@topconsultnpm/sdkui-react-beta 6.7.27 → 6.7.28
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.
|
@@ -3,7 +3,7 @@ import { ITMEditorBase } from './TMEditorBase';
|
|
|
3
3
|
export type ButtonColors = 'error' | 'warning' | 'success' | 'info' | 'primary' | 'secondary' | 'tertiary' | 'standard' | 'primaryOutline' | 'secondaryOutline' | 'tertiaryOutline' | 'errorOutline' | 'warningOutline' | 'successOutline' | 'infoOutline';
|
|
4
4
|
export type ButtonStyle = 'normal' | 'toolbar' | 'icon' | 'text' | 'advanced';
|
|
5
5
|
export type AdvancedButtonType = 'success' | 'error' | 'tertiary' | 'primary';
|
|
6
|
-
interface ITMButton extends ITMEditorBase {
|
|
6
|
+
export interface ITMButton extends ITMEditorBase {
|
|
7
7
|
color?: ButtonColors;
|
|
8
8
|
btnStyle?: ButtonStyle;
|
|
9
9
|
advancedType?: AdvancedButtonType;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormModes, ITMSaveFormBaseProps } from '../../ts/types';
|
|
3
|
-
import {
|
|
3
|
+
import { ITMButton } from '../base/TMButton';
|
|
4
4
|
declare const TMSaveForm: React.FC<ITMSaveFormBaseProps>;
|
|
5
5
|
export default TMSaveForm;
|
|
6
|
-
interface ITMSaveFormButtonBase {
|
|
7
|
-
btnStyle: ButtonStyle;
|
|
6
|
+
interface ITMSaveFormButtonBase extends ITMButton {
|
|
8
7
|
iconColor?: string;
|
|
9
8
|
formMode: FormModes;
|
|
10
9
|
isModified: boolean;
|
|
@@ -25,8 +24,8 @@ interface ITMSaveFormButtonSaveProps extends ITMSaveFormButtonBase {
|
|
|
25
24
|
errorsCount: number;
|
|
26
25
|
onSaveAsync?: () => Promise<void>;
|
|
27
26
|
}
|
|
28
|
-
export declare const TMSaveFormButtonSave: ({ btnStyle, errorsCount, isModified, iconColor, onSaveAsync }: ITMSaveFormButtonSaveProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const TMSaveFormButtonSave: ({ btnStyle, errorsCount, isModified, iconColor, width, advancedColor, advancedType, onSaveAsync }: ITMSaveFormButtonSaveProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
28
|
interface ITMSaveFormButtonUndoProps extends ITMSaveFormButtonBase {
|
|
30
29
|
onUndo?: () => void;
|
|
31
30
|
}
|
|
32
|
-
export declare const TMSaveFormButtonUndo: ({ btnStyle, isModified, iconColor, onUndo }: ITMSaveFormButtonUndoProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const TMSaveFormButtonUndo: ({ btnStyle, isModified, iconColor, width, advancedColor, advancedType, onUndo }: ITMSaveFormButtonUndoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -153,15 +153,15 @@ export const TMSaveFormButtonNext = ({ btnStyle, formMode, isModified, onNext, c
|
|
|
153
153
|
};
|
|
154
154
|
return (_jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, { color: iconColor }), disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }));
|
|
155
155
|
};
|
|
156
|
-
export const TMSaveFormButtonSave = ({ btnStyle, errorsCount, isModified, iconColor, onSaveAsync }) => {
|
|
156
|
+
export const TMSaveFormButtonSave = ({ btnStyle, errorsCount, isModified, iconColor, width, advancedColor, advancedType, onSaveAsync }) => {
|
|
157
157
|
const doSaveAsync = async () => { try {
|
|
158
158
|
await onSaveAsync?.();
|
|
159
159
|
}
|
|
160
160
|
catch (ex) {
|
|
161
161
|
TMExceptionBoxManager.show({ exception: ex });
|
|
162
162
|
} };
|
|
163
|
-
return (_jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Save, icon: _jsx(IconSave, { color: iconColor }), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", disabled: !(isModified && errorsCount <= 0) }));
|
|
163
|
+
return (_jsx(TMButton, { btnStyle: btnStyle, width: width, advancedColor: advancedColor, advancedType: advancedType, caption: SDKUI_Localizator.Save, icon: _jsx(IconSave, { color: iconColor }), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", disabled: !(isModified && errorsCount <= 0) }));
|
|
164
164
|
};
|
|
165
|
-
export const TMSaveFormButtonUndo = ({ btnStyle, isModified, iconColor, onUndo }) => {
|
|
166
|
-
return (_jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, { color: iconColor }), keyGesture: "alt+z", color: "tertiary", disabled: !isModified, onClick: onUndo }));
|
|
165
|
+
export const TMSaveFormButtonUndo = ({ btnStyle, isModified, iconColor, width, advancedColor, advancedType, onUndo }) => {
|
|
166
|
+
return (_jsx(TMButton, { btnStyle: btnStyle, width: width, advancedColor: advancedColor, advancedType: advancedType, caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, { color: iconColor }), keyGesture: "alt+z", color: "tertiary", disabled: !isModified, onClick: onUndo }));
|
|
167
167
|
};
|