@topconsultnpm/sdkui-react 6.20.0-dev1.99 → 6.20.0-dev2.1
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/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +56 -18
- package/lib/components/NewComponents/ContextMenu/styles.js +13 -34
- package/lib/components/NewComponents/ContextMenu/types.d.ts +8 -2
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +315 -271
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +6 -2
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +7 -4
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMDropDownMenu.js +2 -0
- package/lib/components/base/TMListView.js +1 -1
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +9 -5
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +11 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -0
- package/lib/components/choosers/TMUserChooser.js +8 -2
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +2 -0
- package/lib/components/editors/TMMetadataValues.js +3 -3
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +23 -1
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +120 -87
- package/lib/components/features/documents/TMDcmtPreview.js +27 -30
- package/lib/components/features/search/TMSearch.js +5 -1
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.js +24 -10
- package/lib/components/features/search/TMSearchResult.js +168 -8
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +24 -4
- package/lib/components/features/search/TMViewHistoryDcmt.js +45 -50
- package/lib/components/features/tasks/TMTaskForm.js +55 -24
- package/lib/components/features/tasks/TMTasksUtils.js +14 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +5 -4
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +1 -1
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +4 -0
- package/lib/components/query/TMQueryEditor.js +14 -10
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- package/lib/helper/SDKUI_Globals.d.ts +3 -0
- package/lib/helper/SDKUI_Globals.js +6 -3
- package/lib/helper/SDKUI_Localizator.d.ts +4 -16
- package/lib/helper/SDKUI_Localizator.js +37 -157
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/TMUtils.d.ts +2 -1
- package/lib/helper/TMUtils.js +13 -1
- package/lib/helper/helpers.d.ts +27 -1
- package/lib/helper/helpers.js +107 -1
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +24 -1
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/package.json +56 -56
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { SDKUI_Globals } from '../helper';
|
|
3
|
+
export const useFloatingBarPinnedItems = (options = {}) => {
|
|
4
|
+
const { defaultPinnedIds = [] } = options;
|
|
5
|
+
const loadPinnedIds = useCallback(() => {
|
|
6
|
+
try {
|
|
7
|
+
const settings = SDKUI_Globals.userSettings?.searchSettings?.floatingMenuBar || {};
|
|
8
|
+
if (settings.itemIds && Array.isArray(settings.itemIds) && settings.itemIds.length > 0) {
|
|
9
|
+
return settings.itemIds;
|
|
10
|
+
}
|
|
11
|
+
return defaultPinnedIds;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.error('Failed to load pinned items from localStorage:', error);
|
|
15
|
+
return defaultPinnedIds;
|
|
16
|
+
}
|
|
17
|
+
}, [defaultPinnedIds]);
|
|
18
|
+
const [internalPinnedItemIds, setInternalPinnedItemIds] = useState(loadPinnedIds);
|
|
19
|
+
const savePinnedIds = useCallback((ids) => {
|
|
20
|
+
try {
|
|
21
|
+
const currentSettings = SDKUI_Globals.userSettings?.searchSettings?.floatingMenuBar || {};
|
|
22
|
+
SDKUI_Globals.userSettings.searchSettings.floatingMenuBar = {
|
|
23
|
+
...currentSettings,
|
|
24
|
+
itemIds: ids,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Failed to save pinned items to localStorage:', error);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const setPinnedItemIds = useCallback((ids) => {
|
|
32
|
+
setInternalPinnedItemIds(ids);
|
|
33
|
+
savePinnedIds(ids);
|
|
34
|
+
}, [savePinnedIds]);
|
|
35
|
+
const isPinned = useCallback((id) => {
|
|
36
|
+
return internalPinnedItemIds.includes(id);
|
|
37
|
+
}, [internalPinnedItemIds]);
|
|
38
|
+
const togglePin = useCallback((id) => {
|
|
39
|
+
setInternalPinnedItemIds(prev => {
|
|
40
|
+
const newIds = prev.includes(id)
|
|
41
|
+
? prev.filter(pinnedId => pinnedId !== id)
|
|
42
|
+
: [...prev, id];
|
|
43
|
+
savePinnedIds(newIds);
|
|
44
|
+
return newIds;
|
|
45
|
+
});
|
|
46
|
+
}, [savePinnedIds]);
|
|
47
|
+
return {
|
|
48
|
+
pinnedItemIds: internalPinnedItemIds,
|
|
49
|
+
isPinned,
|
|
50
|
+
togglePin,
|
|
51
|
+
setPinnedItemIds,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export default useFloatingBarPinnedItems;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
export interface MetadataHelper {
|
|
3
|
+
Mid: number;
|
|
4
|
+
MetadataName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UseMetadataExpressionProps {
|
|
7
|
+
qd?: QueryDescriptor;
|
|
8
|
+
tid?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UseMetadataExpressionResult {
|
|
11
|
+
metadatas_Info_Source: MetadataHelper[];
|
|
12
|
+
Expression_IDs2Names: (expression: string | undefined) => string | undefined;
|
|
13
|
+
Expression_Names2IDs: (expression: string | undefined) => string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom hook per gestire le espressioni con metadati.
|
|
17
|
+
* Fornisce funzioni per convertire tra IDs e nomi dei metadati e gestisce il caricamento dei metadati.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useMetadataExpression: ({ qd, tid }: UseMetadataExpressionProps) => UseMetadataExpressionResult;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { TMExceptionBoxManager } from '../components/base/TMPopUp';
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook per gestire le espressioni con metadati.
|
|
6
|
+
* Fornisce funzioni per convertire tra IDs e nomi dei metadati e gestisce il caricamento dei metadati.
|
|
7
|
+
*/
|
|
8
|
+
export const useMetadataExpression = ({ qd, tid }) => {
|
|
9
|
+
const [metadatas_Info_Source, setMetadatas_Info_Source] = useState([]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
MetadataInfos_Source_Get_Async();
|
|
12
|
+
}, [qd]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
MetadataInfos_Source_GetByTID_Async();
|
|
15
|
+
}, [tid]);
|
|
16
|
+
async function MetadataInfos_Source_Get_Async() {
|
|
17
|
+
if (!qd?.select)
|
|
18
|
+
return;
|
|
19
|
+
let mhs_source = [];
|
|
20
|
+
try {
|
|
21
|
+
let dtd_source;
|
|
22
|
+
let md_source;
|
|
23
|
+
let tid_source = -1;
|
|
24
|
+
let si;
|
|
25
|
+
let sis = qd.select.slice();
|
|
26
|
+
sis = sis.slice().sort((a, b) => a.tid - b.tid);
|
|
27
|
+
for (si of sis) {
|
|
28
|
+
if (si.tid == undefined || si.mid == undefined)
|
|
29
|
+
continue;
|
|
30
|
+
if (tid_source != si.tid) {
|
|
31
|
+
dtd_source = await DcmtTypeListCacheService.GetAsync(si.tid, true);
|
|
32
|
+
if (dtd_source == undefined)
|
|
33
|
+
continue;
|
|
34
|
+
tid_source = si.tid;
|
|
35
|
+
}
|
|
36
|
+
if (dtd_source?.metadata == undefined)
|
|
37
|
+
continue;
|
|
38
|
+
md_source = dtd_source.metadata.find(o => o.id == si.mid);
|
|
39
|
+
if (md_source?.name == undefined)
|
|
40
|
+
continue;
|
|
41
|
+
if (tid_source == undefined)
|
|
42
|
+
continue;
|
|
43
|
+
mhs_source.push({ Mid: si.mid, MetadataName: md_source.name });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_Get_Async' });
|
|
48
|
+
}
|
|
49
|
+
setMetadatas_Info_Source(mhs_source);
|
|
50
|
+
}
|
|
51
|
+
async function MetadataInfos_Source_GetByTID_Async() {
|
|
52
|
+
if (!tid)
|
|
53
|
+
return;
|
|
54
|
+
let mhs_source = [];
|
|
55
|
+
try {
|
|
56
|
+
let dtd_source = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
57
|
+
if (dtd_source == undefined)
|
|
58
|
+
return;
|
|
59
|
+
if (dtd_source?.metadata == undefined)
|
|
60
|
+
return;
|
|
61
|
+
for (let md_source of dtd_source?.metadata) {
|
|
62
|
+
if (md_source?.name == undefined)
|
|
63
|
+
continue;
|
|
64
|
+
if (md_source?.id == undefined)
|
|
65
|
+
continue;
|
|
66
|
+
mhs_source.push({ Mid: md_source.id, MetadataName: md_source.name });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_GetByTID_Async' });
|
|
71
|
+
}
|
|
72
|
+
setMetadatas_Info_Source(mhs_source);
|
|
73
|
+
}
|
|
74
|
+
function Expression_IDs2Names(expression) {
|
|
75
|
+
if (expression == undefined)
|
|
76
|
+
return expression;
|
|
77
|
+
let temp = expression.slice();
|
|
78
|
+
for (const mh of metadatas_Info_Source) {
|
|
79
|
+
temp = temp.replaceAll(`{@${mh.Mid}}`, `{@${mh.MetadataName}}`);
|
|
80
|
+
}
|
|
81
|
+
temp = temp.replaceAll("{@1}", "{@DID}");
|
|
82
|
+
return temp;
|
|
83
|
+
}
|
|
84
|
+
function Expression_Names2IDs(expression) {
|
|
85
|
+
if (expression == undefined)
|
|
86
|
+
return expression;
|
|
87
|
+
let temp = expression.slice();
|
|
88
|
+
for (const mh of metadatas_Info_Source) {
|
|
89
|
+
temp = temp.replaceAll(`{@${mh.MetadataName}}`, `{@${mh.Mid}}`);
|
|
90
|
+
}
|
|
91
|
+
temp = temp.replaceAll("{@DID}", "{@1}");
|
|
92
|
+
return temp;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
metadatas_Info_Source,
|
|
96
|
+
Expression_IDs2Names,
|
|
97
|
+
Expression_Names2IDs
|
|
98
|
+
};
|
|
99
|
+
};
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
2
|
+
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
+
"version": "6.20.0-dev2.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" \u0026\u0026 exit 1",
|
|
7
|
+
"clean": "powershell Remove-Item lib/ -recurse",
|
|
8
|
+
"copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
|
|
9
|
+
"tm-build": "npm run clean \u0026\u0026 tsc \u0026\u0026 npm run copy-files",
|
|
10
|
+
"tm-watch": "tsc -w",
|
|
11
|
+
"tm-publish": "npm publish --tag latest",
|
|
12
|
+
"tm-publish_wl": "npm publish",
|
|
13
|
+
"storybook": "storybook dev -p 6006",
|
|
14
|
+
"build-storybook": "storybook build"
|
|
15
|
+
},
|
|
16
|
+
"author": "TopConsult",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
20
|
+
"@storybook/addon-docs": "^10.1.0",
|
|
21
|
+
"@storybook/addon-onboarding": "^10.1.0",
|
|
22
|
+
"@storybook/react-vite": "^10.1.0",
|
|
23
|
+
"@types/htmlparser2": "^3.10.7",
|
|
24
|
+
"@types/node": "^20.2.5",
|
|
25
|
+
"@types/react": "^18.3.3",
|
|
26
|
+
"@types/react-dom": "^18.3.3",
|
|
27
|
+
"copyfiles": "^2.4.1",
|
|
28
|
+
"esbuild": "^0.25.0",
|
|
29
|
+
"react": "^18.3.1",
|
|
30
|
+
"react-dom": "^18.3.1",
|
|
31
|
+
"storybook": "^10.1.0",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vite": "^6.1.1"
|
|
34
|
+
},
|
|
35
|
+
"main": "dist/cjs/index.js",
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"module": "lib/esm/index.js",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"lib"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"react-router-dom": "^6.15.0",
|
|
44
|
+
"react-pdf": "^10.3.0",
|
|
45
|
+
"htmlparser2": "^10.0.0",
|
|
46
|
+
"buffer": "^6.0.3",
|
|
47
|
+
"@topconsultnpm/sdk-ts": "6.20.0-test1",
|
|
48
|
+
"exceljs": "^4.4.0",
|
|
49
|
+
"devextreme": "25.2.4",
|
|
50
|
+
"styled-components": "^6.1.1",
|
|
51
|
+
"pdfjs-dist": "5.4.296",
|
|
52
|
+
"devextreme-react": "25.2.4"
|
|
53
|
+
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"esbuild": "^0.25.0"
|
|
56
|
+
}
|
|
57
|
+
}
|