@topconsultnpm/sdkui-react-beta 6.6.4 → 6.6.6
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/TMButton.d.ts +11 -0
- package/lib/components/base/TMButton.js +41 -2
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/query/TMQueryResultForm.d.ts +0 -11
- package/lib/components/query/TMQueryResultForm.js +1 -39
- package/package.json +1 -1
|
@@ -15,3 +15,14 @@ interface ITMButton extends ITMEditorBase {
|
|
|
15
15
|
}
|
|
16
16
|
declare const TMButton: React.FunctionComponent<ITMButton>;
|
|
17
17
|
export default TMButton;
|
|
18
|
+
export type NewButtonType = 'success' | 'error' | 'tertiary' | 'primary';
|
|
19
|
+
export declare const TMButtonNew: ({ color, caption, disable, onClick, type, icon, width, height }: {
|
|
20
|
+
color?: string;
|
|
21
|
+
width?: string;
|
|
22
|
+
height?: string;
|
|
23
|
+
disable?: boolean;
|
|
24
|
+
caption?: string;
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
type?: NewButtonType;
|
|
27
|
+
icon?: any;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
|
-
import { getColor } from '../../helper';
|
|
4
|
-
import { FontSize } from '../../utils/theme';
|
|
4
|
+
import { getColor, IconApply } from '../../helper';
|
|
5
|
+
import { FontSize, TMColors } from '../../utils/theme';
|
|
5
6
|
import TMTooltip from './TMTooltip';
|
|
6
7
|
const StyledNormalButton = styled.button.withConfig({ shouldForwardProp: prop => !['text'].includes(prop) }) `
|
|
7
8
|
font-size: ${props => props.fontSize};
|
|
@@ -161,3 +162,41 @@ const TMButton = ({ width, height, keyGesture, btnStyle = 'normal', color = 'pri
|
|
|
161
162
|
return (_jsx("div", { style: elementStyle, children: showTooltip ? _jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: renderedButton() }) : renderedButton() }));
|
|
162
163
|
};
|
|
163
164
|
export default TMButton;
|
|
165
|
+
const StyledWorkFlowOperationButton = styled.div `
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: flex-end;
|
|
169
|
+
width: ${props => props.$width};
|
|
170
|
+
height: ${props => props.$height};
|
|
171
|
+
font-weight: bold;
|
|
172
|
+
cursor: ${props => !props.$isDisabled ? 'pointer' : 'default'};
|
|
173
|
+
border-radius: 10px;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
color: white;
|
|
176
|
+
user-select: none;
|
|
177
|
+
`;
|
|
178
|
+
const StyledWorkFlowOperationButtonIcon = styled.div `
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
width: ${props => props.$isHoverred ? '25px' : '0px'};
|
|
183
|
+
transition: width ease-in-out 100ms;
|
|
184
|
+
height: 100%;
|
|
185
|
+
background-color: ${props => props.$isDisabled ? '#b4b4b4' : props.$color ? `${props.$color}90` : props.$type === 'success' ? `${TMColors.success}90` : props.$type === 'error' ? `${TMColors.error}90` : props.$type === 'tertiary' ? `${TMColors.tertiary}90` : `${TMColors.primary}90`};
|
|
186
|
+
border-top-left-radius: 10px;
|
|
187
|
+
border-bottom-left-radius: 10px;
|
|
188
|
+
`;
|
|
189
|
+
const StyledWorkFlowOperationButtonText = styled.div `
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 100%;
|
|
195
|
+
background-color: ${props => props.$isDisabled ? '#d1d1d1' : props.$color ? props.$color : props.$type === 'success' ? `${TMColors.success}` : props.$type === 'error' ? `${TMColors.error}` : props.$type === 'tertiary' ? `${TMColors.tertiary}` : `${TMColors.primary}`};
|
|
196
|
+
border-top-right-radius: 10px;
|
|
197
|
+
border-bottom-right-radius: 10px;
|
|
198
|
+
`;
|
|
199
|
+
export const TMButtonNew = ({ color, caption = '', disable = false, onClick, type = 'primary', icon = _jsx(IconApply, {}), width = '90px', height = '30px' }) => {
|
|
200
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
201
|
+
return (_jsxs(StyledWorkFlowOperationButton, { "$width": width, "$height": height, onMouseOver: () => !disable && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disable, onClick: () => !disable && onClick && onClick(), children: [_jsx(StyledWorkFlowOperationButtonIcon, { "$color": color, "$isHoverred": isHovered, "$isDisabled": disable, "$type": type, children: icon }), _jsxs(StyledWorkFlowOperationButtonText, { "$color": color, "$isDisabled": disable, "$type": type, children: [" ", caption, " "] })] }));
|
|
202
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as ShowAlert } from './base/TMAlert';
|
|
2
|
-
export { default as TMButton } from './base/TMButton';
|
|
2
|
+
export { default as TMButton, TMButtonNew } from './base/TMButton';
|
|
3
3
|
export { default as TMClosableList } from './base/TMClosableList';
|
|
4
4
|
export * from './base/TMContextMenu';
|
|
5
5
|
export { default as TMDropDownMenu } from './base/TMDropDownMenu';
|
package/lib/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// base
|
|
2
2
|
// export { default as TMAbortBox } from './base/TMAbortBox'
|
|
3
3
|
export { default as ShowAlert } from './base/TMAlert';
|
|
4
|
-
export { default as TMButton } from './base/TMButton';
|
|
4
|
+
export { default as TMButton, TMButtonNew } from './base/TMButton';
|
|
5
5
|
export { default as TMClosableList } from './base/TMClosableList';
|
|
6
6
|
export * from './base/TMContextMenu';
|
|
7
7
|
export { default as TMDropDownMenu } from './base/TMDropDownMenu';
|
|
@@ -5,17 +5,6 @@ export declare enum SearchResultContext {
|
|
|
5
5
|
FAVORITES = "favorites",
|
|
6
6
|
RECENT = "recent"
|
|
7
7
|
}
|
|
8
|
-
export type NewButtonType = 'success' | 'error' | 'tertiary' | 'primary';
|
|
9
|
-
export declare const TMButtonNew: ({ color, caption, disable, onClick, type, icon, width, height }: {
|
|
10
|
-
color?: string;
|
|
11
|
-
width?: string;
|
|
12
|
-
height?: string;
|
|
13
|
-
disable?: boolean;
|
|
14
|
-
caption?: string;
|
|
15
|
-
onClick?: () => void;
|
|
16
|
-
type?: NewButtonType;
|
|
17
|
-
icon?: any;
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
8
|
declare const TMQueryResultForm: ({ onUpdate, isModal, onClose, context, result1, result2, elapsedTime, searchText, tabIcon1, tabIcon2, tabTitle1, tabTitle2 }: {
|
|
20
9
|
tabTitle1?: string;
|
|
21
10
|
tabTitle2?: string;
|
|
@@ -8,7 +8,7 @@ import { FormModes } from '../../ts';
|
|
|
8
8
|
import { TMColors } from '../../utils/theme';
|
|
9
9
|
import { StyledBadge } from '../base/Styled';
|
|
10
10
|
import ShowAlert from '../base/TMAlert';
|
|
11
|
-
import TMButton from '../base/TMButton';
|
|
11
|
+
import TMButton, { TMButtonNew } from '../base/TMButton';
|
|
12
12
|
import TMDropDownMenu from '../base/TMDropDownMenu';
|
|
13
13
|
import { TMSplitterLayout, TMLayoutItem } from '../base/TMLayout';
|
|
14
14
|
import TMModal from '../base/TMModal';
|
|
@@ -32,40 +32,6 @@ const StyledWorkFlowOperationButtonsContainer = styled.div `
|
|
|
32
32
|
gap: 15px;
|
|
33
33
|
margin-left: 50px;
|
|
34
34
|
`;
|
|
35
|
-
const StyledWorkFlowOpereationButton = styled.div `
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: flex-end;
|
|
39
|
-
width: ${props => props.$width};
|
|
40
|
-
height: ${props => props.$height};
|
|
41
|
-
font-weight: bold;
|
|
42
|
-
cursor: ${props => !props.$isDisabled ? 'pointer' : 'default'};
|
|
43
|
-
border-radius: 10px;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
color: white;
|
|
46
|
-
user-select: none;
|
|
47
|
-
`;
|
|
48
|
-
const StyledWorkFlowOpereationButtonIcon = styled.div `
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
width: ${props => props.$isHoverred ? '25px' : '0px'};
|
|
53
|
-
transition: width ease-in-out 100ms;
|
|
54
|
-
height: 100%;
|
|
55
|
-
background-color: ${props => props.$isDisabled ? '#b4b4b4' : props.$color ? `${props.$color}90` : props.$type === 'success' ? `${TMColors.success}90` : props.$type === 'error' ? `${TMColors.error}90` : props.$type === 'tertiary' ? `${TMColors.tertiary}90` : `${TMColors.primary}90`};
|
|
56
|
-
border-top-left-radius: 10px;
|
|
57
|
-
border-bottom-left-radius: 10px;
|
|
58
|
-
`;
|
|
59
|
-
const StyledWorkFlowOpereationButtonText = styled.div `
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
justify-content: center;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 100%;
|
|
65
|
-
background-color: ${props => props.$isDisabled ? '#d1d1d1' : props.$color ? props.$color : props.$type === 'success' ? `${TMColors.success}` : props.$type === 'error' ? `${TMColors.error}` : props.$type === 'tertiary' ? `${TMColors.tertiary}` : `${TMColors.primary}`};
|
|
66
|
-
border-top-right-radius: 10px;
|
|
67
|
-
border-bottom-right-radius: 10px;
|
|
68
|
-
`;
|
|
69
35
|
const StyledTextArea = styled.textarea `
|
|
70
36
|
width: 100%;
|
|
71
37
|
height: 100%;
|
|
@@ -81,10 +47,6 @@ const StyledTitleContainer = styled.div ` width: max-content; height: max-conten
|
|
|
81
47
|
const WorfflowListItem = ({ data }) => {
|
|
82
48
|
return (_jsxs("div", { style: { width: '100%', padding: '2px 5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', userSelect: 'none' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] }));
|
|
83
49
|
};
|
|
84
|
-
export const TMButtonNew = ({ color, caption = '', disable = false, onClick, type = 'primary', icon = _jsx(IconApply, {}), width = '90px', height = '30px' }) => {
|
|
85
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
86
|
-
return (_jsxs(StyledWorkFlowOpereationButton, { "$width": width, "$height": height, onMouseOver: () => !disable && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disable, onClick: () => !disable && onClick && onClick(), children: [_jsx(StyledWorkFlowOpereationButtonIcon, { "$color": color, "$isHoverred": isHovered, "$isDisabled": disable, "$type": type, children: icon }), _jsxs(StyledWorkFlowOpereationButtonText, { "$color": color, "$isDisabled": disable, "$type": type, children: [" ", caption, " "] })] }));
|
|
87
|
-
};
|
|
88
50
|
const WorkFlowOperationButtons = ({ onApprove, onReAssign, onReject, approveDisable = false, reassignDisable = false, rejectDisable = false }) => {
|
|
89
51
|
return (_jsxs(StyledWorkFlowOperationButtonsContainer, { children: [_jsx(TMButtonNew, { icon: _jsx(IconApply, {}), caption: 'Approva', disable: approveDisable, onClick: () => !approveDisable && onApprove && onApprove(), type: 'success' }), _jsx(TMButtonNew, { icon: _jsx(IconCloseOutline, {}), caption: 'Rifiuta', disable: rejectDisable, onClick: () => !rejectDisable && onReject && onReject(), type: 'error' }), _jsx(TMButtonNew, { icon: _jsx(IconUser, { fontSize: 16 }), caption: 'Riassegna', disable: reassignDisable, onClick: () => !reassignDisable && onReAssign && onReAssign(), type: 'tertiary' }), _jsx(TMButtonNew, { icon: _jsx(IconInfo, { fontSize: 16 }), caption: 'Maggiori informazioni', width: '180px', disable: approveDisable, onClick: () => alert('TODO!!!'), type: 'primary' })] }));
|
|
90
52
|
};
|