@topconsultnpm/sdkui-react-beta 6.11.110 → 6.11.111

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.
@@ -4,12 +4,10 @@ import { ITMChooserFormProps, ITMChooserProps } from '../../ts';
4
4
  interface ITMUserChooserProps extends ITMChooserProps {
5
5
  /** Contiene i values selezionati */
6
6
  values?: number[];
7
- /** predicate function per filtrare i metadati. Significativo per un solo tid (tids) */
7
+ /** predicate function per filtrare gli utenti */
8
8
  filter?: (value: UserDescriptor, index: number, array: UserDescriptor[]) => unknown;
9
9
  /** Visualizza il bordo */
10
10
  showBorder?: boolean;
11
- /** Visualizza colonne con informazioni utente */
12
- showColumnsUserInfo?: boolean;
13
11
  /** Nascondi pulsante aggiorna dati */
14
12
  hideRefresh?: boolean;
15
13
  /** Nascondi pulsante mostra ID */
@@ -20,8 +18,6 @@ export default TMUserChooser;
20
18
  interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
21
19
  /** predicate function per filtrare i metadati. Significativo per un solo tid (tids) */
22
20
  filter?: (value: UserDescriptor, index: number, array: UserDescriptor[]) => unknown;
23
- /** Visualizza colonne con informazioni utente */
24
- showColumnsUserInfo?: boolean;
25
21
  /** Nascondi pulsante aggiorna dati */
26
22
  hideRefresh?: boolean;
27
23
  /** Nascondi pulsante mostra ID */
@@ -10,30 +10,20 @@ import TMSummary from '../editors/TMSummary';
10
10
  import TMChooserForm from '../forms/TMChooserForm';
11
11
  import { TMColors } from '../../utils/theme';
12
12
  import { TMExceptionBoxManager } from '../base/TMPopUp';
13
- const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, showColumnsUserInfo = false, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton }) => {
13
+ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton }) => {
14
14
  const [showChooser, setShowChooser] = useState(false);
15
- useEffect(() => {
16
- if (!values || values.length <= 0)
17
- return;
18
- TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
19
- UserListCacheService.GetAsync(values[0]).then(() => { TMSpinner.hide(); });
20
- }, [values]);
21
15
  const renderTemplate = () => {
22
16
  return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px' }, children: [values && values.length > 0 && _jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true, noneSelectionText: '' }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
23
17
  };
24
18
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, 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, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
25
- _jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, title: titleForm, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, showColumnsUserInfo: showColumnsUserInfo, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
19
+ _jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, title: titleForm, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
26
20
  };
27
21
  export default TMUserChooser;
