@topconsultnpm/sdkui-react-beta 6.7.78 → 6.7.80
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.
|
@@ -23,33 +23,33 @@ const TMMetadataEditor = ({ isModifiedWhen = false, hasLabel = false, readOnly,
|
|
|
23
23
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}")
|
|
24
24
|
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: md?.length, autoFocus: autoFocus, value: value || '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
25
25
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
26
|
-
return _jsx(TMDynDataListItemChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, buttons: !readOnly ? [btnDistincValues] : undefined, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton:
|
|
26
|
+
return _jsx(TMDynDataListItemChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, buttons: !readOnly ? [btnDistincValues] : undefined, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton: !readOnly, onValueChanged: (IDs) => {
|
|
27
27
|
if (!IDs || IDs.length <= 0)
|
|
28
28
|
onValueChanged?.(undefined);
|
|
29
29
|
else
|
|
30
30
|
onValueChanged?.(IDs[0]);
|
|
31
31
|
} });
|
|
32
32
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
33
|
-
return _jsx(TMDataListItemChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton:
|
|
33
|
+
return _jsx(TMDataListItemChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !readOnly, buttons: !readOnly ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
34
34
|
if (!IDs || IDs.length <= 0)
|
|
35
35
|
onValueChanged?.(undefined);
|
|
36
36
|
else
|
|
37
37
|
onValueChanged?.(IDs.join(","));
|
|
38
38
|
} });
|
|
39
39
|
if (md?.dataDomain == MetadataDataDomains.UserID)
|
|
40
|
-
return _jsx(TMUserChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton:
|
|
40
|
+
return _jsx(TMUserChooser, { isModifiedWhen: isModifiedWhen, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: !readOnly, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: !readOnly ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
41
41
|
if (!IDs || IDs.length <= 0)
|
|
42
42
|
onValueChanged?.(undefined);
|
|
43
43
|
else
|
|
44
44
|
onValueChanged?.(IDs.join(","));
|
|
45
45
|
} });
|
|
46
46
|
if (showAsText)
|
|
47
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton:
|
|
47
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton: !readOnly, maxLength: md?.length, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
48
48
|
if (showAsNumber)
|
|
49
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', showClearButton:
|
|
49
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', showClearButton: !readOnly, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
50
50
|
switch (md?.dataType) {
|
|
51
|
-
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, label: hasLabel ? md?.nameLoc : undefined, validationItems: validationItems, disabled: disabled, width: '100%', value: value, buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton:
|
|
52
|
-
case MetadataDataTypes.Number: return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton:
|
|
51
|
+
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, label: hasLabel ? md?.nameLoc : undefined, validationItems: validationItems, disabled: disabled, width: '100%', value: value, buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton: !readOnly, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
|
|
52
|
+
case MetadataDataTypes.Number: return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhen, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', buttons: !readOnly ? [btnDistincValues] : undefined, showClearButton: !readOnly, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
53
53
|
default:
|
|
54
54
|
if (showByTextarea) {
|
|
55
55
|
return _jsx(TMTextArea, { rows: 1, readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, isModifiedWhen: isModifiedWhen, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, showClearButton: true, buttons: !readOnly ? [btnDistincValues] : undefined, autoFocus: autoFocus, maxLength: md?.length, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
|