Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 | (self.webpackChunkstorybook=self.webpackChunkstorybook||[]).push([[204],{"./stories/Components/Table.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("../../libs/ui/table/public/build/bundle.js");const __WEBPACK_DEFAULT_EXPORT__={title:"Components/Tables"},Default=(({headers,data})=>`\n <jga-ui-table\n headers='${JSON.stringify(headers)}'\n data='${JSON.stringify(data)}'\n ></jga-ui-table>\n `).bind({});Default.args={headers:["Movie Title"],data:[["Star Wars"],["Howard The Duck"],["Americam Graffit"]]},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"({\n headers,\n data\n}) => {\n return `\n <jga-ui-table\n headers='${JSON.stringify(headers)}'\n data='${JSON.stringify(data)}'\n ></jga-ui-table>\n `;\n}",...Default.parameters?.docs?.source}}};const __namedExportsOrder=["Default"]},"../../libs/ui/table/public/build/bundle.js":()=>{!function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function s(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e}function i(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function $(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function h(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function u(){return d(" ")}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function p(t,e){e=""+e,t.data!==e&&(t.data=e)}let b;function g(t){b=t}const v=[],_=[];let y=[];const z=[],w=Promise.resolve();let x=!1;function E(t){y.push(t)}const k=new Set;let O=0;function N(){if(0!==O)return;const t=b;do{try{for(;O<v.length;){const t=v[O];O++,g(t),A(t.$$)}}catch(t){throw v.length=0,O=0,t}for(g(null),v.length=0,O=0;_.length;)_.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(v.length);for(;z.length;)z.pop()();x=!1,k.clear(),g(t)}function A(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(E)}}const j=new Set;function D(t){return void 0!==t?.length?t:Array.from(t)}function C(t,e){-1===t.$$.dirty[0]&&(v.push(t),x||(x=!0,w.then(N)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function L(r,i,l,a,$,h,d=null,u=[-1]){const f=b;g(r);const p=r.$$={fragment:null,ctx:[],props:h,update:t,not_equal:$,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:i.target||f.$$.root};d&&d(p.root);let m=!1;if(p.ctx=l?l(r,i.props||{},((t,e,...n)=>{const s=n.length?n[0]:e;return p.ctx&&$(p.ctx[t],p.ctx[t]=s)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](s),m&&C(r,t)),e})):[],p.update(),m=!0,s(p.before_update),p.fragment=!!a&&a(p.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);p.fragment&&p.fragment.l(t),t.forEach(c)}else p.fragment&&p.fragment.c();i.intro&&(v=r.$$.fragment)&&v.i&&(j.delete(v),v.i(undefined)),function(t,n,r){const{fragment:i,after_update:l}=t.$$;i&&i.m(n,r),E((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):s(n),t.$$.on_mount=[]})),l.forEach(E)}(r,i.target,i.anchor),N()}var v;g(f)}let S;function P(t,e,n,s){const o=n[t]?.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!s||!n[t])return e;if("toAttribute"===s)switch(o){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(S=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=h("slot"),"default"!==t&&f(e,"name",t)},m:function(t,n){a(t,e,n)},d:function(t){t&&c(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const o of this.$$s)o in n&&(e[o]=[t(o)]);for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=P(i,r.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)l in this.$$d||void 0===this[l]||(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=P(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const $ in this.$$l)for(const d of this.$$l[$]){const u=this.$$c.$on($,d);this.$$l_u.set(d,u)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=P(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});class B{$$=void 0;$$set=void 0;$destroy(){(function H(t,e){const n=t.$$;null!==n.fragment&&(function(t){const e=[],n=[];y.forEach((s=>-1===t.indexOf(s)?e.push(s):n.push(s))),n.forEach((t=>t())),y=e}(n.after_update),s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])})(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(n),()=>{const t=s.indexOf(n);-1!==t&&s.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function J(t){!function l(t,e,n){const s=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}(t);if(!s.getElementById(e)){const t=h("style");t.id=e,t.textContent=n,function(t,e){i(t.head||t,e),e.sheet}(s,t)}}(t,"svelte-to63hz",'table.svelte-to63hz.svelte-to63hz{margin:1em 0;min-width:300px}table.svelte-to63hz tr.svelte-to63hz{border-top:1px solid #ddd;border-bottom:1px solid #ddd}table.svelte-to63hz th.svelte-to63hz{display:none}table.svelte-to63hz th.svelte-to63hz,table.svelte-to63hz td.svelte-to63hz{text-align:left}@media(min-width: 480px){table.svelte-to63hz th.svelte-to63hz,table.svelte-to63hz td.svelte-to63hz{display:table-cell;padding:0.25em 0.5em}table.svelte-to63hz th.svelte-to63hz:first-child,table.svelte-to63hz td.svelte-to63hz:first-child{padding-left:0}table.svelte-to63hz th.svelte-to63hz:last-child,table.svelte-to63hz td.svelte-to63hz:last-child{padding-right:0}}table.svelte-to63hz td.svelte-to63hz{display:block}table.svelte-to63hz td.svelte-to63hz:first-child{padding-top:0.5em}table.svelte-to63hz td.svelte-to63hz:last-child{padding-bottom:0.5em}table.svelte-to63hz td.svelte-to63hz::before{content:attr(data-th) ": ";font-weight:bold;width:6.5em;display:inline-block}@media(min-width: 480px){table.svelte-to63hz td.svelte-to63hz::before{display:none}}')}function M(t,e,n){const s=t.slice();return s[4]=e[n],s[6]=n,s}function R(t,e,n){const s=t.slice();return s[7]=e[n],s}function T(t){let e,n,s=t[7]+"";return{c(){e=h("th"),n=d(s),f(e,"class","svelte-to63hz")},m(t,s){a(t,e,s),i(e,n)},p(t,e){1&e&&s!==(s=t[7]+"")&&p(n,s)},d(t){t&&c(e)}}}function q(t){let e,n,s,o,r,l=t[4]+"";return{c(){e=h("tr"),n=h("td"),s=d(l),r=u(),f(n,"data-th",o=t[0][t[6]]),f(n,"class","svelte-to63hz"),f(e,"class","svelte-to63hz")},m(t,o){a(t,e,o),i(e,n),i(n,s),i(e,r)},p(t,e){2&e&&l!==(l=t[4]+"")&&p(s,l),1&e&&o!==(o=t[0][t[6]])&&f(n,"data-th",o)},d(t){t&&c(e)}}}function F(e){let n,s,o,r=D(e[0]),l=[];for(let t=0;t<r.length;t+=1)l[t]=T(R(e,r,t));let d=D(e[1]),p=[];for(let t=0;t<d.length;t+=1)p[t]=q(M(e,d,t));return{c(){n=h("table"),s=h("tr");for(let t=0;t<l.length;t+=1)l[t].c();o=u();for(let t=0;t<p.length;t+=1)p[t].c();f(s,"class","svelte-to63hz"),f(n,"class","svelte-to63hz")},m(t,e){a(t,n,e),i(n,s);for(let t=0;t<l.length;t+=1)l[t]&&l[t].m(s,null);i(n,o);for(let t=0;t<p.length;t+=1)p[t]&&p[t].m(n,null)},p(t,[e]){if(1&e){let n;for(r=D(t[0]),n=0;n<r.length;n+=1){const o=R(t,r,n);l[n]?l[n].p(o,e):(l[n]=T(o),l[n].c(),l[n].m(s,null))}for(;n<l.length;n+=1)l[n].d(1);l.length=r.length}if(3&e){let s;for(d=D(t[1]),s=0;s<d.length;s+=1){const o=M(t,d,s);p[s]?p[s].p(o,e):(p[s]=q(o),p[s].c(),p[s].m(n,null))}for(;s<p.length;s+=1)p[s].d(1);p.length=d.length}},i:t,o:t,d(t){t&&c(n),$(l,t),$(p,t)}}}function I(t,e,n){let{headers:s=[]}=e,{data:o=[]}=e,{tableHeaders:r=[]}=e,{tableData:i=[]}=e;return function m(t){(function(){if(!b)throw new Error("Function called outside component initialization");return b})().$$.on_mount.push(t)}((()=>{n(0,r="string"==typeof s?JSON.parse(s):s),n(1,i="string"==typeof o?JSON.parse(o):o)})),t.$$set=t=>{"headers"in t&&n(2,s=t.headers),"data"in t&&n(3,o=t.data),"tableHeaders"in t&&n(0,r=t.tableHeaders),"tableData"in t&&n(1,i=t.tableData)},[r,i,s,o]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class G extends B{constructor(t){super(),L(this,t,I,F,r,{headers:2,data:3,tableHeaders:0,tableData:1},J)}get headers(){return this.$$.ctx[2]}set headers(t){this.$$set({headers:t}),N()}get data(){return this.$$.ctx[3]}set data(t){this.$$set({data:t}),N()}get tableHeaders(){return this.$$.ctx[0]}set tableHeaders(t){this.$$set({tableHeaders:t}),N()}get tableData(){return this.$$.ctx[1]}set tableData(t){this.$$set({tableData:t}),N()}}customElements.define("jga-ui-table",function(t,e,n,s,o,r){let i=class extends S{constructor(){super(t,n,true),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((t=>(e[t].attribute||t).toLowerCase()))}};return Object.keys(e).forEach((t=>{Object.defineProperty(i.prototype,t,{get(){return this.$$c&&t in this.$$c?this.$$c[t]:this.$$d[t]},set(n){n=P(t,n,e),this.$$d[t]=n,this.$$c?.$set({[t]:n})}})})),[].forEach((t=>{Object.defineProperty(i.prototype,t,{get(){return this.$$c?.[t]}})})),t.element=i,i}(G,{headers:{},data:{},tableHeaders:{},tableData:{}},[]))}()}}]); |