@topconsultnpm/sdkui-react-beta 6.14.114 → 6.14.116

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.
@@ -105,6 +105,60 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
105
105
  : renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob) }) }));
106
106
  };
107
107
  export default TMDcmtPreview;
108
+ // export const TMFileViewer: React.FC<ITMFileViewerProps> = ({ fileBlob, isResizingActive }) => {
109
+ // const [blobUrl, setBlobUrl] = useState<string | undefined>(undefined);
110
+ // const [fileType, setFileType] = useState<string | undefined>(undefined);
111
+ // const [formattedXml, setFormattedXml] = useState<string | undefined>(undefined);
112
+ // useEffect(() => {
113
+ // if (fileBlob) {
114
+ // const url = URL.createObjectURL(fileBlob);
115
+ // setBlobUrl(url);
116
+ // setFileType(fileBlob.type);
117
+ // if (fileBlob.type.includes("xml")) {
118
+ // fileBlob.text().then((text) => {
119
+ // const parser = new DOMParser();
120
+ // const xmlDoc = parser.parseFromString(text, "application/xml");
121
+ // if (xmlDoc.querySelector("parsererror")) {
122
+ // setFormattedXml(`<div style="color: red;">Invalid XML</div>`);
123
+ // return;
124
+ // }
125
+ // const serializer = new XMLSerializer();
126
+ // const prettyXml = serializer
127
+ // .serializeToString(xmlDoc)
128
+ // .replace(/></g, ">\n<")
129
+ // .replace(/^(?!\s*$)/gm, " ");
130
+ // setFormattedXml(
131
+ // `<pre style="font-family: monospace; white-space: pre-wrap; line-height: 1.5;">${prettyXml
132
+ // .replace(/</g, "&lt;")
133
+ // .replace(/>/g, "&gt;")}</pre>`
134
+ // );
135
+ // });
136
+ // }
137
+ // return () => {
138
+ // URL.revokeObjectURL(url);
139
+ // };
140
+ // }
141
+ // return () => { }
142
+ // }, [fileBlob]);
143
+ // if (!fileBlob) {
144
+ // return <div>{`${SDKUI_Localizator.FileUpload}...`}</div>;
145
+ // }
146
+ // if (fileBlob.type.includes('image')) {
147
+ // return (
148
+ // <ImageViewer fileBlob={fileBlob} alt='' />
149
+ // )
150
+ // }
151
+ // return (
152
+ // <iframe
153
+ // srcDoc={fileType?.includes("xml") && formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined}
154
+ // src={!fileType?.includes("xml") || !formattedXml ? blobUrl : undefined}
155
+ // title="File Viewer"
156
+ // width="100%"
157
+ // height="100%"
158
+ // style={{ border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" }}
159
+ // />
160
+ // );
161
+ // };
108
162
  export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
109
163
  const [blobUrl, setBlobUrl] = useState(undefined);
110
164
  const [fileType, setFileType] = useState(undefined);
@@ -114,6 +168,7 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
114
168
  const url = URL.createObjectURL(fileBlob);
115
169
  setBlobUrl(url);
116
170
  setFileType(fileBlob.type);
171
+ setFormattedXml(undefined); // Reset XML when blob changes
117
172
  if (fileBlob.type.includes("xml")) {
118
173
  fileBlob.text().then((text) => {
119
174
  const parser = new DOMParser();
@@ -136,6 +191,11 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
136
191
  URL.revokeObjectURL(url);
137
192
  };
138
193
  }
194
+ else {
195
+ setBlobUrl(undefined);
196
+ setFileType(undefined);
197
+ setFormattedXml(undefined);
198
+ }
139
199
  return () => { };
140
200
  }, [fileBlob]);
