diginet-core-ui 1.3.43 → 1.3.44-beta.1
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/assets/images/menu/dhr/MHRP09N0033.svg +12 -0
- package/components/alert/index.js +1 -1
- package/components/avatar/index.js +138 -187
- package/components/button/icon.js +211 -216
- package/components/chart/line/Axis.js +11 -10
- package/components/chart/line/Grid.js +4 -3
- package/components/chart/line/Path.js +11 -10
- package/components/chart/line/Point.js +107 -80
- package/components/chart/line/index.js +36 -17
- package/components/chip/index.js +1 -2
- package/components/form-control/checkbox/index.js +6 -6
- package/components/form-control/date-picker/index.js +131 -119
- package/components/form-control/dropdown/index.js +67 -43
- package/components/form-control/dropdown-box/index.js +1 -1
- package/components/form-control/helper-text/index.js +35 -33
- package/components/form-control/input-base/index.js +318 -317
- package/components/form-control/number-input/index2.js +7 -7
- package/components/form-control/radio/index.js +71 -58
- package/components/form-control/text-input/index.js +4 -4
- package/components/form-control/time-picker/index.js +10 -19
- package/components/modal/modal.js +14 -8
- package/components/paging/page-info.js +78 -41
- package/components/slider/slider-container.js +150 -126
- package/components/slider/slider-item.js +84 -89
- package/components/tree-view/css.js +17 -16
- package/components/tree-view/index.js +41 -23
- package/components/typography/index.js +18 -74
- package/package.json +55 -35
- package/readme.md +12 -0
- package/theme/make-styles.js +12 -1
- package/theme/settings.js +8 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M34.66 9.48L25.43 0.34C25.22 0.12 24.92 0 24.62 0H8.46C6.55 0 5 1.54 5 3.43V35.57C5 37.46 6.55 39 8.46 39H10.31H29.68H31.53C33.44 39 34.99 37.46 34.99 35.57V18.04V16.98V11.42V11.31V10.28C35 9.97 34.87 9.68 34.66 9.48ZM25.77 3.9L31.06 9.14H26.92C26.28 9.14 25.77 8.63 25.77 8V3.9ZM32.69 18.13V35.58C32.69 36.21 32.17 36.72 31.54 36.72H26.38H13.62H8.46C7.82 36.72 7.31 36.21 7.31 35.58V3.43C7.31 2.8 7.83 2.29 8.46 2.29H23.46V8C23.46 9.89 25.01 11.43 26.92 11.43H31.04C31.05 11.43 31.06 11.43 31.07 11.43H32.69V16.99V18.13V18.13Z" fill="#2680EB"/>
|
|
3
|
+
<path d="M30.79 28.13C30.79 27.5 30.27 26.99 29.64 26.99H19.23C18.59 26.99 18.08 27.5 18.08 28.13C18.08 28.76 18.6 29.27 19.23 29.27H29.64C30.27 29.27 30.79 28.76 30.79 28.13Z" fill="#FF8C00"/>
|
|
4
|
+
<path d="M29.64 22.41H19.23C18.59 22.41 18.08 22.92 18.08 23.55C18.08 24.18 18.6 24.69 19.23 24.69H29.64C30.28 24.69 30.79 24.18 30.79 23.55C30.79 22.92 30.27 22.41 29.64 22.41Z" fill="#FF8C00"/>
|
|
5
|
+
<path d="M19.23 31.56C18.59 31.56 18.08 32.07 18.08 32.7C18.08 33.33 18.6 33.84 19.23 33.84H25.02C25.66 33.84 26.17 33.33 26.17 32.7C26.17 32.07 25.65 31.56 25.02 31.56H19.23Z" fill="#FF8C00"/>
|
|
6
|
+
<path d="M10.0601 25.8101H11.2001V23.5701H10.2401V22.8501C10.8601 22.7501 11.1701 22.6401 11.5201 22.4301H12.3901V25.8201H13.3301V26.7601H10.0601V25.8101Z" fill="#FF8C00"/>
|
|
7
|
+
<path d="M14.8801 25.9401C14.8801 25.4501 15.2401 25.0501 15.7801 25.0501C16.3201 25.0501 16.6801 25.4501 16.6801 25.9401C16.6801 26.4301 16.3201 26.8301 15.7801 26.8301C15.2401 26.8301 14.8801 26.4301 14.8801 25.9401Z" fill="#FF8C00"/>
|
|
8
|
+
<path d="M9.91999 33.17C11.09 32.23 11.94 31.5 11.94 30.91C11.94 30.52 11.69 30.34 11.3 30.34C10.98 30.34 10.72 30.55 10.49 30.75L9.85999 30.12C10.34 29.64 10.78 29.42 11.47 29.42C12.41 29.42 13.06 29.98 13.06 30.84C13.06 31.54 12.33 32.3 11.61 32.9C11.85 32.87 12.18 32.85 12.4 32.85H13.28V33.83H9.91999V33.17Z" fill="#FF8C00"/>
|
|
9
|
+
<path d="M14.88 33.03C14.88 32.54 15.24 32.14 15.78 32.14C16.32 32.14 16.68 32.54 16.68 33.03C16.68 33.52 16.32 33.92 15.78 33.92C15.24 33.92 14.88 33.53 14.88 33.03Z" fill="#FF8C00"/>
|
|
10
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.83 6.84C21.71 6.72 21.55 6.65 21.38 6.65H18.64C18.72 6.49 18.76 6.31 18.76 6.13C18.76 5.51 18.26 5 17.65 5H17.64C17.15 5.03 16.68 5.22 16.3 5.54C15.95 5.81 15.63 6.1 15.33 6.41C15.02 6.1 14.7 5.81 14.35 5.54C13.97 5.22 13.5 5.03 13.01 5C12.39 5 11.89 5.5 11.89 6.13C11.89 6.31 11.93 6.49 12.01 6.65H9.27001C8.92001 6.65 8.64001 6.94 8.64001 7.29V8.54C8.64001 8.89 8.92001 9.18 9.27001 9.18H21.38C21.73 9.18 22.01 8.89 22.01 8.54V7.29C22.01 7.12 21.94 6.96 21.83 6.84ZM12.88 6.65C12.86 6.63 12.84 6.61 12.81 6.59C12.72 6.54 12.64 6.47 12.58 6.39C12.54 6.31 12.51 6.22 12.52 6.13C12.52 6 12.57 5.88 12.66 5.78C12.75 5.69 12.88 5.64 13 5.64C13.36 5.67 13.7 5.82 13.98 6.05C14.17 6.2 14.36 6.36 14.53 6.53C14.57 6.56 14.62 6.61 14.66 6.65H12.88ZM18.07 6.39C18.01 6.47 17.93 6.54 17.84 6.59C17.81 6.61 17.79 6.63 17.77 6.65H15.99L16.11 6.53C16.29 6.36 16.47 6.2 16.67 6.06C16.95 5.82 17.29 5.68 17.64 5.64C17.77 5.64 17.9 5.69 17.99 5.79C18.08 5.88 18.13 6 18.13 6.14C18.13 6.22 18.11 6.31 18.07 6.39Z" fill="#FFAA00"/>
|
|
11
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.82001 9.74V15.98C9.83001 16.54 10.27 17 10.82 17H19.83C20.09 17 20.35 16.89 20.53 16.7C20.72 16.51 20.83 16.25 20.83 15.98V9.74H9.82001ZM15.57 15.23V15.71C15.57 15.79 15.51 15.85 15.44 15.85H15.12C15.05 15.85 14.99 15.79 14.99 15.71V15.28C14.71 15.26 14.44 15.21 14.18 15.11C14.06 15.07 14 14.94 14.03 14.81L14.08 14.61C14.1 14.54 14.15 14.48 14.21 14.44C14.28 14.41 14.35 14.41 14.42 14.43C14.65 14.53 14.9 14.57 15.14 14.58C15.48 14.58 15.72 14.44 15.72 14.2C15.72 13.97 15.52 13.82 15.09 13.67C14.45 13.45 14.01 13.15 14.01 12.57C14.03 12 14.46 11.54 15.01 11.49V11.05C15.01 10.97 15.08 10.91 15.15 10.9H15.47C15.54 10.91 15.6 10.97 15.6 11.05V11.45C15.82 11.45 16.03 11.49 16.24 11.56C16.37 11.6 16.44 11.73 16.41 11.86L16.36 12.04C16.35 12.11 16.3 12.17 16.24 12.21C16.18 12.24 16.11 12.25 16.04 12.22C15.85 12.16 15.64 12.12 15.44 12.12C15.05 12.12 14.93 12.29 14.93 12.46C14.93 12.66 15.14 12.79 15.64 12.98C16.35 13.23 16.64 13.57 16.63 14.12C16.61 14.71 16.16 15.19 15.57 15.23Z" fill="#FFAA00"/>
|
|
12
|
+
</svg>
|
|
@@ -10,8 +10,8 @@ import ButtonIcon from '../button/icon';
|
|
|
10
10
|
import Icon from '../../icons';
|
|
11
11
|
import { hexToRGBA } from '../../styles/color-helper';
|
|
12
12
|
import { typography } from '../../styles/typography';
|
|
13
|
-
import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
|
|
14
13
|
import { useTheme } from '../../theme';
|
|
14
|
+
import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
|
|
15
15
|
const {
|
|
16
16
|
heading3,
|
|
17
17
|
heading4,
|
|
@@ -27,59 +27,6 @@ const {
|
|
|
27
27
|
const existed = {},
|
|
28
28
|
urlAvatar = {},
|
|
29
29
|
popupHandler = {};
|
|
30
|
-
|
|
31
|
-
const getDirection = direction => {
|
|
32
|
-
switch (direction) {
|
|
33
|
-
case 'top':
|
|
34
|
-
return {
|
|
35
|
-
anchorOrigin: {
|
|
36
|
-
vertical: 'top',
|
|
37
|
-
horizontal: 'center'
|
|
38
|
-
},
|
|
39
|
-
transformOrigin: {
|
|
40
|
-
vertical: 'bottom',
|
|
41
|
-
horizontal: 'center'
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
case 'left':
|
|
46
|
-
return {
|
|
47
|
-
anchorOrigin: {
|
|
48
|
-
vertical: 'center',
|
|
49
|
-
horizontal: 'left'
|
|
50
|
-
},
|
|
51
|
-
transformOrigin: {
|
|
52
|
-
vertical: 'center',
|
|
53
|
-
horizontal: 'right'
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
case 'right':
|
|
58
|
-
return {
|
|
59
|
-
anchorOrigin: {
|
|
60
|
-
vertical: 'center',
|
|
61
|
-
horizontal: 'right'
|
|
62
|
-
},
|
|
63
|
-
transformOrigin: {
|
|
64
|
-
vertical: 'center',
|
|
65
|
-
horizontal: 'left'
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
default:
|
|
70
|
-
return {
|
|
71
|
-
anchorOrigin: {
|
|
72
|
-
vertical: 'bottom',
|
|
73
|
-
horizontal: 'center'
|
|
74
|
-
},
|
|
75
|
-
transformOrigin: {
|
|
76
|
-
vertical: 'top',
|
|
77
|
-
horizontal: 'center'
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
30
|
const blurKeyframe = keyframes`
|
|
84
31
|
0% { -webkit-filter: blur(4px);}
|
|
85
32
|
25% { -webkit-filter: blur(3px);}
|
|
@@ -109,7 +56,7 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
109
56
|
readOnly,
|
|
110
57
|
disabled,
|
|
111
58
|
lazyLoading,
|
|
112
|
-
|
|
59
|
+
id
|
|
113
60
|
}, reference) => {
|
|
114
61
|
if (!defaultSrc) defaultSrc = AvatarDefault;
|
|
115
62
|
const ref = useRef(null);
|
|
@@ -128,6 +75,14 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
128
75
|
setIsInView(true);
|
|
129
76
|
});
|
|
130
77
|
|
|
78
|
+
const _ActionIconCSS = ActionIconCSS(actionIconWidth);
|
|
79
|
+
|
|
80
|
+
const _AvatarPreviewCSS = AvatarPreviewCSS(readOnly);
|
|
81
|
+
|
|
82
|
+
const _AvatarContainerCSS = AvatarContainerCSS(_AvatarPreviewCSS.name, _ActionIconCSS.name);
|
|
83
|
+
|
|
84
|
+
const _AvatarRootCSS = AvatarRootCSS(width, height, outlined);
|
|
85
|
+
|
|
131
86
|
const _isMobile = isMobile.any();
|
|
132
87
|
|
|
133
88
|
const triggerInput = e => {
|
|
@@ -204,36 +159,31 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
204
159
|
};
|
|
205
160
|
|
|
206
161
|
const renderImage = () => {
|
|
162
|
+
const _image = jsx(Fragment, null, !onLoaded && jsx("img", {
|
|
163
|
+
src: defaultSrc,
|
|
164
|
+
alt: '',
|
|
165
|
+
style: {
|
|
166
|
+
objectFit: 'cover'
|
|
167
|
+
}
|
|
168
|
+
}), jsx("img", {
|
|
169
|
+
css: blurAnimationCSS,
|
|
170
|
+
src: srcState,
|
|
171
|
+
alt: srcState,
|
|
172
|
+
style: {
|
|
173
|
+
objectFit: 'cover'
|
|
174
|
+
},
|
|
175
|
+
onLoad: () => setOnLoaded(true)
|
|
176
|
+
}));
|
|
177
|
+
|
|
207
178
|
if (lazyLoading) {
|
|
208
|
-
return isInView ?
|
|
209
|
-
src:
|
|
210
|
-
alt: '',
|
|
211
|
-
style: {
|
|
212
|
-
objectFit: 'cover'
|
|
213
|
-
}
|
|
214
|
-
}), jsx("img", {
|
|
215
|
-
css: blurAnimation,
|
|
216
|
-
src: srcState || defaultSrc,
|
|
217
|
-
alt: srcState || defaultSrc,
|
|
218
|
-
style: {
|
|
219
|
-
objectFit: 'cover'
|
|
220
|
-
},
|
|
221
|
-
onLoad: () => setOnLoaded(true)
|
|
222
|
-
})) : jsx("img", {
|
|
223
|
-
src: AvatarDefault,
|
|
179
|
+
return isInView ? _image : jsx("img", {
|
|
180
|
+
src: defaultSrc,
|
|
224
181
|
alt: '',
|
|
225
182
|
style: {
|
|
226
183
|
objectFit: 'cover'
|
|
227
184
|
}
|
|
228
185
|
});
|
|
229
|
-
} else return
|
|
230
|
-
css: blurAnimation,
|
|
231
|
-
src: srcState || defaultSrc,
|
|
232
|
-
alt: srcState || defaultSrc,
|
|
233
|
-
style: {
|
|
234
|
-
objectFit: 'cover'
|
|
235
|
-
}
|
|
236
|
-
});
|
|
186
|
+
} else return _image;
|
|
237
187
|
};
|
|
238
188
|
|
|
239
189
|
const showMoreInfo = () => {
|
|
@@ -268,16 +218,19 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
268
218
|
urlAvatar[unique] = src;
|
|
269
219
|
img.src = src;
|
|
270
220
|
img.alt = '';
|
|
271
|
-
setSrcState(src);
|
|
272
|
-
existed[unique] = true;
|
|
273
221
|
|
|
274
222
|
img.onerror = () => {
|
|
275
223
|
setSrcState(null);
|
|
276
224
|
existed[unique] = false;
|
|
277
225
|
};
|
|
226
|
+
|
|
227
|
+
img.onload = () => {
|
|
228
|
+
setSrcState(src);
|
|
229
|
+
existed[unique] = true;
|
|
230
|
+
};
|
|
278
231
|
}
|
|
279
232
|
}
|
|
280
|
-
}, [src
|
|
233
|
+
}, [src]);
|
|
281
234
|
useImperativeHandle(reference, () => {
|
|
282
235
|
const currentRef = ref.current || {};
|
|
283
236
|
const _instance = {}; // methods
|
|
@@ -287,89 +240,87 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
287
240
|
currentRef.instance = _instance;
|
|
288
241
|
return currentRef;
|
|
289
242
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}), [maxSizeError]);
|
|
367
|
-
return jsx(Fragment, null, AvatarView, ModalView, hoverAble && MoreInfoView, !disabled && !readOnly && PopupView);
|
|
243
|
+
return useMemo(() => {
|
|
244
|
+
return jsx(Fragment, null, jsx("div", {
|
|
245
|
+
css: _AvatarContainerCSS,
|
|
246
|
+
ref: ref,
|
|
247
|
+
id: unique,
|
|
248
|
+
className: disabled ? 'disabled' : ''
|
|
249
|
+
}, jsx("div", {
|
|
250
|
+
css: _AvatarRootCSS,
|
|
251
|
+
className: ['DGN-UI-Avatar', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
252
|
+
id: id
|
|
253
|
+
}, jsx("input", {
|
|
254
|
+
ref: inputRef,
|
|
255
|
+
type: "file",
|
|
256
|
+
title: '',
|
|
257
|
+
accept: 'image/*',
|
|
258
|
+
onChange: onChangeAvatar
|
|
259
|
+
}), jsx("div", {
|
|
260
|
+
css: _AvatarPreviewCSS,
|
|
261
|
+
onClick: _onClick,
|
|
262
|
+
ref: avatarRef,
|
|
263
|
+
onMouseEnter: _onMouseEnter,
|
|
264
|
+
onMouseLeave: _onMouseLeave,
|
|
265
|
+
tabIndex: "-1",
|
|
266
|
+
onBlur: closeMoreInfo
|
|
267
|
+
}, renderImage())), !readOnly && !disabled && jsx("span", {
|
|
268
|
+
css: _ActionIconCSS
|
|
269
|
+
}, jsx(ButtonIcon, {
|
|
270
|
+
viewType: 'ghost',
|
|
271
|
+
name: 'Edit',
|
|
272
|
+
width: actionIconWidth,
|
|
273
|
+
height: actionIconHeight,
|
|
274
|
+
className: 'icon-edit',
|
|
275
|
+
onClick: triggerInput
|
|
276
|
+
}), clearAble && srcState && jsx(ButtonIcon, {
|
|
277
|
+
viewType: 'ghost',
|
|
278
|
+
name: 'Delete',
|
|
279
|
+
width: actionIconWidth,
|
|
280
|
+
height: actionIconHeight,
|
|
281
|
+
className: 'icon-delete',
|
|
282
|
+
onClick: onRemoveAvatar,
|
|
283
|
+
style: {
|
|
284
|
+
marginTop: '8px'
|
|
285
|
+
}
|
|
286
|
+
}))), jsx(ModalSample, {
|
|
287
|
+
open: viewAvatar,
|
|
288
|
+
onClose: () => setViewAvatar(false),
|
|
289
|
+
width: 'max-content'
|
|
290
|
+
}, jsx("img", {
|
|
291
|
+
src: urlAvatar[unique],
|
|
292
|
+
alt: "",
|
|
293
|
+
style: {
|
|
294
|
+
objectFit: 'cover',
|
|
295
|
+
maxHeight: '100%',
|
|
296
|
+
maxWidth: '100%',
|
|
297
|
+
margin: 'auto',
|
|
298
|
+
display: 'block'
|
|
299
|
+
}
|
|
300
|
+
})), hoverAble && jsx(Popover, {
|
|
301
|
+
arrow: true,
|
|
302
|
+
open: viewMoreInfo,
|
|
303
|
+
pressESCToClose: false,
|
|
304
|
+
bgColor: fillTooltip,
|
|
305
|
+
anchor: avatarRef,
|
|
306
|
+
fullScreen: false,
|
|
307
|
+
width: 'max-content',
|
|
308
|
+
direction: direction
|
|
309
|
+
}, jsx("div", {
|
|
310
|
+
css: MoreInfoCSS
|
|
311
|
+
}, typeof data === 'function' ? data() : renderData())), !disabled && !readOnly && jsx(Popup, {
|
|
312
|
+
getPopup: func => popupHandler[unique] = func,
|
|
313
|
+
type: 'info',
|
|
314
|
+
title: maxSizeError,
|
|
315
|
+
icon: 'danger',
|
|
316
|
+
fullScreen: true
|
|
317
|
+
}));
|
|
318
|
+
}, [width, height, readOnly, disabled, clearAble, maxSize, matchType, hoverAble, outlined, actionIconWidth, actionIconHeight, lazyLoading, defaultSrc, direction, data, maxSizeError, srcState, isInView, onLoaded, viewAvatar, viewMoreInfo]);
|
|
368
319
|
}));
|
|
369
320
|
|
|
370
|
-
const
|
|
371
|
-
${flexCol}
|
|
372
|
-
${positionAbsolute}
|
|
321
|
+
const ActionIconCSS = actionIconWidth => css`
|
|
322
|
+
${flexCol};
|
|
323
|
+
${positionAbsolute};
|
|
373
324
|
right: ${-actionIconWidth}px;
|
|
374
325
|
min-width: ${actionIconWidth}px;
|
|
375
326
|
transition: opacity 0.5s;
|
|
@@ -377,48 +328,48 @@ const ActionIcon = actionIconWidth => css`
|
|
|
377
328
|
z-index: 9002;
|
|
378
329
|
`;
|
|
379
330
|
|
|
380
|
-
const
|
|
381
|
-
${displayBlock}
|
|
382
|
-
${positionRelative}
|
|
383
|
-
${overflowHidden}
|
|
331
|
+
const AvatarPreviewCSS = readOnly => css`
|
|
332
|
+
${displayBlock};
|
|
333
|
+
${positionRelative};
|
|
334
|
+
${overflowHidden};
|
|
384
335
|
width: 100%;
|
|
385
336
|
height: 100%;
|
|
386
337
|
border-radius: 50%;
|
|
387
338
|
cursor: ${readOnly ? 'initial' : 'pointer'};
|
|
388
339
|
`;
|
|
389
340
|
|
|
390
|
-
const
|
|
391
|
-
${inlineFlex}
|
|
392
|
-
${positionRelative}
|
|
393
|
-
${alignCenter}
|
|
341
|
+
const AvatarContainerCSS = (AvatarPreviewCSSName, ActionIconCSSName) => css`
|
|
342
|
+
${inlineFlex};
|
|
343
|
+
${positionRelative};
|
|
344
|
+
${alignCenter};
|
|
394
345
|
&.disabled {
|
|
395
|
-
.css-${
|
|
346
|
+
.css-${AvatarPreviewCSSName} {
|
|
396
347
|
${pointerEventsNone}
|
|
397
348
|
cursor: inherit;
|
|
398
349
|
}
|
|
399
|
-
.css-${
|
|
350
|
+
.css-${ActionIconCSSName} {
|
|
400
351
|
display: none !important;
|
|
401
352
|
}
|
|
402
353
|
}
|
|
403
354
|
&:hover {
|
|
404
|
-
.css-${
|
|
355
|
+
.css-${ActionIconCSSName} {
|
|
405
356
|
opacity: 1;
|
|
406
357
|
}
|
|
407
358
|
}
|
|
408
359
|
`;
|
|
409
360
|
|
|
410
|
-
const
|
|
411
|
-
${displayBlock}
|
|
412
|
-
${positionRelative}
|
|
413
|
-
${overflowHidden}
|
|
414
|
-
${userSelectNone}
|
|
415
|
-
${borderNone}
|
|
416
|
-
${parseWidthHeight(width, height)}
|
|
361
|
+
const AvatarRootCSS = (width, height, outlined) => css`
|
|
362
|
+
${displayBlock};
|
|
363
|
+
${positionRelative};
|
|
364
|
+
${overflowHidden};
|
|
365
|
+
${userSelectNone};
|
|
366
|
+
${borderNone};
|
|
367
|
+
${parseWidthHeight(width, height)};
|
|
417
368
|
border: ${typeof outlined === 'boolean' && outlined ? `1px solid ${white}` : outlined};
|
|
418
369
|
border-radius: 50%;
|
|
419
370
|
box-sizing: content-box;
|
|
420
371
|
input {
|
|
421
|
-
${displayNone}
|
|
372
|
+
${displayNone};
|
|
422
373
|
}
|
|
423
374
|
img {
|
|
424
375
|
width: 100%;
|
|
@@ -426,12 +377,12 @@ const AvatarRoot = (width, height, outlined) => css`
|
|
|
426
377
|
}
|
|
427
378
|
`;
|
|
428
379
|
|
|
429
|
-
const
|
|
430
|
-
${displayBlock}
|
|
431
|
-
${positionRelative}
|
|
380
|
+
const MoreInfoCSS = css`
|
|
381
|
+
${displayBlock};
|
|
382
|
+
${positionRelative};
|
|
432
383
|
padding: 8px;
|
|
433
384
|
`;
|
|
434
|
-
const
|
|
385
|
+
const blurAnimationCSS = css`
|
|
435
386
|
animation: ${blurKeyframe} 1s ease;
|
|
436
387
|
`;
|
|
437
388
|
Avatar.defaultProps = {
|
|
@@ -445,7 +396,7 @@ Avatar.defaultProps = {
|
|
|
445
396
|
actionIconWidth: 24,
|
|
446
397
|
actionIconHeight: 24,
|
|
447
398
|
className: '',
|
|
448
|
-
direction: '
|
|
399
|
+
direction: 'bottom',
|
|
449
400
|
maxSizeError: `File ${getGlobal(['errorDefault', 'maxSize'])}`,
|
|
450
401
|
wrongTypeError: `File ${getGlobal(['errorDefault', 'fileType'])}`,
|
|
451
402
|
matchType: /^image\/(gif|jpe?g|tiff?|png|webp|bmp|svg(\+xml)?)$/i,
|
|
@@ -505,7 +456,7 @@ Avatar.propTypes = {
|
|
|
505
456
|
defaultSrc: PropTypes.string,
|
|
506
457
|
|
|
507
458
|
/** the direction to display more info */
|
|
508
|
-
direction: PropTypes.oneOf(['top', '
|
|
459
|
+
direction: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
|
|
509
460
|
|
|
510
461
|
/**
|
|
511
462
|
* data to display when hoverAble is true<br />
|