@topconsultnpm/sdkui-react 6.22.0-dev2.2 → 6.22.0-dev2.4
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.
- package/lib/components/editors/TMTextBox.js +15 -15
- package/package.json +66 -66
|
@@ -296,21 +296,21 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
|
|
|
296
296
|
// Stima la larghezza del simbolo (circa 10px per carattere + margine)
|
|
297
297
|
return 6 + (currencySymbol.length * 10) + 4;
|
|
298
298
|
};
|
|
299
|
-
return (_jsx("div", { style: { width: '100%', height: 'fit-content', cursor: onClick ? 'pointer' : undefined, display: 'flex', alignItems: 'center' }, id: `text-${id}`, onClick: onClick, children:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
299
|
+
return (_jsx("div", { style: { width: '100%', height: 'fit-content', cursor: onClick ? 'pointer' : undefined, display: 'flex', alignItems: 'center' }, id: `text-${id}`, onClick: onClick, children: _jsxs("div", { style: { flex: 1 }, children: [_jsxs("div", { style: { position: 'relative' }, children: [currencySymbol && initialType !== 'password' && initialType !== 'secureText' && _jsx("span", { style: { position: 'absolute', left: '6px', top: '50%', transform: 'translateY(-50%)', color: disabled ? TMColors.disabled : TMColors.text_normal, fontSize: fontSize, pointerEvents: 'none', zIndex: 1 }, children: currencySymbol }), _jsx(StyledEditor, { ref: inputRef, onContextMenu: (e) => e.stopPropagation(), id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: autoComplete, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
300
|
+
onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
|
|
301
|
+
if (currentType === 'number') {
|
|
302
|
+
if (!scale && (e.key == "." || e.key == ","))
|
|
303
|
+
e.preventDefault();
|
|
304
|
+
}
|
|
305
|
+
onKeyDown?.(e);
|
|
306
|
+
}, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingLeft: `${calculateLeftPadding()}px`, paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' && (formulaItems.length > 0 || (showClearButton && currentValue) || buttons.length > 0) &&
|
|
307
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: '50%', transform: 'translateY(-50%)', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
308
|
+
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
309
|
+
setShowFormulaItemsChooser(true);
|
|
310
|
+
}, children: _jsx(IconDataList, {}) }), (showClearButton && currentValue) &&
|
|
311
|
+
_jsx(StyledTextBoxEditorButton, { onClick: () => { onValueChanged?.({ target: { value: undefined } }); onBlur?.(undefined); }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
312
|
+
return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
313
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` }))] }), _jsx(TMVilViewer, { vil: validationItems })] }) }));
|
|
314
314
|
};
|
|
315
315
|
const renderedLeftLabelTextBox = () => {
|
|
316
316
|
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()] }) })] }));
|
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"version":
|
|
4
|
-
"description":
|
|
5
|
-
"scripts":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"author":
|
|
17
|
-
"license":
|
|
18
|
-
"devDependencies":
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"main":
|
|
35
|
-
"types":
|
|
36
|
-
"module":
|
|
37
|
-
"files":
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"dependencies":
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"overrides":
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"allowScripts":
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
2
|
+
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
+
"version": "6.22.0-dev2.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('lib',{recursive:true,force:true});fs.mkdirSync('lib')\"",
|
|
8
|
+
"copy-files": "cpx \"src/{assets/*.*,assets/ImageLibrary/*.*,assets/thumbnails/*.*,assets/IconsS4t/*.*,assets/Metadata/*.*,css/tm-sdkui.css}\" lib",
|
|
9
|
+
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
|
+
"tm-watch": "tsc -w",
|
|
11
|
+
"tm-publish": "npm publish --tag latest",
|
|
12
|
+
"tm-publish_wl": "npm publish",
|
|
13
|
+
"storybook": "storybook dev -p 6006",
|
|
14
|
+
"build-storybook": "storybook build"
|
|
15
|
+
},
|
|
16
|
+
"author": "TopConsult",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@chromatic-com/storybook": "^5.1.2",
|
|
20
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
21
|
+
"@storybook/addon-onboarding": "^10.3.5",
|
|
22
|
+
"@storybook/react-vite": "^10.3.5",
|
|
23
|
+
"@types/node": "^24.12.2",
|
|
24
|
+
"@types/react": "^18.3.3",
|
|
25
|
+
"@types/react-dom": "^18.3.3",
|
|
26
|
+
"cpx2": "^9.0.0",
|
|
27
|
+
"esbuild": "^0.25.0",
|
|
28
|
+
"react": "^18.3.1",
|
|
29
|
+
"react-dom": "^18.3.1",
|
|
30
|
+
"storybook": "^10.3.5",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vite": "^6.1.1"
|
|
33
|
+
},
|
|
34
|
+
"main": "dist/cjs/index.js",
|
|
35
|
+
"types": "./index.d.ts",
|
|
36
|
+
"module": "lib/esm/index.js",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"lib"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.22.0-dev2.2",
|
|
43
|
+
"@zip.js/zip.js": "2.8.26",
|
|
44
|
+
"buffer": "^6.0.3",
|
|
45
|
+
"devextreme": "^25.2.6",
|
|
46
|
+
"devextreme-exceljs-fork": "^4.4.10",
|
|
47
|
+
"devextreme-react": "^25.2.6",
|
|
48
|
+
"htmlparser2": "^10.0.0",
|
|
49
|
+
"pdf-lib": "^1.17.1",
|
|
50
|
+
"react-pdf": "^10.4.1",
|
|
51
|
+
"react-window": "^2.2.7",
|
|
52
|
+
"styled-components": "^6.1.1"
|
|
53
|
+
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"esbuild": "^0.25.0",
|
|
56
|
+
"devextreme-exceljs-fork": {
|
|
57
|
+
"archiver": "^8.0.0"
|
|
58
|
+
},
|
|
59
|
+
"quill-delta": {
|
|
60
|
+
"lodash.isequal": "npm:fast-deep-equal@^3.1.3"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"allowScripts": {
|
|
64
|
+
"core-js@3.49.0": true,
|
|
65
|
+
"esbuild@0.25.12": true,
|
|
66
|
+
"inferno@8.2.3": true
|
|
67
|
+
}
|
|
68
68
|
}
|