diginet-core-ui 1.3.70-beta.5 → 1.3.70-beta.7

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.
@@ -52,31 +52,31 @@ const checkFileType = (type, matchType) => {
52
52
 
53
53
  const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
54
54
  action = {},
55
- src,
55
+ actionIconHeight,
56
+ actionIconWidth,
57
+ allowEdit,
58
+ className,
59
+ clearAble,
60
+ data,
56
61
  defaultSrc,
57
- outlined,
58
- width,
62
+ direction,
63
+ disabled,
59
64
  height,
60
- maxSize,
65
+ hoverAble,
66
+ id,
67
+ lazyLoading,
61
68
  matchType,
62
- className,
69
+ maxSize,
63
70
  maxSizeError,
64
- wrongTypeError,
65
- actionIconWidth,
66
- actionIconHeight,
67
- direction,
68
- data,
69
- onRemove,
70
71
  onChange,
71
- clearAble,
72
- hoverAble,
73
- readOnly,
74
- disabled,
75
- lazyLoading,
76
- id,
77
- allowEdit,
78
72
  onClick,
79
- style
73
+ onRemove,
74
+ outlined,
75
+ readOnly,
76
+ src,
77
+ style,
78
+ width,
79
+ wrongTypeError
80
80
  }, reference) => {
81
81
  if (!defaultSrc) defaultSrc = AvatarDefault;
82
82
  const ref = useRef(null);
@@ -331,7 +331,7 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
331
331
  icon: 'danger',
332
332
  fullScreen: true
333
333
  }));
334
- }, [width, height, readOnly, disabled, clearAble, maxSize, matchType, hoverAble, outlined, actionIconWidth, actionIconHeight, lazyLoading, defaultSrc, direction, data, maxSizeError, allowEdit, srcState, isInView, onLoaded, viewAvatar, viewMoreInfo]);
334
+ }, [actionIconHeight, actionIconWidth, allowEdit, clearAble, data, defaultSrc, direction, disabled, height, hoverAble, lazyLoading, matchType, maxSize, maxSizeError, outlined, readOnly, width, isInView, onLoaded, srcState, viewAvatar, viewMoreInfo]);
335
335
  }));
336
336
 
337
337
  const ActionIconCSS = actionIconWidth => css`
@@ -402,104 +402,104 @@ const blurAnimationCSS = css`
402
402
  animation: ${blurKeyframe} 1s ease;
