@topconsultnpm/sdkui-react 6.21.0-dev4.12 → 6.21.0-dev4.14

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.
@@ -26,7 +26,9 @@ export declare const TMNothingToShow: ({ text, secondText, fileExt, icon }: {
26
26
  fileExt?: string;
27
27
  icon?: any;
28
28
  }) => import("react/jsx-runtime").JSX.Element;
29
- export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
29
+ export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
30
30
  $color: string;
31
- }>> & string;
32
- export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
31
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
32
+ $color: string;
33
+ }, never>>> & string;
34
+ export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
3
+ import { DcmtMetadataMap } from '../../../helper';
3
4
  import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
4
5
  import { ITMTreeItem } from '../../base/TMTreeView';
5
6
  /**
@@ -19,7 +20,7 @@ export interface RelationTreeItem extends ITMTreeItem {
19
20
  isSeparator?: boolean;
20
21
  isInfoMessage?: boolean;
21
22
  isLogDel?: number;
22
- values?: any;
23
+ values?: DcmtMetadataMap;
23
24
  searchResult?: SearchResultDescriptor[];
24
25
  itemsCount?: number;
25
26
  fileExt?: string;
@@ -131,14 +132,6 @@ export declare const hasDetailRelations: (mTID: number | undefined) => Promise<b
131
132
  * Check if document type has master relations
132
133
  */
133
134
  export declare const hasMasterRelations: (dTID: number | undefined) => Promise<boolean>;
134
- /**
135
- * Get metadata keys excluding system metadata
136
- */
137
- export declare const getMetadataKeys: (obj: any) => string[];
138
- /**
139
- * Get display value keys for a document (max 5, prioritize SYS_Abstract)
140
- */
141
- export declare const getDcmtDisplayValue: (obj: any) => string[];
142
135
  /**
143
136
  * Get display value formatted by column type
144
137
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
- import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService } from "@topconsultnpm/sdk-ts";
4
- import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus, IconChevronDown, IconChevronRight, SDKUI_Localizator } from '../../../helper';
3
+ import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService } from "@topconsultnpm/sdk-ts";
4
+ import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus, IconChevronDown, IconChevronRight, SDKUI_Localizator, buildDcmtDisplayName } from '../../../helper';
5
5
  import ShowAlert from '../../base/TMAlert';
6
6
  import TMToppyMessage from '../../../helper/TMToppyMessage';
7
7
  import { TMColors } from '../../../utils/theme';
@@ -43,31 +43,6 @@ const isManyToManyRelation = async (relationID) => {
43
43
  const rdlManyToMany = allRelations.filter(o => o.relationType == RelationTypes.ManyToMany && o.id === relationID) ?? [];
44
44
  return rdlManyToMany.length > 0;
45
45
  };
46
- /**
47
- * Get metadata keys excluding system metadata
48
- */
49
- export const getMetadataKeys = (obj) => {
50
- if (!obj)
51
- return [];
52
- const keys = Object.keys(obj);
53
- // Escludi metadati di sistema (MID < 100 che sono uppercase) e altri campi tecnici
54
- const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
55
- return keys.filter(k => obj?.[k].value && !sysMIDs.includes(k)).filter(o => o !== "rowIndex" && o !== "ISLEXPROT");
56
- };
57
- /**
58
- * Get display value keys for a document (max 5, prioritize SYS_Abstract)
59
- */
60
- export const getDcmtDisplayValue = (obj) => {
61
- if (!obj)
62
- return [];
63
- // Prima cerca SYS_Abstract
64
- if (obj['SYS_Abstract']?.value) {
65
- return ['SYS_Abstract'];
66
- }
67
- // Altrimenti prendi i primi 5 metadati non di sistema
68
- const mdKeys = getMetadataKeys(obj);
69
- return mdKeys.slice(0, 5);
70
- };
71
46
  /**
72
47
  * Get display value formatted by column type
73
48
  */
