@topconsultnpm/sdkui-react 6.21.0-dev1.4 → 6.21.0-dev1.41
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/NewComponents/ContextMenu/TMContextMenu.js +2 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -19
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +79 -27
- package/lib/components/base/Styled.d.ts +76 -40
- package/lib/components/base/TMAreaManager.js +28 -11
- package/lib/components/base/TMFileManagerDataGridView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -2
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +5 -3
- package/lib/components/choosers/TMDataListItemChooser.js +25 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +50 -23
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/editors/TMEditorStyled.d.ts +42 -10
- package/lib/components/editors/TMFormulaEditor.js +15 -3
- package/lib/components/editors/TMMetadataEditor.js +4 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +11 -7
- package/lib/components/features/documents/TMDcmtPreview.d.ts +5 -3
- package/lib/components/features/documents/TMDragDropOverlay.js +7 -2
- package/lib/components/features/documents/TMFileUploader.js +4 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +74 -21
- package/lib/components/features/documents/TMRelationViewer.d.ts +6 -1
- package/lib/components/features/documents/TMRelationViewer.js +44 -7
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +13 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -3
- package/lib/components/features/search/TMSearchResult.js +16 -3
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +15 -5
- package/lib/components/forms/TMChooserForm.js +25 -2
- package/lib/components/grids/TMBlogsPost.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -2
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryCountButton.d.ts +11 -0
- package/lib/components/query/TMQueryCountButton.js +32 -0
- package/lib/components/query/TMQueryEditor.d.ts +10 -6
- package/lib/components/query/TMQueryEditor.js +41 -4
- package/lib/components/query/TMQuerySummary.js +3 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +2 -2
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/TMUtils.d.ts +4 -3
- package/lib/helper/TMUtils.js +12 -0
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +18 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +75 -4
- package/lib/hooks/useDocumentOperations.js +13 -8
- package/lib/hooks/useForm.js +20 -14
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +34 -0
- package/lib/hooks/useQueryParametersDialog.js +5 -5
- package/package.json +55 -55
|
@@ -341,6 +341,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
341
341
|
const isUndoingRedoing = useRef(false);
|
|
342
342
|
const initialDiagramRef = useRef(null);
|
|
343
343
|
const notifiedXmlRef = useRef(null);
|
|
344
|
+
const serializationGenRef = useRef(0);
|
|
344
345
|
const svgRef = useRef(null);
|
|
345
346
|
const containerRef = useRef(null);
|
|
346
347
|
const [isDrawingConnection, setIsDrawingConnection] = useState(false);
|
|
@@ -430,10 +431,15 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
430
431
|
setHistoryIndex(newHistory.length);
|
|
431
432
|
}
|
|
432
433
|
setWfDiagram(newDiagram);
|
|
434
|
+
const currentGen = ++serializationGenRef.current;
|
|
433
435
|
(async () => {
|
|
434
436
|
try {
|
|
435
437
|
// await è necessario per attendere il risultato stringa
|
|
436
438
|
const newXml = await serializeWfDiagramToXml(newDiagram);
|
|
439
|
+
// Ignora serializzazioni obsolete: se nel frattempo è partita una nuova serializzazione,
|
|
440
|
+
// questa è vecchia e non deve sovrascrivere il risultato più recente.
|
|
441
|
+
if (currentGen !== serializationGenRef.current)
|
|
442
|
+
return;
|
|
437
443
|
notifiedXmlRef.current = newXml;
|
|
438
444
|
// Chiama il callback per notificare TMWFEditor
|
|
439
445
|
// L'invio dell'XML al genitore avviene solo a serializzazione completata.
|
|
@@ -449,7 +455,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
449
455
|
catch (e) {
|
|
450
456
|
TMExceptionBoxManager.show({ exception: e });
|
|
451
457
|
}
|
|
452
|
-
}, [wfDiagramHistory, historyIndex, isUndoingRedoing, setWfDiagramHistory, setHistoryIndex, setWfDiagram, isReadOnly]);
|
|
458
|
+
}, [wfDiagramHistory, historyIndex, isUndoingRedoing, setWfDiagramHistory, setHistoryIndex, setWfDiagram, isReadOnly, onDiagramChange]);
|
|
453
459
|
const handleUndo = useCallback(() => {
|
|
454
460
|
if (isReadOnly)
|
|
455
461
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { WorkItemActor } from './RecipientList';
|
|
4
|
-
export declare const RecipientsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
4
|
+
export declare const RecipientsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
5
5
|
export declare const tosToActors: (tosString: string) => {
|
|
6
6
|
andRecipients: WorkItemActor[];
|
|
7
7
|
orRecipients: WorkItemActor[];
|
|
@@ -67,14 +67,13 @@ export const getSeveritiesNumber = (severity) => {
|
|
|
67
67
|
};
|
|
68
68
|
export const getWorkItemSetRulesNumber = (setRule) => {
|
|
69
69
|
switch (setRule) {
|
|
70
|
-
case WorkItemSetRules.Ands_AND_Ors:
|
|
71
|
-
|
|
72
|
-
case WorkItemSetRules.
|
|
73
|
-
|
|
74
|
-
case WorkItemSetRules.
|
|
75
|
-
|
|
76
|
-
default:
|
|
77
|
-
return 0;
|
|
70
|
+
case WorkItemSetRules.Ands_AND_Ors: return 0;
|
|
71
|
+
case WorkItemSetRules.Ands_OR_Ors: return 1;
|
|
72
|
+
case WorkItemSetRules.Ands_AND_Ors_AssignModeOrs: return 2;
|
|
73
|
+
case WorkItemSetRules.Ands_OR_Ors_AssignModeOrs: return 3;
|
|
74
|
+
case WorkItemSetRules.Ands_AND_Ors_WaitForAllAnds: return 4;
|
|
75
|
+
case WorkItemSetRules.Ands_OR_Ors_WaitForAllAnds: return 5;
|
|
76
|
+
default: return 0;
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
79
|
export const getWFAppTypesNumber = (appType) => {
|
|
@@ -147,12 +146,12 @@ const mapSeverity = (severityValue) => {
|
|
|
147
146
|
// Funzione helper per mappare i valori numerici di WorkItemSetRules
|
|
148
147
|
const mapWorkItemSetRules = (ruleValue) => {
|
|
149
148
|
switch (ruleValue) {
|
|
150
|
-
case 0:
|
|
151
|
-
|
|
152
|
-
case
|
|
153
|
-
|
|
154
|
-
case
|
|
155
|
-
|
|
149
|
+
case 0: return WorkItemSetRules.Ands_AND_Ors;
|
|
150
|
+
case 1: return WorkItemSetRules.Ands_OR_Ors;
|
|
151
|
+
case 2: return WorkItemSetRules.Ands_AND_Ors_AssignModeOrs;
|
|
152
|
+
case 3: return WorkItemSetRules.Ands_OR_Ors_AssignModeOrs;
|
|
153
|
+
case 4: return WorkItemSetRules.Ands_AND_Ors_WaitForAllAnds;
|
|
154
|
+
case 5: return WorkItemSetRules.Ands_OR_Ors_WaitForAllAnds;
|
|
156
155
|
default:
|
|
157
156
|
console.warn(`Valore WorkItemSetRules sconosciuto: ${ruleValue}. Ritorno WorkItemSetRules.Ands_AND_Ors.`);
|
|
158
157
|
return WorkItemSetRules.Ands_AND_Ors;
|
|
@@ -11,4 +11,4 @@ interface ChangePasswordInputsProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChangePasswordInputs: React.FC<ChangePasswordInputsProps>;
|
|
13
13
|
export default ChangePasswordInputs;
|
|
14
|
-
export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
14
|
+
export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -328,8 +328,8 @@ const TMLoginForm = (props) => {
|
|
|
328
328
|
const nextStepHandler = async () => {
|
|
329
329
|
if (!endpoint || (!dcmtArchive && !manualArchiveID))
|
|
330
330
|
return;
|
|
331
|
-
if (loginStep === 1 &&
|
|
332
|
-
const isValid = await
|
|
331
|
+
if (loginStep === 1 && manualArchiveID) {
|
|
332
|
+
const isValid = await fetchManualArchiveByIdAsync();
|
|
333
333
|
if (!isValid)
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
@@ -359,17 +359,27 @@ const TMLoginForm = (props) => {
|
|
|
359
359
|
return;
|
|
360
360
|
setLoginStep(prev => prev - 1);
|
|
361
361
|
}, [loginStep]);
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
/** Retrieves and sets the archive descriptor from server using the manually entered ID. */
|
|
363
|
+
const fetchManualArchiveByIdAsync = async () => {
|
|
364
|
+
// Early exit if session or manual archive ID is not available
|
|
365
|
+
if (!tmSession || !manualArchiveID) {
|
|
366
|
+
setDcmtArchive(undefined);
|
|
364
367
|
return false;
|
|
368
|
+
}
|
|
369
|
+
;
|
|
365
370
|
try {
|
|
366
371
|
TMSpinner.show({ description: '' });
|
|
372
|
+
// Create archive engine and retrieve archive descriptor by ID
|
|
367
373
|
const archiveEngine = tmSession.NewArchiveEngine();
|
|
368
|
-
await archiveEngine.RetrieveAsync(manualArchiveID);
|
|
374
|
+
const result = await archiveEngine.RetrieveAsync(manualArchiveID);
|
|
375
|
+
// Update state with retrieved archive if valid
|
|
376
|
+
setDcmtArchive(result);
|
|
369
377
|
return true;
|
|
370
378
|
}
|
|
371
379
|
catch (e) {
|
|
380
|
+
// Display error to user if retrieval fails
|
|
372
381
|
TMExceptionBoxManager.show({ exception: e });
|
|
382
|
+
setDcmtArchive(undefined);
|
|
373
383
|
return false;
|
|
374
384
|
}
|
|
375
385
|
finally {
|
|
@@ -16,17 +16,40 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
|
|
|
16
16
|
const [selectedRowKeys, setSelectedRowKeys] = useState(selectedIDs ?? []);
|
|
17
17
|
const [focusedRowKey, setFocusedRowKey] = useState(selectedIDs?.[0]);
|
|
18
18
|
const [selectedRowCounter, setSelectedRowCounter] = useState([]);
|
|
19
|
+
// Helper per confronto case-insensitive
|
|
20
|
+
const includesCaseInsensitive = (arr, value) => {
|
|
21
|
+
if (!arr)
|
|
22
|
+
return false;
|
|
23
|
+
if (typeof value === 'string') {
|
|
24
|
+
return arr.some(item => typeof item === 'string' && item.toLowerCase() === value.toLowerCase());
|
|
25
|
+
}
|
|
26
|
+
return arr.includes(value);
|
|
27
|
+
};
|
|
19
28
|
useEffect(() => { doGetItems(false); }, [getItems]);
|
|
29
|
+
// Normalizza selectedRowKeys per corrispondere al case reale dei dati
|
|
30
|
+
const normalizeSelectedKeys = useCallback((items, keys) => {
|
|
31
|
+
return keys.map(key => {
|
|
32
|
+
if (typeof key === 'string') {
|
|
33
|
+
const match = items.find((item) => typeof item[keyName] === 'string' && item[keyName].toLowerCase() === key.toLowerCase());
|
|
34
|
+
return match ? match[keyName] : key;
|
|
35
|
+
}
|
|
36
|
+
return key;
|
|
37
|
+
});
|
|
38
|
+
}, [keyName]);
|
|
20
39
|
useEffect(() => {
|
|
40
|
+
const normalizedKeys = normalizeSelectedKeys(allItems, selectedRowKeys);
|
|
41
|
+
if (JSON.stringify(normalizedKeys) !== JSON.stringify(selectedRowKeys)) {
|
|
42
|
+
setSelectedRowKeys(normalizedKeys);
|
|
43
|
+
}
|
|
21
44
|
if (showOnlySelectedItems)
|
|
22
|
-
setFilteredItems(allItems.filter((o) =>
|
|
45
|
+
setFilteredItems(allItems.filter((o) => includesCaseInsensitive(normalizedKeys, o[keyName])));
|
|
23
46
|
else
|
|
24
47
|
setFilteredItems(allItems);
|
|
25
48
|
}, [showOnlySelectedItems, allItems, selectedRowKeys, keyName]);
|
|
26
49
|
useEffect(() => {
|
|
27
50
|
setSelectedRowCounter(selectedRowKeys);
|
|
28
51
|
}, [selectedRowKeys]);
|
|
29
|
-
const getSelectedIDs = () => { return filteredItems.filter((o) => selectedRowKeys
|
|
52
|
+
const getSelectedIDs = () => { return filteredItems.filter((o) => includesCaseInsensitive(selectedRowKeys, o[keyName])).map((item) => { return convertID ? convertID(item) : item[keyName]; }); };
|
|
30
53
|
const getFocusedIDs = () => { return filteredItems.filter((o) => o[keyName] == focusedRowKey).map((item) => { return convertID ? convertID(item) : item[keyName]; }); };
|
|
31
54
|
const renderTitle = () => { return title ? `${title} (${selectedRowCounter.length}/${filteredItems.length})` : SDKUI_Localizator.Select; };
|
|
32
55
|
const doGetItems = (refreshCache) => {
|
|
@@ -41,7 +41,7 @@ const TMBlogsPost = (props) => {
|
|
|
41
41
|
// State to manage the layout mode of the document form
|
|
42
42
|
const [layoutMode, setLayoutMode] = useState("extended");
|
|
43
43
|
const COMPACT_WIDTH_THRESHOLD = 465;
|
|
44
|
-
const COMPACT_HEIGHT_THRESHOLD =
|
|
44
|
+
const COMPACT_HEIGHT_THRESHOLD = 400;
|
|
45
45
|
// State to store an array of blog posts, which can be either BlogPost or HomeBlogPost type
|
|
46
46
|
const [blogPosts, setBlogPosts] = useState([]);
|
|
47
47
|
// State to store the first unread post
|
|
@@ -62,6 +62,7 @@ export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
|
62
62
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
63
63
|
export * from './query/TMQueryEditor';
|
|
64
64
|
export * from './query/TMQuerySummary';
|
|
65
|
+
export * from './query/TMQueryCountButton';
|
|
65
66
|
export { default as TMToppyDraggableHelpCenter } from './features/assistant/TMToppyDraggableHelpCenter';
|
|
66
67
|
export * from './features/documents/TMDcmtForm';
|
|
67
68
|
export * from './features/documents/TMDcmtIcon';
|
package/lib/components/index.js
CHANGED
|
@@ -68,6 +68,7 @@ export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm'
|
|
|
68
68
|
//query
|
|
69
69
|
export * from './query/TMQueryEditor';
|
|
70
70
|
export * from './query/TMQuerySummary';
|
|
71
|
+
export * from './query/TMQueryCountButton';
|
|
71
72
|
//assistant
|
|
72
73
|
export { default as TMToppyDraggableHelpCenter } from './features/assistant/TMToppyDraggableHelpCenter';
|
|
73
74
|
//documents
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TMPanelDefinition } from './types';
|
|
3
|
-
export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
3
|
+
export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$isDisabled" | "$isActive"> & {
|
|
4
4
|
$isActive?: boolean;
|
|
5
5
|
$isDisabled?: boolean;
|
|
6
|
-
}
|
|
6
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$isDisabled" | "$isActive"> & {
|
|
7
|
+
$isActive?: boolean;
|
|
8
|
+
$isDisabled?: boolean;
|
|
9
|
+
}, never>>> & string;
|
|
7
10
|
interface TMPanelManagerToolbarProps {
|
|
8
11
|
panels: Array<TMPanelDefinition>;
|
|
9
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import { SDK_Globals, ObjectClasses, ResultTypes } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/data-grid";
|
|
@@ -215,7 +215,9 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
215
215
|
return;
|
|
216
216
|
setSelectedItems([row.data]);
|
|
217
217
|
setShowList(false);
|
|
218
|
-
}, showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); onSelectionChanged?.(e.selectedRowsData); }, children: [_jsx(GroupPanel, { visible: !!(deviceType !== DeviceType.MOBILE && showAllColumns) }), _jsx(SearchPanel, { visible: false }), _jsx(Grouping, { autoExpandAll: false }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { width: 20, cellRender: cellRenderObjectIcon }), _jsx(Column, { width: 'auto', visible: showId, dataField: "id", caption: "ID" }), _jsx(Column, { width: 250, dataField: "name", caption: SDKUI_Localizator.Name, sortOrder: "asc" }),
|
|
218
|
+
}, showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); onSelectionChanged?.(e.selectedRowsData); }, children: [_jsx(GroupPanel, { visible: !!(deviceType !== DeviceType.MOBILE && showAllColumns) }), _jsx(SearchPanel, { visible: false }), _jsx(Grouping, { autoExpandAll: false }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { width: 20, cellRender: cellRenderObjectIcon }), _jsx(Column, { width: 'auto', visible: showId, dataField: "id", caption: "ID" }), _jsx(Column, { width: 250, dataField: "name", caption: SDKUI_Localizator.Name, sortOrder: "asc" }), objClass == ObjectClasses.User ?
|
|
219
|
+
_jsxs(_Fragment, { children: [_jsx(Column, { width: 'auto', dataField: "type", caption: SDKUI_Localizator.Type }), _jsx(Column, { width: 'auto', dataField: "fn", caption: SDKUI_Localizator.User_FirstName }), _jsx(Column, { width: 'auto', dataField: "ln", caption: SDKUI_Localizator.User_LastName })] })
|
|
220
|
+
: _jsx(_Fragment, {}), _jsx(Column, { width: 250, visible: objClass == ObjectClasses.User ? true : showAllColumns, dataField: "description", caption: SDKUI_Localizator.Description }), customColumns?.map((item, index) => { return React.cloneElement(item, { key: index, visible: showAllColumns }); }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerID", caption: SDKUI_Localizator.OwnerID }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerName", caption: SDKUI_Localizator.OwnerName }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "creationTime", caption: SDKUI_Localizator.CreationTime }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime })] })] }), detailInsteadOfContent ??
|
|
219
221
|
_jsx(TMLayoutItem, { children: selectedItems.length == 1 || formMode == FormModes.Create || formMode == FormModes.Duplicate ?
|
|
220
222
|
_jsx(TMToolbarCard, { onBack: deviceType === DeviceType.MOBILE ? () => setShowList(true) : undefined, title: calcSaveFormTitle(objName, formMode, selectedItems.length == 0 ? -1 : selectedItems[0].id, detailTitlePathKeys), children: getDetailFormWithProps() })
|
|
221
223
|
:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryDescriptor, QueryParameterDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
interface ITMQueryCountButton {
|
|
4
|
+
qd?: QueryDescriptor;
|
|
5
|
+
lastparams: QueryParameterDescriptor[] | undefined;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
showSpinner: boolean;
|
|
8
|
+
onLastQueryParamsChanged?: (params: QueryParameterDescriptor[]) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const TMQueryCountButton: React.FunctionComponent<ITMQueryCountButton>;
|
|
11
|
+
export default TMQueryCountButton;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import TMButton from '../base/TMButton';
|
|
3
|
+
import { getQueryCountAsync, IconCount, IsParametricQuery, SDKUI_Localizator } from '../../helper';
|
|
4
|
+
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
|
5
|
+
const TMQueryCountButton = ({ qd, lastparams, disabled, showSpinner, onLastQueryParamsChanged }) => {
|
|
6
|
+
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
|
7
|
+
const getQueryCountLocalAsync = async () => {
|
|
8
|
+
if (qd == undefined)
|
|
9
|
+
return;
|
|
10
|
+
let qdLocal = { ...qd };
|
|
11
|
+
const whereCopy = qdLocal.where?.map((curItem) => ({ ...curItem }));
|
|
12
|
+
if (IsParametricQuery(qd)) {
|
|
13
|
+
const qdParams = await confirmQueryParams(qdLocal, lastparams);
|
|
14
|
+
if (!qdParams || qdParams.length <= 0)
|
|
15
|
+
return;
|
|
16
|
+
for (const qpd of qdParams) {
|
|
17
|
+
let wi = whereCopy?.find(o => o.value1 == qpd.name);
|
|
18
|
+
if (wi)
|
|
19
|
+
wi.value1 = wi.value1?.replace(wi.value1, !qpd.value ? '' : qpd.value.toString());
|
|
20
|
+
else {
|
|
21
|
+
wi = whereCopy?.find(o => o.value2 == qpd.name);
|
|
22
|
+
if (wi)
|
|
23
|
+
wi.value2 = wi.value2?.replace(wi.value2, !qpd.value ? '' : qpd.value.toString());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
onLastQueryParamsChanged?.(qdParams ?? []);
|
|
27
|
+
}
|
|
28
|
+
await getQueryCountAsync({ ...qdLocal, where: whereCopy }, showSpinner);
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Count, icon: _jsx(IconCount, {}), disabled: disabled, onClick: async () => await getQueryCountLocalAsync() }), _jsx(ConfirmQueryParamsDialog, {})] }));
|
|
31
|
+
};
|
|
32
|
+
export default TMQueryCountButton;
|
|
@@ -2,14 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ITMApplyFormProps, FormModes } from '../../ts';
|
|
4
4
|
import type { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
|
|
5
|
-
export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
6
|
-
export declare const StyledItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
5
|
+
export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
6
|
+
export declare const StyledItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$borderRadius"> & {
|
|
7
7
|
$borderRadius?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$borderRadius"> & {
|
|
9
|
+
$borderRadius?: string;
|
|
10
|
+
}, never>>> & string;
|
|
11
|
+
export declare const StyledAccordionItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
12
|
+
export declare const StyledAccordionItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled"> & {
|
|
13
|
+
$disabled?: boolean;
|
|
14
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled"> & {
|
|
11
15
|
$disabled?: boolean;
|
|
12
|
-
}
|
|
16
|
+
}, never>>> & string;
|
|
13
17
|
export declare const colorValue = "rgba(224,224,224,.5)";
|
|
14
18
|
export declare const colorBrackets = "rgba(209,52,56,.3)";
|
|
15
19
|
export declare const colorOperator = "rgba(16,124,16,.3)";
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
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';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import Accordion, { Item } from 'devextreme-react/accordion';
|
|
6
|
-
import { SDKUI_Localizator, IconSearch,
|
|
6
|
+
import { SDKUI_Localizator, IconSearch, calcIsModified, IconClear, IconAddCircleOutline, IconDotsVerticalCircleOutline, IconHide, IconShow, IconDraggabledots, genUniqueId, LocalizeQueryOperators, LocalizeQueryFunctions, LocalizeQueryJoinTypes, IconArchiveDoc, IconArrowRight, SDKUI_Globals } from '../../helper';
|
|
7
7
|
import { displayMetadataValue, getDcmtTypesByQdAsync, getTIDsByQd, IsParametricQuery, prepareQdForSearchAsync } from '../../helper/queryHelper';
|
|
8
8
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
9
9
|
import { FormModes, SearchResultContext } from '../../ts';
|
|
@@ -30,6 +30,7 @@ import TMMetadataEditor from '../editors/TMMetadataEditor';
|
|
|
30
30
|
import { ContextMenu } from '../NewComponents/ContextMenu';
|
|
31
31
|
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
|
32
32
|
import TMSearchResult from '../features/search/TMSearchResult';
|
|
33
|
+
import TMQueryCountButton from './TMQueryCountButton';
|
|
33
34
|
export const StyledRowItem = styled.div ` display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 5px; gap: 3px; `;
|
|
34
35
|
export const StyledItemWrapper = styled.div ` border-radius: ${props => props.$borderRadius ?? '4px'}; padding: 4px; font-size: 1rem; user-select: none; width: max-content; `;
|
|
35
36
|
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; `;
|
|
@@ -242,6 +243,35 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
242
243
|
curJoinItem.on = onJoinCopy;
|
|
243
244
|
setFormData({ ...formData, join: joinCopy });
|
|
244
245
|
};
|
|
246
|
+
const onChange_OnJoinItem_Or = (or, index, indexOn) => {
|
|
247
|
+
const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
|
|
248
|
+
let curJoinItem = joinCopy[index];
|
|
249
|
+
const onJoinCopy = curJoinItem.on?.map((curItem, curIndex) => {
|
|
250
|
+
if (indexOn != curIndex)
|
|
251
|
+
return curItem;
|
|
252
|
+
let newOn = new OnJoinItem();
|
|
253
|
+
newOn.init({ ...curItem, or: or });
|
|
254
|
+
return newOn;
|
|
255
|
+
});
|
|
256
|
+
curJoinItem.on = onJoinCopy;
|
|
257
|
+
setFormData({ ...formData, join: joinCopy });
|
|
258
|
+
};
|
|
259
|
+
const onChange_OnJoinItem_Brackets = (value, isLeft, index, indexOn) => {
|
|
260
|
+
const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
|
|
261
|
+
let curJoinItem = joinCopy[index];
|
|
262
|
+
const onJoinCopy = curJoinItem.on?.map((curItem, curIndex) => {
|
|
263
|
+
if (indexOn != curIndex)
|
|
264
|
+
return curItem;
|
|
265
|
+
let newOn = new OnJoinItem();
|
|
266
|
+
if (isLeft)
|
|
267
|
+
newOn.init({ ...curItem, leftBrackets: value });
|
|
268
|
+
else
|
|
269
|
+
newOn.init({ ...curItem, rightBrackets: value });
|
|
270
|
+
return newOn;
|
|
271
|
+
});
|
|
272
|
+
curJoinItem.on = onJoinCopy;
|
|
273
|
+
setFormData({ ...formData, join: joinCopy });
|
|
274
|
+
};
|
|
245
275
|
const getJoinTypesMenuItems = (index) => {
|
|
246
276
|
let items = [
|
|
247
277
|
{ name: LocalizeQueryJoinTypes(JoinTypes.InnerJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.InnerJoin, index) },
|
|
@@ -703,7 +733,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
703
733
|
}
|
|
704
734
|
};
|
|
705
735
|
// #endregion
|
|
706
|
-
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: async () => await onSearchAsync(formData) }), _jsx(
|
|
736
|
+
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: async () => await onSearchAsync(formData) }), _jsx(TMQueryCountButton, { qd: { ...formData }, lastparams: lastQdParams, onLastQueryParamsChanged: (params) => { setLastQdParams(params); }, disabled: errorsCount > 0, showSpinner: 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) => {
|
|
707
737
|
let items = e.component.option("items");
|
|
708
738
|
if (items && items.length > 0) {
|
|
709
739
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -739,7 +769,10 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
739
769
|
setFormData({ ...formData, join: joinCopy });
|
|
740
770
|
}
|
|
741
771
|
}
|
|
742
|
-
] }), _jsx(
|
|
772
|
+
] }), _jsx(TMQdDropDownMenu, { disabled: indexOn == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: onItem.or ? 'OR' : 'AND' }), items: [
|
|
773
|
+
{ name: 'AND', onClick: () => onChange_OnJoinItem_Or(false, index, indexOn) },
|
|
774
|
+
{ name: 'OR', onClick: () => onChange_OnJoinItem_Or(true, index, indexOn) }
|
|
775
|
+
] }), _jsx(TMQdEditableItem, { value: onItem.leftBrackets, allowedPattern: /\(/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_OnJoinItem_Brackets(value, true, index, indexOn); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, 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); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, 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); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdEditableItem, { value: onItem.rightBrackets, allowedPattern: /\)/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_OnJoinItem_Brackets(value, false, index, indexOn); } })] }, indexOn));
|
|
743
776
|
})] }, `${ji.tid}_${index}`));
|
|
744
777
|
}), _jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.join) })] }) }) }), canShowSelect && _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 &&
|
|
745
778
|
_jsxs(StyledRowItem, { children: [_jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_SelectItem }), dcmtTypesList.length == 1
|
|
@@ -795,7 +828,11 @@ const TMQdEditableItem = ({ value, placeHolder, width, backgroundColor, allowedP
|
|
|
795
828
|
return (_jsx("div", { ref: ref, children: isComponentVisible ?
|
|
796
829
|
_jsx(TMTextBox, { elementStyle: { marginLeft: '5px', marginRight: '5px' }, width: width ?? '50px', autoFocus: true, value: value ?? '', onValueChanged: handleTextBoxValueChanged, allowedPattern: allowedPattern })
|
|
797
830
|
:
|
|
798
|
-
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: {
|
|
831
|
+
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: {
|
|
832
|
+
backgroundColor: backgroundColor,
|
|
833
|
+
cursor: 'pointer',
|
|
834
|
+
minHeight: '24px'
|
|
835
|
+
}, children: value ?? placeHolder }) }));
|
|
799
836
|
};
|
|
800
837
|
const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEditing = false, onValueChanged, onCascadeRefreshDynDataLists, updateIsModalOpen }) => {
|
|
801
838
|
let EditingModes;
|
|
@@ -5,10 +5,11 @@ import { QueryDescriptor, ResultTypes, TMScopeNames } from '@topconsultnpm/sdk-t
|
|
|
5
5
|
import { FontSize } from '../../utils/theme';
|
|
6
6
|
import TMQueryEditor from './TMQueryEditor';
|
|
7
7
|
import TMButton from '../base/TMButton';
|
|
8
|
-
import {
|
|
8
|
+
import { IconEraser, IconPencil, SDKUI_Localizator } from '../../helper';
|
|
9
9
|
import TMVilViewer from '../base/TMVilViewer';
|
|
10
10
|
import { FormModes } from '../../ts';
|
|
11
11
|
import TMModal from '../base/TMModal';
|
|
12
|
+
import TMQueryCountButton from './TMQueryCountButton';
|
|
12
13
|
// #region Style
|
|
13
14
|
const StyledWrapper = styled.div `
|
|
14
15
|
display: flex;
|
|
@@ -28,7 +29,7 @@ const TMQuerySummary = ({ children, qd, validateSelect = true, validateOrderBy =
|
|
|
28
29
|
const [showEditor, setShowEditor] = useState(false);
|
|
29
30
|
const validationItemsQd = validationItems.filter(o => o.PropertyScopes.includes(TMScopeNames.qd) || o.PropertyName == TMScopeNames.qd);
|
|
30
31
|
const useInternalEditor = onEditClick === undefined;
|
|
31
|
-
return (_jsxs(StyledWrapper, { children: [_jsxs(StyledQueryToolbar, { children: [_jsx(TMButton, { caption: SDKUI_Localizator.QueryDefine, icon: _jsx(IconPencil, { fontSize: 16 }), btnStyle: 'toolbar', onClick: () => onEditClick ? onEditClick() : setShowEditor(true) }), _jsx(
|
|
32
|
+
return (_jsxs(StyledWrapper, { children: [_jsxs(StyledQueryToolbar, { children: [_jsx(TMButton, { caption: SDKUI_Localizator.QueryDefine, icon: _jsx(IconPencil, { fontSize: 16 }), btnStyle: 'toolbar', onClick: () => onEditClick ? onEditClick() : setShowEditor(true) }), _jsx(TMQueryCountButton, { qd: { ...qd }, lastparams: [], disabled: validationItemsQd.filter(o => o.ResultType == ResultTypes.ERROR).length > 0, showSpinner: true }), _jsx(TMButton, { caption: SDKUI_Localizator.QueryClear, icon: _jsx(IconEraser, { fontSize: 16 }), btnStyle: 'toolbar', onClick: () => onValueChanged?.(new QueryDescriptor()) }), children] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', width: '100%', overflowX: 'auto' }, children: [qd && qd.from &&
|
|
32
33
|
_jsx(TMQueryEditor, { formMode: FormModes.ReadOnly, inputData: qd, showDistinct: showDistinct, isModal: false, showToolbar: false, validateSelect: validateSelect, validateOrderBy: validateOrderBy, raiseWarningForOnlyMetadataDcmtTypes: raiseWarningForOnlyMetadataDcmtTypes }), _jsx("div", { style: { padding: '0px 5px' }, children: _jsx(TMVilViewer, { vil: validationItemsQd }) })] }), useInternalEditor && showEditor &&
|
|
33
34
|
_jsx(TMModal, { title: SDKUI_Localizator.QueryDefine, children: _jsx(TMQueryEditor, { formMode: FormModes.Update, inputData: qd, isModal: true, showDistinct: showDistinct, raiseWarningForOnlyMetadataDcmtTypes: raiseWarningForOnlyMetadataDcmtTypes, validateSelect: validateSelect, validateOrderBy: validateOrderBy, onApplied: (newValue) => onValueChanged?.(newValue), onClose: () => { setShowEditor(false); } }) })] }));
|
|
34
35
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const StyledCommandsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
2
|
+
export declare const StyledCommandsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isMobile"> & {
|
|
3
3
|
$isMobile?: boolean;
|
|
4
|
-
}
|
|
4
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isMobile"> & {
|
|
5
|
+
$isMobile?: boolean;
|
|
6
|
+
}, never>>> & string;
|
|
5
7
|
export interface TMCommandItemProps {
|
|
6
8
|
icon: React.ReactNode;
|
|
7
9
|
selected?: boolean;
|
|
@@ -5,7 +5,8 @@ interface ITMDataListItemViewerProps {
|
|
|
5
5
|
value?: string | Date | number;
|
|
6
6
|
viewMode?: DataListViewModes;
|
|
7
7
|
showTooltip?: boolean;
|
|
8
|
+
width?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const TMDataListItemViewer: ({ dataListId, value, viewMode, showTooltip }: ITMDataListItemViewerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
declare const TMDataListItemViewer: ({ dataListId, value, viewMode, showTooltip, width }: ITMDataListItemViewerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export default TMDataListItemViewer;
|
|
11
12
|
export declare const cellRenderDataListItem: (data: DataGridTypes.ColumnCellTemplateData, dataListId?: number, viewMode?: DataListViewModes) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { SDKUI_Localizator } from '../../helper';
|
|
|
5
5
|
import TMTooltip from '../base/TMTooltip';
|
|
6
6
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
7
7
|
import { useDataListItem } from '../../hooks/useDataListItem';
|
|
8
|
-
const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.ImageAndDescription, showTooltip = true }) => {
|
|
8
|
+
const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.ImageAndDescription, showTooltip = true, width = '100%' }) => {
|
|
9
9
|
const { loadDataListsAsync, getDataListItem, renderDataListCell, convertToDataListValue } = useDataListItem();
|
|
10
10
|
const [dataListItem, setDataListItem] = useState(undefined);
|
|
11
11
|
useEffect(() => {
|
|
@@ -36,7 +36,7 @@ const TMDataListItemViewer = ({ dataListId, value, viewMode = DataListViewModes.
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const content = renderDataListCell(value, dataListId, viewMode);
|
|
39
|
-
return showTooltip ? (_jsx(TMTooltip, { content: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, parentStyle: { width
|
|
39
|
+
return showTooltip ? (_jsx(TMTooltip, { content: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, parentStyle: { width }, childStyle: { width }, children: content })) : content;
|
|
40
40
|
};
|
|
41
41
|
export default TMDataListItemViewer;
|
|
42
42
|
export const cellRenderDataListItem = (data, dataListId, viewMode) => {
|
|
@@ -123,4 +123,6 @@ export declare class DcmtFormSettings {
|
|
|
123
123
|
}
|
|
124
124
|
export declare class SDKUI_Globals {
|
|
125
125
|
static userSettings: UserSettings;
|
|
126
|
+
/** Global handler for scanner requests. Set by the host app (e.g. surfer) to open the scanner UI. */
|
|
127
|
+
static scanRequestHandler?: (mode: 'new' | 'edit', onFileScanned: (file: File) => void, onCancel: () => void, existingFile?: File) => void;
|
|
126
128
|
}
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ interface TabItemProps {
|
|
|
23
23
|
$isSelected: boolean;
|
|
24
24
|
$activeGradient?: string;
|
|
25
25
|
}
|
|
26
|
-
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
27
|
-
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
28
|
-
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
26
|
+
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
|
|
27
|
+
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
|
|
28
|
+
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
29
29
|
export declare const PDGS_COLORS: {
|
|
30
30
|
DOSSIER: string;
|
|
31
31
|
DOCUMENT: string;
|
|
@@ -41,6 +41,7 @@ export declare const parseSignatureConfiguration: (did: number, informationSign:
|
|
|
41
41
|
export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
|
|
42
42
|
export declare const getAppModuleGradient: (appModuleID: AppModules) => string;
|
|
43
43
|
export declare const getPanelManagerToolbarColor: (appModuleID: AppModules) => string;
|
|
44
|
+
export declare const getFileManagerFolderColor: (appModuleID: AppModules) => string;
|
|
44
45
|
type SearchToolbarVisibility = {
|
|
45
46
|
tmSearchResult: boolean;
|
|
46
47
|
tmBlog: boolean;
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -374,6 +374,18 @@ export const getPanelManagerToolbarColor = (appModuleID) => {
|
|
|
374
374
|
return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
|
+
export const getFileManagerFolderColor = (appModuleID) => {
|
|
378
|
+
switch (appModuleID) {
|
|
379
|
+
case AppModules.SURFER:
|
|
380
|
+
return '#2559a5';
|
|
381
|
+
case AppModules.DESIGNER:
|
|
382
|
+
return '#482234';
|
|
383
|
+
case AppModules.ORCHESTRATOR:
|
|
384
|
+
return '#1d6f42';
|
|
385
|
+
default:
|
|
386
|
+
return '#2559a5';
|
|
387
|
+
}
|
|
388
|
+
};
|
|
377
389
|
export const getSearchToolbarVisibility = (appModuleID) => {
|
|
378
390
|
switch (appModuleID) {
|
|
379
391
|
case AppModules.SURFER:
|