@topconsultnpm/sdkui-react-beta 6.12.43 → 6.12.44
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.
- package/lib/components/features/archive/TMArchive.d.ts +6 -0
- package/lib/components/features/archive/TMArchive.js +57 -0
- package/lib/components/{query → features/documents}/TMBatchUpdateForm.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMBatchUpdateForm.js +18 -18
- package/lib/components/{query → features/documents}/TMDcmtBlog.js +4 -4
- package/lib/components/{query → features/documents}/TMDcmtForm.d.ts +2 -2
- package/lib/components/{query → features/documents}/TMDcmtForm.js +22 -22
- package/lib/components/{query → features/documents}/TMDcmtIcon.js +2 -2
- package/lib/components/{query → features/documents}/TMDcmtPreview.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMDcmtPreview.js +14 -14
- package/lib/components/{query → features/documents}/TMFileUploader.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMFileUploader.js +10 -10
- package/lib/components/{query → features/documents}/TMMasterDetailDcmts.d.ts +2 -2
- package/lib/components/{query → features/documents}/TMMasterDetailDcmts.js +20 -20
- package/lib/components/{search → features/search}/TMSavedQueryForm.d.ts +1 -1
- package/lib/components/{search → features/search}/TMSavedQueryForm.js +10 -10
- package/lib/components/{search → features/search}/TMSavedQuerySelector.js +9 -9
- package/lib/components/{search → features/search}/TMSearch.d.ts +1 -1
- package/lib/components/{search → features/search}/TMSearch.js +6 -6
- package/lib/components/{search → features/search}/TMSearchQueryEditor.d.ts +1 -1
- package/lib/components/{search → features/search}/TMSearchQueryEditor.js +11 -11
- package/lib/components/{search → features/search}/TMSearchQueryPanel.d.ts +2 -2
- package/lib/components/{search → features/search}/TMSearchQueryPanel.js +16 -16
- package/lib/components/{search → features/search}/TMSearchResult.d.ts +1 -1
- package/lib/components/{search → features/search}/TMSearchResult.js +30 -30
- package/lib/components/{search → features/search}/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/{search → features/search}/TMSearchResultsMenuItems.js +5 -5
- package/lib/components/{search → features/search}/TMTreeSelector.js +7 -7
- package/lib/components/{query → features/workflow}/TMWorkflowPopup.d.ts +1 -1
- package/lib/components/{query → features/workflow}/TMWorkflowPopup.js +8 -8
- package/lib/components/grids/TMBlogsUtils.d.ts +2 -1
- package/lib/components/index.d.ts +5 -2
- package/lib/components/index.js +8 -2
- package/lib/components/query/TMQueryEditor.js +5 -8
- package/package.json +1 -1
- package/lib/components/query/TMQueryResult.d.ts +0 -10
- package/lib/components/query/TMQueryResult.js +0 -42
- package/lib/components/query/TMQueryResultForm.d.ts +0 -17
- package/lib/components/query/TMQueryResultForm.js +0 -318
- /package/lib/components/{query → features/documents}/TMDcmtBlog.d.ts +0 -0
- /package/lib/components/{query → features/documents}/TMDcmtIcon.d.ts +0 -0
- /package/lib/components/{search → features/search}/TMSavedQuerySelector.d.ts +0 -0
- /package/lib/components/{search → features/search}/TMTreeSelector.d.ts +0 -0
@@ -4,36 +4,36 @@ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, M
|
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import { commandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
6
6
|
import { ContextMenu } from 'devextreme-react';
|
7
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconTag, IconDetails, IconCommand, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, IconSave, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, SDKUI_Globals, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues } from '
|
8
|
-
import { useDcmtOperations } from '
|
9
|
-
import { useInputCvtFormatDialog } from '
|
10
|
-
import { DcmtOperationTypes, FormModes, SearchResultContext } from '
|
11
|
-
import { TMColors } from '
|
12
|
-
import { StyledModalContainer, StyledBadge, StyledMultiViewPanel } from '
|
13
|
-
import ShowAlert from '
|
14
|
-
import TMButton from '
|
15
|
-
import TMDataGrid, { TMDataGridPageSize } from '
|
16
|
-
import { useDeviceType, DeviceType } from '
|
17
|
-
import { TMSplitterLayout, TMLayoutItem } from '
|
18
|
-
import { CustomListViewHeader } from '
|
19
|
-
import { TMMessageBoxManager, ButtonNames } from '
|
20
|
-
import TMToolbarCard from '
|
21
|
-
import TMTooltip from '
|
22
|
-
import { TMLayoutWaitingContainer } from '
|
23
|
-
import { TMUserIdViewer } from '
|
24
|
-
import TMMetadataValues from '
|
25
|
-
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '
|
26
|
-
import TMDataListItemViewer from '
|
27
|
-
import TMTidViewer from '
|
28
|
-
import
|
29
|
-
import {
|
30
|
-
import
|
31
|
-
import
|
32
|
-
import
|
33
|
-
import
|
34
|
-
import
|
35
|
-
import
|
36
|
-
import
|
7
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconTag, IconDetails, IconCommand, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, IconSave, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, SDKUI_Globals, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues } from '../../../helper';
|
8
|
+
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
9
|
+
import { useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
10
|
+
import { DcmtOperationTypes, FormModes, SearchResultContext } from '../../../ts';
|
11
|
+
import { TMColors } from '../../../utils/theme';
|
12
|
+
import { StyledModalContainer, StyledBadge, StyledMultiViewPanel } from '../../base/Styled';
|
13
|
+
import ShowAlert from '../../base/TMAlert';
|
14
|
+
import TMButton from '../../base/TMButton';
|
15
|
+
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
16
|
+
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
17
|
+
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
18
|
+
import { CustomListViewHeader } from '../../base/TMListView';
|
19
|
+
import { TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
20
|
+
import TMToolbarCard from '../../base/TMToolbarCard';
|
21
|
+
import TMTooltip from '../../base/TMTooltip';
|
22
|
+
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
23
|
+
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
24
|
+
import TMMetadataValues from '../../editors/TMMetadataValues';
|
25
|
+
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
26
|
+
import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
27
|
+
import TMTidViewer from '../../viewers/TMTidViewer';
|
28
|
+
import { hasDetailRelations, hasMasterRelations } from '../../../helper/dcmtsHelper';
|
29
|
+
import TMDcmtPreview, { TMNothingToShow } from '../documents/TMDcmtPreview';
|
30
|
+
import TMFloatingToolbar from '../../base/TMFloatingToolbar';
|
31
|
+
import { WorkFlowApproveRejectPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
32
|
+
import TMMasterDetailDcmts from '../documents/TMMasterDetailDcmts';
|
33
|
+
import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
34
|
+
import TMDcmtForm from '../documents/TMDcmtForm';
|
35
|
+
import TMDcmtBlog from '../documents/TMDcmtBlog';
|
36
|
+
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
37
37
|
//#endregion region Interfaces, Types and Enums
|
38
38
|
//#region Styled Components
|
39
39
|
const StyledContainer = styled.div ` overflow: hidden; background-color: #ffffff; width: calc(100%); height: calc(100%); display: flex; gap: 10px; `;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { DcmtTypeDescriptor, FileFormats, LayoutModes, RecentCategories } from '@topconsultnpm/sdk-ts-beta';
|
3
|
-
import { TMDataGridContextMenuItem } from '
|
4
|
-
import { DcmtInfo, DcmtOperationTypes, SearchResultContext } from '
|
3
|
+
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
4
|
+
import { DcmtInfo, DcmtOperationTypes, SearchResultContext } from '../../../ts';
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, category?: RecentCategories, fileFormat?: FileFormats) => DcmtInfo[];
|
6
6
|
export declare const commandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, openTaskFormHandler: (value: boolean) => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, fromDatagrid: boolean, showDetailDcmts: boolean) => Array<TMDataGridContextMenuItem>;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { AccessLevels, AccessLevelsEx, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconHide, IconInfo, IconPreview, IconRelation, IconSave, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '
|
4
|
-
import ShowAlert from '
|
5
|
-
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '
|
6
|
-
import TMSpinner from '
|
7
|
-
import { DcmtOperationTypes, SearchResultContext } from '
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconHide, IconInfo, IconPreview, IconRelation, IconSave, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '../../../helper';
|
4
|
+
import ShowAlert from '../../base/TMAlert';
|
5
|
+
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
6
|
+
import TMSpinner from '../../base/TMSpinner';
|
7
|
+
import { DcmtOperationTypes, SearchResultContext } from '../../../ts';
|
8
8
|
const disabledForSingleRow = (selectedItems, focusedItem) => {
|
9
9
|
return selectedItems.length > 1 || focusedItem === undefined;
|
10
10
|
};
|
@@ -3,13 +3,13 @@ import { useCallback, useEffect, useState } from 'react';
|
|
3
3
|
import { LayoutModes, LocalStorageService, SDK_Globals, SDK_Localizator, TreeCacheService, TreeItemTypes } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import { TreeList, Column, Scrolling, Selection } from 'devextreme-react/tree-list';
|
5
5
|
import { DropDownBox } from 'devextreme-react';
|
6
|
-
import { IconStarRemove, IconStar, SDKUI_Localizator, SDKUI_Globals } from '
|
7
|
-
import { StyledDivHorizontal } from '
|
8
|
-
import TMButton from '
|
9
|
-
import TMDataGrid from '
|
10
|
-
import TMLayoutContainer, { TMLayoutItem } from '
|
11
|
-
import TMToolbarCard from '
|
12
|
-
import TMTidViewer from '
|
6
|
+
import { IconStarRemove, IconStar, SDKUI_Localizator, SDKUI_Globals } from '../../../helper';
|
7
|
+
import { StyledDivHorizontal } from '../../base/Styled';
|
8
|
+
import TMButton from '../../base/TMButton';
|
9
|
+
import TMDataGrid from '../../base/TMDataGrid';
|
10
|
+
import TMLayoutContainer, { TMLayoutItem } from '../../base/TMLayout';
|
11
|
+
import TMToolbarCard from '../../base/TMToolbarCard';
|
12
|
+
import TMTidViewer from '../../viewers/TMTidViewer';
|
13
13
|
const TMTreeSelector = ({ layoutMode = LayoutModes.Update, onSelectedTIDChanged, onClose }) => {
|
14
14
|
const [trees, setTrees] = useState([]);
|
15
15
|
const [treeItems, setTreeItems] = useState([]);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DeviceType } from "
|
1
|
+
import { DeviceType } from "../../base/TMDeviceProvider";
|
2
2
|
export declare const WorkFlowOperationButtons: ({ isInDcmtForm, deviceType, onApprove, onReAssign, onReject, approveDisable, reassignDisable, rejectDisable, infoDisable }: {
|
3
3
|
isInDcmtForm?: boolean;
|
4
4
|
onApprove?: () => void;
|
@@ -3,14 +3,14 @@ import { useMemo, useState } from "react";
|
|
3
3
|
import { SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import { Menu } from "devextreme-react";
|
5
5
|
import styled from "styled-components";
|
6
|
-
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo } from "
|
7
|
-
import { TMColors } from "
|
8
|
-
import TMButton from "
|
9
|
-
import { DeviceType } from "
|
10
|
-
import TMModal from "
|
11
|
-
import { TMExceptionBoxManager } from "
|
12
|
-
import TMSpinner from "
|
13
|
-
import TMUserChooser from "
|
6
|
+
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo } from "../../../helper";
|
7
|
+
import { TMColors } from "../../../utils/theme";
|
8
|
+
import TMButton from "../../base/TMButton";
|
9
|
+
import { DeviceType } from "../../base/TMDeviceProvider";
|
10
|
+
import TMModal from "../../base/TMModal";
|
11
|
+
import { TMExceptionBoxManager } from "../../base/TMPopUp";
|
12
|
+
import TMSpinner from "../../base/TMSpinner";
|
13
|
+
import TMUserChooser from "../../choosers/TMUserChooser";
|
14
14
|
const StyledWorkFlowOperationButtonsContainer = styled.div `
|
15
15
|
display: flex;
|
16
16
|
align-items: center;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, HomeBlogPost } from "@topconsultnpm/sdk-ts-beta";
|
3
3
|
import { FileItem } from '../base/TMFileManager';
|
4
|
+
import { DcmtInfo } from '../../ts';
|
4
5
|
export declare const DRAFT_TYPE_TID = 6;
|
5
6
|
export declare const colors: {
|
6
7
|
DARK_BLUE: string;
|
@@ -71,7 +72,7 @@ export declare const AttachmentElement: (attachment: BlogPostAttachment, treeFs:
|
|
71
72
|
did: number;
|
72
73
|
fileExt: string;
|
73
74
|
fileSize: string;
|
74
|
-
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string, color: string, handleClickAttachmentFolderFileCallback: ((folderId: number, draftId: number) => void) | undefined, downloadDcmtsAsync: (inputDcmts: Array<
|
75
|
+
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string, color: string, handleClickAttachmentFolderFileCallback: ((folderId: number, draftId: number) => void) | undefined, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined) => Promise<void>) => import("react/jsx-runtime").JSX.Element;
|
75
76
|
export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) => import("react/jsx-runtime").JSX.Element;
|
76
77
|
export declare const IconAndHeaderElement: (blogPost: BlogPost | HomeBlogPost, iconColor: string, isSelected: boolean, headerClickCallback: () => void, searchText: string) => import("react/jsx-runtime").JSX.Element;
|
77
78
|
export declare const findFileItemByDraftID: (tree: FileItem | undefined, draftID: number | undefined) => FileItem | null;
|
@@ -42,10 +42,13 @@ export * from './choosers/TMMetadataChooser';
|
|
42
42
|
export * from './choosers/TMUserChooser';
|
43
43
|
export { default as TMValidationItemsList } from './grids/TMValidationItemsList';
|
44
44
|
export { default as TMBlogs } from './grids/TMBlogs';
|
45
|
-
export * from './query/TMDcmtIcon';
|
46
45
|
export * from './query/TMQueryEditor';
|
47
|
-
export * from './query/TMQueryResultForm';
|
48
46
|
export * from './query/TMQuerySummary';
|
47
|
+
export * from './features/documents/TMDcmtForm';
|
48
|
+
export * from './features/documents/TMDcmtIcon';
|
49
|
+
export * from './features/archive/TMArchive';
|
50
|
+
export * from './features/search/TMSearch';
|
51
|
+
export * from './features/search/TMSearchResult';
|
49
52
|
export * from './base/TMTab';
|
50
53
|
export { default as TMHeader } from "./sidebar/TMHeader";
|
51
54
|
export { default as TMSidebar } from "./sidebar/TMSidebar";
|
package/lib/components/index.js
CHANGED
@@ -47,10 +47,16 @@ export * from './choosers/TMUserChooser';
|
|
47
47
|
export { default as TMValidationItemsList } from './grids/TMValidationItemsList';
|
48
48
|
export { default as TMBlogs } from './grids/TMBlogs';
|
49
49
|
//query
|
50
|
-
export * from './query/TMDcmtIcon';
|
51
50
|
export * from './query/TMQueryEditor';
|
52
|
-
export * from './query/TMQueryResultForm';
|
53
51
|
export * from './query/TMQuerySummary';
|
52
|
+
//documents
|
53
|
+
export * from './features/documents/TMDcmtForm';
|
54
|
+
export * from './features/documents/TMDcmtIcon';
|
55
|
+
//archive
|
56
|
+
export * from './features/archive/TMArchive';
|
57
|
+
//search
|
58
|
+
export * from './features/search/TMSearch';
|
59
|
+
export * from './features/search/TMSearchResult';
|
54
60
|
//tab
|
55
61
|
export * from './base/TMTab';
|
56
62
|
// others
|
@@ -26,12 +26,12 @@ import { getDisplayAlias } from '../viewers/TMMidViewer';
|
|
26
26
|
import { useApplyForm } from '../../hooks/useForm';
|
27
27
|
import ShowAlert from '../base/TMAlert';
|
28
28
|
import { TMDynDataListItemChooserForm } from '../choosers/TMDynDataListItemChooser';
|
29
|
-
import TMQueryResultForm from './TMQueryResultForm';
|
30
29
|
import TMMetadataEditor from '../editors/TMMetadataEditor';
|
31
30
|
import { ContextMenu } from 'devextreme-react';
|
32
31
|
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
32
|
+
import TMSearchResult from '../features/search/TMSearchResult';
|
33
33
|
export const StyledRowItem = styled.div ` display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 5px; gap: 3px; `;
|
34
|
-
export const StyledItemWrapper = styled.div ` border-radius: ${props => props.$borderRadius
|
34
|
+
export const StyledItemWrapper = styled.div ` border-radius: ${props => props.$borderRadius ?? '4px'}; padding: 4px; font-size: 1rem; user-select: none; width: max-content; `;
|
35
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; `;
|
36
36
|
export const StyledAccordionItemContent = styled.div ` width: 100%; pointer-events: ${props => props.$disabled ? 'none' : ''}; `;
|
37
37
|
export const colorValue = 'rgba(224,224,224,.5)';
|
@@ -67,8 +67,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isModal, showDistinct
|
|
67
67
|
const { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData } = useQueryApplyForm(Descriptors.Query, formMode, inputData, onApplied);
|
68
68
|
const [dcmtTypesList, setDcmtTypesList] = useState([]);
|
69
69
|
const [lastQdParams, setLastQdParams] = useState([]);
|
70
|
-
const [resultSearch, setResultSearch] = useState();
|
71
|
-
const [elapsedTime, setElapsedTime] = useState(0);
|
70
|
+
const [resultSearch, setResultSearch] = useState([]);
|
72
71
|
const [draggingItem, setDraggingItem] = useState();
|
73
72
|
const [showId, setShowId] = useState(false);
|
74
73
|
const [showCompleteMetadataName, setShowCompleteMetadataName] = useState(false);
|
@@ -570,10 +569,9 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isModal, showDistinct
|
|
570
569
|
};
|
571
570
|
// #endregion
|
572
571
|
// #region Ricerca
|
573
|
-
const renderResultSearchForm = _jsx(
|
572
|
+
const renderResultSearchForm = _jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, onClose: () => { setShowResultSearch(false); }, searchResults: resultSearch });
|
574
573
|
const onSearchAsync = async (qdInput) => {
|
575
574
|
try {
|
576
|
-
const startTime = new Date().getTime();
|
577
575
|
let qdSearch = await prepareQdForSearchAsync(qdInput);
|
578
576
|
if (IsParametricQuery(qdSearch)) {
|
579
577
|
const qdParams = await confirmQueryParams(qdSearch, lastQdParams);
|
@@ -597,8 +595,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isModal, showDistinct
|
|
597
595
|
if (dcmtsFound <= 0)
|
598
596
|
ShowAlert({ message: SDKUI_Localizator.NoDcmtFound, mode: 'info', title: SDKUI_Localizator.SearchResult, duration: 3000 });
|
599
597
|
else {
|
600
|
-
|
601
|
-
setResultSearch(result);
|
598
|
+
result && setResultSearch([result]);
|
602
599
|
setShowResultSearch(true);
|
603
600
|
}
|
604
601
|
}
|
package/package.json
CHANGED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { SearchResultDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
2
|
-
declare const TMQueryResult: ({ result, elapsedTime, showHiddenSelectItems, searchText, onSelectionChanged, onDblClick }: {
|
3
|
-
onDblClick?: () => void;
|
4
|
-
onSelectionChanged?: (e: any[]) => void;
|
5
|
-
result: SearchResultDescriptor | undefined;
|
6
|
-
elapsedTime?: number;
|
7
|
-
showHiddenSelectItems?: boolean;
|
8
|
-
searchText?: string;
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
10
|
-
export default TMQueryResult;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useEffect, useState } from 'react';
|
3
|
-
import { DataColumnTypes } from '@topconsultnpm/sdk-ts-beta';
|
4
|
-
import DataGrid, { Column, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from 'devextreme-react/cjs/data-grid';
|
5
|
-
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
6
|
-
import { StyledDivHorizontal, StyledParagraph, cellRenderObjectIcon } from '../base/Styled';
|
7
|
-
import { Globalization, IconAll, IconApply, IconFileDots, IconProgressReady, IconSelected, IconVisible, SDKUI_Globals, getDataColumnName, searchResultDescriptorToSimpleArray } from '../../helper';
|
8
|
-
import { TMColors } from '../../utils/theme';
|
9
|
-
const TMQueryResult = ({ result, elapsedTime, showHiddenSelectItems, searchText, onSelectionChanged, onDblClick }) => {
|
10
|
-
const [dataSource, setDataSource] = useState();
|
11
|
-
const [selectedItems, setSelectedItems] = useState([]);
|
12
|
-
const [visibleItems, setVisibleItems] = useState([]);
|
13
|
-
let gridInstance;
|
14
|
-
useEffect(() => { gridInstance?.instance().searchByText(searchText ?? ''); }, [searchText]);
|
15
|
-
useEffect(() => { setDataSource(searchResultDescriptorToSimpleArray(result)); setSelectedItems([]); }, [result]);
|
16
|
-
function millisecondsToTime(milli) {
|
17
|
-
let milliseconds = milli % 1000;
|
18
|
-
let seconds = Math.floor((milli / 1000) % 60);
|
19
|
-
let minutes = Math.floor((milli / (60 * 1000)) % 60);
|
20
|
-
return minutes + "m " + seconds + "s " + milliseconds.toFixed(2) + "ms";
|
21
|
-
}
|
22
|
-
return (_jsxs(TMLayoutContainer, { gap: 0, children: [_jsx(TMLayoutItem, { height: 'calc(100% - 30px)', children: _jsxs(DataGrid, { ref: (grid) => (gridInstance = grid), keyExpr: "rowIndex", width: '100%', height: '100%', dataSource: dataSource, selectedRowKeys: selectedItems, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onContentReady: (e) => { setVisibleItems(e.component.getVisibleRows().map((row) => { return row.data; })); }, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowKeys); onSelectionChanged && onSelectionChanged(e.selectedRowsData); }, onToolbarPreparing: (e) => {
|
23
|
-
e.toolbarOptions.items.forEach((item) => {
|
24
|
-
if (item.name === "searchPanel") {
|
25
|
-
item.location = "before";
|
26
|
-
}
|
27
|
-
});
|
28
|
-
}, onRowDblClick: onDblClick, children: [_jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(SearchPanel, { visible: false }), _jsx(Scrolling, { mode: 'virtual', useNative: SDKUI_Globals.dataGridUseNativeScrollbar }), _jsx(HeaderFilter, { visible: true }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { dataType: "object", width: 40, visible: true, cellRender: () => cellRenderObjectIcon(_jsx(IconFileDots, { color: '#767676' })) }), result?.dtdResult?.columns?.map((col, index) => {
|
29
|
-
let keyField = getDataColumnName(result?.fromTID, col);
|
30
|
-
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
31
|
-
const dataType = () => {
|
32
|
-
switch (col.dataType) {
|
33
|
-
case DataColumnTypes.DateTime: return "datetime";
|
34
|
-
case DataColumnTypes.Bool: return "boolean";
|
35
|
-
case DataColumnTypes.Number: return "number";
|
36
|
-
default: return "string";
|
37
|
-
}
|
38
|
-
};
|
39
|
-
return (_jsx(Column, { dataField: keyField, caption: col.caption, visible: isVisible || showHiddenSelectItems, dataType: dataType(), format: col.dataType === DataColumnTypes.DateTime ? Globalization.getDateDisplayFormat() : "" }, col.caption + index.toString()));
|
40
|
-
})] }) }), _jsx(TMLayoutItem, { height: 'max-content', children: _jsxs(StyledDivHorizontal, { style: { backgroundColor: TMColors.toolbar_background, height: '30px' }, children: [_jsxs(StyledParagraph, { children: [_jsxs("span", { style: { marginRight: '5px', fontWeight: 'bold' }, children: [" ", _jsx(IconAll, { fontSize: 12 })] }), Globalization.getNumberDisplayValue(dataSource?.length ?? 0, true)] }), _jsxs(StyledParagraph, { children: [_jsxs("span", { style: { marginRight: '5px', fontWeight: 'bold' }, children: [" ", _jsx(IconVisible, { fontSize: 12 })] }), Globalization.getNumberDisplayValue(visibleItems.length ?? 0, true)] }), _jsxs(StyledParagraph, { children: [_jsxs("span", { style: { marginRight: '5px', fontWeight: 'bold' }, children: [" ", _jsx(IconSelected, { fontSize: 12 })] }), Globalization.getNumberDisplayValue(selectedItems.length ?? 0, true)] }), _jsxs(StyledParagraph, { children: [_jsxs("span", { style: { marginRight: '5px', fontWeight: 'bold' }, children: [" ", _jsx(IconApply, { fontSize: 12 })] }), `${Globalization.getNumberDisplayValue(result?.dcmtsReturned ?? 0, true)}/${Globalization.getNumberDisplayValue(result?.dcmtsFound ?? 0, true)}`] }), _jsxs(StyledParagraph, { children: [_jsxs("span", { style: { marginRight: '5px', fontWeight: 'bold' }, children: [" ", _jsx(IconProgressReady, { fontSize: 12 })] }), millisecondsToTime(elapsedTime)] })] }) })] }));
|
41
|
-
};
|
42
|
-
export default TMQueryResult;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { SearchResultDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
2
|
-
import { SearchResultContext } from '../../ts';
|
3
|
-
declare const TMQueryResultForm: ({ onUpdate, isModal, onClose, context, result1, result2, elapsedTime, searchText, tabIcon1, tabIcon2, tabTitle1, tabTitle2 }: {
|
4
|
-
tabTitle1?: string;
|
5
|
-
tabTitle2?: string;
|
6
|
-
tabIcon1?: any;
|
7
|
-
tabIcon2?: any;
|
8
|
-
isModal?: boolean;
|
9
|
-
onClose?: () => void;
|
10
|
-
context?: SearchResultContext;
|
11
|
-
result1?: SearchResultDescriptor | SearchResultDescriptor[];
|
12
|
-
result2?: SearchResultDescriptor | SearchResultDescriptor[];
|
13
|
-
elapsedTime?: number;
|
14
|
-
searchText?: string;
|
15
|
-
onUpdate?: () => Promise<void>;
|
16
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
17
|
-
export default TMQueryResultForm;
|