@prt-ts/fluent-react-table-v2 9.47.1-build-1.0 → 9.47.1-build-2.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/index.cjs.js
CHANGED
|
@@ -1560,6 +1560,7 @@ const useTableHeaderStyles = reactComponents.makeStyles({
|
|
|
1560
1560
|
height: '100%',
|
|
1561
1561
|
cursor: 'grab',
|
|
1562
1562
|
},
|
|
1563
|
+
tHeadCellDraggableDragging: Object.assign(Object.assign({}, reactComponents.shorthands.borderLeft(reactComponents.tokens.strokeWidthThin, 'solid', reactComponents.tokens.colorBrandBackgroundInverted)), reactComponents.shorthands.padding(0, reactComponents.tokens.spacingHorizontalXS)),
|
|
1563
1564
|
tHeadCellDragging: {
|
|
1564
1565
|
opacity: 0.5,
|
|
1565
1566
|
cursor: 'grabbing',
|
|
@@ -1617,7 +1618,7 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1617
1618
|
var _a, _b, _c;
|
|
1618
1619
|
const { column, id } = header;
|
|
1619
1620
|
const { isDragging, attributes, listeners, setNodeRef, transform, transition, } = sortable.useSortable({
|
|
1620
|
-
id:
|
|
1621
|
+
id: id
|
|
1621
1622
|
});
|
|
1622
1623
|
const dndStyle = {
|
|
1623
1624
|
transform: utilities.CSS.Translate.toString(transform),
|
|
@@ -1627,10 +1628,10 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1627
1628
|
const isLeafHeaders = ((_b = (_a = `${id}`) === null || _a === void 0 ? void 0 : _a.split('_')) === null || _b === void 0 ? void 0 : _b.length) === 1;
|
|
1628
1629
|
const headerCellCombinedStyles = getHeaderCellPinningStyles(column, isDragging, dndStyle);
|
|
1629
1630
|
if (header.isPlaceholder) {
|
|
1630
|
-
return (jsxRuntime.jsx("th", { colSpan: header.colSpan, className: styles.tHeadCell, style: headerCellCombinedStyles, ref: setNodeRef, children: jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getCanResize(), children: jsxRuntime.jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: reactComponents.mergeClasses(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }) }));
|
|
1631
|
+
return (jsxRuntime.jsx("th", Object.assign({ colSpan: header.colSpan, className: styles.tHeadCell, style: headerCellCombinedStyles, ref: setNodeRef }, attributes, listeners, { children: jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getCanResize(), children: jsxRuntime.jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: reactComponents.mergeClasses(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }) })));
|
|
1631
1632
|
}
|
|
1632
1633
|
const columnName = reactTable.flexRender(header.column.columnDef.header, header.getContext());
|
|
1633
|
-
return (jsxRuntime.jsxs("th", Object.assign({ colSpan: header.colSpan, className: reactComponents.mergeClasses(styles.tHeadCell, isLeafHeaders && styles.tHeadNonLeafCell, isDragging && styles.tHeadCellDragging), style: headerCellCombinedStyles, ref: setNodeRef }, tabAttributes, { tabIndex: 0, children: [jsxRuntime.jsx("div", Object.assign({ className: styles.tHeadCellDraggable }, attributes, listeners, { children: jsxRuntime.jsxs("div", { className: isLeafHeaders
|
|
1634
|
+
return (jsxRuntime.jsxs("th", Object.assign({ colSpan: header.colSpan, className: reactComponents.mergeClasses(styles.tHeadCell, isLeafHeaders && styles.tHeadNonLeafCell, isDragging && styles.tHeadCellDragging), style: headerCellCombinedStyles, ref: setNodeRef }, tabAttributes, { tabIndex: 0, children: [jsxRuntime.jsx("div", Object.assign({ className: reactComponents.mergeClasses(styles.tHeadCellDraggable, isDragging && styles.tHeadCellDraggableDragging) }, attributes, listeners, { children: jsxRuntime.jsxs("div", { className: isLeafHeaders
|
|
1634
1635
|
? styles.tLeafHeadCellContent
|
|
1635
1636
|
: styles.tNonLeafHeadCellContent, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(reactControlFlow.Show, { when: !header.isPlaceholder, children: jsxRuntime.jsxs(reactComponents.Button, { style: {
|
|
1636
1637
|
display: 'flex',
|
|
@@ -1648,18 +1649,14 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1648
1649
|
}, appearance: "transparent", className: styles.tHeadContentBtn, icon: (_c = {
|
|
1649
1650
|
asc: (jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(SortAscIcon, {}) })),
|
|
1650
1651
|
desc: (jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(SortDescIcon, {}) })),
|
|
1651
|
-
}[header.column.getIsSorted()]) !== null && _c !== void 0 ? _c : undefined, iconPosition: "after", children: [jsxRuntime.jsx("strong", { children: columnName }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsGrouped(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(GroupListRegular, {}) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsFiltered(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(FilterFilled, {}) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsPinned(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(PinRegular, {}) }) })] }) }) }), jsxRuntime.jsx(HeaderMenu, { header: header, table: table
|
|
1652
|
+
}[header.column.getIsSorted()]) !== null && _c !== void 0 ? _c : undefined, iconPosition: "after", children: [jsxRuntime.jsx("strong", { children: columnName }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsGrouped(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(GroupListRegular, {}) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsFiltered(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(FilterFilled, {}) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getIsPinned(), children: jsxRuntime.jsx("strong", { children: jsxRuntime.jsx(PinRegular, {}) }) })] }) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: isLeafHeaders, children: jsxRuntime.jsx(HeaderMenu, { header: header, table: table }) })] }) })), jsxRuntime.jsx(reactControlFlow.Show, { when: header.column.getCanResize(), children: jsxRuntime.jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: reactComponents.mergeClasses(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }), jsxRuntime.jsx(reactControlFlow.Show, { when: !isLeafHeaders, children: jsxRuntime.jsx("div", { className: styles.tHeadNonLeafCellFakeBorder }) })] })));
|
|
1652
1653
|
}
|
|
1653
1654
|
function HeaderMenu(props) {
|
|
1654
|
-
const { header, table
|
|
1655
|
+
const { header, table } = props;
|
|
1655
1656
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1656
1657
|
const { dispatchDrawerAction, drawerState } = table.options.meta;
|
|
1657
1658
|
const styles = useTableHeaderStyles();
|
|
1658
|
-
|
|
1659
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " }));
|
|
1660
|
-
const canHavePopOver = header.column.getCanSort() ||
|
|
1661
|
-
header.column.getCanGroup() ||
|
|
1662
|
-
header.column.getCanFilter();
|
|
1659
|
+
const canHavePopOver = header.column.getCanSort() || header.column.getCanGroup() || header.column.getCanFilter();
|
|
1663
1660
|
if (!canHavePopOver)
|
|
1664
1661
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " }));
|
|
1665
1662
|
const columnName = reactTable.flexRender(header.column.columnDef.header, header.getContext());
|
package/index.esm.js
CHANGED
|
@@ -1538,6 +1538,7 @@ const useTableHeaderStyles = makeStyles({
|
|
|
1538
1538
|
height: '100%',
|
|
1539
1539
|
cursor: 'grab',
|
|
1540
1540
|
},
|
|
1541
|
+
tHeadCellDraggableDragging: Object.assign(Object.assign({}, shorthands.borderLeft(tokens.strokeWidthThin, 'solid', tokens.colorBrandBackgroundInverted)), shorthands.padding(0, tokens.spacingHorizontalXS)),
|
|
1541
1542
|
tHeadCellDragging: {
|
|
1542
1543
|
opacity: 0.5,
|
|
1543
1544
|
cursor: 'grabbing',
|
|
@@ -1595,7 +1596,7 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1595
1596
|
var _a, _b, _c;
|
|
1596
1597
|
const { column, id } = header;
|
|
1597
1598
|
const { isDragging, attributes, listeners, setNodeRef, transform, transition, } = useSortable({
|
|
1598
|
-
id:
|
|
1599
|
+
id: id
|
|
1599
1600
|
});
|
|
1600
1601
|
const dndStyle = {
|
|
1601
1602
|
transform: CSS.Translate.toString(transform),
|
|
@@ -1605,10 +1606,10 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1605
1606
|
const isLeafHeaders = ((_b = (_a = `${id}`) === null || _a === void 0 ? void 0 : _a.split('_')) === null || _b === void 0 ? void 0 : _b.length) === 1;
|
|
1606
1607
|
const headerCellCombinedStyles = getHeaderCellPinningStyles(column, isDragging, dndStyle);
|
|
1607
1608
|
if (header.isPlaceholder) {
|
|
1608
|
-
return (jsx("th", { colSpan: header.colSpan, className: styles.tHeadCell, style: headerCellCombinedStyles, ref: setNodeRef, children: jsx(Show, { when: header.column.getCanResize(), children: jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: mergeClasses$1(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }) }));
|
|
1609
|
+
return (jsx("th", Object.assign({ colSpan: header.colSpan, className: styles.tHeadCell, style: headerCellCombinedStyles, ref: setNodeRef }, attributes, listeners, { children: jsx(Show, { when: header.column.getCanResize(), children: jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: mergeClasses$1(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }) })));
|
|
1609
1610
|
}
|
|
1610
1611
|
const columnName = flexRender(header.column.columnDef.header, header.getContext());
|
|
1611
|
-
return (jsxs("th", Object.assign({ colSpan: header.colSpan, className: mergeClasses$1(styles.tHeadCell, isLeafHeaders && styles.tHeadNonLeafCell, isDragging && styles.tHeadCellDragging), style: headerCellCombinedStyles, ref: setNodeRef }, tabAttributes, { tabIndex: 0, children: [jsx("div", Object.assign({ className: styles.tHeadCellDraggable }, attributes, listeners, { children: jsxs("div", { className: isLeafHeaders
|
|
1612
|
+
return (jsxs("th", Object.assign({ colSpan: header.colSpan, className: mergeClasses$1(styles.tHeadCell, isLeafHeaders && styles.tHeadNonLeafCell, isDragging && styles.tHeadCellDragging), style: headerCellCombinedStyles, ref: setNodeRef }, tabAttributes, { tabIndex: 0, children: [jsx("div", Object.assign({ className: mergeClasses$1(styles.tHeadCellDraggable, isDragging && styles.tHeadCellDraggableDragging) }, attributes, listeners, { children: jsxs("div", { className: isLeafHeaders
|
|
1612
1613
|
? styles.tLeafHeadCellContent
|
|
1613
1614
|
: styles.tNonLeafHeadCellContent, children: [jsx("div", { children: jsx(Show, { when: !header.isPlaceholder, children: jsxs(Button, { style: {
|
|
1614
1615
|
display: 'flex',
|
|
@@ -1626,18 +1627,14 @@ function HeaderCell({ header, table, tabAttributes }) {
|
|
|
1626
1627
|
}, appearance: "transparent", className: styles.tHeadContentBtn, icon: (_c = {
|
|
1627
1628
|
asc: (jsx("strong", { children: jsx(SortAscIcon, {}) })),
|
|
1628
1629
|
desc: (jsx("strong", { children: jsx(SortDescIcon, {}) })),
|
|
1629
|
-
}[header.column.getIsSorted()]) !== null && _c !== void 0 ? _c : undefined, iconPosition: "after", children: [jsx("strong", { children: columnName }), jsx(Show, { when: header.column.getIsGrouped(), children: jsx("strong", { children: jsx(GroupListRegular, {}) }) }), jsx(Show, { when: header.column.getIsFiltered(), children: jsx("strong", { children: jsx(FilterFilled, {}) }) }), jsx(Show, { when: header.column.getIsPinned(), children: jsx("strong", { children: jsx(PinRegular, {}) }) })] }) }) }), jsx(HeaderMenu, { header: header, table: table
|
|
1630
|
+
}[header.column.getIsSorted()]) !== null && _c !== void 0 ? _c : undefined, iconPosition: "after", children: [jsx("strong", { children: columnName }), jsx(Show, { when: header.column.getIsGrouped(), children: jsx("strong", { children: jsx(GroupListRegular, {}) }) }), jsx(Show, { when: header.column.getIsFiltered(), children: jsx("strong", { children: jsx(FilterFilled, {}) }) }), jsx(Show, { when: header.column.getIsPinned(), children: jsx("strong", { children: jsx(PinRegular, {}) }) })] }) }) }), jsx(Show, { when: isLeafHeaders, children: jsx(HeaderMenu, { header: header, table: table }) })] }) })), jsx(Show, { when: header.column.getCanResize(), children: jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: mergeClasses$1(styles.resizer, column.getIsResizing() && styles.resizerActive) }) }), jsx(Show, { when: !isLeafHeaders, children: jsx("div", { className: styles.tHeadNonLeafCellFakeBorder }) })] })));
|
|
1630
1631
|
}
|
|
1631
1632
|
function HeaderMenu(props) {
|
|
1632
|
-
const { header, table
|
|
1633
|
+
const { header, table } = props;
|
|
1633
1634
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1634
1635
|
const { dispatchDrawerAction, drawerState } = table.options.meta;
|
|
1635
1636
|
const styles = useTableHeaderStyles();
|
|
1636
|
-
|
|
1637
|
-
return (jsx(Fragment, { children: " " }));
|
|
1638
|
-
const canHavePopOver = header.column.getCanSort() ||
|
|
1639
|
-
header.column.getCanGroup() ||
|
|
1640
|
-
header.column.getCanFilter();
|
|
1637
|
+
const canHavePopOver = header.column.getCanSort() || header.column.getCanGroup() || header.column.getCanFilter();
|
|
1641
1638
|
if (!canHavePopOver)
|
|
1642
1639
|
return (jsx(Fragment, { children: " " }));
|
|
1643
1640
|
const columnName = flexRender(header.column.columnDef.header, header.getContext());
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useTableHeaderStyles: () => Record<"tHead" | "tHeadRow" | "tHeadCell" | "tHeadNonLeafCell" | "tHeadNonLeafCellFakeBorder" | "tHeadCellDraggable" | "tHeadCellDragging" | "tHeadCellOver" | "tLeafHeadCellContent" | "tNonLeafHeadCellContent" | "tHeadContentBtn" | "tHeadMenuPopover" | "resizer" | "resizerActive", string>;
|
|
1
|
+
export declare const useTableHeaderStyles: () => Record<"tHead" | "tHeadRow" | "tHeadCell" | "tHeadNonLeafCell" | "tHeadNonLeafCellFakeBorder" | "tHeadCellDraggable" | "tHeadCellDraggableDragging" | "tHeadCellDragging" | "tHeadCellOver" | "tLeafHeadCellContent" | "tNonLeafHeadCellContent" | "tHeadContentBtn" | "tHeadMenuPopover" | "resizer" | "resizerActive", string>;
|