dtable-ui-component 6.0.24 → 6.0.25
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/ActionSheet/index.js +194 -0
- package/lib/ActionSheet/style/index.css +365 -0
- package/lib/ActivityIndicator/index.css +108 -0
- package/lib/ActivityIndicator/index.js +76 -0
- package/lib/Badge/index.css +96 -0
- package/lib/Badge/index.js +65 -0
- package/lib/DateEditor/mb-date-editor-popover/index.js +3 -3
- package/lib/DatePicker/index.js +120 -0
- package/lib/DatePicker/locale/en_US.js +14 -0
- package/lib/DatePicker/locale/ru_RU.js +14 -0
- package/lib/DatePicker/locale/sv_SE.js +14 -0
- package/lib/DatePicker/locale/zh_CN.js +14 -0
- package/lib/DatePicker/style/index.css +290 -0
- package/lib/DatePicker/utils.js +36 -0
- package/lib/Drawer/index.css +142 -0
- package/lib/Drawer/index.js +21 -0
- package/lib/Icon/index.css +50 -0
- package/lib/Icon/index.js +34 -0
- package/lib/Icon/load-sprite.js +56 -0
- package/lib/InputItem/custom-input.js +321 -0
- package/lib/InputItem/custom-keyboard.js +162 -0
- package/lib/InputItem/index.js +388 -0
- package/lib/InputItem/input.js +45 -0
- package/lib/InputItem/locale/en_US.js +12 -0
- package/lib/InputItem/locale/ru_RU.js +12 -0
- package/lib/InputItem/locale/sv_SE.js +12 -0
- package/lib/InputItem/locale/zh_CN.js +12 -0
- package/lib/InputItem/portal.js +23 -0
- package/lib/InputItem/style/index.css +512 -0
- package/lib/List/index.css +381 -0
- package/lib/List/index.js +41 -0
- package/lib/List/list-item.js +169 -0
- package/lib/Modal/alert.js +82 -0
- package/lib/Modal/index.js +15 -0
- package/lib/Modal/modal.js +118 -0
- package/lib/Modal/operation.js +77 -0
- package/lib/Modal/prompt.js +207 -0
- package/lib/Picker/AbstractPicker.js +190 -0
- package/lib/Picker/index.js +28 -0
- package/lib/Picker/locale/en_US.js +12 -0
- package/lib/Picker/locale/ru_RU.js +12 -0
- package/lib/Picker/locale/sv_SE.js +12 -0
- package/lib/Picker/locale/zh_CN.js +12 -0
- package/lib/Picker/popupProps.js +12 -0
- package/lib/Picker/style/index.css +141 -0
- package/lib/Popover/index.js +62 -0
- package/lib/Popover/item.js +55 -0
- package/lib/Popover/style/index.css +229 -0
- package/lib/Progress/index.css +22 -0
- package/lib/Progress/index.js +65 -0
- package/lib/Radio/Radio.js +47 -0
- package/lib/Radio/RadioItem.js +57 -0
- package/lib/Radio/index.css +90 -0
- package/lib/Radio/index.js +12 -0
- package/lib/TabBar/Tab.js +76 -0
- package/lib/TabBar/index.css +138 -0
- package/lib/TabBar/index.js +128 -0
- package/lib/Tabs/index.css +443 -0
- package/lib/Tabs/index.js +38 -0
- package/lib/TextareaItem/index.css +231 -0
- package/lib/TextareaItem/index.js +231 -0
- package/lib/Toast/index.css +65 -0
- package/lib/Toast/index.js +131 -0
- package/lib/_util/class.js +34 -0
- package/lib/_util/closest.js +17 -0
- package/lib/_util/exenv.js +8 -0
- package/lib/_util/getDataAttr.js +15 -0
- package/lib/_util/getLocale.js +42 -0
- package/lib/index.js +106 -1
- package/package.json +12 -3
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
.am-picker-popup {
|
|
2
|
+
left: 0;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
position: fixed;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: #fff;
|
|
7
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.am-picker-popup-wrap {
|
|
11
|
+
position: fixed;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
top: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
-webkit-overflow-scrolling: touch;
|
|
19
|
+
outline: 0;
|
|
20
|
+
-webkit-transform: translateZ(1px);
|
|
21
|
+
transform: translateZ(1px);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.am-picker-popup-mask {
|
|
25
|
+
position: fixed;
|
|
26
|
+
top: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
31
|
+
height: 100%;
|
|
32
|
+
z-index: 1000;
|
|
33
|
+
-webkit-transform: translateZ(1px);
|
|
34
|
+
transform: translateZ(1px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.am-picker-popup-mask-hidden {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.am-picker-popup-header {
|
|
42
|
+
background-image: -webkit-linear-gradient(top, #e7e7e7, #e7e7e7, transparent, transparent);
|
|
43
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e7e7e7), color-stop(#e7e7e7), color-stop(transparent), to(transparent));
|
|
44
|
+
background-image: linear-gradient(to bottom, #e7e7e7, #e7e7e7, transparent, transparent);
|
|
45
|
+
background-position: bottom;
|
|
46
|
+
background-size: 100% 1PX;
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
display: -webkit-box;
|
|
49
|
+
display: -webkit-flex;
|
|
50
|
+
display: -ms-flexbox;
|
|
51
|
+
display: flex;
|
|
52
|
+
-webkit-box-align: center;
|
|
53
|
+
-webkit-align-items: center;
|
|
54
|
+
-ms-flex-align: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
position: relative;
|
|
57
|
+
border-bottom: 1PX solid #ddd;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
61
|
+
html:not([data-scale]) .am-picker-popup-header {
|
|
62
|
+
border-bottom: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
html:not([data-scale]) .am-picker-popup-header::after {
|
|
66
|
+
content: '';
|
|
67
|
+
position: absolute;
|
|
68
|
+
background-color: #ddd;
|
|
69
|
+
display: block;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
top: auto;
|
|
72
|
+
right: auto;
|
|
73
|
+
bottom: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 1PX;
|
|
77
|
+
-webkit-transform-origin: 50% 100%;
|
|
78
|
+
-ms-transform-origin: 50% 100%;
|
|
79
|
+
transform-origin: 50% 100%;
|
|
80
|
+
-webkit-transform: scaleY(0.5);
|
|
81
|
+
-ms-transform: scaleY(0.5);
|
|
82
|
+
transform: scaleY(0.5);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
87
|
+
html:not([data-scale]) .am-picker-popup-header::after {
|
|
88
|
+
-webkit-transform: scaleY(0.33);
|
|
89
|
+
-ms-transform: scaleY(0.33);
|
|
90
|
+
transform: scaleY(0.33);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.am-picker-popup-header .am-picker-popup-header-right {
|
|
95
|
+
text-align: right;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.am-picker-popup-item {
|
|
99
|
+
color: #108ee9;
|
|
100
|
+
font-size: 17px;
|
|
101
|
+
padding: 9px 15px;
|
|
102
|
+
height: 42px;
|
|
103
|
+
-webkit-box-sizing: border-box;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: -webkit-box;
|
|
106
|
+
display: -webkit-flex;
|
|
107
|
+
display: -ms-flexbox;
|
|
108
|
+
display: flex;
|
|
109
|
+
-webkit-box-align: center;
|
|
110
|
+
-webkit-align-items: center;
|
|
111
|
+
-ms-flex-align: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
-webkit-box-pack: center;
|
|
114
|
+
-webkit-justify-content: center;
|
|
115
|
+
-ms-flex-pack: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.am-picker-popup-item-active {
|
|
120
|
+
background-color: #ddd;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.am-picker-popup-title {
|
|
124
|
+
-webkit-box-flex: 1;
|
|
125
|
+
-webkit-flex: 1;
|
|
126
|
+
-ms-flex: 1;
|
|
127
|
+
flex: 1;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: #000;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.am-picker-popup .am-picker-popup-close {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.am-picker-col {
|
|
137
|
+
-webkit-box-flex: 1;
|
|
138
|
+
-webkit-flex: 1;
|
|
139
|
+
-ms-flex: 1;
|
|
140
|
+
flex: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.am-picker-col {
|
|
144
|
+
display: block;
|
|
145
|
+
position: relative;
|
|
146
|
+
height: 238px;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
width: 100%;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.am-picker-col-content {
|
|
152
|
+
position: absolute;
|
|
153
|
+
left: 0;
|
|
154
|
+
top: 0;
|
|
155
|
+
width: 100%;
|
|
156
|
+
z-index: 1;
|
|
157
|
+
padding: 102px 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.am-picker-col-item {
|
|
161
|
+
-ms-touch-action: manipulation;
|
|
162
|
+
touch-action: manipulation;
|
|
163
|
+
text-align: center;
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
height: 34px;
|
|
166
|
+
line-height: 34px;
|
|
167
|
+
color: #000;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
text-overflow: ellipsis;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.am-picker-col-item-selected {
|
|
173
|
+
font-size: 17px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.am-picker-col-mask {
|
|
177
|
+
position: absolute;
|
|
178
|
+
left: 0;
|
|
179
|
+
top: 0;
|
|
180
|
+
height: 100%;
|
|
181
|
+
margin: 0 auto;
|
|
182
|
+
width: 100%;
|
|
183
|
+
z-index: 3;
|
|
184
|
+
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6)), -webkit-linear-gradient(bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
|
|
185
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6))), -webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6)));
|
|
186
|
+
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6)), linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
|
|
187
|
+
background-position: top, bottom;
|
|
188
|
+
background-size: 100% 102px;
|
|
189
|
+
background-repeat: no-repeat;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.am-picker-col-indicator {
|
|
193
|
+
-webkit-box-sizing: border-box;
|
|
194
|
+
box-sizing: border-box;
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 34px;
|
|
197
|
+
position: absolute;
|
|
198
|
+
left: 0;
|
|
199
|
+
top: 102px;
|
|
200
|
+
z-index: 3;
|
|
201
|
+
border-top: 1PX solid #ddd;
|
|
202
|
+
border-bottom: 1PX solid #ddd;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
206
|
+
html:not([data-scale]) .am-picker-col-indicator {
|
|
207
|
+
border-top: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
html:not([data-scale]) .am-picker-col-indicator::before {
|
|
211
|
+
content: '';
|
|
212
|
+
position: absolute;
|
|
213
|
+
background-color: #ddd;
|
|
214
|
+
display: block;
|
|
215
|
+
z-index: 1;
|
|
216
|
+
top: 0;
|
|
217
|
+
right: auto;
|
|
218
|
+
bottom: auto;
|
|
219
|
+
left: 0;
|
|
220
|
+
width: 100%;
|
|
221
|
+
height: 1PX;
|
|
222
|
+
-webkit-transform-origin: 50% 50%;
|
|
223
|
+
-ms-transform-origin: 50% 50%;
|
|
224
|
+
transform-origin: 50% 50%;
|
|
225
|
+
-webkit-transform: scaleY(0.5);
|
|
226
|
+
-ms-transform: scaleY(0.5);
|
|
227
|
+
transform: scaleY(0.5);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
232
|
+
html:not([data-scale]) .am-picker-col-indicator::before {
|
|
233
|
+
-webkit-transform: scaleY(0.33);
|
|
234
|
+
-ms-transform: scaleY(0.33);
|
|
235
|
+
transform: scaleY(0.33);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
240
|
+
html:not([data-scale]) .am-picker-col-indicator {
|
|
241
|
+
border-bottom: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
html:not([data-scale]) .am-picker-col-indicator::after {
|
|
245
|
+
content: '';
|
|
246
|
+
position: absolute;
|
|
247
|
+
background-color: #ddd;
|
|
248
|
+
display: block;
|
|
249
|
+
z-index: 1;
|
|
250
|
+
top: auto;
|
|
251
|
+
right: auto;
|
|
252
|
+
bottom: 0;
|
|
253
|
+
left: 0;
|
|
254
|
+
width: 100%;
|
|
255
|
+
height: 1PX;
|
|
256
|
+
-webkit-transform-origin: 50% 100%;
|
|
257
|
+
-ms-transform-origin: 50% 100%;
|
|
258
|
+
transform-origin: 50% 100%;
|
|
259
|
+
-webkit-transform: scaleY(0.5);
|
|
260
|
+
-ms-transform: scaleY(0.5);
|
|
261
|
+
transform: scaleY(0.5);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
266
|
+
html:not([data-scale]) .am-picker-col-indicator::after {
|
|
267
|
+
-webkit-transform: scaleY(0.33);
|
|
268
|
+
-ms-transform: scaleY(0.33);
|
|
269
|
+
transform: scaleY(0.33);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.am-picker {
|
|
274
|
+
display: -webkit-box;
|
|
275
|
+
display: -webkit-flex;
|
|
276
|
+
display: -ms-flexbox;
|
|
277
|
+
display: flex;
|
|
278
|
+
-webkit-box-align: center;
|
|
279
|
+
-webkit-align-items: center;
|
|
280
|
+
-ms-flex-align: center;
|
|
281
|
+
align-items: center;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.am-picker-item {
|
|
285
|
+
-webkit-box-flex: 1;
|
|
286
|
+
-webkit-flex: 1;
|
|
287
|
+
-ms-flex: 1;
|
|
288
|
+
flex: 1;
|
|
289
|
+
text-align: center;
|
|
290
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatFn = formatFn;
|
|
7
|
+
function formatIt(date, form) {
|
|
8
|
+
const pad = n => n < 10 ? "0".concat(n) : n;
|
|
9
|
+
const dateStr = "".concat(date.getFullYear(), "-").concat(pad(date.getMonth() + 1), "-").concat(pad(date.getDate()));
|
|
10
|
+
const timeStr = "".concat(pad(date.getHours()), ":").concat(pad(date.getMinutes()));
|
|
11
|
+
if (form === 'YYYY-MM-DD') {
|
|
12
|
+
return dateStr;
|
|
13
|
+
}
|
|
14
|
+
if (form === 'HH:mm') {
|
|
15
|
+
return timeStr;
|
|
16
|
+
}
|
|
17
|
+
return "".concat(dateStr, " ").concat(timeStr);
|
|
18
|
+
}
|
|
19
|
+
function formatFn(instance, value) {
|
|
20
|
+
const formatsEnum = {
|
|
21
|
+
date: 'YYYY-MM-DD',
|
|
22
|
+
time: 'HH:mm',
|
|
23
|
+
datetime: 'YYYY-MM-DD HH:mm'
|
|
24
|
+
};
|
|
25
|
+
const {
|
|
26
|
+
format
|
|
27
|
+
} = instance.props;
|
|
28
|
+
const type = typeof format;
|
|
29
|
+
if (type === 'string') {
|
|
30
|
+
return formatIt(value, format);
|
|
31
|
+
}
|
|
32
|
+
if (type === 'function') {
|
|
33
|
+
return format(value);
|
|
34
|
+
}
|
|
35
|
+
return formatIt(value, formatsEnum[instance.props.mode]);
|
|
36
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.am-drawer {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.am-drawer-sidebar {
|
|
11
|
+
z-index: 4;
|
|
12
|
+
position: absolute;
|
|
13
|
+
-webkit-transition: -webkit-transform 0.3s ease-out;
|
|
14
|
+
transition: -webkit-transform 0.3s ease-out;
|
|
15
|
+
transition: transform 0.3s ease-out;
|
|
16
|
+
transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
|
|
17
|
+
will-change: transform;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.am-drawer-draghandle {
|
|
22
|
+
z-index: 1;
|
|
23
|
+
position: absolute;
|
|
24
|
+
background-color: rgba(50, 50, 50, 0.1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.am-drawer-overlay {
|
|
28
|
+
z-index: 3;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
right: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
opacity: 0;
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
-webkit-transition: opacity 0.5s ease-out;
|
|
37
|
+
transition: opacity 0.5s ease-out;
|
|
38
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.am-drawer-content {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
right: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
overflow: auto;
|
|
48
|
+
-webkit-transition: left 0.3s ease-out, right 0.3s ease-out;
|
|
49
|
+
transition: left 0.3s ease-out, right 0.3s ease-out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.am-drawer.am-drawer-left .am-drawer-sidebar,
|
|
53
|
+
.am-drawer.am-drawer-right .am-drawer-sidebar,
|
|
54
|
+
.am-drawer.am-drawer-left .am-drawer-draghandle,
|
|
55
|
+
.am-drawer.am-drawer-right .am-drawer-draghandle {
|
|
56
|
+
top: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.am-drawer.am-drawer-left .am-drawer-draghandle,
|
|
61
|
+
.am-drawer.am-drawer-right .am-drawer-draghandle {
|
|
62
|
+
width: 10px;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.am-drawer.am-drawer-top .am-drawer-sidebar,
|
|
67
|
+
.am-drawer.am-drawer-bottom .am-drawer-sidebar,
|
|
68
|
+
.am-drawer.am-drawer-top .am-drawer-draghandle,
|
|
69
|
+
.am-drawer.am-drawer-bottom .am-drawer-draghandle {
|
|
70
|
+
left: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.am-drawer.am-drawer-top .am-drawer-draghandle,
|
|
75
|
+
.am-drawer.am-drawer-bottom .am-drawer-draghandle {
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 10px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.am-drawer.am-drawer-left .am-drawer-sidebar {
|
|
81
|
+
left: 0;
|
|
82
|
+
-webkit-transform: translateX(-100%);
|
|
83
|
+
-ms-transform: translateX(-100%);
|
|
84
|
+
transform: translateX(-100%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.am-drawer-open.am-drawer.am-drawer-left .am-drawer-sidebar {
|
|
88
|
+
-webkit-box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
89
|
+
box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.am-drawer.am-drawer-left .am-drawer-draghandle {
|
|
93
|
+
left: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.am-drawer.am-drawer-right .am-drawer-sidebar {
|
|
97
|
+
right: 0;
|
|
98
|
+
-webkit-transform: translateX(100%);
|
|
99
|
+
-ms-transform: translateX(100%);
|
|
100
|
+
transform: translateX(100%);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.am-drawer-open.am-drawer.am-drawer-right .am-drawer-sidebar {
|
|
104
|
+
-webkit-box-shadow: -1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
105
|
+
box-shadow: -1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.am-drawer.am-drawer-right .am-drawer-draghandle {
|
|
109
|
+
right: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.am-drawer.am-drawer-top .am-drawer-sidebar {
|
|
113
|
+
top: 0;
|
|
114
|
+
-webkit-transform: translateY(-100%);
|
|
115
|
+
-ms-transform: translateY(-100%);
|
|
116
|
+
transform: translateY(-100%);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.am-drawer-open.am-drawer.am-drawer-top .am-drawer-sidebar {
|
|
120
|
+
-webkit-box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
121
|
+
box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.am-drawer.am-drawer-top .am-drawer-draghandle {
|
|
125
|
+
top: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.am-drawer.am-drawer-bottom .am-drawer-sidebar {
|
|
129
|
+
bottom: 0;
|
|
130
|
+
-webkit-transform: translateY(100%);
|
|
131
|
+
-ms-transform: translateY(100%);
|
|
132
|
+
transform: translateY(100%);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.am-drawer-open.am-drawer.am-drawer-bottom .am-drawer-sidebar {
|
|
136
|
+
-webkit-box-shadow: 1PX -1PX 2px rgba(0, 0, 0, 0.15);
|
|
137
|
+
box-shadow: 1PX -1PX 2px rgba(0, 0, 0, 0.15);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.am-drawer.am-drawer-bottom .am-drawer-draghandle {
|
|
141
|
+
bottom: 0;
|
|
142
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _rmcDrawer = _interopRequireDefault(require("rmc-drawer"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
require("./index.css");
|
|
12
|
+
class Drawer extends React.Component {
|
|
13
|
+
render() {
|
|
14
|
+
return /*#__PURE__*/React.createElement(_rmcDrawer.default, this.props);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Drawer;
|
|
18
|
+
Drawer.defaultProps = {
|
|
19
|
+
prefixCls: 'am-drawer',
|
|
20
|
+
enableDragHandle: false
|
|
21
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.am-icon {
|
|
2
|
+
fill: currentColor;
|
|
3
|
+
background-size: cover;
|
|
4
|
+
width: 22px;
|
|
5
|
+
height: 22px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.am-icon-xxs {
|
|
9
|
+
width: 15px;
|
|
10
|
+
height: 15px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.am-icon-xs {
|
|
14
|
+
width: 18px;
|
|
15
|
+
height: 18px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.am-icon-sm {
|
|
19
|
+
width: 21px;
|
|
20
|
+
height: 21px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.am-icon-md {
|
|
24
|
+
width: 22px;
|
|
25
|
+
height: 22px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.am-icon-lg {
|
|
29
|
+
width: 36px;
|
|
30
|
+
height: 36px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.am-icon-loading {
|
|
34
|
+
-webkit-animation: cirle-anim 1s linear infinite;
|
|
35
|
+
animation: cirle-anim 1s linear infinite;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@-webkit-keyframes cirle-anim {
|
|
39
|
+
100% {
|
|
40
|
+
-webkit-transform: rotate(360deg);
|
|
41
|
+
transform: rotate(360deg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes cirle-anim {
|
|
46
|
+
100% {
|
|
47
|
+
-webkit-transform: rotate(360deg);
|
|
48
|
+
transform: rotate(360deg);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _loadSprite = _interopRequireDefault(require("./load-sprite"));
|
|
12
|
+
class Icon extends React.Component {
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
(0, _loadSprite.default)();
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
const {
|
|
18
|
+
type,
|
|
19
|
+
className,
|
|
20
|
+
size,
|
|
21
|
+
...restProps
|
|
22
|
+
} = this.props;
|
|
23
|
+
const cls = (0, _classnames.default)(className, 'am-icon', "am-icon-".concat(type), "am-icon-".concat(size));
|
|
24
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
25
|
+
className: cls
|
|
26
|
+
}, restProps), /*#__PURE__*/React.createElement("use", {
|
|
27
|
+
xlinkHref: "#".concat(type)
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = Icon;
|
|
32
|
+
Icon.defaultProps = {
|
|
33
|
+
size: 'md'
|
|
34
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/* tslint:disable:max-line-length */
|
|
8
|
+
// inspried by https://github.com/kisenka/svg-sprite-loader/blob/master/runtime/browser-sprite.js
|
|
9
|
+
// Much simplified, do make sure run this after document ready
|
|
10
|
+
const svgSprite = contents => "\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n id=\"__ANTD_MOBILE_SVG_SPRITE_NODE__\"\n style=\"display:none;overflow:hidden;width:0;height:0\"\n >\n <defs>\n ".concat(contents, "\n </defs>\n </svg>\n");
|
|
11
|
+
|
|
12
|
+
// both minified by https://github.com/svg/svgo
|
|
13
|
+
const icons = {
|
|
14
|
+
check: '<svg viewBox="0 0 44 44"><path fill-rule="evenodd" d="M34.538 8L38 11.518 17.808 32 8 22.033l3.462-3.518 6.346 6.45z"/></svg>',
|
|
15
|
+
'check-circle': '<svg viewBox="0 0 48 48"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.1 23.2l-2.2 2.1 10 9.9L38.1 15l-2.2-2-15.2 17.8-7.6-7.6z" fill-rule="evenodd"/></svg>',
|
|
16
|
+
'check-circle-o': '<svg viewBox="0 0 48 48"><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M12.2 23.2L10 25.3l10 9.9L37.2 15 35 13 19.8 30.8z"/></g></svg>',
|
|
17
|
+
cross: '<svg viewBox="0 0 44 44"><path fill-rule="evenodd" d="M24.008 21.852l8.97-8.968L31.092 11l-8.97 8.968L13.157 11l-1.884 1.884 8.968 8.968-9.24 9.24 1.884 1.885 9.24-9.24 9.24 9.24 1.885-1.884-9.24-9.24z"/></svg>',
|
|
18
|
+
'cross-circle': '<svg viewBox="0 0 48 48"><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M24.34 22.22l-7.775-7.775a1.5 1.5 0 1 0-2.12 2.12l7.773 7.775-7.774 7.775a1.5 1.5 0 1 0 2.12 2.12l7.775-7.773 7.774 7.774a1.5 1.5 0 1 0 2.12-2.12L26.46 24.34l7.774-7.774a1.5 1.5 0 1 0-2.12-2.12l-7.776 7.773z"/></g></svg>',
|
|
19
|
+
'cross-circle-o': '<svg viewBox="0 0 48 48"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm.353-25.77l-7.593-7.593c-.797-.8-1.538-.822-2.263-.207-.724.614-.56 1.617-.124 2.067l7.852 7.847-7.72 7.723c-.727.728-.56 1.646-.066 2.177.493.532 1.553.683 2.31-.174l7.588-7.584 7.644 7.623c.796.798 1.608.724 2.21.145.605-.58.72-1.442-.074-2.24l-7.657-7.67 7.545-7.52c.81-.697.9-1.76.297-2.34-.92-.885-1.85-.338-2.264.078l-7.685 7.667z" fill-rule="evenodd"/></svg>',
|
|
20
|
+
// Todo: simplify direction to 2, use css transform
|
|
21
|
+
left: '<svg viewBox="0 0 44 44"><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M16.247 21.4L28.48 9.165l2.12 2.12-10.117 10.12L30.6 31.524l-2.12 2.12-12.233-12.232.007-.006z"/></svg>',
|
|
22
|
+
right: '<svg viewBox="0 0 44 44"><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M30.6 21.4L18.37 9.165l-2.12 2.12 10.117 10.12-10.118 10.118 2.12 2.12 12.234-12.232-.005-.006z"/></svg>',
|
|
23
|
+
down: '<svg viewBox="0 0 44 44"><path d="M22.355 28.237l-11.483-10.9c-.607-.576-1.714-.396-2.48.41l.674-.71c-.763.802-.73 2.07-.282 2.496l11.37 10.793-.04.04 2.088 2.195L23.3 31.52l12.308-11.682c.447-.425.48-1.694-.282-2.496l.674.71c-.766-.806-1.873-.986-2.48-.41L22.355 28.237z" fill-rule="evenodd"/></svg>',
|
|
24
|
+
up: '<svg viewBox="0 0 44 44"><path fill="none" d="M-1-1h46v46H-1z"/><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M23.417 14.23L11.184 26.46l2.12 2.12 10.12-10.117 10.118 10.118 2.12-2.12L23.43 14.228l-.006.005z"/></svg>',
|
|
25
|
+
loading: '<svg viewBox="0 -2 59.75 60.25"><path fill="#ccc" d="M29.69-.527C14.044-.527 1.36 12.158 1.36 27.806S14.043 56.14 29.69 56.14c15.65 0 28.334-12.686 28.334-28.334S45.34-.527 29.69-.527zm.185 53.75c-14.037 0-25.417-11.38-25.417-25.417S15.838 2.39 29.875 2.39s25.417 11.38 25.417 25.417-11.38 25.416-25.417 25.416z"/><path fill="none" stroke="#108ee9" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" d="M56.587 29.766c.37-7.438-1.658-14.7-6.393-19.552"/></svg>',
|
|
26
|
+
search: '<svg viewBox="0 0 44 44"><path d="M32.98 29.255l8.915 8.293L39.603 40l-8.86-8.242a15.952 15.952 0 0 1-10.753 4.147C11.16 35.905 4 28.763 4 19.952 4 11.142 11.16 4 19.99 4s15.99 7.142 15.99 15.952c0 3.472-1.112 6.685-3 9.303zm.05-9.21c0 7.123-5.7 12.918-12.88 12.918-7.176 0-13.015-5.795-13.015-12.918 0-7.12 5.84-12.917 13.017-12.917 7.178 0 12.88 5.797 12.88 12.917z" fill-rule="evenodd"/></svg>',
|
|
27
|
+
ellipsis: '<svg viewBox="0 0 44 44"><circle cx="21.888" cy="22" r="4.045"/><circle cx="5.913" cy="22" r="4.045"/><circle cx="37.863" cy="22" r="4.045"/></svg>',
|
|
28
|
+
'ellipsis-circle': '<svg viewBox="0 0 44 44"><g fill-rule="evenodd"><path d="M22.13.11C10.05.11.255 9.902.255 21.983S10.05 43.86 22.13 43.86s21.875-9.795 21.875-21.876S34.21.11 22.13.11zm0 40.7c-10.396 0-18.825-8.43-18.825-18.826S11.735 3.16 22.13 3.16c10.396 0 18.825 8.428 18.825 18.824S32.525 40.81 22.13 40.81z"/><circle cx="21.888" cy="22.701" r="2.445"/><circle cx="12.23" cy="22.701" r="2.445"/><circle cx="31.546" cy="22.701" r="2.445"/></g></svg>',
|
|
29
|
+
'exclamation-circle': '<svg viewBox="0 0 64 64"><path d="M59.58 40.89L41.193 9.11C39.135 5.382 35.723 3 31.387 3c-3.11 0-6.52 2.382-8.58 6.11L4.42 40.89c-2.788 4.635-3.126 8.81-1.225 12.22C5.015 56.208 7.572 58 13 58h36.773c5.428 0 9.21-1.792 11.03-4.89 1.9-3.41 1.565-7.583-1.224-12.22zm-2.452 11c-.635 1.694-3.802 2.443-7.354 2.443H13c-3.59 0-5.493-.75-6.13-2.444-1.71-2.41-1.374-5.263 0-8.557l18.387-31.777c2.116-3.168 4.394-4.89 6.13-4.89 2.96 0 5.238 1.722 7.354 4.89l18.387 31.777c1.374 3.294 1.713 6.146 0 8.556zm-25.74-33c-.405 0-1.227.835-1.227 2.443v15.89c0 1.608.823 2.444 1.227 2.444 1.628 0 2.452-.836 2.452-2.445v-15.89c0-1.607-.825-2.443-2.453-2.443zm0 23.22c-.405 0-1.227.79-1.227 1.223v2.445c0 .434.823 1.222 1.227 1.222 1.628 0 2.452-.788 2.452-1.222v-2.445c0-.434-.825-1.222-2.453-1.222z" fill-rule="evenodd"/></svg>',
|
|
30
|
+
'info-circle': '<svg viewBox="0 0 44 44"><circle cx="13.828" cy="19.63" r="1.938"/><circle cx="21.767" cy="19.63" r="1.938"/><circle cx="29.767" cy="19.63" r="1.938"/><path d="M22.102 4.16c-9.918 0-17.958 7.147-17.958 15.962 0 4.935 2.522 9.345 6.48 12.273v5.667l.04.012a2.627 2.627 0 1 0 4.5 1.455h.002l5.026-3.54c.628.06 1.265.094 1.91.094 9.92 0 17.96-7.146 17.96-15.96C40.06 11.306 32.02 4.16 22.1 4.16zm-.04 29.902c-.902 0-1.78-.08-2.642-.207l-5.882 4.234c-.024.024-.055.04-.083.06l-.008.005a.51.51 0 0 1-.284.095.525.525 0 0 1-.525-.525l.005-6.375c-3.91-2.516-6.456-6.544-6.456-11.1 0-7.628 7.107-13.812 15.875-13.812s15.875 6.184 15.875 13.812-7.107 13.812-15.875 13.812z"/></svg>',
|
|
31
|
+
'question-circle': '<svg viewBox="0 0 44 44"><g fill-rule="evenodd"><path d="M21.186 3c-10.853 0-19.36 8.506-19.36 19.358C1.827 32.494 10.334 41 21.187 41c10.133 0 18.64-8.506 18.64-18.642C39.827 11.506 31.32 3 21.187 3m15.64 19c0 8.823-7.178 16-16 16s-16-7.177-16-16 7.178-16 16-16 16 7.177 16 16z"/><path d="M22.827 31.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4-15.48c0 .957-.203 1.822-.61 2.593-.427.792-1.117 1.612-2.073 2.457-.867.734-1.453 1.435-1.754 2.096-.302.7-.453 1.693-.453 2.98a.828.828 0 0 1-.823.854.828.828 0 0 1-.584-.22.877.877 0 0 1-.24-.635c0-1.305.168-2.38.506-3.227.336-.883.93-1.682 1.78-2.4 1.01-.883 1.71-1.692 2.1-2.428.336-.645.503-1.38.503-2.21-.02-.935-.3-1.7-.85-2.288-.655-.717-1.62-1.075-2.897-1.075-1.506 0-2.596.535-3.27 1.6-.46.754-.688 1.645-.688 2.677a.92.92 0 0 1-.266.66.747.747 0 0 1-.56.25.73.73 0 0 1-.584-.194c-.16-.164-.24-.393-.24-.69 0-1.82.585-3.272 1.755-4.357C18.645 11.486 19.928 11 21.434 11h.293c1.452 0 2.638.414 3.56 1.24 1.028.903 1.54 2.163 1.54 3.78z"/></g></svg>',
|
|
32
|
+
voice: '<svg viewBox="0 0 38 33"><g fill-rule="evenodd"><path d="M17.838 28.8c-.564-.468-1.192-.983-1.836-1.496-4.244-3.385-5.294-3.67-6.006-3.67-.014 0-.027.005-.04.005-.015 0-.028-.006-.042-.006H3.562c-.734 0-.903-.203-.903-.928v-12.62c0-.49.057-.8.66-.8H9.1c.694 0 1.76-.28 6.4-3.63.83-.596 1.638-1.196 2.337-1.722V28.8zM19.682.19c-.463-.22-1.014-.158-1.417.157-.02.016-1.983 1.552-4.152 3.125C10.34 6.21 9.243 6.664 9.02 6.737H3.676c-.027 0-.053.003-.08.004H1.183c-.608 0-1.1.487-1.1 1.086V25.14c0 .598.492 1.084 1.1 1.084h8.71c.22.08 1.257.55 4.605 3.24 1.947 1.562 3.694 3.088 3.712 3.103.25.22.568.333.89.333.186 0 .373-.038.55-.116.48-.213.79-.684.79-1.204V1.38c0-.506-.294-.968-.758-1.19z" mask="url(#mask-2)"/><path d="M31.42 16.475c0-3.363-1.854-6.297-4.606-7.876-.125-.067-.42-.193-.625-.193-.613 0-1.11.488-1.11 1.09 0 .404.22.764.55.952 2.13 1.19 3.566 3.44 3.566 6.024 0 2.627-1.486 4.913-3.677 6.087-.32.19-.53.54-.53.935 0 .602.495 1.09 1.106 1.09.26.002.568-.15.568-.15 2.835-1.556 4.754-4.538 4.754-7.96" mask="url(#mask-4)"/><path d="M30.14 3.057c-.205-.122-.41-.22-.658-.22-.608 0-1.1.485-1.1 1.084 0 .434.26.78.627.978 4.042 2.323 6.76 6.636 6.76 11.578 0 4.938-2.715 9.248-6.754 11.572-.354.19-.66.55-.66.993 0 .6.494 1.085 1.102 1.085.243 0 .438-.092.65-.213 4.692-2.695 7.848-7.7 7.848-13.435 0-5.723-3.142-10.718-7.817-13.418" mask="url(#mask-6)"/></g></svg>',
|
|
33
|
+
plus: '<svg viewBox="0 0 30 30"><path d="M14 14H0v2h14v14h2V16h14v-2H16V0h-2v14z" fill-rule="evenodd"/></svg>',
|
|
34
|
+
minus: '<svg viewBox="0 0 30 2"><path d="M0 0h30v2H0z" fill-rule="evenodd"/></svg>',
|
|
35
|
+
dislike: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path fill="#FFF" d="M47 22h2v6h-2zm-24 0h2v6h-2z"/><path d="M21 51s4.6-7 15-7 15 7 15 7" stroke="#FFF" stroke-width="2"/></g></svg>',
|
|
36
|
+
fail: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path d="M22 22l28.304 28.304m-28.304 0L50.304 22" stroke="#FFF" stroke-width="2"/></g></svg>',
|
|
37
|
+
success: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path stroke="#FFF" stroke-width="2" d="M19 34.54l11.545 11.923L52.815 24"/></g></svg>'
|
|
38
|
+
};
|
|
39
|
+
const renderSvgSprite = () => {
|
|
40
|
+
const symbols = Object.keys(icons).map(iconName => {
|
|
41
|
+
const svgContent = icons[iconName].split('svg')[1];
|
|
42
|
+
return "<symbol id=".concat(iconName).concat(svgContent, "symbol>");
|
|
43
|
+
}).join('');
|
|
44
|
+
return svgSprite(symbols);
|
|
45
|
+
};
|
|
46
|
+
const loadSprite = () => {
|
|
47
|
+
if (!document) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const existing = document.getElementById('__ANTD_MOBILE_SVG_SPRITE_NODE__');
|
|
51
|
+
const mountNode = document.body;
|
|
52
|
+
if (!existing) {
|
|
53
|
+
mountNode.insertAdjacentHTML('afterbegin', renderSvgSprite());
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var _default = exports.default = loadSprite;
|