@nuxt/ui 4.10.0 → 4.11.1
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.static.css +11 -11
- package/README.md +1 -0
- package/cli/commands/make/locale.mjs +40 -11
- package/cli/templates.mjs +2 -2
- package/dist/module.d.mts +1 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +5 -2
- package/dist/runtime/components/AuthForm.d.vue.ts +7 -7
- package/dist/runtime/components/AuthForm.vue.d.ts +7 -7
- package/dist/runtime/components/Button.vue +11 -2
- package/dist/runtime/components/Carousel.d.vue.ts +6 -6
- package/dist/runtime/components/Carousel.vue.d.ts +6 -6
- package/dist/runtime/components/ChatMessages.d.vue.ts +2 -2
- package/dist/runtime/components/ChatMessages.vue.d.ts +2 -2
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +2 -2
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +2 -2
- package/dist/runtime/components/Checkbox.d.vue.ts +1 -1
- package/dist/runtime/components/Checkbox.vue +12 -6
- package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +6 -0
- package/dist/runtime/components/CheckboxGroup.vue +10 -4
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +6 -0
- package/dist/runtime/components/Editor.vue +4 -1
- package/dist/runtime/components/Error.d.vue.ts +1 -1
- package/dist/runtime/components/Error.vue.d.ts +1 -1
- package/dist/runtime/components/FileUpload.vue +17 -10
- package/dist/runtime/components/Form.vue +1 -1
- package/dist/runtime/components/Input.vue +12 -7
- package/dist/runtime/components/InputDate.vue +12 -8
- package/dist/runtime/components/InputMenu.vue +25 -11
- package/dist/runtime/components/InputNumber.vue +22 -14
- package/dist/runtime/components/InputRating.vue +10 -7
- package/dist/runtime/components/InputTags.vue +12 -7
- package/dist/runtime/components/InputTime.vue +12 -7
- package/dist/runtime/components/Link.vue +61 -7
- package/dist/runtime/components/Listbox.vue +10 -6
- package/dist/runtime/components/Modal.vue +12 -5
- package/dist/runtime/components/NavigationMenu.vue +10 -10
- package/dist/runtime/components/PinInput.vue +13 -8
- package/dist/runtime/components/Popover.vue +0 -1
- package/dist/runtime/components/PricingTable.d.vue.ts +1 -1
- package/dist/runtime/components/PricingTable.vue.d.ts +1 -1
- package/dist/runtime/components/Progress.d.vue.ts +2 -1
- package/dist/runtime/components/Progress.vue +5 -6
- package/dist/runtime/components/Progress.vue.d.ts +2 -1
- package/dist/runtime/components/ProgressGroup.d.vue.ts +91 -0
- package/dist/runtime/components/ProgressGroup.vue +99 -0
- package/dist/runtime/components/ProgressGroup.vue.d.ts +91 -0
- package/dist/runtime/components/RadioGroup.d.vue.ts +7 -1
- package/dist/runtime/components/RadioGroup.vue +14 -5
- package/dist/runtime/components/RadioGroup.vue.d.ts +7 -1
- package/dist/runtime/components/Select.d.vue.ts +2 -0
- package/dist/runtime/components/Select.vue +23 -8
- package/dist/runtime/components/Select.vue.d.ts +2 -0
- package/dist/runtime/components/SelectMenu.d.vue.ts +3 -0
- package/dist/runtime/components/SelectMenu.vue +35 -14
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -0
- package/dist/runtime/components/Slider.vue +15 -8
- package/dist/runtime/components/Splitter.d.vue.ts +266 -0
- package/dist/runtime/components/Splitter.vue +99 -0
- package/dist/runtime/components/Splitter.vue.d.ts +266 -0
- package/dist/runtime/components/Switch.vue +8 -4
- package/dist/runtime/components/Table.vue +5 -5
- package/dist/runtime/components/Textarea.vue +17 -7
- package/dist/runtime/components/Theme.d.vue.ts +1 -1
- package/dist/runtime/components/Theme.vue +4 -3
- package/dist/runtime/components/Theme.vue.d.ts +1 -1
- package/dist/runtime/components/Tree.vue +1 -1
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +1 -0
- package/dist/runtime/components/content/ContentNavigation.vue +8 -1
- package/dist/runtime/components/content/ContentToc.vue +4 -1
- package/dist/runtime/components/locale/LocaleSelect.vue +1 -0
- package/dist/runtime/components/prose/CodeTree.vue +31 -18
- package/dist/runtime/composables/useComponentProps.d.ts +1 -1
- package/dist/runtime/composables/useComponentProps.js +6 -0
- package/dist/runtime/composables/useFormField.d.ts +10 -4
- package/dist/runtime/composables/useFormField.js +10 -3
- package/dist/runtime/keyframes.css +1 -1
- package/dist/runtime/locale/da.js +1 -1
- package/dist/runtime/locale/de_at.js +7 -0
- package/dist/runtime/locale/de_ch.js +1 -1
- package/dist/runtime/locale/eu.js +1 -1
- package/dist/runtime/locale/fi.js +1 -1
- package/dist/runtime/locale/he.js +1 -1
- package/dist/runtime/locale/hi.js +1 -1
- package/dist/runtime/locale/index.d.ts +2 -1
- package/dist/runtime/locale/index.js +2 -1
- package/dist/runtime/locale/is.js +1 -1
- package/dist/runtime/locale/lb.js +1 -1
- package/dist/runtime/locale/tg.d.ts +3 -0
- package/dist/runtime/locale/{tj.js → tg.js} +1 -1
- package/dist/runtime/locale/ur.js +1 -1
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/html.d.ts +3 -1
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/theme.d.ts +2 -0
- package/dist/runtime/types/tv.d.ts +6 -2
- package/dist/runtime/utils/form.d.ts +1 -1
- package/dist/runtime/utils/form.js +3 -1
- package/dist/runtime/utils/link-keys.d.ts +1 -0
- package/dist/runtime/utils/link-keys.js +40 -0
- package/dist/runtime/utils/link.d.ts +2 -1
- package/dist/runtime/utils/link.js +2 -40
- package/dist/runtime/utils/prefetch.d.ts +5 -0
- package/dist/runtime/utils/prefetch.js +45 -0
- package/dist/runtime/utils/search.js +11 -18
- package/dist/runtime/utils/tv.d.ts +1 -1
- package/dist/runtime/utils/tv.js +103 -25
- package/dist/runtime/vue/components/Icon.vue +5 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +1 -0
- package/dist/shared/{ui.XkBrgXFP.mjs → ui.DCJ9twx8.mjs} +597 -220
- package/dist/unplugin.d.mts +1 -1
- package/dist/unplugin.mjs +22 -6
- package/dist/vite.mjs +4 -4
- package/package.json +54 -53
- /package/dist/runtime/locale/{tj.d.ts → de_at.d.ts} +0 -0
package/.nuxt/ui.static.css
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
@theme static {
|
|
2
|
-
--color-old-neutral-50: oklch(98.5% 0
|
|
3
|
-
--color-old-neutral-100: oklch(97% 0
|
|
4
|
-
--color-old-neutral-200: oklch(92.2% 0
|
|
5
|
-
--color-old-neutral-300: oklch(87% 0
|
|
6
|
-
--color-old-neutral-400: oklch(70.8% 0
|
|
7
|
-
--color-old-neutral-500: oklch(55.6% 0
|
|
8
|
-
--color-old-neutral-600: oklch(43.9% 0
|
|
9
|
-
--color-old-neutral-700: oklch(37.1% 0
|
|
10
|
-
--color-old-neutral-800: oklch(26.9% 0
|
|
11
|
-
--color-old-neutral-900: oklch(20.5% 0
|
|
12
|
-
--color-old-neutral-950: oklch(14.5% 0
|
|
2
|
+
--color-old-neutral-50: oklch(98.5% 0 none);
|
|
3
|
+
--color-old-neutral-100: oklch(97% 0 none);
|
|
4
|
+
--color-old-neutral-200: oklch(92.2% 0 none);
|
|
5
|
+
--color-old-neutral-300: oklch(87% 0 none);
|
|
6
|
+
--color-old-neutral-400: oklch(70.8% 0 none);
|
|
7
|
+
--color-old-neutral-500: oklch(55.6% 0 none);
|
|
8
|
+
--color-old-neutral-600: oklch(43.9% 0 none);
|
|
9
|
+
--color-old-neutral-700: oklch(37.1% 0 none);
|
|
10
|
+
--color-old-neutral-800: oklch(26.9% 0 none);
|
|
11
|
+
--color-old-neutral-900: oklch(20.5% 0 none);
|
|
12
|
+
--color-old-neutral-950: oklch(14.5% 0 none);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@theme default inline {
|
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Kickstart your project with one of our ready-to-use Nuxt UI templates or follow
|
|
|
33
33
|
- [Portfolio](https://github.com/nuxt-ui-templates/portfolio) — A sleek portfolio template to showcase your work, skills and blog powered by Nuxt Content.
|
|
34
34
|
- [Changelog](https://github.com/nuxt-ui-templates/changelog) — A changelog template to display your repository releases notes from GitHub powered by Nuxt MDC.
|
|
35
35
|
- [Editor](https://github.com/nuxt-ui-templates/editor) — A rich text editor template powered by TipTap with support for markdown, HTML, and JSON content types.
|
|
36
|
+
- [Calendar](https://github.com/nuxt-ui-templates/calendar) — An Apple Calendar-inspired template with day, week and month views, drag and drop and optimistic updates.
|
|
36
37
|
|
|
37
38
|
## Installation
|
|
38
39
|
|
|
@@ -11,16 +11,14 @@ export default defineCommand({
|
|
|
11
11
|
},
|
|
12
12
|
args: {
|
|
13
13
|
code: {
|
|
14
|
-
description: 'Locale code to create. For example: en.',
|
|
14
|
+
description: 'Locale code to create. For example: en or en_gb.',
|
|
15
15
|
required: true
|
|
16
16
|
},
|
|
17
17
|
name: {
|
|
18
|
-
description: 'Locale name
|
|
19
|
-
required: true
|
|
18
|
+
description: 'Locale name in its own language. Defaults to the CLDR name for the code.'
|
|
20
19
|
},
|
|
21
20
|
dir: {
|
|
22
|
-
description: 'Locale direction.
|
|
23
|
-
default: 'ltr'
|
|
21
|
+
description: 'Locale direction. Defaults to the CLDR direction for the code.'
|
|
24
22
|
}
|
|
25
23
|
},
|
|
26
24
|
async setup({ args }) {
|
|
@@ -36,13 +34,44 @@ export default defineCommand({
|
|
|
36
34
|
process.exit(1)
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
if (![
|
|
40
|
-
consola.error(`🚨
|
|
37
|
+
if (!args.code.match(/^[a-z]{2,3}(?:_(?:[a-z]{2}|\d{3}))?$/)) {
|
|
38
|
+
consola.error(`🚨 ${args.code} is not a valid locale code!\nExample: en, en_gb or es_419`)
|
|
39
|
+
process.exit(1)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const code = normalizeLocale(args.code)
|
|
43
|
+
const language = code.split('-')[0]
|
|
44
|
+
|
|
45
|
+
// `Intl.DisplayNames` echoes the input back when the code is unknown to CLDR
|
|
46
|
+
if (new Intl.DisplayNames(['en'], { type: 'language' }).of(language) === language) {
|
|
47
|
+
consola.error(`🚨 ${language} is not a known ISO 639 language code!\nFor example, the code for Tajik is tg, not tj.`)
|
|
48
|
+
process.exit(1)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const region = code.split('-')[1]
|
|
52
|
+
if (region && new Intl.DisplayNames(['en'], { type: 'region' }).of(region) === region) {
|
|
53
|
+
consola.error(`🚨 ${region} is not a known region code!\nExample: en_gb or pt_br`)
|
|
41
54
|
process.exit(1)
|
|
42
55
|
}
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
let name = args.name
|
|
58
|
+
if (!name) {
|
|
59
|
+
const cldrName = new Intl.DisplayNames([code], { type: 'language', languageDisplay: 'standard' }).of(code)
|
|
60
|
+
name = cldrName.charAt(0).toLocaleUpperCase(code) + cldrName.slice(1)
|
|
61
|
+
consola.info(`🌍 Using CLDR name for ${code}: ${name}`)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let dir = args.dir
|
|
65
|
+
if (!dir) {
|
|
66
|
+
const intlLocale = new Intl.Locale(code)
|
|
67
|
+
dir = (intlLocale.getTextInfo?.() ?? intlLocale.textInfo)?.direction ?? 'ltr'
|
|
68
|
+
if (dir === 'rtl') {
|
|
69
|
+
consola.info(`🌍 Using CLDR direction for ${code}: ${dir}`)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!['ltr', 'rtl'].includes(dir)) {
|
|
74
|
+
consola.error(`🚨 Direction ${dir} not supported!`)
|
|
46
75
|
process.exit(1)
|
|
47
76
|
}
|
|
48
77
|
|
|
@@ -55,8 +84,8 @@ export default defineCommand({
|
|
|
55
84
|
await fsp.copyFile(originLocaleFilePath, newLocaleFilePath)
|
|
56
85
|
const localeFile = await fsp.readFile(newLocaleFilePath, 'utf-8')
|
|
57
86
|
const rewrittenLocaleFile = localeFile
|
|
58
|
-
.replace(/name: '(.*)',/, `name: '${
|
|
59
|
-
.replace(/code: '(.*)',/, `code: '${
|
|
87
|
+
.replace(/name: '(.*)',/, `name: '${name}',`)
|
|
88
|
+
.replace(/code: '(.*)',/, `code: '${code}',${dir !== 'ltr' ? `\n dir: '${dir}',` : ''}`)
|
|
60
89
|
await fsp.writeFile(newLocaleFilePath, rewrittenLocaleFile)
|
|
61
90
|
|
|
62
91
|
consola.success(`🪄 Generated ${newLocaleFilePath}`)
|
package/cli/templates.mjs
CHANGED
|
@@ -73,7 +73,7 @@ const props = useComponentProps('${componentKey}', _props)
|
|
|
73
73
|
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
74
74
|
|
|
75
75
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
76
|
-
const ui = computed(() => tv({ extend:
|
|
76
|
+
const ui = computed(() => tv({ extend: theme, ...(${appConfigLookup} || {}) })())
|
|
77
77
|
</script>
|
|
78
78
|
|
|
79
79
|
<template>
|
|
@@ -126,7 +126,7 @@ const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
|
126
126
|
const rootProps = useForwardProps(reactivePick(props, 'as'), emits)
|
|
127
127
|
|
|
128
128
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
129
|
-
const ui = computed(() => tv({ extend:
|
|
129
|
+
const ui = computed(() => tv({ extend: theme, ...(${appConfigLookup} || {}) })())
|
|
130
130
|
</script>
|
|
131
131
|
|
|
132
132
|
<template>
|
package/dist/module.d.mts
CHANGED
|
@@ -98,7 +98,7 @@ interface ModuleOptions {
|
|
|
98
98
|
* - `string[]`: Enable detection and include additional components (useful for dynamic components)
|
|
99
99
|
* @defaultValue false
|
|
100
100
|
* @example true
|
|
101
|
-
* @example ['Modal', '
|
|
101
|
+
* @example ['Modal', 'DropdownMenu']
|
|
102
102
|
*/
|
|
103
103
|
componentDetection?: boolean | string[];
|
|
104
104
|
};
|
package/dist/module.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.1",
|
|
4
4
|
"docs": "https://ui.nuxt.com/docs/getting-started/installation/nuxt",
|
|
5
5
|
"configKey": "ui",
|
|
6
6
|
"compatibility": {
|
|
7
7
|
"nuxt": ">=4.1.0"
|
|
8
8
|
},
|
|
9
9
|
"builder": {
|
|
10
|
-
"@nuxt/module-builder": "1.0.
|
|
10
|
+
"@nuxt/module-builder": "1.0.3",
|
|
11
11
|
"unbuild": "3.6.1"
|
|
12
12
|
}
|
|
13
13
|
}
|
package/dist/module.mjs
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, addImports } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors,
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, c as getDefaultConfig, g as getClientBundleIcons, f as publicComposables, a as addTemplates } from './shared/ui.DCJ9twx8.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
7
7
|
import 'knitwork';
|
|
8
8
|
import 'tailwindcss/colors';
|
|
9
|
+
import 'node:fs';
|
|
9
10
|
import 'node:fs/promises';
|
|
11
|
+
import 'consola';
|
|
10
12
|
import 'pathe';
|
|
11
13
|
import 'tinyglobby';
|
|
14
|
+
import 'mlly';
|
|
12
15
|
|
|
13
16
|
const name = "@nuxt/ui";
|
|
14
|
-
const version = "4.
|
|
17
|
+
const version = "4.11.1";
|
|
15
18
|
|
|
16
19
|
const module$1 = defineNuxtModule({
|
|
17
20
|
meta: {
|
|
@@ -11,7 +11,7 @@ import type { SelectMenuProps } from './SelectMenu.vue';
|
|
|
11
11
|
import type { PinInputProps } from './PinInput.vue';
|
|
12
12
|
import type { IconProps } from './Icon.vue';
|
|
13
13
|
import type { LinkPropsKeys } from './Link.vue';
|
|
14
|
-
import type { FormSchema, FormSubmitEvent, InferInput } from '../types/form';
|
|
14
|
+
import type { FormData, FormSchema, FormSubmitEvent, InferInput } from '../types/form';
|
|
15
15
|
import type { FormHTMLAttributes } from '../types/html';
|
|
16
16
|
import type { NonUnion } from '../types/utils';
|
|
17
17
|
import type { ComponentConfig } from '../types/tv';
|
|
@@ -107,7 +107,7 @@ declare const _default: typeof __VLS_export;
|
|
|
107
107
|
export default _default;
|
|
108
108
|
declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
109
109
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<AuthFormProps<T, F> & {
|
|
110
|
-
onSubmit?: ((payload: FormSubmitEvent<import("
|
|
110
|
+
onSubmit?: ((payload: FormSubmitEvent<import("../types").InferOutput<T>>) => any) | undefined;
|
|
111
111
|
}> & (typeof globalThis extends {
|
|
112
112
|
__VLS_PROPS_FALLBACK: infer P;
|
|
113
113
|
} ? P : {});
|
|
@@ -119,13 +119,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
119
119
|
silent?: false | undefined;
|
|
120
120
|
nested?: boolean;
|
|
121
121
|
transform?: T_1 | undefined;
|
|
122
|
-
}): Promise<
|
|
122
|
+
}): Promise<FormData<T, T_1>>;
|
|
123
123
|
<T_1 extends boolean>(opts: {
|
|
124
124
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
125
125
|
silent?: true | undefined;
|
|
126
126
|
nested?: boolean;
|
|
127
127
|
transform?: T_1 | undefined;
|
|
128
|
-
}): Promise<false |
|
|
128
|
+
}): Promise<false | FormData<T, T_1>>;
|
|
129
129
|
};
|
|
130
130
|
errors: {
|
|
131
131
|
id?: string | undefined;
|
|
@@ -153,13 +153,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
153
153
|
silent?: false | undefined;
|
|
154
154
|
nested?: boolean;
|
|
155
155
|
transform?: T_1 | undefined;
|
|
156
|
-
}): Promise<
|
|
156
|
+
}): Promise<FormData<T, T_1>>;
|
|
157
157
|
<T_1 extends boolean>(opts: {
|
|
158
158
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
159
159
|
silent?: true | undefined;
|
|
160
160
|
nested?: boolean;
|
|
161
161
|
transform?: T_1 | undefined;
|
|
162
|
-
}): Promise<false |
|
|
162
|
+
}): Promise<false | FormData<T, T_1>>;
|
|
163
163
|
};
|
|
164
164
|
errors: {
|
|
165
165
|
id?: string | undefined;
|
|
@@ -185,7 +185,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
185
185
|
}>) => void;
|
|
186
186
|
attrs: any;
|
|
187
187
|
slots: AuthFormSlots<import("vue").Reactive<InferInput<T>>, F>;
|
|
188
|
-
emit: (evt: "submit", payload: FormSubmitEvent<import("
|
|
188
|
+
emit: (evt: "submit", payload: FormSubmitEvent<import("../types").InferOutput<T>>) => void;
|
|
189
189
|
}>) => import("vue").VNode & {
|
|
190
190
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
191
191
|
};
|
|
@@ -11,7 +11,7 @@ import type { SelectMenuProps } from './SelectMenu.vue';
|
|
|
11
11
|
import type { PinInputProps } from './PinInput.vue';
|
|
12
12
|
import type { IconProps } from './Icon.vue';
|
|
13
13
|
import type { LinkPropsKeys } from './Link.vue';
|
|
14
|
-
import type { FormSchema, FormSubmitEvent, InferInput } from '../types/form';
|
|
14
|
+
import type { FormData, FormSchema, FormSubmitEvent, InferInput } from '../types/form';
|
|
15
15
|
import type { FormHTMLAttributes } from '../types/html';
|
|
16
16
|
import type { NonUnion } from '../types/utils';
|
|
17
17
|
import type { ComponentConfig } from '../types/tv';
|
|
@@ -107,7 +107,7 @@ declare const _default: typeof __VLS_export;
|
|
|
107
107
|
export default _default;
|
|
108
108
|
declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
109
109
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<AuthFormProps<T, F> & {
|
|
110
|
-
onSubmit?: ((payload: FormSubmitEvent<import("
|
|
110
|
+
onSubmit?: ((payload: FormSubmitEvent<import("../types").InferOutput<T>>) => any) | undefined;
|
|
111
111
|
}> & (typeof globalThis extends {
|
|
112
112
|
__VLS_PROPS_FALLBACK: infer P;
|
|
113
113
|
} ? P : {});
|
|
@@ -119,13 +119,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
119
119
|
silent?: false | undefined;
|
|
120
120
|
nested?: boolean;
|
|
121
121
|
transform?: T_1 | undefined;
|
|
122
|
-
}): Promise<
|
|
122
|
+
}): Promise<FormData<T, T_1>>;
|
|
123
123
|
<T_1 extends boolean>(opts: {
|
|
124
124
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
125
125
|
silent?: true | undefined;
|
|
126
126
|
nested?: boolean;
|
|
127
127
|
transform?: T_1 | undefined;
|
|
128
|
-
}): Promise<false |
|
|
128
|
+
}): Promise<false | FormData<T, T_1>>;
|
|
129
129
|
};
|
|
130
130
|
errors: {
|
|
131
131
|
id?: string | undefined;
|
|
@@ -153,13 +153,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
153
153
|
silent?: false | undefined;
|
|
154
154
|
nested?: boolean;
|
|
155
155
|
transform?: T_1 | undefined;
|
|
156
|
-
}): Promise<
|
|
156
|
+
}): Promise<FormData<T, T_1>>;
|
|
157
157
|
<T_1 extends boolean>(opts: {
|
|
158
158
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
159
159
|
silent?: true | undefined;
|
|
160
160
|
nested?: boolean;
|
|
161
161
|
transform?: T_1 | undefined;
|
|
162
|
-
}): Promise<false |
|
|
162
|
+
}): Promise<false | FormData<T, T_1>>;
|
|
163
163
|
};
|
|
164
164
|
errors: {
|
|
165
165
|
id?: string | undefined;
|
|
@@ -185,7 +185,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
185
185
|
}>) => void;
|
|
186
186
|
attrs: any;
|
|
187
187
|
slots: AuthFormSlots<import("vue").Reactive<InferInput<T>>, F>;
|
|
188
|
-
emit: (evt: "submit", payload: FormSubmitEvent<import("
|
|
188
|
+
emit: (evt: "submit", payload: FormSubmitEvent<import("../types").InferOutput<T>>) => void;
|
|
189
189
|
}>) => import("vue").VNode & {
|
|
190
190
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
191
191
|
};
|
|
@@ -70,6 +70,7 @@ const props = useComponentProps("button", _props);
|
|
|
70
70
|
const appConfig = useAppConfig();
|
|
71
71
|
const { orientation, size: buttonSize } = useFieldGroup(_props);
|
|
72
72
|
const linkProps = useForwardProps(pickLinkProps(props));
|
|
73
|
+
const forwardedLinkProps = computed(() => omit(linkProps.value, ["type", "disabled", "onClick"]));
|
|
73
74
|
const loadingAutoState = ref(false);
|
|
74
75
|
const formLoading = inject(formLoadingInjectionKey, void 0);
|
|
75
76
|
async function onClickWrapper(event) {
|
|
@@ -85,7 +86,15 @@ const isLoading = computed(() => {
|
|
|
85
86
|
return props.loading || props.loadingAuto && (loadingAutoState.value || formLoading?.value && props.type === "submit");
|
|
86
87
|
});
|
|
87
88
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(
|
|
88
|
-
computed(() => ({
|
|
89
|
+
computed(() => ({
|
|
90
|
+
icon: props.icon,
|
|
91
|
+
leading: props.leading,
|
|
92
|
+
leadingIcon: props.leadingIcon,
|
|
93
|
+
trailing: props.trailing,
|
|
94
|
+
trailingIcon: props.trailingIcon,
|
|
95
|
+
loading: isLoading.value,
|
|
96
|
+
loadingIcon: props.loadingIcon
|
|
97
|
+
}))
|
|
89
98
|
);
|
|
90
99
|
const ui = computed(() => tv({
|
|
91
100
|
extend: theme,
|
|
@@ -119,7 +128,7 @@ const ui = computed(() => tv({
|
|
|
119
128
|
v-slot="{ active, ...slotProps }"
|
|
120
129
|
:type="props.type"
|
|
121
130
|
:disabled="props.disabled || isLoading"
|
|
122
|
-
v-bind="
|
|
131
|
+
v-bind="forwardedLinkProps"
|
|
123
132
|
custom
|
|
124
133
|
>
|
|
125
134
|
<ULinkBase
|
|
@@ -66,32 +66,32 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Om
|
|
|
66
66
|
items?: T[];
|
|
67
67
|
/**
|
|
68
68
|
* Enable Autoplay plugin
|
|
69
|
-
* @see https://www.embla-carousel.com/plugins/autoplay
|
|
69
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/autoplay
|
|
70
70
|
*/
|
|
71
71
|
autoplay?: boolean | AutoplayOptionsType;
|
|
72
72
|
/**
|
|
73
73
|
* Enable Auto Scroll plugin
|
|
74
|
-
* @see https://www.embla-carousel.com/plugins/auto-scroll
|
|
74
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/auto-scroll
|
|
75
75
|
*/
|
|
76
76
|
autoScroll?: boolean | AutoScrollOptionsType;
|
|
77
77
|
/**
|
|
78
78
|
* Enable Auto Height plugin
|
|
79
|
-
* @see https://www.embla-carousel.com/plugins/auto-height
|
|
79
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/auto-height
|
|
80
80
|
*/
|
|
81
81
|
autoHeight?: boolean | AutoHeightOptionsType;
|
|
82
82
|
/**
|
|
83
83
|
* Enable Class Names plugin
|
|
84
|
-
* @see https://www.embla-carousel.com/plugins/class-names
|
|
84
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/class-names
|
|
85
85
|
*/
|
|
86
86
|
classNames?: boolean | ClassNamesOptionsType;
|
|
87
87
|
/**
|
|
88
88
|
* Enable Fade plugin
|
|
89
|
-
* @see https://www.embla-carousel.com/plugins/fade
|
|
89
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/fade
|
|
90
90
|
*/
|
|
91
91
|
fade?: boolean | FadeOptionsType;
|
|
92
92
|
/**
|
|
93
93
|
* Enable Wheel Gestures plugin
|
|
94
|
-
* @see https://www.embla-carousel.com/plugins/wheel-gestures
|
|
94
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/wheel-gestures
|
|
95
95
|
*/
|
|
96
96
|
wheelGestures?: boolean | WheelGesturesPluginOptions;
|
|
97
97
|
class?: any;
|
|
@@ -66,32 +66,32 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Om
|
|
|
66
66
|
items?: T[];
|
|
67
67
|
/**
|
|
68
68
|
* Enable Autoplay plugin
|
|
69
|
-
* @see https://www.embla-carousel.com/plugins/autoplay
|
|
69
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/autoplay
|
|
70
70
|
*/
|
|
71
71
|
autoplay?: boolean | AutoplayOptionsType;
|
|
72
72
|
/**
|
|
73
73
|
* Enable Auto Scroll plugin
|
|
74
|
-
* @see https://www.embla-carousel.com/plugins/auto-scroll
|
|
74
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/auto-scroll
|
|
75
75
|
*/
|
|
76
76
|
autoScroll?: boolean | AutoScrollOptionsType;
|
|
77
77
|
/**
|
|
78
78
|
* Enable Auto Height plugin
|
|
79
|
-
* @see https://www.embla-carousel.com/plugins/auto-height
|
|
79
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/auto-height
|
|
80
80
|
*/
|
|
81
81
|
autoHeight?: boolean | AutoHeightOptionsType;
|
|
82
82
|
/**
|
|
83
83
|
* Enable Class Names plugin
|
|
84
|
-
* @see https://www.embla-carousel.com/plugins/class-names
|
|
84
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/class-names
|
|
85
85
|
*/
|
|
86
86
|
classNames?: boolean | ClassNamesOptionsType;
|
|
87
87
|
/**
|
|
88
88
|
* Enable Fade plugin
|
|
89
|
-
* @see https://www.embla-carousel.com/plugins/fade
|
|
89
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/fade
|
|
90
90
|
*/
|
|
91
91
|
fade?: boolean | FadeOptionsType;
|
|
92
92
|
/**
|
|
93
93
|
* Enable Wheel Gestures plugin
|
|
94
|
-
* @see https://www.embla-carousel.com/plugins/wheel-gestures
|
|
94
|
+
* @see https://www.embla-carousel.com/docs/v8/plugins/wheel-gestures
|
|
95
95
|
*/
|
|
96
96
|
wheelGestures?: boolean | WheelGesturesPluginOptions;
|
|
97
97
|
class?: any;
|
|
@@ -39,12 +39,12 @@ export interface ChatMessagesProps<T extends UIMessage[] = UIMessage[]> {
|
|
|
39
39
|
* The `user` messages props.
|
|
40
40
|
* `{ side: 'right', variant: 'soft' }`{lang="ts-type"}
|
|
41
41
|
*/
|
|
42
|
-
user?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui'>;
|
|
42
|
+
user?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui' | 'color'>;
|
|
43
43
|
/**
|
|
44
44
|
* The `assistant` messages props.
|
|
45
45
|
* `{ side: 'left', variant: 'naked' }`{lang="ts-type"}
|
|
46
46
|
*/
|
|
47
|
-
assistant?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui'>;
|
|
47
|
+
assistant?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui' | 'color'>;
|
|
48
48
|
/**
|
|
49
49
|
* Render the messages in a compact style.
|
|
50
50
|
* This is done automatically when used inside a `UChatPalette`{lang="ts-type"}.
|
|
@@ -39,12 +39,12 @@ export interface ChatMessagesProps<T extends UIMessage[] = UIMessage[]> {
|
|
|
39
39
|
* The `user` messages props.
|
|
40
40
|
* `{ side: 'right', variant: 'soft' }`{lang="ts-type"}
|
|
41
41
|
*/
|
|
42
|
-
user?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui'>;
|
|
42
|
+
user?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui' | 'color'>;
|
|
43
43
|
/**
|
|
44
44
|
* The `assistant` messages props.
|
|
45
45
|
* `{ side: 'left', variant: 'naked' }`{lang="ts-type"}
|
|
46
46
|
*/
|
|
47
|
-
assistant?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui'>;
|
|
47
|
+
assistant?: Pick<PropsBase<T>, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'ui' | 'color'>;
|
|
48
48
|
/**
|
|
49
49
|
* Render the messages in a compact style.
|
|
50
50
|
* This is done automatically when used inside a `UChatPalette`{lang="ts-type"}.
|
|
@@ -82,11 +82,11 @@ export interface ChatPromptSubmitEmits {
|
|
|
82
82
|
declare const _default: typeof __VLS_export;
|
|
83
83
|
export default _default;
|
|
84
84
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
|
-
stop: (event: MouseEvent) => any;
|
|
86
85
|
reload: (event: MouseEvent) => any;
|
|
86
|
+
stop: (event: MouseEvent) => any;
|
|
87
87
|
}, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
|
|
88
|
-
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
89
88
|
onReload?: ((event: MouseEvent) => any) | undefined;
|
|
89
|
+
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
90
90
|
}>, {
|
|
91
91
|
status: ChatStatus;
|
|
92
92
|
streamingColor: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
|
|
@@ -82,11 +82,11 @@ export interface ChatPromptSubmitEmits {
|
|
|
82
82
|
declare const _default: typeof __VLS_export;
|
|
83
83
|
export default _default;
|
|
84
84
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
|
-
stop: (event: MouseEvent) => any;
|
|
86
85
|
reload: (event: MouseEvent) => any;
|
|
86
|
+
stop: (event: MouseEvent) => any;
|
|
87
87
|
}, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
|
|
88
|
-
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
89
88
|
onReload?: ((event: MouseEvent) => any) | undefined;
|
|
89
|
+
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
90
90
|
}>, {
|
|
91
91
|
status: ChatStatus;
|
|
92
92
|
streamingColor: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
|
|
@@ -34,7 +34,7 @@ export interface CheckboxProps<T = boolean> extends Pick<CheckboxRootProps<T>, '
|
|
|
34
34
|
/** Highlight the ring color like a focus state. */
|
|
35
35
|
highlight?: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* The icon displayed when checked
|
|
37
|
+
* The icon displayed when checked, or above the label when `indicator` is `hidden`.
|
|
38
38
|
* @defaultValue appConfig.ui.icons.check
|
|
39
39
|
* @IconifyIcon
|
|
40
40
|
*/
|
|
@@ -41,19 +41,24 @@ const emits = defineEmits(["change", "update:modelValue"]);
|
|
|
41
41
|
const props = useComponentProps("checkbox", _props);
|
|
42
42
|
const appConfig = useAppConfig();
|
|
43
43
|
const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue", "modelValue", "trueValue", "falseValue"), emits);
|
|
44
|
-
const { id: _id, emitFormChange, emitFormInput, size, color, highlight, name, disabled, ariaAttrs } = useFormField(_props);
|
|
44
|
+
const { id: _id, emitFormChange, emitFormInput, size: formFieldSize, color: formFieldColor, highlight: formFieldHighlight, name, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props);
|
|
45
45
|
const id = _id.value ?? useId();
|
|
46
|
+
const color = computed(() => formFieldColor.value ?? props.color);
|
|
47
|
+
const highlight = computed(() => formFieldHighlight.value ?? props.highlight);
|
|
48
|
+
const size = computed(() => formFieldSize.value ?? props.size);
|
|
49
|
+
const disabled = computed(() => formFieldDisabled.value ?? props.disabled);
|
|
50
|
+
const labelIcon = computed(() => props.indicator === "hidden" ? props.icon : void 0);
|
|
46
51
|
const attrs = useAttrs();
|
|
47
52
|
const forwardedAttrs = computed(() => {
|
|
48
53
|
const { "data-state": _, ...rest } = attrs;
|
|
49
54
|
return rest;
|
|
50
55
|
});
|
|
51
56
|
const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.checkbox || {} })({
|
|
52
|
-
size: size.value
|
|
53
|
-
color: color.value
|
|
57
|
+
size: size.value,
|
|
58
|
+
color: color.value,
|
|
54
59
|
variant: props.variant,
|
|
55
60
|
indicator: props.indicator,
|
|
56
|
-
highlight: highlight.value
|
|
61
|
+
highlight: highlight.value,
|
|
57
62
|
required: props.required,
|
|
58
63
|
disabled: disabled.value
|
|
59
64
|
}));
|
|
@@ -78,7 +83,7 @@ function onUpdate(value) {
|
|
|
78
83
|
@update:model-value="onUpdate"
|
|
79
84
|
>
|
|
80
85
|
<template #default="{ state }">
|
|
81
|
-
<CheckboxIndicator data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })">
|
|
86
|
+
<CheckboxIndicator v-if="props.indicator !== 'hidden'" data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })">
|
|
82
87
|
<UIcon v-if="state === 'indeterminate'" :name="props.indeterminateIcon || appConfig.ui.icons.minus" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
83
88
|
<UIcon v-else :name="props.icon || appConfig.ui.icons.check" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
84
89
|
</CheckboxIndicator>
|
|
@@ -86,7 +91,8 @@ function onUpdate(value) {
|
|
|
86
91
|
</CheckboxRoot>
|
|
87
92
|
</div>
|
|
88
93
|
|
|
89
|
-
<div v-if="props.label || !!slots.label || (props.description || !!slots.description)" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
94
|
+
<div v-if="labelIcon || (props.label || !!slots.label) || (props.description || !!slots.description)" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
95
|
+
<UIcon v-if="labelIcon" :name="labelIcon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
90
96
|
<component :is="!props.variant || props.variant === 'list' ? Label : 'p'" v-if="props.label || !!slots.label" :for="id" data-slot="label" :class="ui.label({ class: props.ui?.label })">
|
|
91
97
|
<slot name="label" :label="props.label">
|
|
92
98
|
{{ props.label }}
|
|
@@ -34,7 +34,7 @@ export interface CheckboxProps<T = boolean> extends Pick<CheckboxRootProps<T>, '
|
|
|
34
34
|
/** Highlight the ring color like a focus state. */
|
|
35
35
|
highlight?: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* The icon displayed when checked
|
|
37
|
+
* The icon displayed when checked, or above the label when `indicator` is `hidden`.
|
|
38
38
|
* @defaultValue appConfig.ui.icons.check
|
|
39
39
|
* @IconifyIcon
|
|
40
40
|
*/
|
|
@@ -3,6 +3,7 @@ import type { VNode } from 'vue';
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/ui/checkbox-group';
|
|
5
5
|
import type { CheckboxProps } from './Checkbox.vue';
|
|
6
|
+
import type { IconProps } from './Icon.vue';
|
|
6
7
|
import type { AcceptableValue, GetItemKeys, GetModelValue, GetModelValueEmits } from '../types/utils';
|
|
7
8
|
import type { ComponentConfig } from '../types/tv';
|
|
8
9
|
type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
|
|
@@ -12,6 +13,11 @@ export type CheckboxGroupItem = CheckboxGroupValue | {
|
|
|
12
13
|
description?: string;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
value?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The icon displayed when checked, or above the label when `indicator` is `hidden`.
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
20
|
+
icon?: IconProps['name'];
|
|
15
21
|
class?: any;
|
|
16
22
|
ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
|
|
17
23
|
[key: string]: any;
|
|
@@ -41,16 +41,21 @@ const slots = defineSlots();
|
|
|
41
41
|
const props = useComponentProps("checkboxGroup", _props);
|
|
42
42
|
const appConfig = useAppConfig();
|
|
43
43
|
const rootProps = useForwardProps(reactivePick(props, "as", "modelValue", "defaultValue", "orientation", "loop", "required"), emits);
|
|
44
|
-
const checkboxProps = useForwardProps(reactivePick(props, "variant", "indicator"
|
|
44
|
+
const checkboxProps = useForwardProps(reactivePick(props, "variant", "indicator"));
|
|
45
45
|
const getProxySlots = () => omit(slots, ["legend"]);
|
|
46
|
-
const { emitFormChange, emitFormInput, color, highlight, name, size, id: _id, disabled, ariaAttrs } = useFormField(_props, { bind: false });
|
|
46
|
+
const { emitFormChange, emitFormInput, color: formFieldColor, highlight: formFieldHighlight, name, size: formFieldSize, id: _id, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props, { bind: false });
|
|
47
47
|
const id = _id.value ?? useId();
|
|
48
|
+
const color = computed(() => formFieldColor.value ?? props.color);
|
|
49
|
+
const size = computed(() => formFieldSize.value ?? props.size);
|
|
50
|
+
const highlight = computed(() => formFieldHighlight.value ?? props.highlight);
|
|
51
|
+
const disabled = computed(() => formFieldDisabled.value ?? props.disabled);
|
|
48
52
|
const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.checkboxGroup || {} })({
|
|
49
|
-
size: size.value
|
|
53
|
+
size: size.value,
|
|
50
54
|
required: props.required,
|
|
51
55
|
orientation: props.orientation,
|
|
52
|
-
color: color.value
|
|
56
|
+
color: color.value,
|
|
53
57
|
variant: props.variant,
|
|
58
|
+
highlight: highlight.value,
|
|
54
59
|
disabled: disabled.value
|
|
55
60
|
}));
|
|
56
61
|
function normalizeItem(item) {
|
|
@@ -114,6 +119,7 @@ function onUpdate(value) {
|
|
|
114
119
|
v-for="item in normalizedItems"
|
|
115
120
|
:key="item.value"
|
|
116
121
|
v-bind="{ ...item, ...checkboxProps }"
|
|
122
|
+
:icon="item.icon ?? props.icon"
|
|
117
123
|
:color="color"
|
|
118
124
|
:highlight="highlight"
|
|
119
125
|
:size="size"
|
|
@@ -3,6 +3,7 @@ import type { VNode } from 'vue';
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/ui/checkbox-group';
|
|
5
5
|
import type { CheckboxProps } from './Checkbox.vue';
|
|
6
|
+
import type { IconProps } from './Icon.vue';
|
|
6
7
|
import type { AcceptableValue, GetItemKeys, GetModelValue, GetModelValueEmits } from '../types/utils';
|
|
7
8
|
import type { ComponentConfig } from '../types/tv';
|
|
8
9
|
type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
|
|
@@ -12,6 +13,11 @@ export type CheckboxGroupItem = CheckboxGroupValue | {
|
|
|
12
13
|
description?: string;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
value?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The icon displayed when checked, or above the label when `indicator` is `hidden`.
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
20
|
+
icon?: IconProps['name'];
|
|
15
21
|
class?: any;
|
|
16
22
|
ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
|
|
17
23
|
[key: string]: any;
|