gxxc-ui 1.0.54 → 1.0.60

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.
Files changed (51) hide show
  1. package/dist/AmountCellUI/index.js +28 -33
  2. package/dist/AnchorUI/demo/anchor-button.js +7 -24
  3. package/dist/AnchorUI/demo/use-anchor.js +3 -12
  4. package/dist/AnchorUI/index.js +17 -30
  5. package/dist/BackUI/index.js +15 -17
  6. package/dist/BroadcastUI/index.js +23 -29
  7. package/dist/ButtonUI/index.js +6 -8
  8. package/dist/CellUI/index.js +22 -34
  9. package/dist/DateUI/index.js +33 -62
  10. package/dist/DescriptionsUI/index.js +23 -29
  11. package/dist/EmptyUI/emptyImage.js +111 -3
  12. package/dist/EmptyUI/index.js +7 -6
  13. package/dist/FilterUI/index.js +99 -143
  14. package/dist/FormUI/index.js +15 -14
  15. package/dist/HtmlTemplateRenderer/index.js +16 -14
  16. package/dist/IconUI/index.js +13 -14
  17. package/dist/IconUI/material/dictionary.js +18 -33
  18. package/dist/IconUI/material/material.js +52 -52
  19. package/dist/IconUI/material/rally.js +13 -19
  20. package/dist/ImageUI/index.js +70 -85
  21. package/dist/InputUI/index.js +39 -64
  22. package/dist/LoadingUI/index.js +5 -4
  23. package/dist/ModalUI/index.js +42 -63
  24. package/dist/NotificationUI/index.js +11 -20
  25. package/dist/PasswordStrongUI/index.js +14 -15
  26. package/dist/RichEditorUI/index.js +14 -25
  27. package/dist/SearchNumberUI/index.js +18 -28
  28. package/dist/SearchUI/index.js +17 -30
  29. package/dist/SelectUI/index.js +24 -40
  30. package/dist/StatisticUI/index.js +24 -24
  31. package/dist/SwitchUI/index.js +8 -9
  32. package/dist/TableUI/demo/setting.js +16 -35
  33. package/dist/TableUI/index.js +32 -51
  34. package/dist/TableUI/material/Button/index.js +10 -12
  35. package/dist/TableUI/material/HideMultipleLines/index.js +13 -12
  36. package/dist/TableUI/material/MultiLine/index.js +11 -14
  37. package/dist/TableUI/material/Operate/index.js +20 -23
  38. package/dist/TableUI/material/Setting/index.js +72 -102
  39. package/dist/TagUI/index.js +30 -41
  40. package/dist/TestUI/index.js +2 -2
  41. package/dist/TextUI/index.js +8 -10
  42. package/dist/Tiga/demo/demoQuick.js +14 -23
  43. package/dist/Tiga/demo/demoQuickType.js +10 -10
  44. package/dist/Tiga/index.js +29 -35
  45. package/dist/Tiga/material/quickType.js +30 -46
  46. package/dist/UploadUI/index.js +205 -301
  47. package/dist/UploadUI/type.js +1 -1
  48. package/dist/VesselUI/index.js +95 -138
  49. package/dist/VideoPreviewUI/index.js +14 -45
  50. package/dist/index.js +36 -270
  51. package/package.json +1 -1
@@ -1,33 +1,28 @@
1
- var _excluded = ["className", "children", "animation", "rawValue", "forceRender", "separator"];
2
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
2
  import { Tooltip } from 'antd';
6
3
  import lodash from 'lodash';
7
4
  import React from 'react';
8
5
  import CountUp from 'react-countup';
9
6
  import { num_expand } from 'gxxc-util';
