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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/dist/AmountCellUI/index.d.ts +11 -0
  4. package/dist/AmountCellUI/index.js +123 -0
  5. package/dist/AnchorUI/demo/anchor-button.d.ts +3 -0
  6. package/dist/AnchorUI/demo/anchor-button.js +85 -0
  7. package/dist/AnchorUI/demo/use-anchor.d.ts +3 -0
  8. package/dist/AnchorUI/demo/use-anchor.js +69 -0
  9. package/dist/AnchorUI/index.d.ts +4 -0
  10. package/dist/AnchorUI/index.js +56 -0
  11. package/dist/AnchorUI/index.scss +21 -0
  12. package/dist/BackUI/index.d.ts +14 -0
  13. package/dist/BackUI/index.js +35 -0
  14. package/dist/BackUI/index.scss +26 -0
  15. package/dist/BroadcastUI/index.d.ts +12 -0
  16. package/dist/BroadcastUI/index.js +62 -0
  17. package/dist/BroadcastUI/index.scss +43 -0
  18. package/dist/ButtonUI/index.d.ts +9 -0
  19. package/dist/ButtonUI/index.js +17 -0
  20. package/dist/ButtonUI/index.scss +6 -0
  21. package/dist/CellUI/index.d.ts +13 -0
  22. package/dist/CellUI/index.js +78 -0
  23. package/dist/CellUI/index.scss +28 -0
  24. package/dist/Components/index.d.ts +2 -0
  25. package/dist/Components/index.js +4 -0
  26. package/dist/DateUI/index.d.ts +5 -0
  27. package/dist/DateUI/index.js +116 -0
  28. package/dist/DateUI/index.scss +3 -0
  29. package/dist/DescriptionsUI/index.d.ts +19 -0
  30. package/dist/DescriptionsUI/index.js +72 -0
  31. package/dist/DescriptionsUI/index.scss +88 -0
  32. package/dist/EmptyUI/emptyImage.d.ts +3 -0
  33. package/dist/EmptyUI/emptyImage.js +12 -0
  34. package/dist/EmptyUI/index.d.ts +9 -0
  35. package/dist/EmptyUI/index.js +13 -0
  36. package/dist/EmptyUI/index.scss +10 -0
  37. package/dist/FilterUI/index.d.ts +28 -0
  38. package/dist/FilterUI/index.js +252 -0
  39. package/dist/FilterUI/index.scss +80 -0
  40. package/dist/FormUI/index.d.ts +4 -0
  41. package/dist/FormUI/index.js +45 -0
  42. package/dist/FormUI/index.scss +64 -0
  43. package/dist/IconUI/index.d.ts +27 -0
  44. package/dist/IconUI/index.js +22 -0
  45. package/dist/IconUI/material/dictionary.d.ts +4 -0
  46. package/dist/IconUI/material/dictionary.js +71 -0
  47. package/dist/IconUI/material/dictionary.scss +58 -0
  48. package/dist/IconUI/material/material.d.ts +16 -0
  49. package/dist/IconUI/material/material.js +476 -0
  50. package/dist/IconUI/material/rally.d.ts +22 -0
  51. package/dist/IconUI/material/rally.js +50 -0
  52. package/dist/ImageUI/index.d.ts +13 -0
  53. package/dist/ImageUI/index.js +159 -0
  54. package/dist/ImageUI/index.scss +59 -0
  55. package/dist/InputUI/index.d.ts +7 -0
  56. package/dist/InputUI/index.js +114 -0
  57. package/dist/InputUI/index.scss +24 -0
  58. package/dist/LoadingUI/index.d.ts +4 -0
  59. package/dist/LoadingUI/index.js +13 -0
  60. package/dist/LoadingUI/index.scss +47 -0
  61. package/dist/MessageUI/index.d.ts +3 -0
  62. package/dist/MessageUI/index.js +9 -0
  63. package/dist/MessageUI/index.scss +50 -0
  64. package/dist/ModalUI/index.d.ts +4 -0
  65. package/dist/ModalUI/index.js +98 -0
  66. package/dist/ModalUI/index.scss +45 -0
  67. package/dist/NotificationUI/index.d.ts +3 -0
  68. package/dist/NotificationUI/index.js +30 -0
  69. package/dist/NotificationUI/index.scss +0 -0
  70. package/dist/PasswordStrongUI/index.d.ts +8 -0
  71. package/dist/PasswordStrongUI/index.js +67 -0
  72. package/dist/PasswordStrongUI/index.scss +35 -0
  73. package/dist/RichEditorUI/index.d.ts +10 -0
  74. package/dist/RichEditorUI/index.js +68 -0
  75. package/dist/RichEditorUI/index.scss +20 -0
  76. package/dist/SearchUI/index.d.ts +4 -0
  77. package/dist/SearchUI/index.js +55 -0
  78. package/dist/SearchUI/index.scss +20 -0
  79. package/dist/SelectUI/index.d.ts +13 -0
  80. package/dist/SelectUI/index.js +87 -0
  81. package/dist/SelectUI/index.scss +13 -0
  82. package/dist/StatisticUI/index.d.ts +20 -0
  83. package/dist/StatisticUI/index.js +70 -0
  84. package/dist/StatisticUI/index.scss +6 -0
  85. package/dist/SwitchUI/index.d.ts +4 -0
  86. package/dist/SwitchUI/index.js +24 -0
  87. package/dist/SwitchUI/index.scss +0 -0
  88. package/dist/TableUI/demo/index.scss +7 -0
  89. package/dist/TableUI/demo/setting.d.ts +4 -0
  90. package/dist/TableUI/demo/setting.js +107 -0
  91. package/dist/TableUI/index.d.ts +12 -0
  92. package/dist/TableUI/index.js +109 -0
  93. package/dist/TableUI/index.scss +40 -0
  94. package/dist/TableUI/material/Button/index.d.ts +4 -0
  95. package/dist/TableUI/material/Button/index.js +20 -0
  96. package/dist/TableUI/material/Button/index.scss +35 -0
  97. package/dist/TableUI/material/HideMultipleLines/index.d.ts +4 -0
  98. package/dist/TableUI/material/HideMultipleLines/index.js +48 -0
  99. package/dist/TableUI/material/HideMultipleLines/index.scss +11 -0
  100. package/dist/TableUI/material/MultiLine/index.d.ts +4 -0
  101. package/dist/TableUI/material/MultiLine/index.js +23 -0
  102. package/dist/TableUI/material/MultiLine/index.scss +25 -0
  103. package/dist/TableUI/material/Operate/index.d.ts +3 -0
  104. package/dist/TableUI/material/Operate/index.js +43 -0
  105. package/dist/TableUI/material/Operate/index.scss +25 -0
  106. package/dist/TableUI/material/Setting/index.d.ts +3 -0
  107. package/dist/TableUI/material/Setting/index.js +211 -0
  108. package/dist/TableUI/material/Setting/index.scss +52 -0
  109. package/dist/TagUI/index.d.ts +17 -0
  110. package/dist/TagUI/index.js +118 -0
  111. package/dist/TagUI/index.scss +41 -0
  112. package/dist/TestUI/index.d.ts +3 -0
  113. package/dist/TestUI/index.js +5 -0
  114. package/dist/TestUI/index.scss +0 -0
  115. package/dist/TextUI/index.d.ts +7 -0
  116. package/dist/TextUI/index.js +17 -0
  117. package/dist/TextUI/index.scss +10 -0
  118. package/dist/Tiga/demo/demoQuick.d.ts +3 -0
  119. package/dist/Tiga/demo/demoQuick.js +104 -0
  120. package/dist/Tiga/demo/demoQuickType.d.ts +8 -0
  121. package/dist/Tiga/demo/demoQuickType.js +94 -0
  122. package/dist/Tiga/index.d.ts +4 -0
  123. package/dist/Tiga/index.js +68 -0
  124. package/dist/Tiga/index.scss +0 -0
  125. package/dist/Tiga/material/quickType.d.ts +29 -0
  126. package/dist/Tiga/material/quickType.js +75 -0
  127. package/dist/UploadUI/index.d.ts +23 -0
  128. package/dist/UploadUI/index.js +383 -0
  129. package/dist/UploadUI/index.scss +202 -0
  130. package/dist/UploadUI/type.d.ts +4 -0
  131. package/dist/UploadUI/type.js +30 -0
  132. package/dist/VesselUI/index.d.ts +3 -0
  133. package/dist/VesselUI/index.js +199 -0
  134. package/dist/VesselUI/type.d.ts +64 -0
  135. package/dist/VesselUI/type.js +1 -0
  136. package/dist/VideoPreviewUI/index.d.ts +11 -0
  137. package/dist/VideoPreviewUI/index.js +65 -0
  138. package/dist/VideoPreviewUI/index.scss +32 -0
  139. package/dist/assets/index.d.ts +1 -0
  140. package/dist/assets/index.js +1 -0
  141. package/dist/index.d.ts +34 -0
  142. package/dist/index.js +34 -0
  143. 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,8 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface IProps {
4
+ value: string;
5
+ style?: any;
6
+ }
7
+ declare const PasswordStrongUI: (props: IProps) => React.JSX.Element;
8
+ export default PasswordStrongUI;
@@ -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,4 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const SearchUI: (props: any) => React.JSX.Element;
4
+ export default SearchUI;
@@ -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,13 @@
1
+ .selectUI {
2
+ width: 100%;
3
+ display: flex;
4
+ align-items: center;
5
+ gap: 4px;
6
+ .ant-select {
7
+ flex: 1;
8
+ }
9
+ &-copy {
10
+ color: var(--themeColor);
11
+ cursor: pointer;
12
+ }
13
+ }
@@ -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,6 @@
1
+ .statisticUI {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+ gap: 12px;
6
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const SwitchUI: (props: any) => React.JSX.Element;
4
+ export default SwitchUI;
@@ -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
@@ -0,0 +1,7 @@
1
+ .demo-setting {
2
+ &-operate {
3
+ display: flex;
4
+ justify-content: space-between;
5
+ margin-bottom: 10px;
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const DemoSetting: () => React.JSX.Element;
4
+ export default DemoSetting;