@zjlab-fe/data-hub-ui 0.32.5 → 0.32.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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type TagType = 'running' | 'failed' | 'success' | 'stopped' | '
|
|
3
|
-
type TagVariant = 'filled' | 'bordered' | 'dot';
|
|
4
|
-
|
|
2
|
+
type TagType = 'running' | 'failed' | 'success' | 'stopped' | 'warning' | 'waiting';
|
|
3
|
+
type TagVariant = 'filled' | 'bordered' | 'dot' | 'dotFilled';
|
|
4
|
+
type IProps = {
|
|
5
5
|
type?: TagType;
|
|
6
6
|
variant?: TagVariant;
|
|
7
7
|
className?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
export default function StatusTag(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -2,36 +2,86 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Tag } from 'antd';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import * as index_module from './index.module.scss.js';
|
|
5
|
-
import { statusDot, statusTag
|
|
5
|
+
import { statusDot, statusTag } from './index.module.scss.js';
|
|
6
6
|
|
|
7
|
+
const stoppedFilled = { color: '#545b64', backgroundColor: '#edf2fc' };
|
|
8
|
+
const stoppedDot = { color: 'rgba(0, 0, 0, 0.65)', dotColor: '#d9d9d9' };
|
|
9
|
+
const stoppedBordered = {
|
|
10
|
+
color: 'rgba(0, 0, 0, 0.25)',
|
|
11
|
+
backgroundColor: '#f5f5f5',
|
|
12
|
+
borderColor: '#d9d9d9',
|
|
13
|
+
};
|
|
14
|
+
const waitingDotFilled = {
|
|
15
|
+
color: '#545b64',
|
|
16
|
+
backgroundColor: 'rgba(217, 217, 217, 0.2)',
|
|
17
|
+
borderColor: 'rgba(217, 217, 217, 0.6)',
|
|
18
|
+
dotColor: '#d9d9d9',
|
|
19
|
+
};
|
|
7
20
|
const statusStyles = {
|
|
8
21
|
filled: {
|
|
9
22
|
running: { color: '#1775fe', backgroundColor: 'rgba(23, 117, 254, 0.1)' },
|
|
10
23
|
failed: { color: '#ff4d4f', backgroundColor: 'rgba(255, 77, 79, 0.1)' },
|
|
11
24
|
success: { color: '#52c41a', backgroundColor: 'rgba(82, 196, 26, 0.1)' },
|
|
12
|
-
stopped:
|
|
13
|
-
|
|
25
|
+
stopped: stoppedFilled,
|
|
26
|
+
warning: { color: '#fa8c16', backgroundColor: '#fff7e6' },
|
|
27
|
+
waiting: stoppedFilled,
|
|
14
28
|
},
|
|
15
29
|
dot: {
|
|
16
30
|
running: { color: '#1775fe', dotColor: '#1775fe' },
|
|
17
31
|
failed: { color: '#ff4d4f', dotColor: '#ff4d4f' },
|
|
18
32
|
success: { color: '#52c41a', dotColor: '#52c41a' },
|
|
19
|
-
stopped:
|
|
20
|
-
|
|
33
|
+
stopped: stoppedDot,
|
|
34
|
+
warning: { color: '#fa8c16', dotColor: '#fa8c16' },
|
|
35
|
+
waiting: stoppedDot,
|
|
21
36
|
},
|
|
22
37
|
bordered: {
|
|
23
38
|
running: { color: '#1775fe', backgroundColor: '#ecf4ff', borderColor: '#b3d2ff' },
|
|
24
39
|
failed: { color: '#f5222d', backgroundColor: '#fff1f0', borderColor: '#ffa39e' },
|
|
25
40
|
success: { color: '#52c41a', backgroundColor: '#f6ffed', borderColor: '#b7eb8f' },
|
|
26
|
-
stopped:
|
|
27
|
-
|
|
41
|
+
stopped: stoppedBordered,
|
|
42
|
+
warning: { color: '#fa8c16', backgroundColor: '#fff7e6', borderColor: '#fa8c16' },
|
|
43
|
+
waiting: stoppedBordered,
|
|
44
|
+
},
|
|
45
|
+
dotFilled: {
|
|
46
|
+
running: {
|
|
47
|
+
color: '#545b64',
|
|
48
|
+
backgroundColor: 'rgba(23, 117, 254, 0.1)',
|
|
49
|
+
borderColor: 'rgba(23, 117, 254, 0.1)',
|
|
50
|
+
dotColor: '#1775fe',
|
|
51
|
+
},
|
|
52
|
+
failed: {
|
|
53
|
+
color: '#545b64',
|
|
54
|
+
backgroundColor: 'rgba(255, 77, 79, 0.1)',
|
|
55
|
+
borderColor: 'rgba(255, 77, 79, 0.1)',
|
|
56
|
+
dotColor: '#ff4d4f',
|
|
57
|
+
},
|
|
58
|
+
success: {
|
|
59
|
+
color: '#545b64',
|
|
60
|
+
backgroundColor: 'rgba(82, 196, 26, 0.1)',
|
|
61
|
+
borderColor: 'rgba(82, 196, 26, 0.1)',
|
|
62
|
+
dotColor: '#52c41a',
|
|
63
|
+
},
|
|
64
|
+
stopped: waitingDotFilled,
|
|
65
|
+
warning: {
|
|
66
|
+
color: '#545b64',
|
|
67
|
+
backgroundColor: '#fff7e6',
|
|
68
|
+
borderColor: 'rgba(250, 140, 22, 0.1)',
|
|
69
|
+
dotColor: '#fa8c16',
|
|
70
|
+
},
|
|
71
|
+
waiting: waitingDotFilled,
|
|
28
72
|
},
|
|
29
73
|
};
|
|
30
74
|
function StatusTag(props) {
|
|
31
75
|
const { type = 'running', variant = 'filled', className, children } = props;
|
|
32
76
|
const preset = statusStyles[variant][type];
|
|
33
|
-
|
|
34
|
-
|
|
77
|
+
const hasStatusDot = variant === 'dot' || variant === 'dotFilled';
|
|
78
|
+
if (hasStatusDot) {
|
|
79
|
+
return (jsxs("span", { className: classNames(statusTag, index_module[variant], className), style: variant === 'dotFilled'
|
|
80
|
+
? {
|
|
81
|
+
backgroundColor: preset.backgroundColor,
|
|
82
|
+
borderColor: preset.borderColor,
|
|
83
|
+
}
|
|
84
|
+
: undefined, children: [jsx("span", { className: statusDot, style: { backgroundColor: preset.dotColor } }), jsx("span", { style: { color: preset.color }, children: children })] }));
|
|
35
85
|
}
|
|
36
86
|
return (jsx(Tag, { bordered: variant === 'bordered', className: classNames(statusTag, index_module[variant], className), style: {
|
|
37
87
|
color: preset.color,
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
var style = document.createElement('style');
|
|
2
|
-
style.textContent =
|
|
2
|
+
style.textContent = `@font-face {
|
|
3
|
+
font-family: "AlibabaPuHuiTi-3-55-RegularL3";
|
|
4
|
+
src: url("https://haina-datahub.zero2x.org/ossRoute/frontend/resources/fonts/alibaba_puhuiti_3/AlibabaPuHuiTi-3-55-RegularL3.ttf") format("truetype");
|
|
5
|
+
}
|
|
6
|
+
@font-face {
|
|
7
|
+
font-family: "AlibabaPuHuiTi-3-65-Medium";
|
|
8
|
+
src: url("https://haina-datahub.zero2x.org/ossRoute/frontend/resources/fonts/alibaba_puhuiti_3/AlibabaPuHuiTi-3-65-Medium.ttf") format("truetype");
|
|
9
|
+
}
|
|
10
|
+
.index-module__statusTag___yRGEa {
|
|
3
11
|
display: inline-flex;
|
|
4
12
|
align-items: center;
|
|
5
13
|
margin-inline-end: 0;
|
|
6
14
|
font-family: "AlibabaPuHuiTi-3-55-RegularL3", "PingFang SC", sans-serif;
|
|
7
15
|
white-space: nowrap;
|
|
8
16
|
}
|
|
9
|
-
|
|
10
17
|
.index-module__filled___SKjTo {
|
|
11
18
|
border-radius: 4px;
|
|
12
19
|
padding: 1px 8px;
|
|
13
20
|
font-size: 12px;
|
|
14
21
|
line-height: 16px;
|
|
15
22
|
}
|
|
16
|
-
|
|
17
23
|
.index-module__bordered___x7xGX {
|
|
18
24
|
border-radius: 2px;
|
|
19
25
|
padding: 0 8px;
|
|
@@ -22,7 +28,6 @@ style.textContent = `.index-module__statusTag___yRGEa {
|
|
|
22
28
|
border-width: 1px;
|
|
23
29
|
border-style: solid;
|
|
24
30
|
}
|
|
25
|
-
|
|
26
31
|
.index-module__dot___rbWrB {
|
|
27
32
|
gap: 8px;
|
|
28
33
|
font-size: 14px;
|
|
@@ -30,7 +35,18 @@ style.textContent = `.index-module__statusTag___yRGEa {
|
|
|
30
35
|
padding: 0;
|
|
31
36
|
background: transparent;
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
.index-module__dotFilled___UU7nq {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
gap: 8px;
|
|
41
|
+
height: 30px;
|
|
42
|
+
padding: 4px 16px;
|
|
43
|
+
border: 1px solid;
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
font-family: "AlibabaPuHuiTi-3-65-Medium", "PingFang SC", sans-serif;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
line-height: 22px;
|
|
49
|
+
}
|
|
34
50
|
.index-module__statusDot___yMpG3 {
|
|
35
51
|
flex-shrink: 0;
|
|
36
52
|
width: 6px;
|
|
@@ -39,7 +55,7 @@ style.textContent = `.index-module__statusTag___yRGEa {
|
|
|
39
55
|
}`;
|
|
40
56
|
document.head.appendChild(style);
|
|
41
57
|
|
|
42
|
-
var statusTag = "index-module__statusTag___yRGEa";var filled = "index-module__filled___SKjTo";var bordered = "index-module__bordered___x7xGX";var dot = "index-module__dot___rbWrB";var statusDot = "index-module__statusDot___yMpG3";
|
|
43
|
-
var styles = {"statusTag":"index-module__statusTag___yRGEa","filled":"index-module__filled___SKjTo","bordered":"index-module__bordered___x7xGX","dot":"index-module__dot___rbWrB","statusDot":"index-module__statusDot___yMpG3"};
|
|
58
|
+
var statusTag = "index-module__statusTag___yRGEa";var filled = "index-module__filled___SKjTo";var bordered = "index-module__bordered___x7xGX";var dot = "index-module__dot___rbWrB";var dotFilled = "index-module__dotFilled___UU7nq";var statusDot = "index-module__statusDot___yMpG3";
|
|
59
|
+
var styles = {"statusTag":"index-module__statusTag___yRGEa","filled":"index-module__filled___SKjTo","bordered":"index-module__bordered___x7xGX","dot":"index-module__dot___rbWrB","dotFilled":"index-module__dotFilled___UU7nq","statusDot":"index-module__statusDot___yMpG3"};
|
|
44
60
|
|
|
45
|
-
export { bordered, styles as default, dot, filled, statusDot, statusTag };
|
|
61
|
+
export { bordered, styles as default, dot, dotFilled, filled, statusDot, statusTag };
|