@mono-lit/helper 0.0.2 → 0.0.3

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 (497) hide show
  1. package/dist/{breakpoints-CAbhDUht.js → breakpoints-DllybT82.js} +7 -5
  2. package/dist/checkbox.css_raw-AYtSbUtY.js +5 -0
  3. package/dist/{chip-limits-BMoO31JM.js → chip-limits-CFABydIL.js} +5 -3
  4. package/dist/{chip-strip-Cw3gyz0q.js → chip-strip-bNfLn52Z.js} +5 -3
  5. package/dist/chip.css_raw-ChfRSHLO.js +5 -0
  6. package/dist/{color-DHYrfXsX.js → color-CEYYtRX-.js} +8 -7
  7. package/dist/{css-class-BRKRzHx-.js → css-class-B6Tc_MAx.js} +2 -1
  8. package/dist/{css-size-DhHSVZJK.js → css-size-DWAPgQdT.js} +2 -1
  9. package/dist/{data-source-controller-Dbb4fd8I.js → data-source-controller-Cf_sMxEh.js} +4 -2
  10. package/dist/{data-source-controller-B_rgHCjw.js → data-source-controller-Dx6IQ2CN.js} +4 -2
  11. package/dist/{data-source-options-CP-X62Pa.js → data-source-options-Bk-UoaZV.js} +15 -10
  12. package/dist/{data-source-options-Jqj7LU3Z.js → data-source-options-QjuI73g8.js} +17 -12
  13. package/dist/{data-source-read-B4DGp6UQ.js → data-source-read-Cuqw3LcP.js} +7 -4
  14. package/dist/{data-source-read-DL88aH8t.js → data-source-read-FxqzQkk2.js} +8 -5
  15. package/dist/{decorate-DEXtNagw.js → decorate-DbYFpi8R.js} +7 -5
  16. package/dist/{element-props-CLB6yvbm.js → element-props-xvw0EB7H.js} +4 -3
  17. package/dist/{esm-Ptok4SQZ.js → esm-D0We7ndD.js} +48 -44
  18. package/dist/{excel-DopRbEMK.js → excel-BXzr3uI1.js} +192 -16
  19. package/dist/{excel-CY6zGkcx.js → excel-DtRpxmxs.js} +27 -16
  20. package/dist/{export-BiGVyxt6.js → export-B91P6J1y.js} +104 -18
  21. package/dist/export.js +103 -18
  22. package/dist/{field-icons-DELrSdqJ.js → field-icons-FmyBWa0g.js} +3 -1
  23. package/dist/{field-path-C92eGLg3.js → field-path-BabiMrrA.js} +3 -2
  24. package/dist/{filter-builder-CE4zE0V5.js → filter-builder-B6Y2mmbM.js} +7 -4
  25. package/dist/{filter-builder-Bke3qOgJ.js → filter-builder-C0T3pMx2.js} +7 -4
  26. package/dist/{filter-eval-DIfU2EAn.js → filter-eval-ChDSaAUH.js} +7 -5
  27. package/dist/{filter-odata-C1vSGZaY.js → filter-odata-Bi27XUpQ.js} +9 -6
  28. package/dist/{form-control-core-B8d7k6vk.js → form-control-core-CIdMLXMo.js} +9 -6
  29. package/dist/{form-control-core-eeRr0zLU.js → form-control-core-CRZPZ1ru.js} +9 -6
  30. package/dist/hydration-flush-DHrl4_KK.js +1014 -0
  31. package/dist/{icon-CJkTlmTb.js → icon-BM9N-jOt.js} +5 -2
  32. package/dist/{icon-dVhYJUIH.js → icon-ClxnYhBG.js} +4 -2
  33. package/dist/{import-BgJdkwBI.js → import-Dc4eXC02.js} +22 -16
  34. package/dist/import.js +22 -16
  35. package/dist/index.js +17 -16
  36. package/dist/{index.node-BIqEGehH.js → index.node-dvrNviMx.js} +26 -20
  37. package/dist/index.node.js +17 -16
  38. package/dist/input.css_raw-CGESifay.js +5 -0
  39. package/dist/{layout-var-CZnzMC0s.js → layout-var-BSBKY49k.js} +3 -2
  40. package/dist/{light-slots-BVJwyg_2.js → light-slots-4ZCjOcBg.js} +6 -4
  41. package/dist/{light-slots-DW1WgfgT.js → light-slots-DdDdZ6zs.js} +6 -4
  42. package/dist/{markdown-DfqrfOJN.js → markdown-uGlE_OfJ.js} +414 -369
  43. package/dist/mono-button-CeDB9khW.js +878 -0
  44. package/dist/mono-button.shadow-D9NdMsmH.js +790 -0
  45. package/dist/{mono-data-chart-CEv29_NS.js → mono-data-chart-ChkelNT7.js} +15 -12
  46. package/dist/{mono-data-dropdown-Wnoke6zO.js → mono-data-dropdown-DxpUUk2y.js} +5 -3
  47. package/dist/{mono-data-grid-YjR3n9Ar.js → mono-data-grid-8jmeIXUU.js} +56 -38
  48. package/dist/{mono-data-grid-CjkEqxgE.js → mono-data-grid-BHlo1IgR.js} +56 -38
  49. package/dist/{mono-element-B0kP_96P.js → mono-element-C7vCschg.js} +7 -4
  50. package/dist/{mono-event-Bi1qP9uN.js → mono-event-BPku9HpS.js} +4 -3
  51. package/dist/{mono-form-controller-5PfsU4qa.js → mono-form-controller-IYn0MuUQ.js} +7 -4
  52. package/dist/{mono-modal-controller-BMO3n3rP.js → mono-modal-controller-ClObbHUs.js} +9 -7
  53. package/dist/{mono-ui-CPV7rrdo.js → mono-ui-BwUc0L6B.js} +22 -20
  54. package/dist/{normalize-error-Gcgmgh5i.js → normalize-error-D93O4q8g.js} +26 -20
  55. package/dist/{notifier-CE4yxMUQ.js → notifier-BIrqUzRh.js} +11 -1
  56. package/dist/nuxt.js +20 -15
  57. package/dist/{popup-portal-BziRX1yG.js → popup-portal-HWhkd7oy.js} +6 -4
  58. package/dist/{popup-stack-CEEMib__.js → popup-stack-De05Y-mJ.js} +13 -10
  59. package/dist/{rate-limit-BBa2PO79.js → rate-limit-e9Jlpl5l.js} +12 -9
  60. package/dist/{reactive-Di3mTMnV.js → reactive-DFCdZbH9.js} +30 -22
  61. package/dist/{reactive-D3EERqgO.js → reactive-Dtd-esHO.js} +2 -1
  62. package/dist/search.js +5 -4
  63. package/dist/src/components/accordion/accordion-core.d.ts +42 -40
  64. package/dist/src/components/accordion/accordion-types.d.ts +50 -48
  65. package/dist/src/components/accordion/index.d.ts +3 -2
  66. package/dist/src/components/accordion/index.shadow.d.ts +4 -4
  67. package/dist/src/components/accordion/mono-accordion.d.ts +44 -40
  68. package/dist/src/components/accordion/mono-accordion.shadow.d.ts +42 -38
  69. package/dist/src/components/alert/alert-core.d.ts +30 -28
  70. package/dist/src/components/alert/alert-types.d.ts +36 -34
  71. package/dist/src/components/alert/index.d.ts +3 -2
  72. package/dist/src/components/alert/index.shadow.d.ts +4 -4
  73. package/dist/src/components/alert/mono-alert.d.ts +30 -26
  74. package/dist/src/components/alert/mono-alert.shadow.d.ts +24 -20
  75. package/dist/src/components/breadcrumb/breadcrumb-core.d.ts +42 -40
  76. package/dist/src/components/breadcrumb/breadcrumb-list-core.d.ts +31 -29
  77. package/dist/src/components/breadcrumb/breadcrumb-render.d.ts +18 -16
  78. package/dist/src/components/breadcrumb/breadcrumb-types.d.ts +89 -87
  79. package/dist/src/components/breadcrumb/breadcrumb-utils.d.ts +18 -15
  80. package/dist/src/components/breadcrumb/index.d.ts +6 -5
  81. package/dist/src/components/breadcrumb/index.shadow.d.ts +7 -7
  82. package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +18 -14
  83. package/dist/src/components/breadcrumb/mono-breadcrumb-list.shadow.d.ts +33 -29
  84. package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +24 -20
  85. package/dist/src/components/breadcrumb/mono-breadcrumb.shadow.d.ts +55 -51
  86. package/dist/src/components/button/button-core.d.ts +73 -71
  87. package/dist/src/components/button/button-dropdown-core.d.ts +55 -53
  88. package/dist/src/components/button/button-dropdown-types.d.ts +98 -96
  89. package/dist/src/components/button/button-types.d.ts +157 -155
  90. package/dist/src/components/button/button-utils.d.ts +7 -5
  91. package/dist/src/components/button/index.button-dropdown.d.ts +5 -3
  92. package/dist/src/components/button/index.button-dropdown.shadow.d.ts +5 -3
  93. package/dist/src/components/button/index.d.ts +4 -7
  94. package/dist/src/components/button/index.shadow.d.ts +5 -4
  95. package/dist/src/components/button/mono-button-dropdown.d.ts +24 -19
  96. package/dist/src/components/button/mono-button-dropdown.shadow.d.ts +34 -29
  97. package/dist/src/components/button/mono-button.d.ts +105 -101
  98. package/dist/src/components/button/mono-button.shadow.d.ts +42 -38
  99. package/dist/src/components/card/card-core.d.ts +59 -57
  100. package/dist/src/components/card/card-types.d.ts +91 -89
  101. package/dist/src/components/card/card-utils.d.ts +11 -9
  102. package/dist/src/components/card/index.d.ts +4 -3
  103. package/dist/src/components/card/index.shadow.d.ts +5 -5
  104. package/dist/src/components/card/mono-card.d.ts +36 -32
  105. package/dist/src/components/card/mono-card.shadow.d.ts +32 -28
  106. package/dist/src/components/chart/chart-core.d.ts +30 -28
  107. package/dist/src/components/chart/chart-odata.d.ts +17 -16
  108. package/dist/src/components/chart/chart-types.d.ts +269 -267
  109. package/dist/src/components/chart/index.d.ts +7 -7
  110. package/dist/src/components/chart/index.shadow.d.ts +7 -6
  111. package/dist/src/components/chart/mono-chart-presets.d.ts +33 -29
  112. package/dist/src/components/chart/mono-chart-presets.shadow.d.ts +33 -29
  113. package/dist/src/components/chart/mono-chart.d.ts +13 -9
  114. package/dist/src/components/chart/mono-chart.shadow.d.ts +13 -9
  115. package/dist/src/components/chart/mono-data-chart.d.ts +4 -26
  116. package/dist/src/components/checkbox/checkbox-core.d.ts +39 -37
  117. package/dist/src/components/checkbox/checkbox-types.d.ts +59 -57
  118. package/dist/src/components/checkbox/checkbox-utils.d.ts +13 -11
  119. package/dist/src/components/checkbox/index.d.ts +4 -3
  120. package/dist/src/components/checkbox/index.shadow.d.ts +5 -4
  121. package/dist/src/components/checkbox/mono-checkbox.d.ts +21 -17
  122. package/dist/src/components/checkbox/mono-checkbox.shadow.d.ts +31 -27
  123. package/dist/src/components/chip/chip-core.d.ts +42 -40
  124. package/dist/src/components/chip/chip-types.d.ts +104 -102
  125. package/dist/src/components/chip/chip-utils.d.ts +20 -18
  126. package/dist/src/components/chip/index.d.ts +5 -7
  127. package/dist/src/components/chip/index.shadow.d.ts +6 -5
  128. package/dist/src/components/chip/mono-chip.d.ts +31 -27
  129. package/dist/src/components/chip/mono-chip.shadow.d.ts +19 -15
  130. package/dist/src/components/chip/mono-status-dot.d.ts +19 -17
  131. package/dist/src/components/date/date-core.d.ts +64 -62
  132. package/dist/src/components/date/date-types.d.ts +143 -141
  133. package/dist/src/components/date/index.d.ts +3 -2
  134. package/dist/src/components/date/index.shadow.d.ts +4 -3
  135. package/dist/src/components/date/mono-date.d.ts +12 -8
  136. package/dist/src/components/date/mono-date.shadow.d.ts +21 -17
  137. package/dist/src/components/drawer/drawer-core.d.ts +75 -73
  138. package/dist/src/components/drawer/drawer-types.d.ts +109 -107
  139. package/dist/src/components/drawer/index.d.ts +3 -2
  140. package/dist/src/components/drawer/index.shadow.d.ts +4 -3
  141. package/dist/src/components/drawer/mono-drawer.d.ts +32 -28
  142. package/dist/src/components/drawer/mono-drawer.shadow.d.ts +34 -31
  143. package/dist/src/components/dropdown/dropdown-core.d.ts +31 -29
  144. package/dist/src/components/dropdown/dropdown-types.d.ts +62 -60
  145. package/dist/src/components/dropdown/index.d.ts +3 -2
  146. package/dist/src/components/dropdown/index.shadow.d.ts +4 -3
  147. package/dist/src/components/dropdown/mono-dropdown.d.ts +23 -19
  148. package/dist/src/components/dropdown/mono-dropdown.shadow.d.ts +19 -15
  149. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +53 -51
  150. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +218 -216
  151. package/dist/src/components/dropdown-table/index.d.ts +5 -4
  152. package/dist/src/components/dropdown-table/index.shadow.d.ts +6 -5
  153. package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +119 -129
  154. package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +20 -16
  155. package/dist/src/components/dropdown-table/mono-dropdown-table.shadow.d.ts +15 -11
  156. package/dist/src/components/file-upload/file-upload-core.d.ts +44 -42
  157. package/dist/src/components/file-upload/file-upload-types.d.ts +123 -121
  158. package/dist/src/components/file-upload/file-upload-utils.d.ts +7 -4
  159. package/dist/src/components/file-upload/index.d.ts +4 -3
  160. package/dist/src/components/file-upload/index.shadow.d.ts +5 -4
  161. package/dist/src/components/file-upload/mono-file-upload.d.ts +20 -16
  162. package/dist/src/components/file-upload/mono-file-upload.shadow.d.ts +34 -30
  163. package/dist/src/components/filter/filter-builder-core.d.ts +17 -15
  164. package/dist/src/components/filter/filter-builder.d.ts +4 -22
  165. package/dist/src/components/filter/filter-odata.d.ts +3 -1
  166. package/dist/src/components/filter/filter-operators.d.ts +3 -1
  167. package/dist/src/components/filter/filter-types.d.ts +172 -170
  168. package/dist/src/components/filter/index.d.ts +6 -5
  169. package/dist/src/components/filter/index.shadow.d.ts +7 -6
  170. package/dist/src/components/filter/mono-filter-builder.d.ts +13 -10
  171. package/dist/src/components/filter/mono-filter-builder.shadow.d.ts +10 -7
  172. package/dist/src/components/form/form-control-core.d.ts +14 -12
  173. package/dist/src/components/form/form-rules.d.ts +7 -5
  174. package/dist/src/components/form/form-types.d.ts +214 -214
  175. package/dist/src/components/form/index.d.ts +5 -5
  176. package/dist/src/components/form/mono-form-controller.d.ts +4 -15
  177. package/dist/src/components/input/index.d.ts +5 -5
  178. package/dist/src/components/input/index.shadow.d.ts +6 -7
  179. package/dist/src/components/input/input-core.d.ts +73 -71
  180. package/dist/src/components/input/input-format.d.ts +22 -20
  181. package/dist/src/components/input/input-types.d.ts +167 -165
  182. package/dist/src/components/input/input-utils.d.ts +7 -5
  183. package/dist/src/components/input/mono-input.d.ts +35 -31
  184. package/dist/src/components/input/mono-input.shadow.d.ts +17 -13
  185. package/dist/src/components/menu/index.d.ts +7 -5
  186. package/dist/src/components/menu/index.shadow.d.ts +7 -6
  187. package/dist/src/components/menu/menu-core.d.ts +47 -45
  188. package/dist/src/components/menu/menu-render.d.ts +42 -40
  189. package/dist/src/components/menu/menu-types.d.ts +132 -130
  190. package/dist/src/components/menu/menu-utils.d.ts +16 -13
  191. package/dist/src/components/menu/mono-menu-list.d.ts +116 -114
  192. package/dist/src/components/menu/mono-menu.d.ts +30 -26
  193. package/dist/src/components/menu/mono-menu.shadow.d.ts +22 -18
  194. package/dist/src/components/modal/index.d.ts +5 -3
  195. package/dist/src/components/modal/index.shadow.d.ts +6 -4
  196. package/dist/src/components/modal/modal-core.d.ts +81 -79
  197. package/dist/src/components/modal/modal-types.d.ts +223 -221
  198. package/dist/src/components/modal/mono-modal-controller.d.ts +4 -3
  199. package/dist/src/components/modal/mono-modal.d.ts +32 -28
  200. package/dist/src/components/modal/mono-modal.shadow.d.ts +38 -35
  201. package/dist/src/components/nav/index.d.ts +4 -3
  202. package/dist/src/components/nav/index.shadow.d.ts +5 -5
  203. package/dist/src/components/nav/mono-nav.d.ts +28 -24
  204. package/dist/src/components/nav/mono-nav.shadow.d.ts +10 -7
  205. package/dist/src/components/nav/nav-core.d.ts +16 -14
  206. package/dist/src/components/nav/nav-types.d.ts +23 -22
  207. package/dist/src/components/nav/nav-utils.d.ts +10 -8
  208. package/dist/src/components/radio/index.d.ts +4 -3
  209. package/dist/src/components/radio/index.shadow.d.ts +5 -4
  210. package/dist/src/components/radio/mono-radio.d.ts +19 -15
  211. package/dist/src/components/radio/mono-radio.shadow.d.ts +22 -18
  212. package/dist/src/components/radio/radio-core.d.ts +31 -29
  213. package/dist/src/components/radio/radio-types.d.ts +48 -46
  214. package/dist/src/components/radio/radio-utils.d.ts +5 -3
  215. package/dist/src/components/rich-text-editor/index.d.ts +5 -4
  216. package/dist/src/components/rich-text-editor/index.shadow.d.ts +6 -5
  217. package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +19 -15
  218. package/dist/src/components/rich-text-editor/mono-rich-text-editor.shadow.d.ts +22 -19
  219. package/dist/src/components/rich-text-editor/rich-text-editor-core.d.ts +61 -59
  220. package/dist/src/components/rich-text-editor/rich-text-editor-loader.d.ts +2 -0
  221. package/dist/src/components/rich-text-editor/rich-text-editor-toolbar.d.ts +5 -3
  222. package/dist/src/components/rich-text-editor/rich-text-editor-types.d.ts +179 -177
  223. package/dist/src/components/select/index.d.ts +4 -3
  224. package/dist/src/components/select/index.shadow.d.ts +5 -4
  225. package/dist/src/components/select/mono-select.d.ts +58 -54
  226. package/dist/src/components/select/mono-select.shadow.d.ts +30 -27
  227. package/dist/src/components/select/select-core.d.ts +82 -80
  228. package/dist/src/components/select/select-types.d.ts +228 -227
  229. package/dist/src/components/select/select-utils.d.ts +7 -5
  230. package/dist/src/components/sidebar/index.d.ts +4 -3
  231. package/dist/src/components/sidebar/index.shadow.d.ts +5 -5
  232. package/dist/src/components/sidebar/mono-sidebar.d.ts +22 -18
  233. package/dist/src/components/sidebar/mono-sidebar.shadow.d.ts +11 -8
  234. package/dist/src/components/sidebar/sidebar-core.d.ts +33 -31
  235. package/dist/src/components/sidebar/sidebar-types.d.ts +77 -75
  236. package/dist/src/components/sidebar/sidebar-utils.d.ts +28 -26
  237. package/dist/src/components/switch/index.d.ts +4 -3
  238. package/dist/src/components/switch/index.shadow.d.ts +5 -4
  239. package/dist/src/components/switch/mono-switch.d.ts +19 -15
  240. package/dist/src/components/switch/mono-switch.shadow.d.ts +23 -19
  241. package/dist/src/components/switch/switch-core.d.ts +35 -33
  242. package/dist/src/components/switch/switch-types.d.ts +55 -53
  243. package/dist/src/components/switch/switch-utils.d.ts +5 -3
  244. package/dist/src/components/table/array-source.d.ts +31 -29
  245. package/dist/src/components/table/date-filter-tree.d.ts +25 -23
  246. package/dist/src/components/table/grouping.d.ts +22 -20
  247. package/dist/src/components/table/index.d.ts +28 -32
  248. package/dist/src/components/table/index.shadow.d.ts +34 -46
  249. package/dist/src/components/table/mono-data-grid.d.ts +1447 -1456
  250. package/dist/src/components/table/mono-table-checkbox-core.d.ts +34 -32
  251. package/dist/src/components/table/mono-table-checkbox.d.ts +12 -8
  252. package/dist/src/components/table/mono-table-checkbox.shadow.d.ts +16 -12
  253. package/dist/src/components/table/mono-table-detail-core.d.ts +29 -27
  254. package/dist/src/components/table/mono-table-detail.d.ts +12 -8
  255. package/dist/src/components/table/mono-table-detail.shadow.d.ts +13 -9
  256. package/dist/src/components/table/mono-table-empty-core.d.ts +24 -22
  257. package/dist/src/components/table/mono-table-empty.d.ts +17 -13
  258. package/dist/src/components/table/mono-table-empty.shadow.d.ts +22 -18
  259. package/dist/src/components/table/mono-table-error-core.d.ts +24 -22
  260. package/dist/src/components/table/mono-table-error.d.ts +12 -8
  261. package/dist/src/components/table/mono-table-error.shadow.d.ts +15 -11
  262. package/dist/src/components/table/mono-table-info-core.d.ts +6 -4
  263. package/dist/src/components/table/mono-table-info.d.ts +12 -8
  264. package/dist/src/components/table/mono-table-info.shadow.d.ts +9 -5
  265. package/dist/src/components/table/mono-table-loading-core.d.ts +7 -5
  266. package/dist/src/components/table/mono-table-loading.d.ts +12 -8
  267. package/dist/src/components/table/mono-table-loading.shadow.d.ts +9 -5
  268. package/dist/src/components/table/mono-table-page-size-core.d.ts +7 -5
  269. package/dist/src/components/table/mono-table-page-size.d.ts +12 -8
  270. package/dist/src/components/table/mono-table-page-size.shadow.d.ts +9 -5
  271. package/dist/src/components/table/mono-table-paging-core.d.ts +16 -14
  272. package/dist/src/components/table/mono-table-paging-group-core.d.ts +10 -8
  273. package/dist/src/components/table/mono-table-paging-group.d.ts +12 -8
  274. package/dist/src/components/table/mono-table-paging-group.shadow.d.ts +9 -5
  275. package/dist/src/components/table/mono-table-paging.d.ts +12 -8
  276. package/dist/src/components/table/mono-table-paging.shadow.d.ts +9 -5
  277. package/dist/src/components/table/mono-table-search-core.d.ts +51 -49
  278. package/dist/src/components/table/mono-table-search.d.ts +25 -22
  279. package/dist/src/components/table/mono-table-search.shadow.d.ts +12 -9
  280. package/dist/src/components/table/mono-table-sort-core.d.ts +16 -14
  281. package/dist/src/components/table/mono-table-sort.d.ts +21 -18
  282. package/dist/src/components/table/mono-table-sort.shadow.d.ts +11 -8
  283. package/dist/src/components/table/mono-table-summary-core.d.ts +9 -7
  284. package/dist/src/components/table/mono-table-summary.d.ts +12 -8
  285. package/dist/src/components/table/mono-table-summary.shadow.d.ts +9 -5
  286. package/dist/src/components/table/mono-table-th-core.d.ts +23 -21
  287. package/dist/src/components/table/mono-table-th.d.ts +21 -18
  288. package/dist/src/components/table/mono-table-th.shadow.d.ts +11 -8
  289. package/dist/src/components/table/store-group-source.d.ts +14 -12
  290. package/dist/src/components/table/table-controller-core.d.ts +17 -15
  291. package/dist/src/components/table/table-filter-icons.d.ts +3 -1
  292. package/dist/src/components/table/table-menu-core.d.ts +40 -38
  293. package/dist/src/components/table/table-overlay.d.ts +43 -41
  294. package/dist/src/components/table/table-sort-icons.d.ts +4 -2
  295. package/dist/src/components/table/table-sort-utils.d.ts +3 -1
  296. package/dist/src/components/table/table-types.d.ts +391 -400
  297. package/dist/src/components/tabs/index.d.ts +3 -2
  298. package/dist/src/components/tabs/index.shadow.d.ts +4 -3
  299. package/dist/src/components/tabs/mono-tabs.d.ts +21 -17
  300. package/dist/src/components/tabs/mono-tabs.shadow.d.ts +21 -17
  301. package/dist/src/components/tabs/tabs-core.d.ts +36 -34
  302. package/dist/src/components/tabs/tabs-types.d.ts +48 -46
  303. package/dist/src/components/tag-input/index.d.ts +5 -3
  304. package/dist/src/components/tag-input/index.shadow.d.ts +6 -4
  305. package/dist/src/components/tag-input/mono-tag-input.d.ts +56 -52
  306. package/dist/src/components/tag-input/mono-tag-input.shadow.d.ts +41 -38
  307. package/dist/src/components/tag-input/tag-input-core.d.ts +95 -93
  308. package/dist/src/components/tag-input/tag-input-types.d.ts +343 -346
  309. package/dist/src/components/tag-input/tag-input-utils.d.ts +7 -5
  310. package/dist/src/components/textarea/index.d.ts +4 -3
  311. package/dist/src/components/textarea/index.shadow.d.ts +5 -4
  312. package/dist/src/components/textarea/mono-textarea.d.ts +19 -15
  313. package/dist/src/components/textarea/mono-textarea.shadow.d.ts +19 -16
  314. package/dist/src/components/textarea/textarea-core.d.ts +48 -46
  315. package/dist/src/components/textarea/textarea-types.d.ts +120 -118
  316. package/dist/src/components/textarea/textarea-utils.d.ts +7 -5
  317. package/dist/src/components/tooltip/control-tooltip.d.ts +3 -1
  318. package/dist/src/components/tooltip/index.d.ts +6 -5
  319. package/dist/src/components/tooltip/tooltip-config.d.ts +17 -15
  320. package/dist/src/components/tooltip/tooltip-declarative.d.ts +3 -1
  321. package/dist/src/components/tooltip/tooltip-loader.d.ts +2 -0
  322. package/dist/src/components/tooltip/tooltip-types.d.ts +74 -72
  323. package/dist/src/composables/breakpoints.d.ts +9 -7
  324. package/dist/src/composables/chip-limits.d.ts +12 -10
  325. package/dist/src/composables/chip-strip.d.ts +91 -89
  326. package/dist/src/composables/color.d.ts +6 -4
  327. package/dist/src/composables/css-class.d.ts +4 -2
  328. package/dist/src/composables/css-size.d.ts +9 -7
  329. package/dist/src/composables/data-source-controller.d.ts +90 -88
  330. package/dist/src/composables/element-props.d.ts +3 -3
  331. package/dist/src/composables/field-icons.d.ts +3 -1
  332. package/dist/src/composables/hybird-prop.d.ts +10 -8
  333. package/dist/src/composables/hydration-flush.d.ts +16 -14
  334. package/dist/src/composables/icon.d.ts +3 -1
  335. package/dist/src/composables/layout-var.d.ts +2 -0
  336. package/dist/src/composables/light-slots.d.ts +34 -32
  337. package/dist/src/composables/mdi-glyphs.d.ts +2 -0
  338. package/dist/src/composables/mono-element.d.ts +3 -1
  339. package/dist/src/composables/mono-event.d.ts +15 -13
  340. package/dist/src/composables/mono-pending.d.ts +4 -2
  341. package/dist/src/composables/mono-skeleton.d.ts +100 -98
  342. package/dist/src/composables/mono-ui.d.ts +17 -18
  343. package/dist/src/composables/notifier.d.ts +20 -18
  344. package/dist/src/composables/popup-portal.d.ts +177 -175
  345. package/dist/src/composables/popup-stack.d.ts +36 -34
  346. package/dist/src/composables/rate-limit.d.ts +33 -31
  347. package/dist/src/composables/reactive.d.ts +3 -1
  348. package/dist/src/composables/shadow-css.d.ts +17 -15
  349. package/dist/src/composables/visibility.d.ts +6 -4
  350. package/dist/src/data/theme/index.d.ts +9 -7
  351. package/dist/src/data/theme/presets.d.ts +64 -62
  352. package/dist/src/entries/index.d.ts +36 -1
  353. package/dist/src/entries/index.node.d.ts +34 -41
  354. package/dist/src/entries/search.d.ts +2 -2
  355. package/dist/src/export/detail.d.ts +14 -12
  356. package/dist/src/export/download.d.ts +2 -0
  357. package/dist/src/export/excel/index.d.ts +13 -11
  358. package/dist/src/export/excel/nodes.d.ts +95 -93
  359. package/dist/src/export/expression.d.ts +3 -1
  360. package/dist/src/export/helpers.d.ts +3 -1
  361. package/dist/src/export/index.d.ts +6 -4
  362. package/dist/src/export/markdown.d.ts +19 -17
  363. package/dist/src/export/resolve-data.d.ts +3 -1
  364. package/dist/src/export/sentinel.d.ts +32 -30
  365. package/dist/src/export/sheet-name.d.ts +7 -5
  366. package/dist/src/export/styles.d.ts +13 -11
  367. package/dist/src/export/template.d.ts +3 -1
  368. package/dist/src/export/types.d.ts +224 -222
  369. package/dist/src/import/coerce.d.ts +5 -3
  370. package/dist/src/import/index.d.ts +12 -10
  371. package/dist/src/import/match.d.ts +20 -18
  372. package/dist/src/import/parse.d.ts +5 -3
  373. package/dist/src/import/types.d.ts +125 -123
  374. package/dist/src/nuxt/index.d.ts +92 -90
  375. package/dist/src/search/data-search.d.ts +92 -90
  376. package/dist/src/search/field-path.d.ts +10 -8
  377. package/dist/src/search/filter-eval.d.ts +2 -0
  378. package/dist/src/search/index.d.ts +6 -22
  379. package/dist/src/search/odata-search.d.ts +9 -7
  380. package/dist/src/search/search-expr.d.ts +16 -14
  381. package/dist/src/utils/data-source-apply.d.ts +11 -9
  382. package/dist/src/utils/data-source-options.d.ts +37 -35
  383. package/dist/src/utils/data-source-read.d.ts +40 -54
  384. package/dist/src/utils/data-source-summary.d.ts +8 -7
  385. package/dist/src/utils/normalize-error.d.ts +16 -14
  386. package/dist/src/vite/index.d.ts +34 -34
  387. package/dist/src/vite/mono-client-only.d.ts +34 -32
  388. package/dist/src/vite/mono-ssr-stub.d.ts +8 -6
  389. package/dist/src/vite/shadow-manifest.d.ts +2 -0
  390. package/dist/{styles-BIJ31TM4.js → styles-D-ergrfR.js} +417 -207
  391. package/dist/{tooltip-DQqNpqk2.js → tooltip-FCMRUSLi.js} +32 -25
  392. package/dist/tooltip.js +3 -2
  393. package/dist/ui/accordion.js +16 -12
  394. package/dist/ui/alert.js +21 -14
  395. package/dist/ui/breadcrumb.js +28 -18
  396. package/dist/ui/button-dropdown.js +18 -14
  397. package/dist/ui/button.js +4 -2
  398. package/dist/ui/card.js +17 -12
  399. package/dist/ui/chart.js +31 -26
  400. package/dist/ui/checkbox.js +17 -12
  401. package/dist/ui/chip.js +19 -12
  402. package/dist/ui/date.js +19 -15
  403. package/dist/ui/drawer.js +26 -20
  404. package/dist/ui/dropdown-table.js +39 -30
  405. package/dist/ui/dropdown.js +19 -15
  406. package/dist/ui/file-upload.js +22 -17
  407. package/dist/ui/filter.js +18 -14
  408. package/dist/ui/form.js +4 -3
  409. package/dist/ui/index.css +1073 -2197
  410. package/dist/ui/input.js +24 -17
  411. package/dist/ui/menu.js +32 -20
  412. package/dist/ui/modal.js +33 -26
  413. package/dist/ui/nav.js +21 -15
  414. package/dist/ui/radio.js +17 -12
  415. package/dist/ui/rich-text-editor.js +34 -28
  416. package/dist/ui/select.js +32 -26
  417. package/dist/ui/shadow/accordion.js +13 -9
  418. package/dist/ui/shadow/alert.js +13 -9
  419. package/dist/ui/shadow/breadcrumb.js +23 -14
  420. package/dist/ui/shadow/button-dropdown.js +17 -13
  421. package/dist/ui/shadow/button.js +4 -2
  422. package/dist/ui/shadow/card.js +15 -10
  423. package/dist/ui/shadow/chart.js +36 -29
  424. package/dist/ui/shadow/checkbox.js +13 -9
  425. package/dist/ui/shadow/chip.js +16 -10
  426. package/dist/ui/shadow/date.js +19 -12
  427. package/dist/ui/shadow/drawer.js +22 -16
  428. package/dist/ui/shadow/dropdown-table.js +39 -28
  429. package/dist/ui/shadow/dropdown.js +15 -11
  430. package/dist/ui/shadow/file-upload.js +26 -19
  431. package/dist/ui/shadow/filter.js +17 -13
  432. package/dist/ui/shadow/input.js +20 -14
  433. package/dist/ui/shadow/menu.js +24 -14
  434. package/dist/ui/shadow/modal.js +35 -27
  435. package/dist/ui/shadow/nav.js +18 -12
  436. package/dist/ui/shadow/radio.js +15 -10
  437. package/dist/ui/shadow/rich-text-editor.js +32 -26
  438. package/dist/ui/shadow/select.js +30 -24
  439. package/dist/ui/shadow/sidebar.js +23 -16
  440. package/dist/ui/shadow/switch.js +15 -10
  441. package/dist/ui/shadow/table.js +123 -84
  442. package/dist/ui/shadow/tabs.js +12 -8
  443. package/dist/ui/shadow/tag-input.js +37 -31
  444. package/dist/ui/shadow/textarea.js +17 -12
  445. package/dist/ui/sidebar.js +27 -20
  446. package/dist/ui/switch.js +17 -12
  447. package/dist/ui/table.js +129 -87
  448. package/dist/ui/tabs.js +15 -11
  449. package/dist/ui/tag-input.js +33 -27
  450. package/dist/ui/textarea.js +19 -14
  451. package/dist/{vite-C5iUK7so.js → vite-DcyRlTTf.js} +17 -9
  452. package/dist/vite.js +3 -2
  453. package/package.json +15 -14
  454. package/dist/checkbox-Cqpie9Ap.js +0 -4
  455. package/dist/chip-DBUUa2eB.js +0 -4
  456. package/dist/data/theme/presets.json.d.ts +0 -140
  457. package/dist/export.d.ts +0 -1
  458. package/dist/hydration-flush-RB5Tz5nl.js +0 -1001
  459. package/dist/import.d.ts +0 -1
  460. package/dist/index.d.ts +0 -1
  461. package/dist/index.node.d.ts +0 -1
  462. package/dist/input-zGOULADt.js +0 -4
  463. package/dist/mono-button-simcTQdW.js +0 -873
  464. package/dist/mono-button.shadow-B_rKOY9N.js +0 -784
  465. package/dist/nuxt.d.ts +0 -1
  466. package/dist/search.d.ts +0 -1
  467. package/dist/tooltip.d.ts +0 -1
  468. package/dist/ui/accordion.d.ts +0 -1
  469. package/dist/ui/alert.d.ts +0 -1
  470. package/dist/ui/breadcrumb.d.ts +0 -1
  471. package/dist/ui/button-dropdown.d.ts +0 -1
  472. package/dist/ui/button.d.ts +0 -1
  473. package/dist/ui/card.d.ts +0 -1
  474. package/dist/ui/chart.d.ts +0 -1
  475. package/dist/ui/checkbox.d.ts +0 -1
  476. package/dist/ui/chip.d.ts +0 -1
  477. package/dist/ui/date.d.ts +0 -1
  478. package/dist/ui/drawer.d.ts +0 -1
  479. package/dist/ui/dropdown-table.d.ts +0 -1
  480. package/dist/ui/dropdown.d.ts +0 -1
  481. package/dist/ui/file-upload.d.ts +0 -1
  482. package/dist/ui/filter.d.ts +0 -1
  483. package/dist/ui/form.d.ts +0 -1
  484. package/dist/ui/input.d.ts +0 -1
  485. package/dist/ui/menu.d.ts +0 -1
  486. package/dist/ui/modal.d.ts +0 -1
  487. package/dist/ui/nav.d.ts +0 -1
  488. package/dist/ui/radio.d.ts +0 -1
  489. package/dist/ui/rich-text-editor.d.ts +0 -1
  490. package/dist/ui/select.d.ts +0 -1
  491. package/dist/ui/sidebar.d.ts +0 -1
  492. package/dist/ui/switch.d.ts +0 -1
  493. package/dist/ui/table.d.ts +0 -1
  494. package/dist/ui/tabs.d.ts +0 -1
  495. package/dist/ui/tag-input.d.ts +0 -1
  496. package/dist/ui/textarea.d.ts +0 -1
  497. package/dist/vite.d.ts +0 -1
