diginet-core-ui 1.3.76 → 1.3.78

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,7 +1,7 @@
1
1
  /** @jsxRuntime classic */
2
2
 
3
3
  /** @jsx jsx */
4
- import { Fragment, memo, useRef, forwardRef, useState, useEffect, useMemo, useImperativeHandle } from 'react';
4
+ import { Fragment, memo, useRef, forwardRef, useState, useEffect, useMemo, useImperativeHandle, isValidElement } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css, keyframes } from '@emotion/core';
7
7
  import OptionWrapper from '../others/option-wrapper';
@@ -149,9 +149,10 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
149
149
  };
150
150
 
151
151
  const renderData = () => {
152
+ if ( /*#__PURE__*/isValidElement(data)) return data;
152
153
  const info = Object.keys(data || {});
153
154
 
154
- if (info.length) {
155
+ if (info !== null && info !== void 0 && info.length) {
155
156
  return info.map((key, index) => {
156
157
  return jsx(Typography, {
157
158
  key: index,
@@ -441,7 +442,7 @@ Avatar.propTypes = {
441
442
  * data to display when hoverAble is true<br />
442
443
  * data is an object or function return a jsx element
443
444
  */
444
- data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
445
+ data: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.node]),
445
446
 
446
447
  /**
447
448
  * it is used to display the default if there is no src<br />
@@ -213,11 +213,11 @@ Badge.propTypes = {
213
213
  /** other icon props when use prop name */
214
214
  iconProps: PropTypes.object,
215
215
 
216
- /** size of Badge
217
- *
218
- * * medium (dot 8px, typography p3)
219
- * * large (button 10px, typography p2)
220
- * * giant (button 12px, typography p1)
216
+ /** size of Badge
217
+ *
218
+ * * medium (dot 8px, typography p3)
219
+ * * large (button 10px, typography p2)
220
+ * * giant (button 12px, typography p1)
221
221
  * */
222
222
  size: PropTypes.oneOf(['medium', 'large', 'giant']),
223
223
 
@@ -328,10 +328,10 @@ Checkbox.propTypes = {
328
328
  /** The name of the Checkbox corresponds to the label displayed on the interface. */
329
329
  name: PropTypes.string,
330
330
 
331
- /**
332
- * Callback fired when the state is changed.
333
- *
334
- * You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
331
+ /**
332
+ * Callback fired when the state is changed.
333
+ *
334
+ * You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
335
335
  */
336
336
  onChange: PropTypes.func,
337
337