@topconsultnpm/sdkui-react-beta 6.8.63 → 6.8.65

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DataListItemDescriptor, QueryDescriptor, DynamicDataListDescriptor, SearchResultDescriptor, MetadataDescriptor, LayoutModes } from '@topconsultnpm/sdk-ts-beta';
2
+ import { DataListItemDescriptor, DynamicDataListDescriptor, SearchResultDescriptor, MetadataDescriptor, LayoutModes } from '@topconsultnpm/sdk-ts-beta';
3
3
  import { ITMChooserProps, ITMChooserFormProps } from '../../ts';
4
4
  interface ITMDynDataListItemChooserProps extends ITMChooserProps {
5
5
  /** TID della lista dati da gestire */
@@ -17,7 +17,6 @@ interface ITMDynDataListItemChooserProps extends ITMChooserProps {
17
17
  /** Indica quali liste dati dinamiche aggiornare in cascata */
18
18
  onCascadeRefreshDynDataLists?: (dynDataListsToBeRefreshed: DynDataListsToBeRefreshed[]) => void;
19
19
  }
20
- export declare const IsParametricQuery: (qd: QueryDescriptor | undefined) => boolean;
21
20
  export type DynDataListsToBeRefreshed = {
22
21
  mid: number | undefined;
23
22
  queryParams: string[];
@@ -2,27 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useEffect, useState } from 'react';
3
3
  import { DataColumnTypes, SDK_Localizator, DataListCacheService, SDK_Globals, LayoutModes } from '@topconsultnpm/sdk-ts-beta';
4
4
  import { Column } from 'devextreme-react/cjs/data-grid';
5
- import { IconDetails, IconSearch, getDataColumnName, Globalization, SDKUI_Localizator, searchResultDescriptorToSimpleArray } from '../../helper';
5
+ import { IconDetails, IconSearch, getDataColumnName, Globalization, SDKUI_Localizator, searchResultDescriptorToSimpleArray, IsParametricQuery } from '../../helper';
6
6
  import { StyledDivHorizontal } from '../base/Styled';
7
7
  import { TMExceptionBoxManager } from '../base/TMPopUp';
8
8
  import TMSpinner from '../base/TMSpinner';
9
9
  import TMSummary from '../editors/TMSummary';
10
10
  import TMChooserForm from '../forms/TMChooserForm';
11
- //TODO: Spostare in SDK QueryEngine
12
- export const IsParametricQuery = (qd) => {
13
- if (qd == undefined)
14
- return false;
15
- if (qd.where == undefined)
16
- return false;
17
- let qp = "{@QueryParam";
18
- for (const wi of qd.where) {
19
- if (wi.value1?.includes(qp))
20
- return true;
21
- if (wi.value2?.includes(qp))
22
- return true;
23
- }
24
- return false;
25
- };
26
11
  const TMDynDataListItemChooser = ({ tid, md, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, onValueChanged, onCascadeRefreshDynDataLists, showClearButton }) => {
27
12
  const [showChooser, setShowChooser] = useState(false);
28
13
  const [dynDl, setDynDl] = useState();
@@ -20,7 +20,7 @@ const cellRender = (cellData) => {
20
20
  }
21
21
  };
22
22
  const TMResultDialog = ({ title, result, id1Caption, id2Caption }) => {
23
- return (_jsx(TMModal, { height: '65%', width: '75%', title: `Esito operazione - ${title}`, children: _jsxs(TMLayoutContainer, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', padding: '3px', justifyContent: 'center', alignItems: 'center' }, children: [_jsx("p", { children: `Documenti elaborati: ${result.length}` }), _jsx(IconSuccessCirlce, { fontSize: 22, color: TMColors.success }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.SUCCESS).length ?? 0 }), _jsx(IconWarning, { fontSize: 22, color: TMColors.warning }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.WARNING).length ?? 0 }), _jsx(IconCloseCircle, { fontSize: 22, color: TMColors.error }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.ERROR).length ?? 0 })] }), _jsxs(DataGrid, { dataSource: result.filter(o => o.resultType != ResultTypes.SUCCESS), showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, keyExpr: "rowIndex", width: "100%", height: "100%", columnResizingMode: "widget", allowColumnResizing: true, columnAutoWidth: true, children: [_jsx(Column, { dataField: 'resultType', caption: '', allowResizing: true, allowSorting: true, cellRender: cellRender }), _jsx(Column, { dataField: 'id1', caption: id1Caption }), id2Caption && _jsx(Column, { dataField: 'id2', caption: id2Caption }), _jsx(Column, { dataField: 'description', allowResizing: true, caption: SDKUI_Localizator.Description, allowSorting: true }), _jsx(Paging, { enabled: true, pageSize: 30 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(Scrolling, { mode: 'standard', useNative: SDKUI_Globals.dataGridUseNativeScrollbar }), _jsx(HeaderFilter, { visible: true })] })] }) }));
23
+ return (_jsx(TMModal, { height: '65%', width: '75%', title: `${SDKUI_Localizator.OperationResult} - ${title}`, children: _jsxs(TMLayoutContainer, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', padding: '5px', justifyContent: 'center', alignItems: 'center' }, children: [_jsx("p", { children: `${SDKUI_Localizator.ProcessedItems}: ${result.length}` }), _jsx(IconSuccessCirlce, { fontSize: 22, color: TMColors.success }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.SUCCESS).length ?? 0 }), _jsx(IconWarning, { fontSize: 22, color: TMColors.warning }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.WARNING).length ?? 0 }), _jsx(IconCloseCircle, { fontSize: 22, color: TMColors.error }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.ERROR).length ?? 0 })] }), _jsxs(DataGrid, { dataSource: result.filter(o => o.resultType != ResultTypes.SUCCESS), showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, keyExpr: "rowIndex", width: "100%", height: "100%", columnResizingMode: "widget", allowColumnResizing: true, columnAutoWidth: true, children: [_jsx(Column, { dataField: 'resultType', caption: '', allowResizing: true, allowSorting: true, cellRender: cellRender }), _jsx(Column, { dataField: 'id1', caption: id1Caption }), id2Caption && _jsx(Column, { dataField: 'id2', caption: id2Caption }), _jsx(Column, { dataField: 'description', allowResizing: true, caption: SDKUI_Localizator.Description, allowSorting: true }), _jsx(Paging, { enabled: true, pageSize: 30 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(Scrolling, { mode: 'standard', useNative: SDKUI_Globals.dataGridUseNativeScrollbar }), _jsx(HeaderFilter, { visible: true })] })] }) }));
24
24
  };
25
25
  export default TMResultDialog;
26
26
  export class TMResultManager {
@@ -28,7 +28,7 @@ export class TMResultManager {
28
28
  const warningsCount = result.filter(o => o.resultType == ResultTypes.WARNING).length;
29
29
  const errorsCount = result.filter(o => o.resultType == ResultTypes.ERROR).length;
30
30
  if (warningsCount <= 0 && errorsCount <= 0) {
31
- ShowAlert({ message: "Operazione completata con successo", mode: 'success', duration: 3000, title: title });
31
+ ShowAlert({ message: SDKUI_Localizator.OperationSuccess, mode: 'success', duration: 3000, title: title });
32
32
  return;
33
33
  }
34
34
  let container = document.createElement('div');
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { SDK_Localizator, AccessLevels, OnJoinItem, JoinTypes, PlatformObjectValidator, MetadataDataDomains, DcmtTypeListCacheService, JoinItem, SystemMIDsAsNumber, MetadataDataTypes, OrderByItem, QueryDescriptor, QueryFunctions, QueryOperators, ResultTypes, SelectItem, SDK_Globals, UserListCacheService, WhereItem, SearchEngine, SelectItemVisibilities, DataListCacheService, QueryValidatorOptions, TMPropertyNames, AppModules, LayoutModes } from '@topconsultnpm/sdk-ts-beta';
3
+ import { SDK_Localizator, AccessLevels, OnJoinItem, JoinTypes, PlatformObjectValidator, MetadataDataDomains, DcmtTypeListCacheService, JoinItem, MetadataDataTypes, OrderByItem, QueryFunctions, QueryOperators, ResultTypes, SelectItem, SDK_Globals, UserListCacheService, WhereItem, SearchEngine, SelectItemVisibilities, DataListCacheService, QueryValidatorOptions, TMPropertyNames, AppModules, LayoutModes } from '@topconsultnpm/sdk-ts-beta';
4
4
  import styled from 'styled-components';
5
5
  import Accordion, { Item } from 'devextreme-react/accordion';
6
6
  import { SDKUI_Localizator, IconSearch, IconCount, getQueryCountAsync, calcIsModified, IconClear, IconAddCircleOutline, IconDotsVerticalCircleOutline, IconHide, IconShow, IconDraggabledots, genUniqueId, LocalizeQueryOperators, LocalizeQueryFunctions, LocalizeQueryJoinTypes, IconArchiveDoc, IconArrowRight, svgToString } from '../../helper';
7
- import { displayMetadataValue, getDcmtTypesByQdAsync, getTIDsByQd } from '../../helper/queryHelper';
7
+ import { displayMetadataValue, getDcmtTypesByQdAsync, getTIDsByQd, IsParametricQuery, prepareQdForSearchAsync } from '../../helper/queryHelper';
8
8
  import { useOutsideClick } from '../../hooks/useOutsideClick';
9
9
  import { FormModes } from '../../ts';
10
10
  import { TMColors } from '../../utils/theme';
@@ -25,10 +25,11 @@ import TMApplyForm from '../forms/TMApplyForm';
25
25
  import { getDisplayAlias } from '../viewers/TMMidViewer';
26
26
  import { useApplyForm } from '../../hooks/useForm';
27
27
  import ShowAlert from '../base/TMAlert';
28
- import { IsParametricQuery, TMDynDataListItemChooserForm } from '../choosers/TMDynDataListItemChooser';
28
+ import { TMDynDataListItemChooserForm } from '../choosers/TMDynDataListItemChooser';
29
29
  import TMQueryResultForm, { SearchResultContext } from './TMQueryResultForm';
30
30
  import TMMetadataEditor from '../editors/TMMetadataEditor';
31
31
  import { ContextMenu } from 'devextreme-react';
32
+ import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
32
33
  export const StyledRowItem = styled.div ` display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 5px; gap: 3px; `;
33
34
  export const StyledItemWrapper = styled.div ` border-radius: ${props => props.$borderRadius ? props.$borderRadius : '4px'}; padding: 4px; font-size: 1rem; user-select: none; width: max-content; `;
34
35
  export const StyledAccordionItemContainer = styled.div ` width: 100%; padding: 2px; display: flex; flex-direction: column; overflow-x: auto; align-items: flex-start; margin-left: 5px; gap: 3px; max-height: 300px; `;
@@ -62,6 +63,7 @@ export function useOrchApplyForm(d, formMode, inputData, onApplied, parameters)
62
63
  return { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData };
63
64
  }
64
65
  const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = false, isModal, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged }) => {
66
+ const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
65
67
  const { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData } = useOrchApplyForm(Descriptors.Query, formMode, inputData, onApplied);
66
68
  const [dcmtTypesList, setDcmtTypesList] = useState([]);
67
69
  const [resultSearch, setResultSearch] = useState();
@@ -571,62 +573,30 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
571
573
  // #endregion
572
574
  // #region Ricerca
573
575
  const renderResultSearchForm = _jsx(TMQueryResultForm, { context: SearchResultContext.METADATA_SEARCH, onClose: () => { setShowResultSearch(false); }, isModal: isModal, result1: resultSearch, elapsedTime: elapsedTime, searchText: searchText });
574
- const addHiddenSelectItem = (select, tid, mid) => {
575
- if (select.findIndex(o => o.mid == mid) >= 0)
576
- return;
577
- let si = new SelectItem();
578
- si.tid = tid;
579
- si.mid = mid;
580
- si.visibility = SelectItemVisibilities.Hidden;
581
- select.push(si);
582
- };
583
576
  const onSearchAsync = async () => {
584
577
  try {
585
- TMSpinner.show({ description: `Esecuzione query ...`, backgroundColor: 'transparent' });
586
578
  const startTime = new Date().getTime();
587
- let qd = new QueryDescriptor();
588
- qd.init({ ...formData });
589
- // V5 SDKUI >> QueryControl >> GetQueryDescriptor
590
- if (!qd.select)
591
- qd.select = [];
592
- let qdWithAggrFunctions = qd.select?.some(o => o.function != QueryFunctions.None);
593
- if (!qd.isDistinct && !qdWithAggrFunctions) {
594
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.TID);
595
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.DID);
596
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.FileCount);
597
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.FileExt);
598
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.IsLex);
599
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.IsLogDel);
600
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.IsMail);
601
- addHiddenSelectItem(qd.select, qd?.from?.tid, SystemMIDsAsNumber.IsSigned);
602
- }
603
- // Alcuni lavori di ORCHESTRATOR non definiscono i SelectItem (per esempio, CheckSequence, DcmtPrinter, ...).
604
- // In tal caso il risultato della ricerca risultava senza colonne (metadati).
605
- // In questa condizione si è deciso di visualizzare, di default, i primi 10 metadati.
606
- if (qd.select.filter(o => o.mid > 100).length <= 0) {
607
- let dtd = await DcmtTypeListCacheService.GetAsync(qd?.from?.tid, true);
608
- if (dtd?.metadata) {
609
- let counter = 1;
610
- for (const md of dtd.metadata) {
611
- if (md.isSystem == 1)
612
- continue;
613
- if (md.perm && md.perm.canView === AccessLevels.No)
614
- continue;
615
- if (counter > 10)
616
- break;
617
- let si = new SelectItem();
618
- si.visibility = SelectItemVisibilities.Visible;
619
- si.tid = dtd.id;
620
- si.mid = md.id;
621
- qd.select.push(si);
622
- counter++;
579
+ let qd = await prepareQdForSearchAsync(formData);
580
+ if (IsParametricQuery(qd)) {
581
+ const qdParams = await confirmQueryParams(qd);
582
+ if (!qdParams || qdParams.length <= 0)
583
+ return;
584
+ for (const qpd of qdParams) {
585
+ let wi = qd.where?.find(o => o.value1 == qpd.name);
586
+ if (wi)
587
+ wi.value1 = wi.value1?.replace(wi.value1, !qpd.value ? '' : qpd.value.toString());
588
+ else {
589
+ wi = qd.where?.find(o => o.value2 == qpd.name);
590
+ if (wi)
591
+ wi.value2 = wi.value2?.replace(wi.value2, !qpd.value ? '' : qpd.value.toString());
623
592
  }
624
593
  }
625
594
  }
595
+ TMSpinner.show({ description: `${SDKUI_Localizator.Search} ...`, backgroundColor: 'transparent' });
626
596
  let result = await SDK_Globals.tmSession?.NewSearchEngine().SearchByIDAsync(qd);
627
597
  let dcmtsFound = result?.dcmtsFound ?? 0;
628
598
  if (dcmtsFound <= 0)
629
- ShowAlert({ message: "Nessun documento trovato", mode: 'info', title: "Risultato ricerca", duration: 3000 });
599
+ ShowAlert({ message: SDKUI_Localizator.NoDcmtFound, mode: 'info', title: SDKUI_Localizator.SearchResult, duration: 3000 });
630
600
  else {
631
601
  setElapsedTime(new Date().getTime() - startTime);
632
602
  setResultSearch(result);
@@ -708,97 +678,97 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
708
678
  }
709
679
  };
710
680
  // #endregion
711
- return (_jsxs(_Fragment, { children: [_jsx(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: onSearchAsync }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Count, icon: _jsx(IconCount, {}), disabled: errorsCount > 0, onClick: () => getQueryCountAsync(formData, true) }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Passa ad archiviazione", icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: _jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
712
- let items = e.component.option("items");
713
- if (items && items.length > 0) {
714
- for (let i = 0; i < items.length; i++) {
715
- e.component.collapseItem(i);
716
- let title = items[i].title;
717
- if (title == SDKUI_Localizator.Source || title == SDK_Localizator.QueryWhere) {
718
- e.component?.expandItem(i);
681
+ return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: onSearchAsync }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Count, icon: _jsx(IconCount, {}), disabled: errorsCount > 0, onClick: () => getQueryCountAsync(formData, true) }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Passa ad archiviazione", icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
682
+ let items = e.component.option("items");
683
+ if (items && items.length > 0) {
684
+ for (let i = 0; i < items.length; i++) {
685
+ e.component.collapseItem(i);
686
+ let title = items[i].title;
687
+ if (title == SDKUI_Localizator.Source || title == SDK_Localizator.QueryWhere) {
688
+ e.component?.expandItem(i);
689
+ }
719
690
  }
720
691
  }
721
- }
722
- }, children: [(!isReadOnly || fromCount > 0) && _jsx(Item, { title: SDKUI_Localizator.Source, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, fromCount, validationItems.filter((o) => [TMPropertyNames.fromTid, TMPropertyNames.join].includes(o.PropertyName))), children: _jsx(StyledAccordionItemContainer, { style: { maxHeight: fromCount > 0 ? '330px' : '100%' }, children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, style: { height: '100%' }, children: [_jsxs(StyledRowItem, { children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => { let qd = SearchEngine.NewQueryDescriptor(); setFormData({ ...qd }); } }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', elementStyle: { opacity: !formData?.from?.tid ? 0.4 : 1 }, disabled: !formData?.from?.tid, icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: onAdd_JoinItem }), _jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMQdDropDownMenu, { content: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }), items: [
723
- { icon: svgToString(showId ? _jsx(IconHide, { color: TMColors.button_icon }) : _jsx(IconShow, { color: TMColors.button_icon })), text: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show, onClick: () => setShowId(!showId) },
724
- { icon: svgToString(showCompleteMetadataName ? _jsx(IconHide, { color: TMColors.primary }) : _jsx(IconShow, { color: TMColors.primary })), text: showCompleteMetadataName ? SDKUI_Localizator.Hide_CompleteName : SDKUI_Localizator.Show_CompleteName, onClick: () => setShowCompleteMetadataName(!showCompleteMetadataName) }
725
- ] }) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: formData.from?.tid, alias: undefined }), values: [formData.from?.tid], validationItems: validationItems.filter((o) => o.PropertyName === TMPropertyNames.fromTid), onValueChanged: (tids) => { let qd = SearchEngine.NewQueryDescriptor(); qd.from.tid = tids[0]; setFormData({ ...qd }); onFromTIDChanged?.(tids[0]); } })] }), formData?.join?.map((ji, index) => {
726
- return (_jsxs("div", { style: { width: 'max-content', padding: isReadOnly ? '0px 20px' : 0 }, children: [_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropJoin(e, ji), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, ji), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
727
- { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_JoinItem(index) },
728
- { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) },
729
- { text: SDKUI_Localizator.AddDefinition, onClick: () => onAdd_OnJoinItem(index, 0) },
730
- { text: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) },
731
- { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, join: undefined }) }
732
- ] }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryJoinTypes(ji.joinType) }), items: getJoinTypesMenuItems(index) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: ji.tid, alias: ji.alias }), values: ji.tid ? [ji.tid] : [], onValueChanged: (newValues) => onChange_JoinItem_TID(newValues[0], index) }), ji.alias &&
733
- _jsx(StyledItemWrapper, { style: { fontStyle: 'italic', color: TMColors.primary }, children: `AS ${getDisplayAlias(getDcmtTypeName(ji.tid), ji.alias)}` })] }), ji.on?.map((onItem, indexOn) => {
734
- return (_jsxs(StyledRowItem, { style: { marginLeft: '40px' }, children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
735
- { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OnJoinItem(index, indexOn) },
736
- { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) },
737
- { text: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) },
738
- {
739
- text: SDKUI_Localizator.RemoveAll, onClick: () => {
740
- if (!formData.join)
741
- return;
742
- const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
743
- joinCopy[index].on = undefined;
744
- setFormData({ ...formData, join: joinCopy });
692
+ }, children: [(!isReadOnly || fromCount > 0) && _jsx(Item, { title: SDKUI_Localizator.Source, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, fromCount, validationItems.filter((o) => [TMPropertyNames.fromTid, TMPropertyNames.join].includes(o.PropertyName))), children: _jsx(StyledAccordionItemContainer, { style: { maxHeight: fromCount > 0 ? '330px' : '100%' }, children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, style: { height: '100%' }, children: [_jsxs(StyledRowItem, { children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => { let qd = SearchEngine.NewQueryDescriptor(); setFormData({ ...qd }); } }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', elementStyle: { opacity: !formData?.from?.tid ? 0.4 : 1 }, disabled: !formData?.from?.tid, icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: onAdd_JoinItem }), _jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMQdDropDownMenu, { content: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }), items: [
693
+ { icon: svgToString(showId ? _jsx(IconHide, { color: TMColors.button_icon }) : _jsx(IconShow, { color: TMColors.button_icon })), text: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show, onClick: () => setShowId(!showId) },
694
+ { icon: svgToString(showCompleteMetadataName ? _jsx(IconHide, { color: TMColors.primary }) : _jsx(IconShow, { color: TMColors.primary })), text: showCompleteMetadataName ? SDKUI_Localizator.Hide_CompleteName : SDKUI_Localizator.Show_CompleteName, onClick: () => setShowCompleteMetadataName(!showCompleteMetadataName) }
695
+ ] }) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: formData.from?.tid, alias: undefined }), values: [formData.from?.tid], validationItems: validationItems.filter((o) => o.PropertyName === TMPropertyNames.fromTid), onValueChanged: (tids) => { let qd = SearchEngine.NewQueryDescriptor(); qd.from.tid = tids[0]; setFormData({ ...qd }); onFromTIDChanged?.(tids[0]); } })] }), formData?.join?.map((ji, index) => {
696
+ return (_jsxs("div", { style: { width: 'max-content', padding: isReadOnly ? '0px 20px' : 0 }, children: [_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropJoin(e, ji), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, ji), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
697
+ { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_JoinItem(index) },
698
+ { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) },
699
+ { text: SDKUI_Localizator.AddDefinition, onClick: () => onAdd_OnJoinItem(index, 0) },
700
+ { text: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) },
701
+ { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, join: undefined }) }
702
+ ] }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryJoinTypes(ji.joinType) }), items: getJoinTypesMenuItems(index) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: ji.tid, alias: ji.alias }), values: ji.tid ? [ji.tid] : [], onValueChanged: (newValues) => onChange_JoinItem_TID(newValues[0], index) }), ji.alias &&
703
+ _jsx(StyledItemWrapper, { style: { fontStyle: 'italic', color: TMColors.primary }, children: `AS ${getDisplayAlias(getDcmtTypeName(ji.tid), ji.alias)}` })] }), ji.on?.map((onItem, indexOn) => {
704
+ return (_jsxs(StyledRowItem, { style: { marginLeft: '40px' }, children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
705
+ { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OnJoinItem(index, indexOn) },
706
+ { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) },
707
+ { text: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) },
708
+ {
709
+ text: SDKUI_Localizator.RemoveAll, onClick: () => {
710
+ if (!formData.join)
711
+ return;
712
+ const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
713
+ joinCopy[index].on = undefined;
714
+ setFormData({ ...formData, join: joinCopy });
715
+ }
745
716
  }
746
- }
747
- ] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.leftTID, alias: onItem.leftAlias }), qd: formData, values: onItem.leftTID ? [{ tid: onItem.leftTID, mid: onItem.leftMID, aliasTID: onItem.leftAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoLeft(values[0], index, indexOn); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.rightTID, alias: onItem.rightAlias }), qd: formData, values: onItem.rightTID ? [{ tid: onItem.rightTID, mid: onItem.rightMID, aliasTID: onItem.rightAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoRight(values[0], index, indexOn); } })] }, indexOn));
748
- })] }, `${ji.tid}_${index}`));
749
- }), _jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.join) })] }) }) }), fromCount > 0 && (!isReadOnly || selectCount > 0) && validateSelect && _jsx(Item, { title: SDK_Localizator.QuerySelect, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, selectCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.select)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.select) }), (!formData?.select || formData?.select.length <= 0) && !isReadOnly &&
750
- _jsxs(StyledRowItem, { children: [_jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_SelectItem }), dcmtTypesList.length == 1
751
- ? _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls, onClick: () => { onAddAll_SelectItem(qdTIDs[0]); } })
752
- : _jsx(TMQdDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls }), items: qdTIDs.map((tid_alias) => ({ text: `${getDisplayAlias(getDcmtTypeName(tid_alias.tid), tid_alias.alias)}`, onClick: () => { onAddAll_SelectItem(tid_alias); } })) })] }), formData?.select?.map((si, index) => {
753
- return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropSelect(e, si), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, si), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_SelectItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_SelectItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: getSelectMenuItems(index) }), (!isReadOnly || (si.function && si.function != QueryFunctions.None)) && _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: si.function === QueryFunctions.None ? "..." : LocalizeQueryFunctions(si.function) }), items: getQueryFunctionsMenuItems(si, index) }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: si.tid, alias: si.alias }), qd: formData, values: [{ tid: si.tid, mid: si.mid, aliasTID: si.alias }], onValueChanged: (values) => { values.length > 0 && onChange_SelectItem_MID(values[0], index); } }), (!isReadOnly || si.as) && _jsx(TMQdEditableItem, { value: si.as, backgroundColor: colorValue, placeHolder: `<${SDKUI_Localizator.Query_EnterAlias}...>`, width: '100%', onValueChanged: (value) => { onChange_SelectItem_As(value, index); } })] }, `${si.tid}_${si.mid}_${index}`));
754
- })] }) }) }), fromCount > 0 && (!isReadOnly || whereCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryWhere, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, whereCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.where)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.where) }), (!formData?.where || formData?.where.length <= 0) && !isReadOnly &&
755
- _jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_WhereItem }) }), formData?.where?.map((wi, index) => {
756
- return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropWhere(e, wi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, wi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
757
- { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_WhereItem(index) },
758
- { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) },
759
- { text: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) },
760
- { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, where: undefined }) },
761
- {
762
- text: "Imposta parametro", items: [
763
- { text: "{@UserName}", onClick: () => onChange_WhereItem_Values("{@UserName}", undefined, index) },
764
- { text: "{@UserID}", onClick: () => onChange_WhereItem_Values("{@UserID}", undefined, index) },
765
- { text: "{@QueryParam...N}", onClick: () => onChange_WhereItem_Values(calcQueryParamN(), undefined, index) }
766
- ]
767
- },
768
- ] }), _jsx(TMQdDropDownMenu, { disabled: index == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: wi.or ? 'OR' : 'AND' }), items: [
769
- { text: 'AND', onClick: () => onChange_WhereItem_Or(false, index) },
770
- { text: 'OR', onClick: () => onChange_WhereItem_Or(true, index) }
771
- ] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == wi.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
772
- let newDynDataListsToBeRefreshed = [];
773
- for (const item of dynDataListsToBeRefreshed) {
774
- let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
775
- if (index >= 0)
776
- continue;
777
- newDynDataListsToBeRefreshed.push(item);
778
- }
779
- for (const item of ddlToBeRefreshed) {
780
- if (item.queryParams.length <= 0)
781
- continue;
782
- if (!item.mid)
783
- continue;
784
- if (item.mid <= 0)
785
- continue;
786
- newDynDataListsToBeRefreshed.push(item);
787
- }
788
- setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
789
- }, onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); } }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
790
- })] }) }) }), fromCount > 0 && (!isReadOnly || orderByCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryOrderBy, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, orderByCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.orderBy)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [(!formData?.orderBy || formData?.orderBy.length <= 0) && !isReadOnly &&
791
- _jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_OrderByItem }) }), formData?.orderBy?.map((oi, index) => {
792
- return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropOrderBy(e, oi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, oi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
793
- { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OrderByItem(index) },
794
- { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) },
795
- { text: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) },
796
- { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, orderBy: undefined }) },
797
- ] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, showId: showId, borderRadius: borderRadius, backgroundColor: getColorIndex({ tid: oi.tid, alias: oi.alias }), qd: formData, values: [{ tid: oi.tid, mid: oi.mid, aliasTID: oi.alias }], onValueChanged: (values) => onChange_OrderByItem_MID(values[0], index) }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: oi.asc ? 'ASC' : 'DESC' }), items: [
798
- { text: 'ASC', onClick: () => onChange_OrderByItem_Asc(true, oi, index) },
799
- { text: 'DESC', onClick: () => onChange_OrderByItem_Asc(false, oi, index) }
800
- ] })] }, `${oi.tid}_${oi.mid}_${index}`));
801
- })] }) }) }), fromCount > 0 && _jsx(Item, { title: SDKUI_Localizator.Options, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, undefined, []), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [showDistinct && _jsx(TMCheckBox, { label: SDK_Localizator.QueryDistinct, value: formData.isDistinct, onValueChanged: () => { setFormData({ ...formData, isDistinct: !formData.isDistinct }); } }), _jsx(TMTextBox, { type: 'number', width: '200px', label: SDKUI_Localizator.MaxDcmtsToBeReturned, validationItems: validationItems.filter((o) => o.PropertyName == TMPropertyNames.maxDcmtsToBeReturned), value: formData.maxDcmtsToBeReturned, onBlur: (newValue) => setFormData({ ...formData, maxDcmtsToBeReturned: Number(newValue) }) })] }) }) })] }) }), showResultSearch && _jsxs(StyledModalContainer, { children: [" ", renderResultSearchForm, " "] })] }));
717
+ ] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.leftTID, alias: onItem.leftAlias }), qd: formData, values: onItem.leftTID ? [{ tid: onItem.leftTID, mid: onItem.leftMID, aliasTID: onItem.leftAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoLeft(values[0], index, indexOn); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.rightTID, alias: onItem.rightAlias }), qd: formData, values: onItem.rightTID ? [{ tid: onItem.rightTID, mid: onItem.rightMID, aliasTID: onItem.rightAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoRight(values[0], index, indexOn); } })] }, indexOn));
718
+ })] }, `${ji.tid}_${index}`));
719
+ }), _jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.join) })] }) }) }), fromCount > 0 && (!isReadOnly || selectCount > 0) && validateSelect && _jsx(Item, { title: SDK_Localizator.QuerySelect, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, selectCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.select)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.select) }), (!formData?.select || formData?.select.length <= 0) && !isReadOnly &&
720
+ _jsxs(StyledRowItem, { children: [_jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_SelectItem }), dcmtTypesList.length == 1
721
+ ? _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls, onClick: () => { onAddAll_SelectItem(qdTIDs[0]); } })
722
+ : _jsx(TMQdDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls }), items: qdTIDs.map((tid_alias) => ({ text: `${getDisplayAlias(getDcmtTypeName(tid_alias.tid), tid_alias.alias)}`, onClick: () => { onAddAll_SelectItem(tid_alias); } })) })] }), formData?.select?.map((si, index) => {
723
+ return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropSelect(e, si), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, si), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_SelectItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_SelectItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: getSelectMenuItems(index) }), (!isReadOnly || (si.function && si.function != QueryFunctions.None)) && _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: si.function === QueryFunctions.None ? "..." : LocalizeQueryFunctions(si.function) }), items: getQueryFunctionsMenuItems(si, index) }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: si.tid, alias: si.alias }), qd: formData, values: [{ tid: si.tid, mid: si.mid, aliasTID: si.alias }], onValueChanged: (values) => { values.length > 0 && onChange_SelectItem_MID(values[0], index); } }), (!isReadOnly || si.as) && _jsx(TMQdEditableItem, { value: si.as, backgroundColor: colorValue, placeHolder: `<${SDKUI_Localizator.Query_EnterAlias}...>`, width: '100%', onValueChanged: (value) => { onChange_SelectItem_As(value, index); } })] }, `${si.tid}_${si.mid}_${index}`));
724
+ })] }) }) }), fromCount > 0 && (!isReadOnly || whereCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryWhere, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, whereCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.where)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.where) }), (!formData?.where || formData?.where.length <= 0) && !isReadOnly &&
725
+ _jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_WhereItem }) }), formData?.where?.map((wi, index) => {
726
+ return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropWhere(e, wi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, wi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
727
+ { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_WhereItem(index) },
728
+ { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) },
729
+ { text: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) },
730
+ { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, where: undefined }) },
731
+ {
732
+ text: "Imposta parametro", items: [
733
+ { text: "{@UserName}", onClick: () => onChange_WhereItem_Values("{@UserName}", undefined, index) },
734
+ { text: "{@UserID}", onClick: () => onChange_WhereItem_Values("{@UserID}", undefined, index) },
735
+ { text: "{@QueryParam...N}", onClick: () => onChange_WhereItem_Values(calcQueryParamN(), undefined, index) }
736
+ ]
737
+ },
738
+ ] }), _jsx(TMQdDropDownMenu, { disabled: index == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: wi.or ? 'OR' : 'AND' }), items: [
739
+ { text: 'AND', onClick: () => onChange_WhereItem_Or(false, index) },
740
+ { text: 'OR', onClick: () => onChange_WhereItem_Or(true, index) }
741
+ ] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == wi.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
742
+ let newDynDataListsToBeRefreshed = [];
743
+ for (const item of dynDataListsToBeRefreshed) {
744
+ let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
745
+ if (index >= 0)
746
+ continue;
747
+ newDynDataListsToBeRefreshed.push(item);
748
+ }
749
+ for (const item of ddlToBeRefreshed) {
750
+ if (item.queryParams.length <= 0)
751
+ continue;
752
+ if (!item.mid)
753
+ continue;
754
+ if (item.mid <= 0)
755
+ continue;
756
+ newDynDataListsToBeRefreshed.push(item);
757
+ }
758
+ setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
759
+ }, onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); } }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
760
+ })] }) }) }), fromCount > 0 && (!isReadOnly || orderByCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryOrderBy, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, orderByCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.orderBy)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [(!formData?.orderBy || formData?.orderBy.length <= 0) && !isReadOnly &&
761
+ _jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_OrderByItem }) }), formData?.orderBy?.map((oi, index) => {
762
+ return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropOrderBy(e, oi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, oi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
763
+ { text: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OrderByItem(index) },
764
+ { text: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) },
765
+ { text: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) },
766
+ { text: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, orderBy: undefined }) },
767
+ ] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, showId: showId, borderRadius: borderRadius, backgroundColor: getColorIndex({ tid: oi.tid, alias: oi.alias }), qd: formData, values: [{ tid: oi.tid, mid: oi.mid, aliasTID: oi.alias }], onValueChanged: (values) => onChange_OrderByItem_MID(values[0], index) }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: oi.asc ? 'ASC' : 'DESC' }), items: [
768
+ { text: 'ASC', onClick: () => onChange_OrderByItem_Asc(true, oi, index) },
769
+ { text: 'DESC', onClick: () => onChange_OrderByItem_Asc(false, oi, index) }
770
+ ] })] }, `${oi.tid}_${oi.mid}_${index}`));
771
+ })] }) }) }), fromCount > 0 && _jsx(Item, { title: SDKUI_Localizator.Options, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, undefined, []), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [showDistinct && _jsx(TMCheckBox, { label: SDK_Localizator.QueryDistinct, value: formData.isDistinct, onValueChanged: () => { setFormData({ ...formData, isDistinct: !formData.isDistinct }); } }), _jsx(TMTextBox, { type: 'number', width: '200px', label: SDKUI_Localizator.MaxDcmtsToBeReturned, validationItems: validationItems.filter((o) => o.PropertyName == TMPropertyNames.maxDcmtsToBeReturned), value: formData.maxDcmtsToBeReturned, onBlur: (newValue) => setFormData({ ...formData, maxDcmtsToBeReturned: Number(newValue) }) })] }) }) })] }), _jsx(ConfirmQueryParamsDialog, {})] }), showResultSearch && _jsxs(StyledModalContainer, { children: [" ", renderResultSearchForm, " "] })] }));
802
772
  };
