@topconsultnpm/sdkui-react-beta 6.5.66 → 6.5.67
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.
|
@@ -3,9 +3,9 @@ import { ITMEditorBase } from '../base/TMEditorBase';
|
|
|
3
3
|
interface ITMSummary extends ITMEditorBase {
|
|
4
4
|
showBorder?: boolean;
|
|
5
5
|
borderRadius?: string;
|
|
6
|
-
|
|
7
|
-
infoTemplate?: React.ReactNode;
|
|
6
|
+
showEditButton?: boolean;
|
|
8
7
|
iconEditButton?: React.ReactNode;
|
|
8
|
+
iconeEditTooltip?: string;
|
|
9
9
|
template?: React.ReactNode;
|
|
10
10
|
openEditorOnSummaryClick?: boolean;
|
|
11
11
|
customBtn?: any;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
4
4
|
import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
|
|
5
|
-
import {
|
|
5
|
+
import { IconClear, IconPencil, SDKUI_Localizator } from '../../helper';
|
|
6
6
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
7
7
|
import TMVilViewer from '../base/TMVilViewer';
|
|
8
8
|
import TMTooltip from '../base/TMTooltip';
|
|
@@ -46,13 +46,14 @@ const StyledEditorButtonIcon2 = styled.div `
|
|
|
46
46
|
border-bottom-color: ${TMColors.primary};
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
|
-
const TMSummary = ({ customBtn, borderRadius = '4px', validationItems = [], label = '',
|
|
49
|
+
const TMSummary = ({ customBtn, borderRadius = '4px', validationItems = [], label = '', onClearClick, onCustumBtnClick, openEditorOnSummaryClick, onEditorClick, backgroundColor = 'transparent', showBorder = true, isModifiedWhen, elementStyle, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, icon, showEditButton = true, iconEditButton, iconeEditTooltip, labelPosition = 'left', template, disabled = false, onValueChanged }) => {
|
|
50
50
|
const renderTemplateField = () => {
|
|
51
|
-
return (_jsx(StyledSummaryTemplateInput, { tabIndex: 0, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, "$isModified": isModifiedWhen, "$vil": validationItems, "$disabled": disabled, "$showBorder": showBorder, "$fontSize": fontSize, "$width": width, "$height": height, onChange: onValueChanged, children: _jsxs("div", { onClick: () =>
|
|
51
|
+
return (_jsx(StyledSummaryTemplateInput, { tabIndex: 0, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, "$isModified": isModifiedWhen, "$vil": validationItems, "$disabled": disabled, "$showBorder": showBorder, "$fontSize": fontSize, "$width": width, "$height": height, onChange: onValueChanged, children: _jsxs("div", { onClick: () => { if (openEditorOnSummaryClick && !disabled)
|
|
52
|
+
onEditorClick?.(); }, onDoubleClick: () => { if (!openEditorOnSummaryClick && !disabled)
|
|
53
|
+
onEditorClick?.(); }, style: { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', minHeight: '16px', cursor: openEditorOnSummaryClick ? 'pointer' : 'default' }, children: [template, _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [!openEditorOnSummaryClick && showEditButton && _jsx(StyledEditorButtonIcon2, { tabIndex: disabled ? -1 : 0, onKeyDown: (e) => e.code === 'Space' && onEditorClick?.(), "$transform": '2px', onClick: onEditorClick, "$index": onCustumBtnClick && onClearClick ? 2 : onCustumBtnClick ? 1 : 0, children: _jsx(TMTooltip, { content: iconeEditTooltip ?? SDKUI_Localizator.Update, children: iconEditButton ?? _jsx(IconPencil, {}) }) }), onClearClick && _jsx(StyledEditorButtonIcon2, { tabIndex: disabled ? -1 : 0, onKeyDown: (e) => e.code === 'Space' && onClearClick?.(), "$transform": '2px', onClick: onClearClick, "$index": onCustumBtnClick ? 1 : 0, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Clear, children: _jsx(IconClear, {}) }) }), onCustumBtnClick && _jsx(StyledEditorButtonIcon2, { tabIndex: disabled ? -1 : 0, onKeyDown: (e) => e.code === 'Space' && onCustumBtnClick?.(), "$transform": '2px', onClick: onCustumBtnClick, "$index": 0, children: customBtn })] })] }) }));
|
|
52
54
|
};
|
|
53
55
|
const renderLabel = () => {
|
|
54
|
-
return (_jsx(StyledEditorLabel, { "$isFocused": false, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children:
|
|
55
|
-
_jsx(TMTooltip, { content: infoTemplate, children: _jsx(IconCircleInfo, { style: { marginLeft: '5px' }, color: TMColors.primary }) })] }) }));
|
|
56
|
+
return (_jsx(StyledEditorLabel, { "$isFocused": false, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children: _jsx("div", { style: { flexDirection: "row", display: "flex", alignItems: "start", justifyContent: "start" }, children: label }) }));
|
|
56
57
|
};
|
|
57
58
|
const renderSummary = () => {
|
|
58
59
|
return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: icon && _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && renderLabel(), renderTemplateField(), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
|
|
@@ -12,7 +12,6 @@ const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
value && DataListCacheService.GetAsync(dataListId).then((dl) => {
|
|
15
|
-
console.log(dl);
|
|
16
15
|
if (value.length > 0) {
|
|
17
16
|
setDataListItem(dl?.items?.find(o => o.value == value));
|
|
18
17
|
}
|