@@ -1,19 +1,20 @@
1
- import { MonoDataSource } from '../../composables/data-source-controller';
2
- import { MonoErrorMessages } from '../../utils/normalize-error';
3
- import { MonoGroupNode } from './grouping';
4
- import { MonoDateLevel } from './date-filter-tree';
5
- import { MonoExportOptions, MonoExportResult } from '../../export/types';
6
- import { MonoImportOptions, MonoImportResult } from '../../import/types';
7
- import { MonoEventProps } from '../../composables/element-props';
8
- import { TableDetailEvents } from './mono-table-detail-core';
9
- import { TableCheckboxEvents } from './mono-table-checkbox-core';
10
- import { TableEmptyEvents } from './mono-table-empty-core';
11
- import { TableErrorEvents } from './mono-table-error-core';
12
- import { MaybeReactive } from '../../composables/reactive';
13
- import { MonoDataSourceOptions, MonoOdataOptions } from '../../utils/data-source-options';
14
- import { MonoSearchExprEntry } from '../../search/search-expr.js';
15
- import { MonoSearchFieldsAliases, MonoSearchValue } from '../../search/data-search.js';
16
- import { MonoFilterBuilderOptions, MonoFilterController } from '../filter/filter-types';
1
+ import { MonoEventProps } from "../../composables/element-props.js";
2
+ import { MonoErrorMessages } from "../../utils/normalize-error.js";
3
+ import { MonoDataSource } from "../../composables/data-source-controller.js";
4
+ import { MonoGroupNode } from "./grouping.js";
5
+ import { MonoDateLevel, MonoDateRange, isDateRange } from "./date-filter-tree.js";
6
+ import { MonoExportOptions, MonoExportResult } from "../../export/types.js";
7
+ import { MonoImportOptions, MonoImportResult } from "../../import/types.js";
8
+ import { TableDetailEvents } from "./mono-table-detail-core.js";
9
+ import { TableCheckboxEvents } from "./mono-table-checkbox-core.js";
10
+ import { TableEmptyEvents } from "./mono-table-empty-core.js";
11
+ import { TableErrorEvents } from "./mono-table-error-core.js";
12
+ import { MaybeReactive } from "../../composables/reactive.js";
13
+ import { MonoDataSourceOptions, MonoOdataOptions, MonoSourceSortEntry } from "../../utils/data-source-options.js";
14
+ import { MonoSearchExprEntry } from "../../search/search-expr.js";
15
+ import { MonoSearchFieldsAliases, MonoSearchValue } from "../../search/data-search.js";
16
+ import { MonoFilterBuilderOptions, MonoFilterController } from "../filter/filter-types.js";
17
+ //#region src/components/table/mono-data-grid.d.ts
17
18
  /**
18
19
  * Structural shape of a devextreme DataSource as used by the table controller.
19
20
  * Extends the shared {@link MonoDataSource} with the extra methods devextreme
@@ -27,38 +28,38 @@ import { MonoFilterBuilderOptions, MonoFilterController } from '../filter/filter
27
28
  * store — and the mono IndexedDB mock — supply the writes at runtime.
28
29
  */
29
30
  export interface MonoGridStore {
30
- load(options?: unknown): PromiseLike<unknown>;
31
- update?(key: unknown, values: Record<string, unknown>): PromiseLike<unknown> | unknown;
32
- insert?(values: Record<string, unknown>): PromiseLike<unknown> | unknown;
33
- remove?(key: unknown): PromiseLike<unknown> | unknown;
34
- byKey?(key: unknown): PromiseLike<unknown> | unknown;
35
- key?(): string | string[] | undefined;
36
- /** OData protocol version (a devextreme `ODataStore`); absent on a CustomStore. */
37
- version?(): number;
38
- /** Optimistic client-side change notification (real devextreme store). */
39
- push?(changes: MonoStorePush[]): void;
31
+ load(options?: unknown): PromiseLike<unknown>;
32
+ update?(key: unknown, values: Record<string, unknown>): PromiseLike<unknown> | unknown;
33
+ insert?(values: Record<string, unknown>): PromiseLike<unknown> | unknown;
34
+ remove?(key: unknown): PromiseLike<unknown> | unknown;
35
+ byKey?(key: unknown): PromiseLike<unknown> | unknown;
36
+ key?(): string | string[] | undefined;
37
+ /** OData protocol version (a devextreme `ODataStore`); absent on a CustomStore. */
38
+ version?(): number;
39
+ /** Optimistic client-side change notification (real devextreme store). */
40
+ push?(changes: MonoStorePush[]): void;
40
41
  }
41
42
  export interface MonoGridSource<T = any> extends MonoDataSource<T> {
42
- reload?: () => PromiseLike<T[]> | T[];
43
- filter?(value?: unknown): unknown;
44
- searchValue?(value?: unknown): unknown;
45
- searchOperation?(op?: string): string;
46
- searchExpr?(expr?: unknown): unknown;
47
- sort?(value?: unknown): unknown;
48
- /** `$select` — devextreme's accessor (`undefined` READS; clear with `null`). */
49
- select?(value?: unknown): unknown;
50
- requireTotalCount?(value?: boolean): unknown;
51
- /**
52
- * devextreme's live `_storeLoadOptions` object. `expand` and `customQueryParams`
53
- * have no accessor of their own — an ODataStore declares them as custom load
54
- * options — so this is the only way to set them after construction.
55
- */
56
- loadOptions?(): Record<string, unknown>;
57
- pageCount?: () => number;
58
- /** devextreme DataSource's underlying store — server-side group paging + writes. */
59
- store?(): MonoGridStore | undefined;
60
- /** Full backing array (array sources only) — used to derive header-filter values client-side. */
61
- data?(): T[];
43
+ reload?: () => PromiseLike<T[]> | T[];
44
+ filter?(value?: unknown): unknown;
45
+ searchValue?(value?: unknown): unknown;
46
+ searchOperation?(op?: string): string;
47
+ searchExpr?(expr?: unknown): unknown;
48
+ sort?(value?: unknown): unknown;
49
+ /** `$select` — devextreme's accessor (`undefined` READS; clear with `null`). */
50
+ select?(value?: unknown): unknown;
51
+ requireTotalCount?(value?: boolean): unknown;
52
+ /**
53
+ * devextreme's live `_storeLoadOptions` object. `expand` and `customQueryParams`
54
+ * have no accessor of their own — an ODataStore declares them as custom load
55
+ * options — so this is the only way to set them after construction.
56
+ */
57
+ loadOptions?(): Record<string, unknown>;
58
+ pageCount?: () => number;
59
+ /** devextreme DataSource's underlying store — server-side group paging + writes. */
60
+ store?(): MonoGridStore | undefined;
61
+ /** Full backing array (array sources only) — used to derive header-filter values client-side. */
62
+ data?(): T[];
62
63
  }
63
64
  /** Sort direction (`null` = unsorted). */
64
65
  export type SortOrder = 'asc' | 'desc' | null;
@@ -69,121 +70,121 @@ export type SortOrder = 'asc' | 'desc' | null;
69
70
  * for a remote store, the order of the emitted `$orderby`.
70
71
  */
71
72
  export interface MonoSortEntry {
72
- field: string;
73
- order: 'asc' | 'desc';
73
+ field: string;
74
+ order: 'asc' | 'desc';
74
75
  }
75
76
  /** Per-call mode for {@link MonoTableController.setColumnFilter}. */
76
77
  export interface MonoSetColumnFilterOptions {
77
- /**
78
- * Keep the other columns' filters. `false` *(default)* — this column becomes the
79
- * ONLY filtered one, which is what the funnel icon does. `true` combines across
80
- * columns (AND between them, OR within one) — what the header's right-click
81
- * `Header Filter ›` row does, and the only way to filter two columns at once.
82
- */
83
- multi?: boolean;
84
- /**
85
- * This write is the COMBINE GESTURE (the right-click `Header Filter ›` row):
86
- * remember it, so that until nothing is filtered any more the funnel icon
87
- * combines too — a user who started combining means to keep combining. A
88
- * replace (`multi: false`) or an emptied filter forgets it. Read back with
89
- * `columnFilterCombining()`. Only meaningful with `multi: true`.
90
- */
91
- sticky?: boolean;
78
+ /**
79
+ * Keep the other columns' filters. `false` *(default)* — this column becomes the
80
+ * ONLY filtered one, which is what the funnel icon does. `true` combines across
81
+ * columns (AND between them, OR within one) — what the header's right-click
82
+ * `Header Filter ›` row does, and the only way to filter two columns at once.
83
+ */
84
+ multi?: boolean;
85
+ /**
86
+ * This write is the COMBINE GESTURE (the right-click `Header Filter ›` row):
87
+ * remember it, so that until nothing is filtered any more the funnel icon
88
+ * combines too — a user who started combining means to keep combining. A
89
+ * replace (`multi: false`) or an emptied filter forgets it. Read back with
90
+ * `columnFilterCombining()`. Only meaningful with `multi: true`.
91
+ */
92
+ sticky?: boolean;
92
93
  }
93
94
  /** Per-call mode for {@link MonoTableController.setSort}. */
94
95
  export interface MonoSetSortOptions {
95
- /**
96
- * Accumulate instead of replacing. `false` *(default)* — the field becomes the
97
- * ENTIRE sort, which is what a column's sort arrow does. `true` appends an
98
- * unsorted field (pick order = precedence), changes an already-sorted one in
99
- * place, and drops just that field on `null` — what the header's right-click
100
- * `Sort ›` menu does.
101
- */
102
- multi?: boolean;
103
- /**
104
- * This write is the COMBINE GESTURE (the right-click `Sort ›` menu): remember
105
- * it, so that until nothing is sorted any more the sort arrow appends too. A
106
- * replace (`multi: false`) or an emptied sort forgets it. Read back with
107
- * `sortCombining()`. Only meaningful with `multi: true` — a seeded default
108
- * sort passes `multi` without it, since it is not a gesture.
109
- */
110
- sticky?: boolean;
96
+ /**
97
+ * Accumulate instead of replacing. `false` *(default)* — the field becomes the
98
+ * ENTIRE sort, which is what a column's sort arrow does. `true` appends an
99
+ * unsorted field (pick order = precedence), changes an already-sorted one in
100
+ * place, and drops just that field on `null` — what the header's right-click
101
+ * `Sort ›` menu does.
102
+ */
103
+ multi?: boolean;
104
+ /**
105
+ * This write is the COMBINE GESTURE (the right-click `Sort ›` menu): remember
106
+ * it, so that until nothing is sorted any more the sort arrow appends too. A
107
+ * replace (`multi: false`) or an emptied sort forgets it. Read back with
108
+ * `sortCombining()`. Only meaningful with `multi: true` — a seeded default
109
+ * sort passes `multi` without it, since it is not a gesture.
110
+ */
111
+ sticky?: boolean;
111
112
  }
112
113
  export interface MonoColumnSort {
113
- /**
114
- * Whether the column is sortable at all. Defaults to `true` when a `sort` object
115
- * is given — `sort: true` is the shorthand for "sortable with defaults" (`{}`
116
- * still means the same).
117
- *
118
- * `enable: false` removes the sort UI entirely (identical to omitting `sort`) —
119
- * unlike `disabled`, which still renders the affordance but ignores clicks.
120
- */
121
- enable?: boolean;
122
- /**
123
- * Initial direction, seeded once when the column registers. Omit = unsorted.
124
- * Several columns may each seed one — they combine, in registration order
125
- * unless `index` pins them.
126
- */
127
- order?: 'asc' | 'desc';
128
- /**
129
- * **1-based** sort precedence. `index: 1` makes this column the primary key,
130
- * `index: 2` the secondary, and so on — whenever it is part of the sort, whether
131
- * it got there from `order` or from a click.
132
- *
133
- * Columns without an `index` keep their click order and fill the slots after
134
- * every indexed one. Gaps and duplicates are fine: the numbers only decide
135
- * relative order, so `index: 10` simply sorts after `index: 2`.
136
- */
137
- index?: number;
138
- /** Cycle `asc ↔ desc` only (never clears). */
139
- noClear?: boolean;
140
- /** Sortable UI is shown but inert. */
141
- disabled?: boolean;
142
- /**
143
- * Show the sort arrow beside the caption. Default `true`.
144
- *
145
- * The arrow is the single-sort click target, so hiding it moves that trigger
146
- * back onto the **caption** — the column stays sortable, it just loses the
147
- * glyph. Right-click still opens the header menu either way, and the `<sup>`
148
- * precedence badge renders either way.
149
- */
150
- showIcon?: boolean;
114
+ /**
115
+ * Whether the column is sortable at all. Defaults to `true` when a `sort` object
116
+ * is given — `sort: true` is the shorthand for "sortable with defaults" (`{}`
117
+ * still means the same).
118
+ *
119
+ * `enable: false` removes the sort UI entirely (identical to omitting `sort`) —
120
+ * unlike `disabled`, which still renders the affordance but ignores clicks.
121
+ */
122
+ enable?: boolean;
123
+ /**
124
+ * Initial direction, seeded once when the column registers. Omit = unsorted.
125
+ * Several columns may each seed one — they combine, in registration order
126
+ * unless `index` pins them.
127
+ */
128
+ order?: 'asc' | 'desc';
129
+ /**
130
+ * **1-based** sort precedence. `index: 1` makes this column the primary key,
131
+ * `index: 2` the secondary, and so on — whenever it is part of the sort, whether
132
+ * it got there from `order` or from a click.
133
+ *
134
+ * Columns without an `index` keep their click order and fill the slots after
135
+ * every indexed one. Gaps and duplicates are fine: the numbers only decide
136
+ * relative order, so `index: 10` simply sorts after `index: 2`.
137
+ */
138
+ index?: number;
139
+ /** Cycle `asc ↔ desc` only (never clears). */
140
+ noClear?: boolean;
141
+ /** Sortable UI is shown but inert. */
142
+ disabled?: boolean;
143
+ /**
144
+ * Show the sort arrow beside the caption. Default `true`.
145
+ *
146
+ * The arrow is the single-sort click target, so hiding it moves that trigger
147
+ * back onto the **caption** — the column stays sortable, it just loses the
148
+ * glyph. Right-click still opens the header menu either way, and the `<sup>`
149
+ * precedence badge renders either way.
150
+ */
151
+ showIcon?: boolean;
151
152
  }
