@topconsultnpm/sdkui-react-beta 6.15.126 → 6.15.128
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.
- package/lib/components/choosers/TMDataListItemChooser.js +3 -3
- package/lib/components/choosers/TMDynDataListItemChooser.js +3 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/editors/TMSummary.js +17 -2
- package/lib/components/viewers/TMDataListItemViewer.js +1 -1
- package/package.json +2 -2
|
@@ -7,14 +7,14 @@ import TMSpinner from '../base/TMSpinner';
|
|
|
7
7
|
import TMSummary from '../editors/TMSummary';
|
|
8
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
9
|
import TMDataListItemViewer from '../viewers/TMDataListItemViewer';
|
|
10
|
-
const TMDataListItemChooser = ({ labelColor, dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged }) => {
|
|
10
|
+
const TMDataListItemChooser = ({ labelColor, width = '100%', dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged }) => {
|
|
11
11
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
12
|
const renderTemplate = () => {
|
|
13
13
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
14
|
-
return (_jsxs(StyledDivHorizontal, { style: {
|
|
14
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataListItemViewer, { dataListId: dataListId, value: values?.[0] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
15
15
|
};
|
|
16
16
|
const summaryInputRef = useRef(null);
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
18
18
|
_jsx(TMDataListItemChooserForm, { allowMultipleSelection: allowMultipleSelection, title: titleForm, dataListId: dataListId, selectedIDs: values, onClose: () => {
|
|
19
19
|
setShowChooser(false);
|
|
20
20
|
summaryInputRef.current?.focus();
|
|
@@ -9,7 +9,7 @@ import TMChooserForm from '../forms/TMChooserForm';
|
|
|
9
9
|
import { TMColors } from '../../utils/theme';
|
|
10
10
|
import TMTooltip from '../base/TMTooltip';
|
|
11
11
|
import { FormulaHelper } from '../editors/TMFormulaEditor';
|
|
12
|
-
const TMDynDataListItemChooser = ({ tid, md, titleForm, openChooserBySingleClick, readOnly, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, showClearButton, onValueChanged, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs }) => {
|
|
12
|
+
const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChooserBySingleClick, readOnly, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, showClearButton, onValueChanged, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs }) => {
|
|
13
13
|
const [showChooser, setShowChooser] = useState(false);
|
|
14
14
|
const [dynDl, setDynDl] = useState();
|
|
15
15
|
const [dataSource, setDataSource] = useState();
|
|
@@ -78,9 +78,9 @@ const TMDynDataListItemChooser = ({ tid, md, titleForm, openChooserBySingleClick
|
|
|
78
78
|
};
|
|
79
79
|
const renderTemplate = () => {
|
|
80
80
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
81
|
-
return (_jsxs(StyledDivHorizontal, { style: {
|
|
81
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [dataSource && _jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { marginLeft: '5px' }, children: getDescription() })] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
82
82
|
};
|
|
83
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, 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 &&
|
|
83
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, width: width, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, 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 &&
|
|
84
84
|
_jsx(TMDynDataListItemChooserForm, { TID: tid, MID: md?.id, dynDL: dynDl, title: titleForm, allowMultipleSelection: allowMultipleSelection, searchResult: dataSource, selectedIDs: values, onClose: () => {
|
|
85
85
|
setShowChooser(false);
|
|
86
86
|
summaryInputRef.current?.focus();
|
|
@@ -20,7 +20,8 @@ const StyledSummaryTemplateInput = styled.div `
|
|
|
20
20
|
border-radius: ${props => !props.$showBorder ? props.$borderRadius : TMEditorsDefaultBorderRadius};
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
|
-
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
|
|
24
25
|
&:focus{
|
|
25
26
|
outline: none;
|
|
26
27
|
background-image: ${props => !props.$showBorder ? '' : 'linear-gradient(white, #E4E9F7)'};
|
|
@@ -62,7 +63,21 @@ const TMSummary = forwardRef(({ placeHolder, readOnly, labelColor, hasValue, bor
|
|
|
62
63
|
const renderTemplateField = () => {
|
|
63
64
|
return (_jsxs(StyledSummaryTemplateInput, { ref: summaryElementRef, "$readOnly": readOnly, tabIndex: 0, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, "$isModified": isModifiedWhen, "$vil": validationItems, "$disabled": disabled, "$showBorder": showBorder, "$fontSize": fontSize, "$width": width, "$height": height, onChange: onValueChanged, children: [_jsx("div", { onClick: () => { if (openEditorOnSummaryClick && !disabled)
|
|
64
65
|
onEditorClick?.(); }, onDoubleClick: () => { if (!openEditorOnSummaryClick && !disabled)
|
|
65
|
-
onEditorClick?.(); }, style: {
|
|
66
|
+
onEditorClick?.(); }, style: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
justifyContent: 'space-between',
|
|
70
|
+
userSelect: 'text',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
width: '5px',
|
|
73
|
+
minHeight: '16px',
|
|
74
|
+
cursor: (openEditorOnSummaryClick && !readOnly) ? 'pointer' : 'default',
|
|
75
|
+
overflow: 'hidden',
|
|
76
|
+
textOverflow: 'ellipsis',
|
|
77
|
+
whiteSpace: 'nowrap',
|
|
78
|
+
flexGrow: 1,
|
|
79
|
+
marginRight: '5px' // Spazio per i bottoni
|
|
80
|
+
}, children: template }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '3px', justifyContent: 'flex-start', alignItems: 'center', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && hasValue && _jsx(StyledEditorButtonIcon2, { tabIndex: disabled ? -1 : 0, onKeyDown: (e) => e.code === 'Space' && onClearClick?.(), onClick: handleClearClick, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Clear, children: _jsx(IconClearButton, {}) }) }), showEditButton && _jsx(StyledEditorButtonIcon2, { tabIndex: disabled ? -1 : 0, onKeyDown: (e) => e.code === 'Space' && onEditorClick?.(), onClick: onEditorClick, children: _jsx(TMTooltip, { content: iconeEditTooltip ?? SDKUI_Localizator.Update, children: iconEditButton ?? _jsx(IconPencil, {}) }) }), buttons.map((buttonItem) => {
|
|
66
81
|
return (_jsx(StyledEditorButtonIcon2, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
67
82
|
})] })] }));
|
|
68
83
|
};
|
|
@@ -63,7 +63,7 @@ const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.
|
|
|
63
63
|
}
|
|
64
64
|
return dataListItem ? dataListItem.name : displayValue;
|
|
65
65
|
};
|
|
66
|
-
return (_jsx(TMTooltip, { content: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, childStyle: { width: '100%' }, children: _jsxs(StyledDivHorizontal, { style: { width: '100%' }, children: [getIcon(), _jsx("p", { style: {
|
|
66
|
+
return (_jsx(TMTooltip, { content: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, parentStyle: { width: '100%' }, childStyle: { width: '100%' }, children: _jsxs(StyledDivHorizontal, { style: { width: '100%' }, children: [getIcon(), _jsx("p", { style: {
|
|
67
67
|
textAlign: 'left',
|
|
68
68
|
marginLeft: showIcon ? '5px' : '',
|
|
69
69
|
opacity: dataListItem ? 1 : 0.5,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.15.
|
|
3
|
+
"version": "6.15.128",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lib"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@topconsultnpm/sdk-ts-beta": "6.15.
|
|
41
|
+
"@topconsultnpm/sdk-ts-beta": "6.15.10",
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"devextreme": "25.1.4",
|
|
44
44
|
"devextreme-react": "25.1.4",
|