@adapttable/mantine 0.2.2 → 0.3.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/CHANGELOG.md +38 -0
- package/README.md +3 -1
- package/dist/index.cjs +20 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @adapttable/mantine
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6ab1391: docs: every package README now leads with a click-to-play demo — a poster (with
|
|
8
|
+
a play button) that links to an mp4 of the table in action — replacing the
|
|
9
|
+
autoplaying GIF. Republishing so the new READMEs land on npm.
|
|
10
|
+
- Updated dependencies [6ab1391]
|
|
11
|
+
- @adapttable/core@0.3.1
|
|
12
|
+
|
|
13
|
+
## 0.3.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- a90a2c2: Logical column pinning, so pinning stays correct under RTL.
|
|
18
|
+
|
|
19
|
+
**Breaking.** Pinned-side values are now `"start"` / `"end"` (were `"left"` /
|
|
20
|
+
`"right"`) — this is the public `pinned` layout value and the `colPin` URL token
|
|
21
|
+
(e.g. `colPin=name:start`); pre-existing `left`/`right` URLs no longer parse. The
|
|
22
|
+
label keys `pinLeft` / `pinRight` / `moveLeft` / `moveRight` are renamed to
|
|
23
|
+
`pinStart` / `pinEnd` / `moveStart` / `moveEnd`, with logical display strings
|
|
24
|
+
shipped for every locale. Pinning a data column is now a start-only toggle; the
|
|
25
|
+
injected actions column keeps its one-click end-pin.
|
|
26
|
+
|
|
27
|
+
To migrate: update any `defaultColumnLayout={{ pinned: { x: "left" } }}` to
|
|
28
|
+
`"start"` (and `"right"` → `"end"`), any persisted `colPin` URLs, and any custom
|
|
29
|
+
`labels` overriding the renamed keys.
|
|
30
|
+
|
|
31
|
+
- a90a2c2: Numbered page buttons in every adapter's pagination (with first/last and
|
|
32
|
+
ellipsis truncation), replacing the prev/next-only control — driven by a shared
|
|
33
|
+
`paginationItems` builder in `@adapttable/core`.
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [a90a2c2]
|
|
38
|
+
- Updated dependencies [a90a2c2]
|
|
39
|
+
- @adapttable/core@0.3.0
|
|
40
|
+
|
|
3
41
|
## 0.2.2
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @adapttable/mantine
|
|
2
2
|
|
|
3
|
-
](https://orwa-mahmoud.github.io/adapttable/media/demo-mantine.mp4)
|
|
4
|
+
|
|
5
|
+
▶ **[Watch the demo](https://orwa-mahmoud.github.io/adapttable/media/demo-mantine.mp4)**
|
|
4
6
|
|
|
5
7
|
**[📖 Documentation](https://orwa-mahmoud.github.io/adapttable/)** · **[🚀 Live demo](https://orwa-mahmoud.github.io/adapttable/demo/)** · **[Get started](https://orwa-mahmoud.github.io/adapttable/getting-started/)**
|
|
6
8
|
|
package/dist/index.cjs
CHANGED
|
@@ -1010,7 +1010,7 @@ function ActionsRow(t0) {
|
|
|
1010
1010
|
$[1] = t1;
|
|
1011
1011
|
} else t1 = $[1];
|
|
1012
1012
|
const hidden = t1;
|
|
1013
|
-
const pinned = layout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "
|
|
1013
|
+
const pinned = layout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "end";
|
|
1014
1014
|
let t2;
|
|
1015
1015
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1016
1016
|
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, { w: 22 });
|
|
@@ -1035,10 +1035,10 @@ function ActionsRow(t0) {
|
|
|
1035
1035
|
$[7] = t3;
|
|
1036
1036
|
$[8] = t4;
|
|
1037
1037
|
} else t4 = $[8];
|
|
1038
|
-
const t5 = `${pinned ? labels.unpin : labels.
|
|
1038
|
+
const t5 = `${pinned ? labels.unpin : labels.pinEnd}: ${labels.actions}`;
|
|
1039
1039
|
let t6;
|
|
1040
1040
|
if ($[9] !== layout || $[10] !== pinned) {
|
|
1041
|
-
t6 = () => layout.setPinned(_adapttable_core.ACTIONS_COLUMN_KEY, pinned ? void 0 : "
|
|
1041
|
+
t6 = () => layout.setPinned(_adapttable_core.ACTIONS_COLUMN_KEY, pinned ? void 0 : "end");
|
|
1042
1042
|
$[9] = layout;
|
|
1043
1043
|
$[10] = pinned;
|
|
1044
1044
|
$[11] = t6;
|
|
@@ -1136,7 +1136,7 @@ function ColumnMenu(t0) {
|
|
|
1136
1136
|
color: "gray",
|
|
1137
1137
|
size: "sm",
|
|
1138
1138
|
style: { cursor: "grab" },
|
|
1139
|
-
...(0, _adapttable_core.columnReorderKeyProps)(r.key, r.index, layout.move, `${labels.
|
|
1139
|
+
...(0, _adapttable_core.columnReorderKeyProps)(r.key, r.index, layout.move, `${labels.moveStart} / ${labels.moveEnd}: ${r.name}`),
|
|
1140
1140
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.GripIcon, {})
|
|
1141
1141
|
}),
|
|
1142
1142
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowVisibility, {
|
|
@@ -1844,7 +1844,7 @@ function desktopRowPropsEqual(prev, next) {
|
|
|
1844
1844
|
function leadingPinStyle(active, inset, zIndex, background) {
|
|
1845
1845
|
if (!active) return void 0;
|
|
1846
1846
|
const style = (0, _adapttable_core.pinnedCellStyle)({
|
|
1847
|
-
side: "
|
|
1847
|
+
side: "start",
|
|
1848
1848
|
inset
|
|
1849
1849
|
}, zIndex);
|
|
1850
1850
|
return background ? {
|
|
@@ -1857,11 +1857,11 @@ function leadingPinStyle(active, inset, zIndex, background) {
|
|
|
1857
1857
|
* columns). Memoized rows compare this one string instead of the per-render
|
|
1858
1858
|
* style objects derived from it.
|
|
1859
1859
|
*/
|
|
1860
|
-
function pinLayoutSignature(columns, pinOffset,
|
|
1860
|
+
function pinLayoutSignature(columns, pinOffset, hasStartPin, actionsEdgePinned) {
|
|
1861
1861
|
return `${columns.map((column) => {
|
|
1862
1862
|
const pin = pinOffset?.(column.key);
|
|
1863
1863
|
return pin ? `${column.key}:${pin.side}${pin.inset}` : column.key;
|
|
1864
|
-
}).join("|")}|${String(
|
|
1864
|
+
}).join("|")}|${String(hasStartPin)}|${String(actionsEdgePinned)}`;
|
|
1865
1865
|
}
|
|
1866
1866
|
/**
|
|
1867
1867
|
* One desktop row (plus its detail row when expanded), extracted so it can
|
|
@@ -2035,8 +2035,8 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2035
2035
|
const expandable = expansion !== void 0;
|
|
2036
2036
|
const groupCells = (0, _adapttable_core.headerGroupRow)(columns);
|
|
2037
2037
|
const summaryCells = summaryRow?.(rows);
|
|
2038
|
-
const
|
|
2039
|
-
const actionsEdgePinned = showActions && (
|
|
2038
|
+
const hasEndPin = table.columns.some((c) => pinOffset?.(c.key)?.side === "end");
|
|
2039
|
+
const actionsEdgePinned = showActions && (hasEndPin || actionsPinned);
|
|
2040
2040
|
const hasPinned = table.columns.some((c_0) => pinOffset?.(c_0.key) != null) || actionsEdgePinned;
|
|
2041
2041
|
const { ref: wrapperRef, overflowing } = (0, _adapttable_core.useHorizontalOverflow)();
|
|
2042
2042
|
const headerCellStyle = stickyHeader ? {
|
|
@@ -2051,10 +2051,10 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2051
2051
|
const actionsWidth = 120;
|
|
2052
2052
|
const expansionLead = expandable ? expansionWidth : 0;
|
|
2053
2053
|
const leads = {
|
|
2054
|
-
|
|
2055
|
-
|
|
2054
|
+
start: expansionLead + (selection ? selectionWidth : 0),
|
|
2055
|
+
end: showActions ? actionsWidth : 0
|
|
2056
2056
|
};
|
|
2057
|
-
const
|
|
2057
|
+
const hasStartPin = table.columns.some((c_1) => pinOffset?.(c_1.key)?.side === "start");
|
|
2058
2058
|
const pinBg = "var(--mantine-color-body)";
|
|
2059
2059
|
const headerStyleFor = (column) => {
|
|
2060
2060
|
const key = column.key;
|
|
@@ -2069,15 +2069,15 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2069
2069
|
};
|
|
2070
2070
|
const expansionHeaderStyle = {
|
|
2071
2071
|
...headerCellStyle,
|
|
2072
|
-
...leadingPinStyle(
|
|
2072
|
+
...leadingPinStyle(hasStartPin, 0, _adapttable_core.PIN_Z.headerPinned)
|
|
2073
2073
|
};
|
|
2074
2074
|
const selectionHeaderStyle = {
|
|
2075
2075
|
...headerCellStyle,
|
|
2076
|
-
...leadingPinStyle(
|
|
2076
|
+
...leadingPinStyle(hasStartPin, expansionLead, _adapttable_core.PIN_Z.headerPinned)
|
|
2077
2077
|
};
|
|
2078
2078
|
const actionsHeaderStyle = {
|
|
2079
2079
|
...headerCellStyle,
|
|
2080
|
-
...(0, _adapttable_core.edgePinStyle)("
|
|
2080
|
+
...(0, _adapttable_core.edgePinStyle)("end", actionsEdgePinned, _adapttable_core.PIN_Z.headerPinned)
|
|
2081
2081
|
};
|
|
2082
2082
|
const edgeBodyStyle = (side, active) => {
|
|
2083
2083
|
const pin_0 = (0, _adapttable_core.edgePinStyle)(side, active, _adapttable_core.PIN_Z.body);
|
|
@@ -2086,9 +2086,9 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2086
2086
|
background: pinBg
|
|
2087
2087
|
} : void 0;
|
|
2088
2088
|
};
|
|
2089
|
-
const expansionCellStyle = leadingPinStyle(
|
|
2090
|
-
const selectionCellStyle = leadingPinStyle(
|
|
2091
|
-
const actionsCellStyle = edgeBodyStyle("
|
|
2089
|
+
const expansionCellStyle = leadingPinStyle(hasStartPin, 0, _adapttable_core.PIN_Z.body, pinBg);
|
|
2090
|
+
const selectionCellStyle = leadingPinStyle(hasStartPin, expansionLead, _adapttable_core.PIN_Z.body, pinBg);
|
|
2091
|
+
const actionsCellStyle = edgeBodyStyle("end", actionsEdgePinned);
|
|
2092
2092
|
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
2093
2093
|
const resizeHandleFor = (column_1) => setWidth ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2094
2094
|
...(0, _adapttable_core.columnResizeHandleProps)(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
@@ -2110,7 +2110,7 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2110
2110
|
selectionRef.current = selection;
|
|
2111
2111
|
const toggleSelect = (0, react.useCallback)((id) => selectionRef.current.toggle(id), []);
|
|
2112
2112
|
const Row = (0, react.useMemo)(() => (0, react.memo)(DesktopRowBase, desktopRowPropsEqual), []);
|
|
2113
|
-
const pinSignature = pinLayoutSignature(columns, pinOffset,
|
|
2113
|
+
const pinSignature = pinLayoutSignature(columns, pinOffset, hasStartPin, actionsEdgePinned);
|
|
2114
2114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2115
2115
|
ref: (node) => {
|
|
2116
2116
|
wrapperRef(node);
|
|
@@ -3620,7 +3620,7 @@ function DataTable(props) {
|
|
|
3620
3620
|
$[2] = t5;
|
|
3621
3621
|
} else t5 = $[2];
|
|
3622
3622
|
const visibleRowActions = t5;
|
|
3623
|
-
const actionsPinned = chrome.columnLayout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "
|
|
3623
|
+
const actionsPinned = chrome.columnLayout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "end";
|
|
3624
3624
|
const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = (0, _adapttable_core.useChromeBodyData)(chrome, chromeProps);
|
|
3625
3625
|
const [drawerOpened, setDrawerOpened] = (0, react.useState)(false);
|
|
3626
3626
|
const filtersTrigger = (0, _adapttable_core.useFilterTriggerToggle)(drawerOpened, setDrawerOpened);
|