@bridge-ui/vue 0.5.0 → 0.6.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 -2
- package/dist/Components/Alert/alertDefaultIcons.js +1 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +150 -145
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Button/button.types.d.ts +6 -0
- package/dist/Components/Button/composables/useButton.d.ts +4 -1
- package/dist/Components/Button/composables/useButton.js +88 -69
- package/dist/Components/ButtonGroup/ButtonGroup.js +5 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue.d.ts +14 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/Components/ButtonGroup/buttonGroup.types.d.ts +93 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.d.ts +7 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.js +4 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.d.ts +16 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.js +66 -0
- package/dist/Components/ButtonGroup/index.d.ts +4 -0
- package/dist/Components/ButtonGroup/index.js +4 -0
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +90 -90
- package/dist/Components/DataTable/DataTableColumnsMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterOptions.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableSortButton.vue.d.ts +5 -11
- package/dist/Components/DataTable/DataTableSortButton.vue_vue_type_script_setup_true_lang.js +22 -26
- package/dist/Components/DataTable/composables/useDataTable.d.ts +0 -3
- package/dist/Components/DataTable/composables/useDataTable.js +199 -213
- package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +4 -1
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
- package/dist/Components/ListItem/composables/useListItem.js +101 -86
- package/dist/Components/ListSection/composables/useListSection.js +34 -31
- package/dist/Components/ListSection/listSection.types.d.ts +2 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +82 -82
- package/dist/Components/Listbox/collectComposedListboxOptions.d.ts +5 -0
- package/dist/Components/Listbox/collectComposedListboxOptions.js +27 -0
- package/dist/Components/Radio/composables/useRadio.js +2 -1
- package/dist/Components/Select/composables/useSelect.d.ts +1 -1
- package/dist/Components/Select/composables/useSelect.js +104 -99
- package/dist/Components/Sidebar/SidebarTrigger.vue_vue_type_script_setup_true_lang.js +16 -15
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +29 -28
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +2 -0
- package/dist/Components/Sidebar/composables/useSidebarTrigger.js +16 -13
- package/dist/Components/Slider/composables/useSlider.js +53 -53
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/Components/TimePanel/composables/useTimePanel.js +106 -106
- package/dist/augments.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +150 -147
- package/docs/README.md +1 -0
- package/docs/components/Badge.md +2 -0
- package/docs/components/Button.md +5 -1
- package/docs/components/ButtonGroup.md +124 -0
- package/docs/components/DataTable.md +5 -1
- package/docs/components/Divider.md +1 -0
- package/docs/components/ToggleGroup.md +1 -1
- package/docs/examples/i18n-dictionary.ts +3 -0
- 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
|
@@ -2,10 +2,10 @@ import { useBridgeUI as e } from "../../../Provider/useBridgeUI.js";
|
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
3
|
import { baseFieldBridgeKeys as i, useBaseField as a } from "../../BaseField/composables/useBaseField.js";
|
|
4
4
|
import { computed as o, ref as s, toValue as ee, useAttrs as te, watch as ne } from "vue";
|
|
5
|
-
import { get as c,
|
|
6
|
-
import { getSliderBarGeometry as re, getSliderPointerClientX as
|
|
7
|
-
import { sliderColorProps as
|
|
8
|
-
import { cn as y, getColorToken as
|
|
5
|
+
import { get as c, isNumber as l, omit as u, pick as d } from "es-toolkit/compat";
|
|
6
|
+
import { getSliderBarGeometry as re, getSliderPointerClientX as f, isSliderStopCovered as ie, normalizeSliderStops as ae, percentFromSliderPointer as p, percentToValue as m, pickClosestSliderThumb as oe, resolveSliderBounds as se, snapSliderValue as h, sortSliderRangeValue as ce, stepSliderValue as g, valueToPercent as _, writeSliderRangeThumb as v } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { sliderColorProps as le, sliderRoundedProps as ue, sliderSizeProps as de } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as y, getColorToken as fe, mergeBridgeUILayeredClasses as b, splitComponentProps as pe } from "@bridge-ui/core/Utils";
|
|
9
9
|
//#region src/Components/Slider/composables/useSlider.ts
|
|
10
10
|
var x = [
|
|
11
11
|
"max",
|
|
@@ -28,14 +28,14 @@ function w(e, t, n, r) {
|
|
|
28
28
|
value: n
|
|
29
29
|
} : v(e, t, n);
|
|
30
30
|
}
|
|
31
|
-
function T(v, T, E,
|
|
32
|
-
let
|
|
31
|
+
function T(v, T, E, me = {}) {
|
|
32
|
+
let he = te(), ge = e(), D = s(null), O = s(null), k = s(null), A = s(null), j = o(() => pe({
|
|
33
33
|
bridgeKeys: S,
|
|
34
34
|
props: {
|
|
35
|
-
...
|
|
35
|
+
...he,
|
|
36
36
|
...ee(v)
|
|
37
37
|
}
|
|
38
|
-
})),
|
|
38
|
+
})), _e = o(() => d(j.value.componentProps, i)), M = a(_e, {
|
|
39
39
|
error: !1,
|
|
40
40
|
hideErrorMessage: !1,
|
|
41
41
|
size: T.size ?? "md"
|
|
@@ -46,7 +46,7 @@ function T(v, T, E, pe = {}) {
|
|
|
46
46
|
libDefaults: T,
|
|
47
47
|
componentName: "Slider",
|
|
48
48
|
props: () => ({
|
|
49
|
-
...
|
|
49
|
+
...d(j.value.componentProps, x),
|
|
50
50
|
size: M.merged.value.size,
|
|
51
51
|
classes: j.value.componentProps.classes,
|
|
52
52
|
customProps: j.value.componentProps.customProps
|
|
@@ -54,18 +54,18 @@ function T(v, T, E, pe = {}) {
|
|
|
54
54
|
}), F = o(() => N.value.customProps), I = r({
|
|
55
55
|
entry: P,
|
|
56
56
|
props: () => j.value.componentProps
|
|
57
|
-
}), L = o(() =>
|
|
57
|
+
}), L = o(() => se({
|
|
58
58
|
min: N.value.min,
|
|
59
59
|
max: N.value.max,
|
|
60
60
|
step: N.value.step
|
|
61
|
-
})), R = o(() => !!N.value.range), z = o(() => N.value.showTooltip !== !1), B = o(() =>
|
|
61
|
+
})), R = o(() => !!N.value.range), z = o(() => N.value.showTooltip !== !1), B = o(() => ge?.global.value.direction === "rtl"), { controlId: V, isDisabled: H, isReadonly: U, invalidated: W, ariaDescribedBy: ve } = M, G = o(() => {
|
|
62
62
|
let e = E.value, t = L.value;
|
|
63
63
|
if (R.value) {
|
|
64
|
-
if (Array.isArray(e)) return
|
|
65
|
-
let n = h(
|
|
64
|
+
if (Array.isArray(e)) return ce(h(e[0], t.min, t.max, t.step), h(e[1], t.min, t.max, t.step));
|
|
65
|
+
let n = h(l(e) ? e : t.min, t.min, t.max, t.step);
|
|
66
66
|
return [n, n];
|
|
67
67
|
}
|
|
68
|
-
return h(Array.isArray(e) ? e[0] :
|
|
68
|
+
return h(Array.isArray(e) ? e[0] : l(e) ? e : t.min, t.min, t.max, t.step);
|
|
69
69
|
}), K = o(() => ae({
|
|
70
70
|
min: L.value.min,
|
|
71
71
|
max: L.value.max,
|
|
@@ -78,43 +78,43 @@ function T(v, T, E, pe = {}) {
|
|
|
78
78
|
max: L.value.max,
|
|
79
79
|
value: G.value
|
|
80
80
|
})), J = o(() => {
|
|
81
|
-
let e = b(
|
|
82
|
-
return
|
|
81
|
+
let e = b(le, P.value?.tokens?.color);
|
|
82
|
+
return fe({
|
|
83
83
|
tokens: e,
|
|
84
84
|
color: N.value.color,
|
|
85
85
|
invalid: W.value
|
|
86
86
|
});
|
|
87
87
|
}), Y = o(() => {
|
|
88
|
-
let e = b(
|
|
88
|
+
let e = b(de, P.value?.tokens?.size);
|
|
89
89
|
return c(e, N.value.size ?? "md");
|
|
90
90
|
}), X = o(() => {
|
|
91
|
-
let e = b(
|
|
91
|
+
let e = b(ue, P.value?.tokens?.rounded);
|
|
92
92
|
return c(e, N.value.rounded ?? "full");
|
|
93
|
-
}),
|
|
94
|
-
E.value = e,
|
|
95
|
-
},
|
|
93
|
+
}), ye = o(() => K.value.some((e) => !!e.label)), Z = (e) => {
|
|
94
|
+
E.value = e, me.onChange?.(e);
|
|
95
|
+
}, be = (e) => {
|
|
96
96
|
D.value &&= { thumbIndex: e }, O.value !== null && (O.value = e);
|
|
97
|
-
},
|
|
97
|
+
}, xe = (e, t) => {
|
|
98
98
|
if (H.value || U.value) return;
|
|
99
|
-
let n = L.value, r =
|
|
100
|
-
i.thumbIndex !== e &&
|
|
99
|
+
let n = L.value, r = m(t, n.min, n.max, n.step), i = w(G.value, e, r, R.value);
|
|
100
|
+
i.thumbIndex !== e && be(i.thumbIndex), Z(i.value);
|
|
101
101
|
}, Q = (e, t) => {
|
|
102
102
|
H.value || U.value || (e.preventDefault(), D.value = { thumbIndex: t }, O.value = t);
|
|
103
|
-
},
|
|
103
|
+
}, Se = (e) => {
|
|
104
104
|
if (H.value || U.value || e.target.closest("[data-bridge-slider-thumb]")) return;
|
|
105
105
|
let t = A.value?.getBoundingClientRect();
|
|
106
106
|
if (!t) return;
|
|
107
|
-
let n =
|
|
107
|
+
let n = p({
|
|
108
108
|
rect: t,
|
|
109
109
|
isRtl: B.value,
|
|
110
|
-
clientX:
|
|
111
|
-
}), r = L.value, i =
|
|
110
|
+
clientX: f(e)
|
|
111
|
+
}), r = L.value, i = m(n, r.min, r.max, r.step), a = 0, o = G.value;
|
|
112
112
|
R.value && Array.isArray(o) && (a = oe(i, o[0], o[1]));
|
|
113
113
|
let s = w(o, a, i, R.value);
|
|
114
114
|
Z(s.value), Q(e, s.thumbIndex);
|
|
115
|
-
}, Se = (e) => (t) => {
|
|
116
|
-
Q(t, e);
|
|
117
115
|
}, Ce = (e) => (t) => {
|
|
116
|
+
Q(t, e);
|
|
117
|
+
}, we = (e) => (t) => {
|
|
118
118
|
if (H.value || U.value) return;
|
|
119
119
|
let n = L.value, r = C(G.value, e, R.value), i = null, a = B.value;
|
|
120
120
|
switch (t.key) {
|
|
@@ -151,12 +151,12 @@ function T(v, T, E, pe = {}) {
|
|
|
151
151
|
let r = (e) => {
|
|
152
152
|
let t = A.value?.getBoundingClientRect();
|
|
153
153
|
if (!t || D.value === null) return;
|
|
154
|
-
let n =
|
|
154
|
+
let n = p({
|
|
155
155
|
rect: t,
|
|
156
156
|
isRtl: B.value,
|
|
157
|
-
clientX:
|
|
157
|
+
clientX: f(e)
|
|
158
158
|
});
|
|
159
|
-
|
|
159
|
+
xe(D.value.thumbIndex, n);
|
|
160
160
|
}, i = () => {
|
|
161
161
|
D.value = null, O.value = null;
|
|
162
162
|
};
|
|
@@ -164,9 +164,9 @@ function T(v, T, E, pe = {}) {
|
|
|
164
164
|
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", i), window.removeEventListener("pointercancel", i);
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
|
-
let
|
|
168
|
-
...
|
|
169
|
-
onPointerdown:
|
|
167
|
+
let $ = o(() => t({}, {}, y("relative w-full min-w-0 flex-1"))), Te = o(() => t({
|
|
168
|
+
...u(F.value?.track ?? {}, ["style"]),
|
|
169
|
+
onPointerdown: Se
|
|
170
170
|
}, {}, y({
|
|
171
171
|
"relative w-full select-none touch-none": !0,
|
|
172
172
|
"cursor-pointer": !H.value && !U.value,
|
|
@@ -175,7 +175,7 @@ function T(v, T, E, pe = {}) {
|
|
|
175
175
|
[X.value ?? ""]: !0,
|
|
176
176
|
[J.value?.track ?? ""]: !0,
|
|
177
177
|
[I.value.track ?? ""]: !0
|
|
178
|
-
}))), Ee = o(() => t(
|
|
178
|
+
}))), Ee = o(() => t(u(F.value?.bar ?? {}, ["style"]), {
|
|
179
179
|
"aria-hidden": !0,
|
|
180
180
|
style: {
|
|
181
181
|
width: q.value.width,
|
|
@@ -186,10 +186,10 @@ function T(v, T, E, pe = {}) {
|
|
|
186
186
|
[X.value ?? ""]: !0,
|
|
187
187
|
[J.value?.bar ?? ""]: !0,
|
|
188
188
|
[I.value.bar ?? ""]: !0
|
|
189
|
-
}))),
|
|
189
|
+
}))), De = (e) => {
|
|
190
190
|
let n = C(G.value, e, R.value), r = _(n, L.value.min, L.value.max), i = O.value === e;
|
|
191
191
|
return t({
|
|
192
|
-
...
|
|
192
|
+
...u(F.value?.thumb ?? {}, ["style"]),
|
|
193
193
|
role: "slider",
|
|
194
194
|
type: "button",
|
|
195
195
|
"aria-valuenow": n,
|
|
@@ -199,13 +199,13 @@ function T(v, T, E, pe = {}) {
|
|
|
199
199
|
"data-bridge-slider-thumb": e,
|
|
200
200
|
disabled: H.value || void 0,
|
|
201
201
|
"aria-orientation": "horizontal",
|
|
202
|
-
"aria-describedby":
|
|
203
|
-
onKeydown:
|
|
202
|
+
"aria-describedby": ve.value,
|
|
203
|
+
onKeydown: we(e),
|
|
204
204
|
id: `${V.value}-thumb-${e}`,
|
|
205
205
|
"aria-disabled": H.value || void 0,
|
|
206
206
|
"aria-readonly": U.value || void 0,
|
|
207
207
|
"aria-invalid": W.value || void 0,
|
|
208
|
-
onPointerdown:
|
|
208
|
+
onPointerdown: Ce(e),
|
|
209
209
|
style: { insetInlineStart: `${r}%` },
|
|
210
210
|
onFocus: () => {
|
|
211
211
|
k.value = e;
|
|
@@ -228,7 +228,7 @@ function T(v, T, E, pe = {}) {
|
|
|
228
228
|
[Y.value?.thumb ?? ""]: !0,
|
|
229
229
|
[I.value.thumb ?? ""]: !0
|
|
230
230
|
}));
|
|
231
|
-
},
|
|
231
|
+
}, Oe = (e) => {
|
|
232
232
|
let n = O.value === e;
|
|
233
233
|
return t(F.value?.thumbKnob, { "aria-hidden": !0 }, y({
|
|
234
234
|
"block rounded-full border-2 shadow-sm transition-transform duration-100": !0,
|
|
@@ -239,7 +239,7 @@ function T(v, T, E, pe = {}) {
|
|
|
239
239
|
[J.value?.thumb ?? ""]: !0,
|
|
240
240
|
[I.value.thumbKnob ?? ""]: !0
|
|
241
241
|
}));
|
|
242
|
-
},
|
|
242
|
+
}, ke = (e) => {
|
|
243
243
|
let n = _(e.value, L.value.min, L.value.max), r = ie({
|
|
244
244
|
range: R.value,
|
|
245
245
|
min: L.value.min,
|
|
@@ -247,7 +247,7 @@ function T(v, T, E, pe = {}) {
|
|
|
247
247
|
stopValue: e.value,
|
|
248
248
|
value: G.value
|
|
249
249
|
});
|
|
250
|
-
return t(
|
|
250
|
+
return t(u(F.value?.stop ?? {}, ["style"]), {
|
|
251
251
|
"aria-hidden": !0,
|
|
252
252
|
style: {
|
|
253
253
|
insetInlineStart: `${n}%`,
|
|
@@ -257,7 +257,7 @@ function T(v, T, E, pe = {}) {
|
|
|
257
257
|
"absolute top-1/2 h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white dark:bg-dark-400": !0,
|
|
258
258
|
[I.value.stop ?? ""]: !0
|
|
259
259
|
}));
|
|
260
|
-
},
|
|
260
|
+
}, Ae = o(() => t(F.value?.stopLabels, { "aria-hidden": !0 }, y({
|
|
261
261
|
"relative h-[1lh] w-full text-xs": !0,
|
|
262
262
|
[I.value.stopLabels ?? ""]: !0
|
|
263
263
|
})));
|
|
@@ -269,26 +269,26 @@ function T(v, T, E, pe = {}) {
|
|
|
269
269
|
trackRef: A,
|
|
270
270
|
baseField: M,
|
|
271
271
|
trackBind: Te,
|
|
272
|
-
controlBind:
|
|
272
|
+
controlBind: $,
|
|
273
273
|
showTooltip: z,
|
|
274
|
-
getStopBind:
|
|
274
|
+
getStopBind: ke,
|
|
275
275
|
thumbIndexes: o(() => R.value ? [0, 1] : [0]),
|
|
276
|
-
getThumbBind:
|
|
276
|
+
getThumbBind: De,
|
|
277
277
|
resolvedStops: K,
|
|
278
278
|
resolvedValue: G,
|
|
279
279
|
isTooltipOpen: (e) => z.value && (O.value === e || k.value === e),
|
|
280
|
-
hasStopLabels:
|
|
281
|
-
stopLabelsBind:
|
|
280
|
+
hasStopLabels: ye,
|
|
281
|
+
stopLabelsBind: Ae,
|
|
282
282
|
getStopLabelBind: (e) => {
|
|
283
283
|
let n = _(e.value, L.value.min, L.value.max);
|
|
284
|
-
return t(
|
|
284
|
+
return t(u(F.value?.stopLabel ?? {}, ["style"]), { style: { insetInlineStart: `${n}%` } }, y({
|
|
285
285
|
"absolute top-0 -translate-x-1/2 whitespace-nowrap": !0,
|
|
286
286
|
"text-dark-700 dark:text-dark-400": !W.value,
|
|
287
287
|
"text-error-600 dark:text-error-400": W.value,
|
|
288
288
|
[I.value.stopLabel ?? ""]: !0
|
|
289
289
|
}));
|
|
290
290
|
},
|
|
291
|
-
getThumbKnobBind:
|
|
291
|
+
getThumbKnobBind: Oe,
|
|
292
292
|
tooltipProps: o(() => F.value?.tooltip),
|
|
293
293
|
readThumbValue: (e) => C(G.value, e, R.value)
|
|
294
294
|
};
|
|
@@ -4,8 +4,9 @@ import n from "../TabList/TabList.js";
|
|
|
4
4
|
import r from "../TabPanel/TabPanel.js";
|
|
5
5
|
import { useTabs as i } from "./composables/useTabs.js";
|
|
6
6
|
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeProps as _, openBlock as v, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useModel as C, withCtx as w } from "vue";
|
|
7
|
+
import { isString as T } from "es-toolkit/compat";
|
|
7
8
|
//#region src/Components/Tabs/Tabs.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var E = /*@__PURE__*/ p({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "Tabs",
|
|
11
12
|
props: /*@__PURE__*/ h({
|
|
@@ -26,23 +27,23 @@ var T = /*@__PURE__*/ p({
|
|
|
26
27
|
}),
|
|
27
28
|
emits: /*@__PURE__*/ h(["change", "update:modelValue"], ["update:modelValue"]),
|
|
28
29
|
setup(p, { emit: h }) {
|
|
29
|
-
let
|
|
30
|
+
let E = h, D = p, O = C(p, "modelValue"), { rootBind: k, tabItems: A } = i(D, {
|
|
30
31
|
size: "md",
|
|
31
32
|
variant: "line",
|
|
32
33
|
color: "primary",
|
|
33
34
|
keepMounted: !0,
|
|
34
35
|
activation: "automatic",
|
|
35
36
|
orientation: "horizontal"
|
|
36
|
-
},
|
|
37
|
-
return (i, o) => (v(), l("div", _(m(S(
|
|
38
|
-
default: w(() => [(v(!0), l(a, null, y(S(
|
|
37
|
+
}, O, E), j = o(() => A.value.length > 0);
|
|
38
|
+
return (i, o) => (v(), l("div", _(m(S(k))), [j.value ? (v(), l(a, { key: 0 }, [f(n, _(m(D.customProps?.tabList)), {
|
|
39
|
+
default: w(() => [(v(!0), l(a, null, y(S(A), (n) => (v(), s(t, g({
|
|
39
40
|
key: n.value,
|
|
40
41
|
value: n.value,
|
|
41
42
|
"end-icon": n.endIcon,
|
|
42
43
|
disabled: n.disabled,
|
|
43
44
|
"start-icon": n.startIcon
|
|
44
|
-
}, { ref_for: !0 },
|
|
45
|
-
default: w(() => [
|
|
45
|
+
}, { ref_for: !0 }, D.customProps?.tab), u({
|
|
46
|
+
default: w(() => [S(T)(n.label) ? (v(), l(a, { key: 0 }, [d(x(n.label), 1)], 64)) : (v(), s(S(e), {
|
|
46
47
|
key: 1,
|
|
47
48
|
fn: n.label
|
|
48
49
|
}, null, 8, ["fn"]))]),
|
|
@@ -62,15 +63,15 @@ var T = /*@__PURE__*/ p({
|
|
|
62
63
|
"start-icon"
|
|
63
64
|
]))), 128))]),
|
|
64
65
|
_: 1
|
|
65
|
-
}, 16), (v(!0), l(a, null, y(S(
|
|
66
|
+
}, 16), (v(!0), l(a, null, y(S(A), (t) => (v(), s(r, g({
|
|
66
67
|
key: t.value,
|
|
67
68
|
value: t.value,
|
|
68
69
|
"keep-mounted": t.keepMounted
|
|
69
|
-
}, { ref_for: !0 },
|
|
70
|
+
}, { ref_for: !0 }, D.customProps?.tabPanel), {
|
|
70
71
|
default: w(() => [f(S(e), { fn: t.panel }, null, 8, ["fn"])]),
|
|
71
72
|
_: 2
|
|
72
73
|
}, 1040, ["value", "keep-mounted"]))), 128))], 64)) : c("", !0), b(i.$slots, "default")], 16));
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
//#endregion
|
|
76
|
-
export {
|
|
77
|
+
export { E as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useDateAdapter as e, useDateAdapterContext as t } from "../../../Adapters/Date/useDateAdapter.js";
|
|
2
2
|
import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
3
|
-
import { computed as a, toValue as
|
|
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
|
|
3
|
+
import { computed as a, toValue as ee, useAttrs as o } from "vue";
|
|
4
|
+
import { get as s, isNumber 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 h, to12Hour as g, to24Hour as _, toMeridiem as v } from "@bridge-ui/core/Domain";
|
|
6
|
+
import { timeColorProps as y, timeRoundedProps as b } from "@bridge-ui/core/Tokens";
|
|
7
|
+
import { cn as x, getColorToken as S, mergeBridgeUILayeredClasses as C, splitComponentProps as w } from "@bridge-ui/core/Utils";
|
|
8
8
|
//#region src/Components/TimePanel/composables/useTimePanel.ts
|
|
9
|
-
var
|
|
9
|
+
var T = [
|
|
10
10
|
"ampm",
|
|
11
11
|
"fill",
|
|
12
12
|
"color",
|
|
@@ -23,171 +23,171 @@ var C = [
|
|
|
23
23
|
"customProps",
|
|
24
24
|
"showSeconds",
|
|
25
25
|
"disableTimes"
|
|
26
|
-
],
|
|
27
|
-
function E
|
|
28
|
-
let
|
|
29
|
-
bridgeKeys:
|
|
26
|
+
], E = "w-[3.75rem]", D = "min-w-[3.75rem]";
|
|
27
|
+
function O(E, O, k) {
|
|
28
|
+
let A = o(), j = e(), M = t(), N = a(() => w({
|
|
29
|
+
bridgeKeys: T,
|
|
30
30
|
props: {
|
|
31
|
-
...
|
|
32
|
-
...
|
|
31
|
+
...A,
|
|
32
|
+
...ee(E)
|
|
33
33
|
}
|
|
34
|
-
})), { merged:
|
|
35
|
-
libDefaults:
|
|
34
|
+
})), { merged: P, entry: F } = r({
|
|
35
|
+
libDefaults: O,
|
|
36
36
|
componentName: "TimePanel",
|
|
37
|
-
props: () =>
|
|
38
|
-
}),
|
|
39
|
-
props: () =>
|
|
37
|
+
props: () => N.value.componentProps
|
|
38
|
+
}), I = a(() => P.value.customProps), L = a(() => l(N.value.inheritedAttrs, ["onChange"])), R = i({
|
|
39
|
+
props: () => N.value.componentProps,
|
|
40
40
|
entry: a(() => {})
|
|
41
|
-
}),
|
|
42
|
-
let e =
|
|
43
|
-
return
|
|
44
|
-
}),
|
|
45
|
-
let e =
|
|
46
|
-
return
|
|
41
|
+
}), z = a(() => M(P.value.timeZone)), B = a(() => {
|
|
42
|
+
let e = C(b, F.value?.tokens?.rounded);
|
|
43
|
+
return s(e, P.value.rounded);
|
|
44
|
+
}), V = a(() => {
|
|
45
|
+
let e = C(y, F.value?.tokens?.color);
|
|
46
|
+
return S({
|
|
47
47
|
tokens: e,
|
|
48
|
-
color:
|
|
49
|
-
invalid:
|
|
48
|
+
color: P.value.color,
|
|
49
|
+
invalid: P.value.error
|
|
50
50
|
});
|
|
51
|
-
}),
|
|
52
|
-
let e =
|
|
53
|
-
return r =
|
|
54
|
-
}),
|
|
55
|
-
adapter:
|
|
56
|
-
context:
|
|
57
|
-
maxTime:
|
|
58
|
-
minTime:
|
|
59
|
-
disableTimes:
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
}, K = (e) => {
|
|
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);
|
|
65
|
-
}, q = (e) => {
|
|
66
|
-
let t = k.value.setMinutes(B.value, e, L.value);
|
|
67
|
-
G(t);
|
|
51
|
+
}), H = a(() => {
|
|
52
|
+
let e = P.value.value ?? j.value.now(z.value), t = h(j.value.getMinutes(e, z.value), P.value.interval), n = P.value.showSeconds ? j.value.getSeconds(e, z.value) : 0, r = j.value.setHours(e, j.value.getHours(e, z.value), z.value);
|
|
53
|
+
return r = j.value.setMinutes(r, t, z.value), r = j.value.setSeconds(r, n, z.value), r;
|
|
54
|
+
}), te = a(() => u({ ampm: P.value.ampm })), U = a(() => d({ interval: P.value.interval })), W = a(() => f()), G = a(() => v(j.value.getHours(H.value, z.value))), K = (e) => !!P.value.disabled || p(e, {
|
|
55
|
+
adapter: j.value,
|
|
56
|
+
context: z.value,
|
|
57
|
+
maxTime: P.value.maxTime,
|
|
58
|
+
minTime: P.value.minTime,
|
|
59
|
+
disableTimes: P.value.disableTimes
|
|
60
|
+
}), q = (e) => {
|
|
61
|
+
P.value.disabled || P.value.readOnly || K(e) || k("change", e);
|
|
68
62
|
}, J = (e) => {
|
|
69
|
-
let t =
|
|
70
|
-
|
|
63
|
+
let t = P.value.ampm ? _(e, G.value) : e, n = j.value.setHours(H.value, t, z.value);
|
|
64
|
+
n = j.value.setMinutes(n, j.value.getMinutes(H.value, z.value), z.value), q(n);
|
|
71
65
|
}, Y = (e) => {
|
|
72
|
-
let t =
|
|
73
|
-
|
|
74
|
-
}, X =
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
let t = j.value.setMinutes(H.value, e, z.value);
|
|
67
|
+
q(t);
|
|
68
|
+
}, X = (e) => {
|
|
69
|
+
let t = j.value.setSeconds(H.value, e, z.value);
|
|
70
|
+
q(t);
|
|
71
|
+
}, Z = (e) => {
|
|
72
|
+
let t = g(j.value.getHours(H.value, z.value)), n = _(t, e), r = j.value.setHours(H.value, n, z.value);
|
|
73
|
+
r = j.value.setMinutes(r, j.value.getMinutes(H.value, z.value), z.value), q(r);
|
|
74
|
+
}, Q = a(() => {
|
|
75
|
+
let e = j.value.getHours(H.value, z.value), t = P.value.ampm ? g(e) : e;
|
|
76
|
+
return te.value.map((e) => {
|
|
77
|
+
let n = P.value.ampm ? _(e, G.value) : e, r = j.value.setHours(H.value, n, z.value);
|
|
78
|
+
r = j.value.setMinutes(r, j.value.getMinutes(H.value, z.value), z.value);
|
|
79
|
+
let i = K(r), a = e === t;
|
|
80
80
|
return {
|
|
81
81
|
state: m({
|
|
82
82
|
disabled: i,
|
|
83
83
|
selected: a,
|
|
84
|
-
readOnly:
|
|
84
|
+
readOnly: P.value.readOnly
|
|
85
85
|
}),
|
|
86
86
|
selected: a,
|
|
87
87
|
value: e,
|
|
88
|
-
disabled: i || !!
|
|
89
|
-
label:
|
|
88
|
+
disabled: i || !!P.value.readOnly,
|
|
89
|
+
label: P.value.ampm ? String(e) : String(e).padStart(2, "0")
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
|
-
}),
|
|
93
|
-
let e =
|
|
94
|
-
return
|
|
95
|
-
let n =
|
|
92
|
+
}), ne = a(() => {
|
|
93
|
+
let e = j.value.getMinutes(H.value, z.value);
|
|
94
|
+
return U.value.map((t) => {
|
|
95
|
+
let n = j.value.setMinutes(H.value, t, z.value), r = K(n), i = t === e;
|
|
96
96
|
return {
|
|
97
97
|
state: m({
|
|
98
98
|
disabled: r,
|
|
99
99
|
selected: i,
|
|
100
|
-
readOnly:
|
|
100
|
+
readOnly: P.value.readOnly
|
|
101
101
|
}),
|
|
102
102
|
selected: i,
|
|
103
103
|
value: t,
|
|
104
104
|
label: String(t).padStart(2, "0"),
|
|
105
|
-
disabled: r || !!
|
|
105
|
+
disabled: r || !!P.value.readOnly
|
|
106
106
|
};
|
|
107
107
|
});
|
|
108
108
|
}), re = a(() => {
|
|
109
|
-
if (!
|
|
110
|
-
let e =
|
|
111
|
-
return
|
|
112
|
-
let n =
|
|
109
|
+
if (!P.value.showSeconds) return [];
|
|
110
|
+
let e = j.value.getSeconds(H.value, z.value);
|
|
111
|
+
return W.value.map((t) => {
|
|
112
|
+
let n = j.value.setSeconds(H.value, t, z.value), r = K(n), i = t === e;
|
|
113
113
|
return {
|
|
114
114
|
state: m({
|
|
115
115
|
disabled: r,
|
|
116
116
|
selected: i,
|
|
117
|
-
readOnly:
|
|
117
|
+
readOnly: P.value.readOnly
|
|
118
118
|
}),
|
|
119
119
|
selected: i,
|
|
120
120
|
value: t,
|
|
121
121
|
label: String(t).padStart(2, "0"),
|
|
122
|
-
disabled: r || !!
|
|
122
|
+
disabled: r || !!P.value.readOnly
|
|
123
123
|
};
|
|
124
124
|
});
|
|
125
|
-
}), ie = a(() =>
|
|
126
|
-
let t =
|
|
127
|
-
r =
|
|
128
|
-
let i =
|
|
125
|
+
}), ie = a(() => P.value.ampm ? ["AM", "PM"].map((e) => {
|
|
126
|
+
let t = g(j.value.getHours(H.value, z.value)), n = _(t, e), r = j.value.setHours(H.value, n, z.value);
|
|
127
|
+
r = j.value.setMinutes(r, j.value.getMinutes(H.value, z.value), z.value);
|
|
128
|
+
let i = K(r), a = e === G.value;
|
|
129
129
|
return {
|
|
130
130
|
state: m({
|
|
131
131
|
disabled: i,
|
|
132
132
|
selected: a,
|
|
133
|
-
readOnly:
|
|
133
|
+
readOnly: P.value.readOnly
|
|
134
134
|
}),
|
|
135
135
|
selected: a,
|
|
136
136
|
label: e,
|
|
137
137
|
value: e,
|
|
138
|
-
disabled: i || !!
|
|
138
|
+
disabled: i || !!P.value.readOnly
|
|
139
139
|
};
|
|
140
|
-
}) : []), ae = a(() => n(
|
|
140
|
+
}) : []), ae = a(() => n(I.value?.root, L.value, x({
|
|
141
141
|
"flex h-72 flex-row gap-2": !0,
|
|
142
|
-
"w-full min-w-fit":
|
|
143
|
-
"w-fit min-w-fit": !
|
|
144
|
-
[
|
|
145
|
-
}))),
|
|
142
|
+
"w-full min-w-fit": P.value.fill,
|
|
143
|
+
"w-fit min-w-fit": !P.value.fill,
|
|
144
|
+
[R.value.root ?? ""]: !0
|
|
145
|
+
}))), oe = a(() => n(I.value?.column, {}, x({
|
|
146
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
|
-
[
|
|
148
|
-
[
|
|
147
|
+
[D]: !0,
|
|
148
|
+
[R.value.column ?? ""]: !0
|
|
149
149
|
}))), $ = (e, t, r) => {
|
|
150
|
-
let i =
|
|
151
|
-
return n(
|
|
150
|
+
let i = V.value;
|
|
151
|
+
return n(I.value?.item, {
|
|
152
152
|
type: "button",
|
|
153
153
|
"aria-label": r,
|
|
154
154
|
disabled: e.disabled,
|
|
155
155
|
"aria-pressed": e.selected,
|
|
156
156
|
onClick: () => t(e.value)
|
|
157
|
-
},
|
|
157
|
+
}, x({
|
|
158
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
|
-
[
|
|
159
|
+
[B.value ?? ""]: !0,
|
|
160
160
|
[i?.base ?? ""]: e.state === "base" || e.state === "hover",
|
|
161
161
|
[i?.hover ?? ""]: e.state === "base" || e.state === "hover",
|
|
162
162
|
[i?.selected ?? ""]: e.state === "selected",
|
|
163
163
|
[i?.disabled ?? ""]: e.state === "disabled",
|
|
164
|
-
[
|
|
164
|
+
[R.value.item ?? ""]: !0
|
|
165
165
|
}));
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
}, `Hour ${e.label}`),
|
|
169
|
-
|
|
170
|
-
}, `Minute ${e.label}`),
|
|
171
|
-
|
|
172
|
-
}, `Second ${e.label}`),
|
|
173
|
-
(e === "AM" || e === "PM") &&
|
|
174
|
-
}, String(e.label)),
|
|
166
|
+
}, se = (e) => $(e, (e) => {
|
|
167
|
+
c(e) && J(e);
|
|
168
|
+
}, `Hour ${e.label}`), ce = (e) => $(e, (e) => {
|
|
169
|
+
c(e) && Y(e);
|
|
170
|
+
}, `Minute ${e.label}`), le = (e) => $(e, (e) => {
|
|
171
|
+
c(e) && X(e);
|
|
172
|
+
}, `Second ${e.label}`), ue = (e) => $(e, (e) => {
|
|
173
|
+
(e === "AM" || e === "PM") && Z(e);
|
|
174
|
+
}, String(e.label)), de = a(() => !!P.value.ampm);
|
|
175
175
|
return {
|
|
176
|
-
merged:
|
|
176
|
+
merged: P,
|
|
177
177
|
rootBind: ae,
|
|
178
|
-
hourItems:
|
|
179
|
-
columnBind:
|
|
180
|
-
getHourBind:
|
|
181
|
-
minuteItems:
|
|
178
|
+
hourItems: Q,
|
|
179
|
+
columnBind: oe,
|
|
180
|
+
getHourBind: se,
|
|
181
|
+
minuteItems: ne,
|
|
182
182
|
secondItems: re,
|
|
183
|
-
displayDate:
|
|
184
|
-
showSeconds: a(() => !!
|
|
185
|
-
showMeridiem:
|
|
186
|
-
getMinuteBind:
|
|
187
|
-
getSecondBind:
|
|
183
|
+
displayDate: H,
|
|
184
|
+
showSeconds: a(() => !!P.value.showSeconds),
|
|
185
|
+
showMeridiem: de,
|
|
186
|
+
getMinuteBind: ce,
|
|
187
|
+
getSecondBind: le,
|
|
188
188
|
meridiemItems: ie,
|
|
189
|
-
getMeridiemBind:
|
|
189
|
+
getMeridiemBind: ue
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
|
-
export {
|
|
193
|
+
export { D as TIME_PANEL_COLUMN_MIN_WIDTH_CLASS, E as TIME_PANEL_COLUMN_WIDTH_CLASS, O as useTimePanel };
|
package/dist/augments.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AutocompleteClasses, AutocompleteProps } from './Components/Autocomplet
|
|
|
3
3
|
import { AvatarClasses, AvatarProps } from './Components/Avatar';
|
|
4
4
|
import { BadgeClasses, BadgeProps } from './Components/Badge';
|
|
5
5
|
import { ButtonClasses, ButtonProps } from './Components/Button';
|
|
6
|
+
import { ButtonGroupClasses, ButtonGroupProps } from './Components/ButtonGroup';
|
|
6
7
|
import { CardClasses, CardProps } from './Components/Card';
|
|
7
8
|
import { CheckboxClasses, CheckboxProps } from './Components/Checkbox';
|
|
8
9
|
import { ChipClasses, ChipProps } from './Components/Chip';
|
|
@@ -51,6 +52,10 @@ declare module "@bridge-ui/core/Config" {
|
|
|
51
52
|
classes: ButtonClasses;
|
|
52
53
|
defaultProps: Partial<Pick<ButtonProps, "size" | "color" | "density" | "rounded" | "variant">>;
|
|
53
54
|
}
|
|
55
|
+
interface ButtonGroupConfigOverrides {
|
|
56
|
+
classes: ButtonGroupClasses;
|
|
57
|
+
defaultProps: Partial<Pick<ButtonGroupProps, "full" | "size" | "color" | "density" | "rounded" | "variant" | "separator" | "orientation">>;
|
|
58
|
+
}
|
|
54
59
|
interface CardConfigOverrides {
|
|
55
60
|
classes: CardClasses;
|
|
56
61
|
defaultProps: Partial<Pick<CardProps, "shadow" | "padding" | "rounded" | "variant">>;
|