pay-sdk-react 1.1.1 → 1.1.3
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/README.md +38 -20
- package/README.zh-CN.md +38 -20
- package/dist/css/index.css +703 -1
- package/dist/css/index.min.css +1 -0
- package/dist/es/Airwallex/airwallex-button.js +56 -36
- package/dist/es/Airwallex/airwallex-modal.js +41 -34
- package/dist/es/Airwallex/airwallex-popup.js +43 -38
- package/dist/es/Airwallex/airwallex.js +26 -28
- package/dist/es/Airwallex/index.js +1 -1
- package/dist/es/Airwallex/style/index.css +335 -1
- package/dist/es/Airwallex/style/index.min.css +1 -0
- package/dist/es/Alipay/alipay-button.js +39 -24
- package/dist/es/Alipay/alipay-modal.js +38 -32
- package/dist/es/Alipay/alipay.js +22 -15
- package/dist/es/Alipay/index.d.ts +4 -4
- package/dist/es/Alipay/index.js +5 -5
- package/dist/es/Alipay/interface.d.ts +7 -9
- package/dist/es/Alipay/style/index.css +18 -1
- package/dist/es/Alipay/style/index.min.css +1 -0
- package/dist/es/Button/button.js +62 -37
- package/dist/es/Button/index.d.ts +2 -2
- package/dist/es/Button/index.js +2 -2
- package/dist/es/Button/interface.d.ts +4 -0
- package/dist/es/Button/style/index.css +95 -1
- package/dist/es/Button/style/index.min.css +1 -0
- package/dist/es/FullScreenLoading/index.js +40 -40
- package/dist/es/FullScreenLoading/interface.d.ts +2 -2
- package/dist/es/FullScreenLoading/style/index.css +239 -1
- package/dist/es/FullScreenLoading/style/index.min.css +1 -0
- package/dist/es/MAlipay/index.js +1 -1
- package/dist/es/MAlipay/m-alipay-auto-submit.js +9 -11
- package/dist/es/MAlipay/m-alipay-button.js +86 -55
- package/dist/es/MAlipay/style/index.css +252 -1
- package/dist/es/MAlipay/style/index.min.css +1 -0
- package/dist/es/MWeChat/index.d.ts +2 -2
- package/dist/es/MWeChat/index.js +2 -2
- package/dist/es/MWeChat/m-wechat-button.js +86 -54
- package/dist/es/MWeChat/style/index.css +252 -1
- package/dist/es/MWeChat/style/index.min.css +1 -0
- package/dist/es/Mask/index.d.ts +2 -2
- package/dist/es/Mask/index.js +2 -2
- package/dist/es/Mask/mask.js +48 -45
- package/dist/es/Mask/style/index.css +11 -1
- package/dist/es/Mask/style/index.min.css +1 -0
- package/dist/es/PayButton/index.js +2 -2
- package/dist/es/PayButton/interface.d.ts +9 -9
- package/dist/es/PayButton/interface.js +1 -1
- package/dist/es/PayMask/index.d.ts +2 -2
- package/dist/es/PayMask/index.js +2 -2
- package/dist/es/PayMask/interface.d.ts +2 -2
- package/dist/es/PayMask/pay-mask.js +41 -40
- package/dist/es/PayMask/style/index.css +62 -1
- package/dist/es/PayMask/style/index.min.css +1 -0
- package/dist/es/Paypal/index.d.ts +2 -2
- package/dist/es/Paypal/index.js +2 -2
- package/dist/es/Paypal/paypal-button.js +55 -36
- package/dist/es/Paypal/style/index.css +207 -1
- package/dist/es/Paypal/style/index.min.css +1 -0
- package/dist/es/Payssion/index.d.ts +2 -2
- package/dist/es/Payssion/index.js +2 -2
- package/dist/es/Payssion/payssion-button.js +56 -37
- package/dist/es/Payssion/style/index.css +157 -1
- package/dist/es/Payssion/style/index.min.css +1 -0
- package/dist/es/Stripe/index.d.ts +5 -5
- package/dist/es/Stripe/index.js +6 -6
- package/dist/es/Stripe/stripe-button.js +47 -33
- package/dist/es/Stripe/stripe-modal.js +38 -32
- package/dist/es/Stripe/stripe-popup.js +42 -37
- package/dist/es/Stripe/stripe.js +15 -15
- package/dist/es/Stripe/style/index.css +365 -1
- package/dist/es/Stripe/style/index.min.css +1 -0
- package/dist/es/Wechat/index.d.ts +4 -4
- package/dist/es/Wechat/index.js +5 -5
- package/dist/es/Wechat/style/index.css +25 -1
- package/dist/es/Wechat/style/index.min.css +1 -0
- package/dist/es/Wechat/wechat-button.js +38 -23
- package/dist/es/Wechat/wechat-modal.js +37 -31
- package/dist/es/Wechat/wechat.js +16 -12
- package/dist/es/confirm-modal/index.d.ts +3 -3
- package/dist/es/confirm-modal/index.js +53 -35
- package/dist/es/confirm-modal/interface.d.ts +2 -2
- package/dist/es/confirm-modal/style/index.css +95 -1
- package/dist/es/confirm-modal/style/index.min.css +1 -0
- package/dist/es/dot-loading/dot-loading.js +25 -23
- package/dist/es/dot-loading/index.d.ts +2 -2
- package/dist/es/dot-loading/index.js +2 -2
- package/dist/es/dot-loading/style/index.css +3 -1
- package/dist/es/dot-loading/style/index.min.css +1 -0
- package/dist/es/hooks/use-initialized.js +2 -2
- package/dist/es/hooks/use-inner-visible.js +8 -4
- package/dist/es/hooks/use-lock-scroll.d.ts +2 -2
- package/dist/es/hooks/use-lock-scroll.js +30 -34
- package/dist/es/hooks/use-touch.d.ts +1 -1
- package/dist/es/hooks/use-touch.js +35 -31
- package/dist/es/hooks/usePayWindowOpen.d.ts +1 -1
- package/dist/es/hooks/usePayWindowOpen.js +31 -27
- package/dist/es/icons/IconAlipay/index.js +18 -16
- package/dist/es/icons/IconClose/index.js +24 -22
- package/dist/es/icons/IconPaypalText/index.js +24 -22
- package/dist/es/icons/IconPaypalWhite/index.js +19 -17
- package/dist/es/icons/IconPayssionPay/index.js +47 -45
- package/dist/es/icons/IconStripe/index.js +19 -17
- package/dist/es/icons/IconStripeText/index.js +19 -17
- package/dist/es/icons/IconWechatPay/index.js +18 -16
- package/dist/es/icons/interface.d.ts +1 -1
- package/dist/es/icons/style/index.css +45 -1
- package/dist/es/icons/style/index.min.css +1 -0
- package/dist/es/index.d.ts +1 -1
- package/dist/es/pay-modal/index.d.ts +2 -2
- package/dist/es/pay-modal/index.js +2 -2
- package/dist/es/pay-modal/interface.d.ts +8 -18
- package/dist/es/pay-modal/pay-modal.js +53 -42
- package/dist/es/pay-modal/style/index.css +95 -1
- package/dist/es/pay-modal/style/index.min.css +1 -0
- package/dist/es/pay-popup/index.js +51 -53
- package/dist/es/pay-popup/interface.d.ts +6 -6
- package/dist/es/pay-popup/style/index.css +145 -1
- package/dist/es/pay-popup/style/index.min.css +1 -0
- package/dist/es/shared/enums/index.js +1 -1
- package/dist/es/shared/index.d.ts +1 -1
- package/dist/es/shared/index.js +1 -1
- package/dist/es/utils/can-use-dom.js +1 -1
- package/dist/es/utils/classNames.js +15 -11
- package/dist/es/utils/dom.js +18 -18
- package/dist/es/utils/get-container.js +2 -2
- package/dist/es/utils/get-scroll-parent.js +8 -9
- package/dist/es/utils/is.js +54 -32
- package/dist/es/utils/native-props.d.ts +2 -2
- package/dist/es/utils/native-props.js +7 -9
- package/dist/es/utils/omit.js +3 -5
- package/dist/es/utils/qrcode.js +5 -5
- package/dist/es/utils/render-to-container.d.ts +1 -1
- package/dist/es/utils/render-to-container.js +4 -4
- package/dist/es/utils/should-render.d.ts +1 -1
- package/dist/es/utils/should-render.js +4 -4
- package/dist/es/utils/supports-passive.js +8 -7
- package/dist/es/utils/warning.js +0 -1
- package/dist/es/utils/with-default-props.js +6 -4
- package/dist/es/utils/with-stop-propagation.d.ts +3 -3
- package/dist/es/utils/with-stop-propagation.js +27 -14
- package/dist/lib/Airwallex/airwallex-button.js +12 -15
- package/dist/lib/Airwallex/airwallex-modal.js +11 -14
- package/dist/lib/Airwallex/airwallex-popup.js +16 -23
- package/dist/lib/Airwallex/airwallex.js +20 -25
- package/dist/lib/Airwallex/index.js +1 -1
- package/dist/lib/Airwallex/style/index.css +335 -1
- package/dist/lib/Airwallex/style/index.min.css +1 -0
- package/dist/lib/Alipay/alipay-button.js +12 -15
- package/dist/lib/Alipay/alipay-modal.js +10 -13
- package/dist/lib/Alipay/alipay.js +19 -23
- package/dist/lib/Alipay/index.js +1 -1
- package/dist/lib/Alipay/style/index.css +18 -1
- package/dist/lib/Alipay/style/index.min.css +1 -0
- package/dist/lib/Button/button.js +13 -13
- package/dist/lib/Button/index.js +1 -1
- package/dist/lib/Button/style/index.css +95 -1
- package/dist/lib/Button/style/index.min.css +1 -0
- package/dist/lib/FullScreenLoading/index.js +28 -29
- package/dist/lib/FullScreenLoading/style/index.css +239 -1
- package/dist/lib/FullScreenLoading/style/index.min.css +1 -0
- package/dist/lib/MAlipay/index.js +1 -1
- package/dist/lib/MAlipay/m-alipay-auto-submit.js +3 -4
- package/dist/lib/MAlipay/m-alipay-button.js +42 -41
- package/dist/lib/MAlipay/style/index.css +252 -1
- package/dist/lib/MAlipay/style/index.min.css +1 -0
- package/dist/lib/MWeChat/index.js +2 -2
- package/dist/lib/MWeChat/m-wechat-button.js +43 -41
- package/dist/lib/MWeChat/style/index.css +252 -1
- package/dist/lib/MWeChat/style/index.min.css +1 -0
- package/dist/lib/Mask/index.js +1 -1
- package/dist/lib/Mask/mask.js +6 -11
- package/dist/lib/Mask/style/index.css +11 -1
- package/dist/lib/Mask/style/index.min.css +1 -0
- package/dist/lib/PayButton/index.js +10 -10
- package/dist/lib/PayMask/index.js +1 -1
- package/dist/lib/PayMask/pay-mask.js +20 -23
- package/dist/lib/PayMask/style/index.css +62 -1
- package/dist/lib/PayMask/style/index.min.css +1 -0
- package/dist/lib/Paypal/index.js +2 -2
- package/dist/lib/Paypal/paypal-button.js +17 -22
- package/dist/lib/Paypal/style/index.css +207 -1
- package/dist/lib/Paypal/style/index.min.css +1 -0
- package/dist/lib/Payssion/index.js +2 -2
- package/dist/lib/Payssion/payssion-button.js +17 -22
- package/dist/lib/Payssion/style/index.css +157 -1
- package/dist/lib/Payssion/style/index.min.css +1 -0
- package/dist/lib/Stripe/index.js +1 -1
- package/dist/lib/Stripe/stripe-button.js +14 -17
- package/dist/lib/Stripe/stripe-modal.js +10 -13
- package/dist/lib/Stripe/stripe-popup.js +16 -23
- package/dist/lib/Stripe/stripe.js +8 -11
- package/dist/lib/Stripe/style/index.css +365 -1
- package/dist/lib/Stripe/style/index.min.css +1 -0
- package/dist/lib/Wechat/index.js +1 -1
- package/dist/lib/Wechat/style/index.css +25 -1
- package/dist/lib/Wechat/style/index.min.css +1 -0
- package/dist/lib/Wechat/wechat-button.js +12 -15
- package/dist/lib/Wechat/wechat-modal.js +9 -12
- package/dist/lib/Wechat/wechat.js +11 -12
- package/dist/lib/confirm-modal/index.js +22 -12
- package/dist/lib/confirm-modal/style/index.css +95 -1
- package/dist/lib/confirm-modal/style/index.min.css +1 -0
- package/dist/lib/dot-loading/dot-loading.js +3 -4
- package/dist/lib/dot-loading/index.js +1 -1
- package/dist/lib/dot-loading/style/index.css +3 -1
- package/dist/lib/dot-loading/style/index.min.css +1 -0
- package/dist/lib/hooks/use-lock-scroll.js +11 -12
- package/dist/lib/hooks/use-touch.js +10 -10
- package/dist/lib/hooks/usePayWindowOpen.js +14 -15
- package/dist/lib/icons/IconAlipay/index.js +6 -6
- package/dist/lib/icons/IconClose/index.js +8 -8
- package/dist/lib/icons/IconPaypalText/index.js +7 -7
- package/dist/lib/icons/IconPaypalWhite/index.js +6 -6
- package/dist/lib/icons/IconPayssionPay/index.js +13 -13
- package/dist/lib/icons/IconStripe/index.js +6 -6
- package/dist/lib/icons/IconStripeText/index.js +6 -6
- package/dist/lib/icons/IconWechatPay/index.js +6 -6
- package/dist/lib/icons/index.js +2 -2
- package/dist/lib/icons/style/index.css +45 -1
- package/dist/lib/icons/style/index.min.css +1 -0
- package/dist/lib/index.js +2 -2
- package/dist/lib/pay-modal/index.js +1 -1
- package/dist/lib/pay-modal/pay-modal.js +29 -21
- package/dist/lib/pay-modal/style/index.css +95 -1
- package/dist/lib/pay-modal/style/index.min.css +1 -0
- package/dist/lib/pay-popup/index.js +24 -28
- package/dist/lib/pay-popup/style/index.css +145 -1
- package/dist/lib/pay-popup/style/index.min.css +1 -0
- package/dist/lib/utils/can-use-dom.js +1 -1
- package/dist/lib/utils/classNames.js +6 -7
- package/dist/lib/utils/dom.js +9 -11
- package/dist/lib/utils/get-scroll-parent.js +2 -3
- package/dist/lib/utils/getPrefixCls.js +1 -1
- package/dist/lib/utils/is.js +16 -14
- package/dist/lib/utils/native-props.js +10 -10
- package/dist/lib/utils/omit.js +3 -6
- package/dist/lib/utils/qrcode.js +1 -1
- package/dist/lib/utils/supports-passive.js +4 -3
- package/dist/lib/utils/warning.js +2 -6
- package/dist/lib/utils/with-default-props.js +4 -8
- package/dist/lib/utils/with-stop-propagation.js +6 -9
- package/dist/umd/pay-sdk-react.umd.js +106 -86
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +5 -2
|
@@ -1 +1,145 @@
|
|
|
1
|
-
.pay-mask
|
|
1
|
+
.pay-mask {
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 1000;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
}
|
|
12
|
+
.pay-icon {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
color: inherit;
|
|
15
|
+
width: 16px;
|
|
16
|
+
vertical-align: -2px;
|
|
17
|
+
stroke: currentColor;
|
|
18
|
+
}
|
|
19
|
+
.pay-icon[fill='currentColor'] {
|
|
20
|
+
fill: currentColor;
|
|
21
|
+
stroke: none;
|
|
22
|
+
}
|
|
23
|
+
.pay-icon[stroke='currentColor'] {
|
|
24
|
+
stroke: currentColor;
|
|
25
|
+
fill: none;
|
|
26
|
+
}
|
|
27
|
+
.pay-icon[fill='currentColor'][stroke='currentColor'] {
|
|
28
|
+
fill: currentColor;
|
|
29
|
+
stroke: currentColor;
|
|
30
|
+
}
|
|
31
|
+
.pay-icon-paypal-text {
|
|
32
|
+
width: 64px;
|
|
33
|
+
height: 26px;
|
|
34
|
+
max-width: 72px;
|
|
35
|
+
max-height: 32px;
|
|
36
|
+
}
|
|
37
|
+
.pay-icon-close {
|
|
38
|
+
width: 18px;
|
|
39
|
+
height: 18px;
|
|
40
|
+
}
|
|
41
|
+
.pay-icon-stripe-text {
|
|
42
|
+
width: 24px;
|
|
43
|
+
height: 24px;
|
|
44
|
+
}
|
|
45
|
+
.pay-icon-alipay {
|
|
46
|
+
width: 20px;
|
|
47
|
+
height: 20px;
|
|
48
|
+
}
|
|
49
|
+
.pay-icon-wechat-pay {
|
|
50
|
+
width: 20px;
|
|
51
|
+
height: 20px;
|
|
52
|
+
}
|
|
53
|
+
.pay-icon-payssion-pay {
|
|
54
|
+
width: 36px;
|
|
55
|
+
height: 20px;
|
|
56
|
+
}
|
|
57
|
+
.pay-popup {
|
|
58
|
+
position: fixed;
|
|
59
|
+
z-index: 1001;
|
|
60
|
+
}
|
|
61
|
+
/* Base container for the animated popup body */
|
|
62
|
+
.pay-popup-body {
|
|
63
|
+
position: fixed;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
background-color: #ffffff;
|
|
67
|
+
z-index: 1010;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
}
|
|
70
|
+
/* --- Sizing and Positioning --- */
|
|
71
|
+
.pay-popup-body.pay-popup-body-position-bottom {
|
|
72
|
+
width: 100%;
|
|
73
|
+
left: 0;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
}
|
|
76
|
+
.pay-popup-body.pay-popup-body-position-top {
|
|
77
|
+
width: 100%;
|
|
78
|
+
left: 0;
|
|
79
|
+
top: 0;
|
|
80
|
+
}
|
|
81
|
+
.pay-popup-body.pay-popup-body-position-left {
|
|
82
|
+
height: 100%;
|
|
83
|
+
width: 80vw;
|
|
84
|
+
left: 0;
|
|
85
|
+
top: 0;
|
|
86
|
+
}
|
|
87
|
+
.pay-popup-body.pay-popup-body-position-right {
|
|
88
|
+
height: 100%;
|
|
89
|
+
width: 80vw;
|
|
90
|
+
right: 0;
|
|
91
|
+
top: 0;
|
|
92
|
+
}
|
|
93
|
+
/* --- Round Corners Modifier --- */
|
|
94
|
+
.pay-popup-body.pay-popup-body-round.pay-popup-body-position-bottom {
|
|
95
|
+
border-radius: 16px 16px 0 0;
|
|
96
|
+
}
|
|
97
|
+
.pay-popup-body.pay-popup-body-round.pay-popup-body-position-top {
|
|
98
|
+
border-radius: 0 0 16px 16px;
|
|
99
|
+
}
|
|
100
|
+
.pay-popup-body.pay-popup-body-round.pay-popup-body-position-left {
|
|
101
|
+
border-radius: 0 16px 16px 0;
|
|
102
|
+
}
|
|
103
|
+
.pay-popup-body.pay-popup-body-round.pay-popup-body-position-right {
|
|
104
|
+
border-radius: 16px 0 0 16px;
|
|
105
|
+
}
|
|
106
|
+
/* --- Close Icon --- */
|
|
107
|
+
.pay-popup-close-icon {
|
|
108
|
+
position: absolute;
|
|
109
|
+
z-index: 1;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
padding: 4px;
|
|
112
|
+
font-size: 18px;
|
|
113
|
+
line-height: 1;
|
|
114
|
+
color: #999;
|
|
115
|
+
}
|
|
116
|
+
.pay-popup-body.pay-popup-body-position-bottom .pay-popup-close-icon,
|
|
117
|
+
.pay-popup-body.pay-popup-body-position-left .pay-popup-close-icon {
|
|
118
|
+
top: 8px;
|
|
119
|
+
right: 8px;
|
|
120
|
+
}
|
|
121
|
+
.pay-popup-body.pay-popup-body-position-top .pay-popup-close-icon {
|
|
122
|
+
bottom: 8px;
|
|
123
|
+
right: 8px;
|
|
124
|
+
}
|
|
125
|
+
.pay-popup-body.pay-popup-body-position-right .pay-popup-close-icon {
|
|
126
|
+
top: 8px;
|
|
127
|
+
left: 8px;
|
|
128
|
+
}
|
|
129
|
+
/* --- Content Area --- */
|
|
130
|
+
.pay-popup-content {
|
|
131
|
+
flex: 1;
|
|
132
|
+
overflow-y: auto;
|
|
133
|
+
-webkit-overflow-scrolling: touch;
|
|
134
|
+
}
|
|
135
|
+
/* --- Padding adjustment when close icon is visible --- */
|
|
136
|
+
.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-bottom .pay-popup-content,
|
|
137
|
+
.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-left .pay-popup-content {
|
|
138
|
+
padding-top: 40px;
|
|
139
|
+
}
|
|
140
|
+
.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-right .pay-popup-content {
|
|
141
|
+
padding-top: 40px;
|
|
142
|
+
}
|
|
143
|
+
.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-top .pay-popup-content {
|
|
144
|
+
padding-bottom: 40px;
|
|
145
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-icon{display:inline-block;color:inherit;width:16px;vertical-align:-2px;stroke:currentColor}.pay-icon[fill=currentColor]{fill:currentColor;stroke:none}.pay-icon[stroke=currentColor]{stroke:currentColor;fill:none}.pay-icon[fill=currentColor][stroke=currentColor]{fill:currentColor;stroke:currentColor}.pay-icon-paypal-text{width:64px;height:26px;max-width:72px;max-height:32px}.pay-icon-close{width:18px;height:18px}.pay-icon-stripe-text{width:24px;height:24px}.pay-icon-alipay{width:20px;height:20px}.pay-icon-wechat-pay{width:20px;height:20px}.pay-icon-payssion-pay{width:36px;height:20px}.pay-popup{position:fixed;z-index:1001}.pay-popup-body{position:fixed;display:flex;flex-direction:column;background-color:#fff;z-index:1010;box-sizing:border-box}.pay-popup-body.pay-popup-body-position-bottom{width:100%;left:0;bottom:0}.pay-popup-body.pay-popup-body-position-top{width:100%;left:0;top:0}.pay-popup-body.pay-popup-body-position-left{height:100%;width:80vw;left:0;top:0}.pay-popup-body.pay-popup-body-position-right{height:100%;width:80vw;right:0;top:0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-bottom{border-radius:16px 16px 0 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-top{border-radius:0 0 16px 16px}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-left{border-radius:0 16px 16px 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-right{border-radius:16px 0 0 16px}.pay-popup-close-icon{position:absolute;z-index:1;cursor:pointer;padding:4px;font-size:18px;line-height:1;color:#999}.pay-popup-body.pay-popup-body-position-bottom .pay-popup-close-icon,.pay-popup-body.pay-popup-body-position-left .pay-popup-close-icon{top:8px;right:8px}.pay-popup-body.pay-popup-body-position-top .pay-popup-close-icon{bottom:8px;right:8px}.pay-popup-body.pay-popup-body-position-right .pay-popup-close-icon{top:8px;left:8px}.pay-popup-content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-bottom .pay-popup-content,.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-left .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-right .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-top .pay-popup-content{padding-bottom:40px}
|
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.canUseDom = void 0;
|
|
7
|
-
const canUseDom = exports.canUseDom = !!(typeof window !==
|
|
7
|
+
const canUseDom = exports.canUseDom = !!(typeof window !== 'undefined' && typeof document !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = _default;
|
|
7
8
|
var _is = require("./is");
|
|
8
9
|
var _warning = _interopRequireDefault(require("./warning"));
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _default() {
|
|
12
|
-
const length = arguments.length;
|
|
10
|
+
function _default(...args) {
|
|
11
|
+
const length = args.length;
|
|
13
12
|
let classNames = [];
|
|
14
13
|
for (let i = 0; i < length; i++) {
|
|
15
|
-
const v =
|
|
14
|
+
const v = args[i];
|
|
16
15
|
if (!v) {
|
|
17
16
|
continue;
|
|
18
17
|
}
|
|
@@ -27,8 +26,8 @@ function _default() {
|
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
28
|
} else {
|
|
30
|
-
(0, _warning.default)(true,
|
|
29
|
+
(0, _warning.default)(true, 'arguments must be one of string/array/object.');
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
return [...new Set(classNames)].join(
|
|
32
|
+
return [...new Set(classNames)].join(' ');
|
|
34
33
|
}
|
package/dist/lib/utils/dom.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.open = exports.on = exports.off = exports.location = exports.localStorag
|
|
|
7
7
|
const NOOP = () => {};
|
|
8
8
|
const isServerRendering = exports.isServerRendering = function () {
|
|
9
9
|
try {
|
|
10
|
-
return !(typeof window !==
|
|
10
|
+
return !(typeof window !== 'undefined' && document !== undefined);
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
12
|
} catch (e) {
|
|
13
13
|
return true;
|
|
@@ -36,24 +36,23 @@ const location = exports.location = function () {
|
|
|
36
36
|
return NOOP;
|
|
37
37
|
}
|
|
38
38
|
return function (action, value) {
|
|
39
|
-
if (action ===
|
|
39
|
+
if (action === 'replace') {
|
|
40
40
|
window.location.replace(value);
|
|
41
41
|
}
|
|
42
|
-
if (action ===
|
|
42
|
+
if (action === 'href') {
|
|
43
43
|
window.location.href = value;
|
|
44
44
|
}
|
|
45
|
-
if (action ===
|
|
45
|
+
if (action === 'reload') {
|
|
46
46
|
window.location.reload();
|
|
47
47
|
}
|
|
48
|
-
if (action ===
|
|
48
|
+
if (action === 'protocol') {
|
|
49
49
|
return window.location.protocol;
|
|
50
50
|
}
|
|
51
|
-
if (action ===
|
|
51
|
+
if (action === 'host') {
|
|
52
52
|
return window.location.host;
|
|
53
53
|
}
|
|
54
|
-
if (action ===
|
|
55
|
-
|
|
56
|
-
return (_window$location$sear = window.location.search) !== null && _window$location$sear !== void 0 ? _window$location$sear : "";
|
|
54
|
+
if (action === 'search') {
|
|
55
|
+
return window.location.search ?? '';
|
|
57
56
|
}
|
|
58
57
|
};
|
|
59
58
|
}();
|
|
@@ -61,8 +60,7 @@ const open = exports.open = function () {
|
|
|
61
60
|
if (isServerRendering) {
|
|
62
61
|
return NOOP;
|
|
63
62
|
}
|
|
64
|
-
return function (url) {
|
|
65
|
-
let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_blank";
|
|
63
|
+
return function (url, target = '_blank') {
|
|
66
64
|
window.open(url, target);
|
|
67
65
|
};
|
|
68
66
|
}();
|
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getScrollParent = getScrollParent;
|
|
7
7
|
var _canUseDom = require("./can-use-dom");
|
|
8
8
|
const defaultRoot = _canUseDom.canUseDom ? window : undefined;
|
|
9
|
-
const overflowStylePatterns = [
|
|
9
|
+
const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
|
|
10
10
|
function isElement(node) {
|
|
11
11
|
const ELEMENT_NODE_TYPE = 1;
|
|
12
12
|
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
13
13
|
}
|
|
14
|
-
function getScrollParent(el) {
|
|
15
|
-
let root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
|
|
14
|
+
function getScrollParent(el, root = defaultRoot) {
|
|
16
15
|
let node = el;
|
|
17
16
|
while (node && node !== root && isElement(node)) {
|
|
18
17
|
if (node === document.body) {
|
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPrefixCls = getPrefixCls;
|
|
7
7
|
function getPrefixCls(componentName, customPrefix) {
|
|
8
|
-
return
|
|
8
|
+
return `${customPrefix || 'pay'}-${componentName}`;
|
|
9
9
|
}
|
package/dist/lib/utils/is.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -32,30 +33,31 @@ exports.isString = isString;
|
|
|
32
33
|
exports.isUndefined = isUndefined;
|
|
33
34
|
exports.isUsPhoneNumber = isUsPhoneNumber;
|
|
34
35
|
exports.isWindow = isWindow;
|
|
36
|
+
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
35
37
|
var _react = require("react");
|
|
36
38
|
var _canUseDom = require("./can-use-dom");
|
|
37
39
|
var _dom = require("./dom");
|
|
38
40
|
const opt = Object.prototype.toString;
|
|
39
41
|
function isArray(obj) {
|
|
40
|
-
return opt.call(obj) ===
|
|
42
|
+
return opt.call(obj) === '[object Array]';
|
|
41
43
|
}
|
|
42
44
|
function isObject(obj) {
|
|
43
|
-
return opt.call(obj) ===
|
|
45
|
+
return opt.call(obj) === '[object Object]';
|
|
44
46
|
}
|
|
45
47
|
function isString(obj) {
|
|
46
|
-
return opt.call(obj) ===
|
|
48
|
+
return opt.call(obj) === '[object String]';
|
|
47
49
|
}
|
|
48
50
|
function isNumber(obj) {
|
|
49
|
-
return opt.call(obj) ===
|
|
51
|
+
return opt.call(obj) === '[object Number]' && obj === obj;
|
|
50
52
|
}
|
|
51
53
|
function isRegExp(obj) {
|
|
52
|
-
return opt.call(obj) ===
|
|
54
|
+
return opt.call(obj) === '[object RegExp]';
|
|
53
55
|
}
|
|
54
56
|
function isFile(obj) {
|
|
55
|
-
return opt.call(obj) ===
|
|
57
|
+
return opt.call(obj) === '[object File]';
|
|
56
58
|
}
|
|
57
59
|
function isBlob(obj) {
|
|
58
|
-
return opt.call(obj) ===
|
|
60
|
+
return opt.call(obj) === '[object Blob]';
|
|
59
61
|
}
|
|
60
62
|
function isHex(color) {
|
|
61
63
|
return /^#[a-fA-F0-9]{3}$|#[a-fA-F0-9]{6}$/.test(color);
|
|
@@ -79,7 +81,7 @@ function isNullOrUndefined(obj) {
|
|
|
79
81
|
return obj === null || obj === undefined;
|
|
80
82
|
}
|
|
81
83
|
function isFunction(obj) {
|
|
82
|
-
return typeof obj ===
|
|
84
|
+
return typeof obj === 'function';
|
|
83
85
|
}
|
|
84
86
|
function isEmptyObject(obj) {
|
|
85
87
|
return isObject(obj) && Object.keys(obj).length === 0;
|
|
@@ -88,7 +90,7 @@ function isEmptyReactNode(content, trim) {
|
|
|
88
90
|
if (content === null || content === undefined || content === false) {
|
|
89
91
|
return true;
|
|
90
92
|
}
|
|
91
|
-
if (typeof content ===
|
|
93
|
+
if (typeof content === 'string' && (trim ? (0, _trim.default)(content).call(content) === '' : content === '')) {
|
|
92
94
|
return true;
|
|
93
95
|
}
|
|
94
96
|
return false;
|
|
@@ -100,10 +102,10 @@ function isWindow(el) {
|
|
|
100
102
|
return el === window;
|
|
101
103
|
}
|
|
102
104
|
function isBoolean(value) {
|
|
103
|
-
return typeof value ===
|
|
105
|
+
return typeof value === 'boolean';
|
|
104
106
|
}
|
|
105
107
|
const isReactComponent = element => {
|
|
106
|
-
return element && /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type ===
|
|
108
|
+
return element && /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type === 'function';
|
|
107
109
|
};
|
|
108
110
|
exports.isReactComponent = isReactComponent;
|
|
109
111
|
const isClassComponent = element => {
|
|
@@ -114,11 +116,11 @@ const isClassComponent = element => {
|
|
|
114
116
|
// element 是合成的 dom 元素或者字符串,数字等
|
|
115
117
|
exports.isClassComponent = isClassComponent;
|
|
116
118
|
const isDOMElement = element => {
|
|
117
|
-
return /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type ===
|
|
119
|
+
return /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type === 'string';
|
|
118
120
|
};
|
|
119
121
|
exports.isDOMElement = isDOMElement;
|
|
120
122
|
const isLink = text => {
|
|
121
|
-
return isString(text) && (text.startsWith(
|
|
123
|
+
return isString(text) && (text.startsWith('http') || text.startsWith('https'));
|
|
122
124
|
};
|
|
123
125
|
exports.isLink = isLink;
|
|
124
126
|
async function isImageLinkAvailable(url) {
|
|
@@ -145,7 +147,7 @@ function isUsPhoneNumber(phone) {
|
|
|
145
147
|
return phoneRegex.test(phone);
|
|
146
148
|
}
|
|
147
149
|
function isPromise(obj) {
|
|
148
|
-
return !!obj && typeof obj ===
|
|
150
|
+
return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
/**
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.withNativeProps = withNativeProps;
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _classNames = _interopRequireDefault(require("./classNames"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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); }
|
|
15
10
|
function withNativeProps(props, element) {
|
|
16
|
-
const p =
|
|
11
|
+
const p = {
|
|
12
|
+
...element.props
|
|
13
|
+
};
|
|
17
14
|
if (props.className) {
|
|
18
15
|
p.className = (0, _classNames.default)(element.props.className, props.className);
|
|
19
16
|
}
|
|
20
17
|
if (props.style) {
|
|
21
|
-
p.style =
|
|
18
|
+
p.style = {
|
|
19
|
+
...p.style,
|
|
20
|
+
...props.style
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
if (props.tabIndex !== undefined) {
|
|
24
24
|
p.tabIndex = props.tabIndex;
|
|
25
25
|
}
|
|
26
26
|
for (const key in props) {
|
|
27
|
-
if (!
|
|
28
|
-
if (key.startsWith(
|
|
27
|
+
if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
|
|
28
|
+
if (key.startsWith('data-') || key.startsWith('aria-')) {
|
|
29
29
|
p[key] = props[key];
|
|
30
30
|
}
|
|
31
31
|
}
|
package/dist/lib/utils/omit.js
CHANGED
|
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = omit;
|
|
7
|
-
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; }
|
|
8
|
-
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; }
|
|
9
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
-
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); }
|
|
12
7
|
// delete keys from object
|
|
13
8
|
function omit(obj, keys) {
|
|
14
|
-
const clone =
|
|
9
|
+
const clone = {
|
|
10
|
+
...obj
|
|
11
|
+
};
|
|
15
12
|
keys.forEach(key => {
|
|
16
13
|
if (key in clone) {
|
|
17
14
|
delete clone[key];
|
package/dist/lib/utils/qrcode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _qrcode = _interopRequireDefault(require("qrcode"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/**
|
|
10
10
|
* 根据入参生成一个二维码
|
|
11
11
|
* @param url 要生成二维码的url
|
|
@@ -9,12 +9,13 @@ let supportsPassive = exports.supportsPassive = false;
|
|
|
9
9
|
if (_canUseDom.canUseDom) {
|
|
10
10
|
try {
|
|
11
11
|
const opts = {};
|
|
12
|
-
Object.defineProperty(opts,
|
|
12
|
+
Object.defineProperty(opts, 'passive', {
|
|
13
|
+
// eslint-disable-next-line getter-return
|
|
13
14
|
get() {
|
|
14
15
|
exports.supportsPassive = supportsPassive = true;
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
|
-
window.addEventListener(
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
window.addEventListener('test-passive', null, opts);
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty
|
|
19
20
|
} catch (e) {}
|
|
20
21
|
}
|
|
@@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = warning;
|
|
7
|
-
function warning(condition, message) {
|
|
7
|
+
function warning(condition, message, ...extra) {
|
|
8
8
|
if (process.env.NODE_ENV !== 'production' && console) {
|
|
9
9
|
if (condition) {
|
|
10
|
-
|
|
11
|
-
extra[_key - 2] = arguments[_key];
|
|
12
|
-
}
|
|
13
|
-
// eslint-disable-next-line no-console
|
|
14
|
-
return console.error("[pay-sdk-react]: ".concat(message), extra ? {
|
|
10
|
+
return console.error(`[pay-sdk-react]: ${message}`, extra ? {
|
|
15
11
|
detail: extra
|
|
16
12
|
} : undefined);
|
|
17
13
|
}
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mergeProp = mergeProp;
|
|
7
7
|
exports.mergeProps = mergeProps;
|
|
8
|
-
|
|
8
|
+
/* eslint-disable no-redeclare */
|
|
9
|
+
|
|
10
|
+
function mergeProps(...items) {
|
|
9
11
|
const ret = {};
|
|
10
|
-
for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
|
-
items[_key] = arguments[_key];
|
|
12
|
-
}
|
|
13
12
|
items.forEach(item => {
|
|
14
13
|
if (item) {
|
|
15
14
|
Object.keys(item).forEach(key => {
|
|
@@ -27,10 +26,7 @@ function mergeProps() {
|
|
|
27
26
|
* The later has higher priority. e.g. (10, 1, 5) => 5 wins.
|
|
28
27
|
* This is useful with legacy props that have been deprecated.
|
|
29
28
|
*/
|
|
30
|
-
function mergeProp(defaultProp) {
|
|
31
|
-
for (var _len2 = arguments.length, propList = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
32
|
-
propList[_key2 - 1] = arguments[_key2];
|
|
33
|
-
}
|
|
29
|
+
function mergeProp(defaultProp, ...propList) {
|
|
34
30
|
for (let i = propList.length - 1; i >= 0; i -= 1) {
|
|
35
31
|
if (propList[i] !== undefined) {
|
|
36
32
|
return propList[i];
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.withStopPropagation = withStopPropagation;
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
-
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
9
|
const eventToPropRecord = {
|
|
15
|
-
click:
|
|
16
|
-
touchstart:
|
|
10
|
+
click: 'onClick',
|
|
11
|
+
touchstart: 'onTouchStart'
|
|
17
12
|
};
|
|
18
13
|
function withStopPropagation(events, element) {
|
|
19
|
-
const props =
|
|
14
|
+
const props = {
|
|
15
|
+
...element.props
|
|
16
|
+
};
|
|
20
17
|
for (const key of events) {
|
|
21
18
|
const prop = eventToPropRecord[key];
|
|
22
19
|
props[prop] = function (e) {
|