schummar-table 0.44.1 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +424 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +343 -203
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,11 +54,11 @@ var defaultColors = {
|
|
|
54
54
|
// src/components/spinnner.tsx
|
|
55
55
|
import { css } from "@emotion/react";
|
|
56
56
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
57
|
-
function Spinner({ className:
|
|
57
|
+
function Spinner({ className: className3 }) {
|
|
58
58
|
return /* @__PURE__ */ jsxs(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
61
|
+
className: className3,
|
|
62
62
|
css: css`
|
|
63
63
|
display: inline-block;
|
|
64
64
|
position: relative;
|
|
@@ -220,7 +220,7 @@ var Button = (_a) => {
|
|
|
220
220
|
// src/theme/defaultTheme/checkbox.tsx
|
|
221
221
|
import { jsx as jsx4, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
222
222
|
var Checkbox = (_a) => {
|
|
223
|
-
var _b = _a, { className:
|
|
223
|
+
var _b = _a, { className: className3 } = _b, props = __objRest(_b, ["className"]);
|
|
224
224
|
return /* @__PURE__ */ jsxs4(
|
|
225
225
|
"label",
|
|
226
226
|
{
|
|
@@ -237,7 +237,7 @@ var Checkbox = (_a) => {
|
|
|
237
237
|
},
|
|
238
238
|
props.disabled && { color: "rgba(0, 0, 0, 0.26)" }
|
|
239
239
|
],
|
|
240
|
-
className:
|
|
240
|
+
className: className3,
|
|
241
241
|
children: [
|
|
242
242
|
/* @__PURE__ */ jsx4("input", __spreadValues({ type: "checkbox" }, props)),
|
|
243
243
|
props.checked ? /* @__PURE__ */ jsx4(
|
|
@@ -299,7 +299,7 @@ var TextField = (_a) => {
|
|
|
299
299
|
var _b = _a, {
|
|
300
300
|
startIcon,
|
|
301
301
|
endIcon,
|
|
302
|
-
className:
|
|
302
|
+
className: className3,
|
|
303
303
|
inputRef,
|
|
304
304
|
onBlur
|
|
305
305
|
} = _b, props = __objRest(_b, [
|
|
@@ -314,7 +314,7 @@ var TextField = (_a) => {
|
|
|
314
314
|
return /* @__PURE__ */ jsxs5(
|
|
315
315
|
"div",
|
|
316
316
|
{
|
|
317
|
-
className:
|
|
317
|
+
className: className3,
|
|
318
318
|
css: [
|
|
319
319
|
{
|
|
320
320
|
flex: 1,
|
|
@@ -757,7 +757,7 @@ var castArray = (a) => Array.isArray(a) ? a : [a];
|
|
|
757
757
|
var cx = (...classNames) => classNames.flatMap((entry) => {
|
|
758
758
|
if (!entry) return [];
|
|
759
759
|
if (typeof entry === "string") return [entry];
|
|
760
|
-
return Object.entries(entry).filter(([, predicate]) => predicate).map(([
|
|
760
|
+
return Object.entries(entry).filter(([, predicate]) => predicate).map(([className3]) => className3);
|
|
761
761
|
}).join(" ");
|
|
762
762
|
function isTruthy(x) {
|
|
763
763
|
return !!x;
|
|
@@ -1101,12 +1101,12 @@ function Filter(_a) {
|
|
|
1101
1101
|
// src/components/datePicker.tsx
|
|
1102
1102
|
import { useDayzed } from "dayzed";
|
|
1103
1103
|
import {
|
|
1104
|
-
Fragment as
|
|
1104
|
+
Fragment as Fragment4,
|
|
1105
1105
|
createContext as createContext4,
|
|
1106
1106
|
useContext as useContext6,
|
|
1107
1107
|
useEffect as useEffect2,
|
|
1108
|
-
useMemo as
|
|
1109
|
-
useState as
|
|
1108
|
+
useMemo as useMemo6,
|
|
1109
|
+
useState as useState6
|
|
1110
1110
|
} from "react";
|
|
1111
1111
|
|
|
1112
1112
|
// src/misc/defaults.ts
|
|
@@ -1146,11 +1146,7 @@ var tabNext = (event) => {
|
|
|
1146
1146
|
next.focus();
|
|
1147
1147
|
}
|
|
1148
1148
|
};
|
|
1149
|
-
function DateInput({
|
|
1150
|
-
value,
|
|
1151
|
-
onChange,
|
|
1152
|
-
locale
|
|
1153
|
-
}) {
|
|
1149
|
+
function DateInput({ value, onChange, locale }) {
|
|
1154
1150
|
const [override, setOverride] = useState4();
|
|
1155
1151
|
const commit = () => {
|
|
1156
1152
|
if (!override) {
|
|
@@ -1245,8 +1241,121 @@ function Text({ id }) {
|
|
|
1245
1241
|
return /* @__PURE__ */ jsx13(Fragment2, { children: text });
|
|
1246
1242
|
}
|
|
1247
1243
|
|
|
1244
|
+
// src/components/timeInput.tsx
|
|
1245
|
+
import { Fragment as Fragment3, useMemo as useMemo5, useState as useState5 } from "react";
|
|
1246
|
+
import { jsx as jsx14 } from "@emotion/react/jsx-runtime";
|
|
1247
|
+
var className2 = "schummar-table-time-input";
|
|
1248
|
+
var defaultDate2 = new Date(1970, 0, 1);
|
|
1249
|
+
var isIncludedType2 = (type) => type === "hour" || type === "minute" || type === "second";
|
|
1250
|
+
var defaultLengths2 = {
|
|
1251
|
+
hour: 2,
|
|
1252
|
+
minute: 2,
|
|
1253
|
+
second: 2
|
|
1254
|
+
};
|
|
1255
|
+
var maxLengths2 = {
|
|
1256
|
+
hour: 2,
|
|
1257
|
+
minute: 2,
|
|
1258
|
+
second: 2
|
|
1259
|
+
};
|
|
1260
|
+
var length2 = (type, value) => Math.max(value.length, defaultLengths2[type]);
|
|
1261
|
+
var tabNext2 = (event) => {
|
|
1262
|
+
const all = Array.from(document.querySelectorAll(`.${className2}`));
|
|
1263
|
+
const index = all.indexOf(event);
|
|
1264
|
+
const next = all[(index + 1) % all.length];
|
|
1265
|
+
if (next instanceof HTMLElement) {
|
|
1266
|
+
next.focus();
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
function TimeInput({ value, onChange, locale, showSeconds = true }) {
|
|
1270
|
+
const [override, setOverride] = useState5();
|
|
1271
|
+
const commit = () => {
|
|
1272
|
+
if (!override) {
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
setOverride(void 0);
|
|
1276
|
+
if (!override.value) {
|
|
1277
|
+
onChange(null);
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
const newValue = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
1281
|
+
switch (override.type) {
|
|
1282
|
+
case "hour": {
|
|
1283
|
+
newValue.setHours(Number(override.value));
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
case "minute": {
|
|
1287
|
+
newValue.setMinutes(Number(override.value));
|
|
1288
|
+
break;
|
|
1289
|
+
}
|
|
1290
|
+
case "second": {
|
|
1291
|
+
newValue.setSeconds(Number(override.value));
|
|
1292
|
+
break;
|
|
1293
|
+
}
|
|
1294
|
+
default: {
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
onChange(newValue);
|
|
1299
|
+
};
|
|
1300
|
+
const format = useMemo5(
|
|
1301
|
+
() => new Intl.DateTimeFormat(locale, {
|
|
1302
|
+
hour: "2-digit",
|
|
1303
|
+
minute: "2-digit",
|
|
1304
|
+
second: showSeconds ? "2-digit" : void 0
|
|
1305
|
+
}),
|
|
1306
|
+
[locale]
|
|
1307
|
+
);
|
|
1308
|
+
const parts = format.formatToParts(value != null ? value : defaultDate2);
|
|
1309
|
+
const isEmpty = !value;
|
|
1310
|
+
return /* @__PURE__ */ jsx14(
|
|
1311
|
+
"div",
|
|
1312
|
+
{
|
|
1313
|
+
css: {
|
|
1314
|
+
display: "flex",
|
|
1315
|
+
alignItems: "baseline"
|
|
1316
|
+
},
|
|
1317
|
+
children: parts.map(({ type, value: value2 }, index) => /* @__PURE__ */ jsx14(Fragment3, { children: isIncludedType2(type) ? /* @__PURE__ */ jsx14(
|
|
1318
|
+
"input",
|
|
1319
|
+
{
|
|
1320
|
+
className: className2,
|
|
1321
|
+
css: {
|
|
1322
|
+
boxSizing: "content-box",
|
|
1323
|
+
overflow: "visible",
|
|
1324
|
+
border: "none",
|
|
1325
|
+
borderBottom: "2px solid transparent",
|
|
1326
|
+
outline: "none",
|
|
1327
|
+
fontSize: "inherit",
|
|
1328
|
+
backgroundColor: "inherit",
|
|
1329
|
+
color: "inherit",
|
|
1330
|
+
"::placeholder": {
|
|
1331
|
+
color: "inherit",
|
|
1332
|
+
opacity: 0.5
|
|
1333
|
+
},
|
|
1334
|
+
"&:focus": {
|
|
1335
|
+
borderBottom: "2px solid var(--primaryMain)"
|
|
1336
|
+
}
|
|
1337
|
+
},
|
|
1338
|
+
style: {
|
|
1339
|
+
width: `${length2(type, value2)}ch`
|
|
1340
|
+
},
|
|
1341
|
+
placeholder: "".padEnd(length2(type, value2), "0"),
|
|
1342
|
+
value: (override == null ? void 0 : override.type) === type ? override.value : !isEmpty ? value2 : "",
|
|
1343
|
+
onChange: (event) => {
|
|
1344
|
+
setOverride({ type, value: event.target.value });
|
|
1345
|
+
if (event.target.value.length >= maxLengths2[type]) {
|
|
1346
|
+
setTimeout(() => tabNext2(event.target));
|
|
1347
|
+
}
|
|
1348
|
+
},
|
|
1349
|
+
onFocus: (event) => event.target.select(),
|
|
1350
|
+
onBlur: commit
|
|
1351
|
+
}
|
|
1352
|
+
) : type === "literal" ? /* @__PURE__ */ jsx14("span", { children: value2 }) : null }, index))
|
|
1353
|
+
}
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1248
1357
|
// src/components/datePicker.tsx
|
|
1249
|
-
import { Fragment as
|
|
1358
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
|
|
1250
1359
|
var DatePickerContext = createContext4({});
|
|
1251
1360
|
function DatePickerProvider(_a) {
|
|
1252
1361
|
var _b = _a, {
|
|
@@ -1254,8 +1363,8 @@ function DatePickerProvider(_a) {
|
|
|
1254
1363
|
} = _b, props = __objRest(_b, [
|
|
1255
1364
|
"children"
|
|
1256
1365
|
]);
|
|
1257
|
-
const value =
|
|
1258
|
-
return /* @__PURE__ */
|
|
1366
|
+
const value = useMemo6(() => props, [JSON.stringify(props)]);
|
|
1367
|
+
return /* @__PURE__ */ jsx15(DatePickerContext.Provider, { value, children });
|
|
1259
1368
|
}
|
|
1260
1369
|
var weekDays = [0, 1, 2, 3, 4, 5, 6];
|
|
1261
1370
|
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
@@ -1333,12 +1442,12 @@ var getCalendarWeek = (date) => {
|
|
|
1333
1442
|
return weekOfYear;
|
|
1334
1443
|
};
|
|
1335
1444
|
var commonQuickOptions = {
|
|
1336
|
-
today: { label: /* @__PURE__ */
|
|
1337
|
-
thisWeek: { label: /* @__PURE__ */
|
|
1338
|
-
thisMonth: { label: /* @__PURE__ */
|
|
1339
|
-
thisYear: { label: /* @__PURE__ */
|
|
1340
|
-
lastSevenDays: { label: /* @__PURE__ */
|
|
1341
|
-
lastThirtyDays: { label: /* @__PURE__ */
|
|
1445
|
+
today: { label: /* @__PURE__ */ jsx15(Text, { id: "today" }), value: today },
|
|
1446
|
+
thisWeek: { label: /* @__PURE__ */ jsx15(Text, { id: "thisWeek" }), value: (props) => thisWeek(0, props.firstDayOfWeek) },
|
|
1447
|
+
thisMonth: { label: /* @__PURE__ */ jsx15(Text, { id: "thisMonth" }), value: () => thisMonth() },
|
|
1448
|
+
thisYear: { label: /* @__PURE__ */ jsx15(Text, { id: "thisYear" }), value: () => thisYear() },
|
|
1449
|
+
lastSevenDays: { label: /* @__PURE__ */ jsx15(Text, { id: "lastSevenDays" }), value: () => lastDays(7) },
|
|
1450
|
+
lastThirtyDays: { label: /* @__PURE__ */ jsx15(Text, { id: "lastThirtyDays" }), value: () => lastDays(30) }
|
|
1342
1451
|
};
|
|
1343
1452
|
function dateIntersect(a, b) {
|
|
1344
1453
|
if (a instanceof Date) {
|
|
@@ -1385,7 +1494,8 @@ function DatePicker(props) {
|
|
|
1385
1494
|
minDate,
|
|
1386
1495
|
maxDate,
|
|
1387
1496
|
showCalendarWeek,
|
|
1388
|
-
blockedRanges = []
|
|
1497
|
+
blockedRanges = [],
|
|
1498
|
+
showTime
|
|
1389
1499
|
} = defaults(props, context);
|
|
1390
1500
|
function onChange(value2, source) {
|
|
1391
1501
|
if (value2 instanceof Date) {
|
|
@@ -1453,10 +1563,10 @@ function DatePicker(props) {
|
|
|
1453
1563
|
}
|
|
1454
1564
|
];
|
|
1455
1565
|
}
|
|
1456
|
-
const mountTime =
|
|
1457
|
-
const [dirty, setDirty] =
|
|
1458
|
-
const [hovered, setHovered] =
|
|
1459
|
-
const [dateInViewLocal, setDateInViewLocal] =
|
|
1566
|
+
const mountTime = useMemo6(() => /* @__PURE__ */ new Date(), []);
|
|
1567
|
+
const [dirty, setDirty] = useState6();
|
|
1568
|
+
const [hovered, setHovered] = useState6();
|
|
1569
|
+
const [dateInViewLocal, setDateInViewLocal] = useState6(defaultDateInView != null ? defaultDateInView : mountTime);
|
|
1460
1570
|
const dateInView = (_a = props.dateInView) != null ? _a : dateInViewLocal;
|
|
1461
1571
|
function setDateInView(date) {
|
|
1462
1572
|
var _a2;
|
|
@@ -1467,7 +1577,7 @@ function DatePicker(props) {
|
|
|
1467
1577
|
const max = dirty ? dirty.max : value instanceof Date ? value : value == null ? void 0 : value.max;
|
|
1468
1578
|
const resolvedQuickOptions = [
|
|
1469
1579
|
...quickOptions,
|
|
1470
|
-
...noReset ? [] : [{ label: /* @__PURE__ */
|
|
1580
|
+
...noReset ? [] : [{ label: /* @__PURE__ */ jsx15(Text, { id: "reset" }), value: null }]
|
|
1471
1581
|
].map((option, index) => {
|
|
1472
1582
|
if (option instanceof Function) {
|
|
1473
1583
|
return option((value3) => {
|
|
@@ -1476,7 +1586,7 @@ function DatePicker(props) {
|
|
|
1476
1586
|
});
|
|
1477
1587
|
}
|
|
1478
1588
|
const { label, value: value2 } = typeof option === "string" ? commonQuickOptions[option] : option;
|
|
1479
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsx15(
|
|
1480
1590
|
Button2,
|
|
1481
1591
|
{
|
|
1482
1592
|
variant: "text",
|
|
@@ -1507,8 +1617,8 @@ function DatePicker(props) {
|
|
|
1507
1617
|
minDate,
|
|
1508
1618
|
maxDate
|
|
1509
1619
|
});
|
|
1510
|
-
const now =
|
|
1511
|
-
const formatWeekday =
|
|
1620
|
+
const now = useMemo6(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
1621
|
+
const formatWeekday = useMemo6(() => {
|
|
1512
1622
|
const { format } = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
1513
1623
|
return (weekDay) => format(new Date(Date.UTC(2021, 7, (weekDay + firstDayOfWeek) % 7 + 1)));
|
|
1514
1624
|
}, [locale, firstDayOfWeek]);
|
|
@@ -1544,11 +1654,11 @@ function DatePicker(props) {
|
|
|
1544
1654
|
setDirty({ min: min2, max: max2 });
|
|
1545
1655
|
}
|
|
1546
1656
|
}
|
|
1547
|
-
const formatMonth =
|
|
1657
|
+
const formatMonth = useMemo6(() => {
|
|
1548
1658
|
const { format } = new Intl.DateTimeFormat(locale, { month: "long" });
|
|
1549
1659
|
return (month) => format(new Date(2021, month));
|
|
1550
1660
|
}, [locale]);
|
|
1551
|
-
const formatYear =
|
|
1661
|
+
const formatYear = useMemo6(() => {
|
|
1552
1662
|
const { format } = new Intl.DateTimeFormat(locale, { year: "numeric" });
|
|
1553
1663
|
return (year) => format(new Date(year, 0, 1));
|
|
1554
1664
|
}, [locale]);
|
|
@@ -1569,28 +1679,55 @@ function DatePicker(props) {
|
|
|
1569
1679
|
display: "grid",
|
|
1570
1680
|
gridAutoFlow: "column",
|
|
1571
1681
|
justifyContent: "center",
|
|
1572
|
-
alignItems: "
|
|
1573
|
-
gap: "var(--spacing)"
|
|
1682
|
+
alignItems: "center",
|
|
1683
|
+
gap: "calc(var(--spacing) * 4)",
|
|
1684
|
+
"& > div": {
|
|
1685
|
+
display: "flex",
|
|
1686
|
+
flexDirection: "column",
|
|
1687
|
+
alignItems: "center"
|
|
1688
|
+
}
|
|
1574
1689
|
},
|
|
1575
1690
|
children: [
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
|
|
1578
|
-
{
|
|
1579
|
-
value: min != null ? min : null,
|
|
1580
|
-
onChange: (date) => set("input", date != null ? date : void 0, max, "min"),
|
|
1581
|
-
locale
|
|
1582
|
-
}
|
|
1583
|
-
),
|
|
1584
|
-
rangeSelect && /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
1585
|
-
" - ",
|
|
1586
|
-
/* @__PURE__ */ jsx14(
|
|
1691
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1692
|
+
/* @__PURE__ */ jsx15(
|
|
1587
1693
|
DateInput,
|
|
1588
1694
|
{
|
|
1589
|
-
value:
|
|
1590
|
-
onChange: (date) => set("input",
|
|
1695
|
+
value: min != null ? min : null,
|
|
1696
|
+
onChange: (date) => set("input", date != null ? date : void 0, max, "min"),
|
|
1591
1697
|
locale
|
|
1592
1698
|
}
|
|
1699
|
+
),
|
|
1700
|
+
showTime && /* @__PURE__ */ jsx15(
|
|
1701
|
+
TimeInput,
|
|
1702
|
+
{
|
|
1703
|
+
value: min != null ? min : null,
|
|
1704
|
+
onChange: (date) => set("input", date != null ? date : void 0, max, "min"),
|
|
1705
|
+
locale,
|
|
1706
|
+
showSeconds: typeof showTime === "boolean" ? true : showTime.showSeconds
|
|
1707
|
+
}
|
|
1593
1708
|
)
|
|
1709
|
+
] }),
|
|
1710
|
+
rangeSelect && /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
1711
|
+
" - ",
|
|
1712
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1713
|
+
/* @__PURE__ */ jsx15(
|
|
1714
|
+
DateInput,
|
|
1715
|
+
{
|
|
1716
|
+
value: max != null ? max : null,
|
|
1717
|
+
onChange: (date) => set("input", min, date != null ? date : void 0, "max"),
|
|
1718
|
+
locale
|
|
1719
|
+
}
|
|
1720
|
+
),
|
|
1721
|
+
showTime && /* @__PURE__ */ jsx15(
|
|
1722
|
+
TimeInput,
|
|
1723
|
+
{
|
|
1724
|
+
value: max != null ? max : null,
|
|
1725
|
+
onChange: (date) => set("input", min, date != null ? date : void 0, "max"),
|
|
1726
|
+
locale,
|
|
1727
|
+
showSeconds: typeof showTime === "boolean" ? true : showTime.showSeconds
|
|
1728
|
+
}
|
|
1729
|
+
)
|
|
1730
|
+
] })
|
|
1594
1731
|
] })
|
|
1595
1732
|
]
|
|
1596
1733
|
}
|
|
@@ -1607,13 +1744,13 @@ function DatePicker(props) {
|
|
|
1607
1744
|
alignItems: "center"
|
|
1608
1745
|
},
|
|
1609
1746
|
children: [
|
|
1610
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ jsx15(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getBackProps({ calendars })), { children: /* @__PURE__ */ jsx15(ChevronRight2, { css: { transform: "rotate3d(0, 0, 1, 180deg)" } }) })),
|
|
1611
1748
|
/* @__PURE__ */ jsxs8("div", { css: { display: "flex" }, children: [
|
|
1612
1749
|
formatMonth(month),
|
|
1613
1750
|
" ",
|
|
1614
1751
|
formatYear(year)
|
|
1615
1752
|
] }),
|
|
1616
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ jsx15(IconButton2, __spreadProps(__spreadValues({ type: "button" }, getForwardProps({ calendars })), { children: /* @__PURE__ */ jsx15(ChevronRight2, {}) }))
|
|
1617
1754
|
]
|
|
1618
1755
|
}
|
|
1619
1756
|
),
|
|
@@ -1626,7 +1763,7 @@ function DatePicker(props) {
|
|
|
1626
1763
|
gridTemplateColumns: "repeat(8, max-content)"
|
|
1627
1764
|
},
|
|
1628
1765
|
children: [
|
|
1629
|
-
showCalendarWeek ? /* @__PURE__ */
|
|
1766
|
+
showCalendarWeek ? /* @__PURE__ */ jsx15(
|
|
1630
1767
|
"div",
|
|
1631
1768
|
{
|
|
1632
1769
|
css: {
|
|
@@ -1634,10 +1771,10 @@ function DatePicker(props) {
|
|
|
1634
1771
|
padding: 10,
|
|
1635
1772
|
borderRight: "1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))"
|
|
1636
1773
|
},
|
|
1637
|
-
children: /* @__PURE__ */
|
|
1774
|
+
children: /* @__PURE__ */ jsx15(Text, { id: "calendarWeek" })
|
|
1638
1775
|
}
|
|
1639
|
-
) : /* @__PURE__ */
|
|
1640
|
-
weekDays.map((_v, weekDay) => /* @__PURE__ */
|
|
1776
|
+
) : /* @__PURE__ */ jsx15("div", {}),
|
|
1777
|
+
weekDays.map((_v, weekDay) => /* @__PURE__ */ jsx15(
|
|
1641
1778
|
"div",
|
|
1642
1779
|
{
|
|
1643
1780
|
css: {
|
|
@@ -1652,8 +1789,8 @@ function DatePicker(props) {
|
|
|
1652
1789
|
const weekStart = week[0];
|
|
1653
1790
|
const weekEnd = week[6];
|
|
1654
1791
|
const weekDisabled = !rangeSelect || minDate && weekEnd.date < minDate || maxDate && weekStart.date > maxDate;
|
|
1655
|
-
return /* @__PURE__ */ jsxs8(
|
|
1656
|
-
showCalendarWeek ? /* @__PURE__ */
|
|
1792
|
+
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
1793
|
+
showCalendarWeek ? /* @__PURE__ */ jsx15(
|
|
1657
1794
|
"button",
|
|
1658
1795
|
{
|
|
1659
1796
|
type: "button",
|
|
@@ -1678,10 +1815,10 @@ function DatePicker(props) {
|
|
|
1678
1815
|
onPointerOut: () => !weekDisabled && setHovered(void 0),
|
|
1679
1816
|
children: getCalendarWeek(weekEnd.date)
|
|
1680
1817
|
}
|
|
1681
|
-
) : /* @__PURE__ */
|
|
1818
|
+
) : /* @__PURE__ */ jsx15("div", {}),
|
|
1682
1819
|
week.map((dateObject, dayIndex) => {
|
|
1683
1820
|
if (!dateObject) {
|
|
1684
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ jsx15("div", {}, dayIndex);
|
|
1685
1822
|
}
|
|
1686
1823
|
const { prevMonth, nextMonth, date } = dateObject;
|
|
1687
1824
|
const today2 = startOfDay(date).getTime() === now.getTime();
|
|
@@ -1692,7 +1829,7 @@ function DatePicker(props) {
|
|
|
1692
1829
|
min <= hovered.min ? { min, max: hovered.min } : { min: hovered.max, max: min }
|
|
1693
1830
|
));
|
|
1694
1831
|
const blocked = blockedRanges.some((range) => dateIntersect(date, range));
|
|
1695
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx15(
|
|
1696
1833
|
"button",
|
|
1697
1834
|
__spreadProps(__spreadValues({
|
|
1698
1835
|
type: "button",
|
|
@@ -1728,7 +1865,7 @@ function DatePicker(props) {
|
|
|
1728
1865
|
}
|
|
1729
1866
|
)
|
|
1730
1867
|
] }, `${month}${year}`)),
|
|
1731
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ jsx15(
|
|
1732
1869
|
"div",
|
|
1733
1870
|
{
|
|
1734
1871
|
css: {
|
|
@@ -1746,7 +1883,7 @@ function DatePicker(props) {
|
|
|
1746
1883
|
}
|
|
1747
1884
|
|
|
1748
1885
|
// src/components/dateFilter.tsx
|
|
1749
|
-
import { jsx as
|
|
1886
|
+
import { jsx as jsx16 } from "@emotion/react/jsx-runtime";
|
|
1750
1887
|
function convertDate(x) {
|
|
1751
1888
|
if (x instanceof Date) return x;
|
|
1752
1889
|
if (typeof x === "number" || typeof x === "string") return new Date(x);
|
|
@@ -1776,7 +1913,8 @@ function DateFilter(_a) {
|
|
|
1776
1913
|
filterBy = convertDateOrArray,
|
|
1777
1914
|
minDate,
|
|
1778
1915
|
maxDate,
|
|
1779
|
-
showCalendarWeek
|
|
1916
|
+
showCalendarWeek,
|
|
1917
|
+
showTime
|
|
1780
1918
|
} = _b, props = __objRest(_b, [
|
|
1781
1919
|
"locale",
|
|
1782
1920
|
"firstDayOfWeek",
|
|
@@ -1786,7 +1924,8 @@ function DateFilter(_a) {
|
|
|
1786
1924
|
"filterBy",
|
|
1787
1925
|
"minDate",
|
|
1788
1926
|
"maxDate",
|
|
1789
|
-
"showCalendarWeek"
|
|
1927
|
+
"showCalendarWeek",
|
|
1928
|
+
"showTime"
|
|
1790
1929
|
]);
|
|
1791
1930
|
const { value = null, onChange } = useFilter(__spreadProps(__spreadValues({}, props), {
|
|
1792
1931
|
filterBy,
|
|
@@ -1798,14 +1937,14 @@ function DateFilter(_a) {
|
|
|
1798
1937
|
return dateIntersect(filterValue, value2);
|
|
1799
1938
|
}
|
|
1800
1939
|
}));
|
|
1801
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ jsx16(
|
|
1802
1941
|
"div",
|
|
1803
1942
|
{
|
|
1804
1943
|
css: {
|
|
1805
1944
|
padding: "calc(var(--spacing) * 2)",
|
|
1806
1945
|
display: "grid"
|
|
1807
1946
|
},
|
|
1808
|
-
children: /* @__PURE__ */
|
|
1947
|
+
children: /* @__PURE__ */ jsx16(
|
|
1809
1948
|
DatePicker,
|
|
1810
1949
|
{
|
|
1811
1950
|
rangeSelect: !singleSelect,
|
|
@@ -1817,7 +1956,8 @@ function DateFilter(_a) {
|
|
|
1817
1956
|
quickOptions,
|
|
1818
1957
|
minDate,
|
|
1819
1958
|
maxDate,
|
|
1820
|
-
showCalendarWeek
|
|
1959
|
+
showCalendarWeek,
|
|
1960
|
+
showTime
|
|
1821
1961
|
}
|
|
1822
1962
|
)
|
|
1823
1963
|
}
|
|
@@ -1825,8 +1965,8 @@ function DateFilter(_a) {
|
|
|
1825
1965
|
}
|
|
1826
1966
|
|
|
1827
1967
|
// src/components/numberField.tsx
|
|
1828
|
-
import { useState as
|
|
1829
|
-
import { jsx as
|
|
1968
|
+
import { useState as useState7 } from "react";
|
|
1969
|
+
import { jsx as jsx17 } from "@emotion/react/jsx-runtime";
|
|
1830
1970
|
var Pattern = /^-?\d*(?:[.,]\d*)?$/;
|
|
1831
1971
|
var printNumber = (value, locale) => {
|
|
1832
1972
|
if (value === null) {
|
|
@@ -1851,8 +1991,8 @@ function NumberField(_a) {
|
|
|
1851
1991
|
]);
|
|
1852
1992
|
const locale = useTheme((t) => t.locale);
|
|
1853
1993
|
const TextField2 = useTheme((t) => t.components.TextField);
|
|
1854
|
-
const [value = printNumber(commitedValue, locale), setValue] =
|
|
1855
|
-
return /* @__PURE__ */
|
|
1994
|
+
const [value = printNumber(commitedValue, locale), setValue] = useState7();
|
|
1995
|
+
return /* @__PURE__ */ jsx17(
|
|
1856
1996
|
TextField2,
|
|
1857
1997
|
__spreadProps(__spreadValues({
|
|
1858
1998
|
value,
|
|
@@ -1877,7 +2017,7 @@ function NumberField(_a) {
|
|
|
1877
2017
|
}
|
|
1878
2018
|
|
|
1879
2019
|
// src/components/rangeFilter.tsx
|
|
1880
|
-
import { jsx as
|
|
2020
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "@emotion/react/jsx-runtime";
|
|
1881
2021
|
function RangeFilter(_a) {
|
|
1882
2022
|
var _b = _a, {
|
|
1883
2023
|
min,
|
|
@@ -1931,7 +2071,7 @@ function RangeFilter(_a) {
|
|
|
1931
2071
|
return value2 !== null && value2 >= min2 && value2 <= max2;
|
|
1932
2072
|
}
|
|
1933
2073
|
}));
|
|
1934
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ jsx18(
|
|
1935
2075
|
"div",
|
|
1936
2076
|
{
|
|
1937
2077
|
css: {
|
|
@@ -1951,12 +2091,12 @@ function RangeFilter(_a) {
|
|
|
1951
2091
|
}
|
|
1952
2092
|
},
|
|
1953
2093
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ jsx18(
|
|
1955
2095
|
NumberField,
|
|
1956
2096
|
{
|
|
1957
2097
|
value: value == null ? void 0 : value[0],
|
|
1958
2098
|
onChange: (newMin) => onChange(normalize(newMin, value == null ? void 0 : value[1], "min", { min, max })),
|
|
1959
|
-
startIcon: /* @__PURE__ */
|
|
2099
|
+
startIcon: /* @__PURE__ */ jsx18("span", { css: { margin: "0 calc(var(--spacing) * 2)" }, children: rangeMinText }),
|
|
1960
2100
|
placeholder: String(minValue != null ? minValue : ""),
|
|
1961
2101
|
css: {
|
|
1962
2102
|
alignItems: "baseline"
|
|
@@ -1964,12 +2104,12 @@ function RangeFilter(_a) {
|
|
|
1964
2104
|
}
|
|
1965
2105
|
),
|
|
1966
2106
|
"-",
|
|
1967
|
-
/* @__PURE__ */
|
|
2107
|
+
/* @__PURE__ */ jsx18(
|
|
1968
2108
|
NumberField,
|
|
1969
2109
|
{
|
|
1970
2110
|
value: value == null ? void 0 : value[1],
|
|
1971
2111
|
onChange: (newMax) => onChange(normalize(value == null ? void 0 : value[0], newMax, "max", { min, max })),
|
|
1972
|
-
startIcon: /* @__PURE__ */
|
|
2112
|
+
startIcon: /* @__PURE__ */ jsx18("span", { css: { margin: "0 calc(var(--spacing) * 2)" }, children: rangeMaxText }),
|
|
1973
2113
|
placeholder: String(maxValue != null ? maxValue : ""),
|
|
1974
2114
|
css: {
|
|
1975
2115
|
alignItems: "baseline"
|
|
@@ -1999,10 +2139,10 @@ function clamp(value, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFI
|
|
|
1999
2139
|
}
|
|
2000
2140
|
|
|
2001
2141
|
// src/components/selectFilter.tsx
|
|
2002
|
-
import { useEffect as useEffect4, useMemo as
|
|
2142
|
+
import { useEffect as useEffect4, useMemo as useMemo8, useState as useState9 } from "react";
|
|
2003
2143
|
|
|
2004
2144
|
// src/components/formControlLabel.tsx
|
|
2005
|
-
import { jsx as
|
|
2145
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
|
|
2006
2146
|
function FormControlLabel({
|
|
2007
2147
|
control,
|
|
2008
2148
|
label,
|
|
@@ -2025,14 +2165,14 @@ function FormControlLabel({
|
|
|
2025
2165
|
],
|
|
2026
2166
|
children: [
|
|
2027
2167
|
control,
|
|
2028
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ jsx19("span", { css: { marginLeft: "var(--spacing)" }, children: label })
|
|
2029
2169
|
]
|
|
2030
2170
|
}
|
|
2031
2171
|
);
|
|
2032
2172
|
}
|
|
2033
2173
|
|
|
2034
2174
|
// src/components/virtualList.tsx
|
|
2035
|
-
import { useEffect as useEffect3, useMemo as
|
|
2175
|
+
import { useEffect as useEffect3, useMemo as useMemo7, useRef as useRef3, useState as useState8 } from "react";
|
|
2036
2176
|
|
|
2037
2177
|
// src/misc/throttle.ts
|
|
2038
2178
|
function throttle(function_, ms) {
|
|
@@ -2073,7 +2213,7 @@ function throttle(function_, ms) {
|
|
|
2073
2213
|
}
|
|
2074
2214
|
|
|
2075
2215
|
// src/components/virtualList.tsx
|
|
2076
|
-
import { jsx as
|
|
2216
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "@emotion/react/jsx-runtime";
|
|
2077
2217
|
function VirtualList(_a) {
|
|
2078
2218
|
var _b = _a, {
|
|
2079
2219
|
virtual = true,
|
|
@@ -2086,9 +2226,9 @@ function VirtualList(_a) {
|
|
|
2086
2226
|
]);
|
|
2087
2227
|
var _a2, _b2, _c, _d, _e;
|
|
2088
2228
|
const container = useRef3(null);
|
|
2089
|
-
const [, setId] =
|
|
2229
|
+
const [, setId] = useState8({});
|
|
2090
2230
|
const throttleScroll = (_b2 = (_a2 = typeof virtual === "boolean" ? void 0 : virtual) == null ? void 0 : _a2.throttleScroll) != null ? _b2 : 16;
|
|
2091
|
-
const update =
|
|
2231
|
+
const update = useMemo7(() => throttle(() => setId({}), throttleScroll), [throttleScroll]);
|
|
2092
2232
|
useEffect3(() => {
|
|
2093
2233
|
if (!virtual) return;
|
|
2094
2234
|
const ro = new ResizeObserver(update);
|
|
@@ -2103,7 +2243,7 @@ function VirtualList(_a) {
|
|
|
2103
2243
|
};
|
|
2104
2244
|
}, [update, virtual, throttleScroll]);
|
|
2105
2245
|
if (!virtual) {
|
|
2106
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ jsx20(
|
|
2107
2247
|
"div",
|
|
2108
2248
|
__spreadProps(__spreadValues({}, props), {
|
|
2109
2249
|
css: {
|
|
@@ -2148,9 +2288,9 @@ function VirtualList(_a) {
|
|
|
2148
2288
|
display: "grid"
|
|
2149
2289
|
},
|
|
2150
2290
|
children: [
|
|
2151
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ jsx20("div", { "data-virtual-before": true, style: { height: before } }),
|
|
2152
2292
|
items.slice(from, to).map((item, index) => children(item, index + from)),
|
|
2153
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ jsx20("div", { "data-virtual-after": true, style: { height: after } })
|
|
2154
2294
|
]
|
|
2155
2295
|
})
|
|
2156
2296
|
);
|
|
@@ -2164,7 +2304,7 @@ function averageItemHeight(container) {
|
|
|
2164
2304
|
}
|
|
2165
2305
|
|
|
2166
2306
|
// src/components/selectFilter.tsx
|
|
2167
|
-
import { jsx as
|
|
2307
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "@emotion/react/jsx-runtime";
|
|
2168
2308
|
function toggle(set, value, singleSelect) {
|
|
2169
2309
|
const newSet = new Set(singleSelect ? [] : set);
|
|
2170
2310
|
if (set.has(value)) {
|
|
@@ -2222,11 +2362,11 @@ function SelectFilter(_a) {
|
|
|
2222
2362
|
)
|
|
2223
2363
|
);
|
|
2224
2364
|
});
|
|
2225
|
-
const [query, setQuery] =
|
|
2365
|
+
const [query, setQuery] = useState9("");
|
|
2226
2366
|
const filtered = options.filter(
|
|
2227
2367
|
(option) => !query || stringValue(option).toLowerCase().includes(query.toLowerCase())
|
|
2228
2368
|
);
|
|
2229
|
-
const delayedValue =
|
|
2369
|
+
const delayedValue = useMemo8(() => value, [isActive]);
|
|
2230
2370
|
const ordered = filtered.filter((option) => delayedValue.has(option)).concat(filtered.filter((option) => !delayedValue.has(option)));
|
|
2231
2371
|
const Button2 = useTheme((t) => t.components.Button);
|
|
2232
2372
|
useEffect4(() => {
|
|
@@ -2242,16 +2382,16 @@ function SelectFilter(_a) {
|
|
|
2242
2382
|
gap: "var(--spacing)"
|
|
2243
2383
|
},
|
|
2244
2384
|
children: [
|
|
2245
|
-
!hideSearchField && /* @__PURE__ */
|
|
2385
|
+
!hideSearchField && /* @__PURE__ */ jsx21(
|
|
2246
2386
|
AutoFocusTextField,
|
|
2247
2387
|
{
|
|
2248
2388
|
value: query,
|
|
2249
2389
|
onChange: (event) => setQuery(event.target.value),
|
|
2250
|
-
endIcon: /* @__PURE__ */
|
|
2390
|
+
endIcon: /* @__PURE__ */ jsx21(IconButton2, { onClick: () => setQuery(""), children: !query ? /* @__PURE__ */ jsx21(Search2, {}) : /* @__PURE__ */ jsx21(Clear2, {}) }),
|
|
2251
2391
|
css: { marginBottom: "var(--spacing)" }
|
|
2252
2392
|
}
|
|
2253
2393
|
),
|
|
2254
|
-
!hideResetButton && /* @__PURE__ */
|
|
2394
|
+
!hideResetButton && /* @__PURE__ */ jsx21(
|
|
2255
2395
|
Button2,
|
|
2256
2396
|
{
|
|
2257
2397
|
disabled: value.size === 0,
|
|
@@ -2266,7 +2406,7 @@ function SelectFilter(_a) {
|
|
|
2266
2406
|
children: deselectAll
|
|
2267
2407
|
}
|
|
2268
2408
|
),
|
|
2269
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx21(
|
|
2270
2410
|
VirtualList,
|
|
2271
2411
|
{
|
|
2272
2412
|
items: ordered,
|
|
@@ -2278,10 +2418,10 @@ function SelectFilter(_a) {
|
|
|
2278
2418
|
display: "grid",
|
|
2279
2419
|
gridTemplateColumns: "minmax(0, 1fr)"
|
|
2280
2420
|
},
|
|
2281
|
-
children: (option, index) => /* @__PURE__ */
|
|
2421
|
+
children: (option, index) => /* @__PURE__ */ jsx21(
|
|
2282
2422
|
FormControlLabel,
|
|
2283
2423
|
{
|
|
2284
|
-
control: /* @__PURE__ */
|
|
2424
|
+
control: /* @__PURE__ */ jsx21(
|
|
2285
2425
|
Checkbox2,
|
|
2286
2426
|
{
|
|
2287
2427
|
checked: value.has(option),
|
|
@@ -2294,17 +2434,17 @@ function SelectFilter(_a) {
|
|
|
2294
2434
|
)
|
|
2295
2435
|
}
|
|
2296
2436
|
),
|
|
2297
|
-
ordered.length === 0 && /* @__PURE__ */
|
|
2437
|
+
ordered.length === 0 && /* @__PURE__ */ jsx21("span", { css: { textAlign: "center" }, children: noResults })
|
|
2298
2438
|
]
|
|
2299
2439
|
}
|
|
2300
2440
|
);
|
|
2301
2441
|
}
|
|
2302
2442
|
|
|
2303
2443
|
// src/components/table.tsx
|
|
2304
|
-
import { memo as memo3, useEffect as useEffect15, useLayoutEffect as useLayoutEffect6, useState as
|
|
2444
|
+
import { memo as memo3, useEffect as useEffect15, useLayoutEffect as useLayoutEffect6, useState as useState15 } from "react";
|
|
2305
2445
|
|
|
2306
2446
|
// src/internalState/tableStateStorage.ts
|
|
2307
|
-
import { useEffect as useEffect5, useState as
|
|
2447
|
+
import { useEffect as useEffect5, useState as useState10 } from "react";
|
|
2308
2448
|
|
|
2309
2449
|
// src/misc/queue.ts
|
|
2310
2450
|
var Queue = class {
|
|
@@ -2388,8 +2528,8 @@ function parse(value) {
|
|
|
2388
2528
|
});
|
|
2389
2529
|
}
|
|
2390
2530
|
function useTableStateStorage(table) {
|
|
2391
|
-
const [isHydrated, setIsHydrated] =
|
|
2392
|
-
const [q] =
|
|
2531
|
+
const [isHydrated, setIsHydrated] = useState10(false);
|
|
2532
|
+
const [q] = useState10(() => new Queue());
|
|
2393
2533
|
useEffect5(() => {
|
|
2394
2534
|
const { persist } = table.getState().props;
|
|
2395
2535
|
if (!persist) {
|
|
@@ -2511,7 +2651,7 @@ function useTableStateStorage(table) {
|
|
|
2511
2651
|
|
|
2512
2652
|
// src/internalState/useTableState.ts
|
|
2513
2653
|
import { castDraft as castDraft4 } from "immer";
|
|
2514
|
-
import { useEffect as useEffect12, useMemo as
|
|
2654
|
+
import { useEffect as useEffect12, useMemo as useMemo10, useState as useState11 } from "react";
|
|
2515
2655
|
|
|
2516
2656
|
// src/internalState/calcItems.ts
|
|
2517
2657
|
import { castDraft as castDraft2 } from "immer";
|
|
@@ -2636,7 +2776,7 @@ function calcItems(state) {
|
|
|
2636
2776
|
}
|
|
2637
2777
|
|
|
2638
2778
|
// src/internalState/calcProps.ts
|
|
2639
|
-
import { useMemo as
|
|
2779
|
+
import { useMemo as useMemo9 } from "react";
|
|
2640
2780
|
|
|
2641
2781
|
// src/exporters/serializer.ts
|
|
2642
2782
|
function defaultSerializer(x) {
|
|
@@ -2685,7 +2825,7 @@ var defaultProps = {
|
|
|
2685
2825
|
};
|
|
2686
2826
|
function calcProps(props) {
|
|
2687
2827
|
const cache = useTableMemo();
|
|
2688
|
-
return
|
|
2828
|
+
return useMemo9(
|
|
2689
2829
|
() => overrides(defaultProps, calc(props, cache)),
|
|
2690
2830
|
[props]
|
|
2691
2831
|
);
|
|
@@ -3007,7 +3147,7 @@ function watchDisplaySize(state) {
|
|
|
3007
3147
|
|
|
3008
3148
|
// src/internalState/useTableState.ts
|
|
3009
3149
|
function useTableState(_props) {
|
|
3010
|
-
const [key, setKey] =
|
|
3150
|
+
const [key, setKey] = useState11({});
|
|
3011
3151
|
const props = calcProps(_props);
|
|
3012
3152
|
function reset() {
|
|
3013
3153
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -3026,7 +3166,7 @@ function useTableState(_props) {
|
|
|
3026
3166
|
}
|
|
3027
3167
|
(_i = props.onReset) == null ? void 0 : _i.call(props, "table");
|
|
3028
3168
|
}
|
|
3029
|
-
const state =
|
|
3169
|
+
const state = useMemo10(
|
|
3030
3170
|
() => {
|
|
3031
3171
|
var _a, _b, _c, _d;
|
|
3032
3172
|
return new Store({
|
|
@@ -3081,12 +3221,12 @@ function useTableState(_props) {
|
|
|
3081
3221
|
}
|
|
3082
3222
|
|
|
3083
3223
|
// src/components/clearFiltersButton.tsx
|
|
3084
|
-
import { jsx as
|
|
3224
|
+
import { jsx as jsx22 } from "@emotion/react/jsx-runtime";
|
|
3085
3225
|
function ClearFiltersButton() {
|
|
3086
3226
|
const Button2 = useTheme((t) => t.components.Button);
|
|
3087
3227
|
const textClearFilters = useTheme((t) => t.text.clearFilters);
|
|
3088
3228
|
const table = useTableContext();
|
|
3089
|
-
return /* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsx22("div", { css: defaultClasses.clearFiltersButton, children: /* @__PURE__ */ jsx22(
|
|
3090
3230
|
Button2,
|
|
3091
3231
|
{
|
|
3092
3232
|
variant: "outlined",
|
|
@@ -3105,7 +3245,7 @@ function ClearFiltersButton() {
|
|
|
3105
3245
|
}
|
|
3106
3246
|
|
|
3107
3247
|
// src/components/columnFooter.tsx
|
|
3108
|
-
import { jsx as
|
|
3248
|
+
import { jsx as jsx23 } from "@emotion/react/jsx-runtime";
|
|
3109
3249
|
function ColumnFooter() {
|
|
3110
3250
|
const table = useTableContext();
|
|
3111
3251
|
const columnId = useColumnContext();
|
|
@@ -3137,7 +3277,7 @@ function ColumnFooter() {
|
|
|
3137
3277
|
const column = state.activeColumns.find((column2) => column2.id === columnId);
|
|
3138
3278
|
return column == null ? void 0 : column.footer;
|
|
3139
3279
|
});
|
|
3140
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ jsx23(
|
|
3141
3281
|
"div",
|
|
3142
3282
|
{
|
|
3143
3283
|
className: cx(classes, columnClasses),
|
|
@@ -3159,7 +3299,7 @@ import { castDraft as castDraft5 } from "immer";
|
|
|
3159
3299
|
import { useEffect as useEffect13, useRef as useRef4 } from "react";
|
|
3160
3300
|
|
|
3161
3301
|
// src/components/resizeHandle.tsx
|
|
3162
|
-
import { jsx as
|
|
3302
|
+
import { jsx as jsx24 } from "@emotion/react/jsx-runtime";
|
|
3163
3303
|
function ResizeHandle() {
|
|
3164
3304
|
const table = useTableContext();
|
|
3165
3305
|
const columnId = useColumnContext();
|
|
@@ -3196,7 +3336,7 @@ function ResizeHandle() {
|
|
|
3196
3336
|
if (!enabled) {
|
|
3197
3337
|
return null;
|
|
3198
3338
|
}
|
|
3199
|
-
return /* @__PURE__ */
|
|
3339
|
+
return /* @__PURE__ */ jsx24(
|
|
3200
3340
|
ResizeHandleView,
|
|
3201
3341
|
{
|
|
3202
3342
|
enabled,
|
|
@@ -3213,7 +3353,7 @@ function ResizeHandleView(_a) {
|
|
|
3213
3353
|
} = _b, props = __objRest(_b, [
|
|
3214
3354
|
"enabled"
|
|
3215
3355
|
]);
|
|
3216
|
-
const
|
|
3356
|
+
const className3 = useTheme((theme) => {
|
|
3217
3357
|
var _a2;
|
|
3218
3358
|
return (_a2 = theme.classes) == null ? void 0 : _a2.columnDivider;
|
|
3219
3359
|
});
|
|
@@ -3221,10 +3361,10 @@ function ResizeHandleView(_a) {
|
|
|
3221
3361
|
var _a2;
|
|
3222
3362
|
return (_a2 = theme.styles) == null ? void 0 : _a2.columnDivider;
|
|
3223
3363
|
});
|
|
3224
|
-
return /* @__PURE__ */
|
|
3364
|
+
return /* @__PURE__ */ jsx24(
|
|
3225
3365
|
"div",
|
|
3226
3366
|
__spreadValues({
|
|
3227
|
-
className:
|
|
3367
|
+
className: className3,
|
|
3228
3368
|
css: [
|
|
3229
3369
|
{
|
|
3230
3370
|
alignSelf: "stretch",
|
|
@@ -3250,7 +3390,7 @@ function ResizeHandleView(_a) {
|
|
|
3250
3390
|
}
|
|
3251
3391
|
|
|
3252
3392
|
// src/components/sortComponent.tsx
|
|
3253
|
-
import { jsx as
|
|
3393
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
|
|
3254
3394
|
function SortComponent({ children }) {
|
|
3255
3395
|
const table = useTableContext();
|
|
3256
3396
|
const columnId = useColumnContext();
|
|
@@ -3307,8 +3447,8 @@ function SortComponent({ children }) {
|
|
|
3307
3447
|
onClick: (event) => toggle2(event),
|
|
3308
3448
|
onContextMenu: (event) => toggle2(event, true),
|
|
3309
3449
|
children: [
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx25("div", { children }),
|
|
3451
|
+
/* @__PURE__ */ jsx25(Badge2, { badgeContent: sortDisabled ? 0 : index, children: /* @__PURE__ */ jsx25(
|
|
3312
3452
|
"span",
|
|
3313
3453
|
{
|
|
3314
3454
|
css: [
|
|
@@ -3316,7 +3456,7 @@ function SortComponent({ children }) {
|
|
|
3316
3456
|
!direction && { opacity: 0 },
|
|
3317
3457
|
direction === "desc" && { transform: "rotate3d(0, 0, 1, 180deg)" }
|
|
3318
3458
|
],
|
|
3319
|
-
children: /* @__PURE__ */
|
|
3459
|
+
children: /* @__PURE__ */ jsx25(ArrowUpward2, {})
|
|
3320
3460
|
}
|
|
3321
3461
|
) })
|
|
3322
3462
|
]
|
|
@@ -3325,7 +3465,7 @@ function SortComponent({ children }) {
|
|
|
3325
3465
|
}
|
|
3326
3466
|
|
|
3327
3467
|
// src/components/columnHeader.tsx
|
|
3328
|
-
import { jsx as
|
|
3468
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "@emotion/react/jsx-runtime";
|
|
3329
3469
|
var ColumnHeaderContext = new StoreScope({
|
|
3330
3470
|
items: /* @__PURE__ */ new Map()
|
|
3331
3471
|
});
|
|
@@ -3488,18 +3628,18 @@ function ColumnHeader() {
|
|
|
3488
3628
|
onPointerMove: enabled ? onPointerMove : void 0,
|
|
3489
3629
|
onPointerUp: enabled ? onPointerUp : void 0,
|
|
3490
3630
|
children: [
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
/* @__PURE__ */
|
|
3493
|
-
/* @__PURE__ */
|
|
3494
|
-
/* @__PURE__ */
|
|
3631
|
+
/* @__PURE__ */ jsx26(SortComponent, { children: header }),
|
|
3632
|
+
/* @__PURE__ */ jsx26("div", { css: { flex: 1 } }),
|
|
3633
|
+
/* @__PURE__ */ jsx26(FilterControl, {}),
|
|
3634
|
+
/* @__PURE__ */ jsx26(ResizeHandle, {})
|
|
3495
3635
|
]
|
|
3496
3636
|
}
|
|
3497
3637
|
);
|
|
3498
3638
|
}
|
|
3499
3639
|
|
|
3500
3640
|
// src/components/columnSelection.tsx
|
|
3501
|
-
import { useContext as useContext7, useState as
|
|
3502
|
-
import { Fragment as
|
|
3641
|
+
import { useContext as useContext7, useState as useState12 } from "react";
|
|
3642
|
+
import { Fragment as Fragment6, jsx as jsx27, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
3503
3643
|
function ColumnSelection() {
|
|
3504
3644
|
const IconButton2 = useTheme((t) => t.components.IconButton);
|
|
3505
3645
|
const Popover2 = useTheme((t) => t.components.Popover);
|
|
@@ -3516,7 +3656,7 @@ function ColumnSelection() {
|
|
|
3516
3656
|
const reset = useContext7(TableResetContext);
|
|
3517
3657
|
const columns = table.useState((state) => state.props.columns);
|
|
3518
3658
|
const hiddenColumns = table.useState((state) => state.hiddenColumns);
|
|
3519
|
-
const [anchorElement, setAnchorElement] =
|
|
3659
|
+
const [anchorElement, setAnchorElement] = useState12(null);
|
|
3520
3660
|
const toggle2 = (column, state) => {
|
|
3521
3661
|
const {
|
|
3522
3662
|
props: { hiddenColumns: controlledHiddenColumns, onHiddenColumnsChange }
|
|
@@ -3537,9 +3677,9 @@ function ColumnSelection() {
|
|
|
3537
3677
|
onHiddenColumnsChange == null ? void 0 : onHiddenColumnsChange(newValue);
|
|
3538
3678
|
};
|
|
3539
3679
|
const allVisible = columns.every((column) => !hiddenColumns.has(column.id));
|
|
3540
|
-
return /* @__PURE__ */ jsxs15(
|
|
3541
|
-
/* @__PURE__ */
|
|
3542
|
-
/* @__PURE__ */
|
|
3680
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
3681
|
+
/* @__PURE__ */ jsx27(IconButton2, { onClick: (event) => setAnchorElement(anchorElement ? null : event.currentTarget), children: /* @__PURE__ */ jsx27(Settings2, {}) }),
|
|
3682
|
+
/* @__PURE__ */ jsx27(
|
|
3543
3683
|
Popover2,
|
|
3544
3684
|
{
|
|
3545
3685
|
anchorEl: anchorElement,
|
|
@@ -3549,17 +3689,17 @@ function ColumnSelection() {
|
|
|
3549
3689
|
className: classes == null ? void 0 : classes.popover,
|
|
3550
3690
|
backdropClassName: classes == null ? void 0 : classes.popoverBackdrop,
|
|
3551
3691
|
children: /* @__PURE__ */ jsxs15("div", { css: { padding: `calc(var(--spacing) * 2)`, display: "grid" }, children: [
|
|
3552
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsx27("div", { css: { marginBottom: "var(--spacing)" }, children: selectColumns }),
|
|
3553
3693
|
/* @__PURE__ */ jsxs15("div", { css: { margin: "0.5em 0", display: "flex", gap: "0.5em" }, children: [
|
|
3554
|
-
/* @__PURE__ */
|
|
3555
|
-
/* @__PURE__ */
|
|
3694
|
+
/* @__PURE__ */ jsx27(Button2, { variant: "outlined", onClick: () => toggle2(void 0, !allVisible), children: allVisible ? hideAll : showAll }),
|
|
3695
|
+
/* @__PURE__ */ jsx27(Button2, { variant: "outlined", onClick: reset, children: resetAll })
|
|
3556
3696
|
] }),
|
|
3557
3697
|
columns.map((column) => {
|
|
3558
3698
|
var _a;
|
|
3559
|
-
return /* @__PURE__ */
|
|
3699
|
+
return /* @__PURE__ */ jsx27(
|
|
3560
3700
|
FormControlLabel,
|
|
3561
3701
|
{
|
|
3562
|
-
control: /* @__PURE__ */
|
|
3702
|
+
control: /* @__PURE__ */ jsx27(
|
|
3563
3703
|
Checkbox2,
|
|
3564
3704
|
{
|
|
3565
3705
|
checked: !((_a = column.hidden) != null ? _a : hiddenColumns.has(column.id)),
|
|
@@ -3579,8 +3719,8 @@ function ColumnSelection() {
|
|
|
3579
3719
|
}
|
|
3580
3720
|
|
|
3581
3721
|
// src/components/export.tsx
|
|
3582
|
-
import { useContext as useContext8, useState as
|
|
3583
|
-
import { Fragment as
|
|
3722
|
+
import { useContext as useContext8, useState as useState13 } from "react";
|
|
3723
|
+
import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs16 } from "@emotion/react/jsx-runtime";
|
|
3584
3724
|
function Export2() {
|
|
3585
3725
|
const { exporters: contextExporters } = useContext8(TableSettingsContext);
|
|
3586
3726
|
const table = useTableContext();
|
|
@@ -3603,7 +3743,7 @@ function Export2() {
|
|
|
3603
3743
|
}
|
|
3604
3744
|
return state.props.enableExport;
|
|
3605
3745
|
});
|
|
3606
|
-
const [anchor, setAnchor] =
|
|
3746
|
+
const [anchor, setAnchor] = useState13(null);
|
|
3607
3747
|
function execute({ action, exporter }) {
|
|
3608
3748
|
const { activeColumns, activeItems, items } = table.getState();
|
|
3609
3749
|
const columns = activeColumns.map((column) => column.exportHeader);
|
|
@@ -3625,9 +3765,9 @@ function Export2() {
|
|
|
3625
3765
|
URL.revokeObjectURL(url);
|
|
3626
3766
|
}
|
|
3627
3767
|
}
|
|
3628
|
-
return /* @__PURE__ */ jsxs16(
|
|
3629
|
-
/* @__PURE__ */
|
|
3630
|
-
/* @__PURE__ */
|
|
3768
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
3769
|
+
/* @__PURE__ */ jsx28(IconButton2, { onClick: (event) => setAnchor(anchor ? null : event.currentTarget), children: /* @__PURE__ */ jsx28(ExportIcon, { css: !!anchor && { color: "var(--primaryMain)" } }) }),
|
|
3770
|
+
/* @__PURE__ */ jsx28(
|
|
3631
3771
|
Popover2,
|
|
3632
3772
|
{
|
|
3633
3773
|
open: !!anchor,
|
|
@@ -3649,11 +3789,11 @@ function Export2() {
|
|
|
3649
3789
|
}
|
|
3650
3790
|
},
|
|
3651
3791
|
children: [
|
|
3652
|
-
/* @__PURE__ */
|
|
3792
|
+
/* @__PURE__ */ jsx28("div", { css: { marginBottom: "var(--spacing)" }, children: exportTitle }),
|
|
3653
3793
|
exporters.map((entry, index) => /* @__PURE__ */ jsxs16(
|
|
3654
3794
|
Button2,
|
|
3655
3795
|
{
|
|
3656
|
-
startIcon: entry.action === "copy" ? /* @__PURE__ */
|
|
3796
|
+
startIcon: entry.action === "copy" ? /* @__PURE__ */ jsx28(Clipboard2, {}) : /* @__PURE__ */ jsx28(ExportIcon, {}),
|
|
3657
3797
|
onClick: () => execute(entry),
|
|
3658
3798
|
children: [
|
|
3659
3799
|
entry.action === "copy" ? exportCopy : exportDownload,
|
|
@@ -3694,10 +3834,10 @@ function calcCss(styles, item, index) {
|
|
|
3694
3834
|
|
|
3695
3835
|
// src/components/cell.tsx
|
|
3696
3836
|
import { memo, useLayoutEffect as useLayoutEffect3 } from "react";
|
|
3697
|
-
import { jsx as
|
|
3837
|
+
import { jsx as jsx29 } from "@emotion/react/jsx-runtime";
|
|
3698
3838
|
var defaultWrapCell = (content) => {
|
|
3699
3839
|
if (typeof content === "string") {
|
|
3700
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ jsx29("span", { css: defaultClasses.text, title: content, children: content });
|
|
3701
3841
|
}
|
|
3702
3842
|
return content;
|
|
3703
3843
|
};
|
|
@@ -3721,21 +3861,21 @@ var Cell = memo(function Cell2({ itemId, rowIndex }) {
|
|
|
3721
3861
|
var _a2, _b;
|
|
3722
3862
|
return (_b = (_a2 = table.getState().props).debugRender) == null ? void 0 : _b.call(_a2, "render cell", itemId, columnId);
|
|
3723
3863
|
});
|
|
3724
|
-
const
|
|
3864
|
+
const className3 = useTheme((t) => cx(...calcClassNames(t.classes, item == null ? void 0 : item.value, rowIndex)));
|
|
3725
3865
|
const styles = useTheme((t) => calcCss(t.styles, item == null ? void 0 : item.value, rowIndex));
|
|
3726
3866
|
if (!column || !item) return null;
|
|
3727
3867
|
const content = column.renderCell(column.value(item.value), item.value);
|
|
3728
|
-
return /* @__PURE__ */
|
|
3868
|
+
return /* @__PURE__ */ jsx29("div", { className: className3, css: [defaultClasses.cell, styles], style: columnStyleOverride, children: wrapCell(content, column.value(item.value), item.value, rowIndex) });
|
|
3729
3869
|
});
|
|
3730
3870
|
|
|
3731
3871
|
// src/components/details.tsx
|
|
3732
3872
|
import { forwardRef } from "react";
|
|
3733
|
-
import { jsx as
|
|
3873
|
+
import { jsx as jsx30 } from "@emotion/react/jsx-runtime";
|
|
3734
3874
|
var Details = forwardRef(function Details2({ itemId, rowIndex }, ref) {
|
|
3735
3875
|
const table = useTableContext();
|
|
3736
3876
|
const classes = useTheme((t) => t.classes);
|
|
3737
3877
|
const styles = useTheme((t) => t.styles);
|
|
3738
|
-
const { details, className:
|
|
3878
|
+
const { details, className: className3, css: css3 } = table.useState((state) => {
|
|
3739
3879
|
const item = state.activeItemsById.get(itemId);
|
|
3740
3880
|
return {
|
|
3741
3881
|
details: state.expanded.has(itemId) ? state.props.rowDetails instanceof Function ? item ? state.props.rowDetails(item.value, rowIndex) : null : state.props.rowDetails : void 0,
|
|
@@ -3743,11 +3883,11 @@ var Details = forwardRef(function Details2({ itemId, rowIndex }, ref) {
|
|
|
3743
3883
|
css: (styles == null ? void 0 : styles.details) instanceof Function ? styles.details(item == null ? void 0 : item.value, rowIndex) : styles == null ? void 0 : styles.details
|
|
3744
3884
|
};
|
|
3745
3885
|
});
|
|
3746
|
-
return details ? /* @__PURE__ */
|
|
3886
|
+
return details ? /* @__PURE__ */ jsx30("div", { ref, className: className3, css: [defaultClasses.details, css3], children: details }) : null;
|
|
3747
3887
|
});
|
|
3748
3888
|
|
|
3749
3889
|
// src/components/expandControl.tsx
|
|
3750
|
-
import { jsx as
|
|
3890
|
+
import { jsx as jsx31 } from "@emotion/react/jsx-runtime";
|
|
3751
3891
|
function ExpandControl({
|
|
3752
3892
|
itemId,
|
|
3753
3893
|
hasDeferredChildren
|
|
@@ -3794,9 +3934,9 @@ function ExpandControl({
|
|
|
3794
3934
|
}
|
|
3795
3935
|
}
|
|
3796
3936
|
if (isExpanded && hasDeferredChildren && !hasChildren) {
|
|
3797
|
-
return /* @__PURE__ */
|
|
3937
|
+
return /* @__PURE__ */ jsx31(Spinner2, { css: { margin: "0 var(--spacing)" } });
|
|
3798
3938
|
}
|
|
3799
|
-
return /* @__PURE__ */
|
|
3939
|
+
return /* @__PURE__ */ jsx31(IconButton2, { onClick: toggle2, children: /* @__PURE__ */ jsx31(
|
|
3800
3940
|
"span",
|
|
3801
3941
|
{
|
|
3802
3942
|
css: {
|
|
@@ -3804,13 +3944,13 @@ function ExpandControl({
|
|
|
3804
3944
|
transition: "all 300ms",
|
|
3805
3945
|
transform: isExpanded ? "rotate3d(0, 0, 1, 90deg)" : "rotate3d(0, 0, 1, 0deg)"
|
|
3806
3946
|
},
|
|
3807
|
-
children: /* @__PURE__ */
|
|
3947
|
+
children: /* @__PURE__ */ jsx31(ChevronRight2, {})
|
|
3808
3948
|
}
|
|
3809
3949
|
) });
|
|
3810
3950
|
}
|
|
3811
3951
|
|
|
3812
3952
|
// src/components/selectComponent.tsx
|
|
3813
|
-
import { jsx as
|
|
3953
|
+
import { jsx as jsx32 } from "@emotion/react/jsx-runtime";
|
|
3814
3954
|
function SelectComponent({ itemId }) {
|
|
3815
3955
|
const table = useTableContext();
|
|
3816
3956
|
const Checkbox2 = useTheme((t) => t.components.Checkbox);
|
|
@@ -3859,7 +3999,7 @@ function SelectComponent({ itemId }) {
|
|
|
3859
3999
|
state.lastSelectedId = itemId;
|
|
3860
4000
|
});
|
|
3861
4001
|
}
|
|
3862
|
-
return /* @__PURE__ */
|
|
4002
|
+
return /* @__PURE__ */ jsx32(
|
|
3863
4003
|
Checkbox2,
|
|
3864
4004
|
{
|
|
3865
4005
|
css: {
|
|
@@ -3873,7 +4013,7 @@ function SelectComponent({ itemId }) {
|
|
|
3873
4013
|
}
|
|
3874
4014
|
|
|
3875
4015
|
// src/components/row.tsx
|
|
3876
|
-
import { Fragment as
|
|
4016
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs17 } from "@emotion/react/jsx-runtime";
|
|
3877
4017
|
var Row = memo2(function Row2({
|
|
3878
4018
|
itemId,
|
|
3879
4019
|
rowIndex
|
|
@@ -3885,7 +4025,7 @@ var Row = memo2(function Row2({
|
|
|
3885
4025
|
const classes = useTheme((t) => t.classes);
|
|
3886
4026
|
const styles = useTheme((t) => t.styles);
|
|
3887
4027
|
const item = table.useState((state) => state.activeItemsById.get(itemId));
|
|
3888
|
-
const wrapRow = (_a = table.useState((state) => state.props.wrapRow)) != null ? _a : (props) => /* @__PURE__ */
|
|
4028
|
+
const wrapRow = (_a = table.useState((state) => state.props.wrapRow)) != null ? _a : (props) => /* @__PURE__ */ jsx33("div", __spreadValues({}, props));
|
|
3889
4029
|
const rowClassName = (classes == null ? void 0 : classes.row) instanceof Function ? classes.row(item == null ? void 0 : item.value, rowIndex) : classes == null ? void 0 : classes.row;
|
|
3890
4030
|
const rowStyles = (styles == null ? void 0 : styles.row) instanceof Function ? styles.row(item == null ? void 0 : item.value, rowIndex) : styles == null ? void 0 : styles.row;
|
|
3891
4031
|
const subgrid = table.useState((state) => state.props.subgrid);
|
|
@@ -3942,7 +4082,7 @@ var Row = memo2(function Row2({
|
|
|
3942
4082
|
if (!item) {
|
|
3943
4083
|
return null;
|
|
3944
4084
|
}
|
|
3945
|
-
return /* @__PURE__ */
|
|
4085
|
+
return /* @__PURE__ */ jsx33(ClassNames2, { children: ({ css: css3 }) => /* @__PURE__ */ jsx33(Fragment8, { children: wrapRow(
|
|
3946
4086
|
{
|
|
3947
4087
|
className: css3([
|
|
3948
4088
|
subgrid ? {
|
|
@@ -3955,8 +4095,8 @@ var Row = memo2(function Row2({
|
|
|
3955
4095
|
rowClassName,
|
|
3956
4096
|
rowStyles
|
|
3957
4097
|
]),
|
|
3958
|
-
children: /* @__PURE__ */ jsxs17(
|
|
3959
|
-
/* @__PURE__ */
|
|
4098
|
+
children: /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
4099
|
+
/* @__PURE__ */ jsx33(
|
|
3960
4100
|
"div",
|
|
3961
4101
|
{
|
|
3962
4102
|
className: cellClassName,
|
|
@@ -3970,16 +4110,16 @@ var Row = memo2(function Row2({
|
|
|
3970
4110
|
className: cellClassName,
|
|
3971
4111
|
css: [defaultClasses.cell, defaultClasses.firstCell, css_],
|
|
3972
4112
|
children: [
|
|
3973
|
-
indent > 0 && /* @__PURE__ */
|
|
3974
|
-
enableSelection && /* @__PURE__ */
|
|
3975
|
-
(hasChildren || hasDeferredChildren || hasDetails) && /* @__PURE__ */
|
|
4113
|
+
indent > 0 && /* @__PURE__ */ jsx33("div", { css: { width: indent * 20 } }),
|
|
4114
|
+
enableSelection && /* @__PURE__ */ jsx33(SelectComponent, { itemId }),
|
|
4115
|
+
(hasChildren || hasDeferredChildren || hasDetails) && /* @__PURE__ */ jsx33(ExpandControl, { itemId, hasDeferredChildren }),
|
|
3976
4116
|
rowAction
|
|
3977
4117
|
]
|
|
3978
4118
|
}
|
|
3979
4119
|
),
|
|
3980
|
-
columnIds.map((columnId) => /* @__PURE__ */
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
/* @__PURE__ */
|
|
4120
|
+
columnIds.map((columnId) => /* @__PURE__ */ jsx33(ColumnContext.Provider, { value: columnId, children: /* @__PURE__ */ jsx33(Cell, { itemId, rowIndex }) }, columnId)),
|
|
4121
|
+
/* @__PURE__ */ jsx33("div", { className: cellClassName, css: [defaultClasses.cellFill, css_] }),
|
|
4122
|
+
/* @__PURE__ */ jsx33(Details, { ref: detailsDivRef, itemId, rowIndex })
|
|
3983
4123
|
] })
|
|
3984
4124
|
},
|
|
3985
4125
|
item.value,
|
|
@@ -3988,8 +4128,8 @@ var Row = memo2(function Row2({
|
|
|
3988
4128
|
});
|
|
3989
4129
|
|
|
3990
4130
|
// src/components/virtualized.tsx
|
|
3991
|
-
import { useEffect as useEffect14, useLayoutEffect as useLayoutEffect5, useMemo as
|
|
3992
|
-
import { jsx as
|
|
4131
|
+
import { useEffect as useEffect14, useLayoutEffect as useLayoutEffect5, useMemo as useMemo11, useRef as useRef6, useState as useState14 } from "react";
|
|
4132
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "@emotion/react/jsx-runtime";
|
|
3993
4133
|
var findScrollRoot = (x) => {
|
|
3994
4134
|
const parent = x.parentElement;
|
|
3995
4135
|
if (!parent) return document.documentElement;
|
|
@@ -4016,7 +4156,7 @@ function Virtualized(_a) {
|
|
|
4016
4156
|
const table = useTableContext();
|
|
4017
4157
|
const virtual = table.useState((state) => state.props.virtual);
|
|
4018
4158
|
const probeRef = useRef6(null);
|
|
4019
|
-
const [, setId] =
|
|
4159
|
+
const [, setId] = useState14({});
|
|
4020
4160
|
const {
|
|
4021
4161
|
itemIds = [],
|
|
4022
4162
|
from = 0,
|
|
@@ -4068,7 +4208,7 @@ function Virtualized(_a) {
|
|
|
4068
4208
|
{ throttle: 16 }
|
|
4069
4209
|
);
|
|
4070
4210
|
const throttleScroll = (_b2 = (_a2 = typeof virtual === "boolean" ? void 0 : virtual) == null ? void 0 : _a2.throttleScroll) != null ? _b2 : 16;
|
|
4071
|
-
const update =
|
|
4211
|
+
const update = useMemo11(() => throttle(() => setId({}), throttleScroll), [throttleScroll]);
|
|
4072
4212
|
useEffect14(() => {
|
|
4073
4213
|
var _a3;
|
|
4074
4214
|
const tableElem = (_a3 = probeRef.current) == null ? void 0 : _a3.parentElement;
|
|
@@ -4104,15 +4244,15 @@ function Virtualized(_a) {
|
|
|
4104
4244
|
);
|
|
4105
4245
|
return /* @__PURE__ */ jsxs18("div", __spreadProps(__spreadValues({}, props), { children: [
|
|
4106
4246
|
header,
|
|
4107
|
-
virtual && /* @__PURE__ */
|
|
4247
|
+
virtual && /* @__PURE__ */ jsx34("div", { style: { gridColumn: "1 / -1", height: before }, ref: probeRef }),
|
|
4108
4248
|
children(itemIds, from),
|
|
4109
|
-
virtual && /* @__PURE__ */
|
|
4249
|
+
virtual && /* @__PURE__ */ jsx34("div", { style: { gridColumn: "1 / -1", height: after } }),
|
|
4110
4250
|
footer
|
|
4111
4251
|
] }));
|
|
4112
4252
|
}
|
|
4113
4253
|
|
|
4114
4254
|
// src/components/table.tsx
|
|
4115
|
-
import { Fragment as
|
|
4255
|
+
import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
|
|
4116
4256
|
function Table(props) {
|
|
4117
4257
|
const [table, resetState] = useTableState(props);
|
|
4118
4258
|
const [isHydrated, clearStorage] = useTableStateStorage(table);
|
|
@@ -4126,18 +4266,18 @@ function Table(props) {
|
|
|
4126
4266
|
var _a, _b;
|
|
4127
4267
|
return (_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table");
|
|
4128
4268
|
});
|
|
4129
|
-
return /* @__PURE__ */
|
|
4269
|
+
return /* @__PURE__ */ jsx35(TableContext.Provider, { value: table, children: /* @__PURE__ */ jsx35(TableResetContext.Provider, { value: reset, children: /* @__PURE__ */ jsx35(TableMemoContextProvider, { children: /* @__PURE__ */ jsx35(TableLoadingState, { isHydrated }) }) }) });
|
|
4130
4270
|
}
|
|
4131
4271
|
function TableLoadingState({ isHydrated }) {
|
|
4132
4272
|
const loadingText = useTheme((t) => t.text.loading);
|
|
4133
|
-
const [showLoading, setShowLoading] =
|
|
4273
|
+
const [showLoading, setShowLoading] = useState15(false);
|
|
4134
4274
|
useEffect15(() => {
|
|
4135
4275
|
const handle = setTimeout(() => setShowLoading(true), 500);
|
|
4136
4276
|
return () => clearTimeout(handle);
|
|
4137
4277
|
});
|
|
4138
|
-
return /* @__PURE__ */ jsxs19(
|
|
4139
|
-
!isHydrated && showLoading && /* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4278
|
+
return /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4279
|
+
!isHydrated && showLoading && /* @__PURE__ */ jsx35("div", { children: loadingText }),
|
|
4280
|
+
/* @__PURE__ */ jsx35(TableInner, { hidden: !isHydrated })
|
|
4141
4281
|
] });
|
|
4142
4282
|
}
|
|
4143
4283
|
var TableInner = memo3(function TableInner2({ hidden }) {
|
|
@@ -4178,7 +4318,7 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4178
4318
|
var _a, _b;
|
|
4179
4319
|
return (_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table inner");
|
|
4180
4320
|
});
|
|
4181
|
-
return /* @__PURE__ */
|
|
4321
|
+
return /* @__PURE__ */ jsx35(
|
|
4182
4322
|
Virtualized,
|
|
4183
4323
|
{
|
|
4184
4324
|
className: classes == null ? void 0 : classes.table,
|
|
@@ -4197,8 +4337,8 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4197
4337
|
fullWidth === "left" || fullWidth === true ? "auto" : "0"
|
|
4198
4338
|
].join(" ")
|
|
4199
4339
|
},
|
|
4200
|
-
header: /* @__PURE__ */ jsxs19(
|
|
4201
|
-
/* @__PURE__ */
|
|
4340
|
+
header: /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4341
|
+
/* @__PURE__ */ jsx35(
|
|
4202
4342
|
"div",
|
|
4203
4343
|
{
|
|
4204
4344
|
className: classes == null ? void 0 : classes.headerCell,
|
|
@@ -4223,18 +4363,18 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4223
4363
|
styles == null ? void 0 : styles.headerCell
|
|
4224
4364
|
],
|
|
4225
4365
|
children: [
|
|
4226
|
-
enableSelection && /* @__PURE__ */
|
|
4227
|
-
enableColumnSelection && /* @__PURE__ */
|
|
4228
|
-
enableExport && /* @__PURE__ */
|
|
4229
|
-
(enableSelection || enableColumnSelection || enableExport) && /* @__PURE__ */ jsxs19(
|
|
4230
|
-
/* @__PURE__ */
|
|
4231
|
-
/* @__PURE__ */
|
|
4366
|
+
enableSelection && /* @__PURE__ */ jsx35(SelectComponent, {}),
|
|
4367
|
+
enableColumnSelection && /* @__PURE__ */ jsx35(ColumnSelection, {}),
|
|
4368
|
+
enableExport && /* @__PURE__ */ jsx35(Export2, {}),
|
|
4369
|
+
(enableSelection || enableColumnSelection || enableExport) && /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4370
|
+
/* @__PURE__ */ jsx35("div", { css: { flex: 1 } }),
|
|
4371
|
+
/* @__PURE__ */ jsx35(ResizeHandleView, {})
|
|
4232
4372
|
] })
|
|
4233
4373
|
]
|
|
4234
4374
|
}
|
|
4235
4375
|
),
|
|
4236
|
-
/* @__PURE__ */
|
|
4237
|
-
/* @__PURE__ */
|
|
4376
|
+
/* @__PURE__ */ jsx35(ColumnHeaderContext.Provider, { children: visibleColumns.map((column) => /* @__PURE__ */ jsx35(ColumnContext.Provider, { value: column.id, children: /* @__PURE__ */ jsx35(ColumnHeader, {}) }, column.id)) }),
|
|
4377
|
+
/* @__PURE__ */ jsx35(
|
|
4238
4378
|
"div",
|
|
4239
4379
|
{
|
|
4240
4380
|
className: classes == null ? void 0 : classes.headerCell,
|
|
@@ -4247,10 +4387,10 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4247
4387
|
}
|
|
4248
4388
|
)
|
|
4249
4389
|
] }),
|
|
4250
|
-
footer: /* @__PURE__ */ jsxs19(
|
|
4251
|
-
enableClearFiltersButton && hasActiveFilters && /* @__PURE__ */
|
|
4252
|
-
hasFooter && /* @__PURE__ */ jsxs19(
|
|
4253
|
-
/* @__PURE__ */
|
|
4390
|
+
footer: /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4391
|
+
enableClearFiltersButton && hasActiveFilters && /* @__PURE__ */ jsx35(ClearFiltersButton, {}),
|
|
4392
|
+
hasFooter && /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4393
|
+
/* @__PURE__ */ jsx35(
|
|
4254
4394
|
"div",
|
|
4255
4395
|
{
|
|
4256
4396
|
className: classes == null ? void 0 : classes.footerCell,
|
|
@@ -4263,7 +4403,7 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4263
4403
|
]
|
|
4264
4404
|
}
|
|
4265
4405
|
),
|
|
4266
|
-
/* @__PURE__ */
|
|
4406
|
+
/* @__PURE__ */ jsx35(
|
|
4267
4407
|
"div",
|
|
4268
4408
|
{
|
|
4269
4409
|
className: classes == null ? void 0 : classes.footerCell,
|
|
@@ -4275,8 +4415,8 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4275
4415
|
]
|
|
4276
4416
|
}
|
|
4277
4417
|
),
|
|
4278
|
-
visibleColumns.map((column) => /* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4418
|
+
visibleColumns.map((column) => /* @__PURE__ */ jsx35(ColumnContext.Provider, { value: column.id, children: /* @__PURE__ */ jsx35(ColumnFooter, {}) }, column.id)),
|
|
4419
|
+
/* @__PURE__ */ jsx35(
|
|
4280
4420
|
"div",
|
|
4281
4421
|
{
|
|
4282
4422
|
className: classes == null ? void 0 : classes.footerCell,
|
|
@@ -4290,7 +4430,7 @@ var TableInner = memo3(function TableInner2({ hidden }) {
|
|
|
4290
4430
|
)
|
|
4291
4431
|
] })
|
|
4292
4432
|
] }),
|
|
4293
|
-
children: (itemIds, startIndex) => itemIds.map((itemId, index) => /* @__PURE__ */
|
|
4433
|
+
children: (itemIds, startIndex) => itemIds.map((itemId, index) => /* @__PURE__ */ jsx35(Row, { itemId, rowIndex: startIndex + index }, itemId))
|
|
4294
4434
|
}
|
|
4295
4435
|
);
|
|
4296
4436
|
});
|
|
@@ -4316,7 +4456,7 @@ var termMatch = (text, query) => {
|
|
|
4316
4456
|
};
|
|
4317
4457
|
|
|
4318
4458
|
// src/components/textFilter.tsx
|
|
4319
|
-
import { jsx as
|
|
4459
|
+
import { jsx as jsx36 } from "@emotion/react/jsx-runtime";
|
|
4320
4460
|
function TextFilter(_a) {
|
|
4321
4461
|
var _b = _a, {
|
|
4322
4462
|
compare = textMatch,
|
|
@@ -4340,19 +4480,19 @@ function TextFilter(_a) {
|
|
|
4340
4480
|
return compare(value2, filterValue);
|
|
4341
4481
|
}
|
|
4342
4482
|
}));
|
|
4343
|
-
return /* @__PURE__ */
|
|
4483
|
+
return /* @__PURE__ */ jsx36(
|
|
4344
4484
|
"div",
|
|
4345
4485
|
{
|
|
4346
4486
|
css: {
|
|
4347
4487
|
padding: `calc(var(--spacing) * 2)`,
|
|
4348
4488
|
display: "grid"
|
|
4349
4489
|
},
|
|
4350
|
-
children: /* @__PURE__ */
|
|
4490
|
+
children: /* @__PURE__ */ jsx36(
|
|
4351
4491
|
AutoFocusTextField,
|
|
4352
4492
|
{
|
|
4353
4493
|
value,
|
|
4354
4494
|
onChange: (event) => onChange(event.target.value),
|
|
4355
|
-
endIcon: /* @__PURE__ */
|
|
4495
|
+
endIcon: /* @__PURE__ */ jsx36(IconButton2, { onClick: () => onChange(""), children: !value ? /* @__PURE__ */ jsx36(Search2, {}) : /* @__PURE__ */ jsx36(Clear2, {}) }),
|
|
4356
4496
|
placeholder
|
|
4357
4497
|
}
|
|
4358
4498
|
)
|