@topconsultnpm/sdkui-react-beta 6.7.20 → 6.7.22

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.
@@ -4,6 +4,7 @@ interface ITMListViewHeader {
4
4
  headerTitle?: string;
5
5
  firstCounter?: React.ReactNode;
6
6
  secondCounter?: React.ReactNode;
7
+ titleColor?: string;
7
8
  }
8
9
  interface ListProps<T> {
9
10
  dataSource?: T[];
@@ -7,6 +7,7 @@ import { IconApply, IconCloseCircle, IconColumns, IconDown, IconHide, IconShow,
7
7
  import { TMSearchBar } from '../sidebar/TMHeader';
8
8
  import TMTooltip from './TMTooltip';
9
9
  import { SDKUI_Localizator } from '../../helper';
10
+ import { TMColors } from '../../utils/theme';
10
11
  const StyledListItem = styled.div ` width: 100%; height: max-content; border-bottom: 1px solid #e5e5e5; background-color: ${props => props.$isSelected ? props.$color ? `${props.$color}99` : '#00000030' : 'transparent'} ; color: ${props => props.$isSelected ? props.$color ? 'white' : '#000000' : '#000000'} ; &:hover{ background-color: ${props => props.$color ? props.$isSelected ? `${props.$color}99` : `${props.$color}40` : props.$isSelected ? '#00000030' : '#00000010'};} `;
11
12
  const StyledListViewContainer = styled.div ` position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; width: 100%; height: 100%; `;
12
13
  const StyledSearchContainer = styled.div ` width: 100%; height: max-content; padding: 5px; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; gap: 10px; `;
@@ -330,5 +331,5 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
330
331
  };
331
332
  export default TMListView;
332
333
  export const CustomListViewHeader = (props) => {
333
- return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', padding: '0 5px', gap: 5 }, children: [props.headerIcon, _jsx("p", { children: props.headerTitle }), props.firstCounter, props.secondCounter] }));
334
+ return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', padding: '0 5px', gap: 5 }, children: [props.headerIcon, _jsx("p", { style: { fontWeight: 'bold', color: props.titleColor ? props.titleColor : TMColors.text_normal }, children: props.headerTitle }), props.firstCounter, props.secondCounter] }));
334
335
  };
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import styled from "styled-components";
4
4
  import { FontSize, TMColors } from '../../utils/theme';
5
- import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from "./TMEditorStyled";
5
+ import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, TMEditorsDefaultBorderRadius, editorColorManager } from "./TMEditorStyled";
6
6
  import TMLayoutContainer, { TMLayoutItem } from "../base/TMLayout";
7
7
  import TMVilViewer from "../base/TMVilViewer";
8
8
  const StyledDropDown = styled.select `
@@ -13,7 +13,7 @@ const StyledDropDown = styled.select `
13
13
  border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid ;
14
14
  border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