152
153
  /** Devextreme load options for a header filter's DISTINCT-values request. */
153
154
  export interface MonoHeaderFilterLoadOptions {
154
- /** Columns to fetch. Defaults to `[field]`; pass `null`/`[]` to send none. */
155
- select?: string | string[] | null;
156
- /** Extra devextreme filter expression. Default: none. */
157
- filter?: unknown;
158
- sort?: unknown;
159
- /** `$top`. Default: **none** — the request is uncapped. */
160
- take?: number | null;
161
- /** `$skip`. Default: none. */
162
- skip?: number | null;
163
- requireTotalCount?: boolean;
164
- [key: string]: unknown;
155
+ /** Columns to fetch. Defaults to `[field]`; pass `null`/`[]` to send none. */
156
+ select?: string | string[] | null;
157
+ /** Extra devextreme filter expression. Default: none. */
158
+ filter?: unknown;
159
+ sort?: unknown;
160
+ /** `$top`. Default: **none** — the request is uncapped. */
161
+ take?: number | null;
162
+ /** `$skip`. Default: none. */
163
+ skip?: number | null;
164
+ requireTotalCount?: boolean;
165
+ [key: string]: unknown;
165
166
  }
166
167
  /**
167
168
  * Header-filter config for a column. `headerFilter: true` is shorthand for all of
168
169
  * these defaults.
169
170
  */
170
171
  export interface MonoHeaderFilter {
171
- /** Whether the filter is active. Defaults to `true` when an object is given. */
172
- enable?: boolean;
173
- /** Panel heading. Default `Filter: <caption or field>`. */
174
- title?: string;
175
- /**
176
- * Show the funnel icon left of the caption. Default `true`. The funnel opens the
177
- * value panel directly; right-click the header reaches it via the menu's
178
- * `Header Filter ›` row either way, so hiding the icon never strands it.
179
- */
180
- showIcon?: boolean;
181
- /**
182
- * Shapes the DISTINCT-values request. Defaults to `{ select: [field] }` only —
183
- * no `$filter`, no `$top`, no `$skip`, so an uncapped column scan. Set `take`
184
- * to cap it on a large table.
185
- */
186
- dataSourceOptions?: MonoHeaderFilterLoadOptions;
172
+ /** Whether the filter is active. Defaults to `true` when an object is given. */
173
+ enable?: boolean;
174
+ /** Panel heading. Default `Filter: <caption or field>`. */
175
+ title?: string;
176
+ /**
177
+ * Show the funnel icon left of the caption. Default `true`. The funnel opens the
178
+ * value panel directly; right-click the header reaches it via the menu's
179
+ * `Header Filter ›` row either way, so hiding the icon never strands it.
180
+ */
181
+ showIcon?: boolean;
182
+ /**
183
+ * Shapes the DISTINCT-values request. Defaults to `{ select: [field] }` only —
184
+ * no `$filter`, no `$top`, no `$skip`, so an uncapped column scan. Set `take`
185
+ * to cap it on a large table.
186
+ */
187
+ dataSourceOptions?: MonoHeaderFilterLoadOptions;
187
188
  }
188
189
  /**
189
190
  * Date-filter config for a column — the header filter's sibling for date /
@@ -199,49 +200,46 @@ export interface MonoHeaderFilter {
199
200
  * timestamp in scope, once per open, and the tree is built client-side.
200
201
  */
201
202
  export interface MonoDateFilter {
202
- /** Whether the filter is active. Defaults to `true` when an object is given. */
203
- enable?: boolean;
204
- /** Panel heading. Default `Filter: <caption or field>`. */
205
- title?: string;
206
- /** Show the funnel icon left of the caption. Default `true`. */
207
- showIcon?: boolean;
208
- /** Deepest tree level. Default `'month'`; `'day'` for a date-only column, `'second'` for the full drill-down. */
209
- depth?: MonoDateLevel;
210
- /** Read the year/month/… parts in UTC rather than local time. Default `false`. */
211
- utc?: boolean;
212
- /** BCP-47 tag for the month and weekday names. Default: the browser's. */
213
- locale?: string;
214
- /**
215
- * Shapes the DISTINCT-values request, exactly as `headerFilter.dataSourceOptions`
216
- * — set `take` to cap a huge datetime column (one value per distinct timestamp).
217
- */
218
- dataSourceOptions?: MonoHeaderFilterLoadOptions;
203
+ /** Whether the filter is active. Defaults to `true` when an object is given. */
204
+ enable?: boolean;
205
+ /** Panel heading. Default `Filter: <caption or field>`. */
206
+ title?: string;
207
+ /** Show the funnel icon left of the caption. Default `true`. */
208
+ showIcon?: boolean;
209
+ /** Deepest tree level. Default `'month'`; `'day'` for a date-only column, `'second'` for the full drill-down. */
210
+ depth?: MonoDateLevel;
211
+ /** Read the year/month/… parts in UTC rather than local time. Default `false`. */
212
+ utc?: boolean;
213
+ /** BCP-47 tag for the month and weekday names. Default: the browser's. */
214
+ locale?: string;
215
+ /**
216
+ * Shapes the DISTINCT-values request, exactly as `headerFilter.dataSourceOptions`
217
+ * — set `take` to cap a huge datetime column (one value per distinct timestamp).
218
+ */
219
+ dataSourceOptions?: MonoHeaderFilterLoadOptions;
219
220
  }
220
- export type { MonoDateLevel, MonoDateRange } from './date-filter-tree';
221
- export { isDateRange } from './date-filter-tree';
222
221
  /**
223
222
  * What a `distinctValues` resolver is handed, beside the load options — the
224
223
  * grid's base filter in the forms an `$apply` builder needs. Mirrors
225
224
  * {@link MonoSummaryResolveContext}, which is the other consumer-built `$apply`.
226
225
  */
227
226
  export interface MonoDistinctValuesContext {
228
- /**
229
- * The grid's base — `dataSourceOptions` / `odataOptions`, whatever the consumer
230
- * set on the source, `setFilter()` — AND-ed with the column's own
231
- * `headerFilter.dataSourceOptions.filter`. NOT the other columns' filters
232
- * (this panel is how those change) and not the search. Devextreme array form.
233
- */
234
- filter: unknown;
235
- /** `filter` as an OData string, or `''` when there is none. */
236
- odataFilter: string;
237
- /** `groupby((<field>),aggregate($count as count))` — no filter applied. */
238
- apply: string;
239
- /** `filter(<odataFilter>)/groupby(…)` — or just the groupby when there is no filter. */
240
- applyWithFilter: string;
241
- /** The bound source, for a resolver that needs its store or url. */
242
- source: unknown;
227
+ /**
228
+ * The grid's base — `dataSourceOptions` / `odataOptions`, whatever the consumer
229
+ * set on the source, `setFilter()` — AND-ed with the column's own
230
+ * `headerFilter.dataSourceOptions.filter`. NOT the other columns' filters
231
+ * (this panel is how those change) and not the search. Devextreme array form.
232
+ */
233
+ filter: unknown;
234
+ /** `filter` as an OData string, or `''` when there is none. */
235
+ odataFilter: string;
236
+ /** `groupby((<field>),aggregate($count as count))` — no filter applied. */
237
+ apply: string;
238
+ /** `filter(<odataFilter>)/groupby(…)` — or just the groupby when there is no filter. */
239
+ applyWithFilter: string;
240
+ /** The bound source, for a resolver that needs its store or url. */
241
+ source: unknown;
243
242
  }
244
- export type { MonoDataSourceOptions, MonoOdataOptions, MonoSourceSortEntry, } from '../../utils/data-source-options';
245
243
  /**
246
244
  * One column in `monoDataGrid({ props: { th } })` — everything that column needs,
247
245
  * declared once: its `mono-table-th` props, plus the `sort` and `summary` config
@@ -251,67 +249,67 @@ export type { MonoDataSourceOptions, MonoOdataOptions, MonoSourceSortEntry, } fr
251
249
  * the header for you.
252
250
  */
253
251
  export interface MonoTableColumnProps {
254
- /** Column field — also the identity every element matches on. Path-aware. */
255
- field: string;
252
+ /** Column field — also the identity every element matches on. Path-aware. */
253
+ field: string;
254
+ caption?: string;
255
+ /**
256
+ * Sortable config for both the `th` and a `<mono-table-sort field=…>`.
257
+ * `true` = sortable with every default (the same as `{}`, which still works);
258
+ * an object tunes it — see {@link MonoColumnSort}. `false` / omitted = not sortable.
259
+ */
260
+ sort?: boolean | (MonoColumnSort & {
261
+ disabled?: boolean;
262
+ noClear?: boolean;
256
263
  caption?: string;
257
- /**
258
- * Sortable config for both the `th` and a `<mono-table-sort field=…>`.
259
- * `true` = sortable with every default (the same as `{}`, which still works);
260
- * an object tunes it — see {@link MonoColumnSort}. `false` / omitted = not sortable.
261
- */
262
- sort?: boolean | (MonoColumnSort & {
263
- disabled?: boolean;
264
- noClear?: boolean;
265
- caption?: string;
266
- });
267
- /** Aggregate for a `<mono-table-summary field=…>`; also registered as a spec. */
268
- summary?: Omit<MonoSummarySpec, 'field'>;
269
- editable?: boolean;
270
- editableTrigger?: MonoEditableTrigger;
271
- /**
272
- * Draw a red `*` after this column's caption, so a user can see which columns
273
- * want input. Presentation only: `editable` is what opens an editor.
274
- */
275
- required?: boolean;
276
- /** `true` for the defaults, or an object to set the title / icon / query. */
277
- headerFilter?: boolean | MonoHeaderFilter;
278
- /**
279
- * A header filter for a DATE column: the panel is a year → … → second tree.
280
- * `true` for the defaults, or an object — see {@link MonoDateFilter}. Not
281
- * together with `headerFilter`.
282
- */
283
- dateFilter?: boolean | MonoDateFilter;
284
- /**
285
- * Presentation value for THIS column, written onto the mapped row under `field`
286
- * (`table.mapped` / `displayRows[].mapped`) — the raw row in `items` is untouched.
287
- *
288
- * It always receives the **raw** field value (and the raw row), never the
289
- * grid-level map's output — that is what keeps the body and the header-filter
290
- * list in agreement, since the filter can only feed it a raw distinct value.
291
- * It is applied last, so it overwrites whatever
292
- * {@link MonoDataGridOptions.map} put in this field.
293
- *
294
- * It also relabels this column's **header-filter** list, while the checkboxes
295
- * keep sending the RAW value, so filtering still matches the real data.
296
- *
297
- * Display only: search, sort, filters and summaries all read the raw value —
298
- * sorting a formatted date string would order it as text.
299
- *
300
- * @example map: (v) => formatDateTime(v)
301
- */
302
- map?: (value: any, row: any, index: number) => unknown;
303
- width?: string | number;
304
- height?: string | number;
305
- /**
306
- * Header alignment: `'left' | 'center' | 'right'`. Applied to the column's `<th>`.
307
- *
308
- * The body cells are the consumer's own markup, so mono cannot align them — but this is the
309
- * one place the intent is declared, and a `<td>` loop reading the same column entry keeps the
310
- * two sides in step.
311
- */
312
- align?: 'left' | 'center' | 'right';
313
- /** Anything else the element accepts. */
314
- [key: string]: unknown;
264
+ });
265
+ /** Aggregate for a `<mono-table-summary field=…>`; also registered as a spec. */
266
+ summary?: Omit<MonoSummarySpec, 'field'>;
267
+ editable?: boolean;
268
+ editableTrigger?: MonoEditableTrigger;
269
+ /**
270
+ * Draw a red `*` after this column's caption, so a user can see which columns
271
+ * want input. Presentation only: `editable` is what opens an editor.
272
+ */
273
+ required?: boolean;
274
+ /** `true` for the defaults, or an object to set the title / icon / query. */
275
+ headerFilter?: boolean | MonoHeaderFilter;
276
+ /**
277
+ * A header filter for a DATE column: the panel is a year → … → second tree.
278
+ * `true` for the defaults, or an object — see {@link MonoDateFilter}. Not
279
+ * together with `headerFilter`.
280
+ */
281
+ dateFilter?: boolean | MonoDateFilter;
282
+ /**
283
+ * Presentation value for THIS column, written onto the mapped row under `field`
284
+ * (`table.mapped` / `displayRows[].mapped`) — the raw row in `items` is untouched.
285
+ *
286
+ * It always receives the **raw** field value (and the raw row), never the
287
+ * grid-level map's output — that is what keeps the body and the header-filter
288
+ * list in agreement, since the filter can only feed it a raw distinct value.
289
+ * It is applied last, so it overwrites whatever
290
+ * {@link MonoDataGridOptions.map} put in this field.
291
+ *
292
+ * It also relabels this column's **header-filter** list, while the checkboxes
293
+ * keep sending the RAW value, so filtering still matches the real data.
294
+ *
295
+ * Display only: search, sort, filters and summaries all read the raw value —
296
+ * sorting a formatted date string would order it as text.
297
+ *
298
+ * @example map: (v) => formatDateTime(v)
299
+ */
300
+ map?: (value: any, row: any, index: number) => unknown;
301
+ width?: string | number;
302
+ height?: string | number;
303
+ /**
304
+ * Header alignment: `'left' | 'center' | 'right'`. Applied to the column's `<th>`.
305
+ *
306
+ * The body cells are the consumer's own markup, so mono cannot align them — but this is the
307
+ * one place the intent is declared, and a `<td>` loop reading the same column entry keeps the
308
+ * two sides in step.
309
+ */
310
+ align?: 'left' | 'center' | 'right';
311
+ /** Anything else the element accepts. */
312
+ [key: string]: unknown;
315
313
  }
316
314
  /**
317
315
  * Central props for the `mono-table-*` elements, so each is wired with just
@@ -325,77 +323,77 @@ export interface MonoTableColumnProps {
325
323
  * which one fired.
326
324
  */
327
325
  export interface MonoTableProps {
328
- /** Per-column config — `th`, `sort` and `summary` all resolve from this list. */
329
- th?: MonoTableColumnProps[];
330
- search?: Record<string, unknown>;
331
- info?: Record<string, unknown>;
332
- paging?: Record<string, unknown>;
333
- loading?: Record<string, unknown>;
334
- /**
335
- * Shared defaults for every `<mono-table-empty>` bound to this grid — one place
336
- * to set the `icon` / `title` / `subtitle` / `reload` an app uses everywhere,
337
- * instead of restating them on each table.
338
- */
339
- empty?: Record<string, unknown> & MonoEventProps<TableEmptyEvents>;
340
- /**
341
- * Shared defaults for every `<mono-table-error>` bound to this grid — one place
342
- * to set `dismissible` / `closeLabel` for the whole app.
343
- */
344
- error?: Record<string, unknown> & MonoEventProps<TableErrorEvents>;
345
- pageSize?: Record<string, unknown>;
346
- pagingGroup?: Record<string, unknown>;
347
- /**
348
- * Shared defaults for EVERY `<mono-table-detail>` bound to this grid — the
349
- * icons, `disabled`, `stay-open`. `open` is deliberately ignored here: it is
350
- * per-row state the user toggles, so re-applying it centrally would undo every
351
- * click. Open/close from code with {@link MonoTableController.detail}.
352
- */
353
- detail?: Record<string, unknown> & MonoEventProps<TableDetailEvents>;
354
- /**
355
- * Shared defaults for every `<mono-table-checkbox>` bound to this grid — the
356
- * natural home for `keyValue` / `mode` / `chunk`, so the header and the row
357
- * checkboxes can't disagree.
358
- */
359
- checkbox?: Record<string, unknown> & MonoEventProps<TableCheckboxEvents>;
326
+ /** Per-column config — `th`, `sort` and `summary` all resolve from this list. */
327
+ th?: MonoTableColumnProps[];
328
+ search?: Record<string, unknown>;
329
+ info?: Record<string, unknown>;
330
+ paging?: Record<string, unknown>;
331
+ loading?: Record<string, unknown>;
332
+ /**
333
+ * Shared defaults for every `<mono-table-empty>` bound to this grid — one place
334
+ * to set the `icon` / `title` / `subtitle` / `reload` an app uses everywhere,
335
+ * instead of restating them on each table.
336
+ */
337
+ empty?: Record<string, unknown> & MonoEventProps<TableEmptyEvents>;
338
+ /**
339
+ * Shared defaults for every `<mono-table-error>` bound to this grid — one place
340
+ * to set `dismissible` / `closeLabel` for the whole app.
341
+ */
342
+ error?: Record<string, unknown> & MonoEventProps<TableErrorEvents>;
343
+ pageSize?: Record<string, unknown>;
344
+ pagingGroup?: Record<string, unknown>;
345
+ /**
346
+ * Shared defaults for EVERY `<mono-table-detail>` bound to this grid — the
347
+ * icons, `disabled`, `stay-open`. `open` is deliberately ignored here: it is
348
+ * per-row state the user toggles, so re-applying it centrally would undo every
349
+ * click. Open/close from code with {@link MonoTableController.detail}.
350
+ */
351
+ detail?: Record<string, unknown> & MonoEventProps<TableDetailEvents>;
352
+ /**
353
+ * Shared defaults for every `<mono-table-checkbox>` bound to this grid — the
354
+ * natural home for `keyValue` / `mode` / `chunk`, so the header and the row
355
+ * checkboxes can't disagree.
356
+ */
357
+ checkbox?: Record<string, unknown> & MonoEventProps<TableCheckboxEvents>;
360
358
  }
361
359
  /**
362
360
  * A registered `<mono-table-detail>`, as the controller sees it. Only the two
363
361
  * pieces of state `table.detail()` drives are part of the contract.
364
362
  */
365
363
  export interface MonoDetailEl {
366
- /** Whether the row's panel is showing. */
367
- open: boolean;
368
- /**
369
- * Exempt from every AUTOMATIC close — both the accordion
370
- * ({@link MonoDetailHandle.collapseOthers}) and {@link MonoDetailHandle.collapseAll}.
371
- * Not a lock: the row's own chevron still closes it.
372
- */
373
- stayOpen?: boolean;
374
- /** Present on real elements; used to return `getAll()` in DOM order. */
375
- compareDocumentPosition?(other: Node): number;
364
+ /** Whether the row's panel is showing. */
365
+ open: boolean;
366
+ /**
367
+ * Exempt from every AUTOMATIC close — both the accordion
368
+ * ({@link MonoDetailHandle.collapseOthers}) and {@link MonoDetailHandle.collapseAll}.
369
+ * Not a lock: the row's own chevron still closes it.
370
+ */
371
+ stayOpen?: boolean;
372
+ /** Present on real elements; used to return `getAll()` in DOM order. */
373
+ compareDocumentPosition?(other: Node): number;
376
374
  }
377
375
  /** The handle returned by `table.detail()`. */
378
376
  export interface MonoDetailHandle {
379
- /** Open every registered detail (never auto-closes anything). */
380
- expandAll(): void;
381
- /**
382
- * Close every registered detail EXCEPT those marked `stay-open`. Those keep
383
- * their panel; their own chevron still closes them by hand.
384
- */
385
- collapseAll(): void;
386
- /**
387
- * Close every registered detail except `except` and the `stay-open` ones.
388
- *
389
- * This is the **accordion**: `<mono-table-detail>` calls it on itself whenever
390
- * the user opens it, so opening one row closes the row that was open. Details
391
- * registered on a DIFFERENT controller (a nested grid's) are untouched, which
392
- * is what lets a nested table run its own accordion.
393
- */
394
- collapseOthers(except?: MonoDetailEl): void;
395
- /** How many panels are open right now. */
396
- openCount(): number;
397
- /** Every registered `<mono-table-detail>`, in DOM (visual) order. */
398
- getAll(): MonoDetailEl[];
377
+ /** Open every registered detail (never auto-closes anything). */
378
+ expandAll(): void;
379
+ /**
380
+ * Close every registered detail EXCEPT those marked `stay-open`. Those keep
381
+ * their panel; their own chevron still closes them by hand.
382
+ */
383
+ collapseAll(): void;
384
+ /**
385
+ * Close every registered detail except `except` and the `stay-open` ones.
386
+ *
387
+ * This is the **accordion**: `<mono-table-detail>` calls it on itself whenever
388
+ * the user opens it, so opening one row closes the row that was open. Details
389
+ * registered on a DIFFERENT controller (a nested grid's) are untouched, which
390
+ * is what lets a nested table run its own accordion.
391
+ */
392
+ collapseOthers(except?: MonoDetailEl): void;
393
+ /** How many panels are open right now. */
394
+ openCount(): number;
395
+ /** Every registered `<mono-table-detail>`, in DOM (visual) order. */
396
+ getAll(): MonoDetailEl[];
399
397
  }
400
398
  /**
401
399
  * How a `type="all"` `<mono-table-checkbox>` selects.
@@ -407,107 +405,107 @@ export interface MonoDetailHandle {
407
405
  export type MonoCheckMode = 'all' | 'per-page';
408
406
  /** Shared config for the checkboxes bound to one grid. */
409
407
  export interface MonoCheckConfig {
410
- /**
411
- * Field(s) `getAll()` projects each selected row down to. Path-aware and
412
- * shape-preserving: `['Company.Name', 'Transaction.[*].Id']` yields
413
- * `{ Company: { Name }, Transaction: [{ Id }] }`. Omit for the whole row.
414
- */
415
- keyValue?: string | string[];
416
- mode?: MonoCheckMode;
417
- /** Rows per request while draining in `mode: 'all'` (default 100). */
418
- chunk?: number;
419
- /**
420
- * Most rows the USER can have selected (unset = unlimited). A pick past the cap
421
- * is rejected — the store does not change and notifies so a bound checkbox
422
- * un-ticks itself; a bulk select (`selectPage` / `selectAll`) fills only the
423
- * room left. `replace()` is not capped: a value the developer pushes in is theirs.
424
- */
425
- max?: number | null;
426
- /**
427
- * Fewest rows the USER can leave selected (unset = 0). Un-ticking at the floor
428
- * is rejected the same way; `clear()` keeps the first `min` rows. Only guards
429
- * removals — an empty store starts empty regardless.
430
- */
431
- min?: number | null;
408
+ /**
409
+ * Field(s) `getAll()` projects each selected row down to. Path-aware and
410
+ * shape-preserving: `['Company.Name', 'Transaction.[*].Id']` yields
411
+ * `{ Company: { Name }, Transaction: [{ Id }] }`. Omit for the whole row.
412
+ */
413
+ keyValue?: string | string[];
414
+ mode?: MonoCheckMode;
415
+ /** Rows per request while draining in `mode: 'all'` (default 100). */
416
+ chunk?: number;
417
+ /**
418
+ * Most rows the USER can have selected (unset = unlimited). A pick past the cap
419
+ * is rejected — the store does not change and notifies so a bound checkbox
420
+ * un-ticks itself; a bulk select (`selectPage` / `selectAll`) fills only the
421
+ * room left. `replace()` is not capped: a value the developer pushes in is theirs.
422
+ */
423
+ max?: number | null;
424
+ /**
425
+ * Fewest rows the USER can leave selected (unset = 0). Un-ticking at the floor
426
+ * is rejected the same way; `clear()` keeps the first `min` rows. Only guards
427
+ * removals — an empty store starts empty regardless.
428
+ */
429
+ min?: number | null;
432
430
  }
433
431
  /** The user-facing selection limits, resolved to numbers. */
434
432
  export interface MonoCheckLimits {
435
- max?: number;
436
- min?: number;
433
+ max?: number;
434
+ min?: number;
437
435
  }
438
436
  /** The handle returned by `table.check()`. */
