@topconsultnpm/sdkui-react-beta 6.6.18 → 6.6.20

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,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from 'react';
3
3
  import { DateBox } from 'devextreme-react';
4
- import { Button } from 'devextreme-react/cjs/date-box';
5
- import { DateDisplayTypes, Globalization, IconLayerGroup } from '../../helper';
4
+ import { DateDisplayTypes, Globalization } from '../../helper';
6
5
  import { TMColors } from '../../utils/theme';
7
6
  import TMVilViewer from '../base/TMVilViewer';
8
- import ReactDOMServer from 'react-dom/server';
9
7
  const TMDateBox = (props) => {
10
8
  useEffect(() => {
11
9
  let htmlElement = dateBoxRef?.current?.instance().element();
@@ -50,7 +48,7 @@ const TMDateBox = (props) => {
50
48
  return "datetime";
51
49
  return props.dateDisplayType == DateDisplayTypes.Date ? "date" : "time";
52
50
  };
53
- return (_jsxs(_Fragment, { children: [_jsxs(DateBox, { ref: dateBoxRef,
51
+ return (_jsxs(_Fragment, { children: [_jsx(DateBox, { ref: dateBoxRef,
54
52
  // defaultValue={props.defaultValue}
55
53
  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); }, onKeyUp: (e) => {
56
54
  if (e.event?.code == "Space") {
@@ -67,12 +65,6 @@ const TMDateBox = (props) => {
67
65
  const currentDate = new Date(e.value);
68
66
  currentDate.setHours(0, 0, 0, 0);
69
67
  e.component.option("value", currentDate.toISOString());
70
- }, children: [props.buttons?.map((btn) => {
71
- return (_jsx(Button, { name: btn.text, location: "after", options: {
72
- icon: ReactDOMServer.renderToString(_jsx(IconLayerGroup, {})),
73
- stylingMode: 'text',
74
- onClick: () => btn?.onClick?.()
75
- } }, btn.text));
76
- }), _jsx(Button, { name: "dropDown" })] }), _jsx(TMVilViewer, { vil: props.validationItems })] }));
68
+ } }), _jsx(TMVilViewer, { vil: props.validationItems })] }));
77
69
  };
78
70
  export default TMDateBox;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from 'react';
3
3
  import styled from 'styled-components';
4
- import { StyledEditor, StyledEditorButtonIcon, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
4
+ import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
5
5
  import { FontSize, TMColors } from '../../utils/theme';
6
6
  import { genUniqueId, IconClearButton, IconHide, IconShow, useWindowWidth } from '../../helper';
7
7
  import ShowAlert from '../base/TMAlert';
@@ -18,6 +18,19 @@ const StyledShowPasswordIcon = styled.div `
18
18
  transform: translateY(-25px);
19
19
  cursor: pointer;
20
20
  `;
21
+ const StyledTextBoxEditorButton = styled.div `
22
+ color: ${TMColors.button_icon};
23
+ display: flex;
24
+ align-items: center;
25
+ position: relative;
26
+ cursor: pointer;
27
+ &:focus{
28
+ outline: none;
29
+ background-image: linear-gradient(white, #E4E9F7);
30
+ border-bottom: 2px solid;
31
+ border-bottom-color: ${TMColors.primary};
32
+ }
33
+ `;
21
34
  const TMTextBox = ({ autoFocus, maxLength, precision, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onValueChanged, onBlur }) => {
22
35
  const [initialType, setInitialType] = useState(type);
23
36
  const [currentType, setCurrentType] = useState(type);
@@ -128,12 +141,13 @@ const TMTextBox = ({ autoFocus, maxLength, precision, scale, showClearButton, va
128
141
  e.preventDefault();
129
142
  }
130
143
  }, "$isMobile": screenWidth < 640, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType }), initialType === 'password' && currentValue && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
131
- buttons.map((buttonItem, index) => {
132
- return (_jsx(StyledEditorButtonIcon, { onClick: buttonItem.onClick, "$index": index, "$transform": '-26px', children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, index));
133
- }), initialType !== 'password' && showClearButton && currentValue && _jsx(StyledEditorButtonIcon, { "$index": buttons.length, "$transform": '-26px', onClick: () => {
134
- onValueChanged?.({ target: { value: undefined } });
135
- onBlur?.(undefined);
136
- }, children: _jsx(IconClearButton, {}) }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
144
+ _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
145
+ _jsx(StyledTextBoxEditorButton, { onClick: () => {
146
+ onValueChanged?.({ target: { value: undefined } });
147
+ onBlur?.(undefined);
148
+ }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
149
+ return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
150
+ })] }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
137
151
  };
138
152
  const renderedLeftLabelTextBox = () => {
139
153
  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 }), renderInputField()] }) })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.6.18",
3
+ "version": "6.6.20",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",