@jimka/typescript-ui 0.5.0 → 0.6.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 (252) hide show
  1. package/dist/lib/{AbstractInput-B10DfLOf.js → AbstractInput-sRNPzWel.js} +2 -2
  2. package/dist/lib/{AbstractInput-B10DfLOf.js.map → AbstractInput-sRNPzWel.js.map} +1 -1
  3. package/dist/lib/Anchor-CwRhdP2J.js +2 -0
  4. package/dist/lib/Anchor-CwRhdP2J.js.map +1 -0
  5. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js +2 -0
  6. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js.map +1 -0
  7. package/dist/lib/Border-0DJFDiij.js +2 -0
  8. package/dist/lib/Border-0DJFDiij.js.map +1 -0
  9. package/dist/lib/Button-MpMIYBYJ.js +2 -0
  10. package/dist/lib/Button-MpMIYBYJ.js.map +1 -0
  11. package/dist/lib/{Card-CD3jxshU.js → Card-QYo27r5b.js} +2 -2
  12. package/dist/lib/{Card-CD3jxshU.js.map → Card-QYo27r5b.js.map} +1 -1
  13. package/dist/lib/Checkbox-D0JYK-wc.js +2 -0
  14. package/dist/lib/Checkbox-D0JYK-wc.js.map +1 -0
  15. package/dist/lib/CheckboxMenuRow-CesLhSnp.js +2 -0
  16. package/dist/lib/CheckboxMenuRow-CesLhSnp.js.map +1 -0
  17. package/dist/lib/{CodeEditor-BGlB232h.js → CodeEditor-N1FQodcF.js} +2 -2
  18. package/dist/lib/CodeEditor-N1FQodcF.js.map +1 -0
  19. package/dist/lib/ComboBox-Dx8Tk9yg.js +2 -0
  20. package/dist/lib/ComboBox-Dx8Tk9yg.js.map +1 -0
  21. package/dist/lib/Component-B0ShfPVi.js +2 -0
  22. package/dist/lib/Component-B0ShfPVi.js.map +1 -0
  23. package/dist/lib/Container-abY5Ww3W.js +2 -0
  24. package/dist/lib/{Container-C7RPLQEc.js.map → Container-abY5Ww3W.js.map} +1 -1
  25. package/dist/lib/{DOM-Ba8YRVel.js → DOM-C-Edb3tA.js} +2 -2
  26. package/dist/lib/DOM-C-Edb3tA.js.map +1 -0
  27. package/dist/lib/Dialog-cbA9V17e.js +2 -0
  28. package/dist/lib/Dialog-cbA9V17e.js.map +1 -0
  29. package/dist/lib/{FieldDecorator-HG65hEtk.js → FieldDecorator-BlYMfZ9L.js} +2 -2
  30. package/dist/lib/{FieldDecorator-HG65hEtk.js.map → FieldDecorator-BlYMfZ9L.js.map} +1 -1
  31. package/dist/lib/{Fit-Cg3dPyZg.js → Fit-BhlB-HAo.js} +2 -2
  32. package/dist/lib/{Fit-Cg3dPyZg.js.map → Fit-BhlB-HAo.js.map} +1 -1
  33. package/dist/lib/{FloatingPanel-D5buuVrQ.js → FloatingPanel-DkJXsZ2D.js} +2 -2
  34. package/dist/lib/{FloatingPanel-D5buuVrQ.js.map → FloatingPanel-DkJXsZ2D.js.map} +1 -1
  35. package/dist/lib/{Glyph-DeJF_zsR.js → Glyph-_VeBacS2.js} +2 -2
  36. package/dist/lib/{Glyph-DeJF_zsR.js.map → Glyph-_VeBacS2.js.map} +1 -1
  37. package/dist/lib/{Grid-BYBohJIA.js → Grid-Daiz7F5d.js} +2 -2
  38. package/dist/lib/Grid-Daiz7F5d.js.map +1 -0
  39. package/dist/lib/GridConstraints-C58LuTqM.js +2 -0
  40. package/dist/lib/{GridConstraints-Bts284FI.js.map → GridConstraints-C58LuTqM.js.map} +1 -1
  41. package/dist/lib/{Header-BIFJK9nR.js → Header-Dql3Zxc6.js} +2 -2
  42. package/dist/lib/{Header-BIFJK9nR.js.map → Header-Dql3Zxc6.js.map} +1 -1
  43. package/dist/lib/{IconText-Dsb1xS-E.js → IconText-PUjhTLlp.js} +2 -2
  44. package/dist/lib/{IconText-Dsb1xS-E.js.map → IconText-PUjhTLlp.js.map} +1 -1
  45. package/dist/lib/LayoutSerialization-CMxunLfV.js +2 -0
  46. package/dist/lib/LayoutSerialization-CMxunLfV.js.map +1 -0
  47. package/dist/lib/List-nx8220Fi.js +2 -0
  48. package/dist/lib/{List-BPd-IXZR.js.map → List-nx8220Fi.js.map} +1 -1
  49. package/dist/lib/MemoryStore-DhPoU-7X.js +2 -0
  50. package/dist/lib/MemoryStore-DhPoU-7X.js.map +1 -0
  51. package/dist/lib/Menu-Q0bpXXze.js +2 -0
  52. package/dist/lib/Menu-Q0bpXXze.js.map +1 -0
  53. package/dist/lib/{MenuButton-BR4KOFld.js → MenuButton-DCXi0tsP.js} +2 -2
  54. package/dist/lib/{MenuButton-BR4KOFld.js.map → MenuButton-DCXi0tsP.js.map} +1 -1
  55. package/dist/lib/OverlayFade-3pof2AJH.js +2 -0
  56. package/dist/lib/OverlayFade-3pof2AJH.js.map +1 -0
  57. package/dist/lib/{Panel-CpNQTLNF.js → Panel-Cy1pdlWO.js} +2 -2
  58. package/dist/lib/{Panel-CpNQTLNF.js.map → Panel-Cy1pdlWO.js.map} +1 -1
  59. package/dist/lib/{Position-PBVBW1JS.js → Position-BwtxouxK.js} +2 -2
  60. package/dist/lib/{Position-PBVBW1JS.js.map → Position-BwtxouxK.js.map} +1 -1
  61. package/dist/lib/{ProgressSpinner-lAsK26C-.js → ProgressSpinner-DK8xEQ9y.js} +2 -2
  62. package/dist/lib/{ProgressSpinner-lAsK26C-.js.map → ProgressSpinner-DK8xEQ9y.js.map} +1 -1
  63. package/dist/lib/RadioButton-BEwpqg1k.js +2 -0
  64. package/dist/lib/{RadioButton-CCcIaL54.js.map → RadioButton-BEwpqg1k.js.map} +1 -1
  65. package/dist/lib/RadioMenuRow-DP5qPyFR.js +2 -0
  66. package/dist/lib/RadioMenuRow-DP5qPyFR.js.map +1 -0
  67. package/dist/lib/{RovingTabIndex-C2Vzq0IX.js → RovingTabIndex-pHEv5oLD.js} +2 -2
  68. package/dist/lib/{RovingTabIndex-C2Vzq0IX.js.map → RovingTabIndex-pHEv5oLD.js.map} +1 -1
  69. package/dist/lib/Scrollbar-t8fFrUVQ.js +2 -0
  70. package/dist/lib/Scrollbar-t8fFrUVQ.js.map +1 -0
  71. package/dist/lib/{Slider-DZ9drUxn.js → Slider-CTbwR6HR.js} +2 -2
  72. package/dist/lib/{Slider-DZ9drUxn.js.map → Slider-CTbwR6HR.js.map} +1 -1
  73. package/dist/lib/{Spacer-SDhOMp2g.js → Spacer-srdN2d2b.js} +2 -2
  74. package/dist/lib/{Spacer-SDhOMp2g.js.map → Spacer-srdN2d2b.js.map} +1 -1
  75. package/dist/lib/TabButton-DLoMQzky.js +2 -0
  76. package/dist/lib/TabButton-DLoMQzky.js.map +1 -0
  77. package/dist/lib/TabCloseButton-CY7BGitY.js +2 -0
  78. package/dist/lib/TabCloseButton-CY7BGitY.js.map +1 -0
  79. package/dist/lib/{Text-CdHf3B-1.js → Text-CMKnK9uB.js} +2 -2
  80. package/dist/lib/{Text-CdHf3B-1.js.map → Text-CMKnK9uB.js.map} +1 -1
  81. package/dist/lib/{Tooltip-B_UF5bXD.js → Tooltip-CUOJOqQi.js} +3 -3
  82. package/dist/lib/Tooltip-CUOJOqQi.js.map +1 -0
  83. package/dist/lib/Tree-C64JNPWJ.js +2 -0
  84. package/dist/lib/Tree-C64JNPWJ.js.map +1 -0
  85. package/dist/lib/VBox-DfJPWXqc.js +2 -0
  86. package/dist/lib/VBox-DfJPWXqc.js.map +1 -0
  87. package/dist/lib/VirtualScroller-DTIn19o1.js +2 -0
  88. package/dist/lib/VirtualScroller-DTIn19o1.js.map +1 -0
  89. package/dist/lib/assets/StoreWorker-B5NwRM2I.js +2 -0
  90. package/dist/lib/assets/StoreWorker-B5NwRM2I.js.map +1 -0
  91. package/dist/lib/component/button.es.js +1 -1
  92. package/dist/lib/component/button.es.js.map +1 -1
  93. package/dist/lib/component/chart.es.js +1 -1
  94. package/dist/lib/component/container.es.js +1 -1
  95. package/dist/lib/component/container.es.js.map +1 -1
  96. package/dist/lib/component/diagram.es.js +1 -1
  97. package/dist/lib/component/diagram.es.js.map +1 -1
  98. package/dist/lib/component/display.es.js +1 -1
  99. package/dist/lib/component/display.es.js.map +1 -1
  100. package/dist/lib/component/editor.es.js +2 -2
  101. package/dist/lib/component/editor.es.js.map +1 -1
  102. package/dist/lib/component/input.es.js +1 -1
  103. package/dist/lib/component/input.es.js.map +1 -1
  104. package/dist/lib/component/list.es.js +1 -1
  105. package/dist/lib/component/list.es.js.map +1 -1
  106. package/dist/lib/component/menubar.es.js +1 -1
  107. package/dist/lib/component/menubar.es.js.map +1 -1
  108. package/dist/lib/component/table.es.js +6 -3
  109. package/dist/lib/component/table.es.js.map +1 -1
  110. package/dist/lib/component/tree.es.js +1 -1
  111. package/dist/lib/core.es.js +1 -1
  112. package/dist/lib/core.es.js.map +1 -1
  113. package/dist/lib/data.es.js +1 -1
  114. package/dist/lib/glyphs/solid/index.es.js +1 -1
  115. package/dist/lib/layout.es.js +1 -1
  116. package/dist/lib/layout.es.js.map +1 -1
  117. package/dist/lib/overlay.es.js +1 -1
  118. package/dist/lib/overlay.es.js.map +1 -1
  119. package/dist/lib/primitive.es.js +1 -1
  120. package/dist/lib/router.es.js +1 -1
  121. package/dist/lib/router.es.js.map +1 -1
  122. package/dist/lib/selectionsEqual-gMG7gCVI.js +2 -0
  123. package/dist/lib/selectionsEqual-gMG7gCVI.js.map +1 -0
  124. package/dist/lib/types/component/button/Button.d.ts +13 -0
  125. package/dist/lib/types/component/button/MenuButton.d.ts +1 -0
  126. package/dist/lib/types/component/button/PopupButton.d.ts +22 -0
  127. package/dist/lib/types/component/button/TabButton.d.ts +4 -0
  128. package/dist/lib/types/component/button/index.d.ts +2 -0
  129. package/dist/lib/types/component/container/CheckboxMenuRow.d.ts +33 -0
  130. package/dist/lib/types/component/container/CollapseButton.d.ts +11 -3
  131. package/dist/lib/types/component/container/MenuItem.d.ts +15 -5
  132. package/dist/lib/types/component/container/MenuRow.d.ts +24 -0
  133. package/dist/lib/types/component/container/MenuSeparator.d.ts +4 -2
  134. package/dist/lib/types/component/container/RadioMenuRow.d.ts +33 -0
  135. package/dist/lib/types/component/container/Scrollbar.d.ts +5 -0
  136. package/dist/lib/types/component/container/SplitGutter.d.ts +7 -2
  137. package/dist/lib/types/component/container/TabBar.d.ts +2 -0
  138. package/dist/lib/types/component/container/WindowBorder.d.ts +1 -1
  139. package/dist/lib/types/component/container/index.d.ts +6 -1
  140. package/dist/lib/types/component/display/WebGLCanvas.d.ts +1 -0
  141. package/dist/lib/types/component/input/AbstractCalendarDropdown.d.ts +2 -0
  142. package/dist/lib/types/component/input/AbstractPickerField.d.ts +3 -2
  143. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +1 -1
  144. package/dist/lib/types/component/list/MultiSelectList.d.ts +2 -1
  145. package/dist/lib/types/component/shared/VirtualRowView.d.ts +2 -0
  146. package/dist/lib/types/component/table/Body.d.ts +22 -1
  147. package/dist/lib/types/component/table/Column.d.ts +3 -1
  148. package/dist/lib/types/component/table/ColumnConfig.d.ts +2 -0
  149. package/dist/lib/types/component/table/ColumnFilter.d.ts +27 -0
  150. package/dist/lib/types/component/table/Header.d.ts +30 -3
  151. package/dist/lib/types/component/table/Row.d.ts +4 -0
  152. package/dist/lib/types/component/table/Table.d.ts +29 -0
  153. package/dist/lib/types/component/table/TableExporter.d.ts +4 -3
  154. package/dist/lib/types/component/table/TreeBody.d.ts +2 -1
  155. package/dist/lib/types/component/table/cell/CellText.d.ts +9 -0
  156. package/dist/lib/types/component/table/cell/Filter.d.ts +54 -0
  157. package/dist/lib/types/component/table/cell/FilterClauseBadge.d.ts +21 -0
  158. package/dist/lib/types/component/table/cell/GroupSeparator.d.ts +9 -0
  159. package/dist/lib/types/component/table/cell/Header.d.ts +1 -0
  160. package/dist/lib/types/component/table/cell/editor/CellEditor.d.ts +1 -0
  161. package/dist/lib/types/component/table/cell/renderer/CellRenderer.d.ts +1 -0
  162. package/dist/lib/types/component/table/cell/renderer/Combo.d.ts +2 -0
  163. package/dist/lib/types/component/table/cell/renderer/Date.d.ts +2 -0
  164. package/dist/lib/types/component/table/cell/renderer/DateTime.d.ts +2 -0
  165. package/dist/lib/types/component/table/cell/renderer/Filter.d.ts +16 -0
  166. package/dist/lib/types/component/table/cell/renderer/Glyph.d.ts +1 -0
  167. package/dist/lib/types/component/table/cell/renderer/Link.d.ts +2 -0
  168. package/dist/lib/types/component/table/cell/renderer/Number.d.ts +3 -1
  169. package/dist/lib/types/component/table/cell/renderer/String.d.ts +2 -0
  170. package/dist/lib/types/component/table/cell/renderer/Time.d.ts +2 -0
  171. package/dist/lib/types/component/table/cell/renderer/TreeCell.d.ts +1 -0
  172. package/dist/lib/types/component/table/index.d.ts +6 -0
  173. package/dist/lib/types/component/tree/Tree.d.ts +17 -1
  174. package/dist/lib/types/component/tree/index.d.ts +1 -1
  175. package/dist/lib/types/core/AnimatedDropdown.d.ts +0 -9
  176. package/dist/lib/types/core/Body.d.ts +4 -0
  177. package/dist/lib/types/core/ClassStyleRules.d.ts +1 -0
  178. package/dist/lib/types/core/DOM.d.ts +10 -0
  179. package/dist/lib/types/core/Event.d.ts +11 -2
  180. package/dist/lib/types/core/OverlayFade.d.ts +12 -0
  181. package/dist/lib/types/core/OverlayPosition.d.ts +6 -0
  182. package/dist/lib/types/core/Theme.d.ts +8 -0
  183. package/dist/lib/types/core/index.d.ts +5 -3
  184. package/dist/lib/types/data/AbstractStore.d.ts +3 -0
  185. package/dist/lib/types/data/FilterDescriptor.d.ts +13 -0
  186. package/dist/lib/types/data/index.d.ts +2 -1
  187. package/dist/lib/types/data/temporalText.d.ts +2 -0
  188. package/dist/lib/types/layout/BoxLayout.d.ts +6 -1
  189. package/dist/lib/types/layout/Grid.d.ts +1 -0
  190. package/dist/lib/types/layout/HFlow.d.ts +1 -1
  191. package/dist/lib/types/layout/Split.d.ts +10 -1
  192. package/dist/lib/types/layout/Tab.d.ts +7 -1
  193. package/dist/lib/types/layout/VFlow.d.ts +1 -1
  194. package/dist/lib/types/layout/index.d.ts +1 -1
  195. package/dist/lib/types/overlay/Dock.d.ts +1 -0
  196. package/dist/lib/types/overlay/Menu.d.ts +1 -1
  197. package/dist/lib/types/overlay/Popover.d.ts +3 -0
  198. package/dist/lib/types/overlay/PopupPanel.d.ts +17 -0
  199. package/dist/lib/types/overlay/Window.d.ts +2 -0
  200. package/dist/lib/types/overlay/index.d.ts +2 -0
  201. package/dist/lib/types/router/RoutePattern.d.ts +7 -0
  202. package/dist/lib/types/router/Router.d.ts +6 -2
  203. package/dist/lib/types/router/index.d.ts +1 -1
  204. package/dist/lib/validation.es.js +1 -1
  205. package/llms.txt +4 -0
  206. package/package.json +1 -1
  207. package/dist/lib/AbstractBooleanInput-CbW7ZrDT.js +0 -2
  208. package/dist/lib/AbstractBooleanInput-CbW7ZrDT.js.map +0 -1
  209. package/dist/lib/Anchor-BsblS5it.js +0 -2
  210. package/dist/lib/Anchor-BsblS5it.js.map +0 -1
  211. package/dist/lib/AnimatedDropdown-kL47HPGP.js +0 -2
  212. package/dist/lib/AnimatedDropdown-kL47HPGP.js.map +0 -1
  213. package/dist/lib/Border-CNS6aEXB.js +0 -2
  214. package/dist/lib/Border-CNS6aEXB.js.map +0 -1
  215. package/dist/lib/Button-T16zSZip.js +0 -2
  216. package/dist/lib/Button-T16zSZip.js.map +0 -1
  217. package/dist/lib/CodeEditor-BGlB232h.js.map +0 -1
  218. package/dist/lib/ComboBox-C9FYMuLv.js +0 -2
  219. package/dist/lib/ComboBox-C9FYMuLv.js.map +0 -1
  220. package/dist/lib/Component-w65rPK75.js +0 -2
  221. package/dist/lib/Component-w65rPK75.js.map +0 -1
  222. package/dist/lib/Container-C7RPLQEc.js +0 -2
  223. package/dist/lib/DOM-Ba8YRVel.js.map +0 -1
  224. package/dist/lib/DragManager-UvPHSoRm.js +0 -2
  225. package/dist/lib/DragManager-UvPHSoRm.js.map +0 -1
  226. package/dist/lib/Grid-BYBohJIA.js.map +0 -1
  227. package/dist/lib/GridConstraints-Bts284FI.js +0 -2
  228. package/dist/lib/LayoutSerialization-ySzY1h2l.js +0 -2
  229. package/dist/lib/LayoutSerialization-ySzY1h2l.js.map +0 -1
  230. package/dist/lib/LayoutSizes-DKDK1Cle.js +0 -2
  231. package/dist/lib/LayoutSizes-DKDK1Cle.js.map +0 -1
  232. package/dist/lib/List-BPd-IXZR.js +0 -2
  233. package/dist/lib/MemoryStore-BgP7-Uzn.js +0 -2
  234. package/dist/lib/MemoryStore-BgP7-Uzn.js.map +0 -1
  235. package/dist/lib/Menu-C0roOCY7.js +0 -2
  236. package/dist/lib/Menu-C0roOCY7.js.map +0 -1
  237. package/dist/lib/RadioButton-CCcIaL54.js +0 -2
  238. package/dist/lib/Scrollbar-C3ZZyZ1e.js +0 -2
  239. package/dist/lib/Scrollbar-C3ZZyZ1e.js.map +0 -1
  240. package/dist/lib/TabButton-DNo4ZgV8.js +0 -2
  241. package/dist/lib/TabButton-DNo4ZgV8.js.map +0 -1
  242. package/dist/lib/Tooltip-B_UF5bXD.js.map +0 -1
  243. package/dist/lib/Tree-C7qLbIYH.js +0 -2
  244. package/dist/lib/Tree-C7qLbIYH.js.map +0 -1
  245. package/dist/lib/VBox-32fxpkDl.js +0 -2
  246. package/dist/lib/VBox-32fxpkDl.js.map +0 -1
  247. package/dist/lib/VirtualScroller-cvFNMS7U.js +0 -2
  248. package/dist/lib/VirtualScroller-cvFNMS7U.js.map +0 -1
  249. package/dist/lib/assets/StoreWorker-CgOBYoai.js +0 -2
  250. package/dist/lib/assets/StoreWorker-CgOBYoai.js.map +0 -1
  251. package/dist/lib/selectionsEqual-BrTxPMmK.js +0 -2
  252. package/dist/lib/selectionsEqual-BrTxPMmK.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { LayoutManager, LayoutManagerOptions } from "../layout/LayoutManager.js";
