@getcortexlabs/mavis-core 0.1.0-alpha.1 → 0.1.0-alpha.11
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 +2 -2
- package/dist/accordion.d.ts +17 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +42 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.d.ts +21 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +13 -0
- package/dist/alert.js.map +1 -0
- package/dist/app-icons.d.ts +27 -0
- package/dist/app-icons.d.ts.map +1 -0
- package/dist/app-icons.js +42 -0
- package/dist/app-icons.js.map +1 -0
- package/dist/avatar.d.ts +10 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +11 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +7 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +11 -0
- package/dist/badge.js.map +1 -0
- package/dist/capabilities.d.ts +132 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +180 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/chart.d.ts +40 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +73 -0
- package/dist/chart.js.map +1 -0
- package/dist/chip.d.ts +9 -0
- package/dist/chip.d.ts.map +1 -0
- package/dist/chip.js +16 -0
- package/dist/chip.js.map +1 -0
- package/dist/choice-motion.d.ts +14 -0
- package/dist/choice-motion.d.ts.map +1 -0
- package/dist/choice-motion.js +5 -0
- package/dist/choice-motion.js.map +1 -0
- package/dist/choice.d.ts +15 -0
- package/dist/choice.d.ts.map +1 -0
- package/dist/choice.js +27 -0
- package/dist/choice.js.map +1 -0
- package/dist/collections.d.ts +46 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +48 -0
- package/dist/collections.js.map +1 -0
- package/dist/combobox.d.ts +42 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +159 -0
- package/dist/combobox.js.map +1 -0
- package/dist/contracts.d.ts +1321 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +268 -0
- package/dist/contracts.js.map +1 -0
- package/dist/date-input.d.ts +10 -0
- package/dist/date-input.d.ts.map +1 -0
- package/dist/date-input.js +58 -0
- package/dist/date-input.js.map +1 -0
- package/dist/date-time.d.ts +19 -0
- package/dist/date-time.d.ts.map +1 -0
- package/dist/date-time.js +27 -0
- package/dist/date-time.js.map +1 -0
- package/dist/date.d.ts +96 -0
- package/dist/date.d.ts.map +1 -0
- package/dist/date.js +235 -0
- package/dist/date.js.map +1 -0
- package/dist/dialog.d.ts +4 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +21 -0
- package/dist/dialog.js.map +1 -0
- package/dist/discovery.d.ts +49 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +80 -0
- package/dist/discovery.js.map +1 -0
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.d.ts.map +1 -0
- package/dist/empty-state.js +5 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/experimental-collections.d.ts +82 -0
- package/dist/experimental-collections.d.ts.map +1 -0
- package/dist/experimental-collections.js +8 -0
- package/dist/experimental-collections.js.map +1 -0
- package/dist/experimental-effects.d.ts +107 -0
- package/dist/experimental-effects.d.ts.map +1 -0
- package/dist/experimental-effects.js +24 -0
- package/dist/experimental-effects.js.map +1 -0
- package/dist/experimental-platforms.d.ts +94 -0
- package/dist/experimental-platforms.d.ts.map +1 -0
- package/dist/experimental-platforms.js +2 -0
- package/dist/experimental-platforms.js.map +1 -0
- package/dist/experimental-playback.d.ts +63 -0
- package/dist/experimental-playback.d.ts.map +1 -0
- package/dist/experimental-playback.js +46 -0
- package/dist/experimental-playback.js.map +1 -0
- package/dist/experimental-regions.d.ts +179 -0
- package/dist/experimental-regions.d.ts.map +1 -0
- package/dist/experimental-regions.js +554 -0
- package/dist/experimental-regions.js.map +1 -0
- package/dist/experimental-sensors.d.ts +42 -0
- package/dist/experimental-sensors.d.ts.map +1 -0
- package/dist/experimental-sensors.js +2 -0
- package/dist/experimental-sensors.js.map +1 -0
- package/dist/experimental-surfaces.d.ts +127 -0
- package/dist/experimental-surfaces.d.ts.map +1 -0
- package/dist/experimental-surfaces.js +2 -0
- package/dist/experimental-surfaces.js.map +1 -0
- package/dist/experimental.d.ts +197 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +855 -0
- package/dist/experimental.js.map +1 -0
- package/dist/files.d.ts +87 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +328 -0
- package/dist/files.js.map +1 -0
- package/dist/form.d.ts +39 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +170 -0
- package/dist/form.js.map +1 -0
- package/dist/grid.d.ts +3 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +16 -0
- package/dist/grid.js.map +1 -0
- package/dist/icon.d.ts +15 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +28 -0
- package/dist/icon.js.map +1 -0
- package/dist/icons.d.ts +2002 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +2003 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +59 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -1
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +14 -0
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +12 -0
- package/dist/input.js.map +1 -1
- package/dist/link.d.ts +36 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +60 -0
- package/dist/link.js.map +1 -0
- package/dist/list-item.d.ts +3 -0
- package/dist/list-item.d.ts.map +1 -0
- package/dist/list-item.js +7 -0
- package/dist/list-item.js.map +1 -0
- package/dist/motion.d.ts +58 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +73 -0
- package/dist/motion.js.map +1 -0
- package/dist/multi-select.d.ts +4 -0
- package/dist/multi-select.d.ts.map +1 -0
- package/dist/multi-select.js +23 -0
- package/dist/multi-select.js.map +1 -0
- package/dist/navigation-transition.d.ts +10 -0
- package/dist/navigation-transition.d.ts.map +1 -0
- package/dist/navigation-transition.js +10 -0
- package/dist/navigation-transition.js.map +1 -0
- package/dist/navigation.d.ts +22 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +54 -0
- package/dist/navigation.js.map +1 -0
- package/dist/number-input.d.ts +21 -0
- package/dist/number-input.d.ts.map +1 -0
- package/dist/number-input.js +63 -0
- package/dist/number-input.js.map +1 -0
- package/dist/popover.d.ts +17 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +19 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.d.ts +19 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +19 -0
- package/dist/progress.js.map +1 -0
- package/dist/responsive.d.ts +18 -0
- package/dist/responsive.d.ts.map +1 -0
- package/dist/responsive.js +35 -0
- package/dist/responsive.js.map +1 -0
- package/dist/section-scroll.d.ts +14 -0
- package/dist/section-scroll.d.ts.map +1 -0
- package/dist/section-scroll.js +28 -0
- package/dist/section-scroll.js.map +1 -0
- package/dist/segmented.d.ts +11 -0
- package/dist/segmented.d.ts.map +1 -0
- package/dist/segmented.js +30 -0
- package/dist/segmented.js.map +1 -0
- package/dist/sheet.d.ts +19 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +15 -0
- package/dist/sheet.js.map +1 -0
- package/dist/tabs.d.ts +11 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +28 -0
- package/dist/tabs.js.map +1 -0
- package/dist/theme/themes.d.ts.map +1 -1
- package/dist/theme/themes.js +85 -12
- package/dist/theme/themes.js.map +1 -1
- package/dist/theme/types.d.ts +64 -4
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/typography.d.ts +10 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/typography.js +90 -0
- package/dist/theme/typography.js.map +1 -0
- package/dist/time.d.ts +34 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +78 -0
- package/dist/time.js.map +1 -0
- package/dist/toast.d.ts +43 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +228 -0
- package/dist/toast.js.map +1 -0
- package/dist/vue/button-content.d.ts +10 -0
- package/dist/vue/button-content.d.ts.map +1 -0
- package/dist/vue/button-content.js +54 -0
- package/dist/vue/button-content.js.map +1 -0
- package/dist/vue/cached-activity.d.ts +3 -0
- package/dist/vue/cached-activity.d.ts.map +1 -0
- package/dist/vue/cached-activity.js +13 -0
- package/dist/vue/cached-activity.js.map +1 -0
- package/dist/vue/carousel.d.ts +11 -0
- package/dist/vue/carousel.d.ts.map +1 -0
- package/dist/vue/carousel.js +115 -0
- package/dist/vue/carousel.js.map +1 -0
- package/dist/vue/chart.d.ts +194 -0
- package/dist/vue/chart.d.ts.map +1 -0
- package/dist/vue/chart.js +246 -0
- package/dist/vue/chart.js.map +1 -0
- package/dist/vue/combobox.d.ts +155 -0
- package/dist/vue/combobox.d.ts.map +1 -0
- package/dist/vue/combobox.js +195 -0
- package/dist/vue/combobox.js.map +1 -0
- package/dist/vue/command-palette.d.ts +129 -0
- package/dist/vue/command-palette.d.ts.map +1 -0
- package/dist/vue/command-palette.js +187 -0
- package/dist/vue/command-palette.js.map +1 -0
- package/dist/vue/component-props.d.ts +3310 -0
- package/dist/vue/component-props.d.ts.map +1 -0
- package/dist/vue/component-props.js +43 -0
- package/dist/vue/component-props.js.map +1 -0
- package/dist/vue/configurator-props.d.ts +277 -0
- package/dist/vue/configurator-props.d.ts.map +1 -0
- package/dist/vue/configurator-props.js +63 -0
- package/dist/vue/configurator-props.js.map +1 -0
- package/dist/vue/configurator.d.ts +403 -0
- package/dist/vue/configurator.d.ts.map +1 -0
- package/dist/vue/configurator.js +287 -0
- package/dist/vue/configurator.js.map +1 -0
- package/dist/vue/contracts.d.ts +18 -0
- package/dist/vue/contracts.d.ts.map +1 -0
- package/dist/vue/contracts.js +24 -0
- package/dist/vue/contracts.js.map +1 -0
- package/dist/vue/data-table.d.ts +17 -0
- package/dist/vue/data-table.d.ts.map +1 -0
- package/dist/vue/data-table.js +133 -0
- package/dist/vue/data-table.js.map +1 -0
- package/dist/vue/date-calendar.d.ts +64 -0
- package/dist/vue/date-calendar.d.ts.map +1 -0
- package/dist/vue/date-calendar.js +65 -0
- package/dist/vue/date-calendar.js.map +1 -0
- package/dist/vue/date-picker.d.ts +1000 -0
- package/dist/vue/date-picker.d.ts.map +1 -0
- package/dist/vue/date-picker.js +334 -0
- package/dist/vue/date-picker.js.map +1 -0
- package/dist/vue/date-props.d.ts +278 -0
- package/dist/vue/date-props.d.ts.map +1 -0
- package/dist/vue/date-props.js +81 -0
- package/dist/vue/date-props.js.map +1 -0
- package/dist/vue/dialog.d.ts +21 -0
- package/dist/vue/dialog.d.ts.map +1 -0
- package/dist/vue/dialog.js +58 -0
- package/dist/vue/dialog.js.map +1 -0
- package/dist/vue/discovery-components.d.ts +50 -0
- package/dist/vue/discovery-components.d.ts.map +1 -0
- package/dist/vue/discovery-components.js +2 -0
- package/dist/vue/discovery-components.js.map +1 -0
- package/dist/vue/discovery-controls.d.ts +197 -0
- package/dist/vue/discovery-controls.d.ts.map +1 -0
- package/dist/vue/discovery-controls.js +166 -0
- package/dist/vue/discovery-controls.js.map +1 -0
- package/dist/vue/discovery-props.d.ts +249 -0
- package/dist/vue/discovery-props.d.ts.map +1 -0
- package/dist/vue/discovery-props.js +87 -0
- package/dist/vue/discovery-props.js.map +1 -0
- package/dist/vue/files.d.ts +53 -0
- package/dist/vue/files.d.ts.map +1 -0
- package/dist/vue/files.js +40 -0
- package/dist/vue/files.js.map +1 -0
- package/dist/vue/forms.d.ts +4 -0
- package/dist/vue/forms.d.ts.map +1 -0
- package/dist/vue/forms.js +15 -0
- package/dist/vue/forms.js.map +1 -0
- package/dist/vue/global-components.d.ts +259 -3
- package/dist/vue/global-components.d.ts.map +1 -1
- package/dist/vue/index.d.ts +54 -4
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +45 -2
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/inline-content.d.ts +54 -0
- package/dist/vue/inline-content.d.ts.map +1 -0
- package/dist/vue/inline-content.js +64 -0
- package/dist/vue/inline-content.js.map +1 -0
- package/dist/vue/layout-context.d.ts +4 -2
- package/dist/vue/layout-context.d.ts.map +1 -1
- package/dist/vue/layout-context.js +7 -2
- package/dist/vue/layout-context.js.map +1 -1
- package/dist/vue/list-motion.d.ts +7 -0
- package/dist/vue/list-motion.d.ts.map +1 -0
- package/dist/vue/list-motion.js +28 -0
- package/dist/vue/list-motion.js.map +1 -0
- package/dist/vue/loading-effect.d.ts +7 -0
- package/dist/vue/loading-effect.d.ts.map +1 -0
- package/dist/vue/loading-effect.js +32 -0
- package/dist/vue/loading-effect.js.map +1 -0
- package/dist/vue/menu.d.ts +122 -0
- package/dist/vue/menu.d.ts.map +1 -0
- package/dist/vue/menu.js +79 -0
- package/dist/vue/menu.js.map +1 -0
- package/dist/vue/navigation-controls.d.ts +124 -0
- package/dist/vue/navigation-controls.d.ts.map +1 -0
- package/dist/vue/navigation-controls.js +117 -0
- package/dist/vue/navigation-controls.js.map +1 -0
- package/dist/vue/navigation-props.d.ts +283 -0
- package/dist/vue/navigation-props.d.ts.map +1 -0
- package/dist/vue/navigation-props.js +82 -0
- package/dist/vue/navigation-props.js.map +1 -0
- package/dist/vue/navigation.d.ts +7 -0
- package/dist/vue/navigation.d.ts.map +1 -0
- package/dist/vue/navigation.js +15 -0
- package/dist/vue/navigation.js.map +1 -0
- package/dist/vue/platform.d.ts +37 -0
- package/dist/vue/platform.d.ts.map +1 -0
- package/dist/vue/platform.js +46 -0
- package/dist/vue/platform.js.map +1 -0
- package/dist/vue/props.d.ts +3326 -510
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +314 -83
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/reveal-state.d.ts +18 -0
- package/dist/vue/reveal-state.d.ts.map +1 -0
- package/dist/vue/reveal-state.js +76 -0
- package/dist/vue/reveal-state.js.map +1 -0
- package/dist/vue/theme-provider.d.ts +58 -0
- package/dist/vue/theme-provider.d.ts.map +1 -0
- package/dist/vue/theme-provider.js +69 -0
- package/dist/vue/theme-provider.js.map +1 -0
- package/dist/vue/theme.d.ts +1029 -19
- package/dist/vue/theme.d.ts.map +1 -1
- package/dist/vue/theme.js +47 -2
- package/dist/vue/theme.js.map +1 -1
- package/dist/vue/time-picker.d.ts +488 -0
- package/dist/vue/time-picker.d.ts.map +1 -0
- package/dist/vue/time-picker.js +190 -0
- package/dist/vue/time-picker.js.map +1 -0
- package/dist/vue/toast.d.ts +29 -0
- package/dist/vue/toast.d.ts.map +1 -0
- package/dist/vue/toast.js +79 -0
- package/dist/vue/toast.js.map +1 -0
- package/dist/vue/tree-view.d.ts +111 -0
- package/dist/vue/tree-view.d.ts.map +1 -0
- package/dist/vue/tree-view.js +180 -0
- package/dist/vue/tree-view.js.map +1 -0
- package/dist/vue/virtual-list.d.ts +26 -0
- package/dist/vue/virtual-list.d.ts.map +1 -0
- package/dist/vue/virtual-list.js +2 -0
- package/dist/vue/virtual-list.js.map +1 -0
- package/dist/vue/wayfinding-controls.d.ts +198 -0
- package/dist/vue/wayfinding-controls.d.ts.map +1 -0
- package/dist/vue/wayfinding-controls.js +310 -0
- package/dist/vue/wayfinding-controls.js.map +1 -0
- package/dist/vue/wayfinding-props.d.ts +221 -0
- package/dist/vue/wayfinding-props.d.ts.map +1 -0
- package/dist/vue/wayfinding-props.js +86 -0
- package/dist/vue/wayfinding-props.js.map +1 -0
- package/dist/vue/workflow-props.d.ts +110 -0
- package/dist/vue/workflow-props.d.ts.map +1 -0
- package/dist/vue/workflow-props.js +37 -0
- package/dist/vue/workflow-props.js.map +1 -0
- package/dist/vue/workflows.d.ts +267 -0
- package/dist/vue/workflows.d.ts.map +1 -0
- package/dist/vue/workflows.js +200 -0
- package/dist/vue/workflows.js.map +1 -0
- package/dist/wayfinding.d.ts +50 -0
- package/dist/wayfinding.d.ts.map +1 -0
- package/dist/wayfinding.js +54 -0
- package/dist/wayfinding.js.map +1 -0
- package/package.json +5 -1
- package/src/accordion.ts +66 -0
- package/src/alert.ts +16 -0
- package/src/app-icons.ts +57 -0
- package/src/avatar.ts +11 -0
- package/src/badge.ts +11 -0
- package/src/capabilities.ts +183 -0
- package/src/chart.ts +112 -0
- package/src/chip.ts +20 -0
- package/src/choice-motion.ts +12 -0
- package/src/choice.ts +41 -0
- package/src/collections.ts +87 -0
- package/src/combobox.ts +198 -0
- package/src/contracts.ts +324 -0
- package/src/date-input.ts +87 -0
- package/src/date-time.ts +37 -0
- package/src/date.ts +280 -0
- package/src/dialog.ts +22 -0
- package/src/discovery.ts +139 -0
- package/src/empty-state.ts +4 -0
- package/src/experimental-collections.ts +87 -0
- package/src/experimental-effects.ts +146 -0
- package/src/experimental-platforms.ts +96 -0
- package/src/experimental-playback.ts +115 -0
- package/src/experimental-regions.ts +777 -0
- package/src/experimental-sensors.ts +50 -0
- package/src/experimental-surfaces.ts +124 -0
- package/src/experimental.ts +1102 -0
- package/src/files.ts +408 -0
- package/src/form.ts +190 -0
- package/src/grid.ts +19 -0
- package/src/icon.ts +30 -0
- package/src/icons.ts +2002 -0
- package/src/index.ts +93 -2
- package/src/input.ts +27 -0
- package/src/link.ts +91 -0
- package/src/list-item.ts +5 -0
- package/src/motion.ts +80 -0
- package/src/multi-select.ts +30 -0
- package/src/navigation-transition.ts +14 -0
- package/src/navigation.ts +61 -0
- package/src/number-input.ts +80 -0
- package/src/popover.ts +38 -0
- package/src/progress.ts +22 -0
- package/src/responsive.ts +61 -0
- package/src/section-scroll.ts +46 -0
- package/src/segmented.ts +39 -0
- package/src/sheet.ts +31 -0
- package/src/tabs.ts +35 -0
- package/src/theme/themes.ts +89 -12
- package/src/theme/types.ts +55 -2
- package/src/theme/typography.ts +84 -0
- package/src/time.ts +83 -0
- package/src/toast.ts +249 -0
- package/src/vue/button-content.ts +60 -0
- package/src/vue/cached-activity.ts +13 -0
- package/src/vue/carousel.ts +173 -0
- package/src/vue/chart.ts +338 -0
- package/src/vue/combobox.ts +238 -0
- package/src/vue/command-palette.ts +232 -0
- package/src/vue/component-props.ts +70 -0
- package/src/vue/configurator-props.ts +67 -0
- package/src/vue/configurator.ts +350 -0
- package/src/vue/contracts.ts +39 -0
- package/src/vue/data-table.ts +190 -0
- package/src/vue/date-calendar.ts +76 -0
- package/src/vue/date-picker.ts +410 -0
- package/src/vue/date-props.ts +89 -0
- package/src/vue/dialog.ts +63 -0
- package/src/vue/discovery-components.ts +60 -0
- package/src/vue/discovery-controls.ts +218 -0
- package/src/vue/discovery-props.ts +92 -0
- package/src/vue/files.ts +53 -0
- package/src/vue/forms.ts +20 -0
- package/src/vue/global-components.ts +248 -4
- package/src/vue/index.ts +97 -4
- package/src/vue/inline-content.ts +71 -0
- package/src/vue/layout-context.ts +10 -3
- package/src/vue/list-motion.ts +31 -0
- package/src/vue/loading-effect.ts +44 -0
- package/src/vue/menu.ts +100 -0
- package/src/vue/navigation-controls.ts +138 -0
- package/src/vue/navigation-props.ts +87 -0
- package/src/vue/navigation.ts +16 -0
- package/src/vue/platform.ts +73 -0
- package/src/vue/props.ts +348 -96
- package/src/vue/reveal-state.ts +83 -0
- package/src/vue/theme-provider.ts +74 -0
- package/src/vue/theme.ts +65 -3
- package/src/vue/time-picker.ts +227 -0
- package/src/vue/toast.ts +99 -0
- package/src/vue/tree-view.ts +220 -0
- package/src/vue/virtual-list.ts +28 -0
- package/src/vue/wayfinding-controls.ts +412 -0
- package/src/vue/wayfinding-props.ts +97 -0
- package/src/vue/workflow-props.ts +41 -0
- package/src/vue/workflows.ts +257 -0
- package/src/wayfinding.ts +85 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { type Component } from '@vue/runtime-core';
|
|
2
|
+
import type { InputHandle } from '../input.js';
|
|
3
|
+
import type { ChoiceValue } from '../choice.js';
|
|
4
|
+
import { type NumberDraft } from '../number-input.js';
|
|
5
|
+
interface Primitives {
|
|
6
|
+
Column: Component;
|
|
7
|
+
Row: Component;
|
|
8
|
+
Text: Component;
|
|
9
|
+
Button: Component;
|
|
10
|
+
Input: Component;
|
|
11
|
+
Chip: Component;
|
|
12
|
+
Checkbox: Component;
|
|
13
|
+
Sheet: Component;
|
|
14
|
+
focusTrigger: (component: unknown) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Shared controls compose the renderer primitives, keeping editing and selection in one place. */
|
|
17
|
+
export declare function createConfiguratorControls(ui: Primitives, platform: 'web' | 'native'): {
|
|
18
|
+
MNumberInput: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: import("@vue/runtime-core").PropType<number | null>;
|
|
21
|
+
default: null;
|
|
22
|
+
};
|
|
23
|
+
draft: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
min: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
max: {
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
step: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
locale: {
|
|
40
|
+
type: import("@vue/runtime-core").PropType<import("../number-input.js").NumberLocale>;
|
|
41
|
+
default: string;
|
|
42
|
+
validator: (value: string) => boolean;
|
|
43
|
+
};
|
|
44
|
+
name: {
|
|
45
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
46
|
+
} & {
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
placeholder: {
|
|
50
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
51
|
+
} & {
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
incrementLabel: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
decrementLabel: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
id: {
|
|
63
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
64
|
+
} & {
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
67
|
+
label: {
|
|
68
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
69
|
+
} & {
|
|
70
|
+
required: true;
|
|
71
|
+
};
|
|
72
|
+
width: {
|
|
73
|
+
type: import("@vue/runtime-core").PropType<import("../layout.js").Dimension>;
|
|
74
|
+
} & {
|
|
75
|
+
default: undefined;
|
|
76
|
+
};
|
|
77
|
+
grow: {
|
|
78
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
79
|
+
} & {
|
|
80
|
+
default: number;
|
|
81
|
+
};
|
|
82
|
+
shrink: {
|
|
83
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
84
|
+
} & {
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
disabled: BooleanConstructor;
|
|
88
|
+
readonly: BooleanConstructor;
|
|
89
|
+
helperText: {
|
|
90
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
91
|
+
} & {
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
error: {
|
|
95
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
96
|
+
} & {
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
99
|
+
accessibilityHidden: {
|
|
100
|
+
type: import("@vue/runtime-core").PropType<boolean>;
|
|
101
|
+
} & {
|
|
102
|
+
default: undefined;
|
|
103
|
+
};
|
|
104
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
107
|
+
'update:modelValue': (_value: number | null) => true;
|
|
108
|
+
'update:draft': (_value: string) => true;
|
|
109
|
+
validityChange: (_value: NumberDraft) => true;
|
|
110
|
+
focus: () => true;
|
|
111
|
+
blur: () => true;
|
|
112
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
113
|
+
modelValue: {
|
|
114
|
+
type: import("@vue/runtime-core").PropType<number | null>;
|
|
115
|
+
default: null;
|
|
116
|
+
};
|
|
117
|
+
draft: {
|
|
118
|
+
type: StringConstructor;
|
|
119
|
+
default: undefined;
|
|
120
|
+
};
|
|
121
|
+
min: {
|
|
122
|
+
type: NumberConstructor;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
max: {
|
|
126
|
+
type: NumberConstructor;
|
|
127
|
+
default: undefined;
|
|
128
|
+
};
|
|
129
|
+
step: {
|
|
130
|
+
type: NumberConstructor;
|
|
131
|
+
default: number;
|
|
132
|
+
};
|
|
133
|
+
locale: {
|
|
134
|
+
type: import("@vue/runtime-core").PropType<import("../number-input.js").NumberLocale>;
|
|
135
|
+
default: string;
|
|
136
|
+
validator: (value: string) => boolean;
|
|
137
|
+
};
|
|
138
|
+
name: {
|
|
139
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
140
|
+
} & {
|
|
141
|
+
default: undefined;
|
|
142
|
+
};
|
|
143
|
+
placeholder: {
|
|
144
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
145
|
+
} & {
|
|
146
|
+
default: string;
|
|
147
|
+
};
|
|
148
|
+
incrementLabel: {
|
|
149
|
+
type: StringConstructor;
|
|
150
|
+
default: string;
|
|
151
|
+
};
|
|
152
|
+
decrementLabel: {
|
|
153
|
+
type: StringConstructor;
|
|
154
|
+
default: string;
|
|
155
|
+
};
|
|
156
|
+
id: {
|
|
157
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
158
|
+
} & {
|
|
159
|
+
default: undefined;
|
|
160
|
+
};
|
|
161
|
+
label: {
|
|
162
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
163
|
+
} & {
|
|
164
|
+
required: true;
|
|
165
|
+
};
|
|
166
|
+
width: {
|
|
167
|
+
type: import("@vue/runtime-core").PropType<import("../layout.js").Dimension>;
|
|
168
|
+
} & {
|
|
169
|
+
default: undefined;
|
|
170
|
+
};
|
|
171
|
+
grow: {
|
|
172
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
173
|
+
} & {
|
|
174
|
+
default: number;
|
|
175
|
+
};
|
|
176
|
+
shrink: {
|
|
177
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
178
|
+
} & {
|
|
179
|
+
default: undefined;
|
|
180
|
+
};
|
|
181
|
+
disabled: BooleanConstructor;
|
|
182
|
+
readonly: BooleanConstructor;
|
|
183
|
+
helperText: {
|
|
184
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
185
|
+
} & {
|
|
186
|
+
default: string;
|
|
187
|
+
};
|
|
188
|
+
error: {
|
|
189
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
190
|
+
} & {
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
accessibilityHidden: {
|
|
194
|
+
type: import("@vue/runtime-core").PropType<boolean>;
|
|
195
|
+
} & {
|
|
196
|
+
default: undefined;
|
|
197
|
+
};
|
|
198
|
+
}>> & Readonly<{
|
|
199
|
+
onFocus?: (() => any) | undefined;
|
|
200
|
+
onBlur?: (() => any) | undefined;
|
|
201
|
+
"onUpdate:modelValue"?: ((_value: number | null) => any) | undefined;
|
|
202
|
+
"onUpdate:draft"?: ((_value: string) => any) | undefined;
|
|
203
|
+
onValidityChange?: ((_value: NumberDraft) => any) | undefined;
|
|
204
|
+
}>, {
|
|
205
|
+
shrink: number;
|
|
206
|
+
name: string;
|
|
207
|
+
error: string;
|
|
208
|
+
id: string;
|
|
209
|
+
disabled: boolean;
|
|
210
|
+
modelValue: number | null;
|
|
211
|
+
width: import("../layout.js").Dimension;
|
|
212
|
+
grow: number;
|
|
213
|
+
accessibilityHidden: boolean;
|
|
214
|
+
placeholder: string;
|
|
215
|
+
helperText: string;
|
|
216
|
+
readonly: boolean;
|
|
217
|
+
locale: import("../number-input.js").NumberLocale;
|
|
218
|
+
min: number;
|
|
219
|
+
max: number;
|
|
220
|
+
step: number;
|
|
221
|
+
draft: string;
|
|
222
|
+
incrementLabel: string;
|
|
223
|
+
decrementLabel: string;
|
|
224
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any> & {
|
|
225
|
+
new (): InputHandle;
|
|
226
|
+
};
|
|
227
|
+
MMultiSelect: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
228
|
+
modelValue: {
|
|
229
|
+
type: import("@vue/runtime-core").PropType<readonly ChoiceValue[]>;
|
|
230
|
+
default: () => never[];
|
|
231
|
+
};
|
|
232
|
+
options: {
|
|
233
|
+
type: import("@vue/runtime-core").PropType<readonly import("../choice.js").ChoiceOption[]>;
|
|
234
|
+
required: true;
|
|
235
|
+
};
|
|
236
|
+
maxSelected: {
|
|
237
|
+
type: NumberConstructor;
|
|
238
|
+
default: undefined;
|
|
239
|
+
};
|
|
240
|
+
placeholder: {
|
|
241
|
+
type: StringConstructor;
|
|
242
|
+
default: string;
|
|
243
|
+
};
|
|
244
|
+
searchLabel: {
|
|
245
|
+
type: StringConstructor;
|
|
246
|
+
default: string;
|
|
247
|
+
};
|
|
248
|
+
closeLabel: {
|
|
249
|
+
type: StringConstructor;
|
|
250
|
+
default: string;
|
|
251
|
+
};
|
|
252
|
+
emptyLabel: {
|
|
253
|
+
type: StringConstructor;
|
|
254
|
+
default: string;
|
|
255
|
+
};
|
|
256
|
+
removeLabel: {
|
|
257
|
+
type: StringConstructor;
|
|
258
|
+
default: string;
|
|
259
|
+
};
|
|
260
|
+
id: {
|
|
261
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
262
|
+
} & {
|
|
263
|
+
default: undefined;
|
|
264
|
+
};
|
|
265
|
+
label: {
|
|
266
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
267
|
+
} & {
|
|
268
|
+
required: true;
|
|
269
|
+
};
|
|
270
|
+
width: {
|
|
271
|
+
type: import("@vue/runtime-core").PropType<import("../layout.js").Dimension>;
|
|
272
|
+
} & {
|
|
273
|
+
default: undefined;
|
|
274
|
+
};
|
|
275
|
+
grow: {
|
|
276
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
277
|
+
} & {
|
|
278
|
+
default: number;
|
|
279
|
+
};
|
|
280
|
+
shrink: {
|
|
281
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
282
|
+
} & {
|
|
283
|
+
default: undefined;
|
|
284
|
+
};
|
|
285
|
+
disabled: BooleanConstructor;
|
|
286
|
+
readonly: BooleanConstructor;
|
|
287
|
+
helperText: {
|
|
288
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
289
|
+
} & {
|
|
290
|
+
default: string;
|
|
291
|
+
};
|
|
292
|
+
error: {
|
|
293
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
294
|
+
} & {
|
|
295
|
+
default: string;
|
|
296
|
+
};
|
|
297
|
+
accessibilityHidden: {
|
|
298
|
+
type: import("@vue/runtime-core").PropType<boolean>;
|
|
299
|
+
} & {
|
|
300
|
+
default: undefined;
|
|
301
|
+
};
|
|
302
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
305
|
+
'update:modelValue': (_values: ChoiceValue[]) => true;
|
|
306
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
307
|
+
modelValue: {
|
|
308
|
+
type: import("@vue/runtime-core").PropType<readonly ChoiceValue[]>;
|
|
309
|
+
default: () => never[];
|
|
310
|
+
};
|
|
311
|
+
options: {
|
|
312
|
+
type: import("@vue/runtime-core").PropType<readonly import("../choice.js").ChoiceOption[]>;
|
|
313
|
+
required: true;
|
|
314
|
+
};
|
|
315
|
+
maxSelected: {
|
|
316
|
+
type: NumberConstructor;
|
|
317
|
+
default: undefined;
|
|
318
|
+
};
|
|
319
|
+
placeholder: {
|
|
320
|
+
type: StringConstructor;
|
|
321
|
+
default: string;
|
|
322
|
+
};
|
|
323
|
+
searchLabel: {
|
|
324
|
+
type: StringConstructor;
|
|
325
|
+
default: string;
|
|
326
|
+
};
|
|
327
|
+
closeLabel: {
|
|
328
|
+
type: StringConstructor;
|
|
329
|
+
default: string;
|
|
330
|
+
};
|
|
331
|
+
emptyLabel: {
|
|
332
|
+
type: StringConstructor;
|
|
333
|
+
default: string;
|
|
334
|
+
};
|
|
335
|
+
removeLabel: {
|
|
336
|
+
type: StringConstructor;
|
|
337
|
+
default: string;
|
|
338
|
+
};
|
|
339
|
+
id: {
|
|
340
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
341
|
+
} & {
|
|
342
|
+
default: undefined;
|
|
343
|
+
};
|
|
344
|
+
label: {
|
|
345
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
346
|
+
} & {
|
|
347
|
+
required: true;
|
|
348
|
+
};
|
|
349
|
+
width: {
|
|
350
|
+
type: import("@vue/runtime-core").PropType<import("../layout.js").Dimension>;
|
|
351
|
+
} & {
|
|
352
|
+
default: undefined;
|
|
353
|
+
};
|
|
354
|
+
grow: {
|
|
355
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
356
|
+
} & {
|
|
357
|
+
default: number;
|
|
358
|
+
};
|
|
359
|
+
shrink: {
|
|
360
|
+
type: import("@vue/runtime-core").PropType<number>;
|
|
361
|
+
} & {
|
|
362
|
+
default: undefined;
|
|
363
|
+
};
|
|
364
|
+
disabled: BooleanConstructor;
|
|
365
|
+
readonly: BooleanConstructor;
|
|
366
|
+
helperText: {
|
|
367
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
368
|
+
} & {
|
|
369
|
+
default: string;
|
|
370
|
+
};
|
|
371
|
+
error: {
|
|
372
|
+
type: import("@vue/runtime-core").PropType<string>;
|
|
373
|
+
} & {
|
|
374
|
+
default: string;
|
|
375
|
+
};
|
|
376
|
+
accessibilityHidden: {
|
|
377
|
+
type: import("@vue/runtime-core").PropType<boolean>;
|
|
378
|
+
} & {
|
|
379
|
+
default: undefined;
|
|
380
|
+
};
|
|
381
|
+
}>> & Readonly<{
|
|
382
|
+
"onUpdate:modelValue"?: ((_values: ChoiceValue[]) => any) | undefined;
|
|
383
|
+
}>, {
|
|
384
|
+
shrink: number;
|
|
385
|
+
error: string;
|
|
386
|
+
id: string;
|
|
387
|
+
disabled: boolean;
|
|
388
|
+
modelValue: readonly ChoiceValue[];
|
|
389
|
+
width: import("../layout.js").Dimension;
|
|
390
|
+
grow: number;
|
|
391
|
+
accessibilityHidden: boolean;
|
|
392
|
+
placeholder: string;
|
|
393
|
+
helperText: string;
|
|
394
|
+
readonly: boolean;
|
|
395
|
+
closeLabel: string;
|
|
396
|
+
emptyLabel: string;
|
|
397
|
+
searchLabel: string;
|
|
398
|
+
maxSelected: number;
|
|
399
|
+
removeLabel: string;
|
|
400
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
401
|
+
};
|
|
402
|
+
export {};
|
|
403
|
+
//# sourceMappingURL=configurator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator.d.ts","sourceRoot":"","sources":["../../src/vue/configurator.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAA;AAK3B,UAAU,UAAU;IAClB,MAAM,EAAE,SAAS,CAAA;IACjB,GAAG,EAAE,SAAS,CAAA;IACd,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,SAAS,CAAA;IAChB,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C;AAED,mGAAmG;AACnG,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,GAAG,QAAQ;kBAoTpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCA9SG,MAAM,GAAG,IAAI;iCAClB,MAAM;iCACN,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iGA4SY;QAAE,QAAQ,WAAW,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA5IjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+IxD"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, defineComponent, h, mergeProps, nextTick, ref, watch, } from '@vue/runtime-core';
|
|
2
|
+
import { choiceKey } from '../choice.js';
|
|
3
|
+
import { formatNumber, parseNumberDraft, stepNumber, validateNumberConstraints, } from '../number-input.js';
|
|
4
|
+
import { toggleMultiSelection, validateMultiSelection } from '../multi-select.js';
|
|
5
|
+
import { numberInputProps, multiSelectProps } from './configurator-props.js';
|
|
6
|
+
import { useButtonAction } from './button-content.js';
|
|
7
|
+
/** Shared controls compose the renderer primitives, keeping editing and selection in one place. */
|
|
8
|
+
export function createConfiguratorControls(ui, platform) {
|
|
9
|
+
const NumberInput = defineComponent({
|
|
10
|
+
name: 'MNumberInput',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
props: numberInputProps,
|
|
13
|
+
emits: {
|
|
14
|
+
'update:modelValue': (_value) => true,
|
|
15
|
+
'update:draft': (_value) => true,
|
|
16
|
+
validityChange: (_value) => true,
|
|
17
|
+
focus: () => true,
|
|
18
|
+
blur: () => true,
|
|
19
|
+
},
|
|
20
|
+
setup(props, { attrs, emit, expose }) {
|
|
21
|
+
useButtonAction();
|
|
22
|
+
const editor = ref();
|
|
23
|
+
const local = ref(props.draft ?? formatNumber(props.modelValue, props.locale));
|
|
24
|
+
const draft = computed(() => props.draft ?? local.value);
|
|
25
|
+
const parsed = computed(() => parseNumberDraft(draft.value, props.locale, props));
|
|
26
|
+
let alive = true;
|
|
27
|
+
onBeforeUnmount(() => {
|
|
28
|
+
alive = false;
|
|
29
|
+
});
|
|
30
|
+
let revision = 0;
|
|
31
|
+
let requested;
|
|
32
|
+
function setDraft(value) {
|
|
33
|
+
local.value = value;
|
|
34
|
+
emit('update:draft', value);
|
|
35
|
+
}
|
|
36
|
+
watch(() => [props.modelValue, props.locale], ([value, locale], previous) => {
|
|
37
|
+
if (!Object.is(value, requested) || locale !== previous[1])
|
|
38
|
+
setDraft(formatNumber(value, locale));
|
|
39
|
+
requested = undefined;
|
|
40
|
+
});
|
|
41
|
+
watch(() => props.draft, (value) => {
|
|
42
|
+
if (value !== undefined)
|
|
43
|
+
local.value = value;
|
|
44
|
+
});
|
|
45
|
+
function publish(value) {
|
|
46
|
+
const current = ++revision;
|
|
47
|
+
requested = value;
|
|
48
|
+
emit('update:modelValue', value);
|
|
49
|
+
void nextTick(() => {
|
|
50
|
+
if (!alive || current !== revision)
|
|
51
|
+
return;
|
|
52
|
+
if (!Object.is(props.modelValue, value))
|
|
53
|
+
setDraft(formatNumber(props.modelValue, props.locale));
|
|
54
|
+
requested = undefined;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function edit(value) {
|
|
58
|
+
if (props.disabled || props.readonly)
|
|
59
|
+
return;
|
|
60
|
+
revision++;
|
|
61
|
+
setDraft(value);
|
|
62
|
+
const validation = parseNumberDraft(value, props.locale, props);
|
|
63
|
+
emit('validityChange', validation);
|
|
64
|
+
if (validation.status === 'valid' || validation.status === 'empty')
|
|
65
|
+
publish(validation.value);
|
|
66
|
+
}
|
|
67
|
+
function step(direction) {
|
|
68
|
+
if (props.disabled || props.readonly)
|
|
69
|
+
return;
|
|
70
|
+
const current = parsed.value.status === 'valid' ? parsed.value.value : props.modelValue;
|
|
71
|
+
const value = stepNumber(current, direction, props);
|
|
72
|
+
setDraft(formatNumber(value, props.locale));
|
|
73
|
+
publish(value);
|
|
74
|
+
emit('validityChange', { status: 'valid', value });
|
|
75
|
+
}
|
|
76
|
+
expose({
|
|
77
|
+
focus: () => editor.value?.focus(),
|
|
78
|
+
blur: () => editor.value?.blur(),
|
|
79
|
+
});
|
|
80
|
+
return () => {
|
|
81
|
+
validateNumberConstraints(props);
|
|
82
|
+
if (!props.label.trim())
|
|
83
|
+
throw new TypeError('NumberInput requires a label.');
|
|
84
|
+
const blocked = props.disabled || props.readonly;
|
|
85
|
+
const issue = ['invalid', 'range'].includes(parsed.value.status);
|
|
86
|
+
const message = issue
|
|
87
|
+
? props.locale === 'pt-BR'
|
|
88
|
+
? 'Informe um número dentro dos limites.'
|
|
89
|
+
: 'Enter a number within the allowed range.'
|
|
90
|
+
: '';
|
|
91
|
+
return h(ui.Row, {
|
|
92
|
+
gap: 'sm',
|
|
93
|
+
align: 'end',
|
|
94
|
+
width: props.width,
|
|
95
|
+
grow: props.grow,
|
|
96
|
+
shrink: props.shrink,
|
|
97
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
98
|
+
}, () => [
|
|
99
|
+
h(ui.Input, mergeProps(attrs, {
|
|
100
|
+
ref: editor,
|
|
101
|
+
id: props.id,
|
|
102
|
+
modelValue: draft.value,
|
|
103
|
+
label: props.label,
|
|
104
|
+
name: props.name,
|
|
105
|
+
placeholder: props.placeholder,
|
|
106
|
+
inputmode: 'decimal',
|
|
107
|
+
disabled: props.disabled,
|
|
108
|
+
readonly: props.readonly,
|
|
109
|
+
helperText: props.helperText,
|
|
110
|
+
error: props.error || message,
|
|
111
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
112
|
+
width: 0,
|
|
113
|
+
grow: 1,
|
|
114
|
+
autocorrect: false,
|
|
115
|
+
autocapitalize: 'none',
|
|
116
|
+
'onUpdate:modelValue': edit,
|
|
117
|
+
onFocus: () => emit('focus'),
|
|
118
|
+
onBlur: () => emit('blur'),
|
|
119
|
+
...(platform === 'web'
|
|
120
|
+
? {
|
|
121
|
+
onKeydown: (event) => {
|
|
122
|
+
if (!blocked &&
|
|
123
|
+
!event.isComposing &&
|
|
124
|
+
['ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
step(event.key === 'ArrowUp' ? 1 : -1);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
: {}),
|
|
131
|
+
})),
|
|
132
|
+
h(ui.Button, {
|
|
133
|
+
text: '−',
|
|
134
|
+
variant: 'secondary',
|
|
135
|
+
accessibilityLabel: `${props.decrementLabel}: ${props.label}`,
|
|
136
|
+
disabled: blocked ||
|
|
137
|
+
(props.min !== undefined &&
|
|
138
|
+
props.modelValue !== null &&
|
|
139
|
+
props.modelValue <= props.min),
|
|
140
|
+
onClick: () => step(-1),
|
|
141
|
+
}),
|
|
142
|
+
h(ui.Button, {
|
|
143
|
+
text: '+',
|
|
144
|
+
variant: 'secondary',
|
|
145
|
+
accessibilityLabel: `${props.incrementLabel}: ${props.label}`,
|
|
146
|
+
disabled: blocked ||
|
|
147
|
+
(props.max !== undefined &&
|
|
148
|
+
props.modelValue !== null &&
|
|
149
|
+
props.modelValue >= props.max),
|
|
150
|
+
onClick: () => step(1),
|
|
151
|
+
}),
|
|
152
|
+
]);
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
const MultiSelect = defineComponent({
|
|
157
|
+
name: 'MMultiSelect',
|
|
158
|
+
inheritAttrs: false,
|
|
159
|
+
props: multiSelectProps,
|
|
160
|
+
emits: { 'update:modelValue': (_values) => true },
|
|
161
|
+
setup(props, { attrs, emit }) {
|
|
162
|
+
useButtonAction();
|
|
163
|
+
const open = ref(false), query = ref('');
|
|
164
|
+
const trigger = ref();
|
|
165
|
+
let alive = true;
|
|
166
|
+
onBeforeUnmount(() => {
|
|
167
|
+
alive = false;
|
|
168
|
+
});
|
|
169
|
+
function restoreFocus() {
|
|
170
|
+
void nextTick(() => {
|
|
171
|
+
if (alive)
|
|
172
|
+
ui.focusTrigger(trigger.value);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
watch(() => props.disabled || props.readonly, (blocked) => {
|
|
176
|
+
if (blocked)
|
|
177
|
+
open.value = false;
|
|
178
|
+
});
|
|
179
|
+
watch(open, (value) => {
|
|
180
|
+
if (!value && platform === 'native' && !props.disabled)
|
|
181
|
+
restoreFocus();
|
|
182
|
+
});
|
|
183
|
+
function toggle(value) {
|
|
184
|
+
if (props.disabled || props.readonly)
|
|
185
|
+
return;
|
|
186
|
+
const next = toggleMultiSelection(props.options, props.modelValue, value, props.maxSelected);
|
|
187
|
+
if (next)
|
|
188
|
+
emit('update:modelValue', next);
|
|
189
|
+
}
|
|
190
|
+
return () => {
|
|
191
|
+
validateMultiSelection(props.options, props.modelValue, props.maxSelected);
|
|
192
|
+
if (!props.label.trim())
|
|
193
|
+
throw new TypeError('MultiSelect requires a label.');
|
|
194
|
+
const selected = props.modelValue.map((value) => props.options.find((option) => option.value === value));
|
|
195
|
+
const filter = query.value.trim().toLocaleLowerCase();
|
|
196
|
+
const options = props.options.filter((option) => option.label.toLocaleLowerCase().includes(filter));
|
|
197
|
+
return h(ui.Column, mergeProps(attrs, {
|
|
198
|
+
gap: 'sm',
|
|
199
|
+
width: props.width,
|
|
200
|
+
grow: props.grow,
|
|
201
|
+
shrink: props.shrink,
|
|
202
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
203
|
+
}), () => [
|
|
204
|
+
h(ui.Text, { text: props.label, variant: 'caption', weight: '600' }),
|
|
205
|
+
h(ui.Button, {
|
|
206
|
+
ref: trigger,
|
|
207
|
+
id: props.id,
|
|
208
|
+
text: selected.length ? `${props.label} · ${selected.length}` : props.placeholder,
|
|
209
|
+
accessibilityLabel: `${props.label}: ${selected.map((option) => option.label).join(', ') || props.placeholder}`,
|
|
210
|
+
variant: 'secondary',
|
|
211
|
+
disabled: props.disabled || props.readonly,
|
|
212
|
+
onClick: () => {
|
|
213
|
+
ui.focusTrigger(trigger.value);
|
|
214
|
+
query.value = '';
|
|
215
|
+
open.value = true;
|
|
216
|
+
},
|
|
217
|
+
}),
|
|
218
|
+
selected.length
|
|
219
|
+
? h(ui.Row, { gap: 'sm', wrap: true }, () => selected.map((option) => h(ui.Chip, {
|
|
220
|
+
key: choiceKey(option.value),
|
|
221
|
+
label: option.label,
|
|
222
|
+
removable: true,
|
|
223
|
+
removeLabel: `${props.removeLabel}: ${option.label}`,
|
|
224
|
+
disabled: props.disabled || props.readonly || option.disabled,
|
|
225
|
+
onRemove: () => {
|
|
226
|
+
toggle(option.value);
|
|
227
|
+
restoreFocus();
|
|
228
|
+
},
|
|
229
|
+
})))
|
|
230
|
+
: null,
|
|
231
|
+
props.error || props.helperText
|
|
232
|
+
? h(ui.Text, {
|
|
233
|
+
text: props.error || props.helperText,
|
|
234
|
+
tone: props.error ? 'danger' : 'muted',
|
|
235
|
+
variant: 'caption',
|
|
236
|
+
})
|
|
237
|
+
: null,
|
|
238
|
+
h(ui.Sheet, {
|
|
239
|
+
open: open.value,
|
|
240
|
+
title: props.label,
|
|
241
|
+
closeLabel: props.closeLabel,
|
|
242
|
+
'onUpdate:open': (value) => {
|
|
243
|
+
open.value = value;
|
|
244
|
+
},
|
|
245
|
+
}, () => [
|
|
246
|
+
h(ui.Column, { gap: 'md' }, () => [
|
|
247
|
+
h(ui.Input, {
|
|
248
|
+
modelValue: query.value,
|
|
249
|
+
label: props.searchLabel,
|
|
250
|
+
type: 'search',
|
|
251
|
+
autocorrect: false,
|
|
252
|
+
'onUpdate:modelValue': (value) => {
|
|
253
|
+
query.value = value;
|
|
254
|
+
},
|
|
255
|
+
}),
|
|
256
|
+
...options.map((option) => h(ui.Checkbox, {
|
|
257
|
+
key: choiceKey(option.value),
|
|
258
|
+
label: option.label,
|
|
259
|
+
helperText: option.helperText ?? '',
|
|
260
|
+
modelValue: props.modelValue.includes(option.value),
|
|
261
|
+
disabled: props.disabled ||
|
|
262
|
+
props.readonly ||
|
|
263
|
+
option.disabled ||
|
|
264
|
+
(!props.modelValue.includes(option.value) &&
|
|
265
|
+
props.maxSelected !== undefined &&
|
|
266
|
+
props.modelValue.length >= props.maxSelected),
|
|
267
|
+
'onUpdate:modelValue': () => toggle(option.value),
|
|
268
|
+
})),
|
|
269
|
+
!options.length ? h(ui.Text, { text: props.emptyLabel, tone: 'muted' }) : null,
|
|
270
|
+
h(ui.Button, {
|
|
271
|
+
text: props.closeLabel,
|
|
272
|
+
onClick: () => {
|
|
273
|
+
open.value = false;
|
|
274
|
+
},
|
|
275
|
+
}),
|
|
276
|
+
]),
|
|
277
|
+
]),
|
|
278
|
+
]);
|
|
279
|
+
};
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
return {
|
|
283
|
+
MNumberInput: NumberInput,
|
|
284
|
+
MMultiSelect: MultiSelect,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=configurator.js.map
|