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