@nuxt/ui 3.0.0-alpha.1 → 3.0.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/.nuxt/ui/accordion.ts +20 -0
- package/.nuxt/ui/alert.ts +259 -0
- package/.nuxt/ui/avatar-group.ts +52 -0
- package/.nuxt/ui/avatar.ts +54 -0
- package/.nuxt/ui/badge.ts +231 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +29 -0
- package/.nuxt/ui/button.ts +376 -0
- package/.nuxt/ui/calendar.ts +103 -0
- package/.nuxt/ui/card.ts +8 -0
- package/.nuxt/ui/carousel.ts +43 -0
- package/.nuxt/ui/checkbox.ts +123 -0
- package/.nuxt/ui/chip.ts +96 -0
- package/.nuxt/ui/collapsible.ts +6 -0
- package/.nuxt/ui/color-picker.ts +47 -0
- package/.nuxt/ui/command-palette.ts +50 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/context-menu.ts +216 -0
- package/.nuxt/ui/drawer.ts +62 -0
- package/.nuxt/ui/dropdown-menu.ts +217 -0
- package/.nuxt/ui/form-field.ts +48 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +48 -0
- package/.nuxt/ui/input-menu.ts +445 -0
- package/.nuxt/ui/input-number.ts +235 -0
- package/.nuxt/ui/input.ts +298 -0
- package/.nuxt/ui/kbd.ts +31 -0
- package/.nuxt/ui/link.ts +15 -0
- package/.nuxt/ui/modal.ts +28 -0
- package/.nuxt/ui/navigation-menu.ts +436 -0
- package/.nuxt/ui/pagination.ts +8 -0
- package/.nuxt/ui/pin-input.ts +171 -0
- package/.nuxt/ui/popover.ts +6 -0
- package/.nuxt/ui/progress.ts +297 -0
- package/.nuxt/ui/radio-group.ts +135 -0
- package/.nuxt/ui/select-menu.ts +351 -0
- package/.nuxt/ui/select.ts +350 -0
- package/.nuxt/ui/separator.ts +172 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +70 -0
- package/.nuxt/ui/slider.ts +171 -0
- package/.nuxt/ui/stepper.ts +202 -0
- package/.nuxt/ui/switch.ts +131 -0
- package/.nuxt/ui/table.ts +146 -0
- package/.nuxt/ui/tabs.ts +255 -0
- package/.nuxt/ui/textarea.ts +298 -0
- package/.nuxt/ui/toast.ts +76 -0
- package/.nuxt/ui/toaster.ts +91 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/README.md +82 -54
- package/cli/commands/{init.mjs → make/component.mjs} +17 -5
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +2 -2
- package/cli/package.json +2 -2
- package/cli/templates.mjs +60 -10
- package/cli/utils.mjs +14 -0
- package/dist/chunks/component-meta.cjs +82802 -0
- package/dist/chunks/component-meta.mjs +82800 -0
- package/dist/client/devtools/200.html +1 -0
- package/dist/client/devtools/404.html +1 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
- package/dist/client/devtools/_nuxt/CQ-XZFu7.js +54 -0
- package/dist/client/devtools/_nuxt/DNZFyo26.js +1 -0
- package/dist/client/devtools/_nuxt/Dtz-o9GB.js +1 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
- package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +1 -0
- package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.CfcCHs91.css +1 -0
- package/dist/client/devtools/favicon.svg +1 -0
- package/dist/client/devtools/index.html +1 -0
- package/dist/devtools/runtime/DevtoolsRenderer.vue +54 -0
- package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
- package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
- package/dist/devtools/runtime/examples/CardExample.vue +13 -0
- package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
- package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
- package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
- package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
- package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
- package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
- package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/FormExample.vue +30 -0
- package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
- package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
- package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
- package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
- package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/StepperExample.vue +44 -0
- package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
- package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
- package/dist/module.cjs +223 -4
- package/dist/module.d.cts +54 -0
- package/dist/module.d.mts +38 -7
- package/dist/module.d.ts +38 -7
- package/dist/module.json +2 -1
- package/dist/module.mjs +179 -2568
- package/dist/runtime/components/Accordion.vue +51 -9
- package/dist/runtime/components/Alert.vue +16 -8
- package/dist/runtime/components/App.vue +20 -7
- package/dist/runtime/components/Avatar.vue +36 -11
- package/dist/runtime/components/AvatarGroup.vue +6 -2
- package/dist/runtime/components/Badge.vue +36 -5
- package/dist/runtime/components/Breadcrumb.vue +53 -14
- package/dist/runtime/components/Button.vue +47 -7
- package/dist/runtime/components/ButtonGroup.vue +7 -3
- package/dist/runtime/components/Calendar.vue +191 -0
- package/dist/runtime/components/Card.vue +5 -2
- package/dist/runtime/components/Carousel.vue +323 -0
- package/dist/runtime/components/Checkbox.vue +30 -34
- package/dist/runtime/components/Chip.vue +12 -4
- package/dist/runtime/components/Collapsible.vue +11 -6
- package/dist/runtime/components/ColorPicker.vue +266 -0
- package/dist/runtime/components/CommandPalette.vue +132 -99
- package/dist/runtime/components/Container.vue +5 -2
- package/dist/runtime/components/ContextMenu.vue +103 -15
- package/dist/runtime/components/ContextMenuContent.vue +49 -19
- package/dist/runtime/components/Drawer.vue +28 -12
- package/dist/runtime/components/DropdownMenu.vue +93 -17
- package/dist/runtime/components/DropdownMenuContent.vue +51 -19
- package/dist/runtime/components/Form.vue +59 -41
- package/dist/runtime/components/FormField.vue +20 -7
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +18 -8
- package/dist/runtime/components/InputMenu.vue +164 -66
- package/dist/runtime/components/InputNumber.vue +193 -0
- package/dist/runtime/components/Kbd.vue +5 -2
- package/dist/runtime/components/Link.vue +72 -9
- package/dist/runtime/components/LinkBase.vue +10 -7
- package/dist/runtime/components/Modal.vue +23 -16
- package/dist/runtime/components/NavigationMenu.vue +178 -78
- package/dist/runtime/components/Pagination.vue +32 -16
- package/dist/runtime/components/PinInput.vue +97 -0
- package/dist/runtime/components/Popover.vue +29 -9
- package/dist/runtime/components/Progress.vue +29 -11
- package/dist/runtime/components/RadioGroup.vue +30 -8
- package/dist/runtime/components/Select.vue +81 -33
- package/dist/runtime/components/SelectMenu.vue +181 -81
- package/dist/runtime/components/Separator.vue +5 -4
- package/dist/runtime/components/Skeleton.vue +5 -2
- package/dist/runtime/components/Slideover.vue +23 -15
- package/dist/runtime/components/Slider.vue +5 -4
- package/dist/runtime/components/Stepper.vue +173 -0
- package/dist/runtime/components/Switch.vue +18 -17
- package/dist/runtime/components/Table.vue +263 -0
- package/dist/runtime/components/Tabs.vue +45 -16
- package/dist/runtime/components/Textarea.vue +12 -5
- package/dist/runtime/components/Toast.vue +15 -6
- package/dist/runtime/components/Toaster.vue +33 -17
- package/dist/runtime/components/Tooltip.vue +10 -7
- package/dist/runtime/composables/defineLocale.d.ts +9 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +3 -9
- package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
- package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -0
- package/dist/runtime/composables/useFormField.d.ts +9 -5
- package/dist/runtime/composables/useFormField.js +8 -4
- package/dist/runtime/composables/useKbd.d.ts +10 -3
- package/dist/runtime/composables/useKbd.js +14 -8
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/composables/useModal.d.ts +2 -2
- package/dist/runtime/composables/useSlideover.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +2 -2
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/keyframes.css +1 -0
- package/dist/runtime/locale/ar.d.ts +2 -0
- package/dist/runtime/locale/ar.js +55 -0
- package/dist/runtime/locale/cs.d.ts +2 -0
- package/dist/runtime/locale/cs.js +54 -0
- package/dist/runtime/locale/da.d.ts +2 -0
- package/dist/runtime/locale/da.js +54 -0
- package/dist/runtime/locale/de.d.ts +2 -0
- package/dist/runtime/locale/de.js +54 -0
- package/dist/runtime/locale/el.d.ts +2 -0
- package/dist/runtime/locale/el.js +54 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +54 -0
- package/dist/runtime/locale/es.d.ts +2 -0
- package/dist/runtime/locale/es.js +54 -0
- package/dist/runtime/locale/et.d.ts +2 -0
- package/dist/runtime/locale/et.js +54 -0
- package/dist/runtime/locale/fa_ir.d.ts +2 -0
- package/dist/runtime/locale/fa_ir.js +55 -0
- package/dist/runtime/locale/fi.d.ts +2 -0
- package/dist/runtime/locale/fi.js +54 -0
- package/dist/runtime/locale/fr.d.ts +2 -0
- package/dist/runtime/locale/fr.js +54 -0
- package/dist/runtime/locale/id.d.ts +2 -0
- package/dist/runtime/locale/id.js +54 -0
- package/dist/runtime/locale/index.d.ts +28 -0
- package/dist/runtime/locale/index.js +28 -0
- package/dist/runtime/locale/it.d.ts +2 -0
- package/dist/runtime/locale/it.js +54 -0
- package/dist/runtime/locale/ja.d.ts +2 -0
- package/dist/runtime/locale/ja.js +54 -0
- package/dist/runtime/locale/ko.d.ts +2 -0
- package/dist/runtime/locale/ko.js +54 -0
- package/dist/runtime/locale/nl.d.ts +2 -0
- package/dist/runtime/locale/nl.js +54 -0
- package/dist/runtime/locale/pl.d.ts +2 -0
- package/dist/runtime/locale/pl.js +54 -0
- package/dist/runtime/locale/pt.d.ts +2 -0
- package/dist/runtime/locale/pt.js +54 -0
- package/dist/runtime/locale/pt_br.d.ts +2 -0
- package/dist/runtime/locale/pt_br.js +54 -0
- package/dist/runtime/locale/ru.d.ts +2 -0
- package/dist/runtime/locale/ru.js +54 -0
- package/dist/runtime/locale/sk.d.ts +2 -0
- package/dist/runtime/locale/sk.js +54 -0
- package/dist/runtime/locale/sv.d.ts +2 -0
- package/dist/runtime/locale/sv.js +54 -0
- package/dist/runtime/locale/th.d.ts +2 -0
- package/dist/runtime/locale/th.js +54 -0
- package/dist/runtime/locale/tr.d.ts +2 -0
- package/dist/runtime/locale/tr.js +54 -0
- package/dist/runtime/locale/uk.d.ts +2 -0
- package/dist/runtime/locale/uk.js +54 -0
- package/dist/runtime/locale/vi.d.ts +2 -0
- package/dist/runtime/locale/vi.js +54 -0
- package/dist/runtime/locale/zh_hans.d.ts +2 -0
- package/dist/runtime/locale/zh_hans.js +54 -0
- package/dist/runtime/locale/zh_hant.d.ts +2 -0
- package/dist/runtime/locale/zh_hant.js +54 -0
- package/dist/runtime/plugins/colors.js +12 -8
- package/dist/runtime/types/form.d.ts +11 -4
- package/dist/runtime/types/form.js +2 -2
- package/dist/runtime/types/index.d.ts +50 -42
- package/dist/runtime/types/index.js +8 -0
- package/dist/runtime/types/locale.d.ts +56 -0
- package/dist/runtime/types/utils.d.ts +8 -3
- package/dist/runtime/utils/form.d.ts +7 -5
- package/dist/runtime/utils/form.js +117 -28
- package/dist/runtime/utils/index.d.ts +2 -1
- package/dist/runtime/utils/index.js +16 -0
- package/dist/runtime/utils/link.d.ts +5 -3
- package/dist/runtime/utils/link.js +1 -1
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/components/Icon.vue +15 -0
- package/dist/runtime/vue/components/Link.vue +208 -0
- package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
- package/dist/runtime/vue/plugins/color-mode.js +6 -0
- package/dist/runtime/vue/plugins/head.d.ts +4 -0
- package/dist/runtime/vue/plugins/head.js +6 -0
- package/dist/runtime/vue/stubs.d.ts +15 -0
- package/dist/runtime/vue/stubs.js +27 -0
- package/dist/shared/ui.BKsd22-Q.mjs +3289 -0
- package/dist/shared/ui.DCjJwb6l.cjs +3296 -0
- package/dist/unplugin.cjs +192 -0
- package/dist/unplugin.d.cts +49 -0
- package/dist/unplugin.d.mts +49 -0
- package/dist/unplugin.d.ts +49 -0
- package/dist/unplugin.mjs +181 -0
- package/dist/vite.cjs +22 -0
- package/dist/vite.d.cts +13 -0
- package/dist/vite.d.mts +13 -0
- package/dist/vite.d.ts +13 -0
- package/dist/vite.mjs +20 -0
- package/package.json +107 -35
- package/vue-plugin.d.ts +5 -0
- package/cli/node_modules/.ignored/citty/LICENSE +0 -36
- package/cli/node_modules/.ignored/citty/README.md +0 -134
- package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
- package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
- package/cli/node_modules/.ignored/citty/package.json +0 -49
- package/cli/node_modules/.ignored/consola/LICENSE +0 -47
- package/cli/node_modules/.ignored/consola/README.md +0 -318
- package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
- package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
- package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
- package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
- package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
- package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
- package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
- package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
- package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
- package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
- package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
- package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
- package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
- package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
- package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
- package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
- package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
- package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
- package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
- package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
- package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
- package/cli/node_modules/.ignored/consola/package.json +0 -101
- package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
- package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
- package/cli/node_modules/.ignored/pathe/README.md +0 -69
- package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
- package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
- package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
- package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
- package/cli/node_modules/.ignored/pathe/package.json +0 -48
- package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
- package/cli/node_modules/.ignored/scule/LICENSE +0 -21
- package/cli/node_modules/.ignored/scule/README.md +0 -149
- package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
- package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
- package/cli/node_modules/.ignored/scule/package.json +0 -43
- package/cli/node_modules/.package-lock.json +0 -33
- package/dist/runtime/types/component.d.ts +0 -17
- /package/dist/runtime/types/{component.js → locale.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export class FormValidationException extends Error {
|
|
2
2
|
formId;
|
|
3
3
|
errors;
|
|
4
|
-
|
|
4
|
+
children;
|
|
5
5
|
constructor(formId, errors, childErrors) {
|
|
6
6
|
super("Form validation exception");
|
|
7
7
|
this.formId = formId;
|
|
8
8
|
this.errors = errors;
|
|
9
|
-
this.
|
|
9
|
+
this.children = childErrors;
|
|
10
10
|
Object.setPrototypeOf(this, FormValidationException.prototype);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,42 +1,50 @@
|
|
|
1
|
-
export * from '../components/Accordion.vue
|
|
2
|
-
export * from '../components/Alert.vue
|
|
3
|
-
export * from '../components/App.vue
|
|
4
|
-
export * from '../components/Avatar.vue
|
|
5
|
-
export * from '../components/AvatarGroup.vue
|
|
6
|
-
export * from '../components/Badge.vue
|
|
7
|
-
export * from '../components/Breadcrumb.vue
|
|
8
|
-
export * from '../components/Button.vue
|
|
9
|
-
export * from '../components/
|
|
10
|
-
export * from '../components/
|
|
11
|
-
export * from '../components/
|
|
12
|
-
export * from '../components/
|
|
13
|
-
export * from '../components/
|
|
14
|
-
export * from '../components/
|
|
15
|
-
export * from '../components/
|
|
16
|
-
export * from '../components/
|
|
17
|
-
export * from '../components/
|
|
18
|
-
export * from '../components/
|
|
19
|
-
export * from '../components/
|
|
20
|
-
export * from '../components/
|
|
21
|
-
export * from '../components/
|
|
22
|
-
export * from '../components/
|
|
23
|
-
export * from '../components/
|
|
24
|
-
export * from '../components/
|
|
25
|
-
export * from '../components/
|
|
26
|
-
export * from '../components/
|
|
27
|
-
export * from '../components/
|
|
28
|
-
export * from '../components/
|
|
29
|
-
export * from '../components/
|
|
30
|
-
export * from '../components/
|
|
31
|
-
export * from '../components/
|
|
32
|
-
export * from '../components/
|
|
33
|
-
export * from '../components/
|
|
34
|
-
export * from '../components/
|
|
35
|
-
export * from '../components/
|
|
36
|
-
export * from '../components/
|
|
37
|
-
export * from '../components/
|
|
38
|
-
export * from '../components/
|
|
39
|
-
export * from '../components/
|
|
40
|
-
export * from '../components/
|
|
41
|
-
export * from '../components/
|
|
42
|
-
export * from '
|
|
1
|
+
export * from '../components/Accordion.vue';
|
|
2
|
+
export * from '../components/Alert.vue';
|
|
3
|
+
export * from '../components/App.vue';
|
|
4
|
+
export * from '../components/Avatar.vue';
|
|
5
|
+
export * from '../components/AvatarGroup.vue';
|
|
6
|
+
export * from '../components/Badge.vue';
|
|
7
|
+
export * from '../components/Breadcrumb.vue';
|
|
8
|
+
export * from '../components/Button.vue';
|
|
9
|
+
export * from '../components/Calendar.vue';
|
|
10
|
+
export * from '../components/Card.vue';
|
|
11
|
+
export * from '../components/Carousel.vue';
|
|
12
|
+
export * from '../components/Checkbox.vue';
|
|
13
|
+
export * from '../components/Chip.vue';
|
|
14
|
+
export * from '../components/Collapsible.vue';
|
|
15
|
+
export * from '../components/ColorPicker.vue';
|
|
16
|
+
export * from '../components/CommandPalette.vue';
|
|
17
|
+
export * from '../components/Container.vue';
|
|
18
|
+
export * from '../components/ContextMenu.vue';
|
|
19
|
+
export * from '../components/Drawer.vue';
|
|
20
|
+
export * from '../components/DropdownMenu.vue';
|
|
21
|
+
export * from '../components/Form.vue';
|
|
22
|
+
export * from '../components/FormField.vue';
|
|
23
|
+
export * from '../components/Input.vue';
|
|
24
|
+
export * from '../components/InputMenu.vue';
|
|
25
|
+
export * from '../components/InputNumber.vue';
|
|
26
|
+
export * from '../components/Kbd.vue';
|
|
27
|
+
export * from '../components/Link.vue';
|
|
28
|
+
export * from '../components/Modal.vue';
|
|
29
|
+
export * from '../components/NavigationMenu.vue';
|
|
30
|
+
export * from '../components/Pagination.vue';
|
|
31
|
+
export * from '../components/PinInput.vue';
|
|
32
|
+
export * from '../components/Popover.vue';
|
|
33
|
+
export * from '../components/Progress.vue';
|
|
34
|
+
export * from '../components/RadioGroup.vue';
|
|
35
|
+
export * from '../components/Select.vue';
|
|
36
|
+
export * from '../components/SelectMenu.vue';
|
|
37
|
+
export * from '../components/Separator.vue';
|
|
38
|
+
export * from '../components/Skeleton.vue';
|
|
39
|
+
export * from '../components/Slideover.vue';
|
|
40
|
+
export * from '../components/Slider.vue';
|
|
41
|
+
export * from '../components/Stepper.vue';
|
|
42
|
+
export * from '../components/Switch.vue';
|
|
43
|
+
export * from '../components/Table.vue';
|
|
44
|
+
export * from '../components/Tabs.vue';
|
|
45
|
+
export * from '../components/Textarea.vue';
|
|
46
|
+
export * from '../components/Toast.vue';
|
|
47
|
+
export * from '../components/Toaster.vue';
|
|
48
|
+
export * from '../components/Tooltip.vue';
|
|
49
|
+
export * from './form';
|
|
50
|
+
export * from './locale';
|
|
@@ -6,10 +6,13 @@ export * from "../components/AvatarGroup.vue";
|
|
|
6
6
|
export * from "../components/Badge.vue";
|
|
7
7
|
export * from "../components/Breadcrumb.vue";
|
|
8
8
|
export * from "../components/Button.vue";
|
|
9
|
+
export * from "../components/Calendar.vue";
|
|
9
10
|
export * from "../components/Card.vue";
|
|
11
|
+
export * from "../components/Carousel.vue";
|
|
10
12
|
export * from "../components/Checkbox.vue";
|
|
11
13
|
export * from "../components/Chip.vue";
|
|
12
14
|
export * from "../components/Collapsible.vue";
|
|
15
|
+
export * from "../components/ColorPicker.vue";
|
|
13
16
|
export * from "../components/CommandPalette.vue";
|
|
14
17
|
export * from "../components/Container.vue";
|
|
15
18
|
export * from "../components/ContextMenu.vue";
|
|
@@ -19,11 +22,13 @@ export * from "../components/Form.vue";
|
|
|
19
22
|
export * from "../components/FormField.vue";
|
|
20
23
|
export * from "../components/Input.vue";
|
|
21
24
|
export * from "../components/InputMenu.vue";
|
|
25
|
+
export * from "../components/InputNumber.vue";
|
|
22
26
|
export * from "../components/Kbd.vue";
|
|
23
27
|
export * from "../components/Link.vue";
|
|
24
28
|
export * from "../components/Modal.vue";
|
|
25
29
|
export * from "../components/NavigationMenu.vue";
|
|
26
30
|
export * from "../components/Pagination.vue";
|
|
31
|
+
export * from "../components/PinInput.vue";
|
|
27
32
|
export * from "../components/Popover.vue";
|
|
28
33
|
export * from "../components/Progress.vue";
|
|
29
34
|
export * from "../components/RadioGroup.vue";
|
|
@@ -33,10 +38,13 @@ export * from "../components/Separator.vue";
|
|
|
33
38
|
export * from "../components/Skeleton.vue";
|
|
34
39
|
export * from "../components/Slideover.vue";
|
|
35
40
|
export * from "../components/Slider.vue";
|
|
41
|
+
export * from "../components/Stepper.vue";
|
|
36
42
|
export * from "../components/Switch.vue";
|
|
43
|
+
export * from "../components/Table.vue";
|
|
37
44
|
export * from "../components/Tabs.vue";
|
|
38
45
|
export * from "../components/Textarea.vue";
|
|
39
46
|
export * from "../components/Toast.vue";
|
|
40
47
|
export * from "../components/Toaster.vue";
|
|
41
48
|
export * from "../components/Tooltip.vue";
|
|
42
49
|
export * from "./form.js";
|
|
50
|
+
export * from "./locale.js";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type Messages = {
|
|
2
|
+
inputMenu: {
|
|
3
|
+
noMatch: string;
|
|
4
|
+
noData: string;
|
|
5
|
+
create: string;
|
|
6
|
+
};
|
|
7
|
+
calendar: {
|
|
8
|
+
prevYear: string;
|
|
9
|
+
nextYear: string;
|
|
10
|
+
prevMonth: string;
|
|
11
|
+
nextMonth: string;
|
|
12
|
+
};
|
|
13
|
+
inputNumber: {
|
|
14
|
+
increment: string;
|
|
15
|
+
decrement: string;
|
|
16
|
+
};
|
|
17
|
+
commandPalette: {
|
|
18
|
+
placeholder: string;
|
|
19
|
+
noMatch: string;
|
|
20
|
+
noData: string;
|
|
21
|
+
close: string;
|
|
22
|
+
};
|
|
23
|
+
selectMenu: {
|
|
24
|
+
noMatch: string;
|
|
25
|
+
noData: string;
|
|
26
|
+
create: string;
|
|
27
|
+
search: string;
|
|
28
|
+
};
|
|
29
|
+
toast: {
|
|
30
|
+
close: string;
|
|
31
|
+
};
|
|
32
|
+
carousel: {
|
|
33
|
+
prev: string;
|
|
34
|
+
next: string;
|
|
35
|
+
goto: string;
|
|
36
|
+
};
|
|
37
|
+
modal: {
|
|
38
|
+
close: string;
|
|
39
|
+
};
|
|
40
|
+
slideover: {
|
|
41
|
+
close: string;
|
|
42
|
+
};
|
|
43
|
+
alert: {
|
|
44
|
+
close: string;
|
|
45
|
+
};
|
|
46
|
+
table: {
|
|
47
|
+
noData: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export type Direction = 'ltr' | 'rtl';
|
|
51
|
+
export type Locale = {
|
|
52
|
+
name: string;
|
|
53
|
+
code: string;
|
|
54
|
+
dir: Direction;
|
|
55
|
+
messages: Messages;
|
|
56
|
+
};
|
|
@@ -2,7 +2,7 @@ export interface TightMap<O = any> {
|
|
|
2
2
|
[key: string]: TightMap | O;
|
|
3
3
|
}
|
|
4
4
|
export type DeepPartial<T, O = any> = {
|
|
5
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P], O> : T[P];
|
|
5
|
+
[P in keyof T]?: T[P] extends Array<string> ? string : T[P] extends object ? DeepPartial<T[P], O> : T[P];
|
|
6
6
|
} & {
|
|
7
7
|
[key: string]: O | TightMap<O>;
|
|
8
8
|
};
|
|
@@ -10,8 +10,13 @@ export type DynamicSlots<T extends {
|
|
|
10
10
|
slot?: string;
|
|
11
11
|
}, SlotProps, Slot = T['slot']> = Record<string, SlotProps> & (Slot extends string ? Record<Slot, SlotProps> : Record<string, never>);
|
|
12
12
|
export type GetObjectField<MaybeObject, Key extends string> = MaybeObject extends Record<string, any> ? MaybeObject[Key] : never;
|
|
13
|
-
export type AcceptableValue = string | number | boolean | Record<string, any>;
|
|
14
|
-
export type ArrayOrWrapped<T> = T extends any[] ? T : Array<T>;
|
|
15
13
|
export type PartialString<T> = {
|
|
16
14
|
[K in keyof T]?: string;
|
|
17
15
|
};
|
|
16
|
+
export type MaybeArrayOfArray<T> = T[] | T[][];
|
|
17
|
+
export type MaybeArrayOfArrayItem<I> = I extends Array<infer T> ? T extends Array<infer U> ? U : T : never;
|
|
18
|
+
export type SelectModelValue<T, V, M extends boolean = false, DV = T> = (T extends Record<string, any> ? V extends keyof T ? T[V] : DV : T) extends infer U ? M extends true ? U[] : U : never;
|
|
19
|
+
export type SelectItemKey<T> = T extends Record<string, any> ? keyof T : string;
|
|
20
|
+
export type SelectModelValueEmits<T, V, M extends boolean = false, DV = T> = {
|
|
21
|
+
'update:modelValue': [payload: SelectModelValue<T, V, M, DV>];
|
|
22
|
+
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import type { ZodSchema } from 'zod';
|
|
2
3
|
import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi';
|
|
3
4
|
import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup';
|
|
4
5
|
import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
|
|
5
|
-
import type {
|
|
6
|
+
import type { Struct } from 'superstruct';
|
|
7
|
+
import type { FormSchema, ValidateReturnSchema } from '../types/form';
|
|
6
8
|
export declare function isYupSchema(schema: any): schema is YupObjectSchema<any>;
|
|
7
9
|
export declare function isYupError(error: any): error is YupError;
|
|
8
|
-
export declare function
|
|
10
|
+
export declare function isSuperStructSchema(schema: any): schema is Struct<any, any>;
|
|
9
11
|
export declare function isZodSchema(schema: any): schema is ZodSchema;
|
|
10
|
-
export declare function getZodErrors(state: any, schema: ZodSchema): Promise<FormError[]>;
|
|
11
12
|
export declare function isJoiSchema(schema: any): schema is JoiSchema;
|
|
12
13
|
export declare function isJoiError(error: any): error is JoiError;
|
|
13
|
-
export declare function getJoiErrors(state: any, schema: JoiSchema): Promise<FormError[]>;
|
|
14
14
|
export declare function isValibotSchema(schema: any): schema is ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any>;
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function isStandardSchema(schema: any): schema is StandardSchemaV1;
|
|
16
|
+
export declare function validateStandardSchema(state: any, schema: StandardSchemaV1): Promise<ValidateReturnSchema<typeof state>>;
|
|
17
|
+
export declare function validateSchema<T extends object>(state: T, schema: FormSchema<T>): Promise<ValidateReturnSchema<typeof state>>;
|
|
@@ -4,63 +4,152 @@ export function isYupSchema(schema) {
|
|
|
4
4
|
export function isYupError(error) {
|
|
5
5
|
return error.inner !== void 0;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export function isSuperStructSchema(schema) {
|
|
8
|
+
return "schema" in schema && typeof schema.coercer === "function" && typeof schema.validator === "function" && typeof schema.refiner === "function";
|
|
9
|
+
}
|
|
10
|
+
export function isZodSchema(schema) {
|
|
11
|
+
return schema.parse !== void 0;
|
|
12
|
+
}
|
|
13
|
+
export function isJoiSchema(schema) {
|
|
14
|
+
return schema.validateAsync !== void 0 && schema.id !== void 0;
|
|
15
|
+
}
|
|
16
|
+
export function isJoiError(error) {
|
|
17
|
+
return error.isJoi === true;
|
|
18
|
+
}
|
|
19
|
+
export function isValibotSchema(schema) {
|
|
20
|
+
return "_run" in schema || typeof schema === "function" && "schema" in schema;
|
|
21
|
+
}
|
|
22
|
+
export function isStandardSchema(schema) {
|
|
23
|
+
return "~standard" in schema;
|
|
24
|
+
}
|
|
25
|
+
export async function validateStandardSchema(state, schema) {
|
|
26
|
+
const result = await schema["~standard"].validate({
|
|
27
|
+
value: state
|
|
28
|
+
});
|
|
29
|
+
if (result.issues) {
|
|
30
|
+
return {
|
|
31
|
+
errors: result.issues?.map((issue) => ({
|
|
32
|
+
name: issue.path?.map((item) => typeof item === "object" ? item.key : item).join(".") || "",
|
|
33
|
+
message: issue.message
|
|
34
|
+
})) || [],
|
|
35
|
+
result: null
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
errors: null,
|
|
40
|
+
result: result.value
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function validateYupSchema(state, schema) {
|
|
8
44
|
try {
|
|
9
|
-
await schema.validate(state, { abortEarly: false });
|
|
10
|
-
return
|
|
45
|
+
const result = await schema.validate(state, { abortEarly: false });
|
|
46
|
+
return {
|
|
47
|
+
errors: null,
|
|
48
|
+
result
|
|
49
|
+
};
|
|
11
50
|
} catch (error) {
|
|
12
51
|
if (isYupError(error)) {
|
|
13
|
-
|
|
52
|
+
const errors = error.inner.map((issue) => ({
|
|
14
53
|
name: issue.path ?? "",
|
|
15
54
|
message: issue.message
|
|
16
55
|
}));
|
|
56
|
+
return {
|
|
57
|
+
errors,
|
|
58
|
+
result: null
|
|
59
|
+
};
|
|
17
60
|
} else {
|
|
18
61
|
throw error;
|
|
19
62
|
}
|
|
20
63
|
}
|
|
21
64
|
}
|
|
22
|
-
|
|
23
|
-
|
|
65
|
+
async function validateSuperstructSchema(state, schema) {
|
|
66
|
+
const [err, result] = schema.validate(state);
|
|
67
|
+
if (err) {
|
|
68
|
+
const errors = err.failures().map((error) => ({
|
|
69
|
+
message: error.message,
|
|
70
|
+
name: error.path.join(".")
|
|
71
|
+
}));
|
|
72
|
+
return {
|
|
73
|
+
errors,
|
|
74
|
+
result: null
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
errors: null,
|
|
79
|
+
result
|
|
80
|
+
};
|
|
24
81
|
}
|
|
25
|
-
|
|
82
|
+
async function validateZodSchema(state, schema) {
|
|
26
83
|
const result = await schema.safeParseAsync(state);
|
|
27
84
|
if (result.success === false) {
|
|
28
|
-
|
|
85
|
+
const errors = result.error.issues.map((issue) => ({
|
|
29
86
|
name: issue.path.join("."),
|
|
30
87
|
message: issue.message
|
|
31
88
|
}));
|
|
89
|
+
return {
|
|
90
|
+
errors,
|
|
91
|
+
result: null
|
|
92
|
+
};
|
|
32
93
|
}
|
|
33
|
-
return
|
|
94
|
+
return {
|
|
95
|
+
result: result.data,
|
|
96
|
+
errors: null
|
|
97
|
+
};
|
|
34
98
|
}
|
|
35
|
-
|
|
36
|
-
return schema.validateAsync !== void 0 && schema.id !== void 0;
|
|
37
|
-
}
|
|
38
|
-
export function isJoiError(error) {
|
|
39
|
-
return error.isJoi === true;
|
|
40
|
-
}
|
|
41
|
-
export async function getJoiErrors(state, schema) {
|
|
99
|
+
async function validateJoiSchema(state, schema) {
|
|
42
100
|
try {
|
|
43
|
-
await schema.validateAsync(state, { abortEarly: false });
|
|
44
|
-
return
|
|
101
|
+
const result = await schema.validateAsync(state, { abortEarly: false });
|
|
102
|
+
return {
|
|
103
|
+
errors: null,
|
|
104
|
+
result
|
|
105
|
+
};
|
|
45
106
|
} catch (error) {
|
|
46
107
|
if (isJoiError(error)) {
|
|
47
|
-
|
|
48
|
-
name:
|
|
49
|
-
message:
|
|
108
|
+
const errors = error.details.map((issue) => ({
|
|
109
|
+
name: issue.path.join("."),
|
|
110
|
+
message: issue.message
|
|
50
111
|
}));
|
|
112
|
+
return {
|
|
113
|
+
errors,
|
|
114
|
+
result: null
|
|
115
|
+
};
|
|
51
116
|
} else {
|
|
52
117
|
throw error;
|
|
53
118
|
}
|
|
54
119
|
}
|
|
55
120
|
}
|
|
56
|
-
|
|
57
|
-
return "_run" in schema || typeof schema === "function" && "schema" in schema;
|
|
58
|
-
}
|
|
59
|
-
export async function getValibotError(state, schema) {
|
|
121
|
+
async function validateValibotSchema(state, schema) {
|
|
60
122
|
const result = await ("_run" in schema ? schema._run({ typed: false, value: state }, {}) : schema(state));
|
|
61
|
-
|
|
62
|
-
|
|
123
|
+
if (!result.issues || result.issues.length === 0) {
|
|
124
|
+
const output = "output" in result ? result.output : "value" in result ? result.value : null;
|
|
125
|
+
return {
|
|
126
|
+
errors: null,
|
|
127
|
+
result: output
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const errors = result.issues.map((issue) => ({
|
|
63
131
|
name: issue.path?.map((item) => item.key).join(".") || "",
|
|
64
132
|
message: issue.message
|
|
65
|
-
}))
|
|
133
|
+
}));
|
|
134
|
+
return {
|
|
135
|
+
errors,
|
|
136
|
+
result: null
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function validateSchema(state, schema) {
|
|
140
|
+
if (isZodSchema(schema)) {
|
|
141
|
+
return validateZodSchema(state, schema);
|
|
142
|
+
} else if (isJoiSchema(schema)) {
|
|
143
|
+
return validateJoiSchema(state, schema);
|
|
144
|
+
} else if (isValibotSchema(schema)) {
|
|
145
|
+
return validateValibotSchema(state, schema);
|
|
146
|
+
} else if (isYupSchema(schema)) {
|
|
147
|
+
return validateYupSchema(state, schema);
|
|
148
|
+
} else if (isSuperStructSchema(schema)) {
|
|
149
|
+
return validateSuperstructSchema(state, schema);
|
|
150
|
+
} else if (isStandardSchema(schema)) {
|
|
151
|
+
return validateStandardSchema(state, schema);
|
|
152
|
+
} else {
|
|
153
|
+
throw new Error("Form validation failed: Unsupported form schema");
|
|
154
|
+
}
|
|
66
155
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
|
|
2
2
|
export declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
|
|
3
|
-
export declare function get(object: Record<string, any
|
|
3
|
+
export declare function get(object: Record<string, any> | undefined, path: (string | number)[] | string, defaultValue?: any): any;
|
|
4
4
|
export declare function set(object: Record<string, any>, path: (string | number)[] | string, value: any): void;
|
|
5
5
|
export declare function looseToNumber(val: any): any;
|
|
6
|
+
export declare function compare<T>(value?: T, currentValue?: T, comparator?: string | ((a: T, b: T) => boolean)): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEqual } from "ohash";
|
|
1
2
|
export function pick(data, keys) {
|
|
2
3
|
const result = {};
|
|
3
4
|
for (const key of keys) {
|
|
@@ -45,3 +46,18 @@ export function looseToNumber(val) {
|
|
|
45
46
|
const n = Number.parseFloat(val);
|
|
46
47
|
return Number.isNaN(n) ? val : n;
|
|
47
48
|
}
|
|
49
|
+
export function compare(value, currentValue, comparator) {
|
|
50
|
+
if (value === void 0 || currentValue === void 0) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value === "string") {
|
|
54
|
+
return value === currentValue;
|
|
55
|
+
}
|
|
56
|
+
if (typeof comparator === "function") {
|
|
57
|
+
return comparator(value, currentValue);
|
|
58
|
+
}
|
|
59
|
+
if (typeof comparator === "string") {
|
|
60
|
+
return get(value, comparator) === get(currentValue, comparator);
|
|
61
|
+
}
|
|
62
|
+
return isEqual(value, currentValue);
|
|
63
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { LinkProps } from '../types
|
|
1
|
+
import type { LinkProps } from '../types';
|
|
2
2
|
export declare function pickLinkProps(link: LinkProps & {
|
|
3
3
|
ariaLabel?: string;
|
|
4
|
+
title?: string;
|
|
4
5
|
}): {
|
|
6
|
+
replace: any;
|
|
5
7
|
type: any;
|
|
8
|
+
title: any;
|
|
9
|
+
exact: any;
|
|
6
10
|
active: any;
|
|
7
11
|
activeClass: any;
|
|
8
12
|
ariaCurrentValue: any;
|
|
9
13
|
ariaLabel: any;
|
|
10
14
|
as: any;
|
|
11
15
|
disabled: any;
|
|
12
|
-
exact: any;
|
|
13
16
|
exactActiveClass: any;
|
|
14
17
|
exactHash: any;
|
|
15
18
|
exactQuery: any;
|
|
@@ -21,7 +24,6 @@ export declare function pickLinkProps(link: LinkProps & {
|
|
|
21
24
|
prefetch: any;
|
|
22
25
|
prefetchedClass: any;
|
|
23
26
|
rel: any;
|
|
24
|
-
replace: any;
|
|
25
27
|
target: any;
|
|
26
28
|
to: any;
|
|
27
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { reactivePick } from "@vueuse/core";
|
|
2
2
|
export function pickLinkProps(link) {
|
|
3
|
-
return reactivePick(link, "active", "activeClass", "ariaCurrentValue", "ariaLabel", "as", "disabled", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "href", "inactiveClass", "noPrefetch", "noRel", "prefetch", "prefetchedClass", "rel", "replace", "target", "to", "type");
|
|
3
|
+
return reactivePick(link, "active", "activeClass", "ariaCurrentValue", "ariaLabel", "as", "disabled", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "href", "inactiveClass", "noPrefetch", "noRel", "prefetch", "prefetchedClass", "rel", "replace", "target", "to", "type", "title");
|
|
4
4
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { Locale, Direction } from '../types/locale';
|
|
3
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
4
|
+
export type TranslatorOption = Record<string, string | number>;
|
|
5
|
+
export type Translator = (path: string, option?: TranslatorOption) => string;
|
|
6
|
+
export type LocaleContext = {
|
|
7
|
+
locale: Ref<Locale>;
|
|
8
|
+
lang: Ref<string>;
|
|
9
|
+
dir: Ref<Direction>;
|
|
10
|
+
code: Ref<string>;
|
|
11
|
+
t: Translator;
|
|
12
|
+
};
|
|
13
|
+
export declare function buildTranslator(locale: MaybeRef<Locale>): Translator;
|
|
14
|
+
export declare function translate(path: string, option: undefined | TranslatorOption, locale: Locale): string;
|
|
15
|
+
export declare function buildLocaleContext(locale: MaybeRef<Locale>): LocaleContext;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed, isRef, ref, unref } from "vue";
|
|
2
|
+
import { get } from "./index.js";
|
|
3
|
+
export function buildTranslator(locale) {
|
|
4
|
+
return (path, option) => translate(path, option, unref(locale));
|
|
5
|
+
}
|
|
6
|
+
export function translate(path, option, locale) {
|
|
7
|
+
const prop = get(locale, `messages.${path}`, path);
|
|
8
|
+
return prop.replace(
|
|
9
|
+
/\{(\w+)\}/g,
|
|
10
|
+
(_, key) => `${option?.[key] ?? `{${key}}`}`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export function buildLocaleContext(locale) {
|
|
14
|
+
const lang = computed(() => unref(locale).name);
|
|
15
|
+
const code = computed(() => unref(locale).code);
|
|
16
|
+
const dir = computed(() => unref(locale).dir);
|
|
17
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
18
|
+
return {
|
|
19
|
+
lang,
|
|
20
|
+
code,
|
|
21
|
+
dir,
|
|
22
|
+
locale: localeRef,
|
|
23
|
+
t: buildTranslator(locale)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").CreateTV<boolean | (string | number | symbol)[] | {} | undefined>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export interface IconProps {
|
|
3
|
+
name: string
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { Icon as IconifyIcon } from '@iconify/vue'
|
|
9
|
+
|
|
10
|
+
defineProps<IconProps>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<IconifyIcon :icon="name.replace(/^i-/, '')" />
|
|
15
|
+
</template>
|