@topconsultnpm/sdkui-react-beta 6.14.71 → 6.14.72

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.
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import styled from "styled-components";
4
+ import { IconChevronDown, IconChevronRight } from "../../helper";
5
+ import { TMColors } from "../../utils/theme";
6
+ const TMAccordion = ({ title, children, defaultOpen = true, defaultCollapsed }) => {
7
+ // Se defaultCollapsed è definito, ha la precedenza su defaultOpen
8
+ const [isOpen, setIsOpen] = useState(defaultCollapsed !== undefined ? !defaultCollapsed : defaultOpen);
9
+ const toggleAccordion = () => {
10
+ setIsOpen(!isOpen);
11
+ };
12
+ return (_jsxs(StyledAccordionContainer, { children: [_jsxs(StyledGroupTemplate, { onClick: toggleAccordion, children: [isOpen ? _jsx(IconChevronDown, { fontSize: 20 }) : _jsx(IconChevronRight, { fontSize: 20 }), _jsx("h3", { children: title })] }), isOpen && (_jsx(StyledAccordionContent, { children: children }))] }));
13
+ };
14
+ export default TMAccordion;
15
+ //#region Styled Components
16
+ const StyledAccordionContainer = styled.div `
17
+ margin-bottom: 10px;
18
+ overflow: hidden;
19
+ `;
20
+ const StyledGroupTemplate = styled.div `
21
+ cursor: pointer;
22
+ background: none !important;
23
+ border: none !important;
24
+ box-shadow: none !important;
25
+ padding: 10px;
26
+ display: flex;
27
+ flex-direction: row;
28
+ gap: 5px;
29
+ align-items: center;
30
+ font-size: 1rem;
31
+ font-weight: 600;
32
+ color: ${TMColors.primaryColor};
33
+ position: relative;
34
+
35
+ &::after {
36
+ content: '';
37
+ display: block;
38
+ width: 90%;
39
+ margin: 0 auto;
40
+ border-bottom: 1px solid #00A99D;
41
+ margin-top: 8px;
42
+ position: absolute;
43
+ left: 5%;
44
+ bottom: 0;
45
+ }
46
+ `;
47
+ const StyledAccordionContent = styled.div `
48
+ padding: 10px;
49
+ background-color: #fff; /* White background for the content area */
50
+ `;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import styled from "styled-components";
4
- import { AccessLevels, DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
4
+ import { AccessLevels, DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, TemplateTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts-beta';
5
5
  import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys } from "../../helper";
6
6
  import { TMColors } from "../../utils/theme";
7
7
  import TMButton from "../base/TMButton";
@@ -11,6 +11,7 @@ import TMCheckBox from "./TMCheckBox";
11
11
  import TMMetadataEditor, { useMetadataEditableList } from "./TMMetadataEditor";
12
12
  import { FormulaHelper } from "./TMFormulaEditor";
13
13
  import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
14
+ import TMAccordion from "../base/TMAccordion";
14
15
  export var ShowCheckBoxesMode;
15
16
  (function (ShowCheckBoxesMode) {
16
17
  ShowCheckBoxesMode[ShowCheckBoxesMode["Never"] = 0] = "Never";
@@ -83,6 +84,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
83
84
  return;
84
85
  if (!currentDTD)
85
86
  return;
87
+ console.log('TMMetadataValues: metadataValues', metadataValues);
86
88
  //if no dynamic data list has changed we do not call APIs
87
89
  if (deepCompare(metadataValues.filter(o => o.md?.dataDomain === MetadataDataDomains.DynamicDataList), prevMetadataValues.filter(o => o.md?.dataDomain === MetadataDataDomains.DynamicDataList)))
88
90
  return;
@@ -212,62 +214,97 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
212
214
  ];
213
215
  return menu;
214
216
  };
217
+ // Helper function to render a single metadata item
218
+ const renderMetadataItem = (item, isReadOnlyOverride = false) => (_jsxs(StyledRow, { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '6px' : '0', gap: '8px' }, onClick: () => { handleMetadataValueSelection(item); }, onFocus: () => { handleMetadataValueSelection(item); }, children: [showCheckBoxes !== ShowCheckBoxesMode.Never &&
219
+ _jsx(TMCheckBox, { elementStyle: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '14px' : '20px' }, value: item.isSelected, disabled: showCheckBoxes === ShowCheckBoxesMode.AlwaysReadOnly, onValueChanged: (newValue) => {
220
+ let newValues = structuredClone(metadataValues);
221
+ const mvd = newValues.find(value => value.mid === item.mid);
222
+ if (mvd)
223
+ mvd.isSelected = newValue;
224
+ onValueChanged?.(newValues);
225
+ } }), _jsxs("div", { style: { position: 'relative', height: '100%', width: '100%', opacity: showNullValueCheckBoxes && item.isNull ? 0.4 : 1 }, children: [_jsx(TMMetadataEditor, { tid: TID, mid: item.mid, layoutMode: layoutMode, isLexProt: item.isLexProt, isSelected: isOpenDistinctValues && item.mid === selectedMID, isModifiedWhen: (item.value ?? '') !== (metadataValuesOrig.find(m => m.mid === item.mid)?.value ?? ''), isReadOnly: isReadOnly || isReadOnlyOverride || (showNullValueCheckBoxes ? item.isNull : undefined), isEditable: item.isEditable, validationItems: editorValidationHandler(item.mid ?? 0), value: item.value, openChooserBySingleClick: openChooserBySingleClick, onValueChanged: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, onValueChange: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == item.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
226
+ let newDynDataListsToBeRefreshed = [];
227
+ for (const item of dynDataListsToBeRefreshed) {
228
+ let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
229
+ if (index >= 0)
230
+ continue;
231
+ newDynDataListsToBeRefreshed.push(item);
232
+ }
233
+ for (const item of ddlToBeRefreshed) {
234
+ if (item.queryParams.length <= 0)
235
+ continue;
236
+ if (!item.mid)
237
+ continue;
238
+ if (item.mid <= 0)
239
+ continue;
240
+ newDynDataListsToBeRefreshed.push(item);
241
+ }
242
+ setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
243
+ }, onCascadeUpdateMIDs: (midsToBeUpdated) => {
244
+ //Attenzione. Il primo elemento di midsToBeUpdated è il currentMID con il new value.
245
+ //nonostante passi prima da onValueChanged, la collection metadata non risulta aggiornata!
246
+ let newMetadata = structuredClone(metadataValues);
247
+ for (const item of midsToBeUpdated) {
248
+ const mdItem = newMetadata.find(value => value.mid === item.mid);
249
+ if (mdItem)
250
+ mdItem.value = item.value;
251
+ }
252
+ onValueChanged?.(newMetadata);
253
+ } }), FormulaHelper.isFormula(item.value)
254
+ ? _jsx(IconFunction, { color: "#1a89d3", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '14px' } })
255
+ : (isEditable(item.mid) || item.isEditable)
256
+ ? _jsx(IconPencil, { color: "#138603", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '16px' } })
257
+ : _jsx(_Fragment, {})] }), showNullValueCheckBoxes &&
258
+ _jsx(TMTooltip, { content: "Imposta <Null>", children: _jsx(IconNull, { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px', opacity: item.md?.isRequired === 1 ? 0.4 : 1 }, cursor: item.md?.isRequired === 1 ? 'default' : 'pointer', color: item.isNull ? TMColors.isModified : TMColors.button_icon, onClick: () => {
259
+ if (item.md?.isRequired === 1)
260
+ return;
261
+ let newValues = structuredClone(metadataValues);
262
+ const mvd = newValues.find(value => value.mid === item.mid);
263
+ if (mvd) {
264
+ mvd.isNull = !mvd.isNull;
265
+ if (mvd.isNull)
266
+ mvd.isSelected = true;
267
+ else
268
+ mvd.isSelected = !stringIsNullOrEmpty(mvd.value);
269
+ }
270
+ onValueChanged?.(newValues);
271
+ } }) }), !isReadOnly && _jsx("div", { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px' }, onClick: () => { handleMetadataValueSelection(item); }, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', color: TMColors.button_icon, borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), disabled: item.isLexProt === 1, items: getAdvancedMenuItems(item) }) })] }, item.mid));
272
+ const layoutWorkItem = () => {
273
+ const workItemData = [];
274
+ const technicalWorkItemData = [];
275
+ const documentData = [];
276
+ metadataValues.forEach(item => {
277
+ switch (item.md?.name) {
278
+ case WorkItemMetadataNames.WI_Description:
279
+ case WorkItemMetadataNames.WI_CreationTime:
280
+ workItemData.push(item);
281
+ break;
282
+ case WorkItemMetadataNames.WI_Response:
283
+ case WorkItemMetadataNames.WI_From:
284
+ case WorkItemMetadataNames.WI_To:
285
+ case WorkItemMetadataNames.WI_WFID:
286
+ case WorkItemMetadataNames.WI_TID:
287
+ case WorkItemMetadataNames.WI_DID:
288
+ technicalWorkItemData.push(item);
289
+ break;
290
+ default:
291
+ // Check if it's another WorkItemMetadataName not explicitly listed
292
+ if (Object.values(WorkItemMetadataNames).includes(item.md?.name)) {
293
+ technicalWorkItemData.push(item);
294
+ }
295
+ else {
296
+ documentData.push(item);
297
+ }
298
+ break;
299
+ }
300
+ });
301
+ return (_jsxs("div", { style: { width: '100%' }, children: [_jsx(TMAccordion, { title: SDKUI_Localizator.DocumentData, children: documentData.map(item => renderMetadataItem(item)) }), _jsx(TMAccordion, { title: SDKUI_Localizator.WorkItemData, children: workItemData.map(item => renderMetadataItem(item, true)) }), _jsx(TMAccordion, { title: SDKUI_Localizator.WorkItemTechnicalData, defaultCollapsed: true, children: technicalWorkItemData.map(item => renderMetadataItem(item, true)) })] }));
302
+ };
215
303
  return (_jsx(StyledMetadataValuesContainer, { children: !TID ?
216
304
  _jsx(TMNothingToShow, { text: 'Nessun documento selezionato.', secondText: 'Metadati di sistema non disponibile.', icon: _jsx(IconDcmtTypeSys, { fontSize: 96 }) }) :
217
- _jsx(_Fragment, { children: metadataValues.map((item) => (_jsxs(StyledRow, { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '6px' : '0', gap: '8px' }, onClick: () => { handleMetadataValueSelection(item); }, onFocus: () => { handleMetadataValueSelection(item); }, children: [showCheckBoxes !== ShowCheckBoxesMode.Never &&
218
- _jsx(TMCheckBox, { elementStyle: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '14px' : '20px' }, value: item.isSelected, disabled: showCheckBoxes === ShowCheckBoxesMode.AlwaysReadOnly, onValueChanged: (newValue) => {
219
- let newValues = structuredClone(metadataValues);
220
- const mvd = newValues.find(value => value.mid === item.mid);
221
- if (mvd)
222
- mvd.isSelected = newValue;
223
- onValueChanged?.(newValues);
224
- } }), _jsxs("div", { style: { position: 'relative', height: '100%', width: '100%', opacity: showNullValueCheckBoxes && item.isNull ? 0.4 : 1 }, children: [_jsx(TMMetadataEditor, { tid: TID, mid: item.mid, layoutMode: layoutMode, isLexProt: item.isLexProt, isSelected: isOpenDistinctValues && item.mid === selectedMID, isModifiedWhen: (item.value ?? '') !== (metadataValuesOrig.find(m => m.mid === item.mid)?.value ?? ''), isReadOnly: showNullValueCheckBoxes ? item.isNull : undefined, isEditable: item.isEditable, validationItems: editorValidationHandler(item.mid ?? 0), value: item.value, openChooserBySingleClick: openChooserBySingleClick, onValueChanged: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, onValueChange: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == item.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
225
- let newDynDataListsToBeRefreshed = [];
226
- for (const item of dynDataListsToBeRefreshed) {
227
- let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
228
- if (index >= 0)
229
- continue;
230
- newDynDataListsToBeRefreshed.push(item);
231
- }
232
- for (const item of ddlToBeRefreshed) {
233
- if (item.queryParams.length <= 0)
234
- continue;
235
- if (!item.mid)
236
- continue;
237
- if (item.mid <= 0)
238
- continue;
239
- newDynDataListsToBeRefreshed.push(item);
240
- }
241
- setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
242
- }, onCascadeUpdateMIDs: (midsToBeUpdated) => {
243
- //Attenzione. Il primo elemento di midsToBeUpdated è il currentMID con il new value.
244
- //nonostante passi prima da onValueChanged, la collection metadata non risulta aggiornata!
245
- let newMetadata = structuredClone(metadataValues);
246
- for (const item of midsToBeUpdated) {
247
- const mdItem = newMetadata.find(value => value.mid === item.mid);
248
- if (mdItem)
249
- mdItem.value = item.value;
250
- }
251
- onValueChanged?.(newMetadata);
252
- } }), FormulaHelper.isFormula(item.value)
253
- ? _jsx(IconFunction, { color: "#1a89d3", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '14px' } })
254
- : (isEditable(item.mid) || item.isEditable)
255
- ? _jsx(IconPencil, { color: "#138603", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '16px' } })
256
- : _jsx(_Fragment, {})] }), showNullValueCheckBoxes &&
257
- _jsx(TMTooltip, { content: "Imposta <Null>", children: _jsx(IconNull, { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px', opacity: item.md?.isRequired === 1 ? 0.4 : 1 }, cursor: item.md?.isRequired === 1 ? 'default' : 'pointer', color: item.isNull ? TMColors.isModified : TMColors.button_icon, onClick: () => {
258
- if (item.md?.isRequired === 1)
259
- return;
260
- let newValues = structuredClone(metadataValues);
261
- const mvd = newValues.find(value => value.mid === item.mid);
262
- if (mvd) {
263
- mvd.isNull = !mvd.isNull;
264
- if (mvd.isNull)
265
- mvd.isSelected = true;
266
- else
267
- mvd.isSelected = !stringIsNullOrEmpty(mvd.value);
268
- }
269
- onValueChanged?.(newValues);
270
- } }) }), !isReadOnly && _jsx("div", { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px' }, onClick: () => { handleMetadataValueSelection(item); }, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', color: TMColors.button_icon, borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), disabled: item.isLexProt === 1, items: getAdvancedMenuItems(item) }) })] }, item.mid))) }) }));
305
+ _jsx(_Fragment, { children: currentDTD?.templateTID === TemplateTIDs.WF_WIApprView ?
306
+ layoutWorkItem() :
307
+ metadataValues.map((item) => renderMetadataItem(item)) }) }));
271
308
  };
