@getcortexlabs/mavis 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 +9 -5
- package/dist/app-icons.d.ts +26 -0
- package/dist/app-icons.d.ts.map +1 -0
- package/dist/app-icons.js +9 -0
- package/dist/app-icons.js.map +1 -0
- package/dist/date-format.d.ts +3 -0
- package/dist/date-format.d.ts.map +1 -0
- package/dist/date-format.js +2 -0
- package/dist/date-format.js.map +1 -0
- package/dist/files.d.ts +4 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +3 -0
- package/dist/files.js.map +1 -0
- package/dist/native/app-icons.android.d.ts +4 -0
- package/dist/native/app-icons.android.d.ts.map +1 -0
- package/dist/native/app-icons.android.js +67 -0
- package/dist/native/app-icons.android.js.map +1 -0
- package/dist/native/app-icons.d.ts +4 -0
- package/dist/native/app-icons.d.ts.map +1 -0
- package/dist/native/app-icons.ios.d.ts +4 -0
- package/dist/native/app-icons.ios.d.ts.map +1 -0
- package/dist/native/app-icons.ios.js +45 -0
- package/dist/native/app-icons.ios.js.map +1 -0
- package/dist/native/app-icons.js +9 -0
- package/dist/native/app-icons.js.map +1 -0
- package/dist/native/appearance.android.d.ts +4 -0
- package/dist/native/appearance.android.d.ts.map +1 -0
- package/dist/native/appearance.android.js +55 -0
- package/dist/native/appearance.android.js.map +1 -0
- package/dist/native/appearance.d.ts +4 -0
- package/dist/native/appearance.d.ts.map +1 -0
- package/dist/native/appearance.js +31 -0
- package/dist/native/appearance.js.map +1 -0
- package/dist/native/avatar-image.d.ts +4 -0
- package/dist/native/avatar-image.d.ts.map +1 -0
- package/dist/native/avatar-image.js +12 -0
- package/dist/native/avatar-image.js.map +1 -0
- package/dist/native/avatar-label.android.d.ts +9 -0
- package/dist/native/avatar-label.android.d.ts.map +1 -0
- package/dist/native/avatar-label.android.js +9 -0
- package/dist/native/avatar-label.android.js.map +1 -0
- package/dist/native/avatar-label.d.ts +2 -0
- package/dist/native/avatar-label.d.ts.map +1 -0
- package/dist/native/avatar-label.js +2 -0
- package/dist/native/avatar-label.js.map +1 -0
- package/dist/native/box.android.d.ts +5 -0
- package/dist/native/box.android.d.ts.map +1 -0
- package/dist/native/box.android.js +7 -0
- package/dist/native/box.android.js.map +1 -0
- package/dist/native/box.d.ts +2 -0
- package/dist/native/box.d.ts.map +1 -0
- package/dist/native/box.ios.d.ts +10 -0
- package/dist/native/box.ios.d.ts.map +1 -0
- package/dist/native/box.ios.js +40 -0
- package/dist/native/box.ios.js.map +1 -0
- package/dist/native/box.js +3 -0
- package/dist/native/box.js.map +1 -0
- package/dist/native/button.android.d.ts +11 -0
- package/dist/native/button.android.d.ts.map +1 -0
- package/dist/native/button.android.js +31 -0
- package/dist/native/button.android.js.map +1 -0
- package/dist/native/button.ios.d.ts +13 -1
- package/dist/native/button.ios.d.ts.map +1 -1
- package/dist/native/button.ios.js +29 -1
- package/dist/native/button.ios.js.map +1 -1
- package/dist/native/checkbox.android.d.ts +7 -0
- package/dist/native/checkbox.android.d.ts.map +1 -0
- package/dist/native/checkbox.android.js +26 -0
- package/dist/native/checkbox.android.js.map +1 -0
- package/dist/native/checkbox.d.ts +7 -0
- package/dist/native/checkbox.d.ts.map +1 -0
- package/dist/native/checkbox.js +7 -0
- package/dist/native/checkbox.js.map +1 -0
- package/dist/native/collection-motion.d.ts +5 -0
- package/dist/native/collection-motion.d.ts.map +1 -0
- package/dist/native/collection-motion.js +157 -0
- package/dist/native/collection-motion.js.map +1 -0
- package/dist/native/combobox-editor.android.d.ts +3 -0
- package/dist/native/combobox-editor.android.d.ts.map +1 -0
- package/dist/native/combobox-editor.android.js +5 -0
- package/dist/native/combobox-editor.android.js.map +1 -0
- package/dist/native/combobox-editor.d.ts +4 -0
- package/dist/native/combobox-editor.d.ts.map +1 -0
- package/dist/native/combobox-editor.js +5 -0
- package/dist/native/combobox-editor.js.map +1 -0
- package/dist/native/composed-button.android.d.ts +4 -0
- package/dist/native/composed-button.android.d.ts.map +1 -0
- package/dist/native/composed-button.android.js +53 -0
- package/dist/native/composed-button.android.js.map +1 -0
- package/dist/native/composed-button.d.ts +3 -0
- package/dist/native/composed-button.d.ts.map +1 -0
- package/dist/native/composed-button.js +4 -0
- package/dist/native/composed-button.js.map +1 -0
- package/dist/native/date-format.android.d.ts +5 -0
- package/dist/native/date-format.android.d.ts.map +1 -0
- package/dist/native/date-format.android.js +39 -0
- package/dist/native/date-format.android.js.map +1 -0
- package/dist/native/date-format.d.ts +6 -0
- package/dist/native/date-format.d.ts.map +1 -0
- package/dist/native/date-format.ios.d.ts +5 -0
- package/dist/native/date-format.ios.d.ts.map +1 -0
- package/dist/native/date-format.ios.js +29 -0
- package/dist/native/date-format.ios.js.map +1 -0
- package/dist/native/date-format.js +8 -0
- package/dist/native/date-format.js.map +1 -0
- package/dist/native/dialog.android.d.ts +12 -0
- package/dist/native/dialog.android.d.ts.map +1 -0
- package/dist/native/dialog.android.js +46 -0
- package/dist/native/dialog.android.js.map +1 -0
- package/dist/native/dialog.d.ts +12 -0
- package/dist/native/dialog.d.ts.map +1 -0
- package/dist/native/dialog.ios.d.ts +12 -0
- package/dist/native/dialog.ios.d.ts.map +1 -0
- package/dist/native/dialog.ios.js +13 -0
- package/dist/native/dialog.ios.js.map +1 -0
- package/dist/native/dialog.js +4 -0
- package/dist/native/dialog.js.map +1 -0
- package/dist/native/dynamic-type.d.ts +15 -0
- package/dist/native/dynamic-type.d.ts.map +1 -0
- package/dist/native/dynamic-type.js +47 -0
- package/dist/native/dynamic-type.js.map +1 -0
- package/dist/native/file-access.d.ts +23 -0
- package/dist/native/file-access.d.ts.map +1 -0
- package/dist/native/file-access.js +55 -0
- package/dist/native/file-access.js.map +1 -0
- package/dist/native/file-picker.android.d.ts +3 -0
- package/dist/native/file-picker.android.d.ts.map +1 -0
- package/dist/native/file-picker.android.js +147 -0
- package/dist/native/file-picker.android.js.map +1 -0
- package/dist/native/file-picker.d.ts +4 -0
- package/dist/native/file-picker.d.ts.map +1 -0
- package/dist/native/file-picker.ios.d.ts +3 -0
- package/dist/native/file-picker.ios.d.ts.map +1 -0
- package/dist/native/file-picker.ios.js +152 -0
- package/dist/native/file-picker.ios.js.map +1 -0
- package/dist/native/file-picker.js +7 -0
- package/dist/native/file-picker.js.map +1 -0
- package/dist/native/flex-children.d.ts +4 -0
- package/dist/native/flex-children.d.ts.map +1 -0
- package/dist/native/flex-children.js +12 -0
- package/dist/native/flex-children.js.map +1 -0
- package/dist/native/flex-layout.android.d.ts +3 -1
- package/dist/native/flex-layout.android.d.ts.map +1 -1
- package/dist/native/flex-layout.android.js +9 -0
- package/dist/native/flex-layout.android.js.map +1 -1
- package/dist/native/flex-layout.ios.d.ts +14 -1
- package/dist/native/flex-layout.ios.d.ts.map +1 -1
- package/dist/native/flex-layout.ios.js +113 -0
- package/dist/native/flex-layout.ios.js.map +1 -1
- package/dist/native/image-effects.d.ts +11 -0
- package/dist/native/image-effects.d.ts.map +1 -0
- package/dist/native/image-effects.js +61 -0
- package/dist/native/image-effects.js.map +1 -0
- package/dist/native/input-action.d.ts +5 -0
- package/dist/native/input-action.d.ts.map +1 -0
- package/dist/native/input-action.js +13 -0
- package/dist/native/input-action.js.map +1 -0
- package/dist/native/keyboard-dismiss.android.d.ts +8 -0
- package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.android.js +9 -0
- package/dist/native/keyboard-dismiss.android.js.map +1 -0
- package/dist/native/keyboard-dismiss.d.ts +10 -0
- package/dist/native/keyboard-dismiss.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
- package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.js +91 -0
- package/dist/native/keyboard-dismiss.ios.js.map +1 -0
- package/dist/native/keyboard-dismiss.js +6 -0
- package/dist/native/keyboard-dismiss.js.map +1 -0
- package/dist/native/label.android.d.ts +12 -0
- package/dist/native/label.android.d.ts.map +1 -0
- package/dist/native/label.android.js +19 -0
- package/dist/native/label.android.js.map +1 -0
- package/dist/native/label.ios.d.ts +14 -1
- package/dist/native/label.ios.d.ts.map +1 -1
- package/dist/native/label.ios.js +37 -1
- package/dist/native/label.ios.js.map +1 -1
- package/dist/native/measure-memo.d.ts +37 -0
- package/dist/native/measure-memo.d.ts.map +1 -0
- package/dist/native/measure-memo.js +82 -0
- package/dist/native/measure-memo.js.map +1 -0
- package/dist/native/motion-owner.d.ts +5 -0
- package/dist/native/motion-owner.d.ts.map +1 -0
- package/dist/native/motion-owner.js +58 -0
- package/dist/native/motion-owner.js.map +1 -0
- package/dist/native/motion-region.d.ts +7 -0
- package/dist/native/motion-region.d.ts.map +1 -0
- package/dist/native/motion-region.js +249 -0
- package/dist/native/motion-region.js.map +1 -0
- package/dist/native/motion-surface.d.ts +9 -0
- package/dist/native/motion-surface.d.ts.map +1 -0
- package/dist/native/motion-surface.js +229 -0
- package/dist/native/motion-surface.js.map +1 -0
- package/dist/native/platform-motion.d.ts +5 -0
- package/dist/native/platform-motion.d.ts.map +1 -0
- package/dist/native/platform-motion.js +90 -0
- package/dist/native/platform-motion.js.map +1 -0
- package/dist/native/press.d.ts +8 -2
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +58 -8
- package/dist/native/press.js.map +1 -1
- package/dist/native/progress.d.ts +7 -0
- package/dist/native/progress.d.ts.map +1 -0
- package/dist/native/progress.js +77 -0
- package/dist/native/progress.js.map +1 -0
- package/dist/native/screen.android.d.ts +6 -0
- package/dist/native/screen.android.d.ts.map +1 -0
- package/dist/native/screen.android.js +8 -0
- package/dist/native/screen.android.js.map +1 -0
- package/dist/native/screen.d.ts +2 -0
- package/dist/native/screen.d.ts.map +1 -0
- package/dist/native/screen.js +3 -0
- package/dist/native/screen.js.map +1 -0
- package/dist/native/scroll-motion.d.ts +12 -0
- package/dist/native/scroll-motion.d.ts.map +1 -0
- package/dist/native/scroll-motion.js +100 -0
- package/dist/native/scroll-motion.js.map +1 -0
- package/dist/native/section-scroll.d.ts +9 -0
- package/dist/native/section-scroll.d.ts.map +1 -0
- package/dist/native/section-scroll.js +69 -0
- package/dist/native/section-scroll.js.map +1 -0
- package/dist/native/segmented.d.ts +14 -0
- package/dist/native/segmented.d.ts.map +1 -0
- package/dist/native/segmented.js +86 -0
- package/dist/native/segmented.js.map +1 -0
- package/dist/native/sheet.android.d.ts +18 -0
- package/dist/native/sheet.android.d.ts.map +1 -0
- package/dist/native/sheet.android.js +16 -0
- package/dist/native/sheet.android.js.map +1 -0
- package/dist/native/sheet.d.ts +21 -0
- package/dist/native/sheet.d.ts.map +1 -0
- package/dist/native/sheet.ios.d.ts +19 -0
- package/dist/native/sheet.ios.d.ts.map +1 -0
- package/dist/native/sheet.ios.js +41 -0
- package/dist/native/sheet.ios.js.map +1 -0
- package/dist/native/sheet.js +17 -0
- package/dist/native/sheet.js.map +1 -0
- package/dist/native/surface-effects.d.ts +4 -0
- package/dist/native/surface-effects.d.ts.map +1 -0
- package/dist/native/surface-effects.js +31 -0
- package/dist/native/surface-effects.js.map +1 -0
- package/dist/native/tabs.android.d.ts +3 -0
- package/dist/native/tabs.android.d.ts.map +1 -0
- package/dist/native/tabs.android.js +29 -0
- package/dist/native/tabs.android.js.map +1 -0
- package/dist/native/tabs.d.ts +3 -0
- package/dist/native/tabs.d.ts.map +1 -0
- package/dist/native/tabs.js +4 -0
- package/dist/native/tabs.js.map +1 -0
- package/dist/native/text-field.android.d.ts +1 -0
- package/dist/native/text-field.android.d.ts.map +1 -1
- package/dist/native/text-field.android.js +13 -0
- package/dist/native/text-field.android.js.map +1 -1
- package/dist/native/text-field.ios.d.ts +9 -0
- package/dist/native/text-field.ios.d.ts.map +1 -0
- package/dist/native/text-field.ios.js +52 -0
- package/dist/native/text-field.ios.js.map +1 -0
- package/dist/native/text-view.ios.d.ts +7 -0
- package/dist/native/text-view.ios.d.ts.map +1 -0
- package/dist/native/text-view.ios.js +10 -0
- package/dist/native/text-view.ios.js.map +1 -0
- package/dist/native/toast.android.d.ts +4 -0
- package/dist/native/toast.android.d.ts.map +1 -0
- package/dist/native/toast.android.js +10 -0
- package/dist/native/toast.android.js.map +1 -0
- package/dist/native/toast.d.ts +4 -0
- package/dist/native/toast.d.ts.map +1 -0
- package/dist/native/toast.ios.d.ts +4 -0
- package/dist/native/toast.ios.d.ts.map +1 -0
- package/dist/native/toast.ios.js +8 -0
- package/dist/native/toast.ios.js.map +1 -0
- package/dist/native/toast.js +5 -0
- package/dist/native/toast.js.map +1 -0
- package/dist/native/visual-effects.d.ts +5 -0
- package/dist/native/visual-effects.d.ts.map +1 -0
- package/dist/native/visual-effects.js +126 -0
- package/dist/native/visual-effects.js.map +1 -0
- package/dist/vue/components/ChartPlot.d.ts +65 -0
- package/dist/vue/components/ChartPlot.d.ts.map +1 -0
- package/dist/vue/components/ChartPlot.js +100 -0
- package/dist/vue/components/ChartPlot.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts +114 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +218 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/DateCalendar.d.ts +109 -0
- package/dist/vue/components/DateCalendar.d.ts.map +1 -0
- package/dist/vue/components/DateCalendar.js +98 -0
- package/dist/vue/components/DateCalendar.js.map +1 -0
- package/dist/vue/components/LoadingDecoration.d.ts +116 -0
- package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
- package/dist/vue/components/LoadingDecoration.js +34 -0
- package/dist/vue/components/LoadingDecoration.js.map +1 -0
- package/dist/vue/components/MAccordion.d.ts +119 -0
- package/dist/vue/components/MAccordion.d.ts.map +1 -0
- package/dist/vue/components/MAccordion.js +83 -0
- package/dist/vue/components/MAccordion.js.map +1 -0
- package/dist/vue/components/MAlert.d.ts +109 -0
- package/dist/vue/components/MAlert.d.ts.map +1 -0
- package/dist/vue/components/MAlert.js +126 -0
- package/dist/vue/components/MAlert.js.map +1 -0
- package/dist/vue/components/MAvatar.d.ts +80 -0
- package/dist/vue/components/MAvatar.d.ts.map +1 -0
- package/dist/vue/components/MAvatar.js +86 -0
- package/dist/vue/components/MAvatar.js.map +1 -0
- package/dist/vue/components/MBadge.d.ts +70 -0
- package/dist/vue/components/MBadge.d.ts.map +1 -0
- package/dist/vue/components/MBadge.js +30 -0
- package/dist/vue/components/MBadge.js.map +1 -0
- package/dist/vue/components/MButton.d.ts +212 -32
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +192 -20
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +113 -21
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +24 -6
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MCheckbox.d.ts +103 -0
- package/dist/vue/components/MCheckbox.d.ts.map +1 -0
- package/dist/vue/components/MCheckbox.js +26 -0
- package/dist/vue/components/MCheckbox.js.map +1 -0
- package/dist/vue/components/MChip.d.ts +117 -0
- package/dist/vue/components/MChip.d.ts.map +1 -0
- package/dist/vue/components/MChip.js +120 -0
- package/dist/vue/components/MChip.js.map +1 -0
- package/dist/vue/components/MCombobox.d.ts +279 -0
- package/dist/vue/components/MCombobox.d.ts.map +1 -0
- package/dist/vue/components/MCombobox.js +234 -0
- package/dist/vue/components/MCombobox.js.map +1 -0
- package/dist/vue/components/MDatePicker.d.ts +1350 -0
- package/dist/vue/components/MDatePicker.d.ts.map +1 -0
- package/dist/vue/components/MDatePicker.js +25 -0
- package/dist/vue/components/MDatePicker.js.map +1 -0
- package/dist/vue/components/MDialog.d.ts +100 -0
- package/dist/vue/components/MDialog.d.ts.map +1 -0
- package/dist/vue/components/MDialog.js +245 -0
- package/dist/vue/components/MDialog.js.map +1 -0
- package/dist/vue/components/MEmptyState.d.ts +117 -0
- package/dist/vue/components/MEmptyState.d.ts.map +1 -0
- package/dist/vue/components/MEmptyState.js +79 -0
- package/dist/vue/components/MEmptyState.js.map +1 -0
- package/dist/vue/components/MFilePicker.d.ts +112 -0
- package/dist/vue/components/MFilePicker.d.ts.map +1 -0
- package/dist/vue/components/MFilePicker.js +196 -0
- package/dist/vue/components/MFilePicker.js.map +1 -0
- package/dist/vue/components/MGrid.d.ts +165 -0
- package/dist/vue/components/MGrid.d.ts.map +1 -0
- package/dist/vue/components/MGrid.js +52 -0
- package/dist/vue/components/MGrid.js.map +1 -0
- package/dist/vue/components/MIcon.d.ts +75 -0
- package/dist/vue/components/MIcon.d.ts.map +1 -0
- package/dist/vue/components/MIcon.js +45 -0
- package/dist/vue/components/MIcon.js.map +1 -0
- package/dist/vue/components/MImage.d.ts +248 -0
- package/dist/vue/components/MImage.d.ts.map +1 -0
- package/dist/vue/components/MImage.js +157 -0
- package/dist/vue/components/MImage.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +195 -50
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +134 -20
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts +120 -0
- package/dist/vue/components/MLink.d.ts.map +1 -0
- package/dist/vue/components/MLink.js +76 -0
- package/dist/vue/components/MLink.js.map +1 -0
- package/dist/vue/components/MListItem.d.ts +106 -0
- package/dist/vue/components/MListItem.d.ts.map +1 -0
- package/dist/vue/components/MListItem.js +53 -0
- package/dist/vue/components/MListItem.js.map +1 -0
- package/dist/vue/components/MPopover.d.ts +106 -0
- package/dist/vue/components/MPopover.d.ts.map +1 -0
- package/dist/vue/components/MPopover.js +209 -0
- package/dist/vue/components/MPopover.js.map +1 -0
- package/dist/vue/components/MProgress.d.ts +122 -0
- package/dist/vue/components/MProgress.d.ts.map +1 -0
- package/dist/vue/components/MProgress.js +75 -0
- package/dist/vue/components/MProgress.js.map +1 -0
- package/dist/vue/components/MRadioGroup.d.ts +103 -0
- package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
- package/dist/vue/components/MRadioGroup.js +57 -0
- package/dist/vue/components/MRadioGroup.js.map +1 -0
- package/dist/vue/components/MRangeSlider.d.ts +105 -0
- package/dist/vue/components/MRangeSlider.d.ts.map +1 -0
- package/dist/vue/components/MRangeSlider.js +107 -0
- package/dist/vue/components/MRangeSlider.js.map +1 -0
- package/dist/vue/components/MReveal.d.ts +73 -37
- package/dist/vue/components/MReveal.d.ts.map +1 -1
- package/dist/vue/components/MReveal.js +80 -37
- package/dist/vue/components/MReveal.js.map +1 -1
- package/dist/vue/components/MScreen.d.ts +42 -8
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +91 -6
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSegmentedControl.d.ts +95 -0
- package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
- package/dist/vue/components/MSegmentedControl.js +172 -0
- package/dist/vue/components/MSegmentedControl.js.map +1 -0
- package/dist/vue/components/MSelect.d.ts +140 -0
- package/dist/vue/components/MSelect.d.ts.map +1 -0
- package/dist/vue/components/MSelect.js +158 -0
- package/dist/vue/components/MSelect.js.map +1 -0
- package/dist/vue/components/MSeparator.d.ts +56 -0
- package/dist/vue/components/MSeparator.d.ts.map +1 -0
- package/dist/vue/components/MSeparator.js +36 -0
- package/dist/vue/components/MSeparator.js.map +1 -0
- package/dist/vue/components/MSheet.d.ts +116 -0
- package/dist/vue/components/MSheet.d.ts.map +1 -0
- package/dist/vue/components/MSheet.js +313 -0
- package/dist/vue/components/MSheet.js.map +1 -0
- package/dist/vue/components/MSkeleton.d.ts +89 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -0
- package/dist/vue/components/MSkeleton.js +89 -0
- package/dist/vue/components/MSkeleton.js.map +1 -0
- package/dist/vue/components/MSlider.d.ts +8 -4
- package/dist/vue/components/MSlider.d.ts.map +1 -1
- package/dist/vue/components/MSlider.js +3 -2
- package/dist/vue/components/MSlider.js.map +1 -1
- package/dist/vue/components/MStack.d.ts +199 -0
- package/dist/vue/components/MStack.d.ts.map +1 -0
- package/dist/vue/components/MStack.js +62 -0
- package/dist/vue/components/MStack.js.map +1 -0
- package/dist/vue/components/MSwitch.d.ts +89 -0
- package/dist/vue/components/MSwitch.d.ts.map +1 -0
- package/dist/vue/components/MSwitch.js +173 -0
- package/dist/vue/components/MSwitch.js.map +1 -0
- package/dist/vue/components/MTabs.d.ts +101 -0
- package/dist/vue/components/MTabs.d.ts.map +1 -0
- package/dist/vue/components/MTabs.js +245 -0
- package/dist/vue/components/MTabs.js.map +1 -0
- package/dist/vue/components/MText.d.ts +61 -25
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +47 -19
- package/dist/vue/components/MText.js.map +1 -1
- package/dist/vue/components/MTimePicker.d.ts +655 -0
- package/dist/vue/components/MTimePicker.d.ts.map +1 -0
- package/dist/vue/components/MTimePicker.js +50 -0
- package/dist/vue/components/MTimePicker.js.map +1 -0
- package/dist/vue/components/MToast.d.ts +23 -0
- package/dist/vue/components/MToast.d.ts.map +1 -0
- package/dist/vue/components/MToast.js +242 -0
- package/dist/vue/components/MToast.js.map +1 -0
- package/dist/vue/components/MTooltip.d.ts +65 -0
- package/dist/vue/components/MTooltip.d.ts.map +1 -0
- package/dist/vue/components/MTooltip.js +35 -0
- package/dist/vue/components/MTooltip.js.map +1 -0
- package/dist/vue/components/MVirtualList.d.ts +3 -0
- package/dist/vue/components/MVirtualList.d.ts.map +1 -0
- package/dist/vue/components/MVirtualList.js +88 -0
- package/dist/vue/components/MVirtualList.js.map +1 -0
- package/dist/vue/components/configurator.d.ts +541 -0
- package/dist/vue/components/configurator.d.ts.map +1 -0
- package/dist/vue/components/configurator.js +24 -0
- package/dist/vue/components/configurator.js.map +1 -0
- package/dist/vue/components/discovery.d.ts +282 -0
- package/dist/vue/components/discovery.d.ts.map +1 -0
- package/dist/vue/components/discovery.js +67 -0
- package/dist/vue/components/discovery.js.map +1 -0
- package/dist/vue/components/layout.d.ts +230 -88
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +16 -9
- package/dist/vue/components/layout.js.map +1 -1
- package/dist/vue/components/navigation.d.ts +225 -0
- package/dist/vue/components/navigation.d.ts.map +1 -0
- package/dist/vue/components/navigation.js +16 -0
- package/dist/vue/components/navigation.js.map +1 -0
- package/dist/vue/components/wayfinding.d.ts +441 -0
- package/dist/vue/components/wayfinding.d.ts.map +1 -0
- package/dist/vue/components/wayfinding.js +37 -0
- package/dist/vue/components/wayfinding.js.map +1 -0
- package/dist/vue/components/workflows.d.ts +251 -0
- package/dist/vue/components/workflows.d.ts.map +1 -0
- package/dist/vue/components/workflows.js +35 -0
- package/dist/vue/components/workflows.js.map +1 -0
- package/dist/vue/index.d.ts +54 -9
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +105 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/layers.d.ts +19 -0
- package/dist/vue/layers.d.ts.map +1 -0
- package/dist/vue/layers.js +26 -0
- package/dist/vue/layers.js.map +1 -0
- package/dist/vue/native-view.d.ts +6 -0
- package/dist/vue/native-view.d.ts.map +1 -0
- package/dist/vue/native-view.js +5 -0
- package/dist/vue/native-view.js.map +1 -0
- package/dist/vue/navigation.d.ts +4 -0
- package/dist/vue/navigation.d.ts.map +1 -0
- package/dist/vue/navigation.js +16 -0
- package/dist/vue/navigation.js.map +1 -0
- package/dist/vue/props.d.ts +12 -11
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +25 -10
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/router-navigation.d.ts +25 -0
- package/dist/vue/router-navigation.d.ts.map +1 -0
- package/dist/vue/router-navigation.js +15 -0
- package/dist/vue/router-navigation.js.map +1 -0
- package/dist/vue/services.d.ts +16 -0
- package/dist/vue/services.d.ts.map +1 -0
- package/dist/vue/services.js +23 -0
- package/dist/vue/services.js.map +1 -0
- package/dist/vue/system-back.d.ts +11 -0
- package/dist/vue/system-back.d.ts.map +1 -0
- package/dist/vue/system-back.js +2 -0
- package/dist/vue/system-back.js.map +1 -0
- package/dist/vue/use-choice-paint.d.ts +9 -0
- package/dist/vue/use-choice-paint.d.ts.map +1 -0
- package/dist/vue/use-choice-paint.js +32 -0
- package/dist/vue/use-choice-paint.js.map +1 -0
- package/dist/vue/use-motion-region.d.ts +7 -0
- package/dist/vue/use-motion-region.d.ts.map +1 -0
- package/dist/vue/use-motion-region.js +28 -0
- package/dist/vue/use-motion-region.js.map +1 -0
- package/dist/vue/use-motion-surface.d.ts +8 -0
- package/dist/vue/use-motion-surface.d.ts.map +1 -0
- package/dist/vue/use-motion-surface.js +105 -0
- package/dist/vue/use-motion-surface.js.map +1 -0
- package/dist/vue/use-press.d.ts +1 -1
- package/dist/vue/use-press.d.ts.map +1 -1
- package/dist/vue/use-press.js +13 -5
- package/dist/vue/use-press.js.map +1 -1
- package/dist/vue/use-scroll-motion.d.ts +7 -0
- package/dist/vue/use-scroll-motion.d.ts.map +1 -0
- package/dist/vue/use-scroll-motion.js +30 -0
- package/dist/vue/use-scroll-motion.js.map +1 -0
- package/fonts/LICENSE +45 -0
- package/fonts/lucide.ttf +0 -0
- package/package.json +20 -4
- package/platforms/android/java/com/mavis/ui/Box.java +65 -0
- package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
- package/platforms/android/java/com/mavis/ui/FlexLayout.java +101 -4
- package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
- package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
- package/src/app-icons.ts +21 -0
- package/src/date-format.ts +2 -0
- package/src/files.ts +3 -0
- package/src/native/app-icons.android.ts +95 -0
- package/src/native/app-icons.ios.ts +74 -0
- package/src/native/app-icons.ts +12 -0
- package/src/native/appearance.android.ts +75 -0
- package/src/native/appearance.ts +33 -0
- package/src/native/avatar-image.ts +9 -0
- package/src/native/avatar-label.android.ts +14 -0
- package/src/native/avatar-label.ts +1 -0
- package/src/native/box.android.ts +11 -0
- package/src/native/box.ios.ts +61 -0
- package/src/native/box.ts +2 -0
- package/src/native/button.android.ts +38 -0
- package/src/native/button.ios.ts +53 -1
- package/src/native/checkbox.android.ts +35 -0
- package/src/native/checkbox.ts +9 -0
- package/src/native/collection-motion.ts +166 -0
- package/src/native/combobox-editor.android.ts +11 -0
- package/src/native/combobox-editor.ts +6 -0
- package/src/native/composed-button.android.ts +74 -0
- package/src/native/composed-button.ts +9 -0
- package/src/native/date-format.android.ts +72 -0
- package/src/native/date-format.ios.ts +54 -0
- package/src/native/date-format.ts +17 -0
- package/src/native/dialog.android.ts +56 -0
- package/src/native/dialog.ios.ts +23 -0
- package/src/native/dialog.ts +10 -0
- package/src/native/dynamic-type.ts +71 -0
- package/src/native/file-access.ts +71 -0
- package/src/native/file-picker.android.ts +191 -0
- package/src/native/file-picker.ios.ts +230 -0
- package/src/native/file-picker.ts +8 -0
- package/src/native/flex-children.ts +12 -0
- package/src/native/flex-layout.android.ts +12 -1
- package/src/native/flex-layout.ios.ts +148 -1
- package/src/native/image-effects.ts +71 -0
- package/src/native/input-action.ts +15 -0
- package/src/native/keyboard-dismiss.android.ts +17 -0
- package/src/native/keyboard-dismiss.ios.ts +124 -0
- package/src/native/keyboard-dismiss.ts +14 -0
- package/src/native/label.android.ts +27 -0
- package/src/native/label.ios.ts +54 -1
- package/src/native/measure-memo.ts +116 -0
- package/src/native/motion-owner.ts +66 -0
- package/src/native/motion-region.ts +293 -0
- package/src/native/motion-surface.ts +273 -0
- package/src/native/platform-motion.ts +103 -0
- package/src/native/press.ts +58 -10
- package/src/native/progress.ts +78 -0
- package/src/native/screen.android.ts +12 -0
- package/src/native/screen.ts +2 -0
- package/src/native/scroll-motion.ts +106 -0
- package/src/native/section-scroll.ts +81 -0
- package/src/native/segmented.ts +95 -0
- package/src/native/sheet.android.ts +24 -0
- package/src/native/sheet.ios.ts +52 -0
- package/src/native/sheet.ts +26 -0
- package/src/native/surface-effects.ts +33 -0
- package/src/native/tabs.android.ts +58 -0
- package/src/native/tabs.ts +8 -0
- package/src/native/text-field.android.ts +19 -0
- package/src/native/text-field.ios.ts +53 -0
- package/src/native/text-view.ios.ts +10 -0
- package/src/native/toast.android.ts +9 -0
- package/src/native/toast.ios.ts +13 -0
- package/src/native/toast.ts +6 -0
- package/src/native/visual-effects.ts +147 -0
- package/src/vue/components/ChartPlot.ts +114 -0
- package/src/vue/components/ChoiceControl.ts +265 -0
- package/src/vue/components/DateCalendar.ts +121 -0
- package/src/vue/components/LoadingDecoration.ts +38 -0
- package/src/vue/components/MAccordion.ts +123 -0
- package/src/vue/components/MAlert.ts +156 -0
- package/src/vue/components/MAvatar.ts +103 -0
- package/src/vue/components/MBadge.ts +34 -0
- package/src/vue/components/MButton.ts +255 -18
- package/src/vue/components/MCard.ts +44 -5
- package/src/vue/components/MCheckbox.ts +25 -0
- package/src/vue/components/MChip.ts +134 -0
- package/src/vue/components/MCombobox.ts +257 -0
- package/src/vue/components/MDatePicker.ts +25 -0
- package/src/vue/components/MDialog.ts +312 -0
- package/src/vue/components/MEmptyState.ts +96 -0
- package/src/vue/components/MFilePicker.ts +226 -0
- package/src/vue/components/MGrid.ts +86 -0
- package/src/vue/components/MIcon.ts +53 -0
- package/src/vue/components/MImage.ts +181 -0
- package/src/vue/components/MInput.ts +143 -21
- package/src/vue/components/MLink.ts +99 -0
- package/src/vue/components/MListItem.ts +66 -0
- package/src/vue/components/MPopover.ts +254 -0
- package/src/vue/components/MProgress.ts +94 -0
- package/src/vue/components/MRadioGroup.ts +64 -0
- package/src/vue/components/MRangeSlider.ts +125 -0
- package/src/vue/components/MReveal.ts +89 -48
- package/src/vue/components/MScreen.ts +122 -6
- package/src/vue/components/MSegmentedControl.ts +214 -0
- package/src/vue/components/MSelect.ts +185 -0
- package/src/vue/components/MSeparator.ts +40 -0
- package/src/vue/components/MSheet.ts +375 -0
- package/src/vue/components/MSkeleton.ts +102 -0
- package/src/vue/components/MSlider.ts +8 -2
- package/src/vue/components/MStack.ts +83 -0
- package/src/vue/components/MSwitch.ts +200 -0
- package/src/vue/components/MTabs.ts +302 -0
- package/src/vue/components/MText.ts +48 -10
- package/src/vue/components/MTimePicker.ts +57 -0
- package/src/vue/components/MToast.ts +289 -0
- package/src/vue/components/MTooltip.ts +39 -0
- package/src/vue/components/MVirtualList.ts +120 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/discovery.ts +92 -0
- package/src/vue/components/layout.ts +24 -9
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/wayfinding.ts +46 -0
- package/src/vue/components/workflows.ts +38 -0
- package/src/vue/index.ts +217 -22
- package/src/vue/layers.ts +48 -0
- package/src/vue/native-view.ts +6 -0
- package/src/vue/navigation.ts +15 -0
- package/src/vue/props.ts +37 -12
- package/src/vue/router-navigation.ts +39 -0
- package/src/vue/services.ts +39 -0
- package/src/vue/system-back.ts +12 -0
- package/src/vue/use-choice-paint.ts +39 -0
- package/src/vue/use-motion-region.ts +29 -0
- package/src/vue/use-motion-surface.ts +115 -0
- package/src/vue/use-press.ts +13 -5
- package/src/vue/use-scroll-motion.ts +31 -0
- package/dist/native/input-description.android.d.ts +0 -4
- package/dist/native/input-description.android.d.ts.map +0 -1
- package/dist/native/input-description.android.js +0 -18
- package/dist/native/input-description.android.js.map +0 -1
- package/dist/theme/resolve.d.ts +0 -3
- package/dist/theme/resolve.d.ts.map +0 -1
- package/dist/theme/resolve.js +0 -8
- package/dist/theme/resolve.js.map +0 -1
- package/dist/theme/themes.d.ts +0 -6
- package/dist/theme/themes.d.ts.map +0 -1
- package/dist/theme/themes.js +0 -83
- package/dist/theme/themes.js.map +0 -1
- package/dist/theme/types.d.ts +0 -50
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -2
- package/dist/theme/types.js.map +0 -1
- package/dist/vue/global-components.d.ts +0 -21
- package/dist/vue/global-components.d.ts.map +0 -1
- package/dist/vue/global-components.js +0 -2
- package/dist/vue/global-components.js.map +0 -1
- package/dist/vue/layout-context.d.ts +0 -5
- package/dist/vue/layout-context.d.ts.map +0 -1
- package/dist/vue/layout-context.js +0 -7
- package/dist/vue/layout-context.js.map +0 -1
- package/dist/vue/text-content.d.ts +0 -4
- package/dist/vue/text-content.d.ts.map +0 -1
- package/dist/vue/text-content.js +0 -17
- package/dist/vue/text-content.js.map +0 -1
- package/dist/vue/theme.d.ts +0 -177
- package/dist/vue/theme.d.ts.map +0 -1
- package/dist/vue/theme.js +0 -17
- package/dist/vue/theme.js.map +0 -1
|
@@ -7,41 +7,68 @@ import {
|
|
|
7
7
|
registerElement,
|
|
8
8
|
watch,
|
|
9
9
|
provide,
|
|
10
|
+
onBeforeUnmount,
|
|
10
11
|
} from 'nativescript-vue'
|
|
11
12
|
import {
|
|
13
|
+
useButtonAction,
|
|
12
14
|
inputProps,
|
|
13
15
|
inputEmits,
|
|
14
16
|
useMavisTheme,
|
|
15
|
-
|
|
17
|
+
useLayoutShrink,
|
|
16
18
|
layoutDirection,
|
|
17
19
|
} from '@getcortexlabs/mavis-core/vue'
|
|
18
20
|
import {
|
|
19
21
|
validateInput,
|
|
22
|
+
fontFamily,
|
|
23
|
+
resolveRadius,
|
|
20
24
|
nonNegative,
|
|
21
25
|
resolveDimension,
|
|
22
|
-
|
|
26
|
+
iconSizes,
|
|
27
|
+
inputActionSize,
|
|
28
|
+
type InputActionHandle,
|
|
23
29
|
} from '@getcortexlabs/mavis-core'
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
30
|
+
import { isAndroid } from '@nativescript/core'
|
|
31
|
+
import type { EventData, PropertyChangeData, TextField, TextView, View } from '@nativescript/core'
|
|
32
|
+
import { MavisTextField } from '../../native/text-field'
|
|
33
|
+
import { MavisTextView } from '../../native/text-view'
|
|
27
34
|
import { MText } from './MText.js'
|
|
35
|
+
import { MIcon } from './MIcon.js'
|
|
36
|
+
import { MButton } from './MButton.js'
|
|
37
|
+
import { keepEditingOn } from '../../native/input-action'
|
|
28
38
|
import { useNativeViewAttrs } from '../accessibility.js'
|
|
39
|
+
import { notifyAccessibilityLayout } from '../../native/accessibility-layout'
|
|
29
40
|
|
|
30
41
|
registerElement('MavisTextField', () => MavisTextField)
|
|
31
42
|
registerElement('MavisTextView', () => MavisTextView)
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
const Input = defineComponent({
|
|
34
45
|
name: 'MInput',
|
|
35
46
|
inheritAttrs: false,
|
|
36
47
|
props: inputProps,
|
|
37
48
|
emits: inputEmits,
|
|
38
49
|
setup(props, { attrs, emit, expose }) {
|
|
50
|
+
useButtonAction()
|
|
39
51
|
const { theme } = useMavisTheme()
|
|
40
|
-
const shrink =
|
|
52
|
+
const shrink = useLayoutShrink()
|
|
41
53
|
provide(layoutDirection, 'column')
|
|
42
54
|
const nativeAttrs = useNativeViewAttrs(props)
|
|
43
55
|
const editor = shallowRef<{ nativeView: TextField | TextView }>()
|
|
56
|
+
const actionButton = shallowRef<{ $el?: { nativeView?: View } }>()
|
|
44
57
|
const focused = ref(false)
|
|
58
|
+
let focusFeedback: ReturnType<typeof setTimeout> | undefined
|
|
59
|
+
function cancelFocusFeedback() {
|
|
60
|
+
clearTimeout(focusFeedback)
|
|
61
|
+
focusFeedback = undefined
|
|
62
|
+
}
|
|
63
|
+
let releaseAction: (() => void) | undefined
|
|
64
|
+
function clearAction() {
|
|
65
|
+
releaseAction?.()
|
|
66
|
+
releaseAction = undefined
|
|
67
|
+
}
|
|
68
|
+
onBeforeUnmount(() => {
|
|
69
|
+
cancelFocusFeedback()
|
|
70
|
+
clearAction()
|
|
71
|
+
})
|
|
45
72
|
function blur() {
|
|
46
73
|
const view = editor.value?.nativeView
|
|
47
74
|
view?.dismissSoftInput()
|
|
@@ -54,11 +81,19 @@ export const MInput = defineComponent({
|
|
|
54
81
|
},
|
|
55
82
|
)
|
|
56
83
|
expose({
|
|
84
|
+
focusAction: () => {
|
|
85
|
+
if (props.disabled || props.readonly || props.trailingAction?.disabled) return
|
|
86
|
+
const view = actionButton.value?.$el?.nativeView
|
|
87
|
+
if (!view?.isLoaded) return
|
|
88
|
+
view.focus()
|
|
89
|
+
if (isAndroid) view.android?.performAccessibilityAction(64, null)
|
|
90
|
+
else notifyAccessibilityLayout(view)
|
|
91
|
+
},
|
|
57
92
|
focus: () => {
|
|
58
93
|
if (!props.disabled && !props.readonly) editor.value?.nativeView.focus()
|
|
59
94
|
},
|
|
60
95
|
blur,
|
|
61
|
-
} satisfies
|
|
96
|
+
} satisfies InputActionHandle)
|
|
62
97
|
|
|
63
98
|
return () => {
|
|
64
99
|
validateInput(props)
|
|
@@ -67,6 +102,32 @@ export const MInput = defineComponent({
|
|
|
67
102
|
const text = props.type === 'text' || props.type === 'search'
|
|
68
103
|
const capitalize = props.autocapitalize ?? (text ? 'sentences' : 'none')
|
|
69
104
|
const border = props.error ? colors.danger : focused.value ? colors.primary : colors.border
|
|
105
|
+
const tokens = theme.value.components.input
|
|
106
|
+
const fontSize = tokens.fontSize ?? typography.body.fontSize
|
|
107
|
+
const family = fontFamily(
|
|
108
|
+
tokens.fontFamily ?? typography.body.fontFamily,
|
|
109
|
+
isAndroid ? 'android' : 'ios',
|
|
110
|
+
)
|
|
111
|
+
const inset = tokens.paddingX + iconSizes.md + 10
|
|
112
|
+
const action = props.trailingAction
|
|
113
|
+
// Icons sit over the editor box and let touches through to it.
|
|
114
|
+
const icon = (name: typeof props.icon, trailing: boolean) =>
|
|
115
|
+
name
|
|
116
|
+
? h(MIcon, {
|
|
117
|
+
name,
|
|
118
|
+
size: 'md',
|
|
119
|
+
tone: props.error ? 'danger' : 'muted',
|
|
120
|
+
row: 1,
|
|
121
|
+
isUserInteractionEnabled: false,
|
|
122
|
+
style: {
|
|
123
|
+
horizontalAlignment: trailing ? 'right' : 'left',
|
|
124
|
+
verticalAlignment: props.multiline ? 'top' : 'middle',
|
|
125
|
+
marginLeft: trailing ? 0 : tokens.paddingX,
|
|
126
|
+
marginRight: trailing ? tokens.paddingX : 0,
|
|
127
|
+
marginTop: space.sm + (props.multiline ? 14 : 0),
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
: null
|
|
70
131
|
return h(
|
|
71
132
|
'GridLayout',
|
|
72
133
|
mergeProps(
|
|
@@ -76,7 +137,7 @@ export const MInput = defineComponent({
|
|
|
76
137
|
style: {
|
|
77
138
|
width: resolveDimension(props.width),
|
|
78
139
|
flexGrow: nonNegative(props.grow, 'grow'),
|
|
79
|
-
flexShrink: nonNegative(props.shrink ?? shrink, 'shrink'),
|
|
140
|
+
flexShrink: nonNegative(props.shrink ?? shrink.value, 'shrink'),
|
|
80
141
|
minWidth: 0,
|
|
81
142
|
opacity: props.disabled ? 0.5 : 1,
|
|
82
143
|
},
|
|
@@ -107,11 +168,15 @@ export const MInput = defineComponent({
|
|
|
107
168
|
returnKeyType: props.returnKey,
|
|
108
169
|
}),
|
|
109
170
|
keyboardType:
|
|
110
|
-
props.
|
|
111
|
-
? '
|
|
112
|
-
:
|
|
113
|
-
?
|
|
114
|
-
:
|
|
171
|
+
props.inputmode === 'decimal'
|
|
172
|
+
? 'decimal'
|
|
173
|
+
: props.inputmode === 'numeric'
|
|
174
|
+
? 'number'
|
|
175
|
+
: props.type === 'tel'
|
|
176
|
+
? 'phone'
|
|
177
|
+
: ['email', 'url'].includes(props.type)
|
|
178
|
+
? props.type
|
|
179
|
+
: undefined,
|
|
115
180
|
autocapitalizationType: capitalize === 'characters' ? 'allcharacters' : capitalize,
|
|
116
181
|
autocorrect: props.autocorrect ?? text,
|
|
117
182
|
maxLength: props.maxLength ?? Infinity,
|
|
@@ -122,19 +187,28 @@ export const MInput = defineComponent({
|
|
|
122
187
|
style: {
|
|
123
188
|
flexShrink: 0,
|
|
124
189
|
minWidth: 0,
|
|
125
|
-
minHeight: props.multiline
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
190
|
+
minHeight: props.multiline
|
|
191
|
+
? props.rows * fontSize * tokens.lineHeight + tokens.paddingY * 2 + 2
|
|
192
|
+
: Math.max(control.md.height, action ? inputActionSize + 8 : 0),
|
|
193
|
+
padding: tokens.paddingY,
|
|
194
|
+
paddingLeft: props.icon ? inset : tokens.paddingX,
|
|
195
|
+
paddingRight: action
|
|
196
|
+
? Math.max(inputActionSize + 12, tokens.paddingX)
|
|
197
|
+
: props.trailingIcon
|
|
198
|
+
? inset
|
|
199
|
+
: tokens.paddingX,
|
|
129
200
|
margin: 0,
|
|
130
201
|
marginTop: space.sm,
|
|
131
|
-
fontSize
|
|
202
|
+
fontSize,
|
|
203
|
+
fontFamily: family,
|
|
204
|
+
fontWeight: tokens.fontWeight,
|
|
205
|
+
lineHeight: fontSize * (tokens.lineHeight - 1),
|
|
132
206
|
color: colors.text,
|
|
133
207
|
placeholderColor: colors.muted,
|
|
134
208
|
backgroundColor: props.readonly ? colors.elevated : colors.surface,
|
|
135
209
|
borderColor: border,
|
|
136
210
|
borderWidth: 2,
|
|
137
|
-
borderRadius:
|
|
211
|
+
borderRadius: resolveRadius(theme.value, tokens.radius),
|
|
138
212
|
},
|
|
139
213
|
onTextChange: (event: PropertyChangeData) => {
|
|
140
214
|
const value = String(event.value ?? '')
|
|
@@ -142,14 +216,25 @@ export const MInput = defineComponent({
|
|
|
142
216
|
emit('update:modelValue', value)
|
|
143
217
|
},
|
|
144
218
|
onFocus: () => {
|
|
145
|
-
|
|
219
|
+
cancelFocusFeedback()
|
|
220
|
+
const view = editor.value?.nativeView
|
|
221
|
+
if (view?.android) {
|
|
222
|
+
// Repainting the border invalidates Android's text layout. Let EditText finish
|
|
223
|
+
// its touch event and request the IME before updating the focus appearance.
|
|
224
|
+
focusFeedback = setTimeout(() => {
|
|
225
|
+
focusFeedback = undefined
|
|
226
|
+
if (view.isLoaded && view.android?.hasFocus()) focused.value = true
|
|
227
|
+
}, 0)
|
|
228
|
+
} else focused.value = true
|
|
146
229
|
emit('focus')
|
|
147
230
|
},
|
|
148
231
|
onBlur: () => {
|
|
232
|
+
cancelFocusFeedback()
|
|
149
233
|
focused.value = false
|
|
150
234
|
emit('blur')
|
|
151
235
|
},
|
|
152
236
|
onUnloaded: () => {
|
|
237
|
+
cancelFocusFeedback()
|
|
153
238
|
focused.value = false
|
|
154
239
|
},
|
|
155
240
|
onReturnPress: (event: EventData) => {
|
|
@@ -159,6 +244,38 @@ export const MInput = defineComponent({
|
|
|
159
244
|
emit('submit', field.text ?? '')
|
|
160
245
|
},
|
|
161
246
|
}),
|
|
247
|
+
icon(props.icon, false),
|
|
248
|
+
icon(props.trailingIcon, true),
|
|
249
|
+
action
|
|
250
|
+
? h(MButton, {
|
|
251
|
+
ref: actionButton,
|
|
252
|
+
row: 1,
|
|
253
|
+
icon: action.icon,
|
|
254
|
+
accessibilityLabel: action.label,
|
|
255
|
+
variant: 'ghost',
|
|
256
|
+
disabled: props.disabled || props.readonly || action.disabled,
|
|
257
|
+
style: {
|
|
258
|
+
horizontalAlignment: 'right',
|
|
259
|
+
verticalAlignment: props.multiline ? 'top' : 'middle',
|
|
260
|
+
width: inputActionSize,
|
|
261
|
+
minHeight: inputActionSize,
|
|
262
|
+
padding: 0,
|
|
263
|
+
marginRight: 4,
|
|
264
|
+
marginTop: space.sm + (props.multiline ? 4 : 0),
|
|
265
|
+
},
|
|
266
|
+
onClick: () => {
|
|
267
|
+
if (!props.disabled && !props.readonly && !action.disabled) emit('action')
|
|
268
|
+
},
|
|
269
|
+
onLoaded: (event: EventData) => {
|
|
270
|
+
clearAction()
|
|
271
|
+
releaseAction = keepEditingOn(
|
|
272
|
+
event.object as View,
|
|
273
|
+
() => editor.value?.nativeView,
|
|
274
|
+
)
|
|
275
|
+
},
|
|
276
|
+
onUnloaded: clearAction,
|
|
277
|
+
})
|
|
278
|
+
: null,
|
|
162
279
|
message
|
|
163
280
|
? h(MText, {
|
|
164
281
|
row: 2,
|
|
@@ -173,3 +290,8 @@ export const MInput = defineComponent({
|
|
|
173
290
|
}
|
|
174
291
|
},
|
|
175
292
|
})
|
|
293
|
+
|
|
294
|
+
// Keep the constructor declaration aligned with the portable handle exposed above.
|
|
295
|
+
export const MInput = Input as typeof Input & {
|
|
296
|
+
new (): InstanceType<typeof Input> & InputActionHandle
|
|
297
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, onBeforeUnmount, ref } from 'nativescript-vue'
|
|
2
|
+
import { type EventData, type View } from '@nativescript/core'
|
|
3
|
+
import { nativeDestination, navigateNative } from '../navigation.js'
|
|
4
|
+
import {
|
|
5
|
+
linkProps,
|
|
6
|
+
linkEmits,
|
|
7
|
+
textContent,
|
|
8
|
+
useMavisTheme,
|
|
9
|
+
useNavigationOptions,
|
|
10
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
11
|
+
import { MRow } from './layout.js'
|
|
12
|
+
import { MText } from './MText.js'
|
|
13
|
+
import { ActionChildren, useNativeViewAttrs } from '../accessibility.js'
|
|
14
|
+
import { observeComposedButton } from '../../native/composed-button'
|
|
15
|
+
|
|
16
|
+
export const MLink = defineComponent({
|
|
17
|
+
name: 'MLink',
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
props: linkProps,
|
|
20
|
+
emits: linkEmits,
|
|
21
|
+
setup(props, { attrs, slots, emit }) {
|
|
22
|
+
const { theme } = useMavisTheme()
|
|
23
|
+
const navigation = useNavigationOptions(props)
|
|
24
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
25
|
+
const focused = ref(false)
|
|
26
|
+
let release: (() => void) | undefined
|
|
27
|
+
const clear = () => {
|
|
28
|
+
release?.()
|
|
29
|
+
release = undefined
|
|
30
|
+
focused.value = false
|
|
31
|
+
}
|
|
32
|
+
onBeforeUnmount(clear)
|
|
33
|
+
const activate = async () => {
|
|
34
|
+
if (props.disabled) return
|
|
35
|
+
emit('click')
|
|
36
|
+
try {
|
|
37
|
+
await navigateNative(navigation())
|
|
38
|
+
} catch (error) {
|
|
39
|
+
emit('error', error)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return () => {
|
|
43
|
+
nativeDestination(navigation())
|
|
44
|
+
const text = props.text ?? textContent(slots.default?.())
|
|
45
|
+
const label = props.accessibilityLabel ?? text
|
|
46
|
+
if (!label.trim()) throw new TypeError('MLink requires a name.')
|
|
47
|
+
return h(
|
|
48
|
+
MRow,
|
|
49
|
+
mergeProps(
|
|
50
|
+
{
|
|
51
|
+
align: 'center',
|
|
52
|
+
justify: 'center',
|
|
53
|
+
grow: props.grow,
|
|
54
|
+
shrink: props.shrink,
|
|
55
|
+
style: {
|
|
56
|
+
minHeight: props.inline ? 0 : 44,
|
|
57
|
+
opacity: props.disabled ? 0.45 : 1,
|
|
58
|
+
borderWidth: focused.value ? 1 : 0,
|
|
59
|
+
borderColor: theme.value.colors.primary,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
nativeAttrs(),
|
|
63
|
+
attrs,
|
|
64
|
+
{
|
|
65
|
+
accessible: true,
|
|
66
|
+
accessibilityRole: 'link',
|
|
67
|
+
accessibilityLabel: label,
|
|
68
|
+
accessibilityState: props.disabled ? 'disabled' : '',
|
|
69
|
+
isEnabled: !props.disabled,
|
|
70
|
+
onTap: activate,
|
|
71
|
+
onLoaded(event: EventData) {
|
|
72
|
+
clear()
|
|
73
|
+
release = observeComposedButton(
|
|
74
|
+
event.object as View,
|
|
75
|
+
(value) => {
|
|
76
|
+
focused.value = value
|
|
77
|
+
},
|
|
78
|
+
activate,
|
|
79
|
+
() => {},
|
|
80
|
+
)
|
|
81
|
+
},
|
|
82
|
+
onUnloaded: clear,
|
|
83
|
+
},
|
|
84
|
+
),
|
|
85
|
+
{
|
|
86
|
+
default: () =>
|
|
87
|
+
h(
|
|
88
|
+
ActionChildren,
|
|
89
|
+
{ hidden: true },
|
|
90
|
+
{
|
|
91
|
+
default: () =>
|
|
92
|
+
h(MText, { text, tone: 'primary', style: { textDecoration: 'underline' } }),
|
|
93
|
+
},
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
})
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, type SlotsType, type VNode } from 'nativescript-vue'
|
|
2
|
+
import { listItemProps, actionEmits } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
import { listItemLabel } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import { MCard } from './MCard.js'
|
|
5
|
+
import { MRow, MColumn } from './layout.js'
|
|
6
|
+
import { MText } from './MText.js'
|
|
7
|
+
import { MIcon } from './MIcon.js'
|
|
8
|
+
|
|
9
|
+
export const MListItem = defineComponent({
|
|
10
|
+
name: 'MListItem',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
props: listItemProps,
|
|
13
|
+
emits: actionEmits,
|
|
14
|
+
slots: Object as SlotsType<{ leading?: () => VNode[]; trailing?: () => VNode[] }>,
|
|
15
|
+
setup(props, { attrs, slots, emit }) {
|
|
16
|
+
return () => {
|
|
17
|
+
const label = listItemLabel(props.title, props.description, props.accessibilityLabel)
|
|
18
|
+
return h(
|
|
19
|
+
MCard,
|
|
20
|
+
mergeProps(attrs, {
|
|
21
|
+
id: props.id,
|
|
22
|
+
width: props.width,
|
|
23
|
+
grow: props.grow,
|
|
24
|
+
shrink: props.shrink,
|
|
25
|
+
padding: 'md',
|
|
26
|
+
radius: 'md',
|
|
27
|
+
interactive: props.interactive,
|
|
28
|
+
disabled: props.disabled,
|
|
29
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
30
|
+
accessibilityLabel: props.interactive ? label : undefined,
|
|
31
|
+
style: { borderWidth: 0 },
|
|
32
|
+
onClick: () => emit('click'),
|
|
33
|
+
}),
|
|
34
|
+
{
|
|
35
|
+
default: () =>
|
|
36
|
+
h(
|
|
37
|
+
MRow,
|
|
38
|
+
{ gap: 'md' },
|
|
39
|
+
{
|
|
40
|
+
default: () => [
|
|
41
|
+
slots.leading ? h(MColumn, { shrink: 0 }, { default: slots.leading }) : null,
|
|
42
|
+
h(
|
|
43
|
+
MColumn,
|
|
44
|
+
{ width: 0, grow: 1, gap: 'xs' },
|
|
45
|
+
{
|
|
46
|
+
default: () => [
|
|
47
|
+
h(MText, { text: props.title, style: { fontWeight: '600' } }),
|
|
48
|
+
props.description
|
|
49
|
+
? h(MText, { text: props.description, variant: 'caption', tone: 'muted' })
|
|
50
|
+
: null,
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
),
|
|
54
|
+
slots.trailing
|
|
55
|
+
? h(MColumn, { shrink: 1, align: 'end' }, { default: slots.trailing })
|
|
56
|
+
: props.interactive
|
|
57
|
+
? h(MIcon, { name: 'chevron-right', size: 'sm', tone: 'muted' })
|
|
58
|
+
: null,
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
})
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
getCurrentInstance,
|
|
5
|
+
h,
|
|
6
|
+
inject,
|
|
7
|
+
nextTick,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
provide,
|
|
10
|
+
ref,
|
|
11
|
+
shallowRef,
|
|
12
|
+
watch,
|
|
13
|
+
type PropType,
|
|
14
|
+
type VNodeChild,
|
|
15
|
+
} from 'nativescript-vue'
|
|
16
|
+
import { isAndroid, type EventData, type View } from '@nativescript/core'
|
|
17
|
+
import { placePopover, resolveSpace, type PopoverCloseReason } from '@getcortexlabs/mavis-core'
|
|
18
|
+
import { popoverProps, useCachedActivity, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
19
|
+
import { useLayerHost } from '../layers.js'
|
|
20
|
+
import { systemBackKey } from '../system-back.js'
|
|
21
|
+
import { contentInsets, safeAreaOf, setModal, watchBack } from '../../native/sheet'
|
|
22
|
+
import { notifyAccessibilityLayout } from '../../native/accessibility-layout'
|
|
23
|
+
import { MButton } from './MButton.js'
|
|
24
|
+
import { MColumn } from './layout.js'
|
|
25
|
+
|
|
26
|
+
export const MPopover = defineComponent({
|
|
27
|
+
name: 'MPopover',
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
props: popoverProps,
|
|
30
|
+
emits: {
|
|
31
|
+
'update:open': (_open: boolean) => true,
|
|
32
|
+
close: (_reason: PopoverCloseReason) => true,
|
|
33
|
+
opened: () => true,
|
|
34
|
+
},
|
|
35
|
+
setup(props, { attrs, slots, emit }) {
|
|
36
|
+
const host = useLayerHost('MPopover')
|
|
37
|
+
const { theme } = useMavisTheme()
|
|
38
|
+
const active = useCachedActivity()
|
|
39
|
+
const presented = computed(() => props.open && !props.disabled && active.value)
|
|
40
|
+
const anchor = shallowRef<{ nativeView: View }>()
|
|
41
|
+
const trigger = shallowRef<{ $el?: { nativeView?: View } }>()
|
|
42
|
+
const provides =
|
|
43
|
+
(getCurrentInstance() as { provides?: Record<PropertyKey, unknown> } | null)?.provides ?? {}
|
|
44
|
+
const claimBack = inject(systemBackKey, undefined)
|
|
45
|
+
let releaseBack = () => {}
|
|
46
|
+
let releaseClaim = () => {}
|
|
47
|
+
const scrollParents: View[] = []
|
|
48
|
+
function close(reason: PopoverCloseReason) {
|
|
49
|
+
if (!props.open) return
|
|
50
|
+
emit('update:open', false)
|
|
51
|
+
emit('close', reason)
|
|
52
|
+
}
|
|
53
|
+
const scrolled = () => close('program')
|
|
54
|
+
function cleanup() {
|
|
55
|
+
releaseBack()
|
|
56
|
+
releaseClaim()
|
|
57
|
+
releaseBack = releaseClaim = () => {}
|
|
58
|
+
scrollParents.splice(0).forEach((view) => view.off('scroll', scrolled))
|
|
59
|
+
}
|
|
60
|
+
watch(
|
|
61
|
+
presented,
|
|
62
|
+
(value) => {
|
|
63
|
+
cleanup()
|
|
64
|
+
if (!value) {
|
|
65
|
+
void nextTick(() => {
|
|
66
|
+
if (active.value && !props.open) trigger.value?.$el?.nativeView?.focus()
|
|
67
|
+
})
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
const back = () => close('back')
|
|
71
|
+
releaseBack = watchBack((event) => {
|
|
72
|
+
event.cancel = true
|
|
73
|
+
back()
|
|
74
|
+
})
|
|
75
|
+
releaseClaim = claimBack?.({ owns: () => presented.value, back }) ?? (() => {})
|
|
76
|
+
for (
|
|
77
|
+
let parent = anchor.value?.nativeView.parent as View | undefined;
|
|
78
|
+
parent;
|
|
79
|
+
parent = parent.parent as View | undefined
|
|
80
|
+
) {
|
|
81
|
+
parent.on('scroll', scrolled)
|
|
82
|
+
scrollParents.push(parent)
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{ immediate: true },
|
|
86
|
+
)
|
|
87
|
+
watch(
|
|
88
|
+
() => active.value && !props.disabled,
|
|
89
|
+
(value) => {
|
|
90
|
+
if (!value && props.open) close('program')
|
|
91
|
+
},
|
|
92
|
+
)
|
|
93
|
+
const Layer = defineComponent({
|
|
94
|
+
name: 'MPopoverLayer',
|
|
95
|
+
props: { content: { type: Function as PropType<() => VNodeChild>, required: true } },
|
|
96
|
+
setup(layer) {
|
|
97
|
+
const seen = new Set<PropertyKey>()
|
|
98
|
+
for (
|
|
99
|
+
let source: object | null = provides;
|
|
100
|
+
source && source !== Object.prototype;
|
|
101
|
+
source = Object.getPrototypeOf(source)
|
|
102
|
+
) {
|
|
103
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
104
|
+
if (seen.has(key)) continue
|
|
105
|
+
seen.add(key)
|
|
106
|
+
provide(key as string | symbol, (source as Record<PropertyKey, unknown>)[key])
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const root = shallowRef<View>()
|
|
110
|
+
const panel = shallowRef<View>()
|
|
111
|
+
const position = ref({ x: 8, y: 8, width: props.width, height: 400 })
|
|
112
|
+
function place() {
|
|
113
|
+
const container = root.value
|
|
114
|
+
const target = anchor.value?.nativeView
|
|
115
|
+
const surface = panel.value
|
|
116
|
+
if (!container?.isLoaded || !target?.isLoaded || !surface) return
|
|
117
|
+
const location = target.getLocationRelativeTo(container)
|
|
118
|
+
if (!location) {
|
|
119
|
+
close('program')
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
const size = container.getActualSize()
|
|
123
|
+
if (!size.width || !size.height) return
|
|
124
|
+
const inset = contentInsets(container)
|
|
125
|
+
const safe = safeAreaOf(container)
|
|
126
|
+
const viewport = {
|
|
127
|
+
x: inset.left,
|
|
128
|
+
y: safe.top,
|
|
129
|
+
width: size.width - inset.left - inset.right,
|
|
130
|
+
height: size.height - safe.top - safe.bottom,
|
|
131
|
+
}
|
|
132
|
+
const width = Math.max(1, Math.min(props.width, viewport.width - 16))
|
|
133
|
+
const height = Math.max(1, viewport.height - 16)
|
|
134
|
+
const measured = surface.getActualSize()
|
|
135
|
+
const rtl = isAndroid
|
|
136
|
+
? target.android?.getLayoutDirection?.() === 1
|
|
137
|
+
: target.ios?.effectiveUserInterfaceLayoutDirection === 1
|
|
138
|
+
const next = {
|
|
139
|
+
...placePopover(
|
|
140
|
+
{ ...location, ...target.getActualSize() },
|
|
141
|
+
{ width, height: Math.min(measured.height, height) },
|
|
142
|
+
viewport,
|
|
143
|
+
props.placement,
|
|
144
|
+
rtl,
|
|
145
|
+
),
|
|
146
|
+
width,
|
|
147
|
+
height,
|
|
148
|
+
}
|
|
149
|
+
if (JSON.stringify(next) !== JSON.stringify(position.value)) position.value = next
|
|
150
|
+
}
|
|
151
|
+
watch(
|
|
152
|
+
() => [props.width, props.placement],
|
|
153
|
+
() => void nextTick(place),
|
|
154
|
+
)
|
|
155
|
+
return () =>
|
|
156
|
+
h(
|
|
157
|
+
'GridLayout',
|
|
158
|
+
{
|
|
159
|
+
onLoaded: (event: EventData) => {
|
|
160
|
+
root.value = event.object as View
|
|
161
|
+
place()
|
|
162
|
+
},
|
|
163
|
+
onLayoutChanged: place,
|
|
164
|
+
},
|
|
165
|
+
[
|
|
166
|
+
h('MavisBox', {
|
|
167
|
+
backgroundColor: 'transparent',
|
|
168
|
+
accessible: false,
|
|
169
|
+
onTap: () => close('outside'),
|
|
170
|
+
}),
|
|
171
|
+
h('AbsoluteLayout', { isPassThroughParentEnabled: true }, [
|
|
172
|
+
h(
|
|
173
|
+
'ScrollView',
|
|
174
|
+
{
|
|
175
|
+
left: position.value.x,
|
|
176
|
+
top: position.value.y,
|
|
177
|
+
width: position.value.width,
|
|
178
|
+
maxHeight: position.value.height,
|
|
179
|
+
id: props.id,
|
|
180
|
+
accessibilityLabel: props.label,
|
|
181
|
+
backgroundColor: theme.value.colors.surface,
|
|
182
|
+
borderColor: theme.value.colors.border,
|
|
183
|
+
borderWidth: 1,
|
|
184
|
+
borderRadius: theme.value.radius.md,
|
|
185
|
+
onLoaded: (event: EventData) => {
|
|
186
|
+
const view = event.object as View
|
|
187
|
+
panel.value = view
|
|
188
|
+
setModal(view, true)
|
|
189
|
+
void nextTick(() => {
|
|
190
|
+
if (!view.isLoaded || !presented.value) return
|
|
191
|
+
place()
|
|
192
|
+
if (isAndroid) view.android?.performAccessibilityAction(64, null)
|
|
193
|
+
else notifyAccessibilityLayout(view)
|
|
194
|
+
emit('opened')
|
|
195
|
+
})
|
|
196
|
+
},
|
|
197
|
+
onLayoutChanged: place,
|
|
198
|
+
onUnloaded: () => {
|
|
199
|
+
if (panel.value) setModal(panel.value, false)
|
|
200
|
+
panel.value = undefined
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
[
|
|
204
|
+
h(
|
|
205
|
+
MColumn,
|
|
206
|
+
{ padding: resolveSpace(theme.value, props.padding), gap: 'sm' },
|
|
207
|
+
() => layer.content(),
|
|
208
|
+
),
|
|
209
|
+
],
|
|
210
|
+
),
|
|
211
|
+
]),
|
|
212
|
+
],
|
|
213
|
+
)
|
|
214
|
+
},
|
|
215
|
+
})
|
|
216
|
+
const remove = host.add({
|
|
217
|
+
component: Layer,
|
|
218
|
+
props: { content: () => slots.default?.({ close: () => close('program') }) },
|
|
219
|
+
presented,
|
|
220
|
+
})
|
|
221
|
+
onBeforeUnmount(() => {
|
|
222
|
+
cleanup()
|
|
223
|
+
remove()
|
|
224
|
+
})
|
|
225
|
+
return () => {
|
|
226
|
+
if (!props.label.trim() || !props.triggerLabel.trim())
|
|
227
|
+
throw new TypeError('Popovers require panel and trigger labels.')
|
|
228
|
+
if (!Number.isFinite(props.width) || props.width <= 0)
|
|
229
|
+
throw new RangeError('Popover width must be positive and finite.')
|
|
230
|
+
return h(
|
|
231
|
+
'GridLayout',
|
|
232
|
+
{
|
|
233
|
+
rows: 'auto',
|
|
234
|
+
columns: 'auto',
|
|
235
|
+
...attrs,
|
|
236
|
+
ref: anchor,
|
|
237
|
+
horizontalAlignment: 'left',
|
|
238
|
+
verticalAlignment: 'top',
|
|
239
|
+
},
|
|
240
|
+
[
|
|
241
|
+
h(MButton, {
|
|
242
|
+
ref: trigger,
|
|
243
|
+
text: props.triggerLabel,
|
|
244
|
+
icon: props.icon,
|
|
245
|
+
variant: props.variant,
|
|
246
|
+
disabled: props.disabled,
|
|
247
|
+
accessibilityState: props.open ? 'expanded' : '',
|
|
248
|
+
onClick: () => (props.open ? close('trigger') : emit('update:open', true)),
|
|
249
|
+
}),
|
|
250
|
+
],
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
})
|