10
7
  export default function AmountCellUI(props) {
11
- var className = props.className,
12
- children = props.children,
13
- _props$animation = props.animation,
14
- animation = _props$animation === void 0 ? false : _props$animation,
15
- _props$rawValue = props.rawValue,
16
- rawValue = _props$rawValue === void 0 ? false : _props$rawValue,
17
- _props$forceRender = props.forceRender,
18
- forceRender = _props$forceRender === void 0 ? false : _props$forceRender,
19
- _props$separator = props.separator,
20
- separator = _props$separator === void 0 ? '' : _props$separator,
21
- otherProps = _objectWithoutProperties(props, _excluded);
8
+ const {
9
+ className,
10
+ children,
11
+ animation = false,
12
+ rawValue = false,
13
+ forceRender = false,
14
+ separator = '',
15
+ ...otherProps
16
+ } = props;
22
17
 
23
18
  /**
24
19
  * 判断传入值是否为合法数字(包括字符串形式的数字)
25
20
  */
26
- var isNumeric = function isNumeric(value) {
21
+ const isNumeric = value => {
27
22
  if (value === null || value === undefined) return false;
28
- var num;
23
+ let num;
29
24
  if (lodash.isString(value)) {
30
- var trimmed = value.trim();
25
+ const trimmed = value.trim();
31
26
  if (!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(trimmed)) return false;
32
27
  num = Number(trimmed);
33
28
  } else if (lodash.isNumber(value)) {
@@ -41,7 +36,7 @@ export default function AmountCellUI(props) {
41
36
  /**
42
37
  * 将传入值转换为有限数字,失败返回 null
43
38
  */
44
- var toFiniteNumber = function toFiniteNumber(value) {
39
+ const toFiniteNumber = value => {
45
40
  if (isNumeric(value)) {
46
41
  return Number(value);
47
42
  }
@@ -51,14 +46,14 @@ export default function AmountCellUI(props) {
51
46
  /**
52
47
  * 获取传入值的小数位数(忽略末尾为 0 的情况,如 1.00 返回 0)
53
48
  */
54
- var getDecimalsIfNumber = function getDecimalsIfNumber(value) {
55
- var num = toFiniteNumber(value);
49
+ const getDecimalsIfNumber = value => {
50
+ const num = toFiniteNumber(value);
56
51
  if (num === null || !isNumeric(value)) return 0;
57
52
  if (Number.isInteger(num)) return 0;
58
- var str = num.toPrecision(); // 更稳定地获取数值字符串
59
- var decimalIndex = str.indexOf('.');
53
+ const str = num.toPrecision(); // 更稳定地获取数值字符串
54
+ const decimalIndex = str.indexOf('.');
60
55
  if (decimalIndex === -1) return 0;
61
- var fractionalPart = str.slice(decimalIndex + 1).replace(/[^0-9]/g, '');
56
+ const fractionalPart = str.slice(decimalIndex + 1).replace(/[^0-9]/g, '');
62
57
  return fractionalPart.length;
63
58
  };
64
59
 
@@ -68,8 +63,8 @@ export default function AmountCellUI(props) {
68
63
  * - 大于等于 1 万:显示为 "X 万"
69
64
  * - 否则原样展示
70
65
  */
71
- var getFormatAmount = function getFormatAmount(amount) {
72
- var num = toFiniteNumber(amount);
66
+ const getFormatAmount = amount => {
67
+ const num = toFiniteNumber(amount);
73
68
  if (num === null) return {
74
69
  value: amount,
75
70
  suffix: ''
@@ -96,28 +91,28 @@ export default function AmountCellUI(props) {
96
91
  // 如果强制渲染,直接返回内容
97
92
  if (forceRender) {
98
93
  return /*#__PURE__*/React.createElement("div", _extends({
99
- className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
94
+ className: `amountCellUI ${className ?? ''}`
100
95
  }, otherProps), children);
101
96
  }
102
97
 
103
98
  // 如果不是合法数字,直接返回 '--'
104
99
  if (!isNumeric(children)) {
105
100
  return /*#__PURE__*/React.createElement("div", _extends({
106
- className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
101
+ className: `amountCellUI ${className ?? ''}`
107
102
  }, otherProps), '--');
108
103
  }
109
104
 
110
105
  // 提前计算格式化结果,避免重复调用
111
- var formattedAmount = getFormatAmount(children);
106
+ const formattedAmount = getFormatAmount(children);
112
107
  return /*#__PURE__*/React.createElement("div", _extends({
113
- className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
108
+ className: `amountCellUI ${className ?? ''}`
114
109
  }, otherProps), /*#__PURE__*/React.createElement(Tooltip, {
115
110
  placement: "right",
116
111
  title: children
117
112
  }, animation ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CountUp, {
118
- end: rawValue ? Number(children) : Number(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value),
119
- decimals: rawValue ? getDecimalsIfNumber(children) : getDecimalsIfNumber(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value),
120
- suffix: rawValue ? '' : formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.suffix,
113
+ end: rawValue ? Number(children) : Number(formattedAmount?.value),
114
+ decimals: rawValue ? getDecimalsIfNumber(children) : getDecimalsIfNumber(formattedAmount?.value),
115
+ suffix: rawValue ? '' : formattedAmount?.suffix,
121
116
  separator: separator
122
- })) : /*#__PURE__*/React.createElement("span", null, rawValue ? Number(children) : Number(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value) + (formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.suffix))));
117
+ })) : /*#__PURE__*/React.createElement("span", null, rawValue ? Number(children) : Number(formattedAmount?.value) + formattedAmount?.suffix)));
123
118
  }
@@ -1,34 +1,17 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import React, { useRef, useState } from 'react';
8
2
  import { AnchorUI, ButtonUI } from "../..";
9
- export default (function () {
10
- var ref = useRef(null);
3
+ export default (() => {
4
+ const ref = useRef(null);
11
5
  //当前导航项
12
- var _useState = useState(''),
13
- _useState2 = _slicedToArray(_useState, 2),
14
- anchorActive = _useState2[0],
15
- setAnchorActive = _useState2[1];
6
+ const [anchorActive, setAnchorActive] = useState('');
16
7
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ButtonUI, {
17
- onClick: function onClick() {
18
- return setAnchorActive('part-1');
19
- }
8
+ onClick: () => setAnchorActive('part-1')
20
9
  }, "\u70B9\u51FB\u5230\u4E3B\u4F53\u8D44\u8D28"), /*#__PURE__*/React.createElement(ButtonUI, {
21
- onClick: function onClick() {
22
- return setAnchorActive('part-2');
23
- }
10
+ onClick: () => setAnchorActive('part-2')
24
11
  }, "\u70B9\u51FB\u5230\u5BA2\u6237\u6765\u6E90"), /*#__PURE__*/React.createElement(ButtonUI, {
25
- onClick: function onClick() {
26
- return setAnchorActive('part-3');
27
- }
12
+ onClick: () => setAnchorActive('part-3')
28
13
  }, "\u70B9\u51FB\u5230\u9879\u76EE\u4FE1\u606F"), /*#__PURE__*/React.createElement(ButtonUI, {
29
- onClick: function onClick() {
30
- return setAnchorActive('part-4');
31
- }
14
+ onClick: () => setAnchorActive('part-4')
32
15
  }, "\u70B9\u51FB\u5230\u98CE\u63A7\u4FE1\u606F"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
33
16
  style: {
34
17
  display: 'flex'
@@ -1,18 +1,9 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import React, { useRef, useState } from 'react';
8
2
  import { AnchorUI } from "../..";
9
- export default (function () {
10
- var ref = useRef(null);
3
+ export default (() => {
4
+ const ref = useRef(null);
11
5
  //当前导航项
12
- var _useState = useState(''),
13
- _useState2 = _slicedToArray(_useState, 2),
14
- anchorActive = _useState2[0],
15
- setAnchorActive = _useState2[1];
6
+ const [anchorActive, setAnchorActive] = useState('');
16
7
  return /*#__PURE__*/React.createElement("div", {
17
8
  style: {
18
9
  display: 'flex'
@@ -1,28 +1,21 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import { Anchor } from 'antd';
8
2
  import React, { useEffect, useState } from 'react';
9
3
  import "./index.scss";
10
- var AnchorUI = function AnchorUI(props) {
11
- var className = props.className,
12
- anchoruiRef = props.anchoruiRef,
13
- items = props.items,
14
- anchorActive = props.anchorActive,
15
- setAnchorActive = props.setAnchorActive;
4
+ const AnchorUI = props => {
5
+ const {
6
+ className,
7
+ anchoruiRef,
8
+ items,
9
+ anchorActive,
10
+ setAnchorActive
11
+ } = props;
16
12
  // 当前聚焦id
17
- var _useState = useState(''),
18
- _useState2 = _slicedToArray(_useState, 2),
19
- activeId = _useState2[0],
20
- setActiveId = _useState2[1];
21
- useEffect(function () {
13
+ const [activeId, setActiveId] = useState('');
14
+ useEffect(() => {
22
15
  if (anchorActive) {
23
16
  //判断是否点击的是当前聚焦项
24
17
  if ('#' + anchorActive !== activeId) {
25
- var targetElement = document.getElementById(anchorActive);
18
+ const targetElement = document.getElementById(anchorActive);
26
19
  if (targetElement) targetElement.scrollIntoView({
27
20
  behavior: 'auto'
28
21
  });
@@ -31,26 +24,20 @@ var AnchorUI = function AnchorUI(props) {
31
24
  if (setAnchorActive) setAnchorActive('');
32
25
  }
33
26
  }, [anchorActive]);
34
- var newItems = items.map(function (item) {
27
+ const newItems = items.map(item => {
35
28
  return {
36
29
  key: item.key,
37
30
  title: item.title,
38
- href: "#".concat(item.key)
31
+ href: `#${item.key}`
39
32
  };
40
33
  });
41
34
  return /*#__PURE__*/React.createElement(Anchor, {
42
- className: "anchoraUI ".concat(className !== null && className !== void 0 ? className : ''),
35
+ className: `anchoraUI ${className ?? ''}`,
43
36
  items: newItems,
44
37
  affix: false,
45
- getContainer: function getContainer() {
46
- return anchoruiRef === null || anchoruiRef === void 0 ? void 0 : anchoruiRef.current;
47
- },
48
- onClick: function onClick(e) {
49
- return e.preventDefault();
50
- },
51
- onChange: function onChange(e) {
52
- return setActiveId(e);
53
- }
38
+ getContainer: () => anchoruiRef?.current,
39
+ onClick: e => e.preventDefault(),
40
+ onChange: e => setActiveId(e)
54
41
  });
55
42
  };
56
43
  export default AnchorUI;
@@ -1,29 +1,27 @@
1
- var _excluded = ["to", "before", "current", "className", "children", "backClick"];
2
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
2
  import React from 'react';
6
3
  import { useNavigate } from 'react-router-dom';
7
4
  import { IconUI } from "./..";
8
5
  import "./index.scss";
9
- var BackUI = function BackUI(props) {
10
- var _props$to = props.to,
11
- to = _props$to === void 0 ? -1 : _props$to,
12
- before = props.before,
13
- current = props.current,
14
- className = props.className,
15
- children = props.children,
16
- backClick = props.backClick,
17
- otherProps = _objectWithoutProperties(props, _excluded);
18
- var navigate = useNavigate();
19
- var handleClick = function handleClick() {
20
- navigate(to !== null && to !== void 0 ? to : -1);
6
+ const BackUI = props => {
7
+ const {
8
+ to = -1,
9
+ before,
10
+ current,
11
+ className,
12
+ children,
13
+ backClick,
14
+ ...otherProps
15
+ } = props;
16
+ const navigate = useNavigate();
17
+ const handleClick = () => {
18
+ navigate(to ?? -1);
21
19
  };
22
20
  return /*#__PURE__*/React.createElement("div", _extends({
23
- className: "sic-backui ".concat(className !== null && className !== void 0 ? className : '')
21
+ className: `sic-backui ${className ?? ''}`
24
22
  }, otherProps), /*#__PURE__*/React.createElement("div", {
25
23
  className: "sic-backui-button",
26
- onClick: function onClick() {
24
+ onClick: () => {
27
25
  if (backClick) {
28
26
  backClick(handleClick);
29
27
  return;
@@ -2,13 +2,13 @@ import { Carousel, Popover } from 'antd';
2
2
  import React, { useRef } from 'react';
3
3
  import { IconUI } from "./..";
4
4
  import "./index.scss";
5
- var BroadcastUI = function BroadcastUI(props) {
6
- var ref = useRef(null);
7
- var _props$items = props.items,
8
- items = _props$items === void 0 ? [] : _props$items,
9
- width = props.width,
10
- _props$textAlign = props.textAlign,
11
- textAlign = _props$textAlign === void 0 ? 'left' : _props$textAlign;
5
+ const BroadcastUI = props => {
6
+ const ref = useRef(null);
7
+ const {
8
+ items = [],
9
+ width,
10
+ textAlign = 'left'
11
+ } = props;
12
12
  return /*#__PURE__*/React.createElement("div", {
13
13
  className: "sicBroadcastui",
14
14
  style: {
@@ -19,41 +19,35 @@ var BroadcastUI = function BroadcastUI(props) {
19
19
  theme: "filled",
20
20
  fill: "var(--red)",
21
21
  size: "18"
22
- }), (items === null || items === void 0 ? void 0 : items.length) > 0 && /*#__PURE__*/React.createElement("div", {
22
+ }), items?.length > 0 && /*#__PURE__*/React.createElement("div", {
23
23
  className: "sicBroadcastui-content"
24
24
  }, /*#__PURE__*/React.createElement(Carousel, {
25
- autoplay: (items === null || items === void 0 ? void 0 : items.length) > 1,
25
+ autoplay: items?.length > 1,
26
26
  dots: false,
27
27
  dotPosition: "left",
28
28
  autoplaySpeed: 5000,
29
29
  adaptiveHeight: true
30
- }, items.map(function (item, index) {
31
- return /*#__PURE__*/React.createElement("div", {
32
- className: "sicBroadcastui-content-item",
33
- key: index
34
- }, /*#__PURE__*/React.createElement("div", {
35
- className: "sicBroadcastui-content-item-text",
36
- style: {
37
- textAlign: textAlign
38
- }
39
- }, item));
40
- }))), (items === null || items === void 0 ? void 0 : items.length) > 1 && /*#__PURE__*/React.createElement(Popover, {
30
+ }, items.map((item, index) => /*#__PURE__*/React.createElement("div", {
31
+ className: "sicBroadcastui-content-item",
32
+ key: index
33
+ }, /*#__PURE__*/React.createElement("div", {
34
+ className: "sicBroadcastui-content-item-text",
35
+ style: {
36
+ textAlign: textAlign
37
+ }
38
+ }, item))))), items?.length > 1 && /*#__PURE__*/React.createElement(Popover, {
41
39
  color: "rgba(0, 0, 0, 0.85)",
42
40
  placement: "bottomRight",
43
- getPopupContainer: function getPopupContainer() {
44
- return ref.current || document.body;
45
- },
41
+ getPopupContainer: () => ref.current || document.body,
46
42
  content: /*#__PURE__*/React.createElement("div", {
47
43
  className: "sicBroadcastui-popover",
48
44
  style: {
49
45
  width: width ? width - 20 : 'auto'
50
46
  }
51
- }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
52
- return /*#__PURE__*/React.createElement("div", {
53
- className: "sicBroadcastui-popover-item",
54
- key: index
55
- }, item);
56
- }))
47
+ }, items?.map((item, index) => /*#__PURE__*/React.createElement("div", {
48
+ className: "sicBroadcastui-popover-item",
49
+ key: index
50
+ }, item)))
57
51
  }, /*#__PURE__*/React.createElement("div", {
58
52
  className: "sicBroadcastui-more",
59
53
  ref: ref
@@ -1,15 +1,13 @@
1
- var _excluded = ["children", "iconPosition"];
2
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
2
  import { Button } from 'antd';
6
3
  import React from 'react';
7
4
  import "./index.scss";
8
- var ButtonUI = function ButtonUI(props) {
9
- var children = props.children,
10
- _props$iconPosition = props.iconPosition,
11
- iconPosition = _props$iconPosition === void 0 ? 'end' : _props$iconPosition,
12
- otherProps = _objectWithoutProperties(props, _excluded);
5
+ const ButtonUI = props => {
6
+ const {
7
+ children,
8
+ iconPosition = 'end',
9
+ ...otherProps
10
+ } = props;
13
11
  return /*#__PURE__*/React.createElement(Button, _extends({
14
12
  iconPosition: iconPosition
15
13
  }, otherProps), children);
@@ -1,47 +1,37 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import { Tooltip } from 'antd';
8
2
  import React, { useEffect, useRef, useState } from 'react';
9
3
  import { IconUI, MessageUI } from "./..";
10
4
  import "./index.scss";
11
- var CellUI = function CellUI(props) {
12
- var textRef = useRef(null);
13
- var _props$line = props.line,
14
- line = _props$line === void 0 ? 2 : _props$line,
15
- _props$placement = props.placement,
16
- placement = _props$placement === void 0 ? 'right' : _props$placement,
17
- _props$isShowCopy = props.isShowCopy,
18
- isShowCopy = _props$isShowCopy === void 0 ? true : _props$isShowCopy,
19
- className = props.className,
20
- children = props.children,
21
- style = props.style,
22
- onClick = props.onClick;
23
- var _useState = useState(false),
24
- _useState2 = _slicedToArray(_useState, 2),
25
- showTooltip = _useState2[0],
26
- setShowTooltip = _useState2[1];
27
- useEffect(function () {
28
- var element = textRef.current;
5
+ const CellUI = props => {
6
+ const textRef = useRef(null);
7
+ const {
8
+ line = 2,
9
+ placement = 'right',
10
+ isShowCopy = true,
11
+ className,
12
+ children,
13
+ style,
14
+ onClick
15
+ } = props;
16
+ const [showTooltip, setShowTooltip] = useState(false);
17
+ useEffect(() => {
18
+ const element = textRef.current;
29
19
  if (element) {
30
20
  // 获取元素的实际高度
31
- var clientHeight = element.clientHeight;
21
+ const clientHeight = element.clientHeight;
32
22
  // 获取元素的滚动高度
33
- var scrollHeight = element.scrollHeight;
23
+ const scrollHeight = element.scrollHeight;
34
24
  // 判断是否溢出
35
- var isOverflowing = scrollHeight > clientHeight;
25
+ const isOverflowing = scrollHeight > clientHeight;
36
26
  if (isOverflowing) {
37
27
  setShowTooltip(isOverflowing);
38
28
  }
39
29
  }
40
30
  }, [children]);
41
- var cellStyle = {
31
+ const cellStyle = {
42
32
  '--cellLine': line
43
33
  };
44
- var clickCopy = function clickCopy(e, children) {
34
+ const clickCopy = (e, children) => {
45
35
  e.stopPropagation();
46
36
  try {
47
37
  navigator.clipboard.writeText(children);
@@ -50,20 +40,18 @@ var CellUI = function CellUI(props) {
50
40
  MessageUI.error('复制失败');
51
41
  }
52
42
  };
53
- var tooltipContent = function tooltipContent(children) {
43
+ const tooltipContent = children => {
54
44
  return /*#__PURE__*/React.createElement("div", {
55
45
  className: "sic-cellui-tooltipContent"
56
46
  }, isShowCopy && /*#__PURE__*/React.createElement(IconUI, {
57
47
  className: "sic-cellui-tooltipContent-icon",
58
48
  name: "Copy",
59
49
  fill: "var(--themeColor)",
60
- onClick: function onClick(e) {
61
- return clickCopy(e, children);
62
- }
50
+ onClick: e => clickCopy(e, children)
63
51
  }), children);
64
52
  };
65
53
  return /*#__PURE__*/React.createElement("div", {
66
- className: "sic-cellui ".concat(className !== null && className !== void 0 ? className : ''),
54
+ className: `sic-cellui ${className ?? ''}`,
67
55
  style: style,
68
56
  onClick: onClick
69
57
  }, /*#__PURE__*/React.createElement(Tooltip, {