@nuxt/ui 3.3.0 → 3.3.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/drawer.ts +1 -1
- package/.nuxt/ui/input.ts +1 -1
- package/.nuxt/ui/select.ts +7 -7
- package/.nuxt/ui/textarea.ts +1 -1
- package/cli/templates.mjs +4 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/ContextMenuContent.vue +5 -3
- package/dist/runtime/components/DropdownMenuContent.vue +5 -3
- package/dist/runtime/components/FileUpload.vue +7 -1
- package/dist/runtime/components/Form.vue +3 -3
- package/dist/runtime/components/InputMenu.vue +11 -6
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -211
- package/dist/runtime/components/InputNumber.vue +3 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +3 -77
- package/dist/runtime/components/InputTags.vue.d.ts +2 -2
- package/dist/runtime/components/PinInput.vue +3 -1
- package/dist/runtime/components/PinInput.vue.d.ts +4 -4
- package/dist/runtime/components/Select.vue +16 -6
- package/dist/runtime/components/Select.vue.d.ts +2 -2
- package/dist/runtime/components/SelectMenu.vue +10 -5
- package/dist/runtime/components/SelectMenu.vue.d.ts +2 -2
- package/dist/runtime/components/Tabs.vue +1 -0
- package/dist/runtime/components/Toast.vue.d.ts +2 -2
- package/dist/runtime/components/Tooltip.vue +2 -2
- package/dist/runtime/components/Tree.vue +29 -27
- package/dist/runtime/components/Tree.vue.d.ts +1 -0
- package/dist/runtime/composables/useFileUpload.js +7 -1
- package/dist/runtime/composables/useOverlay.d.ts +1 -1
- package/dist/runtime/composables/useOverlay.js +4 -3
- package/dist/runtime/locale/ar.js +3 -0
- package/dist/runtime/locale/az.js +3 -0
- package/dist/runtime/locale/bg.js +3 -0
- package/dist/runtime/locale/bn.js +3 -0
- package/dist/runtime/locale/ca.js +3 -0
- package/dist/runtime/locale/ckb.js +3 -0
- package/dist/runtime/locale/cs.js +3 -0
- package/dist/runtime/locale/da.js +3 -0
- package/dist/runtime/locale/de.js +3 -0
- package/dist/runtime/locale/el.js +3 -0
- package/dist/runtime/locale/en.js +3 -0
- package/dist/runtime/locale/es.js +3 -0
- package/dist/runtime/locale/et.js +3 -0
- package/dist/runtime/locale/fa_ir.js +3 -0
- package/dist/runtime/locale/fi.js +3 -0
- package/dist/runtime/locale/fr.js +3 -0
- package/dist/runtime/locale/he.js +3 -0
- package/dist/runtime/locale/hi.js +3 -0
- package/dist/runtime/locale/hu.js +3 -0
- package/dist/runtime/locale/hy.js +3 -0
- package/dist/runtime/locale/id.js +3 -0
- package/dist/runtime/locale/it.js +3 -0
- package/dist/runtime/locale/ja.js +3 -0
- package/dist/runtime/locale/kk.js +3 -0
- package/dist/runtime/locale/km.js +3 -0
- package/dist/runtime/locale/ko.js +3 -0
- package/dist/runtime/locale/ky.js +3 -0
- package/dist/runtime/locale/lb.js +3 -0
- package/dist/runtime/locale/lt.js +3 -0
- package/dist/runtime/locale/mn.js +3 -0
- package/dist/runtime/locale/ms.js +3 -0
- package/dist/runtime/locale/nb_no.js +3 -0
- package/dist/runtime/locale/nl.js +3 -0
- package/dist/runtime/locale/pl.js +3 -0
- package/dist/runtime/locale/pt.js +3 -0
- package/dist/runtime/locale/pt_br.js +3 -0
- package/dist/runtime/locale/ro.js +3 -0
- package/dist/runtime/locale/ru.js +3 -0
- package/dist/runtime/locale/sk.js +3 -0
- package/dist/runtime/locale/sl.js +3 -0
- package/dist/runtime/locale/sv.js +3 -0
- package/dist/runtime/locale/th.js +3 -0
- package/dist/runtime/locale/tj.js +3 -0
- package/dist/runtime/locale/tr.js +3 -0
- package/dist/runtime/locale/ug_cn.js +3 -0
- package/dist/runtime/locale/uk.js +3 -0
- package/dist/runtime/locale/ur.js +3 -0
- package/dist/runtime/locale/uz.js +3 -0
- package/dist/runtime/locale/vi.js +3 -0
- package/dist/runtime/locale/zh_cn.js +3 -0
- package/dist/runtime/locale/zh_tw.js +3 -0
- package/dist/runtime/types/locale.d.ts +3 -0
- package/dist/runtime/utils/index.d.ts +5 -0
- package/dist/runtime/utils/index.js +18 -0
- package/dist/shared/{ui.BkSj2DmF.mjs → ui.BTUFJHYJ.mjs} +21 -7
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +20 -16
|
@@ -4,7 +4,7 @@ import theme from '#build/ui/input-number';
|
|
|
4
4
|
import type { ButtonProps } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/utils';
|
|
6
6
|
type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
|
|
7
|
-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange'> {
|
|
7
|
+
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'> {
|
|
8
8
|
/**
|
|
9
9
|
* The element or component this component should render as.
|
|
10
10
|
* @defaultValue 'div'
|
|
@@ -80,43 +80,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumbe
|
|
|
80
80
|
};
|
|
81
81
|
$refs: {
|
|
82
82
|
[x: string]: unknown;
|
|
83
|
-
} & {
|
|
84
|
-
primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
85
|
-
asChild: {
|
|
86
|
-
type: BooleanConstructor;
|
|
87
|
-
default: boolean;
|
|
88
|
-
};
|
|
89
|
-
as: {
|
|
90
|
-
type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
|
|
91
|
-
default: string;
|
|
92
|
-
};
|
|
93
|
-
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
96
|
-
asChild: boolean;
|
|
97
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
98
|
-
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
99
|
-
P: {};
|
|
100
|
-
B: {};
|
|
101
|
-
D: {};
|
|
102
|
-
C: {};
|
|
103
|
-
M: {};
|
|
104
|
-
Defaults: {};
|
|
105
|
-
}, Readonly<import("vue").ExtractPropTypes<{
|
|
106
|
-
asChild: {
|
|
107
|
-
type: BooleanConstructor;
|
|
108
|
-
default: boolean;
|
|
109
|
-
};
|
|
110
|
-
as: {
|
|
111
|
-
type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
|
|
112
|
-
default: string;
|
|
113
|
-
};
|
|
114
|
-
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
115
|
-
[key: string]: any;
|
|
116
|
-
}>, {}, {}, {}, {
|
|
117
|
-
asChild: boolean;
|
|
118
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
119
|
-
}> | null;
|
|
120
83
|
};
|
|
121
84
|
$slots: Readonly<{
|
|
122
85
|
[name: string]: import("vue").Slot<any> | undefined;
|
|
@@ -152,7 +115,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumbe
|
|
|
152
115
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
153
116
|
}> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
154
117
|
$slots: {
|
|
155
|
-
default
|
|
118
|
+
default?: (props: {}) => any;
|
|
156
119
|
};
|
|
157
120
|
}) | null, ({
|
|
158
121
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -166,43 +129,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumbe
|
|
|
166
129
|
};
|
|
167
130
|
$refs: {
|
|
168
131
|
[x: string]: unknown;
|
|
169
|
-
} & {
|
|
170
|
-
primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
171
|
-
asChild: {
|
|
172
|
-
type: BooleanConstructor;
|
|
173
|
-
default: boolean;
|
|
174
|
-
};
|
|
175
|
-
as: {
|
|
176
|
-
type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
|
|
177
|
-
default: string;
|
|
178
|
-
};
|
|
179
|
-
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
180
|
-
[key: string]: any;
|
|
181
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
182
|
-
asChild: boolean;
|
|
183
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
184
|
-
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
185
|
-
P: {};
|
|
186
|
-
B: {};
|
|
187
|
-
D: {};
|
|
188
|
-
C: {};
|
|
189
|
-
M: {};
|
|
190
|
-
Defaults: {};
|
|
191
|
-
}, Readonly<import("vue").ExtractPropTypes<{
|
|
192
|
-
asChild: {
|
|
193
|
-
type: BooleanConstructor;
|
|
194
|
-
default: boolean;
|
|
195
|
-
};
|
|
196
|
-
as: {
|
|
197
|
-
type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
|
|
198
|
-
default: string;
|
|
199
|
-
};
|
|
200
|
-
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
201
|
-
[key: string]: any;
|
|
202
|
-
}>, {}, {}, {}, {
|
|
203
|
-
asChild: boolean;
|
|
204
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
205
|
-
}> | null;
|
|
206
132
|
};
|
|
207
133
|
$slots: Readonly<{
|
|
208
134
|
[name: string]: import("vue").Slot<any> | undefined;
|
|
@@ -238,7 +164,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumbe
|
|
|
238
164
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
239
165
|
}> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
240
166
|
$slots: {
|
|
241
|
-
default
|
|
167
|
+
default?: (props: {}) => any;
|
|
242
168
|
};
|
|
243
169
|
}) | null>;
|
|
244
170
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -117,7 +117,7 @@ declare const _default: <T extends InputTagItem>(__VLS_props: NonNullable<Awaite
|
|
|
117
117
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
118
118
|
}> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
119
119
|
$slots: {
|
|
120
|
-
default
|
|
120
|
+
default?: (props: {}) => any;
|
|
121
121
|
};
|
|
122
122
|
}) | null, ({
|
|
123
123
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -169,7 +169,7 @@ declare const _default: <T extends InputTagItem>(__VLS_props: NonNullable<Awaite
|
|
|
169
169
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
170
170
|
}> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
171
171
|
$slots: {
|
|
172
|
-
default
|
|
172
|
+
default?: (props: {}) => any;
|
|
173
173
|
};
|
|
174
174
|
}) | null>;
|
|
175
175
|
}>): void;
|
|
@@ -34,7 +34,7 @@ const props = defineProps({
|
|
|
34
34
|
});
|
|
35
35
|
const emits = defineEmits(["update:modelValue", "complete", "change", "blur"]);
|
|
36
36
|
const appConfig = useAppConfig();
|
|
37
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "
|
|
37
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "disabled", "id", "mask", "name", "otp", "required", "type"), emits);
|
|
38
38
|
const { emitFormInput, emitFormFocus, emitFormChange, emitFormBlur, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props);
|
|
39
39
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pinInput || {} })({
|
|
40
40
|
color: color.value,
|
|
@@ -76,6 +76,8 @@ defineExpose({
|
|
|
76
76
|
:id="id"
|
|
77
77
|
:name="name"
|
|
78
78
|
:placeholder="placeholder"
|
|
79
|
+
:model-value="modelValue"
|
|
80
|
+
:default-value="defaultValue"
|
|
79
81
|
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
80
82
|
@update:model-value="emitFormInput()"
|
|
81
83
|
@complete="onComplete"
|
|
@@ -38,19 +38,19 @@ export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T
|
|
|
38
38
|
change: [payload: Event];
|
|
39
39
|
blur: [payload: Event];
|
|
40
40
|
};
|
|
41
|
-
declare const _default: <T extends PinInputType
|
|
41
|
+
declare const _default: <T extends PinInputType>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
42
42
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
43
43
|
readonly onBlur?: ((payload: Event) => any) | undefined;
|
|
44
|
-
readonly onComplete?: ((value: T extends "number" ? number[] : string[]) => any) | undefined;
|
|
44
|
+
readonly onComplete?: ((value: [T] extends ["number"] ? number[] : string[]) => any) | undefined;
|
|
45
45
|
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
46
|
-
readonly "onUpdate:modelValue"?: ((value: T extends "number" ? number[] : string[]) => any) | undefined;
|
|
46
|
+
readonly "onUpdate:modelValue"?: ((value: [T] extends ["number"] ? number[] : string[]) => any) | undefined;
|
|
47
47
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue" | "onComplete"> & PinInputProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
48
48
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
49
49
|
inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
50
50
|
}>): void;
|
|
51
51
|
attrs: any;
|
|
52
52
|
slots: {};
|
|
53
|
-
emit: ((evt: "blur", payload: Event) => void) & ((evt: "complete", value: T extends "number" ? number[] : string[]) => void) & ((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", value: T extends "number" ? number[] : string[]) => void);
|
|
53
|
+
emit: ((evt: "blur", payload: Event) => void) & ((evt: "complete", value: [T] extends ["number"] ? number[] : string[]) => void) & ((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", value: [T] extends ["number"] ? number[] : string[]) => void);
|
|
54
54
|
}>) => import("vue").VNode & {
|
|
55
55
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
56
56
|
};
|
|
@@ -12,7 +12,7 @@ import { useButtonGroup } from "../composables/useButtonGroup";
|
|
|
12
12
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
13
13
|
import { useFormField } from "../composables/useFormField";
|
|
14
14
|
import { usePortal } from "../composables/usePortal";
|
|
15
|
-
import {
|
|
15
|
+
import { get, getDisplayValue, isArrayOfArray } from "../utils";
|
|
16
16
|
import { tv } from "../utils/tv";
|
|
17
17
|
import UIcon from "./Icon.vue";
|
|
18
18
|
import UAvatar from "./Avatar.vue";
|
|
@@ -81,11 +81,16 @@ const groups = computed(
|
|
|
81
81
|
const items = computed(() => groups.value.flatMap((group) => group));
|
|
82
82
|
function displayValue(value) {
|
|
83
83
|
if (props.multiple && Array.isArray(value)) {
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const displayedValues = value.map((item) => getDisplayValue(items.value, item, {
|
|
85
|
+
labelKey: props.labelKey,
|
|
86
|
+
valueKey: props.valueKey
|
|
87
|
+
})).filter((v) => v != null && v !== "");
|
|
88
|
+
return displayedValues.length > 0 ? displayedValues.join(", ") : void 0;
|
|
86
89
|
}
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
return getDisplayValue(items.value, value, {
|
|
91
|
+
labelKey: props.labelKey,
|
|
92
|
+
valueKey: props.valueKey
|
|
93
|
+
});
|
|
89
94
|
}
|
|
90
95
|
const triggerRef = ref(null);
|
|
91
96
|
function autoFocus() {
|
|
@@ -137,7 +142,12 @@ defineExpose({
|
|
|
137
142
|
@update:model-value="onUpdate"
|
|
138
143
|
@update:open="onUpdateOpen"
|
|
139
144
|
>
|
|
140
|
-
<SelectTrigger
|
|
145
|
+
<SelectTrigger
|
|
146
|
+
:id="id"
|
|
147
|
+
ref="triggerRef"
|
|
148
|
+
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
149
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
150
|
+
>
|
|
141
151
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
142
152
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
143
153
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -186,7 +186,7 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
|
|
|
186
186
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
187
187
|
}> & Omit<Readonly<import("reka-ui").SelectTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
188
188
|
$slots: {
|
|
189
|
-
default
|
|
189
|
+
default?: (props: {}) => any;
|
|
190
190
|
};
|
|
191
191
|
}) | null, ({
|
|
192
192
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -237,7 +237,7 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
|
|
|
237
237
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
238
238
|
}> & Omit<Readonly<import("reka-ui").SelectTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
239
239
|
$slots: {
|
|
240
|
-
default
|
|
240
|
+
default?: (props: {}) => any;
|
|
241
241
|
};
|
|
242
242
|
}) | null>;
|
|
243
243
|
}>): void;
|
|
@@ -13,7 +13,7 @@ import { useComponentIcons } from "../composables/useComponentIcons";
|
|
|
13
13
|
import { useFormField } from "../composables/useFormField";
|
|
14
14
|
import { useLocale } from "../composables/useLocale";
|
|
15
15
|
import { usePortal } from "../composables/usePortal";
|
|
16
|
-
import { compare, get, isArrayOfArray } from "../utils";
|
|
16
|
+
import { compare, get, getDisplayValue, isArrayOfArray } from "../utils";
|
|
17
17
|
import { tv } from "../utils/tv";
|
|
18
18
|
import UIcon from "./Icon.vue";
|
|
19
19
|
import UAvatar from "./Avatar.vue";
|
|
@@ -90,11 +90,16 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.selectMenu ||
|
|
|
90
90
|
}));
|
|
91
91
|
function displayValue(value) {
|
|
92
92
|
if (props.multiple && Array.isArray(value)) {
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const displayedValues = value.map((item) => getDisplayValue(items.value, item, {
|
|
94
|
+
labelKey: props.labelKey,
|
|
95
|
+
valueKey: props.valueKey
|
|
96
|
+
})).filter((v) => v != null && v !== "");
|
|
97
|
+
return displayedValues.length > 0 ? displayedValues.join(", ") : void 0;
|
|
95
98
|
}
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
return getDisplayValue(items.value, value, {
|
|
100
|
+
labelKey: props.labelKey,
|
|
101
|
+
valueKey: props.valueKey
|
|
102
|
+
});
|
|
98
103
|
}
|
|
99
104
|
const groups = computed(
|
|
100
105
|
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
@@ -233,7 +233,7 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
233
233
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
234
234
|
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
235
235
|
$slots: {
|
|
236
|
-
default
|
|
236
|
+
default?: (props: {}) => any;
|
|
237
237
|
};
|
|
238
238
|
}) | null, ({
|
|
239
239
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -283,7 +283,7 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
283
283
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
284
284
|
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
285
285
|
$slots: {
|
|
286
|
-
default
|
|
286
|
+
default?: (props: {}) => any;
|
|
287
287
|
};
|
|
288
288
|
}) | null>;
|
|
289
289
|
}>): void;
|
|
@@ -11,6 +11,7 @@ import { get } from "../utils";
|
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
12
|
import UIcon from "./Icon.vue";
|
|
13
13
|
import UAvatar from "./Avatar.vue";
|
|
14
|
+
import UBadge from "./Badge.vue";
|
|
14
15
|
const props = defineProps({
|
|
15
16
|
as: { type: null, required: false },
|
|
16
17
|
items: { type: Array, required: false },
|
|
@@ -50,7 +50,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
50
50
|
* `{ size: 'sm' }`{lang="ts-type"}
|
|
51
51
|
* @defaultValue true
|
|
52
52
|
*/
|
|
53
|
-
progress?: boolean | Pick<ProgressProps, 'color'>;
|
|
53
|
+
progress?: boolean | Pick<ProgressProps, 'color' | 'ui'>;
|
|
54
54
|
class?: any;
|
|
55
55
|
ui?: Toast['slots'];
|
|
56
56
|
}
|
|
@@ -153,7 +153,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
|
|
|
153
153
|
}>, "currentTarget">) => any) | undefined;
|
|
154
154
|
}>, {
|
|
155
155
|
close: boolean | Partial<ButtonProps>;
|
|
156
|
-
progress: boolean | Pick<ProgressProps, "color">;
|
|
156
|
+
progress: boolean | Pick<ProgressProps, "color" | "ui">;
|
|
157
157
|
orientation: Toast["variants"]["orientation"];
|
|
158
158
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
|
|
159
159
|
export default _default;
|
|
@@ -31,7 +31,7 @@ const props = defineProps({
|
|
|
31
31
|
const emits = defineEmits(["update:open"]);
|
|
32
32
|
const slots = defineSlots();
|
|
33
33
|
const appConfig = useAppConfig();
|
|
34
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "
|
|
34
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "ignoreNonKeyboardFocus"), emits);
|
|
35
35
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
36
36
|
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
37
37
|
const arrowProps = toRef(() => props.arrow);
|
|
@@ -41,7 +41,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {}
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
|
-
<TooltipRoot v-slot="{ open }" v-bind="rootProps">
|
|
44
|
+
<TooltipRoot v-slot="{ open }" v-bind="rootProps" :disabled="!(text || kbds?.length || !!slots.content) || props.disabled">
|
|
45
45
|
<TooltipTrigger v-if="!!slots.default || !!reference" v-bind="$attrs" as-child :reference="reference" :class="props.class">
|
|
46
46
|
<slot :open="open" />
|
|
47
47
|
</TooltipTrigger>
|
|
@@ -73,35 +73,37 @@ const defaultExpanded = computed(
|
|
|
73
73
|
@toggle="item.onToggle"
|
|
74
74
|
@select="item.onSelect"
|
|
75
75
|
>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<slot :name="item.slot
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<span v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
|
|
92
|
-
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
93
|
-
{{ getItemLabel(item) }}
|
|
76
|
+
<slot :name="item.slot ? `${item.slot}-wrapper` : 'item-wrapper'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
77
|
+
<button type="button" :disabled="item.disabled || disabled" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || disabled })">
|
|
78
|
+
<slot :name="item.slot || 'item'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
79
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
80
|
+
<UIcon
|
|
81
|
+
v-if="item.icon"
|
|
82
|
+
:name="item.icon"
|
|
83
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
84
|
+
/>
|
|
85
|
+
<UIcon
|
|
86
|
+
v-else-if="item.children?.length"
|
|
87
|
+
:name="isExpanded ? expandedIcon ?? appConfig.ui.icons.folderOpen : collapsedIcon ?? appConfig.ui.icons.folder"
|
|
88
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
89
|
+
/>
|
|
94
90
|
</slot>
|
|
95
|
-
</span>
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
92
|
+
<span v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
|
|
93
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
94
|
+
{{ getItemLabel(item) }}
|
|
95
|
+
</slot>
|
|
96
|
+
</span>
|
|
97
|
+
|
|
98
|
+
<span v-if="item.trailingIcon || item.children?.length || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })">
|
|
99
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="item">
|
|
100
|
+
<UIcon v-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })" />
|
|
101
|
+
<UIcon v-else-if="item.children?.length" :name="trailingIcon ?? appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })" />
|
|
102
|
+
</slot>
|
|
103
|
+
</span>
|
|
104
|
+
</slot>
|
|
105
|
+
</button>
|
|
106
|
+
</slot>
|
|
105
107
|
|
|
106
108
|
<ul v-if="item.children?.length && isExpanded" :class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })">
|
|
107
109
|
<ReuseTreeTemplate :items="item.children" :level="level + 1" />
|
|
@@ -85,6 +85,7 @@ type SlotProps<T extends TreeItem> = (props: {
|
|
|
85
85
|
selected: boolean;
|
|
86
86
|
}) => any;
|
|
87
87
|
export type TreeSlots<A extends TreeItem[] = TreeItem[], T extends NestedItem<A> = NestedItem<A>> = {
|
|
88
|
+
'item-wrapper': SlotProps<T>;
|
|
88
89
|
'item': SlotProps<T>;
|
|
89
90
|
'item-leading': SlotProps<T>;
|
|
90
91
|
'item-label': SlotProps<T>;
|
|
@@ -4,7 +4,13 @@ function parseAcceptToDataTypes(accept) {
|
|
|
4
4
|
if (!accept || accept === "*") {
|
|
5
5
|
return void 0;
|
|
6
6
|
}
|
|
7
|
-
const types = accept.split(",").map((type) =>
|
|
7
|
+
const types = accept.split(",").map((type) => {
|
|
8
|
+
const trimmedType = type.trim();
|
|
9
|
+
if (trimmedType.includes("/") && trimmedType.endsWith("/*")) {
|
|
10
|
+
return trimmedType.split("/")[0] || trimmedType;
|
|
11
|
+
}
|
|
12
|
+
return trimmedType;
|
|
13
|
+
}).filter((type) => {
|
|
8
14
|
return !type.startsWith(".");
|
|
9
15
|
});
|
|
10
16
|
return types.length > 0 ? types : void 0;
|
|
@@ -50,7 +50,7 @@ type OverlayInstance<T extends Component> = Omit<ManagedOverlayOptionsPrivate<T>
|
|
|
50
50
|
};
|
|
51
51
|
type OpenedOverlay<T extends Component> = Omit<OverlayInstance<T>, 'open' | 'close' | 'patch' | 'modelValue' | 'resolvePromise'> & {
|
|
52
52
|
result: Promise<CloseEventArgType<ComponentEmit<T>>>;
|
|
53
|
-
}
|
|
53
|
+
} & Promise<CloseEventArgType<ComponentEmit<T>>>;
|
|
54
54
|
declare function _useOverlay(): {
|
|
55
55
|
overlays: import("vue").ShallowReactive<Overlay[]>;
|
|
56
56
|
open: <T extends Component>(id: symbol, props?: ComponentProps<T>) => OpenedOverlay<T>;
|
|
@@ -30,12 +30,13 @@ function _useOverlay() {
|
|
|
30
30
|
}
|
|
31
31
|
overlay.isOpen = true;
|
|
32
32
|
overlay.isMounted = true;
|
|
33
|
-
|
|
33
|
+
const result = new Promise((resolve) => overlay.resolvePromise = resolve);
|
|
34
|
+
return Object.assign(result, {
|
|
34
35
|
id,
|
|
35
36
|
isMounted: overlay.isMounted,
|
|
36
37
|
isOpen: overlay.isOpen,
|
|
37
|
-
result
|
|
38
|
-
};
|
|
38
|
+
result
|
|
39
|
+
});
|
|
39
40
|
};
|
|
40
41
|
const close = (id, value) => {
|
|
41
42
|
const overlay = getOverlay(id);
|
|
@@ -51,6 +51,9 @@ export default defineLocale({
|
|
|
51
51
|
},
|
|
52
52
|
table: {
|
|
53
53
|
noData: "\u0394\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03C5\u03BD \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1"
|
|
54
|
+
},
|
|
55
|
+
fileUpload: {
|
|
56
|
+
removeFile: "\u0391\u03C6\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7 {filename}"
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
});
|