@bridge-ui/vue 0.25.0 → 0.26.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/dist/Components/ActionFooter/ActionFooter.vue.d.ts +2 -2
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +4 -4
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +62 -58
- package/dist/Components/Calendar/calendar.types.d.ts +8 -0
- package/dist/Components/Calendar/composables/useCalendar.d.ts +2 -1
- package/dist/Components/Calendar/composables/useCalendar.js +188 -177
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +96 -92
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +8 -0
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +2 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +203 -220
- package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +2 -2
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
- package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +2 -2
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +2 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/List/composables/useList.d.ts +1 -1
- package/dist/Components/List/composables/useList.js +5 -1
- package/dist/Components/List/index.d.ts +1 -1
- package/dist/Components/List/list.types.d.ts +10 -1
- package/dist/Components/List/listInjectionKey.d.ts +2 -0
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -2
- package/dist/Components/ListItem/composables/useListItem.js +92 -86
- package/dist/Components/ListItem/listItem.types.d.ts +8 -0
- package/dist/Components/ListSection/composables/useListSection.js +31 -29
- package/dist/Components/Listbox/Listbox.vue.d.ts +2 -2
- package/dist/Components/Listbox/listbox.types.d.ts +2 -2
- package/dist/Components/Modal/Modal.vue.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Pagination/Pagination.vue.d.ts +2 -2
- package/dist/Components/Select/Select.vue.d.ts +4 -4
- package/dist/Components/Sidebar/SidebarList.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +2 -2
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
- package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -2
- package/dist/Utils/index.d.ts +2 -0
- package/dist/Utils/index.js +40 -39
- package/dist/Utils/useWheelNavigation.d.ts +11 -0
- package/dist/Utils/useWheelNavigation.js +20 -0
- package/dist/augments.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/docs/components/Calendar.md +31 -30
- package/docs/components/CalendarRange.md +29 -28
- package/docs/components/List.md +43 -27
- package/package.json +2 -2
|
@@ -7,18 +7,18 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
9
|
clear: () => any;
|
|
10
|
-
apply: () => any;
|
|
11
10
|
cancel: () => any;
|
|
12
11
|
change: (value: Date | null) => any;
|
|
13
12
|
close: () => any;
|
|
13
|
+
apply: () => any;
|
|
14
14
|
open: () => any;
|
|
15
15
|
"update:modelValue": (value: Date | null | undefined) => any;
|
|
16
16
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
17
|
onClear?: (() => any) | undefined;
|
|
18
|
-
onApply?: (() => any) | undefined;
|
|
19
18
|
onCancel?: (() => any) | undefined;
|
|
20
19
|
onChange?: ((value: Date | null) => any) | undefined;
|
|
21
20
|
onClose?: (() => any) | undefined;
|
|
21
|
+
onApply?: (() => any) | undefined;
|
|
22
22
|
onOpen?: (() => any) | undefined;
|
|
23
23
|
"onUpdate:modelValue"?: ((value: Date | null | undefined) => any) | undefined;
|
|
24
24
|
}>, {
|
|
@@ -6,14 +6,14 @@ type __VLS_ModelProps = {
|
|
|
6
6
|
};
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
-
apply: () => any;
|
|
10
9
|
cancel: () => any;
|
|
11
10
|
change: (value: Date | null) => any;
|
|
11
|
+
apply: () => any;
|
|
12
12
|
"update:modelValue": (...args: unknown[]) => any;
|
|
13
13
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
-
onApply?: (() => any) | undefined;
|
|
15
14
|
onCancel?: (() => any) | undefined;
|
|
16
15
|
onChange?: ((value: Date | null) => any) | undefined;
|
|
16
|
+
onApply?: (() => any) | undefined;
|
|
17
17
|
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
19
|
showFooter: boolean;
|
package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -62,6 +62,7 @@ var w = /*@__PURE__*/ d({
|
|
|
62
62
|
defaultView: "date"
|
|
63
63
|
}, O, T);
|
|
64
64
|
return (n, a) => (_(), s("div", g(f(x(A))), [c("div", { class: h(x(P)) }, [c("div", { class: h(x(L)) }, [u(t, {
|
|
65
|
+
"wheel-navigation": "",
|
|
65
66
|
fill: x(k).fill,
|
|
66
67
|
color: x(k).color,
|
|
67
68
|
error: x(k).error,
|
|
@@ -8,18 +8,18 @@ type __VLS_ModelProps = {
|
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
10
|
clear: () => any;
|
|
11
|
-
apply: () => any;
|
|
12
11
|
cancel: () => any;
|
|
13
12
|
change: (value: DateRangeValue | null) => any;
|
|
14
13
|
close: () => any;
|
|
14
|
+
apply: () => any;
|
|
15
15
|
open: () => any;
|
|
16
16
|
"update:modelValue": (value: DateRangeValue | null | undefined) => any;
|
|
17
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
18
|
onClear?: (() => any) | undefined;
|
|
19
|
-
onApply?: (() => any) | undefined;
|
|
20
19
|
onCancel?: (() => any) | undefined;
|
|
21
20
|
onChange?: ((value: DateRangeValue | null) => any) | undefined;
|
|
22
21
|
onClose?: (() => any) | undefined;
|
|
22
|
+
onApply?: (() => any) | undefined;
|
|
23
23
|
onOpen?: (() => any) | undefined;
|
|
24
24
|
"onUpdate:modelValue"?: ((value: DateRangeValue | null | undefined) => any) | undefined;
|
|
25
25
|
}>, {
|
|
@@ -7,14 +7,14 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
};
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
-
apply: () => any;
|
|
11
10
|
cancel: () => any;
|
|
12
11
|
change: (value: DateRangeValue | null) => any;
|
|
12
|
+
apply: () => any;
|
|
13
13
|
"update:modelValue": (...args: unknown[]) => any;
|
|
14
14
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
-
onApply?: (() => any) | undefined;
|
|
16
15
|
onCancel?: (() => any) | undefined;
|
|
17
16
|
onChange?: ((value: DateRangeValue | null) => any) | undefined;
|
|
17
|
+
onApply?: (() => any) | undefined;
|
|
18
18
|
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
showFooter: boolean;
|
|
@@ -62,6 +62,7 @@ var w = /*@__PURE__*/ d({
|
|
|
62
62
|
orientation: "horizontal"
|
|
63
63
|
}, O, T);
|
|
64
64
|
return (n, a) => (_(), s("div", g(f(x(A))), [c("div", { class: h(x(F)) }, [c("div", { class: h(x(R)) }, [u(t, {
|
|
65
|
+
"wheel-navigation": "",
|
|
65
66
|
fill: x(k).fill,
|
|
66
67
|
color: x(k).color,
|
|
67
68
|
error: x(k).error,
|
|
@@ -16,6 +16,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
16
16
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
17
17
|
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
|
+
scroll: keyof import('@bridge-ui/core/Tokens').DrawerScroll;
|
|
19
20
|
autoFocus: boolean;
|
|
20
21
|
closeOnEscape: boolean;
|
|
21
22
|
closeOnOverlay: boolean;
|
|
@@ -26,7 +27,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
26
27
|
keepMounted: boolean;
|
|
27
28
|
persistent: boolean;
|
|
28
29
|
placement: keyof import('@bridge-ui/core/Tokens').DrawerPlacement;
|
|
29
|
-
scroll: keyof import('@bridge-ui/core/Tokens').DrawerScroll;
|
|
30
30
|
teleportTo: string | false;
|
|
31
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -34,7 +34,7 @@ export declare function useDrawer(props: DrawerOwnProps, libDefaults: DrawerLibD
|
|
|
34
34
|
};
|
|
35
35
|
"aria-hidden": boolean | undefined;
|
|
36
36
|
class: string;
|
|
37
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<DrawerProps, "size" | "classes" | "customProps" | "transition" | "ariaLabel" | "ariaLabelledBy" | "autoFocus" | "
|
|
37
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<DrawerProps, "size" | "blur" | "scroll" | "classes" | "customProps" | "transition" | "ariaLabel" | "ariaLabelledBy" | "autoFocus" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "placement" | "stackId" | "teleportTo">>>;
|
|
38
38
|
panelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
39
39
|
"data-drawer-part": string;
|
|
40
40
|
"data-state": "open" | "closed";
|
|
@@ -3,5 +3,5 @@ export declare function useList(props: ListOwnProps): {
|
|
|
3
3
|
merged: import('vue').ComputedRef<ListOwnProps>;
|
|
4
4
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
5
5
|
class: string;
|
|
6
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
|
|
6
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "size" | "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
|
|
7
7
|
};
|
|
@@ -6,6 +6,7 @@ import { cn as l, splitComponentProps as u } from "@bridge-ui/core/Utils";
|
|
|
6
6
|
// src/Components/List/composables/useList.ts
|
|
7
7
|
var d = [
|
|
8
8
|
"as",
|
|
9
|
+
"size",
|
|
9
10
|
"dense",
|
|
10
11
|
"nested",
|
|
11
12
|
"classes",
|
|
@@ -24,7 +25,10 @@ function f(f) {
|
|
|
24
25
|
}), _ = i(() => h.value.customProps), v = r({
|
|
25
26
|
entry: g,
|
|
26
27
|
props: () => m.value.componentProps
|
|
27
|
-
}), y = i(() => ({
|
|
28
|
+
}), y = i(() => ({
|
|
29
|
+
size: h.value.size,
|
|
30
|
+
dense: h.value.dense === !0
|
|
31
|
+
}));
|
|
28
32
|
a(e, y);
|
|
29
33
|
let b = i(() => c(m.value.inheritedAttrs, []));
|
|
30
34
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useList } from './composables/useList';
|
|
2
|
-
export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, } from './list.types';
|
|
2
|
+
export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, ListSizeOverrides, } from './list.types';
|
|
3
3
|
export { default as List } from './List.vue';
|
|
4
4
|
export { LIST_INJECTION_KEY } from './listInjectionKey';
|
|
5
5
|
export type { ListContextValue } from './listInjectionKey';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { ListSize } from '@bridge-ui/core/Tokens';
|
|
3
|
+
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
4
|
+
export interface ListSizeOverrides {}
|
|
3
5
|
export interface ListClasses {
|
|
4
6
|
/**
|
|
5
7
|
* The classes to apply to the root.
|
|
@@ -46,5 +48,12 @@ export interface ListOwnProps {
|
|
|
46
48
|
* @default false
|
|
47
49
|
*/
|
|
48
50
|
nested?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Typography scale for items (`ListItem`) and section titles
|
|
53
|
+
* (`ListSection`). Items can override it with their own `size`.
|
|
54
|
+
*
|
|
55
|
+
* @default "md"
|
|
56
|
+
*/
|
|
57
|
+
size?: MergeProps<ListSize, ListSizeOverrides>;
|
|
49
58
|
}
|
|
50
59
|
export type ListProps = MergeHtmlProps<ListOwnProps, HTMLAttributes>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { ListOwnProps } from './list.types';
|
|
2
3
|
export type ListContextValue = {
|
|
3
4
|
dense: boolean;
|
|
5
|
+
size?: ListOwnProps["size"];
|
|
4
6
|
};
|
|
5
7
|
export declare const LIST_INJECTION_KEY: InjectionKey<ComputedRef<ListContextValue>>;
|
|
@@ -12,7 +12,7 @@ export declare function useListItem<T extends LinkAsTag = "a">(props: ListItemOw
|
|
|
12
12
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
13
13
|
class: string;
|
|
14
14
|
id: string | undefined;
|
|
15
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps<T>, "target" | "role" | "href" | "value" | "classes" | "primary" | "secondary" | "customProps" | "as" | "disabled" | "linkAs" | "linkProps" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
|
|
15
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps<T>, "target" | "role" | "href" | "size" | "value" | "classes" | "primary" | "secondary" | "customProps" | "as" | "disabled" | "linkAs" | "linkProps" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
|
|
16
16
|
rowClass: import('vue').ComputedRef<string>;
|
|
17
17
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
18
18
|
hasPrimary: import('vue').ComputedRef<boolean>;
|
|
@@ -36,7 +36,6 @@ export declare function useListItem<T extends LinkAsTag = "a">(props: ListItemOw
|
|
|
36
36
|
} & object & Record<"class", string>) | null>;
|
|
37
37
|
selectedIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
38
38
|
class: string;
|
|
39
|
-
size?: "sm" | undefined;
|
|
40
39
|
}, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
41
40
|
resolvedSelectedIcon: import('vue').ComputedRef<IconSource | null>;
|
|
42
41
|
};
|
|
@@ -5,14 +5,15 @@ import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistr
|
|
|
5
5
|
import { resolveLinkAsProps as o } from "../../../Utils/linkAs.js";
|
|
6
6
|
import { computed as s, getCurrentInstance as c, inject as l, onBeforeUnmount as u, toValue as d, useAttrs as f, watch as p } from "vue";
|
|
7
7
|
import { get as m, isNil as h, isNull as g, omit as _ } from "es-toolkit/compat";
|
|
8
|
-
import { getListboxOptionId as v, listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
|
|
9
|
-
import { cn as
|
|
8
|
+
import { getListboxOptionId as v, listboxOptionFromComposedItem as y, resolveListSizeClasses as b } from "@bridge-ui/core/Domain";
|
|
9
|
+
import { cn as x, splitComponentProps as ee } from "@bridge-ui/core/Utils";
|
|
10
10
|
// src/Components/ListItem/composables/useListItem.ts
|
|
11
11
|
var S = [
|
|
12
12
|
"as",
|
|
13
13
|
"rel",
|
|
14
14
|
"href",
|
|
15
15
|
"role",
|
|
16
|
+
"size",
|
|
16
17
|
"dense",
|
|
17
18
|
"value",
|
|
18
19
|
"linkAs",
|
|
@@ -29,132 +30,137 @@ var S = [
|
|
|
29
30
|
"selectedIcon"
|
|
30
31
|
];
|
|
31
32
|
function C(C, w, T) {
|
|
32
|
-
let E = f(), D = l(t, null), O = l(n, null), k = !h(O), A = s(() =>
|
|
33
|
+
let E = f(), D = l(t, null), O = l(n, null), k = !h(O), A = s(() => ee({
|
|
33
34
|
props: {
|
|
34
35
|
...E,
|
|
35
36
|
...C
|
|
36
37
|
},
|
|
37
38
|
bridgeKeys: S
|
|
38
|
-
})), { merged: j,
|
|
39
|
+
})), { merged: j, components: M, entry: N } = i({
|
|
39
40
|
libDefaults: w,
|
|
40
41
|
componentName: "ListItem",
|
|
41
42
|
props: () => A.value.componentProps
|
|
42
|
-
}),
|
|
43
|
+
}), P = s(() => O ? d(O) : null), F = s(() => k ? y({
|
|
43
44
|
value: j.value.value,
|
|
44
45
|
primary: j.value.primary,
|
|
45
46
|
disabled: j.value.disabled,
|
|
46
47
|
secondary: j.value.secondary
|
|
47
|
-
}) : null),
|
|
48
|
+
}) : null), I;
|
|
48
49
|
p(() => {
|
|
49
|
-
let e =
|
|
50
|
+
let e = F.value;
|
|
50
51
|
return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
|
|
51
52
|
}, () => {
|
|
52
|
-
|
|
53
|
-
let e =
|
|
54
|
-
e && O && (
|
|
53
|
+
I?.(), I = void 0;
|
|
54
|
+
let e = F.value;
|
|
55
|
+
e && O && (I = d(O).registerOption(e));
|
|
55
56
|
}, { immediate: !0 }), u(() => {
|
|
56
|
-
|
|
57
|
+
I?.();
|
|
57
58
|
});
|
|
58
|
-
let
|
|
59
|
-
entry:
|
|
59
|
+
let L = s(() => !h(F.value)), R = s(() => !F.value || !P.value ? !1 : P.value.isSelected(F.value.value)), z = s(() => !F.value || !P.value ? -1 : P.value.getOptionIndex(F.value.value)), B = s(() => !P.value || z.value < 0 ? !1 : P.value.highlightedIndex === z.value), V = s(() => j.value.customProps), H = a({
|
|
60
|
+
entry: N,
|
|
60
61
|
props: () => A.value.componentProps
|
|
61
|
-
}),
|
|
62
|
-
|
|
62
|
+
}), U = s(() => "dense" in (c()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? d(D).dense : !1), W = s(() => {
|
|
63
|
+
let e = k ? void 0 : j.value.size ?? (D ? d(D).size : void 0);
|
|
64
|
+
return b(M.value, e);
|
|
65
|
+
}), G = s(() => e(T, "primary") || e(T, "default") || !!j.value.primary), K = s(() => e(T, "secondary") || !!j.value.secondary), q = s(() => L.value ? !R.value || !P.value?.showCheckmark ? null : "check" : !j.value.selected || g(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), J = s(() => e(T, "end") || q.value != null), Y = s(() => _(A.value.inheritedAttrs, [])), X = s(() => r(V.value?.root, Y.value, {
|
|
66
|
+
class: x({
|
|
63
67
|
"list-none": !0,
|
|
64
68
|
"border-b border-black/10 last:border-b-0 dark:border-white/10": j.value.divider,
|
|
65
|
-
[m(
|
|
69
|
+
[m(H.value, "root") ?? ""]: !0
|
|
66
70
|
}),
|
|
67
|
-
id:
|
|
68
|
-
})),
|
|
69
|
-
if (!
|
|
70
|
-
let e = r(
|
|
71
|
+
id: L.value && P.value?.listboxId && z.value >= 0 ? v(P.value.listboxId, z.value) : void 0
|
|
72
|
+
})), Z = s(() => !!j.value.href && !L.value), Q = s(() => !!(j.value.interactive || L.value || Z.value)), $ = s(() => Z.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), te = s(() => {
|
|
73
|
+
if (!Q.value) return null;
|
|
74
|
+
let e = r(V.value?.interactive, o(j.value.linkAs, j.value.linkProps, $.value), {
|
|
71
75
|
"aria-disabled": j.value.disabled ? !0 : void 0,
|
|
72
|
-
rel:
|
|
73
|
-
"data-selected": j.value.selected ||
|
|
74
|
-
"aria-selected":
|
|
75
|
-
href:
|
|
76
|
-
target:
|
|
77
|
-
role:
|
|
78
|
-
onMousedown:
|
|
76
|
+
rel: Z.value && !j.value.disabled ? j.value.rel : void 0,
|
|
77
|
+
"data-selected": j.value.selected || R.value ? !0 : void 0,
|
|
78
|
+
"aria-selected": L.value ? R.value : void 0,
|
|
79
|
+
href: Z.value && !j.value.disabled ? j.value.href : void 0,
|
|
80
|
+
target: Z.value && !j.value.disabled ? j.value.target : void 0,
|
|
81
|
+
role: L.value ? "option" : Z.value ? void 0 : j.value.role,
|
|
82
|
+
onMousedown: L.value ? (e) => {
|
|
79
83
|
e.preventDefault();
|
|
80
84
|
} : void 0,
|
|
81
|
-
tabindex: j.value.disabled ||
|
|
82
|
-
onClick:
|
|
83
|
-
|
|
85
|
+
tabindex: j.value.disabled || L.value ? -1 : Z.value ? void 0 : 0,
|
|
86
|
+
onClick: L.value ? () => {
|
|
87
|
+
F.value && P.value?.onSelect(F.value);
|
|
84
88
|
} : void 0,
|
|
85
|
-
class:
|
|
86
|
-
"flex w-full min-w-0 items-center gap-x-2 rounded-md text-left text-
|
|
87
|
-
|
|
89
|
+
class: x({
|
|
90
|
+
"flex w-full min-w-0 items-center gap-x-2 rounded-md text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
|
|
91
|
+
[W.value.item]: !L.value,
|
|
92
|
+
"no-underline": Z.value,
|
|
88
93
|
"cursor-pointer select-none": !j.value.disabled,
|
|
89
|
-
"px-2": !
|
|
90
|
-
"py-1.5": !
|
|
91
|
-
"py-1": !
|
|
92
|
-
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !j.value.disabled && !
|
|
93
|
-
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
94
|
+
"px-2": !L.value,
|
|
95
|
+
"py-1.5": !L.value && !U.value,
|
|
96
|
+
"py-1": !L.value && U.value,
|
|
97
|
+
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !j.value.disabled && !L.value,
|
|
98
|
+
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !L.value,
|
|
99
|
+
[P.value?.optionHoverClass ?? ""]: L.value && !j.value.disabled && !R.value,
|
|
100
|
+
[P.value?.mergedClasses.optionHover ?? ""]: L.value && !j.value.disabled && !R.value,
|
|
101
|
+
[P.value?.optionSelectedClass ?? ""]: L.value && R.value,
|
|
102
|
+
[P.value?.mergedClasses.optionSelected ?? ""]: L.value && R.value,
|
|
103
|
+
[P.value?.optionHighlightedClass ?? ""]: L.value && B.value && !R.value,
|
|
104
|
+
[P.value?.mergedClasses.optionHighlighted ?? ""]: L.value && B.value && !R.value,
|
|
100
105
|
"opacity-50 pointer-events-none": j.value.disabled,
|
|
101
|
-
[
|
|
102
|
-
[m(
|
|
106
|
+
[P.value?.sizeClasses?.option ?? ""]: L.value,
|
|
107
|
+
[m(H.value, "interactive") ?? ""]: !0
|
|
103
108
|
})
|
|
104
109
|
});
|
|
105
|
-
return !
|
|
110
|
+
return !Z.value || !j.value.disabled ? e : {
|
|
106
111
|
...e,
|
|
107
112
|
rel: void 0,
|
|
108
113
|
href: void 0,
|
|
109
114
|
target: void 0
|
|
110
115
|
};
|
|
111
|
-
}),
|
|
116
|
+
}), ne = s(() => x({
|
|
112
117
|
"flex w-full min-w-0 items-center gap-x-2": !0,
|
|
113
|
-
"rounded-md text-dark-900 dark:text-dark-100": !
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
"py-1": !
|
|
117
|
-
|
|
118
|
+
"rounded-md text-dark-900 dark:text-dark-100": !Q.value,
|
|
119
|
+
[W.value.item]: !Q.value,
|
|
120
|
+
"px-2": !Q.value,
|
|
121
|
+
"py-1.5": !Q.value && !U.value,
|
|
122
|
+
"py-1": !Q.value && U.value
|
|
123
|
+
})), re = s(() => r(V.value?.start, {}, x({
|
|
118
124
|
"flex shrink-0 items-center text-dark-600 dark:text-dark-300": !0,
|
|
119
|
-
[m(
|
|
120
|
-
}))),
|
|
125
|
+
[m(H.value, "start") ?? ""]: !0
|
|
126
|
+
}))), ie = s(() => r(V.value?.content, {}, x({
|
|
121
127
|
"min-w-0 flex-1": !0,
|
|
122
|
-
[m(
|
|
123
|
-
}))),
|
|
124
|
-
"block truncate
|
|
125
|
-
[
|
|
126
|
-
[
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
[
|
|
128
|
+
[m(H.value, "content") ?? ""]: !0
|
|
129
|
+
}))), ae = s(() => r(V.value?.primary, {}, x({
|
|
130
|
+
"block truncate leading-normal font-medium": !0,
|
|
131
|
+
[W.value.primary]: !L.value,
|
|
132
|
+
[P.value?.sizeClasses?.primary ?? ""]: L.value,
|
|
133
|
+
[m(H.value, "primary") ?? ""]: !0
|
|
134
|
+
}))), oe = s(() => r(V.value?.secondary, {}, x({
|
|
135
|
+
"mt-0.5 block truncate leading-normal text-dark-500 dark:text-dark-400": !0,
|
|
136
|
+
[W.value.secondary]: !L.value,
|
|
137
|
+
[P.value?.sizeClasses?.secondary ?? ""]: L.value,
|
|
138
|
+
[m(H.value, "secondary") ?? ""]: !0
|
|
131
139
|
})));
|
|
132
140
|
return {
|
|
133
141
|
merged: j,
|
|
134
|
-
hasEnd:
|
|
135
|
-
endBind: s(() => r(
|
|
142
|
+
hasEnd: J,
|
|
143
|
+
endBind: s(() => r(V.value?.end, {}, x({
|
|
136
144
|
"ml-auto flex shrink-0 items-center": !0,
|
|
137
|
-
[m(
|
|
145
|
+
[m(H.value, "end") ?? ""]: !0
|
|
138
146
|
}))),
|
|
139
|
-
rootBind:
|
|
140
|
-
rowClass:
|
|
141
|
-
startBind:
|
|
142
|
-
hasPrimary:
|
|
143
|
-
contentBind:
|
|
144
|
-
primaryBind:
|
|
145
|
-
hasSecondary:
|
|
146
|
-
secondaryBind:
|
|
147
|
-
interactiveTag:
|
|
148
|
-
interactiveBind:
|
|
149
|
-
selectedIconBind: s(() => r(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})),
|
|
157
|
-
resolvedSelectedIcon: G
|
|
147
|
+
rootBind: X,
|
|
148
|
+
rowClass: ne,
|
|
149
|
+
startBind: re,
|
|
150
|
+
hasPrimary: G,
|
|
151
|
+
contentBind: ie,
|
|
152
|
+
primaryBind: ae,
|
|
153
|
+
hasSecondary: K,
|
|
154
|
+
secondaryBind: oe,
|
|
155
|
+
interactiveTag: $,
|
|
156
|
+
interactiveBind: te,
|
|
157
|
+
selectedIconBind: s(() => r(V.value?.selectedIcon, {}, { class: x({
|
|
158
|
+
"block shrink-0": !0,
|
|
159
|
+
[W.value.icon]: !L.value,
|
|
160
|
+
[P.value?.checkClass ?? ""]: L.value,
|
|
161
|
+
[m(H.value, "selectedIcon") ?? ""]: !0
|
|
162
|
+
}) })),
|
|
163
|
+
resolvedSelectedIcon: q
|
|
158
164
|
};
|
|
159
165
|
}
|
|
160
166
|
export { C as useListItem };
|
|
@@ -3,6 +3,7 @@ import { ListboxValue } from '@bridge-ui/core/Domain';
|
|
|
3
3
|
import { MergeHtmlProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { IconSource } from '../../Adapters/Icon';
|
|
5
5
|
import { IconProps } from '../Icon';
|
|
6
|
+
import { ListOwnProps } from '../List/list.types';
|
|
6
7
|
import { LinkAsTag, LinkHref, LinkPropsOf } from '../../Utils/linkAs';
|
|
7
8
|
export interface ListItemClasses {
|
|
8
9
|
/**
|
|
@@ -179,6 +180,13 @@ export interface ListItemOwnProps<T extends LinkAsTag = "a"> {
|
|
|
179
180
|
* @default Check
|
|
180
181
|
*/
|
|
181
182
|
selectedIcon?: null | IconSource;
|
|
183
|
+
/**
|
|
184
|
+
* Typography scale for the row. Inherits `size` from parent `List` when
|
|
185
|
+
* omitted. Ignored inside a `Listbox`, which applies its own size.
|
|
186
|
+
*
|
|
187
|
+
* @default undefined
|
|
188
|
+
*/
|
|
189
|
+
size?: ListOwnProps["size"];
|
|
182
190
|
/**
|
|
183
191
|
* Where to open the URL. Forwarded to the anchor when `href` is set.
|
|
184
192
|
*
|
|
@@ -4,9 +4,10 @@ import { LIST_SECTION_INJECTION_KEY as n } from "../listSectionInjectionKey.js";
|
|
|
4
4
|
import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
|
|
5
5
|
import { computed as o, inject as s, toValue as c, useAttrs as l } from "vue";
|
|
6
6
|
import { get as u, isNil as d, omit as f } from "es-toolkit/compat";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveListSizeClasses as p } from "@bridge-ui/core/Domain";
|
|
8
|
+
import { cn as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
|
|
8
9
|
// src/Components/ListSection/composables/useListSection.ts
|
|
9
|
-
var
|
|
10
|
+
var g = [
|
|
10
11
|
"as",
|
|
11
12
|
"inset",
|
|
12
13
|
"title",
|
|
@@ -14,41 +15,42 @@ var h = [
|
|
|
14
15
|
"classes",
|
|
15
16
|
"customProps"
|
|
16
17
|
];
|
|
17
|
-
function
|
|
18
|
-
let
|
|
18
|
+
function _(_) {
|
|
19
|
+
let v = l(), y = s(e, null), b = s(n, null), x = s(t, null), S = o(() => x ? c(x) : null), C = o(() => h({
|
|
19
20
|
props: {
|
|
20
|
-
...
|
|
21
|
-
...
|
|
21
|
+
...v,
|
|
22
|
+
..._
|
|
22
23
|
},
|
|
23
|
-
bridgeKeys:
|
|
24
|
-
})), { merged:
|
|
24
|
+
bridgeKeys: g
|
|
25
|
+
})), { merged: w, components: T, entry: E } = i({
|
|
25
26
|
componentName: "ListSection",
|
|
26
|
-
props: () =>
|
|
27
|
-
}),
|
|
28
|
-
entry:
|
|
29
|
-
props: () =>
|
|
30
|
-
}),
|
|
27
|
+
props: () => C.value.componentProps
|
|
28
|
+
}), D = o(() => w.value.customProps), O = a({
|
|
29
|
+
entry: E,
|
|
30
|
+
props: () => C.value.componentProps
|
|
31
|
+
}), k = o(() => y ? c(y).dense : !1), A = o(() => p(T.value, y ? c(y).size : void 0)), j = o(() => b ? c(b).hidden : !1), M = o(() => f(C.value.inheritedAttrs, [])), N = o(() => w.value.as === "div");
|
|
31
32
|
return {
|
|
32
|
-
merged:
|
|
33
|
-
rootBind: o(() => r(
|
|
33
|
+
merged: w,
|
|
34
|
+
rootBind: o(() => r(D.value?.root, M.value, m({
|
|
34
35
|
"mt-1 list-none first:mt-0": !0,
|
|
35
|
-
"sticky top-0 z-10 bg-white dark:bg-dark-800":
|
|
36
|
-
[u(
|
|
36
|
+
"sticky top-0 z-10 bg-white dark:bg-dark-800": w.value.sticky && !N.value,
|
|
37
|
+
[u(O.value, "root") ?? ""]: !0
|
|
37
38
|
}))),
|
|
38
|
-
isHidden:
|
|
39
|
-
titleBind: o(() => r(
|
|
39
|
+
isHidden: j,
|
|
40
|
+
titleBind: o(() => r(D.value?.title, {}, {
|
|
40
41
|
role: "presentation",
|
|
41
|
-
class:
|
|
42
|
-
"sticky top-0 z-10 bg-white dark:bg-dark-800":
|
|
43
|
-
"px-2": d(
|
|
44
|
-
"py-1": d(
|
|
45
|
-
"py-1.5": d(
|
|
46
|
-
[
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
42
|
+
class: m({
|
|
43
|
+
"sticky top-0 z-10 bg-white dark:bg-dark-800": w.value.sticky && N.value,
|
|
44
|
+
"px-2": d(x),
|
|
45
|
+
"py-1": d(x) && k.value,
|
|
46
|
+
"py-1.5": d(x) && !k.value,
|
|
47
|
+
[S.value?.sizeClasses?.option ?? ""]: !d(x),
|
|
48
|
+
"font-medium text-dark-500 dark:text-dark-400": !0,
|
|
49
|
+
[d(x) ? A.value.section : "text-xs"]: !0,
|
|
50
|
+
"pl-14": w.value.inset,
|
|
51
|
+
[u(O.value, "title") ?? ""]: !0
|
|
50
52
|
})
|
|
51
53
|
}))
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
|
-
export {
|
|
56
|
+
export { _ as useListSection };
|
|
@@ -7,16 +7,16 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
};
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
-
apply: () => any;
|
|
11
10
|
cancel: () => any;
|
|
12
11
|
select: (option: ListboxOption) => any;
|
|
12
|
+
apply: () => any;
|
|
13
13
|
"update:modelValue": (value: boolean) => any;
|
|
14
14
|
"show-change": (show: boolean) => any;
|
|
15
15
|
"registered-options-change": (options: ListboxOption[]) => any;
|
|
16
16
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
-
onApply?: (() => any) | undefined;
|
|
18
17
|
onCancel?: (() => any) | undefined;
|
|
19
18
|
onSelect?: ((option: ListboxOption) => any) | undefined;
|
|
19
|
+
onApply?: (() => any) | undefined;
|
|
20
20
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
21
21
|
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
22
22
|
"onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
|
|
@@ -78,14 +78,14 @@ export interface ListboxCustomProps {
|
|
|
78
78
|
*
|
|
79
79
|
* @default undefined
|
|
80
80
|
*/
|
|
81
|
-
list?: Partial<ListOwnProps
|
|
81
|
+
list?: Partial<Omit<ListOwnProps, "size">>;
|
|
82
82
|
/**
|
|
83
83
|
* Props forwarded to each mapped `ListItem` option.
|
|
84
84
|
* Merged last so they override Listbox defaults.
|
|
85
85
|
*
|
|
86
86
|
* @default undefined
|
|
87
87
|
*/
|
|
88
|
-
listItem?: Partial<ListItemOwnProps
|
|
88
|
+
listItem?: Partial<Omit<ListItemOwnProps, "size">>;
|
|
89
89
|
/**
|
|
90
90
|
* Props forwarded to each mapped `ListSection`.
|
|
91
91
|
*
|