@ethanhann/mantine-dataview 0.4.1 → 0.5.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 CHANGED
@@ -91,16 +91,18 @@ function q(e, t) {
91
91
  }
92
92
  }) || console.warn("[@ethanhann/mantine-dataview] animateRows is enabled but the CSS keyframes are missing. Import \"@ethanhann/mantine-dataview/styles.css\" in your app entry."), a.current = !0);
93
93
  }, [t]);
94
- let o = e.map((e) => e.id), s = /* @__PURE__ */ new Set();
94
+ let o = e.map((e) => e.id), s = /* @__PURE__ */ new Set(), c = i.current;
95
95
  if (t && r.current) {
96
96
  let e = n.current, t = new Set(e);
97
- if (o.length !== e.length || o.some((t, n) => t !== e[n])) if (i.current++, o.length === e.length && o.every((e) => t.has(e))) for (let e of o) s.add(e);
97
+ if (o.length !== e.length || o.some((t, n) => t !== e[n])) if (c = i.current + 1, o.length === e.length && o.every((e) => t.has(e))) for (let e of o) s.add(e);
98
98
  else for (let e of o) t.has(e) || s.add(e);
99
99
  }
100
- return n.current = o, r.current = !0, {
100
+ return V(() => {
101
+ n.current = o, r.current = !0, i.current = c;
102
+ }), {
101
103
  rows: e,
102
104
  entering: s,
103
- generation: i.current
105
+ generation: c
104
106
  };
105
107
  }
106
108
  //#endregion
@@ -521,11 +523,12 @@ function De({ colSpan: e, children: t }) {
521
523
  }) }) });
522
524
  }
523
525
  function Oe({ header: e, disabled: t }) {
524
- let { column: n } = e, r = n.columnDef.meta?.align, i = n.getIsSorted(), a = n.getSortIndex(), o = a > 0, c = e.isPlaceholder ? null : s(n.columnDef.header, e.getContext()), l = n.getCanSort() && !t;
526
+ let { column: n } = e, r = n.columnDef.meta?.align, i = n.getIsSorted(), a = n.getSortIndex(), o = a > 0, c = e.isPlaceholder ? null : s(n.columnDef.header, e.getContext()), l = n.getCanSort() && !t, u = n.columnDef.size;
525
527
  return /* @__PURE__ */ I(M.Th, {
526
528
  style: {
527
529
  ...we(n),
528
- ...r ? { textAlign: r } : void 0
530
+ ...r ? { textAlign: r } : void 0,
531
+ ...u == null ? void 0 : { width: u }
529
532
  },
530
533
  "aria-sort": i === "asc" ? "ascending" : i === "desc" ? "descending" : void 0,
531
534
  children: l ? /* @__PURE__ */ L(re, {
@@ -1191,6 +1194,7 @@ var nt = {
1191
1194
  header: i,
1192
1195
  ...n?.cell ? { cell: n.cell } : {},
1193
1196
  ...n?.enableSorting === !1 ? { enableSorting: !1 } : {},
1197
+ ...n?.width == null ? {} : { size: n.width },
1194
1198
  meta: {
1195
1199
  label: i,
1196
1200
  ...r.dataType ? { dataType: r.dataType } : {},