@topconsultnpm/sdkui-react-beta 6.11.111 → 6.11.112

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,8 +26,4 @@ interface ITMMetadataEditorProps {
26
26
  }
27
27
  declare const TMMetadataEditor: React.FC<ITMMetadataEditorProps>;
28
28
  export default TMMetadataEditor;
29
- export declare const MetadataEditorContextMenu: React.MemoExoticComponent<({ target, menuItems }: {
30
- target: string;
31
- menuItems: any[];
32
- }) => import("react/jsx-runtime").JSX.Element>;
33
29
  export declare const useMetadataEditableList: () => [(mid: number | undefined) => boolean, (mid: number | undefined) => void];
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useEffect, useState } from 'react';
2
+ import { useEffect, useState } from 'react';
3
3
  import { MetadataDataDomains, MetadataDataTypes, DcmtTypeListCacheService, LayoutModes, AccessLevels, PlatformObjectValidator, QueryOperators, SDK_Globals, AppModules, MetadataFormats } from '@topconsultnpm/sdk-ts-beta';
4
4
  import { TMColors } from '../../utils/theme';
5
5
  import TMDataListItemChooser from '../choosers/TMDataListItemChooser';
@@ -10,7 +10,6 @@ import TMTextBox from './TMTextBox';
10
10
  import { TMMetadataIcon } from '../viewers/TMMidViewer';
11
11
  import TMTextArea from './TMTextArea';
12
12
  import { DateDisplayTypes } from '../../helper/Globalization';
13
- import ContextMenu from "devextreme-react/cjs/context-menu";
14
13
  const renderMetadataIcon = (tid, md, layoutMode, isMetadataSelected) => {
15
14
  return (_jsx(TMMetadataIcon, { isMetadataSelected: isMetadataSelected, layoutMode: layoutMode, md: md, tid: tid }));
16
15
  };
@@ -111,9 +110,6 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
111
110
  }
112
111
  };
113
112
  export default TMMetadataEditor;
