@umami/react-zen 0.154.0 → 0.155.0
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 +8 -5
- package/dist/index.mjs +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30853,19 +30853,22 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
30853
30853
|
const items = data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
|
|
30854
30854
|
const widths = [];
|
|
30855
30855
|
const columns = import_react178.Children.map(children, (child) => {
|
|
30856
|
-
|
|
30857
|
-
|
|
30858
|
-
|
|
30856
|
+
if (child) {
|
|
30857
|
+
widths.push(child?.props?.width || "1fr");
|
|
30858
|
+
return { ...child?.props };
|
|
30859
|
+
}
|
|
30860
|
+
return null;
|
|
30861
|
+
})?.filter((n) => n);
|
|
30859
30862
|
const gridTemplateColumns2 = widths.join(" ");
|
|
30860
30863
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Table2, { ...props, className: (0, import_classnames25.default)(DataTable_default.datatable, className), children: [
|
|
30861
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns
|
|
30864
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, label, as, hidden, width, ...columnProps }) => {
|
|
30862
30865
|
if (hidden) {
|
|
30863
30866
|
return null;
|
|
30864
30867
|
}
|
|
30865
30868
|
return /* @__PURE__ */ (0, import_react179.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
|
|
30866
30869
|
}) }),
|
|
30867
30870
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableBody, { children: items.map((row, index) => {
|
|
30868
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns
|
|
30871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
30869
30872
|
if (hidden) {
|
|
30870
30873
|
return null;
|
|
30871
30874
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -30737,19 +30737,22 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
30737
30737
|
const items = data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
|
|
30738
30738
|
const widths = [];
|
|
30739
30739
|
const columns = Children2.map(children, (child) => {
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
|
|
30740
|
+
if (child) {
|
|
30741
|
+
widths.push(child?.props?.width || "1fr");
|
|
30742
|
+
return { ...child?.props };
|
|
30743
|
+
}
|
|
30744
|
+
return null;
|
|
30745
|
+
})?.filter((n) => n);
|
|
30743
30746
|
const gridTemplateColumns2 = widths.join(" ");
|
|
30744
30747
|
return /* @__PURE__ */ jsxs20(Table2, { ...props, className: (0, import_classnames25.default)(DataTable_default.datatable, className), children: [
|
|
30745
|
-
/* @__PURE__ */ jsx39(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns
|
|
30748
|
+
/* @__PURE__ */ jsx39(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, label, as, hidden, width, ...columnProps }) => {
|
|
30746
30749
|
if (hidden) {
|
|
30747
30750
|
return null;
|
|
30748
30751
|
}
|
|
30749
30752
|
return /* @__PURE__ */ createElement8(TableColumn, { ...columnProps, key: id, id }, label);
|
|
30750
30753
|
}) }),
|
|
30751
30754
|
/* @__PURE__ */ jsx39(TableBody, { children: items.map((row, index) => {
|
|
30752
|
-
return /* @__PURE__ */ jsx39(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns
|
|
30755
|
+
return /* @__PURE__ */ jsx39(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
30753
30756
|
if (hidden) {
|
|
30754
30757
|
return null;
|
|
30755
30758
|
}
|