@sustaina/shared-ui 1.68.0 → 1.70.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/dist/index.d.mts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/index.js +705 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +705 -301
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6550,7 +6550,7 @@ var MeasureText = React.forwardRef(({ style, children }, ref) => {
|
|
|
6550
6550
|
React.useImperativeHandle(ref, () => ({
|
|
6551
6551
|
isExceed: () => {
|
|
6552
6552
|
const span = spanRef.current;
|
|
6553
|
-
return span.scrollHeight > span.clientHeight;
|
|
6553
|
+
return span.scrollHeight > span.clientHeight || span.scrollWidth > span.clientWidth;
|
|
6554
6554
|
},
|
|
6555
6555
|
getHeight: () => spanRef.current.clientHeight
|
|
6556
6556
|
}));
|
|
@@ -8977,7 +8977,7 @@ var HeaderCell = ({
|
|
|
8977
8977
|
{
|
|
8978
8978
|
ref,
|
|
8979
8979
|
className: cn(
|
|
8980
|
-
"flex items-center justify-between gap-2",
|
|
8980
|
+
"flex items-center justify-between gap-2 h-full",
|
|
8981
8981
|
{
|
|
8982
8982
|
"cursor-pointer": context?.column?.getCanSort()
|
|
8983
8983
|
},
|
|
@@ -9005,13 +9005,17 @@ var HeaderCell = ({
|
|
|
9005
9005
|
showSorter && /* @__PURE__ */ jsxs(
|
|
9006
9006
|
"div",
|
|
9007
9007
|
{
|
|
9008
|
-
className:
|
|
9008
|
+
className: cn(
|
|
9009
|
+
"flex flex-col -space-y-2 transition-opacity duration-150",
|
|
9010
|
+
sorterProps?.rootClassName
|
|
9011
|
+
),
|
|
9012
|
+
style: { opacity: hovering || !!context.column.getIsSorted() ? 1 : 0.35 },
|
|
9009
9013
|
title: context.column.getCanSort() ? context.column.getNextSortingOrder() === "asc" ? "Sort ascending" : context.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort" : void 0,
|
|
9010
9014
|
children: [
|
|
9011
9015
|
/* @__PURE__ */ jsx(
|
|
9012
9016
|
ChevronUp,
|
|
9013
9017
|
{
|
|
9014
|
-
className: cn("stroke-[#BBBBBB]", {
|
|
9018
|
+
className: cn("stroke-[#BBBBBB] transition-colors duration-200", {
|
|
9015
9019
|
"stroke-sus-gray-5": context?.column?.getIsSorted() === "asc",
|
|
9016
9020
|
"stroke-sus-gray-5/45": context?.column?.getNextSortingOrder() === "asc" && hovering
|
|
9017
9021
|
}),
|
|
@@ -9022,7 +9026,7 @@ var HeaderCell = ({
|
|
|
9022
9026
|
/* @__PURE__ */ jsx(
|
|
9023
9027
|
ChevronDown,
|
|
9024
9028
|
{
|
|
9025
|
-
className: cn("stroke-[#BBBBBB]", {
|
|
9029
|
+
className: cn("stroke-[#BBBBBB] transition-colors duration-200", {
|
|
9026
9030
|
"stroke-sus-gray-5": context?.column?.getIsSorted() === "desc",
|
|
9027
9031
|
"stroke-sus-gray-5/45": context?.column?.getNextSortingOrder() === "desc" && hovering
|
|
9028
9032
|
}),
|
|
@@ -9098,7 +9102,7 @@ function TableHead({ className, ...props }) {
|
|
|
9098
9102
|
{
|
|
9099
9103
|
"data-slot": "table-head",
|
|
9100
9104
|
className: cn(
|
|
9101
|
-
"text-foreground h-9 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5 hover:bg-gray-200 bg-[#F0F0F0] truncate",
|
|
9105
|
+
"text-foreground h-9 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5 hover:bg-gray-200 bg-[#F0F0F0] truncate transition-colors duration-150",
|
|
9102
9106
|
className
|
|
9103
9107
|
),
|
|
9104
9108
|
...props
|
|
@@ -9457,8 +9461,13 @@ var useScrollFetch = ({ scrollFetch, containerRef }) => {
|
|
|
9457
9461
|
}, [fetchMoreOnScrollReached, containerRef]);
|
|
9458
9462
|
return fetchMoreOnScrollReached;
|
|
9459
9463
|
};
|
|
9464
|
+
|
|
9465
|
+
// src/components/data-table/constants.ts
|
|
9460
9466
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
9461
9467
|
var DEFAULT_OVER_SCAN = 10;
|
|
9468
|
+
var DEFAULT_COLUMN_OVERSCAN = 1;
|
|
9469
|
+
|
|
9470
|
+
// src/components/data-table/hooks/useTableVirtualizer.ts
|
|
9462
9471
|
var useTableVirtualizer = ({
|
|
9463
9472
|
enabled,
|
|
9464
9473
|
table,
|
|
@@ -9466,23 +9475,50 @@ var useTableVirtualizer = ({
|
|
|
9466
9475
|
virtual
|
|
9467
9476
|
}) => {
|
|
9468
9477
|
const rowModel = table.getRowModel().rows;
|
|
9478
|
+
const columnsEnabled = virtual?.columns?.enabled ?? false;
|
|
9479
|
+
const centerColumns = table.getCenterVisibleLeafColumns();
|
|
9480
|
+
const getRowVirtualItemKey = useCallback((index) => rowModel[index]?.id ?? index, [rowModel]);
|
|
9481
|
+
const getColumnVirtualItemKey = useCallback(
|
|
9482
|
+
(index) => centerColumns[index]?.id ?? index,
|
|
9483
|
+
[centerColumns]
|
|
9484
|
+
);
|
|
9469
9485
|
const virtualizer = useVirtualizer({
|
|
9470
9486
|
count: enabled ? rowModel.length : 0,
|
|
9471
9487
|
useFlushSync: false,
|
|
9472
9488
|
getScrollElement: () => containerRef.current,
|
|
9473
9489
|
estimateSize: () => DEFAULT_ROW_HEIGHT,
|
|
9490
|
+
getItemKey: getRowVirtualItemKey,
|
|
9474
9491
|
measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element?.getBoundingClientRect().height : void 0,
|
|
9475
9492
|
overscan: virtual?.overscan ?? DEFAULT_OVER_SCAN
|
|
9476
9493
|
});
|
|
9494
|
+
const columnVirtualizer = useVirtualizer({
|
|
9495
|
+
count: columnsEnabled ? centerColumns.length : 0,
|
|
9496
|
+
estimateSize: (index) => centerColumns[index]?.getSize() ?? 0,
|
|
9497
|
+
getScrollElement: () => containerRef.current,
|
|
9498
|
+
horizontal: true,
|
|
9499
|
+
getItemKey: getColumnVirtualItemKey,
|
|
9500
|
+
overscan: virtual?.columns?.overscan ?? DEFAULT_COLUMN_OVERSCAN
|
|
9501
|
+
});
|
|
9477
9502
|
const virtualItems = enabled ? virtualizer.getVirtualItems() : [];
|
|
9478
9503
|
const paddingTop = enabled && virtualItems.length > 0 ? virtualItems[0].start : 0;
|
|
9479
9504
|
const paddingBottom = enabled && virtualItems.length > 0 ? virtualizer.getTotalSize() - virtualItems[virtualItems.length - 1].end : 0;
|
|
9505
|
+
let columnVirtual;
|
|
9506
|
+
if (!columnsEnabled) {
|
|
9507
|
+
columnVirtual = { enabled: false };
|
|
9508
|
+
} else {
|
|
9509
|
+
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
9510
|
+
const virtualPaddingLeft = virtualColumns[0]?.start ?? 0;
|
|
9511
|
+
const virtualPaddingRight = columnVirtualizer.getTotalSize() - (virtualColumns[virtualColumns.length - 1]?.end ?? 0);
|
|
9512
|
+
columnVirtual = { enabled: true, virtualColumns, virtualPaddingLeft, virtualPaddingRight };
|
|
9513
|
+
}
|
|
9480
9514
|
return {
|
|
9481
9515
|
virtualizer,
|
|
9516
|
+
columnVirtualizer,
|
|
9482
9517
|
virtualItems,
|
|
9483
9518
|
paddingTop,
|
|
9484
9519
|
paddingBottom,
|
|
9485
|
-
rowModel
|
|
9520
|
+
rowModel,
|
|
9521
|
+
columnVirtual
|
|
9486
9522
|
};
|
|
9487
9523
|
};
|
|
9488
9524
|
function useComputedTableState({
|
|
@@ -9585,6 +9621,7 @@ var ColumnSeparator = ({ show, className, ...props }) => {
|
|
|
9585
9621
|
var ColumnSeparator_default = React__default.memo(ColumnSeparator);
|
|
9586
9622
|
|
|
9587
9623
|
// src/components/data-table/helpers.ts
|
|
9624
|
+
var toCSSId = (id) => id.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
9588
9625
|
function getColumnPinningInfo(column) {
|
|
9589
9626
|
const isPinned = column.getIsPinned();
|
|
9590
9627
|
const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left");
|
|
@@ -9595,8 +9632,8 @@ function getColumnPinningStyles(column) {
|
|
|
9595
9632
|
const { isPinned, isFirstRightPinnedColumn, isLastLeftPinnedColumn } = getColumnPinningInfo(column);
|
|
9596
9633
|
const classes = cn(isPinned ? "sticky" : "relative");
|
|
9597
9634
|
const style = {
|
|
9598
|
-
left: isPinned === "left" ? column.getStart("left") : void 0,
|
|
9599
|
-
right: isPinned === "right" ? column.getAfter("right") : void 0,
|
|
9635
|
+
left: isPinned === "left" ? `calc(var(--col-${toCSSId(column.id)}-pin-start, ${column.getStart("left")}) * 1px)` : void 0,
|
|
9636
|
+
right: isPinned === "right" ? `calc(var(--col-${toCSSId(column.id)}-pin-after, ${column.getAfter("right")}) * 1px)` : void 0,
|
|
9600
9637
|
zIndex: isPinned ? 1 : 0,
|
|
9601
9638
|
boxShadow: isLastLeftPinnedColumn ? "inset -1px 0 0 0 black" : isFirstRightPinnedColumn ? "inset 1px 0 0 0 black" : void 0
|
|
9602
9639
|
};
|
|
@@ -9615,102 +9652,223 @@ function getRowClickHandlers(handler, { rowData, row, table }) {
|
|
|
9615
9652
|
onClick: handleClick
|
|
9616
9653
|
};
|
|
9617
9654
|
}
|
|
9655
|
+
function renderHeaderCell(header, headerGroup, {
|
|
9656
|
+
columnResizing,
|
|
9657
|
+
virtual,
|
|
9658
|
+
components,
|
|
9659
|
+
table
|
|
9660
|
+
}, rowSpan) {
|
|
9661
|
+
const { classes, style } = getColumnPinningStyles(header.column);
|
|
9662
|
+
const useColumnSizing = header.column.columnDef?.meta?.useColumnSizing ?? columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9663
|
+
const tableHeadCellProps = typeof components?.tableHeadCellProps === "function" ? components?.tableHeadCellProps({ header, table }) : components?.tableHeadCellProps;
|
|
9664
|
+
const nextHeader = headerGroup.headers?.[header.index + 1] || header;
|
|
9665
|
+
const { isLastLeftPinnedColumn } = getColumnPinningInfo(header.column);
|
|
9666
|
+
const { isFirstRightPinnedColumn } = getColumnPinningInfo(nextHeader.column);
|
|
9667
|
+
const headerGroupLength = headerGroup.headers.length;
|
|
9668
|
+
const showSeparator = header.index !== headerGroupLength - 1 && !isLastLeftPinnedColumn && !isFirstRightPinnedColumn && (!header.isPlaceholder || !nextHeader.isPlaceholder);
|
|
9669
|
+
return /* @__PURE__ */ jsxs(
|
|
9670
|
+
TableHead,
|
|
9671
|
+
{
|
|
9672
|
+
"data-testid": `table-head-${header.id}`,
|
|
9673
|
+
colSpan: header.colSpan,
|
|
9674
|
+
rowSpan,
|
|
9675
|
+
...tableHeadCellProps,
|
|
9676
|
+
...header.column.columnDef?.meta?.headerProps,
|
|
9677
|
+
className: cn(
|
|
9678
|
+
classes,
|
|
9679
|
+
tableHeadCellProps?.className,
|
|
9680
|
+
header.column.columnDef?.meta?.headerProps?.className
|
|
9681
|
+
),
|
|
9682
|
+
style: {
|
|
9683
|
+
...style,
|
|
9684
|
+
width: useColumnSizing ? `calc(var(--header-${toCSSId(header.id)}-size, ${header.getSize()}) * 1px)` : void 0,
|
|
9685
|
+
minWidth: useColumnSizing ? header.column.columnDef.minSize : void 0,
|
|
9686
|
+
maxWidth: useColumnSizing ? header.column.columnDef.maxSize : void 0,
|
|
9687
|
+
...tableHeadCellProps?.style,
|
|
9688
|
+
...header.column.columnDef?.meta?.headerProps?.style
|
|
9689
|
+
},
|
|
9690
|
+
children: [
|
|
9691
|
+
!header.isPlaceholder || rowSpan ? flexRender(header.column.columnDef.header, header.getContext()) : null,
|
|
9692
|
+
/* @__PURE__ */ jsx(
|
|
9693
|
+
ColumnSeparator_default,
|
|
9694
|
+
{
|
|
9695
|
+
...components?.columnSeparatorProps?.headerCell,
|
|
9696
|
+
...header.column.columnDef?.meta?.columnSeparatorProps,
|
|
9697
|
+
show: header.column.columnDef?.meta?.columnSeparatorProps?.show ?? components?.columnSeparatorProps?.headerCell?.show ?? showSeparator
|
|
9698
|
+
}
|
|
9699
|
+
),
|
|
9700
|
+
/* @__PURE__ */ jsx(ColumnResizer_default, { header, ...components?.columnResizerProps })
|
|
9701
|
+
]
|
|
9702
|
+
},
|
|
9703
|
+
header.id
|
|
9704
|
+
);
|
|
9705
|
+
}
|
|
9618
9706
|
var TableHeaderRows = ({
|
|
9619
9707
|
table,
|
|
9620
9708
|
columnResizing,
|
|
9621
9709
|
virtual,
|
|
9710
|
+
columnVirtual,
|
|
9622
9711
|
components
|
|
9623
9712
|
}) => {
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9713
|
+
const cellProps = { columnResizing, virtual, components, table };
|
|
9714
|
+
const centerLeafCols = columnVirtual.enabled ? table.getCenterVisibleLeafColumns() : [];
|
|
9715
|
+
const totalGroups = table.getHeaderGroups().length;
|
|
9716
|
+
const spannedIds = /* @__PURE__ */ new Set();
|
|
9717
|
+
const resolveHeaderCell = (header, headerGroup, groupIndex) => {
|
|
9718
|
+
if (spannedIds.has(header.column.id)) return null;
|
|
9719
|
+
const remainingRows = totalGroups - groupIndex;
|
|
9720
|
+
if (header.isPlaceholder && header.column.columnDef.meta?.spanRows && remainingRows > 1) {
|
|
9721
|
+
spannedIds.add(header.column.id);
|
|
9722
|
+
return renderHeaderCell(header, headerGroup, cellProps, remainingRows);
|
|
9723
|
+
}
|
|
9724
|
+
return renderHeaderCell(header, headerGroup, cellProps);
|
|
9725
|
+
};
|
|
9726
|
+
return /* @__PURE__ */ jsx(Fragment, { children: table.getHeaderGroups().map((headerGroup, groupIndex) => {
|
|
9727
|
+
if (!columnVirtual.enabled) {
|
|
9728
|
+
return /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => resolveHeaderCell(header, headerGroup, groupIndex)) }, headerGroup.id);
|
|
9729
|
+
}
|
|
9730
|
+
const leftHeaders = table.getLeftHeaderGroups()[groupIndex]?.headers ?? [];
|
|
9731
|
+
const centerHeaders = table.getCenterHeaderGroups()[groupIndex]?.headers ?? [];
|
|
9732
|
+
const rightHeaders = table.getRightHeaderGroups()[groupIndex]?.headers ?? [];
|
|
9733
|
+
const isLeafLevel = !centerHeaders[0] || centerHeaders[0].subHeaders.length === 0;
|
|
9734
|
+
if (isLeafLevel) {
|
|
9735
|
+
return /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
9736
|
+
leftHeaders.map((header) => resolveHeaderCell(header, headerGroup, groupIndex)),
|
|
9737
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
9738
|
+
columnVirtual.virtualColumns.map((vc) => {
|
|
9739
|
+
const header = centerHeaders[vc.index];
|
|
9740
|
+
if (!header) return null;
|
|
9741
|
+
return renderHeaderCell(header, headerGroup, cellProps);
|
|
9742
|
+
}),
|
|
9743
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
9744
|
+
rightHeaders.map((header) => resolveHeaderCell(header, headerGroup, groupIndex))
|
|
9745
|
+
] }, headerGroup.id);
|
|
9746
|
+
}
|
|
9747
|
+
const leafToGroupIdx = [];
|
|
9748
|
+
let leafRunning = 0;
|
|
9749
|
+
for (let gi = 0; gi < centerHeaders.length; gi++) {
|
|
9750
|
+
for (let i = 0; i < centerHeaders[gi].colSpan; i++) {
|
|
9751
|
+
leafToGroupIdx[leafRunning + i] = gi;
|
|
9752
|
+
}
|
|
9753
|
+
leafRunning += centerHeaders[gi].colSpan;
|
|
9754
|
+
}
|
|
9755
|
+
const virtualCols = columnVirtual.virtualColumns;
|
|
9756
|
+
const useColumnSizing = columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9757
|
+
return /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
9758
|
+
leftHeaders.map((header) => resolveHeaderCell(header, headerGroup, groupIndex)),
|
|
9759
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
9760
|
+
virtualCols.map((vc, vcIdx) => {
|
|
9761
|
+
const gi = leafToGroupIdx[vc.index];
|
|
9762
|
+
if (gi === void 0) return null;
|
|
9763
|
+
const groupHeader = centerHeaders[gi];
|
|
9764
|
+
const leafCol = centerLeafCols[vc.index];
|
|
9765
|
+
const isFirst = vcIdx === 0 || leafToGroupIdx[virtualCols[vcIdx - 1].index] !== gi;
|
|
9766
|
+
const isLast = vcIdx === virtualCols.length - 1 || leafToGroupIdx[virtualCols[vcIdx + 1].index] !== gi;
|
|
9767
|
+
const { classes, style } = getColumnPinningStyles(groupHeader.column);
|
|
9768
|
+
const tableHeadCellProps = typeof components?.tableHeadCellProps === "function" ? components.tableHeadCellProps({ header: groupHeader, table }) : components?.tableHeadCellProps;
|
|
9769
|
+
return /* @__PURE__ */ jsxs(
|
|
9770
|
+
TableHead,
|
|
9771
|
+
{
|
|
9772
|
+
colSpan: 1,
|
|
9773
|
+
...tableHeadCellProps,
|
|
9774
|
+
...groupHeader.column.columnDef?.meta?.headerProps,
|
|
9775
|
+
className: cn(
|
|
9776
|
+
classes,
|
|
9777
|
+
tableHeadCellProps?.className,
|
|
9778
|
+
groupHeader.column.columnDef?.meta?.headerProps?.className
|
|
9663
9779
|
),
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9780
|
+
style: {
|
|
9781
|
+
...style,
|
|
9782
|
+
width: useColumnSizing ? `calc(var(--col-${toCSSId(leafCol.id)}-size, ${leafCol.getSize()}) * 1px)` : void 0,
|
|
9783
|
+
...tableHeadCellProps?.style,
|
|
9784
|
+
...groupHeader.column.columnDef?.meta?.headerProps?.style
|
|
9785
|
+
},
|
|
9786
|
+
children: [
|
|
9787
|
+
isFirst && !groupHeader.isPlaceholder ? flexRender(groupHeader.column.columnDef.header, groupHeader.getContext()) : null,
|
|
9788
|
+
/* @__PURE__ */ jsx(ColumnSeparator_default, { ...components?.columnSeparatorProps?.headerCell, show: isLast })
|
|
9789
|
+
]
|
|
9790
|
+
},
|
|
9791
|
+
`${groupHeader.id}-${leafCol.id}`
|
|
9792
|
+
);
|
|
9793
|
+
}),
|
|
9794
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
9795
|
+
rightHeaders.map((header) => resolveHeaderCell(header, headerGroup, groupIndex))
|
|
9796
|
+
] }, headerGroup.id);
|
|
9670
9797
|
}) });
|
|
9671
9798
|
};
|
|
9799
|
+
var MemoizedTableHeaderRows = React__default.memo(
|
|
9800
|
+
TableHeaderRows,
|
|
9801
|
+
(_, next) => next.isResizing === true
|
|
9802
|
+
);
|
|
9803
|
+
function renderFilterCell(column, {
|
|
9804
|
+
columnResizing,
|
|
9805
|
+
virtual,
|
|
9806
|
+
components,
|
|
9807
|
+
table
|
|
9808
|
+
}) {
|
|
9809
|
+
const { classes, style } = getColumnPinningStyles(column);
|
|
9810
|
+
const useColumnSizing = column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9811
|
+
const tableFilterCellProps = typeof components?.tableFilterCellProps === "function" ? components?.tableFilterCellProps({ column, table }) : components?.tableFilterCellProps;
|
|
9812
|
+
return /* @__PURE__ */ jsx(
|
|
9813
|
+
TableCell,
|
|
9814
|
+
{
|
|
9815
|
+
"data-testid": `table-filter-cell-${column.id}`,
|
|
9816
|
+
...tableFilterCellProps,
|
|
9817
|
+
...column.columnDef?.meta?.filterCellProps,
|
|
9818
|
+
className: cn(
|
|
9819
|
+
"bg-white border-b",
|
|
9820
|
+
classes,
|
|
9821
|
+
tableFilterCellProps?.className,
|
|
9822
|
+
column.columnDef?.meta?.filterCellProps?.className
|
|
9823
|
+
),
|
|
9824
|
+
style: {
|
|
9825
|
+
...style,
|
|
9826
|
+
width: useColumnSizing ? `calc(var(--col-${toCSSId(column.id)}-size, ${column.getSize()}) * 1px)` : void 0,
|
|
9827
|
+
minWidth: useColumnSizing ? column.columnDef.minSize : void 0,
|
|
9828
|
+
maxWidth: useColumnSizing ? column.columnDef.maxSize : void 0,
|
|
9829
|
+
...tableFilterCellProps?.style,
|
|
9830
|
+
...column.columnDef?.meta?.filterCellProps?.style
|
|
9831
|
+
},
|
|
9832
|
+
children: column.getCanFilter() && column.columnDef.meta?.renderColumnFilter?.({
|
|
9833
|
+
column,
|
|
9834
|
+
table
|
|
9835
|
+
})
|
|
9836
|
+
},
|
|
9837
|
+
column.id
|
|
9838
|
+
);
|
|
9839
|
+
}
|
|
9672
9840
|
var TableFilterRow = ({
|
|
9673
9841
|
table,
|
|
9674
9842
|
filterableColumns,
|
|
9675
9843
|
isSomeColumnsFilterable,
|
|
9676
9844
|
columnResizing,
|
|
9677
9845
|
virtual,
|
|
9846
|
+
columnVirtual,
|
|
9678
9847
|
components
|
|
9679
9848
|
}) => {
|
|
9680
9849
|
if (!isSomeColumnsFilterable) return null;
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
...style,
|
|
9699
|
-
width: useColumnSizing ? `calc(var(--col-${column.id}-size, ${column.getSize()}) * 1px)` : void 0,
|
|
9700
|
-
minWidth: useColumnSizing ? column.columnDef.minSize : void 0,
|
|
9701
|
-
maxWidth: useColumnSizing ? column.columnDef.maxSize : void 0,
|
|
9702
|
-
...tableFilterCellProps?.style,
|
|
9703
|
-
...column.columnDef?.meta?.filterCellProps?.style
|
|
9704
|
-
},
|
|
9705
|
-
children: column.getCanFilter() && column.columnDef.meta?.renderColumnFilter?.({
|
|
9706
|
-
column,
|
|
9707
|
-
table
|
|
9708
|
-
})
|
|
9709
|
-
},
|
|
9710
|
-
column.id
|
|
9711
|
-
);
|
|
9712
|
-
}) });
|
|
9850
|
+
const cellProps = { columnResizing, virtual, components, table };
|
|
9851
|
+
if (!columnVirtual.enabled) {
|
|
9852
|
+
return /* @__PURE__ */ jsx(TableRow, { "data-testid": "table-filter-row", children: filterableColumns.map((column) => renderFilterCell(column, cellProps)) });
|
|
9853
|
+
}
|
|
9854
|
+
const centerColumns = table.getCenterVisibleLeafColumns();
|
|
9855
|
+
const leftColumns = filterableColumns.filter((col) => col.getIsPinned() === "left");
|
|
9856
|
+
const centerFilterColumns = filterableColumns.filter((col) => !col.getIsPinned());
|
|
9857
|
+
const rightColumns = filterableColumns.filter((col) => col.getIsPinned() === "right");
|
|
9858
|
+
const centerColumnIndexMap = new Map(centerColumns.map((col, i) => [col.id, i]));
|
|
9859
|
+
const virtualIndexSet = new Set(columnVirtual.virtualColumns.map((vc) => vc.index));
|
|
9860
|
+
return /* @__PURE__ */ jsxs(TableRow, { "data-testid": "table-filter-row", children: [
|
|
9861
|
+
leftColumns.map((column) => renderFilterCell(column, cellProps)),
|
|
9862
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
9863
|
+
centerFilterColumns.filter((col) => virtualIndexSet.has(centerColumnIndexMap.get(col.id) ?? -1)).map((column) => renderFilterCell(column, cellProps)),
|
|
9864
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
9865
|
+
rightColumns.map((column) => renderFilterCell(column, cellProps))
|
|
9866
|
+
] });
|
|
9713
9867
|
};
|
|
9868
|
+
var MemoizedTableFilterRow = React__default.memo(
|
|
9869
|
+
TableFilterRow,
|
|
9870
|
+
(_, next) => next.isResizing === true
|
|
9871
|
+
);
|
|
9714
9872
|
var TableDataRows = ({
|
|
9715
9873
|
table,
|
|
9716
9874
|
rowModel,
|
|
@@ -9722,6 +9880,7 @@ var TableDataRows = ({
|
|
|
9722
9880
|
visibleColumnCount,
|
|
9723
9881
|
columnResizing,
|
|
9724
9882
|
virtual,
|
|
9883
|
+
columnVirtual,
|
|
9725
9884
|
onRowClick,
|
|
9726
9885
|
components
|
|
9727
9886
|
}) => {
|
|
@@ -9740,6 +9899,56 @@ var TableDataRows = ({
|
|
|
9740
9899
|
if (!row) return null;
|
|
9741
9900
|
const virtualIndex = config.isVirtualize ? item.index : void 0;
|
|
9742
9901
|
const tableDataRowProps = typeof components?.tableDataRowProps === "function" ? components.tableDataRowProps({ row, table }) || {} : components?.tableDataRowProps || {};
|
|
9902
|
+
const renderCell = (cell) => {
|
|
9903
|
+
const { classes, style } = getColumnPinningStyles(cell.column);
|
|
9904
|
+
const useColumnSizing = cell.column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9905
|
+
const tableDataCellProps = typeof components?.tableDataCellProps === "function" ? components?.tableDataCellProps({ row, cell, table }) : components?.tableDataCellProps;
|
|
9906
|
+
return /* @__PURE__ */ jsx(
|
|
9907
|
+
TableCell,
|
|
9908
|
+
{
|
|
9909
|
+
"data-testid": `table-data-cell-${cell.id}`,
|
|
9910
|
+
"data-row-id": row.id,
|
|
9911
|
+
"data-column-id": cell.column.id,
|
|
9912
|
+
...tableDataCellProps,
|
|
9913
|
+
...cell.column.columnDef?.meta?.cellProps,
|
|
9914
|
+
className: cn(
|
|
9915
|
+
{
|
|
9916
|
+
"bg-[#dfeae3]": row.getIsSelected(),
|
|
9917
|
+
"bg-white group-hover:bg-sus-primary-3-hover transition-colors duration-150": !row.getIsSelected()
|
|
9918
|
+
},
|
|
9919
|
+
classes,
|
|
9920
|
+
tableDataCellProps?.className,
|
|
9921
|
+
cell.column.columnDef?.meta?.cellProps?.className
|
|
9922
|
+
),
|
|
9923
|
+
style: {
|
|
9924
|
+
...style,
|
|
9925
|
+
width: useColumnSizing ? `calc(var(--col-${toCSSId(cell.column.id)}-size, ${cell.column.getSize()}) * 1px)` : void 0,
|
|
9926
|
+
minWidth: useColumnSizing ? cell.column.columnDef.minSize : void 0,
|
|
9927
|
+
maxWidth: useColumnSizing ? cell.column.columnDef.maxSize : void 0,
|
|
9928
|
+
...tableDataCellProps?.style,
|
|
9929
|
+
...cell.column.columnDef?.meta?.cellProps?.style
|
|
9930
|
+
},
|
|
9931
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
9932
|
+
},
|
|
9933
|
+
cell.id
|
|
9934
|
+
);
|
|
9935
|
+
};
|
|
9936
|
+
const rowContent = columnVirtual.enabled ? (() => {
|
|
9937
|
+
const leftCells = row.getLeftVisibleCells();
|
|
9938
|
+
const centerCells = row.getCenterVisibleCells();
|
|
9939
|
+
const rightCells = row.getRightVisibleCells();
|
|
9940
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9941
|
+
leftCells.map(renderCell),
|
|
9942
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
9943
|
+
columnVirtual.virtualColumns.map((vc) => {
|
|
9944
|
+
const cell = centerCells[vc.index];
|
|
9945
|
+
if (!cell) return null;
|
|
9946
|
+
return renderCell(cell);
|
|
9947
|
+
}),
|
|
9948
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
9949
|
+
rightCells.map(renderCell)
|
|
9950
|
+
] });
|
|
9951
|
+
})() : row.getVisibleCells().map(renderCell);
|
|
9743
9952
|
return /* @__PURE__ */ createElement(
|
|
9744
9953
|
TableRow,
|
|
9745
9954
|
{
|
|
@@ -9757,40 +9966,7 @@ var TableDataRows = ({
|
|
|
9757
9966
|
table
|
|
9758
9967
|
})
|
|
9759
9968
|
},
|
|
9760
|
-
|
|
9761
|
-
const { classes, style } = getColumnPinningStyles(cell.column);
|
|
9762
|
-
const useColumnSizing = cell.column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9763
|
-
const tableDataCellProps = typeof components?.tableDataCellProps === "function" ? components?.tableDataCellProps({ row, cell, table }) : components?.tableDataCellProps;
|
|
9764
|
-
return /* @__PURE__ */ jsx(
|
|
9765
|
-
TableCell,
|
|
9766
|
-
{
|
|
9767
|
-
"data-testid": `table-data-cell-${cell.id}`,
|
|
9768
|
-
"data-row-id": row.id,
|
|
9769
|
-
"data-column-id": cell.column.id,
|
|
9770
|
-
...tableDataCellProps,
|
|
9771
|
-
...cell.column.columnDef?.meta?.cellProps,
|
|
9772
|
-
className: cn(
|
|
9773
|
-
{
|
|
9774
|
-
"bg-[#dfeae3]": row.getIsSelected(),
|
|
9775
|
-
"bg-white group-hover:bg-sus-primary-3-hover": !row.getIsSelected()
|
|
9776
|
-
},
|
|
9777
|
-
classes,
|
|
9778
|
-
tableDataCellProps?.className,
|
|
9779
|
-
cell.column.columnDef?.meta?.cellProps?.className
|
|
9780
|
-
),
|
|
9781
|
-
style: {
|
|
9782
|
-
...style,
|
|
9783
|
-
width: useColumnSizing ? `calc(var(--col-${cell.column.id}-size, ${cell.column.getSize()}) * 1px)` : void 0,
|
|
9784
|
-
minWidth: useColumnSizing ? cell.column.columnDef.minSize : void 0,
|
|
9785
|
-
maxWidth: useColumnSizing ? cell.column.columnDef.maxSize : void 0,
|
|
9786
|
-
...tableDataCellProps?.style,
|
|
9787
|
-
...cell.column.columnDef?.meta?.cellProps?.style
|
|
9788
|
-
},
|
|
9789
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
9790
|
-
},
|
|
9791
|
-
cell.id
|
|
9792
|
-
);
|
|
9793
|
-
})
|
|
9969
|
+
rowContent
|
|
9794
9970
|
);
|
|
9795
9971
|
}),
|
|
9796
9972
|
virtualEnabled && paddingBottom > 0 && /* @__PURE__ */ jsx(TableRow, { "aria-hidden": "true", "data-testid": "table-virtual-padding-bottom", children: /* @__PURE__ */ jsx(
|
|
@@ -9805,68 +9981,161 @@ var TableDataRows = ({
|
|
|
9805
9981
|
};
|
|
9806
9982
|
var MemoizedTableDataRows = React__default.memo(
|
|
9807
9983
|
TableDataRows,
|
|
9808
|
-
(
|
|
9984
|
+
(_, next) => next.isResizing === true
|
|
9809
9985
|
);
|
|
9986
|
+
function renderFooterCell(footer, footerGroup, {
|
|
9987
|
+
columnResizing,
|
|
9988
|
+
virtual,
|
|
9989
|
+
components,
|
|
9990
|
+
table
|
|
9991
|
+
}, rowSpan) {
|
|
9992
|
+
const { classes, style } = getColumnPinningStyles(footer.column);
|
|
9993
|
+
const useColumnSizing = footer.column.columnDef?.meta?.useColumnSizing ?? columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
9994
|
+
const tableFooterCellProps = typeof components?.tableFooterCellProps === "function" ? components.tableFooterCellProps({ footer, table }) : components?.tableFooterCellProps;
|
|
9995
|
+
const nextFooter = footerGroup.headers[footer.index + 1] ?? footer;
|
|
9996
|
+
const { isLastLeftPinnedColumn } = getColumnPinningInfo(footer.column);
|
|
9997
|
+
const { isFirstRightPinnedColumn } = getColumnPinningInfo(nextFooter.column);
|
|
9998
|
+
const footerGroupLength = footerGroup.headers.length;
|
|
9999
|
+
const showSeparator = footer.index !== footerGroupLength - 1 && !isLastLeftPinnedColumn && !isFirstRightPinnedColumn && (!footer.isPlaceholder || !nextFooter.isPlaceholder);
|
|
10000
|
+
return /* @__PURE__ */ jsxs(
|
|
10001
|
+
TableHead,
|
|
10002
|
+
{
|
|
10003
|
+
"data-testid": `footer-cell-${footer.id}`,
|
|
10004
|
+
colSpan: footer.colSpan,
|
|
10005
|
+
rowSpan,
|
|
10006
|
+
...tableFooterCellProps,
|
|
10007
|
+
...footer.column.columnDef?.meta?.footerProps,
|
|
10008
|
+
className: cn(
|
|
10009
|
+
classes,
|
|
10010
|
+
tableFooterCellProps?.className,
|
|
10011
|
+
footer.column.columnDef?.meta?.footerProps?.className
|
|
10012
|
+
),
|
|
10013
|
+
style: {
|
|
10014
|
+
...style,
|
|
10015
|
+
width: useColumnSizing ? `calc(var(--col-${toCSSId(footer.column.id)}-size, ${footer.column.getSize()}) * 1px)` : void 0,
|
|
10016
|
+
minWidth: useColumnSizing ? footer.column.columnDef.minSize : void 0,
|
|
10017
|
+
maxWidth: useColumnSizing ? footer.column.columnDef.maxSize : void 0,
|
|
10018
|
+
...tableFooterCellProps?.style,
|
|
10019
|
+
...footer.column.columnDef?.meta?.footerProps?.style
|
|
10020
|
+
},
|
|
10021
|
+
children: [
|
|
10022
|
+
footer.isPlaceholder ? null : flexRender(footer.column.columnDef.footer, footer.getContext()),
|
|
10023
|
+
/* @__PURE__ */ jsx(
|
|
10024
|
+
ColumnSeparator_default,
|
|
10025
|
+
{
|
|
10026
|
+
...components?.columnSeparatorProps?.headerCell,
|
|
10027
|
+
...footer.column.columnDef?.meta?.columnSeparatorProps,
|
|
10028
|
+
show: footer.column.columnDef?.meta?.columnSeparatorProps?.show ?? components?.columnSeparatorProps?.headerCell?.show ?? showSeparator
|
|
10029
|
+
}
|
|
10030
|
+
),
|
|
10031
|
+
!footer.isPlaceholder && /* @__PURE__ */ jsx(ColumnResizer_default, { header: footer, ...components?.columnResizerProps })
|
|
10032
|
+
]
|
|
10033
|
+
},
|
|
10034
|
+
footer.id
|
|
10035
|
+
);
|
|
10036
|
+
}
|
|
9810
10037
|
var TableFooterRows = ({
|
|
9811
10038
|
table,
|
|
9812
10039
|
columnResizing,
|
|
9813
|
-
|
|
9814
|
-
|
|
10040
|
+
virtual,
|
|
10041
|
+
columnVirtual,
|
|
10042
|
+
components
|
|
9815
10043
|
}) => {
|
|
9816
|
-
const
|
|
9817
|
-
|
|
9818
|
-
|
|
10044
|
+
const cellProps = { columnResizing, virtual, components, table };
|
|
10045
|
+
const centerLeafCols = columnVirtual.enabled ? table.getCenterVisibleLeafColumns() : [];
|
|
10046
|
+
const totalFooterGroups = table.getFooterGroups().length;
|
|
10047
|
+
const spannedIds = /* @__PURE__ */ new Set();
|
|
10048
|
+
const resolveFooterCell = (footer, footerGroup, groupIndex) => {
|
|
10049
|
+
if (spannedIds.has(footer.column.id)) return null;
|
|
10050
|
+
const remainingRows = totalFooterGroups - groupIndex;
|
|
10051
|
+
if (!footer.isPlaceholder && footer.column.columnDef.meta?.spanRows && remainingRows > 1) {
|
|
10052
|
+
spannedIds.add(footer.column.id);
|
|
10053
|
+
return renderFooterCell(footer, footerGroup, cellProps, remainingRows);
|
|
10054
|
+
}
|
|
10055
|
+
return renderFooterCell(footer, footerGroup, cellProps);
|
|
10056
|
+
};
|
|
10057
|
+
return /* @__PURE__ */ jsx(Fragment, { children: table.getFooterGroups().map((footerGroup, groupIndex) => {
|
|
9819
10058
|
const tableFooterRowProps = typeof components?.tableFooterRowProps === "function" ? components.tableFooterRowProps({ footerGroup, table }) : components?.tableFooterRowProps;
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
{
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
10059
|
+
if (!columnVirtual.enabled) {
|
|
10060
|
+
return /* @__PURE__ */ jsx(TableRow, { ...tableFooterRowProps, children: footerGroup.headers.map((footer) => resolveFooterCell(footer, footerGroup, groupIndex)) }, footerGroup.id);
|
|
10061
|
+
}
|
|
10062
|
+
const leftFooters = table.getLeftFooterGroups()[groupIndex]?.headers ?? [];
|
|
10063
|
+
const centerFooters = table.getCenterFooterGroups()[groupIndex]?.headers ?? [];
|
|
10064
|
+
const rightFooters = table.getRightFooterGroups()[groupIndex]?.headers ?? [];
|
|
10065
|
+
const isLeafLevel = !centerFooters[0] || centerFooters[0].subHeaders.length === 0;
|
|
10066
|
+
if (isLeafLevel) {
|
|
10067
|
+
return /* @__PURE__ */ jsxs(TableRow, { ...tableFooterRowProps, children: [
|
|
10068
|
+
leftFooters.map((footer) => resolveFooterCell(footer, footerGroup, groupIndex)),
|
|
10069
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
10070
|
+
columnVirtual.virtualColumns.map((vc) => {
|
|
10071
|
+
const footer = centerFooters[vc.index];
|
|
10072
|
+
if (!footer) return null;
|
|
10073
|
+
return renderFooterCell(footer, footerGroup, cellProps);
|
|
10074
|
+
}),
|
|
10075
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
10076
|
+
rightFooters.map((footer) => resolveFooterCell(footer, footerGroup, groupIndex))
|
|
10077
|
+
] }, footerGroup.id);
|
|
10078
|
+
}
|
|
10079
|
+
const leafToGroupIdx = [];
|
|
10080
|
+
let leafRunning = 0;
|
|
10081
|
+
for (let gi = 0; gi < centerFooters.length; gi++) {
|
|
10082
|
+
for (let i = 0; i < centerFooters[gi].colSpan; i++) {
|
|
10083
|
+
leafToGroupIdx[leafRunning + i] = gi;
|
|
10084
|
+
}
|
|
10085
|
+
leafRunning += centerFooters[gi].colSpan;
|
|
10086
|
+
}
|
|
10087
|
+
const virtualCols = columnVirtual.virtualColumns;
|
|
10088
|
+
const useColumnSizing = columnResizing?.enabled ?? virtual?.enabled ?? false;
|
|
10089
|
+
return /* @__PURE__ */ jsxs(TableRow, { ...tableFooterRowProps, children: [
|
|
10090
|
+
leftFooters.map((footer) => resolveFooterCell(footer, footerGroup, groupIndex)),
|
|
10091
|
+
columnVirtual.virtualPaddingLeft > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingLeft } }),
|
|
10092
|
+
virtualCols.map((vc, vcIdx) => {
|
|
10093
|
+
const gi = leafToGroupIdx[vc.index];
|
|
10094
|
+
if (gi === void 0) return null;
|
|
10095
|
+
const groupFooter = centerFooters[gi];
|
|
10096
|
+
const leafCol = centerLeafCols[vc.index];
|
|
10097
|
+
const isFirst = vcIdx === 0 || leafToGroupIdx[virtualCols[vcIdx - 1].index] !== gi;
|
|
10098
|
+
const isLast = vcIdx === virtualCols.length - 1 || leafToGroupIdx[virtualCols[vcIdx + 1].index] !== gi;
|
|
10099
|
+
const { classes, style } = getColumnPinningStyles(groupFooter.column);
|
|
10100
|
+
const tableFooterCellProps = typeof components?.tableFooterCellProps === "function" ? components.tableFooterCellProps({ footer: groupFooter, table }) : components?.tableFooterCellProps;
|
|
10101
|
+
return /* @__PURE__ */ jsxs(
|
|
10102
|
+
TableHead,
|
|
10103
|
+
{
|
|
10104
|
+
colSpan: 1,
|
|
10105
|
+
...tableFooterCellProps,
|
|
10106
|
+
...groupFooter.column.columnDef?.meta?.footerProps,
|
|
10107
|
+
className: cn(
|
|
10108
|
+
classes,
|
|
10109
|
+
tableFooterCellProps?.className,
|
|
10110
|
+
groupFooter.column.columnDef?.meta?.footerProps?.className
|
|
9858
10111
|
),
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
10112
|
+
style: {
|
|
10113
|
+
...style,
|
|
10114
|
+
width: useColumnSizing ? `calc(var(--col-${toCSSId(leafCol.id)}-size, ${leafCol.getSize()}) * 1px)` : void 0,
|
|
10115
|
+
...tableFooterCellProps?.style,
|
|
10116
|
+
...groupFooter.column.columnDef?.meta?.footerProps?.style
|
|
10117
|
+
},
|
|
10118
|
+
children: [
|
|
10119
|
+
isFirst && !groupFooter.isPlaceholder ? flexRender(groupFooter.column.columnDef.footer, groupFooter.getContext()) : null,
|
|
10120
|
+
/* @__PURE__ */ jsx(ColumnSeparator_default, { ...components?.columnSeparatorProps?.headerCell, show: isLast })
|
|
10121
|
+
]
|
|
10122
|
+
},
|
|
10123
|
+
`${groupFooter.id}-${leafCol.id}`
|
|
10124
|
+
);
|
|
10125
|
+
}),
|
|
10126
|
+
columnVirtual.virtualPaddingRight > 0 && /* @__PURE__ */ jsx("th", { "aria-hidden": "true", style: { width: columnVirtual.virtualPaddingRight } }),
|
|
10127
|
+
rightFooters.map((footer) => resolveFooterCell(footer, footerGroup, groupIndex))
|
|
10128
|
+
] }, footerGroup.id);
|
|
9865
10129
|
}) });
|
|
9866
10130
|
};
|
|
10131
|
+
var MemoizedTableFooterRows = React__default.memo(
|
|
10132
|
+
TableFooterRows,
|
|
10133
|
+
(_, next) => next.isResizing === true
|
|
10134
|
+
);
|
|
9867
10135
|
var DataTable = ({
|
|
9868
10136
|
tableRef,
|
|
9869
10137
|
virtualizerRef,
|
|
10138
|
+
columnVirtualizerRef,
|
|
9870
10139
|
isInitialLoading,
|
|
9871
10140
|
columns,
|
|
9872
10141
|
data,
|
|
@@ -9906,7 +10175,15 @@ var DataTable = ({
|
|
|
9906
10175
|
rowIdKey,
|
|
9907
10176
|
childrenKey
|
|
9908
10177
|
});
|
|
9909
|
-
const {
|
|
10178
|
+
const {
|
|
10179
|
+
virtualizer,
|
|
10180
|
+
columnVirtualizer,
|
|
10181
|
+
virtualItems,
|
|
10182
|
+
paddingTop,
|
|
10183
|
+
paddingBottom,
|
|
10184
|
+
rowModel,
|
|
10185
|
+
columnVirtual
|
|
10186
|
+
} = useTableVirtualizer({
|
|
9910
10187
|
enabled: virtualEnabled,
|
|
9911
10188
|
table,
|
|
9912
10189
|
containerRef: tableContainerRef,
|
|
@@ -9927,14 +10204,21 @@ var DataTable = ({
|
|
|
9927
10204
|
const headers = table.getFlatHeaders();
|
|
9928
10205
|
const colSizes = {};
|
|
9929
10206
|
for (const header of headers) {
|
|
9930
|
-
colSizes[`--header-${header.id}-size`] = header.getSize();
|
|
9931
|
-
colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
|
|
10207
|
+
colSizes[`--header-${toCSSId(header.id)}-size`] = header.getSize();
|
|
10208
|
+
colSizes[`--col-${toCSSId(header.column.id)}-size`] = header.column.getSize();
|
|
10209
|
+
if (header.column.getIsPinned() === "left") {
|
|
10210
|
+
colSizes[`--col-${toCSSId(header.column.id)}-pin-start`] = header.column.getStart("left");
|
|
10211
|
+
} else if (header.column.getIsPinned() === "right") {
|
|
10212
|
+
colSizes[`--col-${toCSSId(header.column.id)}-pin-after`] = header.column.getAfter("right");
|
|
10213
|
+
}
|
|
9932
10214
|
}
|
|
9933
10215
|
return colSizes;
|
|
9934
10216
|
}, [columnSizing, columnSizingInfo, columnResizingEnabled, virtualEnabled]);
|
|
9935
|
-
const isResizing = columnResizingEnabled && !!columnSizingInfo.isResizingColumn;
|
|
10217
|
+
const isResizing = !columnVirtual.enabled && (columnResizingEnabled ?? false) && !!columnSizingInfo.isResizingColumn;
|
|
10218
|
+
const hasAnyFooter = table.getAllColumns().some((col) => col.columnDef.footer != null);
|
|
9936
10219
|
useBindRef_default({ ref: tableRef, value: table });
|
|
9937
10220
|
useBindRef_default({ ref: virtualizerRef, value: virtualizer });
|
|
10221
|
+
useBindRef_default({ ref: columnVirtualizerRef, value: columnVirtualizer });
|
|
9938
10222
|
return /* @__PURE__ */ jsxs(
|
|
9939
10223
|
TableContainer,
|
|
9940
10224
|
{
|
|
@@ -9970,47 +10254,52 @@ var DataTable = ({
|
|
|
9970
10254
|
},
|
|
9971
10255
|
defaultIcon: /* @__PURE__ */ jsx(SuiEmptyDataIcon, { size: 128 })
|
|
9972
10256
|
}
|
|
9973
|
-
) : /* @__PURE__ */
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10257
|
+
) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
10258
|
+
Table,
|
|
10259
|
+
{
|
|
10260
|
+
...components?.tableProps,
|
|
10261
|
+
style: {
|
|
10262
|
+
tableLayout: virtualEnabled ? "fixed" : "auto",
|
|
10263
|
+
minWidth: columnVirtual.enabled ? `${table.getTotalSize()}px` : void 0,
|
|
10264
|
+
...components?.tableProps?.style,
|
|
10265
|
+
...columnSizeVars
|
|
10266
|
+
},
|
|
10267
|
+
children: [
|
|
10268
|
+
/* @__PURE__ */ jsxs(
|
|
10269
|
+
TableHeader,
|
|
10270
|
+
{
|
|
10271
|
+
className: cn("sticky top-0 z-10 bg-white", components?.tableHeaderProps?.className),
|
|
10272
|
+
...components?.tableHeaderProps,
|
|
10273
|
+
children: [
|
|
10274
|
+
/* @__PURE__ */ jsx(
|
|
10275
|
+
MemoizedTableHeaderRows,
|
|
10276
|
+
{
|
|
10277
|
+
table,
|
|
10278
|
+
columnResizing,
|
|
10279
|
+
virtual,
|
|
10280
|
+
columnVirtual,
|
|
10281
|
+
components,
|
|
10282
|
+
isResizing
|
|
10283
|
+
}
|
|
10284
|
+
),
|
|
10285
|
+
/* @__PURE__ */ jsx(
|
|
10286
|
+
MemoizedTableFilterRow,
|
|
10287
|
+
{
|
|
10288
|
+
table,
|
|
10289
|
+
filterableColumns,
|
|
10290
|
+
isSomeColumnsFilterable,
|
|
10291
|
+
columnResizing,
|
|
10292
|
+
virtual,
|
|
10293
|
+
columnVirtual,
|
|
10294
|
+
components,
|
|
10295
|
+
isResizing
|
|
10296
|
+
}
|
|
10297
|
+
)
|
|
10298
|
+
]
|
|
10299
|
+
}
|
|
10300
|
+
),
|
|
10301
|
+
/* @__PURE__ */ jsxs(TableBody, { ...components?.tableBodyProps, children: [
|
|
10302
|
+
/* @__PURE__ */ jsx(
|
|
10014
10303
|
MemoizedTableDataRows,
|
|
10015
10304
|
{
|
|
10016
10305
|
table,
|
|
@@ -10023,82 +10312,70 @@ var DataTable = ({
|
|
|
10023
10312
|
visibleColumnCount,
|
|
10024
10313
|
columnResizing,
|
|
10025
10314
|
virtual,
|
|
10315
|
+
columnVirtual,
|
|
10026
10316
|
onRowClick,
|
|
10027
|
-
components
|
|
10317
|
+
components,
|
|
10318
|
+
isResizing
|
|
10028
10319
|
}
|
|
10029
|
-
)
|
|
10030
|
-
|
|
10320
|
+
),
|
|
10321
|
+
activeStatusContentComputed === "emptyFilteredData" && /* @__PURE__ */ jsx(TableRow, { "data-testid": "status-row-empty-filtered-data", children: /* @__PURE__ */ jsx(TableCell, { colSpan: visibleColumnCount, className: "border-b-0 p-0", children: /* @__PURE__ */ jsx(
|
|
10322
|
+
StatusContentSlot_default,
|
|
10031
10323
|
{
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
columnResizing,
|
|
10041
|
-
virtual,
|
|
10042
|
-
onRowClick,
|
|
10043
|
-
components
|
|
10324
|
+
content: statusContent?.emptyFilteredData?.content ?? "No records found. Please try a different search.",
|
|
10325
|
+
icon: statusContent?.emptyFilteredData?.icon,
|
|
10326
|
+
wrapperProps: statusContent?.emptyFilteredData?.wrapperProps,
|
|
10327
|
+
defaultWrapperProps: {
|
|
10328
|
+
className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
|
|
10329
|
+
["data-testid"]: "status-content-empty-filtered-data"
|
|
10330
|
+
},
|
|
10331
|
+
defaultIcon: /* @__PURE__ */ jsx(SuiEmptyDataIcon, { size: 128 })
|
|
10044
10332
|
}
|
|
10045
|
-
) }),
|
|
10046
|
-
/* @__PURE__ */ jsx(
|
|
10047
|
-
|
|
10333
|
+
) }) }),
|
|
10334
|
+
activeStatusContentComputed === "fetchingMore" && /* @__PURE__ */ jsx(TableRow, { "data-testid": "status-row-fetching-more", children: /* @__PURE__ */ jsx(TableCell, { colSpan: visibleColumnCount, className: "border-b-0 p-0", children: /* @__PURE__ */ jsx(
|
|
10335
|
+
StatusContentSlot_default,
|
|
10048
10336
|
{
|
|
10049
|
-
...
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
columnResizing,
|
|
10056
|
-
virtual,
|
|
10057
|
-
components
|
|
10058
|
-
}
|
|
10059
|
-
)
|
|
10337
|
+
content: statusContent?.fetchingMore?.content ?? "Loading more...",
|
|
10338
|
+
wrapperProps: statusContent?.fetchingMore?.wrapperProps,
|
|
10339
|
+
defaultWrapperProps: {
|
|
10340
|
+
className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
|
|
10341
|
+
["data-testid"]: "status-content-fetching-more"
|
|
10342
|
+
}
|
|
10060
10343
|
}
|
|
10061
|
-
)
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
},
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
|
|
10097
|
-
["data-testid"]: "status-content-no-more-data"
|
|
10098
|
-
}
|
|
10099
|
-
}
|
|
10100
|
-
)
|
|
10101
|
-
] }),
|
|
10344
|
+
) }) }),
|
|
10345
|
+
activeStatusContentComputed === "noMoreData" && /* @__PURE__ */ jsx(TableRow, { "data-testid": "status-row-no-more-data", children: /* @__PURE__ */ jsx(TableCell, { colSpan: visibleColumnCount, className: "border-b-0 p-0", children: /* @__PURE__ */ jsx(
|
|
10346
|
+
StatusContentSlot_default,
|
|
10347
|
+
{
|
|
10348
|
+
content: statusContent?.noMoreData?.content,
|
|
10349
|
+
icon: statusContent?.noMoreData?.icon,
|
|
10350
|
+
wrapperProps: statusContent?.noMoreData?.wrapperProps,
|
|
10351
|
+
defaultWrapperProps: {
|
|
10352
|
+
className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
|
|
10353
|
+
["data-testid"]: "status-content-no-more-data"
|
|
10354
|
+
}
|
|
10355
|
+
}
|
|
10356
|
+
) }) })
|
|
10357
|
+
] }),
|
|
10358
|
+
hasAnyFooter && /* @__PURE__ */ jsx(
|
|
10359
|
+
TableFooter,
|
|
10360
|
+
{
|
|
10361
|
+
...components?.tableFooterProps,
|
|
10362
|
+
className: cn("sticky bottom-0 z-10 bg-white", components?.tableFooterProps?.className),
|
|
10363
|
+
children: /* @__PURE__ */ jsx(
|
|
10364
|
+
MemoizedTableFooterRows,
|
|
10365
|
+
{
|
|
10366
|
+
table,
|
|
10367
|
+
columnResizing,
|
|
10368
|
+
virtual,
|
|
10369
|
+
columnVirtual,
|
|
10370
|
+
components,
|
|
10371
|
+
isResizing
|
|
10372
|
+
}
|
|
10373
|
+
)
|
|
10374
|
+
}
|
|
10375
|
+
)
|
|
10376
|
+
]
|
|
10377
|
+
}
|
|
10378
|
+
) }),
|
|
10102
10379
|
debug && /* @__PURE__ */ jsx(DataTableDevTool_default, { table })
|
|
10103
10380
|
]
|
|
10104
10381
|
}
|
|
@@ -10221,7 +10498,7 @@ var DateTimePicker = ({
|
|
|
10221
10498
|
},
|
|
10222
10499
|
[currentHour, handleTimeApply]
|
|
10223
10500
|
);
|
|
10224
|
-
const hours = React__default.useMemo(() => Array.from({ length: 24 }, (_, index) =>
|
|
10501
|
+
const hours = React__default.useMemo(() => Array.from({ length: 24 }, (_, index) => index), []);
|
|
10225
10502
|
const minuteInterval = React__default.useMemo(() => {
|
|
10226
10503
|
const safeStep = Math.min(60, Math.max(1, minuteStep));
|
|
10227
10504
|
return Array.from({ length: Math.ceil(60 / safeStep) }, (_, index) => index * safeStep).filter(
|
|
@@ -13352,23 +13629,12 @@ function TooltipProvider2({
|
|
|
13352
13629
|
delayDuration = 0,
|
|
13353
13630
|
...props
|
|
13354
13631
|
}) {
|
|
13355
|
-
return /* @__PURE__ */ jsx(
|
|
13356
|
-
TooltipPrimitive.Provider,
|
|
13357
|
-
{
|
|
13358
|
-
"data-slot": "tooltip-provider",
|
|
13359
|
-
delayDuration,
|
|
13360
|
-
...props
|
|
13361
|
-
}
|
|
13362
|
-
);
|
|
13632
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration, ...props });
|
|
13363
13633
|
}
|
|
13364
|
-
function Tooltip2({
|
|
13365
|
-
...props
|
|
13366
|
-
}) {
|
|
13634
|
+
function Tooltip2({ ...props }) {
|
|
13367
13635
|
return /* @__PURE__ */ jsx(TooltipProvider2, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
13368
13636
|
}
|
|
13369
|
-
function TooltipTrigger2({
|
|
13370
|
-
...props
|
|
13371
|
-
}) {
|
|
13637
|
+
function TooltipTrigger2({ ...props }) {
|
|
13372
13638
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13373
13639
|
}
|
|
13374
13640
|
function TooltipArrow(props) {
|
|
@@ -13974,6 +14240,144 @@ var Image2 = React.forwardRef(function Image3({
|
|
|
13974
14240
|
);
|
|
13975
14241
|
});
|
|
13976
14242
|
Image2.displayName = "Image";
|
|
14243
|
+
function LanguageSelector({
|
|
14244
|
+
tenant,
|
|
14245
|
+
selectedLocale,
|
|
14246
|
+
onSelectLocale,
|
|
14247
|
+
errorLocales = [],
|
|
14248
|
+
enableErrorHighlight = false,
|
|
14249
|
+
sortLocales = true,
|
|
14250
|
+
priorityLocale = "en",
|
|
14251
|
+
className,
|
|
14252
|
+
visibleLocalesCount = 3,
|
|
14253
|
+
localeButtonWidth = 35,
|
|
14254
|
+
localeGap = 4
|
|
14255
|
+
}) {
|
|
14256
|
+
const orderedTenant = React__default.useMemo(() => {
|
|
14257
|
+
const normalizedPriority = priorityLocale.trim().toLowerCase();
|
|
14258
|
+
const localeAwareSorted = sortLocales ? [...tenant].sort(
|
|
14259
|
+
(a, b) => a.locale.localeCompare(b.locale, void 0, { sensitivity: "base", numeric: true })
|
|
14260
|
+
) : [...tenant];
|
|
14261
|
+
if (!normalizedPriority) {
|
|
14262
|
+
return localeAwareSorted;
|
|
14263
|
+
}
|
|
14264
|
+
return localeAwareSorted.sort((a, b) => {
|
|
14265
|
+
const aIsPriority = a.locale.toLowerCase() === normalizedPriority;
|
|
14266
|
+
const bIsPriority = b.locale.toLowerCase() === normalizedPriority;
|
|
14267
|
+
if (aIsPriority && !bIsPriority) return -1;
|
|
14268
|
+
if (!aIsPriority && bIsPriority) return 1;
|
|
14269
|
+
return 0;
|
|
14270
|
+
});
|
|
14271
|
+
}, [priorityLocale, sortLocales, tenant]);
|
|
14272
|
+
const selectedIndex = orderedTenant.findIndex((t) => t.locale === selectedLocale);
|
|
14273
|
+
const currentIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
14274
|
+
const isFirst = currentIndex <= 0;
|
|
14275
|
+
const isLast = currentIndex >= orderedTenant.length - 1;
|
|
14276
|
+
const safeVisibleCount = Math.min(orderedTenant.length, Math.max(1, visibleLocalesCount));
|
|
14277
|
+
const halfWindow = Math.floor((safeVisibleCount - 1) / 2);
|
|
14278
|
+
const maxStart = Math.max(0, orderedTenant.length - safeVisibleCount);
|
|
14279
|
+
const windowStart = Math.min(maxStart, Math.max(0, currentIndex - halfWindow));
|
|
14280
|
+
const visibleLocales = orderedTenant.slice(windowStart, windowStart + safeVisibleCount);
|
|
14281
|
+
const safeLocaleButtonWidth = Math.max(28, localeButtonWidth);
|
|
14282
|
+
const safeLocaleGap = Math.max(0, localeGap);
|
|
14283
|
+
const localeAreaWidth = safeVisibleCount * safeLocaleButtonWidth + (safeVisibleCount - 1) * safeLocaleGap;
|
|
14284
|
+
const localeWindowRef = React__default.useRef(null);
|
|
14285
|
+
const previousWindowStartRef = React__default.useRef(windowStart);
|
|
14286
|
+
React__default.useEffect(() => {
|
|
14287
|
+
const previousWindowStart = previousWindowStartRef.current;
|
|
14288
|
+
if (previousWindowStart === windowStart) {
|
|
14289
|
+
return;
|
|
14290
|
+
}
|
|
14291
|
+
previousWindowStartRef.current = windowStart;
|
|
14292
|
+
const localeWindow = localeWindowRef.current;
|
|
14293
|
+
if (!localeWindow) {
|
|
14294
|
+
return;
|
|
14295
|
+
}
|
|
14296
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
14297
|
+
return;
|
|
14298
|
+
}
|
|
14299
|
+
const movingRight = windowStart > previousWindowStart;
|
|
14300
|
+
const offsetX = movingRight ? 10 : -10;
|
|
14301
|
+
localeWindow.animate(
|
|
14302
|
+
[
|
|
14303
|
+
{ opacity: 0.86, transform: `translate3d(${offsetX}px, 0, 0) scale(0.992)` },
|
|
14304
|
+
{ opacity: 1, transform: "translate3d(0, 0, 0) scale(1)" }
|
|
14305
|
+
],
|
|
14306
|
+
{
|
|
14307
|
+
duration: 460,
|
|
14308
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)"
|
|
14309
|
+
}
|
|
14310
|
+
);
|
|
14311
|
+
}, [windowStart]);
|
|
14312
|
+
if (orderedTenant.length <= 1) {
|
|
14313
|
+
return null;
|
|
14314
|
+
}
|
|
14315
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1 min-w-0", className), children: [
|
|
14316
|
+
/* @__PURE__ */ jsx(
|
|
14317
|
+
"button",
|
|
14318
|
+
{
|
|
14319
|
+
type: "button",
|
|
14320
|
+
disabled: isFirst,
|
|
14321
|
+
"aria-label": "Select previous locale",
|
|
14322
|
+
onClick: () => !isFirst && onSelectLocale(orderedTenant[currentIndex - 1]),
|
|
14323
|
+
className: cn(
|
|
14324
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-md transform-gpu motion-safe:transition-[transform,background-color,color,box-shadow] motion-safe:duration-400 motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)] active:scale-[0.985]",
|
|
14325
|
+
isFirst ? "text-muted-foreground/30 cursor-not-allowed" : "text-muted-foreground hover:text-foreground hover:bg-muted hover:shadow-sm"
|
|
14326
|
+
),
|
|
14327
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
14328
|
+
}
|
|
14329
|
+
),
|
|
14330
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 overflow-hidden", style: { width: localeAreaWidth, maxWidth: "100%" }, children: /* @__PURE__ */ jsx(
|
|
14331
|
+
"div",
|
|
14332
|
+
{
|
|
14333
|
+
ref: localeWindowRef,
|
|
14334
|
+
className: "grid gap-1",
|
|
14335
|
+
style: {
|
|
14336
|
+
gridTemplateColumns: `repeat(${safeVisibleCount}, minmax(0, 1fr))`,
|
|
14337
|
+
columnGap: safeLocaleGap
|
|
14338
|
+
},
|
|
14339
|
+
children: visibleLocales.map((lang) => /* @__PURE__ */ jsx(
|
|
14340
|
+
"button",
|
|
14341
|
+
{
|
|
14342
|
+
type: "button",
|
|
14343
|
+
"data-locale": lang.locale,
|
|
14344
|
+
"aria-label": lang.locale.toUpperCase(),
|
|
14345
|
+
onClick: () => onSelectLocale(lang),
|
|
14346
|
+
className: cn(
|
|
14347
|
+
"h-8 min-w-0 px-2 text-xs font-medium rounded-md transform-gpu motion-safe:transition-[transform,background-color,color,box-shadow] motion-safe:duration-400 motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)] active:scale-[0.985] select-none",
|
|
14348
|
+
selectedLocale === lang.locale ? "bg-primary text-primary-foreground shadow-sm" : "bg-muted text-muted-foreground hover:bg-muted/80 hover:shadow-sm",
|
|
14349
|
+
enableErrorHighlight && errorLocales.includes(lang.locale) && "ring-1 ring-inset ring-red-500"
|
|
14350
|
+
),
|
|
14351
|
+
children: /* @__PURE__ */ jsx(
|
|
14352
|
+
truncated_default,
|
|
14353
|
+
{
|
|
14354
|
+
as: "span",
|
|
14355
|
+
className: "block w-full text-center",
|
|
14356
|
+
tooltipContentProps: { side: "bottom", sideOffset: 6 },
|
|
14357
|
+
children: lang.locale.toUpperCase()
|
|
14358
|
+
}
|
|
14359
|
+
)
|
|
14360
|
+
},
|
|
14361
|
+
lang.locale
|
|
14362
|
+
))
|
|
14363
|
+
}
|
|
14364
|
+
) }),
|
|
14365
|
+
/* @__PURE__ */ jsx(
|
|
14366
|
+
"button",
|
|
14367
|
+
{
|
|
14368
|
+
type: "button",
|
|
14369
|
+
disabled: isLast,
|
|
14370
|
+
"aria-label": "Select next locale",
|
|
14371
|
+
onClick: () => !isLast && onSelectLocale(orderedTenant[currentIndex + 1]),
|
|
14372
|
+
className: cn(
|
|
14373
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-md transform-gpu motion-safe:transition-[transform,background-color,color,box-shadow] motion-safe:duration-400 motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)] active:scale-[0.985]",
|
|
14374
|
+
isLast ? "text-muted-foreground/30 cursor-not-allowed" : "text-muted-foreground hover:text-foreground hover:bg-muted hover:shadow-sm"
|
|
14375
|
+
),
|
|
14376
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
14377
|
+
}
|
|
14378
|
+
)
|
|
14379
|
+
] });
|
|
14380
|
+
}
|
|
13977
14381
|
var AnimatedDots = () => {
|
|
13978
14382
|
const dotAnimation = `
|
|
13979
14383
|
@keyframes dot1 {
|
|
@@ -18719,6 +19123,6 @@ function InputMentionInner({
|
|
|
18719
19123
|
}
|
|
18720
19124
|
var InputMention = forwardRef(InputMentionInner);
|
|
18721
19125
|
|
|
18722
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, dropdownMenu_default as ActionDropdown, ActionMenu, AdministrationIcon, AdvanceSearch_default as AdvanceSearch, AnalyticsIcon, ApplicationLogIcon, ArrowIcon, AuditFooter, BookmarkIcon, BriefcaseBusinessIcon, BuildingIcon, Button, SuiCalendarIcon2 as Calendar2Icon, CalendarDaysIcon, CardIcon, Carousel, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, CarouselThumbnails, Checkbox, CircleUserIcon, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CopyUserRightsIcon, CropperModal, CropperModalError, CustomActionStatusIcon, CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DashboardIcon, DataEntryIcon, DataTable_default as DataTable, DatePicker2 as DatePicker, DateTimePicker, DecreaseIcon, Dialog2 as Dialog, DialogAlert, DialogAlertProvider, DialogClose, DialogCloseButton, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader2 as DialogHeader, DialogTitle2 as DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EllipsisBoxIcon, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, FactoryIcon, FileCogIcon, FileSpreadsheet, FileTextIcon, FiltersIcon, FolderIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HamburgerMenuIcon, HandymanIcon, header_default as Header, HeaderCell_default as HeaderCell, HelpIcon, HomeIcon, HomePlusIcon, Image2 as Image, ImagePlaceholderIcon, InformationIcon, Input, InputMention, InputNumber_default as InputNumber, Label2 as Label, LoadingPage, LookupSelect, MailIcon, MainListContainer_default as MainListContainer, ManIcon, ManagementIcon, MenuIcon, MessageIcon, MessageIconInverse, MessageSquareIcon, MonthPicker2 as MonthPicker, navbar_default as Navbar, NotFoundIcon, OutlineArrowIcon, PlusIcon, PlusSearchIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PowerIcon, PreventPageLeave_default as PreventPageLeave, ProgressBar_default as ProgressBar, QuestionIcon, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, RoleIcon, SearchIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, SetupIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, SuiCalendarIcon, SuiCalendarIcon2, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, TabSelect, Table, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, TagListViewIcon, TextArea, ToolBoxIcon, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, TransferUserRightsIcon, TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, UserActiveIcon, UserAloneIcon, UserFriendIcon, UserGroupIcon, UserIcon, UserInactiveIcon, UserNameIcon, UserProtectIcon, UsersIcon, VirtualizedCommand_default as VirtualizedCommand, WorkFlowIcon, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useBindRef_default as useBindRef, useCarousel, useControllableState_default as useControllableState, useDraftGuardStore, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useSafeBlocker, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
19126
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, dropdownMenu_default as ActionDropdown, ActionMenu, AdministrationIcon, AdvanceSearch_default as AdvanceSearch, AnalyticsIcon, ApplicationLogIcon, ArrowIcon, AuditFooter, BookmarkIcon, BriefcaseBusinessIcon, BuildingIcon, Button, SuiCalendarIcon2 as Calendar2Icon, CalendarDaysIcon, CardIcon, Carousel, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, CarouselThumbnails, Checkbox, CircleUserIcon, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CopyUserRightsIcon, CropperModal, CropperModalError, CustomActionStatusIcon, CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DashboardIcon, DataEntryIcon, DataTable_default as DataTable, DatePicker2 as DatePicker, DateTimePicker, DecreaseIcon, Dialog2 as Dialog, DialogAlert, DialogAlertProvider, DialogClose, DialogCloseButton, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader2 as DialogHeader, DialogTitle2 as DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EllipsisBoxIcon, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, FactoryIcon, FileCogIcon, FileSpreadsheet, FileTextIcon, FiltersIcon, FolderIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HamburgerMenuIcon, HandymanIcon, header_default as Header, HeaderCell_default as HeaderCell, HelpIcon, HomeIcon, HomePlusIcon, Image2 as Image, ImagePlaceholderIcon, InformationIcon, Input, InputMention, InputNumber_default as InputNumber, Label2 as Label, LanguageSelector, LoadingPage, LookupSelect, MailIcon, MainListContainer_default as MainListContainer, ManIcon, ManagementIcon, MenuIcon, MessageIcon, MessageIconInverse, MessageSquareIcon, MonthPicker2 as MonthPicker, navbar_default as Navbar, NotFoundIcon, OutlineArrowIcon, PlusIcon, PlusSearchIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PowerIcon, PreventPageLeave_default as PreventPageLeave, ProgressBar_default as ProgressBar, QuestionIcon, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, RoleIcon, SearchIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, SetupIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, SuiCalendarIcon, SuiCalendarIcon2, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, TabSelect, Table, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, TagListViewIcon, TextArea, ToolBoxIcon, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, TransferUserRightsIcon, TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, UserActiveIcon, UserAloneIcon, UserFriendIcon, UserGroupIcon, UserIcon, UserInactiveIcon, UserNameIcon, UserProtectIcon, UsersIcon, VirtualizedCommand_default as VirtualizedCommand, WorkFlowIcon, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useBindRef_default as useBindRef, useCarousel, useControllableState_default as useControllableState, useDraftGuardStore, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useSafeBlocker, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
18723
19127
|
//# sourceMappingURL=index.mjs.map
|
|
18724
19128
|
//# sourceMappingURL=index.mjs.map
|