@jimka/typescript-ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +4 -0
  2. package/THIRD-PARTY-NOTICES.md +7 -3
  3. package/dist/lib/{AbstractBooleanInput-BGesvIZy.js → AbstractBooleanInput-DSwKBAic.js} +2 -2
  4. package/dist/lib/{AbstractBooleanInput-BGesvIZy.js.map → AbstractBooleanInput-DSwKBAic.js.map} +1 -1
  5. package/dist/lib/{AbstractInput-BxOtFrER.js → AbstractInput-BmWGJTs1.js} +2 -2
  6. package/dist/lib/{AbstractInput-BxOtFrER.js.map → AbstractInput-BmWGJTs1.js.map} +1 -1
  7. package/dist/lib/AnchorConstraints-CVrMP9rz.js +2 -0
  8. package/dist/lib/AnchorConstraints-CVrMP9rz.js.map +1 -0
  9. package/dist/lib/{AnimatedDropdown-CZQEqQi-.js → AnimatedDropdown-DKas40B-.js} +2 -2
  10. package/dist/lib/{AnimatedDropdown-CZQEqQi-.js.map → AnimatedDropdown-DKas40B-.js.map} +1 -1
  11. package/dist/lib/Border-Bz29z-_7.js +2 -0
  12. package/dist/lib/Border-Bz29z-_7.js.map +1 -0
  13. package/dist/lib/Button-bjpWruNc.js +2 -0
  14. package/dist/lib/{Button-U1rsP4v8.js.map → Button-bjpWruNc.js.map} +1 -1
  15. package/dist/lib/{Card-BVwOS8AG.js → Card-BdfbvOD_.js} +2 -2
  16. package/dist/lib/{Card-BVwOS8AG.js.map → Card-BdfbvOD_.js.map} +1 -1
  17. package/dist/lib/ComboBox-CBw2VLLN.js +2 -0
  18. package/dist/lib/ComboBox-CBw2VLLN.js.map +1 -0
  19. package/dist/lib/Component-DHqrPwAw.js +2 -0
  20. package/dist/lib/Component-DHqrPwAw.js.map +1 -0
  21. package/dist/lib/Container-CAQpj4yb.js +2 -0
  22. package/dist/lib/{Container-D5H8VxJK.js.map → Container-CAQpj4yb.js.map} +1 -1
  23. package/dist/lib/DOM-67StIm5G.js +2 -0
  24. package/dist/lib/DOM-67StIm5G.js.map +1 -0
  25. package/dist/lib/DragChain-CYGuT7OA.js +2 -0
  26. package/dist/lib/DragChain-CYGuT7OA.js.map +1 -0
  27. package/dist/lib/DragManager-CHWCe3-8.js +2 -0
  28. package/dist/lib/DragManager-CHWCe3-8.js.map +1 -0
  29. package/dist/lib/{FieldDecorator-CJs9gwqH.js → FieldDecorator-CgAGcqCk.js} +2 -2
  30. package/dist/lib/{FieldDecorator-CJs9gwqH.js.map → FieldDecorator-CgAGcqCk.js.map} +1 -1
  31. package/dist/lib/{Fit-DjRsiwlg.js → Fit-DIYt2aQB.js} +2 -2
  32. package/dist/lib/{Fit-DjRsiwlg.js.map → Fit-DIYt2aQB.js.map} +1 -1
  33. package/dist/lib/Glyph-CeAIWyPB.js +2 -0
  34. package/dist/lib/Glyph-CeAIWyPB.js.map +1 -0
  35. package/dist/lib/{Grid-DdL9TVeJ.js → Grid-ViA0joow.js} +2 -2
  36. package/dist/lib/{Grid-DdL9TVeJ.js.map → Grid-ViA0joow.js.map} +1 -1
  37. package/dist/lib/GridConstraints-B1rxCw9B.js +2 -0
  38. package/dist/lib/GridConstraints-B1rxCw9B.js.map +1 -0
  39. package/dist/lib/Header-mKaqgfat.js +2 -0
  40. package/dist/lib/Header-mKaqgfat.js.map +1 -0
  41. package/dist/lib/IconText-BqwXA82-.js +2 -0
  42. package/dist/lib/IconText-BqwXA82-.js.map +1 -0
  43. package/dist/lib/{LayoutSerialization-BT66TY83.js → LayoutSerialization-D82UtnDD.js} +2 -2
  44. package/dist/lib/{LayoutSerialization-BT66TY83.js.map → LayoutSerialization-D82UtnDD.js.map} +1 -1
  45. package/dist/lib/LayoutSizes-DG9aW9k6.js +2 -0
  46. package/dist/lib/LayoutSizes-DG9aW9k6.js.map +1 -0
  47. package/dist/lib/List-CUntS8ux.js +2 -0
  48. package/dist/lib/List-CUntS8ux.js.map +1 -0
  49. package/dist/lib/MemoryStore-DT6iWWco.js +2 -0
  50. package/dist/lib/MemoryStore-DT6iWWco.js.map +1 -0
  51. package/dist/lib/Menu-B_-SQj72.js +2 -0
  52. package/dist/lib/Menu-B_-SQj72.js.map +1 -0
  53. package/dist/lib/{MenuButton-VJ5uC3c1.js → MenuButton-C79l8Ysf.js} +2 -2
  54. package/dist/lib/{MenuButton-VJ5uC3c1.js.map → MenuButton-C79l8Ysf.js.map} +1 -1
  55. package/dist/lib/{Panel-DzWdYwq1.js → Panel-D2X33qR6.js} +2 -2
  56. package/dist/lib/{Panel-DzWdYwq1.js.map → Panel-D2X33qR6.js.map} +1 -1
  57. package/dist/lib/Position-Ck_KD4cR.js +2 -0
  58. package/dist/lib/Position-Ck_KD4cR.js.map +1 -0
  59. package/dist/lib/{ProgressSpinner-zJKtGyNJ.js → ProgressSpinner-DCyq02pd.js} +2 -2
  60. package/dist/lib/{ProgressSpinner-zJKtGyNJ.js.map → ProgressSpinner-DCyq02pd.js.map} +1 -1
  61. package/dist/lib/{RadioButton-CYSSv4nV.js → RadioButton-BJIAQkII.js} +2 -2
  62. package/dist/lib/{RadioButton-CYSSv4nV.js.map → RadioButton-BJIAQkII.js.map} +1 -1
  63. package/dist/lib/{RovingTabIndex-BSZ31Vp5.js → RovingTabIndex-DFJyoveq.js} +2 -2
  64. package/dist/lib/{RovingTabIndex-BSZ31Vp5.js.map → RovingTabIndex-DFJyoveq.js.map} +1 -1
  65. package/dist/lib/Scrollbar-CSFK-Y57.js +2 -0
  66. package/dist/lib/Scrollbar-CSFK-Y57.js.map +1 -0
  67. package/dist/lib/Slider-C-kQQYCj.js +2 -0
  68. package/dist/lib/Slider-C-kQQYCj.js.map +1 -0
  69. package/dist/lib/{Spacer-D9NGW4QG.js → Spacer-D159iJy9.js} +2 -2
  70. package/dist/lib/{Spacer-D9NGW4QG.js.map → Spacer-D159iJy9.js.map} +1 -1
  71. package/dist/lib/TabButton-CHkXBgCj.js +2 -0
  72. package/dist/lib/TabButton-CHkXBgCj.js.map +1 -0
  73. package/dist/lib/Text-D5pg7taZ.js +2 -0
  74. package/dist/lib/Text-D5pg7taZ.js.map +1 -0
  75. package/dist/lib/Tooltip-DzK6LxUt.js +3 -0
  76. package/dist/lib/{Tooltip-tkXDk5Bo.js.map → Tooltip-DzK6LxUt.js.map} +1 -1
  77. package/dist/lib/VBox-BNegDPs_.js +2 -0
  78. package/dist/lib/VBox-BNegDPs_.js.map +1 -0
  79. package/dist/lib/VirtualScroller-zQr-vKrO.js +2 -0
  80. package/dist/lib/VirtualScroller-zQr-vKrO.js.map +1 -0
  81. package/dist/lib/component/button.es.js +1 -1
  82. package/dist/lib/component/chart.es.js +1 -1
  83. package/dist/lib/component/chart.es.js.map +1 -1
  84. package/dist/lib/component/container.es.js +1 -1
  85. package/dist/lib/component/container.es.js.map +1 -1
  86. package/dist/lib/component/diagram.es.js +1 -1
  87. package/dist/lib/component/diagram.es.js.map +1 -1
  88. package/dist/lib/component/display.es.js +1 -1
  89. package/dist/lib/component/display.es.js.map +1 -1
  90. package/dist/lib/component/editor.es.js +3 -3
  91. package/dist/lib/component/editor.es.js.map +1 -1
  92. package/dist/lib/component/input.es.js +1 -1
  93. package/dist/lib/component/input.es.js.map +1 -1
  94. package/dist/lib/component/list.es.js +1 -1
  95. package/dist/lib/component/list.es.js.map +1 -1
  96. package/dist/lib/component/menubar.es.js +1 -1
  97. package/dist/lib/component/menubar.es.js.map +1 -1
  98. package/dist/lib/component/table.es.js +2 -2
  99. package/dist/lib/component/table.es.js.map +1 -1
  100. package/dist/lib/component/tree.es.js +1 -1
  101. package/dist/lib/component/tree.es.js.map +1 -1
  102. package/dist/lib/core.es.js +1 -1
  103. package/dist/lib/core.es.js.map +1 -1
  104. package/dist/lib/data.es.js +1 -1
  105. package/dist/lib/data.es.js.map +1 -1
  106. package/dist/lib/glyphs/solid/index.es.js +1 -1
  107. package/dist/lib/layout.es.js +1 -1
  108. package/dist/lib/layout.es.js.map +1 -1
  109. package/dist/lib/overlay.es.js +1 -1
  110. package/dist/lib/overlay.es.js.map +1 -1
  111. package/dist/lib/primitive.es.js +1 -1
  112. package/dist/lib/router.es.js +1 -1
  113. package/dist/lib/router.es.js.map +1 -1
  114. package/dist/lib/selectionsEqual-4r5R7pTK.js +2 -0
  115. package/dist/lib/selectionsEqual-4r5R7pTK.js.map +1 -0
  116. package/dist/lib/types/component/button/TabCloseButton.d.ts +1 -1
  117. package/dist/lib/types/component/container/CollapseButton.d.ts +1 -1
  118. package/dist/lib/types/component/container/DialogBackdrop.d.ts +1 -1
  119. package/dist/lib/types/component/container/MenuItem.d.ts +4 -0
  120. package/dist/lib/types/component/container/MenuSeparator.d.ts +1 -1
  121. package/dist/lib/types/component/container/Scrollbar.d.ts +1 -0
  122. package/dist/lib/types/component/container/SplitGutter.d.ts +2 -2
  123. package/dist/lib/types/component/container/StatusBar.d.ts +1 -1
  124. package/dist/lib/types/component/container/VirtualScroller.d.ts +1 -0
  125. package/dist/lib/types/component/container/WindowBorder.d.ts +1 -1
  126. package/dist/lib/types/component/diagram/DiagramEdgeLayer.d.ts +14 -1
  127. package/dist/lib/types/component/diagram/DiagramModel.d.ts +1 -0
  128. package/dist/lib/types/component/diagram/DiagramNode.d.ts +5 -1
  129. package/dist/lib/types/component/diagram/DiagramView.d.ts +76 -5
  130. package/dist/lib/types/component/diagram/ElkLayoutEngine.d.ts +14 -1
  131. package/dist/lib/types/component/diagram/index.d.ts +2 -2
  132. package/dist/lib/types/component/display/Canvas.d.ts +8 -2
  133. package/dist/lib/types/component/display/Glyph.d.ts +2 -1
  134. package/dist/lib/types/component/display/Header.d.ts +1 -1
  135. package/dist/lib/types/component/display/IconLabel.d.ts +1 -1
  136. package/dist/lib/types/component/display/IconText.d.ts +1 -1
  137. package/dist/lib/types/component/display/Image.d.ts +1 -1
  138. package/dist/lib/types/component/display/Video.d.ts +1 -1
  139. package/dist/lib/types/component/display/WebGLCanvas.d.ts +8 -2
  140. package/dist/lib/types/component/editor/CodeEditor.d.ts +4 -3
  141. package/dist/lib/types/component/input/AbstractPickerField.d.ts +1 -1
  142. package/dist/lib/types/component/input/AutoCompleteDropdown.d.ts +1 -1
  143. package/dist/lib/types/component/input/Link.d.ts +1 -1
  144. package/dist/lib/types/component/input/NumberSpinner.d.ts +1 -1
  145. package/dist/lib/types/component/input/PasswordField.d.ts +1 -1
  146. package/dist/lib/types/component/input/SpinButton.d.ts +1 -1
  147. package/dist/lib/types/component/input/Text.d.ts +3 -1
  148. package/dist/lib/types/component/input/TextArea.d.ts +1 -1
  149. package/dist/lib/types/component/input/TextField.d.ts +3 -1
  150. package/dist/lib/types/component/input/UsernameField.d.ts +1 -1
  151. package/dist/lib/types/component/list/AbstractMarkerList.d.ts +9 -1
  152. package/dist/lib/types/component/list/BulletedList.d.ts +1 -0
  153. package/dist/lib/types/component/list/ListItem.d.ts +10 -4
  154. package/dist/lib/types/component/list/NumberedList.d.ts +1 -0
  155. package/dist/lib/types/component/menubar/MenuBarButton.d.ts +1 -1
  156. package/dist/lib/types/component/menubar/ToolBar.d.ts +1 -1
  157. package/dist/lib/types/component/menubar/ToolBarSeparator.d.ts +1 -1
  158. package/dist/lib/types/component/shared/VirtualRowView.d.ts +13 -1
  159. package/dist/lib/types/component/shared/selectionsEqual.d.ts +1 -0
  160. package/dist/lib/types/component/table/Body.d.ts +15 -2
  161. package/dist/lib/types/component/table/CellGeometry.d.ts +6 -0
  162. package/dist/lib/types/component/table/Column.d.ts +6 -0
  163. package/dist/lib/types/component/table/ColumnConfig.d.ts +4 -0
  164. package/dist/lib/types/component/table/Header.d.ts +25 -2
  165. package/dist/lib/types/component/table/Row.d.ts +13 -2
  166. package/dist/lib/types/component/table/Table.d.ts +45 -4
  167. package/dist/lib/types/component/table/TableExporter.d.ts +1 -1
  168. package/dist/lib/types/component/table/TablePanel.d.ts +2 -1
  169. package/dist/lib/types/component/table/cell/Cell.d.ts +1 -1
  170. package/dist/lib/types/component/table/cell/Header.d.ts +4 -0
  171. package/dist/lib/types/component/table/index.d.ts +2 -2
  172. package/dist/lib/types/component/tree/Tree.d.ts +2 -0
  173. package/dist/lib/types/core/Aria.d.ts +1 -3
  174. package/dist/lib/types/core/Body.d.ts +9 -2
  175. package/dist/lib/types/core/ClassStyleRules.d.ts +17 -0
  176. package/dist/lib/types/core/Component.d.ts +16 -2
  177. package/dist/lib/types/core/ComponentDefaults.d.ts +1 -0
  178. package/dist/lib/types/core/DOM.d.ts +15 -2
  179. package/dist/lib/types/core/DragChain.d.ts +3 -0
  180. package/dist/lib/types/core/ElementAttributes.d.ts +15 -0
  181. package/dist/lib/types/core/Favicon.d.ts +7 -0
  182. package/dist/lib/types/core/FirstLayoutGate.d.ts +5 -0
  183. package/dist/lib/types/core/PendingTransitions.d.ts +4 -0
  184. package/dist/lib/types/core/StyleTarget.d.ts +1 -0
  185. package/dist/lib/types/core/Theme.d.ts +1 -0
  186. package/dist/lib/types/core/Util.d.ts +3 -0
  187. package/dist/lib/types/core/index.d.ts +3 -0
  188. package/dist/lib/types/layout/Accordion.d.ts +0 -1
  189. package/dist/lib/types/layout/Border.d.ts +1 -0
  190. package/dist/lib/types/layout/FlowLayout.d.ts +4 -0
  191. package/dist/lib/types/layout/HFlow.d.ts +3 -0
  192. package/dist/lib/types/layout/Tab.d.ts +4 -1
  193. package/dist/lib/types/layout/Table.d.ts +1 -0
  194. package/dist/lib/types/layout/VFlow.d.ts +1 -0
  195. package/dist/lib/types/overlay/AbstractWindow.d.ts +2 -1
  196. package/dist/lib/types/overlay/Dock.d.ts +1 -0
  197. package/dist/lib/types/overlay/DropZoneOverlay.d.ts +1 -0
  198. package/dist/lib/types/overlay/Popover.d.ts +1 -1
  199. package/dist/lib/types/router/RoutePattern.d.ts +7 -0
  200. package/dist/lib/types/router/Router.d.ts +13 -2
  201. package/dist/lib/types/router/index.d.ts +1 -1
  202. package/dist/lib/validation.es.js +1 -1
  203. package/llms.txt +2 -1
  204. package/package.json +5 -9
  205. package/dist/lib/Border-BgaZkc1R.js +0 -2
  206. package/dist/lib/Border-BgaZkc1R.js.map +0 -1
  207. package/dist/lib/BoxLayout-DrKGfsup.js +0 -2
  208. package/dist/lib/BoxLayout-DrKGfsup.js.map +0 -1
  209. package/dist/lib/Button-U1rsP4v8.js +0 -2
  210. package/dist/lib/ComboBox-B9EDPu6T.js +0 -2
  211. package/dist/lib/ComboBox-B9EDPu6T.js.map +0 -1
  212. package/dist/lib/Component-DXf5a3g0.js +0 -2
  213. package/dist/lib/Component-DXf5a3g0.js.map +0 -1
  214. package/dist/lib/Container-D5H8VxJK.js +0 -2
  215. package/dist/lib/DOM-CGn7xyTw.js +0 -2
  216. package/dist/lib/DOM-CGn7xyTw.js.map +0 -1
  217. package/dist/lib/DragManager-CI4mZQFy.js +0 -2
  218. package/dist/lib/DragManager-CI4mZQFy.js.map +0 -1
  219. package/dist/lib/Glyph-KEf4nIv2.js +0 -2
  220. package/dist/lib/Glyph-KEf4nIv2.js.map +0 -1
  221. package/dist/lib/GridConstraints-DkLueyrf.js +0 -2
  222. package/dist/lib/GridConstraints-DkLueyrf.js.map +0 -1
  223. package/dist/lib/HBox-Ce0GTCJP.js +0 -2
  224. package/dist/lib/HBox-Ce0GTCJP.js.map +0 -1
  225. package/dist/lib/Header-BQIVpBte.js +0 -2
  226. package/dist/lib/Header-BQIVpBte.js.map +0 -1
  227. package/dist/lib/IconText-Bo4Qcnot.js +0 -2
  228. package/dist/lib/IconText-Bo4Qcnot.js.map +0 -1
  229. package/dist/lib/LayoutSizes-DU3qSq0w.js +0 -2
  230. package/dist/lib/LayoutSizes-DU3qSq0w.js.map +0 -1
  231. package/dist/lib/List-DtTVTyWW.js +0 -2
  232. package/dist/lib/List-DtTVTyWW.js.map +0 -1
  233. package/dist/lib/Menu-Dz4L7EKJ.js +0 -2
  234. package/dist/lib/Menu-Dz4L7EKJ.js.map +0 -1
  235. package/dist/lib/Position-A39T7-_1.js +0 -2
  236. package/dist/lib/Position-A39T7-_1.js.map +0 -1
  237. package/dist/lib/Scrollbar-BhtOjqkG.js +0 -2
  238. package/dist/lib/Scrollbar-BhtOjqkG.js.map +0 -1
  239. package/dist/lib/Slider-CdXm7E64.js +0 -2
  240. package/dist/lib/Slider-CdXm7E64.js.map +0 -1
  241. package/dist/lib/TabButton-CThevdY_.js +0 -2
  242. package/dist/lib/TabButton-CThevdY_.js.map +0 -1
  243. package/dist/lib/Text-gz6qjFfP.js +0 -2
  244. package/dist/lib/Text-gz6qjFfP.js.map +0 -1
  245. package/dist/lib/Tooltip-tkXDk5Bo.js +0 -3
  246. package/dist/lib/VBox-EIqw85Rh.js +0 -2
  247. package/dist/lib/VBox-EIqw85Rh.js.map +0 -1
  248. package/dist/lib/VirtualRowView-BxpHQ_u8.js +0 -2
  249. package/dist/lib/VirtualRowView-BxpHQ_u8.js.map +0 -1
  250. package/dist/lib/VirtualScroller-DwEEJE1_.js +0 -2
  251. package/dist/lib/VirtualScroller-DwEEJE1_.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{i as e,l as t,n}from"./Position-A39T7-_1.js";import{d as r,f as i,t as a,u as o,y as s}from"./Component-DXf5a3g0.js";import{t as c}from"./Glyph-KEf4nIv2.js";import{t as l}from"./Tooltip-tkXDk5Bo.js";import{t as u}from"./Fit-DjRsiwlg.js";import{t as d}from"./Text-gz6qjFfP.js";import{t as f}from"./HBox-Ce0GTCJP.js";import{n as p}from"./VBox-EIqw85Rh.js";var m=new n(5,10,5,10),h=new n(2,6,2,6),g=new n(2,2,2,2),_=new n(4,4,4,4),v=`var(--ts-ui-button-bg, transparent)`,y={tag:`button`,cursor:`pointer`,foregroundColor:`var(--ts-ui-text-color, black)`,border:`2px ridge var(--ts-ui-button-border, rgb(200, 200, 200))`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-button-shadow, 1px 2px 5px 0 rgba(0, 0, 0, 0.2))`,backgroundImage:`var(--ts-ui-button-bg, linear-gradient(rgb(241, 241, 241), rgb(200, 200, 200)))`,insets:m,anchor:o.CENTER,fill:r.NONE,pressedForegroundColor:`var(--ts-ui-button-pressed-fg, rgb(150, 150, 150))`,pressedBackgroundColor:`var(--ts-ui-button-pressed-bg, rgb(200, 200, 200))`,pressedBackgroundImage:`var(--ts-ui-button-pressed-bg, none)`,pressedShadow:`var(--ts-ui-button-pressed-shadow, 1px 2px 5px 0 rgba(0, 0, 0, 0.2) inset)`,hoverBackgroundColor:`var(--ts-ui-button-hover-bg, rgb(252, 252, 252))`,hoverBackgroundImage:`var(--ts-ui-button-hover-bg, none)`,hoverShadow:`var(--ts-ui-button-hover-shadow, 1px 3px 6px 0 rgba(0, 0, 0, 0.25))`},b=i(class Button extends a{_text;_content;_titleColumn;_description=null;_tooltipSuppressed=!1;_outerColumn=null;_innerRow=null;_glyph=null;_glyphSyncedSize=null;_glyphSizePinned=!1;_onThemeChange=()=>{this._rebuildContentRow(),this.recomputePreferredSize()};get pressedStyleRule(){return this._pressedStyleRule??=this.createStyleRule(`:active`)}_pressedBorder=null;get hoverStyleRule(){return this._hoverStyleRule??=this.createStyleRule(`:hover:not(:active)`)}_hoverBorder=null;_enabledCursor=`pointer`;constructor(e,t,r){let i;typeof e==`string`?i=e:e!==void 0&&(t=e),super(t,{...y,...r??{}}),this.setLayoutManager(new u),this._text=new d,this._titleColumn=new a,this._titleColumn.setLayoutManager(new p({spacing:0})),this._titleColumn.setInsets(new n(0,0,0,0)),this._titleColumn.setPointerEvents(`none`),this._titleColumn.addComponent(this._text),this._content=new a,this._content.setLayoutManager(new f({spacing:2})),this._content.setInsets(new n(0,0,0,0)),this._content.setPointerEvents(`none`),this._content.addComponent(this._titleColumn),this._text.setPointerEvents(`none`),this._text.setTextAlign(`center`),this._text.setFontWeight(`bold`),this._text.setFontSize(`--ts-ui-button-font-size`),this.addComponent(this._content,{fill:this.getFill(),anchor:this.getAnchor()});let o=this._options.text??this._defaultOptions.text??i;o!==void 0&&this.setText(o);let s=this._options.glyph??this._defaultOptions.glyph;s!==void 0&&this.setGlyph(s);let c=this._options.description??this._defaultOptions.description;c!==void 0&&this.setDescription(c),(this._flat||this._compact)&&this._resolveInsets(),this.recomputePreferredSize(),this.subscribeTheme(this._onThemeChange),Object.getPrototypeOf(this)===Button.prototype&&this.applyListeners(t?.listeners)}getAnchor(){return this._options.anchor??this._defaultOptions.anchor}getFill(){return this._options.fill??this._defaultOptions.fill}applyOptions(e){let t=this.getLayoutManager();super.applyOptions(e),e.layoutManager===void 0&&this.getLayoutManager()!==t&&this.setLayoutManager(t),e.descriptionUnderGlyph!==void 0&&(this._options.descriptionUnderGlyph=e.descriptionUnderGlyph),e.showDescription!==void 0&&(this._options.showDescription=e.showDescription),e.showText!==void 0&&(this._options.showText=e.showText);let n=this._text!==void 0;return e.glyphColor!==void 0&&(n?this.setGlyphColor(e.glyphColor):this._options.glyphColor=e.glyphColor),e.descriptionColor!==void 0&&(n?this.setDescriptionColor(e.descriptionColor):this._options.descriptionColor=e.descriptionColor),e.text!==void 0&&(n?this.setText(e.text):this._options.text=e.text),e.description!==void 0&&(n?this.setDescription(e.description):this._options.description=e.description),e.glyph!==void 0&&(n?this.setGlyph(e.glyph):this._options.glyph=e.glyph),e.enabled!==void 0&&this.setEnabled(e.enabled),e.chromeless!==void 0&&(this._options.chromeless=e.chromeless),e.flat!==void 0&&(this._options.flat=e.flat),e.compact!==void 0&&this.setCompact(e.compact),e.anchor!==void 0&&(this._options.anchor=e.anchor),e.fill!==void 0&&(this._options.fill=e.fill),this}applyChromeOptions(e){if((e.chromeless??this.isChromeless())===!0){this.clearBorder(),this._options.borderRadius=void 0,this._options.shadow=void 0,this._options.backgroundImage=void 0,this.getBackgroundColor()===null&&(this._options.backgroundColor=`transparent`);return}super.applyChromeOptions(e),(this._options.flat??e.flat)!==!0&&e.backgroundColor===void 0&&this.setBackgroundColor(v),this.setPressedForegroundColor(e.pressedForegroundColor??this.getPressedForegroundColor()),this.setPressedBackgroundColor(e.pressedBackgroundColor??this.getPressedBackgroundColor()),this.setPressedBackgroundImage(e.pressedBackgroundImage??this.getPressedBackgroundImage()),this.setPressedShadow(e.pressedShadow??this.getPressedShadow()),e.pressedBorder!==void 0&&this.setPressedBorder(e.pressedBorder),e.pressedBorderRadius!==void 0&&this.setPressedBorderRadius(e.pressedBorderRadius),e.hoverForegroundColor!==void 0&&this.setHoverForegroundColor(e.hoverForegroundColor),this.setHoverBackgroundColor(e.hoverBackgroundColor??this.getHoverBackgroundColor()),this.setHoverBackgroundImage(e.hoverBackgroundImage??this.getHoverBackgroundImage()),this.setHoverShadow(e.hoverShadow??this.getHoverShadow()),e.hoverBorder!==void 0&&this.setHoverBorder(e.hoverBorder),e.hoverBorderRadius!==void 0&&this.setHoverBorderRadius(e.hoverBorderRadius),(this._options.flat??e.flat)===!0&&(this._flat=!0,this._applyFlatChrome())}setText(e){return this._options.text=e,this._text.setText(this._isShowText()?e:``),this.recomputePreferredSize(),this._rebuildTooltip(),this._reflectAccessibleName(),this}getText(){return this._options.text??``}setWritingMode(e){let t=this._contentOrientation();return super.setWritingMode(e),this._text&&(this._text.setWritingMode(e),this._description?.setWritingMode(e),this._contentOrientation()!==t&&(this._glyph||this._description)&&this._rebuildContentRow(),this.recomputePreferredSize()),this}setTextAlign(e){if(this._text){this._text.setTextAlign(e);let t=this.getLayoutConstraints(this._content);t&&(t.anchor=this._anchorForTextAlign(e),this.scheduleLayout())}return this}_anchorForTextAlign(e){let t=e===`left`||e===`start`,n=e===`right`||e===`end`,r=this._contentOrientation();return r===`cw`?t?o.NORTH:n?o.SOUTH:o.CENTER:r===`ccw`?t?o.SOUTH:n?o.NORTH:o.CENTER:t?o.WEST:n?o.EAST:o.CENTER}clearWritingMode(){let e=this._contentOrientation();return super.clearWritingMode(),this._text&&(this._text.clearWritingMode(),this._description?.clearWritingMode(),this._contentOrientation()!==e&&(this._glyph||this._description)&&this._rebuildContentRow(),this.recomputePreferredSize()),this}setDescription(e){return this._description||(this._description=new d,this._description.setPointerEvents(`none`),this._description.setTextAlign(`center`),this._description.setFontSize(`--ts-ui-button-description-font-size`),this._description.setFontWeight(`var(--ts-ui-button-description-weight, normal)`),this._description.setForegroundColor(this._options.descriptionColor??`var(--ts-ui-button-description-fg, rgb(110, 110, 110))`)),this._description.setText(e),this._rebuildContentRow(),this._rebuildTooltip(),this.recomputePreferredSize(),this}getDescription(){return this._description}clearDescription(){return this._description=null,this._rebuildContentRow(),this._rebuildTooltip(),this.recomputePreferredSize(),this}_rebuildTooltip(){if(this._tooltipSuppressed){l.detach(this);return}let e=this._options.text??``,t=this._description?.getText().valueOf()??``,n;n=e&&t?`${e}\n\n${t}`:e||t,n?l.attach(this,n):l.detach(this)}setTooltipSuppressed(e){return e===this._tooltipSuppressed?this:(this._tooltipSuppressed=e,this._rebuildTooltip(),this)}_reflectAccessibleName(){let e=this._options.text??``;!this._isShowText()&&e!==``?this.getAria().setLabel(e):this.getAria().clearLabel()}_isDescriptionUnderGlyph(){return this._options.descriptionUnderGlyph??!0}_isShowDescription(){return this._options.showDescription??!0}_isShowText(){return this._options.showText??!0}_contentOrientation(){let e=this.getWritingMode();return e===`sideways-rl`?`cw`:e===`sideways-lr`?`ccw`:`horizontal`}_orientBox(e,t,n){e.setLayoutManager(t===`v`?new p({spacing:n}):new f({spacing:n}))}_addContentChildren(e,t,n){let r=n?[...t].reverse():t;for(let t of r)e.addComponent(t)}_rebuildContentRow(){this._content.removeAllComponents(),this._titleColumn.removeAllComponents(),this._innerRow?.removeAllComponents(),this._outerColumn?.removeAllComponents();let e=this._description!==null&&this._isShowDescription(),r=this._isShowText(),i=this._contentOrientation(),o=i!==`horizontal`,s=o?`v`:`h`,c=o?`h`:`v`,l=i===`ccw`,u=i===`cw`;if(e&&this._glyph&&this._isDescriptionUnderGlyph())this._innerRow||(this._innerRow=new a,this._innerRow.setInsets(new n(0,0,0,0)),this._innerRow.setPointerEvents(`none`)),this._outerColumn||(this._outerColumn=new a,this._outerColumn.setInsets(new n(0,0,0,0)),this._outerColumn.setPointerEvents(`none`)),this._orientBox(this._content,s,2),this._orientBox(this._innerRow,s,2),this._orientBox(this._outerColumn,c,0),this._addContentChildren(this._innerRow,r?[this._glyph,this._text]:[this._glyph],l),this._addContentChildren(this._outerColumn,[this._innerRow,this._description],u),this._content.addComponent(this._outerColumn);else if(e){this._orientBox(this._content,s,2),this._orientBox(this._titleColumn,c,0),this._addContentChildren(this._titleColumn,r?[this._text,this._description]:[this._description],u);let e=this._glyph?[this._glyph,this._titleColumn]:[this._titleColumn];this._addContentChildren(this._content,e,l)}else{let e=this._text.getText().valueOf()!==``;this._orientBox(this._content,s,this._glyph&&!e?0:2);let t=this._glyph?[this._glyph,this._text]:[this._text];this._addContentChildren(this._content,t,l)}let d=!o&&!e&&this._text.getText().valueOf()!==``?t.opticalCenterOffset():0;this._content.setInsets(new n(d,0,0,0)),this._reflectAccessibleName(),this._afterRebuildContentRow()}_afterRebuildContentRow(){}_syncGlyphSize(){let e=this._glyph;if(!e||this._glyphSizePinned)return;let t=this._text.getLineHeight();if(t===null)return;let n=Math.round(t),r=e.getPreferredSize(),i=this._glyphSyncedSize;r&&i!==null&&(r.width!==i||r.height!==i)||(e.setPreferredSize({width:n,height:n}),this._glyphSyncedSize=n)}setGlyph(e){let t=new c(e);return t.setPointerEvents(`none`),this._glyph=t,this._glyphSyncedSize=null,this._options.glyphColor!==void 0&&t.setForegroundColor(this._options.glyphColor),this._rebuildContentRow(),this.recomputePreferredSize(),this}clearGlyph(){return this._glyph=null,this._glyphSyncedSize=null,this._rebuildContentRow(),this.recomputePreferredSize(),this}getGlyph(){return this._glyph}setGlyphColor(e){return this._options.glyphColor=e,this._glyph?.setForegroundColor(e),this}setDescriptionColor(e){return this._options.descriptionColor=e,this._description?.setForegroundColor(e),this}pinGlyphSize(e){return this._glyphSizePinned=!0,this._glyph?.setPreferredSize({width:e,height:e}),this}getBaseline(){return this.wrapInnerBaseline(this._text.getBaseline())}on(e,t){return s.addListener(this,`click`,t),this}off(e,t){return s.removeListener(this,`click`,t),this}click(){return s.fireEvent(this,`click`),this}addPointerDownListener(e){return s.addListener(this,`pointerdown`,e),this}isChromeless(){return this._options.chromeless??this._defaultOptions.chromeless??!1}setChromeless(e){return this.isChromeless()===e||(e?(this._clearChrome(),this._options.chromeless=!0,this._flat=!1,this._options.flat=!1):(this._options.chromeless=!1,this._restoreChrome())),this}_clearChrome(){this.clearBorder(),this.clearBorderRadius(),this.clearShadow(),this.clearBackgroundImage(),this._pressedStyleRule!==void 0&&(this.clearPressedBackgroundColor(),this.clearPressedBackgroundImage(),this.clearPressedForegroundColor(),this.clearPressedShadow(),this.clearPressedBorderRadius(),this.clearPressedBorder()),this._hoverStyleRule!==void 0&&(this.clearHoverBackgroundColor(),this.clearHoverBackgroundImage(),this.clearHoverForegroundColor(),this.clearHoverShadow(),this.clearHoverBorderRadius(),this.clearHoverBorder())}_restoreChrome(){let e=this._defaultOptions;e.backgroundColor===void 0&&this._options.backgroundColor===`transparent`&&this.setBackgroundColor(v),e.border!==void 0&&this.setBorder(e.border),e.borderRadius!==void 0&&this.setBorderRadius(e.borderRadius),e.shadow!==void 0&&this.setShadow(e.shadow),e.backgroundImage!==void 0&&this.setBackgroundImage(e.backgroundImage),e.pressedForegroundColor!==void 0&&this.setPressedForegroundColor(e.pressedForegroundColor),e.pressedBackgroundColor!==void 0&&this.setPressedBackgroundColor(e.pressedBackgroundColor),e.pressedBackgroundImage!==void 0&&this.setPressedBackgroundImage(e.pressedBackgroundImage),e.pressedShadow!==void 0&&this.setPressedShadow(e.pressedShadow),e.pressedBorder===void 0?this.clearPressedBorder():this.setPressedBorder(e.pressedBorder),e.pressedBorderRadius!==void 0&&this.setPressedBorderRadius(e.pressedBorderRadius),e.hoverForegroundColor!==void 0&&this.setHoverForegroundColor(e.hoverForegroundColor),e.hoverBackgroundColor!==void 0&&this.setHoverBackgroundColor(e.hoverBackgroundColor),e.hoverBackgroundImage!==void 0&&this.setHoverBackgroundImage(e.hoverBackgroundImage),e.hoverShadow!==void 0&&this.setHoverShadow(e.hoverShadow),e.hoverBorder===void 0?this.clearHoverBorder():this.setHoverBorder(e.hoverBorder),e.hoverBorderRadius!==void 0&&this.setHoverBorderRadius(e.hoverBorderRadius)}isFlat(){return this._flat??!1}setFlat(e){return e&&this.isChromeless()?(console.warn(`Button #`+this.getId()+`: setFlat(true) ignored — flat and chromeless are mutually exclusive, chromeless wins.`),this):((this._flat??!1)===e||(e?(this._flat=!0,this._options.flat=!0,this._applyFlatChrome()):(this._flat=!1,this._options.flat=!1,this._restoreChrome(),this._resolveInsets())),this)}isCompact(){return this._compact??!1}setCompact(e){return(this._compact??!1)===e?this:(this._compact=e,this._options.compact=e,this._resolveInsets(),this)}_applyFlatChrome(){this.setBorder(`1px solid transparent`),this.clearBorderRadius(),this.clearShadow(),this.clearBackgroundImage();let e=this.getBackgroundColor();(e===void 0||e===v)&&this.setBackgroundColor(`transparent`),this.clearPressedBackgroundImage(),this.clearHoverBackgroundImage(),this.clearHoverShadow(),this.setHoverBackgroundColor(`var(--ts-ui-button-flat-hover-bg, rgba(0, 0, 0, 0.06))`),this.setHoverBorder(`var(--ts-ui-button-flat-hover-border, 1px solid rgb(200, 200, 200))`),this.setPressedBackgroundColor(`var(--ts-ui-button-flat-pressed-bg, rgba(0, 0, 0, 0.10))`),this.setPressedShadow(`var(--ts-ui-button-flat-pressed-shadow, inset 1px 1px 3px rgba(0, 0, 0, 0.25))`),this.setPressedBorder(`var(--ts-ui-button-flat-pressed-border, 1px solid rgb(180, 180, 180))`),this._resolveInsets()}_resolveInsets(){if(this._text===void 0)return;let e=this._glyph!==null&&this._text.getText().valueOf()===``,t;t=this._compact&&e?g:this._compact?h:this._flat&&e?_:m,this.setInsets(t)}setInsets(e){return super.setInsets(e),this.recomputePreferredSize(),this}setPreferredSize(e){return this._consumerSetPreferredSize=!0,super.setPreferredSize(e),this}getPreferredSize(){return this._consumerSetPreferredSize||this._defaultOptions.preferredSize?super.getPreferredSize():this.computePreferredSize()}recomputePreferredSize(){if(this._syncGlyphSize(),this._consumerSetPreferredSize||this._defaultOptions.preferredSize)return;let e=this.computePreferredSize();super.setPreferredSize({width:e.width,height:e.height})}computePreferredSize(){let e=this._content?.getPreferredSize()??{width:0,height:0},t=this.getPerimeterSize();return{width:e.width+t.left+t.right,height:e.height+t.top+t.bottom}}getPressedBackgroundColor(){return this._options.pressedBackgroundColor??this._defaultOptions.pressedBackgroundColor??null}setPressedBackgroundColor(e){return this._options.pressedBackgroundColor=e,this.pressedStyleRule.set(`backgroundColor`,e),this}clearPressedBackgroundColor(){return this._options.pressedBackgroundColor=void 0,this.pressedStyleRule.set(`backgroundColor`,null),this}getPressedBackgroundImage(){return this._options.pressedBackgroundImage??this._defaultOptions.pressedBackgroundImage??null}setPressedBackgroundImage(e){return this._options.pressedBackgroundImage=e,this.pressedStyleRule.set(`backgroundImage`,e),this}clearPressedBackgroundImage(){return this._options.pressedBackgroundImage=void 0,this.pressedStyleRule.set(`backgroundImage`,null),this}getPressedForegroundColor(){return this._options.pressedForegroundColor??this._defaultOptions.pressedForegroundColor??null}setPressedForegroundColor(e){return this._options.pressedForegroundColor=e,this.pressedStyleRule.set(`color`,e),this}clearPressedForegroundColor(){return this._options.pressedForegroundColor=void 0,this.pressedStyleRule.set(`color`,null),this}getPressedBorder(){return this._pressedBorder}setPressedBorder(t){return this._pressedBorder=typeof t==`string`?{border:t}:t??{},this.pressedStyleRule.setMany(e(this._pressedBorder)),this}clearPressedBorder(){return this._pressedBorder=null,this.pressedStyleRule.setMany({borderTop:null,borderRight:null,borderBottom:null,borderLeft:null}),this}getPressedBorderRadius(){return this._options.pressedBorderRadius??null}setPressedBorderRadius(e){return this._options.pressedBorderRadius=e,this.pressedStyleRule.set(`borderRadius`,e),this}clearPressedBorderRadius(){return this._options.pressedBorderRadius=void 0,this.pressedStyleRule.set(`borderRadius`,null),this}getPressedShadow(){return this._options.pressedShadow??this._defaultOptions.pressedShadow??null}setPressedShadow(e){return this._options.pressedShadow=e,this.pressedStyleRule.set(`boxShadow`,e),this}clearPressedShadow(){return this._options.pressedShadow=void 0,this.pressedStyleRule.set(`boxShadow`,null),this}getHoverBackgroundColor(){return this._options.hoverBackgroundColor??this._defaultOptions.hoverBackgroundColor??null}setHoverBackgroundColor(e){return this._options.hoverBackgroundColor=e,this.hoverStyleRule.set(`backgroundColor`,e),this}clearHoverBackgroundColor(){return this._options.hoverBackgroundColor=void 0,this.hoverStyleRule.set(`backgroundColor`,null),this}getHoverBackgroundImage(){return this._options.hoverBackgroundImage??this._defaultOptions.hoverBackgroundImage??null}setHoverBackgroundImage(e){return this._options.hoverBackgroundImage=e,this.hoverStyleRule.set(`backgroundImage`,e),this}clearHoverBackgroundImage(){return this._options.hoverBackgroundImage=void 0,this.hoverStyleRule.set(`backgroundImage`,null),this}getHoverForegroundColor(){return this._options.hoverForegroundColor??null}setHoverForegroundColor(e){return this._options.hoverForegroundColor=e,this.hoverStyleRule.set(`color`,e),this}clearHoverForegroundColor(){return this._options.hoverForegroundColor=void 0,this.hoverStyleRule.set(`color`,null),this}getHoverBorder(){return this._hoverBorder}setHoverBorder(t){return this._hoverBorder=typeof t==`string`?{border:t}:t??{},this.hoverStyleRule.setMany(e(this._hoverBorder)),this}clearHoverBorder(){return this._hoverBorder=null,this.hoverStyleRule.setMany({borderTop:null,borderRight:null,borderBottom:null,borderLeft:null}),this}getHoverBorderRadius(){return this._options.hoverBorderRadius??null}setHoverBorderRadius(e){return this._options.hoverBorderRadius=e,this.hoverStyleRule.set(`borderRadius`,e),this}clearHoverBorderRadius(){return this._options.hoverBorderRadius=void 0,this.hoverStyleRule.set(`borderRadius`,null),this}getHoverShadow(){return this._options.hoverShadow??this._defaultOptions.hoverShadow??null}setHoverShadow(e){return this._options.hoverShadow=e,this.hoverStyleRule.set(`boxShadow`,e),this}clearHoverShadow(){return this._options.hoverShadow=void 0,this.hoverStyleRule.set(`boxShadow`,null),this}setEnabled(e){return(this._options.enabled??!0)===e?this:(this._options.enabled=e,e?(this.setDisabledAttribute(!1),this.clearOpacity(),this.setCursor(this._enabledCursor)):(this._enabledCursor=this.getCursor()??`pointer`,this.setDisabledAttribute(!0),this.setOpacity(.5),this.setCursor(`not-allowed`)),this)}isEnabled(){return this._options.enabled??!0}setDescriptionUnderGlyph(e){return this._options.descriptionUnderGlyph=e,this._rebuildContentRow(),this.recomputePreferredSize(),this}isDescriptionUnderGlyph(){return this._isDescriptionUnderGlyph()}setShowDescription(e){return this._options.showDescription=e,this._rebuildContentRow(),this.recomputePreferredSize(),this}isShowDescription(){return this._isShowDescription()}setShowText(e){return this._options.showText=e,this._text.setText(e?this._options.text??``:``),this._rebuildContentRow(),this._resolveInsets(),this.recomputePreferredSize(),this}isShowText(){return this._isShowText()}});export{b as t};