@@ -115,23 +90,34 @@ export const getDisplayValueByColumn = (col, value) => {
115
90
  export const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
116
91
  const rows = searchResult?.dtdResult?.rows ?? [];
117
92
  const tid = searchResult?.fromTID;
118
- const dtd = await DcmtTypeListCacheService.GetAsync(tid);
93
+ // IMPORTANT: Pass true to get full metadata with all properties (isSpecialSearchOutput, etc.)
94
+ const dtd = await DcmtTypeListCacheService.GetAsync(tid, true);
119
95
  const output = [];
120
96
  for (let index = 0; index < rows.length; index++) {
121
97
  const item = { rowIndex: index };
122
98
  const row = rows[index];
123
99
  for (let i = 0; i < row.length; i++) {
124
- const mid = Number(searchResult?.dtdResult?.columns?.[i]?.extendedProperties?.["MID"] ?? "0");
100
+ const column = searchResult?.dtdResult?.columns?.[i];
101
+ const mid = Number(column?.extendedProperties?.["MID"] ?? "0");
125
102
  if (hideSysMetadata && mid < 100)
126
103
  continue;
127
- let key = searchResult?.dtdResult?.columns?.[i].caption ?? '';
128
- if (mid <= 100)
104
+ // For system metadata (MID <= 100), use UPPERCASE caption as key
105
+ // For custom metadata (MID > 100), use caption as key but handle duplicates
106
+ let key = column?.caption ?? '';
107
+ if (mid <= 100) {
129
108
  key = key.toUpperCase();
109
+ }
110
+ else {
111
+ // If key already exists with a different MID, append MID to make it unique
112
+ if (item[key] !== undefined && item[key]?.md?.id !== mid) {
113
+ key = `${key}_${mid}`;
114
+ }
115
+ }
130
116
  const value = row[i];
131
117
  const md = dtd?.metadata?.find(o => o.id == mid);
132
118
  item[key] = {
133
119
  md: md,
134
- value: getDisplayValueByColumn(searchResult?.dtdResult?.columns?.[i], value)
120
+ value: getDisplayValueByColumn(column, value)
135
121
  };
136
122
  }
137
123
  output.push(item);
@@ -1126,34 +1112,36 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1126
1112
  : defaultDocumentStyle;
1127
1113
  const textDecoration = isLogicallyDeleted ? 'line-through' : 'none';
1128
1114
  const textColor = isLogicallyDeleted ? 'gray' : undefined;
1129
- const defaultMetadataContent = item.values && (_jsx(StyledDivHorizontal, { style: {
1130
- fontSize: '1rem',
1131
- overflow: 'hidden',
1132
- flex: 1,
1133
- minWidth: 0,
1134
- whiteSpace: 'nowrap',
1135
- textDecoration: textDecoration,
1136
- color: textColor
1137
- }, children: getDcmtDisplayValue(item.values).map((key, index) => {
1138
- const md = item.values?.[key]?.md;
1139
- const value = item.values?.[key]?.value;
1140
- const displayValues = getDcmtDisplayValue(item.values);
1141
- const isLast = index === displayValues.length - 1;
1142
- return (_jsxs(StyledDivHorizontal, { style: {
1143
- flexShrink: isLast ? 1 : 0,
1144
- minWidth: isLast ? 0 : 'auto',
1145
- overflow: isLast ? 'hidden' : 'visible',
1146
- textDecoration: textDecoration,
1147
- color: textColor
1148
- }, children: [index > 0 && _jsx("span", { style: { margin: '0 5px', color: textColor || '#999', textDecoration: textDecoration }, children: "\u2022" }), showMetadataNames && (_jsxs("span", { style: { color: textColor || '#666', marginRight: '5px', textDecoration: textDecoration }, children: [md?.name || key, ":"] })), md?.dataDomain === MetadataDataDomains.DataList ? (_jsx("span", { style: { textDecoration: textDecoration, color: textColor }, children: _jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value }) })) : md?.dataDomain === MetadataDataDomains.UserID ? (_jsx("span", { style: { textDecoration: textDecoration, color: textColor }, children: _jsx(TMDataUserIdItemViewer, { userId: value, showIcon: true }) })) : (_jsx("span", { style: {
1149
- fontWeight: 500,
1150
- overflow: isLast ? 'hidden' : 'visible',
1151
- textOverflow: isLast ? 'ellipsis' : 'clip',
1152
- whiteSpace: 'nowrap',
1153
- textDecoration: textDecoration,
1154
- color: textColor
1155
- }, children: value }))] }, `${key}_${index}`));
1156
- }) }));
1115
+ const defaultMetadataContent = item.values && (() => {
1116
+ const displayKeys = buildDcmtDisplayName(item.values);
1117
+ return (_jsx(StyledDivHorizontal, { style: {
1118
+ fontSize: '1rem',
1119
+ overflow: 'hidden',
1120
+ flex: 1,
1121
+ minWidth: 0,
1122
+ whiteSpace: 'nowrap',
1123
+ textDecoration: textDecoration,
1124
+ color: textColor
1125
+ }, children: displayKeys.map((key, index) => {
1126
+ const md = item.values?.[key]?.md;
1127
+ const value = item.values?.[key]?.value;
1128
+ const isLast = index === displayKeys.length - 1;
1129
+ return (_jsxs(StyledDivHorizontal, { style: {
1130
+ flexShrink: isLast ? 1 : 0,
1131
+ minWidth: isLast ? 0 : 'auto',
1132
+ overflow: isLast ? 'hidden' : 'visible',
1133
+ textDecoration: textDecoration,
1134
+ color: textColor
1135
+ }, children: [index > 0 && _jsx("span", { style: { margin: '0 5px', color: textColor || '#999', textDecoration: textDecoration }, children: "\u2022" }), showMetadataNames && (_jsxs("span", { style: { color: textColor || '#666', marginRight: '5px', textDecoration: textDecoration }, children: [md?.name || key, ":"] })), md?.dataDomain === MetadataDataDomains.DataList ? (_jsx("span", { style: { textDecoration: textDecoration, color: textColor }, children: _jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value }) })) : md?.dataDomain === MetadataDataDomains.UserID ? (_jsx("span", { style: { textDecoration: textDecoration, color: textColor }, children: _jsx(TMDataUserIdItemViewer, { userId: value, showIcon: true }) })) : (_jsx("span", { style: {
1136
+ fontWeight: 500,
1137
+ overflow: isLast ? 'hidden' : 'visible',
1138
+ textOverflow: isLast ? 'ellipsis' : 'clip',
1139
+ whiteSpace: 'nowrap',
1140
+ textDecoration: textDecoration,
1141
+ color: textColor
1142
+ }, children: value }))] }, `${key}_${index}`));
1143
+ }) }));
1144
+ })();
1157
1145
  const metadataContent = customDocumentContent