272
309
  export default TMMetadataValues;
273
310
  //#region Styled Components
@@ -28,7 +28,7 @@ import TMMasterDetailDcmts from './TMMasterDetailDcmts';
28
28
  import TMDcmtBlog from './TMDcmtBlog';
29
29
  import { useInputAttachmentsDialog } from '../../../hooks/useInputDialog';
30
30
  import TMModal from '../../base/TMModal';
31
- import toppy from '../../../assets/Toppy-generico.png';
31
+ import Toppy from '../../../assets/Toppy-generico.png';
32
32
  import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
33
33
  import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
34
34
  import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
@@ -67,6 +67,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
67
67
  const [dcmtFile, setDcmtFile] = useState(null);
68
68
  const [focusedMetadataValue, setFocusedMetadataValue] = useState();
69
69
  const [showAll, setShowAll] = useState(layoutMode === LayoutModes.Ark);
70
+ const [fetchError, setFetchError] = useState(null);
70
71
  const [workItems, setWorkItems] = useState([]);
71
72
  const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
72
73
  const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
@@ -76,6 +77,11 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
76
77
  const getDcmts = () => { return [{ TID: currentDcmt?.tid, DID: currentDcmt?.did, FILEEXT: currentDcmt?.fileExt }]; };
77
78
  const fetchData = async () => {
78
79
  try {
80
+ setFetchError(null); // reset errore prima del fetch
81
+ if (!TID)
82
+ return;
83
+ if (!DID)
84
+ return;
79
85
  TMSpinner.show({ description: 'Loading Metadata...' });
80
86
  let getMetadataResult;
81
87
  if (layoutMode === LayoutModes.Update)
@@ -93,9 +99,8 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
93
99
  }
94
100
  layoutMode === LayoutModes.Ark && resetHandler();
95
101
  }
