@jimka/typescript-ui 0.6.0 → 0.7.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 (198) hide show
  1. package/dist/lib/{AbstractInput-sRNPzWel.js → AbstractInput-W2PLJV5_.js} +2 -2
  2. package/dist/lib/{AbstractInput-sRNPzWel.js.map → AbstractInput-W2PLJV5_.js.map} +1 -1
  3. package/dist/lib/{Anchor-CwRhdP2J.js → Anchor-iZhsvMlT.js} +2 -2
  4. package/dist/lib/{Anchor-CwRhdP2J.js.map → Anchor-iZhsvMlT.js.map} +1 -1
  5. package/dist/lib/AnimatedDropdown-D0RhVgv3.js +2 -0
  6. package/dist/lib/AnimatedDropdown-D0RhVgv3.js.map +1 -0
  7. package/dist/lib/Border-6GsTNV-2.js +2 -0
  8. package/dist/lib/Border-6GsTNV-2.js.map +1 -0
  9. package/dist/lib/Button-CnFAiQuV.js +2 -0
  10. package/dist/lib/Button-CnFAiQuV.js.map +1 -0
  11. package/dist/lib/{Card-QYo27r5b.js → Card-C20k2YHU.js} +2 -2
  12. package/dist/lib/{Card-QYo27r5b.js.map → Card-C20k2YHU.js.map} +1 -1
  13. package/dist/lib/Checkbox-CM1z8keM.js +2 -0
  14. package/dist/lib/Checkbox-CM1z8keM.js.map +1 -0
  15. package/dist/lib/{CheckboxMenuRow-CesLhSnp.js → CheckboxMenuRow-C1h4LPHR.js} +2 -2
  16. package/dist/lib/{CheckboxMenuRow-CesLhSnp.js.map → CheckboxMenuRow-C1h4LPHR.js.map} +1 -1
  17. package/dist/lib/{CodeEditor-N1FQodcF.js → CodeEditor-CTL2WjF8.js} +2 -2
  18. package/dist/lib/{CodeEditor-N1FQodcF.js.map → CodeEditor-CTL2WjF8.js.map} +1 -1
  19. package/dist/lib/ComboBox-PZ5YPL0X.js +2 -0
  20. package/dist/lib/ComboBox-PZ5YPL0X.js.map +1 -0
  21. package/dist/lib/Component-D99-15Zt.js +2 -0
  22. package/dist/lib/Component-D99-15Zt.js.map +1 -0
  23. package/dist/lib/Container-FWRjgF6T.js +2 -0
  24. package/dist/lib/{Container-abY5Ww3W.js.map → Container-FWRjgF6T.js.map} +1 -1
  25. package/dist/lib/DOM-Cjh7_7TF.js +2 -0
  26. package/dist/lib/DOM-Cjh7_7TF.js.map +1 -0
  27. package/dist/lib/Dialog-DN78RaVH.js +2 -0
  28. package/dist/lib/Dialog-DN78RaVH.js.map +1 -0
  29. package/dist/lib/{FieldDecorator-BlYMfZ9L.js → FieldDecorator-DyPX8CFh.js} +2 -2
  30. package/dist/lib/{FieldDecorator-BlYMfZ9L.js.map → FieldDecorator-DyPX8CFh.js.map} +1 -1
  31. package/dist/lib/{Fit-BhlB-HAo.js → Fit-CaPMj7Up.js} +2 -2
  32. package/dist/lib/{Fit-BhlB-HAo.js.map → Fit-CaPMj7Up.js.map} +1 -1
  33. package/dist/lib/{FloatingPanel-DkJXsZ2D.js → FloatingPanel-Dsy_vJxi.js} +2 -2
  34. package/dist/lib/{FloatingPanel-DkJXsZ2D.js.map → FloatingPanel-Dsy_vJxi.js.map} +1 -1
  35. package/dist/lib/Glyph-DiEpD3gy.js +2 -0
  36. package/dist/lib/Glyph-DiEpD3gy.js.map +1 -0
  37. package/dist/lib/{Grid-Daiz7F5d.js → Grid-ft_UUpj8.js} +2 -2
  38. package/dist/lib/{Grid-Daiz7F5d.js.map → Grid-ft_UUpj8.js.map} +1 -1
  39. package/dist/lib/{GridConstraints-C58LuTqM.js → GridConstraints-CvZ0Nzaw.js} +2 -2
  40. package/dist/lib/{GridConstraints-C58LuTqM.js.map → GridConstraints-CvZ0Nzaw.js.map} +1 -1
  41. package/dist/lib/{Header-Dql3Zxc6.js → Header-Osm3IjDw.js} +2 -2
  42. package/dist/lib/{Header-Dql3Zxc6.js.map → Header-Osm3IjDw.js.map} +1 -1
  43. package/dist/lib/{IconText-PUjhTLlp.js → IconText-BBaYJ2Fx.js} +2 -2
  44. package/dist/lib/{IconText-PUjhTLlp.js.map → IconText-BBaYJ2Fx.js.map} +1 -1
  45. package/dist/lib/{LayoutSerialization-CMxunLfV.js → LayoutSerialization-BC64__O7.js} +2 -2
  46. package/dist/lib/{LayoutSerialization-CMxunLfV.js.map → LayoutSerialization-BC64__O7.js.map} +1 -1
  47. package/dist/lib/List-CQbZK_pT.js +2 -0
  48. package/dist/lib/List-CQbZK_pT.js.map +1 -0
  49. package/dist/lib/{Menu-Q0bpXXze.js → Menu-CwHluLGT.js} +2 -2
  50. package/dist/lib/{Menu-Q0bpXXze.js.map → Menu-CwHluLGT.js.map} +1 -1
  51. package/dist/lib/{MenuButton-DCXi0tsP.js → MenuButton-BqCT-1yv.js} +2 -2
  52. package/dist/lib/{MenuButton-DCXi0tsP.js.map → MenuButton-BqCT-1yv.js.map} +1 -1
  53. package/dist/lib/{OverlayFade-3pof2AJH.js → OverlayFade-CuEXgimf.js} +2 -2
  54. package/dist/lib/{OverlayFade-3pof2AJH.js.map → OverlayFade-CuEXgimf.js.map} +1 -1
  55. package/dist/lib/{Panel-Cy1pdlWO.js → Panel-CtViePqY.js} +2 -2
  56. package/dist/lib/{Panel-Cy1pdlWO.js.map → Panel-CtViePqY.js.map} +1 -1
  57. package/dist/lib/{Position-BwtxouxK.js → Position-BIEU1Eze.js} +2 -2
  58. package/dist/lib/Position-BIEU1Eze.js.map +1 -0
  59. package/dist/lib/{ProgressSpinner-DK8xEQ9y.js → ProgressSpinner-BuBvC1FY.js} +2 -2
  60. package/dist/lib/{ProgressSpinner-DK8xEQ9y.js.map → ProgressSpinner-BuBvC1FY.js.map} +1 -1
  61. package/dist/lib/RadioButton-Df5J-H6m.js +2 -0
  62. package/dist/lib/RadioButton-Df5J-H6m.js.map +1 -0
  63. package/dist/lib/RadioMenuRow-Cfv0x6Qj.js +2 -0
  64. package/dist/lib/RadioMenuRow-Cfv0x6Qj.js.map +1 -0
  65. package/dist/lib/{RovingTabIndex-pHEv5oLD.js → RovingTabIndex--w28AnXc.js} +2 -2
  66. package/dist/lib/{RovingTabIndex-pHEv5oLD.js.map → RovingTabIndex--w28AnXc.js.map} +1 -1
  67. package/dist/lib/Scrollbar-DcnueNJd.js +2 -0
  68. package/dist/lib/Scrollbar-DcnueNJd.js.map +1 -0
  69. package/dist/lib/SelectableText-DZNxjKXR.js +2 -0
  70. package/dist/lib/SelectableText-DZNxjKXR.js.map +1 -0
  71. package/dist/lib/{Slider-CTbwR6HR.js → Slider-DNfd8Lxz.js} +2 -2
  72. package/dist/lib/{Slider-CTbwR6HR.js.map → Slider-DNfd8Lxz.js.map} +1 -1
  73. package/dist/lib/{Spacer-srdN2d2b.js → Spacer-BznfGbwG.js} +2 -2
  74. package/dist/lib/{Spacer-srdN2d2b.js.map → Spacer-BznfGbwG.js.map} +1 -1
  75. package/dist/lib/TabButton-CAACsMov.js +2 -0
  76. package/dist/lib/TabButton-CAACsMov.js.map +1 -0
  77. package/dist/lib/{TabCloseButton-CY7BGitY.js → TabCloseButton-CCiqsX3y.js} +2 -2
  78. package/dist/lib/{TabCloseButton-CY7BGitY.js.map → TabCloseButton-CCiqsX3y.js.map} +1 -1
  79. package/dist/lib/Text-O-FWa5Cy.js +2 -0
  80. package/dist/lib/Text-O-FWa5Cy.js.map +1 -0
  81. package/dist/lib/{Tooltip-CUOJOqQi.js → Tooltip-CyICVu15.js} +2 -2
  82. package/dist/lib/Tooltip-CyICVu15.js.map +1 -0
  83. package/dist/lib/{Tree-C64JNPWJ.js → Tree-CSEguhlk.js} +2 -2
  84. package/dist/lib/{Tree-C64JNPWJ.js.map → Tree-CSEguhlk.js.map} +1 -1
  85. package/dist/lib/{VBox-DfJPWXqc.js → VBox-DVe4UXwX.js} +2 -2
  86. package/dist/lib/{VBox-DfJPWXqc.js.map → VBox-DVe4UXwX.js.map} +1 -1
  87. package/dist/lib/{VirtualScroller-DTIn19o1.js → VirtualScroller-ggPTCQb0.js} +2 -2
  88. package/dist/lib/{VirtualScroller-DTIn19o1.js.map → VirtualScroller-ggPTCQb0.js.map} +1 -1
  89. package/dist/lib/component/button.es.js +1 -1
  90. package/dist/lib/component/chart.es.js +1 -1
  91. package/dist/lib/component/chart.es.js.map +1 -1
  92. package/dist/lib/component/container.es.js +1 -1
  93. package/dist/lib/component/diagram.es.js +1 -1
  94. package/dist/lib/component/display.es.js +1 -1
  95. package/dist/lib/component/display.es.js.map +1 -1
  96. package/dist/lib/component/editor.es.js +2 -2
  97. package/dist/lib/component/editor.es.js.map +1 -1
  98. package/dist/lib/component/input.es.js +1 -1
  99. package/dist/lib/component/input.es.js.map +1 -1
  100. package/dist/lib/component/list.es.js +1 -1
  101. package/dist/lib/component/menubar.es.js +1 -1
  102. package/dist/lib/component/table.es.js +6 -6
  103. package/dist/lib/component/table.es.js.map +1 -1
  104. package/dist/lib/component/tree.es.js +1 -1
  105. package/dist/lib/core.es.js +1 -1
  106. package/dist/lib/core.es.js.map +1 -1
  107. package/dist/lib/glyphs/solid/index.es.js +1 -1
  108. package/dist/lib/layout.es.js +1 -1
  109. package/dist/lib/overlay.es.js +1 -1
  110. package/dist/lib/overlay.es.js.map +1 -1
  111. package/dist/lib/primitive.es.js +1 -1
  112. package/dist/lib/router.es.js +1 -1
  113. package/dist/lib/{selectionsEqual-gMG7gCVI.js → selectionsEqual-C7MrKMQr.js} +2 -2
  114. package/dist/lib/{selectionsEqual-gMG7gCVI.js.map → selectionsEqual-C7MrKMQr.js.map} +1 -1
  115. package/dist/lib/types/component/button/Button.d.ts +9 -0
  116. package/dist/lib/types/component/button/TabButton.d.ts +5 -0
  117. package/dist/lib/types/component/button/ToggleButton.d.ts +3 -0
  118. package/dist/lib/types/component/chart/AbstractChart.d.ts +2 -0
  119. package/dist/lib/types/component/display/Markdown.d.ts +2 -1
  120. package/dist/lib/types/component/input/AbstractCalendarDropdown.d.ts +2 -0
  121. package/dist/lib/types/component/input/AbstractPickerField.d.ts +2 -0
  122. package/dist/lib/types/component/input/AutoCompleteDropdown.d.ts +2 -0
  123. package/dist/lib/types/component/input/ComboBox.d.ts +3 -1
  124. package/dist/lib/types/component/input/Link.d.ts +2 -0
  125. package/dist/lib/types/component/input/PasswordField.d.ts +2 -0
  126. package/dist/lib/types/component/input/PickerInput.d.ts +2 -0
  127. package/dist/lib/types/component/input/SelectableText.d.ts +11 -0
  128. package/dist/lib/types/component/input/SpinButton.d.ts +2 -0
  129. package/dist/lib/types/component/input/Text.d.ts +16 -2
  130. package/dist/lib/types/component/input/TextArea.d.ts +2 -0
  131. package/dist/lib/types/component/input/TextField.d.ts +2 -0
  132. package/dist/lib/types/component/input/TextInput.d.ts +2 -0
  133. package/dist/lib/types/component/input/TimePickerDropdown.d.ts +3 -1
  134. package/dist/lib/types/component/input/UsernameField.d.ts +2 -0
  135. package/dist/lib/types/component/input/index.d.ts +2 -0
  136. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +4 -2
  137. package/dist/lib/types/component/table/Body.d.ts +40 -14
  138. package/dist/lib/types/component/table/Header.d.ts +1 -1
  139. package/dist/lib/types/component/table/Row.d.ts +20 -2
  140. package/dist/lib/types/component/table/Table.d.ts +2 -0
  141. package/dist/lib/types/component/table/TableExporter.d.ts +3 -0
  142. package/dist/lib/types/component/table/TablePanel.d.ts +1 -0
  143. package/dist/lib/types/component/table/TreeTablePanel.d.ts +1 -0
  144. package/dist/lib/types/component/table/cell/Cell.d.ts +7 -2
  145. package/dist/lib/types/component/table/cell/Default.d.ts +1 -1
  146. package/dist/lib/types/component/table/cell/Header.d.ts +3 -0
  147. package/dist/lib/types/component/table/cell/ResizeHandle.d.ts +1 -1
  148. package/dist/lib/types/component/table/cell/renderer/CellRenderer.d.ts +2 -2
  149. package/dist/lib/types/component/table/cell/renderer/String.d.ts +3 -1
  150. package/dist/lib/types/component/table/index.d.ts +1 -1
  151. package/dist/lib/types/core/AnimatedDropdown.d.ts +2 -0
  152. package/dist/lib/types/core/ClassStyleRules.d.ts +46 -3
  153. package/dist/lib/types/core/Component.d.ts +30 -2
  154. package/dist/lib/types/core/DOM.d.ts +5 -1
  155. package/dist/lib/types/core/LayerManager.d.ts +1 -0
  156. package/dist/lib/types/core/StyleTarget.d.ts +2 -0
  157. package/dist/lib/types/core/Theme.d.ts +1 -0
  158. package/dist/lib/types/core/Util.d.ts +4 -0
  159. package/dist/lib/types/core/index.d.ts +1 -1
  160. package/dist/lib/types/layout/Table.d.ts +2 -0
  161. package/dist/lib/types/overlay/AbstractWindow.d.ts +3 -0
  162. package/dist/lib/types/overlay/PopupPanel.d.ts +2 -0
  163. package/dist/lib/validation.es.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js +0 -2
  166. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js.map +0 -1
  167. package/dist/lib/Border-0DJFDiij.js +0 -2
  168. package/dist/lib/Border-0DJFDiij.js.map +0 -1
  169. package/dist/lib/Button-MpMIYBYJ.js +0 -2
  170. package/dist/lib/Button-MpMIYBYJ.js.map +0 -1
  171. package/dist/lib/Checkbox-D0JYK-wc.js +0 -2
  172. package/dist/lib/Checkbox-D0JYK-wc.js.map +0 -1
  173. package/dist/lib/ComboBox-Dx8Tk9yg.js +0 -2
  174. package/dist/lib/ComboBox-Dx8Tk9yg.js.map +0 -1
  175. package/dist/lib/Component-B0ShfPVi.js +0 -2
  176. package/dist/lib/Component-B0ShfPVi.js.map +0 -1
  177. package/dist/lib/Container-abY5Ww3W.js +0 -2
  178. package/dist/lib/DOM-C-Edb3tA.js +0 -2
  179. package/dist/lib/DOM-C-Edb3tA.js.map +0 -1
  180. package/dist/lib/Dialog-cbA9V17e.js +0 -2
  181. package/dist/lib/Dialog-cbA9V17e.js.map +0 -1
  182. package/dist/lib/Glyph-_VeBacS2.js +0 -2
  183. package/dist/lib/Glyph-_VeBacS2.js.map +0 -1
  184. package/dist/lib/List-nx8220Fi.js +0 -2
  185. package/dist/lib/List-nx8220Fi.js.map +0 -1
  186. package/dist/lib/Position-BwtxouxK.js.map +0 -1
  187. package/dist/lib/RadioButton-BEwpqg1k.js +0 -2
  188. package/dist/lib/RadioButton-BEwpqg1k.js.map +0 -1
  189. package/dist/lib/RadioMenuRow-DP5qPyFR.js +0 -2
  190. package/dist/lib/RadioMenuRow-DP5qPyFR.js.map +0 -1
  191. package/dist/lib/Scrollbar-t8fFrUVQ.js +0 -2
  192. package/dist/lib/Scrollbar-t8fFrUVQ.js.map +0 -1
  193. package/dist/lib/TabButton-DLoMQzky.js +0 -2
  194. package/dist/lib/TabButton-DLoMQzky.js.map +0 -1
  195. package/dist/lib/Text-CMKnK9uB.js +0 -2
  196. package/dist/lib/Text-CMKnK9uB.js.map +0 -1
  197. package/dist/lib/Tooltip-CUOJOqQi.js.map +0 -1
  198. package/dist/lib/types/component/table/CellGeometry.d.ts +0 -6
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./Position-BwtxouxK.js";import{t as c}from"./Placement-7kqdaK4Z.js";var Point=class extends t{_x;_y;constructor(e,t){super(),this._x=e??0,this._y=t??0}getX(){return this._x??0}getY(){return this._y??0}render(){return this.getX()+` `+this.getY()}};export{r as Insets,c as Placement,Point,s as Position,e as UNBOUNDED,a as borderSideWidth,n as borderToStyle,i as isUnbounded,o as saturate};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./Position-BIEU1Eze.js";import{t as c}from"./Placement-7kqdaK4Z.js";var Point=class extends t{_x;_y;constructor(e,t){super(),this._x=e??0,this._y=t??0}getX(){return this._x??0}getY(){return this._y??0}render(){return this.getX()+` `+this.getY()}};export{r as Insets,c as Placement,Point,s as Position,e as UNBOUNDED,a as borderSideWidth,n as borderToStyle,i as isUnbounded,o as saturate};
2
2
  //# sourceMappingURL=primitive.es.js.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./DOM-C-Edb3tA.js";import{t}from"./ListenerBag-WPdKuuds.js";function normalizePath(e){return`/`+splitPath(splitQuery(e.startsWith(`#`)?e.slice(1):e).path).join(`/`)}function splitPath(e){return e.split(`/`).filter(e=>e.length>0)}function splitFragment(e){let t=e.indexOf(`#`);return t===-1?{path:e,fragment:``}:{path:e.slice(0,t),fragment:e.slice(t+1)}}function splitQuery(e){let t=e.indexOf(`?`);return t===-1?{path:e,query:``}:{path:e.slice(0,t),query:e.slice(t+1)}}function parseQuery(e){let t=e.startsWith(`?`)?e.slice(1):e,n={};for(let e of t.split(`&`)){if(e.length===0)continue;let t=e.indexOf(`=`),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t+1),a=decodeSegment(r);a.length!==0&&(n[a]=decodeSegment(i))}return n}function formatQuery(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join(`&`)}function sameQuery(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function normalizeBase(e){let t=splitPath(e);return t.length===0?`/`:`/`+t.join(`/`)+`/`}function stripBase(e,t){let n=normalizeBase(e).slice(0,-1);return n!==``&&(t===n||t.startsWith(n+`/`))?normalizePath(t.slice(n.length)):normalizePath(t)}function joinBase(e,t){let n=normalizeBase(e),r=normalizePath(t);return r===`/`?n:n.slice(0,-1)+r}function compilePattern(e){let t=normalizePath(e),n=splitPath(t),r=n.map((t,r)=>{if(t===`*`){if(r!==n.length-1)throw Error(`RoutePattern: "*" is only valid as the final segment of "${e}"`);return{kind:`catchAll`,value:``}}return t.startsWith(`:`)?{kind:`param`,value:t.slice(1)}:{kind:`static`,value:t}});return{pattern:t,key:r.map(e=>e.kind===`static`?e.value:e.kind===`param`?`:`:`*`).join(`/`),segments:r}}function matchPattern(e,t){let n=e.segments,r=n.length>0&&n.at(-1).kind===`catchAll`,i=r?n.length-1:n.length;if(r?t.length<i:t.length!==i)return null;let a={};for(let e=0;e<i;e+=1){let r=n[e],i=t[e];if(r.kind===`static`){if(r.value!==i)return null}else r.kind===`param`&&(a[r.value]=decodeSegment(i))}return a}function decodeSegment(e){try{return decodeURIComponent(e)}catch{return e}}var n={static:2,param:1,catchAll:0};function rankAt(e,t){return t>=e.length?3:n[e[t].kind]}function selectPattern(e,t){let n=splitPath(t),r=null,i=null;for(let t of e){let e=matchPattern(t,n);e!==null&&(r===null||isMoreSpecific(t.segments,r.segments))&&(r=t,i=e)}return r===null?null:{compiled:r,params:i}}function isMoreSpecific(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){let n=rankAt(e,r),i=rankAt(t,r);if(n!==i)return n>i}return!1}var Router=class{_routes=new Map;_listeners=new t;_started=!1;_mode;_base;_onHashChange=()=>this.handleHashChange();_onPopState=()=>this.handlePopState();constructor(e){this.applyOptions(e??{})}register(e,t){let n=compilePattern(e),r=this._routes.get(n.key);return r!==void 0&&r.pattern!==n.pattern&&console.warn(`Router: "${r.pattern}" and "${n.pattern}" have the same specificity; "${n.pattern}" replaces it.`),this._routes.set(n.key,{...n,handler:t}),this}start(){return this._started?(console.warn(`Router: start() called on an already-started router; ignoring.`),this):(this._started=!0,this.applyCurrentRoute(),this._mode===`history`?e.sink.addListener(e.source.getWindow(),`popstate`,this._onPopState):e.sink.addListener(e.source.getWindow(),`hashchange`,this._onHashChange),this)}stop(){return this._started?(this._mode===`history`?e.sink.removeListener(e.source.getWindow(),`popstate`,this._onPopState):e.sink.removeListener(e.source.getWindow(),`hashchange`,this._onHashChange),this._started=!1,this):this}navigate(t,n){let r=splitFragment(t),i=splitQuery(r.path),a=n?.query??parseQuery(i.query);if(this._mode===`hash`){let r=this.getHref(t,a);return n?.replace===!0?e.sink.replaceLocationHash(r):e.sink.setLocationHash(r),this}let o=normalizePath(i.path),s=r.fragment;if(o===this.getPath()&&s===this.getFragment()&&sameQuery(a,this.getQuery()))return this;let c=this.getHref(s===``?o:`${o}#${s}`,a);return n?.replace===!0?e.sink.replaceHistoryPath(c):e.sink.pushHistoryPath(c),this.applyCurrentRoute(),this}getHref(e,t){let n=splitFragment(e),r=splitQuery(n.path),i=t??parseQuery(r.query),a=`/`+splitPath(normalizePath(r.path)).map(e=>encodeURIComponent(e)).join(`/`),o=formatQuery(i),s=o===``?``:`?`+o;if(this._mode===`hash`)return`#`+a+s;let c=joinBase(this._base,a)+s;return n.fragment===``?c:`${c}#${n.fragment}`}getPath(t){if(this._mode===`hash`){let n=t??e.source.getLocationHash();return this.decodePath(normalizePath(n))}let n=t??e.source.getLocationPathname();return this.decodePath(stripBase(this._base,splitFragment(n).path))}getFragment(t){if(this._mode===`hash`)return``;if(t!==void 0)return splitFragment(t).fragment;let n=e.source.getLocationHash();return n.startsWith(`#`)?n.slice(1):n}getQuery(t){return this._mode===`hash`?parseQuery(splitQuery(t??e.source.getLocationHash()).query):parseQuery(t===void 0?e.source.getLocationSearch():splitQuery(splitFragment(t).path).query)}decodePath(e){return`/`+splitPath(e).map(e=>{try{return decodeURIComponent(e)}catch{return e}}).join(`/`)}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)}applyCurrentRoute(){let e=this.getPath(),t=this.getFragment(),n=this.getQuery(),r=selectPattern(Array.from(this._routes.values()),e);if(r===null){this.emit(`nomatch`,e);return}let i={pattern:r.compiled.pattern,params:r.params,path:e,fragment:t,query:n};r.compiled.handler(r.params,e,t,n),this.emit(`navigate`,i)}applyOptions(e){if(this._mode=e.mode??`hash`,this._base=normalizeBase(e.base??`/`),e.routes!==void 0)for(let t of Object.keys(e.routes))this.register(t,e.routes[t]);if(e.listeners!==void 0)for(let t of Object.keys(e.listeners)){let n=e.listeners[t];n!==void 0&&this._listeners.add(t,n)}}handleHashChange(){this.applyCurrentRoute()}handlePopState(){this.applyCurrentRoute()}};export{Router};
