@bridge-ui/vue 0.1.0 → 0.2.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 +6 -3
- package/ai/skills/bridge-ui-forms/SKILL.md +4 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +0 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +0 -1
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/Components/Calendar/calendar.types.d.ts +1 -21
- package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -2
- package/dist/Components/Calendar/composables/useCalendar.js +97 -97
- package/dist/Components/Calendar/index.d.ts +1 -1
- package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/Components/CalendarDate/calendarDate.types.d.ts +1 -21
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +1 -1
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +73 -73
- package/dist/Components/CalendarDate/index.d.ts +1 -1
- package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +1 -17
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +25 -25
- package/dist/Components/CalendarMonth/index.d.ts +1 -1
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +135 -110
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +18 -26
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -4
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +127 -129
- package/dist/Components/CalendarRange/index.d.ts +1 -1
- package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/Components/CalendarYear/calendarYear.types.d.ts +1 -17
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +1 -1
- package/dist/Components/CalendarYear/composables/useCalendarYear.js +27 -27
- package/dist/Components/CalendarYear/index.d.ts +1 -1
- package/dist/Components/ColorField/ColorField.js +5 -0
- package/dist/Components/ColorField/ColorField.vue.d.ts +38 -0
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +149 -0
- package/dist/Components/ColorField/colorField.types.d.ts +179 -0
- package/dist/Components/ColorField/composables/useColorField.d.ts +748 -0
- package/dist/Components/ColorField/composables/useColorField.js +182 -0
- package/dist/Components/ColorField/index.d.ts +3 -0
- package/dist/Components/ColorField/index.js +3 -0
- package/dist/Components/ColorPicker/ColorPicker.js +5 -0
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +21 -0
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +200 -0
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +111 -0
- package/dist/Components/ColorPicker/composables/useColorPicker.js +253 -0
- package/dist/Components/ColorPicker/index.d.ts +3 -0
- package/dist/Components/ColorPicker/index.js +3 -0
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +4 -7
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +1 -6
- package/dist/Components/DatePicker/composables/useDatePicker.js +30 -9
- package/dist/Components/DatePicker/datePicker.types.d.ts +1 -29
- package/dist/Components/DatePicker/index.d.ts +1 -1
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +4 -7
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +1 -6
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +3 -9
- package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +1 -29
- package/dist/Components/DateRangePicker/index.d.ts +1 -1
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +16 -21
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +1 -10
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +30 -39
- package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +1 -36
- package/dist/Components/DateTimePicker/index.d.ts +1 -1
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +21 -33
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +1 -10
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +34 -43
- package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +1 -36
- package/dist/Components/DateTimeRangePicker/index.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +1 -1
- package/dist/Components/FieldOverlay/FieldOverlay.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/Components/FieldOverlay/composables/useFieldOverlay.d.ts +1 -0
- package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +30 -21
- package/dist/Components/FieldOverlay/fieldOverlay.types.d.ts +14 -3
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/Components/Listbox/composables/useListbox.d.ts +1 -10
- package/dist/Components/Listbox/composables/useListbox.js +51 -52
- package/dist/Components/Listbox/index.d.ts +0 -1
- package/dist/Components/Listbox/listbox.types.d.ts +0 -6
- package/dist/Components/Modal/composables/useModal.js +1 -1
- package/dist/Components/Select/composables/useSelect.d.ts +0 -1
- package/dist/Components/Select/composables/useSelect.js +0 -1
- package/dist/Components/Step/Step.js +5 -0
- package/dist/Components/Step/Step.vue.d.ts +11 -0
- package/dist/Components/Step/Step.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Step/composables/useStep.d.ts +56 -0
- package/dist/Components/Step/composables/useStep.js +162 -0
- package/dist/Components/Step/index.d.ts +3 -0
- package/dist/Components/Step/index.js +3 -0
- package/dist/Components/Step/step.types.d.ts +160 -0
- package/dist/Components/Stepper/Stepper.js +5 -0
- package/dist/Components/Stepper/Stepper.vue.d.ts +24 -0
- package/dist/Components/Stepper/Stepper.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Stepper/composables/useStepper.d.ts +18 -0
- package/dist/Components/Stepper/composables/useStepper.js +91 -0
- package/dist/Components/Stepper/index.d.ts +4 -0
- package/dist/Components/Stepper/index.js +4 -0
- package/dist/Components/Stepper/stepper.types.d.ts +93 -0
- package/dist/Components/Stepper/stepperInjectionKey.d.ts +77 -0
- package/dist/Components/Stepper/stepperInjectionKey.js +4 -0
- package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -1
- package/dist/Components/TimePanel/composables/useTimePanel.js +82 -81
- package/dist/Components/TimePanel/index.d.ts +1 -1
- package/dist/Components/TimePanel/timePanel.types.d.ts +1 -17
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +10 -13
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +1 -5
- package/dist/Components/TimePicker/composables/useTimePicker.js +12 -17
- package/dist/Components/TimePicker/index.d.ts +1 -1
- package/dist/Components/TimePicker/timePicker.types.d.ts +1 -24
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +103 -94
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -6
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +61 -65
- package/dist/Components/TimeRangePicker/index.d.ts +1 -1
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +2 -31
- package/dist/index.d.ts +20 -12
- package/dist/index.js +95 -87
- package/dist/theme.css +2 -0
- package/docs/README.md +7 -0
- package/docs/ScrollUtilities.md +89 -0
- package/docs/components/Autocomplete.md +3 -1
- package/docs/components/BridgeUIProvider.md +9 -11
- package/docs/components/Calendar.md +2 -1
- package/docs/components/CalendarDate.md +2 -1
- package/docs/components/CalendarMonth.md +2 -1
- package/docs/components/CalendarRange.md +6 -4
- package/docs/components/CalendarYear.md +2 -1
- package/docs/components/ColorField.md +93 -0
- package/docs/components/ColorPicker.md +78 -0
- package/docs/components/DatePicker.md +2 -1
- package/docs/components/DateRangePicker.md +5 -3
- package/docs/components/DateTimePicker.md +2 -1
- package/docs/components/DateTimeRangePicker.md +2 -1
- package/docs/components/Drawer.md +21 -21
- package/docs/components/FieldOverlay.md +20 -9
- package/docs/components/Modal.md +19 -19
- package/docs/components/Select.md +3 -1
- package/docs/components/Stepper.md +60 -0
- package/docs/components/TimePanel.md +4 -1
- package/docs/components/TimePicker.md +2 -1
- package/docs/components/TimeRangePicker.md +2 -2
- package/docs/examples/icon-fontawesome.ts +2 -0
- package/docs/examples/icon-heroicons.ts +2 -0
- package/docs/examples/icon-lucide.ts +2 -0
- package/docs/examples/icon-phosphor.ts +2 -0
- package/docs/examples/icon-tabler.ts +2 -0
- package/package.json +2 -2
|
@@ -5,14 +5,13 @@ import { computed as a, getCurrentInstance as te, ref as o, toValue as s, useAtt
|
|
|
5
5
|
import { get as ne, isFunction as l, isNil as u, omit as re } from "es-toolkit/compat";
|
|
6
6
|
import { isDateRangeValue as d } from "@bridge-ui/core/Domain";
|
|
7
7
|
import { calendarRoundedProps as f } from "@bridge-ui/core/Tokens";
|
|
8
|
-
import { cn as p, mergeBridgeUILayeredClasses as
|
|
8
|
+
import { cn as p, mergeBridgeUILayeredClasses as ie, splitComponentProps as ae } from "@bridge-ui/core/Utils";
|
|
9
9
|
//#region src/Components/CalendarRange/composables/useCalendarRange.ts
|
|
10
|
-
var
|
|
10
|
+
var oe = [
|
|
11
11
|
"fill",
|
|
12
12
|
"color",
|
|
13
13
|
"error",
|
|
14
14
|
"value",
|
|
15
|
-
"tokens",
|
|
16
15
|
"classes",
|
|
17
16
|
"maxDate",
|
|
18
17
|
"minDate",
|
|
@@ -34,223 +33,222 @@ var ie = [
|
|
|
34
33
|
"disableMonths",
|
|
35
34
|
"hideOutsideDays"
|
|
36
35
|
];
|
|
37
|
-
function
|
|
36
|
+
function se(e, t, n) {
|
|
38
37
|
return u(e) ? t.now(n) : e[0];
|
|
39
38
|
}
|
|
40
|
-
function
|
|
39
|
+
function ce(e) {
|
|
41
40
|
return d(e) ? e : null;
|
|
42
41
|
}
|
|
43
|
-
function
|
|
44
|
-
let
|
|
45
|
-
bridgeKeys:
|
|
42
|
+
function m(d, m, h) {
|
|
43
|
+
let le = c(), g = e(), _ = n(), v = t(), y = a(() => ae({
|
|
44
|
+
bridgeKeys: oe,
|
|
46
45
|
props: {
|
|
47
|
-
...
|
|
46
|
+
...le,
|
|
48
47
|
...s(d)
|
|
49
48
|
}
|
|
50
|
-
})), { merged: x } = i({
|
|
51
|
-
libDefaults:
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
})), { merged: b, entry: x } = i({
|
|
50
|
+
libDefaults: m,
|
|
51
|
+
componentName: "Calendar",
|
|
52
|
+
props: () => y.value.componentProps
|
|
53
|
+
}), S = a(() => b.value.customProps), C = a(() => re(y.value.inheritedAttrs, [
|
|
54
54
|
"onChange",
|
|
55
55
|
"onViewDateChange",
|
|
56
56
|
"onPreviewDateChange"
|
|
57
57
|
])), w = ee({
|
|
58
|
-
props: () =>
|
|
58
|
+
props: () => y.value.componentProps,
|
|
59
59
|
entry: a(() => {})
|
|
60
|
-
}), T = a(() =>
|
|
60
|
+
}), T = a(() => v(b.value.timeZone)), E = a(() => s(d)), D = a(() => !u(E.value.value)), O = a(() => {
|
|
61
61
|
let e = te()?.vnode.props ?? {}, t = l(e.onViewDateChange) || l(e["onUpdate:viewDate"]);
|
|
62
62
|
return !u(E.value.viewDate) && t;
|
|
63
|
-
}), k = a(() => !u(E.value.previewDate)), A = o(
|
|
64
|
-
let e =
|
|
65
|
-
return ne(e,
|
|
66
|
-
}),
|
|
63
|
+
}), k = a(() => !u(E.value.previewDate)), A = o(b.value.defaultValue ?? null), j = o("date"), M = o(g.value.startOfMonth(u(E.value.viewDate) ? se(E.value.value ?? b.value.defaultValue ?? null, g.value, T.value) : E.value.viewDate, T.value)), N = o(null), P = o(null), F = a(() => D.value ? E.value.value ?? null : A.value), I = a(() => j.value === "year" && b.value.hideYears || j.value === "month" && b.value.hideMonths ? "date" : j.value), L = a(() => O.value ? E.value.viewDate : M.value), R = a(() => g.value.addMonths(L.value, 1, T.value)), z = a(() => k.value ? E.value.previewDate ?? null : N.value), B = a(() => String(g.value.getYear(L.value, T.value))), V = a(() => g.value.getMonthNames(T.value)[g.value.getMonth(L.value, T.value)] ?? ""), H = a(() => g.value.getMonthNames(T.value)[g.value.getMonth(R.value, T.value)] ?? ""), U = a(() => g.value.getYear(L.value, T.value)), W = a(() => g.value.getMonth(L.value, T.value)), G = a(() => u(P.value) ? Math.max(1, U.value - 7) : P.value), K = a(() => {
|
|
64
|
+
let e = ie(f, x.value?.tokens?.rounded);
|
|
65
|
+
return ne(e, b.value.rounded);
|
|
66
|
+
}), q = (e) => {
|
|
67
67
|
j.value = e;
|
|
68
|
-
},
|
|
69
|
-
P.value = Math.max(1,
|
|
70
|
-
},
|
|
71
|
-
let t =
|
|
72
|
-
O.value || (M.value = t),
|
|
73
|
-
}, ue = (e) => {
|
|
74
|
-
Y(e);
|
|
68
|
+
}, ue = () => {
|
|
69
|
+
P.value = Math.max(1, U.value - 7), q("year");
|
|
70
|
+
}, J = (e) => {
|
|
71
|
+
let t = g.value.startOfMonth(e, T.value);
|
|
72
|
+
O.value || (M.value = t), h("viewDateChange", t);
|
|
75
73
|
}, de = (e) => {
|
|
76
|
-
|
|
74
|
+
J(e);
|
|
77
75
|
}, fe = (e) => {
|
|
78
|
-
|
|
79
|
-
D.value || (A.value = t), _("change", t);
|
|
76
|
+
J(g.value.addMonths(e, -1, T.value));
|
|
80
77
|
}, pe = (e) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
Y(v.value.addMonths(R.value, -1, T.value));
|
|
78
|
+
let t = ce(e);
|
|
79
|
+
D.value || (A.value = t), h("change", t);
|
|
80
|
+
}, me = (e) => {
|
|
81
|
+
k.value || (N.value = e), h("previewDateChange", e);
|
|
88
82
|
}, he = () => {
|
|
89
|
-
if (
|
|
90
|
-
P.value =
|
|
83
|
+
if (I.value === "year") {
|
|
84
|
+
P.value = Math.max(1, G.value - 15);
|
|
91
85
|
return;
|
|
92
86
|
}
|
|
93
|
-
|
|
87
|
+
J(g.value.addMonths(L.value, -1, T.value));
|
|
94
88
|
}, ge = () => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
J("date");
|
|
109
|
-
},
|
|
110
|
-
color:
|
|
111
|
-
error:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
})), X = a(() => x.value.orientation === "vertical"), we = a(() => r(S.value?.root, C.value, p({
|
|
89
|
+
if (I.value === "year") {
|
|
90
|
+
P.value = G.value + 15;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
J(g.value.addMonths(L.value, 1, T.value));
|
|
94
|
+
}, _e = () => {
|
|
95
|
+
let e = g.value.startOfMonth(g.value.now(T.value), T.value);
|
|
96
|
+
P.value = null, J(e), q("date");
|
|
97
|
+
}, ve = (e) => {
|
|
98
|
+
P.value = null, J(g.value.setYear(L.value, e, T.value)), q(b.value.hideMonths ? "date" : "month");
|
|
99
|
+
}, Y = () => {
|
|
100
|
+
q("month");
|
|
101
|
+
}, ye = (e) => {
|
|
102
|
+
J(g.value.setMonth(L.value, e, T.value)), q("date");
|
|
103
|
+
}, be = U, xe = W, Se = a(() => ({
|
|
104
|
+
color: b.value.color,
|
|
105
|
+
error: b.value.error,
|
|
106
|
+
rounded: b.value.rounded,
|
|
107
|
+
maxDate: b.value.maxDate,
|
|
108
|
+
minDate: b.value.minDate,
|
|
109
|
+
disabled: b.value.disabled,
|
|
110
|
+
readOnly: b.value.readOnly,
|
|
111
|
+
timeZone: b.value.timeZone
|
|
112
|
+
})), X = a(() => b.value.orientation === "vertical"), Ce = a(() => r(S.value?.root, C.value, p({
|
|
120
113
|
"flex flex-col overflow-hidden": !0,
|
|
121
|
-
"w-full":
|
|
114
|
+
"w-full": b.value.fill,
|
|
122
115
|
"min-w-max": !0,
|
|
123
|
-
"w-fit": !
|
|
116
|
+
"w-fit": !b.value.fill && X.value,
|
|
124
117
|
[w.value.root ?? ""]: !0
|
|
125
|
-
}))),
|
|
126
|
-
"flex w-full items-center p-2.5": !0,
|
|
118
|
+
}))), we = a(() => r(S.value?.header, {}, p({
|
|
119
|
+
"relative flex w-full items-center p-2.5": !0,
|
|
127
120
|
[w.value.header ?? ""]: !0
|
|
128
|
-
}))),
|
|
129
|
-
"flex min-w-0 flex-1 items-center": !0,
|
|
130
|
-
"justify-between": !X.value,
|
|
131
|
-
"justify-start": X.value,
|
|
121
|
+
}))), Te = a(() => r(S.value?.months, {}, p({
|
|
122
|
+
"flex min-w-0 flex-1 items-center justify-center": !0,
|
|
132
123
|
[w.value.months ?? ""]: !0
|
|
124
|
+
}))), Ee = a(() => r(S.value?.startHeader, {}, p({
|
|
125
|
+
"flex min-w-0 flex-1 items-center pr-4": !0,
|
|
126
|
+
[w.value.startHeader ?? ""]: !0
|
|
133
127
|
}))), De = a(() => r(S.value?.endHeader, {}, p({
|
|
134
|
-
"
|
|
128
|
+
"items-center": !0,
|
|
129
|
+
"flex min-w-0 flex-1 items-center pl-4": !X.value || I.value === "month",
|
|
130
|
+
"flex justify-center": X.value && I.value !== "month",
|
|
135
131
|
[w.value.endHeader ?? ""]: !0
|
|
136
132
|
}))), Oe = a(() => r(S.value?.body, {}, p({
|
|
137
|
-
"flex min-h-64 flex-col
|
|
133
|
+
"relative flex min-h-64 flex-col": !0,
|
|
138
134
|
[w.value.body ?? ""]: !0
|
|
139
|
-
}))), ke = a(() => r(S.value?.panels, {}, p({
|
|
140
|
-
"flex w-full
|
|
135
|
+
}))), ke = a(() => r(S.value?.panels, { "aria-hidden": I.value !== "date" }, p({
|
|
136
|
+
"flex w-full": !0,
|
|
141
137
|
"flex-row": !X.value,
|
|
142
138
|
"flex-col": X.value,
|
|
139
|
+
invisible: I.value !== "date",
|
|
143
140
|
[w.value.panels ?? ""]: !0
|
|
144
141
|
}))), Ae = a(() => r(S.value?.start, {}, p({
|
|
145
|
-
"flex min-w-72 flex-1 flex-col": !0,
|
|
142
|
+
"flex min-w-72 flex-1 flex-col px-2.5": !0,
|
|
143
|
+
"pb-2.5": !X.value,
|
|
146
144
|
[w.value.start ?? ""]: !0
|
|
147
145
|
}))), je = a(() => r(S.value?.end, {}, p({
|
|
148
|
-
"flex min-w-72 flex-1 flex-col": !0,
|
|
146
|
+
"flex min-w-72 flex-1 flex-col px-2.5 pb-2.5": !0,
|
|
149
147
|
[w.value.end ?? ""]: !0
|
|
150
|
-
}))), Me = a(() => p({ "
|
|
148
|
+
}))), Me = a(() => p({ "absolute inset-0 z-10 flex flex-col bg-white p-2.5 dark:bg-dark-900": !0 })), Z = a(() => r(S.value?.selector, {
|
|
151
149
|
type: "button",
|
|
152
|
-
disabled:
|
|
150
|
+
disabled: b.value.disabled
|
|
153
151
|
}, p({
|
|
154
152
|
"inline-flex cursor-pointer items-center gap-x-2 px-1.5 py-1 text-sm font-medium text-dark-600 hover:bg-dark-100 focus:outline-none disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
|
|
155
|
-
[
|
|
153
|
+
[K.value ?? ""]: !0,
|
|
156
154
|
[w.value.selector ?? ""]: !0
|
|
157
155
|
}))), Q = a(() => r(S.value?.navButton, {
|
|
158
156
|
type: "button",
|
|
159
|
-
disabled:
|
|
157
|
+
disabled: b.value.disabled
|
|
160
158
|
}, p({
|
|
161
159
|
"inline-flex size-8 shrink-0 cursor-pointer items-center justify-center text-dark-600 hover:bg-dark-100 disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
|
|
162
|
-
[
|
|
160
|
+
[K.value ?? ""]: !0,
|
|
163
161
|
[w.value.navButton ?? ""]: !0
|
|
164
|
-
}))), Ne = a(() =>
|
|
162
|
+
}))), Ne = a(() => I.value === "year" ? _("Previous years") : _("Previous month")), Pe = a(() => I.value === "year" ? _("Next years") : _("Next month")), Fe = a(() => r(S.value?.previousButton, {
|
|
165
163
|
...Q.value,
|
|
166
|
-
onClick:
|
|
164
|
+
onClick: he,
|
|
167
165
|
type: "button",
|
|
168
|
-
disabled:
|
|
166
|
+
disabled: b.value.disabled,
|
|
169
167
|
"aria-label": Ne.value
|
|
170
168
|
}, p({ [w.value.navButton ?? ""]: !0 }))), Ie = a(() => r(S.value?.nextButton, {
|
|
171
169
|
...Q.value,
|
|
172
|
-
onClick:
|
|
170
|
+
onClick: ge,
|
|
173
171
|
type: "button",
|
|
174
|
-
disabled:
|
|
172
|
+
disabled: b.value.disabled,
|
|
175
173
|
"aria-label": Pe.value
|
|
176
174
|
}, p({ [w.value.navButton ?? ""]: !0 }))), Le = a(() => r(S.value?.todayButton, {
|
|
177
|
-
onClick:
|
|
175
|
+
onClick: _e,
|
|
178
176
|
type: "button",
|
|
179
|
-
disabled:
|
|
180
|
-
"aria-label":
|
|
177
|
+
disabled: b.value.disabled,
|
|
178
|
+
"aria-label": _("Today")
|
|
181
179
|
}, p({
|
|
182
180
|
"inline-flex size-8 shrink-0 cursor-pointer items-center justify-center hover:bg-dark-100 disabled:cursor-not-allowed dark:hover:bg-dark-800": !0,
|
|
183
|
-
[
|
|
181
|
+
[K.value ?? ""]: !0,
|
|
184
182
|
[w.value.navButton ?? ""]: !0
|
|
185
183
|
}))), $ = a(() => r(S.value?.selector, void 0, {
|
|
186
184
|
...Z.value,
|
|
187
|
-
onClick:
|
|
185
|
+
onClick: ue,
|
|
188
186
|
type: "button",
|
|
189
|
-
"aria-label":
|
|
190
|
-
disabled:
|
|
187
|
+
"aria-label": _("Select year"),
|
|
188
|
+
disabled: b.value.disabled || b.value.hideYears
|
|
191
189
|
})), Re = a(() => ({
|
|
192
190
|
...r(S.value?.selector, void 0, {
|
|
193
191
|
...Z.value,
|
|
194
192
|
type: "button",
|
|
195
|
-
"aria-label":
|
|
196
|
-
disabled:
|
|
193
|
+
"aria-label": _("Select month"),
|
|
194
|
+
disabled: b.value.disabled || b.value.hideMonths
|
|
197
195
|
}),
|
|
198
|
-
onClick:
|
|
196
|
+
onClick: Y
|
|
199
197
|
})), ze = a(() => ({
|
|
200
198
|
...r(S.value?.selector, void 0, {
|
|
201
199
|
...Z.value,
|
|
202
200
|
type: "button",
|
|
203
|
-
"aria-label":
|
|
204
|
-
disabled:
|
|
201
|
+
"aria-label": _("Select end month"),
|
|
202
|
+
disabled: b.value.disabled || b.value.hideMonths
|
|
205
203
|
}),
|
|
206
|
-
onClick:
|
|
207
|
-
})), Be = a(() => !
|
|
204
|
+
onClick: Y
|
|
205
|
+
})), Be = a(() => !b.value.hideYears), Ve = a(() => !b.value.hideMonths);
|
|
208
206
|
return {
|
|
209
|
-
view:
|
|
210
|
-
value:
|
|
211
|
-
shared:
|
|
212
|
-
merged:
|
|
207
|
+
view: I,
|
|
208
|
+
value: F,
|
|
209
|
+
shared: Se,
|
|
210
|
+
merged: b,
|
|
213
211
|
showNav: a(() => !0),
|
|
214
212
|
endBind: je,
|
|
215
|
-
rootBind:
|
|
213
|
+
rootBind: Ce,
|
|
216
214
|
bodyBind: Oe,
|
|
217
|
-
viewDate:
|
|
218
|
-
viewYear:
|
|
215
|
+
viewDate: L,
|
|
216
|
+
viewYear: U,
|
|
219
217
|
startBind: Ae,
|
|
220
|
-
viewMonth:
|
|
221
|
-
yearLabel:
|
|
222
|
-
monthLabel:
|
|
223
|
-
headerBind:
|
|
224
|
-
monthsBind:
|
|
218
|
+
viewMonth: W,
|
|
219
|
+
yearLabel: B,
|
|
220
|
+
monthLabel: V,
|
|
221
|
+
headerBind: we,
|
|
222
|
+
monthsBind: Te,
|
|
225
223
|
panelsBind: ke,
|
|
226
224
|
isVertical: X,
|
|
227
|
-
endViewDate:
|
|
228
|
-
previewDate:
|
|
229
|
-
setViewDate:
|
|
225
|
+
endViewDate: R,
|
|
226
|
+
previewDate: z,
|
|
227
|
+
setViewDate: J,
|
|
230
228
|
navIconBind: a(() => S.value?.navIcon),
|
|
231
|
-
|
|
232
|
-
handleChange: fe,
|
|
229
|
+
handleChange: pe,
|
|
233
230
|
yearPageSize: 15,
|
|
234
|
-
endMonthLabel:
|
|
231
|
+
endMonthLabel: H,
|
|
235
232
|
endHeaderBind: De,
|
|
236
233
|
monthYearBind: Me,
|
|
237
234
|
nextButtonBind: Ie,
|
|
238
|
-
monthPanelYear:
|
|
235
|
+
monthPanelYear: be,
|
|
236
|
+
startHeaderBind: Ee,
|
|
239
237
|
todayButtonBind: Le,
|
|
240
|
-
monthPanelValue:
|
|
238
|
+
monthPanelValue: xe,
|
|
241
239
|
yearSelectorBind: $,
|
|
242
|
-
handleYearSelect:
|
|
240
|
+
handleYearSelect: ve,
|
|
243
241
|
showYearSelector: Be,
|
|
244
242
|
monthSelectorBind: Re,
|
|
245
|
-
handleMonthSelect:
|
|
243
|
+
handleMonthSelect: ye,
|
|
246
244
|
showMonthSelector: Ve,
|
|
247
245
|
previousButtonBind: Fe,
|
|
248
246
|
endMonthSelectorBind: ze,
|
|
249
|
-
handleEndViewDateChange:
|
|
250
|
-
handlePreviewDateChange:
|
|
251
|
-
handleStartViewDateChange:
|
|
252
|
-
yearPageStart:
|
|
247
|
+
handleEndViewDateChange: fe,
|
|
248
|
+
handlePreviewDateChange: me,
|
|
249
|
+
handleStartViewDateChange: de,
|
|
250
|
+
yearPageStart: G
|
|
253
251
|
};
|
|
254
252
|
}
|
|
255
253
|
//#endregion
|
|
256
|
-
export {
|
|
254
|
+
export { m as useCalendarRange };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CalendarRangeClasses, CalendarRangeColorOverrides, CalendarRangeCustomProps, CalendarRangeEmits, CalendarRangeOrientation, CalendarRangeOwnProps, CalendarRangeProps, CalendarRangeRoundedOverrides, CalendarRangeSlots,
|
|
1
|
+
export type { CalendarRangeClasses, CalendarRangeColorOverrides, CalendarRangeCustomProps, CalendarRangeEmits, CalendarRangeOrientation, CalendarRangeOwnProps, CalendarRangeProps, CalendarRangeRoundedOverrides, CalendarRangeSlots, CalendarRangeView, } from './calendarRange.types';
|
|
2
2
|
export { default as CalendarRange } from './CalendarRange.vue';
|
|
3
3
|
export { useCalendarRange } from './composables/useCalendarRange';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, HTMLAttributes } from 'vue';
|
|
2
|
-
import { CalendarColor,
|
|
2
|
+
import { CalendarColor, CalendarRounded } from '@bridge-ui/core/Tokens';
|
|
3
3
|
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
export interface CalendarYearColorOverrides {}
|
|
5
5
|
export interface CalendarYearRoundedOverrides {}
|
|
@@ -43,16 +43,6 @@ export interface CalendarYearEmits {
|
|
|
43
43
|
*/
|
|
44
44
|
change: [year: number];
|
|
45
45
|
}
|
|
46
|
-
export interface CalendarYearTokens {
|
|
47
|
-
/**
|
|
48
|
-
* Color token map overrides.
|
|
49
|
-
*/
|
|
50
|
-
color?: Record<string, Partial<CalendarColorItem>>;
|
|
51
|
-
/**
|
|
52
|
-
* Border radius token map overrides.
|
|
53
|
-
*/
|
|
54
|
-
rounded?: Record<string, string>;
|
|
55
|
-
}
|
|
56
46
|
export interface CalendarYearOwnProps {
|
|
57
47
|
/**
|
|
58
48
|
* Classes for calendar regions.
|
|
@@ -132,12 +122,6 @@ export interface CalendarYearOwnProps {
|
|
|
132
122
|
* @default undefined
|
|
133
123
|
*/
|
|
134
124
|
timeZone?: string;
|
|
135
|
-
/**
|
|
136
|
-
* Token overrides.
|
|
137
|
-
*
|
|
138
|
-
* @default undefined
|
|
139
|
-
*/
|
|
140
|
-
tokens?: CalendarYearTokens;
|
|
141
125
|
/**
|
|
142
126
|
* Selected year.
|
|
143
127
|
*
|
|
@@ -14,7 +14,7 @@ export type CalendarYearCell = {
|
|
|
14
14
|
export declare function useCalendarYear(props: MaybeRefOrGetter<CalendarYearOwnProps>, libDefaults: CalendarYearLibDefaults, emit: (event: "change", year: number) => void): {
|
|
15
15
|
years: import('vue').ComputedRef<CalendarYearCell[]>;
|
|
16
16
|
merged: import('vue').ComputedRef<CalendarYearMerged>;
|
|
17
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<CalendarYearOwnProps, "error" | "color" | "value" | "classes" | "
|
|
17
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<CalendarYearOwnProps, "error" | "color" | "value" | "classes" | "customProps" | "rounded" | "disabled" | "readOnly" | "disableYears" | "maxDate" | "minDate" | "timeZone" | "pageSize" | "startYear">>>>;
|
|
18
18
|
gridBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
19
19
|
role: string;
|
|
20
20
|
}>>;
|
|
@@ -10,7 +10,6 @@ var y = 15, b = [
|
|
|
10
10
|
"color",
|
|
11
11
|
"error",
|
|
12
12
|
"value",
|
|
13
|
-
"tokens",
|
|
14
13
|
"classes",
|
|
15
14
|
"maxDate",
|
|
16
15
|
"minDate",
|
|
@@ -30,31 +29,32 @@ function x(x, S, C) {
|
|
|
30
29
|
...w,
|
|
31
30
|
...o(x)
|
|
32
31
|
}
|
|
33
|
-
})), { merged: O } = r({
|
|
32
|
+
})), { merged: O, entry: k } = r({
|
|
34
33
|
libDefaults: S,
|
|
34
|
+
componentName: "Calendar",
|
|
35
35
|
props: () => D.value.componentProps
|
|
36
|
-
}),
|
|
36
|
+
}), A = a(() => O.value.customProps), j = a(() => u(D.value.inheritedAttrs, ["onChange"])), M = i({
|
|
37
37
|
props: () => D.value.componentProps,
|
|
38
38
|
entry: a(() => {})
|
|
39
|
-
}),
|
|
39
|
+
}), N = a(() => E(O.value.timeZone)), P = a(() => O.value.pageSize ?? y), F = a(() => {
|
|
40
40
|
if (!l(O.value.startYear)) return O.value.startYear;
|
|
41
|
-
let e = O.value.value ?? T.value.getYear(T.value.now(
|
|
41
|
+
let e = O.value.value ?? T.value.getYear(T.value.now(N.value), N.value), t = Math.floor(P.value / 2);
|
|
42
42
|
return Math.max(1, e - t);
|
|
43
|
-
}), F = a(() => {
|
|
44
|
-
let e = _(m, O.value.tokens?.rounded);
|
|
45
|
-
return c(e, O.value.rounded);
|
|
46
43
|
}), I = a(() => {
|
|
47
|
-
let e = _(
|
|
44
|
+
let e = _(m, k.value?.tokens?.rounded);
|
|
45
|
+
return c(e, O.value.rounded);
|
|
46
|
+
}), L = a(() => {
|
|
47
|
+
let e = _(p, k.value?.tokens?.color);
|
|
48
48
|
return g({
|
|
49
49
|
tokens: e,
|
|
50
50
|
color: O.value.color,
|
|
51
51
|
invalid: O.value.error
|
|
52
52
|
});
|
|
53
|
-
}),
|
|
54
|
-
let n =
|
|
53
|
+
}), R = a(() => Array.from({ length: P.value }, (e, t) => {
|
|
54
|
+
let n = F.value + t, r = !!O.value.disabled || d({
|
|
55
55
|
year: n,
|
|
56
56
|
adapter: T.value,
|
|
57
|
-
context:
|
|
57
|
+
context: N.value,
|
|
58
58
|
maxDate: O.value.maxDate,
|
|
59
59
|
minDate: O.value.minDate,
|
|
60
60
|
disableYears: O.value.disableYears
|
|
@@ -70,45 +70,45 @@ function x(x, S, C) {
|
|
|
70
70
|
label: String(n),
|
|
71
71
|
disabled: r || !!O.value.readOnly
|
|
72
72
|
};
|
|
73
|
-
})),
|
|
73
|
+
})), z = (e) => {
|
|
74
74
|
O.value.disabled || O.value.readOnly || d({
|
|
75
75
|
year: e,
|
|
76
76
|
adapter: T.value,
|
|
77
|
-
context:
|
|
77
|
+
context: N.value,
|
|
78
78
|
maxDate: O.value.maxDate,
|
|
79
79
|
minDate: O.value.minDate,
|
|
80
80
|
disableYears: O.value.disableYears
|
|
81
81
|
}) || C("change", e);
|
|
82
82
|
};
|
|
83
83
|
return {
|
|
84
|
-
years:
|
|
84
|
+
years: R,
|
|
85
85
|
merged: O,
|
|
86
|
-
rootBind: a(() => n(
|
|
86
|
+
rootBind: a(() => n(A.value?.root, j.value, h({
|
|
87
87
|
"flex flex-col": !0,
|
|
88
|
-
[
|
|
88
|
+
[M.value.root ?? ""]: !0
|
|
89
89
|
}))),
|
|
90
|
-
gridBind: a(() => n(
|
|
90
|
+
gridBind: a(() => n(A.value?.grid, { role: "grid" }, h({
|
|
91
91
|
"grid grid-cols-3 gap-2": !0,
|
|
92
|
-
[
|
|
92
|
+
[M.value.grid ?? ""]: !0
|
|
93
93
|
}))),
|
|
94
|
-
pageSize:
|
|
95
|
-
startYear:
|
|
96
|
-
selectYear:
|
|
94
|
+
pageSize: P,
|
|
95
|
+
startYear: F,
|
|
96
|
+
selectYear: z,
|
|
97
97
|
getYearBind: (e) => {
|
|
98
|
-
let t =
|
|
99
|
-
return n(
|
|
98
|
+
let t = L.value;
|
|
99
|
+
return n(A.value?.year, {
|
|
100
100
|
type: "button",
|
|
101
101
|
disabled: e.disabled,
|
|
102
102
|
"aria-pressed": e.selected,
|
|
103
|
-
onClick: () =>
|
|
103
|
+
onClick: () => z(e.year)
|
|
104
104
|
}, h({
|
|
105
105
|
"cursor-pointer p-2.5 text-xs uppercase transition-all duration-150 ease-in-out outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed": !0,
|
|
106
|
-
[
|
|
106
|
+
[I.value ?? ""]: !0,
|
|
107
107
|
[t?.soft ?? ""]: e.state === "base",
|
|
108
108
|
[t?.hover ?? ""]: e.state === "base",
|
|
109
109
|
[t?.selected ?? ""]: e.state === "selected",
|
|
110
110
|
[t?.disabled ?? ""]: e.state === "disabled",
|
|
111
|
-
[
|
|
111
|
+
[M.value.year ?? ""]: !0
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
114
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CalendarYearClasses, CalendarYearColorOverrides, CalendarYearCustomProps, CalendarYearEmits, CalendarYearOwnProps, CalendarYearProps, CalendarYearRoundedOverrides,
|
|
1
|
+
export type { CalendarYearClasses, CalendarYearColorOverrides, CalendarYearCustomProps, CalendarYearEmits, CalendarYearOwnProps, CalendarYearProps, CalendarYearRoundedOverrides, } from './calendarYear.types';
|
|
2
2
|
export { default as CalendarYear } from './CalendarYear.vue';
|
|
3
3
|
export { useCalendarYear, type CalendarYearCell, } from './composables/useCalendarYear';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ColorFieldOwnProps, ColorFieldSlots } from './colorField.types';
|
|
2
|
+
type __VLS_Slots = ColorFieldSlots;
|
|
3
|
+
type __VLS_Props = ColorFieldOwnProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: null | string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
clear: () => any;
|
|
10
|
+
apply: () => any;
|
|
11
|
+
cancel: () => any;
|
|
12
|
+
change: (value: string | null) => any;
|
|
13
|
+
close: () => any;
|
|
14
|
+
open: () => any;
|
|
15
|
+
"update:modelValue": (value: string | null | undefined) => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
onClear?: (() => any) | undefined;
|
|
18
|
+
onApply?: (() => any) | undefined;
|
|
19
|
+
onCancel?: (() => any) | undefined;
|
|
20
|
+
onChange?: ((value: string | null) => any) | undefined;
|
|
21
|
+
onClose?: (() => any) | undefined;
|
|
22
|
+
onOpen?: (() => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
fill: boolean;
|
|
26
|
+
showFooter: boolean;
|
|
27
|
+
showErrorIcon: boolean;
|
|
28
|
+
clearable: boolean;
|
|
29
|
+
showSwatch: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|