@gridkitjs/react 0.0.0-dev-20261112193732 → 0.0.0-dev-20261112195026
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.js +215 -157
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
moveColumnBefore,
|
|
15
15
|
resolveColumnHeaderText as resolveColumnHeaderText2,
|
|
16
16
|
resolveMessages,
|
|
17
|
-
resolveRows
|
|
18
|
-
totalColumnWidth
|
|
17
|
+
resolveRows
|
|
19
18
|
} from "@gridkitjs/core";
|
|
19
|
+
import { totalColumnWidth } from "@gridkitjs/core/renderer";
|
|
20
20
|
|
|
21
21
|
// src/DataGrid/components/GridColgroup.tsx
|
|
22
22
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -27,15 +27,17 @@ function GridColgroup({ columns }) {
|
|
|
27
27
|
// src/DataGrid/components/GridHeader.tsx
|
|
28
28
|
import { createPortal } from "react-dom";
|
|
29
29
|
import {
|
|
30
|
-
buildKeyShortcuts,
|
|
31
30
|
headerFocus,
|
|
32
|
-
intentOf,
|
|
33
31
|
isColumnFiltered,
|
|
34
|
-
KEYBOARD_STEP,
|
|
35
|
-
resolveColumnFilterMenu,
|
|
36
32
|
sortDirectionFor,
|
|
37
33
|
sortPriorityFor
|
|
38
34
|
} from "@gridkitjs/core";
|
|
35
|
+
import {
|
|
36
|
+
buildKeyShortcuts,
|
|
37
|
+
intentOf,
|
|
38
|
+
KEYBOARD_STEP,
|
|
39
|
+
resolveColumnFilterMenu
|
|
40
|
+
} from "@gridkitjs/core/renderer";
|
|
39
41
|
|
|
40
42
|
// src/DataGrid/ariaAttr.ts
|
|
41
43
|
function ariaAttr(condition, key, value) {
|
|
@@ -174,7 +176,7 @@ function GridHeader({
|
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
return /* @__PURE__ */ jsxs2("thead", { role: "rowgroup", children: [
|
|
177
|
-
/* @__PURE__ */ jsx3("tr", { className: "grid-header", role: "row", "aria-rowindex": 1, children: columns.map((entry, index) => {
|
|
179
|
+
/* @__PURE__ */ jsx3("tr", { className: "gridkit-grid-header", role: "row", "aria-rowindex": 1, children: columns.map((entry, index) => {
|
|
178
180
|
const { column } = entry;
|
|
179
181
|
const resizing = resize.activeColumnId === entry.id;
|
|
180
182
|
const dragging = drag.draggedColumnId === entry.id;
|
|
@@ -219,7 +221,7 @@ function GridHeader({
|
|
|
219
221
|
if (drag.justDragged(entry.id)) {
|
|
220
222
|
return;
|
|
221
223
|
}
|
|
222
|
-
if (event.target instanceof Element && (event.target.closest(".header-resize-handle") !== null || event.target.closest(".header-sort-toggle") !== null || event.target.closest(".header-group-toggle") !== null || event.target.closest(".header-filter-toggle") !== null)) {
|
|
224
|
+
if (event.target instanceof Element && (event.target.closest(".gridkit-header-resize-handle") !== null || event.target.closest(".gridkit-header-sort-toggle") !== null || event.target.closest(".gridkit-header-group-toggle") !== null || event.target.closest(".gridkit-header-filter-toggle") !== null)) {
|
|
223
225
|
return;
|
|
224
226
|
}
|
|
225
227
|
selection.selectColumn(entry.id, intentOf(event));
|
|
@@ -271,7 +273,7 @@ function GridHeader({
|
|
|
271
273
|
nav.onKeyDown(event);
|
|
272
274
|
},
|
|
273
275
|
className: classNames(
|
|
274
|
-
"header-cell",
|
|
276
|
+
"gridkit-header-cell",
|
|
275
277
|
// The grab affordance a header showing either drag
|
|
276
278
|
// destination shares — a column dragged only for grouping
|
|
277
279
|
// (`groupByDraggable` without `reorderable`) grabs the same
|
|
@@ -315,7 +317,7 @@ function GridHeader({
|
|
|
315
317
|
"span",
|
|
316
318
|
{
|
|
317
319
|
className: classNames(
|
|
318
|
-
"header-group-toggle",
|
|
320
|
+
"gridkit-header-group-toggle",
|
|
319
321
|
isGrouped ? "is-grouped" : ""
|
|
320
322
|
),
|
|
321
323
|
"aria-hidden": "true",
|
|
@@ -341,7 +343,7 @@ function GridHeader({
|
|
|
341
343
|
"span",
|
|
342
344
|
{
|
|
343
345
|
className: classNames(
|
|
344
|
-
"header-sort-toggle",
|
|
346
|
+
"gridkit-header-sort-toggle",
|
|
345
347
|
sortDirection !== null ? `is-sorted-${sortDirection}` : ""
|
|
346
348
|
),
|
|
347
349
|
"aria-hidden": "true",
|
|
@@ -356,7 +358,7 @@ function GridHeader({
|
|
|
356
358
|
},
|
|
357
359
|
children: [
|
|
358
360
|
sortDirection === null ? /* @__PURE__ */ jsx3(ChevronsUpDownIcon, {}) : /* @__PURE__ */ jsx3(ChevronUpIcon, {}),
|
|
359
|
-
sortPriority !== null && sortPriority > 1 && /* @__PURE__ */ jsx3("span", { className: "header-sort-priority", children: sortPriority })
|
|
361
|
+
sortPriority !== null && sortPriority > 1 && /* @__PURE__ */ jsx3("span", { className: "gridkit-header-sort-priority", children: sortPriority })
|
|
360
362
|
]
|
|
361
363
|
}
|
|
362
364
|
),
|
|
@@ -370,7 +372,7 @@ function GridHeader({
|
|
|
370
372
|
"span",
|
|
371
373
|
{
|
|
372
374
|
className: classNames(
|
|
373
|
-
"header-filter-toggle",
|
|
375
|
+
"gridkit-header-filter-toggle",
|
|
374
376
|
filtered ? "is-filtered" : ""
|
|
375
377
|
),
|
|
376
378
|
"aria-hidden": "true",
|
|
@@ -393,7 +395,7 @@ function GridHeader({
|
|
|
393
395
|
/* @__PURE__ */ jsx3(
|
|
394
396
|
"span",
|
|
395
397
|
{
|
|
396
|
-
className: "header-resize-handle",
|
|
398
|
+
className: "gridkit-header-resize-handle",
|
|
397
399
|
"aria-hidden": "true",
|
|
398
400
|
tabIndex: -1,
|
|
399
401
|
onPointerDown: (event) => {
|
|
@@ -413,7 +415,7 @@ function GridHeader({
|
|
|
413
415
|
/* @__PURE__ */ jsx3(
|
|
414
416
|
"div",
|
|
415
417
|
{
|
|
416
|
-
className: "gridkit-data-grid header-cell drag-ghost",
|
|
418
|
+
className: "gridkit-data-grid gridkit-header-cell gridkit-drag-ghost",
|
|
417
419
|
style: {
|
|
418
420
|
width: draggedEntry.width,
|
|
419
421
|
transform: drag.ghostTransform
|
|
@@ -434,9 +436,9 @@ import {
|
|
|
434
436
|
} from "react";
|
|
435
437
|
import {
|
|
436
438
|
bodyFocus,
|
|
437
|
-
groupRowId
|
|
438
|
-
intentOf as intentOf2
|
|
439
|
+
groupRowId
|
|
439
440
|
} from "@gridkitjs/core";
|
|
441
|
+
import { intentOf as intentOf2 } from "@gridkitjs/core/renderer";
|
|
440
442
|
import {
|
|
441
443
|
bodyCellFrom,
|
|
442
444
|
bodyRowFrom,
|
|
@@ -613,7 +615,7 @@ function GridGroupRowComponent({
|
|
|
613
615
|
"data-gridkit-group": groupId,
|
|
614
616
|
"data-gridkit-row-index": rowIndex,
|
|
615
617
|
className: classNames(
|
|
616
|
-
"grid-group-row",
|
|
618
|
+
"gridkit-grid-group-row",
|
|
617
619
|
`is-group-level-${String(level)}`
|
|
618
620
|
),
|
|
619
621
|
children: /* @__PURE__ */ jsx4(
|
|
@@ -623,35 +625,35 @@ function GridGroupRowComponent({
|
|
|
623
625
|
colSpan: columnCount,
|
|
624
626
|
tabIndex: focused ? 0 : -1,
|
|
625
627
|
"aria-keyshortcuts": contextMenu ? "Space Enter Shift+F10" : "Space Enter",
|
|
626
|
-
className: "grid-group-cell",
|
|
628
|
+
className: "gridkit-grid-group-cell",
|
|
627
629
|
children: /* @__PURE__ */ jsxs3(
|
|
628
630
|
"div",
|
|
629
631
|
{
|
|
630
|
-
className: "grid-group-cell-content",
|
|
632
|
+
className: "gridkit-grid-group-cell-content",
|
|
631
633
|
style: { paddingInlineStart: `${String(level * 1.25 + 0.5)}rem` },
|
|
632
634
|
children: [
|
|
633
635
|
/* @__PURE__ */ jsx4(
|
|
634
636
|
"span",
|
|
635
637
|
{
|
|
636
638
|
className: classNames(
|
|
637
|
-
"group-toggle",
|
|
639
|
+
"gridkit-group-toggle",
|
|
638
640
|
expanded ? "is-expanded" : "is-collapsed"
|
|
639
641
|
),
|
|
640
642
|
"aria-hidden": "true"
|
|
641
643
|
}
|
|
642
644
|
),
|
|
643
|
-
/* @__PURE__ */ jsxs3("span", { className: "group-label", children: [
|
|
645
|
+
/* @__PURE__ */ jsxs3("span", { className: "gridkit-group-label", children: [
|
|
644
646
|
resolveColumnLabel(groupColumn),
|
|
645
647
|
":",
|
|
646
648
|
" ",
|
|
647
649
|
formatGroupValue(value, groupColumn, locale, cellMessages)
|
|
648
650
|
] }),
|
|
649
|
-
/* @__PURE__ */ jsxs3("span", { className: "group-count", children: [
|
|
651
|
+
/* @__PURE__ */ jsxs3("span", { className: "gridkit-group-count", children: [
|
|
650
652
|
"(",
|
|
651
653
|
count,
|
|
652
654
|
")"
|
|
653
655
|
] }),
|
|
654
|
-
aggregates.length > 0 && /* @__PURE__ */ jsx4("span", { className: "group-aggregates", children: aggregates.map((spec) => {
|
|
656
|
+
aggregates.length > 0 && /* @__PURE__ */ jsx4("span", { className: "gridkit-group-aggregates", children: aggregates.map((spec) => {
|
|
655
657
|
const key = spec.id ?? spec.columnId;
|
|
656
658
|
const aggregateValue = results.get(key);
|
|
657
659
|
const column = definitions.get(spec.columnId);
|
|
@@ -663,7 +665,7 @@ function GridGroupRowComponent({
|
|
|
663
665
|
locale
|
|
664
666
|
);
|
|
665
667
|
const aggregateLabel = spec.id ?? (column === void 0 ? spec.columnId : resolveColumnLabel(column));
|
|
666
|
-
return /* @__PURE__ */ jsxs3("span", { className: "group-aggregate", children: [
|
|
668
|
+
return /* @__PURE__ */ jsxs3("span", { className: "gridkit-group-aggregate", children: [
|
|
667
669
|
aggregateLabel,
|
|
668
670
|
": ",
|
|
669
671
|
rendered
|
|
@@ -705,7 +707,7 @@ function GridGroupSummaryRowComponent({
|
|
|
705
707
|
"data-gridkit-group-summary": groupId,
|
|
706
708
|
"data-gridkit-row-index": rowIndex,
|
|
707
709
|
className: classNames(
|
|
708
|
-
"grid-group-summary-row",
|
|
710
|
+
"gridkit-grid-group-summary-row",
|
|
709
711
|
`is-group-level-${String(level)}`
|
|
710
712
|
),
|
|
711
713
|
children: columns.map((entry) => {
|
|
@@ -717,13 +719,13 @@ function GridGroupSummaryRowComponent({
|
|
|
717
719
|
{
|
|
718
720
|
role: "gridcell",
|
|
719
721
|
"data-gridkit-column": entry.id,
|
|
720
|
-
className: "grid-group-summary-cell",
|
|
722
|
+
className: "gridkit-grid-group-summary-cell",
|
|
721
723
|
style: { textAlign: specs[0]?.alignment ?? entry.alignment },
|
|
722
724
|
children: [
|
|
723
725
|
entry.id === columns[0]?.id && /* @__PURE__ */ jsx5(
|
|
724
726
|
"span",
|
|
725
727
|
{
|
|
726
|
-
className: "grid-group-summary-indent",
|
|
728
|
+
className: "gridkit-grid-group-summary-indent",
|
|
727
729
|
style: { width: `${String(level * 1.25 + 0.5)}rem` },
|
|
728
730
|
"aria-hidden": "true"
|
|
729
731
|
}
|
|
@@ -794,7 +796,7 @@ function GridRowComponent({
|
|
|
794
796
|
"data-gridkit-row-id": rowId,
|
|
795
797
|
...ariaAttr(rowsSelectable, "aria-selected", selected),
|
|
796
798
|
className: classNames(
|
|
797
|
-
"grid-row",
|
|
799
|
+
"gridkit-grid-row",
|
|
798
800
|
selected ? "is-selected" : "",
|
|
799
801
|
rowClassName
|
|
800
802
|
),
|
|
@@ -811,7 +813,7 @@ function GridRowComponent({
|
|
|
811
813
|
...ariaAttr(cellsSelectable, "aria-selected", cellSelected),
|
|
812
814
|
...ariaAttr(shortcuts !== "", "aria-keyshortcuts", shortcuts),
|
|
813
815
|
className: classNames(
|
|
814
|
-
"grid-cell",
|
|
816
|
+
"gridkit-grid-cell",
|
|
815
817
|
id === activeColumnId ? "is-resizing" : "",
|
|
816
818
|
cellSelected || selectedColumnIds.has(id) ? "is-selected" : "",
|
|
817
819
|
column.wrap?.cells ? "is-wrapped" : "",
|
|
@@ -940,7 +942,7 @@ function GridBody({
|
|
|
940
942
|
"tbody",
|
|
941
943
|
{
|
|
942
944
|
role: "rowgroup",
|
|
943
|
-
className: "grid-body",
|
|
945
|
+
className: "gridkit-grid-body",
|
|
944
946
|
onFocus: (event) => {
|
|
945
947
|
const group = groupRowFrom(event.target);
|
|
946
948
|
if (group !== null) {
|
|
@@ -1103,13 +1105,20 @@ function GridBody({
|
|
|
1103
1105
|
}
|
|
1104
1106
|
) }),
|
|
1105
1107
|
infiniteScroll?.hasMore && /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1106
|
-
infiniteScroll.isLoadingMore === true && /* @__PURE__ */ jsx7("tr", { "aria-hidden": "true", className: "grid-loading-row", children: /* @__PURE__ */ jsx7(
|
|
1108
|
+
infiniteScroll.isLoadingMore === true && /* @__PURE__ */ jsx7("tr", { "aria-hidden": "true", className: "gridkit-grid-loading-row", children: /* @__PURE__ */ jsx7(
|
|
1109
|
+
"td",
|
|
1110
|
+
{
|
|
1111
|
+
colSpan: columns.length,
|
|
1112
|
+
className: "gridkit-grid-loading-cell",
|
|
1113
|
+
children: infiniteScroll.loadingTemplate ? infiniteScroll.loadingTemplate() : messages.loadingMore
|
|
1114
|
+
}
|
|
1115
|
+
) }),
|
|
1107
1116
|
/* @__PURE__ */ jsx7(
|
|
1108
1117
|
"tr",
|
|
1109
1118
|
{
|
|
1110
1119
|
"aria-hidden": "true",
|
|
1111
1120
|
ref: sentinelRef,
|
|
1112
|
-
className: "grid-sentinel-row",
|
|
1121
|
+
className: "gridkit-grid-sentinel-row",
|
|
1113
1122
|
children: /* @__PURE__ */ jsx7(
|
|
1114
1123
|
"td",
|
|
1115
1124
|
{
|
|
@@ -1135,36 +1144,44 @@ function GridFooter({
|
|
|
1135
1144
|
locale,
|
|
1136
1145
|
ariaRowIndex
|
|
1137
1146
|
}) {
|
|
1138
|
-
return /* @__PURE__ */ jsx8("tfoot", { role: "rowgroup", children: /* @__PURE__ */ jsx8(
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
"
|
|
1144
|
-
{
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1147
|
+
return /* @__PURE__ */ jsx8("tfoot", { role: "rowgroup", children: /* @__PURE__ */ jsx8(
|
|
1148
|
+
"tr",
|
|
1149
|
+
{
|
|
1150
|
+
className: "gridkit-grid-footer",
|
|
1151
|
+
role: "row",
|
|
1152
|
+
"aria-rowindex": ariaRowIndex,
|
|
1153
|
+
children: columns.map((entry) => {
|
|
1154
|
+
const specs = aggregates.filter(
|
|
1155
|
+
(candidate) => candidate.columnId === entry.id
|
|
1156
|
+
);
|
|
1157
|
+
return /* @__PURE__ */ jsx8(
|
|
1158
|
+
"td",
|
|
1159
|
+
{
|
|
1160
|
+
role: "gridcell",
|
|
1161
|
+
"data-gridkit-column": entry.id,
|
|
1162
|
+
className: "gridkit-grid-footer-cell",
|
|
1163
|
+
style: { textAlign: specs[0]?.alignment ?? entry.alignment },
|
|
1164
|
+
children: specs.map(
|
|
1165
|
+
(spec) => renderAggregate(
|
|
1166
|
+
results.get(spec.id ?? spec.columnId),
|
|
1167
|
+
spec,
|
|
1168
|
+
entry.column,
|
|
1169
|
+
rows,
|
|
1170
|
+
locale
|
|
1171
|
+
)
|
|
1172
|
+
).flatMap(
|
|
1173
|
+
(rendered, index) => index === 0 ? [rendered] : [", ", rendered]
|
|
1174
|
+
)
|
|
1175
|
+
},
|
|
1176
|
+
entry.id
|
|
1177
|
+
);
|
|
1178
|
+
})
|
|
1179
|
+
}
|
|
1180
|
+
) });
|
|
1164
1181
|
}
|
|
1165
1182
|
|
|
1166
1183
|
// src/DataGrid/components/GridPager.tsx
|
|
1167
|
-
import { paginationWindow } from "@gridkitjs/core";
|
|
1184
|
+
import { paginationWindow } from "@gridkitjs/core/renderer";
|
|
1168
1185
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1169
1186
|
function PagerNavButton({
|
|
1170
1187
|
className,
|
|
@@ -1177,7 +1194,7 @@ function PagerNavButton({
|
|
|
1177
1194
|
"button",
|
|
1178
1195
|
{
|
|
1179
1196
|
type: "button",
|
|
1180
|
-
className: `grid-pager-button grid-pager-nav ${className}`,
|
|
1197
|
+
className: `gridkit-grid-pager-button gridkit-grid-pager-nav ${className}`,
|
|
1181
1198
|
"aria-label": label,
|
|
1182
1199
|
title: label,
|
|
1183
1200
|
...ariaAttr(disabled, "aria-disabled", true),
|
|
@@ -1204,11 +1221,11 @@ function GridPager({ pager, config, messages }) {
|
|
|
1204
1221
|
role: "group",
|
|
1205
1222
|
"aria-label": messages.pagerLabel,
|
|
1206
1223
|
children: [
|
|
1207
|
-
/* @__PURE__ */ jsxs6("div", { className: "grid-pager-bar", style: barStyle, children: [
|
|
1224
|
+
/* @__PURE__ */ jsxs6("div", { className: "gridkit-grid-pager-bar", style: barStyle, children: [
|
|
1208
1225
|
/* @__PURE__ */ jsx9(
|
|
1209
1226
|
PagerNavButton,
|
|
1210
1227
|
{
|
|
1211
|
-
className: "grid-pager-first",
|
|
1228
|
+
className: "gridkit-grid-pager-first",
|
|
1212
1229
|
label: messages.firstPage,
|
|
1213
1230
|
disabled: atFirst,
|
|
1214
1231
|
onClick: () => {
|
|
@@ -1220,7 +1237,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1220
1237
|
/* @__PURE__ */ jsx9(
|
|
1221
1238
|
PagerNavButton,
|
|
1222
1239
|
{
|
|
1223
|
-
className: "grid-pager-previous",
|
|
1240
|
+
className: "gridkit-grid-pager-previous",
|
|
1224
1241
|
label: messages.previousPage,
|
|
1225
1242
|
disabled: atFirst,
|
|
1226
1243
|
onClick: () => {
|
|
@@ -1236,7 +1253,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1236
1253
|
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx9(
|
|
1237
1254
|
"span",
|
|
1238
1255
|
{
|
|
1239
|
-
className: "grid-pager-ellipsis",
|
|
1256
|
+
className: "gridkit-grid-pager-ellipsis",
|
|
1240
1257
|
"aria-hidden": "true",
|
|
1241
1258
|
children: "\u2026"
|
|
1242
1259
|
},
|
|
@@ -1245,7 +1262,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1245
1262
|
"button",
|
|
1246
1263
|
{
|
|
1247
1264
|
type: "button",
|
|
1248
|
-
className: "grid-pager-button grid-pager-page",
|
|
1265
|
+
className: "gridkit-grid-pager-button gridkit-grid-pager-page",
|
|
1249
1266
|
"aria-label": messages.pageButtonLabel(entry),
|
|
1250
1267
|
"aria-current": entry === currentPage ? "page" : void 0,
|
|
1251
1268
|
onClick: () => {
|
|
@@ -1255,17 +1272,24 @@ function GridPager({ pager, config, messages }) {
|
|
|
1255
1272
|
},
|
|
1256
1273
|
entry
|
|
1257
1274
|
)
|
|
1258
|
-
) : /* @__PURE__ */ jsxs6("span", { className: "grid-pager-status-slot", children: [
|
|
1259
|
-
/* @__PURE__ */ jsx9("span", { className: "grid-pager-status", children: messages.pageStatus(
|
|
1275
|
+
) : /* @__PURE__ */ jsxs6("span", { className: "gridkit-grid-pager-status-slot", children: [
|
|
1276
|
+
/* @__PURE__ */ jsx9("span", { className: "gridkit-grid-pager-status", children: messages.pageStatus(
|
|
1260
1277
|
pageCount === 0 ? 0 : currentPage,
|
|
1261
1278
|
pageCount
|
|
1262
1279
|
) }),
|
|
1263
|
-
/* @__PURE__ */ jsx9(
|
|
1280
|
+
/* @__PURE__ */ jsx9(
|
|
1281
|
+
"span",
|
|
1282
|
+
{
|
|
1283
|
+
className: "gridkit-grid-pager-status-sizer",
|
|
1284
|
+
"aria-hidden": "true",
|
|
1285
|
+
children: messages.pageStatus(pageCount, pageCount)
|
|
1286
|
+
}
|
|
1287
|
+
)
|
|
1264
1288
|
] }),
|
|
1265
1289
|
/* @__PURE__ */ jsx9(
|
|
1266
1290
|
PagerNavButton,
|
|
1267
1291
|
{
|
|
1268
|
-
className: "grid-pager-next",
|
|
1292
|
+
className: "gridkit-grid-pager-next",
|
|
1269
1293
|
label: messages.nextPage,
|
|
1270
1294
|
disabled: atLast,
|
|
1271
1295
|
onClick: () => {
|
|
@@ -1277,7 +1301,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1277
1301
|
/* @__PURE__ */ jsx9(
|
|
1278
1302
|
PagerNavButton,
|
|
1279
1303
|
{
|
|
1280
|
-
className: "grid-pager-last",
|
|
1304
|
+
className: "gridkit-grid-pager-last",
|
|
1281
1305
|
label: messages.lastPage,
|
|
1282
1306
|
disabled: atLast,
|
|
1283
1307
|
onClick: () => {
|
|
@@ -1287,7 +1311,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1287
1311
|
}
|
|
1288
1312
|
)
|
|
1289
1313
|
] }),
|
|
1290
|
-
sizeOptions !== void 0 && sizeOptions.length > 0 && /* @__PURE__ */ jsxs6("label", { className: "grid-pager-page-size", children: [
|
|
1314
|
+
sizeOptions !== void 0 && sizeOptions.length > 0 && /* @__PURE__ */ jsxs6("label", { className: "gridkit-grid-pager-page-size", children: [
|
|
1291
1315
|
/* @__PURE__ */ jsx9(
|
|
1292
1316
|
"select",
|
|
1293
1317
|
{
|
|
@@ -1298,7 +1322,7 @@ function GridPager({ pager, config, messages }) {
|
|
|
1298
1322
|
children: sizeOptions.map((size) => /* @__PURE__ */ jsx9("option", { value: size, children: size }, size))
|
|
1299
1323
|
}
|
|
1300
1324
|
),
|
|
1301
|
-
/* @__PURE__ */ jsx9("span", { className: "grid-pager-page-size-label", children: messages.pageSizeLabel })
|
|
1325
|
+
/* @__PURE__ */ jsx9("span", { className: "gridkit-grid-pager-page-size-label", children: messages.pageSizeLabel })
|
|
1302
1326
|
] })
|
|
1303
1327
|
]
|
|
1304
1328
|
}
|
|
@@ -1308,9 +1332,9 @@ function GridPager({ pager, config, messages }) {
|
|
|
1308
1332
|
// src/DataGrid/components/GroupByBar.tsx
|
|
1309
1333
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1310
1334
|
import {
|
|
1311
|
-
resolveColumnLabel as resolveColumnLabel2
|
|
1312
|
-
resolveKeyboardDropTarget
|
|
1335
|
+
resolveColumnLabel as resolveColumnLabel2
|
|
1313
1336
|
} from "@gridkitjs/core";
|
|
1337
|
+
import { resolveKeyboardDropTarget } from "@gridkitjs/core/renderer";
|
|
1314
1338
|
|
|
1315
1339
|
// src/DataGrid/useGroupByDrag.ts
|
|
1316
1340
|
import {
|
|
@@ -1475,7 +1499,7 @@ function GroupByBar({
|
|
|
1475
1499
|
role: "group",
|
|
1476
1500
|
"aria-label": messages.groupByBarLabel,
|
|
1477
1501
|
children: [
|
|
1478
|
-
showPlaceholder && /* @__PURE__ */ jsx10("span", { className: "group-by-bar-placeholder", children: messages.groupByBarPlaceholder }),
|
|
1502
|
+
showPlaceholder && /* @__PURE__ */ jsx10("span", { className: "gridkit-group-by-bar-placeholder", children: messages.groupByBarPlaceholder }),
|
|
1479
1503
|
groupBy.map((entry, index) => {
|
|
1480
1504
|
const dropBefore = activeDropTarget?.beforeColumnId === entry.columnId;
|
|
1481
1505
|
const dropAfter = activeDropTarget?.beforeColumnId === null && index === groupBy.length - 1;
|
|
@@ -1484,7 +1508,7 @@ function GroupByBar({
|
|
|
1484
1508
|
"span",
|
|
1485
1509
|
{
|
|
1486
1510
|
className: classNames(
|
|
1487
|
-
"group-by-chip",
|
|
1511
|
+
"gridkit-group-by-chip",
|
|
1488
1512
|
dragging ? "is-dragging" : "",
|
|
1489
1513
|
dropBefore ? "is-drop-before" : "",
|
|
1490
1514
|
dropAfter ? "is-drop-after" : ""
|
|
@@ -1511,12 +1535,12 @@ function GroupByBar({
|
|
|
1511
1535
|
}
|
|
1512
1536
|
},
|
|
1513
1537
|
children: [
|
|
1514
|
-
/* @__PURE__ */ jsx10("span", { className: "group-by-chip-label", children: labelFor(entry.columnId) }),
|
|
1538
|
+
/* @__PURE__ */ jsx10("span", { className: "gridkit-group-by-chip-label", children: labelFor(entry.columnId) }),
|
|
1515
1539
|
/* @__PURE__ */ jsx10(
|
|
1516
1540
|
"button",
|
|
1517
1541
|
{
|
|
1518
1542
|
type: "button",
|
|
1519
|
-
className: "group-by-chip-remove",
|
|
1543
|
+
className: "gridkit-group-by-chip-remove",
|
|
1520
1544
|
"aria-label": messages.removeGroupBy(columnName(entry.columnId)),
|
|
1521
1545
|
onPointerDown: (event) => {
|
|
1522
1546
|
event.stopPropagation();
|
|
@@ -1536,7 +1560,7 @@ function GroupByBar({
|
|
|
1536
1560
|
/* @__PURE__ */ jsx10(
|
|
1537
1561
|
"span",
|
|
1538
1562
|
{
|
|
1539
|
-
className: "group-by-chip drag-ghost",
|
|
1563
|
+
className: "gridkit-group-by-chip gridkit-drag-ghost",
|
|
1540
1564
|
style: { transform: chipDrag.ghostTransform },
|
|
1541
1565
|
"aria-hidden": "true",
|
|
1542
1566
|
children: labelFor(chipDrag.draggedColumnId)
|
|
@@ -2111,17 +2135,17 @@ function MenuItem({
|
|
|
2111
2135
|
{
|
|
2112
2136
|
role: checked === void 0 ? "menuitem" : "menuitemcheckbox",
|
|
2113
2137
|
"data-gridkit-menu-item": entry.id,
|
|
2114
|
-
className: "menu-item",
|
|
2138
|
+
className: "gridkit-menu-item",
|
|
2115
2139
|
...ariaAttr(isItem2 && entry.disabled, "aria-disabled", true),
|
|
2116
2140
|
...ariaAttr(checked !== void 0, "aria-checked", checked),
|
|
2117
2141
|
...ariaAttr(shortcut !== void 0, "aria-keyshortcuts", shortcut),
|
|
2118
2142
|
...ariaAttr(!isItem2, "aria-haspopup", "menu"),
|
|
2119
2143
|
...ariaAttr(!isItem2, "aria-expanded", expanded),
|
|
2120
2144
|
children: [
|
|
2121
|
-
/* @__PURE__ */ jsx13("span", { className: "menu-item-icon", "aria-hidden": "true", children: checked === true ? /* @__PURE__ */ jsx13(CheckIcon, {}) : /* @__PURE__ */ jsx13(MenuIcon, { name: entry.icon }) }),
|
|
2122
|
-
/* @__PURE__ */ jsx13("span", { className: "menu-item-label", children: entry.label }),
|
|
2123
|
-
shortcut !== void 0 && /* @__PURE__ */ jsx13("span", { className: "menu-item-shortcut", "aria-hidden": "true", children: shortcut }),
|
|
2124
|
-
!isItem2 && /* @__PURE__ */ jsx13("span", { className: "menu-submenu-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx13(ChevronRightIcon2, {}) })
|
|
2145
|
+
/* @__PURE__ */ jsx13("span", { className: "gridkit-menu-item-icon", "aria-hidden": "true", children: checked === true ? /* @__PURE__ */ jsx13(CheckIcon, {}) : /* @__PURE__ */ jsx13(MenuIcon, { name: entry.icon }) }),
|
|
2146
|
+
/* @__PURE__ */ jsx13("span", { className: "gridkit-menu-item-label", children: entry.label }),
|
|
2147
|
+
shortcut !== void 0 && /* @__PURE__ */ jsx13("span", { className: "gridkit-menu-item-shortcut", "aria-hidden": "true", children: shortcut }),
|
|
2148
|
+
!isItem2 && /* @__PURE__ */ jsx13("span", { className: "gridkit-menu-submenu-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx13(ChevronRightIcon2, {}) })
|
|
2125
2149
|
]
|
|
2126
2150
|
}
|
|
2127
2151
|
);
|
|
@@ -2224,7 +2248,14 @@ function GridMenu({
|
|
|
2224
2248
|
"aria-label": label,
|
|
2225
2249
|
className: "gridkit-menu",
|
|
2226
2250
|
children: entries.map(
|
|
2227
|
-
(entry) => entry.type === "separator" ? /* @__PURE__ */ jsx13(
|
|
2251
|
+
(entry) => entry.type === "separator" ? /* @__PURE__ */ jsx13(
|
|
2252
|
+
"div",
|
|
2253
|
+
{
|
|
2254
|
+
role: "separator",
|
|
2255
|
+
className: "gridkit-menu-separator"
|
|
2256
|
+
},
|
|
2257
|
+
entry.key
|
|
2258
|
+
) : /* @__PURE__ */ jsx13(
|
|
2228
2259
|
MenuItem,
|
|
2229
2260
|
{
|
|
2230
2261
|
entry,
|
|
@@ -2304,10 +2335,10 @@ import {
|
|
|
2304
2335
|
} from "react";
|
|
2305
2336
|
import {
|
|
2306
2337
|
contextMenuEntries,
|
|
2307
|
-
hasContextMenu,
|
|
2308
2338
|
isSameCell,
|
|
2309
2339
|
resolveMenu
|
|
2310
2340
|
} from "@gridkitjs/core";
|
|
2341
|
+
import { hasContextMenu } from "@gridkitjs/core/renderer";
|
|
2311
2342
|
import {
|
|
2312
2343
|
attachContextMenuTrigger
|
|
2313
2344
|
} from "@gridkitjs/dom";
|
|
@@ -2627,7 +2658,7 @@ import { useRef as useRef15 } from "react";
|
|
|
2627
2658
|
|
|
2628
2659
|
// src/DataGrid/columnChooser/ColumnChooser.tsx
|
|
2629
2660
|
import { useLayoutEffect as useLayoutEffect7, useRef as useRef9, useState as useState6 } from "react";
|
|
2630
|
-
import { resolveColumnChooser } from "@gridkitjs/core";
|
|
2661
|
+
import { resolveColumnChooser } from "@gridkitjs/core/renderer";
|
|
2631
2662
|
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2632
2663
|
function ColumnChooser({
|
|
2633
2664
|
controller,
|
|
@@ -2663,7 +2694,7 @@ function ColumnChooser({
|
|
|
2663
2694
|
"input",
|
|
2664
2695
|
{
|
|
2665
2696
|
type: "search",
|
|
2666
|
-
className: "column-chooser-search",
|
|
2697
|
+
className: "gridkit-column-chooser-search",
|
|
2667
2698
|
"aria-label": messages.columnChooserSearchLabel,
|
|
2668
2699
|
placeholder: messages.searchPlaceholder,
|
|
2669
2700
|
value: search,
|
|
@@ -2672,8 +2703,8 @@ function ColumnChooser({
|
|
|
2672
2703
|
}
|
|
2673
2704
|
}
|
|
2674
2705
|
),
|
|
2675
|
-
entries.length === 0 ? /* @__PURE__ */ jsx15("p", { role: "status", className: "column-chooser-empty", children: messages.noMatchingColumns }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2676
|
-
/* @__PURE__ */ jsxs10("label", { className: "column-chooser-option column-chooser-all", children: [
|
|
2706
|
+
entries.length === 0 ? /* @__PURE__ */ jsx15("p", { role: "status", className: "gridkit-column-chooser-empty", children: messages.noMatchingColumns }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2707
|
+
/* @__PURE__ */ jsxs10("label", { className: "gridkit-column-chooser-option gridkit-column-chooser-all", children: [
|
|
2677
2708
|
/* @__PURE__ */ jsx15(
|
|
2678
2709
|
"input",
|
|
2679
2710
|
{
|
|
@@ -2690,7 +2721,7 @@ function ColumnChooser({
|
|
|
2690
2721
|
),
|
|
2691
2722
|
messages.showAllColumns
|
|
2692
2723
|
] }),
|
|
2693
|
-
/* @__PURE__ */ jsx15("ul", { className: "column-chooser-list", children: entries.map((entry) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs10("label", { className: "column-chooser-option", children: [
|
|
2724
|
+
/* @__PURE__ */ jsx15("ul", { className: "gridkit-column-chooser-list", children: entries.map((entry) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs10("label", { className: "gridkit-column-chooser-option", children: [
|
|
2694
2725
|
/* @__PURE__ */ jsx15(
|
|
2695
2726
|
"input",
|
|
2696
2727
|
{
|
|
@@ -2713,10 +2744,10 @@ function ColumnChooser({
|
|
|
2713
2744
|
// src/DataGrid/filterMenu/FilterMenu.tsx
|
|
2714
2745
|
import { useEffect as useEffect4, useRef as useRef14 } from "react";
|
|
2715
2746
|
import {
|
|
2716
|
-
resolveColumnFilterMenu as resolveColumnFilterMenu2,
|
|
2717
2747
|
resolveColumnHeaderText,
|
|
2718
2748
|
resolveMenu as resolveMenu2
|
|
2719
2749
|
} from "@gridkitjs/core";
|
|
2750
|
+
import { resolveColumnFilterMenu as resolveColumnFilterMenu2 } from "@gridkitjs/core/renderer";
|
|
2720
2751
|
|
|
2721
2752
|
// src/DataGrid/filterMenu/ExcelFilterEditor.tsx
|
|
2722
2753
|
import {
|
|
@@ -2732,7 +2763,7 @@ import {
|
|
|
2732
2763
|
filterChecklist,
|
|
2733
2764
|
filterDraftChanged as filterDraftChanged3,
|
|
2734
2765
|
selectAllState
|
|
2735
|
-
} from "@gridkitjs/core";
|
|
2766
|
+
} from "@gridkitjs/core/renderer";
|
|
2736
2767
|
|
|
2737
2768
|
// src/DataGrid/filterMenu/excelEditorState.ts
|
|
2738
2769
|
import {
|
|
@@ -2741,7 +2772,7 @@ import {
|
|
|
2741
2772
|
filterEditorReducer,
|
|
2742
2773
|
initialFilterEditorDraft,
|
|
2743
2774
|
toValuesDraft
|
|
2744
|
-
} from "@gridkitjs/core";
|
|
2775
|
+
} from "@gridkitjs/core/renderer";
|
|
2745
2776
|
function openValues(filter, columnId, values) {
|
|
2746
2777
|
const shape = describeColumnFilter(filter, columnId);
|
|
2747
2778
|
return {
|
|
@@ -2856,12 +2887,19 @@ function OperatorMenuButton({
|
|
|
2856
2887
|
{
|
|
2857
2888
|
ref,
|
|
2858
2889
|
type: "button",
|
|
2859
|
-
className: "filter-menu-submenu",
|
|
2890
|
+
className: "gridkit-filter-menu-submenu",
|
|
2860
2891
|
...buttonProps,
|
|
2861
2892
|
children: [
|
|
2862
|
-
/* @__PURE__ */ jsx16("span", { className: "filter-menu-submenu-icon", "aria-hidden": "true", children: active !== void 0 && /* @__PURE__ */ jsx16(CheckIcon, {}) }),
|
|
2893
|
+
/* @__PURE__ */ jsx16("span", { className: "gridkit-filter-menu-submenu-icon", "aria-hidden": "true", children: active !== void 0 && /* @__PURE__ */ jsx16(CheckIcon, {}) }),
|
|
2863
2894
|
label,
|
|
2864
|
-
/* @__PURE__ */ jsx16(
|
|
2895
|
+
/* @__PURE__ */ jsx16(
|
|
2896
|
+
"span",
|
|
2897
|
+
{
|
|
2898
|
+
className: "gridkit-filter-menu-submenu-indicator",
|
|
2899
|
+
"aria-hidden": "true",
|
|
2900
|
+
children: /* @__PURE__ */ jsx16(ChevronRightIcon2, {})
|
|
2901
|
+
}
|
|
2902
|
+
)
|
|
2865
2903
|
]
|
|
2866
2904
|
}
|
|
2867
2905
|
),
|
|
@@ -2906,13 +2944,13 @@ import {
|
|
|
2906
2944
|
draftToFilter,
|
|
2907
2945
|
filterDraftChanged as filterDraftChanged2,
|
|
2908
2946
|
filterEditorReducer as filterEditorReducer2
|
|
2909
|
-
} from "@gridkitjs/core";
|
|
2947
|
+
} from "@gridkitjs/core/renderer";
|
|
2910
2948
|
|
|
2911
2949
|
// src/DataGrid/filterMenu/ConditionRow.tsx
|
|
2912
2950
|
import {
|
|
2913
2951
|
filterOperandArity,
|
|
2914
2952
|
parseFilterOperand
|
|
2915
|
-
} from "@gridkitjs/core";
|
|
2953
|
+
} from "@gridkitjs/core/renderer";
|
|
2916
2954
|
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2917
2955
|
function inputType(family, type) {
|
|
2918
2956
|
switch (family) {
|
|
@@ -2936,7 +2974,7 @@ function OperandField({
|
|
|
2936
2974
|
}) {
|
|
2937
2975
|
const field = {
|
|
2938
2976
|
ref: fieldRef,
|
|
2939
|
-
className: "filter-menu-value",
|
|
2977
|
+
className: "gridkit-filter-menu-value",
|
|
2940
2978
|
"aria-label": label,
|
|
2941
2979
|
"aria-invalid": invalidMessageId === void 0 ? void 0 : true,
|
|
2942
2980
|
"aria-describedby": invalidMessageId,
|
|
@@ -2977,13 +3015,13 @@ function ConditionRow({
|
|
|
2977
3015
|
ref,
|
|
2978
3016
|
role: "group",
|
|
2979
3017
|
"aria-label": messages.filterConditionLabel(position),
|
|
2980
|
-
className: "filter-menu-condition",
|
|
3018
|
+
className: "gridkit-filter-menu-condition",
|
|
2981
3019
|
children: [
|
|
2982
3020
|
/* @__PURE__ */ jsx17(
|
|
2983
3021
|
"select",
|
|
2984
3022
|
{
|
|
2985
3023
|
ref: arity === 0 ? focusRef : void 0,
|
|
2986
|
-
className: "filter-menu-operator",
|
|
3024
|
+
className: "gridkit-filter-menu-operator",
|
|
2987
3025
|
"aria-label": messages.filterOperatorFieldLabel,
|
|
2988
3026
|
value: row.operator,
|
|
2989
3027
|
onChange: (event) => {
|
|
@@ -3032,7 +3070,7 @@ import {
|
|
|
3032
3070
|
conditionsFromRows,
|
|
3033
3071
|
describeColumnFilter as describeColumnFilter2,
|
|
3034
3072
|
initialFilterEditorDraft as initialFilterEditorDraft2
|
|
3035
|
-
} from "@gridkitjs/core";
|
|
3073
|
+
} from "@gridkitjs/core/renderer";
|
|
3036
3074
|
var NO_ROWS = [];
|
|
3037
3075
|
var NO_VALUES = {
|
|
3038
3076
|
options: [],
|
|
@@ -3124,8 +3162,8 @@ function CombinatorChoice({
|
|
|
3124
3162
|
{
|
|
3125
3163
|
role: "radiogroup",
|
|
3126
3164
|
"aria-label": messages.filterCombinatorLabel,
|
|
3127
|
-
className: "filter-menu-combinator",
|
|
3128
|
-
children: COMBINATORS.map((choice) => /* @__PURE__ */ jsxs13("label", { className: "filter-menu-combinator-option", children: [
|
|
3165
|
+
className: "gridkit-filter-menu-combinator",
|
|
3166
|
+
children: COMBINATORS.map((choice) => /* @__PURE__ */ jsxs13("label", { className: "gridkit-filter-menu-combinator-option", children: [
|
|
3129
3167
|
/* @__PURE__ */ jsx18(
|
|
3130
3168
|
"input",
|
|
3131
3169
|
{
|
|
@@ -3204,8 +3242,8 @@ function SimpleFilterEditor({
|
|
|
3204
3242
|
rowElements.current[first]?.querySelector('[aria-invalid="true"]')?.focus();
|
|
3205
3243
|
}
|
|
3206
3244
|
}, [invalid]);
|
|
3207
|
-
return /* @__PURE__ */ jsxs13("div", { className: "filter-menu-conditions", children: [
|
|
3208
|
-
opened.custom && /* @__PURE__ */ jsx18("p", { className: "filter-menu-custom", children: messages.customFilter }),
|
|
3245
|
+
return /* @__PURE__ */ jsxs13("div", { className: "gridkit-filter-menu-conditions", children: [
|
|
3246
|
+
opened.custom && /* @__PURE__ */ jsx18("p", { className: "gridkit-filter-menu-custom", children: messages.customFilter }),
|
|
3209
3247
|
draft.rows.map((row, index) => (
|
|
3210
3248
|
// A row is its place: the first condition, or the second.
|
|
3211
3249
|
/* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
@@ -3240,7 +3278,7 @@ function SimpleFilterEditor({
|
|
|
3240
3278
|
)
|
|
3241
3279
|
] }, index)
|
|
3242
3280
|
)),
|
|
3243
|
-
invalid.length > 0 && /* @__PURE__ */ jsx18("p", { id: invalidMessageId, className: "filter-menu-invalid", children: messages.filterValueInvalid(menu.family) })
|
|
3281
|
+
invalid.length > 0 && /* @__PURE__ */ jsx18("p", { id: invalidMessageId, className: "gridkit-filter-menu-invalid", children: messages.filterValueInvalid(menu.family) })
|
|
3244
3282
|
] });
|
|
3245
3283
|
}
|
|
3246
3284
|
|
|
@@ -3314,7 +3352,7 @@ function ValueChecklist({
|
|
|
3314
3352
|
role: "listbox",
|
|
3315
3353
|
"aria-multiselectable": "true",
|
|
3316
3354
|
"aria-label": label,
|
|
3317
|
-
className: "filter-menu-checklist",
|
|
3355
|
+
className: "gridkit-filter-menu-checklist",
|
|
3318
3356
|
children: [
|
|
3319
3357
|
/* @__PURE__ */ jsx19("div", { role: "presentation", style: { height: range.offsetBefore } }),
|
|
3320
3358
|
shown.map((item, offset) => {
|
|
@@ -3329,13 +3367,20 @@ function ValueChecklist({
|
|
|
3329
3367
|
"aria-checked": item.checked,
|
|
3330
3368
|
"aria-setsize": items.length,
|
|
3331
3369
|
"aria-posinset": index + 1,
|
|
3332
|
-
className: "filter-menu-option",
|
|
3370
|
+
className: "gridkit-filter-menu-option",
|
|
3333
3371
|
children: [
|
|
3334
|
-
/* @__PURE__ */ jsx19(
|
|
3335
|
-
|
|
3372
|
+
/* @__PURE__ */ jsx19(
|
|
3373
|
+
"span",
|
|
3374
|
+
{
|
|
3375
|
+
className: "gridkit-filter-menu-option-check",
|
|
3376
|
+
"aria-hidden": "true",
|
|
3377
|
+
children: /* @__PURE__ */ jsx19(CheckIcon, {})
|
|
3378
|
+
}
|
|
3379
|
+
),
|
|
3380
|
+
/* @__PURE__ */ jsx19("span", { className: "gridkit-filter-menu-option-label", children: item.label }),
|
|
3336
3381
|
showCounts && /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3337
3382
|
" ",
|
|
3338
|
-
/* @__PURE__ */ jsx19("span", { className: "filter-menu-option-count", children: String(item.count) })
|
|
3383
|
+
/* @__PURE__ */ jsx19("span", { className: "gridkit-filter-menu-option-count", children: String(item.count) })
|
|
3339
3384
|
] })
|
|
3340
3385
|
]
|
|
3341
3386
|
},
|
|
@@ -3421,12 +3466,12 @@ function ExcelFilterEditor({
|
|
|
3421
3466
|
"button",
|
|
3422
3467
|
{
|
|
3423
3468
|
type: "button",
|
|
3424
|
-
className: "filter-menu-back",
|
|
3469
|
+
className: "gridkit-filter-menu-back",
|
|
3425
3470
|
onClick: () => {
|
|
3426
3471
|
setMode({ kind: "values", focusOnMount: true });
|
|
3427
3472
|
},
|
|
3428
3473
|
children: [
|
|
3429
|
-
/* @__PURE__ */ jsx20("span", { className: "filter-menu-back-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(ChevronLeftIcon2, {}) }),
|
|
3474
|
+
/* @__PURE__ */ jsx20("span", { className: "gridkit-filter-menu-back-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(ChevronLeftIcon2, {}) }),
|
|
3430
3475
|
messages.filterBackToValues
|
|
3431
3476
|
]
|
|
3432
3477
|
}
|
|
@@ -3449,7 +3494,7 @@ function ExcelFilterEditor({
|
|
|
3449
3494
|
] });
|
|
3450
3495
|
}
|
|
3451
3496
|
const { shape } = opened;
|
|
3452
|
-
return /* @__PURE__ */ jsxs15("div", { className: "filter-menu-values", children: [
|
|
3497
|
+
return /* @__PURE__ */ jsxs15("div", { className: "gridkit-filter-menu-values", children: [
|
|
3453
3498
|
menu.operators.length > 0 && /* @__PURE__ */ jsx20(
|
|
3454
3499
|
OperatorMenuButton,
|
|
3455
3500
|
{
|
|
@@ -3462,13 +3507,13 @@ function ExcelFilterEditor({
|
|
|
3462
3507
|
}
|
|
3463
3508
|
}
|
|
3464
3509
|
),
|
|
3465
|
-
(shape.kind === "conditions" || shape.kind === "custom") && /* @__PURE__ */ jsx20("p", { className: "filter-menu-custom", children: shape.kind === "conditions" ? messages.filterByCondition : messages.customFilter }),
|
|
3510
|
+
(shape.kind === "conditions" || shape.kind === "custom") && /* @__PURE__ */ jsx20("p", { className: "gridkit-filter-menu-custom", children: shape.kind === "conditions" ? messages.filterByCondition : messages.customFilter }),
|
|
3466
3511
|
/* @__PURE__ */ jsx20(
|
|
3467
3512
|
"input",
|
|
3468
3513
|
{
|
|
3469
3514
|
ref: initialFocusRef,
|
|
3470
3515
|
type: "search",
|
|
3471
|
-
className: "filter-menu-search",
|
|
3516
|
+
className: "gridkit-filter-menu-search",
|
|
3472
3517
|
"aria-label": messages.filterSearchLabel,
|
|
3473
3518
|
placeholder: messages.searchPlaceholder,
|
|
3474
3519
|
value: draft.search,
|
|
@@ -3477,7 +3522,7 @@ function ExcelFilterEditor({
|
|
|
3477
3522
|
}
|
|
3478
3523
|
}
|
|
3479
3524
|
),
|
|
3480
|
-
/* @__PURE__ */ jsxs15("label", { className: "filter-menu-select-all", children: [
|
|
3525
|
+
/* @__PURE__ */ jsxs15("label", { className: "gridkit-filter-menu-select-all", children: [
|
|
3481
3526
|
/* @__PURE__ */ jsx20(
|
|
3482
3527
|
"input",
|
|
3483
3528
|
{
|
|
@@ -3492,7 +3537,7 @@ function ExcelFilterEditor({
|
|
|
3492
3537
|
),
|
|
3493
3538
|
messages.filterSelectAll
|
|
3494
3539
|
] }),
|
|
3495
|
-
checklist.needsSearch ? /* @__PURE__ */ jsx20("p", { className: "filter-menu-search-first", children: messages.filterSearchFirst(checklist.total) }) : /* @__PURE__ */ jsx20(
|
|
3540
|
+
checklist.needsSearch ? /* @__PURE__ */ jsx20("p", { className: "gridkit-filter-menu-search-first", children: messages.filterSearchFirst(checklist.total) }) : /* @__PURE__ */ jsx20(
|
|
3496
3541
|
ValueChecklist,
|
|
3497
3542
|
{
|
|
3498
3543
|
items: checklist.items,
|
|
@@ -3503,7 +3548,7 @@ function ExcelFilterEditor({
|
|
|
3503
3548
|
}
|
|
3504
3549
|
}
|
|
3505
3550
|
),
|
|
3506
|
-
checklist.hiddenCount > 0 && /* @__PURE__ */ jsx20("p", { role: "status", className: "filter-menu-more", children: messages.filterMoreValues(checklist.hiddenCount) })
|
|
3551
|
+
checklist.hiddenCount > 0 && /* @__PURE__ */ jsx20("p", { role: "status", className: "gridkit-filter-menu-more", children: messages.filterMoreValues(checklist.hiddenCount) })
|
|
3507
3552
|
] });
|
|
3508
3553
|
}
|
|
3509
3554
|
|
|
@@ -3576,7 +3621,7 @@ function FilterMenu({
|
|
|
3576
3621
|
children: /* @__PURE__ */ jsxs16(
|
|
3577
3622
|
"form",
|
|
3578
3623
|
{
|
|
3579
|
-
className: "filter-menu-form",
|
|
3624
|
+
className: "gridkit-filter-menu-form",
|
|
3580
3625
|
noValidate: true,
|
|
3581
3626
|
onSubmit: apply,
|
|
3582
3627
|
onKeyDown: (event) => {
|
|
@@ -3586,11 +3631,11 @@ function FilterMenu({
|
|
|
3586
3631
|
}
|
|
3587
3632
|
},
|
|
3588
3633
|
children: [
|
|
3589
|
-
sortItems.length > 0 && /* @__PURE__ */ jsx21("div", { className: "filter-menu-sort", children: sortItems.map((item) => /* @__PURE__ */ jsxs16(
|
|
3634
|
+
sortItems.length > 0 && /* @__PURE__ */ jsx21("div", { className: "gridkit-filter-menu-sort", children: sortItems.map((item) => /* @__PURE__ */ jsxs16(
|
|
3590
3635
|
"button",
|
|
3591
3636
|
{
|
|
3592
3637
|
type: "button",
|
|
3593
|
-
className: "filter-menu-sort-item",
|
|
3638
|
+
className: "gridkit-filter-menu-sort-item",
|
|
3594
3639
|
disabled: item.disabled,
|
|
3595
3640
|
...ariaAttr(
|
|
3596
3641
|
item.checked !== void 0,
|
|
@@ -3601,19 +3646,26 @@ function FilterMenu({
|
|
|
3601
3646
|
run(item);
|
|
3602
3647
|
},
|
|
3603
3648
|
children: [
|
|
3604
|
-
/* @__PURE__ */ jsx21(
|
|
3649
|
+
/* @__PURE__ */ jsx21(
|
|
3650
|
+
"span",
|
|
3651
|
+
{
|
|
3652
|
+
className: "gridkit-filter-menu-sort-icon",
|
|
3653
|
+
"aria-hidden": "true",
|
|
3654
|
+
children: /* @__PURE__ */ jsx21(MenuIcon, { name: item.icon })
|
|
3655
|
+
}
|
|
3656
|
+
),
|
|
3605
3657
|
item.label
|
|
3606
3658
|
]
|
|
3607
3659
|
},
|
|
3608
3660
|
item.id
|
|
3609
3661
|
)) }),
|
|
3610
3662
|
menu.ui === "excel" ? /* @__PURE__ */ jsx21(ExcelFilterEditor, { ...editorProps, columnValues }) : /* @__PURE__ */ jsx21(SimpleFilterEditor, { ...editorProps }),
|
|
3611
|
-
/* @__PURE__ */ jsxs16("div", { className: "filter-menu-actions", children: [
|
|
3663
|
+
/* @__PURE__ */ jsxs16("div", { className: "gridkit-filter-menu-actions", children: [
|
|
3612
3664
|
clearItem !== void 0 && /* @__PURE__ */ jsx21(
|
|
3613
3665
|
"button",
|
|
3614
3666
|
{
|
|
3615
3667
|
type: "button",
|
|
3616
|
-
className: "filter-menu-clear",
|
|
3668
|
+
className: "gridkit-filter-menu-clear",
|
|
3617
3669
|
disabled: clearItem.disabled,
|
|
3618
3670
|
onClick: () => {
|
|
3619
3671
|
run(clearItem);
|
|
@@ -3621,8 +3673,16 @@ function FilterMenu({
|
|
|
3621
3673
|
children: clearItem.label
|
|
3622
3674
|
}
|
|
3623
3675
|
),
|
|
3624
|
-
/* @__PURE__ */ jsx21(
|
|
3625
|
-
|
|
3676
|
+
/* @__PURE__ */ jsx21(
|
|
3677
|
+
"button",
|
|
3678
|
+
{
|
|
3679
|
+
type: "button",
|
|
3680
|
+
className: "gridkit-filter-menu-cancel",
|
|
3681
|
+
onClick: close,
|
|
3682
|
+
children: messages.cancelFilter
|
|
3683
|
+
}
|
|
3684
|
+
),
|
|
3685
|
+
/* @__PURE__ */ jsx21("button", { type: "submit", className: "gridkit-filter-menu-apply", children: messages.applyFilter })
|
|
3626
3686
|
] })
|
|
3627
3687
|
]
|
|
3628
3688
|
}
|
|
@@ -3662,7 +3722,7 @@ function useApplyFilter(controller, messages, announce) {
|
|
|
3662
3722
|
import { useState as useState11 } from "react";
|
|
3663
3723
|
import {
|
|
3664
3724
|
createColumnValueOptionsCache
|
|
3665
|
-
} from "@gridkitjs/core";
|
|
3725
|
+
} from "@gridkitjs/core/renderer";
|
|
3666
3726
|
var NO_ROWS2 = [];
|
|
3667
3727
|
function useFilterValueCache(controller, messages) {
|
|
3668
3728
|
const [cache] = useState11(createColumnValueOptionsCache);
|
|
@@ -3736,7 +3796,7 @@ function GridPanels({
|
|
|
3736
3796
|
}
|
|
3737
3797
|
|
|
3738
3798
|
// src/DataGrid/panels/panelApi.ts
|
|
3739
|
-
import { resolveColumnFilterMenu as resolveColumnFilterMenu3 } from "@gridkitjs/core";
|
|
3799
|
+
import { resolveColumnFilterMenu as resolveColumnFilterMenu3 } from "@gridkitjs/core/renderer";
|
|
3740
3800
|
function panelApi(panels, controller) {
|
|
3741
3801
|
return {
|
|
3742
3802
|
openColumnChooser: () => {
|
|
@@ -3834,9 +3894,9 @@ function useGridPanels({
|
|
|
3834
3894
|
import { useLayoutEffect as useLayoutEffect13, useRef as useRef19 } from "react";
|
|
3835
3895
|
import {
|
|
3836
3896
|
resolveToolbar,
|
|
3837
|
-
splitToolbarItems,
|
|
3838
3897
|
toolbarEntries
|
|
3839
3898
|
} from "@gridkitjs/core";
|
|
3899
|
+
import { splitToolbarItems } from "@gridkitjs/core/renderer";
|
|
3840
3900
|
import { attachToolbar } from "@gridkitjs/dom";
|
|
3841
3901
|
|
|
3842
3902
|
// src/DataGrid/toolbar/ToolbarMenuButton.tsx
|
|
@@ -3859,14 +3919,17 @@ function ToolbarMenuButton({
|
|
|
3859
3919
|
{
|
|
3860
3920
|
...attributes,
|
|
3861
3921
|
type: "button",
|
|
3862
|
-
className: classNames(
|
|
3922
|
+
className: classNames(
|
|
3923
|
+
"gridkit-toolbar-button",
|
|
3924
|
+
more && "gridkit-toolbar-more"
|
|
3925
|
+
),
|
|
3863
3926
|
"data-gridkit-toolbar-item": itemKey,
|
|
3864
3927
|
...ariaAttr(more, "data-gridkit-toolbar-more", ""),
|
|
3865
3928
|
...buttonProps,
|
|
3866
3929
|
children: [
|
|
3867
|
-
icon !== void 0 && /* @__PURE__ */ jsx23("span", { className: "toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx23(MenuIcon, { name: icon }) }),
|
|
3930
|
+
icon !== void 0 && /* @__PURE__ */ jsx23("span", { className: "gridkit-toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx23(MenuIcon, { name: icon }) }),
|
|
3868
3931
|
label,
|
|
3869
|
-
/* @__PURE__ */ jsx23("span", { className: "toolbar-button-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx23(ChevronDownIcon, {}) })
|
|
3932
|
+
/* @__PURE__ */ jsx23("span", { className: "gridkit-toolbar-button-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx23(ChevronDownIcon, {}) })
|
|
3870
3933
|
]
|
|
3871
3934
|
}
|
|
3872
3935
|
),
|
|
@@ -3901,10 +3964,7 @@ function ToolbarMenuButton({
|
|
|
3901
3964
|
|
|
3902
3965
|
// src/DataGrid/toolbar/ToolbarSearch.tsx
|
|
3903
3966
|
import { useEffect as useEffect6, useRef as useRef17, useState as useState12 } from "react";
|
|
3904
|
-
import {
|
|
3905
|
-
searchTextOf,
|
|
3906
|
-
setSearchText
|
|
3907
|
-
} from "@gridkitjs/core";
|
|
3967
|
+
import { searchTextOf, setSearchText } from "@gridkitjs/core/renderer";
|
|
3908
3968
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3909
3969
|
var SEARCH_DELAY_MS = 250;
|
|
3910
3970
|
function ToolbarSearch({
|
|
@@ -3946,7 +4006,7 @@ function ToolbarSearch({
|
|
|
3946
4006
|
{
|
|
3947
4007
|
...attributes,
|
|
3948
4008
|
type: "search",
|
|
3949
|
-
className: "toolbar-search",
|
|
4009
|
+
className: "gridkit-toolbar-search",
|
|
3950
4010
|
"data-gridkit-toolbar-item": itemKey,
|
|
3951
4011
|
"aria-label": messages.searchLabel,
|
|
3952
4012
|
placeholder: messages.searchPlaceholder,
|
|
@@ -4112,7 +4172,7 @@ function Toolbar({
|
|
|
4112
4172
|
{
|
|
4113
4173
|
...item.attributes,
|
|
4114
4174
|
type: "button",
|
|
4115
|
-
className: "toolbar-button",
|
|
4175
|
+
className: "gridkit-toolbar-button",
|
|
4116
4176
|
"data-gridkit-toolbar-item": item.key,
|
|
4117
4177
|
...ariaAttr(item.disabled, "aria-disabled", true),
|
|
4118
4178
|
...ariaAttr(
|
|
@@ -4129,7 +4189,7 @@ function Toolbar({
|
|
|
4129
4189
|
item.run();
|
|
4130
4190
|
},
|
|
4131
4191
|
children: [
|
|
4132
|
-
item.icon !== void 0 && /* @__PURE__ */ jsx25("span", { className: "toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx25(MenuIcon, { name: item.icon }) }),
|
|
4192
|
+
item.icon !== void 0 && /* @__PURE__ */ jsx25("span", { className: "gridkit-toolbar-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx25(MenuIcon, { name: item.icon }) }),
|
|
4133
4193
|
item.label
|
|
4134
4194
|
]
|
|
4135
4195
|
},
|
|
@@ -4166,7 +4226,7 @@ function Toolbar({
|
|
|
4166
4226
|
{
|
|
4167
4227
|
role: "separator",
|
|
4168
4228
|
"aria-orientation": "vertical",
|
|
4169
|
-
className: "toolbar-separator",
|
|
4229
|
+
className: "gridkit-toolbar-separator",
|
|
4170
4230
|
"data-gridkit-toolbar-item": item.key
|
|
4171
4231
|
},
|
|
4172
4232
|
item.key
|
|
@@ -4175,7 +4235,7 @@ function Toolbar({
|
|
|
4175
4235
|
return /* @__PURE__ */ jsx25(
|
|
4176
4236
|
"div",
|
|
4177
4237
|
{
|
|
4178
|
-
className: "toolbar-spacer",
|
|
4238
|
+
className: "gridkit-toolbar-spacer",
|
|
4179
4239
|
"data-gridkit-toolbar-item": item.key
|
|
4180
4240
|
},
|
|
4181
4241
|
item.key
|
|
@@ -4185,7 +4245,7 @@ function Toolbar({
|
|
|
4185
4245
|
"div",
|
|
4186
4246
|
{
|
|
4187
4247
|
...item.attributes,
|
|
4188
|
-
className: "toolbar-custom",
|
|
4248
|
+
className: "gridkit-toolbar-custom",
|
|
4189
4249
|
"data-gridkit-toolbar-item": item.key,
|
|
4190
4250
|
children: renderItem?.(item.id)
|
|
4191
4251
|
},
|
|
@@ -4219,9 +4279,7 @@ function Toolbar({
|
|
|
4219
4279
|
}
|
|
4220
4280
|
|
|
4221
4281
|
// src/DataGrid/useColumnDrag.ts
|
|
4222
|
-
import {
|
|
4223
|
-
resolveKeyboardDropTarget as resolveKeyboardDropTarget2
|
|
4224
|
-
} from "@gridkitjs/core";
|
|
4282
|
+
import { resolveKeyboardDropTarget as resolveKeyboardDropTarget2 } from "@gridkitjs/core/renderer";
|
|
4225
4283
|
import { resolveColumnDropTarget } from "@gridkitjs/dom";
|
|
4226
4284
|
function useColumnDrag({
|
|
4227
4285
|
order,
|
|
@@ -4266,7 +4324,7 @@ import {
|
|
|
4266
4324
|
clampColumnWidth,
|
|
4267
4325
|
resolveColumnConstraints,
|
|
4268
4326
|
sizeColumnToContent
|
|
4269
|
-
} from "@gridkitjs/core";
|
|
4327
|
+
} from "@gridkitjs/core/renderer";
|
|
4270
4328
|
import { measureColumnContent, startColumnResizeGesture } from "@gridkitjs/dom";
|
|
4271
4329
|
function useColumnResize({
|
|
4272
4330
|
tableRef,
|
|
@@ -4873,16 +4931,16 @@ function DataGrid(props) {
|
|
|
4873
4931
|
}));
|
|
4874
4932
|
const gridTableClassName = classNames(
|
|
4875
4933
|
"gridkit-data-grid",
|
|
4876
|
-
borders ? `borders-${borders}` : "",
|
|
4934
|
+
borders ? `gridkit-borders-${borders}` : "",
|
|
4877
4935
|
// Hover is on by default and selection off, so one set of classes
|
|
4878
4936
|
// turns styling off and the other turns it on. The polarity differs
|
|
4879
4937
|
// because the defaults do.
|
|
4880
|
-
hoverRows ? "" : "no-hover-rows",
|
|
4881
|
-
hoverColumns ? "" : "no-hover-columns",
|
|
4882
|
-
hoverCells ? "" : "no-hover-cells",
|
|
4883
|
-
selection.rowMode === false ? "" : "selectable-rows",
|
|
4884
|
-
selection.columnMode === false ? "" : "selectable-columns",
|
|
4885
|
-
selection.cellMode === false ? "" : "selectable-cells"
|
|
4938
|
+
hoverRows ? "" : "gridkit-no-hover-rows",
|
|
4939
|
+
hoverColumns ? "" : "gridkit-no-hover-columns",
|
|
4940
|
+
hoverCells ? "" : "gridkit-no-hover-cells",
|
|
4941
|
+
selection.rowMode === false ? "" : "gridkit-selectable-rows",
|
|
4942
|
+
selection.columnMode === false ? "" : "gridkit-selectable-columns",
|
|
4943
|
+
selection.cellMode === false ? "" : "gridkit-selectable-cells"
|
|
4886
4944
|
);
|
|
4887
4945
|
const hasFooter = aggregates.length > 0;
|
|
4888
4946
|
return /* @__PURE__ */ jsxs19("div", { className: "gridkit-data-grid-viewport", ref: viewportRef, children: [
|