@topconsultnpm/sdkui-react-beta 6.10.74 → 6.10.76
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,10 @@ interface ITMUserChooserProps extends ITMChooserProps {
|
|
|
10
10
|
showBorder?: boolean;
|
|
11
11
|
/** Visualizza colonne con informazioni utente */
|
|
12
12
|
showColumnsUserInfo?: boolean;
|
|
13
|
+
/** Nascondi pulsante aggiorna dati */
|
|
14
|
+
hideRefresh?: boolean;
|
|
15
|
+
/** Nascondi pulsante mostra ID */
|
|
16
|
+
hideShowId?: boolean;
|
|
13
17
|
}
|
|
14
18
|
declare const TMUserChooser: React.FunctionComponent<ITMUserChooserProps>;
|
|
15
19
|
export default TMUserChooser;
|
|
@@ -18,6 +22,10 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
18
22
|
filter?: (value: UserDescriptor, index: number, array: UserDescriptor[]) => unknown;
|
|
19
23
|
/** Visualizza colonne con informazioni utente */
|
|
20
24
|
showColumnsUserInfo?: boolean;
|
|
25
|
+
/** Nascondi pulsante aggiorna dati */
|
|
26
|
+
hideRefresh?: boolean;
|
|
27
|
+
/** Nascondi pulsante mostra ID */
|
|
28
|
+
hideShowId?: boolean;
|
|
21
29
|
}
|
|
22
30
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
23
31
|
export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
|
|
@@ -10,7 +10,7 @@ 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, 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, showColumnsUserInfo = false, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton }) => {
|
|
14
14
|
const [showChooser, setShowChooser] = useState(false);
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
if (!values || values.length <= 0)
|
|
@@ -22,10 +22,10 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
22
22
|
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
23
|
};
|
|
24
24
|
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, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
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); } })] }));
|
|
26
26
|
};
|
|
27
27
|
export default TMUserChooser;
|
|
28
|
-
export const TMUserChooserForm = ({ allowMultipleSelection, showColumnsUserInfo = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
|
|
28
|
+
export const TMUserChooserForm = ({ allowMultipleSelection, showColumnsUserInfo = false, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
|
|
29
29
|
const renderDataGridColumns = showColumnsUserInfo ? [
|
|
30
30
|
_jsx(Column, { dataField: "domain", caption: SDKUI_Localizator.Domain, dataType: 'string' }, 2),
|
|
31
31
|
_jsx(Column, { dataField: "name", caption: SDKUI_Localizator.UserName, dataType: 'string' }, 3),
|
|
@@ -50,7 +50,7 @@ export const TMUserChooserForm = ({ allowMultipleSelection, showColumnsUserInfo
|
|
|
50
50
|
return title;
|
|
51
51
|
};
|
|
52
52
|
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, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
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, showId: !hideShowId, hideRefresh: hideRefresh, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
54
54
|
};
|
|
55
55
|
export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
56
56
|
const [ud, setUd] = useState();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITMChooserFormProps } from '../../ts';
|
|
2
|
-
declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, keyName, customButtons, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, hideRefresh, keyName, customButtons, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TMChooserForm;
|
|
@@ -8,7 +8,7 @@ import TMToggleButton from '../base/TMToggleButton';
|
|
|
8
8
|
import TMModal from '../base/TMModal';
|
|
9
9
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
10
10
|
import { TMColors } from '../../utils/theme';
|
|
11
|
-
const TMChooserForm = ({ children, title, allowMultipleSelection, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, keyName = "id", customButtons, showDefaultColumns = true, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
|
|
11
|
+
const TMChooserForm = ({ children, title, allowMultipleSelection, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, hideRefresh = false, keyName = "id", customButtons, showDefaultColumns = true, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
|
|
12
12
|
const [showId, setShowId] = useState(false);
|
|
13
13
|
const [showOnlySelectedItems, setShowOnlySelectedItems] = useState(startWithShowOnlySelectedItems && selectedIDs != undefined && selectedIDs.length > 0);
|
|
14
14
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -32,7 +32,7 @@ const TMChooserForm = ({ children, title, allowMultipleSelection, startWithShowO
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const ToolbarButtons = () => {
|
|
35
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: '2px' }, children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Apply, disabled: selectedItems.length <= 0, icon: _jsx(IconApply, {}), color: 'success', fontSize: '1.3rem', onClick: () => { onChoose?.(getSelectedIDs()); onClose?.(); } }), hasShowId ? _jsx(TMButton, { btnStyle: 'toolbar', caption: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show, icon: showId ? _jsx(IconHide, {}) : _jsx(IconShow, {}), fontSize: '1.3rem', onClick: () => { setShowId(!showId); onShowIdChanged?.(); } }) : _jsx(_Fragment, {}), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Refresh, icon: _jsx(IconRefresh, {}), fontSize: '1.3rem', onClick: () => { doGetItems(true); } }), customButtons, hasShowOnlySelectedItems && allowMultipleSelection && _jsx(TMToggleButton, { value: showOnlySelectedItems, elementStyle: { marginLeft: '10px' }, label: 'Mostra solo selezionati', onValueChanged: () => setShowOnlySelectedItems(!showOnlySelectedItems) })] }));
|
|
35
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: '2px' }, children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Apply, disabled: selectedItems.length <= 0, icon: _jsx(IconApply, {}), color: 'success', fontSize: '1.3rem', onClick: () => { onChoose?.(getSelectedIDs()); onClose?.(); } }), hasShowId ? _jsx(TMButton, { btnStyle: 'toolbar', caption: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show, icon: showId ? _jsx(IconHide, {}) : _jsx(IconShow, {}), fontSize: '1.3rem', onClick: () => { setShowId(!showId); onShowIdChanged?.(); } }) : _jsx(_Fragment, {}), !hideRefresh && _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Refresh, icon: _jsx(IconRefresh, {}), fontSize: '1.3rem', onClick: () => { doGetItems(true); } }), customButtons, hasShowOnlySelectedItems && allowMultipleSelection && _jsx(TMToggleButton, { value: showOnlySelectedItems, elementStyle: { marginLeft: '10px' }, label: 'Mostra solo selezionati', onValueChanged: () => setShowOnlySelectedItems(!showOnlySelectedItems) })] }));
|
|
36
36
|
};
|
|
37
37
|
useEffect(() => { doGetItems(false); }, []);
|
|
38
38
|
return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: (children ??
|
package/lib/ts/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.76",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"lib"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@topconsultnpm/sdk-ts-beta": "^6.10.
|
|
44
|
+
"@topconsultnpm/sdk-ts-beta": "^6.10.13",
|
|
45
45
|
"buffer": "^6.0.3",
|
|
46
46
|
"devextreme": "24.2.3",
|
|
47
47
|
"devextreme-react": "24.2.3",
|