803
773
  export default TMQueryEditor;
804
774
  const TMQdEditableItem = ({ value, placeHolder, width, backgroundColor, onValueChanged }) => {
@@ -84,6 +84,7 @@ export declare class SDKUI_Localizator {
84
84
  static get EmailIsNotValid(): "Dies ist keine gültige e-mail Adresse" | "This is not a valid email address" | "Esta no es una dirección de correo electrónico válida." | "Cette adresse email n'est pas valide" | "Este não é um endereço de e-mail válido" | "Questo non è un indirizzo e-mail valido";
85
85
  static get Endpoint(): "Zugangspunkt" | "Endpoint" | "Punto de acceso" | "Point d'entrée" | "Ponto de acesso" | "Punto di accesso";
86
86
  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";
87
+ static get EnterValue(): "Geben Sie einen Wert ein" | "Enter a value" | "Introducir un valor" | "Entrez une valeur" | "Digite um valor" | "Inserire un valore";
87
88
  static get Error(): "Fehler" | "Error" | "Erreur" | "Erro" | "Errore";
88
89
  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.";
89
90
  static get Export(): "Exportieren" | "Export" | "Exportar" | "Exporter" | "Esporta";
@@ -154,6 +155,8 @@ export declare class SDKUI_Localizator {
154
155
  static get OpenInNewTab(): "In einem neuen Tab öffnen" | "Open in new tab" | "Abrir en una nueva pestaña" | "Ouvrir dans un nouvel onglet" | "Abrir em uma nova aba" | "Apri in un nuovo tab";
155
156
  static get OnBehalfOf(): "im Auftrag von" | "on behalf of" | "a nombre de" | "de la part de" | "em nome de" | "per conto di";
156
157
  static get OneMore(): "andere" | "more" | "otro" | "autre" | "outro" | "altro";
158
+ static get OperationResult(): "Operationsergebnis" | "Operation result" | "Resultado de la operación" | "Résultat de l'opération" | "Resultado da operação" | "Esito operazione";
159
+ static get OperationSuccess(): "Vorgang erfolgreich abgeschlossen" | "Operation completed successfully" | "Operación completada con éxito" | "Opération terminée avec succès" | "Operação concluída com sucesso" | "Operazione completata con successo";
157
160
  static get Options(): "Optionen" | "Options" | "Opciones" | "Opções" | "Opzioni";
158
161
  static get OTPSent(): "Der OTP-Code wurde an gesendet " | "OTP code has been sent to " | "El código OTP ha sido enviado a " | "Le code OTP a été envoyé à " | "O código OTP foi enviado para " | "Il codice OTP è stato inviato a ";
159
162
  static get OTPNewRequest(): "Wenn Sie noch kein OTP erhalten haben, können Sie ein neues OTP anfordern " | "If You haven't received OTP yet, you can request a new OTP in " | "Si aún no ha recibido OTP, puede solicitar una nueva OTP en " | "Ii vous n'avez pas encore reçu d'OTP, vous pouvez demander un nouvel OTP en " | "Se você ainda não recebeu o OTP, poderá solicitar um novo OTP em " | "Se non hai ancora ricevuto la OTP, puoi richiederne una nuova entro";
@@ -180,10 +183,12 @@ export declare class SDKUI_Localizator {
180
183
  static get Perms(): "Berechtigungen" | "Permissions" | "Permisos" | "Autorisations" | "Permissão" | "Permessi";
181
184
  static get PhysDelete(): "Physische Stornierung" | "Physical delete" | "Cancelación física" | "Supression" | "Cancelamento física" | "Cancellazione fisica";
182
185
  static get Previous(): "Vorherige" | "Previous" | "Anterior" | "Précédent" | "Precedente";
186
+ static get ProcessedItems(): "Durchdachte Elemente" | "Processed items" | "Elementos elaborados" | "Items traités" | "Itens processados" | "Elementi elaborati";
183
187
  static get QueryClear(): "Query bereinigen" | "Clear query" | "Limpiar consulta" | "Efface query" | "Limpar query" | "Pulisci query";
184
188
  static get QueryCount(): "Zählanfragen" | "Query count" | "Contar consulta" | "Compte query" | "Count query" | "Conta query";
185
189
  static get QueryDefine(): "Abfrage definieren" | "Query define" | "Definir consulta" | "Défine query" | "Definir query" | "Definisci query";
186
190
  static get Query_EnterAlias(): "Geben Sie einen Alias ​​ein" | "Enter an alias" | "Introducir un alias" | "Entrez un alias" | "Digite um nome de alias" | "Inserire un alias";
191
+ static get QueryParamBind(): "Query-Parameter erweitern" | "Fill query parameters" | "Valorizar parámetros consulta" | "Ajoute la valeur à les paramètres de la query" | "Melhora parâmetros de query" | "Valorizza parametri query";
187
192
  static get Recent(): "Kürzlich" | "Recent" | "Recientes" | "Récents" | "Recentes" | "Recenti";
188
193
  static get Relations(): "Korrelationen" | "Correlations" | "Correlaciones" | "Relations" | "Correlacionados" | "Correlazioni";
189
194
  static get RelationManyToMany(): "Folge viele mit vielen" | "Relation many to many" | "Correlación muchos a muchos" | "Corrélation plusieurs à plusieurs" | "Muitos para muitos relação" | "Correlazione molti a molti";
@@ -801,6 +801,16 @@ export class SDKUI_Localizator {
801
801
  return "Inserire un nome per l'accesso";
802
802
  }
803
803
  }
804
+ static get EnterValue() {
805
+ switch (this._cultureID) {
806
+ case CultureIDs.De_DE: return "Geben Sie einen Wert ein";
807
+ case CultureIDs.En_US: return "Enter a value";
808
+ case CultureIDs.Es_ES: return "Introducir un valor";
809
+ case CultureIDs.Fr_FR: return "Entrez une valeur";
810
+ case CultureIDs.Pt_PT: return "Digite um valor";
811
+ default: return "Inserire un valore";
812
+ }
813
+ }
804
814
  static get Error() {
805
815
  switch (this._cultureID) {
806
816
  case CultureIDs.De_DE: return "Fehler";
@@ -1492,6 +1502,26 @@ export class SDKUI_Localizator {
1492
1502
  default: return "altro";
1493
1503
  }
1494
1504
  }
1505
+ static get OperationResult() {
1506
+ switch (this._cultureID) {
1507
+ case CultureIDs.De_DE: return "Operationsergebnis";
1508
+ case CultureIDs.En_US: return "Operation result";
1509
+ case CultureIDs.Es_ES: return "Resultado de la operación";
1510
+ case CultureIDs.Fr_FR: return "Résultat de l'opération";
1511
+ case CultureIDs.Pt_PT: return "Resultado da operação";
1512
+ default: return "Esito operazione";
1513
+ }
1514
+ }
1515
+ static get OperationSuccess() {
1516
+ switch (this._cultureID) {
1517
+ case CultureIDs.De_DE: return "Vorgang erfolgreich abgeschlossen";
1518
+ case CultureIDs.En_US: return "Operation completed successfully";
1519
+ case CultureIDs.Es_ES: return "Operación completada con éxito";
1520
+ case CultureIDs.Fr_FR: return "Opération terminée avec succès";
1521
+ case CultureIDs.Pt_PT: return "Operação concluída com sucesso";
1522
+ default: return "Operazione completata con successo";
1523
+ }
1524
+ }
1495
1525
  static get Options() {
1496
1526
  switch (this._cultureID) {
1497
1527
  case CultureIDs.De_DE: return "Optionen";
@@ -1752,6 +1782,16 @@ export class SDKUI_Localizator {
1752
1782
  default: return "Precedente";
1753
1783
  }
1754
1784
  }
1785
+ static get ProcessedItems() {
1786
+ switch (this._cultureID) {
1787
+ case CultureIDs.De_DE: return "Durchdachte Elemente";
1788
+ case CultureIDs.En_US: return "Processed items";
1789
+ case CultureIDs.Es_ES: return "Elementos elaborados";
1790
+ case CultureIDs.Fr_FR: return "Items traités";
1791
+ case CultureIDs.Pt_PT: return "Itens processados";
1792
+ default: return "Elementi elaborati";
1793
+ }
1794
+ }
1755
1795
  static get QueryClear() {
1756
1796
  switch (this._cultureID) {
1757
1797
  case CultureIDs.De_DE: return "Query bereinigen";
@@ -1792,6 +1832,16 @@ export class SDKUI_Localizator {
1792
1832
  default: return "Inserire un alias";
1793
1833
  }
1794
1834
  }
1835
+ static get QueryParamBind() {
1836
+ switch (this._cultureID) {
1837
+ case CultureIDs.De_DE: return "Query-Parameter erweitern";
1838
+ case CultureIDs.En_US: return "Fill query parameters";
1839
+ case CultureIDs.Es_ES: return "Valorizar parámetros consulta";
1840
+ case CultureIDs.Fr_FR: return "Ajoute la valeur à les paramètres de la query";
1841
+ case CultureIDs.Pt_PT: return "Melhora parâmetros de query";
1842
+ default: return "Valorizza parametri query";
1843
+ }
1844
+ }
1795
1845
  static get Recent() {
1796
1846
  switch (this._cultureID) {
1797
1847
  case CultureIDs.De_DE: return "Kürzlich";
@@ -1,4 +1,4 @@
1
- import { DcmtTypeDescriptor, MetadataDescriptor, QueryDescriptor } from '@topconsultnpm/sdk-ts-beta';
1
+ import { DcmtTypeDescriptor, MetadataDescriptor, SystemMIDsAsNumber, QueryDescriptor, SelectItem } from '@topconsultnpm/sdk-ts-beta';
2
2
  export type TID_Alias = {
3
3
  tid: number;
4
4
  alias: string | undefined;
@@ -6,3 +6,6 @@ export type TID_Alias = {
6
6
  export declare const getTIDsByQd: (qd: QueryDescriptor | undefined) => TID_Alias[];
7
7
  export declare const getDcmtTypesByQdAsync: (qd: QueryDescriptor) => Promise<DcmtTypeDescriptor[]>;
8
8
  export declare const displayMetadataValue: (md: MetadataDescriptor | undefined, value: string | undefined, valueEmptyDescription?: string) => string;
9
+ export declare const IsParametricQuery: (qd: QueryDescriptor | undefined) => boolean;
10
+ export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | undefined, mid: SystemMIDsAsNumber) => void;
11
+ export declare const prepareQdForSearchAsync: (qdInput?: QueryDescriptor) => Promise<QueryDescriptor>;
@@ -1,4 +1,4 @@
1
- import { MetadataDataDomains, DcmtTypeListCacheService, MetadataDataTypes } from '@topconsultnpm/sdk-ts-beta';
1
+ import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities } from '@topconsultnpm/sdk-ts-beta';
2
2
  import { DateDisplayTypes, Globalization } from './Globalization';
3
3
  export const getTIDsByQd = (qd) => {
4
4
  let tids = [];
@@ -30,3 +30,69 @@ export const displayMetadataValue = (md, value, valueEmptyDescription = "") => {
30
30
  }
31
31
  }
32
32
  };
33
+ export const IsParametricQuery = (qd) => {
34
+ if (qd == undefined)
35
+ return false;
36
+ if (qd.where == undefined)
37
+ return false;
38
+ let qp = "{@QueryParam";
39
+ for (const wi of qd.where) {
40
+ if (wi.value1?.includes(qp))
41
+ return true;
42
+ if (wi.value2?.includes(qp))
43
+ return true;
44
+ }
45
+ return false;
46
+ };
47
+ export const addHiddenSelectItem = (select, tid, mid) => {
48
+ if (select.findIndex(o => o.mid == mid) >= 0)
49
+ return;
50
+ let si = new SelectItem();
51
+ si.tid = tid;
52
+ si.mid = mid;
53
+ si.visibility = SelectItemVisibilities.Hidden;
54
+ select.push(si);
55
+ };
56
+ export const prepareQdForSearchAsync = async (qdInput) => {
57
+ let qd = new QueryDescriptor();
58
+ qd.init({ ...qdInput });
59
+ let fromTID = qd?.from?.tid;
60
+ if (!qd.select)
61
+ qd.select = [];
62
+ if (!qd.orderBy)
63
+ qd.orderBy = [];
64
+ let qdWithAggrFunctions = qd.select?.some(o => o.function != QueryFunctions.None && o.function != undefined);
65
+ if (!qd.isDistinct && !qdWithAggrFunctions) {
66
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.TID);
67
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.DID);
68
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.OwnerID);
69
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.UpdaterID);
70
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.CreationTime);
71
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.LastUpdateTime);
72
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.FileCount);
73
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.FileExt);
74
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.FileSize);
75
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsLex);
76
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsLogDel);
77
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsMail);
78
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsSigned);
79
+ addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsShared);
80
+ }
81
+ // Alcuni lavori di ORCHESTRATOR non definiscono i SelectItem (per esempio, CheckSequence, DcmtPrinter, ...).
82
+ // In tal caso il risultato della ricerca risultava senza colonne (metadati).
83
+ // In questa condizione si è deciso di visualizzare, di default, i primi 10 metadati.
84
+ if (qd.select.filter(o => o.mid > 100).length <= 0) {
85
+ let dtd = await DcmtTypeListCacheService.GetAsync(fromTID, true);
86
+ if (dtd?.metadata) {
87
+ for (const md of dtd.metadata.filter(o => o.isSystem != 1 && o.perm?.canView != AccessLevels.No).slice(0, 10)) {
88
+ let si = new SelectItem();
89
+ si.visibility = SelectItemVisibilities.Visible;
90
+ si.tid = dtd.id;
91
+ si.mid = md.id;
92
+ qd.select.push(si);
93
+ }
94
+ }
95
+ }
96
+ qd.isLexProt = 1;
97
+ return qd;
98
+ };
@@ -0,0 +1,2 @@
1
+ import { QueryDescriptor, QueryParameterDescriptor } from '@topconsultnpm/sdk-ts-beta';
2
+ export declare const useQueryParametersDialog: () => [(inputQd: QueryDescriptor) => Promise<QueryParameterDescriptor[]>, () => JSX.Element];
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { QueryParameterDescriptor } from '@topconsultnpm/sdk-ts-beta';
4
+ import { TMModal, TMTextBox, TMButton } from "../components";
5
+ import { IconApply, IconCloseOutline, SDKUI_Localizator } from "../helper";
6
+ import { TMColors } from "../utils/theme";
7
+ const paramPrefix = "{@QueryParam";
8
+ export const useQueryParametersDialog = () => {
9
+ const [promise, setPromise] = useState(null);
10
+ const [open, setOpen] = useState(false);
11
+ const [qdParams, setQdParams] = useState([]);
12
+ let qdParamsOut = [];
13
+ const confirmQueryParams = (inputQd) => new Promise((resolve, reject) => {
14
+ if (inputQd.where) {
15
+ let newQueryParams = [];
16
+ let id = 1;
17
+ for (const wi of inputQd.where) {
18
+ if (wi.value1?.startsWith(paramPrefix)) {
19
+ let qpd = new QueryParameterDescriptor();
20
+ qpd.id = id++;
21
+ qpd.name = wi.value1;
22
+ if (newQueryParams.findIndex(o => o.name == wi.value1) < 0)
23
+ newQueryParams.push(qpd);
24
+ }
25
+ if (wi.value2?.startsWith(paramPrefix)) {
26
+ let qpd = new QueryParameterDescriptor();
27
+ qpd.id = id++;
28
+ qpd.name = wi.value2;
29
+ if (newQueryParams.findIndex(o => o.name == wi.value2) < 0)
30
+ newQueryParams.push(qpd);
31
+ }
32
+ }
33
+ setQdParams(newQueryParams);
34
+ }
35
+ setOpen(true);
36
+ setPromise({ resolve });
37
+ });
38
+ const handleClose = () => {
39
+ setOpen(false);
40
+ setPromise(null);
41
+ };
42
+ const handleConfirm = () => {
43
+ console.log(qdParamsOut);
44
+ promise?.resolve(qdParamsOut);
45
+ handleClose();
46
+ };
47
+ const handleCancel = () => {
48
+ promise?.resolve([]);
49
+ handleClose();
50
+ };
51
+ const ConfirmQueryParamsDialog = () => {
52
+ return (open ?
53
+ _jsx(TMModal, { title: SDKUI_Localizator.QueryParamBind, height: "max-content", width: "400px", onClose: handleClose, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '5px', padding: '10px', height: '100%' }, children: [qdParams.map((qdp, index) => {
54
+ return (_jsx(TMTextBox, { placeHolder: `${SDKUI_Localizator.EnterValue} ...`, label: qdp.name, autoFocus: index == 0, value: qdp.value, onValueChanged: (e) => {
55
+ qdParamsOut = qdParams.map((curItem) => {
56
+ if (curItem.id != qdp.id)
57
+ return curItem;
58
+ return { ...curItem, value: e.target.value };
59
+ });
60
+ } }, qdp.id));
61
+ }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', paddingTop: '10px', justifyContent: 'flex-end', alignItems: 'center', height: '50px' }, children: [_jsx(TMButton, { btnStyle: "advanced", showTooltip: false, icon: _jsx(IconApply, {}), caption: "OK", advancedColor: TMColors.tertiary, onClick: handleConfirm }), _jsx(TMButton, { btnStyle: "advanced", showTooltip: false, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Cancel, onClick: handleCancel })] })] }) })
62
+ : _jsx(_Fragment, {}));
63
+ };
64
+ return [confirmQueryParams, ConfirmQueryParamsDialog];
65
+ };
package/lib/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './helper';
4
4
  export * from './utils/theme';
5
5
  export * from './hooks/useForm';
6
6
  export * from './hooks/useOutsideClick';
7
+ export * from './hooks/useOutsideClick';
7
8
  export * from './services';
package/lib/index.js CHANGED
@@ -4,4 +4,5 @@ export * from './helper';
4
4
  export * from './utils/theme';
5
5
  export * from './hooks/useForm';
6
6
  export * from './hooks/useOutsideClick';
7
+ export * from './hooks/useOutsideClick';
7
8
  export * from './services';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.8.63",
3
+ "version": "6.8.65",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",