@kyndryl-design-system/shidoka-applications 2.47.3 → 2.47.5
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/components/reusable/button/button.d.ts +10 -0
- package/components/reusable/button/button.d.ts.map +1 -1
- package/components/reusable/button/button.js +8 -3
- package/components/reusable/button/button.js.map +1 -1
- package/components/reusable/table/table-header.d.ts +1 -1
- package/components/reusable/table/table-header.d.ts.map +1 -1
- package/components/reusable/table/table-header.js.map +1 -1
- package/components/reusable/table/table-row.d.ts +1 -1
- package/components/reusable/table/table-row.d.ts.map +1 -1
- package/components/reusable/table/table-row.js.map +1 -1
- package/components/reusable/table/table.d.ts +1 -1
- package/components/reusable/table/table.d.ts.map +1 -1
- package/components/reusable/widget/sample/gridstack.newWidget.sample.d.ts +6 -0
- package/components/reusable/widget/sample/gridstack.newWidget.sample.d.ts.map +1 -1
- package/package.json +2 -2
- package/table-CCYJ3J_m.js.map +1 -1
|
@@ -81,6 +81,16 @@ export declare class Button extends LitElement {
|
|
|
81
81
|
* @internal
|
|
82
82
|
*/
|
|
83
83
|
accessor _btnEl: any;
|
|
84
|
+
/** Aligns button text and icon at the edges when `kyn-button` has a set width.*/
|
|
85
|
+
accessor splitLayout: boolean;
|
|
86
|
+
/** Determines _hasIcon state
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
accessor _hasIcon: boolean;
|
|
90
|
+
/** Determines _hasText state
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
accessor _hasText: boolean;
|
|
84
94
|
render(): import("lit-html").TemplateResult<1>;
|
|
85
95
|
private handleClick;
|
|
86
96
|
private _testIconOnly;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/button/button.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAa,MAAM,KAAK,CAAC;AAalD,OAAO,EAC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qDAAqD;IAErD,QAAQ,CAAC,YAAY,UAAS;IAE9B,6BAA6B;IAE7B,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;OAEG;IAEH,QAAQ,CAAC,WAAW,UAAS;IAE7B;;OAEG;IAEH,QAAQ,CAAC,UAAU,UAAS;IAE5B,0BAA0B;IAE1B,QAAQ,CAAC,UAAU,EAAG,GAAG,CAAC;IAE1B;;OAEG;IAEH,QAAQ,CAAC,WAAW,EAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC;;OAEG;IAEH,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAE/B;;OAEG;IAEH,QAAQ,CAAC,MAAM,EAAG,GAAG,CAAC;IAEtB,iFAAiF;IAEjF,QAAQ,CAAC,WAAW,UAAS;IAE7B;;OAEG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;OAEG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAEjB,MAAM;IAmEf,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,iBAAiB;IAWzB,gBAAgB;IAChB,OAAO,CAAC,eAAe,CAGpB;IAEH,gBAAgB;IAChB,OAAO,CAAC,aAAa;IASrB,gBAAgB;IAChB,OAAO,CAAC,eAAe,CAIpB;IAEH,gBAAgB;IAChB,OAAO,CAAC,aAAa;IAQZ,iBAAiB;IAQjB,oBAAoB;CAO9B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAC;KACtB;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t,a as e,b as o,c as r,d as a}from"../../../vendor/tslib-Ac8XvvSX.js";import{i as
|
|
1
|
+
import{_ as t,a as e,b as o,c as r,d as a}from"../../../vendor/tslib-Ac8XvvSX.js";import{i as s,a as n,t as i,r as d,n as c,b as l,o as b,e as u}from"../../../vendor/@lit/reactive-element-f91Vet7N.js";import{e as k,b as h,x as v}from"../../../vendor/lit-html-BRBT5o_V.js";import{i as g}from"../../../vendor/lit-element-m-OqzV5s.js";import{debounce as p}from"../../../common/helpers/helpers.js";import{BUTTON_TYPES as m,BUTTON_KINDS as y,BUTTON_SIZES as f,BUTTON_ICON_POSITION as x,BUTTON_KINDS_OUTLINE as w,BUTTON_KINDS_SOLID as _}from"./defs.js";var S=s`/**
|
|
2
2
|
* Copyright Kyndryl, Inc. 2023
|
|
3
3
|
*/
|
|
4
4
|
*,
|
|
@@ -447,7 +447,12 @@ import{_ as t,a as e,b as o,c as r,d as a}from"../../../vendor/tslib-Ac8XvvSX.js
|
|
|
447
447
|
}
|
|
448
448
|
.kd-btn--icon-align slot[name=icon]::slotted(*) {
|
|
449
449
|
display: flex;
|
|
450
|
-
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.kd-btn--splitLayout span {
|
|
453
|
+
flex: 1;
|
|
454
|
+
justify-content: space-between;
|
|
455
|
+
}`;let z=(()=>{var s,z,E,M,O,B,W,$,C,I,L,P,T,j,F,R,A,U,N,q,D,H,X,Y;let G,K,J,Q,V,Z,tt,et,ot,rt,at,st,nt,it,dt,ct,lt,bt,ut,kt,ht,vt,gt,pt,mt,yt,ft=[i("kyn-button")],xt=[],wt=g,_t=[],St=[],zt=[],Et=[],Mt=[],Ot=[],Bt=[],Wt=[],$t=[],Ct=[],It=[],Lt=[],Pt=[],Tt=[],jt=[],Ft=[],Rt=[],At=[],Ut=[],Nt=[],qt=[],Dt=[],Ht=[],Xt=[],Yt=[],Gt=[],Kt=[],Jt=[],Qt=[],Vt=[],Zt=[],te=[],ee=[],oe=[],re=[],ae=[],se=[],ne=[],ie=[],de=[],ce=[],le=[],be=[],ue=[],ke=[],he=[],ve=[],ge=[];return K=class extends wt{constructor(){super(...arguments),s.set(this,o(this,_t,this.attachInternals())),z.set(this,(o(this,St),o(this,zt,""))),E.set(this,(o(this,Et),o(this,Mt,m.BUTTON))),M.set(this,(o(this,Ot),o(this,Bt,y.PRIMARY))),O.set(this,(o(this,Wt),o(this,$t,""))),B.set(this,(o(this,Ct),o(this,It,"_self"))),W.set(this,(o(this,Lt),o(this,Pt,f.MEDIUM))),$.set(this,(o(this,Tt),o(this,jt,x.CENTER))),C.set(this,(o(this,Ft),o(this,Rt,!1))),I.set(this,(o(this,At),o(this,Ut,!1))),L.set(this,(o(this,Nt),o(this,qt,""))),P.set(this,(o(this,Dt),o(this,Ht,""))),T.set(this,(o(this,Xt),o(this,Yt,!1))),j.set(this,(o(this,Gt),o(this,Kt,!1))),F.set(this,(o(this,Jt),o(this,Qt,!1))),R.set(this,(o(this,Vt),o(this,Zt,!1))),A.set(this,(o(this,te),o(this,ee,!1))),U.set(this,(o(this,oe),o(this,re,void 0))),N.set(this,(o(this,ae),o(this,se,void 0))),q.set(this,(o(this,ne),o(this,ie,void 0))),D.set(this,(o(this,de),o(this,ce,void 0))),H.set(this,(o(this,le),o(this,be,!1))),X.set(this,(o(this,ue),o(this,ke,!1))),Y.set(this,(o(this,he),o(this,ve,!1))),this._debounceResize=(o(this,ge),p((()=>{this._reSizeButton(),this.iconOnly=this._testIconOnly()}))),this._debounceScroll=p((()=>{this.showOnScroll&&this._handleScroll()}))}get internals(){return r(this,s,"f")}set internals(t){a(this,s,t,"f")}get description(){return r(this,z,"f")}set description(t){a(this,z,t,"f")}get type(){return r(this,E,"f")}set type(t){a(this,E,t,"f")}get kind(){return r(this,M,"f")}set kind(t){a(this,M,t,"f")}get href(){return r(this,O,"f")}set href(t){a(this,O,t,"f")}get target(){return r(this,B,"f")}set target(t){a(this,B,t,"f")}get size(){return r(this,W,"f")}set size(t){a(this,W,t,"f")}get iconPosition(){return r(this,$,"f")}set iconPosition(t){a(this,$,t,"f")}get iconOnly(){return r(this,C,"f")}set iconOnly(t){a(this,C,t,"f")}get disabled(){return r(this,I,"f")}set disabled(t){a(this,I,t,"f")}get value(){return r(this,L,"f")}set value(t){a(this,L,t,"f")}get name(){return r(this,P,"f")}set name(t){a(this,P,t,"f")}get isFloating(){return r(this,T,"f")}set isFloating(t){a(this,T,t,"f")}get showOnScroll(){return r(this,j,"f")}set showOnScroll(t){a(this,j,t,"f")}get selected(){return r(this,F,"f")}set selected(t){a(this,F,t,"f")}get _showButton(){return r(this,R,"f")}set _showButton(t){a(this,R,t,"f")}get _reSizeBtn(){return r(this,A,"f")}set _reSizeBtn(t){a(this,A,t,"f")}get formmethod(){return r(this,U,"f")}set formmethod(t){a(this,U,t,"f")}get _slottedEls(){return r(this,N,"f")}set _slottedEls(t){a(this,N,t,"f")}get _iconEls(){return r(this,q,"f")}set _iconEls(t){a(this,q,t,"f")}get _btnEl(){return r(this,D,"f")}set _btnEl(t){a(this,D,t,"f")}get splitLayout(){return r(this,H,"f")}set splitLayout(t){a(this,H,t,"f")}get _hasIcon(){return r(this,X,"f")}set _hasIcon(t){a(this,X,t,"f")}get _hasText(){return r(this,Y,"f")}set _hasText(t){a(this,Y,t,"f")}render(){var t,e;const o={"kd-btn":!0,[`kd-btn--${this.kind}`]:!0,"kd-btn--solid-styles":_.includes(this.kind),"kd-btn--outline-styles":w.includes(this.kind),"kd-btn--large":this.size===f.LARGE,"kd-btn--small":this.size===f.SMALL,"kd-btn--medium":this._reSizeBtn||this.size===f.MEDIUM,"kd-btn--icon-align":!!this.iconPosition,[`kd-btn--icon-${this.iconPosition}`]:!!this.iconPosition&&!this.iconOnly,"kd-btn--icon-center":(null===(t=this._iconEls)||void 0===t?void 0:t.length)&&this.iconOnly,"kd-btn--float":this.isFloating,"kd-btn--hidden":this.showOnScroll&&!this._showButton,"icon-only":(null===(e=this._iconEls)||void 0===e?void 0:e.length)&&this.iconOnly,selected:this.selected,"kd-btn--splitLayout":this.splitLayout&&this._hasIcon&&this._hasText};return v`
|
|
451
456
|
${this.href&&""!==this.href?v`
|
|
452
457
|
<a
|
|
453
458
|
part="button"
|
|
@@ -489,5 +494,5 @@ import{_ as t,a as e,b as o,c as r,d as a}from"../../../vendor/tslib-Ac8XvvSX.js
|
|
|
489
494
|
</span>
|
|
490
495
|
</button>
|
|
491
496
|
`}
|
|
492
|
-
`}handleClick(t){this.internals.form&&("submit"===this.type?this.internals.form.requestSubmit():"reset"===this.type&&this.internals.form.reset());const e=new CustomEvent("on-click",{detail:{origEvent:t}});this.dispatchEvent(e)}_testIconOnly(){var t,e;if(!(null===(t=this._iconEls)||void 0===t?void 0:t.length))return!1;return!(null===(e=this._slottedEls)||void 0===e?void 0:e.filter((t=>""!==t.textContent.trim()))).filter((t=>{if(t.tagName){const e=getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility}return!0})).length}_handleSlotChange(){this.iconOnly=this._testIconOnly(),this.requestUpdate()}_reSizeButton(){(this.isFloating||this.showOnScroll)&&window.innerWidth<=672?this._reSizeBtn=!0:this._reSizeBtn=!1}_handleScroll(){const t=window.scrollY,e=window.innerHeight,o=document.documentElement.scrollHeight;this._showButton=t>(o-e)/2}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._debounceResize),this.showOnScroll&&window.addEventListener("scroll",this._debounceScroll)}disconnectedCallback(){window.removeEventListener("resize",this._debounceResize),this.showOnScroll&&window.removeEventListener("scroll",this._debounceScroll),super.disconnectedCallback()}},
|
|
497
|
+
`}handleClick(t){this.internals.form&&("submit"===this.type?this.internals.form.requestSubmit():"reset"===this.type&&this.internals.form.reset());const e=new CustomEvent("on-click",{detail:{origEvent:t}});this.dispatchEvent(e)}_testIconOnly(){var t,e;if(!(null===(t=this._iconEls)||void 0===t?void 0:t.length))return!1;return!(null===(e=this._slottedEls)||void 0===e?void 0:e.filter((t=>""!==t.textContent.trim()))).filter((t=>{if(t.tagName){const e=getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility}return!0})).length}_handleSlotChange(){var t,e;this.iconOnly=this._testIconOnly(),this._hasIcon=!!(null===(t=this._iconEls)||void 0===t?void 0:t.length);const o=null===(e=this._slottedEls)||void 0===e?void 0:e.filter((t=>""!==t.textContent.trim()));this._hasText=o.length>0,this.requestUpdate()}_reSizeButton(){(this.isFloating||this.showOnScroll)&&window.innerWidth<=672?this._reSizeBtn=!0:this._reSizeBtn=!1}_handleScroll(){const t=window.scrollY,e=window.innerHeight,o=document.documentElement.scrollHeight;this._showButton=t>(o-e)/2}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._debounceResize),this.showOnScroll&&window.addEventListener("scroll",this._debounceScroll)}disconnectedCallback(){window.removeEventListener("resize",this._debounceResize),this.showOnScroll&&window.removeEventListener("scroll",this._debounceScroll),super.disconnectedCallback()}},s=new WeakMap,z=new WeakMap,E=new WeakMap,M=new WeakMap,O=new WeakMap,B=new WeakMap,W=new WeakMap,$=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,P=new WeakMap,T=new WeakMap,j=new WeakMap,F=new WeakMap,R=new WeakMap,A=new WeakMap,U=new WeakMap,N=new WeakMap,q=new WeakMap,D=new WeakMap,H=new WeakMap,X=new WeakMap,Y=new WeakMap,t(K,"Button"),(()=>{var t;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=wt[Symbol.metadata])&&void 0!==t?t:null):void 0;J=[n()],Q=[c({type:String})],V=[c({type:String})],Z=[c({type:String})],tt=[c({type:String})],et=[c({type:String})],ot=[c({type:String})],rt=[c({type:String})],at=[n()],st=[c({type:Boolean,reflect:!0})],nt=[c({type:String})],it=[c({type:String})],dt=[c({type:Boolean})],ct=[c({type:Boolean})],lt=[c({type:Boolean})],bt=[n()],ut=[n()],kt=[c({type:String})],ht=[l()],vt=[b({slot:"icon"})],gt=[u(".button")],pt=[c({type:Boolean})],mt=[n()],yt=[n()],e(K,null,J,{kind:"accessor",name:"internals",static:!1,private:!1,access:{has:t=>"internals"in t,get:t=>t.internals,set:(t,e)=>{t.internals=e}},metadata:o},_t,St),e(K,null,Q,{kind:"accessor",name:"description",static:!1,private:!1,access:{has:t=>"description"in t,get:t=>t.description,set:(t,e)=>{t.description=e}},metadata:o},zt,Et),e(K,null,V,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:o},Mt,Ot),e(K,null,Z,{kind:"accessor",name:"kind",static:!1,private:!1,access:{has:t=>"kind"in t,get:t=>t.kind,set:(t,e)=>{t.kind=e}},metadata:o},Bt,Wt),e(K,null,tt,{kind:"accessor",name:"href",static:!1,private:!1,access:{has:t=>"href"in t,get:t=>t.href,set:(t,e)=>{t.href=e}},metadata:o},$t,Ct),e(K,null,et,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:t=>"target"in t,get:t=>t.target,set:(t,e)=>{t.target=e}},metadata:o},It,Lt),e(K,null,ot,{kind:"accessor",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:o},Pt,Tt),e(K,null,rt,{kind:"accessor",name:"iconPosition",static:!1,private:!1,access:{has:t=>"iconPosition"in t,get:t=>t.iconPosition,set:(t,e)=>{t.iconPosition=e}},metadata:o},jt,Ft),e(K,null,at,{kind:"accessor",name:"iconOnly",static:!1,private:!1,access:{has:t=>"iconOnly"in t,get:t=>t.iconOnly,set:(t,e)=>{t.iconOnly=e}},metadata:o},Rt,At),e(K,null,st,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:t=>"disabled"in t,get:t=>t.disabled,set:(t,e)=>{t.disabled=e}},metadata:o},Ut,Nt),e(K,null,nt,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:o},qt,Dt),e(K,null,it,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:o},Ht,Xt),e(K,null,dt,{kind:"accessor",name:"isFloating",static:!1,private:!1,access:{has:t=>"isFloating"in t,get:t=>t.isFloating,set:(t,e)=>{t.isFloating=e}},metadata:o},Yt,Gt),e(K,null,ct,{kind:"accessor",name:"showOnScroll",static:!1,private:!1,access:{has:t=>"showOnScroll"in t,get:t=>t.showOnScroll,set:(t,e)=>{t.showOnScroll=e}},metadata:o},Kt,Jt),e(K,null,lt,{kind:"accessor",name:"selected",static:!1,private:!1,access:{has:t=>"selected"in t,get:t=>t.selected,set:(t,e)=>{t.selected=e}},metadata:o},Qt,Vt),e(K,null,bt,{kind:"accessor",name:"_showButton",static:!1,private:!1,access:{has:t=>"_showButton"in t,get:t=>t._showButton,set:(t,e)=>{t._showButton=e}},metadata:o},Zt,te),e(K,null,ut,{kind:"accessor",name:"_reSizeBtn",static:!1,private:!1,access:{has:t=>"_reSizeBtn"in t,get:t=>t._reSizeBtn,set:(t,e)=>{t._reSizeBtn=e}},metadata:o},ee,oe),e(K,null,kt,{kind:"accessor",name:"formmethod",static:!1,private:!1,access:{has:t=>"formmethod"in t,get:t=>t.formmethod,set:(t,e)=>{t.formmethod=e}},metadata:o},re,ae),e(K,null,ht,{kind:"accessor",name:"_slottedEls",static:!1,private:!1,access:{has:t=>"_slottedEls"in t,get:t=>t._slottedEls,set:(t,e)=>{t._slottedEls=e}},metadata:o},se,ne),e(K,null,vt,{kind:"accessor",name:"_iconEls",static:!1,private:!1,access:{has:t=>"_iconEls"in t,get:t=>t._iconEls,set:(t,e)=>{t._iconEls=e}},metadata:o},ie,de),e(K,null,gt,{kind:"accessor",name:"_btnEl",static:!1,private:!1,access:{has:t=>"_btnEl"in t,get:t=>t._btnEl,set:(t,e)=>{t._btnEl=e}},metadata:o},ce,le),e(K,null,pt,{kind:"accessor",name:"splitLayout",static:!1,private:!1,access:{has:t=>"splitLayout"in t,get:t=>t.splitLayout,set:(t,e)=>{t.splitLayout=e}},metadata:o},be,ue),e(K,null,mt,{kind:"accessor",name:"_hasIcon",static:!1,private:!1,access:{has:t=>"_hasIcon"in t,get:t=>t._hasIcon,set:(t,e)=>{t._hasIcon=e}},metadata:o},ke,he),e(K,null,yt,{kind:"accessor",name:"_hasText",static:!1,private:!1,access:{has:t=>"_hasText"in t,get:t=>t._hasText,set:(t,e)=>{t._hasText=e}},metadata:o},ve,ge),e(null,G={value:K},ft,{kind:"class",name:K.name,metadata:o},null,xt),K=G.value,o&&Object.defineProperty(K,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),K.styles=d(S),K.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},K.formAssociated=!0,o(K,xt),K})();export{z as Button};
|
|
493
498
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../src/components/reusable/button/button.ts"],"sourcesContent":["/**\n * Copyright Kyndryl, Inc. 2023\n */\n\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n query,\n queryAssignedNodes,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { debounce } from '../../../common/helpers/helpers';\n\nimport {\n BUTTON_KINDS,\n BUTTON_SIZES,\n BUTTON_TYPES,\n BUTTON_ICON_POSITION,\n BUTTON_KINDS_SOLID,\n BUTTON_KINDS_OUTLINE,\n} from './defs';\n\nimport stylesheet from './button.scss?inline';\n\n/**\n * Button component.\n *\n * @slot unnamed - Slot for button text.\n * @slot icon - Slot for an icon.\n * @fires on-click - Emits the original click event.\n */\n@customElement('kyn-button')\nexport class Button extends LitElement {\n static override styles = unsafeCSS(stylesheet);\n\n /** @ignore */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Associate the component with forms.\n * @ignore\n */\n static formAssociated = true;\n\n /**\n * Attached internals for form association.\n * @ignore\n */\n @state()\n accessor internals = this.attachInternals();\n\n /** ARIA label for the button for accessibility. */\n @property({ type: String })\n accessor description = '';\n\n /** Type for the <button> element. */\n @property({ type: String })\n accessor type: BUTTON_TYPES = BUTTON_TYPES.BUTTON;\n\n /** Specifies the visual appearance/kind of the button. */\n @property({ type: String })\n accessor kind: BUTTON_KINDS = BUTTON_KINDS.PRIMARY;\n\n /** Converts the button to an <a> tag if specified. */\n @property({ type: String })\n accessor href = '';\n\n /** Link target, only valid if href is supplied. */\n @property({ type: String })\n accessor target = '_self';\n\n /** Specifies the size of the button. */\n @property({ type: String })\n accessor size: BUTTON_SIZES = BUTTON_SIZES.MEDIUM;\n\n /** Specifies the position of the icon relative to any button text. */\n @property({ type: String })\n accessor iconPosition: BUTTON_ICON_POSITION = BUTTON_ICON_POSITION.CENTER;\n\n /** Determines if the button is disabled.\n * @internal\n */\n @state()\n accessor iconOnly = false;\n\n /** Determines if the button is disabled. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /** Button value. */\n @property({ type: String })\n accessor value = '';\n\n /** Button name. */\n @property({ type: String })\n accessor name = '';\n\n /** Determines if the button is Floatable */\n @property({ type: Boolean })\n accessor isFloating = false;\n\n /** Show button after scrolling to 50% of the page */\n @property({ type: Boolean })\n accessor showOnScroll = false;\n\n /** Button selected state. */\n @property({ type: Boolean })\n accessor selected = false;\n\n /** Determines showButton state .\n * @internal\n */\n @state()\n accessor _showButton = false;\n\n /** re-size button to 'medium' at mobile breakpoint.\n * @internal\n */\n @state()\n accessor _reSizeBtn = false;\n\n /** Button formmethod. */\n @property({ type: String })\n accessor formmethod!: any;\n\n /** Queries default slot nodes.\n * @internal\n */\n @queryAssignedNodes()\n accessor _slottedEls!: Array<any>;\n\n /** Queries icon slot nodes.\n * @internal\n */\n @queryAssignedElements({ slot: 'icon' })\n accessor _iconEls!: Array<any>;\n\n /** Queries the .button element.\n * @internal\n */\n @query('.button')\n accessor _btnEl!: any;\n\n override render() {\n const BtnClasses = {\n 'kd-btn': true,\n [`kd-btn--${this.kind}`]: true,\n 'kd-btn--solid-styles': BUTTON_KINDS_SOLID.includes(this.kind),\n 'kd-btn--outline-styles': BUTTON_KINDS_OUTLINE.includes(this.kind),\n 'kd-btn--large': this.size === BUTTON_SIZES.LARGE,\n 'kd-btn--small': this.size === BUTTON_SIZES.SMALL,\n 'kd-btn--medium': this._reSizeBtn || this.size === BUTTON_SIZES.MEDIUM,\n 'kd-btn--icon-align': !!this.iconPosition,\n [`kd-btn--icon-${this.iconPosition}`]:\n !!this.iconPosition && !this.iconOnly,\n [`kd-btn--icon-center`]: this._iconEls?.length && this.iconOnly,\n 'kd-btn--float': this.isFloating,\n 'kd-btn--hidden': this.showOnScroll && !this._showButton,\n 'icon-only': this._iconEls?.length && this.iconOnly,\n selected: this.selected,\n };\n\n return html`\n ${this.href && this.href !== ''\n ? html`\n <a\n part=\"button\"\n class=${classMap(BtnClasses)}\n href=${this.href}\n target=${this.target}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.description)}\n title=${ifDefined(this.description)}\n @click=${(e: Event) => this.handleClick(e)}\n >\n <span>\n <slot @slotchange=${() => this._handleSlotChange()}></slot>\n <slot\n name=\"icon\"\n @slotchange=${() => this._handleSlotChange()}\n ></slot>\n </span>\n </a>\n `\n : html`\n <button\n part=\"button\"\n class=${classMap(BtnClasses)}\n type=${this.type}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.description)}\n title=${ifDefined(this.description)}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n formmethod=${ifDefined(this.formmethod)}\n @click=${(e: Event) => this.handleClick(e)}\n >\n <span>\n <slot @slotchange=${() => this._handleSlotChange()}></slot>\n <slot\n name=\"icon\"\n @slotchange=${() => this._handleSlotChange()}\n ></slot>\n </span>\n </button>\n `}\n `;\n }\n\n private handleClick(e: Event) {\n if (this.internals.form) {\n if (this.type === 'submit') {\n this.internals.form.requestSubmit();\n } else if (this.type === 'reset') {\n this.internals.form.reset();\n }\n }\n\n const event = new CustomEvent('on-click', {\n detail: { origEvent: e },\n });\n this.dispatchEvent(event);\n }\n\n private _testIconOnly() {\n if (!this._iconEls?.length) {\n return false;\n }\n\n const TextNodes = this._slottedEls?.filter((node: any) => {\n return node.textContent.trim() !== '';\n });\n\n const VisibleTextNodes = TextNodes.filter((node: any) => {\n if (node.tagName) {\n const Styles = getComputedStyle(node);\n return Styles.display !== 'none' && Styles.visibility !== 'hidden';\n } else {\n return true;\n }\n });\n\n return !VisibleTextNodes.length;\n }\n\n private _handleSlotChange() {\n this.iconOnly = this._testIconOnly();\n this.requestUpdate();\n }\n\n /** @internal */\n private _debounceResize = debounce(() => {\n this._reSizeButton();\n this.iconOnly = this._testIconOnly();\n });\n\n /** @internal */\n private _reSizeButton() {\n // Resize button to medium at mobile breakpoint\n if ((this.isFloating || this.showOnScroll) && window.innerWidth <= 672) {\n this._reSizeBtn = true;\n } else {\n this._reSizeBtn = false;\n }\n }\n\n /** @internal */\n private _debounceScroll = debounce(() => {\n if (this.showOnScroll) {\n this._handleScroll();\n }\n });\n\n /** @internal */\n private _handleScroll() {\n const scrollPosition = window.scrollY;\n const windowHeight = window.innerHeight;\n const pageHeight = document.documentElement.scrollHeight;\n // Show the button if scrolled 50% of the page\n this._showButton = scrollPosition > (pageHeight - windowHeight) / 2;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this._debounceResize);\n if (this.showOnScroll) {\n window.addEventListener('scroll', this._debounceScroll);\n }\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this._debounceResize);\n if (this.showOnScroll) {\n window.removeEventListener('scroll', this._debounceScroll);\n }\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-button': Button;\n }\n}\n"],"names":["Button","customElement","LitElement","_classThis","_classSuper","_Button_internals_accessor_storage","set","this","__runInitializers","_internals_initializers","attachInternals","_Button_description_accessor_storage","_internals_extraInitializers","_description_initializers","_Button_type_accessor_storage","_description_extraInitializers","_type_initializers","BUTTON_TYPES","BUTTON","_Button_kind_accessor_storage","_type_extraInitializers","_kind_initializers","BUTTON_KINDS","PRIMARY","_Button_href_accessor_storage","_kind_extraInitializers","_href_initializers","_Button_target_accessor_storage","_href_extraInitializers","_target_initializers","_Button_size_accessor_storage","_target_extraInitializers","_size_initializers","BUTTON_SIZES","MEDIUM","_Button_iconPosition_accessor_storage","_size_extraInitializers","_iconPosition_initializers","BUTTON_ICON_POSITION","CENTER","_Button_iconOnly_accessor_storage","_iconPosition_extraInitializers","_iconOnly_initializers","_Button_disabled_accessor_storage","_iconOnly_extraInitializers","_disabled_initializers","_Button_value_accessor_storage","_disabled_extraInitializers","_value_initializers","_Button_name_accessor_storage","_value_extraInitializers","_name_initializers","_Button_isFloating_accessor_storage","_name_extraInitializers","_isFloating_initializers","_Button_showOnScroll_accessor_storage","_isFloating_extraInitializers","_showOnScroll_initializers","_Button_selected_accessor_storage","_showOnScroll_extraInitializers","_selected_initializers","_Button__showButton_accessor_storage","_selected_extraInitializers","__showButton_initializers","_Button__reSizeBtn_accessor_storage","__showButton_extraInitializers","__reSizeBtn_initializers","_Button_formmethod_accessor_storage","__reSizeBtn_extraInitializers","_formmethod_initializers","_Button__slottedEls_accessor_storage","_formmethod_extraInitializers","__slottedEls_initializers","_Button__iconEls_accessor_storage","__slottedEls_extraInitializers","__iconEls_initializers","_Button__btnEl_accessor_storage","__iconEls_extraInitializers","__btnEl_initializers","_debounceResize","__btnEl_extraInitializers","debounce","_reSizeButton","iconOnly","_testIconOnly","_debounceScroll","showOnScroll","_handleScroll","internals","__classPrivateFieldGet","value","__classPrivateFieldSet","description","type","kind","href","target","size","iconPosition","disabled","name","isFloating","selected","_showButton","_reSizeBtn","formmethod","_slottedEls","_iconEls","_btnEl","render","BtnClasses","BUTTON_KINDS_SOLID","includes","BUTTON_KINDS_OUTLINE","LARGE","SMALL","_a","length","_b","html","classMap","ifDefined","e","handleClick","_handleSlotChange","form","requestSubmit","reset","event","CustomEvent","detail","origEvent","dispatchEvent","filter","node","textContent","trim","tagName","Styles","getComputedStyle","display","visibility","requestUpdate","window","innerWidth","scrollPosition","scrollY","windowHeight","innerHeight","pageHeight","document","documentElement","scrollHeight","connectedCallback","super","addEventListener","disconnectedCallback","removeEventListener","_internals_decorators","state","_description_decorators","property","String","_type_decorators","_kind_decorators","_href_decorators","_target_decorators","_size_decorators","_iconPosition_decorators","_iconOnly_decorators","Boolean","reflect","_value_decorators","_name_decorators","_isFloating_decorators","_showOnScroll_decorators","_selected_decorators","__showButton_decorators","__reSizeBtn_decorators","_formmethod_decorators","__slottedEls_decorators","queryAssignedNodes","__iconEls_decorators","queryAssignedElements","slot","query","__esDecorate","static","private","access","has","obj","get","metadata","_metadata","_disabled_decorators","__btnEl_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","stylesheet","shadowRootOptions","delegatesFocus","formAssociated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCaA,EAAM,wHADlBC,EAAc,wBACaC,qQAARC,EAAA,cAAQC,qCAoBjBC,EAAAC,IAAAC,KAAAC,EAAAD,KAAAE,GAAYF,KAAKG,oBAIjBC,EAAAL,IAAAC,MAAAC,EAAAD,KAAAK,IAAAJ,EAAAD,KAAAM,GAAc,MAIdC,EAAAR,IAAAC,MAAAC,EAAAD,KAAAQ,IAAAP,EAAAD,KAAAS,GAAqBC,EAAaC,UAIlCC,EAAAb,IAAAC,MAAAC,EAAAD,KAAAa,I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AAqG,EAARpF,SAAQjB,CAAA,GAAAuG,SAAAC,GAAAvH,GAAAE,IAMjB6G,EAAAvL,EAAA,KAAAiM,GAAA,CAAAtG,KAAA,WAAAM,KAAA,SAAAuF,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAC,IAAAC,GAAA,WAAAA,EAAAC,IAAAD,GAAAA,EAASnF,OAAMtG,IAAA,CAAAyL,EAAArG,KAAAqG,EAANnF,OAAMlB,CAAA,GAAAuG,SAAAC,GAAApH,GAAAE,IAhHjB0G,EAAA,KAAAW,EAAA,CAAA3G,MAAAvF,GAAAmM,GAAA,CAAAxG,KAAA,QAAAM,KAAAjG,EAAAiG,KAAA6F,SAAAC,GAAA,KAAAK,kHACkBpM,EAAAqM,OAASC,EAAUC,GAGnBvM,EAAAwM,kBAAoB,IAC/BzM,EAAWyM,kBACdC,gBAAgB,GAOXzM,EAAA0M,gBAAiB,EAbbrM,EAAAL,EAAAoM,OAAM"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../src/components/reusable/button/button.ts"],"sourcesContent":["/**\n * Copyright Kyndryl, Inc. 2023\n */\n\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n query,\n queryAssignedNodes,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { debounce } from '../../../common/helpers/helpers';\n\nimport {\n BUTTON_KINDS,\n BUTTON_SIZES,\n BUTTON_TYPES,\n BUTTON_ICON_POSITION,\n BUTTON_KINDS_SOLID,\n BUTTON_KINDS_OUTLINE,\n} from './defs';\n\nimport stylesheet from './button.scss?inline';\n\n/**\n * Button component.\n *\n * @slot unnamed - Slot for button text.\n * @slot icon - Slot for an icon.\n * @fires on-click - Emits the original click event.\n */\n@customElement('kyn-button')\nexport class Button extends LitElement {\n static override styles = unsafeCSS(stylesheet);\n\n /** @ignore */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Associate the component with forms.\n * @ignore\n */\n static formAssociated = true;\n\n /**\n * Attached internals for form association.\n * @ignore\n */\n @state()\n accessor internals = this.attachInternals();\n\n /** ARIA label for the button for accessibility. */\n @property({ type: String })\n accessor description = '';\n\n /** Type for the <button> element. */\n @property({ type: String })\n accessor type: BUTTON_TYPES = BUTTON_TYPES.BUTTON;\n\n /** Specifies the visual appearance/kind of the button. */\n @property({ type: String })\n accessor kind: BUTTON_KINDS = BUTTON_KINDS.PRIMARY;\n\n /** Converts the button to an <a> tag if specified. */\n @property({ type: String })\n accessor href = '';\n\n /** Link target, only valid if href is supplied. */\n @property({ type: String })\n accessor target = '_self';\n\n /** Specifies the size of the button. */\n @property({ type: String })\n accessor size: BUTTON_SIZES = BUTTON_SIZES.MEDIUM;\n\n /** Specifies the position of the icon relative to any button text. */\n @property({ type: String })\n accessor iconPosition: BUTTON_ICON_POSITION = BUTTON_ICON_POSITION.CENTER;\n\n /** Determines if the button is disabled.\n * @internal\n */\n @state()\n accessor iconOnly = false;\n\n /** Determines if the button is disabled. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /** Button value. */\n @property({ type: String })\n accessor value = '';\n\n /** Button name. */\n @property({ type: String })\n accessor name = '';\n\n /** Determines if the button is Floatable */\n @property({ type: Boolean })\n accessor isFloating = false;\n\n /** Show button after scrolling to 50% of the page */\n @property({ type: Boolean })\n accessor showOnScroll = false;\n\n /** Button selected state. */\n @property({ type: Boolean })\n accessor selected = false;\n\n /** Determines showButton state .\n * @internal\n */\n @state()\n accessor _showButton = false;\n\n /** re-size button to 'medium' at mobile breakpoint.\n * @internal\n */\n @state()\n accessor _reSizeBtn = false;\n\n /** Button formmethod. */\n @property({ type: String })\n accessor formmethod!: any;\n\n /** Queries default slot nodes.\n * @internal\n */\n @queryAssignedNodes()\n accessor _slottedEls!: Array<any>;\n\n /** Queries icon slot nodes.\n * @internal\n */\n @queryAssignedElements({ slot: 'icon' })\n accessor _iconEls!: Array<any>;\n\n /** Queries the .button element.\n * @internal\n */\n @query('.button')\n accessor _btnEl!: any;\n\n /** Aligns button text and icon at the edges when `kyn-button` has a set width.*/\n @property({ type: Boolean })\n accessor splitLayout = false;\n\n /** Determines _hasIcon state\n * @internal\n */\n @state()\n accessor _hasIcon = false;\n\n /** Determines _hasText state\n * @internal\n */\n @state()\n accessor _hasText = false;\n\n override render() {\n const BtnClasses = {\n 'kd-btn': true,\n [`kd-btn--${this.kind}`]: true,\n 'kd-btn--solid-styles': BUTTON_KINDS_SOLID.includes(this.kind),\n 'kd-btn--outline-styles': BUTTON_KINDS_OUTLINE.includes(this.kind),\n 'kd-btn--large': this.size === BUTTON_SIZES.LARGE,\n 'kd-btn--small': this.size === BUTTON_SIZES.SMALL,\n 'kd-btn--medium': this._reSizeBtn || this.size === BUTTON_SIZES.MEDIUM,\n 'kd-btn--icon-align': !!this.iconPosition,\n [`kd-btn--icon-${this.iconPosition}`]:\n !!this.iconPosition && !this.iconOnly,\n [`kd-btn--icon-center`]: this._iconEls?.length && this.iconOnly,\n 'kd-btn--float': this.isFloating,\n 'kd-btn--hidden': this.showOnScroll && !this._showButton,\n 'icon-only': this._iconEls?.length && this.iconOnly,\n selected: this.selected,\n 'kd-btn--splitLayout': this.splitLayout && this._hasIcon && this._hasText,\n };\n\n return html`\n ${this.href && this.href !== ''\n ? html`\n <a\n part=\"button\"\n class=${classMap(BtnClasses)}\n href=${this.href}\n target=${this.target}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.description)}\n title=${ifDefined(this.description)}\n @click=${(e: Event) => this.handleClick(e)}\n >\n <span>\n <slot @slotchange=${() => this._handleSlotChange()}></slot>\n <slot\n name=\"icon\"\n @slotchange=${() => this._handleSlotChange()}\n ></slot>\n </span>\n </a>\n `\n : html`\n <button\n part=\"button\"\n class=${classMap(BtnClasses)}\n type=${this.type}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.description)}\n title=${ifDefined(this.description)}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n formmethod=${ifDefined(this.formmethod)}\n @click=${(e: Event) => this.handleClick(e)}\n >\n <span>\n <slot @slotchange=${() => this._handleSlotChange()}></slot>\n <slot\n name=\"icon\"\n @slotchange=${() => this._handleSlotChange()}\n ></slot>\n </span>\n </button>\n `}\n `;\n }\n\n private handleClick(e: Event) {\n if (this.internals.form) {\n if (this.type === 'submit') {\n this.internals.form.requestSubmit();\n } else if (this.type === 'reset') {\n this.internals.form.reset();\n }\n }\n\n const event = new CustomEvent('on-click', {\n detail: { origEvent: e },\n });\n this.dispatchEvent(event);\n }\n\n private _testIconOnly() {\n if (!this._iconEls?.length) {\n return false;\n }\n\n const TextNodes = this._slottedEls?.filter((node: any) => {\n return node.textContent.trim() !== '';\n });\n\n const VisibleTextNodes = TextNodes.filter((node: any) => {\n if (node.tagName) {\n const Styles = getComputedStyle(node);\n return Styles.display !== 'none' && Styles.visibility !== 'hidden';\n } else {\n return true;\n }\n });\n\n return !VisibleTextNodes.length;\n }\n\n private _handleSlotChange() {\n this.iconOnly = this._testIconOnly();\n this._hasIcon = !!this._iconEls?.length;\n\n const TextNodes = this._slottedEls?.filter((node: any) => {\n return node.textContent.trim() !== '';\n });\n this._hasText = TextNodes.length > 0;\n this.requestUpdate();\n }\n\n /** @internal */\n private _debounceResize = debounce(() => {\n this._reSizeButton();\n this.iconOnly = this._testIconOnly();\n });\n\n /** @internal */\n private _reSizeButton() {\n // Resize button to medium at mobile breakpoint\n if ((this.isFloating || this.showOnScroll) && window.innerWidth <= 672) {\n this._reSizeBtn = true;\n } else {\n this._reSizeBtn = false;\n }\n }\n\n /** @internal */\n private _debounceScroll = debounce(() => {\n if (this.showOnScroll) {\n this._handleScroll();\n }\n });\n\n /** @internal */\n private _handleScroll() {\n const scrollPosition = window.scrollY;\n const windowHeight = window.innerHeight;\n const pageHeight = document.documentElement.scrollHeight;\n // Show the button if scrolled 50% of the page\n this._showButton = scrollPosition > (pageHeight - windowHeight) / 2;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this._debounceResize);\n if (this.showOnScroll) {\n window.addEventListener('scroll', this._debounceScroll);\n }\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this._debounceResize);\n if (this.showOnScroll) {\n window.removeEventListener('scroll', this._debounceScroll);\n }\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-button': Button;\n }\n}\n"],"names":["Button","customElement","LitElement","_classThis","_classSuper","_Button_internals_accessor_storage","set","this","__runInitializers","_internals_initializers","attachInternals","_Button_description_accessor_storage","_internals_extraInitializers","_description_initializers","_Button_type_accessor_storage","_description_extraInitializers","_type_initializers","BUTTON_TYPES","BUTTON","_Button_kind_accessor_storage","_type_extraInitializers","_kind_initializers","BUTTON_KINDS","PRIMARY","_Button_href_accessor_storage","_kind_extraInitializers","_href_initializers","_Button_target_accessor_storage","_href_extraInitializers","_target_initializers","_Button_size_accessor_storage","_target_extraInitializers","_size_initializers","BUTTON_SIZES","MEDIUM","_Button_iconPosition_accessor_storage","_size_extraInitializers","_iconPosition_initializers","BUTTON_ICON_POSITION","CENTER","_Button_iconOnly_accessor_storage","_iconPosition_extraInitializers","_iconOnly_initializers","_Button_disabled_accessor_storage","_iconOnly_extraInitializers","_disabled_initializers","_Button_value_accessor_storage","_disabled_extraInitializers","_value_initializers","_Button_name_accessor_storage","_value_extraInitializers","_name_initializers","_Button_isFloating_accessor_storage","_name_extraInitializers","_isFloating_initializers","_Button_showOnScroll_accessor_storage","_isFloating_extraInitializers","_showOnScroll_initializers","_Button_selected_accessor_storage","_showOnScroll_extraInitializers","_selected_initializers","_Button__showButton_accessor_storage","_selected_extraInitializers","__showButton_initializers","_Button__reSizeBtn_accessor_storage","__showButton_extraInitializers","__reSizeBtn_initializers","_Button_formmethod_accessor_storage","__reSizeBtn_extraInitializers","_formmethod_initializers","_Button__slottedEls_accessor_storage","_formmethod_extraInitializers","__slottedEls_initializers","_Button__iconEls_accessor_storage","__slottedEls_extraInitializers","__iconEls_initializers","_Button__btnEl_accessor_storage","__iconEls_extraInitializers","__btnEl_initializers","_Button_splitLayout_accessor_storage","__btnEl_extraInitializers","_splitLayout_initializers","_Button__hasIcon_accessor_storage","_splitLayout_extraInitializers","__hasIcon_initializers","_Button__hasText_accessor_storage","__hasIcon_extraInitializers","__hasText_initializers","_debounceResize","__hasText_extraInitializers","debounce","_reSizeButton","iconOnly","_testIconOnly","_debounceScroll","showOnScroll","_handleScroll","internals","__classPrivateFieldGet","value","__classPrivateFieldSet","description","type","kind","href","target","size","iconPosition","disabled","name","isFloating","selected","_showButton","_reSizeBtn","formmethod","_slottedEls","_iconEls","_btnEl","splitLayout","_hasIcon","_hasText","render","BtnClasses","BUTTON_KINDS_SOLID","includes","BUTTON_KINDS_OUTLINE","LARGE","SMALL","_a","length","_b","html","classMap","ifDefined","e","handleClick","_handleSlotChange","form","requestSubmit","reset","event","CustomEvent","detail","origEvent","dispatchEvent","filter","node","textContent","trim","tagName","Styles","getComputedStyle","display","visibility","TextNodes","requestUpdate","window","innerWidth","scrollPosition","scrollY","windowHeight","innerHeight","pageHeight","document","documentElement","scrollHeight","connectedCallback","super","addEventListener","disconnectedCallback","removeEventListener","_internals_decorators","state","_description_decorators","property","String","_type_decorators","_kind_decorators","_href_decorators","_target_decorators","_size_decorators","_iconPosition_decorators","_iconOnly_decorators","Boolean","reflect","_value_decorators","_name_decorators","_isFloating_decorators","_showOnScroll_decorators","_selected_decorators","__showButton_decorators","__reSizeBtn_decorators","_formmethod_decorators","__slottedEls_decorators","queryAssignedNodes","__iconEls_decorators","queryAssignedElements","slot","query","_splitLayout_decorators","__hasIcon_decorators","__hasText_decorators","__esDecorate","static","private","access","has","obj","get","metadata","_metadata","_disabled_decorators","__btnEl_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","stylesheet","shadowRootOptions","delegatesFocus","formAssociated"],"mappings":";;;;;;;;;;;;;;;;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vM,EAAA,KAAAqM,GAAA,CAAAjG,KAAA,WAAAM,KAAA,WAAA8F,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAC,IAAAC,GAAA,aAAAA,EAAAC,IAAAD,GAAAA,EAASxF,SAAQjH,IAAA,CAAAyM,EAAA5G,KAAA4G,EAARxF,SAAQpB,CAAA,GAAA8G,SAAAC,GAAA9H,GAAAE,IAMjBoH,EAAAvM,EAAA,KAAAsM,GAAA,CAAAlG,KAAA,WAAAM,KAAA,WAAA8F,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAC,IAAAC,GAAA,aAAAA,EAAAC,IAAAD,GAAAA,EAASvF,SAAQlH,IAAA,CAAAyM,EAAA5G,KAAA4G,EAARvF,SAAQrB,CAAA,GAAA8G,SAAAC,GAAA3H,GAAAE,IAhInBiH,EAAA,KAAAW,EAAA,CAAAlH,MAAAhG,GAAAmN,GAAA,CAAA/G,KAAA,QAAAM,KAAA1G,EAAA0G,KAAAoG,SAAAC,GAAA,KAAAK,kHACkBpN,EAAAqN,OAASC,EAAUC,GAGnBvN,EAAAwN,kBAAoB,IAC/BzN,EAAWyN,kBACdC,gBAAgB,GAOXzN,EAAA0N,gBAAiB,EAbbrN,EAAAL,EAAAoN,OAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"table-header.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAmB,cAAc,EAAE,MAAM,KAAK,CAAC;AAWlE,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1D;;;;;;;;GAQG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,0BAAqB;IAE3C;;OAEG;IACH,SACkB,IAAI,SAAkB;IAExC,0DAA0D;IAE1D,QAAQ,CAAC,KAAK,UAAS;IAEvB;;;;;;OAMG;IAGH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAO/B;IAEF;;;OAGG;IACH,mBAAmB,GAAI,WAAW,gBAAgB,UAIhD;IAEF;;;OAGG;IAEH,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAyB;IAEzD;;;;OAIG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B,gEAAgE;IAEhE,QAAQ,CAAC,aAAa,EAAE,cAAc,CAA0B;IAEhE;;;OAGG;IAEH,QAAQ,CAAC,WAAW,SAAM;IAE1B;;;;OAIG;IAEH,QAAQ,CAAC,OAAO,SAAM;IAEtB;;;;;;OAMG;IAEH,QAAQ,CAAC,aAAa,UAAS;IAE/B;;;OAGG;IAEH,QAAQ,CAAC,KAAK,SAAM;IAEpB;;;OAGG;IAEH,QAAQ,CAAC,QAAQ,SAAM;IAEvB;;;;OAIG;IAEH,QAAQ,CAAC,QAAQ,SAAM;IAEvB;;OAEG;IAEH,QAAQ,CAAC,SAAS,EAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAEjC;;;OAGG;IACH,SAAS;IAIT;;;OAGG;IAEH,QAAQ,CAAC,aAAa,SAAM;IAE5B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAsClB,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAiBlD,cAAc;IAUL,MAAM;CAiEhB;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,WAAW,CAAC;KACvB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header.js","sources":["../../../../src/components/reusable/table/table-header.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n queryAssignedNodes,\n state,\n} from 'lit/decorators.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { ContextConsumer } from '@lit/context';\nimport { tableContext, TableContextType } from './table-context';\n\nimport arrowUpIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/arrow-up.svg';\nimport styles from './table-header.scss?inline';\n\nimport { SORT_DIRECTION, TABLE_CELL_ALIGN } from './defs';\n\n/**\n * `kyn-th` Web Component.\n *\n * Represents a custom table header cell (`<th>`) for Shidoka's design system tables.\n * Provides sorting functionality when enabled and allows alignment customization.\n *\n * @fires on-sort-changed - Dispatched when the sort direction is changed.\n * @slot unnamed - The content slot for adding header text or content.\n */\n@customElement('kyn-th')\nexport class TableHeader extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'columnheader';\n\n /** Determines if the cell should have a denser layout. */\n @property({ type: Boolean, reflect: true })\n accessor dense = false;\n\n /**\n * Context consumer for the table context.\n * Updates the cell's dense properties when the context changes.\n * @private\n * @ignore\n * @type {ContextConsumer<TableContextType, TableHeader>}\n */\n @state()\n // @ts-expect-error - This is a context consumer\n private accessor _contextConsumer = new ContextConsumer(\n this,\n tableContext,\n (context) => {\n if (context) this.handleContextChange(context);\n },\n true\n );\n\n /**\n * Updates the cell's dense properties when the context changes.\n * @param {TableContextType} context - The updated context.\n */\n handleContextChange = ({ dense }: TableContextType) => {\n if (typeof dense == 'boolean') {\n this.dense = dense;\n }\n };\n\n /**\n * Specifies the alignment of the content within the table header.\n * Options: 'left', 'center', 'right'\n */\n @property({ type: String, reflect: true })\n accessor align: TABLE_CELL_ALIGN = TABLE_CELL_ALIGN.LEFT;\n\n /**\n * Specifies if the column is sortable.\n * If set to true, an arrow icon will be displayed unpon hover,\n * allowing the user to toggle sort directions.\n */\n @property({ type: Boolean, reflect: true })\n accessor sortable = false;\n\n /** Specifies the direction of sorting applied to the column. */\n @property({ type: String, reflect: true })\n accessor sortDirection: SORT_DIRECTION = SORT_DIRECTION.DEFAULT;\n\n /**\n * The textual content associated with this component.\n * Represents the primary content or label that will be displayed.\n */\n @property({ type: String })\n accessor headerLabel = '';\n\n /**\n * The unique identifier representing this column header.\n * Used to distinguish between different sortable columns and\n * to ensure that only one column is sorted at a time.\n */\n @property({ type: String })\n accessor sortKey = '';\n\n /**\n * Determines whether the content should be hidden from visual view but remain accessible\n * to screen readers for accessibility purposes. When set to `true`, the content\n * will not be visibly shown, but its content can still be read by screen readers.\n * This is especially useful for providing additional context or information to\n * assistive technologies without cluttering the visual UI.\n */\n @property({ type: Boolean })\n accessor visiblyHidden = false;\n\n /**\n * Sets a fixed width for the cell.\n * Accepts standard CSS width values (e.g., '150px', '50%').\n */\n @property({ type: String, reflect: true })\n accessor width = '';\n\n /**\n * Sets a maximum width for the cell.\n * Accepts standard CSS width values (e.g., '150px', '50%').\n */\n @property({ type: String, reflect: true })\n accessor maxWidth = '';\n\n /**\n * Sets a minimum width for the cell;\n * Accepts standard CSS width values (e.g., '150px', '50%').\n * @type {string}\n */\n @property({ type: String, reflect: true })\n accessor minWidth = '';\n\n /**\n * @ignore\n */\n @queryAssignedNodes({ flatten: true })\n accessor listItems!: Array<Node>;\n\n /**\n * Resets the sorting direction of the component to its default state.\n * Useful for initializing or clearing any applied sorting on the element.\n */\n resetSort() {\n this.sortDirection = SORT_DIRECTION.DEFAULT;\n }\n\n /**\n * Assistive text for screen readers.\n * @ignore\n */\n @state()\n accessor assistiveText = '';\n\n /**\n * Toggles the sort direction between ascending, descending, and default states.\n * It also dispatches an event to notify parent components of the sorting change.\n */\n private toggleSortDirection() {\n if (!this.sortKey) {\n console.error('sortKey is missing for a sortable column.');\n return;\n }\n\n switch (this.sortDirection) {\n case SORT_DIRECTION.DEFAULT:\n case SORT_DIRECTION.DESC: {\n this.sortDirection = SORT_DIRECTION.ASC;\n const assistiveText1 = `Column header ${this.sortKey} sorted in ascending order`;\n this.assistiveText =\n this.assistiveText === '' || this.assistiveText === assistiveText1\n ? `${assistiveText1}.`\n : assistiveText1;\n break;\n }\n case SORT_DIRECTION.ASC: {\n this.sortDirection = SORT_DIRECTION.DESC;\n const assistiveText2 = `Column header ${this.sortKey} sorted in descending order`;\n this.assistiveText =\n this.assistiveText === '' || this.assistiveText === assistiveText2\n ? `${assistiveText2}.`\n : assistiveText2;\n break;\n }\n }\n\n // Dispatch event to notify parent components of the sorting change\n this.dispatchEvent(\n new CustomEvent('on-sort-changed', {\n bubbles: true,\n composed: true,\n detail: { sortDirection: this.sortDirection, sortKey: this.sortKey },\n })\n );\n }\n\n override updated(changedProperties: PropertyValues) {\n this.getTextContent();\n\n super.updated(changedProperties);\n if (this.maxWidth && changedProperties.has('maxWidth')) {\n this.style.setProperty('--kyn-th-max-width', this.maxWidth);\n }\n\n if (this.width && changedProperties.has('width')) {\n this.style.setProperty('--kyn-th-width', this.width);\n }\n\n if (this.minWidth && changedProperties.has('minWidth')) {\n this.style.setProperty('--kyn-th-min-width', this.minWidth);\n }\n }\n\n getTextContent() {\n const nonWhitespaceNodes = this.listItems.filter((node) => {\n return (\n node?.nodeType !== Node.TEXT_NODE || node?.textContent?.trim() !== ''\n );\n });\n\n this.headerLabel = nonWhitespaceNodes[0]?.textContent || '';\n }\n\n override render() {\n const iconClasses = {\n 'sort-icon': true,\n 'sort-icon--sorting': this.sortDirection !== SORT_DIRECTION.DEFAULT,\n 'sort-icon--sorting-asc': this.sortDirection === SORT_DIRECTION.ASC,\n 'sort-icon--sorting-desc': this.sortDirection === SORT_DIRECTION.DESC,\n };\n\n const slotClasses = {\n 'slot-wrapper': true,\n 'sr-only': this.visiblyHidden,\n };\n\n /**\n * Accessibility Enhancements:\n * - role: Sets the appropriate role for interactive headers (e.g., when sortable).\n * - ariaSort: Indicates the sorting direction to assistive technologies.\n * - ariaLabel: Provides a descriptive label to assistive technologies for sortable headers.\n * - tabIndex: Enables keyboard interaction for sortable headers.\n * - onKeyDown: Handles keyboard events for sortable headers to allow sorting via the keyboard.\n */\n const role = this.sortable ? 'button' : undefined;\n // const arialSort = this.sortable ? this.sortDirection : undefined;\n const ariaLabel =\n this.sortable && this.headerLabel\n ? `Sort by ${this.headerLabel}`\n : undefined;\n const tabIndex = this.sortable ? 0 : undefined;\n const onKeyDown = this.sortable\n ? (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n this.toggleSortDirection();\n }\n }\n : undefined;\n\n return html`\n <div\n class=\"container\"\n role=${ifDefined(role)}\n @click=${this.sortable ? () => this.toggleSortDirection() : undefined}\n aria-label=${ifDefined(ariaLabel)}\n tabindex=${ifDefined(tabIndex)}\n @keydown=${onKeyDown}\n >\n <div class=${classMap(slotClasses)}>\n <slot></slot>\n </div>\n ${this.sortable\n ? html`<span class=${classMap(iconClasses)}\n >${unsafeSVG(arrowUpIcon)}</span\n >`\n : null}\n\n <div\n class=\"assistive-text\"\n role=\"status\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n >\n ${this.assistiveText}\n </div>\n </div>\n `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-th': TableHeader;\n }\n}\n"],"names":["TableHeader","customElement","LitElement","_classThis","_classSuper","role","__classPrivateFieldGet","this","_TableHeader_role_accessor_storage","value","__classPrivateFieldSet","dense","_TableHeader_dense_accessor_storage","_contextConsumer","_TableHeader__contextConsumer_accessor_storage","align","_TableHeader_align_accessor_storage","sortable","_TableHeader_sortable_accessor_storage","sortDirection","_TableHeader_sortDirection_accessor_storage","headerLabel","_TableHeader_headerLabel_accessor_storage","sortKey","_TableHeader_sortKey_accessor_storage","visiblyHidden","_TableHeader_visiblyHidden_accessor_storage","width","_TableHeader_width_accessor_storage","maxWidth","_TableHeader_maxWidth_accessor_storage","minWidth","_TableHeader_minWidth_accessor_storage","listItems","_TableHeader_listItems_accessor_storage","resetSort","SORT_DIRECTION","DEFAULT","assistiveText","_TableHeader_assistiveText_accessor_storage","toggleSortDirection","DESC","ASC","assistiveText1","assistiveText2","dispatchEvent","CustomEvent","bubbles","composed","detail","console","error","updated","changedProperties","getTextContent","super","has","style","setProperty","nonWhitespaceNodes","filter","node","nodeType","Node","TEXT_NODE","_a","textContent","trim","render","iconClasses","slotClasses","undefined","ariaLabel","tabIndex","onKeyDown","e","key","html","ifDefined","classMap","unsafeSVG","arrowUpIcon","set","__runInitializers","_role_initializers","_role_extraInitializers","_dense_initializers","_dense_extraInitializers","__contextConsumer_initializers","ContextConsumer","tableContext","context","handleContextChange","_align_initializers","TABLE_CELL_ALIGN","LEFT","_align_extraInitializers","_sortable_initializers","_sortable_extraInitializers","_sortDirection_initializers","_sortDirection_extraInitializers","_headerLabel_initializers","_headerLabel_extraInitializers","_sortKey_initializers","_sortKey_extraInitializers","_visiblyHidden_initializers","_visiblyHidden_extraInitializers","_width_initializers","_width_extraInitializers","_maxWidth_initializers","_maxWidth_extraInitializers","_minWidth_initializers","_minWidth_extraInitializers","_listItems_initializers","_listItems_extraInitializers","_assistiveText_initializers","property","type","String","reflect","Boolean","__contextConsumer_decorators","state","_headerLabel_decorators","_sortKey_decorators","_visiblyHidden_decorators","_listItems_decorators","queryAssignedNodes","flatten","_assistiveText_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_dense_decorators","__contextConsumer_extraInitializers","_align_decorators","_sortable_decorators","_sortDirection_decorators","_width_decorators","_maxWidth_decorators","_minWidth_decorators","_assistiveText_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAMjBkB,EAAA/H,EAAA,KAAA2H,EAAA,CAAAM,KAAA,WAAAC,KAAA,YAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAhF,IAAAiF,GAAA,cAAAA,EAAAC,IAAAD,GAAAA,EAASxG,UAASiD,IAAA,CAAAuD,EAAAhI,KAAAgI,EAATxG,UAASxB,CAAA,GAAAkI,SAAAC,GAAA3B,GAAAC,IAelBgB,EAAA/H,EAAA,KAAA8H,EAAA,CAAAG,KAAA,WAAAC,KAAA,gBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAhF,IAAAiF,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAASnG,cAAa4C,IAAA,CAAAuD,EAAAhI,KAAAgI,EAAbnG,cAAa7B,CAAA,GAAAkI,SAAAC,GAAAzB,GAAAkC,IA9HxBnB,EAAA,KAAAoB,EAAA,CAAA7I,MAAAN,GAAAoJ,EAAA,CAAAnB,KAAA,QAAAC,KAAAlI,EAAAkI,KAAAM,SAAAC,GAAA,KAAAY,iHACkBrJ,EAAAsJ,OAASC,EAAUD,GADxBtE,EAAAhF,EAAAqJ,MAAW"}
|
|
1
|
+
{"version":3,"file":"table-header.js","sources":["../../../../src/components/reusable/table/table-header.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS, PropertyValues } from 'lit';\nimport {\n customElement,\n property,\n queryAssignedNodes,\n state,\n} from 'lit/decorators.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { ContextConsumer } from '@lit/context';\nimport { tableContext, TableContextType } from './table-context';\n\nimport arrowUpIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/arrow-up.svg';\nimport styles from './table-header.scss?inline';\n\nimport { SORT_DIRECTION, TABLE_CELL_ALIGN } from './defs';\n\n/**\n * `kyn-th` Web Component.\n *\n * Represents a custom table header cell (`<th>`) for Shidoka's design system tables.\n * Provides sorting functionality when enabled and allows alignment customization.\n *\n * @fires on-sort-changed - Dispatched when the sort direction is changed.\n * @slot unnamed - The content slot for adding header text or content.\n */\n@customElement('kyn-th')\nexport class TableHeader extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'columnheader';\n\n /** Determines if the cell should have a denser layout. */\n @property({ type: Boolean, reflect: true })\n accessor dense = false;\n\n /**\n * Context consumer for the table context.\n * Updates the cell's dense properties when the context changes.\n * @private\n * @ignore\n * @type {ContextConsumer<TableContextType, TableHeader>}\n */\n @state()\n // @ts-expect-error - This is a context consumer\n private accessor _contextConsumer = new ContextConsumer(\n this,\n tableContext,\n (context) => {\n if (context) this.handleContextChange(context);\n },\n true\n );\n\n /**\n * Updates the cell's dense properties when the context changes.\n * @param {TableContextType} context - The updated context.\n */\n handleContextChange = ({ dense }: TableContextType) => {\n if (typeof dense == 'boolean') {\n this.dense = dense;\n }\n };\n\n /**\n * Specifies the alignment of the content within the table header.\n * Options: 'left', 'center', 'right'\n */\n @property({ type: String, reflect: true })\n accessor align: TABLE_CELL_ALIGN = TABLE_CELL_ALIGN.LEFT;\n\n /**\n * Specifies if the column is sortable.\n * If set to true, an arrow icon will be displayed unpon hover,\n * allowing the user to toggle sort directions.\n */\n @property({ type: Boolean, reflect: true })\n accessor sortable = false;\n\n /** Specifies the direction of sorting applied to the column. */\n @property({ type: String, reflect: true })\n accessor sortDirection: SORT_DIRECTION = SORT_DIRECTION.DEFAULT;\n\n /**\n * The textual content associated with this component.\n * Represents the primary content or label that will be displayed.\n */\n @property({ type: String })\n accessor headerLabel = '';\n\n /**\n * The unique identifier representing this column header.\n * Used to distinguish between different sortable columns and\n * to ensure that only one column is sorted at a time.\n */\n @property({ type: String })\n accessor sortKey = '';\n\n /**\n * Determines whether the content should be hidden from visual view but remain accessible\n * to screen readers for accessibility purposes. When set to `true`, the content\n * will not be visibly shown, but its content can still be read by screen readers.\n * This is especially useful for providing additional context or information to\n * assistive technologies without cluttering the visual UI.\n */\n @property({ type: Boolean })\n accessor visiblyHidden = false;\n\n /**\n * Sets a fixed width for the cell.\n * Accepts standard CSS width values (e.g., '150px', '50%').\n */\n @property({ type: String, reflect: true })\n accessor width = '';\n\n /**\n * Sets a maximum width for the cell.\n * Accepts standard CSS width values (e.g., '150px', '50%').\n */\n @property({ type: String, reflect: true })\n accessor maxWidth = '';\n\n /**\n * Sets a minimum width for the cell;\n * Accepts standard CSS width values (e.g., '150px', '50%').\n * @type {string}\n */\n @property({ type: String, reflect: true })\n accessor minWidth = '';\n\n /**\n * @ignore\n */\n @queryAssignedNodes({ flatten: true })\n accessor listItems!: Array<Node>;\n\n /**\n * Resets the sorting direction of the component to its default state.\n * Useful for initializing or clearing any applied sorting on the element.\n */\n resetSort() {\n this.sortDirection = SORT_DIRECTION.DEFAULT;\n }\n\n /**\n * Assistive text for screen readers.\n * @ignore\n */\n @state()\n accessor assistiveText = '';\n\n /**\n * Toggles the sort direction between ascending, descending, and default states.\n * It also dispatches an event to notify parent components of the sorting change.\n */\n private toggleSortDirection() {\n if (!this.sortKey) {\n console.error('sortKey is missing for a sortable column.');\n return;\n }\n\n switch (this.sortDirection) {\n case SORT_DIRECTION.DEFAULT:\n case SORT_DIRECTION.DESC: {\n this.sortDirection = SORT_DIRECTION.ASC;\n const assistiveText1 = `Column header ${this.sortKey} sorted in ascending order`;\n this.assistiveText =\n this.assistiveText === '' || this.assistiveText === assistiveText1\n ? `${assistiveText1}.`\n : assistiveText1;\n break;\n }\n case SORT_DIRECTION.ASC: {\n this.sortDirection = SORT_DIRECTION.DESC;\n const assistiveText2 = `Column header ${this.sortKey} sorted in descending order`;\n this.assistiveText =\n this.assistiveText === '' || this.assistiveText === assistiveText2\n ? `${assistiveText2}.`\n : assistiveText2;\n break;\n }\n }\n\n // Dispatch event to notify parent components of the sorting change\n this.dispatchEvent(\n new CustomEvent('on-sort-changed', {\n bubbles: true,\n composed: true,\n detail: { sortDirection: this.sortDirection, sortKey: this.sortKey },\n })\n );\n }\n\n override updated(changedProperties: PropertyValues) {\n this.getTextContent();\n\n super.updated(changedProperties);\n if (this.maxWidth && changedProperties.has('maxWidth')) {\n this.style.setProperty('--kyn-th-max-width', this.maxWidth);\n }\n\n if (this.width && changedProperties.has('width')) {\n this.style.setProperty('--kyn-th-width', this.width);\n }\n\n if (this.minWidth && changedProperties.has('minWidth')) {\n this.style.setProperty('--kyn-th-min-width', this.minWidth);\n }\n }\n\n getTextContent() {\n const nonWhitespaceNodes = this.listItems.filter((node) => {\n return (\n node?.nodeType !== Node.TEXT_NODE || node?.textContent?.trim() !== ''\n );\n });\n\n this.headerLabel = nonWhitespaceNodes[0]?.textContent || '';\n }\n\n override render() {\n const iconClasses = {\n 'sort-icon': true,\n 'sort-icon--sorting': this.sortDirection !== SORT_DIRECTION.DEFAULT,\n 'sort-icon--sorting-asc': this.sortDirection === SORT_DIRECTION.ASC,\n 'sort-icon--sorting-desc': this.sortDirection === SORT_DIRECTION.DESC,\n };\n\n const slotClasses = {\n 'slot-wrapper': true,\n 'sr-only': this.visiblyHidden,\n };\n\n /**\n * Accessibility Enhancements:\n * - role: Sets the appropriate role for interactive headers (e.g., when sortable).\n * - ariaSort: Indicates the sorting direction to assistive technologies.\n * - ariaLabel: Provides a descriptive label to assistive technologies for sortable headers.\n * - tabIndex: Enables keyboard interaction for sortable headers.\n * - onKeyDown: Handles keyboard events for sortable headers to allow sorting via the keyboard.\n */\n const role = this.sortable ? 'button' : undefined;\n // const arialSort = this.sortable ? this.sortDirection : undefined;\n const ariaLabel =\n this.sortable && this.headerLabel\n ? `Sort by ${this.headerLabel}`\n : undefined;\n const tabIndex = this.sortable ? 0 : undefined;\n const onKeyDown = this.sortable\n ? (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n this.toggleSortDirection();\n }\n }\n : undefined;\n\n return html`\n <div\n class=\"container\"\n role=${ifDefined(role)}\n @click=${this.sortable ? () => this.toggleSortDirection() : undefined}\n aria-label=${ifDefined(ariaLabel)}\n tabindex=${ifDefined(tabIndex)}\n @keydown=${onKeyDown}\n >\n <div class=${classMap(slotClasses)}>\n <slot></slot>\n </div>\n ${this.sortable\n ? html`<span class=${classMap(iconClasses)}\n >${unsafeSVG(arrowUpIcon)}</span\n >`\n : null}\n\n <div\n class=\"assistive-text\"\n role=\"status\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n >\n ${this.assistiveText}\n </div>\n </div>\n `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-th': TableHeader;\n }\n}\n"],"names":["TableHeader","customElement","LitElement","_classThis","_classSuper","role","__classPrivateFieldGet","this","_TableHeader_role_accessor_storage","value","__classPrivateFieldSet","dense","_TableHeader_dense_accessor_storage","_contextConsumer","_TableHeader__contextConsumer_accessor_storage","align","_TableHeader_align_accessor_storage","sortable","_TableHeader_sortable_accessor_storage","sortDirection","_TableHeader_sortDirection_accessor_storage","headerLabel","_TableHeader_headerLabel_accessor_storage","sortKey","_TableHeader_sortKey_accessor_storage","visiblyHidden","_TableHeader_visiblyHidden_accessor_storage","width","_TableHeader_width_accessor_storage","maxWidth","_TableHeader_maxWidth_accessor_storage","minWidth","_TableHeader_minWidth_accessor_storage","listItems","_TableHeader_listItems_accessor_storage","resetSort","SORT_DIRECTION","DEFAULT","assistiveText","_TableHeader_assistiveText_accessor_storage","toggleSortDirection","DESC","ASC","assistiveText1","assistiveText2","dispatchEvent","CustomEvent","bubbles","composed","detail","console","error","updated","changedProperties","getTextContent","super","has","style","setProperty","nonWhitespaceNodes","filter","node","nodeType","Node","TEXT_NODE","_a","textContent","trim","render","iconClasses","slotClasses","undefined","ariaLabel","tabIndex","onKeyDown","e","key","html","ifDefined","classMap","unsafeSVG","arrowUpIcon","set","__runInitializers","_role_initializers","_role_extraInitializers","_dense_initializers","_dense_extraInitializers","__contextConsumer_initializers","ContextConsumer","tableContext","context","handleContextChange","_align_initializers","TABLE_CELL_ALIGN","LEFT","_align_extraInitializers","_sortable_initializers","_sortable_extraInitializers","_sortDirection_initializers","_sortDirection_extraInitializers","_headerLabel_initializers","_headerLabel_extraInitializers","_sortKey_initializers","_sortKey_extraInitializers","_visiblyHidden_initializers","_visiblyHidden_extraInitializers","_width_initializers","_width_extraInitializers","_maxWidth_initializers","_maxWidth_extraInitializers","_minWidth_initializers","_minWidth_extraInitializers","_listItems_initializers","_listItems_extraInitializers","_assistiveText_initializers","property","type","String","reflect","Boolean","__contextConsumer_decorators","state","_headerLabel_decorators","_sortKey_decorators","_visiblyHidden_decorators","_listItems_decorators","queryAssignedNodes","flatten","_assistiveText_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_dense_decorators","__contextConsumer_extraInitializers","_align_decorators","_sortable_decorators","_sortDirection_decorators","_width_decorators","_maxWidth_decorators","_minWidth_decorators","_assistiveText_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BaA,EAAW,6EADvBC,EAAc,kBACkBC,iLAARC,EAAA,cAAQC,EAO/B,QAAkBC,GAAI,OAAAC,EAAAC,KAAAC,EAAA,IAAA,CAAtB,QAAkBH,CAAII,GAAAC,EAAAH,KAAAC,EAAAC,EAAA,IAAA,CAItB,SAASE,GAAK,OAAAL,EAAAC,KAAAK,EAAA,IAAA,CAAd,SAASD,CAAKF,GAAAC,EAAAH,KAAAK,EAAAH,EAAA,IAAA,CAWd,oBAAiBI,GAAgB,OAAAP,EAAAC,KAAAO,EAAA,IAAA,CAAjC,oBAAiBD,CAAgBJ,GAAAC,E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kBAAAA,EAAAC,IAAAD,GAAAA,EAASnG,cAAa4C,IAAA,CAAAuD,EAAAhI,KAAAgI,EAAbnG,cAAa7B,CAAA,GAAAkI,SAAAC,GAAAzB,GAAAkC,IA9HxBnB,EAAA,KAAAoB,EAAA,CAAA7I,MAAAN,GAAAoJ,EAAA,CAAAnB,KAAA,QAAAC,KAAAlI,EAAAkI,KAAAM,SAAAC,GAAA,KAAAY,iHACkBrJ,EAAAsJ,OAASC,EAAUD,GADxBtE,EAAAhF,EAAAqJ,MAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table-row.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table-row.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAa,MAAM,KAAK,CAAC;AAQlE,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKjE,OAAO,sBAAsB,CAAC;AAW9B;;;;;;;GAOG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,OAAgB,MAAM,0BAAqB;IAE3C;;OAEG;IACH,SACkB,IAAI,SAAS;IAE/B;;OAEG;IAEH,QAAQ,CAAC,eAAe,SAAW;IAEnC;;OAEG;IAEH,QAAQ,CAAC,KAAK,SAAM;IAEpB;;;OAGG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;;OAGG;IAEH,QAAQ,CAAC,iBAAiB,UAAS;IAEnC;;;OAGG;IAEH,QAAQ,CAAC,KAAK,UAAS;IAEvB;;OAEG;IAEH,QAAQ,CAAC,MAAM,UAAS;IAExB;;;;OAIG;IAEH,QAAQ,CAAC,MAAM,UAAS;IAExB;;OAEG;IAEH,QAAQ,CAAC,UAAU,UAAS;IAE5B;;OAEG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;;;OAIG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;OAEG;IAEH,QAAQ,CAAC,gBAAgB,UAAS;IAElC;;;OAGG;IAEH,QAAQ,CAAC,MAAM,UAAS;IAExB,iCAAiC;IAEjC,QAAQ,CAAC,WAAW;;;MAAuB;IAE3C;;OAEG;IAEH,QAAQ,CAAC,YAAY;;;MAAuB;IAE5C;;OAEG;IAEH,QAAQ,CAAC,cAAc,EAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IAE7C;;;;;;OAMG;IAGH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAO/B;IAEF;;;OAGG;IAEH,QAAQ,CAAC,aAAa,SAAM;IAE5B;;;OAGG;IACH,mBAAmB,GAAI,uBAAuB,gBAAgB,UAI5D;IAEF;;OAEG;IACH,wBAAwB,CAAC,KAAK,EAAE,WAAW;IAYlC,UAAU,CAAC,YAAY,EAAE,GAAG;IAM5B,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAiClD,iCAAiC,CAAC,QAAQ,UAAiB;IAsB3D,OAAO,CAAC,gBAAgB;IAIf,MAAM;CAkDhB;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,QAAQ,CAAC;KACpB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-row.js","sources":["../../../../src/components/reusable/table/table-row.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { ContextConsumer } from '@lit/context';\nimport { tableContext, TableContextType } from './table-context';\n\nimport chevronDownIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-down.svg';\n\nimport styles from './table-row.scss?inline';\nimport '../checkbox/checkbox';\n\nimport { TableExpandedRow } from './table-expanded-row';\nimport { TableCell } from './table-cell';\nimport { deepmerge } from 'deepmerge-ts';\n\nconst _defaultTextStrings = {\n expanded: 'Expanded',\n collapsed: 'Collapsed',\n};\n\n/**\n * `kyn-tr` Web Component.\n *\n * Represents a table row (`<tr>`) equivalent for custom tables created with Shidoka's design system.\n * It primarily acts as a container for individual table cells and behaves similarly to a native `<tr>` element.\n *\n * @slot unnamed - The content slot for adding table cells (`kyn-td` or other relevant cells).\n */\n@customElement('kyn-tr')\nexport class TableRow extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'row';\n\n /** aria-disabled.\n * @internal\n */\n @property({ type: String, reflect: true })\n accessor 'aria-disabled' = 'false';\n\n /**\n * rowId: String - Unique identifier for the row.\n */\n @property({ type: String, reflect: true })\n accessor rowId = '';\n\n /**\n * selected: Boolean indicating whether the row is selected.\n * Reflects the `selected` attribute.\n */\n @property({ type: Boolean, reflect: true })\n accessor selected = false;\n\n /**\n * checkboxSelection: Boolean indicating whether rows should be\n * selectable using checkboxes.\n */\n @property({ type: Boolean, reflect: true })\n accessor checkboxSelection = false;\n\n /**\n * dense: Boolean indicating whether the table should be displayed\n * in dense mode.\n */\n @property({ type: Boolean })\n accessor dense = false;\n\n /**\n * Unread row state.\n */\n @property({ type: Boolean })\n accessor unread = false;\n\n /**\n * locked: Boolean indicating whether the row is locked.\n * If a row is selected before it is locked, it remains selected even after being locked.\n * A row can be selected and disabled/locked simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor locked = false;\n\n /**\n * expandable: Boolean indicating whether the row is expandable.\n */\n @property({ type: Boolean, reflect: true })\n accessor expandable = false;\n\n /**\n * expanded: Boolean indicating whether the row is expanded.\n */\n @property({ type: Boolean, reflect: true })\n accessor expanded = false;\n\n /**\n * disabled: Boolean indicating whether the row is disabled.\n * A disabled row is not allowed to have any user interactions.\n * A row can be selected and disabled/locked simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /**\n * preventHighlight: Boolean indicating whether the row should not be highlighted.\n */\n @property({ type: Boolean, reflect: true })\n accessor preventHighlight = false;\n\n /**\n * dimmed: Boolean indicating whether the row is dimmed.\n * A row should not be selected and dimmed simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor dimmed = false;\n\n /** Text string customization. */\n @property({ type: Object })\n accessor textStrings = _defaultTextStrings;\n\n /** Internal text strings.\n * @internal\n */\n @state()\n accessor _textStrings = _defaultTextStrings;\n\n /**\n * @ignore\n */\n @queryAssignedElements()\n accessor unnamedSlotEls!: Array<HTMLElement>;\n\n /**\n * Context consumer for the table context.\n * Updates the cell's dense properties when the context changes.\n * @private\n * @ignore\n * @type {ContextConsumer<TableContextType, TableHeader>}\n */\n @state()\n // @ts-expect-error - This is a context consumer\n private accessor _contextConsumer = new ContextConsumer(\n this,\n tableContext,\n (context) => {\n if (context) this.handleContextChange(context);\n },\n true\n );\n\n /**\n * Assistive text for screen readers.\n * @ignore\n */\n @state()\n accessor assistiveText = '';\n\n /**\n * Updates the cell's dense and ellipsis properties when the context changes.\n * @param {TableContextType} context - The updated context.\n */\n handleContextChange = ({ checkboxSelection }: TableContextType) => {\n if (typeof checkboxSelection == 'boolean') {\n this.checkboxSelection = checkboxSelection;\n }\n };\n\n /**\n * Handles the change of selection state for a specific row.\n */\n handleRowSelectionChange(event: CustomEvent) {\n this.selected = event.detail.checked;\n // Emit the custom event with the selected row and its new state\n this.dispatchEvent(\n new CustomEvent('on-row-select', {\n detail: event.detail,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override willUpdate(changedProps: any) {\n if (changedProps.has('textStrings')) {\n this._textStrings = deepmerge(_defaultTextStrings, this.textStrings);\n }\n }\n\n override updated(changedProperties: PropertyValues) {\n // Reflect the expanded state to the next sibling expanded row\n if (changedProperties.has('expanded')) {\n const { expanded, nextElementSibling } = this;\n if (nextElementSibling?.matches('kyn-expanded-tr')) {\n (nextElementSibling as TableExpandedRow).expanded = expanded;\n }\n }\n\n // Reflect the disabled state to the tabindex attribute\n if (changedProperties.has('disabled')) {\n this['aria-disabled'] = this.disabled.toString();\n\n if (this.disabled) {\n this.setAttribute('tabindex', '-1');\n } else {\n this.removeAttribute('tabindex');\n }\n\n this.unnamedSlotEls.forEach((el) => {\n (el as TableCell).disabled = this.disabled;\n });\n }\n\n // A row can be selected and disabled/locked simultaneously.\n // However, a row should not be both selected and dimmed at the same time.\n if (changedProperties.has('dimmed') || changedProperties.has('selected')) {\n this.unnamedSlotEls.forEach((el) => {\n (el as TableCell).dimmed = this.dimmed && !this.selected;\n });\n }\n }\n\n _handleUserInitiatedToggleExpando(expanded = !this.expanded) {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n expanded,\n },\n };\n if (\n this.dispatchEvent(\n new CustomEvent('table-row-expando-beingtoggled', init)\n )\n ) {\n this.expanded = expanded;\n this.assistiveText = expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed;\n this.dispatchEvent(new CustomEvent('table-row-expando-toggled', init));\n }\n }\n\n private _handleExpanding() {\n this._handleUserInitiatedToggleExpando();\n }\n\n override render() {\n return html`\n ${this.expandable\n ? html`\n <kyn-td .align=${'center'} ?dense=${this.dense}>\n <div class=\"kyn--table-expand\">\n <button\n class=\"kyn--table-expand__button\"\n type=\"button\"\n ?disabled=${this.disabled}\n title=${this.expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed}\n aria-label=${this.expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed}\n @click=${this._handleExpanding}\n >\n <span slot=\"icon\">${unsafeSVG(chevronDownIcon)}</span>\n </button>\n </div>\n\n <div\n class=\"assistive-text\"\n role=\"status\"\n aria-live=\"assertive\"\n aria-relevant=\"additions text\"\n >\n ${this.assistiveText}\n </div>\n </kyn-td>\n `\n : null}\n ${this.checkboxSelection\n ? html`\n <kyn-td .align=${'center'} ?dense=${this.dense}>\n <kyn-checkbox\n ?disabled=${this.disabled || this.locked}\n .checked=${this.selected}\n visiblyHidden\n @on-checkbox-change=${this.handleRowSelectionChange}\n >\n ${this.selected ? 'Deselect' : 'Select'} Row ${this.rowId}\n </kyn-checkbox>\n </kyn-td>\n `\n : null}\n <slot></slot>\n `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-tr': TableRow;\n }\n}\n"],"names":["_defaultTextStrings","expanded","collapsed","TableRow","customElement","LitElement","_classThis","_classSuper","_TableRow_role_accessor_storage","set","this","__runInitializers","_role_initializers","_TableRow__a_accessor_storage","_role_extraInitializers","_member_initializers","_TableRow_rowId_accessor_storage","_member_extraInitializers","_rowId_initializers","_TableRow_selected_accessor_storage","_rowId_extraInitializers","_selected_initializers","_TableRow_checkboxSelection_accessor_storage","_selected_extraInitializers","_checkboxSelection_initializers","_TableRow_dense_accessor_storage","_checkboxSelection_extraInitializers","_dense_initializers","_TableRow_unread_accessor_storage","_dense_extraInitializers","_unread_initializers","_TableRow_locked_accessor_storage","_unread_extraInitializers","_locked_initializers","_TableRow_expandable_accessor_storage","_locked_extraInitializers","_expandable_initializers","_TableRow_expanded_accessor_storage","_expandable_extraInitializers","_expanded_initializers","_TableRow_disabled_accessor_storage","_expanded_extraInitializers","_disabled_initializers","_TableRow_preventHighlight_accessor_storage","_disabled_extraInitializers","_preventHighlight_initializers","_TableRow_dimmed_accessor_storage","_preventHighlight_extraInitializers","_dimmed_initializers","_TableRow_textStrings_accessor_storage","_dimmed_extraInitializers","_textStrings_initializers","_TableRow__textStrings_accessor_storage","_textStrings_extraInitializers","__textStrings_initializers","_TableRow_unnamedSlotEls_accessor_storage","__textStrings_extraInitializers","_unnamedSlotEls_initializers","_TableRow__contextConsumer_accessor_storage","_unnamedSlotEls_extraInitializers","__contextConsumer_initializers","ContextConsumer","tableContext","context","handleContextChange","_TableRow_assistiveText_accessor_storage","__contextConsumer_extraInitializers","_assistiveText_initializers","checkboxSelection","role","__classPrivateFieldGet","value","__classPrivateFieldSet","rowId","selected","dense","unread","locked","expandable","disabled","preventHighlight","dimmed","textStrings","_textStrings","unnamedSlotEls","_contextConsumer","assistiveText","handleRowSelectionChange","event","detail","checked","dispatchEvent","CustomEvent","bubbles","composed","willUpdate","changedProps","has","deepmerge","updated","changedProperties","nextElementSibling","matches","toString","setAttribute","removeAttribute","forEach","el","_handleUserInitiatedToggleExpando","init","cancelable","_handleExpanding","render","html","unsafeSVG","chevronDownIcon","property","type","String","reflect","Boolean","_dense_decorators","_unread_decorators","_textStrings_decorators","Object","__textStrings_decorators","state","_unnamedSlotEls_decorators","queryAssignedElements","__contextConsumer_decorators","_assistiveText_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_member_decorators","_rowId_decorators","_selected_decorators","_checkboxSelection_decorators","_locked_decorators","_expandable_decorators","_expanded_decorators","_disabled_decorators","_preventHighlight_decorators","_dimmed_decorators","_assistiveText_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBA,MAAMA,EAAsB,CAC1BC,SAAU,WACVC,UAAW,iBAYAC,EAAQ,iGADpBC,EAAc,oBACeC,iOAARC,EAAA,cAAQC,qCAOVC,EAAAC,IAAAC,KAAAC,EAAAD,KAAAE,GAAO,QAMhBC,EAAAJ,IAAAC,MAAAC,EAAAD,KAAAI,IAAAH,EAAAD,KAAAK,GAAkB,WAMlBC,EAAAP,IAAAC,MAAAC,EAAAD,KAAAO,IAAAN,EAAAD,KAAAQ,GAAQ,MAORC,EAAAV,IAAAC,MAAAC,EAAAD,KAAAU,IAAAT,EAAAD,KAAAW,IAAW,KAOXC,EAAAb,IAAAC,MAAAC,EAAAD,KAAAa,IAAAZ,EAAAD,KAAAc,IAAoB,KAOpBC,EAAAhB,IAAAC,MAAAC,EAAAD,KAAAgB,IAAAf,EAAAD,KAAAiB,IAAQ,KAMRC,EAAAnB,IAAAC,MAAAC,EAAAD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AA,GAAAqE,SAAAC,GAAAjF,GAAAM,IAcjCiE,EAAA7H,EAAA,KAAA4H,GAAA,CAAAG,KAAA,WAAAC,KAAA,gBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAxC,IAAAyC,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAASpD,cAAa7E,IAAA,CAAAiI,EAAAnE,KAAAmE,EAAbpD,cAAaf,CAAA,GAAAqE,SAAAC,GAAA1E,GAAAqF,IAhIxBrB,EAAA,KAAAsB,EAAA,CAAAlF,MAAAjE,GAAAoJ,GAAA,CAAArB,KAAA,QAAAC,KAAAhI,EAAAgI,KAAAM,SAAAC,GAAA,KAAAc,kHACkBrJ,EAAAsJ,OAASC,EAAUD,GADxBjJ,EAAAL,EAAAqJ,OAAQ"}
|
|
1
|
+
{"version":3,"file":"table-row.js","sources":["../../../../src/components/reusable/table/table-row.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, PropertyValues, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { ContextConsumer } from '@lit/context';\nimport { tableContext, TableContextType } from './table-context';\n\nimport chevronDownIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-down.svg';\n\nimport styles from './table-row.scss?inline';\nimport '../checkbox/checkbox';\n\nimport { TableExpandedRow } from './table-expanded-row';\nimport { TableCell } from './table-cell';\nimport { deepmerge } from 'deepmerge-ts';\n\nconst _defaultTextStrings = {\n expanded: 'Expanded',\n collapsed: 'Collapsed',\n};\n\n/**\n * `kyn-tr` Web Component.\n *\n * Represents a table row (`<tr>`) equivalent for custom tables created with Shidoka's design system.\n * It primarily acts as a container for individual table cells and behaves similarly to a native `<tr>` element.\n *\n * @slot unnamed - The content slot for adding table cells (`kyn-td` or other relevant cells).\n */\n@customElement('kyn-tr')\nexport class TableRow extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'row';\n\n /** aria-disabled.\n * @internal\n */\n @property({ type: String, reflect: true })\n accessor 'aria-disabled' = 'false';\n\n /**\n * rowId: String - Unique identifier for the row.\n */\n @property({ type: String, reflect: true })\n accessor rowId = '';\n\n /**\n * selected: Boolean indicating whether the row is selected.\n * Reflects the `selected` attribute.\n */\n @property({ type: Boolean, reflect: true })\n accessor selected = false;\n\n /**\n * checkboxSelection: Boolean indicating whether rows should be\n * selectable using checkboxes.\n */\n @property({ type: Boolean, reflect: true })\n accessor checkboxSelection = false;\n\n /**\n * dense: Boolean indicating whether the table should be displayed\n * in dense mode.\n */\n @property({ type: Boolean })\n accessor dense = false;\n\n /**\n * Unread row state.\n */\n @property({ type: Boolean })\n accessor unread = false;\n\n /**\n * locked: Boolean indicating whether the row is locked.\n * If a row is selected before it is locked, it remains selected even after being locked.\n * A row can be selected and disabled/locked simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor locked = false;\n\n /**\n * expandable: Boolean indicating whether the row is expandable.\n */\n @property({ type: Boolean, reflect: true })\n accessor expandable = false;\n\n /**\n * expanded: Boolean indicating whether the row is expanded.\n */\n @property({ type: Boolean, reflect: true })\n accessor expanded = false;\n\n /**\n * disabled: Boolean indicating whether the row is disabled.\n * A disabled row is not allowed to have any user interactions.\n * A row can be selected and disabled/locked simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /**\n * preventHighlight: Boolean indicating whether the row should not be highlighted.\n */\n @property({ type: Boolean, reflect: true })\n accessor preventHighlight = false;\n\n /**\n * dimmed: Boolean indicating whether the row is dimmed.\n * A row should not be selected and dimmed simultaneously.\n */\n @property({ type: Boolean, reflect: true })\n accessor dimmed = false;\n\n /** Text string customization. */\n @property({ type: Object })\n accessor textStrings = _defaultTextStrings;\n\n /** Internal text strings.\n * @internal\n */\n @state()\n accessor _textStrings = _defaultTextStrings;\n\n /**\n * @ignore\n */\n @queryAssignedElements()\n accessor unnamedSlotEls!: Array<HTMLElement>;\n\n /**\n * Context consumer for the table context.\n * Updates the cell's dense properties when the context changes.\n * @private\n * @ignore\n * @type {ContextConsumer<TableContextType, TableHeader>}\n */\n @state()\n // @ts-expect-error - This is a context consumer\n private accessor _contextConsumer = new ContextConsumer(\n this,\n tableContext,\n (context) => {\n if (context) this.handleContextChange(context);\n },\n true\n );\n\n /**\n * Assistive text for screen readers.\n * @ignore\n */\n @state()\n accessor assistiveText = '';\n\n /**\n * Updates the cell's dense and ellipsis properties when the context changes.\n * @param {TableContextType} context - The updated context.\n */\n handleContextChange = ({ checkboxSelection }: TableContextType) => {\n if (typeof checkboxSelection == 'boolean') {\n this.checkboxSelection = checkboxSelection;\n }\n };\n\n /**\n * Handles the change of selection state for a specific row.\n */\n handleRowSelectionChange(event: CustomEvent) {\n this.selected = event.detail.checked;\n // Emit the custom event with the selected row and its new state\n this.dispatchEvent(\n new CustomEvent('on-row-select', {\n detail: event.detail,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override willUpdate(changedProps: any) {\n if (changedProps.has('textStrings')) {\n this._textStrings = deepmerge(_defaultTextStrings, this.textStrings);\n }\n }\n\n override updated(changedProperties: PropertyValues) {\n // Reflect the expanded state to the next sibling expanded row\n if (changedProperties.has('expanded')) {\n const { expanded, nextElementSibling } = this;\n if (nextElementSibling?.matches('kyn-expanded-tr')) {\n (nextElementSibling as TableExpandedRow).expanded = expanded;\n }\n }\n\n // Reflect the disabled state to the tabindex attribute\n if (changedProperties.has('disabled')) {\n this['aria-disabled'] = this.disabled.toString();\n\n if (this.disabled) {\n this.setAttribute('tabindex', '-1');\n } else {\n this.removeAttribute('tabindex');\n }\n\n this.unnamedSlotEls.forEach((el) => {\n (el as TableCell).disabled = this.disabled;\n });\n }\n\n // A row can be selected and disabled/locked simultaneously.\n // However, a row should not be both selected and dimmed at the same time.\n if (changedProperties.has('dimmed') || changedProperties.has('selected')) {\n this.unnamedSlotEls.forEach((el) => {\n (el as TableCell).dimmed = this.dimmed && !this.selected;\n });\n }\n }\n\n _handleUserInitiatedToggleExpando(expanded = !this.expanded) {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n expanded,\n },\n };\n if (\n this.dispatchEvent(\n new CustomEvent('table-row-expando-beingtoggled', init)\n )\n ) {\n this.expanded = expanded;\n this.assistiveText = expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed;\n this.dispatchEvent(new CustomEvent('table-row-expando-toggled', init));\n }\n }\n\n private _handleExpanding() {\n this._handleUserInitiatedToggleExpando();\n }\n\n override render() {\n return html`\n ${this.expandable\n ? html`\n <kyn-td .align=${'center'} ?dense=${this.dense}>\n <div class=\"kyn--table-expand\">\n <button\n class=\"kyn--table-expand__button\"\n type=\"button\"\n ?disabled=${this.disabled}\n title=${this.expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed}\n aria-label=${this.expanded\n ? this._textStrings.expanded\n : this._textStrings.collapsed}\n @click=${this._handleExpanding}\n >\n <span slot=\"icon\">${unsafeSVG(chevronDownIcon)}</span>\n </button>\n </div>\n\n <div\n class=\"assistive-text\"\n role=\"status\"\n aria-live=\"assertive\"\n aria-relevant=\"additions text\"\n >\n ${this.assistiveText}\n </div>\n </kyn-td>\n `\n : null}\n ${this.checkboxSelection\n ? html`\n <kyn-td .align=${'center'} ?dense=${this.dense}>\n <kyn-checkbox\n ?disabled=${this.disabled || this.locked}\n .checked=${this.selected}\n visiblyHidden\n @on-checkbox-change=${this.handleRowSelectionChange}\n >\n ${this.selected ? 'Deselect' : 'Select'} Row ${this.rowId}\n </kyn-checkbox>\n </kyn-td>\n `\n : null}\n <slot></slot>\n `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-tr': TableRow;\n }\n}\n"],"names":["_defaultTextStrings","expanded","collapsed","TableRow","customElement","LitElement","_classThis","_classSuper","_TableRow_role_accessor_storage","set","this","__runInitializers","_role_initializers","_TableRow__a_accessor_storage","_role_extraInitializers","_member_initializers","_TableRow_rowId_accessor_storage","_member_extraInitializers","_rowId_initializers","_TableRow_selected_accessor_storage","_rowId_extraInitializers","_selected_initializers","_TableRow_checkboxSelection_accessor_storage","_selected_extraInitializers","_checkboxSelection_initializers","_TableRow_dense_accessor_storage","_checkboxSelection_extraInitializers","_dense_initializers","_TableRow_unread_accessor_storage","_dense_extraInitializers","_unread_initializers","_TableRow_locked_accessor_storage","_unread_extraInitializers","_locked_initializers","_TableRow_expandable_accessor_storage","_locked_extraInitializers","_expandable_initializers","_TableRow_expanded_accessor_storage","_expandable_extraInitializers","_expanded_initializers","_TableRow_disabled_accessor_storage","_expanded_extraInitializers","_disabled_initializers","_TableRow_preventHighlight_accessor_storage","_disabled_extraInitializers","_preventHighlight_initializers","_TableRow_dimmed_accessor_storage","_preventHighlight_extraInitializers","_dimmed_initializers","_TableRow_textStrings_accessor_storage","_dimmed_extraInitializers","_textStrings_initializers","_TableRow__textStrings_accessor_storage","_textStrings_extraInitializers","__textStrings_initializers","_TableRow_unnamedSlotEls_accessor_storage","__textStrings_extraInitializers","_unnamedSlotEls_initializers","_TableRow__contextConsumer_accessor_storage","_unnamedSlotEls_extraInitializers","__contextConsumer_initializers","ContextConsumer","tableContext","context","handleContextChange","_TableRow_assistiveText_accessor_storage","__contextConsumer_extraInitializers","_assistiveText_initializers","checkboxSelection","role","__classPrivateFieldGet","value","__classPrivateFieldSet","rowId","selected","dense","unread","locked","expandable","disabled","preventHighlight","dimmed","textStrings","_textStrings","unnamedSlotEls","_contextConsumer","assistiveText","handleRowSelectionChange","event","detail","checked","dispatchEvent","CustomEvent","bubbles","composed","willUpdate","changedProps","has","deepmerge","updated","changedProperties","nextElementSibling","matches","toString","setAttribute","removeAttribute","forEach","el","_handleUserInitiatedToggleExpando","init","cancelable","_handleExpanding","render","html","unsafeSVG","chevronDownIcon","property","type","String","reflect","Boolean","_dense_decorators","_unread_decorators","_textStrings_decorators","Object","__textStrings_decorators","state","_unnamedSlotEls_decorators","queryAssignedElements","__contextConsumer_decorators","_assistiveText_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_member_decorators","_rowId_decorators","_selected_decorators","_checkboxSelection_decorators","_locked_decorators","_expandable_decorators","_expanded_decorators","_disabled_decorators","_preventHighlight_decorators","_dimmed_decorators","_assistiveText_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBA,MAAMA,EAAsB,CAC1BC,SAAU,WACVC,UAAW,iBAYAC,EAAQ,iGADpBC,EAAc,oBACeC,iOAARC,EAAA,cAAQC,qCAOVC,EAAAC,IAAAC,KAAAC,EAAAD,KAAAE,GAAO,QAMhBC,EAAAJ,IAAAC,MAAAC,EAAAD,KAAAI,IAAAH,EAAAD,KAAAK,GAAkB,WAMlBC,EAAAP,IAAAC,MAAAC,EAAAD,KAAAO,IAAAN,EAAAD,KAAAQ,GAAQ,MAORC,EAAAV,IAAAC,MAAAC,EAAAD,KAAAU,IAAAT,EAAAD,KAAAW,IAAW,KAOXC,EAAAb,IAAAC,MAAAC,EAAAD,KAAAa,IAAAZ,EAAAD,KAAAc,IAAoB,KAOpBC,EAAAhB,IAAAC,MAAAC,EAAAD,KAAAgB,IAAAf,EAAAD,KAAAiB,IAAQ,KAMRC,EAAAnB,IAAAC,MAAAC,EAAAD,KAAAmB,IAAAlB,EAAAD,KAAAoB,IAAS,KAQTC,EAAAtB,IAAAC,MAAAC,EAAAD,KAAAsB,IAAArB,EAAAD,KAAAuB,IAAS,KAMTC,EAAAzB,IAAAC,MAAAC,EAAAD,KAAAyB,IAAAxB,EAAAD,KAAA0B,IAAa,KAMbC,EAAA5B,IAAAC,MAAAC,EAAAD,KAAA4B,IAAA3B,EAAAD,KAAA6B,IAAW,KAQXC,EAAA/B,IAAAC,MAAAC,EAAAD,KAAA+B,IAAA9B,E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AAA,CAAAlF,MAAAjE,GAAAoJ,GAAA,CAAArB,KAAA,QAAAC,KAAAhI,EAAAgI,KAAAM,SAAAC,GAAA,KAAAc,kHACkBrJ,EAAAsJ,OAASC,EAAUD,GADxBjJ,EAAAL,EAAAqJ,OAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAa,MAAM,KAAK,CAAC;AAKlE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC;;;;;;GAMG;AAEH,qBACa,KAAM,SAAQ,UAAU;IACnC,OAAgB,MAAM,0BAAqB;IAE3C;;OAEG;IACH,SACkB,IAAI,SAAW;IAEjC;;;;;OAKG;IAEH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAAC;IAEhD;;;;;OAKG;IAEH,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC;;;;;OAKG;IAEH,QAAQ,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C;;;;;OAKG;IAEH,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;;;;;;SAOK;IAEL,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1C;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2C;IAErE;;OAEG;IACM,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAkBlD;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAE/D;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAE1D;;;;;OAKG;IAEH,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAS;IAEtD;;;;;OAKG;IAEH,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAS;IAEhD;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAkB7B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAgCjC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmC3B;;;;;OAKG;IACI,0BAA0B;IAWjC;;;;OAIG;IACI,eAAe;IAItB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,sBAAsB;IAmBrB,iBAAiB;IAiBjB,oBAAoB;IAiBpB,YAAY;IAIZ,MAAM;CAGhB;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,KAAK,CAAC;KACpB;CACF"}
|
|
@@ -40,6 +40,8 @@ export declare class NewWidgetSample extends LitElement {
|
|
|
40
40
|
accessor showFilter: boolean;
|
|
41
41
|
accessor addNewDashboard: boolean;
|
|
42
42
|
accessor showFileUploader: boolean;
|
|
43
|
+
accessor showBundles: boolean;
|
|
44
|
+
accessor showCreateBundles: boolean;
|
|
43
45
|
accessor displayTwoPerRow: boolean;
|
|
44
46
|
accessor updateLayout: {
|
|
45
47
|
max: {
|
|
@@ -85,8 +87,11 @@ export declare class NewWidgetSample extends LitElement {
|
|
|
85
87
|
render(): import("lit-html").TemplateResult<1>;
|
|
86
88
|
handleListDisplay(items: any, size: number): any[];
|
|
87
89
|
toggleList(): Promise<void>;
|
|
90
|
+
private getCreateNewBundleTemplate;
|
|
88
91
|
private getWidgetTemplate;
|
|
89
92
|
private getFilterSortTemplate;
|
|
93
|
+
private getAdminTemplate;
|
|
94
|
+
private getBundleTemplate;
|
|
90
95
|
private getDashboardTemplate;
|
|
91
96
|
private getImageBackgroundTemplate;
|
|
92
97
|
private handleRecommendClick;
|
|
@@ -96,6 +101,7 @@ export declare class NewWidgetSample extends LitElement {
|
|
|
96
101
|
private handleFilterClick;
|
|
97
102
|
private handleUploadImageClick;
|
|
98
103
|
private _handleSelection;
|
|
104
|
+
private handleBundleClick;
|
|
99
105
|
}
|
|
100
106
|
declare global {
|
|
101
107
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridstack.newWidget.sample.d.ts","sourceRoot":"","sources":["../../../../../src/components/reusable/widget/sample/gridstack.newWidget.sample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAKlD,OAAO,UAAU,CAAC;AAClB,OAAO,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"gridstack.newWidget.sample.d.ts","sourceRoot":"","sources":["../../../../../src/components/reusable/widget/sample/gridstack.newWidget.sample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAKlD,OAAO,UAAU,CAAC;AAClB,OAAO,wDAAwD,CAAC;AAqBhE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,YAAY,CAAC;AACpB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,CAAC;AACnB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,YAAY,CAAC;AACpB,OAAO,aAAa,CAAC;AACrB,OAAO,wCAAwC,CAAC;AAchD;;GAEG;AACH,qBACa,eAAgB,SAAQ,UA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ka-applications",
|
|
3
|
-
"version": "2.47.
|
|
3
|
+
"version": "2.47.5",
|
|
4
4
|
"description": "Shidoka Web Components for Applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@kyndryl-design-system/shidoka-foundation": "^2.4.16",
|
|
32
|
-
"@kyndryl-design-system/shidoka-icons": "^2.12.
|
|
32
|
+
"@kyndryl-design-system/shidoka-icons": "^2.12.2",
|
|
33
33
|
"@lit/context": "^1.1.0",
|
|
34
34
|
"deepmerge-ts": "^7.1.0",
|
|
35
35
|
"flatpickr": "^4.6.13",
|
package/table-CCYJ3J_m.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-CCYJ3J_m.js","sources":["../src/components/reusable/table/table.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ContextProvider } from '@lit/context';\nimport { tableContext } from './table-context';\n\nimport { TableRow } from './table-row';\nimport { TableHeaderRow } from './table-header-row';\n\nimport styles from './table.scss?inline';\n\n/**\n * `kyn-table` Web Component.\n * This component provides a table with sorting, pagination, and selection capabilities.\n * It is designed to be used with the `kyn-table-toolbar` and `kyn-table-container` components.\n * @fires on-row-selection-change - Dispatched when the selection state of a row is toggled.\n * @fires on-all-rows-selection-change - Dispatched when the selection state of all rows is toggled.\n */\n\n@customElement('kyn-table')\nexport class Table extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'table';\n\n /**\n * checkboxSelection: Boolean indicating whether rows should be\n * selectable using checkboxes.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor checkboxSelection: boolean | undefined;\n\n /**\n * striped: Boolean indicating whether rows should have alternate\n * coloring.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor striped: boolean | undefined;\n\n /**\n * stickyHeader: Boolean indicating whether the table header should be sticky.\n * Must also set a height or max-height on kyn-table-container.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor stickyHeader: boolean | undefined;\n\n /**\n * dense: Boolean indicating whether the table should be displayed\n * in dense mode.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor dense: boolean | undefined;\n\n /**\n * fixedLayout: Boolean indicating whether the table should have a fixed layout.\n * This will set the table's layout to fixed, which means the table and column widths\n * will be determined by the width of the columns and not by the content of the cells.\n * This can be useful when you want to have a consistent column width across multiple tables.\n * @type {boolean}\n * @default false\n * */\n @property({ type: Boolean })\n accessor fixedLayout: boolean | undefined;\n\n /**\n * _provider: Context provider for the table.\n * @ignore\n * @private\n */\n @state()\n private accessor _provider = new ContextProvider(this, tableContext);\n\n /**\n * updated: Lifecycle method called when the element is updated.\n */\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n // Create an object to hold the new values\n const newValues: Partial<any> = {};\n\n // Check each property in _propsToCheck and add it to newValues if it has really changed\n if (changedProperties.has('dense')) newValues.dense = this.dense;\n if (changedProperties.has('striped')) newValues.striped = this.striped;\n if (changedProperties.has('checkboxSelection'))\n newValues.checkboxSelection = this.checkboxSelection;\n if (changedProperties.has('stickyHeader'))\n newValues.stickyHeader = this.stickyHeader;\n\n // Update the context provider with the new values\n this._provider.setValue(newValues);\n }\n\n /**\n * tableHeaderRow: Reference to the header row of the table.\n * @ignore\n * @private\n */\n @state()\n private accessor _tableHeaderRow: TableHeaderRow | null = null;\n\n /**\n * allRows: Array of objects representing each row in the data table.\n * @ignore\n * @private\n */\n @state()\n private accessor _allRows: TableRow[] = [];\n\n /**\n * selectedRows: Set of row ids that are currently selected.\n * @ignore\n * @private\n */\n @state()\n private accessor _selectedRows: TableRow[] = [];\n\n /**\n * selectedRowIds: Set of row ids that are currently selected.\n * @ignore\n * @private\n */\n @state()\n private accessor _selectedRowIds: Set<string> = new Set();\n\n /**\n * headerCheckboxIndeterminate: Boolean indicating whether the header\n * checkbox is in an indeterminate state.\n * @ignore\n * @private\n */\n @state()\n private accessor _headerCheckboxIndeterminate = false;\n\n /**\n * headerCheckboxChecked: Boolean indicating whether the header checkbox is\n * checked.\n * @ignore\n * @private\n */\n @state()\n private accessor _headerCheckboxChecked = false;\n\n /**\n * Updates the state of the header checkbox based on the number of\n * selected rows.\n * @private\n */\n private _updateHeaderCheckbox() {\n if (this._selectedRows.length === 0 || this._allRows.length === 0) {\n this._headerCheckboxIndeterminate = false;\n this._headerCheckboxChecked = false;\n } else if (this._selectedRows.length === this._allRows.length) {\n this._headerCheckboxIndeterminate = false;\n this._headerCheckboxChecked = true;\n } else {\n this._headerCheckboxIndeterminate = true;\n this._headerCheckboxChecked = false;\n }\n\n this._tableHeaderRow?.updateHeaderCheckboxState(\n this._headerCheckboxIndeterminate,\n this._headerCheckboxChecked\n );\n }\n\n /**\n * Handles the change of selection state for a specific row.\n */\n private _handleRowSelectionChange(event: CustomEvent) {\n event.stopPropagation();\n\n const { target } = event;\n const { _selectedRows: selectedRows } = this;\n\n if (!this.contains(target as TableRow)) {\n return;\n }\n\n if (selectedRows.includes(target as TableRow)) {\n this._selectedRows = selectedRows.filter((e) => e !== target);\n this._selectedRowIds.delete((target as TableRow).rowId);\n } else {\n this._selectedRows.push(target as TableRow);\n this._selectedRowIds.add((target as TableRow).rowId);\n }\n\n this._updateHeaderCheckbox();\n\n const init = {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n selectedRow: target,\n selectedRows: this._selectedRows,\n },\n };\n this.dispatchEvent(new CustomEvent('on-row-selection-change', init));\n }\n\n /**\n * Toggles the selection state of all rows in the table.\n */\n private _toggleSelectionAll(event: CustomEvent) {\n event.stopPropagation();\n\n const {\n detail: { checked },\n target,\n } = event;\n const { _allRows: allRows } = this;\n\n if (!this.contains(target as TableRow)) {\n return;\n }\n\n allRows.forEach((row) => {\n if ((row as TableRow).disabled) return;\n\n (row as TableRow).selected = checked;\n });\n\n this._selectedRows = [...allRows.filter((row) => row.selected)];\n this._selectedRowIds = new Set(this._selectedRows.map((row) => row.rowId));\n\n this._updateHeaderCheckbox();\n\n const init = {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n selectedRows: this._selectedRows,\n },\n };\n this.dispatchEvent(new CustomEvent('on-all-rows-selection-change', init));\n }\n\n /**\n * Resets the selection state of all rows in the table.\n * This method is called when the table is reset or cleared.\n * @public\n * @returns void\n */\n public updateAfterExternalChanges() {\n // Re-query the DOM to update the _allRows based on current children elements\n this._allRows = Array.from(this.querySelectorAll('kyn-tr'));\n\n // Update _selectedRows based on whether the row elements are marked as selected\n this._selectedRows = this._allRows.filter((row) => row.selected);\n\n this._updateHeaderCheckbox();\n this.requestUpdate();\n }\n\n /**\n * Returns the selected rows in the table.\n * @returns Array of selected rows.\n * @public\n */\n public getSelectedRows() {\n return this._selectedRows;\n }\n\n /**\n * Handles the change of rows in the table body.\n * @param {CustomEvent} event - The custom event containing the updated rows.\n * @private\n */\n private _handleRowsChange(event: CustomEvent) {\n const {\n detail: { rows },\n } = event;\n event.stopPropagation();\n\n this._allRows = rows;\n this._updateSelectionStates();\n this._updateHeaderCheckbox();\n }\n\n private _updateSelectionStates() {\n // Temporary array to hold updated selected rows\n const updatedSelectedRows: TableRow[] = [];\n\n // Loop through all rows to update their selected state and rebuild the selectedRows array\n this._allRows.forEach((row) => {\n if (this._selectedRowIds.has(row.rowId)) {\n row.selected = true; // Update the selected property if the rowId matches\n updatedSelectedRows.push(row); // Add the actual row element to the updated selected rows array\n } else if (row.selected) {\n this._selectedRowIds.add(row.rowId); // Add the rowId to the selectedRowIds set\n updatedSelectedRows.push(row); // Add the actual row element to the updated selected rows array\n }\n });\n\n // Replace the old selectedRows with the updated selected rows\n this._selectedRows = updatedSelectedRows;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(\n 'on-header-checkbox-toggle',\n this._toggleSelectionAll as EventListener\n );\n this.addEventListener(\n 'on-row-select',\n this._handleRowSelectionChange as EventListener\n );\n this.addEventListener(\n 'on-rows-change',\n this._handleRowsChange as EventListener\n );\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\n 'on-header-checkbox-toggle',\n this._toggleSelectionAll as EventListener\n );\n this.removeEventListener(\n 'on-row-select',\n this._handleRowSelectionChange as EventListener\n );\n this.removeEventListener(\n 'on-rows-change',\n this._handleRowsChange as EventListener\n );\n }\n\n override firstUpdated() {\n this._tableHeaderRow = this.querySelector('kyn-header-tr');\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-table': Table;\n }\n}\n"],"names":["Table","customElement","LitElement","_classThis","_classSuper","role","__classPrivateFieldGet","this","_Table_role_accessor_storage","value","__classPrivateFieldSet","checkboxSelection","_Table_checkboxSelection_accessor_storage","striped","_Table_striped_accessor_storage","stickyHeader","_Table_stickyHeader_accessor_storage","dense","_Table_dense_accessor_storage","fixedLayout","_Table_fixedLayout_accessor_storage","_provider","_Table__provider_accessor_storage","updated","changedProperties","super","newValues","has","setValue","_tableHeaderRow","_Table__tableHeaderRow_accessor_storage","_allRows","_Table__allRows_accessor_storage","_selectedRows","_Table__selectedRows_accessor_storage","_selectedRowIds","_Table__selectedRowIds_accessor_storage","_headerCheckboxIndeterminate","_Table__headerCheckboxIndeterminate_accessor_storage","_headerCheckboxChecked","_Table__headerCheckboxChecked_accessor_storage","_updateHeaderCheckbox","length","_a","updateHeaderCheckboxState","_handleRowSelectionChange","event","stopPropagation","target","selectedRows","contains","includes","filter","e","delete","rowId","push","add","init","bubbles","cancelable","composed","detail","selectedRow","dispatchEvent","CustomEvent","_toggleSelectionAll","checked","allRows","forEach","row","disabled","selected","Set","map","updateAfterExternalChanges","Array","from","querySelectorAll","requestUpdate","getSelectedRows","_handleRowsChange","rows","_updateSelectionStates","updatedSelectedRows","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","querySelector","render","html","set","__runInitializers","_role_initializers","_role_extraInitializers","_checkboxSelection_initializers","_checkboxSelection_extraInitializers","_striped_initializers","_striped_extraInitializers","_stickyHeader_initializers","_stickyHeader_extraInitializers","_dense_initializers","_dense_extraInitializers","_fixedLayout_initializers","_fixedLayout_extraInitializers","__provider_initializers","ContextProvider","tableContext","__provider_extraInitializers","__tableHeaderRow_initializers","__tableHeaderRow_extraInitializers","__allRows_initializers","__allRows_extraInitializers","__selectedRows_initializers","__selectedRows_extraInitializers","__selectedRowIds_initializers","__selectedRowIds_extraInitializers","__headerCheckboxIndeterminate_initializers","__headerCheckboxIndeterminate_extraInitializers","__headerCheckboxChecked_initializers","property","type","String","reflect","_checkboxSelection_decorators","Boolean","_striped_decorators","_stickyHeader_decorators","_dense_decorators","_fixedLayout_decorators","__provider_decorators","state","__tableHeaderRow_decorators","__allRows_decorators","__selectedRows_decorators","__selectedRowIds_decorators","__headerCheckboxIndeterminate_decorators","__headerCheckboxChecked_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","__headerCheckboxChecked_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;OAmBaA,EAAK,yEADjBC,EAAc,qBACYC,4JAARC,EAAA,cAAQC,EAOzB,QAAkBC,GAAI,OAAAC,EAAAC,KAAAC,EAAA,IAAA,CAAtB,QAAkBH,CAAII,GAAAC,EAAAH,KAAAC,EAAAC,EAAA,IAAA,CAStB,qBAASE,GAAiB,OAAAL,EAAAC,KAAAK,EAAA,IAAA,CAA1B,qBAASD,CAAiBF,GAAAC,EAAAH,KAAAK,EAAAH,EAAA,IAAA,CAS1B,WAASI,GAAO,OAAAP,EAAAC,KAAAO,EAAA,IAAA,CAAhB,WAASD,CAAOJ,GAAAC,EAAAH,KAAAO,EAAAL,EAAA,IAAA,CAShB,gBAASM,GAAY,OAAAT,EAAAC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AA,EAAAC,IAAAD,GAAAA,EAAiB5G,uBAAsBsD,IAAA,CAAAsD,EAAA1I,KAAA0I,EAAtB5G,uBAAsB9B,CAAA,GAAA4I,SAAAC,GAAA7B,GAAA8B,IArIzCX,EAAA,KAAAY,EAAA,CAAA/I,MAAAN,GAAAsJ,EAAA,CAAAX,KAAA,QAAAC,KAAA5I,EAAA4I,KAAAM,SAAAC,GAAA,KAAAI,iHACkBvJ,EAAAwJ,OAASC,EAAUD,GADxB7D,EAAA3F,EAAAuJ,MAAK"}
|
|
1
|
+
{"version":3,"file":"table-CCYJ3J_m.js","sources":["../src/components/reusable/table/table.ts"],"sourcesContent":["import { LitElement, html, PropertyValues, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ContextProvider } from '@lit/context';\nimport { tableContext } from './table-context';\n\nimport { TableRow } from './table-row';\nimport { TableHeaderRow } from './table-header-row';\n\nimport styles from './table.scss?inline';\n\n/**\n * `kyn-table` Web Component.\n * This component provides a table with sorting, pagination, and selection capabilities.\n * It is designed to be used with the `kyn-table-toolbar` and `kyn-table-container` components.\n * @fires on-row-selection-change - Dispatched when the selection state of a row is toggled.\n * @fires on-all-rows-selection-change - Dispatched when the selection state of all rows is toggled.\n */\n\n@customElement('kyn-table')\nexport class Table extends LitElement {\n static override styles = unsafeCSS(styles);\n\n /** aria role.\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor role = 'table';\n\n /**\n * checkboxSelection: Boolean indicating whether rows should be\n * selectable using checkboxes.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor checkboxSelection: boolean | undefined;\n\n /**\n * striped: Boolean indicating whether rows should have alternate\n * coloring.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor striped: boolean | undefined;\n\n /**\n * stickyHeader: Boolean indicating whether the table header should be sticky.\n * Must also set a height or max-height on kyn-table-container.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor stickyHeader: boolean | undefined;\n\n /**\n * dense: Boolean indicating whether the table should be displayed\n * in dense mode.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n accessor dense: boolean | undefined;\n\n /**\n * fixedLayout: Boolean indicating whether the table should have a fixed layout.\n * This will set the table's layout to fixed, which means the table and column widths\n * will be determined by the width of the columns and not by the content of the cells.\n * This can be useful when you want to have a consistent column width across multiple tables.\n * @type {boolean}\n * @default false\n * */\n @property({ type: Boolean })\n accessor fixedLayout: boolean | undefined;\n\n /**\n * _provider: Context provider for the table.\n * @ignore\n * @private\n */\n @state()\n private accessor _provider = new ContextProvider(this, tableContext);\n\n /**\n * updated: Lifecycle method called when the element is updated.\n */\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n // Create an object to hold the new values\n const newValues: Partial<any> = {};\n\n // Check each property in _propsToCheck and add it to newValues if it has really changed\n if (changedProperties.has('dense')) newValues.dense = this.dense;\n if (changedProperties.has('striped')) newValues.striped = this.striped;\n if (changedProperties.has('checkboxSelection'))\n newValues.checkboxSelection = this.checkboxSelection;\n if (changedProperties.has('stickyHeader'))\n newValues.stickyHeader = this.stickyHeader;\n\n // Update the context provider with the new values\n this._provider.setValue(newValues);\n }\n\n /**\n * tableHeaderRow: Reference to the header row of the table.\n * @ignore\n * @private\n */\n @state()\n private accessor _tableHeaderRow: TableHeaderRow | null = null;\n\n /**\n * allRows: Array of objects representing each row in the data table.\n * @ignore\n * @private\n */\n @state()\n private accessor _allRows: TableRow[] = [];\n\n /**\n * selectedRows: Set of row ids that are currently selected.\n * @ignore\n * @private\n */\n @state()\n private accessor _selectedRows: TableRow[] = [];\n\n /**\n * selectedRowIds: Set of row ids that are currently selected.\n * @ignore\n * @private\n */\n @state()\n private accessor _selectedRowIds: Set<string> = new Set();\n\n /**\n * headerCheckboxIndeterminate: Boolean indicating whether the header\n * checkbox is in an indeterminate state.\n * @ignore\n * @private\n */\n @state()\n private accessor _headerCheckboxIndeterminate = false;\n\n /**\n * headerCheckboxChecked: Boolean indicating whether the header checkbox is\n * checked.\n * @ignore\n * @private\n */\n @state()\n private accessor _headerCheckboxChecked = false;\n\n /**\n * Updates the state of the header checkbox based on the number of\n * selected rows.\n * @private\n */\n private _updateHeaderCheckbox() {\n if (this._selectedRows.length === 0 || this._allRows.length === 0) {\n this._headerCheckboxIndeterminate = false;\n this._headerCheckboxChecked = false;\n } else if (this._selectedRows.length === this._allRows.length) {\n this._headerCheckboxIndeterminate = false;\n this._headerCheckboxChecked = true;\n } else {\n this._headerCheckboxIndeterminate = true;\n this._headerCheckboxChecked = false;\n }\n\n this._tableHeaderRow?.updateHeaderCheckboxState(\n this._headerCheckboxIndeterminate,\n this._headerCheckboxChecked\n );\n }\n\n /**\n * Handles the change of selection state for a specific row.\n */\n private _handleRowSelectionChange(event: CustomEvent) {\n event.stopPropagation();\n\n const { target } = event;\n const { _selectedRows: selectedRows } = this;\n\n if (!this.contains(target as TableRow)) {\n return;\n }\n\n if (selectedRows.includes(target as TableRow)) {\n this._selectedRows = selectedRows.filter((e) => e !== target);\n this._selectedRowIds.delete((target as TableRow).rowId);\n } else {\n this._selectedRows.push(target as TableRow);\n this._selectedRowIds.add((target as TableRow).rowId);\n }\n\n this._updateHeaderCheckbox();\n\n const init = {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n selectedRow: target,\n selectedRows: this._selectedRows,\n },\n };\n this.dispatchEvent(new CustomEvent('on-row-selection-change', init));\n }\n\n /**\n * Toggles the selection state of all rows in the table.\n */\n private _toggleSelectionAll(event: CustomEvent) {\n event.stopPropagation();\n\n const {\n detail: { checked },\n target,\n } = event;\n const { _allRows: allRows } = this;\n\n if (!this.contains(target as TableRow)) {\n return;\n }\n\n allRows.forEach((row) => {\n if ((row as TableRow).disabled) return;\n\n (row as TableRow).selected = checked;\n });\n\n this._selectedRows = [...allRows.filter((row) => row.selected)];\n this._selectedRowIds = new Set(this._selectedRows.map((row) => row.rowId));\n\n this._updateHeaderCheckbox();\n\n const init = {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n selectedRows: this._selectedRows,\n },\n };\n this.dispatchEvent(new CustomEvent('on-all-rows-selection-change', init));\n }\n\n /**\n * Resets the selection state of all rows in the table.\n * This method is called when the table is reset or cleared.\n * @public\n * @returns void\n */\n public updateAfterExternalChanges() {\n // Re-query the DOM to update the _allRows based on current children elements\n this._allRows = Array.from(this.querySelectorAll('kyn-tr'));\n\n // Update _selectedRows based on whether the row elements are marked as selected\n this._selectedRows = this._allRows.filter((row) => row.selected);\n\n this._updateHeaderCheckbox();\n this.requestUpdate();\n }\n\n /**\n * Returns the selected rows in the table.\n * @returns Array of selected rows.\n * @public\n */\n public getSelectedRows() {\n return this._selectedRows;\n }\n\n /**\n * Handles the change of rows in the table body.\n * @param {CustomEvent} event - The custom event containing the updated rows.\n * @private\n */\n private _handleRowsChange(event: CustomEvent) {\n const {\n detail: { rows },\n } = event;\n event.stopPropagation();\n\n this._allRows = rows;\n this._updateSelectionStates();\n this._updateHeaderCheckbox();\n }\n\n private _updateSelectionStates() {\n // Temporary array to hold updated selected rows\n const updatedSelectedRows: TableRow[] = [];\n\n // Loop through all rows to update their selected state and rebuild the selectedRows array\n this._allRows.forEach((row) => {\n if (this._selectedRowIds.has(row.rowId)) {\n row.selected = true; // Update the selected property if the rowId matches\n updatedSelectedRows.push(row); // Add the actual row element to the updated selected rows array\n } else if (row.selected) {\n this._selectedRowIds.add(row.rowId); // Add the rowId to the selectedRowIds set\n updatedSelectedRows.push(row); // Add the actual row element to the updated selected rows array\n }\n });\n\n // Replace the old selectedRows with the updated selected rows\n this._selectedRows = updatedSelectedRows;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(\n 'on-header-checkbox-toggle',\n this._toggleSelectionAll as EventListener\n );\n this.addEventListener(\n 'on-row-select',\n this._handleRowSelectionChange as EventListener\n );\n this.addEventListener(\n 'on-rows-change',\n this._handleRowsChange as EventListener\n );\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\n 'on-header-checkbox-toggle',\n this._toggleSelectionAll as EventListener\n );\n this.removeEventListener(\n 'on-row-select',\n this._handleRowSelectionChange as EventListener\n );\n this.removeEventListener(\n 'on-rows-change',\n this._handleRowsChange as EventListener\n );\n }\n\n override firstUpdated() {\n this._tableHeaderRow = this.querySelector('kyn-header-tr');\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\n// Define the custom element in the global namespace\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-table': Table;\n }\n}\n"],"names":["Table","customElement","LitElement","_classThis","_classSuper","role","__classPrivateFieldGet","this","_Table_role_accessor_storage","value","__classPrivateFieldSet","checkboxSelection","_Table_checkboxSelection_accessor_storage","striped","_Table_striped_accessor_storage","stickyHeader","_Table_stickyHeader_accessor_storage","dense","_Table_dense_accessor_storage","fixedLayout","_Table_fixedLayout_accessor_storage","_provider","_Table__provider_accessor_storage","updated","changedProperties","super","newValues","has","setValue","_tableHeaderRow","_Table__tableHeaderRow_accessor_storage","_allRows","_Table__allRows_accessor_storage","_selectedRows","_Table__selectedRows_accessor_storage","_selectedRowIds","_Table__selectedRowIds_accessor_storage","_headerCheckboxIndeterminate","_Table__headerCheckboxIndeterminate_accessor_storage","_headerCheckboxChecked","_Table__headerCheckboxChecked_accessor_storage","_updateHeaderCheckbox","length","_a","updateHeaderCheckboxState","_handleRowSelectionChange","event","stopPropagation","target","selectedRows","contains","includes","filter","e","delete","rowId","push","add","init","bubbles","cancelable","composed","detail","selectedRow","dispatchEvent","CustomEvent","_toggleSelectionAll","checked","allRows","forEach","row","disabled","selected","Set","map","updateAfterExternalChanges","Array","from","querySelectorAll","requestUpdate","getSelectedRows","_handleRowsChange","rows","_updateSelectionStates","updatedSelectedRows","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","querySelector","render","html","set","__runInitializers","_role_initializers","_role_extraInitializers","_checkboxSelection_initializers","_checkboxSelection_extraInitializers","_striped_initializers","_striped_extraInitializers","_stickyHeader_initializers","_stickyHeader_extraInitializers","_dense_initializers","_dense_extraInitializers","_fixedLayout_initializers","_fixedLayout_extraInitializers","__provider_initializers","ContextProvider","tableContext","__provider_extraInitializers","__tableHeaderRow_initializers","__tableHeaderRow_extraInitializers","__allRows_initializers","__allRows_extraInitializers","__selectedRows_initializers","__selectedRows_extraInitializers","__selectedRowIds_initializers","__selectedRowIds_extraInitializers","__headerCheckboxIndeterminate_initializers","__headerCheckboxIndeterminate_extraInitializers","__headerCheckboxChecked_initializers","property","type","String","reflect","_checkboxSelection_decorators","Boolean","_striped_decorators","_stickyHeader_decorators","_dense_decorators","_fixedLayout_decorators","__provider_decorators","state","__tableHeaderRow_decorators","__allRows_decorators","__selectedRows_decorators","__selectedRowIds_decorators","__headerCheckboxIndeterminate_decorators","__headerCheckboxChecked_decorators","__esDecorate","_role_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","__headerCheckboxChecked_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;OAmBaA,EAAK,yEADjBC,EAAc,qBACYC,4JAARC,EAAA,cAAQC,EAOzB,QAAkBC,GAAI,OAAAC,EAAAC,KAAAC,EAAA,IAAA,CAAtB,QAAkBH,CAAII,GAAAC,EAAAH,KAAAC,EAAAC,EAAA,IAAA,CAStB,qBAASE,GAAiB,OAAAL,EAAAC,KAAAK,EAAA,IAAA,CAA1B,qBAASD,CAAiBF,GAAAC,EAAAH,KAAAK,EAAAH,EAAA,IAAA,CAS1B,WAASI,GAAO,OAAAP,EAAAC,KAAAO,EAAA,IAAA,CAAhB,WAASD,CAAOJ,GAAAC,EAAAH,KAAAO,EAAAL,EAAA,IAAA,CAShB,gBAASM,GAAY,OAAAT,EAAAC,KAAAS,EAAA,IAAA,CAArB,gBAASD,CAAYN,GAAAC,EAAAH,KAAAS,EAAAP,EAAA,IAAA,CASrB,SAASQ,GAAK,OAAAX,EAAAC,KAAAW,EAAA,IAAA,CAAd,SAASD,CA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