2
2
  import { SplitGutter } from "../component/container/SplitGutter.js";
3
+ import { CollapseTrigger } from "../component/container/CollapseButton.js";
3
4
  import { Component } from "../core/Component.js";
4
5
  import { Size } from "../primitive/Size.js";
5
6
  import { LayoutSize } from "../layout/LayoutSizes.js";
@@ -11,6 +12,7 @@ export interface SplitOptions extends LayoutManagerOptions {
11
12
  orientation?: AxisOrientation;
12
13
  collapsedPanes?: number[];
13
14
  paneSizes?: LayoutSize[];
15
+ collapseTrigger?: CollapseTrigger;
14
16
  listeners?: {
15
17
  paneresize?: PaneResizeCallback;
16
18
  panecollapse?: PaneCollapseCallback;
@@ -18,12 +20,14 @@ export interface SplitOptions extends LayoutManagerOptions {
18
20
  }
19
21
  declare class Split extends LayoutManager {
20
22
  private _orientation;
23
+ private _collapseTrigger;
21
24
  private _sizes;
22
25
  private _gutters;
23
26
  private _collapsed;
24
27
  private _weights;
25
28
  private _pendingCollapsed;
26
29
  private _listeners;
30
+ private _contextMenu;
27
31
  private _pendingSizes;
28
32
  private _dragOriginPointer;
29
33
  private _dragOriginLhsSize;
@@ -49,7 +53,7 @@ declare class Split extends LayoutManager {
49
53
  setOrientation(orientation: AxisOrientation): this;
50
54
  setPaneSize(pane: Component, size: number): this;
51
55
  getPaneSize(pane: Component): number | undefined;
52
- setPaneResizeWeight(pane: Component, weight: number): this;
56
+ setPaneResizeWeight(pane: Component, weight: number | undefined): this;
53
57
  getPaneResizeWeight(pane: Component): number | undefined;
54
58
  private effectiveResizeWeight;
55
59
  private clampMain;
@@ -70,11 +74,16 @@ declare class Split extends LayoutManager {
70
74
  onDragStart(container: Component, gutter: SplitGutter, position: number): void;
71
75
  onDrag(container: Component, gutter: SplitGutter, position: number): void;
72
76
  private onDragEnd;
77
+ private openGutterMenu;
78
+ private togglePaneResizePin;
79
+ private retargetGutterCollapse;
80
+ private setPaneCollapseDirection;
73
81
  detach(): this;
74
82
  private gutterTotal;
75
83
  protected computeTotalMinSize(): Size;
76
84
  doLayout(): void;
77
85
  private placeGutterAsStrip;
86
+ private commitPanes;
78
87
  private paneClipInset;
79
88
  private applyPendingSizes;
80
89
  private applyPendingCollapsed;
@@ -6,7 +6,7 @@ import type { ComponentFactory } from "../core/Component.js";
6
6
  import { AbstractWindow } from "../overlay/AbstractWindow.js";
7
7
  import type { TabToolDescriptor } from "../component/container/TabBar.js";
8
8
  import type { AxisPosition, AxisEnd } from "../primitive/Axis.js";
9
- export type TabEvent = "tabclose" | "empty" | "detach" | "select" | "activate" | "dock" | "exception";
9
+ export type TabEvent = "tabclose" | "empty" | "detach" | "select" | "activate" | "dock" | "exception" | "busychange";
10
10
  export type TabDetachWindowMode = "bare" | "strip";
11
11
  export type TabWidthMode = "fill" | "content" | "equal" | "fixed";
12
12
  export type TabSide = "north" | "south" | "west" | "east";
@@ -16,6 +16,7 @@ export interface TabOptions extends LayoutManagerOptions {
16
16
  tabclose?: (component: Component) => void;
17
17
  empty?: () => void;
18
18
  exception?: (error: unknown, label: string) => void;
19
+ busychange?: (busy: boolean, label: string) => void;
19
20
  };
20
21
  widthMode?: TabWidthMode;
21
22
  maxWidth?: number | null;
@@ -92,6 +93,8 @@ declare class Tab extends LayoutManager {
92
93
  private _onBarTabClose;
93
94
  private closeEntry;
94
95
  closeTab(content: Component): boolean;
96
+ setTabBusy(content: Component, busy: boolean): boolean;
97
+ isTabBusy(content: Component): boolean;
95
98
  private _onBarDockRequested;
96
99
  private _onBarDockHover;
97
100
  private _onBarTabDragStart;
@@ -108,6 +111,7 @@ declare class Tab extends LayoutManager {
108
111
  addDeferredComponent(factory: ComponentFactory, constraints?: LayoutConstraints): boolean;
109
112
  addLazyTab(factory: ComponentFactory, name: string, constraints?: LayoutConstraints): void;
110
113
  private syncUntabbedChildren;
114
+ private setEntryBusy;
111
115
  private materializeAsync;
112
116
  private announcePendingActivation;
113
117
  private failEntry;
@@ -135,6 +139,7 @@ declare class Tab extends LayoutManager {
135
139
  on(event: "activate", listener: (content: Component, index: number) => void): this;
136
140
  on(event: "dock", listener: (content: Component) => void): this;
137
141
  on(event: "exception", listener: (error: unknown, label: string) => void): this;
142
+ on(event: "busychange", listener: (busy: boolean, label: string) => void): this;
138
143
  off(event: TabEvent, listener: Function): this;
139
144
  protected emit(event: "tabclose", component: Component): void;
140
145
  protected emit(event: "empty"): void;
@@ -143,6 +148,7 @@ declare class Tab extends LayoutManager {
143
148
  protected emit(event: "activate", content: Component, index: number): void;
144
149
  protected emit(event: "dock", content: Component): void;
145
150
  protected emit(event: "exception", error: unknown, label: string): void;
151
+ protected emit(event: "busychange", busy: boolean, label: string): void;
146
152
  }
147
153
  declare const TabCallable: import("../core/Callable.js").Callable<typeof Tab>;
148
154
  type TabCallable = Tab;
@@ -8,7 +8,7 @@ declare class VFlow extends FlowLayout {
8
8
  getMaxSize(): Size | null;
9
9
  doLayout(): void;
10
10
  private groupIntoColumns;
11
- private placeColumns;
11
+ private resolveColumns;
12
12
  private cellsMainExtent;
13
13
  private columnsCrossExtent;
14
14
  }
@@ -21,7 +21,7 @@ export { Border } from '../layout/Border.js';
21
21
  export type { BorderOptions } from '../layout/Border.js';
22
22
  export type { AxisPosition, AxisSpread } from '../primitive/Axis.js';
23
23
  export { BoxLayout } from '../layout/BoxLayout.js';
24
- export type { BoxLayoutOptions, BoxMode, BoxOverflowSizing, BoxJustify } from '../layout/BoxLayout.js';
24
+ export type { BoxLayoutOptions, BoxMode, BoxOverflowSizing, BoxJustify, BoxItemAlign } from '../layout/BoxLayout.js';
25
25
  export { HBox } from '../layout/HBox.js';
26
26
  export type { HBoxOptions } from '../layout/HBox.js';
27
27
  export { VBox } from '../layout/VBox.js';
@@ -111,6 +111,7 @@ declare class Dock extends Container<DockOptions> {
111
111
  private regionKind;
112
112
  private onPanelClosed;
113
113
  private failPanel;
114
+ private setFrameBusy;
114
115
  private onPanelFocused;
115
116
  private onPanelDetached;
116
117
  private onFloatActivated;
@@ -47,7 +47,7 @@ declare class Menu extends Component implements DismissableLayer {
47
47
  private rebuildPersistentItems;
48
48
  private buildPersistentItems;
49
49
  private setFocusedIndex;
50
- private isItemSeparator;
50
+ private isItemSkipped;
51
51
  private closeOpenSubmenu;
52
52
  private dismissAll;
53
53
  getLayerElement(): Handle | null;
@@ -10,6 +10,7 @@ export interface PopoverOptions extends ContainerOptions {
10
10
  dismissOn?: PopoverDismissMode;
11
11
  showArrow?: boolean;
12
12
  title?: string;
13
+ onClose?: () => void;
13
14
  }
14
15
  declare class Popover extends Container<PopoverOptions> implements DismissableLayer {
15
16
  private _placement;
@@ -18,6 +19,7 @@ declare class Popover extends Container<PopoverOptions> implements DismissableLa
18
19
  private _showArrow;
19
20
  private _title;
20
21
  private _titleComponent;
22
+ private _onClose;
21
23
  private _bodyComponent;
22
24
  private _actionsRow;
23
25
  private _fadeShowAnimation;
@@ -55,6 +57,7 @@ declare class Popover extends Container<PopoverOptions> implements DismissableLa
55
57
  getBand(): number;
56
58
  doLayout(): this;
57
59
  protected destructor(): void;
60
+ private _reflowIfOpen;
58
61
  private _reposition;
59
62
  private resolvePlacement;
60
63
  private ensureArrow;
@@ -0,0 +1,17 @@
1
+ import { AnimatedDropdown, AnimatedDropdownOptions } from "../core/AnimatedDropdown.js";
2
+ import type { Handle, Rect } from "../core/DOM.js";
3
+ import { AnchoredFlexiblePlacement } from "../core/OverlayPosition.js";
4
+ import type { Size } from "../primitive/Size.js";
5
+ export interface PopupPanelOptions extends AnimatedDropdownOptions {
6
+ }
7
+ declare class PopupPanel<TOptions extends PopupPanelOptions = PopupPanelOptions> extends AnimatedDropdown<TOptions> {
8
+ private _currentOpener;
9
+ constructor(options?: PopupPanelOptions, subclassDefaults?: Partial<PopupPanelOptions>);
10
+ showAt(anchorRect: Rect): this;
11
+ toggleFor(openerEl: Handle, anchorRect: Rect): this;
12
+ hideAnimated(): this;
13
+ protected resolvePlacement(anchorRect: Rect, size: Size, viewport: Size): AnchoredFlexiblePlacement;
14
+ }
15
+ declare const PopupPanelCallable: import("../core/Callable.js").Callable<typeof PopupPanel>;
16
+ type PopupPanelCallable<TOptions extends PopupPanelOptions = PopupPanelOptions> = PopupPanel<TOptions>;
17
+ export { PopupPanel as _PopupPanel, PopupPanelCallable as PopupPanel, };
@@ -7,6 +7,7 @@ declare class Window extends AbstractWindow {
7
7
  private _headerDragShift;
8
8
  private _headerDragComponentId;
9
9
  private readonly _boundCaptureHeaderShift;
10
+ private readonly _boundOnHeaderMouseDown;
10
11
  constructor(headerText: string, options?: WindowOptions);
11
12
  getHeader(): WindowHeader;
12
13
  setHeaderText(text: string): this;
@@ -22,6 +23,7 @@ declare class Window extends AbstractWindow {
22
23
  protected chromeHeight(): number;
23
24
  protected addContent(content: Component): void;
24
25
  isChromeComponent(child: Component): boolean;
26
+ private onHeaderMouseDown;
25
27
  private onHeaderDoubleClick;
26
28
  private targetIsInTrailingButton;
27
29
  private captureHeaderShift;
@@ -9,6 +9,8 @@ export { Tooltip } from '../overlay/Tooltip.js';
9
9
  export type { TooltipColors } from '../overlay/Tooltip.js';
10
10
  export { Popover } from '../overlay/Popover.js';
11
11
  export type { PopoverOptions, PopoverPlacement, PopoverDismissMode } from '../overlay/Popover.js';
12
+ export { PopupPanel } from '../overlay/PopupPanel.js';
13
+ export type { PopupPanelOptions } from '../overlay/PopupPanel.js';
12
14
  export { Notification } from '../overlay/Notification.js';
13
15
  export type { NotificationType, NotificationRecord } from '../overlay/Notification.js';
14
16
  export { NotificationHistoryButton } from '../overlay/NotificationHistoryButton.js';
@@ -14,6 +14,13 @@ export declare function splitFragment(input: string): {
14
14
  path: string;
15
15
  fragment: string;
16
16
  };
17
+ export declare function splitQuery(input: string): {
18
+ path: string;
19
+ query: string;
20
+ };
21
+ export declare function parseQuery(query: string): Record<string, string>;
22
+ export declare function formatQuery(query: Record<string, string>): string;
23
+ export declare function sameQuery(a: Record<string, string>, b: Record<string, string>): boolean;
17
24
  export declare function normalizeBase(base: string): string;
18
25
  export declare function stripBase(base: string, pathname: string): string;
19
26
  export declare function joinBase(base: string, path: string): string;
@@ -1,5 +1,6 @@
1
1
  export type RouteParams = Record<string, string>;
2
- export type RouteHandler = (params: RouteParams, path: string, fragment: string) => void;
2
+ export type RouteQuery = Record<string, string>;
3
+ export type RouteHandler = (params: RouteParams, path: string, fragment: string, query: RouteQuery) => void;
3
4
  export type RouterEvent = "navigate" | "nomatch";
4
5
  export type RouterMode = "hash" | "history";
5
6
  export interface RouteMatch {
@@ -7,6 +8,7 @@ export interface RouteMatch {
7
8
  params: RouteParams;
8
9
  path: string;
9
10
  fragment: string;
11
+ query: RouteQuery;
10
12
  }
11
13
  export interface RouterOptions {
12
14
  mode?: RouterMode;
@@ -31,10 +33,12 @@ export declare class Router {
31
33
  stop(): this;
32
34
  navigate(path: string, options?: {
33
35
  replace?: boolean;
36
+ query?: RouteQuery;
34
37
  }): this;
35
- getHref(path: string): string;
38
+ getHref(path: string, query?: RouteQuery): string;
36
39
  getPath(href?: string): string;
37
40
  getFragment(href?: string): string;
41
+ getQuery(href?: string): RouteQuery;
38
42
  private decodePath;
39
43
  on(event: "navigate", listener: (match: RouteMatch) => void): this;
40
44
  on(event: "nomatch", listener: (path: string) => void): this;
@@ -1,2 +1,2 @@
1
1
  export { Router } from '../router/Router.js';
2
- export type { RouteParams, RouteHandler, RouterEvent, RouteMatch, RouterOptions, RouterMode } from '../router/Router.js';
2
+ export type { RouteParams, RouteQuery, RouteHandler, RouterEvent, RouteMatch, RouterOptions, RouterMode } from '../router/Router.js';
@@ -1 +1 @@
1
- import{t as e}from"./FieldDecorator-HG65hEtk.js";export{e as FieldDecorator};
1
+ import{t as e}from"./FieldDecorator-BlYMfZ9L.js";export{e as FieldDecorator};
package/llms.txt CHANGED
@@ -39,6 +39,7 @@ Organized by task. Columns: task → symbol · import subpath · summary · docs
39
39
  - Two-state toggle button → **ToggleButton** · `@jimka/typescript-ui/component/button` · A toggle button component that switches between selected and unselected states on each click. · docs/components/ToggleButton.md
40
40
  - Button with a primary action plus a dropdown menu → **SplitButton** · `@jimka/typescript-ui/component/button` · A push button with a trailing dropdown chevron. The main button face fires the primary `"action"` event exactly like `Button`; clicking the… · docs/components/SplitButton.md
41
41
  - Button whose click opens a dropdown menu → **MenuButton** · `@jimka/typescript-ui/component/button` · A push button whose click toggles a rebuild-mode dropdown `Menu` anchored under its bottom-left corner. The menu opens below the button, an… · docs/components/MenuButton.md
42
+ - Button whose click opens a custom popup panel → **PopupButton** · `@jimka/typescript-ui/component/button` · A push button whose click toggles a PopupPanel anchored under its bottom-left corner, mirroring `MenuButton` with a `PopupPanel` in place o… · docs/components/PopupButton.md
42
43
  - Clickable text link that activates in-app (click / Enter) → **Link** · `@jimka/typescript-ui/component/input` · A text link: link-coloured, underlined, and activated by a click or the Enter key. Its **hit area is exactly its text** — it is a Text subc… · docs/components/Link.md
43
44
  - Checkbox → **Checkbox** · `@jimka/typescript-ui/component/input` · A custom-drawn checkbox rendered as a focusable `<div>` with `role="checkbox"`. · docs/components/Checkbox.md
44
45
  - Radio button (mutually exclusive within a group) → **RadioButton** · `@jimka/typescript-ui/component/input` · A custom-drawn radio button rendered as a focusable `<div>` with `role="radio"`. The ring + dot is drawn with framework primitives; the nat… · docs/components/RadioButton.md
@@ -86,7 +87,10 @@ Organized by task. Columns: task → symbol · import subpath · summary · docs
86
87
  - Modal dialog (alert/confirm/prompt/custom) → **Dialog** · `@jimka/typescript-ui/overlay` · A modal dialog component with a title bar, scrollable content area, and button row. · docs/components/Dialog.md
87
88
  - Edge-anchored sliding drawer → **Drawer** · `@jimka/typescript-ui/overlay` · An edge-anchored panel that rests off-screen against a viewport edge and slides into view when opened, overlaying the rest of the UI. · docs/components/Drawer.md
88
89
  - Context / dropdown menu → **Menu** · `@jimka/typescript-ui/overlay` · A floating menu panel that operates in one of two modes: · docs/components/Menu.md
90
+ - Checkbox row in a menu → **CheckboxMenuRow** · `@jimka/typescript-ui/component/container` · A `Menu` row hosting a real `Checkbox`, for a multi-select menu. · docs/components/CheckboxMenuRow.md
91
+ - Radio row in a menu → **RadioMenuRow** · `@jimka/typescript-ui/component/container` · A `Menu` row hosting a real `RadioButton`, for a single-choice menu. · docs/components/RadioMenuRow.md
89
92
  - Anchored floating popover → **Popover** · `@jimka/typescript-ui/overlay` · An anchored, non-modal floating bubble with a directional arrow tail. Use `Popover` for click-triggered, interactive content (title, body,… · docs/components/Popover.md
93
+ - Custom popup panel anchored to a trigger → **PopupPanel** · `@jimka/typescript-ui/overlay` · A floating panel that sizes itself to its content, places itself against a trigger rect, and caps its height to the room available there —… · docs/components/PopupPanel.md
90
94
  - Hover tooltip → **Tooltip** · `@jimka/typescript-ui/overlay` · A singleton floating tooltip that appears near the cursor after a short delay. · docs/components/Tooltip.md
91
95
  - Transient toast notification → **Notification** · `@jimka/typescript-ui/overlay` · A lightweight toast-style notification that appears in the bottom-right corner of the viewport and auto-dismisses after a configurable dura… · docs/components/Notification.md
92
96
  - Browse / re-open past notifications → **NotificationHistoryButton** · `@jimka/typescript-ui/overlay` · A trigger button that opens a menu of recent notifications. The menu lists the in-session Notification history in chronological order (late… · docs/components/NotificationHistoryButton.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimka/typescript-ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A web-based layout manager and UI component framework written in TypeScript.",
5
5
  "keywords": ["ui", "ui-components", "typescript", "layout", "layout-manager", "widgets", "framework", "dock", "data-table", "retained-mode"],
6
6
  "author": "Jimmy Karlsson",
@@ -1,2 +0,0 @@
1
- import{l as e}from"./Position-PBVBW1JS.js";import{S as t}from"./Component-w65rPK75.js";import{t as n}from"./Text-CdHf3B-1.js";import{t as r}from"./AbstractInput-B10DfLOf.js";var AbstractBooleanInput=class extends r{_label=null;getLabel(){return this._options.label??null}setLabel(e){return this._options.label=e,this.applyLabel(e),this}getBaseline(){return this._label===null?this.wrapInnerBaseline(e.measureTextBaseline()):this.wrapInnerBaseline(this._label.getBaseline())}applyLabel(e){if(e===null){this._label!==null&&(super.removeComponent(this._label),this._label=null);return}this._label===null?(this._label=new n(e),this._label.setPointerEvents(`none`),super.addComponent(this._label)):this._label.setText(e)}applyEnabled(e){this.getAria().setDisabled(!e),this.getAria().setTabIndex(e?0:-1),this.getInteractiveSurface().setCursor(e?`pointer`:`default`)}applyReadOnly(e){this.getAria().setReadOnly(e)}handleActivationKey(e){this.activationKeys().includes(e.key)&&(e.preventDefault(),this.isEnabled()&&!this.isReadOnly()&&this.activate())}installKeyboard(){t.addListener(this,`keydown`,this.handleActivationKey)}activateFromPointer(){this.isEnabled()&&!this.isReadOnly()&&this.activate()}activationKeys(){return[` `]}};export{AbstractBooleanInput as t};
2
- //# sourceMappingURL=AbstractBooleanInput-CbW7ZrDT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractBooleanInput-CbW7ZrDT.js","names":[],"sources":["../../src/typescript/lib/component/input/AbstractBooleanInput.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractInput, AbstractInputOptions } from \"~/component/input/AbstractInput.js\";\nimport { Component } from \"~/core/Component.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { Text } from \"~/component/input/Text.js\";\nimport { Util } from \"~/core/Util.js\";\n\n/**\n * Construction-time options shared by the boolean-valued controls\n * ({@link Checkbox}, {@link RadioButton}, {@link Toggle}). Concrete subclasses\n * extend this with their own value / selected / indeterminate fields.\n *\n * @category Components\n */\nexport interface AbstractBooleanInputOptions extends AbstractInputOptions {\n label?: string | null;\n}\n\n/**\n * Abstract base for the three boolean-valued form controls — {@link Checkbox},\n * {@link RadioButton}, {@link Toggle}. Owns the mechanics they share verbatim:\n * the optional inline `_label` {@link Text} (mount / replace / remove), the\n * enabled / read-only ARIA + tabindex + interactive-surface cursor reflection,\n * the label-or-text baseline, and the keyboard-activation wiring routed through\n * the same enabled/read-only guard as pointer activation.\n *\n * Each subclass supplies only what differs: its inner graphic (the interactive\n * surface), the value mutation performed on activation, and — for {@link Toggle}\n * — the activation keys and a pill-centred baseline override. The value\n * semantics (`isSelected` /\n * `setSelected` / `getValue` / `setValue`, indeterminate handling, `ButtonGroup`\n * change firing, synthetic-click behaviour) stay in the subclasses.\n *\n * Not wrapped with `callable()` — abstract classes are never instantiated.\n *\n * @category Components\n */\nabstract class AbstractBooleanInput<\n TOptions extends AbstractBooleanInputOptions = AbstractBooleanInputOptions\n>\n extends AbstractInput<boolean, TOptions>\n{\n // Written by `applyLabel` from the subclass constructor body (after\n // super()), never by a cascade-dispatched setter, so a plain `= null`\n // initializer is safe.\n protected _label: Text | null = null;\n\n /**\n * Returns the label text, or `null` when none was set.\n *\n * @returns The label string, or `null`.\n */\n getLabel(): string | null {\n return this._options.label ?? null;\n }\n\n /**\n * Sets the inline label text. Pass `null` to remove the label entirely.\n *\n * @param text - The label text, or `null` to clear.\n *\n * @returns This component, for method chaining.\n */\n setLabel(text: string | null): this {\n this._options.label = text;\n this.applyLabel(text);\n\n return this;\n }\n\n /**\n * Returns the offset from the top of the control to its inline label's text\n * baseline, or — when there is no label — to the text baseline the graphic\n * would share with a label, so a label-less graphic still sits on a row's\n * baseline.\n *\n * @returns The baseline offset in pixels.\n *\n * @remarks A `null` baseline auto-centres the graphic within the row's\n * text-line height, which floats a small graphic to the row centre once a\n * tall sibling (e.g. a `TextArea`) inflates the row's descent. Returning the\n * text-line baseline keeps the graphic aligned exactly as a labelled\n * control's graphic would be. {@link Toggle} overrides this for its taller\n * pill.\n */\n getBaseline(): number | null {\n if (this._label === null) {\n return this.wrapInnerBaseline(Util.measureTextBaseline());\n }\n\n return this.wrapInnerBaseline(this._label.getBaseline());\n }\n\n /**\n * Mounts, replaces, or removes the inline label.\n *\n * @param text - The label text, or `null` to remove the label.\n */\n protected applyLabel(text: string | null): void {\n if (text === null) {\n if (this._label !== null) {\n super.removeComponent(this._label);\n this._label = null;\n }\n\n return;\n }\n\n if (this._label === null) {\n this._label = new Text(text);\n this._label.setPointerEvents(\"none\");\n super.addComponent(this._label);\n } else {\n this._label.setText(text);\n }\n }\n\n /**\n * Reflects the enabled flag in the ARIA tree, the tabindex, and the\n * interactive surface's cursor.\n *\n * @param value - The new enabled state.\n */\n protected applyEnabled(value: boolean): void {\n this.getAria().setDisabled(!value);\n this.getAria().setTabIndex(value ? 0 : -1);\n this.getInteractiveSurface().setCursor(value ? \"pointer\" : \"default\");\n }\n\n /**\n * Reflects the read-only flag in the ARIA tree.\n *\n * @param value - The new read-only state.\n */\n protected applyReadOnly(value: boolean): void {\n this.getAria().setReadOnly(value);\n }\n\n /**\n * Keydown handler: activates the control when the pressed key is one of\n * {@link activationKeys} and the control is enabled and not read-only.\n *\n * @param e - The keyboard event.\n */\n private handleActivationKey(e: KeyboardEvent): void {\n if (!this.activationKeys().includes(e.key)) {\n return;\n }\n\n e.preventDefault();\n\n if (this.isEnabled() && !this.isReadOnly()) {\n this.activate();\n }\n }\n\n /**\n * Wires the keyboard-activation listener on the focused root. Called from\n * each subclass constructor after its graphic is built.\n */\n protected installKeyboard(): void {\n Event.addListener(this, \"keydown\", this.handleActivationKey);\n }\n\n /**\n * Activates the control from a pointer click, subject to the same\n * enabled/read-only guard as the keyboard path. Wired by each subclass\n * onto its interactive surface (so the hit area is exactly the visible\n * graphic).\n */\n protected activateFromPointer(): void {\n if (this.isEnabled() && !this.isReadOnly()) {\n this.activate();\n }\n }\n\n /**\n * Keys that activate the control. Defaults to Space; {@link Toggle} widens\n * it to Space and Enter.\n *\n * @returns The activation key strings.\n */\n protected activationKeys(): string[] {\n return [\" \"];\n }\n\n /**\n * Subclass hook: perform the value mutation for an activation (click or\n * key). Called only after the enabled/read-only guard has passed.\n */\n protected abstract activate(): void;\n\n /**\n * Subclass hook: the inner graphic that owns the click + cursor surface\n * ({@link Checkbox}'s box, {@link RadioButton}'s ring, {@link Toggle}'s\n * track).\n *\n * @returns The interactive surface component.\n */\n protected abstract getInteractiveSurface(): Component;\n}\n\nexport { AbstractBooleanInput };\n"],"mappings":"8KAsCA,IAAe,qBAAf,cAGY,CACZ,CAII,OAAgC,KAOhC,UAA0B,CACtB,OAAO,KAAK,SAAS,OAAS,IAClC,CASA,SAAS,EAA2B,CAIhC,MAHA,MAAK,SAAS,MAAQ,EACtB,KAAK,WAAW,CAAI,EAEb,IACX,CAiBA,aAA6B,CAKzB,OAJI,KAAK,SAAW,KACT,KAAK,kBAAkB,EAAK,oBAAoB,CAAC,EAGrD,KAAK,kBAAkB,KAAK,OAAO,YAAY,CAAC,CAC3D,CAOA,WAAqB,EAA2B,CAC5C,GAAI,IAAS,KAAM,CACX,KAAK,SAAW,OAChB,MAAM,gBAAgB,KAAK,MAAM,EACjC,KAAK,OAAS,MAGlB,MACJ,CAEI,KAAK,SAAW,MAChB,KAAK,OAAS,IAAI,EAAK,CAAI,EAC3B,KAAK,OAAO,iBAAiB,MAAM,EACnC,MAAM,aAAa,KAAK,MAAM,GAE9B,KAAK,OAAO,QAAQ,CAAI,CAEhC,CAQA,aAAuB,EAAsB,CACzC,KAAK,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAK,EACjC,KAAK,QAAQ,CAAC,CAAC,YAAY,EAAQ,EAAI,EAAE,EACzC,KAAK,sBAAsB,CAAC,CAAC,UAAU,EAAQ,UAAY,SAAS,CACxE,CAOA,cAAwB,EAAsB,CAC1C,KAAK,QAAQ,CAAC,CAAC,YAAY,CAAK,CACpC,CAQA,oBAA4B,EAAwB,CAC3C,KAAK,eAAe,CAAC,CAAC,SAAS,EAAE,GAAG,IAIzC,EAAE,eAAe,EAEb,KAAK,UAAU,GAAK,CAAC,KAAK,WAAW,GACrC,KAAK,SAAS,EAEtB,CAMA,iBAAkC,CAC9B,EAAM,YAAY,KAAM,UAAW,KAAK,mBAAmB,CAC/D,CAQA,qBAAsC,CAC9B,KAAK,UAAU,GAAK,CAAC,KAAK,WAAW,GACrC,KAAK,SAAS,CAEtB,CAQA,gBAAqC,CACjC,MAAO,CAAC,GAAG,CACf,CAgBJ"}
@@ -1,2 +0,0 @@
1
- import{f as e,h as t}from"./Component-w65rPK75.js";var Anchor=class extends e{constructor(e){super(),e&&this.applyOptions(e)}resolve(e,t){if(e!==void 0)return typeof e==`number`?e:t*e.percent/100}resolveAxis(e,t,n,r,i,a,o){if(e!==void 0&&t!==void 0){let n=Math.max(0,r-e-t);return{start:o+e,extent:n}}let s=n??i;return e===void 0?t===void 0?{start:a,extent:s}:{start:o+r-t-s,extent:s}:{start:o+e,extent:s}}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getInnerSize();if(!t)return;let n=e.getContentInsets(),r=n.getLeft(),i=n.getTop();for(let n of e.getLaidOutComponents()){let e=this.getLayoutConstraints(n),a=n.getPreferredSize(),o=n.getSize(),s=a?.width??o?.width??0,c=a?.height??o?.height??0,l=this.resolveAxis(this.resolve(e?.left,t.width),this.resolve(e?.right,t.width),this.resolve(e?.width,t.width),t.width,s,n.getX(),r),u=this.resolveAxis(this.resolve(e?.top,t.height),this.resolve(e?.bottom,t.height),this.resolve(e?.height,t.height),t.height,c,n.getY(),i);this.commitBounds(n,l.start,u.start,l.extent,u.extent)}}},n=t(Anchor);export{n as t};
2
- //# sourceMappingURL=Anchor-BsblS5it.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Anchor-BsblS5it.js","names":[],"sources":["../../src/typescript/lib/layout/Anchor.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { LayoutManager, LayoutManagerOptions } from \"~/layout/LayoutManager.js\";\nimport { AnchorConstraints } from \"~/layout/AnchorConstraints.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * A length used by an {@link Anchor} constraint, expressed either in **pixels**\n * (a bare `number`) or as a **percentage** of the container's inner extent\n * (`{ percent }`, on a 0–100 scale). The percentage resolves against inner width\n * for horizontal fields (`left` / `right` / `width`) and inner height for\n * vertical fields (`top` / `bottom` / `height`).\n *\n * @category Layouts\n */\nexport type AnchorValue = number | { percent: number };\n\n/**\n * Construction-time options for {@link Anchor}.\n *\n * @category Layouts\n */\nexport interface AnchorOptions extends LayoutManagerOptions {\n}\n\n/**\n * The resolved placement of a child along one axis: a `start` offset in the\n * container's coordinate space and the `extent` (width or height) to commit.\n */\ninterface AxisResult {\n start: number;\n extent: number;\n}\n\n/**\n * A resize-reactive layout manager that positions each child by edge-relative\n * and proportional offsets, re-resolving them on every `doLayout` pass so a\n * child stays pinned to a container edge — or stretched between two edges — as\n * the container resizes. It is the reactive counterpart to the static\n * [`Absolute`](/api/layout/classes/Absolute) manager, which never reads the\n * container's inner size.\n *\n * Per child (via {@link AnchorConstraints}) an axis can: pin a fixed distance\n * from one edge (`left` / `right` / `top` / `bottom`), derive its extent from\n * the container when both opposing edges are set (stretch), or take an explicit\n * `width` / `height`. Any offset or size may be a pixel `number` or an\n * {@link AnchorValue} percentage of the container's inner extent.\n *\n * Like `Absolute`, `Anchor` commits rects directly through `commitBounds`,\n * bypassing the cell clamp — a child sized larger than the container is\n * committed at its computed size and may overflow, which a host `Panel` with\n * `autoScroll: \"auto\"` scrolls natively. It imposes no intrinsic preferred,\n * min, or max size on its host.\n *\n * @category Layouts\n */\nclass Anchor extends LayoutManager {\n\n constructor(options?: AnchorOptions) {\n // LayoutManager's constructor takes no options; applied via applyOptions below.\n // eslint-disable-next-line local/forward-super-options\n super();\n\n if (options) {\n this.applyOptions(options);\n }\n }\n\n /**\n * Resolves an {@link AnchorValue} to pixels against the given extent.\n * Returns the number unchanged for a pixel value, `extent * percent / 100`\n * for a percentage tag, and `undefined` when the field is unset.\n *\n * @param value - The pixel-or-percent value, or `undefined` if unset.\n * @param extent - The container inner extent the percentage resolves against.\n * @returns The resolved pixel value, or `undefined` when `value` is unset.\n */\n private resolve(value: AnchorValue | undefined, extent: number): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n\n if (typeof value === \"number\") {\n return value;\n }\n\n // Percent is on a 0–100 (CSS-style) scale, resolved against the inner extent.\n return extent * value.percent / 100;\n }\n\n /**\n * Resolves one axis's placement from its near edge, far edge, and explicit\n * size against the container inner extent, applying the precedence rules:\n * both edges stretch (size ignored); near edge pins the start; far edge pins\n * the end; neither edge falls back to the child's own start. The `origin`\n * (the inset on this axis) is added for every anchored row but **not** for\n * the no-edge fallback, matching {@link Absolute}, which commits the child's\n * own `getX` / `getY` without an inset offset.\n *\n * @param near - Resolved `left` / `top` offset, or `undefined` if unset.\n * @param far - Resolved `right` / `bottom` offset, or `undefined` if unset.\n * @param size - Resolved explicit `width` / `height`, or `undefined` if unset.\n * @param inner - The container's inner extent on this axis.\n * @param preferred - The child's preferred extent on this axis.\n * @param ownStart - The child's own `getX` / `getY` on this axis.\n * @param origin - The inset on this axis added to anchored placements.\n * @returns The `{ start, extent }` to commit on this axis.\n */\n private resolveAxis(near: number | undefined, far: number | undefined, size: number | undefined,\n inner: number, preferred: number, ownStart: number, origin: number): AxisResult {\n if (near !== undefined && far !== undefined) {\n // Stretch between both edges; explicit size is ignored. Clamp the\n // derived extent at 0 so an over-constrained pair never goes negative.\n const extent = Math.max(0, inner - near - far);\n\n return { start: origin + near, extent };\n }\n\n const extent = size ?? preferred;\n\n if (near !== undefined) {\n return { start: origin + near, extent };\n }\n\n if (far !== undefined) {\n return { start: origin + inner - far - extent, extent };\n }\n\n // No edge constrained: keep the child's own position, like Absolute, and\n // do not add the inset origin so mixed Anchor/Absolute usage is consistent.\n return { start: ownStart, extent };\n }\n\n /**\n * Resolves each child's rect from its {@link AnchorConstraints} against the\n * container's current inner size and insets, then commits via the base\n * `commitBounds` (bypassing the cell clamp). Bails before the container\n * connects, when `getInnerSize` is still `null`.\n */\n doLayout(): void {\n const container = this.getContainer();\n\n if (!container) {\n return;\n }\n\n const inner = container.getInnerSize();\n\n if (!inner) {\n return;\n }\n\n const insets = container.getContentInsets();\n const originX = insets.getLeft();\n const originY = insets.getTop();\n\n for (const component of container.getLaidOutComponents()) {\n const cons = this.getLayoutConstraints(component) as AnchorConstraints | undefined;\n\n const preferredSize = component.getPreferredSize();\n const size = component.getSize();\n const prefW = preferredSize?.width ?? size?.width ?? 0;\n const prefH = preferredSize?.height ?? size?.height ?? 0;\n\n const xAxis = this.resolveAxis(this.resolve(cons?.left, inner.width),\n this.resolve(cons?.right, inner.width), this.resolve(cons?.width, inner.width),\n inner.width, prefW, component.getX(), originX);\n\n const yAxis = this.resolveAxis(this.resolve(cons?.top, inner.height),\n this.resolve(cons?.bottom, inner.height), this.resolve(cons?.height, inner.height),\n inner.height, prefH, component.getY(), originY);\n\n this.commitBounds(component, xAxis.start, yAxis.start, xAxis.extent, yAxis.extent);\n }\n }\n}\n\nconst AnchorCallable = callable(Anchor);\ntype AnchorCallable = Anchor;\nexport {\n Anchor as _Anchor,\n AnchorCallable as Anchor\n};\n"],"mappings":"mDAwDA,IAAM,OAAN,cAAqB,CAAc,CAE/B,YAAY,EAAyB,CAGjC,MAAM,EAEF,GACA,KAAK,aAAa,CAAO,CAEjC,CAWA,QAAgB,EAAgC,EAAoC,CAC5E,OAAU,IAAA,GASd,OALI,OAAO,GAAU,SACV,EAIJ,EAAS,EAAM,QAAU,GACpC,CAoBA,YAAoB,EAA0B,EAAyB,EACnD,EAAe,EAAmB,EAAkB,EAA4B,CAChG,GAAI,IAAS,IAAA,IAAa,IAAQ,IAAA,GAAW,CAGzC,IAAM,EAAS,KAAK,IAAI,EAAG,EAAQ,EAAO,CAAG,EAE7C,MAAO,CAAE,MAAO,EAAS,EAAM,QAAO,CAC1C,CAEA,IAAM,EAAS,GAAQ,EAYvB,OAVI,IAAS,IAAA,GAIT,IAAQ,IAAA,GAML,CAAE,MAAO,EAAU,QAAO,EALtB,CAAE,MAAO,EAAS,EAAQ,EAAM,EAAQ,QAAO,EAJ/C,CAAE,MAAO,EAAS,EAAM,QAAO,CAU9C,CAQA,UAAiB,CACb,IAAM,EAAY,KAAK,aAAa,EAEpC,GAAI,CAAC,EACD,OAGJ,IAAM,EAAQ,EAAU,aAAa,EAErC,GAAI,CAAC,EACD,OAGJ,IAAM,EAAS,EAAU,iBAAiB,EACpC,EAAU,EAAO,QAAQ,EACzB,EAAU,EAAO,OAAO,EAE9B,IAAK,IAAM,KAAa,EAAU,qBAAqB,EAAG,CACtD,IAAM,EAAO,KAAK,qBAAqB,CAAS,EAE1C,EAAgB,EAAU,iBAAiB,EAC3C,EAAO,EAAU,QAAQ,EACzB,EAAQ,GAAe,OAAS,GAAM,OAAS,EAC/C,EAAQ,GAAe,QAAU,GAAM,QAAU,EAEjD,EAAQ,KAAK,YAAY,KAAK,QAAQ,GAAM,KAAM,EAAM,KAAK,EAC/D,KAAK,QAAQ,GAAM,MAAO,EAAM,KAAK,EAAG,KAAK,QAAQ,GAAM,MAAO,EAAM,KAAK,EAC7E,EAAM,MAAO,EAAO,EAAU,KAAK,EAAG,CAAO,EAE3C,EAAQ,KAAK,YAAY,KAAK,QAAQ,GAAM,IAAK,EAAM,MAAM,EAC/D,KAAK,QAAQ,GAAM,OAAQ,EAAM,MAAM,EAAG,KAAK,QAAQ,GAAM,OAAQ,EAAM,MAAM,EACjF,EAAM,OAAQ,EAAO,EAAU,KAAK,EAAG,CAAO,EAElD,KAAK,aAAa,EAAW,EAAM,MAAO,EAAM,MAAO,EAAM,OAAQ,EAAM,MAAM,CACrF,CACJ,CACJ,EAEM,EAAiB,EAAS,MAAM"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./DOM-Ba8YRVel.js";import{t}from"./Position-PBVBW1JS.js";import{h as n,t as r,v as i}from"./Component-w65rPK75.js";import{a,r as o}from"./Tooltip-B_UF5bXD.js";var s=120,c=4,l=new WeakMap,u={cancel:()=>{}},d={visible:!1,animated:!0,durationMs:s,translatePx:c},AnimatedDropdown=class extends r{_dismissing=!1;_open=!1;_closeHandler=null;_anchorElement=null;_showAnimation=null;_hideAnimation=null;constructor(e,n){super(e,{...d,...n??{}}),this.setPosition(t.FIXED)}applyOptions(e){return super.applyOptions(e),this.setAnimated(e.animated??this.isAnimated()),this.setDurationMs(e.durationMs??this.getDurationMs()),this.setTranslatePx(e.translatePx??this.getTranslatePx()),this}setAnimated(e){return this._options.animated=e,this}isAnimated(){return this._options.animated??this._defaultOptions.animated}setDurationMs(e){return this._options.durationMs=e,this}getDurationMs(){return this._options.durationMs??this._defaultOptions.durationMs}setTranslatePx(e){return this._options.translatePx=e,this}getTranslatePx(){return this._options.translatePx??this._defaultOptions.translatePx}showAnimated(){a.register(this),this.setZIndex(a.getZIndex(this)),this._dismissing=!1,this._open=!0;let e=this.getElement(!0);return a.mount(e),this.setVisible(!0),this.isAnimated()?(this.setWillChange(`opacity, transform`),this._showAnimation?.cancel(),this._showAnimation=i.play(e,{from:{opacity:`0`,transform:`translateY(-${this.getTranslatePx()}px)`},to:{opacity:`1`,transform:`translateY(0)`},durationMs:this.getDurationMs(),properties:[`opacity`,`transform`],onComplete:()=>{this.setWillChange(null),this.onShowComplete()}}),this):(this.onShowComplete(),this)}hideAnimated(){this._open=!1;let e=this.getElement(),finalize=()=>{this.setVisible(!1),this.removeElement(),a.unregister(this),this.onHideComplete()};return!e||!this.isAnimated()?(finalize(),this):(this._dismissing=!0,this.setWillChange(`opacity, transform`),this._hideAnimation?.cancel(),this._hideAnimation=i.play(e,{to:{opacity:`0`,transform:`translateY(-${this.getTranslatePx()}px)`},durationMs:this.getDurationMs(),properties:[`opacity`,`transform`],onComplete:()=>{if(!this._dismissing){this.setWillChange(null);return}this._dismissing=!1,this.setWillChange(null),finalize()}}),this)}onZIndexChanged(e){this.setZIndex(e)}isOpen(){return this._open}handleKey(e){return!1}placeAnchored(t){let n={width:this.getWidth(),height:this.getHeight()},r=e.source.getViewportSize(),{x:i,y:a}=o(t,n,r,{axis:`vertical`});return this.setX(i),this.setY(a),this}onShowComplete(){}onHideComplete(){}destructor(){this._showAnimation?.cancel(),this._showAnimation=null,this._hideAnimation?.cancel(),this._hideAnimation=null,a.unregister(this),super.destructor()}getLayerElement(){return this.getElement()??null}getDismissMode(){return`click-outside`}requestClose(){if(this._closeHandler){this._closeHandler();return}this.hideAnimated()}getAnchorElement(){return this._anchorElement}getBand(){return a.Band.Dropdown}setCloseHandler(e){return this._closeHandler=e,this}setAnchorElement(e){return this._anchorElement=e,this}};function fadeShow(e,t){let n=t?.durationMs??s,r=t?.translatePx??c,a=t?.animated??!0;l.set(e,!1);let o=e.getElement();return!o||!a?(t?.onComplete?.(),u):(e.setWillChange(`opacity, transform`),i.play(o,{from:{opacity:`0`,transform:`translateY(-${r}px)`},to:{opacity:`1`,transform:`translateY(0)`},durationMs:n,properties:[`opacity`,`transform`],onComplete:()=>{e.setWillChange(null),t?.onComplete?.()}}))}function fadeHideAndDetach(e,t){let n=t?.durationMs??s,r=t?.translatePx??c,a=t?.animated??!0,o=e.getElement(),finalize=()=>{e.setVisible(!1),e.removeElement(),t?.onComplete?.()};return!o||!a?(finalize(),u):(l.set(e,!0),e.setWillChange(`opacity, transform`),i.play(o,{to:{opacity:`0`,transform:`translateY(-${r}px)`},durationMs:n,properties:[`opacity`,`transform`],onComplete:()=>{if(!l.get(e)){e.setWillChange(null);return}l.set(e,!1),e.setWillChange(null),finalize()}}))}var f=n(AnimatedDropdown);export{fadeHideAndDetach as n,fadeShow as r,f as t};
2
- //# sourceMappingURL=AnimatedDropdown-kL47HPGP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnimatedDropdown-kL47HPGP.js","names":[],"sources":["../../src/typescript/lib/core/AnimatedDropdown.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Component, ComponentOptions } from \"~/core/Component.js\";\nimport { Animation } from \"~/core/Animation.js\";\nimport { Position } from \"~/primitive/Position.js\";\nimport { LayerManager, DismissableLayer, LayerDismissMode } from \"~/core/LayerManager.js\";\nimport { positionAnchored } from \"~/core/OverlayPosition.js\";\nimport { callable } from \"~/core/Callable.js\";\nimport { DOM, type Rect, type Handle } from \"~/core/DOM.js\";\n\n/** Default fade duration in milliseconds. Matches `MENU_ANIM_DURATION_MS` from `Menu`. */\nconst DEFAULT_DURATION_MS: number = 120;\n\n/** Default entrance vertical-offset distance in pixels. */\nconst DEFAULT_TRANSLATE_PX: number = 4;\n\n/**\n * Per-component `_dismissing` flag used by the free-function form\n * (`fadeShow` / `fadeHideAndDetach`). `WeakMap`-keyed so a `Component` that\n * never opts into the helper carries no extra state.\n */\nconst _dismissingByComponent: WeakMap<Component, boolean> = new WeakMap();\n\n/** Handle for the fade paths that finish before there is anything to cancel. */\nconst NOOP_HANDLE: Animation.CancelHandle = { cancel: (): void => {} };\n\n/**\n * Construction-time options for {@link AnimatedDropdown}.\n *\n * @category Core\n */\nexport interface AnimatedDropdownOptions extends ComponentOptions {\n /** When false, `showAnimated` / `hideAnimated` skip the transition. Default: true. */\n animated?: boolean;\n /** Fade duration in milliseconds. Default: 120. */\n durationMs?: number;\n /** Vertical translation distance in pixels for the entrance. Default: 4. */\n translatePx?: number;\n}\n\n/**\n * Options forwarded to the free-function forms `fadeShow` / `fadeHideAndDetach`.\n *\n * @category Core\n */\nexport interface FadeOptions {\n /** Fade duration in milliseconds. Default: 120. */\n durationMs?: number;\n /** Vertical translation distance in pixels for the entrance. Default: 4. */\n translatePx?: number;\n /** When false, the helper bypasses the transition and applies the end state synchronously. Default: true. */\n animated?: boolean;\n /** Called once the fade completes (or immediately when animation is disabled). */\n onComplete?: () => void;\n}\n\n/**\n * User-overridable visual defaults forwarded to `super` via the options bag.\n * These are a pure fallback: a caller value wins, otherwise the getters\n * (`isVisible`, `isAnimated`, `getDurationMs`, `getTranslatePx`) resolve the\n * default — `visible: false` is folded by `Component.isVisible`, the rest are\n * dispatched from `applyOptions` as `options.X ?? this.getX()`.\n */\nconst _defaultAnimatedDropdownOptions: Partial<AnimatedDropdownOptions> = {\n visible: false,\n animated: true,\n durationMs: DEFAULT_DURATION_MS,\n translatePx: DEFAULT_TRANSLATE_PX,\n};\n\n/**\n * Floating panel that fades in on `showAnimated` and fades out + detaches on\n * `hideAnimated`. Subclasses (e.g. picker dropdowns for `ComboBox`, `DateField`,\n * `TimeField`, `DateTimeField`) own the panel's interactive content; this base\n * class owns only the open/close lifecycle, the `opacity + translateY`\n * transition, the dismissing-flag re-entrancy guard, and the `will-change`\n * pre-promotion.\n *\n * Positioning math (anchor rect, viewport clamping, flip-above-anchor) lives\n * in the host component or in a subclass — `AnimatedDropdown` does not\n * presume anything about where it should appear.\n *\n * ## Pointer-down contract for hosts mounted under a re-used input element\n *\n * Hosts that compose this dropdown alongside a focusable element whose `blur`\n * commits state (e.g. [`CellEditorPool`](/api/component/table/classes/CellEditorPool)'s pooled editors) must call\n * `event.preventDefault()` on **`pointerdown`** inside the dropdown so the\n * host element keeps focus while the dropdown's selection callback runs. The\n * callback then explicitly drives commit. If the dropdown does not suppress\n * the blur, the editor's blur listener fires first, commits the stale value,\n * and the dropdown's later write goes to a no-longer-active editor.\n *\n * @category Core\n */\nclass AnimatedDropdown<TOptions extends AnimatedDropdownOptions = AnimatedDropdownOptions> extends Component<TOptions> implements DismissableLayer {\n\n // Set true while a fade-out is in flight; reset to false either when the\n // fade completes (so the deferred detach runs) or when a fresh `showAnimated`\n // re-displays the dropdown mid-fade (the deferred detach skips because the\n // dropdown is back on screen).\n private _dismissing: boolean = false;\n private _open: boolean = false;\n\n // Host-supplied close thunk invoked from `requestClose` instead of the\n // bare `hideAnimated`, so the host (a picker field, a ComboBox) can run\n // its own teardown (caret rotation, aria-expanded, commit) when the\n // manager dismisses the layer on an outside click. Null until a host\n // opts into the `\"click-outside\"` dismiss path.\n private _closeHandler: (() => void) | null = null;\n\n // Anchor element (the trigger) excluded from the manager's outside-click\n // test so the click that toggles the dropdown does not immediately\n // re-close it. Null for dropdowns whose host owns the toggle gating.\n private _anchorElement: Handle | null = null;\n\n // In-flight entrance / exit fades, cancelled on teardown so their fallback\n // timers cannot fire against this dropdown's released element handle.\n private _showAnimation: Animation.CancelHandle | null = null;\n private _hideAnimation: Animation.CancelHandle | null = null;\n\n /**\n * @param options - Optional construction-time options.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults. Subclasses-of-subclasses forward their own defaults\n * here so the deepest class's values win.\n */\n constructor(options?: AnimatedDropdownOptions, subclassDefaults?: Partial<AnimatedDropdownOptions>) {\n super(\n options as TOptions,\n { ..._defaultAnimatedDropdownOptions, ...(subclassDefaults ?? {}) } as Partial<TOptions>,\n );\n\n // Floating overlays anchor to the viewport, not to a layout-managed\n // ancestor — `Position.FIXED` is the documented exception to the\n // framework's \"every component is absolute\" rule. See\n // ARCHITECTURE.md §Positioning.\n this.setPosition(Position.FIXED);\n }\n\n /**\n * Applies an {@link AnimatedDropdownOptions} bag, dispatching dropdown-specific\n * fields after inherited Component fields.\n *\n * @param options - The options bag carrying the values to apply.\n */\n protected applyOptions(options: TOptions): this {\n super.applyOptions(options);\n\n // These carry a class default and seed construction-time state, so\n // always dispatch the caller value or the class default.\n this.setAnimated(options.animated ?? this.isAnimated());\n this.setDurationMs(options.durationMs ?? this.getDurationMs());\n this.setTranslatePx(options.translatePx ?? this.getTranslatePx());\n\n return this;\n }\n\n /**\n * Enables or disables the fade transition. When false, `showAnimated` /\n * `hideAnimated` apply visibility synchronously.\n *\n * @param value - true to enable the fade; false for instant show/hide.\n */\n setAnimated(value: boolean): this {\n this._options.animated = value;\n\n return this;\n }\n\n /**\n * Returns whether the fade transition is enabled.\n *\n * @returns true when the fade transition runs on show/hide.\n */\n isAnimated(): boolean {\n return this._options.animated ?? this._defaultOptions.animated!;\n }\n\n /**\n * Sets the fade duration in milliseconds.\n *\n * @param ms - Duration in milliseconds.\n */\n setDurationMs(ms: number): this {\n this._options.durationMs = ms;\n\n return this;\n }\n\n /**\n * Returns the configured fade duration in milliseconds.\n *\n * @returns The duration in milliseconds.\n */\n getDurationMs(): number {\n return this._options.durationMs ?? this._defaultOptions.durationMs!;\n }\n\n /**\n * Sets the entrance vertical-offset distance in pixels.\n *\n * @param px - Translation distance in pixels.\n */\n setTranslatePx(px: number): this {\n this._options.translatePx = px;\n\n return this;\n }\n\n /**\n * Returns the configured entrance vertical-offset distance.\n *\n * @returns The translation distance in pixels.\n */\n getTranslatePx(): number {\n return this._options.translatePx ?? this._defaultOptions.translatePx!;\n }\n\n /**\n * Mounts the dropdown on `document.documentElement` (if not already mounted)\n * and plays the entrance fade. Cancels any in-flight fade-out so a fresh\n * show mid-dismiss keeps the panel on screen.\n */\n showAnimated(): this {\n // Register on the central layer tree. `LayerManager.register` is a\n // no-op when this layer is already registered (a `_dismissing`-\n // cancelled mid-fade re-show), so the tree never double-pushes.\n LayerManager.register(this);\n\n // Mirror the manager's band-based z-stamp onto the element so the\n // dropdown lands above its opener (which registered earlier).\n this.setZIndex(LayerManager.getZIndex(this));\n\n this._dismissing = false;\n this._open = true;\n\n const el = this.getElement(true)!;\n\n LayerManager.mount(el);\n\n this.setVisible(true);\n\n if (!this.isAnimated()) {\n this.onShowComplete();\n return this;\n }\n\n this.setWillChange(\"opacity, transform\");\n\n this._showAnimation?.cancel();\n this._showAnimation = Animation.play(el, {\n from: { opacity: \"0\", transform: `translateY(-${this.getTranslatePx()}px)` },\n to: { opacity: \"1\", transform: \"translateY(0)\" },\n durationMs: this.getDurationMs(),\n properties: [\"opacity\", \"transform\"],\n onComplete: () => {\n this.setWillChange(null);\n this.onShowComplete();\n },\n });\n\n return this;\n }\n\n /**\n * Plays the exit fade, then hides and detaches the dropdown when the\n * transition completes. A fresh `showAnimated` during the fade cancels the\n * deferred detach by flipping the `_dismissing` flag, so the panel stays\n * mounted.\n */\n hideAnimated(): this {\n this._open = false;\n\n const el = this.getElement();\n const finalize = (): void => {\n this.setVisible(false);\n this.removeElement();\n\n // Pop from the central layer tree. `onHideComplete` runs after\n // this so a subclass override sees the layer as already-closed.\n LayerManager.unregister(this);\n\n this.onHideComplete();\n };\n\n if (!el || !this.isAnimated()) {\n finalize();\n return this;\n }\n\n this._dismissing = true;\n this.setWillChange(\"opacity, transform\");\n\n this._hideAnimation?.cancel();\n this._hideAnimation = Animation.play(el, {\n to: { opacity: \"0\", transform: `translateY(-${this.getTranslatePx()}px)` },\n durationMs: this.getDurationMs(),\n properties: [\"opacity\", \"transform\"],\n onComplete: () => {\n if (!this._dismissing) {\n this.setWillChange(null);\n return;\n }\n this._dismissing = false;\n this.setWillChange(null);\n finalize();\n },\n });\n\n return this;\n }\n\n /**\n * Mirrors a manager-allocated z-index onto the element when the dropdown —\n * or the window / surface it was opened inside — is raised via\n * {@link LayerManager.bringToFront}. Without this, the dropdown reads its\n * z once in {@link showAnimated} and never updates; raising its host window\n * (a `mousedown` brings the window to front) would then re-stamp the host\n * above the dropdown's stale z, hiding the open panel — and its fade-out —\n * behind the window.\n *\n * @param zIndex - The fresh z-index assigned by the manager.\n */\n onZIndexChanged(zIndex: number): void {\n this.setZIndex(zIndex);\n }\n\n /**\n * Returns whether the dropdown is currently open (showing or fading in).\n *\n * @returns true when the dropdown is open.\n */\n isOpen(): boolean {\n return this._open;\n }\n\n /**\n * Subclass hook: handle a keystroke arriving via the host input's `keydown`\n * listener while the dropdown is open. Subclasses with a navigation surface\n * (e.g. [`DatePickerDropdown`](/api/component/input/classes/DatePickerDropdown))\n * override to consume arrows / Page / Home / End / type-ahead. The base\n * implementation returns `false` so plain dropdowns without keyboard\n * semantics let the host input's contract run.\n *\n * @param _e - The keyboard event forwarded from the host input.\n * @returns True when the dropdown consumed the keystroke (caller should `preventDefault`).\n */\n handleKey(_e: KeyboardEvent): boolean {\n return false;\n }\n\n /**\n * Places the dropdown relative to an anchor rect at its current\n * width/height. Picks the better of \"below\" or \"above\" the anchor\n * vertically (more available space wins when neither side fully fits).\n * Horizontally the panel left-aligns to the anchor, flipping to\n * right-align with the anchor's right edge when the left alignment\n * would overflow the viewport, and clamping only when neither alignment\n * fits.\n *\n * Callers set `setWidth`/`setHeight` first, then invoke this helper.\n *\n * @param rect - The anchor element's bounding rect (typically from\n * `DOM.source.getElementRect(anchorEl)`).\n */\n placeAnchored(rect: Rect): this {\n const size = { width: this.getWidth(), height: this.getHeight() };\n const vp = DOM.source.getViewportSize();\n\n // Vertical growth: prefer below, flip above when below overflows and\n // above has room. Horizontally: align to the anchor's left, flip to\n // its right when that overflows, clamp only as a last resort. The\n // flip/align/clamp geometry lives in the shared pure primitive.\n const { x, y } = positionAnchored(rect, size, vp, { axis: \"vertical\" });\n\n this.setX(x);\n this.setY(y);\n\n return this;\n }\n\n /**\n * Hook invoked after the entrance fade completes (or immediately when\n * animation is disabled). Override to wire post-show state.\n */\n protected onShowComplete(): void {\n // default: no-op\n }\n\n /**\n * Hook invoked after the exit fade completes (or immediately when\n * animation is disabled). Override to wire post-hide cleanup.\n */\n protected onHideComplete(): void {\n // default: no-op\n }\n\n /**\n * Cancels any in-flight entrance / exit fade, then defers to the base\n * class. Cancelling first keeps the fade's fallback timer from firing after\n * `super.destructor()` has released this dropdown's element handle.\n */\n protected destructor(): void {\n this._showAnimation?.cancel();\n this._showAnimation = null;\n this._hideAnimation?.cancel();\n this._hideAnimation = null;\n\n // `hideAnimated`'s completion callback is the only place the dropdown\n // leaves the layer tree, and cancelling above suppressed it. A layer\n // left registered is walked on the next document pointerdown, where the\n // containment test resolves the element handle released below — the\n // very use-after-free this cancellation exists to prevent. Idempotent,\n // so the already-unregistered cases cost nothing.\n LayerManager.unregister(this);\n\n super.destructor();\n }\n\n // ----- DismissableLayer -----\n\n /**\n * Returns the dropdown's root element for the central layer tree.\n *\n * @returns The dropdown's element, or null when not yet rendered.\n */\n getLayerElement(): Handle | null {\n return this.getElement() ?? null;\n }\n\n /**\n * Returns the dismiss mode the document-level handlers consult. The\n * dropdown is `\"click-outside\"`: the manager closes it when a\n * `pointerdown` lands outside both the dropdown's layer subtree and its\n * anchor. A click inside a descendant layer counts as inside, so a nested\n * dropdown keeps its opener open.\n *\n * @returns The layer dismiss mode.\n */\n getDismissMode(): LayerDismissMode {\n return \"click-outside\";\n }\n\n /**\n * Advisory close request from the manager. Runs the host-supplied close\n * thunk when one is set (so the host can rotate a caret, clear\n * aria-expanded, or commit), otherwise the standard exit fade + detach.\n */\n requestClose(): void {\n if (this._closeHandler) {\n this._closeHandler();\n\n return;\n }\n\n this.hideAnimated();\n }\n\n /**\n * Returns the anchor element excluded from the manager's outside-click\n * test, or null when the host gates the toggle itself.\n *\n * @returns The anchor element, or null.\n */\n getAnchorElement(): Handle | null {\n return this._anchorElement;\n }\n\n /**\n * Returns the dropdown's z-index band so an unrelated top-level dropdown\n * stacks in the dropdown family.\n *\n * @returns The dropdown band base.\n */\n getBand(): number {\n return LayerManager.Band.Dropdown;\n }\n\n /**\n * Installs the close thunk the manager calls from {@link requestClose}\n * when this dropdown is dismissed by an outside click. The host passes its\n * own close routine so the dropdown's teardown and the host's UI state\n * (caret, aria-expanded, commit) stay in lockstep.\n *\n * @param handler - The host's close routine, or null to fall back to\n * {@link hideAnimated}.\n * @returns This dropdown, for method chaining.\n */\n setCloseHandler(handler: (() => void) | null): this {\n this._closeHandler = handler;\n\n return this;\n }\n\n /**\n * Records the anchor (trigger) element excluded from the manager's\n * outside-click test, so the gesture that opened the dropdown does not\n * immediately re-close it.\n *\n * @param el - The anchor element, or null to clear it.\n * @returns This dropdown, for method chaining.\n */\n setAnchorElement(el: Handle | null): this {\n this._anchorElement = el;\n\n return this;\n }\n\n}\n\n/**\n * Plays the standard dropdown-style entrance fade on the given component's\n * element. Mirror of {@link AnimatedDropdown.showAnimated} for components that\n * extend `Component` directly and cannot re-parent to `AnimatedDropdown`.\n *\n * Cancels any in-flight fade-out queued by {@link fadeHideAndDetach} so a\n * fresh show mid-dismiss keeps the panel on screen.\n *\n * @param component - The component to fade in.\n * @param options - Optional duration / translate / animated overrides.\n * @returns A handle the caller stores and cancels on its own teardown.\n */\nexport function fadeShow(component: Component, options?: FadeOptions): Animation.CancelHandle {\n const durationMs = options?.durationMs ?? DEFAULT_DURATION_MS;\n const translatePx = options?.translatePx ?? DEFAULT_TRANSLATE_PX;\n const animated = options?.animated ?? true;\n\n _dismissingByComponent.set(component, false);\n\n const el = component.getElement();\n\n if (!el) {\n options?.onComplete?.();\n return NOOP_HANDLE;\n }\n\n if (!animated) {\n options?.onComplete?.();\n return NOOP_HANDLE;\n }\n\n component.setWillChange(\"opacity, transform\");\n\n return Animation.play(el, {\n from: { opacity: \"0\", transform: `translateY(-${translatePx}px)` },\n to: { opacity: \"1\", transform: \"translateY(0)\" },\n durationMs: durationMs,\n properties: [\"opacity\", \"transform\"],\n onComplete: () => {\n component.setWillChange(null);\n options?.onComplete?.();\n },\n });\n}\n\n/**\n * Plays the standard dropdown-style exit fade on the given component's\n * element, then hides and detaches it from the DOM when the transition\n * completes.\n *\n * A fresh {@link fadeShow} during the fade cancels the deferred detach so the\n * panel stays mounted.\n *\n * @param component - The component to fade out and detach.\n * @param options - Optional duration / translate / animated overrides; `onComplete` fires after detach.\n * @returns A handle the caller stores and cancels on its own teardown.\n */\nexport function fadeHideAndDetach(component: Component, options?: FadeOptions): Animation.CancelHandle {\n const durationMs = options?.durationMs ?? DEFAULT_DURATION_MS;\n const translatePx = options?.translatePx ?? DEFAULT_TRANSLATE_PX;\n const animated = options?.animated ?? true;\n\n const el = component.getElement();\n const finalize = (): void => {\n component.setVisible(false);\n component.removeElement();\n options?.onComplete?.();\n };\n\n if (!el || !animated) {\n finalize();\n return NOOP_HANDLE;\n }\n\n _dismissingByComponent.set(component, true);\n component.setWillChange(\"opacity, transform\");\n\n return Animation.play(el, {\n to: { opacity: \"0\", transform: `translateY(-${translatePx}px)` },\n durationMs: durationMs,\n properties: [\"opacity\", \"transform\"],\n onComplete: () => {\n if (!_dismissingByComponent.get(component)) {\n component.setWillChange(null);\n return;\n }\n _dismissingByComponent.set(component, false);\n component.setWillChange(null);\n finalize();\n },\n });\n}\n\nconst AnimatedDropdownCallable = callable(AnimatedDropdown);\ntype AnimatedDropdownCallable<TOptions extends AnimatedDropdownOptions = AnimatedDropdownOptions> = AnimatedDropdown<TOptions>;\nexport {\n AnimatedDropdown as _AnimatedDropdown,\n AnimatedDropdownCallable as AnimatedDropdown\n};\n"],"mappings":"kLAWA,IAAM,EAA8B,IAG9B,EAA+B,EAO/B,EAAsD,IAAI,QAG1D,EAAsC,CAAE,WAAoB,CAAC,CAAE,EAuC/D,EAAoE,CACtE,QAAa,GACb,SAAa,GACb,WAAa,EACb,YAAa,CACjB,EA0BM,iBAAN,cAAmG,CAAgD,CAM/I,YAAgC,GAChC,MAAgC,GAOhC,cAA6C,KAK7C,eAAwC,KAIxC,eAAwD,KACxD,eAAwD,KAQxD,YAAY,EAAmC,EAAqD,CAChG,MACI,EACA,CAAE,GAAG,EAAiC,GAAI,GAAoB,CAAC,CAAG,CACtE,EAMA,KAAK,YAAY,EAAS,KAAK,CACnC,CAQA,aAAuB,EAAyB,CAS5C,OARA,MAAM,aAAa,CAAO,EAI1B,KAAK,YAAY,EAAQ,UAAY,KAAK,WAAW,CAAC,EACtD,KAAK,cAAc,EAAQ,YAAc,KAAK,cAAc,CAAC,EAC7D,KAAK,eAAe,EAAQ,aAAe,KAAK,eAAe,CAAC,EAEzD,IACX,CAQA,YAAY,EAAsB,CAG9B,MAFA,MAAK,SAAS,SAAW,EAElB,IACX,CAOA,YAAsB,CAClB,OAAO,KAAK,SAAS,UAAY,KAAK,gBAAgB,QAC1D,CAOA,cAAc,EAAkB,CAG5B,MAFA,MAAK,SAAS,WAAa,EAEpB,IACX,CAOA,eAAwB,CACpB,OAAO,KAAK,SAAS,YAAc,KAAK,gBAAgB,UAC5D,CAOA,eAAe,EAAkB,CAG7B,MAFA,MAAK,SAAS,YAAc,EAErB,IACX,CAOA,gBAAyB,CACrB,OAAO,KAAK,SAAS,aAAe,KAAK,gBAAgB,WAC7D,CAOA,cAAqB,CAIjB,EAAa,SAAS,IAAI,EAI1B,KAAK,UAAU,EAAa,UAAU,IAAI,CAAC,EAE3C,KAAK,YAAc,GACnB,KAAK,MAAc,GAEnB,IAAM,EAAK,KAAK,WAAW,EAAI,EAyB/B,OAvBA,EAAa,MAAM,CAAE,EAErB,KAAK,WAAW,EAAI,EAEf,KAAK,WAAW,GAKrB,KAAK,cAAc,oBAAoB,EAEvC,KAAK,gBAAgB,OAAO,EAC5B,KAAK,eAAiB,EAAU,KAAK,EAAI,CACrC,KAAY,CAAE,QAAS,IAAK,UAAW,eAAe,KAAK,eAAe,EAAE,IAAK,EACjF,GAAY,CAAE,QAAS,IAAK,UAAW,eAAgB,EACvD,WAAY,KAAK,cAAc,EAC/B,WAAY,CAAC,UAAW,WAAW,EACnC,eAAkB,CACd,KAAK,cAAc,IAAI,EACvB,KAAK,eAAe,CACxB,CACJ,CAAC,EAEM,OAlBH,KAAK,eAAe,EACb,KAkBf,CAQA,cAAqB,CACjB,KAAK,MAAQ,GAEb,IAAM,EAAK,KAAK,WAAW,EACrB,aAAuB,CACzB,KAAK,WAAW,EAAK,EACrB,KAAK,cAAc,EAInB,EAAa,WAAW,IAAI,EAE5B,KAAK,eAAe,CACxB,EA0BA,MAxBI,CAAC,GAAM,CAAC,KAAK,WAAW,GACxB,SAAS,EACF,OAGX,KAAK,YAAc,GACnB,KAAK,cAAc,oBAAoB,EAEvC,KAAK,gBAAgB,OAAO,EAC5B,KAAK,eAAiB,EAAU,KAAK,EAAI,CACrC,GAAY,CAAE,QAAS,IAAK,UAAW,eAAe,KAAK,eAAe,EAAE,IAAK,EACjF,WAAY,KAAK,cAAc,EAC/B,WAAY,CAAC,UAAW,WAAW,EACnC,eAAkB,CACd,GAAI,CAAC,KAAK,YAAa,CACnB,KAAK,cAAc,IAAI,EACvB,MACJ,CACA,KAAK,YAAc,GACnB,KAAK,cAAc,IAAI,EACvB,SAAS,CACb,CACJ,CAAC,EAEM,KACX,CAaA,gBAAgB,EAAsB,CAClC,KAAK,UAAU,CAAM,CACzB,CAOA,QAAkB,CACd,OAAO,KAAK,KAChB,CAaA,UAAU,EAA4B,CAClC,MAAO,EACX,CAgBA,cAAc,EAAkB,CAC5B,IAAM,EAAO,CAAE,MAAO,KAAK,SAAS,EAAG,OAAQ,KAAK,UAAU,CAAE,EAC1D,EAAO,EAAI,OAAO,gBAAgB,EAMlC,CAAE,IAAG,KAAM,EAAiB,EAAM,EAAM,EAAI,CAAE,KAAM,UAAW,CAAC,EAKtE,OAHA,KAAK,KAAK,CAAC,EACX,KAAK,KAAK,CAAC,EAEJ,IACX,CAMA,gBAAiC,CAEjC,CAMA,gBAAiC,CAEjC,CAOA,YAA6B,CACzB,KAAK,gBAAgB,OAAO,EAC5B,KAAK,eAAiB,KACtB,KAAK,gBAAgB,OAAO,EAC5B,KAAK,eAAiB,KAQtB,EAAa,WAAW,IAAI,EAE5B,MAAM,WAAW,CACrB,CASA,iBAAiC,CAC7B,OAAO,KAAK,WAAW,GAAK,IAChC,CAWA,gBAAmC,CAC/B,MAAO,eACX,CAOA,cAAqB,CACjB,GAAI,KAAK,cAAe,CACpB,KAAK,cAAc,EAEnB,MACJ,CAEA,KAAK,aAAa,CACtB,CAQA,kBAAkC,CAC9B,OAAO,KAAK,cAChB,CAQA,SAAkB,CACd,OAAO,EAAa,KAAK,QAC7B,CAYA,gBAAgB,EAAoC,CAGhD,MAFA,MAAK,cAAgB,EAEd,IACX,CAUA,iBAAiB,EAAyB,CAGtC,MAFA,MAAK,eAAiB,EAEf,IACX,CAEJ,EAcA,SAAgB,SAAS,EAAsB,EAA+C,CAC1F,IAAM,EAAc,GAAS,YAAe,EACtC,EAAc,GAAS,aAAe,EACtC,EAAc,GAAS,UAAe,GAE5C,EAAuB,IAAI,EAAW,EAAK,EAE3C,IAAM,EAAK,EAAU,WAAW,EAchC,MAZI,CAAC,GAKD,CAAC,GACD,GAAS,aAAa,EACf,IAGX,EAAU,cAAc,oBAAoB,EAErC,EAAU,KAAK,EAAI,CACtB,KAAY,CAAE,QAAS,IAAK,UAAW,eAAe,EAAY,IAAK,EACvE,GAAY,CAAE,QAAS,IAAK,UAAW,eAAgB,EAC3C,aACZ,WAAY,CAAC,UAAW,WAAW,EACnC,eAAkB,CACd,EAAU,cAAc,IAAI,EAC5B,GAAS,aAAa,CAC1B,CACJ,CAAC,EACL,CAcA,SAAgB,kBAAkB,EAAsB,EAA+C,CACnG,IAAM,EAAc,GAAS,YAAe,EACtC,EAAc,GAAS,aAAe,EACtC,EAAc,GAAS,UAAe,GAEtC,EAAK,EAAU,WAAW,EAC1B,aAAuB,CACzB,EAAU,WAAW,EAAK,EAC1B,EAAU,cAAc,EACxB,GAAS,aAAa,CAC1B,EAUA,MARI,CAAC,GAAM,CAAC,GACR,SAAS,EACF,IAGX,EAAuB,IAAI,EAAW,EAAI,EAC1C,EAAU,cAAc,oBAAoB,EAErC,EAAU,KAAK,EAAI,CACtB,GAAY,CAAE,QAAS,IAAK,UAAW,eAAe,EAAY,IAAK,EAC3D,aACZ,WAAY,CAAC,UAAW,WAAW,EACnC,eAAkB,CACd,GAAI,CAAC,EAAuB,IAAI,CAAS,EAAG,CACxC,EAAU,cAAc,IAAI,EAC5B,MACJ,CACA,EAAuB,IAAI,EAAW,EAAK,EAC3C,EAAU,cAAc,IAAI,EAC5B,SAAS,CACb,CACJ,CAAC,EACL,CAEA,IAAM,EAA2B,EAAS,gBAAgB"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./DOM-Ba8YRVel.js";import{a as t,s as n}from"./Position-PBVBW1JS.js";import{S as r,b as i,f as a,h as o,m as s,t as c,v as l}from"./Component-w65rPK75.js";import{t as u}from"./ListenerBag-WPdKuuds.js";import{t as d}from"./Tooltip-B_UF5bXD.js";import{t as f}from"./Placement-7kqdaK4Z.js";import{t as p}from"./LayoutConstraints-LIHYYd2F.js";function beginPointerDrag(t){e.sink.apply(e.source.getBody(),{style:{pointerEvents:`none`}}),e.sink.apply(e.source.getDocumentElement(),{style:{cursor:t}})}function endPointerDrag(){e.sink.apply(e.source.getBody(),{style:{pointerEvents:``}}),e.sink.apply(e.source.getDocumentElement(),{style:{cursor:``}})}var m=200,h=`cubic-bezier(0.4, 0, 0.6, 1)`,g={cancel:()=>{}};function track(e,t){let n=null,r=!1,prune=()=>{r=!0;let t=n===null?-1:e.indexOf(n);t>=0&&e.splice(t,1)},{handle:i,cleanup:a}=t(prune);r||(n={cancel:()=>i.cancel(),settle:()=>{i.cancel(),a()}},e.push(n))}function primeCollapse(e,t,n,r,i){let cleanup=()=>{for(let e of n)e.setTransition(null);e.setWillChange(null)};if(l.isReducedMotion())return r(),{handle:g,cleanup};let a=t.map(e=>`${e} ${m}ms ${h}`).join(`, `);for(let e of n)e.setTransition(a);return e.setWillChange(t.join(`, `)),{handle:l.afterTransition({component:e,property:i??t[0],durationMs:m,fallbackBufferMs:40,onComplete:()=>{cleanup(),r()}}),cleanup}}function captureRect(e){return{x:e.getX(),y:e.getY(),width:e.getWidth(),height:e.getHeight()}}function parseCubicBezier(e){let t=e.match(/cubic-bezier\(([^)]+)\)/);if(!t)return e=>e;let[n,r,i,a]=t[1].split(`,`).map(e=>parseFloat(e)),o=3*n,s=3*(i-n)-o,c=1-o-s,l=3*r,u=3*(a-r)-l,d=1-l-u,sampleX=e=>((c*e+s)*e+o)*e,sampleY=e=>((d*e+u)*e+l)*e,sampleDX=e=>(3*c*e+2*s)*e+o;return e=>{let t=e;for(let n=0;n<8;n+=1){let n=sampleX(t)-e;if(Math.abs(n)<1e-6)return sampleY(t);let r=sampleDX(t);if(Math.abs(r)<1e-6)break;t-=n/r}let n=0,r=1;for(t=e;n<r;){let i=sampleX(t);if(Math.abs(i-e)<1e-6)break;i<e?n=t:r=t,t=(n+r)/2}return sampleY(t)}}var _=parseCubicBezier(h),lerp=(e,t,n)=>e+(t-e)*n,lerpRect=(e,t,n)=>({x:lerp(e.x,t.x,n),y:lerp(e.y,t.y,n),width:lerp(e.width,t.width,n),height:lerp(e.height,t.height,n)});function commitRect(e,t,n){e.setAutoCommitStyle(!1),e.setX(t.x),e.setY(t.y),e.setWidth(t.width),e.setHeight(t.height),n&&e.doLayout(),e.setAutoCommitStyle(!0)}function animateLayout(t,n){if(l.isReducedMotion()){for(let e of t)commitRect(e.component,e.end,e.relayout);return n?.(),()=>{}}let r=!1,i=0;for(let e of t)commitRect(e.component,e.start,e.relayout);let a=performance.now(),frame=o=>{if(r)return;let s=Math.min(1,(o-a)/m),c=_(s);for(let e of t)commitRect(e.component,s>=1?e.end:lerpRect(e.start,e.end,c),e.relayout);s<1?i=e.sink.requestAnimationFrame(frame):n?.()};return i=e.sink.requestAnimationFrame(frame),()=>{r=!0,i&&e.sink.cancelAnimationFrame(i)}}function runCollapse(e,t,n,r,i,a){r?.(),track(i,e=>primeCollapse(t,[`clip-path`],[t],e,`clip-path`));let o=n.filter(e=>!e.relayout).map(e=>e.component);o.length>0&&track(i,e=>primeCollapse(o[0],[`background-color`],o,e,`background-color`));let s=n.map(e=>captureRect(e.component));return e.doLayout(),animateLayout(n.map((e,t)=>({component:e.component,relayout:e.relayout,start:s[t],end:captureRect(e.component)})),a)}var v=10,y=40,b={east:0,south:90,west:180,north:-90},x=null;function ensureCollapseButtonClassRule(){x||=new i({scope:`class`,name:`CollapseButton`,styles:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,boxSizing:`border-box`,width:`${v}px`,height:`${y}px`,borderRadius:`2px`,background:`var(--ts-ui-button-bg, #e8e8e8)`,border:`1px solid var(--ts-ui-button-border, #c8c8c8)`,boxShadow:`var(--ts-ui-button-shadow, 0 1px 2px rgba(0, 0, 0, 0.2))`,textAlign:`center`,fontSize:`9px`,lineHeight:`38px`,color:`var(--ts-ui-collapse-button-color, rgb(100,100,100))`,pointerEvents:`auto`,userSelect:`none`}})}var CollapseButton=class extends c{_listeners=new u;constructor(e){ensureCollapseButtonClassRule(),super({tag:`span`,cursor:`pointer`,...e??{}}),this._direction??=`east`,this.applyRotation(),this.applyListeners(e?.listeners),r.addListener(this,`dblclick`,this.onDoubleClick),r.addListener(this,`mousedown`,this.onMouseDown)}applyOptions(e){return super.applyOptions(e),e.direction!==void 0&&this.setDirection(e.direction),this}render(){let t=super.render();return e.sink.apply(t,{text:`▶`}),t}applyRotation(){let e=b[this._direction];this.createStyleRule(``).set(`transform`,`translate(-50%, -50%) rotate(${e}deg)`)}setStripMode(e){return this.createStyleRule(``).set(`width`,`${e?18:v}px`),this}getDirection(){return this._direction}setDirection(e){return this._direction=e,this.applyRotation(),this}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e){this._listeners.fire(e)}onDoubleClick(e){return this.emit(`collapse`),!0}onMouseDown(e){return!0}},S=o(CollapseButton),C={west:`east`,east:`west`,north:`south`,south:`north`},w={orientation:`horizontal`,collapsible:!0,movable:!0},SplitGutter=class extends c{_opaque=!1;_collapseDirection=`west`;_expandedBackground=`var(--ts-ui-gutter-bg, #AAAAAA)`;_tooltipText=``;_listeners=new u;constructor(e,t,n){super(t,{...w,...n??{}}),e&&t?.orientation===void 0&&(this._direction=e),this._expandedBackground=t?.expandedBackground??`var(--ts-ui-gutter-bg, #AAAAAA)`,this.setBackgroundColor(this._expandedBackground),this._collapseDirection=t?.collapseDirection??(this._direction===`horizontal`?`west`:`north`),this._collapseButton=new S({direction:this._collapseDirection,listeners:{collapse:()=>this.emit(`collapse`)}}),this._collapseButton.setVisible(this._collapsible),t?.opaque&&this.setOpaque(!0),this._movable||this.setPointerEvents(`none`),this._movable&&r.addListener(this,`mousedown`,this.onDragStart),this.applyListeners(t?.listeners),this.updateTooltip()}init(t){super.init(t);let n=t||this.getElement();return n&&e.sink.appendChild(n,this._collapseButton.getElement(!0)),this}isCollapsible(){return this._collapsible??this._defaultOptions.collapsible}setCollapsible(e){return this._collapsible=e,this._collapseButton?.setVisible(e),this._collapseButton&&this.updateTooltip(),this}applyOptions(e){return super.applyOptions(e),this.setDirection(e.orientation??this.getDirection()),this.setCollapsible(e.collapsible??this.isCollapsible()),this.setMovable(e.movable??this.isMovable()),this}isMovable(){return this._movable??this._defaultOptions.movable}setMovable(e){return this._movable=e,this}isOpaque(){return this._opaque}setOpaque(e){return this._opaque=e,e?(this.setBackgroundColor(`var(--ts-ui-button-bg, #e8e8e8)`),this.setBackgroundImage(`var(--ts-ui-button-bg, linear-gradient(rgb(241, 241, 241), rgb(200, 200, 200)))`),this.setBorder(`1px solid var(--ts-ui-button-border, #c8c8c8)`),this._collapseButton?.setDirection(C[this._collapseDirection])):(this.clearBackgroundImage(),this.clearBorder(),this.setBackgroundColor(this._expandedBackground),this._collapseButton?.setDirection(this._collapseDirection)),this._collapseButton?.setStripMode(e),this.applyCursor(),this.updateTooltip(),this}getCollapseDirection(){return this._collapseDirection}setCollapseDirection(e){return this._collapseDirection=e,this._collapseButton?.setDirection(this._opaque?C[e]:e),this.updateTooltip(),this}updateTooltip(){if(!this._collapsible){this._tooltipText!==``&&(d.detach(this),this._collapseButton&&d.detach(this._collapseButton),this._tooltipText=``);return}let e=`Double-click to ${this._opaque?`expand`:`collapse`} ${this._opaque?C[this._collapseDirection]:this._collapseDirection}ward`;e!==this._tooltipText&&(this._tooltipText=e,d.attach(this,e),this._collapseButton&&d.attach(this._collapseButton,e))}getDirection(){return this._direction??this._defaultOptions.orientation}setDirection(e){return e||=`horizontal`,this._direction=e,this}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}destructor(){this._collapseButton?.dispose(),super.destructor()}_dispatchDrag(e){this.emit(`drag`,e)}onDragStart(e){if(this._opaque)return;let t=this._direction===`horizontal`?e.clientX:e.clientY;this.emit(`dragstart`,t),r.addViewportListener(this,`mouseup`,this.onDragStop),r.addViewportListener(this,`touchend`,this.onDragStop),r.addViewportListener(this,`touchcancel`,this.onDragStop),r.addViewportListener(this,`mousemove`,this.onDrag),r.addViewportListener(this,`touchmove`,this.onDrag),beginPointerDrag(this.dragCursor())}onDragStop(){return r.removeViewportListener(this,`mouseup`,this.onDragStop),r.removeViewportListener(this,`touchend`,this.onDragStop),r.removeViewportListener(this,`touchcancel`,this.onDragStop),r.removeViewportListener(this,`mousemove`,this.onDrag),r.removeViewportListener(this,`touchmove`,this.onDrag),endPointerDrag(),this.emit(`dragend`),!0}onDrag(e){let t;return t=this._direction===`horizontal`?e.clientX:e.clientY,this._dispatchDrag(t),!0}dragCursor(){return this._direction==`horizontal`?`ew-resize`:`ns-resize`}applyCursor(){this._movable&&!this._opaque?this.setCursor(this.dragCursor()):this.setCursor(`default`)}render(){let e=super.render();return this.applyCursor(),e}},T=o(SplitGutter),E=4,D={[f.NORTH]:`north`,[f.SOUTH]:`south`,[f.WEST]:`west`,[f.EAST]:`east`},Border=class extends a{_northComponent=null;_southComponent=null;_westComponent=null;_eastComponent=null;_centerComponent=null;_spacing=5;_collapsed=new Map;_collapsible=new Map;_gutters=new Map;_collapseAnimation=null;_pendingCollapseTransitions=[];_collapsing=!1;constructor(e){super(),e&&this.applyOptions(e)}applyOptions(e){super.applyOptions(e),e.spacing!==void 0&&this.setComponentSpacing(e.spacing)}setLayoutConstraints(e,t){switch(t||(t=new p,t.placement=f.CENTER),t.placement||(t.placement=f.CENTER),t.placement){case f.NORTH:this._northComponent=e;break;case f.SOUTH:this._southComponent=e;break;case f.WEST:this._westComponent=e;break;case f.EAST:this._eastComponent=e;break;case f.CENTER:this._centerComponent=e}return t.placement===f.CENTER?this._collapsible.set(f.CENTER,!1):this._collapsible.set(t.placement,t.collapsible??!1),super.setLayoutConstraints(e,t)}delLayoutConstraints(e){return this._northComponent===e?this._northComponent=null:this._southComponent===e?this._southComponent=null:this._westComponent===e?this._westComponent=null:this._eastComponent===e?this._eastComponent=null:this._centerComponent===e&&(this._centerComponent=null),super.delLayoutConstraints(e)}getComponentSpacing(){return this._spacing}setComponentSpacing(e){return this._spacing=e,this}getRegionComponent(e){switch(e){case f.NORTH:return this._northComponent;case f.SOUTH:return this._southComponent;case f.WEST:return this._westComponent;case f.EAST:return this._eastComponent;case f.CENTER:return this._centerComponent}}isRegionCollapsed(e){return this._collapsed.get(e)??!1}setRegionCollapsed(e,t){if(e===f.CENTER||!this.isRegionCollapsible(e))return this;let n=this.getRegionComponent(e);if(!n||(this._collapsed.get(e)??!1)===t)return this;let r=this.getContainer();if(!r)return this;let i=this._collapsing;this._collapsing=!0,i||r.doLayout(),this._collapsed.set(e,t),this.ensureGutter(e);let a=[...[this._northComponent,this._southComponent,this._westComponent,this._eastComponent,this._centerComponent].filter(e=>e!=null).map(e=>({component:e,relayout:!0})),...[...this._gutters.values()].map(e=>({component:e,relayout:!1}))];return this._collapseAnimation=runCollapse(r,n,a,this._collapseAnimation,this._pendingCollapseTransitions,()=>{this._collapseAnimation=null,this._collapsing=!1,r.doLayout()}),this}isRegionCollapsible(e){return e===f.CENTER?!1:this._collapsible.get(e)??!1}setRegionCollapsible(e,t){return e===f.CENTER?this:(this._collapsible.set(e,t),this.getContainer()?.scheduleLayout(),this)}ensureGutter(t){let n=this._gutters.get(t);if(n)return n;let r=this.getContainer();return n=new T(t===f.NORTH||t===f.SOUTH?`vertical`:`horizontal`,{movable:!1,opaque:!1,collapseDirection:D[t],expandedBackground:`transparent`,listeners:{collapse:()=>this.setRegionCollapsed(t,!this.isRegionCollapsed(t))}}),n.setVisible(!1),e.sink.appendChild(r.getElement(),n.getElement(!0)),this._gutters.set(t,n),n}regionExtent(e,t){return this.isRegionCollapsed(e)?18:t}flooredMainExtent(e,t,n){let r=t?n?t.height:t.width:0;return Math.max(e,r)}applyRegionClip(e,t){if(this.isRegionCollapsible(t)){if(!this.isRegionCollapsed(t)){e.setClipPath(`inset(0 0 0 0)`);return}switch(t){case f.WEST:e.setClipPath(`inset(0 100% 0 0)`);break;case f.EAST:e.setClipPath(`inset(0 0 0 100%)`);break;case f.NORTH:e.setClipPath(`inset(0 0 100% 0)`);break;case f.SOUTH:e.setClipPath(`inset(100% 0 0 0)`)}}}updateRegionGutter(e,t,n,r,i){let a=this.getRegionComponent(e);if(!a)return;if(!this.isRegionCollapsible(e)){a.setVisible(!0),this._gutters.get(e)?.setVisible(!1);return}let o=this.isRegionCollapsed(e),s=this.ensureGutter(e);a.setVisible(!0),s.setOpaque(o),s.setVisible(!0);let c=o?{x:t,y:n,width:r,height:i}:this.innerEdgeTrack(e,t,n,r,i);s.setX(c.x),s.setY(c.y),s.setWidth(c.width),s.setHeight(c.height)}innerEdgeTrack(e,t,n,r,i){switch(e){case f.NORTH:return{x:t,y:n+i,width:r,height:E};case f.SOUTH:return{x:t,y:n-E,width:r,height:E};case f.WEST:return{x:t+r,y:n,width:E,height:i};case f.EAST:return{x:t-E,y:n,width:E,height:i};default:return{x:t,y:n,width:r,height:i}}}laidOut(e){return e&&e.isDisplayed()?e:null}getPreferredSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=t.left+t.right,r=t.top+t.bottom,i=0,a=0,o=0,s=0,c=this.laidOut(this._northComponent),l=this.laidOut(this._southComponent),u=this.laidOut(this._westComponent),d=this.laidOut(this._centerComponent),p=this.laidOut(this._eastComponent);if(c){let e=c.getPreferredSize();if(e){let t=this.flooredMainExtent(e.height,c.getMinSize(),!0);i=Math.max(i,e.width),a+=this.isRegionCollapsed(f.NORTH)?18:t}}if(l){let e=l.getPreferredSize();if(e){let t=this.flooredMainExtent(e.height,l.getMinSize(),!0);i=Math.max(i,e.width),a+=this.isRegionCollapsed(f.SOUTH)?18:t}}if(u){let e=u.getPreferredSize();if(e){let t=this.flooredMainExtent(e.width,u.getMinSize(),!1);o+=this.isRegionCollapsed(f.WEST)?18:t,s=Math.max(s,e.height)}}if(d){let e=d.getPreferredSize();e&&(o+=e.width,s=Math.max(s,e.height))}if(p){let e=p.getPreferredSize();if(e){let t=this.flooredMainExtent(e.width,p.getMinSize(),!1);o+=this.isRegionCollapsed(f.EAST)?18:t,s=Math.max(s,e.height)}}return i=Math.max(i,o),a+=s,{width:i+n,height:a+r}}getMinSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=t.left+t.right,r=t.top+t.bottom,i=0,a=0,o=0,s=0,c=this.laidOut(this._northComponent),l=this.laidOut(this._southComponent),u=this.laidOut(this._westComponent),d=this.laidOut(this._centerComponent),p=this.laidOut(this._eastComponent);if(c){let e=c.getMinSize();e&&(i=Math.max(i,e.width),a+=this.isRegionCollapsed(f.NORTH)?18:e.height)}if(l){let e=l.getMinSize();e&&(i=Math.max(i,e.width),a+=this.isRegionCollapsed(f.SOUTH)?18:e.height)}if(u){let e=u.getMinSize();e&&(o+=this.isRegionCollapsed(f.WEST)?18:e.width,s=Math.max(s,e.height))}if(d){let e=d.getMinSize();e&&(o+=e.width,s=Math.max(s,e.height))}if(p){let e=p.getMinSize();e&&(o+=this.isRegionCollapsed(f.EAST)?18:e.width,s=Math.max(s,e.height))}return i=Math.max(i,o),a+=s,{width:i+n,height:a+r}}getMaxSize(){let e=this.getContainer();if(!e)return null;let r=e.getPerimeterSize(),i=r.left+r.right,a=r.top+r.bottom,maxOf=e=>this.laidOut(e)?e.getMaxSize()??{width:t,height:t}:null,o=maxOf(this._northComponent),s=maxOf(this._southComponent),c=maxOf(this._westComponent),l=maxOf(this._centerComponent),u=maxOf(this._eastComponent),d=0,f=0,p=!1;for(let e of[c,l,u])e&&(p=!0,d+=e.width,f=Math.max(f,e.height));let m=t;o&&(m=Math.min(m,o.width)),s&&(m=Math.min(m,s.width)),p&&(m=Math.min(m,d));let h=0;return o&&(h+=o.height),p&&(h+=f),s&&(h+=s.height),{width:n(m+i),height:n(h+a)}}computeTotalMinSize(){if(!this.getContainer())return{width:0,height:0};let e=this.laidOut(this._westComponent)?.getMinSize(),t=this.laidOut(this._centerComponent)?.getMinSize(),n=this.laidOut(this._eastComponent)?.getMinSize(),r=this.laidOut(this._northComponent)?.getMinSize(),i=this.laidOut(this._southComponent)?.getMinSize(),a=[];e&&a.push(this.isRegionCollapsed(f.WEST)?18:e.width),t&&a.push(t.width),n&&a.push(this.isRegionCollapsed(f.EAST)?18:n.width);let o=[];r&&o.push(this.isRegionCollapsed(f.NORTH)?18:r.height),t&&o.push(t.height),i&&o.push(this.isRegionCollapsed(f.SOUTH)?18:i.height);let s=0,c=0;for(let e of a)s+=e;s+=Math.max(0,a.length-1)*this._spacing,r&&(s=Math.max(s,r.width)),i&&(s=Math.max(s,i.width));for(let e of o)c+=e;return c+=Math.max(0,o.length-1)*this._spacing,{width:s,height:c}}clearSkippedRegionFrames(...e){[this._northComponent,this._southComponent,this._westComponent,this._centerComponent,this._eastComponent].forEach((t,n)=>{t&&!e[n]&&t.clearClipFrame()})}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getInnerSize();if(!t)return;let n=e.getContentInsets();t=this.inflateForOverflow(t);let r=this.laidOut(this._northComponent),i=this.laidOut(this._southComponent),a=this.laidOut(this._westComponent),o=this.laidOut(this._centerComponent),c=this.laidOut(this._eastComponent);this.clearSkippedRegionFrames(r,i,a,o,c);let l=t.width,u=t.height,d,p,m,h;if(r){let e=this.getLayoutConstraints(r);if(!e)throw Error(`Unable to determine layout constraints for north component.`);let t=r.getPreferredSize();if(!t)throw Error(`Unable to determine preferred size for north component.`);let u=this.flooredMainExtent(t.height,r.getMinSize(),!0),d=this.regionExtent(f.NORTH,u),m=e.ignoreParentInsets?0:n.getLeft(),h=e.ignoreParentInsets?0:n.getTop(),g=l+(e.ignoreParentInsets?n.getLeft()+n.getRight():0),_=e.ignoreParentInsets?n.getTop():0;p=d+_,this.isRegionCollapsible(f.NORTH)||this._collapsing?(this.placeComponent(r,m,h,g,u+_,s.BOTH),r.clearClipFrame(),this.applyRegionClip(r,f.NORTH)):(r.setClipPath(null),r.setClipFrame(m,h,g,u+_),this.commitBounds(r,0,0,g,u+_)),this.updateRegionGutter(f.NORTH,m,h,g,p),(a||o||c||i)&&(p+=this._spacing)}else p=0;if(h=u-p,i){let e=i.getPreferredSize();if(!e)throw Error(`Unable to determine preferred size for south component.`);let t=this.flooredMainExtent(e.height,i.getMinSize(),!0),r=this.regionExtent(f.SOUTH,t),a=n.getLeft(),o=n.getTop()+u-r;h-=this._spacing,h-=r;let c=n.getTop()+u-t;this.isRegionCollapsible(f.SOUTH)||this._collapsing?(this.placeComponent(i,a,c,l,t,s.BOTH),i.clearClipFrame(),this.applyRegionClip(i,f.SOUTH)):(i.setClipPath(null),i.setClipFrame(a,c,l,t),this.commitBounds(i,0,0,l,t)),this.updateRegionGutter(f.SOUTH,a,o,l,r)}let g=0,_=0;if(c){let e=c.getPreferredSize();if(!e)throw Error(`Unable to determine preferred size for east component.`);let t=this.flooredMainExtent(e.width,c.getMinSize(),!1);_=t,g=this.regionExtent(f.EAST,t)}if(a){let e=a.getPreferredSize();if(!e)throw Error(`Unable to determine preferred size for west component.`);let t=this.flooredMainExtent(e.width,a.getMinSize(),!1),r=Math.max(0,Math.min(this.regionExtent(f.WEST,t),l-g)),i=n.getLeft(),c=n.getTop()+p;d=r;let u=Math.max(0,Math.min(t,l-g));this.isRegionCollapsible(f.WEST)||this._collapsing?(this.placeComponent(a,i,c,u,h,s.BOTH),a.clearClipFrame(),this.applyRegionClip(a,f.WEST)):(a.setClipPath(null),a.setClipFrame(i,c,u,h),this.commitBounds(a,0,0,u,h)),this.updateRegionGutter(f.WEST,i,c,r,h),o&&(d+=this._spacing)}else d=0;if(m=l-d,c){m-=this._spacing,m-=g;let e=n.getLeft()+l-g,t=n.getTop()+p,r=n.getLeft()+l-_;this.isRegionCollapsible(f.EAST)||this._collapsing?(this.placeComponent(c,r,t,_,h,s.BOTH),c.clearClipFrame(),this.applyRegionClip(c,f.EAST)):(c.setClipPath(null),c.setClipFrame(r,t,_,h),this.commitBounds(c,0,0,_,h)),this.updateRegionGutter(f.EAST,e,t,g,h)}if(o){let e=n.getLeft()+d,t=n.getTop()+p;this._collapsing?(this.placeComponent(o,e,t,m,h,s.BOTH),o.clearClipFrame()):(o.setClipFrame(e,t,m,h),this.commitBounds(o,0,0,m,h))}}detach(){this._collapseAnimation?.(),this._collapseAnimation=null,this._collapsing=!1;let t=(this.getContainer()?.getComponents().length??0)>0;for(let e of this._pendingCollapseTransitions)t?e.settle():e.cancel();this._pendingCollapseTransitions.length=0,super.detach();for(let t of this._gutters.values()){let n=t.getElement(),r=n?e.source.getParentNode(n):null;n&&r&&e.sink.removeChild(r,n),t.dispose()}this._gutters.clear();for(let e of[f.NORTH,f.SOUTH,f.WEST,f.EAST,f.CENTER])this.getRegionComponent(e)?.clearClipFrame();return this}},O=o(Border);export{beginPointerDrag as a,runCollapse as i,T as n,endPointerDrag as o,S as r,O as t};
2
- //# sourceMappingURL=Border-CNS6aEXB.js.map