96
- catch (e) {
97
- let err = e;
98
- TMExceptionBoxManager.show({ exception: err });
102
+ catch (err) {
103
+ setFetchError(err);
99
104
  }
100
105
  finally {
101
106
  TMSpinner.hide();
@@ -445,6 +450,11 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
445
450
  onClose?.();
446
451
  };
447
452
  const isMobile = deviceType === DeviceType.MOBILE;
453
+ const isApprView = fromDTD?.templateTID === TemplateTIDs.WF_WIApprView;
454
+ useEffect(() => {
455
+ if (isApprView && !showAll)
456
+ setShowAll(true);
457
+ }, [isApprView]);
448
458
  const tmDcmtForm = useMemo(() => _jsx(_Fragment, { children: metadataValuesSource.length > 0 &&
449
459
  _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
450
460
  setFormData((prevItems) => prevItems.map((item) => {
@@ -461,7 +471,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
461
471
  break;
462
472
  }
463
473
  } }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: layoutMode === LayoutModes.Update ? _jsxs(_Fragment, { children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: isModified, formMode: formMode, errorsCount: validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length, onSaveAsync: confirmActionPopup }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: formMode, onUndo: onUndoHandler })] }) :
464
- _jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Archive, advancedColor: TMColors.success, onClick: confirmActionPopup }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Clear, advancedColor: TMColors.tertiary, onClick: clearFormHandler }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: SDKUI_Localizator.Undo, advancedColor: TMColors.tertiary, onClick: onUndoHandler })] }) }) }), totalItems > listMaxItems && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), _jsx(ConfirmAttachmentsDialog, {})] }) }), [TID, DID, formData, formDataOrig, dcmtFile, focusedMetadataValue, isOpenDistinctValues, isOpenFormulaEditor, validationItems, showAll, fileFromConnector]);
474
+ _jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Archive, advancedColor: TMColors.success, onClick: confirmActionPopup }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Clear, advancedColor: TMColors.tertiary, onClick: clearFormHandler }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: SDKUI_Localizator.Undo, advancedColor: TMColors.tertiary, onClick: onUndoHandler })] }) }) }), totalItems > listMaxItems && !isApprView && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), _jsx(ConfirmAttachmentsDialog, {})] }) }), [TID, DID, formData, formDataOrig, dcmtFile, focusedMetadataValue, isOpenDistinctValues, isOpenFormulaEditor, validationItems, showAll, fileFromConnector]);
465
475
  const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID }), [TID, DID]);
