@topconsultnpm/sdkui-react 6.21.0-dev3.4 → 6.21.0-dev3.41

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.
Files changed (67) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +22 -1
  2. package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
  3. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
  4. package/lib/components/base/TMAreaManager.js +11 -0
  5. package/lib/components/base/TMDataGrid.js +12 -2
  6. package/lib/components/base/TMDataGridExportForm.js +19 -8
  7. package/lib/components/base/TMFileManagerDataGridView.js +4 -4
  8. package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
  9. package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
  10. package/lib/components/base/TMFileManagerUtils.js +14 -1
  11. package/lib/components/base/TMModal.js +2 -2
  12. package/lib/components/base/TMPopUp.d.ts +1 -0
  13. package/lib/components/base/TMPopUp.js +59 -2
  14. package/lib/components/base/TMSpinner.d.ts +4 -2
  15. package/lib/components/base/TMSpinner.js +33 -6
  16. package/lib/components/base/TMTreeView.js +12 -15
  17. package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
  18. package/lib/components/choosers/TMGroupChooser.js +1 -1
  19. package/lib/components/editors/TMEditorStyled.d.ts +6 -6
  20. package/lib/components/editors/TMFormulaEditor.d.ts +1 -0
  21. package/lib/components/editors/TMFormulaEditor.js +98 -49
  22. package/lib/components/editors/TMMetadataEditor.js +6 -2
  23. package/lib/components/editors/TMMetadataValues.js +23 -6
  24. package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
  25. package/lib/components/features/documents/TMCopyToFolderForm.js +2 -2
  26. package/lib/components/features/documents/TMDcmtIcon.js +1 -1
  27. package/lib/components/features/documents/TMMasterDetailDcmts.js +1 -1
  28. package/lib/components/features/documents/TMMergeToPdfForm.js +1 -1
  29. package/lib/components/features/documents/TMRelationViewer.js +8 -3
  30. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +0 -13
  31. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +1 -39
  32. package/lib/components/features/search/TMMetadataOutputForm.d.ts +17 -0
  33. package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
  34. package/lib/components/features/search/TMMetadataSorterForm.d.ts +17 -0
  35. package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
  36. package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
  37. package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
  38. package/lib/components/features/search/TMSearchResult.d.ts +1 -0
  39. package/lib/components/features/search/TMSearchResult.js +39 -18
  40. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  41. package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
  42. package/lib/components/features/search/metadataFormHelper.js +77 -0
  43. package/lib/components/forms/Login/TMLoginForm.js +15 -3
  44. package/lib/components/grids/TMBlogAttachments.js +2 -2
  45. package/lib/components/grids/TMBlogsPost.js +5 -3
  46. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  47. package/lib/components/grids/TMBlogsPostUtils.js +3 -1
  48. package/lib/components/wizard/TMWizard.d.ts +1 -0
  49. package/lib/components/wizard/TMWizard.js +5 -3
  50. package/lib/helper/Enum_Localizator.js +1 -0
  51. package/lib/helper/SDKUI_Localizator.d.ts +4 -0
  52. package/lib/helper/SDKUI_Localizator.js +40 -0
  53. package/lib/helper/TMUtils.d.ts +23 -0
  54. package/lib/helper/TMUtils.js +55 -0
  55. package/lib/helper/checkinCheckoutManager.d.ts +4 -3
  56. package/lib/helper/checkinCheckoutManager.js +29 -11
  57. package/lib/helper/helpers.d.ts +2 -1
  58. package/lib/helper/helpers.js +1 -0
  59. package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
  60. package/lib/hooks/useDataUserIdItem.js +1 -1
  61. package/lib/hooks/useDcmtOperations.d.ts +18 -1
  62. package/lib/hooks/useDcmtOperations.js +235 -24
  63. package/lib/hooks/useDocumentOperations.js +22 -3
  64. package/lib/services/platform_services.d.ts +4 -4
  65. package/lib/ts/types.d.ts +2 -1
  66. package/lib/ts/types.js +1 -0
  67. package/package.json +13 -7
@@ -32,7 +32,7 @@ const StyledSpinnerWrapper = styled.div `
32
32
  width: ${props => props.$width || 'fit-content'};
33
33
  height: fit-content;
34
34
  max-width: 250px;
35
- max-height: 200px;
35
+ max-height: ${props => props.$hasCancel ? '280px' : '200px'};
36
36
  padding: 10px;
37
37
  border-radius: 5px;
38
38
  background-color: ${props => props.$flat ? 'transparent' : '#fcfcfc'};
@@ -134,22 +134,49 @@ const StyledSpinnerAnimation = styled.div `
134
134
  const StyledSpinnerDescription = styled.div `
135
135
  font-size: ${props => props.$fontSize || FontSize.defaultFontSize};
136
136
  text-align: center;
137
+ white-space: pre-line;
137
138
  `;
