@nuxt/ui 2.18.4 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/cli/commands/init.mjs +83 -0
- package/cli/index.mjs +15 -0
- package/cli/package.json +13 -0
- package/cli/templates.mjs +171 -0
- package/cli/utils.mjs +17 -0
- package/dist/module.d.mts +10 -26
- package/dist/module.d.ts +10 -26
- package/dist/module.json +3 -3
- package/dist/module.mjs +2620 -152
- package/dist/runtime/assets/css/animations.css +1 -0
- package/dist/runtime/components/Accordion.vue +67 -0
- package/dist/runtime/components/Accordion.vue.d.ts +492 -0
- package/dist/runtime/components/Alert.vue +78 -0
- package/dist/runtime/components/Alert.vue.d.ts +548 -0
- package/dist/runtime/components/App.vue +32 -0
- package/dist/runtime/components/App.vue.d.ts +25 -0
- package/dist/runtime/components/Avatar.vue +48 -0
- package/dist/runtime/components/Avatar.vue.d.ts +384 -0
- package/dist/runtime/components/AvatarGroup.vue +74 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +381 -0
- package/dist/runtime/components/Badge.vue +24 -0
- package/dist/runtime/components/Badge.vue.d.ts +422 -0
- package/dist/runtime/components/Breadcrumb.vue +60 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +307 -0
- package/dist/runtime/components/Button.vue +55 -0
- package/dist/runtime/components/Button.vue.d.ts +949 -0
- package/dist/runtime/components/ButtonGroup.vue +29 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +182 -0
- package/dist/runtime/components/Card.vue +33 -0
- package/dist/runtime/components/Card.vue.d.ts +191 -0
- package/dist/runtime/components/Checkbox.vue +89 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +819 -0
- package/dist/runtime/components/Chip.vue +43 -0
- package/dist/runtime/components/Chip.vue.d.ts +590 -0
- package/dist/runtime/components/Collapsible.vue +33 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +159 -0
- package/dist/runtime/components/CommandPalette.vue +210 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +684 -0
- package/dist/runtime/components/Container.vue +20 -0
- package/dist/runtime/components/Container.vue.d.ts +27 -0
- package/dist/runtime/components/ContextMenu.vue +51 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +796 -0
- package/dist/runtime/components/ContextMenuContent.vue +108 -0
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
- package/dist/runtime/components/Drawer.vue +73 -0
- package/dist/runtime/components/Drawer.vue.d.ts +343 -0
- package/dist/runtime/components/DropdownMenu.vue +55 -0
- package/dist/runtime/components/DropdownMenu.vue.d.ts +815 -0
- package/dist/runtime/components/DropdownMenuContent.vue +111 -0
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
- package/dist/runtime/components/Form.vue +206 -0
- package/dist/runtime/components/Form.vue.d.ts +39 -0
- package/dist/runtime/components/FormField.vue +82 -0
- package/dist/runtime/components/FormField.vue.d.ts +356 -0
- package/dist/runtime/components/Icon.vue +16 -0
- package/dist/runtime/components/Icon.vue.d.ts +17 -0
- package/dist/runtime/components/Input.vue +140 -0
- package/dist/runtime/components/Input.vue.d.ts +1137 -0
- package/dist/runtime/components/InputMenu.vue +264 -0
- package/dist/runtime/components/InputMenu.vue.d.ts +2121 -0
- package/dist/runtime/components/Kbd.vue +27 -0
- package/dist/runtime/components/Kbd.vue.d.ts +169 -0
- package/dist/runtime/components/Link.vue +83 -0
- package/dist/runtime/components/Link.vue.d.ts +76 -0
- package/dist/runtime/components/LinkBase.vue +50 -0
- package/dist/runtime/components/LinkBase.vue.d.ts +49 -0
- package/dist/runtime/components/Modal.vue +100 -0
- package/dist/runtime/components/Modal.vue.d.ts +319 -0
- package/dist/runtime/components/ModalProvider.vue +12 -0
- package/dist/runtime/components/NavigationMenu.vue +125 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +1789 -0
- package/dist/runtime/components/Pagination.vue +80 -0
- package/dist/runtime/components/Pagination.vue.d.ts +295 -0
- package/dist/runtime/components/Popover.vue +52 -0
- package/dist/runtime/components/Popover.vue.d.ts +197 -0
- package/dist/runtime/components/Progress.vue +126 -0
- package/dist/runtime/components/Progress.vue.d.ts +1781 -0
- package/dist/runtime/components/RadioGroup.vue +111 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +1715 -0
- package/dist/runtime/components/Select.vue +148 -0
- package/dist/runtime/components/Select.vue.d.ts +1569 -0
- package/dist/runtime/components/SelectMenu.vue +208 -0
- package/dist/runtime/components/SelectMenu.vue.d.ts +1661 -0
- package/dist/runtime/components/Separator.vue +47 -0
- package/dist/runtime/components/Separator.vue.d.ts +0 -0
- package/dist/runtime/components/Skeleton.vue +19 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
- package/dist/runtime/components/Slideover.vue +101 -0
- package/dist/runtime/components/Slideover.vue.d.ts +375 -0
- package/dist/runtime/components/SlideoverProvider.vue +12 -0
- package/dist/runtime/components/Slider.vue +83 -0
- package/dist/runtime/components/Slider.vue.d.ts +0 -0
- package/dist/runtime/components/Switch.vue +80 -0
- package/dist/runtime/components/Switch.vue.d.ts +1676 -0
- package/dist/runtime/components/Tabs.vue +61 -0
- package/dist/runtime/components/Tabs.vue.d.ts +934 -0
- package/dist/runtime/components/Textarea.vue +149 -0
- package/dist/runtime/components/Textarea.vue.d.ts +1133 -0
- package/dist/runtime/components/Toast.vue +112 -0
- package/dist/runtime/components/Toast.vue.d.ts +0 -0
- package/dist/runtime/components/Toaster.vue +109 -0
- package/dist/runtime/components/Toaster.vue.d.ts +362 -0
- package/dist/runtime/components/Tooltip.vue +52 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +248 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +7 -5
- package/dist/runtime/composables/defineShortcuts.js +94 -65
- package/dist/runtime/composables/useAvatarGroup.d.ts +10 -0
- package/dist/runtime/composables/useAvatarGroup.js +10 -0
- package/dist/runtime/composables/useButtonGroup.d.ts +12 -17
- package/dist/runtime/composables/useButtonGroup.js +6 -56
- package/dist/runtime/composables/useComponentIcons.d.ts +26 -0
- package/dist/runtime/composables/useComponentIcons.js +26 -0
- package/dist/runtime/composables/useFormField.d.ts +31 -0
- package/dist/runtime/composables/useFormField.js +50 -0
- package/dist/runtime/composables/useKbd.d.ts +28 -0
- package/dist/runtime/composables/useKbd.js +46 -0
- package/dist/runtime/composables/useModal.d.ts +8 -4
- package/dist/runtime/composables/useModal.js +1 -0
- package/dist/runtime/composables/useSlideover.d.ts +9 -5
- package/dist/runtime/composables/useSlideover.js +3 -2
- package/dist/runtime/composables/useToast.d.ts +9 -17
- package/dist/runtime/composables/useToast.js +27 -13
- package/dist/runtime/plugins/colors.d.ts +0 -2
- package/dist/runtime/plugins/colors.js +9 -17
- package/dist/runtime/plugins/modal.d.ts +0 -0
- package/dist/runtime/plugins/slideover.d.ts +0 -0
- package/dist/runtime/plugins/{slideovers.js → slideover.js} +3 -3
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/component.d.ts +17 -14
- package/dist/runtime/types/component.js +0 -0
- package/dist/runtime/types/form.d.ts +63 -32
- package/dist/runtime/types/form.js +12 -0
- package/dist/runtime/types/index.d.ts +41 -30
- package/dist/runtime/types/index.js +42 -31
- package/dist/runtime/types/utils.d.ts +13 -32
- package/dist/runtime/types/utils.js +0 -0
- package/dist/runtime/utils/form.d.ts +15 -0
- package/dist/runtime/utils/form.js +66 -0
- package/dist/runtime/utils/fuse.d.ts +4 -0
- package/dist/runtime/utils/fuse.js +63 -0
- package/dist/runtime/utils/index.d.ts +4 -10
- package/dist/runtime/utils/index.js +40 -60
- package/dist/runtime/utils/link.d.ts +58 -71
- package/dist/runtime/utils/link.js +4 -124
- package/package.json +47 -45
- package/dist/runtime/components/data/Table.vue +0 -355
- package/dist/runtime/components/data/Table.vue.d.ts +0 -439
- package/dist/runtime/components/elements/Accordion.vue +0 -185
- package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -223
- package/dist/runtime/components/elements/Alert.vue +0 -139
- package/dist/runtime/components/elements/Alert.vue.d.ts +0 -194
- package/dist/runtime/components/elements/Avatar.vue +0 -160
- package/dist/runtime/components/elements/Avatar.vue.d.ts +0 -255
- package/dist/runtime/components/elements/AvatarGroup.d.ts +0 -56
- package/dist/runtime/components/elements/AvatarGroup.js +0 -58
- package/dist/runtime/components/elements/Badge.vue +0 -75
- package/dist/runtime/components/elements/Badge.vue.d.ts +0 -109
- package/dist/runtime/components/elements/Button.vue +0 -193
- package/dist/runtime/components/elements/Button.vue.d.ts +0 -504
- package/dist/runtime/components/elements/ButtonGroup.d.ts +0 -153
- package/dist/runtime/components/elements/ButtonGroup.js +0 -51
- package/dist/runtime/components/elements/Carousel.vue +0 -165
- package/dist/runtime/components/elements/Carousel.vue.d.ts +0 -159
- package/dist/runtime/components/elements/Chip.vue +0 -85
- package/dist/runtime/components/elements/Chip.vue.d.ts +0 -162
- package/dist/runtime/components/elements/Dropdown.vue +0 -254
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +0 -254
- package/dist/runtime/components/elements/Icon.vue +0 -30
- package/dist/runtime/components/elements/Icon.vue.d.ts +0 -47
- package/dist/runtime/components/elements/Kbd.vue +0 -59
- package/dist/runtime/components/elements/Kbd.vue.d.ts +0 -86
- package/dist/runtime/components/elements/Link.vue +0 -95
- package/dist/runtime/components/elements/Link.vue.d.ts +0 -225
- package/dist/runtime/components/elements/Meter.vue +0 -170
- package/dist/runtime/components/elements/Meter.vue.d.ts +0 -279
- package/dist/runtime/components/elements/MeterGroup.d.ts +0 -135
- package/dist/runtime/components/elements/MeterGroup.js +0 -159
- package/dist/runtime/components/elements/Progress.vue +0 -203
- package/dist/runtime/components/elements/Progress.vue.d.ts +0 -280
- package/dist/runtime/components/forms/Checkbox.vue +0 -143
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +0 -179
- package/dist/runtime/components/forms/Form.vue +0 -219
- package/dist/runtime/components/forms/Form.vue.d.ts +0 -53
- package/dist/runtime/components/forms/FormGroup.vue +0 -128
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +0 -169
- package/dist/runtime/components/forms/Input.vue +0 -300
- package/dist/runtime/components/forms/Input.vue.d.ts +0 -482
- package/dist/runtime/components/forms/InputMenu.vue +0 -439
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +0 -700
- package/dist/runtime/components/forms/Radio.vue +0 -140
- package/dist/runtime/components/forms/Radio.vue.d.ts +0 -168
- package/dist/runtime/components/forms/RadioGroup.vue +0 -145
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +0 -176
- package/dist/runtime/components/forms/Range.vue +0 -173
- package/dist/runtime/components/forms/Range.vue.d.ts +0 -268
- package/dist/runtime/components/forms/Select.vue +0 -322
- package/dist/runtime/components/forms/Select.vue.d.ts +0 -471
- package/dist/runtime/components/forms/SelectMenu.vue +0 -546
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +0 -754
- package/dist/runtime/components/forms/Textarea.vue +0 -231
- package/dist/runtime/components/forms/Textarea.vue.d.ts +0 -436
- package/dist/runtime/components/forms/Toggle.vue +0 -171
- package/dist/runtime/components/forms/Toggle.vue.d.ts +0 -262
- package/dist/runtime/components/layout/Card.vue +0 -63
- package/dist/runtime/components/layout/Card.vue.d.ts +0 -89
- package/dist/runtime/components/layout/Container.vue +0 -48
- package/dist/runtime/components/layout/Container.vue.d.ts +0 -53
- package/dist/runtime/components/layout/Divider.vue +0 -108
- package/dist/runtime/components/layout/Divider.vue.d.ts +0 -198
- package/dist/runtime/components/layout/Skeleton.vue +0 -46
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +0 -53
- package/dist/runtime/components/navigation/Breadcrumb.vue +0 -82
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +0 -95
- package/dist/runtime/components/navigation/CommandPalette.vue +0 -345
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +0 -390
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +0 -152
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +0 -60
- package/dist/runtime/components/navigation/HorizontalNavigation.vue +0 -102
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +0 -99
- package/dist/runtime/components/navigation/Pagination.vue +0 -270
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +0 -260
- package/dist/runtime/components/navigation/Tabs.vue +0 -163
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +0 -165
- package/dist/runtime/components/navigation/VerticalNavigation.vue +0 -105
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +0 -113
- package/dist/runtime/components/overlays/ContextMenu.vue +0 -85
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +0 -126
- package/dist/runtime/components/overlays/Modal.vue +0 -122
- package/dist/runtime/components/overlays/Modal.vue.d.ts +0 -166
- package/dist/runtime/components/overlays/Modals.client.vue +0 -18
- package/dist/runtime/components/overlays/Notification.vue +0 -212
- package/dist/runtime/components/overlays/Notification.vue.d.ts +0 -235
- package/dist/runtime/components/overlays/Notifications.vue +0 -69
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +0 -66
- package/dist/runtime/components/overlays/Popover.vue +0 -213
- package/dist/runtime/components/overlays/Popover.vue.d.ts +0 -220
- package/dist/runtime/components/overlays/Slideover.vue +0 -152
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +0 -167
- package/dist/runtime/components/overlays/Slideovers.client.vue +0 -18
- package/dist/runtime/components/overlays/Tooltip.vue +0 -127
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +0 -165
- package/dist/runtime/composables/useCarouselScroll.d.ts +0 -2
- package/dist/runtime/composables/useCarouselScroll.js +0 -37
- package/dist/runtime/composables/useCopyToClipboard.d.ts +0 -10
- package/dist/runtime/composables/useCopyToClipboard.js +0 -26
- package/dist/runtime/composables/useFormGroup.d.ts +0 -18
- package/dist/runtime/composables/useFormGroup.js +0 -45
- package/dist/runtime/composables/usePopper.d.ts +0 -268
- package/dist/runtime/composables/usePopper.js +0 -94
- package/dist/runtime/composables/useShortcuts.d.ts +0 -12
- package/dist/runtime/composables/useShortcuts.js +0 -26
- package/dist/runtime/composables/useTimer.d.ts +0 -8
- package/dist/runtime/composables/useTimer.js +0 -51
- package/dist/runtime/composables/useUI.d.ts +0 -10
- package/dist/runtime/composables/useUI.js +0 -24
- package/dist/runtime/plugins/modals.d.ts +0 -2
- package/dist/runtime/plugins/slideovers.d.ts +0 -2
- package/dist/runtime/types/accordion.d.ts +0 -9
- package/dist/runtime/types/alert.d.ts +0 -12
- package/dist/runtime/types/avatar.d.ts +0 -17
- package/dist/runtime/types/badge.d.ts +0 -15
- package/dist/runtime/types/breadcrumb.d.ts +0 -10
- package/dist/runtime/types/button.d.ts +0 -31
- package/dist/runtime/types/chip.d.ts +0 -15
- package/dist/runtime/types/clipboard.d.ts +0 -3
- package/dist/runtime/types/command-palette.d.ts +0 -29
- package/dist/runtime/types/divider.d.ts +0 -3
- package/dist/runtime/types/dropdown.d.ts +0 -15
- package/dist/runtime/types/form-group.d.ts +0 -5
- package/dist/runtime/types/horizontal-navigation.d.ts +0 -13
- package/dist/runtime/types/input.d.ts +0 -8
- package/dist/runtime/types/kbd.d.ts +0 -5
- package/dist/runtime/types/link.d.ts +0 -12
- package/dist/runtime/types/meter.d.ts +0 -5
- package/dist/runtime/types/modal.d.ts +0 -18
- package/dist/runtime/types/notification.d.ts +0 -24
- package/dist/runtime/types/popper.d.ts +0 -17
- package/dist/runtime/types/progress.d.ts +0 -6
- package/dist/runtime/types/range.d.ts +0 -7
- package/dist/runtime/types/select.d.ts +0 -8
- package/dist/runtime/types/slideover.d.ts +0 -16
- package/dist/runtime/types/tabs.d.ts +0 -8
- package/dist/runtime/types/textarea.d.ts +0 -8
- package/dist/runtime/types/toggle.d.ts +0 -7
- package/dist/runtime/types/tooltip.d.ts +0 -7
- package/dist/runtime/types/vertical-navigation.d.ts +0 -13
- package/dist/runtime/ui.config/data/table.d.ts +0 -81
- package/dist/runtime/ui.config/data/table.js +0 -80
- package/dist/runtime/ui.config/elements/accordion.d.ts +0 -23
- package/dist/runtime/ui.config/elements/accordion.js +0 -22
- package/dist/runtime/ui.config/elements/alert.d.ts +0 -41
- package/dist/runtime/ui.config/elements/alert.js +0 -40
- package/dist/runtime/ui.config/elements/avatar.d.ts +0 -60
- package/dist/runtime/ui.config/elements/avatar.js +0 -59
- package/dist/runtime/ui.config/elements/avatarGroup.d.ts +0 -6
- package/dist/runtime/ui.config/elements/avatarGroup.js +0 -5
- package/dist/runtime/ui.config/elements/badge.d.ts +0 -34
- package/dist/runtime/ui.config/elements/badge.js +0 -33
- package/dist/runtime/ui.config/elements/button.d.ts +0 -81
- package/dist/runtime/ui.config/elements/button.js +0 -80
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +0 -101
- package/dist/runtime/ui.config/elements/buttonGroup.js +0 -19
- package/dist/runtime/ui.config/elements/carousel.d.ts +0 -27
- package/dist/runtime/ui.config/elements/carousel.js +0 -26
- package/dist/runtime/ui.config/elements/chip.d.ts +0 -35
- package/dist/runtime/ui.config/elements/chip.js +0 -34
- package/dist/runtime/ui.config/elements/dropdown.d.ts +0 -59
- package/dist/runtime/ui.config/elements/dropdown.js +0 -57
- package/dist/runtime/ui.config/elements/kbd.d.ts +0 -17
- package/dist/runtime/ui.config/elements/kbd.js +0 -16
- package/dist/runtime/ui.config/elements/meter.d.ts +0 -77
- package/dist/runtime/ui.config/elements/meter.js +0 -76
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +0 -52
- package/dist/runtime/ui.config/elements/meterGroup.js +0 -24
- package/dist/runtime/ui.config/elements/progress.d.ts +0 -75
- package/dist/runtime/ui.config/elements/progress.js +0 -74
- package/dist/runtime/ui.config/forms/checkbox.d.ts +0 -19
- package/dist/runtime/ui.config/forms/checkbox.js +0 -18
- package/dist/runtime/ui.config/forms/formGroup.d.ts +0 -26
- package/dist/runtime/ui.config/forms/formGroup.js +0 -26
- package/dist/runtime/ui.config/forms/input.d.ts +0 -110
- package/dist/runtime/ui.config/forms/input.js +0 -109
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +0 -64
- package/dist/runtime/ui.config/forms/inputMenu.js +0 -62
- package/dist/runtime/ui.config/forms/radio.d.ts +0 -18
- package/dist/runtime/ui.config/forms/radio.js +0 -17
- package/dist/runtime/ui.config/forms/radioGroup.d.ts +0 -9
- package/dist/runtime/ui.config/forms/radioGroup.js +0 -8
- package/dist/runtime/ui.config/forms/range.d.ts +0 -64
- package/dist/runtime/ui.config/forms/range.js +0 -63
- package/dist/runtime/ui.config/forms/select.d.ts +0 -111
- package/dist/runtime/ui.config/forms/select.js +0 -13
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +0 -70
- package/dist/runtime/ui.config/forms/selectMenu.js +0 -32
- package/dist/runtime/ui.config/forms/textarea.d.ts +0 -109
- package/dist/runtime/ui.config/forms/textarea.js +0 -10
- package/dist/runtime/ui.config/forms/toggle.d.ts +0 -63
- package/dist/runtime/ui.config/forms/toggle.js +0 -62
- package/dist/runtime/ui.config/index.d.ts +0 -43
- package/dist/runtime/ui.config/index.js +0 -43
- package/dist/runtime/ui.config/layout/card.d.ts +0 -24
- package/dist/runtime/ui.config/layout/card.js +0 -23
- package/dist/runtime/ui.config/layout/container.d.ts +0 -6
- package/dist/runtime/ui.config/layout/container.js +0 -5
- package/dist/runtime/ui.config/layout/divider.d.ts +0 -52
- package/dist/runtime/ui.config/layout/divider.js +0 -51
- package/dist/runtime/ui.config/layout/skeleton.d.ts +0 -6
- package/dist/runtime/ui.config/layout/skeleton.js +0 -5
- package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +0 -21
- package/dist/runtime/ui.config/navigation/breadcrumb.js +0 -20
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +0 -72
- package/dist/runtime/ui.config/navigation/commandPalette.js +0 -71
- package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +0 -27
- package/dist/runtime/ui.config/navigation/horizontalNavigation.js +0 -26
- package/dist/runtime/ui.config/navigation/pagination.d.ts +0 -35
- package/dist/runtime/ui.config/navigation/pagination.js +0 -34
- package/dist/runtime/ui.config/navigation/tabs.d.ts +0 -35
- package/dist/runtime/ui.config/navigation/tabs.js +0 -34
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +0 -34
- package/dist/runtime/ui.config/navigation/verticalNavigation.js +0 -33
- package/dist/runtime/ui.config/overlays/contextMenu.d.ts +0 -31
- package/dist/runtime/ui.config/overlays/contextMenu.js +0 -25
- package/dist/runtime/ui.config/overlays/modal.d.ts +0 -36
- package/dist/runtime/ui.config/overlays/modal.js +0 -37
- package/dist/runtime/ui.config/overlays/notification.d.ts +0 -50
- package/dist/runtime/ui.config/overlays/notification.js +0 -50
- package/dist/runtime/ui.config/overlays/notifications.d.ts +0 -7
- package/dist/runtime/ui.config/overlays/notifications.js +0 -6
- package/dist/runtime/ui.config/overlays/popover.d.ts +0 -47
- package/dist/runtime/ui.config/overlays/popover.js +0 -41
- package/dist/runtime/ui.config/overlays/slideover.d.ts +0 -35
- package/dist/runtime/ui.config/overlays/slideover.js +0 -36
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +0 -37
- package/dist/runtime/ui.config/overlays/tooltip.js +0 -34
- package/dist/runtime/ui.config/popper.d.ts +0 -8
- package/dist/runtime/ui.config/popper.js +0 -9
- package/dist/runtime/ui.css +0 -1
- package/dist/runtime/utils/colors.d.ts +0 -11
- package/dist/runtime/utils/colors.js +0 -307
- package/dist/runtime/utils/lodash.d.ts +0 -2
- package/dist/runtime/utils/lodash.js +0 -23
- package/dist/runtime/plugins/{modals.js → modal.js} +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
import { type UseEventBusReturn } from '@vueuse/core';
|
|
3
|
+
import type { FormFieldProps } from '../types.js';
|
|
4
|
+
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form.js';
|
|
5
|
+
import type { GetObjectField } from '../types/utils.js';
|
|
6
|
+
type Props<T> = {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
size?: GetObjectField<T, 'size'>;
|
|
10
|
+
color?: GetObjectField<T, 'color'>;
|
|
11
|
+
eagerValidation?: boolean;
|
|
12
|
+
legend?: string;
|
|
13
|
+
highlight?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
|
|
17
|
+
export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent, string>>;
|
|
18
|
+
export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
|
|
19
|
+
export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, string>>>;
|
|
20
|
+
export declare function useFormField<T>(props?: Props<T>): {
|
|
21
|
+
id: ComputedRef<string | undefined>;
|
|
22
|
+
name: ComputedRef<string | undefined>;
|
|
23
|
+
size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
|
|
24
|
+
color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
|
|
25
|
+
highlight: ComputedRef<boolean | undefined>;
|
|
26
|
+
disabled: ComputedRef<boolean | undefined>;
|
|
27
|
+
emitFormBlur: () => void;
|
|
28
|
+
emitFormInput: import("@vueuse/core").PromisifyFn<() => void>;
|
|
29
|
+
emitFormChange: () => void;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { inject, ref, computed } from "vue";
|
|
2
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
3
|
+
export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
|
|
4
|
+
export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
|
|
5
|
+
export const formFieldInjectionKey = Symbol("nuxt-ui.form-field");
|
|
6
|
+
export const formInputsInjectionKey = Symbol("nuxt-ui.form-inputs");
|
|
7
|
+
export function useFormField(props) {
|
|
8
|
+
const formOptions = inject(formOptionsInjectionKey, void 0);
|
|
9
|
+
const formBus = inject(formBusInjectionKey, void 0);
|
|
10
|
+
const formField = inject(formFieldInjectionKey, void 0);
|
|
11
|
+
const formInputs = inject(formInputsInjectionKey, void 0);
|
|
12
|
+
if (formField) {
|
|
13
|
+
if (props?.id) {
|
|
14
|
+
formField.value.id = props?.id;
|
|
15
|
+
}
|
|
16
|
+
if (formInputs && formField.value.name) {
|
|
17
|
+
formInputs.value[formField.value.name] = formField.value.id;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const blurred = ref(false);
|
|
21
|
+
function emitFormEvent(type, name) {
|
|
22
|
+
if (formBus && formField && name) {
|
|
23
|
+
formBus.emit({ type, name });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function emitFormBlur() {
|
|
27
|
+
emitFormEvent("blur", formField?.value.name);
|
|
28
|
+
blurred.value = true;
|
|
29
|
+
}
|
|
30
|
+
function emitFormChange() {
|
|
31
|
+
emitFormEvent("change", formField?.value.name);
|
|
32
|
+
}
|
|
33
|
+
const emitFormInput = useDebounceFn(
|
|
34
|
+
() => {
|
|
35
|
+
emitFormEvent("input", formField?.value.name);
|
|
36
|
+
},
|
|
37
|
+
formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
|
|
38
|
+
);
|
|
39
|
+
return {
|
|
40
|
+
id: computed(() => props?.id ?? formField?.value.id),
|
|
41
|
+
name: computed(() => props?.name ?? formField?.value.name),
|
|
42
|
+
size: computed(() => props?.size ?? formField?.value.size),
|
|
43
|
+
color: computed(() => formField?.value.error ? "error" : props?.color),
|
|
44
|
+
highlight: computed(() => formField?.value.error ? true : props?.highlight),
|
|
45
|
+
disabled: computed(() => formOptions?.value.disabled || props?.disabled),
|
|
46
|
+
emitFormBlur,
|
|
47
|
+
emitFormInput,
|
|
48
|
+
emitFormChange
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const kbdKeysMap: {
|
|
2
|
+
meta: string;
|
|
3
|
+
command: string;
|
|
4
|
+
shift: string;
|
|
5
|
+
ctrl: string;
|
|
6
|
+
option: string;
|
|
7
|
+
alt: string;
|
|
8
|
+
enter: string;
|
|
9
|
+
delete: string;
|
|
10
|
+
backspace: string;
|
|
11
|
+
escape: string;
|
|
12
|
+
tab: string;
|
|
13
|
+
capslock: string;
|
|
14
|
+
arrowup: string;
|
|
15
|
+
arrowright: string;
|
|
16
|
+
arrowdown: string;
|
|
17
|
+
arrowleft: string;
|
|
18
|
+
pageup: string;
|
|
19
|
+
pagedown: string;
|
|
20
|
+
home: string;
|
|
21
|
+
end: string;
|
|
22
|
+
};
|
|
23
|
+
export type KbdKey = keyof typeof kbdKeysMap;
|
|
24
|
+
export declare const useKbd: () => {
|
|
25
|
+
macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
|
|
26
|
+
metaSymbol: import("vue").Ref<string, string>;
|
|
27
|
+
getKbdKey: (value?: KbdKey | string) => string | undefined;
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
+
import { ref, computed, onMounted } from "vue";
|
|
3
|
+
export const kbdKeysMap = {
|
|
4
|
+
meta: "",
|
|
5
|
+
command: "\u2318",
|
|
6
|
+
shift: "\u21E7",
|
|
7
|
+
ctrl: "\u2303",
|
|
8
|
+
option: "\u2325",
|
|
9
|
+
alt: "\u2387",
|
|
10
|
+
enter: "\u21B5",
|
|
11
|
+
delete: "\u2326",
|
|
12
|
+
backspace: "\u232B",
|
|
13
|
+
escape: "\u238B",
|
|
14
|
+
tab: "\u21E5",
|
|
15
|
+
capslock: "\u21EA",
|
|
16
|
+
arrowup: "\u2191",
|
|
17
|
+
arrowright: "\u2192",
|
|
18
|
+
arrowdown: "\u2193",
|
|
19
|
+
arrowleft: "\u2190",
|
|
20
|
+
pageup: "\u21DE",
|
|
21
|
+
pagedown: "\u21DF",
|
|
22
|
+
home: "\u2196",
|
|
23
|
+
end: "\u2198"
|
|
24
|
+
};
|
|
25
|
+
const _useKbd = () => {
|
|
26
|
+
const macOS = computed(() => import.meta.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/));
|
|
27
|
+
const metaSymbol = ref(" ");
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
metaSymbol.value = macOS.value ? kbdKeysMap.command : kbdKeysMap.ctrl;
|
|
30
|
+
});
|
|
31
|
+
function getKbdKey(value) {
|
|
32
|
+
if (!value) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (value === "meta") {
|
|
36
|
+
return metaSymbol.value;
|
|
37
|
+
}
|
|
38
|
+
return kbdKeysMap[value] || value.toUpperCase();
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
macOS,
|
|
42
|
+
metaSymbol,
|
|
43
|
+
getKbdKey
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export const useKbd = createSharedComposable(_useKbd);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
+
import type { ModalProps } from '../types.js';
|
|
2
3
|
import type { ComponentProps } from '../types/component.js';
|
|
3
|
-
|
|
4
|
+
export interface ModalState {
|
|
5
|
+
component: Component | string;
|
|
6
|
+
props: ModalProps;
|
|
7
|
+
}
|
|
4
8
|
export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
|
|
5
9
|
declare function _useModal(): {
|
|
6
|
-
open: <T extends Component>(component: T, props?:
|
|
10
|
+
open: <T extends Component>(component: T, props?: ModalProps & ComponentProps<T>) => void;
|
|
7
11
|
close: () => Promise<void>;
|
|
8
12
|
reset: () => void;
|
|
9
|
-
patch: <T extends Component =
|
|
10
|
-
isOpen: import("vue").Ref<boolean>;
|
|
13
|
+
patch: <T extends Component = Record<string, never>>(props: Partial<ModalProps & ComponentProps<T>>) => void;
|
|
14
|
+
isOpen: import("vue").Ref<boolean, boolean>;
|
|
11
15
|
};
|
|
12
16
|
export declare const useModal: typeof _useModal;
|
|
13
17
|
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
+
import type { SlideoverProps } from '../types.js';
|
|
2
3
|
import type { ComponentProps } from '../types/component.js';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
export interface SlideoverState {
|
|
5
|
+
component: Component | string;
|
|
6
|
+
props: SlideoverProps;
|
|
7
|
+
}
|
|
8
|
+
export declare const slideoverInjectionKey: InjectionKey<ShallowRef<SlideoverState>>;
|
|
5
9
|
declare function _useSlideover(): {
|
|
6
|
-
open: <T extends Component>(component: T, props?:
|
|
10
|
+
open: <T extends Component>(component: T, props?: SlideoverProps & ComponentProps<T>) => void;
|
|
7
11
|
close: () => Promise<void>;
|
|
8
12
|
reset: () => void;
|
|
9
|
-
patch: <T extends Component =
|
|
10
|
-
isOpen: import("vue").Ref<boolean>;
|
|
13
|
+
patch: <T extends Component = Record<string, never>>(props: Partial<SlideoverState & ComponentProps<T>>) => void;
|
|
14
|
+
isOpen: import("vue").Ref<boolean, boolean>;
|
|
11
15
|
};
|
|
12
16
|
export declare const useSlideover: typeof _useSlideover;
|
|
13
17
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref, inject } from "vue";
|
|
2
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
-
export const
|
|
3
|
+
export const slideoverInjectionKey = Symbol("nuxt-ui.slideover");
|
|
4
4
|
function _useSlideover() {
|
|
5
|
-
const slideoverState = inject(
|
|
5
|
+
const slideoverState = inject(slideoverInjectionKey);
|
|
6
6
|
const isOpen = ref(false);
|
|
7
7
|
function open(component, props) {
|
|
8
8
|
if (!slideoverState) {
|
|
@@ -19,6 +19,7 @@ function _useSlideover() {
|
|
|
19
19
|
isOpen.value = false;
|
|
20
20
|
}
|
|
21
21
|
function reset() {
|
|
22
|
+
if (!slideoverState) return;
|
|
22
23
|
slideoverState.value = {
|
|
23
24
|
component: "div",
|
|
24
25
|
props: {}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToastProps } from '../types.js';
|
|
2
|
+
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
|
3
|
+
id: string | number;
|
|
4
|
+
click?: (toast: Toast) => void;
|
|
5
|
+
}
|
|
2
6
|
export declare function useToast(): {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
icon?: string;
|
|
8
|
-
avatar?: import("../types").Avatar;
|
|
9
|
-
closeButton?: import("../types").Button;
|
|
10
|
-
timeout?: number;
|
|
11
|
-
actions?: import("../types").NotificationAction[];
|
|
12
|
-
click?: (...args: any[]) => void;
|
|
13
|
-
callback?: (...args: any[]) => void;
|
|
14
|
-
color?: import("../types").NotificationColor;
|
|
15
|
-
ui?: any;
|
|
16
|
-
};
|
|
17
|
-
remove: (id: string) => void;
|
|
18
|
-
update: (id: string, notification: Partial<Notification>) => void;
|
|
7
|
+
toasts: import("vue").Ref<Toast[], Toast[]>;
|
|
8
|
+
add: (toast: Partial<Toast>) => Toast;
|
|
9
|
+
update: (id: string | number, toast: Partial<Toast>) => void;
|
|
10
|
+
remove: (id: string | number) => void;
|
|
19
11
|
clear: () => void;
|
|
20
12
|
};
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import { useState } from "#imports";
|
|
2
2
|
export function useToast() {
|
|
3
|
-
const
|
|
4
|
-
function add(
|
|
3
|
+
const toasts = useState("toasts", () => []);
|
|
4
|
+
function add(toast) {
|
|
5
5
|
const body = {
|
|
6
6
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
7
|
-
|
|
7
|
+
open: true,
|
|
8
|
+
...toast
|
|
8
9
|
};
|
|
9
|
-
const index =
|
|
10
|
+
const index = toasts.value.findIndex((t) => t.id === body.id);
|
|
10
11
|
if (index === -1) {
|
|
11
|
-
|
|
12
|
+
toasts.value.push(body);
|
|
12
13
|
}
|
|
14
|
+
toasts.value = toasts.value.slice(-5);
|
|
13
15
|
return body;
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
+
function update(id, toast) {
|
|
18
|
+
const index = toasts.value.findIndex((t) => t.id === id);
|
|
19
|
+
if (index !== -1) {
|
|
20
|
+
toasts.value[index] = {
|
|
21
|
+
...toasts.value[index],
|
|
22
|
+
...toast
|
|
23
|
+
};
|
|
24
|
+
}
|
|
17
25
|
}
|
|
18
|
-
function
|
|
19
|
-
const index =
|
|
26
|
+
function remove(id) {
|
|
27
|
+
const index = toasts.value.findIndex((t) => t.id === id);
|
|
20
28
|
if (index !== -1) {
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
toasts.value[index] = {
|
|
30
|
+
...toasts.value[index],
|
|
31
|
+
open: false
|
|
32
|
+
};
|
|
23
33
|
}
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
toasts.value = toasts.value.filter((t) => t.id !== id);
|
|
36
|
+
}, 200);
|
|
24
37
|
}
|
|
25
38
|
function clear() {
|
|
26
|
-
|
|
39
|
+
toasts.value = [];
|
|
27
40
|
}
|
|
28
41
|
return {
|
|
42
|
+
toasts,
|
|
29
43
|
add,
|
|
30
|
-
remove,
|
|
31
44
|
update,
|
|
45
|
+
remove,
|
|
32
46
|
clear
|
|
33
47
|
};
|
|
34
48
|
}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
-
import { get, hexToRgb } from "../utils/index.js";
|
|
3
2
|
import { defineNuxtPlugin, useAppConfig, useNuxtApp, useHead } from "#imports";
|
|
4
|
-
import colors from "#tailwind-config/theme/colors";
|
|
5
3
|
export default defineNuxtPlugin(() => {
|
|
6
4
|
const appConfig = useAppConfig();
|
|
7
5
|
const nuxtApp = useNuxtApp();
|
|
6
|
+
const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
7
|
+
function generateColor(key, value) {
|
|
8
|
+
return `${shades.map((shade) => `--color-${key}-${shade}: var(--color-${value}-${shade});`).join("\n ")}`;
|
|
9
|
+
}
|
|
8
10
|
const root = computed(() => {
|
|
9
|
-
const primary = get(colors, appConfig.ui.primary);
|
|
10
|
-
const gray = get(colors, appConfig.ui.gray);
|
|
11
|
-
if (!primary) {
|
|
12
|
-
console.warn(`[@nuxt/ui] Primary color '${appConfig.ui.primary}' not found in Tailwind config`);
|
|
13
|
-
}
|
|
14
|
-
if (!gray) {
|
|
15
|
-
console.warn(`[@nuxt/ui] Gray color '${appConfig.ui.gray}' not found in Tailwind config`);
|
|
16
|
-
}
|
|
17
11
|
return `:root {
|
|
18
|
-
${Object.entries(
|
|
19
|
-
--color-primary-DEFAULT: var(--color-primary-500);
|
|
20
|
-
|
|
21
|
-
${Object.entries(gray || colors.cool).map(([key, value]) => `--color-gray-${key}: ${hexToRgb(value)};`).join("\n")}
|
|
12
|
+
${Object.entries(appConfig.ui.colors).map(([key, value]) => generateColor(key, value)).join("\n ")}
|
|
13
|
+
--color-primary-DEFAULT: var(--color-primary-500);
|
|
22
14
|
}
|
|
23
|
-
|
|
24
|
-
.dark {
|
|
15
|
+
@media (prefers-color-scheme: dark) {
|
|
25
16
|
--color-primary-DEFAULT: var(--color-primary-400);
|
|
26
17
|
}
|
|
27
18
|
`;
|
|
@@ -30,7 +21,8 @@ ${Object.entries(gray || colors.cool).map(([key, value]) => `--color-gray-${key}
|
|
|
30
21
|
style: [{
|
|
31
22
|
innerHTML: () => root.value,
|
|
32
23
|
tagPriority: -2,
|
|
33
|
-
id: "nuxt-ui-colors"
|
|
24
|
+
id: "nuxt-ui-colors",
|
|
25
|
+
type: "text/css"
|
|
34
26
|
}]
|
|
35
27
|
};
|
|
36
28
|
if (import.meta.client && nuxtApp.isHydrating && !nuxtApp.payload.serverRendered) {
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from "#imports";
|
|
2
1
|
import { shallowRef } from "vue";
|
|
3
|
-
import {
|
|
2
|
+
import { defineNuxtPlugin } from "#imports";
|
|
3
|
+
import { slideoverInjectionKey } from "../composables/useSlideover.js";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const slideoverState = shallowRef({
|
|
6
6
|
component: "div",
|
|
7
7
|
props: {}
|
|
8
8
|
});
|
|
9
|
-
nuxtApp.vueApp.provide(
|
|
9
|
+
nuxtApp.vueApp.provide(slideoverInjectionKey, slideoverState);
|
|
10
10
|
});
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
export type ComponentProps<T> =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type ComponentEmit<T> =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export type ComponentProps<T> = T extends new () => {
|
|
2
|
+
$props: infer P;
|
|
3
|
+
} ? NonNullable<P> : T extends (props: infer P, ...args: any) => any ? P : Record<string, never>;
|
|
4
|
+
export type ComponentSlots<T> = T extends new () => {
|
|
5
|
+
$slots: infer S;
|
|
6
|
+
} ? NonNullable<S> : T extends (props: any, ctx: {
|
|
7
|
+
slots: infer S;
|
|
8
|
+
attrs: any;
|
|
9
|
+
emit: any;
|
|
10
|
+
}, ...args: any) => any ? NonNullable<S> : Record<string, never>;
|
|
11
|
+
export type ComponentEmit<T> = T extends new () => {
|
|
12
|
+
$emit: infer E;
|
|
13
|
+
} ? NonNullable<E> : T extends (props: any, ctx: {
|
|
14
|
+
slots: any;
|
|
15
|
+
attrs: any;
|
|
16
|
+
emit: infer E;
|
|
17
|
+
}, ...args: any) => any ? NonNullable<E> : Record<string, never>;
|
|
File without changes
|
|
@@ -1,38 +1,69 @@
|
|
|
1
|
-
import type { Ref } from 'vue'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { ZodSchema } from 'zod';
|
|
3
|
+
import type { Schema as JoiSchema } from 'joi';
|
|
4
|
+
import type { ObjectSchema as YupObjectSchema } from 'yup';
|
|
5
|
+
import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
|
|
6
|
+
import type { GetObjectField } from './utils.js';
|
|
7
|
+
export interface Form<T> {
|
|
8
|
+
validate(opts?: {
|
|
9
|
+
name: string | string[];
|
|
10
|
+
silent?: false;
|
|
11
|
+
nested?: boolean;
|
|
12
|
+
}): Promise<T | false>;
|
|
13
|
+
clear(path?: string): void;
|
|
14
|
+
errors: Ref<FormError[]>;
|
|
15
|
+
setErrors(errs: FormError[], path?: string): void;
|
|
16
|
+
getErrors(path?: string): FormError[];
|
|
17
|
+
submit(): Promise<void>;
|
|
18
|
+
disabled: ComputedRef<boolean>;
|
|
19
|
+
}
|
|
20
|
+
export type FormSchema<T extends Record<string, any>> = ZodSchema | YupObjectSchema<T> | ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any> | JoiSchema<T>;
|
|
21
|
+
export type FormInputEvents = 'input' | 'blur' | 'change';
|
|
22
|
+
export interface FormError<P extends string = string> {
|
|
23
|
+
name: P;
|
|
24
|
+
message: string;
|
|
6
25
|
}
|
|
7
|
-
|
|
8
26
|
export interface FormErrorWithId extends FormError {
|
|
9
|
-
|
|
27
|
+
id: string;
|
|
10
28
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
export type FormSubmitEvent<T> = SubmitEvent & {
|
|
30
|
+
data: T;
|
|
31
|
+
};
|
|
32
|
+
export type FormValidationError = {
|
|
33
|
+
errors: FormErrorWithId[];
|
|
34
|
+
childrens: FormValidationError[];
|
|
35
|
+
};
|
|
36
|
+
export type FormErrorEvent = SubmitEvent & FormValidationError;
|
|
37
|
+
export type FormEventType = FormInputEvents;
|
|
38
|
+
export type FormChildAttachEvent = {
|
|
39
|
+
type: 'attach';
|
|
40
|
+
formId: string | number;
|
|
41
|
+
validate: Form<any>['validate'];
|
|
42
|
+
};
|
|
43
|
+
export type FormChildDetachEvent = {
|
|
44
|
+
type: 'detach';
|
|
45
|
+
formId: string | number;
|
|
46
|
+
};
|
|
47
|
+
export type FormInputEvent = {
|
|
48
|
+
type: FormEventType;
|
|
49
|
+
name?: string;
|
|
50
|
+
};
|
|
51
|
+
export type FormEvent = FormInputEvent | FormChildAttachEvent | FormChildDetachEvent;
|
|
52
|
+
export interface FormInjectedOptions {
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
validateOnInputDelay?: number;
|
|
20
55
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type: FormEventType
|
|
29
|
-
path?: string
|
|
56
|
+
export interface FormFieldInjectedOptions<T> {
|
|
57
|
+
id: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
size?: GetObjectField<T, 'size'>;
|
|
60
|
+
error?: string | boolean;
|
|
61
|
+
eagerValidation?: boolean;
|
|
62
|
+
validateOnInputDelay?: number;
|
|
30
63
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
error: Ref<string | boolean | undefined>
|
|
37
|
-
eagerValidation: Ref<boolean>
|
|
64
|
+
export declare class FormValidationException extends Error {
|
|
65
|
+
formId: string | number;
|
|
66
|
+
errors: FormErrorWithId[];
|
|
67
|
+
childrens: FormValidationException[];
|
|
68
|
+
constructor(formId: string | number, errors: FormErrorWithId[], childErrors: FormValidationException[]);
|
|
38
69
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class FormValidationException extends Error {
|
|
2
|
+
formId;
|
|
3
|
+
errors;
|
|
4
|
+
childrens;
|
|
5
|
+
constructor(formId, errors, childErrors) {
|
|
6
|
+
super("Form validation exception");
|
|
7
|
+
this.formId = formId;
|
|
8
|
+
this.errors = errors;
|
|
9
|
+
this.childrens = childErrors;
|
|
10
|
+
Object.setPrototypeOf(this, FormValidationException.prototype);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
1
|
+
export * from '../components/Accordion.vue.js';
|
|
2
|
+
export * from '../components/Alert.vue.js';
|
|
3
|
+
export * from '../components/App.vue.js';
|
|
4
|
+
export * from '../components/Avatar.vue.js';
|
|
5
|
+
export * from '../components/AvatarGroup.vue.js';
|
|
6
|
+
export * from '../components/Badge.vue.js';
|
|
7
|
+
export * from '../components/Breadcrumb.vue.js';
|
|
8
|
+
export * from '../components/Button.vue.js';
|
|
9
|
+
export * from '../components/Card.vue.js';
|
|
10
|
+
export * from '../components/Checkbox.vue.js';
|
|
11
|
+
export * from '../components/Chip.vue.js';
|
|
12
|
+
export * from '../components/Collapsible.vue.js';
|
|
13
|
+
export * from '../components/CommandPalette.vue.js';
|
|
14
|
+
export * from '../components/Container.vue.js';
|
|
15
|
+
export * from '../components/ContextMenu.vue.js';
|
|
16
|
+
export * from '../components/Drawer.vue.js';
|
|
17
|
+
export * from '../components/DropdownMenu.vue.js';
|
|
18
|
+
export * from '../components/Form.vue.js';
|
|
19
|
+
export * from '../components/FormField.vue.js';
|
|
20
|
+
export * from '../components/Input.vue.js';
|
|
21
|
+
export * from '../components/InputMenu.vue.js';
|
|
22
|
+
export * from '../components/Kbd.vue.js';
|
|
23
|
+
export * from '../components/Link.vue.js';
|
|
24
|
+
export * from '../components/Modal.vue.js';
|
|
25
|
+
export * from '../components/NavigationMenu.vue.js';
|
|
26
|
+
export * from '../components/Pagination.vue.js';
|
|
27
|
+
export * from '../components/Popover.vue.js';
|
|
28
|
+
export * from '../components/Progress.vue.js';
|
|
29
|
+
export * from '../components/RadioGroup.vue.js';
|
|
30
|
+
export * from '../components/Select.vue.js';
|
|
31
|
+
export * from '../components/SelectMenu.vue.js';
|
|
32
|
+
export * from '../components/Separator.vue.js';
|
|
33
|
+
export * from '../components/Skeleton.vue.js';
|
|
34
|
+
export * from '../components/Slideover.vue.js';
|
|
35
|
+
export * from '../components/Slider.vue.js';
|
|
36
|
+
export * from '../components/Switch.vue.js';
|
|
37
|
+
export * from '../components/Tabs.vue.js';
|
|
38
|
+
export * from '../components/Textarea.vue.js';
|
|
39
|
+
export * from '../components/Toast.vue.js';
|
|
40
|
+
export * from '../components/Toaster.vue.js';
|
|
41
|
+
export * from '../components/Tooltip.vue.js';
|
|
13
42
|
export * from './form.js';
|
|
14
|
-
export * from './horizontal-navigation.js';
|
|
15
|
-
export * from './input.js';
|
|
16
|
-
export * from './kbd.js';
|
|
17
|
-
export * from './link.js';
|
|
18
|
-
export * from './meter.js';
|
|
19
|
-
export * from './modal.js';
|
|
20
|
-
export * from './slideover.js';
|
|
21
|
-
export * from './notification.js';
|
|
22
|
-
export * from './popper.js';
|
|
23
|
-
export * from './progress.js';
|
|
24
|
-
export * from './range.js';
|
|
25
|
-
export * from './select.js';
|
|
26
|
-
export * from './tabs.js';
|
|
27
|
-
export * from './textarea.js';
|
|
28
|
-
export * from './toggle.js';
|
|
29
|
-
export * from './tooltip.js';
|
|
30
|
-
export * from './vertical-navigation.js';
|
|
31
|
-
export * from './utils.js';
|