@topconsultnpm/sdkui-react-beta 6.9.119 → 6.9.121

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.
@@ -10,6 +10,11 @@ interface ITMUserChooserProps extends ITMChooserProps {
10
10
  declare const TMUserChooser: React.FunctionComponent<ITMUserChooserProps>;
11
11
  export default TMUserChooser;
12
12
  export declare const TMUserChooserForm: React.FunctionComponent<ITMChooserFormProps<UserDescriptor>>;
13
+ export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
14
+ userId?: number;
15
+ showIcon?: boolean;
16
+ noneSelectionText?: string;
17
+ }) => import("react/jsx-runtime").JSX.Element;
13
18
  export declare const TMUserIcon: ({ ud }: {
14
19
  ud?: UserDescriptor;
15
20
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -46,7 +46,7 @@ export const TMUserChooserForm = (props) => {
46
46
  const cellRenderIcon = (data) => _jsx(TMUserIcon, { ud: data.data });
47
47
  return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: props.allowMultipleSelection, hasShowOnlySelectedItems: true, width: props.width, height: props.height, manageUseLocalizedName: false, columns: renderDataGridColumns, selectedIDs: props.selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: props.dataSource, getItems: getItems, onClose: props.onClose, onChoose: (IDs) => props.onChoose?.(IDs) }));
48
48
  };
49
- const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
49
+ export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
50
50
  const [ud, setUd] = useState();
51
51
  useEffect(() => {
52
52
  if (!userId || userId <= 0) {
@@ -67,13 +67,11 @@ const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKU
67
67
  _jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
68
68
  };
69
69
  const getDescription = () => {
70
- if (!ud)
71
- return undefined;
72
70
  if (!userId)
73
71
  return undefined;
74
72
  return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? noneSelectionText;
75
73
  };
76
- return (_jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { textAlign: 'left', marginLeft: showIcon ? '5px' : '' }, children: getDescription() })] }));
74
+ return (_jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: ud ? 1 : 0.5 }, children: getDescription() })] }));
77
75
  };
78
76
  export const TMUserIcon = ({ ud }) => {
79
77
  if (!ud)
@@ -27,13 +27,13 @@ const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.
27
27
  _jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
28
28
  };
29
29
  const getDescription = () => {
30
- if (!dataListItem)
31
- return undefined;
32
30
  if (!dataListId)
33
31
  return undefined;
34
- return dataListItem ? dataListItem.name : value;
32
+ if (!value)
33
+ return undefined;
34
+ return dataListItem ? dataListItem.name : value.toString();
35
35
  };
36
- return (_jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { textAlign: 'left', marginLeft: showIcon ? '5px' : '' }, children: getDescription() })] }));
36
+ return (_jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: dataListItem ? 1 : 0.5 }, children: getDescription() })] }));
37
37
  };
38
38
  export default TMDataListItemViewer;
39
39
  export const cellRenderDataListItem = (data, dataListId, viewMode) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.9.119",
3
+ "version": "6.9.121",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",