@topconsultnpm/sdkui-react-beta 6.13.26 → 6.13.28

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.
@@ -116,8 +116,10 @@ const StyledAdvancedButton = styled.div `
116
116
  cursor: ${props => !props.$isDisabled ? 'pointer' : 'default'};
117
117
  border-radius: 10px;
118
118
  overflow: hidden;
119
- color: white;
119
+ color: ${({ $isPrimaryOutline }) => $isPrimaryOutline ? TMColors.primaryColor : 'white'};
120
120
  user-select: none;
121
+ border: ${({ $isPrimaryOutline }) => $isPrimaryOutline ? `1px solid ${TMColors.primaryColor}` : 'none'};
122
+ background: ${({ $isPrimaryOutline }) => $isPrimaryOutline ? 'white' : 'unset'};
121
123
  `;
122
124
  const StyledAdvancedButtonIcon = styled.div `
123
125
  display: flex;
@@ -140,6 +142,7 @@ const StyledAdvancedButtonText = styled.div `
140
142
  background-color: ${props => props.$isDisabled ? '#d1d1d1' : props.$color ? props.$color : props.$type === 'success' ? `${TMColors.success}` : props.$type === 'error' ? `${TMColors.error}` : props.$type === 'tertiary' ? `${TMColors.tertiary}` : `${TMColors.primary}`};
141
143
  border-top-right-radius: 10px;
142
144
  border-bottom-right-radius: 10px;
