@bfrs/agentic-components 0.9.1 → 0.9.2
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/dist/components/data-display/DataTable/DataTable.d.ts +1 -1
- package/dist/components/data-display/DataTable/DataTable.js +370 -361
- package/dist/components/data-display/DataTable/DataTable.js.map +1 -1
- package/dist/components/data-display/DataTable/DataTable.types.d.ts +24 -0
- package/dist/components/data-display/DataTable/TablePagination.js +123 -73
- package/dist/components/data-display/DataTable/TablePagination.js.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/patterns/SidePanel/SidePanel.d.ts +94 -0
- package/dist/components/ui/patterns/SidePanel/SidePanel.js +265 -0
- package/dist/components/ui/patterns/SidePanel/SidePanel.js.map +1 -0
- package/dist/components/ui/patterns/SidePanel/index.d.ts +1 -0
- package/dist/custom-elements.js +10148 -10074
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +116 -114
- package/dist/index.js.map +1 -1
- package/dist/lib/useMediaQuery.d.ts +4 -0
- package/dist/lib/useMediaQuery.js +23 -0
- package/dist/lib/useMediaQuery.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ArrowsDownUp as
|
|
3
|
-
import { CaretDown as
|
|
4
|
-
import { CaretUp as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import
|
|
7
|
-
import { clsx as
|
|
8
|
-
import { twRing as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { jsxs as x, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowsDownUp as Oe } from "../../../node_modules/@phosphor-icons/react/dist/csr/ArrowsDownUp.es.js";
|
|
3
|
+
import { CaretDown as Ce } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
|
|
4
|
+
import { CaretUp as tr } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretUp.es.js";
|
|
5
|
+
import { useRef as se, useState as S, useMemo as L, useEffect as Et, useCallback as er, useLayoutEffect as rr } from "react";
|
|
6
|
+
import l from "@emotion/styled";
|
|
7
|
+
import { clsx as or } from "../../../node_modules/clsx/dist/clsx.js";
|
|
8
|
+
import { twRing as we } from "../../../lib/emotionTw.js";
|
|
9
|
+
import { useMediaQuery as ar, phoneMediaQuery as ir } from "../../../lib/useMediaQuery.js";
|
|
10
|
+
import { TableEmptyStateContent as nr } from "./TableEmptyState.js";
|
|
11
|
+
import { TableErrorState as sr } from "./TableErrorState.js";
|
|
12
|
+
import { TablePagination as cr } from "./TablePagination.js";
|
|
13
|
+
import { TableSkeleton as lr } from "./TableSkeleton.js";
|
|
14
|
+
const ce = typeof window > "u" ? Et : rr, It = 144, Lt = 220, A = 44, le = 146, dr = 3, pr = 1 / 3, hr = {
|
|
14
15
|
height: "38px",
|
|
15
16
|
paddingLeft: "1.25rem",
|
|
16
17
|
paddingRight: "1.25rem",
|
|
17
18
|
paddingTop: "7px",
|
|
18
19
|
paddingBottom: "7px"
|
|
19
|
-
},
|
|
20
|
+
}, br = {
|
|
20
21
|
height: "4rem",
|
|
21
22
|
paddingLeft: "1.25rem",
|
|
22
23
|
paddingRight: "1.25rem",
|
|
23
24
|
paddingTop: "1rem",
|
|
24
25
|
paddingBottom: "1rem"
|
|
25
|
-
},
|
|
26
|
+
}, zt = {
|
|
26
27
|
fontSize: "12px",
|
|
27
28
|
fontWeight: 700,
|
|
28
29
|
letterSpacing: ".24px",
|
|
29
30
|
"--tw-text-opacity": "1",
|
|
30
31
|
// `states.tableHeaderText` when set, otherwise the original text-primary.
|
|
31
32
|
color: "hsl(var(--bfrs-color-table-header-text, var(--bfrs-color-text-primary)) / var(--tw-text-opacity, 1))"
|
|
32
|
-
},
|
|
33
|
+
}, ve = {
|
|
33
34
|
"--tw-shadow": "3px 0 8px rgba(0,0,0,.05)",
|
|
34
35
|
"--tw-shadow-colored": "3px 0 8px var(--tw-shadow-color)",
|
|
35
36
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)"
|
|
36
|
-
},
|
|
37
|
+
}, fr = {
|
|
37
38
|
"--tw-shadow": "0px 2px 6px rgba(0,0,0,.08)",
|
|
38
39
|
"--tw-shadow-colored": "0px 2px 6px var(--tw-shadow-color)",
|
|
39
40
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)"
|
|
40
|
-
},
|
|
41
|
+
}, wr = {
|
|
41
42
|
"--tw-shadow": "-3px 0 4px rgba(0,0,0,.04)",
|
|
42
43
|
"--tw-shadow-colored": "-3px 0 4px var(--tw-shadow-color)",
|
|
43
44
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)"
|
|
44
|
-
},
|
|
45
|
+
}, ye = {
|
|
45
46
|
"--tw-bg-opacity": "1",
|
|
46
47
|
backgroundColor: "hsl(var(--bfrs-color-table-header) / var(--tw-bg-opacity, 1))"
|
|
47
|
-
},
|
|
48
|
+
}, de = {
|
|
48
49
|
"--tw-bg-opacity": "1",
|
|
49
50
|
backgroundColor: "hsl(var(--bfrs-color-row-hover) / var(--tw-bg-opacity, 1))"
|
|
50
|
-
},
|
|
51
|
+
}, at = {
|
|
51
52
|
"--tw-bg-opacity": "1",
|
|
52
53
|
backgroundColor: "hsl(var(--bfrs-color-row-selected) / var(--tw-bg-opacity, 1))"
|
|
53
|
-
},
|
|
54
|
+
}, vr = {
|
|
54
55
|
position: "var(--bfrs-row-hover-position, static)",
|
|
55
56
|
zIndex: 15,
|
|
56
57
|
boxShadow: "var(--bfrs-shadow-row-hover, 0 0 #0000)"
|
|
57
|
-
},
|
|
58
|
+
}, tt = "hsl(var(--bfrs-color-row-selected-border, 0 0% 0% / 0))", yr = "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)", gr = (e) => ({
|
|
58
59
|
"--bfrs-row-border-left": "0 0 #0000",
|
|
59
60
|
"--bfrs-row-border-right": "0 0 #0000",
|
|
60
|
-
"&:first-of-type": { "--bfrs-row-border-left": `inset 1px 0 0 ${
|
|
61
|
-
"&:last-of-type": { "--bfrs-row-border-right": `inset -1px 0 0 ${
|
|
61
|
+
"&:first-of-type": { "--bfrs-row-border-left": `inset 1px 0 0 ${tt}` },
|
|
62
|
+
"&:last-of-type": { "--bfrs-row-border-right": `inset -1px 0 0 ${tt}` },
|
|
62
63
|
boxShadow: [
|
|
63
|
-
`inset 0 1px 0 ${
|
|
64
|
-
`inset 0 -1px 0 ${
|
|
64
|
+
`inset 0 1px 0 ${tt}`,
|
|
65
|
+
`inset 0 -1px 0 ${tt}`,
|
|
65
66
|
"var(--bfrs-row-border-left)",
|
|
66
67
|
"var(--bfrs-row-border-right)",
|
|
67
|
-
|
|
68
|
+
e
|
|
68
69
|
].filter(Boolean).join(",")
|
|
69
|
-
}),
|
|
70
|
+
}), ur = /* @__PURE__ */ l("div", {
|
|
70
71
|
label: "AgenticDataTable-root",
|
|
71
|
-
shouldForwardProp: (
|
|
72
|
-
})(({ ownerState:
|
|
72
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
73
|
+
})(({ ownerState: e }) => ({
|
|
73
74
|
display: "flex",
|
|
74
75
|
minWidth: "0px",
|
|
75
76
|
minHeight: "0px",
|
|
76
|
-
flex:
|
|
77
|
+
flex: e.fill ? "1 1 auto" : "var(--bfrs-data-table-flex, 0 1 auto)",
|
|
77
78
|
flexDirection: "column",
|
|
78
79
|
overflow: "hidden",
|
|
79
80
|
borderRadius: "var(--bfrs-radius-md)",
|
|
@@ -82,13 +83,13 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
82
83
|
borderColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-border-opacity, 1))",
|
|
83
84
|
"--tw-bg-opacity": "1",
|
|
84
85
|
backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
|
|
85
|
-
})),
|
|
86
|
+
})), xr = /* @__PURE__ */ l("div", {
|
|
86
87
|
label: "AgenticDataTable-scroller"
|
|
87
88
|
})({
|
|
88
89
|
minHeight: "0px",
|
|
89
90
|
flex: "1 1 auto",
|
|
90
91
|
overflow: "auto"
|
|
91
|
-
}),
|
|
92
|
+
}), Sr = /* @__PURE__ */ l("div", {
|
|
92
93
|
label: "AgenticDataTable-stateViewport"
|
|
93
94
|
})({
|
|
94
95
|
position: "sticky",
|
|
@@ -96,7 +97,7 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
96
97
|
width: "100%",
|
|
97
98
|
minWidth: "0px",
|
|
98
99
|
boxSizing: "border-box"
|
|
99
|
-
}),
|
|
100
|
+
}), kr = /* @__PURE__ */ l("table", {
|
|
100
101
|
label: "AgenticDataTable-table"
|
|
101
102
|
})({
|
|
102
103
|
width: "100%",
|
|
@@ -105,83 +106,83 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
105
106
|
"--tw-border-spacing-y": "0px",
|
|
106
107
|
borderSpacing: "var(--tw-border-spacing-x) var(--tw-border-spacing-y)",
|
|
107
108
|
textAlign: "left"
|
|
108
|
-
}),
|
|
109
|
+
}), mr = /* @__PURE__ */ l("thead", {
|
|
109
110
|
label: "AgenticDataTable-head",
|
|
110
|
-
shouldForwardProp: (
|
|
111
|
-
})(({ ownerState:
|
|
112
|
-
|
|
111
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
112
|
+
})(({ ownerState: e }) => [
|
|
113
|
+
e.sticky && {
|
|
113
114
|
position: "sticky",
|
|
114
115
|
top: 0,
|
|
115
116
|
zIndex: 30
|
|
116
117
|
}
|
|
117
|
-
]),
|
|
118
|
+
]), Dr = /* @__PURE__ */ l("tr", {
|
|
118
119
|
label: "AgenticDataTable-headerRow"
|
|
119
|
-
})(
|
|
120
|
+
})(ye), Tr = {
|
|
120
121
|
// Positioning context so the pin button can float without reserving header width.
|
|
121
122
|
position: "relative",
|
|
122
123
|
borderBottomWidth: "1px",
|
|
123
124
|
"--tw-border-opacity": "1",
|
|
124
125
|
borderColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-border-opacity, 1))",
|
|
125
|
-
...
|
|
126
|
-
},
|
|
126
|
+
...ye
|
|
127
|
+
}, et = /* @__PURE__ */ l("th", {
|
|
127
128
|
label: "AgenticDataTable-headerCell",
|
|
128
|
-
shouldForwardProp: (
|
|
129
|
-
})(({ ownerState:
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
130
|
+
})(({ ownerState: e }) => [
|
|
131
|
+
Tr,
|
|
132
|
+
e.kind === "selection" && {
|
|
132
133
|
textAlign: "center",
|
|
133
134
|
"--tw-text-opacity": "1",
|
|
134
135
|
color: "hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))"
|
|
135
136
|
},
|
|
136
|
-
|
|
137
|
+
e.kind === "leading" && {
|
|
137
138
|
verticalAlign: "middle",
|
|
138
|
-
...
|
|
139
|
+
...zt,
|
|
139
140
|
"&:hover button[title]": { opacity: 1 }
|
|
140
141
|
},
|
|
141
|
-
|
|
142
|
+
e.kind === "data" && {
|
|
142
143
|
borderLeftWidth: "2px",
|
|
143
144
|
borderLeftColor: "transparent",
|
|
144
|
-
...
|
|
145
|
+
...zt,
|
|
145
146
|
"&:hover button[title]": { opacity: 1 }
|
|
146
147
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
e.kind === "actions" && zt,
|
|
149
|
+
hr,
|
|
150
|
+
e.sortable && {
|
|
150
151
|
"&:hover": {
|
|
151
152
|
"--tw-text-opacity": "1",
|
|
152
153
|
color: "hsl(var(--bfrs-color-primary) / var(--tw-text-opacity, 1))"
|
|
153
154
|
}
|
|
154
155
|
},
|
|
155
|
-
|
|
156
|
+
e.sorted && {
|
|
156
157
|
"--tw-text-opacity": "1",
|
|
157
158
|
color: "hsl(var(--bfrs-color-primary) / var(--tw-text-opacity, 1))"
|
|
158
159
|
},
|
|
159
|
-
|
|
160
|
+
e.reorderable && {
|
|
160
161
|
cursor: "grab",
|
|
161
162
|
WebkitUserSelect: "none",
|
|
162
163
|
MozUserSelect: "none",
|
|
163
164
|
userSelect: "none",
|
|
164
165
|
"&:active": { cursor: "grabbing" }
|
|
165
166
|
},
|
|
166
|
-
|
|
167
|
+
e.dropTarget && {
|
|
167
168
|
"--tw-border-opacity": "1",
|
|
168
169
|
borderLeftColor: "hsl(var(--bfrs-color-primary) / var(--tw-border-opacity, 1))"
|
|
169
170
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
]),
|
|
171
|
+
e.edgeShadow && ve,
|
|
172
|
+
e.actionsShadow && fr
|
|
173
|
+
]), pe = /* @__PURE__ */ l("span", {
|
|
173
174
|
label: "AgenticDataTable-headerContent",
|
|
174
|
-
shouldForwardProp: (
|
|
175
|
-
})(({ ownerState:
|
|
175
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
176
|
+
})(({ ownerState: e }) => [
|
|
176
177
|
{
|
|
177
178
|
display: "inline-flex",
|
|
178
179
|
maxWidth: "100%",
|
|
179
180
|
alignItems: "center",
|
|
180
|
-
gap:
|
|
181
|
+
gap: e.wide ? ".5rem" : ".375rem"
|
|
181
182
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
]),
|
|
183
|
+
e.align === "right" && { justifyContent: "flex-end" },
|
|
184
|
+
e.align === "center" && { justifyContent: "center" }
|
|
185
|
+
]), Wr = /* @__PURE__ */ l("button", {
|
|
185
186
|
label: "AgenticDataTable-sortButton"
|
|
186
187
|
})({
|
|
187
188
|
display: "inline-flex",
|
|
@@ -192,26 +193,26 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
192
193
|
outline: "2px solid transparent",
|
|
193
194
|
outlineOffset: "2px",
|
|
194
195
|
"&:focus-visible": {
|
|
195
|
-
...
|
|
196
|
+
...we("2px", "hsl(var(--bfrs-color-border-focus) / var(--tw-ring-opacity, 1))"),
|
|
196
197
|
"--tw-ring-opacity": "1"
|
|
197
198
|
}
|
|
198
|
-
}),
|
|
199
|
+
}), Ft = /* @__PURE__ */ l("span", {
|
|
199
200
|
label: "AgenticDataTable-truncate",
|
|
200
|
-
shouldForwardProp: (
|
|
201
|
-
})(({ ownerState:
|
|
201
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
202
|
+
})(({ ownerState: e }) => ({
|
|
202
203
|
minWidth: "0px",
|
|
203
|
-
overflow:
|
|
204
|
-
textOverflow:
|
|
204
|
+
overflow: e.overflow === "visible" ? "visible" : "hidden",
|
|
205
|
+
textOverflow: e.overflow === "visible" ? "clip" : "ellipsis",
|
|
205
206
|
whiteSpace: "nowrap"
|
|
206
|
-
})),
|
|
207
|
+
})), Ar = /* @__PURE__ */ l(Oe, {
|
|
207
208
|
label: "AgenticDataTable-sortIdleIcon"
|
|
208
209
|
})({
|
|
209
210
|
"--tw-text-opacity": "1",
|
|
210
211
|
color: "hsl(var(--bfrs-color-text-disabled) / var(--tw-text-opacity, 1))"
|
|
211
|
-
}),
|
|
212
|
+
}), he = /* @__PURE__ */ l("button", {
|
|
212
213
|
label: "AgenticDataTable-pinButton",
|
|
213
|
-
shouldForwardProp: (
|
|
214
|
-
})(({ ownerState:
|
|
214
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
215
|
+
})(({ ownerState: e }) => [
|
|
215
216
|
{
|
|
216
217
|
// Floated (not a flex item) so the header label keeps its full width; the pin
|
|
217
218
|
// overlays the cell edge on hover instead of shortening the text box and
|
|
@@ -241,13 +242,13 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
241
242
|
opacity: 1,
|
|
242
243
|
outline: "2px solid transparent",
|
|
243
244
|
outlineOffset: "2px",
|
|
244
|
-
...
|
|
245
|
+
...we("2px", "hsl(var(--bfrs-color-border-focus) / var(--tw-ring-opacity, 1))"),
|
|
245
246
|
"--tw-ring-opacity": "1"
|
|
246
247
|
}
|
|
247
248
|
},
|
|
248
249
|
// Anchor to the far edge of the header cell (opposite the text flush side).
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
e.side === "right" ? { right: "1.25rem" } : { left: "1.25rem" },
|
|
251
|
+
e.pinned ? {
|
|
251
252
|
"--tw-bg-opacity": "1",
|
|
252
253
|
backgroundColor: "hsl(var(--bfrs-color-success-soft) / var(--tw-bg-opacity, 1))",
|
|
253
254
|
"--tw-text-opacity": "1",
|
|
@@ -262,28 +263,28 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
262
263
|
color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
|
-
]),
|
|
266
|
+
]), Pr = /* @__PURE__ */ l("tr", {
|
|
266
267
|
label: "AgenticDataTable-row",
|
|
267
|
-
shouldForwardProp: (
|
|
268
|
-
})(({ ownerState:
|
|
268
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
269
|
+
})(({ ownerState: e }) => [
|
|
269
270
|
{
|
|
270
271
|
"--tw-bg-opacity": "1",
|
|
271
272
|
backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))",
|
|
272
273
|
transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
|
|
273
274
|
transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
|
|
274
275
|
transitionDuration: ".15s",
|
|
275
|
-
"&:hover": { ...
|
|
276
|
-
"&:hover > td":
|
|
276
|
+
"&:hover": { ...de, ...vr },
|
|
277
|
+
"&:hover > td": de
|
|
277
278
|
},
|
|
278
279
|
// Selection wins over hover (as in Select), so a distinct rowSelectedBg
|
|
279
280
|
// stays visible while the pointer is over a selected row. Only the
|
|
280
281
|
// background is overridden, so a selected row keeps the hover shadow.
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
]),
|
|
282
|
+
e.selected && { ...at, "&:hover": at, "&:hover > td": at },
|
|
283
|
+
e.clickable && { cursor: "pointer" }
|
|
284
|
+
]), rt = /* @__PURE__ */ l("td", {
|
|
284
285
|
label: "AgenticDataTable-cell",
|
|
285
|
-
shouldForwardProp: (
|
|
286
|
-
})(({ ownerState:
|
|
286
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
287
|
+
})(({ ownerState: e }) => [
|
|
287
288
|
{
|
|
288
289
|
borderBottomWidth: "1px",
|
|
289
290
|
"--tw-border-opacity": "1",
|
|
@@ -294,7 +295,7 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
294
295
|
// data cells top-align — see the `data` branch below.
|
|
295
296
|
verticalAlign: "middle"
|
|
296
297
|
},
|
|
297
|
-
|
|
298
|
+
e.kind === "data" && {
|
|
298
299
|
// Content starts at the first line rather than floating in the middle, so a
|
|
299
300
|
// row made tall by one wrapping cell keeps every other cell readable across
|
|
300
301
|
// the row instead of scattering values at different heights.
|
|
@@ -302,20 +303,20 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
302
303
|
"--tw-text-opacity": "1",
|
|
303
304
|
color: "hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))"
|
|
304
305
|
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
br,
|
|
307
|
+
e.selected && at,
|
|
308
|
+
e.kind === "data" && { fontSize: "12px" },
|
|
309
|
+
e.cellTextSize === "compact" && {
|
|
309
310
|
fontSize: "12px",
|
|
310
311
|
"& *": {
|
|
311
312
|
fontSize: "inherit"
|
|
312
313
|
}
|
|
313
314
|
},
|
|
314
|
-
|
|
315
|
-
|
|
315
|
+
e.edgeShadow && ve,
|
|
316
|
+
e.actionsShadow && wr,
|
|
316
317
|
// Last, so its box-shadow wins; it re-adds the edge shadow set just above.
|
|
317
|
-
|
|
318
|
-
]),
|
|
318
|
+
e.selected && gr(e.edgeShadow || e.actionsShadow ? yr : void 0)
|
|
319
|
+
]), ot = /* @__PURE__ */ l("input", {
|
|
319
320
|
label: "AgenticDataTable-checkbox"
|
|
320
321
|
})({
|
|
321
322
|
width: ".75rem",
|
|
@@ -323,409 +324,417 @@ const Qt = typeof window > "u" ? Mt : je, Rt = 144, Wt = 220, B = 44, Je = 146,
|
|
|
323
324
|
flexShrink: 0,
|
|
324
325
|
cursor: "pointer",
|
|
325
326
|
accentColor: "hsl(var(--bfrs-color-primary) / 1)"
|
|
326
|
-
}),
|
|
327
|
+
}), be = /* @__PURE__ */ l("div", {
|
|
327
328
|
label: "AgenticDataTable-checkboxCenter"
|
|
328
329
|
})({
|
|
329
330
|
display: "flex",
|
|
330
331
|
alignItems: "center",
|
|
331
332
|
justifyContent: "center"
|
|
332
|
-
}),
|
|
333
|
+
}), Br = /* @__PURE__ */ l("div", {
|
|
333
334
|
label: "AgenticDataTable-leadingLayout"
|
|
334
335
|
})({
|
|
335
336
|
display: "flex",
|
|
336
337
|
alignItems: "center",
|
|
337
338
|
gap: ".75rem"
|
|
338
|
-
}),
|
|
339
|
+
}), Mr = /* @__PURE__ */ l("div", {
|
|
339
340
|
label: "AgenticDataTable-leadingContent"
|
|
340
341
|
})({
|
|
341
342
|
minWidth: "0px",
|
|
342
343
|
flex: "1 1 0%"
|
|
343
344
|
});
|
|
344
|
-
function
|
|
345
|
-
if (o.accessorFn) return o.accessorFn(
|
|
346
|
-
if (o.accessorKey) return
|
|
345
|
+
function ge(e, o) {
|
|
346
|
+
if (o.accessorFn) return o.accessorFn(e);
|
|
347
|
+
if (o.accessorKey) return e[o.accessorKey];
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
-
return o.sortValue ? o.sortValue(
|
|
349
|
+
function fe(e, o) {
|
|
350
|
+
return o.sortValue ? o.sortValue(e) : ge(e, o);
|
|
350
351
|
}
|
|
351
|
-
function
|
|
352
|
-
return typeof
|
|
352
|
+
function Ir(e, o) {
|
|
353
|
+
return typeof e == "number" && typeof o == "number" ? e - o : String(e ?? "").localeCompare(String(o ?? ""), void 0, { numeric: !0, sensitivity: "base" });
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
-
if (typeof
|
|
356
|
-
if (typeof
|
|
357
|
-
const p = Number.parseFloat(
|
|
355
|
+
function Ht(e, o) {
|
|
356
|
+
if (typeof e == "number") return e;
|
|
357
|
+
if (typeof e == "string" && e.endsWith("px")) {
|
|
358
|
+
const p = Number.parseFloat(e);
|
|
358
359
|
return Number.isFinite(p) ? p : o;
|
|
359
360
|
}
|
|
360
361
|
return o;
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
-
const p =
|
|
363
|
+
function Nt(e, o) {
|
|
364
|
+
const p = e.filter((y) => o.includes(y)), h = o.filter((y) => !p.includes(y));
|
|
364
365
|
return [...p, ...h];
|
|
365
366
|
}
|
|
366
|
-
function
|
|
367
|
-
const h = [...
|
|
368
|
-
return
|
|
367
|
+
function Lr(e, o, p) {
|
|
368
|
+
const h = [...e], y = h.indexOf(o), z = h.indexOf(p);
|
|
369
|
+
return y === -1 || z === -1 || y === z ? e : (h.splice(y, 1), h.splice(z, 0, o), h);
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
-
return Math.round(
|
|
371
|
+
function zr(e) {
|
|
372
|
+
return Math.round(e * 100) / 100;
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
-
return
|
|
374
|
+
function Y(e, o) {
|
|
375
|
+
return e && e > 0 ? e : o;
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
-
return !
|
|
377
|
+
function Fr(e, o) {
|
|
378
|
+
return !e || e.columns.length !== o.columns.length || Math.abs(e.selection - o.selection) > 0.5 || Math.abs(e.leading - o.leading) > 0.5 || Math.abs(e.rowActions - o.rowActions) > 0.5 ? !1 : e.columns.every((p, h) => Math.abs(p - o.columns[h]) <= 0.5);
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
-
data:
|
|
380
|
+
function Xr({
|
|
381
|
+
data: e,
|
|
381
382
|
columns: o,
|
|
382
383
|
getRowId: p,
|
|
383
384
|
loading: h,
|
|
384
|
-
error:
|
|
385
|
+
error: y,
|
|
385
386
|
emptyState: z,
|
|
386
387
|
// Default no-data view is a two-line message (title + description). Consumers
|
|
387
388
|
// can override either line, or replace the whole thing via `emptyState`.
|
|
388
|
-
emptyTitle:
|
|
389
|
-
emptyDescription:
|
|
390
|
-
pagination:
|
|
391
|
-
enableSorting:
|
|
389
|
+
emptyTitle: ue = "No records found",
|
|
390
|
+
emptyDescription: xe = "There's nothing to show here yet.",
|
|
391
|
+
pagination: Ut,
|
|
392
|
+
enableSorting: it = !0,
|
|
392
393
|
sorting: F,
|
|
393
|
-
defaultSorting:
|
|
394
|
-
onSortingChange:
|
|
395
|
-
visibleColumnIds:
|
|
394
|
+
defaultSorting: nt = null,
|
|
395
|
+
onSortingChange: st,
|
|
396
|
+
visibleColumnIds: ct,
|
|
396
397
|
columnOrder: k,
|
|
397
|
-
defaultColumnOrder:
|
|
398
|
-
onColumnOrderChange:
|
|
399
|
-
enableColumnPinning:
|
|
400
|
-
pinnedColumnCount:
|
|
401
|
-
defaultPinnedColumnCount:
|
|
402
|
-
onPinnedColumnCountChange:
|
|
403
|
-
pinLeadingColumn:
|
|
404
|
-
defaultPinLeadingColumn:
|
|
405
|
-
onPinLeadingColumnChange:
|
|
406
|
-
enableColumnReordering:
|
|
407
|
-
resetKey:
|
|
408
|
-
showSortIcon:
|
|
398
|
+
defaultColumnOrder: lt,
|
|
399
|
+
onColumnOrderChange: dt,
|
|
400
|
+
enableColumnPinning: q = !0,
|
|
401
|
+
pinnedColumnCount: H,
|
|
402
|
+
defaultPinnedColumnCount: pt = 0,
|
|
403
|
+
onPinnedColumnCountChange: ht,
|
|
404
|
+
pinLeadingColumn: N,
|
|
405
|
+
defaultPinLeadingColumn: bt = !1,
|
|
406
|
+
onPinLeadingColumnChange: ft,
|
|
407
|
+
enableColumnReordering: E = !0,
|
|
408
|
+
resetKey: $t,
|
|
409
|
+
showSortIcon: jt = "always",
|
|
409
410
|
leadingColumn: s,
|
|
410
|
-
rowActions:
|
|
411
|
-
rowActionsHeader:
|
|
412
|
-
rowActionsWidth:
|
|
413
|
-
stickyRowActions:
|
|
411
|
+
rowActions: m,
|
|
412
|
+
rowActionsHeader: Se = "Actions",
|
|
413
|
+
rowActionsWidth: U = le,
|
|
414
|
+
stickyRowActions: Vt = !!m,
|
|
415
|
+
pinnedMaxShare: ke = pr,
|
|
416
|
+
pinOnMobile: me = !1,
|
|
414
417
|
selection: G,
|
|
415
|
-
selectedRowIds:
|
|
418
|
+
selectedRowIds: $ = [],
|
|
416
419
|
onSelectedRowIdsChange: J,
|
|
417
|
-
stickyHeader:
|
|
418
|
-
fill:
|
|
419
|
-
headerTextOverflow:
|
|
420
|
-
cellTextSize:
|
|
421
|
-
minWidth:
|
|
422
|
-
maxHeight:
|
|
423
|
-
className:
|
|
424
|
-
scrollerClassName:
|
|
425
|
-
tableClassName:
|
|
426
|
-
headerClassName:
|
|
427
|
-
rowClassName:
|
|
428
|
-
cellClassName:
|
|
429
|
-
onRowClick:
|
|
430
|
-
"aria-label":
|
|
420
|
+
stickyHeader: wt = !0,
|
|
421
|
+
fill: De = !1,
|
|
422
|
+
headerTextOverflow: vt = "truncate",
|
|
423
|
+
cellTextSize: X = "default",
|
|
424
|
+
minWidth: Te = "100%",
|
|
425
|
+
maxHeight: Rt,
|
|
426
|
+
className: We,
|
|
427
|
+
scrollerClassName: Ae,
|
|
428
|
+
tableClassName: Pe,
|
|
429
|
+
headerClassName: Be,
|
|
430
|
+
rowClassName: yt,
|
|
431
|
+
cellClassName: gt,
|
|
432
|
+
onRowClick: Z,
|
|
433
|
+
"aria-label": Me = "Data table"
|
|
431
434
|
}) {
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
k === void 0 &&
|
|
435
|
-
}, [W, k]),
|
|
436
|
-
|
|
435
|
+
const ut = se(null), Qt = se(null), [Kt, Ie] = S(0), [Le, Yt] = S(nt), [xt, St] = S(() => lt ?? o.map((t) => t.id)), [ze, qt] = S(pt), [Fe, Gt] = S(bt), [_, j] = S(null), [He, V] = S(null), [Ne, Jt] = S(null), [b, Ee] = S(null), f = it ? F === void 0 ? Le : F : null, W = L(() => o.map((t) => t.id), [o]), Xt = L(() => new Map(o.map((t) => [t.id, t])), [o]);
|
|
436
|
+
Et(() => {
|
|
437
|
+
k === void 0 && St((t) => Nt(t, W));
|
|
438
|
+
}, [W, k]), Et(() => {
|
|
439
|
+
$t !== void 0 && (F === void 0 && Yt(nt), k === void 0 && St(Nt(lt ?? W, W)), H === void 0 && qt(pt), N === void 0 && Gt(bt), j(null), V(null));
|
|
437
440
|
}, [
|
|
438
441
|
W,
|
|
439
442
|
k,
|
|
440
|
-
|
|
443
|
+
lt,
|
|
444
|
+
pt,
|
|
445
|
+
bt,
|
|
441
446
|
nt,
|
|
442
|
-
|
|
443
|
-
rt,
|
|
447
|
+
N,
|
|
444
448
|
H,
|
|
445
|
-
|
|
446
|
-
Ft,
|
|
449
|
+
$t,
|
|
447
450
|
F
|
|
448
451
|
]);
|
|
449
|
-
const
|
|
450
|
-
if (!
|
|
451
|
-
const
|
|
452
|
-
return
|
|
453
|
-
}, [
|
|
454
|
-
() =>
|
|
455
|
-
[
|
|
456
|
-
),
|
|
457
|
-
|
|
458
|
-
Math.max(0,
|
|
459
|
-
) : 0,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
452
|
+
const kt = L(() => Nt(k ?? xt, W).map((r) => Xt.get(r)).filter((r) => !!r), [Xt, W, k, xt]), v = L(() => {
|
|
453
|
+
if (!ct) return kt;
|
|
454
|
+
const t = new Set(ct);
|
|
455
|
+
return kt.filter((r) => t.has(r.id));
|
|
456
|
+
}, [kt, ct]), Zt = L(
|
|
457
|
+
() => v.map((t) => Ht(t.width ?? t.minWidth, It)),
|
|
458
|
+
[v]
|
|
459
|
+
), g = q ? Math.min(
|
|
460
|
+
v.length,
|
|
461
|
+
Math.max(0, H === void 0 ? ze : H)
|
|
462
|
+
) : 0, D = !!s && ((q && s ? N === void 0 ? Fe : N : !1) || g > 0), Ue = D && g === 0, P = !!(G && !s), _t = P && g > 0, $e = Ht((s == null ? void 0 : s.width) ?? (s == null ? void 0 : s.minWidth), Lt), B = (b == null ? void 0 : b.columns.length) === v.length ? b.columns : void 0, je = Y(b == null ? void 0 : b.selection, A), Ve = Y(b == null ? void 0 : b.leading, $e), Ot = (_t ? je : 0) + (D ? Ve : 0), Ct = v.length + (P ? 1 : 0) + (s ? 1 : 0) + (m ? 1 : 0);
|
|
463
|
+
let te = Ot;
|
|
464
|
+
for (let t = 0; t < g; t += 1)
|
|
465
|
+
te += Y(B == null ? void 0 : B[t], Zt[t] ?? It);
|
|
466
|
+
const Re = Vt && m ? Y(b == null ? void 0 : b.rowActions, Ht(U, le)) : 0, Qe = ar(ir), mt = me || !Qe, R = mt && (Kt <= 0 || te + Re <= Kt * ke), Dt = R ? g : 0, M = R && _t, ee = R && D, re = R && Ue, O = R && Vt, Tt = (t, r) => (p == null ? void 0 : p(t, r)) ?? String(t.id ?? r), Wt = er(() => {
|
|
467
|
+
var w, T;
|
|
468
|
+
const t = (T = (w = ut.current) == null ? void 0 : w.tHead) == null ? void 0 : T.rows[0];
|
|
469
|
+
if (!t) return;
|
|
470
|
+
const r = Array.from(t.cells);
|
|
471
|
+
let c = 0;
|
|
465
472
|
const a = () => {
|
|
466
|
-
var
|
|
467
|
-
return
|
|
473
|
+
var n;
|
|
474
|
+
return zr(((n = r[c++]) == null ? void 0 : n.getBoundingClientRect().width) ?? 0);
|
|
468
475
|
}, d = {
|
|
469
|
-
selection:
|
|
476
|
+
selection: P ? a() : 0,
|
|
470
477
|
leading: s ? a() : 0,
|
|
471
|
-
columns:
|
|
472
|
-
rowActions:
|
|
478
|
+
columns: v.map(() => a()),
|
|
479
|
+
rowActions: m ? a() : 0
|
|
473
480
|
};
|
|
474
|
-
|
|
475
|
-
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}),
|
|
479
|
-
var
|
|
480
|
-
const
|
|
481
|
-
if (!
|
|
482
|
-
const r =
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
H === void 0 &&
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
J && J(
|
|
507
|
-
},
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
481
|
+
Ee((n) => Fr(n, d) ? n : d);
|
|
482
|
+
}, [v, P, s, m]);
|
|
483
|
+
ce(() => {
|
|
484
|
+
Wt();
|
|
485
|
+
}), ce(() => {
|
|
486
|
+
var d, w;
|
|
487
|
+
const t = ut.current;
|
|
488
|
+
if (!t || typeof window > "u" || typeof window.ResizeObserver > "u") return;
|
|
489
|
+
const r = Qt.current, c = () => {
|
|
490
|
+
Wt(), r && Ie(r.clientWidth);
|
|
491
|
+
}, a = new window.ResizeObserver(c);
|
|
492
|
+
return a.observe(t), r && a.observe(r), c(), Array.from(((w = (d = t.tHead) == null ? void 0 : d.rows[0]) == null ? void 0 : w.cells) ?? []).forEach((T) => a.observe(T)), () => a.disconnect();
|
|
493
|
+
}, [Wt]);
|
|
494
|
+
const I = L(() => {
|
|
495
|
+
if (!f) return e;
|
|
496
|
+
const t = o.find((r) => r.id === f.columnId);
|
|
497
|
+
return t ? [...e].sort((r, c) => {
|
|
498
|
+
const a = Ir(fe(r, t), fe(c, t));
|
|
499
|
+
return f.direction === "asc" ? a : -a;
|
|
500
|
+
}) : e;
|
|
501
|
+
}, [f, o, e]), At = I.length > 0 && I.every((t, r) => $.includes(Tt(t, r))), Ke = (t) => {
|
|
502
|
+
if (!it || !t.sortable) return;
|
|
503
|
+
const r = (f == null ? void 0 : f.columnId) === t.id ? { columnId: t.id, direction: f.direction === "asc" ? "desc" : "asc" } : { columnId: t.id, direction: "asc" };
|
|
504
|
+
F === void 0 && Yt(r), st == null || st(r);
|
|
505
|
+
}, Ye = (t) => {
|
|
506
|
+
k === void 0 && St(t), dt == null || dt(t);
|
|
507
|
+
}, Pt = (t) => {
|
|
508
|
+
const r = Math.min(v.length, Math.max(0, t));
|
|
509
|
+
H === void 0 && qt(r), ht == null || ht(r);
|
|
510
|
+
}, oe = (t) => {
|
|
511
|
+
N === void 0 && Gt(t), ft == null || ft(t);
|
|
512
|
+
}, ae = () => {
|
|
513
|
+
J && J(At ? [] : I.map((t, r) => Tt(t, r)));
|
|
514
|
+
}, ie = (t) => {
|
|
515
|
+
J && J($.includes(t) ? $.filter((r) => r !== t) : [...$, t]);
|
|
516
|
+
}, ne = (t) => {
|
|
517
|
+
let r = Ot;
|
|
518
|
+
for (let c = 0; c < t; c += 1)
|
|
519
|
+
r += Y(B == null ? void 0 : B[c], Zt[c] ?? It);
|
|
511
520
|
return r;
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
},
|
|
517
|
-
var d,
|
|
518
|
-
if (!
|
|
519
|
-
if (
|
|
520
|
-
|
|
521
|
+
}, qe = (t, r) => {
|
|
522
|
+
E && (j(r), t.dataTransfer.effectAllowed = "move");
|
|
523
|
+
}, Ge = (t, r) => {
|
|
524
|
+
E && (t.preventDefault(), V(r));
|
|
525
|
+
}, Je = (t, r) => {
|
|
526
|
+
var d, w;
|
|
527
|
+
if (!E) return;
|
|
528
|
+
if (t.preventDefault(), _ === null || _ === r) {
|
|
529
|
+
j(null), V(null);
|
|
521
530
|
return;
|
|
522
531
|
}
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
},
|
|
532
|
+
const c = (d = v[_]) == null ? void 0 : d.id, a = (w = v[r]) == null ? void 0 : w.id;
|
|
533
|
+
c && a && (Ye(Lr(k ?? xt, c, a)), _ < g && Pt(Math.min(g, r + 1))), j(null), V(null);
|
|
534
|
+
}, Bt = (t, r = 20) => ({
|
|
526
535
|
position: "sticky",
|
|
527
|
-
left:
|
|
528
|
-
...
|
|
536
|
+
left: t,
|
|
537
|
+
...wt ? { top: 0 } : {},
|
|
529
538
|
zIndex: r
|
|
530
|
-
}),
|
|
539
|
+
}), Mt = (t, r = 10) => ({
|
|
531
540
|
position: "sticky",
|
|
532
|
-
left:
|
|
541
|
+
left: t,
|
|
533
542
|
zIndex: r
|
|
534
|
-
}),
|
|
543
|
+
}), Xe = O ? {
|
|
535
544
|
position: "sticky",
|
|
536
545
|
right: 0,
|
|
537
546
|
zIndex: 12
|
|
538
|
-
} : {},
|
|
547
|
+
} : {}, Ze = O ? {
|
|
539
548
|
position: "sticky",
|
|
540
549
|
right: 0,
|
|
541
|
-
...
|
|
550
|
+
...wt ? { top: 0 } : {},
|
|
542
551
|
zIndex: 24
|
|
543
552
|
} : {};
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */ i(
|
|
548
|
-
|
|
549
|
-
|
|
553
|
+
return /* @__PURE__ */ x(ur, { className: We, ownerState: { fill: De }, children: [
|
|
554
|
+
/* @__PURE__ */ x(xr, { ref: Qt, className: Ae, style: Rt !== void 0 ? { maxHeight: Rt } : void 0, children: [
|
|
555
|
+
/* @__PURE__ */ x(kr, { ref: ut, "aria-label": Me, "aria-busy": h || void 0, className: Pe, style: { minWidth: Te, tableLayout: "fixed" }, children: [
|
|
556
|
+
/* @__PURE__ */ i(mr, { ownerState: { sticky: !!wt }, className: Be, children: /* @__PURE__ */ x(Dr, { children: [
|
|
557
|
+
P && /* @__PURE__ */ i(
|
|
558
|
+
et,
|
|
550
559
|
{
|
|
551
|
-
ownerState: { kind: "selection", edgeShadow:
|
|
552
|
-
style: { width:
|
|
553
|
-
children: /* @__PURE__ */ i(
|
|
560
|
+
ownerState: { kind: "selection", edgeShadow: M },
|
|
561
|
+
style: { width: A, minWidth: A, ...M ? Bt(0, 24) : {} },
|
|
562
|
+
children: /* @__PURE__ */ i(be, { children: /* @__PURE__ */ i(ot, { type: "checkbox", checked: At, onChange: ae, "aria-label": "Select all rows" }) })
|
|
554
563
|
}
|
|
555
564
|
),
|
|
556
565
|
s && /* @__PURE__ */ i(
|
|
557
|
-
|
|
566
|
+
et,
|
|
558
567
|
{
|
|
559
568
|
scope: "col",
|
|
560
|
-
ownerState: { kind: "leading", edgeShadow:
|
|
569
|
+
ownerState: { kind: "leading", edgeShadow: re },
|
|
561
570
|
className: s.headerClassName,
|
|
562
571
|
style: {
|
|
563
572
|
width: s.width,
|
|
564
|
-
minWidth: s.minWidth ?? s.width ??
|
|
565
|
-
...
|
|
573
|
+
minWidth: s.minWidth ?? s.width ?? Lt,
|
|
574
|
+
...ee ? Bt(M ? A : 0, 23) : {},
|
|
566
575
|
...s.headerStyle
|
|
567
576
|
},
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
G && /* @__PURE__ */ i(
|
|
570
|
-
/* @__PURE__ */ i(
|
|
571
|
-
|
|
572
|
-
|
|
577
|
+
children: /* @__PURE__ */ x(pe, { ownerState: { wide: !0 }, children: [
|
|
578
|
+
G && /* @__PURE__ */ i(ot, { type: "checkbox", checked: At, onChange: ae, "aria-label": "Select all rows" }),
|
|
579
|
+
/* @__PURE__ */ i(Ft, { ownerState: { overflow: vt }, children: s.header }),
|
|
580
|
+
q && mt && /* @__PURE__ */ i(
|
|
581
|
+
he,
|
|
573
582
|
{
|
|
574
583
|
type: "button",
|
|
575
|
-
ownerState: { pinned:
|
|
576
|
-
title:
|
|
577
|
-
"aria-label":
|
|
578
|
-
onClick: (
|
|
579
|
-
|
|
584
|
+
ownerState: { pinned: D, side: "right" },
|
|
585
|
+
title: D ? "Unpin leading column" : "Pin leading column",
|
|
586
|
+
"aria-label": D ? "Unpin leading column" : "Pin leading column",
|
|
587
|
+
onClick: (t) => {
|
|
588
|
+
t.stopPropagation(), D ? (oe(!1), Pt(0)) : oe(!0);
|
|
580
589
|
},
|
|
581
|
-
children:
|
|
590
|
+
children: D ? "Unpin" : "Pin"
|
|
582
591
|
}
|
|
583
592
|
)
|
|
584
593
|
] })
|
|
585
594
|
}
|
|
586
595
|
),
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
width:
|
|
590
|
-
minWidth:
|
|
591
|
-
textAlign:
|
|
592
|
-
...
|
|
593
|
-
...
|
|
594
|
-
},
|
|
595
|
-
|
|
596
|
+
v.map((t, r) => {
|
|
597
|
+
const c = (f == null ? void 0 : f.columnId) === t.id, a = r < g, d = r === g - 1, w = r < Dt, T = {
|
|
598
|
+
width: t.width,
|
|
599
|
+
minWidth: t.minWidth ?? t.width,
|
|
600
|
+
textAlign: t.align,
|
|
601
|
+
...w ? Bt(ne(r), 22) : {},
|
|
602
|
+
...t.headerStyle
|
|
603
|
+
}, n = it && t.sortable, Q = n && jt === "always" && !c, C = n && c && jt !== "never", K = q && mt && r < dr && /* @__PURE__ */ i(
|
|
604
|
+
he,
|
|
596
605
|
{
|
|
597
606
|
type: "button",
|
|
598
|
-
ownerState: { pinned: a, side:
|
|
607
|
+
ownerState: { pinned: a, side: t.align === "right" ? "left" : "right" },
|
|
599
608
|
title: a && d ? "Unpin columns" : "Pin up to this column",
|
|
600
|
-
"aria-label": a && d ? "Unpin columns" : `Pin up to ${String(
|
|
601
|
-
onClick: (
|
|
602
|
-
|
|
609
|
+
"aria-label": a && d ? "Unpin columns" : `Pin up to ${String(t.header)}`,
|
|
610
|
+
onClick: (u) => {
|
|
611
|
+
u.stopPropagation(), Pt(a && d ? 0 : r + 1);
|
|
603
612
|
},
|
|
604
613
|
children: a ? "Unpin" : "Pin"
|
|
605
614
|
}
|
|
606
615
|
);
|
|
607
616
|
return /* @__PURE__ */ i(
|
|
608
|
-
|
|
617
|
+
et,
|
|
609
618
|
{
|
|
610
619
|
scope: "col",
|
|
611
|
-
"aria-sort":
|
|
612
|
-
draggable:
|
|
613
|
-
onDragStart: (
|
|
614
|
-
onDragOver: (
|
|
615
|
-
onDrop: (
|
|
620
|
+
"aria-sort": n ? c ? f.direction === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
621
|
+
draggable: E,
|
|
622
|
+
onDragStart: (u) => qe(u, r),
|
|
623
|
+
onDragOver: (u) => Ge(u, r),
|
|
624
|
+
onDrop: (u) => Je(u, r),
|
|
616
625
|
onDragEnd: () => {
|
|
617
|
-
|
|
626
|
+
j(null), V(null);
|
|
618
627
|
},
|
|
619
628
|
ownerState: {
|
|
620
629
|
kind: "data",
|
|
621
|
-
sortable: !!
|
|
622
|
-
sorted: !!
|
|
623
|
-
reorderable:
|
|
624
|
-
dropTarget:
|
|
625
|
-
edgeShadow:
|
|
630
|
+
sortable: !!n,
|
|
631
|
+
sorted: !!c,
|
|
632
|
+
reorderable: E,
|
|
633
|
+
dropTarget: He === r,
|
|
634
|
+
edgeShadow: w && d
|
|
626
635
|
},
|
|
627
|
-
className:
|
|
628
|
-
style:
|
|
629
|
-
children: /* @__PURE__ */
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
/* @__PURE__ */ i(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
] }) : /* @__PURE__ */ i(
|
|
636
|
-
|
|
636
|
+
className: t.headerClassName,
|
|
637
|
+
style: T,
|
|
638
|
+
children: /* @__PURE__ */ x(pe, { ownerState: { align: t.align }, children: [
|
|
639
|
+
t.align === "right" && K,
|
|
640
|
+
n ? /* @__PURE__ */ x(Wr, { type: "button", onClick: () => Ke(t), children: [
|
|
641
|
+
/* @__PURE__ */ i(Ft, { ownerState: { overflow: vt }, children: t.header }),
|
|
642
|
+
C && (f.direction === "asc" ? /* @__PURE__ */ i(tr, { size: 12, weight: "bold" }) : /* @__PURE__ */ i(Ce, { size: 12, weight: "bold" })),
|
|
643
|
+
Q && /* @__PURE__ */ i(Ar, { size: 12 })
|
|
644
|
+
] }) : /* @__PURE__ */ i(Ft, { ownerState: { overflow: vt }, children: t.header }),
|
|
645
|
+
t.align !== "right" && K
|
|
637
646
|
] })
|
|
638
647
|
},
|
|
639
|
-
|
|
648
|
+
t.id
|
|
640
649
|
);
|
|
641
650
|
}),
|
|
642
|
-
|
|
643
|
-
|
|
651
|
+
m && /* @__PURE__ */ i(
|
|
652
|
+
et,
|
|
644
653
|
{
|
|
645
|
-
ownerState: { kind: "actions", actionsShadow:
|
|
646
|
-
style: { width:
|
|
647
|
-
children:
|
|
654
|
+
ownerState: { kind: "actions", actionsShadow: O },
|
|
655
|
+
style: { width: U, minWidth: U, ...Ze },
|
|
656
|
+
children: Se
|
|
648
657
|
}
|
|
649
658
|
)
|
|
650
659
|
] }) }),
|
|
651
|
-
/* @__PURE__ */ i("tbody", { children: h ? /* @__PURE__ */ i(
|
|
652
|
-
const
|
|
653
|
-
return /* @__PURE__ */
|
|
654
|
-
|
|
660
|
+
/* @__PURE__ */ i("tbody", { children: h ? /* @__PURE__ */ i(lr, { rows: 5, columns: Ct }) : y ? /* @__PURE__ */ i(sr, { description: y, colSpan: Ct }) : I.length === 0 ? null : I.map((t, r) => {
|
|
661
|
+
const c = Tt(t, r), a = $.includes(c), d = Ne === c, w = typeof yt == "function" ? yt(t, r) : yt, T = { rowIndex: r, selected: a, hovered: d };
|
|
662
|
+
return /* @__PURE__ */ x(
|
|
663
|
+
Pr,
|
|
655
664
|
{
|
|
656
|
-
ownerState: { selected: a, clickable: !!
|
|
657
|
-
className:
|
|
658
|
-
onMouseEnter: () =>
|
|
659
|
-
onMouseLeave: () =>
|
|
660
|
-
onClick: () =>
|
|
665
|
+
ownerState: { selected: a, clickable: !!Z },
|
|
666
|
+
className: w,
|
|
667
|
+
onMouseEnter: () => Jt(c),
|
|
668
|
+
onMouseLeave: () => Jt(null),
|
|
669
|
+
onClick: () => Z == null ? void 0 : Z(t),
|
|
661
670
|
children: [
|
|
662
|
-
|
|
663
|
-
|
|
671
|
+
P && /* @__PURE__ */ i(
|
|
672
|
+
rt,
|
|
664
673
|
{
|
|
665
|
-
ownerState: { kind: "selection", selected: a, cellTextSize:
|
|
666
|
-
style: { width:
|
|
667
|
-
onClick: (
|
|
668
|
-
children: /* @__PURE__ */ i(
|
|
674
|
+
ownerState: { kind: "selection", selected: a, cellTextSize: X, edgeShadow: M },
|
|
675
|
+
style: { width: A, minWidth: A, ...M ? Mt(0, 14) : {} },
|
|
676
|
+
onClick: (n) => n.stopPropagation(),
|
|
677
|
+
children: /* @__PURE__ */ i(be, { children: /* @__PURE__ */ i(ot, { type: "checkbox", checked: a, onChange: () => ie(c), "aria-label": `Select row ${r + 1}` }) })
|
|
669
678
|
}
|
|
670
679
|
),
|
|
671
680
|
s && /* @__PURE__ */ i(
|
|
672
|
-
|
|
681
|
+
rt,
|
|
673
682
|
{
|
|
674
|
-
ownerState: { kind: "leading", selected: a, cellTextSize:
|
|
683
|
+
ownerState: { kind: "leading", selected: a, cellTextSize: X, edgeShadow: re },
|
|
675
684
|
className: s.className,
|
|
676
685
|
style: {
|
|
677
686
|
width: s.width,
|
|
678
|
-
minWidth: s.minWidth ?? s.width ??
|
|
679
|
-
...
|
|
687
|
+
minWidth: s.minWidth ?? s.width ?? Lt,
|
|
688
|
+
...ee ? Mt(M ? A : 0, 13) : {},
|
|
680
689
|
...s.style
|
|
681
690
|
},
|
|
682
|
-
onClick: G ? (
|
|
683
|
-
children: /* @__PURE__ */
|
|
684
|
-
G && /* @__PURE__ */ i(
|
|
685
|
-
/* @__PURE__ */ i(
|
|
691
|
+
onClick: G ? (n) => n.stopPropagation() : void 0,
|
|
692
|
+
children: /* @__PURE__ */ x(Br, { children: [
|
|
693
|
+
G && /* @__PURE__ */ i(ot, { type: "checkbox", checked: a, onChange: () => ie(c), "aria-label": `Select row ${r + 1}` }),
|
|
694
|
+
/* @__PURE__ */ i(Mr, { children: s.cell(t, T) })
|
|
686
695
|
] })
|
|
687
696
|
}
|
|
688
697
|
),
|
|
689
|
-
|
|
690
|
-
const
|
|
698
|
+
v.map((n, Q) => {
|
|
699
|
+
const C = ge(t, n), K = Q < Dt, u = Q === Dt - 1, _e = typeof gt == "function" ? gt(t, r, n) : gt;
|
|
691
700
|
return /* @__PURE__ */ i(
|
|
692
|
-
|
|
701
|
+
rt,
|
|
693
702
|
{
|
|
694
|
-
ownerState: { kind: "data", selected: a, cellTextSize:
|
|
695
|
-
className:
|
|
703
|
+
ownerState: { kind: "data", selected: a, cellTextSize: X, edgeShadow: K && u },
|
|
704
|
+
className: or(_e, n.className),
|
|
696
705
|
style: {
|
|
697
|
-
width:
|
|
698
|
-
minWidth:
|
|
699
|
-
textAlign:
|
|
700
|
-
...
|
|
701
|
-
...
|
|
706
|
+
width: n.width,
|
|
707
|
+
minWidth: n.minWidth ?? n.width,
|
|
708
|
+
textAlign: n.align,
|
|
709
|
+
...K ? Mt(ne(Q), 12) : {},
|
|
710
|
+
...n.style
|
|
702
711
|
},
|
|
703
|
-
children:
|
|
712
|
+
children: n.cell ? n.cell(t, { value: C, rowIndex: r, selected: a, hovered: d }) : String(C ?? "")
|
|
704
713
|
},
|
|
705
|
-
|
|
714
|
+
n.id
|
|
706
715
|
);
|
|
707
716
|
}),
|
|
708
|
-
|
|
709
|
-
|
|
717
|
+
m && /* @__PURE__ */ i(
|
|
718
|
+
rt,
|
|
710
719
|
{
|
|
711
|
-
ownerState: { kind: "actions", selected: a, cellTextSize:
|
|
712
|
-
style: { width:
|
|
713
|
-
onClick: (
|
|
714
|
-
children:
|
|
720
|
+
ownerState: { kind: "actions", selected: a, cellTextSize: X, actionsShadow: O },
|
|
721
|
+
style: { width: U, minWidth: U, ...Xe },
|
|
722
|
+
onClick: (n) => n.stopPropagation(),
|
|
723
|
+
children: m(t)
|
|
715
724
|
}
|
|
716
725
|
)
|
|
717
726
|
]
|
|
718
727
|
},
|
|
719
|
-
|
|
728
|
+
c
|
|
720
729
|
);
|
|
721
730
|
}) })
|
|
722
731
|
] }),
|
|
723
|
-
!h && !
|
|
732
|
+
!h && !y && I.length === 0 && /* @__PURE__ */ i(Sr, { children: z ?? /* @__PURE__ */ i(nr, { title: ue, description: xe }) })
|
|
724
733
|
] }),
|
|
725
|
-
|
|
734
|
+
Ut && /* @__PURE__ */ i(cr, { ...Ut })
|
|
726
735
|
] });
|
|
727
736
|
}
|
|
728
737
|
export {
|
|
729
|
-
|
|
738
|
+
Xr as DataTable
|
|
730
739
|
};
|
|
731
740
|
//# sourceMappingURL=DataTable.js.map
|