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

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";
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 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) 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;