145
+ padding: 5px;
143
146
  `;
144
147
  const TMButton = ({ width, height, keyGesture, btnStyle = 'normal', advancedColor, advancedType = 'primary', color = 'primary', fontSize = FontSize.defaultFontSize, disabled = false, showTooltip = true, caption, icon, description, padding, elementStyle, onClick = () => { } }) => {
145
148
  const [isHovered, setIsHovered] = useState(false);
@@ -189,7 +192,7 @@ const TMButton = ({ width, height, keyGesture, btnStyle = 'normal', advancedColo
189
192
  return (_jsx(StyledIconButton, { color: color, caption: caption, disabled: disabled, fontSize: fontSize, padding: padding, onClick: onClick, children: icon }));
190
193
  }
191
194
  else if (btnStyle === 'advanced') {
192
- return (_jsxs(StyledAdvancedButton, { "$width": width ?? '90px', "$height": height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disabled, onClick: () => !disabled && onClick?.(), children: [_jsx(StyledAdvancedButtonIcon, { "$color": advancedColor, "$isVisible": isHovered, "$isDisabled": disabled, "$type": advancedType, children: icon }), _jsxs(StyledAdvancedButtonText, { "$color": advancedColor, "$isDisabled": disabled, "$type": advancedType, children: [" ", caption, " "] })] }));
195
+ return (_jsxs(StyledAdvancedButton, { "$width": width ?? '90px', "$height": height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disabled, "$isPrimaryOutline": advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), children: [_jsx(StyledAdvancedButtonIcon, { "$color": advancedColor, "$isVisible": isHovered, "$isDisabled": disabled, "$type": advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { "$color": advancedColor, "$isDisabled": disabled, "$type": advancedType, children: caption })] }));
193
196
  }
194
197
  else {
195
198
  return (_jsx(StyledTextButton, { color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, children: caption }));
@@ -1,14 +1,19 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { getListMaxItems } from '../../helper';
3
- import { TMColors } from '../../utils/theme';
4
3
  import TMButton from './TMButton';
5
4
  import { useDeviceType, DeviceType } from './TMDeviceProvider';
6
5
  const TMShowAllOrMaxItemsButton = ({ showAll, dataSourceLength, onClick }) => {
7
6
  const deviceType = useDeviceType();
8
7
  let maxItems = getListMaxItems(deviceType ?? DeviceType.DESKTOP);
9
- const captionText = showAll ? "Mostra meno" : `Mostra tutti (+${dataSourceLength - maxItems})`;
10
- return (_jsx(TMButton, { elementStyle: { position: 'absolute', right: '10px' }, btnStyle: 'icon', caption: captionText, icon: showAll ?
11
- _jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `-${dataSourceLength - maxItems}` }) }) :
12
- _jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `+${dataSourceLength - maxItems}` }) }), onClick: () => onClick?.() }));
8
+ const captionText = showAll ? "Mostra meno" : `Mostra tutti`;
9
+ const isMobile = deviceType === DeviceType.MOBILE;
10
+ return (_jsx(_Fragment, { children: isMobile ?
11
+ _jsx(TMButton, { elementStyle: { position: 'absolute', right: '10px' }, btnStyle: 'icon', caption: captionText, icon: showAll ?
12
+ _jsx("div", { style: { backgroundColor: '#4A96D2', minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `-${dataSourceLength - maxItems}` }) }) :
13
+ _jsx("div", { style: { backgroundColor: '#4A96D2', minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `+${dataSourceLength - maxItems}` }) }), onClick: () => onClick?.() })
14
+ :
15
+ _jsx(TMButton, { elementStyle: { position: 'absolute', right: '10px' }, width: 'auto', btnStyle: 'advanced', advancedColor: '#4A96D2', caption: captionText, showTooltip: false, icon: showAll
16
+ ? _jsx("p", { style: { color: 'white' }, children: `-${dataSourceLength - maxItems}` })
17
+ : _jsx("p", { style: { color: 'white' }, children: `+${dataSourceLength - maxItems}` }), onClick: () => onClick?.() }) }));
13
18
  };
14
19
  export default TMShowAllOrMaxItemsButton;
@@ -491,24 +491,24 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
491
491
  setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
492
492
  } }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }) }), showDcmtFormSidebar && _jsx(TMCommandsPanel, { isMobile: deviceType === DeviceType.MOBILE, items: [
493
493
  ...(layoutMode === LayoutModes.Ark ? [
494
- { icon: _jsx(IconRoundFileUpload, { fontSize: 20 }), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
494
+ { icon: _jsx(IconRoundFileUpload, {}), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
495
495
  setIsOpenPreview(!isOpenPreview); } }
496
496
  ] : []),
497
497
  ...(layoutMode !== LayoutModes.Ark ? [
498
- { icon: _jsx(IconShow, { fontSize: 20 }), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
498
+ { icon: _jsx(IconShow, {}), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
499
499
  setIsOpenPreview(!isOpenPreview); } },
500
- { icon: _jsx(IconBoard, { fontSize: 20 }), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
500
+ { icon: _jsx(IconBoard, {}), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
501
501
  closeMiddlePanel();
502
502
  setIsOpenBoard(!isOpenBoard);
503
503
  } } },
504
- { icon: _jsx(IconDcmtTypeSys, { fontSize: 20 }), selected: isOpenSysMetadata, disabled: isSysMetadataDisabled, onClick: () => { if (!isSysMetadataDisabled) {
504
+ { icon: _jsx(IconDcmtTypeSys, {}), selected: isOpenSysMetadata, disabled: isSysMetadataDisabled, onClick: () => { if (!isSysMetadataDisabled) {
505
505
  closeMiddlePanel();
506
506
  setIsOpenSysMetadata(!isOpenSysMetadata);
507
507
  } } },
508
508
  ] : []),
509
- ...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20 }), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
509
+ ...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, {}), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
510
510
  setIsOpenMaster(!isOpenMaster); } }] : []),
511
- ...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
511
+ ...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
512
512
  setIsOpenDetails(!isOpenDetails); } }] : []),
513
513
  ...customRightSidebarItems
514
514
  ] }), isOpenDetails &&
@@ -395,12 +395,12 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
395
395
  _jsx(TMTreeView, { dataSource: data, allowMultipleSelection: allowMultipleSelection, calculateItemsForNode: calculateItemsForNode, itemRender: renderItem, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectionChanged: handleSelectedItemsChanged, onDataChanged: (items) => setData(updateHiddenProperty(items)) }) }), _jsx(TMLayoutItem, { children: focusedItem?.isDcmt ?
396
396
  _jsx(TMDcmtForm, { TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE, showPreview: showPreview, showBoard: showBoard, showSysMetadata: showSysMetadata, showDcmtForm: showDcmtForm, onClose: () => { setShowDcmtForm(false); }, onClosePreview: () => { setShowPreview(false); } }) :
397
397
  _jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onClose: () => { setShowDcmtForm(false); }, onClosePreview: () => { setShowPreview(false); }, onTaskCreateRequest: onTaskCreateRequest }) })] }, "TMDetails-panel") }) }), _jsx(TMCommandsPanel, { isMobile: isMobile, items: [
398
- { icon: _jsx(IconShow, { fontSize: 20 }), selected: showPreview, onClick: () => { setShowPreview(!showPreview); } },
399
- { icon: _jsx(IconPreview, { fontSize: 20 }), selected: showDcmtForm, onClick: () => { setShowDcmtForm(!showDcmtForm); } },
400
- { icon: _jsx(IconBoard, { fontSize: 20 }), selected: showBoard, onClick: () => { setShowSysMetadata(false); setShowBoard(!showBoard); } },
401
- { icon: _jsx(IconDcmtTypeSys, { fontSize: 20 }), selected: showSysMetadata, onClick: () => { setShowBoard(false); setShowSysMetadata(!showSysMetadata); } },
402
- { icon: _jsx(IconCheckFile, { fontSize: 20 }), selected: showZeroDcmts, onClick: () => { setShowZeroDcmts(!showZeroDcmts); } },
403
- { icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), disabled: !focusedItem?.isDcmt, onClick: () => { appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did); } }
398
+ { icon: _jsx(IconShow, {}), selected: showPreview, onClick: () => { setShowPreview(!showPreview); } },
399
+ { icon: _jsx(IconPreview, {}), selected: showDcmtForm, onClick: () => { setShowDcmtForm(!showDcmtForm); } },
400
+ { icon: _jsx(IconBoard, {}), selected: showBoard, onClick: () => { setShowSysMetadata(false); setShowBoard(!showBoard); } },
401
+ { icon: _jsx(IconDcmtTypeSys, {}), selected: showSysMetadata, onClick: () => { setShowBoard(false); setShowSysMetadata(!showSysMetadata); } },
402
+ { icon: _jsx(IconCheckFile, {}), selected: showZeroDcmts, onClick: () => { setShowZeroDcmts(!showZeroDcmts); } },
403
+ { icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), disabled: !focusedItem?.isDcmt, onClick: () => { appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did); } }
404
404
  ] })] }));
405
405
  };
406
406
  export default TMMasterDetailDcmts;
@@ -1,16 +1,18 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { SharingModes, SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts-beta';
5
5
  import { LocalizeSharingModes } from '../../../helper/Enum_Localizator';
6
6
  import ContextMenu from 'devextreme-react/cjs/context-menu';
7
- import { SDKUI_Localizator, Globalization, svgToString, IconStar, IconDelete, IconDashboard, IconApply } from '../../../helper';
7
+ import { SDKUI_Localizator, Globalization, svgToString, IconStar, IconDelete, IconDashboard, IconSavedQuery, IconApply, IconInfo } from '../../../helper';
8
8
  import { TMColors } from '../../../utils/theme';
9
9
  import ShowAlert from '../../base/TMAlert';
10
10
  import TMButton from '../../base/TMButton';
11
11
  import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
12
12
  import TMSpinner from '../../base/TMSpinner';
13
+ import TMTooltip from '../../base/TMTooltip';
13
14
  import { TMSearchBar } from '../../sidebar/TMHeader';
15
+ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
14
16
  const StyledSqdItem = styled.div `