141
201
  if (!fileBlob) {
@@ -144,6 +204,34 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
144
204
  if (fileBlob.type.includes('image')) {
145
205
  return (_jsx(ImageViewer, { fileBlob: fileBlob, alt: '' }));
146
206
  }
207
+ if (fileType === 'application/pdf') {
208
+ return (_jsx("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: _jsx("object", { data: blobUrl, type: "application/pdf", width: "100%", height: "100%", style: { border: 'none' }, children: _jsxs("div", { style: {
209
+ padding: '40px',
210
+ textAlign: 'center',
211
+ display: 'flex',
212
+ flexDirection: 'column',
213
+ alignItems: 'center',
214
+ justifyContent: 'center',
215
+ height: '100%',
216
+ gap: '20px'
217
+ }, children: [_jsx(IconPreview, { fontSize: 96 }), _jsxs("div", { children: [_jsx("h3", { children: "Documento PDF" }), _jsx("p", { children: "Anteprima non disponibile in questo despositivo. Clicca per visualizzare il documento." })] }), _jsxs("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }, children: [_jsx("a", { href: blobUrl, download: "document.pdf", style: {
218
+ minWidth: '180px',
219
+ padding: '12px 24px',
220
+ backgroundColor: TMColors.primaryColor,
221
+ color: 'white',
222
+ textDecoration: 'none',
223
+ borderRadius: '4px',
224
+ display: 'inline-block'
225
+ }, children: "Scarica PDF" }), _jsx("a", { href: blobUrl, target: "_blank", rel: "noopener noreferrer", style: {
226
+ minWidth: '180px',
227
+ padding: '12px 24px',
228
+ backgroundColor: '#6c757d',
229
+ color: 'white',
230
+ textDecoration: 'none',
231
+ borderRadius: '4px',
232
+ display: 'inline-block'
233
+ }, children: "Apri in nuova scheda" })] })] }) }) }));
234
+ }
147
235
  return (_jsx("iframe", { srcDoc: fileType?.includes("xml") && formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined, src: !fileType?.includes("xml") || !formattedXml ? blobUrl : undefined, title: "File Viewer", width: "100%", height: "100%", style: { border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" } }));
148
236
  };
149
237
  const ImageViewer = ({ fileBlob, alt = 'Image', className }) => {
@@ -101,6 +101,8 @@ export declare class SDKUI_Localizator {
101
101
  static get Delete_ConfirmFor1(): "Löschen Sie '{{0}}'?" | "Delete '{{0}}'?" | "¿Eliminar '{{0}}'?" | "Voulez-vous éliminer '{{0}}'?" | "Eliminar '{{0}}'?" | "Eliminare '{{0}}'?";
102
102
  static get Delete_ConfirmForN(): "{{0}} Ausgewählte Objekte. Alle löschen?" | "{{0}} selected objects. Delete them all?" | "{{0}} objetos seleccionados. ¿Eliminarlos todos?" | "{{0}} objets sélectionnés. Éliminez-les tous?" | "{{0}} objetos selecionados. Eliminá-los todos?" | "{{0}} oggetti selezionati. Eliminarli tutti?";
103
103
  static get DeleteComment(): "Kommentar löschen?" | "Delete the comment?" | "¿Eliminar el comentario?" | "Supprimer le commentaire ?" | "Eliminar o comentário?" | "Eliminare il commento?";
104
+ static get DeleteDeletedMessages(): string;
105
+ static get DeleteSystemMessages(): string;
104
106
  static get Deletion(): string;
105
107
  static get DeletionCompletedSuccessfully(): "Löschung erfolgreich abgeschlossen" | "Deletion completed successfully" | "Eliminación completada con éxito" | "Suppression terminée avec succès" | "Exclusão concluída com sucesso" | "Eliminazione completata con successo";
106
108
  static get Deleted(): "Gelöscht" | "Deleted" | "Eliminados" | "Supprimés" | "Excluídos" | "Eliminati";
@@ -197,6 +199,8 @@ export declare class SDKUI_Localizator {
197
199
  static get HideFormattingOptions(): "Formatierungsoptionen ausblenden" | "Hide formatting options" | "Ocultar opciones de formato" | "Masquer les options de formatage" | "Ocultar opções de formatação" | "Nascondi opzioni di formattazione";
198
200
  static get HideMetadata(): string;
199
201
  static get HideSearch(): "Suche ausblenden" | "Hide search" | "Ocultar búsqueda" | "Masquer la recherche" | "Ocultar pesquisa" | "Nascondi ricerca";
202
+ static get HistoryActionLabel(): string;
203
+ static get HistoryLabel(): string;
200
204
  static get ID_Hide(): "Ausblenden ID" | "Hide ID" | "Ocultar ID" | "Masquer ID" | "Nascondi ID";
201
205
  static get ID_Show(): "ID anzeigen" | "Show ID" | "Mostrar ID" | "Afficher ID" | "Visualizza ID";
202
206
  static get Import(): "Importieren" | "Import" | "Importar" | "Importer" | "Importa";
@@ -324,6 +328,7 @@ export declare class SDKUI_Localizator {
324
328
  static get Parameters(): "Parameter" | "Parameters" | "Parámetros" | "Paramètres" | "Parâmetros" | "Parametri";
325
329
  static get Perms(): "Berechtigungen" | "Permissions" | "Permisos" | "Autorisations" | "Permissão" | "Permessi";
326
330
  static get PhysDelete(): "Physische Stornierung" | "Physical delete" | "Cancelación física" | "Supression" | "Cancelamento física" | "Cancellazione fisica";
331
+ static get PhysicalHistoryDeletion(): string;
327
332
  static get Practice(): "Praxis" | "Practice" | "Práctica" | "Pratique" | "Prática" | "Pratica";
328
333
  static get PreviewDocument(): "Vorschau-Dokument" | "Preview document" | "Documento de vista previa" | "Document d'aperçu" | "Documento de pré-visualização" | "Anteprima documento";
329
334
  static get PreviewView(): string;
@@ -959,6 +959,26 @@ export class SDKUI_Localizator {
959
959
  default: return "Eliminare il commento?";
960
960
  }
961
961
  }
962
+ static get DeleteDeletedMessages() {
963
+ switch (this._cultureID) {
964
+ case CultureIDs.De_DE: return "Gelöschte Nachrichten löschen";
965
+ case CultureIDs.En_US: return "Delete deleted messages";
966
+ case CultureIDs.Es_ES: return "Eliminar los mensajes eliminados";
967
+ case CultureIDs.Fr_FR: return "Supprimer les messages supprimés";
968
+ case CultureIDs.Pt_PT: return "Eliminar as mensagens apagadas";
969
+ default: return "Eliminare i messaggi cancellati";
970
+ }
971
+ }
972
+ static get DeleteSystemMessages() {
973
+ switch (this._cultureID) {
974
+ case CultureIDs.De_DE: return "Systemnachrichten löschen";
975
+ case CultureIDs.En_US: return "Delete system messages";
976
+ case CultureIDs.Es_ES: return "Eliminar los mensajes del sistema";
977
+ case CultureIDs.Fr_FR: return "Supprimer les messages système";
978
+ case CultureIDs.Pt_PT: return "Eliminar as mensagens do sistema";
979
+ default: return "Eliminare i messaggi di sistema";
980
+ }
981
+ }
962
982
  static get Deletion() {
963
983
  switch (this._cultureID) {
964
984
  case CultureIDs.De_DE: return "Löschung";
@@ -1930,6 +1950,26 @@ export class SDKUI_Localizator {
1930
1950
  default: return "Nascondi ricerca";
1931
1951
  }
1932
1952
  }
1953
+ static get HistoryActionLabel() {
1954
+ switch (this._cultureID) {
1955
+ case CultureIDs.De_DE: return "Archivieren";
1956
+ case CultureIDs.En_US: return "Archive";
1957
+ case CultureIDs.Es_ES: return "Archivado";
1958
+ case CultureIDs.Fr_FR: return "Archiver";
1959
+ case CultureIDs.Pt_PT: return "Arquivar";
1960
+ default: return "Storicizza";
1961
+ }
1962
+ }
1963
+ static get HistoryLabel() {
1964
+ switch (this._cultureID) {
1965
+ case CultureIDs.De_DE: return "Verlauf";
1966
+ case CultureIDs.En_US: return "History";
1967
+ case CultureIDs.Es_ES: return "Historial";
1968
+ case CultureIDs.Fr_FR: return "Historique";
1969
+ case CultureIDs.Pt_PT: return "Histórico";
1970
+ default: return "Storico";
1971
+ }
1972
+ }
1933
1973
  static get ID_Hide() {
1934
1974
  switch (this._cultureID) {
1935
1975
  case CultureIDs.De_DE: return "Ausblenden ID";
@@ -3191,6 +3231,16 @@ export class SDKUI_Localizator {
3191
3231
  default: return "Cancellazione fisica";
3192
3232
  }
3193
3233
  }
3234
+ static get PhysicalHistoryDeletion() {
3235
+ switch (this._cultureID) {
3236
+ case CultureIDs.De_DE: return "Physisches Löschen des Verlaufs";
3237
+ case CultureIDs.En_US: return "Physical deletion of history";
3238
+ case CultureIDs.Es_ES: return "Eliminación física del historial";
3239
+ case CultureIDs.Fr_FR: return "Suppression physique de l’historique";
3240
+ case CultureIDs.Pt_PT: return "Eliminação física do histórico";
3241
+ default: return "Cancellazione fisica della cronologia";
3242
+ }
3243
+ }
3194
3244
  static get Practice() {
3195
3245
  switch (this._cultureID) {
3196
3246
  case CultureIDs.De_DE: return "Praxis";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.14.114",
3
+ "version": "6.14.116",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",