1/* empty css */ 2/* home/runner/work/gradio/gradio/js/textbox/Example.svelte generated by Svelte v4.2.2 */ 3const { 4 SvelteComponent, 5 add_iframe_resize_listener, 6 add_render_callback, 7 append, 8 attr, 9 binding_callbacks, 10 detach, 11 element, 12 init, 13 insert, 14 noop, 15 safe_not_equal, 16 set_data, 17 text, 18 toggle_class 19} = window.__gradio__svelte__internal; 20const { onMount } = window.__gradio__svelte__internal; 21function create_fragment(ctx) { 22 let div; 23 let t_value = (/*value*/ ctx[0] ? /*value*/ ctx[0] : "") + ""; 24 let t; 25 let div_resize_listener; 26 27 return { 28 c() { 29 div = element("div"); 30 t = text(t_value); 31 attr(div, "class", "svelte-1viwdyg"); 32 add_render_callback(() => /*div_elementresize_handler*/ ctx[5].call(div)); 33 toggle_class(div, "table", /*type*/ ctx[1] === "table"); 34 toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery"); 35 toggle_class(div, "selected", /*selected*/ ctx[2]); 36 }, 37 m(target, anchor) { 38 insert(target, div, anchor); 39 append(div, t); 40 div_resize_listener = add_iframe_resize_listener(div, /*div_elementresize_handler*/ ctx[5].bind(div)); 41 /*div_binding*/ ctx[6](div); 42 }, 43 p(ctx, [dirty]) { 44 if (dirty & /*value*/ 1 && t_value !== (t_value = (/*value*/ ctx[0] ? /*value*/ ctx[0] : "") + "")) set_data(t, t_value); 45 46 if (dirty & /*type*/ 2) { 47 toggle_class(div, "table", /*type*/ ctx[1] === "table"); 48 } 49 50 if (dirty & /*type*/ 2) { 51 toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery"); 52 } 53 54 if (dirty & /*selected*/ 4) { 55 toggle_class(div, "selected", /*selected*/ ctx[2]); 56 } 57 }, 58 i: noop, 59 o: noop, 60 d(detaching) { 61 if (detaching) { 62 detach(div); 63 } 64 65 div_resize_listener(); 66 /*div_binding*/ ctx[6](null); 67 } 68 }; 69} 70 71function instance($$self, $$props, $$invalidate) { 72 let { value } = $$props; 73 let { type } = $$props; 74 let { selected = false } = $$props; 75 let size; 76 let el; 77 78 function set_styles(element, el_width) { 79 if (!element || !el_width) return; 80 el.style.setProperty("--local-text-width", `${el_width < 150 ? el_width : 200}px`); 81 $$invalidate(4, el.style.whiteSpace = "unset", el); 82 } 83 84 onMount(() => { 85 set_styles(el, size); 86 }); 87 88 function div_elementresize_handler() { 89 size = this.clientWidth; 90 $$invalidate(3, size); 91 } 92 93 function div_binding($$value) { 94 binding_callbacks[$$value ? 'unshift' : 'push'](() => { 95 el = $$value; 96 $$invalidate(4, el); 97 }); 98 } 99 100 $$self.$$set = $$props => {
101 if ('value' in $$props) $$invalidate(0, value = $$props.value); 102 if ('type' in $$props) $$invalidate(1, type = $$props.type); 103 if ('selected' in $$props) $$invalidate(2, selected = $$props.selected); 104 }; 105 106 return [value, type, selected, size, el, div_elementresize_handler, div_binding]; 107} 108 109class Example extends SvelteComponent { 110 constructor(options) { 111 super(); 112 init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 }); 113 } 114} 115 116export { Example as default }; 117//# sourceMappingURL=Example-e0df15d4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.