@topconsultnpm/sdkui-react 6.22.0-dev2.22 → 6.22.0-dev2.23
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/TMDataGrid.js +1 -1
- package/lib/components/features/documents/TMMasterInfoFields.js +10 -4
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +4 -4
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +0 -6
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +5 -12
- package/package.json +1 -1
|
@@ -386,7 +386,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
386
386
|
// Temporary: iOS-specific styles to prevent default long-press menu and text selection
|
|
387
387
|
WebkitTouchCallout: 'none',
|
|
388
388
|
WebkitUserSelect: 'none'
|
|
389
|
-
}, children: [dataColumns.map((column, index) => (_jsx(Column, { ...column }, column.caption + index.toString()))), sorting && _jsx(Sorting, { ...sorting }), selection && _jsx(Selection, { ...selection }), scrolling && _jsx(Scrolling, { ...scrolling }), summary && _jsx(Summary, { ...summary }), showHeaderFilter && _jsx(HeaderFilter, { visible: true, ...headerFilter }), rowDragging && _jsx(RowDragging, { ...rowDragging }), filterRow && _jsx(FilterRow, { ...filterRow }), showFilterPanel && _jsx(FilterPanel, { visible: true }), showHeaderColumnChooser && _jsxs(ColumnChooser, { height: "400px", enabled: !showHeaderColumnChooser, mode: "select", children: [_jsx(Position, { my: "center", at: "center", of: window }), _jsx(ColumnChooserSearch, { enabled: true }), _jsx(ColumnChooserSelection, { allowSelectAll: false, selectByClick: true, recursive: true })] }), stateStoring && _jsx(StateStoring, { ...stateStoring }), groupPanel && _jsx(GroupPanel, { ...groupPanel }), _jsx(Grouping, { contextMenuEnabled: true, ...grouping }), _jsx(LoadPanel, { enabled: showLoadPanel }), _jsx(SearchPanel, { visible: showSearchPanel, searchVisibleColumnsOnly: true, highlightSearchText: true }), editing && _jsx(Editing, { ...editing }), paging && _jsx(Paging, { ...paging }), effectivePager && _jsx(Pager, { ...effectivePager, visible: totalRecordCount > pageSize }), masterDetail && _jsx(MasterDetail, { ...masterDetail })] }) }), counterConfig.show && _jsx("div", { style: { width: "100%", height: "25px", display: "flex", alignItems: "center", gap: "15px", backgroundColor: "#e0e0e0" }, children: _jsx(TMCounterContainer, { items: counterValues, bgColorContainer: counterConfig.bgColorContainer, bgColorItem: counterConfig.bgColorItem, hoverColorItem: counterConfig.hoverColorItem, textColorItem: counterConfig.textColorItem }) }), customContextMenuItems && (_jsx(TMContextMenu, { target: ".dx-data-row", items: processCustomContextMenuItems(customContextMenuItems, customContextMenuRowKey), externalControl: {
|
|
389
|
+
}, children: [dataColumns.map((column, index) => (_jsx(Column, { ...column }, column.caption + index.toString()))), sorting && _jsx(Sorting, { ...sorting }), selection && _jsx(Selection, { ...selection }), scrolling && _jsx(Scrolling, { ...scrolling }), summary && _jsx(Summary, { ...summary }), showHeaderFilter && _jsx(HeaderFilter, { visible: true, ...headerFilter, search: { enabled: true, ...headerFilter?.search } }), rowDragging && _jsx(RowDragging, { ...rowDragging }), filterRow && _jsx(FilterRow, { ...filterRow }), showFilterPanel && _jsx(FilterPanel, { visible: true }), showHeaderColumnChooser && _jsxs(ColumnChooser, { height: "400px", enabled: !showHeaderColumnChooser, mode: "select", children: [_jsx(Position, { my: "center", at: "center", of: window }), _jsx(ColumnChooserSearch, { enabled: true }), _jsx(ColumnChooserSelection, { allowSelectAll: false, selectByClick: true, recursive: true })] }), stateStoring && _jsx(StateStoring, { ...stateStoring }), groupPanel && _jsx(GroupPanel, { ...groupPanel }), _jsx(Grouping, { contextMenuEnabled: true, ...grouping }), _jsx(LoadPanel, { enabled: showLoadPanel }), _jsx(SearchPanel, { visible: showSearchPanel, searchVisibleColumnsOnly: true, highlightSearchText: true }), editing && _jsx(Editing, { ...editing }), paging && _jsx(Paging, { ...paging }), effectivePager && _jsx(Pager, { ...effectivePager, visible: totalRecordCount > pageSize }), masterDetail && _jsx(MasterDetail, { ...masterDetail })] }) }), counterConfig.show && _jsx("div", { style: { width: "100%", height: "25px", display: "flex", alignItems: "center", gap: "15px", backgroundColor: "#e0e0e0" }, children: _jsx(TMCounterContainer, { items: counterValues, bgColorContainer: counterConfig.bgColorContainer, bgColorItem: counterConfig.bgColorItem, hoverColorItem: counterConfig.hoverColorItem, textColorItem: counterConfig.textColorItem }) }), customContextMenuItems && (_jsx(TMContextMenu, { target: ".dx-data-row", items: processCustomContextMenuItems(customContextMenuItems, customContextMenuRowKey), externalControl: {
|
|
390
390
|
visible: customContextMenuVisible,
|
|
391
391
|
position: customContextMenuPosition,
|
|
392
392
|
onClose: () => setCustomContextMenuVisible(false)
|
|
@@ -13,11 +13,17 @@ const styles = {
|
|
|
13
13
|
wrapper: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0, borderTop: `1px solid ${TMColors.card_background}` },
|
|
14
14
|
body: { flex: 1, minHeight: 0, padding: '13px 10px 9px', display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(185px, 1fr))', gridAutoRows: 'max-content', alignContent: 'start', columnGap: '10px', rowGap: '13px', overflow: 'auto' },
|
|
15
15
|
item: { position: 'relative', display: 'flex', alignItems: 'center', minWidth: 0, minHeight: '30px', padding: '5px 10px 4px', borderRadius: '8px', border: `1px solid ${TMColors.card_background}`, background: TMColors.default_background, transition: 'border-color 0.15s ease, box-shadow 0.15s ease' },
|
|
16
|
-
|
|
16
|
+
// Come per il pulsante copia, la posizione sta sull'ancora del tooltip; il troncamento con i
|
|
17
|
+
// puntini deve invece stare sull'elemento che contiene il testo
|
|
18
|
+
label: { position: 'absolute', top: '-7px', left: '8px', maxWidth: 'calc(100% - 16px)', minWidth: 0, padding: '0 5px', background: TMColors.default_background },
|
|
19
|
+
labelText: { maxWidth: '100%', fontSize: '9px', fontWeight: 700, lineHeight: '13px', letterSpacing: '0.5px', textTransform: 'uppercase', color: TMColors.label_normal, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
|
|
17
20
|
value: { display: 'block', width: '100%', fontSize: '12.5px', fontWeight: 500, color: TMColors.text_normal, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', userSelect: 'text', cursor: 'text', minHeight: '17px', lineHeight: '17px' },
|
|
18
21
|
emptyValue: { color: TMColors.disabled, fontWeight: 400 },
|
|
19
22
|
// Pulsante di copia: pastiglia sul bordo superiore della card, come la caption
|
|
20
|
-
|
|
23
|
+
// La posizione sta sull'ancora e non sul pulsante: è il contenitore del tooltip, che deve stare
|
|
24
|
+
// dove si vede il pulsante, altrimenti il tooltip si aprirebbe altrove
|
|
25
|
+
copyBtnAnchor: { position: 'absolute', top: '-9px', right: '6px', transition: 'opacity 0.15s ease' },
|
|
26
|
+
copyBtn: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '18px', height: '18px', padding: 0, borderRadius: '50%', border: `1px solid ${TMColors.card_background}`, background: TMColors.default_background, color: TMColors.label_normal, cursor: 'pointer', transition: 'background 0.15s ease, color 0.15s ease, border-color 0.15s ease' },
|
|
21
27
|
placeholder: { gridColumn: '1 / -1', padding: '6px 2px', color: TMColors.label_normal, fontSize: '12px' },
|
|
22
28
|
// Barra di ricerca
|
|
23
29
|
searchBar: { display: 'flex', alignItems: 'center', gap: '8px', padding: '12px 14px 0', flexShrink: 0 },
|
|
@@ -58,7 +64,7 @@ const MetadataCard = ({ caption, copyText, children }) => {
|
|
|
58
64
|
};
|
|
59
65
|
// Il pulsante resta visibile durante il feedback e quando ha il focus (accessibilità da tastiera)
|
|
60
66
|
const isCopyVisible = copyText !== '' && (!SUPPORTS_HOVER || isHovered || isCopied);
|
|
61
|
-
return (_jsxs("div", { style: styles.item, onMouseEnter: (e) => { setIsHovered(true); Object.assign(e.currentTarget.style, { borderColor: TMColors.primary, boxShadow: '0 2px 8px rgba(37, 89, 165, 0.14)' }); }, onMouseLeave: (e) => { setIsHovered(false); Object.assign(e.currentTarget.style, { borderColor: TMColors.card_background, boxShadow: 'none' }); }, children: [_jsx(
|
|
67
|
+
return (_jsxs("div", { style: styles.item, onMouseEnter: (e) => { setIsHovered(true); Object.assign(e.currentTarget.style, { borderColor: TMColors.primary, boxShadow: '0 2px 8px rgba(37, 89, 165, 0.14)' }); }, onMouseLeave: (e) => { setIsHovered(false); Object.assign(e.currentTarget.style, { borderColor: TMColors.card_background, boxShadow: 'none' }); }, children: [_jsx(TMTooltip, { content: caption, parentStyle: { ...styles.label, maxWidth: isCopyVisible ? 'calc(100% - 38px)' : 'calc(100% - 16px)' }, childStyle: { maxWidth: '100%', minWidth: 0 }, children: _jsx("span", { style: styles.labelText, children: caption }) }), children, copyText !== '' && (_jsx(TMTooltip, { content: isCopied ? SDKUI_Localizator.CopiedSuccessfully : SDKUI_Localizator.CopyToClipboard, parentStyle: { ...styles.copyBtnAnchor, opacity: isCopyVisible ? 1 : 0, pointerEvents: isCopyVisible ? 'auto' : 'none' }, children: _jsx("button", { type: 'button', style: { ...styles.copyBtn, ...(isCopied ? COPY_BTN_COPIED : COPY_BTN_IDLE) }, "aria-label": SDKUI_Localizator.CopyToClipboard, onClick: copyAsync, onFocus: () => setIsHovered(true), onBlur: () => setIsHovered(false), ...hoverStyle(isCopied ? COPY_BTN_COPIED : COPY_BTN_HOVER, isCopied ? COPY_BTN_COPIED : COPY_BTN_IDLE), children: isCopied ? _jsx(IconSuccess, { fontSize: 11 }) : _jsx(IconCopy, { fontSize: 11 }) }) }))] }));
|
|
62
68
|
};
|
|
63
69
|
// Riepilogo dei metadati di un documento in card compatte
|
|
64
70
|
const TMMasterInfoFields = ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExpandedView = false }) => {
|
|
@@ -157,7 +163,7 @@ const TMMasterInfoFields = ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExp
|
|
|
157
163
|
e.preventDefault();
|
|
158
164
|
e.stopPropagation();
|
|
159
165
|
setFilter('');
|
|
160
|
-
} }, onFocus: (e) => Object.assign(e.currentTarget.parentElement?.style ?? {}, { borderColor: TMColors.primary, boxShadow: '0 0 0 2px rgba(37, 89, 165, 0.14)' }), onBlur: (e) => Object.assign(e.currentTarget.parentElement?.style ?? {}, { borderColor: TMColors.card_background, boxShadow: 'none' }) }), filter !== '' && (_jsx("button", { type: 'button', style: styles.searchClear,
|
|
166
|
+
} }, onFocus: (e) => Object.assign(e.currentTarget.parentElement?.style ?? {}, { borderColor: TMColors.primary, boxShadow: '0 0 0 2px rgba(37, 89, 165, 0.14)' }), onBlur: (e) => Object.assign(e.currentTarget.parentElement?.style ?? {}, { borderColor: TMColors.card_background, boxShadow: 'none' }) }), filter !== '' && (_jsx(TMTooltip, { content: SDKUI_Localizator.Clear, parentStyle: { display: 'flex', flexShrink: 0 }, children: _jsx("button", { type: 'button', style: styles.searchClear, "aria-label": SDKUI_Localizator.Clear, onClick: () => setFilter(''), ...hoverStyle({ background: TMColors.primary_container, color: TMColors.primary }, { background: 'transparent', color: TMColors.label_normal }), children: _jsx(IconClearButton, { fontSize: 13 }) }) }))] }), _jsxs("span", { style: styles.searchCount, children: [filteredRows.length, "/", rows.length] })] }));
|
|
161
167
|
// La ricerca sta solo nella vista ingrandita: in linea lo spazio è poco e l'elenco è limitato
|
|
162
168
|
// all'anteprima, con il pulsante per aprirlo tutto
|
|
163
169
|
const hasSearch = isExpandedView && rows.length > PREVIEW_COUNT;
|
|
@@ -104,7 +104,7 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
104
104
|
allowSorting: false, allowFiltering: false, allowHeaderFiltering: false, allowResizing: false,
|
|
105
105
|
allowReordering: false, allowHiding: false, showInColumnChooser: false, allowEditing: false,
|
|
106
106
|
cssClass: 'tm-row-actions',
|
|
107
|
-
cellRender: (cell) => (_jsxs("div", { style: styles.actionsCell, children: [_jsx("span", { style: styles.actionIcon,
|
|
107
|
+
cellRender: (cell) => (_jsxs("div", { style: styles.actionsCell, children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Update, children: _jsx("span", { style: styles.actionIcon, onClick: () => openEditForm(cell.data), children: _jsx(IconEdit, { fontSize: 18, color: TMColors.primary }) }) }), _jsx(TMTooltip, { content: SDKUI_Localizator.Duplicate, children: _jsx("span", { style: styles.actionIcon, onClick: () => duplicateRow(cell.data), children: _jsx(IconDuplicate, { fontSize: 18, color: TMColors.tertiary }) }) }), _jsx(TMTooltip, { content: SDKUI_Localizator.Deletion, children: _jsx("span", { style: styles.actionIcon, onClick: () => deleteRow(cell.data), children: _jsx(IconDelete, { fontSize: 18, color: TMColors.error }) }) })] })),
|
|
108
108
|
};
|
|
109
109
|
return [actionsColumn, iconColumn, ...detailColumns, ...(detailSupportsFile ? [fileColumn] : [])];
|
|
110
110
|
}, [detailColumns, detailSupportsFile]);
|
|
@@ -148,13 +148,13 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
148
148
|
const renderOptionsMenu = () => {
|
|
149
149
|
if (!isSummaryPhase || isMobile)
|
|
150
150
|
return undefined;
|
|
151
|
-
return (_jsx(ContextMenu, { trigger: 'left', items: optionsMenuItems, children: _jsx("span", { style: styles.titleMenuIcon,
|
|
151
|
+
return (_jsx(ContextMenu, { trigger: 'left', items: optionsMenuItems, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Options, children: _jsx("span", { style: styles.titleMenuIcon, "aria-label": SDKUI_Localizator.Options, children: _jsx(IconMenuVertical, { fontSize: 16, color: "white" }) }) }) }));
|
|
152
152
|
};
|
|
153
153
|
// ----- Sezione: informazioni del master -----------------------------------------------------
|
|
154
154
|
const renderMasterInfo = (panel) => {
|
|
155
155
|
const isOpen = sectionsOpen.masterInfo;
|
|
156
156
|
const editMasterButton = canUpdateMaster
|
|
157
|
-
? (_jsx("button", { type: 'button', onClick: (e) => { e.stopPropagation(); setIsOpenMasterForm(true); }, style: accordionStyles.accordionExpandBtn,
|
|
157
|
+
? (_jsx(TMTooltip, { content: `${SDKUI_Localizator.Update}: ${getDtdDisplayName(dtd)}`, children: _jsx("button", { type: 'button', onClick: (e) => { e.stopPropagation(); setIsOpenMasterForm(true); }, style: accordionStyles.accordionExpandBtn, ...hoverStyle({ background: TMColors.primary_container, color: TMColors.primary }, { background: 'transparent', color: TMColors.label_normal }), children: _jsx(IconEdit, { fontSize: 16 }) }) }))
|
|
158
158
|
: undefined;
|
|
159
159
|
return (_jsxs("div", { style: { ...accordionStyles.accordion, ...accordionStyles.accordionInPanel }, children: [renderAccordionHeader({
|
|
160
160
|
section: 'masterInfo',
|
|
@@ -172,7 +172,7 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
172
172
|
const isOpen = sectionsOpen.archivedDetails;
|
|
173
173
|
const hasResults = archivedDetailResults.length > 0 && archivedDetailsCount > 0;
|
|
174
174
|
// Ricarica i dettagli già archiviati: la sezione va aperta, altrimenti l'esito non sarebbe visibile
|
|
175
|
-
const refreshArchivedButton = (_jsx("button", { type: 'button', onClick: (e) => { e.stopPropagation(); setSectionOpen('archivedDetails', true); refreshArchivedDetailsAsync(); }, disabled: isLoadingArchivedDetails, style: { ...accordionStyles.accordionExpandBtn, ...(isLoadingArchivedDetails ? { cursor: 'default', opacity: 0.5 } : {}) },
|
|
175
|
+
const refreshArchivedButton = (_jsx(TMTooltip, { content: SDKUI_Localizator.Refresh, children: _jsx("button", { type: 'button', onClick: (e) => { e.stopPropagation(); setSectionOpen('archivedDetails', true); refreshArchivedDetailsAsync(); }, disabled: isLoadingArchivedDetails, style: { ...accordionStyles.accordionExpandBtn, ...(isLoadingArchivedDetails ? { cursor: 'default', opacity: 0.5 } : {}) }, "aria-label": SDKUI_Localizator.Refresh, ...(isLoadingArchivedDetails ? {} : hoverStyle({ background: TMColors.primary_container, color: TMColors.primary }, { background: 'transparent', color: TMColors.label_normal })), children: _jsx(IconRefresh, { fontSize: 16 }) }) }));
|
|
176
176
|
return (_jsxs("div", { style: { ...accordionStyles.accordion, ...accordionStyles.accordionInPanel }, children: [renderAccordionHeader({
|
|
177
177
|
section: 'archivedDetails',
|
|
178
178
|
isOpen,
|
|
@@ -211,7 +211,6 @@ export declare const multiDetailStyles: {
|
|
|
211
211
|
lineHeight: number;
|
|
212
212
|
};
|
|
213
213
|
};
|
|
214
|
-
/** Stili delle sezioni collassabili: qui perché la testata comune (renderAccordionHeader) vive in questo file */
|
|
215
214
|
export declare const accordionStyles: {
|
|
216
215
|
accordion: {
|
|
217
216
|
display: "flex";
|
|
@@ -251,11 +250,6 @@ export declare const accordionStyles: {
|
|
|
251
250
|
display: "inline-flex";
|
|
252
251
|
alignItems: "center";
|
|
253
252
|
justifyContent: "center";
|
|
254
|
-
minWidth: string;
|
|
255
|
-
height: string;
|
|
256
|
-
padding: string;
|
|
257
|
-
borderRadius: string;
|
|
258
|
-
background: string;
|
|
259
253
|
color: string;
|
|
260
254
|
fontSize: string;
|
|
261
255
|
fontWeight: number;
|
|
@@ -128,15 +128,13 @@ export const multiDetailStyles = {
|
|
|
128
128
|
typeCardIcon: { width: '34px', height: '34px', borderRadius: '9px', background: TMColors.primary_container, display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 },
|
|
129
129
|
typeCardName: { flex: 1, fontSize: '14px', fontWeight: 500, color: TMColors.text_normal, whiteSpace: 'normal', wordBreak: 'break-word', lineHeight: 1.3 },
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
// Stili delle sezioni collassabili
|
|
132
132
|
export const accordionStyles = {
|
|
133
133
|
accordion: { display: 'flex', flexDirection: 'column', minHeight: 0, borderRadius: '8px', border: `1px solid ${TMColors.card_background}`, background: TMColors.default_background, overflow: 'hidden' },
|
|
134
|
-
// Sezione dentro un pannello: l'altezza è quella del pannello, che la sezione riempie. Serve `flex`
|
|
135
|
-
// e non `height: 100%`, perché il pannello chiuso ha altezza 0 e vive del suo ingombro minimo
|
|
136
134
|
accordionInPanel: { flex: 1 },
|
|
137
135
|
accordionHeader: { display: 'flex', alignItems: 'center', gap: '8px', padding: '4px 8px', cursor: 'pointer', userSelect: 'none', transition: 'background 0.15s ease', outline: 'none', flexShrink: 0, minHeight: '28px' },
|
|
138
136
|
accordionTitle: { flex: 1, fontSize: '12px', fontWeight: 600, color: TMColors.text_normal, display: 'flex', alignItems: 'center', gap: '6px', minWidth: 0 },
|
|
139
|
-
accordionBadge: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
|
137
|
+
accordionBadge: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: TMColors.primary, fontSize: '13px', fontWeight: 700, flexShrink: 0 },
|
|
140
138
|
accordionListBody: { position: 'relative', flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', borderTop: `1px solid ${TMColors.card_background}` },
|
|
141
139
|
accordionListPlaceholder: { display: 'flex', flex: 1, alignItems: 'center', justifyContent: 'center', gap: '10px', padding: '16px', color: TMColors.label_normal, fontSize: '13px' },
|
|
142
140
|
accordionExpandBtn: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: '20px', height: '20px', padding: 0, borderRadius: '6px', border: 'none', background: 'transparent', color: TMColors.label_normal, cursor: 'pointer', flexShrink: 0, transition: 'background 0.15s ease, color 0.15s ease' },
|
|
@@ -186,12 +184,10 @@ export const renderAccordionHeader = ({ section, isOpen, tooltip, count, title,
|
|
|
186
184
|
const canMaximize = panel.canMaximize;
|
|
187
185
|
const onToggle = () => onToggleOpen(section, !isOpen);
|
|
188
186
|
const expandTooltip = panel.isMaximized ? SDKUI_Localizator.Minimize : SDKUI_Localizator.ZoomIn;
|
|
189
|
-
return (_jsxs("div", { role: canToggle ? 'button' : undefined, tabIndex: canToggle ? 0 : undefined, "aria-expanded": canToggle ? isOpen : undefined, style: { ...accordionStyles.accordionHeader, background: restBackground, ...(canToggle ? {} : { cursor: 'default' }) }, onClick: canToggle ? onToggle : undefined,
|
|
190
|
-
// Doppio click sulla testata: ingrandisce e riduce, come nei pannelli del prodotto
|
|
191
|
-
onDoubleClick: canMaximize ? () => panel.toggleMaximize() : undefined, onKeyDown: canToggle ? (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
187
|
+
return (_jsxs("div", { role: canToggle ? 'button' : undefined, tabIndex: canToggle ? 0 : undefined, "aria-expanded": canToggle ? isOpen : undefined, style: { ...accordionStyles.accordionHeader, background: restBackground, ...(canToggle ? {} : { cursor: 'default' }) }, onClick: canToggle ? onToggle : undefined, onDoubleClick: canMaximize ? () => panel.toggleMaximize() : undefined, onKeyDown: canToggle ? (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
192
188
|
e.preventDefault();
|
|
193
189
|
onToggle();
|
|
194
|
-
} } : undefined,
|
|
190
|
+
} } : undefined, ...(canToggle ? hoverStyle({ background: TMColors.primary_container }, { background: restBackground }) : {}), children: [_jsx(TMTooltip, { content: canToggle ? tooltip : undefined, parentStyle: { flex: 1, minWidth: 0 }, childStyle: { maxWidth: '100%' }, children: _jsxs("span", { style: accordionStyles.accordionTitle, children: [title, _jsx("span", { style: accordionStyles.accordionBadge, children: count })] }) }), actions, canMaximize && (_jsx(TMTooltip, { content: expandTooltip, children: _jsx("button", { type: 'button', onClick: (e) => { e.stopPropagation(); panel.toggleMaximize(); }, style: accordionStyles.accordionExpandBtn, "aria-label": expandTooltip, ...hoverStyle({ background: TMColors.primary_container, color: TMColors.primary }, { background: 'transparent', color: TMColors.label_normal }), children: panel.isMaximized ? _jsx(IconWindowMinimize, { fontSize: 14 }) : _jsx(IconWindowMaximize, { fontSize: 14 }) }) })), canToggle && (_jsx(IconChevronRight, { fontSize: 16, color: TMColors.label_normal, style: { transform: isOpen ? 'rotate(90deg)' : 'none', transition: 'transform 0.2s ease', flexShrink: 0 } }))] }));
|
|
195
191
|
};
|
|
196
192
|
/**
|
|
197
193
|
* Contenuto di un pannello: il contesto del panel manager è leggibile solo dentro l'albero del
|
|
@@ -236,10 +232,7 @@ export const TMSectionPanelsHeights = ({ sections, sectionsOpen }) => {
|
|
|
236
232
|
}
|
|
237
233
|
if (hasMaximizedPanel)
|
|
238
234
|
return;
|
|
239
|
-
// Solo i pannelli a schermo si spartiscono l'altezza
|
|
240
|
-
// resta visibile uno solo) al pannello a schermo toccherebbe la sua sola quota nominale,
|
|
241
|
-
// lasciando vuoto lo spazio dei pannelli che non ci sono. Chi è fuori schermo resta alle proprie
|
|
242
|
-
// quote, che sono quelle da cui il panel manager riparte quando lo si torna a mostrare
|
|
235
|
+
// Solo i pannelli a schermo si spartiscono l'altezza, altrimenti resterebbe vuoto lo spazio dei nascosti
|
|
243
236
|
const visibleSections = sections.filter(section => panelVisibility[section] !== false);
|
|
244
237
|
const heights = sectionPanelHeights(visibleSections, sectionsOpen, dimensionsRef.current);
|
|
245
238
|
visibleSections.forEach(section => setPanelDimensionsById(section, heights[section].width, heights[section].height));
|