1158
1146
  ? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
1159
1147
  : defaultMetadataContent;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { MetadataDescriptor } from '@topconsultnpm/sdk-ts';
2
3
  import { DcmtInfo } from '../../../ts';
3
4
  import { DocumentDownloadSettings, FileNamingMode } from '../../../helper';
4
5
  import { IRelatedDcmt } from './TMMasterDetailDcmts';
@@ -32,9 +33,9 @@ export declare const fileExists: (dirHandle: FileSystemDirectoryHandle, fileName
32
33
  export declare const generateUniqueFileName: (dirHandle: FileSystemDirectoryHandle, originalName: string) => Promise<string>;
33
34
  /** Recupera il nome leggibile del tipo documento (cache) */
34
35
  export declare const getTypeName: (tid: number | undefined) => Promise<string>;
35
- /** Formatta un valore convertendo le date in formato dd-MM-yyyy [HH-mm-ss] */
36
- export declare const formatMetadataValue: (value: string) => string;
37
- /** Recupera i metadati filtrati (primi 5 con mid > 100 e valore presente), concatenati con separatorChar */
36
+ /** Formatta un valore convertendo le date secondo il formato specificato in MetadataDescriptor.format */
37
+ export declare const formatMetadataValue: (value: string, md?: MetadataDescriptor) => string;
38
+ /** Recupera i metadati filtrati usando buildDcmtDisplayName, concatenati con separatorChar */
38
39
  export declare const getFilteredMetadata: (tid: number, did: number, separatorChar: string) => Promise<string | null>;
39
40
  /** Opzioni di naming necessarie per generare il nome del file di destinazione */
40
41
  export interface IFileNamingOptions {
@@ -1,5 +1,5 @@
1
- import { DcmtTypeListCacheService, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts';
2
- import { searchResultToMetadataValues, DocumentDownloadSettings, getFullFileExtension } from '../../../helper';
1
+ import { DcmtTypeListCacheService, LayoutModes, MetadataDataTypes, MetadataFormats, SDK_Globals } from '@topconsultnpm/sdk-ts';
2
+ import { searchResultToMetadataValues, DocumentDownloadSettings, getFullFileExtension, buildDcmtDisplayName } from '../../../helper';
3
3
  import { TMColors } from '../../../utils/theme';
4
4
  /** Numero minimo di file PDF necessari per poterli unire in un unico documento. */
5
5
  export const MIN_PDF_FOR_MERGE = 2;
@@ -82,7 +82,7 @@ export const sanitizeFileName = (fileName, fallbackName, maxLength = 255) => {
82
82
  const illegalCharsRegex = /[<>:"/\\|?*]/g;
83
83
  const controlCharsRegex = /[\x00-\x1F\x7F]/g;
84
84
  let sanitized = fileName
85
- .replace(illegalCharsRegex, '_')
85
+ .replace(illegalCharsRegex, '-')
86
86
  .replace(controlCharsRegex, '')
87
87
  .trim();
88
88
  sanitized = sanitized.replace(/[. ]+$/, '');
@@ -146,27 +146,40 @@ export const getTypeName = async (tid) => {
146
146
  const foundDtd = typeList.find(dtd => dtd.id?.toString() === tid?.toString());
147
147
  return foundDtd?.name ?? String(tid);
148
148
  };
149
- /** Formatta un valore convertendo le date in formato dd-MM-yyyy [HH-mm-ss] */
150
- export const formatMetadataValue = (value) => {
149
+ /** Formatta un valore convertendo le date secondo il formato specificato in MetadataDescriptor.format */
150
+ export const formatMetadataValue = (value, md) => {
151
+ // Formatta come data solo se il MetadataDescriptor indica tipo DateTime
152
+ if (md?.dataType !== MetadataDataTypes.DateTime) {
153
+ return value;
154
+ }
151
155
  const date = new Date(value);
152
- if (!isNaN(date.getTime())) {
153
- const day = date.getDate().toString().padStart(2, '0');
154
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
155
- const year = date.getFullYear();
156
- const hours = date.getHours();
157
- const minutes = date.getMinutes();
158
- const seconds = date.getSeconds();
159
- if (hours !== 0 || minutes !== 0 || seconds !== 0) {
160
- const hh = hours.toString().padStart(2, '0');
161
- const mm = minutes.toString().padStart(2, '0');
162
- const ss = seconds.toString().padStart(2, '0');
163
- return `${day}-${month}-${year} ${hh}-${mm}-${ss}`;
164
- }
165
- return `${day}-${month}-${year}`;
156
+ if (isNaN(date.getTime())) {
157
+ return value;
158
+ }
159
+ const format = md.format?.format;
160
+ const formatCulture = md.format?.formatCulture ?? window.navigator.language;
161
+ switch (format) {
162
+ case MetadataFormats.ShortDate:
163
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
164
+ case MetadataFormats.ShortTime:
165
+ return date.toLocaleString(formatCulture, { timeStyle: 'short' });
166
+ case MetadataFormats.ShortDateLongTime:
167
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit', second: '2-digit' } : { dateStyle: 'short', timeStyle: 'medium' }).replace(',', '');
168
+ case MetadataFormats.ShortDateShortTime:
169
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit' } : { dateStyle: 'short', timeStyle: 'short' }).replace(',', '');
170
+ case MetadataFormats.LongDate:
171
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
172
+ case MetadataFormats.LongTime:
173
+ return date.toLocaleString(formatCulture, { timeStyle: 'medium' });
174
+ case MetadataFormats.LongDateLongTime:
175
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit', second: '2-digit' });
176
+ case MetadataFormats.LongDateShortTime:
177
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit' });
178
+ default:
179
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
166
180
  }
167
- return value;
168
181
  };
169
- /** Recupera i metadati filtrati (primi 5 con mid > 100 e valore presente), concatenati con separatorChar */
182
+ /** Recupera i metadati filtrati usando buildDcmtDisplayName, concatenati con separatorChar */
170
183
  export const getFilteredMetadata = async (tid, did, separatorChar) => {
171
184
  const metadata = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(tid, did, true);
172
185
  if (!metadata)
@@ -177,8 +190,18 @@ export const getFilteredMetadata = async (tid, did, separatorChar) => {
177
190
  const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did, metadata);
178
191
  const mdList = dtdWithMetadata?.metadata ?? [];
179
192
  const metadataList = searchResultToMetadataValues(tid, dtdResult, rows, mids, mdList, LayoutModes.Update);
180
- return metadataList
181
- .reduce((acc, md) => acc.length < 5 && md.mid && md.mid > 100 && md.value ? [...acc, formatMetadataValue(md.value)] : acc, [])
193
+ // Converte l'array di MetadataValueDescriptorEx in DcmtMetadataMap per buildDcmtDisplayName
194
+ const metadataMap = Object.fromEntries(metadataList.filter(mvd => mvd.md?.name).map(mvd => [mvd.md.name, { md: mvd.md, value: mvd.value }]));
195
+ // Usa buildDcmtDisplayName per ricavare i nomi dei metadati da visualizzare
196
+ const displayKeys = buildDcmtDisplayName(metadataMap);
197
+ if (displayKeys.length === 0)
198
+ return null;
199
+ return displayKeys
200
+ .map(key => {
201
+ const entry = metadataMap[key];
202
+ return entry?.value ? formatMetadataValue(String(entry.value), entry.md) : null;
203
+ })
204
+ .filter(Boolean)
182
205
  .join(separatorChar);
183
206
  };
184
207
  /** Genera il nome file di destinazione in base alle impostazioni di naming */
@@ -201,6 +224,7 @@ export const generateTargetFileName = async (file, dcmtInfo, options) => {
201
224
  case 'onlyCustomMetadata': {
202
225
  try {
203
226
  const filteredMetadata = await getFilteredMetadata(dcmtInfo.TID, dcmtInfo.DID, separatorChar);
227
+ console.log("filteredMetadata for TID:", dcmtInfo.TID, "DID:", dcmtInfo.DID, "is", filteredMetadata);
204
228
  if (filteredMetadata) {
205
229
  if (fileNamingMode === 'documentTypeAndCustomMetadata') {
206
230
  const typeName = await getTypeName(dcmtInfo.TID);
@@ -25,6 +25,6 @@ interface ITMSearchQueryPanelProps {
25
25
  declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
26
26
  export default TMSearchQueryPanel;
27
27
  export declare const refreshLastSearch: (qd: QueryDescriptor | undefined) => Promise<SearchResultDescriptor[] | undefined>;
28
- export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
29
- export declare const StyledToppyText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
30
- export declare const StyledToppyImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
28
+ export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
29
+ export declare const StyledToppyText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
30
+ export declare const StyledToppyImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>>> & string;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
3
3
  import { WorkItemActor } from './RecipientList';
4
- export declare const RecipientsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ export declare const RecipientsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
5
5
  export declare const tosToActors: (tosString: string) => {
6
6
  andRecipients: WorkItemActor[];
7
7
  orRecipients: WorkItemActor[];
@@ -11,4 +11,4 @@ interface ChangePasswordInputsProps {
11
11
  }
12
12
  declare const ChangePasswordInputs: React.FC<ChangePasswordInputsProps>;
13
13
  export default ChangePasswordInputs;
14
- export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
14
+ export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
2
  import { TMPanelDefinition } from './types';
3
- export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
3
+ export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$isDisabled" | "$isActive"> & {
4
4
  $isActive?: boolean;
5
5
  $isDisabled?: boolean;
6
- }>> & string;
6
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$isDisabled" | "$isActive"> & {
7
+ $isActive?: boolean;
8
+ $isDisabled?: boolean;
9
+ }, never>>> & string;
7
10
  interface TMPanelManagerToolbarProps {
8
11
  panels: Array<TMPanelDefinition>;
9
12
  }
@@ -2,14 +2,18 @@ import React from 'react';
2
2
  import { QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
3
3
  import { ITMApplyFormProps, FormModes } from '../../ts';
4
4
  import type { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
5
- export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
- export declare const StyledItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
+ export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
6
+ export declare const StyledItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$borderRadius"> & {
7
7
  $borderRadius?: string;
8
- }>> & string;
9
- export declare const StyledAccordionItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const StyledAccordionItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$borderRadius"> & {
9
+ $borderRadius?: string;
10
+ }, never>>> & string;
11
+ export declare const StyledAccordionItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
12
+ export declare const StyledAccordionItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled"> & {
13
+ $disabled?: boolean;
14
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled"> & {
11
15
  $disabled?: boolean;
12
- }>> & string;
16
+ }, never>>> & string;
13
17
  export declare const colorValue = "rgba(224,224,224,.5)";
14
18
  export declare const colorBrackets = "rgba(209,52,56,.3)";
15
19
  export declare const colorOperator = "rgba(16,124,16,.3)";
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- export declare const StyledCommandsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ export declare const StyledCommandsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isMobile"> & {
3
3
  $isMobile?: boolean;
4
- }>> & string;
4
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isMobile"> & {
5
+ $isMobile?: boolean;
6
+ }, never>>> & string;
5
7
  export interface TMCommandItemProps {
6
8
  icon: React.ReactNode;
7
9
  selected?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
3
+ import { getDTDDisplayNameInfo, IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
4
4
  import { AccessLevels, AccessLevelsEx, ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts';
5
5
  import TMSpinner from '../base/TMSpinner';
6
6
  import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipItem, StyledTooltipSeparatorItem } from '../base/Styled';
@@ -309,6 +309,18 @@ export default TMTidViewer;
309
309
  export const cellRenderTID = (data, noneSelectionText) => {
310
310
  return (_jsx(TMTidViewer, { tid: data.value, noneSelectionText: noneSelectionText }));
311
311
  };
312
+ /** Componente per mostrare il metodo di visualizzazione del nome documento (carica i metadati dalla cache se necessario) */
313
+ const TMDisplayNameMethodItem = ({ dtd }) => {
314
+ const [displayNameMethod, setDisplayNameMethod] = useState('...');
315
+ useEffect(() => {
316
+ const fetchDisplayNameMethod = async () => {
317
+ const method = await getDTDDisplayNameInfo(dtd);
318
+ setDisplayNameMethod(method);
319
+ };
320
+ fetchDisplayNameMethod();
321
+ }, [dtd]);
322
+ return _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.DisplayNameMethod}: ${displayNameMethod}` });
323
+ };
312
324
  export const renderDTDTooltipContent = (dtd) => {
313
325
  const mapAccessLevelToLocalizedString = (level) => {
314
326
  if (level === undefined || level === null)
@@ -343,5 +355,5 @@ export const renderDTDTooltipContent = (dtd) => {
343
355
  isPdfEditorEnabled(dtd.widgets) ? 'PDFEditor' : null,
344
356
  ].filter(Boolean);
345
357
  return (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), enabledWidgets.length > 0 && (_jsxs(StyledTooltipItem, { children: ["Widgets: ", enabledWidgets.join(', ')] })), enabledWidgets.length === 0 && (_jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] }))] }));
346
- })() : (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] })] }))] })] }));
358
+ })() : (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] })] })), _jsx(StyledTooltipSeparatorItem, {}), _jsx(TMDisplayNameMethodItem, { dtd: dtd })] })] }));
347
359
  };
@@ -203,6 +203,9 @@ export declare class SDKUI_Localizator {
203
203
  static get DiagramItemTypes_End(): "Ende" | "End" | "Fin" | "Fim" | "Fine";
204
204
  static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
205
205
  static get DisplayFormat(): string;
206
+ static get DisplayNameMethod(): string;
207
+ static get DisplayNameMethod_Abstract(): string;
208
+ static get DisplayNameMethod_Top5(): string;
206
209
  static get DistinctValues(): "Unterschiedliche Werte" | "Distinct values" | "Valores distintos" | "Valeurs distinctes" | "Valori distinti";
207
210
  static get DocumentArchivedSuccessfully(): "Dokument erfolgreich archiviert" | "Document archived successfully" | "Documento archivado con éxito" | "Document archivé avec succès" | "Documento arquivado com sucesso" | "Documento archiviato con successo";
208
211
  static get DocumentAttachedSuccessfullyToEmail(): "Dokument erfolgreich zur E-Mail hinzugefügt." | "Document attached successfully to the email." | "Documento adjuntado exitosamente al correo electrónico." | "Document joint avec succès à l'e-mail." | "Documento anexado com sucesso ao e-mail." | "Documento allegato con successo all'email.";
@@ -1979,6 +1979,36 @@ export class SDKUI_Localizator {
1979
1979
  default: return "Formato di visualizzazione";
1980
1980
  }
1981
1981
  }
1982
+ static get DisplayNameMethod() {
1983
+ switch (this._cultureID) {
1984
+ case CultureIDs.De_DE: return "Anzeigemethode";
1985
+ case CultureIDs.En_US: return "Display Method";
1986
+ case CultureIDs.Es_ES: return "Método de visualización";
1987
+ case CultureIDs.Fr_FR: return "Méthode d'affichage";
1988
+ case CultureIDs.Pt_PT: return "Método de exibição";
1989
+ default: return "Metodo di visualizzazione";
1990
+ }
1991
+ }
1992
+ static get DisplayNameMethod_Abstract() {
1993
+ switch (this._cultureID) {
1994
+ case CultureIDs.De_DE: return "Dokumentbeschreibung (SYS_Abstract)";
1995
+ case CultureIDs.En_US: return "Document description (SYS_Abstract)";
1996
+ case CultureIDs.Es_ES: return "Descripción del documento (SYS_Abstract)";
1997
+ case CultureIDs.Fr_FR: return "Description du document (SYS_Abstract)";
1998
+ case CultureIDs.Pt_PT: return "Descrição do documento (SYS_Abstract)";
1999
+ default: return "Descrizione documento (SYS_Abstract)";
2000
+ }
2001
+ }
2002
+ static get DisplayNameMethod_Top5() {
2003
+ switch (this._cultureID) {
2004
+ case CultureIDs.De_DE: return "Erste 5 Metadaten";
2005
+ case CultureIDs.En_US: return "First 5 metadata";
2006
+ case CultureIDs.Es_ES: return "Primeros 5 metadatos";
2007
+ case CultureIDs.Fr_FR: return "5 premières métadonnées";
2008
+ case CultureIDs.Pt_PT: return "Primeiros 5 metadados";
2009
+ default: return "Primi 5 metadati";
2010
+ }
2011
+ }
1982
2012
  static get DistinctValues() {
1983
2013
  switch (this._cultureID) {
1984
2014
  case CultureIDs.De_DE: return "Unterschiedliche Werte";
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FileItem } from '../components';
3
- import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
3
+ import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, MetadataDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
4
4
  /**
5
5
  * Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
6
6
  * Es: file.pdf.p7m, file.xml.p7m, file.docx.p7m, file.xml.p7m.ts
@@ -46,9 +46,9 @@ interface TabItemProps {
46
46
  $isSelected: boolean;
47
47
  $activeGradient?: string;
48
48
  }
49
- export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TabItemProps>> & string;
50
- export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, TabItemProps>> & string;
51
- export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
49
+ export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
50
+ export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
51
+ export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
52
52
  export declare const PDGS_COLORS: {
53
53
  DOSSIER: string;
54
54
  DOCUMENT: string;
@@ -77,4 +77,36 @@ type DcmtFormToolbarVisibility = {
77
77
  };
78
78
  export declare const getDcmtFormToolbarVisibility: (appModuleID: AppModules) => DcmtFormToolbarVisibility;
79
79
  export declare const isConvertibleToPdfExt: (ext: string | undefined | null) => boolean;
80
+ /** Valore metadato con descrittore (da searchResultToDataSource) */
81
+ export interface DcmtMetadataValue {
82
+ md?: MetadataDescriptor;
83
+ value: any;
84
+ }
85
+ /** Documento con metadati indicizzati per nome */
86
+ export interface DcmtMetadataMap {
87
+ [key: string]: DcmtMetadataValue;
88
+ rowIndex?: any;
89
+ }
90
+ /**
91
+ * Restituisce le chiavi dei metadati da visualizzare come descrizione documento.
92
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema
93
+ */
94
+ export declare const buildDcmtDisplayName: (obj: DcmtMetadataMap | null | undefined) => Array<string>;
95
+ /** Metodo utilizzato per determinare i metadati da visualizzare come descrizione documento */
96
+ export declare enum DcmtDisplayNameMethod {
97
+ /** Nessun metadato disponibile */
98
+ None = "None",
99
+ /** Campo SYS_Abstract presente */
100
+ SysAbstract = "SysAbstract",
101
+ /** Metadati con isSpecialSearchOutput = true */
102
+ SpecialSearchOutput = "SpecialSearchOutput",
103
+ /** Primi 5 metadati non di sistema con permesso canView */
104
+ FirstViewableMetadata = "FirstViewableMetadata"
105
+ }
106
+ /**
107
+ * Analizza un DcmtTypeDescriptor e restituisce la stringa descrittiva del metodo di visualizzazione.
108
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema (default)
109
+ * Se i metadati non sono presenti nel dtd, li recupera dalla cache.
110
+ */
111
+ export declare const getDTDDisplayNameInfo: (dtd: DcmtTypeDescriptor | undefined) => Promise<string>;
80
112
  export {};