@topconsultnpm/sdkui-react-beta 6.6.54 → 6.6.56
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, 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, 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 &&
|
|
25
25
|
_jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, dataSource: dataSource, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
26
26
|
};
|
|
27
27
|
export default TMUserChooser;
|
|
@@ -8,6 +8,7 @@ interface ITMDateBoxProps extends IDateBoxOptions {
|
|
|
8
8
|
useDateSerializationFormat?: boolean;
|
|
9
9
|
containerElement?: Element;
|
|
10
10
|
buttons?: any;
|
|
11
|
+
resetTimeToZeroOnKeyPress?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const TMDateBox: (props: ITMDateBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default TMDateBox;
|
|
@@ -5,6 +5,7 @@ import { DateDisplayTypes, Globalization } from '../../helper';
|
|
|
5
5
|
import { TMColors } from '../../utils/theme';
|
|
6
6
|
import TMVilViewer from '../base/TMVilViewer';
|
|
7
7
|
const TMDateBox = (props) => {
|
|
8
|
+
const resetTimeToZero = props.resetTimeToZeroOnKeyPress !== undefined ? props.resetTimeToZeroOnKeyPress : true;
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
let htmlElement = dateBoxRef?.current?.instance().element();
|
|
10
11
|
if (!htmlElement)
|
|
@@ -57,14 +58,16 @@ const TMDateBox = (props) => {
|
|
|
57
58
|
e.component.option("value", currentDate.toISOString());
|
|
58
59
|
}
|
|
59
60
|
}, onValueChanged: (e) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
if (resetTimeToZero) {
|
|
62
|
+
// soluzione in https://supportcenter.devexpress.com/ticket/details/t1103734/datebox-how-to-initialize-time-to-00-00-when-key-is-pressed-instead-of-current-time
|
|
63
|
+
if (props.value != undefined)
|
|
64
|
+
return;
|
|
65
|
+
if (!e.value)
|
|
66
|
+
return;
|
|
67
|
+
const currentDate = new Date(e.value);
|
|
68
|
+
currentDate.setHours(0, 0, 0, 0);
|
|
69
|
+
e.component.option("value", currentDate.toISOString());
|
|
70
|
+
}
|
|
68
71
|
} }), _jsx(TMVilViewer, { vil: props.validationItems })] }));
|
|
69
72
|
};
|
|
70
73
|
export default TMDateBox;
|