15
17
  display: flex;
16
18
  flex-direction: column;
@@ -26,6 +28,21 @@ const StyledSqdItem = styled.div `
26
28
  cursor: pointer;
27
29
  }
28
30
 
31
+ .info-icon {
32
+ position: absolute;
33
+ left: -2px;
34
+ top: 50%;
35
+ transform: translateY(-50%);
36
+ opacity: ${({ $isMobile }) => ($isMobile ? 1 : 0)};
37
+ transition: opacity 0.2s;
38
+ pointer-events: ${({ $isMobile }) => ($isMobile ? 'auto' : 'none')};
39
+ }
40
+
41
+ &:hover .info-icon {
42
+ opacity: 1;
43
+ pointer-events: auto;
44
+ }
45
+
29
46
  &:last-child {
30
47
  border-bottom: none; // remove border for last item
31
48
  margin-bottom: 0;
@@ -42,7 +59,7 @@ const getSharingModeColor = (sharingMode) => {
42
59
  export const getTooltipBySqd = (sqd) => {
43
60
  if (!sqd)
44
61
  return null;
45
- return (_jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("div", { children: ["ID: ", sqd.id] }), _jsxs("div", { children: ["Master TID: ", sqd.masterTID] }), _jsx("div", { children: sqd.description }), _jsx("hr", {}), _jsxs("div", { children: [SDKUI_Localizator.OwnerName, ": ", sqd.ownerName, " (", sqd.ownerID, ")"] }), _jsx("div", { children: LocalizeSharingModes(sqd.sharingMode) }), _jsxs("div", { children: ["Default: ", sqd.isDefault == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs("div", { children: ["Filtro semplice", ": ", sqd.isEasyWhere == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs("div", { children: ["Esegui ricerca immediatamente", ": ", sqd.runSearchWhenSelected == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsx("hr", {}), _jsxs("div", { children: [SDKUI_Localizator.CreationTime, ": ", Globalization.getDateTimeDisplayValue(sqd.creationTime)] }), _jsxs("div", { children: [SDKUI_Localizator.LastUpdateTime, ": ", Globalization.getDateTimeDisplayValue(sqd.lastUpdateTime)] })] }));
62
+ return (_jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: [_jsx(IconSavedQuery, { color: getSharingModeColor(sqd.sharingMode), fontSize: 20, style: { flexShrink: 0 } }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsxs("div", { children: ["ID: ", sqd.id] }), _jsxs("div", { children: ["Master TID: ", sqd.masterTID] }), sqd.description && _jsx("div", { children: `${SDKUI_Localizator.Description}: ${sqd.description}` })] })] }), _jsx("hr", {}), _jsxs("div", { children: [SDKUI_Localizator.OwnerName, ": ", sqd.ownerName, " (", sqd.ownerID, ")"] }), _jsx("div", { children: LocalizeSharingModes(sqd.sharingMode) }), _jsxs("div", { children: ["Default: ", sqd.isDefault == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs("div", { children: ["Filtro semplice", ": ", sqd.isEasyWhere == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs("div", { children: ["Esegui ricerca immediatamente", ": ", sqd.runSearchWhenSelected == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsx("hr", {}), _jsxs("div", { children: [SDKUI_Localizator.CreationTime, ": ", Globalization.getDateTimeDisplayValue(sqd.creationTime)] }), _jsxs("div", { children: [SDKUI_Localizator.LastUpdateTime, ": ", Globalization.getDateTimeDisplayValue(sqd.lastUpdateTime)] })] }));
46
63
  };
47
64
  const initialSQDsMaxItems = 12;
48
65
  const SavedQueryContexMenu = ({ sqd, manageDefault, deleteAsync, favManageAsync, setDefaultAsync }) => _jsx(ContextMenu, { items: manageDefault ? [
@@ -65,6 +82,8 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
65
82
  const [selectedItem, setSelectedItem] = useState();
66
83
  const [searchText, setSearchText] = useState('');
67
84
  const [showAllRoot, setShowAllRoot] = useState(false);
85
+ const deviceType = useDeviceType();
86
+ const isMobile = deviceType === DeviceType.MOBILE;
68
87
  useEffect(() => { loadDataAsync(false); }, [items]);
69
88
  useEffect(() => { setSelectedItem(dataSource.find(o => o.id == selectedId)); }, [selectedId, dataSource]);
70
89
  const loadDataAsync = async (refreshCache) => {
@@ -121,13 +140,13 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
121
140
  display: 'flex',
122
141
  flexDirection: 'column',
123
142
  width: '100%',
124
- padding: '5px',
143
+ padding: '5px 10px',
125
144
  gap: '3px',
126
145
  overflow: 'auto'
127
- }, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => (_jsxs(StyledSqdItem, { id: `sqd-item-${sqd.id}`, onClick: () => {
146
+ }, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => (_jsxs(StyledSqdItem, { id: `sqd-item-${sqd.id}`, "$isMobile": isMobile, onClick: () => {
128
147
  setSelectedItem(sqd);
129
148
  onItemClick?.(sqd);
130
- }, children: [_jsxs("div", { style: {
149
+ }, children: [_jsx("span", { className: "info-icon", children: _jsx(TMTooltip, { content: getTooltipBySqd(sqd), children: _jsx(IconInfo, { color: TMColors.primaryColor }) }) }), _jsxs("div", { style: {
131
150
  display: 'flex',
132
151
  flexDirection: 'row',
133
152
  justifyContent: 'center',
@@ -170,22 +170,22 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
170
170
  // selectedId={currentSQD?.id}
171
171
  onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }) }) })] })] }) }), _jsx(TMCommandsPanel, { isMobile: isMobile, items: [
172
172
  {
173
- icon: _jsx(IconTree, { fontSize: 20 }),
173
+ icon: _jsx(IconTree, {}),
174
174
  selected: showTreesPanel,
175
175
  onClick: () => setShowTreesPanel(!showTreesPanel),
176
176
  },
177
177
  {
178
- icon: _jsx(IconProgressReady, { fontSize: 20 }),
178
+ icon: _jsx(IconProgressReady, {}),
179
179
  selected: showRecentsPanel,
180
180
  onClick: () => setShowRecentsPanel(!showRecentsPanel),
181
181
  },
182
182
  {
183
- icon: _jsx(IconSavedQuery, { fontSize: 20 }),
183
+ icon: _jsx(IconSavedQuery, {}),
184
184
  selected: showSavedQueryPanel,
185
185
  onClick: () => setShowSavedQueryPanel(!showSavedQueryPanel),
186
186
  },
187
187
  ...(searchResult.length > 0 ? [{
188
- icon: _jsx(IconSearch, { fontSize: 20 }),
188
+ icon: _jsx(IconSearch, {}),
189
189
  disabled: searchResult.length <= 0,
190
190
  onClick: () => {
191
191
  if (searchResult.length > 0) {
@@ -22,6 +22,7 @@ import { TMMetadataChooserForm } from '../../choosers/TMMetadataChooser';
22
22
  import TMQueryEditor from '../../query/TMQueryEditor';
23
23
  import TMSavedQueryForm from './TMSavedQueryForm';
24
24
  import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
25
+ import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
25
26
  const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, onSearchCompleted, onFocusedMetadataChanged, onSqdSaved, onBack }) => {
26
27
  const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
27
28
  const [qd, setQd] = useState();
@@ -120,9 +121,8 @@ const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings
120
121
  setShowDistinctValuesPanel(true);
121
122
  }
122
123
  }, onQdChanged: (newQd) => { if (!deepCompare(qd, newQd))
123
- setQd(newQd); } }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '80px', padding: '15px', position: 'relative' }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, caption: SDKUI_Localizator.Search, onClick: async () => await searchAsync(qd, showAdvancedSearch), advancedColor: '#f09c0a' }), _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: TMColors.primaryColor, onClick: clearFilters })] }), (!showAdvancedSearch && qd?.where && qd?.where?.length > initialMaxItems) && _jsx(TMButton, { elementStyle: { position: 'absolute', right: '10px' }, btnStyle: 'icon', caption: showAllMdWhere ? "Mostra meno" : `Mostra tutti i metadati (+${qd?.where?.length - initialMaxItems})`, icon: showAllMdWhere ?
124
- _jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `-${qd?.where?.length - initialMaxItems}` }) }) :
125
- _jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `+${qd?.where?.length - initialMaxItems}` }) }), onClick: () => setShowAllMdWhere(!showAllMdWhere) })] }), showFiltersConfig &&
124
+ setQd(newQd); } }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '80px', padding: '15px', position: 'relative' }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: async () => await searchAsync(qd, showAdvancedSearch) }), _jsx(TMButton, { btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters })] }), (!showAdvancedSearch && qd?.where && qd?.where?.length > initialMaxItems) &&
125
+ _jsx(TMShowAllOrMaxItemsButton, { showAll: showAllMdWhere, dataSourceLength: qd?.where?.length, onClick: () => { setShowAllMdWhere(!showAllMdWhere); } })] }), showFiltersConfig &&
126
126
  _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: () => setShowFiltersConfig(false), onChoose: (tid_mids) => {
127
127
  if (!fromDTD?.metadata)
128
128
  return;
@@ -468,19 +468,19 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
468
468
  ? _jsx(TMLayoutItem, { children: _jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false); onClosePreview?.(); }, dcmtData: currentDcmt, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev') }) })
469
469
  : _jsx(_Fragment, {})] }) })
470
470
  : _jsx(_Fragment, {})] }) }) }), showSearchResultSidebar && _jsx(TMCommandsPanel, { isMobile: deviceType === DeviceType.MOBILE, items: [
471
- { icon: _jsx(IconShow, { fontSize: 20 }), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
471
+ { icon: _jsx(IconShow, {}), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
472
472
  setIsOpenPreview(!isOpenPreview); } },
473
- { icon: _jsx(IconBoard, { fontSize: 20 }), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
473
+ { icon: _jsx(IconBoard, {}), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
474
474
  closeMiddlePanel();
475
475
  setIsOpenBoard(!isOpenBoard);
476
476
  } } },
477
- { icon: _jsx(IconDcmtTypeSys, { fontSize: 20 }), selected: isOpenSysMetadata, disabled: isSysMetadataDisabled, onClick: () => { if (!isSysMetadataDisabled) {
477
+ { icon: _jsx(IconDcmtTypeSys, {}), selected: isOpenSysMetadata, disabled: isSysMetadataDisabled, onClick: () => { if (!isSysMetadataDisabled) {
478
478
  closeMiddlePanel();
479
479
  setIsOpenSysMetadata(!isOpenSysMetadata);
480
480
  } } },
481
- ...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20 }), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
481
+ ...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, {}), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
482
482
  setIsOpenMaster(!isOpenMaster); } }] : []),
483
- ...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
483
+ ...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
484
484
  setIsOpenDetails(!isOpenDetails); } }] : []),
485
485
  ] }), isOpenDetails &&
486
486
  _jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false) }) }), isOpenMaster &&
@@ -63,7 +63,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, onSelectedTIDChanged,
63
63
  if (treeItem.type == TreeItemTypes.DcmtType)
64
64
  return (_jsx(TMTidViewer, { tid: treeItem.tid, color: TMColors.primaryColor, showIcon: false }));
65
65
  else
66
- return (_jsxs(StyledDivHorizontal, { style: { gap: 5 }, children: [_jsx(IconFolder, { fontSize: 18 }), _jsx("p", { children: treeItem.nameLoc })] }));
66
+ return (_jsxs(StyledDivHorizontal, { style: { gap: 5 }, children: [_jsx(IconFolder, { fontSize: 18 }), _jsx("p", { style: { color: TMColors.primaryColor }, children: treeItem.nameLoc })] }));
67
67
  };
68
68
  // Handles selection change in the data grid
69
69
  const onSelectionChanged = useCallback((e) => {
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import styled from 'styled-components';
3
- import { useState } from 'react';
3
+ import { useEffect, useState } from 'react';
4
4
  import ReactDOMServer from 'react-dom/server';
5
5
  import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts-beta';
6
6
  import ContextMenu from 'devextreme-react/cjs/context-menu';
7
- import { IconDelete, SDKUI_Localizator, IconApply } from '../../helper';
7
+ import { IconDelete, SDKUI_Localizator, IconApply, IconInfo } from '../../helper';
8
8
  import { TMColors } from '../../utils/theme';
9
9
  import { DeviceType } from '../base/TMDeviceProvider';
10
10
  import { TMDcmtTypeChooserForm } from '../choosers/TMDcmtTypeChooser';
11
- import TMTidViewer from '../viewers/TMTidViewer';
11
+ import TMTidViewer, { TMDcmtTypeTooltip } from '../viewers/TMTidViewer';
12
12
  const StyledRecentTidItem = styled.div `
