@topconsultnpm/sdkui-react-beta 6.14.88 → 6.14.90

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,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import React, { useState, forwardRef } from 'react';
2
+ import { useState, forwardRef } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { getColor } from '../../helper';
5
5
  import { FontSize, TMColors } from '../../utils/theme';
@@ -167,7 +167,7 @@ const TMButton = forwardRef((props, ref) => {
167
167
  const renderTooltip = () => {
168
168
  return (showTooltip &&
169
169
  _jsxs(_Fragment, { children: [caption &&
170
- _jsxs(StyledButtonTooltipHeader, { "$description": description, children: [btnStyle !== 'icon' && _jsx("div", { children: icon ? React.cloneElement(icon, { color: '#454545' }) : '' }), _jsx(StyledButtonTooltipItem, { "$color": color, children: caption })] }), description && _jsx(StyledButtonTooltipItem, { children: description })] }));
170
+ _jsx(StyledButtonTooltipHeader, { "$description": description, children: _jsx(StyledButtonTooltipItem, { "$color": color, children: caption }) }), description && _jsx(StyledButtonTooltipItem, { children: description })] }));
171
171
  };
172
172
  return (_jsx("div", { style: elementStyle, children: showTooltip ? _jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: renderedButton() }) : renderedButton() }));
173
173
  });
@@ -128,18 +128,12 @@ const TMBlogCommentForm = (props) => {
128
128
  });
129
129
  blogPost.attachments = attachment;
130
130
  }
