@tylertech/forge 2.23.1 → 2.24.0
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 +20 -0
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/chunks/{chunk.GRBFFU4E.js → chunk.36RT7UOR.js} +2 -2
- package/dist/esm/chunks/{chunk.4J7MOJUW.js → chunk.4QVF44G5.js} +2 -2
- package/dist/esm/chunks/{chunk.PQNQULWB.js → chunk.7NUOX3JD.js} +2 -2
- package/dist/esm/chunks/{chunk.JNWAGZFT.js → chunk.EPFMWAIO.js} +2 -2
- package/dist/esm/chunks/{chunk.WPF4OVWD.js → chunk.HSUOYMJT.js} +2 -2
- package/dist/esm/chunks/{chunk.6RJ6NEKJ.js → chunk.HVYDNI2O.js} +2 -2
- package/dist/esm/chunks/{chunk.5SGTPCLX.js → chunk.K2O3KSP7.js} +2 -2
- package/dist/esm/chunks/{chunk.P6C3463W.js → chunk.KNNT4CGL.js} +2 -2
- package/dist/esm/chunks/{chunk.UE4KJ2BZ.js → chunk.LZOAYM6V.js} +2 -2
- package/dist/esm/chunks/chunk.MA2P7CG4.js +7 -0
- package/dist/esm/chunks/chunk.MA2P7CG4.js.map +7 -0
- package/dist/esm/chunks/{chunk.OC3NNLIP.js → chunk.MSOMQ4HD.js} +2 -2
- package/dist/esm/chunks/{chunk.UNPZKZ23.js → chunk.NHZTE4I4.js} +2 -2
- package/dist/esm/chunks/{chunk.UNPZKZ23.js.map → chunk.NHZTE4I4.js.map} +1 -1
- package/dist/esm/chunks/{chunk.VXCPWDOQ.js → chunk.OLNY6ZNB.js} +2 -2
- package/dist/esm/chunks/{chunk.VXCPWDOQ.js.map → chunk.OLNY6ZNB.js.map} +3 -3
- package/dist/esm/chunks/{chunk.M5SV3NKJ.js → chunk.PTEWJ5PZ.js} +2 -2
- package/dist/esm/chunks/{chunk.3M6GHBEY.js → chunk.QRWYYBZC.js} +2 -2
- package/dist/esm/chunks/{chunk.P45M3ZLT.js → chunk.SDZC7JIX.js} +2 -2
- package/dist/esm/chunks/{chunk.UYR2C32R.js → chunk.ZN6U7WVM.js} +2 -2
- 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/paginator/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/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/table/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/esm/list/list-item/list-item-foundation.d.ts +2 -0
- package/esm/list/list-item/list-item-foundation.js +4 -0
- package/esm/list/list-item/list-item.d.ts +2 -0
- package/esm/list/list-item/list-item.js +3 -0
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/table/table-foundation.js +10 -1
- package/package.json +1 -1
- package/dist/esm/chunks/chunk.QWB7A62L.js +0 -7
- package/dist/esm/chunks/chunk.QWB7A62L.js.map +0 -7
- /package/dist/esm/chunks/{chunk.GRBFFU4E.js.map → chunk.36RT7UOR.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4J7MOJUW.js.map → chunk.4QVF44G5.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PQNQULWB.js.map → chunk.7NUOX3JD.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.JNWAGZFT.js.map → chunk.EPFMWAIO.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.WPF4OVWD.js.map → chunk.HSUOYMJT.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.6RJ6NEKJ.js.map → chunk.HVYDNI2O.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.5SGTPCLX.js.map → chunk.K2O3KSP7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.P6C3463W.js.map → chunk.KNNT4CGL.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.UE4KJ2BZ.js.map → chunk.LZOAYM6V.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OC3NNLIP.js.map → chunk.MSOMQ4HD.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.M5SV3NKJ.js.map → chunk.PTEWJ5PZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.3M6GHBEY.js.map → chunk.QRWYYBZC.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.P45M3ZLT.js.map → chunk.SDZC7JIX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.UYR2C32R.js.map → chunk.ZN6U7WVM.js.map} +0 -0
package/custom-elements.json
CHANGED
|
@@ -104790,6 +104790,16 @@
|
|
|
104790
104790
|
}
|
|
104791
104791
|
}
|
|
104792
104792
|
},
|
|
104793
|
+
{
|
|
104794
|
+
"kind": "method",
|
|
104795
|
+
"name": "deactivateRipple",
|
|
104796
|
+
"privacy": "public",
|
|
104797
|
+
"return": {
|
|
104798
|
+
"type": {
|
|
104799
|
+
"text": "void"
|
|
104800
|
+
}
|
|
104801
|
+
}
|
|
104802
|
+
},
|
|
104793
104803
|
{
|
|
104794
104804
|
"kind": "method",
|
|
104795
104805
|
"name": "_onKeydown",
|
|
@@ -105176,6 +105186,16 @@
|
|
|
105176
105186
|
}
|
|
105177
105187
|
},
|
|
105178
105188
|
"description": "Sets focus to this list item."
|
|
105189
|
+
},
|
|
105190
|
+
{
|
|
105191
|
+
"kind": "method",
|
|
105192
|
+
"name": "deactivateRipple",
|
|
105193
|
+
"privacy": "public",
|
|
105194
|
+
"return": {
|
|
105195
|
+
"type": {
|
|
105196
|
+
"text": "void"
|
|
105197
|
+
}
|
|
105198
|
+
}
|
|
105179
105199
|
}
|
|
105180
105200
|
],
|
|
105181
105201
|
"superclass": {
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a,b,c,d,e}from"../../chunks/chunk.
|
|
6
|
+
import{a,b,c,d,e}from"../../chunks/chunk.KNNT4CGL.js";import"../../chunks/chunk.SDZC7JIX.js";import"../../chunks/chunk.PTEWJ5PZ.js";import"../../chunks/chunk.LZOAYM6V.js";import"../../chunks/chunk.RQG6GVOI.js";import"../../chunks/chunk.FZQCBRPK.js";import"../../chunks/chunk.4QVF44G5.js";import"../../chunks/chunk.MA2P7CG4.js";import"../../chunks/chunk.6YPD6CQM.js";import"../../chunks/chunk.B3LPXCVL.js";import"../../chunks/chunk.P73BXRKY.js";import"../../chunks/chunk.V4TCOZLK.js";import"../../chunks/chunk.4DAIIJ37.js";import"../../chunks/chunk.WCSVKQR2.js";import"../../chunks/chunk.HDHGU4L2.js";import"../../chunks/chunk.MV327MYK.js";import"../../chunks/chunk.EC5JFSHR.js";import"../../chunks/chunk.2DXG2R3M.js";import"../../chunks/chunk.F3MP6AXF.js";import"../../chunks/chunk.MZLPUI6R.js";import"../../chunks/chunk.TEHQWMFI.js";import"../../chunks/chunk.SYHVVXRW.js";import"../../chunks/chunk.YI4JTY4T.js";import"../../chunks/chunk.3KQL7VAZ.js";import"../../chunks/chunk.WHQZNZHW.js";import"../../chunks/chunk.6KTLOA7V.js";import"../../chunks/chunk.U6FJJGO3.js";import"../../chunks/chunk.SKLCDWYQ.js";import"../../chunks/chunk.2KXSGD3S.js";import"../../chunks/chunk.FVRSGKJD.js";import"../../chunks/chunk.U6WGJELL.js";import"../../chunks/chunk.7XFU2W25.js";import"../../chunks/chunk.KZJYLYWN.js";import"../../chunks/chunk.BESB4RGK.js";import"../../chunks/chunk.UWYANU5D.js";import"../../chunks/chunk.KTGSZEAG.js";import"../../chunks/chunk.DL7NX432.js";import"../../chunks/chunk.LJLEPTLU.js";import"../../chunks/chunk.4LA6HEA7.js";import"../../chunks/chunk.J2M2MXP2.js";import"../../chunks/chunk.MCIQXNKY.js";export{c as APP_BAR_HELP_BUTTON_CONSTANTS,a as AppBarHelpButtonAdapter,d as AppBarHelpButtonComponent,b as AppBarHelpButtonFoundation,e as defineAppBarHelpButtonComponent};
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a,b,c,d,e,f as I}from"../chunks/chunk.VFWFNY53.js";import{a as t,b as u,c as v,d as w,e as x}from"../chunks/chunk.
|
|
6
|
+
import{a,b,c,d,e,f as I}from"../chunks/chunk.VFWFNY53.js";import{a as t,b as u,c as v,d as w,e as x}from"../chunks/chunk.KNNT4CGL.js";import"../chunks/chunk.SDZC7JIX.js";import"../chunks/chunk.PTEWJ5PZ.js";import"../chunks/chunk.LZOAYM6V.js";import"../chunks/chunk.RQG6GVOI.js";import"../chunks/chunk.FZQCBRPK.js";import"../chunks/chunk.4QVF44G5.js";import"../chunks/chunk.MA2P7CG4.js";import"../chunks/chunk.6YPD6CQM.js";import"../chunks/chunk.B3LPXCVL.js";import"../chunks/chunk.P73BXRKY.js";import"../chunks/chunk.V4TCOZLK.js";import"../chunks/chunk.4DAIIJ37.js";import{a as l,b as m,c as n}from"../chunks/chunk.KMMOZ2SF.js";import{a as o,b as p,c as q,d as r,e as s}from"../chunks/chunk.E6FHH3CM.js";import"../chunks/chunk.BNIUTBJV.js";import{a as D,b as E,c as F,d as G,e as H}from"../chunks/chunk.32AY5G4D.js";import{a as y,b as z,c as A,d as B,e as C}from"../chunks/chunk.QBST3QSM.js";import"../chunks/chunk.EOZITZSP.js";import"../chunks/chunk.6D5ERZ3Y.js";import"../chunks/chunk.AVKCWA7I.js";import"../chunks/chunk.BJZ7RB5F.js";import"../chunks/chunk.DNWMURCG.js";import"../chunks/chunk.WCSVKQR2.js";import"../chunks/chunk.HDHGU4L2.js";import"../chunks/chunk.MV327MYK.js";import"../chunks/chunk.EC5JFSHR.js";import"../chunks/chunk.2DXG2R3M.js";import"../chunks/chunk.F3MP6AXF.js";import{a as f,b as g,c as h,d as i,e as j,f as k}from"../chunks/chunk.ZVPPLZUU.js";import"../chunks/chunk.MZLPUI6R.js";import"../chunks/chunk.TEHQWMFI.js";import"../chunks/chunk.SYHVVXRW.js";import"../chunks/chunk.YI4JTY4T.js";import"../chunks/chunk.3KQL7VAZ.js";import"../chunks/chunk.WHQZNZHW.js";import"../chunks/chunk.6KTLOA7V.js";import"../chunks/chunk.U6FJJGO3.js";import"../chunks/chunk.SKLCDWYQ.js";import"../chunks/chunk.2KXSGD3S.js";import"../chunks/chunk.FVRSGKJD.js";import"../chunks/chunk.U6WGJELL.js";import"../chunks/chunk.7XFU2W25.js";import"../chunks/chunk.KZJYLYWN.js";import"../chunks/chunk.BESB4RGK.js";import"../chunks/chunk.UWYANU5D.js";import"../chunks/chunk.KTGSZEAG.js";import"../chunks/chunk.DL7NX432.js";import"../chunks/chunk.LJLEPTLU.js";import"../chunks/chunk.4LA6HEA7.js";import"../chunks/chunk.J2M2MXP2.js";import"../chunks/chunk.MCIQXNKY.js";export{b as APP_BAR_CONSTANTS,v as APP_BAR_HELP_BUTTON_CONSTANTS,l as APP_BAR_MENU_BUTTON_CONSTANTS,p as APP_BAR_NOTIFICATION_BUTTON_CONSTANTS,D as APP_BAR_PROFILE_BUTTON_CONSTANTS,f as APP_BAR_SEARCH_CONSTANTS,c as AppBarAdapter,e as AppBarComponent,d as AppBarFoundation,t as AppBarHelpButtonAdapter,w as AppBarHelpButtonComponent,u as AppBarHelpButtonFoundation,m as AppBarMenuButtonComponent,o as AppBarNotificationButtonAdapter,r as AppBarNotificationButtonComponent,q as AppBarNotificationButtonFoundation,E as AppBarProfileButtonAdapter,G as AppBarProfileButtonComponent,F as AppBarProfileButtonFoundation,i as AppBarSearchAdapter,j as AppBarSearchComponent,h as AppBarSearchFoundation,g as DEFAULT_COMBINED_OPTIONS,y as PROFILE_CARD_CONSTANTS,z as ProfileCardAdapter,B as ProfileCardComponent,A as ProfileCardFoundation,I as defineAppBarComponent,x as defineAppBarHelpButtonComponent,n as defineAppBarMenuButtonComponent,s as defineAppBarNotificationButtonComponent,H as defineAppBarProfileButtonComponent,k as defineAppBarSearchComponent,C as defineProfileCardComponent,a as elementName};
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"../chunks/chunk.
|
|
6
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"../chunks/chunk.MSOMQ4HD.js";import"../chunks/chunk.H5IFZCUL.js";import"../chunks/chunk.VDF5MWGC.js";import"../chunks/chunk.EYGSUZWX.js";import"../chunks/chunk.OZPV5ZJC.js";import"../chunks/chunk.DK6EGV4J.js";import"../chunks/chunk.DONAMICM.js";import"../chunks/chunk.DBKVUCUQ.js";import"../chunks/chunk.IX2UHMIM.js";import"../chunks/chunk.CKS5A4YN.js";import"../chunks/chunk.MA573DEE.js";import"../chunks/chunk.QBKSRXQK.js";import"../chunks/chunk.IY43YPCQ.js";import"../chunks/chunk.PTEWJ5PZ.js";import"../chunks/chunk.LZOAYM6V.js";import"../chunks/chunk.RQG6GVOI.js";import"../chunks/chunk.FZQCBRPK.js";import"../chunks/chunk.4QVF44G5.js";import"../chunks/chunk.MA2P7CG4.js";import"../chunks/chunk.6YPD6CQM.js";import"../chunks/chunk.P73BXRKY.js";import"../chunks/chunk.V4TCOZLK.js";import"../chunks/chunk.4DAIIJ37.js";import"../chunks/chunk.WCSVKQR2.js";import"../chunks/chunk.EC5JFSHR.js";import"../chunks/chunk.2DXG2R3M.js";import"../chunks/chunk.F3MP6AXF.js";import"../chunks/chunk.MZLPUI6R.js";import"../chunks/chunk.YI4JTY4T.js";import"../chunks/chunk.3KQL7VAZ.js";import"../chunks/chunk.WHQZNZHW.js";import"../chunks/chunk.6KTLOA7V.js";import"../chunks/chunk.U6FJJGO3.js";import"../chunks/chunk.SKLCDWYQ.js";import"../chunks/chunk.2KXSGD3S.js";import"../chunks/chunk.FVRSGKJD.js";import"../chunks/chunk.U6WGJELL.js";import"../chunks/chunk.7XFU2W25.js";import"../chunks/chunk.KZJYLYWN.js";import"../chunks/chunk.BESB4RGK.js";import"../chunks/chunk.UWYANU5D.js";import"../chunks/chunk.KTGSZEAG.js";import"../chunks/chunk.DL7NX432.js";import"../chunks/chunk.LJLEPTLU.js";import"../chunks/chunk.4LA6HEA7.js";import"../chunks/chunk.J2M2MXP2.js";import"../chunks/chunk.MCIQXNKY.js";export{a as AUTOCOMPLETE_CONSTANTS,c as AutocompleteAdapter,i as AutocompleteComponent,j as AutocompleteComponentDelegate,h as AutocompleteFoundation,b as AutocompleteMode,d as OptionType,k as defineAutocompleteComponent,f as getSelectedOption,e as isOptionType,g as optionEqualPredicate};
|
|
7
7
|
//# sourceMappingURL=index.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 L}from"./chunk.SGTKZRDH.js";import{b as o}from"./chunk.AITARMT3.js";import{a as G}from"./chunk.M5SV3NKJ.js";import{h as P,i as k}from"./chunk.UE4KJ2BZ.js";import{a as V}from"./chunk.WCSVKQR2.js";import{a as B}from"./chunk.UWYANU5D.js";import{a as d}from"./chunk.KTGSZEAG.js";import{i as S}from"./chunk.4LA6HEA7.js";import{a as T,b as c,j as I,k as y,n as x}from"./chunk.J2M2MXP2.js";import{a as b,f as a}from"./chunk.MCIQXNKY.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text"},U=b({},M),R={CHANGE:"change"},m={attributes:U,events:R};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function C(r,O){let e=r.some(i=>D(i)),t=r.some(i=>W(i));return e&&O===1||t&&O===0}function D(r){return c(r)&&I(r)&&r.hasOwnProperty("options")}function W(r){return c(r)&&I(r)&&r.hasOwnProperty("label")&&r.hasOwnProperty("value")}var H=class extends k{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor&&this._optionListenerDestructor(),this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return C(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,constrainViewportWidth:this._constrainPopupWidth,wrapOptionText:this._wrapOptionText,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,n=i.find(l=>l.value===t);if(n){let l=i.indexOf(n);this._onSelect(n,l,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async n=>{if(this._valueChanging)return Promise.resolve(!1);let l=e?e.value:"",u=e?e.label:"",v=[...this._value],f=[...this._selectedValues],g=[...this._selectedLabels],w=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(l)){let h=this._selectedValues.indexOf(l);this._selectedValues.splice(h,1),this._selectedLabels.splice(h,1),this._selectedIndexes.splice(h,1)}else this._selectedValues.push(l),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(l)?(this._selectedValues[0]=l,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);this._value=[...this._selectedValues];let s=()=>{this._selectedValues=[...f],this._selectedLabels=[...g],this._selectedIndexes=[...w],this._value=[...v]},_=()=>{if(this._multiple){let h=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,h)}this._applySelection()},A=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,A));let h=await this._valueChanging;if(this._valueChanging=void 0,!h)return s(),this._tryUpdateDropdownPosition(),n(!1)}let E=!this._adapter.emitHostEvent(m.events.CHANGE,A,!0,!0);E?s():_(),this._tryUpdateDropdownPosition(),n(!E)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(n=>x(n.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?this._selectedLabels.length===1?this._selectedLabels[0]:`${this._selectedLabels.length} options selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,n=e.key==="Space"||e.keyCode===32,l=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),e.stopPropagation(),this._open)){this._closeDropdown();return}if(n)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||l){if(e.preventDefault(),!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let s=0;this._open?(s=this._adapter.getActiveOptionIndex(),s===-1&&(s=this._getFirstSelectedOptionIndex())):s=this._getFirstSelectedOptionIndex(),u?s=this._getPreviousHighlightableOptionIndex(s,this._nonDividerOptions):s=this._getNextHighlightableOptionIndex(s,this._nonDividerOptions),this._adapter.highlightActiveOption(s)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(s=>!s.disabled)));else if(g){if(this._open){e.preventDefault();let s=this._nonDividerOptions;for(let _=s.length-1;_>=0;_--)if(!s[_].disabled){this._adapter.highlightActiveOption(_);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(({disabled:i,label:n})=>!i&&n.trim().toLowerCase().startsWith(this._filterString.trim().toLowerCase()));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._value]:this._value[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;C(e,1)?t=e.map(i=>b({},i)):t=e.map(i=>b({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};a([d()],p.prototype,"value",2),a([d()],p.prototype,"selectedIndex",2),a([d()],p.prototype,"options",2),a([d()],p.prototype,"multiple",2),a([d()],p.prototype,"open",2),a([d()],p.prototype,"optionBuilder",2),a([d()],p.prototype,"selectedTextBuilder",2),a([d()],p.prototype,"beforeValueChange",2),a([d({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(L.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),n=this._createOptionsFromElements(i);return{text:t.label,builder:t.builder,value:t.value,options:n}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,secondaryLabel:t.hasAttribute(o.attributes.SECONDARY_LABEL)?t.getAttribute(o.attributes.SECONDARY_LABEL):c(t.secondaryLabel)?t.secondaryLabel:void 0,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,leadingIconComponentProps:t.leadingIconComponentProps,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,trailingIconComponentProps:t.trailingIconComponentProps,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new P(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=n=>{n.stopPropagation(),e(this.getOptions())};this._component.addEventListener(o.events.VALUE_CHANGE,t);let i=new MutationObserver(()=>e(this.getOptions()));return i.observe(this._component,{childList:!0,subtree:!0}),()=>{this._component.removeEventListener(o.events.VALUE_CHANGE,t),i.disconnect()}}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(D(i)){let n=this._createOptionGroupElement(i);for(let l of i.options){let u=this._createOptionElement(l);n.appendChild(u)}this._component.appendChild(n)}else{let n=this._createOptionElement(i);this._component.appendChild(n)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){!this.popupElement||window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(L.elementName)).forEach(i=>S(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>S(i))}_createOptionGroupElement(e){let t=document.createElement("forge-option-group");return Object.assign(t,e),t}_createOptionElement(e){let t=document.createElement("forge-option");return Object.assign(t,e),t.textContent=e.label,t}};export{m as a,N as b,C as c,D as d,W as e,H as f,p as g,F as h};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as L}from"./chunk.SGTKZRDH.js";import{b as o}from"./chunk.AITARMT3.js";import{a as G}from"./chunk.PTEWJ5PZ.js";import{h as P,i as k}from"./chunk.LZOAYM6V.js";import{a as V}from"./chunk.WCSVKQR2.js";import{a as B}from"./chunk.UWYANU5D.js";import{a as d}from"./chunk.KTGSZEAG.js";import{i as S}from"./chunk.4LA6HEA7.js";import{a as T,b as c,j as I,k as y,n as x}from"./chunk.J2M2MXP2.js";import{a as b,f as a}from"./chunk.MCIQXNKY.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text"},U=b({},M),R={CHANGE:"change"},m={attributes:U,events:R};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function C(r,O){let e=r.some(i=>D(i)),t=r.some(i=>W(i));return e&&O===1||t&&O===0}function D(r){return c(r)&&I(r)&&r.hasOwnProperty("options")}function W(r){return c(r)&&I(r)&&r.hasOwnProperty("label")&&r.hasOwnProperty("value")}var H=class extends k{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor&&this._optionListenerDestructor(),this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return C(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,constrainViewportWidth:this._constrainPopupWidth,wrapOptionText:this._wrapOptionText,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,n=i.find(l=>l.value===t);if(n){let l=i.indexOf(n);this._onSelect(n,l,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async n=>{if(this._valueChanging)return Promise.resolve(!1);let l=e?e.value:"",u=e?e.label:"",v=[...this._value],f=[...this._selectedValues],g=[...this._selectedLabels],w=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(l)){let h=this._selectedValues.indexOf(l);this._selectedValues.splice(h,1),this._selectedLabels.splice(h,1),this._selectedIndexes.splice(h,1)}else this._selectedValues.push(l),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(l)?(this._selectedValues[0]=l,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);this._value=[...this._selectedValues];let s=()=>{this._selectedValues=[...f],this._selectedLabels=[...g],this._selectedIndexes=[...w],this._value=[...v]},_=()=>{if(this._multiple){let h=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,h)}this._applySelection()},A=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,A));let h=await this._valueChanging;if(this._valueChanging=void 0,!h)return s(),this._tryUpdateDropdownPosition(),n(!1)}let E=!this._adapter.emitHostEvent(m.events.CHANGE,A,!0,!0);E?s():_(),this._tryUpdateDropdownPosition(),n(!E)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(n=>x(n.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?this._selectedLabels.length===1?this._selectedLabels[0]:`${this._selectedLabels.length} options selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,n=e.key==="Space"||e.keyCode===32,l=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),e.stopPropagation(),this._open)){this._closeDropdown();return}if(n)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||l){if(e.preventDefault(),!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let s=0;this._open?(s=this._adapter.getActiveOptionIndex(),s===-1&&(s=this._getFirstSelectedOptionIndex())):s=this._getFirstSelectedOptionIndex(),u?s=this._getPreviousHighlightableOptionIndex(s,this._nonDividerOptions):s=this._getNextHighlightableOptionIndex(s,this._nonDividerOptions),this._adapter.highlightActiveOption(s)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(s=>!s.disabled)));else if(g){if(this._open){e.preventDefault();let s=this._nonDividerOptions;for(let _=s.length-1;_>=0;_--)if(!s[_].disabled){this._adapter.highlightActiveOption(_);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(({disabled:i,label:n})=>!i&&n.trim().toLowerCase().startsWith(this._filterString.trim().toLowerCase()));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._value]:this._value[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;C(e,1)?t=e.map(i=>b({},i)):t=e.map(i=>b({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};a([d()],p.prototype,"value",2),a([d()],p.prototype,"selectedIndex",2),a([d()],p.prototype,"options",2),a([d()],p.prototype,"multiple",2),a([d()],p.prototype,"open",2),a([d()],p.prototype,"optionBuilder",2),a([d()],p.prototype,"selectedTextBuilder",2),a([d()],p.prototype,"beforeValueChange",2),a([d({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(L.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),n=this._createOptionsFromElements(i);return{text:t.label,builder:t.builder,value:t.value,options:n}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,secondaryLabel:t.hasAttribute(o.attributes.SECONDARY_LABEL)?t.getAttribute(o.attributes.SECONDARY_LABEL):c(t.secondaryLabel)?t.secondaryLabel:void 0,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,leadingIconComponentProps:t.leadingIconComponentProps,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,trailingIconComponentProps:t.trailingIconComponentProps,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new P(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=n=>{n.stopPropagation(),e(this.getOptions())};this._component.addEventListener(o.events.VALUE_CHANGE,t);let i=new MutationObserver(()=>e(this.getOptions()));return i.observe(this._component,{childList:!0,subtree:!0}),()=>{this._component.removeEventListener(o.events.VALUE_CHANGE,t),i.disconnect()}}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(D(i)){let n=this._createOptionGroupElement(i);for(let l of i.options){let u=this._createOptionElement(l);n.appendChild(u)}this._component.appendChild(n)}else{let n=this._createOptionElement(i);this._component.appendChild(n)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){!this.popupElement||window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(L.elementName)).forEach(i=>S(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>S(i))}_createOptionGroupElement(e){let t=document.createElement("forge-option-group");return Object.assign(t,e),t}_createOptionElement(e){let t=document.createElement("forge-option");return Object.assign(t,e),t.textContent=e.label,t}};export{m as a,N as b,C as c,D as d,W as e,H as f,p as g,F as h};
|
|
7
|
+
//# sourceMappingURL=chunk.36RT7UOR.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 i,b as u,e as E}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as i,b as u,e as E}from"./chunk.MA2P7CG4.js";import{a as y}from"./chunk.UWYANU5D.js";import{a as r}from"./chunk.KTGSZEAG.js";import{a as g}from"./chunk.DL7NX432.js";import{a as _,e as L,l as v}from"./chunk.LJLEPTLU.js";import{r as I}from"./chunk.4LA6HEA7.js";import{b,k as d}from"./chunk.J2M2MXP2.js";import{f as a}from"./chunk.MCIQXNKY.js";var p=class extends y{constructor(t){super(t)}initializeAccessibility(){this._component.hasAttribute("role")||this._component.setAttribute("role","list")}addListener(t,e){this._component.addEventListener(t,e)}removeListener(t,e){this._component.removeEventListener(t,e)}focusNextListItem(){let t=this._getOwnListItems();if(t.length>0){let e=t.findIndex(o=>o.matches(":focus-within")),s=e<t.length-1?e+1:0;s<=t.length-1&&t[s].focus()}}focusPreviousListItem(){let t=this._getOwnListItems();if(t.length>0){let e=t.findIndex(o=>o.matches(":focus-within")),s=e>0?e-1:t.length-1;s>=0&&t[s].focus()}}focusFirstListItem(){let t=this._getOwnListItems();t.length>0&&t[0].focus()}focusLastListItem(){let t=this._getOwnListItems();t.length>0&&t[t.length-1].focus()}setSelectedListItems(t){let e=Array.from(this._component.querySelectorAll(u.elementName));if(e&&e.length)for(let s of e)s.selected=t.includes(s.value)}updateListItems(t){this._getOwnListItems().forEach(e=>t(e))}_getOwnListItems(){let t=I(this._component,u.elementName),e=[],s=o=>{let l=o.composedPath();l.slice(0,l.indexOf(this._component)).some(m=>m.localName===i.elementName.toLowerCase())||e.push(o.target)};return this._component.addEventListener(i.events.SCOPE_TEST,s),t.forEach(o=>o.dispatchEvent(new CustomEvent(i.events.SCOPE_TEST,{bubbles:!0,composed:!0}))),this._component.removeEventListener(i.events.SCOPE_TEST,s),e}};var x=["input","button","textarea","select"],c=class{constructor(t){this._adapter=t;this._static=!1;this._dense=!1;this._propagateClick=!0;this._indented=!1;this._keydownListener=e=>this._onKeydown(e)}initialize(){this._adapter.initializeAccessibility(),this._static||this._adapter.addListener("keydown",this._keydownListener),this._selectedValue&&this._adapter.setSelectedListItems(this._selectedValue)}_onKeydown(t){let e=t.composedPath();if(e.slice(0,e.indexOf(this._adapter.hostElement)).some(A=>A.localName===i.elementName.toLowerCase()))return;let l=t.key==="ArrowDown"||t.keyCode===40,f=t.key==="ArrowUp"||t.keyCode===38,m=t.key==="Home"||t.keyCode===36,C=t.key==="End"||t.keyCode===35,T=t.key==="Tab"||t.keyCode===9;t.altKey||t.ctrlKey||t.shiftKey||t.metaKey||(T||this._preventDefaultEvent(t),m?this._adapter.focusFirstListItem():C?this._adapter.focusLastListItem():l?this._adapter.focusNextListItem():f&&this._adapter.focusPreviousListItem())}_preventDefaultEvent(t){let e=`${t.target.tagName}`.toLowerCase();x.indexOf(e)===-1&&t.preventDefault()}_setSelectedValue(t){let e=t instanceof Array?t:[t];e=e.filter(s=>b(s)),this._adapter.setSelectedListItems(e)}get static(){return this._static}set static(t){this._static!==t&&(this._static=t,this._static?this._adapter.removeListener("keydown",this._keydownListener):this._adapter.addListener("keydown",this._keydownListener),this._adapter.updateListItems(e=>e.static=this._static),this._static?this._adapter.setHostAttribute(i.attributes.STATIC):this._adapter.removeHostAttribute(i.attributes.STATIC))}get dense(){return this._dense}set dense(t){this._dense!==t&&(this._dense=t,this._adapter.updateListItems(e=>e.dense=this._dense),this._dense?this._adapter.setHostAttribute(i.attributes.DENSE):this._adapter.removeHostAttribute(i.attributes.DENSE))}get propagateClick(){return this._propagateClick}set propagateClick(t){this._propagateClick!==t&&(this._propagateClick=t,this._adapter.updateListItems(e=>e.propagateClick=this._propagateClick),this._adapter.setHostAttribute(i.attributes.PROPAGATE_CLICK,""+!!this._propagateClick))}get indented(){return this._indented}set indented(t){this._indented!==t&&(this._indented=t,this._adapter.updateListItems(e=>e.indented=this._indented),this._indented?this._adapter.setHostAttribute(i.attributes.INDENTED):this._adapter.removeHostAttribute(i.attributes.INDENTED))}get selectedValue(){return this._selectedValue}set selectedValue(t){this._selectedValue=t,this._setSelectedValue(t)}};var S='<template><div class="forge-list" part="root"><slot></slot></div></template>',k=".forge-list{-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);line-height:1.5rem;padding-top:8px;padding-top:var(--forge-list-padding,8px);padding-bottom:8px;padding-bottom:var(--forge-list-padding,8px);margin:0;list-style-type:none}.forge-list:focus{outline:0}:host{display:block;contain:content}:host([hidden]){display:none}",n=class extends v{constructor(){super();L(this,S,k),this._foundation=new c(new p(this))}static get observedAttributes(){return[i.attributes.STATIC,i.attributes.DENSE,i.attributes.SELECTED_VALUE,i.attributes.PROPAGATE_CLICK,i.attributes.INDENTED]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(e,s,o){switch(e){case i.attributes.STATIC:this.static=d(o);break;case i.attributes.DENSE:this.dense=d(o);break;case i.attributes.PROPAGATE_CLICK:this.propagateClick=d(o);break;case i.attributes.INDENTED:this.indented=d(o);break;case i.attributes.SELECTED_VALUE:this.selectedValue=o;break}}};a([r()],n.prototype,"static",2),a([r()],n.prototype,"dense",2),a([r()],n.prototype,"propagateClick",2),a([r()],n.prototype,"indented",2),a([r()],n.prototype,"selectedValue",2),n=a([g({name:i.elementName,dependencies:[E]})],n);function Z(){_(n)}export{p as a,c as b,n as c,Z as d};
|
|
7
|
+
//# sourceMappingURL=chunk.4QVF44G5.js.map
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{d as Po}from"./chunk.BQRXAJTH.js";import{f as To}from"./chunk.WYUMHNVZ.js";import{b as go}from"./chunk.4LQ2NTZ6.js";import{h as uo}from"./chunk.
|
|
6
|
+
import{d as Po}from"./chunk.BQRXAJTH.js";import{f as To}from"./chunk.WYUMHNVZ.js";import{b as go}from"./chunk.4LQ2NTZ6.js";import{h as uo}from"./chunk.OLNY6ZNB.js";import{f as So}from"./chunk.Q2PGK4IA.js";import{d as Bo}from"./chunk.F6DMKNFU.js";import{q as so}from"./chunk.HVYDNI2O.js";import{c as ao}from"./chunk.ZN6U7WVM.js";import{e as Ao}from"./chunk.AM65KICK.js";import{d as co}from"./chunk.M5AHW6YM.js";import{d as lo}from"./chunk.POYFRYFF.js";import{b as xo}from"./chunk.VLGCUBD3.js";import{d as fo}from"./chunk.K2O3KSP7.js";import{d as eo}from"./chunk.QRWYYBZC.js";import{d as no}from"./chunk.HSUOYMJT.js";import{b as to}from"./chunk.SGTKZRDH.js";import{d as mo}from"./chunk.AITARMT3.js";import{d as io}from"./chunk.XEZ7QJES.js";import{d as Co}from"./chunk.USKQFX4N.js";import{b as po}from"./chunk.WEE3TIAW.js";import{b as ro}from"./chunk.EUUVSENP.js";import{b as Q}from"./chunk.MKMYJBTE.js";import{b as U}from"./chunk.CPK2WOYA.js";import{j as _}from"./chunk.CYRAGLUX.js";import{d as j}from"./chunk.XYK4TAXA.js";import{b as G}from"./chunk.AERZO3JD.js";import{b as H}from"./chunk.Y37FW3B4.js";import{d as N}from"./chunk.KUVFKOVR.js";import{d as K}from"./chunk.POBCKMFO.js";import{d as y}from"./chunk.QRSFRMBF.js";import{e as v}from"./chunk.M5QM2CPF.js";import{d as R}from"./chunk.TDWRBHQW.js";import{b as O}from"./chunk.6LRCYRAL.js";import{f as V}from"./chunk.UUBAUAER.js";import{d as F}from"./chunk.TRIZ4QJI.js";import{d as E}from"./chunk.RDETMQHP.js";import{E as L}from"./chunk.V5L5DKNF.js";import{i as d}from"./chunk.MSOMQ4HD.js";import{b as e}from"./chunk.H5IFZCUL.js";import{c as l}from"./chunk.VDF5MWGC.js";import{d as B}from"./chunk.OZPV5ZJC.js";import{c as u}from"./chunk.MA573DEE.js";import{e as c}from"./chunk.IY43YPCQ.js";import{d as A}from"./chunk.ATJJ6NAY.js";import{d as D}from"./chunk.BRBYFLUJ.js";import{a as w}from"./chunk.WVU4LCVC.js";import{a as k}from"./chunk.4APGDQHF.js";import{c as h}from"./chunk.ZVHFSAID.js";import{d as M}from"./chunk.QFMQPAT2.js";import{d as s}from"./chunk.7C7XCT32.js";import{d as ho}from"./chunk.WLBRU5HI.js";import{d as p}from"./chunk.MBJGQYCF.js";import{d as t}from"./chunk.SXQ22MNR.js";import{d as m}from"./chunk.47EUT2BJ.js";import{e as z}from"./chunk.VFWFNY53.js";import{d as Y}from"./chunk.KNNT4CGL.js";import{d as q}from"./chunk.SDZC7JIX.js";import{b as a}from"./chunk.RQG6GVOI.js";import{c as C}from"./chunk.4QVF44G5.js";import{e as i}from"./chunk.MA2P7CG4.js";import{d as I}from"./chunk.B3LPXCVL.js";import{b as n}from"./chunk.P73BXRKY.js";import{b as W}from"./chunk.KMMOZ2SF.js";import{d as X}from"./chunk.E6FHH3CM.js";import{d as P}from"./chunk.BNIUTBJV.js";import{d as oo}from"./chunk.32AY5G4D.js";import{d as $}from"./chunk.QBST3QSM.js";import{b as Z}from"./chunk.EOZITZSP.js";import{d as S}from"./chunk.6D5ERZ3Y.js";import{c as b}from"./chunk.DNWMURCG.js";import{e as x}from"./chunk.WCSVKQR2.js";import{a as g}from"./chunk.HDHGU4L2.js";import{f}from"./chunk.EC5JFSHR.js";import{e as J}from"./chunk.ZVPPLZUU.js";import{d as T}from"./chunk.TEHQWMFI.js";import{l as r}from"./chunk.WHQZNZHW.js";import{b as o}from"./chunk.LJLEPTLU.js";var ko=[p,S,s,P,A,D,M,b,ho,E,F,L,O,h,c,u,B,I,V,y,v,R,e,G,H,N,t,K,Q,io,r,g,U,_,j,n,C,i,q,z,J,W,X,Y,oo,$,m,mo,to,ro,fo,x,Co,k,f,po,no,eo,a,xo,ao,Ao,co,lo,w,So,Bo,uo,l,so,Po,Z,T,To,go,d];function Or(){o(ko)}export{Or as a};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright (c) 2022 Tyler Technologies, Inc.
|
|
10
10
|
* License: Apache-2.0
|
|
11
11
|
*/
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.7NUOX3JD.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.HSUOYMJT.js";import{a as n}from"./chunk.2KXSGD3S.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.EPFMWAIO.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 c,f as B,g as M,h as Y}from"./chunk.GRBFFU4E.js";import{b as q}from"./chunk.SGTKZRDH.js";import{d as H}from"./chunk.AITARMT3.js";import{b as W}from"./chunk.WEE3TIAW.js";import{d as O}from"./chunk.DBKVUCUQ.js";import{a as t}from"./chunk.IX2UHMIM.js";import{c as I}from"./chunk.4J7MOJUW.js";import{e as z}from"./chunk.QWB7A62L.js";import{d as N}from"./chunk.B3LPXCVL.js";import{a as L}from"./chunk.4DAIIJ37.js";import{b as P}from"./chunk.EOZITZSP.js";import{e as F}from"./chunk.WCSVKQR2.js";import{a as R}from"./chunk.HDHGU4L2.js";import{c as w,g as A,h as k}from"./chunk.MZLPUI6R.js";import{d as D,l as C}from"./chunk.WHQZNZHW.js";import{a as n}from"./chunk.KTGSZEAG.js";import{a as T,b as S}from"./chunk.DL7NX432.js";import{a as E,e as x,g as f}from"./chunk.LJLEPTLU.js";import{o as y,t as s,u as d}from"./chunk.4LA6HEA7.js";import{b as v,k as b}from"./chunk.J2M2MXP2.js";import{f as a}from"./chunk.MCIQXNKY.js";var U=`${S}select`,h={ROOT:"forge-select",OPENED:"forge-select--opened",SELECTED_TEXT:"forge-select__selected-text",DROPDOWN:"forge-select__dropdown",LABEL_FLOAT:"forge-select--label-float",GROUP_WRAPPER:"forge-select__group-wrapper"},V={ROOT:`.${h.ROOT}`,SELECTED_TEXT:`.${h.SELECTED_TEXT}`,LABEL:"label#select-label",LEADING_SLOT:"slot[name=leading]",ADDON_END_SLOT:"slot[name=addon-end]"},G={TYPE:"type",VALUE:"value",LABEL:"label",MULTIPLE:"multiple",DISABLED:"disabled",PLACEHOLDER:"placeholder",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},X={SCROLLED_BOTTOM:`${U}-scrolled-bottom`},o={elementName:U,classes:h,selectors:V,attributes:G,events:X};var g=class extends Y{constructor(e){super(e);this._selectElement=f(e,o.selectors.ROOT),this._leadingSlot=f(e,o.selectors.LEADING_SLOT),this._addonEndSlot=f(this._component,o.selectors.ADDON_END_SLOT),this._selectedTextElement=f(e,o.selectors.SELECTED_TEXT),this._targetElement=this._selectElement}initializeLabel(){this._labelElement=f(this._component,o.selectors.LABEL)}hasLabel(){return!!this._labelElement}initializeAccessibility(){this._component.setAttribute("role","combobox"),this._component.setAttribute("aria-haspopup","true"),this._component.setAttribute("aria-expanded","false"),(!this._component.hasAttribute("tabindex")||this._component.tabIndex===-1)&&(this._component.tabIndex=0)}initializeFloatingLabel(){return new O(this._labelElement)}setLabel(e){(!this._component.hasAttribute("aria-label")||this._component.getAttribute("aria-label")===this._labelElement.textContent)&&this._component.setAttribute("aria-label",e),this._labelElement.textContent=e}addRootClass(e){this._selectElement.classList.add(e)}removeRootClass(e){this._selectElement.classList.remove(e)}setPlaceholderText(e){d(this._selectedTextElement,!!e,"placeholder",e)}addClickListener(e){this._component.addEventListener("click",e)}removeClickListener(e){this._component.removeEventListener("click",e)}addMouseDownListener(e){this._component.addEventListener("mousedown",e)}removeMouseDownListener(e){this._component.removeEventListener("mousedown",e)}addTargetListener(e,i){this._component.addEventListener(e,i)}removeTargetListener(e,i){this._component.removeEventListener(e,i)}open(e){super.open(e),this._component.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._component.setAttribute("aria-expanded","true"),s(this._selectElement,!0,o.classes.OPENED)}close(){this._component.setAttribute("aria-expanded","false"),this._component.removeAttribute("aria-activedescendant"),this._component.removeAttribute("aria-controls"),s(this._selectElement,!1,o.classes.OPENED),super.close()}updateActiveDescendant(e){d(this._component,!!e,"aria-activedescendant",e)}setSelectedText(e){this._selectedTextElement.textContent=e}setLeadingListener(e){this._leadingSlot.addEventListener("slotchange",e)}removeLeadingListener(e){this._leadingSlot.removeEventListener("slotchange",e)}setAddonEndListener(e){this._addonEndSlot.addEventListener("slotchange",e)}removeAddonEndListener(e){this._addonEndSlot.removeEventListener("slotchange",e)}hasLeadingElement(){return this._leadingSlot.assignedNodes().length>0}setDisabled(e){s(this._selectElement,e,t.classes.DISABLED),d(this._component,e,"aria-disabled","true"),this._component.tabIndex=e?-1:0}setInvalid(e){s(this._selectElement,e,t.classes.INVALID),d(this._component,e,"aria-invalid","true")}setRequired(e){s(this._selectElement,e,t.classes.REQUIRED),d(this._component,e,"aria-required","true")}setRoomy(e){s(this._selectElement,e,t.classes.ROOMY)}setDense(e){s(this._selectElement,e,t.classes.DENSE)}setMultiple(e){e?this.setHostAttribute("aria-multiselectable","true"):this.removeHostAttribute("aria-multiselectable")}getLabelWidth(e,i){return y(this._labelElement.innerText,{fontSize:e,fontFamily:i})}getLabelFontMetrics(){let e=getComputedStyle(this._labelElement);return{fontSize:parseInt(e.fontSize||"16",10),fontFamily:e.fontFamily||"Roboto"}}getTargetWidth(){return this._selectElement.getBoundingClientRect().width}hasAddonEndNodes(){return this._addonEndSlot?this._addonEndSlot.assignedNodes().length>0:!1}setFocus(){this._component.focus()}isWithinSelf(e){return!!this._component.shadowRoot&&this._component.shadowRoot.contains(e)||this._component.contains(e)}};var p=class extends B{constructor(e){super(e);this._shape="default";this._label="";this._disabled=!1;this._invalid=!1;this._required=!1;this._floatLabelType="auto";this._density="default";this._isInitialized=!1;this._leadingChangeListener=i=>this._onLeadingSlotChanged(i),this._addonEndChangeListener=i=>this._onAddonEndSlotChanged(i),this._targetWidthCallback=()=>this._adapter.getTargetWidth(),this._mousedownListener=i=>this._onMouseDown(i)}initialize(){super.initialize(),super.initializeTarget(),this._initializeLabel(),this._initializeAccessibility(),this._adapter.setPlaceholderText(this._placeholder),this._applyDensity(),this._setShapeType(),this._detectLeadingElement(),this._detectAddonEndContent(),this._adapter.addMouseDownListener(this._mousedownListener),this._adapter.setLeadingListener(this._leadingChangeListener),this._adapter.setAddonEndListener(this._addonEndChangeListener),this._disabled&&this._adapter.setDisabled(!0),this._invalid&&this._adapter.setInvalid(!0),this._isInitialized=!0}disconnect(){super.disconnect(),this._adapter.removeMouseDownListener(this._mousedownListener),this._adapter.removeLeadingListener(this._leadingChangeListener),this._adapter.removeAddonEndListener(this._leadingChangeListener),this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeLabel(){if(this._adapter.initializeLabel(),this._updateLabel(),this._floatingLabelInstance=this._adapter.initializeFloatingLabel(),this._floatLabelType==="always")this._floatLabel(!0);else{let e=!!this._getSelectedText(),i=!!this._placeholder;this._floatLabel(e||i)}}_destroyLabel(){this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeValue(){super._initializeValue(),this._selectedValues.length&&this._floatLabel(!0)}_initializeAccessibility(){this._adapter.setMultiple(this._multiple),this._required&&this._adapter.setHostAttribute("aria-required","true"),this._disabled&&this._adapter.setHostAttribute("aria-disabled","true"),this._invalid&&this._adapter.setHostAttribute("aria-invalid","true")}_onMouseDown(e){this._adapter.isWithinSelf(e.target)&&e.preventDefault()}_onLeadingSlotChanged(e){this._detectLeadingElement()}_onAddonEndSlotChanged(e){this._detectAddonEndContent()}_detectLeadingElement(){this._adapter.hasLeadingElement()?this._adapter.addRootClass(t.classes.LEADING):this._adapter.removeRootClass(t.classes.LEADING)}_detectAddonEndContent(){this._adapter.hasAddonEndNodes()?this._adapter.addRootClass(t.classes.ADDON_END):this._adapter.removeRootClass(t.classes.ADDON_END)}_onClick(e){this._disabled||L(e).find(r=>r.classList&&r.classList.contains(t.classes.ADDON_END_CONTAINER))||(this.setFocus(),super._onClick(e))}_onFocus(e){this._disabled||(this._setFocused(),super._onFocus(e))}_floatLabel(e){!this._floatingLabelInstance||(e?this._adapter.addRootClass(o.classes.LABEL_FLOAT):this._adapter.removeRootClass(o.classes.LABEL_FLOAT),this._floatLabelType==="always"&&(e=!0),this._floatingLabelInstance.float(e,this._floatLabelType==="always"))}_onBlur(e){super._onBlur(e),this._setBlurred()}_onDismiss(){super._onDismiss(),this._setBlurred()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}async _onSelect(e,i,r=!0){let u=await super._onSelect(e,i,r);return u&&(this._adapter.setSelectedText(this._getSelectedText()),r&&!this._multiple&&this._adapter.setFocus()),u}_setFocused(){this._adapter.addRootClass(t.classes.FOCUSED),this._floatLabel(!0)}_setBlurred(){var e;this._adapter.removeRootClass(t.classes.FOCUSED),!this._selectedValues.length&&!((e=this._placeholder)!=null&&e.length)&&this._floatLabel(!1)}_reset(){var e;super._reset(),this._adapter.setSelectedText(""),this._floatLabel(!((e=this._placeholder)!=null&&e.length))}_updateLabel(){this._adapter.hasLabel()&&this._adapter.setLabel(this._label),this._label&&this._density!=="dense"?this._adapter.addRootClass(t.classes.LABEL):this._adapter.removeRootClass(t.classes.LABEL)}_applyValue(e){super._applyValue(e);let i=this._getSelectedText();this._adapter.setSelectedText(i),this._open||this._floatLabel(!!i||!!this._placeholder)}_applyDensity(){this._adapter.setRoomy(this._density==="roomy"),this._adapter.setDense(this._density==="dense")}_setShapeType(){this._shape==="rounded"?this._adapter.addRootClass(t.classes.SHAPE_ROUNDED):this._adapter.removeRootClass(t.classes.SHAPE_ROUNDED)}setFocus(){this._adapter.setFocus()}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._updateLabel(),this._label?(this._initializeLabel(),this._adapter.setHostAttribute(o.attributes.LABEL,this._label)):(this._destroyLabel(),this.required=!1,this._adapter.removeHostAttribute(o.attributes.LABEL)))}get shape(){return this._shape}set shape(e){this._shape!==e&&(this._shape=e,this._isInitialized&&this._setShapeType(),this._adapter.setHostAttribute(t.attributes.SHAPE,this._shape))}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.setDisabled(this._disabled),this._initializeLabel())}get invalid(){return this._invalid}set invalid(e){this._invalid!==e&&(this._invalid=e,this._adapter.setInvalid(this._invalid))}get required(){return this._required}set required(e){this._required!==e&&(this._required=e,this._adapter.setRequired(this._required),this._adapter.toggleHostAttribute(t.attributes.REQUIRED,this._required))}get density(){return this._density}set density(e){this._density!==e&&(this._density=e,this._applyDensity(),this._adapter.setHostAttribute(t.attributes.DENSITY,this._density.toString()),this._initializeLabel())}get floatLabelType(){return this._floatLabelType}set floatLabelType(e){this._floatLabelType!==e&&(this._floatLabelType=e,this._floatLabel(this._floatLabelType==="always"||!!this._placeholder),this._adapter.setHostAttribute(t.attributes.FLOAT_LABEL_TYPE,v(this._floatLabelType)?this._floatLabelType.toString():""))}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&(this._placeholder=e,this._adapter.setPlaceholderText(this._placeholder),this._initializeLabel())}};var $='<template><div class="forge-select__wrapper" part="root"><div class="forge-select forge-field" part="container"><div class="forge-select__leading-container" part="leading-container"><slot name="leading"></slot></div><div class="forge-field__label-input-container" part="label-input-container"><div id="selected-text" class="forge-select__selected-text" part="text" aria-live="assertive" aria-atomic="true"></div><label id="select-label" aria-hidden="true" part="label"></label></div><forge-icon class="forge-select__dropdown-icon" name="arrow_drop_down" part="icon"></forge-icon><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',Q='.forge-select{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-select-margin-top,0)}.forge-select.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-select:not(.forge-field--dense):not(.forge-field--roomy){height:3rem;height:var(--forge-select-height,3rem)}.forge-select.forge-field--roomy:not(.forge-field--dense){height:3.5rem;height:var(--forge-select-height,3.5rem)}.forge-select.forge-field--dense:not(.forge-field--roomy){height:1.5rem;height:var(--forge-select-height,1.5rem)}.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-style:var(--forge-select-border-style,solid);border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-select-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field~::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}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-select__leading-container{display:-webkit-box;display:flex;align-self:center}.forge-field label{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-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-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);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field label[dir=rtl],[dir=rtl] .forge-field label{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) label{display:none}.forge-field--required label::after{content:none}.forge-field--required label::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{font-size:1rem}.forge-field--roomy:not(.forge-field--dense) label{font-size:1rem}.forge-field--disabled label{color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) label{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{top:1rem}.forge-field--roomy:not(.forge-field--dense) label{top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) label{left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) label{left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) label{padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded label{padding-right:32px}.forge-field label.forge-floating-label--float-above{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled label.forge-floating-label--float-above{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) label.forge-floating-label--float-above{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label.forge-floating-label--float-above{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above{-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above{-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field .forge-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:block;overflow:hidden;text-overflow:ellipsis;align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;white-space:nowrap;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0;font-size:var(--forge-select-font-size, 1rem);padding:0 12px;padding-right:0}.forge-field:not(.forge-field--disabled) .forge-select__selected-text{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled .forge-select__selected-text{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{font-size:.875rem;font-size:var(--forge-select-font-size, .875rem)}.forge-field .forge-select__selected-text{padding:0 12px}.forge-field--label .forge-select__selected-text{padding-top:24px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-top:29px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-select__selected-text{padding-left:32px}.forge-field--leading .forge-select__selected-text{padding-left:0}.forge-field--label .forge-select__selected-text{padding-bottom:3px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-bottom:8px}.forge-field:not(.forge-field--label):not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height, 3rem)}.forge-field:not(.forge-field--label).forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{line-height:var(--forge-select-height-roomy, 3.5rem)}.forge-field:not(.forge-field--label).forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height-dense, 1.5rem)}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{padding:0 8px}.forge-field .forge-select__selected-text:empty::before{content:attr(placeholder);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field .forge-select--label .forge-select__selected-text{padding-top:25px}.forge-field .forge-select__dropdown-icon{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;width:24px;height:100%;-webkit-box-flex:0;flex:none;-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);pointer-events:none;margin-right:8px}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) .forge-select__dropdown-icon{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) .forge-select__dropdown-icon{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled .forge-select__dropdown-icon{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__dropdown-icon{margin-right:4px}:host{display:block;contain:layout}:host(:focus){outline:0}:host([hidden]){display:none}',l=class extends M{constructor(){super();D.define([w,k,A]),x(this,$,Q),this._foundation=new p(new g(this))}static get observedAttributes(){return[t.attributes.DENSITY,t.attributes.FLOAT_LABEL_TYPE,t.attributes.SHAPE,t.attributes.INVALID,t.attributes.REQUIRED,o.attributes.LABEL,o.attributes.MULTIPLE,o.attributes.VALUE,o.attributes.DISABLED,o.attributes.PLACEHOLDER,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,c.attributes.POPUP_CLASSES,c.attributes.OPTION_LIMIT,c.attributes.SYNC_POPUP_WIDTH,c.attributes.CONSTRAIN_POPUP_WIDTH,c.attributes.WRAP_OPTION_TEXT]}attributeChangedCallback(e,i,r){switch(e){case t.attributes.DENSITY:this.density=r;return;case t.attributes.FLOAT_LABEL_TYPE:this.floatLabelType=r;return;case t.attributes.SHAPE:this.shape=r;break;case t.attributes.INVALID:this.invalid=b(r);return;case t.attributes.REQUIRED:this.required=b(r);return;case o.attributes.LABEL:this.label=r;return;case o.attributes.DISABLED:this.disabled=b(r);return;case o.attributes.PLACEHOLDER:this.placeholder=r;return}super.attributeChangedCallback(e,i,r)}};a([n()],l.prototype,"label",2),a([n()],l.prototype,"disabled",2),a([n()],l.prototype,"invalid",2),a([n()],l.prototype,"required",2),a([n()],l.prototype,"density",2),a([n()],l.prototype,"floatLabelType",2),a([n()],l.prototype,"shape",2),a([n()],l.prototype,"placeholder",2),l=a([T({name:o.elementName,dependencies:[H,q,F,I,z,N,C,W,P,R]})],l);function He(){E(l)}export{o as a,g as b,p as c,l as d,He as e};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as c,f as B,g as M,h as Y}from"./chunk.36RT7UOR.js";import{b as q}from"./chunk.SGTKZRDH.js";import{d as H}from"./chunk.AITARMT3.js";import{b as W}from"./chunk.WEE3TIAW.js";import{d as O}from"./chunk.DBKVUCUQ.js";import{a as t}from"./chunk.IX2UHMIM.js";import{c as I}from"./chunk.4QVF44G5.js";import{e as z}from"./chunk.MA2P7CG4.js";import{d as N}from"./chunk.B3LPXCVL.js";import{a as L}from"./chunk.4DAIIJ37.js";import{b as P}from"./chunk.EOZITZSP.js";import{e as F}from"./chunk.WCSVKQR2.js";import{a as R}from"./chunk.HDHGU4L2.js";import{c as w,g as A,h as k}from"./chunk.MZLPUI6R.js";import{d as D,l as C}from"./chunk.WHQZNZHW.js";import{a as n}from"./chunk.KTGSZEAG.js";import{a as T,b as S}from"./chunk.DL7NX432.js";import{a as E,e as x,g as f}from"./chunk.LJLEPTLU.js";import{o as y,t as s,u as d}from"./chunk.4LA6HEA7.js";import{b as v,k as b}from"./chunk.J2M2MXP2.js";import{f as a}from"./chunk.MCIQXNKY.js";var U=`${S}select`,h={ROOT:"forge-select",OPENED:"forge-select--opened",SELECTED_TEXT:"forge-select__selected-text",DROPDOWN:"forge-select__dropdown",LABEL_FLOAT:"forge-select--label-float",GROUP_WRAPPER:"forge-select__group-wrapper"},V={ROOT:`.${h.ROOT}`,SELECTED_TEXT:`.${h.SELECTED_TEXT}`,LABEL:"label#select-label",LEADING_SLOT:"slot[name=leading]",ADDON_END_SLOT:"slot[name=addon-end]"},G={TYPE:"type",VALUE:"value",LABEL:"label",MULTIPLE:"multiple",DISABLED:"disabled",PLACEHOLDER:"placeholder",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},X={SCROLLED_BOTTOM:`${U}-scrolled-bottom`},o={elementName:U,classes:h,selectors:V,attributes:G,events:X};var g=class extends Y{constructor(e){super(e);this._selectElement=f(e,o.selectors.ROOT),this._leadingSlot=f(e,o.selectors.LEADING_SLOT),this._addonEndSlot=f(this._component,o.selectors.ADDON_END_SLOT),this._selectedTextElement=f(e,o.selectors.SELECTED_TEXT),this._targetElement=this._selectElement}initializeLabel(){this._labelElement=f(this._component,o.selectors.LABEL)}hasLabel(){return!!this._labelElement}initializeAccessibility(){this._component.setAttribute("role","combobox"),this._component.setAttribute("aria-haspopup","true"),this._component.setAttribute("aria-expanded","false"),(!this._component.hasAttribute("tabindex")||this._component.tabIndex===-1)&&(this._component.tabIndex=0)}initializeFloatingLabel(){return new O(this._labelElement)}setLabel(e){(!this._component.hasAttribute("aria-label")||this._component.getAttribute("aria-label")===this._labelElement.textContent)&&this._component.setAttribute("aria-label",e),this._labelElement.textContent=e}addRootClass(e){this._selectElement.classList.add(e)}removeRootClass(e){this._selectElement.classList.remove(e)}setPlaceholderText(e){d(this._selectedTextElement,!!e,"placeholder",e)}addClickListener(e){this._component.addEventListener("click",e)}removeClickListener(e){this._component.removeEventListener("click",e)}addMouseDownListener(e){this._component.addEventListener("mousedown",e)}removeMouseDownListener(e){this._component.removeEventListener("mousedown",e)}addTargetListener(e,i){this._component.addEventListener(e,i)}removeTargetListener(e,i){this._component.removeEventListener(e,i)}open(e){super.open(e),this._component.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._component.setAttribute("aria-expanded","true"),s(this._selectElement,!0,o.classes.OPENED)}close(){this._component.setAttribute("aria-expanded","false"),this._component.removeAttribute("aria-activedescendant"),this._component.removeAttribute("aria-controls"),s(this._selectElement,!1,o.classes.OPENED),super.close()}updateActiveDescendant(e){d(this._component,!!e,"aria-activedescendant",e)}setSelectedText(e){this._selectedTextElement.textContent=e}setLeadingListener(e){this._leadingSlot.addEventListener("slotchange",e)}removeLeadingListener(e){this._leadingSlot.removeEventListener("slotchange",e)}setAddonEndListener(e){this._addonEndSlot.addEventListener("slotchange",e)}removeAddonEndListener(e){this._addonEndSlot.removeEventListener("slotchange",e)}hasLeadingElement(){return this._leadingSlot.assignedNodes().length>0}setDisabled(e){s(this._selectElement,e,t.classes.DISABLED),d(this._component,e,"aria-disabled","true"),this._component.tabIndex=e?-1:0}setInvalid(e){s(this._selectElement,e,t.classes.INVALID),d(this._component,e,"aria-invalid","true")}setRequired(e){s(this._selectElement,e,t.classes.REQUIRED),d(this._component,e,"aria-required","true")}setRoomy(e){s(this._selectElement,e,t.classes.ROOMY)}setDense(e){s(this._selectElement,e,t.classes.DENSE)}setMultiple(e){e?this.setHostAttribute("aria-multiselectable","true"):this.removeHostAttribute("aria-multiselectable")}getLabelWidth(e,i){return y(this._labelElement.innerText,{fontSize:e,fontFamily:i})}getLabelFontMetrics(){let e=getComputedStyle(this._labelElement);return{fontSize:parseInt(e.fontSize||"16",10),fontFamily:e.fontFamily||"Roboto"}}getTargetWidth(){return this._selectElement.getBoundingClientRect().width}hasAddonEndNodes(){return this._addonEndSlot?this._addonEndSlot.assignedNodes().length>0:!1}setFocus(){this._component.focus()}isWithinSelf(e){return!!this._component.shadowRoot&&this._component.shadowRoot.contains(e)||this._component.contains(e)}};var p=class extends B{constructor(e){super(e);this._shape="default";this._label="";this._disabled=!1;this._invalid=!1;this._required=!1;this._floatLabelType="auto";this._density="default";this._isInitialized=!1;this._leadingChangeListener=i=>this._onLeadingSlotChanged(i),this._addonEndChangeListener=i=>this._onAddonEndSlotChanged(i),this._targetWidthCallback=()=>this._adapter.getTargetWidth(),this._mousedownListener=i=>this._onMouseDown(i)}initialize(){super.initialize(),super.initializeTarget(),this._initializeLabel(),this._initializeAccessibility(),this._adapter.setPlaceholderText(this._placeholder),this._applyDensity(),this._setShapeType(),this._detectLeadingElement(),this._detectAddonEndContent(),this._adapter.addMouseDownListener(this._mousedownListener),this._adapter.setLeadingListener(this._leadingChangeListener),this._adapter.setAddonEndListener(this._addonEndChangeListener),this._disabled&&this._adapter.setDisabled(!0),this._invalid&&this._adapter.setInvalid(!0),this._isInitialized=!0}disconnect(){super.disconnect(),this._adapter.removeMouseDownListener(this._mousedownListener),this._adapter.removeLeadingListener(this._leadingChangeListener),this._adapter.removeAddonEndListener(this._leadingChangeListener),this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeLabel(){if(this._adapter.initializeLabel(),this._updateLabel(),this._floatingLabelInstance=this._adapter.initializeFloatingLabel(),this._floatLabelType==="always")this._floatLabel(!0);else{let e=!!this._getSelectedText(),i=!!this._placeholder;this._floatLabel(e||i)}}_destroyLabel(){this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeValue(){super._initializeValue(),this._selectedValues.length&&this._floatLabel(!0)}_initializeAccessibility(){this._adapter.setMultiple(this._multiple),this._required&&this._adapter.setHostAttribute("aria-required","true"),this._disabled&&this._adapter.setHostAttribute("aria-disabled","true"),this._invalid&&this._adapter.setHostAttribute("aria-invalid","true")}_onMouseDown(e){this._adapter.isWithinSelf(e.target)&&e.preventDefault()}_onLeadingSlotChanged(e){this._detectLeadingElement()}_onAddonEndSlotChanged(e){this._detectAddonEndContent()}_detectLeadingElement(){this._adapter.hasLeadingElement()?this._adapter.addRootClass(t.classes.LEADING):this._adapter.removeRootClass(t.classes.LEADING)}_detectAddonEndContent(){this._adapter.hasAddonEndNodes()?this._adapter.addRootClass(t.classes.ADDON_END):this._adapter.removeRootClass(t.classes.ADDON_END)}_onClick(e){this._disabled||L(e).find(r=>r.classList&&r.classList.contains(t.classes.ADDON_END_CONTAINER))||(this.setFocus(),super._onClick(e))}_onFocus(e){this._disabled||(this._setFocused(),super._onFocus(e))}_floatLabel(e){!this._floatingLabelInstance||(e?this._adapter.addRootClass(o.classes.LABEL_FLOAT):this._adapter.removeRootClass(o.classes.LABEL_FLOAT),this._floatLabelType==="always"&&(e=!0),this._floatingLabelInstance.float(e,this._floatLabelType==="always"))}_onBlur(e){super._onBlur(e),this._setBlurred()}_onDismiss(){super._onDismiss(),this._setBlurred()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}async _onSelect(e,i,r=!0){let u=await super._onSelect(e,i,r);return u&&(this._adapter.setSelectedText(this._getSelectedText()),r&&!this._multiple&&this._adapter.setFocus()),u}_setFocused(){this._adapter.addRootClass(t.classes.FOCUSED),this._floatLabel(!0)}_setBlurred(){var e;this._adapter.removeRootClass(t.classes.FOCUSED),!this._selectedValues.length&&!((e=this._placeholder)!=null&&e.length)&&this._floatLabel(!1)}_reset(){var e;super._reset(),this._adapter.setSelectedText(""),this._floatLabel(!((e=this._placeholder)!=null&&e.length))}_updateLabel(){this._adapter.hasLabel()&&this._adapter.setLabel(this._label),this._label&&this._density!=="dense"?this._adapter.addRootClass(t.classes.LABEL):this._adapter.removeRootClass(t.classes.LABEL)}_applyValue(e){super._applyValue(e);let i=this._getSelectedText();this._adapter.setSelectedText(i),this._open||this._floatLabel(!!i||!!this._placeholder)}_applyDensity(){this._adapter.setRoomy(this._density==="roomy"),this._adapter.setDense(this._density==="dense")}_setShapeType(){this._shape==="rounded"?this._adapter.addRootClass(t.classes.SHAPE_ROUNDED):this._adapter.removeRootClass(t.classes.SHAPE_ROUNDED)}setFocus(){this._adapter.setFocus()}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._updateLabel(),this._label?(this._initializeLabel(),this._adapter.setHostAttribute(o.attributes.LABEL,this._label)):(this._destroyLabel(),this.required=!1,this._adapter.removeHostAttribute(o.attributes.LABEL)))}get shape(){return this._shape}set shape(e){this._shape!==e&&(this._shape=e,this._isInitialized&&this._setShapeType(),this._adapter.setHostAttribute(t.attributes.SHAPE,this._shape))}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.setDisabled(this._disabled),this._initializeLabel())}get invalid(){return this._invalid}set invalid(e){this._invalid!==e&&(this._invalid=e,this._adapter.setInvalid(this._invalid))}get required(){return this._required}set required(e){this._required!==e&&(this._required=e,this._adapter.setRequired(this._required),this._adapter.toggleHostAttribute(t.attributes.REQUIRED,this._required))}get density(){return this._density}set density(e){this._density!==e&&(this._density=e,this._applyDensity(),this._adapter.setHostAttribute(t.attributes.DENSITY,this._density.toString()),this._initializeLabel())}get floatLabelType(){return this._floatLabelType}set floatLabelType(e){this._floatLabelType!==e&&(this._floatLabelType=e,this._floatLabel(this._floatLabelType==="always"||!!this._placeholder),this._adapter.setHostAttribute(t.attributes.FLOAT_LABEL_TYPE,v(this._floatLabelType)?this._floatLabelType.toString():""))}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&(this._placeholder=e,this._adapter.setPlaceholderText(this._placeholder),this._initializeLabel())}};var $='<template><div class="forge-select__wrapper" part="root"><div class="forge-select forge-field" part="container"><div class="forge-select__leading-container" part="leading-container"><slot name="leading"></slot></div><div class="forge-field__label-input-container" part="label-input-container"><div id="selected-text" class="forge-select__selected-text" part="text" aria-live="assertive" aria-atomic="true"></div><label id="select-label" aria-hidden="true" part="label"></label></div><forge-icon class="forge-select__dropdown-icon" name="arrow_drop_down" part="icon"></forge-icon><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',Q='.forge-select{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-select-margin-top,0)}.forge-select.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-select:not(.forge-field--dense):not(.forge-field--roomy){height:3rem;height:var(--forge-select-height,3rem)}.forge-select.forge-field--roomy:not(.forge-field--dense){height:3.5rem;height:var(--forge-select-height,3.5rem)}.forge-select.forge-field--dense:not(.forge-field--roomy){height:1.5rem;height:var(--forge-select-height,1.5rem)}.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-style:var(--forge-select-border-style,solid);border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-select-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field~::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}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-select__leading-container{display:-webkit-box;display:flex;align-self:center}.forge-field label{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-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-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);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field label[dir=rtl],[dir=rtl] .forge-field label{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) label{display:none}.forge-field--required label::after{content:none}.forge-field--required label::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{font-size:1rem}.forge-field--roomy:not(.forge-field--dense) label{font-size:1rem}.forge-field--disabled label{color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) label{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{top:1rem}.forge-field--roomy:not(.forge-field--dense) label{top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) label{left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) label{left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) label{padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded label{padding-right:32px}.forge-field label.forge-floating-label--float-above{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled label.forge-floating-label--float-above{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) label.forge-floating-label--float-above{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label.forge-floating-label--float-above{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above{-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above{-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field .forge-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:block;overflow:hidden;text-overflow:ellipsis;align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;white-space:nowrap;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0;font-size:var(--forge-select-font-size, 1rem);padding:0 12px;padding-right:0}.forge-field:not(.forge-field--disabled) .forge-select__selected-text{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled .forge-select__selected-text{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{font-size:.875rem;font-size:var(--forge-select-font-size, .875rem)}.forge-field .forge-select__selected-text{padding:0 12px}.forge-field--label .forge-select__selected-text{padding-top:24px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-top:29px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-select__selected-text{padding-left:32px}.forge-field--leading .forge-select__selected-text{padding-left:0}.forge-field--label .forge-select__selected-text{padding-bottom:3px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-bottom:8px}.forge-field:not(.forge-field--label):not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height, 3rem)}.forge-field:not(.forge-field--label).forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{line-height:var(--forge-select-height-roomy, 3.5rem)}.forge-field:not(.forge-field--label).forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height-dense, 1.5rem)}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{padding:0 8px}.forge-field .forge-select__selected-text:empty::before{content:attr(placeholder);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field .forge-select--label .forge-select__selected-text{padding-top:25px}.forge-field .forge-select__dropdown-icon{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;width:24px;height:100%;-webkit-box-flex:0;flex:none;-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);pointer-events:none;margin-right:8px}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) .forge-select__dropdown-icon{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) .forge-select__dropdown-icon{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled .forge-select__dropdown-icon{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__dropdown-icon{margin-right:4px}:host{display:block;contain:layout}:host(:focus){outline:0}:host([hidden]){display:none}',l=class extends M{constructor(){super();D.define([w,k,A]),x(this,$,Q),this._foundation=new p(new g(this))}static get observedAttributes(){return[t.attributes.DENSITY,t.attributes.FLOAT_LABEL_TYPE,t.attributes.SHAPE,t.attributes.INVALID,t.attributes.REQUIRED,o.attributes.LABEL,o.attributes.MULTIPLE,o.attributes.VALUE,o.attributes.DISABLED,o.attributes.PLACEHOLDER,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,c.attributes.POPUP_CLASSES,c.attributes.OPTION_LIMIT,c.attributes.SYNC_POPUP_WIDTH,c.attributes.CONSTRAIN_POPUP_WIDTH,c.attributes.WRAP_OPTION_TEXT]}attributeChangedCallback(e,i,r){switch(e){case t.attributes.DENSITY:this.density=r;return;case t.attributes.FLOAT_LABEL_TYPE:this.floatLabelType=r;return;case t.attributes.SHAPE:this.shape=r;break;case t.attributes.INVALID:this.invalid=b(r);return;case t.attributes.REQUIRED:this.required=b(r);return;case o.attributes.LABEL:this.label=r;return;case o.attributes.DISABLED:this.disabled=b(r);return;case o.attributes.PLACEHOLDER:this.placeholder=r;return}super.attributeChangedCallback(e,i,r)}};a([n()],l.prototype,"label",2),a([n()],l.prototype,"disabled",2),a([n()],l.prototype,"invalid",2),a([n()],l.prototype,"required",2),a([n()],l.prototype,"density",2),a([n()],l.prototype,"floatLabelType",2),a([n()],l.prototype,"shape",2),a([n()],l.prototype,"placeholder",2),l=a([T({name:o.elementName,dependencies:[H,q,F,I,z,N,C,W,P,R]})],l);function He(){E(l)}export{o as a,g as b,p as c,l as d,He as e};
|
|
7
|
+
//# sourceMappingURL=chunk.HSUOYMJT.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 rt}from"./chunk.LIKJD4SK.js";import{d as at}from"./chunk.TDWRBHQW.js";import{a as f,b as nt}from"./chunk.EYGSUZWX.js";import{h as st}from"./chunk.UE4KJ2BZ.js";import{c as et}from"./chunk.4J7MOJUW.js";import{e as tt}from"./chunk.QWB7A62L.js";import{e as it}from"./chunk.WCSVKQR2.js";import{a as ot}from"./chunk.HDHGU4L2.js";import{a as C}from"./chunk.MV327MYK.js";import{j as K}from"./chunk.MZLPUI6R.js";import{a as F}from"./chunk.YI4JTY4T.js";import{a as Q,d as Z,l as E}from"./chunk.WHQZNZHW.js";import{a as $}from"./chunk.2KXSGD3S.js";import{g as J}from"./chunk.FVRSGKJD.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.U6WGJELL.js";import{a as W}from"./chunk.UWYANU5D.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.DL7NX432.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.LJLEPTLU.js";import{m as A,s as P,u as x}from"./chunk.4LA6HEA7.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,f as p}from"./chunk.MCIQXNKY.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._component.ownerDocument)===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.masked&&this._showMaskFormat&&this._applyMask(),this._allowInput&&this._adapter.selectInputText()}_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 xe(){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,xe as s};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as rt}from"./chunk.LIKJD4SK.js";import{d as at}from"./chunk.TDWRBHQW.js";import{a as f,b as nt}from"./chunk.EYGSUZWX.js";import{h as st}from"./chunk.LZOAYM6V.js";import{c as et}from"./chunk.4QVF44G5.js";import{e as tt}from"./chunk.MA2P7CG4.js";import{e as it}from"./chunk.WCSVKQR2.js";import{a as ot}from"./chunk.HDHGU4L2.js";import{a as C}from"./chunk.MV327MYK.js";import{j as K}from"./chunk.MZLPUI6R.js";import{a as F}from"./chunk.YI4JTY4T.js";import{a as Q,d as Z,l as E}from"./chunk.WHQZNZHW.js";import{a as $}from"./chunk.2KXSGD3S.js";import{g as J}from"./chunk.FVRSGKJD.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.U6WGJELL.js";import{a as W}from"./chunk.UWYANU5D.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.DL7NX432.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.LJLEPTLU.js";import{m as A,s as P,u as x}from"./chunk.4LA6HEA7.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,f as p}from"./chunk.MCIQXNKY.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._component.ownerDocument)===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.masked&&this._showMaskFormat&&this._applyMask(),this._allowInput&&this._adapter.selectInputText()}_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 xe(){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,xe as s};
|
|
7
|
+
//# sourceMappingURL=chunk.HVYDNI2O.js.map
|