@box-kite/react 2.2.7 → 2.2.9
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/BOX_AI_CONTEXT.md +76 -0
- package/BOX_KITE_AI_CONTEXT.md +76 -0
- package/analytics.cjs +1 -0
- package/analytics.d.ts +10 -0
- package/analytics.mjs +121 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +42 -38
- package/box.cjs +1 -1
- package/box.d.ts +9 -0
- package/box.mjs +17 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +8 -0
- package/client.cjs +1 -1
- package/client.mjs +120 -120
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +19 -10
- package/components/agent.cjs +1 -1
- package/components/agent.mjs +21 -8
- package/components/calendar.cjs +1 -1
- package/components/calendar.d.ts +3 -1
- package/components/calendar.mjs +154 -142
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +184 -174
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +183 -170
- package/components/dataGrid/models/columnModel.d.ts +1 -0
- package/components/dataGrid/models/gridModel.d.ts +18 -0
- package/components/dataGrid/models/rangeModel.d.ts +3 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +987 -896
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +160 -149
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +226 -206
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +38 -33
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +107 -93
- package/components/form.cjs +1 -1
- package/components/form.mjs +22 -18
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -0
- package/components/menu.mjs +196 -175
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +7 -7
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +4 -0
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +10 -5
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +84 -83
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +158 -150
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +92 -84
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +10 -5
- package/components/timeZoneSelect.cjs +1 -1
- package/components/timeZoneSelect.mjs +40 -35
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +151 -113
- package/dataGridDateParts.cjs +1 -1
- package/dataGridDateParts.mjs +56 -55
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +430 -429
- package/effects.cjs +1 -1
- package/effects.mjs +1 -1
- package/interactionListening.cjs +1 -0
- package/interactionListening.mjs +117 -0
- package/interactions.cjs +1 -0
- package/interactions.mjs +25 -0
- package/layer.cjs +1 -1
- package/layer.mjs +68 -66
- package/package.json +132 -68
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +44 -25
- package/react/interactions/interactions.d.ts +30 -0
- package/react/popover/usePopoverLayer.d.ts +3 -0
- package/react/useStyles.d.ts +8 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +49 -48
- package/reporting.cjs +1 -0
- package/reporting.mjs +51 -0
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/supabase/functions/collect/index.d.ts +30 -0
- package/supabase/functions/collect/index.test.d.ts +1 -0
- package/utils/analytics/analytics.d.ts +72 -0
- package/utils/analytics/analyticsIdentity.d.ts +13 -0
- package/utils/interactions/componentAttribute.d.ts +6 -0
- package/utils/interactions/interactionChannel.d.ts +35 -0
- package/utils/interactions/interactionJson.d.ts +6 -0
- package/utils/interactions/interactionListening.d.ts +6 -0
- package/utils/interactions/interactionTypes.d.ts +224 -0
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { f as e } from "../react-shared.mjs";
|
|
3
3
|
import t from "../box.mjs";
|
|
4
|
-
import { a as n,
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { A as
|
|
8
|
-
import { l as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import ee from "
|
|
4
|
+
import { a as n, t as r } from "../behavior.mjs";
|
|
5
|
+
import { t as i } from "../placement.mjs";
|
|
6
|
+
import { n as a, t as o } from "../dates.mjs";
|
|
7
|
+
import { A as s, N as c, O as l, i as u, r as d, x as f } from "../date-math.mjs";
|
|
8
|
+
import { l as p, s as m } from "../date-input.mjs";
|
|
9
|
+
import { a as h, t as g } from "../reporting.mjs";
|
|
10
|
+
import { Path as _, Svg as v } from "./svg.mjs";
|
|
11
|
+
import { n as ee } from "../date-environment.mjs";
|
|
12
|
+
import te from "./calendar.mjs";
|
|
12
13
|
import { t as y } from "../layer.mjs";
|
|
13
14
|
import b from "./overlay.mjs";
|
|
14
15
|
import x from "./dateField.mjs";
|
|
15
16
|
import { useCallback as S, useEffect as C, useMemo as w, useState as T } from "react";
|
|
16
|
-
import { Fragment as
|
|
17
|
+
import { Fragment as ne, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
18
|
//#region src/components/datePicker.tsx
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
function re() {
|
|
20
|
+
return /* @__PURE__ */ E(v, {
|
|
20
21
|
viewBox: "0 0 16 16",
|
|
21
22
|
width: "1rem",
|
|
22
23
|
height: "1rem",
|
|
23
24
|
props: { fill: "none" },
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ E(_, {
|
|
25
26
|
d: "M3 3.5h10a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1ZM2 7h12M5.5 2v3M10.5 2v3",
|
|
26
27
|
stroke: "currentColor",
|
|
27
28
|
strokeWidth: 1.5,
|
|
@@ -29,13 +30,13 @@ function te() {
|
|
|
29
30
|
})
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
function ie() {
|
|
34
|
+
return /* @__PURE__ */ E(v, {
|
|
34
35
|
viewBox: "0 0 16 16",
|
|
35
36
|
width: "1rem",
|
|
36
37
|
height: "1rem",
|
|
37
38
|
props: { fill: "none" },
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ E(_, {
|
|
39
40
|
d: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM8 5v3l2 1.5",
|
|
40
41
|
stroke: "currentColor",
|
|
41
42
|
strokeWidth: 1.5,
|
|
@@ -44,13 +45,13 @@ function ne() {
|
|
|
44
45
|
})
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
function ae() {
|
|
49
|
+
return /* @__PURE__ */ E(v, {
|
|
49
50
|
viewBox: "0 0 16 16",
|
|
50
51
|
width: "0.875rem",
|
|
51
52
|
height: "0.875rem",
|
|
52
53
|
props: { fill: "none" },
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ E(_, {
|
|
54
55
|
d: "m4.5 4.5 7 7m0-7-7 7",
|
|
55
56
|
stroke: "currentColor",
|
|
56
57
|
strokeWidth: 1.5,
|
|
@@ -58,12 +59,12 @@ function re() {
|
|
|
58
59
|
})
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function O(e, t) {
|
|
62
63
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
let [r,
|
|
66
|
-
|
|
65
|
+
function oe(e) {
|
|
66
|
+
let [r, a] = T(null), o = e.ref, s = S((e) => {
|
|
67
|
+
a(e), O(o, e);
|
|
67
68
|
}, [o]), c = (e) => {
|
|
68
69
|
if (!e || e.contains(document.activeElement) && document.activeElement !== e) return;
|
|
69
70
|
let t = [
|
|
@@ -78,11 +79,15 @@ function ie(e) {
|
|
|
78
79
|
open: e.open,
|
|
79
80
|
defaultOpen: e.defaultOpen,
|
|
80
81
|
onOpenChange: e.onOpenChange,
|
|
82
|
+
interaction: {
|
|
83
|
+
component: "datePicker",
|
|
84
|
+
type: "openChange"
|
|
85
|
+
},
|
|
81
86
|
onOpened: l,
|
|
82
87
|
onClosing: (e, t) => {
|
|
83
88
|
e && t?.focus();
|
|
84
89
|
}
|
|
85
|
-
}), v =
|
|
90
|
+
}), v = i({
|
|
86
91
|
side: e.side,
|
|
87
92
|
align: e.align,
|
|
88
93
|
offset: 1,
|
|
@@ -108,7 +113,7 @@ function ie(e) {
|
|
|
108
113
|
"aria-label": e.label,
|
|
109
114
|
tabIndex: -1
|
|
110
115
|
};
|
|
111
|
-
return u ? /* @__PURE__ */
|
|
116
|
+
return u ? /* @__PURE__ */ E(t, {
|
|
112
117
|
ref: p,
|
|
113
118
|
component: "popover",
|
|
114
119
|
variant: { topLayer: !0 },
|
|
@@ -120,7 +125,7 @@ function ie(e) {
|
|
|
120
125
|
...i
|
|
121
126
|
},
|
|
122
127
|
children: d ? n : null
|
|
123
|
-
}) : d && /* @__PURE__ */
|
|
128
|
+
}) : d && /* @__PURE__ */ E(b, {
|
|
124
129
|
contentRef: p,
|
|
125
130
|
anchor: r,
|
|
126
131
|
side: e.side,
|
|
@@ -135,14 +140,14 @@ function ie(e) {
|
|
|
135
140
|
}
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
|
-
function
|
|
139
|
-
let { value: n, step:
|
|
143
|
+
function se(e) {
|
|
144
|
+
let { value: n, step: i, locale: a, hourCycle: s, onSelect: c, label: l } = e, u = w(() => p(i), [i]), d = m(n, i), f = Math.max(0, d ? u.indexOf(d) : u.indexOf("09:00:00")), h = r({
|
|
140
145
|
count: u.length,
|
|
141
146
|
defaultActiveIndex: f,
|
|
142
147
|
loop: !1,
|
|
143
148
|
onSelect: (e, t) => c(u[e], t)
|
|
144
149
|
});
|
|
145
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ E(t, {
|
|
146
151
|
component: "datePicker.times",
|
|
147
152
|
position: "relative",
|
|
148
153
|
display: "flex",
|
|
@@ -155,9 +160,9 @@ function ae(e) {
|
|
|
155
160
|
props: {
|
|
156
161
|
role: "listbox",
|
|
157
162
|
"aria-label": l,
|
|
158
|
-
onKeyDown:
|
|
163
|
+
onKeyDown: h.onKeyDown
|
|
159
164
|
},
|
|
160
|
-
children: u.map((e, n) => /* @__PURE__ */
|
|
165
|
+
children: u.map((e, n) => /* @__PURE__ */ E(t, {
|
|
161
166
|
component: "datePicker.time",
|
|
162
167
|
variant: { selected: e === d },
|
|
163
168
|
px: 3,
|
|
@@ -170,20 +175,20 @@ function ae(e) {
|
|
|
170
175
|
props: {
|
|
171
176
|
role: "option",
|
|
172
177
|
"aria-selected": e === d,
|
|
173
|
-
...
|
|
178
|
+
...h.itemProps(n),
|
|
174
179
|
onClick: (t) => c(e, t)
|
|
175
180
|
},
|
|
176
|
-
children:
|
|
181
|
+
children: o(e, {
|
|
177
182
|
locale: a,
|
|
178
183
|
hour: "numeric",
|
|
179
184
|
minute: "2-digit",
|
|
180
|
-
hourCycle:
|
|
185
|
+
hourCycle: s === void 0 ? void 0 : s === 12 ? "h12" : "h23"
|
|
181
186
|
})
|
|
182
187
|
}, e))
|
|
183
188
|
});
|
|
184
189
|
}
|
|
185
|
-
function
|
|
186
|
-
return /* @__PURE__ */
|
|
190
|
+
function ce(e) {
|
|
191
|
+
return /* @__PURE__ */ E(t, {
|
|
187
192
|
component: "datePicker.presets",
|
|
188
193
|
display: "flex",
|
|
189
194
|
d: "column",
|
|
@@ -191,7 +196,7 @@ function oe(e) {
|
|
|
191
196
|
pe: 2,
|
|
192
197
|
be: 1,
|
|
193
198
|
props: { role: "group" },
|
|
194
|
-
children: e.presets.map((n) => /* @__PURE__ */
|
|
199
|
+
children: e.presets.map((n) => /* @__PURE__ */ E(t, {
|
|
195
200
|
tag: "button",
|
|
196
201
|
component: "datePicker.preset",
|
|
197
202
|
variant: { selected: e.isSelected(n.value) },
|
|
@@ -209,51 +214,56 @@ function oe(e) {
|
|
|
209
214
|
}, n.label))
|
|
210
215
|
});
|
|
211
216
|
}
|
|
212
|
-
function
|
|
213
|
-
let { type:
|
|
214
|
-
locale:
|
|
215
|
-
zone:
|
|
216
|
-
}), { locale:
|
|
217
|
-
value:
|
|
218
|
-
defaultValue:
|
|
219
|
-
onChange: (e, t) =>
|
|
217
|
+
function k(e, n) {
|
|
218
|
+
let { type: r = "date", value: i, defaultValue: a = null, onValueChange: p, zone: m, locale: _, hourCycle: v, granularity: y, disambiguation: b, min: S, max: C, isDateUnavailable: w, disabled: T = !1, readOnly: O = !1, required: k, invalid: A, name: j, label: M, labelledBy: le, describedBy: ue, open: N, defaultOpen: P, onOpenChange: de, closeOnSelect: F = !0, firstDayOfWeek: I, weekNumbers: fe, side: L = "bottom", align: pe = "start", clearable: R = !1, triggerLabel: z, clearLabel: B = "Clear", tabIndex: V, step: H = 30, defaultTime: U = "00:00", presets: W, showZone: me, ...he } = e, G = ee({
|
|
219
|
+
locale: _,
|
|
220
|
+
zone: m === "none" ? void 0 : m
|
|
221
|
+
}), { locale: K } = G, q = r === "datetime" && m !== "none" ? G.zone : null, J = q ?? G.zone, [Y, X] = h({
|
|
222
|
+
value: i,
|
|
223
|
+
defaultValue: a,
|
|
224
|
+
onChange: (e, t) => p?.(e, {
|
|
220
225
|
...t,
|
|
221
|
-
...
|
|
222
|
-
})
|
|
223
|
-
|
|
226
|
+
...f(e, J)
|
|
227
|
+
}),
|
|
228
|
+
interaction: {
|
|
229
|
+
component: "datePicker",
|
|
230
|
+
type: "valueChange",
|
|
231
|
+
content: ["value"]
|
|
232
|
+
}
|
|
233
|
+
}), Z = z ?? (r === "time" ? "Choose time" : "Choose date"), Q = typeof M == "string" ? M : Z, { attachTrigger: ge, triggerAttributes: _e, closeOnChoice: ve, attachField: ye, panel: be } = oe({
|
|
224
234
|
ref: n,
|
|
225
|
-
open:
|
|
226
|
-
defaultOpen:
|
|
227
|
-
onOpenChange:
|
|
228
|
-
side:
|
|
229
|
-
align:
|
|
230
|
-
label:
|
|
231
|
-
}),
|
|
232
|
-
locale:
|
|
233
|
-
zone:
|
|
234
|
-
...
|
|
235
|
+
open: N,
|
|
236
|
+
defaultOpen: P,
|
|
237
|
+
onOpenChange: de,
|
|
238
|
+
side: L,
|
|
239
|
+
align: pe,
|
|
240
|
+
label: Q
|
|
241
|
+
}), xe = Y && r !== "time" ? l(Y, { zone: J }) : null, Se = Y && r !== "date" ? s(Y, { zone: J }) : null, Ce = Y ? o(Y, {
|
|
242
|
+
locale: K,
|
|
243
|
+
zone: J,
|
|
244
|
+
...r === "date" ? { dateStyle: "medium" } : r === "time" ? { timeStyle: "short" } : {
|
|
235
245
|
dateStyle: "medium",
|
|
236
246
|
timeStyle: "short"
|
|
237
247
|
}
|
|
238
|
-
}) : "", $ =
|
|
239
|
-
zone:
|
|
248
|
+
}) : "", $ = ve, we = (e, t) => d(e, t, q ? {
|
|
249
|
+
zone: q,
|
|
240
250
|
disambiguation: b
|
|
241
|
-
} : {}),
|
|
242
|
-
e && (
|
|
251
|
+
} : {}), Te = (e, t) => {
|
|
252
|
+
e && (r === "date" ? (X(e, {
|
|
243
253
|
reason: "select",
|
|
244
254
|
event: t
|
|
245
|
-
}), F && $(t)) :
|
|
255
|
+
}), F && $(t)) : X(we(e, Se ?? U), {
|
|
246
256
|
reason: "select",
|
|
247
257
|
event: t
|
|
248
258
|
}));
|
|
249
|
-
},
|
|
250
|
-
|
|
259
|
+
}, Ee = (e, t) => {
|
|
260
|
+
X(r === "time" ? e : we(xe ?? c(J), e), {
|
|
251
261
|
reason: "select",
|
|
252
262
|
event: t
|
|
253
263
|
}), F && $(t);
|
|
254
|
-
},
|
|
264
|
+
}, De = /* @__PURE__ */ E(t, {
|
|
255
265
|
tag: "button",
|
|
256
|
-
ref:
|
|
266
|
+
ref: ge,
|
|
257
267
|
component: "datePicker.trigger",
|
|
258
268
|
display: "inline-flex",
|
|
259
269
|
ai: "center",
|
|
@@ -263,15 +273,15 @@ function A(e, n) {
|
|
|
263
273
|
ms: 2,
|
|
264
274
|
me: -1.5,
|
|
265
275
|
borderRadius: 1.5,
|
|
266
|
-
disabled: T ||
|
|
276
|
+
disabled: T || O,
|
|
267
277
|
props: {
|
|
268
278
|
type: "button",
|
|
269
|
-
"aria-label":
|
|
270
|
-
tabIndex:
|
|
271
|
-
...
|
|
279
|
+
"aria-label": Ce ? `${Z}, ${Ce}` : Z,
|
|
280
|
+
tabIndex: V,
|
|
281
|
+
..._e
|
|
272
282
|
},
|
|
273
|
-
children:
|
|
274
|
-
}),
|
|
283
|
+
children: E(r === "time" ? ie : re, {})
|
|
284
|
+
}), Oe = R && Y && !T && !O && /* @__PURE__ */ E(t, {
|
|
275
285
|
tag: "button",
|
|
276
286
|
component: "datePicker.clear",
|
|
277
287
|
display: "inline-flex",
|
|
@@ -283,105 +293,110 @@ function A(e, n) {
|
|
|
283
293
|
borderRadius: 999,
|
|
284
294
|
props: {
|
|
285
295
|
type: "button",
|
|
286
|
-
"aria-label":
|
|
287
|
-
tabIndex:
|
|
288
|
-
onClick: (e) =>
|
|
296
|
+
"aria-label": B,
|
|
297
|
+
tabIndex: V,
|
|
298
|
+
onClick: (e) => X(null, {
|
|
289
299
|
reason: "clear",
|
|
290
300
|
event: e
|
|
291
301
|
})
|
|
292
302
|
},
|
|
293
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ E(ae, {})
|
|
294
304
|
});
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
ref:
|
|
305
|
+
return /* @__PURE__ */ D(g, { children: [/* @__PURE__ */ E(x, {
|
|
306
|
+
ref: ye,
|
|
297
307
|
...he,
|
|
298
|
-
type:
|
|
299
|
-
value:
|
|
300
|
-
onValueChange: (e, t) =>
|
|
308
|
+
type: r,
|
|
309
|
+
value: Y,
|
|
310
|
+
onValueChange: (e, t) => X(e, {
|
|
301
311
|
reason: t.reason,
|
|
302
312
|
event: t.event
|
|
303
313
|
}),
|
|
304
|
-
zone:
|
|
305
|
-
locale:
|
|
306
|
-
hourCycle:
|
|
314
|
+
zone: m,
|
|
315
|
+
locale: _,
|
|
316
|
+
hourCycle: v,
|
|
307
317
|
granularity: y,
|
|
308
318
|
disambiguation: b,
|
|
309
319
|
min: S,
|
|
310
320
|
max: C,
|
|
311
321
|
isDateUnavailable: w,
|
|
312
322
|
disabled: T,
|
|
313
|
-
readOnly:
|
|
314
|
-
required:
|
|
315
|
-
invalid:
|
|
316
|
-
name:
|
|
317
|
-
label:
|
|
318
|
-
labelledBy:
|
|
319
|
-
describedBy:
|
|
323
|
+
readOnly: O,
|
|
324
|
+
required: k,
|
|
325
|
+
invalid: A,
|
|
326
|
+
name: j,
|
|
327
|
+
label: M,
|
|
328
|
+
labelledBy: le,
|
|
329
|
+
describedBy: ue,
|
|
320
330
|
showZone: me,
|
|
321
|
-
tabIndex:
|
|
322
|
-
end: /* @__PURE__ */
|
|
323
|
-
}),
|
|
331
|
+
tabIndex: V,
|
|
332
|
+
end: /* @__PURE__ */ D(ne, { children: [Oe, De] })
|
|
333
|
+
}), be(/* @__PURE__ */ D(t, {
|
|
324
334
|
display: "flex",
|
|
325
335
|
gap: 3,
|
|
326
336
|
ai: "stretch",
|
|
327
337
|
children: [
|
|
328
|
-
|
|
329
|
-
presets:
|
|
330
|
-
isSelected: (e) =>
|
|
338
|
+
W && W.length > 0 && /* @__PURE__ */ E(ce, {
|
|
339
|
+
presets: W,
|
|
340
|
+
isSelected: (e) => Y !== null && u(e, Y, { zone: J }) === 0,
|
|
331
341
|
onSelect: (e, t) => {
|
|
332
|
-
|
|
342
|
+
X(e, {
|
|
333
343
|
reason: "preset",
|
|
334
344
|
event: t
|
|
335
345
|
}), F && $(t);
|
|
336
346
|
}
|
|
337
347
|
}),
|
|
338
|
-
|
|
339
|
-
value:
|
|
340
|
-
onValueChange: (e, t) =>
|
|
341
|
-
min: S ?
|
|
342
|
-
max: C ?
|
|
348
|
+
r !== "time" && /* @__PURE__ */ E(te, {
|
|
349
|
+
value: xe,
|
|
350
|
+
onValueChange: (e, t) => Te(e, t.event),
|
|
351
|
+
min: S ? l(S, { zone: J }) : void 0,
|
|
352
|
+
max: C ? l(C, { zone: J }) : void 0,
|
|
343
353
|
isDateUnavailable: w,
|
|
344
|
-
locale:
|
|
345
|
-
zone:
|
|
354
|
+
locale: _,
|
|
355
|
+
zone: m === "none" ? void 0 : m,
|
|
346
356
|
firstDayOfWeek: I,
|
|
347
|
-
weekNumbers:
|
|
357
|
+
weekNumbers: fe
|
|
348
358
|
}),
|
|
349
|
-
|
|
350
|
-
value:
|
|
351
|
-
step:
|
|
352
|
-
locale:
|
|
353
|
-
hourCycle:
|
|
354
|
-
label:
|
|
355
|
-
onSelect:
|
|
359
|
+
r !== "date" && /* @__PURE__ */ E(se, {
|
|
360
|
+
value: Se,
|
|
361
|
+
step: H,
|
|
362
|
+
locale: K,
|
|
363
|
+
hourCycle: v,
|
|
364
|
+
label: r === "time" ? Q : "Time",
|
|
365
|
+
onSelect: Ee
|
|
356
366
|
})
|
|
357
367
|
]
|
|
358
368
|
}))] });
|
|
359
369
|
}
|
|
360
|
-
function
|
|
361
|
-
let { value:
|
|
362
|
-
value:
|
|
363
|
-
defaultValue:
|
|
364
|
-
onChange:
|
|
370
|
+
function A(e, n) {
|
|
371
|
+
let { value: r, defaultValue: i = null, onValueChange: o, locale: s, min: c, max: l, isDateUnavailable: d, disabled: f = !1, readOnly: p = !1, required: m, invalid: _, startName: v, endName: y, label: b, labelledBy: S, describedBy: C, startLabel: w = "Start date", endLabel: ne = "End date", open: ie, defaultOpen: O, onOpenChange: se, closeOnSelect: k = !0, firstDayOfWeek: A, weekNumbers: j, months: M = 2, side: le = "bottom", align: ue = "start", clearable: N = !1, triggerLabel: P = "Choose dates", clearLabel: de = "Clear", tabIndex: F, presets: I, props: fe, ...L } = e, { locale: pe } = ee({ locale: s }), [R, z] = h({
|
|
372
|
+
value: r,
|
|
373
|
+
defaultValue: i,
|
|
374
|
+
onChange: o,
|
|
375
|
+
interaction: {
|
|
376
|
+
component: "dateRangePicker",
|
|
377
|
+
type: "valueChange",
|
|
378
|
+
content: ["value"]
|
|
379
|
+
}
|
|
365
380
|
}), [B, V] = T({
|
|
366
|
-
start:
|
|
367
|
-
end:
|
|
368
|
-
source:
|
|
381
|
+
start: R?.start ?? null,
|
|
382
|
+
end: R?.end ?? null,
|
|
383
|
+
source: R
|
|
369
384
|
}), { start: H, end: U } = B;
|
|
370
|
-
B.source !==
|
|
385
|
+
B.source !== R && (H = R?.start ?? null, U = R?.end ?? null, V({
|
|
371
386
|
start: H,
|
|
372
387
|
end: U,
|
|
373
|
-
source:
|
|
388
|
+
source: R
|
|
374
389
|
}));
|
|
375
|
-
let { attachTrigger:
|
|
390
|
+
let { attachTrigger: W, triggerAttributes: me, closeOnChoice: he, id: G, attachField: K, panel: q } = oe({
|
|
376
391
|
ref: n,
|
|
377
|
-
open:
|
|
378
|
-
defaultOpen:
|
|
379
|
-
onOpenChange:
|
|
380
|
-
side:
|
|
381
|
-
align:
|
|
392
|
+
open: ie,
|
|
393
|
+
defaultOpen: O,
|
|
394
|
+
onOpenChange: se,
|
|
395
|
+
side: le,
|
|
396
|
+
align: ue,
|
|
382
397
|
label: typeof b == "string" ? b : P
|
|
383
|
-
}), J =
|
|
384
|
-
let i = e && t &&
|
|
398
|
+
}), J = R ? a(R.start, R.end, { locale: pe }) : "", Y = H !== null && U !== null && u(H, U) > 0, X = (e, t, n, r) => {
|
|
399
|
+
let i = e && t && u(e, t) <= 0 ? {
|
|
385
400
|
start: e,
|
|
386
401
|
end: t
|
|
387
402
|
} : null;
|
|
@@ -389,25 +404,25 @@ function j(e, n) {
|
|
|
389
404
|
start: e,
|
|
390
405
|
end: t,
|
|
391
406
|
source: i
|
|
392
|
-
}),
|
|
407
|
+
}), z(i, {
|
|
393
408
|
reason: n,
|
|
394
409
|
event: r
|
|
395
410
|
});
|
|
396
|
-
}, Z =
|
|
397
|
-
locale:
|
|
398
|
-
min:
|
|
399
|
-
max:
|
|
400
|
-
isDateUnavailable:
|
|
401
|
-
disabled:
|
|
402
|
-
readOnly:
|
|
403
|
-
required:
|
|
411
|
+
}, Z = he, Q = {
|
|
412
|
+
locale: s,
|
|
413
|
+
min: c,
|
|
414
|
+
max: l,
|
|
415
|
+
isDateUnavailable: d,
|
|
416
|
+
disabled: f,
|
|
417
|
+
readOnly: p,
|
|
418
|
+
required: m,
|
|
404
419
|
component: "datePicker.part",
|
|
405
420
|
px: 0,
|
|
406
421
|
py: 0,
|
|
407
|
-
tabIndex:
|
|
422
|
+
tabIndex: F
|
|
408
423
|
};
|
|
409
|
-
return /* @__PURE__ */
|
|
410
|
-
b !== void 0 && /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ D(g, { children: [
|
|
425
|
+
b !== void 0 && /* @__PURE__ */ E(t, {
|
|
411
426
|
component: "dateField.label",
|
|
412
427
|
display: "block",
|
|
413
428
|
mb: 1.5,
|
|
@@ -415,7 +430,7 @@ function j(e, n) {
|
|
|
415
430
|
id: `${G}-label`,
|
|
416
431
|
children: b
|
|
417
432
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ D(t, {
|
|
419
434
|
ref: K,
|
|
420
435
|
component: "dateField",
|
|
421
436
|
display: "inline-flex",
|
|
@@ -423,107 +438,112 @@ function j(e, n) {
|
|
|
423
438
|
gap: 2,
|
|
424
439
|
px: 3,
|
|
425
440
|
py: 2,
|
|
426
|
-
...
|
|
427
|
-
variant: [
|
|
428
|
-
disabled:
|
|
429
|
-
invalid:
|
|
441
|
+
...L,
|
|
442
|
+
variant: [L.variant, {
|
|
443
|
+
disabled: f,
|
|
444
|
+
invalid: _ ?? Y
|
|
430
445
|
}],
|
|
431
446
|
props: {
|
|
432
447
|
role: "group",
|
|
433
448
|
"aria-labelledby": [b === void 0 ? void 0 : `${G}-label`, S].filter(Boolean).join(" ") || void 0,
|
|
434
|
-
"aria-invalid": (
|
|
449
|
+
"aria-invalid": (_ ?? Y) || void 0,
|
|
435
450
|
"aria-describedby": C,
|
|
436
|
-
...
|
|
451
|
+
...fe
|
|
437
452
|
},
|
|
438
453
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ E(x, {
|
|
440
455
|
...Q,
|
|
441
456
|
value: H,
|
|
442
457
|
onValueChange: (e, t) => X(e, U, t.reason, t.event),
|
|
443
|
-
name:
|
|
458
|
+
name: v,
|
|
444
459
|
props: { "aria-label": w },
|
|
445
|
-
invalid:
|
|
460
|
+
invalid: _ ?? Y
|
|
446
461
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ E(t, {
|
|
448
463
|
component: "dateField.literal",
|
|
449
464
|
props: { "aria-hidden": !0 },
|
|
450
465
|
children: "–"
|
|
451
466
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ E(x, {
|
|
453
468
|
...Q,
|
|
454
469
|
value: U,
|
|
455
470
|
onValueChange: (e, t) => X(H, e, t.reason, t.event),
|
|
456
471
|
name: y,
|
|
457
472
|
props: { "aria-label": ne },
|
|
458
|
-
invalid:
|
|
459
|
-
}),
|
|
460
|
-
ue && z && !p && !m && /* @__PURE__ */ D(t, {
|
|
461
|
-
tag: "button",
|
|
462
|
-
component: "datePicker.clear",
|
|
463
|
-
display: "inline-flex",
|
|
464
|
-
ai: "center",
|
|
465
|
-
jc: "center",
|
|
466
|
-
width: 6,
|
|
467
|
-
height: 6,
|
|
468
|
-
borderRadius: 999,
|
|
469
|
-
props: {
|
|
470
|
-
type: "button",
|
|
471
|
-
"aria-label": F,
|
|
472
|
-
tabIndex: I,
|
|
473
|
-
onClick: (e) => X(null, null, "clear", e)
|
|
474
|
-
},
|
|
475
|
-
children: /* @__PURE__ */ D(re, {})
|
|
473
|
+
invalid: _ ?? Y
|
|
476
474
|
}),
|
|
477
475
|
/* @__PURE__ */ D(t, {
|
|
478
|
-
tag: "button",
|
|
479
|
-
ref: me,
|
|
480
|
-
component: "datePicker.trigger",
|
|
481
476
|
display: "inline-flex",
|
|
482
477
|
ai: "center",
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
478
|
+
gap: 2,
|
|
479
|
+
ms: "auto",
|
|
480
|
+
children: [N && R && !f && !p && /* @__PURE__ */ E(t, {
|
|
481
|
+
tag: "button",
|
|
482
|
+
component: "datePicker.clear",
|
|
483
|
+
display: "inline-flex",
|
|
484
|
+
ai: "center",
|
|
485
|
+
jc: "center",
|
|
486
|
+
width: 6,
|
|
487
|
+
height: 6,
|
|
488
|
+
borderRadius: 999,
|
|
489
|
+
props: {
|
|
490
|
+
type: "button",
|
|
491
|
+
"aria-label": de,
|
|
492
|
+
tabIndex: F,
|
|
493
|
+
onClick: (e) => X(null, null, "clear", e)
|
|
494
|
+
},
|
|
495
|
+
children: /* @__PURE__ */ E(ae, {})
|
|
496
|
+
}), /* @__PURE__ */ E(t, {
|
|
497
|
+
tag: "button",
|
|
498
|
+
ref: W,
|
|
499
|
+
component: "datePicker.trigger",
|
|
500
|
+
display: "inline-flex",
|
|
501
|
+
ai: "center",
|
|
502
|
+
jc: "center",
|
|
503
|
+
width: 7,
|
|
504
|
+
height: 7,
|
|
505
|
+
me: -1.5,
|
|
506
|
+
borderRadius: 1.5,
|
|
507
|
+
disabled: f || p,
|
|
508
|
+
props: {
|
|
509
|
+
type: "button",
|
|
510
|
+
"aria-label": J ? `${P}, ${J}` : P,
|
|
511
|
+
tabIndex: F,
|
|
512
|
+
...me
|
|
513
|
+
},
|
|
514
|
+
children: /* @__PURE__ */ E(re, {})
|
|
515
|
+
})]
|
|
496
516
|
})
|
|
497
517
|
]
|
|
498
518
|
}),
|
|
499
|
-
q(/* @__PURE__ */
|
|
519
|
+
q(/* @__PURE__ */ D(t, {
|
|
500
520
|
display: "flex",
|
|
501
521
|
gap: 3,
|
|
502
522
|
ai: "stretch",
|
|
503
|
-
children: [
|
|
504
|
-
presets:
|
|
505
|
-
isSelected: (e) =>
|
|
523
|
+
children: [I && I.length > 0 && /* @__PURE__ */ E(ce, {
|
|
524
|
+
presets: I,
|
|
525
|
+
isSelected: (e) => R !== null && e.start === R.start && e.end === R.end,
|
|
506
526
|
onSelect: (e, t) => {
|
|
507
|
-
X(e.start, e.end, "preset", t),
|
|
527
|
+
X(e.start, e.end, "preset", t), k && Z(t);
|
|
508
528
|
}
|
|
509
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ E(te, {
|
|
510
530
|
mode: "range",
|
|
511
|
-
months:
|
|
512
|
-
value:
|
|
531
|
+
months: M,
|
|
532
|
+
value: R,
|
|
513
533
|
defaultFocusedDate: H ?? void 0,
|
|
514
534
|
onValueChange: (e, t) => {
|
|
515
|
-
X(e?.start ?? null, e?.end ?? null, "select", t.event),
|
|
535
|
+
X(e?.start ?? null, e?.end ?? null, "select", t.event), k && e && t.event && Z(t.event);
|
|
516
536
|
},
|
|
517
|
-
min:
|
|
518
|
-
max:
|
|
519
|
-
isDateUnavailable:
|
|
520
|
-
locale:
|
|
521
|
-
firstDayOfWeek:
|
|
522
|
-
weekNumbers:
|
|
537
|
+
min: c,
|
|
538
|
+
max: l,
|
|
539
|
+
isDateUnavailable: d,
|
|
540
|
+
locale: s,
|
|
541
|
+
firstDayOfWeek: A,
|
|
542
|
+
weekNumbers: j
|
|
523
543
|
})]
|
|
524
544
|
}))
|
|
525
545
|
] });
|
|
526
546
|
}
|
|
527
|
-
var
|
|
547
|
+
var j = e(k, "DatePicker"), M = e(A, "DateRangePicker");
|
|
528
548
|
//#endregion
|
|
529
|
-
export {
|
|
549
|
+
export { M as DateRangePicker, j as default };
|