@topconsultnpm/sdkui-react-beta 6.8.53 → 6.8.55
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/TMToolbarCard.d.ts +1 -0
- package/lib/components/base/TMToolbarCard.js +4 -3
- package/lib/components/editors/TMMetadataEditor.js +10 -10
- package/lib/components/viewers/TMMidViewer.d.ts +4 -2
- package/lib/components/viewers/TMMidViewer.js +17 -14
- package/lib/helper/SDKUI_Localizator.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.js +20 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface ITMToolbarCardProps extends ITMRightSidebarProps {
|
|
|
10
10
|
toolbar?: any;
|
|
11
11
|
padding?: string;
|
|
12
12
|
onBack?: () => void;
|
|
13
|
+
onHeaderDoubleClick?: () => void;
|
|
13
14
|
}
|
|
14
15
|
declare const TMToolbarCard: React.FC<ITMToolbarCardProps>;
|
|
15
16
|
export default TMToolbarCard;
|
|
@@ -31,7 +31,7 @@ const StyledSearchCardHeader = styled.div `
|
|
|
31
31
|
`;
|
|
32
32
|
const StyledSearchCardContent = styled.div `
|
|
33
33
|
width: 100%;
|
|
34
|
-
height:
|
|
34
|
+
height: ${props => props.$height};
|
|
35
35
|
overflow: auto;
|
|
36
36
|
background-color: ${props => props.$backgroundColor};
|
|
37
37
|
border-bottom-right-radius: 10px;
|
|
@@ -43,8 +43,9 @@ const StyledSearchCardContent = styled.div `
|
|
|
43
43
|
position: relative;
|
|
44
44
|
user-select: none;
|
|
45
45
|
`;
|
|
46
|
-
const TMToolbarCard = ({ items = [], onItemClick, selectedItem, showPanel, color = TMColors.colorHeader, backgroundColor = TMColors.backgroundColorHeader, children, showHeader = true, title, titleCount, toolbar, padding = '3px', onBack }) => {
|
|
47
|
-
return (_jsxs(StyledSearchCard, { children: [showHeader && _jsx(StyledSearchCardHeader, { "$backgroundColor": backgroundColor, "$color": color,
|
|
46
|
+
const TMToolbarCard = ({ items = [], onItemClick, selectedItem, showPanel, color = TMColors.colorHeader, backgroundColor = TMColors.backgroundColorHeader, children, showHeader = true, title, titleCount, toolbar, padding = '3px', onBack, onHeaderDoubleClick }) => {
|
|
47
|
+
return (_jsxs(StyledSearchCard, { children: [showHeader && _jsx(StyledSearchCardHeader, { "$backgroundColor": backgroundColor, "$color": color, onDoubleClick: () => { if (onHeaderDoubleClick)
|
|
48
|
+
onHeaderDoubleClick(); }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px' }, children: [onBack && _jsx(TMButton, { btnStyle: 'icon', icon: _jsx("div", { style: { backgroundColor: 'white', minWidth: '24px', minHeight: '24px', borderRadius: '24px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx(IconArrowLeft, { color: TMColors.primaryColor }) }), caption: 'Torna indietro', onClick: onBack }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [_jsx("p", { children: title }), titleCount ? _jsx(StyledBadge, { "$backgroundColor": '#679CE8', children: titleCount }) : _jsx(_Fragment, {})] })] }), _jsx("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '5px' }, children: toolbar })] }) }), _jsxs(StyledSearchCardContent, { "$height": showHeader ? "calc(100% - 35px)" : "100%", "$padding": padding, "$backgroundColor": `${TMColors.backgroundColorHeader}12`, children: [_jsx("div", { style: { width: items.length > 0 ? 'calc(100% - 30px)' : '100%' }, children: children }), items.length > 0 &&
|
|
48
49
|
_jsx(TMRightSidebar, { items: items, onItemClick: onItemClick, selectedItem: selectedItem, showPanel: showPanel })] })] }));
|
|
49
50
|
};
|
|
50
51
|
export default TMToolbarCard;
|
|
@@ -39,41 +39,41 @@ const TMMetadataEditor = ({ isLexProt, layoutMode, queryOperator, isModifiedWhen
|
|
|
39
39
|
let btnDistincValues = { text: 'Valori distinti', icon: _jsx(IconLayerGroup, { fontSize: 16 }), onClick: () => { ShowAlert({ message: "TODO Valori distinti", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } };
|
|
40
40
|
let isReadOnlyResult = isReadOnlyInternal();
|
|
41
41
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}" || queryOperator == QueryOperators.Custom)
|
|
42
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
42
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
43
43
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
44
|
-
return _jsx(TMDynDataListItemChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ? [value] : [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
44
|
+
return _jsx(TMDynDataListItemChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ? [value] : [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
45
45
|
if (!IDs || IDs.length <= 0)
|
|
46
46
|
onValueChanged?.(undefined);
|
|
47
47
|
else
|
|
48
48
|
onValueChanged?.(IDs[0]);
|
|
49
49
|
} });
|
|
50
50
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
51
|
-
return _jsx(TMDataListItemChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
51
|
+
return _jsx(TMDataListItemChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
52
52
|
if (!IDs || IDs.length <= 0)
|
|
53
53
|
onValueChanged?.(undefined);
|
|
54
54
|
else
|
|
55
55
|
onValueChanged?.(IDs.join(","));
|
|
56
56
|
} });
|
|
57
57
|
if (md?.dataDomain == MetadataDataDomains.UserID)
|
|
58
|
-
return _jsx(TMUserChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: !isReadOnlyResult, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
58
|
+
return _jsx(TMUserChooser, { readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: !isReadOnlyResult, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, onValueChanged: (IDs) => {
|
|
59
59
|
if (!IDs || IDs.length <= 0)
|
|
60
60
|
onValueChanged?.(undefined);
|
|
61
61
|
else
|
|
62
62
|
onValueChanged?.(IDs.join(","));
|
|
63
63
|
} });
|
|
64
64
|
if (showAsText)
|
|
65
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, maxLength: maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
65
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, maxLength: maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
66
66
|
if (showAsNumber)
|
|
67
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', showClearButton: !isReadOnlyResult, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
67
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', showClearButton: !isReadOnlyResult, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
68
68
|
switch (md?.dataType) {
|
|
69
|
-
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, label: showLabelTop ? md?.nameLoc : undefined, validationItems: validationItems, disabled: disabled, width: '100%', value: value, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
|
|
70
|
-
case MetadataDataTypes.Number: return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
69
|
+
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, label: showLabelTop ? md?.nameLoc : undefined, validationItems: validationItems, disabled: disabled, width: '100%', value: value, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
|
|
70
|
+
case MetadataDataTypes.Number: return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, showClearButton: !isReadOnlyResult, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
71
71
|
default:
|
|
72
72
|
if (showByTextarea) {
|
|
73
|
-
return _jsx(TMTextArea, { rows: 1, readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, isModifiedWhen: isModifiedWhenInternal(), validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, autoFocus: autoFocus, maxLength: maxLength, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); }, resize: false });
|
|
73
|
+
return _jsx(TMTextArea, { rows: 1, readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, isModifiedWhen: isModifiedWhenInternal(), validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, autoFocus: autoFocus, maxLength: maxLength, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); }, resize: false });
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, disabled: disabled, validationItems: validationItems, type: 'text', elementStyle: { width: '100%' }, showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, autoFocus: autoFocus, maxLength: maxLength, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
|
|
76
|
+
return _jsx(TMTextBox, { isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: showLabelTop ? md?.nameLoc : undefined, icon: showLabelTop ? _jsx(TMMetadataIcon, { layoutMode: layoutMode, md: md, tid: tid }) : undefined, disabled: disabled, validationItems: validationItems, type: 'text', elementStyle: { width: '100%' }, showClearButton: !isReadOnlyResult, buttons: !isReadOnlyResult ? [btnDistincValues] : undefined, autoFocus: autoFocus, maxLength: maxLength, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ITopMediaSession, MetadataDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
2
|
+
import { ITopMediaSession, LayoutModes, MetadataDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { TID_MID } from '../../ts';
|
|
4
4
|
import { DataGridTypes } from 'devextreme-react/cjs/data-grid';
|
|
5
5
|
export declare const TMMidViewer: ({ tmSession, tid_mid, showCompleteName, showIcon, showId, noneSelectionText }: {
|
|
@@ -13,12 +13,14 @@ export declare const TMMidViewer: ({ tmSession, tid_mid, showCompleteName, showI
|
|
|
13
13
|
interface ITMMetadataIcon {
|
|
14
14
|
tid: number | undefined;
|
|
15
15
|
md: MetadataDescriptor | undefined;
|
|
16
|
+
layoutMode?: LayoutModes;
|
|
16
17
|
}
|
|
17
|
-
export declare const TMMetadataIcon: ({ tid, md }: ITMMetadataIcon) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export declare const TMMetadataIcon: ({ tid, md, layoutMode }: ITMMetadataIcon) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
19
|
interface ITMMetadataTooltip {
|
|
19
20
|
tid: number | undefined;
|
|
20
21
|
md: MetadataDescriptor | undefined;
|
|
21
22
|
children?: React.ReactNode;
|
|
23
|
+
layoutMode?: LayoutModes;
|
|
22
24
|
}
|
|
23
25
|
export declare const TMMetadataTooltip: React.FC<ITMMetadataTooltip>;
|
|
24
26
|
export declare const cellRenderMID: (data: DataGridTypes.ColumnCellTemplateData, noneSelectionText?: string, tid?: number) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { IconMetadata_Computed, IconMetadata_DataList, IconMetadata_Date, IconMetadata_DynamicDataList, IconMetadata_Numerator, IconMetadata_Numeric, IconMetadata_Special, IconMetadata_Text, IconMetadata_User, LocalizeMetadataFormats, SDKUI_Localizator, getCompleteMetadataName, getTIDByMID } from '../../helper';
|
|
4
|
-
import { DcmtTypeListCacheService, MetadataDataDomains, MetadataDataTypes, MetadataFormats, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
4
|
+
import { DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, MetadataFormats, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
5
5
|
import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipItem, StyledTooltipSeparatorItem } from '../base/Styled';
|
|
6
6
|
import TMTooltip from '../base/TMTooltip';
|
|
7
7
|
import { TMColors } from '../../utils/theme';
|
|
@@ -28,39 +28,41 @@ export const TMMidViewer = ({ tmSession, tid_mid, showCompleteName, showIcon = f
|
|
|
28
28
|
};
|
|
29
29
|
return (_jsxs(StyledDivHorizontal, { children: [showIcon && _jsx(TMMetadataIcon, { tid: tid_mid?.tid, md: md }), _jsx("p", { style: { textAlign: 'left', marginLeft: showIcon ? '5px' : '', color: md?.isRequired == 1 ? 'red' : undefined }, children: displayName() }), showId && _jsx("p", { style: { padding: '0px 3px' }, children: `(MID: ${tid_mid?.mid})` })] }));
|
|
30
30
|
};
|
|
31
|
-
export const TMMetadataIcon = ({ tid, md }) => {
|
|
31
|
+
export const TMMetadataIcon = ({ tid, md, layoutMode = LayoutModes.Update }) => {
|
|
32
32
|
if (!md)
|
|
33
33
|
return null;
|
|
34
|
+
let isNumeratorInArk = md.dataDomain === MetadataDataDomains.Numerator && layoutMode === LayoutModes.Ark;
|
|
35
|
+
let iconColor = md.isRequired === 1 && !isNumeratorInArk ? TMColors.error : TMColors.text_normal;
|
|
34
36
|
let icon = null;
|
|
35
37
|
switch (md.dataDomain) {
|
|
36
38
|
case MetadataDataDomains.Computed:
|
|
37
|
-
icon = _jsx(IconMetadata_Computed, { fontSize: 16, color:
|
|
39
|
+
icon = _jsx(IconMetadata_Computed, { fontSize: 16, color: iconColor });
|
|
38
40
|
break;
|
|
39
41
|
case MetadataDataDomains.DataList:
|
|
40
|
-
icon = _jsx(IconMetadata_DataList, { fontSize: 16, color:
|
|
42
|
+
icon = _jsx(IconMetadata_DataList, { fontSize: 16, color: iconColor });
|
|
41
43
|
break;
|
|
42
44
|
case MetadataDataDomains.DynamicDataList:
|
|
43
|
-
icon = _jsx(IconMetadata_DynamicDataList, { fontSize: 16, color:
|
|
45
|
+
icon = _jsx(IconMetadata_DynamicDataList, { fontSize: 16, color: iconColor });
|
|
44
46
|
break;
|
|
45
47
|
case MetadataDataDomains.Numerator:
|
|
46
|
-
icon = _jsx(IconMetadata_Numerator, { fontSize: 16, color:
|
|
48
|
+
icon = _jsx(IconMetadata_Numerator, { fontSize: 16, color: iconColor });
|
|
47
49
|
break;
|
|
48
50
|
case MetadataDataDomains.Special:
|
|
49
|
-
icon = _jsx(IconMetadata_Special, { fontSize: 16, color:
|
|
51
|
+
icon = _jsx(IconMetadata_Special, { fontSize: 16, color: iconColor });
|
|
50
52
|
break;
|
|
51
53
|
case MetadataDataDomains.UserID:
|
|
52
|
-
icon = _jsx(IconMetadata_User, { fontSize: 16, color:
|
|
54
|
+
icon = _jsx(IconMetadata_User, { fontSize: 16, color: iconColor });
|
|
53
55
|
break;
|
|
54
56
|
default:
|
|
55
57
|
switch (md.dataType) {
|
|
56
58
|
case MetadataDataTypes.Varchar:
|
|
57
|
-
icon = _jsx(IconMetadata_Text, { fontSize: 16, color:
|
|
59
|
+
icon = _jsx(IconMetadata_Text, { fontSize: 16, color: iconColor });
|
|
58
60
|
break;
|
|
59
61
|
case MetadataDataTypes.Number:
|
|
60
|
-
icon = _jsx(IconMetadata_Numeric, { fontSize: 16, color:
|
|
62
|
+
icon = _jsx(IconMetadata_Numeric, { fontSize: 16, color: iconColor });
|
|
61
63
|
break;
|
|
62
64
|
case MetadataDataTypes.DateTime:
|
|
63
|
-
icon = _jsx(IconMetadata_Date, { fontSize: 16, color:
|
|
65
|
+
icon = _jsx(IconMetadata_Date, { fontSize: 16, color: iconColor });
|
|
64
66
|
break;
|
|
65
67
|
default:
|
|
66
68
|
icon = _jsx(_Fragment, {});
|
|
@@ -68,9 +70,9 @@ export const TMMetadataIcon = ({ tid, md }) => {
|
|
|
68
70
|
}
|
|
69
71
|
break;
|
|
70
72
|
}
|
|
71
|
-
return (_jsx(_Fragment, { children: icon ? _jsx(TMMetadataTooltip, { tid: tid, md: md, children: icon }) : null }));
|
|
73
|
+
return (_jsx(_Fragment, { children: icon ? _jsx(TMMetadataTooltip, { tid: tid, md: md, layoutMode: layoutMode, children: icon }) : null }));
|
|
72
74
|
};
|
|
73
|
-
export const TMMetadataTooltip = ({ tid, md, children }) => {
|
|
75
|
+
export const TMMetadataTooltip = ({ tid, md, children, layoutMode = LayoutModes.Update }) => {
|
|
74
76
|
const _setDefaultValueForUI = (defaultValue) => {
|
|
75
77
|
if (!defaultValue)
|
|
76
78
|
return defaultValue;
|
|
@@ -78,9 +80,10 @@ export const TMMetadataTooltip = ({ tid, md, children }) => {
|
|
|
78
80
|
return defaultValue;
|
|
79
81
|
return "=TM_GetViewLink(...)";
|
|
80
82
|
};
|
|
83
|
+
let isNumeratorInArk = md?.dataDomain === MetadataDataDomains.Numerator && layoutMode === LayoutModes.Ark;
|
|
81
84
|
const renderTooltipContent = (tid, md) => {
|
|
82
85
|
return (!md ? null
|
|
83
|
-
: _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? md.nameLoc : md.name} (TID: ${tid}, MID: ${md.id})` }), md.description && _jsx(StyledTooltipItem, { children: md.description }), _jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: [md.dataType, " ", md.dataType == MetadataDataTypes.Varchar ? `(${md.length ?? 0})` : md.dataType == MetadataDataTypes.Number ? `(${md.length ?? 0},${md.scale ?? 0})` : '', md.isPrimaryKey === 1 ? ' (PK)' : ''] }), _jsx(StyledTooltipItem, { style: { color: md.isRequired === 1 ? TMColors.error : TMColors.text_normal }, children: md.isRequired === 1 ? SDKUI_Localizator.Required : SDKUI_Localizator.RequiredNOT }), md.dataDomain && _jsx(StyledTooltipItem, { children: md.dataDomain }), md.isLexProt == 1 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), md.isLexProt == 2 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.MetadataFlag}` }), md.isLexProt == 3 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes} (${SDKUI_Localizator.MetadataFlag})` }), md.isFreeSearchInput && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), md.isSpecialSearchOutput && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Special}: ${SDKUI_Localizator.Yes}` }), md.format?.format && md.format.format != MetadataFormats.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Format}: ${LocalizeMetadataFormats(md.format.format)}` }), md.defaultValue && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Default}: ${_setDefaultValueForUI(md.defaultValue)}` }), md.fromTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.MetadataRoot}: ${md.isRootMID == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), md.templateMID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${md.templateMID}` }), md.perm && _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${md.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${md.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${md.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${md.perm.canUpdate}` })] })] }));
|
|
86
|
+
: _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? md.nameLoc : md.name} (TID: ${tid}, MID: ${md.id})` }), md.description && _jsx(StyledTooltipItem, { children: md.description }), _jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: [md.dataType, " ", md.dataType == MetadataDataTypes.Varchar ? `(${md.length ?? 0})` : md.dataType == MetadataDataTypes.Number ? `(${md.length ?? 0},${md.scale ?? 0})` : '', md.isPrimaryKey === 1 ? ' (PK)' : ''] }), _jsx(StyledTooltipItem, { style: { color: md.isRequired === 1 && !isNumeratorInArk ? TMColors.error : TMColors.text_normal }, children: md.isRequired === 1 && !isNumeratorInArk ? SDKUI_Localizator.Required : SDKUI_Localizator.RequiredNOT }), md.dataDomain && _jsx(StyledTooltipItem, { children: md.dataDomain }), md.isLexProt == 1 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), md.isLexProt == 2 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.MetadataFlag}` }), md.isLexProt == 3 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes} (${SDKUI_Localizator.MetadataFlag})` }), md.isFreeSearchInput && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), md.isSpecialSearchOutput && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Special}: ${SDKUI_Localizator.Yes}` }), md.format?.format && md.format.format != MetadataFormats.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Format}: ${LocalizeMetadataFormats(md.format.format)}` }), md.defaultValue && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Default}: ${_setDefaultValueForUI(md.defaultValue)}` }), md.fromTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.MetadataRoot}: ${md.isRootMID == 1 ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), md.templateMID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${md.templateMID}` }), md.perm && _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${md.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${md.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${md.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${md.perm.canUpdate}` })] })] }));
|
|
84
87
|
};
|
|
85
88
|
return (_jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMTooltip, { content: renderTooltipContent(tid, md), children: children }) }));
|
|
86
89
|
};
|
|
@@ -144,6 +144,7 @@ export declare class SDKUI_Localizator {
|
|
|
144
144
|
static get Next(): "Weiter" | "Next" | "Siguiente" | "Suivant" | "Seguinte" | "Successivo";
|
|
145
145
|
static get No(): "Nein" | "No" | "Non" | "Não";
|
|
146
146
|
static get NoCredentialsSaved(): "Keine gespeicherten Anmeldedaten" | "No credentials saved" | "No se han guardado credenciales" | "Aucune information d'identification enregistrée" | "Nenhuma credencial salva" | "Nessuna credenziale salvata";
|
|
147
|
+
static get NoDcmtFound(): "Kein Dokument gefunden" | "No documents found" | "Ningún documento encontrado" | "Pas de documents trouvés" | "Nenhum documento encontrado" | "Nessun documento trovato";
|
|
147
148
|
static get NoneSelection(): "Keine Auswahl" | "No selection" | "Ninguna selección" | "Pas de sélections" | "Nenhuma seleção" | "Nessuna selezione";
|
|
148
149
|
static get OldPassword(): "Altes Kennwort" | "Old password" | "Contraseña anterior" | "Ancien mot de passe" | "Senha Antiga" | "Password vecchia";
|
|
149
150
|
static get OpenInNewTab(): "In einem neuen Tab öffnen" | "Open in new tab" | "Abrir en una nueva pestaña" | "Ouvrir dans un nouvel onglet" | "Abrir em uma nova aba" | "Apri in un nuovo tab";
|
|
@@ -201,6 +202,7 @@ export declare class SDKUI_Localizator {
|
|
|
201
202
|
static get Search_EnterValue(): "Geben Sie einen Wert ein, nach dem gesucht werden soll" | "Enter a value to search" | "Introducir un valor para buscar" | "Entrez une valeur à rechercher" | "Digite um valor para pesquisar" | "Inserire un valore da ricercare";
|
|
202
203
|
static get Search_Free(): "Kostenlose Suche" | "Free search" | "Búsqueda libre" | "Recherche libre" | "Pesquisa livre" | "Ricerca libera";
|
|
203
204
|
static get Search_Special(): "Spezielle Suchanfragen" | "Special searches" | "Búsquedas especiales" | "Recherches spéciales" | "Pesquisas especiais" | "Ricerche speciali";
|
|
205
|
+
static get SearchResult(): "Suchergebnis" | "Search result" | "Resultado búsqueda" | "Résultat de la recherche" | "Resultados da pesquisa" | "Risultato ricerca";
|
|
204
206
|
static get Seconds(): "Sekunden" | "Seconds" | "Segundos" | "Secondes" | "Segundas" | "Secondi";
|
|
205
207
|
static get Select(): "Wählen Sie Ihre" | "Select" | "Seleccionar" | "Sélectionne" | "Selecione" | "Seleziona";
|
|
206
208
|
static get Selected(): "Ausgewählt" | "Selected" | "Seleccionados" | "Sélectionné" | "Selecionado" | "Selezionati";
|
|
@@ -1392,6 +1392,16 @@ export class SDKUI_Localizator {
|
|
|
1392
1392
|
default: return "Nessuna credenziale salvata";
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
+
static get NoDcmtFound() {
|
|
1396
|
+
switch (this._cultureID) {
|
|
1397
|
+
case CultureIDs.De_DE: return "Kein Dokument gefunden";
|
|
1398
|
+
case CultureIDs.En_US: return "No documents found";
|
|
1399
|
+
case CultureIDs.Es_ES: return "Ningún documento encontrado";
|
|
1400
|
+
case CultureIDs.Fr_FR: return "Pas de documents trouvés";
|
|
1401
|
+
case CultureIDs.Pt_PT: return "Nenhum documento encontrado";
|
|
1402
|
+
default: return "Nessun documento trovato";
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1395
1405
|
static get NoneSelection() {
|
|
1396
1406
|
switch (this._cultureID) {
|
|
1397
1407
|
case CultureIDs.De_DE: return "Keine Auswahl";
|
|
@@ -1969,6 +1979,16 @@ export class SDKUI_Localizator {
|
|
|
1969
1979
|
default: return "Ricerche speciali";
|
|
1970
1980
|
}
|
|
1971
1981
|
}
|
|
1982
|
+
static get SearchResult() {
|
|
1983
|
+
switch (this._cultureID) {
|
|
1984
|
+
case CultureIDs.De_DE: return "Suchergebnis";
|
|
1985
|
+
case CultureIDs.En_US: return "Search result";
|
|
1986
|
+
case CultureIDs.Es_ES: return "Resultado búsqueda";
|
|
1987
|
+
case CultureIDs.Fr_FR: return "Résultat de la recherche";
|
|
1988
|
+
case CultureIDs.Pt_PT: return "Resultados da pesquisa";
|
|
1989
|
+
default: return "Risultato ricerca";
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1972
1992
|
static get Seconds() {
|
|
1973
1993
|
switch (this._cultureID) {
|
|
1974
1994
|
case CultureIDs.De_DE: return "Sekunden";
|