@topconsultnpm/sdkui-react-beta 6.6.56 → 6.6.58

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.
@@ -21,7 +21,7 @@ const TMUserChooser = ({ readOnly = false, dataSource, backgroundColor, buttons
21
21
  ? _jsx("p", { children: placeHolder })
22
22
  : _jsxs(_Fragment, { children: [_jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }) }));
23
23
  };
24
- return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled, readOnly: readOnly, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
24
+ return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
25
25
  _jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, dataSource: dataSource, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
26
26
  };
27
27
  export default TMUserChooser;
@@ -20,34 +20,34 @@ const TMMetadataEditor = ({ tid, mid, value, queryParamsDynDataList, containerEl
20
20
  if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}")
21
21
  return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', maxLength: md?.length, autoFocus: autoFocus, value: value || '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
22
22
  if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
23
- return _jsx(TMDynDataListItemChooser, { readOnly: readOnly, md: md, tid: tid, buttons: [btnDistincValues], queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton: true, onValueChanged: (IDs) => {
23
+ return _jsx(TMDynDataListItemChooser, { readOnly: readOnly, md: md, tid: tid, buttons: !readOnly ? [btnDistincValues] : [], queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton: !readOnly, onValueChanged: (IDs) => {
24
24
  if (!IDs || IDs.length <= 0)
25
25
  onValueChanged?.(undefined);
26
26
  else
27
27
  onValueChanged?.(IDs[0]);
28
28
  } });
29
29
  if (md?.dataDomain == MetadataDataDomains.DataList)
30
- return _jsx(TMDataListItemChooser, { readOnly: readOnly, 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: true, buttons: [btnDistincValues], onValueChanged: (IDs) => {
30
+ return _jsx(TMDataListItemChooser, { readOnly: readOnly, 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] : [], onValueChanged: (IDs) => {
31
31
  if (!IDs || IDs.length <= 0)
32
32
  onValueChanged?.(undefined);
33
33
  else
34
34
  onValueChanged?.(IDs.join(","));
35
35
  } });
36
36
  if (md?.dataDomain == MetadataDataDomains.UserID)
37
- return _jsx(TMUserChooser, { readOnly: readOnly, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: true, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: [btnDistincValues], onValueChanged: (IDs) => {
37
+ return _jsx(TMUserChooser, { disabled: readOnly, readOnly: readOnly, 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] : [], onValueChanged: (IDs) => {
38
38
  if (!IDs || IDs.length <= 0)
39
39
  onValueChanged?.(undefined);
40
40
  else
41
41
  onValueChanged?.(IDs.join(","));
42
42
  } });
43
43
  if (showAsText)
44
- return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', buttons: [btnDistincValues], showClearButton: true, maxLength: md?.length, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
44
+ return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, maxLength: md?.length, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
45
45
  if (showAsNumber)
46
- return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', showClearButton: true, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
46
+ return _jsx(TMTextBox, { readOnly: readOnly, 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) });
47
47
  switch (md?.dataType) {
48
- case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly: readOnly, width: '100%', value: value, buttons: [btnDistincValues], showClearButton: true, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
49
- case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', buttons: [btnDistincValues], showClearButton: true, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
50
- default: return _jsx(TMTextBox, { readOnly: readOnly, type: 'text', elementStyle: { width: '100%' }, showClearButton: true, buttons: [btnDistincValues], autoFocus: autoFocus, maxLength: md?.length, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
48
+ case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly: readOnly, width: '100%', value: value, buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
49
+ case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
50
+ default: return _jsx(TMTextBox, { readOnly: readOnly, type: 'text', elementStyle: { width: '100%' }, showClearButton: !readOnly, buttons: !readOnly ? [btnDistincValues] : [], autoFocus: autoFocus, maxLength: md?.length, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
51
51
  }
52
52
  };
53
53
  export default TMMetadataEditor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.6.56",
3
+ "version": "6.6.58",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",