28
- export const TMUserChooserForm = ({ allowMultipleSelection, showColumnsUserInfo = false, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
29
- const renderDataGridColumns = showColumnsUserInfo ? [
22
+ export const TMUserChooserForm = ({ allowMultipleSelection, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
23
+ const renderDataGridColumns = [
30
24
  _jsx(Column, { dataField: "domain", caption: SDKUI_Localizator.Domain, dataType: 'string' }, 2),
31
- _jsx(Column, { dataField: "name", caption: SDKUI_Localizator.UserName, dataType: 'string' }, 3),
32
- _jsx(Column, { dataField: "fn", caption: SDKUI_Localizator.User_FirstName, dataType: 'string' }, 4),
33
- _jsx(Column, { dataField: "ln", caption: SDKUI_Localizator.User_LastName, dataType: 'string' }, 5),
34
- _jsx(Column, { dataField: "description", caption: SDKUI_Localizator.Domain, dataType: 'string' }, 6),
35
- _jsx(Column, { dataField: "mailAddress", caption: SDKUI_Localizator.MetadataFormats_EMail, dataType: 'string' }, 7)
36
- ] : [];
25
+ _jsx(Column, { dataField: "name", caption: SDKUI_Localizator.UserName, dataType: 'string' }, 3)
26
+ ];
37
27
  const getItems = async (refreshCache) => {
38
28
  TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
39
29
  if (refreshCache)
@@ -50,7 +40,7 @@ export const TMUserChooserForm = ({ allowMultipleSelection, showColumnsUserInfo
50
40
  return title;
51
41
  };
52
42
  const cellRenderIcon = (data) => _jsx(TMUserIcon, { ud: data.data });
53
- return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, showDefaultColumns: showColumnsUserInfo == undefined ? true : !showColumnsUserInfo, columns: renderDataGridColumns, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: dataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
43
+ return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, showDefaultColumns: false, columns: renderDataGridColumns, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: dataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
54
44
  };
55
45
  export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
56
46
  const [ud, setUd] = useState();
@@ -53,7 +53,7 @@ const TMChooserForm = ({ children, title, allowMultipleSelection, startWithShowO
53
53
  onChoose?.(getSelectedIDs());
54
54
  onClose?.();
55
55
  }, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); }, onToolbarPreparing: (e) => { e.toolbarOptions.items.forEach((item) => { if (item.name === "searchPanel")
56
- item.location = "before"; }); }, children: [cellRenderIcon && _jsx(Column, { width: 30, allowResizing: false, allowFiltering: false, allowSorting: false, cellRender: cellRenderIcon }, 0), showDefaultColumns && _jsx(Column, { dataField: "id", visible: showId, dataType: 'number' }, 1), showDefaultColumns && _jsx(Column, { dataField: SDK_Globals.useLocalizedName && manageUseLocalizedName ? "nameLoc" : "name", caption: SDKUI_Localizator.Name, dataType: 'string', defaultSortOrder: allowSorting ? "asc" : undefined, cellRender: cellRenderNameAndDesc }, 2), showDefaultColumns && _jsx(Column, { dataField: "description", dataType: 'string', caption: SDKUI_Localizator.Description, cellRender: cellRenderNameAndDesc }, 3), columns, allowGrouping && _jsx(Grouping, { autoExpandAll: false, expandMode: 'rowClick' }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: allowMultipleSelection ? "multiple" : "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: SDKUI_Globals.dataGridUseNativeScrollbar }), _jsx(LoadPanel, { enabled: true }), _jsx(SearchPanel, { visible: true }), _jsx(Paging, { pageSize: 100 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsxs(Summary, { children: [_jsx(TotalItem, { column: SDK_Globals.useLocalizedName && manageUseLocalizedName ? "nameLoc" : "name", summaryType: "count" }), summaryItems] })] })
56
+ item.location = "before"; }); }, children: [cellRenderIcon && _jsx(Column, { width: 30, allowResizing: false, allowFiltering: false, allowSorting: false, cellRender: cellRenderIcon }, 0), hasShowId && _jsx(Column, { dataField: "id", visible: showId, dataType: 'number' }, 1), showDefaultColumns && _jsx(Column, { dataField: SDK_Globals.useLocalizedName && manageUseLocalizedName ? "nameLoc" : "name", caption: SDKUI_Localizator.Name, dataType: 'string', defaultSortOrder: allowSorting ? "asc" : undefined, cellRender: cellRenderNameAndDesc }, 2), showDefaultColumns && _jsx(Column, { dataField: "description", dataType: 'string', caption: SDKUI_Localizator.Description, cellRender: cellRenderNameAndDesc }, 3), columns, allowGrouping && _jsx(Grouping, { autoExpandAll: false, expandMode: 'rowClick' }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: allowMultipleSelection ? "multiple" : "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: SDKUI_Globals.dataGridUseNativeScrollbar }), _jsx(LoadPanel, { enabled: true }), _jsx(SearchPanel, { visible: true }), _jsx(Paging, { pageSize: 100 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsxs(Summary, { children: [_jsx(TotalItem, { column: SDK_Globals.useLocalizedName && manageUseLocalizedName ? "nameLoc" : "name", summaryType: "count" }), summaryItems] })] })
57
57
  :
58
58
  _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
59
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.11.110",
3
+ "version": "6.11.111",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",