439
437
  export interface MonoCheckHandle<T = any> {
440
- /**
441
- * The selection, each row projected through `keyValue`. **Synchronous** — it
442
- * returns what is selected right now, so a template can read it directly; a
443
- * `mode: 'all'` drain fills it in and notifies when it lands.
444
- */
445
- getAll(): T[];
446
- /** How many rows are selected. */
447
- count(): number;
448
- /**
449
- * The selected rows themselves, in selection order and UNPROJECTED — unlike
450
- * {@link getAll}, which narrows each row to `keyValue`. For callers that need the
451
- * whole row back (the dropdown derives its `modelValue` and chip text from these).
452
- */
453
- rows(): T[];
454
- /** Whether a row (or its `rowKey`) is selected. */
455
- isChecked(row: T | string): boolean;
456
- /** Select / deselect one row. Omit `checked` to flip it. */
457
- toggle(item: T, checked?: boolean): void;
458
- /** Select every row of the loaded page. */
459
- selectPage(): void;
460
- /**
461
- * Replace the whole selection in ONE update. The bulk primitive: setting N rows
462
- * through {@link toggle} would notify N times, which is the difference between
463
- * one render and 830 of them.
464
- */
465
- replace(rows: readonly T[]): void;
466
- /**
467
- * Select everything the current search/filter matches, draining the source in
468
- * `chunk`-sized requests. Resolves when the drain finishes; the selection is
469
- * also readable (and notified) as it lands.
470
- *
471
- * The last drain is remembered, so calling this again over the **same row set**
472
- * — the "select all, untick one, select all again" loop — re-selects instantly
473
- * and issues no request. Any change to the filter, search, `keyValue`
474
- * projection or the data itself walks the source afresh.
475
- */
476
- selectAll(): Promise<void>;
477
- /** Empty the selection. */
478
- clear(): void;
479
- /** Whether a `selectAll()` drain is in flight. */
480
- readonly pending: boolean;
481
- /** Every loaded row is selected (and there is at least one). */
482
- readonly allChecked: boolean;
483
- /** Some — but not all — loaded rows are selected (the indeterminate state). */
484
- readonly someChecked: boolean;
485
- /** The configured `max` / `min` (see {@link MonoCheckConfig}), sanitised. */
486
- limits(): MonoCheckLimits;
487
- /** `max` is set and the selection has reached it — the next pick is rejected. */
488
- readonly atMax: boolean;
489
- /** `min` is set and the selection is at (or under) it — the next removal is rejected. */
490
- readonly atMin: boolean;
491
- /** Set the shared config. Called by the elements from their own props. */
492
- configure(config: MonoCheckConfig): void;
438
+ /**
439
+ * The selection, each row projected through `keyValue`. **Synchronous** — it
440
+ * returns what is selected right now, so a template can read it directly; a
441
+ * `mode: 'all'` drain fills it in and notifies when it lands.
442
+ */
443
+ getAll(): T[];
444
+ /** How many rows are selected. */
445
+ count(): number;
446
+ /**
447
+ * The selected rows themselves, in selection order and UNPROJECTED — unlike
448
+ * {@link getAll}, which narrows each row to `keyValue`. For callers that need the
449
+ * whole row back (the dropdown derives its `modelValue` and chip text from these).
450
+ */
451
+ rows(): T[];
452
+ /** Whether a row (or its `rowKey`) is selected. */
453
+ isChecked(row: T | string): boolean;
454
+ /** Select / deselect one row. Omit `checked` to flip it. */
455
+ toggle(item: T, checked?: boolean): void;
456
+ /** Select every row of the loaded page. */
457
+ selectPage(): void;
458
+ /**
459
+ * Replace the whole selection in ONE update. The bulk primitive: setting N rows
460
+ * through {@link toggle} would notify N times, which is the difference between
461
+ * one render and 830 of them.
462
+ */
463
+ replace(rows: readonly T[]): void;
464
+ /**
465
+ * Select everything the current search/filter matches, draining the source in
466
+ * `chunk`-sized requests. Resolves when the drain finishes; the selection is
467
+ * also readable (and notified) as it lands.
468
+ *
469
+ * The last drain is remembered, so calling this again over the **same row set**
470
+ * — the "select all, untick one, select all again" loop — re-selects instantly
471
+ * and issues no request. Any change to the filter, search, `keyValue`
472
+ * projection or the data itself walks the source afresh.
473
+ */
474
+ selectAll(): Promise<void>;
475
+ /** Empty the selection. */
476
+ clear(): void;
477
+ /** Whether a `selectAll()` drain is in flight. */
478
+ readonly pending: boolean;
479
+ /** Every loaded row is selected (and there is at least one). */
480
+ readonly allChecked: boolean;
481
+ /** Some — but not all — loaded rows are selected (the indeterminate state). */
482
+ readonly someChecked: boolean;
483
+ /** The configured `max` / `min` (see {@link MonoCheckConfig}), sanitised. */
484
+ limits(): MonoCheckLimits;
485
+ /** `max` is set and the selection has reached it — the next pick is rejected. */
486
+ readonly atMax: boolean;
487
+ /** `min` is set and the selection is at (or under) it — the next removal is rejected. */
488
+ readonly atMin: boolean;
489
+ /** Set the shared config. Called by the elements from their own props. */
490
+ configure(config: MonoCheckConfig): void;
493
491
  }
494
492
  /** A resolved column definition, as read from a registered `mono-table-th`. */
495
493
  export interface MonoColumn {
496
- /**
497
- * Column field. May be a **path expression** into nested / collection data —
498
- * `"Job.Name"` (nested), `"User.[1].Id"` (index), `"User.[*].Name"` (wildcard).
499
- * `.`/`[` are reserved. See {@link getFieldValue} / {@link toODataClause}.
500
- */
501
- field: string;
502
- caption?: string;
503
- /** `true` = sortable with defaults; an object tunes it; `false` / omitted = not sortable. */
504
- sort?: boolean | MonoColumnSort;
505
- /** Whether the column's cells can be edited (`mono-table-th` `editable`). */
506
- editable?: boolean;
507
- /** The column's header-filter config (`mono-table-th` `header-filter`), if any. */
508
- headerFilter?: boolean | MonoHeaderFilter;
509
- /** The column's date-filter config (`mono-table-th` `date-filter`), if any. */
510
- dateFilter?: boolean | MonoDateFilter;
494
+ /**
495
+ * Column field. May be a **path expression** into nested / collection data —
496
+ * `"Job.Name"` (nested), `"User.[1].Id"` (index), `"User.[*].Name"` (wildcard).
497
+ * `.`/`[` are reserved. See {@link getFieldValue} / {@link toODataClause}.
498
+ */
499
+ field: string;
500
+ caption?: string;
501
+ /** `true` = sortable with defaults; an object tunes it; `false` / omitted = not sortable. */
502
+ sort?: boolean | MonoColumnSort;
503
+ /** Whether the column's cells can be edited (`mono-table-th` `editable`). */
504
+ editable?: boolean;
505
+ /** The column's header-filter config (`mono-table-th` `header-filter`), if any. */
506
+ headerFilter?: boolean | MonoHeaderFilter;
507
+ /** The column's date-filter config (`mono-table-th` `date-filter`), if any. */
508
+ dateFilter?: boolean | MonoDateFilter;
511
509
  }
512
510
  /**
513
511
  * One search term. `field` binds it to a single column (a "context"); omit it to
@@ -517,13 +515,13 @@ export interface MonoColumn {
517
515
  * on `Nama` widen, while a term on `Code` narrows.
518
516
  */
519
517
  export interface MonoSearchTerm {
520
- value: string;
521
- field?: string;
518
+ value: string;
519
+ field?: string;
522
520
  }
523
521
  /** One distinct value of a column, with its occurrence count — for the header filter list. */
524
522
  export interface MonoColumnValue {
525
- value: unknown;
526
- count: number;
523
+ value: unknown;
524
+ count: number;
527
525
  }
528
526
  /**
529
527
  * One entry of the central `columns` config passed to `monoDataGrid(data, { columns })`.
@@ -534,9 +532,9 @@ export interface MonoColumnValue {
534
532
  * read via `table.registeredColumns()`).
535
533
  */
536
534
  export interface MonoColumnDef {
537
- field: string;
538
- caption?: string;
539
- [key: string]: unknown;
535
+ field: string;
536
+ caption?: string;
537
+ [key: string]: unknown;
540
538
  }
541
539
  /**
542
540
  * How a row's inline editor is opened. `'click'` (the default) opens on a single
@@ -566,10 +564,10 @@ export type MonoEditorNavKeys = 'tab-arrows' | 'native';
566
564
  export type MonoEditorDirection = 'left' | 'right' | 'up' | 'down';
567
565
  /** The iterable handle returned by `table.columns()` (mirrors {@link MonoSummaryHandle}). */
568
566
  export interface MonoColumnHandle {
569
- /** The column def for `field`, or `null` when it isn't in the config. */
570
- get(field: string): MonoColumnDef | null;
571
- /** Every configured column def, in declaration order — loop to render / inspect. */
572
- getAll(): MonoColumnDef[];
567
+ /** The column def for `field`, or `null` when it isn't in the config. */
568
+ get(field: string): MonoColumnDef | null;
569
+ /** Every configured column def, in declaration order — loop to render / inspect. */
570
+ getAll(): MonoColumnDef[];
573
571
  }
574
572
  /**
575
573
  * A registered header-cell element (`mono-table-th`). Structural so the
@@ -577,59 +575,59 @@ export interface MonoColumnHandle {
577
575
  * column props plus `compareDocumentPosition` for DOM-order sorting.
578
576
  */
579
577
  export interface MonoColumnEl extends MonoColumn {
580
- compareDocumentPosition?(other: Node): number;
578
+ compareDocumentPosition?(other: Node): number;
581
579
  }
582
580
  /** Payload emitted by `commitCell` / consumed via `controller.onCellChange`. */
583
581
  export interface MonoCellChange<T = any> {
584
- rowKey: string;
585
- field: string;
586
- value: unknown;
587
- row: T | undefined;
582
+ rowKey: string;
583
+ field: string;
584
+ value: unknown;
585
+ row: T | undefined;
588
586
  }
589
587
  /** One staged row edit, as returned by `controller.changes()`. */
590
588
  export interface MonoStagedChange<T = any> {
591
- /** The controller's string row key (`rowKeyOf`). */
592
- rowKey: string;
593
- /** The server/entity key value (`row[keyExpr]`), for a store `update`. */
594
- key: unknown;
595
- /** The accumulated field→value patch for this row. */
596
- patch: Record<string, unknown>;
597
- row: T | undefined;
589
+ /** The controller's string row key (`rowKeyOf`). */
590
+ rowKey: string;
591
+ /** The server/entity key value (`row[keyExpr]`), for a store `update`. */
592
+ key: unknown;
593
+ /** The accumulated field→value patch for this row. */
594
+ patch: Record<string, unknown>;
595
+ row: T | undefined;
598
596
  }
599
597
  /** Optional config for {@link MonoTableController.form}. */
600
598
  export interface MonoFormConfig<T = any> {
601
- /** Match field for edit/delete + dedupe on add (default: the grid's keyExpr). */
602
- key?: keyof T & string;
603
- /**
604
- * Inline-add mode. When `true`, `add()` inserts the new row into the grid
605
- * **immediately** (not just the buffer), tagged `_Type: 'Editable'`, and marks
606
- * it so `isEditingCell(rowKey, field)` returns `true` for its editable columns —
607
- * so you can render inline editors with `v-show="table.isEditingCell(...)"` and
608
- * let the user fill the row in place. `apply()` then commits it (stripping the
609
- * `_Type` marker); `discard()` removes it from the grid again. Filling a cell of
610
- * such a row writes straight through to the row object (not the cell buffer), so
611
- * the value the user types is what `apply()` commits. Use `table.rowKey(row)` for
612
- * the row's key — it stays stable even if the user edits the key field.
613
- */
614
- showForm?: boolean;
599
+ /** Match field for edit/delete + dedupe on add (default: the grid's keyExpr). */
600
+ key?: keyof T & string;
601
+ /**
602
+ * Inline-add mode. When `true`, `add()` inserts the new row into the grid
603
+ * **immediately** (not just the buffer), tagged `_Type: 'Editable'`, and marks
604
+ * it so `isEditingCell(rowKey, field)` returns `true` for its editable columns —
605
+ * so you can render inline editors with `v-show="table.isEditingCell(...)"` and
606
+ * let the user fill the row in place. `apply()` then commits it (stripping the
607
+ * `_Type` marker); `discard()` removes it from the grid again. Filling a cell of
608
+ * such a row writes straight through to the row object (not the cell buffer), so
609
+ * the value the user types is what `apply()` commits. Use `table.rowKey(row)` for
610
+ * the row's key — it stays stable even if the user edits the key field.
611
+ */
612
+ showForm?: boolean;
615
613
  }
616
614
  /** One staged row op in the {@link MonoTableController.form} buffer. */
617
615
  export type MonoFormOp<T = any> = {
618
- op: 'add';
619
- rows: T[];
616
+ op: 'add';
617
+ rows: T[];
620
618
  } | {
621
- op: 'edit';
622
- key: unknown;
623
- row: Partial<T>;
619
+ op: 'edit';
620
+ key: unknown;
621
+ row: Partial<T>;
624
622
  } | {
625
- op: 'delete';
626
- key: unknown;
623
+ op: 'delete';
624
+ key: unknown;
627
625
  };
628
626
  /** One entry for a devextreme store `push()` batch. */
629
627
  export interface MonoStorePush {
630
- type: 'insert' | 'update' | 'remove';
631
- key?: unknown;
632
- data?: Record<string, unknown>;
628
+ type: 'insert' | 'update' | 'remove';
629
+ key?: unknown;
630
+ data?: Record<string, unknown>;
633
631
  }
634
632
  /**
635
633
  * Chainable handle for optimistic, row-level CRUD staging. `add`/`edit`/`delete`
@@ -638,49 +636,49 @@ export interface MonoStorePush {
638
636
  * array source and a remote DataSource. Repeated `form()` calls share one buffer.
639
637
  */
640
638
  export interface MonoFormHandle<T = any> {
641
- /** Stage an insert: no arg = one empty row (shape inferred from existing data), one row, or many. */
642
- add(row?: Partial<T> | Array<Partial<T>>): MonoFormHandle<T>;
643
- /** Stage an update of the row whose key field == `key`. No-op if the key is not found. */
644
- edit(key: unknown, row: Partial<T>): MonoFormHandle<T>;
645
- /** Stage removal of the row whose key field == `key`. No-op if the key is not found. */
646
- delete(key: unknown): MonoFormHandle<T>;
647
- /**
648
- * Commit all staged ops into the rendered data. Local only, and **final** —
649
- * there is no undo of a committed apply (the intended flow saves to your API
650
- * first, then applies to reflect the persisted result). Use {@link discard} to
651
- * cancel everything *before* apply, or {@link revert} to drop ONE staged row.
652
- */
653
- apply(): Promise<void>;
654
- /**
655
- * Cancel a single **un-applied** row by its `table.rowKey(row)` — removes the
656
- * inline `showForm` row from the grid and drops its staged `add` from the buffer.
657
- * Per-row counterpart to {@link revertAll}. No-op for a key that isn't a staged
658
- * inline row; never removes already-committed data.
659
- */
660
- revert(key: unknown): MonoFormHandle<T>;
661
- /**
662
- * Cancel **all** un-applied inline (`showForm`) rows at once — the bulk form of
663
- * {@link revert}. Removes every inline row from the grid and its staged `add`,
664
- * but leaves staged `edit`/`delete` ops for existing rows untouched.
665
- */
666
- revertAll(): MonoFormHandle<T>;
667
- /** Snapshot copy of the staged ops. */
668
- changes(): Array<MonoFormOp<T>>;
669
- /**
670
- * Drop staged ops. With **no arg**, clears the whole `form()` buffer (all
671
- * `add`/`edit`/`delete`) and removes un-applied inline rows. With a **key**, drops
672
- * only the staged ops for that key — any `edit`/`delete` op with that key, plus an
673
- * inline `add` row whose `table.rowKey(row)` matches (removing it from the grid).
674
- * Does not touch the inline **cell**-edit buffer (`stageCell`) or edit mode — use
675
- * {@link discardAll} for a complete reset.
676
- */
677
- discard(key?: unknown): MonoFormHandle<T>;
678
- /**
679
- * Full reset: everything {@link discard} does **plus** clearing the cell-edit
680
- * buffer (`discardChanges`) and leaving edit mode (`cancelEdit`) — one call to
681
- * cancel every pending change across both editing systems.
682
- */
683
- discardAll(): MonoFormHandle<T>;
639
+ /** Stage an insert: no arg = one empty row (shape inferred from existing data), one row, or many. */
640
+ add(row?: Partial<T> | Array<Partial<T>>): MonoFormHandle<T>;
641
+ /** Stage an update of the row whose key field == `key`. No-op if the key is not found. */
642
+ edit(key: unknown, row: Partial<T>): MonoFormHandle<T>;
643
+ /** Stage removal of the row whose key field == `key`. No-op if the key is not found. */
644
+ delete(key: unknown): MonoFormHandle<T>;
645
+ /**
646
+ * Commit all staged ops into the rendered data. Local only, and **final** —
647
+ * there is no undo of a committed apply (the intended flow saves to your API
648
+ * first, then applies to reflect the persisted result). Use {@link discard} to
649
+ * cancel everything *before* apply, or {@link revert} to drop ONE staged row.
650
+ */
651
+ apply(): Promise<void>;
652
+ /**
653
+ * Cancel a single **un-applied** row by its `table.rowKey(row)` — removes the
654
+ * inline `showForm` row from the grid and drops its staged `add` from the buffer.
655
+ * Per-row counterpart to {@link revertAll}. No-op for a key that isn't a staged
656
+ * inline row; never removes already-committed data.
657
+ */
658
+ revert(key: unknown): MonoFormHandle<T>;
659
+ /**
660
+ * Cancel **all** un-applied inline (`showForm`) rows at once — the bulk form of
661
+ * {@link revert}. Removes every inline row from the grid and its staged `add`,
662
+ * but leaves staged `edit`/`delete` ops for existing rows untouched.
663
+ */
664
+ revertAll(): MonoFormHandle<T>;
665
+ /** Snapshot copy of the staged ops. */
666
+ changes(): Array<MonoFormOp<T>>;
667
+ /**
668
+ * Drop staged ops. With **no arg**, clears the whole `form()` buffer (all
669
+ * `add`/`edit`/`delete`) and removes un-applied inline rows. With a **key**, drops
670
+ * only the staged ops for that key — any `edit`/`delete` op with that key, plus an
671
+ * inline `add` row whose `table.rowKey(row)` matches (removing it from the grid).
672
+ * Does not touch the inline **cell**-edit buffer (`stageCell`) or edit mode — use
673
+ * {@link discardAll} for a complete reset.
674
+ */
675
+ discard(key?: unknown): MonoFormHandle<T>;
676
+ /**
677
+ * Full reset: everything {@link discard} does **plus** clearing the cell-edit
678
+ * buffer (`discardChanges`) and leaving edit mode (`cancelEdit`) — one call to
679
+ * cancel every pending change across both editing systems.
680
+ */
681
+ discardAll(): MonoFormHandle<T>;
684
682
  }
685
683
  /** Column aggregate kinds supported by {@link MonoTableController.summary}. */
686
684
  export type MonoSummaryType = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'countDistinct';
@@ -690,43 +688,43 @@ export type MonoSummaryType = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'countDi
690
688
  * or `table.summary().getAll()` then reads the result.
691
689
  */
692
690
  export interface MonoSummarySpec {
693
- /**
694
- * Data field to aggregate — path-aware (`"Job.Salary"`, `"User.[0].Age"`),
695
- * resolved with `getFieldValue`. Optional for `type: 'count'` (counts rows).
696
- */
697
- field?: string;
698
- /** Aggregate kind. Default `'sum'`. */
699
- type?: MonoSummaryType;
700
- /**
701
- * Disambiguates two summaries on the SAME field (e.g. a `sum` and an `avg` of
702
- * `Price`) so `summary('Price', type)` / a `name`-keyed element can pick one.
703
- */
704
- name?: string;
705
- /** Decimal places for the formatted value (`summaryText`). */
706
- precision?: number;
707
- /** Leading / trailing text on the formatted value (e.g. `prefix: '$'`). */
708
- prefix?: string;
709
- suffix?: string;
710
- /** Text shown when the value is `null` (no numeric data). Default `'—'`. */
711
- emptyText?: string;
712
- /** Full formatter override — wins over `precision`/`prefix`/`suffix`. */
713
- format?: (value: number | null, rows: unknown[]) => string;
691
+ /**
692
+ * Data field to aggregate — path-aware (`"Job.Salary"`, `"User.[0].Age"`),
693
+ * resolved with `getFieldValue`. Optional for `type: 'count'` (counts rows).
694
+ */
695
+ field?: string;
696
+ /** Aggregate kind. Default `'sum'`. */
697
+ type?: MonoSummaryType;
698
+ /**
699
+ * Disambiguates two summaries on the SAME field (e.g. a `sum` and an `avg` of
700
+ * `Price`) so `summary('Price', type)` / a `name`-keyed element can pick one.
701
+ */
702
+ name?: string;
703
+ /** Decimal places for the formatted value (`summaryText`). */
704
+ precision?: number;
705
+ /** Leading / trailing text on the formatted value (e.g. `prefix: '$'`). */
706
+ prefix?: string;
707
+ suffix?: string;
708
+ /** Text shown when the value is `null` (no numeric data). Default `'—'`. */
709
+ emptyText?: string;
710
+ /** Full formatter override — wins over `precision`/`prefix`/`suffix`. */
711
+ format?: (value: number | null, rows: unknown[]) => string;
714
712
  }
715
713
  /** A per-field summary spec — {@link MonoSummarySpec} minus `field` (the key supplies it). */
716
714
  export type MonoSummaryFieldSpec = Omit<MonoSummarySpec, 'field'>;
717
715
  /** When the aggregates are recomputed. */
718
716
  export interface MonoSummaryRecalculate {
719
- /**
720
- * Recompute when the view is narrowed by search / filters. Default `false` —
721
- * so a total shows the WHOLE dataset regardless of the current search box or
722
- * header filters. Set `true` to make it track what's on screen.
723
- */
724
- searching?: boolean;
725
- /**
726
- * Recompute when the underlying data changes (rows added / removed / reloaded /
727
- * `setData`). Default `true`. (The first computation always runs regardless.)
728
- */
729
- changedData?: boolean;
717
+ /**
718
+ * Recompute when the view is narrowed by search / filters. Default `false` —
719
+ * so a total shows the WHOLE dataset regardless of the current search box or
720
+ * header filters. Set `true` to make it track what's on screen.
721
+ */
722
+ searching?: boolean;
723
+ /**
724
+ * Recompute when the underlying data changes (rows added / removed / reloaded /
725
+ * `setData`). Default `true`. (The first computation always runs regardless.)
726
+ */
727
+ changedData?: boolean;
730
728
  }
731
729
  /**
732
730
  * Object form of the `summary` option — keyed by field, with recompute controls.
@@ -743,67 +741,67 @@ export interface MonoSummaryRecalculate {
743
741
  * })
744
742
  */
745
743
  export interface MonoSummaryConfig {
746
- recalculate?: MonoSummaryRecalculate;
747
- /**
748
- * One spec (or several) per field. Optional: when the aggregates are declared
749
- * per column in `props.th[].summary`, this form is still the only place to set
750
- * `recalculate`, so `{ recalculate }` on its own is valid.
751
- */
752
- fields?: Record<string, MonoSummaryFieldSpec | MonoSummaryFieldSpec[]>;
753
- /**
754
- * Compute the totals on the SERVER instead of draining every row for them.
755
- *
756
- * A total covers the whole filtered set rather than the current page, so
757
- * without this the grid reads every matching row in `take: 100` chunks and
758
- * adds them up here. Over an array that is free. Over a **server-paged** table
759
- * it is the pathological case: opening a grid that shows ten rows fires a
760
- * burst of `$skip`/`$top` requests for every row the pager exists to avoid.
761
- *
762
- * It is a hook rather than something automatic because it has to be.
763
- * devextreme's OData store has NO aggregate support — `totalSummary`,
764
- * `groupSummary` and `$apply` are absent from it, and an unknown load option
765
- * is dropped in silence — so there is nothing for the library to ask. Only the
766
- * consumer knows the source's url and fetcher. The context arrives with the
767
- * clause already built, so a resolver is usually three lines:
768
- *
769
- * ```ts
770
- * summary: {
771
- * fields: { Price: { type: 'sum' } },
772
- * resolve: async ({ applyWithFilter }) => {
773
- * const { data } = await myFetch({ url: '/Orders', params: { \$apply: applyWithFilter } })
774
- * return data?.[0] ?? null // keyed by alias — or `null` to fall back
775
- * },
776
- * }
777
- * ```
778
- *
779
- * Also settable after construction with
780
- * {@link MonoTableController.setSummaryResolver}, for a grid built by a
781
- * factory that does not forward this option.
782
- */
783
- resolve?: MonoSummaryResolver;
744
+ recalculate?: MonoSummaryRecalculate;
745
+ /**
746
+ * One spec (or several) per field. Optional: when the aggregates are declared
747
+ * per column in `props.th[].summary`, this form is still the only place to set
748
+ * `recalculate`, so `{ recalculate }` on its own is valid.
749
+ */
750
+ fields?: Record<string, MonoSummaryFieldSpec | MonoSummaryFieldSpec[]>;
751
+ /**
752
+ * Compute the totals on the SERVER instead of draining every row for them.
753
+ *
754
+ * A total covers the whole filtered set rather than the current page, so
755
+ * without this the grid reads every matching row in `take: 100` chunks and
756
+ * adds them up here. Over an array that is free. Over a **server-paged** table
757
+ * it is the pathological case: opening a grid that shows ten rows fires a
758
+ * burst of `$skip`/`$top` requests for every row the pager exists to avoid.
759
+ *
760
+ * It is a hook rather than something automatic because it has to be.
761
+ * devextreme's OData store has NO aggregate support — `totalSummary`,
762
+ * `groupSummary` and `$apply` are absent from it, and an unknown load option
763
+ * is dropped in silence — so there is nothing for the library to ask. Only the
764
+ * consumer knows the source's url and fetcher. The context arrives with the
765
+ * clause already built, so a resolver is usually three lines:
766
+ *
767
+ * ```ts
768
+ * summary: {
769
+ * fields: { Price: { type: 'sum' } },
770
+ * resolve: async ({ applyWithFilter }) => {
771
+ * const { data } = await myFetch({ url: '/Orders', params: { \$apply: applyWithFilter } })
772
+ * return data?.[0] ?? null // keyed by alias — or `null` to fall back
773
+ * },
774
+ * }
775
+ * ```
776
+ *
777
+ * Also settable after construction with
778
+ * {@link MonoTableController.setSummaryResolver}, for a grid built by a
779
+ * factory that does not forward this option.
780
+ */
781
+ resolve?: MonoSummaryResolver;
784
782
  }
