@mono-lit/helper 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +55 -0
- package/README.md +34 -2
- package/dist/breakpoints-CAbhDUht.js +84 -0
- package/dist/checkbox-Cqpie9Ap.js +4 -0
- package/dist/chip-DBUUa2eB.js +4 -0
- package/dist/chip-limits-BMoO31JM.js +213 -0
- package/dist/chip-strip-Cw3gyz0q.js +213 -0
- package/dist/color-DHYrfXsX.js +253 -0
- package/dist/css-class-BRKRzHx-.js +60 -0
- package/dist/css-size-DhHSVZJK.js +37 -0
- package/dist/data/theme/presets.json.d.ts +140 -0
- package/dist/data-search-Bwo5bg8K.js +573 -0
- package/dist/data-source-controller-C50Qyfzh.js +178 -0
- package/dist/data-source-options-BTpfrOZ_.js +535 -0
- package/dist/data-source-options-CQSTZHPE.js +537 -0
- package/dist/data-source-read-CUX-lgrQ.js +216 -0
- package/dist/data-source-read-DL88aH8t.js +217 -0
- package/dist/decorate-DEXtNagw.js +141 -0
- package/dist/element-props-CLB6yvbm.js +114 -0
- package/dist/esm-Ptok4SQZ.js +2026 -0
- package/dist/excel-CY6zGkcx.js +608 -0
- package/dist/excel-DopRbEMK.js +608 -0
- package/dist/export-BvlBx_GZ.js +2302 -0
- package/dist/export.d.ts +1 -0
- package/dist/export.js +2302 -0
- package/dist/field-icons-BoOG6KrL.js +51 -0
- package/dist/field-path-C92eGLg3.js +251 -0
- package/dist/filter-builder-Bke3qOgJ.js +205 -0
- package/dist/filter-builder-CE4zE0V5.js +205 -0
- package/dist/filter-eval-DIfU2EAn.js +173 -0
- package/dist/filter-odata-C1vSGZaY.js +591 -0
- package/dist/form-control-core-B8d7k6vk.js +223 -0
- package/dist/form-control-core-eeRr0zLU.js +223 -0
- package/dist/hydration-flush-RB5Tz5nl.js +1001 -0
- package/dist/icon-CJkTlmTb.js +55 -0
- package/dist/icon-dVhYJUIH.js +17 -0
- package/dist/import-BgJdkwBI.js +606 -0
- package/dist/import.d.ts +1 -0
- package/dist/import.js +606 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -0
- package/dist/index.node-DjvYOL-J.js +395 -0
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +16 -0
- package/dist/input-zGOULADt.js +4 -0
- package/dist/layout-var-CZnzMC0s.js +73 -0
- package/dist/light-slots-BVJwyg_2.js +244 -0
- package/dist/light-slots-DW1WgfgT.js +254 -0
- package/dist/markdown-DfqrfOJN.js +20146 -0
- package/dist/mono-button-CoVnBLav.js +873 -0
- package/dist/mono-button.shadow-FfP_hMH4.js +784 -0
- package/dist/mono-data-chart-ChU4Ii3p.js +738 -0
- package/dist/mono-data-dropdown-BAUl58kW.js +357 -0
- package/dist/mono-data-grid-CLBK8clE.js +4140 -0
- package/dist/mono-data-grid-Db80FzdZ.js +4142 -0
- package/dist/mono-element-B0kP_96P.js +232 -0
- package/dist/mono-event-Bi1qP9uN.js +129 -0
- package/dist/mono-form-controller-5PfsU4qa.js +409 -0
- package/dist/mono-modal-controller-BMO3n3rP.js +223 -0
- package/dist/mono-ui-CPV7rrdo.js +358 -0
- package/dist/notifier-CE4yxMUQ.js +88 -0
- package/dist/nuxt.d.ts +1 -0
- package/dist/nuxt.js +130 -0
- package/dist/popup-portal-BziRX1yG.js +465 -0
- package/dist/popup-stack-CEEMib__.js +189 -0
- package/dist/rate-limit-BBa2PO79.js +521 -0
- package/dist/reactive-BHsqVjRh.js +789 -0
- package/dist/reactive-D3EERqgO.js +47 -0
- package/dist/search.d.ts +1 -0
- package/dist/search.js +97 -0
- package/dist/src/components/accordion/accordion-core.d.ts +62 -0
- package/dist/src/components/accordion/accordion-types.d.ts +62 -0
- package/dist/src/components/accordion/index.d.ts +3 -0
- package/dist/src/components/accordion/index.shadow.d.ts +5 -0
- package/dist/src/components/accordion/mono-accordion.d.ts +55 -0
- package/dist/src/components/accordion/mono-accordion.shadow.d.ts +56 -0
- package/dist/src/components/alert/alert-core.d.ts +46 -0
- package/dist/src/components/alert/alert-types.d.ts +44 -0
- package/dist/src/components/alert/index.d.ts +3 -0
- package/dist/src/components/alert/index.shadow.d.ts +5 -0
- package/dist/src/components/alert/mono-alert.d.ts +44 -0
- package/dist/src/components/alert/mono-alert.shadow.d.ts +34 -0
- package/dist/src/components/breadcrumb/breadcrumb-core.d.ts +61 -0
- package/dist/src/components/breadcrumb/breadcrumb-list-core.d.ts +49 -0
- package/dist/src/components/breadcrumb/breadcrumb-render.d.ts +31 -0
- package/dist/src/components/breadcrumb/breadcrumb-types.d.ts +117 -0
- package/dist/src/components/breadcrumb/breadcrumb-utils.d.ts +43 -0
- package/dist/src/components/breadcrumb/index.d.ts +6 -0
- package/dist/src/components/breadcrumb/index.shadow.d.ts +8 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +29 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb-list.shadow.d.ts +48 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +38 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb.shadow.d.ts +73 -0
- package/dist/src/components/button/button-core.d.ts +90 -0
- package/dist/src/components/button/button-dropdown-core.d.ts +57 -0
- package/dist/src/components/button/button-dropdown-types.d.ts +129 -0
- package/dist/src/components/button/button-types.d.ts +219 -0
- package/dist/src/components/button/button-utils.d.ts +18 -0
- package/dist/src/components/button/index.button-dropdown.d.ts +4 -0
- package/dist/src/components/button/index.button-dropdown.shadow.d.ts +4 -0
- package/dist/src/components/button/index.d.ts +8 -0
- package/dist/src/components/button/index.shadow.d.ts +5 -0
- package/dist/src/components/button/mono-button-dropdown.d.ts +35 -0
- package/dist/src/components/button/mono-button-dropdown.shadow.d.ts +45 -0
- package/dist/src/components/button/mono-button.d.ts +123 -0
- package/dist/src/components/button/mono-button.shadow.d.ts +56 -0
- package/dist/src/components/card/card-core.d.ts +74 -0
- package/dist/src/components/card/card-types.d.ts +137 -0
- package/dist/src/components/card/card-utils.d.ts +23 -0
- package/dist/src/components/card/index.d.ts +4 -0
- package/dist/src/components/card/index.shadow.d.ts +6 -0
- package/dist/src/components/card/mono-card.d.ts +56 -0
- package/dist/src/components/card/mono-card.shadow.d.ts +52 -0
- package/dist/src/components/chart/chart-core.d.ts +43 -0
- package/dist/src/components/chart/chart-odata.d.ts +52 -0
- package/dist/src/components/chart/chart-types.d.ts +337 -0
- package/dist/src/components/chart/index.d.ts +8 -0
- package/dist/src/components/chart/index.shadow.d.ts +7 -0
- package/dist/src/components/chart/mono-chart-presets.d.ts +43 -0
- package/dist/src/components/chart/mono-chart-presets.shadow.d.ts +43 -0
- package/dist/src/components/chart/mono-chart.d.ts +30 -0
- package/dist/src/components/chart/mono-chart.shadow.d.ts +22 -0
- package/dist/src/components/chart/mono-data-chart.d.ts +27 -0
- package/dist/src/components/checkbox/checkbox-core.d.ts +53 -0
- package/dist/src/components/checkbox/checkbox-types.d.ts +69 -0
- package/dist/src/components/checkbox/checkbox-utils.d.ts +35 -0
- package/dist/src/components/checkbox/index.d.ts +4 -0
- package/dist/src/components/checkbox/index.shadow.d.ts +5 -0
- package/dist/src/components/checkbox/mono-checkbox.d.ts +34 -0
- package/dist/src/components/checkbox/mono-checkbox.shadow.d.ts +45 -0
- package/dist/src/components/chip/chip-core.d.ts +58 -0
- package/dist/src/components/chip/chip-types.d.ts +142 -0
- package/dist/src/components/chip/chip-utils.d.ts +24 -0
- package/dist/src/components/chip/index.d.ts +8 -0
- package/dist/src/components/chip/index.shadow.d.ts +6 -0
- package/dist/src/components/chip/mono-chip.d.ts +48 -0
- package/dist/src/components/chip/mono-chip.shadow.d.ts +33 -0
- package/dist/src/components/chip/mono-status-dot.d.ts +34 -0
- package/dist/src/components/date/date-core.d.ts +80 -0
- package/dist/src/components/date/date-types.d.ts +163 -0
- package/dist/src/components/date/index.d.ts +3 -0
- package/dist/src/components/date/index.shadow.d.ts +4 -0
- package/dist/src/components/date/mono-date.d.ts +22 -0
- package/dist/src/components/date/mono-date.shadow.d.ts +31 -0
- package/dist/src/components/drawer/drawer-core.d.ts +99 -0
- package/dist/src/components/drawer/drawer-types.d.ts +153 -0
- package/dist/src/components/drawer/index.d.ts +3 -0
- package/dist/src/components/drawer/index.shadow.d.ts +4 -0
- package/dist/src/components/drawer/mono-drawer.d.ts +45 -0
- package/dist/src/components/drawer/mono-drawer.shadow.d.ts +46 -0
- package/dist/src/components/dropdown/dropdown-core.d.ts +33 -0
- package/dist/src/components/dropdown/dropdown-types.d.ts +88 -0
- package/dist/src/components/dropdown/index.d.ts +3 -0
- package/dist/src/components/dropdown/index.shadow.d.ts +4 -0
- package/dist/src/components/dropdown/mono-dropdown.d.ts +34 -0
- package/dist/src/components/dropdown/mono-dropdown.shadow.d.ts +28 -0
- package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +65 -0
- package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +278 -0
- package/dist/src/components/dropdown-table/index.d.ts +5 -0
- package/dist/src/components/dropdown-table/index.shadow.d.ts +6 -0
- package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +152 -0
- package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +46 -0
- package/dist/src/components/dropdown-table/mono-dropdown-table.shadow.d.ts +22 -0
- package/dist/src/components/file-upload/file-upload-core.d.ts +60 -0
- package/dist/src/components/file-upload/file-upload-types.d.ts +145 -0
- package/dist/src/components/file-upload/file-upload-utils.d.ts +16 -0
- package/dist/src/components/file-upload/index.d.ts +4 -0
- package/dist/src/components/file-upload/index.shadow.d.ts +5 -0
- package/dist/src/components/file-upload/mono-file-upload.d.ts +33 -0
- package/dist/src/components/file-upload/mono-file-upload.shadow.d.ts +50 -0
- package/dist/src/components/filter/filter-builder-core.d.ts +36 -0
- package/dist/src/components/filter/filter-builder.d.ts +23 -0
- package/dist/src/components/filter/filter-odata.d.ts +27 -0
- package/dist/src/components/filter/filter-operators.d.ts +13 -0
- package/dist/src/components/filter/filter-types.d.ts +253 -0
- package/dist/src/components/filter/index.d.ts +6 -0
- package/dist/src/components/filter/index.shadow.d.ts +7 -0
- package/dist/src/components/filter/mono-filter-builder.d.ts +21 -0
- package/dist/src/components/filter/mono-filter-builder.shadow.d.ts +17 -0
- package/dist/src/components/form/form-control-core.d.ts +37 -0
- package/dist/src/components/form/form-rules.d.ts +25 -0
- package/dist/src/components/form/form-types.d.ts +307 -0
- package/dist/src/components/form/index.d.ts +6 -0
- package/dist/src/components/form/mono-form-controller.d.ts +16 -0
- package/dist/src/components/input/index.d.ts +6 -0
- package/dist/src/components/input/index.shadow.d.ts +8 -0
- package/dist/src/components/input/input-core.d.ts +91 -0
- package/dist/src/components/input/input-format.d.ts +118 -0
- package/dist/src/components/input/input-types.d.ts +179 -0
- package/dist/src/components/input/input-utils.d.ts +10 -0
- package/dist/src/components/input/mono-input.d.ts +46 -0
- package/dist/src/components/input/mono-input.shadow.d.ts +34 -0
- package/dist/src/components/menu/index.d.ts +6 -0
- package/dist/src/components/menu/index.shadow.d.ts +7 -0
- package/dist/src/components/menu/menu-core.d.ts +65 -0
- package/dist/src/components/menu/menu-render.d.ts +55 -0
- package/dist/src/components/menu/menu-types.d.ts +195 -0
- package/dist/src/components/menu/menu-utils.d.ts +53 -0
- package/dist/src/components/menu/mono-menu-list.d.ts +118 -0
- package/dist/src/components/menu/mono-menu.d.ts +39 -0
- package/dist/src/components/menu/mono-menu.shadow.d.ts +40 -0
- package/dist/src/components/modal/index.d.ts +4 -0
- package/dist/src/components/modal/index.shadow.d.ts +5 -0
- package/dist/src/components/modal/modal-core.d.ts +110 -0
- package/dist/src/components/modal/modal-types.d.ts +304 -0
- package/dist/src/components/modal/mono-modal-controller.d.ts +4 -0
- package/dist/src/components/modal/mono-modal.d.ts +45 -0
- package/dist/src/components/modal/mono-modal.shadow.d.ts +50 -0
- package/dist/src/components/nav/index.d.ts +4 -0
- package/dist/src/components/nav/index.shadow.d.ts +6 -0
- package/dist/src/components/nav/mono-nav.d.ts +41 -0
- package/dist/src/components/nav/mono-nav.shadow.d.ts +21 -0
- package/dist/src/components/nav/nav-core.d.ts +34 -0
- package/dist/src/components/nav/nav-types.d.ts +48 -0
- package/dist/src/components/nav/nav-utils.d.ts +12 -0
- package/dist/src/components/radio/index.d.ts +4 -0
- package/dist/src/components/radio/index.shadow.d.ts +5 -0
- package/dist/src/components/radio/mono-radio.d.ts +31 -0
- package/dist/src/components/radio/mono-radio.shadow.d.ts +35 -0
- package/dist/src/components/radio/radio-core.d.ts +45 -0
- package/dist/src/components/radio/radio-types.d.ts +58 -0
- package/dist/src/components/radio/radio-utils.d.ts +12 -0
- package/dist/src/components/rich-text-editor/index.d.ts +5 -0
- package/dist/src/components/rich-text-editor/index.shadow.d.ts +6 -0
- package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +31 -0
- package/dist/src/components/rich-text-editor/mono-rich-text-editor.shadow.d.ts +34 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-core.d.ts +100 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-loader.d.ts +17 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-toolbar.d.ts +65 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-types.d.ts +231 -0
- package/dist/src/components/select/index.d.ts +4 -0
- package/dist/src/components/select/index.shadow.d.ts +5 -0
- package/dist/src/components/select/mono-select.d.ts +69 -0
- package/dist/src/components/select/mono-select.shadow.d.ts +48 -0
- package/dist/src/components/select/select-core.d.ts +98 -0
- package/dist/src/components/select/select-types.d.ts +258 -0
- package/dist/src/components/select/select-utils.d.ts +7 -0
- package/dist/src/components/sidebar/index.d.ts +4 -0
- package/dist/src/components/sidebar/index.shadow.d.ts +6 -0
- package/dist/src/components/sidebar/mono-sidebar.d.ts +34 -0
- package/dist/src/components/sidebar/mono-sidebar.shadow.d.ts +27 -0
- package/dist/src/components/sidebar/sidebar-core.d.ts +51 -0
- package/dist/src/components/sidebar/sidebar-types.d.ts +119 -0
- package/dist/src/components/sidebar/sidebar-utils.d.ts +55 -0
- package/dist/src/components/switch/index.d.ts +4 -0
- package/dist/src/components/switch/index.shadow.d.ts +5 -0
- package/dist/src/components/switch/mono-switch.d.ts +31 -0
- package/dist/src/components/switch/mono-switch.shadow.d.ts +36 -0
- package/dist/src/components/switch/switch-core.d.ts +49 -0
- package/dist/src/components/switch/switch-types.d.ts +64 -0
- package/dist/src/components/switch/switch-utils.d.ts +12 -0
- package/dist/src/components/table/array-source.d.ts +44 -0
- package/dist/src/components/table/date-filter-tree.d.ts +93 -0
- package/dist/src/components/table/grouping.d.ts +55 -0
- package/dist/src/components/table/index.d.ts +33 -0
- package/dist/src/components/table/index.shadow.d.ts +47 -0
- package/dist/src/components/table/mono-data-grid.d.ts +1756 -0
- package/dist/src/components/table/mono-table-checkbox-core.d.ts +76 -0
- package/dist/src/components/table/mono-table-checkbox.d.ts +34 -0
- package/dist/src/components/table/mono-table-checkbox.shadow.d.ts +26 -0
- package/dist/src/components/table/mono-table-detail-core.d.ts +87 -0
- package/dist/src/components/table/mono-table-detail.d.ts +32 -0
- package/dist/src/components/table/mono-table-detail.shadow.d.ts +31 -0
- package/dist/src/components/table/mono-table-empty-core.d.ts +60 -0
- package/dist/src/components/table/mono-table-empty.d.ts +35 -0
- package/dist/src/components/table/mono-table-empty.shadow.d.ts +40 -0
- package/dist/src/components/table/mono-table-error-core.d.ts +84 -0
- package/dist/src/components/table/mono-table-error.d.ts +28 -0
- package/dist/src/components/table/mono-table-error.shadow.d.ts +21 -0
- package/dist/src/components/table/mono-table-info-core.d.ts +13 -0
- package/dist/src/components/table/mono-table-info.d.ts +19 -0
- package/dist/src/components/table/mono-table-info.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-loading-core.d.ts +41 -0
- package/dist/src/components/table/mono-table-loading.d.ts +50 -0
- package/dist/src/components/table/mono-table-loading.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-page-size-core.d.ts +14 -0
- package/dist/src/components/table/mono-table-page-size.d.ts +16 -0
- package/dist/src/components/table/mono-table-page-size.shadow.d.ts +11 -0
- package/dist/src/components/table/mono-table-paging-core.d.ts +22 -0
- package/dist/src/components/table/mono-table-paging-group-core.d.ts +18 -0
- package/dist/src/components/table/mono-table-paging-group.d.ts +20 -0
- package/dist/src/components/table/mono-table-paging-group.shadow.d.ts +13 -0
- package/dist/src/components/table/mono-table-paging.d.ts +16 -0
- package/dist/src/components/table/mono-table-paging.shadow.d.ts +11 -0
- package/dist/src/components/table/mono-table-search-core.d.ts +74 -0
- package/dist/src/components/table/mono-table-search.d.ts +34 -0
- package/dist/src/components/table/mono-table-search.shadow.d.ts +21 -0
- package/dist/src/components/table/mono-table-sort-core.d.ts +35 -0
- package/dist/src/components/table/mono-table-sort.d.ts +38 -0
- package/dist/src/components/table/mono-table-sort.shadow.d.ts +20 -0
- package/dist/src/components/table/mono-table-summary-core.d.ts +26 -0
- package/dist/src/components/table/mono-table-summary.d.ts +24 -0
- package/dist/src/components/table/mono-table-summary.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-th-core.d.ts +56 -0
- package/dist/src/components/table/mono-table-th.d.ts +41 -0
- package/dist/src/components/table/mono-table-th.shadow.d.ts +19 -0
- package/dist/src/components/table/store-group-source.d.ts +24 -0
- package/dist/src/components/table/table-controller-core.d.ts +40 -0
- package/dist/src/components/table/table-filter-icons.d.ts +3 -0
- package/dist/src/components/table/table-menu-core.d.ts +65 -0
- package/dist/src/components/table/table-overlay.d.ts +165 -0
- package/dist/src/components/table/table-sort-icons.d.ts +4 -0
- package/dist/src/components/table/table-sort-utils.d.ts +20 -0
- package/dist/src/components/table/table-types.d.ts +475 -0
- package/dist/src/components/tabs/index.d.ts +3 -0
- package/dist/src/components/tabs/index.shadow.d.ts +4 -0
- package/dist/src/components/tabs/mono-tabs.d.ts +33 -0
- package/dist/src/components/tabs/mono-tabs.shadow.d.ts +37 -0
- package/dist/src/components/tabs/tabs-core.d.ts +57 -0
- package/dist/src/components/tabs/tabs-types.d.ts +65 -0
- package/dist/src/components/tag-input/index.d.ts +4 -0
- package/dist/src/components/tag-input/index.shadow.d.ts +5 -0
- package/dist/src/components/tag-input/mono-tag-input.d.ts +66 -0
- package/dist/src/components/tag-input/mono-tag-input.shadow.d.ts +40 -0
- package/dist/src/components/tag-input/tag-input-core.d.ts +108 -0
- package/dist/src/components/tag-input/tag-input-types.d.ts +394 -0
- package/dist/src/components/tag-input/tag-input-utils.d.ts +8 -0
- package/dist/src/components/textarea/index.d.ts +4 -0
- package/dist/src/components/textarea/index.shadow.d.ts +5 -0
- package/dist/src/components/textarea/mono-textarea.d.ts +29 -0
- package/dist/src/components/textarea/mono-textarea.shadow.d.ts +31 -0
- package/dist/src/components/textarea/textarea-core.d.ts +60 -0
- package/dist/src/components/textarea/textarea-types.d.ts +131 -0
- package/dist/src/components/textarea/textarea-utils.d.ts +7 -0
- package/dist/src/components/tooltip/control-tooltip.d.ts +36 -0
- package/dist/src/components/tooltip/index.d.ts +6 -0
- package/dist/src/components/tooltip/tooltip-config.d.ts +27 -0
- package/dist/src/components/tooltip/tooltip-declarative.d.ts +41 -0
- package/dist/src/components/tooltip/tooltip-loader.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip-types.d.ts +110 -0
- package/dist/src/composables/breakpoints.d.ts +59 -0
- package/dist/src/composables/chip-limits.d.ts +48 -0
- package/dist/src/composables/chip-strip.d.ts +93 -0
- package/dist/src/composables/color.d.ts +103 -0
- package/dist/src/composables/css-class.d.ts +27 -0
- package/dist/src/composables/css-size.d.ts +40 -0
- package/dist/src/composables/data-source-controller.d.ts +84 -0
- package/dist/src/composables/element-props.d.ts +46 -0
- package/dist/src/composables/field-icons.d.ts +7 -0
- package/dist/src/composables/hybird-prop.d.ts +79 -0
- package/dist/src/composables/hydration-flush.d.ts +34 -0
- package/dist/src/composables/icon.d.ts +17 -0
- package/dist/src/composables/layout-var.d.ts +34 -0
- package/dist/src/composables/light-slots.d.ts +133 -0
- package/dist/src/composables/mdi-glyphs.d.ts +4 -0
- package/dist/src/composables/mono-element.d.ts +9 -0
- package/dist/src/composables/mono-event.d.ts +55 -0
- package/dist/src/composables/mono-pending.d.ts +8 -0
- package/dist/src/composables/mono-skeleton.d.ts +193 -0
- package/dist/src/composables/mono-ui.d.ts +58 -0
- package/dist/src/composables/notifier.d.ts +46 -0
- package/dist/src/composables/popup-portal.d.ts +226 -0
- package/dist/src/composables/popup-stack.d.ts +70 -0
- package/dist/src/composables/rate-limit.d.ts +108 -0
- package/dist/src/composables/reactive.d.ts +53 -0
- package/dist/src/composables/shadow-css.d.ts +42 -0
- package/dist/src/composables/visibility.d.ts +36 -0
- package/dist/src/data/theme/index.d.ts +30 -0
- package/dist/src/data/theme/presets.d.ts +94 -0
- package/dist/src/entries/index.d.ts +2 -0
- package/dist/src/entries/index.node.d.ts +42 -0
- package/dist/src/entries/search.d.ts +3 -0
- package/dist/src/export/detail.d.ts +29 -0
- package/dist/src/export/download.d.ts +9 -0
- package/dist/src/export/excel/index.d.ts +27 -0
- package/dist/src/export/excel/nodes.d.ts +123 -0
- package/dist/src/export/expression.d.ts +36 -0
- package/dist/src/export/helpers.d.ts +6 -0
- package/dist/src/export/index.d.ts +13 -0
- package/dist/src/export/markdown.d.ts +52 -0
- package/dist/src/export/resolve-data.d.ts +31 -0
- package/dist/src/export/sentinel.d.ts +97 -0
- package/dist/src/export/sheet-name.d.ts +45 -0
- package/dist/src/export/styles.d.ts +33 -0
- package/dist/src/export/template.d.ts +10 -0
- package/dist/src/export/types.d.ts +259 -0
- package/dist/src/import/coerce.d.ts +38 -0
- package/dist/src/import/index.d.ts +16 -0
- package/dist/src/import/match.d.ts +54 -0
- package/dist/src/import/parse.d.ts +15 -0
- package/dist/src/import/types.d.ts +153 -0
- package/dist/src/nuxt/index.d.ts +94 -0
- package/dist/src/search/data-search.d.ts +207 -0
- package/dist/src/search/field-path.d.ts +107 -0
- package/dist/src/search/filter-eval.d.ts +30 -0
- package/dist/src/search/index.d.ts +22 -0
- package/dist/src/search/odata-search.d.ts +18 -0
- package/dist/src/search/search-expr.d.ts +160 -0
- package/dist/src/utils/data-source-apply.d.ts +97 -0
- package/dist/src/utils/data-source-options.d.ts +116 -0
- package/dist/src/utils/data-source-read.d.ts +85 -0
- package/dist/src/utils/data-source-summary.d.ts +55 -0
- package/dist/src/utils/normalize-error.d.ts +60 -0
- package/dist/src/vite/index.d.ts +48 -0
- package/dist/src/vite/mono-client-only.d.ts +35 -0
- package/dist/src/vite/mono-ssr-stub.d.ts +20 -0
- package/dist/src/vite/shadow-manifest.d.ts +8 -0
- package/dist/styles-BIJ31TM4.js +20146 -0
- package/dist/tooltip-CysgRgBi.js +760 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +2 -0
- package/dist/ui/accordion.d.ts +1 -0
- package/dist/ui/accordion.js +466 -0
- package/dist/ui/alert.d.ts +1 -0
- package/dist/ui/alert.js +221 -0
- package/dist/ui/breadcrumb.d.ts +1 -0
- package/dist/ui/breadcrumb.js +902 -0
- package/dist/ui/button-dropdown.d.ts +1 -0
- package/dist/ui/button-dropdown.js +679 -0
- package/dist/ui/button.d.ts +1 -0
- package/dist/ui/button.js +63 -0
- package/dist/ui/card.d.ts +1 -0
- package/dist/ui/card.js +511 -0
- package/dist/ui/chart.d.ts +1 -0
- package/dist/ui/chart.js +808 -0
- package/dist/ui/checkbox.d.ts +1 -0
- package/dist/ui/checkbox.js +413 -0
- package/dist/ui/chip.d.ts +1 -0
- package/dist/ui/chip.js +558 -0
- package/dist/ui/date.d.ts +1 -0
- package/dist/ui/date.js +686 -0
- package/dist/ui/drawer.d.ts +1 -0
- package/dist/ui/drawer.js +901 -0
- package/dist/ui/dropdown-table.d.ts +1 -0
- package/dist/ui/dropdown-table.js +1291 -0
- package/dist/ui/dropdown.d.ts +1 -0
- package/dist/ui/dropdown.js +586 -0
- package/dist/ui/file-upload.d.ts +1 -0
- package/dist/ui/file-upload.js +688 -0
- package/dist/ui/filter.d.ts +1 -0
- package/dist/ui/filter.js +400 -0
- package/dist/ui/font/files/geist-47c091c9.woff2 +0 -0
- package/dist/ui/font/files/geist-8dd77544.woff2 +0 -0
- package/dist/ui/font/files/geist-b9248b1e.woff2 +0 -0
- package/dist/ui/font/files/geist-d40d74b4.woff2 +0 -0
- package/dist/ui/font/files/geist-f493429a.woff2 +0 -0
- package/dist/ui/font/files/geistmono-03737868.woff2 +0 -0
- package/dist/ui/font/files/geistmono-421a7e38.woff2 +0 -0
- package/dist/ui/font/files/geistmono-48ef518d.woff2 +0 -0
- package/dist/ui/font/files/geistmono-5df35d39.woff2 +0 -0
- package/dist/ui/font/files/geistmono-7de289a4.woff2 +0 -0
- package/dist/ui/font/files/geistmono-e976128f.woff2 +0 -0
- package/dist/ui/font/files/inter-05cf802c.woff2 +0 -0
- package/dist/ui/font/files/inter-2b2f25a4.woff2 +0 -0
- package/dist/ui/font/files/inter-467acc7a.woff2 +0 -0
- package/dist/ui/font/files/inter-6e85163c.woff2 +0 -0
- package/dist/ui/font/files/inter-7048add3.woff2 +0 -0
- package/dist/ui/font/files/inter-9be0371e.woff2 +0 -0
- package/dist/ui/font/files/inter-a28b7e31.woff2 +0 -0
- package/dist/ui/font/files/poppins-054df55a.woff2 +0 -0
- package/dist/ui/font/files/poppins-0ee5dc9a.woff2 +0 -0
- package/dist/ui/font/files/poppins-0f44cb18.woff2 +0 -0
- package/dist/ui/font/files/poppins-0ff0d30c.woff2 +0 -0
- package/dist/ui/font/files/poppins-13045147.woff2 +0 -0
- package/dist/ui/font/files/poppins-1db57cd9.woff2 +0 -0
- package/dist/ui/font/files/poppins-2cf2a902.woff2 +0 -0
- package/dist/ui/font/files/poppins-39e7f079.woff2 +0 -0
- package/dist/ui/font/files/poppins-9607042d.woff2 +0 -0
- package/dist/ui/font/files/poppins-9a88fc1f.woff2 +0 -0
- package/dist/ui/font/files/poppins-b8f4f752.woff2 +0 -0
- package/dist/ui/font/files/poppins-f5e57db4.woff2 +0 -0
- package/dist/ui/font/geist-mono.css +104 -0
- package/dist/ui/font/geist.css +168 -0
- package/dist/ui/font/inter.css +232 -0
- package/dist/ui/font/poppins.css +104 -0
- package/dist/ui/form.d.ts +1 -0
- package/dist/ui/form.js +3 -0
- package/dist/ui/index.css +21826 -0
- package/dist/ui/input.d.ts +1 -0
- package/dist/ui/input.js +1176 -0
- package/dist/ui/menu.d.ts +1 -0
- package/dist/ui/menu.js +1289 -0
- package/dist/ui/modal.d.ts +1 -0
- package/dist/ui/modal.js +995 -0
- package/dist/ui/nav.d.ts +1 -0
- package/dist/ui/nav.js +295 -0
- package/dist/ui/radio.d.ts +1 -0
- package/dist/ui/radio.js +379 -0
- package/dist/ui/rich-text-editor.d.ts +1 -0
- package/dist/ui/rich-text-editor.js +1338 -0
- package/dist/ui/select.d.ts +1 -0
- package/dist/ui/select.js +2066 -0
- package/dist/ui/shadow/accordion.js +442 -0
- package/dist/ui/shadow/alert.js +218 -0
- package/dist/ui/shadow/breadcrumb.js +919 -0
- package/dist/ui/shadow/button-dropdown.js +696 -0
- package/dist/ui/shadow/button.js +63 -0
- package/dist/ui/shadow/card.js +524 -0
- package/dist/ui/shadow/chart.js +1569 -0
- package/dist/ui/shadow/checkbox.js +457 -0
- package/dist/ui/shadow/chip.js +559 -0
- package/dist/ui/shadow/date.js +712 -0
- package/dist/ui/shadow/drawer.js +869 -0
- package/dist/ui/shadow/dropdown-table.js +1620 -0
- package/dist/ui/shadow/dropdown.js +547 -0
- package/dist/ui/shadow/file-upload.js +731 -0
- package/dist/ui/shadow/filter.js +402 -0
- package/dist/ui/shadow/input.js +1150 -0
- package/dist/ui/shadow/menu.js +899 -0
- package/dist/ui/shadow/modal.js +1193 -0
- package/dist/ui/shadow/nav.js +240 -0
- package/dist/ui/shadow/radio.js +408 -0
- package/dist/ui/shadow/rich-text-editor.js +1344 -0
- package/dist/ui/shadow/select.js +2033 -0
- package/dist/ui/shadow/sidebar.js +606 -0
- package/dist/ui/shadow/switch.js +428 -0
- package/dist/ui/shadow/table.js +4755 -0
- package/dist/ui/shadow/tabs.js +372 -0
- package/dist/ui/shadow/tag-input.js +2846 -0
- package/dist/ui/shadow/textarea.js +816 -0
- package/dist/ui/sidebar.d.ts +1 -0
- package/dist/ui/sidebar.js +659 -0
- package/dist/ui/switch.d.ts +1 -0
- package/dist/ui/switch.js +398 -0
- package/dist/ui/table.d.ts +1 -0
- package/dist/ui/table.js +4654 -0
- package/dist/ui/tabs.d.ts +1 -0
- package/dist/ui/tabs.js +379 -0
- package/dist/ui/tag-input.d.ts +1 -0
- package/dist/ui/tag-input.js +2819 -0
- package/dist/ui/textarea.d.ts +1 -0
- package/dist/ui/textarea.js +819 -0
- package/dist/ui/theme/legacy.css +293 -0
- package/dist/ui/theme/luma.css +743 -0
- package/dist/ui/theme/lyra.css +754 -0
- package/dist/ui/theme/maia.css +673 -0
- package/dist/ui/theme/mira.css +802 -0
- package/dist/ui/theme/nova.css +662 -0
- package/dist/ui/theme/one.css +699 -0
- package/dist/ui/theme/rhea.css +742 -0
- package/dist/ui/theme/sera.css +845 -0
- package/dist/ui/theme/tokens.css +261 -0
- package/dist/ui/theme/vega.css +467 -0
- package/dist/vite-C5iUK7so.js +329 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +2 -0
- package/dist/vue.d.ts +282 -0
- package/package.json +411 -3
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { c as toODataClause, n as isPath, t as getFieldValue } from "./field-path-C92eGLg3.js";
|
|
2
|
+
import { n as unwrapReactive, y as andFilters } from "./reactive-BHsqVjRh.js";
|
|
3
|
+
//#region src/components/table/grouping.ts
|
|
4
|
+
/**
|
|
5
|
+
* Client-side grouping helpers shared by {@link monoArraySource} and
|
|
6
|
+
* {@link monoDataGrid}. Dependency-free so @mono-lit/helper stays standalone; the
|
|
7
|
+
* tree shape mirrors what a devextreme DataSource produces for `group`, so a
|
|
8
|
+
* consumer can read `row.key` / `row.items[i].key` / … exactly as before.
|
|
9
|
+
*/
|
|
10
|
+
/** Duck-type a grouped node: `{ key, items: [...] }`. */
|
|
11
|
+
function isGroupNode(x) {
|
|
12
|
+
return !!x && typeof x === "object" && "key" in x && Array.isArray(x.items);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Recursively collect the leaf records from a possibly-grouped array. Already
|
|
16
|
+
* flat rows pass straight through, so this safely normalises both a grouped
|
|
17
|
+
* payload (devextreme `type:'data'` with `group`) and a plain array.
|
|
18
|
+
*/
|
|
19
|
+
function flattenLeaves(rows) {
|
|
20
|
+
const out = [];
|
|
21
|
+
for (const row of rows) if (isGroupNode(row)) out.push(...flattenLeaves(row.items));
|
|
22
|
+
else out.push(row);
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Bucket flat leaf records into the nested {@link MonoGroupNode} tree by
|
|
27
|
+
* `fields` (in order). Group order follows first appearance in `rows` — the
|
|
28
|
+
* source group-orders the rows, so a paged slice renders contiguous headers.
|
|
29
|
+
*
|
|
30
|
+
* @param rows Flat leaf records (already group-ordered for nice paging).
|
|
31
|
+
* @param fields Group-by field names, outermost first.
|
|
32
|
+
* @param collapsed Set of collapsed `path`s; matching nodes get `collapsed:true`.
|
|
33
|
+
*/
|
|
34
|
+
function buildGroups(rows, fields, collapsed = /* @__PURE__ */ new Set()) {
|
|
35
|
+
const build = (items, level, parentPath) => {
|
|
36
|
+
const field = fields[level];
|
|
37
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const row of items) {
|
|
39
|
+
const key = isPath(field) ? getFieldValue(row, field) : row?.[field];
|
|
40
|
+
const keyStr = String(key);
|
|
41
|
+
let bucket = buckets.get(keyStr);
|
|
42
|
+
if (!bucket) {
|
|
43
|
+
bucket = {
|
|
44
|
+
key,
|
|
45
|
+
rows: []
|
|
46
|
+
};
|
|
47
|
+
buckets.set(keyStr, bucket);
|
|
48
|
+
}
|
|
49
|
+
bucket.rows.push(row);
|
|
50
|
+
}
|
|
51
|
+
const nodes = [];
|
|
52
|
+
for (const [keyStr, bucket] of buckets) {
|
|
53
|
+
const path = parentPath ? `${parentPath}/${keyStr}` : keyStr;
|
|
54
|
+
const isLast = level >= fields.length - 1;
|
|
55
|
+
nodes.push({
|
|
56
|
+
key: bucket.key,
|
|
57
|
+
items: isLast ? bucket.rows : build(bucket.rows, level + 1, path),
|
|
58
|
+
count: bucket.rows.length,
|
|
59
|
+
level,
|
|
60
|
+
path,
|
|
61
|
+
collapsed: collapsed.has(path)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return nodes;
|
|
65
|
+
};
|
|
66
|
+
return fields.length ? build(rows, 0, "") : [];
|
|
67
|
+
}
|
|
68
|
+
/** Collect every group node's `path` from a built tree (for collapse-all). */
|
|
69
|
+
function collectGroupPaths(nodes) {
|
|
70
|
+
const out = [];
|
|
71
|
+
const walk = (list) => {
|
|
72
|
+
for (const node of list) {
|
|
73
|
+
out.push(node.path);
|
|
74
|
+
const children = node.items;
|
|
75
|
+
if (children.length && isGroupNode(children[0])) walk(children);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
walk(nodes);
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/utils/data-source-read.ts
|
|
83
|
+
/**
|
|
84
|
+
* Draining a devextreme DataSource (or store) to a flat array.
|
|
85
|
+
*
|
|
86
|
+
* The single place that knows how to read *everything* out of a source, shared
|
|
87
|
+
* by `monoDataGrid.getData()` and the report engine's `data` resolver. Kept
|
|
88
|
+
* duck-typed and dependency-free — @mono-lit/helper never imports devextreme, and a
|
|
89
|
+
* real DataSource satisfies these shapes structurally.
|
|
90
|
+
*
|
|
91
|
+
* The hard part isn't the loop, it's reading a source **without disturbing it**:
|
|
92
|
+
* the same DataSource is usually bound to a live grid, so paging state must
|
|
93
|
+
* either be left alone (the store path) or restored exactly (the array path).
|
|
94
|
+
*/
|
|
95
|
+
/** Stop runaway loops if a backend keeps returning full chunks forever. */
|
|
96
|
+
var MAX_SKIP = 1e7;
|
|
97
|
+
/** A devextreme DataSource: it both loads and holds a current page. */
|
|
98
|
+
function isDataSourceLike(value) {
|
|
99
|
+
const v = value;
|
|
100
|
+
return !!v && typeof v === "object" && typeof v.load === "function" && typeof v.items === "function";
|
|
101
|
+
}
|
|
102
|
+
/** A bare store (ODataStore / CustomStore / ArrayStore) — loads, but has no page. */
|
|
103
|
+
function isStoreLike(value) {
|
|
104
|
+
const v = value;
|
|
105
|
+
return !!v && typeof v === "object" && typeof v.load === "function" && typeof v.items !== "function" && (typeof v.key === "function" || typeof v.byKey === "function");
|
|
106
|
+
}
|
|
107
|
+
/** Anything this module can drain into an array. */
|
|
108
|
+
function isReadableSource(value) {
|
|
109
|
+
return isDataSourceLike(value) || isStoreLike(value);
|
|
110
|
+
}
|
|
111
|
+
/** devextreme `store.load` resolves to either an array or `{ data, … }`. */
|
|
112
|
+
function rowsOf(res) {
|
|
113
|
+
return Array.isArray(res) ? res : res?.data ?? [];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Build a devextreme filter expression for a DataSource's **active search**.
|
|
117
|
+
*
|
|
118
|
+
* This is the subtle one. `searchValue` / `searchExpr` are DataSource-level
|
|
119
|
+
* options: the DataSource folds them into the request it sends to its store.
|
|
120
|
+
* Reading the store directly bypasses them entirely — so an export would
|
|
121
|
+
* silently include rows the user filtered away with `<mono-table-search>`.
|
|
122
|
+
* Reconstructing the filter here keeps the store path faithful to the grid.
|
|
123
|
+
*/
|
|
124
|
+
function searchFilterOf(source) {
|
|
125
|
+
const value = source.searchValue?.();
|
|
126
|
+
const search = value == null || value === "" ? null : String(value);
|
|
127
|
+
if (!search) return void 0;
|
|
128
|
+
const expr = source.searchExpr?.();
|
|
129
|
+
const cols = Array.isArray(expr) ? expr : expr ? [expr] : [];
|
|
130
|
+
if (!cols.length) return void 0;
|
|
131
|
+
const op = source.searchOperation?.() || "contains";
|
|
132
|
+
const clauses = cols.map((c) => toODataClause(c, op, search)).filter((c) => c != null);
|
|
133
|
+
if (!clauses.length) return void 0;
|
|
134
|
+
if (clauses.length === 1) return clauses[0];
|
|
135
|
+
const out = [];
|
|
136
|
+
clauses.forEach((c, i) => {
|
|
137
|
+
if (i) out.push("or");
|
|
138
|
+
out.push(c);
|
|
139
|
+
});
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Read every row a source can produce, in chunks.
|
|
144
|
+
*
|
|
145
|
+
* A plain array passes straight through, so callers can accept
|
|
146
|
+
* "array or DataSource" without branching.
|
|
147
|
+
*/
|
|
148
|
+
async function readAllRows(source, options = {}) {
|
|
149
|
+
const src = unwrapReactive(source);
|
|
150
|
+
if (Array.isArray(src)) return flattenLeaves(src);
|
|
151
|
+
if (!src) return [];
|
|
152
|
+
const chunkSize = Math.max(1, Math.floor(options.chunkSize ?? 100));
|
|
153
|
+
if (isDataSourceLike(src)) {
|
|
154
|
+
const store = src.store?.();
|
|
155
|
+
if (store && typeof store.load === "function") {
|
|
156
|
+
const filter = andFilters(andFilters(src.filter?.() ?? null, searchFilterOf(src) ?? null), options.filter ?? null);
|
|
157
|
+
const sort = options.sort ?? src.sort?.() ?? null;
|
|
158
|
+
const select = options.select ?? src.select?.() ?? null;
|
|
159
|
+
return drainStore(store, {
|
|
160
|
+
chunkSize,
|
|
161
|
+
...select ? { select } : {},
|
|
162
|
+
...filter ? { filter } : {},
|
|
163
|
+
...sort ? { sort } : {},
|
|
164
|
+
...options.loadOptions ? { loadOptions: options.loadOptions } : {}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return readArrayDataSource(src);
|
|
168
|
+
}
|
|
169
|
+
if (isStoreLike(src)) return drainStore(src, {
|
|
170
|
+
chunkSize,
|
|
171
|
+
select: options.select,
|
|
172
|
+
sort: options.sort,
|
|
173
|
+
...options.filter ? { filter: options.filter } : {},
|
|
174
|
+
...options.loadOptions ? { loadOptions: options.loadOptions } : {}
|
|
175
|
+
});
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
/** Loop `store.load` until a short chunk comes back. */
|
|
179
|
+
async function drainStore(store, opts) {
|
|
180
|
+
const acc = [];
|
|
181
|
+
for (let skip = 0;; skip += opts.chunkSize) {
|
|
182
|
+
const rows = rowsOf(await store.load({
|
|
183
|
+
...opts.loadOptions ?? {},
|
|
184
|
+
...opts.filter ? { filter: opts.filter } : {},
|
|
185
|
+
...opts.sort ? { sort: opts.sort } : {},
|
|
186
|
+
...opts.select ? { select: opts.select } : {},
|
|
187
|
+
skip,
|
|
188
|
+
take: opts.chunkSize,
|
|
189
|
+
requireTotalCount: false
|
|
190
|
+
}));
|
|
191
|
+
acc.push(...flattenLeaves(rows));
|
|
192
|
+
if (rows.length < opts.chunkSize) break;
|
|
193
|
+
if (skip > MAX_SKIP) break;
|
|
194
|
+
}
|
|
195
|
+
return acc;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* An array-backed DataSource has no separate read channel, so its paging has to
|
|
199
|
+
* be switched off, read, and put back exactly as it was — subscribers must not
|
|
200
|
+
* observe the detour.
|
|
201
|
+
*/
|
|
202
|
+
async function readArrayDataSource(src) {
|
|
203
|
+
const paginate = src.paginate?.();
|
|
204
|
+
const pageIndex = src.pageIndex?.();
|
|
205
|
+
try {
|
|
206
|
+
src.paginate?.(false);
|
|
207
|
+
await src.load();
|
|
208
|
+
return flattenLeaves([...src.items?.() ?? []]);
|
|
209
|
+
} finally {
|
|
210
|
+
if (typeof paginate === "boolean") src.paginate?.(paginate);
|
|
211
|
+
if (typeof pageIndex === "number") src.pageIndex?.(pageIndex);
|
|
212
|
+
await src.load();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
export { buildGroups as a, isGroupNode as c, searchFilterOf as i, isReadableSource as n, collectGroupPaths as o, readAllRows as r, flattenLeaves as s, isDataSourceLike as t };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { c as toODataClause, n as isPath, t as getFieldValue } from "./field-path-C92eGLg3.js";
|
|
2
|
+
import { t as andFilters } from "./filter-eval-DIfU2EAn.js";
|
|
3
|
+
import { n as unwrapReactive } from "./reactive-D3EERqgO.js";
|
|
4
|
+
//#region src/components/table/grouping.ts
|
|
5
|
+
/**
|
|
6
|
+
* Client-side grouping helpers shared by {@link monoArraySource} and
|
|
7
|
+
* {@link monoDataGrid}. Dependency-free so @mono-lit/helper stays standalone; the
|
|
8
|
+
* tree shape mirrors what a devextreme DataSource produces for `group`, so a
|
|
9
|
+
* consumer can read `row.key` / `row.items[i].key` / … exactly as before.
|
|
10
|
+
*/
|
|
11
|
+
/** Duck-type a grouped node: `{ key, items: [...] }`. */
|
|
12
|
+
function isGroupNode(x) {
|
|
13
|
+
return !!x && typeof x === "object" && "key" in x && Array.isArray(x.items);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Recursively collect the leaf records from a possibly-grouped array. Already
|
|
17
|
+
* flat rows pass straight through, so this safely normalises both a grouped
|
|
18
|
+
* payload (devextreme `type:'data'` with `group`) and a plain array.
|
|
19
|
+
*/
|
|
20
|
+
function flattenLeaves(rows) {
|
|
21
|
+
const out = [];
|
|
22
|
+
for (const row of rows) if (isGroupNode(row)) out.push(...flattenLeaves(row.items));
|
|
23
|
+
else out.push(row);
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Bucket flat leaf records into the nested {@link MonoGroupNode} tree by
|
|
28
|
+
* `fields` (in order). Group order follows first appearance in `rows` — the
|
|
29
|
+
* source group-orders the rows, so a paged slice renders contiguous headers.
|
|
30
|
+
*
|
|
31
|
+
* @param rows Flat leaf records (already group-ordered for nice paging).
|
|
32
|
+
* @param fields Group-by field names, outermost first.
|
|
33
|
+
* @param collapsed Set of collapsed `path`s; matching nodes get `collapsed:true`.
|
|
34
|
+
*/
|
|
35
|
+
function buildGroups(rows, fields, collapsed = /* @__PURE__ */ new Set()) {
|
|
36
|
+
const build = (items, level, parentPath) => {
|
|
37
|
+
const field = fields[level];
|
|
38
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
39
|
+
for (const row of items) {
|
|
40
|
+
const key = isPath(field) ? getFieldValue(row, field) : row?.[field];
|
|
41
|
+
const keyStr = String(key);
|
|
42
|
+
let bucket = buckets.get(keyStr);
|
|
43
|
+
if (!bucket) {
|
|
44
|
+
bucket = {
|
|
45
|
+
key,
|
|
46
|
+
rows: []
|
|
47
|
+
};
|
|
48
|
+
buckets.set(keyStr, bucket);
|
|
49
|
+
}
|
|
50
|
+
bucket.rows.push(row);
|
|
51
|
+
}
|
|
52
|
+
const nodes = [];
|
|
53
|
+
for (const [keyStr, bucket] of buckets) {
|
|
54
|
+
const path = parentPath ? `${parentPath}/${keyStr}` : keyStr;
|
|
55
|
+
const isLast = level >= fields.length - 1;
|
|
56
|
+
nodes.push({
|
|
57
|
+
key: bucket.key,
|
|
58
|
+
items: isLast ? bucket.rows : build(bucket.rows, level + 1, path),
|
|
59
|
+
count: bucket.rows.length,
|
|
60
|
+
level,
|
|
61
|
+
path,
|
|
62
|
+
collapsed: collapsed.has(path)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return nodes;
|
|
66
|
+
};
|
|
67
|
+
return fields.length ? build(rows, 0, "") : [];
|
|
68
|
+
}
|
|
69
|
+
/** Collect every group node's `path` from a built tree (for collapse-all). */
|
|
70
|
+
function collectGroupPaths(nodes) {
|
|
71
|
+
const out = [];
|
|
72
|
+
const walk = (list) => {
|
|
73
|
+
for (const node of list) {
|
|
74
|
+
out.push(node.path);
|
|
75
|
+
const children = node.items;
|
|
76
|
+
if (children.length && isGroupNode(children[0])) walk(children);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
walk(nodes);
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/utils/data-source-read.ts
|
|
84
|
+
/**
|
|
85
|
+
* Draining a devextreme DataSource (or store) to a flat array.
|
|
86
|
+
*
|
|
87
|
+
* The single place that knows how to read *everything* out of a source, shared
|
|
88
|
+
* by `monoDataGrid.getData()` and the report engine's `data` resolver. Kept
|
|
89
|
+
* duck-typed and dependency-free — @mono-lit/helper never imports devextreme, and a
|
|
90
|
+
* real DataSource satisfies these shapes structurally.
|
|
91
|
+
*
|
|
92
|
+
* The hard part isn't the loop, it's reading a source **without disturbing it**:
|
|
93
|
+
* the same DataSource is usually bound to a live grid, so paging state must
|
|
94
|
+
* either be left alone (the store path) or restored exactly (the array path).
|
|
95
|
+
*/
|
|
96
|
+
/** Stop runaway loops if a backend keeps returning full chunks forever. */
|
|
97
|
+
var MAX_SKIP = 1e7;
|
|
98
|
+
/** A devextreme DataSource: it both loads and holds a current page. */
|
|
99
|
+
function isDataSourceLike(value) {
|
|
100
|
+
const v = value;
|
|
101
|
+
return !!v && typeof v === "object" && typeof v.load === "function" && typeof v.items === "function";
|
|
102
|
+
}
|
|
103
|
+
/** A bare store (ODataStore / CustomStore / ArrayStore) — loads, but has no page. */
|
|
104
|
+
function isStoreLike(value) {
|
|
105
|
+
const v = value;
|
|
106
|
+
return !!v && typeof v === "object" && typeof v.load === "function" && typeof v.items !== "function" && (typeof v.key === "function" || typeof v.byKey === "function");
|
|
107
|
+
}
|
|
108
|
+
/** Anything this module can drain into an array. */
|
|
109
|
+
function isReadableSource(value) {
|
|
110
|
+
return isDataSourceLike(value) || isStoreLike(value);
|
|
111
|
+
}
|
|
112
|
+
/** devextreme `store.load` resolves to either an array or `{ data, … }`. */
|
|
113
|
+
function rowsOf(res) {
|
|
114
|
+
return Array.isArray(res) ? res : res?.data ?? [];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Build a devextreme filter expression for a DataSource's **active search**.
|
|
118
|
+
*
|
|
119
|
+
* This is the subtle one. `searchValue` / `searchExpr` are DataSource-level
|
|
120
|
+
* options: the DataSource folds them into the request it sends to its store.
|
|
121
|
+
* Reading the store directly bypasses them entirely — so an export would
|
|
122
|
+
* silently include rows the user filtered away with `<mono-table-search>`.
|
|
123
|
+
* Reconstructing the filter here keeps the store path faithful to the grid.
|
|
124
|
+
*/
|
|
125
|
+
function searchFilterOf(source) {
|
|
126
|
+
const value = source.searchValue?.();
|
|
127
|
+
const search = value == null || value === "" ? null : String(value);
|
|
128
|
+
if (!search) return void 0;
|
|
129
|
+
const expr = source.searchExpr?.();
|
|
130
|
+
const cols = Array.isArray(expr) ? expr : expr ? [expr] : [];
|
|
131
|
+
if (!cols.length) return void 0;
|
|
132
|
+
const op = source.searchOperation?.() || "contains";
|
|
133
|
+
const clauses = cols.map((c) => toODataClause(c, op, search)).filter((c) => c != null);
|
|
134
|
+
if (!clauses.length) return void 0;
|
|
135
|
+
if (clauses.length === 1) return clauses[0];
|
|
136
|
+
const out = [];
|
|
137
|
+
clauses.forEach((c, i) => {
|
|
138
|
+
if (i) out.push("or");
|
|
139
|
+
out.push(c);
|
|
140
|
+
});
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Read every row a source can produce, in chunks.
|
|
145
|
+
*
|
|
146
|
+
* A plain array passes straight through, so callers can accept
|
|
147
|
+
* "array or DataSource" without branching.
|
|
148
|
+
*/
|
|
149
|
+
async function readAllRows(source, options = {}) {
|
|
150
|
+
const src = unwrapReactive(source);
|
|
151
|
+
if (Array.isArray(src)) return flattenLeaves(src);
|
|
152
|
+
if (!src) return [];
|
|
153
|
+
const chunkSize = Math.max(1, Math.floor(options.chunkSize ?? 100));
|
|
154
|
+
if (isDataSourceLike(src)) {
|
|
155
|
+
const store = src.store?.();
|
|
156
|
+
if (store && typeof store.load === "function") {
|
|
157
|
+
const filter = andFilters(andFilters(src.filter?.() ?? null, searchFilterOf(src) ?? null), options.filter ?? null);
|
|
158
|
+
const sort = options.sort ?? src.sort?.() ?? null;
|
|
159
|
+
const select = options.select ?? src.select?.() ?? null;
|
|
160
|
+
return drainStore(store, {
|
|
161
|
+
chunkSize,
|
|
162
|
+
...select ? { select } : {},
|
|
163
|
+
...filter ? { filter } : {},
|
|
164
|
+
...sort ? { sort } : {},
|
|
165
|
+
...options.loadOptions ? { loadOptions: options.loadOptions } : {}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return readArrayDataSource(src);
|
|
169
|
+
}
|
|
170
|
+
if (isStoreLike(src)) return drainStore(src, {
|
|
171
|
+
chunkSize,
|
|
172
|
+
select: options.select,
|
|
173
|
+
sort: options.sort,
|
|
174
|
+
...options.filter ? { filter: options.filter } : {},
|
|
175
|
+
...options.loadOptions ? { loadOptions: options.loadOptions } : {}
|
|
176
|
+
});
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
/** Loop `store.load` until a short chunk comes back. */
|
|
180
|
+
async function drainStore(store, opts) {
|
|
181
|
+
const acc = [];
|
|
182
|
+
for (let skip = 0;; skip += opts.chunkSize) {
|
|
183
|
+
const rows = rowsOf(await store.load({
|
|
184
|
+
...opts.loadOptions ?? {},
|
|
185
|
+
...opts.filter ? { filter: opts.filter } : {},
|
|
186
|
+
...opts.sort ? { sort: opts.sort } : {},
|
|
187
|
+
...opts.select ? { select: opts.select } : {},
|
|
188
|
+
skip,
|
|
189
|
+
take: opts.chunkSize,
|
|
190
|
+
requireTotalCount: false
|
|
191
|
+
}));
|
|
192
|
+
acc.push(...flattenLeaves(rows));
|
|
193
|
+
if (rows.length < opts.chunkSize) break;
|
|
194
|
+
if (skip > MAX_SKIP) break;
|
|
195
|
+
}
|
|
196
|
+
return acc;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* An array-backed DataSource has no separate read channel, so its paging has to
|
|
200
|
+
* be switched off, read, and put back exactly as it was — subscribers must not
|
|
201
|
+
* observe the detour.
|
|
202
|
+
*/
|
|
203
|
+
async function readArrayDataSource(src) {
|
|
204
|
+
const paginate = src.paginate?.();
|
|
205
|
+
const pageIndex = src.pageIndex?.();
|
|
206
|
+
try {
|
|
207
|
+
src.paginate?.(false);
|
|
208
|
+
await src.load();
|
|
209
|
+
return flattenLeaves([...src.items?.() ?? []]);
|
|
210
|
+
} finally {
|
|
211
|
+
if (typeof paginate === "boolean") src.paginate?.(paginate);
|
|
212
|
+
if (typeof pageIndex === "number") src.pageIndex?.(pageIndex);
|
|
213
|
+
await src.load();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
export { buildGroups as a, isGroupNode as c, searchFilterOf as i, isReadableSource as n, collectGroupPaths as o, readAllRows as r, flattenLeaves as s, isDataSourceLike as t };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
//#region src/composables/hybird-prop.ts
|
|
2
|
+
function toKebabCase(value) {
|
|
3
|
+
return value.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
4
|
+
}
|
|
5
|
+
function toLowerCaseProp(value) {
|
|
6
|
+
return value.toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
function defineHybridPropAliases(target, props) {
|
|
9
|
+
for (const prop of props) {
|
|
10
|
+
const kebabProp = toKebabCase(prop);
|
|
11
|
+
const lowerProp = toLowerCaseProp(prop);
|
|
12
|
+
defineAlias(target, kebabProp, prop);
|
|
13
|
+
if (lowerProp !== prop && lowerProp !== kebabProp) defineAlias(target, lowerProp, prop);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Register a cross-name alias for a controller-binding prop — e.g.
|
|
18
|
+
* `defineHybridPropAlias(el, 'controlTable', 'dataGrid')` makes `controlTable`,
|
|
19
|
+
* `control-table` and `controltable` all read/write the canonical reactive
|
|
20
|
+
* `dataGrid` property (so `.controlTable = …` still triggers Lit's update
|
|
21
|
+
* cycle). Used to rename the controller props without a breaking change: the
|
|
22
|
+
* new `control-*` spellings land here while the old `data-*` ones keep working.
|
|
23
|
+
*/
|
|
24
|
+
function defineHybridPropAlias(target, aliasCamel, realProp) {
|
|
25
|
+
const kebab = toKebabCase(aliasCamel);
|
|
26
|
+
const lower = toLowerCaseProp(aliasCamel);
|
|
27
|
+
defineAlias(target, aliasCamel, realProp);
|
|
28
|
+
defineAlias(target, kebab, realProp);
|
|
29
|
+
if (lower !== aliasCamel && lower !== kebab) defineAlias(target, lower, realProp);
|
|
30
|
+
}
|
|
31
|
+
function defineAlias(target, alias, realProp) {
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(target, alias)) return;
|
|
33
|
+
Object.defineProperty(target, alias, {
|
|
34
|
+
get() {
|
|
35
|
+
return this[realProp];
|
|
36
|
+
},
|
|
37
|
+
set(value) {
|
|
38
|
+
this[realProp] = value;
|
|
39
|
+
},
|
|
40
|
+
configurable: true,
|
|
41
|
+
enumerable: false
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Lit `hasChanged` for an array prop.
|
|
46
|
+
*
|
|
47
|
+
* **Load-bearing**, for exactly the reason `rateLimitHasChanged` is (see
|
|
48
|
+
* `composables/rate-limit.ts`): `:items="[...]"` in a template allocates a NEW array
|
|
49
|
+
* on every parent re-render. Under Lit's default `!==` the element sees a change
|
|
50
|
+
* each time, so anything gated on `changed.has('items')` — resetting an
|
|
51
|
+
* infinite-scroll page, invalidating a search memo, rebuilding a cache — runs on
|
|
52
|
+
* renders where nothing about the data actually moved.
|
|
53
|
+
*
|
|
54
|
+
* Element-wise identity rather than a deep compare: rows are normally stable objects
|
|
55
|
+
* owned by a store, so this catches the re-created-wrapper case cheaply. If the
|
|
56
|
+
* consumer also rebuilds each row object the arrays are reported as different, which
|
|
57
|
+
* is the safe direction.
|
|
58
|
+
*
|
|
59
|
+
* **Why this needs no "repair" step, unlike `mono-button-dropdown`.** That element
|
|
60
|
+
* compares entries by CONTENT and deliberately ignores function fields, so it reports
|
|
61
|
+
* "same" for entries that really were rebuilt — leaving cached listener state pointing
|
|
62
|
+
* at the previous array (hence `_retargetItemParts()`). `arrayHasChanged` says "same"
|
|
63
|
+
* only when the array holds literally the same objects in the same order, so nothing
|
|
64
|
+
* item-related can have moved and there is nothing to retarget. Reach for the deeper
|
|
65
|
+
* compare only where the callbacks are resolved late, and prove it.
|
|
66
|
+
*
|
|
67
|
+
* **Do NOT add this (or any `hasChanged`) to these — they hang real work off the
|
|
68
|
+
* update cycle, so suppressing an update silently drops it:**
|
|
69
|
+
* - `chart-core.ts` — `updated()` IS the chart pipeline; its last step `_applyData()`
|
|
70
|
+
* is the only place chart.js is redrawn. A skipped update freezes the canvas.
|
|
71
|
+
* - `date-core.ts` — `updated()` drives `_rebuild()` / `_applyModelValue()`, so
|
|
72
|
+
* flatpickr would be stranded on stale config.
|
|
73
|
+
* - every `mono-table-*` element — `table-controller-core.ts` overrides `update()` to
|
|
74
|
+
* pull each element's slice of `monoDataGrid({ props })`.
|
|
75
|
+
* - every `monoForm`-bound control and `filter-builder-core.ts` — same `update()` hook
|
|
76
|
+
* (`form-control-core.ts`), used for form binding and visibility.
|
|
77
|
+
*
|
|
78
|
+
* Surveyed 2026-08-17 across all 26 component directories; the guarded props are
|
|
79
|
+
* `select`/`tag-input` `items`, `tag-input` `modelValue`/`value`, `menu` +
|
|
80
|
+
* `mono-menu-list` `items`, `tabs` `items`, both `breadcrumb` `items`, and
|
|
81
|
+
* `file-upload` `modelValue`.
|
|
82
|
+
*/
|
|
83
|
+
function arrayHasChanged(value, old) {
|
|
84
|
+
if (value === old) return false;
|
|
85
|
+
if (!Array.isArray(value) || !Array.isArray(old)) return true;
|
|
86
|
+
if (value.length !== old.length) return true;
|
|
87
|
+
for (let i = 0; i < value.length; i++) if (value[i] !== old[i]) return true;
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
var booleanStringConverter = {
|
|
91
|
+
fromAttribute(value) {
|
|
92
|
+
if (value === null || value === void 0) return false;
|
|
93
|
+
if (typeof value === "boolean") return value;
|
|
94
|
+
const normalized = String(value).toLowerCase().trim();
|
|
95
|
+
return normalized === "" || normalized === "true";
|
|
96
|
+
},
|
|
97
|
+
toAttribute(value) {
|
|
98
|
+
return value ? "" : null;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var numberStringConverter = {
|
|
102
|
+
fromAttribute(value) {
|
|
103
|
+
if (value === null || value === "") return 0;
|
|
104
|
+
const parsed = Number(value);
|
|
105
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
106
|
+
},
|
|
107
|
+
toAttribute(value) {
|
|
108
|
+
if (value === void 0 || value === null) return null;
|
|
109
|
+
return String(value);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Like {@link numberStringConverter}, but an absent/blank attribute stays
|
|
114
|
+
* `undefined` instead of collapsing to `0`.
|
|
115
|
+
*
|
|
116
|
+
* Needed wherever 0 is a meaningful value AND "not set" has to mean "fall back to
|
|
117
|
+
* whatever the component computes" — e.g. `mono-modal` / `mono-drawer`'s `z-index`,
|
|
118
|
+
* where 0 is a legal stacking level and unset means "let the popup stack decide".
|
|
119
|
+
* Using the plain number converter there would pin every dialog to `z-index: 0`.
|
|
120
|
+
*/
|
|
121
|
+
var optionalNumberConverter = {
|
|
122
|
+
fromAttribute(value) {
|
|
123
|
+
if (value === null || value === "") return void 0;
|
|
124
|
+
const parsed = Number(value);
|
|
125
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
126
|
+
},
|
|
127
|
+
toAttribute(value) {
|
|
128
|
+
if (value === void 0 || value === null) return null;
|
|
129
|
+
return String(value);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
134
|
+
function __decorate(decorators, target, key, desc) {
|
|
135
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
136
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
137
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
138
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { defineHybridPropAliases as a, defineHybridPropAlias as i, arrayHasChanged as n, numberStringConverter as o, booleanStringConverter as r, optionalNumberConverter as s, __decorate as t };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/composables/element-props.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether `key` can actually be assigned on `obj` — a plain expando, or an
|
|
4
|
+
* accessor/data property that isn't read-only.
|
|
5
|
+
*
|
|
6
|
+
* This matters because a controller's `props` object legitimately carries keys
|
|
7
|
+
* that are NOT element props: `monoDataGrid`'s `th[].summary` includes `prefix`
|
|
8
|
+
* and `precision`, which the controller consumes for formatting. `prefix`
|
|
9
|
+
* collides with the read-only native `Element.prefix`, and assigning it throws —
|
|
10
|
+
* which took down the whole docs page render until this check existed.
|
|
11
|
+
*/
|
|
12
|
+
function isSettable(obj, key) {
|
|
13
|
+
let o = obj;
|
|
14
|
+
while (o) {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(o, key);
|
|
16
|
+
if (d) return !!(d.set || d.writable);
|
|
17
|
+
o = Object.getPrototypeOf(o);
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
var HANDLER_KEY = /^on[A-Z]/;
|
|
22
|
+
/** Whether a props key names an event handler (`onClick`, `onLoadingChange`). */
|
|
23
|
+
function isEventHandlerKey(key) {
|
|
24
|
+
return HANDLER_KEY.test(key);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `onClick` → `click`, `onLoadingChange` → `loading-change`, `onMnoChange` →
|
|
28
|
+
* `mno-change` — the same rule Vue applies to an `on*` listener prop, so a key
|
|
29
|
+
* that works in a template works here.
|
|
30
|
+
*/
|
|
31
|
+
function eventNameFromHandlerKey(key) {
|
|
32
|
+
const rest = key.slice(2);
|
|
33
|
+
return rest.charAt(0).toLowerCase() + rest.slice(1).replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
34
|
+
}
|
|
35
|
+
/** Per element: event name → the handler currently attached through `props`. */
|
|
36
|
+
var attached = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
function applyHandler(el, key, value) {
|
|
38
|
+
if (typeof value !== "function" && value !== null) return;
|
|
39
|
+
const target = el;
|
|
40
|
+
if (typeof target.addEventListener !== "function") return;
|
|
41
|
+
const name = eventNameFromHandlerKey(key);
|
|
42
|
+
let map = attached.get(el);
|
|
43
|
+
const current = map?.get(name);
|
|
44
|
+
if (value === null) {
|
|
45
|
+
if (current) {
|
|
46
|
+
target.removeEventListener(name, current.listener);
|
|
47
|
+
map.delete(name);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const fn = value;
|
|
52
|
+
if (current?.fn === fn) return;
|
|
53
|
+
if (current) target.removeEventListener(name, current.listener);
|
|
54
|
+
const listener = (event) => {
|
|
55
|
+
fn(event);
|
|
56
|
+
};
|
|
57
|
+
target.addEventListener(name, listener);
|
|
58
|
+
if (!map) {
|
|
59
|
+
map = /* @__PURE__ */ new Map();
|
|
60
|
+
attached.set(el, map);
|
|
61
|
+
}
|
|
62
|
+
map.set(name, {
|
|
63
|
+
fn,
|
|
64
|
+
listener
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Remove every handler `applyProps` attached to `el`. Call it where an element
|
|
69
|
+
* leaves its controller (an unbind, a re-bind to a different one) so the old
|
|
70
|
+
* controller's handlers do not keep firing beside the new one's.
|
|
71
|
+
*/
|
|
72
|
+
function detachEventHandlers(el) {
|
|
73
|
+
const map = attached.get(el);
|
|
74
|
+
if (!map) return;
|
|
75
|
+
const target = el;
|
|
76
|
+
for (const [name, { listener }] of map) target.removeEventListener(name, listener);
|
|
77
|
+
attached.delete(el);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Write a controller's props onto an element.
|
|
81
|
+
*
|
|
82
|
+
* Two guards, both load-bearing:
|
|
83
|
+
* - `undefined` values are skipped, so "not declared" never clobbers a value the
|
|
84
|
+
* template set;
|
|
85
|
+
* - each write is equality-checked, so a sync can't schedule another update and
|
|
86
|
+
* loop.
|
|
87
|
+
*
|
|
88
|
+
* Handler keys (`onClick`, `onToggle`, …) become event listeners — see the
|
|
89
|
+
* block above — never properties.
|
|
90
|
+
*
|
|
91
|
+
* Shared by `table-controller-core` (`monoDataGrid`/`monoDataDropdown` elements)
|
|
92
|
+
* and `form-control-core` (`monoForm` controls) — the write loop is identical
|
|
93
|
+
* and its failure modes are subtle enough to be worth having in one place.
|
|
94
|
+
*/
|
|
95
|
+
function applyProps(el, patch) {
|
|
96
|
+
if (!patch) return false;
|
|
97
|
+
const self = el;
|
|
98
|
+
let changed = false;
|
|
99
|
+
for (const [k, v] of Object.entries(patch)) {
|
|
100
|
+
if (v === void 0) continue;
|
|
101
|
+
if (isEventHandlerKey(k)) {
|
|
102
|
+
applyHandler(el, k, v);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (!isSettable(self, k)) continue;
|
|
106
|
+
if (!Object.is(self[k], v)) {
|
|
107
|
+
self[k] = v;
|
|
108
|
+
changed = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return changed;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { detachEventHandlers as n, applyProps as t };
|