@bridge-ui/vue 0.25.0 → 0.27.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/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Components/ActionFooter/ActionFooter.vue.d.ts +2 -2
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +4 -4
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +1 -1
- package/dist/Components/BaseField/composables/useBaseField.js +0 -1
- 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/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -0
- package/dist/Components/Checkbox/composables/useCheckbox.js +2 -1
- package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
- package/dist/Components/ColorField/composables/useColorField.js +1 -1
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +2 -2
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.js +1 -1
- 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/DateRangeField/composables/useDateRangeField.js +1 -1
- 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/DateTimeField/composables/useDateTimeField.js +1 -1
- 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/DateTimeRangeField/composables/useDateTimeRangeField.js +1 -1
- 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/FormControl/composables/useFormControl.d.ts +1 -0
- package/dist/Components/FormControl/composables/useFormControl.js +14 -11
- package/dist/Components/FormField/composables/useFormField.js +0 -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/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/Components/NumberField/composables/useNumberField.d.ts +1 -0
- package/dist/Components/NumberField/composables/useNumberField.js +11 -10
- package/dist/Components/OtpField/composables/useOtpField.js +7 -1
- package/dist/Components/Pagination/Pagination.vue.d.ts +2 -2
- package/dist/Components/QrCode/QrCode.js +4 -0
- package/dist/Components/QrCode/QrCode.vue.d.ts +17 -0
- package/dist/Components/QrCode/QrCode.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/Components/QrCode/composables/useQrCode.d.ts +881 -0
- package/dist/Components/QrCode/composables/useQrCode.js +137 -0
- package/dist/Components/QrCode/index.d.ts +3 -0
- package/dist/Components/QrCode/index.js +3 -0
- package/dist/Components/QrCode/qrCode.types.d.ts +168 -0
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/Radio/composables/useRadio.d.ts +1 -0
- package/dist/Components/Radio/composables/useRadio.js +2 -1
- package/dist/Components/Select/Select.vue.d.ts +4 -4
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Select/composables/useSelect.js +1 -1
- 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/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/Switch/composables/useSwitch.d.ts +1 -0
- package/dist/Components/Switch/composables/useSwitch.js +2 -1
- package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.js +1 -1
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +1 -1
- 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 +7 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +84 -82
- package/docs/README.md +1 -0
- package/docs/components/Calendar.md +31 -30
- package/docs/components/CalendarRange.md +29 -28
- package/docs/components/I18n.md +2 -0
- package/docs/components/List.md +43 -27
- package/docs/components/QrCode.md +134 -0
- package/package.json +3 -3
|
@@ -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
|
*
|
|
@@ -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').ModalScroll;
|
|
19
20
|
autoFocus: boolean;
|
|
20
21
|
closeOnEscape: boolean;
|
|
21
22
|
closeOnOverlay: boolean;
|
|
@@ -25,7 +26,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
25
26
|
hideBackdrop: boolean;
|
|
26
27
|
keepMounted: boolean;
|
|
27
28
|
persistent: boolean;
|
|
28
|
-
scroll: keyof import('@bridge-ui/core/Tokens').ModalScroll;
|
|
29
29
|
teleportTo: string | false;
|
|
30
30
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -34,7 +34,7 @@ export declare function useModal(props: ModalOwnProps, libDefaults: ModalLibDefa
|
|
|
34
34
|
};
|
|
35
35
|
"aria-hidden": boolean | undefined;
|
|
36
36
|
class: string;
|
|
37
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "
|
|
37
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "blur" | "scroll" | "classes" | "customProps" | "transition" | "autoFocus" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "stackId" | "teleportTo" | "align">>>;
|
|
38
38
|
panelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
39
39
|
"data-modal-part": string;
|
|
40
40
|
"data-state": "open" | "closed";
|
|
@@ -3,11 +3,11 @@ import { presentSlotNames as t } from "../../Utils/slotOrProp.js";
|
|
|
3
3
|
import { useHoldRepeat as n } from "../../Utils/useHoldRepeat.js";
|
|
4
4
|
import { useOptionalModel as r } from "../../Utils/useOptionalModel.js";
|
|
5
5
|
import { FORM_FIELD_CHROME_SLOT_NAMES as i } from "../FormField/formField.types.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useNumberField as
|
|
9
|
-
import { mergePartBind as
|
|
10
|
-
import { computed as
|
|
6
|
+
import ee from "../FormField/FormField.js";
|
|
7
|
+
import a from "../Icon/Icon.js";
|
|
8
|
+
import { useNumberField as o } from "./composables/useNumberField.js";
|
|
9
|
+
import { mergePartBind as s } from "../../Utils/index.js";
|
|
10
|
+
import { computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createVNode as m, defineComponent as h, guardReactiveProps as g, isRef as _, mergeModels as v, mergeProps as y, normalizeClass as b, normalizeProps as x, openBlock as S, ref as C, renderList as w, renderSlot as T, unref as E, useModel as D, vModelDynamic as O, withCtx as k, withDirectives as A } from "vue";
|
|
11
11
|
import { cn as j } from "@bridge-ui/core/Utils";
|
|
12
12
|
// src/Components/NumberField/NumberField.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var M = /*@__PURE__*/ h({
|
|
@@ -47,54 +47,54 @@ var M = /*@__PURE__*/ h({
|
|
|
47
47
|
}),
|
|
48
48
|
emits: /*@__PURE__*/ v(["change", "update:modelValue"], ["update:modelValue"]),
|
|
49
49
|
setup(h, { emit: v }) {
|
|
50
|
-
let M = e(),
|
|
50
|
+
let M = e(), N = v, te = D(h, "modelValue"), P = h, F = C(P.defaultValue), I = r(te, F), { isSplit: L, decrement: R, formField: z, increment: B, inputBind: V, stringModel: H, decrementIcon: U, incrementIcon: W, mergedClasses: G, incrementFirst: K, steppersLocked: q, stepperIconSize: J, controlVariantItem: Y } = o(P, I, { onChange: (e) => N("change", e) }), X = n(() => B(), () => ({ disabled: q.value })), Z = n(() => R(), () => ({ disabled: q.value })), ne = c(() => i.filter((e) => !(e === "end" || e === "start" && L.value))), Q = c(() => s(P.customProps?.increment, {
|
|
51
51
|
type: "button",
|
|
52
|
-
disabled:
|
|
53
|
-
onClick:
|
|
54
|
-
onPointerup:
|
|
55
|
-
onPointerdown:
|
|
52
|
+
disabled: q.value,
|
|
53
|
+
onClick: X.onPressClick,
|
|
54
|
+
onPointerup: X.onPressPointerUp,
|
|
55
|
+
onPointerdown: X.onPressPointerDown,
|
|
56
56
|
"aria-label": M("Increment value"),
|
|
57
|
-
onLostpointercapture:
|
|
57
|
+
onLostpointercapture: X.onPressLostPointerCapture
|
|
58
58
|
}, j({
|
|
59
|
-
[
|
|
59
|
+
[Y.value.button]: !0,
|
|
60
60
|
[G.value.increment ?? ""]: !0
|
|
61
|
-
}))), $ =
|
|
61
|
+
}))), $ = c(() => s(P.customProps?.decrement, {
|
|
62
62
|
type: "button",
|
|
63
|
-
disabled:
|
|
64
|
-
onClick:
|
|
65
|
-
onPointerup:
|
|
66
|
-
onPointerdown:
|
|
63
|
+
disabled: q.value,
|
|
64
|
+
onClick: Z.onPressClick,
|
|
65
|
+
onPointerup: Z.onPressPointerUp,
|
|
66
|
+
onPointerdown: Z.onPressPointerDown,
|
|
67
67
|
"aria-label": M("Decrement value"),
|
|
68
|
-
onLostpointercapture:
|
|
68
|
+
onLostpointercapture: Z.onPressLostPointerCapture
|
|
69
69
|
}, j({
|
|
70
|
-
[
|
|
70
|
+
[Y.value.button]: !0,
|
|
71
71
|
[G.value.decrement ?? ""]: !0
|
|
72
72
|
})));
|
|
73
|
-
return (e, n) => (S(),
|
|
74
|
-
end: k(() => [f("div", { class: b(E(
|
|
75
|
-
E(K) ? (S(), d("button", x(y({ key: 0 }, Q.value)), [m(E(
|
|
73
|
+
return (e, n) => (S(), l(E(ee), { field: E(z) }, p({
|
|
74
|
+
end: k(() => [f("div", { class: b(E(Y).endGroup) }, [
|
|
75
|
+
E(K) ? (S(), d("button", x(y({ key: 0 }, Q.value)), [m(E(a), y({
|
|
76
76
|
icon: E(W),
|
|
77
|
-
size: E(
|
|
77
|
+
size: E(J)
|
|
78
78
|
}, P.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16)) : u("", !0),
|
|
79
|
-
E(L) ? u("", !0) : (S(), d("button", x(y({ key: 1 }, $.value)), [m(E(
|
|
79
|
+
E(L) ? u("", !0) : (S(), d("button", x(y({ key: 1 }, $.value)), [m(E(a), y({
|
|
80
80
|
icon: E(U),
|
|
81
|
-
size: E(
|
|
81
|
+
size: E(J)
|
|
82
82
|
}, P.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)),
|
|
83
|
-
E(K) ? u("", !0) : (S(), d("button", x(y({ key: 2 }, Q.value)), [m(E(
|
|
83
|
+
E(K) ? u("", !0) : (S(), d("button", x(y({ key: 2 }, Q.value)), [m(E(a), y({
|
|
84
84
|
icon: E(W),
|
|
85
|
-
size: E(
|
|
85
|
+
size: E(J)
|
|
86
86
|
}, P.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16))
|
|
87
87
|
], 2)]),
|
|
88
88
|
default: k(() => [A(f("input", y({ "onUpdate:modelValue": n[0] ||= (e) => _(H) ? H.value = e : null }, E(V)), null, 16), [[O, E(H)]])]),
|
|
89
89
|
_: 2
|
|
90
|
-
}, [w(E(t)(
|
|
90
|
+
}, [w(E(t)(ne.value, e.$slots), (t) => ({
|
|
91
91
|
name: t,
|
|
92
92
|
fn: k((n) => [T(e.$slots, t, x(g(n || {})))])
|
|
93
93
|
})), E(L) ? {
|
|
94
94
|
name: "start",
|
|
95
|
-
fn: k(() => [f("div", { class: b(E(
|
|
95
|
+
fn: k(() => [f("div", { class: b(E(Y).startGroup) }, [f("button", x(g($.value)), [m(E(a), y({
|
|
96
96
|
icon: E(U),
|
|
97
|
-
size: E(
|
|
97
|
+
size: E(J)
|
|
98
98
|
}, P.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)], 2)]),
|
|
99
99
|
key: "0"
|
|
100
100
|
} : void 0]), 1032, ["field"]));
|
|
@@ -696,6 +696,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
696
696
|
}>>;
|
|
697
697
|
stringModel: import('vue').WritableComputedRef<string, string | null | undefined>;
|
|
698
698
|
mergedClasses: import('vue').ComputedRef<Partial<NumberFieldClasses>>;
|
|
699
|
+
steppersLocked: import('vue').ComputedRef<boolean>;
|
|
699
700
|
stepperIconSize: import('vue').ComputedRef<keyof import('@bridge-ui/core/Tokens').IconSize>;
|
|
700
701
|
controlVariantItem: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').NumberFieldControlVariantItem>;
|
|
701
702
|
isSplit: import('vue').ComputedRef<boolean>;
|
|
@@ -38,13 +38,13 @@ function p(p, m, h = {}) {
|
|
|
38
38
|
}, {
|
|
39
39
|
componentName: "NumberField",
|
|
40
40
|
reservedSlots: () => C.value.isSplit ? ["start", "end"] : ["end"]
|
|
41
|
-
}), E = i(() => l(T.merged.value.size, S.value)), D = i(() => t(T.inputBind.value, {
|
|
41
|
+
}), E = i(() => l(T.merged.value.size, S.value)), D = i(() => !!(p.disabled || p.readonly)), O = i(() => t(T.inputBind.value, {
|
|
42
42
|
min: p.min,
|
|
43
43
|
max: p.max,
|
|
44
44
|
type: "number",
|
|
45
45
|
step: _.value
|
|
46
|
-
}, d({ "appearance:textfield [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none": !0 }))),
|
|
47
|
-
get: () => s(
|
|
46
|
+
}, d({ "appearance:textfield [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none": !0 }))), k = i(() => m.value ?? void 0), A = i({
|
|
47
|
+
get: () => s(k.value) ? "" : String(k.value),
|
|
48
48
|
set: (e) => {
|
|
49
49
|
if (e === "" || s(e)) {
|
|
50
50
|
m.value = void 0;
|
|
@@ -53,22 +53,23 @@ function p(p, m, h = {}) {
|
|
|
53
53
|
let t = Number(e);
|
|
54
54
|
Number.isNaN(t) || (m.value = t, h.onChange?.(t));
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
56
|
+
}), j = (e) => {
|
|
57
57
|
m.value = e, h.onChange?.(e);
|
|
58
58
|
};
|
|
59
59
|
return {
|
|
60
60
|
decrement: () => {
|
|
61
|
-
let e = (
|
|
62
|
-
return !s(p.min) && e < p.min ? !1 : (
|
|
61
|
+
let e = (k.value ?? p.min ?? 0) - _.value;
|
|
62
|
+
return !s(p.min) && e < p.min ? !1 : (j(e), !0);
|
|
63
63
|
},
|
|
64
64
|
formField: T,
|
|
65
65
|
increment: () => {
|
|
66
|
-
let e = (
|
|
67
|
-
return !s(p.max) && e > p.max ? !1 : (
|
|
66
|
+
let e = (k.value ?? p.min ?? 0) + _.value;
|
|
67
|
+
return !s(p.max) && e > p.max ? !1 : (j(e), !0);
|
|
68
68
|
},
|
|
69
|
-
inputBind:
|
|
70
|
-
stringModel:
|
|
69
|
+
inputBind: O,
|
|
70
|
+
stringModel: A,
|
|
71
71
|
mergedClasses: x,
|
|
72
|
+
steppersLocked: D,
|
|
72
73
|
stepperIconSize: E,
|
|
73
74
|
controlVariantItem: w,
|
|
74
75
|
isSplit: i(() => C.value.isSplit),
|
|
@@ -148,6 +148,7 @@ function w(w, T, E = {}, D = {
|
|
|
148
148
|
k.value[e]?.select();
|
|
149
149
|
},
|
|
150
150
|
handlePinPaste: (e, t) => {
|
|
151
|
+
if (B.value) return;
|
|
151
152
|
let n = t.clipboardData?.getData("text") ?? "", r = d({
|
|
152
153
|
index: e,
|
|
153
154
|
pasted: n,
|
|
@@ -162,7 +163,12 @@ function w(w, T, E = {}, D = {
|
|
|
162
163
|
key: t.key,
|
|
163
164
|
digits: Y.value
|
|
164
165
|
});
|
|
165
|
-
|
|
166
|
+
if (n) {
|
|
167
|
+
if (B.value) {
|
|
168
|
+
let { focusIndex: r } = n;
|
|
169
|
+
n.digits.every((e, t) => e === Y.value[t]) && r != null && r !== e && (t.preventDefault(), k.value[r]?.focus());
|
|
170
|
+
} else t.preventDefault(), X(n.digits, n.focusIndex);
|
|
171
|
+
}
|
|
166
172
|
}
|
|
167
173
|
};
|
|
168
174
|
}
|
|
@@ -8,15 +8,15 @@ type __VLS_ModelProps = {
|
|
|
8
8
|
};
|
|
9
9
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
10
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
change: (page: number) => any;
|
|
11
12
|
next: () => any;
|
|
12
13
|
previous: () => any;
|
|
13
|
-
change: (page: number) => any;
|
|
14
14
|
"update:modelValue": (...args: unknown[]) => any;
|
|
15
15
|
"update:cursor": (...args: unknown[]) => any;
|
|
16
16
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
onChange?: ((page: number) => any) | undefined;
|
|
17
18
|
onNext?: (() => any) | undefined;
|
|
18
19
|
onPrevious?: (() => any) | undefined;
|
|
19
|
-
onChange?: ((page: number) => any) | undefined;
|
|
20
20
|
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
21
21
|
"onUpdate:cursor"?: ((...args: unknown[]) => any) | undefined;
|
|
22
22
|
}>, {
|