@topconsultnpm/sdkui-react 6.19.0-dev2.9 → 6.19.0-test2

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 (97) hide show
  1. package/lib/components/base/TMAccordionNew.d.ts +28 -0
  2. package/lib/components/base/TMAccordionNew.js +326 -0
  3. package/lib/components/base/TMButton.d.ts +1 -0
  4. package/lib/components/base/TMButton.js +6 -6
  5. package/lib/components/base/TMCustomButton.d.ts +1 -1
  6. package/lib/components/base/TMCustomButton.js +83 -28
  7. package/lib/components/base/TMDataGridExportForm.js +9 -3
  8. package/lib/components/base/TMFileManager.js +11 -2
  9. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
  10. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  11. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
  12. package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
  13. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
  14. package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
  15. package/lib/components/base/TMModal.d.ts +2 -0
  16. package/lib/components/base/TMModal.js +48 -3
  17. package/lib/components/base/TMPopUp.js +74 -5
  18. package/lib/components/base/TMWaitPanel.js +8 -2
  19. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  20. package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
  21. package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
  22. package/lib/components/choosers/TMMetadataChooser.js +31 -8
  23. package/lib/components/choosers/TMUserChooser.d.ts +4 -0
  24. package/lib/components/choosers/TMUserChooser.js +21 -5
  25. package/lib/components/editors/TMMetadataValues.js +45 -4
  26. package/lib/components/editors/TMTextArea.d.ts +1 -0
  27. package/lib/components/editors/TMTextArea.js +44 -10
  28. package/lib/components/editors/TMTextBox.js +34 -4
  29. package/lib/components/editors/TMTextExpression.js +36 -28
  30. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
  31. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
  32. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
  33. package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
  34. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
  35. package/lib/components/features/blog/TMBlogCommentForm.js +18 -6
  36. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  37. package/lib/components/features/documents/TMDcmtForm.js +290 -31
  38. package/lib/components/features/documents/TMDcmtIcon.js +9 -4
  39. package/lib/components/features/documents/TMDcmtPreview.js +45 -8
  40. package/lib/components/features/documents/TMRelationViewer.js +55 -22
  41. package/lib/components/features/search/TMSearch.js +2 -2
  42. package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
  43. package/lib/components/features/search/TMSearchQueryPanel.js +10 -28
  44. package/lib/components/features/search/TMSearchResult.js +102 -33
  45. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
  46. package/lib/components/features/search/TMSearchResultsMenuItems.js +67 -28
  47. package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
  48. package/lib/components/features/search/TMSignSettingsForm.js +621 -0
  49. package/lib/components/features/tasks/TMTaskForm.js +10 -4
  50. package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
  51. package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
  52. package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -0
  53. package/lib/components/features/tasks/TMTasksUtils.js +17 -2
  54. package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
  55. package/lib/components/features/tasks/TMTasksView.js +11 -5
  56. package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
  57. package/lib/components/features/workflow/diagram/WFDiagram.js +19 -1
  58. package/lib/components/forms/TMSaveForm.js +3 -11
  59. package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
  60. package/lib/components/grids/TMBlogAttachments.js +10 -5
  61. package/lib/components/grids/TMBlogsPost.d.ts +8 -3
  62. package/lib/components/grids/TMBlogsPost.js +100 -39
  63. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  64. package/lib/components/grids/TMBlogsPostUtils.js +27 -6
  65. package/lib/components/index.d.ts +2 -1
  66. package/lib/components/index.js +2 -1
  67. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  68. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
  69. package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
  70. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
  71. package/lib/components/layout/panelManager/types.d.ts +1 -0
  72. package/lib/components/settings/SettingsAppearance.js +5 -5
  73. package/lib/helper/GlobalStyles.d.ts +2 -0
  74. package/lib/helper/GlobalStyles.js +10 -0
  75. package/lib/helper/Globalization.d.ts +1 -0
  76. package/lib/helper/Globalization.js +30 -0
  77. package/lib/helper/SDKUI_Localizator.d.ts +41 -1
  78. package/lib/helper/SDKUI_Localizator.js +410 -10
  79. package/lib/helper/TMIcons.d.ts +4 -1
  80. package/lib/helper/TMIcons.js +13 -1
  81. package/lib/helper/TMToppyMessage.d.ts +1 -0
  82. package/lib/helper/TMToppyMessage.js +4 -3
  83. package/lib/helper/TMUtils.d.ts +42 -4
  84. package/lib/helper/TMUtils.js +190 -23
  85. package/lib/helper/dcmtsHelper.d.ts +2 -1
  86. package/lib/helper/dcmtsHelper.js +56 -17
  87. package/lib/helper/helpers.d.ts +1 -1
  88. package/lib/helper/helpers.js +12 -17
  89. package/lib/helper/index.d.ts +1 -0
  90. package/lib/helper/index.js +1 -0
  91. package/lib/hooks/useDcmtOperations.d.ts +1 -1
  92. package/lib/hooks/useDcmtOperations.js +10 -6
  93. package/lib/hooks/useRelatedDocuments.js +35 -26
  94. package/lib/ts/types.d.ts +2 -0
  95. package/package.json +8 -8
  96. package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
  97. package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts';