1
+ import{t as e}from"./DOM-Cjh7_7TF.js";import{t}from"./ListenerBag-WPdKuuds.js";function normalizePath(e){return`/`+splitPath(splitQuery(e.startsWith(`#`)?e.slice(1):e).path).join(`/`)}function splitPath(e){return e.split(`/`).filter(e=>e.length>0)}function splitFragment(e){let t=e.indexOf(`#`);return t===-1?{path:e,fragment:``}:{path:e.slice(0,t),fragment:e.slice(t+1)}}function splitQuery(e){let t=e.indexOf(`?`);return t===-1?{path:e,query:``}:{path:e.slice(0,t),query:e.slice(t+1)}}function parseQuery(e){let t=e.startsWith(`?`)?e.slice(1):e,n={};for(let e of t.split(`&`)){if(e.length===0)continue;let t=e.indexOf(`=`),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t+1),a=decodeSegment(r);a.length!==0&&(n[a]=decodeSegment(i))}return n}function formatQuery(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join(`&`)}function sameQuery(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function normalizeBase(e){let t=splitPath(e);return t.length===0?`/`:`/`+t.join(`/`)+`/`}function stripBase(e,t){let n=normalizeBase(e).slice(0,-1);return n!==``&&(t===n||t.startsWith(n+`/`))?normalizePath(t.slice(n.length)):normalizePath(t)}function joinBase(e,t){let n=normalizeBase(e),r=normalizePath(t);return r===`/`?n:n.slice(0,-1)+r}function compilePattern(e){let t=normalizePath(e),n=splitPath(t),r=n.map((t,r)=>{if(t===`*`){if(r!==n.length-1)throw Error(`RoutePattern: "*" is only valid as the final segment of "${e}"`);return{kind:`catchAll`,value:``}}return t.startsWith(`:`)?{kind:`param`,value:t.slice(1)}:{kind:`static`,value:t}});return{pattern:t,key:r.map(e=>e.kind===`static`?e.value:e.kind===`param`?`:`:`*`).join(`/`),segments:r}}function matchPattern(e,t){let n=e.segments,r=n.length>0&&n.at(-1).kind===`catchAll`,i=r?n.length-1:n.length;if(r?t.length<i:t.length!==i)return null;let a={};for(let e=0;e<i;e+=1){let r=n[e],i=t[e];if(r.kind===`static`){if(r.value!==i)return null}else r.kind===`param`&&(a[r.value]=decodeSegment(i))}return a}function decodeSegment(e){try{return decodeURIComponent(e)}catch{return e}}var n={static:2,param:1,catchAll:0};function rankAt(e,t){return t>=e.length?3:n[e[t].kind]}function selectPattern(e,t){let n=splitPath(t),r=null,i=null;for(let t of e){let e=matchPattern(t,n);e!==null&&(r===null||isMoreSpecific(t.segments,r.segments))&&(r=t,i=e)}return r===null?null:{compiled:r,params:i}}function isMoreSpecific(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){let n=rankAt(e,r),i=rankAt(t,r);if(n!==i)return n>i}return!1}var Router=class{_routes=new Map;_listeners=new t;_started=!1;_mode;_base;_onHashChange=()=>this.handleHashChange();_onPopState=()=>this.handlePopState();constructor(e){this.applyOptions(e??{})}register(e,t){let n=compilePattern(e),r=this._routes.get(n.key);return r!==void 0&&r.pattern!==n.pattern&&console.warn(`Router: "${r.pattern}" and "${n.pattern}" have the same specificity; "${n.pattern}" replaces it.`),this._routes.set(n.key,{...n,handler:t}),this}start(){return this._started?(console.warn(`Router: start() called on an already-started router; ignoring.`),this):(this._started=!0,this.applyCurrentRoute(),this._mode===`history`?e.sink.addListener(e.source.getWindow(),`popstate`,this._onPopState):e.sink.addListener(e.source.getWindow(),`hashchange`,this._onHashChange),this)}stop(){return this._started?(this._mode===`history`?e.sink.removeListener(e.source.getWindow(),`popstate`,this._onPopState):e.sink.removeListener(e.source.getWindow(),`hashchange`,this._onHashChange),this._started=!1,this):this}navigate(t,n){let r=splitFragment(t),i=splitQuery(r.path),a=n?.query??parseQuery(i.query);if(this._mode===`hash`){let r=this.getHref(t,a);return n?.replace===!0?e.sink.replaceLocationHash(r):e.sink.setLocationHash(r),this}let o=normalizePath(i.path),s=r.fragment;if(o===this.getPath()&&s===this.getFragment()&&sameQuery(a,this.getQuery()))return this;let c=this.getHref(s===``?o:`${o}#${s}`,a);return n?.replace===!0?e.sink.replaceHistoryPath(c):e.sink.pushHistoryPath(c),this.applyCurrentRoute(),this}getHref(e,t){let n=splitFragment(e),r=splitQuery(n.path),i=t??parseQuery(r.query),a=`/`+splitPath(normalizePath(r.path)).map(e=>encodeURIComponent(e)).join(`/`),o=formatQuery(i),s=o===``?``:`?`+o;if(this._mode===`hash`)return`#`+a+s;let c=joinBase(this._base,a)+s;return n.fragment===``?c:`${c}#${n.fragment}`}getPath(t){if(this._mode===`hash`){let n=t??e.source.getLocationHash();return this.decodePath(normalizePath(n))}let n=t??e.source.getLocationPathname();return this.decodePath(stripBase(this._base,splitFragment(n).path))}getFragment(t){if(this._mode===`hash`)return``;if(t!==void 0)return splitFragment(t).fragment;let n=e.source.getLocationHash();return n.startsWith(`#`)?n.slice(1):n}getQuery(t){return this._mode===`hash`?parseQuery(splitQuery(t??e.source.getLocationHash()).query):parseQuery(t===void 0?e.source.getLocationSearch():splitQuery(splitFragment(t).path).query)}decodePath(e){return`/`+splitPath(e).map(e=>{try{return decodeURIComponent(e)}catch{return e}}).join(`/`)}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)}applyCurrentRoute(){let e=this.getPath(),t=this.getFragment(),n=this.getQuery(),r=selectPattern(Array.from(this._routes.values()),e);if(r===null){this.emit(`nomatch`,e);return}let i={pattern:r.compiled.pattern,params:r.params,path:e,fragment:t,query:n};r.compiled.handler(r.params,e,t,n),this.emit(`navigate`,i)}applyOptions(e){if(this._mode=e.mode??`hash`,this._base=normalizeBase(e.base??`/`),e.routes!==void 0)for(let t of Object.keys(e.routes))this.register(t,e.routes[t]);if(e.listeners!==void 0)for(let t of Object.keys(e.listeners)){let n=e.listeners[t];n!==void 0&&this._listeners.add(t,n)}}handleHashChange(){this.applyCurrentRoute()}handlePopState(){this.applyCurrentRoute()}};export{Router};
2
2
  //# sourceMappingURL=router.es.js.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./DOM-C-Edb3tA.js";import{t,u as n}from"./Component-B0ShfPVi.js";import{t as r}from"./VirtualScroller-DTIn19o1.js";var i=2;function rotateLeft(e,t){e.push(...e.splice(0,t))}var VirtualRowView=class extends t{_rowPool=[];_boundIndices=[];_rowGeom=[];_rowDisplayed=[];_scroller=null;_lastWindowStart=null;_renderDeferred=!1;_renderResumed=!1;_pendingScrollX=null;_pendingScrollY=null;_pendingScrollRow=null;initScroller(e){this._scroller=new r(this,e,()=>this.onScrollerTick());for(let e of this._scroller.ownedHandles())this.trackHandle(e)}onScrollerTick(){this.renderWindow()}destructor(){for(let e of this._rowPool)e.dispose();this._scroller?.dispose(),super.destructor()}setScrollX(e){return this._scroller?.resetWheelEase(),this.holdScrollWhileFirstLayoutHeld(`x`,e)||this._scroller?.setScrollX(e),this}setScrollY(e){return this._scroller?.resetWheelEase(),this.holdScrollWhileFirstLayoutHeld(`y`,e)||this._scroller?.setScrollY(e),this}holdScrollWhileFirstLayoutHeld(e,t){return n()?(e===`x`?this._pendingScrollX=t:(this._pendingScrollY=t,this._pendingScrollRow=null),!0):(e===`x`?this._pendingScrollX=null:(this._pendingScrollY=null,this._pendingScrollRow=null),!1)}applyPendingScroll(){let e=this._pendingScrollX,t=this._pendingScrollY,n=this._pendingScrollRow;this._pendingScrollX=null,this._pendingScrollY=null,this._pendingScrollRow=null,e!==null&&this.setScrollX(e),t!==null&&this.setScrollY(t),n!==null&&this.scrollRowIntoView(n)}computeVisibleWindow(e,t,n){let r=this.getRowHeight(),a=Math.max(0,Math.floor(e/r)-i),o=Math.min(n-1,Math.ceil((e+t)/r)+i);return{firstRow:a,lastRow:o,windowSize:o-a+1>0?o-a+1:0}}computePoolTarget(e,t,n){return Math.min(n,Math.max(e,Math.ceil(t/this.getRowHeight())+4+2))}computePageSize(){let e=this.getRowHeight();return Math.max(1,Math.floor((this.getHeight()||e)/e))}growRowPool(t){if(!this._scroller||this._rowPool.length>=t)return;let n=this._scroller.getRowsContainer(),r=e.sink.createDocumentFragment();for(;this._rowPool.length<t;){let t=this.createPoolRow(),n=t.getElement(!0);e.sink.appendChild(r,n),t.setY(0),t.setWillChange(`transform`),this._rowPool.push(t),this._boundIndices.push(-1),this._rowGeom.push(null),this._rowDisplayed.push(!1)}e.sink.appendChild(n,r),e.sink.release(r)}alignPoolWindow(e){let t=this._lastWindowStart===null?0:e-this._lastWindowStart;this._lastWindowStart=e;let n=this._rowPool.length;if(t===0||n===0)return;let r=(t%n+n)%n;rotateLeft(this._rowPool,r),rotateLeft(this._boundIndices,r),rotateLeft(this._rowGeom,r),rotateLeft(this._rowDisplayed,r)}positionRow(e,t,n){let r=this._rowPool[e],i=this.getRowHeight(),a=this._rowGeom[e],o=!a||a.ty!==t||a.w!==n||a.h!==i;return o&&(r.setAutoCommitStyle(!1),r.setX(0),r.setTranslate(0,t),r.setWidth(n),r.setHeight(i),r.setAutoCommitStyle(!0),this._rowGeom[e]={ty:t,w:n,h:i}),this._rowDisplayed[e]||(r.setDisplayed(!0),this._rowDisplayed[e]=!0),o}hideExcessPoolRows(e){for(let t=e;t<this._rowPool.length;t++)this._rowDisplayed[t]&&(this._rowPool[t].setDisplayed(!1),this._rowDisplayed[t]=!1),this._boundIndices[t]=-1,this._rowGeom[t]=null}invalidateGeom(){for(let e=0;e<this._rowGeom.length;e++)this._rowGeom[e]=null}deferRenderWhileFirstLayoutHeld(){return n()?(this._renderDeferred=!0,this.scheduleLayout(),!0):(this._renderResumed=this._renderDeferred,this._renderDeferred=!1,!1)}wasRenderDeferred(){return this._renderDeferred}finishResumedRender(){let e=this._renderResumed;return this._renderResumed=!1,this.applyPendingScroll(),e}renderWindowIfDeferred(){return!this._renderDeferred||this.isLayoutPaused()?!1:(this.renderWindow(),!0)}onThemeReflow(){this._boundIndices.fill(-1),this.invalidateGeom(),this.renderWindow()}scrollRowIntoView(e){if(e<0||!this._scroller)return;if(n()){this._pendingScrollRow=e;return}let t=this.getRowHeight(),r=e*t,i=r+t,a=this._scroller.getScrollY(),o=this.getHeight(),s=a+o,c=a;r<a?c=r:i>s&&(c=i-o),c!==a&&this.setScrollY(c)}};function selectionsEqual(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}export{VirtualRowView as n,selectionsEqual as t};
