ebaoferc 0.1.4 → 0.1.6

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 (35) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +43 -43
  3. package/dist/components/MindGraph/core/graphic/drag.js +15 -15
  4. package/dist/components/MindGraph/core/graphic/index.js +105 -105
  5. package/dist/components/MindGraph/core/helper/depth-first-walk-tree.js +4 -4
  6. package/dist/components/MindGraph/core/helper/descendant.js +3 -3
  7. package/dist/components/MindGraph/core/helper/get-layout-calc-children.js +6 -6
  8. package/dist/components/MindGraph/core/helper/judge-if-all-child-fold.js +4 -4
  9. package/dist/components/MindGraph/core/helper/judge-if-heir-and-fold.js +6 -6
  10. package/dist/components/MindGraph/core/helper/judge-if-visual-leaf.js +3 -3
  11. package/dist/components/MindGraph/core/index.d.ts +2 -6
  12. package/dist/components/MindGraph/core/index.js +26 -26
  13. package/dist/components/MindGraph/core/process/layout/structured/get-node-cross-boundary.js +7 -7
  14. package/dist/components/MindGraph/core/process/layout/type.js +20 -20
  15. package/dist/components/MindGraph/core/process/visible.js +3 -3
  16. package/dist/components/MindGraph/react/component/index.module.less +71 -71
  17. package/dist/components/MindGraph/react/scrollbar/axis/index.module.less +47 -47
  18. package/dist/components/SectionTitleBar/index.less +31 -31
  19. package/dist/components/SliderVerify/style.module.less +119 -119
  20. package/dist/components/StyledTable/index.less +1 -1
  21. package/dist/hooks/index.d.ts +1 -1
  22. package/dist/hooks/index.js +1 -1
  23. package/dist/hooks/useTabsTablePagination/index.d.ts +11 -12
  24. package/dist/hooks/useTabsTablePagination/index.js +29 -12
  25. package/dist/utils/file/download.d.ts +2 -0
  26. package/dist/utils/file/download.js +35 -0
  27. package/dist/utils/file/index.d.ts +1 -0
  28. package/dist/utils/file/index.js +1 -0
  29. package/dist/utils/form/index.d.ts +8 -0
  30. package/dist/utils/form/index.js +15 -1
  31. package/dist/utils/format/index.d.ts +4 -0
  32. package/dist/utils/format/index.js +12 -0
  33. package/dist/utils/index.d.ts +1 -0
  34. package/dist/utils/index.js +1 -0
  35. package/package.json +4 -2