114
- export const MetadataEditorContextMenu = React.memo(({ target, menuItems }) => {
115
- return (_jsx(ContextMenu, { dataSource: menuItems, target: `${target}` }));
116
- });
117
113
  export const useMetadataEditableList = () => {
118
114
  const [editableList, setEditableList] = useState([]);
119
115
  const addOrRemoveEditableList = (mid) => {
@@ -46,7 +46,6 @@ export * from './base/TMTab';
46
46
  export { default as TMHeader } from "./sidebar/TMHeader";
47
47
  export { default as TMSidebar } from "./sidebar/TMSidebar";
48
48
  export { default as TMSidebarItem } from "./sidebar/TMSidebarItem";
49
- export { default as TMSplitterLayout } from "./splitter/TMSplitterLayout";
50
49
  export { default as TMLoginForm } from "./forms/Login/TMLoginForm";
51
50
  export { default as TMChangePassword } from "./forms/Login/ChangePassword";
52
51
  export { default as TMSaveForm } from "./forms/TMSaveForm";
@@ -53,7 +53,6 @@ export * from './base/TMTab';
53
53
  export { default as TMHeader } from "./sidebar/TMHeader";
54
54
  export { default as TMSidebar } from "./sidebar/TMSidebar";
55
55
  export { default as TMSidebarItem } from "./sidebar/TMSidebarItem";
56
- export { default as TMSplitterLayout } from "./splitter/TMSplitterLayout";
57
56
  //form
58
57
  export { default as TMLoginForm } from "./forms/Login/TMLoginForm";
59
58
  export { default as TMChangePassword } from "./forms/Login/ChangePassword";
@@ -107,6 +107,7 @@ export declare class SDKUI_Localizator {
107
107
  static get Error(): "Fehler" | "Error" | "Erreur" | "Erro" | "Errore";
108
108
  static get ErrorParsingFileContent(): "Fehler beim Parsen des Dateiinhalts. Stellen Sie sicher, dass die Datei im richtigen Format vorliegt." | "Error parsing the file content. Ensure the file is in the correct format." | "Error al analizar el contenido del archivo. Asegúrese de que el archivo esté en el formato correcto." | "Erreur lors de l'analyse du contenu du fichier. Assurez-vous que le fichier est dans le bon format." | "Erro ao analisar o conteúdo do arquivo. Certifique-se de que o arquivo está no formato correto." | "Errore durante l'analisi del contenuto del file. Assicurati che il file sia nel formato corretto.";
109
109
  static get EvaluateResult(): "Bewerten Sie das Ergebnis" | "Evaluate result" | "Valorar el resultado" | "Évalue les résultats" | "Avalia os resultados" | "Valuta il risultato";
110
+ static get ExpertMode(): "Expertenmodus" | "Expert mode" | "Modo experto" | "Mode expert" | "Modo especialista" | "Modalità esperto";
110
111
  static get Export(): "Exportieren" | "Export" | "Exportar" | "Exporter" | "Esporta";
111
112
  static get ExportMRN(): "Exportieren MRN" | "Export MRN" | "Exportar MRN" | "Exporter MRN";
112
113
  static get ExportMRNDayBack(): "Anzahl der Tage für die Exportdatenwiederherstellung (MRN)" | "Number of days for export data recovery (MRN)" | "Número de días para la recuperación de datos de exportación (MRN)" | "Nombre de jours pour la récupération des données d'exportation (MRN)" | "Número de dias para recuperação de dados de exportação (MRN)" | "Numero di giorni per il recupero dei dati di Export (MRN)";
@@ -315,6 +316,7 @@ export declare class SDKUI_Localizator {
315
316
  static get SortBy(): "Sortieren nach" | "Sort by" | "Ordenar por" | "Trier par" | "Ordinamento";
316
317
  static get Source(): "Ursprung" | "Source" | "Origen" | "Origem" | "Origine";
317
318
  static get SpecialOperators(): "Spezielle Operatoren" | "Special operators" | "Operadores especiales" | "Opérateurs spéciaux" | "Os operadores especiais" | "Operatori speciali";
319
+ static get StandardMode(): "Standardmodus" | "Standard mode" | "Modo estándar" | "Mode standard" | "Modo padrão" | "Modalità standard";
318
320
  static get Start(): "Zum Booten" | "Start" | "Arrancar" | "Pour démarrer" | "Para inicializar" | "Avviare";
319
321
  static get Statistics(): "Statistiken" | "Statistics" | "Estadística" | "Statistiques" | "Estatísticas" | "Statistiche";
320
322
  static get Summary(): "Zusammenfassung" | "Summary" | "Resumen" | "Résumé" | "Resumo" | "Riepilogo";
@@ -1031,6 +1031,16 @@ export class SDKUI_Localizator {
1031
1031
  default: return "Valuta il risultato";
1032
1032
  }
1033
1033
  }
1034
+ static get ExpertMode() {
1035
+ switch (this._cultureID) {
1036
+ case CultureIDs.De_DE: return "Expertenmodus";
1037
+ case CultureIDs.En_US: return "Expert mode";
1038
+ case CultureIDs.Es_ES: return "Modo experto";
1039
+ case CultureIDs.Fr_FR: return "Mode expert";
1040
+ case CultureIDs.Pt_PT: return "Modo especialista";
1041
+ default: return "Modalità esperto";
1042
+ }
1043
+ }
1034
1044
  static get Export() {
1035
1045
  switch (this._cultureID) {
1036
1046
  case CultureIDs.De_DE: return "Exportieren";
@@ -3108,6 +3118,16 @@ export class SDKUI_Localizator {
3108
3118
  default: return "Operatori speciali";
3109
3119
  }
3110
3120
  }
3121
+ static get StandardMode() {
3122
+ switch (this._cultureID) {
3123
+ case CultureIDs.De_DE: return "Standardmodus";
3124
+ case CultureIDs.En_US: return "Standard mode";
3125
+ case CultureIDs.Es_ES: return "Modo estándar";
3126
+ case CultureIDs.Fr_FR: return "Mode standard";
3127
+ case CultureIDs.Pt_PT: return "Modo padrão";
3128
+ default: return "Modalità standard";
3129
+ }
3130
+ }
3111
3131
  static get Start() {
3112
3132
  switch (this._cultureID) {
3113
3133
  case CultureIDs.De_DE: return "Zum Booten";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.11.111",
3
+ "version": "6.11.112",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- interface ITMSplitterLayoutProps {
3
- vertical?: boolean;
4
- percentage?: boolean;
5
- primaryIndex?: number;
6
- primaryMinSize?: number;
7
- secondaryInitialSize?: number;
8
- secondaryMinSize?: number;
9
- height?: string;
10
- width?: string;
11
- onDragStart?: () => void;
12
- onDragEnd?: () => void;
13
- onSecondaryPaneSizeChange?: (size: number) => void;
14
- children?: React.ReactNode[];
15
- }
16
- declare const TMSplitterLayout: React.FC<ITMSplitterLayoutProps>;
17
- export default TMSplitterLayout;
@@ -1,215 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Questo componente è stato realizzato partendo da :
3
- // https://www.npmjs.com/package/react-splitter-layout
4
- import React, { useState, useEffect, useRef } from 'react';
5
- import styled from 'styled-components';
6
- import { TMColors } from '../../utils/theme';
7
- const clearSelection = () => {
8
- if (window.getSelection) {
9
- const selection = window.getSelection();
10
- if (selection) {
11
- selection.removeAllRanges();
12
- }
13
- // } else if (document.selection) {
14
- // document.selection.empty();
15
- }
16
- };
17
- const DEFAULT_SPLITTER_SIZE = 4;
18
- const StyledPane = styled.div.attrs(({ $isPrimary, $isVertical, $size, $unit }) => ({
19
- style: {
20
- flex: $isPrimary ? '1 1 auto' : '0 0 auto',
21
- height: $isVertical && !$isPrimary ? `${$size}${$unit}` : '',
22
- width: !$isVertical && !$isPrimary ? `${$size}${$unit}` : '',
23
- }
24
- })) `
25
- position: relative;
26
- overflow: auto;
27
- `;
28
- const StyledContainer = styled.div `
29
- position: absolute;
30
- display: flex;
31
- flex-direction: ${(props) => props.$isVertical ? 'column' : 'row'};
32
- width: ${(props) => props.$width ?? '100%'};
33
- height: ${(props) => props.$height ?? '100%'};
34
- overflow: hidden;
35
- ${(props) => props.$isResizing ? `cursor: ${props.$isVertical ? 'row-resize' : 'col-resize'}` : ''};
36
- `;
37
- const StyledSplitter = styled.div `
38
- ${(props) => props.$isVertical ? '' : 'flex: 0 0 auto;'};
39
- width: ${(props) => props.$isVertical ? '100%' : '2px'};
40
- height: ${(props) => props.$isVertical ? '2px' : '100%'};
41
- margin-left: ${(props) => props.$isVertical ? '0' : '2px'};
42
- margin-right: ${(props) => props.$isVertical ? '0' : '2px'};
43
- margin-top: ${(props) => props.$isVertical ? '2px' : '0'};
44
- margin-bottom: ${(props) => props.$isVertical ? '2px' : '0'};
45
- cursor: ${(props) => props.$isVertical ? 'row-resize' : 'col-resize'};
46
- background-color: ${(props) => props.$isResizing ? TMColors.primary : '#ccc'};
47
-
48
- &:hover {
49
- color: ${TMColors.primary};
50
- }
51
- `;
52
- const TMSplitterLayout = ({ vertical = false, percentage = false, primaryIndex = 0, primaryMinSize = 0, secondaryInitialSize, secondaryMinSize = 0, height = "100%", width = "100%", onDragStart, onDragEnd, onSecondaryPaneSizeChange, children = [], }) => {
53
- const [secondaryPaneSize, setSecondaryPaneSize] = useState(0);
54
- const [resizing, setResizing] = useState(false);
55
- const containerRef = useRef(null);
56
- const splitterRef = useRef(null);
57
- const getSecondaryPaneSize = (containerRect, splitterRect, clientPosition, offsetMouse) => {
58
- if (!containerRect || !splitterRect) {
59
- return 0; // Return a default value or handle the case as appropriate
60
- }
61
- let totalSize;
62
- let splitterSize;
63
- let offset;
64
- if (vertical) {
65
- totalSize = containerRect.height;
66
- splitterSize = splitterRect.height;
67
- offset = clientPosition.top - containerRect.top;
68
- }
69
- else {
70
- totalSize = containerRect.width;
71
- splitterSize = splitterRect.width;
72
- offset = clientPosition.left - containerRect.left;
73
- }
74
- if (offsetMouse) {
75
- offset -= splitterSize / 2;
76
- }
77
- if (offset < 0) {
78
- offset = 0;
79
- }
80
- else if (offset > totalSize - splitterSize) {
81
- offset = totalSize - splitterSize;
82
- }
83
- let secondaryPaneSize;
84
- if (primaryIndex === 1) {
85
- secondaryPaneSize = offset;
86
- }
87
- else {
88
- secondaryPaneSize = totalSize - splitterSize - offset;
89
- }
90
- let primaryPaneSize = totalSize - splitterSize - secondaryPaneSize;
91
- if (percentage) {
92
- secondaryPaneSize = (secondaryPaneSize * 100) / totalSize;
93
- primaryPaneSize = (primaryPaneSize * 100) / totalSize;
94
- splitterSize = (splitterSize * 100) / totalSize;
95
- totalSize = 100;
96
- }
97
- let l_primaryMinSize = primaryMinSize;
98
- let l_secondaryMinSize = secondaryMinSize;
99
- if (primaryPaneSize < l_primaryMinSize) {
100
- secondaryPaneSize = Math.max(secondaryPaneSize - (l_primaryMinSize - primaryPaneSize), 0);
101
- }
102
- else if (secondaryPaneSize < l_secondaryMinSize) {
103
- secondaryPaneSize = Math.min(totalSize - splitterSize - l_primaryMinSize, l_secondaryMinSize);
104
- }
105
- return secondaryPaneSize;
106
- };
107
- const handleResize = () => {
108
- if (splitterRef && !percentage) {
109
- const containerRect = containerRef.current?.getBoundingClientRect();
110
- const splitterRect = splitterRef.current?.getBoundingClientRect();
111
- const secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
112
- left: splitterRect?.left,
113
- top: splitterRect?.top
114
- }, false);
115
- setSecondaryPaneSize(secondaryPaneSize);
116
- }
117
- };
118
- const handleMouseMove = (e) => {
119
- if (resizing) {
120
- const containerRect = containerRef.current?.getBoundingClientRect();
121
- const splitterRect = splitterRef.current?.getBoundingClientRect();
122
- const secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
123
- left: e.clientX,
124
- top: e.clientY
125
- }, true);
126
- clearSelection();
127
- setSecondaryPaneSize(secondaryPaneSize);
128
- }
129
- };
130
- const handleTouchMove = (e) => {
131
- handleMouseMove(e.changedTouches[0]);
132
- };
133
- const handleSplitterMouseDown = () => {
134
- clearSelection();
135
- setResizing(true);
136
- };
137
- const handleMouseUp = () => {
138
- setResizing((prevResizing) => (prevResizing ? false : prevResizing));
139
- };
140
- useEffect(() => {
141
- const secondaryPaneSizeCalculation = () => {
142
- if (splitterRef.current && !percentage) {
143
- const containerRect = containerRef.current?.getBoundingClientRect();
144
- const splitterRect = splitterRef.current.getBoundingClientRect();
145
- const newSecondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, { left: splitterRect.left, top: splitterRect.top }, false);
146
- setSecondaryPaneSize(newSecondaryPaneSize);
147
- }
148
- };
149
- window.addEventListener('resize', handleResize);
150
- let initialSecondaryPaneSize;
151
- if (typeof secondaryInitialSize !== 'undefined') {
152
- initialSecondaryPaneSize = secondaryInitialSize;
153
- }
154
- else {
155
- const containerRect = containerRef.current?.getBoundingClientRect();
156
- const splitterRect = splitterRef.current?.getBoundingClientRect() || { width: DEFAULT_SPLITTER_SIZE, height: DEFAULT_SPLITTER_SIZE };
157
- initialSecondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
158
- left: containerRect.left + (containerRect.width - splitterRect.width) / 2,
159
- top: containerRect.top + (containerRect.height - splitterRect.height) / 2,
160
- }, false);
161
- }
162
- setSecondaryPaneSize(initialSecondaryPaneSize);
163
- // Call the calculation function initially
164
- secondaryPaneSizeCalculation();
165
- return () => {
166
- window.removeEventListener('resize', handleResize);
167
- };
168
- }, [secondaryInitialSize, percentage]);
169
- useEffect(() => {
170
- if (secondaryPaneSize !== 0 && onSecondaryPaneSizeChange) {
171
- onSecondaryPaneSizeChange(secondaryPaneSize);
172
- }
173
- if (resizing) {
174
- if (onDragStart) {
175
- onDragStart();
176
- }
177
- }
178
- else if (onDragEnd) {
179
- onDragEnd();
180
- }
181
- }, [secondaryPaneSize, resizing]);
182
- const childrenArray = React.Children.toArray(children).slice(0, 2);
183
- if (childrenArray.length === 0) {
184
- childrenArray.push(_jsx("div", {}));
185
- }
186
- else if (childrenArray.length === 1) {
187
- if (primaryIndex == 0)
188
- childrenArray.push(_jsx("div", {}));
189
- else
190
- childrenArray.unshift(_jsx("div", {}));
191
- }
192
- const thereAreChildrenEmpty = () => {
193
- return childrenArray.length == 2 && (elementIsEmpty(childrenArray[0]) || elementIsEmpty(childrenArray[1]));
194
- };
195
- const elementIsEmpty = (child) => {
196
- return Boolean(Object.keys(child.props).length === 0);
197
- };
198
- const wrappedChildren = childrenArray.map((child, i) => {
199
- let primary = true;
200
- let size = null;
201
- let unit = percentage ? '%' : 'px';
202
- if (childrenArray.length > 1 && i !== primaryIndex) {
203
- primary = false;
204
- size = secondaryPaneSize;
205
- }
206
- if (elementIsEmpty(child)) {
207
- size = 0;
208
- unit = "%";
209
- }
210
- return (_jsx(StyledPane, { "$isPrimary": primary, "$isVertical": vertical, "$size": size || 0, "$unit": percentage ? '%' : 'px', children: child }));
211
- });
212
- return (_jsxs(StyledContainer, { "$isResizing": resizing, "$isVertical": vertical, "$height": height, "$width": width, ref: containerRef, onMouseMove: handleMouseMove, onTouchMove: handleTouchMove, onMouseUp: handleMouseUp, onTouchEnd: handleMouseUp, children: [wrappedChildren[0], !thereAreChildrenEmpty() &&
213
- _jsx(StyledSplitter, { "$isResizing": resizing, "$isVertical": vertical, role: "separator", ref: splitterRef, onMouseDown: handleSplitterMouseDown, onTouchStart: handleSplitterMouseDown }), wrappedChildren.length > 1 && wrappedChildren[1]] }));
214
- };
215
- export default TMSplitterLayout;