@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/dist/index.js
CHANGED
|
@@ -1009,7 +1009,7 @@ function ActionsRow(t0) {
|
|
|
1009
1009
|
$[1] = t1;
|
|
1010
1010
|
} else t1 = $[1];
|
|
1011
1011
|
const hidden = t1;
|
|
1012
|
-
const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] === "
|
|
1012
|
+
const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] === "end";
|
|
1013
1013
|
let t2;
|
|
1014
1014
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1015
1015
|
t2 = /* @__PURE__ */ jsx(Box, { w: 22 });
|
|
@@ -1034,10 +1034,10 @@ function ActionsRow(t0) {
|
|
|
1034
1034
|
$[7] = t3;
|
|
1035
1035
|
$[8] = t4;
|
|
1036
1036
|
} else t4 = $[8];
|
|
1037
|
-
const t5 = `${pinned ? labels.unpin : labels.
|
|
1037
|
+
const t5 = `${pinned ? labels.unpin : labels.pinEnd}: ${labels.actions}`;
|
|
1038
1038
|
let t6;
|
|
1039
1039
|
if ($[9] !== layout || $[10] !== pinned) {
|
|
1040
|
-
t6 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "
|
|
1040
|
+
t6 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "end");
|
|
1041
1041
|
$[9] = layout;
|
|
1042
1042
|
$[10] = pinned;
|
|
1043
1043
|
$[11] = t6;
|
|
@@ -1135,7 +1135,7 @@ function ColumnMenu(t0) {
|
|
|
1135
1135
|
color: "gray",
|
|
1136
1136
|
size: "sm",
|
|
1137
1137
|
style: { cursor: "grab" },
|
|
1138
|
-
...columnReorderKeyProps(r.key, r.index, layout.move, `${labels.
|
|
1138
|
+
...columnReorderKeyProps(r.key, r.index, layout.move, `${labels.moveStart} / ${labels.moveEnd}: ${r.name}`),
|
|
1139
1139
|
children: /* @__PURE__ */ jsx(GripIcon, {})
|
|
1140
1140
|
}),
|
|
1141
1141
|
/* @__PURE__ */ jsx(RowVisibility, {
|
|
@@ -1843,7 +1843,7 @@ function desktopRowPropsEqual(prev, next) {
|
|
|
1843
1843
|
function leadingPinStyle(active, inset, zIndex, background) {
|
|
1844
1844
|
if (!active) return void 0;
|
|
1845
1845
|
const style = pinnedCellStyle({
|
|
1846
|
-
side: "
|
|
1846
|
+
side: "start",
|
|
1847
1847
|
inset
|
|
1848
1848
|
}, zIndex);
|
|
1849
1849
|
return background ? {
|
|
@@ -1856,11 +1856,11 @@ function leadingPinStyle(active, inset, zIndex, background) {
|
|
|
1856
1856
|
* columns). Memoized rows compare this one string instead of the per-render
|
|
1857
1857
|
* style objects derived from it.
|
|
1858
1858
|
*/
|
|
1859
|
-
function pinLayoutSignature(columns, pinOffset,
|
|
1859
|
+
function pinLayoutSignature(columns, pinOffset, hasStartPin, actionsEdgePinned) {
|
|
1860
1860
|
return `${columns.map((column) => {
|
|
1861
1861
|
const pin = pinOffset?.(column.key);
|
|
1862
1862
|
return pin ? `${column.key}:${pin.side}${pin.inset}` : column.key;
|
|
1863
|
-
}).join("|")}|${String(
|
|
1863
|
+
}).join("|")}|${String(hasStartPin)}|${String(actionsEdgePinned)}`;
|
|
1864
1864
|
}
|
|
1865
1865
|
/**
|
|
1866
1866
|
* One desktop row (plus its detail row when expanded), extracted so it can
|
|
@@ -2034,8 +2034,8 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2034
2034
|
const expandable = expansion !== void 0;
|
|
2035
2035
|
const groupCells = headerGroupRow(columns);
|
|
2036
2036
|
const summaryCells = summaryRow?.(rows);
|
|
2037
|
-
const
|
|
2038
|
-
const actionsEdgePinned = showActions && (
|
|
2037
|
+
const hasEndPin = table.columns.some((c) => pinOffset?.(c.key)?.side === "end");
|
|
2038
|
+
const actionsEdgePinned = showActions && (hasEndPin || actionsPinned);
|
|
2039
2039
|
const hasPinned = table.columns.some((c_0) => pinOffset?.(c_0.key) != null) || actionsEdgePinned;
|
|
2040
2040
|
const { ref: wrapperRef, overflowing } = useHorizontalOverflow();
|
|
2041
2041
|
const headerCellStyle = stickyHeader ? {
|
|
@@ -2050,10 +2050,10 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2050
2050
|
const actionsWidth = 120;
|
|
2051
2051
|
const expansionLead = expandable ? expansionWidth : 0;
|
|
2052
2052
|
const leads = {
|
|
2053
|
-
|
|
2054
|
-
|
|
2053
|
+
start: expansionLead + (selection ? selectionWidth : 0),
|
|
2054
|
+
end: showActions ? actionsWidth : 0
|
|
2055
2055
|
};
|
|
2056
|
-
const
|
|
2056
|
+
const hasStartPin = table.columns.some((c_1) => pinOffset?.(c_1.key)?.side === "start");
|
|
2057
2057
|
const pinBg = "var(--mantine-color-body)";
|
|
2058
2058
|
const headerStyleFor = (column) => {
|
|
2059
2059
|
const key = column.key;
|
|
@@ -2068,15 +2068,15 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2068
2068
|
};
|
|
2069
2069
|
const expansionHeaderStyle = {
|
|
2070
2070
|
...headerCellStyle,
|
|
2071
|
-
...leadingPinStyle(
|
|
2071
|
+
...leadingPinStyle(hasStartPin, 0, PIN_Z.headerPinned)
|
|
2072
2072
|
};
|
|
2073
2073
|
const selectionHeaderStyle = {
|
|
2074
2074
|
...headerCellStyle,
|
|
2075
|
-
...leadingPinStyle(
|
|
2075
|
+
...leadingPinStyle(hasStartPin, expansionLead, PIN_Z.headerPinned)
|
|
2076
2076
|
};
|
|
2077
2077
|
const actionsHeaderStyle = {
|
|
2078
2078
|
...headerCellStyle,
|
|
2079
|
-
...edgePinStyle("
|
|
2079
|
+
...edgePinStyle("end", actionsEdgePinned, PIN_Z.headerPinned)
|
|
2080
2080
|
};
|
|
2081
2081
|
const edgeBodyStyle = (side, active) => {
|
|
2082
2082
|
const pin_0 = edgePinStyle(side, active, PIN_Z.body);
|
|
@@ -2085,9 +2085,9 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2085
2085
|
background: pinBg
|
|
2086
2086
|
} : void 0;
|
|
2087
2087
|
};
|
|
2088
|
-
const expansionCellStyle = leadingPinStyle(
|
|
2089
|
-
const selectionCellStyle = leadingPinStyle(
|
|
2090
|
-
const actionsCellStyle = edgeBodyStyle("
|
|
2088
|
+
const expansionCellStyle = leadingPinStyle(hasStartPin, 0, PIN_Z.body, pinBg);
|
|
2089
|
+
const selectionCellStyle = leadingPinStyle(hasStartPin, expansionLead, PIN_Z.body, pinBg);
|
|
2090
|
+
const actionsCellStyle = edgeBodyStyle("end", actionsEdgePinned);
|
|
2091
2091
|
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
2092
2092
|
const resizeHandleFor = (column_1) => setWidth ? /* @__PURE__ */ jsx("span", {
|
|
2093
2093
|
...columnResizeHandleProps(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
@@ -2109,7 +2109,7 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
2109
2109
|
selectionRef.current = selection;
|
|
2110
2110
|
const toggleSelect = useCallback((id) => selectionRef.current.toggle(id), []);
|
|
2111
2111
|
const Row = useMemo(() => memo(DesktopRowBase, desktopRowPropsEqual), []);
|
|
2112
|
-
const pinSignature = pinLayoutSignature(columns, pinOffset,
|
|
2112
|
+
const pinSignature = pinLayoutSignature(columns, pinOffset, hasStartPin, actionsEdgePinned);
|
|
2113
2113
|
return /* @__PURE__ */ jsx("div", {
|
|
2114
2114
|
ref: (node) => {
|
|
2115
2115
|
wrapperRef(node);
|
|
@@ -3619,7 +3619,7 @@ function DataTable(props) {
|
|
|
3619
3619
|
$[2] = t5;
|
|
3620
3620
|
} else t5 = $[2];
|
|
3621
3621
|
const visibleRowActions = t5;
|
|
3622
|
-
const actionsPinned = chrome.columnLayout.state.pinned[ACTIONS_COLUMN_KEY] === "
|
|
3622
|
+
const actionsPinned = chrome.columnLayout.state.pinned[ACTIONS_COLUMN_KEY] === "end";
|
|
3623
3623
|
const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = useChromeBodyData(chrome, chromeProps);
|
|
3624
3624
|
const [drawerOpened, setDrawerOpened] = useState(false);
|
|
3625
3625
|
const filtersTrigger = useFilterTriggerToggle(drawerOpened, setDrawerOpened);
|