Spaces:
Runtime error
Runtime error
import './Button-ab11cb83.js'; | |
/* home/runner/work/gradio/gradio/js/atoms/src/Empty.svelte generated by Svelte v4.2.2 */ | |
const { | |
SvelteComponent, | |
append, | |
attr, | |
binding_callbacks, | |
create_slot, | |
detach, | |
element, | |
get_all_dirty_from_scope, | |
get_slot_changes, | |
init, | |
insert, | |
safe_not_equal, | |
toggle_class, | |
transition_in, | |
transition_out, | |
update_slot_base | |
} = window.__gradio__svelte__internal; | |
function create_fragment(ctx) { | |
let div1; | |
let div0; | |
let current; | |
const default_slot_template = /*#slots*/ ctx[5].default; | |
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null); | |
return { | |
c() { | |
div1 = element("div"); | |
div0 = element("div"); | |
if (default_slot) default_slot.c(); | |
attr(div0, "class", "icon svelte-1oiin9d"); | |
attr(div1, "class", "empty svelte-1oiin9d"); | |
attr(div1, "aria-label", "Empty value"); | |
toggle_class(div1, "small", /*size*/ ctx[0] === "small"); | |
toggle_class(div1, "large", /*size*/ ctx[0] === "large"); | |
toggle_class(div1, "unpadded_box", /*unpadded_box*/ ctx[1]); | |
toggle_class(div1, "small_parent", /*parent_height*/ ctx[3]); | |
}, | |
m(target, anchor) { | |
insert(target, div1, anchor); | |
append(div1, div0); | |
if (default_slot) { | |
default_slot.m(div0, null); | |
} | |
/*div1_binding*/ ctx[6](div1); | |
current = true; | |
}, | |
p(ctx, [dirty]) { | |
if (default_slot) { | |
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) { | |
update_slot_base( | |
default_slot, | |
default_slot_template, | |
ctx, | |
/*$$scope*/ ctx[4], | |
!current | |
? get_all_dirty_from_scope(/*$$scope*/ ctx[4]) | |
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null), | |
null | |
); | |
} | |
} | |
if (!current || dirty & /*size*/ 1) { | |
toggle_class(div1, "small", /*size*/ ctx[0] === "small"); | |
} | |
if (!current || dirty & /*size*/ 1) { | |
toggle_class(div1, "large", /*size*/ ctx[0] === "large"); | |
} | |
if (!current || dirty & /*unpadded_box*/ 2) { | |
toggle_class(div1, "unpadded_box", /*unpadded_box*/ ctx[1]); | |
} | |
if (!current || dirty & /*parent_height*/ 8) { | |
toggle_class(div1, "small_parent", /*parent_height*/ ctx[3]); | |
} | |
}, | |
i(local) { | |
if (current) return; | |
transition_in(default_slot, local); | |
current = true; | |
}, | |
o(local) { | |
transition_out(default_slot, local); | |
current = false; | |
}, | |
d(detaching) { | |
if (detaching) { | |
detach(div1); | |
} | |
if (default_slot) default_slot.d(detaching); | |
/*div1_binding*/ ctx[6](null); | |
} | |
}; | |
} | |
function instance($$self, $$props, $$invalidate) { | |
let parent_height; | |
let { $$slots: slots = {}, $$scope } = $$props; | |
let { size = "small" } = $$props; | |
let { unpadded_box = false } = $$props; | |
let el; | |
function compare_el_to_parent(el) { | |
if (!el) return false; | |
const { height: el_height } = el.getBoundingClientRect(); | |
const { height: parent_height } = el.parentElement?.getBoundingClientRect() || { height: el_height }; | |
return el_height > parent_height + 2; | |
} | |
function div1_binding($$value) { | |
binding_callbacks[$$value ? 'unshift' : 'push'](() => { | |
el = $$value; | |
$$invalidate(2, el); | |
}); | |
} | |
$$self.$$set = $$props => { | |
if ('size' in $$props) $$invalidate(0, size = $$props.size); | |
if ('unpadded_box' in $$props) $$invalidate(1, unpadded_box = $$props.unpadded_box); | |
if ('$$scope' in $$props) $$invalidate(4, $$scope = $$props.$$scope); | |
}; | |
$$self.$$.update = () => { | |
if ($$self.$$.dirty & /*el*/ 4) { | |
$$invalidate(3, parent_height = compare_el_to_parent(el)); | |
} | |
}; | |
return [size, unpadded_box, el, parent_height, $$scope, slots, div1_binding]; | |
} | |
class Empty extends SvelteComponent { | |
constructor(options) { | |
super(); | |
init(this, options, instance, create_fragment, safe_not_equal, { size: 0, unpadded_box: 1 }); | |
} | |
} | |
export { Empty as E }; | |
//# sourceMappingURL=Empty-fef21b7d.js.map | |