@tylertech/forge 2.17.0 → 2.18.1

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.
Files changed (180) hide show
  1. package/custom-elements.json +178 -10
  2. package/dist/esm/accordion/index.js +1 -1
  3. package/dist/esm/app-bar/help-button/index.js +1 -1
  4. package/dist/esm/app-bar/index.js +1 -1
  5. package/dist/esm/app-bar/menu-button/index.js +1 -1
  6. package/dist/esm/app-bar/notification-button/index.js +1 -1
  7. package/dist/esm/app-bar/profile-button/index.js +1 -1
  8. package/dist/esm/app-bar/search/index.js +1 -1
  9. package/dist/esm/autocomplete/index.js +1 -1
  10. package/dist/esm/banner/index.js +1 -1
  11. package/dist/esm/bottom-sheet/index.js +1 -1
  12. package/dist/esm/calendar/index.js +1 -1
  13. package/dist/esm/chip-field/index.js +1 -1
  14. package/dist/esm/chips/chip/index.js +1 -1
  15. package/dist/esm/chips/chip-set/index.js +1 -1
  16. package/dist/esm/chips/index.js +1 -1
  17. package/dist/esm/chunks/{chunk.S2N5KJ7S.js → chunk.23QPY6PU.js} +2 -2
  18. package/dist/esm/chunks/{chunk.65II7E54.js → chunk.2NA4LVTZ.js} +2 -2
  19. package/dist/esm/chunks/{chunk.NOO2ZZKZ.js → chunk.3DYMGITQ.js} +2 -2
  20. package/dist/esm/chunks/{chunk.UW2HWAVL.js → chunk.42QTJZSF.js} +2 -2
  21. package/dist/esm/chunks/{chunk.LLK7YGQW.js → chunk.54KXJVRY.js} +2 -2
  22. package/dist/esm/chunks/{chunk.BKAZC53W.js → chunk.55HRCXPA.js} +2 -2
  23. package/dist/esm/chunks/{chunk.T6NVM7TN.js → chunk.67G7HT5S.js} +2 -2
  24. package/dist/esm/chunks/{chunk.AEKZWVNO.js → chunk.7G53ACL4.js} +2 -2
  25. package/dist/esm/chunks/{chunk.AEKZWVNO.js.map → chunk.7G53ACL4.js.map} +3 -3
  26. package/dist/esm/chunks/{chunk.YMBLWKRP.js → chunk.7IHNVPY5.js} +2 -2
  27. package/dist/esm/chunks/{chunk.RGAPFLQE.js → chunk.7LX3X2DU.js} +2 -2
  28. package/dist/esm/chunks/{chunk.XFAOB6LU.js → chunk.7NHFZL6J.js} +2 -2
  29. package/dist/esm/chunks/{chunk.D24CE6KE.js → chunk.AZFF62ZK.js} +2 -2
  30. package/dist/esm/chunks/chunk.BINM3NUA.js +7 -0
  31. package/dist/esm/chunks/chunk.BINM3NUA.js.map +7 -0
  32. package/dist/esm/chunks/{chunk.IWMA7NUU.js → chunk.D43PPRFO.js} +2 -2
  33. package/dist/esm/chunks/{chunk.SATUJNQX.js → chunk.ETJMASRZ.js} +2 -2
  34. package/dist/esm/chunks/{chunk.FOLQAW63.js → chunk.F7ZYEFH5.js} +2 -2
  35. package/dist/esm/chunks/chunk.GBUXAJPY.js +7 -0
  36. package/dist/esm/chunks/chunk.GBUXAJPY.js.map +7 -0
  37. package/dist/esm/chunks/{chunk.6CAOHLX6.js → chunk.GEWDZDXN.js} +2 -2
  38. package/dist/esm/chunks/{chunk.6CAOHLX6.js.map → chunk.GEWDZDXN.js.map} +2 -2
  39. package/dist/esm/chunks/{chunk.MSFGXRCM.js → chunk.IV2GMOPB.js} +2 -2
  40. package/dist/esm/chunks/chunk.IWICN773.js +7 -0
  41. package/dist/esm/chunks/chunk.IWICN773.js.map +7 -0
  42. package/dist/esm/chunks/{chunk.H4ZMVM5H.js → chunk.J2FXLTZT.js} +2 -2
  43. package/dist/esm/chunks/{chunk.H4ZMVM5H.js.map → chunk.J2FXLTZT.js.map} +1 -1
  44. package/dist/esm/chunks/{chunk.HTH3CEDN.js → chunk.J2PHUKSR.js} +2 -2
  45. package/dist/esm/chunks/{chunk.BKNYDA4V.js → chunk.JCDIPDQR.js} +2 -2
  46. package/dist/esm/chunks/{chunk.BAVLVCGK.js → chunk.JOLJ7WVN.js} +2 -2
  47. package/dist/esm/chunks/{chunk.BAVLVCGK.js.map → chunk.JOLJ7WVN.js.map} +2 -2
  48. package/dist/esm/chunks/chunk.KCC3C3WH.js +7 -0
  49. package/dist/esm/chunks/chunk.KCC3C3WH.js.map +7 -0
  50. package/dist/esm/chunks/{chunk.XIZILH2M.js → chunk.KNVCEYY2.js} +2 -2
  51. package/dist/esm/chunks/chunk.KQK2XX5H.js +7 -0
  52. package/dist/esm/chunks/chunk.KQK2XX5H.js.map +7 -0
  53. package/dist/esm/chunks/{chunk.PYXKGV4Z.js → chunk.MXVJSEF3.js} +2 -2
  54. package/dist/esm/chunks/{chunk.PYXKGV4Z.js.map → chunk.MXVJSEF3.js.map} +2 -2
  55. package/dist/esm/chunks/{chunk.SQTM36C3.js → chunk.N6XHXCZE.js} +2 -2
  56. package/dist/esm/chunks/{chunk.AB5XER3E.js → chunk.NOXJK2U7.js} +2 -2
  57. package/dist/esm/chunks/{chunk.JDLEPQKN.js → chunk.OEZZ2NEY.js} +2 -2
  58. package/dist/esm/chunks/{chunk.MS77SPS4.js → chunk.QZ2NXIGY.js} +2 -2
  59. package/dist/esm/chunks/{chunk.MS77SPS4.js.map → chunk.QZ2NXIGY.js.map} +2 -2
  60. package/dist/esm/chunks/{chunk.CG5CVENX.js → chunk.RLWX5BFQ.js} +2 -2
  61. package/dist/esm/chunks/{chunk.274MFEUZ.js → chunk.SFTWKDQV.js} +2 -2
  62. package/dist/esm/chunks/{chunk.Q5YD3PKM.js → chunk.TH7RLTJK.js} +2 -2
  63. package/dist/esm/chunks/{chunk.USXO7YKN.js → chunk.TOM77CWD.js} +2 -2
  64. package/dist/esm/chunks/chunk.U773QUMB.js +12 -0
  65. package/dist/esm/chunks/{chunk.K6LBO4KJ.js → chunk.UVL4TIK2.js} +2 -2
  66. package/dist/esm/chunks/chunk.WOTVTBJS.js +7 -0
  67. package/dist/esm/chunks/chunk.WOTVTBJS.js.map +7 -0
  68. package/dist/esm/chunks/chunk.WPJEXVHM.js +7 -0
  69. package/dist/esm/chunks/{chunk.NQZXAC65.js.map → chunk.WPJEXVHM.js.map} +2 -2
  70. package/dist/esm/chunks/{chunk.NX4EECNP.js → chunk.XTMXGKUO.js} +2 -2
  71. package/dist/esm/chunks/{chunk.2DAPNN6B.js → chunk.Y2I2VRMF.js} +2 -2
  72. package/dist/esm/chunks/{chunk.ERO7T6WC.js → chunk.Z4HBPQ42.js} +2 -2
  73. package/dist/esm/color-picker/index.js +1 -1
  74. package/dist/esm/date-picker/index.js +1 -1
  75. package/dist/esm/date-range-picker/index.js +1 -1
  76. package/dist/esm/expansion-panel/index.js +1 -1
  77. package/dist/esm/icon/index.js +1 -1
  78. package/dist/esm/icon-button/index.js +1 -1
  79. package/dist/esm/index.js +1 -1
  80. package/dist/esm/keyboard-shortcut/index.js +1 -1
  81. package/dist/esm/list-dropdown/index.js +1 -1
  82. package/dist/esm/menu/index.js +1 -1
  83. package/dist/esm/open-icon/index.js +1 -1
  84. package/dist/esm/paginator/index.js +1 -1
  85. package/dist/esm/profile-card/index.js +1 -1
  86. package/dist/esm/quantity-field/index.js +1 -1
  87. package/dist/esm/select/core/index.js +1 -1
  88. package/dist/esm/select/index.js +1 -1
  89. package/dist/esm/select/option/index.js +1 -1
  90. package/dist/esm/select/select/index.js +1 -1
  91. package/dist/esm/select/select-dropdown/index.js +1 -1
  92. package/dist/esm/split-view/index.js +1 -1
  93. package/dist/esm/split-view/split-view/index.js +1 -1
  94. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  95. package/dist/esm/stepper/index.js +1 -1
  96. package/dist/esm/stepper/step/index.js +1 -1
  97. package/dist/esm/stepper/stepper/index.js +1 -1
  98. package/dist/esm/table/index.js +1 -1
  99. package/dist/esm/tabs/index.js +1 -1
  100. package/dist/esm/tabs/tab-bar/index.js +1 -1
  101. package/dist/esm/time-picker/index.js +1 -1
  102. package/dist/esm/toast/index.js +1 -1
  103. package/esm/autocomplete/autocomplete-constants.d.ts +3 -0
  104. package/esm/autocomplete/autocomplete-foundation.d.ts +3 -1
  105. package/esm/autocomplete/autocomplete-foundation.js +14 -0
  106. package/esm/autocomplete/autocomplete.d.ts +7 -1
  107. package/esm/autocomplete/autocomplete.js +7 -0
  108. package/esm/calendar/calendar-foundation.js +6 -0
  109. package/esm/chip-field/chip-field-adapter.js +1 -1
  110. package/esm/chip-field/chip-field.js +2 -2
  111. package/esm/date-picker/base/base-date-picker-foundation.js +1 -1
  112. package/esm/date-range-picker/date-range-picker-foundation.js +2 -2
  113. package/esm/icon/icon-adapter.d.ts +0 -2
  114. package/esm/icon/icon-adapter.js +4 -5
  115. package/esm/icon/icon-foundation.js +0 -1
  116. package/esm/keyboard-shortcut/keyboard-shortcut-constants.d.ts +1 -0
  117. package/esm/keyboard-shortcut/keyboard-shortcut-foundation.d.ts +6 -0
  118. package/esm/keyboard-shortcut/keyboard-shortcut-foundation.js +9 -0
  119. package/esm/keyboard-shortcut/keyboard-shortcut.d.ts +4 -0
  120. package/esm/keyboard-shortcut/keyboard-shortcut.js +3 -0
  121. package/esm/list-dropdown/list-dropdown-constants.d.ts +4 -0
  122. package/esm/list-dropdown/list-dropdown-utils.js +14 -3
  123. package/esm/paginator/paginator-adapter.d.ts +2 -0
  124. package/esm/paginator/paginator-adapter.js +57 -0
  125. package/esm/select/core/base-select-adapter.js +3 -0
  126. package/esm/select/option/option-constants.d.ts +1 -0
  127. package/esm/select/option/option-constants.js +1 -0
  128. package/esm/select/option/option-foundation.d.ts +13 -0
  129. package/esm/select/option/option-foundation.js +28 -0
  130. package/esm/select/option/option.d.ts +7 -0
  131. package/esm/select/option/option.js +13 -0
  132. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  133. package/esm/time-picker/time-picker-foundation.js +3 -3
  134. package/package.json +1 -1
  135. package/styles/chip-field/_base.scss +1 -0
  136. package/styles/chip-field/_selector.scss +2 -2
  137. package/dist/esm/chunks/chunk.A4UN74PV.js +0 -7
  138. package/dist/esm/chunks/chunk.A4UN74PV.js.map +0 -7
  139. package/dist/esm/chunks/chunk.FFVZ6JMP.js +0 -7
  140. package/dist/esm/chunks/chunk.FFVZ6JMP.js.map +0 -7
  141. package/dist/esm/chunks/chunk.IMEODSRH.js +0 -7
  142. package/dist/esm/chunks/chunk.IMEODSRH.js.map +0 -7
  143. package/dist/esm/chunks/chunk.NQZXAC65.js +0 -7
  144. package/dist/esm/chunks/chunk.S2YVOMLW.js +0 -7
  145. package/dist/esm/chunks/chunk.S2YVOMLW.js.map +0 -7
  146. package/dist/esm/chunks/chunk.S7ZU6JKB.js +0 -7
  147. package/dist/esm/chunks/chunk.S7ZU6JKB.js.map +0 -7
  148. package/dist/esm/chunks/chunk.W3GR3VDN.js +0 -12
  149. package/dist/esm/chunks/chunk.XY45YU7I.js +0 -7
  150. package/dist/esm/chunks/chunk.XY45YU7I.js.map +0 -7
  151. /package/dist/esm/chunks/{chunk.S2N5KJ7S.js.map → chunk.23QPY6PU.js.map} +0 -0
  152. /package/dist/esm/chunks/{chunk.65II7E54.js.map → chunk.2NA4LVTZ.js.map} +0 -0
  153. /package/dist/esm/chunks/{chunk.NOO2ZZKZ.js.map → chunk.3DYMGITQ.js.map} +0 -0
  154. /package/dist/esm/chunks/{chunk.UW2HWAVL.js.map → chunk.42QTJZSF.js.map} +0 -0
  155. /package/dist/esm/chunks/{chunk.LLK7YGQW.js.map → chunk.54KXJVRY.js.map} +0 -0
  156. /package/dist/esm/chunks/{chunk.BKAZC53W.js.map → chunk.55HRCXPA.js.map} +0 -0
  157. /package/dist/esm/chunks/{chunk.T6NVM7TN.js.map → chunk.67G7HT5S.js.map} +0 -0
  158. /package/dist/esm/chunks/{chunk.YMBLWKRP.js.map → chunk.7IHNVPY5.js.map} +0 -0
  159. /package/dist/esm/chunks/{chunk.RGAPFLQE.js.map → chunk.7LX3X2DU.js.map} +0 -0
  160. /package/dist/esm/chunks/{chunk.XFAOB6LU.js.map → chunk.7NHFZL6J.js.map} +0 -0
  161. /package/dist/esm/chunks/{chunk.D24CE6KE.js.map → chunk.AZFF62ZK.js.map} +0 -0
  162. /package/dist/esm/chunks/{chunk.IWMA7NUU.js.map → chunk.D43PPRFO.js.map} +0 -0
  163. /package/dist/esm/chunks/{chunk.SATUJNQX.js.map → chunk.ETJMASRZ.js.map} +0 -0
  164. /package/dist/esm/chunks/{chunk.FOLQAW63.js.map → chunk.F7ZYEFH5.js.map} +0 -0
  165. /package/dist/esm/chunks/{chunk.MSFGXRCM.js.map → chunk.IV2GMOPB.js.map} +0 -0
  166. /package/dist/esm/chunks/{chunk.HTH3CEDN.js.map → chunk.J2PHUKSR.js.map} +0 -0
  167. /package/dist/esm/chunks/{chunk.BKNYDA4V.js.map → chunk.JCDIPDQR.js.map} +0 -0
  168. /package/dist/esm/chunks/{chunk.XIZILH2M.js.map → chunk.KNVCEYY2.js.map} +0 -0
  169. /package/dist/esm/chunks/{chunk.SQTM36C3.js.map → chunk.N6XHXCZE.js.map} +0 -0
  170. /package/dist/esm/chunks/{chunk.AB5XER3E.js.map → chunk.NOXJK2U7.js.map} +0 -0
  171. /package/dist/esm/chunks/{chunk.JDLEPQKN.js.map → chunk.OEZZ2NEY.js.map} +0 -0
  172. /package/dist/esm/chunks/{chunk.CG5CVENX.js.map → chunk.RLWX5BFQ.js.map} +0 -0
  173. /package/dist/esm/chunks/{chunk.274MFEUZ.js.map → chunk.SFTWKDQV.js.map} +0 -0
  174. /package/dist/esm/chunks/{chunk.Q5YD3PKM.js.map → chunk.TH7RLTJK.js.map} +0 -0
  175. /package/dist/esm/chunks/{chunk.USXO7YKN.js.map → chunk.TOM77CWD.js.map} +0 -0
  176. /package/dist/esm/chunks/{chunk.W3GR3VDN.js.map → chunk.U773QUMB.js.map} +0 -0
  177. /package/dist/esm/chunks/{chunk.K6LBO4KJ.js.map → chunk.UVL4TIK2.js.map} +0 -0
  178. /package/dist/esm/chunks/{chunk.NX4EECNP.js.map → chunk.XTMXGKUO.js.map} +0 -0
  179. /package/dist/esm/chunks/{chunk.2DAPNN6B.js.map → chunk.Y2I2VRMF.js.map} +0 -0
  180. /package/dist/esm/chunks/{chunk.ERO7T6WC.js.map → chunk.Z4HBPQ42.js.map} +0 -0
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as S,b as L,d as O,e as B}from"./chunk.MS77SPS4.js";import{E as w}from"./chunk.NQZXAC65.js";import{F as N}from"./chunk.44WDRTRR.js";import{b as y}from"./chunk.NMKDIHFB.js";import{e as g}from"./chunk.DONAMICM.js";import{e as V}from"./chunk.3C44DXZ2.js";import{b as M}from"./chunk.CG5CVENX.js";import{p as P}from"./chunk.MZLPUI6R.js";import{a as D}from"./chunk.YI4JTY4T.js";import{d as T,l as F}from"./chunk.S2YVOMLW.js";import{a as x}from"./chunk.2KXSGD3S.js";import{b as A}from"./chunk.FVRSGKJD.js";import{e as m}from"./chunk.U6WGJELL.js";import{a as b,b as k}from"./chunk.QOA2O575.js";import{a as E,e as C,i as I}from"./chunk.HOXFK44F.js";import{s as f}from"./chunk.4LA6HEA7.js";import{f as v}from"./chunk.J2M2MXP2.js";import{a as d,f as _}from"./chunk.MCIQXNKY.js";var r=`${k}date-picker`,z={VALUE:"value"},U={INPUT:"input,input[forge-date-picker-input]"},R={CHANGE:`${r}-change`,OPEN:`${r}-open`,CLOSE:`${r}-close`,INPUT:`${r}-input`},n={elementName:r,selectors:U,events:R,observedAttributes:z};var l=class extends O{constructor(e){super(e);this._dropdownIdentifier=`forge-date-picker-${this._identifier}`}_initializeInput(){this._inputElement=this._component.querySelector(n.selectors.INPUT)}_initializeCalendarDropdown(){let e=this._getDefaultTargetElement();this._calendarDropdown=new N(e,this._dropdownIdentifier)}initializeMask(e){var t;(t=this._inputMask)==null||t.destroy(),this._inputMask=new A(this._inputElement,e)}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(){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"),this._inputElement.setAttribute("aria-owns",this._dropdownIdentifier)}addInputListener(e,t,i){var a;(a=this._inputElement)==null||a.addEventListener(e,t,{capture:i})}removeInputListener(e,t,i){var a;(a=this._inputElement)==null||a.removeEventListener(e,t,{capture:i})}setInputValueChangedListener(e,t){this.destroyValueChangeListener();let i=g(e,this._inputElement,"value",t);this._valueChangeListeners.push(i)}hasInputElement(){return!!this._inputElement}attachCalendar(e,t){super.attachCalendar(e,t),this._inputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._inputElement&&(this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(e){this._inputElement.setAttribute("aria-activedescendant",e)}setInputValue(e,t){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.updateMask(),t&&(this._inputElement.dispatchEvent(new Event("change")),this._inputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return f(this._component.ownerDocument)===this._inputElement}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",e.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=e))}tryFocusInput(){this._inputElement.focus()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}emitInputEvent(e,t){I(this._inputElement,e,t)}};var p=class extends B{constructor(e){super(e);this._mode="single"}_initializeState(){this._value||(this._value=this._coerceDateValue(this._adapter.getInputValue()))}_emitChangeEvent(e,t){let i=this._getTypedValue(e);return this._adapter.emitHostEvent(n.events.CHANGE,i,!0,!t)?(this._setValue(e),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let e=new Date;e.setHours(0,0,0,0),this._onDateSelected({date:e,selected:!0,type:"date"})}_onClear(){this._onDateSelected({date:null,selected:!1,type:"date"})}_getCurrentValue(){return this._value}_setFormattedInputValue(e){let t=this._formatDate(this._value);t?this._adapter.setInputValue(t,e?!1:this._notifyInputValueChanges):this._allowInvalidDate||this._adapter.setInputValue("",e?!1:this._notifyInputValueChanges)}_setValue(e){(!e||this._isDateValueAcceptable(e))&&(this._value=e)}_onDateSelected(e){let t=e.date;if(e.type==="date"&&this._closeCalendar(!0),!this._emitChangeEvent(t))return;let i=this._formatDate(t);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._formatInputValue(),D.isMobile||this._adapter.selectInputText()}_openCalendar(e){super._openCalendar(e);let t=this._getCurrentValue();t&&this._adapter.goToCalendarDate(new Date(t))}_applyMin(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMin()}_applyMax(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMax()}_applyDisabledDates(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_applyDisabledDaysOfWeek(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_handleInput(e){let t=this._getSanitizedDateString(e),i=this._coerceDateValue(t);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,t),!m(i,this._value)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(i)}_onInputValueChanged(e){let t=this._getSanitizedDateString(e);if(this._masked&&t)return;let i=this._coerceDateValue(t);!m(i,this._value)&&this._isDateValueAcceptable(i)&&(this.value=i,this._emitChangeEvent(this._value))}_applyValue(){this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(this._value)}get value(){let e=this._getTypedValue(this._value);return e?v(e)?new Date(e.getTime()):e:null}set value(e){this._value!==e&&(this._setValue(this._coerceDateValue(e)),this._isInitialized&&this._applyValue())}};var K="<template><slot></slot></template>",$=":host{display:block}:host([hidden]){display:none}",o=class extends L{static get observedAttributes(){return[...Object.values(S.observedAttributes),n.observedAttributes.VALUE]}constructor(){super(),T.define(P),C(this,K,$),this._foundation=new p(new l(this))}attributeChangedCallback(s,e,t){switch(s){case n.observedAttributes.VALUE:this.value=t;return}super.attributeChangedCallback(s,e,t)}};o=_([b({name:n.elementName,dependencies:[V,w,M,F]})],o);var H=class extends x{constructor(e){super(e)}_build(){let e=document.createElement(n.elementName);return this._attachTextField(e),e}getInputElement(){return this._textFieldDelegate.inputElement}getTextFieldElement(){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.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.target.value)):this.getInputElement().addEventListener("input",t=>e(t.target.value))}onInput(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.detail)):this._textFieldDelegate.inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,a,c,h;let t={props:d({},(a=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:a.props),options:d({},(h=(c=this._config.options)==null?void 0:c.textFieldDelegateConfig)==null?void 0:h.options)};this._textFieldDelegate=new y(t),e.appendChild(this._textFieldDelegate.element)}};function Fe(){E(o)}export{n as a,l as b,p as c,o as d,H as e,Fe as f};
7
- //# sourceMappingURL=chunk.XIZILH2M.js.map
6
+ import{a as S,b as L,d as O,e as B}from"./chunk.QZ2NXIGY.js";import{E as w}from"./chunk.WPJEXVHM.js";import{F as N}from"./chunk.44WDRTRR.js";import{b as y}from"./chunk.NMKDIHFB.js";import{e as g}from"./chunk.DONAMICM.js";import{e as V}from"./chunk.3C44DXZ2.js";import{b as M}from"./chunk.RLWX5BFQ.js";import{p as P}from"./chunk.MZLPUI6R.js";import{a as D}from"./chunk.YI4JTY4T.js";import{d as T,l as F}from"./chunk.IWICN773.js";import{a as x}from"./chunk.2KXSGD3S.js";import{b as A}from"./chunk.FVRSGKJD.js";import{e as m}from"./chunk.U6WGJELL.js";import{a as b,b as k}from"./chunk.QOA2O575.js";import{a as E,e as C,i as I}from"./chunk.HOXFK44F.js";import{s as f}from"./chunk.4LA6HEA7.js";import{f as v}from"./chunk.J2M2MXP2.js";import{a as d,f as _}from"./chunk.MCIQXNKY.js";var r=`${k}date-picker`,z={VALUE:"value"},U={INPUT:"input,input[forge-date-picker-input]"},R={CHANGE:`${r}-change`,OPEN:`${r}-open`,CLOSE:`${r}-close`,INPUT:`${r}-input`},n={elementName:r,selectors:U,events:R,observedAttributes:z};var l=class extends O{constructor(e){super(e);this._dropdownIdentifier=`forge-date-picker-${this._identifier}`}_initializeInput(){this._inputElement=this._component.querySelector(n.selectors.INPUT)}_initializeCalendarDropdown(){let e=this._getDefaultTargetElement();this._calendarDropdown=new N(e,this._dropdownIdentifier)}initializeMask(e){var t;(t=this._inputMask)==null||t.destroy(),this._inputMask=new A(this._inputElement,e)}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(){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"),this._inputElement.setAttribute("aria-owns",this._dropdownIdentifier)}addInputListener(e,t,i){var a;(a=this._inputElement)==null||a.addEventListener(e,t,{capture:i})}removeInputListener(e,t,i){var a;(a=this._inputElement)==null||a.removeEventListener(e,t,{capture:i})}setInputValueChangedListener(e,t){this.destroyValueChangeListener();let i=g(e,this._inputElement,"value",t);this._valueChangeListeners.push(i)}hasInputElement(){return!!this._inputElement}attachCalendar(e,t){super.attachCalendar(e,t),this._inputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._inputElement&&(this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(e){this._inputElement.setAttribute("aria-activedescendant",e)}setInputValue(e,t){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.updateMask(),t&&(this._inputElement.dispatchEvent(new Event("change")),this._inputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return f(this._component.ownerDocument)===this._inputElement}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",e.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=e))}tryFocusInput(){this._inputElement.focus()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}emitInputEvent(e,t){I(this._inputElement,e,t)}};var p=class extends B{constructor(e){super(e);this._mode="single"}_initializeState(){this._value||(this._value=this._coerceDateValue(this._adapter.getInputValue()))}_emitChangeEvent(e,t){let i=this._getTypedValue(e);return this._adapter.emitHostEvent(n.events.CHANGE,i,!0,!t)?(this._setValue(e),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let e=new Date;e.setHours(0,0,0,0),this._onDateSelected({date:e,selected:!0,type:"date"})}_onClear(){this._onDateSelected({date:null,selected:!1,type:"date"})}_getCurrentValue(){return this._value}_setFormattedInputValue(e){let t=this._formatDate(this._value);t?this._adapter.setInputValue(t,e?!1:this._notifyInputValueChanges):this._allowInvalidDate||this._adapter.setInputValue("",e?!1:this._notifyInputValueChanges)}_setValue(e){(!e||this._isDateValueAcceptable(e))&&(this._value=e)}_onDateSelected(e){let t=e.date;if(e.type==="date"&&this._closeCalendar(!0),!this._emitChangeEvent(t))return;let i=this._formatDate(t);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._formatInputValue(),D.isMobile||this._adapter.selectInputText()}_openCalendar(e){super._openCalendar(e);let t=this._getCurrentValue();t&&this._adapter.goToCalendarDate(new Date(t))}_applyMin(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMin()}_applyMax(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMax()}_applyDisabledDates(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_applyDisabledDaysOfWeek(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_handleInput(e){let t=this._getSanitizedDateString(e),i=this._coerceDateValue(t);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,t),!m(i,this._value)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(i)}_onInputValueChanged(e){let t=this._getSanitizedDateString(e);if(this._masked&&t)return;let i=this._coerceDateValue(t);!m(i,this._value)&&this._isDateValueAcceptable(i)&&(this.value=i,this._emitChangeEvent(this._value))}_applyValue(){this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(this._value)}get value(){let e=this._getTypedValue(this._value);return e?v(e)?new Date(e.getTime()):e:null}set value(e){this._value!==e&&(this._setValue(this._coerceDateValue(e)),this._isInitialized&&this._applyValue())}};var K="<template><slot></slot></template>",$=":host{display:block}:host([hidden]){display:none}",o=class extends L{static get observedAttributes(){return[...Object.values(S.observedAttributes),n.observedAttributes.VALUE]}constructor(){super(),T.define(P),C(this,K,$),this._foundation=new p(new l(this))}attributeChangedCallback(s,e,t){switch(s){case n.observedAttributes.VALUE:this.value=t;return}super.attributeChangedCallback(s,e,t)}};o=_([b({name:n.elementName,dependencies:[V,w,M,F]})],o);var H=class extends x{constructor(e){super(e)}_build(){let e=document.createElement(n.elementName);return this._attachTextField(e),e}getInputElement(){return this._textFieldDelegate.inputElement}getTextFieldElement(){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.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.target.value)):this.getInputElement().addEventListener("input",t=>e(t.target.value))}onInput(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.detail)):this._textFieldDelegate.inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,a,c,h;let t={props:d({},(a=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:a.props),options:d({},(h=(c=this._config.options)==null?void 0:c.textFieldDelegateConfig)==null?void 0:h.options)};this._textFieldDelegate=new y(t),e.appendChild(this._textFieldDelegate.element)}};function Fe(){E(o)}export{n as a,l as b,p as c,o as d,H as e,Fe as f};
7
+ //# sourceMappingURL=chunk.KNVCEYY2.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as b}from"./chunk.5KC43VFL.js";import{a as s}from"./chunk.KTGSZEAG.js";import{a as d,b as _}from"./chunk.QOA2O575.js";import{a as I,l as g}from"./chunk.HOXFK44F.js";import{k as p}from"./chunk.J2M2MXP2.js";import{f as n}from"./chunk.MCIQXNKY.js";var a=class extends b{constructor(t){super(t)}};var u=`${_}option`,h={DISABLED:"disabled",DIVIDER:"divider",LABEL:"label",SECONDARY_LABEL:"secondary-label",LEADING_ICON_CLASS:"leading-icon-class",LEADING_ICON_TYPE:"leading-icon-type",LEADING_ICON:"leading-icon",OPTION_CLASS:"option-class",TRAILING_ICON_CLASS:"trailing-icon-class",TRAILING_ICON_TYPE:"trailing-icon-type",TRAILING_ICON:"trailing-icon",VALUE:"value"},C={VALUE_CHANGE:`${u}-value-change`},i={elementName:u,attributes:h,events:C};var l=class{constructor(t){this._adapter=t;this._disabled=!1;this._divider=!1;this._optionClass=[]}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._adapter.emitHostEvent(i.events.VALUE_CHANGE,this._value))}get label(){return this._label}set label(t){this._label!==t&&(this._label=t,this._adapter.toggleHostAttribute(i.attributes.LABEL,!!this._label,this._label))}get secondaryLabel(){return this._secondaryLabel}set secondaryLabel(t){this._secondaryLabel!==t&&(this._secondaryLabel=t,this._adapter.toggleHostAttribute(i.attributes.SECONDARY_LABEL,!!this._secondaryLabel,this._secondaryLabel))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.toggleHostAttribute(i.attributes.DISABLED,this._disabled))}get divider(){return this._divider}set divider(t){this._divider!==t&&(this._divider=t,this._adapter.toggleHostAttribute(i.attributes.DIVIDER,this._divider))}get optionClass(){return this._optionClass}set optionClass(t){t?typeof t=="string"&&(t=t.split(" ")):t=[],t=t.filter(o=>o&&!/\s+/.test(o)),this._optionClass.toString()!==t.toString()&&(this._optionClass=t,this._adapter.toggleHostAttribute(i.attributes.OPTION_CLASS,this._optionClass&&!!this._optionClass.length,this._optionClass.join(" ")))}get leadingIcon(){return this._leadingIcon}set leadingIcon(t){this._leadingIcon!==t&&(this._leadingIcon=t,this._adapter.toggleHostAttribute(i.attributes.LEADING_ICON,!!this._leadingIcon,this._leadingIcon))}get leadingIconClass(){return this._leadingIconClass}set leadingIconClass(t){this._leadingIconClass!==t&&(this._leadingIconClass=t,this._adapter.toggleHostAttribute(i.attributes.LEADING_ICON_CLASS,!!this._leadingIconClass,this._leadingIconClass))}get leadingIconType(){return this._leadingIconType}set leadingIconType(t){this._leadingIconType!==t&&(this._leadingIconType=t,this._adapter.toggleHostAttribute(i.attributes.LEADING_ICON_TYPE,!!this._leadingIconType,this._leadingIconType))}get leadingIconComponentProps(){return this._leadingIconComponentProps}set leadingIconComponentProps(t){this._leadingIconComponentProps!==t&&(this._leadingIconComponentProps=t)}get trailingIcon(){return this._trailingIcon}set trailingIcon(t){this._trailingIcon!==t&&(this._trailingIcon=t,this._adapter.toggleHostAttribute(i.attributes.TRAILING_ICON,!!this._trailingIcon,this._trailingIcon))}get trailingIconClass(){return this._trailingIconClass}set trailingIconClass(t){this._trailingIconClass!==t&&(this._trailingIconClass=t,this._adapter.toggleHostAttribute(i.attributes.TRAILING_ICON_CLASS,!!this._trailingIconClass,this._trailingIconClass))}get trailingIconType(){return this._trailingIconType}set trailingIconType(t){this._trailingIconType!==t&&(this._trailingIconType=t,this._adapter.toggleHostAttribute(i.attributes.TRAILING_ICON_TYPE,!!this._trailingIconType,this._trailingIconType))}get trailingIconComponentProps(){return this._trailingIconComponentProps}set trailingIconComponentProps(t){this._trailingIconComponentProps!==t&&(this._trailingIconComponentProps=t)}get leadingBuilder(){return this._leadingBuilder}set leadingBuilder(t){this._leadingBuilder!==t&&(this._leadingBuilder=t)}get trailingBuilder(){return this._trailingBuilder}set trailingBuilder(t){this._trailingBuilder!==t&&(this._trailingBuilder=t)}};var e=class extends g{constructor(){super();this._foundation=new l(new a(this))}static get observedAttributes(){return[i.attributes.VALUE,i.attributes.LABEL,i.attributes.SECONDARY_LABEL,i.attributes.DISABLED,i.attributes.DIVIDER,i.attributes.OPTION_CLASS,i.attributes.LEADING_ICON,i.attributes.LEADING_ICON_CLASS,i.attributes.LEADING_ICON_TYPE,i.attributes.TRAILING_ICON,i.attributes.TRAILING_ICON_CLASS,i.attributes.TRAILING_ICON_TYPE]}initializedCallback(){this.hasAttribute("role")||this.setAttribute("role","option")}attributeChangedCallback(o,L,r){switch(o){case i.attributes.VALUE:this.value=r;break;case i.attributes.LABEL:this.label=r;break;case i.attributes.SECONDARY_LABEL:this.secondaryLabel=r;break;case i.attributes.DISABLED:this.disabled=p(r);break;case i.attributes.DIVIDER:this.divider=this.hasAttribute(i.attributes.DIVIDER);break;case i.attributes.OPTION_CLASS:this.optionClass=r;break;case i.attributes.LEADING_ICON:this.leadingIcon=r;break;case i.attributes.LEADING_ICON_CLASS:this.leadingIconClass=r;break;case i.attributes.LEADING_ICON_TYPE:this.leadingIconType=r;break;case i.attributes.TRAILING_ICON:this.trailingIcon=r;break;case i.attributes.TRAILING_ICON_CLASS:this.trailingIconClass=r;break;case i.attributes.TRAILING_ICON_TYPE:this.trailingIconType=r;break}}};n([s()],e.prototype,"value",2),n([s()],e.prototype,"label",2),n([s()],e.prototype,"secondaryLabel",2),n([s()],e.prototype,"disabled",2),n([s()],e.prototype,"divider",2),n([s()],e.prototype,"optionClass",2),n([s()],e.prototype,"leadingIcon",2),n([s()],e.prototype,"leadingIconClass",2),n([s()],e.prototype,"leadingIconType",2),n([s()],e.prototype,"leadingIconComponentProps",2),n([s()],e.prototype,"trailingIcon",2),n([s()],e.prototype,"trailingIconClass",2),n([s()],e.prototype,"trailingIconType",2),n([s()],e.prototype,"trailingIconComponentProps",2),n([s()],e.prototype,"leadingBuilder",2),n([s()],e.prototype,"trailingBuilder",2),e=n([d({name:i.elementName})],e);function x(){I(e)}export{a,i as b,l as c,e as d,x as e};
7
+ //# sourceMappingURL=chunk.KQK2XX5H.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/select/option/option-adapter.ts", "../../src/select/option/option-constants.ts", "../../src/select/option/option-foundation.ts", "../../src/select/option/option.ts", "../../src/select/option/index.ts"],
4
+ "sourcesContent": ["import { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';\nimport { IOptionComponent } from './option';\n\nexport interface IOptionAdapter extends IBaseAdapter {\n setHostAttribute(name: string, value: string): void;\n removeHostAttribute(name: string): void;\n}\n\n/**\n * The DOM adapter behind the `<forge-option>` element.\n */\nexport class OptionAdapter extends BaseAdapter<IOptionComponent> {\n constructor(component: IOptionComponent) {\n super(component);\n }\n}\n", "import { COMPONENT_NAME_PREFIX } from '../../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}option`;\n\nconst attributes = {\n DISABLED: 'disabled',\n DIVIDER: 'divider',\n LABEL: 'label',\n SECONDARY_LABEL: 'secondary-label',\n LEADING_ICON_CLASS: 'leading-icon-class',\n LEADING_ICON_TYPE: 'leading-icon-type',\n LEADING_ICON: 'leading-icon',\n OPTION_CLASS: 'option-class',\n TRAILING_ICON_CLASS: 'trailing-icon-class',\n TRAILING_ICON_TYPE: 'trailing-icon-type',\n TRAILING_ICON: 'trailing-icon',\n VALUE: 'value'\n};\n\nconst events = {\n VALUE_CHANGE: `${elementName}-value-change`\n};\n\nexport const OPTION_CONSTANTS = {\n elementName,\n attributes,\n events\n};\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\nimport { IIconComponent } from '../../icon';\nimport { IBaseListDropdownOption, ListDropdownIconType } from '../../list-dropdown/list-dropdown-constants';\nimport { IOptionAdapter } from './option-adapter';\nimport { OPTION_CONSTANTS } from './option-constants';\n\nexport interface IOptionFoundation extends ICustomElementFoundation, Required<IBaseListDropdownOption> {}\n\n/** The foundation class behind the `<forge-option>` element. */\nexport class OptionFoundation implements IOptionFoundation {\n private _value: any;\n private _label: string;\n private _secondaryLabel: string;\n private _disabled = false;\n private _divider = false;\n private _optionClass: string[] = [];\n private _leadingIcon: string;\n private _leadingIconClass: string;\n private _leadingIconType: ListDropdownIconType;\n private _leadingIconComponentProps: Partial<IIconComponent>;\n private _trailingIcon: string;\n private _trailingIconClass: string;\n private _trailingIconType: ListDropdownIconType;\n private _trailingIconComponentProps: Partial<IIconComponent>;\n private _leadingBuilder: () => HTMLElement;\n private _trailingBuilder: () => HTMLElement;\n\n constructor(private _adapter: IOptionAdapter) {}\n\n /** Gets/sets the value of this option. */\n public get value(): any {\n return this._value;\n }\n public set value(value: any) {\n if (this._value !== value) {\n this._value = value;\n this._adapter.emitHostEvent(OPTION_CONSTANTS.events.VALUE_CHANGE, this._value);\n }\n }\n\n /** Gets/sets the label of this option. */\n public get label(): string {\n return this._label;\n }\n public set label(value: string) {\n if (this._label !== value) {\n this._label = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.LABEL, !!this._label, this._label);\n }\n }\n\n /** Gets/sets the secondary label of this option. */\n public get secondaryLabel(): string {\n return this._secondaryLabel;\n }\n public set secondaryLabel(value: string) {\n if (this._secondaryLabel !== value) {\n this._secondaryLabel = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.SECONDARY_LABEL, !!this._secondaryLabel, this._secondaryLabel);\n }\n }\n\n /** Gets/sets the disabled status of this option. */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.DISABLED, this._disabled);\n }\n }\n\n /** Gets/sets the whether this option is a divider. */\n public get divider(): boolean {\n return this._divider;\n }\n public set divider(value: boolean) {\n if (this._divider !== value) {\n this._divider = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.DIVIDER, this._divider);\n }\n }\n\n /** Gets/sets the classes of this option. */\n public get optionClass(): string | string[] {\n return this._optionClass;\n }\n public set optionClass(value: string | string[]) {\n if (!value) {\n value = [];\n } else if (typeof value === 'string') {\n value = value.split(' ');\n }\n\n value = value.filter(v => v && !/\\s+/.test(v));\n\n if (this._optionClass.toString() !== value.toString()) {\n this._optionClass = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.OPTION_CLASS, this._optionClass && !!this._optionClass.length, this._optionClass.join(' '));\n }\n }\n\n /** Gets/sets the leading icon of this option. */\n public get leadingIcon(): string {\n return this._leadingIcon;\n }\n public set leadingIcon(value: string) {\n if (this._leadingIcon !== value) {\n this._leadingIcon = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON, !!this._leadingIcon, this._leadingIcon);\n }\n }\n\n /** Gets/sets the leading icon class of this option. */\n public get leadingIconClass(): string {\n return this._leadingIconClass;\n }\n public set leadingIconClass(value: string) {\n if (this._leadingIconClass !== value) {\n this._leadingIconClass = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_CLASS, !!this._leadingIconClass, this._leadingIconClass);\n }\n }\n\n /** Gets/sets the leading icon type of this option. */\n public get leadingIconType(): ListDropdownIconType {\n return this._leadingIconType;\n }\n public set leadingIconType(value: ListDropdownIconType) {\n if (this._leadingIconType !== value) {\n this._leadingIconType = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_TYPE, !!this._leadingIconType, this._leadingIconType);\n }\n }\n\n /** Gets/sets the props on the leading icon component. */\n public get leadingIconComponentProps(): Partial<IIconComponent> {\n return this._leadingIconComponentProps;\n }\n public set leadingIconComponentProps(value: Partial<IIconComponent>) {\n if (this._leadingIconComponentProps !== value) {\n this._leadingIconComponentProps = value;\n }\n }\n\n /** Gets/sets the trailing icon of this option. */\n public get trailingIcon(): string {\n return this._trailingIcon;\n }\n public set trailingIcon(value: string) {\n if (this._trailingIcon !== value) {\n this._trailingIcon = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON, !!this._trailingIcon, this._trailingIcon);\n }\n }\n\n /** Gets/sets the trailing icon class of this option. */\n public get trailingIconClass(): string {\n return this._trailingIconClass;\n }\n public set trailingIconClass(value: string) {\n if (this._trailingIconClass !== value) {\n this._trailingIconClass = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_CLASS, !!this._trailingIconClass, this._trailingIconClass);\n }\n }\n\n /** Gets/sets the trailing icon type of this option. */\n public get trailingIconType(): ListDropdownIconType {\n return this._trailingIconType;\n }\n public set trailingIconType(value: ListDropdownIconType) {\n if (this._trailingIconType !== value) {\n this._trailingIconType = value;\n this._adapter.toggleHostAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_TYPE, !!this._trailingIconType, this._trailingIconType);\n }\n }\n\n /** Gets/sets the props on the trailing icon component. */\n public get trailingIconComponentProps(): Partial<IIconComponent> {\n return this._trailingIconComponentProps;\n }\n public set trailingIconComponentProps(value: Partial<IIconComponent>) {\n if (this._trailingIconComponentProps !== value) {\n this._trailingIconComponentProps = value;\n }\n }\n\n /** Gets/sets the leading builder of this option. */\n public get leadingBuilder(): (() => HTMLElement) {\n return this._leadingBuilder;\n }\n public set leadingBuilder(value: (() => HTMLElement)) {\n if (this._leadingBuilder !== value) {\n this._leadingBuilder = value;\n }\n }\n\n /** Gets/sets the trailing builder of this option. */\n public get trailingBuilder(): (() => HTMLElement) {\n return this._trailingBuilder;\n }\n public set trailingBuilder(value: (() => HTMLElement)) {\n if (this._trailingBuilder !== value) {\n this._trailingBuilder = value;\n }\n }\n}\n", "import { coerceBoolean, CustomElement, FoundationProperty, ICustomElement } from '@tylertech/forge-core';\nimport { IIconComponent } from '../../icon';\nimport { BaseComponent } from '../../core/base/base-component';\nimport { IBaseListDropdownOption, ListDropdownIconType } from '../../list-dropdown/list-dropdown-constants';\nimport { OptionAdapter } from './option-adapter';\nimport { OPTION_CONSTANTS } from './option-constants';\nimport { OptionFoundation } from './option-foundation';\n\nexport interface IOptionComponent extends ICustomElement, Required<IBaseListDropdownOption> {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-option': IOptionComponent;\n }\n}\n\n/**\n * The custom element class behind the `<forge-option>` element.\n * \n * @tag forge-option\n */\n@CustomElement({\n name: OPTION_CONSTANTS.elementName\n})\nexport class OptionComponent extends BaseComponent implements IOptionComponent {\n public static get observedAttributes(): string[] {\n return [\n OPTION_CONSTANTS.attributes.VALUE,\n OPTION_CONSTANTS.attributes.LABEL,\n OPTION_CONSTANTS.attributes.SECONDARY_LABEL,\n OPTION_CONSTANTS.attributes.DISABLED,\n OPTION_CONSTANTS.attributes.DIVIDER,\n OPTION_CONSTANTS.attributes.OPTION_CLASS,\n OPTION_CONSTANTS.attributes.LEADING_ICON,\n OPTION_CONSTANTS.attributes.LEADING_ICON_CLASS,\n OPTION_CONSTANTS.attributes.LEADING_ICON_TYPE,\n OPTION_CONSTANTS.attributes.TRAILING_ICON,\n OPTION_CONSTANTS.attributes.TRAILING_ICON_CLASS,\n OPTION_CONSTANTS.attributes.TRAILING_ICON_TYPE\n ];\n }\n\n private _foundation: OptionFoundation;\n\n constructor() {\n super();\n this._foundation = new OptionFoundation(new OptionAdapter(this));\n }\n\n public initializedCallback(): void {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'option');\n }\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case OPTION_CONSTANTS.attributes.VALUE:\n this.value = newValue;\n break;\n case OPTION_CONSTANTS.attributes.LABEL:\n this.label = newValue;\n break;\n case OPTION_CONSTANTS.attributes.SECONDARY_LABEL:\n this.secondaryLabel = newValue;\n break;\n case OPTION_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case OPTION_CONSTANTS.attributes.DIVIDER:\n this.divider = this.hasAttribute(OPTION_CONSTANTS.attributes.DIVIDER);\n break;\n case OPTION_CONSTANTS.attributes.OPTION_CLASS:\n this.optionClass = newValue;\n break;\n case OPTION_CONSTANTS.attributes.LEADING_ICON:\n this.leadingIcon = newValue;\n break;\n case OPTION_CONSTANTS.attributes.LEADING_ICON_CLASS:\n this.leadingIconClass = newValue;\n break;\n case OPTION_CONSTANTS.attributes.LEADING_ICON_TYPE:\n this.leadingIconType = newValue as ListDropdownIconType;\n break;\n case OPTION_CONSTANTS.attributes.TRAILING_ICON:\n this.trailingIcon = newValue;\n break;\n case OPTION_CONSTANTS.attributes.TRAILING_ICON_CLASS:\n this.trailingIconClass = newValue;\n break;\n case OPTION_CONSTANTS.attributes.TRAILING_ICON_TYPE:\n this.trailingIconType = newValue as ListDropdownIconType;\n break;\n }\n }\n\n /** Gets/sets the value of this option. */\n @FoundationProperty()\n public declare value: any;\n\n /** Gets/sets the label of this option. */\n @FoundationProperty()\n public declare label: string;\n\n /** Gets/sets the secondary label of this option. */\n @FoundationProperty()\n public declare secondaryLabel: string;\n\n /** Gets/sets the disabled status of this option. */\n @FoundationProperty()\n public declare disabled: boolean;\n\n /** Gets/sets the whether this option is a divider. */\n @FoundationProperty()\n public declare divider: boolean;\n\n /** Gets/sets the classes of this option. */\n @FoundationProperty()\n public declare optionClass: string | string[];\n\n /** Gets/sets the leading icon of this option. */\n @FoundationProperty()\n public declare leadingIcon: string;\n\n /** Gets/sets the leading icon class of this option. */\n @FoundationProperty()\n public declare leadingIconClass: string;\n\n /** Gets/sets the leading icon type of this option. */\n @FoundationProperty()\n public declare leadingIconType: ListDropdownIconType;\n\n /** Gets/sets properties on leading icon component. */\n @FoundationProperty()\n public declare leadingIconComponentProps: Partial<IIconComponent>;\n\n /** Gets/sets the trailing icon of this option. */\n @FoundationProperty()\n public declare trailingIcon: string;\n\n /** Gets/sets the trailing icon class of this option. */\n @FoundationProperty()\n public declare trailingIconClass: string;\n\n /** Gets/sets the trailing icon type of this option. */\n @FoundationProperty()\n public declare trailingIconType: ListDropdownIconType;\n\n /** Gets/sets properties on trailing icon component. */\n @FoundationProperty()\n public declare trailingIconComponentProps: Partial<IIconComponent>;\n\n /** Gets/sets the leading builder of this option. */\n @FoundationProperty()\n public declare leadingBuilder: () => HTMLElement;\n\n /** Gets/sets the trailing builder of this option. */\n @FoundationProperty()\n public declare trailingBuilder: () => HTMLElement;\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { OptionComponent } from './option';\n\nexport * from './option-adapter';\nexport * from './option-constants';\nexport * from './option-foundation';\nexport * from './option';\n\nexport function defineOptionComponent(): void {\n defineCustomElement(OptionComponent);\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["OptionAdapter", "BaseAdapter", "component", "elementName", "COMPONENT_NAME_PREFIX", "attributes", "events", "OPTION_CONSTANTS", "OptionFoundation", "_adapter", "value", "OPTION_CONSTANTS", "v", "OptionComponent", "BaseComponent", "OptionFoundation", "OptionAdapter", "OPTION_CONSTANTS", "name", "oldValue", "newValue", "coerceBoolean", "__decorateClass", "FoundationProperty", "CustomElement", "defineOptionComponent", "defineCustomElement", "OptionComponent"]
7
+ }
@@ -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.ITXUKOKJ.js";import{a as f,b as nt}from"./chunk.NMKDIHFB.js";import{h as st}from"./chunk.S7ZU6JKB.js";import{c as et}from"./chunk.SXTM6OK4.js";import{e as tt}from"./chunk.DYF2MREZ.js";import{e as it}from"./chunk.3C44DXZ2.js";import{a as C,b as ot}from"./chunk.CG5CVENX.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.S2YVOMLW.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.5KC43VFL.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.QOA2O575.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.HOXFK44F.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._allowInput&&this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&this._applyMask()}_onInputBlur(t){this.masked&&this._showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){this._adapter.destroyMask();let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);!this._emitChangeEvent(e)||(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t)}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function 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.PYXKGV4Z.js.map
6
+ import{a as rt}from"./chunk.LIKJD4SK.js";import{d as at}from"./chunk.ITXUKOKJ.js";import{a as f,b as nt}from"./chunk.NMKDIHFB.js";import{h as st}from"./chunk.WOTVTBJS.js";import{c as et}from"./chunk.SXTM6OK4.js";import{e as tt}from"./chunk.DYF2MREZ.js";import{e as it}from"./chunk.3C44DXZ2.js";import{a as C,b as ot}from"./chunk.RLWX5BFQ.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.IWICN773.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.5KC43VFL.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.QOA2O575.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.HOXFK44F.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.MXVJSEF3.js.map