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

71 lines
1.3 KiB

5 years ago
/* generated by Svelte vX.Y.Z */
6 years ago
import {
SvelteComponent,
6 years ago
attr,
detach,
element,
init,
insert,
listen,
noop,
run_all,
safe_not_equal,
set_input_value,
6 years ago
to_number
} from "svelte/internal";
function create_fragment(ctx) {
let input;
let dispose;
return {
c() {
6 years ago
input = element("input");
attr(input, "type", "range");
},
m(target, anchor) {
insert(target, input, anchor);
set_input_value(input, /*value*/ ctx[0]);
dispose = [
listen(input, "change", /*input_change_input_handler*/ ctx[1]),
listen(input, "input", /*input_change_input_handler*/ ctx[1])
];
},
p(ctx, [dirty]) {
if (dirty & /*value*/ 1) {
set_input_value(input, /*value*/ ctx[0]);
}
},
i: noop,
o: noop,
6 years ago
d(detaching) {
if (detaching) detach(input);
run_all(dispose);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
function input_change_input_handler() {
6 years ago
value = to_number(this.value);
$$invalidate(0, value);
}
6 years ago
$$self.$set = $$props => {
if ("value" in $$props) $$invalidate(0, value = $$props.value);
};
return [value, input_change_input_handler];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { value: 0 });
}
}
export default Component;