@aws/mynah-ui 4.35.0-beta.7 → 4.35.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/dist/main.d.ts +7 -3
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/docs/PROPERTIES.md +50 -0
- package/docs/USAGE.md +26 -1
- package/docs/img/splashLoaderActions.png +0 -0
- package/package.json +1 -1
package/docs/PROPERTIES.md
CHANGED
|
@@ -6,6 +6,11 @@ export interface MynahUIProps {
|
|
|
6
6
|
defaults?: MynahUITabStoreTab;
|
|
7
7
|
tabs?: MynahUITabStoreModel;
|
|
8
8
|
config?: Partial<ConfigModel>;
|
|
9
|
+
splashScreenInitialStatus?: {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
text?: string;
|
|
12
|
+
actions?: Action[];
|
|
13
|
+
};
|
|
9
14
|
onShowMoreWebResultsClick?: (
|
|
10
15
|
tabId: string,
|
|
11
16
|
messageId: string,
|
|
@@ -169,6 +174,9 @@ export interface MynahUIProps {
|
|
|
169
174
|
tabId: string,
|
|
170
175
|
buttonId: string,
|
|
171
176
|
eventId?: string) => void;
|
|
177
|
+
onSplashLoaderActionClick?: (
|
|
178
|
+
action: Action,
|
|
179
|
+
eventId?: string) => void;
|
|
172
180
|
}
|
|
173
181
|
```
|
|
174
182
|
_Let's deep dive into each property you can set._
|
|
@@ -210,6 +218,23 @@ defaults: {
|
|
|
210
218
|
|
|
211
219
|
---
|
|
212
220
|
|
|
221
|
+
### splashScreenInitialStatus
|
|
222
|
+
_(default: `undefined`)_
|
|
223
|
+
|
|
224
|
+
To initially show the splash loader with some text and actions, you can use this property. Even before the rest of the data is initialized, it will show you the splash loader.
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
...
|
|
228
|
+
splashScreenInitialStatus?: {
|
|
229
|
+
visible: boolean;
|
|
230
|
+
text?: string;
|
|
231
|
+
actions?: Action[];
|
|
232
|
+
}, // default: undefined
|
|
233
|
+
...
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
213
238
|
### `tabs`
|
|
214
239
|
_(default: `undefined`)_
|
|
215
240
|
|
|
@@ -1118,3 +1143,28 @@ onTabBarButtonClick?: (
|
|
|
1118
1143
|
};
|
|
1119
1144
|
...
|
|
1120
1145
|
```
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
---
|
|
1149
|
+
|
|
1150
|
+
### onSplashLoaderActionClick
|
|
1151
|
+
|
|
1152
|
+
This event will be fired when user clicks to an action inside the splash loader.
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
<p align="center">
|
|
1156
|
+
<img src="./img/splashLoaderActions.png" alt="splashLoaderActions" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
1157
|
+
</p>
|
|
1158
|
+
|
|
1159
|
+
```typescript
|
|
1160
|
+
...
|
|
1161
|
+
onSplashLoaderActionClick?: (
|
|
1162
|
+
action: Action,
|
|
1163
|
+
eventId?: string) => void;
|
|
1164
|
+
onSplashLoaderActionClick?: (
|
|
1165
|
+
action: Action,
|
|
1166
|
+
eventId?: string)):void => {
|
|
1167
|
+
console.log(`Splash loader action click ${action.id}`);
|
|
1168
|
+
};
|
|
1169
|
+
...
|
|
1170
|
+
```
|
package/docs/USAGE.md
CHANGED
|
@@ -587,9 +587,34 @@ You can enable or disable window wide splash overlay with or without text.
|
|
|
587
587
|
mynahUI.toggleSplashLoader(true, 'Showing splash loader...');
|
|
588
588
|
```
|
|
589
589
|
<p align="center">
|
|
590
|
-
<img src="./img/splashLoader.png" alt="
|
|
590
|
+
<img src="./img/splashLoader.png" alt="splashLoader" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
591
591
|
</p>
|
|
592
592
|
|
|
593
|
+
In case, if you want to add actions, you can use the actions field.
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
mynahUI.toggleSplashLoader(
|
|
597
|
+
true,
|
|
598
|
+
'Saving **the MCP**',
|
|
599
|
+
[
|
|
600
|
+
{
|
|
601
|
+
id: 'hide-mcp-save',
|
|
602
|
+
status: 'clear',
|
|
603
|
+
text: 'Hide',
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
id: 'cancel-mcp-save',
|
|
607
|
+
status: 'primary',
|
|
608
|
+
text: 'Cancel',
|
|
609
|
+
},
|
|
610
|
+
]);
|
|
611
|
+
```
|
|
612
|
+
<p align="center">
|
|
613
|
+
<img src="./img/splashLoaderActions.png" alt="splashLoaderActions" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
614
|
+
</p>
|
|
615
|
+
|
|
616
|
+
For the initial setup, please see [PROPERTIES / splashScreenInitialStatus](./PROPERTIES.md#splashScreenInitialStatus) and for the event handling see [PROPERTIES / onSplashLoaderActionClick](./PROPERTIES.md#onSplashLoaderActionClick)
|
|
617
|
+
|
|
593
618
|
# Destroy Mynah UI State (`destroy`)
|
|
594
619
|
|
|
595
620
|
You can use this method to tear down the existing Mynah UI state. This is useful if you want to run several tests on fresh instances of Mynah UI.
|
|
Binary file
|
package/package.json
CHANGED