@abgov/web-components 1.0.0-alpha.152 → 1.0.0-alpha.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/web-components.es.js +1 -1
- package/web-components.umd.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/web-components",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.153",
|
|
4
4
|
"description": "Government of Alberta - UI Web components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/GovAlta/ui-components/issues"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"svelte-check": "^2.0.0",
|
|
44
44
|
"svelte-preprocess": "^4.0.0",
|
|
45
45
|
"tslib": "^2.0.0",
|
|
46
|
-
"typescript": "^4.0.0"
|
|
46
|
+
"typescript": "^4.0.0",
|
|
47
|
+
"vite-plugin-replace": "^0.1.1"
|
|
47
48
|
}
|
|
48
49
|
}
|
package/web-components.es.js
CHANGED
|
@@ -13495,7 +13495,7 @@ function instance$3($$self, $$props, $$invalidate) {
|
|
|
13495
13495
|
class Table extends SvelteElement {
|
|
13496
13496
|
constructor(options) {
|
|
13497
13497
|
super();
|
|
13498
|
-
this.shadowRoot.innerHTML = `<style>:host{overflow-x:auto}table{border-collapse:collapse}table.sticky{position:relative}table.sticky thead{position:sticky;top:0}td{padding:0.75rem 1rem;border-bottom:1px solid var(--goa-color-greyscale-200);
|
|
13498
|
+
this.shadowRoot.innerHTML = `<style>:host{overflow-x:auto}table{border-collapse:collapse}table.sticky{position:relative}table.sticky thead{position:sticky;top:0}td{font:var(--goa-typography-body-m);padding:0.75rem 1rem;border-bottom:1px solid var(--goa-color-greyscale-200)}table .goa-table-number-column{font:var(--goa-typography-number-m);text-align:right}table.relaxed td{padding:1rem}th{background-color:var(--goa-color-greyscale-white);color:var(--goa-color-text-secondary);padding:1rem;text-align:left;border-bottom:2px solid var(--goa-color-greyscale-700);vertical-align:bottom}th:has(goa-table-sort-header){padding:0}tfoot td{background-color:var(--goa-color-greyscale-100)}tfoot tr:first-child td{border-top:2px solid var(--goa-color-greyscale-200)}tfoot tr:last-child td{border-bottom:none}</style>`;
|
|
13499
13499
|
|
|
13500
13500
|
init(
|
|
13501
13501
|
this,
|
package/web-components.umd.js
CHANGED
|
@@ -105,7 +105,7 @@ var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`@im
|
|
|
105
105
|
`),O(e,"sticky",i[7])},m(l,o){p(l,e,o),m(e,t),m(e,r),m(e,a),i[9](e)},p(l,[o]){o&2&&u(e,"class",l[1]),o&61&&n!==(n=`
|
|
106
106
|
${l[0]?`width: ${l[0]};`:""}
|
|
107
107
|
${Z(l[2],l[3],l[4],l[5])}
|
|
108
|
-
`)&&u(e,"style",n),o&130&&O(e,"sticky",l[7])},i:x,o:x,d(l){l&&E(e),i[9](null)}}}function _n(i,e,t){let r;const[a,n]=W("Table variant",["normal","relaxed"],!0);let{width:l=""}=e,{stickyheader:o="false"}=e,{variant:s="normal"}=e,{mt:c=null}=e,{mr:d=null}=e,{mb:f=null}=e,{ml:h=null}=e,k;q(()=>{n(s),y();const w=k.querySelector("slot");if(!w||w.assignedElements().length===0)return;const v=w.assignedElements()[0].querySelectorAll("template table > *");k.append(...v.length>0?v:w.assignedElements())});async function y(){await ge();const w=k.querySelectorAll("goa-table-sort-header");w.forEach(v=>{v.addEventListener("click",()=>{const z=v.getAttribute("name");let D;w.forEach(T=>{if(T.getAttribute("name")===z){const A=T.getAttribute("direction")==="desc"?"asc":"desc";D=A==="asc"?1:-1,T.setAttribute("direction",A)}else T.setAttribute("direction","none")}),v.dispatchEvent(new CustomEvent("_sort",{composed:!0,bubbles:!1,cancelable:!0,detail:{sortBy:z,sortDir:D}}))})})}function _(w){te[w?"unshift":"push"](()=>{k=w,t(6,k)})}return i.$$set=w=>{"width"in w&&t(0,l=w.width),"stickyheader"in w&&t(8,o=w.stickyheader),"variant"in w&&t(1,s=w.variant),"mt"in w&&t(2,c=w.mt),"mr"in w&&t(3,d=w.mr),"mb"in w&&t(4,f=w.mb),"ml"in w&&t(5,h=w.ml)},i.$$.update=()=>{i.$$.dirty&256&&t(7,r=Q(o))},[l,s,c,d,f,h,k,r,o,_]}class kn extends P{constructor(e){super();this.shadowRoot.innerHTML="<style>:host{overflow-x:auto}table{border-collapse:collapse}table.sticky{position:relative}table.sticky thead{position:sticky;top:0}td{padding:0.75rem 1rem;border-bottom:1px solid var(--goa-color-greyscale-200);
|
|
108
|
+
`)&&u(e,"style",n),o&130&&O(e,"sticky",l[7])},i:x,o:x,d(l){l&&E(e),i[9](null)}}}function _n(i,e,t){let r;const[a,n]=W("Table variant",["normal","relaxed"],!0);let{width:l=""}=e,{stickyheader:o="false"}=e,{variant:s="normal"}=e,{mt:c=null}=e,{mr:d=null}=e,{mb:f=null}=e,{ml:h=null}=e,k;q(()=>{n(s),y();const w=k.querySelector("slot");if(!w||w.assignedElements().length===0)return;const v=w.assignedElements()[0].querySelectorAll("template table > *");k.append(...v.length>0?v:w.assignedElements())});async function y(){await ge();const w=k.querySelectorAll("goa-table-sort-header");w.forEach(v=>{v.addEventListener("click",()=>{const z=v.getAttribute("name");let D;w.forEach(T=>{if(T.getAttribute("name")===z){const A=T.getAttribute("direction")==="desc"?"asc":"desc";D=A==="asc"?1:-1,T.setAttribute("direction",A)}else T.setAttribute("direction","none")}),v.dispatchEvent(new CustomEvent("_sort",{composed:!0,bubbles:!1,cancelable:!0,detail:{sortBy:z,sortDir:D}}))})})}function _(w){te[w?"unshift":"push"](()=>{k=w,t(6,k)})}return i.$$set=w=>{"width"in w&&t(0,l=w.width),"stickyheader"in w&&t(8,o=w.stickyheader),"variant"in w&&t(1,s=w.variant),"mt"in w&&t(2,c=w.mt),"mr"in w&&t(3,d=w.mr),"mb"in w&&t(4,f=w.mb),"ml"in w&&t(5,h=w.ml)},i.$$.update=()=>{i.$$.dirty&256&&t(7,r=Q(o))},[l,s,c,d,f,h,k,r,o,_]}class kn extends P{constructor(e){super();this.shadowRoot.innerHTML="<style>:host{overflow-x:auto}table{border-collapse:collapse}table.sticky{position:relative}table.sticky thead{position:sticky;top:0}td{font:var(--goa-typography-body-m);padding:0.75rem 1rem;border-bottom:1px solid var(--goa-color-greyscale-200)}table .goa-table-number-column{font:var(--goa-typography-number-m);text-align:right}table.relaxed td{padding:1rem}th{background-color:var(--goa-color-greyscale-white);color:var(--goa-color-text-secondary);padding:1rem;text-align:left;border-bottom:2px solid var(--goa-color-greyscale-700);vertical-align:bottom}th:has(goa-table-sort-header){padding:0}tfoot td{background-color:var(--goa-color-greyscale-100)}tfoot tr:first-child td{border-top:2px solid var(--goa-color-greyscale-200)}tfoot tr:last-child td{border-bottom:none}</style>",Y(this,{target:this.shadowRoot,props:G(this.attributes),customElement:!0},_n,wn,B,{width:0,stickyheader:8,variant:1,mt:2,mr:3,mb:4,ml:5},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),g()))}static get observedAttributes(){return["width","stickyheader","variant","mt","mr","mb","ml"]}get width(){return this.$$.ctx[0]}set width(e){this.$$set({width:e}),g()}get stickyheader(){return this.$$.ctx[8]}set stickyheader(e){this.$$set({stickyheader:e}),g()}get variant(){return this.$$.ctx[1]}set variant(e){this.$$set({variant:e}),g()}get mt(){return this.$$.ctx[2]}set mt(e){this.$$set({mt:e}),g()}get mr(){return this.$$.ctx[3]}set mr(e){this.$$set({mr:e}),g()}get mb(){return this.$$.ctx[4]}set mb(e){this.$$set({mb:e}),g()}get ml(){return this.$$.ctx[5]}set ml(e){this.$$set({ml:e}),g()}}customElements.define("goa-table",kn);function pn(i){let e,t;return{c(){e=b("img"),u(e,"alt",i[0]),u(e,"class",i[0]),xe(e.src,t="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcK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SIjYWRhZGFkIgogICAgICAgaWQ9InBhdGgzMzUiCiAgICAgICBzdHlsZT0ic3Ryb2tlLXdpZHRoOjAuMjY0NTgzIiAvPgogICAgPHBhdGgKICAgICAgIGQ9Ik0gMTMuMzM2NDk0LDEwLjg3MTk2OCAxMS42MDI4ODksOC44NDg4OTY2IGMgLTAuMDI3OTQsLTAuMDMyNTkgLTAuMDYyNjEsLTAuMDU4NzUgLTAuMTAxNjExLC0wLjA3NjY5IC0wLjAzOSwtMC4wMTc5NCAtMC4wODE0MywtMC4wMjcyMiAtMC4xMjQzNTksLTAuMDI3MjIgLTAuMDQyOTMsMCAtMC4wODUzNSwwLjAwOTMgLTAuMTI0MzYsMC4wMjcyMiAtMC4wMzkwMSwwLjAxNzk0IC0wLjA3MzY3LDAuMDQ0MSAtMC4xMDE2MTMsMC4wNzY2OSBMIDkuNDE3MzQ3MSwxMC44NzE5NjggYyAtMC4xNjU0NDcsMC4xOTMxMDMgLTAuMDI4MjgsMC40OTEzNzkgMC4yMjU5NzEsMC40OTEzNzkgaCAzLjQ2NzY5NzkgYyAwLjI1NDIzOCwwIDAuMzkxNDI1LC0wLjI5ODI3NiAwLjIyNTQ3OCwtMC40OTEzNzkgeiIKICAgICAgIGZpbGw9IiNhZGFkYWQiCiAgICAgICBpZD0icGF0aDIiCiAgICAgICBzdHlsZT0ic3Ryb2tlLXdpZHRoOjAuMjY0NTgzIiAvPgogIDwvZz4KPC9zdmc+Cg==")||u(e,"src",t)},m(r,a){p(r,e,a)},p:x,d(r){r&&E(e)}}}function zn(i){let e,t,r;function a(o,s){return o[0]==="none"?xn:pn}let n=a(i),l=n(i);return{c(){e=b("button"),t=b("slot"),r=j(),l.c(),this.c=x},m(o,s){p(o,e,s),m(e,t),m(e,r),l.m(e,null)},p(o,[s]){n===(n=a(o))&&l?l.p(o,s):(l.d(1),l=n(o),l&&(l.c(),l.m(e,null)))},i:x,o:x,d(o){o&&E(e),l.d()}}}function Mn(i,e,t){let{direction:r="none"}=e;return i.$$set=a=>{"direction"in a&&t(0,r=a.direction)},[r]}class Cn extends P{constructor(e){super();this.shadowRoot.innerHTML="<style>:host{display:flex;align-items:flex-end}button{border:none;background:none;display:flex;font-family:inherit;font-size:inherit;font-weight:inherit;color:inherit;padding:1rem;width:100%;height:100%;text-align:left;gap:0.25rem;align-items:flex-end;justify-content:stretch}button *{align-self:flex-end}img{width:16px;height:22px;scale:0.7}button:hover{background-color:var(--goa-color-greyscale-100);cursor:pointer;color:var(--goa-color-interactive-default)}img.asc{transform:rotate(180deg)}</style>",Y(this,{target:this.shadowRoot,props:G(this.attributes),customElement:!0},Mn,zn,B,{direction:0},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),g()))}static get observedAttributes(){return["direction"]}get direction(){return this.$$.ctx[0]}set direction(e){this.$$set({direction:e}),g()}}customElements.define("goa-table-sort-header",Cn);function En(i){let e,t,r,a,n,l,o;return{c(){e=b("div"),t=b("textarea"),a=j(),this.c=x,u(t,"name",i[0]),u(t,"placeholder",i[2]),t.value=i[1],u(t,"rows",i[3]),u(t,"aria-label",r=i[6]||i[0]),u(t,"class","goa-textarea"),t.disabled=i[12],t.readOnly=i[13],u(t,"data-testid",i[4]),O(t,"error",i[14]),u(e,"class","container"),u(e,"style",n=`
|
|
109
109
|
${Z(i[7],i[8],i[9],i[10])};
|
|
110
110
|
--width: ${i[5]};
|
|
111
111
|
`)},m(s,c){p(s,e,c),m(e,t),m(e,a),l||(o=U(t,"keyup",i[15]),l=!0)},p(s,[c]){c&1&&u(t,"name",s[0]),c&4&&u(t,"placeholder",s[2]),c&2&&(t.value=s[1]),c&8&&u(t,"rows",s[3]),c&65&&r!==(r=s[6]||s[0])&&u(t,"aria-label",r),c&4096&&(t.disabled=s[12]),c&8192&&(t.readOnly=s[13]),c&16&&u(t,"data-testid",s[4]),c&16384&&O(t,"error",s[14]),c&1952&&n!==(n=`
|