2
- //# sourceMappingURL=selectionsEqual-gMG7gCVI.js.map
1
+ import{t as e}from"./DOM-Cjh7_7TF.js";import{t,u as n}from"./Component-D99-15Zt.js";import{t as r}from"./VirtualScroller-ggPTCQb0.js";var i=2;function rotateLeft(e,t){e.push(...e.splice(0,t))}var VirtualRowView=class extends t{_rowPool=[];_boundIndices=[];_rowGeom=[];_rowDisplayed=[];_scroller=null;_lastWindowStart=null;_renderDeferred=!1;_renderResumed=!1;_pendingScrollX=null;_pendingScrollY=null;_pendingScrollRow=null;initScroller(e){this._scroller=new r(this,e,()=>this.onScrollerTick());for(let e of this._scroller.ownedHandles())this.trackHandle(e)}onScrollerTick(){this.renderWindow()}destructor(){for(let e of this._rowPool)e.dispose();this._scroller?.dispose(),super.destructor()}setScrollX(e){return this._scroller?.resetWheelEase(),this.holdScrollWhileFirstLayoutHeld(`x`,e)||this._scroller?.setScrollX(e),this}setScrollY(e){return this._scroller?.resetWheelEase(),this.holdScrollWhileFirstLayoutHeld(`y`,e)||this._scroller?.setScrollY(e),this}holdScrollWhileFirstLayoutHeld(e,t){return n()?(e===`x`?this._pendingScrollX=t:(this._pendingScrollY=t,this._pendingScrollRow=null),!0):(e===`x`?this._pendingScrollX=null:(this._pendingScrollY=null,this._pendingScrollRow=null),!1)}applyPendingScroll(){let e=this._pendingScrollX,t=this._pendingScrollY,n=this._pendingScrollRow;this._pendingScrollX=null,this._pendingScrollY=null,this._pendingScrollRow=null,e!==null&&this.setScrollX(e),t!==null&&this.setScrollY(t),n!==null&&this.scrollRowIntoView(n)}computeVisibleWindow(e,t,n){let r=this.getRowHeight(),a=Math.max(0,Math.floor(e/r)-i),o=Math.min(n-1,Math.ceil((e+t)/r)+i);return{firstRow:a,lastRow:o,windowSize:o-a+1>0?o-a+1:0}}computePoolTarget(e,t,n){return Math.min(n,Math.max(e,Math.ceil(t/this.getRowHeight())+4+2))}computePageSize(){let e=this.getRowHeight();return Math.max(1,Math.floor((this.getHeight()||e)/e))}growRowPool(t){if(!this._scroller||this._rowPool.length>=t)return;let n=this._scroller.getRowsContainer(),r=e.sink.createDocumentFragment();for(;this._rowPool.length<t;){let t=this.createPoolRow(),n=t.getElement(!0);e.sink.appendChild(r,n),t.setY(0),t.setWillChange(`transform`),this._rowPool.push(t),this._boundIndices.push(-1),this._rowGeom.push(null),this._rowDisplayed.push(!1)}e.sink.appendChild(n,r),e.sink.release(r)}alignPoolWindow(e){let t=this._lastWindowStart===null?0:e-this._lastWindowStart;this._lastWindowStart=e;let n=this._rowPool.length;if(t===0||n===0)return;let r=(t%n+n)%n;rotateLeft(this._rowPool,r),rotateLeft(this._boundIndices,r),rotateLeft(this._rowGeom,r),rotateLeft(this._rowDisplayed,r)}positionRow(e,t,n){let r=this._rowPool[e],i=this.getRowHeight(),a=this._rowGeom[e],o=!a||a.ty!==t||a.w!==n||a.h!==i;return o&&(r.setAutoCommitStyle(!1),r.setX(0),r.setTranslate(0,t),r.setWidth(n),r.setHeight(i),r.setAutoCommitStyle(!0),this._rowGeom[e]={ty:t,w:n,h:i}),this._rowDisplayed[e]||(r.setDisplayed(!0),this._rowDisplayed[e]=!0),o}hideExcessPoolRows(e){for(let t=e;t<this._rowPool.length;t++)this._rowDisplayed[t]&&(this._rowPool[t].setDisplayed(!1),this._rowDisplayed[t]=!1),this._boundIndices[t]=-1,this._rowGeom[t]=null}invalidateGeom(){for(let e=0;e<this._rowGeom.length;e++)this._rowGeom[e]=null}deferRenderWhileFirstLayoutHeld(){return n()?(this._renderDeferred=!0,this.scheduleLayout(),!0):(this._renderResumed=this._renderDeferred,this._renderDeferred=!1,!1)}wasRenderDeferred(){return this._renderDeferred}finishResumedRender(){let e=this._renderResumed;return this._renderResumed=!1,this.applyPendingScroll(),e}renderWindowIfDeferred(){return!this._renderDeferred||this.isLayoutPaused()?!1:(this.renderWindow(),!0)}onThemeReflow(){this._boundIndices.fill(-1),this.invalidateGeom(),this.renderWindow()}scrollRowIntoView(e){if(e<0||!this._scroller)return;if(n()){this._pendingScrollRow=e;return}let t=this.getRowHeight(),r=e*t,i=r+t,a=this._scroller.getScrollY(),o=this.getHeight(),s=a+o,c=a;r<a?c=r:i>s&&(c=i-o),c!==a&&this.setScrollY(c)}};function selectionsEqual(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}export{VirtualRowView as n,selectionsEqual as t};
2
+ //# sourceMappingURL=selectionsEqual-C7MrKMQr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectionsEqual-gMG7gCVI.js","names":[],"sources":["../../src/typescript/lib/component/shared/VirtualRowView.ts","../../src/typescript/lib/component/shared/selectionsEqual.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Component, ComponentOptions } from \"~/core/Component.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { VirtualScroller } from \"~/component/container/VirtualScroller.js\";\nimport { isFirstLayoutHeld } from \"~/core/FirstLayoutGate.js\";\n\n/** Number of off-screen rows to render above and below the visible viewport. */\nconst SCROLL_BUFFER = 2;\n\n/** Rotates `arr` left by `shift` in place: `arr[i]` becomes what was at `arr[(i + shift) % arr.length]`. */\nfunction rotateLeft<T>(arr: T[], shift: number): void {\n arr.push(...arr.splice(0, shift));\n}\n\n/**\n * Shared transform-windowed virtual-scroll base for the data views —\n * `table/Body` and `tree/Tree` are its only two subclasses. It owns the\n * recycled row pool (`_rowPool` and the parallel `_boundIndices` / `_rowGeom` /\n * `_rowDisplayed` bookkeeping arrays), the {@link VirtualScroller} wiring, and\n * the window / pool-growth / geometry reconciliation primitives each subclass's\n * render pass composes.\n *\n * Only two things genuinely diverge between the two consumers, so only those\n * are hooks:\n *\n * - **Row height** — `Body` derives it live from the theme line box; `Tree`\n * uses a fixed constant. Read through {@link getRowHeight} on every call so a\n * live theme change is honoured.\n * - **Row construction** — the pool-row scaffolding (fragment batching, `setY(0)`\n * pin, `will-change` promotion, parallel-array bookkeeping) is identical; only\n * the row object each subclass builds differs. {@link createPoolRow} returns a\n * fully-constructed, un-appended row and the base owns the rest.\n *\n * The per-frame render pass itself ({@link renderWindow}) stays subclass-specific\n * because the content-width derivation genuinely diverges; the base exposes the\n * shared primitives it calls ({@link computeVisibleWindow},\n * {@link computePoolTarget}, {@link growRowPool}, {@link positionRow},\n * {@link hideExcessPoolRows}).\n *\n * @typeParam TRow - The concrete pooled row component type.\n * @typeParam TOptions - The subclass's options bag.\n *\n * @internal Not barrel-exported; the two subclasses are the only consumers.\n */\nabstract class VirtualRowView<\n TRow extends Component,\n TOptions extends ComponentOptions = ComponentOptions,\n> extends Component<TOptions> {\n\n protected _rowPool : TRow[] = [];\n protected _boundIndices : number[] = [];\n protected _rowGeom : Array<{ ty: number, w: number, h: number } | null> = [];\n protected _rowDisplayed : boolean[] = [];\n protected _scroller : VirtualScroller | null = null;\n\n /** The data index pool slot 0 was aligned to on the last render, for {@link alignPoolWindow} to derive the scroll delta. `null` before the first render. */\n private _lastWindowStart: number | null = null;\n\n /** Whether the startup font gate skipped a render pass that still owes a run. */\n private _renderDeferred: boolean = false;\n /** Whether the render now in flight is the one a skipped pass left pending. */\n private _renderResumed : boolean = false;\n /** Scroll offsets the gate held back, applied once a render pass has run. */\n private _pendingScrollX: number | null = null;\n private _pendingScrollY: number | null = null;\n /** A row reveal the gate held back, recomputed once a render pass has run. */\n private _pendingScrollRow: number | null = null;\n\n /**\n * Returns the height in pixels of a single row. Read on every window /\n * geometry calculation, so a subclass that recomputes it (e.g. on a theme\n * change) reflects the new value immediately.\n */\n protected abstract getRowHeight(): number;\n\n /**\n * Constructs one pool row, fully wired but not yet appended to the\n * rows container — the base's {@link growRowPool} owns the append, the\n * `setY(0)` pin, the `will-change` promotion, and the parallel-array\n * bookkeeping.\n */\n protected abstract createPoolRow(): TRow;\n\n /**\n * Recomputes and reconciles the visible row window against the current\n * scroll position and dataset. Subclass-specific because the content-width\n * derivation diverges; both implementations compose the shared primitives\n * on this base.\n */\n protected abstract renderWindow(): void;\n\n /**\n * Constructs the {@link VirtualScroller} for this view and tracks its\n * container handles so they are released with the component. The scroller's\n * onScroll hook is routed through {@link onScrollerTick}.\n *\n * @param element - This view's initialised element handle.\n */\n protected initScroller(element: Handle): void {\n this._scroller = new VirtualScroller(this, element, () => this.onScrollerTick());\n\n // Track the scroller's created container handles so they are released\n // with this view (on destructor or GC); the scroller is not a Component.\n for (const handle of this._scroller.ownedHandles()) {\n this.trackHandle(handle);\n }\n }\n\n /**\n * Invoked on every scroller tick. Default behaviour re-renders the window;\n * `Body` overrides it to additionally emit its scroll events.\n */\n protected onScrollerTick(): void {\n this.renderWindow();\n }\n\n /**\n * Destroys the pooled rows and the scroller's overlay scrollbars before the\n * inherited teardown runs.\n *\n * {@link growRowPool} appends each row's element straight to the rows\n * container and keeps the row only in `_rowPool`, so a pooled row is never\n * registered as a child component and the base destructor's recursion over\n * `_components` cannot reach it. Without this override neither the rows nor\n * their cells (which *are* registered on their row) release their\n * per-instance stylesheet rules, so the shared sheet grows by roughly the\n * view's whole cell count on every teardown. The scroller's two\n * `Scrollbar` overlays are raw-appended the same way, so they need the\n * same explicit disposal.\n */\n protected destructor(): void {\n for (const row of this._rowPool) {\n row.dispose();\n }\n\n this._scroller?.dispose();\n\n super.destructor();\n }\n\n /**\n * Sets the JS-controlled horizontal scroll position. Delegates to the\n * underlying {@link VirtualScroller}.\n *\n * @param x - The new scroll position in pixels.\n */\n setScrollX(x: number): this {\n // Ahead of the hold: a programmatic scroll cancels an in-flight wheel\n // ease whether or not the offset itself has to wait.\n this._scroller?.resetWheelEase();\n\n if (this.holdScrollWhileFirstLayoutHeld(\"x\", x)) {\n return this;\n }\n\n this._scroller?.setScrollX(x);\n\n return this;\n }\n\n /**\n * Sets the JS-controlled vertical scroll position. Delegates to the\n * underlying {@link VirtualScroller}.\n *\n * @param y - The new scroll position in pixels.\n */\n setScrollY(y: number): this {\n // Ahead of the hold: a programmatic scroll cancels an in-flight wheel\n // ease whether or not the offset itself has to wait.\n this._scroller?.resetWheelEase();\n\n if (this.holdScrollWhileFirstLayoutHeld(\"y\", y)) {\n return this;\n }\n\n this._scroller?.setScrollY(y);\n\n return this;\n }\n\n /**\n * Holds a scroll offset set while the startup font gate is holding this\n * view's render pass, for {@link applyPendingScroll} to apply once the pass\n * has run.\n *\n * @param axis - Which offset is being set.\n * @param offset - The requested offset in pixels.\n *\n * @returns `true` when the caller must return without scrolling.\n *\n * @remarks The scroller clamps every offset against a content extent that\n * only the render pass publishes, so an offset set while that pass is\n * deferred clamps to 0 and the request is lost — a row revealed during\n * startup would end up selected but off-screen. This guards the offsets\n * that are viewport-independent and so can be replayed verbatim: the\n * table's `scrollToRecord`, and a consumer restoring a saved offset.\n * `scrollRowIntoView` is held one level higher instead, by row index, since\n * its target depends on a height the gate is also holding. The table's\n * `scrollColumnIntoView` has that same width dependence but fires only from\n * a pooled cell's editor, which cannot exist while the pass is deferred.\n */\n private holdScrollWhileFirstLayoutHeld(axis: \"x\" | \"y\", offset: number): boolean {\n if (!isFirstLayoutHeld()) {\n // This offset is being applied for real, so it supersedes anything\n // held for the same axis — otherwise the held one would replay on\n // the next render and revert it. A held row reveal is a vertical\n // request too, so it goes with the Y offset.\n if (axis === \"x\") {\n this._pendingScrollX = null;\n } else {\n this._pendingScrollY = null;\n this._pendingScrollRow = null;\n }\n\n return false;\n }\n\n if (axis === \"x\") {\n this._pendingScrollX = offset;\n } else {\n this._pendingScrollY = offset;\n this._pendingScrollRow = null;\n }\n\n return true;\n }\n\n /**\n * Applies the scroll offsets {@link holdScrollWhileFirstLayoutHeld} held\n * back, now that a render pass has published the content extent they clamp\n * against. A no-op once they are applied.\n */\n private applyPendingScroll(): void {\n const x = this._pendingScrollX;\n const y = this._pendingScrollY;\n const row = this._pendingScrollRow;\n\n this._pendingScrollX = null;\n this._pendingScrollY = null;\n this._pendingScrollRow = null;\n\n if (x !== null) {\n this.setScrollX(x);\n }\n\n if (y !== null) {\n this.setScrollY(y);\n }\n\n // Applied after the offsets, which is what makes a reveal win over a\n // raw offset held before it. The reverse order is handled the other\n // way: a raw offset set later clears the reveal outright, so the two\n // vertical requests always resolve to whichever came last.\n if (row !== null) {\n this.scrollRowIntoView(row);\n }\n }\n\n /**\n * Computes the `[firstRow, lastRow]` data-index window visible in the\n * current viewport, padded by `SCROLL_BUFFER` on each side and clamped to\n * the dataset bounds.\n *\n * @param scrollY - The current scroll offset in pixels.\n * @param visibleHeight - The viewport height in pixels.\n * @param totalRows - The total number of rows in the dataset.\n * @returns The `firstRow` / `lastRow` data indices and the number of rows in the window.\n */\n protected computeVisibleWindow(scrollY: number, visibleHeight: number, totalRows: number): { firstRow: number, lastRow: number, windowSize: number } {\n const rowHeight = this.getRowHeight();\n const firstRow = Math.max(0, Math.floor(scrollY / rowHeight) - SCROLL_BUFFER);\n const lastRow = Math.min(\n totalRows - 1,\n Math.ceil((scrollY + visibleHeight) / rowHeight) + SCROLL_BUFFER\n );\n const windowSize = lastRow - firstRow + 1 > 0 ? lastRow - firstRow + 1 : 0;\n\n return { firstRow, lastRow, windowSize };\n }\n\n /**\n * Computes the row-pool target size: the max possible window for the\n * current viewport, not just the current windowSize. windowSize shrinks\n * near the top/bottom edges of the dataset because firstRow clamps to 0\n * (and lastRow to totalRows-1); growing only to windowSize would force\n * regrowth mid-scroll once the user passes a viewport-edge boundary. Pre-\n * growing pays the per-row first-layout cost once.\n *\n * @param windowSize - The current visible-window size.\n * @param visibleHeight - The viewport height in pixels.\n * @param totalRows - The total number of rows in the dataset.\n * @returns The pool target size.\n */\n protected computePoolTarget(windowSize: number, visibleHeight: number, totalRows: number): number {\n return Math.min(\n totalRows,\n Math.max(\n windowSize,\n Math.ceil(visibleHeight / this.getRowHeight()) + 2 * SCROLL_BUFFER + 2\n )\n );\n }\n\n /**\n * Computes the number of whole rows a page-nav keystroke should move by:\n * one viewport height, floored to at least one row.\n *\n * @returns The page size in rows.\n */\n protected computePageSize(): number {\n const rowHeight = this.getRowHeight();\n\n return Math.max(1, Math.floor((this.getHeight() || rowHeight) / rowHeight));\n }\n\n /**\n * Grows the row pool up to `poolTarget`, batching new row elements through\n * a {@link DocumentFragment} so the live rows container sees a single\n * append instead of N. Each new slot pins its static top to 0, promotes it\n * to its own compositor layer, and extends the parallel bookkeeping arrays\n * in lockstep.\n *\n * @param poolTarget - The target pool size.\n */\n protected growRowPool(poolTarget: number): void {\n if (!this._scroller || this._rowPool.length >= poolTarget) {\n return;\n }\n\n const rowsContainer = this._scroller.getRowsContainer();\n const growFragment = DOM.sink.createDocumentFragment();\n\n while (this._rowPool.length < poolTarget) {\n const row = this.createPoolRow();\n const rowEl = row.getElement(true)!;\n\n DOM.sink.appendChild(growFragment, rowEl);\n\n // Pin row's static top to 0 once. Per-frame Y offset comes from\n // translateY, which is composite-only (avoids layout/paint per\n // scroll tick).\n row.setY(0);\n\n // Pre-promote pooled rows to their own compositor layer so the first\n // scroll-driven translate doesn't pay a layer-creation cost.\n row.setWillChange(\"transform\");\n\n this._rowPool.push(row);\n this._boundIndices.push(-1);\n this._rowGeom.push(null);\n this._rowDisplayed.push(false);\n }\n\n DOM.sink.appendChild(rowsContainer, growFragment);\n DOM.sink.release(growFragment);\n }\n\n /**\n * Rotates the pool bookkeeping arrays so each slot keeps tracking the\n * same data index it held before the window moved, instead of being\n * rebound to whichever index now falls at that slot's window-relative\n * position.\n *\n * @param firstRow - The new window's first data index.\n *\n * @remarks Both subclasses key a pool slot by its offset within the\n * window (`firstRow + i`), so without this a one-row scroll shifts every\n * slot's data index by one and forces every pooled row — including the\n * off-screen `SCROLL_BUFFER` rows — through a full rebind and\n * reposition on every tick, instead of just the one row entering the\n * window. Call once per render, after {@link growRowPool} and before the\n * bind pass reads `_rowPool` / `_boundIndices` / `_rowGeom` /\n * `_rowDisplayed` by slot index.\n */\n protected alignPoolWindow(firstRow: number): void {\n const delta = this._lastWindowStart === null ? 0 : firstRow - this._lastWindowStart;\n\n this._lastWindowStart = firstRow;\n\n const n = this._rowPool.length;\n if (delta === 0 || n === 0) {\n return;\n }\n\n const shift = ((delta % n) + n) % n;\n\n rotateLeft(this._rowPool, shift);\n rotateLeft(this._boundIndices, shift);\n rotateLeft(this._rowGeom, shift);\n rotateLeft(this._rowDisplayed, shift);\n }\n\n /**\n * Positions the pool slot at `slot` to `targetY` and sizes it to `rowWidth`,\n * writing the translate/size only when the cached geometry differs from the\n * target, and toggling the row displayed on the false→true edge.\n *\n * @param slot - The pool-slot index.\n * @param targetY - The row's translate-Y offset in pixels.\n * @param rowWidth - The row's width in pixels.\n * @returns `true` when the geometry changed (the subclass may need to re-lay\n * out the row's children), `false` when it was already at the target.\n */\n protected positionRow(slot: number, targetY: number, rowWidth: number): boolean {\n const row = this._rowPool[slot];\n const rowHeight = this.getRowHeight();\n const prev = this._rowGeom[slot];\n const geomChanged = !prev || prev.ty !== targetY || prev.w !== rowWidth || prev.h !== rowHeight;\n\n if (geomChanged) {\n row.setAutoCommitStyle(false);\n row.setX(0);\n row.setTranslate(0, targetY);\n row.setWidth(rowWidth);\n row.setHeight(rowHeight);\n row.setAutoCommitStyle(true);\n this._rowGeom[slot] = { ty: targetY, w: rowWidth, h: rowHeight };\n }\n\n if (!this._rowDisplayed[slot]) {\n row.setDisplayed(true);\n this._rowDisplayed[slot] = true;\n }\n\n return geomChanged;\n }\n\n /**\n * Hides pool slots whose index falls outside the visible window and\n * clears their cached binding so the next bind triggers a full rebuild.\n *\n * @param windowSize - The number of pool slots currently in use.\n */\n protected hideExcessPoolRows(windowSize: number): void {\n for (let i = windowSize; i < this._rowPool.length; i++) {\n if (this._rowDisplayed[i]) {\n this._rowPool[i].setDisplayed(false);\n this._rowDisplayed[i] = false;\n }\n this._boundIndices[i] = -1;\n this._rowGeom[i] = null;\n }\n }\n\n /**\n * Clears the cached row geometry so the next render re-applies positions and\n * sizes for every slot. `Body` overrides this to additionally clear its\n * per-cell geometry cache.\n */\n protected invalidateGeom(): void {\n for (let i = 0; i < this._rowGeom.length; i++) {\n this._rowGeom[i] = null;\n }\n }\n\n /**\n * Skips a render pass while the startup font gate is held, arranging for it\n * to run once the gate opens.\n *\n * @returns `true` when the caller must return without rendering.\n *\n * @remarks Both subclasses call {@link renderWindow} from many synchronous\n * entry points — `init`, a data change, a selection move — so a row's\n * geometry is routinely committed outside the coalesced layout queue, and\n * `init` in particular commits it the moment the element exists. Holding the\n * queue therefore does not hold these views; they have to check the gate\n * themselves. Deferring at this one choke point covers every entry point at\n * once, rather than guarding each caller.\n */\n protected deferRenderWhileFirstLayoutHeld(): boolean {\n if (!isFirstLayoutHeld()) {\n // This render is going ahead, which satisfies anything a held pass\n // left pending — clearing it keeps a later layout from replaying a\n // startup-era pass over the fresher state this one just committed.\n // Note that it also took over that pass's unfinished business, so\n // flag it for `finishResumedRender` to pick up once it has rendered.\n this._renderResumed = this._renderDeferred;\n this._renderDeferred = false;\n\n return false;\n }\n\n this._renderDeferred = true;\n this.scheduleLayout();\n\n return true;\n }\n\n /**\n * Whether the last render pass on this view was skipped by the startup font\n * gate and is still waiting to run.\n *\n * @returns `true` while a pass is pending.\n */\n protected wasRenderDeferred(): boolean {\n return this._renderDeferred;\n }\n\n /**\n * Reports, once, that the render now finishing is the one a held pass left\n * pending — so the caller can redo the post-render work that pass skipped.\n *\n * @returns `true` exactly once per resumed pass, at the end of the render\n * that resumed it.\n *\n * @remarks Called at the tail of {@link renderWindow} rather than from a\n * layout hook because a render resumes from whichever entry point reaches\n * it first, and for the table body that is the parent table layout calling\n * `renderWindow` directly rather than anything going through `doLayout`.\n */\n protected finishResumedRender(): boolean {\n // Read and clear before applying the scroll: applying it re-enters\n // `renderWindow` through the scroller's onScroll hook, and that nested\n // pass resets this flag. Reading it afterwards would lose the caller's\n // post-render work on exactly the passes that carry both.\n const resumed = this._renderResumed;\n\n this._renderResumed = false;\n\n // This pass has published the content extent, so any held offset can be\n // applied now — whether or not the pass is itself the deferred one.\n this.applyPendingScroll();\n\n return resumed;\n }\n\n /**\n * Runs the render pass the startup font gate deferred, if one is pending.\n * Each subclass calls this from its own `doLayout`, which is what picks the\n * pass back up once the gate opens.\n *\n * @returns `true` when a deferred pass ran, so the caller can skip a render\n * of its own and refresh whatever it keeps in step with the rendered rows.\n *\n * @remarks A paused view keeps its pass pending rather than running it: a\n * parent's layout recursion reaches `Body.doLayout` regardless of the\n * child's pause state, so rendering here would defeat a `pauseLayout` the\n * caller asked for. (`Tree.doLayout` already returns early when paused, so\n * the guard only binds for the body.) `resumeLayout` runs a layout of its\n * own, which picks the pass up.\n */\n protected renderWindowIfDeferred(): boolean {\n if (!this._renderDeferred || this.isLayoutPaused()) {\n return false;\n }\n\n // The pending flag is left for `renderWindow`'s own gate check to\n // consume: that is what marks this render as the resumed one, which\n // `finishResumedRender` reads at the end of the pass.\n this.renderWindow();\n\n return true;\n }\n\n /**\n * Re-binds and re-renders every pooled row after a text-metrics reflow —\n * a theme change, or the web font swapping in over the fallback face.\n *\n * @remarks Pooled rows do not ride `ThemeManager`'s reflow for free. Both\n * subclasses render through renderers whose `Text` runs with\n * `setAutoMeasure(false)`, so a bound row only re-measures inside the\n * renderer's `update()` — which {@link renderWindow} skips for a slot that\n * is already bound to its data index. Without the `_boundIndices` reset a\n * visible row therefore keeps the width it measured against whichever font\n * was active when it was bound, clipping the wider glyphs of the real face\n * once it arrives. Subclasses that cache metrics-derived state of their own\n * (row height, content width) override this to refresh it, then chain up.\n */\n protected onThemeReflow(): void {\n this._boundIndices.fill(-1);\n this.invalidateGeom();\n this.renderWindow();\n }\n\n /**\n * Scrolls the view so the row at `index` is fully visible, without moving\n * the viewport unless necessary. Delegates through {@link VirtualScroller}\n * so the header translate + scrollbar thumb stay in sync.\n *\n * @param index - The data index of the row to reveal. A negative index is a\n * no-op (the row is not in the current view).\n */\n protected scrollRowIntoView(index: number): void {\n if (index < 0 || !this._scroller) {\n return;\n }\n\n // Hold the row, not a target. The target depends on this view's height,\n // and at startup that height arrives from the very layout the gate is\n // holding — so computing it now would either read an unset height and\n // reveal nothing, or read 0 and scroll the row just out of view.\n if (isFirstLayoutHeld()) {\n this._pendingScrollRow = index;\n\n return;\n }\n\n const rowHeight = this.getRowHeight();\n const top = index * rowHeight;\n const bottom = top + rowHeight;\n const scrollTop = this._scroller.getScrollY();\n const viewportHeight = this.getHeight();\n const visibleBottom = scrollTop + viewportHeight;\n\n let target = scrollTop;\n if (top < scrollTop) {\n target = top;\n } else if (bottom > visibleBottom) {\n target = bottom - viewportHeight;\n }\n if (target !== scrollTop) {\n this.setScrollY(target);\n }\n }\n}\n\nexport { VirtualRowView };\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\n/**\n * Compares two selection sets by membership only — size and element\n * identity, regardless of insertion order.\n *\n * Pure; no DOM, no component state.\n *\n * @typeParam T - The selection identity type.\n * @param a - One selection set.\n * @param b - The other selection set.\n * @returns `true` when both sets have the same size and every member of\n * `a` is present in `b`.\n *\n * @internal Shared by `Tree` and `Body`; not barrel-exported.\n */\nexport function selectionsEqual<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): boolean {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":"sIASA,IAAM,EAAgB,EAGtB,SAAS,WAAc,EAAU,EAAqB,CAClD,EAAI,KAAK,GAAG,EAAI,OAAO,EAAG,CAAK,CAAC,CACpC,CAgCA,IAAe,eAAf,cAGU,CAAoB,CAE1B,SAAgF,CAAC,EACjF,cAA+E,CAAC,EAChF,SAA+E,CAAC,EAChF,cAA+E,CAAC,EAChF,UAA+E,KAG/E,iBAA0C,KAG1C,gBAAmC,GAEnC,eAAmC,GAEnC,gBAAyC,KACzC,gBAAyC,KAEzC,kBAA2C,KAgC3C,aAAuB,EAAuB,CAC1C,KAAK,UAAY,IAAI,EAAgB,KAAM,MAAe,KAAK,eAAe,CAAC,EAI/E,IAAK,IAAM,KAAU,KAAK,UAAU,aAAa,EAC7C,KAAK,YAAY,CAAM,CAE/B,CAMA,gBAAiC,CAC7B,KAAK,aAAa,CACtB,CAgBA,YAA6B,CACzB,IAAK,IAAM,KAAO,KAAK,SACnB,EAAI,QAAQ,EAGhB,KAAK,WAAW,QAAQ,EAExB,MAAM,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EAAM,EACvB,EAAiB,KAAK,UAAU,WAAW,EAC3C,EAAiB,KAAK,UAAU,EAChC,EAAiB,EAAY,EAE/B,EAAS,EACT,EAAM,EACN,EAAS,EACF,EAAS,IAChB,EAAS,EAAS,GAElB,IAAW,GACX,KAAK,WAAW,CAAM,CAE9B,CACJ,ECxlBA,SAAgB,gBAAmB,EAAmB,EAA4B,CAC9E,GAAI,EAAE,OAAS,EAAE,KACb,MAAO,GAGX,IAAK,IAAM,KAAQ,EACf,GAAI,CAAC,EAAE,IAAI,CAAI,EACX,MAAO,GAIf,MAAO,EACX"}
1
+ {"version":3,"file":"selectionsEqual-C7MrKMQr.js","names":[],"sources":["../../src/typescript/lib/component/shared/VirtualRowView.ts","../../src/typescript/lib/component/shared/selectionsEqual.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Component, ComponentOptions } from \"~/core/Component.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { VirtualScroller } from \"~/component/container/VirtualScroller.js\";\nimport { isFirstLayoutHeld } from \"~/core/FirstLayoutGate.js\";\n\n/** Number of off-screen rows to render above and below the visible viewport. */\nconst SCROLL_BUFFER = 2;\n\n/** Rotates `arr` left by `shift` in place: `arr[i]` becomes what was at `arr[(i + shift) % arr.length]`. */\nfunction rotateLeft<T>(arr: T[], shift: number): void {\n arr.push(...arr.splice(0, shift));\n}\n\n/**\n * Shared transform-windowed virtual-scroll base for the data views —\n * `table/Body` and `tree/Tree` are its only two subclasses. It owns the\n * recycled row pool (`_rowPool` and the parallel `_boundIndices` / `_rowGeom` /\n * `_rowDisplayed` bookkeeping arrays), the {@link VirtualScroller} wiring, and\n * the window / pool-growth / geometry reconciliation primitives each subclass's\n * render pass composes.\n *\n * Only two things genuinely diverge between the two consumers, so only those\n * are hooks:\n *\n * - **Row height** — `Body` derives it live from the theme line box; `Tree`\n * uses a fixed constant. Read through {@link getRowHeight} on every call so a\n * live theme change is honoured.\n * - **Row construction** — the pool-row scaffolding (fragment batching, `setY(0)`\n * pin, `will-change` promotion, parallel-array bookkeeping) is identical; only\n * the row object each subclass builds differs. {@link createPoolRow} returns a\n * fully-constructed, un-appended row and the base owns the rest.\n *\n * The per-frame render pass itself ({@link renderWindow}) stays subclass-specific\n * because the content-width derivation genuinely diverges; the base exposes the\n * shared primitives it calls ({@link computeVisibleWindow},\n * {@link computePoolTarget}, {@link growRowPool}, {@link positionRow},\n * {@link hideExcessPoolRows}).\n *\n * @typeParam TRow - The concrete pooled row component type.\n * @typeParam TOptions - The subclass's options bag.\n *\n * @internal Not barrel-exported; the two subclasses are the only consumers.\n */\nabstract class VirtualRowView<\n TRow extends Component,\n TOptions extends ComponentOptions = ComponentOptions,\n> extends Component<TOptions> {\n\n protected _rowPool : TRow[] = [];\n protected _boundIndices : number[] = [];\n protected _rowGeom : Array<{ ty: number, w: number, h: number } | null> = [];\n protected _rowDisplayed : boolean[] = [];\n protected _scroller : VirtualScroller | null = null;\n\n /** The data index pool slot 0 was aligned to on the last render, for {@link alignPoolWindow} to derive the scroll delta. `null` before the first render. */\n private _lastWindowStart: number | null = null;\n\n /** Whether the startup font gate skipped a render pass that still owes a run. */\n private _renderDeferred: boolean = false;\n /** Whether the render now in flight is the one a skipped pass left pending. */\n private _renderResumed : boolean = false;\n /** Scroll offsets the gate held back, applied once a render pass has run. */\n private _pendingScrollX: number | null = null;\n private _pendingScrollY: number | null = null;\n /** A row reveal the gate held back, recomputed once a render pass has run. */\n private _pendingScrollRow: number | null = null;\n\n /**\n * Returns the height in pixels of a single row. Read on every window /\n * geometry calculation, so a subclass that recomputes it (e.g. on a theme\n * change) reflects the new value immediately.\n */\n protected abstract getRowHeight(): number;\n\n /**\n * Constructs one pool row, fully wired but not yet appended to the\n * rows container — the base's {@link growRowPool} owns the append, the\n * `setY(0)` pin, the `will-change` promotion, and the parallel-array\n * bookkeeping.\n */\n protected abstract createPoolRow(): TRow;\n\n /**\n * Recomputes and reconciles the visible row window against the current\n * scroll position and dataset. Subclass-specific because the content-width\n * derivation diverges; both implementations compose the shared primitives\n * on this base.\n */\n protected abstract renderWindow(): void;\n\n /**\n * Constructs the {@link VirtualScroller} for this view and tracks its\n * container handles so they are released with the component. The scroller's\n * onScroll hook is routed through {@link onScrollerTick}.\n *\n * @param element - This view's initialised element handle.\n */\n protected initScroller(element: Handle): void {\n this._scroller = new VirtualScroller(this, element, () => this.onScrollerTick());\n\n // Track the scroller's created container handles so they are released\n // with this view (on destructor or GC); the scroller is not a Component.\n for (const handle of this._scroller.ownedHandles()) {\n this.trackHandle(handle);\n }\n }\n\n /**\n * Invoked on every scroller tick. Default behaviour re-renders the window;\n * `Body` overrides it to additionally emit its scroll events.\n */\n protected onScrollerTick(): void {\n this.renderWindow();\n }\n\n /**\n * Destroys the pooled rows and the scroller's overlay scrollbars before the\n * inherited teardown runs.\n *\n * {@link growRowPool} appends each row's element straight to the rows\n * container and keeps the row only in `_rowPool`, so a pooled row is never\n * registered as a child component and the base destructor's recursion over\n * `_components` cannot reach it. Without this override neither the rows nor\n * their cells (which *are* registered on their row) release their\n * per-instance stylesheet rules, so the shared sheet grows by roughly the\n * view's whole cell count on every teardown. The scroller's two\n * `Scrollbar` overlays are raw-appended the same way, so they need the\n * same explicit disposal.\n */\n protected destructor(): void {\n for (const row of this._rowPool) {\n row.dispose();\n }\n\n this._scroller?.dispose();\n\n super.destructor();\n }\n\n /**\n * Sets the JS-controlled horizontal scroll position. Delegates to the\n * underlying {@link VirtualScroller}.\n *\n * @param x - The new scroll position in pixels.\n */\n setScrollX(x: number): this {\n // Ahead of the hold: a programmatic scroll cancels an in-flight wheel\n // ease whether or not the offset itself has to wait.\n this._scroller?.resetWheelEase();\n\n if (this.holdScrollWhileFirstLayoutHeld(\"x\", x)) {\n return this;\n }\n\n this._scroller?.setScrollX(x);\n\n return this;\n }\n\n /**\n * Sets the JS-controlled vertical scroll position. Delegates to the\n * underlying {@link VirtualScroller}.\n *\n * @param y - The new scroll position in pixels.\n */\n setScrollY(y: number): this {\n // Ahead of the hold: a programmatic scroll cancels an in-flight wheel\n // ease whether or not the offset itself has to wait.\n this._scroller?.resetWheelEase();\n\n if (this.holdScrollWhileFirstLayoutHeld(\"y\", y)) {\n return this;\n }\n\n this._scroller?.setScrollY(y);\n\n return this;\n }\n\n /**\n * Holds a scroll offset set while the startup font gate is holding this\n * view's render pass, for {@link applyPendingScroll} to apply once the pass\n * has run.\n *\n * @param axis - Which offset is being set.\n * @param offset - The requested offset in pixels.\n *\n * @returns `true` when the caller must return without scrolling.\n *\n * @remarks The scroller clamps every offset against a content extent that\n * only the render pass publishes, so an offset set while that pass is\n * deferred clamps to 0 and the request is lost — a row revealed during\n * startup would end up selected but off-screen. This guards the offsets\n * that are viewport-independent and so can be replayed verbatim: the\n * table's `scrollToRecord`, and a consumer restoring a saved offset.\n * `scrollRowIntoView` is held one level higher instead, by row index, since\n * its target depends on a height the gate is also holding. The table's\n * `scrollColumnIntoView` has that same width dependence but fires only from\n * a pooled cell's editor, which cannot exist while the pass is deferred.\n */\n private holdScrollWhileFirstLayoutHeld(axis: \"x\" | \"y\", offset: number): boolean {\n if (!isFirstLayoutHeld()) {\n // This offset is being applied for real, so it supersedes anything\n // held for the same axis — otherwise the held one would replay on\n // the next render and revert it. A held row reveal is a vertical\n // request too, so it goes with the Y offset.\n if (axis === \"x\") {\n this._pendingScrollX = null;\n } else {\n this._pendingScrollY = null;\n this._pendingScrollRow = null;\n }\n\n return false;\n }\n\n if (axis === \"x\") {\n this._pendingScrollX = offset;\n } else {\n this._pendingScrollY = offset;\n this._pendingScrollRow = null;\n }\n\n return true;\n }\n\n /**\n * Applies the scroll offsets {@link holdScrollWhileFirstLayoutHeld} held\n * back, now that a render pass has published the content extent they clamp\n * against. A no-op once they are applied.\n */\n private applyPendingScroll(): void {\n const x = this._pendingScrollX;\n const y = this._pendingScrollY;\n const row = this._pendingScrollRow;\n\n this._pendingScrollX = null;\n this._pendingScrollY = null;\n this._pendingScrollRow = null;\n\n if (x !== null) {\n this.setScrollX(x);\n }\n\n if (y !== null) {\n this.setScrollY(y);\n }\n\n // Applied after the offsets, which is what makes a reveal win over a\n // raw offset held before it. The reverse order is handled the other\n // way: a raw offset set later clears the reveal outright, so the two\n // vertical requests always resolve to whichever came last.\n if (row !== null) {\n this.scrollRowIntoView(row);\n }\n }\n\n /**\n * Computes the `[firstRow, lastRow]` data-index window visible in the\n * current viewport, padded by `SCROLL_BUFFER` on each side and clamped to\n * the dataset bounds.\n *\n * @param scrollY - The current scroll offset in pixels.\n * @param visibleHeight - The viewport height in pixels.\n * @param totalRows - The total number of rows in the dataset.\n * @returns The `firstRow` / `lastRow` data indices and the number of rows in the window.\n */\n protected computeVisibleWindow(scrollY: number, visibleHeight: number, totalRows: number): { firstRow: number, lastRow: number, windowSize: number } {\n const rowHeight = this.getRowHeight();\n const firstRow = Math.max(0, Math.floor(scrollY / rowHeight) - SCROLL_BUFFER);\n const lastRow = Math.min(\n totalRows - 1,\n Math.ceil((scrollY + visibleHeight) / rowHeight) + SCROLL_BUFFER\n );\n const windowSize = lastRow - firstRow + 1 > 0 ? lastRow - firstRow + 1 : 0;\n\n return { firstRow, lastRow, windowSize };\n }\n\n /**\n * Computes the row-pool target size: the max possible window for the\n * current viewport, not just the current windowSize. windowSize shrinks\n * near the top/bottom edges of the dataset because firstRow clamps to 0\n * (and lastRow to totalRows-1); growing only to windowSize would force\n * regrowth mid-scroll once the user passes a viewport-edge boundary. Pre-\n * growing pays the per-row first-layout cost once.\n *\n * @param windowSize - The current visible-window size.\n * @param visibleHeight - The viewport height in pixels.\n * @param totalRows - The total number of rows in the dataset.\n * @returns The pool target size.\n */\n protected computePoolTarget(windowSize: number, visibleHeight: number, totalRows: number): number {\n return Math.min(\n totalRows,\n Math.max(\n windowSize,\n Math.ceil(visibleHeight / this.getRowHeight()) + 2 * SCROLL_BUFFER + 2\n )\n );\n }\n\n /**\n * Computes the number of whole rows a page-nav keystroke should move by:\n * one viewport height, floored to at least one row.\n *\n * @returns The page size in rows.\n */\n protected computePageSize(): number {\n const rowHeight = this.getRowHeight();\n\n return Math.max(1, Math.floor((this.getHeight() || rowHeight) / rowHeight));\n }\n\n /**\n * Grows the row pool up to `poolTarget`, batching new row elements through\n * a {@link DocumentFragment} so the live rows container sees a single\n * append instead of N. Each new slot pins its static top to 0, promotes it\n * to its own compositor layer, and extends the parallel bookkeeping arrays\n * in lockstep.\n *\n * @param poolTarget - The target pool size.\n */\n protected growRowPool(poolTarget: number): void {\n if (!this._scroller || this._rowPool.length >= poolTarget) {\n return;\n }\n\n const rowsContainer = this._scroller.getRowsContainer();\n const growFragment = DOM.sink.createDocumentFragment();\n\n while (this._rowPool.length < poolTarget) {\n const row = this.createPoolRow();\n const rowEl = row.getElement(true)!;\n\n DOM.sink.appendChild(growFragment, rowEl);\n\n // Pin row's static top to 0 once. Per-frame Y offset comes from\n // translateY, which is composite-only (avoids layout/paint per\n // scroll tick).\n row.setY(0);\n\n // Pre-promote pooled rows to their own compositor layer so the first\n // scroll-driven translate doesn't pay a layer-creation cost.\n row.setWillChange(\"transform\");\n\n this._rowPool.push(row);\n this._boundIndices.push(-1);\n this._rowGeom.push(null);\n this._rowDisplayed.push(false);\n }\n\n DOM.sink.appendChild(rowsContainer, growFragment);\n DOM.sink.release(growFragment);\n }\n\n /**\n * Rotates the pool bookkeeping arrays so each slot keeps tracking the\n * same data index it held before the window moved, instead of being\n * rebound to whichever index now falls at that slot's window-relative\n * position.\n *\n * @param firstRow - The new window's first data index.\n *\n * @remarks Both subclasses key a pool slot by its offset within the\n * window (`firstRow + i`), so without this a one-row scroll shifts every\n * slot's data index by one and forces every pooled row — including the\n * off-screen `SCROLL_BUFFER` rows — through a full rebind and\n * reposition on every tick, instead of just the one row entering the\n * window. Call once per render, after {@link growRowPool} and before the\n * bind pass reads `_rowPool` / `_boundIndices` / `_rowGeom` /\n * `_rowDisplayed` by slot index.\n */\n protected alignPoolWindow(firstRow: number): void {\n const delta = this._lastWindowStart === null ? 0 : firstRow - this._lastWindowStart;\n\n this._lastWindowStart = firstRow;\n\n const n = this._rowPool.length;\n if (delta === 0 || n === 0) {\n return;\n }\n\n const shift = ((delta % n) + n) % n;\n\n rotateLeft(this._rowPool, shift);\n rotateLeft(this._boundIndices, shift);\n rotateLeft(this._rowGeom, shift);\n rotateLeft(this._rowDisplayed, shift);\n }\n\n /**\n * Positions the pool slot at `slot` to `targetY` and sizes it to `rowWidth`,\n * writing the translate/size only when the cached geometry differs from the\n * target, and toggling the row displayed on the false→true edge.\n *\n * @param slot - The pool-slot index.\n * @param targetY - The row's translate-Y offset in pixels.\n * @param rowWidth - The row's width in pixels.\n * @returns `true` when the geometry changed (the subclass may need to re-lay\n * out the row's children), `false` when it was already at the target.\n */\n protected positionRow(slot: number, targetY: number, rowWidth: number): boolean {\n const row = this._rowPool[slot];\n const rowHeight = this.getRowHeight();\n const prev = this._rowGeom[slot];\n const geomChanged = !prev || prev.ty !== targetY || prev.w !== rowWidth || prev.h !== rowHeight;\n\n if (geomChanged) {\n row.setAutoCommitStyle(false);\n row.setX(0);\n row.setTranslate(0, targetY);\n row.setWidth(rowWidth);\n row.setHeight(rowHeight);\n row.setAutoCommitStyle(true);\n this._rowGeom[slot] = { ty: targetY, w: rowWidth, h: rowHeight };\n }\n\n if (!this._rowDisplayed[slot]) {\n row.setDisplayed(true);\n this._rowDisplayed[slot] = true;\n }\n\n return geomChanged;\n }\n\n /**\n * Hides pool slots whose index falls outside the visible window and\n * clears their cached binding so the next bind triggers a full rebuild.\n *\n * @param windowSize - The number of pool slots currently in use.\n */\n protected hideExcessPoolRows(windowSize: number): void {\n for (let i = windowSize; i < this._rowPool.length; i++) {\n if (this._rowDisplayed[i]) {\n this._rowPool[i].setDisplayed(false);\n this._rowDisplayed[i] = false;\n }\n this._boundIndices[i] = -1;\n this._rowGeom[i] = null;\n }\n }\n\n /**\n * Clears the cached row geometry so the next render re-applies positions and\n * sizes for every slot.\n */\n protected invalidateGeom(): void {\n for (let i = 0; i < this._rowGeom.length; i++) {\n this._rowGeom[i] = null;\n }\n }\n\n /**\n * Skips a render pass while the startup font gate is held, arranging for it\n * to run once the gate opens.\n *\n * @returns `true` when the caller must return without rendering.\n *\n * @remarks Both subclasses call {@link renderWindow} from many synchronous\n * entry points — `init`, a data change, a selection move — so a row's\n * geometry is routinely committed outside the coalesced layout queue, and\n * `init` in particular commits it the moment the element exists. Holding the\n * queue therefore does not hold these views; they have to check the gate\n * themselves. Deferring at this one choke point covers every entry point at\n * once, rather than guarding each caller.\n */\n protected deferRenderWhileFirstLayoutHeld(): boolean {\n if (!isFirstLayoutHeld()) {\n // This render is going ahead, which satisfies anything a held pass\n // left pending — clearing it keeps a later layout from replaying a\n // startup-era pass over the fresher state this one just committed.\n // Note that it also took over that pass's unfinished business, so\n // flag it for `finishResumedRender` to pick up once it has rendered.\n this._renderResumed = this._renderDeferred;\n this._renderDeferred = false;\n\n return false;\n }\n\n this._renderDeferred = true;\n this.scheduleLayout();\n\n return true;\n }\n\n /**\n * Whether the last render pass on this view was skipped by the startup font\n * gate and is still waiting to run.\n *\n * @returns `true` while a pass is pending.\n */\n protected wasRenderDeferred(): boolean {\n return this._renderDeferred;\n }\n\n /**\n * Reports, once, that the render now finishing is the one a held pass left\n * pending — so the caller can redo the post-render work that pass skipped.\n *\n * @returns `true` exactly once per resumed pass, at the end of the render\n * that resumed it.\n *\n * @remarks Called at the tail of {@link renderWindow} rather than from a\n * layout hook because a render resumes from whichever entry point reaches\n * it first, and for the table body that is the parent table layout calling\n * `renderWindow` directly rather than anything going through `doLayout`.\n */\n protected finishResumedRender(): boolean {\n // Read and clear before applying the scroll: applying it re-enters\n // `renderWindow` through the scroller's onScroll hook, and that nested\n // pass resets this flag. Reading it afterwards would lose the caller's\n // post-render work on exactly the passes that carry both.\n const resumed = this._renderResumed;\n\n this._renderResumed = false;\n\n // This pass has published the content extent, so any held offset can be\n // applied now — whether or not the pass is itself the deferred one.\n this.applyPendingScroll();\n\n return resumed;\n }\n\n /**\n * Runs the render pass the startup font gate deferred, if one is pending.\n * Each subclass calls this from its own `doLayout`, which is what picks the\n * pass back up once the gate opens.\n *\n * @returns `true` when a deferred pass ran, so the caller can skip a render\n * of its own and refresh whatever it keeps in step with the rendered rows.\n *\n * @remarks A paused view keeps its pass pending rather than running it: a\n * parent's layout recursion reaches `Body.doLayout` regardless of the\n * child's pause state, so rendering here would defeat a `pauseLayout` the\n * caller asked for. (`Tree.doLayout` already returns early when paused, so\n * the guard only binds for the body.) `resumeLayout` runs a layout of its\n * own, which picks the pass up.\n */\n protected renderWindowIfDeferred(): boolean {\n if (!this._renderDeferred || this.isLayoutPaused()) {\n return false;\n }\n\n // The pending flag is left for `renderWindow`'s own gate check to\n // consume: that is what marks this render as the resumed one, which\n // `finishResumedRender` reads at the end of the pass.\n this.renderWindow();\n\n return true;\n }\n\n /**\n * Re-binds and re-renders every pooled row after a text-metrics reflow —\n * a theme change, or the web font swapping in over the fallback face.\n *\n * @remarks Pooled rows do not ride `ThemeManager`'s reflow for free. Both\n * subclasses render through renderers whose `Text` runs with\n * `setAutoMeasure(false)`, so a bound row only re-measures inside the\n * renderer's `update()` — which {@link renderWindow} skips for a slot that\n * is already bound to its data index. Without the `_boundIndices` reset a\n * visible row therefore keeps the width it measured against whichever font\n * was active when it was bound, clipping the wider glyphs of the real face\n * once it arrives. Subclasses that cache metrics-derived state of their own\n * (row height, content width) override this to refresh it, then chain up.\n */\n protected onThemeReflow(): void {\n this._boundIndices.fill(-1);\n this.invalidateGeom();\n this.renderWindow();\n }\n\n /**\n * Scrolls the view so the row at `index` is fully visible, without moving\n * the viewport unless necessary. Delegates through {@link VirtualScroller}\n * so the header translate + scrollbar thumb stay in sync.\n *\n * @param index - The data index of the row to reveal. A negative index is a\n * no-op (the row is not in the current view).\n */\n protected scrollRowIntoView(index: number): void {\n if (index < 0 || !this._scroller) {\n return;\n }\n\n // Hold the row, not a target. The target depends on this view's height,\n // and at startup that height arrives from the very layout the gate is\n // holding — so computing it now would either read an unset height and\n // reveal nothing, or read 0 and scroll the row just out of view.\n if (isFirstLayoutHeld()) {\n this._pendingScrollRow = index;\n\n return;\n }\n\n const rowHeight = this.getRowHeight();\n const top = index * rowHeight;\n const bottom = top + rowHeight;\n const scrollTop = this._scroller.getScrollY();\n const viewportHeight = this.getHeight();\n const visibleBottom = scrollTop + viewportHeight;\n\n let target = scrollTop;\n if (top < scrollTop) {\n target = top;\n } else if (bottom > visibleBottom) {\n target = bottom - viewportHeight;\n }\n if (target !== scrollTop) {\n this.setScrollY(target);\n }\n }\n}\n\nexport { VirtualRowView };\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\n/**\n * Compares two selection sets by membership only — size and element\n * identity, regardless of insertion order.\n *\n * Pure; no DOM, no component state.\n *\n * @typeParam T - The selection identity type.\n * @param a - One selection set.\n * @param b - The other selection set.\n * @returns `true` when both sets have the same size and every member of\n * `a` is present in `b`.\n *\n * @internal Shared by `Tree` and `Body`; not barrel-exported.\n */\nexport function selectionsEqual<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): boolean {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":"sIASA,IAAM,EAAgB,EAGtB,SAAS,WAAc,EAAU,EAAqB,CAClD,EAAI,KAAK,GAAG,EAAI,OAAO,EAAG,CAAK,CAAC,CACpC,CAgCA,IAAe,eAAf,cAGU,CAAoB,CAE1B,SAAgF,CAAC,EACjF,cAA+E,CAAC,EAChF,SAA+E,CAAC,EAChF,cAA+E,CAAC,EAChF,UAA+E,KAG/E,iBAA0C,KAG1C,gBAAmC,GAEnC,eAAmC,GAEnC,gBAAyC,KACzC,gBAAyC,KAEzC,kBAA2C,KAgC3C,aAAuB,EAAuB,CAC1C,KAAK,UAAY,IAAI,EAAgB,KAAM,MAAe,KAAK,eAAe,CAAC,EAI/E,IAAK,IAAM,KAAU,KAAK,UAAU,aAAa,EAC7C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AC7C,GAAI,EAAQ,GAAK,CAAC,KAAK,UACnB,OAOJ,GAAI,EAAkB,EAAG,CACrB,KAAK,kBAAoB,EAEzB,MACJ,CAEA,IAAM,EAAiB,KAAK,aAAa,EACnC,EAAiB,EAAQ,EACzB,EAAiB,EAAM,EACvB,EAAiB,KAAK,UAAU,WAAW,EAC3C,EAAiB,KAAK,UAAU,EAChC,EAAiB,EAAY,EAE/B,EAAS,EACT,EAAM,EACN,EAAS,EACF,EAAS,IAChB,EAAS,EAAS,GAElB,IAAW,GACX,KAAK,WAAW,CAAM,CAE9B,CACJ,ECvlBA,SAAgB,gBAAmB,EAAmB,EAA4B,CAC9E,GAAI,EAAE,OAAS,EAAE,KACb,MAAO,GAGX,IAAK,IAAM,KAAQ,EACf,GAAI,CAAC,EAAE,IAAI,CAAI,EACX,MAAO,GAIf,MAAO,EACX"}
@@ -4,6 +4,7 @@ import { Text } from "../../component/input/Text.js";
4
4
  import { Glyph } from "../../component/display/Glyph.js";
5
5
  import { FillType } from "../../layout/FillType.js";
6
6
  import { AnchorType } from "../../layout/AnchorType.js";
7
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
7
8
  import { BorderOptions } from "../../primitive/Border.js";
8
9
  import { Insets } from "../../primitive/Insets.js";
9
10
  import { Size } from "../../primitive/Size.js";
@@ -41,6 +42,7 @@ export interface ButtonOptions extends ComponentOptions {
41
42
  };
42
43
  }