466
476
  const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [TID, layoutMode, formData, deviceType]);
467
477
  const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? fileFromConnector, deviceType: deviceType, fromDTD: fromDTD, layoutMode: layoutMode, onFileUpload: (setFile) => {
@@ -595,6 +605,9 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
595
605
  }
596
606
  };
597
607
  const renderDcmtForm = () => {
608
+ if (fetchError) {
609
+ return (_jsxs("div", { style: { color: 'red', padding: 24, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 24 }, children: [_jsx("h2", { children: SDKUI_Localizator.ErrorLoadingDocument }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', color: 'black', background: '#f8d7da', padding: 16, borderRadius: 8, maxWidth: 600, overflowX: 'auto' }, children: JSON.stringify(fetchError, Object.getOwnPropertyNames(fetchError), 2) }), _jsx("img", { src: Toppy, alt: "Errore", style: { width: 120, height: 'auto', marginBottom: 16 } })] }));
610
+ }
598
611
  return (_jsxs("div", { style: {
599
612
  display: 'flex',
600
613
  flexDirection: deviceType === DeviceType.MOBILE ? 'column' : 'row',
@@ -695,7 +708,7 @@ const ToppyImage = styled.img `
695
708
  cursor: ${props => props.$isMobile ? 'pointer' : 'default'};
696
709
  `;
697
710
  export const ToppyHelpCenter = ({ content, onClick, deviceType, top = -220 }) => {
698
- return (_jsxs(ToppyContainer, { children: [_jsx(ToppyImage, { "$isMobile": deviceType === DeviceType.MOBILE, onClick: onClick, src: toppy, alt: "Toppy" }), _jsx("div", { style: { top: deviceType === DeviceType.MOBILE ? -80 : top, right: deviceType === DeviceType.MOBILE ? 40 : 1, transform: 'rotate(20deg)', position: 'absolute', width: 'max-content', height: 'max-content' }, children: content })] }));
711
+ return (_jsxs(ToppyContainer, { children: [_jsx(ToppyImage, { "$isMobile": deviceType === DeviceType.MOBILE, onClick: onClick, src: Toppy, alt: "Toppy" }), _jsx("div", { style: { top: deviceType === DeviceType.MOBILE ? -80 : top, right: deviceType === DeviceType.MOBILE ? 40 : 1, transform: 'rotate(20deg)', position: 'absolute', width: 'max-content', height: 'max-content' }, children: content })] }));
699
712
  };
700
713
  const TMDcmtPreviewWrapper = ({ currentDcmt, layoutMode, fromDTD, dcmtFile, deviceType, isVisible, onFileUpload }) => {
701
714
  const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels } = useTMPanelManagerContext();
@@ -102,19 +102,19 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
102
102
  }
103
103
  } }), children: trees.length > 0
104
104
  ?
105
- _jsxs(TMLayoutContainer, { gap: 20, children: [_jsx(TMLayoutItem, { height: '30px', children: _jsx(DropDownBox, { dropDownOptions: {
106
- resizeEnabled: true,
107
- minWidth: "100%",
108
- height: trees.length <= 10 ? 300 : 500,
109
- maxWidth: "100%"
110
- }, value: selectedTreeId, opened: isGridBoxOpened, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, onOptionChanged: onGridBoxOpened, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
111
- { dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
112
- { dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
113
- ], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsx(StyledTreeListWrapper, { style: { width: "100%", height: "100%" }, children: _jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onSelectionChanged: (e) => {
114
- if (e.selectedRowsData[0] && e.selectedRowsData[0].type == TreeItemTypes.DcmtType) {
115
- onSelectedTIDChanged?.(e.selectedRowsData[0].tid, selectedTreeId);
116
- }
117
- }, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }) }) })] })
105
+ _jsx("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', width: '100%', padding: '10px 5px' }, children: _jsxs(TMLayoutContainer, { gap: 10, children: [_jsx(TMLayoutItem, { height: '30px', children: _jsx(DropDownBox, { dropDownOptions: {
106
+ resizeEnabled: true,
107
+ minWidth: "100%",
108
+ height: trees.length <= 10 ? 300 : 500,
109
+ maxWidth: "100%"
110
+ }, value: selectedTreeId, opened: isGridBoxOpened, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, onOptionChanged: onGridBoxOpened, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
111
+ { dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
112
+ { dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
113
+ ], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsx(StyledTreeListWrapper, { style: { width: "100%", height: "100%" }, children: _jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onSelectionChanged: (e) => {
114
+ if (e.selectedRowsData[0] && e.selectedRowsData[0].type == TreeItemTypes.DcmtType) {
115
+ onSelectedTIDChanged?.(e.selectedRowsData[0].tid, selectedTreeId);
116
+ }
117
+ }, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }) }) })] }) })
118
118
  : _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
