@topconsultnpm/sdkui-react-beta 6.16.30 → 6.16.32

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.
@@ -4,12 +4,12 @@ import { Workbook } from 'exceljs';
4
4
  import { buildValueToLabelMapFromDataColumns, getExceptionMessage, SDKUI_Localizator } from '../../helper';
5
5
  import TMCheckBox from '../editors/TMCheckBox';
6
6
  import TMButton from './TMButton';
7
- import TMDropDown from './TMDropDown';
8
7
  import TMModal from './TMModal';
9
8
  import { TMExceptionBoxManager } from './TMPopUp';
10
9
  import { ResultTypes } from '@topconsultnpm/sdk-ts-beta';
11
10
  import TMSpinner from './TMSpinner';
12
11
  import { TMResultManager } from '../forms/TMResultDialog';
12
+ import TMDropDown from '../editors/TMDropDown';
13
13
  const formatDataSource = [
14
14
  { value: 'csv', display: 'CSV' },
15
15
  { value: 'xlsx', display: 'XLSX' },
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CultureIDs } from '@topconsultnpm/sdk-ts-beta';
3
+ import { ITMChooserProps } from '../../ts';
4
+ interface TMCultureIDPickerProps extends ITMChooserProps {
5
+ selectedValue: CultureIDs | undefined;
6
+ onSelectCultureID: (cultureID: CultureIDs) => void;
7
+ }
8
+ declare const TMCultureIDPicker: React.FC<TMCultureIDPickerProps>;
9
+ export default TMCultureIDPicker;
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import styled from 'styled-components';
4
+ import { IconSearch, SDKUI_Localizator } from '../../helper';
5
+ import { CultureIDs } from '@topconsultnpm/sdk-ts-beta';
6
+ import { getCultureIDImg } from '../editors/TMLocalizedTextBox';
7
+ import TMModal from '../base/TMModal';
8
+ import TMSummary from '../editors/TMSummary';
9
+ import { StyledDivHorizontal } from '../..';
10
+ const CULTUREIDs_DATASOURCE = [
11
+ { value: CultureIDs.It_IT, display: "Italiano", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.It_IT), alt: "Lang", width: 16, height: 16 }) },
12
+ { value: CultureIDs.Fr_FR, display: "Française", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Fr_FR), alt: "Lang", width: 16, height: 16 }) },
13
+ { value: CultureIDs.Pt_PT, display: "Português", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Pt_PT), alt: "Lang", width: 16, height: 16 }) },
14
+ { value: CultureIDs.En_US, display: "English", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.En_US), alt: "Lang", width: 16, height: 16 }) },
15
+ { value: CultureIDs.Es_ES, display: "Español", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Es_ES), alt: "Lang", width: 16, height: 16 }) },
16
+ { value: CultureIDs.De_DE, display: "Deutsch", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.De_DE), alt: "Lang", width: 16, height: 16 }) },
17
+ ];
18
+ const PickerContainer = styled.div `
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 10px;
22
+ padding: 20px;
23
+ `;
24
+ const ItemsContainer = styled.div `
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ gap: 15px;
28
+ justify-content: center;
29
+ `;
30
+ const CultureItem = styled.div `
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ justify-content: center;
35
+ cursor: pointer;
36
+ text-align: center;
37
+ font-size: 0.9em;
38
+ padding: 10px 15px;
39
+ border-radius: 8px;
40
+ border: 2px solid transparent;
41
+ transition: all 0.2s ease-in-out;
42
+ width: 120px;
43
+
44
+ &:hover {
45
+ background-color: #f0f0f0;
46
+ }
47
+
48
+ ${props => props.$isSelected && `
49
+ border-color: #007bff;
50
+ background-color: #e6f2ff;
51
+ `}
52
+ `;
53
+ const FlagIcon = styled.div `
54
+ margin-bottom: 5px;
55
+ font-size: 2em;
56
+ `;
57
+ const TMCultureIDPicker = ({ selectedValue, onSelectCultureID, placeHolder, width = '100%', icon, backgroundColor, readOnly = false, openChooserBySingleClick = false, buttons = [], elementStyle, isModifiedWhen, label, showClearButton = false, validationItems = [], onValueChanged }) => {
58
+ const [showPicker, setShowPicker] = useState(false);
59
+ const getCultureIDName = (cultureID) => {
60
+ const item = CULTUREIDs_DATASOURCE.find(c => c.value === cultureID);
61
+ return item ? item.display : '';
62
+ };
63
+ const renderTemplate = () => {
64
+ const isPlaceholder = selectedValue === placeHolder;
65
+ return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [selectedValue && _jsx("img", { src: getCultureIDImg(selectedValue), alt: "Lang", width: 16, height: 16, style: { marginRight: '8px' } }), selectedValue && _jsx("p", { children: getCultureIDName(selectedValue) })] }));
66
+ };
67
+ return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: true, hasValue: selectedValue !== undefined, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowPicker(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showPicker && _jsx(TMModal, { title: label || SDKUI_Localizator.Select, onClose: () => setShowPicker(false), isModal: true, width: "450px", height: "255px", children: _jsx(PickerContainer, { children: _jsx(ItemsContainer, { children: CULTUREIDs_DATASOURCE.map(item => (_jsxs(CultureItem, { "$isSelected": item.value === selectedValue, onClick: () => {
68
+ onSelectCultureID(item.value);
69
+ setShowPicker(false);
70
+ }, children: [_jsx(FlagIcon, { children: item.icon }), _jsx("span", { children: item.display })] }, item.value))) }) }) })] }));
71
+ };
72
+ export default TMCultureIDPicker;
@@ -14,6 +14,7 @@ interface ITMTextExpression extends ITMEditorBase {
14
14
  widthChooser?: string;
15
15
  disableMultipleSelection?: boolean;
16
16
  validationItems?: ValidationItem[];
17
+ rows?: number;
17
18
  onValueChanged?: (newText: string | undefined) => void;
18
19
  }
