@topconsultnpm/sdkui-react 6.19.0-dev1.54 → 6.19.0-dev1.56
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/TMCustomButton.d.ts +11 -0
- package/lib/components/base/TMCustomButton.js +63 -0
- package/lib/components/base/TMLayout.d.ts +2 -1
- package/lib/components/base/TMLayout.js +2 -2
- package/lib/components/features/archive/TMArchive.d.ts +8 -0
- package/lib/components/features/archive/TMArchive.js +3 -3
- package/lib/components/features/documents/TMDcmtBlog.d.ts +8 -0
- package/lib/components/features/documents/TMDcmtBlog.js +3 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +8 -1
- package/lib/components/features/documents/TMDcmtForm.js +52 -21
- package/lib/components/features/documents/TMDcmtTasks.d.ts +12 -0
- package/lib/components/features/documents/TMDcmtTasks.js +24 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +5 -5
- package/lib/components/features/search/TMSearch.d.ts +8 -1
- package/lib/components/features/search/TMSearch.js +3 -3
- package/lib/components/features/search/TMSearchResult.d.ts +8 -1
- package/lib/components/features/search/TMSearchResult.js +14 -11
- package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +37 -0
- package/lib/components/features/tasks/TMTaskForm.js +291 -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 +19 -0
- package/lib/components/features/tasks/TMTasksPanelContent.js +64 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +131 -0
- package/lib/components/features/tasks/TMTasksUtils.js +634 -0
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +32 -0
- package/lib/components/features/tasks/TMTasksUtilsView.js +107 -0
- package/lib/components/features/tasks/TMTasksView.d.ts +39 -0
- package/lib/components/features/tasks/TMTasksView.js +554 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +2 -2
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogsPost.d.ts +8 -5
- package/lib/components/grids/TMBlogsPost.js +28 -28
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/index.d.ts +8 -0
- package/lib/components/index.js +9 -0
- package/lib/helper/SDKUI_Localizator.d.ts +55 -4
- package/lib/helper/SDKUI_Localizator.js +536 -25
- package/lib/helper/TMCustomSearchBar.d.ts +8 -0
- package/lib/helper/TMCustomSearchBar.js +54 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -2
- package/lib/helper/TMImageLibrary.js +230 -230
- package/lib/helper/TMToppyMessage.js +1 -1
- 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/stories/TMSDKUI_Localizator.stories.js +1 -1
- package/package.json +1 -1
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataColumnDescriptor, PdGs } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
|
|
4
5
|
export interface RowData {
|
|
@@ -18,3 +19,11 @@ export declare const isWidgetEnabled: (widgetId: string, widgetsString: string)
|
|
|
18
19
|
export declare const isSign4TopEnabled: (widgetsString: string) => boolean;
|
|
19
20
|
export declare const isCreateCertificateEnabled: (widgetsString: string) => boolean;
|
|
20
21
|
export declare const isPdfEditorEnabled: (widgetsString: string) => boolean;
|
|
22
|
+
interface TabItemProps {
|
|
23
|
+
$isSelected: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TabItemProps>> & string;
|
|
26
|
+
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, TabItemProps>> & string;
|
|
27
|
+
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
28
|
+
export declare const getPdgsIconMap: (fontSize?: number) => Map<PdGs, JSX.Element>;
|
|
29
|
+
export {};
|
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
|
+
]));
|
|
@@ -25,7 +25,7 @@ const Template = () => {
|
|
|
25
25
|
{ key: "All", value: SDKUI_Localizator.All },
|
|
26
26
|
{ key: "AllFilesAndFoldersInSupportArea", value: SDKUI_Localizator.AllFilesAndFoldersInSupportArea },
|
|
27
27
|
{ key: "AllItems", value: SDKUI_Localizator.AllItems },
|
|
28
|
-
{ key: "
|
|
28
|
+
{ key: "AllFemale", value: SDKUI_Localizator.AllFemale },
|
|
29
29
|
{ key: "Alphabetic", value: SDKUI_Localizator.Alphabetic },
|
|
30
30
|
{ key: "Applied", value: SDKUI_Localizator.Applied },
|
|
31
31
|
{ key: "Apply", value: SDKUI_Localizator.Apply },
|