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.
svelte/test/js/samples/input-range/expected.js

72 lines
1.4 KiB

/* generated by Svelte vX.Y.Z */
import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal";
function create_fragment(ctx) {
var input, 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;
},
p(changed, ctx) {
if (changed.value) input.value = ctx.value;
},
i: noop,
o: noop,
d(detach) {
if (detach) {
detachNode(input);
}
run_all(dispose);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
function input_change_input_handler() {
value = toNumber(this.value);
$$invalidate('value', value);
}
$$self.$set = $$props => {
if ('value' in $$props) $$invalidate('value', value = $$props.value);
};
return { value, input_change_input_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal);
}
get value() {
return this.$$.ctx.value;
}
set value(value) {
this.$set({ value });
flush();
}
}
export default SvelteComponent;