@bridge-ui/vue 0.1.1 → 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 +1 -0
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +135 -109
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +17 -5
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +4 -2
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +85 -86
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +1 -6
- 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 +21 -19
- package/dist/Components/FieldOverlay/fieldOverlay.types.d.ts +11 -3
- package/dist/Components/Listbox/composables/useListbox.js +1 -1
- package/dist/Components/Modal/composables/useModal.js +1 -1
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +4 -0
- package/dist/Components/TimePanel/composables/useTimePanel.js +13 -12
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +103 -89
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -2
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +55 -54
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +1 -7
- package/dist/index.js +32 -32
- package/dist/theme.css +2 -0
- package/docs/README.md +4 -0
- package/docs/ScrollUtilities.md +89 -0
- package/docs/components/Autocomplete.md +2 -0
- package/docs/components/CalendarRange.md +4 -3
- package/docs/components/DateRangePicker.md +3 -2
- package/docs/components/Drawer.md +21 -21
- package/docs/components/FieldOverlay.md +19 -8
- package/docs/components/Modal.md +19 -19
- package/docs/components/Select.md +2 -0
- package/docs/components/TimePanel.md +2 -0
- package/docs/components/TimeRangePicker.md +0 -1
- package/package.json +2 -2
|
@@ -60,53 +60,47 @@ function m(d, m, h) {
|
|
|
60
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(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 =
|
|
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
64
|
let e = ie(f, x.value?.tokens?.rounded);
|
|
65
65
|
return ne(e, b.value.rounded);
|
|
66
|
-
}),
|
|
66
|
+
}), q = (e) => {
|
|
67
67
|
j.value = e;
|
|
68
68
|
}, ue = () => {
|
|
69
|
-
P.value = Math.max(1,
|
|
70
|
-
},
|
|
69
|
+
P.value = Math.max(1, U.value - 7), q("year");
|
|
70
|
+
}, J = (e) => {
|
|
71
71
|
let t = g.value.startOfMonth(e, T.value);
|
|
72
72
|
O.value || (M.value = t), h("viewDateChange", t);
|
|
73
73
|
}, de = (e) => {
|
|
74
|
-
|
|
74
|
+
J(e);
|
|
75
75
|
}, fe = (e) => {
|
|
76
|
-
|
|
76
|
+
J(g.value.addMonths(e, -1, T.value));
|
|
77
77
|
}, pe = (e) => {
|
|
78
78
|
let t = ce(e);
|
|
79
79
|
D.value || (A.value = t), h("change", t);
|
|
80
80
|
}, me = (e) => {
|
|
81
81
|
k.value || (N.value = e), h("previewDateChange", e);
|
|
82
82
|
}, he = () => {
|
|
83
|
-
if (
|
|
84
|
-
P.value = Math.max(1,
|
|
83
|
+
if (I.value === "year") {
|
|
84
|
+
P.value = Math.max(1, G.value - 15);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
J(g.value.addMonths(L.value, -1, T.value));
|
|
88
88
|
}, ge = () => {
|
|
89
|
-
if (
|
|
90
|
-
P.value =
|
|
89
|
+
if (I.value === "year") {
|
|
90
|
+
P.value = G.value + 15;
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
J(g.value.addMonths(L.value, 1, T.value));
|
|
94
94
|
}, _e = () => {
|
|
95
95
|
let e = g.value.startOfMonth(g.value.now(T.value), T.value);
|
|
96
|
-
P.value = null,
|
|
96
|
+
P.value = null, J(e), q("date");
|
|
97
97
|
}, ve = (e) => {
|
|
98
|
-
P.value = null,
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
}, xe = (
|
|
104
|
-
if (F.value === "end") {
|
|
105
|
-
let t = g.value.getYear(z.value, T.value), n = g.value.setMonth(g.value.setYear(R.value, t, T.value), e, T.value);
|
|
106
|
-
Y(g.value.addMonths(n, -1, T.value));
|
|
107
|
-
} else Y(g.value.setMonth(R.value, e, T.value));
|
|
108
|
-
J("date");
|
|
109
|
-
}, Se = a(() => F.value === "end" ? g.value.getYear(z.value, T.value) : W.value), Ce = a(() => F.value === "end" ? g.value.getMonth(z.value, T.value) : G.value), we = a(() => ({
|
|
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(() => ({
|
|
110
104
|
color: b.value.color,
|
|
111
105
|
error: b.value.error,
|
|
112
106
|
rounded: b.value.rounded,
|
|
@@ -115,63 +109,68 @@ function m(d, m, h) {
|
|
|
115
109
|
disabled: b.value.disabled,
|
|
116
110
|
readOnly: b.value.readOnly,
|
|
117
111
|
timeZone: b.value.timeZone
|
|
118
|
-
})), X = a(() => b.value.orientation === "vertical"),
|
|
112
|
+
})), X = a(() => b.value.orientation === "vertical"), Ce = a(() => r(S.value?.root, C.value, p({
|
|
119
113
|
"flex flex-col overflow-hidden": !0,
|
|
120
114
|
"w-full": b.value.fill,
|
|
121
115
|
"min-w-max": !0,
|
|
122
116
|
"w-fit": !b.value.fill && X.value,
|
|
123
117
|
[w.value.root ?? ""]: !0
|
|
124
|
-
}))),
|
|
125
|
-
"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,
|
|
126
120
|
[w.value.header ?? ""]: !0
|
|
127
|
-
}))),
|
|
128
|
-
"flex min-w-0 flex-1 items-center": !0,
|
|
129
|
-
"justify-between": !X.value,
|
|
130
|
-
"justify-start": X.value,
|
|
121
|
+
}))), Te = a(() => r(S.value?.months, {}, p({
|
|
122
|
+
"flex min-w-0 flex-1 items-center justify-center": !0,
|
|
131
123
|
[w.value.months ?? ""]: !0
|
|
132
|
-
}))),
|
|
133
|
-
"flex
|
|
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
|
|
127
|
+
}))), De = a(() => r(S.value?.endHeader, {}, p({
|
|
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",
|
|
134
131
|
[w.value.endHeader ?? ""]: !0
|
|
135
|
-
}))),
|
|
136
|
-
"flex min-h-64 flex-col
|
|
132
|
+
}))), Oe = a(() => r(S.value?.body, {}, p({
|
|
133
|
+
"relative flex min-h-64 flex-col": !0,
|
|
137
134
|
[w.value.body ?? ""]: !0
|
|
138
|
-
}))),
|
|
139
|
-
"flex w-full
|
|
135
|
+
}))), ke = a(() => r(S.value?.panels, { "aria-hidden": I.value !== "date" }, p({
|
|
136
|
+
"flex w-full": !0,
|
|
140
137
|
"flex-row": !X.value,
|
|
141
138
|
"flex-col": X.value,
|
|
139
|
+
invisible: I.value !== "date",
|
|
142
140
|
[w.value.panels ?? ""]: !0
|
|
143
|
-
}))),
|
|
144
|
-
"flex min-w-72 flex-1 flex-col": !0,
|
|
141
|
+
}))), Ae = a(() => r(S.value?.start, {}, p({
|
|
142
|
+
"flex min-w-72 flex-1 flex-col px-2.5": !0,
|
|
143
|
+
"pb-2.5": !X.value,
|
|
145
144
|
[w.value.start ?? ""]: !0
|
|
146
|
-
}))),
|
|
147
|
-
"flex min-w-72 flex-1 flex-col": !0,
|
|
145
|
+
}))), je = a(() => r(S.value?.end, {}, p({
|
|
146
|
+
"flex min-w-72 flex-1 flex-col px-2.5 pb-2.5": !0,
|
|
148
147
|
[w.value.end ?? ""]: !0
|
|
149
|
-
}))),
|
|
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, {
|
|
150
149
|
type: "button",
|
|
151
150
|
disabled: b.value.disabled
|
|
152
151
|
}, p({
|
|
153
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,
|
|
154
|
-
[
|
|
153
|
+
[K.value ?? ""]: !0,
|
|
155
154
|
[w.value.selector ?? ""]: !0
|
|
156
155
|
}))), Q = a(() => r(S.value?.navButton, {
|
|
157
156
|
type: "button",
|
|
158
157
|
disabled: b.value.disabled
|
|
159
158
|
}, p({
|
|
160
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,
|
|
161
|
-
[
|
|
160
|
+
[K.value ?? ""]: !0,
|
|
162
161
|
[w.value.navButton ?? ""]: !0
|
|
163
|
-
}))),
|
|
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, {
|
|
164
163
|
...Q.value,
|
|
165
164
|
onClick: he,
|
|
166
165
|
type: "button",
|
|
167
166
|
disabled: b.value.disabled,
|
|
168
|
-
"aria-label":
|
|
167
|
+
"aria-label": Ne.value
|
|
169
168
|
}, p({ [w.value.navButton ?? ""]: !0 }))), Ie = a(() => r(S.value?.nextButton, {
|
|
170
169
|
...Q.value,
|
|
171
170
|
onClick: ge,
|
|
172
171
|
type: "button",
|
|
173
172
|
disabled: b.value.disabled,
|
|
174
|
-
"aria-label":
|
|
173
|
+
"aria-label": Pe.value
|
|
175
174
|
}, p({ [w.value.navButton ?? ""]: !0 }))), Le = a(() => r(S.value?.todayButton, {
|
|
176
175
|
onClick: _e,
|
|
177
176
|
type: "button",
|
|
@@ -179,76 +178,76 @@ function m(d, m, h) {
|
|
|
179
178
|
"aria-label": _("Today")
|
|
180
179
|
}, p({
|
|
181
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,
|
|
182
|
-
[
|
|
181
|
+
[K.value ?? ""]: !0,
|
|
183
182
|
[w.value.navButton ?? ""]: !0
|
|
184
|
-
}))),
|
|
183
|
+
}))), $ = a(() => r(S.value?.selector, void 0, {
|
|
185
184
|
...Z.value,
|
|
186
185
|
onClick: ue,
|
|
187
186
|
type: "button",
|
|
188
187
|
"aria-label": _("Select year"),
|
|
189
188
|
disabled: b.value.disabled || b.value.hideYears
|
|
190
|
-
})),
|
|
189
|
+
})), Re = a(() => ({
|
|
191
190
|
...r(S.value?.selector, void 0, {
|
|
192
191
|
...Z.value,
|
|
193
192
|
type: "button",
|
|
194
193
|
"aria-label": _("Select month"),
|
|
195
194
|
disabled: b.value.disabled || b.value.hideMonths
|
|
196
195
|
}),
|
|
197
|
-
onClick:
|
|
198
|
-
})),
|
|
196
|
+
onClick: Y
|
|
197
|
+
})), ze = a(() => ({
|
|
199
198
|
...r(S.value?.selector, void 0, {
|
|
200
199
|
...Z.value,
|
|
201
200
|
type: "button",
|
|
202
201
|
"aria-label": _("Select end month"),
|
|
203
202
|
disabled: b.value.disabled || b.value.hideMonths
|
|
204
203
|
}),
|
|
205
|
-
onClick:
|
|
206
|
-
})),
|
|
204
|
+
onClick: Y
|
|
205
|
+
})), Be = a(() => !b.value.hideYears), Ve = a(() => !b.value.hideMonths);
|
|
207
206
|
return {
|
|
208
|
-
view:
|
|
209
|
-
value:
|
|
210
|
-
shared:
|
|
207
|
+
view: I,
|
|
208
|
+
value: F,
|
|
209
|
+
shared: Se,
|
|
211
210
|
merged: b,
|
|
212
211
|
showNav: a(() => !0),
|
|
213
|
-
endBind:
|
|
214
|
-
rootBind:
|
|
215
|
-
bodyBind:
|
|
216
|
-
viewDate:
|
|
217
|
-
viewYear:
|
|
218
|
-
startBind:
|
|
219
|
-
viewMonth:
|
|
220
|
-
yearLabel:
|
|
221
|
-
monthLabel:
|
|
222
|
-
headerBind:
|
|
223
|
-
monthsBind:
|
|
224
|
-
panelsBind:
|
|
212
|
+
endBind: je,
|
|
213
|
+
rootBind: Ce,
|
|
214
|
+
bodyBind: Oe,
|
|
215
|
+
viewDate: L,
|
|
216
|
+
viewYear: U,
|
|
217
|
+
startBind: Ae,
|
|
218
|
+
viewMonth: W,
|
|
219
|
+
yearLabel: B,
|
|
220
|
+
monthLabel: V,
|
|
221
|
+
headerBind: we,
|
|
222
|
+
monthsBind: Te,
|
|
223
|
+
panelsBind: ke,
|
|
225
224
|
isVertical: X,
|
|
226
|
-
endViewDate:
|
|
227
|
-
previewDate:
|
|
228
|
-
setViewDate:
|
|
225
|
+
endViewDate: R,
|
|
226
|
+
previewDate: z,
|
|
227
|
+
setViewDate: J,
|
|
229
228
|
navIconBind: a(() => S.value?.navIcon),
|
|
230
|
-
monthTarget: F,
|
|
231
229
|
handleChange: pe,
|
|
232
230
|
yearPageSize: 15,
|
|
233
|
-
endMonthLabel:
|
|
234
|
-
endHeaderBind:
|
|
235
|
-
monthYearBind:
|
|
231
|
+
endMonthLabel: H,
|
|
232
|
+
endHeaderBind: De,
|
|
233
|
+
monthYearBind: Me,
|
|
236
234
|
nextButtonBind: Ie,
|
|
237
|
-
monthPanelYear:
|
|
235
|
+
monthPanelYear: be,
|
|
236
|
+
startHeaderBind: Ee,
|
|
238
237
|
todayButtonBind: Le,
|
|
239
|
-
monthPanelValue:
|
|
240
|
-
yearSelectorBind:
|
|
238
|
+
monthPanelValue: xe,
|
|
239
|
+
yearSelectorBind: $,
|
|
241
240
|
handleYearSelect: ve,
|
|
242
|
-
showYearSelector:
|
|
243
|
-
monthSelectorBind:
|
|
244
|
-
handleMonthSelect:
|
|
245
|
-
showMonthSelector:
|
|
241
|
+
showYearSelector: Be,
|
|
242
|
+
monthSelectorBind: Re,
|
|
243
|
+
handleMonthSelect: ye,
|
|
244
|
+
showMonthSelector: Ve,
|
|
246
245
|
previousButtonBind: Fe,
|
|
247
|
-
endMonthSelectorBind:
|
|
246
|
+
endMonthSelectorBind: ze,
|
|
248
247
|
handleEndViewDateChange: fe,
|
|
249
248
|
handlePreviewDateChange: me,
|
|
250
249
|
handleStartViewDateChange: de,
|
|
251
|
-
yearPageStart:
|
|
250
|
+
yearPageStart: G
|
|
252
251
|
};
|
|
253
252
|
}
|
|
254
253
|
//#endregion
|
|
@@ -77,12 +77,7 @@ var b = /*@__PURE__*/ u({
|
|
|
77
77
|
"hide-weekdays": v(x).hideWeekdays,
|
|
78
78
|
"disable-years": v(x).disableYears,
|
|
79
79
|
"disable-months": v(x).disableMonths,
|
|
80
|
-
"hide-outside-days": v(x).hideOutsideDays
|
|
81
|
-
"custom-props": {
|
|
82
|
-
end: { class: "pr-2.5" },
|
|
83
|
-
start: { class: "pr-2.5" },
|
|
84
|
-
panels: { class: "gap-0" }
|
|
85
|
-
}
|
|
80
|
+
"hide-outside-days": v(x).hideOutsideDays
|
|
86
81
|
}, {
|
|
87
82
|
day: y((e) => [g(i.$slots, "day", m(d(e)), () => [c(_(e.label), 1)])]),
|
|
88
83
|
startAside: y(() => [s("div", { class: p(v(C)) }, [s("div", {
|
|
@@ -91,7 +91,7 @@ function h(h, g, _ = {}) {
|
|
|
91
91
|
"relative rounded-none": !0,
|
|
92
92
|
[be.value ?? ""]: !0,
|
|
93
93
|
[Se.value ?? ""]: !0,
|
|
94
|
-
"overflow-y-auto": B.value === "paper",
|
|
94
|
+
"overflow-y-auto bridge-scroll-fade-y bridge-hide-scrollbar": B.value === "paper",
|
|
95
95
|
[we.value]: z.value,
|
|
96
96
|
[s(L.value, "panel") ?? ""]: !0
|
|
97
97
|
})
|
|
@@ -3,12 +3,12 @@ import t from "../Drawer/Drawer.js";
|
|
|
3
3
|
import { FIELD_OVERLAY_INJECTION_KEY as n } from "./fieldOverlayInjectionKey.js";
|
|
4
4
|
import r from "../Menu/Menu.js";
|
|
5
5
|
import i from "../Modal/Modal.js";
|
|
6
|
-
import { createBlock as a,
|
|
6
|
+
import { createBlock as a, createElementVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeProps as d, openBlock as f, provide as p, renderSlot as m, unref as h, useModel as g, withCtx as _ } from "vue";
|
|
7
7
|
//#region src/Components/FieldOverlay/FieldOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var v = /*@__PURE__*/ s({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "FieldOverlay",
|
|
11
|
-
props: /*@__PURE__*/
|
|
11
|
+
props: /*@__PURE__*/ l({
|
|
12
12
|
customProps: {},
|
|
13
13
|
overlay: { default: "auto" }
|
|
14
14
|
}, {
|
|
@@ -18,55 +18,55 @@ var h = /*@__PURE__*/ o({
|
|
|
18
18
|
},
|
|
19
19
|
modelModifiers: {}
|
|
20
20
|
}),
|
|
21
|
-
emits: /*@__PURE__*/
|
|
22
|
-
setup(
|
|
23
|
-
let
|
|
24
|
-
|
|
21
|
+
emits: /*@__PURE__*/ l(["close", "show-change"], ["update:modelValue"]),
|
|
22
|
+
setup(s, { emit: l }) {
|
|
23
|
+
let v = l, y = s, b = g(s, "modelValue"), { menuBind: x, modalBind: S, drawerBind: C, resolvedOverlay: w, drawerScrollerBind: T } = e(y);
|
|
24
|
+
p(n, {
|
|
25
25
|
apply: () => {
|
|
26
|
-
|
|
26
|
+
b.value = !1;
|
|
27
27
|
},
|
|
28
28
|
cancel: () => {
|
|
29
|
-
|
|
29
|
+
b.value = !1;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
function
|
|
33
|
-
|
|
32
|
+
function E(e) {
|
|
33
|
+
v("show-change", e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
35
|
+
function D() {
|
|
36
|
+
v("close");
|
|
37
37
|
}
|
|
38
|
-
return (e, n) =>
|
|
38
|
+
return (e, n) => h(w) === "menu" ? (f(), a(h(r), u({
|
|
39
39
|
key: 0,
|
|
40
|
-
modelValue:
|
|
41
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
42
|
-
},
|
|
43
|
-
onClose:
|
|
44
|
-
"onUpdate:modelValue":
|
|
40
|
+
modelValue: b.value,
|
|
41
|
+
"onUpdate:modelValue": n[0] ||= (e) => b.value = e
|
|
42
|
+
}, h(x), {
|
|
43
|
+
onClose: D,
|
|
44
|
+
"onUpdate:modelValue": E
|
|
45
45
|
}), {
|
|
46
|
-
default:
|
|
46
|
+
default: _(() => [m(e.$slots, "default")]),
|
|
47
47
|
_: 3
|
|
48
|
-
}, 16, ["modelValue"])) :
|
|
48
|
+
}, 16, ["modelValue"])) : h(w) === "modal" ? (f(), a(h(i), u({
|
|
49
49
|
key: 1,
|
|
50
|
-
modelValue:
|
|
51
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
52
|
-
},
|
|
53
|
-
onClose:
|
|
54
|
-
onShowChange:
|
|
50
|
+
modelValue: b.value,
|
|
51
|
+
"onUpdate:modelValue": n[1] ||= (e) => b.value = e
|
|
52
|
+
}, h(S), {
|
|
53
|
+
onClose: D,
|
|
54
|
+
onShowChange: E
|
|
55
55
|
}), {
|
|
56
|
-
default:
|
|
56
|
+
default: _(() => [m(e.$slots, "default")]),
|
|
57
57
|
_: 3
|
|
58
|
-
}, 16, ["modelValue"])) : (
|
|
58
|
+
}, 16, ["modelValue"])) : (f(), a(h(t), u({
|
|
59
59
|
key: 2,
|
|
60
|
-
modelValue:
|
|
61
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
62
|
-
},
|
|
63
|
-
onClose:
|
|
64
|
-
onShowChange:
|
|
60
|
+
modelValue: b.value,
|
|
61
|
+
"onUpdate:modelValue": n[2] ||= (e) => b.value = e
|
|
62
|
+
}, h(C), {
|
|
63
|
+
onClose: D,
|
|
64
|
+
onShowChange: E
|
|
65
65
|
}), {
|
|
66
|
-
default:
|
|
66
|
+
default: _(() => [o("div", d(c(h(T))), [m(e.$slots, "default")], 16)]),
|
|
67
67
|
_: 3
|
|
68
68
|
}, 16, ["modelValue"]));
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
//#endregion
|
|
72
|
-
export {
|
|
72
|
+
export { v as default };
|
|
@@ -11,5 +11,6 @@ export declare function useFieldOverlay(props: FieldOverlayOwnProps): {
|
|
|
11
11
|
modalBind: import('vue').ComputedRef<ModalOwnProps>;
|
|
12
12
|
drawerBind: import('vue').ComputedRef<DrawerOwnProps>;
|
|
13
13
|
resolvedOverlay: import('vue').ComputedRef<ResolvedFieldOverlay>;
|
|
14
|
+
drawerScrollerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
14
15
|
};
|
|
15
16
|
export type FieldOverlayOptions = FieldOverlayOwnProps;
|
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import { useBreakpoint as e } from "../../../Utils/useBreakpoint.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { mergePartBind as t } from "../../../Utils/index.js";
|
|
3
|
+
import { computed as n } from "vue";
|
|
4
|
+
import { resolveFieldOverlay as r } from "@bridge-ui/core/Domain";
|
|
5
|
+
import { cn as i } from "@bridge-ui/core/Utils";
|
|
6
|
+
import { toMerged as a } from "es-toolkit/object";
|
|
6
7
|
//#region src/Components/FieldOverlay/composables/useFieldOverlay.ts
|
|
7
|
-
function
|
|
8
|
+
function o(e, t) {
|
|
8
9
|
let n = e.customProps?.panel;
|
|
9
|
-
return
|
|
10
|
+
return a(e, { customProps: { panel: {
|
|
10
11
|
...n,
|
|
11
|
-
class:
|
|
12
|
+
class: i(t, n?.class)
|
|
12
13
|
} } });
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
15
|
+
function s(a) {
|
|
16
|
+
let s = e(), c = n(() => r(a.overlay, s.mobile));
|
|
16
17
|
return {
|
|
17
|
-
menuBind:
|
|
18
|
-
let e =
|
|
18
|
+
menuBind: n(() => {
|
|
19
|
+
let e = a.customProps?.menu;
|
|
19
20
|
return {
|
|
20
21
|
closeOnClickAway: !0,
|
|
21
22
|
placement: "bottom-start",
|
|
22
23
|
...e,
|
|
23
24
|
classes: {
|
|
24
25
|
...e?.classes,
|
|
25
|
-
content:
|
|
26
|
+
content: i(e?.classes?.content, "overflow-visible rounded-none bg-transparent shadow-none ring-0 dark:bg-transparent")
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
}),
|
|
29
|
-
modalBind:
|
|
30
|
+
modalBind: n(() => o({
|
|
30
31
|
size: "md",
|
|
31
32
|
scroll: "paper",
|
|
32
33
|
closeOnOverlay: !0,
|
|
33
34
|
align: "middle-center",
|
|
34
35
|
disableRestoreFocus: !0,
|
|
35
|
-
...
|
|
36
|
+
...a.customProps?.modal
|
|
36
37
|
}, "flex w-fit max-w-full sm:max-w-full flex-col items-stretch p-0")),
|
|
37
|
-
drawerBind:
|
|
38
|
+
drawerBind: n(() => o({
|
|
38
39
|
size: "md",
|
|
39
40
|
scroll: "paper",
|
|
40
41
|
placement: "bottom",
|
|
41
42
|
closeOnOverlay: !0,
|
|
42
43
|
disableRestoreFocus: !0,
|
|
43
|
-
...
|
|
44
|
-
}, "flex h-auto max-h-[90dvh] w-full flex-col items-stretch
|
|
45
|
-
resolvedOverlay:
|
|
44
|
+
...a.customProps?.drawer
|
|
45
|
+
}, "flex h-auto max-h-[90dvh] w-full flex-col items-stretch p-0")),
|
|
46
|
+
resolvedOverlay: c,
|
|
47
|
+
drawerScrollerBind: n(() => t(a.customProps?.drawerScroller, {}, i({ "flex min-w-0 w-full flex-col overflow-x-auto overflow-y-hidden bridge-scroll-fade-x bridge-hide-scrollbar": !0 })))
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
//#endregion
|
|
49
|
-
export {
|
|
51
|
+
export { s as useFieldOverlay };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Slot } from 'vue';
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
2
|
import { FieldOverlayMode } from '@bridge-ui/core/Domain';
|
|
3
3
|
import { DrawerOwnProps } from '../Drawer/drawer.types';
|
|
4
4
|
import { MenuOwnProps } from '../Menu/menu.types';
|
|
@@ -10,6 +10,12 @@ export interface FieldOverlayCustomProps {
|
|
|
10
10
|
* @default undefined
|
|
11
11
|
*/
|
|
12
12
|
drawer?: Partial<DrawerOwnProps>;
|
|
13
|
+
/**
|
|
14
|
+
* Props forwarded to the inner horizontal scroller in the `drawer` shell.
|
|
15
|
+
*
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
drawerScroller?: HTMLAttributes;
|
|
13
19
|
/**
|
|
14
20
|
* Props forwarded to the nested `Menu` when that shell is active.
|
|
15
21
|
*
|
|
@@ -37,14 +43,16 @@ export interface FieldOverlayEmits {
|
|
|
37
43
|
/**
|
|
38
44
|
* Renders field picker / listbox content in a `Menu`, `Modal`, or `Drawer`.
|
|
39
45
|
* Visibility is controlled with `v-model`. Shell-specific options go through
|
|
40
|
-
* `customProps.menu` / `.modal` / `.drawer`.
|
|
46
|
+
* `customProps.menu` / `.modal` / `.drawer`. The drawer inner scroller
|
|
47
|
+
* accepts `customProps.drawerScroller`.
|
|
41
48
|
*
|
|
42
49
|
* Menu chrome (fill, radius, shadow, ring) is stripped so the nested picker
|
|
43
50
|
* or listbox paints the visible surface, matching modal / drawer panels.
|
|
44
51
|
*/
|
|
45
52
|
export interface FieldOverlayOwnProps {
|
|
46
53
|
/**
|
|
47
|
-
* Extra props for the nested shells (`menu`, `modal`, `drawer`)
|
|
54
|
+
* Extra props for the nested shells (`menu`, `modal`, `drawer`) and the
|
|
55
|
+
* drawer horizontal scroller (`drawerScroller`).
|
|
48
56
|
*
|
|
49
57
|
* @default undefined
|
|
50
58
|
*/
|
|
@@ -51,7 +51,7 @@ function y(y, b) {
|
|
|
51
51
|
}), I = o(() => N.value?.selected), L = o(() => N.value?.highlighted), R = o(() => N.value?.hover), z = o(() => m(F.value?.check, N.value?.check)), B = o(() => {
|
|
52
52
|
let e = T.value.maxHeight ?? (A.value ? "max-h-[min(60dvh,28rem)]" : "max-h-60"), t = T.value.disableMaxHeight === !0;
|
|
53
53
|
return n(T.value.customProps?.scroll, {}, m({
|
|
54
|
-
"min-h-0 overflow-y-auto overscroll-contain": !t,
|
|
54
|
+
"min-h-0 overflow-y-auto overscroll-contain bridge-soft-scrollbar": !t,
|
|
55
55
|
[e]: !t,
|
|
56
56
|
[D.value.scroll ?? ""]: !0
|
|
57
57
|
}));
|
|
@@ -86,7 +86,7 @@ function v(v, y, b = {}) {
|
|
|
86
86
|
class: d({
|
|
87
87
|
"relative w-full": !0,
|
|
88
88
|
[he.value ?? ""]: !0,
|
|
89
|
-
"max-h-[calc(100dvh-2rem)] overflow-y-auto": U.value === "paper",
|
|
89
|
+
"max-h-[calc(100dvh-2rem)] overflow-y-auto bridge-scroll-fade-y bridge-hide-scrollbar": U.value === "paper",
|
|
90
90
|
[_e.value]: H.value,
|
|
91
91
|
[c(B.value, "panel") ?? ""]: !0
|
|
92
92
|
})
|
|
@@ -27,6 +27,7 @@ export declare function useTimePanel(props: MaybeRefOrGetter<TimePanelOwnProps>,
|
|
|
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;
|
|
@@ -143,34 +143,35 @@ function E(w, E, D) {
|
|
|
143
143
|
"w-fit min-w-fit": !M.value.fill,
|
|
144
144
|
[I.value.root ?? ""]: !0
|
|
145
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
|
|
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
148
|
[I.value.column ?? ""]: !0
|
|
149
|
-
}))), $ = (e, t) => {
|
|
150
|
-
let
|
|
149
|
+
}))), $ = (e, t, r) => {
|
|
150
|
+
let i = z.value;
|
|
151
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
|
}, y({
|
|
157
|
-
"w-full cursor-pointer px-3 py-2 text-sm transition-
|
|
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,
|
|
158
159
|
[R.value ?? ""]: !0,
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
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",
|
|
163
164
|
[I.value.item ?? ""]: !0
|
|
164
165
|
}));
|
|
165
166
|
}, oe = (e) => $(e, (e) => {
|
|
166
167
|
typeof e == "number" && K(e);
|
|
167
|
-
}), se = (e) => $(e, (e) => {
|
|
168
|
+
}, `Hour ${e.label}`), se = (e) => $(e, (e) => {
|
|
168
169
|
typeof e == "number" && q(e);
|
|
169
|
-
}), ce = (e) => $(e, (e) => {
|
|
170
|
+
}, `Minute ${e.label}`), ce = (e) => $(e, (e) => {
|
|
170
171
|
typeof e == "number" && J(e);
|
|
171
|
-
}), le = (e) => $(e, (e) => {
|
|
172
|
+
}, `Second ${e.label}`), le = (e) => $(e, (e) => {
|
|
172
173
|
(e === "AM" || e === "PM") && Y(e);
|
|
173
|
-
}), ue = a(() => !!M.value.ampm);
|
|
174
|
+
}, String(e.label)), ue = a(() => !!M.value.ampm);
|
|
174
175
|
return {
|
|
175
176
|
merged: M,
|
|
176
177
|
rootBind: ae,
|