13
13
  display: flex;
14
14
  flex-direction: column;
@@ -22,6 +22,21 @@ const StyledRecentTidItem = styled.div `
22
22
  cursor: pointer;
23
23
  }
24
24
 
25
+ .info-icon {
26
+ position: absolute;
27
+ left: -7px;
28
+ top: 50%;
29
+ transform: translateY(-50%);
30
+ opacity: 0;
31
+ transition: opacity 0.2s;
32
+ pointer-events: none;
33
+ }
34
+
35
+ &:hover .info-icon {
36
+ opacity: 1;
37
+ pointer-events: auto;
38
+ }
39
+
25
40
  &:last-child {
26
41
  border-bottom: none; // remove border for last item
27
42
  margin-bottom: 0;
@@ -30,6 +45,13 @@ const StyledRecentTidItem = styled.div `
30
45
  const iconDelete = () => ReactDOMServer.renderToString(_jsx(IconDelete, {}));
31
46
  const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, onDeletedTID }) => {
32
47
  const [showDcmtTypeChooser, setShowDcmtTypeChooser] = useState(false);
48
+ const [recentDcmtTypes, setRecentDcmtTypes] = useState([]);
49
+ useEffect(() => {
50
+ DcmtTypeListCacheService.GetAllWithoutMetadataAsync().then((allTypes) => {
51
+ const filtered = allTypes.filter(dt => mruTIDs.includes(dt.id));
52
+ setRecentDcmtTypes(filtered);
53
+ });
54
+ }, [mruTIDs]);
33
55
  return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: deviceType === DeviceType.MOBILE ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px', width: '100%' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
34
56
  color: TMColors.primaryColor,
35
57
  fontSize: '1rem',
@@ -37,8 +59,8 @@ const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, o
37
59
  whiteSpace: 'nowrap',
38
60
  overflow: 'hidden',
39
61
  textOverflow: 'ellipsis'
40
- }, children: `${SDKUI_Localizator.AllDcmtTypes} (${DcmtTypeListCacheService.CacheCount(true)})` }) }) }, 0), mruTIDs.map((tid) => {
41
- return (_jsxs(StyledRecentTidItem, { id: `tid-${tid}`, onClick: () => { onSelectedTID?.(tid); }, children: [_jsx("div", { style: { display: 'flex', justifyContent: 'center', width: '100%' }, children: _jsx(TMTidViewer, { tid: tid, color: TMColors.primaryColor, showIcon: false }) }), _jsx(ContextMenu, { dataSource: [{ text: SDKUI_Localizator.Remove, icon: iconDelete(), }], target: `#tid-${tid}`, onItemClick: () => { onDeletedTID?.(tid); } }), currentMruTID == tid &&
62
+ }, children: `${SDKUI_Localizator.AllDcmtTypes} (${DcmtTypeListCacheService.CacheCount(true)})` }) }) }, 0), recentDcmtTypes.map((dtd) => {
63
+ return (_jsxs(StyledRecentTidItem, { id: `tid-${dtd.id}`, onClick: () => { onSelectedTID?.(dtd.id ?? 0); }, children: [_jsx("span", { className: "info-icon", children: _jsx(TMDcmtTypeTooltip, { dtd: dtd, children: _jsx(IconInfo, { color: TMColors.primaryColor }) }) }), _jsx("div", { style: { display: 'flex', justifyContent: 'center', width: '100%' }, children: _jsx(TMTidViewer, { tid: dtd.id, color: TMColors.primaryColor, showIcon: false }) }), _jsx(ContextMenu, { dataSource: [{ text: SDKUI_Localizator.Remove, icon: iconDelete(), }], target: `#tid-${dtd.id}`, onItemClick: () => { onDeletedTID?.(dtd.id ?? 0); } }), currentMruTID == dtd.id &&
42
64
  _jsx("div", { style: {
43
65
  width: '24px',
44
66
  height: '24px',
@@ -51,7 +73,7 @@ const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, o
51
73
  justifyContent: 'center',
52
74
  fontSize: '1rem',
53
75
  fontWeight: 'bold'
54
- }, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) })] }, tid));
76
+ }, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) })] }, dtd.id));
55
77
  })] }), showDcmtTypeChooser && _jsx(TMDcmtTypeChooserForm, { onClose: () => setShowDcmtTypeChooser(false), onChoose: (tids) => { onSelectedTID?.(tids?.[0] ?? 0); } })] }));
