@topconsultnpm/sdkui-react-beta 6.16.69 → 6.16.70
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.
|
@@ -49,6 +49,8 @@ export interface TMDataGridProps<T> extends IDataGridOptions {
|
|
|
49
49
|
counterConfig?: ITMCounterContainerProps;
|
|
50
50
|
/** Master Detail */
|
|
51
51
|
masterDetail?: IMasterDetailProps;
|
|
52
|
+
/** On Has Filters Change */
|
|
53
|
+
onHasFiltersChange?: (hasFilters: boolean) => void;
|
|
52
54
|
}
|
|
53
55
|
declare const TMDataGrid: React.ForwardRefExoticComponent<TMDataGridProps<unknown> & React.RefAttributes<dxDataGrid<any, any>>>;
|
|
54
56
|
export default TMDataGrid;
|
|
@@ -16,7 +16,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
16
16
|
// main properties
|
|
17
17
|
keyExpr = 'id', dataSource, focusedRowEnabled = true, hoverStateEnabled = true, focusedRowKey, selectedRowKeys = [],
|
|
18
18
|
// custom options
|
|
19
|
-
dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel =
|
|
19
|
+
dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel = true, showLoadPanel = true, showSearchPanel = true, searchPanelToolbarPosition = 'before', searchPanelFocusStarting = false, counterConfig = { show: false, items: new Map() }, onHasFiltersChange,
|
|
20
20
|
// events and callbacks
|
|
21
21
|
onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onCellDblClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, onKeyDown, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, columnChooser, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
|
|
22
22
|
// other properties
|
|
@@ -28,6 +28,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
28
28
|
const [counterValues, setCounterValues] = useState(new Map());
|
|
29
29
|
const [totalRecordCount, setTotalRecordCount] = useState(0);
|
|
30
30
|
const [visibleItemsCount, setVisibleItemsCount] = useState(0);
|
|
31
|
+
const [hasFilters, setHasFilters] = useState(false);
|
|
31
32
|
useEffect(() => {
|
|
32
33
|
const count = getRecordCount(dataSource);
|
|
33
34
|
setTotalRecordCount(count);
|
|
@@ -182,11 +183,19 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
182
183
|
}, 100);
|
|
183
184
|
}
|
|
184
185
|
}, [onContentReady]);
|
|
185
|
-
|
|
186
|
+
const onOptionChangedCallback = useCallback((e) => {
|
|
187
|
+
if (showFilterPanel && e.fullName === 'filterValue' || e.fullName?.startsWith('columns') && e.fullName.endsWith('filterValues')) {
|
|
188
|
+
const newHasFilters = Array.isArray(e.value) ? e.value.length > 0 : !!e.value;
|
|
189
|
+
setHasFilters(newHasFilters);
|
|
190
|
+
onHasFiltersChange?.(newHasFilters);
|
|
191
|
+
}
|
|
192
|
+
onOptionChanged?.(e);
|
|
193
|
+
}, [onOptionChanged]);
|
|
194
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx("div", { style: { width: "100%", height: counterConfig.show ? "calc(100% - 25px)" : "100%" }, children: _jsxs(DataGrid, { ref: internalRef, id: id, className: `tm-datagrid ${hasFilters ? 'has-filters' : ''}`,
|
|
186
195
|
// main properties
|
|
187
196
|
keyExpr: keyExpr, dataSource: dataSource, selectedRowKeys: selectedRowKeys, focusedRowEnabled: focusedRowEnabled, hoverStateEnabled: hoverStateEnabled,
|
|
188
197
|
// events and callbacks
|
|
189
|
-
onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onCellDblClick: onCellDblClick, onOptionChanged:
|
|
198
|
+
onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onCellDblClick: onCellDblClick, onOptionChanged: onOptionChangedCallback, onContentReady: onContentReadyCallback, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange, onKeyDown: onKeyDown,
|
|
190
199
|
// other properties
|
|
191
200
|
disabled: disabled, autoNavigateToFocusedRow: autoNavigateToFocusedRow, focusedRowKey: focusedRowKey, columnHidingEnabled: columnHidingEnabled, columnResizingMode: columnResizingMode, columnAutoWidth: columnAutoWidth, allowColumnResizing: allowColumnResizing, allowColumnReordering: allowColumnReordering, showBorders: showBorders, showRowLines: showRowLines, showColumnLines: showColumnLines, showColumnHeaders: showColumnHeaders, rowAlternationEnabled: rowAlternationEnabled, wordWrapEnabled: wordWrapEnabled, noDataText: noDataText,
|
|
192
201
|
// styles
|
|
@@ -64,6 +64,8 @@ const TMFloatingToolbar = ({ children, backgroundColor, initialLeft, initialTop
|
|
|
64
64
|
isClicked.current = true;
|
|
65
65
|
coords.current.startX = e.clientX;
|
|
66
66
|
coords.current.startY = e.clientY;
|
|
67
|
+
coords.current.lastX = box.offsetLeft;
|
|
68
|
+
coords.current.lastY = box.offsetTop;
|
|
67
69
|
};
|
|
68
70
|
const onMouseUp = (e) => {
|
|
69
71
|
isClicked.current = false;
|
|
@@ -483,7 +483,6 @@ export default TMSearchResult;
|
|
|
483
483
|
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
484
484
|
const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
|
|
485
485
|
const [dataSource, setDataSource] = useState();
|
|
486
|
-
const [showFilterPanel, setShowFilterPanel] = useState(false);
|
|
487
486
|
const [columns, setColumns] = useState([]);
|
|
488
487
|
// State to store selected row keys
|
|
489
488
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
@@ -652,14 +651,7 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
652
651
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
653
652
|
}, []);
|
|
654
653
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
655
|
-
|
|
656
|
-
if (e === undefined)
|
|
657
|
-
return;
|
|
658
|
-
if (e.fullName === "filterValue") {
|
|
659
|
-
setShowFilterPanel(!!e.value);
|
|
660
|
-
}
|
|
661
|
-
}, []);
|
|
662
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
654
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
663
655
|
};
|
|
664
656
|
//#region TMSearchResultSelector
|
|
665
657
|
const StyledItemTemplate = styled.div `
|
|
@@ -621,49 +621,49 @@ const TMBlogs = (props) => {
|
|
|
621
621
|
setShowDcmtForm(false);
|
|
622
622
|
handleFocusedAttachment(undefined);
|
|
623
623
|
}, []);
|
|
624
|
-
return
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
624
|
+
return _jsxs("div", { style: { height: height ?? '100%', width: width ?? '100%' }, children: [_jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: localShowWaitPanel, showWaitPanelPrimary: localShowPrimary, waitPanelTitle: localWaitPanelTitle, waitPanelTextPrimary: localWaitPanelTextPrimary, waitPanelValuePrimary: localWaitPanelValuePrimary, waitPanelMaxValuePrimary: localWaitPanelMaxValuePrimary, isCancelable: true, abortController: localAbortController, children: [(currentHeader && !isHeaderHidden) && (_jsx("div", { style: { display: 'block', width: '100%', overflowX: 'auto', overflowY: 'hidden', whiteSpace: 'nowrap' }, onContextMenu: e => e.preventDefault(), children: _jsx(ScrollView, { width: "100%", height: "auto", direction: "horizontal", useNative: true, children: _jsxs("div", { style: {
|
|
625
|
+
display: 'flex',
|
|
626
|
+
flexDirection: 'row',
|
|
627
|
+
gap: '8px',
|
|
628
|
+
alignItems: 'center',
|
|
629
|
+
minWidth: 'max-content',
|
|
630
|
+
padding: '10px 0',
|
|
631
|
+
}, children: [currentHeader.showSearchBar && (_jsx("div", { style: {
|
|
632
|
+
minWidth: isMobile ? '120px' : '160px',
|
|
633
|
+
maxWidth: isMobile ? '120px' : '200px',
|
|
634
|
+
marginLeft: "10px"
|
|
635
|
+
}, children: _jsx(TMSearchBar, { marginLeft: "0px", maxWidth: "100%", searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })), currentHeader.showPostsDropDown && (_jsx("div", { style: {
|
|
636
|
+
minWidth: isMobile ? '90px' : '120px',
|
|
637
|
+
maxWidth: isMobile ? '90px' : '200px',
|
|
638
|
+
}, children: _jsx(TMDropDown, { value: postsToShow, dataSource: postsToShowDataSource, onValueChanged: handleFilterChange }) })), currentHeader.showFilters && (_jsx(TMTreeDropDown, { dataSource: treeDataSource, values: appliedGlobalFilters, setValues: setAppliedGlobalFilters, displayExpr: false, isValidKey: () => true, elementStyle: {
|
|
639
|
+
minWidth: isMobile ? '90px' : '120px',
|
|
640
|
+
width: isMobile ? '90px' : '150px',
|
|
641
|
+
height: '29px',
|
|
642
|
+
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, onContextMenu: onBackgroundContextMenu, children: [_jsx("div", { style: { width: "100%", height: "100%" }, children: ThumbnailView() }), anchorEl && _jsx(ContextMenu, { ref: contextMenuRef, dataSource: contextMenuItems, target: anchorEl, onHiding: closeContextMenu })] }), (showDcmtForm && focusedAttachment && focusedAttachment.TID && focusedAttachment.DID) && _jsx(TMDcmtForm, { TID: Number(focusedAttachment.TID), DID: Number(focusedAttachment.DID), layoutMode: LayoutModes.Update, onClose: onCloseDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + focusedAttachment.fileName, isModal: true, widthModal: "95%", heightModal: "95%" })] }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
643
|
+
position: 'absolute',
|
|
644
|
+
bottom: '18px',
|
|
645
|
+
right: '20px',
|
|
646
|
+
width: '40px',
|
|
647
|
+
height: '40px',
|
|
648
|
+
borderRadius: "50%",
|
|
649
|
+
backgroundColor: "#C2388B",
|
|
650
|
+
color: '#fff',
|
|
651
|
+
border: 'none',
|
|
652
|
+
cursor: 'pointer',
|
|
653
|
+
boxShadow: '0 2px 6px rgba(0,0,0,0.2)',
|
|
654
|
+
zIndex: 1000,
|
|
655
|
+
transition: 'background-color 0.3s ease, transform 0.2s ease',
|
|
656
|
+
display: 'flex',
|
|
657
|
+
justifyContent: 'center',
|
|
658
|
+
alignItems: 'center',
|
|
659
|
+
}, onMouseEnter: (e) => {
|
|
660
|
+
e.currentTarget.style.backgroundColor = '#D94A9F';
|
|
661
|
+
e.currentTarget.style.transform = 'scale(1.1)';
|
|
662
|
+
e.currentTarget.style.boxShadow = '0 4px 12px rgba(37, 89, 165, 0.6)';
|
|
663
|
+
}, onMouseLeave: (e) => {
|
|
664
|
+
e.currentTarget.style.backgroundColor = "#C2388B";
|
|
665
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
666
|
+
e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
|
|
667
|
+
}, onClick: () => { showCommentFormCallback(); }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.AddNewComment, children: _jsx("i", { className: "dx-icon-chat", style: { fontSize: '25px' } }) }) })] });
|
|
668
668
|
};
|
|
669
669
|
export default TMBlogs;
|