@adapttable/unstyled 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +13 -0
- package/dist/index.cjs +2395 -805
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2395 -805
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
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,310 @@ 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)(38);
|
|
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
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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
|
+
let t4;
|
|
1471
|
+
if ($[9] !== labels || $[10] !== safePage || $[11] !== totalPages) {
|
|
1472
|
+
t4 = labels.pageOf({
|
|
1473
|
+
page: safePage,
|
|
1474
|
+
total: totalPages
|
|
1475
|
+
});
|
|
1476
|
+
$[9] = labels;
|
|
1477
|
+
$[10] = safePage;
|
|
1478
|
+
$[11] = totalPages;
|
|
1479
|
+
$[12] = t4;
|
|
1480
|
+
} else t4 = $[12];
|
|
1481
|
+
let t5;
|
|
1482
|
+
if ($[13] !== t4) {
|
|
1483
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t4 });
|
|
1484
|
+
$[13] = t4;
|
|
1485
|
+
$[14] = t5;
|
|
1486
|
+
} else t5 = $[14];
|
|
1487
|
+
const t6 = safePage <= 1;
|
|
1488
|
+
let t7;
|
|
1489
|
+
if ($[15] !== safePage || $[16] !== source) {
|
|
1490
|
+
t7 = () => source.setPage(safePage - 1);
|
|
1491
|
+
$[15] = safePage;
|
|
1492
|
+
$[16] = source;
|
|
1493
|
+
$[17] = t7;
|
|
1494
|
+
} else t7 = $[17];
|
|
1495
|
+
let t8;
|
|
1496
|
+
if ($[18] !== classNames.pageButton || $[19] !== labels.previousPage || $[20] !== t6 || $[21] !== t7) {
|
|
1497
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1498
|
+
type: "button",
|
|
1499
|
+
"aria-label": labels.previousPage,
|
|
1500
|
+
"data-adapttable-part": "page-prev",
|
|
1501
|
+
className: classNames.pageButton,
|
|
1502
|
+
disabled: t6,
|
|
1503
|
+
onClick: t7,
|
|
1504
|
+
children: "‹"
|
|
1505
|
+
});
|
|
1506
|
+
$[18] = classNames.pageButton;
|
|
1507
|
+
$[19] = labels.previousPage;
|
|
1508
|
+
$[20] = t6;
|
|
1509
|
+
$[21] = t7;
|
|
1510
|
+
$[22] = t8;
|
|
1511
|
+
} else t8 = $[22];
|
|
1512
|
+
const t9 = safePage >= totalPages;
|
|
1513
|
+
let t10;
|
|
1514
|
+
if ($[23] !== safePage || $[24] !== source) {
|
|
1515
|
+
t10 = () => source.setPage(safePage + 1);
|
|
1516
|
+
$[23] = safePage;
|
|
1517
|
+
$[24] = source;
|
|
1518
|
+
$[25] = t10;
|
|
1519
|
+
} else t10 = $[25];
|
|
1520
|
+
let t11;
|
|
1521
|
+
if ($[26] !== classNames.pageButton || $[27] !== labels.nextPage || $[28] !== t10 || $[29] !== t9) {
|
|
1522
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1523
|
+
type: "button",
|
|
1524
|
+
"aria-label": labels.nextPage,
|
|
1525
|
+
"data-adapttable-part": "page-next",
|
|
1526
|
+
className: classNames.pageButton,
|
|
1527
|
+
disabled: t9,
|
|
1528
|
+
onClick: t10,
|
|
1529
|
+
children: "›"
|
|
1530
|
+
});
|
|
1531
|
+
$[26] = classNames.pageButton;
|
|
1532
|
+
$[27] = labels.nextPage;
|
|
1533
|
+
$[28] = t10;
|
|
1534
|
+
$[29] = t9;
|
|
1535
|
+
$[30] = t11;
|
|
1536
|
+
} else t11 = $[30];
|
|
1537
|
+
let t12;
|
|
1538
|
+
if ($[31] !== classNames.footer || $[32] !== t11 || $[33] !== t2 || $[34] !== t3 || $[35] !== t5 || $[36] !== t8) {
|
|
1539
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1540
|
+
"data-adapttable-part": "footer",
|
|
1541
|
+
className: t1,
|
|
1542
|
+
children: [
|
|
1543
|
+
t2,
|
|
1544
|
+
t3,
|
|
1545
|
+
t5,
|
|
1546
|
+
t8,
|
|
1547
|
+
t11
|
|
1548
|
+
]
|
|
1549
|
+
});
|
|
1550
|
+
$[31] = classNames.footer;
|
|
1551
|
+
$[32] = t11;
|
|
1552
|
+
$[33] = t2;
|
|
1553
|
+
$[34] = t3;
|
|
1554
|
+
$[35] = t5;
|
|
1555
|
+
$[36] = t8;
|
|
1556
|
+
$[37] = t12;
|
|
1557
|
+
} else t12 = $[37];
|
|
1558
|
+
return t12;
|
|
771
1559
|
}
|
|
772
1560
|
/** 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
|
-
|
|
1561
|
+
function ErrorState(t0) {
|
|
1562
|
+
const $ = (0, react_compiler_runtime.c)(16);
|
|
1563
|
+
const { error, labels, onRetry, classNames } = t0;
|
|
1564
|
+
let t1;
|
|
1565
|
+
if ($[0] !== labels.errorTitle) {
|
|
1566
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: labels.errorTitle });
|
|
1567
|
+
$[0] = labels.errorTitle;
|
|
1568
|
+
$[1] = t1;
|
|
1569
|
+
} else t1 = $[1];
|
|
1570
|
+
let t2;
|
|
1571
|
+
if ($[2] !== labels.errorMessage) {
|
|
1572
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: labels.errorMessage });
|
|
1573
|
+
$[2] = labels.errorMessage;
|
|
1574
|
+
$[3] = t2;
|
|
1575
|
+
} else t2 = $[3];
|
|
1576
|
+
let t3;
|
|
1577
|
+
if ($[4] !== error.message) {
|
|
1578
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: error.message });
|
|
1579
|
+
$[4] = error.message;
|
|
1580
|
+
$[5] = t3;
|
|
1581
|
+
} else t3 = $[5];
|
|
1582
|
+
let t4;
|
|
1583
|
+
if ($[6] !== classNames.retryButton || $[7] !== labels.retry || $[8] !== onRetry) {
|
|
1584
|
+
t4 = onRetry && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1585
|
+
type: "button",
|
|
1586
|
+
onClick: onRetry,
|
|
1587
|
+
"data-adapttable-part": "retry",
|
|
1588
|
+
className: classNames.retryButton,
|
|
1589
|
+
children: labels.retry
|
|
1590
|
+
});
|
|
1591
|
+
$[6] = classNames.retryButton;
|
|
1592
|
+
$[7] = labels.retry;
|
|
1593
|
+
$[8] = onRetry;
|
|
1594
|
+
$[9] = t4;
|
|
1595
|
+
} else t4 = $[9];
|
|
1596
|
+
let t5;
|
|
1597
|
+
if ($[10] !== classNames.error || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
|
|
1598
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1599
|
+
role: "alert",
|
|
1600
|
+
"data-adapttable-part": "error",
|
|
1601
|
+
className: classNames.error,
|
|
1602
|
+
children: [
|
|
1603
|
+
t1,
|
|
1604
|
+
t2,
|
|
1605
|
+
t3,
|
|
1606
|
+
t4
|
|
1607
|
+
]
|
|
1608
|
+
});
|
|
1609
|
+
$[10] = classNames.error;
|
|
1610
|
+
$[11] = t1;
|
|
1611
|
+
$[12] = t2;
|
|
1612
|
+
$[13] = t3;
|
|
1613
|
+
$[14] = t4;
|
|
1614
|
+
$[15] = t5;
|
|
1615
|
+
} else t5 = $[15];
|
|
1616
|
+
return t5;
|
|
791
1617
|
}
|
|
792
1618
|
function loadingLineWidth(column, total) {
|
|
793
1619
|
if (column === 0) return "70%";
|
|
@@ -795,17 +1621,36 @@ function loadingLineWidth(column, total) {
|
|
|
795
1621
|
return "55%";
|
|
796
1622
|
}
|
|
797
1623
|
/** Skeleton-ish loading placeholder (semantic, unstyled). */
|
|
798
|
-
function LoadingState(
|
|
799
|
-
const
|
|
1624
|
+
function LoadingState(t0) {
|
|
1625
|
+
const $ = (0, react_compiler_runtime.c)(24);
|
|
1626
|
+
const { rows, columns, variant, labels, classNames, hasActions: t1 } = t0;
|
|
1627
|
+
const hasActions = t1 === void 0 ? false : t1;
|
|
1628
|
+
let t2;
|
|
1629
|
+
if ($[0] !== rows) {
|
|
1630
|
+
t2 = Array.from({ length: rows }, _temp2);
|
|
1631
|
+
$[0] = rows;
|
|
1632
|
+
$[1] = t2;
|
|
1633
|
+
} else t2 = $[1];
|
|
1634
|
+
const rowKeys = t2;
|
|
800
1635
|
const columnCount = Math.max(columns, 1) + (hasActions ? 1 : 0);
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1636
|
+
let t3;
|
|
1637
|
+
let t4;
|
|
1638
|
+
let t5;
|
|
1639
|
+
let t6;
|
|
1640
|
+
let t7;
|
|
1641
|
+
let t8;
|
|
1642
|
+
if ($[2] !== classNames.loading || $[3] !== columnCount || $[4] !== rowKeys || $[5] !== variant) {
|
|
1643
|
+
const columnKeys = Array.from({ length: columnCount }, _temp3);
|
|
1644
|
+
t3 = "status";
|
|
1645
|
+
t4 = "true";
|
|
1646
|
+
t5 = "polite";
|
|
1647
|
+
t6 = "loading";
|
|
1648
|
+
if ($[12] !== classNames.loading) {
|
|
1649
|
+
t7 = cx(classNames.loading);
|
|
1650
|
+
$[12] = classNames.loading;
|
|
1651
|
+
$[13] = t7;
|
|
1652
|
+
} else t7 = $[13];
|
|
1653
|
+
t8 = variant === "table" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
809
1654
|
"data-adapttable-part": "loading-table",
|
|
810
1655
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
811
1656
|
"data-adapttable-part": "loading-header-row",
|
|
@@ -818,141 +1663,426 @@ function LoadingState({ rows, columns, variant, labels, classNames, hasActions =
|
|
|
818
1663
|
}, column))
|
|
819
1664
|
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: rowKeys.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
820
1665
|
"data-adapttable-part": "loading-row",
|
|
821
|
-
children: columnKeys.map((
|
|
1666
|
+
children: columnKeys.map((column_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
822
1667
|
"data-adapttable-part": "loading-cell",
|
|
823
1668
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
824
1669
|
"data-adapttable-part": "loading-line",
|
|
825
|
-
style: { width: loadingLineWidth(
|
|
1670
|
+
style: { width: loadingLineWidth(column_0, columnCount) }
|
|
826
1671
|
})
|
|
827
|
-
},
|
|
1672
|
+
}, column_0))
|
|
828
1673
|
}, row)) })]
|
|
829
1674
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
830
1675
|
"data-adapttable-part": "loading-cards",
|
|
831
|
-
children: rowKeys.map((
|
|
1676
|
+
children: rowKeys.map((row_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
832
1677
|
"data-adapttable-part": "loading-card",
|
|
833
|
-
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((
|
|
1678
|
+
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((column_1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
834
1679
|
"data-adapttable-part": "loading-line",
|
|
835
|
-
style: { width: loadingLineWidth(
|
|
836
|
-
},
|
|
837
|
-
},
|
|
838
|
-
})
|
|
1680
|
+
style: { width: loadingLineWidth(column_1, columnKeys.length) }
|
|
1681
|
+
}, column_1))
|
|
1682
|
+
}, row_0))
|
|
1683
|
+
});
|
|
1684
|
+
$[2] = classNames.loading;
|
|
1685
|
+
$[3] = columnCount;
|
|
1686
|
+
$[4] = rowKeys;
|
|
1687
|
+
$[5] = variant;
|
|
1688
|
+
$[6] = t3;
|
|
1689
|
+
$[7] = t4;
|
|
1690
|
+
$[8] = t5;
|
|
1691
|
+
$[9] = t6;
|
|
1692
|
+
$[10] = t7;
|
|
1693
|
+
$[11] = t8;
|
|
1694
|
+
} else {
|
|
1695
|
+
t3 = $[6];
|
|
1696
|
+
t4 = $[7];
|
|
1697
|
+
t5 = $[8];
|
|
1698
|
+
t6 = $[9];
|
|
1699
|
+
t7 = $[10];
|
|
1700
|
+
t8 = $[11];
|
|
1701
|
+
}
|
|
1702
|
+
let t9;
|
|
1703
|
+
if ($[14] !== labels.loading) {
|
|
1704
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
839
1705
|
className: "adapttable-sr-only",
|
|
840
1706
|
children: labels.loading
|
|
841
|
-
})
|
|
842
|
-
|
|
1707
|
+
});
|
|
1708
|
+
$[14] = labels.loading;
|
|
1709
|
+
$[15] = t9;
|
|
1710
|
+
} else t9 = $[15];
|
|
1711
|
+
let t10;
|
|
1712
|
+
if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
|
|
1713
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1714
|
+
role: t3,
|
|
1715
|
+
"aria-busy": t4,
|
|
1716
|
+
"aria-live": t5,
|
|
1717
|
+
"data-adapttable-part": t6,
|
|
1718
|
+
className: t7,
|
|
1719
|
+
children: [t8, t9]
|
|
1720
|
+
});
|
|
1721
|
+
$[16] = t3;
|
|
1722
|
+
$[17] = t4;
|
|
1723
|
+
$[18] = t5;
|
|
1724
|
+
$[19] = t6;
|
|
1725
|
+
$[20] = t7;
|
|
1726
|
+
$[21] = t8;
|
|
1727
|
+
$[22] = t9;
|
|
1728
|
+
$[23] = t10;
|
|
1729
|
+
} else t10 = $[23];
|
|
1730
|
+
return t10;
|
|
1731
|
+
}
|
|
1732
|
+
function _temp3(__0, i_0) {
|
|
1733
|
+
return i_0;
|
|
1734
|
+
}
|
|
1735
|
+
function _temp2(_, i) {
|
|
1736
|
+
return i;
|
|
843
1737
|
}
|
|
844
1738
|
//#endregion
|
|
845
1739
|
//#region src/components/ColumnMenu.tsx
|
|
1740
|
+
/** Menu labels: the shared chrome contract plus the actions row's name. */
|
|
846
1741
|
/** 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
|
-
|
|
1742
|
+
function VisibilityToggle(t0) {
|
|
1743
|
+
const $ = (0, react_compiler_runtime.c)(9);
|
|
1744
|
+
const { hidden, name, labels, classNames, onToggle } = t0;
|
|
1745
|
+
const t1 = !hidden || void 0;
|
|
1746
|
+
const t2 = !hidden;
|
|
1747
|
+
const t3 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
|
|
1748
|
+
let t4;
|
|
1749
|
+
if ($[0] !== hidden) {
|
|
1750
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.EyeIcon, { off: hidden });
|
|
1751
|
+
$[0] = hidden;
|
|
1752
|
+
$[1] = t4;
|
|
1753
|
+
} else t4 = $[1];
|
|
1754
|
+
let t5;
|
|
1755
|
+
if ($[2] !== classNames.columnMenuVisibility || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
1756
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1757
|
+
type: "button",
|
|
1758
|
+
"data-adapttable-part": "column-menu-visibility",
|
|
1759
|
+
"data-active": t1,
|
|
1760
|
+
"aria-pressed": t2,
|
|
1761
|
+
"aria-label": t3,
|
|
1762
|
+
className: classNames.columnMenuVisibility,
|
|
1763
|
+
onClick: onToggle,
|
|
1764
|
+
children: t4
|
|
1765
|
+
});
|
|
1766
|
+
$[2] = classNames.columnMenuVisibility;
|
|
1767
|
+
$[3] = onToggle;
|
|
1768
|
+
$[4] = t1;
|
|
1769
|
+
$[5] = t2;
|
|
1770
|
+
$[6] = t3;
|
|
1771
|
+
$[7] = t4;
|
|
1772
|
+
$[8] = t5;
|
|
1773
|
+
} else t5 = $[8];
|
|
1774
|
+
return t5;
|
|
858
1775
|
}
|
|
859
1776
|
/** The row's name caption, shared by data-column rows and the actions row. */
|
|
860
|
-
function RowName(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1777
|
+
function RowName(t0) {
|
|
1778
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1779
|
+
const { hidden, name, classNames } = t0;
|
|
1780
|
+
const t1 = hidden || void 0;
|
|
1781
|
+
let t2;
|
|
1782
|
+
if ($[0] !== classNames.columnMenuLabel || $[1] !== name || $[2] !== t1) {
|
|
1783
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1784
|
+
"data-adapttable-part": "column-menu-label",
|
|
1785
|
+
"data-hidden": t1,
|
|
1786
|
+
className: classNames.columnMenuLabel,
|
|
1787
|
+
children: name
|
|
1788
|
+
});
|
|
1789
|
+
$[0] = classNames.columnMenuLabel;
|
|
1790
|
+
$[1] = name;
|
|
1791
|
+
$[2] = t1;
|
|
1792
|
+
$[3] = t2;
|
|
1793
|
+
} else t2 = $[3];
|
|
1794
|
+
return t2;
|
|
867
1795
|
}
|
|
868
1796
|
/** 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
|
-
|
|
1797
|
+
function PinToggle(t0) {
|
|
1798
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
1799
|
+
const { active, actionLabel, classNames, onClick } = t0;
|
|
1800
|
+
const t1 = active || void 0;
|
|
1801
|
+
let t2;
|
|
1802
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1803
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.PinIcon, {});
|
|
1804
|
+
$[0] = t2;
|
|
1805
|
+
} else t2 = $[0];
|
|
1806
|
+
let t3;
|
|
1807
|
+
if ($[1] !== actionLabel || $[2] !== active || $[3] !== classNames.columnMenuPin || $[4] !== onClick || $[5] !== t1) {
|
|
1808
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1809
|
+
type: "button",
|
|
1810
|
+
"data-adapttable-part": "column-menu-pin",
|
|
1811
|
+
"data-active": t1,
|
|
1812
|
+
"aria-pressed": active,
|
|
1813
|
+
"aria-label": actionLabel,
|
|
1814
|
+
className: classNames.columnMenuPin,
|
|
1815
|
+
onClick,
|
|
1816
|
+
children: t2
|
|
1817
|
+
});
|
|
1818
|
+
$[1] = actionLabel;
|
|
1819
|
+
$[2] = active;
|
|
1820
|
+
$[3] = classNames.columnMenuPin;
|
|
1821
|
+
$[4] = onClick;
|
|
1822
|
+
$[5] = t1;
|
|
1823
|
+
$[6] = t3;
|
|
1824
|
+
} else t3 = $[6];
|
|
1825
|
+
return t3;
|
|
880
1826
|
}
|
|
881
|
-
function ColumnMenuRowItem(
|
|
1827
|
+
function ColumnMenuRowItem(t0) {
|
|
1828
|
+
const $ = (0, react_compiler_runtime.c)(58);
|
|
1829
|
+
const { row, layout, labels, classNames, drag } = t0;
|
|
882
1830
|
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
|
-
|
|
1831
|
+
const t1 = hidden || void 0;
|
|
1832
|
+
const t2 = classNames.columnMenuItem;
|
|
1833
|
+
let t3;
|
|
1834
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1835
|
+
t3 = { cursor: "grab" };
|
|
1836
|
+
$[0] = t3;
|
|
1837
|
+
} else t3 = $[0];
|
|
1838
|
+
let t4;
|
|
1839
|
+
if ($[1] !== drag || $[2] !== index || $[3] !== key) {
|
|
1840
|
+
t4 = drag.rowDragProps(key, index);
|
|
1841
|
+
$[1] = drag;
|
|
1842
|
+
$[2] = index;
|
|
1843
|
+
$[3] = key;
|
|
1844
|
+
$[4] = t4;
|
|
1845
|
+
} else t4 = $[4];
|
|
1846
|
+
let t5;
|
|
1847
|
+
if ($[5] !== drag || $[6] !== index || $[7] !== layout.move) {
|
|
1848
|
+
t5 = drag.dropProps(index, layout.move);
|
|
1849
|
+
$[5] = drag;
|
|
1850
|
+
$[6] = index;
|
|
1851
|
+
$[7] = layout.move;
|
|
1852
|
+
$[8] = t5;
|
|
1853
|
+
} else t5 = $[8];
|
|
1854
|
+
let t6;
|
|
1855
|
+
if ($[9] !== drag || $[10] !== index || $[11] !== key) {
|
|
1856
|
+
t6 = drag.rowAttrs(key, index);
|
|
1857
|
+
$[9] = drag;
|
|
1858
|
+
$[10] = index;
|
|
1859
|
+
$[11] = key;
|
|
1860
|
+
$[12] = t6;
|
|
1861
|
+
} else t6 = $[12];
|
|
1862
|
+
const t7 = classNames.columnMenuGrip;
|
|
1863
|
+
const t8 = `${labels.moveLeft} / ${labels.moveRight}: ${name}`;
|
|
1864
|
+
let t9;
|
|
1865
|
+
if ($[13] !== index || $[14] !== key || $[15] !== layout.move || $[16] !== t8) {
|
|
1866
|
+
t9 = (0, _adapttable_core.columnReorderKeyProps)(key, index, layout.move, t8);
|
|
1867
|
+
$[13] = index;
|
|
1868
|
+
$[14] = key;
|
|
1869
|
+
$[15] = layout.move;
|
|
1870
|
+
$[16] = t8;
|
|
1871
|
+
$[17] = t9;
|
|
1872
|
+
} else t9 = $[17];
|
|
1873
|
+
let t10;
|
|
1874
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1875
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.GripIcon, {});
|
|
1876
|
+
$[18] = t10;
|
|
1877
|
+
} else t10 = $[18];
|
|
1878
|
+
let t11;
|
|
1879
|
+
if ($[19] !== classNames.columnMenuGrip || $[20] !== t9) {
|
|
1880
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1881
|
+
"data-adapttable-part": "column-menu-grip",
|
|
1882
|
+
className: t7,
|
|
1883
|
+
...t9,
|
|
1884
|
+
children: t10
|
|
1885
|
+
});
|
|
1886
|
+
$[19] = classNames.columnMenuGrip;
|
|
1887
|
+
$[20] = t9;
|
|
1888
|
+
$[21] = t11;
|
|
1889
|
+
} else t11 = $[21];
|
|
1890
|
+
let t12;
|
|
1891
|
+
if ($[22] !== key || $[23] !== layout) {
|
|
1892
|
+
t12 = () => layout.toggleVisible(key);
|
|
1893
|
+
$[22] = key;
|
|
1894
|
+
$[23] = layout;
|
|
1895
|
+
$[24] = t12;
|
|
1896
|
+
} else t12 = $[24];
|
|
1897
|
+
let t13;
|
|
1898
|
+
if ($[25] !== classNames || $[26] !== hidden || $[27] !== labels || $[28] !== name || $[29] !== t12) {
|
|
1899
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VisibilityToggle, {
|
|
1900
|
+
hidden,
|
|
1901
|
+
name,
|
|
1902
|
+
labels,
|
|
1903
|
+
classNames,
|
|
1904
|
+
onToggle: t12
|
|
1905
|
+
});
|
|
1906
|
+
$[25] = classNames;
|
|
1907
|
+
$[26] = hidden;
|
|
1908
|
+
$[27] = labels;
|
|
1909
|
+
$[28] = name;
|
|
1910
|
+
$[29] = t12;
|
|
1911
|
+
$[30] = t13;
|
|
1912
|
+
} else t13 = $[30];
|
|
1913
|
+
let t14;
|
|
1914
|
+
if ($[31] !== classNames || $[32] !== hidden || $[33] !== name) {
|
|
1915
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowName, {
|
|
1916
|
+
hidden,
|
|
1917
|
+
name,
|
|
1918
|
+
classNames
|
|
1919
|
+
});
|
|
1920
|
+
$[31] = classNames;
|
|
1921
|
+
$[32] = hidden;
|
|
1922
|
+
$[33] = name;
|
|
1923
|
+
$[34] = t14;
|
|
1924
|
+
} else t14 = $[34];
|
|
1925
|
+
const t15 = pinned !== void 0;
|
|
1926
|
+
let t16;
|
|
1927
|
+
if ($[35] !== labels || $[36] !== pinned) {
|
|
1928
|
+
t16 = (0, _adapttable_core.pinActionLabel)(pinned, labels);
|
|
1929
|
+
$[35] = labels;
|
|
1930
|
+
$[36] = pinned;
|
|
1931
|
+
$[37] = t16;
|
|
1932
|
+
} else t16 = $[37];
|
|
1933
|
+
const t17 = `${t16}: ${name}`;
|
|
1934
|
+
let t18;
|
|
1935
|
+
if ($[38] !== key || $[39] !== layout || $[40] !== pinned) {
|
|
1936
|
+
t18 = () => layout.setPinned(key, (0, _adapttable_core.nextPinSide)(pinned));
|
|
1937
|
+
$[38] = key;
|
|
1938
|
+
$[39] = layout;
|
|
1939
|
+
$[40] = pinned;
|
|
1940
|
+
$[41] = t18;
|
|
1941
|
+
} else t18 = $[41];
|
|
1942
|
+
let t19;
|
|
1943
|
+
if ($[42] !== classNames || $[43] !== t15 || $[44] !== t17 || $[45] !== t18) {
|
|
1944
|
+
t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
1945
|
+
active: t15,
|
|
1946
|
+
actionLabel: t17,
|
|
1947
|
+
classNames,
|
|
1948
|
+
onClick: t18
|
|
1949
|
+
});
|
|
1950
|
+
$[42] = classNames;
|
|
1951
|
+
$[43] = t15;
|
|
1952
|
+
$[44] = t17;
|
|
1953
|
+
$[45] = t18;
|
|
1954
|
+
$[46] = t19;
|
|
1955
|
+
} else t19 = $[46];
|
|
1956
|
+
let t20;
|
|
1957
|
+
if ($[47] !== classNames.columnMenuItem || $[48] !== pinned || $[49] !== t1 || $[50] !== t11 || $[51] !== t13 || $[52] !== t14 || $[53] !== t19 || $[54] !== t4 || $[55] !== t5 || $[56] !== t6) {
|
|
1958
|
+
t20 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1959
|
+
"data-adapttable-part": "column-menu-item",
|
|
1960
|
+
"data-hidden": t1,
|
|
1961
|
+
"data-pinned": pinned,
|
|
1962
|
+
className: t2,
|
|
1963
|
+
style: t3,
|
|
1964
|
+
...t4,
|
|
1965
|
+
...t5,
|
|
1966
|
+
...t6,
|
|
1967
|
+
children: [
|
|
1968
|
+
t11,
|
|
1969
|
+
t13,
|
|
1970
|
+
t14,
|
|
1971
|
+
t19
|
|
1972
|
+
]
|
|
1973
|
+
});
|
|
1974
|
+
$[47] = classNames.columnMenuItem;
|
|
1975
|
+
$[48] = pinned;
|
|
1976
|
+
$[49] = t1;
|
|
1977
|
+
$[50] = t11;
|
|
1978
|
+
$[51] = t13;
|
|
1979
|
+
$[52] = t14;
|
|
1980
|
+
$[53] = t19;
|
|
1981
|
+
$[54] = t4;
|
|
1982
|
+
$[55] = t5;
|
|
1983
|
+
$[56] = t6;
|
|
1984
|
+
$[57] = t20;
|
|
1985
|
+
} else t20 = $[57];
|
|
1986
|
+
return t20;
|
|
919
1987
|
}
|
|
920
1988
|
/**
|
|
921
1989
|
* The injected row-actions column as a first-class menu row: the same eye
|
|
922
1990
|
* toggle as a data column plus a ONE-CLICK end-pin toggle (right ↔ unpinned).
|
|
923
1991
|
* The column always trails, so there is no left pin and no reorder grip.
|
|
924
1992
|
*/
|
|
925
|
-
function ActionsMenuRowItem(
|
|
926
|
-
const
|
|
1993
|
+
function ActionsMenuRowItem(t0) {
|
|
1994
|
+
const $ = (0, react_compiler_runtime.c)(29);
|
|
1995
|
+
const { layout, labels, classNames } = t0;
|
|
1996
|
+
let t1;
|
|
1997
|
+
if ($[0] !== layout) {
|
|
1998
|
+
t1 = layout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
1999
|
+
$[0] = layout;
|
|
2000
|
+
$[1] = t1;
|
|
2001
|
+
} else t1 = $[1];
|
|
2002
|
+
const hidden = t1;
|
|
927
2003
|
const pinned = layout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] !== void 0;
|
|
928
2004
|
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
|
-
|
|
2005
|
+
const t2 = hidden || void 0;
|
|
2006
|
+
const t3 = pinned ? "right" : void 0;
|
|
2007
|
+
let t4;
|
|
2008
|
+
if ($[2] !== layout) {
|
|
2009
|
+
t4 = () => layout.toggleVisible(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
2010
|
+
$[2] = layout;
|
|
2011
|
+
$[3] = t4;
|
|
2012
|
+
} else t4 = $[3];
|
|
2013
|
+
let t5;
|
|
2014
|
+
if ($[4] !== classNames || $[5] !== hidden || $[6] !== labels || $[7] !== name || $[8] !== t4) {
|
|
2015
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VisibilityToggle, {
|
|
2016
|
+
hidden,
|
|
2017
|
+
name,
|
|
2018
|
+
labels,
|
|
2019
|
+
classNames,
|
|
2020
|
+
onToggle: t4
|
|
2021
|
+
});
|
|
2022
|
+
$[4] = classNames;
|
|
2023
|
+
$[5] = hidden;
|
|
2024
|
+
$[6] = labels;
|
|
2025
|
+
$[7] = name;
|
|
2026
|
+
$[8] = t4;
|
|
2027
|
+
$[9] = t5;
|
|
2028
|
+
} else t5 = $[9];
|
|
2029
|
+
let t6;
|
|
2030
|
+
if ($[10] !== classNames || $[11] !== hidden || $[12] !== name) {
|
|
2031
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowName, {
|
|
2032
|
+
hidden,
|
|
2033
|
+
name,
|
|
2034
|
+
classNames
|
|
2035
|
+
});
|
|
2036
|
+
$[10] = classNames;
|
|
2037
|
+
$[11] = hidden;
|
|
2038
|
+
$[12] = name;
|
|
2039
|
+
$[13] = t6;
|
|
2040
|
+
} else t6 = $[13];
|
|
2041
|
+
const t7 = `${pinned ? labels.unpin : labels.pinRight}: ${name}`;
|
|
2042
|
+
let t8;
|
|
2043
|
+
if ($[14] !== layout || $[15] !== pinned) {
|
|
2044
|
+
t8 = () => layout.setPinned(_adapttable_core.ACTIONS_COLUMN_KEY, pinned ? void 0 : "right");
|
|
2045
|
+
$[14] = layout;
|
|
2046
|
+
$[15] = pinned;
|
|
2047
|
+
$[16] = t8;
|
|
2048
|
+
} else t8 = $[16];
|
|
2049
|
+
let t9;
|
|
2050
|
+
if ($[17] !== classNames || $[18] !== pinned || $[19] !== t7 || $[20] !== t8) {
|
|
2051
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
2052
|
+
active: pinned,
|
|
2053
|
+
actionLabel: t7,
|
|
2054
|
+
classNames,
|
|
2055
|
+
onClick: t8
|
|
2056
|
+
});
|
|
2057
|
+
$[17] = classNames;
|
|
2058
|
+
$[18] = pinned;
|
|
2059
|
+
$[19] = t7;
|
|
2060
|
+
$[20] = t8;
|
|
2061
|
+
$[21] = t9;
|
|
2062
|
+
} else t9 = $[21];
|
|
2063
|
+
let t10;
|
|
2064
|
+
if ($[22] !== classNames.columnMenuItem || $[23] !== t2 || $[24] !== t3 || $[25] !== t5 || $[26] !== t6 || $[27] !== t9) {
|
|
2065
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2066
|
+
"data-adapttable-part": "column-menu-item",
|
|
2067
|
+
"data-actions": "",
|
|
2068
|
+
"data-hidden": t2,
|
|
2069
|
+
"data-pinned": t3,
|
|
2070
|
+
className: classNames.columnMenuItem,
|
|
2071
|
+
children: [
|
|
2072
|
+
t5,
|
|
2073
|
+
t6,
|
|
2074
|
+
t9
|
|
2075
|
+
]
|
|
2076
|
+
});
|
|
2077
|
+
$[22] = classNames.columnMenuItem;
|
|
2078
|
+
$[23] = t2;
|
|
2079
|
+
$[24] = t3;
|
|
2080
|
+
$[25] = t5;
|
|
2081
|
+
$[26] = t6;
|
|
2082
|
+
$[27] = t9;
|
|
2083
|
+
$[28] = t10;
|
|
2084
|
+
} else t10 = $[28];
|
|
2085
|
+
return t10;
|
|
956
2086
|
}
|
|
957
2087
|
/**
|
|
958
2088
|
* Column-management popover: a disclosure button + a panel where each column
|
|
@@ -960,29 +2090,56 @@ function ActionsMenuRowItem({ layout, labels, classNames }) {
|
|
|
960
2090
|
* Closes on outside-click or Escape. Ships no styles — target the
|
|
961
2091
|
* `data-adapttable-part` hooks or the `columnMenu*` className slots.
|
|
962
2092
|
*/
|
|
963
|
-
function ColumnMenu(
|
|
2093
|
+
function ColumnMenu(t0) {
|
|
2094
|
+
const $ = (0, react_compiler_runtime.c)(24);
|
|
2095
|
+
const { allColumns, layout, labels, classNames, hasRowActions } = t0;
|
|
964
2096
|
const drag = (0, _adapttable_core.useColumnDragState)();
|
|
965
2097
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
2098
|
+
let t1;
|
|
2099
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2100
|
+
t1 = { position: "relative" };
|
|
2101
|
+
$[0] = t1;
|
|
2102
|
+
} else t1 = $[0];
|
|
2103
|
+
const t2 = open || void 0;
|
|
2104
|
+
let t3;
|
|
2105
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2106
|
+
t3 = {
|
|
2107
|
+
flexShrink: 0,
|
|
2108
|
+
whiteSpace: "nowrap"
|
|
2109
|
+
};
|
|
2110
|
+
$[1] = t3;
|
|
2111
|
+
} else t3 = $[1];
|
|
2112
|
+
let t4;
|
|
2113
|
+
if ($[2] !== setOpen) {
|
|
2114
|
+
t4 = () => setOpen(_temp);
|
|
2115
|
+
$[2] = setOpen;
|
|
2116
|
+
$[3] = t4;
|
|
2117
|
+
} else t4 = $[3];
|
|
2118
|
+
let t5;
|
|
2119
|
+
if ($[4] !== classNames.columnMenuButton || $[5] !== labels.columns || $[6] !== open || $[7] !== t2 || $[8] !== t4 || $[9] !== triggerRef) {
|
|
2120
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
972
2121
|
ref: triggerRef,
|
|
973
2122
|
type: "button",
|
|
974
2123
|
"aria-expanded": open,
|
|
975
2124
|
"aria-haspopup": "true",
|
|
976
2125
|
"data-adapttable-part": "column-menu-button",
|
|
977
|
-
"data-active":
|
|
2126
|
+
"data-active": t2,
|
|
978
2127
|
className: classNames.columnMenuButton,
|
|
979
|
-
style:
|
|
980
|
-
|
|
981
|
-
whiteSpace: "nowrap"
|
|
982
|
-
},
|
|
983
|
-
onClick: () => setOpen((v) => !v),
|
|
2128
|
+
style: t3,
|
|
2129
|
+
onClick: t4,
|
|
984
2130
|
children: labels.columns
|
|
985
|
-
})
|
|
2131
|
+
});
|
|
2132
|
+
$[4] = classNames.columnMenuButton;
|
|
2133
|
+
$[5] = labels.columns;
|
|
2134
|
+
$[6] = open;
|
|
2135
|
+
$[7] = t2;
|
|
2136
|
+
$[8] = t4;
|
|
2137
|
+
$[9] = triggerRef;
|
|
2138
|
+
$[10] = t5;
|
|
2139
|
+
} else t5 = $[10];
|
|
2140
|
+
let t6;
|
|
2141
|
+
if ($[11] !== allColumns || $[12] !== classNames || $[13] !== drag || $[14] !== hasRowActions || $[15] !== labels || $[16] !== layout || $[17] !== open) {
|
|
2142
|
+
t6 = open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
986
2143
|
"aria-label": labels.columns,
|
|
987
2144
|
"data-adapttable-part": "column-menu-panel",
|
|
988
2145
|
className: classNames.columnMenuPanel,
|
|
@@ -1020,8 +2177,35 @@ function ColumnMenu({ allColumns, layout, labels, classNames, hasRowActions }) {
|
|
|
1020
2177
|
children: labels.resetColumns
|
|
1021
2178
|
})
|
|
1022
2179
|
]
|
|
1023
|
-
})
|
|
1024
|
-
|
|
2180
|
+
});
|
|
2181
|
+
$[11] = allColumns;
|
|
2182
|
+
$[12] = classNames;
|
|
2183
|
+
$[13] = drag;
|
|
2184
|
+
$[14] = hasRowActions;
|
|
2185
|
+
$[15] = labels;
|
|
2186
|
+
$[16] = layout;
|
|
2187
|
+
$[17] = open;
|
|
2188
|
+
$[18] = t6;
|
|
2189
|
+
} else t6 = $[18];
|
|
2190
|
+
let t7;
|
|
2191
|
+
if ($[19] !== classNames.columnMenu || $[20] !== rootRef || $[21] !== t5 || $[22] !== t6) {
|
|
2192
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2193
|
+
ref: rootRef,
|
|
2194
|
+
"data-adapttable-part": "column-menu",
|
|
2195
|
+
className: classNames.columnMenu,
|
|
2196
|
+
style: t1,
|
|
2197
|
+
children: [t5, t6]
|
|
2198
|
+
});
|
|
2199
|
+
$[19] = classNames.columnMenu;
|
|
2200
|
+
$[20] = rootRef;
|
|
2201
|
+
$[21] = t5;
|
|
2202
|
+
$[22] = t6;
|
|
2203
|
+
$[23] = t7;
|
|
2204
|
+
} else t7 = $[23];
|
|
2205
|
+
return t7;
|
|
2206
|
+
}
|
|
2207
|
+
function _temp(v) {
|
|
2208
|
+
return !v;
|
|
1025
2209
|
}
|
|
1026
2210
|
//#endregion
|
|
1027
2211
|
//#region src/components/tables.tsx
|
|
@@ -1053,46 +2237,100 @@ function scrollBoxStyle(maxHeight, scrollX) {
|
|
|
1053
2237
|
};
|
|
1054
2238
|
return scrollX ? { overflowX: "auto" } : void 0;
|
|
1055
2239
|
}
|
|
1056
|
-
function RowActionButtons(
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
2240
|
+
function RowActionButtons(t0) {
|
|
2241
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
2242
|
+
const { row, actions, confirm, cancelLabel, classNames } = t0;
|
|
2243
|
+
let t1;
|
|
2244
|
+
if ($[0] !== actions || $[1] !== cancelLabel || $[2] !== classNames || $[3] !== confirm || $[4] !== row) {
|
|
2245
|
+
let t2;
|
|
2246
|
+
if ($[6] !== cancelLabel || $[7] !== classNames || $[8] !== confirm || $[9] !== row) {
|
|
2247
|
+
t2 = (action) => {
|
|
2248
|
+
if (action.isHidden?.(row)) return null;
|
|
2249
|
+
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(row));
|
|
2250
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
2251
|
+
const handleClick = disabled ? void 0 : (e) => {
|
|
2252
|
+
e.stopPropagation();
|
|
2253
|
+
(0, _adapttable_core.runRowAction)(action, row, confirm, cancelLabel);
|
|
2254
|
+
};
|
|
2255
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2256
|
+
type: "button",
|
|
2257
|
+
disabled,
|
|
2258
|
+
title: reason,
|
|
2259
|
+
"aria-label": action.label,
|
|
2260
|
+
"data-adapttable-part": "action-button",
|
|
2261
|
+
"data-color": action.color,
|
|
2262
|
+
className: classNames.actionButton,
|
|
2263
|
+
onClick: handleClick,
|
|
2264
|
+
children: action.icon ?? action.label
|
|
2265
|
+
}, action.key);
|
|
2266
|
+
};
|
|
2267
|
+
$[6] = cancelLabel;
|
|
2268
|
+
$[7] = classNames;
|
|
2269
|
+
$[8] = confirm;
|
|
2270
|
+
$[9] = row;
|
|
2271
|
+
$[10] = t2;
|
|
2272
|
+
} else t2 = $[10];
|
|
2273
|
+
t1 = actions.map(t2);
|
|
2274
|
+
$[0] = actions;
|
|
2275
|
+
$[1] = cancelLabel;
|
|
2276
|
+
$[2] = classNames;
|
|
2277
|
+
$[3] = confirm;
|
|
2278
|
+
$[4] = row;
|
|
2279
|
+
$[5] = t1;
|
|
2280
|
+
} else t1 = $[5];
|
|
2281
|
+
let t2;
|
|
2282
|
+
if ($[11] !== t1) {
|
|
2283
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
2284
|
+
$[11] = t1;
|
|
2285
|
+
$[12] = t2;
|
|
2286
|
+
} else t2 = $[12];
|
|
2287
|
+
return t2;
|
|
1077
2288
|
}
|
|
1078
2289
|
/**
|
|
1079
2290
|
* The expand/collapse chevron, shared by desktop rows and mobile cards. The
|
|
1080
2291
|
* `data-expanded` attribute is the styling hook for rotating the glyph
|
|
1081
2292
|
* (`rowClickProps`' interactive-child guard keeps the click off the row).
|
|
1082
2293
|
*/
|
|
1083
|
-
function ExpandButton(
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
2294
|
+
function ExpandButton(t0) {
|
|
2295
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
2296
|
+
const { expanded, labels, classNames, onToggle } = t0;
|
|
2297
|
+
const t1 = expanded ? "" : void 0;
|
|
2298
|
+
const t2 = expanded ? labels.collapseRow : labels.expandRow;
|
|
2299
|
+
let t3;
|
|
2300
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2301
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronIcon, { size: 14 });
|
|
2302
|
+
$[0] = t3;
|
|
2303
|
+
} else t3 = $[0];
|
|
2304
|
+
let t4;
|
|
2305
|
+
if ($[1] !== classNames.expandButton || $[2] !== expanded || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2) {
|
|
2306
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2307
|
+
type: "button",
|
|
2308
|
+
"data-adapttable-part": "expand-button",
|
|
2309
|
+
"data-expanded": t1,
|
|
2310
|
+
className: classNames.expandButton,
|
|
2311
|
+
"aria-expanded": expanded,
|
|
2312
|
+
"aria-label": t2,
|
|
2313
|
+
onClick: onToggle,
|
|
2314
|
+
children: t3
|
|
2315
|
+
});
|
|
2316
|
+
$[1] = classNames.expandButton;
|
|
2317
|
+
$[2] = expanded;
|
|
2318
|
+
$[3] = onToggle;
|
|
2319
|
+
$[4] = t1;
|
|
2320
|
+
$[5] = t2;
|
|
2321
|
+
$[6] = t4;
|
|
2322
|
+
} else t4 = $[6];
|
|
2323
|
+
return t4;
|
|
1094
2324
|
}
|
|
1095
2325
|
/**
|
|
2326
|
+
* Props for the memoized desktop row. The comparator below checks ONLY the
|
|
2327
|
+
* visual inputs (row data, selected/expanded state, column + width + class
|
|
2328
|
+
* identities, the pin signature); everything else — `table`, the latest-ref
|
|
2329
|
+
* callback wrappers, `confirm`, `pinOffset`, `measureElement` — is either
|
|
2330
|
+
* stable or only consulted when one of the compared inputs re-renders the
|
|
2331
|
+
* row, so a fresh identity there must not (and does not) defeat the memo.
|
|
2332
|
+
*/
|
|
2333
|
+
/**
|
|
1096
2334
|
* `React.memo` comparator: re-render a row only when one of its VISUAL
|
|
1097
2335
|
* inputs changes. A search keystroke or another row's checkbox re-renders
|
|
1098
2336
|
* the table shell, but every unchanged row bails out here (accessors and
|
|
@@ -1102,26 +2340,70 @@ function desktopRowPropsEqual(prev, next) {
|
|
|
1102
2340
|
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.hasLeftPin === next.hasLeftPin && prev.hasRightPin === next.hasRightPin && prev.actionsPinned === next.actionsPinned && prev.rowClass === next.rowClass && prev.clickable === next.clickable && prev.hasPrefetch === next.hasPrefetch;
|
|
1103
2341
|
}
|
|
1104
2342
|
function DesktopRowBase(props) {
|
|
2343
|
+
const $ = (0, react_compiler_runtime.c)(98);
|
|
1105
2344
|
const { row, index, id, table, columns, labels, classNames, selected, expanded, showActions, rowActions, confirm, columnSpan, pinOffset, hasLeftPin, hasRightPin, actionsPinned, rowClass, clickable, hasPrefetch, onRowClick, onPrefetch, onToggleSelect, onToggleExpand, renderDetail, measureElement } = props;
|
|
1106
2345
|
const expandable = expanded !== void 0;
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
2346
|
+
const t0 = selected === void 0 ? 0 : SELECTION_WIDTH;
|
|
2347
|
+
const t1 = showActions ? ACTIONS_WIDTH : 0;
|
|
2348
|
+
let t10;
|
|
2349
|
+
let t11;
|
|
2350
|
+
let t12;
|
|
2351
|
+
let t2;
|
|
2352
|
+
let t3;
|
|
2353
|
+
let t4;
|
|
2354
|
+
let t5;
|
|
2355
|
+
let t6;
|
|
2356
|
+
let t7;
|
|
2357
|
+
let t8;
|
|
2358
|
+
let t9;
|
|
2359
|
+
if ($[0] !== classNames || $[1] !== clickable || $[2] !== columns || $[3] !== expandable || $[4] !== expanded || $[5] !== hasLeftPin || $[6] !== hasPrefetch || $[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) {
|
|
2360
|
+
const leads = {
|
|
2361
|
+
left: t0,
|
|
2362
|
+
right: t1
|
|
2363
|
+
};
|
|
2364
|
+
const bodyPinStyle = (key) => (0, _adapttable_core.pinnedCellStyle)(pinOffset?.(key), _adapttable_core.PIN_Z.body, leads);
|
|
2365
|
+
let t13;
|
|
2366
|
+
if ($[33] !== index || $[34] !== row || $[35] !== table) {
|
|
2367
|
+
t13 = table.getRowProps(row, index);
|
|
2368
|
+
$[33] = index;
|
|
2369
|
+
$[34] = row;
|
|
2370
|
+
$[35] = table;
|
|
2371
|
+
$[36] = t13;
|
|
2372
|
+
} else t13 = $[36];
|
|
2373
|
+
let rowProps;
|
|
2374
|
+
if ($[37] !== t13) {
|
|
2375
|
+
rowProps = { ...t13 };
|
|
2376
|
+
delete rowProps.key;
|
|
2377
|
+
$[37] = t13;
|
|
2378
|
+
$[38] = rowProps;
|
|
2379
|
+
} else rowProps = $[38];
|
|
2380
|
+
t2 = rowProps;
|
|
2381
|
+
const t14 = clickable ? onRowClick : void 0;
|
|
2382
|
+
if ($[39] !== row || $[40] !== t14) {
|
|
2383
|
+
t3 = (0, _adapttable_core.rowClickProps)(row, t14);
|
|
2384
|
+
$[39] = row;
|
|
2385
|
+
$[40] = t14;
|
|
2386
|
+
$[41] = t3;
|
|
2387
|
+
} else t3 = $[41];
|
|
2388
|
+
t4 = measureElement;
|
|
2389
|
+
t5 = "row";
|
|
2390
|
+
t6 = selected ? "" : void 0;
|
|
2391
|
+
t7 = clickable ? "" : void 0;
|
|
2392
|
+
if ($[42] !== classNames.row || $[43] !== rowClass) {
|
|
2393
|
+
t8 = cx(classNames.row, rowClass);
|
|
2394
|
+
$[42] = classNames.row;
|
|
2395
|
+
$[43] = rowClass;
|
|
2396
|
+
$[44] = t8;
|
|
2397
|
+
} else t8 = $[44];
|
|
2398
|
+
if ($[45] !== hasPrefetch || $[46] !== onPrefetch || $[47] !== row) {
|
|
2399
|
+
t9 = hasPrefetch ? () => onPrefetch(row) : void 0;
|
|
2400
|
+
$[45] = hasPrefetch;
|
|
2401
|
+
$[46] = onPrefetch;
|
|
2402
|
+
$[47] = row;
|
|
2403
|
+
$[48] = t9;
|
|
2404
|
+
} else t9 = $[48];
|
|
2405
|
+
if ($[49] !== classNames || $[50] !== expandable || $[51] !== expanded || $[52] !== id || $[53] !== labels || $[54] !== onToggleExpand) {
|
|
2406
|
+
t10 = expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1125
2407
|
"data-adapttable-part": "expand-cell",
|
|
1126
2408
|
className: classNames.expandCell,
|
|
1127
2409
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandButton, {
|
|
@@ -1130,8 +2412,17 @@ function DesktopRowBase(props) {
|
|
|
1130
2412
|
classNames,
|
|
1131
2413
|
onToggle: () => onToggleExpand(id)
|
|
1132
2414
|
})
|
|
1133
|
-
})
|
|
1134
|
-
|
|
2415
|
+
});
|
|
2416
|
+
$[49] = classNames;
|
|
2417
|
+
$[50] = expandable;
|
|
2418
|
+
$[51] = expanded;
|
|
2419
|
+
$[52] = id;
|
|
2420
|
+
$[53] = labels;
|
|
2421
|
+
$[54] = onToggleExpand;
|
|
2422
|
+
$[55] = t10;
|
|
2423
|
+
} else t10 = $[55];
|
|
2424
|
+
if ($[56] !== classNames.cell || $[57] !== classNames.checkbox || $[58] !== classNames.selectionCell || $[59] !== hasLeftPin || $[60] !== id || $[61] !== labels || $[62] !== onToggleSelect || $[63] !== selected) {
|
|
2425
|
+
t11 = selected !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1135
2426
|
"data-adapttable-part": "selection-cell",
|
|
1136
2427
|
"data-pinned": hasLeftPin ? "left" : void 0,
|
|
1137
2428
|
style: (0, _adapttable_core.edgePinStyle)("left", hasLeftPin, _adapttable_core.PIN_Z.body),
|
|
@@ -1143,44 +2434,162 @@ function DesktopRowBase(props) {
|
|
|
1143
2434
|
onChange: () => onToggleSelect(id),
|
|
1144
2435
|
className: classNames.checkbox
|
|
1145
2436
|
})
|
|
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, {
|
|
2437
|
+
});
|
|
2438
|
+
$[56] = classNames.cell;
|
|
2439
|
+
$[57] = classNames.checkbox;
|
|
2440
|
+
$[58] = classNames.selectionCell;
|
|
2441
|
+
$[59] = hasLeftPin;
|
|
2442
|
+
$[60] = id;
|
|
2443
|
+
$[61] = labels;
|
|
2444
|
+
$[62] = onToggleSelect;
|
|
2445
|
+
$[63] = selected;
|
|
2446
|
+
$[64] = t11;
|
|
2447
|
+
} else t11 = $[64];
|
|
2448
|
+
t12 = columns.map((column) => {
|
|
2449
|
+
const pinStyle = bodyPinStyle(column.key);
|
|
2450
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2451
|
+
...table.getCellProps(column, pinStyle && { style: pinStyle }),
|
|
2452
|
+
"data-adapttable-part": "cell",
|
|
2453
|
+
"data-pinned": pinOffset?.(column.key)?.side,
|
|
2454
|
+
className: classNames.cell,
|
|
2455
|
+
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
1166
2456
|
row,
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
2457
|
+
rowIndex: index
|
|
2458
|
+
}) : column.accessor?.(row)
|
|
2459
|
+
}, column.key);
|
|
2460
|
+
});
|
|
2461
|
+
$[0] = classNames;
|
|
2462
|
+
$[1] = clickable;
|
|
2463
|
+
$[2] = columns;
|
|
2464
|
+
$[3] = expandable;
|
|
2465
|
+
$[4] = expanded;
|
|
2466
|
+
$[5] = hasLeftPin;
|
|
2467
|
+
$[6] = hasPrefetch;
|
|
2468
|
+
$[7] = id;
|
|
2469
|
+
$[8] = index;
|
|
2470
|
+
$[9] = labels;
|
|
2471
|
+
$[10] = measureElement;
|
|
2472
|
+
$[11] = onPrefetch;
|
|
2473
|
+
$[12] = onRowClick;
|
|
2474
|
+
$[13] = onToggleExpand;
|
|
2475
|
+
$[14] = onToggleSelect;
|
|
2476
|
+
$[15] = pinOffset;
|
|
2477
|
+
$[16] = row;
|
|
2478
|
+
$[17] = rowClass;
|
|
2479
|
+
$[18] = selected;
|
|
2480
|
+
$[19] = t0;
|
|
2481
|
+
$[20] = t1;
|
|
2482
|
+
$[21] = table;
|
|
2483
|
+
$[22] = t10;
|
|
2484
|
+
$[23] = t11;
|
|
2485
|
+
$[24] = t12;
|
|
2486
|
+
$[25] = t2;
|
|
2487
|
+
$[26] = t3;
|
|
2488
|
+
$[27] = t4;
|
|
2489
|
+
$[28] = t5;
|
|
2490
|
+
$[29] = t6;
|
|
2491
|
+
$[30] = t7;
|
|
2492
|
+
$[31] = t8;
|
|
2493
|
+
$[32] = t9;
|
|
2494
|
+
} else {
|
|
2495
|
+
t10 = $[22];
|
|
2496
|
+
t11 = $[23];
|
|
2497
|
+
t12 = $[24];
|
|
2498
|
+
t2 = $[25];
|
|
2499
|
+
t3 = $[26];
|
|
2500
|
+
t4 = $[27];
|
|
2501
|
+
t5 = $[28];
|
|
2502
|
+
t6 = $[29];
|
|
2503
|
+
t7 = $[30];
|
|
2504
|
+
t8 = $[31];
|
|
2505
|
+
t9 = $[32];
|
|
2506
|
+
}
|
|
2507
|
+
let t13;
|
|
2508
|
+
if ($[65] !== actionsPinned || $[66] !== classNames || $[67] !== confirm || $[68] !== hasRightPin || $[69] !== labels || $[70] !== row || $[71] !== rowActions || $[72] !== showActions) {
|
|
2509
|
+
t13 = showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2510
|
+
"data-adapttable-part": "actions-cell",
|
|
2511
|
+
"data-pinned": hasRightPin || actionsPinned ? "right" : void 0,
|
|
2512
|
+
style: (0, _adapttable_core.edgePinStyle)("right", hasRightPin || actionsPinned, _adapttable_core.PIN_Z.body),
|
|
2513
|
+
className: cx(classNames.cell, classNames.actionsCell),
|
|
2514
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
2515
|
+
row,
|
|
2516
|
+
actions: rowActions,
|
|
2517
|
+
confirm,
|
|
2518
|
+
cancelLabel: labels.cancel,
|
|
2519
|
+
classNames
|
|
1172
2520
|
})
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
}
|
|
2521
|
+
});
|
|
2522
|
+
$[65] = actionsPinned;
|
|
2523
|
+
$[66] = classNames;
|
|
2524
|
+
$[67] = confirm;
|
|
2525
|
+
$[68] = hasRightPin;
|
|
2526
|
+
$[69] = labels;
|
|
2527
|
+
$[70] = row;
|
|
2528
|
+
$[71] = rowActions;
|
|
2529
|
+
$[72] = showActions;
|
|
2530
|
+
$[73] = t13;
|
|
2531
|
+
} else t13 = $[73];
|
|
2532
|
+
let t14;
|
|
2533
|
+
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) {
|
|
2534
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", {
|
|
2535
|
+
...t2,
|
|
2536
|
+
...t3,
|
|
2537
|
+
ref: t4,
|
|
2538
|
+
"data-adapttable-part": t5,
|
|
2539
|
+
"data-selected": t6,
|
|
2540
|
+
"data-clickable": t7,
|
|
2541
|
+
className: t8,
|
|
2542
|
+
onMouseEnter: t9,
|
|
2543
|
+
children: [
|
|
2544
|
+
t10,
|
|
2545
|
+
t11,
|
|
2546
|
+
t12,
|
|
2547
|
+
t13
|
|
2548
|
+
]
|
|
2549
|
+
});
|
|
2550
|
+
$[74] = t10;
|
|
2551
|
+
$[75] = t11;
|
|
2552
|
+
$[76] = t12;
|
|
2553
|
+
$[77] = t13;
|
|
2554
|
+
$[78] = t2;
|
|
2555
|
+
$[79] = t3;
|
|
2556
|
+
$[80] = t4;
|
|
2557
|
+
$[81] = t5;
|
|
2558
|
+
$[82] = t6;
|
|
2559
|
+
$[83] = t7;
|
|
2560
|
+
$[84] = t8;
|
|
2561
|
+
$[85] = t9;
|
|
2562
|
+
$[86] = t14;
|
|
2563
|
+
} else t14 = $[86];
|
|
2564
|
+
let t15;
|
|
2565
|
+
if ($[87] !== classNames.detailCell || $[88] !== classNames.detailRow || $[89] !== columnSpan || $[90] !== expandable || $[91] !== expanded || $[92] !== renderDetail || $[93] !== row) {
|
|
2566
|
+
t15 = expandable && expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
2567
|
+
"data-adapttable-part": "detail-row",
|
|
2568
|
+
className: classNames.detailRow,
|
|
2569
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2570
|
+
colSpan: columnSpan,
|
|
2571
|
+
"data-adapttable-part": "detail-cell",
|
|
2572
|
+
className: classNames.detailCell,
|
|
2573
|
+
children: renderDetail(row)
|
|
2574
|
+
})
|
|
2575
|
+
});
|
|
2576
|
+
$[87] = classNames.detailCell;
|
|
2577
|
+
$[88] = classNames.detailRow;
|
|
2578
|
+
$[89] = columnSpan;
|
|
2579
|
+
$[90] = expandable;
|
|
2580
|
+
$[91] = expanded;
|
|
2581
|
+
$[92] = renderDetail;
|
|
2582
|
+
$[93] = row;
|
|
2583
|
+
$[94] = t15;
|
|
2584
|
+
} else t15 = $[94];
|
|
2585
|
+
let t16;
|
|
2586
|
+
if ($[95] !== t14 || $[96] !== t15) {
|
|
2587
|
+
t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t14, t15] });
|
|
2588
|
+
$[95] = t14;
|
|
2589
|
+
$[96] = t15;
|
|
2590
|
+
$[97] = t16;
|
|
2591
|
+
} else t16 = $[97];
|
|
2592
|
+
return t16;
|
|
1184
2593
|
}
|
|
1185
2594
|
/**
|
|
1186
2595
|
* One memoized row component per `DesktopTable` instantiation. A factory
|
|
@@ -1220,10 +2629,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1220
2629
|
renderRowDetail
|
|
1221
2630
|
};
|
|
1222
2631
|
const onToggleSelect = (0, react.useCallback)((id) => live.current.selection?.toggle(id), []);
|
|
1223
|
-
const onToggleExpand = (0, react.useCallback)((
|
|
2632
|
+
const onToggleExpand = (0, react.useCallback)((id_0) => live.current.expansion?.toggle(id_0), []);
|
|
1224
2633
|
const handleRowClick = (0, react.useCallback)((row) => live.current.onRowClick?.(row), []);
|
|
1225
|
-
const handlePrefetch = (0, react.useCallback)((
|
|
1226
|
-
const renderDetail = (0, react.useCallback)((
|
|
2634
|
+
const handlePrefetch = (0, react.useCallback)((row_0) => live.current.prefetch?.(row_0), []);
|
|
2635
|
+
const renderDetail = (0, react.useCallback)((row_1) => live.current.renderRowDetail?.(row_1), []);
|
|
1227
2636
|
const Row = (0, react.useMemo)(() => createDesktopRow(), []);
|
|
1228
2637
|
const { ref: overflowRef, overflowing } = (0, _adapttable_core.useHorizontalOverflow)();
|
|
1229
2638
|
const hasPinned = columns.some((c) => pinOffset?.(c.key) != null) || stickActions;
|
|
@@ -1237,21 +2646,21 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1237
2646
|
left: selection ? SELECTION_WIDTH : 0,
|
|
1238
2647
|
right: showActions ? ACTIONS_WIDTH : 0
|
|
1239
2648
|
};
|
|
1240
|
-
const hasLeftPin = columns.some((
|
|
1241
|
-
const hasRightPin = columns.some((
|
|
1242
|
-
const pinSignature = columns.map((
|
|
1243
|
-
const pin = pinOffset?.(
|
|
1244
|
-
return pin ? `${
|
|
2649
|
+
const hasLeftPin = columns.some((c_0) => pinOffset?.(c_0.key)?.side === "left");
|
|
2650
|
+
const hasRightPin = columns.some((c_1) => pinOffset?.(c_1.key)?.side === "right");
|
|
2651
|
+
const pinSignature = columns.map((c_2) => {
|
|
2652
|
+
const pin = pinOffset?.(c_2.key);
|
|
2653
|
+
return pin ? `${c_2.key}:${pin.side}:${pin.inset}` : "";
|
|
1245
2654
|
}).join("|");
|
|
1246
2655
|
const headPinStyle = (key) => (0, _adapttable_core.pinnedCellStyle)(pinOffset?.(key), _adapttable_core.PIN_Z.headerPinned, leads);
|
|
1247
2656
|
const headStyle = (column) => {
|
|
1248
|
-
const
|
|
1249
|
-
const
|
|
1250
|
-
const width =
|
|
1251
|
-
if (!stickyStyle && !
|
|
2657
|
+
const key_0 = column.key;
|
|
2658
|
+
const pin_0 = headPinStyle(key_0);
|
|
2659
|
+
const width = pin_0 ? (0, _adapttable_core.pinnedColumnWidth)(column, columnWidths) : columnWidths?.[key_0];
|
|
2660
|
+
if (!stickyStyle && !pin_0 && width == null && !setWidth) return void 0;
|
|
1252
2661
|
const merged = {
|
|
1253
2662
|
...stickyStyle,
|
|
1254
|
-
...
|
|
2663
|
+
...pin_0,
|
|
1255
2664
|
...width != null && { width }
|
|
1256
2665
|
};
|
|
1257
2666
|
if (setWidth && !merged.position) merged.position = "relative";
|
|
@@ -1265,7 +2674,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1265
2674
|
...edge
|
|
1266
2675
|
};
|
|
1267
2676
|
};
|
|
1268
|
-
const columnName = (
|
|
2677
|
+
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
1269
2678
|
const minWidth = (0, _adapttable_core.tableMinWidth)(columns, {
|
|
1270
2679
|
widths: columnWidths,
|
|
1271
2680
|
extra: (selection ? SELECTION_WIDTH : 0) + (showActions ? ACTIONS_WIDTH : 0)
|
|
@@ -1332,25 +2741,25 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1332
2741
|
className: classNames.checkbox
|
|
1333
2742
|
})
|
|
1334
2743
|
}),
|
|
1335
|
-
columns.map((
|
|
1336
|
-
const localStyle = headStyle(
|
|
1337
|
-
const headerProps = table.getHeaderCellProps(
|
|
1338
|
-
const
|
|
1339
|
-
const sortButtonProps = table.getSortButtonProps(
|
|
2744
|
+
columns.map((column_1) => {
|
|
2745
|
+
const localStyle = headStyle(column_1);
|
|
2746
|
+
const headerProps = table.getHeaderCellProps(column_1, localStyle && { style: localStyle });
|
|
2747
|
+
const active_0 = table.sortBy === column_1.key;
|
|
2748
|
+
const sortButtonProps = table.getSortButtonProps(column_1);
|
|
1340
2749
|
const sortIndex = sortButtonProps["data-sort-index"];
|
|
1341
2750
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("th", {
|
|
1342
2751
|
...headerProps,
|
|
1343
2752
|
"data-adapttable-part": "header-cell",
|
|
1344
|
-
"data-sorted":
|
|
2753
|
+
"data-sorted": active_0 ? table.sortDir : void 0,
|
|
1345
2754
|
"data-sticky": stickyAttr,
|
|
1346
|
-
"data-pinned": pinOffset?.(
|
|
2755
|
+
"data-pinned": pinOffset?.(column_1.key)?.side,
|
|
1347
2756
|
className: classNames.headerCell,
|
|
1348
|
-
children: [
|
|
2757
|
+
children: [column_1.sortable ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1349
2758
|
...sortButtonProps,
|
|
1350
2759
|
"data-adapttable-part": "sort-button",
|
|
1351
2760
|
className: classNames.sortButton,
|
|
1352
2761
|
children: [
|
|
1353
|
-
|
|
2762
|
+
column_1.header,
|
|
1354
2763
|
typeof sortIndex === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1355
2764
|
"data-adapttable-part": "sort-index",
|
|
1356
2765
|
className: classNames.sortIndex,
|
|
@@ -1358,16 +2767,16 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1358
2767
|
}),
|
|
1359
2768
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1360
2769
|
"aria-hidden": true,
|
|
1361
|
-
children: [" ", sortGlyph(
|
|
2770
|
+
children: [" ", sortGlyph(active_0, table.sortDir)]
|
|
1362
2771
|
})
|
|
1363
2772
|
]
|
|
1364
|
-
}) :
|
|
1365
|
-
...(0, _adapttable_core.columnResizeHandleProps)(
|
|
2773
|
+
}) : column_1.header, setWidth && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2774
|
+
...(0, _adapttable_core.columnResizeHandleProps)(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
1366
2775
|
"data-adapttable-part": "resize-handle",
|
|
1367
2776
|
className: classNames.resizeHandle,
|
|
1368
2777
|
style: RESIZE_HANDLE_STYLE
|
|
1369
2778
|
})]
|
|
1370
|
-
},
|
|
2779
|
+
}, column_1.key);
|
|
1371
2780
|
}),
|
|
1372
2781
|
showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1373
2782
|
"data-adapttable-part": "actions-header",
|
|
@@ -1391,18 +2800,18 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1391
2800
|
padding: 0
|
|
1392
2801
|
}
|
|
1393
2802
|
}) }),
|
|
1394
|
-
entries.map(({ row, index, key }) => {
|
|
1395
|
-
const
|
|
2803
|
+
entries.map(({ row: row_2, index, key: key_1 }) => {
|
|
2804
|
+
const id_1 = getRowId(row_2);
|
|
1396
2805
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
|
|
1397
|
-
row,
|
|
2806
|
+
row: row_2,
|
|
1398
2807
|
index,
|
|
1399
|
-
id,
|
|
2808
|
+
id: id_1,
|
|
1400
2809
|
table,
|
|
1401
2810
|
columns,
|
|
1402
2811
|
labels,
|
|
1403
2812
|
classNames,
|
|
1404
|
-
selected: selection ? selection.isSelected(
|
|
1405
|
-
expanded: expansionState ? expansionState.isExpanded(
|
|
2813
|
+
selected: selection ? selection.isSelected(id_1) : void 0,
|
|
2814
|
+
expanded: expansionState ? expansionState.isExpanded(id_1) : void 0,
|
|
1406
2815
|
showActions,
|
|
1407
2816
|
rowActions,
|
|
1408
2817
|
confirm,
|
|
@@ -1413,7 +2822,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1413
2822
|
hasLeftPin,
|
|
1414
2823
|
hasRightPin,
|
|
1415
2824
|
actionsPinned: stickActions,
|
|
1416
|
-
rowClass: rowClassName?.(
|
|
2825
|
+
rowClass: rowClassName?.(row_2, index),
|
|
1417
2826
|
clickable: Boolean(onRowClick),
|
|
1418
2827
|
hasPrefetch: Boolean(prefetch),
|
|
1419
2828
|
onRowClick: handleRowClick,
|
|
@@ -1422,7 +2831,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1422
2831
|
onToggleExpand,
|
|
1423
2832
|
renderDetail,
|
|
1424
2833
|
measureElement
|
|
1425
|
-
},
|
|
2834
|
+
}, key_1);
|
|
1426
2835
|
}),
|
|
1427
2836
|
paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1428
2837
|
colSpan: columnSpan,
|
|
@@ -1442,11 +2851,11 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1442
2851
|
children: [
|
|
1443
2852
|
expandable && summaryPad,
|
|
1444
2853
|
selection && summaryPad,
|
|
1445
|
-
columns.map((
|
|
2854
|
+
columns.map((column_2) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1446
2855
|
"data-adapttable-part": "summary-cell",
|
|
1447
2856
|
className: classNames.summaryCell,
|
|
1448
|
-
children: summary[
|
|
1449
|
-
},
|
|
2857
|
+
children: summary[column_2.key]
|
|
2858
|
+
}, column_2.key)),
|
|
1450
2859
|
showActions && summaryPad
|
|
1451
2860
|
]
|
|
1452
2861
|
})
|
|
@@ -1464,110 +2873,210 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1464
2873
|
});
|
|
1465
2874
|
}
|
|
1466
2875
|
/** Mobile card-list rendering. */
|
|
1467
|
-
function MobileCards(
|
|
2876
|
+
function MobileCards(t0) {
|
|
2877
|
+
const $ = (0, react_compiler_runtime.c)(50);
|
|
2878
|
+
const { table, rows, rowActions, confirm, getRowId, classNames, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
|
|
2879
|
+
const paddingTop = t1 === void 0 ? 0 : t1;
|
|
2880
|
+
const paddingBottom = t2 === void 0 ? 0 : t2;
|
|
1468
2881
|
const { columns, selection, labels } = table;
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2882
|
+
let summary;
|
|
2883
|
+
let t3;
|
|
2884
|
+
let t4;
|
|
2885
|
+
let t5;
|
|
2886
|
+
let t6;
|
|
2887
|
+
let t7;
|
|
2888
|
+
let t8;
|
|
2889
|
+
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) {
|
|
2890
|
+
const entries = (0, _adapttable_core.resolveVirtualRows)(rows, getRowId, rowEntries);
|
|
2891
|
+
const expansionState = renderRowDetail ? expansion : void 0;
|
|
2892
|
+
let t9;
|
|
2893
|
+
if ($[24] !== rows || $[25] !== summaryRow) {
|
|
2894
|
+
t9 = summaryRow?.(rows);
|
|
2895
|
+
$[24] = rows;
|
|
2896
|
+
$[25] = summaryRow;
|
|
2897
|
+
$[26] = t9;
|
|
2898
|
+
} else t9 = $[26];
|
|
2899
|
+
summary = t9;
|
|
2900
|
+
if ($[27] !== table) {
|
|
2901
|
+
t3 = table.getTableProps({ role: void 0 });
|
|
2902
|
+
$[27] = table;
|
|
2903
|
+
$[28] = t3;
|
|
2904
|
+
} else t3 = $[28];
|
|
2905
|
+
t4 = "cards";
|
|
2906
|
+
t5 = classNames.cards;
|
|
2907
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2908
|
+
t6 = {
|
|
2909
|
+
listStyle: "none",
|
|
2910
|
+
margin: 0,
|
|
2911
|
+
padding: 0
|
|
2912
|
+
};
|
|
2913
|
+
$[29] = t6;
|
|
2914
|
+
} else t6 = $[29];
|
|
2915
|
+
if ($[30] !== paddingTop) {
|
|
2916
|
+
t7 = paddingTop > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
1483
2917
|
"aria-hidden": true,
|
|
1484
2918
|
"data-adapttable-part": "virtual-spacer",
|
|
1485
2919
|
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, {
|
|
2920
|
+
});
|
|
2921
|
+
$[30] = paddingTop;
|
|
2922
|
+
$[31] = t7;
|
|
2923
|
+
} else t7 = $[31];
|
|
2924
|
+
t8 = entries.map((t10) => {
|
|
2925
|
+
const { row, index, key } = t10;
|
|
2926
|
+
const id = getRowId(row);
|
|
2927
|
+
const expanded = expansionState?.isExpanded(id) ?? false;
|
|
2928
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2929
|
+
...(0, _adapttable_core.rowClickProps)(row, onRowClick),
|
|
2930
|
+
ref: measureElement,
|
|
2931
|
+
"data-index": index,
|
|
2932
|
+
"data-adapttable-part": "card",
|
|
2933
|
+
"data-selected": selection?.isSelected(id) ? "" : void 0,
|
|
2934
|
+
"data-clickable": onRowClick ? "" : void 0,
|
|
2935
|
+
className: cx(classNames.card, rowClassName?.(row, index)),
|
|
2936
|
+
children: [
|
|
2937
|
+
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2938
|
+
type: "checkbox",
|
|
2939
|
+
"aria-label": labels.selectRow,
|
|
2940
|
+
checked: selection.isSelected(id),
|
|
2941
|
+
onChange: () => selection.toggle(id),
|
|
2942
|
+
className: classNames.checkbox
|
|
2943
|
+
}),
|
|
2944
|
+
expansionState && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandButton, {
|
|
2945
|
+
expanded,
|
|
2946
|
+
labels,
|
|
2947
|
+
classNames,
|
|
2948
|
+
onToggle: () => expansionState.toggle(id)
|
|
2949
|
+
}),
|
|
2950
|
+
columns.map((column) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2951
|
+
"data-adapttable-part": "card-row",
|
|
2952
|
+
className: classNames.cardRow,
|
|
2953
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2954
|
+
"data-adapttable-part": "card-label",
|
|
2955
|
+
className: classNames.cardLabel,
|
|
2956
|
+
children: cardLabel(column)
|
|
2957
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2958
|
+
"data-adapttable-part": "card-value",
|
|
2959
|
+
className: classNames.cardValue,
|
|
2960
|
+
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
1532
2961
|
row,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
2962
|
+
rowIndex: index
|
|
2963
|
+
}) : column.accessor?.(row)
|
|
2964
|
+
})]
|
|
2965
|
+
}, column.key)),
|
|
2966
|
+
rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2967
|
+
"data-adapttable-part": "card-actions",
|
|
2968
|
+
className: classNames.actionsCell,
|
|
2969
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActionButtons, {
|
|
2970
|
+
row,
|
|
2971
|
+
actions: rowActions,
|
|
2972
|
+
confirm,
|
|
2973
|
+
cancelLabel: labels.cancel,
|
|
2974
|
+
classNames
|
|
1543
2975
|
})
|
|
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
|
-
|
|
2976
|
+
}),
|
|
2977
|
+
expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2978
|
+
"data-adapttable-part": "card-detail",
|
|
2979
|
+
className: classNames.cardDetail,
|
|
2980
|
+
children: renderRowDetail(row)
|
|
2981
|
+
})
|
|
2982
|
+
]
|
|
2983
|
+
}, key);
|
|
2984
|
+
});
|
|
2985
|
+
$[0] = classNames;
|
|
2986
|
+
$[1] = columns;
|
|
2987
|
+
$[2] = confirm;
|
|
2988
|
+
$[3] = expansion;
|
|
2989
|
+
$[4] = getRowId;
|
|
2990
|
+
$[5] = labels;
|
|
2991
|
+
$[6] = measureElement;
|
|
2992
|
+
$[7] = onRowClick;
|
|
2993
|
+
$[8] = paddingTop;
|
|
2994
|
+
$[9] = renderRowDetail;
|
|
2995
|
+
$[10] = rowActions;
|
|
2996
|
+
$[11] = rowClassName;
|
|
2997
|
+
$[12] = rowEntries;
|
|
2998
|
+
$[13] = rows;
|
|
2999
|
+
$[14] = selection;
|
|
3000
|
+
$[15] = summaryRow;
|
|
3001
|
+
$[16] = table;
|
|
3002
|
+
$[17] = summary;
|
|
3003
|
+
$[18] = t3;
|
|
3004
|
+
$[19] = t4;
|
|
3005
|
+
$[20] = t5;
|
|
3006
|
+
$[21] = t6;
|
|
3007
|
+
$[22] = t7;
|
|
3008
|
+
$[23] = t8;
|
|
3009
|
+
} else {
|
|
3010
|
+
summary = $[17];
|
|
3011
|
+
t3 = $[18];
|
|
3012
|
+
t4 = $[19];
|
|
3013
|
+
t5 = $[20];
|
|
3014
|
+
t6 = $[21];
|
|
3015
|
+
t7 = $[22];
|
|
3016
|
+
t8 = $[23];
|
|
3017
|
+
}
|
|
3018
|
+
let t9;
|
|
3019
|
+
if ($[32] !== paddingBottom) {
|
|
3020
|
+
t9 = paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
3021
|
+
"aria-hidden": true,
|
|
3022
|
+
"data-adapttable-part": "virtual-spacer",
|
|
3023
|
+
style: { height: paddingBottom }
|
|
3024
|
+
});
|
|
3025
|
+
$[32] = paddingBottom;
|
|
3026
|
+
$[33] = t9;
|
|
3027
|
+
} else t9 = $[33];
|
|
3028
|
+
let t10;
|
|
3029
|
+
if ($[34] !== classNames.cardLabel || $[35] !== classNames.cardRow || $[36] !== classNames.cardValue || $[37] !== classNames.summaryCard || $[38] !== columns || $[39] !== summary) {
|
|
3030
|
+
t10 = summary && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
3031
|
+
"data-adapttable-part": "summary-card",
|
|
3032
|
+
className: classNames.summaryCard,
|
|
3033
|
+
children: columns.filter((column_0) => summary[column_0.key] !== void 0).map((column_1) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3034
|
+
"data-adapttable-part": "card-row",
|
|
3035
|
+
className: classNames.cardRow,
|
|
3036
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3037
|
+
"data-adapttable-part": "card-label",
|
|
3038
|
+
className: classNames.cardLabel,
|
|
3039
|
+
children: cardLabel(column_1)
|
|
3040
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3041
|
+
"data-adapttable-part": "card-value",
|
|
3042
|
+
className: classNames.cardValue,
|
|
3043
|
+
children: summary[column_1.key]
|
|
3044
|
+
})]
|
|
3045
|
+
}, column_1.key))
|
|
3046
|
+
});
|
|
3047
|
+
$[34] = classNames.cardLabel;
|
|
3048
|
+
$[35] = classNames.cardRow;
|
|
3049
|
+
$[36] = classNames.cardValue;
|
|
3050
|
+
$[37] = classNames.summaryCard;
|
|
3051
|
+
$[38] = columns;
|
|
3052
|
+
$[39] = summary;
|
|
3053
|
+
$[40] = t10;
|
|
3054
|
+
} else t10 = $[40];
|
|
3055
|
+
let t11;
|
|
3056
|
+
if ($[41] !== t10 || $[42] !== t3 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t8 || $[48] !== t9) {
|
|
3057
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
3058
|
+
...t3,
|
|
3059
|
+
"data-adapttable-part": t4,
|
|
3060
|
+
className: t5,
|
|
3061
|
+
style: t6,
|
|
3062
|
+
children: [
|
|
3063
|
+
t7,
|
|
3064
|
+
t8,
|
|
3065
|
+
t9,
|
|
3066
|
+
t10
|
|
3067
|
+
]
|
|
3068
|
+
});
|
|
3069
|
+
$[41] = t10;
|
|
3070
|
+
$[42] = t3;
|
|
3071
|
+
$[43] = t4;
|
|
3072
|
+
$[44] = t5;
|
|
3073
|
+
$[45] = t6;
|
|
3074
|
+
$[46] = t7;
|
|
3075
|
+
$[47] = t8;
|
|
3076
|
+
$[48] = t9;
|
|
3077
|
+
$[49] = t11;
|
|
3078
|
+
} else t11 = $[49];
|
|
3079
|
+
return t11;
|
|
1571
3080
|
}
|
|
1572
3081
|
function sortGlyph(active, dir) {
|
|
1573
3082
|
if (!active) return "↕";
|
|
@@ -1579,58 +3088,139 @@ function cardLabel(column) {
|
|
|
1579
3088
|
//#endregion
|
|
1580
3089
|
//#region src/DataTable.tsx
|
|
1581
3090
|
const NO_CLASSNAMES = {};
|
|
1582
|
-
|
|
3091
|
+
/**
|
|
3092
|
+
* `DataTableProps` after tier resolution: the source is definite (whichever
|
|
3093
|
+
* tier provided it) and `filters` is plain JSX (the auto-built form when the
|
|
3094
|
+
* caller passed the declarative array).
|
|
3095
|
+
*/
|
|
3096
|
+
function DataTableBody(t0) {
|
|
3097
|
+
const $ = (0, react_compiler_runtime.c)(48);
|
|
3098
|
+
const { chrome, props, classNames, confirm, getRowId, virtualization, virtualScrollRef, labels } = t0;
|
|
1583
3099
|
const rowActions = chrome.columnLayout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY) ? void 0 : props.rowActions;
|
|
1584
3100
|
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
|
-
|
|
3101
|
+
if (chrome.body === "skeleton") {
|
|
3102
|
+
let t1;
|
|
3103
|
+
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) {
|
|
3104
|
+
t1 = props.slots?.skeleton ?? props.loadingState ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState, {
|
|
3105
|
+
rows: props.skeletonRows ?? props.source.limit,
|
|
3106
|
+
columns: chrome.table.columns.length,
|
|
3107
|
+
variant: chrome.isMobile ? "cards" : "table",
|
|
3108
|
+
labels,
|
|
3109
|
+
classNames,
|
|
3110
|
+
hasActions: (rowActions?.length ?? 0) > 0
|
|
3111
|
+
});
|
|
3112
|
+
$[0] = chrome.isMobile;
|
|
3113
|
+
$[1] = chrome.table;
|
|
3114
|
+
$[2] = classNames;
|
|
3115
|
+
$[3] = labels;
|
|
3116
|
+
$[4] = props.loadingState;
|
|
3117
|
+
$[5] = props.skeletonRows;
|
|
3118
|
+
$[6] = props.slots?.skeleton;
|
|
3119
|
+
$[7] = props.source;
|
|
3120
|
+
$[8] = rowActions?.length;
|
|
3121
|
+
$[9] = t1;
|
|
3122
|
+
} else t1 = $[9];
|
|
3123
|
+
let t2;
|
|
3124
|
+
if ($[10] !== t1) {
|
|
3125
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
3126
|
+
$[10] = t1;
|
|
3127
|
+
$[11] = t2;
|
|
3128
|
+
} else t2 = $[11];
|
|
3129
|
+
return t2;
|
|
3130
|
+
}
|
|
1593
3131
|
if (chrome.body === "empty") {
|
|
1594
3132
|
const noResults = chrome.emptyVariant === "noResults";
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
3133
|
+
let t1;
|
|
3134
|
+
if ($[12] !== chrome.clearFilters || $[13] !== classNames || $[14] !== labels || $[15] !== noResults || $[16] !== props.emptyState || $[17] !== props.slots?.empty) {
|
|
3135
|
+
t1 = props.slots?.empty ?? props.emptyState ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("output", {
|
|
3136
|
+
"data-adapttable-part": "empty",
|
|
3137
|
+
className: classNames.empty,
|
|
3138
|
+
children: [noResults ? labels.noResults : labels.noData, noResults && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3139
|
+
type: "button",
|
|
3140
|
+
"data-adapttable-part": "empty-clear",
|
|
3141
|
+
className: classNames.emptyClear,
|
|
3142
|
+
onClick: chrome.clearFilters,
|
|
3143
|
+
children: labels.clearAll
|
|
3144
|
+
})]
|
|
3145
|
+
});
|
|
3146
|
+
$[12] = chrome.clearFilters;
|
|
3147
|
+
$[13] = classNames;
|
|
3148
|
+
$[14] = labels;
|
|
3149
|
+
$[15] = noResults;
|
|
3150
|
+
$[16] = props.emptyState;
|
|
3151
|
+
$[17] = props.slots?.empty;
|
|
3152
|
+
$[18] = t1;
|
|
3153
|
+
} else t1 = $[18];
|
|
3154
|
+
let t2;
|
|
3155
|
+
if ($[19] !== t1) {
|
|
3156
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t1 });
|
|
3157
|
+
$[19] = t1;
|
|
3158
|
+
$[20] = t2;
|
|
3159
|
+
} else t2 = $[20];
|
|
3160
|
+
return t2;
|
|
1606
3161
|
}
|
|
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
|
-
|
|
3162
|
+
const Renderer = chrome.isMobile ? MobileCards : DesktopTable;
|
|
3163
|
+
const t1 = chrome.detail?.expansion;
|
|
3164
|
+
const t2 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3165
|
+
const t3 = props.resizableColumns ? chrome.columnLayout.setWidth : void 0;
|
|
3166
|
+
let t4;
|
|
3167
|
+
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) {
|
|
3168
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Renderer, {
|
|
3169
|
+
table: chrome.table,
|
|
3170
|
+
rows: props.source.rows,
|
|
3171
|
+
rowActions,
|
|
3172
|
+
actionsPinned,
|
|
3173
|
+
confirm,
|
|
3174
|
+
getRowId,
|
|
3175
|
+
classNames,
|
|
3176
|
+
prefetch: props.prefetch,
|
|
3177
|
+
onRowClick: props.onRowClick,
|
|
3178
|
+
rowClassName: props.rowClassName,
|
|
3179
|
+
renderRowDetail: props.renderRowDetail,
|
|
3180
|
+
summaryRow: props.summaryRow,
|
|
3181
|
+
expansion: t1,
|
|
3182
|
+
rowEntries: t2,
|
|
3183
|
+
paddingTop: virtualization.paddingTop,
|
|
3184
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3185
|
+
measureElement: virtualization.measureElement,
|
|
3186
|
+
stickyHeader: props.stickyHeader,
|
|
3187
|
+
stickyTop: props.stickyTop,
|
|
3188
|
+
pinOffset: chrome.columnLayout.pinOffset,
|
|
3189
|
+
maxHeight: props.maxHeight,
|
|
3190
|
+
virtualScrollRef,
|
|
3191
|
+
setWidth: t3,
|
|
3192
|
+
columnWidths: chrome.columnLayout.state.widths,
|
|
3193
|
+
resizeLabel: labels.resizeColumn
|
|
3194
|
+
});
|
|
3195
|
+
$[21] = Renderer;
|
|
3196
|
+
$[22] = actionsPinned;
|
|
3197
|
+
$[23] = chrome.columnLayout.pinOffset;
|
|
3198
|
+
$[24] = chrome.columnLayout.state.widths;
|
|
3199
|
+
$[25] = chrome.table;
|
|
3200
|
+
$[26] = classNames;
|
|
3201
|
+
$[27] = confirm;
|
|
3202
|
+
$[28] = getRowId;
|
|
3203
|
+
$[29] = labels.resizeColumn;
|
|
3204
|
+
$[30] = props.maxHeight;
|
|
3205
|
+
$[31] = props.onRowClick;
|
|
3206
|
+
$[32] = props.prefetch;
|
|
3207
|
+
$[33] = props.renderRowDetail;
|
|
3208
|
+
$[34] = props.rowClassName;
|
|
3209
|
+
$[35] = props.source.rows;
|
|
3210
|
+
$[36] = props.stickyHeader;
|
|
3211
|
+
$[37] = props.stickyTop;
|
|
3212
|
+
$[38] = props.summaryRow;
|
|
3213
|
+
$[39] = rowActions;
|
|
3214
|
+
$[40] = t1;
|
|
3215
|
+
$[41] = t2;
|
|
3216
|
+
$[42] = t3;
|
|
3217
|
+
$[43] = virtualScrollRef;
|
|
3218
|
+
$[44] = virtualization.measureElement;
|
|
3219
|
+
$[45] = virtualization.paddingBottom;
|
|
3220
|
+
$[46] = virtualization.paddingTop;
|
|
3221
|
+
$[47] = t4;
|
|
3222
|
+
} else t4 = $[47];
|
|
3223
|
+
return t4;
|
|
1634
3224
|
}
|
|
1635
3225
|
/**
|
|
1636
3226
|
* Headless, unstyled AdaptTable for Tailwind / shadcn / custom CSS. Renders
|