gxxc-ui 1.0.53 → 1.0.55
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/dist/AmountCellUI/index.js +28 -33
- package/dist/AnchorUI/demo/anchor-button.js +7 -24
- package/dist/AnchorUI/demo/use-anchor.js +3 -12
- package/dist/AnchorUI/index.js +17 -30
- package/dist/BackUI/index.js +15 -17
- package/dist/BroadcastUI/index.js +23 -29
- package/dist/ButtonUI/index.js +6 -8
- package/dist/CellUI/index.js +22 -34
- package/dist/DateUI/index.js +33 -62
- package/dist/DescriptionsUI/index.js +23 -29
- package/dist/EmptyUI/emptyImage.js +111 -3
- package/dist/EmptyUI/index.js +7 -6
- package/dist/FilterUI/index.js +99 -143
- package/dist/FormUI/index.js +15 -14
- package/dist/HtmlTemplateRenderer/index.js +16 -14
- package/dist/IconUI/index.js +13 -14
- package/dist/IconUI/material/dictionary.js +18 -33
- package/dist/IconUI/material/material.js +52 -52
- package/dist/IconUI/material/rally.js +13 -19
- package/dist/ImageUI/index.js +67 -72
- package/dist/InputUI/index.js +39 -64
- package/dist/LoadingUI/index.js +5 -4
- package/dist/ModalUI/index.js +42 -63
- package/dist/NotificationUI/index.js +11 -20
- package/dist/PasswordStrongUI/index.js +14 -15
- package/dist/RichEditorUI/index.js +14 -25
- package/dist/SearchNumberUI/index.js +18 -28
- package/dist/SearchUI/index.js +17 -30
- package/dist/SelectUI/index.js +24 -40
- package/dist/StatisticUI/index.js +24 -24
- package/dist/SwitchUI/index.js +8 -9
- package/dist/TableUI/demo/setting.js +16 -35
- package/dist/TableUI/index.js +32 -51
- package/dist/TableUI/material/Button/index.js +10 -12
- package/dist/TableUI/material/HideMultipleLines/index.js +13 -12
- package/dist/TableUI/material/MultiLine/index.js +11 -14
- package/dist/TableUI/material/Operate/index.js +20 -23
- package/dist/TableUI/material/Setting/index.js +72 -102
- package/dist/TagUI/index.js +30 -41
- package/dist/TestUI/index.js +2 -2
- package/dist/TextUI/index.js +8 -10
- package/dist/Tiga/demo/demoQuick.js +14 -23
- package/dist/Tiga/demo/demoQuickType.js +10 -10
- package/dist/Tiga/index.js +29 -35
- package/dist/Tiga/material/quickType.js +30 -46
- package/dist/UploadUI/index.js +205 -301
- package/dist/UploadUI/type.js +1 -1
- package/dist/VesselUI/index.js +95 -138
- package/dist/VideoPreviewUI/index.js +14 -45
- package/dist/index.js +36 -270
- 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
animation =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
21
|
+
const isNumeric = value => {
|
|
27
22
|
if (value === null || value === undefined) return false;
|
|
28
|
-
|
|
23
|
+
let num;
|
|
29
24
|
if (lodash.isString(value)) {
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
55
|
-
|
|
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
|
-
|
|
59
|
-
|
|
53
|
+
const str = num.toPrecision(); // 更稳定地获取数值字符串
|
|
54
|
+
const decimalIndex = str.indexOf('.');
|
|
60
55
|
if (decimalIndex === -1) return 0;
|
|
61
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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:
|
|
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:
|
|
101
|
+
className: `amountCellUI ${className ?? ''}`
|
|
107
102
|
}, otherProps), '--');
|
|
108
103
|
}
|
|
109
104
|
|
|
110
105
|
// 提前计算格式化结果,避免重复调用
|
|
111
|
-
|
|
106
|
+
const formattedAmount = getFormatAmount(children);
|
|
112
107
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
113
|
-
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
|
|
119
|
-
decimals: rawValue ? getDecimalsIfNumber(children) : getDecimalsIfNumber(formattedAmount
|
|
120
|
-
suffix: rawValue ? '' : formattedAmount
|
|
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
|
|
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 (
|
|
10
|
-
|
|
3
|
+
export default (() => {
|
|
4
|
+
const ref = useRef(null);
|
|
11
5
|
//当前导航项
|
|
12
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 (
|
|
10
|
-
|
|
3
|
+
export default (() => {
|
|
4
|
+
const ref = useRef(null);
|
|
11
5
|
//当前导航项
|
|
12
|
-
|
|
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'
|
package/dist/AnchorUI/index.js
CHANGED
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const AnchorUI = props => {
|
|
5
|
+
const {
|
|
6
|
+
className,
|
|
7
|
+
anchoruiRef,
|
|
8
|
+
items,
|
|
9
|
+
anchorActive,
|
|
10
|
+
setAnchorActive
|
|
11
|
+
} = props;
|
|
16
12
|
// 当前聚焦id
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
+
const newItems = items.map(item => {
|
|
35
28
|
return {
|
|
36
29
|
key: item.key,
|
|
37
30
|
title: item.title,
|
|
38
|
-
href:
|
|
31
|
+
href: `#${item.key}`
|
|
39
32
|
};
|
|
40
33
|
});
|
|
41
34
|
return /*#__PURE__*/React.createElement(Anchor, {
|
|
42
|
-
className:
|
|
35
|
+
className: `anchoraUI ${className ?? ''}`,
|
|
43
36
|
items: newItems,
|
|
44
37
|
affix: false,
|
|
45
|
-
getContainer:
|
|
46
|
-
|
|
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;
|
package/dist/BackUI/index.js
CHANGED
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
to =
|
|
12
|
-
before
|
|
13
|
-
current
|
|
14
|
-
className
|
|
15
|
-
children
|
|
16
|
-
backClick
|
|
17
|
-
otherProps
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
21
|
+
className: `sic-backui ${className ?? ''}`
|
|
24
22
|
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
25
23
|
className: "sic-backui-button",
|
|
26
|
-
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
items =
|
|
9
|
-
width
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
}),
|
|
22
|
+
}), items?.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
23
23
|
className: "sicBroadcastui-content"
|
|
24
24
|
}, /*#__PURE__*/React.createElement(Carousel, {
|
|
25
|
-
autoplay:
|
|
25
|
+
autoplay: items?.length > 1,
|
|
26
26
|
dots: false,
|
|
27
27
|
dotPosition: "left",
|
|
28
28
|
autoplaySpeed: 5000,
|
|
29
29
|
adaptiveHeight: true
|
|
30
|
-
}, items.map(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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:
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
package/dist/ButtonUI/index.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
iconPosition =
|
|
12
|
-
otherProps
|
|
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);
|
package/dist/CellUI/index.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
line =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
21
|
+
const clientHeight = element.clientHeight;
|
|
32
22
|
// 获取元素的滚动高度
|
|
33
|
-
|
|
23
|
+
const scrollHeight = element.scrollHeight;
|
|
34
24
|
// 判断是否溢出
|
|
35
|
-
|
|
25
|
+
const isOverflowing = scrollHeight > clientHeight;
|
|
36
26
|
if (isOverflowing) {
|
|
37
27
|
setShowTooltip(isOverflowing);
|
|
38
28
|
}
|
|
39
29
|
}
|
|
40
30
|
}, [children]);
|
|
41
|
-
|
|
31
|
+
const cellStyle = {
|
|
42
32
|
'--cellLine': line
|
|
43
33
|
};
|
|
44
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
54
|
+
className: `sic-cellui ${className ?? ''}`,
|
|
67
55
|
style: style,
|
|
68
56
|
onClick: onClick
|
|
69
57
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|