@webority/ui-react 0.17.1 → 0.17.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.
|
@@ -15,14 +15,24 @@
|
|
|
15
15
|
* @param {(row: object) => import('react').ReactNode} [props.rowActions]
|
|
16
16
|
* @param {string} [props.rowActionsLabel]
|
|
17
17
|
* @param {object} [props.pagination] The footer's state, usually straight from usePagination:
|
|
18
|
-
* `{ page, totalPages, pageSize, total,
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* `{ page, totalPages, pageSize, total, setPage, setPageSize }`, plus the optional `pageSizes`
|
|
19
|
+
* and `mode` that AppTablePagination takes. The footer shows once `total` is above 0 and stays
|
|
20
|
+
* in place while `loading`, so the table does not jump between pages.
|
|
21
21
|
* @param {string} [props.ariaLabel]
|
|
22
22
|
* @param {string} [props.className] Extra classes on the <table> (column/table styling).
|
|
23
23
|
* @param {string} [props.wrapperClassName] Extra classes on the `.table-wrap` outer div — the
|
|
24
24
|
* padding hook. Manage the table's inset from here (e.g. a class that sets `--wui-table-pad`);
|
|
25
25
|
* the Razor counterpart is a plain `class` on `<app-data-table>`.
|
|
26
|
+
* @param {'comfortable'|'cozy'|'compact'} [props.density='comfortable'] Row height: 54 / 48 / 40px.
|
|
27
|
+
* compact is one line per row (the identity subline is hidden). An avatar with no size of its own
|
|
28
|
+
* follows the density (32 / 28 / 24px).
|
|
29
|
+
* @param {boolean} [props.striped=false] Alternate-row shading in place of divider lines.
|
|
30
|
+
* @param {string|number} [props.maxHeight] Caps the table's height; the body scrolls inside it with
|
|
31
|
+
* the header pinned. Without it there is no scroll box for the header to stick to.
|
|
32
|
+
* @param {boolean} [props.stickyFirstColumn=false] Pins the first column (and the select/expand
|
|
33
|
+
* column before it) while a wide table scrolls sideways.
|
|
34
|
+
* @param {(row: object) => 'success'|'warning'|'danger'|'info'|undefined} [props.rowStatus] A coloured
|
|
35
|
+
* bar on the row's leading edge, e.g. danger for an overdue invoice. Undefined draws none.
|
|
26
36
|
* @param {boolean} [props.selectable=false] Render a leading checkbox column.
|
|
27
37
|
* @param {Set<string|number>} [props.selectedIds] Currently selected row keys.
|
|
28
38
|
* @param {(id: string|number) => void} [props.onToggleRow]
|
|
@@ -30,7 +40,7 @@
|
|
|
30
40
|
* @param {(row: object) => import('react').ReactNode} [props.renderExpanded] When given, each row
|
|
31
41
|
* gets a leading expand toggle; the returned content renders in a full-width row beneath it.
|
|
32
42
|
*/
|
|
33
|
-
export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, wrapperClassName, selectable, selectedIds, onToggleRow, onToggleAll, renderExpanded, ...rest }: {
|
|
43
|
+
export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, wrapperClassName, selectable, selectedIds, onToggleRow, onToggleAll, renderExpanded, density, striped, maxHeight, stickyFirstColumn, rowStatus, ...rest }: {
|
|
34
44
|
columns: object[];
|
|
35
45
|
rows: object[];
|
|
36
46
|
rowKey?: (row: object, index: number) => string | number;
|
|
@@ -50,6 +60,11 @@ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, load
|
|
|
50
60
|
ariaLabel?: string;
|
|
51
61
|
className?: string;
|
|
52
62
|
wrapperClassName?: string;
|
|
63
|
+
density?: 'comfortable' | 'cozy' | 'compact';
|
|
64
|
+
striped?: boolean;
|
|
65
|
+
maxHeight?: string | number;
|
|
66
|
+
stickyFirstColumn?: boolean;
|
|
67
|
+
rowStatus?: (row: object) => 'success' | 'warning' | 'danger' | 'info' | undefined;
|
|
53
68
|
selectable?: boolean;
|
|
54
69
|
selectedIds?: Set<string | number>;
|
|
55
70
|
onToggleRow?: (id: string | number) => void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pagination footer under a .table. Pair with usePagination.
|
|
3
3
|
*
|
|
4
|
+
* A page-size menu ("10 per page") beside the page buttons. It shows no row range and no total:
|
|
5
|
+
* the page buttons already say where you are.
|
|
6
|
+
*
|
|
4
7
|
* `page` is ONE-BASED, matching `<app-table-pagination page="…">` (the shared 1-based pagination contract). It used to be zero-based here while
|
|
5
8
|
* Razor's was one-based — the same prop name meaning different things on the two surfaces,
|
|
6
9
|
* which no name-level check can see. `pageCount` is likewise now `totalPages`, the name
|
|
@@ -10,30 +13,24 @@
|
|
|
10
13
|
* @param {number} props.page 1-based.
|
|
11
14
|
* @param {number} props.totalPages
|
|
12
15
|
* @param {number} props.pageSize
|
|
13
|
-
* @param {number} props.total
|
|
14
|
-
* @param {number} props.firstRow
|
|
15
|
-
* @param {number} props.lastRow
|
|
16
16
|
* @param {(page: number) => void} props.onPageChange
|
|
17
17
|
* @param {(size: number) => void} props.onPageSizeChange
|
|
18
18
|
* @param {number[]} [props.pageSizes]
|
|
19
|
-
* @param {'prev-next'
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param {boolean} [props.showPageSize=true] Show the
|
|
23
|
-
*
|
|
19
|
+
* @param {'numbered'|'prev-next'} [props.mode='numbered'] numbered (default) puts windowed page
|
|
20
|
+
* buttons (first/last plus an ellipsis over any run of hidden pages) between the arrows.
|
|
21
|
+
* prev-next is the arrows with a "Page N of M" readout.
|
|
22
|
+
* @param {boolean} [props.showPageSize=true] Show the page-size menu. Set false for a pager that
|
|
23
|
+
* pages but doesn't expose page size.
|
|
24
24
|
* @param {string} [props.className] Merged with the component's own table-pagination class.
|
|
25
25
|
*/
|
|
26
|
-
export default function AppTablePagination({ page, totalPages, pageSize,
|
|
26
|
+
export default function AppTablePagination({ page, totalPages, pageSize, onPageChange, onPageSizeChange, pageSizes, mode, showPageSize, className, ...rest }: {
|
|
27
27
|
page: number;
|
|
28
28
|
totalPages: number;
|
|
29
29
|
pageSize: number;
|
|
30
|
-
total: number;
|
|
31
|
-
firstRow: number;
|
|
32
|
-
lastRow: number;
|
|
33
30
|
onPageChange: (page: number) => void;
|
|
34
31
|
onPageSizeChange: (size: number) => void;
|
|
35
32
|
pageSizes?: number[];
|
|
36
|
-
mode?: '
|
|
33
|
+
mode?: 'numbered' | 'prev-next';
|
|
37
34
|
showPageSize?: boolean;
|
|
38
35
|
className?: string;
|
|
39
36
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toolbar above a table: filters on the left, search and actions on the right. While rows are
|
|
3
|
+
* selected the same strip becomes a bulk bar ("3 selected", the bulk actions, Clear), so the two
|
|
4
|
+
* never compete for space. Place it directly above `AppDataTable`; Razor counterpart:
|
|
5
|
+
* `<app-table-toolbar for="…">`.
|
|
6
|
+
*
|
|
7
|
+
* Both rows are always rendered and one is `hidden`, so the markup is identical on both surfaces
|
|
8
|
+
* and the swap never shifts what comes after.
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {import('react').ReactNode} [props.filters] Left side: status segments, chips, a filter menu.
|
|
12
|
+
* @param {import('react').ReactNode} [props.actions] Right side: search, export, a columns menu.
|
|
13
|
+
* @param {number} [props.selectedCount=0] Selected rows. Above 0, the bulk bar replaces the toolbar.
|
|
14
|
+
* @param {import('react').ReactNode} [props.bulkActions] Buttons shown in the bulk bar.
|
|
15
|
+
* @param {() => void} [props.onClearSelection] Shows a Clear button in the bulk bar that calls this.
|
|
16
|
+
* @param {string} [props.className]
|
|
17
|
+
*/
|
|
18
|
+
export default function AppTableToolbar({ filters, actions, selectedCount, bulkActions, onClearSelection, className, ...rest }: {
|
|
19
|
+
filters?: import('react').ReactNode;
|
|
20
|
+
actions?: import('react').ReactNode;
|
|
21
|
+
selectedCount?: number;
|
|
22
|
+
bulkActions?: import('react').ReactNode;
|
|
23
|
+
onClearSelection?: () => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
}): import("react").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export { default as AppStepper } from "./components/AppStepper.jsx";
|
|
|
72
72
|
export { default as AppSwitch } from "./components/AppSwitch.jsx";
|
|
73
73
|
export { default as AppTableEmptyState } from "./components/AppTableEmptyState.jsx";
|
|
74
74
|
export { default as AppTablePagination } from "./components/AppTablePagination.jsx";
|
|
75
|
+
export { default as AppTableToolbar } from "./components/AppTableToolbar.jsx";
|
|
75
76
|
export { default as AppTabs } from "./components/AppTabs.jsx";
|
|
76
77
|
export { default as AppTagInput } from "./components/AppTagInput.jsx";
|
|
77
78
|
export { default as AppTextarea } from "./components/AppTextarea.jsx";
|