@tylertech/forge 3.0.0-next.6 → 3.0.0-next.7
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/custom-elements.json +620 -1108
- package/dist/esm/accordion/index.js +1 -1
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/app-bar/menu-button/index.js +1 -1
- package/dist/esm/app-bar/notification-button/index.js +1 -1
- package/dist/esm/app-bar/profile-button/index.js +1 -1
- package/dist/esm/app-bar/search/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/banner/index.js +1 -1
- package/dist/esm/bottom-sheet/index.js +1 -1
- package/dist/esm/busy-indicator/index.js +1 -1
- package/dist/esm/button/index.js +1 -1
- package/dist/esm/button-toggle/button-toggle/index.js +1 -1
- package/dist/esm/button-toggle/button-toggle-group/index.js +1 -1
- package/dist/esm/button-toggle/index.js +1 -1
- package/dist/esm/calendar/index.js +1 -1
- package/dist/esm/checkbox/index.js +1 -1
- package/dist/esm/chip-field/index.js +1 -1
- package/dist/esm/chips/chip/index.js +1 -1
- package/dist/esm/chips/chip-set/index.js +1 -1
- package/dist/esm/chips/index.js +1 -1
- package/dist/esm/chunks/{chunk.Q6IP5GJ6.js → chunk.246JM2YT.js} +2 -2
- package/dist/esm/chunks/{chunk.DHTAH23Y.js → chunk.24L5GDD2.js} +2 -2
- package/dist/esm/chunks/{chunk.ZWTZJJ6H.js → chunk.2IQGDFQS.js} +2 -2
- package/dist/esm/chunks/{chunk.DAGXGSX7.js → chunk.2LRDPTHK.js} +2 -2
- package/dist/esm/chunks/{chunk.Q47M2LB5.js → chunk.2QFIMTVP.js} +2 -2
- package/dist/esm/chunks/{chunk.IVB6XTHQ.js → chunk.2TQONIPK.js} +2 -2
- package/dist/esm/chunks/{chunk.DXHKS7XO.js → chunk.2XFVFZ3P.js} +2 -2
- package/dist/esm/chunks/{chunk.3ICROIFD.js → chunk.2YAU7AXH.js} +2 -2
- package/dist/esm/chunks/{chunk.5B2CGITX.js → chunk.2YX7ASSX.js} +2 -2
- package/dist/esm/chunks/{chunk.QLNGQCJX.js → chunk.2ZTERGYF.js} +2 -2
- package/dist/esm/chunks/{chunk.Y2ANYRZH.js → chunk.4EB5NVCK.js} +2 -2
- package/dist/esm/chunks/{chunk.SACZLJPQ.js → chunk.4LVS2EYJ.js} +2 -2
- package/dist/esm/chunks/{chunk.E3VXLUEY.js → chunk.5IVB5L5Z.js} +2 -2
- package/dist/esm/chunks/{chunk.QO37K76P.js → chunk.6SBTLXLH.js} +2 -2
- package/dist/esm/chunks/{chunk.BTZF6QGA.js → chunk.7JQHQKXN.js} +2 -2
- package/dist/esm/chunks/{chunk.TWV4OTF7.js → chunk.A5MBSCSQ.js} +2 -2
- package/dist/esm/chunks/{chunk.4EF7UJDK.js → chunk.A5R7KUIP.js} +2 -2
- package/dist/esm/chunks/{chunk.NQH4ZCXJ.js → chunk.AGMPIMJV.js} +2 -2
- package/dist/esm/chunks/{chunk.PMY4KVCF.js → chunk.BKCEVPKW.js} +2 -2
- package/dist/esm/chunks/{chunk.I5MLIFN5.js → chunk.BSTIDYQJ.js} +2 -2
- package/dist/esm/chunks/{chunk.MZNL36GJ.js → chunk.CNQESSA3.js} +2 -2
- package/dist/esm/chunks/{chunk.6FISJTFJ.js → chunk.E6KWYFZG.js} +2 -2
- package/dist/esm/chunks/{chunk.H3SBIXK5.js → chunk.ECRL6O3V.js} +2 -2
- package/dist/esm/chunks/{chunk.SBDWCXK3.js → chunk.ER52NFXX.js} +2 -2
- package/dist/esm/chunks/{chunk.GSQF3ACL.js → chunk.EUE3OVC7.js} +2 -2
- package/dist/esm/chunks/{chunk.DGNS4JNN.js → chunk.FAANPQES.js} +2 -2
- package/dist/esm/chunks/{chunk.MZLPUI6R.js → chunk.FYWPZFLJ.js} +2 -2
- package/dist/esm/chunks/{chunk.MZLPUI6R.js.map → chunk.FYWPZFLJ.js.map} +2 -2
- package/dist/esm/chunks/{chunk.LMSXJOPL.js → chunk.GF2GUVYS.js} +2 -2
- package/dist/esm/chunks/{chunk.QKRB6AIQ.js → chunk.GHSAKRYH.js} +2 -2
- package/dist/esm/chunks/{chunk.JHTGKXXX.js → chunk.GJW4WS4I.js} +2 -2
- package/dist/esm/chunks/{chunk.IW37LUQJ.js → chunk.GUYPITGA.js} +2 -2
- package/dist/esm/chunks/chunk.GWIVOPRO.js +7 -0
- package/dist/esm/chunks/chunk.GWIVOPRO.js.map +7 -0
- package/dist/esm/chunks/{chunk.G75X57KY.js → chunk.HKJEGD6C.js} +2 -2
- package/dist/esm/chunks/{chunk.3ARIVYGG.js → chunk.IGK3VYZG.js} +2 -2
- package/dist/esm/chunks/chunk.JHXNEHWR.js +12 -0
- package/dist/esm/chunks/{chunk.7MDHI4PT.js → chunk.JVW6JGV3.js} +2 -2
- package/dist/esm/chunks/{chunk.LQ4RD7WW.js → chunk.MXNLCQRB.js} +2 -2
- package/dist/esm/chunks/chunk.OHNPVHPF.js +7 -0
- package/dist/esm/chunks/chunk.OHNPVHPF.js.map +7 -0
- package/dist/esm/chunks/{chunk.GZZ6GFKT.js → chunk.OT6H5NHX.js} +2 -2
- package/dist/esm/chunks/{chunk.PG4HEEX2.js → chunk.OTVT3XM2.js} +2 -2
- package/dist/esm/chunks/{chunk.VSO5QDBV.js → chunk.P5QIB6OY.js} +2 -2
- package/dist/esm/chunks/{chunk.XUV63FEH.js → chunk.PPPTT3SM.js} +2 -2
- package/dist/esm/chunks/{chunk.GZRMHYID.js → chunk.QA3NU7EN.js} +2 -2
- package/dist/esm/chunks/{chunk.MVYTV6WX.js → chunk.QYKO543K.js} +2 -2
- package/dist/esm/chunks/{chunk.XI4RWFCG.js → chunk.RHYRMQS7.js} +2 -2
- package/dist/esm/chunks/{chunk.Q4SCW4FN.js → chunk.RUSHOL23.js} +2 -2
- package/dist/esm/chunks/{chunk.AD4CP4UK.js → chunk.SIJGKRYS.js} +2 -2
- package/dist/esm/chunks/{chunk.BIJJCDHE.js → chunk.STGRPD2L.js} +2 -2
- package/dist/esm/chunks/{chunk.BIJJCDHE.js.map → chunk.STGRPD2L.js.map} +1 -1
- package/dist/esm/chunks/{chunk.RTMDWDS4.js → chunk.SYZB7B4F.js} +2 -2
- package/dist/esm/chunks/{chunk.GYPPM2D2.js → chunk.SZIM4KFZ.js} +2 -2
- package/dist/esm/chunks/{chunk.UXQZFI55.js → chunk.THPU5KBV.js} +2 -2
- package/dist/esm/chunks/{chunk.K6VWRQWY.js → chunk.TXFYS6EU.js} +2 -2
- package/dist/esm/chunks/{chunk.ZLFH7VOM.js → chunk.V4RBOYNH.js} +2 -2
- package/dist/esm/chunks/{chunk.4B22UXEH.js → chunk.WFDIA7R6.js} +2 -2
- package/dist/esm/chunks/{chunk.DCCJTW7C.js → chunk.XMFQFFKR.js} +2 -2
- package/dist/esm/chunks/{chunk.JRV5FYMW.js → chunk.YUAU5IWT.js} +2 -2
- package/dist/esm/chunks/{chunk.YSFUL5AD.js → chunk.YZLASVCK.js} +2 -2
- package/dist/esm/chunks/{chunk.R7MQKCHR.js → chunk.Z5TWWM7I.js} +2 -2
- package/dist/esm/color-picker/index.js +1 -1
- package/dist/esm/date-picker/index.js +1 -1
- package/dist/esm/date-range-picker/index.js +1 -1
- package/dist/esm/expansion-panel/index.js +1 -1
- package/dist/esm/file-picker/index.js +1 -1
- package/dist/esm/floating-action-button/index.js +1 -1
- package/dist/esm/icon-button/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/list/index.js +1 -1
- package/dist/esm/list/list/index.js +1 -1
- package/dist/esm/list/list-item/index.js +1 -1
- package/dist/esm/list-dropdown/index.js +1 -1
- package/dist/esm/menu/index.js +1 -1
- package/dist/esm/open-icon/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/profile-card/index.js +1 -1
- package/dist/esm/quantity-field/index.js +1 -1
- package/dist/esm/radio/index.js +1 -1
- package/dist/esm/ripple/index.js +1 -1
- package/dist/esm/select/core/index.js +1 -1
- package/dist/esm/select/index.js +1 -1
- package/dist/esm/select/select/index.js +1 -1
- package/dist/esm/select/select-dropdown/index.js +1 -1
- package/dist/esm/slider/index.js +1 -1
- package/dist/esm/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view-panel/index.js +1 -1
- package/dist/esm/stepper/index.js +1 -1
- package/dist/esm/stepper/step/index.js +1 -1
- package/dist/esm/stepper/stepper/index.js +1 -1
- package/dist/esm/switch/index.js +1 -1
- package/dist/esm/table/index.js +1 -1
- package/dist/esm/tabs/index.js +1 -1
- package/dist/esm/tabs/tab/index.js +1 -1
- package/dist/esm/tabs/tab-bar/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/dist/esm/toast/index.js +1 -1
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/tabs/tab/tab-adapter.d.ts +14 -38
- package/esm/tabs/tab/tab-adapter.js +65 -78
- package/esm/tabs/tab/tab-constants.d.ts +13 -13
- package/esm/tabs/tab/tab-constants.js +18 -10
- package/esm/tabs/tab/tab-foundation.d.ts +24 -23
- package/esm/tabs/tab/tab-foundation.js +68 -62
- package/esm/tabs/tab/tab-ripple.d.ts +17 -0
- package/esm/tabs/tab/tab-ripple.js +33 -0
- package/esm/tabs/tab/tab.d.ts +56 -19
- package/esm/tabs/tab/tab.js +77 -31
- package/esm/tabs/tab-bar/tab-bar-adapter.d.ts +49 -87
- package/esm/tabs/tab-bar/tab-bar-adapter.js +114 -188
- package/esm/tabs/tab-bar/tab-bar-constants.d.ts +15 -45
- package/esm/tabs/tab-bar/tab-bar-constants.js +22 -56
- package/esm/tabs/tab-bar/tab-bar-foundation.d.ts +56 -65
- package/esm/tabs/tab-bar/tab-bar-foundation.js +241 -302
- package/esm/tabs/tab-bar/tab-bar.d.ts +51 -36
- package/esm/tabs/tab-bar/tab-bar.js +84 -52
- package/package.json +1 -1
- package/styles/core/style-layer/tabs/tab/_core.scss +419 -0
- package/styles/core/style-layer/tabs/tab/_variables.scss +20 -0
- package/styles/core/style-layer/tabs/tab/index.scss +13 -0
- package/styles/core/style-layer/tabs/tab-bar/_core.scss +110 -0
- package/styles/core/style-layer/tabs/tab-bar/_variables.scss +9 -0
- package/styles/core/style-layer/tabs/tab-bar/index.scss +13 -0
- package/styles/tabs/tab/_mixins.scss +46 -128
- package/styles/tabs/tab/_variables.scss +26 -4
- package/styles/tabs/tab/tab.scss +50 -11
- package/styles/tabs/tab-bar/_mixins.scss +20 -60
- package/styles/tabs/tab-bar/_variables.scss +11 -0
- package/styles/tabs/tab-bar/tab-bar.scss +29 -2
- package/dist/esm/chunks/chunk.4QPMNWJ3.js +0 -129
- package/dist/esm/chunks/chunk.4QPMNWJ3.js.map +0 -7
- package/dist/esm/chunks/chunk.D3IAEEPM.js +0 -201
- package/dist/esm/chunks/chunk.D3IAEEPM.js.map +0 -7
- package/dist/esm/chunks/chunk.NV4U4DE6.js +0 -12
- /package/dist/esm/chunks/{chunk.Q6IP5GJ6.js.map → chunk.246JM2YT.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DHTAH23Y.js.map → chunk.24L5GDD2.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZWTZJJ6H.js.map → chunk.2IQGDFQS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DAGXGSX7.js.map → chunk.2LRDPTHK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.Q47M2LB5.js.map → chunk.2QFIMTVP.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.IVB6XTHQ.js.map → chunk.2TQONIPK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DXHKS7XO.js.map → chunk.2XFVFZ3P.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.3ICROIFD.js.map → chunk.2YAU7AXH.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.5B2CGITX.js.map → chunk.2YX7ASSX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QLNGQCJX.js.map → chunk.2ZTERGYF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.Y2ANYRZH.js.map → chunk.4EB5NVCK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.SACZLJPQ.js.map → chunk.4LVS2EYJ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.E3VXLUEY.js.map → chunk.5IVB5L5Z.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QO37K76P.js.map → chunk.6SBTLXLH.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.BTZF6QGA.js.map → chunk.7JQHQKXN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.TWV4OTF7.js.map → chunk.A5MBSCSQ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4EF7UJDK.js.map → chunk.A5R7KUIP.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NQH4ZCXJ.js.map → chunk.AGMPIMJV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PMY4KVCF.js.map → chunk.BKCEVPKW.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.I5MLIFN5.js.map → chunk.BSTIDYQJ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MZNL36GJ.js.map → chunk.CNQESSA3.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.6FISJTFJ.js.map → chunk.E6KWYFZG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.H3SBIXK5.js.map → chunk.ECRL6O3V.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.SBDWCXK3.js.map → chunk.ER52NFXX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GSQF3ACL.js.map → chunk.EUE3OVC7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DGNS4JNN.js.map → chunk.FAANPQES.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.LMSXJOPL.js.map → chunk.GF2GUVYS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QKRB6AIQ.js.map → chunk.GHSAKRYH.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.JHTGKXXX.js.map → chunk.GJW4WS4I.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.IW37LUQJ.js.map → chunk.GUYPITGA.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.G75X57KY.js.map → chunk.HKJEGD6C.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.3ARIVYGG.js.map → chunk.IGK3VYZG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NV4U4DE6.js.map → chunk.JHXNEHWR.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7MDHI4PT.js.map → chunk.JVW6JGV3.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.LQ4RD7WW.js.map → chunk.MXNLCQRB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GZZ6GFKT.js.map → chunk.OT6H5NHX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PG4HEEX2.js.map → chunk.OTVT3XM2.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.VSO5QDBV.js.map → chunk.P5QIB6OY.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.XUV63FEH.js.map → chunk.PPPTT3SM.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GZRMHYID.js.map → chunk.QA3NU7EN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MVYTV6WX.js.map → chunk.QYKO543K.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.XI4RWFCG.js.map → chunk.RHYRMQS7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.Q4SCW4FN.js.map → chunk.RUSHOL23.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.AD4CP4UK.js.map → chunk.SIJGKRYS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.RTMDWDS4.js.map → chunk.SYZB7B4F.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GYPPM2D2.js.map → chunk.SZIM4KFZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.UXQZFI55.js.map → chunk.THPU5KBV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.K6VWRQWY.js.map → chunk.TXFYS6EU.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZLFH7VOM.js.map → chunk.V4RBOYNH.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4B22UXEH.js.map → chunk.WFDIA7R6.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DCCJTW7C.js.map → chunk.XMFQFFKR.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.JRV5FYMW.js.map → chunk.YUAU5IWT.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.YSFUL5AD.js.map → chunk.YZLASVCK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.R7MQKCHR.js.map → chunk.Z5TWWM7I.js.map} +0 -0
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as E}from"./chunk.H5D54EHO.js";import{b as I}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as E}from"./chunk.H5D54EHO.js";import{b as I}from"./chunk.SZIM4KFZ.js";import{b as f}from"./chunk.NVMILGC2.js";import{a as g}from"./chunk.RFLASSCI.js";import{a as m,b as h,d as b}from"./chunk.DTZFWZPB.js";import{a as u,h as _,k as d}from"./chunk.NK7H3MMM.js";import{f as l,m as c,t as p}from"./chunk.CFDK4RCW.js";import{k as s,l as a}from"./chunk.J2M2MXP2.js";import{d as r}from"./chunk.M3QDAYD2.js";var v=`${h}icon-button`,y={TOGGLE:"toggle",IS_ON:"is-on",ICON_ON:"forge-icon-button-on",DENSE:"dense",DENSITY_LEVEL:"density-level"},L={BUTTON:"button, a",ICON:"i, span, svg, img, forge-icon"},B={BUTTON:"forge-icon-button",BUTTON_ON:"forge-icon-button--on",BUTTON_DENSE:"forge-icon-button--dense",ICON:"forge-icon-button__icon",ICON_ON:"forge-icon-button__icon--on",DENSITY:["forge-icon-button--dense-1","forge-icon-button--dense-2","forge-icon-button--dense-3","forge-icon-button--dense-4","forge-icon-button--dense-5","forge-icon-button--dense-6"]},S={CHANGE:`${v}-change`},e={elementName:v,attributes:y,selectors:L,classes:B,events:S};var o=class extends d{constructor(){super();this._toggle=!1;this._isOn=!1;this._dense=!1;this._densityLevel=5}static get observedAttributes(){return[e.attributes.IS_ON,e.attributes.DENSE,e.attributes.DENSITY_LEVEL,e.attributes.TOGGLE]}connectedCallback(){this.querySelector(e.selectors.BUTTON)?this._initialize():c(this,e.selectors.BUTTON).then(()=>this._initialize())}disconnectedCallback(){this._rippleInstance&&this._rippleInstance.destroy()}attributeChangedCallback(t,n,i){switch(t){case e.attributes.IS_ON:this.isOn=s(i);break;case e.attributes.DENSE:this.dense=s(i);break;case e.attributes.DENSITY_LEVEL:this.densityLevel=a(i);break;case e.attributes.TOGGLE:this.toggle=s(i);break}}get toggle(){return this._toggle}set toggle(t){this._toggle=t,this._toggle?this._initializeToggle():this._destroyToggle()}get isOn(){return this._isOn}set isOn(t){this._isOn!==t&&(this._isOn=t,this._applyToggle())}get dense(){return this._dense}set dense(t){this._dense!==t&&(this._dense=t,this._applyDensity())}get densityLevel(){return this._densityLevel}set densityLevel(t){this._densityLevel!==t&&(this._densityLevel=t,this._densityLevel<=0?this._densityLevel=1:this._densityLevel>6?this._densityLevel=6:typeof this._densityLevel!="number"&&(this._densityLevel=5),this._applyDensity())}_initialize(){this._buttonElement=this.querySelector(e.selectors.BUTTON),this._buttonElement&&(this._buttonElement.classList.add(e.classes.BUTTON),this._applyToggle(),this._applyDensity(),this._toggleHandler=()=>{this._toggleValue(),_(this,e.events.CHANGE,this._isOn,!0)},this._toggle&&this._initializeToggle(),this._deferRippleInitialization())}async _deferRippleInitialization(){let t=await f(this._buttonElement);this._rippleInstance||(this._rippleInstance=this._createRipple(),t==="focusin"&&this._rippleInstance.handleFocus())}_createRipple(){this._rippleInstance&&this._rippleInstance.destroy();let t=new I(this._buttonElement);return t.unbounded=!0,t}_toggleValue(){this._isOn=!this._isOn,this._applyToggle()}_applyToggle(){this._buttonElement&&(p(this._buttonElement,this._isOn,e.classes.BUTTON_ON),this._toggle&&this._buttonElement.setAttribute("aria-pressed",`${this._isOn}`))}_applyDensity(){if(this._buttonElement){if(e.classes.DENSITY.forEach(t=>this._buttonElement.classList.remove(t)),this._dense){if(this.setAttribute(e.attributes.DENSE,""),this._buttonElement.classList.add(e.classes.BUTTON_DENSE),this._densityLevel<7&&this._densityLevel>0&&this.densityLevel!==5){let t=e.classes.DENSITY[this._densityLevel-1];this._buttonElement.classList.add(t),this.setAttribute(e.attributes.DENSITY_LEVEL,this._densityLevel.toString())}}else this.removeAttribute(e.attributes.DENSE),this._buttonElement.classList.remove(e.classes.BUTTON_DENSE);this._rippleInstance&&this._rippleInstance.layout()}}_initializeToggle(){if(!this._buttonElement)return;let t=Array.from(this._buttonElement.querySelectorAll(e.selectors.ICON));if(t.length!==2){console.error('You must specify two icons, one for "on" and one for "off".');return}if(t.forEach(n=>n.classList.add(e.classes.ICON)),!t.some(n=>n.classList.contains(e.classes.ICON_ON))){let n=t.find(i=>i.hasAttribute(e.attributes.ICON_ON));n?n.classList.add(e.classes.ICON_ON):t[0].classList.add(e.classes.ICON_ON)}this._buttonElement.addEventListener("click",this._toggleHandler),window.requestAnimationFrame(()=>{this._isOn&&(this._buttonElement.classList.add(e.classes.BUTTON_ON),this._buttonElement.setAttribute("aria-pressed",`${this._isOn}`))})}_destroyToggle(){this._buttonElement&&this._buttonElement.removeEventListener("click",this._toggleHandler)}layout(){this._rippleInstance&&this._rippleInstance.layout()}};o=r([m({name:e.elementName})],o);var N=class extends g{constructor(t){super(t)}_build(){var n;let t=document.createElement(e.elementName);if(this._buttonElement=document.createElement("button"),this._buttonElement.type="button",t.appendChild(this._buttonElement),(n=this._config.options)!=null&&n.tooltip){let i=document.createElement("forge-tooltip");i.textContent=this._config.options.tooltip,this._config.options.tooltipPosition&&(i.position=this._config.options.tooltipPosition),t.appendChild(i)}return t}get iconElement(){return this._iconElement}get disabled(){return!!this._buttonElement.disabled}set disabled(t){this._buttonElement.disabled=t}get butttonElement(){return this._buttonElement}get buttonElement(){return this._buttonElement}_configure(){this._configureIcon()}_configureIcon(){var n,i;if(!((n=this._config.options)!=null&&n.iconName))return;switch(((i=this._config.options)==null?void 0:i.iconType)||"component"){case"font":let O=Array.isArray(this._config.options.iconClass)?this._config.options.iconClass:[b];l(O,this._buttonElement),this._buttonElement.textContent=this._config.options.iconName;break;case"component":this._iconElement=document.createElement(E.elementName),this._iconElement.name=this._config.options.iconName,this._config.options.iconExternal!==void 0&&(this._iconElement.external=!!this._config.options.iconExternal),this._config.options.iconExternalType&&(this._iconElement.externalType=this._config.options.iconExternalType),this._config.options.iconClass&&l(this._config.options.iconClass,this._iconElement),this._buttonElement.appendChild(this._iconElement);break}}onClick(t){this._buttonElement.addEventListener("click",t)}onFocus(t){this._buttonElement.addEventListener("focus",n=>t(n))}onBlur(t){this._buttonElement.addEventListener("blur",n=>t(n))}};function W(){u(o)}export{e as a,o as b,N as c,W as d};
|
|
7
|
+
//# sourceMappingURL=chunk.A5R7KUIP.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{c as x,d as D}from"./chunk.Q6IP5GJ6.js";import{a as y}from"./chunk.RFLASSCI.js";import{a as l}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.5V5ABSHI.js";import{a as b,b as L}from"./chunk.DTZFWZPB.js";import{a as v,e as f,f as c,k as _}from"./chunk.NK7H3MMM.js";import{k as p,l as u}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var C=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${C}-change`},i={elementName:C,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){var n,o;e?(this._container.removeEventListener("click",this._inputEventListener),(n=this._button)==null||n.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),(o=this._button)==null||o.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var g=class{constructor(t){this._adapter=t;this._isInitialized=!1;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton(),this._adapter.setDisabled(this._disabled),this._isInitialized=!0}destroy(){this._isInitialized=!1}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let n=e.files;this._handleFiles(n)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let n=this._sortFiles(t),o=n.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=n}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],n=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:n};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?n.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:n}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),this._adapter.toggleHostAttribute(i.attributes.ACCEPT,!!t,String(t)))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,this._adapter.toggleHostAttribute(i.attributes.MAX_SIZE,!!t,String(t)))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),this._adapter.toggleHostAttribute(i.attributes.CAPTURE,!!t,String(t)))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),this._adapter.toggleHostAttribute(i.attributes.MULTIPLE,t))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._isInitialized&&this._adapter.setDisabled(t),this._adapter.toggleHostAttribute(i.attributes.DISABLED,t))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?this._removeDragListeners():this._registerDragListeners(),this._adapter.toggleHostAttribute(i.attributes.COMPACT,t))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),this._adapter.toggleHostAttribute(i.attributes.BORDERLESS,t))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",a=class extends _{constructor(){super();f(this,F,O),this._foundation=new g(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(e,n,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],a.prototype,"accept",2),s([l()],a.prototype,"maxSize",2),s([l()],a.prototype,"capture",2),s([l()],a.prototype,"multiple",2),s([l()],a.prototype,"disabled",2),s([l()],a.prototype,"compact",2),s([l()],a.prototype,"borderless",2),a=s([b({name:i.elementName,dependencies:[x]})],a);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,n,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((n=this._config.options)!=null&&n.buttonText&&new D({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function ce(){v(a)}export{i as a,d as b,g as c,a as d,k as e,ce as f};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{c as x,d as D}from"./chunk.246JM2YT.js";import{a as y}from"./chunk.RFLASSCI.js";import{a as l}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.5V5ABSHI.js";import{a as b,b as L}from"./chunk.DTZFWZPB.js";import{a as v,e as f,f as c,k as _}from"./chunk.NK7H3MMM.js";import{k as p,l as u}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var C=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${C}-change`},i={elementName:C,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){var n,o;e?(this._container.removeEventListener("click",this._inputEventListener),(n=this._button)==null||n.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),(o=this._button)==null||o.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var g=class{constructor(t){this._adapter=t;this._isInitialized=!1;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton(),this._adapter.setDisabled(this._disabled),this._isInitialized=!0}destroy(){this._isInitialized=!1}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let n=e.files;this._handleFiles(n)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let n=this._sortFiles(t),o=n.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=n}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],n=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:n};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?n.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:n}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),this._adapter.toggleHostAttribute(i.attributes.ACCEPT,!!t,String(t)))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,this._adapter.toggleHostAttribute(i.attributes.MAX_SIZE,!!t,String(t)))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),this._adapter.toggleHostAttribute(i.attributes.CAPTURE,!!t,String(t)))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),this._adapter.toggleHostAttribute(i.attributes.MULTIPLE,t))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._isInitialized&&this._adapter.setDisabled(t),this._adapter.toggleHostAttribute(i.attributes.DISABLED,t))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?this._removeDragListeners():this._registerDragListeners(),this._adapter.toggleHostAttribute(i.attributes.COMPACT,t))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),this._adapter.toggleHostAttribute(i.attributes.BORDERLESS,t))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",a=class extends _{constructor(){super();f(this,F,O),this._foundation=new g(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(e,n,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],a.prototype,"accept",2),s([l()],a.prototype,"maxSize",2),s([l()],a.prototype,"capture",2),s([l()],a.prototype,"multiple",2),s([l()],a.prototype,"disabled",2),s([l()],a.prototype,"compact",2),s([l()],a.prototype,"borderless",2),a=s([b({name:i.elementName,dependencies:[x]})],a);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,n,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((n=this._config.options)!=null&&n.buttonText&&new D({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function ce(){v(a)}export{i as a,d as b,g as c,a as d,k as e,ce as f};
|
|
7
|
+
//# sourceMappingURL=chunk.AGMPIMJV.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{d as at}from"./chunk.TT2VTZJ6.js";import{h as st}from"./chunk.RTMDWDS4.js";import{e as it}from"./chunk.7G72CBOJ.js";import{c as et}from"./chunk.Q47M2LB5.js";import{e as tt}from"./chunk.E3VXLUEY.js";import{a as f,b as nt}from"./chunk.PHTOULRR.js";import{a as rt}from"./chunk.LIKJD4SK.js";import{a as F}from"./chunk.MGLWXAZO.js";import{a as C,b as ot}from"./chunk.4EF7UJDK.js";import{j as K}from"./chunk.MZLPUI6R.js";import{a as Q,d as Z,l as E}from"./chunk.H5D54EHO.js";import{g as J}from"./chunk.XIQFHO5R.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.DMCBAYQX.js";import{a as $}from"./chunk.G4IN6Y46.js";import{a as u}from"./chunk.NVUMRW44.js";import{a as W}from"./chunk.5V5ABSHI.js";import{a as R,b as z}from"./chunk.DTZFWZPB.js";import{a as N,e as H,f as V,h as U,k as B}from"./chunk.NK7H3MMM.js";import{m as A,s as P,u as x}from"./chunk.CFDK4RCW.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,d as p}from"./chunk.M3QDAYD2.js";var h=`${z}time-picker`,lt={TOGGLE:"forge-time-picker-toggle",VALUE:"value",OPEN:"open",ALLOW_SECONDS:"allow-seconds",MASKED:"masked",SHOW_MASK_FORMAT:"show-mask-format",USE_24_HOUR_TIME:"use-24-hour-time",ALLOW_INVALID_TIME:"allow-invalid-time",MIN:"min",MAX:"max",START_TIME:"start-time",STEP:"step",ALLOW_INPUT:"allow-input",SHOW_NOW:"show-now",SHOW_HOUR_OPTIONS:"show-hour-options",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",ALLOW_DROPDOWN:"allow-dropdown"},ft={INPUT:"input, input[forge-time-picker-input]",TOGGLE:`[${lt.TOGGLE}]`},gt={OPEN:`${h}-open`,CLOSE:`${h}-close`,INPUT:`${h}-input`,CHANGE:`${h}-change`},vt={DEFAULT_MINUTE_STEP:60,MAX_DAY_MILLIS:864e5,MAX_DAY_MINUTES:1440},s={elementName:h,attributes:lt,selectors:ft,events:gt,numbers:vt};var g=class extends W{constructor(e){super(e)}initialize(){this._inputElement=this._component.querySelector(s.selectors.INPUT)}initializeMask(e){this.destroyMask(),this._inputMask=new J(this._inputElement,e)}destroy(){this._targetElement=void 0,this._toggleElement=void 0,this._inputElement=void 0}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false")}addInputListener(e,i,n){this._inputElement.addEventListener(e,i,{capture:n})}removeInputListener(e,i,n){this._inputElement&&this._inputElement.removeEventListener(e,i,{capture:n})}addToggleListener(e,i){this._toggleElement&&this._toggleElement.addEventListener(e,i)}removeToggleListener(e,i){this._toggleElement&&this._toggleElement.removeEventListener(e,i)}hasInputElement(){return!!this._inputElement}tryCreateToggle(){let e=this._component.querySelector(f.elementName),i=this._component.querySelector(s.selectors.TOGGLE);if(e){let n=e.querySelector(`${C.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let a=document.createElement(C.elementName);a.slot="trailing",a.dense=!0,a.densityLevel=3,a.style.marginRight="4px";let r=document.createElement("button");r.type="button",r.tabIndex=-1,r.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",r.appendChild(d),a.appendChild(r),e.appendChild(a),this._toggleElement=a}else i&&(this._toggleElement=i)}tryFocusInput(){this._inputElement.select()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return P()===this._inputElement}setInputValue(e,i){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.update(),i&&(this._emitInputEvent("change"),this._emitInputEvent("input")))}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this.setToggleDisabled(e)}attachDropdown(e){this._listDropdown=new st(this._inputElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`)}detachDropdown(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0),this._inputElement.removeAttribute("aria-controls")}propagateKey(e){var i;(i=this._listDropdown)==null||i.handleKey(e)}setActiveDescendant(e){x(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._getTargetElement(e).getBoundingClientRect().width}_emitInputEvent(e){this._inputElement.dispatchEvent(new Event(e))}emitInputEvent(e,i){U(this._inputElement,e,i)}setInputReadonly(e){this._inputElement.readOnly=e}setToggleDisabled(e){if(this._toggleElement)if(this._toggleElement.setAttribute("aria-disabled",e.toString()),"disabled"in this._toggleElement)this._toggleElement.disabled=e;else{let i=this._toggleElement.querySelector("button");i&&(i.disabled=e)}}hasActiveOption(){var e,i;return((i=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?i:-1)>=0}activateOptionByIndex(e){var i;(i=this._listDropdown)==null||i.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOption(){var e;return(e=this._listDropdown)==null?void 0:e.getActiveOption()}_getTargetElement(e){return this._targetElement?this._targetElement:(this._targetElement=e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement(),this._targetElement)}_getDefaultTargetElement(){let e=this._component.querySelector(f.elementName);if(e&&e.shadowRoot){let i=V(e,f.selectors.ROOT);if(i)return i}return this._component}};function v(o,t,e){if(!o||/^\s*$/.test(o))return null;let i=0,n=0,a=0;if(b.test(o)){let r=G(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0}else if(X.test(o)){let r=q(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0,i===12&&r.meridiem==="AM"&&(i=0),i<12&&r.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+T(n)+(e?O(a):0)}function c(o,t,e){if(typeof o!="number"||o<0)return null;let i=Math.min(pt(o),23),n=Math.min(ut(o),59),r=o/(1e3*60)<720?"AM":"PM";t||(i=i<=12?i:i-12,i===0&&(i=12));let d=`${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`;if(e){let _=Math.min(M(o),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${r}`),d}function pt(o){return Math.abs(Math.floor(o/(1e3*60*60)))}function ut(o){return Math.abs(Math.floor(I(o)%60))}function I(o){return o/(1e3*60)}function M(o){return Math.abs(Math.floor(It(o)%60))}function It(o){return o/1e3}function dt(o){return o*60*60*1e3}function T(o){return o*60*1e3}function O(o){return o*1e3}function ct(o){return o-O(M(o))}function S(o){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+T(i)+(o?O(t.getSeconds()):0)}function Rt(o,t,e=!1){o||(o=new Date);let i=v(t,!0,e);if(!i)return o.setHours(0,0,0),o;let n=pt(i),a=828e5;n>a?n=a:n<0&&(n=0);let r=ut(i),d=e?M(i):0;return o.setHours(n,r,d),o}var k=class{constructor(t){this._adapter=t;this._value=null;this._masked=!0;this._use24HourTime=!1;this._showMaskFormat=!1;this._min=null;this._max=null;this._restrictedTimes=[];this._startTime=null;this._step=s.numbers.DEFAULT_MINUTE_STEP;this._allowInput=!0;this._open=!1;this._allowSeconds=!1;this._allowInvalidTime=!1;this._showNow=!1;this._showHourOptions=!0;this._customOptions=[];this._disabled=!1;this._popupClasses=[];this._allowDropdown=!0;this._isInitialized=!1;this._identifier=D(),this._inputListener=e=>this._onInput(e),this._inputKeydownListener=e=>this._onInputKeydown(e),this._toggleMousedownListener=e=>this._onToggleMousedown(e),this._inputFocusListener=e=>this._onInputFocus(e),this._inputBlurListener=e=>this._onInputBlur(e),this._inputMousedownListener=e=>this._onInputMousedown(e)}initialize(){if(this._adapter.initialize(),!this._adapter.hasInputElement())throw new Error("Unable to locate <input> element to attach to.");if(this._adapter.initializeAccessibility(this._identifier),!this._value){let t=this._adapter.getInputValue();this._setValue(this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds))}this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._formatInputValue(!1),typeof this._value=="number"&&this._applyValue(this._value,!1),this._applyAllowInput(),this._applyAllowDropdown(),this._applyDisabled(),this._applyMask(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._masked&&this._adapter.destroyMask(),this._closeDropdown(),this._adapter.destroy()}_onInput(t){this._handleInput(this._adapter.getInputValue())}_onInputKeydown(t){var e,i;if(t.shiftKey)switch(t.code){case"Backspace":case"Delete":t.preventDefault(),this._trySetValue(null)&&this._formatInputValue();return}switch(t.code){case"Tab":this._open&&this._selectActiveOption();break;case"Esc":case"Escape":this._open&&(t.preventDefault(),t.stopPropagation(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption():(this._openDropdown(),typeof((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0?this._adapter.activateOptionByIndex((i=this._dropdownConfig)==null?void 0:i.visibleStartIndex):this._adapter.activateFirstOption()));break;case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&(this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption()));break;case"Enter":case"NumpadEnter":case"Home":case"End":this._open&&((t.code==="Enter"||t.code==="NumpadEnter")&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let n=S(this._allowSeconds);if(this._value!==n){let a=c(n,!0,this._allowSeconds);this._emitChangeEvent(a)&&(this._applyValue(n),this._selectInputText())}break}}_trySetActiveOption(){var t,e;!this._adapter.hasActiveOption()&&typeof((t=this._dropdownConfig)==null?void 0:t.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0&&this._adapter.activateOptionByIndex((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)}_selectActiveOption(){let t=this._adapter.getActiveOption();t&&this._onSelect(t.value)}_onToggleMousedown(t){this._disabled||!this.allowDropdown||(t.stopPropagation(),!this._adapter.isInputDisabled()&&(t.preventDefault(),this._open?this._closeDropdown(!0):(F.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openDropdown())))}_onInputFocus(t){this._allowInput&&this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&this._applyMask()}_onInputBlur(t){this.masked&&this._showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){this._adapter.destroyMask();let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);this._emitChangeEvent(e)&&(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t)}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function Ne(){N(l)}export{s as a,g as b,v as c,c as d,pt as e,ut as f,I as g,M as h,It as i,dt as j,T as k,O as l,ct as m,S as n,Rt as o,k as p,l as q,mt as r,Ne as s};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{d as at}from"./chunk.TT2VTZJ6.js";import{h as st}from"./chunk.SYZB7B4F.js";import{e as it}from"./chunk.7G72CBOJ.js";import{c as et}from"./chunk.2QFIMTVP.js";import{e as tt}from"./chunk.5IVB5L5Z.js";import{a as f,b as nt}from"./chunk.PHTOULRR.js";import{a as rt}from"./chunk.LIKJD4SK.js";import{a as F}from"./chunk.MGLWXAZO.js";import{a as C,b as ot}from"./chunk.A5R7KUIP.js";import{j as K}from"./chunk.FYWPZFLJ.js";import{a as Q,d as Z,l as E}from"./chunk.H5D54EHO.js";import{g as J}from"./chunk.XIQFHO5R.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.DMCBAYQX.js";import{a as $}from"./chunk.G4IN6Y46.js";import{a as u}from"./chunk.NVUMRW44.js";import{a as W}from"./chunk.5V5ABSHI.js";import{a as R,b as z}from"./chunk.DTZFWZPB.js";import{a as N,e as H,f as V,h as U,k as B}from"./chunk.NK7H3MMM.js";import{m as A,s as P,u as x}from"./chunk.CFDK4RCW.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,d as p}from"./chunk.M3QDAYD2.js";var h=`${z}time-picker`,lt={TOGGLE:"forge-time-picker-toggle",VALUE:"value",OPEN:"open",ALLOW_SECONDS:"allow-seconds",MASKED:"masked",SHOW_MASK_FORMAT:"show-mask-format",USE_24_HOUR_TIME:"use-24-hour-time",ALLOW_INVALID_TIME:"allow-invalid-time",MIN:"min",MAX:"max",START_TIME:"start-time",STEP:"step",ALLOW_INPUT:"allow-input",SHOW_NOW:"show-now",SHOW_HOUR_OPTIONS:"show-hour-options",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",ALLOW_DROPDOWN:"allow-dropdown"},ft={INPUT:"input, input[forge-time-picker-input]",TOGGLE:`[${lt.TOGGLE}]`},gt={OPEN:`${h}-open`,CLOSE:`${h}-close`,INPUT:`${h}-input`,CHANGE:`${h}-change`},vt={DEFAULT_MINUTE_STEP:60,MAX_DAY_MILLIS:864e5,MAX_DAY_MINUTES:1440},s={elementName:h,attributes:lt,selectors:ft,events:gt,numbers:vt};var g=class extends W{constructor(e){super(e)}initialize(){this._inputElement=this._component.querySelector(s.selectors.INPUT)}initializeMask(e){this.destroyMask(),this._inputMask=new J(this._inputElement,e)}destroy(){this._targetElement=void 0,this._toggleElement=void 0,this._inputElement=void 0}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false")}addInputListener(e,i,n){this._inputElement.addEventListener(e,i,{capture:n})}removeInputListener(e,i,n){this._inputElement&&this._inputElement.removeEventListener(e,i,{capture:n})}addToggleListener(e,i){this._toggleElement&&this._toggleElement.addEventListener(e,i)}removeToggleListener(e,i){this._toggleElement&&this._toggleElement.removeEventListener(e,i)}hasInputElement(){return!!this._inputElement}tryCreateToggle(){let e=this._component.querySelector(f.elementName),i=this._component.querySelector(s.selectors.TOGGLE);if(e){let n=e.querySelector(`${C.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let a=document.createElement(C.elementName);a.slot="trailing",a.dense=!0,a.densityLevel=3,a.style.marginRight="4px";let r=document.createElement("button");r.type="button",r.tabIndex=-1,r.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",r.appendChild(d),a.appendChild(r),e.appendChild(a),this._toggleElement=a}else i&&(this._toggleElement=i)}tryFocusInput(){this._inputElement.select()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return P()===this._inputElement}setInputValue(e,i){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.update(),i&&(this._emitInputEvent("change"),this._emitInputEvent("input")))}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this.setToggleDisabled(e)}attachDropdown(e){this._listDropdown=new st(this._inputElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`)}detachDropdown(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0),this._inputElement.removeAttribute("aria-controls")}propagateKey(e){var i;(i=this._listDropdown)==null||i.handleKey(e)}setActiveDescendant(e){x(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._getTargetElement(e).getBoundingClientRect().width}_emitInputEvent(e){this._inputElement.dispatchEvent(new Event(e))}emitInputEvent(e,i){U(this._inputElement,e,i)}setInputReadonly(e){this._inputElement.readOnly=e}setToggleDisabled(e){if(this._toggleElement)if(this._toggleElement.setAttribute("aria-disabled",e.toString()),"disabled"in this._toggleElement)this._toggleElement.disabled=e;else{let i=this._toggleElement.querySelector("button");i&&(i.disabled=e)}}hasActiveOption(){var e,i;return((i=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?i:-1)>=0}activateOptionByIndex(e){var i;(i=this._listDropdown)==null||i.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOption(){var e;return(e=this._listDropdown)==null?void 0:e.getActiveOption()}_getTargetElement(e){return this._targetElement?this._targetElement:(this._targetElement=e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement(),this._targetElement)}_getDefaultTargetElement(){let e=this._component.querySelector(f.elementName);if(e&&e.shadowRoot){let i=V(e,f.selectors.ROOT);if(i)return i}return this._component}};function v(o,t,e){if(!o||/^\s*$/.test(o))return null;let i=0,n=0,a=0;if(b.test(o)){let r=G(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0}else if(X.test(o)){let r=q(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0,i===12&&r.meridiem==="AM"&&(i=0),i<12&&r.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+T(n)+(e?O(a):0)}function c(o,t,e){if(typeof o!="number"||o<0)return null;let i=Math.min(pt(o),23),n=Math.min(ut(o),59),r=o/(1e3*60)<720?"AM":"PM";t||(i=i<=12?i:i-12,i===0&&(i=12));let d=`${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`;if(e){let _=Math.min(M(o),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${r}`),d}function pt(o){return Math.abs(Math.floor(o/(1e3*60*60)))}function ut(o){return Math.abs(Math.floor(I(o)%60))}function I(o){return o/(1e3*60)}function M(o){return Math.abs(Math.floor(It(o)%60))}function It(o){return o/1e3}function dt(o){return o*60*60*1e3}function T(o){return o*60*1e3}function O(o){return o*1e3}function ct(o){return o-O(M(o))}function S(o){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+T(i)+(o?O(t.getSeconds()):0)}function Rt(o,t,e=!1){o||(o=new Date);let i=v(t,!0,e);if(!i)return o.setHours(0,0,0),o;let n=pt(i),a=828e5;n>a?n=a:n<0&&(n=0);let r=ut(i),d=e?M(i):0;return o.setHours(n,r,d),o}var k=class{constructor(t){this._adapter=t;this._value=null;this._masked=!0;this._use24HourTime=!1;this._showMaskFormat=!1;this._min=null;this._max=null;this._restrictedTimes=[];this._startTime=null;this._step=s.numbers.DEFAULT_MINUTE_STEP;this._allowInput=!0;this._open=!1;this._allowSeconds=!1;this._allowInvalidTime=!1;this._showNow=!1;this._showHourOptions=!0;this._customOptions=[];this._disabled=!1;this._popupClasses=[];this._allowDropdown=!0;this._isInitialized=!1;this._identifier=D(),this._inputListener=e=>this._onInput(e),this._inputKeydownListener=e=>this._onInputKeydown(e),this._toggleMousedownListener=e=>this._onToggleMousedown(e),this._inputFocusListener=e=>this._onInputFocus(e),this._inputBlurListener=e=>this._onInputBlur(e),this._inputMousedownListener=e=>this._onInputMousedown(e)}initialize(){if(this._adapter.initialize(),!this._adapter.hasInputElement())throw new Error("Unable to locate <input> element to attach to.");if(this._adapter.initializeAccessibility(this._identifier),!this._value){let t=this._adapter.getInputValue();this._setValue(this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds))}this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._formatInputValue(!1),typeof this._value=="number"&&this._applyValue(this._value,!1),this._applyAllowInput(),this._applyAllowDropdown(),this._applyDisabled(),this._applyMask(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._masked&&this._adapter.destroyMask(),this._closeDropdown(),this._adapter.destroy()}_onInput(t){this._handleInput(this._adapter.getInputValue())}_onInputKeydown(t){var e,i;if(t.shiftKey)switch(t.code){case"Backspace":case"Delete":t.preventDefault(),this._trySetValue(null)&&this._formatInputValue();return}switch(t.code){case"Tab":this._open&&this._selectActiveOption();break;case"Esc":case"Escape":this._open&&(t.preventDefault(),t.stopPropagation(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption():(this._openDropdown(),typeof((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0?this._adapter.activateOptionByIndex((i=this._dropdownConfig)==null?void 0:i.visibleStartIndex):this._adapter.activateFirstOption()));break;case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&(this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption()));break;case"Enter":case"NumpadEnter":case"Home":case"End":this._open&&((t.code==="Enter"||t.code==="NumpadEnter")&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let n=S(this._allowSeconds);if(this._value!==n){let a=c(n,!0,this._allowSeconds);this._emitChangeEvent(a)&&(this._applyValue(n),this._selectInputText())}break}}_trySetActiveOption(){var t,e;!this._adapter.hasActiveOption()&&typeof((t=this._dropdownConfig)==null?void 0:t.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0&&this._adapter.activateOptionByIndex((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)}_selectActiveOption(){let t=this._adapter.getActiveOption();t&&this._onSelect(t.value)}_onToggleMousedown(t){this._disabled||!this.allowDropdown||(t.stopPropagation(),!this._adapter.isInputDisabled()&&(t.preventDefault(),this._open?this._closeDropdown(!0):(F.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openDropdown())))}_onInputFocus(t){this._allowInput&&this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&this._applyMask()}_onInputBlur(t){this.masked&&this._showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){this._adapter.destroyMask();let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);this._emitChangeEvent(e)&&(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t)}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function Ne(){N(l)}export{s as a,g as b,v as c,c as d,pt as e,ut as f,I as g,M as h,It as i,dt as j,T as k,O as l,ct as m,S as n,Rt as o,k as p,l as q,mt as r,Ne as s};
|
|
7
|
+
//# sourceMappingURL=chunk.BKCEVPKW.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as o}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as o}from"./chunk.SIJGKRYS.js";import{a as n}from"./chunk.G4IN6Y46.js";var l=class extends n{constructor(e){super(e)}_build(){return document.createElement(o.elementName)}_configure(){var e;typeof((e=this._config.options)==null?void 0:e.helperText)=="string"&&this.setHelperText(this._config.options.helperText)}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}onChange(e){this._element.addEventListener("change",t=>e(t.detail))}onFocus(e){this._element.addEventListener("focus",t=>e(t))}onBlur(e){this._element.addEventListener("blur",t=>e(t))}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&this._helperTextElement.isConnected&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}};export{l as a};
|
|
7
|
+
//# sourceMappingURL=chunk.BSTIDYQJ.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{c as re,f as ce}from"./chunk.DXHKS7XO.js";import{a as M,d as ae}from"./chunk.H3SBIXK5.js";import{a as ne}from"./chunk.WO7KEM5K.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.MZLPUI6R.js";import{a as ie,d as se,l as oe}from"./chunk.H5D54EHO.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.5V5ABSHI.js";import{a as j,b as ee}from"./chunk.DTZFWZPB.js";import{a as q,k as J}from"./chunk.NK7H3MMM.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{c as re,f as ce}from"./chunk.2XFVFZ3P.js";import{a as M,d as ae}from"./chunk.ECRL6O3V.js";import{a as ne}from"./chunk.WO7KEM5K.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.FYWPZFLJ.js";import{a as ie,d as se,l as oe}from"./chunk.H5D54EHO.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.5V5ABSHI.js";import{a as j,b as ee}from"./chunk.DTZFWZPB.js";import{a as q,k as J}from"./chunk.NK7H3MMM.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
|
|
7
|
+
//# sourceMappingURL=chunk.CNQESSA3.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{q as g,r as u}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{q as g,r as u}from"./chunk.FYWPZFLJ.js";import{a as h,d as C,l as T}from"./chunk.H5D54EHO.js";import{a as p}from"./chunk.NVUMRW44.js";import{a as _}from"./chunk.5V5ABSHI.js";import{a as f,b}from"./chunk.DTZFWZPB.js";import{a as O,e as d,f as s,k as N}from"./chunk.NK7H3MMM.js";import{t as I}from"./chunk.CFDK4RCW.js";import{k as l}from"./chunk.J2M2MXP2.js";import{d as i}from"./chunk.M3QDAYD2.js";var E=`${b}open-icon`,A={ICON:"forge-open-icon",ICON_OPEN:"forge-open-icon--open"},x={OPEN:"open",ORIENTATION:"orientation"},S={ORIENTATION_VERTICAL:"vertical",ORIENTATION_HORIZONTAL:"horizontal"},e={elementName:E,classes:A,attributes:x,strings:S};var r=class{constructor(o){this._adapter=o;this._open=!1;this._orientation=e.strings.ORIENTATION_VERTICAL}initialize(){this._adapter.setOrientation(this._orientation),this._adapter.setOpenState(this._open)}get open(){return this._open}set open(o){o=!!o,this._open!==o&&(this._open=o,this._adapter.setOpenState(this._open))}get orientation(){return this._orientation}set orientation(o){this._orientation=o,this._adapter.setOrientation(this._orientation)}};var a=class extends _{constructor(t){super(t);this._openIcon=s(t,`.${e.classes.ICON}`),this._iconElement=s(t,h.elementName)}setOrientation(t){t===e.strings.ORIENTATION_HORIZONTAL?this._iconElement.name="keyboard_arrow_right":this._iconElement.name="keyboard_arrow_down"}setOpenState(t){I(this._openIcon,t,e.classes.ICON_OPEN)}};var w='<template><span class="forge-open-icon" part="root"><forge-icon class="icon" part="icon"></forge-icon></span></template>',v=".forge-open-icon{color:#757575;color:var(--forge-theme-icon-color,#757575)}.forge-open-icon .icon{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.forge-open-icon.forge-open-icon--open .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host{line-height:.5}:host([hidden]){display:none}",n=class extends N{constructor(){super();C.define([u,g]),d(this,w,v),this._foundation=new r(new a(this))}static get observedAttributes(){return[e.attributes.OPEN,e.attributes.ORIENTATION]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(t,R,m){switch(t){case e.attributes.OPEN:this.open=l(m);break;case e.attributes.ORIENTATION:this.orientation=m;break}}};i([p()],n.prototype,"open",2),i([p()],n.prototype,"orientation",2),n=i([f({name:e.elementName,dependencies:[T]})],n);function ee(){O(n)}export{e as a,r as b,a as c,n as d,ee as e};
|
|
7
|
+
//# sourceMappingURL=chunk.E6KWYFZG.js.map
|