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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ <a href="https://sic-web.github.io/sic-ui/" target="_blank">
2
+ <img height="180" src="https://testfile.stlg.com.cn/public_image/83fd6378a13df21f2c3caa160ba62565/单logo(2).png">
3
+ </a>
4
+
5
+ <h1>sic ui</h1>
6
+
7
+ [![NPM version](https://img.shields.io/npm/v/sic-ui.svg?style=flat)](https://npmjs.org/package/sic-ui)
8
+ [![NPM downloads](http://img.shields.io/npm/dm/sic-ui.svg?style=flat)](https://npmjs.org/package/sic-ui)
9
+
10
+ ## Usage
11
+
12
+ https://sic-web.github.io/sic-ui/
13
+
14
+ ## Development
15
+
16
+ ```bash
17
+ # install dependencies
18
+ $ npm install
19
+
20
+ # develop library by docs demo
21
+ $ npm start
22
+
23
+ # build library source code
24
+ $ npm run build
25
+
26
+ # build library source code in watch mode
27
+ $ npm run build:watch
28
+
29
+ # build docs
30
+ $ npm run docs:build
31
+
32
+ # Locally preview the production build.
33
+ $ npm run docs:preview
34
+
35
+ # check your project for potential problems
36
+ $ npm run doctor
37
+ ```
38
+
39
+ ## LICENSE
40
+
41
+ MIT
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface PropsType extends React.HTMLAttributes<HTMLDivElement> {
3
+ className?: string;
4
+ children?: string | number;
5
+ animation?: boolean;
6
+ rawValue?: boolean;
7
+ forceRender?: boolean;
8
+ separator?: string;
9
+ }
10
+ export default function AmountCellUI(props: PropsType): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,123 @@
1
+ var _excluded = ["className", "children", "animation", "rawValue", "forceRender", "separator"];
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 { Tooltip } from 'antd';
6
+ import lodash from 'lodash';
7
+ import React from 'react';
8
+ import CountUp from 'react-countup';
9
+ import { num_expand } from 'sic-util';
10
+ export default function AmountCellUI(props) {
11
+ var className = props.className,
12
+ children = props.children,
13
+ _props$animation = props.animation,
14
+ animation = _props$animation === void 0 ? false : _props$animation,
15
+ _props$rawValue = props.rawValue,
16
+ rawValue = _props$rawValue === void 0 ? false : _props$rawValue,
17
+ _props$forceRender = props.forceRender,
18
+ forceRender = _props$forceRender === void 0 ? false : _props$forceRender,
19
+ _props$separator = props.separator,
20
+ separator = _props$separator === void 0 ? '' : _props$separator,
21
+ otherProps = _objectWithoutProperties(props, _excluded);
22
+
23
+ /**
24
+ * 判断传入值是否为合法数字(包括字符串形式的数字)
25
+ */
26
+ var isNumeric = function isNumeric(value) {
27
+ if (value === null || value === undefined) return false;
28
+ var num;
29
+ if (lodash.isString(value)) {
30
+ var trimmed = value.trim();
31
+ if (!/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(trimmed)) return false;
32
+ num = Number(trimmed);
33
+ } else if (lodash.isNumber(value)) {
34
+ num = value;
35
+ } else {
36
+ return false;
37
+ }
38
+ return lodash.isFinite(num);
39
+ };
40
+
41
+ /**
42
+ * 将传入值转换为有限数字,失败返回 null
43
+ */
44
+ var toFiniteNumber = function toFiniteNumber(value) {
45
+ if (isNumeric(value)) {
46
+ return Number(value);
47
+ }
48
+ return null;
49
+ };
50
+
51
+ /**
52
+ * 获取传入值的小数位数(忽略末尾为 0 的情况,如 1.00 返回 0)
53
+ */
54
+ var getDecimalsIfNumber = function getDecimalsIfNumber(value) {
55
+ var num = toFiniteNumber(value);
56
+ if (num === null || !isNumeric(value)) return 0;
57
+ if (Number.isInteger(num)) return 0;
58
+ var str = num.toPrecision(); // 更稳定地获取数值字符串
59
+ var decimalIndex = str.indexOf('.');
60
+ if (decimalIndex === -1) return 0;
61
+ var fractionalPart = str.slice(decimalIndex + 1).replace(/[^0-9]/g, '');
62
+ return fractionalPart.length;
63
+ };
64
+
65
+ /**
66
+ * 对金额进行格式化:
67
+ * - 大于等于 1 亿:显示为 "X 亿"
68
+ * - 大于等于 1 万:显示为 "X 万"
69
+ * - 否则原样展示
70
+ */
71
+ var getFormatAmount = function getFormatAmount(amount) {
72
+ var num = toFiniteNumber(amount);
73
+ if (num === null) return {
74
+ value: amount,
75
+ suffix: ''
76
+ };
77
+ if (Math.abs(num) >= 100000000) {
78
+ return {
79
+ value: num_expand(amount, 100000000),
80
+ suffix: '亿'
81
+ };
82
+ } else if (Math.abs(num) >= 10000) {
83
+ return {
84
+ value: num_expand(amount, 10000),
85
+ suffix: '万'
86
+ };
87
+ } else {
88
+ return {
89
+ value: amount,
90
+ suffix: ''
91
+ };
92
+ }
93
+ };
94
+
95
+ // ================= 组件渲染逻辑 ================= //
96
+ // 如果强制渲染,直接返回内容
97
+ if (forceRender) {
98
+ return /*#__PURE__*/React.createElement("div", _extends({
99
+ className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
100
+ }, otherProps), children);
101
+ }
102
+
103
+ // 如果不是合法数字,直接返回 '--'
104
+ if (!isNumeric(children)) {
105
+ return /*#__PURE__*/React.createElement("div", _extends({
106
+ className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
107
+ }, otherProps), '--');
108
+ }
109
+
110
+ // 提前计算格式化结果,避免重复调用
111
+ var formattedAmount = getFormatAmount(children);
112
+ return /*#__PURE__*/React.createElement("div", _extends({
113
+ className: "amountCellUI ".concat(className !== null && className !== void 0 ? className : '')
114
+ }, otherProps), /*#__PURE__*/React.createElement(Tooltip, {
115
+ placement: "right",
116
+ title: children
117
+ }, animation ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CountUp, {
118
+ end: rawValue ? Number(children) : Number(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value),
119
+ decimals: rawValue ? getDecimalsIfNumber(children) : getDecimalsIfNumber(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value),
120
+ suffix: rawValue ? '' : formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.suffix,
121
+ separator: separator
122
+ })) : /*#__PURE__*/React.createElement("span", null, rawValue ? Number(children) : Number(formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.value) + (formattedAmount === null || formattedAmount === void 0 ? void 0 : formattedAmount.suffix))));
123
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,85 @@
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, { useRef, useState } from 'react';
8
+ import { AnchorUI, ButtonUI } from "../..";
9
+ export default (function () {
10
+ var ref = useRef(null);
11
+ //当前导航项
12
+ var _useState = useState(''),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ anchorActive = _useState2[0],
15
+ setAnchorActive = _useState2[1];
16
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ButtonUI, {
17
+ onClick: function onClick() {
18
+ return setAnchorActive('part-1');
19
+ }
20
+ }, "\u70B9\u51FB\u5230\u4E3B\u4F53\u8D44\u8D28"), /*#__PURE__*/React.createElement(ButtonUI, {
21
+ onClick: function onClick() {
22
+ return setAnchorActive('part-2');
23
+ }
24
+ }, "\u70B9\u51FB\u5230\u5BA2\u6237\u6765\u6E90"), /*#__PURE__*/React.createElement(ButtonUI, {
25
+ onClick: function onClick() {
26
+ return setAnchorActive('part-3');
27
+ }
28
+ }, "\u70B9\u51FB\u5230\u9879\u76EE\u4FE1\u606F"), /*#__PURE__*/React.createElement(ButtonUI, {
29
+ onClick: function onClick() {
30
+ return setAnchorActive('part-4');
31
+ }
32
+ }, "\u70B9\u51FB\u5230\u98CE\u63A7\u4FE1\u606F"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
33
+ style: {
34
+ display: 'flex'
35
+ }
36
+ }, /*#__PURE__*/React.createElement(AnchorUI, {
37
+ anchoruiRef: ref,
38
+ items: [{
39
+ key: 'part-1',
40
+ title: '主体资质'
41
+ }, {
42
+ key: 'part-2',
43
+ title: '客户来源'
44
+ }, {
45
+ key: 'part-3',
46
+ title: '项目信息'
47
+ }, {
48
+ key: 'part-4',
49
+ title: '风控信息'
50
+ }],
51
+ anchorActive: anchorActive,
52
+ setAnchorActive: setAnchorActive
53
+ }), /*#__PURE__*/React.createElement("div", {
54
+ style: {
55
+ flex: 1,
56
+ overflow: 'scroll',
57
+ height: 400
58
+ },
59
+ ref: ref
60
+ }, /*#__PURE__*/React.createElement("div", {
61
+ id: "part-1",
62
+ style: {
63
+ height: '200px',
64
+ backgroundColor: 'rgba(255,0,0,0.2)'
65
+ }
66
+ }), /*#__PURE__*/React.createElement("div", {
67
+ id: "part-2",
68
+ style: {
69
+ height: '200px',
70
+ backgroundColor: 'rgba(0,255,0,0.2)'
71
+ }
72
+ }), /*#__PURE__*/React.createElement("div", {
73
+ id: "part-3",
74
+ style: {
75
+ height: '200px',
76
+ backgroundColor: 'rgba(0,0,255,0.2)'
77
+ }
78
+ }), /*#__PURE__*/React.createElement("div", {
79
+ id: "part-4",
80
+ style: {
81
+ height: '200px',
82
+ backgroundColor: 'rgba(0,0,125,0.2)'
83
+ }
84
+ }))));
85
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,69 @@
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, { useRef, useState } from 'react';
8
+ import { AnchorUI } from "../..";
9
+ export default (function () {
10
+ var ref = useRef(null);
11
+ //当前导航项
12
+ var _useState = useState(''),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ anchorActive = _useState2[0],
15
+ setAnchorActive = _useState2[1];
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ style: {
18
+ display: 'flex'
19
+ }
20
+ }, /*#__PURE__*/React.createElement(AnchorUI, {
21
+ anchoruiRef: ref,
22
+ items: [{
23
+ key: 'part-a',
24
+ title: '主体资质'
25
+ }, {
26
+ key: 'part-b',
27
+ title: '客户来源'
28
+ }, {
29
+ key: 'part-c',
30
+ title: '项目信息'
31
+ }, {
32
+ key: 'part-d',
33
+ title: '风控信息'
34
+ }],
35
+ anchorActive: anchorActive,
36
+ setAnchorActive: setAnchorActive
37
+ }), /*#__PURE__*/React.createElement("div", {
38
+ style: {
39
+ flex: 1,
40
+ overflow: 'scroll',
41
+ height: 400
42
+ },
43
+ ref: ref
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ id: "part-a",
46
+ style: {
47
+ height: '200px',
48
+ backgroundColor: 'rgba(255,0,0,0.2)'
49
+ }
50
+ }), /*#__PURE__*/React.createElement("div", {
51
+ id: "part-b",
52
+ style: {
53
+ height: '200px',
54
+ backgroundColor: 'rgba(0,255,0,0.2)'
55
+ }
56
+ }), /*#__PURE__*/React.createElement("div", {
57
+ id: "part-c",
58
+ style: {
59
+ height: '200px',
60
+ backgroundColor: 'rgba(0,0,255,0.2)'
61
+ }
62
+ }), /*#__PURE__*/React.createElement("div", {
63
+ id: "part-d",
64
+ style: {
65
+ height: '200px',
66
+ backgroundColor: 'rgba(0,0,125,0.2)'
67
+ }
68
+ })));
69
+ });
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const AnchorUI: (props: any) => React.JSX.Element;
4
+ export default AnchorUI;
@@ -0,0 +1,56 @@
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 { Anchor } from 'antd';
8
+ import React, { useEffect, useState } from 'react';
9
+ import "./index.scss";
10
+ var AnchorUI = function AnchorUI(props) {
11
+ var className = props.className,
12
+ anchoruiRef = props.anchoruiRef,
13
+ items = props.items,
14
+ anchorActive = props.anchorActive,
15
+ setAnchorActive = props.setAnchorActive;
16
+ // 当前聚焦id
17
+ var _useState = useState(''),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ activeId = _useState2[0],
20
+ setActiveId = _useState2[1];
21
+ useEffect(function () {
22
+ if (anchorActive) {
23
+ //判断是否点击的是当前聚焦项
24
+ if ('#' + anchorActive !== activeId) {
25
+ var targetElement = document.getElementById(anchorActive);
26
+ if (targetElement) targetElement.scrollIntoView({
27
+ behavior: 'auto'
28
+ });
29
+ }
30
+ //重置父级指定聚焦项 防止重复点击无效
31
+ if (setAnchorActive) setAnchorActive('');
32
+ }
33
+ }, [anchorActive]);
34
+ var newItems = items.map(function (item) {
35
+ return {
36
+ key: item.key,
37
+ title: item.title,
38
+ href: "#".concat(item.key)
39
+ };
40
+ });
41
+ return /*#__PURE__*/React.createElement(Anchor, {
42
+ className: "anchoraUI ".concat(className !== null && className !== void 0 ? className : ''),
43
+ items: newItems,
44
+ affix: false,
45
+ getContainer: function getContainer() {
46
+ return anchoruiRef === null || anchoruiRef === void 0 ? void 0 : anchoruiRef.current;
47
+ },
48
+ onClick: function onClick(e) {
49
+ return e.preventDefault();
50
+ },
51
+ onChange: function onChange(e) {
52
+ return setActiveId(e);
53
+ }
54
+ });
55
+ };
56
+ export default AnchorUI;
@@ -0,0 +1,21 @@
1
+ .anchoraUI {
2
+ .ant-anchor .ant-anchor-link {
3
+ padding: 0;
4
+ width: 125px;
5
+ height: 44px;
6
+ background-color: #f5f5f5;
7
+ }
8
+ .ant-anchor .ant-anchor-link-title {
9
+ box-sizing: border-box;
10
+ padding-left: 20px;
11
+ width: 100%;
12
+ height: 100%;
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .ant-anchor .ant-anchor-link-active {
18
+ background-color: var(--themeColor4);
19
+ transition: background-color 1s ease;
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface IProps {
4
+ to?: any;
5
+ before?: string;
6
+ current?: string;
7
+ className?: string;
8
+ children?: React.ReactNode;
9
+ style?: {
10
+ [key: string]: string | number;
11
+ };
12
+ }
13
+ declare const BackUI: (props: IProps & Record<string, any>) => React.JSX.Element;
14
+ export default BackUI;
@@ -0,0 +1,35 @@
1
+ var _excluded = ["to", "before", "current", "className", "children"];
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 { useNavigate } from 'react-router-dom';
7
+ import { IconUI } from "./..";
8
+ import "./index.scss";
9
+ var BackUI = function BackUI(props) {
10
+ var _props$to = props.to,
11
+ to = _props$to === void 0 ? -1 : _props$to,
12
+ before = props.before,
13
+ current = props.current,
14
+ className = props.className,
15
+ children = props.children,
16
+ otherProps = _objectWithoutProperties(props, _excluded);
17
+ var navigate = useNavigate();
18
+ return /*#__PURE__*/React.createElement("div", _extends({
19
+ className: "sic-backui ".concat(className !== null && className !== void 0 ? className : '')
20
+ }, otherProps), /*#__PURE__*/React.createElement("div", {
21
+ className: "sic-backui-button",
22
+ onClick: function onClick() {
23
+ return navigate(to !== null && to !== void 0 ? to : -1);
24
+ }
25
+ }, /*#__PURE__*/React.createElement(IconUI, {
26
+ name: "Return"
27
+ }), /*#__PURE__*/React.createElement("div", null, "\u8FD4\u56DE")), /*#__PURE__*/React.createElement("div", {
28
+ className: "sic-backui-text"
29
+ }, /*#__PURE__*/React.createElement("div", {
30
+ className: "sic-backui-text-before"
31
+ }, before), /*#__PURE__*/React.createElement("div", null, "/"), /*#__PURE__*/React.createElement("div", null, current)), /*#__PURE__*/React.createElement("div", {
32
+ className: "sic-backui-content"
33
+ }, children));
34
+ };
35
+ export default BackUI;
@@ -0,0 +1,26 @@
1
+ .sic-backui {
2
+ width: 100%;
3
+ height: 22px;
4
+ font-size: 16px;
5
+ line-height: normal;
6
+ font-weight: bold;
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 20px;
10
+ margin-bottom: 12px;
11
+ &-button {
12
+ color: var(--themeColor);
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 8px;
16
+ cursor: pointer;
17
+ }
18
+ &-text {
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 4px;
22
+ &-before {
23
+ color: #999;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface IProps {
4
+ /** 广播消息列表 */
5
+ items?: Array<string | number>;
6
+ /** 组件宽度 */
7
+ width?: number;
8
+ /** 文字对齐方式 */
9
+ textAlign?: 'left' | 'center' | 'right';
10
+ }
11
+ declare const BroadcastUI: (props: IProps) => React.JSX.Element;
12
+ export default BroadcastUI;
@@ -0,0 +1,62 @@
1
+ import { Carousel, Popover } from 'antd';
2
+ import React, { useRef } from 'react';
3
+ import { IconUI } from "./..";
4
+ import "./index.scss";
5
+ var BroadcastUI = function BroadcastUI(props) {
6
+ var ref = useRef(null);
7
+ var _props$items = props.items,
8
+ items = _props$items === void 0 ? [] : _props$items,
9
+ width = props.width,
10
+ _props$textAlign = props.textAlign,
11
+ textAlign = _props$textAlign === void 0 ? 'left' : _props$textAlign;
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ className: "sicBroadcastui",
14
+ style: {
15
+ width: width
16
+ }
17
+ }, /*#__PURE__*/React.createElement(IconUI, {
18
+ name: "Help",
19
+ theme: "filled",
20
+ fill: "var(--red)",
21
+ size: "18"
22
+ }), (items === null || items === void 0 ? void 0 : items.length) > 0 && /*#__PURE__*/React.createElement("div", {
23
+ className: "sicBroadcastui-content"
24
+ }, /*#__PURE__*/React.createElement(Carousel, {
25
+ autoplay: (items === null || items === void 0 ? void 0 : items.length) > 1,
26
+ dots: false,
27
+ dotPosition: "left",
28
+ autoplaySpeed: 5000,
29
+ adaptiveHeight: true
30
+ }, items.map(function (item, index) {
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ className: "sicBroadcastui-content-item",
33
+ key: index
34
+ }, /*#__PURE__*/React.createElement("div", {
35
+ className: "sicBroadcastui-content-item-text",
36
+ style: {
37
+ textAlign: textAlign
38
+ }
39
+ }, item));
40
+ }))), (items === null || items === void 0 ? void 0 : items.length) > 1 && /*#__PURE__*/React.createElement(Popover, {
41
+ color: "rgba(0, 0, 0, 0.85)",
42
+ placement: "bottomRight",
43
+ getPopupContainer: function getPopupContainer() {
44
+ return ref.current || document.body;
45
+ },
46
+ content: /*#__PURE__*/React.createElement("div", {
47
+ className: "sicBroadcastui-popover",
48
+ style: {
49
+ width: width ? width - 20 : 'auto'
50
+ }
51
+ }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
52
+ return /*#__PURE__*/React.createElement("div", {
53
+ className: "sicBroadcastui-popover-item",
54
+ key: index
55
+ }, item);
56
+ }))
57
+ }, /*#__PURE__*/React.createElement("div", {
58
+ className: "sicBroadcastui-more",
59
+ ref: ref
60
+ }, "\u67E5\u770B")));
61
+ };
62
+ export default BroadcastUI;
@@ -0,0 +1,43 @@
1
+ .sicBroadcastui {
2
+ box-sizing: border-box;
3
+ padding: 0 12px;
4
+ height: 32px;
5
+ font-size: 12px;
6
+ font-weight: normal;
7
+ line-height: normal;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ gap: 8px;
12
+ border: 1px solid var(--red);
13
+ border-radius: 4px;
14
+ background: rgba(255, 120, 117, 0.1);
15
+ &-content {
16
+ flex: 1;
17
+ height: 100%;
18
+ overflow: hidden;
19
+ &-item {
20
+ &-text {
21
+ height: 30px;
22
+ line-height: 30px;
23
+ font-size: 12px;
24
+ white-space: nowrap;
25
+ overflow: hidden;
26
+ text-overflow: ellipsis;
27
+ }
28
+ }
29
+ }
30
+ &-more {
31
+ color: var(--red);
32
+ cursor: pointer;
33
+ .ant-popover-inner {
34
+ padding: 0;
35
+ .sicBroadcastui-popover {
36
+ box-sizing: border-box;
37
+ padding: 12px;
38
+ color: #fff;
39
+ font-size: 12px;
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ import { ButtonProps } from 'antd';
2
+ import React from 'react';
3
+ import './index.scss';
4
+ interface ButtonUIProps extends ButtonProps {
5
+ iconPosition?: 'start' | 'end';
6
+ children?: React.ReactNode;
7
+ }
8
+ declare const ButtonUI: React.FC<ButtonUIProps>;
9
+ export default ButtonUI;