@topconsultnpm/sdkui-react-beta 6.13.87 → 6.13.89

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.
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import styled from 'styled-components';
3
4
  import { getFileIcon } from '../../../helper';
4
5
  import TMTooltip from '../../base/TMTooltip';
5
6
  import { DownloadTypes } from '../../../ts';
7
+ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
6
8
  const StyledCellRenderDcmtIcon = styled.div `
7
9
  display: flex;
8
10
  flex-direction: row;
@@ -12,16 +14,24 @@ const StyledCellRenderDcmtIcon = styled.div `
12
14
  position: relative;
13
15
  `;
14
16
  const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", onDownloadDcmtsAsync }) => {
17
+ const deviceType = useDeviceType();
18
+ let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
19
+ const isDownloadable = downloadMode !== "none" &&
20
+ tid !== undefined &&
21
+ did !== undefined &&
22
+ onDownloadDcmtsAsync !== undefined;
15
23
  const handleClick = async (e) => {
16
- if (downloadMode !== "none" &&
17
- tid !== undefined &&
18
- did !== undefined && onDownloadDcmtsAsync !== undefined) {
24
+ if (isDownloadable) {
19
25
  e.stopPropagation();
20
26
  let dcmt = [{ TID: tid, DID: did, FILEEXT: fileExtension }];
21
27
  await onDownloadDcmtsAsync?.(dcmt, DownloadTypes.Dcmt, downloadMode);
22
28
  }
23
29
  };
24
- return (_jsxs(StyledCellRenderDcmtIcon, { style: { cursor: downloadMode !== "none" && tid !== undefined && did !== undefined && onDownloadDcmtsAsync !== undefined ? "pointer" : undefined }, onClick: handleClick, children: [getFileIcon(isMail == 2 ? "PEC" : fileExtension, fileCount), isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] }));
30
+ return (_jsxs(StyledCellRenderDcmtIcon, { className: "tm-dcmt-icon", style: {
31
+ cursor: isMobile
32
+ ? (isDownloadable ? "pointer" : undefined)
33
+ : (isDownloadable ? "default" : undefined)
34
+ }, onClick: isMobile ? handleClick : undefined, onDoubleClick: !isMobile ? handleClick : undefined, children: [getFileIcon(isMail == 2 ? "PEC" : fileExtension, fileCount), isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] }));
25
35
  };
26
36
  export default TMDcmtIcon;
27
37
  function IconLexProtLock(props) {
@@ -573,6 +573,10 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
573
573
  return;
574
574
  if (e.data === undefined)
575
575
  return;
576
+ if (e.event?.target.closest('.tm-dcmt-icon')) {
577
+ // Era sull'icona, non fare nulla
578
+ return;
579
+ }
576
580
  setFocusedItem(e.data);
577
581
  onDblClick();
578
582
  }, [onDblClick]);
@@ -15,6 +15,7 @@ export declare class SDKUI_Localizator {
15
15
  static get AddBelow(): "Unten hinzufügen" | "Add below" | "Añadir abajo" | "Ajouter ci-dessous" | "Adicionar abaixo" | "Aggiungi sotto";
16
16
  static get AddAlls(): "Alle hinzufügen" | "Add all" | "Añadir todos" | "Ajoute toutes" | "Adicionar todos" | "Aggiungi tutti";
17
17
  static get AddDefinition(): "Definition hinzufügen" | "Add definition" | "Añadir definición" | "Ajoute la définition" | "Adicionar definição" | "Aggiungi definizione";
18
+ static get AddNewComment(): string;
18
19
  static get AddOrSubstFile(): "Dateien hinzufügen/ersetzen" | "Add/substitute file" | "Añadir/sustituir archivo" | "Ajoute/Remplace le fichier" | "Adicionar / substituir arquivos" | "Aggiungi/sostituisci file";
19
20
  static get AddToHomePage(): "Zur Startseite hinzufügen" | "Add to Home Page" | "Añadir a la página inicial" | "Ajoute à Home Page" | "Adicionar a Home Page" | "Aggiungi alla Home Page";
20
21
  static get Advanced(): "Erweitert" | "Advanced" | "Avanzado" | "Avancé" | "Avançado" | "Avanzate";
@@ -98,6 +98,16 @@ export class SDKUI_Localizator {
98
98
  default: return "Aggiungi definizione";
99
99
  }
100
100
  }
101
+ static get AddNewComment() {
102
+ switch (this._cultureID) {
103
+ case CultureIDs.De_DE: return "Neuen Kommentar hinzufügen";
104
+ case CultureIDs.En_US: return "Add a new comment";
105
+ case CultureIDs.Es_ES: return "Agregar un nuevo comentario";
106
+ case CultureIDs.Fr_FR: return "Ajouter un nouveau commentaire";
107
+ case CultureIDs.Pt_PT: return "Adicionar um novo comentário";
108
+ default: return "Aggiungi un nuovo commento";
109
+ }
110
+ }
101
111
  static get AddOrSubstFile() {
102
112
  switch (this._cultureID) {
103
113
  case CultureIDs.De_DE: return "Dateien hinzufügen/ersetzen";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.13.87",
3
+ "version": "6.13.89",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",