@rufous/ui 0.1.68 → 0.1.70
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 +143 -98
- package/dist/DataGrid/DataGrid.js +1 -1
- package/dist/DataGrid/index.cjs +143 -98
- package/dist/DataGrid/index.js +1 -1
- package/dist/Dialogs/BaseDialog.css +0 -1
- package/dist/Dialogs/BaseDialog.js +16 -16
- package/dist/Dialogs/index.css +0 -1
- package/dist/Dialogs/index.js +16 -16
- package/dist/TextFields/AddressLookup.js +3 -3
- package/dist/{chunk-B6EOV25J.js → chunk-7OMS6IWF.js} +143 -98
- package/dist/icons/index.js +16 -16
- package/dist/main.cjs +143 -98
- package/dist/main.css +0 -1
- package/dist/main.js +35 -35
- package/dist/style.css +0 -1
- package/dist/styles/datagrid.css +0 -1
- package/package.json +1 -1
- package/dist/{chunk-4GPYGFPP.js → chunk-K6626C4D.js} +3 -3
- package/dist/{chunk-EB6MPFGC.js → chunk-M5GFOGY5.js} +3 -3
package/dist/main.cjs
CHANGED
|
@@ -30384,22 +30384,31 @@ function DataGrid({
|
|
|
30384
30384
|
pageSizeOptions = [5, 10, 25, 50],
|
|
30385
30385
|
title
|
|
30386
30386
|
}) {
|
|
30387
|
-
const
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
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]);
|
|
30393
30401
|
const [columnWidths, setColumnWidths] = (0, import_react18.useState)(() => {
|
|
30394
30402
|
const widths = {};
|
|
30395
|
-
|
|
30403
|
+
initialColumnsProp.forEach((col) => {
|
|
30404
|
+
const field = String(col.field || col.key || "");
|
|
30396
30405
|
const w = col.width || 200;
|
|
30397
|
-
widths[
|
|
30406
|
+
widths[field] = typeof w === "number" ? w : parseInt(w);
|
|
30398
30407
|
});
|
|
30399
30408
|
return widths;
|
|
30400
30409
|
});
|
|
30401
30410
|
const [pageSize, setPageSize] = (0, import_react18.useState)(initialPageSize);
|
|
30402
|
-
const [
|
|
30411
|
+
const [sortField, setSortField] = (0, import_react18.useState)(null);
|
|
30403
30412
|
const [sortDirection, setSortDirection] = (0, import_react18.useState)(null);
|
|
30404
30413
|
const [filterText, setFilterText] = (0, import_react18.useState)("");
|
|
30405
30414
|
const [currentPage, setCurrentPage] = (0, import_react18.useState)(1);
|
|
@@ -30412,40 +30421,15 @@ function DataGrid({
|
|
|
30412
30421
|
const menuRef = (0, import_react18.useRef)(null);
|
|
30413
30422
|
const [showManageColumns, setShowManageColumns] = (0, import_react18.useState)(false);
|
|
30414
30423
|
const [showAdvancedFilter, setShowAdvancedFilter] = (0, import_react18.useState)(false);
|
|
30424
|
+
const initialFilterCol = String(initialColumnsProp[0]?.field || initialColumnsProp[0]?.key || "");
|
|
30415
30425
|
const [advancedFilters, setAdvancedFilters] = (0, import_react18.useState)([
|
|
30416
|
-
{ column:
|
|
30426
|
+
{ column: initialFilterCol, operator: "contains", value: "", logic: "AND" }
|
|
30417
30427
|
]);
|
|
30418
|
-
(0, import_react18.useEffect)(() => {
|
|
30419
|
-
setColumns((prevColumns) => {
|
|
30420
|
-
return initialColumns.map((newCol) => {
|
|
30421
|
-
const prevCol = prevColumns.find((c) => (c.key || c.field) === (newCol.key || newCol.field));
|
|
30422
|
-
if (!prevCol) return newCol;
|
|
30423
|
-
return {
|
|
30424
|
-
...newCol,
|
|
30425
|
-
hidden: prevCol.hidden !== void 0 ? prevCol.hidden : newCol.hidden,
|
|
30426
|
-
pinned: prevCol.pinned !== void 0 ? prevCol.pinned : newCol.pinned
|
|
30427
|
-
};
|
|
30428
|
-
});
|
|
30429
|
-
});
|
|
30430
|
-
}, [initialColumns]);
|
|
30431
|
-
(0, import_react18.useEffect)(() => {
|
|
30432
|
-
setColumnWidths((prev) => {
|
|
30433
|
-
const next = { ...prev };
|
|
30434
|
-
initialColumns.forEach((col) => {
|
|
30435
|
-
const key = String(col.key);
|
|
30436
|
-
if (next[key] === void 0) {
|
|
30437
|
-
const w = col.width || 200;
|
|
30438
|
-
next[key] = typeof w === "number" ? w : parseInt(w);
|
|
30439
|
-
}
|
|
30440
|
-
});
|
|
30441
|
-
return next;
|
|
30442
|
-
});
|
|
30443
|
-
}, [initialColumns]);
|
|
30444
30428
|
const [colSearch, setColSearch] = (0, import_react18.useState)("");
|
|
30445
30429
|
(0, import_react18.useEffect)(() => {
|
|
30446
30430
|
const handleMouseMove = (e) => {
|
|
30447
30431
|
if (!resizingColumn) return;
|
|
30448
|
-
const col =
|
|
30432
|
+
const col = resolvedColumns.find((c) => String(c.field) === resizingColumn);
|
|
30449
30433
|
const diff = e.clientX - startX;
|
|
30450
30434
|
const minW = col?.minWidth ? typeof col.minWidth === "number" ? col.minWidth : parseInt(col.minWidth) : 80;
|
|
30451
30435
|
const maxW = col?.maxWidth ? typeof col.maxWidth === "number" ? col.maxWidth : parseInt(col.maxWidth) : Infinity;
|
|
@@ -30461,7 +30445,7 @@ function DataGrid({
|
|
|
30461
30445
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
30462
30446
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
30463
30447
|
};
|
|
30464
|
-
}, [resizingColumn, startX, startWidth,
|
|
30448
|
+
}, [resizingColumn, startX, startWidth, resolvedColumns]);
|
|
30465
30449
|
(0, import_react18.useEffect)(() => {
|
|
30466
30450
|
const handleClickOutside = (e) => {
|
|
30467
30451
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
@@ -30471,32 +30455,55 @@ function DataGrid({
|
|
|
30471
30455
|
document.addEventListener("mousedown", handleClickOutside);
|
|
30472
30456
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
30473
30457
|
}, []);
|
|
30474
|
-
|
|
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) => {
|
|
30475
30472
|
if (dir !== void 0) {
|
|
30476
|
-
|
|
30473
|
+
setSortField(fieldKey);
|
|
30477
30474
|
setSortDirection(dir);
|
|
30478
|
-
} else if (
|
|
30475
|
+
} else if (sortField === fieldKey) {
|
|
30479
30476
|
if (sortDirection === "asc") setSortDirection("desc");
|
|
30480
30477
|
else {
|
|
30481
|
-
|
|
30478
|
+
setSortField(null);
|
|
30482
30479
|
setSortDirection(null);
|
|
30483
30480
|
}
|
|
30484
30481
|
} else {
|
|
30485
|
-
|
|
30482
|
+
setSortField(fieldKey);
|
|
30486
30483
|
setSortDirection("asc");
|
|
30487
30484
|
}
|
|
30488
30485
|
setActiveMenu(null);
|
|
30489
30486
|
};
|
|
30490
|
-
const togglePin = (
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
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
|
+
});
|
|
30494
30495
|
setActiveMenu(null);
|
|
30495
30496
|
};
|
|
30496
|
-
const toggleHide = (
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
|
|
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
|
+
});
|
|
30500
30507
|
setActiveMenu(null);
|
|
30501
30508
|
};
|
|
30502
30509
|
const filteredData = (0, import_react18.useMemo)(() => {
|
|
@@ -30538,30 +30545,30 @@ function DataGrid({
|
|
|
30538
30545
|
});
|
|
30539
30546
|
}, [data, filterText, advancedFilters]);
|
|
30540
30547
|
const sortedData = (0, import_react18.useMemo)(() => {
|
|
30541
|
-
if (!
|
|
30542
|
-
const col =
|
|
30548
|
+
if (!sortField || !sortDirection) return filteredData;
|
|
30549
|
+
const col = resolvedColumns.find((c) => c.field === sortField);
|
|
30543
30550
|
return [...filteredData].sort((a, b) => {
|
|
30544
|
-
let aVal = a[
|
|
30545
|
-
let bVal = b[
|
|
30551
|
+
let aVal = a[sortField];
|
|
30552
|
+
let bVal = b[sortField];
|
|
30546
30553
|
if (col?.valueGetter) {
|
|
30547
|
-
aVal = col.valueGetter({ value: aVal, row: a, field: String(
|
|
30548
|
-
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) });
|
|
30549
30556
|
}
|
|
30550
30557
|
if (aVal < bVal) return sortDirection === "asc" ? -1 : 1;
|
|
30551
30558
|
if (aVal > bVal) return sortDirection === "asc" ? 1 : -1;
|
|
30552
30559
|
return 0;
|
|
30553
30560
|
});
|
|
30554
|
-
}, [filteredData,
|
|
30561
|
+
}, [filteredData, sortField, sortDirection, resolvedColumns]);
|
|
30555
30562
|
const totalPages = Math.max(1, Math.ceil(sortedData.length / pageSize));
|
|
30556
30563
|
const paginatedData = (0, import_react18.useMemo)(() => {
|
|
30557
30564
|
const start = (currentPage - 1) * pageSize;
|
|
30558
30565
|
return sortedData.slice(start, start + pageSize);
|
|
30559
30566
|
}, [sortedData, currentPage, pageSize]);
|
|
30560
30567
|
const handleExport = () => {
|
|
30561
|
-
const visibleCols =
|
|
30562
|
-
const headers = visibleCols.map((c) => c.
|
|
30568
|
+
const visibleCols = resolvedColumns.filter((c) => !c.hidden);
|
|
30569
|
+
const headers = visibleCols.map((c) => c.headerName).join(",");
|
|
30563
30570
|
const rows = sortedData.map(
|
|
30564
|
-
(item) => visibleCols.map((c) => `"${String(item[c.
|
|
30571
|
+
(item) => visibleCols.map((c) => `"${String(item[c.field]).replace(/"/g, '""')}"`).join(",")
|
|
30565
30572
|
);
|
|
30566
30573
|
const csv = [headers, ...rows].join("\n");
|
|
30567
30574
|
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
@@ -30572,24 +30579,34 @@ function DataGrid({
|
|
|
30572
30579
|
link2.click();
|
|
30573
30580
|
document.body.removeChild(link2);
|
|
30574
30581
|
};
|
|
30575
|
-
const handleMenuOpen = (e,
|
|
30582
|
+
const handleMenuOpen = (e, keyStr) => {
|
|
30576
30583
|
e.stopPropagation();
|
|
30577
30584
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
30578
|
-
|
|
30579
|
-
|
|
30585
|
+
let position2 = {
|
|
30586
|
+
top: rect.bottom + 4,
|
|
30587
|
+
left: rect.left
|
|
30588
|
+
};
|
|
30589
|
+
if (rect.left + 150 > window.innerWidth) {
|
|
30590
|
+
position2 = {
|
|
30591
|
+
top: rect.bottom + 4,
|
|
30592
|
+
right: window.innerWidth - rect.right
|
|
30593
|
+
};
|
|
30594
|
+
}
|
|
30595
|
+
setMenuPosition(position2);
|
|
30596
|
+
setActiveMenu(keyStr);
|
|
30580
30597
|
};
|
|
30581
30598
|
const visibleColumns = (0, import_react18.useMemo)(() => {
|
|
30582
|
-
const left =
|
|
30583
|
-
const mid =
|
|
30584
|
-
const right =
|
|
30599
|
+
const left = resolvedColumns.filter((c) => !c.hidden && c.pinned === "left");
|
|
30600
|
+
const mid = resolvedColumns.filter((c) => !c.hidden && !c.pinned);
|
|
30601
|
+
const right = resolvedColumns.filter((c) => !c.hidden && c.pinned === "right");
|
|
30585
30602
|
return [...left, ...mid, ...right];
|
|
30586
|
-
}, [
|
|
30603
|
+
}, [resolvedColumns]);
|
|
30587
30604
|
const getLeftOffset = (col, idx) => {
|
|
30588
30605
|
if (col.pinned !== "left") return void 0;
|
|
30589
30606
|
let offset2 = 0;
|
|
30590
30607
|
for (let i = 0; i < idx; i++) {
|
|
30591
30608
|
if (visibleColumns[i].pinned === "left") {
|
|
30592
|
-
offset2 += columnWidths[String(visibleColumns[i].
|
|
30609
|
+
offset2 += columnWidths[String(visibleColumns[i].field)] || 200;
|
|
30593
30610
|
}
|
|
30594
30611
|
}
|
|
30595
30612
|
return offset2;
|
|
@@ -30623,14 +30640,14 @@ function DataGrid({
|
|
|
30623
30640
|
},
|
|
30624
30641
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Columns, { size: 16 })
|
|
30625
30642
|
), /* @__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) => {
|
|
30626
|
-
const
|
|
30627
|
-
const width = columnWidths[
|
|
30643
|
+
const colField = String(col.field);
|
|
30644
|
+
const width = columnWidths[colField] || 200;
|
|
30628
30645
|
const leftOffset = getLeftOffset(col, idx);
|
|
30629
|
-
const isSorted =
|
|
30646
|
+
const isSorted = sortField === col.field;
|
|
30630
30647
|
return /* @__PURE__ */ import_react18.default.createElement(
|
|
30631
30648
|
"th",
|
|
30632
30649
|
{
|
|
30633
|
-
key:
|
|
30650
|
+
key: colField,
|
|
30634
30651
|
className: `dg-thead-cell${col.pinned === "left" ? " pinned-left" : col.pinned === "right" ? " pinned-right" : ""} ${col.headerClassName || ""}`,
|
|
30635
30652
|
style: { width, minWidth: width, left: leftOffset, flex: col.flex }
|
|
30636
30653
|
},
|
|
@@ -30638,25 +30655,25 @@ function DataGrid({
|
|
|
30638
30655
|
"div",
|
|
30639
30656
|
{
|
|
30640
30657
|
className: `dg-th-label${col.sortable === false ? " no-sort" : ""}`,
|
|
30641
|
-
onClick: () => col.sortable !== false && handleSort(col.
|
|
30658
|
+
onClick: () => col.sortable !== false && handleSort(col.field || "")
|
|
30642
30659
|
},
|
|
30643
|
-
col.
|
|
30660
|
+
col.headerName,
|
|
30644
30661
|
isSorted && sortDirection === "asc" && /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ChevronUp, { size: 12 }),
|
|
30645
30662
|
isSorted && sortDirection === "desc" && /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ChevronDown, { size: 12 })
|
|
30646
30663
|
), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-th-actions" }, !col.disableColumnMenu && /* @__PURE__ */ import_react18.default.createElement(
|
|
30647
30664
|
"button",
|
|
30648
30665
|
{
|
|
30649
30666
|
className: "dg-th-menu-btn",
|
|
30650
|
-
onClick: (e) => handleMenuOpen(e,
|
|
30667
|
+
onClick: (e) => handleMenuOpen(e, colField)
|
|
30651
30668
|
},
|
|
30652
30669
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.MoreVertical, { size: 13 })
|
|
30653
30670
|
), /* @__PURE__ */ import_react18.default.createElement(
|
|
30654
30671
|
"div",
|
|
30655
30672
|
{
|
|
30656
|
-
className: `dg-resizer${resizingColumn ===
|
|
30673
|
+
className: `dg-resizer${resizingColumn === colField ? " resizing" : ""}`,
|
|
30657
30674
|
onMouseDown: (e) => {
|
|
30658
30675
|
e.preventDefault();
|
|
30659
|
-
setResizingColumn(
|
|
30676
|
+
setResizingColumn(colField);
|
|
30660
30677
|
setStartX(e.clientX);
|
|
30661
30678
|
setStartWidth(width);
|
|
30662
30679
|
}
|
|
@@ -30664,19 +30681,19 @@ function DataGrid({
|
|
|
30664
30681
|
)))
|
|
30665
30682
|
);
|
|
30666
30683
|
}), 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) => {
|
|
30667
|
-
const
|
|
30668
|
-
const width = columnWidths[
|
|
30684
|
+
const colField = String(col.field);
|
|
30685
|
+
const width = columnWidths[colField] || 200;
|
|
30669
30686
|
const leftOffset = getLeftOffset(col, idx);
|
|
30670
30687
|
return /* @__PURE__ */ import_react18.default.createElement(
|
|
30671
30688
|
"td",
|
|
30672
30689
|
{
|
|
30673
|
-
key: `${item.id}-${
|
|
30690
|
+
key: `${item.id}-${colField}`,
|
|
30674
30691
|
className: `dg-td${col.pinned === "left" ? " pinned-left" : ""} ${col.cellClassName || ""}`,
|
|
30675
30692
|
style: { width, minWidth: width, maxWidth: width, left: leftOffset, flex: col.flex }
|
|
30676
30693
|
},
|
|
30677
30694
|
(() => {
|
|
30678
|
-
const field = String(col.
|
|
30679
|
-
const rawValue = item[col.
|
|
30695
|
+
const field = String(col.field);
|
|
30696
|
+
const rawValue = item[col.field || ""];
|
|
30680
30697
|
let value = col.valueGetter ? col.valueGetter({ value: rawValue, row: item, field }) : rawValue;
|
|
30681
30698
|
const formattedValue = col.valueFormatter ? col.valueFormatter({ value, row: item, field }) : value;
|
|
30682
30699
|
if (col.renderCell) {
|
|
@@ -30723,8 +30740,11 @@ function DataGrid({
|
|
|
30723
30740
|
/* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "asc") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ArrowUp, { size: 14 }), " Sort ascending"),
|
|
30724
30741
|
/* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "desc") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.ArrowDown, { size: 14 }), " Sort descending"),
|
|
30725
30742
|
/* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-menu-divider" }),
|
|
30726
|
-
|
|
30727
|
-
|
|
30743
|
+
(() => {
|
|
30744
|
+
const col = resolvedColumns.find((c) => c.field === activeMenu);
|
|
30745
|
+
if (!col) return null;
|
|
30746
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, col.pinned === "left" ? /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Pin, { size: 14, style: { transform: "rotate(45deg)" } }), " Pin left"), col.pinned === "right" ? /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Pin, { size: 14, style: { transform: "rotate(-45deg)" } }), " Pin right"));
|
|
30747
|
+
})(),
|
|
30728
30748
|
/* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-menu-divider" }),
|
|
30729
30749
|
/* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
30730
30750
|
setShowAdvancedFilter(true);
|
|
@@ -30744,7 +30764,27 @@ function DataGrid({
|
|
|
30744
30764
|
value: colSearch,
|
|
30745
30765
|
onChange: (e) => setColSearch(e.target.value)
|
|
30746
30766
|
}
|
|
30747
|
-
)),
|
|
30767
|
+
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
30768
|
+
const key = String(col.key);
|
|
30769
|
+
const isUnhideable = col.hideable === false;
|
|
30770
|
+
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 } })));
|
|
30771
|
+
})), /* @__PURE__ */ import_react18.default.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
30772
|
+
const next = { ...prev };
|
|
30773
|
+
resolvedColumns.forEach((c) => {
|
|
30774
|
+
const k = String(c.key);
|
|
30775
|
+
next[k] = { ...next[k], hidden: false };
|
|
30776
|
+
});
|
|
30777
|
+
return next;
|
|
30778
|
+
}) }, "Show All"), /* @__PURE__ */ import_react18.default.createElement("button", { className: "dg-action-btn", onClick: () => {
|
|
30779
|
+
const newOverrides = { ...columnOverrides };
|
|
30780
|
+
resolvedColumns.forEach((c) => {
|
|
30781
|
+
if (c.hideable !== false) {
|
|
30782
|
+
const key = String(c.key);
|
|
30783
|
+
newOverrides[key] = { ...newOverrides[key], hidden: true };
|
|
30784
|
+
}
|
|
30785
|
+
});
|
|
30786
|
+
setColumnOverrides(newOverrides);
|
|
30787
|
+
} }, "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(
|
|
30748
30788
|
"button",
|
|
30749
30789
|
{
|
|
30750
30790
|
className: `dg-logic-btn${f.logic === "AND" ? " active" : ""}`,
|
|
@@ -30765,7 +30805,7 @@ function DataGrid({
|
|
|
30765
30805
|
value: f.column,
|
|
30766
30806
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, column: e.target.value } : fi))
|
|
30767
30807
|
},
|
|
30768
|
-
|
|
30808
|
+
resolvedColumns.map((c) => /* @__PURE__ */ import_react18.default.createElement("option", { key: String(c.key), value: String(c.key) }, c.header))
|
|
30769
30809
|
), /* @__PURE__ */ import_react18.default.createElement(
|
|
30770
30810
|
"select",
|
|
30771
30811
|
{
|
|
@@ -30779,20 +30819,25 @@ function DataGrid({
|
|
|
30779
30819
|
/* @__PURE__ */ import_react18.default.createElement("option", { value: "ends with" }, "ends with"),
|
|
30780
30820
|
/* @__PURE__ */ import_react18.default.createElement("option", { value: "is empty" }, "is empty"),
|
|
30781
30821
|
/* @__PURE__ */ import_react18.default.createElement("option", { value: "is not empty" }, "is not empty")
|
|
30782
|
-
),
|
|
30783
|
-
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30789
|
-
|
|
30790
|
-
|
|
30822
|
+
), (() => {
|
|
30823
|
+
const col = resolvedColumns.find((c) => String(c.field) === f.column);
|
|
30824
|
+
const isDate = col?.type === "date";
|
|
30825
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
30826
|
+
"input",
|
|
30827
|
+
{
|
|
30828
|
+
type: isDate ? "date" : "text",
|
|
30829
|
+
className: "dg-filter-input",
|
|
30830
|
+
placeholder: "Value\u2026",
|
|
30831
|
+
value: f.value,
|
|
30832
|
+
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: e.target.value } : fi))
|
|
30833
|
+
}
|
|
30834
|
+
);
|
|
30835
|
+
})()))), /* @__PURE__ */ import_react18.default.createElement(
|
|
30791
30836
|
"button",
|
|
30792
30837
|
{
|
|
30793
30838
|
className: "dg-action-btn",
|
|
30794
30839
|
style: { alignSelf: "flex-start", marginTop: 4 },
|
|
30795
|
-
onClick: () => setAdvancedFilters((p) => [...p, { column: String(
|
|
30840
|
+
onClick: () => setAdvancedFilters((p) => [...p, { column: String(resolvedColumns[0].key), operator: "contains", value: "", logic: "AND" }])
|
|
30796
30841
|
},
|
|
30797
30842
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Plus, { size: 14 }),
|
|
30798
30843
|
" Add Filter"
|
|
@@ -30800,7 +30845,7 @@ function DataGrid({
|
|
|
30800
30845
|
"button",
|
|
30801
30846
|
{
|
|
30802
30847
|
className: "dg-action-btn",
|
|
30803
|
-
onClick: () => setAdvancedFilters([{ column: String(
|
|
30848
|
+
onClick: () => setAdvancedFilters([{ column: String(resolvedColumns[0].key), operator: "contains", value: "", logic: "AND" }])
|
|
30804
30849
|
},
|
|
30805
30850
|
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react.Trash2, { size: 14 }),
|
|
30806
30851
|
" Reset"
|
package/dist/main.css
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseDialog_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K6626C4D.js";
|
|
4
4
|
import "./chunk-E5RTHYCU.js";
|
|
5
|
-
import {
|
|
6
|
-
unsubscribeIcon_default
|
|
7
|
-
} from "./chunk-EZI3QGYJ.js";
|
|
8
5
|
import {
|
|
9
6
|
uploadIcon_default
|
|
10
7
|
} from "./chunk-QTGVW36I.js";
|
|
@@ -17,9 +14,6 @@ import {
|
|
|
17
14
|
import {
|
|
18
15
|
workItemIcon_default
|
|
19
16
|
} from "./chunk-QJPQC544.js";
|
|
20
|
-
import {
|
|
21
|
-
softSkillsIcon_default
|
|
22
|
-
} from "./chunk-3Y6QBRGD.js";
|
|
23
17
|
import {
|
|
24
18
|
subscribeIcon_default
|
|
25
19
|
} from "./chunk-JVN6QVET.js";
|
|
@@ -42,8 +36,8 @@ import {
|
|
|
42
36
|
unArchivedIcon_default
|
|
43
37
|
} from "./chunk-ZJAV3FEQ.js";
|
|
44
38
|
import {
|
|
45
|
-
|
|
46
|
-
} from "./chunk-
|
|
39
|
+
unsubscribeIcon_default
|
|
40
|
+
} from "./chunk-EZI3QGYJ.js";
|
|
47
41
|
import {
|
|
48
42
|
refreshIcon_default
|
|
49
43
|
} from "./chunk-YTVUM76D.js";
|
|
@@ -66,8 +60,8 @@ import {
|
|
|
66
60
|
sidebarIcon_default
|
|
67
61
|
} from "./chunk-DK3DA5LH.js";
|
|
68
62
|
import {
|
|
69
|
-
|
|
70
|
-
} from "./chunk-
|
|
63
|
+
softSkillsIcon_default
|
|
64
|
+
} from "./chunk-3Y6QBRGD.js";
|
|
71
65
|
import {
|
|
72
66
|
questionStatusAllIcon_default
|
|
73
67
|
} from "./chunk-4Y7SQ5EP.js";
|
|
@@ -90,8 +84,8 @@ import {
|
|
|
90
84
|
questionTypeMultipleIcon_default
|
|
91
85
|
} from "./chunk-Z7USRFM2.js";
|
|
92
86
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
87
|
+
questionTypeSingleIcon_default
|
|
88
|
+
} from "./chunk-Q4DHI3B5.js";
|
|
95
89
|
import {
|
|
96
90
|
invoiceIcon_default
|
|
97
91
|
} from "./chunk-6SUKO6QW.js";
|
|
@@ -114,8 +108,8 @@ import {
|
|
|
114
108
|
projectIcon_default
|
|
115
109
|
} from "./chunk-DLJHWFNG.js";
|
|
116
110
|
import {
|
|
117
|
-
|
|
118
|
-
} from "./chunk-
|
|
111
|
+
qualificationsIcon_default
|
|
112
|
+
} from "./chunk-UTBCFDOX.js";
|
|
119
113
|
import {
|
|
120
114
|
editIcon_default
|
|
121
115
|
} from "./chunk-H372BAXA.js";
|
|
@@ -135,8 +129,8 @@ import {
|
|
|
135
129
|
inactiveGroupIcon_default
|
|
136
130
|
} from "./chunk-77QDKDFI.js";
|
|
137
131
|
import {
|
|
138
|
-
|
|
139
|
-
} from "./chunk-
|
|
132
|
+
industryIcon_default
|
|
133
|
+
} from "./chunk-4BTXGP7U.js";
|
|
140
134
|
import {
|
|
141
135
|
difficultyAllIcon_default
|
|
142
136
|
} from "./chunk-5XKFPQLH.js";
|
|
@@ -158,6 +152,22 @@ import {
|
|
|
158
152
|
import {
|
|
159
153
|
downloadPdfIcon_default
|
|
160
154
|
} from "./chunk-N26C33E6.js";
|
|
155
|
+
import {
|
|
156
|
+
editChatIcon_default
|
|
157
|
+
} from "./chunk-XCE3QE6Q.js";
|
|
158
|
+
import {
|
|
159
|
+
AddressLookup_default
|
|
160
|
+
} from "./chunk-M5GFOGY5.js";
|
|
161
|
+
import {
|
|
162
|
+
RufousThemeProvider,
|
|
163
|
+
useRufousTheme
|
|
164
|
+
} from "./chunk-BOE27BFQ.js";
|
|
165
|
+
import {
|
|
166
|
+
APP_THEMES
|
|
167
|
+
} from "./chunk-S7BNFVQO.js";
|
|
168
|
+
import {
|
|
169
|
+
FloatingInput
|
|
170
|
+
} from "./chunk-UPCMMCPQ.js";
|
|
161
171
|
import {
|
|
162
172
|
activateUserIcon_default
|
|
163
173
|
} from "./chunk-AH6RCYDL.js";
|
|
@@ -171,22 +181,12 @@ import {
|
|
|
171
181
|
closeIcon_default
|
|
172
182
|
} from "./chunk-Q5XKCUE3.js";
|
|
173
183
|
import {
|
|
174
|
-
|
|
175
|
-
} from "./chunk-
|
|
176
|
-
import
|
|
177
|
-
FloatingInput
|
|
178
|
-
} from "./chunk-UPCMMCPQ.js";
|
|
184
|
+
copyIcon_default
|
|
185
|
+
} from "./chunk-6FEUS4CQ.js";
|
|
186
|
+
import "./chunk-GJGRMMAQ.js";
|
|
179
187
|
import {
|
|
180
188
|
Checkbox
|
|
181
189
|
} from "./chunk-X357WQOT.js";
|
|
182
|
-
import "./chunk-7KRG7VNW.js";
|
|
183
|
-
import {
|
|
184
|
-
DataGrid
|
|
185
|
-
} from "./chunk-B6EOV25J.js";
|
|
186
|
-
import "./chunk-GJGRMMAQ.js";
|
|
187
|
-
import {
|
|
188
|
-
RichTextEditor
|
|
189
|
-
} from "./chunk-66HHM7VI.js";
|
|
190
190
|
import "./chunk-QPGJCRBS.js";
|
|
191
191
|
import {
|
|
192
192
|
addButton_default
|
|
@@ -203,13 +203,13 @@ import {
|
|
|
203
203
|
import {
|
|
204
204
|
circularProgress_default
|
|
205
205
|
} from "./chunk-CTBYVXFP.js";
|
|
206
|
+
import "./chunk-7KRG7VNW.js";
|
|
206
207
|
import {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
} from "./chunk-BOE27BFQ.js";
|
|
208
|
+
DataGrid
|
|
209
|
+
} from "./chunk-7OMS6IWF.js";
|
|
210
210
|
import {
|
|
211
|
-
|
|
212
|
-
} from "./chunk-
|
|
211
|
+
RichTextEditor
|
|
212
|
+
} from "./chunk-66HHM7VI.js";
|
|
213
213
|
import "./chunk-LI4N7JWK.js";
|
|
214
214
|
export {
|
|
215
215
|
APP_THEMES,
|
package/dist/style.css
CHANGED
package/dist/styles/datagrid.css
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRufousTheme
|
|
3
|
+
} from "./chunk-BOE27BFQ.js";
|
|
1
4
|
import {
|
|
2
5
|
FloatingInput
|
|
3
6
|
} from "./chunk-UPCMMCPQ.js";
|
|
4
7
|
import {
|
|
5
8
|
circularProgress_default
|
|
6
9
|
} from "./chunk-CTBYVXFP.js";
|
|
7
|
-
import {
|
|
8
|
-
useRufousTheme
|
|
9
|
-
} from "./chunk-BOE27BFQ.js";
|
|
10
10
|
|
|
11
11
|
// lib/TextFields/AddressLookup.tsx
|
|
12
12
|
import React, { useState, useRef, useEffect } from "react";
|