@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.js
CHANGED
|
@@ -618,6 +618,7 @@ function RowDragCell({ row, table }) {
|
|
|
618
618
|
* display order from the shared core when the click arrives, which is whatever render pass ran
|
|
619
619
|
* last. The controller answers from the commit instead (`use-row-commands.ts`).
|
|
620
620
|
*/
|
|
621
|
+
const CONTROL_CLASS_NAMES = { body: "ledger-selection-control" };
|
|
621
622
|
function noop() {}
|
|
622
623
|
function SelectionHeaderCell({ table }) {
|
|
623
624
|
const { labels, selection, size } = useDataTableContext();
|
|
@@ -628,6 +629,7 @@ function SelectionHeaderCell({ table }) {
|
|
|
628
629
|
return /* @__PURE__ */ jsx(Checkbox, {
|
|
629
630
|
"aria-label": labels.selectAllRows,
|
|
630
631
|
checked: allSelected,
|
|
632
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
631
633
|
indeterminate: !allSelected && someSelected,
|
|
632
634
|
size: SIZES[size].control,
|
|
633
635
|
onChange: noop,
|
|
@@ -647,6 +649,7 @@ function SelectionCell({ row }) {
|
|
|
647
649
|
if (row.getCanMultiSelect() === false) return /* @__PURE__ */ jsx(Radio, {
|
|
648
650
|
"aria-label": labels.selectRow,
|
|
649
651
|
checked: selected,
|
|
652
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
650
653
|
disabled: !row.getCanSelect(),
|
|
651
654
|
name: `${instanceId}-selection`,
|
|
652
655
|
size: SIZES[size].control,
|
|
@@ -656,6 +659,7 @@ function SelectionCell({ row }) {
|
|
|
656
659
|
return /* @__PURE__ */ jsx(Checkbox, {
|
|
657
660
|
"aria-label": labels.selectRow,
|
|
658
661
|
checked: selected,
|
|
662
|
+
classNames: CONTROL_CLASS_NAMES,
|
|
659
663
|
disabled: !row.getCanSelect(),
|
|
660
664
|
indeterminate: !selected && row.getIsSomeSelected(),
|
|
661
665
|
size: SIZES[size].control,
|
|
@@ -6530,7 +6534,8 @@ function useStylesRevision(getStyles, selectors) {
|
|
|
6530
6534
|
//#endregion
|
|
6531
6535
|
//#region src/use-viewport-fit.ts
|
|
6532
6536
|
const UNMEASURED = {
|
|
6533
|
-
|
|
6537
|
+
overflowsX: false,
|
|
6538
|
+
overflowsY: false,
|
|
6534
6539
|
underfilled: false
|
|
6535
6540
|
};
|
|
6536
6541
|
/**
|
|
@@ -6544,10 +6549,12 @@ function useViewportFit(viewport) {
|
|
|
6544
6549
|
if (!viewport) return;
|
|
6545
6550
|
const content = viewport.firstElementChild;
|
|
6546
6551
|
const measure = () => {
|
|
6547
|
-
const
|
|
6552
|
+
const overflowsX = viewport.scrollWidth - viewport.clientWidth > 1;
|
|
6553
|
+
const overflowsY = viewport.scrollHeight - viewport.clientHeight > 1;
|
|
6548
6554
|
const underfilled = content instanceof HTMLElement && viewport.clientHeight - content.offsetHeight >= 1;
|
|
6549
|
-
setFit((previous) => previous.
|
|
6550
|
-
|
|
6555
|
+
setFit((previous) => previous.overflowsX === overflowsX && previous.overflowsY === overflowsY && previous.underfilled === underfilled ? previous : {
|
|
6556
|
+
overflowsX,
|
|
6557
|
+
overflowsY,
|
|
6551
6558
|
underfilled
|
|
6552
6559
|
});
|
|
6553
6560
|
};
|
|
@@ -7163,7 +7170,7 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7163
7170
|
]);
|
|
7164
7171
|
const activeRowAnnouncer = useRef(null);
|
|
7165
7172
|
const rowNavigationHintId = `${instanceId}-row-navigation`;
|
|
7166
|
-
const viewportFocusStop = activeRowEnabled || viewportFit.
|
|
7173
|
+
const viewportFocusStop = activeRowEnabled || viewportFit.overflowsX || viewportFit.overflowsY;
|
|
7167
7174
|
const viewportDescribedBy = activeRowEnabled ? [viewportProps?.["aria-describedby"], rowNavigationHintId].filter(Boolean).join(" ") : viewportProps?.["aria-describedby"];
|
|
7168
7175
|
const announceActiveRow = useEventCallback(() => {
|
|
7169
7176
|
const target = activeRowAnnouncer.current;
|
|
@@ -7407,7 +7414,10 @@ function DataTableCore({ presentation, stylesProps, table }) {
|
|
|
7407
7414
|
scrollbar: { backgroundColor: "transparent" }
|
|
7408
7415
|
},
|
|
7409
7416
|
viewportProps: mergeElementProps(viewportProps, {
|
|
7410
|
-
style: {
|
|
7417
|
+
style: {
|
|
7418
|
+
overscrollBehaviorX: viewportFit.overflowsX ? "none" : "auto",
|
|
7419
|
+
overscrollBehaviorY: viewportFit.overflowsY ? "none" : "auto"
|
|
7420
|
+
},
|
|
7411
7421
|
role: "rowgroup",
|
|
7412
7422
|
"aria-label": viewportProps?.["aria-label"] ?? (viewportFocusStop ? labels.rows : void 0),
|
|
7413
7423
|
"aria-describedby": viewportDescribedBy,
|