@rufous/ui 0.1.67 → 0.1.69
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/DataGrid/DataGrid.cjs +114 -56
- package/dist/DataGrid/DataGrid.d.cts +1 -1
- package/dist/DataGrid/DataGrid.d.ts +1 -1
- package/dist/DataGrid/DataGrid.js +1 -1
- package/dist/DataGrid/index.cjs +114 -56
- package/dist/DataGrid/index.js +1 -1
- package/dist/DataGrid/types.d.cts +4 -2
- package/dist/DataGrid/types.d.ts +4 -2
- package/dist/Dialogs/BaseDialog.js +4 -4
- package/dist/Dialogs/index.js +4 -4
- package/dist/{chunk-IKG2B6JQ.js → chunk-LG4EJGMI.js} +114 -56
- package/dist/main.cjs +114 -56
- package/dist/main.js +7 -7
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -30377,24 +30377,38 @@ var AddressLookup_default = AddressLookup;
|
|
|
30377
30377
|
var import_react18 = __toESM(require("react"), 1);
|
|
30378
30378
|
var import_lucide_react = require("lucide-react");
|
|
30379
30379
|
function DataGrid({
|
|
30380
|
-
columns:
|
|
30380
|
+
columns: initialColumnsProp,
|
|
30381
30381
|
data,
|
|
30382
30382
|
actions,
|
|
30383
30383
|
pageSize: initialPageSize = 10,
|
|
30384
30384
|
pageSizeOptions = [5, 10, 25, 50],
|
|
30385
30385
|
title
|
|
30386
30386
|
}) {
|
|
30387
|
-
const [
|
|
30387
|
+
const [columnOverrides, setColumnOverrides] = (0, import_react18.useState)({});
|
|
30388
|
+
const resolvedColumns = (0, import_react18.useMemo)(() => {
|
|
30389
|
+
return initialColumnsProp.map((col) => {
|
|
30390
|
+
const field = String(col.field || col.key || "");
|
|
30391
|
+
const override = columnOverrides[field] || {};
|
|
30392
|
+
return {
|
|
30393
|
+
...col,
|
|
30394
|
+
field,
|
|
30395
|
+
headerName: col.headerName || col.header || "",
|
|
30396
|
+
hidden: override.hidden !== void 0 ? override.hidden : col.hidden,
|
|
30397
|
+
pinned: override.pinned !== void 0 ? override.pinned : col.pinned
|
|
30398
|
+
};
|
|
30399
|
+
});
|
|
30400
|
+
}, [initialColumnsProp, columnOverrides]);
|
|
30388
30401
|
const [columnWidths, setColumnWidths] = (0, import_react18.useState)(() => {
|
|
30389
30402
|
const widths = {};
|
|
30390
|
-
|
|
30403
|
+
initialColumnsProp.forEach((col) => {
|
|
30404
|
+
const field = String(col.field || col.key || "");
|
|
30391
30405
|
const w = col.width || 200;
|
|
30392
|
-
widths[
|
|
30406
|
+
widths[field] = typeof w === "number" ? w : parseInt(w);
|
|
30393
30407
|
});
|
|
30394
30408
|
return widths;
|
|
30395
30409
|
});
|
|
30396
30410
|
const [pageSize, setPageSize] = (0, import_react18.useState)(initialPageSize);
|
|
30397
|
-
const [
|
|
30411
|
+
const [sortField, setSortField] = (0, import_react18.useState)(null);
|
|
30398
30412
|
const [sortDirection, setSortDirection] = (0, import_react18.useState)(null);
|
|
30399
30413
|
const [filterText, setFilterText] = (0, import_react18.useState)("");
|
|
30400
30414
|
const [currentPage, setCurrentPage] = (0, import_react18.useState)(1);
|
|
@@ -30407,14 +30421,15 @@ function DataGrid({
|
|
|
30407
30421
|
const menuRef = (0, import_react18.useRef)(null);
|
|
30408
30422
|
const [showManageColumns, setShowManageColumns] = (0, import_react18.useState)(false);
|
|
30409
30423
|
const [showAdvancedFilter, setShowAdvancedFilter] = (0, import_react18.useState)(false);
|
|
30424
|
+
const initialFilterCol = String(initialColumnsProp[0]?.field || initialColumnsProp[0]?.key || "");
|
|
30410
30425
|
const [advancedFilters, setAdvancedFilters] = (0, import_react18.useState)([
|
|
30411
|
-
{ column:
|
|
30426
|
+
{ column: initialFilterCol, operator: "contains", value: "", logic: "AND" }
|
|
30412
30427
|
]);
|
|
30413
30428
|
const [colSearch, setColSearch] = (0, import_react18.useState)("");
|
|
30414
30429
|
(0, import_react18.useEffect)(() => {
|
|
30415
30430
|
const handleMouseMove = (e) => {
|
|
30416
30431
|
if (!resizingColumn) return;
|
|
30417
|
-
const col =
|
|
30432
|
+
const col = resolvedColumns.find((c) => String(c.field) === resizingColumn);
|
|
30418
30433
|
const diff = e.clientX - startX;
|
|
30419
30434
|
const minW = col?.minWidth ? typeof col.minWidth === "number" ? col.minWidth : parseInt(col.minWidth) : 80;
|
|
30420
30435
|
const maxW = col?.maxWidth ? typeof col.maxWidth === "number" ? col.maxWidth : parseInt(col.maxWidth) : Infinity;
|
|
@@ -30430,7 +30445,7 @@ function DataGrid({
|
|
|
30430
30445
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
30431
30446
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
30432
30447
|
};
|
|
30433
|
-
}, [resizingColumn, startX, startWidth,
|
|
30448
|
+
}, [resizingColumn, startX, startWidth, resolvedColumns]);
|
|
30434
30449
|
(0, import_react18.useEffect)(() => {
|
|
30435
30450
|
const handleClickOutside = (e) => {
|
|
30436
30451
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
@@ -30440,32 +30455,55 @@ function DataGrid({
|
|
|
30440
30455
|
document.addEventListener("mousedown", handleClickOutside);
|
|
30441
30456
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
30442
30457
|
}, []);
|
|
30443
|
-
|
|
30458
|
+
(0, import_react18.useEffect)(() => {
|
|
30459
|
+
setColumnWidths((prev) => {
|
|
30460
|
+
const next = { ...prev };
|
|
30461
|
+
initialColumnsProp.forEach((col) => {
|
|
30462
|
+
const field = String(col.field || col.key || "");
|
|
30463
|
+
if (next[field] === void 0) {
|
|
30464
|
+
const w = col.width || 200;
|
|
30465
|
+
next[field] = typeof w === "number" ? w : parseInt(w);
|
|
30466
|
+
}
|
|
30467
|
+
});
|
|
30468
|
+
return next;
|
|
30469
|
+
});
|
|
30470
|
+
}, [initialColumnsProp]);
|
|
30471
|
+
const handleSort = (fieldKey, dir) => {
|
|
30444
30472
|
if (dir !== void 0) {
|
|
30445
|
-
|
|
30473
|
+
setSortField(fieldKey);
|
|
30446
30474
|
setSortDirection(dir);
|
|
30447
|
-
} else if (
|
|
30475
|
+
} else if (sortField === fieldKey) {
|
|
30448
30476
|
if (sortDirection === "asc") setSortDirection("desc");
|
|
30449
30477
|
else {
|
|
30450
|
-
|
|
30478
|
+
setSortField(null);
|
|
30451
30479
|
setSortDirection(null);
|
|
30452
30480
|
}
|
|
30453
30481
|
} else {
|
|
30454
|
-
|
|
30482
|
+
setSortField(fieldKey);
|
|
30455
30483
|
setSortDirection("asc");
|
|
30456
30484
|
}
|
|
30457
30485
|
setActiveMenu(null);
|
|
30458
30486
|
};
|
|
30459
|
-
const togglePin = (
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30487
|
+
const togglePin = (fieldKey, side) => {
|
|
30488
|
+
setColumnOverrides((prev) => {
|
|
30489
|
+
const current = prev[fieldKey] || {};
|
|
30490
|
+
return {
|
|
30491
|
+
...prev,
|
|
30492
|
+
[fieldKey]: { ...current, pinned: current.pinned === side ? void 0 : side }
|
|
30493
|
+
};
|
|
30494
|
+
});
|
|
30463
30495
|
setActiveMenu(null);
|
|
30464
30496
|
};
|
|
30465
|
-
const toggleHide = (
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
|
|
30497
|
+
const toggleHide = (fieldKey) => {
|
|
30498
|
+
setColumnOverrides((prev) => {
|
|
30499
|
+
const current = prev[fieldKey] || {};
|
|
30500
|
+
const col = resolvedColumns.find((c) => String(c.field) === fieldKey);
|
|
30501
|
+
if (col?.hideable === false) return prev;
|
|
30502
|
+
return {
|
|
30503
|
+
...prev,
|
|
30504
|
+
[fieldKey]: { ...current, hidden: !current.hidden }
|
|
30505
|
+
};
|
|
30506
|
+
});
|
|
30469
30507
|
setActiveMenu(null);
|
|
30470
30508
|
};
|
|
30471
30509
|
const filteredData = (0, import_react18.useMemo)(() => {
|
|
@@ -30507,30 +30545,30 @@ function DataGrid({
|
|
|
30507
30545
|
});
|
|
30508
30546
|
}, [data, filterText, advancedFilters]);
|
|
30509
30547
|
const sortedData = (0, import_react18.useMemo)(() => {
|
|
30510
|
-
if (!
|
|
30511
|
-
const col =
|
|
30548
|
+
if (!sortField || !sortDirection) return filteredData;
|
|
30549
|
+
const col = resolvedColumns.find((c) => c.field === sortField);
|
|
30512
30550
|
return [...filteredData].sort((a, b) => {
|
|
30513
|
-
let aVal = a[
|
|
30514
|
-
let bVal = b[
|
|
30551
|
+
let aVal = a[sortField];
|
|
30552
|
+
let bVal = b[sortField];
|
|
30515
30553
|
if (col?.valueGetter) {
|
|
30516
|
-
aVal = col.valueGetter({ value: aVal, row: a, field: String(
|
|
30517
|
-
bVal = col.valueGetter({ value: bVal, row: b, field: String(
|
|
30554
|
+
aVal = col.valueGetter({ value: aVal, row: a, field: String(sortField) });
|
|
30555
|
+
bVal = col.valueGetter({ value: bVal, row: b, field: String(sortField) });
|
|
30518
30556
|
}
|
|
30519
30557
|
if (aVal < bVal) return sortDirection === "asc" ? -1 : 1;
|
|
30520
30558
|
if (aVal > bVal) return sortDirection === "asc" ? 1 : -1;
|
|
30521
30559
|
return 0;
|
|
30522
30560
|
});
|
|
30523
|
-
}, [filteredData,
|
|
30561
|
+
}, [filteredData, sortField, sortDirection, resolvedColumns]);
|
|
30524
30562
|
const totalPages = Math.max(1, Math.ceil(sortedData.length / pageSize));
|
|
30525
30563
|
const paginatedData = (0, import_react18.useMemo)(() => {
|
|
30526
30564
|
const start = (currentPage - 1) * pageSize;
|
|
30527
30565
|
return sortedData.slice(start, start + pageSize);
|
|
30528
30566
|
}, [sortedData, currentPage, pageSize]);
|
|
30529
30567
|
const handleExport = () => {
|
|
30530
|
-
const visibleCols =
|
|
30531
|
-
const headers = visibleCols.map((c) => c.
|
|
30568
|
+
const visibleCols = resolvedColumns.filter((c) => !c.hidden);
|
|
30569
|
+
const headers = visibleCols.map((c) => c.headerName).join(",");
|
|
30532
30570
|
const rows = sortedData.map(
|
|
30533
|
-
(item) => visibleCols.map((c) => `"${String(item[c.
|
|
30571
|
+
(item) => visibleCols.map((c) => `"${String(item[c.field]).replace(/"/g, '""')}"`).join(",")
|
|
30534
30572
|
);
|
|
30535
30573
|
const csv = [headers, ...rows].join("\n");
|
|
30536
30574
|
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
@@ -30541,24 +30579,24 @@ function DataGrid({
|
|
|
30541
30579
|
link2.click();
|
|
30542
30580
|
document.body.removeChild(link2);
|
|
30543
30581
|
};
|
|
30544
|
-
const handleMenuOpen = (e,
|
|
30582
|
+
const handleMenuOpen = (e, keyStr) => {
|
|
30545
30583
|
e.stopPropagation();
|
|
30546
30584
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
30547
30585
|
setMenuPosition({ top: rect.bottom + 4, left: rect.left });
|
|
30548
|
-
setActiveMenu(
|
|
30586
|
+
setActiveMenu(keyStr);
|
|
30549
30587
|
};
|
|
30550
30588
|
const visibleColumns = (0, import_react18.useMemo)(() => {
|
|
30551
|
-
const left =
|
|
30552
|
-
const mid =
|
|
30553
|
-
const right =
|
|
30589
|
+
const left = resolvedColumns.filter((c) => !c.hidden && c.pinned === "left");
|
|
30590
|
+
const mid = resolvedColumns.filter((c) => !c.hidden && !c.pinned);
|
|
30591
|
+
const right = resolvedColumns.filter((c) => !c.hidden && c.pinned === "right");
|
|
30554
30592
|
return [...left, ...mid, ...right];
|
|
30555
|
-
}, [
|
|
30593
|
+
}, [resolvedColumns]);
|
|
30556
30594
|
const getLeftOffset = (col, idx) => {
|
|
30557
30595
|
if (col.pinned !== "left") return void 0;
|
|
30558
30596
|
let offset2 = 0;
|
|
30559
30597
|
for (let i = 0; i < idx; i++) {
|
|
30560
30598
|
if (visibleColumns[i].pinned === "left") {
|
|
30561
|
-
offset2 += columnWidths[String(visibleColumns[i].
|
|
30599
|
+
offset2 += columnWidths[String(visibleColumns[i].field)] || 200;
|
|
30562
30600
|
}
|
|
30563
30601
|
}
|
|
30564
30602
|
return offset2;
|
|
@@ -30592,14 +30630,14 @@ function DataGrid({
|
|
|
30592
30630
|
},
|
|
30593
30631
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Columns, { size: 16 })
|
|
30594
30632
|
), /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-action-btn", onClick: handleExport }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Download, { size: 14 }), " Export CSV"))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-table-wrap" }, /* @__PURE__ */ import_react18.default.createElement("table", { className: "dg-table" }, /* @__PURE__ */ import_react18.default.createElement("thead", null, /* @__PURE__ */ import_react18.default.createElement("tr", null, visibleColumns.map((col, idx) => {
|
|
30595
|
-
const
|
|
30596
|
-
const width = columnWidths[
|
|
30633
|
+
const colField = String(col.field);
|
|
30634
|
+
const width = columnWidths[colField] || 200;
|
|
30597
30635
|
const leftOffset = getLeftOffset(col, idx);
|
|
30598
|
-
const isSorted =
|
|
30636
|
+
const isSorted = sortField === col.field;
|
|
30599
30637
|
return /* @__PURE__ */ import_react18.default.createElement(
|
|
30600
30638
|
"th",
|
|
30601
30639
|
{
|
|
30602
|
-
key:
|
|
30640
|
+
key: colField,
|
|
30603
30641
|
className: `dg-thead-cell${col.pinned === "left" ? " pinned-left" : col.pinned === "right" ? " pinned-right" : ""} ${col.headerClassName || ""}`,
|
|
30604
30642
|
style: { width, minWidth: width, left: leftOffset, flex: col.flex }
|
|
30605
30643
|
},
|
|
@@ -30607,25 +30645,25 @@ function DataGrid({
|
|
|
30607
30645
|
"div",
|
|
30608
30646
|
{
|
|
30609
30647
|
className: `dg-th-label${col.sortable === false ? " no-sort" : ""}`,
|
|
30610
|
-
onClick: () => col.sortable !== false && handleSort(col.
|
|
30648
|
+
onClick: () => col.sortable !== false && handleSort(col.field || "")
|
|
30611
30649
|
},
|
|
30612
|
-
col.
|
|
30650
|
+
col.headerName,
|
|
30613
30651
|
isSorted && sortDirection === "asc" && /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ChevronUp, { size: 12 }),
|
|
30614
30652
|
isSorted && sortDirection === "desc" && /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ChevronDown, { size: 12 })
|
|
30615
30653
|
), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-th-actions" }, !col.disableColumnMenu && /* @__PURE__ */ import_react18.default.createElement(
|
|
30616
30654
|
"button",
|
|
30617
30655
|
{
|
|
30618
30656
|
className: "dg-th-menu-btn",
|
|
30619
|
-
onClick: (e) => handleMenuOpen(e,
|
|
30657
|
+
onClick: (e) => handleMenuOpen(e, colField)
|
|
30620
30658
|
},
|
|
30621
30659
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.MoreVertical, { size: 13 })
|
|
30622
30660
|
), /* @__PURE__ */ import_react18.default.createElement(
|
|
30623
30661
|
"div",
|
|
30624
30662
|
{
|
|
30625
|
-
className: `dg-resizer${resizingColumn ===
|
|
30663
|
+
className: `dg-resizer${resizingColumn === colField ? " resizing" : ""}`,
|
|
30626
30664
|
onMouseDown: (e) => {
|
|
30627
30665
|
e.preventDefault();
|
|
30628
|
-
setResizingColumn(
|
|
30666
|
+
setResizingColumn(colField);
|
|
30629
30667
|
setStartX(e.clientX);
|
|
30630
30668
|
setStartWidth(width);
|
|
30631
30669
|
}
|
|
@@ -30633,19 +30671,19 @@ function DataGrid({
|
|
|
30633
30671
|
)))
|
|
30634
30672
|
);
|
|
30635
30673
|
}), actions && /* @__PURE__ */ import_react18.default.createElement("th", { style: { width: 0, padding: 0 } }))), /* @__PURE__ */ import_react18.default.createElement("tbody", null, paginatedData.length === 0 ? /* @__PURE__ */ import_react18.default.createElement("tr", null, /* @__PURE__ */ import_react18.default.createElement("td", { colSpan: visibleColumns.length + (actions ? 1 : 0), className: "dg-empty" }, "No records found")) : paginatedData.map((item) => /* @__PURE__ */ import_react18.default.createElement("tr", { key: item.id, className: "dg-tbody-row" }, visibleColumns.map((col, idx) => {
|
|
30636
|
-
const
|
|
30637
|
-
const width = columnWidths[
|
|
30674
|
+
const colField = String(col.field);
|
|
30675
|
+
const width = columnWidths[colField] || 200;
|
|
30638
30676
|
const leftOffset = getLeftOffset(col, idx);
|
|
30639
30677
|
return /* @__PURE__ */ import_react18.default.createElement(
|
|
30640
30678
|
"td",
|
|
30641
30679
|
{
|
|
30642
|
-
key: `${item.id}-${
|
|
30680
|
+
key: `${item.id}-${colField}`,
|
|
30643
30681
|
className: `dg-td${col.pinned === "left" ? " pinned-left" : ""} ${col.cellClassName || ""}`,
|
|
30644
30682
|
style: { width, minWidth: width, maxWidth: width, left: leftOffset, flex: col.flex }
|
|
30645
30683
|
},
|
|
30646
30684
|
(() => {
|
|
30647
|
-
const field = String(col.
|
|
30648
|
-
const rawValue = item[col.
|
|
30685
|
+
const field = String(col.field);
|
|
30686
|
+
const rawValue = item[col.field || ""];
|
|
30649
30687
|
let value = col.valueGetter ? col.valueGetter({ value: rawValue, row: item, field }) : rawValue;
|
|
30650
30688
|
const formattedValue = col.valueFormatter ? col.valueFormatter({ value, row: item, field }) : value;
|
|
30651
30689
|
if (col.renderCell) {
|
|
@@ -30713,7 +30751,27 @@ function DataGrid({
|
|
|
30713
30751
|
value: colSearch,
|
|
30714
30752
|
onChange: (e) => setColSearch(e.target.value)
|
|
30715
30753
|
}
|
|
30716
|
-
)),
|
|
30754
|
+
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
30755
|
+
const key = String(col.key);
|
|
30756
|
+
const isUnhideable = col.hideable === false;
|
|
30757
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.EyeOff, { size: 14 }) : /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.EyeOff, { size: 14, style: { opacity: 0.4 } })));
|
|
30758
|
+
})), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
30759
|
+
const next = { ...prev };
|
|
30760
|
+
resolvedColumns.forEach((c) => {
|
|
30761
|
+
const k = String(c.key);
|
|
30762
|
+
next[k] = { ...next[k], hidden: false };
|
|
30763
|
+
});
|
|
30764
|
+
return next;
|
|
30765
|
+
}) }, "Show All"), /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-action-btn", onClick: () => {
|
|
30766
|
+
const newOverrides = { ...columnOverrides };
|
|
30767
|
+
resolvedColumns.forEach((c) => {
|
|
30768
|
+
if (c.hideable !== false) {
|
|
30769
|
+
const key = String(c.key);
|
|
30770
|
+
newOverrides[key] = { ...newOverrides[key], hidden: true };
|
|
30771
|
+
}
|
|
30772
|
+
});
|
|
30773
|
+
setColumnOverrides(newOverrides);
|
|
30774
|
+
} }, "Hide All")))), showAdvancedFilter && /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal-overlay", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal dg-modal-wide", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal-header" }, /* @__PURE__ */ import_react18.default.createElement("h3", null, "Filters"), /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-icon-btn", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.X, { size: 18 }))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal-body" }, advancedFilters.map((f, idx) => /* @__PURE__ */ import_react18.default.createElement("div", { key: idx }, idx > 0 && /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-filter-logic" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
30717
30775
|
"button",
|
|
30718
30776
|
{
|
|
30719
30777
|
className: `dg-logic-btn${f.logic === "AND" ? " active" : ""}`,
|
|
@@ -30734,7 +30792,7 @@ function DataGrid({
|
|
|
30734
30792
|
value: f.column,
|
|
30735
30793
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, column: e.target.value } : fi))
|
|
30736
30794
|
},
|
|
30737
|
-
|
|
30795
|
+
resolvedColumns.map((c) => /* @__PURE__ */ import_react18.default.createElement("option", { key: String(c.key), value: String(c.key) }, c.header))
|
|
30738
30796
|
), /* @__PURE__ */ import_react18.default.createElement(
|
|
30739
30797
|
"select",
|
|
30740
30798
|
{
|
|
@@ -30761,7 +30819,7 @@ function DataGrid({
|
|
|
30761
30819
|
{
|
|
30762
30820
|
className: "dg-action-btn",
|
|
30763
30821
|
style: { alignSelf: "flex-start", marginTop: 4 },
|
|
30764
|
-
onClick: () => setAdvancedFilters((p) => [...p, { column: String(
|
|
30822
|
+
onClick: () => setAdvancedFilters((p) => [...p, { column: String(resolvedColumns[0].key), operator: "contains", value: "", logic: "AND" }])
|
|
30765
30823
|
},
|
|
30766
30824
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Plus, { size: 14 }),
|
|
30767
30825
|
" Add Filter"
|
|
@@ -30769,7 +30827,7 @@ function DataGrid({
|
|
|
30769
30827
|
"button",
|
|
30770
30828
|
{
|
|
30771
30829
|
className: "dg-action-btn",
|
|
30772
|
-
onClick: () => setAdvancedFilters([{ column: String(
|
|
30830
|
+
onClick: () => setAdvancedFilters([{ column: String(resolvedColumns[0].key), operator: "contains", value: "", logic: "AND" }])
|
|
30773
30831
|
},
|
|
30774
30832
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Trash2, { size: 14 }),
|
|
30775
30833
|
" Reset"
|
package/dist/main.js
CHANGED
|
@@ -170,14 +170,15 @@ import {
|
|
|
170
170
|
import {
|
|
171
171
|
closeIcon_default
|
|
172
172
|
} from "./chunk-Q5XKCUE3.js";
|
|
173
|
-
import "./chunk-GJGRMMAQ.js";
|
|
174
173
|
import {
|
|
175
174
|
AddressLookup_default
|
|
176
175
|
} from "./chunk-GHCM2AWR.js";
|
|
177
176
|
import {
|
|
178
177
|
FloatingInput
|
|
179
178
|
} from "./chunk-UPCMMCPQ.js";
|
|
180
|
-
import
|
|
179
|
+
import {
|
|
180
|
+
Checkbox
|
|
181
|
+
} from "./chunk-X357WQOT.js";
|
|
181
182
|
import {
|
|
182
183
|
RufousThemeProvider,
|
|
183
184
|
useRufousTheme
|
|
@@ -185,9 +186,11 @@ import {
|
|
|
185
186
|
import {
|
|
186
187
|
APP_THEMES
|
|
187
188
|
} from "./chunk-S7BNFVQO.js";
|
|
189
|
+
import "./chunk-7KRG7VNW.js";
|
|
188
190
|
import {
|
|
189
|
-
|
|
190
|
-
} from "./chunk-
|
|
191
|
+
DataGrid
|
|
192
|
+
} from "./chunk-LG4EJGMI.js";
|
|
193
|
+
import "./chunk-GJGRMMAQ.js";
|
|
191
194
|
import {
|
|
192
195
|
RichTextEditor
|
|
193
196
|
} from "./chunk-66HHM7VI.js";
|
|
@@ -207,9 +210,6 @@ import {
|
|
|
207
210
|
import {
|
|
208
211
|
circularProgress_default
|
|
209
212
|
} from "./chunk-CTBYVXFP.js";
|
|
210
|
-
import {
|
|
211
|
-
DataGrid
|
|
212
|
-
} from "./chunk-IKG2B6JQ.js";
|
|
213
213
|
import "./chunk-LI4N7JWK.js";
|
|
214
214
|
export {
|
|
215
215
|
APP_THEMES,
|