@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,688 @@
|
|
|
1
|
+
import { l as monoHostChildNodes } from "../mono-ui-CPV7rrdo.js";
|
|
2
|
+
import { t as customElement } from "../mono-element-B0kP_96P.js";
|
|
3
|
+
import { a as defineHybridPropAliases, i as defineHybridPropAlias, n as arrayHasChanged, r as booleanStringConverter, t as __decorate } from "../decorate-DEXtNagw.js";
|
|
4
|
+
import { t as dispatchMonoEvent } from "../mono-event-Bi1qP9uN.js";
|
|
5
|
+
import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-DW1WgfgT.js";
|
|
6
|
+
import { t as isIconifyClass } from "../icon-dVhYJUIH.js";
|
|
7
|
+
import { t as MonoFormControlCore } from "../form-control-core-eeRr0zLU.js";
|
|
8
|
+
import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
|
|
9
|
+
import { property, query, state } from "lit/decorators.js";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
+
//#region src/components/file-upload/file-upload-utils.ts
|
|
12
|
+
function validateFileUploadProps(props) {
|
|
13
|
+
const validVariants = ["default", "compact"];
|
|
14
|
+
const validStates = [
|
|
15
|
+
"default",
|
|
16
|
+
"valid",
|
|
17
|
+
"invalid",
|
|
18
|
+
"warning"
|
|
19
|
+
];
|
|
20
|
+
if (props.variant && !validVariants.includes(props.variant)) return false;
|
|
21
|
+
if (props.validationState && !validStates.includes(props.validationState)) return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function formatFileSize(size) {
|
|
25
|
+
if (size < 1024) return `${size} B`;
|
|
26
|
+
if (size < 1024 * 1024) return `${Math.round(size / 1024)} KB`;
|
|
27
|
+
return `${(size / (1024 * 1024)).toFixed(1)} MB`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Pick a default file-type icon. Returns an MDI iconify utility class
|
|
31
|
+
* (`i-mdi-*`, resolved by UnoCSS preset-icons) — see
|
|
32
|
+
* https://icon-sets.iconify.design/mdi/ . The render layer paints these as a
|
|
33
|
+
* masked SVG via {@link isIconifyClass}. The full set is safelisted in
|
|
34
|
+
* `uno.config.ts` so the CSS ships in `dist/ui/index.css`.
|
|
35
|
+
*/
|
|
36
|
+
function getFileIcon(type, name) {
|
|
37
|
+
const ext = name.split(".").pop()?.toLowerCase() ?? "";
|
|
38
|
+
if (type.startsWith("image/")) return "i-mdi-file-image";
|
|
39
|
+
if (type.includes("pdf") || ext === "pdf") return "i-mdi-file-pdf-box";
|
|
40
|
+
if (type.includes("sheet") || [
|
|
41
|
+
"xls",
|
|
42
|
+
"xlsx",
|
|
43
|
+
"csv"
|
|
44
|
+
].includes(ext)) return "i-mdi-file-excel";
|
|
45
|
+
if (type.includes("word") || ["doc", "docx"].includes(ext)) return "i-mdi-file-word";
|
|
46
|
+
if (type.includes("zip") || [
|
|
47
|
+
"zip",
|
|
48
|
+
"rar",
|
|
49
|
+
"7z"
|
|
50
|
+
].includes(ext)) return "i-mdi-zip-box";
|
|
51
|
+
if (type.includes("video/")) return "i-mdi-file-video";
|
|
52
|
+
if (type.includes("audio/")) return "i-mdi-file-music";
|
|
53
|
+
return "i-mdi-file";
|
|
54
|
+
}
|
|
55
|
+
function createUploadItem(file) {
|
|
56
|
+
const isImage = file.type.startsWith("image/");
|
|
57
|
+
return {
|
|
58
|
+
id: `${file.name}-${file.size}-${file.lastModified}`,
|
|
59
|
+
file,
|
|
60
|
+
name: file.name,
|
|
61
|
+
size: file.size,
|
|
62
|
+
type: file.type,
|
|
63
|
+
previewUrl: isImage ? URL.createObjectURL(file) : void 0
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/file-upload/file-upload-core.ts
|
|
68
|
+
var numberStringConverter = {
|
|
69
|
+
fromAttribute(value) {
|
|
70
|
+
if (value === null || value === "") return 0;
|
|
71
|
+
const parsed = Number(value);
|
|
72
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
73
|
+
},
|
|
74
|
+
toAttribute(value) {
|
|
75
|
+
if (value === void 0 || value === null) return null;
|
|
76
|
+
return String(value);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* `MonoFileUploadCore` — all render-mode-agnostic logic for `mono-file-upload`:
|
|
81
|
+
* reactive props (incl. SSR boolean + modelValue-array coercion), hybrid aliases,
|
|
82
|
+
* camelCase attribute fallbacks, the file pipeline (validate / add / drag-drop /
|
|
83
|
+
* remove / clear), the `mno-change`/`mno-remove`/`mno-error` events, and the
|
|
84
|
+
* dropzone/list/message `render()`. Icon rendering goes through overridable hooks
|
|
85
|
+
* (`_renderDropzoneIcon`/`_renderDefaultGlyph`/`_renderRemoveIcon`/
|
|
86
|
+
* `_renderThumbGlyph`) — the light build keeps `data-mono-slot` + `i-mdi-*` iconify
|
|
87
|
+
* classes; the shadow build uses native `<slot>` + inline SVG (iconify can't paint
|
|
88
|
+
* inside a shadow root).
|
|
89
|
+
*
|
|
90
|
+
* SSR-safe: no `document`/`window` access at module/ctor scope; the file pipeline
|
|
91
|
+
* and `_inputEl` (`@query`) only run client-side from user interaction.
|
|
92
|
+
*/
|
|
93
|
+
var MonoFileUploadCore = (superClass) => {
|
|
94
|
+
class MonoFileUploadCoreClass extends MonoFormControlCore(superClass) {
|
|
95
|
+
constructor(...args) {
|
|
96
|
+
super(...args);
|
|
97
|
+
this.label = "";
|
|
98
|
+
this.helperText = "";
|
|
99
|
+
this.icon = "";
|
|
100
|
+
this.removeIcon = "";
|
|
101
|
+
this.accept = "";
|
|
102
|
+
this.multiple = false;
|
|
103
|
+
this.disabled = false;
|
|
104
|
+
this.required = false;
|
|
105
|
+
this.dragdrop = true;
|
|
106
|
+
this.maxFileSize = 0;
|
|
107
|
+
this.maxFiles = 0;
|
|
108
|
+
this.modelValue = [];
|
|
109
|
+
this.cssClass = {};
|
|
110
|
+
this.variant = "default";
|
|
111
|
+
this.validationState = "default";
|
|
112
|
+
this.validationMessage = "";
|
|
113
|
+
this._dragOver = false;
|
|
114
|
+
this._hasIconSlot = false;
|
|
115
|
+
this._hasTitleSlot = false;
|
|
116
|
+
this._hasSubtitleSlot = false;
|
|
117
|
+
this._previewsRevoked = false;
|
|
118
|
+
defineHybridPropAliases(this, [
|
|
119
|
+
"helperText",
|
|
120
|
+
"maxFileSize",
|
|
121
|
+
"maxFiles",
|
|
122
|
+
"modelValue",
|
|
123
|
+
"validationState",
|
|
124
|
+
"validationMessage",
|
|
125
|
+
"cssClass",
|
|
126
|
+
"removeIcon"
|
|
127
|
+
]);
|
|
128
|
+
defineHybridPropAlias(this, "placeholder", "title");
|
|
129
|
+
defineHybridPropAlias(this, "subtext", "subtitle");
|
|
130
|
+
this.title = "Klik atau seret file ke sini";
|
|
131
|
+
this.subtitle = "Pilih file untuk diunggah";
|
|
132
|
+
}
|
|
133
|
+
static get observedAttributes() {
|
|
134
|
+
return [
|
|
135
|
+
...super.observedAttributes ?? [],
|
|
136
|
+
"helpertext",
|
|
137
|
+
"maxfilesize",
|
|
138
|
+
"maxfiles",
|
|
139
|
+
"modelvalue",
|
|
140
|
+
"validationstate",
|
|
141
|
+
"validationmessage",
|
|
142
|
+
"removeicon",
|
|
143
|
+
"remove-icon",
|
|
144
|
+
"placeholder",
|
|
145
|
+
"subtext"
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
149
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
150
|
+
if (oldValue === newValue) return;
|
|
151
|
+
if (name === "helpertext") {
|
|
152
|
+
this.helperText = newValue ?? "";
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (name === "maxfilesize") {
|
|
156
|
+
this.maxFileSize = this._toNumber(newValue);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (name === "maxfiles") {
|
|
160
|
+
this.maxFiles = this._toNumber(newValue);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (name === "modelvalue") {
|
|
164
|
+
this.modelValue = this._toFileUploadItems(newValue);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (name === "validationstate") {
|
|
168
|
+
this.validationState = newValue ?? "default";
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (name === "validationmessage") {
|
|
172
|
+
this.validationMessage = newValue ?? "";
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (name === "removeicon" || name === "remove-icon") {
|
|
176
|
+
this.removeIcon = newValue ?? "";
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (name === "placeholder") {
|
|
180
|
+
this.title = newValue ?? "";
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (name === "subtext") this.subtitle = newValue ?? "";
|
|
184
|
+
}
|
|
185
|
+
willUpdate(changed) {
|
|
186
|
+
for (const key of [
|
|
187
|
+
"multiple",
|
|
188
|
+
"disabled",
|
|
189
|
+
"required",
|
|
190
|
+
"dragdrop"
|
|
191
|
+
]) if (typeof this[key] === "string") {
|
|
192
|
+
const normalized = this[key].toLowerCase().trim();
|
|
193
|
+
this[key] = normalized === "" || normalized === "true";
|
|
194
|
+
}
|
|
195
|
+
if (typeof this.modelValue === "string") this.modelValue = this._toFileUploadItems(this.modelValue);
|
|
196
|
+
super.willUpdate?.(changed);
|
|
197
|
+
}
|
|
198
|
+
connectedCallback() {
|
|
199
|
+
super.connectedCallback?.();
|
|
200
|
+
this._restorePreviews();
|
|
201
|
+
}
|
|
202
|
+
disconnectedCallback() {
|
|
203
|
+
this._revokePreviews();
|
|
204
|
+
this._previewsRevoked = true;
|
|
205
|
+
super.disconnectedCallback();
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Re-create the object URLs that `disconnectedCallback` revoked.
|
|
209
|
+
*
|
|
210
|
+
* Revoking on unmount is right — a blob URL pins the whole file in memory — but
|
|
211
|
+
* the files SURVIVE a reconnect (a `v-if` toggle, `<KeepAlive>`, Vue moving the
|
|
212
|
+
* node), and nothing re-created their previews. `modelValue` kept the same
|
|
213
|
+
* `previewUrl` STRING pointing at a dead URL, so every thumbnail was broken from
|
|
214
|
+
* then on. It hid well: an `<img>` already decoded before the unmount keeps
|
|
215
|
+
* painting, so the damage only surfaced once a later re-render built a fresh
|
|
216
|
+
* `<img>` from the same src.
|
|
217
|
+
*
|
|
218
|
+
* Only the disconnect path restores. `clear()` and the single-select replace also
|
|
219
|
+
* revoke, but those files are gone for good and must NOT come back.
|
|
220
|
+
*
|
|
221
|
+
* Mutates the items in place rather than rebuilding `modelValue`: the consumer
|
|
222
|
+
* holds these same object references, so an in-place write keeps both sides on
|
|
223
|
+
* one live URL and avoids emitting a change event for what was never a user edit.
|
|
224
|
+
*/
|
|
225
|
+
_restorePreviews() {
|
|
226
|
+
if (isServer || !this._previewsRevoked) return;
|
|
227
|
+
this._previewsRevoked = false;
|
|
228
|
+
let restored = false;
|
|
229
|
+
for (const item of this.modelValue) {
|
|
230
|
+
if (!item.file || !item.previewUrl) continue;
|
|
231
|
+
item.previewUrl = URL.createObjectURL(item.file);
|
|
232
|
+
restored = true;
|
|
233
|
+
}
|
|
234
|
+
if (restored) this.requestUpdate();
|
|
235
|
+
}
|
|
236
|
+
_toNumber(value) {
|
|
237
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : 0;
|
|
238
|
+
if (typeof value === "string") {
|
|
239
|
+
const parsed = Number(value);
|
|
240
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
241
|
+
}
|
|
242
|
+
return 0;
|
|
243
|
+
}
|
|
244
|
+
_toFileUploadItems(value) {
|
|
245
|
+
if (Array.isArray(value)) return value;
|
|
246
|
+
if (typeof value === "string") {
|
|
247
|
+
if (!value.trim()) return [];
|
|
248
|
+
try {
|
|
249
|
+
const parsed = JSON.parse(value);
|
|
250
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
251
|
+
} catch {
|
|
252
|
+
return [];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
get _wrapperClasses() {
|
|
258
|
+
return [
|
|
259
|
+
"mono-file-upload",
|
|
260
|
+
this.variant,
|
|
261
|
+
this.disabled ? "disabled" : "",
|
|
262
|
+
this._dragOver ? "dragover" : "",
|
|
263
|
+
this.validationState !== "default" ? this.validationState : "",
|
|
264
|
+
this.cssClass?.root ?? ""
|
|
265
|
+
].filter(Boolean).join(" ");
|
|
266
|
+
}
|
|
267
|
+
_cls(base, key) {
|
|
268
|
+
const extra = this.cssClass?.[key];
|
|
269
|
+
return extra ? `${base} ${extra}` : base;
|
|
270
|
+
}
|
|
271
|
+
_cloneValue(value) {
|
|
272
|
+
return [...value];
|
|
273
|
+
}
|
|
274
|
+
_createModelDetail(args) {
|
|
275
|
+
const currentValue = this._cloneValue(args.modelValue);
|
|
276
|
+
return {
|
|
277
|
+
modelValue: currentValue,
|
|
278
|
+
currentValue,
|
|
279
|
+
oldValue: this._cloneValue(args.oldValue),
|
|
280
|
+
files: currentValue,
|
|
281
|
+
addedFiles: args.addedFiles ? this._cloneValue(args.addedFiles) : [],
|
|
282
|
+
removedFile: args.removedFile,
|
|
283
|
+
action: args.action,
|
|
284
|
+
sourceEvent: args.sourceEvent
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
_emitChange(detail) {
|
|
288
|
+
dispatchMonoEvent(this, "change", detail);
|
|
289
|
+
}
|
|
290
|
+
_emitRemove(detail) {
|
|
291
|
+
dispatchMonoEvent(this, "remove", detail);
|
|
292
|
+
}
|
|
293
|
+
_emitError(detail) {
|
|
294
|
+
dispatchMonoEvent(this, "error", detail);
|
|
295
|
+
}
|
|
296
|
+
_emitValueEvents(detail) {
|
|
297
|
+
this._emitChange(detail);
|
|
298
|
+
}
|
|
299
|
+
_revokePreviews(files = this.modelValue) {
|
|
300
|
+
files.forEach((item) => {
|
|
301
|
+
if (item.previewUrl) URL.revokeObjectURL(item.previewUrl);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
_openPicker() {
|
|
305
|
+
if (this.disabled) return;
|
|
306
|
+
this._inputEl?.click();
|
|
307
|
+
}
|
|
308
|
+
_validateFiles(files, sourceEvent) {
|
|
309
|
+
let nextFiles = files;
|
|
310
|
+
if (this.maxFileSize > 0) {
|
|
311
|
+
const oversized = nextFiles.find((file) => file.size > this.maxFileSize);
|
|
312
|
+
if (oversized) {
|
|
313
|
+
this._emitError({
|
|
314
|
+
message: `File "${oversized.name}" exceeds the maximum size limit.`,
|
|
315
|
+
reason: "max-file-size",
|
|
316
|
+
file: oversized,
|
|
317
|
+
maxFileSize: this.maxFileSize,
|
|
318
|
+
sourceEvent
|
|
319
|
+
});
|
|
320
|
+
nextFiles = nextFiles.filter((file) => file.size <= this.maxFileSize);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (this.maxFiles > 0) {
|
|
324
|
+
const existingCount = this.multiple ? this.modelValue.length : 0;
|
|
325
|
+
const allowed = Math.max(this.maxFiles - existingCount, 0);
|
|
326
|
+
if (nextFiles.length > allowed) {
|
|
327
|
+
this._emitError({
|
|
328
|
+
message: `Only ${this.maxFiles} file(s) are allowed.`,
|
|
329
|
+
reason: "max-files",
|
|
330
|
+
maxFiles: this.maxFiles,
|
|
331
|
+
sourceEvent
|
|
332
|
+
});
|
|
333
|
+
nextFiles = nextFiles.slice(0, allowed);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return nextFiles;
|
|
337
|
+
}
|
|
338
|
+
_addFiles(files, sourceEvent) {
|
|
339
|
+
if (!files.length) return;
|
|
340
|
+
const validFiles = this._validateFiles(files, sourceEvent);
|
|
341
|
+
if (!validFiles.length) return;
|
|
342
|
+
const oldValue = this._cloneValue(this.modelValue);
|
|
343
|
+
const addedFiles = validFiles.map((file) => createUploadItem(file));
|
|
344
|
+
let action = "add";
|
|
345
|
+
if (this.multiple) this.modelValue = [...this.modelValue, ...addedFiles];
|
|
346
|
+
else {
|
|
347
|
+
const replacedFiles = this._cloneValue(this.modelValue);
|
|
348
|
+
this._revokePreviews(replacedFiles);
|
|
349
|
+
this.modelValue = addedFiles.slice(0, 1);
|
|
350
|
+
action = oldValue.length ? "replace" : "add";
|
|
351
|
+
}
|
|
352
|
+
const detail = this._createModelDetail({
|
|
353
|
+
modelValue: this.modelValue,
|
|
354
|
+
oldValue,
|
|
355
|
+
addedFiles,
|
|
356
|
+
action,
|
|
357
|
+
sourceEvent
|
|
358
|
+
});
|
|
359
|
+
this._emitValueEvents(detail);
|
|
360
|
+
}
|
|
361
|
+
_handleInputChange(event) {
|
|
362
|
+
const input = event.currentTarget;
|
|
363
|
+
const files = Array.from(input.files ?? []);
|
|
364
|
+
this._addFiles(files, event);
|
|
365
|
+
input.value = "";
|
|
366
|
+
}
|
|
367
|
+
_handleDragOver(event) {
|
|
368
|
+
if (!this.dragdrop || this.disabled) return;
|
|
369
|
+
event.preventDefault();
|
|
370
|
+
this._dragOver = true;
|
|
371
|
+
}
|
|
372
|
+
_handleDragLeave() {
|
|
373
|
+
this._dragOver = false;
|
|
374
|
+
}
|
|
375
|
+
_handleDrop(event) {
|
|
376
|
+
if (!this.dragdrop || this.disabled) return;
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
this._dragOver = false;
|
|
379
|
+
const files = Array.from(event.dataTransfer?.files ?? []);
|
|
380
|
+
this._addFiles(files, event);
|
|
381
|
+
}
|
|
382
|
+
_removeFile(id, sourceEvent) {
|
|
383
|
+
const removedFile = this.modelValue.find((file) => file.id === id);
|
|
384
|
+
if (!removedFile) return;
|
|
385
|
+
const oldValue = this._cloneValue(this.modelValue);
|
|
386
|
+
if (removedFile.previewUrl) URL.revokeObjectURL(removedFile.previewUrl);
|
|
387
|
+
this.modelValue = this.modelValue.filter((file) => file.id !== id);
|
|
388
|
+
const detail = this._createModelDetail({
|
|
389
|
+
modelValue: this.modelValue,
|
|
390
|
+
oldValue,
|
|
391
|
+
removedFile,
|
|
392
|
+
action: "remove",
|
|
393
|
+
sourceEvent
|
|
394
|
+
});
|
|
395
|
+
this._emitRemove({
|
|
396
|
+
...detail,
|
|
397
|
+
removedFile,
|
|
398
|
+
action: "remove"
|
|
399
|
+
});
|
|
400
|
+
this._emitValueEvents(detail);
|
|
401
|
+
}
|
|
402
|
+
clear() {
|
|
403
|
+
if (!this.modelValue.length) return;
|
|
404
|
+
const oldValue = this._cloneValue(this.modelValue);
|
|
405
|
+
this._revokePreviews();
|
|
406
|
+
this.modelValue = [];
|
|
407
|
+
const detail = this._createModelDetail({
|
|
408
|
+
modelValue: this.modelValue,
|
|
409
|
+
oldValue,
|
|
410
|
+
action: "clear"
|
|
411
|
+
});
|
|
412
|
+
this._emitValueEvents(detail);
|
|
413
|
+
}
|
|
414
|
+
/** Shadow build returns true to render the icon via a native `<slot>`. */
|
|
415
|
+
_useIconSlots() {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
/** Default dropzone glyph. Shadow build overrides with an inline SVG. */
|
|
419
|
+
_renderDefaultGlyph() {
|
|
420
|
+
return html`<span
|
|
421
|
+
class="mono-file-upload-default-icon i-mdi-cloud-upload-outline"
|
|
422
|
+
mono-glyph
|
|
423
|
+
aria-hidden="true"
|
|
424
|
+
></span>`;
|
|
425
|
+
}
|
|
426
|
+
_renderDropzoneIcon() {
|
|
427
|
+
const cls = this._cls("mono-file-upload-icon", "icon");
|
|
428
|
+
if (this._hasIconSlot) return html`<div class=${cls} mono-icon aria-hidden="true"><span data-mono-slot="icon"></span></div>`;
|
|
429
|
+
if (this.icon && isIconifyClass(this.icon)) return html`<div class=${cls} mono-icon aria-hidden="true"><span class=${`mono-file-upload-iconify ${this.icon}`} mono-glyph></span></div>`;
|
|
430
|
+
if (this.icon) return html`<div class=${cls} mono-icon aria-hidden="true">${this.icon}</div>`;
|
|
431
|
+
return html`<div class=${cls} mono-icon aria-hidden="true">${this._renderDefaultGlyph()}</div>`;
|
|
432
|
+
}
|
|
433
|
+
/** Classes of the secondary line — the new `subtitle` key and the old `subtext` one. */
|
|
434
|
+
get _subtitleClasses() {
|
|
435
|
+
return [
|
|
436
|
+
"mono-file-upload-subtitle",
|
|
437
|
+
"mono-file-upload-subtext",
|
|
438
|
+
this.cssClass?.subtitle ?? "",
|
|
439
|
+
this.cssClass?.subtext ?? ""
|
|
440
|
+
].filter(Boolean).join(" ");
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Dropzone headline. A `slot="title"` child beats the prop: the light build
|
|
444
|
+
* renders an empty `[data-mono-slot]` region it re-parents the captured node
|
|
445
|
+
* into; the shadow build overrides this with a native `<slot>` whose fallback
|
|
446
|
+
* is the prop text. (A separate template per branch — Lit's trailing child
|
|
447
|
+
* part would otherwise clear nodes appended after it.)
|
|
448
|
+
*/
|
|
449
|
+
_renderTitle() {
|
|
450
|
+
const cls = this._cls("mono-file-upload-title", "title");
|
|
451
|
+
if (this._hasTitleSlot) return html`<div class=${cls} mono-title data-mono-slot="title"></div>`;
|
|
452
|
+
return html`<div class=${cls} mono-title ?mono-empty=${!this.title}>${this.title}</div>`;
|
|
453
|
+
}
|
|
454
|
+
/** Dropzone secondary line — `mono-subtitle`, plus the old `mono-subtext` hook. */
|
|
455
|
+
_renderSubtitle() {
|
|
456
|
+
const cls = this._subtitleClasses;
|
|
457
|
+
if (this._hasSubtitleSlot) return html`<div class=${cls} mono-subtitle mono-subtext data-mono-slot="subtitle"></div>`;
|
|
458
|
+
return html`<div class=${cls} mono-subtitle mono-subtext ?mono-empty=${!this.subtitle}>${this.subtitle}</div>`;
|
|
459
|
+
}
|
|
460
|
+
_renderRemoveIcon() {
|
|
461
|
+
if (this.removeIcon && isIconifyClass(this.removeIcon)) return html`<span class=${`mono-file-upload-iconify ${this.removeIcon}`} mono-glyph></span>`;
|
|
462
|
+
if (this.removeIcon) return html`${this.removeIcon}`;
|
|
463
|
+
return html`<span class="mono-file-upload-iconify mono-icon i-mdi-close" mono-glyph aria-hidden="true"></span>`;
|
|
464
|
+
}
|
|
465
|
+
/** File-type thumb glyph (non-image). Shadow build overrides with an inline SVG. */
|
|
466
|
+
_renderThumbGlyph(item) {
|
|
467
|
+
const icon = getFileIcon(item.type, item.name);
|
|
468
|
+
return isIconifyClass(icon) ? html`<span class=${`mono-file-upload-iconify ${icon}`} mono-glyph aria-hidden="true"></span>` : html`${icon}`;
|
|
469
|
+
}
|
|
470
|
+
_renderMessage() {
|
|
471
|
+
const extra = this.cssClass?.message ?? "";
|
|
472
|
+
if (this.validationMessage) return html`
|
|
473
|
+
<div
|
|
474
|
+
class="mono-file-upload-message ${this.validationState} ${extra}"
|
|
475
|
+
mono-message=${this.validationState}
|
|
476
|
+
role=${this.validationState === "invalid" ? "alert" : nothing}
|
|
477
|
+
>
|
|
478
|
+
${this.validationMessage}
|
|
479
|
+
</div>
|
|
480
|
+
`;
|
|
481
|
+
if (this.helperText) return html`
|
|
482
|
+
<div class="mono-file-upload-message helper ${extra}" mono-message="helper">${this.helperText}</div>
|
|
483
|
+
`;
|
|
484
|
+
return nothing;
|
|
485
|
+
}
|
|
486
|
+
_renderList() {
|
|
487
|
+
if (!this.modelValue.length) return nothing;
|
|
488
|
+
return html`
|
|
489
|
+
<div class=${this._cls("mono-file-upload-list", "list")} mono-list>
|
|
490
|
+
${this.modelValue.map((item) => html`
|
|
491
|
+
<div class=${this._cls("mono-file-upload-item", "item")} mono-item>
|
|
492
|
+
<div class=${this._cls("mono-file-upload-thumb", "thumb")} mono-thumb>
|
|
493
|
+
${item.previewUrl ? html`<img src=${item.previewUrl} alt=${item.name} />` : this._renderThumbGlyph(item)}
|
|
494
|
+
</div>
|
|
495
|
+
|
|
496
|
+
<div class=${this._cls("mono-file-upload-file", "file")} mono-file>
|
|
497
|
+
<div class=${this._cls("mono-file-upload-name", "name")} mono-name>${item.name}</div>
|
|
498
|
+
<div class=${this._cls("mono-file-upload-meta", "meta")} mono-meta>${formatFileSize(item.size)}</div>
|
|
499
|
+
</div>
|
|
500
|
+
|
|
501
|
+
<button
|
|
502
|
+
type="button"
|
|
503
|
+
class=${this._cls("mono-file-upload-remove", "remove")}
|
|
504
|
+
mono-remove
|
|
505
|
+
aria-label=${ifDefined(`Remove ${item.name}`)}
|
|
506
|
+
@click=${(event) => this._removeFile(item.id, event)}
|
|
507
|
+
>
|
|
508
|
+
${this._renderRemoveIcon()}
|
|
509
|
+
</button>
|
|
510
|
+
</div>
|
|
511
|
+
`)}
|
|
512
|
+
</div>
|
|
513
|
+
`;
|
|
514
|
+
}
|
|
515
|
+
render() {
|
|
516
|
+
return html`
|
|
517
|
+
<div
|
|
518
|
+
class=${this._wrapperClasses}
|
|
519
|
+
mono-file-upload
|
|
520
|
+
mono-variant=${this.variant === "default" ? nothing : this.variant}
|
|
521
|
+
mono-validation-state=${this.validationState === "default" ? nothing : this.validationState}
|
|
522
|
+
?mono-disabled=${this.disabled}
|
|
523
|
+
?mono-required=${this.required}
|
|
524
|
+
?mono-multiple=${this.multiple}
|
|
525
|
+
?mono-no-dragdrop=${!this.dragdrop}
|
|
526
|
+
?mono-dragover=${this._dragOver}
|
|
527
|
+
title=""
|
|
528
|
+
>
|
|
529
|
+
${this.label ? html`
|
|
530
|
+
<label class=${this._cls("mono-file-upload-label", "label")} mono-label>
|
|
531
|
+
${this.label}
|
|
532
|
+
${this.required ? html`<span class=${this._cls("mono-file-upload-required", "required")} mono-required-mark>*</span>` : nothing}
|
|
533
|
+
</label>
|
|
534
|
+
` : nothing}
|
|
535
|
+
|
|
536
|
+
<div
|
|
537
|
+
class=${this._cls("mono-file-upload-dropzone", "dropzone")}
|
|
538
|
+
mono-dropzone
|
|
539
|
+
@click=${this._openPicker}
|
|
540
|
+
@dragover=${this._handleDragOver}
|
|
541
|
+
@dragleave=${this._handleDragLeave}
|
|
542
|
+
@drop=${this._handleDrop}
|
|
543
|
+
>
|
|
544
|
+
${this._renderDropzoneIcon()}
|
|
545
|
+
${this._renderTitle()}
|
|
546
|
+
${this._renderSubtitle()}
|
|
547
|
+
|
|
548
|
+
<input
|
|
549
|
+
class=${this._cls("mono-file-upload-input", "input")}
|
|
550
|
+
mono-native
|
|
551
|
+
type="file"
|
|
552
|
+
accept=${ifDefined(this.accept || void 0)}
|
|
553
|
+
?multiple=${this.multiple}
|
|
554
|
+
?disabled=${this.disabled}
|
|
555
|
+
@change=${this._handleInputChange}
|
|
556
|
+
/>
|
|
557
|
+
</div>
|
|
558
|
+
|
|
559
|
+
${this._renderList()}
|
|
560
|
+
${this._renderMessage()}
|
|
561
|
+
</div>
|
|
562
|
+
`;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "label", void 0);
|
|
566
|
+
__decorate([property({
|
|
567
|
+
type: String,
|
|
568
|
+
attribute: "helper-text"
|
|
569
|
+
})], MonoFileUploadCoreClass.prototype, "helperText", void 0);
|
|
570
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "title", void 0);
|
|
571
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "subtitle", void 0);
|
|
572
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "icon", void 0);
|
|
573
|
+
__decorate([property({
|
|
574
|
+
type: String,
|
|
575
|
+
attribute: "remove-icon"
|
|
576
|
+
})], MonoFileUploadCoreClass.prototype, "removeIcon", void 0);
|
|
577
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "accept", void 0);
|
|
578
|
+
__decorate([property({
|
|
579
|
+
reflect: true,
|
|
580
|
+
converter: booleanStringConverter
|
|
581
|
+
})], MonoFileUploadCoreClass.prototype, "multiple", void 0);
|
|
582
|
+
__decorate([property({
|
|
583
|
+
reflect: true,
|
|
584
|
+
converter: booleanStringConverter
|
|
585
|
+
})], MonoFileUploadCoreClass.prototype, "disabled", void 0);
|
|
586
|
+
__decorate([property({
|
|
587
|
+
reflect: true,
|
|
588
|
+
converter: booleanStringConverter
|
|
589
|
+
})], MonoFileUploadCoreClass.prototype, "required", void 0);
|
|
590
|
+
__decorate([property({
|
|
591
|
+
reflect: true,
|
|
592
|
+
converter: booleanStringConverter
|
|
593
|
+
})], MonoFileUploadCoreClass.prototype, "dragdrop", void 0);
|
|
594
|
+
__decorate([property({
|
|
595
|
+
attribute: "max-file-size",
|
|
596
|
+
converter: numberStringConverter
|
|
597
|
+
})], MonoFileUploadCoreClass.prototype, "maxFileSize", void 0);
|
|
598
|
+
__decorate([property({
|
|
599
|
+
attribute: "max-files",
|
|
600
|
+
converter: numberStringConverter
|
|
601
|
+
})], MonoFileUploadCoreClass.prototype, "maxFiles", void 0);
|
|
602
|
+
__decorate([property({
|
|
603
|
+
attribute: false,
|
|
604
|
+
hasChanged: arrayHasChanged
|
|
605
|
+
})], MonoFileUploadCoreClass.prototype, "modelValue", void 0);
|
|
606
|
+
__decorate([property({ attribute: false })], MonoFileUploadCoreClass.prototype, "cssClass", void 0);
|
|
607
|
+
__decorate([property({ type: String })], MonoFileUploadCoreClass.prototype, "variant", void 0);
|
|
608
|
+
__decorate([property({
|
|
609
|
+
type: String,
|
|
610
|
+
attribute: "validation-state"
|
|
611
|
+
})], MonoFileUploadCoreClass.prototype, "validationState", void 0);
|
|
612
|
+
__decorate([property({
|
|
613
|
+
type: String,
|
|
614
|
+
attribute: "validation-message"
|
|
615
|
+
})], MonoFileUploadCoreClass.prototype, "validationMessage", void 0);
|
|
616
|
+
__decorate([state()], MonoFileUploadCoreClass.prototype, "_dragOver", void 0);
|
|
617
|
+
__decorate([state()], MonoFileUploadCoreClass.prototype, "_hasIconSlot", void 0);
|
|
618
|
+
__decorate([state()], MonoFileUploadCoreClass.prototype, "_hasTitleSlot", void 0);
|
|
619
|
+
__decorate([state()], MonoFileUploadCoreClass.prototype, "_hasSubtitleSlot", void 0);
|
|
620
|
+
__decorate([query(".mono-file-upload-input")], MonoFileUploadCoreClass.prototype, "_inputEl", void 0);
|
|
621
|
+
return MonoFileUploadCoreClass;
|
|
622
|
+
};
|
|
623
|
+
//#endregion
|
|
624
|
+
//#region src/components/file-upload/file-upload.css?raw
|
|
625
|
+
var file_upload_default = "/* =========================================================================\r\n mono-file-upload — a port of Basecoat's `.empty` (the dropzone) and `.item`\r\n (the file rows) inside a `.field` (basecoat-css@1.0.2, vega style).\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-file-upload variant=\"compact\" label=\"Docs\" title=\"Drop here\" subtitle=\"PDF, DOCX\">\r\n <div mono-file-upload mono-variant=\"compact\">\r\n <label mono-label>Docs</label>\r\n <label mono-dropzone>\r\n <span mono-icon><span mono-glyph class=\"i-mdi-cloud-upload-outline\"></span></span>\r\n <span mono-title>Drop here</span>\r\n <span mono-subtitle>PDF, DOCX</span>\r\n <input mono-native type=\"file\" />\r\n </label>\r\n <div mono-list>\r\n <div mono-item>\r\n <span mono-thumb>…</span>\r\n <span mono-file><span mono-name>a.pdf</span><span mono-meta>12 KB</span></span>\r\n <button mono-remove type=\"button\">…</button>\r\n </div>\r\n </div>\r\n <div mono-message=\"helper\">…</div>\r\n </div>\r\n\r\n An absent attribute is the prop's default (`:not([mono-variant])` = default,\r\n no `mono-validation-state` = default). The element renders these on its root\r\n (both builds) plus the states `mono-disabled` / `mono-required` /\r\n `mono-multiple` / `mono-no-dragdrop` (drag-drop is ON by default, so the\r\n attribute marks the exception) and the live `mono-dragover`. The old\r\n classes (`.mono-file-upload.compact.invalid`) are still emitted as inert\r\n hooks until 2.0 but no rule here reads them.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-file-upload] ≡ .field (flex w-full flex-col gap-3)\r\n [mono-label] ≡ .field > label / .label (text-sm leading-snug font-medium)\r\n [mono-dropzone] ≡ .empty (flex flex-col items-center justify-center text-center\r\n text-balance, gap-4 rounded-lg border-dashed p-12) — the border\r\n WIDTH is the `border` utility upstream puts in the markup, and\r\n the gap is `.empty > header`'s gap-2 because our title and\r\n subtext are flat siblings, not a nested <header>\r\n [mono-icon] ≡ .empty figure + .empty figure:has(> svg:only-child)\r\n (mb-2, bg-muted text-foreground size-10 rounded-lg, glyph size-6)\r\n [mono-title] ≡ .empty :is(h2, h3, h4) (text-lg font-medium tracking-tight)\r\n [mono-subtitle]/[mono-subtext] ≡ .empty > header > p (text-sm/relaxed text-muted-foreground)\r\n [mono-native] ≡ .field > input[type='file'] — HIDDEN here: the whole dropzone\r\n is the picker, so the native control never shows\r\n [mono-list] ≡ .item-group (flex w-full flex-col, gap-2.5 beside sm items)\r\n [mono-item] ≡ .item[data-variant='outline'][data-size='sm']\r\n (flex flex-wrap items-center border-border rounded-md text-sm,\r\n gap-2.5 px-3 py-2.5, transition-colors)\r\n [mono-thumb] ≡ .item > figure:has(> img) at sm (size-8 rounded-sm overflow-hidden,\r\n img size-full object-cover) + figure:has(> svg:only-child) (glyph size-4)\r\n [mono-file] ≡ .item > section (flex flex-1 flex-col gap-1)\r\n [mono-name] ≡ .item :is(h2, h3, h4) (line-clamp-1 text-sm/snug font-medium)\r\n [mono-meta] ≡ .item p (text-sm/normal text-muted-foreground line-clamp-2)\r\n [mono-remove] ≡ .btn[data-variant='ghost'][data-size='icon-sm']\r\n (size-8 rounded-[min(radius-md,10px)] hover:bg-muted, glyph size-4)\r\n [mono-message=\"…\"] ≡ .field > p / .field [role='alert'] (text-sm, destructive when invalid)\r\n [mono-validation-state=\"invalid\"] ≡ aria-invalid:border-destructive aria-invalid:ring-destructive/20\r\n [mono-validation-state=\"valid|warning\"] ≡ EXTENSION (the same treatment in --success / --warning)\r\n [mono-variant=\"compact\"] ≡ the `.empty` + `.item` metrics the COMPACT styles use\r\n (nova/lyra/mira: .empty p-6, figure size-8 with a size-4 glyph,\r\n title text-sm; rows drop to .item[data-size='xs'])\r\n [mono-dragover] ≡ EXTENSION (the .item focus-visible treatment: border-ring +\r\n ring-[3px] ring-ring/50, plus an accent tint)\r\n [mono-disabled] ≡ .btn disabled:opacity-50\r\n\r\n Upstream's dropzone is genuinely large — `.empty` is `p-12` — so this port is\r\n TALLER than the pre-Basecoat uploader (which padded 1.2rem). `compact` is the\r\n short one, and `--mono-file-upload-dropzone-padding` is one line either way.\r\n\r\n Specificity contract (same as the pre-port class sheet): a part's RESTING rule\r\n is exactly one attribute strong — `:where([mono-file-upload]) [mono-item]` =\r\n (0,1,0) — so a utility class handed in through `cssClass` wins by source\r\n order, while the prop and state rules stay heavier and win over it.\r\n\r\n The two variants own SEPARATE public knobs (`-dropzone-padding` vs\r\n `-compact-padding`, `-item-padding-x` vs `-compact-item-padding-x`, …): a\r\n flavor writing one shared knob would repaint both looks at once, which is the\r\n bug that made every style's `underlined` textarea come out filled.\r\n\r\n FLAVORS set `--mono-file-upload-{radius,dropzone-padding,dropzone-gap,\r\n icon-offset,icon-size,icon-glyph-size,icon-radius,title-font-size,\r\n title-transform,item-radius,item-padding-*,item-gap,list-gap,thumb-size,\r\n thumb-radius,…}` — the DEFAULT variant's set; `compact` has its own\r\n `--mono-file-upload-compact-*` twins so one look never repaints the other; every fallback\r\n here is vega's value\r\n (`node scripts/basecoat-styles.mjs --varying \"^\\.(empty|item)\"`).\r\n ========================================================================= */\r\n\r\nmono-file-upload {\r\n display: block;\r\n}\r\n\r\n[mono-file-upload] {\r\n /* ── palette: each slot is a public knob over a Basecoat token ─────────── */\r\n --_mono-file-upload-text: var(--mono-file-upload-text, var(--foreground));\r\n --_mono-file-upload-muted: var(--mono-file-upload-muted, var(--muted-foreground));\r\n /* the accent: the dropzone glyph, and the ring the dragover state paints */\r\n --_mono-file-upload-primary: var(--mono-file-upload-primary, var(--primary));\r\n --_mono-file-upload-success: var(--mono-file-upload-success, var(--success));\r\n --_mono-file-upload-danger: var(--mono-file-upload-danger, var(--destructive));\r\n --_mono-file-upload-warning: var(--mono-file-upload-warning, var(--warning));\r\n\r\n /* `-border` is the pre-Basecoat public name for the dropzone edge — kept as\r\n the fallback so a consumer that set it keeps working */\r\n --_mono-file-upload-border-color: var(--mono-file-upload-border-color, var(--mono-file-upload-border, var(--border)));\r\n --_mono-file-upload-border-width: var(--mono-file-upload-border-width, var(--mono-border-width));\r\n --_mono-file-upload-border-style: var(--mono-file-upload-border-style, dashed);\r\n /* .empty has no fill of its own; `-background` is the pre-Basecoat name */\r\n --_mono-file-upload-dropzone-bg: var(--mono-file-upload-dropzone-bg, var(--mono-file-upload-background, transparent));\r\n /* hover: the ghost treatment (bg-muted, dark:bg-muted/50) */\r\n --_mono-file-upload-dropzone-hover-bg: var(--mono-file-upload-dropzone-hover-bg, var(--mono-mode-ghost-hover));\r\n --_mono-file-upload-radius: var(--mono-file-upload-radius, var(--mono-radius-lg));\r\n\r\n --_mono-file-upload-ring-color: var(--mono-file-upload-ring-color, var(--ring));\r\n --_mono-file-upload-ring-width: var(--mono-file-upload-ring-width, var(--mono-ring-width));\r\n --_mono-file-upload-ring-alpha: var(--mono-file-upload-ring-alpha, var(--mono-ring-alpha));\r\n\r\n /* the icon plate — .empty figure:has(> svg:only-child) is a muted square */\r\n --_mono-file-upload-icon-bg: var(--mono-file-upload-icon-bg, var(--muted));\r\n --_mono-file-upload-icon-color: var(--mono-file-upload-icon-color, var(--_mono-file-upload-text));\r\n --_mono-file-upload-icon-radius: var(--mono-file-upload-icon-radius, var(--mono-radius-lg));\r\n\r\n /* the file rows — .item[data-variant='outline'] rings, it does not fill.\r\n `-surface` is the pre-Basecoat name for the row background. */\r\n --_mono-file-upload-item-bg: var(--mono-file-upload-item-bg, var(--mono-file-upload-surface, transparent));\r\n --_mono-file-upload-item-border-color: var(--mono-file-upload-item-border-color, var(--border));\r\n --_mono-file-upload-item-border-width: var(--mono-file-upload-item-border-width, var(--mono-border-width));\r\n --_mono-file-upload-item-radius: var(--mono-file-upload-item-radius, var(--mono-radius-md));\r\n --_mono-file-upload-thumb-bg: var(--mono-file-upload-thumb-bg, var(--muted));\r\n --_mono-file-upload-thumb-radius: var(--mono-file-upload-thumb-radius, var(--mono-radius-sm));\r\n\r\n /* ── the DEFAULT variant's metrics; `compact` re-points every preset ───────\r\n basecoat@1.0.2 styles/vega.css .empty — gap-4 rounded-lg border-dashed p-12;\r\n .empty figure — mb-2; .empty figure:has(> svg:only-child) — size-10 rounded-lg\r\n with a size-6 glyph; .empty :is(h2,h3,h4) — text-lg; .item[data-size='sm'] —\r\n gap-2.5 px-3 py-2.5 with a size-8 image figure; .item-group — gap-2.5 */\r\n --_mono-file-upload-dropzone-padding: var(--_mono-file-upload-dropzone-padding-preset, calc(var(--mono-spacing) * 12));\r\n --_mono-file-upload-dropzone-gap: var(--_mono-file-upload-dropzone-gap-preset, calc(var(--mono-spacing) * 2));\r\n --_mono-file-upload-icon-offset: var(--_mono-file-upload-icon-offset-preset, calc(var(--mono-spacing) * 4));\r\n --_mono-file-upload-icon-size: var(--_mono-file-upload-icon-size-preset, calc(var(--mono-spacing) * 10));\r\n --_mono-file-upload-icon-glyph-size: var(--_mono-file-upload-icon-glyph-size-preset, calc(var(--mono-spacing) * 6));\r\n --_mono-file-upload-title-font-size: var(--_mono-file-upload-title-font-size-preset, var(--mono-text-lg));\r\n --_mono-file-upload-title-line-height: var(--_mono-file-upload-title-line-height-preset, var(--mono-text-lg--lh));\r\n --_mono-file-upload-list-gap: var(--_mono-file-upload-list-gap-preset, calc(var(--mono-spacing) * 2.5));\r\n --_mono-file-upload-item-gap: var(--_mono-file-upload-item-gap-preset, calc(var(--mono-spacing) * 2.5));\r\n --_mono-file-upload-item-padding-x: var(--_mono-file-upload-item-padding-x-preset, calc(var(--mono-spacing) * 3));\r\n --_mono-file-upload-item-padding-y: var(--_mono-file-upload-item-padding-y-preset, calc(var(--mono-spacing) * 2.5));\r\n --_mono-file-upload-file-gap: var(--_mono-file-upload-file-gap-preset, var(--mono-spacing));\r\n --_mono-file-upload-thumb-size: var(--_mono-file-upload-thumb-size-preset, calc(var(--mono-spacing) * 8));\r\n --_mono-file-upload-meta-font-size: var(--_mono-file-upload-meta-font-size-preset, var(--mono-text-sm));\r\n\r\n /* basecoat@1.0.2 components/field.css .field — flex w-full flex-col;\r\n styles/vega.css .field — gap-3 */\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n box-sizing: border-box;\r\n gap: var(--mono-file-upload-gap, calc(var(--mono-spacing) * 3));\r\n color: var(--_mono-file-upload-text);\r\n font-family: inherit;\r\n}\r\n\r\n[mono-file-upload] *,\r\n[mono-file-upload] *::before,\r\n[mono-file-upload] *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n/* The shadow build renders every region and marks the empty ones; this hides\r\n them. It must out-specify the region rules below, hence the root attribute. */\r\n[mono-file-upload] :is([mono-label], [mono-icon], [mono-title], [mono-subtitle], [mono-subtext], [mono-list], [mono-message])[mono-empty] {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n Variants — the DEFAULT look, and the compact one\r\n ========================================= */\r\n\r\n/* `default` is vega's `.empty` + `.item[data-size='sm']`. The knobs are scoped\r\n to the variant so a flavor can restyle one look without touching the other. */\r\n[mono-file-upload]:not([mono-variant=\"compact\"]) {\r\n --_mono-file-upload-dropzone-padding-preset: var(--mono-file-upload-dropzone-padding);\r\n --_mono-file-upload-dropzone-gap-preset: var(--mono-file-upload-dropzone-gap);\r\n --_mono-file-upload-icon-offset-preset: var(--mono-file-upload-icon-offset);\r\n --_mono-file-upload-icon-size-preset: var(--mono-file-upload-icon-size);\r\n --_mono-file-upload-icon-glyph-size-preset: var(--mono-file-upload-icon-glyph-size);\r\n --_mono-file-upload-title-font-size-preset: var(--mono-file-upload-title-font-size);\r\n --_mono-file-upload-title-line-height-preset: var(--mono-file-upload-title-line-height);\r\n --_mono-file-upload-list-gap-preset: var(--mono-file-upload-list-gap);\r\n --_mono-file-upload-item-gap-preset: var(--mono-file-upload-item-gap);\r\n --_mono-file-upload-item-padding-x-preset: var(--mono-file-upload-item-padding-x);\r\n --_mono-file-upload-item-padding-y-preset: var(--mono-file-upload-item-padding-y);\r\n --_mono-file-upload-file-gap-preset: var(--mono-file-upload-file-gap);\r\n --_mono-file-upload-thumb-size-preset: var(--mono-file-upload-thumb-size);\r\n --_mono-file-upload-meta-font-size-preset: var(--mono-file-upload-meta-font-size);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/nova.css .empty — rounded-xl p-6;\r\n styles/nova.css .empty figure:has(> svg:only-child) — size-8 with a size-4 glyph;\r\n styles/nova.css .empty :is(h2, h3, h4) — text-sm;\r\n styles/vega.css .item[data-size='xs'] — gap-2 px-2.5 py-2;\r\n styles/vega.css .item[data-size='xs'] > section — gap-0;\r\n styles/vega.css .item[data-size='xs'] p — text-xs;\r\n styles/vega.css .item[data-size='xs'] > figure:has(> img) — size-6;\r\n styles/vega.css .item-group:has(> .item[data-size='xs']) — gap-2\r\n — DEVIATION: the radius stays the default variant's (a flavor owns that axis). */\r\n[mono-file-upload][mono-variant=\"compact\"] {\r\n --_mono-file-upload-dropzone-padding-preset: var(--mono-file-upload-compact-padding, calc(var(--mono-spacing) * 6));\r\n --_mono-file-upload-dropzone-gap-preset: var(--mono-file-upload-compact-gap, var(--mono-spacing));\r\n --_mono-file-upload-icon-offset-preset: var(--mono-file-upload-compact-icon-offset, calc(var(--mono-spacing) * 3));\r\n --_mono-file-upload-icon-size-preset: var(--mono-file-upload-compact-icon-size, calc(var(--mono-spacing) * 8));\r\n --_mono-file-upload-icon-glyph-size-preset: var(--mono-file-upload-compact-icon-glyph-size, calc(var(--mono-spacing) * 4));\r\n --_mono-file-upload-title-font-size-preset: var(--mono-file-upload-compact-title-font-size, var(--mono-text-sm));\r\n --_mono-file-upload-title-line-height-preset: var(--mono-file-upload-compact-title-line-height, var(--mono-leading-snug));\r\n --_mono-file-upload-list-gap-preset: var(--mono-file-upload-compact-list-gap, calc(var(--mono-spacing) * 2));\r\n --_mono-file-upload-item-gap-preset: var(--mono-file-upload-compact-item-gap, calc(var(--mono-spacing) * 2));\r\n --_mono-file-upload-item-padding-x-preset: var(--mono-file-upload-compact-item-padding-x, calc(var(--mono-spacing) * 2.5));\r\n --_mono-file-upload-item-padding-y-preset: var(--mono-file-upload-compact-item-padding-y, calc(var(--mono-spacing) * 2));\r\n --_mono-file-upload-file-gap-preset: var(--mono-file-upload-compact-file-gap, 0px);\r\n --_mono-file-upload-thumb-size-preset: var(--mono-file-upload-compact-thumb-size, calc(var(--mono-spacing) * 6));\r\n --_mono-file-upload-meta-font-size-preset: var(--mono-file-upload-compact-meta-font-size, var(--mono-text-xs));\r\n}\r\n\r\n/* =========================================\r\n Label\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > label, .label — text-sm leading-snug font-medium */\r\n:where([mono-file-upload]) > [mono-label] {\r\n display: inline-flex;\r\n align-items: center;\r\n width: fit-content;\r\n gap: calc(var(--mono-spacing) * 1);\r\n font-size: var(--mono-file-upload-label-font-size, var(--mono-text-sm));\r\n line-height: var(--mono-file-upload-label-line-height, var(--mono-leading-snug));\r\n font-weight: var(--mono-file-upload-label-font-weight, var(--mono-label-font-weight, var(--mono-font-weight-medium)));\r\n color: var(--mono-file-upload-label-color, var(--_mono-file-upload-text));\r\n}\r\n\r\n[mono-file-upload][mono-validation-state=\"invalid\"] > [mono-label] {\r\n color: var(--mono-file-upload-label-color, var(--_mono-file-upload-danger));\r\n}\r\n\r\n:where([mono-file-upload]) [mono-required-mark] {\r\n color: var(--mono-file-upload-required-color, var(--destructive));\r\n}\r\n\r\n/* =========================================\r\n Dropzone — `.empty`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/empty.css .empty — flex w-full min-w-0 flex-col\r\n items-center justify-center text-center text-balance;\r\n styles/vega.css .empty — gap-4 rounded-lg border-dashed p-12\r\n — the border WIDTH comes from the `border` utility upstream writes in markup,\r\n so it is a knob here; `transition-[color,box-shadow]` is the field treatment. */\r\n:where([mono-file-upload]) [mono-dropzone] {\r\n display: flex;\r\n width: 100%;\r\n min-width: 0;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n text-align: center;\r\n text-wrap: balance;\r\n gap: var(--_mono-file-upload-dropzone-gap);\r\n padding: var(--_mono-file-upload-dropzone-padding);\r\n border: var(--_mono-file-upload-border-width) var(--_mono-file-upload-border-style)\r\n var(--_mono-file-upload-border-color);\r\n border-radius: var(--_mono-file-upload-radius);\r\n background-color: var(--_mono-file-upload-dropzone-bg);\r\n cursor: pointer;\r\n transition:\r\n color var(--mono-duration) var(--mono-ease),\r\n background-color var(--mono-duration) var(--mono-ease),\r\n border-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease);\r\n /* the two-slot stack the ports share: the ring is written by a state rule */\r\n box-shadow: var(--_mono-file-upload-ring, 0 0 #0000);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn[data-variant='ghost'] — hover:bg-muted\r\n (dark:hover:bg-muted/50), carried by --mono-mode-ghost-hover */\r\n@media (hover: hover) {\r\n [mono-file-upload]:not([mono-disabled]) [mono-dropzone]:hover {\r\n border-color: var(--mono-file-upload-hover-border-color, var(--_mono-file-upload-primary));\r\n background-color: var(--_mono-file-upload-dropzone-hover-bg);\r\n }\r\n}\r\n\r\n/* EXTENSION — the drag-over state wears the `.item` focus treatment\r\n (basecoat@1.0.2 components/item.css .item — focus-visible:border-ring\r\n focus-visible:ring-[3px] focus-visible:ring-ring/50) in the accent colour */\r\n[mono-file-upload][mono-dragover] [mono-dropzone] {\r\n border-color: var(--_mono-file-upload-primary);\r\n border-style: solid;\r\n background-color: color-mix(in oklab, var(--_mono-file-upload-primary) var(--mono-mode-tint), transparent);\r\n --_mono-file-upload-ring: 0 0 0 var(--_mono-file-upload-ring-width)\r\n color-mix(in oklab, var(--_mono-file-upload-primary) var(--_mono-file-upload-ring-alpha), transparent);\r\n}\r\n\r\n/* basecoat@1.0.2 components/button.css .btn — disabled:pointer-events-none disabled:opacity-50 */\r\n[mono-file-upload][mono-disabled] [mono-dropzone] {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > textarea, .textarea —\r\n aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3\r\n (dark: destructive/50 and /40, carried by the mode tokens) */\r\n[mono-file-upload][mono-validation-state=\"invalid\"] [mono-dropzone] {\r\n border-color: var(--mono-file-upload-invalid-border-color, var(--mono-mode-invalid-border));\r\n --_mono-file-upload-ring: 0 0 0 var(--_mono-file-upload-ring-width) var(--mono-mode-invalid-ring);\r\n}\r\n\r\n/* EXTENSION — the same treatment in --success / --warning */\r\n[mono-file-upload][mono-validation-state=\"valid\"] [mono-dropzone] {\r\n border-color: var(--_mono-file-upload-success);\r\n --_mono-file-upload-ring: 0 0 0 var(--_mono-file-upload-ring-width)\r\n color-mix(in oklab, var(--_mono-file-upload-success) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n\r\n[mono-file-upload][mono-validation-state=\"warning\"] [mono-dropzone] {\r\n border-color: var(--_mono-file-upload-warning);\r\n --_mono-file-upload-ring: 0 0 0 var(--_mono-file-upload-ring-width)\r\n color-mix(in oklab, var(--_mono-file-upload-warning) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n\r\n/* =========================================\r\n Dropzone contents — figure, title, subtext\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .empty figure — mb-2;\r\n styles/vega.css .empty figure:has(> svg:only-child) — bg-muted text-foreground\r\n flex size-10 shrink-0 items-center justify-center rounded-lg\r\n — DEVIATION: keyed off the part attribute, not `:has(> svg:only-child)`: the\r\n light build paints the glyph with an `i-*` MASK span and the shadow build with\r\n an inline <svg>, so a shape test would style one build and not the other. */\r\n:where([mono-file-upload]) [mono-icon] {\r\n display: flex;\r\n flex-shrink: 0;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-file-upload-icon-size);\r\n height: var(--_mono-file-upload-icon-size);\r\n margin-bottom: var(--_mono-file-upload-icon-offset);\r\n border-radius: var(--_mono-file-upload-icon-radius);\r\n background-color: var(--_mono-file-upload-icon-bg);\r\n color: var(--_mono-file-upload-icon-color);\r\n font-size: var(--_mono-file-upload-icon-glyph-size);\r\n line-height: 1;\r\n overflow: hidden;\r\n}\r\n\r\n/* `[&_svg:not([class*='size-'])]:size-6` — our glyph is a mask span (light) or an\r\n inline SVG (shadow); both are sized by the same box. Only [mono-glyph] is\r\n touched: a slotted custom icon is light DOM in BOTH builds, so a bare `svg`\r\n descendant rule would reach it in light and not in shadow. */\r\n:where([mono-file-upload]) [mono-icon] [mono-glyph] {\r\n display: block;\r\n width: var(--_mono-file-upload-icon-glyph-size);\r\n height: var(--_mono-file-upload-icon-glyph-size);\r\n flex-shrink: 0;\r\n color: inherit;\r\n}\r\n\r\n:where([mono-file-upload]) [mono-icon] [mono-glyph] > svg {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .empty :is(h2, h3, h4) — text-lg font-medium tracking-tight */\r\n:where([mono-file-upload]) [mono-title] {\r\n font-size: var(--_mono-file-upload-title-font-size);\r\n line-height: var(--_mono-file-upload-title-line-height);\r\n font-weight: var(--mono-file-upload-title-font-weight, var(--mono-font-weight-medium));\r\n letter-spacing: var(--mono-file-upload-title-tracking, var(--mono-tracking-tight));\r\n text-transform: var(--mono-file-upload-title-transform, none);\r\n color: var(--_mono-file-upload-text);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .empty > header > p — text-muted-foreground text-sm/relaxed\r\n `mono-subtitle` is the current part name; the element still emits the old\r\n `mono-subtext` beside it, and hand-written markup may use either. The CSS vars\r\n keep their `-subtext-` names. */\r\n:where([mono-file-upload]) :is([mono-subtitle], [mono-subtext]) {\r\n font-size: var(--mono-file-upload-subtext-font-size, var(--mono-text-sm));\r\n line-height: var(--mono-file-upload-subtext-line-height, var(--mono-leading-relaxed));\r\n color: var(--mono-file-upload-subtext-color, var(--_mono-file-upload-muted));\r\n}\r\n\r\n/* The whole dropzone IS the picker — the native control never shows. */\r\n:where([mono-file-upload]) [mono-native] {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n File list — `.item-group` and `.item`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/item.css .item-group — flex w-full flex-col;\r\n styles/vega.css .item-group:has(> .item[data-size='sm']) — gap-2.5 */\r\n:where([mono-file-upload]) [mono-list] {\r\n display: flex;\r\n width: 100%;\r\n flex-direction: column;\r\n gap: var(--_mono-file-upload-list-gap);\r\n}\r\n\r\n/* basecoat@1.0.2 components/item.css .item — flex w-full flex-wrap items-center\r\n border transition-colors duration-100 outline-none;\r\n styles/vega.css .item — rounded-md border text-sm;\r\n styles/vega.css .item[data-variant='outline'] — border-border;\r\n styles/vega.css .item[data-size='sm'] — gap-2.5 px-3 py-2.5 */\r\n:where([mono-file-upload]) [mono-item] {\r\n display: flex;\r\n width: 100%;\r\n flex-wrap: wrap;\r\n align-items: center;\r\n gap: var(--_mono-file-upload-item-gap);\r\n padding-inline: var(--_mono-file-upload-item-padding-x);\r\n padding-block: var(--_mono-file-upload-item-padding-y);\r\n border: var(--_mono-file-upload-item-border-width) solid var(--_mono-file-upload-item-border-color);\r\n border-radius: var(--_mono-file-upload-item-radius);\r\n background-color: var(--_mono-file-upload-item-bg);\r\n font-size: var(--mono-file-upload-item-font-size, var(--mono-text-sm));\r\n transition:\r\n background-color 100ms var(--mono-ease),\r\n border-color 100ms var(--mono-ease);\r\n outline: none;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .item[data-size='sm'] > figure:has(> img) — size-8;\r\n styles/vega.css .item > figure:has(> img) — overflow-hidden rounded-sm;\r\n components/item.css .item > figure:has(> img) — [&_img]:size-full [&_img]:object-cover;\r\n styles/vega.css .item > figure:has(> svg:only-child) — a size-4 glyph */\r\n:where([mono-file-upload]) [mono-thumb] {\r\n display: inline-flex;\r\n flex-shrink: 0;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-file-upload-thumb-size);\r\n height: var(--_mono-file-upload-thumb-size);\r\n overflow: hidden;\r\n border-radius: var(--_mono-file-upload-thumb-radius);\r\n background-color: var(--_mono-file-upload-thumb-bg);\r\n color: var(--mono-file-upload-thumb-color, var(--_mono-file-upload-muted));\r\n font-size: calc(var(--mono-spacing) * 4);\r\n line-height: 1;\r\n}\r\n\r\n:where([mono-file-upload]) [mono-thumb] > img {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n}\r\n\r\n:where([mono-file-upload]) [mono-thumb] [mono-glyph] {\r\n display: block;\r\n width: calc(var(--mono-spacing) * 4);\r\n height: calc(var(--mono-spacing) * 4);\r\n flex-shrink: 0;\r\n}\r\n\r\n:where([mono-file-upload]) [mono-thumb] [mono-glyph] > svg {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* basecoat@1.0.2 components/item.css .item > section — flex flex-1 flex-col;\r\n styles/vega.css .item > section — gap-1 (gap-0 at data-size='xs') */\r\n:where([mono-file-upload]) [mono-file] {\r\n display: flex;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: var(--_mono-file-upload-file-gap);\r\n}\r\n\r\n/* basecoat@1.0.2 components/item.css .item :is(h2, h3, h4) — line-clamp-1 flex\r\n w-fit items-center;\r\n styles/vega.css .item :is(h2, h3, h4) — text-sm leading-snug font-medium\r\n — DEVIATION: one line ellipsised with `text-overflow`, not `line-clamp-1`: a\r\n file name is a single line and must truncate mid-word, which the WebKit box\r\n clamp does not do. */\r\n:where([mono-file-upload]) [mono-name] {\r\n max-width: 100%;\r\n font-size: var(--mono-file-upload-name-font-size, var(--mono-text-sm));\r\n line-height: var(--mono-file-upload-name-line-height, var(--mono-leading-snug));\r\n font-weight: var(--mono-file-upload-name-font-weight, var(--mono-font-weight-medium));\r\n color: var(--_mono-file-upload-text);\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\n/* basecoat@1.0.2 components/item.css .item p — text-muted-foreground line-clamp-2\r\n text-start font-normal;\r\n styles/vega.css .item p — text-sm leading-normal (text-xs at data-size='xs') */\r\n:where([mono-file-upload]) [mono-meta] {\r\n font-size: var(--_mono-file-upload-meta-font-size);\r\n line-height: var(--mono-file-upload-meta-line-height, var(--mono-leading-normal));\r\n font-weight: var(--mono-font-weight-normal);\r\n text-align: start;\r\n color: var(--mono-file-upload-meta-color, var(--_mono-file-upload-muted));\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn[data-variant='ghost'] — hover:bg-muted\r\n hover:text-foreground (dark:hover:bg-muted/50);\r\n styles/vega.css .btn[data-size='icon-sm'] — size-8 rounded-[min(var(--radius-md),10px)]\r\n — DEVIATION: the hover ink is the DANGER role, not `--foreground`: this ghost\r\n button deletes the row it sits in. */\r\n:where([mono-file-upload]) [mono-remove] {\r\n display: inline-flex;\r\n flex-shrink: 0;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--mono-file-upload-remove-size, calc(var(--mono-spacing) * 8));\r\n height: var(--mono-file-upload-remove-size, calc(var(--mono-spacing) * 8));\r\n padding: 0;\r\n border: 0;\r\n border-radius: var(--mono-file-upload-remove-radius, min(var(--mono-radius-md), 10px));\r\n background: transparent;\r\n color: var(--_mono-file-upload-muted);\r\n font: inherit;\r\n font-size: calc(var(--mono-spacing) * 4);\r\n line-height: 1;\r\n cursor: pointer;\r\n transition:\r\n color var(--mono-duration) var(--mono-ease),\r\n background-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease);\r\n box-shadow: var(--_mono-file-upload-remove-ring, 0 0 #0000);\r\n}\r\n\r\n@media (hover: hover) {\r\n :where([mono-file-upload]) [mono-remove]:hover {\r\n background-color: var(--mono-mode-ghost-hover);\r\n color: var(--_mono-file-upload-danger);\r\n }\r\n}\r\n\r\n/* basecoat@1.0.2 components/item.css .item — focus-visible:border-ring\r\n focus-visible:ring-[3px] focus-visible:ring-ring/50 */\r\n:where([mono-file-upload]) [mono-remove]:focus-visible {\r\n outline: none;\r\n color: var(--_mono-file-upload-text);\r\n --_mono-file-upload-remove-ring: 0 0 0 var(--_mono-file-upload-ring-width)\r\n color-mix(in oklab, var(--_mono-file-upload-ring-color) var(--_mono-file-upload-ring-alpha), transparent);\r\n}\r\n\r\n:where([mono-file-upload]) [mono-remove] [mono-glyph] {\r\n display: block;\r\n width: calc(var(--mono-spacing) * 4);\r\n height: calc(var(--mono-spacing) * 4);\r\n flex-shrink: 0;\r\n color: inherit;\r\n}\r\n\r\n:where([mono-file-upload]) [mono-remove] [mono-glyph] > svg {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n[mono-file-upload][mono-disabled] [mono-remove] {\r\n opacity: 0.5;\r\n pointer-events: none;\r\n}\r\n\r\n/* =========================================\r\n Message\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .fieldset legend + p, .field > p, .field section > p\r\n — text-sm text-muted-foreground leading-normal font-normal */\r\n:where([mono-file-upload]) [mono-message] {\r\n font-size: var(--mono-file-upload-message-font-size, var(--mono-text-sm));\r\n line-height: var(--mono-file-upload-message-line-height, var(--mono-leading-normal));\r\n color: var(--mono-file-upload-message-color, var(--_mono-file-upload-muted));\r\n}\r\n\r\n/* basecoat@1.0.2 components/field.css .field >> [role='alert'] — the invalid message\r\n is the destructive one (styles/vega.css gives it text-sm) */\r\n:where([mono-file-upload]) [mono-message=\"invalid\"] {\r\n color: var(--_mono-file-upload-danger);\r\n}\r\n\r\n:where([mono-file-upload]) [mono-message=\"valid\"] {\r\n color: var(--_mono-file-upload-success);\r\n}\r\n\r\n:where([mono-file-upload]) [mono-message=\"warning\"] {\r\n color: var(--_mono-file-upload-warning);\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n :where([mono-file-upload]) :is([mono-dropzone], [mono-item], [mono-remove]) {\r\n transition: none;\r\n }\r\n}\r\n";
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/components/file-upload/mono-file-upload.ts
|
|
628
|
+
/** Named slots the light build captures: the dropzone icon and its two text lines. */
|
|
629
|
+
var FILE_UPLOAD_LIGHT_SLOTS = [
|
|
630
|
+
"icon",
|
|
631
|
+
"title",
|
|
632
|
+
"subtitle"
|
|
633
|
+
];
|
|
634
|
+
var MonoFileUpload = class MonoFileUpload extends MonoFileUploadCore(LitElement) {
|
|
635
|
+
constructor(..._args) {
|
|
636
|
+
super(..._args);
|
|
637
|
+
this._slotsCaptured = false;
|
|
638
|
+
this._slots = {
|
|
639
|
+
icon: [],
|
|
640
|
+
title: [],
|
|
641
|
+
subtitle: []
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
static {
|
|
645
|
+
this.styles = [unsafeCSS(file_upload_default)];
|
|
646
|
+
}
|
|
647
|
+
createRenderRoot() {
|
|
648
|
+
return this;
|
|
649
|
+
}
|
|
650
|
+
connectedCallback() {
|
|
651
|
+
super.connectedCallback();
|
|
652
|
+
this._captureSlots();
|
|
653
|
+
if (this.isConnected) this.performUpdate();
|
|
654
|
+
}
|
|
655
|
+
updated(changed) {
|
|
656
|
+
super.updated?.(changed);
|
|
657
|
+
for (const name of FILE_UPLOAD_LIGHT_SLOTS) {
|
|
658
|
+
this._placeSlot(name, this._slots[name]);
|
|
659
|
+
this._parked = parkDetachedNodes(this._parked, this._slots[name]);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
/** Move light-DOM `slot="icon|title|subtitle"` children out for placement into their regions. */
|
|
663
|
+
_captureSlots() {
|
|
664
|
+
if (this._slotsCaptured) return;
|
|
665
|
+
this._slotsCaptured = true;
|
|
666
|
+
for (const node of monoHostChildNodes(this)) {
|
|
667
|
+
if (!(node instanceof Element)) continue;
|
|
668
|
+
const name = node.getAttribute("slot");
|
|
669
|
+
if (name && FILE_UPLOAD_LIGHT_SLOTS.includes(name)) {
|
|
670
|
+
node.removeAttribute("slot");
|
|
671
|
+
this._slots[name].push(node);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
this._hasIconSlot = this._slots.icon.length > 0;
|
|
675
|
+
this._hasTitleSlot = this._slots.title.length > 0;
|
|
676
|
+
this._hasSubtitleSlot = this._slots.subtitle.length > 0;
|
|
677
|
+
for (const name of FILE_UPLOAD_LIGHT_SLOTS) for (const node of this._slots[name]) if (node.parentNode === this) this.removeChild(node);
|
|
678
|
+
}
|
|
679
|
+
_placeSlot(name, nodes) {
|
|
680
|
+
if (!nodes.length) return;
|
|
681
|
+
const target = this.querySelector(`[data-mono-slot="${name}"]`);
|
|
682
|
+
if (!target) return;
|
|
683
|
+
for (const node of nodes) placeSlotNode(target, node);
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
MonoFileUpload = __decorate([customElement("mono-file-upload")], MonoFileUpload);
|
|
687
|
+
//#endregion
|
|
688
|
+
export { MonoFileUpload, createUploadItem, formatFileSize, getFileIcon, validateFileUploadProps };
|