@evoke-platform/ui-components 1.5.0-testing.15 → 1.5.0-testing.16
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.
@@ -189,9 +189,11 @@ export function convertFormToComponents(entries, parameters, object) {
|
|
189
189
|
tableView: false,
|
190
190
|
displayOption: parameter.type === 'object'
|
191
191
|
? displayOptions?.relatedObjectDisplay
|
192
|
-
:
|
192
|
+
: parameter.type === 'string' && parameter.enum
|
193
193
|
? displayOptions?.choicesDisplay?.type
|
194
|
-
:
|
194
|
+
: parameter.type === 'boolean'
|
195
|
+
? displayOptions?.booleanDisplay
|
196
|
+
: undefined,
|
195
197
|
labelPosition: 'top',
|
196
198
|
dataSrc: property.enum?.length ? 'values' : undefined,
|
197
199
|
showCharCount: displayOptions?.charCount,
|
@@ -346,6 +348,7 @@ export function convertComponentsToForm(components) {
|
|
346
348
|
...((component.displayOption || component.sortBy) &&
|
347
349
|
component.property?.enum &&
|
348
350
|
component.property?.type !== 'array' &&
|
351
|
+
component?.property?.type !== 'boolean' &&
|
349
352
|
component.property?.type !== 'object'
|
350
353
|
? {
|
351
354
|
choicesDisplay: {
|
@@ -354,12 +357,17 @@ export function convertComponentsToForm(components) {
|
|
354
357
|
},
|
355
358
|
}
|
356
359
|
: {}),
|
360
|
+
...(component.displayOption && component?.property?.type === 'boolean'
|
361
|
+
? { booleanDisplay: component.displayOption }
|
362
|
+
: {}),
|
357
363
|
...(component.displayOption && component?.property?.type === 'object'
|
358
364
|
? { relatedObjectDisplay: component.displayOption }
|
359
365
|
: {}),
|
360
366
|
...(component.defaultToCurrentDate ||
|
361
367
|
component.defaultToCurrentTime ||
|
362
368
|
component.initialValue ||
|
369
|
+
(typeof component.initialValue === 'number' && Number.isFinite(component.initialValue)) ||
|
370
|
+
typeof component.initialValue === 'boolean' ||
|
363
371
|
component.defaultValueCriteria
|
364
372
|
? {
|
365
373
|
defaultValue: component.defaultToCurrentDate
|
@@ -35,7 +35,7 @@ const BooleanSelect = (props) => {
|
|
35
35
|
tooltip && (React.createElement(Tooltip, { placement: "right", title: tooltip },
|
36
36
|
React.createElement(IconButton, null,
|
37
37
|
React.createElement(Help, { sx: { fontSize: '14px' } })))),
|
38
|
-
required && (React.createElement(Typography, { variant: "body2", component: "span", color: "error", sx: { marginLeft: '4px', fontSize: '18px' } }, "*"))), control: displayOption === 'switch' ? (React.createElement(Switch, { id: id, "aria-
|
38
|
+
required && (React.createElement(Typography, { variant: "body2", component: "span", color: "error", sx: { marginLeft: '4px', fontSize: '18px' } }, "*"))), control: displayOption === 'switch' ? (React.createElement(Switch, { id: id, "aria-required": required, "aria-invalid": error, size: size ?? 'medium', name: property.id, checked: value, onChange: (e) => handleChange(e.target.checked), disabled: readOnly, sx: { alignSelf: 'start' } })) : (React.createElement(Checkbox, { id: id, "aria-required": required, "aria-invalid": error, size: size ?? 'medium', checked: value, name: property.id, onChange: (e) => handleChange(e.target.checked), disabled: readOnly, sx: { alignSelf: 'start', padding: '4px 9px 9px 9px' } })) }),
|
39
39
|
error && React.createElement(FormHelperText, { sx: { marginX: 0 } }, errorMessage),
|
40
40
|
description && (React.createElement(FormHelperText, { sx: descriptionStyles, component: Typography }, parse(description)))));
|
41
41
|
};
|