Spaces:
Runtime error
Runtime error
File size: 4,970 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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
import { I as Info } from './Info-b271c224.js';
import './Button-ab11cb83.js';
/* home/runner/work/gradio/gradio/js/atoms/src/BlockTitle.svelte generated by Svelte v4.2.2 */
const {
SvelteComponent,
attr,
check_outros,
create_component,
create_slot,
destroy_component,
detach,
element,
empty,
get_all_dirty_from_scope,
get_slot_changes,
group_outros,
init,
insert,
mount_component,
safe_not_equal,
set_data,
space,
text,
toggle_class,
transition_in,
transition_out,
update_slot_base
} = window.__gradio__svelte__internal;
function create_if_block(ctx) {
let info_1;
let current;
info_1 = new Info({
props: {
$$slots: { default: [create_default_slot] },
$$scope: { ctx }
}
});
return {
c() {
create_component(info_1.$$.fragment);
},
m(target, anchor) {
mount_component(info_1, target, anchor);
current = true;
},
p(ctx, dirty) {
const info_1_changes = {};
if (dirty & /*$$scope, info*/ 10) {
info_1_changes.$$scope = { dirty, ctx };
}
info_1.$set(info_1_changes);
},
i(local) {
if (current) return;
transition_in(info_1.$$.fragment, local);
current = true;
},
o(local) {
transition_out(info_1.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(info_1, detaching);
}
};
}
// (15:1) <Info>
function create_default_slot(ctx) {
let t;
return {
c() {
t = text(/*info*/ ctx[1]);
},
m(target, anchor) {
insert(target, t, anchor);
},
p(ctx, dirty) {
if (dirty & /*info*/ 2) set_data(t, /*info*/ ctx[1]);
},
d(detaching) {
if (detaching) {
detach(t);
}
}
};
}
function create_fragment(ctx) {
let span;
let t;
let if_block_anchor;
let current;
const default_slot_template = /*#slots*/ ctx[2].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null);
let if_block = /*info*/ ctx[1] && create_if_block(ctx);
return {
c() {
span = element("span");
if (default_slot) default_slot.c();
t = space();
if (if_block) if_block.c();
if_block_anchor = empty();
attr(span, "data-testid", "block-info");
attr(span, "class", "svelte-1gfkn6j");
toggle_class(span, "sr-only", !/*show_label*/ ctx[0]);
toggle_class(span, "hide", !/*show_label*/ ctx[0]);
toggle_class(span, "has-info", /*info*/ ctx[1] != null);
},
m(target, anchor) {
insert(target, span, anchor);
if (default_slot) {
default_slot.m(span, null);
}
insert(target, t, anchor);
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
current = true;
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 8)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[3],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[3])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[3], dirty, null),
null
);
}
}
if (!current || dirty & /*show_label*/ 1) {
toggle_class(span, "sr-only", !/*show_label*/ ctx[0]);
}
if (!current || dirty & /*show_label*/ 1) {
toggle_class(span, "hide", !/*show_label*/ ctx[0]);
}
if (!current || dirty & /*info*/ 2) {
toggle_class(span, "has-info", /*info*/ ctx[1] != null);
}
if (/*info*/ ctx[1]) {
if (if_block) {
if_block.p(ctx, dirty);
if (dirty & /*info*/ 2) {
transition_in(if_block, 1);
}
} else {
if_block = create_if_block(ctx);
if_block.c();
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
group_outros();
transition_out(if_block, 1, 1, () => {
if_block = null;
});
check_outros();
}
},
i(local) {
if (current) return;
transition_in(default_slot, local);
transition_in(if_block);
current = true;
},
o(local) {
transition_out(default_slot, local);
transition_out(if_block);
current = false;
},
d(detaching) {
if (detaching) {
detach(span);
detach(t);
detach(if_block_anchor);
}
if (default_slot) default_slot.d(detaching);
if (if_block) if_block.d(detaching);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
let { show_label = true } = $$props;
let { info = undefined } = $$props;
$$self.$$set = $$props => {
if ('show_label' in $$props) $$invalidate(0, show_label = $$props.show_label);
if ('info' in $$props) $$invalidate(1, info = $$props.info);
if ('$$scope' in $$props) $$invalidate(3, $$scope = $$props.$$scope);
};
return [show_label, info, slots, $$scope];
}
class BlockTitle extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { show_label: 0, info: 1 });
}
}
export { BlockTitle as B };
//# sourceMappingURL=BlockTitle-05ec971b.js.map
|