403
403
  `;
404
404
  Avatar.defaultProps = {
405
+ actionIconHeight: 24,
406
+ actionIconWidth: 24,
405
407
  allowEdit: false,
406
- disabled: false,
407
- readOnly: false,
408
+ className: '',
408
409
  clearAble: true,
410
+ data: {},
411
+ direction: 'bottom',
412
+ disabled: false,
413
+ height: 48,
409
414
  hoverAble: false,
415
+ lazyLoading: false,
416
+ matchType: /^image\/(gif|jpe?g|tiff?|png|webp|bmp|svg(\+xml)?)$/i,
417
+ maxSizeError: `File ${getGlobal(['errorDefault', 'maxSize'])}`,
410
418
  outlined: false,
419
+ readOnly: false,
420
+ style: {},
411
421
  width: 48,
412
- height: 48,
413
- actionIconWidth: 24,
414
- actionIconHeight: 24,
415
- className: '',
416
- direction: 'bottom',
417
- maxSizeError: `File ${getGlobal(['errorDefault', 'maxSize'])}`,
418
- wrongTypeError: `File ${getGlobal(['errorDefault', 'fileType'])}`,
419
- matchType: /^image\/(gif|jpe?g|tiff?|png|webp|bmp|svg(\+xml)?)$/i,
420
- data: {},
421
- lazyLoading: false,
422
- style: {}
422
+ wrongTypeError: `File ${getGlobal(['errorDefault', 'fileType'])}`
423
423
  };
424
424
  Avatar.propTypes = {
425
+ /** The height of action icon. */
426
+ actionIconHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
427
+
428
+ /** The width of action icon. */
429
+ actionIconWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
430
+
425
431
  /** If `true`, allow to edit avatar. */
426
432
  allowEdit: PropTypes.bool,
427
433
 
428
- /** prevent all events, only view */
429
- disabled: PropTypes.bool,
430
-
431
- /** only view and allow show more info if hoverAble is true */
432
- readOnly: PropTypes.bool,
434
+ /** Class for component. */
435
+ className: PropTypes.string,
433
436
 
434
- /** display remove avatar icon if true */
437
+ /** If `true`, display remove avatar icon. */
435
438
  clearAble: PropTypes.bool,
436
439
 
437
- /** show more info in popover if true */
438
- hoverAble: PropTypes.bool,
440
+ /**
441
+ * data to display when hoverAble is true<br />
442
+ * data is an object or function return a jsx element
443
+ */
444
+ data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
439
445
 
440
- /** border of avatar (true or '1px solid #color') */
441
- outlined: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
446
+ /**
447
+ * it is used to display the default if there is no src<br />
448
+ * if undefined, will display icons available in the icons store
449
+ */
450
+ defaultSrc: PropTypes.string,
442
451
 
443
- /** The width of avatar box (48 or '48px' or ...) */
444
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
452
+ /** the direction to display more info */
453
+ direction: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
454
+
455
+ /** prevent all events, only view */
456
+ disabled: PropTypes.bool,
445
457
 
446
458
  /** The height of avatar box (48 or '48px' or ...) */
447
459
  height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
448
460
 
449
- /** The width of action icon (18 or '18px') */
450
- actionIconWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
451
-
452
- /** The height of action icon (18 or '18px') */
453
- actionIconHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
461
+ /** show more info in popover if true */
462
+ hoverAble: PropTypes.bool,
454
463
 
455
- /** maximum size for avatar file (unit: MB) */
456
- maxSize: PropTypes.number,
464
+ /** lazy loading */
465
+ lazyLoading: PropTypes.bool,
457
466
 
458
467
  /** type of image was allowed */
459
468
  matchType: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func, PropTypes.array]),
460
469
 
461
- /** class for Avatar component */
462
- className: PropTypes.string,
470
+ /** maximum size for avatar file (unit: MB) */
471
+ maxSize: PropTypes.number,
463
472
 
464
473
  /** the error to show on exceeded allowed size */
465
474
  maxSizeError: PropTypes.string,
466
475
 
467
- /** the error to show on wrong type */
468
- wrongTypeError: PropTypes.string,
469
-
470
- /** source of file (http:// or https://) */
471
- src: PropTypes.string,
472
-
473
- /**
474
- * it is used to display the default if there is no src<br />
475
- * if undefined, will display icons available in the icons store
476
- */
477
- defaultSrc: PropTypes.string,
478
-
479
- /** the direction to display more info */
480
- direction: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
476
+ /** will run after change avatar */
477
+ onChange: PropTypes.func,
481
478
 
482
- /**
483
- * data to display when hoverAble is true<br />
484
- * data is an object or function return a jsx element
485
- */
486
- data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
479
+ /** Callback fired when the component is clicked. */
480
+ onClick: PropTypes.func,
487
481
 
488
482
  /** will run after remove avatar */
489
483
  onRemove: PropTypes.func,
490
484
 
491
- /** will run after change avatar */
492
- onChange: PropTypes.func,
485
+ /** border of avatar (true or '1px solid #color') */
486
+ outlined: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
493
487
 
494
- /** Callback fired when the component is clicked. */
495
- onClick: PropTypes.func,
488
+ /** only view and allow show more info if hoverAble is true */
489
+ readOnly: PropTypes.bool,
496
490
 
497
- /** lazy loading */
498
- lazyLoading: PropTypes.bool,
491
+ /** source of file (http:// or https://) */
492
+ src: PropTypes.string,
499
493
 
500
494
  /** Style inline of component. */
501
495
  style: PropTypes.object,
502
496
 
497
+ /** The width of avatar box (48 or '48px' or ...) */
498
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
499
+
500
+ /** the error to show on wrong type */
501
+ wrongTypeError: PropTypes.string,
502
+
503
503
  /**
504
504
  * ref methods
505
505
  *