56
78
  };
57
79
  export default TMRecentsManager;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ResizableGridProps {
3
+ panels: React.ReactNode[];
4
+ minPercents?: number[];
5
+ initialPercents?: number[];
6
+ }
7
+ declare const ResizableGrid: React.FC<ResizableGridProps>;
8
+ export default ResizableGrid;
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // ResizableGrid.tsx
3
+ import React, { useRef, useState } from 'react';
4
+ const ResizableGrid = ({ panels, minPercents, initialPercents, }) => {
5
+ const panelCount = panels.length;
6
+ const defaultMinPercents = minPercents ?? Array(panelCount).fill(0.1);
7
+ const [percents, setPercents] = useState(initialPercents ??
8
+ Array(panelCount).fill(1 / panelCount));
9
+ const containerRef = useRef(null);
10
+ const handleMouseDown = (idx, e) => {
11
+ e.preventDefault();
12
+ const startX = e.clientX;
13
+ const startPercents = [...percents];
14
+ const onMouseMove = (moveEvent) => {
15
+ if (!containerRef.current)
16
+ return;
17
+ const deltaPx = moveEvent.clientX - startX;
18
+ const containerWidth = containerRef.current.offsetWidth;
19
+ if (containerWidth === 0)
20
+ return;
21
+ const deltaPercent = deltaPx / containerWidth;
22
+ let newPercents = [...startPercents];
23
+ // Adjust the dragged panel and the next one
24
+ newPercents[idx] = Math.max(defaultMinPercents[idx], startPercents[idx] + deltaPercent);
25
+ newPercents[idx + 1] = Math.max(defaultMinPercents[idx + 1], startPercents[idx + 1] - deltaPercent);
26
+ // Normalize if overflows
27
+ const total = newPercents.reduce((a, b) => a + b, 0);
28
+ newPercents = newPercents.map(p => p / total);
29
+ setPercents(newPercents);
30
+ };
31
+ const onMouseUp = () => {
32
+ window.removeEventListener('mousemove', onMouseMove);
33
+ window.removeEventListener('mouseup', onMouseUp);
34
+ };
35
+ window.addEventListener('mousemove', onMouseMove);
36
+ window.addEventListener('mouseup', onMouseUp);
37
+ };
38
+ // Build gridTemplateColumns string
39
+ const gridTemplateColumns = percents
40
+ .map((p, i) => `${(p * 100).toFixed(2)}%${i < panelCount - 1 ? ' 6px' : ''}`)
41
+ .join(' ');
42
+ return (_jsx("div", { ref: containerRef, style: {
43
+ display: 'grid',
44
+ gridTemplateColumns,
45
+ width: '100%',
46
+ height: '100%',
47
+ position: 'relative',
48
+ }, children: panels.map((panel, idx) => (_jsxs(React.Fragment, { children: [_jsx("div", { style: { overflow: 'auto', height: '100%' }, children: panel }), idx < panelCount - 1 && (_jsx("div", { style: {
49
+ cursor: 'col-resize',
50
+ background: '#e0e0e0',
51
+ width: 6,
52
+ zIndex: 1,
53
+ height: '100%',
54
+ }, onMouseDown: e => handleMouseDown(idx, e) }))] }, idx))) }));
55
+ };
56
+ export default ResizableGrid;
@@ -3,9 +3,10 @@ import styled from 'styled-components';
3
3
  export const StyledCommandsPanel = styled.div `
4
4
  display: flex;
5
5
  flex-direction: ${({ $isMobile }) => ($isMobile ? 'row' : 'column')};
6
- width: ${({ $isMobile }) => ($isMobile ? '100%' : '40px')};
7
- height: ${({ $isMobile }) => ($isMobile ? '40px' : 'max-content')};
8
- background: transparent linear-gradient(90deg, #E03A8B 9%, #C2388B 34%, #A63B8D 60%, #943C8D 83%, #8F3C8D 100%) 0% 0% no-repeat padding-box;
6
+ align-items: center;
7
+ width: ${({ $isMobile }) => ($isMobile ? '100%' : '50px')};
8
+ height: ${({ $isMobile }) => ($isMobile ? '50px' : 'max-content')};
9
+ background: transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box;
9
10
  border-radius: ${({ $isMobile }) => ($isMobile ? '10px 10px 0 0' : '10px 0px 0px 10px')};
10
11
  padding: 10px;
11
12
  gap: 10px;
@@ -13,13 +14,14 @@ export const StyledCommandsPanel = styled.div `
13
14
  const TMCommandsPanel = ({ isMobile, items }) => (_jsx(StyledCommandsPanel, { "$isMobile": isMobile, children: items.map((iconProps, idx) => (_jsx("span", { style: {
14
15
  background: iconProps.selected ? 'white' : 'transparent',
15
16
  borderRadius: '6px',
16
- color: iconProps.selected ? '#E03A8B' : 'white',
17
+ color: iconProps.selected ? '#005B97' : 'white',
17
18
  opacity: iconProps.disabled ? 0.4 : 1,
18
19
  cursor: iconProps.disabled ? 'not-allowed' : 'pointer',
19
20
  display: 'flex',
20
21
  alignItems: 'center',
21
22
  justifyContent: 'center',
22
- height: '24px',
23
- width: '24px',
24
- }, onClick: iconProps.disabled ? undefined : iconProps.onClick, children: iconProps.icon }, idx))) }));
23
+ height: '32px',
24
+ width: '32px',
25
+ margin: '0 auto',
26
+ }, onClick: iconProps.disabled ? undefined : iconProps.onClick, children: _jsx("span", { style: { fontSize: 24 }, children: iconProps.icon }) }, idx))) }));
25
27
  export default TMCommandsPanel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.13.26",
3
+ "version": "6.13.28",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",