@box-kite/react 2.2.7 → 2.2.8
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 +165 -159
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +198 -183
- 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
package/components/toaster.mjs
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { c as e, t } from "../platform.mjs";
|
|
3
|
+
import { t as n } from "../client.mjs";
|
|
4
4
|
import { n as r } from "../effects.mjs";
|
|
5
|
-
import i from "../
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { t as i } from "../interactions.mjs";
|
|
6
|
+
import a from "../box.mjs";
|
|
7
|
+
import { i as o } from "../reporting.mjs";
|
|
8
|
+
import { n as s } from "../layer.mjs";
|
|
9
|
+
import { t as c } from "../motion.mjs";
|
|
10
|
+
import { useCallback as l, useRef as u } from "react";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
import { createPortal as p } from "react-dom";
|
|
13
|
+
import { useSyncExternalStore as m } from "use-sync-external-store/shim";
|
|
12
14
|
//#region src/utils/toast/toastStore.ts
|
|
13
|
-
var
|
|
15
|
+
var h = ["value"], g = {
|
|
14
16
|
toasts: [],
|
|
15
17
|
overflow: 0
|
|
16
|
-
},
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
}, _ = 0;
|
|
19
|
+
function v() {
|
|
20
|
+
return _ += 1, `toast-${_}`;
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
let t = [], n =
|
|
22
|
-
let t =
|
|
23
|
-
t?.handle && clearTimeout(t.handle),
|
|
24
|
-
},
|
|
22
|
+
function y(e) {
|
|
23
|
+
let t = [], n = g, r = e?.limit ?? 3, a = e?.duration ?? 5e3, o = !1, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), l = (e) => {
|
|
24
|
+
let t = c.get(e);
|
|
25
|
+
t?.handle && clearTimeout(t.handle), c.delete(e);
|
|
26
|
+
}, u = () => {
|
|
25
27
|
let e = 0;
|
|
26
28
|
t = t.map((t) => {
|
|
27
29
|
let n = !t.open || e++ < r;
|
|
@@ -32,122 +34,153 @@ function g(e) {
|
|
|
32
34
|
}), n = {
|
|
33
35
|
toasts: t,
|
|
34
36
|
overflow: Math.max(0, e - r)
|
|
35
|
-
},
|
|
37
|
+
}, d(), s.forEach((e) => e());
|
|
36
38
|
};
|
|
37
|
-
function
|
|
39
|
+
function d() {
|
|
38
40
|
let e = /* @__PURE__ */ new Set();
|
|
39
41
|
for (let n of t) {
|
|
40
42
|
if (!n.open || !n.visible || !Number.isFinite(n.duration)) continue;
|
|
41
43
|
e.add(n.id);
|
|
42
|
-
let t =
|
|
44
|
+
let t = c.get(n.id) ?? {
|
|
43
45
|
handle: null,
|
|
44
46
|
remaining: n.duration,
|
|
45
47
|
startedAt: 0
|
|
46
48
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
c.set(n.id, t), !(o || t.handle) && (t.startedAt = Date.now(), t.handle = setTimeout(() => {
|
|
50
|
+
c.delete(n.id), p(n.id, "timeout");
|
|
49
51
|
}, t.remaining));
|
|
50
52
|
}
|
|
51
|
-
for (let t of [...
|
|
53
|
+
for (let t of [...c.keys()]) e.has(t) || l(t);
|
|
52
54
|
}
|
|
53
|
-
let
|
|
54
|
-
function
|
|
55
|
+
let f = (e, t) => t ?? (e === "loading" ? Infinity : a);
|
|
56
|
+
function p(e, n = "imperative") {
|
|
55
57
|
let r = [];
|
|
56
|
-
t = t.map((t) => !t.open || e !== void 0 && t.id !== e ? t : (r.push(t),
|
|
58
|
+
t = t.map((t) => !t.open || e !== void 0 && t.id !== e ? t : (r.push(t), l(t.id), {
|
|
57
59
|
...t,
|
|
58
60
|
open: !1
|
|
59
|
-
})), r.length && (
|
|
61
|
+
})), r.length && (u(), r.forEach((e) => {
|
|
62
|
+
e.onDismiss?.(n), i({
|
|
63
|
+
component: "toaster",
|
|
64
|
+
type: "dismiss",
|
|
65
|
+
reason: n,
|
|
66
|
+
value: e.message,
|
|
67
|
+
details: {
|
|
68
|
+
id: e.id,
|
|
69
|
+
kind: e.kind
|
|
70
|
+
},
|
|
71
|
+
content: h
|
|
72
|
+
});
|
|
73
|
+
}));
|
|
60
74
|
}
|
|
61
75
|
function m(e, n, r) {
|
|
62
|
-
let
|
|
76
|
+
let a = !1;
|
|
63
77
|
t = t.map((t) => {
|
|
64
78
|
if (t.id !== e) return t;
|
|
65
|
-
|
|
66
|
-
let
|
|
79
|
+
a = !0, l(e);
|
|
80
|
+
let i = r?.kind ?? t.kind;
|
|
67
81
|
return {
|
|
68
82
|
...t,
|
|
69
83
|
...r,
|
|
70
84
|
id: e,
|
|
71
85
|
message: n,
|
|
72
|
-
kind:
|
|
73
|
-
duration: r?.duration ?? (r?.kind ?
|
|
86
|
+
kind: i,
|
|
87
|
+
duration: r?.duration ?? (r?.kind ? f(i) : t.duration),
|
|
74
88
|
open: !0
|
|
75
89
|
};
|
|
76
|
-
}),
|
|
90
|
+
}), a && (u(), i({
|
|
91
|
+
component: "toaster",
|
|
92
|
+
type: "update",
|
|
93
|
+
reason: r?.kind,
|
|
94
|
+
value: n,
|
|
95
|
+
details: { id: e },
|
|
96
|
+
source: "app",
|
|
97
|
+
content: h
|
|
98
|
+
}));
|
|
77
99
|
}
|
|
78
|
-
function
|
|
79
|
-
let r = n?.id ??
|
|
100
|
+
function _(e, n) {
|
|
101
|
+
let r = n?.id ?? v();
|
|
80
102
|
if (n?.id && t.some((e) => e.id === r)) return m(r, e, n), r;
|
|
81
|
-
let
|
|
103
|
+
let a = n?.kind ?? "default";
|
|
82
104
|
return t = [...t, {
|
|
83
105
|
id: r,
|
|
84
|
-
kind:
|
|
106
|
+
kind: a,
|
|
85
107
|
message: e,
|
|
86
108
|
description: n?.description,
|
|
87
|
-
duration:
|
|
109
|
+
duration: f(a, n?.duration),
|
|
88
110
|
action: n?.action,
|
|
89
111
|
dismissible: n?.dismissible ?? !0,
|
|
90
112
|
onDismiss: n?.onDismiss,
|
|
91
113
|
open: !0,
|
|
92
114
|
visible: !1
|
|
93
|
-
}],
|
|
115
|
+
}], u(), i({
|
|
116
|
+
component: "toaster",
|
|
117
|
+
type: "show",
|
|
118
|
+
reason: a,
|
|
119
|
+
value: e,
|
|
120
|
+
details: {
|
|
121
|
+
id: r,
|
|
122
|
+
kind: a
|
|
123
|
+
},
|
|
124
|
+
source: "app",
|
|
125
|
+
content: h
|
|
126
|
+
}), r;
|
|
94
127
|
}
|
|
95
128
|
return {
|
|
96
129
|
subscribe(e) {
|
|
97
|
-
return
|
|
130
|
+
return s.add(e), () => s.delete(e);
|
|
98
131
|
},
|
|
99
132
|
getSnapshot: () => n,
|
|
100
|
-
getServerSnapshot: () =>
|
|
101
|
-
add:
|
|
133
|
+
getServerSnapshot: () => g,
|
|
134
|
+
add: _,
|
|
102
135
|
update: m,
|
|
103
|
-
dismiss:
|
|
136
|
+
dismiss: p,
|
|
104
137
|
remove(e) {
|
|
105
138
|
let n = t.filter((t) => t.id !== e);
|
|
106
|
-
n.length !== t.length && (
|
|
139
|
+
n.length !== t.length && (l(e), t = n, u());
|
|
107
140
|
},
|
|
108
141
|
setLimit(e) {
|
|
109
|
-
e !== r && (r = e,
|
|
142
|
+
e !== r && (r = e, u());
|
|
110
143
|
},
|
|
111
144
|
setDefaultDuration(e) {
|
|
112
|
-
|
|
145
|
+
a = e;
|
|
113
146
|
},
|
|
114
147
|
pause() {
|
|
115
|
-
if (!
|
|
116
|
-
|
|
117
|
-
for (let e of
|
|
148
|
+
if (!o) {
|
|
149
|
+
o = !0;
|
|
150
|
+
for (let e of c.values()) e.handle && (clearTimeout(e.handle), e.handle = null, e.remaining = Math.max(0, e.remaining - (Date.now() - e.startedAt)));
|
|
118
151
|
}
|
|
119
152
|
},
|
|
120
153
|
resume() {
|
|
121
|
-
|
|
154
|
+
o && (o = !1, d());
|
|
122
155
|
},
|
|
123
156
|
reset() {
|
|
124
|
-
for (let e of [...
|
|
125
|
-
t = [], n =
|
|
157
|
+
for (let e of [...c.keys()]) l(e);
|
|
158
|
+
t = [], n = g, s.forEach((e) => e());
|
|
126
159
|
}
|
|
127
160
|
};
|
|
128
161
|
}
|
|
129
162
|
//#endregion
|
|
130
163
|
//#region src/components/toaster.tsx
|
|
131
|
-
var
|
|
164
|
+
var b = y(), x = (e) => (t, n) => b.add(t, {
|
|
132
165
|
...n,
|
|
133
166
|
kind: e
|
|
134
|
-
}),
|
|
135
|
-
success:
|
|
136
|
-
error:
|
|
137
|
-
warning:
|
|
138
|
-
info:
|
|
139
|
-
loading:
|
|
140
|
-
update: (e, t, n) =>
|
|
141
|
-
dismiss: (e) =>
|
|
167
|
+
}), S = Object.assign((e, t) => b.add(e, t), {
|
|
168
|
+
success: x("success"),
|
|
169
|
+
error: x("error"),
|
|
170
|
+
warning: x("warning"),
|
|
171
|
+
info: x("info"),
|
|
172
|
+
loading: x("loading"),
|
|
173
|
+
update: (e, t, n) => b.update(e, t, n),
|
|
174
|
+
dismiss: (e) => b.dismiss(e, "imperative"),
|
|
142
175
|
promise(e, t, n) {
|
|
143
|
-
let r =
|
|
176
|
+
let r = b.add(t.loading, {
|
|
144
177
|
...n,
|
|
145
178
|
id: n?.id,
|
|
146
179
|
kind: "loading"
|
|
147
180
|
}), i = (e, t) => typeof e == "function" ? e(t) : e;
|
|
148
|
-
return e.then((e) =>
|
|
181
|
+
return e.then((e) => b.update(r, i(t.success, e), { kind: "success" }), (e) => b.update(r, i(t.error, e), { kind: "error" })), e;
|
|
149
182
|
}
|
|
150
|
-
}),
|
|
183
|
+
}), C = {
|
|
151
184
|
"top-start": "topStart",
|
|
152
185
|
"top-center": "topCenter",
|
|
153
186
|
"top-end": "topEnd",
|
|
@@ -155,53 +188,58 @@ var _ = g(), v = (e) => (t, n) => _.add(t, {
|
|
|
155
188
|
"bottom-center": "bottomCenter",
|
|
156
189
|
"bottom-end": "bottomEnd"
|
|
157
190
|
};
|
|
158
|
-
function
|
|
191
|
+
function w(e, t) {
|
|
159
192
|
let n = t.toLowerCase().split("+"), r = n[n.length - 1], i = new Set(n.slice(0, -1));
|
|
160
193
|
return e.key.toLowerCase() === r && e.altKey === i.has("alt") && e.ctrlKey === i.has("ctrl") && e.shiftKey === i.has("shift") && e.metaKey === i.has("meta");
|
|
161
194
|
}
|
|
162
|
-
function
|
|
163
|
-
let { toast: t, store: n, fromTop:
|
|
195
|
+
function T(e) {
|
|
196
|
+
let { toast: t, store: n, fromTop: i, closeLabel: s } = e, { mounted: l, ref: u, props: p } = c({ present: t.open }), m = o("toaster");
|
|
164
197
|
if (r(() => {
|
|
165
|
-
|
|
198
|
+
l || n.remove(t.id);
|
|
166
199
|
}, [
|
|
167
|
-
|
|
200
|
+
l,
|
|
168
201
|
n,
|
|
169
202
|
t.id
|
|
170
|
-
]), !
|
|
171
|
-
let
|
|
172
|
-
|
|
203
|
+
]), !l) return null;
|
|
204
|
+
let h = t.action, g = () => {
|
|
205
|
+
h?.onClick(), h?.closeOnClick === !1 ? m("action", t.message, {
|
|
206
|
+
reason: "action",
|
|
207
|
+
id: t.id,
|
|
208
|
+
kind: t.kind,
|
|
209
|
+
content: ["value"]
|
|
210
|
+
}) : n.dismiss(t.id, "action");
|
|
173
211
|
};
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
-
ref:
|
|
212
|
+
return /* @__PURE__ */ f(a, {
|
|
213
|
+
ref: u,
|
|
176
214
|
component: "toaster.toast",
|
|
177
215
|
variant: {
|
|
178
216
|
[t.kind]: t.kind !== "default",
|
|
179
|
-
fromTop:
|
|
217
|
+
fromTop: i
|
|
180
218
|
},
|
|
181
219
|
props: {
|
|
182
220
|
...t.kind === "error" ? { role: "alert" } : {},
|
|
183
221
|
"data-toast-id": t.id,
|
|
184
|
-
...
|
|
222
|
+
...p
|
|
185
223
|
},
|
|
186
224
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ d(a, {
|
|
188
226
|
component: "toaster.message",
|
|
189
227
|
children: t.message
|
|
190
228
|
}),
|
|
191
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
229
|
+
t.description !== void 0 && /* @__PURE__ */ d(a, {
|
|
192
230
|
component: "toaster.description",
|
|
193
231
|
children: t.description
|
|
194
232
|
}),
|
|
195
|
-
|
|
233
|
+
h && /* @__PURE__ */ d(a, {
|
|
196
234
|
tag: "button",
|
|
197
235
|
component: "toaster.action",
|
|
198
236
|
props: {
|
|
199
237
|
type: "button",
|
|
200
|
-
onClick:
|
|
238
|
+
onClick: g
|
|
201
239
|
},
|
|
202
|
-
children:
|
|
240
|
+
children: h.label
|
|
203
241
|
}),
|
|
204
|
-
t.dismissible && /* @__PURE__ */
|
|
242
|
+
t.dismissible && /* @__PURE__ */ d(a, {
|
|
205
243
|
tag: "button",
|
|
206
244
|
component: "toaster.close",
|
|
207
245
|
props: {
|
|
@@ -213,33 +251,33 @@ function S(e) {
|
|
|
213
251
|
]
|
|
214
252
|
});
|
|
215
253
|
}
|
|
216
|
-
function
|
|
217
|
-
let { position:
|
|
254
|
+
function E(i) {
|
|
255
|
+
let { position: o = "bottom-end", limit: c = 3, duration: h = 5e3, label: g = "Notifications", closeLabel: _ = "Close", overflowLabel: v = (e) => `+${e} more`, hotkey: y = "F6", store: x = b, props: S, ...E } = i, D = m(x.subscribe, x.getSnapshot, x.getServerSnapshot), O = s(), k = n(!O), A = u(null), j = u(null), M = u({
|
|
218
256
|
hovered: !1,
|
|
219
257
|
focused: !1,
|
|
220
258
|
hidden: !1
|
|
221
|
-
}), N =
|
|
259
|
+
}), N = l(() => {
|
|
222
260
|
let { hovered: e, focused: t, hidden: n } = M.current;
|
|
223
|
-
e || t || n ?
|
|
224
|
-
}, [
|
|
225
|
-
r(() =>
|
|
226
|
-
let
|
|
227
|
-
!O || !
|
|
261
|
+
e || t || n ? x.pause() : x.resume();
|
|
262
|
+
}, [x]);
|
|
263
|
+
r(() => x.setLimit(c), [x, c]), r(() => x.setDefaultDuration(h), [x, h]), r(() => {
|
|
264
|
+
let t = A.current;
|
|
265
|
+
!O || !e() || !t || !t.isConnected || t.matches(":popover-open") || t.showPopover();
|
|
228
266
|
}), r(() => {
|
|
229
|
-
let e =
|
|
267
|
+
let e = t();
|
|
230
268
|
if (!e) return;
|
|
231
|
-
let
|
|
269
|
+
let n = new AbortController();
|
|
232
270
|
return e.addEventListener("visibilitychange", () => {
|
|
233
271
|
M.current.hidden = e.hidden, N();
|
|
234
|
-
}, { signal:
|
|
272
|
+
}, { signal: n.signal }), () => n.abort();
|
|
235
273
|
}, [N]), r(() => {
|
|
236
|
-
let e =
|
|
237
|
-
if (!
|
|
238
|
-
let
|
|
274
|
+
let e = t();
|
|
275
|
+
if (!y || !e) return;
|
|
276
|
+
let n = new AbortController();
|
|
239
277
|
return e.addEventListener("keydown", (t) => {
|
|
240
|
-
!
|
|
241
|
-
}, { signal:
|
|
242
|
-
}, [
|
|
278
|
+
!w(t, y) || !A.current || (t.preventDefault(), j.current = e.activeElement, A.current.focus());
|
|
279
|
+
}, { signal: n.signal }), () => n.abort();
|
|
280
|
+
}, [y]);
|
|
243
281
|
let P = (e) => !!e && !!A.current?.contains(e), F = () => {
|
|
244
282
|
M.current.hovered = !0, N();
|
|
245
283
|
}, I = (e) => {
|
|
@@ -251,16 +289,16 @@ function C(o) {
|
|
|
251
289
|
}, z = (e) => {
|
|
252
290
|
if (e.key !== "Escape") return;
|
|
253
291
|
let t = (e.target.closest?.("[data-toast-id]"))?.getAttribute("data-toast-id");
|
|
254
|
-
t &&
|
|
255
|
-
}, B =
|
|
292
|
+
t && x.dismiss(t, "close"), x.getSnapshot().toasts.some((e) => e.open) ? A.current?.focus() : j.current?.focus();
|
|
293
|
+
}, B = o.startsWith("top"), V = D.toasts.filter((e) => e.visible), H = B ? [...V].reverse() : V, U = D.overflow > 0 && /* @__PURE__ */ d(a, {
|
|
256
294
|
component: "toaster.overflow",
|
|
257
|
-
children:
|
|
258
|
-
}), W = /* @__PURE__ */
|
|
295
|
+
children: v(D.overflow)
|
|
296
|
+
}), W = /* @__PURE__ */ f(a, {
|
|
259
297
|
tag: "section",
|
|
260
298
|
ref: A,
|
|
261
299
|
component: "toaster",
|
|
262
300
|
...E,
|
|
263
|
-
variant: [E.variant, { [
|
|
301
|
+
variant: [E.variant, { [C[o]]: !0 }],
|
|
264
302
|
props: {
|
|
265
303
|
...O ? { popover: "manual" } : {},
|
|
266
304
|
"aria-live": "polite",
|
|
@@ -268,7 +306,7 @@ function C(o) {
|
|
|
268
306
|
"aria-relevant": "additions text",
|
|
269
307
|
"aria-label": g,
|
|
270
308
|
tabIndex: -1,
|
|
271
|
-
...
|
|
309
|
+
...S,
|
|
272
310
|
onPointerOver: F,
|
|
273
311
|
onPointerOut: I,
|
|
274
312
|
onFocus: L,
|
|
@@ -277,18 +315,18 @@ function C(o) {
|
|
|
277
315
|
},
|
|
278
316
|
children: [
|
|
279
317
|
!B && U,
|
|
280
|
-
H.map((e) => /* @__PURE__ */
|
|
318
|
+
H.map((e) => /* @__PURE__ */ d(T, {
|
|
281
319
|
toast: e,
|
|
282
|
-
store:
|
|
320
|
+
store: x,
|
|
283
321
|
fromTop: B,
|
|
284
|
-
closeLabel:
|
|
322
|
+
closeLabel: _
|
|
285
323
|
}, e.id)),
|
|
286
324
|
B && U
|
|
287
325
|
]
|
|
288
326
|
});
|
|
289
|
-
return O ? W : k ?
|
|
327
|
+
return O ? W : k ? p(W, k) : null;
|
|
290
328
|
}
|
|
291
|
-
var
|
|
292
|
-
|
|
329
|
+
var D = E;
|
|
330
|
+
D.displayName = "Toaster";
|
|
293
331
|
//#endregion
|
|
294
|
-
export {
|
|
332
|
+
export { y as createToastStore, D as default, b as defaultToastStore, S as toast };
|
package/dataGridDateParts.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./box.cjs"),t=require("./dates.cjs"),n=require("./date-math.cjs"),r=require("./date-input.cjs"),i=require("./date-environment.cjs"),
|
|
1
|
+
const e=require("./box.cjs"),t=require("./dates.cjs"),n=require("./date-math.cjs"),r=require("./date-input.cjs"),i=require("./reporting.cjs"),a=require("./date-environment.cjs"),o=require("./components/flex.cjs"),s=require("./components/dropdown.cjs"),c=require("./components/dateField.cjs"),l=require("./components/datePicker.cjs"),u=require("./dataGridListLayout.cjs");let d=require("react"),f=require("react/jsx-runtime");var p={date:{dateStyle:`medium`},time:{timeStyle:`short`},datetime:{dateStyle:`medium`,timeStyle:`short`}};function m(e){return e instanceof Date||typeof e==`string`||typeof e==`number`?e:null}function h(e){let{value:n,format:r}=e,{locale:i,zone:o}=a.n();if(r===`relative`)return(0,f.jsx)(f.Fragment,{children:t.r(m(n),{locale:i,zone:o})});let s=typeof r==`string`?p[r]:r;return(0,f.jsx)(f.Fragment,{children:t.t(m(n),{...s,locale:i,zone:s.zone??o})})}function g(e,t){return t===null?null:e instanceof Date?n.w(t):typeof e==`string`&&/z$/i.test(e)?n.j(t):t}function _(e){let{cell:t,label:r,errorId:a,onBlur:o}=e,{type:s,zone:l,min:u,max:d}=t.editor,p=t.draft instanceof Date||typeof t.draft==`string`?n.v(t.draft):null;return(0,f.jsx)(i.t,{children:(0,f.jsx)(c.default,{type:s,value:p,zone:l,min:typeof u==`string`?u:void 0,max:typeof d==`string`?d:void 0,onValueChange:e=>t.setDraft(s===`datetime`?g(t.value,e):e),width:`fit`,variant:`compact`,b:0,bgColor:`transparent`,focus:{outline:0},invalid:a?!0:void 0,describedBy:a,autoFocus:!0,props:{"aria-label":r,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o()}}})})}function v(e){let t=e.currentFilter?.type===`date`?e.currentFilter:void 0,[n,r]=(0,d.useState)(t?.operator??`on`),[i,a]=(0,d.useState)(t?.valueTo??null),o=t?.value??null;return{operator:n,value:o,valueTo:i,setOperator:t=>{r(t),e.setDateFilter(t,o,i)},setValue:t=>e.setDateFilter(n,t,i),setValueTo:t=>{a(t),e.setDateFilter(n,o,t)},clear:()=>{a(null),e.clearFilter()}}}var y=[{value:`on`,label:`=`},{value:`before`,label:`<`},{value:`after`,label:`>`},{value:`between`,label:`↔`}];function b(e,t){let n=e.filterConfig,r=typeof n?.min==`string`?n.min:void 0,i=typeof n?.max==`string`?n.max:void 0;return{from:{min:r,max:t.operator===`between`&&t.valueTo||i},to:{min:t.value??r,max:i}}}function x(e){let{column:t}=e,n=String(t.header??t.key),r=t.grid.localeText,a=v(t),c=b(t,a),u=(e,t,a,o,s=!1)=>(0,f.jsx)(i.t,{children:(0,f.jsx)(l.default,{value:e,onValueChange:a,min:o.min,max:o.max,clearable:s,clearLabel:r.clearFilter(n),variant:`compact`,width:`fit`,minWidth:0,b:0,bgColor:`transparent`,focus:{outline:0},tabIndex:-1,props:{"aria-label":t}})});return(0,f.jsxs)(o.default,{component:`${t.grid.componentName}.filter.cell.input`,ai:a.operator===`between`?`start`:`center`,gap:1,children:[(0,f.jsx)(i.t,{children:(0,f.jsx)(s.default,{value:a.operator,variant:`compact`,onChange:e=>e&&a.setOperator(e),minWidth:6,hideIcon:!0,b:0,bgColor:`transparent`,focus:{outline:0},props:{tabIndex:-1,"aria-label":r.filterComparison(n)},children:y.map(e=>(0,f.jsx)(s.default.Item,{value:e.value,children:e.label},e.value))})}),(0,f.jsxs)(o.default,{d:`column`,gap:1,flex1:!0,minWidth:0,children:[u(a.value,a.operator===`between`?r.filterFrom(n):r.filterColumn(n),(e,t)=>t.reason===`clear`?a.clear():a.setValue(e),c.from,!0),a.operator===`between`&&u(a.valueTo,r.filterTo(n),a.setValueTo,c.to)]})]})}function S(t){let{column:n}=t,r=n.grid.componentName,a=n.grid.localeText,s=String(n.header??n.key),c=v(n),d=b(n,c);return(0,f.jsxs)(o.default,{gap:2,ai:`center`,flexWrap:`wrap`,children:[(0,f.jsx)(e.default,{tag:`select`,component:`${r}.list.sheet.input`,...u.t.INPUT,width:18,flexShrink:0,props:{value:c.operator,"aria-label":a.filterComparison(s),onChange:e=>c.setOperator(e.target.value)},children:y.map(e=>(0,f.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,f.jsx)(i.t,{children:(0,f.jsx)(l.default,{value:c.value,onValueChange:c.setValue,min:d.from.min,max:d.from.max,flex1:!0,props:{"aria-label":c.operator===`between`?a.filterFrom(s):a.filterColumn(s)}})}),c.operator===`between`&&(0,f.jsx)(i.t,{children:(0,f.jsx)(l.default,{value:c.valueTo,onValueChange:c.setValueTo,min:d.to.min,max:d.to.max,flex1:!0,props:{"aria-label":a.filterTo(s)}})})]})}function C(e,t){let n=e.type===`datetime`?e.zone===`none`?`datetime`:`instant`:e.type;return r.m(t,{kind:n,zone:e.zone===`none`?void 0:e.zone})}function w(e,n){return n===void 0?t.t(e):t.n(e,n)}var T={DateValue:h,DateEditor:_,DateFilter:x,ListDateFilter:S,parsePasted:C,describeDay:w};exports.default=T;
|