@adapttable/unstyled 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/dist/index.cjs +2452 -815
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2453 -816
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let react_compiler_runtime = require("react-compiler-runtime");
|
|
2
3
|
let _adapttable_core = require("@adapttable/core");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -16,126 +17,314 @@ function selectedValues(value) {
|
|
|
16
17
|
if (value == null || value === "") return [];
|
|
17
18
|
return [String(value)];
|
|
18
19
|
}
|
|
20
|
+
/** Props shared by every per-definition field component. */
|
|
19
21
|
/** `<fieldset>` + `<legend>` wrapper for multi-control fields. */
|
|
20
|
-
function GroupField(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
function GroupField(t0) {
|
|
23
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
24
|
+
const { caption, classNames, children } = t0;
|
|
25
|
+
let t1;
|
|
26
|
+
if ($[0] !== caption || $[1] !== classNames.filterLabel) {
|
|
27
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", {
|
|
25
28
|
"data-adapttable-part": LABEL_PART,
|
|
26
29
|
className: classNames.filterLabel,
|
|
27
30
|
children: caption
|
|
28
|
-
})
|
|
29
|
-
|
|
31
|
+
});
|
|
32
|
+
$[0] = caption;
|
|
33
|
+
$[1] = classNames.filterLabel;
|
|
34
|
+
$[2] = t1;
|
|
35
|
+
} else t1 = $[2];
|
|
36
|
+
let t2;
|
|
37
|
+
if ($[3] !== children || $[4] !== classNames.filterField || $[5] !== t1) {
|
|
38
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
39
|
+
"data-adapttable-part": FIELD_PART,
|
|
40
|
+
className: classNames.filterField,
|
|
41
|
+
children: [t1, children]
|
|
42
|
+
});
|
|
43
|
+
$[3] = children;
|
|
44
|
+
$[4] = classNames.filterField;
|
|
45
|
+
$[5] = t1;
|
|
46
|
+
$[6] = t2;
|
|
47
|
+
} else t2 = $[6];
|
|
48
|
+
return t2;
|
|
30
49
|
}
|
|
31
50
|
/** One input bound to a filter-bag state key (empty text clears it). */
|
|
32
|
-
function BagInput(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
function BagInput(t0) {
|
|
52
|
+
const $ = (0, react_compiler_runtime.c)(11);
|
|
53
|
+
const { source, stateKey, type, placeholder, classNames } = t0;
|
|
54
|
+
const t1 = classNames.filterInput;
|
|
55
|
+
const t2 = source.extra[stateKey];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[0] !== t2) {
|
|
58
|
+
t3 = asText(t2);
|
|
59
|
+
$[0] = t2;
|
|
60
|
+
$[1] = t3;
|
|
61
|
+
} else t3 = $[1];
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[2] !== source || $[3] !== stateKey) {
|
|
64
|
+
t4 = (e) => source.setExtra(stateKey, e.currentTarget.value);
|
|
65
|
+
$[2] = source;
|
|
66
|
+
$[3] = stateKey;
|
|
67
|
+
$[4] = t4;
|
|
68
|
+
} else t4 = $[4];
|
|
69
|
+
let t5;
|
|
70
|
+
if ($[5] !== classNames.filterInput || $[6] !== placeholder || $[7] !== t3 || $[8] !== t4 || $[9] !== type) {
|
|
71
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
72
|
+
type,
|
|
73
|
+
placeholder,
|
|
74
|
+
"data-adapttable-part": "filter-input",
|
|
75
|
+
className: t1,
|
|
76
|
+
value: t3,
|
|
77
|
+
onChange: t4
|
|
78
|
+
});
|
|
79
|
+
$[5] = classNames.filterInput;
|
|
80
|
+
$[6] = placeholder;
|
|
81
|
+
$[7] = t3;
|
|
82
|
+
$[8] = t4;
|
|
83
|
+
$[9] = type;
|
|
84
|
+
$[10] = t5;
|
|
85
|
+
} else t5 = $[10];
|
|
86
|
+
return t5;
|
|
41
87
|
}
|
|
42
|
-
function TextField(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
]
|
|
61
|
-
|
|
88
|
+
function TextField(t0) {
|
|
89
|
+
const $ = (0, react_compiler_runtime.c)(14);
|
|
90
|
+
const { def, source, classNames } = t0;
|
|
91
|
+
const t1 = classNames.filterField;
|
|
92
|
+
const t2 = classNames.filterLabel;
|
|
93
|
+
let t3;
|
|
94
|
+
if ($[0] !== def) {
|
|
95
|
+
t3 = (0, _adapttable_core.filterLabel)(def);
|
|
96
|
+
$[0] = def;
|
|
97
|
+
$[1] = t3;
|
|
98
|
+
} else t3 = $[1];
|
|
99
|
+
let t4;
|
|
100
|
+
if ($[2] !== classNames.filterLabel || $[3] !== t3) {
|
|
101
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
102
|
+
"data-adapttable-part": LABEL_PART,
|
|
103
|
+
className: t2,
|
|
104
|
+
children: t3
|
|
105
|
+
});
|
|
106
|
+
$[2] = classNames.filterLabel;
|
|
107
|
+
$[3] = t3;
|
|
108
|
+
$[4] = t4;
|
|
109
|
+
} else t4 = $[4];
|
|
110
|
+
let t5;
|
|
111
|
+
if ($[5] !== classNames || $[6] !== def.key || $[7] !== def.placeholder || $[8] !== source) {
|
|
112
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BagInput, {
|
|
113
|
+
source,
|
|
114
|
+
stateKey: def.key,
|
|
115
|
+
type: "text",
|
|
116
|
+
placeholder: def.placeholder,
|
|
117
|
+
classNames
|
|
118
|
+
});
|
|
119
|
+
$[5] = classNames;
|
|
120
|
+
$[6] = def.key;
|
|
121
|
+
$[7] = def.placeholder;
|
|
122
|
+
$[8] = source;
|
|
123
|
+
$[9] = t5;
|
|
124
|
+
} else t5 = $[9];
|
|
125
|
+
let t6;
|
|
126
|
+
if ($[10] !== classNames.filterField || $[11] !== t4 || $[12] !== t5) {
|
|
127
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
128
|
+
"data-adapttable-part": FIELD_PART,
|
|
129
|
+
className: t1,
|
|
130
|
+
children: [
|
|
131
|
+
t4,
|
|
132
|
+
" ",
|
|
133
|
+
t5
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
$[10] = classNames.filterField;
|
|
137
|
+
$[11] = t4;
|
|
138
|
+
$[12] = t5;
|
|
139
|
+
$[13] = t6;
|
|
140
|
+
} else t6 = $[13];
|
|
141
|
+
return t6;
|
|
62
142
|
}
|
|
63
|
-
function SelectField(
|
|
143
|
+
function SelectField(t0) {
|
|
144
|
+
const $ = (0, react_compiler_runtime.c)(22);
|
|
145
|
+
const { def, source, classNames } = t0;
|
|
64
146
|
const { options, loading } = (0, _adapttable_core.useFilterOptions)(def);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
147
|
+
const t1 = classNames.filterField;
|
|
148
|
+
const t2 = classNames.filterLabel;
|
|
149
|
+
let t3;
|
|
150
|
+
if ($[0] !== def) {
|
|
151
|
+
t3 = (0, _adapttable_core.filterLabel)(def);
|
|
152
|
+
$[0] = def;
|
|
153
|
+
$[1] = t3;
|
|
154
|
+
} else t3 = $[1];
|
|
155
|
+
let t4;
|
|
156
|
+
if ($[2] !== classNames.filterLabel || $[3] !== t3) {
|
|
157
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
158
|
+
"data-adapttable-part": LABEL_PART,
|
|
159
|
+
className: t2,
|
|
160
|
+
children: t3
|
|
161
|
+
});
|
|
162
|
+
$[2] = classNames.filterLabel;
|
|
163
|
+
$[3] = t3;
|
|
164
|
+
$[4] = t4;
|
|
165
|
+
} else t4 = $[4];
|
|
166
|
+
const t5 = classNames.filterSelect;
|
|
167
|
+
const t6 = source.extra[def.key];
|
|
168
|
+
let t7;
|
|
169
|
+
if ($[5] !== t6) {
|
|
170
|
+
t7 = asText(t6);
|
|
171
|
+
$[5] = t6;
|
|
172
|
+
$[6] = t7;
|
|
173
|
+
} else t7 = $[6];
|
|
174
|
+
let t8;
|
|
175
|
+
if ($[7] !== def.key || $[8] !== source) {
|
|
176
|
+
t8 = (e) => source.setExtra(def.key, e.currentTarget.value);
|
|
177
|
+
$[7] = def.key;
|
|
178
|
+
$[8] = source;
|
|
179
|
+
$[9] = t8;
|
|
180
|
+
} else t8 = $[9];
|
|
181
|
+
let t9;
|
|
182
|
+
if ($[10] !== loading || $[11] !== options) {
|
|
183
|
+
t9 = loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
184
|
+
value: "",
|
|
185
|
+
disabled: true,
|
|
186
|
+
children: "…"
|
|
187
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
188
|
+
value: "",
|
|
189
|
+
children: "All"
|
|
190
|
+
}), options.map(_temp$3)] });
|
|
191
|
+
$[10] = loading;
|
|
192
|
+
$[11] = options;
|
|
193
|
+
$[12] = t9;
|
|
194
|
+
} else t9 = $[12];
|
|
195
|
+
let t10;
|
|
196
|
+
if ($[13] !== classNames.filterSelect || $[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
|
|
197
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
198
|
+
"data-adapttable-part": "filter-select",
|
|
199
|
+
className: t5,
|
|
200
|
+
value: t7,
|
|
201
|
+
onChange: t8,
|
|
202
|
+
children: t9
|
|
203
|
+
});
|
|
204
|
+
$[13] = classNames.filterSelect;
|
|
205
|
+
$[14] = t7;
|
|
206
|
+
$[15] = t8;
|
|
207
|
+
$[16] = t9;
|
|
208
|
+
$[17] = t10;
|
|
209
|
+
} else t10 = $[17];
|
|
210
|
+
let t11;
|
|
211
|
+
if ($[18] !== classNames.filterField || $[19] !== t10 || $[20] !== t4) {
|
|
212
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
213
|
+
"data-adapttable-part": FIELD_PART,
|
|
214
|
+
className: t1,
|
|
215
|
+
children: [
|
|
216
|
+
t4,
|
|
217
|
+
" ",
|
|
218
|
+
t10
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
$[18] = classNames.filterField;
|
|
222
|
+
$[19] = t10;
|
|
223
|
+
$[20] = t4;
|
|
224
|
+
$[21] = t11;
|
|
225
|
+
} else t11 = $[21];
|
|
226
|
+
return t11;
|
|
227
|
+
}
|
|
228
|
+
function _temp$3(option) {
|
|
229
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
230
|
+
value: option.value,
|
|
231
|
+
children: option.label
|
|
232
|
+
}, option.value);
|
|
233
|
+
}
|
|
234
|
+
function MultiSelectField(t0) {
|
|
235
|
+
const $ = (0, react_compiler_runtime.c)(10);
|
|
236
|
+
const { def, source, classNames } = t0;
|
|
237
|
+
const selected = selectedValues(source.extra[def.key]);
|
|
238
|
+
const { options, loading } = (0, _adapttable_core.useFilterOptions)(def);
|
|
239
|
+
const T0 = GroupField;
|
|
240
|
+
let t1;
|
|
241
|
+
if ($[0] !== def) {
|
|
242
|
+
t1 = (0, _adapttable_core.filterLabel)(def);
|
|
243
|
+
$[0] = def;
|
|
244
|
+
$[1] = t1;
|
|
245
|
+
} else t1 = $[1];
|
|
246
|
+
const t2 = "filter-checkbox-group";
|
|
247
|
+
const t3 = loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
248
|
+
"data-adapttable-part": "filter-options-loading",
|
|
249
|
+
className: classNames.filterOptionsLoading,
|
|
250
|
+
children: "…"
|
|
251
|
+
}) : options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
252
|
+
"data-adapttable-part": "filter-checkbox",
|
|
253
|
+
className: classNames.filterCheckbox,
|
|
68
254
|
children: [
|
|
69
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
255
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
256
|
+
type: "checkbox",
|
|
257
|
+
checked: selected.includes(option.value),
|
|
258
|
+
onChange: (e) => source.setExtra(def.key, e.currentTarget.checked ? [...selected, option.value] : selected.filter((v) => v !== option.value))
|
|
73
259
|
}),
|
|
74
260
|
" ",
|
|
75
|
-
|
|
76
|
-
"data-adapttable-part": "filter-select",
|
|
77
|
-
className: classNames.filterSelect,
|
|
78
|
-
value: asText(source.extra[def.key]),
|
|
79
|
-
onChange: (e) => source.setExtra(def.key, e.currentTarget.value),
|
|
80
|
-
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
81
|
-
value: "",
|
|
82
|
-
disabled: true,
|
|
83
|
-
children: "…"
|
|
84
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
85
|
-
value: "",
|
|
86
|
-
children: "All"
|
|
87
|
-
}), options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
88
|
-
value: option.value,
|
|
89
|
-
children: option.label
|
|
90
|
-
}, option.value))] })
|
|
91
|
-
})
|
|
261
|
+
option.label
|
|
92
262
|
]
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupField, {
|
|
99
|
-
caption: (0, _adapttable_core.filterLabel)(def),
|
|
100
|
-
classNames,
|
|
101
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
102
|
-
"data-adapttable-part": "filter-checkbox-group",
|
|
263
|
+
}, option.value));
|
|
264
|
+
let t4;
|
|
265
|
+
if ($[2] !== classNames.filterCheckboxGroup || $[3] !== t3) {
|
|
266
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
267
|
+
"data-adapttable-part": t2,
|
|
103
268
|
className: classNames.filterCheckboxGroup,
|
|
104
|
-
children:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
269
|
+
children: t3
|
|
270
|
+
});
|
|
271
|
+
$[2] = classNames.filterCheckboxGroup;
|
|
272
|
+
$[3] = t3;
|
|
273
|
+
$[4] = t4;
|
|
274
|
+
} else t4 = $[4];
|
|
275
|
+
let t5;
|
|
276
|
+
if ($[5] !== T0 || $[6] !== classNames || $[7] !== t1 || $[8] !== t4) {
|
|
277
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(T0, {
|
|
278
|
+
caption: t1,
|
|
279
|
+
classNames,
|
|
280
|
+
children: t4
|
|
281
|
+
});
|
|
282
|
+
$[5] = T0;
|
|
283
|
+
$[6] = classNames;
|
|
284
|
+
$[7] = t1;
|
|
285
|
+
$[8] = t4;
|
|
286
|
+
$[9] = t5;
|
|
287
|
+
} else t5 = $[9];
|
|
288
|
+
return t5;
|
|
123
289
|
}
|
|
124
290
|
/** One bound of a range widget; the parent owns the write-through. */
|
|
125
|
-
function RangeValueInput(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
291
|
+
function RangeValueInput(t0) {
|
|
292
|
+
const $ = (0, react_compiler_runtime.c)(9);
|
|
293
|
+
const { type, label, value, onValue, classNames } = t0;
|
|
294
|
+
let t1;
|
|
295
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
296
|
+
t1 = {
|
|
129
297
|
flex: "1 1 7rem",
|
|
130
298
|
minWidth: "7rem"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
value
|
|
137
|
-
|
|
138
|
-
|
|
299
|
+
};
|
|
300
|
+
$[0] = t1;
|
|
301
|
+
} else t1 = $[0];
|
|
302
|
+
let t2;
|
|
303
|
+
if ($[1] !== onValue) {
|
|
304
|
+
t2 = (e) => onValue(e.currentTarget.value);
|
|
305
|
+
$[1] = onValue;
|
|
306
|
+
$[2] = t2;
|
|
307
|
+
} else t2 = $[2];
|
|
308
|
+
let t3;
|
|
309
|
+
if ($[3] !== classNames.filterInput || $[4] !== label || $[5] !== t2 || $[6] !== type || $[7] !== value) {
|
|
310
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
311
|
+
type,
|
|
312
|
+
style: t1,
|
|
313
|
+
placeholder: label,
|
|
314
|
+
"aria-label": label,
|
|
315
|
+
"data-adapttable-part": "filter-input",
|
|
316
|
+
className: classNames.filterInput,
|
|
317
|
+
value,
|
|
318
|
+
onChange: t2
|
|
319
|
+
});
|
|
320
|
+
$[3] = classNames.filterInput;
|
|
321
|
+
$[4] = label;
|
|
322
|
+
$[5] = t2;
|
|
323
|
+
$[6] = type;
|
|
324
|
+
$[7] = value;
|
|
325
|
+
$[8] = t3;
|
|
326
|
+
} else t3 = $[8];
|
|
327
|
+
return t3;
|
|
139
328
|
}
|
|
140
329
|
/**
|
|
141
330
|
* Operator-first range field: a comparison `<select>` (its placeholder
|
|
@@ -143,105 +332,284 @@ function RangeValueInput({ type, label, value, onValue, classNames }) {
|
|
|
143
332
|
* pair for `between`. The persisted state stays the inclusive
|
|
144
333
|
* `<key><start>` / `<key><end>` pair, written through `setExtras`.
|
|
145
334
|
*/
|
|
146
|
-
function RangeField(
|
|
335
|
+
function RangeField(t0) {
|
|
336
|
+
const $ = (0, react_compiler_runtime.c)(56);
|
|
337
|
+
const { def, source, classNames, inputType, suffixes, labels } = t0;
|
|
147
338
|
const lowKey = def.key + suffixes.start;
|
|
148
339
|
const highKey = def.key + suffixes.end;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
340
|
+
let t1;
|
|
341
|
+
if ($[0] !== highKey || $[1] !== lowKey || $[2] !== source.extra) {
|
|
342
|
+
t1 = () => (0, _adapttable_core.readRangeWidget)(source.extra, lowKey, highKey).op;
|
|
343
|
+
$[0] = highKey;
|
|
344
|
+
$[1] = lowKey;
|
|
345
|
+
$[2] = source.extra;
|
|
346
|
+
$[3] = t1;
|
|
347
|
+
} else t1 = $[3];
|
|
348
|
+
const [op, setOp] = (0, react.useState)(t1);
|
|
349
|
+
const t2 = source.extra[op === "lte" ? highKey : lowKey];
|
|
350
|
+
let t3;
|
|
351
|
+
if ($[4] !== t2) {
|
|
352
|
+
t3 = asText(t2);
|
|
353
|
+
$[4] = t2;
|
|
354
|
+
$[5] = t3;
|
|
355
|
+
} else t3 = $[5];
|
|
356
|
+
const a = t3;
|
|
357
|
+
const t4 = source.extra[highKey];
|
|
358
|
+
let t5;
|
|
359
|
+
if ($[6] !== t4) {
|
|
360
|
+
t5 = asText(t4);
|
|
361
|
+
$[6] = t4;
|
|
362
|
+
$[7] = t5;
|
|
363
|
+
} else t5 = $[7];
|
|
364
|
+
const b = t5;
|
|
365
|
+
let t6;
|
|
366
|
+
if ($[8] !== highKey || $[9] !== lowKey || $[10] !== source) {
|
|
367
|
+
t6 = (nextOp, nextA, nextB) => source.setExtras((0, _adapttable_core.writeRangeWidget)(nextOp, nextA, nextB, lowKey, highKey));
|
|
368
|
+
$[8] = highKey;
|
|
369
|
+
$[9] = lowKey;
|
|
370
|
+
$[10] = source;
|
|
371
|
+
$[11] = t6;
|
|
372
|
+
} else t6 = $[11];
|
|
373
|
+
const write = t6;
|
|
153
374
|
const opLabelKeys = _adapttable_core.RANGE_OP_LABEL_KEYS[inputType];
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})] }),
|
|
199
|
-
op !== void 0 && op !== "between" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeValueInput, {
|
|
200
|
-
type: inputType,
|
|
201
|
-
label: labels.value,
|
|
202
|
-
value: a,
|
|
203
|
-
onValue: (next) => write(op, next, ""),
|
|
204
|
-
classNames
|
|
205
|
-
})
|
|
206
|
-
]
|
|
207
|
-
})
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function FilterField({ def, source, classNames, labels }) {
|
|
211
|
-
switch (def.type) {
|
|
212
|
-
case "text": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
213
|
-
def,
|
|
214
|
-
source,
|
|
215
|
-
classNames
|
|
375
|
+
let t7;
|
|
376
|
+
if ($[12] !== def) {
|
|
377
|
+
t7 = (0, _adapttable_core.filterLabel)(def);
|
|
378
|
+
$[12] = def;
|
|
379
|
+
$[13] = t7;
|
|
380
|
+
} else t7 = $[13];
|
|
381
|
+
let t8;
|
|
382
|
+
let t9;
|
|
383
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
384
|
+
t8 = {
|
|
385
|
+
display: "flex",
|
|
386
|
+
flexWrap: "wrap",
|
|
387
|
+
gap: 8
|
|
388
|
+
};
|
|
389
|
+
t9 = {
|
|
390
|
+
flex: "0 0 8.5rem",
|
|
391
|
+
width: "8.5rem"
|
|
392
|
+
};
|
|
393
|
+
$[14] = t8;
|
|
394
|
+
$[15] = t9;
|
|
395
|
+
} else {
|
|
396
|
+
t8 = $[14];
|
|
397
|
+
t9 = $[15];
|
|
398
|
+
}
|
|
399
|
+
const t10 = labels.operator;
|
|
400
|
+
const t11 = classNames.filterOperator;
|
|
401
|
+
const t12 = op ?? "";
|
|
402
|
+
let t13;
|
|
403
|
+
if ($[16] !== a || $[17] !== b || $[18] !== write) {
|
|
404
|
+
t13 = (e) => {
|
|
405
|
+
const next = _adapttable_core.RANGE_OPS.find((o) => o === e.currentTarget.value);
|
|
406
|
+
setOp(next);
|
|
407
|
+
write(next, a, b);
|
|
408
|
+
};
|
|
409
|
+
$[16] = a;
|
|
410
|
+
$[17] = b;
|
|
411
|
+
$[18] = write;
|
|
412
|
+
$[19] = t13;
|
|
413
|
+
} else t13 = $[19];
|
|
414
|
+
let t14;
|
|
415
|
+
if ($[20] !== labels.operator) {
|
|
416
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
417
|
+
value: "",
|
|
418
|
+
children: labels.operator
|
|
216
419
|
});
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
420
|
+
$[20] = labels.operator;
|
|
421
|
+
$[21] = t14;
|
|
422
|
+
} else t14 = $[21];
|
|
423
|
+
let t15;
|
|
424
|
+
if ($[22] !== labels || $[23] !== opLabelKeys) {
|
|
425
|
+
t15 = _adapttable_core.RANGE_OPS.map((o_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
426
|
+
value: o_0,
|
|
427
|
+
children: labels[opLabelKeys[o_0]]
|
|
428
|
+
}, o_0));
|
|
429
|
+
$[22] = labels;
|
|
430
|
+
$[23] = opLabelKeys;
|
|
431
|
+
$[24] = t15;
|
|
432
|
+
} else t15 = $[24];
|
|
433
|
+
let t16;
|
|
434
|
+
if ($[25] !== classNames.filterOperator || $[26] !== labels.operator || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15) {
|
|
435
|
+
t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
436
|
+
style: t9,
|
|
437
|
+
"aria-label": t10,
|
|
438
|
+
"data-adapttable-part": "filter-operator",
|
|
439
|
+
className: t11,
|
|
440
|
+
value: t12,
|
|
441
|
+
onChange: t13,
|
|
442
|
+
children: [t14, t15]
|
|
221
443
|
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
444
|
+
$[25] = classNames.filterOperator;
|
|
445
|
+
$[26] = labels.operator;
|
|
446
|
+
$[27] = t12;
|
|
447
|
+
$[28] = t13;
|
|
448
|
+
$[29] = t14;
|
|
449
|
+
$[30] = t15;
|
|
450
|
+
$[31] = t16;
|
|
451
|
+
} else t16 = $[31];
|
|
452
|
+
let t17;
|
|
453
|
+
if ($[32] !== a || $[33] !== b || $[34] !== classNames || $[35] !== inputType || $[36] !== labels.from || $[37] !== labels.to || $[38] !== op || $[39] !== write) {
|
|
454
|
+
t17 = op === "between" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeValueInput, {
|
|
455
|
+
type: inputType,
|
|
456
|
+
label: labels.from,
|
|
457
|
+
value: a,
|
|
458
|
+
onValue: (next_0) => write(op, next_0, b),
|
|
459
|
+
classNames
|
|
460
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeValueInput, {
|
|
461
|
+
type: inputType,
|
|
462
|
+
label: labels.to,
|
|
463
|
+
value: b,
|
|
464
|
+
onValue: (next_1) => write(op, a, next_1),
|
|
465
|
+
classNames
|
|
466
|
+
})] });
|
|
467
|
+
$[32] = a;
|
|
468
|
+
$[33] = b;
|
|
469
|
+
$[34] = classNames;
|
|
470
|
+
$[35] = inputType;
|
|
471
|
+
$[36] = labels.from;
|
|
472
|
+
$[37] = labels.to;
|
|
473
|
+
$[38] = op;
|
|
474
|
+
$[39] = write;
|
|
475
|
+
$[40] = t17;
|
|
476
|
+
} else t17 = $[40];
|
|
477
|
+
let t18;
|
|
478
|
+
if ($[41] !== a || $[42] !== classNames || $[43] !== inputType || $[44] !== labels.value || $[45] !== op || $[46] !== write) {
|
|
479
|
+
t18 = op !== void 0 && op !== "between" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeValueInput, {
|
|
480
|
+
type: inputType,
|
|
481
|
+
label: labels.value,
|
|
482
|
+
value: a,
|
|
483
|
+
onValue: (next_2) => write(op, next_2, ""),
|
|
225
484
|
classNames
|
|
226
485
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
486
|
+
$[41] = a;
|
|
487
|
+
$[42] = classNames;
|
|
488
|
+
$[43] = inputType;
|
|
489
|
+
$[44] = labels.value;
|
|
490
|
+
$[45] = op;
|
|
491
|
+
$[46] = write;
|
|
492
|
+
$[47] = t18;
|
|
493
|
+
} else t18 = $[47];
|
|
494
|
+
let t19;
|
|
495
|
+
if ($[48] !== t16 || $[49] !== t17 || $[50] !== t18) {
|
|
496
|
+
t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
497
|
+
style: t8,
|
|
498
|
+
children: [
|
|
499
|
+
t16,
|
|
500
|
+
t17,
|
|
501
|
+
t18
|
|
502
|
+
]
|
|
234
503
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
504
|
+
$[48] = t16;
|
|
505
|
+
$[49] = t17;
|
|
506
|
+
$[50] = t18;
|
|
507
|
+
$[51] = t19;
|
|
508
|
+
} else t19 = $[51];
|
|
509
|
+
let t20;
|
|
510
|
+
if ($[52] !== classNames || $[53] !== t19 || $[54] !== t7) {
|
|
511
|
+
t20 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupField, {
|
|
512
|
+
caption: t7,
|
|
238
513
|
classNames,
|
|
239
|
-
|
|
240
|
-
suffixes: _adapttable_core.RANGE_SUFFIXES.numberRange,
|
|
241
|
-
labels
|
|
514
|
+
children: t19
|
|
242
515
|
});
|
|
516
|
+
$[52] = classNames;
|
|
517
|
+
$[53] = t19;
|
|
518
|
+
$[54] = t7;
|
|
519
|
+
$[55] = t20;
|
|
520
|
+
} else t20 = $[55];
|
|
521
|
+
return t20;
|
|
522
|
+
}
|
|
523
|
+
function FilterField(t0) {
|
|
524
|
+
const $ = (0, react_compiler_runtime.c)(22);
|
|
525
|
+
const { def, source, classNames, labels } = t0;
|
|
526
|
+
switch (def.type) {
|
|
527
|
+
case "text": {
|
|
528
|
+
let t1;
|
|
529
|
+
if ($[0] !== classNames || $[1] !== def || $[2] !== source) {
|
|
530
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
531
|
+
def,
|
|
532
|
+
source,
|
|
533
|
+
classNames
|
|
534
|
+
});
|
|
535
|
+
$[0] = classNames;
|
|
536
|
+
$[1] = def;
|
|
537
|
+
$[2] = source;
|
|
538
|
+
$[3] = t1;
|
|
539
|
+
} else t1 = $[3];
|
|
540
|
+
return t1;
|
|
541
|
+
}
|
|
542
|
+
case "select": {
|
|
543
|
+
let t1;
|
|
544
|
+
if ($[4] !== classNames || $[5] !== def || $[6] !== source) {
|
|
545
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectField, {
|
|
546
|
+
def,
|
|
547
|
+
source,
|
|
548
|
+
classNames
|
|
549
|
+
});
|
|
550
|
+
$[4] = classNames;
|
|
551
|
+
$[5] = def;
|
|
552
|
+
$[6] = source;
|
|
553
|
+
$[7] = t1;
|
|
554
|
+
} else t1 = $[7];
|
|
555
|
+
return t1;
|
|
556
|
+
}
|
|
557
|
+
case "multiSelect": {
|
|
558
|
+
let t1;
|
|
559
|
+
if ($[8] !== classNames || $[9] !== def || $[10] !== source) {
|
|
560
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MultiSelectField, {
|
|
561
|
+
def,
|
|
562
|
+
source,
|
|
563
|
+
classNames
|
|
564
|
+
});
|
|
565
|
+
$[8] = classNames;
|
|
566
|
+
$[9] = def;
|
|
567
|
+
$[10] = source;
|
|
568
|
+
$[11] = t1;
|
|
569
|
+
} else t1 = $[11];
|
|
570
|
+
return t1;
|
|
571
|
+
}
|
|
572
|
+
case "dateRange": {
|
|
573
|
+
let t1;
|
|
574
|
+
if ($[12] !== classNames || $[13] !== def || $[14] !== labels || $[15] !== source) {
|
|
575
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeField, {
|
|
576
|
+
def,
|
|
577
|
+
source,
|
|
578
|
+
classNames,
|
|
579
|
+
inputType: "date",
|
|
580
|
+
suffixes: _adapttable_core.RANGE_SUFFIXES.dateRange,
|
|
581
|
+
labels
|
|
582
|
+
});
|
|
583
|
+
$[12] = classNames;
|
|
584
|
+
$[13] = def;
|
|
585
|
+
$[14] = labels;
|
|
586
|
+
$[15] = source;
|
|
587
|
+
$[16] = t1;
|
|
588
|
+
} else t1 = $[16];
|
|
589
|
+
return t1;
|
|
590
|
+
}
|
|
591
|
+
case "numberRange": {
|
|
592
|
+
let t1;
|
|
593
|
+
if ($[17] !== classNames || $[18] !== def || $[19] !== labels || $[20] !== source) {
|
|
594
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeField, {
|
|
595
|
+
def,
|
|
596
|
+
source,
|
|
597
|
+
classNames,
|
|
598
|
+
inputType: "number",
|
|
599
|
+
suffixes: _adapttable_core.RANGE_SUFFIXES.numberRange,
|
|
600
|
+
labels
|
|
601
|
+
});
|
|
602
|
+
$[17] = classNames;
|
|
603
|
+
$[18] = def;
|
|
604
|
+
$[19] = labels;
|
|
605
|
+
$[20] = source;
|
|
606
|
+
$[21] = t1;
|
|
607
|
+
} else t1 = $[21];
|
|
608
|
+
return t1;
|
|
609
|
+
}
|
|
243
610
|
}
|
|
244
611
|
}
|
|
612
|
+
/** Props for {@link AutoFilterForm}. */
|
|
245
613
|
/**
|
|
246
614
|
* The auto-built filter form for the declarative `filters` array: one
|
|
247
615
|
* semantic field per definition (`text` input, `select` with an "All"
|
|
@@ -252,14 +620,52 @@ function FilterField({ def, source, classNames, labels }) {
|
|
|
252
620
|
*
|
|
253
621
|
* @typeParam TRow - The row type.
|
|
254
622
|
*/
|
|
255
|
-
function AutoFilterForm(
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
623
|
+
function AutoFilterForm(t0) {
|
|
624
|
+
const $ = (0, react_compiler_runtime.c)(15);
|
|
625
|
+
const { defs, source, classNames: t1, labels } = t0;
|
|
626
|
+
let t2;
|
|
627
|
+
if ($[0] !== t1) {
|
|
628
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
629
|
+
$[0] = t1;
|
|
630
|
+
$[1] = t2;
|
|
631
|
+
} else t2 = $[1];
|
|
632
|
+
const classNames = t2;
|
|
633
|
+
let t3;
|
|
634
|
+
if ($[2] !== labels) {
|
|
635
|
+
t3 = (0, _adapttable_core.resolveLabels)(labels);
|
|
636
|
+
$[2] = labels;
|
|
637
|
+
$[3] = t3;
|
|
638
|
+
} else t3 = $[3];
|
|
639
|
+
const resolvedLabels = t3;
|
|
640
|
+
let t4;
|
|
641
|
+
if ($[4] !== classNames || $[5] !== defs || $[6] !== resolvedLabels || $[7] !== source) {
|
|
642
|
+
let t5;
|
|
643
|
+
if ($[9] !== classNames || $[10] !== resolvedLabels || $[11] !== source) {
|
|
644
|
+
t5 = (def) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterField, {
|
|
645
|
+
def,
|
|
646
|
+
source,
|
|
647
|
+
classNames,
|
|
648
|
+
labels: resolvedLabels
|
|
649
|
+
}, def.key);
|
|
650
|
+
$[9] = classNames;
|
|
651
|
+
$[10] = resolvedLabels;
|
|
652
|
+
$[11] = source;
|
|
653
|
+
$[12] = t5;
|
|
654
|
+
} else t5 = $[12];
|
|
655
|
+
t4 = defs.map(t5);
|
|
656
|
+
$[4] = classNames;
|
|
657
|
+
$[5] = defs;
|
|
658
|
+
$[6] = resolvedLabels;
|
|
659
|
+
$[7] = source;
|
|
660
|
+
$[8] = t4;
|
|
661
|
+
} else t4 = $[8];
|
|
662
|
+
let t5;
|
|
663
|
+
if ($[13] !== t4) {
|
|
664
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t4 });
|
|
665
|
+
$[13] = t4;
|
|
666
|
+
$[14] = t5;
|
|
667
|
+
} else t5 = $[14];
|
|
668
|
+
return t5;
|
|
263
669
|
}
|
|
264
670
|
//#endregion
|
|
265
671
|
//#region src/cx.ts
|
|
@@ -275,6 +681,7 @@ function cx(...parts) {
|
|
|
275
681
|
}
|
|
276
682
|
//#endregion
|
|
277
683
|
//#region src/components/FilterPanel.tsx
|
|
684
|
+
/** Props for {@link FilterPanel}. */
|
|
278
685
|
/** Backdrop + side drawer for caller-provided filter widgets. */
|
|
279
686
|
function FilterPanel({ open, onClose, filters, activeFilterCount, onClearFilters, labels, dir = "ltr", classNames }) {
|
|
280
687
|
const panelRef = (0, react.useRef)(null);
|
|
@@ -366,6 +773,7 @@ function FilterPanel({ open, onClose, filters, activeFilterCount, onClearFilters
|
|
|
366
773
|
}
|
|
367
774
|
//#endregion
|
|
368
775
|
//#region src/components/FilterPopover.tsx
|
|
776
|
+
/** Props for {@link FilterPopover}. */
|
|
369
777
|
/**
|
|
370
778
|
* Anchored filter card (the default filter container). Opens beneath the
|
|
371
779
|
* Filters button with NO backdrop — the background stays visible and
|
|
@@ -385,8 +793,8 @@ function FilterPopover({ open, onClose, filters, activeFilterCount, onClearFilte
|
|
|
385
793
|
if (cardRef.current?.contains(document.activeElement)) return;
|
|
386
794
|
onCloseRef.current();
|
|
387
795
|
};
|
|
388
|
-
const onKeyDown = (
|
|
389
|
-
if (
|
|
796
|
+
const onKeyDown = (event_0) => {
|
|
797
|
+
if (event_0.key !== "Escape") return;
|
|
390
798
|
onCloseRef.current();
|
|
391
799
|
rootRef.current?.querySelector("button")?.focus();
|
|
392
800
|
};
|
|
@@ -442,45 +850,104 @@ function FilterPopover({ open, onClose, filters, activeFilterCount, onClearFilte
|
|
|
442
850
|
}
|
|
443
851
|
//#endregion
|
|
444
852
|
//#region src/components/icons.tsx
|
|
445
|
-
function Svg(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
853
|
+
function Svg(t0) {
|
|
854
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
855
|
+
const { size: t1, className, children } = t0;
|
|
856
|
+
const size = t1 === void 0 ? 16 : t1;
|
|
857
|
+
let t2;
|
|
858
|
+
if ($[0] !== children || $[1] !== className || $[2] !== size) {
|
|
859
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
860
|
+
width: size,
|
|
861
|
+
height: size,
|
|
862
|
+
viewBox: "0 0 24 24",
|
|
863
|
+
fill: "none",
|
|
864
|
+
stroke: "currentColor",
|
|
865
|
+
strokeWidth: 2,
|
|
866
|
+
strokeLinecap: "round",
|
|
867
|
+
strokeLinejoin: "round",
|
|
868
|
+
className,
|
|
869
|
+
"aria-hidden": "true",
|
|
870
|
+
focusable: "false",
|
|
871
|
+
children
|
|
872
|
+
});
|
|
873
|
+
$[0] = children;
|
|
874
|
+
$[1] = className;
|
|
875
|
+
$[2] = size;
|
|
876
|
+
$[3] = t2;
|
|
877
|
+
} else t2 = $[3];
|
|
878
|
+
return t2;
|
|
460
879
|
}
|
|
461
880
|
/** Magnifying-glass search glyph (inline SVG, `currentColor`). */
|
|
462
|
-
const SearchIcon = (p) =>
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
881
|
+
const SearchIcon = (p) => {
|
|
882
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
883
|
+
let t0;
|
|
884
|
+
let t1;
|
|
885
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
886
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
887
|
+
cx: "11",
|
|
888
|
+
cy: "11",
|
|
889
|
+
r: "7"
|
|
890
|
+
});
|
|
891
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m21 21-4.3-4.3" });
|
|
892
|
+
$[0] = t0;
|
|
893
|
+
$[1] = t1;
|
|
894
|
+
} else {
|
|
895
|
+
t0 = $[0];
|
|
896
|
+
t1 = $[1];
|
|
897
|
+
}
|
|
898
|
+
let t2;
|
|
899
|
+
if ($[2] !== p) {
|
|
900
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Svg, {
|
|
901
|
+
...p,
|
|
902
|
+
children: [t0, t1]
|
|
903
|
+
});
|
|
904
|
+
$[2] = p;
|
|
905
|
+
$[3] = t2;
|
|
906
|
+
} else t2 = $[3];
|
|
907
|
+
return t2;
|
|
908
|
+
};
|
|
470
909
|
/** Funnel glyph for the Filters button (inline SVG, `currentColor`). */
|
|
471
|
-
const FiltersIcon = (p) =>
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
910
|
+
const FiltersIcon = (p) => {
|
|
911
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
912
|
+
let t0;
|
|
913
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
914
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 4h18l-7 8v6l-4 2v-8L3 4Z" });
|
|
915
|
+
$[0] = t0;
|
|
916
|
+
} else t0 = $[0];
|
|
917
|
+
let t1;
|
|
918
|
+
if ($[1] !== p) {
|
|
919
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
920
|
+
...p,
|
|
921
|
+
children: t0
|
|
922
|
+
});
|
|
923
|
+
$[1] = p;
|
|
924
|
+
$[2] = t1;
|
|
925
|
+
} else t1 = $[2];
|
|
926
|
+
return t1;
|
|
927
|
+
};
|
|
475
928
|
/**
|
|
476
929
|
* Right-pointing chevron (▸) for the expand-row button. The button carries a
|
|
477
930
|
* `data-expanded` attribute so consumers rotate the glyph with their own CSS
|
|
478
931
|
* (e.g. `[data-expanded] svg { transform: rotate(90deg) }`).
|
|
479
932
|
*/
|
|
480
|
-
const ChevronIcon = (p) =>
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
933
|
+
const ChevronIcon = (p) => {
|
|
934
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
935
|
+
let t0;
|
|
936
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
937
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m9 6 6 6-6 6" });
|
|
938
|
+
$[0] = t0;
|
|
939
|
+
} else t0 = $[0];
|
|
940
|
+
let t1;
|
|
941
|
+
if ($[1] !== p) {
|
|
942
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
943
|
+
...p,
|
|
944
|
+
children: t0
|
|
945
|
+
});
|
|
946
|
+
$[1] = p;
|
|
947
|
+
$[2] = t1;
|
|
948
|
+
} else t1 = $[2];
|
|
949
|
+
return t1;
|
|
950
|
+
};
|
|
484
951
|
//#endregion
|
|
485
952
|
//#region src/components/menuPopover.ts
|
|
486
953
|
/**
|
|
@@ -497,41 +964,62 @@ const MENU_PANEL_STYLE = {
|
|
|
497
964
|
padding: 0,
|
|
498
965
|
minInlineSize: 0
|
|
499
966
|
};
|
|
967
|
+
/** Disclosure state shared by the toolbar menu popovers. */
|
|
500
968
|
/**
|
|
501
969
|
* Disclosure behaviour for the toolbar menus (ColumnMenu, SavedViewsMenu):
|
|
502
970
|
* open/close state that also closes on outside mousedown or Escape, with
|
|
503
971
|
* Escape restoring focus to the trigger.
|
|
504
972
|
*/
|
|
505
973
|
function useMenuPopover() {
|
|
974
|
+
const $ = (0, react_compiler_runtime.c)(5);
|
|
506
975
|
const [open, setOpen] = (0, react.useState)(false);
|
|
507
976
|
const rootRef = (0, react.useRef)(null);
|
|
508
977
|
const triggerRef = (0, react.useRef)(null);
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
978
|
+
let t0;
|
|
979
|
+
let t1;
|
|
980
|
+
if ($[0] !== open) {
|
|
981
|
+
t0 = () => {
|
|
982
|
+
if (!open) return;
|
|
983
|
+
const onDown = (event) => {
|
|
984
|
+
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
985
|
+
};
|
|
986
|
+
const onKey = (event_0) => {
|
|
987
|
+
if (event_0.key !== "Escape") return;
|
|
988
|
+
setOpen(false);
|
|
989
|
+
triggerRef.current?.focus();
|
|
990
|
+
};
|
|
991
|
+
document.addEventListener("mousedown", onDown);
|
|
992
|
+
document.addEventListener("keydown", onKey);
|
|
993
|
+
return () => {
|
|
994
|
+
document.removeEventListener("mousedown", onDown);
|
|
995
|
+
document.removeEventListener("keydown", onKey);
|
|
996
|
+
};
|
|
518
997
|
};
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
998
|
+
t1 = [open];
|
|
999
|
+
$[0] = open;
|
|
1000
|
+
$[1] = t0;
|
|
1001
|
+
$[2] = t1;
|
|
1002
|
+
} else {
|
|
1003
|
+
t0 = $[1];
|
|
1004
|
+
t1 = $[2];
|
|
1005
|
+
}
|
|
1006
|
+
(0, react.useEffect)(t0, t1);
|
|
1007
|
+
let t2;
|
|
1008
|
+
if ($[3] !== open) {
|
|
1009
|
+
t2 = {
|
|
1010
|
+
open,
|
|
1011
|
+
setOpen,
|
|
1012
|
+
rootRef,
|
|
1013
|
+
triggerRef
|
|
524
1014
|
};
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
rootRef,
|
|
530
|
-
triggerRef
|
|
531
|
-
};
|
|
1015
|
+
$[3] = open;
|
|
1016
|
+
$[4] = t2;
|
|
1017
|
+
} else t2 = $[4];
|
|
1018
|
+
return t2;
|
|
532
1019
|
}
|
|
533
1020
|
//#endregion
|
|
534
1021
|
//#region src/components/SavedViewsMenu.tsx
|
|
1022
|
+
/** The label strings the saved-views menu renders. */
|
|
535
1023
|
/**
|
|
536
1024
|
* Saved-views popover: a disclosure button + a panel listing the saved views
|
|
537
1025
|
* (click applies one; each has a delete button) above a save row that
|
|
@@ -539,30 +1027,64 @@ function useMenuPopover() {
|
|
|
539
1027
|
* `useSavedViews`; closes on outside-click or Escape. Ships no styles —
|
|
540
1028
|
* target the `data-adapttable-part` hooks or the `views*` className slots.
|
|
541
1029
|
*/
|
|
542
|
-
function SavedViewsMenu(
|
|
1030
|
+
function SavedViewsMenu(t0) {
|
|
1031
|
+
const $ = (0, react_compiler_runtime.c)(34);
|
|
1032
|
+
const { options, labels, classNames } = t0;
|
|
543
1033
|
const { views, save, apply, remove } = (0, _adapttable_core.useSavedViews)(options);
|
|
544
1034
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
545
1035
|
const [name, setName] = (0, react.useState)("");
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
1036
|
+
let t1;
|
|
1037
|
+
if ($[0] !== name) {
|
|
1038
|
+
t1 = name.trim();
|
|
1039
|
+
$[0] = name;
|
|
1040
|
+
$[1] = t1;
|
|
1041
|
+
} else t1 = $[1];
|
|
1042
|
+
const trimmed = t1;
|
|
1043
|
+
let t2;
|
|
1044
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1045
|
+
t2 = { position: "relative" };
|
|
1046
|
+
$[2] = t2;
|
|
1047
|
+
} else t2 = $[2];
|
|
1048
|
+
const t3 = open || void 0;
|
|
1049
|
+
let t4;
|
|
1050
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1051
|
+
t4 = {
|
|
1052
|
+
flexShrink: 0,
|
|
1053
|
+
whiteSpace: "nowrap"
|
|
1054
|
+
};
|
|
1055
|
+
$[3] = t4;
|
|
1056
|
+
} else t4 = $[3];
|
|
1057
|
+
let t5;
|
|
1058
|
+
if ($[4] !== setOpen) {
|
|
1059
|
+
t5 = () => setOpen(_temp$2);
|
|
1060
|
+
$[4] = setOpen;
|
|
1061
|
+
$[5] = t5;
|
|
1062
|
+
} else t5 = $[5];
|
|
1063
|
+
let t6;
|
|
1064
|
+
if ($[6] !== classNames.viewsButton || $[7] !== labels.savedViews || $[8] !== open || $[9] !== t3 || $[10] !== t5 || $[11] !== triggerRef) {
|
|
1065
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
552
1066
|
ref: triggerRef,
|
|
553
1067
|
type: "button",
|
|
554
1068
|
"aria-expanded": open,
|
|
555
1069
|
"aria-haspopup": "true",
|
|
556
1070
|
"data-adapttable-part": "views-button",
|
|
557
|
-
"data-active":
|
|
1071
|
+
"data-active": t3,
|
|
558
1072
|
className: classNames.viewsButton,
|
|
559
|
-
style:
|
|
560
|
-
|
|
561
|
-
whiteSpace: "nowrap"
|
|
562
|
-
},
|
|
563
|
-
onClick: () => setOpen((v) => !v),
|
|
1073
|
+
style: t4,
|
|
1074
|
+
onClick: t5,
|
|
564
1075
|
children: labels.savedViews
|
|
565
|
-
})
|
|
1076
|
+
});
|
|
1077
|
+
$[6] = classNames.viewsButton;
|
|
1078
|
+
$[7] = labels.savedViews;
|
|
1079
|
+
$[8] = open;
|
|
1080
|
+
$[9] = t3;
|
|
1081
|
+
$[10] = t5;
|
|
1082
|
+
$[11] = triggerRef;
|
|
1083
|
+
$[12] = t6;
|
|
1084
|
+
} else t6 = $[12];
|
|
1085
|
+
let t7;
|
|
1086
|
+
if ($[13] !== apply || $[14] !== classNames.viewsDelete || $[15] !== classNames.viewsInput || $[16] !== classNames.viewsItem || $[17] !== classNames.viewsPanel || $[18] !== classNames.viewsSave || $[19] !== labels.deleteView || $[20] !== labels.saveView || $[21] !== labels.viewName || $[22] !== name || $[23] !== open || $[24] !== remove || $[25] !== save || $[26] !== setOpen || $[27] !== trimmed || $[28] !== views) {
|
|
1087
|
+
t7 = open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
566
1088
|
"data-adapttable-part": "views-panel",
|
|
567
1089
|
className: classNames.viewsPanel,
|
|
568
1090
|
style: MENU_PANEL_STYLE,
|
|
@@ -616,63 +1138,165 @@ function SavedViewsMenu({ options, labels, classNames }) {
|
|
|
616
1138
|
})]
|
|
617
1139
|
})
|
|
618
1140
|
]
|
|
619
|
-
})
|
|
620
|
-
|
|
1141
|
+
});
|
|
1142
|
+
$[13] = apply;
|
|
1143
|
+
$[14] = classNames.viewsDelete;
|
|
1144
|
+
$[15] = classNames.viewsInput;
|
|
1145
|
+
$[16] = classNames.viewsItem;
|
|
1146
|
+
$[17] = classNames.viewsPanel;
|
|
1147
|
+
$[18] = classNames.viewsSave;
|
|
1148
|
+
$[19] = labels.deleteView;
|
|
1149
|
+
$[20] = labels.saveView;
|
|
1150
|
+
$[21] = labels.viewName;
|
|
1151
|
+
$[22] = name;
|
|
1152
|
+
$[23] = open;
|
|
1153
|
+
$[24] = remove;
|
|
1154
|
+
$[25] = save;
|
|
1155
|
+
$[26] = setOpen;
|
|
1156
|
+
$[27] = trimmed;
|
|
1157
|
+
$[28] = views;
|
|
1158
|
+
$[29] = t7;
|
|
1159
|
+
} else t7 = $[29];
|
|
1160
|
+
let t8;
|
|
1161
|
+
if ($[30] !== rootRef || $[31] !== t6 || $[32] !== t7) {
|
|
1162
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1163
|
+
ref: rootRef,
|
|
1164
|
+
"data-adapttable-part": "views-menu",
|
|
1165
|
+
style: t2,
|
|
1166
|
+
children: [t6, t7]
|
|
1167
|
+
});
|
|
1168
|
+
$[30] = rootRef;
|
|
1169
|
+
$[31] = t6;
|
|
1170
|
+
$[32] = t7;
|
|
1171
|
+
$[33] = t8;
|
|
1172
|
+
} else t8 = $[33];
|
|
1173
|
+
return t8;
|
|
1174
|
+
}
|
|
1175
|
+
function _temp$2(v) {
|
|
1176
|
+
return !v;
|
|
621
1177
|
}
|
|
622
1178
|
//#endregion
|
|
623
1179
|
//#region src/components/chrome.tsx
|
|
624
1180
|
/** Removable filter-chip strip. Renders nothing when empty. */
|
|
625
|
-
function Chips(
|
|
1181
|
+
function Chips(t0) {
|
|
1182
|
+
const $ = (0, react_compiler_runtime.c)(21);
|
|
1183
|
+
const { chips, onClearAll, labels, classNames } = t0;
|
|
626
1184
|
if (chips.length === 0) return null;
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
1185
|
+
const t1 = labels.filters;
|
|
1186
|
+
const t2 = classNames.chips;
|
|
1187
|
+
let t3;
|
|
1188
|
+
if ($[0] !== chips || $[1] !== classNames.chip || $[2] !== classNames.chipRemove || $[3] !== labels.clearAll) {
|
|
1189
|
+
let t4;
|
|
1190
|
+
if ($[5] !== classNames.chip || $[6] !== classNames.chipRemove || $[7] !== labels.clearAll) {
|
|
1191
|
+
t4 = (chip) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
1192
|
+
"data-adapttable-part": "chip",
|
|
1193
|
+
className: classNames.chip,
|
|
1194
|
+
children: [chip.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1195
|
+
type: "button",
|
|
1196
|
+
"aria-label": `${labels.clearAll}: ${chip.label}`,
|
|
1197
|
+
"data-adapttable-part": "chip-remove",
|
|
1198
|
+
className: classNames.chipRemove,
|
|
1199
|
+
onClick: chip.onRemove,
|
|
1200
|
+
children: "×"
|
|
1201
|
+
})]
|
|
1202
|
+
}, chip.key);
|
|
1203
|
+
$[5] = classNames.chip;
|
|
1204
|
+
$[6] = classNames.chipRemove;
|
|
1205
|
+
$[7] = labels.clearAll;
|
|
1206
|
+
$[8] = t4;
|
|
1207
|
+
} else t4 = $[8];
|
|
1208
|
+
t3 = chips.map(t4);
|
|
1209
|
+
$[0] = chips;
|
|
1210
|
+
$[1] = classNames.chip;
|
|
1211
|
+
$[2] = classNames.chipRemove;
|
|
1212
|
+
$[3] = labels.clearAll;
|
|
1213
|
+
$[4] = t3;
|
|
1214
|
+
} else t3 = $[4];
|
|
1215
|
+
let t4;
|
|
1216
|
+
if ($[9] !== classNames.chipRemove || $[10] !== labels.clearAll || $[11] !== onClearAll) {
|
|
1217
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1218
|
+
type: "button",
|
|
1219
|
+
"data-adapttable-part": "chip-remove",
|
|
1220
|
+
className: classNames.chipRemove,
|
|
1221
|
+
onClick: onClearAll,
|
|
1222
|
+
children: labels.clearAll
|
|
1223
|
+
});
|
|
1224
|
+
$[9] = classNames.chipRemove;
|
|
1225
|
+
$[10] = labels.clearAll;
|
|
1226
|
+
$[11] = onClearAll;
|
|
1227
|
+
$[12] = t4;
|
|
1228
|
+
} else t4 = $[12];
|
|
1229
|
+
let t5;
|
|
1230
|
+
if ($[13] !== classNames.chip || $[14] !== t4) {
|
|
1231
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
643
1232
|
"data-adapttable-part": "chip",
|
|
644
1233
|
className: classNames.chip,
|
|
645
|
-
children:
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
1234
|
+
children: t4
|
|
1235
|
+
});
|
|
1236
|
+
$[13] = classNames.chip;
|
|
1237
|
+
$[14] = t4;
|
|
1238
|
+
$[15] = t5;
|
|
1239
|
+
} else t5 = $[15];
|
|
1240
|
+
let t6;
|
|
1241
|
+
if ($[16] !== classNames.chips || $[17] !== labels.filters || $[18] !== t3 || $[19] !== t5) {
|
|
1242
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
1243
|
+
"aria-label": t1,
|
|
1244
|
+
"data-adapttable-part": "chips",
|
|
1245
|
+
className: t2,
|
|
1246
|
+
children: [t3, t5]
|
|
1247
|
+
});
|
|
1248
|
+
$[16] = classNames.chips;
|
|
1249
|
+
$[17] = labels.filters;
|
|
1250
|
+
$[18] = t3;
|
|
1251
|
+
$[19] = t5;
|
|
1252
|
+
$[20] = t6;
|
|
1253
|
+
} else t6 = $[20];
|
|
1254
|
+
return t6;
|
|
654
1255
|
}
|
|
655
1256
|
/** Selection toolbar with bulk-action buttons. */
|
|
656
|
-
function BulkBar(
|
|
1257
|
+
function BulkBar(t0) {
|
|
1258
|
+
const $ = (0, react_compiler_runtime.c)(42);
|
|
1259
|
+
const { selection, total, bulkActions, confirm, labels, classNames } = t0;
|
|
657
1260
|
const { selectedIds, selectedCount, clear, headerState, visibleIds, allMatching, selectAllMatching } = selection;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1261
|
+
let t1;
|
|
1262
|
+
if ($[0] !== clear || $[1] !== confirm || $[2] !== labels.cancel) {
|
|
1263
|
+
t1 = {
|
|
1264
|
+
confirm,
|
|
1265
|
+
cancelLabel: labels.cancel,
|
|
1266
|
+
onComplete: clear
|
|
1267
|
+
};
|
|
1268
|
+
$[0] = clear;
|
|
1269
|
+
$[1] = confirm;
|
|
1270
|
+
$[2] = labels.cancel;
|
|
1271
|
+
$[3] = t1;
|
|
1272
|
+
} else t1 = $[3];
|
|
1273
|
+
const { pending, run } = (0, _adapttable_core.useBulkActionRunner)(t1);
|
|
663
1274
|
if (selectedCount === 0) return null;
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
1275
|
+
let t2;
|
|
1276
|
+
if ($[4] !== allMatching || $[5] !== bulkActions || $[6] !== classNames.bulkBar || $[7] !== classNames.bulkButton || $[8] !== classNames.selectAllBanner || $[9] !== classNames.selectAllButton || $[10] !== classNames.selectAllText || $[11] !== clear || $[12] !== headerState || $[13] !== labels || $[14] !== pending || $[15] !== run || $[16] !== selectAllMatching || $[17] !== selectedCount || $[18] !== selectedIds || $[19] !== total || $[20] !== visibleIds) {
|
|
1277
|
+
const ids = [...selectedIds];
|
|
1278
|
+
const showBanner = headerState === "all" && total > visibleIds.length;
|
|
1279
|
+
const scope = allMatching ? {
|
|
1280
|
+
allMatching: true,
|
|
1281
|
+
total
|
|
1282
|
+
} : void 0;
|
|
1283
|
+
const t3 = classNames.bulkBar;
|
|
1284
|
+
let t4;
|
|
1285
|
+
if ($[22] !== labels || $[23] !== selectedCount) {
|
|
1286
|
+
t4 = labels.selectedCount(selectedCount);
|
|
1287
|
+
$[22] = labels;
|
|
1288
|
+
$[23] = selectedCount;
|
|
1289
|
+
$[24] = t4;
|
|
1290
|
+
} else t4 = $[24];
|
|
1291
|
+
let t5;
|
|
1292
|
+
if ($[25] !== t4) {
|
|
1293
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t4 });
|
|
1294
|
+
$[25] = t4;
|
|
1295
|
+
$[26] = t5;
|
|
1296
|
+
} else t5 = $[26];
|
|
1297
|
+
let t6;
|
|
1298
|
+
if ($[27] !== allMatching || $[28] !== classNames.selectAllBanner || $[29] !== classNames.selectAllButton || $[30] !== classNames.selectAllText || $[31] !== clear || $[32] !== labels || $[33] !== selectAllMatching || $[34] !== showBanner || $[35] !== total || $[36] !== visibleIds) {
|
|
1299
|
+
t6 = showBanner && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
676
1300
|
"data-adapttable-part": "select-all-banner",
|
|
677
1301
|
className: classNames.selectAllBanner,
|
|
678
1302
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -686,108 +1310,357 @@ function BulkBar({ selection, total, bulkActions, confirm, labels, classNames })
|
|
|
686
1310
|
onClick: allMatching ? clear : selectAllMatching,
|
|
687
1311
|
children: allMatching ? labels.clearAll : labels.selectAllMatching(total)
|
|
688
1312
|
})]
|
|
689
|
-
})
|
|
690
|
-
|
|
1313
|
+
});
|
|
1314
|
+
$[27] = allMatching;
|
|
1315
|
+
$[28] = classNames.selectAllBanner;
|
|
1316
|
+
$[29] = classNames.selectAllButton;
|
|
1317
|
+
$[30] = classNames.selectAllText;
|
|
1318
|
+
$[31] = clear;
|
|
1319
|
+
$[32] = labels;
|
|
1320
|
+
$[33] = selectAllMatching;
|
|
1321
|
+
$[34] = showBanner;
|
|
1322
|
+
$[35] = total;
|
|
1323
|
+
$[36] = visibleIds;
|
|
1324
|
+
$[37] = t6;
|
|
1325
|
+
} else t6 = $[37];
|
|
1326
|
+
const t7 = pending !== null;
|
|
1327
|
+
let t8;
|
|
1328
|
+
if ($[38] !== clear || $[39] !== labels.clearAll || $[40] !== t7) {
|
|
1329
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
691
1330
|
type: "button",
|
|
692
1331
|
onClick: clear,
|
|
693
|
-
disabled:
|
|
1332
|
+
disabled: t7,
|
|
694
1333
|
children: labels.clearAll
|
|
695
|
-
})
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
1334
|
+
});
|
|
1335
|
+
$[38] = clear;
|
|
1336
|
+
$[39] = labels.clearAll;
|
|
1337
|
+
$[40] = t7;
|
|
1338
|
+
$[41] = t8;
|
|
1339
|
+
} else t8 = $[41];
|
|
1340
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1341
|
+
"data-adapttable-part": "bulk-bar",
|
|
1342
|
+
className: t3,
|
|
1343
|
+
children: [
|
|
1344
|
+
t5,
|
|
1345
|
+
t6,
|
|
1346
|
+
t8,
|
|
1347
|
+
bulkActions.map((action) => {
|
|
1348
|
+
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(ids));
|
|
1349
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1350
|
+
type: "button",
|
|
1351
|
+
title: reason,
|
|
1352
|
+
disabled: reason !== void 0 || pending !== null,
|
|
1353
|
+
"data-adapttable-part": "bulk-button",
|
|
1354
|
+
"data-color": action.color,
|
|
1355
|
+
className: classNames.bulkButton,
|
|
1356
|
+
onClick: () => run(action, ids, scope),
|
|
1357
|
+
children: [action.icon, action.label]
|
|
1358
|
+
}, action.key);
|
|
1359
|
+
})
|
|
1360
|
+
]
|
|
1361
|
+
});
|
|
1362
|
+
$[4] = allMatching;
|
|
1363
|
+
$[5] = bulkActions;
|
|
1364
|
+
$[6] = classNames.bulkBar;
|
|
1365
|
+
$[7] = classNames.bulkButton;
|
|
1366
|
+
$[8] = classNames.selectAllBanner;
|
|
1367
|
+
$[9] = classNames.selectAllButton;
|
|
1368
|
+
$[10] = classNames.selectAllText;
|
|
1369
|
+
$[11] = clear;
|
|
1370
|
+
$[12] = headerState;
|
|
1371
|
+
$[13] = labels;
|
|
1372
|
+
$[14] = pending;
|
|
1373
|
+
$[15] = run;
|
|
1374
|
+
$[16] = selectAllMatching;
|
|
1375
|
+
$[17] = selectedCount;
|
|
1376
|
+
$[18] = selectedIds;
|
|
1377
|
+
$[19] = total;
|
|
1378
|
+
$[20] = visibleIds;
|
|
1379
|
+
$[21] = t2;
|
|
1380
|
+
} else t2 = $[21];
|
|
1381
|
+
return t2;
|
|
711
1382
|
}
|
|
712
1383
|
/** The rows-per-page selector shared by the toolbar (infinite) and footer. */
|
|
713
|
-
function RowsPerPageSelect(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1384
|
+
function RowsPerPageSelect(t0) {
|
|
1385
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
1386
|
+
const { source, labels, classNames } = t0;
|
|
1387
|
+
const t1 = labels.rowsPerPage;
|
|
1388
|
+
const t2 = labels.rowsPerPage;
|
|
1389
|
+
const t3 = classNames.rowsPerPageSelect;
|
|
1390
|
+
const t4 = source.limit;
|
|
1391
|
+
let t5;
|
|
1392
|
+
if ($[0] !== source) {
|
|
1393
|
+
t5 = (e) => source.setLimit(Number(e.currentTarget.value));
|
|
1394
|
+
$[0] = source;
|
|
1395
|
+
$[1] = t5;
|
|
1396
|
+
} else t5 = $[1];
|
|
1397
|
+
let t6;
|
|
1398
|
+
if ($[2] !== source.limit) {
|
|
1399
|
+
t6 = (0, _adapttable_core.pageSizeOptions)(source.limit).map(_temp$1);
|
|
1400
|
+
$[2] = source.limit;
|
|
1401
|
+
$[3] = t6;
|
|
1402
|
+
} else t6 = $[3];
|
|
1403
|
+
let t7;
|
|
1404
|
+
if ($[4] !== classNames.rowsPerPageSelect || $[5] !== labels.rowsPerPage || $[6] !== source.limit || $[7] !== t5 || $[8] !== t6) {
|
|
1405
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
1406
|
+
"aria-label": t2,
|
|
719
1407
|
"data-adapttable-part": "rows-per-page",
|
|
720
|
-
className:
|
|
721
|
-
value:
|
|
722
|
-
onChange:
|
|
723
|
-
children:
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1408
|
+
className: t3,
|
|
1409
|
+
value: t4,
|
|
1410
|
+
onChange: t5,
|
|
1411
|
+
children: t6
|
|
1412
|
+
});
|
|
1413
|
+
$[4] = classNames.rowsPerPageSelect;
|
|
1414
|
+
$[5] = labels.rowsPerPage;
|
|
1415
|
+
$[6] = source.limit;
|
|
1416
|
+
$[7] = t5;
|
|
1417
|
+
$[8] = t6;
|
|
1418
|
+
$[9] = t7;
|
|
1419
|
+
} else t7 = $[9];
|
|
1420
|
+
let t8;
|
|
1421
|
+
if ($[10] !== labels.rowsPerPage || $[11] !== t7) {
|
|
1422
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [
|
|
1423
|
+
t1,
|
|
1424
|
+
" ",
|
|
1425
|
+
t7
|
|
1426
|
+
] });
|
|
1427
|
+
$[10] = labels.rowsPerPage;
|
|
1428
|
+
$[11] = t7;
|
|
1429
|
+
$[12] = t8;
|
|
1430
|
+
} else t8 = $[12];
|
|
1431
|
+
return t8;
|
|
729
1432
|
}
|
|
730
1433
|
/** Prev/next pager with a rows-per-page select. */
|
|
731
|
-
function
|
|
1434
|
+
function _temp$1(n) {
|
|
1435
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1436
|
+
value: n,
|
|
1437
|
+
children: n
|
|
1438
|
+
}, n);
|
|
1439
|
+
}
|
|
1440
|
+
function Footer(t0) {
|
|
1441
|
+
const $ = (0, react_compiler_runtime.c)(53);
|
|
1442
|
+
const { pagination, source, labels, classNames } = t0;
|
|
732
1443
|
const { safePage, totalPages, fromIndex, toIndex } = pagination;
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
1444
|
+
const t1 = classNames.footer;
|
|
1445
|
+
let t2;
|
|
1446
|
+
if ($[0] !== classNames || $[1] !== labels || $[2] !== source) {
|
|
1447
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowsPerPageSelect, {
|
|
1448
|
+
source,
|
|
1449
|
+
labels,
|
|
1450
|
+
classNames
|
|
1451
|
+
});
|
|
1452
|
+
$[0] = classNames;
|
|
1453
|
+
$[1] = labels;
|
|
1454
|
+
$[2] = source;
|
|
1455
|
+
$[3] = t2;
|
|
1456
|
+
} else t2 = $[3];
|
|
1457
|
+
let t3;
|
|
1458
|
+
if ($[4] !== fromIndex || $[5] !== labels || $[6] !== source.total || $[7] !== toIndex) {
|
|
1459
|
+
t3 = source.total > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.showing({
|
|
1460
|
+
from: fromIndex,
|
|
1461
|
+
to: toIndex,
|
|
1462
|
+
total: source.total
|
|
1463
|
+
}) });
|
|
1464
|
+
$[4] = fromIndex;
|
|
1465
|
+
$[5] = labels;
|
|
1466
|
+
$[6] = source.total;
|
|
1467
|
+
$[7] = toIndex;
|
|
1468
|
+
$[8] = t3;
|
|
1469
|
+
} else t3 = $[8];
|
|
1470
|
+
const t4 = classNames.pager;
|
|
1471
|
+
let t5;
|
|
1472
|
+
if ($[9] !== labels || $[10] !== safePage || $[11] !== totalPages) {
|
|
1473
|
+
t5 = labels.pageOf({
|
|
1474
|
+
page: safePage,
|
|
1475
|
+
total: totalPages
|
|
1476
|
+
});
|
|
1477
|
+
$[9] = labels;
|
|
1478
|
+
$[10] = safePage;
|
|
1479
|
+
$[11] = totalPages;
|
|
1480
|
+
$[12] = t5;
|
|
1481
|
+
} else t5 = $[12];
|
|
1482
|
+
let t6;
|
|
1483
|
+
if ($[13] !== t5) {
|
|
1484
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t5 });
|
|
1485
|
+
$[13] = t5;
|
|
1486
|
+
$[14] = t6;
|
|
1487
|
+
} else t6 = $[14];
|
|
1488
|
+
const t7 = safePage <= 1;
|
|
1489
|
+
let t8;
|
|
1490
|
+
if ($[15] !== safePage || $[16] !== source) {
|
|
1491
|
+
t8 = () => source.setPage(safePage - 1);
|
|
1492
|
+
$[15] = safePage;
|
|
1493
|
+
$[16] = source;
|
|
1494
|
+
$[17] = t8;
|
|
1495
|
+
} else t8 = $[17];
|
|
1496
|
+
let t9;
|
|
1497
|
+
if ($[18] !== classNames.pageButton || $[19] !== labels.previousPage || $[20] !== t7 || $[21] !== t8) {
|
|
1498
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1499
|
+
type: "button",
|
|
1500
|
+
"aria-label": labels.previousPage,
|
|
1501
|
+
"data-adapttable-part": "page-prev",
|
|
1502
|
+
className: classNames.pageButton,
|
|
1503
|
+
disabled: t7,
|
|
1504
|
+
onClick: t8,
|
|
1505
|
+
children: "‹"
|
|
1506
|
+
});
|
|
1507
|
+
$[18] = classNames.pageButton;
|
|
1508
|
+
$[19] = labels.previousPage;
|
|
1509
|
+
$[20] = t7;
|
|
1510
|
+
$[21] = t8;
|
|
1511
|
+
$[22] = t9;
|
|
1512
|
+
} else t9 = $[22];
|
|
1513
|
+
let t10;
|
|
1514
|
+
if ($[23] !== classNames.pageButton || $[24] !== classNames.pageEllipsis || $[25] !== safePage || $[26] !== source || $[27] !== totalPages) {
|
|
1515
|
+
let t11;
|
|
1516
|
+
if ($[29] !== classNames.pageButton || $[30] !== classNames.pageEllipsis || $[31] !== safePage || $[32] !== source) {
|
|
1517
|
+
t11 = (item, i) => item === "ellipsis" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1518
|
+
"data-adapttable-part": "page-ellipsis",
|
|
1519
|
+
"aria-hidden": "true",
|
|
1520
|
+
className: classNames.pageEllipsis,
|
|
1521
|
+
children: "…"
|
|
1522
|
+
}, `ellipsis-${i}`) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
761
1523
|
type: "button",
|
|
762
|
-
"
|
|
763
|
-
"
|
|
1524
|
+
"data-adapttable-part": "page-number",
|
|
1525
|
+
"aria-current": item === safePage ? "page" : void 0,
|
|
764
1526
|
className: classNames.pageButton,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1527
|
+
onClick: () => source.setPage(item),
|
|
1528
|
+
children: item
|
|
1529
|
+
}, item);
|
|
1530
|
+
$[29] = classNames.pageButton;
|
|
1531
|
+
$[30] = classNames.pageEllipsis;
|
|
1532
|
+
$[31] = safePage;
|
|
1533
|
+
$[32] = source;
|
|
1534
|
+
$[33] = t11;
|
|
1535
|
+
} else t11 = $[33];
|
|
1536
|
+
t10 = (0, _adapttable_core.paginationItems)(safePage, totalPages).map(t11);
|
|
1537
|
+
$[23] = classNames.pageButton;
|
|
1538
|
+
$[24] = classNames.pageEllipsis;
|
|
1539
|
+
$[25] = safePage;
|
|
1540
|
+
$[26] = source;
|
|
1541
|
+
$[27] = totalPages;
|
|
1542
|
+
$[28] = t10;
|
|
1543
|
+
} else t10 = $[28];
|
|
1544
|
+
const t11 = safePage >= totalPages;
|
|
1545
|
+
let t12;
|
|
1546
|
+
if ($[34] !== safePage || $[35] !== source) {
|
|
1547
|
+
t12 = () => source.setPage(safePage + 1);
|
|
1548
|
+
$[34] = safePage;
|
|
1549
|
+
$[35] = source;
|
|
1550
|
+
$[36] = t12;
|
|
1551
|
+
} else t12 = $[36];
|
|
1552
|
+
let t13;
|
|
1553
|
+
if ($[37] !== classNames.pageButton || $[38] !== labels.nextPage || $[39] !== t11 || $[40] !== t12) {
|
|
1554
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1555
|
+
type: "button",
|
|
1556
|
+
"aria-label": labels.nextPage,
|
|
1557
|
+
"data-adapttable-part": "page-next",
|
|
1558
|
+
className: classNames.pageButton,
|
|
1559
|
+
disabled: t11,
|
|
1560
|
+
onClick: t12,
|
|
1561
|
+
children: "›"
|
|
1562
|
+
});
|
|
1563
|
+
$[37] = classNames.pageButton;
|
|
1564
|
+
$[38] = labels.nextPage;
|
|
1565
|
+
$[39] = t11;
|
|
1566
|
+
$[40] = t12;
|
|
1567
|
+
$[41] = t13;
|
|
1568
|
+
} else t13 = $[41];
|
|
1569
|
+
let t14;
|
|
1570
|
+
if ($[42] !== classNames.pager || $[43] !== t10 || $[44] !== t13 || $[45] !== t6 || $[46] !== t9) {
|
|
1571
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1572
|
+
"data-adapttable-part": "pager",
|
|
1573
|
+
className: t4,
|
|
1574
|
+
children: [
|
|
1575
|
+
t6,
|
|
1576
|
+
t9,
|
|
1577
|
+
t10,
|
|
1578
|
+
t13
|
|
1579
|
+
]
|
|
1580
|
+
});
|
|
1581
|
+
$[42] = classNames.pager;
|
|
1582
|
+
$[43] = t10;
|
|
1583
|
+
$[44] = t13;
|
|
1584
|
+
$[45] = t6;
|
|
1585
|
+
$[46] = t9;
|
|
1586
|
+
$[47] = t14;
|
|
1587
|
+
} else t14 = $[47];
|
|
1588
|
+
let t15;
|
|
1589
|
+
if ($[48] !== classNames.footer || $[49] !== t14 || $[50] !== t2 || $[51] !== t3) {
|
|
1590
|
+
t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1591
|
+
"data-adapttable-part": "footer",
|
|
1592
|
+
className: t1,
|
|
1593
|
+
children: [
|
|
1594
|
+
t2,
|
|
1595
|
+
t3,
|
|
1596
|
+
t14
|
|
1597
|
+
]
|
|
1598
|
+
});
|
|
1599
|
+
$[48] = classNames.footer;
|
|
1600
|
+
$[49] = t14;
|
|
1601
|
+
$[50] = t2;
|
|
1602
|
+
$[51] = t3;
|
|
1603
|
+
$[52] = t15;
|
|
1604
|
+
} else t15 = $[52];
|
|
1605
|
+
return t15;
|
|
771
1606
|
}
|
|
772
1607
|
/** Inline error with optional retry. */
|
|
773
|
-
function ErrorState(
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
children:
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1608
|
+
function ErrorState(t0) {
|
|
1609
|
+
const $ = (0, react_compiler_runtime.c)(16);
|
|
1610
|
+
const { error, labels, onRetry, classNames } = t0;
|
|
1611
|
+
let t1;
|
|
1612
|
+
if ($[0] !== labels.errorTitle) {
|
|
1613
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: labels.errorTitle });
|
|
1614
|
+
$[0] = labels.errorTitle;
|
|
1615
|
+
$[1] = t1;
|
|
1616
|
+
} else t1 = $[1];
|
|
1617
|
+
let t2;
|
|
1618
|
+
if ($[2] !== labels.errorMessage) {
|
|
1619
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: labels.errorMessage });
|
|
1620
|
+
$[2] = labels.errorMessage;
|
|
1621
|
+
$[3] = t2;
|
|
1622
|
+
} else t2 = $[3];
|
|
1623
|
+
let t3;
|
|
1624
|
+
if ($[4] !== error.message) {
|
|
1625
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: error.message });
|
|
1626
|
+
$[4] = error.message;
|
|
1627
|
+
$[5] = t3;
|
|
1628
|
+
} else t3 = $[5];
|
|
1629
|
+
let t4;
|
|
1630
|
+
if ($[6] !== classNames.retryButton || $[7] !== labels.retry || $[8] !== onRetry) {
|
|
1631
|
+
t4 = onRetry && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1632
|
+
type: "button",
|
|
1633
|
+
onClick: onRetry,
|
|
1634
|
+
"data-adapttable-part": "retry",
|
|
1635
|
+
className: classNames.retryButton,
|
|
1636
|
+
children: labels.retry
|
|
1637
|
+
});
|
|
1638
|
+
$[6] = classNames.retryButton;
|
|
1639
|
+
$[7] = labels.retry;
|
|
1640
|
+
$[8] = onRetry;
|
|
1641
|
+
$[9] = t4;
|
|
1642
|
+
} else t4 = $[9];
|
|
1643
|
+
let t5;
|
|
1644
|
+
if ($[10] !== classNames.error || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
|
|
1645
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1646
|
+
role: "alert",
|
|
1647
|
+
"data-adapttable-part": "error",
|
|
1648
|
+
className: classNames.error,
|
|
1649
|
+
children: [
|
|
1650
|
+
t1,
|
|
1651
|
+
t2,
|
|
1652
|
+
t3,
|
|
1653
|
+
t4
|
|
1654
|
+
]
|
|
1655
|
+
});
|
|
1656
|
+
$[10] = classNames.error;
|
|
1657
|
+
$[11] = t1;
|
|
1658
|
+
$[12] = t2;
|
|
1659
|
+
$[13] = t3;
|
|
1660
|
+
$[14] = t4;
|
|
1661
|
+
$[15] = t5;
|
|
1662
|
+
} else t5 = $[15];
|
|
1663
|
+
return t5;
|
|
791
1664
|
}
|
|
792
1665
|
function loadingLineWidth(column, total) {
|
|
793
1666
|
if (column === 0) return "70%";
|
|
@@ -795,17 +1668,36 @@ function loadingLineWidth(column, total) {
|
|
|
795
1668
|
return "55%";
|
|
796
1669
|
}
|
|
797
1670
|
/** Skeleton-ish loading placeholder (semantic, unstyled). */
|
|
798
|
-
function LoadingState(
|
|
799
|
-
const
|
|
1671
|
+
function LoadingState(t0) {
|
|
1672
|
+
const $ = (0, react_compiler_runtime.c)(24);
|
|
1673
|
+
const { rows, columns, variant, labels, classNames, hasActions: t1 } = t0;
|
|
1674
|
+
const hasActions = t1 === void 0 ? false : t1;
|
|
1675
|
+
let t2;
|
|
1676
|
+
if ($[0] !== rows) {
|
|
1677
|
+
t2 = Array.from({ length: rows }, _temp2);
|
|
1678
|
+
$[0] = rows;
|
|
1679
|
+
$[1] = t2;
|
|
1680
|
+
} else t2 = $[1];
|
|
1681
|
+
const rowKeys = t2;
|
|
800
1682
|
const columnCount = Math.max(columns, 1) + (hasActions ? 1 : 0);
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1683
|
+
let t3;
|
|
1684
|
+
let t4;
|
|
1685
|
+
let t5;
|
|
1686
|
+
let t6;
|
|
1687
|
+
let t7;
|
|
1688
|
+
let t8;
|
|
1689
|
+
if ($[2] !== classNames.loading || $[3] !== columnCount || $[4] !== rowKeys || $[5] !== variant) {
|
|
1690
|
+
const columnKeys = Array.from({ length: columnCount }, _temp3);
|
|
1691
|
+
t3 = "status";
|
|
1692
|
+
t4 = "true";
|
|
1693
|
+
t5 = "polite";
|
|
1694
|
+
t6 = "loading";
|
|
1695
|
+
if ($[12] !== classNames.loading) {
|
|
1696
|
+
t7 = cx(classNames.loading);
|
|
1697
|
+
$[12] = classNames.loading;
|
|
1698
|
+
$[13] = t7;
|
|
1699
|
+
} else t7 = $[13];
|
|
1700
|
+
t8 = variant === "table" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
809
1701
|
"data-adapttable-part": "loading-table",
|
|
810
1702
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
811
1703
|
"data-adapttable-part": "loading-header-row",
|
|
@@ -818,141 +1710,426 @@ function LoadingState({ rows, columns, variant, labels, classNames, hasActions =
|
|
|
818
1710
|
}, column))
|
|
819
1711
|
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: rowKeys.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
820
1712
|
"data-adapttable-part": "loading-row",
|
|
821
|
-
children: columnKeys.map((
|
|
1713
|
+
children: columnKeys.map((column_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
822
1714
|
"data-adapttable-part": "loading-cell",
|
|
823
1715
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
824
1716
|
"data-adapttable-part": "loading-line",
|
|
825
|
-
style: { width: loadingLineWidth(
|
|
1717
|
+
style: { width: loadingLineWidth(column_0, columnCount) }
|
|
826
1718
|
})
|
|
827
|
-
},
|
|
1719
|
+
}, column_0))
|
|
828
1720
|
}, row)) })]
|
|
829
1721
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
830
1722
|
"data-adapttable-part": "loading-cards",
|
|
831
|
-
children: rowKeys.map((
|
|
1723
|
+
children: rowKeys.map((row_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
832
1724
|
"data-adapttable-part": "loading-card",
|
|
833
|
-
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((
|
|
1725
|
+
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((column_1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
834
1726
|
"data-adapttable-part": "loading-line",
|
|
835
|
-
style: { width: loadingLineWidth(
|
|
836
|
-
},
|
|
837
|
-
},
|
|
838
|
-
})
|
|
1727
|
+
style: { width: loadingLineWidth(column_1, columnKeys.length) }
|
|
1728
|
+
}, column_1))
|
|
1729
|
+
}, row_0))
|
|
1730
|
+
});
|
|
1731
|
+
$[2] = classNames.loading;
|
|
1732
|
+
$[3] = columnCount;
|
|
1733
|
+
$[4] = rowKeys;
|
|
1734
|
+
$[5] = variant;
|
|
1735
|
+
$[6] = t3;
|
|
1736
|
+
$[7] = t4;
|
|
1737
|
+
$[8] = t5;
|
|
1738
|
+
$[9] = t6;
|
|
1739
|
+
$[10] = t7;
|
|
1740
|
+
$[11] = t8;
|
|
1741
|
+
} else {
|
|
1742
|
+
t3 = $[6];
|
|
1743
|
+
t4 = $[7];
|
|
1744
|
+
t5 = $[8];
|
|
1745
|
+
t6 = $[9];
|
|
1746
|
+
t7 = $[10];
|
|
1747
|
+
t8 = $[11];
|
|
1748
|
+
}
|
|
1749
|
+
let t9;
|
|
1750
|
+
if ($[14] !== labels.loading) {
|
|
1751
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
839
1752
|
className: "adapttable-sr-only",
|
|
840
1753
|
children: labels.loading
|
|
841
|
-
})
|
|
842
|
-
|
|
1754
|
+
});
|
|
1755
|
+
$[14] = labels.loading;
|
|
1756
|
+
$[15] = t9;
|
|
1757
|
+
} else t9 = $[15];
|
|
1758
|
+
let t10;
|
|
1759
|
+
if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
|
|
1760
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1761
|
+
role: t3,
|
|
1762
|
+
"aria-busy": t4,
|
|
1763
|
+
"aria-live": t5,
|
|
1764
|
+
"data-adapttable-part": t6,
|
|
1765
|
+
className: t7,
|
|
1766
|
+
children: [t8, t9]
|
|
1767
|
+
});
|
|
1768
|
+
$[16] = t3;
|
|
1769
|
+
$[17] = t4;
|
|
1770
|
+
$[18] = t5;
|
|
1771
|
+
$[19] = t6;
|
|
1772
|
+
$[20] = t7;
|
|
1773
|
+
$[21] = t8;
|
|
1774
|
+
$[22] = t9;
|
|
1775
|
+
$[23] = t10;
|
|
1776
|
+
} else t10 = $[23];
|
|
1777
|
+
return t10;
|
|
1778
|
+
}
|
|
1779
|
+
function _temp3(__0, i_0) {
|
|
1780
|
+
return i_0;
|
|
1781
|
+
}
|
|
1782
|
+
function _temp2(_, i) {
|
|
1783
|
+
return i;
|
|
843
1784
|
}
|
|
844
1785
|
//#endregion
|
|
845
1786
|
//#region src/components/ColumnMenu.tsx
|
|
1787
|
+
/** Menu labels: the shared chrome contract plus the actions row's name. */
|
|
846
1788
|
/** The eye toggle shared by data-column rows and the actions row. */
|
|
847
|
-
function VisibilityToggle(
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1789
|
+
function VisibilityToggle(t0) {
|
|
1790
|
+
const $ = (0, react_compiler_runtime.c)(9);
|
|
1791
|
+
const { hidden, name, labels, classNames, onToggle } = t0;
|
|
1792
|
+
const t1 = !hidden || void 0;
|
|
1793
|
+
const t2 = !hidden;
|
|
1794
|
+
const t3 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
|
|
1795
|
+
let t4;
|
|
1796
|
+
if ($[0] !== hidden) {
|
|
1797
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.EyeIcon, { off: hidden });
|
|
1798
|
+
$[0] = hidden;
|
|
1799
|
+
$[1] = t4;
|
|
1800
|
+
} else t4 = $[1];
|
|
1801
|
+
let t5;
|
|
1802
|
+
if ($[2] !== classNames.columnMenuVisibility || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
1803
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1804
|
+
type: "button",
|
|
1805
|
+
"data-adapttable-part": "column-menu-visibility",
|
|
1806
|
+
"data-active": t1,
|
|
1807
|
+
"aria-pressed": t2,
|
|
1808
|
+
"aria-label": t3,
|
|
1809
|
+
className: classNames.columnMenuVisibility,
|
|
1810
|
+
onClick: onToggle,
|
|
1811
|
+
children: t4
|
|
1812
|
+
});
|
|
1813
|
+
$[2] = classNames.columnMenuVisibility;
|
|
1814
|
+
$[3] = onToggle;
|
|
1815
|
+
$[4] = t1;
|
|
1816
|
+
$[5] = t2;
|
|
1817
|
+
$[6] = t3;
|
|
1818
|
+
$[7] = t4;
|
|
1819
|
+
$[8] = t5;
|
|
1820
|
+
} else t5 = $[8];
|
|
1821
|
+
return t5;
|
|
858
1822
|
}
|
|
859
1823
|
/** The row's name caption, shared by data-column rows and the actions row. */
|
|
860
|
-
function RowName(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1824
|
+
function RowName(t0) {
|
|
1825
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1826
|
+
const { hidden, name, classNames } = t0;
|
|
1827
|
+
const t1 = hidden || void 0;
|
|
1828
|
+
let t2;
|
|
1829
|
+
if ($[0] !== classNames.columnMenuLabel || $[1] !== name || $[2] !== t1) {
|
|
1830
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1831
|
+
"data-adapttable-part": "column-menu-label",
|
|
1832
|
+
"data-hidden": t1,
|
|
1833
|
+
className: classNames.columnMenuLabel,
|
|
1834
|
+
children: name
|
|
1835
|
+
});
|
|
1836
|
+
$[0] = classNames.columnMenuLabel;
|
|
1837
|
+
$[1] = name;
|
|
1838
|
+
$[2] = t1;
|
|
1839
|
+
$[3] = t2;
|
|
1840
|
+
} else t2 = $[3];
|
|
1841
|
+
return t2;
|
|
867
1842
|
}
|
|
868
1843
|
/** The pin toggle shared by data-column rows and the actions row. */
|
|
869
|
-
function PinToggle(
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1844
|
+
function PinToggle(t0) {
|
|
1845
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
1846
|
+
const { active, actionLabel, classNames, onClick } = t0;
|
|
1847
|
+
const t1 = active || void 0;
|
|
1848
|
+
let t2;
|
|
1849
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1850
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.PinIcon, {});
|
|
1851
|
+
$[0] = t2;
|
|
1852
|
+
} else t2 = $[0];
|
|
1853
|
+
let t3;
|
|
1854
|
+
if ($[1] !== actionLabel || $[2] !== active || $[3] !== classNames.columnMenuPin || $[4] !== onClick || $[5] !== t1) {
|
|
1855
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1856
|
+
type: "button",
|
|
1857
|
+
"data-adapttable-part": "column-menu-pin",
|
|
1858
|
+
"data-active": t1,
|
|
1859
|
+
"aria-pressed": active,
|
|
1860
|
+
"aria-label": actionLabel,
|
|
1861
|
+
className: classNames.columnMenuPin,
|
|
1862
|
+
onClick,
|
|
1863
|
+
children: t2
|
|
1864
|
+
});
|
|
1865
|
+
$[1] = actionLabel;
|
|
1866
|
+
$[2] = active;
|
|
1867
|
+
$[3] = classNames.columnMenuPin;
|
|
1868
|
+
$[4] = onClick;
|
|
1869
|
+
$[5] = t1;
|
|
1870
|
+
$[6] = t3;
|
|
1871
|
+
} else t3 = $[6];
|
|
1872
|
+
return t3;
|
|
880
1873
|
}
|
|
881
|
-
function ColumnMenuRowItem(
|
|
1874
|
+
function ColumnMenuRowItem(t0) {
|
|
1875
|
+
const $ = (0, react_compiler_runtime.c)(58);
|
|
1876
|
+
const { row, layout, labels, classNames, drag } = t0;
|
|
882
1877
|
const { key, name, hidden, pinned, index } = row;
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1878
|
+
const t1 = hidden || void 0;
|
|
1879
|
+
const t2 = classNames.columnMenuItem;
|
|
1880
|
+
let t3;
|
|
1881
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1882
|
+
t3 = { cursor: "grab" };
|
|
1883
|
+
$[0] = t3;
|
|
1884
|
+
} else t3 = $[0];
|
|
1885
|
+
let t4;
|
|
1886
|
+
if ($[1] !== drag || $[2] !== index || $[3] !== key) {
|
|
1887
|
+
t4 = drag.rowDragProps(key, index);
|
|
1888
|
+
$[1] = drag;
|
|
1889
|
+
$[2] = index;
|
|
1890
|
+
$[3] = key;
|
|
1891
|
+
$[4] = t4;
|
|
1892
|
+
} else t4 = $[4];
|
|
1893
|
+
let t5;
|
|
1894
|
+
if ($[5] !== drag || $[6] !== index || $[7] !== layout.move) {
|
|
1895
|
+
t5 = drag.dropProps(index, layout.move);
|
|
1896
|
+
$[5] = drag;
|
|
1897
|
+
$[6] = index;
|
|
1898
|
+
$[7] = layout.move;
|
|
1899
|
+
$[8] = t5;
|
|
1900
|
+
} else t5 = $[8];
|
|
1901
|
+
let t6;
|
|
1902
|
+
if ($[9] !== drag || $[10] !== index || $[11] !== key) {
|
|
1903
|
+
t6 = drag.rowAttrs(key, index);
|
|
1904
|
+
$[9] = drag;
|
|
1905
|
+
$[10] = index;
|
|
1906
|
+
$[11] = key;
|
|
1907
|
+
$[12] = t6;
|
|
1908
|
+
} else t6 = $[12];
|
|
1909
|
+
const t7 = classNames.columnMenuGrip;
|
|
1910
|
+
const t8 = `${labels.moveStart} / ${labels.moveEnd}: ${name}`;
|
|
1911
|
+
let t9;
|
|
1912
|
+
if ($[13] !== index || $[14] !== key || $[15] !== layout.move || $[16] !== t8) {
|
|
1913
|
+
t9 = (0, _adapttable_core.columnReorderKeyProps)(key, index, layout.move, t8);
|
|
1914
|
+
$[13] = index;
|
|
1915
|
+
$[14] = key;
|
|
1916
|
+
$[15] = layout.move;
|
|
1917
|
+
$[16] = t8;
|
|
1918
|
+
$[17] = t9;
|
|
1919
|
+
} else t9 = $[17];
|
|
1920
|
+
let t10;
|
|
1921
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1922
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.GripIcon, {});
|
|
1923
|
+
$[18] = t10;
|
|
1924
|
+
} else t10 = $[18];
|
|
1925
|
+
let t11;
|
|
1926
|
+
if ($[19] !== classNames.columnMenuGrip || $[20] !== t9) {
|
|
1927
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1928
|
+
"data-adapttable-part": "column-menu-grip",
|
|
1929
|
+
className: t7,
|
|
1930
|
+
...t9,
|
|
1931
|
+
children: t10
|
|
1932
|
+
});
|
|
1933
|
+
$[19] = classNames.columnMenuGrip;
|
|
1934
|
+
$[20] = t9;
|
|
1935
|
+
$[21] = t11;
|
|
1936
|
+
} else t11 = $[21];
|
|
1937
|
+
let t12;
|
|
1938
|
+
if ($[22] !== key || $[23] !== layout) {
|
|
1939
|
+
t12 = () => layout.toggleVisible(key);
|
|
1940
|
+
$[22] = key;
|
|
1941
|
+
$[23] = layout;
|
|
1942
|
+
$[24] = t12;
|
|
1943
|
+
} else t12 = $[24];
|
|
1944
|
+
let t13;
|
|
1945
|
+
if ($[25] !== classNames || $[26] !== hidden || $[27] !== labels || $[28] !== name || $[29] !== t12) {
|
|
1946
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VisibilityToggle, {
|
|
1947
|
+
hidden,
|
|
1948
|
+
name,
|
|
1949
|
+
labels,
|
|
1950
|
+
classNames,
|
|
1951
|
+
onToggle: t12
|
|
1952
|
+
});
|
|
1953
|
+
$[25] = classNames;
|
|
1954
|
+
$[26] = hidden;
|
|
1955
|
+
$[27] = labels;
|
|
1956
|
+
$[28] = name;
|
|
1957
|
+
$[29] = t12;
|
|
1958
|
+
$[30] = t13;
|
|
1959
|
+
} else t13 = $[30];
|
|
1960
|
+
let t14;
|
|
1961
|
+
if ($[31] !== classNames || $[32] !== hidden || $[33] !== name) {
|
|
1962
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowName, {
|
|
1963
|
+
hidden,
|
|
1964
|
+
name,
|
|
1965
|
+
classNames
|
|
1966
|
+
});
|
|
1967
|
+
$[31] = classNames;
|
|
1968
|
+
$[32] = hidden;
|
|
1969
|
+
$[33] = name;
|
|
1970
|
+
$[34] = t14;
|
|
1971
|
+
} else t14 = $[34];
|
|
1972
|
+
const t15 = pinned !== void 0;
|
|
1973
|
+
let t16;
|
|
1974
|
+
if ($[35] !== labels || $[36] !== pinned) {
|
|
1975
|
+
t16 = (0, _adapttable_core.pinActionLabel)(pinned, labels);
|
|
1976
|
+
$[35] = labels;
|
|
1977
|
+
$[36] = pinned;
|
|
1978
|
+
$[37] = t16;
|
|
1979
|
+
} else t16 = $[37];
|
|
1980
|
+
const t17 = `${t16}: ${name}`;
|
|
1981
|
+
let t18;
|
|
1982
|
+
if ($[38] !== key || $[39] !== layout || $[40] !== pinned) {
|
|
1983
|
+
t18 = () => layout.setPinned(key, (0, _adapttable_core.nextPinSide)(pinned));
|
|
1984
|
+
$[38] = key;
|
|
1985
|
+
$[39] = layout;
|
|
1986
|
+
$[40] = pinned;
|
|
1987
|
+
$[41] = t18;
|
|
1988
|
+
} else t18 = $[41];
|
|
1989
|
+
let t19;
|
|
1990
|
+
if ($[42] !== classNames || $[43] !== t15 || $[44] !== t17 || $[45] !== t18) {
|
|
1991
|
+
t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
1992
|
+
active: t15,
|
|
1993
|
+
actionLabel: t17,
|
|
1994
|
+
classNames,
|
|
1995
|
+
onClick: t18
|
|
1996
|
+
});
|
|
1997
|
+
$[42] = classNames;
|
|
1998
|
+
$[43] = t15;
|
|
1999
|
+
$[44] = t17;
|
|
2000
|
+
$[45] = t18;
|
|
2001
|
+
$[46] = t19;
|
|
2002
|
+
} else t19 = $[46];
|
|
2003
|
+
let t20;
|
|
2004
|
+
if ($[47] !== classNames.columnMenuItem || $[48] !== pinned || $[49] !== t1 || $[50] !== t11 || $[51] !== t13 || $[52] !== t14 || $[53] !== t19 || $[54] !== t4 || $[55] !== t5 || $[56] !== t6) {
|
|
2005
|
+
t20 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2006
|
+
"data-adapttable-part": "column-menu-item",
|
|
2007
|
+
"data-hidden": t1,
|
|
2008
|
+
"data-pinned": pinned,
|
|
2009
|
+
className: t2,
|
|
2010
|
+
style: t3,
|
|
2011
|
+
...t4,
|
|
2012
|
+
...t5,
|
|
2013
|
+
...t6,
|
|
2014
|
+
children: [
|
|
2015
|
+
t11,
|
|
2016
|
+
t13,
|
|
2017
|
+
t14,
|
|
2018
|
+
t19
|
|
2019
|
+
]
|
|
2020
|
+
});
|
|
2021
|
+
$[47] = classNames.columnMenuItem;
|
|
2022
|
+
$[48] = pinned;
|
|
2023
|
+
$[49] = t1;
|
|
2024
|
+
$[50] = t11;
|
|
2025
|
+
$[51] = t13;
|
|
2026
|
+
$[52] = t14;
|
|
2027
|
+
$[53] = t19;
|
|
2028
|
+
$[54] = t4;
|
|
2029
|
+
$[55] = t5;
|
|
2030
|
+
$[56] = t6;
|
|
2031
|
+
$[57] = t20;
|
|
2032
|
+
} else t20 = $[57];
|
|
2033
|
+
return t20;
|
|
919
2034
|
}
|
|
920
2035
|
/**
|
|
921
2036
|
* The injected row-actions column as a first-class menu row: the same eye
|
|
922
2037
|
* toggle as a data column plus a ONE-CLICK end-pin toggle (right ↔ unpinned).
|
|
923
2038
|
* The column always trails, so there is no left pin and no reorder grip.
|
|
924
2039
|
*/
|
|
925
|
-
function ActionsMenuRowItem(
|
|
926
|
-
const
|
|
2040
|
+
function ActionsMenuRowItem(t0) {
|
|
2041
|
+
const $ = (0, react_compiler_runtime.c)(29);
|
|
2042
|
+
const { layout, labels, classNames } = t0;
|
|
2043
|
+
let t1;
|
|
2044
|
+
if ($[0] !== layout) {
|
|
2045
|
+
t1 = layout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
2046
|
+
$[0] = layout;
|
|
2047
|
+
$[1] = t1;
|
|
2048
|
+
} else t1 = $[1];
|
|
2049
|
+
const hidden = t1;
|
|
927
2050
|
const pinned = layout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] !== void 0;
|
|
928
2051
|
const name = labels.actions;
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
2052
|
+
const t2 = hidden || void 0;
|
|
2053
|
+
const t3 = pinned ? "end" : void 0;
|
|
2054
|
+
let t4;
|
|
2055
|
+
if ($[2] !== layout) {
|
|
2056
|
+
t4 = () => layout.toggleVisible(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
2057
|
+
$[2] = layout;
|
|
2058
|
+
$[3] = t4;
|
|
2059
|
+
} else t4 = $[3];
|
|
2060
|
+
let t5;
|
|
2061
|
+
if ($[4] !== classNames || $[5] !== hidden || $[6] !== labels || $[7] !== name || $[8] !== t4) {
|
|
2062
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VisibilityToggle, {
|
|
2063
|
+
hidden,
|
|
2064
|
+
name,
|
|
2065
|
+
labels,
|
|
2066
|
+
classNames,
|
|
2067
|
+
onToggle: t4
|
|
2068
|
+
});
|
|
2069
|
+
$[4] = classNames;
|
|
2070
|
+
$[5] = hidden;
|
|
2071
|
+
$[6] = labels;
|
|
2072
|
+
$[7] = name;
|
|
2073
|
+
$[8] = t4;
|
|
2074
|
+
$[9] = t5;
|
|
2075
|
+
} else t5 = $[9];
|
|
2076
|
+
let t6;
|
|
2077
|
+
if ($[10] !== classNames || $[11] !== hidden || $[12] !== name) {
|
|
2078
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowName, {
|
|
2079
|
+
hidden,
|
|
2080
|
+
name,
|
|
2081
|
+
classNames
|
|
2082
|
+
});
|
|
2083
|
+
$[10] = classNames;
|
|
2084
|
+
$[11] = hidden;
|
|
2085
|
+
$[12] = name;
|
|
2086
|
+
$[13] = t6;
|
|
2087
|
+
} else t6 = $[13];
|
|
2088
|
+
const t7 = `${pinned ? labels.unpin : labels.pinEnd}: ${name}`;
|
|
2089
|
+
let t8;
|
|
2090
|
+
if ($[14] !== layout || $[15] !== pinned) {
|
|
2091
|
+
t8 = () => layout.setPinned(_adapttable_core.ACTIONS_COLUMN_KEY, pinned ? void 0 : "end");
|
|
2092
|
+
$[14] = layout;
|
|
2093
|
+
$[15] = pinned;
|
|
2094
|
+
$[16] = t8;
|
|
2095
|
+
} else t8 = $[16];
|
|
2096
|
+
let t9;
|
|
2097
|
+
if ($[17] !== classNames || $[18] !== pinned || $[19] !== t7 || $[20] !== t8) {
|
|
2098
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
2099
|
+
active: pinned,
|
|
2100
|
+
actionLabel: t7,
|
|
2101
|
+
classNames,
|
|
2102
|
+
onClick: t8
|
|
2103
|
+
});
|
|
2104
|
+
$[17] = classNames;
|
|
2105
|
+
$[18] = pinned;
|
|
2106
|
+
$[19] = t7;
|
|
2107
|
+
$[20] = t8;
|
|
2108
|
+
$[21] = t9;
|
|
2109
|
+
} else t9 = $[21];
|
|
2110
|
+
let t10;
|
|
2111
|
+
if ($[22] !== classNames.columnMenuItem || $[23] !== t2 || $[24] !== t3 || $[25] !== t5 || $[26] !== t6 || $[27] !== t9) {
|
|
2112
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2113
|
+
"data-adapttable-part": "column-menu-item",
|
|
2114
|
+
"data-actions": "",
|
|
2115
|
+
"data-hidden": t2,
|
|
2116
|
+
"data-pinned": t3,
|
|
2117
|
+
className: classNames.columnMenuItem,
|
|
2118
|
+
children: [
|
|
2119
|
+
t5,
|
|
2120
|
+
t6,
|
|
2121
|
+
t9
|
|
2122
|
+
]
|
|
2123
|
+
});
|
|
2124
|
+
$[22] = classNames.columnMenuItem;
|
|
2125
|
+
$[23] = t2;
|
|
2126
|
+
$[24] = t3;
|
|
2127
|
+
$[25] = t5;
|
|
2128
|
+
$[26] = t6;
|
|
2129
|
+
$[27] = t9;
|
|
2130
|
+
$[28] = t10;
|
|
2131
|
+
} else t10 = $[28];
|
|
2132
|
+
return t10;
|
|
956
2133
|
}
|
|
957
2134
|
/**
|
|
958
2135
|
* Column-management popover: a disclosure button + a panel where each column
|
|
@@ -960,29 +2137,56 @@ function ActionsMenuRowItem({ layout, labels, classNames }) {
|
|
|
960
2137
|
* Closes on outside-click or Escape. Ships no styles — target the
|
|
961
2138
|
* `data-adapttable-part` hooks or the `columnMenu*` className slots.
|
|
962
2139
|
*/
|
|
963
|
-
function ColumnMenu(
|
|
2140
|
+
function ColumnMenu(t0) {
|
|
2141
|
+
const $ = (0, react_compiler_runtime.c)(24);
|
|
2142
|
+
const { allColumns, layout, labels, classNames, hasRowActions } = t0;
|
|
964
2143
|
const drag = (0, _adapttable_core.useColumnDragState)();
|
|
965
2144
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
2145
|
+
let t1;
|
|
2146
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2147
|
+
t1 = { position: "relative" };
|
|
2148
|
+
$[0] = t1;
|
|
2149
|
+
} else t1 = $[0];
|
|
2150
|
+
const t2 = open || void 0;
|
|
2151
|
+
let t3;
|
|
2152
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2153
|
+
t3 = {
|
|
2154
|
+
flexShrink: 0,
|
|
2155
|
+
whiteSpace: "nowrap"
|
|
2156
|
+
};
|
|
2157
|
+
$[1] = t3;
|
|
2158
|
+
} else t3 = $[1];
|
|
2159
|
+
let t4;
|
|
2160
|
+
if ($[2] !== setOpen) {
|
|
2161
|
+
t4 = () => setOpen(_temp);
|
|
2162
|
+
$[2] = setOpen;
|
|
2163
|
+
$[3] = t4;
|
|
2164
|
+
} else t4 = $[3];
|
|
2165
|
+
let t5;
|
|
2166
|
+
if ($[4] !== classNames.columnMenuButton || $[5] !== labels.columns || $[6] !== open || $[7] !== t2 || $[8] !== t4 || $[9] !== triggerRef) {
|
|
2167
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
972
2168
|
ref: triggerRef,
|
|
973
2169
|
type: "button",
|
|
974
2170
|
"aria-expanded": open,
|
|
975
2171
|
"aria-haspopup": "true",
|
|
976
2172
|
"data-adapttable-part": "column-menu-button",
|
|
977
|
-
"data-active":
|
|
2173
|
+
"data-active": t2,
|
|
978
2174
|
className: classNames.columnMenuButton,
|
|
979
|
-
style:
|
|
980
|
-
|
|
981
|
-
whiteSpace: "nowrap"
|
|
982
|
-
},
|
|
983
|
-
onClick: () => setOpen((v) => !v),
|
|
2175
|
+
style: t3,
|
|
2176
|
+
onClick: t4,
|
|
984
2177
|
children: labels.columns
|
|
985
|
-
})
|
|
2178
|
+
});
|
|
2179
|
+
$[4] = classNames.columnMenuButton;
|
|
2180
|
+
$[5] = labels.columns;
|
|
2181
|
+
$[6] = open;
|
|
2182
|
+
$[7] = t2;
|
|
2183
|
+
$[8] = t4;
|
|
2184
|
+
$[9] = triggerRef;
|
|
2185
|
+
$[10] = t5;
|
|
2186
|
+
} else t5 = $[10];
|
|
2187
|
+
let t6;
|
|
2188
|
+
if ($[11] !== allColumns || $[12] !== classNames || $[13] !== drag || $[14] !== hasRowActions || $[15] !== labels || $[16] !== layout || $[17] !== open) {
|
|
2189
|
+
t6 = open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
986
2190
|
"aria-label": labels.columns,
|
|
987
2191
|
"data-adapttable-part": "column-menu-panel",
|
|
988
2192
|
className: classNames.columnMenuPanel,
|
|
@@ -1020,8 +2224,35 @@ function ColumnMenu({ allColumns, layout, labels, classNames, hasRowActions }) {
|
|
|
1020
2224
|
children: labels.resetColumns
|
|
1021
2225
|
})
|
|
1022
2226
|
]
|
|
1023
|
-
})
|
|
1024
|
-
|
|
2227
|
+
});
|
|
2228
|
+
$[11] = allColumns;
|
|
2229
|
+
$[12] = classNames;
|
|
2230
|
+
$[13] = drag;
|
|
2231
|
+
$[14] = hasRowActions;
|
|
2232
|
+
$[15] = labels;
|
|
2233
|
+
$[16] = layout;
|
|
2234
|
+
$[17] = open;
|
|
2235
|
+
$[18] = t6;
|
|
2236
|
+
} else t6 = $[18];
|
|
2237
|
+
let t7;
|
|
2238
|
+
if ($[19] !== classNames.columnMenu || $[20] !== rootRef || $[21] !== t5 || $[22] !== t6) {
|
|
2239
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2240
|
+
ref: rootRef,
|
|
2241
|
+
"data-adapttable-part": "column-menu",
|
|
2242
|
+
className: classNames.columnMenu,
|
|
2243
|
+
style: t1,
|
|
2244
|
+
children: [t5, t6]
|
|
2245
|
+
});
|
|
2246
|
+
$[19] = classNames.columnMenu;
|
|
2247
|
+
$[20] = rootRef;
|
|
2248
|
+
$[21] = t5;
|
|
2249
|
+
$[22] = t6;
|
|
2250
|
+
$[23] = t7;
|
|
2251
|
+
} else t7 = $[23];
|
|
2252
|
+
return t7;
|
|
2253
|
+
}
|
|
2254
|
+
function _temp(v) {
|
|
2255
|
+
return !v;
|
|
1025
2256
|
}
|
|
1026
2257
|
//#endregion
|
|
1027
2258
|
//#region src/components/tables.tsx
|
|
@@ -1053,75 +2284,173 @@ function scrollBoxStyle(maxHeight, scrollX) {
|
|
|
1053
2284
|
};
|
|
1054
2285
|
return scrollX ? { overflowX: "auto" } : void 0;
|
|
1055
2286
|
}
|
|
1056
|
-
function RowActionButtons(
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
2287
|
+
function RowActionButtons(t0) {
|
|
2288
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
2289
|
+
const { row, actions, confirm, cancelLabel, classNames } = t0;
|
|
2290
|
+
let t1;
|
|
2291
|
+
if ($[0] !== actions || $[1] !== cancelLabel || $[2] !== classNames || $[3] !== confirm || $[4] !== row) {
|
|
2292
|
+
let t2;
|
|
2293
|
+
if ($[6] !== cancelLabel || $[7] !== classNames || $[8] !== confirm || $[9] !== row) {
|
|
2294
|
+
t2 = (action) => {
|
|
2295
|
+
if (action.isHidden?.(row)) return null;
|
|
2296
|
+
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(row));
|
|
2297
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
2298
|
+
const handleClick = disabled ? void 0 : (e) => {
|
|
2299
|
+
e.stopPropagation();
|
|
2300
|
+
(0, _adapttable_core.runRowAction)(action, row, confirm, cancelLabel);
|
|
2301
|
+
};
|
|
2302
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2303
|
+
type: "button",
|
|
2304
|
+
disabled,
|
|
2305
|
+
title: reason,
|
|
2306
|
+
"aria-label": action.label,
|
|
2307
|
+
"data-adapttable-part": "action-button",
|
|
2308
|
+
"data-color": action.color,
|
|
2309
|
+
className: classNames.actionButton,
|
|
2310
|
+
onClick: handleClick,
|
|
2311
|
+
children: action.icon ?? action.label
|
|
2312
|
+
}, action.key);
|
|
2313
|
+
};
|
|
2314
|
+
$[6] = cancelLabel;
|
|
2315
|
+
$[7] = classNames;
|
|
2316
|
+
$[8] = confirm;
|
|
2317
|
+
$[9] = row;
|
|
2318
|
+
$[10] = t2;
|
|
2319
|
+
} else t2 = $[10];
|
|
2320
|
+
t1 = actions.map(t2);
|
|
2321
|
+
$[0] = actions;
|
|
2322
|
+
$[1] = cancelLabel;
|
|
2323
|
+
$[2] = classNames;
|
|
2324
|
+
$[3] = confirm;
|
|
2325
|
+
$[4] = row;
|
|
2326
|
+
$[5] = t1;
|
|
2327
|
+
} else t1 = $[5];
|
|
2328
|
+
let t2;
|
|
2329
|
+
if ($[11] !== t1) {
|
|
2330
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
2331
|
+
$[11] = t1;
|
|
2332
|
+
$[12] = t2;
|
|
2333
|
+
} else t2 = $[12];
|
|
2334
|
+
return t2;
|
|
1077
2335
|
}
|
|
1078
2336
|
/**
|
|
1079
2337
|
* The expand/collapse chevron, shared by desktop rows and mobile cards. The
|
|
1080
2338
|
* `data-expanded` attribute is the styling hook for rotating the glyph
|
|
1081
2339
|
* (`rowClickProps`' interactive-child guard keeps the click off the row).
|
|
1082
2340
|
*/
|
|
1083
|
-
function ExpandButton(
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
2341
|
+
function ExpandButton(t0) {
|
|
2342
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
2343
|
+
const { expanded, labels, classNames, onToggle } = t0;
|
|
2344
|
+
const t1 = expanded ? "" : void 0;
|
|
2345
|
+
const t2 = expanded ? labels.collapseRow : labels.expandRow;
|
|
2346
|
+
let t3;
|
|
2347
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2348
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronIcon, { size: 14 });
|
|
2349
|
+
$[0] = t3;
|
|
2350
|
+
} else t3 = $[0];
|
|
2351
|
+
let t4;
|
|
2352
|
+
if ($[1] !== classNames.expandButton || $[2] !== expanded || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2) {
|
|
2353
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2354
|
+
type: "button",
|
|
2355
|
+
"data-adapttable-part": "expand-button",
|
|
2356
|
+
"data-expanded": t1,
|
|
2357
|
+
className: classNames.expandButton,
|
|
2358
|
+
"aria-expanded": expanded,
|
|
2359
|
+
"aria-label": t2,
|
|
2360
|
+
onClick: onToggle,
|
|
2361
|
+
children: t3
|
|
2362
|
+
});
|
|
2363
|
+
$[1] = classNames.expandButton;
|
|
2364
|
+
$[2] = expanded;
|
|
2365
|
+
$[3] = onToggle;
|
|
2366
|
+
$[4] = t1;
|
|
2367
|
+
$[5] = t2;
|
|
2368
|
+
$[6] = t4;
|
|
2369
|
+
} else t4 = $[6];
|
|
2370
|
+
return t4;
|
|
1094
2371
|
}
|
|
1095
2372
|
/**
|
|
2373
|
+
* Props for the memoized desktop row. The comparator below checks ONLY the
|
|
2374
|
+
* visual inputs (row data, selected/expanded state, column + width + class
|
|
2375
|
+
* identities, the pin signature); everything else — `table`, the latest-ref
|
|
2376
|
+
* callback wrappers, `confirm`, `pinOffset`, `measureElement` — is either
|
|
2377
|
+
* stable or only consulted when one of the compared inputs re-renders the
|
|
2378
|
+
* row, so a fresh identity there must not (and does not) defeat the memo.
|
|
2379
|
+
*/
|
|
2380
|
+
/**
|
|
1096
2381
|
* `React.memo` comparator: re-render a row only when one of its VISUAL
|
|
1097
2382
|
* inputs changes. A search keystroke or another row's checkbox re-renders
|
|
1098
2383
|
* the table shell, but every unchanged row bails out here (accessors and
|
|
1099
2384
|
* Cell render-props are not re-invoked).
|
|
1100
2385
|
*/
|
|
1101
2386
|
function desktopRowPropsEqual(prev, next) {
|
|
1102
|
-
return prev.row === next.row && prev.index === next.index && prev.id === next.id && prev.selected === next.selected && prev.expanded === next.expanded && prev.columns === next.columns && prev.labels === next.labels && prev.classNames === next.classNames && prev.showActions === next.showActions && prev.rowActions === next.rowActions && prev.columnSpan === next.columnSpan && prev.columnWidths === next.columnWidths && prev.pinSignature === next.pinSignature && prev.
|
|
2387
|
+
return prev.row === next.row && prev.index === next.index && prev.id === next.id && prev.selected === next.selected && prev.expanded === next.expanded && prev.columns === next.columns && prev.labels === next.labels && prev.classNames === next.classNames && prev.showActions === next.showActions && prev.rowActions === next.rowActions && prev.columnSpan === next.columnSpan && prev.columnWidths === next.columnWidths && prev.pinSignature === next.pinSignature && prev.hasStartPin === next.hasStartPin && prev.hasEndPin === next.hasEndPin && prev.actionsPinned === next.actionsPinned && prev.rowClass === next.rowClass && prev.clickable === next.clickable && prev.hasPrefetch === next.hasPrefetch;
|
|
1103
2388
|
}
|
|
1104
2389
|
function DesktopRowBase(props) {
|
|
1105
|
-
const
|
|
2390
|
+
const $ = (0, react_compiler_runtime.c)(98);
|
|
2391
|
+
const { row, index, id, table, columns, labels, classNames, selected, expanded, showActions, rowActions, confirm, columnSpan, pinOffset, hasStartPin, hasEndPin, actionsPinned, rowClass, clickable, hasPrefetch, onRowClick, onPrefetch, onToggleSelect, onToggleExpand, renderDetail, measureElement } = props;
|
|
1106
2392
|
const expandable = expanded !== void 0;
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
2393
|
+
const t0 = selected === void 0 ? 0 : SELECTION_WIDTH;
|
|
2394
|
+
const t1 = showActions ? ACTIONS_WIDTH : 0;
|
|
2395
|
+
let t10;
|
|
2396
|
+
let t11;
|
|
2397
|
+
let t12;
|
|
2398
|
+
let t2;
|
|
2399
|
+
let t3;
|
|
2400
|
+
let t4;
|
|
2401
|
+
let t5;
|
|
2402
|
+
let t6;
|
|
2403
|
+
let t7;
|
|
2404
|
+
let t8;
|
|
2405
|
+
let t9;
|
|
2406
|
+
if ($[0] !== classNames || $[1] !== clickable || $[2] !== columns || $[3] !== expandable || $[4] !== expanded || $[5] !== hasPrefetch || $[6] !== hasStartPin || $[7] !== id || $[8] !== index || $[9] !== labels || $[10] !== measureElement || $[11] !== onPrefetch || $[12] !== onRowClick || $[13] !== onToggleExpand || $[14] !== onToggleSelect || $[15] !== pinOffset || $[16] !== row || $[17] !== rowClass || $[18] !== selected || $[19] !== t0 || $[20] !== t1 || $[21] !== table) {
|
|
2407
|
+
const leads = {
|
|
2408
|
+
start: t0,
|
|
2409
|
+
end: t1
|
|
2410
|
+
};
|
|
2411
|
+
const bodyPinStyle = (key) => (0, _adapttable_core.pinnedCellStyle)(pinOffset?.(key), _adapttable_core.PIN_Z.body, leads);
|
|
2412
|
+
let t13;
|
|
2413
|
+
if ($[33] !== index || $[34] !== row || $[35] !== table) {
|
|
2414
|
+
t13 = table.getRowProps(row, index);
|
|
2415
|
+
$[33] = index;
|
|
2416
|
+
$[34] = row;
|
|
2417
|
+
$[35] = table;
|
|
2418
|
+
$[36] = t13;
|
|
2419
|
+
} else t13 = $[36];
|
|
2420
|
+
let rowProps;
|
|
2421
|
+
if ($[37] !== t13) {
|
|
2422
|
+
rowProps = { ...t13 };
|
|
2423
|
+
delete rowProps.key;
|
|
2424
|
+
$[37] = t13;
|
|
2425
|
+
$[38] = rowProps;
|
|
2426
|
+
} else rowProps = $[38];
|
|
2427
|
+
t2 = rowProps;
|
|
2428
|
+
const t14 = clickable ? onRowClick : void 0;
|
|
2429
|
+
if ($[39] !== row || $[40] !== t14) {
|
|
2430
|
+
t3 = (0, _adapttable_core.rowClickProps)(row, t14);
|
|
2431
|
+
$[39] = row;
|
|
2432
|
+
$[40] = t14;
|
|
2433
|
+
$[41] = t3;
|
|
2434
|
+
} else t3 = $[41];
|
|
2435
|
+
t4 = measureElement;
|
|
2436
|
+
t5 = "row";
|
|
2437
|
+
t6 = selected ? "" : void 0;
|
|
2438
|
+
t7 = clickable ? "" : void 0;
|
|
2439
|
+
if ($[42] !== classNames.row || $[43] !== rowClass) {
|
|
2440
|
+
t8 = cx(classNames.row, rowClass);
|
|
2441
|
+
$[42] = classNames.row;
|
|
2442
|
+
$[43] = rowClass;
|
|
2443
|
+
$[44] = t8;
|
|
2444
|
+
} else t8 = $[44];
|
|
2445
|
+
if ($[45] !== hasPrefetch || $[46] !== onPrefetch || $[47] !== row) {
|
|
2446
|
+
t9 = hasPrefetch ? () => onPrefetch(row) : void 0;
|
|
2447
|
+
$[45] = hasPrefetch;
|
|
2448
|
+
$[46] = onPrefetch;
|
|
2449
|
+
$[47] = row;
|
|
2450
|
+
$[48] = t9;
|
|
2451
|
+
} else t9 = $[48];
|
|
2452
|
+
if ($[49] !== classNames || $[50] !== expandable || $[51] !== expanded || $[52] !== id || $[53] !== labels || $[54] !== onToggleExpand) {
|
|
2453
|
+
t10 = expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1125
2454
|
"data-adapttable-part": "expand-cell",
|
|
1126
2455
|
className: classNames.expandCell,
|
|
1127
2456
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandButton, {
|
|
@@ -1130,11 +2459,20 @@ function DesktopRowBase(props) {
|
|
|
1130
2459
|
classNames,
|
|
1131
2460
|
onToggle: () => onToggleExpand(id)
|
|
1132
2461
|
})
|
|
1133
|
-
})
|
|
1134
|
-
|
|
2462
|
+
});
|
|
2463
|
+
$[49] = classNames;
|
|
2464
|
+
$[50] = expandable;
|
|
2465
|
+
$[51] = expanded;
|
|
2466
|
+
$[52] = id;
|
|
2467
|
+
$[53] = labels;
|
|
2468
|
+
$[54] = onToggleExpand;
|
|
2469
|
+
$[55] = t10;
|
|
2470
|
+
} else t10 = $[55];
|
|
2471
|
+
if ($[56] !== classNames.cell || $[57] !== classNames.checkbox || $[58] !== classNames.selectionCell || $[59] !== hasStartPin || $[60] !== id || $[61] !== labels || $[62] !== onToggleSelect || $[63] !== selected) {
|
|
2472
|
+
t11 = selected !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1135
2473
|
"data-adapttable-part": "selection-cell",
|
|
1136
|
-
"data-pinned":
|
|
1137
|
-
style: (0, _adapttable_core.edgePinStyle)("
|
|
2474
|
+
"data-pinned": hasStartPin ? "start" : void 0,
|
|
2475
|
+
style: (0, _adapttable_core.edgePinStyle)("start", hasStartPin, _adapttable_core.PIN_Z.body),
|
|
1138
2476
|
className: cx(classNames.cell, classNames.selectionCell),
|
|
1139
2477
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1140
2478
|
type: "checkbox",
|
|
@@ -1143,44 +2481,162 @@ function DesktopRowBase(props) {
|
|
|
1143
2481
|
onChange: () => onToggleSelect(id),
|
|
1144
2482
|
className: classNames.checkbox
|
|
1145
2483
|
})
|
|
1146
|
-
})
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
"data-adapttable-part": "
|
|
1162
|
-
"data-pinned":
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
2484
|
+
});
|
|
2485
|
+
$[56] = classNames.cell;
|
|
2486
|
+
$[57] = classNames.checkbox;
|
|
2487
|
+
$[58] = classNames.selectionCell;
|
|
2488
|
+
$[59] = hasStartPin;
|
|
2489
|
+
$[60] = id;
|
|
2490
|
+
$[61] = labels;
|
|
2491
|
+
$[62] = onToggleSelect;
|
|
2492
|
+
$[63] = selected;
|
|
2493
|
+
$[64] = t11;
|
|
2494
|
+
} else t11 = $[64];
|
|
2495
|
+
t12 = columns.map((column) => {
|
|
2496
|
+
const pinStyle = bodyPinStyle(column.key);
|
|
2497
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2498
|
+
...table.getCellProps(column, pinStyle && { style: pinStyle }),
|
|
2499
|
+
"data-adapttable-part": "cell",
|
|
2500
|
+
"data-pinned": pinOffset?.(column.key)?.side,
|
|
2501
|
+
className: classNames.cell,
|
|
2502
|
+
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
1166
2503
|
row,
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
2504
|
+
rowIndex: index
|
|
2505
|
+
}) : column.accessor?.(row)
|
|
2506
|
+
}, column.key);
|
|
2507
|
+
});
|
|
2508
|
+
$[0] = classNames;
|
|
2509
|
+
$[1] = clickable;
|
|
2510
|
+
$[2] = columns;
|
|
2511
|
+
$[3] = expandable;
|
|
2512
|
+
$[4] = expanded;
|
|
2513
|
+
$[5] = hasPrefetch;
|
|
2514
|
+
$[6] = hasStartPin;
|
|
2515
|
+
$[7] = id;
|
|
2516
|
+
$[8] = index;
|
|
2517
|
+
$[9] = labels;
|
|
2518
|
+
$[10] = measureElement;
|
|
2519
|
+
$[11] = onPrefetch;
|
|
2520
|
+
$[12] = onRowClick;
|
|
2521
|
+
$[13] = onToggleExpand;
|
|
2522
|
+
$[14] = onToggleSelect;
|
|
2523
|
+
$[15] = pinOffset;
|
|
2524
|
+
$[16] = row;
|
|
2525
|
+
$[17] = rowClass;
|
|
2526
|
+
$[18] = selected;
|
|
2527
|
+
$[19] = t0;
|
|
2528
|
+
$[20] = t1;
|
|
2529
|
+
$[21] = table;
|
|
2530
|
+
$[22] = t10;
|
|
2531
|
+
$[23] = t11;
|
|
2532
|
+
$[24] = t12;
|
|
2533
|
+
$[25] = t2;
|
|
2534
|
+
$[26] = t3;
|
|
2535
|
+
$[27] = t4;
|
|
2536
|
+
$[28] = t5;
|
|
2537
|
+
$[29] = t6;
|
|
2538
|
+
$[30] = t7;
|
|
2539
|
+
$[31] = t8;
|
|
2540
|
+
$[32] = t9;
|
|
2541
|
+
} else {
|
|
2542
|
+
t10 = $[22];
|
|
2543
|
+
t11 = $[23];
|
|
2544
|
+
t12 = $[24];
|
|
2545
|
+
t2 = $[25];
|
|
2546
|
+
t3 = $[26];
|
|
2547
|
+
t4 = $[27];
|
|
2548
|
+
t5 = $[28];
|
|
2549
|
+
t6 = $[29];
|
|
2550
|
+
t7 = $[30];
|
|
2551
|
+
t8 = $[31];
|
|
2552
|
+
t9 = $[32];
|
|
2553
|
+
}
|
|
2554
|
+
let t13;
|
|
2555
|
+
if ($[65] !== actionsPinned || $[66] !== classNames || $[67] !== confirm || $[68] !== hasEndPin || $[69] !== labels || $[70] !== row || $[71] !== rowActions || $[72] !== showActions) {
|
|
2556
|
+
t13 = showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2557
|
+
"data-adapttable-part": "actions-cell",
|
|
2558
|
+
"data-pinned": hasEndPin || actionsPinned ? "end" : void 0,
|
|
2559
|
+
style: (0, _adapttable_core.edgePinStyle)("end", hasEndPin || actionsPinned, _adapttable_core.PIN_Z.body),
|
|
2560
|
+
className: cx(classNames.cell, classNames.actionsCell),
|
|
2561
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
2562
|
+
row,
|
|
2563
|
+
actions: rowActions,
|
|
2564
|
+
confirm,
|
|
2565
|
+
cancelLabel: labels.cancel,
|
|
2566
|
+
classNames
|
|
1172
2567
|
})
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
}
|
|
2568
|
+
});
|
|
2569
|
+
$[65] = actionsPinned;
|
|
2570
|
+
$[66] = classNames;
|
|
2571
|
+
$[67] = confirm;
|
|
2572
|
+
$[68] = hasEndPin;
|
|
2573
|
+
$[69] = labels;
|
|
2574
|
+
$[70] = row;
|
|
2575
|
+
$[71] = rowActions;
|
|
2576
|
+
$[72] = showActions;
|
|
2577
|
+
$[73] = t13;
|
|
2578
|
+
} else t13 = $[73];
|
|
2579
|
+
let t14;
|
|
2580
|
+
if ($[74] !== t10 || $[75] !== t11 || $[76] !== t12 || $[77] !== t13 || $[78] !== t2 || $[79] !== t3 || $[80] !== t4 || $[81] !== t5 || $[82] !== t6 || $[83] !== t7 || $[84] !== t8 || $[85] !== t9) {
|
|
2581
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", {
|
|
2582
|
+
...t2,
|
|
2583
|
+
...t3,
|
|
2584
|
+
ref: t4,
|
|
2585
|
+
"data-adapttable-part": t5,
|
|
2586
|
+
"data-selected": t6,
|
|
2587
|
+
"data-clickable": t7,
|
|
2588
|
+
className: t8,
|
|
2589
|
+
onMouseEnter: t9,
|
|
2590
|
+
children: [
|
|
2591
|
+
t10,
|
|
2592
|
+
t11,
|
|
2593
|
+
t12,
|
|
2594
|
+
t13
|
|
2595
|
+
]
|
|
2596
|
+
});
|
|
2597
|
+
$[74] = t10;
|
|
2598
|
+
$[75] = t11;
|
|
2599
|
+
$[76] = t12;
|
|
2600
|
+
$[77] = t13;
|
|
2601
|
+
$[78] = t2;
|
|
2602
|
+
$[79] = t3;
|
|
2603
|
+
$[80] = t4;
|
|
2604
|
+
$[81] = t5;
|
|
2605
|
+
$[82] = t6;
|
|
2606
|
+
$[83] = t7;
|
|
2607
|
+
$[84] = t8;
|
|
2608
|
+
$[85] = t9;
|
|
2609
|
+
$[86] = t14;
|
|
2610
|
+
} else t14 = $[86];
|
|
2611
|
+
let t15;
|
|
2612
|
+
if ($[87] !== classNames.detailCell || $[88] !== classNames.detailRow || $[89] !== columnSpan || $[90] !== expandable || $[91] !== expanded || $[92] !== renderDetail || $[93] !== row) {
|
|
2613
|
+
t15 = expandable && expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
2614
|
+
"data-adapttable-part": "detail-row",
|
|
2615
|
+
className: classNames.detailRow,
|
|
2616
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2617
|
+
colSpan: columnSpan,
|
|
2618
|
+
"data-adapttable-part": "detail-cell",
|
|
2619
|
+
className: classNames.detailCell,
|
|
2620
|
+
children: renderDetail(row)
|
|
2621
|
+
})
|
|
2622
|
+
});
|
|
2623
|
+
$[87] = classNames.detailCell;
|
|
2624
|
+
$[88] = classNames.detailRow;
|
|
2625
|
+
$[89] = columnSpan;
|
|
2626
|
+
$[90] = expandable;
|
|
2627
|
+
$[91] = expanded;
|
|
2628
|
+
$[92] = renderDetail;
|
|
2629
|
+
$[93] = row;
|
|
2630
|
+
$[94] = t15;
|
|
2631
|
+
} else t15 = $[94];
|
|
2632
|
+
let t16;
|
|
2633
|
+
if ($[95] !== t14 || $[96] !== t15) {
|
|
2634
|
+
t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t14, t15] });
|
|
2635
|
+
$[95] = t14;
|
|
2636
|
+
$[96] = t15;
|
|
2637
|
+
$[97] = t16;
|
|
2638
|
+
} else t16 = $[97];
|
|
2639
|
+
return t16;
|
|
1184
2640
|
}
|
|
1185
2641
|
/**
|
|
1186
2642
|
* One memoized row component per `DesktopTable` instantiation. A factory
|
|
@@ -1220,10 +2676,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1220
2676
|
renderRowDetail
|
|
1221
2677
|
};
|
|
1222
2678
|
const onToggleSelect = (0, react.useCallback)((id) => live.current.selection?.toggle(id), []);
|
|
1223
|
-
const onToggleExpand = (0, react.useCallback)((
|
|
2679
|
+
const onToggleExpand = (0, react.useCallback)((id_0) => live.current.expansion?.toggle(id_0), []);
|
|
1224
2680
|
const handleRowClick = (0, react.useCallback)((row) => live.current.onRowClick?.(row), []);
|
|
1225
|
-
const handlePrefetch = (0, react.useCallback)((
|
|
1226
|
-
const renderDetail = (0, react.useCallback)((
|
|
2681
|
+
const handlePrefetch = (0, react.useCallback)((row_0) => live.current.prefetch?.(row_0), []);
|
|
2682
|
+
const renderDetail = (0, react.useCallback)((row_1) => live.current.renderRowDetail?.(row_1), []);
|
|
1227
2683
|
const Row = (0, react.useMemo)(() => createDesktopRow(), []);
|
|
1228
2684
|
const { ref: overflowRef, overflowing } = (0, _adapttable_core.useHorizontalOverflow)();
|
|
1229
2685
|
const hasPinned = columns.some((c) => pinOffset?.(c.key) != null) || stickActions;
|
|
@@ -1234,24 +2690,24 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1234
2690
|
} : void 0;
|
|
1235
2691
|
const stickyAttr = stickyHeader || void 0;
|
|
1236
2692
|
const leads = {
|
|
1237
|
-
|
|
1238
|
-
|
|
2693
|
+
start: selection ? SELECTION_WIDTH : 0,
|
|
2694
|
+
end: showActions ? ACTIONS_WIDTH : 0
|
|
1239
2695
|
};
|
|
1240
|
-
const
|
|
1241
|
-
const
|
|
1242
|
-
const pinSignature = columns.map((
|
|
1243
|
-
const pin = pinOffset?.(
|
|
1244
|
-
return pin ? `${
|
|
2696
|
+
const hasStartPin = columns.some((c_0) => pinOffset?.(c_0.key)?.side === "start");
|
|
2697
|
+
const hasEndPin = columns.some((c_1) => pinOffset?.(c_1.key)?.side === "end");
|
|
2698
|
+
const pinSignature = columns.map((c_2) => {
|
|
2699
|
+
const pin = pinOffset?.(c_2.key);
|
|
2700
|
+
return pin ? `${c_2.key}:${pin.side}:${pin.inset}` : "";
|
|
1245
2701
|
}).join("|");
|
|
1246
2702
|
const headPinStyle = (key) => (0, _adapttable_core.pinnedCellStyle)(pinOffset?.(key), _adapttable_core.PIN_Z.headerPinned, leads);
|
|
1247
2703
|
const headStyle = (column) => {
|
|
1248
|
-
const
|
|
1249
|
-
const
|
|
1250
|
-
const width =
|
|
1251
|
-
if (!stickyStyle && !
|
|
2704
|
+
const key_0 = column.key;
|
|
2705
|
+
const pin_0 = headPinStyle(key_0);
|
|
2706
|
+
const width = pin_0 ? (0, _adapttable_core.pinnedColumnWidth)(column, columnWidths) : columnWidths?.[key_0];
|
|
2707
|
+
if (!stickyStyle && !pin_0 && width == null && !setWidth) return void 0;
|
|
1252
2708
|
const merged = {
|
|
1253
2709
|
...stickyStyle,
|
|
1254
|
-
...
|
|
2710
|
+
...pin_0,
|
|
1255
2711
|
...width != null && { width }
|
|
1256
2712
|
};
|
|
1257
2713
|
if (setWidth && !merged.position) merged.position = "relative";
|
|
@@ -1265,7 +2721,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1265
2721
|
...edge
|
|
1266
2722
|
};
|
|
1267
2723
|
};
|
|
1268
|
-
const columnName = (
|
|
2724
|
+
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
1269
2725
|
const minWidth = (0, _adapttable_core.tableMinWidth)(columns, {
|
|
1270
2726
|
widths: columnWidths,
|
|
1271
2727
|
extra: (selection ? SELECTION_WIDTH : 0) + (showActions ? ACTIONS_WIDTH : 0)
|
|
@@ -1318,8 +2774,8 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1318
2774
|
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1319
2775
|
"data-adapttable-part": "selection-header",
|
|
1320
2776
|
"data-sticky": stickyAttr,
|
|
1321
|
-
"data-pinned":
|
|
1322
|
-
style: edgeHeadStyle("
|
|
2777
|
+
"data-pinned": hasStartPin ? "start" : void 0,
|
|
2778
|
+
style: edgeHeadStyle("start", hasStartPin),
|
|
1323
2779
|
className: cx(classNames.headerCell, classNames.selectionCell),
|
|
1324
2780
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1325
2781
|
type: "checkbox",
|
|
@@ -1332,25 +2788,25 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1332
2788
|
className: classNames.checkbox
|
|
1333
2789
|
})
|
|
1334
2790
|
}),
|
|
1335
|
-
columns.map((
|
|
1336
|
-
const localStyle = headStyle(
|
|
1337
|
-
const headerProps = table.getHeaderCellProps(
|
|
1338
|
-
const
|
|
1339
|
-
const sortButtonProps = table.getSortButtonProps(
|
|
2791
|
+
columns.map((column_1) => {
|
|
2792
|
+
const localStyle = headStyle(column_1);
|
|
2793
|
+
const headerProps = table.getHeaderCellProps(column_1, localStyle && { style: localStyle });
|
|
2794
|
+
const active_0 = table.sortBy === column_1.key;
|
|
2795
|
+
const sortButtonProps = table.getSortButtonProps(column_1);
|
|
1340
2796
|
const sortIndex = sortButtonProps["data-sort-index"];
|
|
1341
2797
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("th", {
|
|
1342
2798
|
...headerProps,
|
|
1343
2799
|
"data-adapttable-part": "header-cell",
|
|
1344
|
-
"data-sorted":
|
|
2800
|
+
"data-sorted": active_0 ? table.sortDir : void 0,
|
|
1345
2801
|
"data-sticky": stickyAttr,
|
|
1346
|
-
"data-pinned": pinOffset?.(
|
|
2802
|
+
"data-pinned": pinOffset?.(column_1.key)?.side,
|
|
1347
2803
|
className: classNames.headerCell,
|
|
1348
|
-
children: [
|
|
2804
|
+
children: [column_1.sortable ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1349
2805
|
...sortButtonProps,
|
|
1350
2806
|
"data-adapttable-part": "sort-button",
|
|
1351
2807
|
className: classNames.sortButton,
|
|
1352
2808
|
children: [
|
|
1353
|
-
|
|
2809
|
+
column_1.header,
|
|
1354
2810
|
typeof sortIndex === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1355
2811
|
"data-adapttable-part": "sort-index",
|
|
1356
2812
|
className: classNames.sortIndex,
|
|
@@ -1358,22 +2814,22 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1358
2814
|
}),
|
|
1359
2815
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1360
2816
|
"aria-hidden": true,
|
|
1361
|
-
children: [" ", sortGlyph(
|
|
2817
|
+
children: [" ", sortGlyph(active_0, table.sortDir)]
|
|
1362
2818
|
})
|
|
1363
2819
|
]
|
|
1364
|
-
}) :
|
|
1365
|
-
...(0, _adapttable_core.columnResizeHandleProps)(
|
|
2820
|
+
}) : column_1.header, setWidth && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2821
|
+
...(0, _adapttable_core.columnResizeHandleProps)(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
1366
2822
|
"data-adapttable-part": "resize-handle",
|
|
1367
2823
|
className: classNames.resizeHandle,
|
|
1368
2824
|
style: RESIZE_HANDLE_STYLE
|
|
1369
2825
|
})]
|
|
1370
|
-
},
|
|
2826
|
+
}, column_1.key);
|
|
1371
2827
|
}),
|
|
1372
2828
|
showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1373
2829
|
"data-adapttable-part": "actions-header",
|
|
1374
2830
|
"data-sticky": stickyAttr,
|
|
1375
|
-
"data-pinned":
|
|
1376
|
-
style: edgeHeadStyle("
|
|
2831
|
+
"data-pinned": hasEndPin || stickActions ? "end" : void 0,
|
|
2832
|
+
style: edgeHeadStyle("end", hasEndPin || stickActions),
|
|
1377
2833
|
className: cx(classNames.headerCell, classNames.actionsCell),
|
|
1378
2834
|
children: labels.actions
|
|
1379
2835
|
})
|
|
@@ -1391,18 +2847,18 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1391
2847
|
padding: 0
|
|
1392
2848
|
}
|
|
1393
2849
|
}) }),
|
|
1394
|
-
entries.map(({ row, index, key }) => {
|
|
1395
|
-
const
|
|
2850
|
+
entries.map(({ row: row_2, index, key: key_1 }) => {
|
|
2851
|
+
const id_1 = getRowId(row_2);
|
|
1396
2852
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
|
|
1397
|
-
row,
|
|
2853
|
+
row: row_2,
|
|
1398
2854
|
index,
|
|
1399
|
-
id,
|
|
2855
|
+
id: id_1,
|
|
1400
2856
|
table,
|
|
1401
2857
|
columns,
|
|
1402
2858
|
labels,
|
|
1403
2859
|
classNames,
|
|
1404
|
-
selected: selection ? selection.isSelected(
|
|
1405
|
-
expanded: expansionState ? expansionState.isExpanded(
|
|
2860
|
+
selected: selection ? selection.isSelected(id_1) : void 0,
|
|
2861
|
+
expanded: expansionState ? expansionState.isExpanded(id_1) : void 0,
|
|
1406
2862
|
showActions,
|
|
1407
2863
|
rowActions,
|
|
1408
2864
|
confirm,
|
|
@@ -1410,10 +2866,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1410
2866
|
columnWidths,
|
|
1411
2867
|
pinOffset,
|
|
1412
2868
|
pinSignature,
|
|
1413
|
-
|
|
1414
|
-
|
|
2869
|
+
hasStartPin,
|
|
2870
|
+
hasEndPin,
|
|
1415
2871
|
actionsPinned: stickActions,
|
|
1416
|
-
rowClass: rowClassName?.(
|
|
2872
|
+
rowClass: rowClassName?.(row_2, index),
|
|
1417
2873
|
clickable: Boolean(onRowClick),
|
|
1418
2874
|
hasPrefetch: Boolean(prefetch),
|
|
1419
2875
|
onRowClick: handleRowClick,
|
|
@@ -1422,7 +2878,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1422
2878
|
onToggleExpand,
|
|
1423
2879
|
renderDetail,
|
|
1424
2880
|
measureElement
|
|
1425
|
-
},
|
|
2881
|
+
}, key_1);
|
|
1426
2882
|
}),
|
|
1427
2883
|
paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1428
2884
|
colSpan: columnSpan,
|
|
@@ -1442,11 +2898,11 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1442
2898
|
children: [
|
|
1443
2899
|
expandable && summaryPad,
|
|
1444
2900
|
selection && summaryPad,
|
|
1445
|
-
columns.map((
|
|
2901
|
+
columns.map((column_2) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1446
2902
|
"data-adapttable-part": "summary-cell",
|
|
1447
2903
|
className: classNames.summaryCell,
|
|
1448
|
-
children: summary[
|
|
1449
|
-
},
|
|
2904
|
+
children: summary[column_2.key]
|
|
2905
|
+
}, column_2.key)),
|
|
1450
2906
|
showActions && summaryPad
|
|
1451
2907
|
]
|
|
1452
2908
|
})
|
|
@@ -1464,110 +2920,210 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1464
2920
|
});
|
|
1465
2921
|
}
|
|
1466
2922
|
/** Mobile card-list rendering. */
|
|
1467
|
-
function MobileCards(
|
|
2923
|
+
function MobileCards(t0) {
|
|
2924
|
+
const $ = (0, react_compiler_runtime.c)(50);
|
|
2925
|
+
const { table, rows, rowActions, confirm, getRowId, classNames, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
|
|
2926
|
+
const paddingTop = t1 === void 0 ? 0 : t1;
|
|
2927
|
+
const paddingBottom = t2 === void 0 ? 0 : t2;
|
|
1468
2928
|
const { columns, selection, labels } = table;
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2929
|
+
let summary;
|
|
2930
|
+
let t3;
|
|
2931
|
+
let t4;
|
|
2932
|
+
let t5;
|
|
2933
|
+
let t6;
|
|
2934
|
+
let t7;
|
|
2935
|
+
let t8;
|
|
2936
|
+
if ($[0] !== classNames || $[1] !== columns || $[2] !== confirm || $[3] !== expansion || $[4] !== getRowId || $[5] !== labels || $[6] !== measureElement || $[7] !== onRowClick || $[8] !== paddingTop || $[9] !== renderRowDetail || $[10] !== rowActions || $[11] !== rowClassName || $[12] !== rowEntries || $[13] !== rows || $[14] !== selection || $[15] !== summaryRow || $[16] !== table) {
|
|
2937
|
+
const entries = (0, _adapttable_core.resolveVirtualRows)(rows, getRowId, rowEntries);
|
|
2938
|
+
const expansionState = renderRowDetail ? expansion : void 0;
|
|
2939
|
+
let t9;
|
|
2940
|
+
if ($[24] !== rows || $[25] !== summaryRow) {
|
|
2941
|
+
t9 = summaryRow?.(rows);
|
|
2942
|
+
$[24] = rows;
|
|
2943
|
+
$[25] = summaryRow;
|
|
2944
|
+
$[26] = t9;
|
|
2945
|
+
} else t9 = $[26];
|
|
2946
|
+
summary = t9;
|
|
2947
|
+
if ($[27] !== table) {
|
|
2948
|
+
t3 = table.getTableProps({ role: void 0 });
|
|
2949
|
+
$[27] = table;
|
|
2950
|
+
$[28] = t3;
|
|
2951
|
+
} else t3 = $[28];
|
|
2952
|
+
t4 = "cards";
|
|
2953
|
+
t5 = classNames.cards;
|
|
2954
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2955
|
+
t6 = {
|
|
2956
|
+
listStyle: "none",
|
|
2957
|
+
margin: 0,
|
|
2958
|
+
padding: 0
|
|
2959
|
+
};
|
|
2960
|
+
$[29] = t6;
|
|
2961
|
+
} else t6 = $[29];
|
|
2962
|
+
if ($[30] !== paddingTop) {
|
|
2963
|
+
t7 = paddingTop > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
1483
2964
|
"aria-hidden": true,
|
|
1484
2965
|
"data-adapttable-part": "virtual-spacer",
|
|
1485
2966
|
style: { height: paddingTop }
|
|
1486
|
-
})
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}, column.key)),
|
|
1528
|
-
rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1529
|
-
"data-adapttable-part": "card-actions",
|
|
1530
|
-
className: classNames.actionsCell,
|
|
1531
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
2967
|
+
});
|
|
2968
|
+
$[30] = paddingTop;
|
|
2969
|
+
$[31] = t7;
|
|
2970
|
+
} else t7 = $[31];
|
|
2971
|
+
t8 = entries.map((t10) => {
|
|
2972
|
+
const { row, index, key } = t10;
|
|
2973
|
+
const id = getRowId(row);
|
|
2974
|
+
const expanded = expansionState?.isExpanded(id) ?? false;
|
|
2975
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2976
|
+
...(0, _adapttable_core.rowClickProps)(row, onRowClick),
|
|
2977
|
+
ref: measureElement,
|
|
2978
|
+
"data-index": index,
|
|
2979
|
+
"data-adapttable-part": "card",
|
|
2980
|
+
"data-selected": selection?.isSelected(id) ? "" : void 0,
|
|
2981
|
+
"data-clickable": onRowClick ? "" : void 0,
|
|
2982
|
+
className: cx(classNames.card, rowClassName?.(row, index)),
|
|
2983
|
+
children: [
|
|
2984
|
+
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2985
|
+
type: "checkbox",
|
|
2986
|
+
"aria-label": labels.selectRow,
|
|
2987
|
+
checked: selection.isSelected(id),
|
|
2988
|
+
onChange: () => selection.toggle(id),
|
|
2989
|
+
className: classNames.checkbox
|
|
2990
|
+
}),
|
|
2991
|
+
expansionState && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandButton, {
|
|
2992
|
+
expanded,
|
|
2993
|
+
labels,
|
|
2994
|
+
classNames,
|
|
2995
|
+
onToggle: () => expansionState.toggle(id)
|
|
2996
|
+
}),
|
|
2997
|
+
columns.map((column) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2998
|
+
"data-adapttable-part": "card-row",
|
|
2999
|
+
className: classNames.cardRow,
|
|
3000
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3001
|
+
"data-adapttable-part": "card-label",
|
|
3002
|
+
className: classNames.cardLabel,
|
|
3003
|
+
children: cardLabel(column)
|
|
3004
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3005
|
+
"data-adapttable-part": "card-value",
|
|
3006
|
+
className: classNames.cardValue,
|
|
3007
|
+
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
1532
3008
|
row,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
3009
|
+
rowIndex: index
|
|
3010
|
+
}) : column.accessor?.(row)
|
|
3011
|
+
})]
|
|
3012
|
+
}, column.key)),
|
|
3013
|
+
rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3014
|
+
"data-adapttable-part": "card-actions",
|
|
3015
|
+
className: classNames.actionsCell,
|
|
3016
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
3017
|
+
row,
|
|
3018
|
+
actions: rowActions,
|
|
3019
|
+
confirm,
|
|
3020
|
+
cancelLabel: labels.cancel,
|
|
3021
|
+
classNames
|
|
1543
3022
|
})
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
})
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
]
|
|
1570
|
-
|
|
3023
|
+
}),
|
|
3024
|
+
expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3025
|
+
"data-adapttable-part": "card-detail",
|
|
3026
|
+
className: classNames.cardDetail,
|
|
3027
|
+
children: renderRowDetail(row)
|
|
3028
|
+
})
|
|
3029
|
+
]
|
|
3030
|
+
}, key);
|
|
3031
|
+
});
|
|
3032
|
+
$[0] = classNames;
|
|
3033
|
+
$[1] = columns;
|
|
3034
|
+
$[2] = confirm;
|
|
3035
|
+
$[3] = expansion;
|
|
3036
|
+
$[4] = getRowId;
|
|
3037
|
+
$[5] = labels;
|
|
3038
|
+
$[6] = measureElement;
|
|
3039
|
+
$[7] = onRowClick;
|
|
3040
|
+
$[8] = paddingTop;
|
|
3041
|
+
$[9] = renderRowDetail;
|
|
3042
|
+
$[10] = rowActions;
|
|
3043
|
+
$[11] = rowClassName;
|
|
3044
|
+
$[12] = rowEntries;
|
|
3045
|
+
$[13] = rows;
|
|
3046
|
+
$[14] = selection;
|
|
3047
|
+
$[15] = summaryRow;
|
|
3048
|
+
$[16] = table;
|
|
3049
|
+
$[17] = summary;
|
|
3050
|
+
$[18] = t3;
|
|
3051
|
+
$[19] = t4;
|
|
3052
|
+
$[20] = t5;
|
|
3053
|
+
$[21] = t6;
|
|
3054
|
+
$[22] = t7;
|
|
3055
|
+
$[23] = t8;
|
|
3056
|
+
} else {
|
|
3057
|
+
summary = $[17];
|
|
3058
|
+
t3 = $[18];
|
|
3059
|
+
t4 = $[19];
|
|
3060
|
+
t5 = $[20];
|
|
3061
|
+
t6 = $[21];
|
|
3062
|
+
t7 = $[22];
|
|
3063
|
+
t8 = $[23];
|
|
3064
|
+
}
|
|
3065
|
+
let t9;
|
|
3066
|
+
if ($[32] !== paddingBottom) {
|
|
3067
|
+
t9 = paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
3068
|
+
"aria-hidden": true,
|
|
3069
|
+
"data-adapttable-part": "virtual-spacer",
|
|
3070
|
+
style: { height: paddingBottom }
|
|
3071
|
+
});
|
|
3072
|
+
$[32] = paddingBottom;
|
|
3073
|
+
$[33] = t9;
|
|
3074
|
+
} else t9 = $[33];
|
|
3075
|
+
let t10;
|
|
3076
|
+
if ($[34] !== classNames.cardLabel || $[35] !== classNames.cardRow || $[36] !== classNames.cardValue || $[37] !== classNames.summaryCard || $[38] !== columns || $[39] !== summary) {
|
|
3077
|
+
t10 = summary && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
3078
|
+
"data-adapttable-part": "summary-card",
|
|
3079
|
+
className: classNames.summaryCard,
|
|
3080
|
+
children: columns.filter((column_0) => summary[column_0.key] !== void 0).map((column_1) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3081
|
+
"data-adapttable-part": "card-row",
|
|
3082
|
+
className: classNames.cardRow,
|
|
3083
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3084
|
+
"data-adapttable-part": "card-label",
|
|
3085
|
+
className: classNames.cardLabel,
|
|
3086
|
+
children: cardLabel(column_1)
|
|
3087
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3088
|
+
"data-adapttable-part": "card-value",
|
|
3089
|
+
className: classNames.cardValue,
|
|
3090
|
+
children: summary[column_1.key]
|
|
3091
|
+
})]
|
|
3092
|
+
}, column_1.key))
|
|
3093
|
+
});
|
|
3094
|
+
$[34] = classNames.cardLabel;
|
|
3095
|
+
$[35] = classNames.cardRow;
|
|
3096
|
+
$[36] = classNames.cardValue;
|
|
3097
|
+
$[37] = classNames.summaryCard;
|
|
3098
|
+
$[38] = columns;
|
|
3099
|
+
$[39] = summary;
|
|
3100
|
+
$[40] = t10;
|
|
3101
|
+
} else t10 = $[40];
|
|
3102
|
+
let t11;
|
|
3103
|
+
if ($[41] !== t10 || $[42] !== t3 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t8 || $[48] !== t9) {
|
|
3104
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
3105
|
+
...t3,
|
|
3106
|
+
"data-adapttable-part": t4,
|
|
3107
|
+
className: t5,
|
|
3108
|
+
style: t6,
|
|
3109
|
+
children: [
|
|
3110
|
+
t7,
|
|
3111
|
+
t8,
|
|
3112
|
+
t9,
|
|
3113
|
+
t10
|
|
3114
|
+
]
|
|
3115
|
+
});
|
|
3116
|
+
$[41] = t10;
|
|
3117
|
+
$[42] = t3;
|
|
3118
|
+
$[43] = t4;
|
|
3119
|
+
$[44] = t5;
|
|
3120
|
+
$[45] = t6;
|
|
3121
|
+
$[46] = t7;
|
|
3122
|
+
$[47] = t8;
|
|
3123
|
+
$[48] = t9;
|
|
3124
|
+
$[49] = t11;
|
|
3125
|
+
} else t11 = $[49];
|
|
3126
|
+
return t11;
|
|
1571
3127
|
}
|
|
1572
3128
|
function sortGlyph(active, dir) {
|
|
1573
3129
|
if (!active) return "↕";
|
|
@@ -1579,58 +3135,139 @@ function cardLabel(column) {
|
|
|
1579
3135
|
//#endregion
|
|
1580
3136
|
//#region src/DataTable.tsx
|
|
1581
3137
|
const NO_CLASSNAMES = {};
|
|
1582
|
-
|
|
3138
|
+
/**
|
|
3139
|
+
* `DataTableProps` after tier resolution: the source is definite (whichever
|
|
3140
|
+
* tier provided it) and `filters` is plain JSX (the auto-built form when the
|
|
3141
|
+
* caller passed the declarative array).
|
|
3142
|
+
*/
|
|
3143
|
+
function DataTableBody(t0) {
|
|
3144
|
+
const $ = (0, react_compiler_runtime.c)(48);
|
|
3145
|
+
const { chrome, props, classNames, confirm, getRowId, virtualization, virtualScrollRef, labels } = t0;
|
|
1583
3146
|
const rowActions = chrome.columnLayout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY) ? void 0 : props.rowActions;
|
|
1584
3147
|
const actionsPinned = (rowActions?.length ?? 0) > 0 && chrome.columnLayout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] !== void 0;
|
|
1585
|
-
if (chrome.body === "skeleton")
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
3148
|
+
if (chrome.body === "skeleton") {
|
|
3149
|
+
let t1;
|
|
3150
|
+
if ($[0] !== chrome.isMobile || $[1] !== chrome.table || $[2] !== classNames || $[3] !== labels || $[4] !== props.loadingState || $[5] !== props.skeletonRows || $[6] !== props.slots?.skeleton || $[7] !== props.source || $[8] !== rowActions?.length) {
|
|
3151
|
+
t1 = props.slots?.skeleton ?? props.loadingState ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState, {
|
|
3152
|
+
rows: props.skeletonRows ?? props.source.limit,
|
|
3153
|
+
columns: chrome.table.columns.length,
|
|
3154
|
+
variant: chrome.isMobile ? "cards" : "table",
|
|
3155
|
+
labels,
|
|
3156
|
+
classNames,
|
|
3157
|
+
hasActions: (rowActions?.length ?? 0) > 0
|
|
3158
|
+
});
|
|
3159
|
+
$[0] = chrome.isMobile;
|
|
3160
|
+
$[1] = chrome.table;
|
|
3161
|
+
$[2] = classNames;
|
|
3162
|
+
$[3] = labels;
|
|
3163
|
+
$[4] = props.loadingState;
|
|
3164
|
+
$[5] = props.skeletonRows;
|
|
3165
|
+
$[6] = props.slots?.skeleton;
|
|
3166
|
+
$[7] = props.source;
|
|
3167
|
+
$[8] = rowActions?.length;
|
|
3168
|
+
$[9] = t1;
|
|
3169
|
+
} else t1 = $[9];
|
|
3170
|
+
let t2;
|
|
3171
|
+
if ($[10] !== t1) {
|
|
3172
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
3173
|
+
$[10] = t1;
|
|
3174
|
+
$[11] = t2;
|
|
3175
|
+
} else t2 = $[11];
|
|
3176
|
+
return t2;
|
|
3177
|
+
}
|
|
1593
3178
|
if (chrome.body === "empty") {
|
|
1594
3179
|
const noResults = chrome.emptyVariant === "noResults";
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
3180
|
+
let t1;
|
|
3181
|
+
if ($[12] !== chrome.clearFilters || $[13] !== classNames || $[14] !== labels || $[15] !== noResults || $[16] !== props.emptyState || $[17] !== props.slots?.empty) {
|
|
3182
|
+
t1 = props.slots?.empty ?? props.emptyState ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("output", {
|
|
3183
|
+
"data-adapttable-part": "empty",
|
|
3184
|
+
className: classNames.empty,
|
|
3185
|
+
children: [noResults ? labels.noResults : labels.noData, noResults && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3186
|
+
type: "button",
|
|
3187
|
+
"data-adapttable-part": "empty-clear",
|
|
3188
|
+
className: classNames.emptyClear,
|
|
3189
|
+
onClick: chrome.clearFilters,
|
|
3190
|
+
children: labels.clearAll
|
|
3191
|
+
})]
|
|
3192
|
+
});
|
|
3193
|
+
$[12] = chrome.clearFilters;
|
|
3194
|
+
$[13] = classNames;
|
|
3195
|
+
$[14] = labels;
|
|
3196
|
+
$[15] = noResults;
|
|
3197
|
+
$[16] = props.emptyState;
|
|
3198
|
+
$[17] = props.slots?.empty;
|
|
3199
|
+
$[18] = t1;
|
|
3200
|
+
} else t1 = $[18];
|
|
3201
|
+
let t2;
|
|
3202
|
+
if ($[19] !== t1) {
|
|
3203
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
3204
|
+
$[19] = t1;
|
|
3205
|
+
$[20] = t2;
|
|
3206
|
+
} else t2 = $[20];
|
|
3207
|
+
return t2;
|
|
1606
3208
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
3209
|
+
const Renderer = chrome.isMobile ? MobileCards : DesktopTable;
|
|
3210
|
+
const t1 = chrome.detail?.expansion;
|
|
3211
|
+
const t2 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3212
|
+
const t3 = props.resizableColumns ? chrome.columnLayout.setWidth : void 0;
|
|
3213
|
+
let t4;
|
|
3214
|
+
if ($[21] !== Renderer || $[22] !== actionsPinned || $[23] !== chrome.columnLayout.pinOffset || $[24] !== chrome.columnLayout.state.widths || $[25] !== chrome.table || $[26] !== classNames || $[27] !== confirm || $[28] !== getRowId || $[29] !== labels.resizeColumn || $[30] !== props.maxHeight || $[31] !== props.onRowClick || $[32] !== props.prefetch || $[33] !== props.renderRowDetail || $[34] !== props.rowClassName || $[35] !== props.source.rows || $[36] !== props.stickyHeader || $[37] !== props.stickyTop || $[38] !== props.summaryRow || $[39] !== rowActions || $[40] !== t1 || $[41] !== t2 || $[42] !== t3 || $[43] !== virtualScrollRef || $[44] !== virtualization.measureElement || $[45] !== virtualization.paddingBottom || $[46] !== virtualization.paddingTop) {
|
|
3215
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Renderer, {
|
|
3216
|
+
table: chrome.table,
|
|
3217
|
+
rows: props.source.rows,
|
|
3218
|
+
rowActions,
|
|
3219
|
+
actionsPinned,
|
|
3220
|
+
confirm,
|
|
3221
|
+
getRowId,
|
|
3222
|
+
classNames,
|
|
3223
|
+
prefetch: props.prefetch,
|
|
3224
|
+
onRowClick: props.onRowClick,
|
|
3225
|
+
rowClassName: props.rowClassName,
|
|
3226
|
+
renderRowDetail: props.renderRowDetail,
|
|
3227
|
+
summaryRow: props.summaryRow,
|
|
3228
|
+
expansion: t1,
|
|
3229
|
+
rowEntries: t2,
|
|
3230
|
+
paddingTop: virtualization.paddingTop,
|
|
3231
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3232
|
+
measureElement: virtualization.measureElement,
|
|
3233
|
+
stickyHeader: props.stickyHeader,
|
|
3234
|
+
stickyTop: props.stickyTop,
|
|
3235
|
+
pinOffset: chrome.columnLayout.pinOffset,
|
|
3236
|
+
maxHeight: props.maxHeight,
|
|
3237
|
+
virtualScrollRef,
|
|
3238
|
+
setWidth: t3,
|
|
3239
|
+
columnWidths: chrome.columnLayout.state.widths,
|
|
3240
|
+
resizeLabel: labels.resizeColumn
|
|
3241
|
+
});
|
|
3242
|
+
$[21] = Renderer;
|
|
3243
|
+
$[22] = actionsPinned;
|
|
3244
|
+
$[23] = chrome.columnLayout.pinOffset;
|
|
3245
|
+
$[24] = chrome.columnLayout.state.widths;
|
|
3246
|
+
$[25] = chrome.table;
|
|
3247
|
+
$[26] = classNames;
|
|
3248
|
+
$[27] = confirm;
|
|
3249
|
+
$[28] = getRowId;
|
|
3250
|
+
$[29] = labels.resizeColumn;
|
|
3251
|
+
$[30] = props.maxHeight;
|
|
3252
|
+
$[31] = props.onRowClick;
|
|
3253
|
+
$[32] = props.prefetch;
|
|
3254
|
+
$[33] = props.renderRowDetail;
|
|
3255
|
+
$[34] = props.rowClassName;
|
|
3256
|
+
$[35] = props.source.rows;
|
|
3257
|
+
$[36] = props.stickyHeader;
|
|
3258
|
+
$[37] = props.stickyTop;
|
|
3259
|
+
$[38] = props.summaryRow;
|
|
3260
|
+
$[39] = rowActions;
|
|
3261
|
+
$[40] = t1;
|
|
3262
|
+
$[41] = t2;
|
|
3263
|
+
$[42] = t3;
|
|
3264
|
+
$[43] = virtualScrollRef;
|
|
3265
|
+
$[44] = virtualization.measureElement;
|
|
3266
|
+
$[45] = virtualization.paddingBottom;
|
|
3267
|
+
$[46] = virtualization.paddingTop;
|
|
3268
|
+
$[47] = t4;
|
|
3269
|
+
} else t4 = $[47];
|
|
3270
|
+
return t4;
|
|
1634
3271
|
}
|
|
1635
3272
|
/**
|
|
1636
3273
|
* Headless, unstyled AdaptTable for Tailwind / shadcn / custom CSS. Renders
|