@aloudata/aloudata-design 2.12.6 → 2.13.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 (41) hide show
  1. package/dist/ColorPicker/index.js +2 -2
  2. package/dist/Icon/components/SignLightLine.d.ts +11 -0
  3. package/dist/Icon/components/SignLightLine.js +35 -0
  4. package/dist/Icon/index.d.ts +1 -0
  5. package/dist/Icon/index.js +1 -0
  6. package/dist/Icon/svg/Sign-light-line.svg +3 -0
  7. package/dist/List/index.js +1 -4
  8. package/dist/LogicTree/DisplayLogicTree.d.ts +9 -0
  9. package/dist/LogicTree/DisplayLogicTree.js +14 -0
  10. package/dist/LogicTree/components/DisplayLogicItem/index.d.ts +10 -0
  11. package/dist/LogicTree/components/DisplayLogicItem/index.js +87 -0
  12. package/dist/LogicTree/components/LogicItem/index.d.ts +14 -0
  13. package/dist/LogicTree/components/LogicItem/index.js +144 -0
  14. package/dist/LogicTree/helper.d.ts +8 -0
  15. package/dist/LogicTree/helper.js +183 -0
  16. package/dist/LogicTree/index.d.ts +17 -0
  17. package/dist/LogicTree/index.js +78 -0
  18. package/dist/LogicTree/style/DisplayLogicItem.less +54 -0
  19. package/dist/LogicTree/style/LoginItem.less +79 -0
  20. package/dist/LogicTree/style/index.d.ts +2 -0
  21. package/dist/LogicTree/style/index.js +2 -0
  22. package/dist/LogicTree/style/index.less +12 -0
  23. package/dist/LogicTree/type.d.ts +22 -0
  24. package/dist/LogicTree/type.js +10 -0
  25. package/dist/MemberPicker/components/PanelWrapper.js +0 -1
  26. package/dist/MemberPicker/index.js +24 -21
  27. package/dist/MemberPicker/tests/mockPort.d.ts +6 -0
  28. package/dist/MemberPicker/tests/mockPort.js +147 -0
  29. package/dist/Steps/style/index.less +1 -7
  30. package/dist/_utils/getUniqId.d.ts +5 -0
  31. package/dist/_utils/getUniqId.js +12 -0
  32. package/dist/ald.min.css +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/index.less +1 -0
  36. package/dist/locale/default.d.ts +10 -0
  37. package/dist/locale/en_US.d.ts +10 -0
  38. package/dist/locale/en_US.js +10 -0
  39. package/dist/locale/zh_CN.d.ts +10 -0
  40. package/dist/locale/zh_CN.js +10 -0
  41. package/package.json +1 -1