119
119
  };
120
120
  export default TMTreeSelector;
@@ -111,6 +111,7 @@ export declare class SDKUI_Localizator {
111
111
  static get DetailsView(): string;
112
112
  static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
113
113
  static get DistinctValues(): "Unterschiedliche Werte" | "Distinct values" | "Valores distintos" | "Valeurs distinctes" | "Valori distinti";
114
+ static get DocumentData(): string;
114
115
  static get DocumentNotAvailable(): string;
115
116
  static get Domain(): "Domäne" | "Domain" | "Dominio" | "Domaine";
116
117
  static get DownloadFile(): string;
@@ -134,6 +135,7 @@ export declare class SDKUI_Localizator {
134
135
  static get EnterNameForAccess(): "Geben Sie einen Namen für den Zugriff ein" | "Enter a name for access" | "Introduzca un nombre para el acceso" | "Entrez un nom pour l'accès" | "Insira um nome para o acesso" | "Inserire un nome per l'accesso";
135
136
  static get EnterValue(): "Geben Sie einen Wert ein" | "Enter a value" | "Introducir un valor" | "Entrez une valeur" | "Digite um valor" | "Inserire un valore";
136
137
  static get Error(): "Fehler" | "Error" | "Erreur" | "Erro" | "Errore";
138
+ static get ErrorLoadingDocument(): string;
137
139
  static get ErrorParsingFileContent(): "Fehler beim Parsen des Dateiinhalts. Stellen Sie sicher, dass die Datei im richtigen Format vorliegt." | "Error parsing the file content. Ensure the file is in the correct format." | "Error al analizar el contenido del archivo. Asegúrese de que el archivo esté en el formato correcto." | "Erreur lors de l'analyse du contenu du fichier. Assurez-vous que le fichier est dans le bon format." | "Erro ao analisar o conteúdo do arquivo. Certifique-se de que o arquivo está no formato correto." | "Errore durante l'analisi del contenuto del file. Assicurati che il file sia nel formato corretto.";
138
140
  static get ExtractedBy(): "Ausgezogen von" | "Extracted by" | "Extraído por" | "Extrait par" | "Estratto da";
139
141
  static get ExtractedFromOtherUser(): string;
@@ -463,6 +465,8 @@ export declare class SDKUI_Localizator {
463
465
  static get WorkGroup(): "Arbeitsgruppe" | "Work Group" | "Grupo de Trabajo" | "Groupe de travail" | "Grupo de Trabalho" | "Gruppo di lavoro";
464
466
  static get WorkgroupArchivedDocuments(): string;
465
467
  static get WorkgroupDrafts(): string;
468
+ static get WorkItemData(): string;
469
+ static get WorkItemTechnicalData(): string;
466
470
  static get WrittenOn(): "Geschrieben am" | "Written on" | "Escrito el" | "Écrit le" | "Escrito em" | "Scritto il";
467
471
  static get Yes(): "Ja" | "Yes" | "Sí" | "Oui" | "Sim" | "Sì";
468
472
  }
@@ -1059,6 +1059,16 @@ export class SDKUI_Localizator {
1059
1059
  default: return "Valori distinti";
1060
1060
  }
1061
1061
  }
1062
+ static get DocumentData() {
1063
+ switch (this._cultureID) {
1064
+ case CultureIDs.De_DE: return "Dokumentendaten";
1065
+ case CultureIDs.En_US: return "Document Data";
1066
+ case CultureIDs.Es_ES: return "Datos del Documento";
1067
+ case CultureIDs.Fr_FR: return "Données du Document";
1068
+ case CultureIDs.Pt_PT: return "Dados do Documento";
1069
+ default: return "Dati del documento";
1070
+ }
1071
+ }
1062
1072
  static get DocumentNotAvailable() {
1063
1073
  switch (this._cultureID) {
1064
1074
  case CultureIDs.De_DE: return "Dokument nicht verfügbar";
@@ -1301,6 +1311,16 @@ export class SDKUI_Localizator {
1301
1311
  default: return "Errore";
1302
1312
  }
1303
1313
  }
1314
+ static get ErrorLoadingDocument() {
1315
+ switch (this._cultureID) {
1316
+ case CultureIDs.De_DE: return "Fehler beim Laden des Dokuments";
1317
+ case CultureIDs.En_US: return "Error loading document";
1318
+ case CultureIDs.Es_ES: return "Error al cargar el documento";
1319
+ case CultureIDs.Fr_FR: return "Erreur lors du chargement du document";
1320
+ case CultureIDs.Pt_PT: return "Erro ao carregar o documento";
1321
+ default: return "Errore durante il caricamento del documento";
1322
+ }
1323
+ }
1304
1324
  static get ErrorParsingFileContent() {
1305
1325
  switch (this._cultureID) {
1306
1326
  case CultureIDs.De_DE: return "Fehler beim Parsen des Dateiinhalts. Stellen Sie sicher, dass die Datei im richtigen Format vorliegt.";
@@ -4588,6 +4608,26 @@ export class SDKUI_Localizator {
4588
4608
  default: return "Gruppo di lavoro - Bozze";
4589
4609
  }
4590
4610
  }
4611
+ static get WorkItemData() {
4612
+ switch (this._cultureID) {
4613
+ case CultureIDs.De_DE: return "Arbeitsaufgabendaten";
4614
+ case CultureIDs.En_US: return "Work Item Data";
4615
+ case CultureIDs.Es_ES: return "Datos del Elemento de Trabajo";
4616
+ case CultureIDs.Fr_FR: return "Données de l'Élément de Travail";
4617
+ case CultureIDs.Pt_PT: return "Dados do Item de Trabalho";
4618
+ default: return "Dati del WorkItem"; // Italian (default)
4619
+ }
4620
+ }
4621
+ static get WorkItemTechnicalData() {
4622
+ switch (this._cultureID) {
4623
+ case CultureIDs.De_DE: return "Technische Arbeitsaufgabendaten";
4624
+ case CultureIDs.En_US: return "Technical Work Item Data";
4625
+ case CultureIDs.Es_ES: return "Datos Técnicos del Elemento de Trabajo";
4626
+ case CultureIDs.Fr_FR: return "Données Techniques de l'Élément de Travail";
4627
+ case CultureIDs.Pt_PT: return "Dados Técnicos do Item de Trabalho";
4628
+ default: return "Dati tecnici del WorkItem"; // Italian (default)
4629
+ }
4630
+ }
4591
4631
  static get WrittenOn() {
4592
4632
  switch (this._cultureID) {
4593
4633
  case CultureIDs.De_DE: return "Geschrieben am";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.14.71",
3
+ "version": "6.14.72",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -42,7 +42,7 @@
42
42
  "lib"
43
43
  ],
44
44
  "dependencies": {
45
- "@topconsultnpm/sdk-ts-beta": "6.14.15",
45
+ "@topconsultnpm/sdk-ts-beta": "6.14.16",
46
46
  "buffer": "^6.0.3",
47
47
  "devextreme": "24.2.6",
48
48
  "devextreme-react": "24.2.6",