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-files/expected.js

75 lines
1.4 KiB

/* generated by Svelte vX.Y.Z */
import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js";
function create_fragment(component, ctx) {
var input, input_updating = false, current, dispose;
return {
c() {
input = createElement("input");
setAttribute(input, "type", "file");
input.multiple = true;
dispose = addListener(input, "input", ctx.input_input_handler);
},
m(target, anchor) {
insert(target, input, anchor);
input.files = ctx.files;
current = true;
},
p(changed, ctx) {
if (!input_updating && changed.files) input.files = ctx.files;
},
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) {
if (detach) {
detachNode(input);
}
dispose();
}
};
}
function define($$self, $$props, $$make_dirty) {
let { files } = $$props;
function input_input_handler() {
files = this.files;
$$make_dirty('files');
}
$$self.$$.get = () => ({ files, input_input_handler });
$$self.$$.set = $$props => {
if ('files' in $$props) files = $$props.files;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get files() {
return this.$$.get().files;
}
set files(value) {
this.$set({ files: value });
flush();
}
}
export default SvelteComponent;