Spaces:
Runtime error
Runtime error
File size: 4,241 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 |
const Example_svelte_svelte_type_style_lang = '';
/* home/runner/work/gradio/gradio/js/checkboxgroup/Example.svelte generated by Svelte v4.2.2 */
const {
SvelteComponent,
attr,
destroy_each,
detach,
element,
empty,
ensure_array_like,
init,
insert,
noop,
safe_not_equal,
set_data,
text,
toggle_class
} = window.__gradio__svelte__internal;
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[3] = list[i];
child_ctx[5] = i;
return child_ctx;
}
// (11:50) {#if i !== value.length - 1}
function create_if_block(ctx) {
let t;
return {
c() {
t = text(", ");
},
m(target, anchor) {
insert(target, t, anchor);
},
d(detaching) {
if (detaching) {
detach(t);
}
}
};
}
// (11:1) {#each value as check, i}
function create_each_block(ctx) {
let t_value = /*check*/ ctx[3].toLocaleString() + "";
let t;
let if_block_anchor;
let if_block = /*i*/ ctx[5] !== /*value*/ ctx[0].length - 1 && create_if_block();
return {
c() {
t = text(t_value);
if (if_block) if_block.c();
if_block_anchor = empty();
},
m(target, anchor) {
insert(target, t, anchor);
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
},
p(ctx, dirty) {
if (dirty & /*value*/ 1 && t_value !== (t_value = /*check*/ ctx[3].toLocaleString() + "")) set_data(t, t_value);
if (/*i*/ ctx[5] !== /*value*/ ctx[0].length - 1) {
if (if_block) ; else {
if_block = create_if_block();
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d(detaching) {
if (detaching) {
detach(t);
detach(if_block_anchor);
}
if (if_block) if_block.d(detaching);
}
};
}
function create_fragment(ctx) {
let div;
let each_value = ensure_array_like(/*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));
}
return {
c() {
div = element("div");
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
attr(div, "class", "svelte-1ayixqk");
toggle_class(div, "table", /*type*/ ctx[1] === "table");
toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
toggle_class(div, "selected", /*selected*/ ctx[2]);
},
m(target, anchor) {
insert(target, div, anchor);
for (let i = 0; i < each_blocks.length; i += 1) {
if (each_blocks[i]) {
each_blocks[i].m(div, null);
}
}
},
p(ctx, [dirty]) {
if (dirty & /*value*/ 1) {
each_value = ensure_array_like(/*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(div, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (dirty & /*type*/ 2) {
toggle_class(div, "table", /*type*/ ctx[1] === "table");
}
if (dirty & /*type*/ 2) {
toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
}
if (dirty & /*selected*/ 4) {
toggle_class(div, "selected", /*selected*/ ctx[2]);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
destroy_each(each_blocks, detaching);
}
};
}
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-5a888e08.js.map
|