@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.
Files changed (116) hide show
  1. package/lib/components/base/Styled.d.ts +1 -0
  2. package/lib/components/base/Styled.js +40 -0
  3. package/lib/components/base/TMCustomButton.d.ts +11 -0
  4. package/lib/components/base/TMCustomButton.js +63 -0
  5. package/lib/components/base/TMFileManagerDataGridView.js +4 -1
  6. package/lib/components/base/TMLayout.d.ts +2 -1
  7. package/lib/components/base/TMLayout.js +2 -2
  8. package/lib/components/base/TMPopUp.js +5 -18
  9. package/lib/components/base/TMTreeView.js +3 -2
  10. package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
  11. package/lib/components/editors/TMHtmlEditor.js +72 -12
  12. package/lib/components/editors/TMMetadataValues.js +90 -40
  13. package/lib/components/features/archive/TMArchive.d.ts +10 -0
  14. package/lib/components/features/archive/TMArchive.js +56 -25
  15. package/lib/components/features/blog/TMBlogCommentForm.d.ts +4 -4
  16. package/lib/components/features/blog/TMBlogCommentForm.js +76 -51
  17. package/lib/components/features/documents/TMDcmtBlog.d.ts +15 -0
  18. package/lib/components/features/documents/TMDcmtBlog.js +21 -33
  19. package/lib/components/features/documents/TMDcmtForm.d.ts +17 -3
  20. package/lib/components/features/documents/TMDcmtForm.js +205 -46
  21. package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
  22. package/lib/components/features/documents/TMDcmtTasks.js +24 -0
  23. package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
  24. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
  25. package/lib/components/features/documents/TMMasterDetailDcmts.js +6 -6
  26. package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
  27. package/lib/components/features/documents/TMRelationViewer.js +232 -85
  28. package/lib/components/features/search/TMSearch.d.ts +10 -1
  29. package/lib/components/features/search/TMSearch.js +14 -5
  30. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
  31. package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
  32. package/lib/components/features/search/TMSearchResult.d.ts +10 -1
  33. package/lib/components/features/search/TMSearchResult.js +140 -422
  34. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
  35. package/lib/components/features/search/TMSearchResultsMenuItems.js +33 -8
  36. package/lib/components/features/tasks/TMTaskForm.d.ts +38 -0
  37. package/lib/components/features/tasks/TMTaskForm.js +386 -0
  38. package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
  39. package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
  40. package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
  41. package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
  42. package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
  43. package/lib/components/features/tasks/TMTasksHeader.js +37 -0
  44. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
  45. package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
  46. package/lib/components/features/tasks/TMTasksUtils.d.ts +132 -0
  47. package/lib/components/features/tasks/TMTasksUtils.js +634 -0
  48. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +39 -0
  49. package/lib/components/features/tasks/TMTasksUtilsView.js +118 -0
  50. package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
  51. package/lib/components/features/tasks/TMTasksView.js +560 -0
  52. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
  53. package/lib/components/features/workflow/TMWorkflowPopup.js +19 -6
  54. package/lib/components/features/workflow/diagram/RecipientList.js +4 -3
  55. package/lib/components/forms/Login/Chooser.js +1 -1
  56. package/lib/components/forms/TMChooserForm.d.ts +1 -1
  57. package/lib/components/forms/TMChooserForm.js +2 -2
  58. package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
  59. package/lib/components/grids/TMBlogAttachments.js +43 -0
  60. package/lib/components/grids/TMBlogHeader.d.ts +31 -0
  61. package/lib/components/grids/TMBlogHeader.js +41 -0
  62. package/lib/components/grids/{TMBlogs.d.ts → TMBlogsPost.d.ts} +42 -58
  63. package/lib/components/grids/TMBlogsPost.js +628 -0
  64. package/lib/components/grids/{TMBlogsUtils.d.ts → TMBlogsPostUtils.d.ts} +61 -47
  65. package/lib/components/grids/{TMBlogsUtils.js → TMBlogsPostUtils.js} +146 -124
  66. package/lib/components/index.d.ts +14 -1
  67. package/lib/components/index.js +15 -1
  68. package/lib/components/layout/panelManager/TMPanelManagerContext.js +7 -0
  69. package/lib/components/settings/SettingsAppearance.js +8 -0
  70. package/lib/components/viewers/TMTidViewer.js +20 -2
  71. package/lib/css/tm-sdkui.css +1 -1
  72. package/lib/helper/SDKUI_Globals.d.ts +4 -1
  73. package/lib/helper/SDKUI_Globals.js +10 -1
  74. package/lib/helper/SDKUI_Localizator.d.ts +62 -4
  75. package/lib/helper/SDKUI_Localizator.js +618 -25
  76. package/lib/helper/TMCustomSearchBar.d.ts +8 -0
  77. package/lib/helper/TMCustomSearchBar.js +54 -0
  78. package/lib/helper/TMIcons.d.ts +2 -0
  79. package/lib/helper/TMIcons.js +6 -0
  80. package/lib/helper/TMImageLibrary.d.ts +3 -2
  81. package/lib/helper/TMImageLibrary.js +230 -230
  82. package/lib/helper/TMToppyMessage.d.ts +7 -0
  83. package/lib/helper/TMToppyMessage.js +42 -0
  84. package/lib/helper/TMUtils.d.ts +10 -1
  85. package/lib/helper/TMUtils.js +42 -1
  86. package/lib/helper/dcmtsHelper.d.ts +2 -0
  87. package/lib/helper/dcmtsHelper.js +18 -0
  88. package/lib/helper/helpers.js +1 -0
  89. package/lib/helper/index.d.ts +1 -0
  90. package/lib/helper/index.js +1 -0
  91. package/lib/hooks/useRelatedDocuments.d.ts +72 -0
  92. package/lib/hooks/useRelatedDocuments.js +655 -0
  93. package/lib/index.d.ts +1 -0
  94. package/lib/index.js +1 -0
  95. package/lib/ts/types.d.ts +14 -0
  96. package/lib/ts/types.js +15 -0
  97. package/lib/utils/theme.d.ts +1 -0
  98. package/lib/utils/theme.js +1 -0
  99. package/package.json +7 -7
  100. package/lib/components/grids/TMBlogs.js +0 -721
  101. package/lib/stories/TMButton.stories.d.ts +0 -4
  102. package/lib/stories/TMButton.stories.js +0 -29
  103. package/lib/stories/TMDataGrid.stories.d.ts +0 -9
  104. package/lib/stories/TMDataGrid.stories.js +0 -310
  105. package/lib/stories/TMHtmlContentDisplay.stories.d.ts +0 -6
  106. package/lib/stories/TMHtmlContentDisplay.stories.js +0 -45
  107. package/lib/stories/TMHtmlEditor.stories.d.ts +0 -6
  108. package/lib/stories/TMHtmlEditor.stories.js +0 -49
  109. package/lib/stories/TMIcons.stories.d.ts +0 -4
  110. package/lib/stories/TMIcons.stories.js +0 -13
  111. package/lib/stories/TMSDKUI_Localizator.stories.d.ts +0 -4
  112. package/lib/stories/TMSDKUI_Localizator.stories.js +0 -123
  113. package/lib/stories/TMStoriesUtils.d.ts +0 -1
  114. package/lib/stories/TMStoriesUtils.js +0 -10
  115. package/lib/stories/TMUserAvatar.stories.d.ts +0 -6
  116. package/lib/stories/TMUserAvatar.stories.js +0 -20