@@ -1,119 +1,119 @@
1
- .slider {
2
- background-color: #fff;
3
- width: 278px;
4
- z-index: 999;
5
- box-sizing: border-box;
6
- padding: 9px;
7
- border-radius: 6px;
8
- box-shadow: 0 0 11px 0 #999;
9
- user-select: none;
10
- }
11
-
12
- .slider .content {
13
- width: 100%;
14
- height: 159px;
15
- position: relative;
16
- }
17
-
18
- .bg-img-div {
19
- width: 100%;
20
- height: 100%;
21
- position: absolute;
22
- transform: translate(0, 0);
23
- }
24
-
25
- .slider-img-div {
26
- height: 100%;
27
- position: absolute;
28
- transform: translate(0, 0);
29
- }
30
-
31
- .bg-img-div img {
32
- width: 100%;
33
- -webkit-user-drag: none;
34
- -khtml-user-drag: none;
35
- -moz-user-drag: none;
36
- -o-user-drag: none;
37
- }
38
-
39
- .slider-img-div img {
40
- height: 100%;
41
- -webkit-user-drag: none;
42
- -khtml-user-drag: none;
43
- -moz-user-drag: none;
44
- -o-user-drag: none;
45
- }
46
-
47
- .slider .slider-move {
48
- width: 100%;
49
- margin: 11px 0;
50
- position: relative;
51
- }
52
-
53
- .slider .bottom {
54
- width: 100%;
55
- display: flex;
56
- justify-content: flex-end;
57
- }
58
-
59
- .refresh-btn,
60
- .close-btn {
61
- display: inline-block;
62
- }
63
-
64
- .slider-move .slider-move-track {
65
- line-height: 32px;
66
- font-size: 14px;
67
- text-align: center;
68
- white-space: nowrap;
69
- color: #88949d;
70
- user-select: none;
71
- border-radius: 20px;
72
- background: #dfe1e2;
73
- box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 15%);
74
- }
75
-
76
- .slider-move .slider-move-btn {
77
- transform: translate(0, 0);
78
- position: absolute;
79
- top: -8px;
80
- left: 0;
81
- width: 48px;
82
- height: 48px;
83
- -webkit-user-drag: none;
84
- -khtml-user-drag: none;
85
- -moz-user-drag: none;
86
- -o-user-drag: none;
87
- box-shadow: 0 0 8px 0 rgba(0, 0, 0, 30%), inset 0 0 6px 0 rgba(0, 0, 0, 5%);
88
- background-color: white;
89
- border-radius: 50%;
90
- display: flex;
91
- justify-content: center;
92
- align-items: center;
93
- }
94
-
95
- .slider-move .slider-move-btn-img {
96
- -webkit-user-drag: none;
97
- -khtml-user-drag: none;
98
- -moz-user-drag: none;
99
- -o-user-drag: none;
100
- display: flex;
101
- }
102
-
103
- .slider-move-btn:hover,
104
- .close-btn:hover,
105
- .refresh-btn:hover {
106
- cursor: pointer;
107
- }
108
-
109
- .bottom .close-btn {
110
- width: 20px;
111
- height: 20px;
112
- margin: 5px;
113
- }
114
-
115
- .bottom .refresh-btn {
116
- width: 20px;
117
- height: 20px;
118
- margin: 5px;
119
- }
1
+ .slider {
2
+ background-color: #fff;
3
+ width: 278px;
4
+ z-index: 999;
5
+ box-sizing: border-box;
6
+ padding: 9px;
7
+ border-radius: 6px;
8
+ box-shadow: 0 0 11px 0 #999;
9
+ user-select: none;
10
+ }
11
+
12
+ .slider .content {
13
+ width: 100%;
14
+ height: 159px;
15
+ position: relative;
16
+ }
17
+
18
+ .bg-img-div {
19
+ width: 100%;
20
+ height: 100%;
21
+ position: absolute;
22
+ transform: translate(0, 0);
23
+ }
24
+
25
+ .slider-img-div {
26
+ height: 100%;
27
+ position: absolute;
28
+ transform: translate(0, 0);
29
+ }
30
+
31
+ .bg-img-div img {
32
+ width: 100%;
33
+ -webkit-user-drag: none;
34
+ -khtml-user-drag: none;
35
+ -moz-user-drag: none;
36
+ -o-user-drag: none;
37
+ }
38
+
39
+ .slider-img-div img {
40
+ height: 100%;
41
+ -webkit-user-drag: none;
42
+ -khtml-user-drag: none;
43
+ -moz-user-drag: none;
44
+ -o-user-drag: none;
45
+ }
46
+
47
+ .slider .slider-move {
48
+ width: 100%;
49
+ margin: 11px 0;
50
+ position: relative;
51
+ }
52
+
53
+ .slider .bottom {
54
+ width: 100%;
55
+ display: flex;
56
+ justify-content: flex-end;
57
+ }
58
+
59
+ .refresh-btn,
60
+ .close-btn {
61
+ display: inline-block;
62
+ }
63
+
64
+ .slider-move .slider-move-track {
65
+ line-height: 32px;
66
+ font-size: 14px;
67
+ text-align: center;
68
+ white-space: nowrap;
69
+ color: #88949d;
70
+ user-select: none;
71
+ border-radius: 20px;
72
+ background: #dfe1e2;
73
+ box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 15%);
74
+ }
75
+
76
+ .slider-move .slider-move-btn {
77
+ transform: translate(0, 0);
78
+ position: absolute;
79
+ top: -8px;
80
+ left: 0;
81
+ width: 48px;
82
+ height: 48px;
83
+ -webkit-user-drag: none;
84
+ -khtml-user-drag: none;
85
+ -moz-user-drag: none;
86
+ -o-user-drag: none;
87
+ box-shadow: 0 0 8px 0 rgba(0, 0, 0, 30%), inset 0 0 6px 0 rgba(0, 0, 0, 5%);
88
+ background-color: white;
89
+ border-radius: 50%;
90
+ display: flex;
91
+ justify-content: center;
92
+ align-items: center;
93
+ }
94
+
95
+ .slider-move .slider-move-btn-img {
96
+ -webkit-user-drag: none;
97
+ -khtml-user-drag: none;
98
+ -moz-user-drag: none;
99
+ -o-user-drag: none;
100
+ display: flex;
101
+ }
102
+
103
+ .slider-move-btn:hover,
104
+ .close-btn:hover,
105
+ .refresh-btn:hover {
106
+ cursor: pointer;
107
+ }
108
+
109
+ .bottom .close-btn {
110
+ width: 20px;
111
+ height: 20px;
112
+ margin: 5px;
113
+ }
114
+
115
+ .bottom .refresh-btn {
116
+ width: 20px;
117
+ height: 20px;
118
+ margin: 5px;
119
+ }
@@ -1,6 +1,6 @@
1
1
  .styled-table-row {
2
2
  td {
3
- padding: 7.5px 16px !important;
3
+ padding: 12.67px 16px !important;
4
4
  }
5
5
 
6
6
  &:hover {
@@ -1,3 +1,3 @@
1
1
  export * from './useBIHooks';
2
2
  export * from './useEnhancePagination';
3
- export { default as useTabsTablePagination } from './useTabsTablePagination/index';
3
+ export * from './useTabsTablePagination/index';
@@ -1,3 +1,3 @@
1
1
  export * from "./useBIHooks";
2
2
  export * from "./useEnhancePagination";
3
- export { default as useTabsTablePagination } from "./useTabsTablePagination/index";
3
+ export * from "./useTabsTablePagination/index";
@@ -1,15 +1,15 @@
1
- import { Service } from 'ahooks/lib/usePagination/types';
1
+ import { Data, Params, Service } from 'ahooks/lib/usePagination/types';
2
2
  import { TUseEnhancePaginationOptions } from '../useEnhancePagination';
3
- type TPaginationHookParams = {
3
+ export type TUseTabsTablePaginationParams<TData extends Data, TParams extends Params> = {
4
4
  defaultTabKey: any;
5
5
  tabKeyAlias?: string;
6
6
  tabKeyMaps?: {
7
7
  [key: string]: any[];
8
8
  };
9
- service: Service<any, any>;
10
- options?: TUseEnhancePaginationOptions<any, any>;
9
+ service: Service<TData, TParams>;
10
+ options?: TUseEnhancePaginationOptions<TData, TParams>;
11
11
  };
12
- export default function useTabsTablePagination(params: TPaginationHookParams): {
12
+ export declare function useTabsTablePagination<TData extends Data, TParams extends Params>(params: TUseTabsTablePaginationParams<TData, TParams>): {
13
13
  processQueryFilterOnReset: () => void;
14
14
  onChangeTab: (activeKey: string) => void;
15
15
  filterConditions: any;
@@ -23,15 +23,14 @@ export default function useTabsTablePagination(params: TPaginationHookParams): {
23
23
  changePageSize: (pageSize: number) => void;
24
24
  };
25
25
  loading: boolean;
26
- data?: any;
26
+ data?: TData | undefined;
27
27
  error?: Error | undefined;
28
- params: [] | [any];
28
+ params: [] | TParams;
29
29
  cancel: () => void;
30
30
  refresh: () => void;
31
- refreshAsync: () => Promise<any>;
32
- run: (params_0: any) => void;
33
- runAsync: (params_0: any) => Promise<any>;
34
- mutate: (data?: any) => void;
31
+ refreshAsync: () => Promise<TData>;
32
+ run: (...params: TParams) => void;
33
+ runAsync: (...params: TParams) => Promise<TData>;
34
+ mutate: (data?: TData | ((oldData?: TData | undefined) => TData | undefined) | undefined) => void;
35
35
  listData: any[];
36
36
  };
37
- export {};
@@ -1,9 +1,14 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  var _excluded = ["current", "pageSize"];
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
3
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
8
  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; }
6
9
  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; }
10
+ function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
14
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -14,12 +19,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
14
19
  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; } }