785
783
  /**
786
784
  * What a {@link MonoSummaryResolver} is handed — everything needed to ask a
787
785
  * server for the totals, with the OData clause already built.
788
786
  */
789
787
  export interface MonoSummaryResolveContext {
790
- /** The aggregates to compute, in order. A positional result must match this. */
791
- specs: readonly MonoSummarySpec[];
792
- /** Response key per spec, parallel to `specs` — what an object result is read by. */
793
- aliases: readonly string[];
794
- /**
795
- * The predicate to aggregate over: the source's own filter AND its active
796
- * search, as a devextreme expression. The SAME one the drain would use.
797
- */
798
- filter: unknown;
799
- /** `filter` as an OData string, or `''` when there is none. */
800
- odataFilter: string;
801
- /** `aggregate(Price with sum as Price, …)` — no filter applied. */
802
- apply: string;
803
- /** `filter(<expr>)/aggregate(…)` — what an `$apply` parameter usually wants. */
804
- applyWithFilter: string;
805
- /** The bound source, for a resolver that needs its store or url. */
806
- source: unknown;
788
+ /** The aggregates to compute, in order. A positional result must match this. */
789
+ specs: readonly MonoSummarySpec[];
790
+ /** Response key per spec, parallel to `specs` — what an object result is read by. */
791
+ aliases: readonly string[];
792
+ /**
793
+ * The predicate to aggregate over: the source's own filter AND its active
794
+ * search, as a devextreme expression. The SAME one the drain would use.
795
+ */
796
+ filter: unknown;
797
+ /** `filter` as an OData string, or `''` when there is none. */
798
+ odataFilter: string;
799
+ /** `aggregate(Price with sum as Price, …)` — no filter applied. */
800
+ apply: string;
801
+ /** `filter(<expr>)/aggregate(…)` — what an `$apply` parameter usually wants. */
802
+ applyWithFilter: string;
803
+ /** The bound source, for a resolver that needs its store or url. */
804
+ source: unknown;
807
805
  }
808
806
  /**
809
807
  * Compute the registered summaries somewhere other than the browser.
@@ -821,331 +819,331 @@ export interface MonoSummaryResolveContext {
821
819
  export type MonoSummaryResolver = (ctx: MonoSummaryResolveContext) => Promise<(number | null)[] | Record<string, number | null> | null> | (number | null)[] | Record<string, number | null> | null;
822
820
  /** A computed summary — what `table.summary().get/getAll` return, for rendering anywhere. */
823
821
  export interface MonoSummaryResult {
824
- field?: string;
825
- type: MonoSummaryType;
826
- name?: string;
827
- /** The numeric aggregate, or `null` when there's no numeric data. */
828
- value: number | null;
829
- /** The formatted value per the spec (`format`/`prefix`/`precision`/`suffix`). */
830
- text: string;
822
+ field?: string;
823
+ type: MonoSummaryType;
824
+ name?: string;
825
+ /** The numeric aggregate, or `null` when there's no numeric data. */
826
+ value: number | null;
827
+ /** The formatted value per the spec (`format`/`prefix`/`precision`/`suffix`). */
828
+ text: string;
831
829
  }
832
830
  /** The iterable handle returned by `table.summary()` (no args). */
833
831
  export interface MonoSummaryHandle {
834
- /** One result by field (and optional type), or `null` if there's no such spec. */
835
- get(field: string, type?: MonoSummaryType): MonoSummaryResult | null;
836
- /** Every computed summary — loop this to render totals outside the footer. */
837
- getAll(): MonoSummaryResult[];
832
+ /** One result by field (and optional type), or `null` if there's no such spec. */
833
+ get(field: string, type?: MonoSummaryType): MonoSummaryResult | null;
834
+ /** Every computed summary — loop this to render totals outside the footer. */
835
+ getAll(): MonoSummaryResult[];
838
836
  }
839
837
  export interface MonoDataGridOptions extends MonoSearchFieldsAliases {
840
- /**
841
- * Columns searched by `setSearch`. Each entry may be a **path expression** —
842
- * `"Job.Name"` (nested), `"User.[1].Id"` (index) or `"User.[*].Name"` (wildcard).
843
- * Array sources resolve paths client-side; a remote OData source translates a
844
- * wildcard column to a lambda (`Detail.[*].Bulan` → `Detail/any(d: …)`).
845
- *
846
- * An entry may also be `{ field, custom }` to build its own clause, for a column
847
- * `contains` can't search — a boolean, or a code the user never types:
848
- *
849
- * ```ts
850
- * searchExpr: [
851
- * 'Code',
852
- * { field: 'Active', custom: ({ field, value }) => `${field} eq ${value}` },
853
- * { field: 'Month', custom: ({ field, value }) => [field, '=', MONTHS.indexOf(value)] },
854
- * ]
855
- * ```
856
- *
857
- * The custom runs for every term (return `null` to opt out of one).
858
- *
859
- * An entry may also be a **`*` pattern**, resolved against the loaded rows, so a
860
- * grid can search everything without listing columns. Patterns read literally,
861
- * segment by segment:
862
- *
863
- * ```ts
864
- * searchExpr: ['*'] // every top-level field
865
- * searchExpr: ['*', '*.*'] // …plus every field of a nested OBJECT
866
- * searchExpr: ['*', '*.[*].*'] // …plus every field of a nested ARRAY
867
- * searchExpr: ['*', { field: 'Month', custom }] // explicit entries always win
868
- * ```
869
- *
870
- * A remote source only gets clauses for **string** columns (`contains(Price,'x')`
871
- * is not valid OData); give a non-text column an explicit entry.
872
- *
873
- * Neither customs nor patterns are honoured in server-group mode (`serverGroup` /
874
- * an auto server-grouped store), which keeps plain columns.
875
- *
876
- * **Four interchangeable spellings.** `searchExpr`, `search-expr`, `searchValue`
877
- * and `search-value` all name this same option — `search-value` is what
878
- * `mono-select` / `mono-tag-input` call it, and the grid accepts it so one
879
- * expression is portable between them. Passing more than one **merges** them
880
- * (de-duplicated by field); `searchExpr` is kept for back-compat.
881
- *
882
- * Each also accepts a **comma-separated string** instead of an array — a comma
883
- * can't appear in a path or a pattern, so the two forms are equivalent:
884
- *
885
- * ```ts
886
- * searchExpr: ['Company.Name', 'Transaction.[*].Price', '*.[*].*']
887
- * 'search-value': 'Company.Name,Transaction.[*].Price,*.[*].*'
888
- * ```
889
- */
890
- searchExpr?: MonoSearchValue;
891
- /** Search operation (default `'contains'`). */
892
- searchOperation?: string;
893
- /** Rows per page when wrapping a plain array (forwarded to `monoArraySource`). */
894
- pageSize?: number;
895
- /**
896
- * Group-by field(s), outermost first (e.g. `['Nama', 'Code']`). When set, the
897
- * controller groups the full result set and the main paging (`pageSize` /
898
- * `totalCount` / `pageCount`) operates on the **top-level groups** — so
899
- * `<mono-table-paging>` / `-info` / `-page-size` page and count groups. Rows
900
- * inside a group can be paged independently with `<mono-table-paging-group>`
901
- * (otherwise all rows in the group are shown). Works for a plain array and a
902
- * remote grouped DataSource alike.
903
- */
904
- group?: string | string[];
905
- /**
906
- * Default rows-per-page **inside** each group. When set, every group is paged
907
- * by this size from the first render (so a huge group never renders all its
908
- * rows at once); a `<mono-table-paging-group>` then just navigates/overrides
909
- * it. Leave unset to show all rows in a group until a `<mono-table-paging-group>`
910
- * is attached.
911
- */
912
- groupRowPageSize?: number;
913
- /**
914
- * Per-group aggregates for **server-side** grouping, e.g. `{ TotalBudget: 'sum' }`.
915
- * Computed by the groupby query (no rows loaded) and surfaced on each group node
916
- * as `node.meta.aggregates` — handy for a subtotal in the group header.
917
- */
918
- groupSummary?: Record<string, 'sum' | 'avg' | 'min' | 'max' | 'count'>;
919
- /**
920
- * Column summaries (aggregate footers). Either a plain array of specs, or the
921
- * richer object form ({@link MonoSummaryConfig}) with `recalculate` controls
922
- * and field-keyed specs. Read via `<mono-table-summary>`, `table.summary(field)`,
923
- * or `table.summary().getAll()`.
924
- */
925
- summary?: MonoSummarySpec[] | MonoSummaryConfig;
926
- /**
927
- * Central column config, read via `table.columns().get(field)` /
928
- * `table.columns().getAll()`. Entries only need `field` (plus optional `caption`)
929
- * today; the type is extensible for per-column props later. Separate from the
930
- * registered `<mono-table-th>` elements (see `table.registeredColumns()`).
931
- */
932
- columns?: MonoColumnDef[];
933
- /**
934
- * Props for the `mono-table-*` elements, declared centrally so each element is
935
- * wired with just `:data-grid.prop="table"`. Read back via `table.props()`.
936
- *
937
- * `props.th` is merged OVER `columns` by field, and each `th[].summary` is
938
- * folded into the same spec list `summary` feeds — so both styles coexist and
939
- * `table.summary()` sees one reconciled set.
940
- */
941
- props?: MonoTableProps;
942
- /**
943
- * A ref the grid writes a `props()` snapshot into on every change, so a Vue
944
- * template can drive its header loop from `state.th` with no manual
945
- * subscription. Mirrors `monoForm({ state })`.
946
- */
947
- state?: {
948
- value: MonoTableProps | undefined;
949
- };
950
- /** Columns fetched for a group's rows in server mode (omit = `dataSourceOptions.select`, else all columns). */
951
- select?: string[];
952
- /**
953
- * DataSource-level knobs the grid keeps under every query it runs — see
954
- * {@link MonoDataSourceOptions}. A value, a getter, or a `{ value }` box
955
- * (a Vue `ref` / `computed`), read fresh at query time.
956
- *
957
- * Not needed just to keep a filter: whatever a consumer sets on the source
958
- * directly (`ds.filter(...)`) is adopted as the base too. This is for the case
959
- * where the base is DERIVED from reactive state and should follow it.
960
- */
961
- dataSourceOptions?: MaybeReactive<MonoDataSourceOptions>;
962
- /** The same, in raw OData (`$select`, `$filter`, …) — see {@link MonoOdataOptions}. */
963
- odataOptions?: MaybeReactive<MonoOdataOptions>;
964
- /** Row key field used to build stable `displayRows` keys (default `'Id'`). */
965
- keyExpr?: string;
966
- /**
967
- * Max rows fetched per server request. When the page size is set to **"all"**,
968
- * the controller loads everything in chunks of this size (so a backend capped
969
- * at e.g. 100 rows/request still returns the full set). Default `100`.
970
- */
971
- chunkSize?: number;
972
- /**
973
- * Advanced override for server-side grouping. Normally you don't set this:
974
- * passing a single-field `group` plus a remote devextreme `DataSource` makes
975
- * the controller drive server group paging automatically from the source's
976
- * store. Provide this only to supply custom group/row fetching.
977
- */
978
- serverGroup?: MonoServerGroupSource<any>;
979
- /**
980
- * Whether the grid may send OData `$apply` requests through the bound
981
- * source's own store — ONE `groupby` for a header filter's distinct values,
982
- * ONE `aggregate` for the summary footer — instead of scanning or draining
983
- * rows. Default `true`. The request goes out on the store's url, `beforeSend`
984
- * and auth (the clause goes into the url via `urlOverride` — never through
985
- * `customQueryParams`, which devextreme quotes as a literal — and never to a
986
- * CustomStore). A backend that rejects it (4xx / 501) turns the path off for
987
- * this controller and the client-side fallback takes over. Set `false` to
988
- * never try — a backend you know has no `$apply`.
989
- */
990
- serverApply?: boolean;
991
- /**
992
- * Whether a header filter's value list CASCADES: scoped by the other columns'
993
- * active header filters and by the grid search, so after Brand = "One" the
994
- * Product panel lists only that brand's products (with counts to match).
995
- * Default `true`. The column's OWN filter is never applied to its list, so a
996
- * value you filtered out can be ticked back. The panel's search box still
997
- * narrows the list on top. `false` scopes the list by the base filter alone.
998
- */
999
- headerFilterCascade?: boolean;
1000
- /**
1001
- * What a failed load does to the rows already on screen. Default
1002
- * `'clear-list'`: they are emptied (see `MonoErrorBehaviour`), so a filter that
1003
- * the backend rejected never leaves the previous filter's rows showing under
1004
- * the error bar. `<mono-table-error behaviour>` writes the same setting.
1005
- */
1006
- onError?: MonoErrorBehaviour;
1007
- /**
1008
- * Wording for the error bar, by HTTP status (`401`, `403`, `500`, …), plus
1009
- * `'network'` (no answer at all) and `'default'`. A status with a preset shows
1010
- * the preset rather than the transport's reason phrase — "You do not have
1011
- * permission to view this data." instead of "Forbidden" (or, over HTTP/2,
1012
- * where the statusText is blank, instead of the bare word "Error"). Anything
1013
- * the SERVER said beyond the status is kept as `error.detail`. Merged over the
1014
- * app-wide `setErrorMessages()` and the English defaults
1015
- * (`DEFAULT_ERROR_MESSAGES`), so this only needs the keys that differ.
1016
- */
1017
- errorMessages?: MonoErrorMessages;
1018
- /**
1019
- * How a `header-filter` column fetches its DISTINCT values. Array-backed tables
1020
- * derive them client-side automatically; a **remote** devextreme source gets
1021
- * ONE `$apply=groupby((field))` request through its own store (see
1022
- * `serverApply`). Supply this to take over — a non-devextreme fetcher, a custom
1023
- * dialect, a cached lookup. Return the distinct values, optionally with counts.
1024
- * Example (public endpoint → a plain request; route it through your own client
1025
- * for an authenticated backend):
1026
- * ```ts
1027
- * monoDataGrid(null, {
1028
- * distinctValues: async (field, _options, ctx) => {
1029
- * // `ctx.applyWithFilter` already folds the grid's base filter in front of
1030
- * // the groupby, so a scoped grid lists only values in scope.
1031
- * const apply = encodeURIComponent(ctx.applyWithFilter)
1032
- * const res = await fetch(`${base}/DTO_Departmen?$apply=${apply}&$orderby=${field} asc`)
1033
- * if (!res.ok) throw new Error(`HTTP ${res.status}`)
1034
- * const json = await res.json()
1035
- * return (json.value ?? []).map((r) => ({ value: r[field], count: Number(r.count ?? 0) }))
1036
- * },
1037
- * })
1038
- * ```
1039
- */
1040
- distinctValues?: (field: string,
1041
- /**
1042
- * The column's `headerFilter.dataSourceOptions`, with the grid's base filter
1043
- * AND-ed into `filter`, so a resolver that goes through `store.load(options)`
1044
- * is scoped without doing anything.
1045
- */
1046
- options?: MonoHeaderFilterLoadOptions,
1047
- /** The same, in OData form — for a resolver that builds its own `$apply`. */
1048
- ctx?: MonoDistinctValuesContext) => Promise<Array<MonoColumnValue | unknown>> | Array<MonoColumnValue | unknown>;
1049
- /**
1050
- * How a row's inline editor opens — `'click'` (default) or `'double-click'`.
1051
- * The grid binds one delegated listener on the `<table>`; rows only need
1052
- * `data-row-key`. A `<mono-table-th editable-trigger="…">` overrides this.
1053
- *
1054
- * Clicks on an editor or on an interactive control (button / link / form
1055
- * field) never open the editor, so per-row action buttons keep working.
1056
- */
1057
- editableTrigger?: MonoEditableTrigger;
1058
- /**
1059
- * How the keyboard moves between inline editors.
1060
- *
1061
- * - `'tab-arrows'` *(default)* — tap `Tab` for the next column (rolling into
1062
- * the next row at the row's end, `Shift+Tab` mirrors it), or **hold `Tab`
1063
- * and press an arrow** to move one cell in that direction: `←`/`→` within
1064
- * the row, `↑`/`↓` to the same column of the previous/next row. Arrows never
1065
- * wrap — at an edge the key is swallowed and nothing moves. Plain arrows are
1066
- * left alone, so they still move the caret, change `mono-textarea` lines and
1067
- * walk an open `mono-select` / `mono-date` list.
1068
- * - `'native'` — no interception inside a row: the browser's own `Tab` order
1069
- * applies (which also steps into a cell's sub-controls) and the grid only
1070
- * rolls over at the row's edges.
1071
- *
1072
- * With `'tab-arrows'`, `Tab` acts on key*up* — it has to be swallowed on
1073
- * keydown so a following arrow isn't preceded by a stray move.
1074
- */
1075
- editorNavKeys?: MonoEditorNavKeys;
1076
- /**
1077
- * Turn each raw row into a presentation row, so a consumer stops hand-rolling a
1078
- * `computed` that re-maps `items` on every notify. The result lands in
1079
- * `table.mapped` and on `displayRows[].mapped`; **`items` stays raw**, because
1080
- * editing, row keys, summaries, search, sort and filters all read it.
1081
- *
1082
- * Per-column {@link MonoTableColumnProps.map} entries are applied afterwards and
1083
- * overwrite their own field. They read the RAW value, not this map's output, so
1084
- * don't rely on chaining the two on the same field — pick one per field.
1085
- *
1086
- * @example
1087
- * monoDataGrid(null, {
1088
- * map: (row) => ({
1089
- * ...row,
1090
- * _status: renderStatus(row.Status),
1091
- * _date: formatDateTime(row.DibuatTanggal),
1092
- * }),
1093
- * })
1094
- * // then: rows.value = [...table.mapped] // in your subscribe callback
1095
- */
1096
- map?: (row: any, index: number) => unknown;
1097
- /**
1098
- * Creates a `monoFilterBuilder()` controller owned by the grid and exposed as
1099
- * `table.filterBuilder`, so a `<mono-filter-builder :data-filter.prop="table.filterBuilder">`
1100
- * slotted into a `<mono-table-search>` joins without a standalone controller.
1101
- * Accepts the same options as `monoFilterBuilder()`; `dataGrid` is wired
1102
- * automatically (its field list is derived from the registered columns).
1103
- */
1104
- filterBuilder?: MonoFilterBuilderOptions;
838
+ /**
839
+ * Columns searched by `setSearch`. Each entry may be a **path expression** —
840
+ * `"Job.Name"` (nested), `"User.[1].Id"` (index) or `"User.[*].Name"` (wildcard).
841
+ * Array sources resolve paths client-side; a remote OData source translates a
842
+ * wildcard column to a lambda (`Detail.[*].Bulan` → `Detail/any(d: …)`).
843
+ *
844
+ * An entry may also be `{ field, custom }` to build its own clause, for a column
845
+ * `contains` can't search — a boolean, or a code the user never types:
846
+ *
847
+ * ```ts
848
+ * searchExpr: [
849
+ * 'Code',
850
+ * { field: 'Active', custom: ({ field, value }) => `${field} eq ${value}` },
851
+ * { field: 'Month', custom: ({ field, value }) => [field, '=', MONTHS.indexOf(value)] },
852
+ * ]
853
+ * ```
854
+ *
855
+ * The custom runs for every term (return `null` to opt out of one).
856
+ *
857
+ * An entry may also be a **`*` pattern**, resolved against the loaded rows, so a
858
+ * grid can search everything without listing columns. Patterns read literally,
859
+ * segment by segment:
860
+ *
861
+ * ```ts
862
+ * searchExpr: ['*'] // every top-level field
863
+ * searchExpr: ['*', '*.*'] // …plus every field of a nested OBJECT
864
+ * searchExpr: ['*', '*.[*].*'] // …plus every field of a nested ARRAY
865
+ * searchExpr: ['*', { field: 'Month', custom }] // explicit entries always win
866
+ * ```
867
+ *
868
+ * A remote source only gets clauses for **string** columns (`contains(Price,'x')`
869
+ * is not valid OData); give a non-text column an explicit entry.
870
+ *
871
+ * Neither customs nor patterns are honoured in server-group mode (`serverGroup` /
872
+ * an auto server-grouped store), which keeps plain columns.
873
+ *
874
+ * **Four interchangeable spellings.** `searchExpr`, `search-expr`, `searchValue`
875
+ * and `search-value` all name this same option — `search-value` is what
876
+ * `mono-select` / `mono-tag-input` call it, and the grid accepts it so one
877
+ * expression is portable between them. Passing more than one **merges** them
878
+ * (de-duplicated by field); `searchExpr` is kept for back-compat.
879
+ *
880
+ * Each also accepts a **comma-separated string** instead of an array — a comma
881
+ * can't appear in a path or a pattern, so the two forms are equivalent:
882
+ *
883
+ * ```ts
884
+ * searchExpr: ['Company.Name', 'Transaction.[*].Price', '*.[*].*']
885
+ * 'search-value': 'Company.Name,Transaction.[*].Price,*.[*].*'
886
+ * ```
887
+ */
888
+ searchExpr?: MonoSearchValue;
889
+ /** Search operation (default `'contains'`). */
890
+ searchOperation?: string;
891
+ /** Rows per page when wrapping a plain array (forwarded to `monoArraySource`). */
892
+ pageSize?: number;
893
+ /**
894
+ * Group-by field(s), outermost first (e.g. `['Nama', 'Code']`). When set, the
895
+ * controller groups the full result set and the main paging (`pageSize` /
896
+ * `totalCount` / `pageCount`) operates on the **top-level groups** — so
897
+ * `<mono-table-paging>` / `-info` / `-page-size` page and count groups. Rows
898
+ * inside a group can be paged independently with `<mono-table-paging-group>`
899
+ * (otherwise all rows in the group are shown). Works for a plain array and a
900
+ * remote grouped DataSource alike.
901
+ */
902
+ group?: string | string[];
903
+ /**
904
+ * Default rows-per-page **inside** each group. When set, every group is paged
905
+ * by this size from the first render (so a huge group never renders all its
906
+ * rows at once); a `<mono-table-paging-group>` then just navigates/overrides
907
+ * it. Leave unset to show all rows in a group until a `<mono-table-paging-group>`
908
+ * is attached.
909
+ */
910
+ groupRowPageSize?: number;
911
+ /**
912
+ * Per-group aggregates for **server-side** grouping, e.g. `{ TotalBudget: 'sum' }`.
913
+ * Computed by the groupby query (no rows loaded) and surfaced on each group node
914
+ * as `node.meta.aggregates` — handy for a subtotal in the group header.
915
+ */
916
+ groupSummary?: Record<string, 'sum' | 'avg' | 'min' | 'max' | 'count'>;
917
+ /**
918
+ * Column summaries (aggregate footers). Either a plain array of specs, or the
919
+ * richer object form ({@link MonoSummaryConfig}) with `recalculate` controls
920
+ * and field-keyed specs. Read via `<mono-table-summary>`, `table.summary(field)`,
921
+ * or `table.summary().getAll()`.
922
+ */
923
+ summary?: MonoSummarySpec[] | MonoSummaryConfig;
924
+ /**
925
+ * Central column config, read via `table.columns().get(field)` /
926
+ * `table.columns().getAll()`. Entries only need `field` (plus optional `caption`)
927
+ * today; the type is extensible for per-column props later. Separate from the
928
+ * registered `<mono-table-th>` elements (see `table.registeredColumns()`).
929
+ */
930
+ columns?: MonoColumnDef[];
931
+ /**
932
+ * Props for the `mono-table-*` elements, declared centrally so each element is
933
+ * wired with just `:data-grid.prop="table"`. Read back via `table.props()`.
934
+ *
935
+ * `props.th` is merged OVER `columns` by field, and each `th[].summary` is
936
+ * folded into the same spec list `summary` feeds — so both styles coexist and
937
+ * `table.summary()` sees one reconciled set.
938
+ */
939
+ props?: MonoTableProps;
940
+ /**
941
+ * A ref the grid writes a `props()` snapshot into on every change, so a Vue
942
+ * template can drive its header loop from `state.th` with no manual
943
+ * subscription. Mirrors `monoForm({ state })`.
944
+ */
945
+ state?: {
946
+ value: MonoTableProps | undefined;
947
+ };
948
+ /** Columns fetched for a group's rows in server mode (omit = `dataSourceOptions.select`, else all columns). */
949
+ select?: string[];
950
+ /**
951
+ * DataSource-level knobs the grid keeps under every query it runs — see
952
+ * {@link MonoDataSourceOptions}. A value, a getter, or a `{ value }` box
953
+ * (a Vue `ref` / `computed`), read fresh at query time.
954
+ *
955
+ * Not needed just to keep a filter: whatever a consumer sets on the source
956
+ * directly (`ds.filter(...)`) is adopted as the base too. This is for the case
957
+ * where the base is DERIVED from reactive state and should follow it.
958
+ */
959
+ dataSourceOptions?: MaybeReactive<MonoDataSourceOptions>;
960
+ /** The same, in raw OData (`$select`, `$filter`, …) — see {@link MonoOdataOptions}. */
961
+ odataOptions?: MaybeReactive<MonoOdataOptions>;
962
+ /** Row key field used to build stable `displayRows` keys (default `'Id'`). */
963
+ keyExpr?: string;
964
+ /**
965
+ * Max rows fetched per server request. When the page size is set to **"all"**,
966
+ * the controller loads everything in chunks of this size (so a backend capped
967
+ * at e.g. 100 rows/request still returns the full set). Default `100`.
968
+ */
969
+ chunkSize?: number;
970
+ /**
971
+ * Advanced override for server-side grouping. Normally you don't set this:
972
+ * passing a single-field `group` plus a remote devextreme `DataSource` makes
973
+ * the controller drive server group paging automatically from the source's
974
+ * store. Provide this only to supply custom group/row fetching.
975
+ */
976
+ serverGroup?: MonoServerGroupSource<any>;
977
+ /**
978
+ * Whether the grid may send OData `$apply` requests through the bound
979
+ * source's own store — ONE `groupby` for a header filter's distinct values,
980
+ * ONE `aggregate` for the summary footer — instead of scanning or draining
981
+ * rows. Default `true`. The request goes out on the store's url, `beforeSend`
982
+ * and auth (the clause goes into the url via `urlOverride` — never through
983
+ * `customQueryParams`, which devextreme quotes as a literal — and never to a
984
+ * CustomStore). A backend that rejects it (4xx / 501) turns the path off for
985
+ * this controller and the client-side fallback takes over. Set `false` to
986
+ * never try — a backend you know has no `$apply`.
987
+ */
988
+ serverApply?: boolean;
989
+ /**
990
+ * Whether a header filter's value list CASCADES: scoped by the other columns'
991
+ * active header filters and by the grid search, so after Brand = "One" the
992
+ * Product panel lists only that brand's products (with counts to match).
993
+ * Default `true`. The column's OWN filter is never applied to its list, so a
994
+ * value you filtered out can be ticked back. The panel's search box still
995
+ * narrows the list on top. `false` scopes the list by the base filter alone.
996
+ */
997
+ headerFilterCascade?: boolean;
998
+ /**
999
+ * What a failed load does to the rows already on screen. Default
1000
+ * `'clear-list'`: they are emptied (see `MonoErrorBehaviour`), so a filter that
1001
+ * the backend rejected never leaves the previous filter's rows showing under
1002
+ * the error bar. `<mono-table-error behaviour>` writes the same setting.
1003
+ */
1004
+ onError?: MonoErrorBehaviour;
1005
+ /**
1006
+ * Wording for the error bar, by HTTP status (`401`, `403`, `500`, …), plus
1007
+ * `'network'` (no answer at all) and `'default'`. A status with a preset shows
1008
+ * the preset rather than the transport's reason phrase — "You do not have
1009
+ * permission to view this data." instead of "Forbidden" (or, over HTTP/2,
1010
+ * where the statusText is blank, instead of the bare word "Error"). Anything
1011
+ * the SERVER said beyond the status is kept as `error.detail`. Merged over the
1012
+ * app-wide `setErrorMessages()` and the English defaults
1013
+ * (`DEFAULT_ERROR_MESSAGES`), so this only needs the keys that differ.
1014
+ */
1015
+ errorMessages?: MonoErrorMessages;
1016
+ /**
1017
+ * How a `header-filter` column fetches its DISTINCT values. Array-backed tables
1018
+ * derive them client-side automatically; a **remote** devextreme source gets
1019
+ * ONE `$apply=groupby((field))` request through its own store (see
1020
+ * `serverApply`). Supply this to take over — a non-devextreme fetcher, a custom
1021
+ * dialect, a cached lookup. Return the distinct values, optionally with counts.
1022
+ * Example (public endpoint → a plain request; route it through your own client
1023
+ * for an authenticated backend):
1024
+ * ```ts
1025
+ * monoDataGrid(null, {
1026
+ * distinctValues: async (field, _options, ctx) => {
1027
+ * // `ctx.applyWithFilter` already folds the grid's base filter in front of
1028
+ * // the groupby, so a scoped grid lists only values in scope.
1029
+ * const apply = encodeURIComponent(ctx.applyWithFilter)
1030
+ * const res = await fetch(`${base}/DTO_Departmen?$apply=${apply}&$orderby=${field} asc`)
1031
+ * if (!res.ok) throw new Error(`HTTP ${res.status}`)
1032
+ * const json = await res.json()
1033
+ * return (json.value ?? []).map((r) => ({ value: r[field], count: Number(r.count ?? 0) }))
1034
+ * },
1035
+ * })
1036
+ * ```
1037
+ */
1038
+ distinctValues?: (field: string,
1039
+ /**
1040
+ * The column's `headerFilter.dataSourceOptions`, with the grid's base filter
1041
+ * AND-ed into `filter`, so a resolver that goes through `store.load(options)`
1042
+ * is scoped without doing anything.
1043
+ */
1044
+ options?: MonoHeaderFilterLoadOptions,
1045
+ /** The same, in OData form — for a resolver that builds its own `$apply`. */
1046
+ ctx?: MonoDistinctValuesContext) => Promise<Array<MonoColumnValue | unknown>> | Array<MonoColumnValue | unknown>;
1047
+ /**
1048
+ * How a row's inline editor opens — `'click'` (default) or `'double-click'`.
1049
+ * The grid binds one delegated listener on the `<table>`; rows only need
1050
+ * `data-row-key`. A `<mono-table-th editable-trigger="…">` overrides this.
1051
+ *
1052
+ * Clicks on an editor or on an interactive control (button / link / form
1053
+ * field) never open the editor, so per-row action buttons keep working.
1054
+ */
1055
+ editableTrigger?: MonoEditableTrigger;
1056
+ /**
1057
+ * How the keyboard moves between inline editors.
1058
+ *
1059
+ * - `'tab-arrows'` *(default)* — tap `Tab` for the next column (rolling into
1060
+ * the next row at the row's end, `Shift+Tab` mirrors it), or **hold `Tab`
1061
+ * and press an arrow** to move one cell in that direction: `←`/`→` within
1062
+ * the row, `↑`/`↓` to the same column of the previous/next row. Arrows never
1063
+ * wrap — at an edge the key is swallowed and nothing moves. Plain arrows are
1064
+ * left alone, so they still move the caret, change `mono-textarea` lines and
1065
+ * walk an open `mono-select` / `mono-date` list.
1066
+ * - `'native'` — no interception inside a row: the browser's own `Tab` order
1067
+ * applies (which also steps into a cell's sub-controls) and the grid only
1068
+ * rolls over at the row's edges.
1069
+ *
1070
+ * With `'tab-arrows'`, `Tab` acts on key*up* — it has to be swallowed on
1071
+ * keydown so a following arrow isn't preceded by a stray move.
1072
+ */
1073
+ editorNavKeys?: MonoEditorNavKeys;
1074
+ /**
1075
+ * Turn each raw row into a presentation row, so a consumer stops hand-rolling a
1076
+ * `computed` that re-maps `items` on every notify. The result lands in
1077
+ * `table.mapped` and on `displayRows[].mapped`; **`items` stays raw**, because
1078
+ * editing, row keys, summaries, search, sort and filters all read it.
1079
+ *
1080
+ * Per-column {@link MonoTableColumnProps.map} entries are applied afterwards and
1081
+ * overwrite their own field. They read the RAW value, not this map's output, so
1082
+ * don't rely on chaining the two on the same field — pick one per field.
1083
+ *
1084
+ * @example
1085
+ * monoDataGrid(null, {
1086
+ * map: (row) => ({
1087
+ * ...row,
1088
+ * _status: renderStatus(row.Status),
1089
+ * _date: formatDateTime(row.DibuatTanggal),
1090
+ * }),
1091
+ * })
1092
+ * // then: rows.value = [...table.mapped] // in your subscribe callback
1093
+ */
1094
+ map?: (row: any, index: number) => unknown;
1095
+ /**
1096
+ * Creates a `monoFilterBuilder()` controller owned by the grid and exposed as
1097
+ * `table.filterBuilder`, so a `<mono-filter-builder :data-filter.prop="table.filterBuilder">`
1098
+ * slotted into a `<mono-table-search>` joins without a standalone controller.
1099
+ * Accepts the same options as `monoFilterBuilder()`; `dataGrid` is wired
1100
+ * automatically (its field list is derived from the registered columns).
1101
+ */
1102
+ filterBuilder?: MonoFilterBuilderOptions;
1105
1103
  }
