@gridkitjs/react 0.0.0-dev-20261118223155 → 0.0.0-dev-20261119130019
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.d.ts +19 -3
- package/dist/index.js +227 -179
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -593,6 +593,27 @@ function createRowPropsResolver() {
|
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
+
// src/DataGrid/components/GridEmptyRow.tsx
|
|
597
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
598
|
+
function GridEmptyRow({
|
|
599
|
+
columnCount,
|
|
600
|
+
viewportWidth,
|
|
601
|
+
children
|
|
602
|
+
}) {
|
|
603
|
+
const contentStyle = viewportWidth === null ? void 0 : {
|
|
604
|
+
"--gridkit-empty-width": `${String(viewportWidth)}px`
|
|
605
|
+
};
|
|
606
|
+
return /* @__PURE__ */ jsx4("tr", { role: "row", className: "gridkit-grid-empty-row", children: /* @__PURE__ */ jsx4(
|
|
607
|
+
"td",
|
|
608
|
+
{
|
|
609
|
+
role: "gridcell",
|
|
610
|
+
colSpan: columnCount,
|
|
611
|
+
className: "gridkit-grid-empty-cell",
|
|
612
|
+
children: /* @__PURE__ */ jsx4("div", { className: "gridkit-grid-empty-content", style: contentStyle, children })
|
|
613
|
+
}
|
|
614
|
+
) });
|
|
615
|
+
}
|
|
616
|
+
|
|
596
617
|
// src/DataGrid/components/GridGroupRow.tsx
|
|
597
618
|
import { memo } from "react";
|
|
598
619
|
import {
|
|
@@ -615,7 +636,7 @@ function renderAggregate(value, spec, column, rows, locale) {
|
|
|
615
636
|
}
|
|
616
637
|
|
|
617
638
|
// src/DataGrid/components/GridGroupRow.tsx
|
|
618
|
-
import { jsx as
|
|
639
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
619
640
|
function GridGroupRowComponent({
|
|
620
641
|
columnCount,
|
|
621
642
|
groupId,
|
|
@@ -637,7 +658,7 @@ function GridGroupRowComponent({
|
|
|
637
658
|
cellMessages,
|
|
638
659
|
ref
|
|
639
660
|
}) {
|
|
640
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsx5(
|
|
641
662
|
"tr",
|
|
642
663
|
{
|
|
643
664
|
ref,
|
|
@@ -653,7 +674,7 @@ function GridGroupRowComponent({
|
|
|
653
674
|
"gridkit-grid-group-row",
|
|
654
675
|
`is-group-level-${String(level)}`
|
|
655
676
|
),
|
|
656
|
-
children: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ jsx5(
|
|
657
678
|
"td",
|
|
658
679
|
{
|
|
659
680
|
role: "gridcell",
|
|
@@ -667,7 +688,7 @@ function GridGroupRowComponent({
|
|
|
667
688
|
className: "gridkit-grid-group-cell-content",
|
|
668
689
|
style: { paddingInlineStart: `${String(level * 1.25 + 0.5)}rem` },
|
|
669
690
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ jsx5(
|
|
671
692
|
"span",
|
|
672
693
|
{
|
|
673
694
|
className: classNames(
|
|
@@ -688,7 +709,7 @@ function GridGroupRowComponent({
|
|
|
688
709
|
count,
|
|
689
710
|
")"
|
|
690
711
|
] }),
|
|
691
|
-
aggregates.length > 0 && /* @__PURE__ */
|
|
712
|
+
aggregates.length > 0 && /* @__PURE__ */ jsx5("span", { className: "gridkit-group-aggregates", children: aggregates.map((spec) => {
|
|
692
713
|
const key = spec.id ?? spec.columnId;
|
|
693
714
|
const aggregateValue = results.get(key);
|
|
694
715
|
const column = definitions.get(spec.columnId);
|
|
@@ -735,7 +756,7 @@ function textAlignFor(alignment) {
|
|
|
735
756
|
}
|
|
736
757
|
|
|
737
758
|
// src/DataGrid/components/GridGroupSummaryRow.tsx
|
|
738
|
-
import { jsx as
|
|
759
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
739
760
|
function GridGroupSummaryRowComponent({
|
|
740
761
|
groupId,
|
|
741
762
|
level,
|
|
@@ -747,7 +768,7 @@ function GridGroupSummaryRowComponent({
|
|
|
747
768
|
locale,
|
|
748
769
|
ref
|
|
749
770
|
}) {
|
|
750
|
-
return /* @__PURE__ */
|
|
771
|
+
return /* @__PURE__ */ jsx6(
|
|
751
772
|
"tr",
|
|
752
773
|
{
|
|
753
774
|
ref,
|
|
@@ -777,7 +798,7 @@ function GridGroupSummaryRowComponent({
|
|
|
777
798
|
...pinnedCellStyle(entry)
|
|
778
799
|
},
|
|
779
800
|
children: [
|
|
780
|
-
entry.id === columns[0]?.id && /* @__PURE__ */
|
|
801
|
+
entry.id === columns[0]?.id && /* @__PURE__ */ jsx6(
|
|
781
802
|
"span",
|
|
782
803
|
{
|
|
783
804
|
className: "gridkit-grid-group-summary-indent",
|
|
@@ -815,7 +836,7 @@ import {
|
|
|
815
836
|
formatCellValue
|
|
816
837
|
} from "@gridkitjs/core";
|
|
817
838
|
import { memo as memo3 } from "react";
|
|
818
|
-
import { jsx as
|
|
839
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
819
840
|
function GridRowComponent({
|
|
820
841
|
columns,
|
|
821
842
|
rowId,
|
|
@@ -843,7 +864,7 @@ function GridRowComponent({
|
|
|
843
864
|
cellsSelectable ? "Space Enter" : "",
|
|
844
865
|
contextMenu ? "Shift+F10" : ""
|
|
845
866
|
].filter(Boolean).join(" ");
|
|
846
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ jsx7(
|
|
847
868
|
"tr",
|
|
848
869
|
{
|
|
849
870
|
...rowAttributes,
|
|
@@ -865,7 +886,7 @@ function GridRowComponent({
|
|
|
865
886
|
const { id, column, alignment } = entry;
|
|
866
887
|
const value = accessDotted(row, column.field);
|
|
867
888
|
const cellSelected = id === selectedColumnId;
|
|
868
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ jsx7(
|
|
869
890
|
"td",
|
|
870
891
|
{
|
|
871
892
|
role: "gridcell",
|
|
@@ -905,7 +926,7 @@ var GridRow = memo3(GridRowComponent);
|
|
|
905
926
|
var GridRow_default = GridRow;
|
|
906
927
|
|
|
907
928
|
// src/DataGrid/components/GridBody.tsx
|
|
908
|
-
import { Fragment, jsx as
|
|
929
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
909
930
|
function GridBody({
|
|
910
931
|
columns,
|
|
911
932
|
definitions,
|
|
@@ -919,6 +940,9 @@ function GridBody({
|
|
|
919
940
|
virtualRange,
|
|
920
941
|
infiniteScroll,
|
|
921
942
|
sentinelRef,
|
|
943
|
+
empty,
|
|
944
|
+
emptyTemplate,
|
|
945
|
+
viewportWidth,
|
|
922
946
|
locale,
|
|
923
947
|
getRowProps,
|
|
924
948
|
onRowClick,
|
|
@@ -1050,7 +1074,7 @@ function GridBody({
|
|
|
1050
1074
|
// to give the browser's scrollbar the correct total height and thumb
|
|
1051
1075
|
// position, the same way `GridFooter`'s `<tfoot>` isn't a "row" to
|
|
1052
1076
|
// any of this grid's own row-counting logic.
|
|
1053
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx8("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx8(
|
|
1054
1078
|
"td",
|
|
1055
1079
|
{
|
|
1056
1080
|
style: {
|
|
@@ -1064,7 +1088,7 @@ function GridBody({
|
|
|
1064
1088
|
switch (entry.kind) {
|
|
1065
1089
|
case "data": {
|
|
1066
1090
|
const rowProps = rowPropsOf(entry.rowId);
|
|
1067
|
-
return /* @__PURE__ */
|
|
1091
|
+
return /* @__PURE__ */ jsx8(
|
|
1068
1092
|
GridRow_default,
|
|
1069
1093
|
{
|
|
1070
1094
|
ref: virtualRange?.measureRow(entry.rowIndex),
|
|
@@ -1096,7 +1120,7 @@ function GridBody({
|
|
|
1096
1120
|
);
|
|
1097
1121
|
}
|
|
1098
1122
|
case "group-summary":
|
|
1099
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsx8(
|
|
1100
1124
|
GridGroupSummaryRow_default,
|
|
1101
1125
|
{
|
|
1102
1126
|
ref: virtualRange?.measureRow(entry.rowIndex),
|
|
@@ -1112,7 +1136,7 @@ function GridBody({
|
|
|
1112
1136
|
`${entry.groupId}-summary`
|
|
1113
1137
|
);
|
|
1114
1138
|
case "group":
|
|
1115
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ jsx8(
|
|
1116
1140
|
GridGroupRow_default,
|
|
1117
1141
|
{
|
|
1118
1142
|
ref: virtualRange?.measureRow(entry.rowIndex),
|
|
@@ -1141,7 +1165,15 @@ function GridBody({
|
|
|
1141
1165
|
return entry;
|
|
1142
1166
|
}
|
|
1143
1167
|
}),
|
|
1144
|
-
|
|
1168
|
+
empty !== null && /* @__PURE__ */ jsx8(
|
|
1169
|
+
GridEmptyRow,
|
|
1170
|
+
{
|
|
1171
|
+
columnCount: columns.length,
|
|
1172
|
+
viewportWidth,
|
|
1173
|
+
children: emptyTemplate ? emptyTemplate(empty) : empty.filtered ? messages.noMatchingRows : messages.noRows
|
|
1174
|
+
}
|
|
1175
|
+
),
|
|
1176
|
+
virtualRange !== null && virtualRange.offsetAfter > 0 && /* @__PURE__ */ jsx8("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx8(
|
|
1145
1177
|
"td",
|
|
1146
1178
|
{
|
|
1147
1179
|
style: {
|
|
@@ -1152,7 +1184,7 @@ function GridBody({
|
|
|
1152
1184
|
}
|
|
1153
1185
|
) }),
|
|
1154
1186
|
infiniteScroll?.hasMore && /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1155
|
-
infiniteScroll.isLoadingMore === true && /* @__PURE__ */
|
|
1187
|
+
infiniteScroll.isLoadingMore === true && /* @__PURE__ */ jsx8("tr", { "aria-hidden": "true", className: "gridkit-grid-loading-row", children: /* @__PURE__ */ jsx8(
|
|
1156
1188
|
"td",
|
|
1157
1189
|
{
|
|
1158
1190
|
colSpan: columns.length,
|
|
@@ -1160,13 +1192,13 @@ function GridBody({
|
|
|
1160
1192
|
children: infiniteScroll.loadingTemplate ? infiniteScroll.loadingTemplate() : messages.loadingMore
|
|
1161
1193
|
}
|
|
1162
1194
|
) }),
|
|
1163
|
-
/* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ jsx8(
|
|
1164
1196
|
"tr",
|
|
1165
1197
|
{
|
|
1166
1198
|
"aria-hidden": "true",
|
|
1167
1199
|
ref: sentinelRef,
|
|
1168
1200
|
className: "gridkit-grid-sentinel-row",
|
|
1169
|
-
children: /* @__PURE__ */
|
|
1201
|
+
children: /* @__PURE__ */ jsx8(
|
|
1170
1202
|
"td",
|
|
1171
1203
|
{
|
|
1172
1204
|
colSpan: columns.length,
|
|
@@ -1182,7 +1214,7 @@ function GridBody({
|
|
|
1182
1214
|
}
|
|
1183
1215
|
|
|
1184
1216
|
// src/DataGrid/components/GridFooter.tsx
|
|
1185
|
-
import { jsx as
|
|
1217
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1186
1218
|
function GridFooter({
|
|
1187
1219
|
columns,
|
|
1188
1220
|
aggregates,
|
|
@@ -1191,7 +1223,7 @@ function GridFooter({
|
|
|
1191
1223
|
locale,
|
|
1192
1224
|
ariaRowIndex
|
|
1193
1225
|
}) {
|
|
1194
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ jsx9("tfoot", { role: "rowgroup", children: /* @__PURE__ */ jsx9(
|
|
1195
1227
|
"tr",
|
|
1196
1228
|
{
|
|
1197
1229
|
className: "gridkit-grid-footer",
|
|
@@ -1201,7 +1233,7 @@ function GridFooter({
|
|
|
1201
1233
|
const specs = aggregates.filter(
|
|
1202
1234
|
(candidate) => candidate.columnId === entry.id
|
|
1203
1235
|
);
|
|
1204
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ jsx9(
|
|
1205
1237
|
"td",
|
|
1206
1238
|
{
|
|
1207
1239
|
role: "gridcell",
|
|
@@ -1235,7 +1267,7 @@ function GridFooter({
|
|
|
1235
1267
|
|
|
1236
1268
|
// src/DataGrid/components/GridPager.tsx
|
|
1237
1269
|
import { paginationWindow } from "@gridkitjs/core/renderer";
|
|
1238
|
-
import { jsx as
|
|
1270
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1239
1271
|
function PagerNavButton({
|
|
1240
1272
|
className,
|
|
1241
1273
|
label,
|
|
@@ -1243,7 +1275,7 @@ function PagerNavButton({
|
|
|
1243
1275
|
onClick,
|
|
1244
1276
|
children
|
|
1245
1277
|
}) {
|
|
1246
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ jsx10(
|
|
1247
1279
|
"button",
|
|
1248
1280
|
{
|
|
1249
1281
|
type: "button",
|
|
@@ -1259,13 +1291,15 @@ function PagerNavButton({
|
|
|
1259
1291
|
);
|
|
1260
1292
|
}
|
|
1261
1293
|
function GridPager({ pager, config, messages }) {
|
|
1262
|
-
const { pagination
|
|
1294
|
+
const { pagination } = pager;
|
|
1295
|
+
const pageCount = Math.max(1, pager.pageCount);
|
|
1296
|
+
const currentPage = Math.max(1, pager.currentPage);
|
|
1263
1297
|
const variant = config?.variant ?? "compact";
|
|
1264
1298
|
const sizeOptions = config?.sizeOptions;
|
|
1265
1299
|
const atFirst = pagination.pageIndex <= 0;
|
|
1266
1300
|
const atLast = pagination.pageIndex >= pageCount - 1;
|
|
1267
1301
|
const barStyle = {
|
|
1268
|
-
"--gridkit-pager-digits": String(String(
|
|
1302
|
+
"--gridkit-pager-digits": String(String(pageCount).length)
|
|
1269
1303
|
};
|
|
1270
1304
|
return /* @__PURE__ */ jsxs6(
|
|
1271
1305
|
"div",
|
|
@@ -1275,7 +1309,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1275
1309
|
"aria-label": messages.pagerLabel,
|
|
1276
1310
|
children: [
|
|
1277
1311
|
/* @__PURE__ */ jsxs6("div", { className: "gridkit-grid-pager-bar", style: barStyle, children: [
|
|
1278
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ jsx10(
|
|
1279
1313
|
PagerNavButton,
|
|
1280
1314
|
{
|
|
1281
1315
|
className: "gridkit-grid-pager-first",
|
|
@@ -1284,10 +1318,10 @@ function GridPager({ pager, config, messages }) {
|
|
|
1284
1318
|
onClick: () => {
|
|
1285
1319
|
pager.goToPage(0);
|
|
1286
1320
|
},
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1321
|
+
children: /* @__PURE__ */ jsx10(ChevronsLeftIcon, {})
|
|
1288
1322
|
}
|
|
1289
1323
|
),
|
|
1290
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ jsx10(
|
|
1291
1325
|
PagerNavButton,
|
|
1292
1326
|
{
|
|
1293
1327
|
className: "gridkit-grid-pager-previous",
|
|
@@ -1296,14 +1330,14 @@ function GridPager({ pager, config, messages }) {
|
|
|
1296
1330
|
onClick: () => {
|
|
1297
1331
|
pager.previousPage();
|
|
1298
1332
|
},
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1333
|
+
children: /* @__PURE__ */ jsx10(ChevronLeftIcon, {})
|
|
1300
1334
|
}
|
|
1301
1335
|
),
|
|
1302
1336
|
variant === "numbered" ? paginationWindow(currentPage, pageCount, {
|
|
1303
1337
|
boundaryCount: config?.boundaryCount,
|
|
1304
1338
|
siblingCount: config?.siblingCount
|
|
1305
1339
|
}).map(
|
|
1306
|
-
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */
|
|
1340
|
+
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx10(
|
|
1307
1341
|
"span",
|
|
1308
1342
|
{
|
|
1309
1343
|
className: "gridkit-grid-pager-ellipsis",
|
|
@@ -1311,7 +1345,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1311
1345
|
children: "\u2026"
|
|
1312
1346
|
},
|
|
1313
1347
|
`ellipsis-${String(index)}`
|
|
1314
|
-
) : /* @__PURE__ */
|
|
1348
|
+
) : /* @__PURE__ */ jsx10(
|
|
1315
1349
|
"button",
|
|
1316
1350
|
{
|
|
1317
1351
|
type: "button",
|
|
@@ -1326,11 +1360,8 @@ function GridPager({ pager, config, messages }) {
|
|
|
1326
1360
|
entry
|
|
1327
1361
|
)
|
|
1328
1362
|
) : /* @__PURE__ */ jsxs6("span", { className: "gridkit-grid-pager-status-slot", children: [
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
|
|
1331
|
-
pageCount
|
|
1332
|
-
) }),
|
|
1333
|
-
/* @__PURE__ */ jsx9(
|
|
1363
|
+
/* @__PURE__ */ jsx10("span", { className: "gridkit-grid-pager-status", children: messages.pageStatus(currentPage, pageCount) }),
|
|
1364
|
+
/* @__PURE__ */ jsx10(
|
|
1334
1365
|
"span",
|
|
1335
1366
|
{
|
|
1336
1367
|
className: "gridkit-grid-pager-status-sizer",
|
|
@@ -1339,7 +1370,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1339
1370
|
}
|
|
1340
1371
|
)
|
|
1341
1372
|
] }),
|
|
1342
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ jsx10(
|
|
1343
1374
|
PagerNavButton,
|
|
1344
1375
|
{
|
|
1345
1376
|
className: "gridkit-grid-pager-next",
|
|
@@ -1348,10 +1379,10 @@ function GridPager({ pager, config, messages }) {
|
|
|
1348
1379
|
onClick: () => {
|
|
1349
1380
|
pager.nextPage();
|
|
1350
1381
|
},
|
|
1351
|
-
children: /* @__PURE__ */
|
|
1382
|
+
children: /* @__PURE__ */ jsx10(ChevronRightIcon, {})
|
|
1352
1383
|
}
|
|
1353
1384
|
),
|
|
1354
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx10(
|
|
1355
1386
|
PagerNavButton,
|
|
1356
1387
|
{
|
|
1357
1388
|
className: "gridkit-grid-pager-last",
|
|
@@ -1360,22 +1391,22 @@ function GridPager({ pager, config, messages }) {
|
|
|
1360
1391
|
onClick: () => {
|
|
1361
1392
|
pager.goToPage(pageCount - 1);
|
|
1362
1393
|
},
|
|
1363
|
-
children: /* @__PURE__ */
|
|
1394
|
+
children: /* @__PURE__ */ jsx10(ChevronsRightIcon, {})
|
|
1364
1395
|
}
|
|
1365
1396
|
)
|
|
1366
1397
|
] }),
|
|
1367
1398
|
sizeOptions !== void 0 && sizeOptions.length > 0 && /* @__PURE__ */ jsxs6("label", { className: "gridkit-grid-pager-page-size", children: [
|
|
1368
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ jsx10(
|
|
1369
1400
|
"select",
|
|
1370
1401
|
{
|
|
1371
1402
|
value: pagination.pageSize,
|
|
1372
1403
|
onChange: (event) => {
|
|
1373
1404
|
pager.setPageSize(Number(event.target.value));
|
|
1374
1405
|
},
|
|
1375
|
-
children: sizeOptions.map((size) => /* @__PURE__ */
|
|
1406
|
+
children: sizeOptions.map((size) => /* @__PURE__ */ jsx10("option", { value: size, children: size }, size))
|
|
1376
1407
|
}
|
|
1377
1408
|
),
|
|
1378
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ jsx10("span", { className: "gridkit-grid-pager-page-size-label", children: messages.pageSizeLabel })
|
|
1379
1410
|
] })
|
|
1380
1411
|
]
|
|
1381
1412
|
}
|
|
@@ -1507,7 +1538,7 @@ function useGroupByDrag({
|
|
|
1507
1538
|
}
|
|
1508
1539
|
|
|
1509
1540
|
// src/DataGrid/components/GroupByBar.tsx
|
|
1510
|
-
import { jsx as
|
|
1541
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1511
1542
|
function GroupByBar({
|
|
1512
1543
|
columns,
|
|
1513
1544
|
definitions,
|
|
@@ -1556,7 +1587,7 @@ function GroupByBar({
|
|
|
1556
1587
|
role: "group",
|
|
1557
1588
|
"aria-label": messages.groupByBarLabel,
|
|
1558
1589
|
children: [
|
|
1559
|
-
showPlaceholder && /* @__PURE__ */
|
|
1590
|
+
showPlaceholder && /* @__PURE__ */ jsx11("span", { className: "gridkit-group-by-bar-placeholder", children: messages.groupByBarPlaceholder }),
|
|
1560
1591
|
groupBy.map((entry, index) => {
|
|
1561
1592
|
const dropBefore = activeDropTarget?.beforeColumnId === entry.columnId;
|
|
1562
1593
|
const dropAfter = activeDropTarget?.beforeColumnId === null && index === groupBy.length - 1;
|
|
@@ -1592,8 +1623,8 @@ function GroupByBar({
|
|
|
1592
1623
|
}
|
|
1593
1624
|
},
|
|
1594
1625
|
children: [
|
|
1595
|
-
/* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsx11("span", { className: "gridkit-group-by-chip-label", children: labelFor(entry.columnId) }),
|
|
1627
|
+
/* @__PURE__ */ jsx11(
|
|
1597
1628
|
"button",
|
|
1598
1629
|
{
|
|
1599
1630
|
type: "button",
|
|
@@ -1614,7 +1645,7 @@ function GroupByBar({
|
|
|
1614
1645
|
);
|
|
1615
1646
|
}),
|
|
1616
1647
|
chipDrag.draggedColumnId !== null && chipDrag.ghostTransform !== null && createPortal2(
|
|
1617
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsx11(
|
|
1618
1649
|
"span",
|
|
1619
1650
|
{
|
|
1620
1651
|
className: "gridkit-group-by-chip gridkit-drag-ghost",
|
|
@@ -1765,7 +1796,10 @@ function announcedCallbacks({
|
|
|
1765
1796
|
onPaginationChange: (event) => {
|
|
1766
1797
|
callbacks.onPaginationChange?.(event);
|
|
1767
1798
|
announce(
|
|
1768
|
-
messages.pageStatus(
|
|
1799
|
+
messages.pageStatus(
|
|
1800
|
+
event.pagination.pageIndex + 1,
|
|
1801
|
+
Math.max(1, event.pageCount)
|
|
1802
|
+
)
|
|
1769
1803
|
);
|
|
1770
1804
|
},
|
|
1771
1805
|
/**
|
|
@@ -2058,7 +2092,7 @@ import {
|
|
|
2058
2092
|
attachOverlay,
|
|
2059
2093
|
writingDirection as writingDirection4
|
|
2060
2094
|
} from "@gridkitjs/dom";
|
|
2061
|
-
import { jsx as
|
|
2095
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2062
2096
|
var ANCHOR_GAP = 4;
|
|
2063
2097
|
function attachedFocus(focus) {
|
|
2064
2098
|
return typeof focus === "object" && !(focus instanceof HTMLElement) ? focus.current ?? "first" : focus;
|
|
@@ -2126,7 +2160,7 @@ function Overlay({
|
|
|
2126
2160
|
trapFocus
|
|
2127
2161
|
]);
|
|
2128
2162
|
return createPortal3(
|
|
2129
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ jsx12(
|
|
2130
2164
|
"div",
|
|
2131
2165
|
{
|
|
2132
2166
|
ref: panelRef,
|
|
@@ -2140,42 +2174,42 @@ function Overlay({
|
|
|
2140
2174
|
}
|
|
2141
2175
|
|
|
2142
2176
|
// src/DataGrid/menu/menuIcons.tsx
|
|
2143
|
-
import { jsx as
|
|
2177
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2144
2178
|
var BUILT_IN_ICONS = {
|
|
2145
2179
|
sortAscending: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
/* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */
|
|
2180
|
+
/* @__PURE__ */ jsx13("path", { d: "m3 8 4-4 4 4" }),
|
|
2181
|
+
/* @__PURE__ */ jsx13("path", { d: "M7 4v16" }),
|
|
2182
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 12h4" }),
|
|
2183
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 16h7" }),
|
|
2184
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 20h10" })
|
|
2151
2185
|
] }),
|
|
2152
2186
|
sortDescending: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsx13("path", { d: "m3 16 4 4 4-4" }),
|
|
2188
|
+
/* @__PURE__ */ jsx13("path", { d: "M7 20V4" }),
|
|
2189
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 4h10" }),
|
|
2190
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 8h7" }),
|
|
2191
|
+
/* @__PURE__ */ jsx13("path", { d: "M11 12h4" })
|
|
2158
2192
|
] }),
|
|
2159
|
-
group: () => /* @__PURE__ */
|
|
2193
|
+
group: () => /* @__PURE__ */ jsx13(GroupIcon, {}),
|
|
2160
2194
|
hide: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ jsx13("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
2196
|
+
/* @__PURE__ */ jsx13("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
2197
|
+
/* @__PURE__ */ jsx13("path", { d: "M6.61 6.61A13.53 13.53 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
2198
|
+
/* @__PURE__ */ jsx13("path", { d: "m2 2 20 20" })
|
|
2165
2199
|
] }),
|
|
2166
2200
|
autoFit: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2168
|
-
/* @__PURE__ */
|
|
2169
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ jsx13("path", { d: "m18 8 4 4-4 4" }),
|
|
2202
|
+
/* @__PURE__ */ jsx13("path", { d: "M2 12h20" }),
|
|
2203
|
+
/* @__PURE__ */ jsx13("path", { d: "m6 8-4 4 4 4" })
|
|
2170
2204
|
] }),
|
|
2171
2205
|
copy: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ jsx13("rect", { x: "8", y: "8", width: "14", height: "14", rx: "2" }),
|
|
2207
|
+
/* @__PURE__ */ jsx13("path", { d: "M4 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2" })
|
|
2174
2208
|
] }),
|
|
2175
2209
|
print: () => /* @__PURE__ */ jsxs8(Icon, { children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsx13("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
|
|
2211
|
+
/* @__PURE__ */ jsx13("path", { d: "M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6" }),
|
|
2212
|
+
/* @__PURE__ */ jsx13("rect", { x: "6", y: "14", width: "12", height: "8", rx: "1" })
|
|
2179
2213
|
] })
|
|
2180
2214
|
};
|
|
2181
2215
|
var ICONS = new Map(Object.entries(BUILT_IN_ICONS));
|
|
@@ -2184,20 +2218,20 @@ function MenuIcon({ name }) {
|
|
|
2184
2218
|
return draw === void 0 ? null : draw();
|
|
2185
2219
|
}
|
|
2186
2220
|
function CheckIcon() {
|
|
2187
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ jsx13(Icon, { children: /* @__PURE__ */ jsx13("path", { d: "M20 6 9 17l-5-5" }) });
|
|
2188
2222
|
}
|
|
2189
2223
|
function ChevronDownIcon() {
|
|
2190
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ jsx13(Icon, { children: /* @__PURE__ */ jsx13("path", { d: "m6 9 6 6 6-6" }) });
|
|
2191
2225
|
}
|
|
2192
2226
|
function ChevronLeftIcon2() {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ jsx13(Icon, { children: /* @__PURE__ */ jsx13("path", { d: "m15 18-6-6 6-6" }) });
|
|
2194
2228
|
}
|
|
2195
2229
|
function ChevronRightIcon2() {
|
|
2196
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ jsx13(Icon, { children: /* @__PURE__ */ jsx13("path", { d: "m9 18 6-6-6-6" }) });
|
|
2197
2231
|
}
|
|
2198
2232
|
|
|
2199
2233
|
// src/DataGrid/menu/GridMenu.tsx
|
|
2200
|
-
import { Fragment as Fragment2, jsx as
|
|
2234
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2201
2235
|
var CLOSED = { kind: "closed" };
|
|
2202
2236
|
var ENTRY_GONE = { kind: "entryGone" };
|
|
2203
2237
|
function itemElement(menu, id) {
|
|
@@ -2228,10 +2262,10 @@ function MenuItem({
|
|
|
2228
2262
|
...ariaAttr(!isItem2, "aria-haspopup", "menu"),
|
|
2229
2263
|
...ariaAttr(!isItem2, "aria-expanded", expanded),
|
|
2230
2264
|
children: [
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2233
|
-
shortcut !== void 0 && /* @__PURE__ */
|
|
2234
|
-
!isItem2 && /* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ jsx14("span", { className: "gridkit-menu-item-icon", "aria-hidden": "true", children: checked === true ? /* @__PURE__ */ jsx14(CheckIcon, {}) : /* @__PURE__ */ jsx14(MenuIcon, { name: entry.icon }) }),
|
|
2266
|
+
/* @__PURE__ */ jsx14("span", { className: "gridkit-menu-item-label", children: entry.label }),
|
|
2267
|
+
shortcut !== void 0 && /* @__PURE__ */ jsx14("span", { className: "gridkit-menu-item-shortcut", "aria-hidden": "true", children: shortcut }),
|
|
2268
|
+
!isItem2 && /* @__PURE__ */ jsx14("span", { className: "gridkit-menu-submenu-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx14(ChevronRightIcon2, {}) })
|
|
2235
2269
|
]
|
|
2236
2270
|
}
|
|
2237
2271
|
);
|
|
@@ -2326,7 +2360,7 @@ function GridMenu({
|
|
|
2326
2360
|
setSubmenu(ENTRY_GONE);
|
|
2327
2361
|
}
|
|
2328
2362
|
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2329
|
-
/* @__PURE__ */
|
|
2363
|
+
/* @__PURE__ */ jsx14(
|
|
2330
2364
|
"div",
|
|
2331
2365
|
{
|
|
2332
2366
|
ref: menuRef,
|
|
@@ -2334,14 +2368,14 @@ function GridMenu({
|
|
|
2334
2368
|
"aria-label": label,
|
|
2335
2369
|
className: "gridkit-menu",
|
|
2336
2370
|
children: entries.map(
|
|
2337
|
-
(entry) => entry.type === "separator" ? /* @__PURE__ */
|
|
2371
|
+
(entry) => entry.type === "separator" ? /* @__PURE__ */ jsx14(
|
|
2338
2372
|
"div",
|
|
2339
2373
|
{
|
|
2340
2374
|
role: "separator",
|
|
2341
2375
|
className: "gridkit-menu-separator"
|
|
2342
2376
|
},
|
|
2343
2377
|
entry.key
|
|
2344
|
-
) : /* @__PURE__ */
|
|
2378
|
+
) : /* @__PURE__ */ jsx14(
|
|
2345
2379
|
MenuItem,
|
|
2346
2380
|
{
|
|
2347
2381
|
entry,
|
|
@@ -2352,7 +2386,7 @@ function GridMenu({
|
|
|
2352
2386
|
)
|
|
2353
2387
|
}
|
|
2354
2388
|
),
|
|
2355
|
-
submenu.kind === "open" && openEntry !== void 0 && /* @__PURE__ */
|
|
2389
|
+
submenu.kind === "open" && openEntry !== void 0 && /* @__PURE__ */ jsx14(
|
|
2356
2390
|
Overlay,
|
|
2357
2391
|
{
|
|
2358
2392
|
anchor: submenu.anchor,
|
|
@@ -2361,7 +2395,7 @@ function GridMenu({
|
|
|
2361
2395
|
initialFocus: submenu.focus,
|
|
2362
2396
|
scope,
|
|
2363
2397
|
onDismiss: closeSubmenu,
|
|
2364
|
-
children: /* @__PURE__ */
|
|
2398
|
+
children: /* @__PURE__ */ jsx14(
|
|
2365
2399
|
GridMenu,
|
|
2366
2400
|
{
|
|
2367
2401
|
entries: openEntry.items,
|
|
@@ -2380,7 +2414,7 @@ function GridMenu({
|
|
|
2380
2414
|
}
|
|
2381
2415
|
|
|
2382
2416
|
// src/DataGrid/contextMenu/GridContextMenu.tsx
|
|
2383
|
-
import { jsx as
|
|
2417
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2384
2418
|
function GridContextMenu({
|
|
2385
2419
|
contextMenu
|
|
2386
2420
|
}) {
|
|
@@ -2388,7 +2422,7 @@ function GridContextMenu({
|
|
|
2388
2422
|
if (menu === null) {
|
|
2389
2423
|
return null;
|
|
2390
2424
|
}
|
|
2391
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ jsx15(
|
|
2392
2426
|
Overlay,
|
|
2393
2427
|
{
|
|
2394
2428
|
anchor: menu.anchor,
|
|
@@ -2397,7 +2431,7 @@ function GridContextMenu({
|
|
|
2397
2431
|
returnFocusFallback,
|
|
2398
2432
|
scope: menu.scope,
|
|
2399
2433
|
onDismiss: close,
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2434
|
+
children: /* @__PURE__ */ jsx15(
|
|
2401
2435
|
GridMenu,
|
|
2402
2436
|
{
|
|
2403
2437
|
entries: menu.entries,
|
|
@@ -2784,7 +2818,7 @@ import { useRef as useRef15 } from "react";
|
|
|
2784
2818
|
// src/DataGrid/columnChooser/ColumnChooser.tsx
|
|
2785
2819
|
import { useLayoutEffect as useLayoutEffect7, useRef as useRef9, useState as useState6 } from "react";
|
|
2786
2820
|
import { resolveColumnChooser } from "@gridkitjs/core/renderer";
|
|
2787
|
-
import { Fragment as Fragment3, jsx as
|
|
2821
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2788
2822
|
function ColumnChooser({
|
|
2789
2823
|
controller,
|
|
2790
2824
|
messages
|
|
@@ -2815,7 +2849,7 @@ function ColumnChooser({
|
|
|
2815
2849
|
"aria-label": messages.columnChooserLabel,
|
|
2816
2850
|
className: "gridkit-column-chooser",
|
|
2817
2851
|
children: [
|
|
2818
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx16(
|
|
2819
2853
|
"input",
|
|
2820
2854
|
{
|
|
2821
2855
|
type: "search",
|
|
@@ -2828,9 +2862,9 @@ function ColumnChooser({
|
|
|
2828
2862
|
}
|
|
2829
2863
|
}
|
|
2830
2864
|
),
|
|
2831
|
-
entries.length === 0 ? /* @__PURE__ */
|
|
2865
|
+
entries.length === 0 ? /* @__PURE__ */ jsx16("p", { role: "status", className: "gridkit-column-chooser-empty", children: messages.noMatchingColumns }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2832
2866
|
/* @__PURE__ */ jsxs10("label", { className: "gridkit-column-chooser-option gridkit-column-chooser-all", children: [
|
|
2833
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsx16(
|
|
2834
2868
|
"input",
|
|
2835
2869
|
{
|
|
2836
2870
|
ref: showAllRef,
|
|
@@ -2846,8 +2880,8 @@ function ColumnChooser({
|
|
|
2846
2880
|
),
|
|
2847
2881
|
messages.showAllColumns
|
|
2848
2882
|
] }),
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx16("ul", { className: "gridkit-column-chooser-list", children: entries.map((entry) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsxs10("label", { className: "gridkit-column-chooser-option", children: [
|
|
2884
|
+
/* @__PURE__ */ jsx16(
|
|
2851
2885
|
"input",
|
|
2852
2886
|
{
|
|
2853
2887
|
type: "checkbox",
|
|
@@ -2977,7 +3011,7 @@ function useMenuButton({
|
|
|
2977
3011
|
}
|
|
2978
3012
|
|
|
2979
3013
|
// src/DataGrid/filterMenu/OperatorMenuButton.tsx
|
|
2980
|
-
import { Fragment as Fragment4, jsx as
|
|
3014
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2981
3015
|
function gapBeside(button) {
|
|
2982
3016
|
const dialog = button.closest('[role="dialog"]') ?? button;
|
|
2983
3017
|
return dialog.getBoundingClientRect().right - button.getBoundingClientRect().right + ANCHOR_GAP;
|
|
@@ -3015,20 +3049,20 @@ function OperatorMenuButton({
|
|
|
3015
3049
|
className: "gridkit-filter-menu-submenu",
|
|
3016
3050
|
...buttonProps,
|
|
3017
3051
|
children: [
|
|
3018
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsx17("span", { className: "gridkit-filter-menu-submenu-icon", "aria-hidden": "true", children: active !== void 0 && /* @__PURE__ */ jsx17(CheckIcon, {}) }),
|
|
3019
3053
|
label,
|
|
3020
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ jsx17(
|
|
3021
3055
|
"span",
|
|
3022
3056
|
{
|
|
3023
3057
|
className: "gridkit-filter-menu-submenu-indicator",
|
|
3024
3058
|
"aria-hidden": "true",
|
|
3025
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx17(ChevronRightIcon2, {})
|
|
3026
3060
|
}
|
|
3027
3061
|
)
|
|
3028
3062
|
]
|
|
3029
3063
|
}
|
|
3030
3064
|
),
|
|
3031
|
-
state.kind === "open" && /* @__PURE__ */
|
|
3065
|
+
state.kind === "open" && /* @__PURE__ */ jsx17(
|
|
3032
3066
|
Overlay,
|
|
3033
3067
|
{
|
|
3034
3068
|
anchor: state.anchor,
|
|
@@ -3037,7 +3071,7 @@ function OperatorMenuButton({
|
|
|
3037
3071
|
returnFocusTo: state.anchor,
|
|
3038
3072
|
scope: state.scope,
|
|
3039
3073
|
onDismiss: close,
|
|
3040
|
-
children: /* @__PURE__ */
|
|
3074
|
+
children: /* @__PURE__ */ jsx17(
|
|
3041
3075
|
GridMenu,
|
|
3042
3076
|
{
|
|
3043
3077
|
entries,
|
|
@@ -3076,7 +3110,7 @@ import {
|
|
|
3076
3110
|
filterOperandArity,
|
|
3077
3111
|
parseFilterOperand
|
|
3078
3112
|
} from "@gridkitjs/core/renderer";
|
|
3079
|
-
import { jsx as
|
|
3113
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3080
3114
|
function inputType(family, type) {
|
|
3081
3115
|
switch (family) {
|
|
3082
3116
|
case "text":
|
|
@@ -3110,12 +3144,12 @@ function OperandField({
|
|
|
3110
3144
|
};
|
|
3111
3145
|
if (family === "boolean") {
|
|
3112
3146
|
return /* @__PURE__ */ jsxs12("select", { ...field, children: [
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */
|
|
3115
|
-
/* @__PURE__ */
|
|
3147
|
+
/* @__PURE__ */ jsx18("option", { value: "" }),
|
|
3148
|
+
/* @__PURE__ */ jsx18("option", { value: "true", children: messages.booleanTrue }),
|
|
3149
|
+
/* @__PURE__ */ jsx18("option", { value: "false", children: messages.booleanFalse })
|
|
3116
3150
|
] });
|
|
3117
3151
|
}
|
|
3118
|
-
return /* @__PURE__ */
|
|
3152
|
+
return /* @__PURE__ */ jsx18("input", { ...field, type: inputType(family, type) });
|
|
3119
3153
|
}
|
|
3120
3154
|
function ConditionRow({
|
|
3121
3155
|
row,
|
|
@@ -3142,7 +3176,7 @@ function ConditionRow({
|
|
|
3142
3176
|
"aria-label": messages.filterConditionLabel(position),
|
|
3143
3177
|
className: "gridkit-filter-menu-condition",
|
|
3144
3178
|
children: [
|
|
3145
|
-
/* @__PURE__ */
|
|
3179
|
+
/* @__PURE__ */ jsx18(
|
|
3146
3180
|
"select",
|
|
3147
3181
|
{
|
|
3148
3182
|
ref: arity === 0 ? focusRef : void 0,
|
|
@@ -3155,10 +3189,10 @@ function ConditionRow({
|
|
|
3155
3189
|
onChange({ ...row, operator });
|
|
3156
3190
|
}
|
|
3157
3191
|
},
|
|
3158
|
-
children: operators.map((operator) => /* @__PURE__ */
|
|
3192
|
+
children: operators.map((operator) => /* @__PURE__ */ jsx18("option", { value: operator, children: messages.filterOperatorLabel(operator, menu.family) }, operator))
|
|
3159
3193
|
}
|
|
3160
3194
|
),
|
|
3161
|
-
arity > 0 && /* @__PURE__ */
|
|
3195
|
+
arity > 0 && /* @__PURE__ */ jsx18(
|
|
3162
3196
|
OperandField,
|
|
3163
3197
|
{
|
|
3164
3198
|
...operand,
|
|
@@ -3171,7 +3205,7 @@ function ConditionRow({
|
|
|
3171
3205
|
}
|
|
3172
3206
|
}
|
|
3173
3207
|
),
|
|
3174
|
-
arity === 2 && /* @__PURE__ */
|
|
3208
|
+
arity === 2 && /* @__PURE__ */ jsx18(
|
|
3175
3209
|
OperandField,
|
|
3176
3210
|
{
|
|
3177
3211
|
...operand,
|
|
@@ -3269,7 +3303,7 @@ function simpleEditorReducer(state, action) {
|
|
|
3269
3303
|
}
|
|
3270
3304
|
|
|
3271
3305
|
// src/DataGrid/filterMenu/SimpleFilterEditor.tsx
|
|
3272
|
-
import { jsx as
|
|
3306
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3273
3307
|
var COMBINATORS = ["and", "or"];
|
|
3274
3308
|
function holdsUnreadable(row) {
|
|
3275
3309
|
return Array.from(row?.querySelectorAll("input") ?? []).some(
|
|
@@ -3282,14 +3316,14 @@ function CombinatorChoice({
|
|
|
3282
3316
|
messages,
|
|
3283
3317
|
onChange
|
|
3284
3318
|
}) {
|
|
3285
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ jsx19(
|
|
3286
3320
|
"div",
|
|
3287
3321
|
{
|
|
3288
3322
|
role: "radiogroup",
|
|
3289
3323
|
"aria-label": messages.filterCombinatorLabel,
|
|
3290
3324
|
className: "gridkit-filter-menu-combinator",
|
|
3291
3325
|
children: COMBINATORS.map((choice) => /* @__PURE__ */ jsxs13("label", { className: "gridkit-filter-menu-combinator-option", children: [
|
|
3292
|
-
/* @__PURE__ */
|
|
3326
|
+
/* @__PURE__ */ jsx19(
|
|
3293
3327
|
"input",
|
|
3294
3328
|
{
|
|
3295
3329
|
type: "radio",
|
|
@@ -3368,11 +3402,11 @@ function SimpleFilterEditor({
|
|
|
3368
3402
|
}
|
|
3369
3403
|
}, [invalid]);
|
|
3370
3404
|
return /* @__PURE__ */ jsxs13("div", { className: "gridkit-filter-menu-conditions", children: [
|
|
3371
|
-
opened.custom && /* @__PURE__ */
|
|
3405
|
+
opened.custom && /* @__PURE__ */ jsx19("p", { className: "gridkit-filter-menu-custom", children: messages.customFilter }),
|
|
3372
3406
|
draft.rows.map((row, index) => (
|
|
3373
3407
|
// A row is its place: the first condition, or the second.
|
|
3374
3408
|
/* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
3375
|
-
index > 0 && /* @__PURE__ */
|
|
3409
|
+
index > 0 && /* @__PURE__ */ jsx19(
|
|
3376
3410
|
CombinatorChoice,
|
|
3377
3411
|
{
|
|
3378
3412
|
name: combinatorName,
|
|
@@ -3383,7 +3417,7 @@ function SimpleFilterEditor({
|
|
|
3383
3417
|
}
|
|
3384
3418
|
}
|
|
3385
3419
|
),
|
|
3386
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsx19(
|
|
3387
3421
|
ConditionRow,
|
|
3388
3422
|
{
|
|
3389
3423
|
ref: (element) => {
|
|
@@ -3403,7 +3437,7 @@ function SimpleFilterEditor({
|
|
|
3403
3437
|
)
|
|
3404
3438
|
] }, index)
|
|
3405
3439
|
)),
|
|
3406
|
-
invalid.length > 0 && /* @__PURE__ */
|
|
3440
|
+
invalid.length > 0 && /* @__PURE__ */ jsx19("p", { id: invalidMessageId, className: "gridkit-filter-menu-invalid", children: messages.filterValueInvalid(menu.family) })
|
|
3407
3441
|
] });
|
|
3408
3442
|
}
|
|
3409
3443
|
|
|
@@ -3413,7 +3447,7 @@ import {
|
|
|
3413
3447
|
attachChecklist,
|
|
3414
3448
|
createRowVirtualizer
|
|
3415
3449
|
} from "@gridkitjs/dom";
|
|
3416
|
-
import { Fragment as Fragment6, jsx as
|
|
3450
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3417
3451
|
var ESTIMATED_ITEM_HEIGHT = 28;
|
|
3418
3452
|
var OVERSCAN = 4;
|
|
3419
3453
|
var NO_RANGE = {
|
|
@@ -3479,7 +3513,7 @@ function ValueChecklist({
|
|
|
3479
3513
|
"aria-label": label,
|
|
3480
3514
|
className: "gridkit-filter-menu-checklist",
|
|
3481
3515
|
children: [
|
|
3482
|
-
/* @__PURE__ */
|
|
3516
|
+
/* @__PURE__ */ jsx20("div", { role: "presentation", style: { height: range.offsetBefore } }),
|
|
3483
3517
|
shown.map((item, offset) => {
|
|
3484
3518
|
const index = range.startIndex + offset;
|
|
3485
3519
|
return /* @__PURE__ */ jsxs14(
|
|
@@ -3494,32 +3528,32 @@ function ValueChecklist({
|
|
|
3494
3528
|
"aria-posinset": index + 1,
|
|
3495
3529
|
className: "gridkit-filter-menu-option",
|
|
3496
3530
|
children: [
|
|
3497
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ jsx20(
|
|
3498
3532
|
"span",
|
|
3499
3533
|
{
|
|
3500
3534
|
className: "gridkit-filter-menu-option-check",
|
|
3501
3535
|
"aria-hidden": "true",
|
|
3502
|
-
children: /* @__PURE__ */
|
|
3536
|
+
children: /* @__PURE__ */ jsx20(CheckIcon, {})
|
|
3503
3537
|
}
|
|
3504
3538
|
),
|
|
3505
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsx20("span", { className: "gridkit-filter-menu-option-label", children: item.label }),
|
|
3506
3540
|
showCounts && /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3507
3541
|
" ",
|
|
3508
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsx20("span", { className: "gridkit-filter-menu-option-count", children: String(item.count) })
|
|
3509
3543
|
] })
|
|
3510
3544
|
]
|
|
3511
3545
|
},
|
|
3512
3546
|
item.key
|
|
3513
3547
|
);
|
|
3514
3548
|
}),
|
|
3515
|
-
/* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ jsx20("div", { role: "presentation", style: { height: range.offsetAfter } })
|
|
3516
3550
|
]
|
|
3517
3551
|
}
|
|
3518
3552
|
);
|
|
3519
3553
|
}
|
|
3520
3554
|
|
|
3521
3555
|
// src/DataGrid/filterMenu/ExcelFilterEditor.tsx
|
|
3522
|
-
import { Fragment as Fragment7, jsx as
|
|
3556
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3523
3557
|
var OPENED_ON_VALUES = {
|
|
3524
3558
|
kind: "values",
|
|
3525
3559
|
focusOnMount: false
|
|
@@ -3596,12 +3630,12 @@ function ExcelFilterEditor({
|
|
|
3596
3630
|
setMode({ kind: "values", focusOnMount: true });
|
|
3597
3631
|
},
|
|
3598
3632
|
children: [
|
|
3599
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ jsx21("span", { className: "gridkit-filter-menu-back-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx21(ChevronLeftIcon2, {}) }),
|
|
3600
3634
|
messages.filterBackToValues
|
|
3601
3635
|
]
|
|
3602
3636
|
}
|
|
3603
3637
|
),
|
|
3604
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ jsx21(
|
|
3605
3639
|
SimpleFilterEditor,
|
|
3606
3640
|
{
|
|
3607
3641
|
ref: conditions,
|
|
@@ -3620,7 +3654,7 @@ function ExcelFilterEditor({
|
|
|
3620
3654
|
}
|
|
3621
3655
|
const { shape } = opened;
|
|
3622
3656
|
return /* @__PURE__ */ jsxs15("div", { className: "gridkit-filter-menu-values", children: [
|
|
3623
|
-
menu.operators.length > 0 && /* @__PURE__ */
|
|
3657
|
+
menu.operators.length > 0 && /* @__PURE__ */ jsx21(
|
|
3624
3658
|
OperatorMenuButton,
|
|
3625
3659
|
{
|
|
3626
3660
|
ref: operatorButton,
|
|
@@ -3632,8 +3666,8 @@ function ExcelFilterEditor({
|
|
|
3632
3666
|
}
|
|
3633
3667
|
}
|
|
3634
3668
|
),
|
|
3635
|
-
(shape.kind === "conditions" || shape.kind === "custom") && /* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3669
|
+
(shape.kind === "conditions" || shape.kind === "custom") && /* @__PURE__ */ jsx21("p", { className: "gridkit-filter-menu-custom", children: shape.kind === "conditions" ? messages.filterByCondition : messages.customFilter }),
|
|
3670
|
+
/* @__PURE__ */ jsx21(
|
|
3637
3671
|
"input",
|
|
3638
3672
|
{
|
|
3639
3673
|
ref: initialFocusRef,
|
|
@@ -3648,7 +3682,7 @@ function ExcelFilterEditor({
|
|
|
3648
3682
|
}
|
|
3649
3683
|
),
|
|
3650
3684
|
/* @__PURE__ */ jsxs15("label", { className: "gridkit-filter-menu-select-all", children: [
|
|
3651
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx21(
|
|
3652
3686
|
"input",
|
|
3653
3687
|
{
|
|
3654
3688
|
ref: selectAllRef,
|
|
@@ -3662,7 +3696,7 @@ function ExcelFilterEditor({
|
|
|
3662
3696
|
),
|
|
3663
3697
|
messages.filterSelectAll
|
|
3664
3698
|
] }),
|
|
3665
|
-
checklist.needsSearch ? /* @__PURE__ */
|
|
3699
|
+
checklist.needsSearch ? /* @__PURE__ */ jsx21("p", { className: "gridkit-filter-menu-search-first", children: messages.filterSearchFirst(checklist.total) }) : /* @__PURE__ */ jsx21(
|
|
3666
3700
|
ValueChecklist,
|
|
3667
3701
|
{
|
|
3668
3702
|
items: checklist.items,
|
|
@@ -3673,12 +3707,12 @@ function ExcelFilterEditor({
|
|
|
3673
3707
|
}
|
|
3674
3708
|
}
|
|
3675
3709
|
),
|
|
3676
|
-
checklist.hiddenCount > 0 && /* @__PURE__ */
|
|
3710
|
+
checklist.hiddenCount > 0 && /* @__PURE__ */ jsx21("p", { role: "status", className: "gridkit-filter-menu-more", children: messages.filterMoreValues(checklist.hiddenCount) })
|
|
3677
3711
|
] });
|
|
3678
3712
|
}
|
|
3679
3713
|
|
|
3680
3714
|
// src/DataGrid/filterMenu/FilterMenu.tsx
|
|
3681
|
-
import { jsx as
|
|
3715
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3682
3716
|
var SORT_COMMANDS = [
|
|
3683
3717
|
"sort.ascending",
|
|
3684
3718
|
"sort.descending",
|
|
@@ -3735,7 +3769,7 @@ function FilterMenu({
|
|
|
3735
3769
|
close();
|
|
3736
3770
|
}
|
|
3737
3771
|
}
|
|
3738
|
-
return /* @__PURE__ */
|
|
3772
|
+
return /* @__PURE__ */ jsx22(
|
|
3739
3773
|
"div",
|
|
3740
3774
|
{
|
|
3741
3775
|
role: "dialog",
|
|
@@ -3756,7 +3790,7 @@ function FilterMenu({
|
|
|
3756
3790
|
}
|
|
3757
3791
|
},
|
|
3758
3792
|
children: [
|
|
3759
|
-
sortItems.length > 0 && /* @__PURE__ */
|
|
3793
|
+
sortItems.length > 0 && /* @__PURE__ */ jsx22("div", { className: "gridkit-filter-menu-sort", children: sortItems.map((item) => /* @__PURE__ */ jsxs16(
|
|
3760
3794
|
"button",
|
|
3761
3795
|
{
|
|
3762
3796
|
type: "button",
|
|
@@ -3771,12 +3805,12 @@ function FilterMenu({
|
|
|
3771
3805
|
run(item);
|
|
3772
3806
|
},
|
|
3773
3807
|
children: [
|
|
3774
|
-
/* @__PURE__ */
|
|
3808
|
+
/* @__PURE__ */ jsx22(
|
|
3775
3809
|
"span",
|
|
3776
3810
|
{
|
|
3777
3811
|
className: "gridkit-filter-menu-sort-icon",
|
|
3778
3812
|
"aria-hidden": "true",
|
|
3779
|
-
children: /* @__PURE__ */
|
|
3813
|
+
children: /* @__PURE__ */ jsx22(MenuIcon, { name: item.icon })
|
|
3780
3814
|
}
|
|
3781
3815
|
),
|
|
3782
3816
|
item.label
|
|
@@ -3784,9 +3818,9 @@ function FilterMenu({
|
|
|
3784
3818
|
},
|
|
3785
3819
|
item.id
|
|
3786
3820
|
)) }),
|
|
3787
|
-
menu.ui === "excel" ? /* @__PURE__ */
|
|
3821
|
+
menu.ui === "excel" ? /* @__PURE__ */ jsx22(ExcelFilterEditor, { ...editorProps, columnValues }) : /* @__PURE__ */ jsx22(SimpleFilterEditor, { ...editorProps }),
|
|
3788
3822
|
/* @__PURE__ */ jsxs16("div", { className: "gridkit-filter-menu-actions", children: [
|
|
3789
|
-
clearItem !== void 0 && /* @__PURE__ */
|
|
3823
|
+
clearItem !== void 0 && /* @__PURE__ */ jsx22(
|
|
3790
3824
|
"button",
|
|
3791
3825
|
{
|
|
3792
3826
|
type: "button",
|
|
@@ -3798,7 +3832,7 @@ function FilterMenu({
|
|
|
3798
3832
|
children: clearItem.label
|
|
3799
3833
|
}
|
|
3800
3834
|
),
|
|
3801
|
-
/* @__PURE__ */
|
|
3835
|
+
/* @__PURE__ */ jsx22(
|
|
3802
3836
|
"button",
|
|
3803
3837
|
{
|
|
3804
3838
|
type: "button",
|
|
@@ -3807,7 +3841,7 @@ function FilterMenu({
|
|
|
3807
3841
|
children: messages.cancelFilter
|
|
3808
3842
|
}
|
|
3809
3843
|
),
|
|
3810
|
-
/* @__PURE__ */
|
|
3844
|
+
/* @__PURE__ */ jsx22("button", { type: "submit", className: "gridkit-filter-menu-apply", children: messages.applyFilter })
|
|
3811
3845
|
] })
|
|
3812
3846
|
]
|
|
3813
3847
|
}
|
|
@@ -3864,7 +3898,7 @@ function useFilterValueCache(controller, messages) {
|
|
|
3864
3898
|
}
|
|
3865
3899
|
|
|
3866
3900
|
// src/DataGrid/panels/GridPanels.tsx
|
|
3867
|
-
import { jsx as
|
|
3901
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3868
3902
|
var panelKinds = {
|
|
3869
3903
|
columnChooser: { component: ColumnChooser, trapFocus: false },
|
|
3870
3904
|
filter: { component: FilterMenu, trapFocus: true }
|
|
@@ -3887,7 +3921,7 @@ function GridPanels({
|
|
|
3887
3921
|
return null;
|
|
3888
3922
|
}
|
|
3889
3923
|
const { component: Panel, trapFocus } = panelKinds[panel.kind];
|
|
3890
|
-
return /* @__PURE__ */
|
|
3924
|
+
return /* @__PURE__ */ jsx23(
|
|
3891
3925
|
Overlay,
|
|
3892
3926
|
{
|
|
3893
3927
|
anchor: panel.anchor,
|
|
@@ -3900,7 +3934,7 @@ function GridPanels({
|
|
|
3900
3934
|
trapFocus,
|
|
3901
3935
|
scope: panel.scope,
|
|
3902
3936
|
onDismiss: close,
|
|
3903
|
-
children: /* @__PURE__ */
|
|
3937
|
+
children: /* @__PURE__ */ jsx23(
|
|
3904
3938
|
Panel,
|
|
3905
3939
|
{
|
|
3906
3940
|
target: panel.target,
|
|
@@ -4028,7 +4062,7 @@ import { splitToolbarItems } from "@gridkitjs/core/renderer";
|
|
|
4028
4062
|
import { attachToolbar } from "@gridkitjs/dom";
|
|
4029
4063
|
|
|
4030
4064
|
// src/DataGrid/toolbar/ToolbarMenuButton.tsx
|
|
4031
|
-
import { Fragment as Fragment8, jsx as
|
|
4065
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4032
4066
|
function ToolbarMenuButton({
|
|
4033
4067
|
itemKey,
|
|
4034
4068
|
attributes,
|
|
@@ -4055,13 +4089,13 @@ function ToolbarMenuButton({
|
|
|
4055
4089
|
...ariaAttr(more, "data-gridkit-toolbar-more", ""),
|
|
4056
4090
|
...buttonProps,
|
|
4057
4091
|
children: [
|
|
4058
|
-
icon !== void 0 && /* @__PURE__ */
|
|
4092
|
+
icon !== void 0 && /* @__PURE__ */ jsx24("span", { className: "gridkit-toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx24(MenuIcon, { name: icon }) }),
|
|
4059
4093
|
label,
|
|
4060
|
-
/* @__PURE__ */
|
|
4094
|
+
/* @__PURE__ */ jsx24("span", { className: "gridkit-toolbar-button-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx24(ChevronDownIcon, {}) })
|
|
4061
4095
|
]
|
|
4062
4096
|
}
|
|
4063
4097
|
),
|
|
4064
|
-
state.kind === "open" && /* @__PURE__ */
|
|
4098
|
+
state.kind === "open" && /* @__PURE__ */ jsx24(
|
|
4065
4099
|
Overlay,
|
|
4066
4100
|
{
|
|
4067
4101
|
anchor: state.anchor,
|
|
@@ -4071,7 +4105,7 @@ function ToolbarMenuButton({
|
|
|
4071
4105
|
returnFocusFallback,
|
|
4072
4106
|
scope: state.scope,
|
|
4073
4107
|
onDismiss: close,
|
|
4074
|
-
children: /* @__PURE__ */
|
|
4108
|
+
children: /* @__PURE__ */ jsx24(
|
|
4075
4109
|
GridMenu,
|
|
4076
4110
|
{
|
|
4077
4111
|
entries,
|
|
@@ -4093,7 +4127,7 @@ function ToolbarMenuButton({
|
|
|
4093
4127
|
// src/DataGrid/toolbar/ToolbarSearch.tsx
|
|
4094
4128
|
import { useEffect as useEffect6, useRef as useRef17, useState as useState12 } from "react";
|
|
4095
4129
|
import { searchTextOf, setSearchText } from "@gridkitjs/core/renderer";
|
|
4096
|
-
import { jsx as
|
|
4130
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
4097
4131
|
var SEARCH_DELAY_MS = 250;
|
|
4098
4132
|
function ToolbarSearch({
|
|
4099
4133
|
itemKey,
|
|
@@ -4129,7 +4163,7 @@ function ToolbarSearch({
|
|
|
4129
4163
|
},
|
|
4130
4164
|
[]
|
|
4131
4165
|
);
|
|
4132
|
-
return /* @__PURE__ */
|
|
4166
|
+
return /* @__PURE__ */ jsx25(
|
|
4133
4167
|
"input",
|
|
4134
4168
|
{
|
|
4135
4169
|
...attributes,
|
|
@@ -4198,7 +4232,7 @@ function useToolbarOverflow(toolbarRef, items) {
|
|
|
4198
4232
|
}
|
|
4199
4233
|
|
|
4200
4234
|
// src/DataGrid/toolbar/GridToolbar.tsx
|
|
4201
|
-
import { jsx as
|
|
4235
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4202
4236
|
function reporting(run, report) {
|
|
4203
4237
|
return () => {
|
|
4204
4238
|
const ran = run();
|
|
@@ -4251,7 +4285,7 @@ function GridToolbar(props) {
|
|
|
4251
4285
|
return null;
|
|
4252
4286
|
}
|
|
4253
4287
|
const options = typeof props.toolbar === "object" ? props.toolbar : void 0;
|
|
4254
|
-
return /* @__PURE__ */
|
|
4288
|
+
return /* @__PURE__ */ jsx26(
|
|
4255
4289
|
Toolbar,
|
|
4256
4290
|
{
|
|
4257
4291
|
...props,
|
|
@@ -4317,14 +4351,14 @@ function Toolbar({
|
|
|
4317
4351
|
item.run();
|
|
4318
4352
|
},
|
|
4319
4353
|
children: [
|
|
4320
|
-
item.icon !== void 0 && /* @__PURE__ */
|
|
4354
|
+
item.icon !== void 0 && /* @__PURE__ */ jsx26("span", { className: "gridkit-toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx26(MenuIcon, { name: item.icon }) }),
|
|
4321
4355
|
item.label
|
|
4322
4356
|
]
|
|
4323
4357
|
},
|
|
4324
4358
|
item.key
|
|
4325
4359
|
);
|
|
4326
4360
|
case "menu":
|
|
4327
|
-
return /* @__PURE__ */
|
|
4361
|
+
return /* @__PURE__ */ jsx26(
|
|
4328
4362
|
ToolbarMenuButton,
|
|
4329
4363
|
{
|
|
4330
4364
|
itemKey: item.key,
|
|
@@ -4337,7 +4371,7 @@ function Toolbar({
|
|
|
4337
4371
|
item.key
|
|
4338
4372
|
);
|
|
4339
4373
|
case "search":
|
|
4340
|
-
return /* @__PURE__ */
|
|
4374
|
+
return /* @__PURE__ */ jsx26(
|
|
4341
4375
|
ToolbarSearch,
|
|
4342
4376
|
{
|
|
4343
4377
|
itemKey: item.key,
|
|
@@ -4349,7 +4383,7 @@ function Toolbar({
|
|
|
4349
4383
|
item.key
|
|
4350
4384
|
);
|
|
4351
4385
|
case "separator":
|
|
4352
|
-
return /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ jsx26(
|
|
4353
4387
|
"div",
|
|
4354
4388
|
{
|
|
4355
4389
|
role: "separator",
|
|
@@ -4360,7 +4394,7 @@ function Toolbar({
|
|
|
4360
4394
|
item.key
|
|
4361
4395
|
);
|
|
4362
4396
|
case "spacer":
|
|
4363
|
-
return /* @__PURE__ */
|
|
4397
|
+
return /* @__PURE__ */ jsx26(
|
|
4364
4398
|
"div",
|
|
4365
4399
|
{
|
|
4366
4400
|
className: "gridkit-toolbar-spacer",
|
|
@@ -4369,7 +4403,7 @@ function Toolbar({
|
|
|
4369
4403
|
item.key
|
|
4370
4404
|
);
|
|
4371
4405
|
case "custom":
|
|
4372
|
-
return /* @__PURE__ */
|
|
4406
|
+
return /* @__PURE__ */ jsx26(
|
|
4373
4407
|
"div",
|
|
4374
4408
|
{
|
|
4375
4409
|
...item.attributes,
|
|
@@ -4391,7 +4425,7 @@ function Toolbar({
|
|
|
4391
4425
|
className: "gridkit-toolbar",
|
|
4392
4426
|
children: [
|
|
4393
4427
|
shown.map(draw),
|
|
4394
|
-
overflow.length > 0 && /* @__PURE__ */
|
|
4428
|
+
overflow.length > 0 && /* @__PURE__ */ jsx26(
|
|
4395
4429
|
ToolbarMenuButton,
|
|
4396
4430
|
{
|
|
4397
4431
|
itemKey: "more",
|
|
@@ -4735,7 +4769,7 @@ function useRowVirtualizer({
|
|
|
4735
4769
|
}
|
|
4736
4770
|
|
|
4737
4771
|
// src/DataGrid/DataGrid.tsx
|
|
4738
|
-
import { jsx as
|
|
4772
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4739
4773
|
var NO_AGGREGATES = [];
|
|
4740
4774
|
function paginationReader(controller) {
|
|
4741
4775
|
let last;
|
|
@@ -4773,6 +4807,12 @@ function tablesStyle(height, headerHeight, footerHeight, pinned) {
|
|
|
4773
4807
|
const style = { ...heights, ...widths };
|
|
4774
4808
|
return Object.keys(style).length === 0 ? void 0 : style;
|
|
4775
4809
|
}
|
|
4810
|
+
function emptyContext(view, filter, infiniteScroll) {
|
|
4811
|
+
if (view.pageRows.length > 0 || view.columns.length === 0 || infiniteScroll?.hasMore === true) {
|
|
4812
|
+
return null;
|
|
4813
|
+
}
|
|
4814
|
+
return { filtered: filter.length > 0 };
|
|
4815
|
+
}
|
|
4776
4816
|
function DataGrid(props) {
|
|
4777
4817
|
const {
|
|
4778
4818
|
borders,
|
|
@@ -4861,6 +4901,11 @@ function DataGrid(props) {
|
|
|
4861
4901
|
sentinelRef,
|
|
4862
4902
|
config: infiniteScroll
|
|
4863
4903
|
});
|
|
4904
|
+
const empty = emptyContext(view, state.filter, infiniteScroll);
|
|
4905
|
+
const emptyWidth = useElementWidth(
|
|
4906
|
+
gridRef,
|
|
4907
|
+
empty !== null && resizeMode !== "fit"
|
|
4908
|
+
);
|
|
4864
4909
|
function columnOf(columnId) {
|
|
4865
4910
|
return view.dataColumns.find((candidate) => candidate.id === columnId)?.column;
|
|
4866
4911
|
}
|
|
@@ -5140,7 +5185,7 @@ function DataGrid(props) {
|
|
|
5140
5185
|
ref: viewportRef,
|
|
5141
5186
|
tabIndex: -1,
|
|
5142
5187
|
children: [
|
|
5143
|
-
/* @__PURE__ */
|
|
5188
|
+
/* @__PURE__ */ jsx27(
|
|
5144
5189
|
GridToolbar,
|
|
5145
5190
|
{
|
|
5146
5191
|
toolbar: props.toolbar,
|
|
@@ -5152,7 +5197,7 @@ function DataGrid(props) {
|
|
|
5152
5197
|
announce
|
|
5153
5198
|
}
|
|
5154
5199
|
),
|
|
5155
|
-
showGroupByBar && /* @__PURE__ */
|
|
5200
|
+
showGroupByBar && /* @__PURE__ */ jsx27(
|
|
5156
5201
|
GroupByBar,
|
|
5157
5202
|
{
|
|
5158
5203
|
columns: view.columns,
|
|
@@ -5213,8 +5258,8 @@ function DataGrid(props) {
|
|
|
5213
5258
|
style: { width: totalColumnWidth(view.columns) },
|
|
5214
5259
|
className: classNames(gridTableClassName, "gridkit-data-grid-header"),
|
|
5215
5260
|
children: [
|
|
5216
|
-
/* @__PURE__ */
|
|
5217
|
-
/* @__PURE__ */
|
|
5261
|
+
/* @__PURE__ */ jsx27(GridColgroup, { columns: view.columns }),
|
|
5262
|
+
/* @__PURE__ */ jsx27(
|
|
5218
5263
|
GridHeader,
|
|
5219
5264
|
{
|
|
5220
5265
|
columns: view.columns,
|
|
@@ -5235,7 +5280,7 @@ function DataGrid(props) {
|
|
|
5235
5280
|
]
|
|
5236
5281
|
}
|
|
5237
5282
|
),
|
|
5238
|
-
/* @__PURE__ */
|
|
5283
|
+
/* @__PURE__ */ jsx27(
|
|
5239
5284
|
"div",
|
|
5240
5285
|
{
|
|
5241
5286
|
className: "gridkit-data-grid-body",
|
|
@@ -5250,8 +5295,8 @@ function DataGrid(props) {
|
|
|
5250
5295
|
style: { width: totalColumnWidth(view.columns) },
|
|
5251
5296
|
className: gridTableClassName,
|
|
5252
5297
|
children: [
|
|
5253
|
-
/* @__PURE__ */
|
|
5254
|
-
/* @__PURE__ */
|
|
5298
|
+
/* @__PURE__ */ jsx27(GridColgroup, { columns: view.columns }),
|
|
5299
|
+
/* @__PURE__ */ jsx27(
|
|
5255
5300
|
GridBody,
|
|
5256
5301
|
{
|
|
5257
5302
|
columns: view.columns,
|
|
@@ -5266,6 +5311,9 @@ function DataGrid(props) {
|
|
|
5266
5311
|
virtualRange: virtualized ? virtualizer : null,
|
|
5267
5312
|
infiniteScroll,
|
|
5268
5313
|
sentinelRef,
|
|
5314
|
+
empty,
|
|
5315
|
+
emptyTemplate: props.emptyTemplate,
|
|
5316
|
+
viewportWidth: viewportWidth ?? emptyWidth,
|
|
5269
5317
|
locale,
|
|
5270
5318
|
getRowProps,
|
|
5271
5319
|
onRowClick,
|
|
@@ -5291,8 +5339,8 @@ function DataGrid(props) {
|
|
|
5291
5339
|
"gridkit-data-grid-footer"
|
|
5292
5340
|
),
|
|
5293
5341
|
children: [
|
|
5294
|
-
/* @__PURE__ */
|
|
5295
|
-
/* @__PURE__ */
|
|
5342
|
+
/* @__PURE__ */ jsx27(GridColgroup, { columns: view.columns }),
|
|
5343
|
+
/* @__PURE__ */ jsx27(
|
|
5296
5344
|
GridFooter,
|
|
5297
5345
|
{
|
|
5298
5346
|
columns: view.columns,
|
|
@@ -5309,8 +5357,8 @@ function DataGrid(props) {
|
|
|
5309
5357
|
]
|
|
5310
5358
|
}
|
|
5311
5359
|
),
|
|
5312
|
-
/* @__PURE__ */
|
|
5313
|
-
/* @__PURE__ */
|
|
5360
|
+
/* @__PURE__ */ jsx27(GridContextMenu, { contextMenu }),
|
|
5361
|
+
/* @__PURE__ */ jsx27(
|
|
5314
5362
|
GridPanels,
|
|
5315
5363
|
{
|
|
5316
5364
|
panels,
|
|
@@ -5319,7 +5367,7 @@ function DataGrid(props) {
|
|
|
5319
5367
|
messages
|
|
5320
5368
|
}
|
|
5321
5369
|
),
|
|
5322
|
-
paginated && (pager?.template ? pager.template(pagerContext) : /* @__PURE__ */
|
|
5370
|
+
paginated && (pager?.template ? pager.template(pagerContext) : /* @__PURE__ */ jsx27(GridPager, { pager: pagerContext, config: pager, messages }))
|
|
5323
5371
|
]
|
|
5324
5372
|
}
|
|
5325
5373
|
);
|