@aws/mynah-ui 4.37.1 → 4.38.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/components/icon.d.ts +3 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +3 -0
- package/docs/DATAMODEL.md +12 -2
- package/package.json +1 -1
package/dist/static.d.ts
CHANGED
|
@@ -501,6 +501,7 @@ export type TextBasedFormItem = BaseFormItem & {
|
|
|
501
501
|
patterns: ValidationPattern[];
|
|
502
502
|
};
|
|
503
503
|
validateOnChange?: boolean;
|
|
504
|
+
disabled?: boolean;
|
|
504
505
|
};
|
|
505
506
|
type DropdownFormItem = BaseFormItem & {
|
|
506
507
|
type: 'select';
|
|
@@ -528,6 +529,7 @@ type RadioGroupFormItem = BaseFormItem & {
|
|
|
528
529
|
label?: string;
|
|
529
530
|
icon?: MynahIcons | MynahIconsType;
|
|
530
531
|
}>;
|
|
532
|
+
disabled?: boolean;
|
|
531
533
|
};
|
|
532
534
|
type CheckboxFormItem = BaseFormItem & {
|
|
533
535
|
type: 'switch' | 'checkbox';
|
|
@@ -550,6 +552,7 @@ export interface ListFormItem {
|
|
|
550
552
|
boldTitle?: boolean;
|
|
551
553
|
items: SingularFormItem[];
|
|
552
554
|
value: ListItemEntry[];
|
|
555
|
+
disabled?: boolean;
|
|
553
556
|
}
|
|
554
557
|
export interface ListItemEntry {
|
|
555
558
|
persistent?: boolean;
|
package/docs/DATAMODEL.md
CHANGED
|
@@ -1188,6 +1188,7 @@ export type TextBasedFormItem = BaseFormItem & {
|
|
|
1188
1188
|
genericValidationErrorMessage?: string;
|
|
1189
1189
|
patterns: ValidationPattern[];
|
|
1190
1190
|
};
|
|
1191
|
+
disabled?: boolean;
|
|
1191
1192
|
};
|
|
1192
1193
|
|
|
1193
1194
|
type DropdownFormItem = BaseFormItem & {
|
|
@@ -1218,6 +1219,7 @@ type RadioGroupFormItem = BaseFormItem & {
|
|
|
1218
1219
|
label?: string;
|
|
1219
1220
|
icon?: MynahIcons | MynahIconsType;
|
|
1220
1221
|
}>;
|
|
1222
|
+
disabled?: boolean;
|
|
1221
1223
|
};
|
|
1222
1224
|
|
|
1223
1225
|
type CheckboxFormItem = BaseFormItem & {
|
|
@@ -1238,6 +1240,7 @@ export interface ListFormItem {
|
|
|
1238
1240
|
icon?: MynahIcons | MynahIconsType;
|
|
1239
1241
|
items: SingularFormItem[];
|
|
1240
1242
|
value: ListItemEntry[];
|
|
1243
|
+
disabled?: boolean;
|
|
1241
1244
|
};
|
|
1242
1245
|
|
|
1243
1246
|
export interface ListItemEntry {
|
|
@@ -2994,7 +2997,7 @@ interface ChatItemFormItem {
|
|
|
2994
2997
|
label: string;
|
|
2995
2998
|
description?: string; // Only applicable to select types. This will add a description below the label to add more context for the option
|
|
2996
2999
|
}>;
|
|
2997
|
-
disabled?: boolean; //
|
|
3000
|
+
disabled?: boolean; // If set to true, the form item will be disabled and user cannot interact with it. Applicable to textinput, numericinput, email, radiogroup, and select types.
|
|
2998
3001
|
boldTitle?: boolean; // this will make the title of the input bold
|
|
2999
3002
|
selectTooltip?: string; // this is only applicable to DropDownFormItem. This will make the tooltip float right above the dropdown, not the wrapper object (or the title to be specific)
|
|
3000
3003
|
}
|
|
@@ -3006,7 +3009,14 @@ Since you can give unlimited form items with several different types, it might b
|
|
|
3006
3009
|
|
|
3007
3010
|
**Another thing which might be interesting** is to know that if you set the `select` or the `radiogroup` mandatory, they'll be rendered as the first item's of them selected if you don't provide an initial value. And you cannot deselet a radio item in any case. For select, if it is mandatory there won't be the option `Please select...`.
|
|
3008
3011
|
|
|
3009
|
-
**Important note
|
|
3012
|
+
**Important note about the `disabled` property:** The `disabled` property can be set to `true` to disable form items and prevent user interaction. This is supported for the following form item types:
|
|
3013
|
+
- `textinput` - Text input fields will be disabled
|
|
3014
|
+
- `numericinput` - Numeric input fields will be disabled
|
|
3015
|
+
- `email` - Email input fields will be disabled
|
|
3016
|
+
- `radiogroup` - Radio button groups will be disabled
|
|
3017
|
+
- `select` - Dropdown selectors will be disabled
|
|
3018
|
+
|
|
3019
|
+
When you have a default value and want to ensure it's always displayed, you can combine `mandatory: true` with `disabled: true` - this will automatically select and display the first value in `options` (for select/radiogroup types) while preventing user interaction.
|
|
3010
3020
|
|
|
3011
3021
|
_**NOTE**: If you set `options` for `textinput` for example, it won't affect the textinput to be rendered and work properly._
|
|
3012
3022
|
|
package/package.json
CHANGED