@bwp-web/components 0.11.2 → 0.11.3
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/BiampTable/BiampTableColumnVisibility.d.ts +8 -5
- package/dist/BiampTable/BiampTableColumnVisibility.d.ts.map +1 -1
- package/dist/BiampTable/BiampTablePagination.d.ts +4 -4
- package/dist/BiampTable/BiampTablePagination.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarColumnVisibility.d.ts +1 -3
- package/dist/BiampTable/BiampTableToolbarColumnVisibility.d.ts.map +1 -1
- package/dist/BiampTable/index.d.ts +1 -1
- package/dist/BiampTable/index.d.ts.map +1 -1
- package/dist/index.cjs +37 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -24
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PopoverProps } from '@mui/material';
|
|
2
|
-
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
import type { Table, VisibilityState } from '@tanstack/react-table';
|
|
3
3
|
import './tanstack-meta';
|
|
4
4
|
/**
|
|
5
5
|
* A looser alternative to TanStack's `VisibilityState` (`Record<string, boolean>`).
|
|
@@ -8,6 +8,11 @@ import './tanstack-meta';
|
|
|
8
8
|
* treated as `true` (visible).
|
|
9
9
|
*/
|
|
10
10
|
export type ColumnVisibility = Partial<Record<string, boolean>>;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a `ColumnVisibility` to TanStack's `VisibilityState`.
|
|
13
|
+
* Use this when passing to `useReactTable({ state: { columnVisibility } })`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toVisibilityState(visibility: ColumnVisibility): VisibilityState;
|
|
11
16
|
/**
|
|
12
17
|
* Reads `meta.defaultVisible` from all leaf columns and returns a
|
|
13
18
|
* `ColumnVisibility` map. Columns without `defaultVisible` are omitted
|
|
@@ -20,13 +25,11 @@ export declare function getDefaultColumnVisibility<TData>(table: Table<TData>):
|
|
|
20
25
|
* on each column definition.
|
|
21
26
|
*/
|
|
22
27
|
export declare function getColumnVisibilityDirtyCount<TData>(table: Table<TData>, defaultVisibility?: ColumnVisibility): number;
|
|
23
|
-
export type BiampTableColumnVisibilityProps<TData> = Omit<PopoverProps, 'open'
|
|
28
|
+
export type BiampTableColumnVisibilityProps<TData> = Omit<PopoverProps, 'open'> & {
|
|
24
29
|
/** TanStack Table instance to connect to. */
|
|
25
30
|
table: Table<TData>;
|
|
26
|
-
/** Called after column visibility changes. */
|
|
27
|
-
onChange?: (visibility: ColumnVisibility) => void;
|
|
28
31
|
/** Label for the "show all" toggle. @default "Show all" */
|
|
29
32
|
showAllLabel?: string;
|
|
30
33
|
};
|
|
31
|
-
export declare function BiampTableColumnVisibility<TData>({ table,
|
|
34
|
+
export declare function BiampTableColumnVisibility<TData>({ table, showAllLabel, anchorEl, anchorOrigin, transformOrigin, slotProps, ...popoverProps }: BiampTableColumnVisibilityProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
32
35
|
//# sourceMappingURL=BiampTableColumnVisibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiampTableColumnVisibility.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTableColumnVisibility.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"BiampTableColumnVisibility.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTableColumnVisibility.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,gBAAgB,GAC3B,eAAe,CAEjB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAClB,gBAAgB,CAOlB;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EACjD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EACnB,iBAAiB,CAAC,EAAE,gBAAgB,GACnC,MAAM,CAUR;AAED,MAAM,MAAM,+BAA+B,CAAC,KAAK,IAAI,IAAI,CACvD,YAAY,EACZ,MAAM,CACP,GAAG;IACF,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAcF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,EAChD,KAAK,EACL,YAAyB,EACzB,QAAQ,EACR,YAA0D,EAC1D,eAA0D,EAC1D,SAAS,EACT,GAAG,YAAY,EAChB,EAAE,+BAA+B,CAAC,KAAK,CAAC,2CAuExC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, type TablePaginationProps } from '@mui/material';
|
|
2
2
|
import type { Table } from '@tanstack/react-table';
|
|
3
|
-
export type BiampTablePaginationProps<TData> =
|
|
3
|
+
export type BiampTablePaginationProps<TData> = {
|
|
4
4
|
/** TanStack Table instance to connect to. */
|
|
5
5
|
table: Table<TData>;
|
|
6
6
|
/** Rows-per-page options. When omitted, the selector is hidden and defaults to 25. */
|
|
@@ -9,6 +9,6 @@ export type BiampTablePaginationProps<TData> = BoxProps & {
|
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
/** Hide pagination when all rows fit on one page. @default true */
|
|
11
11
|
autoHide?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function BiampTablePagination<TData>({ table, rowsPerPageOptions, loading, autoHide, ...
|
|
12
|
+
} & Omit<TablePaginationProps<typeof Box>, 'component' | 'count' | 'page' | 'rowsPerPage' | 'onPageChange' | 'onRowsPerPageChange' | 'rowsPerPageOptions'>;
|
|
13
|
+
export declare function BiampTablePagination<TData>({ table, rowsPerPageOptions, loading, autoHide, sx, ...paginationProps }: BiampTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
//# sourceMappingURL=BiampTablePagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiampTablePagination.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTablePagination.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"BiampTablePagination.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTablePagination.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAmB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,MAAM,yBAAyB,CAAC,KAAK,IAAI;IAC7C,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CACN,oBAAoB,CAAC,OAAO,GAAG,CAAC,EAC9B,WAAW,GACX,OAAO,GACP,MAAM,GACN,aAAa,GACb,cAAc,GACd,qBAAqB,GACrB,oBAAoB,CACvB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,EAC1C,KAAK,EACL,kBAAkB,EAClB,OAAO,EACP,QAAe,EACf,EAAE,EACF,GAAG,eAAe,EACnB,EAAE,yBAAyB,CAAC,KAAK,CAAC,kDAwClC"}
|
|
@@ -14,10 +14,8 @@ export type BiampTableToolbarColumnVisibilityProps<TData> = {
|
|
|
14
14
|
* When omitted, auto-derived from `meta.defaultVisible` on each column.
|
|
15
15
|
*/
|
|
16
16
|
defaultColumnVisibility?: ColumnVisibility;
|
|
17
|
-
/** Called after column visibility changes. */
|
|
18
|
-
onChange?: (visibility: ColumnVisibility) => void;
|
|
19
17
|
/** Label for the "show all" toggle inside the popover. @default "Show all" */
|
|
20
18
|
showAllLabel?: string;
|
|
21
19
|
} & Omit<BiampTableToolbarActionButtonProps, 'icon' | 'label' | 'onClick' | 'badgeContent' | 'onChange'>;
|
|
22
|
-
export declare function BiampTableToolbarColumnVisibility<TData>({ table, icon, label, defaultColumnVisibility,
|
|
20
|
+
export declare function BiampTableToolbarColumnVisibility<TData>({ table, icon, label, defaultColumnVisibility, showAllLabel, ...actionButtonProps }: BiampTableToolbarColumnVisibilityProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
23
21
|
//# sourceMappingURL=BiampTableToolbarColumnVisibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiampTableToolbarColumnVisibility.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTableToolbarColumnVisibility.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAc,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AACxD,OAAO,EAEL,KAAK,gBAAgB,EAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,sCAAsC,CAAC,KAAK,IAAI;IAC1D,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,iFAAiF;IACjF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IAC3C,
|
|
1
|
+
{"version":3,"file":"BiampTableToolbarColumnVisibility.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTableToolbarColumnVisibility.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAc,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AACxD,OAAO,EAEL,KAAK,gBAAgB,EAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,sCAAsC,CAAC,KAAK,IAAI;IAC1D,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,iFAAiF;IACjF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IAC3C,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,IAAI,CACN,kCAAkC,EAClC,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,GAAG,UAAU,CAC3D,CAAC;AAEF,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,EACvD,KAAK,EACL,IAAmC,EACnC,KAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,GAAG,iBAAiB,EACrB,EAAE,sCAAsC,CAAC,KAAK,CAAC,2CAyB/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BiampTable, type BiampTableProps } from './BiampTable';
|
|
2
2
|
export { BiampTableContainer, type BiampTableContainerProps, } from './BiampTableContainer';
|
|
3
3
|
export { BiampTableCellActionButton, type BiampTableCellActionButtonProps, } from './BiampTableCellActionButton';
|
|
4
|
-
export { BiampTableColumnVisibility, type BiampTableColumnVisibilityProps, getColumnVisibilityDirtyCount, getDefaultColumnVisibility, type ColumnVisibility, } from './BiampTableColumnVisibility';
|
|
4
|
+
export { BiampTableColumnVisibility, type BiampTableColumnVisibilityProps, getColumnVisibilityDirtyCount, getDefaultColumnVisibility, toVisibilityState, type ColumnVisibility, } from './BiampTableColumnVisibility';
|
|
5
5
|
export { BiampTableToolbarColumnVisibility, type BiampTableToolbarColumnVisibilityProps, } from './BiampTableToolbarColumnVisibility';
|
|
6
6
|
export { BiampTableEmptyState, type BiampTableEmptyStateProps, } from './BiampTableEmptyState';
|
|
7
7
|
export { BiampTableErrorState, type BiampTableErrorStateProps, } from './BiampTableErrorState';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BiampTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,KAAK,+BAA+B,GACrC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,0BAA0B,EAC1B,KAAK,gBAAgB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iCAAiC,EACjC,KAAK,sCAAsC,GAC5C,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,KAAK,kCAAkC,GACxC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BiampTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,KAAK,+BAA+B,GACrC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iCAAiC,EACjC,KAAK,sCAAsC,GAC5C,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,KAAK,kCAAkC,GACxC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -56,6 +56,7 @@ __export(index_exports, {
|
|
|
56
56
|
exportToCsv: () => exportToCsv,
|
|
57
57
|
getColumnVisibilityDirtyCount: () => getColumnVisibilityDirtyCount,
|
|
58
58
|
getDefaultColumnVisibility: () => getDefaultColumnVisibility,
|
|
59
|
+
toVisibilityState: () => toVisibilityState,
|
|
59
60
|
useDebouncedCallback: () => useDebouncedCallback
|
|
60
61
|
});
|
|
61
62
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -867,8 +868,10 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
|
867
868
|
|
|
868
869
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
869
870
|
var import_material9 = require("@mui/material");
|
|
870
|
-
var import_react3 = require("react");
|
|
871
871
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
872
|
+
function toVisibilityState(visibility) {
|
|
873
|
+
return visibility;
|
|
874
|
+
}
|
|
872
875
|
function getDefaultColumnVisibility(table) {
|
|
873
876
|
const result = {};
|
|
874
877
|
for (const col of table.getAllLeafColumns()) {
|
|
@@ -900,7 +903,6 @@ var columnListItemSx = {
|
|
|
900
903
|
};
|
|
901
904
|
function BiampTableColumnVisibility({
|
|
902
905
|
table,
|
|
903
|
-
onChange,
|
|
904
906
|
showAllLabel = "Show all",
|
|
905
907
|
anchorEl,
|
|
906
908
|
anchorOrigin = { vertical: "bottom", horizontal: "right" },
|
|
@@ -908,13 +910,6 @@ function BiampTableColumnVisibility({
|
|
|
908
910
|
slotProps,
|
|
909
911
|
...popoverProps
|
|
910
912
|
}) {
|
|
911
|
-
const visibility = table.getState().columnVisibility;
|
|
912
|
-
const prevVisibilityRef = (0, import_react3.useRef)(visibility);
|
|
913
|
-
(0, import_react3.useEffect)(() => {
|
|
914
|
-
if (prevVisibilityRef.current === visibility) return;
|
|
915
|
-
prevVisibilityRef.current = visibility;
|
|
916
|
-
onChange?.(visibility);
|
|
917
|
-
}, [visibility, onChange]);
|
|
918
913
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
919
914
|
const someVisible = table.getAllLeafColumns().some((col) => col.getIsVisible());
|
|
920
915
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -990,7 +985,7 @@ function BiampTableColumnVisibility({
|
|
|
990
985
|
|
|
991
986
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
992
987
|
var import_assets6 = require("@bwp-web/assets");
|
|
993
|
-
var
|
|
988
|
+
var import_react3 = require("react");
|
|
994
989
|
|
|
995
990
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
996
991
|
var import_material10 = require("@mui/material");
|
|
@@ -1037,11 +1032,10 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1037
1032
|
icon = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_assets6.ColumnsIcon, { variant: "xs" }),
|
|
1038
1033
|
label = "Columns",
|
|
1039
1034
|
defaultColumnVisibility,
|
|
1040
|
-
onChange,
|
|
1041
1035
|
showAllLabel,
|
|
1042
1036
|
...actionButtonProps
|
|
1043
1037
|
}) {
|
|
1044
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
1038
|
+
const [anchorEl, setAnchorEl] = (0, import_react3.useState)(null);
|
|
1045
1039
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1046
1040
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1047
1041
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
@@ -1061,7 +1055,6 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1061
1055
|
table,
|
|
1062
1056
|
anchorEl,
|
|
1063
1057
|
onClose: () => setAnchorEl(null),
|
|
1064
|
-
onChange,
|
|
1065
1058
|
showAllLabel
|
|
1066
1059
|
}
|
|
1067
1060
|
)
|
|
@@ -1069,7 +1062,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1069
1062
|
}
|
|
1070
1063
|
|
|
1071
1064
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1072
|
-
var
|
|
1065
|
+
var import_react4 = require("react");
|
|
1073
1066
|
var import_material11 = require("@mui/material");
|
|
1074
1067
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1075
1068
|
function BiampTablePagination({
|
|
@@ -1077,20 +1070,21 @@ function BiampTablePagination({
|
|
|
1077
1070
|
rowsPerPageOptions,
|
|
1078
1071
|
loading,
|
|
1079
1072
|
autoHide = true,
|
|
1080
|
-
|
|
1073
|
+
sx,
|
|
1074
|
+
...paginationProps
|
|
1081
1075
|
}) {
|
|
1082
1076
|
const rowCount = table.getRowCount();
|
|
1083
|
-
const lastRowCountRef = (0,
|
|
1077
|
+
const lastRowCountRef = (0, import_react4.useRef)(rowCount);
|
|
1084
1078
|
if (!loading && rowCount >= 0) {
|
|
1085
1079
|
lastRowCountRef.current = rowCount;
|
|
1086
1080
|
}
|
|
1087
1081
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1088
1082
|
const pageSize = table.getState().pagination.pageSize;
|
|
1089
1083
|
if (autoHide && !loading && stableCount <= pageSize) return null;
|
|
1090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1091
1085
|
import_material11.TablePagination,
|
|
1092
1086
|
{
|
|
1093
|
-
component:
|
|
1087
|
+
component: import_material11.Box,
|
|
1094
1088
|
count: stableCount,
|
|
1095
1089
|
page: table.getState().pagination.pageIndex,
|
|
1096
1090
|
rowsPerPage: table.getState().pagination.pageSize,
|
|
@@ -1101,9 +1095,19 @@ function BiampTablePagination({
|
|
|
1101
1095
|
},
|
|
1102
1096
|
rowsPerPageOptions: rowsPerPageOptions ?? [],
|
|
1103
1097
|
showFirstButton: true,
|
|
1104
|
-
showLastButton: true
|
|
1098
|
+
showLastButton: true,
|
|
1099
|
+
sx: {
|
|
1100
|
+
height: 40,
|
|
1101
|
+
minHeight: 40,
|
|
1102
|
+
"& .MuiToolbar-root": {
|
|
1103
|
+
minHeight: 40,
|
|
1104
|
+
px: 0
|
|
1105
|
+
},
|
|
1106
|
+
...sx
|
|
1107
|
+
},
|
|
1108
|
+
...paginationProps
|
|
1105
1109
|
}
|
|
1106
|
-
)
|
|
1110
|
+
);
|
|
1107
1111
|
}
|
|
1108
1112
|
|
|
1109
1113
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
@@ -1168,7 +1172,7 @@ function BiampTableToolbarExport({
|
|
|
1168
1172
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1169
1173
|
var import_material15 = require("@mui/material");
|
|
1170
1174
|
var import_assets8 = require("@bwp-web/assets");
|
|
1171
|
-
var
|
|
1175
|
+
var import_react5 = require("react");
|
|
1172
1176
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1173
1177
|
function BiampTableToolbarFilters({
|
|
1174
1178
|
activeFilterCount,
|
|
@@ -1183,8 +1187,8 @@ function BiampTableToolbarFilters({
|
|
|
1183
1187
|
buttonLabel = "Filters",
|
|
1184
1188
|
DrawerProps: drawerProps
|
|
1185
1189
|
}) {
|
|
1186
|
-
const [open, setOpen] = (0,
|
|
1187
|
-
const titleId = (0,
|
|
1190
|
+
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
1191
|
+
const titleId = (0, import_react5.useId)();
|
|
1188
1192
|
function handleClose() {
|
|
1189
1193
|
onApply?.();
|
|
1190
1194
|
setOpen(false);
|
|
@@ -1301,21 +1305,21 @@ function BiampTableToolbarFilters({
|
|
|
1301
1305
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1302
1306
|
var import_material16 = require("@mui/material");
|
|
1303
1307
|
var import_assets9 = require("@bwp-web/assets");
|
|
1304
|
-
var
|
|
1308
|
+
var import_react7 = require("react");
|
|
1305
1309
|
|
|
1306
1310
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1307
|
-
var
|
|
1311
|
+
var import_react6 = require("react");
|
|
1308
1312
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1309
1313
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1310
|
-
const timeoutRef = (0,
|
|
1311
|
-
const callbackRef = (0,
|
|
1314
|
+
const timeoutRef = (0, import_react6.useRef)(null);
|
|
1315
|
+
const callbackRef = (0, import_react6.useRef)(callback);
|
|
1312
1316
|
callbackRef.current = callback;
|
|
1313
|
-
(0,
|
|
1317
|
+
(0, import_react6.useEffect)(() => {
|
|
1314
1318
|
return () => {
|
|
1315
1319
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1316
1320
|
};
|
|
1317
1321
|
}, []);
|
|
1318
|
-
return (0,
|
|
1322
|
+
return (0, import_react6.useCallback)(
|
|
1319
1323
|
(...args) => {
|
|
1320
1324
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1321
1325
|
timeoutRef.current = setTimeout(
|
|
@@ -1348,10 +1352,10 @@ function BiampTableToolbarSearch({
|
|
|
1348
1352
|
sx,
|
|
1349
1353
|
...textFieldProps
|
|
1350
1354
|
}) {
|
|
1351
|
-
const [inputValue, setInputValue] = (0,
|
|
1352
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
1355
|
+
const [inputValue, setInputValue] = (0, import_react7.useState)(defaultValue);
|
|
1356
|
+
const [isExpanded, setIsExpanded] = (0, import_react7.useState)(false);
|
|
1353
1357
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
1354
|
-
(0,
|
|
1358
|
+
(0, import_react7.useEffect)(() => {
|
|
1355
1359
|
setInputValue(defaultValue);
|
|
1356
1360
|
}, [defaultValue]);
|
|
1357
1361
|
const handleChange = (e) => {
|
|
@@ -1516,6 +1520,7 @@ function downloadCsv(csvContent, filename) {
|
|
|
1516
1520
|
exportToCsv,
|
|
1517
1521
|
getColumnVisibilityDirtyCount,
|
|
1518
1522
|
getDefaultColumnVisibility,
|
|
1523
|
+
toVisibilityState,
|
|
1519
1524
|
useDebouncedCallback
|
|
1520
1525
|
});
|
|
1521
1526
|
//# sourceMappingURL=index.cjs.map
|