@topconsultnpm/sdkui-react 6.19.0-dev1.9 → 6.19.0-dev2.2
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/base/Styled.d.ts +1 -0
- package/lib/components/base/Styled.js +40 -0
- package/lib/components/base/TMCustomButton.d.ts +11 -0
- package/lib/components/base/TMCustomButton.js +63 -0
- package/lib/components/base/TMFileManagerDataGridView.js +4 -1
- package/lib/components/base/TMLayout.d.ts +2 -1
- package/lib/components/base/TMLayout.js +2 -2
- package/lib/components/base/TMPopUp.js +5 -18
- package/lib/components/base/TMTreeView.js +3 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
- package/lib/components/editors/TMHtmlEditor.js +72 -12
- package/lib/components/editors/TMMetadataValues.js +90 -40
- package/lib/components/features/archive/TMArchive.d.ts +10 -0
- package/lib/components/features/archive/TMArchive.js +56 -25
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +4 -4
- package/lib/components/features/blog/TMBlogCommentForm.js +76 -51
- package/lib/components/features/documents/TMDcmtBlog.d.ts +15 -0
- package/lib/components/features/documents/TMDcmtBlog.js +21 -33
- package/lib/components/features/documents/TMDcmtForm.d.ts +17 -3
- package/lib/components/features/documents/TMDcmtForm.js +205 -46
- package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
- package/lib/components/features/documents/TMDcmtTasks.js +24 -0
- package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +6 -6
- package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
- package/lib/components/features/documents/TMRelationViewer.js +232 -85
- package/lib/components/features/search/TMSearch.d.ts +10 -1
- package/lib/components/features/search/TMSearch.js +14 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
- package/lib/components/features/search/TMSearchResult.d.ts +10 -1
- package/lib/components/features/search/TMSearchResult.js +140 -422
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +33 -8
- package/lib/components/features/tasks/TMTaskForm.d.ts +38 -0
- package/lib/components/features/tasks/TMTaskForm.js +386 -0
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
- package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
- package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
- package/lib/components/features/tasks/TMTasksHeader.js +37 -0
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
- package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +132 -0
- package/lib/components/features/tasks/TMTasksUtils.js +634 -0
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +39 -0
- package/lib/components/features/tasks/TMTasksUtilsView.js +118 -0
- package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
- package/lib/components/features/tasks/TMTasksView.js +560 -0
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +19 -6
- package/lib/components/features/workflow/diagram/RecipientList.js +4 -3
- package/lib/components/forms/Login/Chooser.js +1 -1
- package/lib/components/forms/TMChooserForm.d.ts +1 -1
- package/lib/components/forms/TMChooserForm.js +2 -2
- package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
- package/lib/components/grids/TMBlogAttachments.js +43 -0
- package/lib/components/grids/TMBlogHeader.d.ts +31 -0
- package/lib/components/grids/TMBlogHeader.js +41 -0
- package/lib/components/grids/{TMBlogs.d.ts → TMBlogsPost.d.ts} +42 -58
- package/lib/components/grids/TMBlogsPost.js +628 -0
- package/lib/components/grids/{TMBlogsUtils.d.ts → TMBlogsPostUtils.d.ts} +61 -47
- package/lib/components/grids/{TMBlogsUtils.js → TMBlogsPostUtils.js} +146 -124
- package/lib/components/index.d.ts +14 -1
- package/lib/components/index.js +15 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +7 -0
- package/lib/components/settings/SettingsAppearance.js +8 -0
- package/lib/components/viewers/TMTidViewer.js +20 -2
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +4 -1
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +62 -4
- package/lib/helper/SDKUI_Localizator.js +618 -25
- package/lib/helper/TMCustomSearchBar.d.ts +8 -0
- package/lib/helper/TMCustomSearchBar.js +54 -0
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -2
- package/lib/helper/TMImageLibrary.js +230 -230
- package/lib/helper/TMToppyMessage.d.ts +7 -0
- package/lib/helper/TMToppyMessage.js +42 -0
- package/lib/helper/TMUtils.d.ts +10 -1
- package/lib/helper/TMUtils.js +42 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +18 -0
- package/lib/helper/helpers.js +1 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.d.ts +72 -0
- package/lib/hooks/useRelatedDocuments.js +655 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ts/types.d.ts +14 -0
- package/lib/ts/types.js +15 -0
- package/lib/utils/theme.d.ts +1 -0
- package/lib/utils/theme.js +1 -0
- package/package.json +7 -7
- package/lib/components/grids/TMBlogs.js +0 -721
- package/lib/stories/TMButton.stories.d.ts +0 -4
- package/lib/stories/TMButton.stories.js +0 -29
- package/lib/stories/TMDataGrid.stories.d.ts +0 -9
- package/lib/stories/TMDataGrid.stories.js +0 -310
- package/lib/stories/TMHtmlContentDisplay.stories.d.ts +0 -6
- package/lib/stories/TMHtmlContentDisplay.stories.js +0 -45
- package/lib/stories/TMHtmlEditor.stories.d.ts +0 -6
- package/lib/stories/TMHtmlEditor.stories.js +0 -49
- package/lib/stories/TMIcons.stories.d.ts +0 -4
- package/lib/stories/TMIcons.stories.js +0 -13
- package/lib/stories/TMSDKUI_Localizator.stories.d.ts +0 -4
- package/lib/stories/TMSDKUI_Localizator.stories.js +0 -123
- package/lib/stories/TMStoriesUtils.d.ts +0 -1
- package/lib/stories/TMStoriesUtils.js +0 -10
- package/lib/stories/TMUserAvatar.stories.d.ts +0 -6
- package/lib/stories/TMUserAvatar.stories.js +0 -20
package/lib/helper/TMUtils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { TMTooltip } from '../components';
|
|
4
4
|
import { IconKey } from './TMIcons';
|
|
5
|
-
import { DataListCacheService, MetadataDataDomains } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { DataListCacheService, MetadataDataDomains, PdGs } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
7
7
|
const StyledIconFileContainer = styled.div `
|
|
8
8
|
height: 22px;
|
|
@@ -174,3 +174,44 @@ export const isCreateCertificateEnabled = (widgetsString) => {
|
|
|
174
174
|
export const isPdfEditorEnabled = (widgetsString) => {
|
|
175
175
|
return isWidgetEnabled(PDF_EDITOR_ID, widgetsString);
|
|
176
176
|
};
|
|
177
|
+
export const StyledTabItem = styled.div `
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
padding: 6px 12px;
|
|
181
|
+
border-radius: 8px;
|
|
182
|
+
font-weight: ${({ $isSelected }) => ($isSelected ? 'bold' : 'normal')};
|
|
183
|
+
color: ${({ $isSelected }) => ($isSelected ? '#fff' : '#000')};
|
|
184
|
+
background: ${({ $isSelected }) => $isSelected
|
|
185
|
+
? 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)'
|
|
186
|
+
: 'transparent'};
|
|
187
|
+
transition: background-color 0.2s ease;
|
|
188
|
+
font-size: 1rem;
|
|
189
|
+
&:hover {
|
|
190
|
+
background: ${({ $isSelected }) => ($isSelected ? null : 'rgba(0, 0, 0, 0.05)')};
|
|
191
|
+
}
|
|
192
|
+
`;
|
|
193
|
+
export const StyledTabIcon = styled.i `
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
font-size: 16px;
|
|
196
|
+
color: ${({ $isSelected }) => ($isSelected ? '#fff !important' : '#000 !important')};
|
|
197
|
+
transition: color 0.2s ease;
|
|
198
|
+
`;
|
|
199
|
+
export const TMCountBadge = styled.div ` background-color: #ff5252; color: white; border-radius: 999px; margin-left: 8px; font-size: 0.7rem; line-height: 1; min-height: 20px; min-width: 20px; display: flex ; align-items: center; justify-content: center; `;
|
|
200
|
+
const taskPdgsIconClassMap = () => {
|
|
201
|
+
return new Map([
|
|
202
|
+
[PdGs.None, ""],
|
|
203
|
+
[PdGs.CF, "dx-icon-folder"],
|
|
204
|
+
[PdGs.DT, "dx-icon-file"],
|
|
205
|
+
[PdGs.WF, "dx-icon-box"],
|
|
206
|
+
[PdGs.WG, "dx-icon-group"],
|
|
207
|
+
]);
|
|
208
|
+
};
|
|
209
|
+
export const getPdgsIconMap = (fontSize = 20) => {
|
|
210
|
+
return new Map([
|
|
211
|
+
[PdGs.None, _jsx("span", {}, "PdGs-None")],
|
|
212
|
+
[PdGs.CF, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.CF) }, "PdGs-CF")],
|
|
213
|
+
[PdGs.DT, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.DT) }, "PdGs-DT")],
|
|
214
|
+
[PdGs.WF, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.WF) }, "PdGs-WF")],
|
|
215
|
+
[PdGs.WG, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.WG) }, "PdGs-WG")], // <IconUserGroup color="#009700"/>
|
|
216
|
+
]);
|
|
217
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { MetadataValueDescriptorEx } from "../ts";
|
|
1
2
|
/** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
|
|
2
3
|
export declare const hasDetailRelations: (mTID: number | undefined) => Promise<boolean>;
|
|
3
4
|
/** Check if dcmtType (mTID) has configured Master or Many-to-Many relations */
|
|
4
5
|
export declare const hasMasterRelations: (mTID: number | undefined) => Promise<boolean>;
|
|
5
6
|
export declare const isXMLFileExt: (fileExt: string | undefined) => boolean;
|
|
7
|
+
export declare const processButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined) => Record<string, string | number> | undefined;
|
|
@@ -23,3 +23,21 @@ export const isXMLFileExt = (fileExt) => {
|
|
|
23
23
|
default: return false;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
+
/*utility functions for TMCustomButton*/
|
|
27
|
+
export const processButtonAttributes = (args, formData) => args && formData ? splitArguments(replaceCustomButtonAttributes(args, formDataMap(formData))) : undefined;
|
|
28
|
+
const replaceCustomButtonAttributes = (input, attributes) => {
|
|
29
|
+
const matches = Array.from(input.matchAll(/@\w+/g));
|
|
30
|
+
return matches
|
|
31
|
+
.map(([match]) => `${match}=${attributes[match.slice(1)] ?? ''}`)
|
|
32
|
+
.join(';') + ';';
|
|
33
|
+
};
|
|
34
|
+
const formDataMap = (data) => data.reduce((acc, md) => {
|
|
35
|
+
const key = md.md?.name;
|
|
36
|
+
if (key && md.value)
|
|
37
|
+
acc[key] = md.value;
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
const splitArguments = (input) => Object.fromEntries(Array.from(input.matchAll(/@?(\w+)=([^;]+)/g), ([, key, value]) => [
|
|
41
|
+
key,
|
|
42
|
+
isNaN(Number(value)) ? value : Number(value),
|
|
43
|
+
]));
|
package/lib/helper/helpers.js
CHANGED
|
@@ -43,6 +43,7 @@ export const setSDK_GlobalsInfoAsync = async (tms) => {
|
|
|
43
43
|
tmSessionNew.SessionDescr = tms?.SessionDescr;
|
|
44
44
|
}
|
|
45
45
|
SDK_Globals.tmSession = tmSessionNew;
|
|
46
|
+
SDK_Globals.tmSession.AutoRefresh = true;
|
|
46
47
|
if (SDK_Globals.license == undefined) {
|
|
47
48
|
try {
|
|
48
49
|
SDK_Globals.license = await tmSessionNew.NewLicenseEngine().RetrieveAsync();
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SearchResultDescriptor, RelationDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { TMSearchResultFloatingActionConfig } from '../components/features/search/TMSearchResultFloatingActionButton';
|
|
3
|
+
interface UseRelatedDocumentsProps {
|
|
4
|
+
selectedSearchResult: SearchResultDescriptor | undefined;
|
|
5
|
+
currentSearchResults: SearchResultDescriptor[];
|
|
6
|
+
focusedItem: any;
|
|
7
|
+
}
|
|
8
|
+
interface UseRelatedDocumentsReturn {
|
|
9
|
+
relatedDcmts: RelationDescriptor[] | undefined;
|
|
10
|
+
showRelatedDcmtsChooser: boolean;
|
|
11
|
+
archiveType?: 'detail' | 'master';
|
|
12
|
+
isOpenDetails: boolean;
|
|
13
|
+
isOpenMaster: boolean;
|
|
14
|
+
isOpenArchiveRelationForm: boolean;
|
|
15
|
+
archiveRelatedDcmtFormTID: number | undefined;
|
|
16
|
+
archiveRelatedDcmtFormMids: Array<{
|
|
17
|
+
mid: number;
|
|
18
|
+
value: string;
|
|
19
|
+
}>;
|
|
20
|
+
relatedDcmtsChooserDataSource: Array<{
|
|
21
|
+
id: number | undefined;
|
|
22
|
+
name: string | undefined;
|
|
23
|
+
}> | undefined;
|
|
24
|
+
showPairDcmtsModal: boolean;
|
|
25
|
+
isPairingManyToMany: boolean;
|
|
26
|
+
pairedSearchResults: SearchResultDescriptor[] | undefined;
|
|
27
|
+
manyToManyRelations: RelationDescriptor[] | undefined;
|
|
28
|
+
selectedManyToManyRelation: RelationDescriptor | undefined;
|
|
29
|
+
showManyToManyChooser: boolean;
|
|
30
|
+
manyToManyChooserDataSource: Array<{
|
|
31
|
+
id: number | undefined;
|
|
32
|
+
name: string | undefined;
|
|
33
|
+
}> | undefined;
|
|
34
|
+
showPairSearchModal: boolean;
|
|
35
|
+
pairSearchModalTargetTID: number | undefined;
|
|
36
|
+
pairSearchModalParentTID: number | undefined;
|
|
37
|
+
pairSearchModalParentDID: number | undefined;
|
|
38
|
+
pairSearchModalRelation: RelationDescriptor | undefined;
|
|
39
|
+
pairSearchModalInputMids: Array<{
|
|
40
|
+
mid: number;
|
|
41
|
+
value: string;
|
|
42
|
+
}> | undefined;
|
|
43
|
+
currentTIDHasDetailRelations: boolean | undefined;
|
|
44
|
+
currentTIDHasMasterRelations: boolean | undefined;
|
|
45
|
+
canArchiveMasterRelation: boolean;
|
|
46
|
+
canArchiveDetailRelation: boolean;
|
|
47
|
+
hasManyToManyRelation: boolean;
|
|
48
|
+
setIsOpenDetails: (value: boolean) => void;
|
|
49
|
+
setIsOpenMaster: (value: boolean) => void;
|
|
50
|
+
setShowRelatedDcmtsChooser: (value: boolean) => void;
|
|
51
|
+
setShowManyToManyChooser: (value: boolean) => void;
|
|
52
|
+
setShowPairDcmtsModal: (value: boolean) => void;
|
|
53
|
+
setShowPairSearchModal: (value: boolean) => void;
|
|
54
|
+
setIsOpenArchiveRelationForm: (value: boolean) => void;
|
|
55
|
+
setArchiveType: (value: 'detail' | 'master' | undefined) => void;
|
|
56
|
+
setArchiveRelatedDcmtFormTID: (value: number | undefined) => void;
|
|
57
|
+
setArchiveRelatedDcmtFormMids: (value: Array<{
|
|
58
|
+
mid: number;
|
|
59
|
+
value: string;
|
|
60
|
+
}>) => void;
|
|
61
|
+
pairFloatingActionConfig: TMSearchResultFloatingActionConfig;
|
|
62
|
+
pairSearchModalFloatingActionConfig: TMSearchResultFloatingActionConfig;
|
|
63
|
+
archiveMasterDocuments: (tid: number) => Promise<void>;
|
|
64
|
+
archiveDetailDocuments: (tid: number) => Promise<void>;
|
|
65
|
+
pairManyToMany: (isPairing: boolean) => Promise<void>;
|
|
66
|
+
checkRelatedDcmtsArchiveCapability: () => Promise<void>;
|
|
67
|
+
checkManyToManyCapability: () => Promise<void>;
|
|
68
|
+
archiveRelatedDcmtHandler: (relation: RelationDescriptor, type: 'detail' | 'master') => Promise<void>;
|
|
69
|
+
executeManyToManyPairing: (relation: RelationDescriptor, isPairing: boolean) => Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export declare const useRelatedDocuments: ({ selectedSearchResult, focusedItem, currentSearchResults }: UseRelatedDocumentsProps) => UseRelatedDocumentsReturn;
|
|
72
|
+
export {};
|