138
- const Spinner = ({ backgroundColor = 'transparent', description = '', fontSize = FontSize.defaultFontSize, width = 'fit-content', flat = false }) => {
139
- return (_jsx(StyledSpinnerContainer, { "$backgroundColor": backgroundColor, children: _jsxs(StyledSpinnerWrapper, { "$width": width, "$flat": flat, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
139
+ // Pulsante Annulla sotto lo spinner
140
+ const StyledCancelButton = styled.button `
141
+ margin-top: 15px;
142
+ padding: 8px 20px;
143
+ font-size: 14px;
144
+ font-weight: 500;
145
+ color: #fff;
146
+ background-color: #d12a1c;
147
+ border: none;
148
+ border-radius: 5px;
149
+ cursor: pointer;
150
+ transition: background-color 0.2s ease, transform 0.1s ease;
151
+
152
+ &:hover {
153
+ background-color: #b8241a;
154
+ }
155
+
156
+ &:active {
157
+ transform: scale(0.98);
158
+ }
159
+ `;
160
+ const Spinner = ({ backgroundColor = 'transparent', description = '', fontSize = FontSize.defaultFontSize, width = 'fit-content', flat = false, onCancel, cancelText = 'Annulla' }) => {
161
+ return (_jsx(StyledSpinnerContainer, { "$backgroundColor": backgroundColor, children: _jsxs(StyledSpinnerWrapper, { "$width": width, "$flat": flat, "$hasCancel": !!onCancel, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
140
162
  position: 'absolute',
141
163
  top: '50%',
142
164
  left: '50%',
143
165
  transform: 'translate(-54%, -54%)'
144
- }, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, { "$fontSize": fontSize, children: description })] }) }));
166
+ }, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, { "$fontSize": fontSize, children: description }), onCancel && (_jsx(StyledCancelButton, { onClick: onCancel, children: cancelText }))] }) }));
145
167
  };
146
168
  class TMSpinner {
147
- static show({ description, backgroundColor, fontSize, flat } = { backgroundColor: 'transparent', description: '', fontSize: FontSize.defaultFontSize, flat: false }) {
169
+ static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText } = {
170
+ backgroundColor: 'transparent',
171
+ description: '',
172
+ fontSize: FontSize.defaultFontSize,
173
+ flat: false
174
+ }) {
148
175
  let container = document.createElement('div');
149
176
  container.setAttribute("id", 'tm-spinner-temporary-container');
150
177
  document.body.appendChild(container);
151
178
  const root = ReactDOM.createRoot(container);
152
- root.render(_jsx(React.StrictMode, { children: _jsx(Spinner, { backgroundColor: backgroundColor, fontSize: fontSize, description: description, flat: flat }) }));
179
+ root.render(_jsx(React.StrictMode, { children: _jsx(Spinner, { backgroundColor: backgroundColor, fontSize: fontSize, description: description, flat: flat, onCancel: onCancel, cancelText: cancelText }) }));
153
180
  }
154
181
  static hide() {
155
182
  let container = document.getElementById('tm-spinner-temporary-container');
@@ -138,22 +138,19 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
138
138
  }
139
139
  if (delayFocus) {
140
140
  // Logica per il ritardo del focus (es. click singolo su icona desktop, gestito dal padre)
141
- if (clickTimeoutRef.current) {
142
- // Questo è il secondo click di un potenziale doppio click.
143
- // Annulla l'azione di focus dal click singolo precedente.
144
- clearTimeout(clickTimeoutRef.current);
145
- clickTimeoutRef.current = null;
146
- lastClickedNodeKeyRef.current = undefined;
147
- return; // Non attivare onFocusedItemChanged per il doppio click
141
+ // Il focus viene ritardato per permettere al doppio click di registrarsi sull'icona,
142
+ // ma il focus avviene comunque (sia con click singolo che doppio)
143
+ if (!clickTimeoutRef.current) {
144
+ // Primo click: imposta il timer per il focus
145
+ lastClickedNodeKeyRef.current = node.key;
146
+ clickTimeoutRef.current = setTimeout(() => {
147
+ onFocusedItemChanged?.(node);
148
+ clickTimeoutRef.current = null;
149
+ lastClickedNodeKeyRef.current = undefined;
150
+ }, 200);
148
151
  }
149
- // Primo click di un potenziale doppio click o un click singolo che necessita di ritardo
150
- lastClickedNodeKeyRef.current = node.key;
151
- clickTimeoutRef.current = setTimeout(() => {
152
- // Se il timer scade, significa che è stato solo un click singolo.
153
- onFocusedItemChanged?.(node);
154
- clickTimeoutRef.current = null;
155
- lastClickedNodeKeyRef.current = undefined;
156
- }, 200);
152
+ // Se c'è già un timer attivo (secondo click di doppio click), non fare nulla
153
+ // Il focus avverrà comunque quando scade il timer del primo click
157
154
  }
158
155
  else {
159
156
  // Logica per il focus immediato (per tutti gli altri click, o se shouldDelayFocusOnEvent è false)
@@ -84,10 +84,15 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
84
84
  _jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
85
85
  };
86
86
  const renderTemplate = () => {
87
+ const isPlaceholder = values?.[0] === placeHolder;
88
+ // Selezione singola: mostra direttamente il primo valore
89
+ if (!allowMultipleSelection) {
90
+ const singleDescription = getValueDescription(values?.[0]);
91
+ return (_jsx(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: dataSource && singleDescription && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [getIcon(), _jsx("p", { children: singleDescription })] }) }));
92
+ }
87
93
  const MIN_COUNT_FOR_BADGE = 1;
