@byyuurin/ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +2 -2
- package/dist/runtime/components/Accordion.vue.d.ts +11 -7
- package/dist/runtime/components/Alert.vue +2 -1
- package/dist/runtime/components/Alert.vue.d.ts +4 -4
- package/dist/runtime/components/App.vue +2 -1
- package/dist/runtime/components/App.vue.d.ts +11 -7
- package/dist/runtime/components/Avatar.vue +2 -1
- package/dist/runtime/components/Avatar.vue.d.ts +4 -3
- package/dist/runtime/components/AvatarGroup.vue +2 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +4 -3
- package/dist/runtime/components/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/Breadcrumb.vue +2 -2
- package/dist/runtime/components/Breadcrumb.vue.d.ts +10 -6
- package/dist/runtime/components/Button.vue +8 -8
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Calendar.vue.d.ts +16 -12
- package/dist/runtime/components/Card.vue +2 -1
- package/dist/runtime/components/Card.vue.d.ts +1 -1
- package/dist/runtime/components/Carousel.vue +2 -1
- package/dist/runtime/components/Carousel.vue.d.ts +14 -10
- package/dist/runtime/components/Checkbox.vue +4 -2
- package/dist/runtime/components/Checkbox.vue.d.ts +4 -3
- package/dist/runtime/components/CheckboxGroup.vue +4 -3
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +11 -7
- package/dist/runtime/components/Chip.vue +5 -1
- package/dist/runtime/components/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/Collapsible.vue +2 -1
- package/dist/runtime/components/Collapsible.vue.d.ts +2 -2
- package/dist/runtime/components/Drawer.vue +2 -1
- package/dist/runtime/components/Drawer.vue.d.ts +6 -6
- package/dist/runtime/components/DropdownMenu.vue +3 -3
- package/dist/runtime/components/DropdownMenu.vue.d.ts +17 -9
- package/dist/runtime/components/DropdownMenuContent.vue +11 -12
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +11 -7
- package/dist/runtime/components/FieldGroup.vue +2 -1
- package/dist/runtime/components/FieldGroup.vue.d.ts +2 -2
- package/dist/runtime/components/FileUpload.vue +267 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +178 -0
- package/dist/runtime/components/Form.vue +2 -1
- package/dist/runtime/components/Form.vue.d.ts +13 -8
- package/dist/runtime/components/FormField.vue +6 -4
- package/dist/runtime/components/FormField.vue.d.ts +7 -2
- package/dist/runtime/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/Input.vue +4 -4
- package/dist/runtime/components/Input.vue.d.ts +16 -12
- package/dist/runtime/components/InputNumber.vue +3 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +128 -124
- package/dist/runtime/components/InputTags.vue +2 -1
- package/dist/runtime/components/InputTags.vue.d.ts +16 -11
- package/dist/runtime/components/Kbd.vue +2 -1
- package/dist/runtime/components/Kbd.vue.d.ts +2 -2
- package/dist/runtime/components/Link.vue +5 -3
- package/dist/runtime/components/Link.vue.d.ts +16 -6
- package/dist/runtime/components/LinkBase.vue.d.ts +2 -2
- package/dist/runtime/components/Marquee.vue +2 -1
- package/dist/runtime/components/Marquee.vue.d.ts +3 -3
- package/dist/runtime/components/Modal.vue +3 -2
- package/dist/runtime/components/Modal.vue.d.ts +6 -6
- package/dist/runtime/components/NavigationMenu.vue +2 -2
- package/dist/runtime/components/NavigationMenu.vue.d.ts +11 -7
- package/dist/runtime/components/Pagination.vue +2 -1
- package/dist/runtime/components/Pagination.vue.d.ts +4 -4
- package/dist/runtime/components/PinInput.vue +4 -4
- package/dist/runtime/components/PinInput.vue.d.ts +14 -10
- package/dist/runtime/components/Popover.vue +1 -1
- package/dist/runtime/components/Popover.vue.d.ts +11 -7
- package/dist/runtime/components/Progress.vue +2 -1
- package/dist/runtime/components/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +3 -3
- package/dist/runtime/components/RadioGroup.vue.d.ts +11 -7
- package/dist/runtime/components/ScrollArea.vue +2 -1
- package/dist/runtime/components/ScrollArea.vue.d.ts +2 -2
- package/dist/runtime/components/Select.vue +282 -131
- package/dist/runtime/components/Select.vue.d.ts +103 -123
- package/dist/runtime/components/Separator.vue +2 -1
- package/dist/runtime/components/Separator.vue.d.ts +2 -2
- package/dist/runtime/components/Skeleton.vue +2 -1
- package/dist/runtime/components/Skeleton.vue.d.ts +2 -2
- package/dist/runtime/components/Slider.vue +2 -1
- package/dist/runtime/components/Slider.vue.d.ts +11 -7
- package/dist/runtime/components/Stepper.vue +117 -0
- package/dist/runtime/components/Stepper.vue.d.ts +83 -0
- package/dist/runtime/components/Switch.vue +3 -4
- package/dist/runtime/components/Switch.vue.d.ts +4 -3
- package/dist/runtime/components/Table.vue +2 -1
- package/dist/runtime/components/Table.vue.d.ts +13 -8
- package/dist/runtime/components/Tabs.vue +2 -2
- package/dist/runtime/components/Tabs.vue.d.ts +12 -8
- package/dist/runtime/components/Textarea.vue +3 -3
- package/dist/runtime/components/Textarea.vue.d.ts +16 -11
- package/dist/runtime/components/Timeline.vue +2 -1
- package/dist/runtime/components/Timeline.vue.d.ts +11 -7
- package/dist/runtime/components/Toast.vue +2 -1
- package/dist/runtime/components/Toast.vue.d.ts +5 -5
- package/dist/runtime/components/ToastProvider.vue +2 -2
- package/dist/runtime/components/ToastProvider.vue.d.ts +3 -3
- package/dist/runtime/components/Tooltip.vue +4 -4
- package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/components/Tree.vue +241 -0
- package/dist/runtime/components/Tree.vue.d.ts +121 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -0
- package/dist/runtime/composables/defineShortcuts.js +44 -8
- package/dist/runtime/composables/useFileUpload.d.ts +19 -0
- package/dist/runtime/composables/useFileUpload.js +79 -0
- package/dist/runtime/composables/useLocale.d.ts +18 -0
- package/dist/runtime/locale/en.d.ts +9 -0
- package/dist/runtime/locale/en.js +9 -0
- package/dist/runtime/locale/zh_tw.d.ts +9 -0
- package/dist/runtime/locale/zh_tw.js +9 -0
- package/dist/runtime/types/html.d.ts +8 -0
- package/dist/runtime/types/html.js +0 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/runtime/types/input.d.ts +5 -5
- package/dist/runtime/types/locale.d.ts +9 -0
- package/dist/runtime/types/utils.d.ts +4 -4
- package/dist/runtime/utils/index.d.ts +3 -3
- package/dist/runtime/utils/link.d.ts +2 -1
- package/dist/runtime/utils/link.js +40 -29
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/vue/components/Link.vue +7 -12
- package/dist/runtime/vue/components/Link.vue.d.ts +11 -40
- package/dist/setup.d.mts +1 -1
- package/dist/shared/{ui.DpbffTXs.d.mts → ui.CGCKYv7g.d.mts} +6 -2
- package/dist/shared/{ui.CzIlLITK.mjs → ui.DYMXCXO6.mjs} +9 -5
- package/dist/shared/{ui.DLOxhmP0.mjs → ui.DcEKQd0n.mjs} +490 -20
- package/dist/unocss.mjs +1 -1
- package/dist/unplugin.d.mts +1 -1
- package/dist/unplugin.mjs +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +31 -31
|
@@ -8,6 +8,7 @@ import { CheckboxIndicator, CheckboxRoot, Label, Primitive, useForwardProps } fr
|
|
|
8
8
|
import { computed, useId } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
import Icon from "./Icon.vue";
|
|
13
14
|
defineOptions({ inheritAttrs: false });
|
|
@@ -35,14 +36,15 @@ const emit = defineEmits(["update:modelValue", "change"]);
|
|
|
35
36
|
const slots = defineSlots();
|
|
36
37
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
37
38
|
const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue"));
|
|
38
|
-
const { id: _id, size,
|
|
39
|
+
const { id: _id, name, size, color, disabled, ariaAttrs, emitFormChange, emitFormInput } = useFormField(props);
|
|
39
40
|
const id = _id.value ?? useId();
|
|
40
41
|
const appConfig = useAppConfig();
|
|
41
42
|
const ui = computed(() => {
|
|
42
43
|
const styler = cv(merge(theme, appConfig.ui.checkbox));
|
|
43
44
|
return styler({
|
|
44
|
-
...props,
|
|
45
|
+
...pick(props, ["variant", "indicator", "required"]),
|
|
45
46
|
size: size.value,
|
|
47
|
+
color: color.value,
|
|
46
48
|
disabled: disabled.value
|
|
47
49
|
});
|
|
48
50
|
});
|
|
@@ -2,9 +2,10 @@ import type { VariantProps } from '@byyuurin/ui-kit';
|
|
|
2
2
|
import type { CheckboxRootEmits, CheckboxRootProps, PrimitiveProps } from 'reka-ui';
|
|
3
3
|
import theme from '#build/ui/checkbox';
|
|
4
4
|
import type { ComponentBaseProps, ComponentUIProps, IconProps } from '../types';
|
|
5
|
+
import type { ButtonHTMLAttributes } from '../types/html';
|
|
5
6
|
import type { StaticSlot } from '../types/utils';
|
|
6
7
|
type ThemeVariants = VariantProps<typeof theme>;
|
|
7
|
-
export interface CheckboxProps extends ComponentBaseProps, Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'> {
|
|
8
|
+
export interface CheckboxProps extends ComponentBaseProps, Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled' | 'value' | 'name'> {
|
|
8
9
|
/**
|
|
9
10
|
* The element or component this component should render as.
|
|
10
11
|
* @default "div"
|
|
@@ -44,6 +45,8 @@ export interface CheckboxSlots {
|
|
|
44
45
|
description?: string;
|
|
45
46
|
}>;
|
|
46
47
|
}
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
export default _default;
|
|
47
50
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CheckboxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
51
|
change: (event: Event) => any;
|
|
49
52
|
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
@@ -54,8 +57,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Checkb
|
|
|
54
57
|
disabled: boolean;
|
|
55
58
|
required: boolean;
|
|
56
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CheckboxSlots>;
|
|
57
|
-
declare const _default: typeof __VLS_export;
|
|
58
|
-
export default _default;
|
|
59
60
|
type __VLS_WithSlots<T, S> = T & {
|
|
60
61
|
new (): {
|
|
61
62
|
$slots: S;
|
|
@@ -8,7 +8,7 @@ import { CheckboxGroupRoot, useForwardProps, useForwardPropsEmits } from "reka-u
|
|
|
8
8
|
import { computed, useId } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
-
import { get, omit } from "../utils";
|
|
11
|
+
import { get, omit, pick } from "../utils";
|
|
12
12
|
import { cv, merge } from "../utils/style";
|
|
13
13
|
import Checkbox from "./Checkbox.vue";
|
|
14
14
|
const props = defineProps({
|
|
@@ -91,9 +91,10 @@ const appConfig = useAppConfig();
|
|
|
91
91
|
const ui = computed(() => {
|
|
92
92
|
const styler = cv(merge(theme, appConfig.ui.checkboxGroup));
|
|
93
93
|
return styler({
|
|
94
|
-
...props,
|
|
94
|
+
...pick(props, ["required", "orientation", "variant"]),
|
|
95
95
|
size: size.value,
|
|
96
|
-
color: color.value
|
|
96
|
+
color: color.value,
|
|
97
|
+
disabled: disabled.value
|
|
97
98
|
});
|
|
98
99
|
});
|
|
99
100
|
</script>
|
|
@@ -70,11 +70,15 @@ export interface CheckboxGroupSlots<T extends CheckboxGroupItem[] = CheckboxGrou
|
|
|
70
70
|
};
|
|
71
71
|
}>;
|
|
72
72
|
}
|
|
73
|
-
declare const
|
|
74
|
-
|
|
73
|
+
declare const _default: typeof __VLS_export;
|
|
74
|
+
export default _default;
|
|
75
|
+
declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__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<{
|
|
76
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<CheckboxGroupProps<T, VK> & {
|
|
75
77
|
onChange?: ((event: Event) => any) | undefined;
|
|
76
78
|
"onUpdate:modelValue"?: ((value: T[number][]) => any) | undefined;
|
|
77
|
-
}> &
|
|
79
|
+
}> & (typeof globalThis extends {
|
|
80
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
81
|
+
} ? P : {});
|
|
78
82
|
expose: (exposed: {}) => void;
|
|
79
83
|
attrs: any;
|
|
80
84
|
slots: CheckboxGroupSlots<CheckboxGroupItem[]>;
|
|
@@ -82,8 +86,8 @@ declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKe
|
|
|
82
86
|
}>) => import("vue").VNode & {
|
|
83
87
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
84
88
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
90
|
+
[K in keyof T]: T[K];
|
|
91
|
+
} : {
|
|
88
92
|
[K in keyof T as K]: T[K];
|
|
89
|
-
} & {};
|
|
93
|
+
}) & {};
|
|
@@ -8,6 +8,7 @@ import { Primitive, Slot } from "reka-ui";
|
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useAvatarGroup } from "../composables/useAvatarGroup";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
defineOptions({ inheritAttrs: false });
|
|
13
14
|
const props = defineProps({
|
|
@@ -29,7 +30,10 @@ const { size } = useAvatarGroup(props);
|
|
|
29
30
|
const appConfig = useAppConfig();
|
|
30
31
|
const ui = computed(() => {
|
|
31
32
|
const styler = cv(merge(theme, appConfig.ui.chip));
|
|
32
|
-
return styler({
|
|
33
|
+
return styler({
|
|
34
|
+
...pick(props, ["color", "position", "inset", "standalone"]),
|
|
35
|
+
size: size.value
|
|
36
|
+
});
|
|
33
37
|
});
|
|
34
38
|
</script>
|
|
35
39
|
|
|
@@ -32,6 +32,8 @@ export interface ChipSlots {
|
|
|
32
32
|
default: StaticSlot;
|
|
33
33
|
content: StaticSlot;
|
|
34
34
|
}
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
35
37
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
38
|
"update:show": (show: boolean) => any;
|
|
37
39
|
}, string, import("vue").PublicProps, Readonly<ChipProps> & Readonly<{
|
|
@@ -39,8 +41,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChipPr
|
|
|
39
41
|
}>, {
|
|
40
42
|
show: boolean;
|
|
41
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChipSlots>;
|
|
42
|
-
declare const _default: typeof __VLS_export;
|
|
43
|
-
export default _default;
|
|
44
44
|
type __VLS_WithSlots<T, S> = T & {
|
|
45
45
|
new (): {
|
|
46
46
|
$slots: S;
|
|
@@ -7,6 +7,7 @@ import { reactivePick } from "@vueuse/core";
|
|
|
7
7
|
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
+
import { pick } from "../utils";
|
|
10
11
|
import { cv, merge } from "../utils/style";
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
as: { type: null, required: false },
|
|
@@ -23,7 +24,7 @@ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultOpen",
|
|
|
23
24
|
const appConfig = useAppConfig();
|
|
24
25
|
const ui = computed(() => {
|
|
25
26
|
const styler = cv(merge(theme, appConfig.ui.collapsible));
|
|
26
|
-
return styler(props);
|
|
27
|
+
return styler(pick(props, []));
|
|
27
28
|
});
|
|
28
29
|
</script>
|
|
29
30
|
|
|
@@ -18,6 +18,8 @@ export interface CollapsibleSlots {
|
|
|
18
18
|
}>;
|
|
19
19
|
content: StaticSlot;
|
|
20
20
|
}
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
21
23
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
24
|
"update:open": (value: boolean) => any;
|
|
23
25
|
}, string, import("vue").PublicProps, Readonly<CollapsibleProps> & Readonly<{
|
|
@@ -25,8 +27,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Collap
|
|
|
25
27
|
}>, {
|
|
26
28
|
unmountOnHide: boolean;
|
|
27
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CollapsibleSlots>;
|
|
28
|
-
declare const _default: typeof __VLS_export;
|
|
29
|
-
export default _default;
|
|
30
30
|
type __VLS_WithSlots<T, S> = T & {
|
|
31
31
|
new (): {
|
|
32
32
|
$slots: S;
|
|
@@ -9,6 +9,7 @@ import { computed, toRef } from "vue";
|
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
11
|
import { usePortal } from "../composables/usePortal";
|
|
12
|
+
import { pick } from "../utils";
|
|
12
13
|
import { cv, merge } from "../utils/style";
|
|
13
14
|
import Button from "./Button.vue";
|
|
14
15
|
const props = defineProps({
|
|
@@ -53,7 +54,7 @@ const { t } = useLocale();
|
|
|
53
54
|
const appConfig = useAppConfig();
|
|
54
55
|
const ui = computed(() => {
|
|
55
56
|
const styler = cv(merge(theme, appConfig.ui.drawer));
|
|
56
|
-
return styler(props);
|
|
57
|
+
return styler(pick(props, ["transition", "direction", "inset"]));
|
|
57
58
|
});
|
|
58
59
|
</script>
|
|
59
60
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VariantProps } from '@byyuurin/ui-kit';
|
|
2
2
|
import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
3
3
|
import theme from '#build/ui/drawer';
|
|
4
|
-
import type { ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
|
|
4
|
+
import type { ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps, LinkPropsKeys } from '../types';
|
|
5
5
|
import type { EmitsToProps, StaticSlot } from '../types/utils';
|
|
6
6
|
type ThemeVariants = VariantProps<typeof theme>;
|
|
7
7
|
export interface DrawerProps extends ComponentBaseProps, DialogRootProps {
|
|
@@ -37,7 +37,7 @@ export interface DrawerProps extends ComponentBaseProps, DialogRootProps {
|
|
|
37
37
|
* Display a close button to dismiss the drawer.
|
|
38
38
|
* @default true
|
|
39
39
|
*/
|
|
40
|
-
close?: boolean |
|
|
40
|
+
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
41
41
|
/** @default app.icons.close */
|
|
42
42
|
closeIcon?: IconProps['name'];
|
|
43
43
|
/**
|
|
@@ -75,6 +75,8 @@ export interface DrawerSlots {
|
|
|
75
75
|
close: () => void;
|
|
76
76
|
}>;
|
|
77
77
|
}
|
|
78
|
+
declare const _default: typeof __VLS_export;
|
|
79
|
+
export default _default;
|
|
78
80
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
79
81
|
"update:open": (value: boolean) => any;
|
|
80
82
|
"after-leave": () => any;
|
|
@@ -86,16 +88,14 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Drawer
|
|
|
86
88
|
"onAfter-enter"?: (() => any) | undefined;
|
|
87
89
|
"onClose-prevent"?: (() => any) | undefined;
|
|
88
90
|
}>, {
|
|
89
|
-
|
|
90
|
-
close: boolean | Partial<ButtonProps>;
|
|
91
|
+
close: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
91
92
|
transition: boolean;
|
|
93
|
+
overlay: boolean;
|
|
92
94
|
direction: "top" | "right" | "bottom" | "left";
|
|
93
95
|
modal: boolean;
|
|
94
96
|
portal: boolean | string | HTMLElement;
|
|
95
97
|
dismissible: boolean;
|
|
96
98
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DrawerSlots>;
|
|
97
|
-
declare const _default: typeof __VLS_export;
|
|
98
|
-
export default _default;
|
|
99
99
|
type __VLS_WithSlots<T, S> = T & {
|
|
100
100
|
new (): {
|
|
101
101
|
$slots: S;
|
|
@@ -7,7 +7,7 @@ import { reactivePick } from "@vueuse/core";
|
|
|
7
7
|
import { DropdownMenuArrow, DropdownMenuRoot, DropdownMenuTrigger, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { computed, toRef } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import { omit } from "../utils";
|
|
10
|
+
import { omit, pick } from "../utils";
|
|
11
11
|
import { cv, merge } from "../utils/style";
|
|
12
12
|
import DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
13
13
|
const props = defineProps({
|
|
@@ -26,7 +26,7 @@ const props = defineProps({
|
|
|
26
26
|
class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
|
|
27
27
|
defaultOpen: { type: Boolean, required: false },
|
|
28
28
|
open: { type: Boolean, required: false },
|
|
29
|
-
modal: { type: Boolean, required: false, default:
|
|
29
|
+
modal: { type: Boolean, required: false, default: false }
|
|
30
30
|
});
|
|
31
31
|
const emit = defineEmits(["update:open"]);
|
|
32
32
|
const slots = defineSlots();
|
|
@@ -37,7 +37,7 @@ const getProxySlots = () => omit(slots, ["default"]);
|
|
|
37
37
|
const appConfig = useAppConfig();
|
|
38
38
|
const ui = computed(() => {
|
|
39
39
|
const styler = cv(merge(theme, appConfig.ui.dropdownMenu));
|
|
40
|
-
return styler(props);
|
|
40
|
+
return styler(pick(props, ["size"]));
|
|
41
41
|
});
|
|
42
42
|
</script>
|
|
43
43
|
|
|
@@ -112,8 +112,12 @@ export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayO
|
|
|
112
112
|
index: number;
|
|
113
113
|
ui: ComponentStyler<typeof theme>;
|
|
114
114
|
}>;
|
|
115
|
-
'content-top': StaticSlot
|
|
116
|
-
|
|
115
|
+
'content-top': StaticSlot<{
|
|
116
|
+
sub: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
'content-bottom': StaticSlot<{
|
|
119
|
+
sub: boolean;
|
|
120
|
+
}>;
|
|
117
121
|
} & DynamicSlots<MergeTypes<T>, 'label' | 'description', {
|
|
118
122
|
active?: boolean;
|
|
119
123
|
index: number;
|
|
@@ -122,10 +126,14 @@ export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayO
|
|
|
122
126
|
index: number;
|
|
123
127
|
ui: ComponentStyler<typeof theme>;
|
|
124
128
|
}>;
|
|
125
|
-
declare const
|
|
126
|
-
|
|
129
|
+
declare const _default: typeof __VLS_export;
|
|
130
|
+
export default _default;
|
|
131
|
+
declare const __VLS_export: <T extends ArrayOrNested<DropdownMenuItem>>(__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<{
|
|
132
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<DropdownMenuProps<T> & {
|
|
127
133
|
"onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
128
|
-
}> &
|
|
134
|
+
}> & (typeof globalThis extends {
|
|
135
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
136
|
+
} ? P : {});
|
|
129
137
|
expose: (exposed: {}) => void;
|
|
130
138
|
attrs: any;
|
|
131
139
|
slots: DropdownMenuSlots<T, NestedItem<T>>;
|
|
@@ -133,8 +141,8 @@ declare const __VLS_export: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_pr
|
|
|
133
141
|
}>) => import("vue").VNode & {
|
|
134
142
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
135
143
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
145
|
+
[K in keyof T]: T[K];
|
|
146
|
+
} : {
|
|
139
147
|
[K in keyof T as K]: T[K];
|
|
140
|
-
} & {};
|
|
148
|
+
}) & {};
|
|
@@ -141,7 +141,7 @@ const groups = computed(
|
|
|
141
141
|
|
|
142
142
|
<DropdownMenu.Portal v-bind="portalProps">
|
|
143
143
|
<component :is="props.sub ? DropdownMenu.SubContent : DropdownMenu.Content" v-bind="{ ...contentProps, ...$attrs }" :class="props.class">
|
|
144
|
-
<slot name="content-top"></slot>
|
|
144
|
+
<slot name="content-top" :sub="props.sub ?? false"></slot>
|
|
145
145
|
|
|
146
146
|
<div role="presentation" :class="props.ui.viewport({ class: props.uiOverride?.viewport })" data-part="viewport">
|
|
147
147
|
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="props.ui.group({ class: props.uiOverride?.group })" data-part="group">
|
|
@@ -197,26 +197,25 @@ const groups = computed(
|
|
|
197
197
|
>
|
|
198
198
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
199
199
|
</DropdownMenu.CheckboxItem>
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
200
|
+
<Link v-else v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
201
|
+
<DropdownMenu.Item
|
|
202
|
+
as-child
|
|
203
|
+
:disabled="item.disabled"
|
|
204
|
+
:text-value="get(item, props.labelKey)"
|
|
205
|
+
@select="item.onSelect"
|
|
206
|
+
>
|
|
208
207
|
<LinkBase v-bind="slotProps" :class="props.ui.item({ class: [props.uiOverride?.item, item.ui?.item, item.class], color: item.color, active })" data-part="item">
|
|
209
208
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
210
209
|
</LinkBase>
|
|
211
|
-
</
|
|
212
|
-
</
|
|
210
|
+
</DropdownMenu.Item>
|
|
211
|
+
</Link>
|
|
213
212
|
</template>
|
|
214
213
|
</DropdownMenu.Group>
|
|
215
214
|
</div>
|
|
216
215
|
|
|
217
216
|
<slot></slot>
|
|
218
217
|
|
|
219
|
-
<slot name="content-bottom"></slot>
|
|
218
|
+
<slot name="content-bottom" :sub="props.sub ?? false"></slot>
|
|
220
219
|
</component>
|
|
221
220
|
</DropdownMenu.Portal>
|
|
222
221
|
</template>
|
|
@@ -29,14 +29,18 @@ export type DropdownMenuContentSlots<A extends ArrayOrNested<DropdownMenuItem> =
|
|
|
29
29
|
index: number;
|
|
30
30
|
ui: ComponentStyler<typeof theme>;
|
|
31
31
|
}>;
|
|
32
|
-
declare const
|
|
33
|
-
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
declare const __VLS_export: <T extends ArrayOrNested<DropdownMenuItem>>(__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<{
|
|
35
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<DropdownMenuContentProps<T> & {
|
|
34
36
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
35
37
|
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
36
38
|
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
37
39
|
onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
38
40
|
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
39
|
-
}> &
|
|
41
|
+
}> & (typeof globalThis extends {
|
|
42
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
43
|
+
} ? P : {});
|
|
40
44
|
expose: (exposed: {}) => void;
|
|
41
45
|
attrs: any;
|
|
42
46
|
slots: DropdownMenuContentSlots<T, NestedItem<T>>;
|
|
@@ -44,8 +48,8 @@ declare const __VLS_export: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_pr
|
|
|
44
48
|
}>) => import("vue").VNode & {
|
|
45
49
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
46
50
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} : {
|
|
50
54
|
[K in keyof T as K]: T[K];
|
|
51
|
-
} & {};
|
|
55
|
+
}) & {};
|
|
@@ -7,6 +7,7 @@ import { Primitive } from "reka-ui";
|
|
|
7
7
|
import { computed } from "vue";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { provideFieldGroup } from "../composables/useFieldGroup";
|
|
10
|
+
import { pick } from "../utils";
|
|
10
11
|
import { cv, merge } from "../utils/style";
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
as: { type: null, required: false },
|
|
@@ -18,7 +19,7 @@ defineSlots();
|
|
|
18
19
|
const appConfig = useAppConfig();
|
|
19
20
|
const ui = computed(() => {
|
|
20
21
|
const styler = cv(merge(theme, appConfig.ui.fieldGroup));
|
|
21
|
-
return styler(props);
|
|
22
|
+
return styler(pick(props, ["orientation", "size"]));
|
|
22
23
|
});
|
|
23
24
|
provideFieldGroup(computed(() => ({
|
|
24
25
|
orientation: props.orientation,
|
|
@@ -21,11 +21,11 @@ export interface FieldGroupProps extends ComponentBaseProps {
|
|
|
21
21
|
export interface FieldGroupSlots {
|
|
22
22
|
default: StaticSlot;
|
|
23
23
|
}
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
24
26
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<FieldGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FieldGroupProps> & Readonly<{}>, {
|
|
25
27
|
orientation: "horizontal" | "vertical";
|
|
26
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FieldGroupSlots>;
|
|
27
|
-
declare const _default: typeof __VLS_export;
|
|
28
|
-
export default _default;
|
|
29
29
|
type __VLS_WithSlots<T, S> = T & {
|
|
30
30
|
new (): {
|
|
31
31
|
$slots: S;
|