pay-sdk-react 1.1.2 → 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 +37 -19
- package/README.zh-CN.md +37 -19
- 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 +37 -31
- 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/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/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 +71 -51
- 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 +70 -50
- 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.js +38 -39
- 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/pay-modal/index.d.ts +2 -2
- package/dist/es/pay-modal/index.js +2 -2
- package/dist/es/pay-modal/pay-modal.js +45 -48
- 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 +9 -12
- 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 +34 -44
- 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 +34 -44
- 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 +17 -26
- 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 +24 -30
- 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 +61 -63
- 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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './enums';
|
package/dist/es/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './enums';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var canUseDom = !!(typeof window !== 'undefined' && typeof document !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/esm/toConsumableArray";
|
|
2
|
+
import { isArray, isObject, isString } from './is';
|
|
3
|
+
import warning from './warning';
|
|
4
4
|
export default function () {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
var _arguments = arguments;
|
|
6
|
+
var length = arguments.length;
|
|
7
|
+
var classNames = [];
|
|
8
|
+
var _loop = function _loop() {
|
|
9
|
+
var v = i < 0 || _arguments.length <= i ? undefined : _arguments[i];
|
|
9
10
|
if (!v) {
|
|
10
|
-
continue
|
|
11
|
+
return 1; // continue
|
|
11
12
|
}
|
|
12
13
|
if (isString(v)) {
|
|
13
14
|
classNames.push(v);
|
|
14
15
|
} else if (isArray(v)) {
|
|
15
16
|
classNames = classNames.concat(v);
|
|
16
17
|
} else if (isObject(v)) {
|
|
17
|
-
Object.keys(v).forEach(k
|
|
18
|
+
Object.keys(v).forEach(function (k) {
|
|
18
19
|
if (v[k]) {
|
|
19
20
|
classNames.push(k);
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
} else {
|
|
23
|
-
warning(true,
|
|
24
|
+
warning(true, 'arguments must be one of string/array/object.');
|
|
24
25
|
}
|
|
26
|
+
};
|
|
27
|
+
for (var i = 0; i < length; i++) {
|
|
28
|
+
if (_loop()) continue;
|
|
25
29
|
}
|
|
26
|
-
return
|
|
30
|
+
return _toConsumableArray(new Set(classNames)).join(' ');
|
|
27
31
|
}
|
package/dist/es/utils/dom.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
var NOOP = function NOOP() {};
|
|
2
|
+
export var isServerRendering = function () {
|
|
3
3
|
try {
|
|
4
|
-
return !(typeof window !==
|
|
4
|
+
return !(typeof window !== 'undefined' && document !== undefined);
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
6
|
} catch (e) {
|
|
7
7
|
return true;
|
|
8
8
|
}
|
|
9
9
|
}();
|
|
10
|
-
export
|
|
10
|
+
export var clientWindow = function () {
|
|
11
11
|
if (isServerRendering) {
|
|
12
12
|
return undefined;
|
|
13
13
|
}
|
|
14
14
|
return window;
|
|
15
15
|
}();
|
|
16
|
-
export
|
|
16
|
+
export var clientDocument = function () {
|
|
17
17
|
if (isServerRendering) {
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
20
|
return document;
|
|
21
21
|
}();
|
|
22
|
-
export
|
|
22
|
+
export var localStorage = function () {
|
|
23
23
|
if (isServerRendering) {
|
|
24
24
|
return NOOP;
|
|
25
25
|
}
|
|
26
26
|
return window.localStorage;
|
|
27
27
|
}();
|
|
28
|
-
export
|
|
28
|
+
export var location = function () {
|
|
29
29
|
if (isServerRendering) {
|
|
30
30
|
return NOOP;
|
|
31
31
|
}
|
|
32
32
|
return function (action, value) {
|
|
33
|
-
if (action ===
|
|
33
|
+
if (action === 'replace') {
|
|
34
34
|
window.location.replace(value);
|
|
35
35
|
}
|
|
36
|
-
if (action ===
|
|
36
|
+
if (action === 'href') {
|
|
37
37
|
window.location.href = value;
|
|
38
38
|
}
|
|
39
|
-
if (action ===
|
|
39
|
+
if (action === 'reload') {
|
|
40
40
|
window.location.reload();
|
|
41
41
|
}
|
|
42
|
-
if (action ===
|
|
42
|
+
if (action === 'protocol') {
|
|
43
43
|
return window.location.protocol;
|
|
44
44
|
}
|
|
45
|
-
if (action ===
|
|
45
|
+
if (action === 'host') {
|
|
46
46
|
return window.location.host;
|
|
47
47
|
}
|
|
48
|
-
if (action ===
|
|
48
|
+
if (action === 'search') {
|
|
49
49
|
var _window$location$sear;
|
|
50
|
-
return (_window$location$sear = window.location.search) !== null && _window$location$sear !== void 0 ? _window$location$sear :
|
|
50
|
+
return (_window$location$sear = window.location.search) !== null && _window$location$sear !== void 0 ? _window$location$sear : '';
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
}();
|
|
54
|
-
export
|
|
54
|
+
export var open = function () {
|
|
55
55
|
if (isServerRendering) {
|
|
56
56
|
return NOOP;
|
|
57
57
|
}
|
|
58
58
|
return function (url) {
|
|
59
|
-
|
|
59
|
+
var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_blank';
|
|
60
60
|
window.open(url, target);
|
|
61
61
|
};
|
|
62
62
|
}();
|
|
63
|
-
export
|
|
63
|
+
export var on = function () {
|
|
64
64
|
if (isServerRendering) {
|
|
65
65
|
return NOOP;
|
|
66
66
|
}
|
|
@@ -69,7 +69,7 @@ export const on = function () {
|
|
|
69
69
|
element && element.addEventListener(event, handler, options || false);
|
|
70
70
|
};
|
|
71
71
|
}();
|
|
72
|
-
export
|
|
72
|
+
export var off = function () {
|
|
73
73
|
if (isServerRendering) {
|
|
74
74
|
return NOOP;
|
|
75
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isFunction } from
|
|
1
|
+
import { isFunction } from './is';
|
|
2
2
|
export function resolveContainer(getContainer) {
|
|
3
|
-
|
|
3
|
+
var container = isFunction(getContainer) ? getContainer() : getContainer;
|
|
4
4
|
return container || document.body;
|
|
5
5
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { canUseDom } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { canUseDom } from './can-use-dom';
|
|
2
|
+
var defaultRoot = canUseDom ? window : undefined;
|
|
3
|
+
var overflowStylePatterns = ['scroll', 'auto', 'overlay'];
|
|
4
4
|
function isElement(node) {
|
|
5
|
-
|
|
5
|
+
var ELEMENT_NODE_TYPE = 1;
|
|
6
6
|
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
7
7
|
}
|
|
8
8
|
export function getScrollParent(el) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
|
|
10
|
+
var node = el;
|
|
11
11
|
while (node && node !== root && isElement(node)) {
|
|
12
12
|
if (node === document.body) {
|
|
13
13
|
return root;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
overflowY
|
|
17
|
-
} = window.getComputedStyle(node);
|
|
15
|
+
var _window$getComputedSt = window.getComputedStyle(node),
|
|
16
|
+
overflowY = _window$getComputedSt.overflowY;
|
|
18
17
|
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
19
18
|
return node;
|
|
20
19
|
}
|
package/dist/es/utils/is.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
4
|
+
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim";
|
|
5
|
+
import { isValidElement } from 'react';
|
|
6
|
+
import { canUseDom } from './can-use-dom';
|
|
7
|
+
import { clientWindow } from './dom';
|
|
8
|
+
var opt = Object.prototype.toString;
|
|
5
9
|
export function isArray(obj) {
|
|
6
|
-
return opt.call(obj) ===
|
|
10
|
+
return opt.call(obj) === '[object Array]';
|
|
7
11
|
}
|
|
8
12
|
export function isObject(obj) {
|
|
9
|
-
return opt.call(obj) ===
|
|
13
|
+
return opt.call(obj) === '[object Object]';
|
|
10
14
|
}
|
|
11
15
|
export function isString(obj) {
|
|
12
|
-
return opt.call(obj) ===
|
|
16
|
+
return opt.call(obj) === '[object String]';
|
|
13
17
|
}
|
|
14
18
|
export function isNumber(obj) {
|
|
15
|
-
return opt.call(obj) ===
|
|
19
|
+
return opt.call(obj) === '[object Number]' && obj === obj;
|
|
16
20
|
}
|
|
17
21
|
export function isRegExp(obj) {
|
|
18
|
-
return opt.call(obj) ===
|
|
22
|
+
return opt.call(obj) === '[object RegExp]';
|
|
19
23
|
}
|
|
20
24
|
export function isFile(obj) {
|
|
21
|
-
return opt.call(obj) ===
|
|
25
|
+
return opt.call(obj) === '[object File]';
|
|
22
26
|
}
|
|
23
27
|
export function isBlob(obj) {
|
|
24
|
-
return opt.call(obj) ===
|
|
28
|
+
return opt.call(obj) === '[object Blob]';
|
|
25
29
|
}
|
|
26
30
|
function isHex(color) {
|
|
27
31
|
return /^#[a-fA-F0-9]{3}$|#[a-fA-F0-9]{6}$/.test(color);
|
|
@@ -45,7 +49,7 @@ export function isNullOrUndefined(obj) {
|
|
|
45
49
|
return obj === null || obj === undefined;
|
|
46
50
|
}
|
|
47
51
|
export function isFunction(obj) {
|
|
48
|
-
return typeof obj ===
|
|
52
|
+
return typeof obj === 'function';
|
|
49
53
|
}
|
|
50
54
|
export function isEmptyObject(obj) {
|
|
51
55
|
return isObject(obj) && Object.keys(obj).length === 0;
|
|
@@ -54,7 +58,7 @@ export function isEmptyReactNode(content, trim) {
|
|
|
54
58
|
if (content === null || content === undefined || content === false) {
|
|
55
59
|
return true;
|
|
56
60
|
}
|
|
57
|
-
if (typeof content ===
|
|
61
|
+
if (typeof content === 'string' && (trim ? _trimInstanceProperty(content).call(content) === '' : content === '')) {
|
|
58
62
|
return true;
|
|
59
63
|
}
|
|
60
64
|
return false;
|
|
@@ -66,48 +70,66 @@ export function isWindow(el) {
|
|
|
66
70
|
return el === window;
|
|
67
71
|
}
|
|
68
72
|
export function isBoolean(value) {
|
|
69
|
-
return typeof value ===
|
|
73
|
+
return typeof value === 'boolean';
|
|
70
74
|
}
|
|
71
|
-
export
|
|
72
|
-
return element && /*#__PURE__*/isValidElement(element) && typeof element.type ===
|
|
75
|
+
export var isReactComponent = function isReactComponent(element) {
|
|
76
|
+
return element && /*#__PURE__*/isValidElement(element) && typeof element.type === 'function';
|
|
73
77
|
};
|
|
74
|
-
export
|
|
78
|
+
export var isClassComponent = function isClassComponent(element) {
|
|
75
79
|
var _element$type$prototy;
|
|
76
80
|
return isReactComponent(element) && !!((_element$type$prototy = element.type.prototype) !== null && _element$type$prototy !== void 0 && _element$type$prototy.isReactComponent);
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
// element 是合成的 dom 元素或者字符串,数字等
|
|
80
|
-
export
|
|
81
|
-
return /*#__PURE__*/isValidElement(element) && typeof element.type ===
|
|
84
|
+
export var isDOMElement = function isDOMElement(element) {
|
|
85
|
+
return /*#__PURE__*/isValidElement(element) && typeof element.type === 'string';
|
|
82
86
|
};
|
|
83
|
-
export
|
|
84
|
-
return isString(text) && (text.startsWith(
|
|
87
|
+
export var isLink = function isLink(text) {
|
|
88
|
+
return isString(text) && (text.startsWith('http') || text.startsWith('https'));
|
|
85
89
|
};
|
|
86
|
-
export
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
export function isImageLinkAvailable(_x) {
|
|
91
|
+
return _isImageLinkAvailable.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
function _isImageLinkAvailable() {
|
|
94
|
+
_isImageLinkAvailable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
95
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
96
|
+
while (1) switch (_context.prev = _context.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
99
|
+
var img = new Image();
|
|
100
|
+
img.onload = function () {
|
|
101
|
+
return resolve(true);
|
|
102
|
+
};
|
|
103
|
+
img.onerror = function () {
|
|
104
|
+
return resolve(false);
|
|
105
|
+
};
|
|
106
|
+
img.src = url;
|
|
107
|
+
}));
|
|
108
|
+
case 1:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee);
|
|
113
|
+
}));
|
|
114
|
+
return _isImageLinkAvailable.apply(this, arguments);
|
|
93
115
|
}
|
|
94
116
|
export function isMobile() {
|
|
95
117
|
return clientWindow && /Android|iPhone|iPad|iPod|Windows Phone|BlackBerry|Mobile/i.test(clientWindow === null || clientWindow === void 0 ? void 0 : clientWindow.navigator.userAgent);
|
|
96
118
|
}
|
|
97
119
|
export function isEmail(email) {
|
|
98
|
-
|
|
120
|
+
var emailReg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
|
99
121
|
return emailReg.test(email);
|
|
100
122
|
}
|
|
101
123
|
export function isSmsCode(code) {
|
|
102
|
-
|
|
124
|
+
var codeReg = /\d{6}/;
|
|
103
125
|
return codeReg.test(code);
|
|
104
126
|
}
|
|
105
127
|
export function isUsPhoneNumber(phone) {
|
|
106
|
-
|
|
128
|
+
var phoneRegex = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
107
129
|
return phoneRegex.test(phone);
|
|
108
130
|
}
|
|
109
131
|
export function isPromise(obj) {
|
|
110
|
-
return !!obj &&
|
|
132
|
+
return !!obj && _typeof(obj) === 'object' && typeof obj.then === 'function';
|
|
111
133
|
}
|
|
112
134
|
|
|
113
135
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { AriaAttributes } from
|
|
2
|
-
import type { CSSProperties, ReactElement } from
|
|
1
|
+
import React, { AriaAttributes } from 'react';
|
|
2
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
3
3
|
export type NativeProps<S extends string = never> = {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: CSSProperties & Partial<Record<S, string>>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
1
2
|
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; }
|
|
2
3
|
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; }
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
import React from "react";
|
|
7
|
-
import cs from "./classNames";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import cs from './classNames';
|
|
8
6
|
export function withNativeProps(props, element) {
|
|
9
|
-
|
|
7
|
+
var p = _objectSpread({}, element.props);
|
|
10
8
|
if (props.className) {
|
|
11
9
|
p.className = cs(element.props.className, props.className);
|
|
12
10
|
}
|
|
@@ -16,9 +14,9 @@ export function withNativeProps(props, element) {
|
|
|
16
14
|
if (props.tabIndex !== undefined) {
|
|
17
15
|
p.tabIndex = props.tabIndex;
|
|
18
16
|
}
|
|
19
|
-
for (
|
|
20
|
-
if (!
|
|
21
|
-
if (key.startsWith(
|
|
17
|
+
for (var key in props) {
|
|
18
|
+
if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
|
|
19
|
+
if (key.startsWith('data-') || key.startsWith('aria-')) {
|
|
22
20
|
p[key] = props[key];
|
|
23
21
|
}
|
|
24
22
|
}
|
package/dist/es/utils/omit.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
1
2
|
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; }
|
|
2
3
|
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; }
|
|
3
|
-
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; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
-
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); }
|
|
6
4
|
// delete keys from object
|
|
7
5
|
export default function omit(obj, keys) {
|
|
8
|
-
|
|
9
|
-
keys.forEach(key
|
|
6
|
+
var clone = _objectSpread({}, obj);
|
|
7
|
+
keys.forEach(function (key) {
|
|
10
8
|
if (key in clone) {
|
|
11
9
|
delete clone[key];
|
|
12
10
|
}
|
package/dist/es/utils/qrcode.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import QRCode from
|
|
1
|
+
import QRCode from 'qrcode';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 根据入参生成一个二维码
|
|
5
5
|
* @param url 要生成二维码的url
|
|
6
6
|
* @returns Promise
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
return new Promise((resolve, reject)
|
|
10
|
-
QRCode.toDataURL(url).then(qrcodeUrl
|
|
8
|
+
var makeQrcode = function makeQrcode(url) {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
QRCode.toDataURL(url).then(function (qrcodeUrl) {
|
|
11
11
|
resolve(qrcodeUrl);
|
|
12
|
-
}).catch(err
|
|
12
|
+
}).catch(function (err) {
|
|
13
13
|
reject(err);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ReactElement } from
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
export type GetContainer = HTMLElement | (() => HTMLElement) | null;
|
|
3
3
|
export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createPortal } from
|
|
2
|
-
import { resolveContainer } from
|
|
3
|
-
import { canUseDom } from
|
|
1
|
+
import { createPortal } from 'react-dom';
|
|
2
|
+
import { resolveContainer } from './get-container';
|
|
3
|
+
import { canUseDom } from './can-use-dom';
|
|
4
4
|
export function renderToContainer(getContainer, node) {
|
|
5
5
|
if (canUseDom && getContainer) {
|
|
6
|
-
|
|
6
|
+
var container = resolveContainer(getContainer);
|
|
7
7
|
return /*#__PURE__*/createPortal(node, container);
|
|
8
8
|
}
|
|
9
9
|
return node;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useInitialized } from
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import { useInitialized } from '../hooks/use-initialized';
|
|
2
|
+
export var ShouldRender = function ShouldRender(props) {
|
|
3
|
+
var shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
|
|
4
4
|
return shouldRender ? props.children : null;
|
|
5
5
|
};
|
|
6
6
|
export function useShouldRender(active, forceRender, destroyOnClose) {
|
|
7
|
-
|
|
7
|
+
var initialized = useInitialized(active);
|
|
8
8
|
if (forceRender) return true;
|
|
9
9
|
if (active) return true;
|
|
10
10
|
if (!initialized) return false;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { canUseDom } from
|
|
2
|
-
export
|
|
1
|
+
import { canUseDom } from './can-use-dom';
|
|
2
|
+
export var supportsPassive = false;
|
|
3
3
|
if (canUseDom) {
|
|
4
4
|
try {
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(opts,
|
|
7
|
-
|
|
5
|
+
var opts = {};
|
|
6
|
+
Object.defineProperty(opts, 'passive', {
|
|
7
|
+
// eslint-disable-next-line getter-return
|
|
8
|
+
get: function get() {
|
|
8
9
|
supportsPassive = true;
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
|
-
window.addEventListener(
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
window.addEventListener('test-passive', null, opts);
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty
|
|
13
14
|
} catch (e) {}
|
|
14
15
|
}
|