@mono-lit/helper 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. package/LICENSE.md +55 -0
  2. package/README.md +34 -2
  3. package/dist/breakpoints-CAbhDUht.js +84 -0
  4. package/dist/checkbox-Cqpie9Ap.js +4 -0
  5. package/dist/chip-DBUUa2eB.js +4 -0
  6. package/dist/chip-limits-BMoO31JM.js +213 -0
  7. package/dist/chip-strip-Cw3gyz0q.js +213 -0
  8. package/dist/color-DHYrfXsX.js +253 -0
  9. package/dist/css-class-BRKRzHx-.js +60 -0
  10. package/dist/css-size-DhHSVZJK.js +37 -0
  11. package/dist/data/theme/presets.json.d.ts +140 -0
  12. package/dist/data-search-Bwo5bg8K.js +573 -0
  13. package/dist/data-source-controller-C50Qyfzh.js +178 -0
  14. package/dist/data-source-options-BTpfrOZ_.js +535 -0
  15. package/dist/data-source-options-CQSTZHPE.js +537 -0
  16. package/dist/data-source-read-CUX-lgrQ.js +216 -0
  17. package/dist/data-source-read-DL88aH8t.js +217 -0
  18. package/dist/decorate-DEXtNagw.js +141 -0
  19. package/dist/element-props-CLB6yvbm.js +114 -0
  20. package/dist/esm-Ptok4SQZ.js +2026 -0
  21. package/dist/excel-CY6zGkcx.js +608 -0
  22. package/dist/excel-DopRbEMK.js +608 -0
  23. package/dist/export-BvlBx_GZ.js +2302 -0
  24. package/dist/export.d.ts +1 -0
  25. package/dist/export.js +2302 -0
  26. package/dist/field-icons-BoOG6KrL.js +51 -0
  27. package/dist/field-path-C92eGLg3.js +251 -0
  28. package/dist/filter-builder-Bke3qOgJ.js +205 -0
  29. package/dist/filter-builder-CE4zE0V5.js +205 -0
  30. package/dist/filter-eval-DIfU2EAn.js +173 -0
  31. package/dist/filter-odata-C1vSGZaY.js +591 -0
  32. package/dist/form-control-core-B8d7k6vk.js +223 -0
  33. package/dist/form-control-core-eeRr0zLU.js +223 -0
  34. package/dist/hydration-flush-RB5Tz5nl.js +1001 -0
  35. package/dist/icon-CJkTlmTb.js +55 -0
  36. package/dist/icon-dVhYJUIH.js +17 -0
  37. package/dist/import-BgJdkwBI.js +606 -0
  38. package/dist/import.d.ts +1 -0
  39. package/dist/import.js +606 -0
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +16 -0
  42. package/dist/index.node-DjvYOL-J.js +395 -0
  43. package/dist/index.node.d.ts +1 -0
  44. package/dist/index.node.js +16 -0
  45. package/dist/input-zGOULADt.js +4 -0
  46. package/dist/layout-var-CZnzMC0s.js +73 -0
  47. package/dist/light-slots-BVJwyg_2.js +244 -0
  48. package/dist/light-slots-DW1WgfgT.js +254 -0
  49. package/dist/markdown-DfqrfOJN.js +20146 -0
  50. package/dist/mono-button-CoVnBLav.js +873 -0
  51. package/dist/mono-button.shadow-FfP_hMH4.js +784 -0
  52. package/dist/mono-data-chart-ChU4Ii3p.js +738 -0
  53. package/dist/mono-data-dropdown-BAUl58kW.js +357 -0
  54. package/dist/mono-data-grid-CLBK8clE.js +4140 -0
  55. package/dist/mono-data-grid-Db80FzdZ.js +4142 -0
  56. package/dist/mono-element-B0kP_96P.js +232 -0
  57. package/dist/mono-event-Bi1qP9uN.js +129 -0
  58. package/dist/mono-form-controller-5PfsU4qa.js +409 -0
  59. package/dist/mono-modal-controller-BMO3n3rP.js +223 -0
  60. package/dist/mono-ui-CPV7rrdo.js +358 -0
  61. package/dist/notifier-CE4yxMUQ.js +88 -0
  62. package/dist/nuxt.d.ts +1 -0
  63. package/dist/nuxt.js +130 -0
  64. package/dist/popup-portal-BziRX1yG.js +465 -0
  65. package/dist/popup-stack-CEEMib__.js +189 -0
  66. package/dist/rate-limit-BBa2PO79.js +521 -0
  67. package/dist/reactive-BHsqVjRh.js +789 -0
  68. package/dist/reactive-D3EERqgO.js +47 -0
  69. package/dist/search.d.ts +1 -0
  70. package/dist/search.js +97 -0
  71. package/dist/src/components/accordion/accordion-core.d.ts +62 -0
  72. package/dist/src/components/accordion/accordion-types.d.ts +62 -0
  73. package/dist/src/components/accordion/index.d.ts +3 -0
  74. package/dist/src/components/accordion/index.shadow.d.ts +5 -0
  75. package/dist/src/components/accordion/mono-accordion.d.ts +55 -0
  76. package/dist/src/components/accordion/mono-accordion.shadow.d.ts +56 -0
  77. package/dist/src/components/alert/alert-core.d.ts +46 -0
  78. package/dist/src/components/alert/alert-types.d.ts +44 -0
  79. package/dist/src/components/alert/index.d.ts +3 -0
  80. package/dist/src/components/alert/index.shadow.d.ts +5 -0
  81. package/dist/src/components/alert/mono-alert.d.ts +44 -0
  82. package/dist/src/components/alert/mono-alert.shadow.d.ts +34 -0
  83. package/dist/src/components/breadcrumb/breadcrumb-core.d.ts +61 -0
  84. package/dist/src/components/breadcrumb/breadcrumb-list-core.d.ts +49 -0
  85. package/dist/src/components/breadcrumb/breadcrumb-render.d.ts +31 -0
  86. package/dist/src/components/breadcrumb/breadcrumb-types.d.ts +117 -0
  87. package/dist/src/components/breadcrumb/breadcrumb-utils.d.ts +43 -0
  88. package/dist/src/components/breadcrumb/index.d.ts +6 -0
  89. package/dist/src/components/breadcrumb/index.shadow.d.ts +8 -0
  90. package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +29 -0
  91. package/dist/src/components/breadcrumb/mono-breadcrumb-list.shadow.d.ts +48 -0
  92. package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +38 -0
  93. package/dist/src/components/breadcrumb/mono-breadcrumb.shadow.d.ts +73 -0
  94. package/dist/src/components/button/button-core.d.ts +90 -0
  95. package/dist/src/components/button/button-dropdown-core.d.ts +57 -0
  96. package/dist/src/components/button/button-dropdown-types.d.ts +129 -0
  97. package/dist/src/components/button/button-types.d.ts +219 -0
  98. package/dist/src/components/button/button-utils.d.ts +18 -0
  99. package/dist/src/components/button/index.button-dropdown.d.ts +4 -0
  100. package/dist/src/components/button/index.button-dropdown.shadow.d.ts +4 -0
  101. package/dist/src/components/button/index.d.ts +8 -0
  102. package/dist/src/components/button/index.shadow.d.ts +5 -0
  103. package/dist/src/components/button/mono-button-dropdown.d.ts +35 -0
  104. package/dist/src/components/button/mono-button-dropdown.shadow.d.ts +45 -0
  105. package/dist/src/components/button/mono-button.d.ts +123 -0
  106. package/dist/src/components/button/mono-button.shadow.d.ts +56 -0
  107. package/dist/src/components/card/card-core.d.ts +74 -0
  108. package/dist/src/components/card/card-types.d.ts +137 -0
  109. package/dist/src/components/card/card-utils.d.ts +23 -0
  110. package/dist/src/components/card/index.d.ts +4 -0
  111. package/dist/src/components/card/index.shadow.d.ts +6 -0
  112. package/dist/src/components/card/mono-card.d.ts +56 -0
  113. package/dist/src/components/card/mono-card.shadow.d.ts +52 -0
  114. package/dist/src/components/chart/chart-core.d.ts +43 -0
  115. package/dist/src/components/chart/chart-odata.d.ts +52 -0
  116. package/dist/src/components/chart/chart-types.d.ts +337 -0
  117. package/dist/src/components/chart/index.d.ts +8 -0
  118. package/dist/src/components/chart/index.shadow.d.ts +7 -0
  119. package/dist/src/components/chart/mono-chart-presets.d.ts +43 -0
  120. package/dist/src/components/chart/mono-chart-presets.shadow.d.ts +43 -0
  121. package/dist/src/components/chart/mono-chart.d.ts +30 -0
  122. package/dist/src/components/chart/mono-chart.shadow.d.ts +22 -0
  123. package/dist/src/components/chart/mono-data-chart.d.ts +27 -0
  124. package/dist/src/components/checkbox/checkbox-core.d.ts +53 -0
  125. package/dist/src/components/checkbox/checkbox-types.d.ts +69 -0
  126. package/dist/src/components/checkbox/checkbox-utils.d.ts +35 -0
  127. package/dist/src/components/checkbox/index.d.ts +4 -0
  128. package/dist/src/components/checkbox/index.shadow.d.ts +5 -0
  129. package/dist/src/components/checkbox/mono-checkbox.d.ts +34 -0
  130. package/dist/src/components/checkbox/mono-checkbox.shadow.d.ts +45 -0
  131. package/dist/src/components/chip/chip-core.d.ts +58 -0
  132. package/dist/src/components/chip/chip-types.d.ts +142 -0
  133. package/dist/src/components/chip/chip-utils.d.ts +24 -0
  134. package/dist/src/components/chip/index.d.ts +8 -0
  135. package/dist/src/components/chip/index.shadow.d.ts +6 -0
  136. package/dist/src/components/chip/mono-chip.d.ts +48 -0
  137. package/dist/src/components/chip/mono-chip.shadow.d.ts +33 -0
  138. package/dist/src/components/chip/mono-status-dot.d.ts +34 -0
  139. package/dist/src/components/date/date-core.d.ts +80 -0
  140. package/dist/src/components/date/date-types.d.ts +163 -0
  141. package/dist/src/components/date/index.d.ts +3 -0
  142. package/dist/src/components/date/index.shadow.d.ts +4 -0
  143. package/dist/src/components/date/mono-date.d.ts +22 -0
  144. package/dist/src/components/date/mono-date.shadow.d.ts +31 -0
  145. package/dist/src/components/drawer/drawer-core.d.ts +99 -0
  146. package/dist/src/components/drawer/drawer-types.d.ts +153 -0
  147. package/dist/src/components/drawer/index.d.ts +3 -0
  148. package/dist/src/components/drawer/index.shadow.d.ts +4 -0
  149. package/dist/src/components/drawer/mono-drawer.d.ts +45 -0
  150. package/dist/src/components/drawer/mono-drawer.shadow.d.ts +46 -0
  151. package/dist/src/components/dropdown/dropdown-core.d.ts +33 -0
  152. package/dist/src/components/dropdown/dropdown-types.d.ts +88 -0
  153. package/dist/src/components/dropdown/index.d.ts +3 -0
  154. package/dist/src/components/dropdown/index.shadow.d.ts +4 -0
  155. package/dist/src/components/dropdown/mono-dropdown.d.ts +34 -0
  156. package/dist/src/components/dropdown/mono-dropdown.shadow.d.ts +28 -0
  157. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +65 -0
  158. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +278 -0
  159. package/dist/src/components/dropdown-table/index.d.ts +5 -0
  160. package/dist/src/components/dropdown-table/index.shadow.d.ts +6 -0
  161. package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +152 -0
  162. package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +46 -0
  163. package/dist/src/components/dropdown-table/mono-dropdown-table.shadow.d.ts +22 -0
  164. package/dist/src/components/file-upload/file-upload-core.d.ts +60 -0
  165. package/dist/src/components/file-upload/file-upload-types.d.ts +145 -0
  166. package/dist/src/components/file-upload/file-upload-utils.d.ts +16 -0
  167. package/dist/src/components/file-upload/index.d.ts +4 -0
  168. package/dist/src/components/file-upload/index.shadow.d.ts +5 -0
  169. package/dist/src/components/file-upload/mono-file-upload.d.ts +33 -0
  170. package/dist/src/components/file-upload/mono-file-upload.shadow.d.ts +50 -0
  171. package/dist/src/components/filter/filter-builder-core.d.ts +36 -0
  172. package/dist/src/components/filter/filter-builder.d.ts +23 -0
  173. package/dist/src/components/filter/filter-odata.d.ts +27 -0
  174. package/dist/src/components/filter/filter-operators.d.ts +13 -0
  175. package/dist/src/components/filter/filter-types.d.ts +253 -0
  176. package/dist/src/components/filter/index.d.ts +6 -0
  177. package/dist/src/components/filter/index.shadow.d.ts +7 -0
  178. package/dist/src/components/filter/mono-filter-builder.d.ts +21 -0
  179. package/dist/src/components/filter/mono-filter-builder.shadow.d.ts +17 -0
  180. package/dist/src/components/form/form-control-core.d.ts +37 -0
  181. package/dist/src/components/form/form-rules.d.ts +25 -0
  182. package/dist/src/components/form/form-types.d.ts +307 -0
  183. package/dist/src/components/form/index.d.ts +6 -0
  184. package/dist/src/components/form/mono-form-controller.d.ts +16 -0
  185. package/dist/src/components/input/index.d.ts +6 -0
  186. package/dist/src/components/input/index.shadow.d.ts +8 -0
  187. package/dist/src/components/input/input-core.d.ts +91 -0
  188. package/dist/src/components/input/input-format.d.ts +118 -0
  189. package/dist/src/components/input/input-types.d.ts +179 -0
  190. package/dist/src/components/input/input-utils.d.ts +10 -0
  191. package/dist/src/components/input/mono-input.d.ts +46 -0
  192. package/dist/src/components/input/mono-input.shadow.d.ts +34 -0
  193. package/dist/src/components/menu/index.d.ts +6 -0
  194. package/dist/src/components/menu/index.shadow.d.ts +7 -0
  195. package/dist/src/components/menu/menu-core.d.ts +65 -0
  196. package/dist/src/components/menu/menu-render.d.ts +55 -0
  197. package/dist/src/components/menu/menu-types.d.ts +195 -0
  198. package/dist/src/components/menu/menu-utils.d.ts +53 -0
  199. package/dist/src/components/menu/mono-menu-list.d.ts +118 -0
  200. package/dist/src/components/menu/mono-menu.d.ts +39 -0
  201. package/dist/src/components/menu/mono-menu.shadow.d.ts +40 -0
  202. package/dist/src/components/modal/index.d.ts +4 -0
  203. package/dist/src/components/modal/index.shadow.d.ts +5 -0
  204. package/dist/src/components/modal/modal-core.d.ts +110 -0
  205. package/dist/src/components/modal/modal-types.d.ts +304 -0
  206. package/dist/src/components/modal/mono-modal-controller.d.ts +4 -0
  207. package/dist/src/components/modal/mono-modal.d.ts +45 -0
  208. package/dist/src/components/modal/mono-modal.shadow.d.ts +50 -0
  209. package/dist/src/components/nav/index.d.ts +4 -0
  210. package/dist/src/components/nav/index.shadow.d.ts +6 -0
  211. package/dist/src/components/nav/mono-nav.d.ts +41 -0
  212. package/dist/src/components/nav/mono-nav.shadow.d.ts +21 -0
  213. package/dist/src/components/nav/nav-core.d.ts +34 -0
  214. package/dist/src/components/nav/nav-types.d.ts +48 -0
  215. package/dist/src/components/nav/nav-utils.d.ts +12 -0
  216. package/dist/src/components/radio/index.d.ts +4 -0
  217. package/dist/src/components/radio/index.shadow.d.ts +5 -0
  218. package/dist/src/components/radio/mono-radio.d.ts +31 -0
  219. package/dist/src/components/radio/mono-radio.shadow.d.ts +35 -0
  220. package/dist/src/components/radio/radio-core.d.ts +45 -0
  221. package/dist/src/components/radio/radio-types.d.ts +58 -0
  222. package/dist/src/components/radio/radio-utils.d.ts +12 -0
  223. package/dist/src/components/rich-text-editor/index.d.ts +5 -0
  224. package/dist/src/components/rich-text-editor/index.shadow.d.ts +6 -0
  225. package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +31 -0
  226. package/dist/src/components/rich-text-editor/mono-rich-text-editor.shadow.d.ts +34 -0
  227. package/dist/src/components/rich-text-editor/rich-text-editor-core.d.ts +100 -0
  228. package/dist/src/components/rich-text-editor/rich-text-editor-loader.d.ts +17 -0
  229. package/dist/src/components/rich-text-editor/rich-text-editor-toolbar.d.ts +65 -0
  230. package/dist/src/components/rich-text-editor/rich-text-editor-types.d.ts +231 -0
  231. package/dist/src/components/select/index.d.ts +4 -0
  232. package/dist/src/components/select/index.shadow.d.ts +5 -0
  233. package/dist/src/components/select/mono-select.d.ts +69 -0
  234. package/dist/src/components/select/mono-select.shadow.d.ts +48 -0
  235. package/dist/src/components/select/select-core.d.ts +98 -0
  236. package/dist/src/components/select/select-types.d.ts +258 -0
  237. package/dist/src/components/select/select-utils.d.ts +7 -0
  238. package/dist/src/components/sidebar/index.d.ts +4 -0
  239. package/dist/src/components/sidebar/index.shadow.d.ts +6 -0
  240. package/dist/src/components/sidebar/mono-sidebar.d.ts +34 -0
  241. package/dist/src/components/sidebar/mono-sidebar.shadow.d.ts +27 -0
  242. package/dist/src/components/sidebar/sidebar-core.d.ts +51 -0
  243. package/dist/src/components/sidebar/sidebar-types.d.ts +119 -0
  244. package/dist/src/components/sidebar/sidebar-utils.d.ts +55 -0
  245. package/dist/src/components/switch/index.d.ts +4 -0
  246. package/dist/src/components/switch/index.shadow.d.ts +5 -0
  247. package/dist/src/components/switch/mono-switch.d.ts +31 -0
  248. package/dist/src/components/switch/mono-switch.shadow.d.ts +36 -0
  249. package/dist/src/components/switch/switch-core.d.ts +49 -0
  250. package/dist/src/components/switch/switch-types.d.ts +64 -0
  251. package/dist/src/components/switch/switch-utils.d.ts +12 -0
  252. package/dist/src/components/table/array-source.d.ts +44 -0
  253. package/dist/src/components/table/date-filter-tree.d.ts +93 -0
  254. package/dist/src/components/table/grouping.d.ts +55 -0
  255. package/dist/src/components/table/index.d.ts +33 -0
  256. package/dist/src/components/table/index.shadow.d.ts +47 -0
  257. package/dist/src/components/table/mono-data-grid.d.ts +1756 -0
  258. package/dist/src/components/table/mono-table-checkbox-core.d.ts +76 -0
  259. package/dist/src/components/table/mono-table-checkbox.d.ts +34 -0
  260. package/dist/src/components/table/mono-table-checkbox.shadow.d.ts +26 -0
  261. package/dist/src/components/table/mono-table-detail-core.d.ts +87 -0
  262. package/dist/src/components/table/mono-table-detail.d.ts +32 -0
  263. package/dist/src/components/table/mono-table-detail.shadow.d.ts +31 -0
  264. package/dist/src/components/table/mono-table-empty-core.d.ts +60 -0
  265. package/dist/src/components/table/mono-table-empty.d.ts +35 -0
  266. package/dist/src/components/table/mono-table-empty.shadow.d.ts +40 -0
  267. package/dist/src/components/table/mono-table-error-core.d.ts +84 -0
  268. package/dist/src/components/table/mono-table-error.d.ts +28 -0
  269. package/dist/src/components/table/mono-table-error.shadow.d.ts +21 -0
  270. package/dist/src/components/table/mono-table-info-core.d.ts +13 -0
  271. package/dist/src/components/table/mono-table-info.d.ts +19 -0
  272. package/dist/src/components/table/mono-table-info.shadow.d.ts +14 -0
  273. package/dist/src/components/table/mono-table-loading-core.d.ts +41 -0
  274. package/dist/src/components/table/mono-table-loading.d.ts +50 -0
  275. package/dist/src/components/table/mono-table-loading.shadow.d.ts +14 -0
  276. package/dist/src/components/table/mono-table-page-size-core.d.ts +14 -0
  277. package/dist/src/components/table/mono-table-page-size.d.ts +16 -0
  278. package/dist/src/components/table/mono-table-page-size.shadow.d.ts +11 -0
  279. package/dist/src/components/table/mono-table-paging-core.d.ts +22 -0
  280. package/dist/src/components/table/mono-table-paging-group-core.d.ts +18 -0
  281. package/dist/src/components/table/mono-table-paging-group.d.ts +20 -0
  282. package/dist/src/components/table/mono-table-paging-group.shadow.d.ts +13 -0
  283. package/dist/src/components/table/mono-table-paging.d.ts +16 -0
  284. package/dist/src/components/table/mono-table-paging.shadow.d.ts +11 -0
  285. package/dist/src/components/table/mono-table-search-core.d.ts +74 -0
  286. package/dist/src/components/table/mono-table-search.d.ts +34 -0
  287. package/dist/src/components/table/mono-table-search.shadow.d.ts +21 -0
  288. package/dist/src/components/table/mono-table-sort-core.d.ts +35 -0
  289. package/dist/src/components/table/mono-table-sort.d.ts +38 -0
  290. package/dist/src/components/table/mono-table-sort.shadow.d.ts +20 -0
  291. package/dist/src/components/table/mono-table-summary-core.d.ts +26 -0
  292. package/dist/src/components/table/mono-table-summary.d.ts +24 -0
  293. package/dist/src/components/table/mono-table-summary.shadow.d.ts +14 -0
  294. package/dist/src/components/table/mono-table-th-core.d.ts +56 -0
  295. package/dist/src/components/table/mono-table-th.d.ts +41 -0
  296. package/dist/src/components/table/mono-table-th.shadow.d.ts +19 -0
  297. package/dist/src/components/table/store-group-source.d.ts +24 -0
  298. package/dist/src/components/table/table-controller-core.d.ts +40 -0
  299. package/dist/src/components/table/table-filter-icons.d.ts +3 -0
  300. package/dist/src/components/table/table-menu-core.d.ts +65 -0
  301. package/dist/src/components/table/table-overlay.d.ts +165 -0
  302. package/dist/src/components/table/table-sort-icons.d.ts +4 -0
  303. package/dist/src/components/table/table-sort-utils.d.ts +20 -0
  304. package/dist/src/components/table/table-types.d.ts +475 -0
  305. package/dist/src/components/tabs/index.d.ts +3 -0
  306. package/dist/src/components/tabs/index.shadow.d.ts +4 -0
  307. package/dist/src/components/tabs/mono-tabs.d.ts +33 -0
  308. package/dist/src/components/tabs/mono-tabs.shadow.d.ts +37 -0
  309. package/dist/src/components/tabs/tabs-core.d.ts +57 -0
  310. package/dist/src/components/tabs/tabs-types.d.ts +65 -0
  311. package/dist/src/components/tag-input/index.d.ts +4 -0
  312. package/dist/src/components/tag-input/index.shadow.d.ts +5 -0
  313. package/dist/src/components/tag-input/mono-tag-input.d.ts +66 -0
  314. package/dist/src/components/tag-input/mono-tag-input.shadow.d.ts +40 -0
  315. package/dist/src/components/tag-input/tag-input-core.d.ts +108 -0
  316. package/dist/src/components/tag-input/tag-input-types.d.ts +394 -0
  317. package/dist/src/components/tag-input/tag-input-utils.d.ts +8 -0
  318. package/dist/src/components/textarea/index.d.ts +4 -0
  319. package/dist/src/components/textarea/index.shadow.d.ts +5 -0
  320. package/dist/src/components/textarea/mono-textarea.d.ts +29 -0
  321. package/dist/src/components/textarea/mono-textarea.shadow.d.ts +31 -0
  322. package/dist/src/components/textarea/textarea-core.d.ts +60 -0
  323. package/dist/src/components/textarea/textarea-types.d.ts +131 -0
  324. package/dist/src/components/textarea/textarea-utils.d.ts +7 -0
  325. package/dist/src/components/tooltip/control-tooltip.d.ts +36 -0
  326. package/dist/src/components/tooltip/index.d.ts +6 -0
  327. package/dist/src/components/tooltip/tooltip-config.d.ts +27 -0
  328. package/dist/src/components/tooltip/tooltip-declarative.d.ts +41 -0
  329. package/dist/src/components/tooltip/tooltip-loader.d.ts +1 -0
  330. package/dist/src/components/tooltip/tooltip-types.d.ts +110 -0
  331. package/dist/src/composables/breakpoints.d.ts +59 -0
  332. package/dist/src/composables/chip-limits.d.ts +48 -0
  333. package/dist/src/composables/chip-strip.d.ts +93 -0
  334. package/dist/src/composables/color.d.ts +103 -0
  335. package/dist/src/composables/css-class.d.ts +27 -0
  336. package/dist/src/composables/css-size.d.ts +40 -0
  337. package/dist/src/composables/data-source-controller.d.ts +84 -0
  338. package/dist/src/composables/element-props.d.ts +46 -0
  339. package/dist/src/composables/field-icons.d.ts +7 -0
  340. package/dist/src/composables/hybird-prop.d.ts +79 -0
  341. package/dist/src/composables/hydration-flush.d.ts +34 -0
  342. package/dist/src/composables/icon.d.ts +17 -0
  343. package/dist/src/composables/layout-var.d.ts +34 -0
  344. package/dist/src/composables/light-slots.d.ts +133 -0
  345. package/dist/src/composables/mdi-glyphs.d.ts +4 -0
  346. package/dist/src/composables/mono-element.d.ts +9 -0
  347. package/dist/src/composables/mono-event.d.ts +55 -0
  348. package/dist/src/composables/mono-pending.d.ts +8 -0
  349. package/dist/src/composables/mono-skeleton.d.ts +193 -0
  350. package/dist/src/composables/mono-ui.d.ts +58 -0
  351. package/dist/src/composables/notifier.d.ts +46 -0
  352. package/dist/src/composables/popup-portal.d.ts +226 -0
  353. package/dist/src/composables/popup-stack.d.ts +70 -0
  354. package/dist/src/composables/rate-limit.d.ts +108 -0
  355. package/dist/src/composables/reactive.d.ts +53 -0
  356. package/dist/src/composables/shadow-css.d.ts +42 -0
  357. package/dist/src/composables/visibility.d.ts +36 -0
  358. package/dist/src/data/theme/index.d.ts +30 -0
  359. package/dist/src/data/theme/presets.d.ts +94 -0
  360. package/dist/src/entries/index.d.ts +2 -0
  361. package/dist/src/entries/index.node.d.ts +42 -0
  362. package/dist/src/entries/search.d.ts +3 -0
  363. package/dist/src/export/detail.d.ts +29 -0
  364. package/dist/src/export/download.d.ts +9 -0
  365. package/dist/src/export/excel/index.d.ts +27 -0
  366. package/dist/src/export/excel/nodes.d.ts +123 -0
  367. package/dist/src/export/expression.d.ts +36 -0
  368. package/dist/src/export/helpers.d.ts +6 -0
  369. package/dist/src/export/index.d.ts +13 -0
  370. package/dist/src/export/markdown.d.ts +52 -0
  371. package/dist/src/export/resolve-data.d.ts +31 -0
  372. package/dist/src/export/sentinel.d.ts +97 -0
  373. package/dist/src/export/sheet-name.d.ts +45 -0
  374. package/dist/src/export/styles.d.ts +33 -0
  375. package/dist/src/export/template.d.ts +10 -0
  376. package/dist/src/export/types.d.ts +259 -0
  377. package/dist/src/import/coerce.d.ts +38 -0
  378. package/dist/src/import/index.d.ts +16 -0
  379. package/dist/src/import/match.d.ts +54 -0
  380. package/dist/src/import/parse.d.ts +15 -0
  381. package/dist/src/import/types.d.ts +153 -0
  382. package/dist/src/nuxt/index.d.ts +94 -0
  383. package/dist/src/search/data-search.d.ts +207 -0
  384. package/dist/src/search/field-path.d.ts +107 -0
  385. package/dist/src/search/filter-eval.d.ts +30 -0
  386. package/dist/src/search/index.d.ts +22 -0
  387. package/dist/src/search/odata-search.d.ts +18 -0
  388. package/dist/src/search/search-expr.d.ts +160 -0
  389. package/dist/src/utils/data-source-apply.d.ts +97 -0
  390. package/dist/src/utils/data-source-options.d.ts +116 -0
  391. package/dist/src/utils/data-source-read.d.ts +85 -0
  392. package/dist/src/utils/data-source-summary.d.ts +55 -0
  393. package/dist/src/utils/normalize-error.d.ts +60 -0
  394. package/dist/src/vite/index.d.ts +48 -0
  395. package/dist/src/vite/mono-client-only.d.ts +35 -0
  396. package/dist/src/vite/mono-ssr-stub.d.ts +20 -0
  397. package/dist/src/vite/shadow-manifest.d.ts +8 -0
  398. package/dist/styles-BIJ31TM4.js +20146 -0
  399. package/dist/tooltip-CysgRgBi.js +760 -0
  400. package/dist/tooltip.d.ts +1 -0
  401. package/dist/tooltip.js +2 -0
  402. package/dist/ui/accordion.d.ts +1 -0
  403. package/dist/ui/accordion.js +466 -0
  404. package/dist/ui/alert.d.ts +1 -0
  405. package/dist/ui/alert.js +221 -0
  406. package/dist/ui/breadcrumb.d.ts +1 -0
  407. package/dist/ui/breadcrumb.js +902 -0
  408. package/dist/ui/button-dropdown.d.ts +1 -0
  409. package/dist/ui/button-dropdown.js +679 -0
  410. package/dist/ui/button.d.ts +1 -0
  411. package/dist/ui/button.js +63 -0
  412. package/dist/ui/card.d.ts +1 -0
  413. package/dist/ui/card.js +511 -0
  414. package/dist/ui/chart.d.ts +1 -0
  415. package/dist/ui/chart.js +808 -0
  416. package/dist/ui/checkbox.d.ts +1 -0
  417. package/dist/ui/checkbox.js +413 -0
  418. package/dist/ui/chip.d.ts +1 -0
  419. package/dist/ui/chip.js +558 -0
  420. package/dist/ui/date.d.ts +1 -0
  421. package/dist/ui/date.js +686 -0
  422. package/dist/ui/drawer.d.ts +1 -0
  423. package/dist/ui/drawer.js +901 -0
  424. package/dist/ui/dropdown-table.d.ts +1 -0
  425. package/dist/ui/dropdown-table.js +1291 -0
  426. package/dist/ui/dropdown.d.ts +1 -0
  427. package/dist/ui/dropdown.js +586 -0
  428. package/dist/ui/file-upload.d.ts +1 -0
  429. package/dist/ui/file-upload.js +688 -0
  430. package/dist/ui/filter.d.ts +1 -0
  431. package/dist/ui/filter.js +400 -0
  432. package/dist/ui/font/files/geist-47c091c9.woff2 +0 -0
  433. package/dist/ui/font/files/geist-8dd77544.woff2 +0 -0
  434. package/dist/ui/font/files/geist-b9248b1e.woff2 +0 -0
  435. package/dist/ui/font/files/geist-d40d74b4.woff2 +0 -0
  436. package/dist/ui/font/files/geist-f493429a.woff2 +0 -0
  437. package/dist/ui/font/files/geistmono-03737868.woff2 +0 -0
  438. package/dist/ui/font/files/geistmono-421a7e38.woff2 +0 -0
  439. package/dist/ui/font/files/geistmono-48ef518d.woff2 +0 -0
  440. package/dist/ui/font/files/geistmono-5df35d39.woff2 +0 -0
  441. package/dist/ui/font/files/geistmono-7de289a4.woff2 +0 -0
  442. package/dist/ui/font/files/geistmono-e976128f.woff2 +0 -0
  443. package/dist/ui/font/files/inter-05cf802c.woff2 +0 -0
  444. package/dist/ui/font/files/inter-2b2f25a4.woff2 +0 -0
  445. package/dist/ui/font/files/inter-467acc7a.woff2 +0 -0
  446. package/dist/ui/font/files/inter-6e85163c.woff2 +0 -0
  447. package/dist/ui/font/files/inter-7048add3.woff2 +0 -0
  448. package/dist/ui/font/files/inter-9be0371e.woff2 +0 -0
  449. package/dist/ui/font/files/inter-a28b7e31.woff2 +0 -0
  450. package/dist/ui/font/files/poppins-054df55a.woff2 +0 -0
  451. package/dist/ui/font/files/poppins-0ee5dc9a.woff2 +0 -0
  452. package/dist/ui/font/files/poppins-0f44cb18.woff2 +0 -0
  453. package/dist/ui/font/files/poppins-0ff0d30c.woff2 +0 -0
  454. package/dist/ui/font/files/poppins-13045147.woff2 +0 -0
  455. package/dist/ui/font/files/poppins-1db57cd9.woff2 +0 -0
  456. package/dist/ui/font/files/poppins-2cf2a902.woff2 +0 -0
  457. package/dist/ui/font/files/poppins-39e7f079.woff2 +0 -0
  458. package/dist/ui/font/files/poppins-9607042d.woff2 +0 -0
  459. package/dist/ui/font/files/poppins-9a88fc1f.woff2 +0 -0
  460. package/dist/ui/font/files/poppins-b8f4f752.woff2 +0 -0
  461. package/dist/ui/font/files/poppins-f5e57db4.woff2 +0 -0
  462. package/dist/ui/font/geist-mono.css +104 -0
  463. package/dist/ui/font/geist.css +168 -0
  464. package/dist/ui/font/inter.css +232 -0
  465. package/dist/ui/font/poppins.css +104 -0
  466. package/dist/ui/form.d.ts +1 -0
  467. package/dist/ui/form.js +3 -0
  468. package/dist/ui/index.css +21826 -0
  469. package/dist/ui/input.d.ts +1 -0
  470. package/dist/ui/input.js +1176 -0
  471. package/dist/ui/menu.d.ts +1 -0
  472. package/dist/ui/menu.js +1289 -0
  473. package/dist/ui/modal.d.ts +1 -0
  474. package/dist/ui/modal.js +995 -0
  475. package/dist/ui/nav.d.ts +1 -0
  476. package/dist/ui/nav.js +295 -0
  477. package/dist/ui/radio.d.ts +1 -0
  478. package/dist/ui/radio.js +379 -0
  479. package/dist/ui/rich-text-editor.d.ts +1 -0
  480. package/dist/ui/rich-text-editor.js +1338 -0
  481. package/dist/ui/select.d.ts +1 -0
  482. package/dist/ui/select.js +2066 -0
  483. package/dist/ui/shadow/accordion.js +442 -0
  484. package/dist/ui/shadow/alert.js +218 -0
  485. package/dist/ui/shadow/breadcrumb.js +919 -0
  486. package/dist/ui/shadow/button-dropdown.js +696 -0
  487. package/dist/ui/shadow/button.js +63 -0
  488. package/dist/ui/shadow/card.js +524 -0
  489. package/dist/ui/shadow/chart.js +1569 -0
  490. package/dist/ui/shadow/checkbox.js +457 -0
  491. package/dist/ui/shadow/chip.js +559 -0
  492. package/dist/ui/shadow/date.js +712 -0
  493. package/dist/ui/shadow/drawer.js +869 -0
  494. package/dist/ui/shadow/dropdown-table.js +1620 -0
  495. package/dist/ui/shadow/dropdown.js +547 -0
  496. package/dist/ui/shadow/file-upload.js +731 -0
  497. package/dist/ui/shadow/filter.js +402 -0
  498. package/dist/ui/shadow/input.js +1150 -0
  499. package/dist/ui/shadow/menu.js +899 -0
  500. package/dist/ui/shadow/modal.js +1193 -0
  501. package/dist/ui/shadow/nav.js +240 -0
  502. package/dist/ui/shadow/radio.js +408 -0
  503. package/dist/ui/shadow/rich-text-editor.js +1344 -0
  504. package/dist/ui/shadow/select.js +2033 -0
  505. package/dist/ui/shadow/sidebar.js +606 -0
  506. package/dist/ui/shadow/switch.js +428 -0
  507. package/dist/ui/shadow/table.js +4755 -0
  508. package/dist/ui/shadow/tabs.js +372 -0
  509. package/dist/ui/shadow/tag-input.js +2846 -0
  510. package/dist/ui/shadow/textarea.js +816 -0
  511. package/dist/ui/sidebar.d.ts +1 -0
  512. package/dist/ui/sidebar.js +659 -0
  513. package/dist/ui/switch.d.ts +1 -0
  514. package/dist/ui/switch.js +398 -0
  515. package/dist/ui/table.d.ts +1 -0
  516. package/dist/ui/table.js +4654 -0
  517. package/dist/ui/tabs.d.ts +1 -0
  518. package/dist/ui/tabs.js +379 -0
  519. package/dist/ui/tag-input.d.ts +1 -0
  520. package/dist/ui/tag-input.js +2819 -0
  521. package/dist/ui/textarea.d.ts +1 -0
  522. package/dist/ui/textarea.js +819 -0
  523. package/dist/ui/theme/legacy.css +293 -0
  524. package/dist/ui/theme/luma.css +743 -0
  525. package/dist/ui/theme/lyra.css +754 -0
  526. package/dist/ui/theme/maia.css +673 -0
  527. package/dist/ui/theme/mira.css +802 -0
  528. package/dist/ui/theme/nova.css +662 -0
  529. package/dist/ui/theme/one.css +699 -0
  530. package/dist/ui/theme/rhea.css +742 -0
  531. package/dist/ui/theme/sera.css +845 -0
  532. package/dist/ui/theme/tokens.css +261 -0
  533. package/dist/ui/theme/vega.css +467 -0
  534. package/dist/vite-C5iUK7so.js +329 -0
  535. package/dist/vite.d.ts +1 -0
  536. package/dist/vite.js +2 -0
  537. package/dist/vue.d.ts +282 -0
  538. package/package.json +411 -3