43
44
  declare class Button<TOptions extends ButtonOptions = ButtonOptions> extends Component<TOptions> {
45
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
44
46
  private _text;
45
47
  protected _content: Component;
46
48
  private _titleColumn;
@@ -72,6 +74,12 @@ declare class Button<TOptions extends ButtonOptions = ButtonOptions> extends Com
72
74
  private _hoverStyleRule?;
73
75
  private get hoverStyleRule();
74
76
  private _hoverBorder;
77
+ protected getRestingExclusionSuffixes(): readonly string[];
78
+ protected setElementCSSRule(key: string, value: Object | null): this;
79
+ protected static extractPressedClassDeclarations(defaults: Partial<ButtonOptions>): Record<string, string | null>;
80
+ protected getPressedClassDeclarations(): Record<string, string | null>;
81
+ protected static extractHoverClassDeclarations(_defaults: Partial<ButtonOptions>): Record<string, string | null>;
82
+ protected getHoverClassDeclarations(): Record<string, string | null>;
75
83
  private _flat?;
76
84
  private _compact?;
77
85
  private _enabledCursor;
@@ -117,6 +125,7 @@ declare class Button<TOptions extends ButtonOptions = ButtonOptions> extends Com
117
125
  setChromeless(value: boolean): this;
118
126
  private _clearChrome;
119
127
  private _restoreChrome;
128
+ private pinPressedToResting;
120
129
  isFlat(): boolean;
121
130
  setFlat(value: boolean): this;
122
131
  isCompact(): boolean;
@@ -1,9 +1,12 @@
1
1
  import { ToggleButton, ToggleButtonOptions } from "../../component/button/ToggleButton.js";
2
+ import type { ButtonOptions } from "../../component/button/Button.js";
2
3
  import { TabCloseButton } from "../../component/button/TabCloseButton.js";
4
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
5
  export interface TabButtonOptions extends ToggleButtonOptions {
4
6
  closeable?: boolean;
5
7
  }
6
8
  declare class TabButton extends ToggleButton {
9
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
7
10
  private _closeable;
8
11
  private _closeButton;
9
12
  private _busy;
@@ -11,6 +14,8 @@ declare class TabButton extends ToggleButton {
11
14
  constructor(text: string, options?: TabButtonOptions, subclassDefaults?: Partial<TabButtonOptions>);
12
15
  protected destructor(): void;
13
16
  private applyTabStyling;
17
+ protected static extractSelectedClassDeclarations(_defaults: Partial<ButtonOptions>): Record<string, string | null>;
18
+ protected getSelectedClassDeclarations(): Record<string, string | null>;
14
19
  private buildCloseButton;
15
20
  getCloseButton(): TabCloseButton | null;
16
21
  isCloseable(): boolean;
@@ -6,6 +6,9 @@ export interface ToggleButtonOptions extends ButtonOptions {
6
6
  declare class ToggleButton extends Button<ToggleButtonOptions> {
7
7
  private _selectedStyleRule?;
8
8
  private get selectedStyleRule();
9
+ protected static extractSelectedClassDeclarations(defaults: Partial<ButtonOptions>): Record<string, string | null>;
10
+ protected getSelectedClassDeclarations(): Record<string, string | null>;
11
+ protected getRestingExclusionSuffixes(): readonly string[];
9
12
  constructor(text: string, options?: ToggleButtonOptions, subclassDefaults?: Partial<ToggleButtonOptions>);
10
13
  protected applyOptions(options: ToggleButtonOptions): this;
11
14
  on(event: "action", listener: ClickListener): this;
@@ -1,4 +1,5 @@
1
1
  import { Panel, PanelOptions } from "../../core/Panel.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  import type { Handle, ElementPatch } from "../../core/DOM.js";
3
4
  import { AbstractStore } from "../../data/AbstractStore.js";
4
5
  import type { ChartScale } from "../../component/chart/Scale.js";
@@ -21,6 +22,7 @@ export interface AbstractChartOptions extends PanelOptions {
21
22
  listeners?: ChartListeners;
22
23
  }
23
24
  export declare abstract class AbstractChart<O extends AbstractChartOptions = AbstractChartOptions> extends Panel<O> {
25
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
24
26
  private _listeners;
25
27
  protected _series: ChartSeriesModel[];
26
28
  protected _selectedPoint: {
@@ -28,13 +28,14 @@ declare class Markdown extends Component<MarkdownOptions> {
28
28
  private readonly handleScheduledMeasure;
29
29
  private _renderGeneration;
30
30
  private _maxMeasure;
31
- constructor(markdown?: string, options?: MarkdownOptions);
31
+ constructor(markdown?: string, options?: MarkdownOptions, subclassDefaults?: Partial<MarkdownOptions>);
32
32
  protected applyOptions(options: MarkdownOptions): this;
33
33
  getMarkdown(): string;
34
34
  setLinkResolver(resolver: MarkdownLinkResolver): this;
35
35
  getLinkResolver(): MarkdownLinkResolver;
36
36
  setMaxMeasure(value: string | number | null): this;
37
37
  getMaxMeasure(): string | number | null;
38
+ applyStyle(element: Handle): this;
38
39
  setFontScale(value: number): this;
39
40
  getFontScale(): number;
40
41
  setMarkdown(markdown: string): this;
@@ -3,6 +3,7 @@ import { Component } from "../../core/Component.js";
3
3
  import type { Handle } from "../../core/DOM.js";
4
4
  import { Text } from "../../component/input/Text.js";
5
5
  import { PickerColumn } from "../../component/input/PickerColumn.js";
6
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
6
7
  declare const MONTH_HEIGHT: number;
7
8
  declare const NAV_BTN_WIDTH: number;
8
9
  declare const HEADER_HEIGHT: number;
@@ -52,6 +53,7 @@ export interface AbstractCalendarDropdownOptions extends AnimatedDropdownOptions
52
53
  maxDate?: Date | null;
53
54
  }
54
55
  declare abstract class AbstractCalendarDropdown<TOptions extends AbstractCalendarDropdownOptions = AbstractCalendarDropdownOptions> extends AnimatedDropdown<TOptions> {
56
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
55
57
  private readonly _onSelect;
56
58
  protected _value: Date | null;
57
59
  protected _monthAnchor: Date;
@@ -1,5 +1,6 @@
1
1
  import { AbstractInput, AbstractInputOptions } from "../../component/input/AbstractInput.js";
2
2
  import { AnimatedDropdown } from "../../core/AnimatedDropdown.js";
3
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
4
  import type { Handle } from "../../core/DOM.js";
4
5
  import { PickerInput } from "../../component/input/PickerInput.js";
5
6
  import { PickerButton } from "../../component/input/PickerButton.js";
@@ -10,6 +11,7 @@ export interface AbstractPickerFieldOptions extends AbstractInputOptions {
10
11
  declare abstract class AbstractPickerField<TValue, TDropdown extends AnimatedDropdown & {
11
12
  showAt(anchorEl: Handle, value: TValue | null): unknown;
12
13
  }, TOptions extends AbstractPickerFieldOptions = AbstractPickerFieldOptions> extends AbstractInput<TValue | null, TOptions> {
14
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
13
15
  protected _input: PickerInput;
14
16
  protected _button: PickerButton;
15
17
  protected _dropdown: TDropdown | null;
@@ -1,9 +1,11 @@
1
1
  import { AnimatedDropdown, AnimatedDropdownOptions } from "../../core/AnimatedDropdown.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
3
  import { List } from "../../component/list/List.js";
4
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
4
5
  interface AutoCompleteDropdownOptions extends AnimatedDropdownOptions {
5
6
  }
6
7
  declare class AutoCompleteDropdown extends AnimatedDropdown<AutoCompleteDropdownOptions> {
8
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
7
9
  private readonly _list;
8
10
  private readonly _onSelect;
9
11
  private readonly _onHide;
@@ -6,6 +6,7 @@ import { ModelRecord } from "../../data/ModelRecord.js";
6
6
  import { SelectableListItem, SelectableListItemSpec } from "../../component/list/AbstractSelectableList.js";
7
7
  import { ListItemRenderer } from "../../component/list/ListItemRenderer.js";
8
8
  import { List } from "../../component/list/List.js";
9
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
9
10
  export interface ComboBoxOptions extends AbstractInputOptions {
10
11
  items?: SelectableListItemSpec | Array<SelectableListItemSpec>;
11
12
  store?: AbstractStore;
@@ -25,9 +26,10 @@ export interface ComboBoxOptions extends AbstractInputOptions {
25
26
  };
26
27
  }
27
28
  declare class ComboBoxDropdown extends AnimatedDropdown<AnimatedDropdownOptions> {
29
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
28
30
  private readonly _list;
29
31
  private _minWidth;
30
- constructor(onSelect: (index: number) => void);
32
+ constructor(onSelect: (index: number) => void, subclassDefaults?: Partial<AnimatedDropdownOptions>);
31
33
  handleKey(e: KeyboardEvent): boolean;
32
34
  showAt(anchorEl: Handle, items: Array<SelectableListItem>, selectedIndex: number): this;
33
35
  setMinWidth(px: number): this;
@@ -1,5 +1,6 @@
1
1
  import { Text, TextOptions } from "../../component/input/Text.js";
2
2
  import type { ClickListener } from "../../component/button/Button.js";
3
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
4
  export type LinkEvent = "action";
4
5
  export interface LinkOptions extends TextOptions {
5
6
  interactive?: boolean;
@@ -8,6 +9,7 @@ export interface LinkOptions extends TextOptions {
8
9
  };
9
10
  }
10
11
  declare class Link extends Text<LinkOptions> {
12
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
11
13
  constructor(text?: String, options?: LinkOptions, subclassDefaults?: Partial<LinkOptions>);
12
14
  protected applyOptions(options: LinkOptions): this;
13
15
  isInteractive(): boolean;
@@ -1,8 +1,10 @@
1
1
  import { TextInput, TextInputOptions } from "../../component/input/TextInput.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  export interface PasswordFieldOptions extends TextInputOptions {
3
4
  newPassword?: boolean;
4
5
  }
5
6
  declare class PasswordField extends TextInput<PasswordFieldOptions> {
7
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
6
8
  constructor(options?: PasswordFieldOptions, subclassDefaults?: Partial<PasswordFieldOptions>);
7
9
  private updateHeight;
8
10
  }
@@ -1,5 +1,7 @@
1
1
  import { TextInput, TextInputOptions } from "../../component/input/TextInput.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  declare class PickerInput extends TextInput<TextInputOptions> {
4
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
3
5
  constructor();
4
6
  }
5
7
  declare const PickerInputCallable: import("../../core/Callable.js").Callable<typeof PickerInput>;
@@ -0,0 +1,11 @@
1
+ import { Text, TextOptions } from "../../component/input/Text.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
+ export interface SelectableTextOptions extends TextOptions {
4
+ }
5
+ declare class SelectableText extends Text<SelectableTextOptions> {
6
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
7
+ constructor(text?: String, options?: SelectableTextOptions, subclassDefaults?: Partial<SelectableTextOptions>);
8
+ }
9
+ declare const SelectableTextCallable: import("../../core/Callable.js").Callable<typeof SelectableText>;
10
+ type SelectableTextCallable = SelectableText;
11
+ export { SelectableText as _SelectableText, SelectableTextCallable as SelectableText, };
@@ -1,4 +1,5 @@
1
1
  import { Button, ButtonEvent, ButtonOptions, ClickListener } from "../../component/button/Button.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  export type SpinButtonEvent = ButtonEvent | "tick";
3
4
  export interface SpinButtonOptions extends ButtonOptions {
4
5
  listeners?: {
@@ -7,6 +8,7 @@ export interface SpinButtonOptions extends ButtonOptions {
7
8
  };
8
9
  }
9
10
  declare class SpinButton extends Button<SpinButtonOptions> {
11
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
10
12
  private _listeners;
11
13
  private _repeat;
12
14
  constructor(symbol: "▲" | "▼", options?: SpinButtonOptions, subclassDefaults?: Partial<SpinButtonOptions>);
@@ -1,6 +1,7 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
3
  import { Size } from "../../primitive/Size.js";
4
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
4
5
  export interface TextOptions extends ComponentOptions {
5
6
  tag?: string;
6
7
  text?: string;
@@ -20,11 +21,13 @@ export interface TextOptions extends ComponentOptions {
20
21
  truncate?: boolean;
21
22
  }
22
23
  declare class Text<TOptions extends TextOptions = TextOptions> extends Component<TOptions> {
24
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
23
25
  private _hasExplicitPreferredSize;
24
26
  private _fontSizeCSSVar;
25
27
  private _fontSizeCSSRule;
26
28
  private _lineHeightCSSVar;
27
29
  private _lineHeightCSSRule;
30
+ private _lineHeightValueClass;
28
31
  private _measuredBaseline;
29
32
  private _measuredMinSize;
30
33
  private _autoMeasure;
@@ -32,13 +35,18 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
32
35
  private _measuredGeneration;
33
36
  private _wordBreak;
34
37
  private _lineClamp;
38
+ private readonly _measureRef;
35
39
  constructor(text?: String, options?: NoInfer<TOptions>, subclassDefaults?: Partial<TOptions>);
40
+ protected destructor(): void;
36
41
  protected applyOptions(options: TOptions): this;
37
42
  private readThemeLineHeightPx;
38
43
  getElement(createIfMissing?: boolean): Handle | undefined;
39
44
  private resolveBoundFontSizePx;
40
45
  setPreferredSize(size: Size): this;
41
46
  private setCalculatedSize;
47
+ private applyNaturalMetrics;
48
+ private wantsBatchedMeasure;
49
+ private static batchMeasure;
42
50
  private calculateSize;
43
51
  private needsMeasure;
44
52
  measure(): void;
@@ -75,6 +83,8 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
75
83
  getFontWeight(): string | null;
76
84
  setFontWeight(value: string): this;
77
85
  getLineHeight(): number;
86
+ private applyLineHeightValueClass;
87
+ private clearLineHeightValueClass;
78
88
  setLineHeight(value: number | string): this;
79
89
  centerInHeight(px: number | null): this;
80
90
  getTextOverflow(): string | null;
@@ -87,9 +97,13 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
87
97
  getLineClamp(): number | null;
88
98
  setLineClamp(lines: number): this;
89
99
  clearLineClamp(): this;
90
- applyStyle(element: Handle): this;
100
+ protected getClassStyleDefaults(): ClassStyleDefaults;
101
+ private writeFontDeclaration;
102
+ protected applySubclassStyles(): void;
91
103
  protected render(): Handle;
92
104
  }
105
+ declare function _resetTextMeasurementRegistry(): void;
106
+ declare function _textMeasurementRegistrySize(): number;
93
107
  declare const TextCallable: import("../../core/Callable.js").Callable<typeof Text>;
94
108
  type TextCallable<TOptions extends TextOptions = TextOptions> = Text<TOptions>;
95
- export { Text as _Text, TextCallable as Text };
109
+ export { Text as _Text, TextCallable as Text, _resetTextMeasurementRegistry, _textMeasurementRegistrySize, };
@@ -1,11 +1,13 @@
1
1
  import { TextInput, TextInputOptions } from "../../component/input/TextInput.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
4
  export interface TextAreaOptions extends TextInputOptions {
4
5
  rows?: number;
5
6
  cols?: number;
6
7
  wrap?: string;
7
8
  }
8
9
  declare class TextArea extends TextInput<TextAreaOptions> {
10
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
9
11
  constructor(text?: string, options?: TextAreaOptions, subclassDefaults?: Partial<TextAreaOptions>);
10
12
  protected applyOptions(options: TextAreaOptions): this;
11
13
  getRows(): number | null;
@@ -1,8 +1,10 @@
1
1
  import { TextInput, TextInputOptions } from "../../component/input/TextInput.js";
2
2
  import { BorderOptions } from "../../primitive/Border.js";
3
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
4
  export interface TextFieldOptions extends TextInputOptions {
4
5
  }
5
6
  declare class TextField extends TextInput<TextFieldOptions> {
7
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
6
8
  constructor(options?: TextFieldOptions, subclassDefaults?: Partial<TextFieldOptions>);
7
9
  private updateHeight;
8
10
  setBorder(options: BorderOptions | string): this;
@@ -1,4 +1,5 @@
1
1
  import { AbstractInput, AbstractInputOptions } from "../../component/input/AbstractInput.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  import type { Handle } from "../../core/DOM.js";
3
4
  import { Event } from "../../core/Event.js";
4
5
  export interface TextInputOptions extends AbstractInputOptions {
@@ -16,6 +17,7 @@ export interface TextInputOptions extends AbstractInputOptions {
16
17
  };
17
18
  }
18
19
  declare class TextInput<TOptions extends TextInputOptions = TextInputOptions> extends AbstractInput<string, TOptions> {
20
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
19
21
  constructor(options?: TOptions, subclassDefaults?: Partial<TOptions>);
20
22
  protected onInput(): void;
21
23
  protected applyOptions(options: TOptions): this;
@@ -1,12 +1,14 @@
1
1
  import { AnimatedDropdown, AnimatedDropdownOptions } from "../../core/AnimatedDropdown.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
3
4
  export interface TimePickerDropdownOptions extends AnimatedDropdownOptions {
4
5
  showSeconds?: boolean;
5
6
  }
6
7
  declare class TimePickerDropdown extends AnimatedDropdown<TimePickerDropdownOptions> {
8
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
7
9
  private readonly _showSeconds;
8
10
  private readonly _timeColumns;
9
- constructor(onSelect: (hours: number, minutes: number, seconds: number) => void, options?: TimePickerDropdownOptions);
11
+ constructor(onSelect: (hours: number, minutes: number, seconds: number) => void, options?: TimePickerDropdownOptions, subclassDefaults?: Partial<TimePickerDropdownOptions>);
10
12
  private onPointerDown;
11
13
  showAt(anchorEl: Handle, selected: Date | null): this;
12
14
  }
@@ -1,8 +1,10 @@
1
1
  import { TextInput, TextInputOptions } from "../../component/input/TextInput.js";
2
+ import type { ClassStyleDefaults } from "../../core/ClassStyleRules.js";
2
3
  export interface UsernameFieldOptions extends TextInputOptions {
3
4
  email?: boolean;
4
5
  }
5
6
  declare class UsernameField extends TextInput<UsernameFieldOptions> {
7
+ protected static readonly ownClassStyleDefaults: ClassStyleDefaults;
6
8
  constructor(options?: UsernameFieldOptions, subclassDefaults?: Partial<UsernameFieldOptions>);
7
9
  private updateHeight;
8
10
  }
@@ -1,5 +1,7 @@
1
1
  export { Text } from '../../component/input/Text.js';
2
2
  export type { TextOptions } from '../../component/input/Text.js';
3
+ export { SelectableText } from '../../component/input/SelectableText.js';
4
+ export type { SelectableTextOptions } from '../../component/input/SelectableText.js';
3
5
  export { Label } from '../../component/input/Label.js';
4
6
  export type { LabelOptions } from '../../component/input/Label.js';
5
7
  export { Link } from '../../component/input/Link.js';