@@ -0,0 +1,78 @@
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useControllableValue } from 'ahooks';
8
+ import classNames from 'classnames';
9
+ import React from 'react';
10
+ import { getUniqId } from "../_utils/getUniqId";
11
+ import DisplayLogicTree from "./DisplayLogicTree";
12
+ import LogicItem from "./components/LogicItem";
13
+ import { addLogicNode, addRecordNode, changeRecordData, changeRelation, removeNode } from "./helper";
14
+ import { ELogicType, ENodeType } from "./type";
15
+ export { DisplayLogicTree, ELogicType, ENodeType };
16
+ export default function LogicTree(props) {
17
+ var newInitializationData = props.newInitializationData,
18
+ propsOnChange = props.onChange,
19
+ renderCondition = props.renderCondition,
20
+ rootNodeAllowedEmpty = props.rootNodeAllowedEmpty,
21
+ className = props.className;
22
+ var initialNode = {
23
+ id: getUniqId(),
24
+ type: ENodeType.LOGIC,
25
+ logicType: ELogicType.AND,
26
+ nodes: [{
27
+ id: getUniqId(),
28
+ type: ENodeType.RECORD,
29
+ data: newInitializationData
30
+ }]
31
+ };
32
+ var _useControllableValue = useControllableValue(props.value ? {
33
+ value: props.value
34
+ } : {}, {
35
+ defaultValue: initialNode
36
+ }),
37
+ _useControllableValue2 = _slicedToArray(_useControllableValue, 2),
38
+ innerValue = _useControllableValue2[0],
39
+ setInnerValue = _useControllableValue2[1];
40
+ var changeInnerValue = function changeInnerValue(newValue) {
41
+ setInnerValue(newValue);
42
+ propsOnChange(newValue);
43
+ };
44
+ var onAddCondition = function onAddCondition(id) {
45
+ var newRootNode = addRecordNode(id, innerValue, newInitializationData);
46
+ changeInnerValue(newRootNode);
47
+ };
48
+ var onAddRelation = function onAddRelation(id) {
49
+ var newRootNode = addLogicNode(id, innerValue, newInitializationData);
50
+ changeInnerValue(newRootNode);
51
+ };
52
+ var onChangeRelation = function onChangeRelation(id, logicType) {
53
+ var newRootNode = changeRelation(id, logicType, innerValue);
54
+ changeInnerValue(newRootNode);
55
+ };
56
+ var onRemove = function onRemove(id) {
57
+ var newRootNode = removeNode(id, innerValue, initialNode, rootNodeAllowedEmpty);
58
+ changeInnerValue(newRootNode);
59
+ };
60
+ var onChangeRecordData = function onChangeRecordData(id, data) {
61
+ var newRootNode = changeRecordData(id, data, innerValue);
62
+ changeInnerValue(newRootNode);
63
+ };
64
+ if (!innerValue) {
65
+ return null;
66
+ }
67
+ return /*#__PURE__*/React.createElement("div", {
68
+ className: classNames('ald-logic-tree-wrap', className)
69
+ }, /*#__PURE__*/React.createElement(LogicItem, {
70
+ value: innerValue,
71
+ addCondition: onAddCondition,
72
+ addRelation: onAddRelation,
73
+ remove: onRemove,
74
+ changeRecordData: onChangeRecordData,
75
+ renderCondition: renderCondition,
76
+ changeRelation: onChangeRelation
77
+ }));
78
+ }
@@ -0,0 +1,54 @@
1
+ @displayRecordLineWidth: 18px;
2
+ @displaySelectWidth: 24px;
3
+ @displaySelectHeight: 20px;
4
+
5
+ .ald-logic-tree-display-logic-node {
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: 8px;
9
+ padding-left: calc(@displayRecordLineWidth + @displaySelectWidth / 2);
10
+ position: relative;
11
+
12
+ .ald-logic-tree-node-wrap {
13
+ position: relative;
14
+
15
+ .ald-logic-tree-horizontal-line {
16
+ position: absolute;
17
+ border-top: 1px solid #d1d5db;
18
+ top: 50%;
19
+ width: @displayRecordLineWidth;
20
+ left: -@displayRecordLineWidth;
21
+ }
22
+ }
23
+
24
+ .ald-logic-tree-logic-type {
25
+ width: @displaySelectWidth;
26
+ height: 20px;
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ position: absolute;
31
+ top: calc(50% - @displaySelectHeight / 2);
32
+ background-color: #fff;
33
+ z-index: 1;
34
+ left: 0;
35
+ }
36
+
37
+ .ald-logic-tree-logic-vertical-line {
38
+ position: absolute;
39
+ border-left: 1px solid #d1d5db;
40
+ left: calc(@displaySelectWidth / 2);
41
+ }
42
+ }
43
+
44
+ .ald-logic-tree-display-record-node {
45
+ display: flex;
46
+ align-items: center;
47
+
48
+ .ald-logic-tree-render-condition-wrap {
49
+ display: flex;
50
+ align-items: center;
51
+ width: 100%;
52
+ height: 100%;
53
+ }
54
+ }
@@ -0,0 +1,79 @@
1
+ @recordLineWidth: 32px;
2
+ @selectWidth: 48px;
3
+
4
+ .ald-logic-tree-logic-node {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 8px;
8
+ padding-left: calc(@recordLineWidth + @selectWidth / 2);
9
+ position: relative;
10
+
11
+ .ald-logic-tree-node-wrap {
12
+ position: relative;
13
+
14
+ .ald-logic-tree-horizontal-line {
15
+ position: absolute;
16
+ border-top: 1px solid #d1d5db;
17
+ top: 50%;
18
+ width: @recordLineWidth;
19
+ left: -@recordLineWidth;
20
+ }
21
+ }
22
+
23
+ .ald-logic-tree-operation {
24
+ height: 32px;
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 10px;
28
+
29
+ .ald-logic-tree-left-bottom-dash-line {
30
+ position: absolute;
31
+ border-bottom: 1px dashed #d1d5db;
32
+ border-left: 1px dashed #d1d5db;
33
+ height: calc(50% - 16px);
34
+ width: @recordLineWidth;
35
+ top: 50%;
36
+ left: calc(@selectWidth / 2);
37
+ }
38
+ }
39
+
40
+ .ald-logic-tree-logic-vertical-line {
41
+ position: absolute;
42
+ border-left: 1px solid #d1d5db;
43
+ left: calc(@selectWidth / 2);
44
+ }
45
+
46
+ .ald-logic-tree-select-relation {
47
+ position: absolute !important;
48
+ top: calc(50% - 14px);
49
+ left: 0;
50
+ z-index: 1;
51
+ width: @selectWidth !important;
52
+ background: #fff !important;
53
+
54
+ .ant-select-selector {
55
+ padding-left: 8px !important;
56
+ padding-right: 0 !important;
57
+
58
+ .ant-select-selection-search {
59
+ right: 0 !important;
60
+ }
61
+ }
62
+
63
+ .ant-select-arrow {
64
+ right: 6px !important;
65
+ }
66
+ }
67
+ }
68
+
69
+ .ald-logic-tree-record-node {
70
+ display: flex;
71
+ align-items: center;
72
+ gap: 6px;
73
+
74
+ .ald-logic-tree-render-condition-wrap {
75
+ display: flex;
76
+ align-items: center;
77
+ flex: 0 0 fit-content;
78
+ }
79
+ }
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import "../../style";
2
+ import "./index.less";
@@ -0,0 +1,12 @@
1
+ @import '../../TextLink/style/index.less';
2
+ @import '../../IconButton/style/index.less';
3
+ @import '../../Select/style/index.less';
4
+ @import './DisplayLogicItem.less';
5
+ @import './LoginItem.less';
6
+
7
+ .ald-logic-tree-wrap {
8
+ width: 100%;
9
+ overflow-x: scroll;
10
+ padding: 15px;
11
+ padding-right: 0;
12
+ }
@@ -0,0 +1,22 @@
1
+ export declare enum ELogicType {
2
+ AND = "AND",
3
+ OR = "OR"
4
+ }
5
+ export declare enum ENodeType {
6
+ LOGIC = "LOGIC",
7
+ RECORD = "RECORD"
8
+ }
9
+ export interface INodeBase {
10
+ id: string;
11
+ type: ENodeType;
12
+ }
13
+ export interface ILogicNode<T> extends INodeBase {
14
+ type: ENodeType.LOGIC;
15
+ logicType: ELogicType;
16
+ nodes: TNode<T>[];
17
+ }
18
+ export interface IRecordNode<T> extends INodeBase {
19
+ type: ENodeType.RECORD;
20
+ data: T;
21
+ }
22
+ export type TNode<T> = ILogicNode<T> | IRecordNode<T>;
@@ -0,0 +1,10 @@
1
+ export var ELogicType = /*#__PURE__*/function (ELogicType) {
2
+ ELogicType["AND"] = "AND";
3
+ ELogicType["OR"] = "OR";
4
+ return ELogicType;
5
+ }({});
6
+ export var ENodeType = /*#__PURE__*/function (ENodeType) {
7
+ ENodeType["LOGIC"] = "LOGIC";
8
+ ENodeType["RECORD"] = "RECORD";
9
+ return ENodeType;
10
+ }({});
@@ -76,7 +76,6 @@ export var PanelWrapper = function PanelWrapper(_ref) {
76
76
  cacheTime: 1000 * 60 * 2,
77
77
  // 2分钟内不重复请求
78
78
  onSuccess: function onSuccess(result) {
79
- console.log('%c [ result ]-73', 'font-size:13px; background:#c324a4; color:#ff68e8;', 1433223, result);
80
79
  setSearchUserList(result);
81
80
  },
82
81
  onError: function onError(error) {
@@ -74,6 +74,7 @@ var Component = function Component(props) {
74
74
  _useState8 = _slicedToArray(_useState7, 2),
75
75
  dropdownContentWidth = _useState8[0],
76
76
  setDropdownContentWidth = _useState8[1];
77
+ console.log('%c [ ]-65', 'font-size:13px; background:#10657f; color:#54a9c3;', 1433223, dropdownContentWidth);
77
78
  var triggerRef = useRef(null);
78
79
  var onSearchValueChange = useCallback(function (v) {
79
80
  setSearchString(v);
@@ -198,29 +199,31 @@ var Component = function Component(props) {
198
199
  }
199
200
  }, [open]);
200
201
  useEffect(function () {
201
- var resizeEle = triggerRef.current;
202
- if (!resizeEle) return;
203
- var resizeObserver = new ResizeObserver(function (entries) {
204
- var _iterator = _createForOfIteratorHelper(entries),
205
- _step;
206
- try {
207
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
208
- var entry = _step.value;
209
- var width = entry.contentRect.width;
210
- setDropdownContentWidth(width);
202
+ if (!dropdownContentWidth) {
203
+ var resizeEle = triggerRef.current;
204
+ if (!resizeEle) return;
205
+ var resizeObserver = new ResizeObserver(function (entries) {
206
+ var _iterator = _createForOfIteratorHelper(entries),
207
+ _step;
208
+ try {
209
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
210
+ var entry = _step.value;
211
+ var width = entry.contentRect.width;
212
+ setDropdownContentWidth(width);
213
+ }
214
+ } catch (err) {
215
+ _iterator.e(err);
216
+ } finally {
217
+ _iterator.f();
211
218
  }
212
- } catch (err) {
213
- _iterator.e(err);
214
- } finally {
215
- _iterator.f();
216
- }
217
- });
218
- resizeObserver.observe(resizeEle);
219
- return function () {
220
- resizeObserver.unobserve(resizeEle);
221
- };
219
+ });
220
+ resizeObserver.observe(resizeEle);
221
+ return function () {
222
+ resizeObserver.unobserve(resizeEle);
223
+ };
224
+ }
222
225
  // eslint-disable-next-line react-hooks/exhaustive-deps
223
- }, [triggerRef.current, triggerRef]);
226
+ }, [triggerRef.current, triggerRef, dropdownContentWidth]);
224
227
  var onDropdownOpenChange = useCallback(function (open) {
225
228
  setDropdownOpen(open);
226
229
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open);
@@ -0,0 +1,6 @@
1
+ import { IUser, TUser } from '../../ConfigProvider/getUserList';
2
+ import { TUserGroupValue, TUserValue } from '../interface';
3
+ export declare function genUserListByKeywords(keywords: string): TUser;
4
+ export declare function genUserListByIds(ids: string[]): IUser[];
5
+ export declare const getUserByIds: (ids: Array<TUserValue | TUserGroupValue>) => Promise<IUser[]>;
6
+ export declare const getUsersByKeywords: (keywords: string) => Promise<TUser>;
@@ -0,0 +1,147 @@
1
+ /* eslint-disable i18n/no-chinese-character */
2
+ import { EUserType } from "../../ConfigProvider/getUserList";
3
+ export function genUserListByKeywords(keywords) {
4
+ var userList = [];
5
+ for (var i = 0; i < 5; i++) {
6
+ var user = {
7
+ type: EUserType.USER,
8
+ userId: "user".concat(i),
9
+ name: "\u7528\u6237".concat(i).concat(keywords ? '-' : '').concat(keywords),
10
+ nickname: "\u7528\u6237".concat(i).concat(keywords ? '-' : '').concat(keywords)
11
+ };
12
+ userList.push(user);
13
+ }
14
+ userList.push({
15
+ type: EUserType.USER,
16
+ userId: "user".concat(123123),
17
+ name: "\u7528\u6237".concat(1, keywords ? '-' : '').concat(keywords),
18
+ nickname: "\u7528\u6237".concat(1, keywords ? '-' : '').concat(keywords)
19
+ });
20
+ var userGroupList = [{
21
+ type: EUserType.USER_GROUP,
22
+ groupId: 'userGroup0',
23
+ parentId: null,
24
+ name: '用户组0',
25
+ frontId: null
26
+ }, {
27
+ type: EUserType.USER_GROUP,
28
+ groupId: 'userGroup0-1',
29
+ parentId: 'userGroup0',
30
+ name: '用户组0-1',
31
+ frontId: null
32
+ }, {
33
+ type: EUserType.USER_GROUP,
34
+ groupId: 'userGroup0-1-1',
35
+ parentId: 'userGroup0-1',
36
+ name: '用户组0-1-1',
37
+ frontId: null
38
+ }, {
39
+ type: EUserType.USER_GROUP,
40
+ groupId: 'userGroup0-1-1-1',
41
+ parentId: 'userGroup0-1-1',
42
+ name: '用户组0-1-1-1',
43
+ frontId: null
44
+ }, {
45
+ type: EUserType.USER_GROUP,
46
+ groupId: 'userGroup0-1-1-1-1',
47
+ parentId: 'userGroup0-1-1-1',
48
+ name: '用户组0-1-1-1-1',
49
+ frontId: null
50
+ }, {
51
+ type: EUserType.USER_GROUP,
52
+ groupId: 'userGroup0-1-1-1-1-1',
53
+ parentId: 'userGroup0-1-1-1-1',
54
+ name: '用户组0-1-1-1-1-1',
55
+ frontId: null
56
+ }, {
57
+ type: EUserType.USER_GROUP,
58
+ groupId: 'userGroup0-1-1-1-1-2',
59
+ parentId: 'userGroup0-1-1-1-1',
60
+ name: '用户组0-1-1-1-1-2',
61
+ frontId: null
62
+ }, {
63
+ type: EUserType.USER_GROUP,
64
+ groupId: 'userGroup0-1-1-1-1-3',
65
+ parentId: 'userGroup0-1-1-1-1',
66
+ name: '用户组0-1-1-1-1-3',
67
+ frontId: null
68
+ }, {
69
+ type: EUserType.USER_GROUP,
70
+ groupId: 'userGroup0-1-1-1-1-4',
71
+ parentId: 'userGroup0-1-1-1-1',
72
+ name: '用户组0-1-1-1-1-4',
73
+ frontId: null
74
+ }, {
75
+ type: EUserType.USER_GROUP,
76
+ groupId: 'userGroup0-1-1-1-1-5',
77
+ parentId: 'userGroup0-1-1-1-1',
78
+ name: '用户组0-1-1-1-1-5',
79
+ frontId: null
80
+ }, {
81
+ type: EUserType.USER_GROUP,
82
+ groupId: 'userGroup0-1-1-1-1-6',
83
+ parentId: 'userGroup0-1-1-1-1',
84
+ name: '用户组0-1-1-1-1-6',
85
+ frontId: null
86
+ }, {
87
+ type: EUserType.USER_GROUP,
88
+ groupId: 'userGroup0-1-1-1-1-7',
89
+ parentId: 'userGroup0-1-1-1-1',
90
+ name: '用户组0-1-1-1-1-7',
91
+ frontId: null
92
+ }, {
93
+ type: EUserType.USER_GROUP,
94
+ groupId: 'userGroup0-1-1-1-1-8',
95
+ parentId: 'userGroup0-1-1-1-1',
96
+ name: '用户组0-1-1-1-1-8',
97
+ frontId: null
98
+ }, {
99
+ type: EUserType.USER_GROUP,
100
+ groupId: 'userGroup1',
101
+ parentId: null,
102
+ name: '用户组1',
103
+ frontId: 'userGroup0'
104
+ }, {
105
+ type: EUserType.USER_GROUP,
106
+ groupId: 'userGroup' + '1-1',
107
+ parentId: 'userGroup1',
108
+ name: '用户组1-1',
109
+ frontId: null
110
+ }, {
111
+ type: EUserType.USER_GROUP,
112
+ groupId: 'userGroup' + '1-2',
113
+ parentId: 'userGroup1',
114
+ name: '用户组1-2',
115
+ frontId: 'userGroup1-1'
116
+ }, {
117
+ type: EUserType.USER_GROUP,
118
+ groupId: 'userGroup' + '2',
119
+ parentId: null,
120
+ name: '用户组2',
121
+ frontId: 'userGroup1'
122
+ }];
123
+ return [].concat(userList, userGroupList);
124
+ }
125
+ export function genUserListByIds(ids) {
126
+ var userList = [];
127
+ var regex = /\d+/g;
128
+ for (var i = 0; i < ids.length; i++) {
129
+ var _ids$i$match;
130
+ var user = {
131
+ type: EUserType.USER,
132
+ userId: ids[i],
133
+ name: 'name' + i,
134
+ nickname: "\u7528\u6237".concat(((_ids$i$match = ids[i].match(regex)) === null || _ids$i$match === void 0 ? void 0 : _ids$i$match[0]) || ids[i])
135
+ };
136
+ userList.push(user);
137
+ }
138
+ return userList;
139
+ }
140
+ export var getUserByIds = function getUserByIds(ids) {
141
+ return Promise.resolve(genUserListByIds(ids.map(function (item) {
142
+ return item.type === EUserType.USER ? item.userId : item.groupId;
143
+ })));
144
+ };
145
+ export var getUsersByKeywords = function getUsersByKeywords(keywords) {
146
+ return Promise.resolve(genUserListByKeywords(keywords));
147
+ };
@@ -2,20 +2,14 @@
2
2
 
3
3
  // 水平状态下
4
4
  .ant-steps.ald-steps.ald-steps {
5
- padding: 24px;
6
-
7
5
  .ant-steps-item .ant-steps-item-container .ant-steps-item-icon {
8
- margin: 0 8px 4px 66px;
6
+ margin: 2px 8px 2px 66px;
9
7
  font-size: 12px;
10
8
  height: 16px;
11
9
  text-align: center;
12
10
  transition: background-color 0.3s, border-color 0.3s;
13
11
  }
14
12
 
15
- .ant-steps-item-container {
16
- height: 49px;
17
- }
18
-
19
13
  .ant-steps-item-content {
20
14
  display: flex;
21
15
  flex-direction: column;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 获取唯一 ID
3
+ * @returns 唯一的 ID
4
+ */
5
+ export declare function getUniqId(): string;
@@ -0,0 +1,12 @@
1
+ import { customAlphabet } from 'nanoid';
2
+ /**
3
+ * 获取唯一 ID
4
+ * @returns 唯一的 ID
5
+ */
6
+ export function getUniqId() {
7
+ // 16位的长度,每秒生成1000个ID的话,240年时间才有1%的可能性产生一次 ID 冲突
8
+ // 参考 https://zelark.github.io/nano-id-cc/
9
+ var CHARACTER_LEN = 16;
10
+ var alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
11
+ return customAlphabet(alphabet, CHARACTER_LEN)();
12
+ }