@coldsmirk/ledger-mantine 0.9.0 → 0.9.2
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.cjs +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +7 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -642,6 +642,7 @@ function RowDragCell({ row, table }) {
|
|
|
642
642
|
* display order from the shared core when the click arrives, which is whatever render pass ran
|
|
643
643
|
* last. The controller answers from the commit instead (`use-row-commands.ts`).
|
|
644
644
|
*/
|
|
645
|
+
const CONTROL_CLASS_NAMES = { body: "ledger-selection-control" };
|
|
645
646
|
function noop() {}
|
|
646
647
|
function SelectionHeaderCell({ table }) {
|
|
647
648
|
const { labels, selection, size } = useDataTableContext();
|
|
@@ -652,6 +653,7 @@ function SelectionHeaderCell({ table }) {
|
|
|
652
653
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
653
654
|
"aria-label": labels.selectAllRows,
|
|
654
655
|
checked: allSelected,
|
|
656
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
655
657
|
indeterminate: !allSelected && someSelected,
|
|
656
658
|
size: SIZES[size].control,
|
|
657
659
|
onChange: noop,
|
|
@@ -671,6 +673,7 @@ function SelectionCell({ row }) {
|
|
|
671
673
|
if (row.getCanMultiSelect() === false) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Radio, {
|
|
672
674
|
"aria-label": labels.selectRow,
|
|
673
675
|
checked: selected,
|
|
676
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
674
677
|
disabled: !row.getCanSelect(),
|
|
675
678
|
name: `${instanceId}-selection`,
|
|
676
679
|
size: SIZES[size].control,
|
|
@@ -680,6 +683,7 @@ function SelectionCell({ row }) {
|
|
|
680
683
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
681
684
|
"aria-label": labels.selectRow,
|
|
682
685
|
checked: selected,
|
|
686
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
683
687
|
disabled: !row.getCanSelect(),
|
|
684
688
|
indeterminate: !selected && row.getIsSomeSelected(),
|
|
685
689
|
size: SIZES[size].control,
|
|
@@ -6554,7 +6558,8 @@ function useStylesRevision(getStyles, selectors) {
|
|
|
6554
6558
|
//#endregion
|
|
6555
6559
|
//#region src/use-viewport-fit.ts
|
|
6556
6560
|
const UNMEASURED = {
|
|
6557
|
-
|
|
6561
|
+
overflowsX: false,
|
|
6562
|
+
overflowsY: false,
|
|
6558
6563
|
underfilled: false
|
|
6559
6564
|
};
|
|
6560
6565
|
/**
|
|
@@ -6568,10 +6573,12 @@ function useViewportFit(viewport) {
|
|
|
6568
6573
|
if (!viewport) return;
|
|
6569
6574
|
const content = viewport.firstElementChild;
|
|
6570
6575
|
const measure = () => {
|
|
6571
|
-
const
|
|
6576
|
+
const overflowsX = viewport.scrollWidth - viewport.clientWidth > 1;
|
|
6577
|
+
const overflowsY = viewport.scrollHeight - viewport.clientHeight > 1;
|
|
6572
6578
|
const underfilled = content instanceof HTMLElement && viewport.clientHeight - content.offsetHeight >= 1;
|
|
6573
|
-
setFit((previous) => previous.
|
|
6574
|
-
|
|
6579
|
+
setFit((previous) => previous.overflowsX === overflowsX && previous.overflowsY === overflowsY && previous.underfilled === underfilled ? previous : {
|
|
6580
|
+
overflowsX,
|
|
6581
|
+
overflowsY,
|
|
6575
6582
|
underfilled
|
|
6576
6583
|
});
|
|
6577
6584
|
};
|
|
@@ -7187,7 +7194,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7187
7194
|
]);
|
|
7188
7195
|
const activeRowAnnouncer = (0, react.useRef)(null);
|
|
7189
7196
|
const rowNavigationHintId = `${instanceId}-row-navigation`;
|
|
7190
|
-
const viewportFocusStop = activeRowEnabled || viewportFit.
|
|
7197
|
+
const viewportFocusStop = activeRowEnabled || viewportFit.overflowsX || viewportFit.overflowsY;
|
|
7191
7198
|
const viewportDescribedBy = activeRowEnabled ? [viewportProps?.["aria-describedby"], rowNavigationHintId].filter(Boolean).join(" ") : viewportProps?.["aria-describedby"];
|
|
7192
7199
|
const announceActiveRow = useEventCallback(() => {
|
|
7193
7200
|
const target = activeRowAnnouncer.current;
|
|
@@ -7431,7 +7438,10 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7431
7438
|
scrollbar: { backgroundColor: "transparent" }
|
|
7432
7439
|
},
|
|
7433
7440
|
viewportProps: mergeElementProps(viewportProps, {
|
|
7434
|
-
style: {
|
|
7441
|
+
style: {
|
|
7442
|
+
overscrollBehaviorX: viewportFit.overflowsX ? "none" : "auto",
|
|
7443
|
+
overscrollBehaviorY: viewportFit.overflowsY ? "none" : "auto"
|
|
7444
|
+
},
|
|
7435
7445
|
role: "rowgroup",
|
|
7436
7446
|
"aria-label": viewportProps?.["aria-label"] ?? (viewportFocusStop ? labels.rows : void 0),
|
|
7437
7447
|
"aria-describedby": viewportDescribedBy,
|