@bfrs/agentic-components 0.8.3 → 0.8.4
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.
|
@@ -1,47 +1,51 @@
|
|
|
1
|
-
import { jsxs as c, jsx as t, Fragment as
|
|
2
|
-
import { Root as
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as Ae } from "react/jsx-runtime";
|
|
2
|
+
import { Root as Ie, Portal as De, Overlay as It, Content as Dt, Title as Vt, Description as Wt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
3
3
|
import { Root as Bt, Trigger as Ot, Portal as Ht, Content as Lt } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
|
|
4
4
|
import { BookmarkSimple as Et } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
|
|
5
5
|
import { CaretDown as Pt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
|
|
6
|
-
import { DotsThreeVertical as
|
|
6
|
+
import { DotsThreeVertical as Ve } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
|
|
7
7
|
import { Info as Ft } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
|
|
8
8
|
import { PencilSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
|
|
9
|
-
import { Star as
|
|
9
|
+
import { Star as K } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
|
|
10
10
|
import { Trash as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
|
|
11
|
-
import { useRef as A, useMemo as le, useState as p, useId as $t, useEffect as
|
|
11
|
+
import { useRef as A, useMemo as le, useState as p, useId as $t, useEffect as N, useCallback as $ } from "react";
|
|
12
12
|
import i from "@emotion/styled";
|
|
13
|
-
import { IconButton as
|
|
14
|
-
import { twRing as
|
|
13
|
+
import { IconButton as We, Button as M } from "../../primitives/Button/Button.js";
|
|
14
|
+
import { twRing as de, twTransform as Ke, kfContentIn as Kt, kfOverlayIn as Mt, kfModalContentIn as qt } from "../../../lib/emotionTw.js";
|
|
15
15
|
import { floatingCollisionPadding as Yt } from "../../ui/overlays/overlayPositioning.js";
|
|
16
|
-
import { createTableViewSelectorStore as Gt, isReservedViewName as
|
|
16
|
+
import { createTableViewSelectorStore as Gt, isReservedViewName as Be } from "./viewStore.js";
|
|
17
17
|
import { BfrsPortalScope as ce } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
|
|
18
18
|
import { Tooltip as Jt } from "../../ui/overlays/Tooltip/Tooltip.js";
|
|
19
|
-
import { ActionMenu as
|
|
19
|
+
import { ActionMenu as Oe } from "../../navigation/ActionMenu/ActionMenu.js";
|
|
20
20
|
const D = {
|
|
21
21
|
"--tw-text-opacity": "1",
|
|
22
22
|
color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
|
|
23
23
|
}, V = {
|
|
24
24
|
"--tw-text-opacity": "1",
|
|
25
25
|
color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
|
|
26
|
-
},
|
|
26
|
+
}, ue = {
|
|
27
27
|
"--tw-bg-opacity": "1",
|
|
28
28
|
backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
|
|
29
|
-
},
|
|
29
|
+
}, Me = {
|
|
30
30
|
"--tw-bg-opacity": "1",
|
|
31
31
|
backgroundColor: "hsl(var(--bfrs-color-primary-soft) / var(--tw-bg-opacity, 1))"
|
|
32
32
|
}, Qt = {
|
|
33
|
-
|
|
33
|
+
"--tw-bg-opacity": "1",
|
|
34
|
+
backgroundColor: "hsl(var(--bfrs-color-surface-muted) / var(--tw-bg-opacity, 1))"
|
|
34
35
|
}, Xt = {
|
|
36
|
+
"--tw-bg-opacity": "1",
|
|
37
|
+
backgroundColor: "hsl(var(--bfrs-color-primary-border) / var(--tw-bg-opacity, 1))"
|
|
38
|
+
}, Zt = {
|
|
35
39
|
backgroundColor: "#F6F9F6"
|
|
36
|
-
},
|
|
40
|
+
}, me = {
|
|
37
41
|
"--tw-border-opacity": "1",
|
|
38
42
|
borderColor: "hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))"
|
|
39
|
-
},
|
|
43
|
+
}, Ut = /* @__PURE__ */ i("div", {
|
|
40
44
|
label: "AgenticTableViewSelector-root"
|
|
41
45
|
})({
|
|
42
46
|
display: "inline-flex",
|
|
43
47
|
minWidth: "0px"
|
|
44
|
-
}),
|
|
48
|
+
}), er = /* @__PURE__ */ i("button", {
|
|
45
49
|
label: "AgenticTableViewSelector-trigger",
|
|
46
50
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
47
51
|
})(({ ownerState: o }) => [
|
|
@@ -54,7 +58,7 @@ const D = {
|
|
|
54
58
|
gap: ".5rem",
|
|
55
59
|
borderRadius: "7px",
|
|
56
60
|
borderWidth: "1px",
|
|
57
|
-
...
|
|
61
|
+
...Zt,
|
|
58
62
|
paddingLeft: ".75rem",
|
|
59
63
|
paddingRight: ".75rem",
|
|
60
64
|
fontSize: "12px",
|
|
@@ -66,8 +70,8 @@ const D = {
|
|
|
66
70
|
transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
|
|
67
71
|
transitionTimingFunction: "cubic-bezier(0,0,.2,1)",
|
|
68
72
|
transitionDuration: ".15s",
|
|
69
|
-
"&:hover":
|
|
70
|
-
"&:focus-visible":
|
|
73
|
+
"&:hover": Me,
|
|
74
|
+
"&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
|
|
71
75
|
"&:disabled": {
|
|
72
76
|
pointerEvents: "none",
|
|
73
77
|
opacity: ".55"
|
|
@@ -84,11 +88,11 @@ const D = {
|
|
|
84
88
|
o.open || o.filled || o.defaultSelected ? {
|
|
85
89
|
"--tw-border-opacity": "1",
|
|
86
90
|
borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))"
|
|
87
|
-
} :
|
|
91
|
+
} : me,
|
|
88
92
|
// Default is a selected, built-in view. It must use the same primary text
|
|
89
93
|
// colour as a selected saved view; only a genuinely empty trigger is muted.
|
|
90
94
|
o.empty && !o.defaultSelected && V
|
|
91
|
-
]),
|
|
95
|
+
]), tr = /* @__PURE__ */ i("span", {
|
|
92
96
|
label: "AgenticTableViewSelector-triggerLabel"
|
|
93
97
|
})({
|
|
94
98
|
minWidth: "0px",
|
|
@@ -96,13 +100,13 @@ const D = {
|
|
|
96
100
|
overflow: "hidden",
|
|
97
101
|
textOverflow: "ellipsis",
|
|
98
102
|
whiteSpace: "nowrap"
|
|
99
|
-
}), se = /* @__PURE__ */ i(
|
|
103
|
+
}), se = /* @__PURE__ */ i(K, {
|
|
100
104
|
label: "AgenticTableViewSelector-primaryStar"
|
|
101
105
|
})({
|
|
102
106
|
flexShrink: 0,
|
|
103
107
|
"--tw-text-opacity": "1",
|
|
104
108
|
color: "hsl(var(--bfrs-color-warning) / var(--tw-text-opacity, 1))"
|
|
105
|
-
}),
|
|
109
|
+
}), rr = /* @__PURE__ */ i(Pt, {
|
|
106
110
|
label: "AgenticTableViewSelector-caret",
|
|
107
111
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
108
112
|
})(({ ownerState: o }) => [
|
|
@@ -113,8 +117,8 @@ const D = {
|
|
|
113
117
|
transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
|
|
114
118
|
transitionDuration: ".15s"
|
|
115
119
|
},
|
|
116
|
-
o.open &&
|
|
117
|
-
]),
|
|
120
|
+
o.open && Ke({ "--tw-rotate": "180deg" })
|
|
121
|
+
]), or = /* @__PURE__ */ i(Lt, {
|
|
118
122
|
label: "AgenticTableViewSelector-content"
|
|
119
123
|
})({
|
|
120
124
|
zIndex: 1e3,
|
|
@@ -122,8 +126,8 @@ const D = {
|
|
|
122
126
|
overflow: "hidden",
|
|
123
127
|
borderRadius: "var(--bfrs-radius-lg)",
|
|
124
128
|
borderWidth: "1px",
|
|
125
|
-
...fe,
|
|
126
129
|
...me,
|
|
130
|
+
...ue,
|
|
127
131
|
"--tw-shadow": "var(--bfrs-shadow-elevated)",
|
|
128
132
|
"--tw-shadow-colored": "var(--bfrs-shadow-elevated)",
|
|
129
133
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
|
|
@@ -131,7 +135,7 @@ const D = {
|
|
|
131
135
|
outlineOffset: "2px",
|
|
132
136
|
...Kt,
|
|
133
137
|
animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
|
|
134
|
-
}),
|
|
138
|
+
}), ir = /* @__PURE__ */ i("div", {
|
|
135
139
|
label: "AgenticTableViewSelector-header"
|
|
136
140
|
})({
|
|
137
141
|
display: "flex",
|
|
@@ -147,7 +151,7 @@ const D = {
|
|
|
147
151
|
letterSpacing: ".08em",
|
|
148
152
|
textTransform: "uppercase",
|
|
149
153
|
...V
|
|
150
|
-
}),
|
|
154
|
+
}), nr = /* @__PURE__ */ i("span", {
|
|
151
155
|
label: "AgenticTableViewSelector-headerInfo"
|
|
152
156
|
})({
|
|
153
157
|
display: "inline-flex",
|
|
@@ -166,7 +170,7 @@ const D = {
|
|
|
166
170
|
"--tw-text-opacity": "1",
|
|
167
171
|
color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
|
|
168
172
|
}
|
|
169
|
-
}),
|
|
173
|
+
}), ar = /* @__PURE__ */ i("div", {
|
|
170
174
|
label: "AgenticTableViewSelector-list"
|
|
171
175
|
})({
|
|
172
176
|
display: "flex",
|
|
@@ -183,17 +187,16 @@ const D = {
|
|
|
183
187
|
gap: ".375rem",
|
|
184
188
|
paddingLeft: ".5rem",
|
|
185
189
|
paddingRight: ".625rem"
|
|
186
|
-
}),
|
|
190
|
+
}), lr = /* @__PURE__ */ i(qe, {
|
|
187
191
|
label: "AgenticTableViewSelector-defaultRow"
|
|
188
192
|
})({
|
|
189
193
|
marginLeft: ".5rem",
|
|
190
194
|
marginRight: ".5rem",
|
|
191
195
|
marginBottom: ".25rem",
|
|
192
196
|
borderRadius: "var(--bfrs-radius-sm)",
|
|
193
|
-
backgroundColor: "hsl(var(--bfrs-color-primary-soft) / .55)",
|
|
194
197
|
paddingLeft: ".125rem",
|
|
195
198
|
paddingRight: ".125rem"
|
|
196
|
-
}),
|
|
199
|
+
}), cr = /* @__PURE__ */ i("div", {
|
|
197
200
|
label: "AgenticTableViewSelector-defaultDivider"
|
|
198
201
|
})({
|
|
199
202
|
height: "1px",
|
|
@@ -203,7 +206,7 @@ const D = {
|
|
|
203
206
|
marginBottom: ".25rem",
|
|
204
207
|
"--tw-bg-opacity": "1",
|
|
205
208
|
backgroundColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-bg-opacity, 1))"
|
|
206
|
-
}),
|
|
209
|
+
}), He = /* @__PURE__ */ i("button", {
|
|
207
210
|
label: "AgenticTableViewSelector-viewButton",
|
|
208
211
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
209
212
|
})(({ ownerState: o }) => [
|
|
@@ -226,15 +229,15 @@ const D = {
|
|
|
226
229
|
...D,
|
|
227
230
|
outline: "2px solid transparent",
|
|
228
231
|
outlineOffset: "2px",
|
|
229
|
-
"&:
|
|
230
|
-
"&:focus-visible": ue("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
|
|
232
|
+
"&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
|
|
231
233
|
},
|
|
234
|
+
!o.neutral && { "&:hover": Me },
|
|
232
235
|
o.selected && {
|
|
233
|
-
...
|
|
236
|
+
...Qt,
|
|
234
237
|
fontWeight: 700,
|
|
235
|
-
"&:hover":
|
|
238
|
+
"&:hover": Xt
|
|
236
239
|
}
|
|
237
|
-
]),
|
|
240
|
+
]), Le = /* @__PURE__ */ i("span", {
|
|
238
241
|
label: "AgenticTableViewSelector-name"
|
|
239
242
|
})({
|
|
240
243
|
minWidth: "0px",
|
|
@@ -242,7 +245,7 @@ const D = {
|
|
|
242
245
|
overflow: "hidden",
|
|
243
246
|
textOverflow: "ellipsis",
|
|
244
247
|
whiteSpace: "nowrap"
|
|
245
|
-
}),
|
|
248
|
+
}), Ee = /* @__PURE__ */ i("div", {
|
|
246
249
|
label: "AgenticTableViewSelector-empty"
|
|
247
250
|
})({
|
|
248
251
|
paddingLeft: ".75rem",
|
|
@@ -252,7 +255,7 @@ const D = {
|
|
|
252
255
|
fontSize: ".75rem",
|
|
253
256
|
lineHeight: "1rem",
|
|
254
257
|
...V
|
|
255
|
-
}),
|
|
258
|
+
}), Pe = /* @__PURE__ */ i(It, {
|
|
256
259
|
label: "AgenticTableViewSelector-renameOverlay"
|
|
257
260
|
})({
|
|
258
261
|
position: "fixed",
|
|
@@ -261,7 +264,7 @@ const D = {
|
|
|
261
264
|
backgroundColor: "hsl(var(--bfrs-color-text-primary) / .45)",
|
|
262
265
|
...Mt,
|
|
263
266
|
animation: "bfrs-bfrs-overlay-in var(--bfrs-motion-fast) var(--bfrs-ease-out)"
|
|
264
|
-
}),
|
|
267
|
+
}), Fe = /* @__PURE__ */ i(Dt, {
|
|
265
268
|
label: "AgenticTableViewSelector-renameContent"
|
|
266
269
|
})({
|
|
267
270
|
position: "fixed",
|
|
@@ -274,8 +277,8 @@ const D = {
|
|
|
274
277
|
overflow: "auto",
|
|
275
278
|
borderRadius: "var(--bfrs-radius-lg)",
|
|
276
279
|
borderWidth: "1px",
|
|
277
|
-
...fe,
|
|
278
280
|
...me,
|
|
281
|
+
...ue,
|
|
279
282
|
padding: "1.25rem",
|
|
280
283
|
...D,
|
|
281
284
|
"--tw-shadow": "var(--bfrs-shadow-overlay)",
|
|
@@ -283,24 +286,24 @@ const D = {
|
|
|
283
286
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
|
|
284
287
|
outline: "2px solid transparent",
|
|
285
288
|
outlineOffset: "2px",
|
|
286
|
-
...
|
|
289
|
+
...Ke({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
|
|
287
290
|
...qt,
|
|
288
291
|
animation: "bfrs-bfrs-modal-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
|
|
289
|
-
}),
|
|
292
|
+
}), je = /* @__PURE__ */ i(Vt, {
|
|
290
293
|
label: "AgenticTableViewSelector-renameTitle"
|
|
291
294
|
})({
|
|
292
295
|
fontSize: "1.125rem",
|
|
293
296
|
lineHeight: "1.5rem",
|
|
294
297
|
fontWeight: 700,
|
|
295
298
|
...D
|
|
296
|
-
}),
|
|
299
|
+
}), Ne = /* @__PURE__ */ i(Wt, {
|
|
297
300
|
label: "AgenticTableViewSelector-renameDescription"
|
|
298
301
|
})({
|
|
299
302
|
marginTop: ".25rem",
|
|
300
303
|
fontSize: ".75rem",
|
|
301
304
|
lineHeight: "1.25rem",
|
|
302
305
|
...V
|
|
303
|
-
}),
|
|
306
|
+
}), sr = /* @__PURE__ */ i("label", {
|
|
304
307
|
label: "AgenticTableViewSelector-renameLabel"
|
|
305
308
|
})({
|
|
306
309
|
display: "block",
|
|
@@ -309,7 +312,7 @@ const D = {
|
|
|
309
312
|
lineHeight: "1rem",
|
|
310
313
|
fontWeight: 700,
|
|
311
314
|
...D
|
|
312
|
-
}),
|
|
315
|
+
}), dr = /* @__PURE__ */ i("input", {
|
|
313
316
|
label: "AgenticTableViewSelector-renameInput"
|
|
314
317
|
})({
|
|
315
318
|
marginTop: ".5rem",
|
|
@@ -319,7 +322,7 @@ const D = {
|
|
|
319
322
|
borderWidth: "1.5px",
|
|
320
323
|
"--tw-border-opacity": "1",
|
|
321
324
|
borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))",
|
|
322
|
-
...
|
|
325
|
+
...ue,
|
|
323
326
|
paddingLeft: ".75rem",
|
|
324
327
|
paddingRight: ".75rem",
|
|
325
328
|
fontSize: ".875rem",
|
|
@@ -328,15 +331,15 @@ const D = {
|
|
|
328
331
|
...D,
|
|
329
332
|
outline: "2px solid transparent",
|
|
330
333
|
outlineOffset: "2px",
|
|
331
|
-
"&:focus-visible":
|
|
332
|
-
}),
|
|
334
|
+
"&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
|
|
335
|
+
}), $e = /* @__PURE__ */ i("div", {
|
|
333
336
|
label: "AgenticTableViewSelector-renameFooter"
|
|
334
337
|
})({
|
|
335
338
|
marginTop: "1.5rem",
|
|
336
339
|
display: "flex",
|
|
337
340
|
justifyContent: "flex-end",
|
|
338
341
|
gap: ".625rem"
|
|
339
|
-
}),
|
|
342
|
+
}), ur = /* @__PURE__ */ i(M, {
|
|
340
343
|
label: "AgenticTableViewSelector-renameSubmitButton"
|
|
341
344
|
})({
|
|
342
345
|
"&&:disabled": {
|
|
@@ -347,7 +350,7 @@ const D = {
|
|
|
347
350
|
"--tw-text-opacity": "1",
|
|
348
351
|
color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
|
|
349
352
|
}
|
|
350
|
-
}),
|
|
353
|
+
}), mr = /* @__PURE__ */ i("p", {
|
|
351
354
|
label: "AgenticTableViewSelector-renameFieldError"
|
|
352
355
|
})({
|
|
353
356
|
marginTop: ".375rem",
|
|
@@ -359,7 +362,7 @@ const D = {
|
|
|
359
362
|
function I(o, n) {
|
|
360
363
|
return n ? o.find((r) => r.view_id === n) ?? null : null;
|
|
361
364
|
}
|
|
362
|
-
function
|
|
365
|
+
function fr(o, n, r) {
|
|
363
366
|
var h;
|
|
364
367
|
const S = [], x = /* @__PURE__ */ new Set(), T = n ?? ((h = o.find((s) => s.is_default)) == null ? void 0 : h.view_id) ?? null, b = (s) => {
|
|
365
368
|
if (!s || x.has(s)) return;
|
|
@@ -371,14 +374,14 @@ function mr(o, n, r) {
|
|
|
371
374
|
x.has(s.view_id) || (S.push(s), x.add(s.view_id));
|
|
372
375
|
return S;
|
|
373
376
|
}
|
|
374
|
-
function
|
|
377
|
+
function pr(o) {
|
|
375
378
|
return o ? [
|
|
376
379
|
"api",
|
|
377
380
|
o.viewType && o.tab ? "scoped" : "local",
|
|
378
381
|
o.saveEndpoint || o.endpoint ? "remote-save" : "local-save"
|
|
379
382
|
].join(":") : "none";
|
|
380
383
|
}
|
|
381
|
-
function
|
|
384
|
+
function br(o) {
|
|
382
385
|
const n = () => o.current;
|
|
383
386
|
return {
|
|
384
387
|
get baseUrl() {
|
|
@@ -431,7 +434,7 @@ function pr(o) {
|
|
|
431
434
|
}
|
|
432
435
|
};
|
|
433
436
|
}
|
|
434
|
-
function
|
|
437
|
+
function Or({
|
|
435
438
|
screenName: o,
|
|
436
439
|
store: n,
|
|
437
440
|
saveApi: r,
|
|
@@ -442,23 +445,23 @@ function Br({
|
|
|
442
445
|
onViewSelect: h,
|
|
443
446
|
onPrimaryViewChange: s,
|
|
444
447
|
onUnsetPrimaryView: u,
|
|
445
|
-
onRenameView:
|
|
446
|
-
onDeleteView:
|
|
448
|
+
onRenameView: q,
|
|
449
|
+
onDeleteView: Y,
|
|
447
450
|
onResetSavedFilters: _,
|
|
448
451
|
onError: L,
|
|
449
452
|
triggerLabel: Ye,
|
|
450
453
|
placeholder: Ge = "Views",
|
|
451
454
|
viewsLabel: Je = "VIEWS",
|
|
452
|
-
primaryHintLabel:
|
|
455
|
+
primaryHintLabel: fe = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
|
|
453
456
|
emptyLabel: Qe = "No saved views",
|
|
454
457
|
loadingLabel: Xe = "Loading views",
|
|
455
|
-
defaultViewLabel:
|
|
456
|
-
setPrimaryLabel:
|
|
458
|
+
defaultViewLabel: pe = "Default",
|
|
459
|
+
setPrimaryLabel: be = "Set as Primary View",
|
|
457
460
|
unsetPrimaryLabel: Ze = "Unset as Primary",
|
|
458
461
|
renameLabel: Ue = "Rename",
|
|
459
462
|
deleteLabel: et = "Delete",
|
|
460
463
|
renameTitle: tt = "Rename view",
|
|
461
|
-
renameDescription:
|
|
464
|
+
renameDescription: he = "Update the saved view name.",
|
|
462
465
|
renameInputLabel: rt = "View name",
|
|
463
466
|
renameCancelLabel: ot = "Cancel",
|
|
464
467
|
renameSaveLabel: it = "Save",
|
|
@@ -471,70 +474,70 @@ function Br({
|
|
|
471
474
|
className: ut,
|
|
472
475
|
triggerClassName: mt,
|
|
473
476
|
contentClassName: ft,
|
|
474
|
-
actionMenuClassName:
|
|
477
|
+
actionMenuClassName: ge
|
|
475
478
|
}) {
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
() =>
|
|
480
|
-
[
|
|
479
|
+
const ve = A(r);
|
|
480
|
+
ve.current = r;
|
|
481
|
+
const we = pr(r), G = le(
|
|
482
|
+
() => we === "none" ? void 0 : br(ve),
|
|
483
|
+
[we]
|
|
481
484
|
), m = le(
|
|
482
|
-
() => n ?? Gt(o,
|
|
483
|
-
[o, n,
|
|
484
|
-
), E = S !== void 0, [
|
|
485
|
-
|
|
485
|
+
() => n ?? Gt(o, G ? { saveApi: G } : void 0),
|
|
486
|
+
[o, n, G]
|
|
487
|
+
), E = S !== void 0, [J, Q] = p(!1), [R, pt] = p([]), [W, bt] = p(null), [ht, ye] = p(x ?? null), [Se, xe] = p(!1), [P, Te] = p(null), [B, X] = p(""), [g, _e] = p(null), O = S ?? ht, H = A(O), F = A(E), Z = A(!1), v = A(!1), C = A(null), Re = $t();
|
|
488
|
+
N(() => {
|
|
486
489
|
H.current = O, O && (v.current = !1);
|
|
487
|
-
}, [O]),
|
|
490
|
+
}, [O]), N(() => {
|
|
488
491
|
F.current = E;
|
|
489
|
-
}, [E]),
|
|
490
|
-
C.current = null,
|
|
492
|
+
}, [E]), N(() => {
|
|
493
|
+
C.current = null, Z.current = !1, v.current = !1;
|
|
491
494
|
}, [m, o]);
|
|
492
|
-
const w =
|
|
495
|
+
const w = $(
|
|
493
496
|
(e) => {
|
|
494
497
|
L == null || L(e);
|
|
495
498
|
},
|
|
496
499
|
[L]
|
|
497
|
-
), f =
|
|
500
|
+
), f = $(
|
|
498
501
|
(e) => {
|
|
499
|
-
e && (v.current = !1), F.current ||
|
|
502
|
+
e && (v.current = !1), F.current || ye((e == null ? void 0 : e.view_id) ?? null), b == null || b((e == null ? void 0 : e.view_id) ?? null, e), e && (h == null || h(e));
|
|
500
503
|
},
|
|
501
504
|
[b, h]
|
|
502
|
-
),
|
|
505
|
+
), U = $(
|
|
503
506
|
(e) => {
|
|
504
507
|
f(e);
|
|
505
508
|
},
|
|
506
509
|
[f]
|
|
507
|
-
), y =
|
|
510
|
+
), y = $(
|
|
508
511
|
async (e) => {
|
|
509
|
-
var
|
|
512
|
+
var ke;
|
|
510
513
|
const a = e === void 0 ? "__default__" : e ?? "__none__";
|
|
511
|
-
if (((
|
|
514
|
+
if (((ke = C.current) == null ? void 0 : ke.key) === a) return C.current.promise;
|
|
512
515
|
const d = { key: a, promise: Promise.resolve(null) };
|
|
513
516
|
return C.current = d, d.promise = (async () => {
|
|
514
|
-
|
|
517
|
+
xe(!0);
|
|
515
518
|
try {
|
|
516
|
-
const k = await m.list(), z = k.find((At) => At.is_default) ?? null, kt = e !== void 0 ? e : H.current,
|
|
517
|
-
return pt(k), bt((z == null ? void 0 : z.view_id) ?? null), F.current ||
|
|
519
|
+
const k = await m.list(), z = k.find((At) => At.is_default) ?? null, kt = e !== void 0 ? e : H.current, ze = I(k, kt), zt = !v.current && (e !== void 0 || T || !F.current), ae = ze || !zt ? null : I(k, z == null ? void 0 : z.view_id), j = ze ?? ae ?? null;
|
|
520
|
+
return pt(k), bt((z == null ? void 0 : z.view_id) ?? null), F.current || ye((j == null ? void 0 : j.view_id) ?? null), T && ae && e === void 0 && !H.current && !Z.current && (Z.current = !0, U(ae)), j;
|
|
518
521
|
} catch (k) {
|
|
519
522
|
return w(k), null;
|
|
520
523
|
} finally {
|
|
521
|
-
|
|
524
|
+
xe(!1), C.current === d && (C.current = null);
|
|
522
525
|
}
|
|
523
526
|
})(), d.promise;
|
|
524
527
|
},
|
|
525
|
-
[
|
|
528
|
+
[U, w, m, T, f]
|
|
526
529
|
);
|
|
527
|
-
|
|
530
|
+
N(() => {
|
|
528
531
|
const e = () => {
|
|
529
532
|
y();
|
|
530
533
|
};
|
|
531
534
|
return e(), m.subscribe(e);
|
|
532
535
|
}, [y, m]);
|
|
533
536
|
const l = I(R, O) ?? (!v.current && (T || !E) ? I(R, W) : null), gt = le(
|
|
534
|
-
() =>
|
|
537
|
+
() => fr(R, W, l == null ? void 0 : l.view_id),
|
|
535
538
|
[W, l == null ? void 0 : l.view_id, R]
|
|
536
|
-
),
|
|
537
|
-
|
|
539
|
+
), ee = !l, te = W === null, vt = Ye ?? (l == null ? void 0 : l.name) ?? (ee ? pe : Ge), re = R.length > 0, wt = (e) => {
|
|
540
|
+
Q(!1), U(e);
|
|
538
541
|
}, yt = (e) => {
|
|
539
542
|
m.setPrimary(e.view_id).then(async (a) => {
|
|
540
543
|
const d = await y(e.view_id);
|
|
@@ -545,95 +548,95 @@ function Br({
|
|
|
545
548
|
const d = await y(e.view_id);
|
|
546
549
|
f(d ?? a), u == null || u(a);
|
|
547
550
|
}).catch(w);
|
|
548
|
-
}, oe = () =>
|
|
551
|
+
}, oe = () => _e(null), xt = (e) => {
|
|
549
552
|
const a = H.current === e.view_id;
|
|
550
553
|
m.remove(e.view_id).then(async () => {
|
|
551
554
|
const d = await y(a ? null : H.current);
|
|
552
|
-
a && f(d),
|
|
555
|
+
a && f(d), Y == null || Y(e.view_id);
|
|
553
556
|
}).catch(w).finally(oe);
|
|
554
557
|
}, Tt = () => {
|
|
555
558
|
g && xt(g);
|
|
556
|
-
},
|
|
557
|
-
v.current = !0, f(null), _ == null || _(),
|
|
559
|
+
}, Ce = () => {
|
|
560
|
+
v.current = !0, f(null), _ == null || _(), Q(!1);
|
|
558
561
|
}, _t = () => {
|
|
559
562
|
const e = I(R, W);
|
|
560
563
|
if (!e) {
|
|
561
|
-
|
|
564
|
+
Ce();
|
|
562
565
|
return;
|
|
563
566
|
}
|
|
564
567
|
m.unsetPrimary(e.view_id).then(async (a) => {
|
|
565
568
|
v.current = !0, await y(null), f(null), _ == null || _(), u == null || u(a);
|
|
566
569
|
}).catch(w);
|
|
567
570
|
}, Rt = (e) => {
|
|
568
|
-
|
|
571
|
+
Te(e), X(e.name);
|
|
569
572
|
}, ie = () => {
|
|
570
|
-
|
|
573
|
+
Te(null), X("");
|
|
571
574
|
}, Ct = (e) => {
|
|
572
575
|
e.preventDefault();
|
|
573
576
|
const a = B.trim();
|
|
574
|
-
!P || !a ||
|
|
575
|
-
await y(P.view_id),
|
|
577
|
+
!P || !a || Be(a) || m.rename(P.view_id, a).then(async (d) => {
|
|
578
|
+
await y(P.view_id), q == null || q(d), ie();
|
|
576
579
|
}).catch(w);
|
|
577
|
-
}, ne =
|
|
578
|
-
return re ? /* @__PURE__ */ c(
|
|
579
|
-
/* @__PURE__ */ c(Bt, { open:
|
|
580
|
+
}, ne = Be(B);
|
|
581
|
+
return re ? /* @__PURE__ */ c(Ut, { className: ut, children: [
|
|
582
|
+
/* @__PURE__ */ c(Bt, { open: J, onOpenChange: Q, children: [
|
|
580
583
|
/* @__PURE__ */ t(Ot, { asChild: !0, children: /* @__PURE__ */ c(
|
|
581
|
-
|
|
584
|
+
er,
|
|
582
585
|
{
|
|
583
586
|
type: "button",
|
|
584
587
|
"aria-label": "Saved views",
|
|
585
588
|
className: mt,
|
|
586
589
|
disabled: dt,
|
|
587
590
|
"data-filled": l ? "" : void 0,
|
|
588
|
-
ownerState: { open:
|
|
591
|
+
ownerState: { open: J, empty: !l, filled: !!l, defaultSelected: ee, size: st },
|
|
589
592
|
children: [
|
|
590
593
|
/* @__PURE__ */ t(Et, { size: 13 }),
|
|
591
|
-
/* @__PURE__ */ t(
|
|
592
|
-
l != null && l.is_default ||
|
|
593
|
-
/* @__PURE__ */ t(
|
|
594
|
+
/* @__PURE__ */ t(tr, { children: vt }),
|
|
595
|
+
l != null && l.is_default || ee && te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
|
|
596
|
+
/* @__PURE__ */ t(rr, { size: 13, ownerState: { open: J } })
|
|
594
597
|
]
|
|
595
598
|
}
|
|
596
599
|
) }),
|
|
597
600
|
/* @__PURE__ */ t(Ht, { children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ c(
|
|
598
|
-
|
|
601
|
+
or,
|
|
599
602
|
{
|
|
600
603
|
align: "start",
|
|
601
604
|
sideOffset: 8,
|
|
602
605
|
collisionPadding: Yt,
|
|
603
606
|
className: ft,
|
|
604
607
|
children: [
|
|
605
|
-
/* @__PURE__ */ c(
|
|
608
|
+
/* @__PURE__ */ c(ir, { children: [
|
|
606
609
|
Je,
|
|
607
|
-
|
|
610
|
+
fe ? /* @__PURE__ */ t(Jt, { content: fe, side: "right", variant: "white", children: /* @__PURE__ */ t(nr, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Ft, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
|
|
608
611
|
] }),
|
|
609
|
-
/* @__PURE__ */ c(
|
|
610
|
-
|
|
611
|
-
!
|
|
612
|
-
/* @__PURE__ */ c(
|
|
613
|
-
/* @__PURE__ */ c(
|
|
614
|
-
/* @__PURE__ */ t(
|
|
612
|
+
/* @__PURE__ */ c(ar, { children: [
|
|
613
|
+
Se && !re ? /* @__PURE__ */ t(Ee, { children: Xe }) : null,
|
|
614
|
+
!Se && !re ? /* @__PURE__ */ t(Ee, { children: Qe }) : null,
|
|
615
|
+
/* @__PURE__ */ c(lr, { "data-default-view-surface": !0, children: [
|
|
616
|
+
/* @__PURE__ */ c(He, { type: "button", ownerState: { selected: !1, neutral: !0 }, onClick: Ce, children: [
|
|
617
|
+
/* @__PURE__ */ t(Le, { children: pe }),
|
|
615
618
|
te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
|
|
616
619
|
] }),
|
|
617
620
|
/* @__PURE__ */ t(
|
|
618
|
-
|
|
621
|
+
Oe,
|
|
619
622
|
{
|
|
620
623
|
align: "start",
|
|
621
624
|
side: "right",
|
|
622
625
|
size: "sm",
|
|
623
|
-
className:
|
|
626
|
+
className: ge,
|
|
624
627
|
trigger: /* @__PURE__ */ t(
|
|
625
|
-
|
|
628
|
+
We,
|
|
626
629
|
{
|
|
627
630
|
variant: "secondary",
|
|
628
631
|
size: "sm",
|
|
629
|
-
icon: /* @__PURE__ */ t(
|
|
632
|
+
icon: /* @__PURE__ */ t(Ve, { size: 14, weight: "bold" }),
|
|
630
633
|
"aria-label": "View actions for Default"
|
|
631
634
|
}
|
|
632
635
|
),
|
|
633
636
|
items: [
|
|
634
637
|
{
|
|
635
|
-
label:
|
|
636
|
-
icon: /* @__PURE__ */ t(
|
|
638
|
+
label: be,
|
|
639
|
+
icon: /* @__PURE__ */ t(K, { size: 16 }),
|
|
637
640
|
disabled: te,
|
|
638
641
|
onSelect: _t
|
|
639
642
|
}
|
|
@@ -641,27 +644,27 @@ function Br({
|
|
|
641
644
|
}
|
|
642
645
|
)
|
|
643
646
|
] }),
|
|
644
|
-
/* @__PURE__ */ t(
|
|
647
|
+
/* @__PURE__ */ t(cr, { role: "separator", "data-default-view-divider": !0 }),
|
|
645
648
|
gt.map((e) => {
|
|
646
649
|
const a = (l == null ? void 0 : l.view_id) === e.view_id;
|
|
647
650
|
return /* @__PURE__ */ c(qe, { children: [
|
|
648
|
-
/* @__PURE__ */ c(
|
|
649
|
-
/* @__PURE__ */ t(
|
|
651
|
+
/* @__PURE__ */ c(He, { type: "button", ownerState: { selected: a }, onClick: () => wt(e), children: [
|
|
652
|
+
/* @__PURE__ */ t(Le, { children: e.name }),
|
|
650
653
|
e.is_default ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
|
|
651
654
|
] }),
|
|
652
655
|
/* @__PURE__ */ t(
|
|
653
|
-
|
|
656
|
+
Oe,
|
|
654
657
|
{
|
|
655
658
|
align: "start",
|
|
656
659
|
side: "right",
|
|
657
660
|
size: "sm",
|
|
658
|
-
className:
|
|
661
|
+
className: ge,
|
|
659
662
|
trigger: /* @__PURE__ */ t(
|
|
660
|
-
|
|
663
|
+
We,
|
|
661
664
|
{
|
|
662
665
|
variant: "secondary",
|
|
663
666
|
size: "sm",
|
|
664
|
-
icon: /* @__PURE__ */ t(
|
|
667
|
+
icon: /* @__PURE__ */ t(Ve, { size: 14, weight: "bold" }),
|
|
665
668
|
"aria-label": `View actions for ${e.name}`
|
|
666
669
|
}
|
|
667
670
|
),
|
|
@@ -669,11 +672,11 @@ function Br({
|
|
|
669
672
|
...e.is_system_defined ? [] : [
|
|
670
673
|
e.is_default ? {
|
|
671
674
|
label: Ze,
|
|
672
|
-
icon: /* @__PURE__ */ t(
|
|
675
|
+
icon: /* @__PURE__ */ t(K, { size: 16 }),
|
|
673
676
|
onSelect: () => St(e)
|
|
674
677
|
} : {
|
|
675
|
-
label:
|
|
676
|
-
icon: /* @__PURE__ */ t(
|
|
678
|
+
label: be,
|
|
679
|
+
icon: /* @__PURE__ */ t(K, { size: 16 }),
|
|
677
680
|
onSelect: () => yt(e)
|
|
678
681
|
}
|
|
679
682
|
],
|
|
@@ -686,7 +689,7 @@ function Br({
|
|
|
686
689
|
label: et,
|
|
687
690
|
icon: /* @__PURE__ */ t(Nt, { size: 16 }),
|
|
688
691
|
destructive: !0,
|
|
689
|
-
onSelect: () =>
|
|
692
|
+
onSelect: () => _e(e)
|
|
690
693
|
}
|
|
691
694
|
]
|
|
692
695
|
}
|
|
@@ -698,59 +701,59 @@ function Br({
|
|
|
698
701
|
}
|
|
699
702
|
) }) })
|
|
700
703
|
] }),
|
|
701
|
-
/* @__PURE__ */ t(
|
|
704
|
+
/* @__PURE__ */ t(Ie, { open: !!P, onOpenChange: (e) => {
|
|
702
705
|
e || ie();
|
|
703
|
-
}, children: /* @__PURE__ */ t(
|
|
704
|
-
/* @__PURE__ */ t(
|
|
705
|
-
/* @__PURE__ */ t(
|
|
706
|
-
/* @__PURE__ */ t(
|
|
707
|
-
|
|
708
|
-
/* @__PURE__ */ t(
|
|
706
|
+
}, children: /* @__PURE__ */ t(De, { children: /* @__PURE__ */ c(ce, { children: [
|
|
707
|
+
/* @__PURE__ */ t(Pe, {}),
|
|
708
|
+
/* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ c("form", { onSubmit: Ct, children: [
|
|
709
|
+
/* @__PURE__ */ t(je, { children: tt }),
|
|
710
|
+
he ? /* @__PURE__ */ t(Ne, { children: he }) : null,
|
|
711
|
+
/* @__PURE__ */ t(sr, { htmlFor: Re, children: rt }),
|
|
709
712
|
/* @__PURE__ */ t(
|
|
710
|
-
|
|
713
|
+
dr,
|
|
711
714
|
{
|
|
712
|
-
id:
|
|
715
|
+
id: Re,
|
|
713
716
|
autoFocus: !0,
|
|
714
717
|
value: B,
|
|
715
|
-
onChange: (e) =>
|
|
718
|
+
onChange: (e) => X(e.currentTarget.value),
|
|
716
719
|
"aria-invalid": ne
|
|
717
720
|
}
|
|
718
721
|
),
|
|
719
|
-
ne ? /* @__PURE__ */ c(
|
|
722
|
+
ne ? /* @__PURE__ */ c(mr, { children: [
|
|
720
723
|
"“",
|
|
721
724
|
B.trim(),
|
|
722
725
|
"” is reserved. Choose a different name."
|
|
723
726
|
] }) : null,
|
|
724
|
-
/* @__PURE__ */ c(
|
|
725
|
-
/* @__PURE__ */ t(
|
|
726
|
-
/* @__PURE__ */ t(
|
|
727
|
+
/* @__PURE__ */ c($e, { children: [
|
|
728
|
+
/* @__PURE__ */ t(M, { type: "button", variant: "secondary", onClick: ie, children: ot }),
|
|
729
|
+
/* @__PURE__ */ t(ur, { type: "submit", disabled: B.trim().length === 0 || ne, children: it })
|
|
727
730
|
] })
|
|
728
731
|
] }) })
|
|
729
732
|
] }) }) }),
|
|
730
|
-
/* @__PURE__ */ t(
|
|
733
|
+
/* @__PURE__ */ t(Ie, { open: !!g, onOpenChange: (e) => {
|
|
731
734
|
e || oe();
|
|
732
|
-
}, children: /* @__PURE__ */ t(
|
|
733
|
-
/* @__PURE__ */ t(
|
|
734
|
-
/* @__PURE__ */ c(
|
|
735
|
-
/* @__PURE__ */ t(
|
|
736
|
-
/* @__PURE__ */ t(
|
|
735
|
+
}, children: /* @__PURE__ */ t(De, { children: /* @__PURE__ */ c(ce, { children: [
|
|
736
|
+
/* @__PURE__ */ t(Pe, {}),
|
|
737
|
+
/* @__PURE__ */ c(Fe, { children: [
|
|
738
|
+
/* @__PURE__ */ t(je, { children: nt }),
|
|
739
|
+
/* @__PURE__ */ t(Ne, { children: at ?? /* @__PURE__ */ c(Ae, { children: [
|
|
737
740
|
"Are you sure you want to delete",
|
|
738
|
-
g != null && g.name ? /* @__PURE__ */ c(
|
|
741
|
+
g != null && g.name ? /* @__PURE__ */ c(Ae, { children: [
|
|
739
742
|
" “",
|
|
740
743
|
/* @__PURE__ */ t("strong", { children: g.name }),
|
|
741
744
|
"”"
|
|
742
745
|
] }) : " this view",
|
|
743
746
|
"? This can’t be undone."
|
|
744
747
|
] }) }),
|
|
745
|
-
/* @__PURE__ */ c(
|
|
746
|
-
/* @__PURE__ */ t(
|
|
747
|
-
/* @__PURE__ */ t(
|
|
748
|
+
/* @__PURE__ */ c($e, { children: [
|
|
749
|
+
/* @__PURE__ */ t(M, { type: "button", variant: "secondary", onClick: oe, children: lt }),
|
|
750
|
+
/* @__PURE__ */ t(M, { type: "button", variant: "danger", onClick: Tt, children: ct })
|
|
748
751
|
] })
|
|
749
752
|
] })
|
|
750
753
|
] }) }) })
|
|
751
754
|
] }) : null;
|
|
752
755
|
}
|
|
753
756
|
export {
|
|
754
|
-
|
|
757
|
+
Or as TableViewSelector
|
|
755
758
|
};
|
|
756
759
|
//# sourceMappingURL=TableViewSelector.js.map
|