131
- // Initialize an empty array to hold the result information
132
- let result = [];
133
131
  if (context.engine === 'WorkingGroupEngine' && context.object && context.object.id) {
134
132
  // Create an instance of WorkingGroupEngine to interact with the working group
135
133
  const workingGroupEngine = new WorkingGroupEngine(SDK_Globals.tmSession);
136
134
  // Call the BlogPostAddAsync method to add the blog post to the working group
137
135
  await workingGroupEngine.BlogPostAddAsync(context.object.id, blogPost)
138
136
  .then(() => {
139
- // On success, push a success result to the result array
140
- // result.push({ rowIndex: 1, id1: context.object?.id, id2: 0, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS })
141
- // Show the result to the user
142
- // TMResultManager.show(result, SDKUI_Localizator.Comment, "ID", undefined);
143
137
  refreshCallback();
144
138
  })
145
139
  .catch((e) => {
@@ -157,10 +151,6 @@ const TMBlogCommentForm = (props) => {
157
151
  const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
158
152
  await searchEngine.BlogPostAddAsync(context.object.tid, context.object.did, cleanComment)
159
153
  .then(() => {
160
- // On success, push a success result to the result array
161
- // result.push({ rowIndex: 1, id1: context.object?.tid, id2: context.object?.did, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS })
162
- // Show the result to the user
163
- // TMResultManager.show(result, SDKUI_Localizator.Comment, "ID", undefined);
164
154
  refreshCallback();
165
155
  })
166
156
  .catch((e) => {
@@ -221,7 +211,7 @@ const TMBlogCommentForm = (props) => {
221
211
  // Update the state with selected draft items
222
212
  setCurrentDraftAttachments(selectedDraftItems);
223
213
  };
224
- return _jsx(TMSaveForm, { id: 1, title: SDKUI_Localizator.AddNewComment, showTitleFormMode: false, showErrorCount: false, customSaveButton: _jsx("i", { className: 'dx-icon-send' }), showUndoButton: false, hasNavigation: false, skipIsModifiedCheck: true, isModal: true, width: calcResponsiveSizes(deviceType, '800px', '800px', '95%'), height: '550px', formMode: FormModes.Create, validationItems: validationItems, exception: exception, isModified: calcIsModified(formData, formDataOrig), onSaveAsync: onSaveAsync, onClose: onCloseCallback, customToolbarElements: _jsx("div", { style: { display: 'flex', gap: '2px' }, children: _jsx(TMButton, { btnStyle: "toolbar", icon: isEditorEnabled ? _jsx("i", { className: 'dx-icon-font' }) : _jsx("i", { className: 'dx-icon-background' }), caption: isEditorEnabled ? SDKUI_Localizator.HideFormattingOptions : SDKUI_Localizator.ShowFormattingOptions, onClick: toggleEditorMode }) }), children: _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx("div", { style: { width: "100%", height: showAttachmentsSection ? "calc(100% - 60px)" : "100%" }, children: _jsx(TMHtmlEditor, { width: '100%', height: '100%', isEditorEnabled: isEditorEnabled, validationItems: validationItems, onValueChanged: onValueChanged, mentionsConfig: mentionsConfig, autoFocus: true }) }), showAttachmentsSection && _jsxs("div", { style: { display: 'flex', alignItems: 'center', height: '60px', marginTop: '10px' }, children: [_jsx("div", { style: {
214
+ return _jsx(TMSaveForm, { id: 1, title: SDKUI_Localizator.AddNewComment, showTitleFormMode: false, showErrorCount: false, customSaveButton: _jsx("i", { className: 'dx-icon-send' }), customTooltipSaveButton: SDKUI_Localizator.Send, showUndoButton: false, hasNavigation: false, skipIsModifiedCheck: true, isModal: true, width: calcResponsiveSizes(deviceType, '800px', '800px', '95%'), height: '550px', formMode: FormModes.Create, validationItems: validationItems, exception: exception, isModified: calcIsModified(formData, formDataOrig), onSaveAsync: onSaveAsync, onClose: onCloseCallback, customToolbarElements: _jsx("div", { style: { display: 'flex', gap: '2px' }, children: _jsx(TMButton, { btnStyle: "toolbar", icon: isEditorEnabled ? _jsx("i", { className: 'dx-icon-font' }) : _jsx("i", { className: 'dx-icon-background' }), caption: isEditorEnabled ? SDKUI_Localizator.HideFormattingOptions : SDKUI_Localizator.ShowFormattingOptions, onClick: toggleEditorMode }) }), children: _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx("div", { style: { width: "100%", height: showAttachmentsSection ? "calc(100% - 60px)" : "100%" }, children: _jsx(TMHtmlEditor, { width: '100%', height: '100%', isEditorEnabled: isEditorEnabled, validationItems: validationItems, onValueChanged: onValueChanged, mentionsConfig: mentionsConfig, autoFocus: true }) }), showAttachmentsSection && _jsxs("div", { style: { display: 'flex', alignItems: 'center', height: '60px', marginTop: '10px' }, children: [_jsx("div", { style: {
225
215
  width: 'calc(100% - 60px)',
226
216
  overflowX: 'auto',
227
217
  whiteSpace: 'nowrap',
@@ -11,7 +11,7 @@ import { TMColors } from '../../utils/theme';
11
11
  import TMValidationItemsList from '../grids/TMValidationItemsList';
12
12
  import TMModal from '../base/TMModal';
13
13
  import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
14
- const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showSaveButton = true, customSaveButton, showBackButton, showWarningsCount = true, showErrorCount = true, showUndoButton = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height, askClosingConfirm = false, showTitleFormMode = true }) => {
14
+ const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showSaveButton = true, customSaveButton, customTooltipSaveButton, showBackButton, showWarningsCount = true, showErrorCount = true, showUndoButton = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height, askClosingConfirm = false, showTitleFormMode = true }) => {
15
15
  const [showList, setShowList] = useState(true);
16
16
  const [showErrorGrid, setShowErrorGrid] = useState(false);
17
17
  const deviceType = useDeviceType();
@@ -93,7 +93,7 @@ const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipI
93
93
  const warningsCount = validationItems.filter(o => o.ResultType == ResultTypes.WARNING).length;
94
94
  const errorsCount = validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length;
95
95
  const renderSaveForm = () => {
96
- return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [showToolbar && _jsx(TMLayoutItem, { height: 'max-content', children: _jsxs(StyledToolbarForm, { children: [showBackButton && _jsx(TMButton, { btnStyle: 'toolbar', color: 'tertiary', caption: SDKUI_Localizator.Back, icon: _jsx(IconArrowLeft, {}), elementStyle: { marginRight: '10px' }, onClick: () => { doClose(); } }), showSaveButton && _jsx(TMButton, { caption: SDKUI_Localizator.Save, icon: customSaveButton ?? _jsx(IconSave, {}), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", btnStyle: "toolbar", disabled: !(isModified && errorsCount <= 0) }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Previous, icon: _jsx(IconArrowUp, {}), btnStyle: "toolbar", disabled: !canPrev || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doPrev }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, {}), btnStyle: "toolbar", disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }), showUndoButton && _jsx(TMButton, { caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, {}), keyGesture: "alt+z", color: "tertiary", btnStyle: "toolbar", disabled: isModified ? false : true, onClick: onUndo }), customToolbarElements, Boolean(showWarningsCount && warningsCount > 0) &&
96
+ return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [showToolbar && _jsx(TMLayoutItem, { height: 'max-content', children: _jsxs(StyledToolbarForm, { children: [showBackButton && _jsx(TMButton, { btnStyle: 'toolbar', color: 'tertiary', caption: SDKUI_Localizator.Back, icon: _jsx(IconArrowLeft, {}), elementStyle: { marginRight: '10px' }, onClick: () => { doClose(); } }), showSaveButton && _jsx(TMButton, { caption: customTooltipSaveButton ?? SDKUI_Localizator.Save, icon: customSaveButton ?? _jsx(IconSave, {}), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", btnStyle: "toolbar", disabled: !(isModified && errorsCount <= 0) }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Previous, icon: _jsx(IconArrowUp, {}), btnStyle: "toolbar", disabled: !canPrev || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doPrev }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, {}), btnStyle: "toolbar", disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }), showUndoButton && _jsx(TMButton, { caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, {}), keyGesture: "alt+z", color: "tertiary", btnStyle: "toolbar", disabled: isModified ? false : true, onClick: onUndo }), customToolbarElements, Boolean(showWarningsCount && warningsCount > 0) &&
97
97
  _jsx(TMLayoutItem, { width: 'fit-content', height: '90%', children: _jsxs(StyledResultTypeContainer, { style: { marginLeft: '10px' }, onClick: () => setShowErrorGrid(!showErrorGrid), "$resultType": ResultTypes.WARNING, children: [" ", _jsx(IconWarning, { fontSize: 16 }), " ", _jsx("span", { children: warningsCount })] }) }), Boolean(showErrorCount && errorsCount > 0) &&
98
98
  _jsx(TMLayoutItem, { width: 'fit-content', height: '90%', children: _jsxs(StyledResultTypeContainer, { style: { marginLeft: warningsCount <= 0 ? '10px' : '0' }, onClick: () => setShowErrorGrid(!showErrorGrid), "$resultType": ResultTypes.ERROR, children: [" ", _jsx(IconCloseCircle, { fontSize: 16 }), " ", _jsx("span", { children: errorsCount })] }) }), onShowList &&
99
99
  _jsx("div", { style: { right: '10px', position: 'absolute' }, children: deviceType !== DeviceType.MOBILE && _jsx(TMButton, { caption: showList ? SDKUI_Localizator.List_Hide : SDKUI_Localizator.List_Show, icon: showList ? _jsx(IconHide, {}) : _jsx(IconShow, {}), keyGesture: "alt+h", onClick: () => { setShowList(!showList); onShowList?.(!showList); }, btnStyle: 'toolbar' }) }), (formMode == FormModes.Create || formMode == FormModes.Duplicate) &&
@@ -30,7 +30,7 @@ const TMBlogs = (props) => {
30
30
  isRestoreEnabled: false,
31
31
  isRefreshEnabled: false,
32
32
  isCreateContextualTask: false,
33
- }, refreshCallback, newPosts = [], showCommentFormCallback, showTaskFormCallback, showContextMenu = true, handleAttachmentFocus, showFloatingCommentButton = false, context, layoutMode = 'stacked', markBlogAsRead } = props;
33
+ }, refreshCallback, showCommentFormCallback, showTaskFormCallback, handleAttachmentFocus, showFloatingCommentButton = false, context, layoutMode = 'stacked', markBlogAsRead } = props;
34
34
  // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
35
35
  const deviceType = useDeviceType();
36
36
  const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
@@ -512,7 +512,7 @@ const TMBlogs = (props) => {
512
512
  whiteSpace: "nowrap",
513
513
  }, children: blogPost.newPosts }))] }), _jsxs("div", { style: { fontSize: 'calc(1rem - 1px)', color: isSelected ? "#fff" : !blogPost.isSys ? TMColors.primary : colors.RED }, children: [(showIconHeader) && blogPost.header && blogPost.classID &&
514
514
  _jsxs(_Fragment, { children: [_jsx("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: blogPost.ownerName }), _jsx("span", { style: { margin: "0 5px" }, children: "\u2501" })] }), blogPost.creationTime &&
515
- highlightText(`${SDKUI_Localizator.WrittenOn} ${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? `(${SDKUI_Localizator.Today})` : ''}`, searchText, isSelected), localShowId && _jsxs(_Fragment, { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), blogPost.attachments && showExtendedAttachments === false &&
515
+ highlightText(`${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? `(${SDKUI_Localizator.Today})` : ''}`, searchText, isSelected), localShowId && _jsxs(_Fragment, { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), blogPost.attachments && showExtendedAttachments === false &&
516
516
  _jsx("div", { style: { marginTop: "10px", fontSize: "13px", display: "flex", justifyContent: "flex-end" }, children: _jsx(TMTooltip, { content: `${SDKUI_Localizator.Attachments}: ${blogPost.attachments.length}`, children: _jsx(IconAttachment, { fontSize: 20, color: isSelected ? '#fff' : color }) }) })] }) })] }), _jsx("div", { style: { marginTop: "10px", fontSize: '1rem' }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 &&
517
517
  attachmentDetails(blogPost.attachments, isSelected)] }, id + "-" + blogPost.id));
518
518
  };
@@ -380,6 +380,7 @@ export declare class SDKUI_Localizator {
380
380
  static get Selected(): "Ausgewählt" | "Selected" | "Seleccionados" | "Sélectionné" | "Selecionado" | "Selezionati";
381
381
  static get SelectDesiredFilters(): "Wählen Sie die gewünschten Filter aus" | "Select the desired filters" | "Selecciona los filtros deseados" | "Sélectionnez les filtres souhaités" | "Selecione os filtros desejados" | "Seleziona i filtri desiderati";
382
382
  static get SelectedItems(): "Ausgewählte Artikel" | "Selected items" | "Artículos seleccionados" | "Articles sélectionnés" | "Itens selecionados" | "Elementi selezionati";
383
+ static get Send(): "Senden" | "Send" | "Enviar" | "Envoyer" | "Invia";
383
384
  static get SendLinkByMail(): "Link per E-Mail senden" | "Send link via mail" | "Enviar enlace por correo electrónico" | "Envoyer le lien par email" | "Enviar link por e-mail" | "Invia link tramite mail";
384
385
  static get SendToSupport(): "An den Support senden" | "Send to support" | "Enviar a soporte" | "Envoyer au support" | "Enviar para suporte" | "Invia a supporto";
385
386
  static get SetAsDefault(): "Als Standardbaum festlegen" | "Set as default" | "Establecer como predeterminado" | "Définir par défaut" | "Definir como padrão" | "Imposta come predefinito";
@@ -3758,6 +3758,17 @@ export class SDKUI_Localizator {
3758
3758
  default: return "Elementi selezionati";
3759
3759
  }
3760
3760
  }
3761
+ static get Send() {
3762
+ switch (this._cultureID) {
3763
+ case CultureIDs.De_DE: return "Senden";
3764
+ case CultureIDs.En_US: return "Send";
3765
+ case CultureIDs.Es_ES: return "Enviar";
3766
+ case CultureIDs.Fr_FR: return "Envoyer";
3767
+ case CultureIDs.Pt_PT: return "Enviar";
3768
+ case CultureIDs.It_IT: return "Invia";
3769
+ default: return "Send";
3770
+ }
3771
+ }
3761
3772
  static get SendLinkByMail() {
3762
3773
  switch (this._cultureID) {
3763
3774
  case CultureIDs.De_DE: return "Link per E-Mail senden";
package/lib/ts/types.d.ts CHANGED
@@ -135,6 +135,7 @@ export interface ITMSaveFormBaseProps {
135
135
  signal?: AbortSignal;
136
136
  showSaveButton?: boolean;
137
137
  customSaveButton?: JSX.Element;
138
+ customTooltipSaveButton?: string;
138
139
  showBackButton?: boolean;
139
140
  showUndoButton?: boolean;
140
141
  showWarningsCount?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.14.88",
3
+ "version": "6.14.90",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",