@cloudwick/astral-ui 8.4.0 → 8.5.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/README.md +2 -2
- package/dist/components/adpIcon/adpIcon.d.ts +7 -2
- package/dist/components/button/button.d.ts +7 -7
- package/dist/components/card/card.d.ts +5 -0
- package/dist/components/card/cardVariants.d.ts +3 -0
- package/dist/components/dataTable/dataTable.d.ts +1 -137
- package/dist/components/dataTable/deriveConfiguredColumns.d.ts +7 -0
- package/dist/components/dataTable/index.d.ts +2 -2
- package/dist/components/dataTable/types.d.ts +135 -2
- package/dist/components/emptyState/emptyStateContent.d.ts +6 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +8 -6
- package/dist/components/multiSelectTransfer/multiSelectTransferModal.d.ts +4 -1
- package/dist/components/multiSelectTransfer/multiSelectTransferOptionRow.d.ts +5 -4
- package/dist/components/multiSelectTransfer/multiSelectTransferVariants.d.ts +18 -0
- package/dist/components/multiSelectTransfer/types.d.ts +16 -0
- package/dist/components/multiSelectTransfer/useMultiSelectTransferDropdownDraft.d.ts +34 -0
- package/dist/components/scrollbar/index.d.ts +2 -1
- package/dist/components/scrollbar/scrollbar.d.ts +1 -51
- package/dist/components/scrollbar/types.d.ts +52 -0
- package/dist/components/scrollbar/utils.d.ts +28 -0
- package/dist/components/select/selectComponents.d.ts +2 -3
- package/dist/components/select/selectKeyboard.d.ts +1 -1
- package/dist/components/select/types.d.ts +48 -9
- package/dist/components/select/useSelectComponents.d.ts +18 -0
- package/dist/components/select/useSelectDraft.d.ts +53 -0
- package/dist/components/select/useSelectOptionPool.d.ts +27 -0
- package/dist/components/select/utils.d.ts +9 -1
- package/dist/components/textField/textField.d.ts +5 -7
- package/dist/components/toggle/toggle.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/transferList/transferListItem.d.ts +6 -1
- package/dist/components/transferList/transferListPanel.d.ts +2 -58
- package/dist/components/transferList/types.d.ts +76 -1
- package/dist/components/transferList/useTransferList.d.ts +14 -5
- package/dist/components/transferList/useTransferListLimit.d.ts +24 -0
- package/dist/components/transferList/useTransferListPanelKeys.d.ts +7 -1
- package/dist/css/index.min.css +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useDeprecationWarning.d.ts +4 -0
- package/dist/hooks/useLiveAnnouncement.d.ts +13 -0
- package/dist/hooks/useSelectionLimit.d.ts +37 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +5 -5
- package/dist/utils/devWarn.d.ts +8 -2
- package/dist/utils/elementUtils.d.ts +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/optionText.d.ts +10 -0
- package/dist/utils/stringUtils/index.d.ts +2 -0
- package/dist/utils/stringUtils/optionToggled.d.ts +12 -0
- package/dist/utils/stringUtils/selectionLimitReached.d.ts +8 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
UI Library for Cloudwick
|
|
4
4
|
|
|
5
|
-
Version - 8.
|
|
5
|
+
Version - 8.5.0
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ This package has the following peer dependencies:
|
|
|
27
27
|
Astral UI provides the following components:
|
|
28
28
|
|
|
29
29
|
- Accordion
|
|
30
|
-
- ADPIcon
|
|
30
|
+
- ADPIcon (deprecated, removed in the next major; use `@cloudwick/icons`)
|
|
31
31
|
- Avatar
|
|
32
32
|
- AvatarGroup
|
|
33
33
|
- Badge
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type IIconDetails, type TIconType, iconList } from "./svgObjects";
|
|
3
|
-
export { iconList };
|
|
3
|
+
export { iconList, type TIconType };
|
|
4
4
|
/**
|
|
5
5
|
* Icon component for ADP icons
|
|
6
6
|
*
|
|
@@ -54,9 +54,14 @@ export interface IADPIconProps extends Omit<React.SVGAttributes<SVGSVGElement>,
|
|
|
54
54
|
*/
|
|
55
55
|
customSVG?: IIconDetails;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Renders an SVG icon from the set of predefined icons or a custom SVG object. Library components
|
|
59
|
+
* render this directly; consumers get it through the deprecated `ADPIcon`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const ADPIconBase: React.ForwardRefExoticComponent<IADPIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
57
62
|
/**
|
|
58
63
|
* Astral UI Icon component
|
|
59
64
|
*
|
|
60
|
-
*
|
|
65
|
+
* @deprecated Use an icon from `@cloudwick/icons` instead. `ADPIcon` will be removed in the next major.
|
|
61
66
|
*/
|
|
62
67
|
export declare const ADPIcon: React.ForwardRefExoticComponent<IADPIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Placement } from "@floating-ui/react";
|
|
3
|
-
import { type TIconType } from "../adpIcon";
|
|
3
|
+
import { type TIconType } from "../adpIcon/adpIcon";
|
|
4
4
|
export declare const colors: readonly ["primary", "secondary", "success", "warning", "error"];
|
|
5
5
|
export declare const variants: readonly ["filled", "outline", "shade", "text"];
|
|
6
6
|
export declare enum ESizes {
|
|
@@ -39,17 +39,15 @@ export interface IButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
39
39
|
/**
|
|
40
40
|
* Icon to be displayed before the button's content.
|
|
41
41
|
* @description
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* - If a ReactNode is provided, it will be rendered as-is.
|
|
42
|
+
* Pass an icon from `@cloudwick/icons`; the node is rendered as-is. A string icon name
|
|
43
|
+
* (`TIconType`) still renders an ADPIcon but is deprecated and will be removed in the next major.
|
|
45
44
|
*/
|
|
46
45
|
prefixIcon?: TIconType | React.ReactNode;
|
|
47
46
|
/**
|
|
48
47
|
* Icon to be displayed after the button's content.
|
|
49
48
|
* @description
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* - If a ReactNode is provided, it will be rendered as-is.
|
|
49
|
+
* Pass an icon from `@cloudwick/icons`; the node is rendered as-is. A string icon name
|
|
50
|
+
* (`TIconType`) still renders an ADPIcon but is deprecated and will be removed in the next major.
|
|
53
51
|
*/
|
|
54
52
|
suffixIcon?: TIconType | React.ReactNode;
|
|
55
53
|
/**
|
|
@@ -69,6 +67,8 @@ export interface IButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
69
67
|
tooltipPlacement?: Placement;
|
|
70
68
|
}
|
|
71
69
|
export declare const ButtonSizeToSpinnerMap: Record<TSize, "xxs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
70
|
+
/** The icon Button renders for a string icon name on a button of `size`. */
|
|
71
|
+
export declare function buttonIcon(icon: TIconType, size?: TSize): React.ReactElement;
|
|
72
72
|
/**
|
|
73
73
|
* Button component with multiple variants, colors, and sizes.
|
|
74
74
|
*
|
|
@@ -30,6 +30,11 @@ export interface ICardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
30
30
|
* Title of the card
|
|
31
31
|
*/
|
|
32
32
|
title?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Renders the title as a heading (`h1`–`h6`) at this level. Choose the level that fits the page outline.
|
|
35
|
+
* Without it the title is a plain `div`. Same values as the exported `THeadingLevel`.
|
|
36
|
+
*/
|
|
37
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
33
38
|
/**
|
|
34
39
|
* Props for the CTAGroup component. Pass an object with the props for the CTAGroup.
|
|
35
40
|
*/
|
|
@@ -12,6 +12,7 @@ export declare const cardVariants: import("tailwind-variants").TVReturnType<{
|
|
|
12
12
|
}, {
|
|
13
13
|
base: string;
|
|
14
14
|
header: string;
|
|
15
|
+
title: string;
|
|
15
16
|
body: string;
|
|
16
17
|
footer: string;
|
|
17
18
|
}, undefined, {
|
|
@@ -28,6 +29,7 @@ export declare const cardVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
29
|
}, {
|
|
29
30
|
base: string;
|
|
30
31
|
header: string;
|
|
32
|
+
title: string;
|
|
31
33
|
body: string;
|
|
32
34
|
footer: string;
|
|
33
35
|
}, import("tailwind-variants").TVReturnType<{
|
|
@@ -44,6 +46,7 @@ export declare const cardVariants: import("tailwind-variants").TVReturnType<{
|
|
|
44
46
|
}, {
|
|
45
47
|
base: string;
|
|
46
48
|
header: string;
|
|
49
|
+
title: string;
|
|
47
50
|
body: string;
|
|
48
51
|
footer: string;
|
|
49
52
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -1,143 +1,7 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { type ReactNode } from "react";
|
|
3
|
-
import
|
|
4
|
-
import type { TColumn, TFilterItem, TAdvancedFilterItem, TFilters } from "./types";
|
|
5
|
-
interface ISearchProps {
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
hidden?: boolean;
|
|
8
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
-
value?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Props to control the onSearch function debounceTime
|
|
12
|
-
*/
|
|
13
|
-
debounceTime?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Attach the debounced search function
|
|
16
|
-
*/
|
|
17
|
-
onSearch?: (value: string) => void;
|
|
18
|
-
}
|
|
19
|
-
interface IPaginationProps {
|
|
20
|
-
onPageSizeChange?: (args: number) => void;
|
|
21
|
-
onPageChange?: (args: number) => void;
|
|
22
|
-
totalRecords?: number;
|
|
23
|
-
offset?: number;
|
|
24
|
-
pageSize?: number;
|
|
25
|
-
}
|
|
26
|
-
export interface IDataTableProps<T> {
|
|
27
|
-
/**
|
|
28
|
-
* Defines the column structure for the Data Table, including column headers,
|
|
29
|
-
* accessors, and any additional configurations.
|
|
30
|
-
*/
|
|
31
|
-
columns: TColumn[];
|
|
32
|
-
/**
|
|
33
|
-
* The array of data objects that will populate the rows of the Data Table.
|
|
34
|
-
*/
|
|
35
|
-
data: T[];
|
|
36
|
-
/**
|
|
37
|
-
* Optional: Provide custom class names as a space-separated
|
|
38
|
-
* string to override the default Data Table styling.
|
|
39
|
-
*/
|
|
40
|
-
className?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Configuration for applying advanced filters to the Data Table.
|
|
43
|
-
* Allows complex filtering logic and customization.
|
|
44
|
-
*/
|
|
45
|
-
advancedFilters?: TAdvancedFilterItem[];
|
|
46
|
-
/**
|
|
47
|
-
* Configuration for applying basic filters to the Data Table.
|
|
48
|
-
* Enables simple filtering by key-value pairs.
|
|
49
|
-
* Showing maximum 3 basic filters in the table.
|
|
50
|
-
*/
|
|
51
|
-
basicFilters?: TFilterItem[];
|
|
52
|
-
/**
|
|
53
|
-
* Allows to set filters by key-value pairs.
|
|
54
|
-
*/
|
|
55
|
-
filters?: TFilters;
|
|
56
|
-
/**
|
|
57
|
-
* A callback function used to update the list of applied filters.
|
|
58
|
-
*/
|
|
59
|
-
setFilters?: (filters: TFilters) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Boolean value to display a loading state in the Data Table,
|
|
62
|
-
* typically while loading or processing data.
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
loading?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* A callback function triggered to refresh the Data Table,
|
|
68
|
-
* typically re-fetching or updating the data.
|
|
69
|
-
*/
|
|
70
|
-
onRefresh?: () => void;
|
|
71
|
-
/**
|
|
72
|
-
* To adjust the width of the columns
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
resizable?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* To adding virtualization for column in the data table
|
|
78
|
-
* @default true
|
|
79
|
-
*/
|
|
80
|
-
columnVirtualization?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* To adding virtualization for row in the data table
|
|
83
|
-
* @default true
|
|
84
|
-
*/
|
|
85
|
-
rowVirtualization?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* To pin the first columns of the data table
|
|
88
|
-
* @default true
|
|
89
|
-
*/
|
|
90
|
-
pinnedFirstColumn?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* To make the row selectable by showing checkboxes
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
selectable?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Callback function triggered on row selection.
|
|
98
|
-
* @param selectedRows - Index List of the selected rows
|
|
99
|
-
*/
|
|
100
|
-
onRowSelection?: (selectedRows: object) => void;
|
|
101
|
-
/**
|
|
102
|
-
* Allows to set sort by using key-value pair.
|
|
103
|
-
*/
|
|
104
|
-
sorting?: SortingState;
|
|
105
|
-
/**
|
|
106
|
-
* Callback function triggered on row sorting.
|
|
107
|
-
* @param sortState - Index List of the selected rows
|
|
108
|
-
*/
|
|
109
|
-
setSorting?: OnChangeFn<SortingState> | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Allows to set pagination props.
|
|
112
|
-
*/
|
|
113
|
-
paginationProps?: IPaginationProps;
|
|
114
|
-
/**
|
|
115
|
-
* To Adjust the height of the table.
|
|
116
|
-
* @default 100%
|
|
117
|
-
*/
|
|
118
|
-
height?: string;
|
|
119
|
-
/**
|
|
120
|
-
* To set the page size option
|
|
121
|
-
* @default PAGE_SIZE_OPTIONS
|
|
122
|
-
*/
|
|
123
|
-
pageSizeOptions?: number[];
|
|
124
|
-
/**
|
|
125
|
-
* To add the custom CTAs
|
|
126
|
-
*/
|
|
127
|
-
customCTAs?: ReactNode;
|
|
128
|
-
/**
|
|
129
|
-
* Callback function triggered on change of Column Preferences.
|
|
130
|
-
* @param columns - columns array with updated order and selected key value
|
|
131
|
-
*/
|
|
132
|
-
setColumns: (columns: TColumn[]) => void;
|
|
133
|
-
/**
|
|
134
|
-
* Allows to set search textfield props.
|
|
135
|
-
*/
|
|
136
|
-
searchProps?: ISearchProps;
|
|
137
|
-
}
|
|
2
|
+
import type { IDataTableProps } from "./types";
|
|
138
3
|
/**
|
|
139
4
|
* DataTable is a powerful component that displays tabular data with advanced features
|
|
140
5
|
* like filtering, sorting, pagination, and row selection.
|
|
141
6
|
*/
|
|
142
7
|
export declare const DataTable: <T extends object>({ advancedFilters, basicFilters, className, columns, data, filters, loading, paginationProps, resizable, selectable, pinnedFirstColumn, rowVirtualization, columnVirtualization, sorting, height, customCTAs, searchProps, pageSizeOptions, setFilters, setSorting, onRefresh, onRowSelection, setColumns }: IDataTableProps<T>) => ReactNode;
|
|
143
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ColumnHelper } from "@tanstack/react-table";
|
|
2
|
+
import type { TColumn } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* The TanStack columns for a DataTable: the row-selection checkbox column when `selectable`, then the
|
|
5
|
+
* consumer's columns with fixed ones first and deselected ones dropped.
|
|
6
|
+
*/
|
|
7
|
+
export declare const deriveConfiguredColumns: (rawColumns: TColumn[], selectable: boolean, columnHelper: ColumnHelper<any>) => import("@tanstack/react-table").AccessorKeyColumnDef<any, any>[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DataTable
|
|
2
|
-
export { type TColumn, type TFilterItem, type TAdvancedFilterItem, type TFilters } from "./types";
|
|
1
|
+
export { DataTable } from "./dataTable";
|
|
2
|
+
export { type IDataTableProps, type TColumn, type TFilterItem, type TAdvancedFilterItem, type TFilters } from "./types";
|
|
3
3
|
export { AdvancedFilters } from "./advancedFilters";
|
|
4
4
|
export { DataTableColumnSettings } from "./DataTableColumnSettings";
|
|
5
5
|
export { PageSizeModal } from "./pageSizeModal";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { CellContext, SortingFnOption } from "@tanstack/react-table";
|
|
1
|
+
import type { ChangeEvent, ReactNode } from "react";
|
|
2
|
+
import type { CellContext, OnChangeFn, SortingFnOption, SortingState } from "@tanstack/react-table";
|
|
3
3
|
import type { TIconType } from "../adpIcon";
|
|
4
4
|
import type { IOption } from "../select";
|
|
5
5
|
/**
|
|
@@ -58,3 +58,136 @@ export type TAdvancedFilterItem = {
|
|
|
58
58
|
* Filters record type
|
|
59
59
|
*/
|
|
60
60
|
export type TFilters = Record<string, any>;
|
|
61
|
+
export interface ISearchProps {
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
hidden?: boolean;
|
|
64
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
65
|
+
value?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Props to control the onSearch function debounceTime
|
|
68
|
+
*/
|
|
69
|
+
debounceTime?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Attach the debounced search function
|
|
72
|
+
*/
|
|
73
|
+
onSearch?: (value: string) => void;
|
|
74
|
+
}
|
|
75
|
+
export interface IPaginationProps {
|
|
76
|
+
onPageSizeChange?: (args: number) => void;
|
|
77
|
+
onPageChange?: (args: number) => void;
|
|
78
|
+
totalRecords?: number;
|
|
79
|
+
offset?: number;
|
|
80
|
+
pageSize?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface IDataTableProps<T> {
|
|
83
|
+
/**
|
|
84
|
+
* Defines the column structure for the Data Table, including column headers,
|
|
85
|
+
* accessors, and any additional configurations.
|
|
86
|
+
*/
|
|
87
|
+
columns: TColumn[];
|
|
88
|
+
/**
|
|
89
|
+
* The array of data objects that will populate the rows of the Data Table.
|
|
90
|
+
*/
|
|
91
|
+
data: T[];
|
|
92
|
+
/**
|
|
93
|
+
* Optional: Provide custom class names as a space-separated
|
|
94
|
+
* string to override the default Data Table styling.
|
|
95
|
+
*/
|
|
96
|
+
className?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Configuration for applying advanced filters to the Data Table.
|
|
99
|
+
* Allows complex filtering logic and customization.
|
|
100
|
+
*/
|
|
101
|
+
advancedFilters?: TAdvancedFilterItem[];
|
|
102
|
+
/**
|
|
103
|
+
* Configuration for applying basic filters to the Data Table.
|
|
104
|
+
* Enables simple filtering by key-value pairs.
|
|
105
|
+
* Showing maximum 3 basic filters in the table.
|
|
106
|
+
*/
|
|
107
|
+
basicFilters?: TFilterItem[];
|
|
108
|
+
/**
|
|
109
|
+
* Allows to set filters by key-value pairs.
|
|
110
|
+
*/
|
|
111
|
+
filters?: TFilters;
|
|
112
|
+
/**
|
|
113
|
+
* A callback function used to update the list of applied filters.
|
|
114
|
+
*/
|
|
115
|
+
setFilters?: (filters: TFilters) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Boolean value to display a loading state in the Data Table,
|
|
118
|
+
* typically while loading or processing data.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
loading?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* A callback function triggered to refresh the Data Table,
|
|
124
|
+
* typically re-fetching or updating the data.
|
|
125
|
+
*/
|
|
126
|
+
onRefresh?: () => void;
|
|
127
|
+
/**
|
|
128
|
+
* To adjust the width of the columns
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
resizable?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* To adding virtualization for column in the data table
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
columnVirtualization?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* To adding virtualization for row in the data table
|
|
139
|
+
* @default true
|
|
140
|
+
*/
|
|
141
|
+
rowVirtualization?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* To pin the first columns of the data table
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
pinnedFirstColumn?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* To make the row selectable by showing checkboxes
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
selectable?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Callback function triggered on row selection.
|
|
154
|
+
* @param selectedRows - Index List of the selected rows
|
|
155
|
+
*/
|
|
156
|
+
onRowSelection?: (selectedRows: object) => void;
|
|
157
|
+
/**
|
|
158
|
+
* Allows to set sort by using key-value pair.
|
|
159
|
+
*/
|
|
160
|
+
sorting?: SortingState;
|
|
161
|
+
/**
|
|
162
|
+
* Callback function triggered on row sorting.
|
|
163
|
+
* @param sortState - Index List of the selected rows
|
|
164
|
+
*/
|
|
165
|
+
setSorting?: OnChangeFn<SortingState> | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Allows to set pagination props.
|
|
168
|
+
*/
|
|
169
|
+
paginationProps?: IPaginationProps;
|
|
170
|
+
/**
|
|
171
|
+
* To Adjust the height of the table.
|
|
172
|
+
* @default 100%
|
|
173
|
+
*/
|
|
174
|
+
height?: string;
|
|
175
|
+
/**
|
|
176
|
+
* To set the page size option
|
|
177
|
+
* @default [ 25, 50, 100, 200, 500, 1000 ]
|
|
178
|
+
*/
|
|
179
|
+
pageSizeOptions?: number[];
|
|
180
|
+
/**
|
|
181
|
+
* To add the custom CTAs
|
|
182
|
+
*/
|
|
183
|
+
customCTAs?: ReactNode;
|
|
184
|
+
/**
|
|
185
|
+
* Callback function triggered on change of Column Preferences.
|
|
186
|
+
* @param columns - columns array with updated order and selected key value
|
|
187
|
+
*/
|
|
188
|
+
setColumns: (columns: TColumn[]) => void;
|
|
189
|
+
/**
|
|
190
|
+
* Allows to set search textfield props.
|
|
191
|
+
*/
|
|
192
|
+
searchProps?: ISearchProps;
|
|
193
|
+
}
|
|
@@ -4,6 +4,12 @@ export interface IEmptyStateContentProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
4
4
|
className?: string;
|
|
5
5
|
/** Content title */
|
|
6
6
|
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the title as a heading (`h1`–`h6`) at this level. Set it only when the empty state starts a
|
|
9
|
+
* section of the page, at the level that fits the page outline. Without it the title is a `p`. Same values
|
|
10
|
+
* as the exported `THeadingLevel`.
|
|
11
|
+
*/
|
|
12
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
13
|
/** Content children */
|
|
8
14
|
children?: React.ReactNode;
|
|
9
15
|
}
|
|
@@ -3,6 +3,8 @@ import { type TSentinelRef } from "@hooks";
|
|
|
3
3
|
import type { TTransferListValue } from "../transferList/types";
|
|
4
4
|
import type { TMultiSelectTransferOption, TMultiSelectTransferSize } from "./types";
|
|
5
5
|
interface IMultiSelectTransferDropdownProps {
|
|
6
|
+
/** Opened from the keyboard, so the active row starts with the keyboard highlight. */
|
|
7
|
+
openedByKeyboard: boolean;
|
|
6
8
|
error?: boolean;
|
|
7
9
|
size: TMultiSelectTransferSize;
|
|
8
10
|
disabled?: boolean;
|
|
@@ -21,17 +23,17 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
21
23
|
hasSelectAll: boolean;
|
|
22
24
|
areAllSelected: boolean;
|
|
23
25
|
onSelectAll: () => void;
|
|
26
|
+
/** Cannot be ticked now: its own `isDisabled` or the limit. Arrow keys and Enter skip only the former. */
|
|
27
|
+
isOptionDisabled: (option: TMultiSelectTransferOption) => boolean;
|
|
28
|
+
/** The last toggle (and the limit, when it reached it), spoken through its own polite region. */
|
|
29
|
+
announcement?: string;
|
|
24
30
|
/** Escape from anywhere in the dropdown: discard the draft and close. */
|
|
25
31
|
onCancel: () => void;
|
|
26
32
|
/** Tab out of the dropdown's last (or Shift+Tab out of its first) control: commit and close. */
|
|
27
33
|
onCommit: () => void;
|
|
28
34
|
/** Any load in flight; renders the loader row below the list. */
|
|
29
35
|
isLoading?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Loader (or error) takes the rows' place rather than appending below them. Required, and supplied
|
|
32
|
-
* by the option source rather than re-derived here, so the hook is the single source of this
|
|
33
|
-
* predicate — two components deriving it differently is how they drifted.
|
|
34
|
-
*/
|
|
36
|
+
/** Loader (or error) takes the rows' place rather than appending. Supplied by the option source, its one owner. */
|
|
35
37
|
isSearchFetch: boolean;
|
|
36
38
|
sentinelRef: TSentinelRef;
|
|
37
39
|
/** Replaces the rows when set: the whole list failed to load. */
|
|
@@ -49,7 +51,7 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
49
51
|
* The open-state dropdown for MultiSelectTransfer: an optional search input, an optional "Select All"
|
|
50
52
|
* row, the (draft-checked) option list, and the infinite-scroll sentinel.
|
|
51
53
|
*/
|
|
52
|
-
export declare function MultiSelectTransferDropdown({ error, size, disabled, searchable, filterQuery, onFilterInput, onFilterKeyDown, onFilterKeyUp, onFilterBlur, searchPlaceholder, options, selectedValues, onOptionToggle, hasSelectAll, areAllSelected, onSelectAll, onCancel, onCommit, isLoading, isSearchFetch, sentinelRef, loadError, loadMoreError, onRetryLoadMore, retryLabel, reloadTooltip, onReload, isReloading }: IMultiSelectTransferDropdownProps): React.ReactElement;
|
|
54
|
+
export declare function MultiSelectTransferDropdown({ openedByKeyboard, error, size, disabled, searchable, filterQuery, onFilterInput, onFilterKeyDown, onFilterKeyUp, onFilterBlur, searchPlaceholder, options, selectedValues, onOptionToggle, hasSelectAll, areAllSelected, onSelectAll, isOptionDisabled, announcement, onCancel, onCommit, isLoading, isSearchFetch, sentinelRef, loadError, loadMoreError, onRetryLoadMore, retryLabel, reloadTooltip, onReload, isReloading }: IMultiSelectTransferDropdownProps): React.ReactElement;
|
|
53
55
|
export declare namespace MultiSelectTransferDropdown {
|
|
54
56
|
var displayName: string;
|
|
55
57
|
}
|
|
@@ -11,6 +11,9 @@ interface IMultiSelectTransferModalProps {
|
|
|
11
11
|
title?: React.ReactNode;
|
|
12
12
|
subtitle?: React.ReactNode;
|
|
13
13
|
reorderable?: boolean;
|
|
14
|
+
showSelectAll?: boolean;
|
|
15
|
+
maxSelected?: number;
|
|
16
|
+
maxSelectedMessage?: string;
|
|
14
17
|
reloadTooltip?: string;
|
|
15
18
|
onReload?: () => void;
|
|
16
19
|
isReloading?: boolean;
|
|
@@ -41,7 +44,7 @@ interface IMultiSelectTransferModalProps {
|
|
|
41
44
|
* The transfer-list modal surface for MultiSelectTransfer: full-screen on mobile, a widened
|
|
42
45
|
* centered dialog from sm up. Hosts the two-panel TransferList plus a pinned footer bar.
|
|
43
46
|
*/
|
|
44
|
-
export declare function MultiSelectTransferModal({ showModal, availableItems, selectedItems, onChange, onCancel, onDone, header, title, subtitle, reorderable, reloadTooltip, onReload, isReloading, searchable, searchPlaceholder, availablePanelHeaderSlot, selectedPanelHeaderSlot, hasMoreAvailable, onLoadMoreAvailable, isLoadingAvailable, isLoadingMoreAvailable, availableLoadError, availableLoadMoreError, onRetryLoadMoreAvailable, retryLabel, availableTotalCount, availableSearchTerm, onAvailableSearchChange, cancelLabel, doneLabel }: IMultiSelectTransferModalProps): React.ReactElement;
|
|
47
|
+
export declare function MultiSelectTransferModal({ showModal, availableItems, selectedItems, onChange, onCancel, onDone, header, title, subtitle, reorderable, showSelectAll, maxSelected, maxSelectedMessage, reloadTooltip, onReload, isReloading, searchable, searchPlaceholder, availablePanelHeaderSlot, selectedPanelHeaderSlot, hasMoreAvailable, onLoadMoreAvailable, isLoadingAvailable, isLoadingMoreAvailable, availableLoadError, availableLoadMoreError, onRetryLoadMoreAvailable, retryLabel, availableTotalCount, availableSearchTerm, onAvailableSearchChange, cancelLabel, doneLabel }: IMultiSelectTransferModalProps): React.ReactElement;
|
|
45
48
|
export declare namespace MultiSelectTransferModal {
|
|
46
49
|
var displayName: string;
|
|
47
50
|
}
|
|
@@ -11,7 +11,8 @@ interface IOptionRowProps {
|
|
|
11
11
|
/** Escape has hidden the label reveal (see useLabelPeekDismissal). */
|
|
12
12
|
isPeekDismissed: boolean;
|
|
13
13
|
onToggle: () => void;
|
|
14
|
-
|
|
14
|
+
/** Pointer movement over the row; it hands the keyboard highlight back to the hover tint. */
|
|
15
|
+
onPointerMove: () => void;
|
|
15
16
|
onMouseEnter: () => void;
|
|
16
17
|
optionItemClass: string | undefined;
|
|
17
18
|
optionLabelWrapClass: string;
|
|
@@ -26,8 +27,8 @@ interface IOptionRowProps {
|
|
|
26
27
|
* Rows are not individually tabbable: focus sits on the single tab stop above them — the filter input
|
|
27
28
|
* (a combobox) where the search is shown, otherwise the listbox itself — and keyboard navigation is
|
|
28
29
|
* driven from there by `aria-activedescendant` / arrow keys. `active` marks the row the arrow keys
|
|
29
|
-
* have landed on so it can be highlighted
|
|
30
|
-
* click
|
|
30
|
+
* have landed on, while the keyboard is in use, so it can be highlighted; the pointer path toggles on
|
|
31
|
+
* click and reports its movement. The keyboard-active row reveals a truncated label just as a hovered one does.
|
|
31
32
|
*/
|
|
32
|
-
export declare function OptionRow({ id, posInSet, setSize, label, checked, active, disabled, isPeekDismissed, onToggle,
|
|
33
|
+
export declare function OptionRow({ id, posInSet, setSize, label, checked, active, disabled, isPeekDismissed, onToggle, onPointerMove, onMouseEnter, optionItemClass, optionLabelWrapClass, optionLabelClass }: IOptionRowProps): React.ReactElement;
|
|
33
34
|
export {};
|
|
@@ -53,6 +53,12 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
53
53
|
};
|
|
54
54
|
false: {};
|
|
55
55
|
};
|
|
56
|
+
pointerNav: {
|
|
57
|
+
true: {
|
|
58
|
+
optionItem: string;
|
|
59
|
+
};
|
|
60
|
+
false: {};
|
|
61
|
+
};
|
|
56
62
|
searchable: {
|
|
57
63
|
false: {
|
|
58
64
|
dropdownHeader: string;
|
|
@@ -138,6 +144,12 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
138
144
|
};
|
|
139
145
|
false: {};
|
|
140
146
|
};
|
|
147
|
+
pointerNav: {
|
|
148
|
+
true: {
|
|
149
|
+
optionItem: string;
|
|
150
|
+
};
|
|
151
|
+
false: {};
|
|
152
|
+
};
|
|
141
153
|
searchable: {
|
|
142
154
|
false: {
|
|
143
155
|
dropdownHeader: string;
|
|
@@ -223,6 +235,12 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
223
235
|
};
|
|
224
236
|
false: {};
|
|
225
237
|
};
|
|
238
|
+
pointerNav: {
|
|
239
|
+
true: {
|
|
240
|
+
optionItem: string;
|
|
241
|
+
};
|
|
242
|
+
false: {};
|
|
243
|
+
};
|
|
226
244
|
searchable: {
|
|
227
245
|
false: {
|
|
228
246
|
dropdownHeader: string;
|
|
@@ -71,6 +71,22 @@ export interface IMultiSelectTransferProps {
|
|
|
71
71
|
isLoading?: boolean;
|
|
72
72
|
/** Max pills shown in the trigger before showing "+N More". @default 3 */
|
|
73
73
|
maxVisiblePills?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Renders the dropdown's "Select All" row and the transfer list modal's "Select all" checkboxes.
|
|
76
|
+
* While `maxSelected` is set the dropdown's row and the modal's Available-panel checkbox are always
|
|
77
|
+
* hidden, since selecting everything could exceed the limit.
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
showSelectAll?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The most options the selection may hold, on both surfaces. Once the dropdown draft (or the modal's
|
|
83
|
+
* Selected panel plus its checked rows) reaches it, every unchecked option is disabled until one is
|
|
84
|
+
* removed. A `value` already over the limit is left as it is. Must be a positive integer — anything
|
|
85
|
+
* else is ignored with a dev warning.
|
|
86
|
+
*/
|
|
87
|
+
maxSelected?: number;
|
|
88
|
+
/** Screen-reader announcement when `maxSelected` is reached. @default "Selection limit of {maxSelected} reached" */
|
|
89
|
+
maxSelectedMessage?: string;
|
|
74
90
|
/** Title rendered in the transfer list modal header. */
|
|
75
91
|
transferListTitle?: ReactNode;
|
|
76
92
|
/** Subtitle rendered under the modal title. */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TMultiSelectTransferOption } from "./types";
|
|
2
|
+
interface IUseMultiSelectTransferDropdownDraftArgs {
|
|
3
|
+
/** The loaded option pool. */
|
|
4
|
+
options: readonly TMultiSelectTransferOption[];
|
|
5
|
+
/** The pool is already the answer to the query, so no local filtering applies. */
|
|
6
|
+
isServerFiltered: boolean;
|
|
7
|
+
filterQuery: string;
|
|
8
|
+
/** The committed selection the draft starts from. */
|
|
9
|
+
value: TMultiSelectTransferOption[];
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
maxSelected?: number;
|
|
12
|
+
maxSelectedMessage?: string;
|
|
13
|
+
showSelectAll: boolean;
|
|
14
|
+
/** Speaks a draft change through the dropdown's polite region. */
|
|
15
|
+
announce: (message: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The dropdown's draft selection: ticks collect here while the dropdown is open and are committed by
|
|
19
|
+
* its caller. Also owns the rows the dropdown shows, `maxSelected` counted against the draft, Select
|
|
20
|
+
* All, and the announcement of every tick.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useMultiSelectTransferDropdownDraft({ options, isServerFiltered, filterQuery, value, isOpen, maxSelected, maxSelectedMessage, showSelectAll, announce }: IUseMultiSelectTransferDropdownDraftArgs): {
|
|
23
|
+
pendingSelectedRef: import("react").MutableRefObject<import("../transferList").ITransferListItem[]>;
|
|
24
|
+
setPendingSelected: import("react").Dispatch<import("react").SetStateAction<import("../transferList").ITransferListItem[]>>;
|
|
25
|
+
displayedOptions: readonly import("../transferList").ITransferListItem[];
|
|
26
|
+
pendingValues: Set<import("../transferList").TTransferListValue>;
|
|
27
|
+
maxSelectable: number | undefined;
|
|
28
|
+
hasSelectAll: boolean;
|
|
29
|
+
areAllSelected: boolean;
|
|
30
|
+
handleOptionToggle: (option: TMultiSelectTransferOption) => void;
|
|
31
|
+
isOptionDisabled: (option: TMultiSelectTransferOption) => boolean;
|
|
32
|
+
handleSelectAll: () => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|