@@ -65,9 +65,10 @@ const FloatingMenu = styled.div `
65
65
  transform: translateY(5px);
66
66
  align-items: center; /* Centra i pulsanti orizzontalmente */
67
67
  `;
68
- const FloatingMenuButton = styled(TMButton) `
69
- width: 100%; /* Rende i pulsanti interni larghi quanto il menu */
70
- `;
68
+ // FloatingMenuButton wrapper component to avoid circular dependency
69
+ const FloatingMenuButton = (props) => {
70
+ return _jsx(TMButton, { width: "100%", ...props });
71
+ };
71
72
  const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange }) => {
72
73
  const [uiState, setUiState] = useState({
73
74
  isMenuOpen: false,
@@ -30,7 +30,7 @@ const DropdownContainer = styled.div `
30
30
  border: 1px solid #ccc;
31
31
  border-radius: 4px;
32
32
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
33
- max-height: max-content;
33
+ max-height: 35vh;
34
34
  overflow-y: auto;
35
35
  z-index: 9999;
36
36
  width: fit-content;
@@ -1,3 +1,3 @@
1
1
  import { ITMChooserFormProps } from '../../ts';
2
- declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, allowApplyWithZeroSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, hideRefresh, keyName, customButtons, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
2
+ declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, allowApplyWithZeroSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, hideRefresh, keyName, customButtons, showFilterPanel, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
3
3
  export default TMChooserForm;
@@ -8,7 +8,7 @@ import TMModal from '../base/TMModal';
8
8
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
9
9
  import { TMColors } from '../../utils/theme';
10
10
  import TMDataGrid from '../base/TMDataGrid';
11
- const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowApplyWithZeroSelection = false, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, hideRefresh = false, keyName = "id", customButtons, showDefaultColumns = true, columns = [], summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
11
+ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowApplyWithZeroSelection = false, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, hideRefresh = false, keyName = "id", customButtons, showFilterPanel = false, showDefaultColumns = true, columns = [], summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
12
12
  const [showId, setShowId] = useState(false);
13
13
  const [showOnlySelectedItems, setShowOnlySelectedItems] = useState(allowMultipleSelection && hasShowOnlySelectedItems && startWithShowOnlySelectedItems && selectedIDs != undefined && selectedIDs.length > 0);
14
14
  const [allItems, setAllItems] = useState([]);
@@ -88,7 +88,7 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
88
88
  }, [manageUseLocalizedName, summaryItems]);
89
89
  return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
90
90
  filteredItems.length > 0
91
- ? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
91
+ ? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, showFilterPanel: showFilterPanel, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
92
92
  : _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
93
93
  };
94
94
  export default TMChooserForm;
@@ -0,0 +1,42 @@
1
+ import { BlogPostAttachment, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
2
+ import { TMBlogContextDescriptor } from "./TMBlogsPostUtils";
3
+ import { DcmtInfo } from "../../ts";
4
+ import { FileItem } from "../base/TMFileManagerUtils";
5
+ interface TMBlogAttachmentsProps {
6
+ contextMenuParams?: {
7
+ isShowHideFilterEnabled: boolean;
8
+ isShowHideIDEnaled: boolean;
9
+ isCommentEnabled: boolean;
10
+ isDownloadAttachmentEnabled: boolean;
11
+ isViewEditMetadata: boolean;
12
+ isDeleteEnabled: boolean;
13
+ isCopyToClipboardEnabled: boolean;
14
+ isRestoreEnabled: boolean;
15
+ isRefreshEnabled: boolean;
16
+ isCreateContextualTask: boolean;
17
+ };
18
+ layoutMode: "compact" | "extended";
19
+ attachments: Array<BlogPostAttachment>;
20
+ isSelected: boolean;
21
+ searchText: string;
22
+ dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>;
23
+ treeFs: FileItem | undefined;
24
+ draftLatestInfoMap: Map<number, {
25
+ latestVersion: number;
26
+ folderId: number;
27
+ folderName: string;
28
+ fileExt: string;
29
+ fileSize: string;
30
+ }> | undefined;
31
+ archivedDocumentMap: Map<number, {
32
+ tid: number;
33
+ did: number;
34
+ fileExt: string;
35
+ fileSize: string;
36
+ }> | undefined;
37
+ context?: TMBlogContextDescriptor;
38
+ handleAttachmentFocus: (attachment: DcmtInfo | undefined) => void;
39
+ openDcmtForm: (dcmtInfo: DcmtInfo) => void;
40
+ }
41
+ declare const TMBlogAttachments: (props: TMBlogAttachmentsProps) => import("react/jsx-runtime").JSX.Element;
42
+ export default TMBlogAttachments;
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SDK_Globals } from "@topconsultnpm/sdk-ts";
3
+ import { getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
4
+ import TMDcmtIcon from "../features/documents/TMDcmtIcon";
5
+ import { IconAttachment } from "../../helper";
6
+ const TMBlogAttachments = (props) => {
7
+ const { attachments, isSelected, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
8
+ const handleMouseEnter = (e, blogPostAttachment, name, fileExt) => {
9
+ e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
10
+ e.currentTarget.style.backgroundColor = isSelected ? lightenColor("#135596", 40) : '#cfcfcf';
11
+ const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
12
+ const fileName = `${removeFileExtension(name)}_${archiveID}_${blogPostAttachment.tid}_${blogPostAttachment.did}.${fileExt}`;
13
+ handleAttachmentFocus({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
14
+ };
15
+ const handleMouseLeave = (e) => {
16
+ e.currentTarget.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.1)';
17
+ e.currentTarget.style.backgroundColor = isSelected ? "#135596" : "#ffffff";
18
+ handleAttachmentFocus(undefined);
19
+ };
20
+ const onDoubleClick = (e, blogPostAttachment, name, fileExt) => {
21
+ const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
22
+ const fileName = `${removeFileExtension(name)}_${archiveID}_${blogPostAttachment.tid}_${blogPostAttachment.did}.${fileExt}`;
23
+ openDcmtForm({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
24
+ };
25
+ return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
26
+ const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
27
+ return _jsx("div", { onDoubleClick: (e) => onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => handleMouseLeave(e), style: {
28
+ display: 'inline-flex',
29
+ padding: '4px 8px',
30
+ margin: '4px',
31
+ border: '1px solid #ddd',
32
+ borderRadius: '8px',
33
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
34
+ backgroundColor: isSelected ? "#135596" : "#ffffff",
35
+ cursor: "pointer",
36
+ fontSize: '0.9rem',
37
+ color: isSelected ? "#ffffff" : "#000000",
38
+ }, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex' }, children: [(!archivedDocumentsExist && !draftExist) ?
39
+ _jsx(IconAttachment, { style: { marginRight: "5px" } }) :
40
+ _jsx("div", { style: { marginRight: "10px" }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, children: nameElement })] }) }, blogPostAttachment.did + "_" + index);
41
+ }) });
42
+ };
43
+ export default TMBlogAttachments;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { BlogPost, HomeBlogPost } from "@topconsultnpm/sdk-ts";
3
+ import { TMBlogsFilterCategoryId, TMBlogsFilterCategoryIdDataSource } from "./TMBlogsPostUtils";
4
+ interface TMBlogHeaderProps {
5
+ /** Visibility of the component */
6
+ isVisible: boolean;
7
+ /** Layout mode of the component */
8
+ layoutMode: "compact" | "extended";
9
+ /** Optional height of the component (CSS value) */
10
+ height: string;
11
+ /** Optional width of the component (CSS value) */
12
+ width: string;
13
+ /** An array of blog posts or home blog posts */
14
+ allPosts: Array<BlogPost | HomeBlogPost>;
15
+ /** Number of posts to show */
16
+ postsToShow: number;
17
+ /** Callback when the number of posts to show changes */
18
+ onPostsToShowChange: (postsToShow: number) => void;
19
+ /** Data source for the tree component */
20
+ categoryIdDataSource: Array<TMBlogsFilterCategoryIdDataSource>;
21
+ /** Currently applied global filters */
22
+ appliedCategoryIdFilters: Array<TMBlogsFilterCategoryId>;
23
+ /** Setter for applied global filters */
24
+ setAppliedCategoryIdFilters: React.Dispatch<React.SetStateAction<Array<TMBlogsFilterCategoryId>>>;
25
+ /** Current search text */
26
+ searchText: string;
27
+ /** Callback when the search text changes */
28
+ onSearchChange: (value: string) => void;
29
+ }
30
+ declare const TMBlogHeader: (props: TMBlogHeaderProps) => import("react/jsx-runtime").JSX.Element;
31
+ export default TMBlogHeader;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SDKUI_Localizator } from "../../helper";
3
+ import TMDropDown from "../editors/TMDropDown";
4
+ import TMTreeDropDown from "../editors/TMTreeDropDown";
5
+ import { TMSearchBar } from "../sidebar/TMHeader";
6
+ const TMBlogHeader = (props) => {
7
+ const { isVisible, layoutMode, height, width, allPosts, postsToShow, onPostsToShowChange, categoryIdDataSource, appliedCategoryIdFilters, setAppliedCategoryIdFilters, searchText, onSearchChange } = props;
8
+ // Data source for the number of posts to display in the UI
9
+ const postsToShowDataSource = [
10
+ { value: 30, display: SDKUI_Localizator.Latest + ' 30' },
11
+ { value: 50, display: SDKUI_Localizator.Latest + ' 50' },
12
+ { value: 100, display: SDKUI_Localizator.Latest + ' 100' },
13
+ { value: allPosts.length, display: SDKUI_Localizator.All + ` (${allPosts.length})` },
14
+ ];
15
+ // Function to handle changes in the filter (number of posts to show)
16
+ const handlePostsToShowChange = (e) => {
17
+ if (!e?.target?.value)
18
+ return;
19
+ const value = e.target.value;
20
+ if (value !== undefined) {
21
+ onPostsToShowChange(Number(value));
22
+ }
23
+ };
24
+ const containerStyle = {
25
+ display: isVisible ? "flex" : "none",
26
+ height: isVisible ? height : "0px",
27
+ width: isVisible ? width : "0px",
28
+ flexDirection: layoutMode === "extended" ? "row" : "column",
29
+ gap: layoutMode === "extended" ? "8px" : "4px",
30
+ alignItems: layoutMode === "extended" ? "center" : "normal",
31
+ justifyContent: layoutMode === "extended" ? "normal" : "center",
32
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
33
+ borderBottom: "2px solid transparent",
34
+ backgroundImage: "linear-gradient(white, white), linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)",
35
+ backgroundOrigin: "border-box",
36
+ backgroundClip: "padding-box, border-box",
37
+ marginLeft: "4px",
38
+ };
39
+ return _jsxs("div", { style: containerStyle, children: [_jsx("div", { children: _jsx(TMSearchBar, { marginLeft: "0px", maxWidth: "100%", searchValue: searchText, onSearchValueChanged: (value) => onSearchChange(value) }) }), layoutMode === "extended" && _jsx("div", { children: _jsx(TMDropDown, { value: postsToShow, dataSource: postsToShowDataSource, onValueChanged: handlePostsToShowChange, elementStyle: { width: '120px', height: '29px' } }) }), _jsx("div", { children: _jsx(TMTreeDropDown, { dataSource: categoryIdDataSource, values: appliedCategoryIdFilters, setValues: setAppliedCategoryIdFilters, displayExpr: false, isValidKey: () => true, elementStyle: { minWidth: '100%', height: '29px' } }) })] });
40
+ };
41
+ export default TMBlogHeader;
@@ -1,36 +1,27 @@
1
- import React from 'react';
2
- import { BlogPost, HomeBlogPost, IDCount, UserDescriptor } from "@topconsultnpm/sdk-ts";
3
- import { TMBlogContextDescriptor } from './TMBlogsUtils';
4
- import { DcmtInfo } from '../../ts';
5
- import { FileItem } from '../base/TMFileManagerUtils';
6
- interface TMBlogsProps {
1
+ import React from "react";
2
+ import { BlogPost, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
3
+ import { DcmtInfo } from "../../ts";
4
+ import { FileItem } from "../base/TMFileManagerUtils";
5
+ import { TMBlogsPostHeader, TMBlogContextDescriptor } from "./TMBlogsPostUtils";
6
+ interface TMBlogsPostProps {
7
+ /** Flag to indicate whether the component is open */
8
+ scrollToSelected: boolean;
7
9
  /** Component Identifier */
8
10
  id: string;
9
11
  /** An array of blog posts or home blog posts */
10
- allData: Array<BlogPost | HomeBlogPost>;
11
- /** Optional flag to show extended attachments */
12
- showExtendedAttachments?: boolean;
13
- /** Optional flag to automatically scroll to the bottom of the list */
14
- scrollToBottom?: boolean;
12
+ posts: Array<BlogPost | HomeBlogPost>;
13
+ /** Optional display mode */
14
+ displayMode?: "chat" | "stacked";
15
15
  /** Optional height of the component (CSS value) */
16
16
  height?: string;
17
17
  /** Optional width of the component (CSS value) */
18
18
  width?: string;
19
+ /** Optional flag to indicate whether to scroll to bottom on new posts */
20
+ scrollToBottom?: boolean;
19
21
  /** Optional header configuration object */
20
- header?: {
21
- /** Flag to display the view mode toggle */
22
- showViewMode: boolean;
23
- /** Flag to display filter options */
24
- showFilters: boolean;
25
- /** Flag to display the search bar */
26
- showSearchBar: boolean;
27
- /** Flag to display a dropdown menu for selecting posts */
28
- showPostsDropDown: boolean;
29
- };
30
- /** Optional flag to show an icon in the component */
31
- showIconHeader?: boolean;
32
- /** Optional color for customizing the appearance */
33
- color?: string;
22
+ header?: TMBlogsPostHeader;
23
+ /** Optional flag to show extended attachments */
24
+ showExtendedAttachments?: boolean;
34
25
  /** Optional file system tree structure */
35
26
  treeFs?: FileItem;
36
27
  /** Optional map storing the latest draft information, where the key is the draft ID */
@@ -48,14 +39,8 @@ interface TMBlogsProps {
48
39
  fileExt: string;
49
40
  fileSize: string;
50
41
  }>;
51
- /** Optional callback function to update the list of visualized blog posts */
52
- updateVisualizedBlogCallback?: (blogPosts: Array<BlogPost | HomeBlogPost>) => void;
53
- /** Optional callback to handle navigation to working groups */
54
- handleNavigateToWGs?: (selectedWorkingGroupId: number) => void;
55
- /** Optional boolean to control the visibility of an ID */
56
- showId?: boolean;
57
- /** Optional setter function to update the visibility state of an ID */
58
- setShowId?: React.Dispatch<React.SetStateAction<boolean>>;
42
+ /** Context descriptor for the blog component */
43
+ context?: TMBlogContextDescriptor;
59
44
  /** Optional context menu params */
60
45
  contextMenuParams?: {
61
46
  isShowHideFilterEnabled: boolean;
@@ -69,34 +54,33 @@ interface TMBlogsProps {
69
54
  isRefreshEnabled: boolean;
70
55
  isCreateContextualTask: boolean;
71
56
  };
72
- /** Optional refresh callback */
73
- refreshCallback?: () => Promise<void>;
74
- /** An array of partecipants */
75
- participants?: Array<UserDescriptor>;
76
- /** An array of new blog posts ID */
77
- newPosts?: Array<IDCount>;
57
+ /** Optional flag to show the floating comment button (default: false) */
58
+ showFloatingCommentButton?: boolean;
78
59
  /** Show Comment Form Callback */
79
- showCommentFormCallback?: () => void;
60
+ showCommentFormCallback?: (dcmt: DcmtInfo | undefined) => void;
80
61
  /** Show Task Form Callback */
81
62
  showTaskFormCallback?: () => void;
82
- /** Optional Whether to enable the context menu */
83
- showContextMenu?: boolean;
84
- /** Optional handle attachment focus functon */
85
- handleAttachmentFocus?: (attachment: DcmtInfo | undefined) => void;
86
- /** Optional flag to show the floating comment button (default: false) */
87
- showFloatingCommentButton?: boolean;
88
- /** Context descriptor for the blog component */
89
- context?: TMBlogContextDescriptor;
90
- /** Optional layout mode */
91
- layoutMode?: 'stacked' | 'chat';
92
- /** Optional callback to mark blog as read */
93
- markBlogAsRead?: (blog: BlogPost | undefined) => Promise<void>;
94
- /** Flag to indicate whether the blog component should automatically select */
95
- shouldSelectLastBlog?: boolean;
96
- /** Updates the flag that determines if the blog component should automatically select the last blog. */
97
- updateShouldSelectLastBlog?: (value: boolean) => void;
63
+ /** Optional refresh callback */
64
+ refreshCallback?: () => Promise<void>;
65
+ /** Optional boolean to control the visibility of an ID */
66
+ showId?: boolean;
67
+ /** Optional setter function to update the visibility state of an ID */
68
+ setShowId?: React.Dispatch<React.SetStateAction<boolean>>;
98
69
  /** Refresh Home Page News Callback */
99
70
  refreshHomePageNews?: () => Promise<void>;
71
+ /** Optional callback to mark blog as read */
72
+ markBlogAsRead?: (blog: BlogPost | undefined) => Promise<void>;
73
+ /** Optional blog post to be externally selected */
74
+ externalBlogPost?: BlogPost;
75
+ /** Optional function to reset the external blog post */
76
+ resetExternalBlogPost?: () => void;
77
+ allTasks?: Array<TaskDescriptor>;
78
+ getAllTasks?: () => Promise<void>;
79
+ deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
80
+ addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
81
+ editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
82
+ handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
83
+ handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
100
84
  }
101
- declare const TMBlogs: (props: TMBlogsProps) => import("react/jsx-runtime").JSX.Element;
102
- export default TMBlogs;
85
+ declare const TMBlogsPost: (props: TMBlogsPostProps) => import("react/jsx-runtime").JSX.Element;
86
+ export default TMBlogsPost;