2
- //# sourceMappingURL=Button-U1rsP4v8.js.map
@@ -1,2 +0,0 @@
1
- import{t as e}from"./DOM-CGn7xyTw.js";import{l as t,n}from"./Position-A39T7-_1.js";import{_ as r,f as i,h as a,t as o,y as s}from"./Component-DXf5a3g0.js";import{t as c}from"./Glyph-KEf4nIv2.js";import{t as l}from"./Panel-DzWdYwq1.js";import{t as u}from"./AnimatedDropdown-CZQEqQi-.js";import{t as d}from"./Fit-DjRsiwlg.js";import{t as f}from"./Text-gz6qjFfP.js";import{t as p}from"./AbstractInput-BxOtFrER.js";import{t as m}from"./AbstractBooleanInput-BGesvIZy.js";import{t as h}from"./HBox-Ce0GTCJP.js";import{t as g}from"./LayoutConstraints-DkctJZXB.js";import{n as _}from"./VBox-EIqw85Rh.js";import{t as v}from"./Button-U1rsP4v8.js";import{t as y}from"./Grid-DdL9TVeJ.js";import{chevron_left as b}from"./glyphs/solid/chevron_left.es.js";import{chevron_right as x}from"./glyphs/solid/chevron_right.es.js";import{clock as S}from"./glyphs/solid/clock.es.js";import{check as C}from"./glyphs/solid/check.es.js";import{r as w,t as T}from"./List-DtTVTyWW.js";import{chevron_down as ee}from"./glyphs/solid/chevron_down.es.js";var E=`var(--ts-ui-link-color, rgb(21, 101, 192))`;new r({scope:`selector`,name:`.Link`,styles:{textDecoration:`underline`}}),new r({scope:`selector`,name:`.Link:focus-visible`,styles:{outline:`2px solid var(--ts-ui-indicator-focus, rgb(30, 100, 200))`,outlineOffset:`1px`}});var D={tag:`a`,foregroundColor:E,cursor:`pointer`,interactive:!0},Link=class extends f{constructor(e,t){super(e,t,D),s.addListener(this,`keydown`,this.handleKeyDown),this.applyListeners(t?.listeners)}applyOptions(e){return super.applyOptions(e),this.setInteractive(e.interactive??this.isInteractive()),this}isInteractive(){return this._options.interactive??this._defaultOptions.interactive??!0}setInteractive(e){return this._options.interactive=e,e?this.getAria().setRole(`link`).setTabIndex(0):this.getAria().clearRole().setTabIndex(null),this}on(e,t){return s.addListener(this,`click`,t),this}off(e,t){return s.removeListener(this,`click`,t),this}click(){return s.fireEvent(this,`click`),this}destructor(){s.removeListener(this,`keydown`,this.handleKeyDown),super.destructor()}handleKeyDown(e){this.isInteractive()&&e.key===`Enter`&&(e.preventDefault(),this.click())}},O=i(Link);new r({scope:`selector`,name:`.TextField:focus, .TextArea:focus, .PasswordField:focus`,styles:{outline:`none`,boxShadow:`inset 0 0 0 2px var(--ts-ui-indicator-focus, rgb(30, 100, 200))`}});var k={tag:`input`,backgroundColor:`var(--ts-ui-input-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`},TextInput=class extends p{constructor(e,t){super(e,{...k,...t??{}}),this.setElementCSSRules({fontFamily:`var(--ts-ui-font-family, sans-serif)`,fontSize:`var(--ts-ui-font-size, 14px)`,lineHeight:`calc(1em + var(--ts-ui-line-padding, 2px))`}),s.addListener(this,`input`,this.onInput)}onInput(){let t=this.getElement();this.setText(t?e.source.getValue(t):``),this.notifyChange(this.getValue())}applyOptions(e){return super.applyOptions(e),e.text!==void 0&&this.setText(e.text),e.textAlign!==void 0&&this.setTextAlign(e.textAlign),e.placeholder!==void 0&&this.setPlaceholder(e.placeholder),e.readOnly!==void 0&&this.setReadOnly(e.readOnly),e.enabled!==void 0&&this.setEnabled(e.enabled),e.maxLength!==void 0&&this.setMaxLength(e.maxLength),e.inputMode!==void 0&&this.setInputMode(e.inputMode),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete),this}on(e,t){return e===`action`?(s.addListener(this,`input`,t),this):e===`keydown`?(s.addListener(this,`keydown`,t),this):super.on(e,t)}off(e,t){return e===`action`?(s.removeListener(this,`input`,t),this):e===`keydown`?(s.removeListener(this,`keydown`,t),this):super.off(e,t)}setType(e){return this._options.type=e,this.setElementAttribute(`type`,e),this}setName(e){return super.setName(e),e==null?this.removeElementAttribute(`name`):this.setElementAttribute(`name`,e),this}clearName(){return this._options.name===void 0?this:(this._options.name=void 0,this.removeElementAttribute(`name`),this)}getInputMode(){return this._options.inputMode??null}setInputMode(e){return this._options.inputMode===e?this:(this._options.inputMode=e,this.setElementAttribute(`inputmode`,e),this)}clearInputMode(){return this._options.inputMode===void 0?this:(this._options.inputMode=void 0,this.removeElementAttribute(`inputmode`),this)}getAutoComplete(){return this._options.autoComplete??null}setAutoComplete(e){return this._options.autoComplete===e?this:(this._options.autoComplete=e,this.setElementAttribute(`autocomplete`,e),this)}clearAutoComplete(){return this._options.autoComplete===void 0?this:(this._options.autoComplete=void 0,this.removeElementAttribute(`autocomplete`),this)}getBaseline(){return this.wrapInnerBaseline(t.measureTextBaseline())}getTextAlign(){return this._options.textAlign??null}setTextAlign(e){return this._options.textAlign=e,this.setElementCSSRule(`textAlign`,e),this}clearTextAlign(){return this.setTextAlign(null)}getText(){return this._options.text??``}setText(t){this._options.text=t||``;let n=this.getElement();return n&&e.sink.setValue(n,this._options.text),this}getValue(){return this.getText()}setValue(e){return this.setText(e)}getPlaceholder(){return this._options.placeholder??null}setPlaceholder(e){return this._options.placeholder=e,this.setElementAttribute(`placeholder`,e),this}clearPlaceholder(){return this._options.placeholder===void 0?this:(this._options.placeholder=void 0,this.removeElementAttribute(`placeholder`),this)}getMaxLength(){return this._options.maxLength??null}setMaxLength(e){return this._options.maxLength=e,this.setElementAttribute(`maxlength`,String(e)),this}clearMaxLength(){return this._options.maxLength===void 0?this:(this._options.maxLength=void 0,this.removeElementAttribute(`maxlength`),this)}select(t,n){let r=this.getElement();if(!r)return this;(!t||t<0)&&(t=0);let i=this._options.text??``;return(!n||n>i.length)&&(n=i.length+1),e.sink.setSelectionRange(r,t,n),this}applyEnabled(e){this.setDisabledAttribute(!e)}applyReadOnly(e){e?this.setElementAttribute(`readonly`,``):this.removeElementAttribute(`readonly`)}getElement(e=!1){return super.getElement(e)}init(t){super.init(t);let n=t||this.getElement();return this._options.type!==void 0&&e.sink.apply(n,{setAttr:{type:this._options.type}}),this._options.name!=null&&e.sink.apply(n,{setAttr:{name:this._options.name}}),this._options.placeholder!==void 0&&e.sink.apply(n,{setAttr:{placeholder:this._options.placeholder}}),this._options.readOnly&&e.sink.apply(n,{setAttr:{readonly:``}}),this._options.maxLength!==void 0&&e.sink.apply(n,{setAttr:{maxlength:String(this._options.maxLength)}}),this._options.inputMode!==void 0&&e.sink.apply(n,{setAttr:{inputmode:this._options.inputMode}}),this._options.autoComplete!==void 0&&e.sink.apply(n,{setAttr:{autocomplete:this._options.autoComplete}}),this}render(){let t=super.render();return e.sink.setValue(t,this._options.text??``),t}},A=i(TextInput),j={cursor:`text`,border:`none`,outline:`none`},PickerInput=class extends A{constructor(){super(void 0,j)}},M=i(PickerInput),PickerButton=class extends v{constructor(){super({chromeless:!0,insets:new n(0,4,0,4)})}},N=i(PickerButton),P={content:`''`,position:`absolute`,inset:`0`,border:`2px solid var(--ts-ui-indicator-focus, rgb(30, 100, 200))`,borderRadius:`inherit`,boxSizing:`border-box`,pointerEvents:`none`,zIndex:`1`};function registerFocusWithinRing(e){new r({scope:`selector`,name:e.split(`,`).map(e=>e.trim()+`:focus-within::after`).join(`, `),styles:P})}registerFocusWithinRing(`.DateField, .TimeField, .DateTimeField`);var F=24,I={cursor:`text`,padding:new n(3,3,3,3),backgroundColor:`var(--ts-ui-input-bg, rgb(255, 255, 255))`,foregroundColor:`var(--ts-ui-text-color, black)`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`},AbstractPickerField=class extends p{_input;_button;_dropdown=null;_value=null;_invalid=!1;_showSeconds=!1;constructor(e){super(e,I),this._input=new M,this._input.setType(`text`),this._input.setInputMode(`none`),this._input.setAutoComplete(`off`),this._input.setPadding(new n(0,3,0,3)),this._button=new N,this.addComponent(this._input),this.addComponent(this._button),this.updateHeight(),this.subscribeTheme(()=>this.updateHeight()),s.addListener(this._input,`input`,()=>this.onInput()),s.addListener(this._input,`blur`,()=>this.onBlur()),s.addListener(this._input,`keydown`,e=>this.onKeyDown(e)),this._button.on(`action`,()=>this.onButtonClick()),this._button.addPointerDownListener(e=>this.onButtonPointerDown(e)),this._options.enabled!==void 0&&this.applyEnabled(this._options.enabled),this._options.readOnly!==void 0&&this.applyReadOnly(this._options.readOnly)}getDefaultBorder(){return I.border}applyOptions(e){return super.applyOptions(e),e.dropdownAnimated!==void 0&&this.setDropdownAnimated(e.dropdownAnimated),this}doLayout(){super.doLayout();let e=this.getWidth(),t=this.getHeight();return this._input.setX(0),this._input.setY(0),this._input.setWidth(Math.max(0,e-F)),this._input.setHeight(t),this._button.setX(e-F),this._button.setY(0),this._button.setWidth(F),this._button.setHeight(t),this._button.doLayout(),this}updateHeight(){let e=t.singleLineBoxHeight(this.getInsets(),this.getPadding(),this.getBorderSize());this.setPreferredSize({width:this.getPreferredWidth(),height:e}),this.setMaxSize({width:2**53-1,height:e}),this.setMinSize({width:0,height:e})}setValue(e){return this._value=e,this._input?.setText(e?this.formatValue(e):``),this}getValue(){return this._value}getBaseline(){return this.wrapInnerBaseline(this._input.getBaseline())}setDropdownAnimated(e){return this._options.dropdownAnimated=e,this._dropdown&&this._dropdown.setAnimated(e),this}isDropdownAnimated(){return this._options.dropdownAnimated??!0}applyEnabled(e){this._input.setEnabled(e)}applyReadOnly(e){this._input.setReadOnly(e)}onButtonClick(){this._dropdown?.isOpen()?this.closeDropdown():(this._input.focus(),this.openDropdown())}onButtonPointerDown(e){e.preventDefault()}onInput(){let e=this._input.getText();if(!e){this._value=null,this.setInvalid(!1),this.notifyChange(null);return}let t=this.parseRaw(e);t===null?this.setInvalid(!0):(this._value=t,this.setInvalid(!1),this.notifyChange(t))}onBlur(){this._invalid&&(this._input.setText(``),this._value=null,this.setInvalid(!1))}setInvalid(e){this._invalid!==e&&(this._invalid=e,e?this.setBorder({border:`1px solid var(--ts-ui-validation-error-border)`}):this.setBorder(this.getDefaultBorder()))}onKeyDown(e){if(this._dropdown&&this._dropdown.isOpen()&&this._dropdown.handleKey(e)){e.preventDefault();return}e.key===`ArrowDown`?(e.preventDefault(),this.openDropdown()):e.key===`Escape`&&this.closeDropdown()}ensureDropdown(){if(!this._dropdown){this._dropdown=this.createDropdown();let e=this._options.dropdownAnimated;e!==void 0&&this._dropdown.setAnimated(e)}return this._dropdown}openDropdown(){let e=this.ensureDropdown();e.isOpen()||(e.setCloseHandler(()=>this.closeDropdown()),e.setAnchorElement(this.getElement(!0)??null),e.showAt(this._input.getElement(!0),this._value))}closeDropdown(){this._dropdown&&this._dropdown.isOpen()&&this._dropdown.hideAnimated()}},L={cursor:`text`,padding:new n(3,3,3,3),backgroundColor:`var(--ts-ui-input-bg, rgb(255, 255, 255))`,foregroundColor:`var(--ts-ui-text-color, black)`},TextField=class extends A{constructor(e){super(e,L),this.updateHeight(),this.subscribeTheme(()=>this.updateHeight()),this.setType(`text`)}updateHeight(){let e=t.singleLineBoxHeight(this.getInsets(),this.getPadding(),this.getBorderSize());this.setPreferredSize({width:200,height:e}),this.setMaxSize({width:2**53-1,height:e}),this.setMinSize({width:0,height:e})}},R=i(TextField);new r({scope:`class`,name:`PickerColumnHeader`,styles:{opacity:`0.7`}}),new r({scope:`class`,name:`PickerCell`,styles:{borderRadius:`3px`}}),new r({scope:`selector`,name:`.PickerCell:hover`,styles:{backgroundColor:`var(--ts-ui-autocomplete-item-hover-bg, rgba(30, 100, 200, 0.08))`}}),new r({scope:`selector`,name:`.PickerCell.disabled`,styles:{pointerEvents:`none`,color:`var(--ts-ui-autocomplete-item-disabled-color, rgb(170, 170, 170))`,backgroundColor:`var(--ts-ui-picker-cell-disabled-bg, transparent)`}});var PickerColumnHeader=class extends f{constructor(e){super(e,{textAlign:`center`,fontSize:12})}},PickerCellList=class extends l{constructor(){super({layoutManager:new _({spacing:0,stretching:!0}),autoScroll:`y`,insets:new n(0,0,0,0)})}getMinSize(){let e=super.getMinSize();return e&&{width:e.width,height:0}}},PickerCell=class extends f{_selected=!1;_disabled=!1;_onClick;constructor(e,t){super(e,{textAlign:`center`,preferredSize:{width:0,height:22}}),this._onClick=t,this.setLineHeight(22),this.setCursor(`pointer`),s.addListener(this,`pointerdown`,this.handlePointerDown),s.addListener(this,`click`,this.handleClick)}handlePointerDown(e){e.preventDefault()}handleClick(){this._disabled||this._onClick()}setSelected(e){return this._selected===e?this:(this._selected=e,e?(this.setBackgroundColor(`var(--ts-ui-autocomplete-item-highlight-bg, rgba(30, 100, 200, 0.18))`),this.setFontWeight(`bold`)):(this.clearBackgroundColor(),this.setFontWeight(`normal`)),this)}isSelected(){return this._selected}setDisabled(t){if(this._disabled===t)return this;this._disabled=t,this.setCursor(t?`default`:`pointer`);let n=this.getElement();return n&&e.sink.apply(n,{toggleClass:{disabled:t}}),this}isDisabled(){return this._disabled}render(){let t=super.render();return this._disabled&&e.sink.apply(t,{addClass:[`disabled`]}),t}},PickerColumn=class extends o{_cellList;constructor(e){if(super(),this.setLayoutManager(new _({spacing:2,stretching:!0})),e!==null){let t=new PickerColumnHeader(e);t.setPreferredSize({width:0,height:18}),this.addComponent(t)}this._cellList=new PickerCellList;let t=new g;t.weight=1,this.addComponent(this._cellList,t)}addCell(e){return this._cellList.addComponent(e),this}clearCells(){return this._cellList.removeAllComponents(),this}getCellList(){return this._cellList}scrollSelectedIntoView(){let n=this._cellList.getElement();if(!n)return this;let r=this._cellList.getComponents(),i=null;for(let e of r)if(e instanceof PickerCell&&e.isSelected()){i=e;break}if(!i)return this;let a=i.getElement();if(!a)return this;let o=e.source.getOffsetSize(a),s=e.source.getScrollMetrics(n),c=o.offsetTop,l=o.offsetHeight,u=s.clientHeight,d=c-(u-l)/2,f=s.scrollHeight-u,p=t.clamp(d,0,f);return e.sink.apply(n,{scrollTop:p}),this}setSelectedValue(e){for(let t of this._cellList.getComponents())t instanceof PickerCell&&t.setSelected(t.getText().valueOf()===e);return this}};c.register(b),c.register(x),new r({scope:`class`,name:`PickerDay`,styles:{borderRadius:`3px`}}),new r({scope:`selector`,name:`.PickerDay:hover`,styles:{backgroundColor:`var(--ts-ui-autocomplete-item-hover-bg, rgba(30, 100, 200, 0.08))`}}),new r({scope:`selector`,name:`.PickerDay.disabled`,styles:{pointerEvents:`none`,color:`var(--ts-ui-autocomplete-item-disabled-color, rgb(170, 170, 170))`,backgroundColor:`var(--ts-ui-picker-cell-disabled-bg, transparent)`}}),new r({scope:`class`,name:`PickerNavButton`,styles:{borderRadius:`3px`,color:`var(--ts-ui-picker-nav-fg, var(--ts-ui-text-color))`}}),new r({scope:`selector`,name:`.PickerNavButton:hover`,styles:{backgroundColor:`var(--ts-ui-picker-nav-hover-bg, rgba(30, 100, 200, 0.08))`}});var PickerDayHeader=class extends f{constructor(e){super(e,{textAlign:`center`,fontSize:12,preferredSize:{width:0,height:20}}),this.setLineHeight(20)}},PickerBlankCell=class extends o{constructor(){super({preferredSize:{width:0,height:24}})}},PickerNavButton=class extends o{constructor(e,t){super({preferredSize:{width:24,height:24}}),this.setLayoutManager(new d),this.setCursor(`pointer`),this.getAria().setRole(`button`);let n=new c(e);n.setPointerEvents(`none`),n.setPreferredSize({width:12,height:12}),this.addComponent(n),s.addListener(this,`pointerdown`,e=>e.preventDefault()),s.addListener(this,`click`,()=>t())}render(){let t=super.render();return e.sink.apply(t,{addClass:[`PickerNavButton`]}),t}},PickerMonthLabel=class extends f{constructor(e){super(``,{textAlign:`center`,fontWeight:`bold`}),this.setLineHeight(24),this.setCursor(`pointer`),this.getAria().setRole(`button`),this.getAria().setExpanded(!1),this.getAria().setTabIndex(0),s.addListener(this,`pointerdown`,e=>e.preventDefault()),s.addListener(this,`click`,()=>e())}render(){let t=super.render();return e.sink.apply(t,{addClass:[`PickerNavButton`]}),t}},PickerDay=class extends f{_date;_selected=!1;_disabled=!1;_onClick;constructor(e,t){super(String(e.getDate()),{textAlign:`center`,preferredSize:{width:0,height:24}}),this._date=e,this._onClick=t,this.setLineHeight(24),this.setCursor(`pointer`),s.addListener(this,`pointerdown`,e=>this.onPointerDown(e)),s.addListener(this,`click`,()=>this.onClick())}getDate(){return this._date}onPointerDown(e){e.preventDefault()}onClick(){this._disabled||this._onClick(this._date)}setSelected(e){return this._selected===e?this:(this._selected=e,e?(this.setBackgroundColor(`var(--ts-ui-autocomplete-item-highlight-bg, rgba(30, 100, 200, 0.18))`),this.setFontWeight(`bold`)):(this.clearBackgroundColor(),this.setFontWeight(`normal`)),this)}isSelected(){return this._selected}setDisabled(t){if(this._disabled===t)return this;this._disabled=t,this.setCursor(t?`default`:`pointer`);let n=this.getElement();return n&&e.sink.apply(n,{toggleClass:{disabled:t}}),this}isDisabled(){return this._disabled}render(){let t=super.render();return e.sink.apply(t,{addClass:[`PickerDay`]}),this._disabled&&e.sink.apply(t,{addClass:[`disabled`]}),t}};function dayStart(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function dayEnd(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}var AbstractCalendarDropdown=class extends u{_onSelect;_value=null;_monthAnchor=new Date;_yearScrollOpen=!1;_root;_headerRow;_prevButton;_nextButton;_monthLabel;_weekdayRow;_dayGrid;_yearColumn=null;_highlightedDayIdx=-1;_highlightedYear=-1;_yearTypeBuffer=``;_yearTypeTimer=null;constructor(e,t,r){super(t,{zIndex:10050,layoutManager:new d,backgroundColor:`var(--ts-ui-autocomplete-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-autocomplete-shadow, 2px 4px 8px rgba(0,0,0,0.15))`,insets:new n(6,6,6,6),...r??{}}),this._onSelect=e,this.getAria().setRole(`group`),this.setContain(`layout`),this._root=new o,this._root.setLayoutManager(new _({spacing:4,stretching:!0})),this._headerRow=new o({preferredSize:{width:0,height:24}}),this._headerRow.setLayoutManager(new h({spacing:2,stretching:!0})),this._prevButton=new PickerNavButton(`chevron-left`,()=>this.prevMonth()),this._nextButton=new PickerNavButton(`chevron-right`,()=>this.nextMonth()),this._monthLabel=new PickerMonthLabel(()=>this.toggleYearScroller());let i=new g;i.weight=1,this._headerRow.addComponent(this._prevButton),this._headerRow.addComponent(this._monthLabel,i),this._headerRow.addComponent(this._nextButton),this._root.addComponent(this._headerRow),this._weekdayRow=new o({preferredSize:{width:0,height:20}}),this._weekdayRow.setLayoutManager(new y({columns:7,spacing:2}));for(let e of[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`])this._weekdayRow.addComponent(new PickerDayHeader(e));this._root.addComponent(this._weekdayRow),this._dayGrid=new o({preferredSize:{width:0,height:154}}),this._dayGrid.setLayoutManager(new y({columns:7,spacing:2})),this._root.addComponent(this._dayGrid),this.addComponent(this._root),this.buildExtraRootChildren(),s.addSubtreeListener(this,`pointerdown`,e=>this.onPointerDown(e))}applyOptions(e){return super.applyOptions(e),e.minDate!==void 0&&(this._options.minDate=e.minDate),e.maxDate!==void 0&&(this._options.maxDate=e.maxDate),this}onPointerDown(t){e.source.isNode(t.target)&&e.source.getTagName(e.source.intern(t.target))===`INPUT`||t.preventDefault()}showAt(t,n){this._value=n?new Date(n.getTime()):null;let r=this._value??new Date;this._monthAnchor=new Date(r.getFullYear(),r.getMonth(),1),this._highlightedDayIdx=-1,this._highlightedYear=-1,this.resetYearTypeBuffer(),this._yearScrollOpen&&this.closeYearScroller(),this.pauseLayout(),this.rebuild(),this.resumeLayout();let i=this.computePanelHeight();return this.setWidth(this.getPanelWidth()),this.setHeight(i),this.doLayout(),this.placeAnchored(e.source.getElementRect(t)),this.showAnimated(),this}hideAnimated(){return super.hideAnimated(),this.resetYearTypeBuffer(),this}computePanelHeight(){let e=this.getPerimeterSize(),t=206+this.getExtraInnerHeight();return e.top+e.bottom+t}rebuild(){this.buildDayGrid(),this.rebuildExtraRowsAfterValueChange()}buildDayGrid(){this._dayGrid.removeAllComponents(),this._highlightedDayIdx=-1;let e=this._monthAnchor.getFullYear(),t=this._monthAnchor.getMonth();this._monthLabel.setText(this._monthAnchor.toLocaleDateString(void 0,{month:`long`,year:`numeric`}));let n=new Date(e,t,1).getDay(),r=new Date(e,t+1,0).getDate();for(let e=0;e<n;e++)this._dayGrid.addComponent(new PickerBlankCell);for(let n=1;n<=r;n++){let r=new Date(e,t,n),i=new PickerDay(r,e=>this.onDateSelected(e));this.isDateInRange(r)||i.setDisabled(!0),this.isValueOnDay(r)&&i.setSelected(!0),this._dayGrid.addComponent(i)}let i=42-n-r;for(let e=0;e<i;e++)this._dayGrid.addComponent(new PickerBlankCell)}isValueOnDay(e){return this._value?this._value.getFullYear()===e.getFullYear()&&this._value.getMonth()===e.getMonth()&&this._value.getDate()===e.getDate():!1}isDateInRange(e){let t=this._options.minDate??null,n=this._options.maxDate??null;return!(t&&e.getTime()<dayStart(t).getTime()||n&&e.getTime()>dayEnd(n).getTime())}hasAnyInRange(e){let t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n+1,0).getDate(),i=new Date(t,n,1),a=new Date(t,n,r),o=this._options.minDate??null,s=this._options.maxDate??null;return!(o&&dayEnd(a).getTime()<dayStart(o).getTime()||s&&dayStart(i).getTime()>dayEnd(s).getTime())}onDateSelected(e){this.applyDateSelection(e),this._monthAnchor=new Date(e.getFullYear(),e.getMonth(),1),this.notifyValueChanged(),this.rebuild(),this.doLayout()}notifyValueChanged(){this._value&&this._onSelect(new Date(this._value.getTime()))}prevMonth(){let e=new Date(this._monthAnchor.getFullYear(),this._monthAnchor.getMonth()-1,1);this.hasAnyInRange(e)&&(this._monthAnchor=e,this._yearScrollOpen?(this.updateMonthLabel(),this.refreshYearSelection()):(this.buildDayGrid(),this.doLayout()))}nextMonth(){let e=new Date(this._monthAnchor.getFullYear(),this._monthAnchor.getMonth()+1,1);this.hasAnyInRange(e)&&(this._monthAnchor=e,this._yearScrollOpen?(this.updateMonthLabel(),this.refreshYearSelection()):(this.buildDayGrid(),this.doLayout()))}updateMonthLabel(){this._monthLabel.setText(this._monthAnchor.toLocaleDateString(void 0,{month:`long`,year:`numeric`}))}toggleYearScroller(){this._yearScrollOpen?this.closeYearScroller():this.openYearScroller()}openYearScroller(){this._yearColumn||(this._yearColumn=new PickerColumn(null),this._yearColumn.setPreferredSize({width:0,height:154}),this._yearColumn.getAria().setRole(`listbox`)),this.buildYearScroller(),this._root.removeComponent(this._dayGrid),this._root.insertComponent(this._yearColumn,2),this._yearScrollOpen=!0,this._monthLabel.getAria().setExpanded(!0),this.doLayout(),this._yearColumn.scrollSelectedIntoView()}closeYearScroller(){this._yearColumn&&this._root.removeComponent(this._yearColumn),this._root.insertComponent(this._dayGrid,2),this._yearScrollOpen=!1,this._monthLabel.getAria().setExpanded(!1),this.resetYearTypeBuffer(),this.buildDayGrid(),this.doLayout()}buildYearScroller(){if(!this._yearColumn)return;this._yearColumn.clearCells(),this._highlightedYear=-1;let e=new Date,t=this._options.minDate?.getFullYear()??e.getFullYear()-120,n=this._options.maxDate?.getFullYear()??e.getFullYear()+50,r=this._monthAnchor.getFullYear();for(let e=t;e<=n;e++){let t=e,n=new PickerCell(String(t),()=>this.onYearSelected(t));t===r&&n.setSelected(!0),this._yearColumn.addCell(n)}}refreshYearSelection(){if(!this._yearColumn)return;let e=this._monthAnchor.getFullYear();for(let t of this._yearColumn.getCellList().getComponents())t instanceof PickerCell&&t.setSelected(t.getText().valueOf()===String(e))}onYearSelected(e){this._monthAnchor=new Date(e,this._monthAnchor.getMonth(),1),this.applyYearSelection(e),this.closeYearScroller()}resetYearTypeBuffer(){this._yearTypeBuffer=``,this._yearTypeTimer!==null&&(clearTimeout(this._yearTypeTimer),this._yearTypeTimer=null)}handleKey(e){return this.isOpen()?this._yearScrollOpen?this.handleKeyInYearScroller(e):this.handleKeyInDayGrid(e):!1}handleKeyInDayGrid(e){switch(e.key){case`ArrowLeft`:return this.moveHighlightedDay(-1);case`ArrowRight`:return this.moveHighlightedDay(1);case`ArrowUp`:return this.moveHighlightedDay(-7);case`ArrowDown`:return this.moveHighlightedDay(7);case`PageUp`:return this.prevMonth(),!0;case`PageDown`:return this.nextMonth(),!0;case`Home`:return this.highlightFirstDayOfMonth();case`End`:return this.highlightLastDayOfMonth();case`Enter`:case` `:return this.commitHighlightedDay();default:return!1}}getDayGridChildren(){return this._dayGrid.getComponents()}moveHighlightedDay(e){let t=this.getDayGridChildren(),n=[];for(let e=0;e<t.length;e++){let r=t[e];r instanceof PickerDay&&!r.isDisabled()&&n.push({idx:e,cell:r})}if(n.length===0)return!0;let r=-1;for(let e=0;e<n.length;e++)if(n[e].idx===this._highlightedDayIdx){r=e;break}if(r<0){r=0;for(let e=0;e<n.length;e++)if(n[e].cell.isSelected()){r=e;break}}let i=Math.max(0,Math.min(n.length-1,r+e));return this.setHighlightedDay(n[i].idx),!0}setHighlightedDay(e){let t=this.getDayGridChildren();if(this._highlightedDayIdx>=0&&this._highlightedDayIdx<t.length){let e=t[this._highlightedDayIdx];e instanceof PickerDay&&!this.matchesSelection(e)&&e.setSelected(!1)}if(e<0||e>=t.length){this._highlightedDayIdx=-1;return}let n=t[e];n instanceof PickerDay&&(n.setSelected(!0),this._highlightedDayIdx=e)}matchesSelection(e){return this.isValueOnDay(e.getDate())}highlightFirstDayOfMonth(){let e=this.getDayGridChildren();for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof PickerDay&&!n.isDisabled())return this.setHighlightedDay(t),!0}return!0}highlightLastDayOfMonth(){let e=this.getDayGridChildren();for(let t=e.length-1;t>=0;t--){let n=e[t];if(n instanceof PickerDay&&!n.isDisabled())return this.setHighlightedDay(t),!0}return!0}commitHighlightedDay(){if(this._highlightedDayIdx<0)return!1;let e=this.getDayGridChildren()[this._highlightedDayIdx];return e instanceof PickerDay&&!e.isDisabled()?(this.onDateSelected(e.getDate()),!0):!1}handleKeyInYearScroller(e){if(/^[0-9]$/.test(e.key))return this.appendYearDigit(e.key);switch(e.key){case`ArrowLeft`:case`ArrowUp`:return this.moveHighlightedYear(-1);case`ArrowRight`:case`ArrowDown`:return this.moveHighlightedYear(1);case`PageUp`:return this.moveHighlightedYear(-10);case`PageDown`:return this.moveHighlightedYear(10);case`Home`:return this.highlightFirstYear();case`End`:return this.highlightLastYear();case`Enter`:case` `:return this.commitHighlightedYear();case`Escape`:return this.closeYearScroller(),!0;default:return!1}}getYearCells(){if(!this._yearColumn)return[];let e=[];for(let t of this._yearColumn.getCellList().getComponents())t instanceof PickerCell&&e.push(t);return e}moveHighlightedYear(e){let t=this.getYearCells();if(t.length===0)return!0;let n=this.findHighlightedYearPos(t),r=Math.max(0,Math.min(t.length-1,n+e));return this.applyYearHighlight(t,r),!0}findHighlightedYearPos(e){if(this._highlightedYear<0){for(let t=0;t<e.length;t++)if(e[t].isSelected())return t;return 0}for(let t=0;t<e.length;t++)if(e[t].getText().valueOf()===String(this._highlightedYear))return t;return 0}applyYearHighlight(e,t){let n=this._monthAnchor.getFullYear();for(let t of e)t.setSelected(t.getText().valueOf()===String(n));e[t].setSelected(!0),this._highlightedYear=parseInt(e[t].getText().valueOf(),10),this._yearColumn&&this._yearColumn.scrollSelectedIntoView()}highlightFirstYear(){let e=this.getYearCells();return e.length===0||this.applyYearHighlight(e,0),!0}highlightLastYear(){let e=this.getYearCells();return e.length===0||this.applyYearHighlight(e,e.length-1),!0}commitHighlightedYear(){let e=this._highlightedYear>=0?this._highlightedYear:this._monthAnchor.getFullYear();return this.onYearSelected(e),!0}appendYearDigit(e){this._yearTypeBuffer.length>=4&&(this._yearTypeBuffer=``),this._yearTypeBuffer+=e,this._yearTypeTimer!==null&&clearTimeout(this._yearTypeTimer),this._yearTypeTimer=setTimeout(()=>this.resetYearTypeBuffer(),800);let t=this.getYearCells(),n=this._yearTypeBuffer,r=-1;for(let e=0;e<t.length;e++)if(t[e].getText().valueOf().startsWith(n)){r=e;break}return r>=0&&this.applyYearHighlight(t,r),n.length===4&&this.resetYearTypeBuffer(),!0}getExtraInnerHeight(){return 0}buildExtraRootChildren(){}rebuildExtraRowsAfterValueChange(){}applyDateSelection(e){this._value=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}applyYearSelection(e){}},z=240,DatePickerDropdown=class extends AbstractCalendarDropdown{constructor(e,t){super(e,t)}getPanelWidth(){return z}onDateSelected(e){this.applyDateSelection(e),this._monthAnchor=new Date(e.getFullYear(),e.getMonth(),1),this.notifyValueChanged()}},B=i(DatePickerDropdown),TimeColumns=class extends o{_onChange;_showSeconds;_hours=-1;_minutes=-1;_seconds=-1;_hourColumn;_minuteColumn;_secondColumn;constructor(e,t){super({preferredSize:{width:0,height:176}}),this._onChange=e,this._showSeconds=t?.showSeconds??!1,this.setLayoutManager(new h({spacing:4,stretching:!0}));let n=new g;n.weight=1,this._hourColumn=this.buildColumn(`Hour`,24,1,e=>this.onUnitSelected(`hours`,e)),this._minuteColumn=this.buildColumn(`Min`,60,5,e=>this.onUnitSelected(`minutes`,e)),this.addComponent(this._hourColumn,n),this.addComponent(this._minuteColumn,n),this._showSeconds?(this._secondColumn=this.buildColumn(`Sec`,60,5,e=>this.onUnitSelected(`seconds`,e)),this.addComponent(this._secondColumn,n)):this._secondColumn=null}setTime(e){return e?(this._hours=e.getHours(),this._minutes=e.getMinutes(),this._seconds=this._showSeconds?e.getSeconds():0):(this._hours=-1,this._minutes=-1,this._seconds=-1),this.refreshColumns(),this}buildColumn(e,t,n,r){let i=new PickerColumn(e);for(let e=0;e<t;e+=n){let t=e,n=new PickerCell(String(t).padStart(2,`0`),()=>r(t));i.addCell(n)}return i}onUnitSelected(e,t){e===`hours`?this._hours=t:e===`minutes`?this._minutes=t:this._seconds=t,this._hours<0&&(this._hours=0),this._minutes<0&&(this._minutes=0),this._seconds<0&&(this._seconds=0),this.refreshColumns(),this._onChange(this._hours,this._minutes,this._showSeconds?this._seconds:0)}refreshColumns(){this._hourColumn.setSelectedValue(this.cellLabel(this._hours)),this._minuteColumn.setSelectedValue(this.cellLabel(this._minutes)),this._secondColumn?.setSelectedValue(this.cellLabel(this._seconds))}cellLabel(e){return e<0?null:String(e).padStart(2,`0`)}},V=140,H=200,U=220,TimePickerDropdown=class extends u{_showSeconds;_timeColumns;constructor(e,t){super(t,{zIndex:10050,layoutManager:new d,backgroundColor:`var(--ts-ui-autocomplete-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-autocomplete-shadow, 2px 4px 8px rgba(0,0,0,0.15))`,insets:new n(4,4,4,4)}),this._showSeconds=t?.showSeconds??!1,this.getAria().setRole(`group`),this.setContain(`layout`),this._timeColumns=new TimeColumns(e,{showSeconds:this._showSeconds}),this.addComponent(this._timeColumns),s.addSubtreeListener(this,`pointerdown`,e=>this.onPointerDown(e))}onPointerDown(e){e.preventDefault()}showAt(t,n){return this._timeColumns.setTime(n),this.setWidth(this._showSeconds?H:V),this.setHeight(U),this.placeAnchored(e.source.getElementRect(t)),this.showAnimated(),this.doLayout(),this}},W=i(TimePickerDropdown);c.register(S);var TimeField=class extends AbstractPickerField{constructor(e){super(e),this._button.setGlyph(`clock`),this._options.showSeconds!==void 0&&(this._showSeconds=this._options.showSeconds),this._options.value!==void 0&&this.setValue(this._options.value)}applyOptions(e){return super.applyOptions(e),e.showSeconds!==void 0&&(this._options.showSeconds=e.showSeconds),e.value!==void 0&&(this._options.value=e.value),this}formatValue(e){let t=String(e.getHours()).padStart(2,`0`),n=String(e.getMinutes()).padStart(2,`0`);return this._showSeconds?`${t}:${n}:${String(e.getSeconds()).padStart(2,`0`)}`:`${t}:${n}`}parseRaw(e){let[t,n,r]=e.split(`:`),i=Number(t),a=Number(n),o=r===void 0?0:Number(r);if(!(n!==void 0&&n!==``)||!(!isNaN(i)&&i>=0&&i<24)||!(!isNaN(a)&&a>=0&&a<60)||!(!isNaN(o)&&o>=0&&o<60))return null;let s=new Date;return s.setHours(i,a,o,0),s}createDropdown(){return new W((e,t,n)=>this.onTimeSelected(e,t,n),{showSeconds:this._showSeconds})}onTimeSelected(e,t,n){let r=new Date;r.setHours(e,t,n,0),this.onDropdownSelected(r)}onDropdownSelected(e){this.setValue(e),s.fireEvent(this._input,`input`)}getPreferredWidth(){return 140}},G=i(TimeField),K=240,DateTimePickerDropdown=class extends AbstractCalendarDropdown{constructor(e,t){super(e,t)}applyOptions(e){return super.applyOptions(e),e.showSeconds!==void 0&&(this._options.showSeconds=e.showSeconds),this}buildExtraRootChildren(){this._timeField=new G({showSeconds:this.isShowingSeconds()}),this._timeField.on(`change`,e=>this.onTimeFieldChange(e)),this._root.addComponent(this._timeField)}rebuildExtraRowsAfterValueChange(){this._timeField.setValue(this._value)}onTimeFieldChange(e){if(!e)return;let t=this._value??this.todayMidnight();t.setHours(e.getHours(),e.getMinutes(),this.isShowingSeconds()?e.getSeconds():0,0),this._value=t,this.notifyValueChanged()}applyDateSelection(e){this._value?this._value.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()):this._value=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}applyYearSelection(e){this._value&&(this._value.setFullYear(e),this.notifyValueChanged())}getPanelWidth(){return K}getExtraInnerHeight(){return 4+(this._timeField.getPreferredSize()?.height??0)}isShowingSeconds(){return this._options.showSeconds??!1}todayMidnight(){let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}},q=i(DateTimePickerDropdown);c.register(C);var Checkbox=class extends m{_box;_check;_dash;constructor(e){super({...e??{}}),this.setLayoutManager(new h),this._box=new o,this._box.setPreferredSize({width:16,height:16}),this._box.setMinSize({width:16,height:16}),this._box.setMaxSize({width:16,height:16}),this._box.setSize({width:16,height:16}),this._box.setBackgroundColor(`var(--ts-ui-checkbox-bg, var(--ts-ui-form-bg, rgb(255, 255, 255)))`),this._box.setBorder(`1px solid var(--ts-ui-form-border, rgb(160, 160, 160))`),this._box.setBorderRadius(`var(--ts-ui-checkbox-radius, 3px)`),this._box.setCursor(`pointer`),this._check=new c(`check`),this._check.setForegroundColor(`var(--ts-ui-checkbox-check-color, rgb(255, 255, 255))`),this._check.setPreferredSize({width:12,height:12}),this._check.setMaxSize({width:12,height:12}),this._check.setX(1),this._check.setY(1),this._check.setOpacity(0),this._check.setPointerEvents(`none`),this._dash=new o,this._dash.setBackgroundColor(`var(--ts-ui-checkbox-check-color, rgb(255, 255, 255))`),this._dash.setPreferredSize({width:8,height:2}),this._dash.setMaxSize({width:8,height:2}),this._dash.setSize({width:8,height:2}),this._dash.setX(3),this._dash.setY(6),this._dash.setOpacity(0),this._dash.setPointerEvents(`none`),a.isReducedMotion()||(this._check.setTransition(`opacity 120ms ease-out`),this._dash.setTransition(`opacity 120ms ease-out`),this._box.setTransition(`background-color 120ms ease-out, border-color 120ms ease-out`)),this._box.addComponent(this._check),this._box.addComponent(this._dash),super.addComponent(this._box),this.getAria().setRole(`checkbox`),this.getAria().setTabIndex(0),this.getAria().setChecked(!1),this.setOutline(`none`),s.addListener(this._box,`click`,()=>this.activateFromPointer()),this.installKeyboard(),this._options.value!==void 0&&this._options.selected===void 0&&(this._options.selected=this._options.value),this._options.selected!==void 0&&this.applySelected(this._options.selected,this._options.indeterminate??!1),this._options.indeterminate!==void 0&&this.applySelected(this._options.selected??!1,this._options.indeterminate),this._options.label!==void 0&&this.applyLabel(this._options.label),this._options.enabled!==void 0&&this.applyEnabled(this._options.enabled),this._options.readOnly!==void 0&&this.applyReadOnly(this._options.readOnly)}applyOptions(e){return super.applyOptions(e),e.selected!==void 0&&(this._options.selected=e.selected),e.value!==void 0&&(this._options.value=e.value),e.indeterminate!==void 0&&(this._options.indeterminate=e.indeterminate),e.label!==void 0&&(this._options.label=e.label),e.enabled!==void 0&&(this._options.enabled=e.enabled),e.readOnly!==void 0&&(this._options.readOnly=e.readOnly),this}activate(){if(this.isIndeterminate()){this.setSelected(!0);return}this.setSelected(!this.isSelected())}getInteractiveSurface(){return this._box}isSelected(){return this._options.selected??!1}setSelected(e){let t=!!e;return t===this.isSelected()&&!this.isIndeterminate()?this:(this._options.selected=t,this._options.indeterminate=!1,this.applySelected(t,!1),this.notifyChange(t),this.getElement()?s.fireEvent(this,`click`):console.warn(`Checkbox '`+this.getId()+`' setSelected before mount; synthetic 'click' skipped.`),this)}getValue(){return this.isSelected()}setValue(e){return this.setSelected(e)}isIndeterminate(){return this._options.indeterminate??!1}setIndeterminate(e){let t=!!e;return t===this.isIndeterminate()?this:(this._options.indeterminate=t,this.applySelected(this.isSelected(),t),this)}setAnimated(e){let t=e&&!a.isReducedMotion();return this._check.setTransition(t?`opacity 120ms ease-out`:`none`),this._dash.setTransition(t?`opacity 120ms ease-out`:`none`),this._box.setTransition(t?`background-color 120ms ease-out, border-color 120ms ease-out`:`none`),this}on(e,t){return e===`action`?(s.addListener(this,`click`,t),this):super.on(e,t)}off(e,t){return e===`action`?(s.removeListener(this,`click`,t),this):super.off(e,t)}applySelected(e,t){t?this.getAria().setChecked(`mixed`):this.getAria().setChecked(e);let n=t?`var(--ts-ui-checkbox-bg-indeterminate, rgb(160, 160, 160))`:e?`var(--ts-ui-checkbox-bg-selected, rgb(30, 100, 200))`:`var(--ts-ui-checkbox-bg, var(--ts-ui-form-bg, rgb(255, 255, 255)))`,r=e||t?`1px solid `+(t?`var(--ts-ui-checkbox-bg-indeterminate, rgb(160, 160, 160))`:`var(--ts-ui-checkbox-bg-selected, rgb(30, 100, 200))`):`1px solid var(--ts-ui-form-border, rgb(160, 160, 160))`;this._box.setBackgroundColor(n),this._box.setBorder(r),this._check.setOpacity(e&&!t?1:0),this._dash.setOpacity(+!!t)}},J=i(Checkbox);c.register(ee);var Y={tag:`div`,backgroundColor:`var(--ts-ui-input-bg, rgb(255, 255, 255))`,foregroundColor:`var(--ts-ui-text-color, black)`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,cursor:`pointer`,insets:new n(3,6,3,6)},X=200,Z=22,Q=16,$=200,ComboBoxDropdown=class extends u{_list;_minWidth=$;constructor(e){super(void 0,{layoutManager:new d,backgroundColor:`var(--ts-ui-autocomplete-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-autocomplete-shadow, 2px 4px 8px rgba(0,0,0,0.15))`}),this.setContain(`layout`),this._list=new T,this._list.setBorder(`none`),this._list.setBorderRadius(`0`),this._list.setFocusOnRowClick(!1),this.addComponent(this._list),this._list.on(`action`,()=>e(this._list.getSelectedIndex()))}handleKey(e){return this._list.handleKey(e)}showAt(t,n,r){this.pauseLayout(),this._list.setItemsArray(n),this._list.setSelectedIndex(r,!1),this.resumeLayout();let i=this.getPerimeterSize(),a=i.top+i.bottom,o=i.left+i.right,s=n.length*Z+a,c=Math.min(s,X),l=e.source.getElementRect(t),u=this.measureWidestLabel(n)+Q+o,d=l.width,f=Math.max(l.width,this._minWidth),p=Math.min(Math.max(u,d),f,e.source.getViewportSize().width);return this.setWidth(p),this.setHeight(c),this.placeAnchored(l),this.showAnimated(),this.doLayout(),this}setMinWidth(e){return this._minWidth=e,this}getMinWidth(){return this._minWidth}getList(){return this._list}measureWidestLabel(e){let n=0;for(let r of e){let e=t.measureTextWidth(r.label);e>n&&(n=e)}return n}};new r({scope:`class`,name:`ComboBox`,styles:{userSelect:`none`,whiteSpace:`nowrap`}}),new r({scope:`class`,name:`ComboBoxLabel`,styles:{overflow:`hidden`,textOverflow:`ellipsis`}}),new r({scope:`selector`,name:`.ComboBoxDropdown .List:focus::after`,styles:{content:`none`}});var ComboBoxLabel=class extends o{_lineHeight=null;_renderer;constructor(e){super({tag:`span`}),this.setPointerEvents(`none`),this._renderer=e()}setItem(e,t){return this._renderer.update({item:e,index:t}),this}setRenderer(t){let n=this.getElement();if(n){let t=this._renderer.getElement();t&&e.source.getParentNode(t)===n&&e.sink.removeChild(n,t)}return this._renderer=t,n&&e.sink.appendChild(n,this._renderer.getElement(!0)),this}setLineHeight(e){return this._lineHeight=typeof e==`number`?e+`px`:e,this.setElementCSSRule(`lineHeight`,this._lineHeight),this}getLineHeight(){return this._lineHeight}init(t){super.init(t);let n=t||this.getElement();return n&&e.sink.appendChild(n,this._renderer.getElement(!0)),this}doLayout(){super.doLayout();let e=this.getWidth(),t=this.getHeight();return this._renderer.setAutoCommitStyle(!1),this._renderer.setX(0),this._renderer.setY(0),this._renderer.setWidth(e),this._renderer.setHeight(t),this._renderer.setAutoCommitStyle(!0),this._renderer.layoutChildren(e,t),this}},ComboBoxCaret=class extends o{_glyph=new c(`chevron-down`);_size;constructor(){super({tag:`span`}),this._size=t.lineHeightPx({linePadding:!1}),this.setMinSize({width:this._size,height:this._size}),this.setMaxSize({width:this._size,height:this._size}),this.setPointerEvents(`none`),this._glyph.setPreferredSize({width:this._size,height:this._size}),this._glyph.setPointerEvents(`none`),this.addComponent(this._glyph)}getCaretSize(){return this._size}getGlyph(){return this._glyph}},ComboBox=class extends p{_dropdown;_label;_caret;_pendingValue=null;_boundStore=null;_onStoreRefresh;constructor(e,t){super(e,{...Y,...t??{}}),this.getAria().setRole(`combobox`),this.getAria().setExpanded(!1),this.getAria().setTabIndex(0),this._label=new ComboBoxLabel(this._options.rendererFactory??(()=>new w)),this._caret=new ComboBoxCaret,this.addComponent(this._label),this.addComponent(this._caret),this._dropdown=new ComboBoxDropdown(e=>this.onRowSelected(e)),this._options.dropdownAnimated!==void 0&&this._dropdown.setAnimated(this._options.dropdownAnimated),this._options.dropdownMinWidth!==void 0&&this._dropdown.setMinWidth(this._options.dropdownMinWidth),this._options.rendererFactory!==void 0&&this._dropdown.getList().setRendererFactory(this._options.rendererFactory),this.refreshLabel(),this.updateHeight(),this.subscribeTheme(()=>this.updateHeight()),s.addListener(this,`click`,()=>this.toggleDropdown()),s.addListener(this,`keydown`,e=>this.onKeyDown(e)),this._dropdown.setCloseHandler(()=>this.closeDropdown()),this._onStoreRefresh=()=>this.onStoreRefresh(),this._options.store!==void 0&&this._options.displayField!==void 0&&this.setStore(this._options.store,this._options.displayField,this._options.valueField,this._options.glyphField),this._options.items!==void 0&&this.setItems(this._options.items),this._options.selectedIndex!==void 0&&this.setSelectedIndex(this._options.selectedIndex,!1),this._options.value!==void 0&&this.setValue(this._options.value),this._options.selectedItem!==void 0&&this.setValue(this._options.selectedItem),this._options.enabled!==void 0&&this.applyEnabled(this._options.enabled),this._options.readOnly!==void 0&&this.applyReadOnly(this._options.readOnly)}applyOptions(e){return super.applyOptions(e),e.items!==void 0&&(this._options.items=e.items),e.store!==void 0&&(this._options.store=e.store),e.displayField!==void 0&&(this._options.displayField=e.displayField),e.valueField!==void 0&&(this._options.valueField=e.valueField),e.glyphField!==void 0&&(this._options.glyphField=e.glyphField),e.rendererFactory!==void 0&&(this._options.rendererFactory=e.rendererFactory),e.selectedIndex!==void 0&&(this._options.selectedIndex=e.selectedIndex),e.value!==void 0&&(this._options.value=e.value),e.selectedItem!==void 0&&(this._options.selectedItem=e.selectedItem),e.dropdownAnimated!==void 0&&(this._options.dropdownAnimated=e.dropdownAnimated),e.dropdownMinWidth!==void 0&&this.setDropdownMinWidth(e.dropdownMinWidth),this}updateHeight(){let e=t.singleLineBoxHeight(this.getInsets(),this.getPadding(),this.getBorderSize());this.setPreferredSize({width:200,height:e}),this.setMaxSize({width:2**53-1,height:e}),this.setMinSize({width:0,height:e})}doLayout(){super.doLayout();let e=this.getInnerSize();if(!e)return this;let t=this._caret.getCaretSize(),n=this.getInsets(),r=n.getLeft(),i=n.getTop(),a=Math.max(0,e.width-t-6),o=r+a+6,s=i+Math.max(0,(e.height-t)/2);return this._label.setX(r),this._label.setY(i),this._label.setWidth(a),this._label.setHeight(e.height),this._label.setLineHeight(e.height),this._label.doLayout(),this._caret.setX(o),this._caret.setY(s),this._caret.setWidth(t),this._caret.setHeight(t),this}getBaseline(){return this.wrapInnerBaseline(t.measureTextBaseline())}openDropdown(){return this._dropdown.isOpen()||this.toggleDropdown(),this}toggleDropdown(){if(this._dropdown.isOpen()){this.closeDropdown();return}let e=this.getElement(!0),t=this._dropdown.getList();this._dropdown.setAnchorElement(e),this._dropdown.showAt(e,t.getItems(),t.getSelectedIndex()),this.getAria().setExpanded(!0),this.setCaretOpen(!0)}setCaretOpen(e){let t=this._caret.getGlyph(),n=this._dropdown.isAnimated()?this._dropdown.getDurationMs():0;t.setTransition(`transform ${n}ms ease`),t.setTransform(e?`rotate(180deg)`:`rotate(0deg)`)}closeDropdown(){this._dropdown.isOpen()&&(this._dropdown.hideAnimated(),this.getAria().setExpanded(!1),this.setCaretOpen(!1))}onKeyDown(e){if(this._dropdown.isOpen()){if(this._dropdown.handleKey(e)){e.preventDefault();return}e.key===`Escape`&&(e.preventDefault(),this.closeDropdown());return}switch(e.key){case`ArrowDown`:case`ArrowUp`:case`Enter`:case` `:e.preventDefault(),this.toggleDropdown();break;case`Escape`:break;default:break}}onRowSelected(e){this.setSelectedIndex(e,!0),this.closeDropdown()}computeSelectedItem(){let e=this._dropdown.getList(),t=e.getSelectedIndex(),n=e.getItems();return t>=0&&t<n.length?{item:n[t],index:t}:{item:{key:``,label:``},index:-1}}refreshLabel(){let{item:e,index:t}=this.computeSelectedItem();this._label.setItem(e,t)}on(e,t){return super.on(e===`action`?`change`:e,t)}off(e,t){return super.off(e===`action`?`change`:e,t)}setValue(e){return this._pendingValue=e,this._dropdown.getList().setValue(e),this.refreshLabel(),this}getValue(){return this._dropdown.getList().getValue()||(this._pendingValue??``)}getSelectedIndex(){return this._dropdown.getList().getSelectedIndex()}setSelectedIndex(e,t=!0){return this._dropdown.getList().setSelectedIndex(e,!1),this._pendingValue=null,this.refreshLabel(),t&&this.notifyChange(this.getValue()),this}getItems(){return this._dropdown.getList().getItems()}setItems(e){return this._dropdown.getList().setItems(e),this.reapplyPendingValue(),this.autoSelectFirstIfEmpty(),this.refreshLabel(),this}addItem(e){return this._dropdown.getList().addItem(e),this.reapplyPendingValue(),this.autoSelectFirstIfEmpty(),this.refreshLabel(),this}setStore(e,t,n,r){return this._options.store=e,this._options.displayField=t,this._options.valueField=n,this._options.glyphField=r,this._boundStore&&[`load`,`add`,`remove`,`datachange`].forEach(e=>this._boundStore.off(e,this._onStoreRefresh)),this._dropdown.getList().setStore(e,t,n,r),this._boundStore=e,[`load`,`add`,`remove`,`datachange`].forEach(t=>e.on(t,this._onStoreRefresh)),this.reapplyPendingValue(),this.autoSelectFirstIfEmpty(),this.refreshLabel(),this}getStore(){return this._dropdown.getList().getStore()}setRendererFactory(e){return this._options.rendererFactory=e,this._dropdown.getList().setRendererFactory(e),this._label.setRenderer(e()),this.refreshLabel(),this}getRendererFactory(){return this._dropdown.getList().getRendererFactory()}getSelectedRecord(){return this._dropdown.getList().getSelectedRecord()}reapplyPendingValue(){if(this._pendingValue===null)return;let e=this._dropdown.getList();e.setValue(this._pendingValue),e.getSelectedIndex()>=0&&(this._pendingValue=null)}autoSelectFirstIfEmpty(){let e=this._dropdown.getList();e.getSelectedIndex()<0&&e.getItems().length>0&&e.setSelectedIndex(0,!1)}onStoreRefresh(){this.reapplyPendingValue(),this.autoSelectFirstIfEmpty(),this.refreshLabel()}setDropdownAnimated(e){return this._options.dropdownAnimated=e,this._dropdown.setAnimated(e),this}isDropdownAnimated(){return this._options.dropdownAnimated??!0}setDropdownMinWidth(e){return this._options.dropdownMinWidth=e,this._dropdown.setMinWidth(e),this}getDropdownMinWidth(){return this._options.dropdownMinWidth??$}applyEnabled(e){this.getAria().setDisabled(!e),this.getAria().setTabIndex(e?0:-1),this.setCursor(e?`pointer`:`default`),e||this.closeDropdown()}applyReadOnly(e){this.getAria().setReadOnly(e)}},te=i(ComboBox);export{W as a,PickerCellList as c,AbstractPickerField as d,registerFocusWithinRing as f,O as g,A as h,G as i,PickerColumn as l,M as m,J as n,B as o,N as p,q as r,PickerCell as s,te as t,R as u};
2
- //# sourceMappingURL=ComboBox-B9EDPu6T.js.map