trotl-table 1.0.65 → 1.0.67
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/Table.cjs.js +30 -5
- package/dist/Table.cjs.js.map +1 -1
- package/dist/Table.esm.js +30 -5
- package/dist/Table.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/Table.cjs.js
CHANGED
|
@@ -9640,6 +9640,7 @@ function TableInner({
|
|
|
9640
9640
|
data = [],
|
|
9641
9641
|
isGrouped = false,
|
|
9642
9642
|
groupKey = "groupId",
|
|
9643
|
+
routePath = null,
|
|
9643
9644
|
extraSearchTerm = "",
|
|
9644
9645
|
rowHeight = 34,
|
|
9645
9646
|
groupHeaderHeight = 36,
|
|
@@ -9798,7 +9799,12 @@ function TableInner({
|
|
|
9798
9799
|
setSearchTerm(extraSearchTerm);
|
|
9799
9800
|
return;
|
|
9800
9801
|
}
|
|
9802
|
+
const pagePath = routePath || null;
|
|
9801
9803
|
const updateSearchFromUrl = () => {
|
|
9804
|
+
// prevent clearing filter when we're navigating away from this table route
|
|
9805
|
+
if (pagePath && window.location.pathname !== pagePath) {
|
|
9806
|
+
return;
|
|
9807
|
+
}
|
|
9802
9808
|
const params = new URLSearchParams(window.location.search);
|
|
9803
9809
|
const entrySearch = params.get("entry");
|
|
9804
9810
|
const urlSearch = params.get("search");
|
|
@@ -10315,6 +10321,30 @@ function TableInner({
|
|
|
10315
10321
|
}));
|
|
10316
10322
|
}
|
|
10317
10323
|
|
|
10324
|
+
// Color column type (display color swatch background)
|
|
10325
|
+
if (col && col.type === 'color') {
|
|
10326
|
+
const colorVal = v || "transparent";
|
|
10327
|
+
const text = String(colorVal) ;
|
|
10328
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10329
|
+
style: {
|
|
10330
|
+
width: '100%',
|
|
10331
|
+
height: '100%',
|
|
10332
|
+
minHeight: '20px',
|
|
10333
|
+
backgroundColor: colorVal,
|
|
10334
|
+
color: '#000',
|
|
10335
|
+
border: '1px solid #ccc',
|
|
10336
|
+
boxSizing: 'border-box',
|
|
10337
|
+
display: 'flex',
|
|
10338
|
+
alignItems: 'center',
|
|
10339
|
+
justifyContent: 'center',
|
|
10340
|
+
fontSize: '12px',
|
|
10341
|
+
overflow: 'hidden'
|
|
10342
|
+
},
|
|
10343
|
+
title: isNoData ? translate("noData") : text,
|
|
10344
|
+
onClick: () => triggerCellCallback(row, col, colorVal)
|
|
10345
|
+
}, text);
|
|
10346
|
+
}
|
|
10347
|
+
|
|
10318
10348
|
// Input column type (editable text)
|
|
10319
10349
|
if (col && col.type === 'input') {
|
|
10320
10350
|
const text = isNoData ? "" : v == null ? "" : String(v);
|
|
@@ -10358,11 +10388,6 @@ function TableInner({
|
|
|
10358
10388
|
}
|
|
10359
10389
|
});
|
|
10360
10390
|
}
|
|
10361
|
-
if (isNoData) {
|
|
10362
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
10363
|
-
title: translate("noData")
|
|
10364
|
-
}, "...");
|
|
10365
|
-
}
|
|
10366
10391
|
|
|
10367
10392
|
// If column has dateFormat, format value as date/time
|
|
10368
10393
|
if (col && col.dateFormat && v) {
|