@ethanhann/mantine-dataview 0.3.0 → 0.4.1

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.d.ts CHANGED
@@ -5,7 +5,7 @@ export { DataCards, type DataCardsProps } from './components/DataCards';
5
5
  export { DataPagination, type DataPaginationProps, } from './components/DataPagination';
6
6
  export { DataTable, type DataTableProps } from './components/DataTable';
7
7
  export { DataToolbar, type DataToolbarProps, FilterControl, ViewSwitcher, type ViewSwitcherProps, } from './components/DataToolbar';
8
- export { DataView, type DataViewBodyProps, type DataViewContextValue, type DataViewProps, type DataViewToolbarProps, useDataViewContext, } from './components/DataView';
8
+ export { type DataViewContextValue, DataViewer, type DataViewerBodyProps, type DataViewerProps, type DataViewerToolbarProps, useDataViewContext, } from './components/DataViewer';
9
9
  export type { CardSlotContext, DataViewSlots, EmptySlotContext, ErrorSlotContext, RenderCardContext, RowSlotContext, } from './components/types';
10
10
  export { type CardField, type CardLayout, type CardLayoutRole, type ComposeCardOptions, composeCardLayout, resolveColumnLabel, } from './core/cardComposition';
11
11
  export { type ColOptions, ColumnBuilder, col } from './core/colBuilder';
package/dist/index.js CHANGED
@@ -81,15 +81,25 @@ function ue(e, t = {}) {
81
81
  //#endregion
82
82
  //#region src/core/useRowTransition.ts
83
83
  function q(e, t) {
84
- let n = U([]), r = U(!1), i = U(0), a = e.map((e) => e.id), o = /* @__PURE__ */ new Set();
84
+ let n = U([]), r = U(!1), i = U(0), a = U(!1);
85
+ V(() => {
86
+ t && !a.current && typeof document < "u" && process.env.NODE_ENV !== "production" && (Array.from(document.styleSheets).some((e) => {
87
+ try {
88
+ return Array.from(e.cssRules).some((e) => e instanceof CSSKeyframesRule && e.name === "dataview-row-enter");
89
+ } catch {
90
+ return !1;
91
+ }
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
+ }, [t]);
94
+ let o = e.map((e) => e.id), s = /* @__PURE__ */ new Set();
85
95
  if (t && r.current) {
86
96
  let e = n.current, t = new Set(e);
87
- if (a.length !== e.length || a.some((t, n) => t !== e[n])) if (i.current++, a.length === e.length && a.every((e) => t.has(e))) for (let e of a) o.add(e);
88
- else for (let e of a) t.has(e) || o.add(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);
98
+ else for (let e of o) t.has(e) || s.add(e);
89
99
  }
90
- return n.current = a, r.current = !0, {
100
+ return n.current = o, r.current = !0, {
91
101
  rows: e,
92
- entering: o,
102
+ entering: s,
93
103
  generation: i.current
94
104
  };
95
105
  }
@@ -1052,15 +1062,15 @@ function Je({ view: e, searchPlaceholder: t = "Search…", filterInlineThreshold
1052
1062
  });
1053
1063
  }
1054
1064
  //#endregion
1055
- //#region src/components/DataView/context.tsx
1065
+ //#region src/components/DataViewer/context.tsx
1056
1066
  var Ye = ae(null), Xe = Ye.Provider;
1057
1067
  function Z() {
1058
1068
  let e = B(Ye);
1059
- if (!e) throw Error("DataView.Toolbar / DataView.Body / DataView.Pagination must be rendered inside <DataView>.");
1069
+ if (!e) throw Error("DataViewer.Toolbar / DataViewer.Body / DataViewer.Pagination must be rendered inside <DataViewer>.");
1060
1070
  return e;
1061
1071
  }
1062
1072
  //#endregion
1063
- //#region src/components/DataView/DataView.tsx
1073
+ //#region src/components/DataViewer/DataViewer.tsx
1064
1074
  function Q({ view: e, slots: t, renderCard: n, fallbackRole: r, lockSwitcherOnMobile: i, animateRows: a, children: o, ...s }) {
1065
1075
  return /* @__PURE__ */ I(Xe, {
1066
1076
  value: H(() => ({
@@ -1561,6 +1571,6 @@ function yt({ fetcher: e, deps: t, ...n }) {
1561
1571
  });
1562
1572
  }
1563
1573
  //#endregion
1564
- export { rt as ColumnBuilder, G as DataBulkActions, me as DataCards, ge as DataPagination, Te as DataTable, Je as DataToolbar, Q as DataView, ze as FilterControl, Ge as ViewSwitcher, it as col, ue as composeCardLayout, a as createColumnHelper, ot as exportCsv, K as resolveColumnLabel, vt as useDataView, Z as useDataViewContext, yt as useDataViewFetcher };
1574
+ export { rt as ColumnBuilder, G as DataBulkActions, me as DataCards, ge as DataPagination, Te as DataTable, Je as DataToolbar, Q as DataViewer, ze as FilterControl, Ge as ViewSwitcher, it as col, ue as composeCardLayout, a as createColumnHelper, ot as exportCsv, K as resolveColumnLabel, vt as useDataView, Z as useDataViewContext, yt as useDataViewFetcher };
1565
1575
 
1566
1576
  //# sourceMappingURL=index.js.map