@licklist/design 0.78.7-stage.12 → 0.78.7-stage.13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RyftPaymentForm.d.ts","sourceRoot":"","sources":["../../../src/iframe/ryft/RyftPaymentForm.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,sBAAsB,EACvB,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0EAA0E,CAAA;AAIlH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAOzD,MAAM,WAAW,oBAAoB;IAEnC,SAAS,EAAE,GAAG,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAA;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,IAAI,EACrB,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAClD;AAED,eAAO,MAAM,eAAe,8JAUzB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"RyftPaymentForm.d.ts","sourceRoot":"","sources":["../../../src/iframe/ryft/RyftPaymentForm.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,sBAAsB,EACvB,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0EAA0E,CAAA;AAIlH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAOzD,MAAM,WAAW,oBAAoB;IAEnC,SAAS,EAAE,GAAG,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAA;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,IAAI,EACrB,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAClD;AAED,eAAO,MAAM,eAAe,8JAUzB,oBAAoB,4CAsNtB,CAAA"}
|
|
@@ -198,7 +198,7 @@ var ryftErrorMap = {
|
|
|
198
198
|
};
|
|
199
199
|
var RyftPaymentForm = function(param) {
|
|
200
200
|
var accountId = param.accountId, isCreateLoading = param.isCreateLoading, isAppUsingInIframe = param.isAppUsingInIframe, providerPaymentSettings = param.providerPaymentSettings, onApplePayButtonClick = param.onApplePayButtonClick, initRyft = param.initRyft, resetReferrer = param.resetReferrer, onSubmit = param.onSubmit, payButtonDisabled = param.payButtonDisabled;
|
|
201
|
-
var _formRef_current_childNodes, _formRef_current, _formRef_current_childNodes1, _formRef_current1
|
|
201
|
+
var _formRef_current_childNodes, _formRef_current, _accountId_data, _formRef_current_childNodes1, _formRef_current1;
|
|
202
202
|
var t = useTranslation([
|
|
203
203
|
'Design',
|
|
204
204
|
'Validation',
|
|
@@ -303,46 +303,31 @@ var RyftPaymentForm = function(param) {
|
|
|
303
303
|
};
|
|
304
304
|
}();
|
|
305
305
|
console.log((_formRef_current = formRef.current) === null || _formRef_current === void 0 ? void 0 : (_formRef_current_childNodes = _formRef_current.childNodes) === null || _formRef_current_childNodes === void 0 ? void 0 : _formRef_current_childNodes.length, 'formRef.current?.childNodes?.length ');
|
|
306
|
-
useEffect(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
if (googleButton) {
|
|
333
|
-
googleButton.disabled = payButtonDisabled;
|
|
334
|
-
googleButton.style.opacity = payButtonDisabled ? '0.6' : '1';
|
|
335
|
-
}
|
|
336
|
-
if (appleButton) {
|
|
337
|
-
appleButton.disabled = payButtonDisabled;
|
|
338
|
-
appleButton.style.opacity = payButtonDisabled ? '0.6' : '1';
|
|
339
|
-
}
|
|
340
|
-
if (formBox) {
|
|
341
|
-
formBox.style.display = payButtonDisabled ? 'block' : 'none';
|
|
342
|
-
}
|
|
343
|
-
}, [
|
|
344
|
-
payButtonDisabled
|
|
345
|
-
]);
|
|
306
|
+
// useEffect(() => {
|
|
307
|
+
// const formBox = document.getElementById('form-disable-box')
|
|
308
|
+
// const cardContainer = document.getElementById('ryft-pay-iframe')
|
|
309
|
+
// const googleButton = document.getElementById(
|
|
310
|
+
// 'gpay-button-online-api-id',
|
|
311
|
+
// ) as HTMLButtonElement | null
|
|
312
|
+
// const appleButton = document.getElementById(
|
|
313
|
+
// 'ryft-pay-apple-pay-button',
|
|
314
|
+
// ) as HTMLButtonElement | null
|
|
315
|
+
// if (cardContainer) {
|
|
316
|
+
// cardContainer.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
317
|
+
// cardContainer.setAttribute('aria-disabled', payButtonDisabled.toString())
|
|
318
|
+
// }
|
|
319
|
+
// if (googleButton) {
|
|
320
|
+
// googleButton.disabled = payButtonDisabled
|
|
321
|
+
// googleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
322
|
+
// }
|
|
323
|
+
// if (appleButton) {
|
|
324
|
+
// appleButton.disabled = payButtonDisabled
|
|
325
|
+
// appleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
326
|
+
// }
|
|
327
|
+
// if (formBox) {
|
|
328
|
+
// formBox.style.display = payButtonDisabled ? 'block' : 'none'
|
|
329
|
+
// }
|
|
330
|
+
// }, [payButtonDisabled])
|
|
346
331
|
useEffect(function() {
|
|
347
332
|
var _accountId_data;
|
|
348
333
|
if (!((_accountId_data = accountId.data) === null || _accountId_data === void 0 ? void 0 : _accountId_data.account_id) || accountId.isError) return;
|
|
@@ -361,6 +346,24 @@ var RyftPaymentForm = function(param) {
|
|
|
361
346
|
}, [
|
|
362
347
|
(_accountId_data = accountId.data) === null || _accountId_data === void 0 ? void 0 : _accountId_data.account_id
|
|
363
348
|
]);
|
|
349
|
+
useEffect(function() {
|
|
350
|
+
var _formRef_current_childNodes, _formRef_current, _formRef_current_childNodes1, _formRef_current1, _accountId_data;
|
|
351
|
+
if (!((_formRef_current = formRef.current) === null || _formRef_current === void 0 ? void 0 : (_formRef_current_childNodes = _formRef_current.childNodes) === null || _formRef_current_childNodes === void 0 ? void 0 : _formRef_current_childNodes.length) || ((_formRef_current1 = formRef.current) === null || _formRef_current1 === void 0 ? void 0 : (_formRef_current_childNodes1 = _formRef_current1.childNodes) === null || _formRef_current_childNodes1 === void 0 ? void 0 : _formRef_current_childNodes1.length) < 3 || !((_accountId_data = accountId.data) === null || _accountId_data === void 0 ? void 0 : _accountId_data.account_id)) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
injectComponentsInRyftForm({
|
|
355
|
+
t: t,
|
|
356
|
+
isAppUsingInIframe: isAppUsingInIframe,
|
|
357
|
+
onApplePayButtonClick: onApplePayButtonClick,
|
|
358
|
+
isDisableButton: !payButtonDisabled,
|
|
359
|
+
additionalPaymentMethodsEnabled: providerPaymentSettings === null || providerPaymentSettings === void 0 ? void 0 : providerPaymentSettings.additionalPaymentMethodsEnabled
|
|
360
|
+
});
|
|
361
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
362
|
+
[
|
|
363
|
+
(_formRef_current1 = formRef.current) === null || _formRef_current1 === void 0 ? void 0 : (_formRef_current_childNodes1 = _formRef_current1.childNodes) === null || _formRef_current_childNodes1 === void 0 ? void 0 : _formRef_current_childNodes1.length,
|
|
364
|
+
showApplePayButton,
|
|
365
|
+
payButtonDisabled
|
|
366
|
+
]);
|
|
364
367
|
if (accountId.isLoading || accountId.isFetching || isCreateLoading) return /*#__PURE__*/ jsx("div", {
|
|
365
368
|
className: "mt-5 pt-5",
|
|
366
369
|
children: /*#__PURE__*/ jsx(BlockLoader, {})
|
package/package.json
CHANGED
|
@@ -138,59 +138,38 @@ export const RyftPaymentForm = ({
|
|
|
138
138
|
formRef.current?.childNodes?.length,
|
|
139
139
|
'formRef.current?.childNodes?.length ',
|
|
140
140
|
)
|
|
141
|
-
useEffect(
|
|
142
|
-
() => {
|
|
143
|
-
if (
|
|
144
|
-
!formRef.current?.childNodes?.length ||
|
|
145
|
-
formRef.current?.childNodes?.length < 3 ||
|
|
146
|
-
!accountId.data?.account_id
|
|
147
|
-
) {
|
|
148
|
-
return
|
|
149
|
-
}
|
|
150
|
-
injectComponentsInRyftForm({
|
|
151
|
-
t,
|
|
152
|
-
isAppUsingInIframe,
|
|
153
|
-
onApplePayButtonClick,
|
|
154
|
-
isDisableButton: !payButtonDisabled,
|
|
155
|
-
additionalPaymentMethodsEnabled:
|
|
156
|
-
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
157
|
-
})
|
|
158
|
-
},
|
|
159
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
|
-
[formRef.current?.childNodes?.length, showApplePayButton],
|
|
161
|
-
)
|
|
162
141
|
|
|
163
|
-
useEffect(() => {
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
// useEffect(() => {
|
|
143
|
+
// const formBox = document.getElementById('form-disable-box')
|
|
144
|
+
// const cardContainer = document.getElementById('ryft-pay-iframe')
|
|
166
145
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
146
|
+
// const googleButton = document.getElementById(
|
|
147
|
+
// 'gpay-button-online-api-id',
|
|
148
|
+
// ) as HTMLButtonElement | null
|
|
170
149
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
150
|
+
// const appleButton = document.getElementById(
|
|
151
|
+
// 'ryft-pay-apple-pay-button',
|
|
152
|
+
// ) as HTMLButtonElement | null
|
|
174
153
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
154
|
+
// if (cardContainer) {
|
|
155
|
+
// cardContainer.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
156
|
+
// cardContainer.setAttribute('aria-disabled', payButtonDisabled.toString())
|
|
157
|
+
// }
|
|
179
158
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
159
|
+
// if (googleButton) {
|
|
160
|
+
// googleButton.disabled = payButtonDisabled
|
|
161
|
+
// googleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
162
|
+
// }
|
|
184
163
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
164
|
+
// if (appleButton) {
|
|
165
|
+
// appleButton.disabled = payButtonDisabled
|
|
166
|
+
// appleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
|
|
167
|
+
// }
|
|
189
168
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}, [payButtonDisabled])
|
|
169
|
+
// if (formBox) {
|
|
170
|
+
// formBox.style.display = payButtonDisabled ? 'block' : 'none'
|
|
171
|
+
// }
|
|
172
|
+
// }, [payButtonDisabled])
|
|
194
173
|
|
|
195
174
|
useEffect(() => {
|
|
196
175
|
if (!accountId.data?.account_id || accountId.isError) return
|
|
@@ -214,6 +193,29 @@ export const RyftPaymentForm = ({
|
|
|
214
193
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
215
194
|
}, [accountId.data?.account_id])
|
|
216
195
|
|
|
196
|
+
|
|
197
|
+
useEffect(
|
|
198
|
+
() => {
|
|
199
|
+
if (
|
|
200
|
+
!formRef.current?.childNodes?.length ||
|
|
201
|
+
formRef.current?.childNodes?.length < 3 ||
|
|
202
|
+
!accountId.data?.account_id
|
|
203
|
+
) {
|
|
204
|
+
return
|
|
205
|
+
}
|
|
206
|
+
injectComponentsInRyftForm({
|
|
207
|
+
t,
|
|
208
|
+
isAppUsingInIframe,
|
|
209
|
+
onApplePayButtonClick,
|
|
210
|
+
isDisableButton: !payButtonDisabled,
|
|
211
|
+
additionalPaymentMethodsEnabled:
|
|
212
|
+
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
|
+
[formRef.current?.childNodes?.length, showApplePayButton, payButtonDisabled],
|
|
217
|
+
)
|
|
218
|
+
|
|
217
219
|
if (accountId.isLoading || accountId.isFetching || isCreateLoading)
|
|
218
220
|
return (
|
|
219
221
|
<div className='mt-5 pt-5'>
|