1106
1104
  /** A top-level group's metadata, returned by {@link MonoServerGroupSource.loadGroups}. */
1107
1105
  export interface MonoGroupMeta {
1108
- /** The group's key (its value for the group field). */
1109
- key: unknown;
1110
- /** Total rows in the group (from the groupby `$count`). */
1111
- count: number;
1112
- /** Optional per-group aggregates (e.g. a `Sum`) from the groupby query. */
1113
- aggregates?: Record<string, number>;
1106
+ /** The group's key (its value for the group field). */
1107
+ key: unknown;
1108
+ /** Total rows in the group (from the groupby `$count`). */
1109
+ count: number;
1110
+ /** Optional per-group aggregates (e.g. a `Sum`) from the groupby query. */
1111
+ aggregates?: Record<string, number>;
1114
1112
  }
1115
1113
  /** Shared search/sort context passed to a {@link MonoServerGroupSource}. */
1116
1114
  export interface MonoServerGroupCtx {
1117
- /** Current search value (or null). */
1118
- search: string | null;
1119
- /** Active multi-key sort (group fields first), or null. */
1120
- sort: Array<{
1121
- selector: string;
1122
- desc: boolean;
1123
- }> | null;
1124
- /**
1125
- * The grid's composed base filter — `dataSourceOptions.filter`, whatever the
1126
- * consumer set on the source, `setFilter()`, and the header column filters —
1127
- * WITHOUT the search, which the source folds from `search` itself. A server
1128
- * group source must AND this into both requests; the DataSource's own filter
1129
- * never reaches a `store.load()`.
1130
- */
1131
- filter?: unknown;
1132
- /** `dataSourceOptions.select`, when the grid's own `select` option is unset. */
1133
- select?: string[];
1134
- /** `expand` / `customQueryParams` from `dataSourceOptions`, to spread into `store.load()`. */
1135
- loadOptions?: Record<string, unknown>;
1115
+ /** Current search value (or null). */
1116
+ search: string | null;
1117
+ /** Active multi-key sort (group fields first), or null. */
1118
+ sort: Array<{
1119
+ selector: string;
1120
+ desc: boolean;
1121
+ }> | null;
1122
+ /**
1123
+ * The grid's composed base filter — `dataSourceOptions.filter`, whatever the
1124
+ * consumer set on the source, `setFilter()`, and the header column filters —
1125
+ * WITHOUT the search, which the source folds from `search` itself. A server
1126
+ * group source must AND this into both requests; the DataSource's own filter
1127
+ * never reaches a `store.load()`.
1128
+ */
1129
+ filter?: unknown;
1130
+ /** `dataSourceOptions.select`, when the grid's own `select` option is unset. */
1131
+ select?: string[];
1132
+ /** `expand` / `customQueryParams` from `dataSourceOptions`, to spread into `store.load()`. */
1133
+ loadOptions?: Record<string, unknown>;
1136
1134
  }
1137
1135
  /**
1138
1136
  * Consumer-supplied data access for server-side group paging. The controller
1139
1137
  * calls these; @mono-lit/helper never imports a fetcher, so any backend works.
1140
1138
  */
1141
1139
  export interface MonoServerGroupSource<T = any> {
1142
- /** Fetch the group list + per-group counts/aggregates (one cheap groupby). */
1143
- loadGroups(ctx: MonoServerGroupCtx): Promise<MonoGroupMeta[]>;
1144
- /** Fetch one page of rows for a single group (`$filter` + `$skip`/`$top`). */
1145
- loadRows(key: unknown, ctx: MonoServerGroupCtx & {
1146
- skip: number;
1147
- take: number;
1148
- }): Promise<T[]>;
1140
+ /** Fetch the group list + per-group counts/aggregates (one cheap groupby). */
1141
+ loadGroups(ctx: MonoServerGroupCtx): Promise<MonoGroupMeta[]>;
1142
+ /** Fetch one page of rows for a single group (`$filter` + `$skip`/`$top`). */
1143
+ loadRows(key: unknown, ctx: MonoServerGroupCtx & {
1144
+ skip: number;
1145
+ take: number;
1146
+ }): Promise<T[]>;
1149
1147
  }
1150
1148
  /**
1151
1149
  * A flattened, ready-to-render row for the table body — read `controller.displayRows`
@@ -1153,32 +1151,32 @@ export interface MonoServerGroupSource<T = any> {
1153
1151
  * group tree, test `isGroupNode`, or build keys in the consumer.
1154
1152
  */
1155
1153
  export interface MonoDisplayRow<T = any> {
1156
- /** Stable, unique key for the framework's keyed list. */
1157
- key: string;
1158
- /** What to render: a group header, a data row, or a per-group pager slot. */
1159
- kind: 'group' | 'row' | 'footer';
1160
- /** Nesting depth (0 = top level) — use for indentation. */
1161
- level: number;
1162
- /** The group node (set for `group` / `footer`). */
1163
- node?: MonoGroupNode<T>;
1164
- /** The data row (set for `row`) — always the RAW row. */
1165
- row?: T;
1166
- /**
1167
- * The row after `map` / per-column `map` (set for `row`). Identical to `row`
1168
- * when no map is configured, so a template can read `mapped` unconditionally.
1169
- */
1170
- mapped?: any;
1154
+ /** Stable, unique key for the framework's keyed list. */
1155
+ key: string;
1156
+ /** What to render: a group header, a data row, or a per-group pager slot. */
1157
+ kind: 'group' | 'row' | 'footer';
1158
+ /** Nesting depth (0 = top level) — use for indentation. */
1159
+ level: number;
1160
+ /** The group node (set for `group` / `footer`). */
1161
+ node?: MonoGroupNode<T>;
1162
+ /** The data row (set for `row`) — always the RAW row. */
1163
+ row?: T;
1164
+ /**
1165
+ * The row after `map` / per-column `map` (set for `row`). Identical to `row`
1166
+ * when no map is configured, so a template can read `mapped` unconditionally.
1167
+ */
1168
+ mapped?: any;
1171
1169
  }
1172
1170
  /** Per-group row paging snapshot, returned by {@link MonoTableController.groupPageInfo}. */
1173
1171
  export interface GroupPageInfo {
1174
- /** Zero-based current page within the group. */
1175
- pageIndex: number;
1176
- /** Total pages for the group's rows. */
1177
- pageCount: number;
1178
- /** Rows per group-page. */
1179
- pageSize: number;
1180
- /** Total rows (or sub-groups) directly under the group. */
1181
- total: number;
1172
+ /** Zero-based current page within the group. */
1173
+ pageIndex: number;
1174
+ /** Total pages for the group's rows. */
1175
+ pageCount: number;
1176
+ /** Rows per group-page. */
1177
+ pageSize: number;
1178
+ /** Total rows (or sub-groups) directly under the group. */
1179
+ total: number;
1182
1180
  }
1183
1181
  /**
1184
1182
  * Simplified, framework-agnostic view over a devextreme DataSource. Keeps its
@@ -1195,562 +1193,555 @@ export interface GroupPageInfo {
1195
1193
  * the original, not a rendering of it.
1196
1194
  */
1197
1195
  export interface MonoTableError {
1198
- /**
1199
- * The line to show. The preset for the HTTP status when there is one
1200
- * (`errorMessages` / `setErrorMessages()`), else the error's own text — see
1201
- * `describeError`.
1202
- */
1203
- message: string;
1204
- /** The HTTP status the error carried, `0` for a network failure, absent when it had none. */
1205
- status?: number;
1206
- /**
1207
- * What the server said beyond the status — an OData error body's message, a
1208
- * JSON `message` — or the error's own text when a preset took the headline.
1209
- * Never a bare reason phrase like "Forbidden".
1210
- */
1211
- detail?: string;
1212
- /** Exactly what was thrown — an `Error`, a string, an HTTP payload, anything. */
1213
- raw: unknown;
1214
- /** Which operation failed, so a consumer can word it ("Reload failed"). */
1215
- source: 'load' | 'reload' | 'group' | 'groupRows' | 'selectAll';
1216
- /** `Date.now()` at capture. */
1217
- at: number;
1196
+ /**
1197
+ * The line to show. The preset for the HTTP status when there is one
1198
+ * (`errorMessages` / `setErrorMessages()`), else the error's own text — see
1199
+ * `describeError`.
1200
+ */
1201
+ message: string;
1202
+ /** The HTTP status the error carried, `0` for a network failure, absent when it had none. */
1203
+ status?: number;
1204
+ /**
1205
+ * What the server said beyond the status — an OData error body's message, a
1206
+ * JSON `message` — or the error's own text when a preset took the headline.
1207
+ * Never a bare reason phrase like "Forbidden".
1208
+ */
1209
+ detail?: string;
1210
+ /** Exactly what was thrown — an `Error`, a string, an HTTP payload, anything. */
1211
+ raw: unknown;
1212
+ /** Which operation failed, so a consumer can word it ("Reload failed"). */
1213
+ source: 'load' | 'reload' | 'group' | 'groupRows' | 'selectAll';
1214
+ /** `Date.now()` at capture. */
1215
+ at: number;
1218
1216
  }