@@ -0,0 +1,1756 @@
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';
17
+ /**
18
+ * Structural shape of a devextreme DataSource as used by the table controller.
19
+ * Extends the shared {@link MonoDataSource} with the extra methods devextreme
20
+ * exposes for paging / search / filtering. All optional/duck-typed so
21
+ * @mono-lit/helper stays dependency-free; a real devextreme DataSource satisfies it.
22
+ */
23
+ /**
24
+ * The subset of a devextreme store (ODataStore/CustomStore/mock store) the table
25
+ * uses. `load` is required (server-side group paging); the write methods are
26
+ * optional so a read-only store still satisfies the shape. A real devextreme
27
+ * store — and the mono IndexedDB mock — supply the writes at runtime.
28
+ */
29
+ 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;
40
+ }
41
+ 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[];
62
+ }
63
+ /** Sort direction (`null` = unsorted). */
64
+ export type SortOrder = 'asc' | 'desc' | null;
65
+ /** Per-column sort config declared on a `mono-table-th` (`:sort.prop`). */
66
+ /**
67
+ * One key in the grid's active sort. The controller keeps these in **precedence
68
+ * order** (`sorts[0]` is primary), which is the order they reach the source and,
69
+ * for a remote store, the order of the emitted `$orderby`.
70
+ */
71
+ export interface MonoSortEntry {
72
+ field: string;
73
+ order: 'asc' | 'desc';
74
+ }
75
+ /** Per-call mode for {@link MonoTableController.setColumnFilter}. */
76
+ 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;
92
+ }
93
+ /** Per-call mode for {@link MonoTableController.setSort}. */
94
+ 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;
111
+ }
112
+ 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;
151
+ }
152
+ /** Devextreme load options for a header filter's DISTINCT-values request. */
153
+ 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;
165
+ }
166
+ /**
167
+ * Header-filter config for a column. `headerFilter: true` is shorthand for all of
168
+ * these defaults.
169
+ */
170
+ 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;
187
+ }
188
+ /**
189
+ * Date-filter config for a column — the header filter's sibling for date /
190
+ * datetime columns. `dateFilter: true` is shorthand for all of these defaults.
191
+ *
192
+ * The panel is a TREE: years, each expandable to the months, days, hours,
193
+ * minutes and seconds that occur in the data (down to `depth`), with row counts.
194
+ * Ticking a node filters to that whole period; the applied filter is a list of
195
+ * `{ from, to }` ranges (`table.columnFilter(field)`), OR-ed. Exclusive with
196
+ * `headerFilter` on the same column — both set, this one wins with a warning.
197
+ * The values come from the SAME `distinctValues` request the header filter
198
+ * makes (cascade, resolver, `$apply` → scan fallback included): every distinct
199
+ * timestamp in scope, once per open, and the tree is built client-side.
200
+ */
201
+ 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;
219
+ }
220
+ export type { MonoDateLevel, MonoDateRange } from './date-filter-tree';
221
+ export { isDateRange } from './date-filter-tree';
222
+ /**
223
+ * What a `distinctValues` resolver is handed, beside the load options — the
224
+ * grid's base filter in the forms an `$apply` builder needs. Mirrors
225
+ * {@link MonoSummaryResolveContext}, which is the other consumer-built `$apply`.
226
+ */
227
+ 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;
243
+ }
244
+ export type { MonoDataSourceOptions, MonoOdataOptions, MonoSourceSortEntry, } from '../../utils/data-source-options';
245
+ /**
246
+ * One column in `monoDataGrid({ props: { th } })` — everything that column needs,
247
+ * declared once: its `mono-table-th` props, plus the `sort` and `summary` config
248
+ * its `<mono-table-sort field>` / `<mono-table-summary field>` siblings read.
249
+ *
250
+ * The consumer loops this list themselves (`state.th`) — the library never renders
251
+ * the header for you.
252
+ */
253
+ export interface MonoTableColumnProps {
254
+ /** Column field — also the identity every element matches on. Path-aware. */
255
+ field: string;
256
+ 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;
315
+ }
316
+ /**
317
+ * Central props for the `mono-table-*` elements, so each is wired with just
318
+ * `:data-grid.prop="table"`. Keys declared here WIN over the same attribute
319
+ * written on the element (matching `monoForm`'s `setProp`); keys absent here are
320
+ * left entirely to the element.
321
+ *
322
+ * A slot also takes its element's events as `on<Event>` keys — `detail: {
323
+ * onToggle }`, `error: { onReload }` — attached as listeners on EVERY element
324
+ * of that slot bound to this grid, so a row detail's `event.detail.rowKey` says
325
+ * which one fired.
326
+ */
327
+ 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>;
360
+ }
361
+ /**
362
+ * A registered `<mono-table-detail>`, as the controller sees it. Only the two
363
+ * pieces of state `table.detail()` drives are part of the contract.
364
+ */
365
+ 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;
376
+ }
377
+ /** The handle returned by `table.detail()`. */
378
+ 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[];
399
+ }
400
+ /**
401
+ * How a `type="all"` `<mono-table-checkbox>` selects.
402
+ *
403
+ * - `'all'` — drains the SOURCE in `chunk`-sized requests and selects every row
404
+ * the active search/filter matches, including rows never fetched for display.
405
+ * - `'per-page'` — selects the loaded page only. No request.
406
+ */
407
+ export type MonoCheckMode = 'all' | 'per-page';
408
+ /** Shared config for the checkboxes bound to one grid. */
409
+ 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;
432
+ }
433
+ /** The user-facing selection limits, resolved to numbers. */
434
+ export interface MonoCheckLimits {
435
+ max?: number;
436
+ min?: number;
437
+ }
438
+ /** The handle returned by `table.check()`. */
439
+ 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;
493
+ }
494
+ /** A resolved column definition, as read from a registered `mono-table-th`. */
495
+ 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;
511
+ }
512
+ /**
513
+ * One search term. `field` binds it to a single column (a "context"); omit it to
514
+ * search every `searchExpr` column, which is the classic single-box behaviour.
515
+ *
516
+ * Terms group by `field`: **OR within a field, AND across fields** — so two terms
517
+ * on `Nama` widen, while a term on `Code` narrows.
518
+ */
519
+ export interface MonoSearchTerm {
520
+ value: string;
521
+ field?: string;
522
+ }
523
+ /** One distinct value of a column, with its occurrence count — for the header filter list. */
524
+ export interface MonoColumnValue {
525
+ value: unknown;
526
+ count: number;
527
+ }
528
+ /**
529
+ * One entry of the central `columns` config passed to `monoDataGrid(data, { columns })`.
530
+ * Extensible on purpose — only `field` (and optionally `caption`) are used today; add
531
+ * per-column props here later without changing the API. Read via `table.columns()`.
532
+ *
533
+ * Distinct from {@link MonoColumn} (the live props of a registered `<mono-table-th>`,
534
+ * read via `table.registeredColumns()`).
535
+ */
536
+ export interface MonoColumnDef {
537
+ field: string;
538
+ caption?: string;
539
+ [key: string]: unknown;
540
+ }
541
+ /**
542
+ * How a row's inline editor is opened. `'click'` (the default) opens on a single
543
+ * click anywhere in the row; `'double-click'` requires a double-click, leaving
544
+ * single clicks free for row selection or other interactions.
545
+ *
546
+ * Clicks that land on an editor (`[data-edit-cell]`) or on an interactive control
547
+ * (button / link / form field) never open the editor under either setting, so a
548
+ * row's own Edit / Delete buttons keep working.
549
+ */
550
+ export type MonoEditableTrigger = 'click' | 'double-click';
551
+ /**
552
+ * What happens to the PUBLISHED rows when a load fails. `'clear-list'` (default)
553
+ * empties `items` / `totalCount` so the table never shows the previous scope's
554
+ * rows under the error bar; `'keep-list'` leaves them as they were. A failed
555
+ * select-all drain never clears — it is not the row set.
556
+ */
557
+ export type MonoErrorBehaviour = 'clear-list' | 'keep-list';
558
+ /**
559
+ * How the keyboard moves between inline editors — `'tab-arrows'` (default; tap
560
+ * `Tab` for the next column, hold `Tab` + an arrow to move one cell that way) or
561
+ * `'native'` (the browser's own Tab order, the pre-existing behaviour).
562
+ * See {@link MonoDataGridOptions.editorNavKeys}.
563
+ */
564
+ export type MonoEditorNavKeys = 'tab-arrows' | 'native';
565
+ /** A direction for {@link MonoDataGridController.moveEditor}. */
566
+ export type MonoEditorDirection = 'left' | 'right' | 'up' | 'down';
567
+ /** The iterable handle returned by `table.columns()` (mirrors {@link MonoSummaryHandle}). */
568
+ 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[];
573
+ }
574
+ /**
575
+ * A registered header-cell element (`mono-table-th`). Structural so the
576
+ * controller stays free of a Lit/DOM import — the element supplies the live
577
+ * column props plus `compareDocumentPosition` for DOM-order sorting.
578
+ */
579
+ export interface MonoColumnEl extends MonoColumn {
580
+ compareDocumentPosition?(other: Node): number;
581
+ }
582
+ /** Payload emitted by `commitCell` / consumed via `controller.onCellChange`. */
583
+ export interface MonoCellChange<T = any> {
584
+ rowKey: string;
585
+ field: string;
586
+ value: unknown;
587
+ row: T | undefined;
588
+ }
589
+ /** One staged row edit, as returned by `controller.changes()`. */
590
+ 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;
598
+ }
599
+ /** Optional config for {@link MonoTableController.form}. */
600
+ 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;
615
+ }
616
+ /** One staged row op in the {@link MonoTableController.form} buffer. */
617
+ export type MonoFormOp<T = any> = {
618
+ op: 'add';
619
+ rows: T[];
620
+ } | {
621
+ op: 'edit';
622
+ key: unknown;
623
+ row: Partial<T>;
624
+ } | {
625
+ op: 'delete';
626
+ key: unknown;
627
+ };
628
+ /** One entry for a devextreme store `push()` batch. */
629
+ export interface MonoStorePush {
630
+ type: 'insert' | 'update' | 'remove';
631
+ key?: unknown;
632
+ data?: Record<string, unknown>;
633
+ }
634
+ /**
635
+ * Chainable handle for optimistic, row-level CRUD staging. `add`/`edit`/`delete`
636
+ * buffer ops; `apply()` commits them into the rendered data **locally** — it does
637
+ * NOT call the server (the caller already ran their change API). Works for both an
638
+ * array source and a remote DataSource. Repeated `form()` calls share one buffer.
639
+ */
640
+ 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>;
684
+ }
685
+ /** Column aggregate kinds supported by {@link MonoTableController.summary}. */
686
+ export type MonoSummaryType = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'countDistinct';
687
+ /**
688
+ * One column-summary spec. Declared centrally (see {@link MonoSummaryConfig} or
689
+ * the array form); a `<mono-table-summary>` footer cell, `table.summary(field)`,
690
+ * or `table.summary().getAll()` then reads the result.
691
+ */
692
+ 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;
714
+ }
715
+ /** A per-field summary spec — {@link MonoSummarySpec} minus `field` (the key supplies it). */
716
+ export type MonoSummaryFieldSpec = Omit<MonoSummarySpec, 'field'>;
717
+ /** When the aggregates are recomputed. */
718
+ 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;
730
+ }
731
+ /**
732
+ * Object form of the `summary` option — keyed by field, with recompute controls.
733
+ *
734
+ * @example
735
+ * monoDataGrid(data, {
736
+ * summary: {
737
+ * recalculate: { searching: false, changedData: true },
738
+ * fields: {
739
+ * Price: { type: 'sum', prefix: '$', precision: 2 },
740
+ * Qty: [{ type: 'sum' }, { type: 'avg', name: 'average', precision: 1 }],
741
+ * },
742
+ * },
743
+ * })
744
+ */
745
+ 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;
784
+ }
785
+ /**
786
+ * What a {@link MonoSummaryResolver} is handed — everything needed to ask a
787
+ * server for the totals, with the OData clause already built.
788
+ */
789
+ 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;
807
+ }
808
+ /**
809
+ * Compute the registered summaries somewhere other than the browser.
810
+ *
811
+ * Return one value per spec — positionally, or keyed by {@link
812
+ * MonoSummaryResolveContext.aliases} (or plain field name) — and the grid uses
813
+ * them as-is. Return `null` to decline, and it drains and aggregates locally
814
+ * exactly as it would without a resolver, so declining is always safe: a
815
+ * resolver that cannot answer for this source, or whose request failed, should
816
+ * return `null` rather than guess.
817
+ *
818
+ * THROWING also falls back, and is reported once; prefer `null` for the
819
+ * expected cases so a real fault stays visible.
820
+ */
821
+ export type MonoSummaryResolver = (ctx: MonoSummaryResolveContext) => Promise<(number | null)[] | Record<string, number | null> | null> | (number | null)[] | Record<string, number | null> | null;
822
+ /** A computed summary — what `table.summary().get/getAll` return, for rendering anywhere. */
823
+ 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;
831
+ }
832
+ /** The iterable handle returned by `table.summary()` (no args). */
833
+ 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[];
838
+ }
839
+ 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;
1105
+ }
1106
+ /** A top-level group's metadata, returned by {@link MonoServerGroupSource.loadGroups}. */
1107
+ 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>;
1114
+ }
1115
+ /** Shared search/sort context passed to a {@link MonoServerGroupSource}. */
1116
+ 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>;
1136
+ }
1137
+ /**
1138
+ * Consumer-supplied data access for server-side group paging. The controller
1139
+ * calls these; @mono-lit/helper never imports a fetcher, so any backend works.
1140
+ */
1141
+ 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[]>;
1149
+ }
1150
+ /**
1151
+ * A flattened, ready-to-render row for the table body — read `controller.displayRows`
1152
+ * and `v-for` over it (use `key` for the row key). Removes the need to walk the
1153
+ * group tree, test `isGroupNode`, or build keys in the consumer.
1154
+ */
1155
+ 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;
1171
+ }
1172
+ /** Per-group row paging snapshot, returned by {@link MonoTableController.groupPageInfo}. */
1173
+ 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;
1182
+ }
1183
+ /**
1184
+ * Simplified, framework-agnostic view over a devextreme DataSource. Keeps its
1185
+ * own snapshot of `items / loading / totalCount / pageIndex / pageSize /
1186
+ * pageCount`, stays in sync from the source's `changed` / `loadingChanged`
1187
+ * events, and notifies subscribers so any UI (Lit components, a Vue ref, …)
1188
+ * can re-render.
1189
+ */
1190
+ /**
1191
+ * A controller operation that failed.
1192
+ *
1193
+ * `raw` is kept alongside the message because the message is a best-effort read
1194
+ * of something the store chose the shape of — a consumer logging to Sentry wants
1195
+ * the original, not a rendering of it.
1196
+ */
1197
+ 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;
1218
+ }
1219
+ 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;
1746
+ }
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
+ export declare function monoDataGrid<T = any>(ds?: MonoGridSource<T> | T[] | null, opts?: MonoDataGridOptions): MonoTableController<T>;