15
15
  color: ${props => !props.disabled ? (props.$vil.length === 0) ? !props.$isModified ? TMColors.text_normal : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
16
- border-radius: 2px;
16
+ border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
17
17
  min-width: 70px;
18
18
  &:focus{
19
19
  outline: none;
@@ -31,7 +31,7 @@ const StyledDropDown = styled.select `
31
31
  const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, onValueChanged }) => {
32
32
  const [isFocused, setIsfocused] = useState(false);
33
33
  const renderedLeftLabelTextBox = () => {
34
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children: label }), _jsx(StyledDropDown, { value: value, onFocus: () => setIsfocused(true), onBlur: () => setIsfocused(false), "$disabled": disabled, disabled: disabled, "$fontSize": fontSize, "$width": width, "$isModified": isModifiedWhen, "$vil": validationItems, onChange: onValueChanged, children: dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index))) }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
34
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), _jsx(StyledDropDown, { value: value, onFocus: () => setIsfocused(true), onBlur: () => setIsfocused(false), "$disabled": disabled, disabled: disabled, "$fontSize": fontSize, "$width": width, "$isModified": isModifiedWhen, "$vil": validationItems, onChange: onValueChanged, children: dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index))) }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
35
35
  };
36
36
  return (_jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() }));
37
37
  };
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ValidationItem } from '@topconsultnpm/sdk-ts-beta';
3
+ export declare const TMEditorsDefaultBorderRadius = "5px";
4
+ export declare const TMEditorsDefaultLabelFontSize = "0.85rem";
3
5
  export declare const editorColorManager: (validationItems: ValidationItem[]) => string;
4
6
  export declare const StyledEditorContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
7
  $width: string;
@@ -24,7 +26,7 @@ export declare const StyledEditorLabel: import("styled-components").IStyledCompo
24
26
  $isFocused: boolean;
25
27
  $labelPosition: 'right' | 'left' | 'top';
26
28
  $disabled: boolean;
27
- $fontSize: string;
29
+ $fontSize?: string | undefined;
28
30
  $color?: string | undefined;
29
31
  }>>;
30
32
  export declare const StyledEditorButtonIcon: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
@@ -39,4 +41,5 @@ export declare const StyledTextareaEditor: import("styled-components").IStyledCo
39
41
  $disabled: boolean;
40
42
  $isMobile?: boolean | undefined;
41
43
  $maxHeight?: string | undefined;
44
+ $borderRadius?: string | undefined;
42
45
  }>>;
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components';
2
2
  import { ResultTypes } from '@topconsultnpm/sdk-ts-beta';
3
3
  import { TMColors } from '../../utils/theme';
4
+ export const TMEditorsDefaultBorderRadius = '5px';
5
+ export const TMEditorsDefaultLabelFontSize = '0.85rem';
4
6
  export const editorColorManager = (validationItems) => {
5
7
  if (validationItems.find(item => item.ResultType === ResultTypes.ERROR))
6
8
  return TMColors.error;
@@ -22,7 +24,7 @@ export const StyledEditor = styled.input `
22
24
  border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid ;
23
25
  border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
24
26
  color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? 'black' : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
25
- border-radius: ${props => props.$borderRadius || '2px'};
27
+ border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
26
28
  min-width: ${props => props.$isMobile && '70px'};
27
29
  &:focus{
28
30
  outline: none;
@@ -48,7 +50,7 @@ export const StyledEditorIcon = styled.div `
48
50
  transform: translateY(18px);
49
51
  `;
50
52
  export const StyledEditorLabel = styled.div `
51
- font-size: ${props => props.$fontSize} ;
53
+ font-size: ${props => props.$fontSize ?? TMEditorsDefaultLabelFontSize} ;
52
54
  color:${props => !props.$disabled ? props.$isFocused ? TMColors.primary : props.$color ? props.$color : TMColors.label_normal : TMColors.disabled};
53
55
  padding: 0 3px;
54
56
  user-select: none;
@@ -91,7 +93,7 @@ export const StyledTextareaEditor = styled.textarea `
91
93
  : TMColors.isModified
92
94
  : editorColorManager(props.$vil)
93
95
  : TMColors.disabled};
94
- border-radius: 4px; /* Slightly increased radius for smoother corners */
96
+ border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius}; /* Slightly increased radius for smoother corners */
95
97
  min-width: ${props => (props.$isMobile ? '70px' : '100%')}; /* Adjust for mobile */
96
98
  max-height: ${props => props.$maxHeight || 'auto'};
97
99
  &:focus {
@@ -1,7 +1,7 @@
1
1
  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
- import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
4
+ import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, TMEditorsDefaultBorderRadius, editorColorManager } from './TMEditorStyled';
5
5
  import { IconClearButton, IconPencil, SDKUI_Localizator } from '../../helper';
6
6
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
7
7
  import TMVilViewer from '../base/TMVilViewer';
@@ -16,7 +16,7 @@ const StyledSummaryTemplateInput = styled.div `
16
16
  border-bottom: ${props => !props.$showBorder ? '' : (props.$vil.length > 0) ? '3px solid' : '1px solid'} ;
17
17
  border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
18
18
  color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? 'black' : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
19
- border-radius: ${props => !props.$showBorder ? props.$borderRadius : '2px'};
19
+ border-radius: ${props => !props.$showBorder ? props.$borderRadius : TMEditorsDefaultBorderRadius};
20
20
  display: flex;
21
21
  align-items: center;
22
22
  /* min-width: 70px; */
@@ -55,7 +55,7 @@ const TMSummary = ({ labelColor, hasValue, borderRadius = '4px', validationItems
55
55
  })] })] }) }));
56
56
  };
57
57
  const renderLabel = () => {
58
- return (_jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": false, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children: _jsx("div", { style: { flexDirection: "row", display: "flex", alignItems: "start", justifyContent: "start" }, children: label }) }));
58
+ return (_jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": false, "$labelPosition": labelPosition, "$disabled": disabled, children: _jsx("div", { style: { flexDirection: "row", display: "flex", alignItems: "start", justifyContent: "start" }, children: label }) }));
59
59
  };
60
60
  const renderSummary = () => {
61
61
  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 })] }) })] }));
@@ -64,7 +64,7 @@ const TMTextArea = (props) => {
64
64
  }), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
65
65
  };
66
66
  const renderedLeftLabelTextArea = () => {
67
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children: label ?? '' }), renderTextArea()] }) })] }));
67
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label ?? '' }), renderTextArea()] }) })] }));
68
68
  };
69
69
  return (_jsx("div", { style: elementStyle, children: renderedLeftLabelTextArea() }));
70
70
  };
@@ -151,7 +151,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, scale, showCle
151
151
  })] }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
152
152
  };
153
153
  const renderedLeftLabelTextBox = () => {
154
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, "$fontSize": fontSize, children: label }), renderInputField()] }) })] }));
154
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), renderInputField()] }) })] }));
155
155
  };
156
156
  return (_jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() }));
157
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.7.20",
3
+ "version": "6.7.22",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -29,7 +29,6 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@topconsultnpm/sdk-ts-beta": "^6.7.17",
32
- "@topconsultnpm/sdkui-react-beta": "^6.7.10",
33
32
  "buffer": "^6.0.3",
34
33
  "devextreme": "24.1.6",
35
34
  "devextreme-react": "24.1.6",