@martinsura/ui 0.1.8 → 0.1.9
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.cjs +8 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1660,6 +1660,12 @@ function useGrid(defaults, storageKey) {
|
|
|
1660
1660
|
};
|
|
1661
1661
|
return { ...state, onChange, apiQuery };
|
|
1662
1662
|
}
|
|
1663
|
+
function getNestedValue(obj, path) {
|
|
1664
|
+
return path.split(".").reduce((acc, key) => {
|
|
1665
|
+
if (acc == null || typeof acc !== "object") return void 0;
|
|
1666
|
+
return acc[key];
|
|
1667
|
+
}, obj);
|
|
1668
|
+
}
|
|
1663
1669
|
var columnTypeWidth2 = {
|
|
1664
1670
|
date: 100,
|
|
1665
1671
|
datetime: 130,
|
|
@@ -1872,7 +1878,7 @@ var Grid = (props) => {
|
|
|
1872
1878
|
}
|
|
1873
1879
|
),
|
|
1874
1880
|
props.columns.map((col, colIdx) => {
|
|
1875
|
-
const content = col.render ? col.render(item) : col.dataField ? formatCellValue(item
|
|
1881
|
+
const content = col.render ? col.render(item) : col.dataField ? formatCellValue(getNestedValue(item, col.dataField), col.type) : null;
|
|
1876
1882
|
const centeredContent = col.align === "center";
|
|
1877
1883
|
const rightAlignedContent = col.align === "right";
|
|
1878
1884
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5360,6 +5366,7 @@ exports.TreeSelectInput = TreeSelectInput;
|
|
|
5360
5366
|
exports.UploadInput = UploadInput;
|
|
5361
5367
|
exports.UploadProvider = UploadProvider;
|
|
5362
5368
|
exports.getIcon = getIcon;
|
|
5369
|
+
exports.getNestedValue = getNestedValue;
|
|
5363
5370
|
exports.initUI = initUI;
|
|
5364
5371
|
exports.notification = notification;
|
|
5365
5372
|
exports.registerIcons = registerIcons;
|