@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
|
@@ -22,11 +22,12 @@ export type TimePanelItem = {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function useTimePanel(props: MaybeRefOrGetter<TimePanelOwnProps>, libDefaults: TimePanelLibDefaults, emit: (event: "change", value: Date | null) => void): {
|
|
24
24
|
merged: import('vue').ComputedRef<TimePanelMerged>;
|
|
25
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<TimePanelOwnProps, "error" | "color" | "fill" | "value" | "classes" | "
|
|
25
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<TimePanelOwnProps, "error" | "color" | "fill" | "value" | "classes" | "customProps" | "rounded" | "disabled" | "readOnly" | "timeZone" | "ampm" | "disableTimes" | "interval" | "maxTime" | "minTime" | "showSeconds">>>>;
|
|
26
26
|
hourItems: import('vue').ComputedRef<TimePanelItem[]>;
|
|
27
27
|
columnBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
28
28
|
getHourBind: (item: TimePanelItem) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').ButtonHTMLAttributes | undefined, {
|
|
29
29
|
type: "button";
|
|
30
|
+
"aria-label": string;
|
|
30
31
|
disabled: boolean;
|
|
31
32
|
"aria-pressed": boolean;
|
|
32
33
|
onClick: () => void;
|
|
@@ -38,12 +39,14 @@ export declare function useTimePanel(props: MaybeRefOrGetter<TimePanelOwnProps>,
|
|
|
38
39
|
showMeridiem: import('vue').ComputedRef<boolean>;
|
|
39
40
|
getMinuteBind: (item: TimePanelItem) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').ButtonHTMLAttributes | undefined, {
|
|
40
41
|
type: "button";
|
|
42
|
+
"aria-label": string;
|
|
41
43
|
disabled: boolean;
|
|
42
44
|
"aria-pressed": boolean;
|
|
43
45
|
onClick: () => void;
|
|
44
46
|
}>;
|
|
45
47
|
getSecondBind: (item: TimePanelItem) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').ButtonHTMLAttributes | undefined, {
|
|
46
48
|
type: "button";
|
|
49
|
+
"aria-label": string;
|
|
47
50
|
disabled: boolean;
|
|
48
51
|
"aria-pressed": boolean;
|
|
49
52
|
onClick: () => void;
|
|
@@ -51,6 +54,7 @@ export declare function useTimePanel(props: MaybeRefOrGetter<TimePanelOwnProps>,
|
|
|
51
54
|
meridiemItems: import('vue').ComputedRef<TimePanelItem[]>;
|
|
52
55
|
getMeridiemBind: (item: TimePanelItem) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').ButtonHTMLAttributes | undefined, {
|
|
53
56
|
type: "button";
|
|
57
|
+
"aria-label": string;
|
|
54
58
|
disabled: boolean;
|
|
55
59
|
"aria-pressed": boolean;
|
|
56
60
|
onClick: () => void;
|
|
@@ -2,17 +2,16 @@ import { useDateAdapter as e, useDateAdapterContext as t } from "../../../Adapte
|
|
|
2
2
|
import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
3
3
|
import { computed as a, toValue as o, useAttrs as s } from "vue";
|
|
4
4
|
import { get as c, omit as l } from "es-toolkit/compat";
|
|
5
|
-
import { buildHourOptions as u, buildMinuteOptions as d, buildSecondOptions as f, isTimeDisabled as p, resolveCalendarDayInteractionState as m, snapMinutes as
|
|
6
|
-
import { timeColorProps as
|
|
7
|
-
import { cn as
|
|
5
|
+
import { buildHourOptions as u, buildMinuteOptions as d, buildSecondOptions as f, isTimeDisabled as p, resolveCalendarDayInteractionState as m, snapMinutes as ee, to12Hour as h, to24Hour as g, toMeridiem as te } from "@bridge-ui/core/Domain";
|
|
6
|
+
import { timeColorProps as _, timeRoundedProps as v } from "@bridge-ui/core/Tokens";
|
|
7
|
+
import { cn as y, getColorToken as b, mergeBridgeUILayeredClasses as x, splitComponentProps as S } from "@bridge-ui/core/Utils";
|
|
8
8
|
//#region src/Components/TimePanel/composables/useTimePanel.ts
|
|
9
|
-
var
|
|
9
|
+
var C = [
|
|
10
10
|
"ampm",
|
|
11
11
|
"fill",
|
|
12
12
|
"color",
|
|
13
13
|
"error",
|
|
14
14
|
"value",
|
|
15
|
-
"tokens",
|
|
16
15
|
"classes",
|
|
17
16
|
"maxTime",
|
|
18
17
|
"minTime",
|
|
@@ -26,57 +25,58 @@ var te = [
|
|
|
26
25
|
"disableTimes"
|
|
27
26
|
], w = "w-[3.75rem]", T = "min-w-[3.75rem]";
|
|
28
27
|
function E(w, E, D) {
|
|
29
|
-
let O = s(), k = e(), A = t(), j = a(() =>
|
|
30
|
-
bridgeKeys:
|
|
28
|
+
let O = s(), k = e(), A = t(), j = a(() => S({
|
|
29
|
+
bridgeKeys: C,
|
|
31
30
|
props: {
|
|
32
31
|
...O,
|
|
33
32
|
...o(w)
|
|
34
33
|
}
|
|
35
|
-
})), { merged: M } = r({
|
|
34
|
+
})), { merged: M, entry: N } = r({
|
|
36
35
|
libDefaults: E,
|
|
36
|
+
componentName: "TimePanel",
|
|
37
37
|
props: () => j.value.componentProps
|
|
38
|
-
}),
|
|
38
|
+
}), P = a(() => M.value.customProps), F = a(() => l(j.value.inheritedAttrs, ["onChange"])), I = i({
|
|
39
39
|
props: () => j.value.componentProps,
|
|
40
40
|
entry: a(() => {})
|
|
41
|
-
}),
|
|
42
|
-
let e =
|
|
41
|
+
}), L = a(() => A(M.value.timeZone)), R = a(() => {
|
|
42
|
+
let e = x(v, N.value?.tokens?.rounded);
|
|
43
43
|
return c(e, M.value.rounded);
|
|
44
|
-
}),
|
|
45
|
-
let e =
|
|
46
|
-
return
|
|
44
|
+
}), z = a(() => {
|
|
45
|
+
let e = x(_, N.value?.tokens?.color);
|
|
46
|
+
return b({
|
|
47
47
|
tokens: e,
|
|
48
48
|
color: M.value.color,
|
|
49
49
|
invalid: M.value.error
|
|
50
50
|
});
|
|
51
|
-
}),
|
|
52
|
-
let e = M.value.value ?? k.value.now(
|
|
53
|
-
return r = k.value.setMinutes(r, t,
|
|
54
|
-
}), ne = a(() => u({ ampm: M.value.ampm })),
|
|
51
|
+
}), B = a(() => {
|
|
52
|
+
let e = M.value.value ?? k.value.now(L.value), t = ee(k.value.getMinutes(e, L.value), M.value.interval), n = M.value.showSeconds ? k.value.getSeconds(e, L.value) : 0, r = k.value.setHours(e, k.value.getHours(e, L.value), L.value);
|
|
53
|
+
return r = k.value.setMinutes(r, t, L.value), r = k.value.setSeconds(r, n, L.value), r;
|
|
54
|
+
}), ne = a(() => u({ ampm: M.value.ampm })), V = a(() => d({ interval: M.value.interval })), H = a(() => f()), U = a(() => te(k.value.getHours(B.value, L.value))), W = (e) => !!M.value.disabled || p(e, {
|
|
55
55
|
adapter: k.value,
|
|
56
|
-
context:
|
|
56
|
+
context: L.value,
|
|
57
57
|
maxTime: M.value.maxTime,
|
|
58
58
|
minTime: M.value.minTime,
|
|
59
59
|
disableTimes: M.value.disableTimes
|
|
60
|
-
}),
|
|
61
|
-
M.value.disabled || M.value.readOnly ||
|
|
62
|
-
}, G = (e) => {
|
|
63
|
-
let t = M.value.ampm ? _(e, H.value) : e, n = k.value.setHours(z.value, t, I.value);
|
|
64
|
-
n = k.value.setMinutes(n, k.value.getMinutes(z.value, I.value), I.value), W(n);
|
|
60
|
+
}), G = (e) => {
|
|
61
|
+
M.value.disabled || M.value.readOnly || W(e) || D("change", e);
|
|
65
62
|
}, K = (e) => {
|
|
66
|
-
let t = k.value.
|
|
67
|
-
|
|
63
|
+
let t = M.value.ampm ? g(e, U.value) : e, n = k.value.setHours(B.value, t, L.value);
|
|
64
|
+
n = k.value.setMinutes(n, k.value.getMinutes(B.value, L.value), L.value), G(n);
|
|
68
65
|
}, q = (e) => {
|
|
69
|
-
let t = k.value.
|
|
70
|
-
|
|
66
|
+
let t = k.value.setMinutes(B.value, e, L.value);
|
|
67
|
+
G(t);
|
|
71
68
|
}, J = (e) => {
|
|
72
|
-
let t =
|
|
73
|
-
|
|
74
|
-
}, Y =
|
|
75
|
-
let
|
|
69
|
+
let t = k.value.setSeconds(B.value, e, L.value);
|
|
70
|
+
G(t);
|
|
71
|
+
}, Y = (e) => {
|
|
72
|
+
let t = h(k.value.getHours(B.value, L.value)), n = g(t, e), r = k.value.setHours(B.value, n, L.value);
|
|
73
|
+
r = k.value.setMinutes(r, k.value.getMinutes(B.value, L.value), L.value), G(r);
|
|
74
|
+
}, X = a(() => {
|
|
75
|
+
let e = k.value.getHours(B.value, L.value), t = M.value.ampm ? h(e) : e;
|
|
76
76
|
return ne.value.map((e) => {
|
|
77
|
-
let n = M.value.ampm ?
|
|
78
|
-
r = k.value.setMinutes(r, k.value.getMinutes(
|
|
79
|
-
let i =
|
|
77
|
+
let n = M.value.ampm ? g(e, U.value) : e, r = k.value.setHours(B.value, n, L.value);
|
|
78
|
+
r = k.value.setMinutes(r, k.value.getMinutes(B.value, L.value), L.value);
|
|
79
|
+
let i = W(r), a = e === t;
|
|
80
80
|
return {
|
|
81
81
|
state: m({
|
|
82
82
|
disabled: i,
|
|
@@ -89,10 +89,10 @@ function E(w, E, D) {
|
|
|
89
89
|
label: M.value.ampm ? String(e) : String(e).padStart(2, "0")
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
|
-
}),
|
|
93
|
-
let e = k.value.getMinutes(
|
|
94
|
-
return
|
|
95
|
-
let n = k.value.setMinutes(
|
|
92
|
+
}), Z = a(() => {
|
|
93
|
+
let e = k.value.getMinutes(B.value, L.value);
|
|
94
|
+
return V.value.map((t) => {
|
|
95
|
+
let n = k.value.setMinutes(B.value, t, L.value), r = W(n), i = t === e;
|
|
96
96
|
return {
|
|
97
97
|
state: m({
|
|
98
98
|
disabled: r,
|
|
@@ -105,11 +105,11 @@ function E(w, E, D) {
|
|
|
105
105
|
disabled: r || !!M.value.readOnly
|
|
106
106
|
};
|
|
107
107
|
});
|
|
108
|
-
}),
|
|
108
|
+
}), re = a(() => {
|
|
109
109
|
if (!M.value.showSeconds) return [];
|
|
110
|
-
let e = k.value.getSeconds(
|
|
111
|
-
return
|
|
112
|
-
let n = k.value.setSeconds(
|
|
110
|
+
let e = k.value.getSeconds(B.value, L.value);
|
|
111
|
+
return H.value.map((t) => {
|
|
112
|
+
let n = k.value.setSeconds(B.value, t, L.value), r = W(n), i = t === e;
|
|
113
113
|
return {
|
|
114
114
|
state: m({
|
|
115
115
|
disabled: r,
|
|
@@ -122,10 +122,10 @@ function E(w, E, D) {
|
|
|
122
122
|
disabled: r || !!M.value.readOnly
|
|
123
123
|
};
|
|
124
124
|
});
|
|
125
|
-
}),
|
|
126
|
-
let t =
|
|
127
|
-
r = k.value.setMinutes(r, k.value.getMinutes(
|
|
128
|
-
let i =
|
|
125
|
+
}), ie = a(() => M.value.ampm ? ["AM", "PM"].map((e) => {
|
|
126
|
+
let t = h(k.value.getHours(B.value, L.value)), n = g(t, e), r = k.value.setHours(B.value, n, L.value);
|
|
127
|
+
r = k.value.setMinutes(r, k.value.getMinutes(B.value, L.value), L.value);
|
|
128
|
+
let i = W(r), a = e === U.value;
|
|
129
129
|
return {
|
|
130
130
|
state: m({
|
|
131
131
|
disabled: i,
|
|
@@ -137,55 +137,56 @@ function E(w, E, D) {
|
|
|
137
137
|
value: e,
|
|
138
138
|
disabled: i || !!M.value.readOnly
|
|
139
139
|
};
|
|
140
|
-
}) : []),
|
|
140
|
+
}) : []), ae = a(() => n(P.value?.root, F.value, y({
|
|
141
141
|
"flex h-72 flex-row gap-2": !0,
|
|
142
142
|
"w-full min-w-fit": M.value.fill,
|
|
143
143
|
"w-fit min-w-fit": !M.value.fill,
|
|
144
|
-
[
|
|
145
|
-
}))),
|
|
146
|
-
"box-border flex h-full min-w-0 flex-1 flex-col items-stretch gap-1 overflow-x-hidden overflow-y-auto
|
|
144
|
+
[I.value.root ?? ""]: !0
|
|
145
|
+
}))), Q = a(() => n(P.value?.column, {}, y({
|
|
146
|
+
"box-border flex h-full min-w-0 flex-1 flex-col items-stretch gap-1 overflow-x-hidden overflow-y-auto bridge-scroll-fade-y bridge-hide-scrollbar": !0,
|
|
147
147
|
[T]: !0,
|
|
148
|
-
[
|
|
149
|
-
}))),
|
|
150
|
-
let
|
|
151
|
-
return n(
|
|
148
|
+
[I.value.column ?? ""]: !0
|
|
149
|
+
}))), $ = (e, t, r) => {
|
|
150
|
+
let i = z.value;
|
|
151
|
+
return n(P.value?.item, {
|
|
152
152
|
type: "button",
|
|
153
|
+
"aria-label": r,
|
|
153
154
|
disabled: e.disabled,
|
|
154
155
|
"aria-pressed": e.selected,
|
|
155
156
|
onClick: () => t(e.value)
|
|
156
|
-
},
|
|
157
|
-
"w-full cursor-pointer px-3 py-2 text-sm transition-
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
157
|
+
}, y({
|
|
158
|
+
"w-full cursor-pointer px-3 py-2 text-sm transition-colors duration-150 ease-in-out outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed": !0,
|
|
159
|
+
[R.value ?? ""]: !0,
|
|
160
|
+
[i?.base ?? ""]: e.state === "base" || e.state === "hover",
|
|
161
|
+
[i?.hover ?? ""]: e.state === "base" || e.state === "hover",
|
|
162
|
+
[i?.selected ?? ""]: e.state === "selected",
|
|
163
|
+
[i?.disabled ?? ""]: e.state === "disabled",
|
|
164
|
+
[I.value.item ?? ""]: !0
|
|
164
165
|
}));
|
|
165
|
-
}, oe = (e) =>
|
|
166
|
-
typeof e == "number" && G(e);
|
|
167
|
-
}), $ = (e) => Q(e, (e) => {
|
|
166
|
+
}, oe = (e) => $(e, (e) => {
|
|
168
167
|
typeof e == "number" && K(e);
|
|
169
|
-
}), se = (e) =>
|
|
168
|
+
}, `Hour ${e.label}`), se = (e) => $(e, (e) => {
|
|
170
169
|
typeof e == "number" && q(e);
|
|
171
|
-
}), ce = (e) =>
|
|
172
|
-
|
|
173
|
-
}), le =
|
|
170
|
+
}, `Minute ${e.label}`), ce = (e) => $(e, (e) => {
|
|
171
|
+
typeof e == "number" && J(e);
|
|
172
|
+
}, `Second ${e.label}`), le = (e) => $(e, (e) => {
|
|
173
|
+
(e === "AM" || e === "PM") && Y(e);
|
|
174
|
+
}, String(e.label)), ue = a(() => !!M.value.ampm);
|
|
174
175
|
return {
|
|
175
176
|
merged: M,
|
|
176
|
-
rootBind:
|
|
177
|
-
hourItems:
|
|
178
|
-
columnBind:
|
|
177
|
+
rootBind: ae,
|
|
178
|
+
hourItems: X,
|
|
179
|
+
columnBind: Q,
|
|
179
180
|
getHourBind: oe,
|
|
180
|
-
minuteItems:
|
|
181
|
-
secondItems:
|
|
182
|
-
displayDate:
|
|
181
|
+
minuteItems: Z,
|
|
182
|
+
secondItems: re,
|
|
183
|
+
displayDate: B,
|
|
183
184
|
showSeconds: a(() => !!M.value.showSeconds),
|
|
184
|
-
showMeridiem:
|
|
185
|
-
getMinuteBind:
|
|
186
|
-
getSecondBind:
|
|
187
|
-
meridiemItems:
|
|
188
|
-
getMeridiemBind:
|
|
185
|
+
showMeridiem: ue,
|
|
186
|
+
getMinuteBind: se,
|
|
187
|
+
getSecondBind: ce,
|
|
188
|
+
meridiemItems: ie,
|
|
189
|
+
getMeridiemBind: le
|
|
189
190
|
};
|
|
190
191
|
}
|
|
191
192
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { TIME_PANEL_COLUMN_WIDTH_CLASS, useTimePanel, type TimePanelItem, } from './composables/useTimePanel';
|
|
2
|
-
export type { TimePanelClasses, TimePanelColorOverrides, TimePanelCustomProps, TimePanelEmits, TimePanelOwnProps, TimePanelProps, TimePanelRoundedOverrides,
|
|
2
|
+
export type { TimePanelClasses, TimePanelColorOverrides, TimePanelCustomProps, TimePanelEmits, TimePanelOwnProps, TimePanelProps, TimePanelRoundedOverrides, } from './timePanel.types';
|
|
3
3
|
export { default as TimePanel } from './TimePanel.vue';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, HTMLAttributes } from 'vue';
|
|
2
2
|
import { DisableTimesInput, TimeValue } from '@bridge-ui/core/Domain';
|
|
3
|
-
import { TimeColor,
|
|
3
|
+
import { TimeColor, TimeRounded } from '@bridge-ui/core/Tokens';
|
|
4
4
|
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
5
5
|
export interface TimePanelColorOverrides {}
|
|
6
6
|
export interface TimePanelRoundedOverrides {}
|
|
@@ -44,16 +44,6 @@ export interface TimePanelEmits {
|
|
|
44
44
|
*/
|
|
45
45
|
change: [value: Date | null];
|
|
46
46
|
}
|
|
47
|
-
export interface TimePanelTokens {
|
|
48
|
-
/**
|
|
49
|
-
* Color token map overrides.
|
|
50
|
-
*/
|
|
51
|
-
color?: Record<string, Partial<TimeColorItem>>;
|
|
52
|
-
/**
|
|
53
|
-
* Border radius token map overrides.
|
|
54
|
-
*/
|
|
55
|
-
rounded?: Record<string, string>;
|
|
56
|
-
}
|
|
57
47
|
export interface TimePanelOwnProps {
|
|
58
48
|
/**
|
|
59
49
|
* Uses a 12-hour clock with an AM/PM column.
|
|
@@ -146,12 +136,6 @@ export interface TimePanelOwnProps {
|
|
|
146
136
|
* @default undefined
|
|
147
137
|
*/
|
|
148
138
|
timeZone?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Token overrides.
|
|
151
|
-
*
|
|
152
|
-
* @default undefined
|
|
153
|
-
*/
|
|
154
|
-
tokens?: TimePanelTokens;
|
|
155
139
|
/**
|
|
156
140
|
* Selected time (`Date` wall clock).
|
|
157
141
|
*
|
|
@@ -27,7 +27,6 @@ var v = /*@__PURE__*/ c({
|
|
|
27
27
|
},
|
|
28
28
|
showSeconds: { type: Boolean },
|
|
29
29
|
timeZone: {},
|
|
30
|
-
tokens: {},
|
|
31
30
|
value: {}
|
|
32
31
|
},
|
|
33
32
|
emits: [
|
|
@@ -36,19 +35,18 @@ var v = /*@__PURE__*/ c({
|
|
|
36
35
|
"change"
|
|
37
36
|
],
|
|
38
37
|
setup(c, { emit: v }) {
|
|
39
|
-
let { merged: y, rootBind: b, footerBind: x, showFooter: S, applyLabel: C,
|
|
38
|
+
let { merged: y, rootBind: b, footerBind: x, showFooter: S, applyLabel: C, contentBind: w, handleApply: T, cancelLabel: E, displayValue: D, handleCancel: O, applyButtonProps: k, cancelButtonProps: A, handlePanelChange: j } = n(c, {
|
|
40
39
|
ampm: !1,
|
|
41
40
|
interval: 1,
|
|
42
41
|
rounded: "md",
|
|
43
42
|
color: "primary",
|
|
44
43
|
showSeconds: !1
|
|
45
44
|
}, v);
|
|
46
|
-
return (n, c) => (p(), i("div", f(l(g(b))), [a("div", { class: d(g(
|
|
45
|
+
return (n, c) => (p(), i("div", f(l(g(b))), [a("div", { class: d(g(w)) }, [s(g(t), {
|
|
47
46
|
ampm: g(y).ampm,
|
|
48
47
|
fill: g(y).fill,
|
|
49
|
-
tokens: g(w),
|
|
50
48
|
color: g(y).color,
|
|
51
|
-
value: g(
|
|
49
|
+
value: g(D),
|
|
52
50
|
error: g(y).error,
|
|
53
51
|
rounded: g(y).rounded,
|
|
54
52
|
"max-time": g(y).maxTime,
|
|
@@ -57,13 +55,12 @@ var v = /*@__PURE__*/ c({
|
|
|
57
55
|
interval: g(y).interval,
|
|
58
56
|
"read-only": g(y).readOnly,
|
|
59
57
|
"time-zone": g(y).timeZone,
|
|
60
|
-
onChange: g(
|
|
58
|
+
onChange: g(j),
|
|
61
59
|
"show-seconds": g(y).showSeconds,
|
|
62
60
|
"disable-times": g(y).disableTimes
|
|
63
61
|
}, null, 8, [
|
|
64
62
|
"ampm",
|
|
65
63
|
"fill",
|
|
66
|
-
"tokens",
|
|
67
64
|
"color",
|
|
68
65
|
"value",
|
|
69
66
|
"error",
|
|
@@ -78,16 +75,16 @@ var v = /*@__PURE__*/ c({
|
|
|
78
75
|
"show-seconds",
|
|
79
76
|
"disable-times"
|
|
80
77
|
])], 2), g(S) ? (p(), i("div", f(u({ key: 0 }, g(x))), [m(n.$slots, "footer", {
|
|
81
|
-
apply: g(
|
|
82
|
-
cancel: g(
|
|
78
|
+
apply: g(T),
|
|
79
|
+
cancel: g(O)
|
|
83
80
|
}, () => [s(g(e), u({
|
|
84
81
|
variant: "flat",
|
|
85
82
|
color: "secondary",
|
|
86
|
-
onClick: g(
|
|
87
|
-
}, g(
|
|
88
|
-
default: _(() => [o(h(g(
|
|
83
|
+
onClick: g(O)
|
|
84
|
+
}, g(A)), {
|
|
85
|
+
default: _(() => [o(h(g(E)), 1)]),
|
|
89
86
|
_: 1
|
|
90
|
-
}, 16, ["onClick"]), s(g(e), u({ color: "primary" }, g(
|
|
87
|
+
}, 16, ["onClick"]), s(g(e), u({ color: "primary" }, g(k), { onClick: g(T) }), {
|
|
91
88
|
default: _(() => [o(h(g(C)), 1)]),
|
|
92
89
|
_: 1
|
|
93
90
|
}, 16, ["onClick"])])], 16)) : r("", !0)], 16));
|
|
@@ -9,13 +9,9 @@ type TimePickerMerged = MergeLibDefaults<TimePickerOwnProps, TimePickerLibDefaul
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function useTimePicker(props: MaybeRefOrGetter<TimePickerOwnProps>, libDefaults: TimePickerLibDefaults, emit: SetupContext<TimePickerEmits>["emit"]): {
|
|
11
11
|
merged: import('vue').ComputedRef<TimePickerMerged>;
|
|
12
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<TimePickerOwnProps, "error" | "color" | "fill" | "value" | "classes" | "
|
|
12
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<TimePickerOwnProps, "error" | "color" | "fill" | "value" | "classes" | "showFooter" | "customProps" | "rounded" | "disabled" | "defaultValue" | "readOnly" | "timeZone" | "ampm" | "disableTimes" | "interval" | "maxTime" | "minTime" | "showSeconds">>>>;
|
|
13
13
|
footerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
14
14
|
showFooter: import('vue').ComputedRef<boolean>;
|
|
15
|
-
timeTokens: import('vue').ComputedRef<{
|
|
16
|
-
color: Record<string, Partial<import('@bridge-ui/core/Tokens').TimeColorItem>> | undefined;
|
|
17
|
-
rounded: Record<string, string> | undefined;
|
|
18
|
-
}>;
|
|
19
15
|
contentBind: import('vue').ComputedRef<string>;
|
|
20
16
|
handleApply: () => void;
|
|
21
17
|
displayValue: import('vue').ComputedRef<Date | null>;
|
|
@@ -12,7 +12,6 @@ var _ = [
|
|
|
12
12
|
"color",
|
|
13
13
|
"error",
|
|
14
14
|
"value",
|
|
15
|
-
"tokens",
|
|
16
15
|
"classes",
|
|
17
16
|
"maxTime",
|
|
18
17
|
"minTime",
|
|
@@ -52,22 +51,19 @@ function v(v, y, b) {
|
|
|
52
51
|
u(() => [N.value, T.value.showFooter], ([e, t]) => {
|
|
53
52
|
t && (P.value = e);
|
|
54
53
|
});
|
|
55
|
-
let F = a(() => T.value.showFooter ? P.value : N.value), I =
|
|
56
|
-
color: T.value.tokens?.time?.color ?? T.value.tokens?.color,
|
|
57
|
-
rounded: T.value.tokens?.time?.rounded ?? T.value.tokens?.rounded
|
|
58
|
-
})), L = (e) => {
|
|
54
|
+
let F = a(() => T.value.showFooter ? P.value : N.value), I = (e) => {
|
|
59
55
|
j.value || (M.value = e), b("change", e);
|
|
60
|
-
},
|
|
56
|
+
}, L = (e) => {
|
|
61
57
|
if (T.value.showFooter) {
|
|
62
58
|
P.value = e;
|
|
63
59
|
return;
|
|
64
60
|
}
|
|
65
|
-
|
|
61
|
+
I(e);
|
|
62
|
+
}, R = () => {
|
|
63
|
+
I(P.value), b("apply"), S.apply();
|
|
66
64
|
}, z = () => {
|
|
67
|
-
L(P.value), b("apply"), S.apply();
|
|
68
|
-
}, B = () => {
|
|
69
65
|
P.value = N.value, b("cancel"), S.cancel();
|
|
70
|
-
},
|
|
66
|
+
}, B = a(() => {
|
|
71
67
|
let e = d(m, T.value.rounded ?? "md");
|
|
72
68
|
return t(D.value?.root, O.value, h({
|
|
73
69
|
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-900": !0,
|
|
@@ -76,21 +72,20 @@ function v(v, y, b) {
|
|
|
76
72
|
[e]: !0,
|
|
77
73
|
[k.value.root ?? ""]: !0
|
|
78
74
|
}));
|
|
79
|
-
}),
|
|
75
|
+
}), V = a(() => h({ "px-2.5": !0 }));
|
|
80
76
|
return {
|
|
81
77
|
merged: T,
|
|
82
|
-
rootBind:
|
|
78
|
+
rootBind: B,
|
|
83
79
|
footerBind: a(() => t(D.value?.footer, {}, h({
|
|
84
80
|
"flex items-center justify-end gap-2 border-t border-dark-100 bg-dark-50 px-3 py-2 dark:border-dark-800 dark:bg-dark-950/40": !0,
|
|
85
81
|
[k.value.footer ?? ""]: !0
|
|
86
82
|
}))),
|
|
87
83
|
showFooter: a(() => !!T.value.showFooter),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
handleApply: z,
|
|
84
|
+
contentBind: V,
|
|
85
|
+
handleApply: R,
|
|
91
86
|
displayValue: F,
|
|
92
|
-
handleCancel:
|
|
93
|
-
handlePanelChange:
|
|
87
|
+
handleCancel: z,
|
|
88
|
+
handlePanelChange: L,
|
|
94
89
|
applyLabel: a(() => C("Apply")),
|
|
95
90
|
cancelLabel: a(() => C("Cancel")),
|
|
96
91
|
applyButtonProps: a(() => D.value?.applyButton),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { useTimePicker } from './composables/useTimePicker';
|
|
2
|
-
export type { TimePickerClasses, TimePickerColorOverrides, TimePickerCustomProps, TimePickerEmits, TimePickerOwnProps, TimePickerProps, TimePickerRoundedOverrides, TimePickerSlots,
|
|
2
|
+
export type { TimePickerClasses, TimePickerColorOverrides, TimePickerCustomProps, TimePickerEmits, TimePickerOwnProps, TimePickerProps, TimePickerRoundedOverrides, TimePickerSlots, } from './timePicker.types';
|
|
3
3
|
export { default as TimePicker } from './TimePicker.vue';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
2
|
import { DisableTimesInput, FieldOverlayFooterSlotProps, TimeValue } from '@bridge-ui/core/Domain';
|
|
3
|
-
import { TimeColor,
|
|
3
|
+
import { TimeColor, TimeRounded } from '@bridge-ui/core/Tokens';
|
|
4
4
|
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
5
5
|
import { ButtonProps } from '../Button/button.types';
|
|
6
6
|
export interface TimePickerColorOverrides {}
|
|
@@ -166,12 +166,6 @@ export interface TimePickerOwnProps {
|
|
|
166
166
|
* @default undefined
|
|
167
167
|
*/
|
|
168
168
|
timeZone?: string;
|
|
169
|
-
/**
|
|
170
|
-
* Token overrides.
|
|
171
|
-
*
|
|
172
|
-
* @default undefined
|
|
173
|
-
*/
|
|
174
|
-
tokens?: TimePickerTokens;
|
|
175
169
|
/**
|
|
176
170
|
* Controlled value.
|
|
177
171
|
*
|
|
@@ -188,21 +182,4 @@ export interface TimePickerSlots {
|
|
|
188
182
|
*/
|
|
189
183
|
footer?: Slot<FieldOverlayFooterSlotProps>;
|
|
190
184
|
}
|
|
191
|
-
export interface TimePickerTokens {
|
|
192
|
-
/**
|
|
193
|
-
* Color token map overrides.
|
|
194
|
-
*/
|
|
195
|
-
color?: Record<string, Partial<TimeColorItem>>;
|
|
196
|
-
/**
|
|
197
|
-
* Border radius token map overrides.
|
|
198
|
-
*/
|
|
199
|
-
rounded?: Record<string, string>;
|
|
200
|
-
/**
|
|
201
|
-
* Nested time panel token overrides.
|
|
202
|
-
*/
|
|
203
|
-
time?: {
|
|
204
|
-
color?: Record<string, Partial<TimeColorItem>>;
|
|
205
|
-
rounded?: Record<string, string>;
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
185
|
export type TimePickerProps = MergeHtmlProps<TimePickerOwnProps, HTMLAttributes>;
|