@getcortexlabs/mavis 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +7 -5
- 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.ios.d.ts +4 -0
- package/dist/native/box.ios.d.ts.map +1 -1
- package/dist/native/box.ios.js +29 -1
- package/dist/native/box.ios.js.map +1 -1
- 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/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/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/flex-layout.ios.d.ts +10 -0
- package/dist/native/flex-layout.ios.d.ts.map +1 -1
- package/dist/native/flex-layout.ios.js +85 -0
- package/dist/native/flex-layout.ios.js.map +1 -1
- 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-surface.d.ts +9 -0
- package/dist/native/motion-surface.d.ts.map +1 -0
- package/dist/native/motion-surface.js +119 -0
- package/dist/native/motion-surface.js.map +1 -0
- package/dist/native/press.d.ts +5 -2
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +52 -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 +11 -0
- package/dist/native/scroll-motion.d.ts.map +1 -0
- package/dist/native/scroll-motion.js +94 -0
- package/dist/native/scroll-motion.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/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/vue/components/ChoiceControl.d.ts +101 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +196 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/MAccordion.d.ts +109 -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 +99 -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 +74 -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 +64 -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 +57 -5
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +129 -11
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +23 -5
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +14 -4
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MCheckbox.d.ts +93 -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 +107 -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/MDialog.d.ts +95 -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 +107 -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/MInput.d.ts +62 -7
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +88 -14
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MListItem.d.ts +92 -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/MProgress.d.ts +112 -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 +93 -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/MReveal.d.ts.map +1 -1
- package/dist/vue/components/MReveal.js +5 -7
- package/dist/vue/components/MReveal.js.map +1 -1
- package/dist/vue/components/MScreen.d.ts +18 -0
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +68 -5
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSegmentedControl.d.ts +85 -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 +130 -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 +54 -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 +101 -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 +70 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -0
- package/dist/vue/components/MSkeleton.js +87 -0
- package/dist/vue/components/MSkeleton.js.map +1 -0
- package/dist/vue/components/MSlider.d.ts +1 -1
- package/dist/vue/components/MSlider.d.ts.map +1 -1
- package/dist/vue/components/MSlider.js +2 -1
- package/dist/vue/components/MSlider.js.map +1 -1
- package/dist/vue/components/MSwitch.d.ts +79 -0
- package/dist/vue/components/MSwitch.d.ts.map +1 -0
- package/dist/vue/components/MSwitch.js +163 -0
- package/dist/vue/components/MSwitch.js.map +1 -0
- package/dist/vue/components/MTabs.d.ts +91 -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 +16 -7
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +43 -17
- package/dist/vue/components/MText.js.map +1 -1
- 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/index.d.ts +31 -4
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +48 -4
- 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/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/reveal-motion.d.ts +13 -0
- package/dist/vue/reveal-motion.d.ts.map +1 -0
- package/dist/vue/reveal-motion.js +55 -0
- package/dist/vue/reveal-motion.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-motion-surface.d.ts +8 -0
- package/dist/vue/use-motion-surface.d.ts.map +1 -0
- package/dist/vue/use-motion-surface.js +75 -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 +12 -4
- 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/package.json +3 -3
- package/platforms/android/java/com/mavis/ui/Box.java +38 -3
- package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
- package/platforms/android/java/com/mavis/ui/FlexLayout.java +80 -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/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.ios.ts +48 -1
- 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/composed-button.android.ts +74 -0
- package/src/native/composed-button.ts +9 -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/flex-layout.ios.ts +113 -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-surface.ts +137 -0
- package/src/native/press.ts +52 -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 +101 -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/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/vue/components/ChoiceControl.ts +238 -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 +176 -9
- package/src/vue/components/MCard.ts +23 -3
- package/src/vue/components/MCheckbox.ts +25 -0
- package/src/vue/components/MChip.ts +134 -0
- package/src/vue/components/MDialog.ts +312 -0
- package/src/vue/components/MEmptyState.ts +96 -0
- package/src/vue/components/MInput.ts +96 -12
- package/src/vue/components/MListItem.ts +66 -0
- package/src/vue/components/MProgress.ts +94 -0
- package/src/vue/components/MRadioGroup.ts +64 -0
- package/src/vue/components/MReveal.ts +6 -7
- package/src/vue/components/MScreen.ts +93 -5
- 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 +100 -0
- package/src/vue/components/MSlider.ts +7 -1
- package/src/vue/components/MSwitch.ts +187 -0
- package/src/vue/components/MTabs.ts +302 -0
- package/src/vue/components/MText.ts +37 -6
- package/src/vue/components/MToast.ts +289 -0
- package/src/vue/index.ts +90 -4
- package/src/vue/layers.ts +48 -0
- package/src/vue/native-view.ts +6 -0
- package/src/vue/props.ts +37 -12
- package/src/vue/reveal-motion.ts +61 -0
- package/src/vue/system-back.ts +12 -0
- package/src/vue/use-motion-surface.ts +77 -0
- package/src/vue/use-press.ts +12 -4
- 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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, onBeforeUnmount, watch } from 'nativescript-vue'
|
|
2
|
+
import type { EventData, View } from '@nativescript/core'
|
|
3
|
+
import { progressProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
4
|
+
import {
|
|
5
|
+
progressSizes,
|
|
6
|
+
progressMotion,
|
|
7
|
+
progressState,
|
|
8
|
+
checkProgressLabels,
|
|
9
|
+
} from '@getcortexlabs/mavis-core'
|
|
10
|
+
import { attachProgressMotion } from '../../native/progress'
|
|
11
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
12
|
+
import { MBox } from './layout.js'
|
|
13
|
+
|
|
14
|
+
export const MProgress = defineComponent({
|
|
15
|
+
name: 'MProgress',
|
|
16
|
+
inheritAttrs: false,
|
|
17
|
+
props: progressProps,
|
|
18
|
+
setup(props, { attrs }) {
|
|
19
|
+
const { theme } = useMavisTheme()
|
|
20
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
21
|
+
let track: View | undefined
|
|
22
|
+
let fill: View | undefined
|
|
23
|
+
let motion: ReturnType<typeof attachProgressMotion> | undefined
|
|
24
|
+
function connect() {
|
|
25
|
+
if (track && fill && !motion) motion = attachProgressMotion(track, fill, props.indeterminate)
|
|
26
|
+
}
|
|
27
|
+
function release() {
|
|
28
|
+
motion?.dispose()
|
|
29
|
+
motion = undefined
|
|
30
|
+
}
|
|
31
|
+
watch(
|
|
32
|
+
() => props.indeterminate,
|
|
33
|
+
(value) => motion?.update(value),
|
|
34
|
+
{ flush: 'post' },
|
|
35
|
+
)
|
|
36
|
+
onBeforeUnmount(release)
|
|
37
|
+
return () => {
|
|
38
|
+
checkProgressLabels(props.label, props.indeterminateLabel)
|
|
39
|
+
const reading = progressState(props.value, props.max)
|
|
40
|
+
const fraction = props.indeterminate ? progressMotion.segment : reading.ratio
|
|
41
|
+
return h(
|
|
42
|
+
MBox,
|
|
43
|
+
mergeProps(
|
|
44
|
+
{
|
|
45
|
+
width: props.width,
|
|
46
|
+
height: progressSizes[props.size],
|
|
47
|
+
grow: props.grow,
|
|
48
|
+
shrink: props.shrink,
|
|
49
|
+
radius: 'full',
|
|
50
|
+
backgroundColor: theme.value.colors.border,
|
|
51
|
+
},
|
|
52
|
+
attrs,
|
|
53
|
+
nativeAttrs(),
|
|
54
|
+
{
|
|
55
|
+
accessible: true,
|
|
56
|
+
accessibilityRole: 'progressBar',
|
|
57
|
+
accessibilityLabel: props.label,
|
|
58
|
+
accessibilityValue: props.indeterminate ? props.indeterminateLabel : reading.text,
|
|
59
|
+
clipToBounds: true,
|
|
60
|
+
onLoaded: (event: EventData) => {
|
|
61
|
+
track = event.object as View
|
|
62
|
+
connect()
|
|
63
|
+
},
|
|
64
|
+
onUnloaded: () => {
|
|
65
|
+
release()
|
|
66
|
+
track = undefined
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
),
|
|
70
|
+
{
|
|
71
|
+
default: () =>
|
|
72
|
+
h(MBox, {
|
|
73
|
+
width: fraction === 0 ? 0 : `${fraction * 100}%`,
|
|
74
|
+
height: progressSizes[props.size],
|
|
75
|
+
radius: 'full',
|
|
76
|
+
horizontalAlignment: 'left',
|
|
77
|
+
backgroundColor: theme.value.colors[props.tone],
|
|
78
|
+
accessible: false,
|
|
79
|
+
accessibilityHidden: true,
|
|
80
|
+
isUserInteractionEnabled: false,
|
|
81
|
+
onLoaded: (event: EventData) => {
|
|
82
|
+
fill = event.object as View
|
|
83
|
+
connect()
|
|
84
|
+
},
|
|
85
|
+
onUnloaded: () => {
|
|
86
|
+
release()
|
|
87
|
+
fill = undefined
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { computed, defineComponent, h, mergeProps } from 'nativescript-vue'
|
|
2
|
+
import { choiceKey, validateChoices, canChoose } from '@getcortexlabs/mavis-core'
|
|
3
|
+
import { useButtonAction, radioGroupProps, radioGroupEmits } from '@getcortexlabs/mavis-core/vue'
|
|
4
|
+
import { MColumn } from './layout.js'
|
|
5
|
+
import { MText } from './MText.js'
|
|
6
|
+
import { ChoiceControl } from './ChoiceControl.js'
|
|
7
|
+
|
|
8
|
+
export const MRadioGroup = defineComponent({
|
|
9
|
+
name: 'MRadioGroup',
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
props: radioGroupProps,
|
|
12
|
+
emits: radioGroupEmits,
|
|
13
|
+
setup(props, { attrs, emit }) {
|
|
14
|
+
useButtonAction()
|
|
15
|
+
const options = computed(() => {
|
|
16
|
+
validateChoices(props.options, props.modelValue)
|
|
17
|
+
return props.options
|
|
18
|
+
})
|
|
19
|
+
return () =>
|
|
20
|
+
h(
|
|
21
|
+
MColumn,
|
|
22
|
+
mergeProps(attrs, {
|
|
23
|
+
id: props.id,
|
|
24
|
+
width: props.width,
|
|
25
|
+
grow: props.grow,
|
|
26
|
+
shrink: props.shrink,
|
|
27
|
+
gap: 'sm',
|
|
28
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
29
|
+
}),
|
|
30
|
+
{
|
|
31
|
+
default: () => [
|
|
32
|
+
h(MText, {
|
|
33
|
+
text: props.label,
|
|
34
|
+
style: { fontWeight: '600' },
|
|
35
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
36
|
+
}),
|
|
37
|
+
props.helperText
|
|
38
|
+
? h(MText, {
|
|
39
|
+
text: props.helperText,
|
|
40
|
+
variant: 'caption',
|
|
41
|
+
tone: 'muted',
|
|
42
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
43
|
+
})
|
|
44
|
+
: null,
|
|
45
|
+
...options.value.map((option) =>
|
|
46
|
+
h(ChoiceControl, {
|
|
47
|
+
key: choiceKey(option.value),
|
|
48
|
+
radio: true,
|
|
49
|
+
modelValue: props.modelValue === option.value,
|
|
50
|
+
label: option.label,
|
|
51
|
+
helperText: option.helperText,
|
|
52
|
+
disabled: props.disabled || option.disabled,
|
|
53
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
54
|
+
onActivate() {
|
|
55
|
+
if (canChoose(option, props.modelValue, props.disabled))
|
|
56
|
+
emit('update:modelValue', option.value)
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
),
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
},
|
|
64
|
+
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, mergeProps } from 'nativescript-vue'
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, h, mergeProps, BaseTransition } from 'nativescript-vue'
|
|
2
|
+
import { useRevealMotion } from '../reveal-motion.js'
|
|
3
3
|
import { revealProps } from '@getcortexlabs/mavis-core/vue'
|
|
4
4
|
import { MColumn } from './layout.js'
|
|
5
5
|
import { isAndroid, type View } from '@nativescript/core'
|
|
@@ -11,20 +11,19 @@ export const MReveal = defineComponent({
|
|
|
11
11
|
inheritAttrs: false,
|
|
12
12
|
props: revealProps,
|
|
13
13
|
setup(props, { attrs, slots }) {
|
|
14
|
+
const motion = useRevealMotion()
|
|
14
15
|
let trigger: WeakRef<View> | undefined
|
|
15
16
|
let restore = false
|
|
16
17
|
return () => {
|
|
17
18
|
const { show, ...layout } = props
|
|
18
19
|
return h(
|
|
19
|
-
|
|
20
|
+
BaseTransition,
|
|
20
21
|
{
|
|
21
|
-
|
|
22
|
-
leave: [{ opacity: 0 }, { duration: 120 }],
|
|
22
|
+
...motion,
|
|
23
23
|
onBeforeEnter: (element: { nativeView?: View }) => {
|
|
24
24
|
if (element.nativeView)
|
|
25
25
|
element.nativeView.accessibilityHidden = Boolean(props.accessibilityHidden)
|
|
26
|
-
|
|
27
|
-
onEnter: (element: { nativeView?: View }) => {
|
|
26
|
+
|
|
28
27
|
const page = element.nativeView?.page
|
|
29
28
|
const focused = page && focusedView(page)
|
|
30
29
|
trigger = focused ? new WeakRef(focused) : undefined
|
|
@@ -1,25 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useScrollMotion } from '../use-scroll-motion.js'
|
|
2
|
+
import { useAppToastHost } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
import { MToast } from './MToast.js'
|
|
4
|
+
import {
|
|
5
|
+
defineComponent,
|
|
6
|
+
h,
|
|
7
|
+
mergeProps,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
provide,
|
|
10
|
+
registerElement,
|
|
11
|
+
watch,
|
|
12
|
+
} from 'nativescript-vue'
|
|
13
|
+
import { isIOS, type EventData, type View } from '@nativescript/core'
|
|
2
14
|
import { screenProps, useMavisTheme, layoutDirection } from '@getcortexlabs/mavis-core/vue'
|
|
3
15
|
import { MColumn } from './layout.js'
|
|
4
16
|
import { MavisScreenScroll } from '../../native/screen-scroll'
|
|
17
|
+
import { MavisScreen } from '../../native/screen'
|
|
18
|
+
import { dismissKeyboardOn } from '../../native/keyboard-dismiss'
|
|
5
19
|
import { useNativeViewAttrs } from '../accessibility.js'
|
|
20
|
+
import { provideLayerHost } from '../layers.js'
|
|
21
|
+
import { expandLayerHost } from '../../native/sheet'
|
|
6
22
|
|
|
7
23
|
registerElement('MavisScreenScroll', () => MavisScreenScroll, {
|
|
8
24
|
// NSVViewFlags.CONTENT_VIEW; ScrollView owns one content view.
|
|
9
25
|
viewFlags: 2,
|
|
10
26
|
})
|
|
27
|
+
// NSVViewFlags.LAYOUT_VIEW; the page container also puts the keyboard away.
|
|
28
|
+
registerElement('MavisScreen', () => MavisScreen, { viewFlags: 4 })
|
|
11
29
|
|
|
12
30
|
export const MScreen = defineComponent({
|
|
13
31
|
name: 'MScreen',
|
|
14
32
|
inheritAttrs: false,
|
|
15
33
|
props: screenProps,
|
|
16
34
|
setup(props, { attrs, slots }) {
|
|
35
|
+
const scrollMotion = useScrollMotion(() => props.motionScroll)
|
|
17
36
|
const { theme } = useMavisTheme()
|
|
37
|
+
const appToast = useAppToastHost()
|
|
18
38
|
const nativeAttrs = useNativeViewAttrs(props)
|
|
39
|
+
const layers = provideLayerHost()
|
|
19
40
|
provide(layoutDirection, 'column')
|
|
41
|
+
let container: View | undefined
|
|
42
|
+
let release: (() => void) | undefined
|
|
43
|
+
const applyKeyboard = () => {
|
|
44
|
+
release?.()
|
|
45
|
+
release = undefined
|
|
46
|
+
if (!container || !props.dismissKeyboard) return
|
|
47
|
+
release = dismissKeyboardOn(container, { tap: true, drag: props.scroll })
|
|
48
|
+
}
|
|
49
|
+
watch(() => [props.dismissKeyboard, props.scroll], applyKeyboard)
|
|
50
|
+
onBeforeUnmount(() => {
|
|
51
|
+
release?.()
|
|
52
|
+
release = undefined
|
|
53
|
+
})
|
|
20
54
|
return () => {
|
|
55
|
+
// A presented layer covers the content, which leaves the accessibility tree meanwhile.
|
|
56
|
+
const presented = layers.filter((layer) => layer.presented.value)
|
|
57
|
+
const modal = presented.filter((layer) => layer.modal !== false)
|
|
58
|
+
const notices = presented.filter((layer) => layer.modal === false)
|
|
59
|
+
const covered = modal.length > 0
|
|
21
60
|
// Page and ScrollView require one content view; the column also accepts multiple slot children.
|
|
22
|
-
const content = h(
|
|
61
|
+
const content = h(
|
|
62
|
+
MColumn,
|
|
63
|
+
{ accessibilityHidden: props.scroll ? undefined : covered },
|
|
64
|
+
{
|
|
65
|
+
default: () => [
|
|
66
|
+
slots.default?.(),
|
|
67
|
+
appToast?.requested.value
|
|
68
|
+
? h(MToast, { controller: appToast.controller, closeLabel: appToast.closeLabel })
|
|
69
|
+
: null,
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
)
|
|
23
73
|
return h(
|
|
24
74
|
'Page',
|
|
25
75
|
mergeProps(
|
|
@@ -33,9 +83,47 @@ export const MScreen = defineComponent({
|
|
|
33
83
|
attrs,
|
|
34
84
|
),
|
|
35
85
|
[
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
86
|
+
h(
|
|
87
|
+
'MavisScreen',
|
|
88
|
+
{
|
|
89
|
+
...(isIOS ? { clipToBounds: false } : {}),
|
|
90
|
+
onLoaded: (event: EventData) => {
|
|
91
|
+
container = event.object as View
|
|
92
|
+
applyKeyboard()
|
|
93
|
+
},
|
|
94
|
+
onUnloaded: () => {
|
|
95
|
+
release?.()
|
|
96
|
+
release = undefined
|
|
97
|
+
container = undefined
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
[
|
|
101
|
+
props.scroll
|
|
102
|
+
? h(
|
|
103
|
+
'MavisScreenScroll',
|
|
104
|
+
{ iosOverflowSafeArea: false, accessibilityHidden: covered, ...scrollMotion },
|
|
105
|
+
[content],
|
|
106
|
+
)
|
|
107
|
+
: content,
|
|
108
|
+
...notices.map((layer) =>
|
|
109
|
+
h(layer.component, { ...layer.props, covered, key: layer.key }),
|
|
110
|
+
),
|
|
111
|
+
// Layers such as sheets render above the content. Their host ignores Core's safe-area
|
|
112
|
+
// adjustment and grows over the whole window, so the sheet geometry can trust its frame
|
|
113
|
+
// and the scrim covers the status bar and home indicator areas too.
|
|
114
|
+
covered
|
|
115
|
+
? h(
|
|
116
|
+
'GridLayout',
|
|
117
|
+
{
|
|
118
|
+
iosIgnoreSafeArea: true,
|
|
119
|
+
onLoaded: (event: EventData) => expandLayerHost(event.object as View),
|
|
120
|
+
onLayoutChanged: (event: EventData) => expandLayerHost(event.object as View),
|
|
121
|
+
},
|
|
122
|
+
modal.map((layer) => h(layer.component, { ...layer.props, key: layer.key })),
|
|
123
|
+
)
|
|
124
|
+
: null,
|
|
125
|
+
],
|
|
126
|
+
),
|
|
39
127
|
],
|
|
40
128
|
)
|
|
41
129
|
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
mergeProps,
|
|
5
|
+
onBeforeUnmount,
|
|
6
|
+
ref,
|
|
7
|
+
registerElement,
|
|
8
|
+
watch,
|
|
9
|
+
} from 'nativescript-vue'
|
|
10
|
+
import type { EventData, View } from '@nativescript/core'
|
|
11
|
+
import {
|
|
12
|
+
canChoose,
|
|
13
|
+
choiceKey,
|
|
14
|
+
segmentedFocusTarget,
|
|
15
|
+
validateSegments,
|
|
16
|
+
type SegmentedOption,
|
|
17
|
+
} from '@getcortexlabs/mavis-core'
|
|
18
|
+
import {
|
|
19
|
+
useButtonAction,
|
|
20
|
+
segmentedProps,
|
|
21
|
+
segmentedEmits,
|
|
22
|
+
useMavisTheme,
|
|
23
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
24
|
+
import { MavisButton } from '../../native/button'
|
|
25
|
+
import { observeTab } from '../../native/tabs'
|
|
26
|
+
import { attachSegmentedIndicator } from '../../native/segmented'
|
|
27
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
28
|
+
import { MBox, MRow } from './layout.js'
|
|
29
|
+
|
|
30
|
+
registerElement('MavisSegmentButton', () => MavisButton)
|
|
31
|
+
|
|
32
|
+
export const MSegmentedControl = defineComponent({
|
|
33
|
+
name: 'MSegmentedControl',
|
|
34
|
+
inheritAttrs: false,
|
|
35
|
+
props: segmentedProps,
|
|
36
|
+
emits: segmentedEmits,
|
|
37
|
+
setup(props, { attrs, emit }) {
|
|
38
|
+
useButtonAction()
|
|
39
|
+
const { theme } = useMavisTheme()
|
|
40
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
41
|
+
const controls = new Map<string, View>()
|
|
42
|
+
const observers = new Map<string, () => void>()
|
|
43
|
+
const focusKey = ref<string>()
|
|
44
|
+
let row: View | undefined, indicator: View | undefined
|
|
45
|
+
let motion: ReturnType<typeof attachSegmentedIndicator> | undefined
|
|
46
|
+
function connect() {
|
|
47
|
+
if (row && indicator && !motion)
|
|
48
|
+
motion = attachSegmentedIndicator(indicator, () => {
|
|
49
|
+
const active = props.options.find((option) => option.value === props.modelValue)
|
|
50
|
+
const key = active && choiceKey(active.value)
|
|
51
|
+
const button = key && controls.get(key)
|
|
52
|
+
const point = button && row && button.getLocationRelativeTo(row)
|
|
53
|
+
if (!key || !button || !point) return
|
|
54
|
+
return { key, x: point.x, ...button.getActualSize() }
|
|
55
|
+
})
|
|
56
|
+
motion?.update()
|
|
57
|
+
}
|
|
58
|
+
function release() {
|
|
59
|
+
motion?.dispose()
|
|
60
|
+
motion = undefined
|
|
61
|
+
for (const dispose of observers.values()) dispose()
|
|
62
|
+
observers.clear()
|
|
63
|
+
controls.clear()
|
|
64
|
+
row = indicator = undefined
|
|
65
|
+
focusKey.value = undefined
|
|
66
|
+
}
|
|
67
|
+
onBeforeUnmount(release)
|
|
68
|
+
watch(
|
|
69
|
+
() => props.modelValue,
|
|
70
|
+
() => motion?.update(true),
|
|
71
|
+
{ flush: 'post' },
|
|
72
|
+
)
|
|
73
|
+
watch(
|
|
74
|
+
() => [props.options, props.disabled],
|
|
75
|
+
() => motion?.update(),
|
|
76
|
+
{ deep: true, flush: 'post' },
|
|
77
|
+
)
|
|
78
|
+
function request(option: SegmentedOption) {
|
|
79
|
+
if (canChoose(option, props.modelValue, props.disabled))
|
|
80
|
+
emit('update:modelValue', option.value)
|
|
81
|
+
}
|
|
82
|
+
function navigate(option: SegmentedOption, key: string) {
|
|
83
|
+
if (props.disabled || props.options.find((item) => item.value === option.value)?.disabled)
|
|
84
|
+
return
|
|
85
|
+
const rtl =
|
|
86
|
+
row?.android?.getLayoutDirection() === 1 ||
|
|
87
|
+
row?.ios?.effectiveUserInterfaceLayoutDirection === 1
|
|
88
|
+
const next = segmentedFocusTarget(props.options, option.value, key, rtl)
|
|
89
|
+
if (!next) return
|
|
90
|
+
controls.get(choiceKey(next.value))?.focus()
|
|
91
|
+
request(next)
|
|
92
|
+
}
|
|
93
|
+
return () => {
|
|
94
|
+
validateSegments(props.options, props.modelValue, props.label)
|
|
95
|
+
const { colors, radius, typography } = theme.value
|
|
96
|
+
return h(
|
|
97
|
+
MBox,
|
|
98
|
+
mergeProps(attrs, {
|
|
99
|
+
id: props.id,
|
|
100
|
+
width: props.width,
|
|
101
|
+
grow: props.grow,
|
|
102
|
+
shrink: props.shrink,
|
|
103
|
+
accessibilityHidden: props.accessibilityHidden,
|
|
104
|
+
padding: 4,
|
|
105
|
+
radius: 'md',
|
|
106
|
+
backgroundColor: colors.elevated,
|
|
107
|
+
style: { borderWidth: 1, borderColor: colors.border, opacity: props.disabled ? 0.45 : 1 },
|
|
108
|
+
onUnloaded: release,
|
|
109
|
+
}),
|
|
110
|
+
{
|
|
111
|
+
default: () => [
|
|
112
|
+
h('MavisBox', {
|
|
113
|
+
accessible: false,
|
|
114
|
+
accessibilityHidden: true,
|
|
115
|
+
isUserInteractionEnabled: false,
|
|
116
|
+
horizontalAlignment: 'left',
|
|
117
|
+
verticalAlignment: 'top',
|
|
118
|
+
width: 1,
|
|
119
|
+
height: 1,
|
|
120
|
+
backgroundColor: colors.primarySoft,
|
|
121
|
+
borderRadius: Math.max(0, radius.md - 4),
|
|
122
|
+
opacity: 0,
|
|
123
|
+
onLoaded: (event: EventData) => {
|
|
124
|
+
indicator = event.object as View
|
|
125
|
+
connect()
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
h(
|
|
129
|
+
MRow,
|
|
130
|
+
{
|
|
131
|
+
gap: 4,
|
|
132
|
+
align: 'stretch',
|
|
133
|
+
onLoaded: (event: EventData) => {
|
|
134
|
+
row = event.object as View
|
|
135
|
+
connect()
|
|
136
|
+
},
|
|
137
|
+
onLayoutChanged: () => motion?.update(),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
default: () =>
|
|
141
|
+
props.options.map((option) => {
|
|
142
|
+
const key = choiceKey(option.value),
|
|
143
|
+
selected = option.value === props.modelValue
|
|
144
|
+
const disabled = props.disabled || Boolean(option.disabled)
|
|
145
|
+
return h('MavisSegmentButton', {
|
|
146
|
+
...nativeAttrs(),
|
|
147
|
+
id: undefined,
|
|
148
|
+
key,
|
|
149
|
+
text: option.label,
|
|
150
|
+
textWrap: true,
|
|
151
|
+
accessible: true,
|
|
152
|
+
accessibilityRole: 'radioButton',
|
|
153
|
+
accessibilityLabel: option.label,
|
|
154
|
+
accessibilityHint: props.label,
|
|
155
|
+
accessibilityState: selected ? 'checked' : 'unchecked',
|
|
156
|
+
isEnabled: !disabled,
|
|
157
|
+
iosAccessibilityAdjustsFontSize: true,
|
|
158
|
+
style: {
|
|
159
|
+
width: 0,
|
|
160
|
+
flexGrow: 1,
|
|
161
|
+
flexShrink: 1,
|
|
162
|
+
minHeight: 48,
|
|
163
|
+
margin: 0,
|
|
164
|
+
paddingLeft: 8,
|
|
165
|
+
paddingRight: 8,
|
|
166
|
+
paddingTop: 10,
|
|
167
|
+
paddingBottom: 10,
|
|
168
|
+
fontSize: typography.body.fontSize,
|
|
169
|
+
fontWeight: '600',
|
|
170
|
+
textTransform: 'none',
|
|
171
|
+
color: selected ? colors.primary : colors.text,
|
|
172
|
+
backgroundColor: 'transparent',
|
|
173
|
+
borderWidth: 2,
|
|
174
|
+
borderColor: focusKey.value === key ? colors.primary : 'transparent',
|
|
175
|
+
borderRadius: Math.max(0, radius.md - 4),
|
|
176
|
+
opacity: option.disabled && !props.disabled ? 0.45 : 1,
|
|
177
|
+
androidElevation: 0,
|
|
178
|
+
androidDynamicElevationOffset: 0,
|
|
179
|
+
},
|
|
180
|
+
onTap: () => request(option),
|
|
181
|
+
onLoaded: (event: EventData) => {
|
|
182
|
+
const button = event.object as View
|
|
183
|
+
controls.set(key, button)
|
|
184
|
+
observers.get(key)?.()
|
|
185
|
+
observers.set(
|
|
186
|
+
key,
|
|
187
|
+
observeTab(
|
|
188
|
+
button,
|
|
189
|
+
(focused) => {
|
|
190
|
+
if (focused) focusKey.value = key
|
|
191
|
+
else if (focusKey.value === key) focusKey.value = undefined
|
|
192
|
+
},
|
|
193
|
+
(direction) => navigate(option, direction),
|
|
194
|
+
),
|
|
195
|
+
)
|
|
196
|
+
motion?.update()
|
|
197
|
+
},
|
|
198
|
+
onUnloaded: () => {
|
|
199
|
+
observers.get(key)?.()
|
|
200
|
+
observers.delete(key)
|
|
201
|
+
controls.delete(key)
|
|
202
|
+
motion?.update()
|
|
203
|
+
},
|
|
204
|
+
onLayoutChanged: () => motion?.update(),
|
|
205
|
+
})
|
|
206
|
+
}),
|
|
207
|
+
},
|
|
208
|
+
),
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
})
|