@topconsultnpm/sdkui-react 6.21.0-dev2.4 → 6.21.0-dev2.6
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.
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useEffect, useId, useRef } from 'react';
|
|
3
3
|
import { DateBox } from 'devextreme-react';
|
|
4
4
|
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
8
|
const resetTimeToZero = props.resetTimeToZeroOnKeyPress ?? true;
|
|
9
|
+
const autoId = useId();
|
|
10
|
+
const effectiveInputAttr = { id: autoId, ...props.inputAttr };
|
|
9
11
|
useEffect(() => {
|
|
10
12
|
let htmlElement = dateBoxRef?.current?.instance().element();
|
|
11
13
|
if (!htmlElement)
|
|
@@ -63,7 +65,7 @@ const TMDateBox = (props) => {
|
|
|
63
65
|
return "datetime";
|
|
64
66
|
return props.dateDisplayType == DateDisplayTypes.Date ? "date" : "time";
|
|
65
67
|
};
|
|
66
|
-
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', padding: props.padding }, children: [props.icon && (_jsx("span", { style: { marginRight: '8px', marginTop: '8px', display: 'flex', alignItems: 'center' }, children: props.icon })), _jsxs("div", { onContextMenu: (e) => e.stopPropagation(), style: { display: 'flex', flexDirection: 'column', gap: '5px', width: '100%' }, children: [_jsx(DateBox, { readOnly: props.readOnly, ref: dateBoxRef, showClearButton: props.showClearButton, dateSerializationFormat: props.useDateSerializationFormat ? 'yyyy-MM-ddTHH:mm:ss' : undefined, disabled: props.disabled, displayFormat: props.displayFormat ?? Globalization.getDateDisplayFormat(props.dateDisplayType), dropDownOptions: dropDownOptions, label: props.label, labelMode: 'static', type: getType(), useMaskBehavior: true, height: '28px', value: props.value, width: props.width, valueChangeEvent: 'keyup input change', onValueChange: (e) => { props.onValueChange?.(e); }, onInitialized: (e) => { props.onInitialized?.(e); }, onContentReady: (e) => { props.onContentReady?.(e); }, placeholder: props.placeholder, onKeyUp: (e) => {
|
|
68
|
+
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', padding: props.padding }, children: [props.icon && (_jsx("span", { style: { marginRight: '8px', marginTop: '8px', display: 'flex', alignItems: 'center' }, children: props.icon })), _jsxs("div", { onContextMenu: (e) => e.stopPropagation(), style: { display: 'flex', flexDirection: 'column', gap: '5px', width: '100%' }, children: [_jsx(DateBox, { readOnly: props.readOnly, ref: dateBoxRef, showClearButton: props.showClearButton, dateSerializationFormat: props.useDateSerializationFormat ? 'yyyy-MM-ddTHH:mm:ss' : undefined, disabled: props.disabled, displayFormat: props.displayFormat ?? Globalization.getDateDisplayFormat(props.dateDisplayType), dropDownOptions: dropDownOptions, label: props.label, labelMode: 'static', type: getType(), useMaskBehavior: true, height: '28px', value: props.value, width: props.width, valueChangeEvent: 'keyup input change', onValueChange: (e) => { props.onValueChange?.(e); }, onInitialized: (e) => { props.onInitialized?.(e); }, onContentReady: (e) => { props.onContentReady?.(e); }, placeholder: props.placeholder, ...(props.name && { name: props.name }), inputAttr: effectiveInputAttr, onKeyUp: (e) => {
|
|
67
69
|
if (e.event?.code == "Space") {
|
|
68
70
|
const currentDate = new Date();
|
|
69
71
|
currentDate.setHours(0, 0, 0, 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { useState, useEffect, useRef, useId } from 'react';
|
|
3
3
|
import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
|
|
4
4
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
5
5
|
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
@@ -28,7 +28,10 @@ const StyledTextAreaEditorButton = styled.div `
|
|
|
28
28
|
// Define the TMTextArea component
|
|
29
29
|
const TMTextArea = (props) => {
|
|
30
30
|
// Extract properties from the props object
|
|
31
|
-
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true, autoCalculateRows = true, fillHeight = false } = props;
|
|
31
|
+
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true, autoCalculateRows = true, fillHeight = false, name, id } = props;
|
|
32
|
+
// Generate a unique id if not provided
|
|
33
|
+
const autoId = useId();
|
|
34
|
+
const effectiveId = id ?? autoId;
|
|
32
35
|
// Reference to the textarea DOM element
|
|
33
36
|
const inputRef = useRef(null);
|
|
34
37
|
// Stores the textarea is focused
|
|
@@ -148,7 +151,7 @@ const TMTextArea = (props) => {
|
|
|
148
151
|
};
|
|
149
152
|
// Renders the textarea
|
|
150
153
|
const renderTextArea = () => {
|
|
151
|
-
const textareaElement = _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: fillHeight ? undefined : calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
154
|
+
const textareaElement = _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, id: effectiveId, ...(name && { name }), autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: fillHeight ? undefined : calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
152
155
|
onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize, style: fillHeight ? { flex: 1, height: 0 } : undefined }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
153
156
|
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
154
157
|
setShowFormulaItemsChooser(true);
|
|
@@ -77,7 +77,6 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
77
77
|
UpdaterDisplayName: user?.name ?? updaterID.toString(),
|
|
78
78
|
CreationTime: row.CreationTime,
|
|
79
79
|
LastUpdateTime: row.LastUpdateTime,
|
|
80
|
-
LastUpdateTimeDisplay: row.LastUpdateTime ? Globalization.getDateTimeDisplayValue(new Date(row.LastUpdateTime)) : '-',
|
|
81
80
|
Version: row.Version,
|
|
82
81
|
CheckInTime: row.CheckInTime,
|
|
83
82
|
IsLex: row.IsLex ? row.IsLex.toString() === '1' : false,
|
|
@@ -277,7 +276,7 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
277
276
|
{ dataField: "Version", caption: "V.", dataType: 'number' },
|
|
278
277
|
{ dataField: "FileSizeDisplay", caption: SDKUI_Localizator.Size },
|
|
279
278
|
{ dataField: "UpdaterDisplayName", caption: SDKUI_Localizator.Author },
|
|
280
|
-
{ dataField: "
|
|
279
|
+
{ dataField: "LastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm:ss', },
|
|
281
280
|
]);
|
|
282
281
|
}, [showId]);
|
|
283
282
|
return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showLocalWaitPanel, showWaitPanelPrimary: showLocalPrimary, waitPanelTitle: waitLocalPanelTitle, waitPanelTextPrimary: waitLocalPanelTextPrimary, waitPanelValuePrimary: waitLocalPanelValuePrimary, waitPanelMaxValuePrimary: waitLocalPanelMaxValuePrimary, isCancelable: true, abortController: abortLocalController, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, customContextMenuItems: customContextMenuItems, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
|
|
@@ -6,6 +6,12 @@ const GlobalStyle = createGlobalStyle `
|
|
|
6
6
|
* {
|
|
7
7
|
font-family: var(--base-font-family, "Inter"), sans-serif;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
.dx-widget input,
|
|
11
|
+
.dx-widget textarea {
|
|
12
|
+
font-family: var(--base-font-family, "Inter"), sans-serif !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
.dx-filemanager-dirs-tree-item-text{
|
|
10
16
|
font-size: var(--base-font-size, 13px);
|
|
11
17
|
}
|