88
94
  const MAX_VISIBLE_ITEMS = 3;
89
95
  const MAX_TOOLTIP_ITEMS = 50;
90
- const isPlaceholder = values?.[0] === placeHolder;
91
96
  const descriptions = getDescriptions(MAX_VISIBLE_ITEMS);
92
97
  const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
93
98
  const totalCount = values?.length ?? 0;
@@ -11,7 +11,7 @@ export const TMGroupChooserForm = (props) => {
11
11
  TMSpinner.hide();
12
12
  return items ?? [];
13
13
  };
14
- return (_jsx(TMChooserForm, { title: SDK_Localizator.Groups, allowMultipleSelection: props.allowMultipleSelection, width: props.width, height: props.height, manageUseLocalizedName: true, hasShowOnlySelectedItems: true, selectedIDs: props.selectedIDs, startWithShowOnlySelectedItems: false, cellRenderIcon: () => _jsx(IconUserGroup, { color: '#767676' }), dataSource: props.dataSource, getItems: getItems, onClose: props.onClose, onChoose: (IDs) => { props.onChoose?.(IDs); } }));
14
+ return (_jsx(TMChooserForm, { title: SDK_Localizator.Groups, allowMultipleSelection: props.allowMultipleSelection, width: props.width, height: props.height, manageUseLocalizedName: props.manageUseLocalizedName ?? true, hasShowOnlySelectedItems: true, selectedIDs: props.selectedIDs, startWithShowOnlySelectedItems: false, cellRenderIcon: () => _jsx(IconUserGroup, { color: '#767676' }), dataSource: props.dataSource, getItems: getItems, onClose: props.onClose, onChoose: (IDs) => { props.onChoose?.(IDs); } }));
15
15
  };
16
16
  export const TMGroupIdViewer = (props) => {
17
17
  const [group, setGroup] = useState(null);
@@ -7,7 +7,7 @@ export declare const StyledEditorContainer: import("styled-components/dist/types
7
7
  }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
8
8
  $width: string;
9
9
  }, never>>> & string;
10
- export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$disabled" | "$isMobile" | "$width" | "$type" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$maxValue"> & {
10
+ export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
11
11
  $vil: ValidationItem[];
12
12
  $width: string;
13
13
  $type: string;
@@ -17,7 +17,7 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
17
17
  $disabled: boolean;
18
18
  $isMobile?: boolean;
19
19
  $borderRadius?: string;
20
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$disabled" | "$isMobile" | "$width" | "$type" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$maxValue"> & {
20
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
21
21
  $vil: ValidationItem[];
22
22
  $width: string;
23
23
  $type: string;
@@ -37,20 +37,20 @@ export declare const StyledEditorIcon: import("styled-components/dist/types").IS
37
37
  $disabled: boolean;
38
38
  $isModified: boolean;
39
39
  }, never>>> & string;
40
- export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
40
+ export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
41
41
  $isFocused: boolean;
42
42
  $labelPosition: "right" | "left" | "top";
43
43
  $disabled: boolean;
44
44
  $fontSize?: string;
45
45
  $color?: string;
46
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
46
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
47
47
  $isFocused: boolean;
48
48
  $labelPosition: "right" | "left" | "top";
49
49
  $disabled: boolean;
50
50
  $fontSize?: string;
51
51
  $color?: string;
52
52
  }, never>>> & string;
53
- export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$maxHeight" | "$disabled" | "$isMobile" | "$width" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$resize"> & {
53
+ export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
54
54
  $vil: ValidationItem[];
55
55
  $width: string;
56
56
  $isModified: boolean;
@@ -60,7 +60,7 @@ export declare const StyledTextareaEditor: import("styled-components/dist/types"
60
60
  $maxHeight?: string;
61
61
  $borderRadius?: string;
62
62
  $resize?: boolean;
63
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$maxHeight" | "$disabled" | "$isMobile" | "$width" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$resize"> & {
63
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
64
64
  $vil: ValidationItem[];
65
65
  $width: string;
66
66
  $isModified: boolean;
@@ -28,6 +28,7 @@ export declare class FormulaDescriptor {
28
28
  metadataDataTypeDest?: MetadataDataTypes;
29
29
  tid?: number;
30
30
  description?: string;
31
+ syntax?: string;
31
32
  }
32
33
  export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) => import("react/jsx-runtime").JSX.Element;
33
34
  declare const TMFormulaEditor: React.FunctionComponent<ITMApplyFormProps<FormulaDescriptor>>;