taro-react-uilib 1.4.22-0 → 1.4.22-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/Group/index.js +1 -1
- package/dist/components/Checkbox/Group/index.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Notice/index.js +2 -0
- package/dist/components/Notice/index.js.map +1 -0
- package/dist/components/Radio/Group/index.js +1 -1
- package/dist/components/Radio/Group/index.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/src/index.js +1 -1
- package/dist/components/src/utils/index.js +1 -1
- package/dist/components/src/utils/index.js.map +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/font/iconfont.ttf +0 -0
- package/dist/styles/components/font/iconfont.woff +0 -0
- package/dist/styles/components/font/iconfont.woff2 +0 -0
- package/dist/styles/components/icon.scss +5 -1
- package/dist/styles/components/index.scss +2 -0
- package/dist/styles/components/notice.scss +43 -0
- package/dist/styles/components/tabnav.scss +97 -0
- package/package.json +2 -2
- package/types/components/ActionSheet/index.d.ts +43 -44
- package/types/components/ActivityIndicator/index.d.ts +12 -13
- package/types/components/AmountInput/index.d.ts +25 -26
- package/types/components/AmountKeyboard/index.d.ts +35 -36
- package/types/components/Animated/Animated.d.ts +11 -12
- package/types/components/Animated/Fade/index.d.ts +9 -9
- package/types/components/Animated/Scale/index.d.ts +9 -9
- package/types/components/Animated/Slide/index.d.ts +11 -11
- package/types/components/Animated/index.d.ts +3 -3
- package/types/components/Badge/index.d.ts +7 -8
- package/types/components/BankCardNumberInput/index.d.ts +47 -48
- package/types/components/BankIcon/index.d.ts +8 -9
- package/types/components/Button/DotJump.d.ts +7 -7
- package/types/components/Button/index.d.ts +29 -30
- package/types/components/Captcha/index.d.ts +24 -25
- package/types/components/Cell/index.d.ts +29 -30
- package/types/components/Checkbox/Group/index.d.ts +23 -23
- package/types/components/Checkbox/index.d.ts +28 -29
- package/types/components/CheckboxButton/index.d.ts +23 -24
- package/types/components/Collapse/index.d.ts +10 -11
- package/types/components/Countdown/index.d.ts +10 -11
- package/types/components/Dialog/Alert/index.d.ts +26 -26
- package/types/components/Dialog/Confirm/index.d.ts +37 -37
- package/types/components/Dialog/index.d.ts +11 -11
- package/types/components/DialogComponent/index.d.ts +18 -19
- package/types/components/DialogRef/index.d.ts +37 -38
- package/types/components/Echarts/index.d.ts +5 -5
- package/types/components/Echarts/types.d.ts +34 -34
- package/types/components/Echarts/weapp/wx-canvas.d.ts +21 -21
- package/types/components/Echarts/weapp/wx-touch.d.ts +13 -13
- package/types/components/FormInput/index.d.ts +55 -56
- package/types/components/IDNumberInput/index.d.ts +39 -40
- package/types/components/Icon/index.d.ts +13 -14
- package/types/components/Image/index.d.ts +11 -12
- package/types/components/LicensePlateInput/Keyboard.d.ts +26 -27
- package/types/components/LicensePlateInput/index.d.ts +37 -38
- package/types/components/LinkMan/index.d.ts +33 -34
- package/types/components/List/index.d.ts +21 -22
- package/types/components/Loading/index.d.ts +11 -12
- package/types/components/Mask/index.d.ts +9 -10
- package/types/components/NavBar/index.d.ts +11 -12
- package/types/components/Notice/index.d.ts +13 -0
- package/types/components/NumberKeyboard/index.d.ts +24 -25
- package/types/components/Page/index.d.ts +21 -22
- package/types/components/PasswordInput/index.d.ts +10 -11
- package/types/components/Picker/Picker.d.ts +24 -24
- package/types/components/Picker/PickerSlot.d.ts +23 -24
- package/types/components/Picker/index.d.ts +12 -13
- package/types/components/Popup/index.d.ts +10 -11
- package/types/components/Progress/index.d.ts +21 -22
- package/types/components/ProgressCircle/index.d.ts +13 -14
- package/types/components/Radio/Group/index.d.ts +29 -29
- package/types/components/Radio/index.d.ts +29 -30
- package/types/components/Rank/index.d.ts +13 -14
- package/types/components/Result/index.d.ts +23 -24
- package/types/components/ScrollView/index.d.ts +11 -11
- package/types/components/Space/Item.d.ts +11 -11
- package/types/components/Space/config-provider.d.ts +12 -12
- package/types/components/Space/index.d.ts +20 -21
- package/types/components/Step/Steps/index.d.ts +14 -14
- package/types/components/Step/index.d.ts +19 -20
- package/types/components/Switch/index.d.ts +11 -12
- package/types/components/TabNav/TabNavItem/index.d.ts +8 -0
- package/types/components/TabNav/index.d.ts +27 -0
- package/types/components/Tabbar/index.d.ts +8 -9
- package/types/components/Tabbar/tabbar/TabItem.d.ts +8 -8
- package/types/components/Tabbar/tabbar/Tabbar.d.ts +31 -31
- package/types/components/ThemeProvider/index.d.ts +30 -30
- package/types/components/Toast/Toast.d.ts +19 -20
- package/types/components/Toast/index.d.ts +4 -5
- package/types/hooks/index.d.ts +2 -2
- package/types/hooks/useCustomNavbar.d.ts +6 -6
- package/types/hooks/useFirstMountState.d.ts +1 -1
- package/types/hooks/useFlexGapSupport.d.ts +2 -2
- package/types/hooks/useGenerateId.d.ts +1 -1
- package/types/hooks/usePrevious.d.ts +1 -1
- package/types/hooks/useRefs.d.ts +1 -1
- package/types/hooks/useTouch.d.ts +18 -18
- package/types/hooks/useUnMount.d.ts +1 -1
- package/types/hooks/useUpdateEffect.d.ts +1 -1
- package/types/index.d.ts +44 -43
- package/types/types/index.d.ts +5 -5
- package/types/utils/index.d.ts +57 -57
- package/lib/components/ActionSheet/index.js +0 -67
- package/lib/components/ActionSheet/index.js.map +0 -1
- package/lib/components/ActivityIndicator/index.js +0 -30
- package/lib/components/ActivityIndicator/index.js.map +0 -1
- package/lib/components/AmountInput/index.js +0 -53
- package/lib/components/AmountInput/index.js.map +0 -1
- package/lib/components/AmountKeyboard/index.js +0 -134
- package/lib/components/AmountKeyboard/index.js.map +0 -1
- package/lib/components/Animated/Animated.js +0 -20
- package/lib/components/Animated/Animated.js.map +0 -1
- package/lib/components/Animated/Fade/index.js +0 -19
- package/lib/components/Animated/Fade/index.js.map +0 -1
- package/lib/components/Animated/Scale/index.js +0 -19
- package/lib/components/Animated/Scale/index.js.map +0 -1
- package/lib/components/Animated/Slide/index.js +0 -19
- package/lib/components/Animated/Slide/index.js.map +0 -1
- package/lib/components/Animated/index.js +0 -5
- package/lib/components/Animated/index.js.map +0 -1
- package/lib/components/Badge/index.js +0 -11
- package/lib/components/Badge/index.js.map +0 -1
- package/lib/components/BankCardNumberInput/index.js +0 -44
- package/lib/components/BankCardNumberInput/index.js.map +0 -1
- package/lib/components/BankIcon/index.js +0 -12
- package/lib/components/BankIcon/index.js.map +0 -1
- package/lib/components/Button/DotJump.js +0 -13
- package/lib/components/Button/DotJump.js.map +0 -1
- package/lib/components/Button/index.js +0 -62
- package/lib/components/Button/index.js.map +0 -1
- package/lib/components/Captcha/index.js +0 -76
- package/lib/components/Captcha/index.js.map +0 -1
- package/lib/components/Cell/index.js +0 -29
- package/lib/components/Cell/index.js.map +0 -1
- package/lib/components/Checkbox/Group/index.js +0 -49
- package/lib/components/Checkbox/Group/index.js.map +0 -1
- package/lib/components/Checkbox/index.js +0 -55
- package/lib/components/Checkbox/index.js.map +0 -1
- package/lib/components/CheckboxButton/index.js +0 -30
- package/lib/components/CheckboxButton/index.js.map +0 -1
- package/lib/components/Collapse/index.js +0 -47
- package/lib/components/Collapse/index.js.map +0 -1
- package/lib/components/Countdown/index.js +0 -69
- package/lib/components/Countdown/index.js.map +0 -1
- package/lib/components/Dialog/Alert/index.js +0 -35
- package/lib/components/Dialog/Alert/index.js.map +0 -1
- package/lib/components/Dialog/Confirm/index.js +0 -41
- package/lib/components/Dialog/Confirm/index.js.map +0 -1
- package/lib/components/Dialog/index.js +0 -8
- package/lib/components/Dialog/index.js.map +0 -1
- package/lib/components/DialogComponent/index.js +0 -36
- package/lib/components/DialogComponent/index.js.map +0 -1
- package/lib/components/DialogRef/index.js +0 -55
- package/lib/components/DialogRef/index.js.map +0 -1
- package/lib/components/Echarts/index.js +0 -276
- package/lib/components/Echarts/index.js.map +0 -1
- package/lib/components/Echarts/types.js +0 -2
- package/lib/components/Echarts/types.js.map +0 -1
- package/lib/components/Echarts/weapp/wx-canvas.js +0 -125
- package/lib/components/Echarts/weapp/wx-canvas.js.map +0 -1
- package/lib/components/Echarts/weapp/wx-touch.js +0 -75
- package/lib/components/Echarts/weapp/wx-touch.js.map +0 -1
- package/lib/components/FormInput/index.js +0 -75
- package/lib/components/FormInput/index.js.map +0 -1
- package/lib/components/IDNumberInput/index.js +0 -37
- package/lib/components/IDNumberInput/index.js.map +0 -1
- package/lib/components/Icon/index.js +0 -24
- package/lib/components/Icon/index.js.map +0 -1
- package/lib/components/Image/index.js +0 -48
- package/lib/components/Image/index.js.map +0 -1
- package/lib/components/LicensePlateInput/Keyboard.js +0 -168
- package/lib/components/LicensePlateInput/Keyboard.js.map +0 -1
- package/lib/components/LicensePlateInput/index.js +0 -94
- package/lib/components/LicensePlateInput/index.js.map +0 -1
- package/lib/components/LinkMan/index.js +0 -348
- package/lib/components/LinkMan/index.js.map +0 -1
- package/lib/components/List/index.js +0 -26
- package/lib/components/List/index.js.map +0 -1
- package/lib/components/Loading/index.js +0 -18
- package/lib/components/Loading/index.js.map +0 -1
- package/lib/components/Mask/index.js +0 -17
- package/lib/components/Mask/index.js.map +0 -1
- package/lib/components/NavBar/index.js +0 -41
- package/lib/components/NavBar/index.js.map +0 -1
- package/lib/components/NumberKeyboard/index.js +0 -63
- package/lib/components/NumberKeyboard/index.js.map +0 -1
- package/lib/components/Page/index.js +0 -30
- package/lib/components/Page/index.js.map +0 -1
- package/lib/components/PasswordInput/index.js +0 -24
- package/lib/components/PasswordInput/index.js.map +0 -1
- package/lib/components/Picker/Picker.js +0 -205
- package/lib/components/Picker/Picker.js.map +0 -1
- package/lib/components/Picker/PickerSlot.js +0 -226
- package/lib/components/Picker/PickerSlot.js.map +0 -1
- package/lib/components/Picker/index.js +0 -33
- package/lib/components/Picker/index.js.map +0 -1
- package/lib/components/Popup/index.js +0 -60
- package/lib/components/Popup/index.js.map +0 -1
- package/lib/components/Progress/index.js +0 -29
- package/lib/components/Progress/index.js.map +0 -1
- package/lib/components/ProgressCircle/index.js +0 -22
- package/lib/components/ProgressCircle/index.js.map +0 -1
- package/lib/components/Radio/Group/index.js +0 -58
- package/lib/components/Radio/Group/index.js.map +0 -1
- package/lib/components/Radio/index.js +0 -56
- package/lib/components/Radio/index.js.map +0 -1
- package/lib/components/Rank/index.js +0 -22
- package/lib/components/Rank/index.js.map +0 -1
- package/lib/components/Result/index.js +0 -38
- package/lib/components/Result/index.js.map +0 -1
- package/lib/components/ScrollView/index.js +0 -34
- package/lib/components/ScrollView/index.js.map +0 -1
- package/lib/components/Space/Item.js +0 -25
- package/lib/components/Space/Item.js.map +0 -1
- package/lib/components/Space/config-provider.js +0 -8
- package/lib/components/Space/config-provider.js.map +0 -1
- package/lib/components/Space/index.js +0 -77
- package/lib/components/Space/index.js.map +0 -1
- package/lib/components/Step/Steps/index.js +0 -33
- package/lib/components/Step/Steps/index.js.map +0 -1
- package/lib/components/Step/index.js +0 -20
- package/lib/components/Step/index.js.map +0 -1
- package/lib/components/Switch/index.js +0 -26
- package/lib/components/Switch/index.js.map +0 -1
- package/lib/components/Tabbar/index.js +0 -7
- package/lib/components/Tabbar/index.js.map +0 -1
- package/lib/components/Tabbar/tabbar/TabItem.js +0 -9
- package/lib/components/Tabbar/tabbar/TabItem.js.map +0 -1
- package/lib/components/Tabbar/tabbar/Tabbar.js +0 -87
- package/lib/components/Tabbar/tabbar/Tabbar.js.map +0 -1
- package/lib/components/ThemeProvider/index.js +0 -32
- package/lib/components/ThemeProvider/index.js.map +0 -1
- package/lib/components/Toast/Toast.js +0 -38
- package/lib/components/Toast/Toast.js.map +0 -1
- package/lib/components/Toast/index.js +0 -56
- package/lib/components/Toast/index.js.map +0 -1
- package/lib/hooks/index.js +0 -17
- package/lib/hooks/index.js.map +0 -1
- package/lib/hooks/useCustomNavbar.js +0 -24
- package/lib/hooks/useCustomNavbar.js.map +0 -1
- package/lib/hooks/useFirstMountState.js +0 -10
- package/lib/hooks/useFirstMountState.js.map +0 -1
- package/lib/hooks/useFlexGapSupport.js +0 -10
- package/lib/hooks/useFlexGapSupport.js.map +0 -1
- package/lib/hooks/useGenerateId.js +0 -12
- package/lib/hooks/useGenerateId.js.map +0 -1
- package/lib/hooks/usePrevious.js +0 -9
- package/lib/hooks/usePrevious.js.map +0 -1
- package/lib/hooks/useRefs.js +0 -13
- package/lib/hooks/useRefs.js.map +0 -1
- package/lib/hooks/useTouch.js +0 -67
- package/lib/hooks/useTouch.js.map +0 -1
- package/lib/hooks/useUnMount.js +0 -5
- package/lib/hooks/useUnMount.js.map +0 -1
- package/lib/hooks/useUpdateEffect.js +0 -12
- package/lib/hooks/useUpdateEffect.js.map +0 -1
- package/lib/index.js +0 -44
- package/lib/index.js.map +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +0 -1
- package/lib/utils/index.js +0 -320
- package/lib/utils/index.js.map +0 -1
- package/types/components/BankIcon/bank.d.ts +0 -18
- package/types/components/Dialog/Dialog/index.d.ts +0 -19
- package/types/components/Dialog/DialogComponent/index.d.ts +0 -19
- package/types/components/NumberKeyboard/Key/index.d.ts +0 -8
- package/types/components/PickerSlot/index.d.ts +0 -24
- package/types/components/Tabbar/components/TabItem.d.ts +0 -9
- package/types/components/Tabbar/components/Tabbar.d.ts +0 -30
- package/types/components/Theme/index.d.ts +0 -27
package/lib/utils/index.js
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 禁止输入emoji表情
|
|
3
|
-
* @param {string} val - 输入内容
|
|
4
|
-
* @returns {boolean} - 校验结果 返回 true || false
|
|
5
|
-
*/
|
|
6
|
-
import React from "react";
|
|
7
|
-
export const inputRange = (val) => {
|
|
8
|
-
let iconRule1 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi;
|
|
9
|
-
return val.replace(iconRule1, "");
|
|
10
|
-
};
|
|
11
|
-
// function Handler(fn) {
|
|
12
|
-
// this.handler = fn;
|
|
13
|
-
// this.next = null;
|
|
14
|
-
// }
|
|
15
|
-
// Handler.prototype.setNext = function setNext(h) {
|
|
16
|
-
// this.next = h;
|
|
17
|
-
// return h;
|
|
18
|
-
// };
|
|
19
|
-
// Handler.prototype.passRequest = function () {
|
|
20
|
-
// const ret = this.handler.apply(this, arguments);
|
|
21
|
-
// // 提前结束
|
|
22
|
-
// if (!ret) {
|
|
23
|
-
// return ret;
|
|
24
|
-
// }
|
|
25
|
-
// // 向后传递
|
|
26
|
-
// if (this.next) {
|
|
27
|
-
// return this.next.passRequest.apply(this.next, arguments);
|
|
28
|
-
// }
|
|
29
|
-
// return ret;
|
|
30
|
-
// };
|
|
31
|
-
// export class ChainHander {
|
|
32
|
-
// public hander: (s: string) => boolean
|
|
33
|
-
// public next
|
|
34
|
-
// constructor(fn: (str: string) => boolean) {
|
|
35
|
-
// this.hander = fn
|
|
36
|
-
// }
|
|
37
|
-
// public setNext(callback): () => boolean {
|
|
38
|
-
// this.next = callback
|
|
39
|
-
// return callback
|
|
40
|
-
// }
|
|
41
|
-
// public checkPass(...arg) {
|
|
42
|
-
// const result = this.hander.apply(this, arg)
|
|
43
|
-
// if (!result) {
|
|
44
|
-
// return result
|
|
45
|
-
// }
|
|
46
|
-
// if (this.next != null) {
|
|
47
|
-
// return this.next.checkPass.apply(this.next, arg)
|
|
48
|
-
// }
|
|
49
|
-
// return result
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
|
-
export const throtte = (fn, delay = 1500) => {
|
|
53
|
-
let timer;
|
|
54
|
-
let canCall = true;
|
|
55
|
-
return function (arg) {
|
|
56
|
-
if (canCall) {
|
|
57
|
-
canCall = false;
|
|
58
|
-
fn(arg);
|
|
59
|
-
}
|
|
60
|
-
timer = setTimeout(() => {
|
|
61
|
-
canCall = true;
|
|
62
|
-
clearTimeout(timer);
|
|
63
|
-
}, delay);
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export const debounce = (fn, delay = 1500) => {
|
|
67
|
-
let timer = null;
|
|
68
|
-
return function () {
|
|
69
|
-
const context = this;
|
|
70
|
-
const arg = arguments;
|
|
71
|
-
if (timer)
|
|
72
|
-
clearTimeout(timer);
|
|
73
|
-
timer = setTimeout(() => {
|
|
74
|
-
fn.apply(context, arg);
|
|
75
|
-
}, delay);
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
export function pxTransform(size, designWidth = 750) {
|
|
79
|
-
if (!size)
|
|
80
|
-
return "";
|
|
81
|
-
const deviceRatio = {
|
|
82
|
-
640: 2.34 / 2,
|
|
83
|
-
750: 1,
|
|
84
|
-
828: 1.81 / 2,
|
|
85
|
-
};
|
|
86
|
-
if (process.env.TARO_ENV === "h5")
|
|
87
|
-
return (Math.ceil((((parseInt(`${size}`, 10) / 40) * 640) / designWidth) * 10000) /
|
|
88
|
-
10000 +
|
|
89
|
-
"rem");
|
|
90
|
-
return `${size / deviceRatio[designWidth]}rpx`;
|
|
91
|
-
}
|
|
92
|
-
let flexGapSupported;
|
|
93
|
-
export const detectFlexGapSupported = () => {
|
|
94
|
-
if (flexGapSupported !== undefined) {
|
|
95
|
-
return flexGapSupported;
|
|
96
|
-
}
|
|
97
|
-
const flex = document.createElement("div");
|
|
98
|
-
flex.style.display = "flex";
|
|
99
|
-
flex.style.flexDirection = "column";
|
|
100
|
-
flex.style.rowGap = "1px";
|
|
101
|
-
flex.appendChild(document.createElement("div"));
|
|
102
|
-
flex.appendChild(document.createElement("div"));
|
|
103
|
-
document.body.appendChild(flex);
|
|
104
|
-
flexGapSupported = flex.scrollHeight === 1;
|
|
105
|
-
document.body.removeChild(flex);
|
|
106
|
-
return flexGapSupported;
|
|
107
|
-
};
|
|
108
|
-
export function toArray(children, option = {}) {
|
|
109
|
-
let ret = [];
|
|
110
|
-
React.Children.forEach(children, (child) => {
|
|
111
|
-
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (Array.isArray(child)) {
|
|
115
|
-
ret = ret.concat(toArray(child));
|
|
116
|
-
}
|
|
117
|
-
else if (isFragment(child) && child.props) {
|
|
118
|
-
ret = ret.concat(toArray(child.props.children, option));
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
ret.push(child);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
return ret;
|
|
125
|
-
}
|
|
126
|
-
function isFragment(object) {
|
|
127
|
-
return (object.$$typeof === Symbol.for("react.element") &&
|
|
128
|
-
object.type === Symbol.for("react.fragment"));
|
|
129
|
-
}
|
|
130
|
-
// 获取 校验银行卡
|
|
131
|
-
export const checkBankCard = (cardNo) => {
|
|
132
|
-
if (!cardNo)
|
|
133
|
-
return false;
|
|
134
|
-
let tmp = true;
|
|
135
|
-
let total = 0;
|
|
136
|
-
for (let i = cardNo.length; i > 0; i--) {
|
|
137
|
-
let num = +cardNo.substring(i, i - 1);
|
|
138
|
-
if (((tmp = !tmp), tmp))
|
|
139
|
-
num = num * 2;
|
|
140
|
-
const gw = num % 10;
|
|
141
|
-
total += gw + (num - gw) / 10;
|
|
142
|
-
}
|
|
143
|
-
return total % 10 === 0;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* 格式化银行卡号
|
|
147
|
-
*
|
|
148
|
-
* @export
|
|
149
|
-
* @param {string} cardNum 6217002712347888987
|
|
150
|
-
* @param {boolean} mask 是否掩码
|
|
151
|
-
* @returns {string} 6217 0027 1234 7888 987
|
|
152
|
-
*/
|
|
153
|
-
export function creditCard(cardNum, mask) {
|
|
154
|
-
const newCardNum = cardNum
|
|
155
|
-
.replace(/[^\d]/g, "")
|
|
156
|
-
.replace(/(\d{4})(?=\d)/g, "$1 ");
|
|
157
|
-
return mask ? newCardNum.replace(/\s(\d{4})(?!\d)/g, " ****") : newCardNum;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* 校验身份证号是否符合规范
|
|
161
|
-
*
|
|
162
|
-
* @export
|
|
163
|
-
* @param {string} idcard
|
|
164
|
-
* @returns {boolean} true 符合 | false 不符合
|
|
165
|
-
*/
|
|
166
|
-
export function verifyIdcard(idcard) {
|
|
167
|
-
if (!idcard)
|
|
168
|
-
return false;
|
|
169
|
-
let regex1 = /^[1-9][0-7]\d{4}((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229))\d{3}(\d|X|x)?$/;
|
|
170
|
-
/* 身份号码位数及格式检验 */
|
|
171
|
-
switch (idcard.length) {
|
|
172
|
-
case 15:
|
|
173
|
-
if ((parseInt(idcard.substr(6, 2)) + 1900) % 4 === 0 ||
|
|
174
|
-
((parseInt(idcard.substr(6, 2)) + 1900) % 100 === 0 &&
|
|
175
|
-
(parseInt(idcard.substr(6, 2)) + 1900) % 4 === 0)) {
|
|
176
|
-
let regex2 = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/; // 测试出生日期的合法性
|
|
177
|
-
if (regex2.test(idcard)) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
|
-
// eslint-disable-next-line
|
|
183
|
-
let regex2 = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/; // 测试出生日期的合法性
|
|
184
|
-
if (regex2.test(idcard)) {
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
return false;
|
|
188
|
-
case 18:
|
|
189
|
-
if (regex1.test(idcard)) {
|
|
190
|
-
let S = (parseInt(idcard.charAt(0)) + parseInt(idcard.charAt(10))) * 7 +
|
|
191
|
-
(parseInt(idcard.charAt(1)) + parseInt(idcard.charAt(11))) * 9 +
|
|
192
|
-
(parseInt(idcard.charAt(2)) + parseInt(idcard.charAt(12))) * 10 +
|
|
193
|
-
(parseInt(idcard.charAt(3)) + parseInt(idcard.charAt(13))) * 5 +
|
|
194
|
-
(parseInt(idcard.charAt(4)) + parseInt(idcard.charAt(14))) * 8 +
|
|
195
|
-
(parseInt(idcard.charAt(5)) + parseInt(idcard.charAt(15))) * 4 +
|
|
196
|
-
(parseInt(idcard.charAt(6)) + parseInt(idcard.charAt(16))) * 2 +
|
|
197
|
-
parseInt(idcard.charAt(7)) * 1 +
|
|
198
|
-
parseInt(idcard.charAt(8)) * 6 +
|
|
199
|
-
parseInt(idcard.charAt(9)) * 3;
|
|
200
|
-
let Y = S % 11;
|
|
201
|
-
let M = "F";
|
|
202
|
-
let JYM = "10X98765432";
|
|
203
|
-
M = JYM.substr(Y, 1);
|
|
204
|
-
/* 判断校验位 */
|
|
205
|
-
if (M === idcard.charAt(17).toUpperCase()) {
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
break;
|
|
211
|
-
default:
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
export function tripleDefer(func) {
|
|
217
|
-
setTimeout(() => setTimeout(() => setTimeout(() => func())));
|
|
218
|
-
}
|
|
219
|
-
export function isString(v) {
|
|
220
|
-
return typeof v === "string";
|
|
221
|
-
}
|
|
222
|
-
export function isFunction(v) {
|
|
223
|
-
return typeof v === "function";
|
|
224
|
-
}
|
|
225
|
-
export function isEqual(x, y) {
|
|
226
|
-
if (x === y) {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
else if (typeof x === "object" &&
|
|
230
|
-
x !== null &&
|
|
231
|
-
typeof y === "object" &&
|
|
232
|
-
y !== null) {
|
|
233
|
-
const keysX = Object.keys(x);
|
|
234
|
-
const keysY = Object.keys(y);
|
|
235
|
-
if (keysX.length !== keysY.length) {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
for (const key of keysX) {
|
|
239
|
-
if (!isEqual(x[key], y[key])) {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
export function pick(obj, keys) {
|
|
248
|
-
const r = {};
|
|
249
|
-
keys.forEach(key => {
|
|
250
|
-
r[key] = obj[key];
|
|
251
|
-
});
|
|
252
|
-
return r;
|
|
253
|
-
}
|
|
254
|
-
const idCounter = {};
|
|
255
|
-
export function uniqueId(prefix = "$unique$") {
|
|
256
|
-
if (!idCounter[prefix]) {
|
|
257
|
-
idCounter[prefix] = 0;
|
|
258
|
-
}
|
|
259
|
-
const id = ++idCounter[prefix];
|
|
260
|
-
if (prefix === "$unique$") {
|
|
261
|
-
return `${id}`;
|
|
262
|
-
}
|
|
263
|
-
return `${prefix}${id}`;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* 版本号比较进阶版
|
|
267
|
-
* @param {string} ver1 5.19.1 前一个版本
|
|
268
|
-
* @param {string} ver2 5.18.3 后一个版本
|
|
269
|
-
* @returns {number} 1: 前一个版本 大于 后一个版本
|
|
270
|
-
* -1: 前一个版本 小于 后一个版本
|
|
271
|
-
* 0: 前一个版本 等于 后一个版本
|
|
272
|
-
*/
|
|
273
|
-
export function compareVersion(ver1, ver2) {
|
|
274
|
-
let v1 = ver1.split(".");
|
|
275
|
-
let v2 = ver2.split(".");
|
|
276
|
-
const len = Math.max(v1.length, v2.length);
|
|
277
|
-
// 调整两个版本号位数相同
|
|
278
|
-
while (v1.length < len) {
|
|
279
|
-
v1.push("0");
|
|
280
|
-
}
|
|
281
|
-
while (v2.length < len) {
|
|
282
|
-
v2.push("0");
|
|
283
|
-
}
|
|
284
|
-
// 循环判断每位数的大小
|
|
285
|
-
for (let i = 0; i < len; i++) {
|
|
286
|
-
const num1 = parseInt(v1[i]);
|
|
287
|
-
const num2 = parseInt(v2[i]);
|
|
288
|
-
if (num1 > num2) {
|
|
289
|
-
//前一个版本 大于 后一个版本
|
|
290
|
-
return 1;
|
|
291
|
-
}
|
|
292
|
-
else if (num1 < num2) {
|
|
293
|
-
//前一个版本 小于 后一个版本
|
|
294
|
-
return -1;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return 0;
|
|
298
|
-
}
|
|
299
|
-
export const replaceCharByIndex = (str, index, replace) => {
|
|
300
|
-
return str.substring(0, index) + replace + str.substring(index + 1);
|
|
301
|
-
};
|
|
302
|
-
/**
|
|
303
|
-
* 车牌号正则校验
|
|
304
|
-
*
|
|
305
|
-
* @export
|
|
306
|
-
* @param {string} str 车牌号
|
|
307
|
-
* @returns {boolean} false | true
|
|
308
|
-
*/
|
|
309
|
-
export const isLicenseNo = (str) => {
|
|
310
|
-
let xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
|
|
311
|
-
let creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
|
|
312
|
-
if (str.length === 7) {
|
|
313
|
-
return creg.test(str);
|
|
314
|
-
}
|
|
315
|
-
else if (str.length === 8) {
|
|
316
|
-
return xreg.test(str);
|
|
317
|
-
}
|
|
318
|
-
return false;
|
|
319
|
-
};
|
|
320
|
-
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAU,EAAE;IAChD,IAAI,SAAS,GACX,4OAA4O,CAAC;IAC/O,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,yBAAyB;AACzB,uBAAuB;AACvB,sBAAsB;AACtB,IAAI;AAEJ,oDAAoD;AACpD,mBAAmB;AACnB,cAAc;AACd,KAAK;AAEL,gDAAgD;AAChD,qDAAqD;AACrD,YAAY;AACZ,gBAAgB;AAChB,kBAAkB;AAClB,MAAM;AAEN,WAAW;AACX,qBAAqB;AACrB,gEAAgE;AAChE,MAAM;AACN,gBAAgB;AAChB,KAAK;AAEL,6BAA6B;AAC7B,0CAA0C;AAC1C,gBAAgB;AAChB,gDAAgD;AAChD,uBAAuB;AACvB,MAAM;AACN,8CAA8C;AAC9C,2BAA2B;AAC3B,sBAAsB;AACtB,MAAM;AACN,+BAA+B;AAC/B,kDAAkD;AAClD,qBAAqB;AACrB,sBAAsB;AACtB,QAAQ;AAER,+BAA+B;AAC/B,yDAAyD;AACzD,QAAQ;AAER,oBAAoB;AACpB,MAAM;AACN,IAAI;AAEJ,MAAM,CAAC,MAAM,OA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AAI,IAAI,GACN,mGAAmG,CAAC;IACtG,IAAI,IAAI,GACN,4FAA4F,CAAC;IAC/F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACvB;SAAM,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACvB;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'102': any;
|
|
3
|
-
'103': any;
|
|
4
|
-
'104': any;
|
|
5
|
-
'105': any;
|
|
6
|
-
'301': any;
|
|
7
|
-
'302': any;
|
|
8
|
-
'303': any;
|
|
9
|
-
'304': any;
|
|
10
|
-
'305': any;
|
|
11
|
-
'306': any;
|
|
12
|
-
'307': any;
|
|
13
|
-
'308': any;
|
|
14
|
-
'309': any;
|
|
15
|
-
'310': any;
|
|
16
|
-
'403': any;
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { XHComponentCommonProps } from "../../../types";
|
|
3
|
-
import "./index.scss";
|
|
4
|
-
export declare type DialogProps = {
|
|
5
|
-
header?: string | ReactNode;
|
|
6
|
-
content: string | ReactNode;
|
|
7
|
-
footer?: string | ReactNode;
|
|
8
|
-
visible: boolean;
|
|
9
|
-
} & XHComponentCommonProps;
|
|
10
|
-
export declare type DialogRef = {
|
|
11
|
-
close: () => void;
|
|
12
|
-
};
|
|
13
|
-
declare const Dialog: React.ForwardRefExoticComponent<{
|
|
14
|
-
header?: string | ReactNode;
|
|
15
|
-
content: string | ReactNode;
|
|
16
|
-
footer?: string | ReactNode;
|
|
17
|
-
visible: boolean;
|
|
18
|
-
} & XHComponentCommonProps & React.RefAttributes<DialogRef>>;
|
|
19
|
-
export default Dialog;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { XHComponentCommonProps } from "../../../types";
|
|
3
|
-
import "./index.scss";
|
|
4
|
-
export declare type DialogProps = {
|
|
5
|
-
header?: string | ReactNode;
|
|
6
|
-
content: string | ReactNode;
|
|
7
|
-
footer?: string | ReactNode;
|
|
8
|
-
visible: boolean;
|
|
9
|
-
} & XHComponentCommonProps;
|
|
10
|
-
export declare type DialogRef = {
|
|
11
|
-
close: () => void;
|
|
12
|
-
};
|
|
13
|
-
declare const DialogCom: React.ForwardRefExoticComponent<{
|
|
14
|
-
header?: string | ReactNode;
|
|
15
|
-
content: string | ReactNode;
|
|
16
|
-
footer?: string | ReactNode;
|
|
17
|
-
visible: boolean;
|
|
18
|
-
} & XHComponentCommonProps & React.RefAttributes<DialogRef>>;
|
|
19
|
-
export default DialogCom;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { MouseEventHandler } from "react";
|
|
2
|
-
import "./index.scss";
|
|
3
|
-
interface PickerObjectValue {
|
|
4
|
-
text: string | number;
|
|
5
|
-
value: string | number;
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
export declare type PickerValue = string | PickerObjectValue;
|
|
9
|
-
interface PickerSlotProps<T extends PickerValue = PickerObjectValue> {
|
|
10
|
-
defaultValue?: string | number;
|
|
11
|
-
data: T[];
|
|
12
|
-
mode?: "normal" | "3D";
|
|
13
|
-
swipeDuration?: number | string;
|
|
14
|
-
onConfirm?: (value: T, index: number) => void;
|
|
15
|
-
onCancel?: MouseEventHandler;
|
|
16
|
-
onClose?: MouseEventHandler;
|
|
17
|
-
keyIndex: number;
|
|
18
|
-
visible: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare const PickerSlot: React.ForwardRefExoticComponent<Partial<PickerSlotProps<PickerObjectValue>> & React.RefAttributes<{
|
|
21
|
-
stopMomentum: () => void;
|
|
22
|
-
moving: boolean;
|
|
23
|
-
}>>;
|
|
24
|
-
export default PickerSlot;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
import "./index.scss";
|
|
3
|
-
export interface TabItemProps extends PropsWithChildren<{}> {
|
|
4
|
-
title?: string;
|
|
5
|
-
TabItemComponent?: ReactNode;
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
declare const TabItem: (props: TabItemProps) => JSX.Element;
|
|
9
|
-
export default TabItem;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FC, ReactElement } from "react";
|
|
2
|
-
import Item from "./TabItem";
|
|
3
|
-
import "./index.scss";
|
|
4
|
-
/**
|
|
5
|
-
* Tab切换
|
|
6
|
-
*
|
|
7
|
-
* @param children //子组件
|
|
8
|
-
* @param animated //是否开启转场动画
|
|
9
|
-
* @param selectIndex //默认选中第几个
|
|
10
|
-
* @param lineColor //下划线颜色
|
|
11
|
-
* @param titleActiveColor //标题选中态颜色
|
|
12
|
-
* @param titleInctiveColor //标题默认态颜色
|
|
13
|
-
* @param onChange //切换回调事件
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export interface TabProps {
|
|
17
|
-
children: ReactElement[];
|
|
18
|
-
animated?: boolean;
|
|
19
|
-
initIndex?: number;
|
|
20
|
-
lineColor?: string;
|
|
21
|
-
titleActiveColor?: string;
|
|
22
|
-
titleInctiveColor?: string;
|
|
23
|
-
onChange?: (index: number) => void;
|
|
24
|
-
}
|
|
25
|
-
export interface TabsComponent<P = {}> extends FC<P> {
|
|
26
|
-
Item: typeof Item;
|
|
27
|
-
}
|
|
28
|
-
declare const XHTabs: TabsComponent<TabProps>;
|
|
29
|
-
export default XHTabs;
|
|
30
|
-
export declare const TabItem: (props: import("./TabItem").TabItemProps) => JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare type ThemeValue = {
|
|
3
|
-
"--color-primary"?: string;
|
|
4
|
-
"--color-primary-dark"?: string;
|
|
5
|
-
"--color-primary-reverse"?: string;
|
|
6
|
-
"--color-disabled"?: string;
|
|
7
|
-
"--color-warning"?: string;
|
|
8
|
-
"--color-warning-light"?: string;
|
|
9
|
-
"--background-color"?: string;
|
|
10
|
-
"--body-background-color"?: string;
|
|
11
|
-
"--font-color"?: string;
|
|
12
|
-
"--font-color-secondary"?: string;
|
|
13
|
-
"--font-color-tertiary"?: string;
|
|
14
|
-
"--border-color"?: string;
|
|
15
|
-
"--btn-color"?: string;
|
|
16
|
-
"--btn-shadow-primary"?: string;
|
|
17
|
-
"--mask-color"?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare type ThemeProviderProps = {
|
|
20
|
-
value: ThemeValue;
|
|
21
|
-
scoped?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare const ThemeContext: React.Context<{
|
|
24
|
-
[x: string]: string;
|
|
25
|
-
}>;
|
|
26
|
-
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
27
|
-
export default ThemeProvider;
|