gxxc-ui 1.0.0
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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/AmountCellUI/index.d.ts +11 -0
- package/dist/AmountCellUI/index.js +123 -0
- package/dist/AnchorUI/demo/anchor-button.d.ts +3 -0
- package/dist/AnchorUI/demo/anchor-button.js +85 -0
- package/dist/AnchorUI/demo/use-anchor.d.ts +3 -0
- package/dist/AnchorUI/demo/use-anchor.js +69 -0
- package/dist/AnchorUI/index.d.ts +4 -0
- package/dist/AnchorUI/index.js +56 -0
- package/dist/AnchorUI/index.scss +21 -0
- package/dist/BackUI/index.d.ts +14 -0
- package/dist/BackUI/index.js +35 -0
- package/dist/BackUI/index.scss +26 -0
- package/dist/BroadcastUI/index.d.ts +12 -0
- package/dist/BroadcastUI/index.js +62 -0
- package/dist/BroadcastUI/index.scss +43 -0
- package/dist/ButtonUI/index.d.ts +9 -0
- package/dist/ButtonUI/index.js +17 -0
- package/dist/ButtonUI/index.scss +6 -0
- package/dist/CellUI/index.d.ts +13 -0
- package/dist/CellUI/index.js +78 -0
- package/dist/CellUI/index.scss +28 -0
- package/dist/Components/index.d.ts +2 -0
- package/dist/Components/index.js +4 -0
- package/dist/DateUI/index.d.ts +5 -0
- package/dist/DateUI/index.js +116 -0
- package/dist/DateUI/index.scss +3 -0
- package/dist/DescriptionsUI/index.d.ts +19 -0
- package/dist/DescriptionsUI/index.js +72 -0
- package/dist/DescriptionsUI/index.scss +88 -0
- package/dist/EmptyUI/emptyImage.d.ts +3 -0
- package/dist/EmptyUI/emptyImage.js +12 -0
- package/dist/EmptyUI/index.d.ts +9 -0
- package/dist/EmptyUI/index.js +13 -0
- package/dist/EmptyUI/index.scss +10 -0
- package/dist/FilterUI/index.d.ts +28 -0
- package/dist/FilterUI/index.js +252 -0
- package/dist/FilterUI/index.scss +80 -0
- package/dist/FormUI/index.d.ts +4 -0
- package/dist/FormUI/index.js +45 -0
- package/dist/FormUI/index.scss +64 -0
- package/dist/IconUI/index.d.ts +27 -0
- package/dist/IconUI/index.js +22 -0
- package/dist/IconUI/material/dictionary.d.ts +4 -0
- package/dist/IconUI/material/dictionary.js +71 -0
- package/dist/IconUI/material/dictionary.scss +58 -0
- package/dist/IconUI/material/material.d.ts +16 -0
- package/dist/IconUI/material/material.js +476 -0
- package/dist/IconUI/material/rally.d.ts +22 -0
- package/dist/IconUI/material/rally.js +50 -0
- package/dist/ImageUI/index.d.ts +13 -0
- package/dist/ImageUI/index.js +159 -0
- package/dist/ImageUI/index.scss +59 -0
- package/dist/InputUI/index.d.ts +7 -0
- package/dist/InputUI/index.js +114 -0
- package/dist/InputUI/index.scss +24 -0
- package/dist/LoadingUI/index.d.ts +4 -0
- package/dist/LoadingUI/index.js +13 -0
- package/dist/LoadingUI/index.scss +47 -0
- package/dist/MessageUI/index.d.ts +3 -0
- package/dist/MessageUI/index.js +9 -0
- package/dist/MessageUI/index.scss +50 -0
- package/dist/ModalUI/index.d.ts +4 -0
- package/dist/ModalUI/index.js +98 -0
- package/dist/ModalUI/index.scss +45 -0
- package/dist/NotificationUI/index.d.ts +3 -0
- package/dist/NotificationUI/index.js +30 -0
- package/dist/NotificationUI/index.scss +0 -0
- package/dist/PasswordStrongUI/index.d.ts +8 -0
- package/dist/PasswordStrongUI/index.js +67 -0
- package/dist/PasswordStrongUI/index.scss +35 -0
- package/dist/RichEditorUI/index.d.ts +10 -0
- package/dist/RichEditorUI/index.js +68 -0
- package/dist/RichEditorUI/index.scss +20 -0
- package/dist/SearchUI/index.d.ts +4 -0
- package/dist/SearchUI/index.js +55 -0
- package/dist/SearchUI/index.scss +20 -0
- package/dist/SelectUI/index.d.ts +13 -0
- package/dist/SelectUI/index.js +87 -0
- package/dist/SelectUI/index.scss +13 -0
- package/dist/StatisticUI/index.d.ts +20 -0
- package/dist/StatisticUI/index.js +70 -0
- package/dist/StatisticUI/index.scss +6 -0
- package/dist/SwitchUI/index.d.ts +4 -0
- package/dist/SwitchUI/index.js +24 -0
- package/dist/SwitchUI/index.scss +0 -0
- package/dist/TableUI/demo/index.scss +7 -0
- package/dist/TableUI/demo/setting.d.ts +4 -0
- package/dist/TableUI/demo/setting.js +107 -0
- package/dist/TableUI/index.d.ts +12 -0
- package/dist/TableUI/index.js +109 -0
- package/dist/TableUI/index.scss +40 -0
- package/dist/TableUI/material/Button/index.d.ts +4 -0
- package/dist/TableUI/material/Button/index.js +20 -0
- package/dist/TableUI/material/Button/index.scss +35 -0
- package/dist/TableUI/material/HideMultipleLines/index.d.ts +4 -0
- package/dist/TableUI/material/HideMultipleLines/index.js +48 -0
- package/dist/TableUI/material/HideMultipleLines/index.scss +11 -0
- package/dist/TableUI/material/MultiLine/index.d.ts +4 -0
- package/dist/TableUI/material/MultiLine/index.js +23 -0
- package/dist/TableUI/material/MultiLine/index.scss +25 -0
- package/dist/TableUI/material/Operate/index.d.ts +3 -0
- package/dist/TableUI/material/Operate/index.js +43 -0
- package/dist/TableUI/material/Operate/index.scss +25 -0
- package/dist/TableUI/material/Setting/index.d.ts +3 -0
- package/dist/TableUI/material/Setting/index.js +211 -0
- package/dist/TableUI/material/Setting/index.scss +52 -0
- package/dist/TagUI/index.d.ts +17 -0
- package/dist/TagUI/index.js +118 -0
- package/dist/TagUI/index.scss +41 -0
- package/dist/TestUI/index.d.ts +3 -0
- package/dist/TestUI/index.js +5 -0
- package/dist/TestUI/index.scss +0 -0
- package/dist/TextUI/index.d.ts +7 -0
- package/dist/TextUI/index.js +17 -0
- package/dist/TextUI/index.scss +10 -0
- package/dist/Tiga/demo/demoQuick.d.ts +3 -0
- package/dist/Tiga/demo/demoQuick.js +104 -0
- package/dist/Tiga/demo/demoQuickType.d.ts +8 -0
- package/dist/Tiga/demo/demoQuickType.js +94 -0
- package/dist/Tiga/index.d.ts +4 -0
- package/dist/Tiga/index.js +68 -0
- package/dist/Tiga/index.scss +0 -0
- package/dist/Tiga/material/quickType.d.ts +29 -0
- package/dist/Tiga/material/quickType.js +75 -0
- package/dist/UploadUI/index.d.ts +23 -0
- package/dist/UploadUI/index.js +383 -0
- package/dist/UploadUI/index.scss +202 -0
- package/dist/UploadUI/type.d.ts +4 -0
- package/dist/UploadUI/type.js +30 -0
- package/dist/VesselUI/index.d.ts +3 -0
- package/dist/VesselUI/index.js +199 -0
- package/dist/VesselUI/type.d.ts +64 -0
- package/dist/VesselUI/type.js +1 -0
- package/dist/VideoPreviewUI/index.d.ts +11 -0
- package/dist/VideoPreviewUI/index.js +65 -0
- package/dist/VideoPreviewUI/index.scss +32 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +34 -0
- package/package.json +87 -0
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import React, { useEffect } from 'react';
|
|
8
|
+
import { notification } from 'antd';
|
|
9
|
+
var NotificationUI = function NotificationUI(props) {
|
|
10
|
+
var _notification$useNoti = notification.useNotification(),
|
|
11
|
+
_notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
|
|
12
|
+
api = _notification$useNoti2[0],
|
|
13
|
+
contextHolder = _notification$useNoti2[1];
|
|
14
|
+
var notmsg = props.notmsg,
|
|
15
|
+
_props$placement = props.placement,
|
|
16
|
+
placement = _props$placement === void 0 ? 'topRight' : _props$placement;
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
if (notmsg !== null && notmsg !== void 0 && notmsg.type) {
|
|
19
|
+
var _notmsg$message;
|
|
20
|
+
api[notmsg.type]({
|
|
21
|
+
description: notmsg === null || notmsg === void 0 ? void 0 : notmsg.description,
|
|
22
|
+
message: (_notmsg$message = notmsg === null || notmsg === void 0 ? void 0 : notmsg.message) !== null && _notmsg$message !== void 0 ? _notmsg$message : '系统提示',
|
|
23
|
+
duration: 2,
|
|
24
|
+
placement: placement
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}, [notmsg]);
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, contextHolder);
|
|
29
|
+
};
|
|
30
|
+
export default NotificationUI;
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./index.scss";
|
|
3
|
+
var PassStrong = [{
|
|
4
|
+
level: 0,
|
|
5
|
+
text: ''
|
|
6
|
+
}, {
|
|
7
|
+
level: 1,
|
|
8
|
+
text: '弱'
|
|
9
|
+
}, {
|
|
10
|
+
level: 2,
|
|
11
|
+
text: '中'
|
|
12
|
+
}, {
|
|
13
|
+
level: 3,
|
|
14
|
+
text: '强'
|
|
15
|
+
}];
|
|
16
|
+
var getLevel = function getLevel(str) {
|
|
17
|
+
var level = 0;
|
|
18
|
+
if (/\d/.test(str)) {
|
|
19
|
+
level = level + 1;
|
|
20
|
+
}
|
|
21
|
+
if (/[a-zA-Z]/.test(str)) {
|
|
22
|
+
level = level + 1;
|
|
23
|
+
}
|
|
24
|
+
if (/[^a-zA-Z0-9\s]/.test(str)) {
|
|
25
|
+
level = level + 1;
|
|
26
|
+
}
|
|
27
|
+
return level;
|
|
28
|
+
};
|
|
29
|
+
var StrongCheck = function StrongCheck(value) {
|
|
30
|
+
var _PassStrong$filter;
|
|
31
|
+
var current = PassStrong === null || PassStrong === void 0 || (_PassStrong$filter = PassStrong.filter(function (item) {
|
|
32
|
+
return (item === null || item === void 0 ? void 0 : item.level) === getLevel(value);
|
|
33
|
+
})) === null || _PassStrong$filter === void 0 ? void 0 : _PassStrong$filter[0];
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "sic-passwordStrongui-check"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: "bar"
|
|
38
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "one",
|
|
40
|
+
style: {
|
|
41
|
+
backgroundColor: (current === null || current === void 0 ? void 0 : current.level) >= 1 ? '#FAD39A' : '#f0f0f0'
|
|
42
|
+
}
|
|
43
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "two",
|
|
45
|
+
style: {
|
|
46
|
+
backgroundColor: (current === null || current === void 0 ? void 0 : current.level) >= 2 ? '#A6E29D' : '#f0f0f0'
|
|
47
|
+
}
|
|
48
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: "three",
|
|
50
|
+
style: {
|
|
51
|
+
backgroundColor: (current === null || current === void 0 ? void 0 : current.level) === 3 ? '#1EAF69' : '#f0f0f0'
|
|
52
|
+
}
|
|
53
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "text"
|
|
55
|
+
}, current === null || current === void 0 ? void 0 : current.text));
|
|
56
|
+
};
|
|
57
|
+
var PasswordStrongUI = function PasswordStrongUI(props) {
|
|
58
|
+
var value = props.value,
|
|
59
|
+
style = props.style;
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "sic-passwordStrongui",
|
|
62
|
+
style: style
|
|
63
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: "line1"
|
|
65
|
+
}, "\u5BC6\u7801\u5F3A\u5EA6\uFF1A", StrongCheck(value)), /*#__PURE__*/React.createElement("div", null, "\u5BC6\u7801\u5F3A\u5EA68\uFF5E32\u4F4D\uFF0C\u5305\u542B\u6570\u5B57\u3001\u5927/\u5C0F\u5199\u5B57\u6BCD\u3001\u7279\u6B8A\u5B57\u7B26\u3002"));
|
|
66
|
+
};
|
|
67
|
+
export default PasswordStrongUI;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.sic-passwordStrongui {
|
|
2
|
+
color: #7e7e7e;
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
.line1 {
|
|
5
|
+
display: flex;
|
|
6
|
+
margin-bottom: 2px;
|
|
7
|
+
}
|
|
8
|
+
&-check {
|
|
9
|
+
display: flex;
|
|
10
|
+
color: #333;
|
|
11
|
+
.bar {
|
|
12
|
+
display: flex;
|
|
13
|
+
margin-right: 4px;
|
|
14
|
+
padding-top: 4px;
|
|
15
|
+
.one {
|
|
16
|
+
width: 60px;
|
|
17
|
+
height: 10px;
|
|
18
|
+
border-top-left-radius: 10px;
|
|
19
|
+
border-bottom-left-radius: 10px;
|
|
20
|
+
margin-right: 0.2rem;
|
|
21
|
+
}
|
|
22
|
+
.two {
|
|
23
|
+
width: 60px;
|
|
24
|
+
height: 10px;
|
|
25
|
+
margin-right: 0.2rem;
|
|
26
|
+
}
|
|
27
|
+
.three {
|
|
28
|
+
width: 60px;
|
|
29
|
+
height: 10px;
|
|
30
|
+
border-top-right-radius: 10px;
|
|
31
|
+
border-bottom-right-radius: 10px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '@wangeditor/editor/dist/css/style.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
interface RichEditorProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (html: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const RichEditorUI: (props: RichEditorProps) => React.JSX.Element;
|
|
10
|
+
export default RichEditorUI;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
import { Editor, Toolbar } from '@wangeditor/editor-for-react';
|
|
8
|
+
import '@wangeditor/editor/dist/css/style.css';
|
|
9
|
+
import React, { useEffect, useState } from 'react';
|
|
10
|
+
import "./index.scss";
|
|
11
|
+
|
|
12
|
+
// 定义组件属性接口
|
|
13
|
+
|
|
14
|
+
var RichEditorUI = function RichEditorUI(props) {
|
|
15
|
+
var value = props.value,
|
|
16
|
+
onChange = props.onChange,
|
|
17
|
+
_props$placeholder = props.placeholder,
|
|
18
|
+
placeholder = _props$placeholder === void 0 ? '请输入内容...' : _props$placeholder;
|
|
19
|
+
|
|
20
|
+
// editor 实例
|
|
21
|
+
var _useState = useState(null),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
editor = _useState2[0],
|
|
24
|
+
setEditor = _useState2[1];
|
|
25
|
+
// 编辑器内容
|
|
26
|
+
var _useState3 = useState(),
|
|
27
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
28
|
+
html = _useState4[0],
|
|
29
|
+
setHtml = _useState4[1];
|
|
30
|
+
|
|
31
|
+
// 编辑器配置
|
|
32
|
+
var editorConfig = {
|
|
33
|
+
placeholder: placeholder,
|
|
34
|
+
autoFocus: false
|
|
35
|
+
};
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
setHtml(value);
|
|
38
|
+
}, [value]);
|
|
39
|
+
// 组件销毁时,销毁编辑器实例
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
return function () {
|
|
42
|
+
if (editor === null) return;
|
|
43
|
+
editor.destroy();
|
|
44
|
+
setEditor(null);
|
|
45
|
+
};
|
|
46
|
+
}, [editor]);
|
|
47
|
+
var onChangeEditor = function onChangeEditor(editor) {
|
|
48
|
+
if (onChange && html !== editor.getHtml()) {
|
|
49
|
+
setHtml(editor.getHtml());
|
|
50
|
+
onChange(editor.getHtml());
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "richEditorUI"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
56
|
+
className: "richEditorUI-toolbar",
|
|
57
|
+
editor: editor,
|
|
58
|
+
mode: "default"
|
|
59
|
+
}), /*#__PURE__*/React.createElement(Editor, {
|
|
60
|
+
className: "richEditorUI-editor",
|
|
61
|
+
defaultConfig: editorConfig,
|
|
62
|
+
value: html,
|
|
63
|
+
onCreated: setEditor,
|
|
64
|
+
onChange: onChangeEditor,
|
|
65
|
+
mode: "default"
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
export default RichEditorUI;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.richEditorUI {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
border: 1px solid #d9d9d9;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
transition: all 0.3s;
|
|
8
|
+
&:hover {
|
|
9
|
+
border-color: var(--themeColor);
|
|
10
|
+
box-shadow: 0 0 0 2px var(--themeColor2);
|
|
11
|
+
}
|
|
12
|
+
&-toolbar {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
padding: 8px;
|
|
15
|
+
border-bottom: 1px solid #d9d9d9;
|
|
16
|
+
}
|
|
17
|
+
&-editor .w-e-scroll > div {
|
|
18
|
+
min-height: 300px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
import { Flex, Input } from 'antd';
|
|
8
|
+
import React, { useEffect, useState } from 'react';
|
|
9
|
+
import { IconUI } from "./..";
|
|
10
|
+
import "./index.scss";
|
|
11
|
+
// 搜索框
|
|
12
|
+
var timer;
|
|
13
|
+
var SearchUI = function SearchUI(props) {
|
|
14
|
+
var value = props.value,
|
|
15
|
+
placeholder = props.placeholder,
|
|
16
|
+
onChange = props.onChange;
|
|
17
|
+
var _useState = useState(),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
searchValue = _useState2[0],
|
|
20
|
+
setSearchValue = _useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
setSearchValue(value);
|
|
23
|
+
return function () {
|
|
24
|
+
clearTimeout(timer);
|
|
25
|
+
};
|
|
26
|
+
}, [value]);
|
|
27
|
+
var valueChange = function valueChange(e) {
|
|
28
|
+
if ((e === null || e === void 0 ? void 0 : e.type) === 'change' || (e === null || e === void 0 ? void 0 : e.type) === 'compositionend') {
|
|
29
|
+
setSearchValue(e.target.value);
|
|
30
|
+
clearTimeout(timer);
|
|
31
|
+
timer = setTimeout(function () {
|
|
32
|
+
onChange(e.target.value.trim());
|
|
33
|
+
}, 500);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(Input.Search, {
|
|
37
|
+
value: searchValue,
|
|
38
|
+
className: "sic-searchui",
|
|
39
|
+
onChange: function onChange(e) {
|
|
40
|
+
return valueChange(e);
|
|
41
|
+
},
|
|
42
|
+
allowClear: true,
|
|
43
|
+
onSearch: function onSearch(e) {
|
|
44
|
+
return onChange(e.trim());
|
|
45
|
+
},
|
|
46
|
+
placeholder: placeholder,
|
|
47
|
+
enterButton: /*#__PURE__*/React.createElement(Flex, {
|
|
48
|
+
align: "center",
|
|
49
|
+
gap: 4
|
|
50
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
51
|
+
name: "Search"
|
|
52
|
+
}), /*#__PURE__*/React.createElement("div", null, "\u641C\u7D22"))
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export default SearchUI;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.sic-searchui {
|
|
2
|
+
font-size: 13px;
|
|
3
|
+
width: 320px;
|
|
4
|
+
.ant-input-search-button {
|
|
5
|
+
padding: 0 8px;
|
|
6
|
+
}
|
|
7
|
+
.ant-input-group-addon {
|
|
8
|
+
.ant-btn-variant-solid {
|
|
9
|
+
color: var(--themeColor);
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
border: 1px solid #d9d9d9;
|
|
12
|
+
box-shadow: none;
|
|
13
|
+
}
|
|
14
|
+
.ant-btn-variant-solid:hover {
|
|
15
|
+
color: var(--themeColor);
|
|
16
|
+
background-color: #fff;
|
|
17
|
+
border: 1px solid var(--themeColor);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
/**
|
|
4
|
+
* @description: 下拉框
|
|
5
|
+
* @param {boolean} showSearch 是否显示搜索
|
|
6
|
+
* @param {boolean} allowClear 是否显示清除
|
|
7
|
+
* @param {Function} filterOption 过滤条件
|
|
8
|
+
* @param {Function} filterSort 排序条件
|
|
9
|
+
* @param {Function} fieldNames 自定义字段
|
|
10
|
+
* @return {*}
|
|
11
|
+
*/
|
|
12
|
+
declare const SelectUI: (props: any) => React.JSX.Element;
|
|
13
|
+
export default SelectUI;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var _excluded = ["options", "filterOption", "filterSort", "fieldNames", "onChange", "value", "copy"];
|
|
2
|
+
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
import { Select } from 'antd';
|
|
12
|
+
import React, { useEffect, useState } from 'react';
|
|
13
|
+
import { IconUI, MessageUI } from "./..";
|
|
14
|
+
import "./index.scss";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description: 下拉框
|
|
18
|
+
* @param {boolean} showSearch 是否显示搜索
|
|
19
|
+
* @param {boolean} allowClear 是否显示清除
|
|
20
|
+
* @param {Function} filterOption 过滤条件
|
|
21
|
+
* @param {Function} filterSort 排序条件
|
|
22
|
+
* @param {Function} fieldNames 自定义字段
|
|
23
|
+
* @return {*}
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var SelectUI = function SelectUI(props) {
|
|
27
|
+
var _props$options = props.options,
|
|
28
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
29
|
+
filterOption = props.filterOption,
|
|
30
|
+
filterSort = props.filterSort,
|
|
31
|
+
fieldNames = props.fieldNames,
|
|
32
|
+
onChange = props.onChange,
|
|
33
|
+
value = props.value,
|
|
34
|
+
_props$copy = props.copy,
|
|
35
|
+
copy = _props$copy === void 0 ? false : _props$copy,
|
|
36
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
37
|
+
var _useState = useState(value),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
selecValue = _useState2[0],
|
|
40
|
+
setSelecValue = _useState2[1];
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
setSelecValue(value);
|
|
43
|
+
}, [value]);
|
|
44
|
+
var defaultFilterOption = function defaultFilterOption(input, option) {
|
|
45
|
+
var label = fieldNames !== null && fieldNames !== void 0 && fieldNames.label ? option === null || option === void 0 ? void 0 : option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label].toString() : option === null || option === void 0 ? void 0 : option.label.toString();
|
|
46
|
+
return label.includes(input);
|
|
47
|
+
};
|
|
48
|
+
var defaultFilterSort = function defaultFilterSort(optionA, optionB) {
|
|
49
|
+
var labelA = fieldNames !== null && fieldNames !== void 0 && fieldNames.label ? optionA === null || optionA === void 0 ? void 0 : optionA[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label].toString().toLowerCase() : optionA === null || optionA === void 0 ? void 0 : optionA.label.toString().toLowerCase();
|
|
50
|
+
var labelB = fieldNames !== null && fieldNames !== void 0 && fieldNames.label ? optionB === null || optionB === void 0 ? void 0 : optionB[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label].toString().toLowerCase() : optionB === null || optionB === void 0 ? void 0 : optionB.label.toString().toLowerCase();
|
|
51
|
+
return labelA.localeCompare(labelB);
|
|
52
|
+
};
|
|
53
|
+
var clickCopy = function clickCopy() {
|
|
54
|
+
var _options$find$label, _options$find;
|
|
55
|
+
var labelValue = (_options$find$label = options === null || options === void 0 || (_options$find = options.find(function (item) {
|
|
56
|
+
return (item === null || item === void 0 ? void 0 : item.value) === selecValue;
|
|
57
|
+
})) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : '';
|
|
58
|
+
try {
|
|
59
|
+
navigator.clipboard.writeText(labelValue);
|
|
60
|
+
MessageUI.info('文本已复制到剪贴板');
|
|
61
|
+
} catch (err) {
|
|
62
|
+
MessageUI.error('复制失败');
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var changeSelect = function changeSelect(value, option) {
|
|
66
|
+
setSelecValue(value);
|
|
67
|
+
if (onChange) onChange(value, option);
|
|
68
|
+
};
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "selectUI"
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
72
|
+
value: selecValue,
|
|
73
|
+
options: options,
|
|
74
|
+
showSearch: true,
|
|
75
|
+
allowClear: true,
|
|
76
|
+
optionFilterProp: "label",
|
|
77
|
+
filterOption: filterOption !== null && filterOption !== void 0 ? filterOption : defaultFilterOption,
|
|
78
|
+
filterSort: filterSort !== null && filterSort !== void 0 ? filterSort : defaultFilterSort,
|
|
79
|
+
fieldNames: fieldNames,
|
|
80
|
+
onChange: changeSelect
|
|
81
|
+
}, otherProps)), copy && /*#__PURE__*/React.createElement(IconUI, {
|
|
82
|
+
className: "selectUI-copy",
|
|
83
|
+
name: "CopyOne",
|
|
84
|
+
onClick: clickCopy
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
87
|
+
export default SelectUI;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface ItemsType {
|
|
4
|
+
id: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: number | string;
|
|
7
|
+
type?: number | string | 'primary';
|
|
8
|
+
colon?: boolean;
|
|
9
|
+
suffix?: string;
|
|
10
|
+
decimals?: number;
|
|
11
|
+
separator?: string;
|
|
12
|
+
rawValue?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface PropsType {
|
|
15
|
+
className?: string;
|
|
16
|
+
duration?: number;
|
|
17
|
+
items: ItemsType[];
|
|
18
|
+
}
|
|
19
|
+
export default function StatisticUI(props: PropsType): React.JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import lodash from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import CountUp from 'react-countup';
|
|
4
|
+
import { TagUI } from "./..";
|
|
5
|
+
import "./index.scss";
|
|
6
|
+
// 统计数值组件
|
|
7
|
+
export default function StatisticUI(props) {
|
|
8
|
+
var className = props.className,
|
|
9
|
+
_props$duration = props.duration,
|
|
10
|
+
duration = _props$duration === void 0 ? 2 : _props$duration,
|
|
11
|
+
items = props.items;
|
|
12
|
+
var getDecimalsIfNumber = function getDecimalsIfNumber(value) {
|
|
13
|
+
if (value === null || value === undefined) {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
var num = null;
|
|
17
|
+
var str = '';
|
|
18
|
+
if (lodash.isString(value)) {
|
|
19
|
+
str = value.trim();
|
|
20
|
+
// 支持科学计数法、正负号等
|
|
21
|
+
if (!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(str)) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
num = Number(str);
|
|
25
|
+
} else if (lodash.isNumber(value)) {
|
|
26
|
+
str = value.toString();
|
|
27
|
+
num = value;
|
|
28
|
+
} else {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
if (!lodash.isFinite(num)) {
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 处理原始字符串来获取小数位数,避免 toFixed 导致精度丢失
|
|
36
|
+
var decimalIndex = str.indexOf('.');
|
|
37
|
+
if (decimalIndex === -1) {
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
var fractionalPart = str.slice(decimalIndex + 1).replace(/[^0-9]/g, '');
|
|
41
|
+
return fractionalPart.length;
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "statisticUI ".concat(className !== null && className !== void 0 ? className : '')
|
|
45
|
+
}, !lodash.isEmpty(items) && items.map(function (item) {
|
|
46
|
+
var id = item.id,
|
|
47
|
+
label = item.label,
|
|
48
|
+
value = item.value,
|
|
49
|
+
type = item.type,
|
|
50
|
+
_item$colon = item.colon,
|
|
51
|
+
colon = _item$colon === void 0 ? true : _item$colon,
|
|
52
|
+
suffix = item.suffix,
|
|
53
|
+
decimals = item.decimals,
|
|
54
|
+
_item$separator = item.separator,
|
|
55
|
+
separator = _item$separator === void 0 ? '' : _item$separator,
|
|
56
|
+
_item$rawValue = item.rawValue,
|
|
57
|
+
rawValue = _item$rawValue === void 0 ? false : _item$rawValue;
|
|
58
|
+
return /*#__PURE__*/React.createElement(TagUI, {
|
|
59
|
+
size: "large",
|
|
60
|
+
type: type,
|
|
61
|
+
key: id
|
|
62
|
+
}, label + (colon ? ':' : ''), rawValue ? value : /*#__PURE__*/React.createElement(CountUp, {
|
|
63
|
+
end: Number(value),
|
|
64
|
+
decimals: decimals !== null && decimals !== void 0 ? decimals : getDecimalsIfNumber(value),
|
|
65
|
+
suffix: suffix,
|
|
66
|
+
separator: separator,
|
|
67
|
+
duration: duration
|
|
68
|
+
}));
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _excluded = ["value", "onChange", "onClick"];
|
|
2
|
+
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
|
+
import React from 'react';
|
|
6
|
+
import { Switch } from 'antd';
|
|
7
|
+
import "./index.scss";
|
|
8
|
+
var SwitchUI = function SwitchUI(props) {
|
|
9
|
+
var value = props.value,
|
|
10
|
+
onChange = props.onChange,
|
|
11
|
+
onClick = props.onClick,
|
|
12
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
13
|
+
var checkChange = function checkChange(e) {
|
|
14
|
+
if (onChange) {
|
|
15
|
+
onChange(e === true ? 1 : 2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Switch, _extends({
|
|
19
|
+
checked: value === 1 ? true : false,
|
|
20
|
+
onClick: onClick,
|
|
21
|
+
onChange: checkChange
|
|
22
|
+
}, otherProps)));
|
|
23
|
+
};
|
|
24
|
+
export default SwitchUI;
|
|
File without changes
|