mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.5 KiB
78 lines
1.5 KiB
/* generated by Svelte vX.Y.Z */
|
|
import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal.js";
|
|
|
|
function create_fragment(component, ctx) {
|
|
var input, current, dispose;
|
|
|
|
return {
|
|
c() {
|
|
input = createElement("input");
|
|
setAttribute(input, "type", "range");
|
|
|
|
dispose = [
|
|
addListener(input, "change", ctx.input_change_input_handler),
|
|
addListener(input, "input", ctx.input_change_input_handler)
|
|
];
|
|
},
|
|
|
|
m(target, anchor) {
|
|
insert(target, input, anchor);
|
|
|
|
input.value = ctx.value;
|
|
|
|
current = true;
|
|
},
|
|
|
|
p(changed, ctx) {
|
|
if (changed.value) input.value = ctx.value;
|
|
},
|
|
|
|
i(target, anchor) {
|
|
if (current) return;
|
|
this.m(target, anchor);
|
|
},
|
|
|
|
o: run,
|
|
|
|
d(detach) {
|
|
if (detach) {
|
|
detachNode(input);
|
|
}
|
|
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
|
|
function define($$self, $$props, $$make_dirty) {
|
|
let { value } = $$props;
|
|
|
|
function input_change_input_handler() {
|
|
value = toNumber(this.value);
|
|
$$make_dirty('value');
|
|
}
|
|
|
|
$$self.$$.get = () => ({ value, input_change_input_handler });
|
|
|
|
$$self.$$.set = $$props => {
|
|
if ('value' in $$props) value = $$props.value;
|
|
};
|
|
}
|
|
|
|
class SvelteComponent extends SvelteComponent_1 {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, define, create_fragment, safe_not_equal);
|
|
}
|
|
|
|
get value() {
|
|
return this.$$.get().value;
|
|
}
|
|
|
|
set value(value) {
|
|
this.$set({ value: value });
|
|
flush();
|
|
}
|
|
}
|
|
|
|
export default SvelteComponent; |