15
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
21
  import { isNullOrUndefined } from "../../utils";
17
- import { useState } from 'react';
22
+ import { useCallback, useState } from 'react';
18
23
  import { useEnhancePagination } from "../useEnhancePagination";
19
24
  var shortCircuitOperation = function shortCircuitOperation(a, b) {
20
25
  return isNullOrUndefined(a) ? b : a;
21
26
  };
22
- export default function useTabsTablePagination(params) {
27
+ export function useTabsTablePagination(params) {
23
28
  var defaultTabKey = params.defaultTabKey,
24
29
  _params$tabKeyAlias = params.tabKeyAlias,
25
30
  tabKeyAlias = _params$tabKeyAlias === void 0 ? 'tabState' : _params$tabKeyAlias,
@@ -33,18 +38,26 @@ export default function useTabsTablePagination(params) {
33
38
  _useState2 = _slicedToArray(_useState, 2),
34
39
  filterConditions = _useState2[0],
35
40
  setFilterConditions = _useState2[1];
36
- var paginationHookRes = useEnhancePagination(function (_ref) {
37
- var _ref$current = _ref.current,
38
- current = _ref$current === void 0 ? 1 : _ref$current,
39
- _ref$pageSize = _ref.pageSize,
40
- pageSize = _ref$pageSize === void 0 ? 10 : _ref$pageSize,
41
- restParams = _objectWithoutProperties(_ref, _excluded);
41
+ var paginationHookRes = useEnhancePagination(function () {
42
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
+ args[_key] = arguments[_key];
44
+ }
45
+ var _ref = args !== null && args !== void 0 ? args : [],
46
+ _ref2 = _toArray(_ref),
47
+ params = _ref2[0],
48
+ otherParams = _ref2.slice(1);
49
+ var _params$current = params.current,
50
+ current = _params$current === void 0 ? 1 : _params$current,
51
+ _params$pageSize = params.pageSize,
52
+ pageSize = _params$pageSize === void 0 ? 10 : _params$pageSize,
53
+ restParams = _objectWithoutProperties(params, _excluded);
42
54
  var newConditions = _objectSpread(_objectSpread({}, restParams), {}, _defineProperty({
43
55
  page: current,
44
56
  limit: pageSize
45
57
  }, tabKeyAlias, getTabValue(shortCircuitOperation(restParams === null || restParams === void 0 ? void 0 : restParams[tabKeyAlias], filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias]))));
46
58
  setFilterConditions(newConditions);
47
- return service(newConditions);
59
+ var finalParams = [newConditions].concat(_toConsumableArray(otherParams));
60
+ return service.apply(void 0, _toConsumableArray(finalParams));
48
61
  }, options);
49
62
  var processQueryFilterOnReset = function processQueryFilterOnReset() {
50
63
  setFilterConditions(_defineProperty({
@@ -52,15 +65,19 @@ export default function useTabsTablePagination(params) {
52
65
  limit: 10
53
66
  }, tabKeyAlias, getTabValue(filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias])));
54
67
  };
55
- var onChangeTab = function onChangeTab(activeKey) {
68
+ var onChangeTab = useCallback(function (activeKey) {
56
69
  var _paginationHookRes$ru;
57
70
  var newFilterConditions = _objectSpread(_objectSpread({}, filterConditions), {}, _defineProperty({
58
71
  page: 1,
59
72
  limit: 10
60
73
  }, tabKeyAlias, getTabValue(activeKey)));
61
74
  setFilterConditions(newFilterConditions);
62
- paginationHookRes === null || paginationHookRes === void 0 || (_paginationHookRes$ru = paginationHookRes.run) === null || _paginationHookRes$ru === void 0 || _paginationHookRes$ru.call(paginationHookRes, newFilterConditions);
63
- };
75
+ var _paginationHookRes$pa = _toArray(paginationHookRes.params),
76
+ _ = _paginationHookRes$pa[0],
77
+ otherParams = _paginationHookRes$pa.slice(1);
78
+ var finalParams = [newFilterConditions].concat(_toConsumableArray(otherParams));
79
+ paginationHookRes === null || paginationHookRes === void 0 || (_paginationHookRes$ru = paginationHookRes.run) === null || _paginationHookRes$ru === void 0 || _paginationHookRes$ru.call.apply(_paginationHookRes$ru, [paginationHookRes].concat(_toConsumableArray(finalParams)));
80
+ }, [paginationHookRes.params]);
64
81
  return _objectSpread(_objectSpread({}, paginationHookRes), {}, {
65
82
  processQueryFilterOnReset: processQueryFilterOnReset,
66
83
  onChangeTab: onChangeTab,
@@ -0,0 +1,2 @@
1
+ export declare function downloadFileByBlob(data: BlobPart, fileFullname: string): void;
2
+ export declare const downloadFileByLink: (href: string) => void;
@@ -0,0 +1,35 @@
1
+ export function downloadFileByBlob(data, fileFullname) {
2
+ if (!window.Blob || !window.URL || !window.URL.createObjectURL) {
3
+ console.error('浏览器不支持 Blob 或 URL.createObjectURL');
4
+ return;
5
+ }
6
+ try {
7
+ var blob = new Blob([data], {
8
+ type: 'application/octet-stream'
9
+ });
10
+ var blobURL = window.URL.createObjectURL(blob);
11
+ var tempLink = document.createElement('a');
12
+ tempLink.style.display = 'none';
13
+ tempLink.href = blobURL;
14
+ tempLink.download = fileFullname;
15
+ document.body.appendChild(tempLink);
16
+ tempLink.click();
17
+ document.body.removeChild(tempLink);
18
+ window.URL.revokeObjectURL(blobURL);
19
+ } catch (error) {
20
+ console.error('下载文件时出错:', error);
21
+ }
22
+ }
23
+ export var downloadFileByLink = function downloadFileByLink(href) {
24
+ try {
25
+ var a = document.createElement('a');
26
+ a.href = href;
27
+ a.download = '';
28
+ a.target = '_blank';
29
+ document.body.appendChild(a);
30
+ a.click();
31
+ document.body.removeChild(a);
32
+ } catch (error) {
33
+ console.error('下载文件时出错:', error);
34
+ }
35
+ };
@@ -0,0 +1 @@
1
+ export * from './download';
@@ -0,0 +1 @@
1
+ export * from "./download";
@@ -4,10 +4,18 @@ export declare const RequiredRules: {
4
4
  }[];
5
5
  required: boolean;
6
6
  };
7
+ export declare const LandlineRule: {
8
+ pattern: RegExp;
9
+ message: string;
10
+ };
7
11
  export declare const PhoneRule: {
8
12
  pattern: RegExp;
9
13
  message: string;
10
14
  };
15
+ export declare const PhoneAndLandlineRule: {
16
+ pattern: RegExp;
17
+ message: string;
18
+ };
11
19
  export declare const IdRule: {
12
20
  pattern: RegExp;
13
21
  message: string;
@@ -4,10 +4,24 @@ export var RequiredRules = {
4
4
  }],
5
5
  required: true
6
6
  };
7
+ var genTelephonePattern = function genTelephonePattern(patterns) {
8
+ return new RegExp("^(".concat(patterns.join('|'), ")$"));
9
+ };
10
+ var LandlinePatternStr = '\\(\\d{3,4}\\)\\s?\\d{7,8}|\\d{3,4}-\\d{7,8}'; // 适应多种座机格式
11
+ var PhonePatternStr = '1[3-9]\\d{9}'; // 手机号的标准格式
12
+
13
+ export var LandlineRule = {
14
+ pattern: genTelephonePattern([LandlinePatternStr]),
15
+ message: '请输入正确的座机号'
16
+ };
7
17
  export var PhoneRule = {
8
- pattern: /^1[3-9]\d{9}$/,
18
+ pattern: genTelephonePattern([PhonePatternStr]),
9
19
  message: '请输入正确的手机号'
10
20
  };
21
+ export var PhoneAndLandlineRule = {
22
+ pattern: genTelephonePattern([PhonePatternStr, LandlinePatternStr]),
23
+ message: '请输入正确的手机号或座机号'
24
+ };
11
25
  export var IdRule = {
12
26
  pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
13
27
  message: '请输入正确的身份证号码'
@@ -3,6 +3,10 @@ type AliasMap<T> = {
3
3
  };
4
4
  export declare function resolveAlias<T>(obj: T, aliasMap: AliasMap<T>): Partial<T>;
5
5
  export declare function isNullOrUndefined(target: any): boolean;
6
+ type TSingleValueToArrayRes<T> = T extends (infer _U)[] ? T : T extends null | undefined ? [] : T[];
7
+ export declare function singleValueToArray<T>(value: T): TSingleValueToArrayRes<T>;
8
+ type TArrayToSingleValueRes<T> = T extends (infer U)[] ? U : T;
9
+ export declare function arrayToSingleValue<T>(value: T): TArrayToSingleValueRes<T>;
6
10
  /**
7
11
  * 给对象第一层的字符串属性值做 trim
8
12
  */
@@ -13,6 +13,18 @@ export function resolveAlias(obj, aliasMap) {
13
13
  export function isNullOrUndefined(target) {
14
14
  return target === null || target === undefined;
15
15
  }
16
+ export function singleValueToArray(value) {
17
+ if (Array.isArray(value)) {
18
+ return value;
19
+ }
20
+ return isNullOrUndefined(value) ? [] : [value];
21
+ }
22
+ export function arrayToSingleValue(value) {
23
+ if (Array.isArray(value)) {
24
+ return value === null || value === void 0 ? void 0 : value[0];
25
+ }
26
+ return value;
27
+ }
16
28
 
17
29
  /**
18
30
  * 给对象第一层的字符串属性值做 trim
@@ -1,3 +1,4 @@
1
1
  export * from './bi/index';
2
+ export * from './file';
2
3
  export * from './form/index';
3
4
  export * from './format/index';
@@ -1,3 +1,4 @@
1
1
  export * from "./bi/index";
2
+ export * from "./file";
2
3
  export * from "./form/index";
3
4
  export * from "./format/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ebaoferc",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -9,7 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build": "father build",
12
+ "build": "node checkProject && father build",
13
13
  "build:watch": "father dev",
14
14
  "dev": "dumi dev",
15
15
  "docs:build": "dumi build",
@@ -63,10 +63,12 @@
63
63
  "ahooks": "^3.7.10",
64
64
  "antd": "^5.17.0",
65
65
  "classnames": "^2.5.1",
66
+ "connect-history-api-fallback": "^2.0.0",
66
67
  "cross-env": "^7.0.3",
67
68
  "dayjs": "^1.11.10",
68
69
  "dumi": "^2.3.0",
69
70
  "eslint": "^8.23.0",
71
+ "express": "^4.19.2",
70
72
  "father": "^4.1.0",
71
73
  "husky": "^8.0.1",
72
74
  "lint-staged": "^13.0.3",