@axinom/mosaic-ui 0.32.0-rc.3 → 0.32.0-rc.4
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/components/Actions/Actions.models.d.ts +4 -16
- package/dist/components/Actions/Actions.models.d.ts.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts.map +1 -1
- package/dist/components/Explorer/Explorer.model.d.ts +2 -2
- package/dist/components/Explorer/Explorer.model.d.ts.map +1 -1
- package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts +12 -3
- package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +1 -22
- package/dist/components/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeader.model.d.ts +23 -0
- package/dist/components/PageHeader/PageHeader.model.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.d.ts +20 -33
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts +47 -0
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeaderAction/index.d.ts +3 -0
- package/dist/components/PageHeader/PageHeaderAction/index.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeaderBulkActions/PageHeaderBulkActions.d.ts +2 -2
- package/dist/components/PageHeader/PageHeaderBulkActions/PageHeaderBulkActions.d.ts.map +1 -1
- package/dist/components/PageHeader/index.d.ts +3 -2
- package/dist/components/PageHeader/index.d.ts.map +1 -1
- package/dist/components/models.d.ts +19 -0
- package/dist/components/models.d.ts.map +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Actions/Actions.models.ts +4 -23
- package/src/components/Explorer/Explorer.model.ts +2 -2
- package/src/components/Explorer/Explorer.tsx +19 -14
- package/src/components/Explorer/NavigationExplorer/NavigationExplorer.tsx +31 -11
- package/src/components/PageHeader/PageHeader.model.ts +23 -0
- package/src/components/PageHeader/PageHeader.stories.tsx +2 -1
- package/src/components/PageHeader/PageHeader.tsx +2 -26
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.model.ts +60 -0
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.spec.tsx +46 -4
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.stories.tsx +12 -1
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.tsx +91 -45
- package/src/components/PageHeader/PageHeaderAction/index.ts +2 -0
- package/src/components/PageHeader/PageHeaderBulkActions/PageHeaderBulkActions.spec.tsx +2 -2
- package/src/components/PageHeader/PageHeaderBulkActions/PageHeaderBulkActions.tsx +56 -43
- package/src/components/PageHeader/index.ts +3 -2
- package/src/components/models.ts +27 -0
|
@@ -4,12 +4,15 @@ import { noop } from '../../../helpers/utils';
|
|
|
4
4
|
import { useExpand } from '../../../hooks/useExpand/useExpand';
|
|
5
5
|
import { ConfirmationMode } from '../../ConfirmDialog';
|
|
6
6
|
import { IconName } from '../../Icons';
|
|
7
|
-
import { PageHeaderProps } from '../PageHeader';
|
|
7
|
+
import { PageHeaderProps } from '../PageHeader.model';
|
|
8
8
|
import {
|
|
9
|
+
isPageHeaderJsAction,
|
|
9
10
|
PageHeaderAction,
|
|
11
|
+
} from '../PageHeaderAction/PageHeaderAction';
|
|
12
|
+
import {
|
|
10
13
|
PageHeaderActionProps,
|
|
11
14
|
PageHeaderActionType,
|
|
12
|
-
} from '../PageHeaderAction/PageHeaderAction';
|
|
15
|
+
} from '../PageHeaderAction/PageHeaderAction.model';
|
|
13
16
|
import classes from './PageHeaderBulkActions.scss';
|
|
14
17
|
|
|
15
18
|
export interface PageHeaderBulkActionsProps
|
|
@@ -107,23 +110,27 @@ export const PageHeaderBulkActions: React.FC<PageHeaderBulkActionsProps> = ({
|
|
|
107
110
|
}}
|
|
108
111
|
/>
|
|
109
112
|
{isExpanded &&
|
|
110
|
-
actions.slice(0, availableActionSpace).map((action, idx) =>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
actions.slice(0, availableActionSpace).map((action, idx) =>
|
|
114
|
+
isPageHeaderJsAction(action) ? (
|
|
115
|
+
<PageHeaderAction
|
|
116
|
+
key={idx}
|
|
117
|
+
{...action}
|
|
118
|
+
disabled={bulkActionsDisabled}
|
|
119
|
+
confirmationConfig={{
|
|
120
|
+
...action.confirmationConfig,
|
|
121
|
+
onConfirmOpen: (isOpen, args) => {
|
|
122
|
+
onConfirmToggled(
|
|
123
|
+
isOpen,
|
|
124
|
+
args as { id: string; mode: ConfirmationMode },
|
|
125
|
+
);
|
|
126
|
+
action.confirmationConfig?.onConfirmOpen?.(isOpen, args);
|
|
127
|
+
},
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
) : (
|
|
131
|
+
<PageHeaderAction key={idx} {...action} />
|
|
132
|
+
),
|
|
133
|
+
)}
|
|
127
134
|
{isExpanded && actions.length > availableActionSpace && (
|
|
128
135
|
<div
|
|
129
136
|
className={clsx(classes.hasMore)}
|
|
@@ -142,30 +149,36 @@ export const PageHeaderBulkActions: React.FC<PageHeaderBulkActionsProps> = ({
|
|
|
142
149
|
/>
|
|
143
150
|
{isMoreExpanded && (
|
|
144
151
|
<div className={clsx(classes.dropDownList)}>
|
|
145
|
-
{actions.slice(availableActionSpace).map((action, idx) =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
{actions.slice(availableActionSpace).map((action, idx) =>
|
|
153
|
+
isPageHeaderJsAction(action) ? (
|
|
154
|
+
<PageHeaderAction
|
|
155
|
+
key={idx}
|
|
156
|
+
{...action}
|
|
157
|
+
disabled={bulkActionsDisabled}
|
|
158
|
+
onClick={() => {
|
|
159
|
+
action.onClick();
|
|
160
|
+
moreCollapse();
|
|
161
|
+
setIsMouseOverMore(false);
|
|
162
|
+
}}
|
|
163
|
+
className={clsx(classes.dropDown)}
|
|
164
|
+
confirmationConfig={{
|
|
165
|
+
...action.confirmationConfig,
|
|
166
|
+
onConfirmOpen: (isOpen, args) => {
|
|
167
|
+
onConfirmToggled(
|
|
168
|
+
isOpen,
|
|
169
|
+
args as { id: string; mode: ConfirmationMode },
|
|
170
|
+
);
|
|
171
|
+
action.confirmationConfig?.onConfirmOpen?.(
|
|
172
|
+
isOpen,
|
|
173
|
+
args,
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
) : (
|
|
179
|
+
<PageHeaderAction key={idx} {...action} />
|
|
180
|
+
),
|
|
181
|
+
)}
|
|
169
182
|
</div>
|
|
170
183
|
)}
|
|
171
184
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { PageHeader
|
|
1
|
+
export { PageHeader } from './PageHeader';
|
|
2
|
+
export { PageHeaderProps } from './PageHeader.model';
|
|
2
3
|
export {
|
|
3
4
|
PageHeaderAction,
|
|
4
5
|
PageHeaderActionProps,
|
|
5
6
|
PageHeaderActionType,
|
|
6
|
-
} from './PageHeaderAction
|
|
7
|
+
} from './PageHeaderAction';
|
package/src/components/models.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ConfirmationConfig, ConfirmationMode } from './ConfirmDialog';
|
|
2
3
|
import { MessageBarProps } from './MessageBar';
|
|
3
4
|
|
|
4
5
|
export type StationError = Pick<MessageBarProps, 'title'> & {
|
|
@@ -16,8 +17,34 @@ export type StationMessage = MessageBarProps & {
|
|
|
16
17
|
*/
|
|
17
18
|
body?: string | React.ReactNode;
|
|
18
19
|
};
|
|
20
|
+
|
|
19
21
|
/**
|
|
20
22
|
* Possible error options the engine will handle
|
|
21
23
|
*/
|
|
22
24
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
23
25
|
export type ErrorType = StationError | string | Object | Error;
|
|
26
|
+
|
|
27
|
+
/** Properties to generate a link */
|
|
28
|
+
export interface LinkAction {
|
|
29
|
+
/** Path to navigate to when the action is clicked. */
|
|
30
|
+
path: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Properties for Action click confirmation
|
|
35
|
+
*/
|
|
36
|
+
export interface ConfirmAction {
|
|
37
|
+
/** If set to 'Simple', the action will require confirmation. If set to 'Advanced', action will require confirmation via a confirmation pop up. (default: 'None') */
|
|
38
|
+
confirmationMode?: ConfirmationMode;
|
|
39
|
+
/** Optional text overrides for the confirmation pop up. */
|
|
40
|
+
confirmationConfig?: ConfirmationConfig;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Default Action click event handler
|
|
45
|
+
*/
|
|
46
|
+
export type DefaultHandler = () =>
|
|
47
|
+
| Promise<ErrorType | undefined | void>
|
|
48
|
+
| ErrorType
|
|
49
|
+
| undefined
|
|
50
|
+
| void;
|