@ansible/ansible-ui-framework 0.0.298 → 0.0.300
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/BulkActionDialog.d.ts +3 -0
- package/cjs/BulkActionDialog.js +9 -2
- package/docs/BulkActionDialog.md +19 -13
- package/docs/PageHeader.md +9 -9
- package/package.json +1 -1
@@ -24,4 +24,7 @@ export interface BulkActionDialogProps<T extends object> {
|
|
24
24
|
/** Indicates if this is a destructive operation */
|
25
25
|
isDanger?: boolean;
|
26
26
|
}
|
27
|
+
/**
|
28
|
+
* useBulkActionDialog - react hook to open a BulkActionDialog by calling the hook with BulkActionDialogProps
|
29
|
+
*/
|
27
30
|
export declare function useBulkActionDialog<T extends object>(): import("react").Dispatch<import("react").SetStateAction<BulkActionDialogProps<T> | undefined>>;
|
package/cjs/BulkActionDialog.js
CHANGED
@@ -98,9 +98,13 @@ var PageTable_1 = require("./PageTable");
|
|
98
98
|
var useFrameworkTranslations_1 = require("./useFrameworkTranslations");
|
99
99
|
var useTableItems_1 = require("./useTableItems");
|
100
100
|
/**
|
101
|
-
* BulkActionDialog
|
101
|
+
* BulkActionDialog is a generic dialog for process bulk actions.
|
102
|
+
*
|
103
|
+
* It processes the actions in parallel up to 5 concurrently.
|
104
|
+
* The easiest way to use the BulkActionDialog is then useBulkActionDialog hook.
|
105
|
+
*
|
102
106
|
* @param {string} title - The title of the model.
|
103
|
-
* @param {
|
107
|
+
* @param {T[]} items - The items to confirm for the bulk action.
|
104
108
|
* @param {function} keyFn - A function that gets a unique key for each item.
|
105
109
|
* @param {Array(ITableColumn<T>)} actionColumns - The columns to display when processing the actions.
|
106
110
|
* @param {function} actionFn - The action function to perform on each item
|
@@ -268,6 +272,9 @@ function BulkActionDialog(props) {
|
|
268
272
|
? react_core_1.ProgressVariant.success
|
269
273
|
: undefined }) }))] })));
|
270
274
|
}
|
275
|
+
/**
|
276
|
+
* useBulkActionDialog - react hook to open a BulkActionDialog by calling the hook with BulkActionDialogProps
|
277
|
+
*/
|
271
278
|
function useBulkActionDialog() {
|
272
279
|
var _a = __read((0, PageDialog_1.usePageDialog)(), 2), _ = _a[0], setDialog = _a[1];
|
273
280
|
var _b = __read((0, react_1.useState)(), 2), props = _b[0], setProps = _b[1];
|
package/docs/BulkActionDialog.md
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
# BulkActionDialog
|
2
2
|
|
3
|
-
BulkActionDialog
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
| [
|
15
|
-
| [
|
3
|
+
BulkActionDialog is a generic dialog for process bulk actions.
|
4
|
+
It processes the actions in parallel up to 5 concurrently.
|
5
|
+
The easiest way to use the BulkActionDialog is then useBulkActionDialog hook.
|
6
|
+
|
7
|
+
| Param | Type | Description |
|
8
|
+
| ---------------- | ------------------- | ------------------------------------------------------------------------- |
|
9
|
+
| title | `string` | The title of the model. |
|
10
|
+
| items | `T[]` | The items to confirm for the bulk action. |
|
11
|
+
| keyFn | `function` | A function that gets a unique key for each item. |
|
12
|
+
| actionColumns | `ITableColumn<T>[]` | The columns to display when processing the actions. |
|
13
|
+
| actionFn | `function` | The action function to perform on each item |
|
14
|
+
| [onComplete] | `function` | Callback when all the actions are complete. Returns the successful items. |
|
15
|
+
| [onClose] | `function` | Callback called when the dialog closes. |
|
16
|
+
| [processingText] | `string` | The text to show for each item when the action is happening. |
|
17
|
+
| [isDanger] | `boolean` | Indicates if this is a destructive operation. |
|
18
|
+
|
19
|
+
## useBulkActionDialog()
|
20
|
+
|
21
|
+
useBulkActionDialog - react hook to open a BulkActionDialog by calling the hook with BulkActionDialogProps
|
package/docs/PageHeader.md
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
PageHeader enables the responsive layout of the header.
|
4
4
|
|
5
|
-
| Param | Type
|
6
|
-
| -------------- |
|
7
|
-
| breadcrumbs | `
|
8
|
-
| title | `string`
|
9
|
-
| titleHelpTitle | `string`
|
10
|
-
| titleHelp | `ReactNode`
|
11
|
-
| description | `string`
|
12
|
-
| controls | `ReactNode`
|
13
|
-
| headerActions | `ReactNode`
|
5
|
+
| Param | Type | Description |
|
6
|
+
| -------------- | -------------- | --------------------------------- |
|
7
|
+
| breadcrumbs | `Breadcrumb[]` | The breadcrumbs for the page. |
|
8
|
+
| title | `string` | The title of the page. |
|
9
|
+
| titleHelpTitle | `string` | The title of help popover. |
|
10
|
+
| titleHelp | `ReactNode` | The content for the help popover. |
|
11
|
+
| description | `string` | The description of the page. |
|
12
|
+
| controls | `ReactNode` | Support for extra page controls. |
|
13
|
+
| headerActions | `ReactNode` | The actions for the page. |
|
14
14
|
|
15
15
|
## Example
|
16
16
|
|
package/package.json
CHANGED