Spaces:
Runtime error
Runtime error
File size: 4,612 Bytes
5f5d58c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
const Example_svelte_svelte_type_style_lang = '';
/* home/runner/work/gradio/gradio/js/fileexplorer/Example.svelte generated by Svelte v4.2.2 */
const {
SvelteComponent,
append,
attr,
destroy_each,
detach,
element,
ensure_array_like,
init,
insert,
noop,
safe_not_equal,
set_data,
space,
text,
toggle_class
} = window.__gradio__svelte__internal;
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[3] = list[i];
return child_ctx;
}
// (11:1) {#each Array.isArray(value) ? value.slice(0, 3) : [value] as path}
function create_each_block(ctx) {
let li;
let code;
let t0;
let t1_value = /*path*/ ctx[3] + "";
let t1;
return {
c() {
li = element("li");
code = element("code");
t0 = text("./");
t1 = text(t1_value);
},
m(target, anchor) {
insert(target, li, anchor);
append(li, code);
append(code, t0);
append(code, t1);
},
p(ctx, dirty) {
if (dirty & /*value*/ 1 && t1_value !== (t1_value = /*path*/ ctx[3] + "")) set_data(t1, t1_value);
},
d(detaching) {
if (detaching) {
detach(li);
}
}
};
}
// (14:1) {#if Array.isArray(value) && value.length > 3}
function create_if_block(ctx) {
let li;
return {
c() {
li = element("li");
li.textContent = "...";
attr(li, "class", "extra svelte-4tf8f");
},
m(target, anchor) {
insert(target, li, anchor);
},
d(detaching) {
if (detaching) {
detach(li);
}
}
};
}
function create_fragment(ctx) {
let ul;
let t;
let show_if = Array.isArray(/*value*/ ctx[0]) && /*value*/ ctx[0].length > 3;
let each_value = ensure_array_like(Array.isArray(/*value*/ ctx[0])
? /*value*/ ctx[0].slice(0, 3)
: [/*value*/ ctx[0]]);
let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
}
let if_block = show_if && create_if_block();
return {
c() {
ul = element("ul");
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
t = space();
if (if_block) if_block.c();
attr(ul, "class", "svelte-4tf8f");
toggle_class(ul, "table", /*type*/ ctx[1] === "table");
toggle_class(ul, "gallery", /*type*/ ctx[1] === "gallery");
toggle_class(ul, "selected", /*selected*/ ctx[2]);
},
m(target, anchor) {
insert(target, ul, anchor);
for (let i = 0; i < each_blocks.length; i += 1) {
if (each_blocks[i]) {
each_blocks[i].m(ul, null);
}
}
append(ul, t);
if (if_block) if_block.m(ul, null);
},
p(ctx, [dirty]) {
if (dirty & /*Array, value*/ 1) {
each_value = ensure_array_like(Array.isArray(/*value*/ ctx[0])
? /*value*/ ctx[0].slice(0, 3)
: [/*value*/ ctx[0]]);
let i;
for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context(ctx, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(ul, t);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (dirty & /*value*/ 1) show_if = Array.isArray(/*value*/ ctx[0]) && /*value*/ ctx[0].length > 3;
if (show_if) {
if (if_block) ; else {
if_block = create_if_block();
if_block.c();
if_block.m(ul, null);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (dirty & /*type*/ 2) {
toggle_class(ul, "table", /*type*/ ctx[1] === "table");
}
if (dirty & /*type*/ 2) {
toggle_class(ul, "gallery", /*type*/ ctx[1] === "gallery");
}
if (dirty & /*selected*/ 4) {
toggle_class(ul, "selected", /*selected*/ ctx[2]);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(ul);
}
destroy_each(each_blocks, detaching);
if (if_block) if_block.d();
}
};
}
function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
let { type } = $$props;
let { selected = false } = $$props;
$$self.$$set = $$props => {
if ('value' in $$props) $$invalidate(0, value = $$props.value);
if ('type' in $$props) $$invalidate(1, type = $$props.type);
if ('selected' in $$props) $$invalidate(2, selected = $$props.selected);
};
return [value, type, selected];
}
class Example extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 });
}
}
export { Example as default };
//# sourceMappingURL=Example-3e057617.js.map
|