4
- import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels } from '../../helper';
4
+ import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
5
5
  import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipSeparatorItem } from '../base/Styled';
6
6
  import TMSpinner from '../base/TMSpinner';
7
7
  import TMTooltip from '../base/TMTooltip';
@@ -9,7 +9,8 @@ import TMSummary from '../editors/TMSummary';
9
9
  import TMChooserForm from '../forms/TMChooserForm';
10
10
  import { TMColors } from '../../utils/theme';
11
11
  import { TMExceptionBoxManager } from '../base/TMPopUp';
12
- const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false }) => {
12
+ import TMButton from '../base/TMButton';
13
+ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false }) => {
13
14
  const [showChooser, setShowChooser] = useState(initialShowChooser);
14
15
  useEffect(() => {
15
16
  setShowChooser(initialShowChooser);
@@ -20,13 +21,15 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
20
21
  return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true, noneSelectionText: '' }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
21
22
  };
22
23
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, width: width, disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
23
- _jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => {
24
+ _jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
24
25
  setShowChooser(false);
25
26
  summaryInputRef.current?.focus();
26
27
  }, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
27
28
  };
28
29
  export default TMUserChooser;
29
- export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
30
+ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false }) => {
31
+ const [currentDataSource, setCurrentDataSource] = useState(dataSource);
32
+ const [showingAllUsers, setShowingAllUsers] = useState(false);
30
33
  const dataColumns = useMemo(() => {
31
34
  return [
32
35
  { dataField: 'domain', caption: SDKUI_Localizator.Domain, dataType: 'string' },
@@ -42,6 +45,18 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
42
45
  TMSpinner.hide();
43
46
  return users;
44
47
  };
48
+ const handleToggleAllUsers = () => {
49
+ if (showingAllUsers) {
50
+ // Torna indietro: ripristina il dataSource originale
51
+ setCurrentDataSource(dataSource);
52
+ setShowingAllUsers(false);
53
+ }
54
+ else {
55
+ // Mostra tutti: rimuove il dataSource per usare getItems
56
+ setCurrentDataSource(undefined);
57
+ setShowingAllUsers(true);
58
+ }
59
+ };
45
60
  const getTitle = () => {
46
61
  let title = SDK_Localizator.Users;
47
62
  if (title)
@@ -49,7 +64,8 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
49
64
  return title;
50
65
  };
51
66
  const cellRenderIcon = (data) => _jsx(TMUserIcon, { ud: data.data });
52
- return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: dataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
67
+ const customButton = (allowShowAllUsers && dataSource) ? (_jsx(TMButton, { btnStyle: 'toolbar', caption: showingAllUsers ? SDKUI_Localizator.HideAll : SDKUI_Localizator.ShowAll, onClick: handleToggleAllUsers, icon: showingAllUsers ? _jsx(IconShowAllUsersOff, {}) : _jsx(IconShowAllUsers, {}) })) : undefined;
68
+ return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: currentDataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, customButtons: customButton, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
53
69
  };
54
70
  export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
55
71
  const [ud, setUd] = useState();
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import styled from "styled-components";
4
- import { AccessLevels, DcmtTypeListCacheService, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, TemplateTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
4
+ import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, TemplateTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
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";
@@ -13,6 +13,7 @@ import { FormulaHelper } from "./TMFormulaEditor";
13
13
  import { DraftsMIDs, DSAttachsMIDs } from "../../ts";
14
14
  import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
15
15
  import TMAccordion from "../base/TMAccordion";
16
+ import TabPanel, { Item } from 'devextreme-react/tab-panel';
16
17
  export var ShowCheckBoxesMode;
17
18
  (function (ShowCheckBoxesMode) {
18
19
  ShowCheckBoxesMode[ShowCheckBoxesMode["Never"] = 0] = "Never";
@@ -33,6 +34,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
33
34
  const [selectedItem, setSelectedItem] = useState(undefined);
34
35
  const [prevMetadataValues, setPrevMetadataValues] = useState([]);
35
36
  const [inputMidsApplied, setInputMidsApplied] = useState(false);
37
+ const [selectedIndex, setSelectedIndex] = useState(0);
36
38
  const onChangeHandler = useCallback((newValue, mid) => {
37
39
  let newValues = structuredClone(metadataValues);
38
40
  const item = newValues.find(value => value.mid === mid);
@@ -440,17 +442,49 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
440
442
  // Check if this is a LayoutRoot - just render its children
441
443
  if (layoutItem.type === LayoutItemTypes.LayoutRoot) {
442
444
  const children = getChildren(layoutItem.layoutItemID);
443
- return (_jsx(React.Fragment, { children: children.map(child => renderLayoutItem(child, depth, visited)) }, `root-${layoutItem.layoutItemID}`));
445
+ if (layout.showTab) {
446
+ return (_jsx(React.Fragment, { children: _jsx(TabPanel, { width: "100%", height: "100%", children: children.map(child => renderLayoutItem(child, depth, visited)) }) }, `root-${layoutItem.layoutItemID}`));
447
+ }
448
+ else {
449
+ return (_jsx(React.Fragment, { children: children.map(child => renderLayoutItem(child, depth, visited)) }, `root-${layoutItem.layoutItemID}`));
450
+ }
444
451
  }
445
452
  // Check if this is a LayoutGroup
446
453
  else if (layoutItem.type === LayoutItemTypes.LayoutGroup && layoutItem.lgd) {
447
454
  const children = getChildren(layoutItem.layoutItemID);
448
455
  const groupDescriptor = layoutItem.lgd;
449
456
  const groupTitle = groupDescriptor.caption || `Group ${layoutItem.layoutItemID}`;
457
+ const groupIsNoBorder = groupDescriptor.borderStyle == undefined || groupDescriptor.borderStyle == LayoutGroupBorderStyles.NoBorder || groupDescriptor.borderStyle == LayoutGroupBorderStyles.None;
450
458
  const isCollapsed = false; // LayoutGroupDescriptor doesn't have collapsed property
459
+ //Layout Grou da trasformare in tab
460
+ if (groupDescriptor.orientation == LayoutGroupOrientations.Vertical && layout.showTab && layoutItem.parentID === 0) {
461
+ return (_jsx(Item, { title: groupTitle, children: _jsx("div", { style: { width: '100%' }, children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }) }, `group-tab-${layoutItem.layoutItemID}`));
462
+ }
463
+ if (groupIsNoBorder && groupDescriptor.orientation !== LayoutGroupOrientations.Horizontal && children.length == 0) {
464
+ return (_jsx("br", {}));
465
+ }
466
+ if (groupIsNoBorder && groupDescriptor.orientation === LayoutGroupOrientations.Vertical) {
467
+ return (_jsx("div", { style: { width: '100%', border: 'none', padding: 0 }, children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }));
468
+ }
469
+ if (!groupIsNoBorder && groupDescriptor.orientation === LayoutGroupOrientations.Vertical) {
470
+ if (groupDescriptor.borderStyle == LayoutGroupBorderStyles.Group) {
471
+ return (_jsxs("div", { style: { position: 'relative', border: '2px solid #CAD9EB', borderRadius: '3px', padding: '12px 6px 6px', margin: '10px', display: 'flex', flexDirection: 'column', flexWrap: 'wrap', gap: '3px', }, children: [_jsx("div", { style: { position: 'absolute', top: '-10px', left: '10px', padding: '0 8px', backgroundColor: '#fff', fontWeight: 600, fontSize: '1rem', color: TMColors.primaryColor, }, children: groupTitle }), children.map(child => renderLayoutItem(child, depth + 1, visited))] }));
472
+ }
473
+ if (groupDescriptor.borderStyle == LayoutGroupBorderStyles.GroupBox || groupDescriptor.borderStyle == LayoutGroupBorderStyles.Tabbed) {
474
+ return (_jsx(TMAccordion, { title: groupTitle, titleSize: "Small", children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }));
475
+ }
476
+ }
477
+ if (groupDescriptor.orientation === LayoutGroupOrientations.Horizontal) {
478
+ return (_jsx("div", { style: { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', gap: '3px' }, children: groupDescriptor.borderStyle == LayoutGroupBorderStyles.GroupBox || groupDescriptor.borderStyle == LayoutGroupBorderStyles.Tabbed ?
479
+ _jsx(TMAccordion, { title: groupTitle, titleSize: "Small", children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }) :
480
+ groupDescriptor.borderStyle == LayoutGroupBorderStyles.Group ?
481
+ _jsxs("div", { style: { position: 'relative', border: '2px solid #CAD9EB', borderRadius: '3px', padding: '12px 6px 6px', margin: '10px', display: 'flex', flexDirection: 'column', flexWrap: 'wrap', gap: '3px', }, children: [_jsx("div", { style: { position: 'absolute', top: '-10px', left: '10px', padding: '0 8px', backgroundColor: '#fff', fontWeight: 600, fontSize: '1rem', color: TMColors.primaryColor, }, children: groupTitle }), children.map(child => (_jsx("div", { style: { flex: '1 1 0', minWidth: 0 }, children: renderLayoutItem(child, depth + 1, visited) }, child.layoutItemID)))] })
482
+ :
483
+ children.map(child => (_jsx("div", { style: { flex: '1 1 0', minWidth: 0 }, children: renderLayoutItem(child, depth + 1, visited) }, child.layoutItemID))) }, `group-horizontal-${layoutItem.layoutItemID}`));
484
+ }
451
485
  // Apply indentation only to subgroups (depth > 0), not to root groups
452
486
  const indentationPx = depth > 0 ? depth * 10 : 0;
453
- return (_jsx("div", { style: { paddingLeft: `${indentationPx}px` }, children: _jsx(TMAccordion, { title: groupTitle, defaultCollapsed: isCollapsed, children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }) }, `group-wrapper-${layoutItem.layoutItemID}`));
487
+ return (_jsx("div", { style: { paddingLeft: `${indentationPx}px` }, children: _jsx(TMAccordion, { title: groupTitle, defaultCollapsed: isCollapsed, titleSize: "Small", children: children.map(child => renderLayoutItem(child, depth + 1, visited)) }) }, `group-wrapper-${layoutItem.layoutItemID}`));
454
488
  }
455
489
  // Check if this is a LayoutControlItem (metadata field)
456
490
  else if (layoutItem.type === LayoutItemTypes.LayoutControlItem && layoutItem.lcid) {
@@ -458,12 +492,19 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
458
492
  const mid = controlDescriptor.mid;
459
493
  if (!mid)
460
494
  return null;
495
+ let isAccordion = true;
496
+ const parent = layout.items?.filter(p => p.layoutItemID === layoutItem.parentID);
497
+ if (parent && parent.length > 0 && parent[0].type === LayoutItemTypes.LayoutGroup && parent[0].lgd) {
498
+ const groupDescriptor = parent[0].lgd;
499
+ if (groupDescriptor.borderStyle == LayoutGroupBorderStyles.Group)
500
+ isAccordion = false;
501
+ }
461
502
  // Find the metadata value for this MID
462
503
  const metadataItem = metadataValues.find(m => m.mid === mid);
463
504
  if (!metadataItem)
464
505
  return null;
465
506
  // Indent control items based on depth so they align under groups
466
- const controlIndentPx = depth > 0 ? depth * 10 : 15;
507
+ const controlIndentPx = !isAccordion ? 3 : isAccordion && depth > 0 ? depth * 10 : 15;
467
508
  return (_jsx("div", { style: { paddingLeft: `${controlIndentPx}px` }, children: renderMetadataItem(metadataItem) }, `control-${layoutItem.layoutItemID}`));
468
509
  }
469
510
  // Check if this is a SeparatorItem (horizontal line)
@@ -12,6 +12,7 @@ interface ITMTextArea extends ITMEditorBase {
12
12
  rows?: number;
13
13
  maxLength?: number;
14
14
  resize?: boolean;
15
+ autoCalculateRows?: boolean;
15
16
  }
16
17
  declare const TMTextArea: React.FunctionComponent<ITMTextArea>;
17
18
  export default TMTextArea;
@@ -1,4 +1,4 @@
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 { useState, useEffect, useRef } from 'react';
3
3
  import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
4
4
  import { FontSize, TMColors } from '../../utils/theme';
@@ -8,8 +8,10 @@ import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
8
8
  import TMVilViewer from '../base/TMVilViewer';
9
9
  import TMTooltip from '../base/TMTooltip';
10
10
  import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
11
- import { IconClearButton } from '../../helper';
11
+ import { IconClearButton, IconDataList, SDKUI_Localizator } from '../../helper';
12
12
  import styled from 'styled-components';
13
+ import { FormulaItemHelper } from './TMTextExpression';
14
+ import TMChooserForm from '../forms/TMChooserForm';
13
15
  const StyledTextAreaEditorButton = styled.div `
14
16
  color: ${TMColors.button_icon};
15
17
  display: flex;
@@ -26,7 +28,7 @@ const StyledTextAreaEditorButton = styled.div `
26
28
  // Define the TMTextArea component
27
29
  const TMTextArea = (props) => {
28
30
  // Extract properties from the props object
29
- const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true } = props;
31
+ const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true, autoCalculateRows = true } = props;
30
32
  // Reference to the textarea DOM element
31
33
  const inputRef = useRef(null);
32
34
  // Stores the textarea is focused
@@ -37,11 +39,15 @@ const TMTextArea = (props) => {
37
39
  const [formulaMenuItems, setFormulaMenuItems] = useState([]);
38
40
  // Stores the calculated number of rows for the textarea
39
41
  const [calculatedRows, setCalculatedRows] = useState(rows ?? 1);
42
+ //Show chooserForm formulaItems
43
+ const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
40
44
  // Manages the state for the custom context menu
41
45
  const { clicked, setClicked, points, setPoints } = useContextMenu();
42
46
  const deviceType = useDeviceType();
43
47
  // Attach a `ResizeObserver` to the textarea to monitor changes in width: dynamically updates rows based on textarea content and width
44
48
  useEffect(() => {
49
+ if (!autoCalculateRows)
50
+ return;
45
51
  const observer = new ResizeObserver(() => { if (currentValue) {
46
52
  updateRows();
47
53
  } });
@@ -51,18 +57,18 @@ const TMTextArea = (props) => {
51
57
  return () => { if (inputRef.current) {
52
58
  observer.unobserve(inputRef.current);
53
59
  } };
54
- }, [currentValue]);
60
+ }, [currentValue, autoCalculateRows]);
55
61
  // Update current value whenever the `value` prop changes, synchronize the internal state with the `value` prop
56
62
  useEffect(() => {
57
63
  setCurrentValue(value);
58
64
  }, [value]);
59
65
  // Recalculate the number of rows whenever the `currentValue` changes
60
66
  useEffect(() => {
61
- if (currentValue) {
67
+ if (autoCalculateRows && currentValue) {
62
68
  const newRowCount = calculateRows(currentValue);
63
69
  setCalculatedRows(newRowCount);
64
70
  }
65
- }, [currentValue]);
71
+ }, [currentValue, autoCalculateRows]);
66
72
  // Populate the formula menu items whenever the `formulaItems` prop changes
67
73
  useEffect(() => {
68
74
  if (formulaItems && formulaItems.length > 0) {
@@ -73,6 +79,30 @@ const TMTextArea = (props) => {
73
79
  setFormulaMenuItems(menuItems);
74
80
  }
75
81
  }, [formulaItems]);
82
+ function getFormulaDataSorce() {
83
+ let fiarray = [];
84
+ if (!formulaItems)
85
+ return [];
86
+ let i = 0;
87
+ for (const f of formulaItems) {
88
+ let fi = new FormulaItemHelper();
89
+ fi.id = i;
90
+ fi.paramName = f;
91
+ fiarray.push(fi);
92
+ i++;
93
+ }
94
+ return fiarray;
95
+ }
96
+ const openFormulaItemsChooser = () => {
97
+ return (showFormulaItemsChooser ?
98
+ _jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
99
+ { dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
100
+ ], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
101
+ let expr = value?.toString() ?? '';
102
+ IDs.map(i => expr += formulaItems[i]);
103
+ onValueChanged?.({ target: { value: expr } });
104
+ } }) : _jsx(_Fragment, {}));
105
+ };
76
106
  // Adjust the rows dynamically
77
107
  const updateRows = () => {
78
108
  const newRowCount = calculateRows(currentValue);
@@ -123,7 +153,7 @@ const TMTextArea = (props) => {
123
153
  };
124
154
  // Renders the textarea
125
155
  const renderTextArea = () => {
126
- return _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
156
+ return _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
127
157
  onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, onContextMenu: (e) => {
128
158
  if (formulaItems.length <= 0)
129
159
  return;
@@ -136,15 +166,19 @@ const TMTextArea = (props) => {
136
166
  const y = e.clientY - bounds.top;
137
167
  // set the x and y coordinates of our users right click
138
168
  setPoints({ x, y });
139
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
169
+ }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
170
+ _jsx(StyledTextAreaEditorButton, { onClick: () => {
171
+ setShowFormulaItemsChooser(true);
172
+ }, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
140
173
  _jsx(StyledTextAreaEditorButton, { onClick: () => {
141
174
  onValueChanged?.({ target: { value: undefined } });
142
175
  setCurrentValue('');
143
- setCalculatedRows(1);
176
+ if (autoCalculateRows)
177
+ setCalculatedRows(1);
144
178
  onBlur?.(undefined);
145
179
  }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
146
180
  return (_jsx(StyledTextAreaEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
147
- })] }), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
181
+ })] }), openFormulaItemsChooser(), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
148
182
  };
149
183
  // Layout for the textarea with a left-aligned label
150
184
  const renderedLeftLabelTextArea = () => {
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
5
5
  import { FontSize, TMColors } from '../../utils/theme';
6
- import { genUniqueId, IconClearButton, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
6
+ import { genUniqueId, IconClearButton, IconDataList, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
7
7
  import ShowAlert from '../base/TMAlert';
8
8
  import { TMExceptionBoxManager } from '../base/TMPopUp';
9
9
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
@@ -11,6 +11,8 @@ import TMVilViewer from '../base/TMVilViewer';
11
11
  import TMTooltip from '../base/TMTooltip';
12
12
  import { ContextMenu } from 'devextreme-react';
13
13
  import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
14
+ import TMChooserForm from '../forms/TMChooserForm';
15
+ import { FormulaItemHelper } from './TMTextExpression';
14
16
  const StyledShowPasswordIcon = styled.div `
15
17
  color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? TMColors.text_normal : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
16
18
  position: absolute;
@@ -37,6 +39,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
37
39
  const [currentType, setCurrentType] = useState(type);
38
40
  const [currentValue, setCurrentValue] = useState(value);
39
41
  const [formulaMenuItems, setFormulaMenuItems] = useState([]);
42
+ const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
40
43
  const [isFocused, setIsFocused] = useState(false);
41
44
  const inputRef = useRef(null);
42
45
  const deviceType = useDeviceType();
@@ -219,6 +222,30 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
219
222
  setCurrentValue(inputValue);
220
223
  onValueChanged?.({ target: { value: inputValue } }); // Passa il valore filtrato
221
224
  };
225
+ function getFormulaDataSorce() {
226
+ let fiarray = [];
227
+ if (!formulaItems)
228
+ return [];
229
+ let i = 0;
230
+ for (const f of formulaItems) {
231
+ let fi = new FormulaItemHelper();
232
+ fi.id = i;
233
+ fi.paramName = f;
234
+ fiarray.push(fi);
235
+ i++;
236
+ }
237
+ return fiarray;
238
+ }
239
+ const openFormulaItemsChooser = () => {
240
+ return (showFormulaItemsChooser ?
241
+ _jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
242
+ { dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
243
+ ], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
244
+ let expr = value?.toString() ?? '';
245
+ IDs.map(i => expr += formulaItems[i]);
246
+ onValueChanged?.({ target: { value: expr } });
247
+ } }) : _jsx(_Fragment, {}));
248
+ };
222
249
  const renderInputField = () => {
223
250
  const bulletEntity = '\u2022'; // &#8226;
224
251
  const displayedValue = initialType === 'secureText'
@@ -226,20 +253,23 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
226
253
  ? bulletEntity.repeat(currentValue?.length ?? 0)
227
254
  : currentValue ?? '')
228
255
  : currentValue ?? '';
229
- return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
256
+ return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
230
257
  onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
231
258
  if (currentType === 'number') {
232
259
  if (!scale && (e.key == "." || e.key == ","))
233
260
  e.preventDefault();
234
261
  }
235
262
  }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
236
- _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
263
+ _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '3px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
264
+ _jsx(StyledTextBoxEditorButton, { onClick: () => {
265
+ setShowFormulaItemsChooser(true);
266
+ }, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
237
267
  _jsx(StyledTextBoxEditorButton, { onClick: () => {
238
268
  onValueChanged?.({ target: { value: undefined } });
239
269
  onBlur?.(undefined);
240
270
  }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
241
271
  return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
242
- })] }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
272
+ })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
243
273
  };
244
274
  const renderedLeftLabelTextBox = () => {
245
275
  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()] }) })] }));
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from 'react';
3
3
  import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
4
- import { IconClear, IconColumns, IconDataList, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
4
+ import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
5
5
  import { TMExceptionBoxManager } from '../base/TMPopUp';
6
6
  import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
7
- import TMChooserForm from '../forms/TMChooserForm';
8
7
  import TMTextBox from './TMTextBox';
9
8
  import TMTextArea from './TMTextArea';
10
9
  const TMTextExpression = (props) => {
@@ -96,8 +95,7 @@ const TMTextExpression = (props) => {
96
95
  let buttons = [];
97
96
  if (props.qd || props.tid)
98
97
  buttons.push({ icon: _jsx(IconColumns, {}), text: SDKUI_Localizator.MetadataReferenceInsert, onClick: () => { setShowMetadataChooser(true); } });
99
- if (props.formulaItems && props.formulaItems.length > 0)
100
- buttons.push({ icon: _jsx(IconDataList, {}), text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) });
98
+ // if (props.formulaItems && props.formulaItems.length > 0) buttons.push({ icon: <IconDataList />, text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) })
101
99
  buttons.push({ icon: _jsx(IconClear, {}), text: SDKUI_Localizator.Clear, onClick: () => props.onValueChanged?.('') });
102
100
  return buttons;
103
101
  };
@@ -120,20 +118,18 @@ const TMTextExpression = (props) => {
120
118
  }
121
119
  return output;
122
120
  }
123
- function getFormulaDataSorce() {
124
- let fiarray = [];
125
- if (!props.formulaItems)
126
- return [];
127
- let i = 0;
128
- for (const f of props.formulaItems) {
129
- let fi = new FormulaItemHelper();
130
- fi.id = i;
131
- fi.paramName = f;
132
- fiarray.push(fi);
133
- i++;
134
- }
135
- return fiarray;
136
- }
121
+ // function getFormulaDataSorce() {
122
+ // let fiarray: FormulaItemHelper[] = []
123
+ // if (!props.formulaItems) return []
124
+ // let i: number = 0;
125
+ // for (const f of props.formulaItems!) {
126
+ // let fi = new FormulaItemHelper();
127
+ // fi.id = i; fi.paramName = f;
128
+ // fiarray.push(fi);
129
+ // i++;
130
+ // }
131
+ // return fiarray;
132
+ // }
137
133
  const openMetadataChooseForm = () => {
138
134
  return (showMetadataChooser ?
139
135
  _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, qd: props.qd, tids: props.tid ? [props.tid] : undefined, qdShowOnlySelectItems: true, allowSysMetadata: true, onClose: () => setShowMetadataChooser(false), onChoose: (tid_mid) => {
@@ -146,18 +142,30 @@ const TMTextExpression = (props) => {
146
142
  { dataField: 'paramName', caption: props.captionColumnChooser ?? SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
147
143
  ];
148
144
  }, []);
149
- const openFormulaChooseForm = () => {
150
- return (showFormulaChooser ?
151
- _jsx(TMChooserForm, { title: props.titleChooser ?? SDKUI_Localizator.Parameters, height: props.higthChooser ?? '350', width: props.widthChooser ?? '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: props.disableMultipleSelection !== true, columns: dataColumns, dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaChooser(false); }, onChoose: (IDs) => {
152
- let expr = props.value ?? '';
153
- IDs.map(i => expr += props.formulaItems[i]);
154
- props.onValueChanged?.(expr);
155
- } }) : _jsx(_Fragment, {}));
156
- };
145
+ // const openFormulaChooseForm = () => {
146
+ // return (showFormulaChooser ?
147
+ // <TMChooserForm
148
+ // title={props.titleChooser ?? SDKUI_Localizator.Parameters}
149
+ // height={props.higthChooser ?? '350'}
150
+ // width={props.widthChooser ?? '300'}
151
+ // hasShowId={false}
152
+ // showDefaultColumns={false}
153
+ // allowMultipleSelection={props.disableMultipleSelection !== true}
154
+ // columns={dataColumns}
155
+ // dataSource={getFormulaDataSorce()}
156
+ // onClose={() => { setShowFormulaChooser(false); }}
157
+ // onChoose={(IDs: number[]) => {
158
+ // let expr: string = props.value ?? '';
159
+ // IDs.map(i => expr += props.formulaItems![i]);
160
+ // props.onValueChanged?.(expr)
161
+ // }}
162
+ // /> : <></>
163
+ // )
164
+ // }
157
165
  return (_jsxs(_Fragment, { children: [props.rows === undefined ?
158
- _jsx(TMTextBox, { buttons: renderButtons(), isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
166
+ _jsx(TMTextBox, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
159
167
  :
160
- _jsx(TMTextArea, { buttons: renderButtons(), isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " ", openFormulaChooseForm()] }));
168
+ _jsx(TMTextArea, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " "] }));
161
169
  };
162
170
  class MetatadaHelper {
163
171
  constructor(mid, metadataName) {
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { DeviceType } from '../../base/TMDeviceProvider';
3
+ /**
4
+ * Proprietà del componente ToppyDraggableHelpCenter
5
+ */
6
+ interface ToppyDraggableHelpCenterProps {
7
+ /** Contenuto da visualizzare nella speech bubble */
8
+ content?: React.ReactNode;
9
+ /** Tipo di dispositivo per adattare il comportamento */
10
+ deviceType?: DeviceType;
11
+ /** Allineamento iniziale del componente (destra o sinistra) */
12
+ align?: 'right' | 'left';
13
+ /** Stato iniziale collassato/espanso */
14
+ initialIsCollapsed?: boolean;
15
+ /** Callback chiamato quando si clicca sull'immagine di Toppy */
16
+ onToppyImageClick?: () => void;
17
+ /** Visibilità del componente */
18
+ isVisible?: boolean;
19
+ /** Se true, renderizza Toppy nel document.body tramite Portal invece che nel parent */
20
+ usePortal?: boolean;
21
+ }
22
+ /**
23
+ * Componente ToppyDraggableHelpCenter
24
+ *
25
+ * Renderizza un assistente virtuale (Toppy) draggable che può mostrare contenuti
26
+ * in una speech bubble. Il componente può essere trascinato all'interno del suo
27
+ * contenitore e può essere collassato/espanso con un doppio click.
28
+ */
29
+ declare const ToppyDraggableHelpCenter: React.FC<ToppyDraggableHelpCenterProps>;
30
+ export default ToppyDraggableHelpCenter;