@ansible/ansible-ui-framework 2.4.279 → 2.4.281
Sign up to get free protection for your applications and to get access to all the features.
- package/framework/PageForm/Inputs/PageFormFileUpload.d.ts +2 -2
- package/framework/PageForm/PageFormExpandableSection.cy.d.ts +1 -0
- package/framework/PageForm/PageFormExpandableSection.d.ts +7 -0
- package/framework/PageTable/PageTable.d.ts +1 -1
- package/framework/PageTable/PageTableColumn.d.ts +7 -9
- package/framework/PageTable/PageToolbar/PageToolbar.d.ts +1 -1
- package/framework/PageTable/PageToolbar/PageToolbarView.d.ts +0 -1
- package/framework/components/ReorderItems.d.ts +8 -10
- package/framework/components/useManageColumns.d.ts +5 -0
- package/framework/components/useManagedItems.d.ts +32 -0
- package/index.js +18574 -18168
- package/index.umd.cjs +260 -260
- package/package.json +1 -1
- package/style.css +1 -1
- package/framework/PageColumnModal.d.ts +0 -6
@@ -1,7 +1,7 @@
|
|
1
|
+
import { FileUploadProps } from '@patternfly/react-core';
|
1
2
|
import { PageFormGroupProps } from './PageFormGroup';
|
2
3
|
export type PageFormFileUploadProps = {
|
3
4
|
name: string;
|
4
|
-
isReadOnly?: boolean;
|
5
5
|
placeholder?: string;
|
6
|
-
} & PageFormGroupProps
|
6
|
+
} & PageFormGroupProps & Omit<FileUploadProps, 'id'>;
|
7
7
|
export declare function PageFormFileUpload(props: PageFormFileUploadProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface IPageFormExpandableSectionProps {
|
3
|
+
children: React.ReactNode;
|
4
|
+
singleColumn?: boolean;
|
5
|
+
}
|
6
|
+
export declare function PageFormExpandableSection(props: IPageFormExpandableSectionProps): import("react/jsx-runtime").JSX.Element;
|
7
|
+
export {};
|
@@ -11,6 +11,7 @@ export type IPaginationRelatedProps = {
|
|
11
11
|
setPerPage: (perPage: number) => void;
|
12
12
|
};
|
13
13
|
export type PageTableProps<T extends object> = {
|
14
|
+
id?: string;
|
14
15
|
keyFn: (item: T) => string | number;
|
15
16
|
itemCount?: number;
|
16
17
|
pageItems: T[] | undefined;
|
@@ -50,7 +51,6 @@ export type PageTableProps<T extends object> = {
|
|
50
51
|
disableTableView?: boolean;
|
51
52
|
disableListView?: boolean;
|
52
53
|
disableCardView?: boolean;
|
53
|
-
disableColumnManagement?: boolean;
|
54
54
|
defaultTableView?: PageTableViewType;
|
55
55
|
disableBodyPadding?: boolean;
|
56
56
|
disablePagination?: boolean;
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import { PageTableViewTypeE } from './PageToolbar/PageTableViewType';
|
3
3
|
export declare enum ColumnTableOption {
|
4
|
-
Key = "key",
|
5
4
|
Description = "description",
|
6
5
|
Expanded = "expanded",
|
7
|
-
Hidden = "hidden"
|
8
|
-
Id = "id"
|
6
|
+
Hidden = "hidden"
|
9
7
|
}
|
10
8
|
export declare enum ColumnListOption {
|
11
9
|
Name = "name",
|
@@ -183,7 +181,7 @@ export declare function useColumnsWithoutSort<T extends object>(columns: ITableC
|
|
183
181
|
modal?: ColumnModalOption | undefined;
|
184
182
|
})[];
|
185
183
|
export declare function useColumnsWithoutExpandedRow<T extends object>(columns: ITableColumn<T>[]): ({
|
186
|
-
table: ColumnTableOption.
|
184
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
187
185
|
type?: undefined;
|
188
186
|
value?: CellFn<T, string | number | boolean | string[] | null | undefined> | undefined;
|
189
187
|
cell: CellFn<T, ReactNode>;
|
@@ -201,7 +199,7 @@ export declare function useColumnsWithoutExpandedRow<T extends object>(columns:
|
|
201
199
|
card?: "name" | "hidden" | "description" | "subtitle" | undefined;
|
202
200
|
modal?: ColumnModalOption | undefined;
|
203
201
|
} | {
|
204
|
-
table: ColumnTableOption.
|
202
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
205
203
|
type: "text";
|
206
204
|
value: CellFn<T, string | null | undefined>;
|
207
205
|
id?: string | undefined;
|
@@ -218,7 +216,7 @@ export declare function useColumnsWithoutExpandedRow<T extends object>(columns:
|
|
218
216
|
card?: "name" | "hidden" | "description" | "subtitle" | undefined;
|
219
217
|
modal?: ColumnModalOption | undefined;
|
220
218
|
} | {
|
221
|
-
table: ColumnTableOption.
|
219
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
222
220
|
type: "description";
|
223
221
|
value: CellFn<T, string | null | undefined>;
|
224
222
|
id?: string | undefined;
|
@@ -235,7 +233,7 @@ export declare function useColumnsWithoutExpandedRow<T extends object>(columns:
|
|
235
233
|
card?: "name" | "hidden" | "description" | "subtitle" | undefined;
|
236
234
|
modal?: ColumnModalOption | undefined;
|
237
235
|
} | {
|
238
|
-
table: ColumnTableOption.
|
236
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
239
237
|
type: "datetime";
|
240
238
|
value: CellFn<T, string | number | undefined>;
|
241
239
|
id?: string | undefined;
|
@@ -252,7 +250,7 @@ export declare function useColumnsWithoutExpandedRow<T extends object>(columns:
|
|
252
250
|
card?: "name" | "hidden" | "description" | "subtitle" | undefined;
|
253
251
|
modal?: ColumnModalOption | undefined;
|
254
252
|
} | {
|
255
|
-
table: ColumnTableOption.
|
253
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
256
254
|
type: "labels";
|
257
255
|
value: CellFn<T, string[] | undefined>;
|
258
256
|
id?: string | undefined;
|
@@ -269,7 +267,7 @@ export declare function useColumnsWithoutExpandedRow<T extends object>(columns:
|
|
269
267
|
card?: "name" | "hidden" | "description" | "subtitle" | undefined;
|
270
268
|
modal?: ColumnModalOption | undefined;
|
271
269
|
} | {
|
272
|
-
table: ColumnTableOption.
|
270
|
+
table: ColumnTableOption.Description | ColumnTableOption.Hidden | undefined;
|
273
271
|
type: "count";
|
274
272
|
value: CellFn<T, number | undefined>;
|
275
273
|
id?: string | undefined;
|
@@ -5,6 +5,7 @@ import './PageToolbar.css';
|
|
5
5
|
import { IToolbarFilter } from './PageToolbarFilter';
|
6
6
|
import { PageTableSortOption } from './PageToolbarSort';
|
7
7
|
export type PageTableToolbarProps<T extends object> = {
|
8
|
+
localStorageKey?: string;
|
8
9
|
openColumnModal?: () => void;
|
9
10
|
keyFn: (item: T) => string | number;
|
10
11
|
itemCount?: number;
|
@@ -34,7 +35,6 @@ export type PageTableToolbarProps<T extends object> = {
|
|
34
35
|
disableTableView?: boolean;
|
35
36
|
disableListView?: boolean;
|
36
37
|
disableCardView?: boolean;
|
37
|
-
disableColumnManagement?: boolean;
|
38
38
|
disablePagination?: boolean;
|
39
39
|
bottomBorder?: boolean;
|
40
40
|
sortOptions?: PageTableSortOption[];
|
@@ -3,7 +3,6 @@ export type PageToolbarViewProps = {
|
|
3
3
|
disableTableView?: boolean;
|
4
4
|
disableCardView?: boolean;
|
5
5
|
disableListView?: boolean;
|
6
|
-
disableColumnManagement?: boolean;
|
7
6
|
openColumnModal?: () => void;
|
8
7
|
viewType: PageTableViewType;
|
9
8
|
setViewType: (viewType: PageTableViewType) => void;
|
@@ -2,21 +2,19 @@ import { ReactNode } from 'react';
|
|
2
2
|
type ReorderItemsProps<T extends object> = {
|
3
3
|
columns: {
|
4
4
|
header: string;
|
5
|
-
cell: (item: T) => ReactNode | string;
|
5
|
+
cell: (item: T, setItem: (item: T) => void) => ReactNode | string;
|
6
6
|
}[];
|
7
7
|
items: T[];
|
8
|
+
setItems: (items: T[]) => void;
|
9
|
+
isSelected: (items: T) => boolean;
|
10
|
+
selectItem: (items: T) => void;
|
11
|
+
unselectItem: (items: T) => void;
|
12
|
+
allSelected: boolean;
|
13
|
+
selectAll: () => void;
|
14
|
+
unselectAll: () => void;
|
8
15
|
keyFn: (item: T) => string | number;
|
9
|
-
onChange: (items: T[], selectedItems: T[]) => void;
|
10
|
-
isCompactBorderless?: boolean;
|
11
16
|
hideColumnHeaders?: boolean;
|
12
17
|
isSelectableWithCheckbox?: boolean;
|
13
|
-
defaultSelection?: T[];
|
14
|
-
};
|
15
|
-
export type ReorderItemsRef<T extends object> = {
|
16
|
-
getReorderedAndSelectedItems: () => {
|
17
|
-
reorderedItems: T[];
|
18
|
-
selectedItems: T[];
|
19
|
-
};
|
20
18
|
};
|
21
19
|
export declare function ReorderItems<T extends object>(props: ReorderItemsProps<T>): import("react/jsx-runtime").JSX.Element;
|
22
20
|
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { ITableColumn } from '../PageTable/PageTableColumn';
|
2
|
+
export declare function useManageColumns<T extends object>(id: string, tableColumns: ITableColumn<T>[], disableTableView?: boolean, disableListView?: boolean, disableCardView?: boolean): {
|
3
|
+
openColumnManagement: () => void;
|
4
|
+
managedColumns: ITableColumn<T>[];
|
5
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ModalVariant } from '@patternfly/react-core';
|
2
|
+
import { ReactNode } from 'react';
|
3
|
+
interface IManageItemColumn<ItemT extends object> {
|
4
|
+
header: string;
|
5
|
+
cell: (item: ItemT, setItem: (item: ItemT) => void) => ReactNode;
|
6
|
+
}
|
7
|
+
export interface ManageItemsProps<ItemT extends object> {
|
8
|
+
id: string;
|
9
|
+
title: string;
|
10
|
+
description?: string;
|
11
|
+
keyFn: (item: ItemT) => string | number;
|
12
|
+
items: ItemT[];
|
13
|
+
columns: IManageItemColumn<ItemT>[];
|
14
|
+
hideColumnHeaders?: boolean;
|
15
|
+
variant?: ModalVariant;
|
16
|
+
isSelected?: (item: ItemT) => boolean;
|
17
|
+
setSelected?: (item: ItemT, selected: boolean) => void;
|
18
|
+
saveFn?: (items: ItemT[]) => object[];
|
19
|
+
loadFn?: (items: ItemT[], data: object[]) => void;
|
20
|
+
}
|
21
|
+
export declare function useManageItems<ItemT extends object>(options: ManageItemsProps<ItemT>): {
|
22
|
+
openModal: () => void;
|
23
|
+
items: ItemT[];
|
24
|
+
isSelected: (item: ItemT) => boolean;
|
25
|
+
selectItem: () => (item: ItemT) => void;
|
26
|
+
unselectItem: () => (item: ItemT) => void;
|
27
|
+
};
|
28
|
+
export declare function ManageItemsModal<ItemT extends object>(props: ManageItemsProps<ItemT> & {
|
29
|
+
defaultSelectedItems?: ItemT[];
|
30
|
+
onApplyChanges: (items: ItemT[], selectedItems: ItemT[]) => void;
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
32
|
+
export {};
|