@yewdiel21/motion-kit 0.10.0 → 0.15.0
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/README.md +81 -0
- package/bin/motion-kit.mjs +3 -3
- package/dist/auto/index.d.ts +56 -3
- package/dist/auto/index.js +107 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-XAKC2QY7.js → chunk-6IRJYXJU.js} +3 -28
- package/dist/chunk-6IRJYXJU.js.map +1 -0
- package/dist/chunk-A6QQCF6V.js +21333 -0
- package/dist/chunk-A6QQCF6V.js.map +1 -0
- package/dist/chunk-JXRS3OEA.js +3638 -0
- package/dist/chunk-JXRS3OEA.js.map +1 -0
- package/dist/chunk-QP4QJOEN.js +72 -0
- package/dist/chunk-QP4QJOEN.js.map +1 -0
- package/dist/css/components/activity-feed.css +240 -0
- package/dist/css/components/add-to-cart.css +72 -0
- package/dist/css/components/attachment.css +266 -0
- package/dist/css/components/bidirectional-slider.css +168 -0
- package/dist/css/components/breadcrumb.css +110 -0
- package/dist/css/components/chart-tooltip.css +168 -0
- package/dist/css/components/chart.css +296 -0
- package/dist/css/components/code-block.css +264 -0
- package/dist/css/components/color-area.css +82 -0
- package/dist/css/components/color-field.css +67 -0
- package/dist/css/components/color-picker.css +131 -0
- package/dist/css/components/color-slider.css +113 -0
- package/dist/css/components/command-search.css +252 -0
- package/dist/css/components/context-menu.css +23 -0
- package/dist/css/components/credit-card.css +288 -0
- package/dist/css/components/data-table.css +686 -0
- package/dist/css/components/date-range-picker.css +168 -0
- package/dist/css/components/date-time-picker.css +178 -0
- package/dist/css/components/drawer.css +58 -0
- package/dist/css/components/editable-table.css +201 -0
- package/dist/css/components/empty-state.css +61 -0
- package/dist/css/components/file-explorer.css +633 -0
- package/dist/css/components/filter-builder.css +227 -0
- package/dist/css/components/heatmap-chart.css +391 -0
- package/dist/css/components/hold-confirm.css +87 -0
- package/dist/css/components/hover-card.css +19 -7
- package/dist/css/components/image-preview.css +283 -0
- package/dist/css/components/json-viewer.css +304 -0
- package/dist/css/components/like-button.css +78 -0
- package/dist/css/components/link-preview.css +275 -0
- package/dist/css/components/loading-button.css +77 -0
- package/dist/css/components/multi-select.css +267 -0
- package/dist/css/components/nav.css +102 -102
- package/dist/css/components/notification-bell.css +127 -0
- package/dist/css/components/orbit-menu.css +130 -0
- package/dist/css/components/pagination.css +10 -5
- package/dist/css/components/password-strength.css +183 -0
- package/dist/css/components/pie-chart.css +390 -0
- package/dist/css/components/pill-button.css +135 -0
- package/dist/css/components/popover.css +25 -0
- package/dist/css/components/progress.css +140 -0
- package/dist/css/components/questionnaire.css +217 -0
- package/dist/css/components/radar-chart.css +370 -0
- package/dist/css/components/radial-chart.css +398 -0
- package/dist/css/components/range-calendar.css +186 -0
- package/dist/css/components/range-slider.css +192 -0
- package/dist/css/components/resizable-panel.css +243 -0
- package/dist/css/components/rich-text-editor.css +284 -0
- package/dist/css/components/sankey-chart.css +358 -0
- package/dist/css/components/scratch-card.css +75 -0
- package/dist/css/components/scroll-island.css +111 -0
- package/dist/css/components/select.css +136 -0
- package/dist/css/components/skeleton.css +108 -0
- package/dist/css/components/split-view.css +19 -0
- package/dist/css/components/star-rating.css +80 -0
- package/dist/css/components/stat-card.css +164 -0
- package/dist/css/components/swipe-actions.css +105 -0
- package/dist/css/components/tag-input.css +244 -0
- package/dist/css/components/time-field.css +88 -0
- package/dist/css/components/timeline.css +219 -0
- package/dist/css/components/toolbar.css +122 -0
- package/dist/css/components/tooltip.css +79 -0
- package/dist/css/components/tree-view.css +289 -0
- package/dist/css/components/virtual-list.css +195 -0
- package/dist/css/components/voice-dots.css +70 -0
- package/dist/css/tokens.css +185 -181
- package/dist/elements/index.d.ts +849 -7
- package/dist/elements/index.js +1642 -8
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-GDGwQnJE.d.ts → engine-5zRIssTO.d.ts} +11 -1
- package/dist/engine-QECQnGz1.d.ts +33 -0
- package/dist/index.css +10890 -311
- package/dist/index.d.ts +89 -5
- package/dist/index.js +273 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +686 -24
- package/dist/react/index.js +2345 -9
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BmBzKH94.d.ts → reduced-6X_bns60.d.ts} +9 -2
- package/dist/reveal-BfyKKsw4.d.ts +2474 -0
- package/dist/store-CA2Qcun_.d.ts +453 -0
- package/package.json +9 -16
- package/registry.json +1096 -543
- package/src/auto/auto-init.ts +104 -0
- package/src/components/activity-feed/README.md +56 -0
- package/src/components/activity-feed/activity-feed.css +239 -0
- package/src/components/activity-feed/element.ts +36 -0
- package/src/components/activity-feed/engine.ts +351 -0
- package/src/components/activity-feed/react.tsx +32 -0
- package/src/components/add-to-cart/README.md +34 -0
- package/src/components/add-to-cart/add-to-cart.css +71 -0
- package/src/components/add-to-cart/element.ts +20 -0
- package/src/components/add-to-cart/engine.ts +206 -0
- package/src/components/add-to-cart/react.tsx +29 -0
- package/src/components/attachment/README.md +27 -0
- package/src/components/attachment/attachment.css +265 -0
- package/src/components/attachment/element.ts +50 -0
- package/src/components/attachment/engine.ts +469 -0
- package/src/components/attachment/react.tsx +65 -0
- package/src/components/bidirectional-slider/README.md +46 -0
- package/src/components/bidirectional-slider/bidirectional-slider.css +167 -0
- package/src/components/bidirectional-slider/element.ts +42 -0
- package/src/components/bidirectional-slider/engine.ts +289 -0
- package/src/components/bidirectional-slider/react.tsx +45 -0
- package/src/components/breadcrumb/README.md +38 -0
- package/src/components/breadcrumb/breadcrumb.css +109 -0
- package/src/components/breadcrumb/element.ts +27 -0
- package/src/components/breadcrumb/engine.ts +249 -0
- package/src/components/breadcrumb/react.tsx +30 -0
- package/src/components/chart/README.md +34 -0
- package/src/components/chart/chart.css +295 -0
- package/src/components/chart/element.ts +43 -0
- package/src/components/chart/engine.ts +838 -0
- package/src/components/chart/parts.ts +237 -0
- package/src/components/chart/react.tsx +50 -0
- package/src/components/chart/use-chart.ts +55 -0
- package/src/components/chart-tooltip/README.md +53 -0
- package/src/components/chart-tooltip/chart-tooltip.css +167 -0
- package/src/components/chart-tooltip/element.ts +37 -0
- package/src/components/chart-tooltip/engine.ts +442 -0
- package/src/components/chart-tooltip/react.tsx +47 -0
- package/src/components/code-block/README.md +19 -0
- package/src/components/code-block/code-block.css +263 -0
- package/src/components/code-block/element.ts +34 -0
- package/src/components/code-block/engine.ts +254 -0
- package/src/components/code-block/highlight.ts +244 -0
- package/src/components/code-block/react.tsx +94 -0
- package/src/components/color-area/README.md +50 -0
- package/src/components/color-area/color-area.css +81 -0
- package/src/components/color-area/element.ts +26 -0
- package/src/components/color-area/engine.ts +246 -0
- package/src/components/color-area/react.tsx +42 -0
- package/src/components/color-field/README.md +43 -0
- package/src/components/color-field/color-field.css +66 -0
- package/src/components/color-field/element.ts +26 -0
- package/src/components/color-field/engine.ts +174 -0
- package/src/components/color-field/react.tsx +42 -0
- package/src/components/color-picker/README.md +45 -0
- package/src/components/color-picker/color-picker.css +130 -0
- package/src/components/color-picker/element.ts +45 -0
- package/src/components/color-picker/engine.ts +314 -0
- package/src/components/color-picker/react.tsx +47 -0
- package/src/components/color-slider/README.md +55 -0
- package/src/components/color-slider/color-slider.css +112 -0
- package/src/components/color-slider/element.ts +26 -0
- package/src/components/color-slider/engine.ts +234 -0
- package/src/components/color-slider/react.tsx +45 -0
- package/src/components/command-search/README.md +15 -0
- package/src/components/command-search/command-search.css +251 -0
- package/src/components/command-search/element.ts +36 -0
- package/src/components/command-search/engine.ts +356 -0
- package/src/components/command-search/match.ts +53 -0
- package/src/components/command-search/react.tsx +66 -0
- package/src/components/context-menu/README.md +31 -0
- package/src/components/context-menu/context-menu.css +22 -0
- package/src/components/context-menu/element.ts +40 -0
- package/src/components/context-menu/engine.ts +153 -0
- package/src/components/context-menu/react.tsx +57 -0
- package/src/components/credit-card/README.md +20 -0
- package/src/components/credit-card/card.ts +77 -0
- package/src/components/credit-card/credit-card.css +287 -0
- package/src/components/credit-card/element.ts +33 -0
- package/src/components/credit-card/engine.ts +410 -0
- package/src/components/credit-card/react.tsx +36 -0
- package/src/components/data-table/README.md +83 -0
- package/src/components/data-table/data-table.css +685 -0
- package/src/components/data-table/element.ts +54 -0
- package/src/components/data-table/engine.ts +1111 -0
- package/src/components/data-table/react.tsx +94 -0
- package/src/components/date-range-picker/README.md +51 -0
- package/src/components/date-range-picker/date-range-picker.css +167 -0
- package/src/components/date-range-picker/element.ts +52 -0
- package/src/components/date-range-picker/engine.ts +352 -0
- package/src/components/date-range-picker/react.tsx +57 -0
- package/src/components/date-time-picker/README.md +48 -0
- package/src/components/date-time-picker/date-time-picker.css +177 -0
- package/src/components/date-time-picker/element.ts +47 -0
- package/src/components/date-time-picker/engine.ts +350 -0
- package/src/components/date-time-picker/react.tsx +54 -0
- package/src/components/dialog/README.md +103 -102
- package/src/components/dialog/element.ts +123 -118
- package/src/components/dialog/engine.ts +449 -432
- package/src/components/drawer/README.md +28 -0
- package/src/components/drawer/drawer.css +57 -0
- package/src/components/drawer/element.ts +21 -0
- package/src/components/drawer/engine.ts +56 -0
- package/src/components/drawer/react.tsx +85 -0
- package/src/components/editable-table/README.md +67 -0
- package/src/components/editable-table/editable-table.css +200 -0
- package/src/components/editable-table/element.ts +45 -0
- package/src/components/editable-table/engine.ts +831 -0
- package/src/components/editable-table/react.tsx +79 -0
- package/src/components/empty-state/README.md +41 -0
- package/src/components/empty-state/element.ts +23 -0
- package/src/components/empty-state/empty-state.css +60 -0
- package/src/components/empty-state/engine.ts +232 -0
- package/src/components/empty-state/react.tsx +34 -0
- package/src/components/file-explorer/README.md +67 -0
- package/src/components/file-explorer/element.ts +39 -0
- package/src/components/file-explorer/engine.ts +1307 -0
- package/src/components/file-explorer/file-explorer.css +632 -0
- package/src/components/file-explorer/react.tsx +77 -0
- package/src/components/filter-builder/README.md +47 -0
- package/src/components/filter-builder/element.ts +34 -0
- package/src/components/filter-builder/engine.ts +396 -0
- package/src/components/filter-builder/filter-builder.css +226 -0
- package/src/components/filter-builder/react.tsx +36 -0
- package/src/components/heatmap-chart/README.md +48 -0
- package/src/components/heatmap-chart/element.ts +21 -0
- package/src/components/heatmap-chart/engine.ts +281 -0
- package/src/components/heatmap-chart/heatmap-chart.css +93 -0
- package/src/components/heatmap-chart/react.tsx +14 -0
- package/src/components/hold-confirm/README.md +13 -0
- package/src/components/hold-confirm/element.ts +24 -0
- package/src/components/hold-confirm/engine.ts +216 -0
- package/src/components/hold-confirm/hold-confirm.css +86 -0
- package/src/components/hold-confirm/react.tsx +28 -0
- package/src/components/hover-card/README.md +6 -2
- package/src/components/hover-card/engine.ts +98 -7
- package/src/components/hover-card/hover-card.css +19 -7
- package/src/components/image-preview/README.md +16 -0
- package/src/components/image-preview/element.ts +26 -0
- package/src/components/image-preview/engine.ts +405 -0
- package/src/components/image-preview/image-preview.css +282 -0
- package/src/components/image-preview/react.tsx +43 -0
- package/src/components/json-viewer/README.md +56 -0
- package/src/components/json-viewer/element.ts +37 -0
- package/src/components/json-viewer/engine.ts +449 -0
- package/src/components/json-viewer/json-viewer.css +303 -0
- package/src/components/json-viewer/react.tsx +56 -0
- package/src/components/like-button/README.md +13 -0
- package/src/components/like-button/element.ts +47 -0
- package/src/components/like-button/engine.ts +145 -0
- package/src/components/like-button/like-button.css +77 -0
- package/src/components/like-button/react.tsx +39 -0
- package/src/components/link-preview/README.md +19 -0
- package/src/components/link-preview/element.ts +29 -0
- package/src/components/link-preview/engine.ts +192 -0
- package/src/components/link-preview/link-preview.css +274 -0
- package/src/components/link-preview/react.tsx +101 -0
- package/src/components/loading-button/README.md +45 -0
- package/src/components/loading-button/element.ts +34 -0
- package/src/components/loading-button/engine.ts +201 -0
- package/src/components/loading-button/loading-button.css +76 -0
- package/src/components/loading-button/react.tsx +43 -0
- package/src/components/multi-select/README.md +48 -0
- package/src/components/multi-select/element.ts +28 -0
- package/src/components/multi-select/engine.ts +294 -0
- package/src/components/multi-select/multi-select.css +266 -0
- package/src/components/multi-select/react.tsx +39 -0
- package/src/components/nav/README.md +12 -10
- package/src/components/nav/element.ts +5 -5
- package/src/components/nav/engine.ts +21 -14
- package/src/components/nav/nav.css +102 -102
- package/src/components/nav/react.tsx +4 -4
- package/src/components/notification-bell/README.md +14 -0
- package/src/components/notification-bell/element.ts +48 -0
- package/src/components/notification-bell/engine.ts +202 -0
- package/src/components/notification-bell/notification-bell.css +126 -0
- package/src/components/notification-bell/react.tsx +57 -0
- package/src/components/orbit-menu/README.md +46 -0
- package/src/components/orbit-menu/element.ts +27 -0
- package/src/components/orbit-menu/engine.ts +179 -0
- package/src/components/orbit-menu/orbit-menu.css +129 -0
- package/src/components/orbit-menu/react.tsx +44 -0
- package/src/components/pagination/README.md +1 -1
- package/src/components/pagination/engine.ts +50 -4
- package/src/components/pagination/pagination.css +10 -5
- package/src/components/password-strength/README.md +17 -0
- package/src/components/password-strength/element.ts +22 -0
- package/src/components/password-strength/engine.ts +212 -0
- package/src/components/password-strength/password-strength.css +182 -0
- package/src/components/password-strength/react.tsx +36 -0
- package/src/components/password-strength/score.ts +62 -0
- package/src/components/pie-chart/README.md +48 -0
- package/src/components/pie-chart/element.ts +30 -0
- package/src/components/pie-chart/engine.ts +283 -0
- package/src/components/pie-chart/pie-chart.css +92 -0
- package/src/components/pie-chart/react.tsx +14 -0
- package/src/components/pill-button/README.md +46 -0
- package/src/components/pill-button/element.ts +16 -0
- package/src/components/pill-button/engine.ts +77 -0
- package/src/components/pill-button/pill-button.css +134 -0
- package/src/components/pill-button/react.tsx +32 -0
- package/src/components/popover/README.md +44 -0
- package/src/components/popover/element.ts +31 -0
- package/src/components/popover/engine.ts +114 -0
- package/src/components/popover/popover.css +24 -0
- package/src/components/popover/react.tsx +50 -0
- package/src/components/progress/README.md +17 -0
- package/src/components/progress/element.ts +30 -0
- package/src/components/progress/engine.ts +173 -0
- package/src/components/progress/progress.css +139 -0
- package/src/components/progress/react.tsx +35 -0
- package/src/components/questionnaire/README.md +32 -0
- package/src/components/questionnaire/element.ts +118 -0
- package/src/components/questionnaire/engine.ts +255 -0
- package/src/components/questionnaire/questionnaire.css +216 -0
- package/src/components/questionnaire/react.tsx +140 -0
- package/src/components/radar-chart/README.md +48 -0
- package/src/components/radar-chart/element.ts +30 -0
- package/src/components/radar-chart/engine.ts +327 -0
- package/src/components/radar-chart/radar-chart.css +72 -0
- package/src/components/radar-chart/react.tsx +14 -0
- package/src/components/radial-chart/README.md +48 -0
- package/src/components/radial-chart/element.ts +30 -0
- package/src/components/radial-chart/engine.ts +290 -0
- package/src/components/radial-chart/radial-chart.css +100 -0
- package/src/components/radial-chart/react.tsx +14 -0
- package/src/components/range-calendar/README.md +58 -0
- package/src/components/range-calendar/element.ts +42 -0
- package/src/components/range-calendar/engine.ts +390 -0
- package/src/components/range-calendar/range-calendar.css +185 -0
- package/src/components/range-calendar/react.tsx +56 -0
- package/src/components/range-slider/README.md +23 -0
- package/src/components/range-slider/element.ts +53 -0
- package/src/components/range-slider/engine.ts +316 -0
- package/src/components/range-slider/range-slider.css +191 -0
- package/src/components/range-slider/react.tsx +66 -0
- package/src/components/resizable-panel/README.md +61 -0
- package/src/components/resizable-panel/element.ts +36 -0
- package/src/components/resizable-panel/engine.ts +551 -0
- package/src/components/resizable-panel/react.tsx +74 -0
- package/src/components/resizable-panel/resizable-panel.css +242 -0
- package/src/components/rich-text-editor/README.md +57 -0
- package/src/components/rich-text-editor/element.ts +34 -0
- package/src/components/rich-text-editor/engine.ts +673 -0
- package/src/components/rich-text-editor/react.tsx +60 -0
- package/src/components/rich-text-editor/rich-text-editor.css +283 -0
- package/src/components/sankey-chart/README.md +48 -0
- package/src/components/sankey-chart/element.ts +31 -0
- package/src/components/sankey-chart/engine.ts +401 -0
- package/src/components/sankey-chart/react.tsx +14 -0
- package/src/components/sankey-chart/sankey-chart.css +60 -0
- package/src/components/scratch-card/README.md +15 -0
- package/src/components/scratch-card/element.ts +30 -0
- package/src/components/scratch-card/engine.ts +257 -0
- package/src/components/scratch-card/react.tsx +40 -0
- package/src/components/scratch-card/scratch-card.css +74 -0
- package/src/components/scroll-island/README.md +34 -0
- package/src/components/scroll-island/element.ts +16 -0
- package/src/components/scroll-island/engine.ts +252 -0
- package/src/components/scroll-island/react.tsx +26 -0
- package/src/components/scroll-island/scroll-island.css +110 -0
- package/src/components/select/README.md +34 -0
- package/src/components/select/element.ts +26 -0
- package/src/components/select/engine.ts +267 -0
- package/src/components/select/react.tsx +33 -0
- package/src/components/select/select.css +135 -0
- package/src/components/skeleton/README.md +15 -0
- package/src/components/skeleton/element.ts +32 -0
- package/src/components/skeleton/engine.ts +104 -0
- package/src/components/skeleton/react.tsx +41 -0
- package/src/components/skeleton/skeleton.css +107 -0
- package/src/components/split-view/README.md +50 -0
- package/src/components/split-view/element.ts +34 -0
- package/src/components/split-view/engine.ts +114 -0
- package/src/components/split-view/react.tsx +63 -0
- package/src/components/split-view/split-view.css +18 -0
- package/src/components/star-rating/README.md +14 -0
- package/src/components/star-rating/element.ts +26 -0
- package/src/components/star-rating/engine.ts +217 -0
- package/src/components/star-rating/react.tsx +33 -0
- package/src/components/star-rating/star-rating.css +79 -0
- package/src/components/stat-card/README.md +42 -0
- package/src/components/stat-card/element.ts +40 -0
- package/src/components/stat-card/engine.ts +283 -0
- package/src/components/stat-card/react.tsx +36 -0
- package/src/components/stat-card/stat-card.css +163 -0
- package/src/components/swipe-actions/README.md +19 -0
- package/src/components/swipe-actions/element.ts +26 -0
- package/src/components/swipe-actions/engine.ts +260 -0
- package/src/components/swipe-actions/react.tsx +80 -0
- package/src/components/swipe-actions/swipe-actions.css +104 -0
- package/src/components/tag-input/README.md +42 -0
- package/src/components/tag-input/element.ts +39 -0
- package/src/components/tag-input/engine.ts +313 -0
- package/src/components/tag-input/react.tsx +54 -0
- package/src/components/tag-input/tag-input.css +243 -0
- package/src/components/time-field/README.md +54 -0
- package/src/components/time-field/element.ts +38 -0
- package/src/components/time-field/engine.ts +110 -0
- package/src/components/time-field/react.tsx +45 -0
- package/src/components/time-field/time-field.css +87 -0
- package/src/components/timeline/README.md +57 -0
- package/src/components/timeline/element.ts +31 -0
- package/src/components/timeline/engine.ts +300 -0
- package/src/components/timeline/react.tsx +59 -0
- package/src/components/timeline/timeline.css +218 -0
- package/src/components/toolbar/README.md +46 -0
- package/src/components/toolbar/element.ts +30 -0
- package/src/components/toolbar/engine.ts +230 -0
- package/src/components/toolbar/react.tsx +34 -0
- package/src/components/toolbar/toolbar.css +121 -0
- package/src/components/tooltip/README.md +46 -0
- package/src/components/tooltip/element.ts +22 -0
- package/src/components/tooltip/engine.ts +288 -0
- package/src/components/tooltip/react.tsx +30 -0
- package/src/components/tooltip/tooltip.css +78 -0
- package/src/components/tree-view/README.md +61 -0
- package/src/components/tree-view/element.ts +32 -0
- package/src/components/tree-view/engine.ts +743 -0
- package/src/components/tree-view/react.tsx +82 -0
- package/src/components/tree-view/tree-view.css +288 -0
- package/src/components/virtual-list/README.md +81 -0
- package/src/components/virtual-list/element.ts +42 -0
- package/src/components/virtual-list/engine.ts +678 -0
- package/src/components/virtual-list/react.tsx +101 -0
- package/src/components/virtual-list/virtual-list.css +194 -0
- package/src/components/voice-dots/README.md +48 -0
- package/src/components/voice-dots/element.ts +45 -0
- package/src/components/voice-dots/engine.ts +243 -0
- package/src/components/voice-dots/react.tsx +52 -0
- package/src/components/voice-dots/voice-dots.css +69 -0
- package/src/core/chips.ts +196 -0
- package/src/core/color.ts +304 -0
- package/src/core/date-range.ts +67 -0
- package/src/core/dates.ts +11 -1
- package/src/core/files.ts +107 -0
- package/src/core/filter.ts +229 -0
- package/src/core/gsap.ts +80 -65
- package/src/core/listbox.ts +332 -0
- package/src/core/mark.ts +29 -0
- package/src/core/position.ts +89 -0
- package/src/core/relative-time.ts +77 -0
- package/src/core/segment-field.ts +373 -0
- package/src/core/segments.ts +153 -0
- package/src/core/tree.ts +116 -0
- package/src/core/virtual.ts +79 -0
- package/src/css/tokens.css +186 -182
- package/src/elements/index.ts +186 -0
- package/src/index.ts +88 -0
- package/src/motion/liquid.ts +14 -4
- package/src/motion/micro.ts +248 -0
- package/src/motion/sheet.ts +88 -65
- package/src/motion/surface.ts +9 -0
- package/src/react/index.ts +71 -1
- package/dist/chunk-IKQ5FODN.js +0 -1617
- package/dist/chunk-IKQ5FODN.js.map +0 -1
- package/dist/chunk-J6OCFNGU.js +0 -177
- package/dist/chunk-J6OCFNGU.js.map +0 -1
- package/dist/chunk-TFNRIZHU.js +0 -3977
- package/dist/chunk-TFNRIZHU.js.map +0 -1
- package/dist/chunk-XAKC2QY7.js.map +0 -1
- package/dist/reveal-jsX-uwUz.d.ts +0 -625
- package/dist/store-DYb3tTsZ.d.ts +0 -195
package/dist/elements/index.js
CHANGED
|
@@ -1,27 +1,89 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createBidirectionalSlider,
|
|
2
3
|
createChat,
|
|
3
|
-
createChatBackground,
|
|
4
4
|
createCursor,
|
|
5
|
+
createHeatmapChart,
|
|
5
6
|
createIsland,
|
|
6
7
|
createNav,
|
|
7
|
-
|
|
8
|
+
createOrbitMenu,
|
|
9
|
+
createPieChart,
|
|
10
|
+
createPillButton,
|
|
11
|
+
createRadarChart,
|
|
12
|
+
createRadialChart,
|
|
13
|
+
createSankeyChart,
|
|
8
14
|
createThemePicker,
|
|
9
15
|
createToaster,
|
|
16
|
+
createToolbar,
|
|
17
|
+
createVoiceDots,
|
|
10
18
|
iconSvg,
|
|
11
19
|
toast
|
|
12
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-JXRS3OEA.js";
|
|
13
21
|
import {
|
|
22
|
+
createActivityFeed,
|
|
23
|
+
createAddToCart,
|
|
24
|
+
createAttachment,
|
|
25
|
+
createBreadcrumb,
|
|
14
26
|
createCalendar,
|
|
27
|
+
createChart,
|
|
28
|
+
createChartTooltip,
|
|
29
|
+
createChatBackground,
|
|
30
|
+
createCodeBlock,
|
|
31
|
+
createColorArea,
|
|
32
|
+
createColorField,
|
|
33
|
+
createColorPicker,
|
|
34
|
+
createColorSlider,
|
|
35
|
+
createCommandSearch,
|
|
36
|
+
createContextMenu,
|
|
37
|
+
createCreditCard,
|
|
38
|
+
createDataTable,
|
|
39
|
+
createDateRangePicker,
|
|
40
|
+
createDateTimePicker,
|
|
15
41
|
createDialog,
|
|
42
|
+
createDrawer,
|
|
43
|
+
createEditableTable,
|
|
44
|
+
createEmptyState,
|
|
45
|
+
createFileExplorer,
|
|
46
|
+
createFilterBuilder,
|
|
47
|
+
createHoldConfirm,
|
|
16
48
|
createHoverCard,
|
|
49
|
+
createImagePreview,
|
|
17
50
|
createInputOtp,
|
|
51
|
+
createJsonViewer,
|
|
52
|
+
createLikeButton,
|
|
53
|
+
createLinkPreview,
|
|
54
|
+
createLoadingButton,
|
|
18
55
|
createMenu,
|
|
56
|
+
createMultiSelect,
|
|
57
|
+
createNotificationBell,
|
|
19
58
|
createPagination,
|
|
59
|
+
createPasswordStrength,
|
|
60
|
+
createPopover,
|
|
61
|
+
createProgress,
|
|
20
62
|
createQuantity,
|
|
63
|
+
createQuestionnaire,
|
|
64
|
+
createRangeCalendar,
|
|
65
|
+
createRangeSlider,
|
|
66
|
+
createResizablePanel,
|
|
67
|
+
createRichTextEditor,
|
|
68
|
+
createScratchCard,
|
|
69
|
+
createScrollIsland,
|
|
70
|
+
createSelect,
|
|
71
|
+
createSkeleton,
|
|
21
72
|
createSlotPicker,
|
|
73
|
+
createSplitView,
|
|
74
|
+
createStarRating,
|
|
75
|
+
createStatCard,
|
|
76
|
+
createSteps,
|
|
22
77
|
createStudioDock,
|
|
23
|
-
|
|
24
|
-
|
|
78
|
+
createSwipeActions,
|
|
79
|
+
createTagInput,
|
|
80
|
+
createTimeField,
|
|
81
|
+
createTimeline,
|
|
82
|
+
createTooltip,
|
|
83
|
+
createTrailer,
|
|
84
|
+
createTreeView,
|
|
85
|
+
createVirtualList
|
|
86
|
+
} from "../chunk-A6QQCF6V.js";
|
|
25
87
|
import "../chunk-RVSKEBIC.js";
|
|
26
88
|
import "../chunk-DOOMULVV.js";
|
|
27
89
|
import "../chunk-TGV27ZWM.js";
|
|
@@ -195,7 +257,7 @@ var MkDialogElement = class extends MkElement {
|
|
|
195
257
|
dialog.append(body);
|
|
196
258
|
}
|
|
197
259
|
this.append(dialog);
|
|
198
|
-
const engine =
|
|
260
|
+
const engine = this.createEngine(dialog, {
|
|
199
261
|
variant: options.variant ?? "morph",
|
|
200
262
|
placement: options.placement ?? "center",
|
|
201
263
|
backdrop: !options.noBackdrop,
|
|
@@ -204,7 +266,7 @@ var MkDialogElement = class extends MkElement {
|
|
|
204
266
|
float: options.float || false,
|
|
205
267
|
triggers: this.id || false,
|
|
206
268
|
labels: { close: closeLabel }
|
|
207
|
-
});
|
|
269
|
+
}, options);
|
|
208
270
|
this.dialog = engine;
|
|
209
271
|
return {
|
|
210
272
|
destroy: () => {
|
|
@@ -215,6 +277,10 @@ var MkDialogElement = class extends MkElement {
|
|
|
215
277
|
}
|
|
216
278
|
};
|
|
217
279
|
}
|
|
280
|
+
/** The engine on the built <dialog> (Drawer swaps it). */
|
|
281
|
+
createEngine(dialog, options, _attributes) {
|
|
282
|
+
return createDialog(dialog, options);
|
|
283
|
+
}
|
|
218
284
|
open(origin) {
|
|
219
285
|
this.dialog?.open(origin);
|
|
220
286
|
}
|
|
@@ -582,6 +648,1450 @@ var MkSlotPickerElement = class extends MkElement {
|
|
|
582
648
|
}
|
|
583
649
|
};
|
|
584
650
|
|
|
651
|
+
// src/components/attachment/element.ts
|
|
652
|
+
var MkAttachmentElement = class extends MkElement {
|
|
653
|
+
static options = {
|
|
654
|
+
accept: "string",
|
|
655
|
+
multiple: "boolean",
|
|
656
|
+
maxFiles: "number",
|
|
657
|
+
maxSize: "number",
|
|
658
|
+
disabled: "boolean",
|
|
659
|
+
name: "string",
|
|
660
|
+
hint: "string",
|
|
661
|
+
initialFiles: "json"
|
|
662
|
+
};
|
|
663
|
+
create(options) {
|
|
664
|
+
return createAttachment(this, options);
|
|
665
|
+
}
|
|
666
|
+
attributeChangedCallback(name, previous, next) {
|
|
667
|
+
if (previous === next || !this.isConnected || !this.instance) return;
|
|
668
|
+
const files = this.instance.files;
|
|
669
|
+
this.instance.destroy();
|
|
670
|
+
this.instance = this.create({ ...this.options, initialFiles: files });
|
|
671
|
+
}
|
|
672
|
+
addFiles(files) {
|
|
673
|
+
return this.instance?.addFiles(files) ?? [];
|
|
674
|
+
}
|
|
675
|
+
/** Remove one file (HTMLElement.remove() still removes the element). */
|
|
676
|
+
removeFile(id) {
|
|
677
|
+
this.instance?.remove(id);
|
|
678
|
+
}
|
|
679
|
+
setProgress(id, value, status) {
|
|
680
|
+
this.instance?.setProgress(id, value, status);
|
|
681
|
+
}
|
|
682
|
+
get files() {
|
|
683
|
+
return this.instance?.files ?? [];
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// src/components/skeleton/element.ts
|
|
688
|
+
var MkSkeletonElement = class extends MkElement {
|
|
689
|
+
static options = { loaded: "boolean", animation: "string", shape: "string", lines: "number", label: "string" };
|
|
690
|
+
create(options) {
|
|
691
|
+
return createSkeleton(this, { ...options, loading: !options.loaded });
|
|
692
|
+
}
|
|
693
|
+
attributeChangedCallback(name, previous, next) {
|
|
694
|
+
if (previous === next || !this.instance) return;
|
|
695
|
+
if (name === "loaded") this.instance.setLoading(next === null || next === "false");
|
|
696
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
697
|
+
}
|
|
698
|
+
setLoading(loading) {
|
|
699
|
+
this.instance?.setLoading(loading);
|
|
700
|
+
}
|
|
701
|
+
get loading() {
|
|
702
|
+
return this.instance?.loading ?? false;
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
// src/components/questionnaire/element.ts
|
|
707
|
+
var el = (tag, attrs = {}, text) => {
|
|
708
|
+
const element = document.createElement(tag);
|
|
709
|
+
for (const [name, value] of Object.entries(attrs)) element.setAttribute(name, value);
|
|
710
|
+
if (text !== void 0) element.textContent = text;
|
|
711
|
+
return element;
|
|
712
|
+
};
|
|
713
|
+
function buildForm(questions) {
|
|
714
|
+
const form = el("form", { class: "mk-questionnaire", novalidate: "" });
|
|
715
|
+
const progress = el("div", { "data-mk-question-progress": "", "aria-hidden": "true" });
|
|
716
|
+
progress.append(el("span", { "data-mk-question-bar": "" }));
|
|
717
|
+
form.append(progress);
|
|
718
|
+
questions.forEach((question, i) => {
|
|
719
|
+
const titleId = `${question.id}-title`;
|
|
720
|
+
const section = el("section", { "data-mk-question": "", "aria-labelledby": titleId });
|
|
721
|
+
if (i) section.hidden = true;
|
|
722
|
+
section.append(el("p", { "data-mk-question-step": "" }, `Pregunta ${i + 1} de ${questions.length}`));
|
|
723
|
+
const title = el("h3", { id: titleId, "data-mk-step-title": "", "data-mk-flow-item": "" }, question.label);
|
|
724
|
+
if (question.required) title.append(el("span", { "data-mk-question-required": "", "aria-hidden": "true" }, " *"));
|
|
725
|
+
section.append(title);
|
|
726
|
+
if (question.description) section.append(el("p", { "data-mk-question-description": "", "data-mk-flow-item": "" }, question.description));
|
|
727
|
+
const field = el("div", { "data-mk-question-field": "", "data-mk-flow-item": "" });
|
|
728
|
+
if (question.type === "text" || question.type === "textarea") {
|
|
729
|
+
const input = question.type === "text" ? el("input", { type: "text" }) : el("textarea", { rows: "4" });
|
|
730
|
+
input.name = question.id;
|
|
731
|
+
input.required = Boolean(question.required);
|
|
732
|
+
input.setAttribute("aria-labelledby", titleId);
|
|
733
|
+
field.append(input);
|
|
734
|
+
} else {
|
|
735
|
+
const group = el("div", { role: question.type === "single" ? "radiogroup" : "group", "aria-labelledby": titleId, "data-mk-question-options": "" });
|
|
736
|
+
for (const raw of question.options ?? []) {
|
|
737
|
+
const option = typeof raw === "string" ? { value: raw, label: raw } : raw;
|
|
738
|
+
const label = el("label", { "data-mk-question-option": "" });
|
|
739
|
+
const input = el("input", { type: question.type === "single" ? "radio" : "checkbox" });
|
|
740
|
+
input.name = question.id;
|
|
741
|
+
input.value = option.value;
|
|
742
|
+
input.required = Boolean(question.required);
|
|
743
|
+
label.append(input, el("span", {}, option.label));
|
|
744
|
+
group.append(label);
|
|
745
|
+
}
|
|
746
|
+
field.append(group);
|
|
747
|
+
}
|
|
748
|
+
section.append(field);
|
|
749
|
+
const actions = el("div", { "data-mk-question-actions": "", "data-mk-flow-item": "" });
|
|
750
|
+
if (i) actions.append(el("button", { type: "button", class: "mk-button mk-button--text", "data-mk-question-prev": "" }, "Anterior"));
|
|
751
|
+
actions.append(
|
|
752
|
+
i < questions.length - 1 ? el("button", { type: "button", class: "mk-button", "data-mk-question-next": "" }, "Siguiente") : el("button", { type: "submit", class: "mk-button" }, "Finalizar")
|
|
753
|
+
);
|
|
754
|
+
section.append(actions);
|
|
755
|
+
form.append(section);
|
|
756
|
+
});
|
|
757
|
+
form.append(el("p", { "data-mk-question-error": "", role: "alert" }));
|
|
758
|
+
const done = el("div", { "data-mk-question-complete": "" });
|
|
759
|
+
done.hidden = true;
|
|
760
|
+
done.append(el("p", {}, "\xA1Gracias! Respuestas enviadas."), el("button", { type: "reset", class: "mk-button mk-button--tonal" }, "Empezar de nuevo"));
|
|
761
|
+
form.append(done);
|
|
762
|
+
return form;
|
|
763
|
+
}
|
|
764
|
+
var MkQuestionnaireElement = class extends MkElement {
|
|
765
|
+
static options = { questions: "json", index: "number" };
|
|
766
|
+
questionnaire = null;
|
|
767
|
+
create(options) {
|
|
768
|
+
const questions = Array.isArray(options.questions) ? options.questions : null;
|
|
769
|
+
const built = questions && !this.querySelector("[data-mk-question]") ? buildForm(questions) : null;
|
|
770
|
+
if (built) this.append(built);
|
|
771
|
+
const engine = createQuestionnaire(this, { index: options.index });
|
|
772
|
+
this.questionnaire = engine;
|
|
773
|
+
return {
|
|
774
|
+
destroy: () => {
|
|
775
|
+
engine.destroy();
|
|
776
|
+
built?.remove();
|
|
777
|
+
this.questionnaire = null;
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
next() {
|
|
782
|
+
return this.questionnaire?.next() ?? Promise.resolve(false);
|
|
783
|
+
}
|
|
784
|
+
prev() {
|
|
785
|
+
return this.questionnaire?.prev() ?? Promise.resolve();
|
|
786
|
+
}
|
|
787
|
+
reset() {
|
|
788
|
+
this.questionnaire?.reset();
|
|
789
|
+
}
|
|
790
|
+
get answers() {
|
|
791
|
+
return this.questionnaire?.answers ?? {};
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
// src/components/code-block/element.ts
|
|
796
|
+
var MkCodeBlockElement = class extends MkElement {
|
|
797
|
+
static options = {
|
|
798
|
+
code: "string",
|
|
799
|
+
language: "string",
|
|
800
|
+
title: "string",
|
|
801
|
+
lineNumbers: "boolean",
|
|
802
|
+
copyLabel: "string",
|
|
803
|
+
copiedLabel: "string",
|
|
804
|
+
errorLabel: "string"
|
|
805
|
+
};
|
|
806
|
+
create(options) {
|
|
807
|
+
return createCodeBlock(this, options);
|
|
808
|
+
}
|
|
809
|
+
setCode(code) {
|
|
810
|
+
this.instance?.setCode(code);
|
|
811
|
+
}
|
|
812
|
+
copy() {
|
|
813
|
+
return this.instance?.copy() ?? Promise.resolve(false);
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
// src/components/context-menu/element.ts
|
|
818
|
+
var MkContextMenuElement = class extends MkElement {
|
|
819
|
+
static options = { keepOpen: "boolean", overrideEditable: "boolean", longPress: "number", variant: "string" };
|
|
820
|
+
create(options) {
|
|
821
|
+
const { keepOpen, ...rest } = options;
|
|
822
|
+
return createContextMenu(this, { ...rest, closeOnSelect: !keepOpen });
|
|
823
|
+
}
|
|
824
|
+
openAt(x, y) {
|
|
825
|
+
this.instance?.openAt(x, y);
|
|
826
|
+
}
|
|
827
|
+
open(origin) {
|
|
828
|
+
this.instance?.open(origin);
|
|
829
|
+
}
|
|
830
|
+
close() {
|
|
831
|
+
this.instance?.close();
|
|
832
|
+
}
|
|
833
|
+
get isOpen() {
|
|
834
|
+
return this.instance?.isOpen ?? false;
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
// src/components/drawer/element.ts
|
|
839
|
+
var MkDrawerElement = class extends MkDialogElement {
|
|
840
|
+
static options = { ...MkDialogElement.options, side: "string" };
|
|
841
|
+
createEngine(dialog, options, attributes) {
|
|
842
|
+
dialog.classList.add("mk-drawer");
|
|
843
|
+
const { variant: _variant, placement: _placement, float: _float, ...rest } = options;
|
|
844
|
+
return createDrawer(dialog, { ...rest, side: attributes.side });
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
// src/components/link-preview/element.ts
|
|
849
|
+
var MkLinkPreviewElement = class extends MkElement {
|
|
850
|
+
static options = {
|
|
851
|
+
url: "string",
|
|
852
|
+
title: "string",
|
|
853
|
+
description: "string",
|
|
854
|
+
image: "string",
|
|
855
|
+
imageAlt: "string",
|
|
856
|
+
siteName: "string",
|
|
857
|
+
variant: "string",
|
|
858
|
+
label: "string",
|
|
859
|
+
target: "string",
|
|
860
|
+
openDelay: "number",
|
|
861
|
+
closeDelay: "number",
|
|
862
|
+
placement: "string"
|
|
863
|
+
};
|
|
864
|
+
create(options) {
|
|
865
|
+
return createLinkPreview(this, options);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// src/components/progress/element.ts
|
|
870
|
+
var MkProgressElement = class extends MkElement {
|
|
871
|
+
static options = { value: "number", min: "number", max: "number", label: "string", variant: "string", showValue: "boolean" };
|
|
872
|
+
create(options) {
|
|
873
|
+
return createProgress(this, { ...options, value: typeof options.value === "number" ? options.value : null });
|
|
874
|
+
}
|
|
875
|
+
attributeChangedCallback(name, previous, next) {
|
|
876
|
+
if (previous === next || !this.instance) return;
|
|
877
|
+
if (name === "value") this.instance.setValue(next === null || !Number.isFinite(Number(next)) ? null : Number(next));
|
|
878
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
879
|
+
}
|
|
880
|
+
setValue(value) {
|
|
881
|
+
this.instance?.setValue(value);
|
|
882
|
+
}
|
|
883
|
+
get value() {
|
|
884
|
+
return this.instance?.value ?? null;
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// src/components/range-slider/element.ts
|
|
889
|
+
var MkRangeSliderElement = class extends MkElement {
|
|
890
|
+
static options = { min: "number", max: "number", step: "number", value: "json", disabled: "boolean", name: "string", label: "string" };
|
|
891
|
+
format;
|
|
892
|
+
/** Formatter for the output and aria-valuetext (code, so a property rather than an attribute). */
|
|
893
|
+
get formatValue() {
|
|
894
|
+
return this.format;
|
|
895
|
+
}
|
|
896
|
+
set formatValue(format) {
|
|
897
|
+
this.format = format;
|
|
898
|
+
this.rebuild(true);
|
|
899
|
+
}
|
|
900
|
+
create(options) {
|
|
901
|
+
return createRangeSlider(this, { ...options, formatValue: this.format });
|
|
902
|
+
}
|
|
903
|
+
/** Rebuild with the current attributes; keepValue keeps the edited value over the `value` attribute. */
|
|
904
|
+
rebuild(keepValue) {
|
|
905
|
+
if (!this.isConnected || !this.instance) return;
|
|
906
|
+
const value = this.instance.value;
|
|
907
|
+
this.instance.destroy();
|
|
908
|
+
this.instance = this.create(keepValue ? { ...this.options, value } : { value, ...this.options });
|
|
909
|
+
}
|
|
910
|
+
// Bounds rebuild the engine but keep the edited value unless `value` is set.
|
|
911
|
+
attributeChangedCallback(_name, previous, next) {
|
|
912
|
+
if (previous !== next) this.rebuild(false);
|
|
913
|
+
}
|
|
914
|
+
setValue(value, notify) {
|
|
915
|
+
this.instance?.setValue(value, notify);
|
|
916
|
+
}
|
|
917
|
+
get value() {
|
|
918
|
+
return this.instance?.value;
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
// src/components/chart/element.ts
|
|
923
|
+
var MkChartElement = class extends MkElement {
|
|
924
|
+
static options = {
|
|
925
|
+
type: "string",
|
|
926
|
+
labels: "list",
|
|
927
|
+
series: "json",
|
|
928
|
+
points: "json",
|
|
929
|
+
stacked: "boolean",
|
|
930
|
+
label: "string",
|
|
931
|
+
height: "number",
|
|
932
|
+
emptyLabel: "string",
|
|
933
|
+
legend: "boolean",
|
|
934
|
+
tooltip: "boolean",
|
|
935
|
+
axis: "boolean",
|
|
936
|
+
endLabel: "boolean"
|
|
937
|
+
};
|
|
938
|
+
create(options) {
|
|
939
|
+
return createChart(this, options);
|
|
940
|
+
}
|
|
941
|
+
attributeChangedCallback(_name, previous, next) {
|
|
942
|
+
if (previous === next || !this.instance) return;
|
|
943
|
+
this.instance.update({ stacked: false, legend: void 0, ...this.options });
|
|
944
|
+
}
|
|
945
|
+
update(options) {
|
|
946
|
+
this.instance?.update(options);
|
|
947
|
+
}
|
|
948
|
+
select(index) {
|
|
949
|
+
this.instance?.select(index);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
// src/components/credit-card/element.ts
|
|
954
|
+
var MkCreditCardElement = class extends MkElement {
|
|
955
|
+
static options = { tilt: "boolean", labels: "json", names: "json" };
|
|
956
|
+
create(options) {
|
|
957
|
+
return createCreditCard(this, options);
|
|
958
|
+
}
|
|
959
|
+
focusField(field) {
|
|
960
|
+
this.instance?.focus(field);
|
|
961
|
+
}
|
|
962
|
+
flip(back) {
|
|
963
|
+
this.instance?.flip(back);
|
|
964
|
+
}
|
|
965
|
+
get values() {
|
|
966
|
+
return this.instance?.values;
|
|
967
|
+
}
|
|
968
|
+
get brand() {
|
|
969
|
+
return this.instance?.brand ?? "unknown";
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
// src/components/command-search/element.ts
|
|
974
|
+
var MkCommandSearchElement = class extends MkElement {
|
|
975
|
+
static options = { items: "json", placeholder: "string", emptyLabel: "string", label: "string", shortcut: "boolean", limit: "number" };
|
|
976
|
+
create(options) {
|
|
977
|
+
return createCommandSearch(this, options);
|
|
978
|
+
}
|
|
979
|
+
attributeChangedCallback(name, previous, next) {
|
|
980
|
+
if (previous === next || !this.instance) return;
|
|
981
|
+
if (name === "items") this.instance.setItems(this.options.items ?? []);
|
|
982
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
983
|
+
}
|
|
984
|
+
open() {
|
|
985
|
+
this.instance?.open();
|
|
986
|
+
}
|
|
987
|
+
close() {
|
|
988
|
+
this.instance?.close();
|
|
989
|
+
}
|
|
990
|
+
setItems(items) {
|
|
991
|
+
this.instance?.setItems(items);
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
// src/components/hold-confirm/element.ts
|
|
996
|
+
var MkHoldConfirmElement = class extends MkElement {
|
|
997
|
+
static options = { duration: "number", resetAfter: "number", holdingLabel: "string", doneLabel: "string", hint: "string", disabled: "boolean" };
|
|
998
|
+
create(options) {
|
|
999
|
+
return createHoldConfirm(this, options);
|
|
1000
|
+
}
|
|
1001
|
+
reset() {
|
|
1002
|
+
this.instance?.reset();
|
|
1003
|
+
}
|
|
1004
|
+
get confirmed() {
|
|
1005
|
+
return this.instance?.confirmed ?? false;
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
// src/components/image-preview/element.ts
|
|
1010
|
+
var MkImagePreviewElement = class extends MkElement {
|
|
1011
|
+
static options = { loop: "boolean", strip: "boolean", labels: "json" };
|
|
1012
|
+
create(options) {
|
|
1013
|
+
return createImagePreview(this, options);
|
|
1014
|
+
}
|
|
1015
|
+
open(index) {
|
|
1016
|
+
this.instance?.open(index);
|
|
1017
|
+
}
|
|
1018
|
+
close() {
|
|
1019
|
+
this.instance?.close();
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
// src/components/like-button/element.ts
|
|
1024
|
+
var MkLikeButtonElement = class extends MkElement {
|
|
1025
|
+
static options = { liked: "boolean", count: "number", label: "string", hideCount: "boolean" };
|
|
1026
|
+
create(options) {
|
|
1027
|
+
let made = null;
|
|
1028
|
+
if (!this.querySelector("button")) {
|
|
1029
|
+
made = document.createElement("button");
|
|
1030
|
+
made.type = "button";
|
|
1031
|
+
this.append(made);
|
|
1032
|
+
}
|
|
1033
|
+
const engine = createLikeButton(this, options);
|
|
1034
|
+
if (made) {
|
|
1035
|
+
const destroy = engine.destroy;
|
|
1036
|
+
engine.destroy = () => {
|
|
1037
|
+
destroy();
|
|
1038
|
+
made.remove();
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
return engine;
|
|
1042
|
+
}
|
|
1043
|
+
// A new `liked` or `count` attribute updates in place (with the animation).
|
|
1044
|
+
attributeChangedCallback(name, previous, next) {
|
|
1045
|
+
if (previous === next || !this.instance) return;
|
|
1046
|
+
if (name === "liked") this.instance.setLiked(next !== null && next !== "false", false);
|
|
1047
|
+
else if (name === "count") this.instance.setCount(Number(next));
|
|
1048
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1049
|
+
}
|
|
1050
|
+
get liked() {
|
|
1051
|
+
return this.instance?.liked ?? false;
|
|
1052
|
+
}
|
|
1053
|
+
get count() {
|
|
1054
|
+
return this.instance?.count ?? 0;
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
// src/components/notification-bell/element.ts
|
|
1059
|
+
var MkNotificationBellElement = class extends MkElement {
|
|
1060
|
+
static options = { count: "number", label: "string", messageDuration: "number", max: "number" };
|
|
1061
|
+
create(options) {
|
|
1062
|
+
let made = null;
|
|
1063
|
+
if (!this.querySelector("button")) {
|
|
1064
|
+
made = document.createElement("button");
|
|
1065
|
+
made.type = "button";
|
|
1066
|
+
this.append(made);
|
|
1067
|
+
}
|
|
1068
|
+
const engine = createNotificationBell(this, options);
|
|
1069
|
+
if (made) {
|
|
1070
|
+
const destroy = engine.destroy;
|
|
1071
|
+
engine.destroy = () => {
|
|
1072
|
+
destroy();
|
|
1073
|
+
made.remove();
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
return engine;
|
|
1077
|
+
}
|
|
1078
|
+
attributeChangedCallback(name, previous, next) {
|
|
1079
|
+
if (previous === next || !this.instance) return;
|
|
1080
|
+
if (name === "count") this.instance.setCount(Number(next) || 0);
|
|
1081
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1082
|
+
}
|
|
1083
|
+
notify(message) {
|
|
1084
|
+
this.instance?.notify(message);
|
|
1085
|
+
}
|
|
1086
|
+
clear() {
|
|
1087
|
+
this.instance?.clear();
|
|
1088
|
+
}
|
|
1089
|
+
get count() {
|
|
1090
|
+
return this.instance?.count ?? 0;
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
// src/components/password-strength/element.ts
|
|
1095
|
+
var MkPasswordStrengthElement = class extends MkElement {
|
|
1096
|
+
static options = { minLength: "number", requireScore: "number", labels: "json" };
|
|
1097
|
+
create(options) {
|
|
1098
|
+
return createPasswordStrength(this, options);
|
|
1099
|
+
}
|
|
1100
|
+
get score() {
|
|
1101
|
+
return this.instance?.score ?? 0;
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
// src/components/scratch-card/element.ts
|
|
1106
|
+
var MkScratchCardElement = class extends MkElement {
|
|
1107
|
+
static options = { threshold: "number", brush: "number", coverLabel: "string", revealLabel: "string", revealedLabel: "string", celebrate: "boolean" };
|
|
1108
|
+
create(options) {
|
|
1109
|
+
return createScratchCard(this, options);
|
|
1110
|
+
}
|
|
1111
|
+
reveal() {
|
|
1112
|
+
this.instance?.reveal();
|
|
1113
|
+
}
|
|
1114
|
+
reset() {
|
|
1115
|
+
this.instance?.reset();
|
|
1116
|
+
}
|
|
1117
|
+
get revealed() {
|
|
1118
|
+
return this.instance?.revealed ?? false;
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
// src/components/star-rating/element.ts
|
|
1123
|
+
var MkStarRatingElement = class extends MkElement {
|
|
1124
|
+
static options = { max: "number", value: "number", name: "string", label: "string", labels: "list", readonly: "boolean", allowClear: "boolean", disabled: "boolean" };
|
|
1125
|
+
create(options) {
|
|
1126
|
+
return createStarRating(this, options);
|
|
1127
|
+
}
|
|
1128
|
+
attributeChangedCallback(name, previous, next) {
|
|
1129
|
+
if (previous === next || !this.instance) return;
|
|
1130
|
+
if (name === "value") this.instance.setValue(Number(next) || 0);
|
|
1131
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1132
|
+
}
|
|
1133
|
+
get value() {
|
|
1134
|
+
return this.instance?.value ?? 0;
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
// src/components/swipe-actions/element.ts
|
|
1139
|
+
var MkSwipeActionsElement = class extends MkElement {
|
|
1140
|
+
static options = { fullSwipe: "number" };
|
|
1141
|
+
create(options) {
|
|
1142
|
+
return createSwipeActions(this, options);
|
|
1143
|
+
}
|
|
1144
|
+
close() {
|
|
1145
|
+
this.instance?.close();
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
// src/components/color-slider/element.ts
|
|
1150
|
+
var MkColorSliderElement = class extends MkElement {
|
|
1151
|
+
static options = { channel: "string", value: "string", label: "string", orientation: "string", step: "number", showValue: "boolean", name: "string", disabled: "boolean" };
|
|
1152
|
+
create(options) {
|
|
1153
|
+
return createColorSlider(this, options);
|
|
1154
|
+
}
|
|
1155
|
+
attributeChangedCallback(name, previous, next) {
|
|
1156
|
+
if (previous === next || !this.instance) return;
|
|
1157
|
+
if (name === "value" && next) this.instance.setColor(next, false);
|
|
1158
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1159
|
+
}
|
|
1160
|
+
get value() {
|
|
1161
|
+
return this.instance?.value ?? "";
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
// src/components/color-area/element.ts
|
|
1166
|
+
var MkColorAreaElement = class extends MkElement {
|
|
1167
|
+
static options = { value: "string", label: "string", step: "number", name: "string", disabled: "boolean" };
|
|
1168
|
+
create(options) {
|
|
1169
|
+
return createColorArea(this, options);
|
|
1170
|
+
}
|
|
1171
|
+
attributeChangedCallback(name, previous, next) {
|
|
1172
|
+
if (previous === next || !this.instance) return;
|
|
1173
|
+
if (name === "value" && next) this.instance.setColor(next, false);
|
|
1174
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1175
|
+
}
|
|
1176
|
+
get value() {
|
|
1177
|
+
return this.instance?.value ?? "";
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
// src/components/color-field/element.ts
|
|
1182
|
+
var MkColorFieldElement = class extends MkElement {
|
|
1183
|
+
static options = { value: "string", format: "string", alpha: "boolean", label: "string", name: "string", disabled: "boolean", readOnly: "boolean" };
|
|
1184
|
+
create(options) {
|
|
1185
|
+
return createColorField(this, options);
|
|
1186
|
+
}
|
|
1187
|
+
attributeChangedCallback(name, previous, next) {
|
|
1188
|
+
if (previous === next || !this.instance) return;
|
|
1189
|
+
if (name === "value" && next) this.instance.setColor(next, false);
|
|
1190
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1191
|
+
}
|
|
1192
|
+
get value() {
|
|
1193
|
+
return this.instance?.value ?? "";
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
// src/components/color-picker/element.ts
|
|
1198
|
+
var MkColorPickerElement = class extends MkElement {
|
|
1199
|
+
static options = {
|
|
1200
|
+
value: "string",
|
|
1201
|
+
alpha: "boolean",
|
|
1202
|
+
format: "string",
|
|
1203
|
+
swatches: "list",
|
|
1204
|
+
label: "string",
|
|
1205
|
+
name: "string",
|
|
1206
|
+
disabled: "boolean",
|
|
1207
|
+
inline: "boolean",
|
|
1208
|
+
eyedropper: "boolean"
|
|
1209
|
+
};
|
|
1210
|
+
create(options) {
|
|
1211
|
+
return createColorPicker(this, options);
|
|
1212
|
+
}
|
|
1213
|
+
attributeChangedCallback(name, previous, next) {
|
|
1214
|
+
if (previous === next || !this.instance) return;
|
|
1215
|
+
if (name === "value" && next) this.instance.setColor(next, false);
|
|
1216
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1217
|
+
}
|
|
1218
|
+
open() {
|
|
1219
|
+
this.instance?.open();
|
|
1220
|
+
}
|
|
1221
|
+
close() {
|
|
1222
|
+
this.instance?.close();
|
|
1223
|
+
}
|
|
1224
|
+
get value() {
|
|
1225
|
+
return this.instance?.value ?? "";
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
// src/components/time-field/element.ts
|
|
1230
|
+
var MkTimeFieldElement = class extends MkElement {
|
|
1231
|
+
static options = {
|
|
1232
|
+
value: "string",
|
|
1233
|
+
locale: "string",
|
|
1234
|
+
hourCycle: "number",
|
|
1235
|
+
seconds: "boolean",
|
|
1236
|
+
minuteStep: "number",
|
|
1237
|
+
min: "string",
|
|
1238
|
+
max: "string",
|
|
1239
|
+
label: "string",
|
|
1240
|
+
name: "string",
|
|
1241
|
+
disabled: "boolean",
|
|
1242
|
+
readOnly: "boolean"
|
|
1243
|
+
};
|
|
1244
|
+
create(options) {
|
|
1245
|
+
return createTimeField(this, options);
|
|
1246
|
+
}
|
|
1247
|
+
attributeChangedCallback(name, previous, next) {
|
|
1248
|
+
if (previous === next || !this.instance) return;
|
|
1249
|
+
if (name === "value") this.instance.setValue(next);
|
|
1250
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1251
|
+
}
|
|
1252
|
+
get value() {
|
|
1253
|
+
return this.instance?.value ?? null;
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
// src/components/range-calendar/element.ts
|
|
1258
|
+
var MkRangeCalendarElement = class extends MkElement {
|
|
1259
|
+
static options = {
|
|
1260
|
+
start: "string",
|
|
1261
|
+
end: "string",
|
|
1262
|
+
month: "string",
|
|
1263
|
+
visibleMonths: "number",
|
|
1264
|
+
firstDay: "number",
|
|
1265
|
+
min: "string",
|
|
1266
|
+
max: "string",
|
|
1267
|
+
unavailable: "list",
|
|
1268
|
+
locale: "string",
|
|
1269
|
+
today: "string"
|
|
1270
|
+
};
|
|
1271
|
+
create(options) {
|
|
1272
|
+
const { start, end, ...rest } = options;
|
|
1273
|
+
return createRangeCalendar(this, { ...rest, value: start && end ? { start, end } : null });
|
|
1274
|
+
}
|
|
1275
|
+
attributeChangedCallback(name, previous, next) {
|
|
1276
|
+
if (previous === next || !this.instance) return;
|
|
1277
|
+
if (name === "start" || name === "end") {
|
|
1278
|
+
const start = this.getAttribute("start");
|
|
1279
|
+
const end = this.getAttribute("end");
|
|
1280
|
+
this.instance.setValue(start && end ? { start, end } : null);
|
|
1281
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1282
|
+
}
|
|
1283
|
+
get value() {
|
|
1284
|
+
return this.instance?.value ?? null;
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
// src/components/date-range-picker/element.ts
|
|
1289
|
+
var MkDateRangePickerElement = class extends MkElement {
|
|
1290
|
+
static options = {
|
|
1291
|
+
start: "string",
|
|
1292
|
+
end: "string",
|
|
1293
|
+
min: "string",
|
|
1294
|
+
max: "string",
|
|
1295
|
+
unavailable: "list",
|
|
1296
|
+
firstDay: "number",
|
|
1297
|
+
locale: "string",
|
|
1298
|
+
today: "string",
|
|
1299
|
+
label: "string",
|
|
1300
|
+
name: "string",
|
|
1301
|
+
presets: "json",
|
|
1302
|
+
disabled: "boolean"
|
|
1303
|
+
};
|
|
1304
|
+
create(options) {
|
|
1305
|
+
const { start, end, ...rest } = options;
|
|
1306
|
+
return createDateRangePicker(this, { ...rest, value: start && end ? { start, end } : null });
|
|
1307
|
+
}
|
|
1308
|
+
attributeChangedCallback(name, previous, next) {
|
|
1309
|
+
if (previous === next || !this.instance) return;
|
|
1310
|
+
if (name === "start" || name === "end") {
|
|
1311
|
+
const start = this.getAttribute("start");
|
|
1312
|
+
const end = this.getAttribute("end");
|
|
1313
|
+
this.instance.setValue(start && end ? { start, end } : null);
|
|
1314
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1315
|
+
}
|
|
1316
|
+
open() {
|
|
1317
|
+
this.instance?.open();
|
|
1318
|
+
}
|
|
1319
|
+
close() {
|
|
1320
|
+
this.instance?.close();
|
|
1321
|
+
}
|
|
1322
|
+
get value() {
|
|
1323
|
+
return this.instance?.value ?? null;
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
|
|
1327
|
+
// src/components/tooltip/element.ts
|
|
1328
|
+
var MkTooltipElement = class extends MkElement {
|
|
1329
|
+
static options = { content: "string", placement: "string", openDelay: "number", closeDelay: "number", interactive: "boolean", arrow: "boolean" };
|
|
1330
|
+
create(options) {
|
|
1331
|
+
return createTooltip(this, options);
|
|
1332
|
+
}
|
|
1333
|
+
attributeChangedCallback(name, previous, next) {
|
|
1334
|
+
if (previous === next || !this.instance) return;
|
|
1335
|
+
if (name === "content") this.instance.setContent(next ?? "");
|
|
1336
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
// src/components/popover/element.ts
|
|
1341
|
+
var MkPopoverElement = class extends MkElement {
|
|
1342
|
+
static options = { label: "string" };
|
|
1343
|
+
create(options) {
|
|
1344
|
+
return createPopover(this, options);
|
|
1345
|
+
}
|
|
1346
|
+
open() {
|
|
1347
|
+
this.instance?.open();
|
|
1348
|
+
}
|
|
1349
|
+
close() {
|
|
1350
|
+
this.instance?.close();
|
|
1351
|
+
}
|
|
1352
|
+
get isOpen() {
|
|
1353
|
+
return this.instance?.isOpen ?? false;
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
|
|
1357
|
+
// src/components/loading-button/element.ts
|
|
1358
|
+
var MkLoadingButtonElement = class extends MkElement {
|
|
1359
|
+
static options = { labels: "json", compact: "boolean", resetAfter: "number", state: "string" };
|
|
1360
|
+
create(options) {
|
|
1361
|
+
const { state, ...rest } = options;
|
|
1362
|
+
const instance = createLoadingButton(this, rest);
|
|
1363
|
+
if (state) instance.setState(state);
|
|
1364
|
+
return instance;
|
|
1365
|
+
}
|
|
1366
|
+
attributeChangedCallback(name, previous, next) {
|
|
1367
|
+
if (previous === next || !this.instance) return;
|
|
1368
|
+
if (name === "state") this.instance.setState(next || "idle");
|
|
1369
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1370
|
+
}
|
|
1371
|
+
run(action) {
|
|
1372
|
+
return this.instance?.run(action) ?? Promise.resolve(false);
|
|
1373
|
+
}
|
|
1374
|
+
get state() {
|
|
1375
|
+
return this.instance?.state ?? "idle";
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
// src/components/breadcrumb/element.ts
|
|
1380
|
+
var MkBreadcrumbElement = class extends MkElement {
|
|
1381
|
+
static options = { items: "json", label: "string", maxItems: "number" };
|
|
1382
|
+
create(options) {
|
|
1383
|
+
return createBreadcrumb(this, options);
|
|
1384
|
+
}
|
|
1385
|
+
attributeChangedCallback(name, previous, next) {
|
|
1386
|
+
if (previous === next || !this.instance) return;
|
|
1387
|
+
if (name === "items") {
|
|
1388
|
+
try {
|
|
1389
|
+
this.instance.setItems(JSON.parse(next ?? "[]"));
|
|
1390
|
+
} catch {
|
|
1391
|
+
}
|
|
1392
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
// src/components/empty-state/element.ts
|
|
1397
|
+
var MkEmptyStateElement = class extends MkElement {
|
|
1398
|
+
static options = { illustration: "string", title: "string", description: "string", actions: "json", loop: "boolean" };
|
|
1399
|
+
create(options) {
|
|
1400
|
+
return createEmptyState(this, options);
|
|
1401
|
+
}
|
|
1402
|
+
attributeChangedCallback(name, previous, next) {
|
|
1403
|
+
if (previous === next || !this.instance) return;
|
|
1404
|
+
if (name === "loop") return super.attributeChangedCallback(name, previous, next);
|
|
1405
|
+
this.instance.update(this.options);
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
// src/components/stat-card/element.ts
|
|
1410
|
+
var MkStatCardElement = class extends MkElement {
|
|
1411
|
+
static options = {
|
|
1412
|
+
label: "string",
|
|
1413
|
+
value: "number",
|
|
1414
|
+
previous: "number",
|
|
1415
|
+
format: "json",
|
|
1416
|
+
locale: "string",
|
|
1417
|
+
positive: "string",
|
|
1418
|
+
comparison: "string",
|
|
1419
|
+
series: "list",
|
|
1420
|
+
target: "number",
|
|
1421
|
+
countOnView: "boolean"
|
|
1422
|
+
};
|
|
1423
|
+
create(options) {
|
|
1424
|
+
return createStatCard(this, normalise(options));
|
|
1425
|
+
}
|
|
1426
|
+
attributeChangedCallback(name, previous, next) {
|
|
1427
|
+
if (previous === next || !this.instance) return;
|
|
1428
|
+
if (name === "locale" || name === "count-on-view") return super.attributeChangedCallback(name, previous, next);
|
|
1429
|
+
this.instance.update(normalise(this.options));
|
|
1430
|
+
}
|
|
1431
|
+
};
|
|
1432
|
+
var normalise = (options) => ({
|
|
1433
|
+
...options,
|
|
1434
|
+
series: Array.isArray(options.series) ? options.series.map(Number).filter(Number.isFinite) : void 0
|
|
1435
|
+
});
|
|
1436
|
+
|
|
1437
|
+
// src/components/chart-tooltip/element.ts
|
|
1438
|
+
var MkChartTooltipElement = class extends MkElement {
|
|
1439
|
+
static options = {
|
|
1440
|
+
labels: "list",
|
|
1441
|
+
series: "json",
|
|
1442
|
+
align: "string",
|
|
1443
|
+
inset: "json",
|
|
1444
|
+
min: "number",
|
|
1445
|
+
max: "number",
|
|
1446
|
+
delta: "boolean",
|
|
1447
|
+
share: "boolean",
|
|
1448
|
+
total: "boolean",
|
|
1449
|
+
sort: "boolean",
|
|
1450
|
+
pin: "boolean",
|
|
1451
|
+
label: "string"
|
|
1452
|
+
};
|
|
1453
|
+
create(options) {
|
|
1454
|
+
return createChartTooltip(this, options);
|
|
1455
|
+
}
|
|
1456
|
+
attributeChangedCallback(_name, previous, next) {
|
|
1457
|
+
if (previous === next || !this.instance) return;
|
|
1458
|
+
this.instance.update(this.options);
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
// src/components/multi-select/element.ts
|
|
1463
|
+
var MkMultiSelectElement = class extends MkElement {
|
|
1464
|
+
static options = { options: "json", value: "list", placeholder: "string", label: "string", name: "string", max: "number", closeOnSelect: "boolean", disabled: "boolean" };
|
|
1465
|
+
create(options) {
|
|
1466
|
+
return createMultiSelect(this, options);
|
|
1467
|
+
}
|
|
1468
|
+
attributeChangedCallback(name, previous, next) {
|
|
1469
|
+
if (previous === next || !this.instance) return;
|
|
1470
|
+
if (name === "value") this.instance.setValue((next ?? "").split(",").map((item) => item.trim()).filter(Boolean));
|
|
1471
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1472
|
+
}
|
|
1473
|
+
get value() {
|
|
1474
|
+
return this.instance?.value ?? [];
|
|
1475
|
+
}
|
|
1476
|
+
};
|
|
1477
|
+
|
|
1478
|
+
// src/components/tag-input/element.ts
|
|
1479
|
+
var MkTagInputElement = class extends MkElement {
|
|
1480
|
+
static options = {
|
|
1481
|
+
value: "list",
|
|
1482
|
+
suggestions: "list",
|
|
1483
|
+
placeholder: "string",
|
|
1484
|
+
label: "string",
|
|
1485
|
+
name: "string",
|
|
1486
|
+
max: "number",
|
|
1487
|
+
restrict: "boolean",
|
|
1488
|
+
allowDuplicates: "boolean",
|
|
1489
|
+
disabled: "boolean"
|
|
1490
|
+
};
|
|
1491
|
+
create(options) {
|
|
1492
|
+
return createTagInput(this, options);
|
|
1493
|
+
}
|
|
1494
|
+
attributeChangedCallback(name, previous, next) {
|
|
1495
|
+
if (previous === next || !this.instance) return;
|
|
1496
|
+
const list = (next ?? "").split(",").map((item) => item.trim()).filter(Boolean);
|
|
1497
|
+
if (name === "value") this.instance.setValue(list);
|
|
1498
|
+
else if (name === "suggestions") this.instance.setSuggestions(list);
|
|
1499
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1500
|
+
}
|
|
1501
|
+
get value() {
|
|
1502
|
+
return this.instance?.value ?? [];
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
// src/components/date-time-picker/element.ts
|
|
1507
|
+
var MkDateTimePickerElement = class extends MkElement {
|
|
1508
|
+
static options = {
|
|
1509
|
+
value: "string",
|
|
1510
|
+
min: "string",
|
|
1511
|
+
max: "string",
|
|
1512
|
+
locale: "string",
|
|
1513
|
+
hourCycle: "number",
|
|
1514
|
+
minuteStep: "number",
|
|
1515
|
+
firstDay: "number",
|
|
1516
|
+
unavailable: "list",
|
|
1517
|
+
today: "string",
|
|
1518
|
+
label: "string",
|
|
1519
|
+
name: "string",
|
|
1520
|
+
disabled: "boolean"
|
|
1521
|
+
};
|
|
1522
|
+
create(options) {
|
|
1523
|
+
return createDateTimePicker(this, options);
|
|
1524
|
+
}
|
|
1525
|
+
attributeChangedCallback(name, previous, next) {
|
|
1526
|
+
if (previous === next || !this.instance) return;
|
|
1527
|
+
if (name === "value") this.instance.setValue(next);
|
|
1528
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1529
|
+
}
|
|
1530
|
+
open() {
|
|
1531
|
+
this.instance?.open();
|
|
1532
|
+
}
|
|
1533
|
+
close() {
|
|
1534
|
+
this.instance?.close();
|
|
1535
|
+
}
|
|
1536
|
+
get value() {
|
|
1537
|
+
return this.instance?.value ?? null;
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1541
|
+
// src/components/filter-builder/element.ts
|
|
1542
|
+
var MkFilterBuilderElement = class extends MkElement {
|
|
1543
|
+
static options = { fields: "json", value: "json", maxDepth: "number", label: "string", summary: "boolean" };
|
|
1544
|
+
create(options) {
|
|
1545
|
+
return createFilterBuilder(this, options);
|
|
1546
|
+
}
|
|
1547
|
+
attributeChangedCallback(name, previous, next) {
|
|
1548
|
+
if (previous === next || !this.instance) return;
|
|
1549
|
+
if (name === "value" && next) {
|
|
1550
|
+
try {
|
|
1551
|
+
this.instance.setValue(JSON.parse(next));
|
|
1552
|
+
} catch {
|
|
1553
|
+
}
|
|
1554
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1555
|
+
}
|
|
1556
|
+
get value() {
|
|
1557
|
+
return this.instance?.value ?? null;
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
// src/components/timeline/element.ts
|
|
1562
|
+
var MkTimelineElement = class extends MkElement {
|
|
1563
|
+
static options = { events: "json", layout: "string", group: "boolean", relative: "boolean", locale: "string", label: "string" };
|
|
1564
|
+
create(options) {
|
|
1565
|
+
return createTimeline(this, options);
|
|
1566
|
+
}
|
|
1567
|
+
attributeChangedCallback(name, previous, next) {
|
|
1568
|
+
if (previous === next || !this.instance) return;
|
|
1569
|
+
if (name === "events") {
|
|
1570
|
+
try {
|
|
1571
|
+
this.instance.setEvents(JSON.parse(next ?? "[]"));
|
|
1572
|
+
} catch {
|
|
1573
|
+
}
|
|
1574
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1575
|
+
}
|
|
1576
|
+
add(event, at) {
|
|
1577
|
+
this.instance?.add(event, at);
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
// src/components/activity-feed/element.ts
|
|
1582
|
+
var MkActivityFeedElement = class extends MkElement {
|
|
1583
|
+
static options = { items: "json", locale: "string", label: "string", emptyLabel: "string" };
|
|
1584
|
+
create(options) {
|
|
1585
|
+
return createActivityFeed(this, options);
|
|
1586
|
+
}
|
|
1587
|
+
attributeChangedCallback(name, previous, next) {
|
|
1588
|
+
if (previous === next || !this.instance) return;
|
|
1589
|
+
if (name === "items") {
|
|
1590
|
+
try {
|
|
1591
|
+
this.instance.setItems(JSON.parse(next ?? "[]"));
|
|
1592
|
+
} catch {
|
|
1593
|
+
}
|
|
1594
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1595
|
+
}
|
|
1596
|
+
/** New activity on top (not Element.prepend). */
|
|
1597
|
+
prependItems(items) {
|
|
1598
|
+
this.instance?.prepend(items);
|
|
1599
|
+
}
|
|
1600
|
+
appendItems(items) {
|
|
1601
|
+
this.instance?.append(items);
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
// src/components/tree-view/element.ts
|
|
1606
|
+
var MkTreeViewElement = class extends MkElement {
|
|
1607
|
+
static options = { nodes: "json", checkable: "boolean", checked: "list", expanded: "list", selected: "string", search: "string", label: "string", icons: "boolean", draggable: "boolean" };
|
|
1608
|
+
create(options) {
|
|
1609
|
+
const search = this.hasAttribute("search") ? this.getAttribute("search") || true : void 0;
|
|
1610
|
+
const expanded = this.getAttribute("expanded") === "all" ? true : options.expanded;
|
|
1611
|
+
return createTreeView(this, { ...options, search, expanded });
|
|
1612
|
+
}
|
|
1613
|
+
attributeChangedCallback(name, previous, next) {
|
|
1614
|
+
if (previous === next || !this.instance) return;
|
|
1615
|
+
if (name === "nodes") {
|
|
1616
|
+
try {
|
|
1617
|
+
this.instance.setNodes(JSON.parse(next ?? "[]"));
|
|
1618
|
+
} catch {
|
|
1619
|
+
}
|
|
1620
|
+
} else if (name === "selected") this.instance.select(next);
|
|
1621
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
// src/components/file-explorer/element.ts
|
|
1626
|
+
var MkFileExplorerElement = class extends MkElement {
|
|
1627
|
+
static options = {
|
|
1628
|
+
files: "json",
|
|
1629
|
+
rootLabel: "string",
|
|
1630
|
+
folder: "string",
|
|
1631
|
+
view: "string",
|
|
1632
|
+
tree: "boolean",
|
|
1633
|
+
readOnly: "boolean",
|
|
1634
|
+
locale: "string",
|
|
1635
|
+
label: "string"
|
|
1636
|
+
};
|
|
1637
|
+
create(options) {
|
|
1638
|
+
return createFileExplorer(this, options);
|
|
1639
|
+
}
|
|
1640
|
+
attributeChangedCallback(name, previous, next) {
|
|
1641
|
+
if (previous === next || !this.instance) return;
|
|
1642
|
+
if (name === "files") {
|
|
1643
|
+
try {
|
|
1644
|
+
this.instance.setFiles(JSON.parse(next ?? "[]"));
|
|
1645
|
+
} catch {
|
|
1646
|
+
}
|
|
1647
|
+
} else if (name === "view") this.instance.setView(next === "grid" ? "grid" : "list");
|
|
1648
|
+
else if (name === "folder") this.instance.open(next || "/");
|
|
1649
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
|
|
1653
|
+
// src/components/json-viewer/element.ts
|
|
1654
|
+
var MkJsonViewerElement = class extends MkElement {
|
|
1655
|
+
static options = {
|
|
1656
|
+
data: "json",
|
|
1657
|
+
expandDepth: "number",
|
|
1658
|
+
rootName: "string",
|
|
1659
|
+
search: "string",
|
|
1660
|
+
toolbar: "boolean",
|
|
1661
|
+
sortKeys: "boolean",
|
|
1662
|
+
label: "string"
|
|
1663
|
+
};
|
|
1664
|
+
create(options) {
|
|
1665
|
+
const search = this.hasAttribute("search") ? this.getAttribute("search") || true : void 0;
|
|
1666
|
+
return createJsonViewer(this, { ...options, search });
|
|
1667
|
+
}
|
|
1668
|
+
attributeChangedCallback(name, previous, next) {
|
|
1669
|
+
if (previous === next || !this.instance) return;
|
|
1670
|
+
if (name === "data") {
|
|
1671
|
+
try {
|
|
1672
|
+
this.instance.setData(JSON.parse(next ?? "null"));
|
|
1673
|
+
} catch {
|
|
1674
|
+
}
|
|
1675
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
// src/components/virtual-list/element.ts
|
|
1680
|
+
var MkVirtualListElement = class extends MkElement {
|
|
1681
|
+
static options = {
|
|
1682
|
+
items: "json",
|
|
1683
|
+
itemHeight: "number",
|
|
1684
|
+
estimatedHeight: "number",
|
|
1685
|
+
overscan: "number",
|
|
1686
|
+
selectable: "string",
|
|
1687
|
+
selected: "list",
|
|
1688
|
+
label: "string",
|
|
1689
|
+
emptyLabel: "string",
|
|
1690
|
+
locale: "string"
|
|
1691
|
+
};
|
|
1692
|
+
create(options) {
|
|
1693
|
+
const raw = this.getAttribute("selectable");
|
|
1694
|
+
const selectable = raw === null || raw === "false" ? false : raw === "multiple" ? "multiple" : "single";
|
|
1695
|
+
return createVirtualList(this, { ...options, selectable });
|
|
1696
|
+
}
|
|
1697
|
+
attributeChangedCallback(name, previous, next) {
|
|
1698
|
+
if (previous === next || !this.instance) return;
|
|
1699
|
+
if (name === "items") {
|
|
1700
|
+
try {
|
|
1701
|
+
this.instance.setItems(JSON.parse(next ?? "[]"));
|
|
1702
|
+
} catch {
|
|
1703
|
+
}
|
|
1704
|
+
} else if (name === "selected") this.instance.select((next ?? "").split(",").map((key) => key.trim()).filter(Boolean));
|
|
1705
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
|
|
1709
|
+
// src/components/resizable-panel/element.ts
|
|
1710
|
+
var MkResizablePanelElement = class extends MkElement {
|
|
1711
|
+
static options = {
|
|
1712
|
+
orientation: "string",
|
|
1713
|
+
sizes: "list",
|
|
1714
|
+
min: "number",
|
|
1715
|
+
max: "number",
|
|
1716
|
+
collapsible: "list",
|
|
1717
|
+
collapsed: "list",
|
|
1718
|
+
step: "number",
|
|
1719
|
+
storageKey: "string",
|
|
1720
|
+
handleButtons: "boolean",
|
|
1721
|
+
labels: "list"
|
|
1722
|
+
};
|
|
1723
|
+
create(options) {
|
|
1724
|
+
const numbers = (value) => Array.isArray(value) ? value.map(Number).filter(Number.isFinite) : void 0;
|
|
1725
|
+
return createResizablePanel(this, { ...options, sizes: numbers(options.sizes), collapsible: numbers(options.collapsible), collapsed: numbers(options.collapsed) });
|
|
1726
|
+
}
|
|
1727
|
+
attributeChangedCallback(name, previous, next) {
|
|
1728
|
+
if (previous === next || !this.instance) return;
|
|
1729
|
+
if (name === "orientation") this.instance.setOrientation(next === "vertical" ? "vertical" : "horizontal");
|
|
1730
|
+
else if (name === "sizes") this.instance.setSizes((next ?? "").split(",").map(Number).filter(Number.isFinite));
|
|
1731
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
// src/components/split-view/element.ts
|
|
1736
|
+
var MkSplitViewElement = class extends MkElement {
|
|
1737
|
+
static options = {
|
|
1738
|
+
orientation: "string",
|
|
1739
|
+
ratio: "number",
|
|
1740
|
+
min: "number",
|
|
1741
|
+
collapsible: "string",
|
|
1742
|
+
stackBelow: "number",
|
|
1743
|
+
storageKey: "string",
|
|
1744
|
+
labels: "list"
|
|
1745
|
+
};
|
|
1746
|
+
create(options) {
|
|
1747
|
+
const raw = this.getAttribute("collapsible");
|
|
1748
|
+
const collapsible = raw === null || raw === "" || raw === "true" ? true : raw === "false" ? false : raw === "start" || raw === "end" ? raw : true;
|
|
1749
|
+
const labels = Array.isArray(options.labels) && options.labels.length === 2 ? options.labels : void 0;
|
|
1750
|
+
return createSplitView(this, { ...options, collapsible, labels });
|
|
1751
|
+
}
|
|
1752
|
+
attributeChangedCallback(name, previous, next) {
|
|
1753
|
+
if (previous === next || !this.instance) return;
|
|
1754
|
+
if (name === "ratio" && next !== null && Number.isFinite(Number(next))) this.instance.setRatio(Number(next));
|
|
1755
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1756
|
+
}
|
|
1757
|
+
};
|
|
1758
|
+
|
|
1759
|
+
// src/components/data-table/element.ts
|
|
1760
|
+
var MkDataTableElement = class extends MkElement {
|
|
1761
|
+
static options = {
|
|
1762
|
+
columns: "json",
|
|
1763
|
+
rows: "json",
|
|
1764
|
+
rowKey: "string",
|
|
1765
|
+
caption: "string",
|
|
1766
|
+
pageSize: "number",
|
|
1767
|
+
pageSizes: "json",
|
|
1768
|
+
selectable: "boolean",
|
|
1769
|
+
search: "string",
|
|
1770
|
+
filters: "boolean",
|
|
1771
|
+
columnsMenu: "boolean",
|
|
1772
|
+
actions: "json",
|
|
1773
|
+
bulkActions: "json",
|
|
1774
|
+
sort: "string",
|
|
1775
|
+
loading: "boolean",
|
|
1776
|
+
emptyTitle: "string",
|
|
1777
|
+
emptyDescription: "string",
|
|
1778
|
+
locale: "string"
|
|
1779
|
+
};
|
|
1780
|
+
create(options) {
|
|
1781
|
+
const raw = this.getAttribute("search");
|
|
1782
|
+
const search = raw === null || raw === "" ? true : raw === "false" ? false : raw;
|
|
1783
|
+
const [key, direction] = String(options.sort ?? "").split(":");
|
|
1784
|
+
const sort = key ? { key, direction: direction === "desc" ? "desc" : "asc" } : null;
|
|
1785
|
+
return createDataTable(this, { ...options, search, sort });
|
|
1786
|
+
}
|
|
1787
|
+
attributeChangedCallback(name, previous, next) {
|
|
1788
|
+
if (previous === next || !this.instance) return;
|
|
1789
|
+
if (name === "rows") {
|
|
1790
|
+
try {
|
|
1791
|
+
this.instance.setRows(JSON.parse(next ?? "[]"));
|
|
1792
|
+
} catch {
|
|
1793
|
+
}
|
|
1794
|
+
} else if (name === "loading") this.instance.setLoading(next !== null && next !== "false");
|
|
1795
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
// src/components/editable-table/element.ts
|
|
1800
|
+
var MkEditableTableElement = class extends MkElement {
|
|
1801
|
+
static options = {
|
|
1802
|
+
columns: "json",
|
|
1803
|
+
rows: "json",
|
|
1804
|
+
rowKey: "string",
|
|
1805
|
+
caption: "string",
|
|
1806
|
+
pageSize: "number",
|
|
1807
|
+
selectable: "boolean",
|
|
1808
|
+
search: "string",
|
|
1809
|
+
filters: "boolean",
|
|
1810
|
+
columnsMenu: "boolean",
|
|
1811
|
+
newRow: "json",
|
|
1812
|
+
locale: "string"
|
|
1813
|
+
};
|
|
1814
|
+
create(options) {
|
|
1815
|
+
const raw = this.getAttribute("search");
|
|
1816
|
+
const search = raw === null || raw === "" ? true : raw === "false" ? false : raw;
|
|
1817
|
+
const template = options.newRow;
|
|
1818
|
+
return createEditableTable(this, { ...options, search, newRow: template ? () => ({ ...template }) : void 0 });
|
|
1819
|
+
}
|
|
1820
|
+
attributeChangedCallback(name, previous, next) {
|
|
1821
|
+
if (previous === next || !this.instance) return;
|
|
1822
|
+
if (name === "rows") {
|
|
1823
|
+
try {
|
|
1824
|
+
this.instance.setRows(JSON.parse(next ?? "[]"));
|
|
1825
|
+
} catch {
|
|
1826
|
+
}
|
|
1827
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
1828
|
+
}
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
// src/components/rich-text-editor/element.ts
|
|
1832
|
+
var MkRichTextEditorElement = class extends MkElement {
|
|
1833
|
+
static options = {
|
|
1834
|
+
value: "string",
|
|
1835
|
+
placeholder: "string",
|
|
1836
|
+
toolbar: "list",
|
|
1837
|
+
maxLength: "number",
|
|
1838
|
+
counter: "string",
|
|
1839
|
+
name: "string",
|
|
1840
|
+
label: "string",
|
|
1841
|
+
readOnly: "boolean",
|
|
1842
|
+
markdown: "boolean"
|
|
1843
|
+
};
|
|
1844
|
+
create(options) {
|
|
1845
|
+
const counter = options.counter === "false" ? false : options.counter === "characters" ? "characters" : options.counter === "words" ? "words" : void 0;
|
|
1846
|
+
return createRichTextEditor(this, { ...options, counter, toolbar: options.toolbar });
|
|
1847
|
+
}
|
|
1848
|
+
attributeChangedCallback(name, previous, next) {
|
|
1849
|
+
if (previous === next || !this.instance) return;
|
|
1850
|
+
if (name === "value") this.instance.setValue(next ?? "");
|
|
1851
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
|
|
1855
|
+
// src/components/select/element.ts
|
|
1856
|
+
var MkSelectElement = class extends MkElement {
|
|
1857
|
+
static options = { value: "string", name: "string", label: "string", placeholder: "string", disabled: "boolean" };
|
|
1858
|
+
create(options) {
|
|
1859
|
+
return createSelect(this, options);
|
|
1860
|
+
}
|
|
1861
|
+
attributeChangedCallback(name, previous, next) {
|
|
1862
|
+
if (previous === next || !this.instance) return;
|
|
1863
|
+
if (name === "value" && next !== null) this.instance.setValue(next, false);
|
|
1864
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
1865
|
+
}
|
|
1866
|
+
get value() {
|
|
1867
|
+
return this.instance?.value ?? "";
|
|
1868
|
+
}
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
// src/components/add-to-cart/element.ts
|
|
1872
|
+
var MkAddToCartElement = class extends MkElement {
|
|
1873
|
+
static options = { target: "string", image: "string", quantity: "number", count: "number", label: "string" };
|
|
1874
|
+
create(options) {
|
|
1875
|
+
return createAddToCart(this, options);
|
|
1876
|
+
}
|
|
1877
|
+
get count() {
|
|
1878
|
+
return this.instance?.count ?? 0;
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
|
|
1882
|
+
// src/components/scroll-island/element.ts
|
|
1883
|
+
var MkScrollIslandElement = class extends MkElement {
|
|
1884
|
+
static options = { sections: "string", reach: "number", idle: "number", page: "boolean" };
|
|
1885
|
+
create(options) {
|
|
1886
|
+
return createScrollIsland(options.page ? document.documentElement : this, options);
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
|
|
1890
|
+
// src/components/pill-button/element.ts
|
|
1891
|
+
var MkPillButtonElement = class extends MkElement {
|
|
1892
|
+
static options = { expand: "boolean", icon: "string" };
|
|
1893
|
+
create(options) {
|
|
1894
|
+
return createPillButton(this, options);
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
|
|
1898
|
+
// src/components/toolbar/element.ts
|
|
1899
|
+
var MkToolbarElement = class extends MkElement {
|
|
1900
|
+
static options = { value: "string", orientation: "string", tips: "boolean" };
|
|
1901
|
+
create(options) {
|
|
1902
|
+
return createToolbar(this, options);
|
|
1903
|
+
}
|
|
1904
|
+
get value() {
|
|
1905
|
+
return this.instance?.value ?? "";
|
|
1906
|
+
}
|
|
1907
|
+
set value(next) {
|
|
1908
|
+
this.instance?.setValue(next);
|
|
1909
|
+
}
|
|
1910
|
+
setValue(value, notify = false) {
|
|
1911
|
+
this.instance?.setValue(value, notify);
|
|
1912
|
+
}
|
|
1913
|
+
attributeChangedCallback(name, previous, next) {
|
|
1914
|
+
if (name === "value" && this.instance) {
|
|
1915
|
+
if (next !== null) this.instance.setValue(next);
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
super.attributeChangedCallback(name, previous, next);
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1922
|
+
// src/components/bidirectional-slider/element.ts
|
|
1923
|
+
var MkBidirectionalSliderElement = class extends MkElement {
|
|
1924
|
+
static options = {
|
|
1925
|
+
min: "number",
|
|
1926
|
+
max: "number",
|
|
1927
|
+
origin: "number",
|
|
1928
|
+
step: "number",
|
|
1929
|
+
value: "number",
|
|
1930
|
+
disabled: "boolean",
|
|
1931
|
+
name: "string",
|
|
1932
|
+
label: "string",
|
|
1933
|
+
icons: "string"
|
|
1934
|
+
};
|
|
1935
|
+
create(options) {
|
|
1936
|
+
return createBidirectionalSlider(this, { ...options, icons: options.icons === "none" ? false : options.icons });
|
|
1937
|
+
}
|
|
1938
|
+
get value() {
|
|
1939
|
+
return this.instance?.value ?? 0;
|
|
1940
|
+
}
|
|
1941
|
+
set value(next) {
|
|
1942
|
+
this.setValue(next);
|
|
1943
|
+
}
|
|
1944
|
+
setValue(value, notify = false) {
|
|
1945
|
+
this.instance?.setValue(value, notify);
|
|
1946
|
+
}
|
|
1947
|
+
reset(notify = false) {
|
|
1948
|
+
this.instance?.reset(notify);
|
|
1949
|
+
}
|
|
1950
|
+
attributeChangedCallback(name, previous, next) {
|
|
1951
|
+
if (name === "value" && this.instance) {
|
|
1952
|
+
this.instance.setValue(Number(next ?? this.options.origin ?? 0));
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
super.attributeChangedCallback(name, previous, next);
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
// src/components/voice-dots/element.ts
|
|
1960
|
+
var MkVoiceDotsElement = class extends MkElement {
|
|
1961
|
+
static options = { state: "string", count: "number", colorful: "boolean", size: "number" };
|
|
1962
|
+
create(options) {
|
|
1963
|
+
return createVoiceDots(this, options);
|
|
1964
|
+
}
|
|
1965
|
+
/** A new state flows from where the dots are (the engine, and the audio it follows, stay). */
|
|
1966
|
+
attributeChangedCallback(name, previous, next) {
|
|
1967
|
+
if (name === "state" && this.instance) {
|
|
1968
|
+
this.instance.setState(next ?? "idle");
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
super.attributeChangedCallback(name, previous, next);
|
|
1972
|
+
}
|
|
1973
|
+
get state() {
|
|
1974
|
+
return this.instance?.state ?? "idle";
|
|
1975
|
+
}
|
|
1976
|
+
set state(next) {
|
|
1977
|
+
this.setAttribute("state", next);
|
|
1978
|
+
}
|
|
1979
|
+
setLevel(level) {
|
|
1980
|
+
this.instance?.setLevel(level);
|
|
1981
|
+
}
|
|
1982
|
+
listen(source) {
|
|
1983
|
+
return this.instance?.listen(source) ?? Promise.resolve(() => {
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
stop() {
|
|
1987
|
+
this.instance?.stop();
|
|
1988
|
+
}
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
// src/components/pie-chart/element.ts
|
|
1992
|
+
var MkPieChartElement = class extends MkElement {
|
|
1993
|
+
static options = { data: "json", donut: "number", gap: "number", size: "number", label: "string", totalLabel: "string", legend: "boolean", emptyLabel: "string" };
|
|
1994
|
+
create(options) {
|
|
1995
|
+
return createPieChart(this, options);
|
|
1996
|
+
}
|
|
1997
|
+
attributeChangedCallback(_name, previous, next) {
|
|
1998
|
+
if (previous === next || !this.instance) return;
|
|
1999
|
+
this.instance.update({ legend: void 0, ...this.options });
|
|
2000
|
+
}
|
|
2001
|
+
update(options) {
|
|
2002
|
+
this.instance?.update(options);
|
|
2003
|
+
}
|
|
2004
|
+
select(index) {
|
|
2005
|
+
this.instance?.select(index);
|
|
2006
|
+
}
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
// src/components/radar-chart/element.ts
|
|
2010
|
+
var MkRadarChartElement = class extends MkElement {
|
|
2011
|
+
static options = { axes: "list", series: "json", max: "number", levels: "number", grid: "string", size: "number", label: "string", legend: "boolean", emptyLabel: "string" };
|
|
2012
|
+
create(options) {
|
|
2013
|
+
return createRadarChart(this, options);
|
|
2014
|
+
}
|
|
2015
|
+
attributeChangedCallback(_name, previous, next) {
|
|
2016
|
+
if (previous === next || !this.instance) return;
|
|
2017
|
+
this.instance.update({ legend: void 0, max: void 0, ...this.options });
|
|
2018
|
+
}
|
|
2019
|
+
update(options) {
|
|
2020
|
+
this.instance?.update(options);
|
|
2021
|
+
}
|
|
2022
|
+
select(axis) {
|
|
2023
|
+
this.instance?.select(axis);
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
// src/components/radial-chart/element.ts
|
|
2028
|
+
var MkRadialChartElement = class extends MkElement {
|
|
2029
|
+
static options = { data: "json", max: "number", sweep: "number", size: "number", thickness: "number", label: "string", totalLabel: "string", legend: "boolean", emptyLabel: "string" };
|
|
2030
|
+
create(options) {
|
|
2031
|
+
return createRadialChart(this, options);
|
|
2032
|
+
}
|
|
2033
|
+
attributeChangedCallback(_name, previous, next) {
|
|
2034
|
+
if (previous === next || !this.instance) return;
|
|
2035
|
+
this.instance.update({ legend: void 0, max: void 0, ...this.options });
|
|
2036
|
+
}
|
|
2037
|
+
update(options) {
|
|
2038
|
+
this.instance?.update(options);
|
|
2039
|
+
}
|
|
2040
|
+
select(index) {
|
|
2041
|
+
this.instance?.select(index);
|
|
2042
|
+
}
|
|
2043
|
+
};
|
|
2044
|
+
|
|
2045
|
+
// src/components/sankey-chart/element.ts
|
|
2046
|
+
var MkSankeyChartElement = class extends MkElement {
|
|
2047
|
+
static options = { nodes: "json", links: "json", height: "number", nodeWidth: "number", nodePadding: "number", label: "string", emptyLabel: "string" };
|
|
2048
|
+
create(options) {
|
|
2049
|
+
return createSankeyChart(this, options);
|
|
2050
|
+
}
|
|
2051
|
+
attributeChangedCallback(_name, previous, next) {
|
|
2052
|
+
if (previous === next || !this.instance) return;
|
|
2053
|
+
this.instance.update(this.options);
|
|
2054
|
+
}
|
|
2055
|
+
update(options) {
|
|
2056
|
+
this.instance?.update(options);
|
|
2057
|
+
}
|
|
2058
|
+
select(index) {
|
|
2059
|
+
this.instance?.select(index);
|
|
2060
|
+
}
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
// src/components/heatmap-chart/element.ts
|
|
2064
|
+
var MkHeatmapChartElement = class extends MkElement {
|
|
2065
|
+
static options = { data: "json", end: "string", weeks: "number", firstDay: "number", locale: "string", levels: "number", color: "string", unit: "string", label: "string", legend: "boolean", emptyLabel: "string" };
|
|
2066
|
+
create(options) {
|
|
2067
|
+
return createHeatmapChart(this, options);
|
|
2068
|
+
}
|
|
2069
|
+
attributeChangedCallback(_name, previous, next) {
|
|
2070
|
+
if (previous === next || !this.instance) return;
|
|
2071
|
+
this.instance.update({ legend: void 0, color: void 0, ...this.options });
|
|
2072
|
+
}
|
|
2073
|
+
update(options) {
|
|
2074
|
+
this.instance?.update(options);
|
|
2075
|
+
}
|
|
2076
|
+
select(date) {
|
|
2077
|
+
this.instance?.select(date);
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
|
|
2081
|
+
// src/components/orbit-menu/element.ts
|
|
2082
|
+
var MkOrbitMenuElement = class extends MkElement {
|
|
2083
|
+
static options = { radius: "number", start: "number", closeOnSelect: "boolean" };
|
|
2084
|
+
create(options) {
|
|
2085
|
+
return createOrbitMenu(this, options);
|
|
2086
|
+
}
|
|
2087
|
+
open() {
|
|
2088
|
+
this.instance?.open();
|
|
2089
|
+
}
|
|
2090
|
+
close() {
|
|
2091
|
+
this.instance?.close();
|
|
2092
|
+
}
|
|
2093
|
+
};
|
|
2094
|
+
|
|
585
2095
|
// src/elements/index.ts
|
|
586
2096
|
var ELEMENTS = {
|
|
587
2097
|
"mk-theme-picker": MkThemePickerElement,
|
|
@@ -601,7 +2111,69 @@ var ELEMENTS = {
|
|
|
601
2111
|
"mk-studio-dock": MkStudioDockElement,
|
|
602
2112
|
"mk-trailer": MkTrailerElement,
|
|
603
2113
|
"mk-calendar": MkCalendarElement,
|
|
604
|
-
"mk-slot-picker": MkSlotPickerElement
|
|
2114
|
+
"mk-slot-picker": MkSlotPickerElement,
|
|
2115
|
+
"mk-attachment": MkAttachmentElement,
|
|
2116
|
+
"mk-skeleton": MkSkeletonElement,
|
|
2117
|
+
"mk-questionnaire": MkQuestionnaireElement,
|
|
2118
|
+
"mk-code-block": MkCodeBlockElement,
|
|
2119
|
+
"mk-context-menu": MkContextMenuElement,
|
|
2120
|
+
"mk-drawer": MkDrawerElement,
|
|
2121
|
+
"mk-link-preview": MkLinkPreviewElement,
|
|
2122
|
+
"mk-progress": MkProgressElement,
|
|
2123
|
+
"mk-range-slider": MkRangeSliderElement,
|
|
2124
|
+
"mk-chart": MkChartElement,
|
|
2125
|
+
"mk-credit-card": MkCreditCardElement,
|
|
2126
|
+
"mk-command-search": MkCommandSearchElement,
|
|
2127
|
+
"mk-hold-confirm": MkHoldConfirmElement,
|
|
2128
|
+
"mk-image-preview": MkImagePreviewElement,
|
|
2129
|
+
"mk-like-button": MkLikeButtonElement,
|
|
2130
|
+
"mk-notification-bell": MkNotificationBellElement,
|
|
2131
|
+
"mk-password-strength": MkPasswordStrengthElement,
|
|
2132
|
+
"mk-scratch-card": MkScratchCardElement,
|
|
2133
|
+
"mk-star-rating": MkStarRatingElement,
|
|
2134
|
+
"mk-swipe-actions": MkSwipeActionsElement,
|
|
2135
|
+
"mk-color-slider": MkColorSliderElement,
|
|
2136
|
+
"mk-color-area": MkColorAreaElement,
|
|
2137
|
+
"mk-color-field": MkColorFieldElement,
|
|
2138
|
+
"mk-color-picker": MkColorPickerElement,
|
|
2139
|
+
"mk-time-field": MkTimeFieldElement,
|
|
2140
|
+
"mk-range-calendar": MkRangeCalendarElement,
|
|
2141
|
+
"mk-date-range-picker": MkDateRangePickerElement,
|
|
2142
|
+
"mk-tooltip": MkTooltipElement,
|
|
2143
|
+
"mk-popover": MkPopoverElement,
|
|
2144
|
+
"mk-loading-button": MkLoadingButtonElement,
|
|
2145
|
+
"mk-breadcrumb": MkBreadcrumbElement,
|
|
2146
|
+
"mk-empty-state": MkEmptyStateElement,
|
|
2147
|
+
"mk-stat-card": MkStatCardElement,
|
|
2148
|
+
"mk-chart-tooltip": MkChartTooltipElement,
|
|
2149
|
+
"mk-multi-select": MkMultiSelectElement,
|
|
2150
|
+
"mk-tag-input": MkTagInputElement,
|
|
2151
|
+
"mk-date-time-picker": MkDateTimePickerElement,
|
|
2152
|
+
"mk-filter-builder": MkFilterBuilderElement,
|
|
2153
|
+
"mk-timeline": MkTimelineElement,
|
|
2154
|
+
"mk-activity-feed": MkActivityFeedElement,
|
|
2155
|
+
"mk-tree-view": MkTreeViewElement,
|
|
2156
|
+
"mk-file-explorer": MkFileExplorerElement,
|
|
2157
|
+
"mk-json-viewer": MkJsonViewerElement,
|
|
2158
|
+
"mk-virtual-list": MkVirtualListElement,
|
|
2159
|
+
"mk-resizable-panel": MkResizablePanelElement,
|
|
2160
|
+
"mk-split-view": MkSplitViewElement,
|
|
2161
|
+
"mk-data-table": MkDataTableElement,
|
|
2162
|
+
"mk-editable-table": MkEditableTableElement,
|
|
2163
|
+
"mk-rich-text-editor": MkRichTextEditorElement,
|
|
2164
|
+
"mk-select": MkSelectElement,
|
|
2165
|
+
"mk-add-to-cart": MkAddToCartElement,
|
|
2166
|
+
"mk-scroll-island": MkScrollIslandElement,
|
|
2167
|
+
"mk-pill-button": MkPillButtonElement,
|
|
2168
|
+
"mk-toolbar": MkToolbarElement,
|
|
2169
|
+
"mk-bidirectional-slider": MkBidirectionalSliderElement,
|
|
2170
|
+
"mk-voice-dots": MkVoiceDotsElement,
|
|
2171
|
+
"mk-pie-chart": MkPieChartElement,
|
|
2172
|
+
"mk-radar-chart": MkRadarChartElement,
|
|
2173
|
+
"mk-radial-chart": MkRadialChartElement,
|
|
2174
|
+
"mk-sankey-chart": MkSankeyChartElement,
|
|
2175
|
+
"mk-heatmap-chart": MkHeatmapChartElement,
|
|
2176
|
+
"mk-orbit-menu": MkOrbitMenuElement
|
|
605
2177
|
// new-component:entries
|
|
606
2178
|
};
|
|
607
2179
|
function defineElements(names = Object.keys(ELEMENTS)) {
|
|
@@ -609,25 +2181,87 @@ function defineElements(names = Object.keys(ELEMENTS)) {
|
|
|
609
2181
|
}
|
|
610
2182
|
export {
|
|
611
2183
|
ELEMENTS,
|
|
2184
|
+
MkActivityFeedElement,
|
|
2185
|
+
MkAddToCartElement,
|
|
2186
|
+
MkAttachmentElement,
|
|
2187
|
+
MkBidirectionalSliderElement,
|
|
2188
|
+
MkBreadcrumbElement,
|
|
612
2189
|
MkCalendarElement,
|
|
2190
|
+
MkChartElement,
|
|
2191
|
+
MkChartTooltipElement,
|
|
613
2192
|
MkChatBackgroundElement,
|
|
614
2193
|
MkChatElement,
|
|
2194
|
+
MkCodeBlockElement,
|
|
2195
|
+
MkColorAreaElement,
|
|
2196
|
+
MkColorFieldElement,
|
|
2197
|
+
MkColorPickerElement,
|
|
2198
|
+
MkColorSliderElement,
|
|
2199
|
+
MkCommandSearchElement,
|
|
2200
|
+
MkContextMenuElement,
|
|
2201
|
+
MkCreditCardElement,
|
|
615
2202
|
MkCursorElement,
|
|
2203
|
+
MkDataTableElement,
|
|
2204
|
+
MkDateRangePickerElement,
|
|
2205
|
+
MkDateTimePickerElement,
|
|
616
2206
|
MkDialogElement,
|
|
2207
|
+
MkDrawerElement,
|
|
2208
|
+
MkEditableTableElement,
|
|
617
2209
|
MkElement,
|
|
2210
|
+
MkEmptyStateElement,
|
|
2211
|
+
MkFileExplorerElement,
|
|
2212
|
+
MkFilterBuilderElement,
|
|
2213
|
+
MkHeatmapChartElement,
|
|
2214
|
+
MkHoldConfirmElement,
|
|
618
2215
|
MkHoverCardElement,
|
|
2216
|
+
MkImagePreviewElement,
|
|
619
2217
|
MkInputOtpElement,
|
|
620
2218
|
MkIslandElement,
|
|
2219
|
+
MkJsonViewerElement,
|
|
2220
|
+
MkLikeButtonElement,
|
|
2221
|
+
MkLinkPreviewElement,
|
|
2222
|
+
MkLoadingButtonElement,
|
|
621
2223
|
MkMenuElement,
|
|
2224
|
+
MkMultiSelectElement,
|
|
622
2225
|
MkNavElement,
|
|
2226
|
+
MkNotificationBellElement,
|
|
2227
|
+
MkOrbitMenuElement,
|
|
623
2228
|
MkPaginationElement,
|
|
2229
|
+
MkPasswordStrengthElement,
|
|
2230
|
+
MkPieChartElement,
|
|
2231
|
+
MkPillButtonElement,
|
|
2232
|
+
MkPopoverElement,
|
|
2233
|
+
MkProgressElement,
|
|
624
2234
|
MkQuantityElement,
|
|
2235
|
+
MkQuestionnaireElement,
|
|
2236
|
+
MkRadarChartElement,
|
|
2237
|
+
MkRadialChartElement,
|
|
2238
|
+
MkRangeCalendarElement,
|
|
2239
|
+
MkRangeSliderElement,
|
|
2240
|
+
MkResizablePanelElement,
|
|
2241
|
+
MkRichTextEditorElement,
|
|
2242
|
+
MkSankeyChartElement,
|
|
2243
|
+
MkScratchCardElement,
|
|
2244
|
+
MkScrollIslandElement,
|
|
2245
|
+
MkSelectElement,
|
|
2246
|
+
MkSkeletonElement,
|
|
625
2247
|
MkSlotPickerElement,
|
|
2248
|
+
MkSplitViewElement,
|
|
2249
|
+
MkStarRatingElement,
|
|
2250
|
+
MkStatCardElement,
|
|
626
2251
|
MkStepsElement,
|
|
627
2252
|
MkStudioDockElement,
|
|
2253
|
+
MkSwipeActionsElement,
|
|
2254
|
+
MkTagInputElement,
|
|
628
2255
|
MkThemePickerElement,
|
|
2256
|
+
MkTimeFieldElement,
|
|
2257
|
+
MkTimelineElement,
|
|
629
2258
|
MkToasterElement,
|
|
2259
|
+
MkToolbarElement,
|
|
2260
|
+
MkTooltipElement,
|
|
630
2261
|
MkTrailerElement,
|
|
2262
|
+
MkTreeViewElement,
|
|
2263
|
+
MkVirtualListElement,
|
|
2264
|
+
MkVoiceDotsElement,
|
|
631
2265
|
SafeHTMLElement,
|
|
632
2266
|
defineElement,
|
|
633
2267
|
defineElements,
|