1219
1217
  export interface MonoTableController<T = any> {
1220
- /** Current page rows (mirror of `dataSource.items()`) — always RAW. */
1221
- items: T[];
1222
- /**
1223
- * `items` after `map` / per-column `map`, ready to render. Identical to `items`
1224
- * when neither is configured, so it is always safe to read.
1225
- */
1226
- mapped: any[];
1227
- /**
1228
- * Flattened, keyed rows ready to render (group headers, data rows, per-group
1229
- * pager footers). `v-for` over this and switch on `kind` — no tree walking.
1230
- */
1231
- displayRows: Array<MonoDisplayRow<T>>;
1232
- /** Whether the source is loading. */
1233
- loading: boolean;
1234
- /**
1235
- * Whether the bound source has settled at least once.
1236
- *
1237
- * `items: []` with `loading: false` is the controller's INITIAL state as well as
1238
- * "loaded, and there is genuinely nothing" — the two are otherwise
1239
- * indistinguishable, so anything that reacts to emptiness (`mono-table-empty`)
1240
- * would announce "no data" on a table that has not been asked for any yet.
1241
- * Latched on the first `changed` the source emits and reset when a different
1242
- * source is bound.
1243
- */
1244
- hasLoaded: boolean;
1245
- /**
1246
- * The last operation that failed, or `null`.
1247
- *
1248
- * A fresh object per failure, so two identical errors are still distinguishable
1249
- * — `<mono-table-error>` dismisses per failure by remembering the object it
1250
- * dismissed. Cleared by the next successful settle and when a new source is
1251
- * bound.
1252
- */
1253
- error: MonoTableError | null;
1254
- /** Total row count (needs `requireTotalCount: true`; else falls back). */
1255
- totalCount: number;
1256
- /** Zero-based current page index. */
1257
- pageIndex: number;
1258
- /** Rows per page. */
1259
- pageSize: number;
1260
- /** Whether the "all" page size is active (no pagination — everything shown). */
1261
- pageSizeAll: boolean;
1262
- /** Total number of pages. */
1263
- pageCount: number;
1264
- /**
1265
- * Active sort keys, **in precedence order** — `sorts[0]` is the primary. A
1266
- * column's sort arrow is single-key, so clicking one leaves exactly this entry;
1267
- * the header's right-click `Sort ›` menu appends instead, which is how a
1268
- * multi-key sort is built (and what the `<sup>` precedence badges reflect).
1269
- */
1270
- sorts: MonoSortEntry[];
1271
- /**
1272
- * Primary sort field (`sorts[0]`), or null. Kept for back-compat — read `sorts`
1273
- * to see every active key.
1274
- */
1275
- sortField: string | null;
1276
- /** Primary sort direction (`sorts[0]`), or null when unsorted. */
1277
- sortOrder: SortOrder;
1278
- /** Whether grouping is active (one or more group fields configured). */
1279
- grouped: boolean;
1280
- /** Active scroll-paging mode. `'off'` = classic numbered paging. */
1281
- scrollMode: 'off' | 'infinity' | 'virtual';
1282
- /** Whether more unloaded rows exist beyond `loadedCount` (scroll modes). */
1283
- hasMore: boolean;
1284
- /** Total rows currently accumulated (loaded) in a scroll mode. */
1285
- loadedCount: number;
1286
- /** Virtual window: first accumulated index rendered (`items[0]`). */
1287
- virtualStart: number;
1288
- /** Virtual window: one-past-last accumulated index rendered. */
1289
- virtualEnd: number;
1290
- /** Virtual top spacer height in px (rows scrolled above the window). */
1291
- virtualPadTop: number;
1292
- /** Virtual bottom spacer height in px (rows below the window). */
1293
- virtualPadBottom: number;
1294
- /** The bound source (or null). */
1295
- readonly dataSource: MonoGridSource<T> | null;
1296
- load(): Promise<void>;
1297
- reload(): Promise<void>;
1298
- /**
1299
- * Empty the PUBLISHED rows without a request — `items`, the scroll accumulator, the
1300
- * "all" buffer — and notify. The bound source and its filter / sort are untouched, so
1301
- * the next `load()` refills under whatever scope is set by then.
1302
- *
1303
- * For a consumer whose scope changed while nobody was looking (a dropdown panel that
1304
- * is shut): the list must not keep showing the previous scope's rows until someone
1305
- * opens it and pays for the fetch. A load in flight when this runs is superseded — its
1306
- * rows will not land on the cleared list.
1307
- */
1308
- clear(): void;
1309
- setPage(pageIndex: number): Promise<void>;
1310
- /**
1311
- * Enable a scroll-paging mode (flat tables only — grouped/server grids warn
1312
- * and stay on classic paging). Driven by `<mono-table-paging type="…">`.
1313
- *
1314
- * Pass `{ reload: false }` when the mode change is BOOKKEEPING rather than a request for
1315
- * different rows — a pager element being disconnected, most of all. Nothing consumes a fetch
1316
- * issued on the way out, and the accumulator is kept so a reconnect can resume from it.
1317
- */
1318
- setScrollPaging(mode: 'off' | 'infinity' | 'virtual', opts?: {
1319
- reload?: boolean;
1320
- }): Promise<void>;
1321
- /** Load & append the next page onto the scroll accumulator (no-op if `!hasMore`). */
1322
- loadNext(): Promise<void>;
1323
- /** Set the virtual render window (indices into the accumulator) + spacer px. */
1324
- setVirtualWindow(start: number, end: number, padTop: number, padBottom: number): void;
1325
- /**
1326
- * Override the page size (rows fetched per page / scroll chunk), winning over
1327
- * the bound source's configured `pageSize`. `null` clears the override.
1328
- * Applied order-independently: stored + re-applied on every `bind`.
1329
- */
1330
- setPreferredPageSize(pageSize: number | null): Promise<void>;
1331
- /** Set rows/groups per page, or `'all'` to load & show everything (chunked). */
1332
- setPageSize(pageSize: number | 'all'): Promise<void>;
1333
- setSearch(value: string): Promise<void>;
1334
- /**
1335
- * Multi-term search. Terms group by `field`: **OR within a field, AND across
1336
- * fields**, so `[{Nama,'a'},{Nama,'b'},{Code,'x'}]` becomes
1337
- * `(contains(Nama,'a') or contains(Nama,'b')) and contains(Code,'x')`.
1338
- *
1339
- * A term with no `field` searches every `searchExpr` column (ORed), which is
1340
- * exactly what {@link setSearch} does — `setSearch(v)` is shorthand for
1341
- * `setSearchTerms([{ value: v }])`.
1342
- */
1343
- setSearchTerms(terms: MonoSearchTerm[]): Promise<void>;
1344
- /**
1345
- * Replace the searched fields after construction — the same value
1346
- * `monoDataGrid({ searchValue })` takes (array or comma string, paths, `*`
1347
- * patterns and `{ field, custom }` entries all allowed).
1348
- *
1349
- * This is what `<mono-table-search search-value="…">` calls, so a template can
1350
- * declare the fields next to the search box instead of in the options. It
1351
- * **replaces** the configured option rather than merging with it; pass
1352
- * `undefined` to drop the override and fall back to the options.
1353
- *
1354
- * Re-runs the active search so the grid reflects the new fields at once.
1355
- */
1356
- setSearchValue(expr: MonoSearchValue | undefined | null): Promise<void>;
1357
- /** Alias of {@link setSearchValue}, under the option's older name. */
1358
- setSearchExpr(expr: MonoSearchValue | undefined | null): Promise<void>;
1359
- /**
1360
- * The fields currently searched, resolved from the options + any override.
1361
- *
1362
- * Returns `['*']` (every top-level field) when nothing was configured — that is
1363
- * the default — and `undefined` only when the bound **source** carries its own
1364
- * `searchExpr` and is therefore left to fold the search itself.
1365
- *
1366
- * NOTE this returns the **fields**, not the typed term — the live query text is
1367
- * {@link searchTerms}. (A devextreme DataSource uses `searchValue` for the text;
1368
- * here the whole family — the option, the element prop and this reader — names
1369
- * the fields, matching `mono-select` and `mono-tag-input`.)
1370
- */
1371
- searchValue(): MonoSearchExprEntry[] | undefined;
1372
- /** Alias of {@link searchValue}, under the option's older name. */
1373
- searchExpr(): MonoSearchExprEntry[] | undefined;
1374
- /** The live search terms (empty when unsearched). */
1375
- searchTerms: MonoSearchTerm[];
1376
- /**
1377
- * An explicit filter of the grid's own — what the slotted filter builder
1378
- * writes. One LAYER of the query, not the whole of it: it is AND-ed with the
1379
- * base (`dataSourceOptions.filter` + whatever the consumer set on the source),
1380
- * the header column filters and the search, and clearing it (`null`) clears
1381
- * only this layer. Array sources take an array (compiled) or a predicate.
1382
- */
1383
- setFilter(filter: unknown): Promise<void>;
1384
- /**
1385
- * Replace `dataSourceOptions` after construction and run the query. Pass the
1386
- * same shapes the option takes (a value, a getter, a `{ value }` box).
1387
- */
1388
- setDataSourceOptions(next: MaybeReactive<MonoDataSourceOptions> | undefined): Promise<void>;
1389
- /** Replace `odataOptions` after construction and run the query. */
1390
- setOdataOptions(next: MaybeReactive<MonoOdataOptions> | undefined): Promise<void>;
1391
- /**
1392
- * Re-read `dataSourceOptions` / `odataOptions` and the source's own filter,
1393
- * then load. The call to make after the reactive state behind a getter
1394
- * changed. Goes back to page 0 only when something actually changed — unlike
1395
- * `reload()`, which always restarts and drops the store cache.
1396
- */
1397
- refresh(): Promise<void>;
1398
- /** The merged, normalised options as of the last query (read-only snapshot). */
1399
- resolvedDataSourceOptions(): Readonly<MonoDataSourceOptions>;
1400
- /**
1401
- * The grid-owned filter-builder controller, when `monoDataGrid({ filterBuilder })
1402
- * is set. Bind it with `<mono-filter-builder :data-filter.prop="table.filterBuilder">`;
1403
- * `undefined` when no `filterBuilder` option was passed.
1404
- */
1405
- filterBuilder?: MonoFilterController;
1406
- /**
1407
- * Sort by a column. With no `order`, cycles `asc → desc → null` for that field;
1408
- * pass an explicit `order` (including `null` to drop the column) to set it.
1409
- * `field: null` clears every key.
1410
- *
1411
- * **Single-key by default** — the call REPLACES the whole sort, so clearing a key
1412
- * empties `sorts` rather than renumbering it. That is what a column's sort arrow
1413
- * does. Pass `{ multi: true }` to accumulate instead: an unsorted field is
1414
- * appended (pick order = precedence), an already-sorted one changes direction in
1415
- * place, and `null` drops just that field and renumbers the rest. That is what
1416
- * the header's right-click `Sort ›` menu does. Add `sticky: true` to that and
1417
- * the grid REMEMBERS the gesture: the arrows append too, until nothing is
1418
- * sorted any more (see `sortCombining`).
1419
- */
1420
- setSort(field: string | null, order?: SortOrder, options?: MonoSetSortOptions): Promise<void>;
1421
- /**
1422
- * Whether the user has started a combined sort from the menu and something is
1423
- * still sorted — the header arrows read this to append instead of replace.
1424
- */
1425
- sortCombining(): boolean;
1426
- /** This column's direction, or null when it isn't part of the sort. */
1427
- sortOf(field: string): SortOrder;
1428
- /** 1-based precedence of a column in `sorts`; `0` when it isn't sorted. */
1429
- sortIndex(field: string): number;
1430
- /** Drop every sort key. */
1431
- clearSort(): Promise<void>;
1432
- /**
1433
- * A column's `map` from `props.th`, if it declares one. Used by the header filter
1434
- * to relabel its value list; returns `undefined` for an unmapped column.
1435
- */
1436
- columnMap(field: string): ((value: any, row: any, index: number) => unknown) | undefined;
1437
- /**
1438
- * Restrict a column to the given values (empty/`null` clears it) and reload.
1439
- * Works for both a remote DataSource (devextreme `$filter`) and an array source
1440
- * (client-side predicate).
1441
- *
1442
- * **Single-column by default** — the call REPLACES every active column filter, so
1443
- * clearing empties them all. That is what the funnel icon does. Pass
1444
- * `{ multi: true }` to combine instead (AND across columns, OR within one),
1445
- * leaving the other columns alone and clearing only this one on empty. That is
1446
- * what the header's right-click `Header Filter ›` row does. Add `sticky: true`
1447
- * to that and the grid REMEMBERS the gesture: the funnel combines too, until
1448
- * nothing is filtered any more (see `columnFilterCombining`).
1449
- */
1450
- setColumnFilter(field: string, values: unknown[] | null, options?: MonoSetColumnFilterOptions): Promise<void>;
1451
- /**
1452
- * Whether the user has started combining filters from the menu and something
1453
- * is still filtered — the funnel reads this to combine instead of replace.
1454
- */
1455
- columnFilterCombining(): boolean;
1456
- /** What a failed load does to the published rows (`onError`). */
1457
- errorBehaviour(): MonoErrorBehaviour;
1458
- /** Change it after construction — `<mono-table-error behaviour>` calls this. */
1459
- setErrorBehaviour(next: MonoErrorBehaviour): void;
1460
- /** The values currently selected for a column's header filter (empty = none). */
1461
- columnFilter(field: string): unknown[];
1462
- /**
1463
- * Every field with an active header filter, in insertion order. The right-click
1464
- * `Header Filter ›` row is what pushes this past one entry (and, once it has,
1465
- * the funnel keeps adding — see `columnFilterCombining`).
1466
- */
1467
- filteredColumns(): string[];
1468
- /**
1469
- * The column's DISTINCT values with counts, for the header-filter list. Uses an
1470
- * OData `$apply=groupby((field))` request for a remote store, else derives them
1471
- * client-side from the array source's full data.
1472
- */
1473
- distinctValues(field: string, options?: MonoHeaderFilterLoadOptions): Promise<MonoColumnValue[]>;
1474
- /**
1475
- * Replace the backing rows. Effective only for array-backed tables (a plain
1476
- * array passed to `monoDataGrid`, or a `monoArraySource`); ignored for a
1477
- * remote DataSource.
1478
- */
1479
- setData(next: T[]): Promise<void>;
1480
- /**
1481
- * Change the group-by field(s) at runtime (pass `null`/`[]` to ungroup).
1482
- * Re-applies the group-contiguous sort, resets to page 0 and reloads.
1483
- */
1484
- setGroup(group: string | string[] | null): Promise<void>;
1485
- /** Collapse/expand a group by its node or `path`. */
1486
- toggleGroup(target: MonoGroupNode<T> | string): void;
1487
- /** Whether the group at `path` is currently collapsed. */
1488
- isGroupCollapsed(path: string): boolean;
1489
- /** Expand every group. */
1490
- expandAllGroups(): void;
1491
- /** Collapse every group. */
1492
- collapseAllGroups(): void;
1493
- /**
1494
- * Register/replace the per-group row page size for the group at `path` —
1495
- * called by `<mono-table-paging-group>` on connect. While registered, that
1496
- * group's rows are sliced to one page; otherwise all rows show.
1497
- */
1498
- setGroupPageSize(path: string, pageSize: number): void;
1499
- /** Set the current page within the group at `path`. */
1500
- setGroupPage(path: string, pageIndex: number): void;
1501
- /** Stop paging the group at `path` (show all its rows again). */
1502
- clearGroupPaging(path: string): void;
1503
- /** Current row-paging state for the group at `path`. */
1504
- groupPageInfo(path: string): GroupPageInfo;
1505
- /**
1506
- * The full (un-paged) group node at `path` for the current data — use its
1507
- * `items` for aggregates (e.g. a subtotal) even when the displayed rows are
1508
- * sliced by a `<mono-table-paging-group>`. `undefined` if not found.
1509
- */
1510
- groupNode(path: string): MonoGroupNode<T> | undefined;
1511
- /**
1512
- * Every row matching the current search / filters / sort — not just the page
1513
- * on screen — without disturbing what's displayed.
1514
- *
1515
- * A remote source is read straight off its store, so the bound DataSource's
1516
- * paging is never touched; an array source is read with paging temporarily
1517
- * off and restored afterwards. Either way `items` / `pageIndex` are the same
1518
- * when the promise resolves as they were before it.
1519
- */
1520
- getData(): Promise<T[]>;
1521
- /**
1522
- * The full group tree for `rows`, using the group field(s) already configured
1523
- * on this grid. Omit `rows` to group everything {@link getData} returns.
1524
- * Empty when the grid isn't grouped.
1525
- *
1526
- * To group by something other than the grid's own fields, use the exported
1527
- * `buildGroups(rows, fields)` helper directly.
1528
- */
1529
- buildGroups(rows?: T[]): Promise<Array<MonoGroupNode<T>>>;
1530
- /**
1531
- * Render a Markdown report template.
1532
- *
1533
- * The template is authored in Markdown (Handlebars for loops/conditions, Jexl
1534
- * for `{{= … }}` expressions) and rendered to Markdown or `.xlsx`. The
1535
- * template sees **exactly** what you put in `data` — nothing is injected — so
1536
- * pass the grid's rows explicitly when a report needs them.
1537
- *
1538
- * The engine (and the optional `exceljs` peer) is loaded on first use, so
1539
- * importing `monoDataGrid` costs nothing if you never export.
1540
- *
1541
- * @example
1542
- * const report = await table.export({
1543
- * md: template, // import md from './payroll.md?raw'
1544
- * fileName: 'payroll.xlsx', // extension picks the renderer + downloads
1545
- * data: { rows: await table.getData(), company },
1546
- * styles: { header: { bg: '#1F2937' } },
1547
- * })
1548
- */
1549
- export(options: MonoExportOptions): Promise<MonoExportResult>;
1550
- /**
1551
- * Read an edited spreadsheet back into the grid as **staged** changes.
1552
- *
1553
- * Pairs each sheet row with a table row by composite key, coerces the declared
1554
- * columns, and stages only the cells that actually differ. The underlying data
1555
- * is untouched until `saveChanges()` — so an import can be reviewed, and
1556
- * `discardChanges()` undoes the whole thing.
1557
- *
1558
- * Imported cells are marked (see {@link isCellImported}) so they can be tinted
1559
- * differently from hand edits.
1560
- *
1561
- * @example
1562
- * const result = await table.import({
1563
- * type: 'excel', // or 'copy-paste'; inferred from `data`
1564
- * data: file,
1565
- * match: [{ excel: 'Brand', field: 'BrandNama' }],
1566
- * columns: [{ excel: 'JAN', field: 'Jan', type: 'number' }],
1567
- * })
1568
- * if (!result.ok) warn(`${result.unmatched} rows didn't match`)
1569
- */
1570
- import(options: MonoImportOptions<T>): Promise<MonoImportResult<T>>;
1571
- /** Whether a cell's staged value came from an import rather than a hand edit. */
1572
- isCellImported(rowKey: string, field: string): boolean;
1573
- /** Whether any of a row's staged values came from an import. */
1574
- isRowImported(rowKey: string): boolean;
1575
- /**
1576
- * With no args, an iterable handle over every computed summary — loop
1577
- * `table.summary().getAll()` (each `{ field, type, value, text }`) to render
1578
- * totals anywhere, or `table.summary().get(field)` for one.
1579
- */
1580
- summary(): MonoSummaryHandle;
1581
- /**
1582
- * The computed aggregate for a column, or `null` when there's no numeric data
1583
- * (or it hasn't been computed yet). Reads the summary cache; if no spec matches
1584
- * `field`(+`type`), a default one (`{ field, type: type ?? 'sum' }`) is
1585
- * registered on the fly, so a bare `table.summary('Price')` works with no
1586
- * central config. Computed over the full filtered set — not just the page.
1587
- */
1588
- summary(field: string, type?: MonoSummaryType): number | null;
1589
- /**
1590
- * Attach (or clear, with `null`) the server-side summary resolver after the
1591
- * grid is built — see {@link MonoSummaryConfig.resolve}. The aggregates are
1592
- * recomputed immediately, so a footer already on screen updates itself.
1593
- */
1594
- setSummaryResolver(resolve: MonoSummaryResolver | null): void;
1595
- /**
1596
- * The formatted summary string for a column, per its spec's
1597
- * `format`/`prefix`/`precision`/`suffix` (`emptyText` when null). This is what
1598
- * `<mono-table-summary>` renders.
1599
- */
1600
- summaryText(field: string, type?: MonoSummaryType): string;
1601
- /** Register/replace a summary spec (called by `<mono-table-summary>` on connect). */
1602
- registerSummary(spec: MonoSummarySpec): void;
1603
- /** Remove a summary spec (called on disconnect). */
1604
- unregisterSummary(spec: MonoSummarySpec): void;
1605
- /** The currently registered summary specs. */
1606
- summaries(): ReadonlyArray<MonoSummarySpec>;
1607
- /** Attach (or swap) the source — a devextreme DataSource or a plain array. */
1608
- bind(ds: MonoGridSource<T> | T[] | null): void;
1609
- /** Subscribe to state changes; returns an unsubscribe function. */
1610
- subscribe(cb: () => void): () => void;
1611
- /** Detach listeners and clear subscribers. */
1612
- dispose(): void;
1613
- /** Row key of the row currently in edit mode, or `null`. */
1614
- editingKey: string | null;
1615
- /**
1616
- * Optional sink for inline edits. `commitCell` invokes this with the change so
1617
- * the consumer can update its own full data array and call `setData`. Assign
1618
- * after creating the controller (`table.onCellChange = …`).
1619
- */
1620
- onCellChange: ((change: MonoCellChange<T>) => void) | null;
1621
- /**
1622
- * How a row click opens its inline editor — `'click'` (default) or
1623
- * `'double-click'`. Set it via `monoDataGrid(data, { editableTrigger })`, or
1624
- * per table by putting `editable-trigger` on a `<mono-table-th>` (a th only
1625
- * writes when its own prop is set).
1626
- */
1627
- editableTrigger: MonoEditableTrigger;
1628
- /**
1629
- * How the keyboard moves between inline editors — `'tab-arrows'` (default) or
1630
- * `'native'`. Set it via `monoDataGrid(data, { editorNavKeys })`.
1631
- */
1632
- editorNavKeys: MonoEditorNavKeys;
1633
- /**
1634
- * Move the inline editor one cell in `dir` and focus it, scrolling it into
1635
- * view. Returns `false` when the move is blocked by an edge (and nothing
1636
- * moved) — the arrow directions never wrap. Normally driven by the keyboard,
1637
- * but public so a consumer can wire its own buttons.
1638
- */
1639
- moveEditor(dir: MonoEditorDirection, fromEl?: EventTarget | null): boolean;
1640
- /**
1641
- * Bind the row trigger to the `<table>` holding this grid's rows. Called by
1642
- * `mono-table-th` on update — idempotent, so the repeated calls from every
1643
- * header cell collapse to a single listener.
1644
- */
1645
- bindRowTrigger(tableEl: HTMLElement | null): void;
1646
- /** Register/replace a header-cell element — called by `mono-table-th` on connect. */
1647
- registerColumn(el: MonoColumnEl): void;
1648
- /** Remove a header-cell element — called on disconnect. */
1649
- unregisterColumn(el: MonoColumnEl): void;
1650
- /**
1651
- * The central column config (from `monoDataGrid(data, { columns })`) as an
1652
- * iterable handle: `table.columns().get(field)` / `.getAll()`. For the live
1653
- * registered `<mono-table-th>` list, use {@link registeredColumns}.
1654
- */
1655
- columns(): MonoColumnHandle;
1656
- /**
1657
- * The central element props (`monoDataGrid({ props })`), merged with `columns`.
1658
- * A stable object mutated in place — read it after `subscribe`, or drive a
1659
- * template from the `state` ref. `props().th` is the per-column list you loop
1660
- * yourself to render the header.
1661
- */
1662
- props(): MonoTableProps;
1663
- /**
1664
- * Row-detail handle — `table.detail().expandAll()` / `.collapseAll()` /
1665
- * `.openCount()` / `.getAll()` over every `<mono-table-detail>` bound to this
1666
- * grid. `collapseAll()` skips the ones marked `stay-open`.
1667
- */
1668
- detail(): MonoDetailHandle;
1669
- /**
1670
- * Row-selection handle — what `<mono-table-checkbox>` drives and
1671
- * `table.check().getAll()` reads back. The selection is keyed by
1672
- * {@link rowKey}, so it survives paging, sorting, searching and filtering;
1673
- * only `clear()` (or unchecking) empties it.
1674
- */
1675
- check(): MonoCheckHandle<T>;
1676
- /** Register a `<mono-table-detail>` — called by the element on connect. */
1677
- registerDetail(el: MonoDetailEl): void;
1678
- /** Remove a `<mono-table-detail>` — called on disconnect. */
1679
- unregisterDetail(el: MonoDetailEl): void;
1680
- /** Registered `<mono-table-th>` elements in DOM (visual) order. */
1681
- registeredColumns(): MonoColumn[];
1682
- /** Registered columns that declare an `editable` config, in DOM order. */
1683
- editableColumns(): MonoColumn[];
1684
- /**
1685
- * Put a row into edit mode (all its editable cells). Pass the triggering DOM
1686
- * event (the row click / dblclick) to auto-focus the row's first editor, so a
1687
- * later click/tab away reliably exits via `editorBlur`.
1688
- */
1689
- beginEditRow(rowKey: string, event?: Event): void;
1690
- /** Leave edit mode. */
1691
- cancelEdit(): void;
1692
- /** Whether `rowKey` is the row currently being edited. */
1693
- isEditingRow(rowKey: string): boolean;
1694
- /** Whether `rowKey`'s `field` cell should render an editor right now. */
1695
- isEditingCell(rowKey: string, field: string): boolean;
1696
- /** Emit a cell change immediately (funnels to `onCellChange`). */
1697
- commitCell(rowKey: string, field: string, value: unknown): void;
1698
- /** Buffer an edit (shown optimistically; not sent). */
1699
- stageCell(rowKey: string, field: string, value: unknown): void;
1700
- /** Staged value for a cell, or `fallback` when it isn't staged. */
1701
- cellValue(rowKey: string, field: string, fallback: unknown): unknown;
1702
- /** Whether a specific cell has a staged edit. */
1703
- isCellDirty(rowKey: string, field: string): boolean;
1704
- /** Whether a row has any staged edit. */
1705
- isRowDirty(rowKey: string): boolean;
1706
- /** Number of rows with staged edits. */
1707
- pendingCount(): number;
1708
- /** Whether any edit is staged. */
1709
- hasChanges(): boolean;
1710
- /** The staged change set — for sending your own (bulk) request. */
1711
- changes(): Array<MonoStagedChange<T>>;
1712
- /** Drop all staged edits (reverts the optimistic display). */
1713
- discardChanges(): void;
1714
- /**
1715
- * Flush staged edits to the bound source: a DataSource store `update` (OData
1716
- * PATCH) per row + `reload()`, an array source per-row `update`, or a `setData`
1717
- * merge. Keeps the buffer on error so the save is retryable.
1718
- */
1719
- saveChanges(): Promise<void>;
1720
- /**
1721
- * Keyboard handler an inline editor forwards its `keydown` to. Tab wraps to the
1722
- * next/previous row's editor at a row boundary; Enter/Escape leave edit mode.
1723
- * Rows must carry `data-row-key` and editors `data-edit-cell` for focus to move.
1724
- */
1725
- editorKeydown(event: KeyboardEvent, rowKey: string, field: string): void;
1726
- /**
1727
- * Row-level CRUD staging for **optimistic** updates after your own change API
1728
- * succeeds — insert/update/delete whole rows without a full reload. Returns a
1729
- * chainable handle that shares one buffer across calls; `apply()` commits the
1730
- * staged ops into the rendered data locally (no server call).
1731
- *
1732
- * @example
1733
- * table.form({ key: 'Id' }).edit(1, updatedRow).apply()
1734
- * table.form().add().apply() // append one auto-shaped empty row
1735
- */
1736
- form(config?: MonoFormConfig<T>): MonoFormHandle<T>;
1737
- /** The live row-level staging buffer (readable) — what `form()` has staged but not yet applied. */
1738
- pendingData: Array<MonoFormOp<T>>;
1739
- /**
1740
- * Stable string key for a row — use it as the `data-row-key` / editing key
1741
- * (e.g. `const rk = (row) => table.rowKey(row)`). For a `form({ showForm: true })`
1742
- * row it returns an internal stable id that survives edits to the key field;
1743
- * otherwise it's `String(row[keyExpr])`.
1744
- */
1745
- rowKey(row: T): string;
1218
+ /** Current page rows (mirror of `dataSource.items()`) — always RAW. */
1219
+ items: T[];
1220
+ /**
1221
+ * `items` after `map` / per-column `map`, ready to render. Identical to `items`
1222
+ * when neither is configured, so it is always safe to read.
1223
+ */
1224
+ mapped: any[];
1225
+ /**
1226
+ * Flattened, keyed rows ready to render (group headers, data rows, per-group
1227
+ * pager footers). `v-for` over this and switch on `kind` — no tree walking.
1228
+ */
1229
+ displayRows: Array<MonoDisplayRow<T>>;
1230
+ /** Whether the source is loading. */
1231
+ loading: boolean;
1232
+ /**
1233
+ * Whether the bound source has settled at least once.
1234
+ *
1235
+ * `items: []` with `loading: false` is the controller's INITIAL state as well as
1236
+ * "loaded, and there is genuinely nothing" — the two are otherwise
1237
+ * indistinguishable, so anything that reacts to emptiness (`mono-table-empty`)
1238
+ * would announce "no data" on a table that has not been asked for any yet.
1239
+ * Latched on the first `changed` the source emits and reset when a different
1240
+ * source is bound.
1241
+ */
1242
+ hasLoaded: boolean;
1243
+ /**
1244
+ * The last operation that failed, or `null`.
1245
+ *
1246
+ * A fresh object per failure, so two identical errors are still distinguishable
1247
+ * — `<mono-table-error>` dismisses per failure by remembering the object it
1248
+ * dismissed. Cleared by the next successful settle and when a new source is
1249
+ * bound.
1250
+ */
1251
+ error: MonoTableError | null;
1252
+ /** Total row count (needs `requireTotalCount: true`; else falls back). */
1253
+ totalCount: number;
1254
+ /** Zero-based current page index. */
1255
+ pageIndex: number;
1256
+ /** Rows per page. */
1257
+ pageSize: number;
1258
+ /** Whether the "all" page size is active (no pagination — everything shown). */
1259
+ pageSizeAll: boolean;
1260
+ /** Total number of pages. */
1261
+ pageCount: number;
1262
+ /**
1263
+ * Active sort keys, **in precedence order** — `sorts[0]` is the primary. A
1264
+ * column's sort arrow is single-key, so clicking one leaves exactly this entry;
1265
+ * the header's right-click `Sort ›` menu appends instead, which is how a
1266
+ * multi-key sort is built (and what the `<sup>` precedence badges reflect).
1267
+ */
1268
+ sorts: MonoSortEntry[];
1269
+ /**
1270
+ * Primary sort field (`sorts[0]`), or null. Kept for back-compat — read `sorts`
1271
+ * to see every active key.
1272
+ */
1273
+ sortField: string | null;
1274
+ /** Primary sort direction (`sorts[0]`), or null when unsorted. */
1275
+ sortOrder: SortOrder;
1276
+ /** Whether grouping is active (one or more group fields configured). */
1277
+ grouped: boolean;
1278
+ /** Active scroll-paging mode. `'off'` = classic numbered paging. */
1279
+ scrollMode: 'off' | 'infinity' | 'virtual';
1280
+ /** Whether more unloaded rows exist beyond `loadedCount` (scroll modes). */
1281
+ hasMore: boolean;
1282
+ /** Total rows currently accumulated (loaded) in a scroll mode. */
1283
+ loadedCount: number;
1284
+ /** Virtual window: first accumulated index rendered (`items[0]`). */
1285
+ virtualStart: number;
1286
+ /** Virtual window: one-past-last accumulated index rendered. */
1287
+ virtualEnd: number;
1288
+ /** Virtual top spacer height in px (rows scrolled above the window). */
1289
+ virtualPadTop: number;
1290
+ /** Virtual bottom spacer height in px (rows below the window). */
1291
+ virtualPadBottom: number;
1292
+ /** The bound source (or null). */
1293
+ readonly dataSource: MonoGridSource<T> | null;
1294
+ load(): Promise<void>;
1295
+ reload(): Promise<void>;
1296
+ /**
1297
+ * Empty the PUBLISHED rows without a request — `items`, the scroll accumulator, the
1298
+ * "all" buffer — and notify. The bound source and its filter / sort are untouched, so
1299
+ * the next `load()` refills under whatever scope is set by then.
1300
+ *
1301
+ * For a consumer whose scope changed while nobody was looking (a dropdown panel that
1302
+ * is shut): the list must not keep showing the previous scope's rows until someone
1303
+ * opens it and pays for the fetch. A load in flight when this runs is superseded — its
1304
+ * rows will not land on the cleared list.
1305
+ */
1306
+ clear(): void;
1307
+ setPage(pageIndex: number): Promise<void>;
1308
+ /**
1309
+ * Enable a scroll-paging mode (flat tables only — grouped/server grids warn
1310
+ * and stay on classic paging). Driven by `<mono-table-paging type="…">`.
1311
+ *
1312
+ * Pass `{ reload: false }` when the mode change is BOOKKEEPING rather than a request for
1313
+ * different rows — a pager element being disconnected, most of all. Nothing consumes a fetch
1314
+ * issued on the way out, and the accumulator is kept so a reconnect can resume from it.
1315
+ */
1316
+ setScrollPaging(mode: 'off' | 'infinity' | 'virtual', opts?: {
1317
+ reload?: boolean;
1318
+ }): Promise<void>;
1319
+ /** Load & append the next page onto the scroll accumulator (no-op if `!hasMore`). */
1320
+ loadNext(): Promise<void>;
1321
+ /** Set the virtual render window (indices into the accumulator) + spacer px. */
1322
+ setVirtualWindow(start: number, end: number, padTop: number, padBottom: number): void;
1323
+ /**
1324
+ * Override the page size (rows fetched per page / scroll chunk), winning over
1325
+ * the bound source's configured `pageSize`. `null` clears the override.
1326
+ * Applied order-independently: stored + re-applied on every `bind`.
1327
+ */
1328
+ setPreferredPageSize(pageSize: number | null): Promise<void>;
1329
+ /** Set rows/groups per page, or `'all'` to load & show everything (chunked). */
1330
+ setPageSize(pageSize: number | 'all'): Promise<void>;
1331
+ setSearch(value: string): Promise<void>;
1332
+ /**
1333
+ * Multi-term search. Terms group by `field`: **OR within a field, AND across
1334
+ * fields**, so `[{Nama,'a'},{Nama,'b'},{Code,'x'}]` becomes
1335
+ * `(contains(Nama,'a') or contains(Nama,'b')) and contains(Code,'x')`.
1336
+ *
1337
+ * A term with no `field` searches every `searchExpr` column (ORed), which is
1338
+ * exactly what {@link setSearch} does — `setSearch(v)` is shorthand for
1339
+ * `setSearchTerms([{ value: v }])`.
1340
+ */
1341
+ setSearchTerms(terms: MonoSearchTerm[]): Promise<void>;
1342
+ /**
1343
+ * Replace the searched fields after construction — the same value
1344
+ * `monoDataGrid({ searchValue })` takes (array or comma string, paths, `*`
1345
+ * patterns and `{ field, custom }` entries all allowed).
1346
+ *
1347
+ * This is what `<mono-table-search search-value="…">` calls, so a template can
1348
+ * declare the fields next to the search box instead of in the options. It
1349
+ * **replaces** the configured option rather than merging with it; pass
1350
+ * `undefined` to drop the override and fall back to the options.
1351
+ *
1352
+ * Re-runs the active search so the grid reflects the new fields at once.
1353
+ */
1354
+ setSearchValue(expr: MonoSearchValue | undefined | null): Promise<void>;
1355
+ /** Alias of {@link setSearchValue}, under the option's older name. */
1356
+ setSearchExpr(expr: MonoSearchValue | undefined | null): Promise<void>;
1357
+ /**
1358
+ * The fields currently searched, resolved from the options + any override.
1359
+ *
1360
+ * Returns `['*']` (every top-level field) when nothing was configured — that is
1361
+ * the default — and `undefined` only when the bound **source** carries its own
1362
+ * `searchExpr` and is therefore left to fold the search itself.
1363
+ *
1364
+ * NOTE this returns the **fields**, not the typed term — the live query text is
1365
+ * {@link searchTerms}. (A devextreme DataSource uses `searchValue` for the text;
1366
+ * here the whole family — the option, the element prop and this reader — names
1367
+ * the fields, matching `mono-select` and `mono-tag-input`.)
1368
+ */
1369
+ searchValue(): MonoSearchExprEntry[] | undefined;
1370
+ /** Alias of {@link searchValue}, under the option's older name. */
1371
+ searchExpr(): MonoSearchExprEntry[] | undefined;
1372
+ /** The live search terms (empty when unsearched). */
1373
+ searchTerms: MonoSearchTerm[];
1374
+ /**
1375
+ * An explicit filter of the grid's own — what the slotted filter builder
1376
+ * writes. One LAYER of the query, not the whole of it: it is AND-ed with the
1377
+ * base (`dataSourceOptions.filter` + whatever the consumer set on the source),
1378
+ * the header column filters and the search, and clearing it (`null`) clears
1379
+ * only this layer. Array sources take an array (compiled) or a predicate.
1380
+ */
1381
+ setFilter(filter: unknown): Promise<void>;
1382
+ /**
1383
+ * Replace `dataSourceOptions` after construction and run the query. Pass the
1384
+ * same shapes the option takes (a value, a getter, a `{ value }` box).
1385
+ */
1386
+ setDataSourceOptions(next: MaybeReactive<MonoDataSourceOptions> | undefined): Promise<void>;
1387
+ /** Replace `odataOptions` after construction and run the query. */
1388
+ setOdataOptions(next: MaybeReactive<MonoOdataOptions> | undefined): Promise<void>;
1389
+ /**
1390
+ * Re-read `dataSourceOptions` / `odataOptions` and the source's own filter,
1391
+ * then load. The call to make after the reactive state behind a getter
1392
+ * changed. Goes back to page 0 only when something actually changed — unlike
1393
+ * `reload()`, which always restarts and drops the store cache.
1394
+ */
1395
+ refresh(): Promise<void>;
1396
+ /** The merged, normalised options as of the last query (read-only snapshot). */
1397
+ resolvedDataSourceOptions(): Readonly<MonoDataSourceOptions>;
1398
+ /**
1399
+ * The grid-owned filter-builder controller, when `monoDataGrid({ filterBuilder })
1400
+ * is set. Bind it with `<mono-filter-builder :data-filter.prop="table.filterBuilder">`;
1401
+ * `undefined` when no `filterBuilder` option was passed.
1402
+ */
1403
+ filterBuilder?: MonoFilterController;
1404
+ /**
1405
+ * Sort by a column. With no `order`, cycles `asc → desc → null` for that field;
1406
+ * pass an explicit `order` (including `null` to drop the column) to set it.
1407
+ * `field: null` clears every key.
1408
+ *
1409
+ * **Single-key by default** — the call REPLACES the whole sort, so clearing a key
1410
+ * empties `sorts` rather than renumbering it. That is what a column's sort arrow
1411
+ * does. Pass `{ multi: true }` to accumulate instead: an unsorted field is
1412
+ * appended (pick order = precedence), an already-sorted one changes direction in
1413
+ * place, and `null` drops just that field and renumbers the rest. That is what
1414
+ * the header's right-click `Sort ›` menu does. Add `sticky: true` to that and
1415
+ * the grid REMEMBERS the gesture: the arrows append too, until nothing is
1416
+ * sorted any more (see `sortCombining`).
1417
+ */
1418
+ setSort(field: string | null, order?: SortOrder, options?: MonoSetSortOptions): Promise<void>;
1419
+ /**
1420
+ * Whether the user has started a combined sort from the menu and something is
1421
+ * still sorted — the header arrows read this to append instead of replace.
1422
+ */
1423
+ sortCombining(): boolean;
1424
+ /** This column's direction, or null when it isn't part of the sort. */
1425
+ sortOf(field: string): SortOrder;
1426
+ /** 1-based precedence of a column in `sorts`; `0` when it isn't sorted. */
1427
+ sortIndex(field: string): number;
1428
+ /** Drop every sort key. */
1429
+ clearSort(): Promise<void>;
1430
+ /**
1431
+ * A column's `map` from `props.th`, if it declares one. Used by the header filter
1432
+ * to relabel its value list; returns `undefined` for an unmapped column.
1433
+ */
1434
+ columnMap(field: string): ((value: any, row: any, index: number) => unknown) | undefined;
1435
+ /**
1436
+ * Restrict a column to the given values (empty/`null` clears it) and reload.
1437
+ * Works for both a remote DataSource (devextreme `$filter`) and an array source
1438
+ * (client-side predicate).
1439
+ *
1440
+ * **Single-column by default** — the call REPLACES every active column filter, so
1441
+ * clearing empties them all. That is what the funnel icon does. Pass
1442
+ * `{ multi: true }` to combine instead (AND across columns, OR within one),
1443
+ * leaving the other columns alone and clearing only this one on empty. That is
1444
+ * what the header's right-click `Header Filter ›` row does. Add `sticky: true`
1445
+ * to that and the grid REMEMBERS the gesture: the funnel combines too, until
1446
+ * nothing is filtered any more (see `columnFilterCombining`).
1447
+ */
1448
+ setColumnFilter(field: string, values: unknown[] | null, options?: MonoSetColumnFilterOptions): Promise<void>;
1449
+ /**
1450
+ * Whether the user has started combining filters from the menu and something
1451
+ * is still filtered — the funnel reads this to combine instead of replace.
1452
+ */
1453
+ columnFilterCombining(): boolean;
1454
+ /** What a failed load does to the published rows (`onError`). */
1455
+ errorBehaviour(): MonoErrorBehaviour;
1456
+ /** Change it after construction — `<mono-table-error behaviour>` calls this. */
1457
+ setErrorBehaviour(next: MonoErrorBehaviour): void;
1458
+ /** The values currently selected for a column's header filter (empty = none). */
1459
+ columnFilter(field: string): unknown[];
1460
+ /**
1461
+ * Every field with an active header filter, in insertion order. The right-click
1462
+ * `Header Filter ›` row is what pushes this past one entry (and, once it has,
1463
+ * the funnel keeps adding — see `columnFilterCombining`).
1464
+ */
1465
+ filteredColumns(): string[];
1466
+ /**
1467
+ * The column's DISTINCT values with counts, for the header-filter list. Uses an
1468
+ * OData `$apply=groupby((field))` request for a remote store, else derives them
1469
+ * client-side from the array source's full data.
1470
+ */
1471
+ distinctValues(field: string, options?: MonoHeaderFilterLoadOptions): Promise<MonoColumnValue[]>;
1472
+ /**
1473
+ * Replace the backing rows. Effective only for array-backed tables (a plain
1474
+ * array passed to `monoDataGrid`, or a `monoArraySource`); ignored for a
1475
+ * remote DataSource.
1476
+ */
1477
+ setData(next: T[]): Promise<void>;
1478
+ /**
1479
+ * Change the group-by field(s) at runtime (pass `null`/`[]` to ungroup).
1480
+ * Re-applies the group-contiguous sort, resets to page 0 and reloads.
1481
+ */
1482
+ setGroup(group: string | string[] | null): Promise<void>;
1483
+ /** Collapse/expand a group by its node or `path`. */
1484
+ toggleGroup(target: MonoGroupNode<T> | string): void;
1485
+ /** Whether the group at `path` is currently collapsed. */
1486
+ isGroupCollapsed(path: string): boolean;
1487
+ /** Expand every group. */
1488
+ expandAllGroups(): void;
1489
+ /** Collapse every group. */
1490
+ collapseAllGroups(): void;
1491
+ /**
1492
+ * Register/replace the per-group row page size for the group at `path` —
1493
+ * called by `<mono-table-paging-group>` on connect. While registered, that
1494
+ * group's rows are sliced to one page; otherwise all rows show.
1495
+ */
1496
+ setGroupPageSize(path: string, pageSize: number): void;
1497
+ /** Set the current page within the group at `path`. */
1498
+ setGroupPage(path: string, pageIndex: number): void;
1499
+ /** Stop paging the group at `path` (show all its rows again). */
1500
+ clearGroupPaging(path: string): void;
1501
+ /** Current row-paging state for the group at `path`. */
1502
+ groupPageInfo(path: string): GroupPageInfo;
1503
+ /**
1504
+ * The full (un-paged) group node at `path` for the current data — use its
1505
+ * `items` for aggregates (e.g. a subtotal) even when the displayed rows are
1506
+ * sliced by a `<mono-table-paging-group>`. `undefined` if not found.
1507
+ */
1508
+ groupNode(path: string): MonoGroupNode<T> | undefined;
1509
+ /**
1510
+ * Every row matching the current search / filters / sort — not just the page
1511
+ * on screen — without disturbing what's displayed.
1512
+ *
1513
+ * A remote source is read straight off its store, so the bound DataSource's
1514
+ * paging is never touched; an array source is read with paging temporarily
1515
+ * off and restored afterwards. Either way `items` / `pageIndex` are the same
1516
+ * when the promise resolves as they were before it.
1517
+ */
1518
+ getData(): Promise<T[]>;
1519
+ /**
1520
+ * The full group tree for `rows`, using the group field(s) already configured
1521
+ * on this grid. Omit `rows` to group everything {@link getData} returns.
1522
+ * Empty when the grid isn't grouped.
1523
+ *
1524
+ * To group by something other than the grid's own fields, use the exported
1525
+ * `buildGroups(rows, fields)` helper directly.
1526
+ */
1527
+ buildGroups(rows?: T[]): Promise<Array<MonoGroupNode<T>>>;
1528
+ /**
1529
+ * Render a Markdown report template.
1530
+ *
1531
+ * The template is authored in Markdown (Handlebars for loops/conditions, Jexl
1532
+ * for `{{= … }}` expressions) and rendered to Markdown or `.xlsx`. The
1533
+ * template sees **exactly** what you put in `data` — nothing is injected — so
1534
+ * pass the grid's rows explicitly when a report needs them.
1535
+ *
1536
+ * The engine (and the optional `exceljs` peer) is loaded on first use, so
1537
+ * importing `monoDataGrid` costs nothing if you never export.
1538
+ *
1539
+ * @example
1540
+ * const report = await table.export({
1541
+ * md: template, // import md from './payroll.md?raw'
1542
+ * fileName: 'payroll.xlsx', // extension picks the renderer + downloads
1543
+ * data: { rows: await table.getData(), company },
1544
+ * styles: { header: { bg: '#1F2937' } },
1545
+ * })
1546
+ */
1547
+ export(options: MonoExportOptions): Promise<MonoExportResult>;
1548
+ /**
1549
+ * Read an edited spreadsheet back into the grid as **staged** changes.
1550
+ *
1551
+ * Pairs each sheet row with a table row by composite key, coerces the declared
1552
+ * columns, and stages only the cells that actually differ. The underlying data
1553
+ * is untouched until `saveChanges()` — so an import can be reviewed, and
1554
+ * `discardChanges()` undoes the whole thing.
1555
+ *
1556
+ * Imported cells are marked (see {@link isCellImported}) so they can be tinted
1557
+ * differently from hand edits.
1558
+ *
1559
+ * @example
1560
+ * const result = await table.import({
1561
+ * type: 'excel', // or 'copy-paste'; inferred from `data`
1562
+ * data: file,
1563
+ * match: [{ excel: 'Brand', field: 'BrandNama' }],
1564
+ * columns: [{ excel: 'JAN', field: 'Jan', type: 'number' }],
1565
+ * })
1566
+ * if (!result.ok) warn(`${result.unmatched} rows didn't match`)
1567
+ */
1568
+ import(options: MonoImportOptions<T>): Promise<MonoImportResult<T>>;
1569
+ /** Whether a cell's staged value came from an import rather than a hand edit. */
1570
+ isCellImported(rowKey: string, field: string): boolean;
1571
+ /** Whether any of a row's staged values came from an import. */
1572
+ isRowImported(rowKey: string): boolean;
1573
+ /**
1574
+ * With no args, an iterable handle over every computed summary — loop
1575
+ * `table.summary().getAll()` (each `{ field, type, value, text }`) to render
1576
+ * totals anywhere, or `table.summary().get(field)` for one.
1577
+ */
1578
+ summary(): MonoSummaryHandle;
1579
+ /**
1580
+ * The computed aggregate for a column, or `null` when there's no numeric data
1581
+ * (or it hasn't been computed yet). Reads the summary cache; if no spec matches
1582
+ * `field`(+`type`), a default one (`{ field, type: type ?? 'sum' }`) is
1583
+ * registered on the fly, so a bare `table.summary('Price')` works with no
1584
+ * central config. Computed over the full filtered set — not just the page.
1585
+ */
1586
+ summary(field: string, type?: MonoSummaryType): number | null;
1587
+ /**
1588
+ * Attach (or clear, with `null`) the server-side summary resolver after the
1589
+ * grid is built — see {@link MonoSummaryConfig.resolve}. The aggregates are
1590
+ * recomputed immediately, so a footer already on screen updates itself.
1591
+ */
1592
+ setSummaryResolver(resolve: MonoSummaryResolver | null): void;
1593
+ /**
1594
+ * The formatted summary string for a column, per its spec's
1595
+ * `format`/`prefix`/`precision`/`suffix` (`emptyText` when null). This is what
1596
+ * `<mono-table-summary>` renders.
1597
+ */
1598
+ summaryText(field: string, type?: MonoSummaryType): string;
1599
+ /** Register/replace a summary spec (called by `<mono-table-summary>` on connect). */
1600
+ registerSummary(spec: MonoSummarySpec): void;
1601
+ /** Remove a summary spec (called on disconnect). */
1602
+ unregisterSummary(spec: MonoSummarySpec): void;
1603
+ /** The currently registered summary specs. */
1604
+ summaries(): ReadonlyArray<MonoSummarySpec>;
1605
+ /** Attach (or swap) the source — a devextreme DataSource or a plain array. */
1606
+ bind(ds: MonoGridSource<T> | T[] | null): void;
1607
+ /** Subscribe to state changes; returns an unsubscribe function. */
1608
+ subscribe(cb: () => void): () => void;
1609
+ /** Detach listeners and clear subscribers. */
1610
+ dispose(): void;
1611
+ /** Row key of the row currently in edit mode, or `null`. */
1612
+ editingKey: string | null;
1613
+ /**
1614
+ * Optional sink for inline edits. `commitCell` invokes this with the change so
1615
+ * the consumer can update its own full data array and call `setData`. Assign
1616
+ * after creating the controller (`table.onCellChange = …`).
1617
+ */
1618
+ onCellChange: ((change: MonoCellChange<T>) => void) | null;
1619
+ /**
1620
+ * How a row click opens its inline editor — `'click'` (default) or
1621
+ * `'double-click'`. Set it via `monoDataGrid(data, { editableTrigger })`, or
1622
+ * per table by putting `editable-trigger` on a `<mono-table-th>` (a th only
1623
+ * writes when its own prop is set).
1624
+ */
1625
+ editableTrigger: MonoEditableTrigger;
1626
+ /**
1627
+ * How the keyboard moves between inline editors — `'tab-arrows'` (default) or
1628
+ * `'native'`. Set it via `monoDataGrid(data, { editorNavKeys })`.
1629
+ */
1630
+ editorNavKeys: MonoEditorNavKeys;
1631
+ /**
1632
+ * Move the inline editor one cell in `dir` and focus it, scrolling it into
1633
+ * view. Returns `false` when the move is blocked by an edge (and nothing
1634
+ * moved) — the arrow directions never wrap. Normally driven by the keyboard,
1635
+ * but public so a consumer can wire its own buttons.
1636
+ */
1637
+ moveEditor(dir: MonoEditorDirection, fromEl?: EventTarget | null): boolean;
1638
+ /**
1639
+ * Bind the row trigger to the `<table>` holding this grid's rows. Called by
1640
+ * `mono-table-th` on update — idempotent, so the repeated calls from every
1641
+ * header cell collapse to a single listener.
1642
+ */
1643
+ bindRowTrigger(tableEl: HTMLElement | null): void;
1644
+ /** Register/replace a header-cell element — called by `mono-table-th` on connect. */
1645
+ registerColumn(el: MonoColumnEl): void;
1646
+ /** Remove a header-cell element — called on disconnect. */
1647
+ unregisterColumn(el: MonoColumnEl): void;
1648
+ /**
1649
+ * The central column config (from `monoDataGrid(data, { columns })`) as an
1650
+ * iterable handle: `table.columns().get(field)` / `.getAll()`. For the live
1651
+ * registered `<mono-table-th>` list, use {@link registeredColumns}.
1652
+ */
1653
+ columns(): MonoColumnHandle;
1654
+ /**
1655
+ * The central element props (`monoDataGrid({ props })`), merged with `columns`.
1656
+ * A stable object mutated in place — read it after `subscribe`, or drive a
1657
+ * template from the `state` ref. `props().th` is the per-column list you loop
1658
+ * yourself to render the header.
1659
+ */
1660
+ props(): MonoTableProps;
1661
+ /**
1662
+ * Row-detail handle — `table.detail().expandAll()` / `.collapseAll()` /
1663
+ * `.openCount()` / `.getAll()` over every `<mono-table-detail>` bound to this
1664
+ * grid. `collapseAll()` skips the ones marked `stay-open`.
1665
+ */
1666
+ detail(): MonoDetailHandle;
1667
+ /**
1668
+ * Row-selection handle — what `<mono-table-checkbox>` drives and
1669
+ * `table.check().getAll()` reads back. The selection is keyed by
1670
+ * {@link rowKey}, so it survives paging, sorting, searching and filtering;
1671
+ * only `clear()` (or unchecking) empties it.
1672
+ */
1673
+ check(): MonoCheckHandle<T>;
1674
+ /** Register a `<mono-table-detail>` — called by the element on connect. */
1675
+ registerDetail(el: MonoDetailEl): void;
1676
+ /** Remove a `<mono-table-detail>` — called on disconnect. */
1677
+ unregisterDetail(el: MonoDetailEl): void;
1678
+ /** Registered `<mono-table-th>` elements in DOM (visual) order. */
1679
+ registeredColumns(): MonoColumn[];
1680
+ /** Registered columns that declare an `editable` config, in DOM order. */
1681
+ editableColumns(): MonoColumn[];
1682
+ /**
1683
+ * Put a row into edit mode (all its editable cells). Pass the triggering DOM
1684
+ * event (the row click / dblclick) to auto-focus the row's first editor, so a
1685
+ * later click/tab away reliably exits via `editorBlur`.
1686
+ */
1687
+ beginEditRow(rowKey: string, event?: Event): void;
1688
+ /** Leave edit mode. */
1689
+ cancelEdit(): void;
1690
+ /** Whether `rowKey` is the row currently being edited. */
1691
+ isEditingRow(rowKey: string): boolean;
1692
+ /** Whether `rowKey`'s `field` cell should render an editor right now. */
1693
+ isEditingCell(rowKey: string, field: string): boolean;
1694
+ /** Emit a cell change immediately (funnels to `onCellChange`). */
1695
+ commitCell(rowKey: string, field: string, value: unknown): void;
1696
+ /** Buffer an edit (shown optimistically; not sent). */
1697
+ stageCell(rowKey: string, field: string, value: unknown): void;
1698
+ /** Staged value for a cell, or `fallback` when it isn't staged. */
1699
+ cellValue(rowKey: string, field: string, fallback: unknown): unknown;
1700
+ /** Whether a specific cell has a staged edit. */
1701
+ isCellDirty(rowKey: string, field: string): boolean;
1702
+ /** Whether a row has any staged edit. */
1703
+ isRowDirty(rowKey: string): boolean;
1704
+ /** Number of rows with staged edits. */
1705
+ pendingCount(): number;
1706
+ /** Whether any edit is staged. */
1707
+ hasChanges(): boolean;
1708
+ /** The staged change set — for sending your own (bulk) request. */
1709
+ changes(): Array<MonoStagedChange<T>>;
1710
+ /** Drop all staged edits (reverts the optimistic display). */
1711
+ discardChanges(): void;
1712
+ /**
1713
+ * Flush staged edits to the bound source: a DataSource store `update` (OData
1714
+ * PATCH) per row + `reload()`, an array source per-row `update`, or a `setData`
1715
+ * merge. Keeps the buffer on error so the save is retryable.
1716
+ */
1717
+ saveChanges(): Promise<void>;
1718
+ /**
1719
+ * Keyboard handler an inline editor forwards its `keydown` to. Tab wraps to the
1720
+ * next/previous row's editor at a row boundary; Enter/Escape leave edit mode.
1721
+ * Rows must carry `data-row-key` and editors `data-edit-cell` for focus to move.
1722
+ */
1723
+ editorKeydown(event: KeyboardEvent, rowKey: string, field: string): void;
1724
+ /**
1725
+ * Row-level CRUD staging for **optimistic** updates after your own change API
1726
+ * succeeds — insert/update/delete whole rows without a full reload. Returns a
1727
+ * chainable handle that shares one buffer across calls; `apply()` commits the
1728
+ * staged ops into the rendered data locally (no server call).
1729
+ *
1730
+ * @example
1731
+ * table.form({ key: 'Id' }).edit(1, updatedRow).apply()
1732
+ * table.form().add().apply() // append one auto-shaped empty row
1733
+ */
1734
+ form(config?: MonoFormConfig<T>): MonoFormHandle<T>;
1735
+ /** The live row-level staging buffer (readable) — what `form()` has staged but not yet applied. */
1736
+ pendingData: Array<MonoFormOp<T>>;
1737
+ /**
1738
+ * Stable string key for a row — use it as the `data-row-key` / editing key
1739
+ * (e.g. `const rk = (row) => table.rowKey(row)`). For a `form({ showForm: true })`
1740
+ * row it returns an internal stable id that survives edits to the key field;
1741
+ * otherwise it's `String(row[keyExpr])`.
1742
+ */
1743
+ rowKey(row: T): string;
1746
1744
  }
1747
- /**
1748
- * Create a table controller around a devextreme DataSource.
1749
- *
1750
- * @example
1751
- * const table = monoDataGrid(dataSource, { searchExpr: ['Name', 'Email'] })
1752
- * table.subscribe(() => rows.value = [...table.items]) // Vue mirror
1753
- */
1754
- /** Renamed "control" alias of {@link monoDataGrid} (no breaking change — both work). */
1755
- export { monoDataGrid as controlMonoTable };
1756
1745
  export declare function monoDataGrid<T = any>(ds?: MonoGridSource<T> | T[] | null, opts?: MonoDataGridOptions): MonoTableController<T>;
1746
+ //#endregion
1747
+ export { type MonoDataSourceOptions, type MonoDateLevel, type MonoDateRange, type MonoOdataOptions, type MonoSourceSortEntry, monoDataGrid as controlMonoTable, isDateRange };