19
20
  declare const TMTextExpression: React.FunctionComponent<ITMTextExpression>;
@@ -6,6 +6,7 @@ import { TMExceptionBoxManager } from '../base/TMPopUp';
6
6
  import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
7
7
  import TMChooserForm from '../forms/TMChooserForm';
8
8
  import TMTextBox from './TMTextBox';
9
+ import TMTextArea from './TMTextArea';
9
10
  const TMTextExpression = (props) => {
10
11
  const [metadatas_Info_Source, setMetadatas_Info_Source] = useState([]);
11
12
  const [showMetadataChooser, setShowMetadataChooser] = useState(false);
@@ -153,7 +154,10 @@ const TMTextExpression = (props) => {
153
154
  props.onValueChanged?.(expr);
154
155
  } }) : _jsx(_Fragment, {}));
155
156
  };
156
- return (_jsxs(_Fragment, { children: [_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)); } }), openMetadataChooseForm(), " ", openFormulaChooseForm()] }));
157
+ 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)); } })
159
+ :
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()] }));
157
161
  };
158
162
  class MetatadaHelper {
159
163
  constructor(mid, metadataName) {
@@ -10,10 +10,10 @@ import TMTextBox from '../../../editors/TMTextBox';
10
10
  import TMButton from '../../../base/TMButton';
11
11
  import styled from 'styled-components';
12
12
  import TMQuerySummary from '../../../query/TMQuerySummary';
13
- import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, SDK_Globals, SearchEngine, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts-beta';
14
- import TMLocalizedTextBox, { getCultureIDImg } from '../../../editors/TMLocalizedTextBox';
13
+ import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, SDK_Globals, SearchEngine, Severities, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts-beta';
14
+ import TMLocalizedTextBox from '../../../editors/TMLocalizedTextBox';
15
15
  import TMDataListItemPicker from '../../../choosers/TMDataListItemPicker';
16
- import WorkitemRecipientsEditor from './WorkitemRecipientsEditor';
16
+ import WorkitemRecipientsEditor, { actorsToTos, tosToActors } from './WorkitemRecipientsEditor';
17
17
  import TMDropDown from '../../../editors/TMDropDown';
18
18
  import TMMetadataValues, { AdvancedMenuButtons, ShowCheckBoxesMode } from '../../../editors/TMMetadataValues';
19
19
  import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../../editors/TMFormulaEditor';
@@ -22,6 +22,8 @@ import TMTidViewer from '../../../viewers/TMTidViewer';
22
22
  import { TMColors } from '../../../../utils/theme';
23
23
  import TMPathChooser from '../../../choosers/TMPathChooser';
24
24
  import TMTextExpression from '../../../editors/TMTextExpression';
25
+ import TMCultureIDPicker from '../../../choosers/TMCultureIDPicker';
26
+ import RecipientList, { WorkItemActorTypes } from './RecipientList';
25
27
  const FormContainer = styled.div `
26
28
  display: flex;
27
29
  flex-direction: column;
@@ -60,13 +62,11 @@ const SET_RULE_DATASOURCE = [
60
62
  { value: WorkItemSetRules.Ands_AND_Ors, display: "Ands_AND_Ors" },
61
63
  { value: WorkItemSetRules.Ands_OR_Ors, display: "Ands_OR_Ors" }
62
64
  ];
63
- const CULTUREIDs_DATASOURCE = [
64
- { value: CultureIDs.It_IT, display: "Italiano", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.It_IT), alt: "Lang", width: 16, height: 16 }) },
65
- { value: CultureIDs.Fr_FR, display: "Française", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Fr_FR), alt: "Lang", width: 16, height: 16 }) },
66
- { value: CultureIDs.Pt_PT, display: "Português", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Pt_PT), alt: "Lang", width: 16, height: 16 }) },
67
- { value: CultureIDs.En_US, display: "English", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.En_US), alt: "Lang", width: 16, height: 16 }) },
68
- { value: CultureIDs.Es_ES, display: "Español", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Es_ES), alt: "Lang", width: 16, height: 16 }) },
69
- { value: CultureIDs.De_DE, display: "Deutsch", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.De_DE), alt: "Lang", width: 16, height: 16 }) },
65
+ const SEVERITY_DATASOURCE = [
66
+ { value: Severities.Critical, display: "Critical" },
67
+ { value: Severities.Error, display: "Error" },
68
+ { value: Severities.Warning, display: "Warning" },
69
+ { value: Severities.Information, display: "Information" },
70
70
  ];
71
71
  const APP_TYPES_DATASOURCE = [
72
72
  { value: WFAppTypes.EXE, display: "EXE" },
@@ -117,6 +117,10 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
117
117
  width = '450px';
118
118
  height = '420px';
119
119
  break;
120
+ case DiagramItemTypes.Notification:
121
+ width = '700px';
122
+ height = '700px';
123
+ break;
120
124
  default:
121
125
  width = '50%';
122
126
  height = '50%';
@@ -331,7 +335,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
331
335
  const renderAppFields = () => {
332
336
  return (_jsxs(_Fragment, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.WorkflowAppType, dataSource: APP_TYPES_DATASOURCE, value: localItem.AppType, isModifiedWhen: localItem.AppType !== localItemOrig.AppType, onValueChanged: (e) => { handleAppTypeChange(e.target.value); } }), localItem.AppType === WFAppTypes.EXE
333
337
  ? _jsx(TMPathChooser, { label: SDKUI_Localizator.WorkflowAppName, value: localItem.AppName || '', isModifiedWhen: (localItem.AppName ?? '') !== (localItemOrig.AppName ?? ''), onValueChanged: (newValue) => { handleAppNameChange(newValue); }, allowBrowseFile_Area: true, allowBrowseFolder_Area: false, allowParametricPath: false })
334
- : _jsx(TMTextBox, { label: SDKUI_Localizator.WorkflowAppName, value: localItem.AppName, isModifiedWhen: (localItem.AppName ?? '') !== (localItemOrig.AppName ?? ''), onValueChanged: (e) => { handleAppNameChange(e.target.value); } }), _jsx(TMTextExpression, { label: SDKUI_Localizator.Arguments, value: localItem.AppArgs, valueOrig: localItemOrig.AppArgs, tid: wf?.MTID, onValueChanged: (newValue) => { handleAppArgsChange(newValue); } }), _jsx(TMDropDown, { label: SDKUI_Localizator.Format, dataSource: CULTUREIDs_DATASOURCE, value: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, onValueChanged: (e) => { handleFormatCultureIDChange(e.target.value); } })] }));
338
+ : _jsx(TMTextBox, { label: SDKUI_Localizator.WorkflowAppName, value: localItem.AppName, isModifiedWhen: (localItem.AppName ?? '') !== (localItemOrig.AppName ?? ''), onValueChanged: (e) => { handleAppNameChange(e.target.value); } }), _jsx(TMTextExpression, { label: SDKUI_Localizator.Arguments, value: localItem.AppArgs, valueOrig: localItemOrig.AppArgs, tid: wf?.MTID, onValueChanged: (newValue) => { handleAppArgsChange(newValue); } }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange })] }));
335
339
  };
336
340
  // Function to render Approval-specific fields
337
341
  const renderApprovalFields = () => {
@@ -419,6 +423,57 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
419
423
  const renderRunAppFields = () => {
420
424
  return (_jsxs(_Fragment, { children: [_jsx(TMLocalizedTextBox, { label: SDKUI_Localizator.Description, value: localItem.Description, value_IT: localItem.Description_IT, value_EN: localItem.Description_EN, value_FR: localItem.Description_FR, value_PT: localItem.Description_PT, value_ES: localItem.Description_ES, value_DE: localItem.Description_DE, isModifiedWhen: localItem.Description !== localItemOrig.Description, onValueChanged: handleLocalizedDescriptionChange }), renderAppFields()] }));
421
425
  };
426
+ const handleRegAsWfInstPartChange = useCallback((newValue) => {
427
+ setLocalItem(prevLocalItem => ({
428
+ ...prevLocalItem,
429
+ RegAsWfInstPart: newValue
430
+ }));
431
+ }, []);
432
+ const renderNotificationFields = () => {
433
+ const qdForRecipientsEditor = localItem.QD ?? SearchEngine.NewQueryDescriptor();
434
+ if (!qdForRecipientsEditor.from) {
435
+ qdForRecipientsEditor.from = new FromItem();
436
+ }
437
+ qdForRecipientsEditor.from.tid = wf?.MTID;
438
+ const { andRecipients } = useMemo(() => {
439
+ return tosToActors(localItem.Tos ?? '');
440
+ }, [localItem.Tos]);
441
+ const handleQDChosen = useCallback((newQd, orValue) => {
442
+ const allRecipients = [...andRecipients];
443
+ const updatedRecipients = allRecipients.filter(r => r.ActorType !== WorkItemActorTypes.QID);
444
+ const recipientToAdd = {
445
+ ActorType: WorkItemActorTypes.QID,
446
+ ActorID: newQd.id ? newQd.id.toString() : '-1',
447
+ Or: orValue,
448
+ };
449
+ updatedRecipients.push(recipientToAdd);
450
+ const newTos = actorsToTos(updatedRecipients);
451
+ handleTosChange(newTos);
452
+ handleSetRuleQDChange(newQd);
453
+ }, [andRecipients]);
454
+ const handleAddRecipients = useCallback((newRecipients, orValue) => {
455
+ const { andRecipients } = tosToActors(localItem.Tos ?? '');
456
+ let allRecipients = [...andRecipients];
457
+ // 1. Rimuovi qualsiasi QID esistente se il nuovo destinatario è una query
458
+ if (newRecipients.length > 0 && newRecipients[0].ActorType === WorkItemActorTypes.QID) {
459
+ allRecipients = allRecipients.filter(r => r.ActorType !== WorkItemActorTypes.QID);
460
+ }
461
+ const updatedRecipients = [...allRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
462
+ const newTos = actorsToTos(updatedRecipients);
463
+ handleTosChange(newTos);
464
+ }, [localItem.Tos, handleTosChange]);
465
+ const handleRemoveRecipient = useCallback((recipientToRemove) => {
466
+ const { andRecipients } = tosToActors(localItem.Tos ?? '');
467
+ const allRecipients = [...andRecipients];
468
+ const updatedRecipients = allRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID || r.Or !== recipientToRemove.Or);
469
+ const newTos = actorsToTos(updatedRecipients);
470
+ handleTosChange(newTos);
471
+ if (recipientToRemove.ActorType === WorkItemActorTypes.QID) {
472
+ handleSetRuleQDChange(undefined);
473
+ }
474
+ }, [localItem]);
475
+ return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: SDKUI_Localizator.Description, placeHolder: 'Inserire il testo della notifica...', rows: 3, value: localItem.Description, tid: wf?.MTID, isModifiedWhen: (localItem.Description ?? '') !== (localItemOrig.Description ?? ''), onValueChanged: (newValue) => handleLocalizedDescriptionChange(CultureIDs.None, newValue ?? ''), valueOrig: undefined }), _jsx(TMDropDown, { label: "Gravit\u00E0", dataSource: SEVERITY_DATASOURCE, value: localItem.Severity, isModifiedWhen: localItem.Severity !== localItemOrig.Severity, onValueChanged: (e) => setLocalItem(prevLocalItem => ({ ...prevLocalItem, Severity: e.target.value })) }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMCheckBox, { value: localItem.RegAsWfInstPart ?? 0, label: "Registra i destinatari della notifica come partecipanti dell'istanza di flusso", isModifiedWhen: localItem.RegAsWfInstPart !== localItemOrig.RegAsWfInstPart, onValueChanged: handleRegAsWfInstPartChange }), _jsx(RecipientList, { recipients: andRecipients, title: "Destinatari", tid: wf?.MTID, qd: qdForRecipientsEditor, onQDChange: (newQd) => newQd && handleQDChosen(newQd, 0), onAdd: (newRecipients) => handleAddRecipients(newRecipients, 0), onRemove: handleRemoveRecipient })] }));
476
+ };
422
477
  const renderForm = () => {
423
478
  let specificFields;
424
479
  switch (localItem.Type) {
@@ -448,6 +503,9 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
448
503
  case DiagramItemTypes.RunApp:
449
504
  specificFields = renderRunAppFields();
450
505
  break;
506
+ case DiagramItemTypes.Notification:
507
+ specificFields = renderNotificationFields();
508
+ break;
451
509
  default:
452
510
  specificFields = null;
453
511
  }
@@ -599,7 +599,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, readOnly = false, zoomLevel
599
599
  const isNonLinearConnection = isConnectionNonLinear(sourceRect, sinkRect, sourceConnectorName, sinkConnectorName);
600
600
  let pathPoints = [];
601
601
  let sinkArrowAngle = 0;
602
- const offset = 15;
602
+ const offsetStub = 15;
603
603
  const bypassBuffer = 50;
604
604
  const getDirection = (connectorName) => {
605
605
  if (connectorName === 'Left' || connectorName === 'Right')
@@ -611,16 +611,16 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, readOnly = false, zoomLevel
611
611
  let startStubPoint;
612
612
  switch (connection.Source.ConnectorName) {
613
613
  case 'Right':
614
- startStubPoint = { x: sourcePoint.x + offset, y: sourcePoint.y };
614
+ startStubPoint = { x: sourcePoint.x + offsetStub, y: sourcePoint.y };
615
615
  break;
616
616
  case 'Left':
617
- startStubPoint = { x: sourcePoint.x - offset, y: sourcePoint.y };
617
+ startStubPoint = { x: sourcePoint.x - offsetStub, y: sourcePoint.y };
618
618
  break;
619
619
  case 'Bottom':
620
- startStubPoint = { x: sourcePoint.x, y: sourcePoint.y + offset };
620
+ startStubPoint = { x: sourcePoint.x, y: sourcePoint.y + offsetStub };
621
621
  break;
622
622
  case 'Top':
623
- startStubPoint = { x: sourcePoint.x, y: sourcePoint.y - offset };
623
+ startStubPoint = { x: sourcePoint.x, y: sourcePoint.y - offsetStub };
624
624
  break;
625
625
  default: startStubPoint = sourcePoint;
626
626
  }
@@ -629,16 +629,16 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, readOnly = false, zoomLevel
629
629
  let endStubPoint;
630
630
  switch (connection.Sink.ConnectorName) {
631
631
  case 'Right':
632
- endStubPoint = { x: sinkPoint.x + offset, y: sinkPoint.y };
632
+ endStubPoint = { x: sinkPoint.x + offsetStub, y: sinkPoint.y };
633
633
  break;
634
634
  case 'Left':
635
- endStubPoint = { x: sinkPoint.x - offset, y: sinkPoint.y };
635
+ endStubPoint = { x: sinkPoint.x - offsetStub, y: sinkPoint.y };
636
636
  break;
637
637
  case 'Bottom':
638
- endStubPoint = { x: sinkPoint.x, y: sinkPoint.y + offset };
638
+ endStubPoint = { x: sinkPoint.x, y: sinkPoint.y + offsetStub };
639
639
  break;
640
640
  case 'Top':
641
- endStubPoint = { x: sinkPoint.x, y: sinkPoint.y - offset };
641
+ endStubPoint = { x: sinkPoint.x, y: sinkPoint.y - offsetStub };
642
642
  break;
643
643
  default: endStubPoint = sinkPoint;
644
644
  }
@@ -1,5 +1,11 @@
1
1
  import React from 'react';
2
2
  import { QueryDescriptor } from '@topconsultnpm/sdk-ts-beta';
3
+ import { WorkItemActor } from './RecipientList';
4
+ export declare const tosToActors: (tosString: string) => {
5
+ andRecipients: WorkItemActor[];
6
+ orRecipients: WorkItemActor[];
7
+ };
8
+ export declare const actorsToTos: (actors: WorkItemActor[]) => string;
3
9
  interface WorkitemRecipientsEditorProps {
4
10
  tos: string;
5
11
  qd: QueryDescriptor | undefined;
@@ -7,7 +7,7 @@ const RecipientsContainer = styled.div `
7
7
  gap: 20px;
8
8
  flex-wrap: wrap;
9
9
  `;
10
- const tosToActors = (tosString) => {
10
+ export const tosToActors = (tosString) => {
11
11
  const andRecipients = [];
12
12
  const orRecipients = [];
13
13
  if (!tosString)
@@ -40,7 +40,7 @@ const tosToActors = (tosString) => {
40
40
  }
41
41
  return { andRecipients, orRecipients };
42
42
  };
43
- const actorsToTos = (actors) => {
43
+ export const actorsToTos = (actors) => {
44
44
  return actors.map(actor => `${WorkItemActorTypes[actor.ActorType]}|${actor.ActorID}|${actor.Or}`).join(';');
45
45
  };
46
46
  const WorkitemRecipientsEditor = ({ tos, qd, mTID, onTosChange, onQDChange }) => {
@@ -1,4 +1,4 @@
1
- import { CultureIDs, QueryDescriptor, WFAppTypes, WorkItemSetRules, WorkItemStatus } from "@topconsultnpm/sdk-ts-beta";
1
+ import { CultureIDs, QueryDescriptor, Severities, WFAppTypes, WorkItemSetRules, WorkItemStatus } from "@topconsultnpm/sdk-ts-beta";
2
2
  import { MetadataValueDescriptorEx } from "../../../../ts";
3
3
  export declare enum DiagramItemTypes {
4
4
  None = 0,
@@ -66,7 +66,7 @@ export interface DiagramItem {
66
66
  QD?: QueryDescriptor;
67
67
  SOD?: string;
68
68
  MetadataValues?: MetadataValueDescriptorEx[];
69
- Severity?: number;
69
+ Severity?: Severities;
70
70
  RegAsWfInstPart?: number;
71
71
  FormatCultureID?: CultureIDs | undefined;
72
72
  Tos2?: string;
@@ -86,8 +86,8 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
86
86
  ...summaryItems ?? {}
87
87
  });
88
88
  }, [manageUseLocalizedName, summaryItems]);
89
- return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
90
- filteredItems.length > 0
89
+ return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: (children ??
90
+ filteredItems.length > 0)
91
91
  ? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
92
92
  : _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
93
93
  };
@@ -877,7 +877,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
877
877
  mdOut?.id && SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(whereItem.tid, mdOut?.id, LayoutModes.None, queryParamsDynDataList ?? []).then((result) => {
878
878
  TMSpinner.hide();
879
879
  setDataSource(result);
880
- }).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
880
+ }).catch((err) => { TMSpinner.hide(); TMExceptionBoxManager.show({ exception: err }); });
881
881
  break;
882
882
  }
883
883
  case MetadataDataDomains.UserID:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.16.30",
3
+ "version": "6.16.32",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { Colors, ITMEditorBase } from './TMEditorBase';
3
- interface ITMDropDown extends ITMEditorBase {
4
- dataSource?: any[];
5
- color?: Colors;
6
- value?: string | number;
7
- disabled?: boolean;
8
- onValueChanged?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
9
- }
10
- declare const TMDropDown: React.FC<ITMDropDown>;
11
- export default TMDropDown;
@@ -1,64 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- import styled from 'styled-components';
4
- import { FontSize } from '../../utils/theme';
5
- import { getColor } from "../../helper/helpers";
6
- const StyledDropDownContainer = styled.div.withConfig({ shouldForwardProp: prop => !['labelPosition'].includes(prop) }) `
7
- width: ${props => props.width};
8
- display: flex;
9
- flex-direction: ${props => props.labelPosition === 'left' ? 'row' : 'column'};
10
- justify-content: flex-start;
11
- align-items: ${props => props.labelPosition === 'left' ? 'center' : 'flex-start'};;
12
- position: relative;
13
- `;
14
- const StyledDropDown = styled.select.withConfig({ shouldForwardProp: prop => !['flexBase'].includes(prop) }) `
15
- width: ${props => props.width};
16
- padding: 3px 15px 3px 5px;
17
- border: 1px solid;
18
- border-color: ${props => !props.disabled ? getColor(props.color) : 'rgb(180,180,180)'};;
19
- color: ${props => getColor(props.color)};
20
- border-radius: 5px;
21
- min-width: 70px;
22
- /* &:focus{
23
- outline: none;
24
- } */
25
- font-size: ${props => props.fontSize};
26
- flex: ${props => 10 - props.flexBase};
27
- &::placeholder {
28
- /* color: ${props => getColor(props.color)}; */
29
- font-size: ${props => props.fontSize};
30
- }
31
- `;
32
- const StyledDropDownIcon = styled.div.withConfig({ shouldForwardProp: prop => !['labelPosition'].includes(prop) }) `
33
- color: ${props => !props.disabled ? getColor(props.color) : 'rgb(180,180,180)'};
34
- width: 25px;
35
- height: 25px;
36
- margin-right: 2px;
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- font-size: 18px;
41
- user-select: none;
42
- `;
43
- const StyledDropDownLabel = styled.div.withConfig({ shouldForwardProp: prop => !['flexBase'].includes(prop) }) `
44
- font-size: ${props => props.fontSize} ;
45
- color: ${props => !props.disabled ? getColor(props.color) : 'rgb(180,180,180)'};
46
- flex: ${props => props.flexBase};
47
- transform: translateY(1px);
48
- user-select: none;
49
- padding-right: 10px;
50
- `;
51
- const TMDropDown = ({ disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', flexBase = 1, label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, color = 'primary', value, onValueChanged }) => {
52
- const [currentColor, setCurrentColor] = useState(color);
53
- useEffect(() => {
54
- setCurrentColor(isModifiedWhen ? 'tertiary' : color);
55
- }, [isModifiedWhen, color]);
56
- const renderedLeftLabelTextBox = () => {
57
- return (_jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', width: '100%' }, children: _jsxs(StyledDropDownContainer, { labelPosition: labelPosition, width: width, children: [icon && _jsx(StyledDropDownIcon, { disabled: disabled, labelPosition: labelPosition, color: currentColor, children: icon }), label && _jsx(StyledDropDownLabel, { disabled: disabled, flexBase: flexBase, color: currentColor, fontSize: fontSize, children: label }), _jsx(StyledDropDown, { disabled: disabled, flexBase: flexBase, fontSize: fontSize, width: width, color: currentColor, value: value, onChange: onValueChanged, children: dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index))) })] }) }));
58
- };
59
- const renderedTopLabelTextBox = () => {
60
- return (_jsxs(StyledDropDownContainer, { labelPosition: labelPosition, width: width, children: [_jsx("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: '2px', marginTop: '3px', width: '100%' }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center' }, children: [icon && _jsx(StyledDropDownIcon, { disabled: disabled, labelPosition: labelPosition, color: currentColor, children: icon }), label && _jsx(StyledDropDownLabel, { disabled: disabled, flexBase: flexBase, color: currentColor, fontSize: fontSize, children: label })] }) }), _jsx("div", { style: { width: '100%', display: 'flex', flexDirection: 'row', position: 'relative' }, children: _jsx(StyledDropDown, { disabled: disabled, flexBase: flexBase, fontSize: fontSize, width: width, color: currentColor, value: value, onChange: onValueChanged, children: dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index))) }) })] }));
61
- };
62
- return (_jsx("div", { style: elementStyle, children: labelPosition === 'left' ? renderedLeftLabelTextBox() : renderedTopLabelTextBox() }));
63
- };
64
- export default TMDropDown;