datastake-daf 0.6.180 → 0.6.182
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/dist/components/index.js +658 -522
- package/dist/utils/index.js +573 -487
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Globe/index.jsx +20 -1
- package/src/@daf/core/components/Dashboard/Globe/style.js +28 -0
- package/src/@daf/core/components/Dashboard/Tooltip.stories.js +38 -21
- package/src/@daf/core/components/Icon/configs/Ant.js +14 -0
- package/src/@daf/core/components/Icon/configs/Bird.js +14 -0
- package/src/@daf/core/components/Icon/configs/Fish.js +14 -0
- package/src/@daf/core/components/Icon/configs/Leaf.js +13 -13
- package/src/@daf/core/components/Icon/configs/Tree.js +13 -6
- package/src/@daf/core/components/Icon/configs/WaterDrop.js +15 -0
- package/src/@daf/core/components/Icon/configs/index.js +8 -0
- package/src/@daf/core/components/Table/MoreTags/index.jsx +118 -95
- package/src/@daf/utils/tooltip.js +182 -129
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Tag, Tooltip } from "antd";
|
|
2
2
|
import { formatClassname } from "../../helpers/ClassesHelper";
|
|
3
3
|
import CustomIcon from "../core/components/Icon/CustomIcon.jsx";
|
|
4
|
+
export const renderTooltip = ({
|
|
5
|
+
title = "",
|
|
6
|
+
items = [],
|
|
7
|
+
subTitle,
|
|
8
|
+
link,
|
|
9
|
+
fitContent,
|
|
10
|
+
}) => {
|
|
11
|
+
let content = `<div class="daf-tooltip-cont ${
|
|
12
|
+
fitContent ? "fit-content" : ""
|
|
13
|
+
}">`;
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
let content = `<div class="daf-tooltip-cont ${fitContent ? "fit-content" : ""}">`;
|
|
7
|
-
|
|
8
|
-
content += `
|
|
15
|
+
content += `
|
|
9
16
|
<div class="daf-tooltip-head">
|
|
10
17
|
<div class="daf-tooltip-title">
|
|
11
18
|
<div>
|
|
@@ -14,8 +21,8 @@ export const renderTooltip = ({ title = "", items = [], subTitle, link, fitConte
|
|
|
14
21
|
</div>
|
|
15
22
|
</div>
|
|
16
23
|
${
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
link
|
|
25
|
+
? `
|
|
19
26
|
<div class="flex flex-column justify-content-center">
|
|
20
27
|
<a href="${link}" class="link-cont" target="_blank" rel="noopener noreferrer">
|
|
21
28
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 14 14" fill="none">
|
|
@@ -24,144 +31,190 @@ export const renderTooltip = ({ title = "", items = [], subTitle, link, fitConte
|
|
|
24
31
|
</a>
|
|
25
32
|
</div>
|
|
26
33
|
`
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
: ""
|
|
35
|
+
}
|
|
29
36
|
</div>
|
|
30
37
|
`;
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
content += '<div class="daf-tooltip-list">';
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<div class="${formatClassname([
|
|
41
|
+
items.forEach((v) => {
|
|
42
|
+
content += `
|
|
43
|
+
<div class="${formatClassname([
|
|
44
|
+
"daf-tooltip-list-item",
|
|
45
|
+
v.isTotal && "is-total",
|
|
46
|
+
])}">
|
|
37
47
|
${
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
v.color
|
|
49
|
+
? `
|
|
40
50
|
<div class="flex flex-column justify-content-center">
|
|
41
51
|
<span class="daf-tooltip-marker" style="background: ${v.color};"></span>
|
|
42
52
|
</div>
|
|
43
53
|
`
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<span class="daf-tooltip-name" style="${v.labelStyle || ""}">${
|
|
47
|
-
|
|
54
|
+
: ""
|
|
55
|
+
}
|
|
56
|
+
<span class="daf-tooltip-name" style="${v.labelStyle || ""}">${
|
|
57
|
+
v.label
|
|
58
|
+
}</span>
|
|
59
|
+
<span class="daf-tooltip-value" style="${v.valueStyle || ""}">${
|
|
60
|
+
v.value
|
|
61
|
+
}</span>
|
|
48
62
|
</div>
|
|
49
63
|
`;
|
|
50
|
-
|
|
64
|
+
});
|
|
51
65
|
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
content += "</div></div>";
|
|
67
|
+
return content;
|
|
54
68
|
};
|
|
55
69
|
|
|
56
70
|
export const renderTooltipJsx = ({
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
title = "",
|
|
72
|
+
items = [],
|
|
73
|
+
tags,
|
|
74
|
+
subTitle,
|
|
75
|
+
className,
|
|
76
|
+
link,
|
|
77
|
+
onClickLink,
|
|
78
|
+
total,
|
|
64
79
|
}) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
<div className={formatClassname(["daf-tooltip-cont", className])}>
|
|
83
|
+
<div className="daf-tooltip-head">
|
|
84
|
+
<div className="daf-tooltip-title">
|
|
85
|
+
<div>
|
|
86
|
+
<Tooltip title={title}>
|
|
87
|
+
<h4
|
|
88
|
+
className={formatClassname([
|
|
89
|
+
typeof total === "number" && "limited",
|
|
90
|
+
])}
|
|
91
|
+
>
|
|
92
|
+
{title}
|
|
93
|
+
</h4>
|
|
94
|
+
</Tooltip>
|
|
95
|
+
{subTitle ? (
|
|
96
|
+
<h5
|
|
97
|
+
className={formatClassname([
|
|
98
|
+
typeof total === "number" && "limited",
|
|
99
|
+
])}
|
|
100
|
+
>
|
|
101
|
+
{subTitle}
|
|
102
|
+
</h5>
|
|
103
|
+
) : null}
|
|
104
|
+
</div>
|
|
105
|
+
<div style={{ height: "100%" }}>
|
|
106
|
+
{typeof total === "number" ? (
|
|
107
|
+
<div className="daf-tooltip-user-count">
|
|
108
|
+
<div className="flex flex-column justify-content-center">
|
|
109
|
+
<CustomIcon name="UsersCheck" width={13} height={13} />
|
|
110
|
+
</div>
|
|
111
|
+
<div className="flex flex-column justify-content-center">
|
|
112
|
+
<span>{total}</span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
) : null}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
{link ? (
|
|
119
|
+
typeof onClickLink === "function" || typeof link !== "string" ? (
|
|
120
|
+
<div className="flex flex-column">
|
|
121
|
+
<div className="link-cont" onClick={onClickLink}>
|
|
122
|
+
<CustomIcon width={10} height={10} name="Link" />
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
) : (
|
|
126
|
+
<div className="flex flex-column">
|
|
127
|
+
<a
|
|
128
|
+
href={link}
|
|
129
|
+
className="link-cont"
|
|
130
|
+
target="_blank"
|
|
131
|
+
rel="noopener noreferrer"
|
|
132
|
+
>
|
|
133
|
+
<CustomIcon width={10} height={10} name="LinkNewTab" />
|
|
134
|
+
</a>
|
|
135
|
+
</div>
|
|
136
|
+
)
|
|
137
|
+
) : null}
|
|
138
|
+
</div>
|
|
139
|
+
<div className="daf-tooltip-list">
|
|
140
|
+
{items &&
|
|
141
|
+
items.map((item, i) => (
|
|
142
|
+
<div
|
|
143
|
+
key={`tooltip-${i}-item`}
|
|
144
|
+
className={formatClassname([
|
|
145
|
+
"daf-tooltip-list-item",
|
|
146
|
+
item.isTotal && "is-total",
|
|
147
|
+
])}
|
|
148
|
+
>
|
|
149
|
+
{!!item.color && (
|
|
150
|
+
<div className="flex flex-column justify-content-center">
|
|
151
|
+
<span
|
|
152
|
+
className="daf-tooltip-marker"
|
|
153
|
+
style={{ background: item.color }}
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
<Tooltip title={item.label}>
|
|
158
|
+
<span className="daf-tooltip-name">{item.label}</span>
|
|
159
|
+
</Tooltip>
|
|
144
160
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
<Tooltip title={item.value}>
|
|
162
|
+
<div
|
|
163
|
+
style={{
|
|
164
|
+
height: "20px",
|
|
165
|
+
display: "flex",
|
|
166
|
+
alignItems: "center",
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{item.tag ? (
|
|
170
|
+
<Tag color={item.tag} className="mr-none">
|
|
171
|
+
{item.value}
|
|
172
|
+
</Tag>
|
|
173
|
+
) : (
|
|
174
|
+
<span className="daf-tooltip-value">{item.value}</span>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
</Tooltip>
|
|
178
|
+
</div>
|
|
179
|
+
))}
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
{tags && (
|
|
183
|
+
<div
|
|
184
|
+
style={{
|
|
185
|
+
gap: 4,
|
|
186
|
+
display: "flex",
|
|
187
|
+
fontSize: 12,
|
|
188
|
+
flexDirection: "column",
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<Tooltip title={tags.label}>
|
|
192
|
+
<span className="daf-tooltip-name">{tags.label}</span>
|
|
193
|
+
</Tooltip>
|
|
194
|
+
<div
|
|
195
|
+
style={{
|
|
196
|
+
display: "flex",
|
|
197
|
+
gap: 4,
|
|
198
|
+
flexWrap: "wrap",
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
{tags.items.map((item, i) => (
|
|
202
|
+
<Tag
|
|
203
|
+
key={`tooltip-${i}-item`}
|
|
204
|
+
color={item?.color}
|
|
205
|
+
style={{
|
|
206
|
+
margin: 0,
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
<Tooltip title={item.label}>
|
|
210
|
+
<span className="daf-tooltip-name">{item.label}</span>
|
|
211
|
+
</Tooltip>
|
|
212
|
+
</Tag>
|
|
213
|
+
))}
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
)}
|
|
217
|
+
</div>
|
|
218
|
+
</>
|
|
219
|
+
);
|
|
167
220
|
};
|