@saasquatch/mint-components 1.12.0-12 → 1.12.0-14
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/cjs/sqm-banking-info-form_16.cjs.entry.js +33 -13
- package/dist/cjs/sqm-big-stat_39.cjs.entry.js +38 -1
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-invoice-table-view-301eed81.js → sqm-invoice-table-view-ed76d7bd.js} +16 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -1
- package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +5 -1
- package/dist/collection/components/sqm-payout-button-scroll/usePayoutButton.js +3 -10
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +1 -1
- package/dist/collection/components/tax-and-cash/BankingForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +15 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +28 -6
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +4 -5
- package/dist/esm/sqm-banking-info-form_16.entry.js +33 -13
- package/dist/esm/sqm-big-stat_39.entry.js +38 -1
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/{sqm-invoice-table-view-1f26f252.js → sqm-invoice-table-view-6601d8f2.js} +16 -0
- package/dist/esm/sqm-stencilbook.entry.js +2 -1
- package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-6601d8f2.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-b24b4d75.entry.js → p-02892b2a.entry.js} +1 -1
- package/dist/mint-components/{p-9ddcfcd7.entry.js → p-21aa318a.entry.js} +3 -3
- package/dist/mint-components/p-2d836e58.js +1 -0
- package/dist/mint-components/{p-b9e863d0.entry.js → p-30ac8e59.entry.js} +29 -11
- package/dist/mint-components/p-45a8d0fc.system.js +1 -0
- package/dist/mint-components/p-4adff550.system.entry.js +1 -0
- package/dist/mint-components/{p-f7902f51.entry.js → p-856c09f1.entry.js} +2 -2
- package/dist/mint-components/{p-f7493ca6.system.entry.js → p-8fa2809f.system.entry.js} +1 -1
- package/dist/mint-components/p-9a21cc81.system.entry.js +1 -0
- package/dist/mint-components/p-ca809fdd.system.js +1 -1
- package/dist/mint-components/{p-c5f84a95.system.entry.js → p-e0c54a41.system.entry.js} +1 -1
- package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +2 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-1f26f252.js +0 -1
- package/dist/mint-components/p-635f1cf5.system.entry.js +0 -1
- package/dist/mint-components/p-78ec0d48.js +0 -1
- package/dist/mint-components/p-7d79f697.system.js +0 -1
- package/dist/mint-components/p-a567ba84.system.entry.js +0 -1
|
@@ -16,7 +16,7 @@ const useChildElements = require('./useChildElements-410d2435.js');
|
|
|
16
16
|
const luxon = require('./luxon-05098e19.js');
|
|
17
17
|
const useReferralTable = require('./useReferralTable-824ac152.js');
|
|
18
18
|
const utils = require('./utils-6847bc06.js');
|
|
19
|
-
const sqmInvoiceTableView = require('./sqm-invoice-table-view-
|
|
19
|
+
const sqmInvoiceTableView = require('./sqm-invoice-table-view-ed76d7bd.js');
|
|
20
20
|
const keys = require('./keys-cff24974.js');
|
|
21
21
|
const usePayoutStatus = require('./usePayoutStatus-5ac536a3.js');
|
|
22
22
|
const extractProps = require('./extractProps-fd93ba62.js');
|
|
@@ -1190,7 +1190,8 @@ function useBankingInfoForm(props) {
|
|
|
1190
1190
|
});
|
|
1191
1191
|
setShowVerification(false);
|
|
1192
1192
|
}
|
|
1193
|
-
|
|
1193
|
+
if (token)
|
|
1194
|
+
await runMutation(formData, token);
|
|
1194
1195
|
};
|
|
1195
1196
|
const onVerification = async (token) => {
|
|
1196
1197
|
host.dispatchEvent(new CustomEvent(keys.VERIFICATION_EVENT_KEY, {
|
|
@@ -1223,6 +1224,7 @@ function useBankingInfoForm(props) {
|
|
|
1223
1224
|
onBack: () => setStep("/dashboard"),
|
|
1224
1225
|
setCountrySearch,
|
|
1225
1226
|
onVerification,
|
|
1227
|
+
onVerificationHide: () => onVerification(null),
|
|
1226
1228
|
},
|
|
1227
1229
|
states: {
|
|
1228
1230
|
showVerification,
|
|
@@ -1556,15 +1558,33 @@ const BankingInfoForm = class {
|
|
|
1556
1558
|
bitset: props.states.bitset,
|
|
1557
1559
|
formMap,
|
|
1558
1560
|
});
|
|
1559
|
-
const
|
|
1561
|
+
const style = {
|
|
1562
|
+
Dialog: {
|
|
1563
|
+
"&::part(panel)": {
|
|
1564
|
+
maxWidth: "420px",
|
|
1565
|
+
},
|
|
1566
|
+
"&::part(close-button)": {
|
|
1567
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
1568
|
+
},
|
|
1569
|
+
"&::part(body)": {
|
|
1570
|
+
padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
1571
|
+
fontSize: "var(--sl-font-size-small)",
|
|
1572
|
+
},
|
|
1573
|
+
"&::part(footer)": {
|
|
1574
|
+
display: "flex",
|
|
1575
|
+
flexDirection: "column",
|
|
1576
|
+
gap: "var(--sl-spacing-small)",
|
|
1577
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
1578
|
+
alignItems: "center",
|
|
1579
|
+
flex: "1",
|
|
1580
|
+
},
|
|
1581
|
+
},
|
|
1560
1582
|
SearchInput: {
|
|
1561
1583
|
padding: "var(--sl-spacing-x-small)",
|
|
1562
1584
|
},
|
|
1563
1585
|
};
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
}
|
|
1567
|
-
return (index.h(index.Host, null, index.h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
1586
|
+
const sheet = JSS.createStyleSheet(style);
|
|
1587
|
+
return (index.h(index.Host, null, props.states.isPartner && props.states.showVerification ? (index.h("sl-dialog", { class: sheet.classes.Dialog, open: true, "onSl-hide": props.callbacks.onVerificationHide }, index.h("sqm-code-verification", { onVerification: props.callbacks.onVerification }))) : null, index.h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
1568
1588
|
formInputsSlot: inputFields === null || inputFields === void 0 ? void 0 : inputFields.map(({ input }) => input),
|
|
1569
1589
|
countryInputSlot: (index.h("sl-select", Object.assign({ label: props.text.bankLocationLabel, disabled: props.states.saveLoading, required: true, name: "/bankCountry", id: "bankCountry", value: props.states.formState.bankCountry || "", "onSl-select": (e) => { var _a, _b; return props.callbacks.setBankCountry((_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value); } }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.bankCountry) && {
|
|
1570
1590
|
class: "error-input",
|
|
@@ -1572,7 +1592,7 @@ const BankingInfoForm = class {
|
|
|
1572
1592
|
type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.bankCountry) === null || _c === void 0 ? void 0 : _c.type,
|
|
1573
1593
|
label: props.text.bankLocationLabel,
|
|
1574
1594
|
}),
|
|
1575
|
-
})), index.h("sl-input", { disabled: props.states.saveLoading, class:
|
|
1595
|
+
})), index.h("sl-input", { disabled: props.states.saveLoading, class: sheet.classes.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
|
|
1576
1596
|
// Stop shoelace intercepting key presses
|
|
1577
1597
|
e.stopPropagation();
|
|
1578
1598
|
}, "onSl-input": (e) => {
|
|
@@ -1688,6 +1708,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1688
1708
|
hasPayPal: true,
|
|
1689
1709
|
},
|
|
1690
1710
|
callbacks: {
|
|
1711
|
+
onVerificationHide: () => { },
|
|
1691
1712
|
onSubmit: async () => {
|
|
1692
1713
|
setStep("/dashboard");
|
|
1693
1714
|
},
|
|
@@ -5050,6 +5071,7 @@ const style$5 = {
|
|
|
5050
5071
|
PageDescriptionText: {
|
|
5051
5072
|
color: "var(--sl-color-neutral-500)",
|
|
5052
5073
|
fontSize: "var(--sl-font-size-medium)",
|
|
5074
|
+
marginTop: "0",
|
|
5053
5075
|
},
|
|
5054
5076
|
Dialog: {
|
|
5055
5077
|
"&::part(panel)": {
|
|
@@ -5218,20 +5240,18 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5218
5240
|
index.h("strong", null, text.error.generalTitle),
|
|
5219
5241
|
index.h("br", null),
|
|
5220
5242
|
text.error.generalDescription)),
|
|
5221
|
-
states.payoutStatus &&
|
|
5243
|
+
getAlert(states.payoutStatus) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", name: (_b = getAlert(states.payoutStatus)) === null || _b === void 0 ? void 0 : _b.alertType, open: true, class: (_c = getAlert(states.payoutStatus)) === null || _c === void 0 ? void 0 : _c.class },
|
|
5222
5244
|
index.h("sl-icon", { slot: "icon", name: (_d = getAlert(states.payoutStatus)) === null || _d === void 0 ? void 0 : _d.icon }),
|
|
5223
5245
|
index.h("strong", null, getAlert(states.payoutStatus).header),
|
|
5224
5246
|
index.h("p", { style: { margin: "0" } }, getAlert(states.payoutStatus).description),
|
|
5225
|
-
getAlert(states.payoutStatus).buttonText && (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.
|
|
5226
|
-
//AL: TODO hooks
|
|
5227
|
-
onClick: () => callbacks.onClick }, getAlert(states.payoutStatus).buttonText)))),
|
|
5247
|
+
getAlert(states.payoutStatus).buttonText && (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, getAlert(states.payoutStatus).buttonText)))),
|
|
5228
5248
|
index.h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet$4.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
|
|
5229
5249
|
index.h("p", null, text.replaceTaxFormModalBodyText),
|
|
5230
5250
|
index.h("sl-button", { slot: "footer", type: "primary", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
|
|
5231
5251
|
index.h("sl-button", { slot: "footer", type: "default", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
|
|
5232
5252
|
states.status === "INACTIVE" && alertMap[states.status],
|
|
5233
5253
|
index.h("div", null,
|
|
5234
|
-
index.h("h3",
|
|
5254
|
+
index.h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
|
|
5235
5255
|
index.h("p", { class: sheet$4.classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
5236
5256
|
index.h("div", { class: sheet$4.classes.BankingInformationContainer },
|
|
5237
5257
|
slots.payoutDetailsCardSlot,
|
|
@@ -1743,6 +1743,41 @@ function PayoutButtonScrollView(props) {
|
|
|
1743
1743
|
index.h("p", { class: sheet$2.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
|
|
1744
1744
|
}
|
|
1745
1745
|
|
|
1746
|
+
const GET_PAYOUT_DETAILS = index_module.dist.gql `
|
|
1747
|
+
query getPayoutDetails {
|
|
1748
|
+
user: viewer {
|
|
1749
|
+
... on User {
|
|
1750
|
+
id
|
|
1751
|
+
impactConnection {
|
|
1752
|
+
connected
|
|
1753
|
+
publisher {
|
|
1754
|
+
id
|
|
1755
|
+
payoutsAccount {
|
|
1756
|
+
hold
|
|
1757
|
+
balance
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
`;
|
|
1765
|
+
function usePayoutButton(props) {
|
|
1766
|
+
var _a, _b, _c;
|
|
1767
|
+
const { data, refetch } = index_module.En(GET_PAYOUT_DETAILS, {});
|
|
1768
|
+
stencilHooks_module.useEffect(() => {
|
|
1769
|
+
const cb = () => refetch();
|
|
1770
|
+
window.addEventListener("sqm:tax-form-updated", cb);
|
|
1771
|
+
return () => window.removeEventListener("sqm:tax-form-updated", cb);
|
|
1772
|
+
}, []);
|
|
1773
|
+
return {
|
|
1774
|
+
states: {
|
|
1775
|
+
payoutSettingsComplete: !!((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.payoutsAccount),
|
|
1776
|
+
},
|
|
1777
|
+
text: props.getTextProps(),
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1746
1781
|
const PayoutButtonScroll = class {
|
|
1747
1782
|
constructor(hostRef) {
|
|
1748
1783
|
index.registerInstance(this, hostRef);
|
|
@@ -1763,7 +1798,9 @@ const PayoutButtonScroll = class {
|
|
|
1763
1798
|
return utils.getProps(this);
|
|
1764
1799
|
}
|
|
1765
1800
|
render() {
|
|
1766
|
-
const props =
|
|
1801
|
+
const props = index_module.isDemo()
|
|
1802
|
+
? useDemoPayoutButtonScroll(this)
|
|
1803
|
+
: usePayoutButton(this);
|
|
1767
1804
|
return index.h(PayoutButtonScrollView, Object.assign({}, props));
|
|
1768
1805
|
}
|
|
1769
1806
|
};
|
|
@@ -714,6 +714,7 @@ const stepFourProps = {
|
|
|
714
714
|
},
|
|
715
715
|
},
|
|
716
716
|
callbacks: {
|
|
717
|
+
onVerificationHide: () => { },
|
|
717
718
|
onVerification: () => { },
|
|
718
719
|
onSubmit: async () => console.log("Submit"),
|
|
719
720
|
setPaymentMethodChecked: () => { },
|
|
@@ -1262,6 +1263,20 @@ const StepFourToPaypalChecked = () => {
|
|
|
1262
1263
|
},
|
|
1263
1264
|
} }));
|
|
1264
1265
|
};
|
|
1266
|
+
const StepFourReVerifyEmail = () => {
|
|
1267
|
+
return (index.h("sqm-banking-info-form", { demoData: {
|
|
1268
|
+
...stepFourProps,
|
|
1269
|
+
states: {
|
|
1270
|
+
...stepFourProps.states,
|
|
1271
|
+
showVerification: true,
|
|
1272
|
+
isPartner: true,
|
|
1273
|
+
formState: {
|
|
1274
|
+
...stepFourProps.states.formState,
|
|
1275
|
+
paymentMethodChecked: "toPayPalAccount",
|
|
1276
|
+
},
|
|
1277
|
+
},
|
|
1278
|
+
} }));
|
|
1279
|
+
};
|
|
1265
1280
|
const TaxAndCashDashboardActiveW9Form = () => {
|
|
1266
1281
|
return (index.h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
1267
1282
|
...dashboardProps,
|
|
@@ -1755,6 +1770,7 @@ const TaxForm = /*#__PURE__*/Object.freeze({
|
|
|
1755
1770
|
StepFourIsPartner: StepFourIsPartner,
|
|
1756
1771
|
StepFourDirectToBankChecked: StepFourDirectToBankChecked,
|
|
1757
1772
|
StepFourToPaypalChecked: StepFourToPaypalChecked,
|
|
1773
|
+
StepFourReVerifyEmail: StepFourReVerifyEmail,
|
|
1758
1774
|
TaxAndCashDashboardActiveW9Form: TaxAndCashDashboardActiveW9Form,
|
|
1759
1775
|
TaxAndCashDashboardActiveW8BENForm: TaxAndCashDashboardActiveW8BENForm,
|
|
1760
1776
|
TaxAndCashDashboardActiveW8BENEForm: TaxAndCashDashboardActiveW8BENEForm,
|
|
@@ -30,7 +30,7 @@ const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-96f
|
|
|
30
30
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7ffcc0d4.js');
|
|
31
31
|
const ShadowViewAddon = require('./ShadowViewAddon-040cffad.js');
|
|
32
32
|
const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
|
|
33
|
-
const sqmInvoiceTableView = require('./sqm-invoice-table-view-
|
|
33
|
+
const sqmInvoiceTableView = require('./sqm-invoice-table-view-ed76d7bd.js');
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* lodash (Custom Build) <https://lodash.com/>
|
|
@@ -14404,6 +14404,7 @@ const bankingFormProps = {
|
|
|
14404
14404
|
loadingError: false,
|
|
14405
14405
|
},
|
|
14406
14406
|
callbacks: {
|
|
14407
|
+
onVerificationHide: () => { },
|
|
14407
14408
|
onVerification: () => { },
|
|
14408
14409
|
onSubmit: async () => console.log("Submit"),
|
|
14409
14410
|
setPaymentMethodChecked: () => { },
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Component, h, Prop, State } from "@stencil/core";
|
|
2
2
|
import { withHooks } from "@saasquatch/stencil-hooks";
|
|
3
|
+
import { isDemo } from "@saasquatch/component-boilerplate";
|
|
3
4
|
import { getProps } from "../../utils/utils";
|
|
4
5
|
import { PayoutButtonScrollView, } from "./sqm-payout-button-scroll-view";
|
|
5
6
|
import deepmerge from "deepmerge";
|
|
7
|
+
import { usePayoutButton } from "./usePayoutButton";
|
|
6
8
|
/**
|
|
7
9
|
* @uiName Payout Button Scroll
|
|
8
10
|
*/
|
|
@@ -25,7 +27,9 @@ export class PayoutButtonScroll {
|
|
|
25
27
|
return getProps(this);
|
|
26
28
|
}
|
|
27
29
|
render() {
|
|
28
|
-
const props =
|
|
30
|
+
const props = isDemo()
|
|
31
|
+
? useDemoPayoutButtonScroll(this)
|
|
32
|
+
: usePayoutButton(this);
|
|
29
33
|
return h(PayoutButtonScrollView, Object.assign({}, props));
|
|
30
34
|
}
|
|
31
35
|
static get is() { return "sqm-payout-button-scroll"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { gql } from "graphql-request";
|
|
2
2
|
import { useQuery } from "@saasquatch/component-boilerplate";
|
|
3
|
-
import { useEffect
|
|
3
|
+
import { useEffect } from "@saasquatch/universal-hooks";
|
|
4
4
|
const GET_PAYOUT_DETAILS = gql `
|
|
5
5
|
query getPayoutDetails {
|
|
6
6
|
user: viewer {
|
|
@@ -21,15 +21,8 @@ const GET_PAYOUT_DETAILS = gql `
|
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
23
|
export function usePayoutButton(props) {
|
|
24
|
+
var _a, _b, _c;
|
|
24
25
|
const { data, refetch } = useQuery(GET_PAYOUT_DETAILS, {});
|
|
25
|
-
const [completed, setCompleted] = useState(false);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
var _a, _b, _c;
|
|
28
|
-
if (!data)
|
|
29
|
-
return;
|
|
30
|
-
const hasCompleted = (_c = (_b = (_a = data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.payoutAccount;
|
|
31
|
-
setCompleted(hasCompleted);
|
|
32
|
-
}, [data]);
|
|
33
26
|
useEffect(() => {
|
|
34
27
|
const cb = () => refetch();
|
|
35
28
|
window.addEventListener("sqm:tax-form-updated", cb);
|
|
@@ -37,7 +30,7 @@ export function usePayoutButton(props) {
|
|
|
37
30
|
}, []);
|
|
38
31
|
return {
|
|
39
32
|
states: {
|
|
40
|
-
payoutSettingsComplete:
|
|
33
|
+
payoutSettingsComplete: !!((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.payoutsAccount),
|
|
41
34
|
},
|
|
42
35
|
text: props.getTextProps(),
|
|
43
36
|
};
|
|
@@ -210,6 +210,7 @@ const stepFourProps = {
|
|
|
210
210
|
},
|
|
211
211
|
},
|
|
212
212
|
callbacks: {
|
|
213
|
+
onVerificationHide: () => { },
|
|
213
214
|
onVerification: () => { },
|
|
214
215
|
onSubmit: async () => console.log("Submit"),
|
|
215
216
|
setPaymentMethodChecked: () => { },
|
|
@@ -758,6 +759,20 @@ export const StepFourToPaypalChecked = () => {
|
|
|
758
759
|
},
|
|
759
760
|
} }));
|
|
760
761
|
};
|
|
762
|
+
export const StepFourReVerifyEmail = () => {
|
|
763
|
+
return (h("sqm-banking-info-form", { demoData: {
|
|
764
|
+
...stepFourProps,
|
|
765
|
+
states: {
|
|
766
|
+
...stepFourProps.states,
|
|
767
|
+
showVerification: true,
|
|
768
|
+
isPartner: true,
|
|
769
|
+
formState: {
|
|
770
|
+
...stepFourProps.states.formState,
|
|
771
|
+
paymentMethodChecked: "toPayPalAccount",
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
} }));
|
|
775
|
+
};
|
|
761
776
|
export const TaxAndCashDashboardActiveW9Form = () => {
|
|
762
777
|
return (h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
763
778
|
...dashboardProps,
|
package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getFormMap } from "./formDefinitions";
|
|
|
10
10
|
import { mockPaymentOptions } from "./mockData";
|
|
11
11
|
import { BankingInfoFormView, } from "./sqm-banking-info-form-view";
|
|
12
12
|
import { getFormInputs, paypalFeeMap, useBankingInfoForm, } from "./useBankingInfoForm";
|
|
13
|
+
import { createStyleSheet } from "../../../styling/JSS";
|
|
13
14
|
/**
|
|
14
15
|
* @uiName Banking Information Form
|
|
15
16
|
* @exampleGroup Common Components
|
|
@@ -308,15 +309,35 @@ export class BankingInfoForm {
|
|
|
308
309
|
bitset: props.states.bitset,
|
|
309
310
|
formMap,
|
|
310
311
|
});
|
|
311
|
-
const
|
|
312
|
+
const style = {
|
|
313
|
+
Dialog: {
|
|
314
|
+
"&::part(panel)": {
|
|
315
|
+
maxWidth: "420px",
|
|
316
|
+
},
|
|
317
|
+
"&::part(close-button)": {
|
|
318
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
319
|
+
},
|
|
320
|
+
"&::part(body)": {
|
|
321
|
+
padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
322
|
+
fontSize: "var(--sl-font-size-small)",
|
|
323
|
+
},
|
|
324
|
+
"&::part(footer)": {
|
|
325
|
+
display: "flex",
|
|
326
|
+
flexDirection: "column",
|
|
327
|
+
gap: "var(--sl-spacing-small)",
|
|
328
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
329
|
+
alignItems: "center",
|
|
330
|
+
flex: "1",
|
|
331
|
+
},
|
|
332
|
+
},
|
|
312
333
|
SearchInput: {
|
|
313
334
|
padding: "var(--sl-spacing-x-small)",
|
|
314
335
|
},
|
|
315
336
|
};
|
|
316
|
-
|
|
317
|
-
return (h("sqm-code-verification", { onVerification: props.callbacks.onVerification }));
|
|
318
|
-
}
|
|
337
|
+
const sheet = createStyleSheet(style);
|
|
319
338
|
return (h(Host, null,
|
|
339
|
+
props.states.isPartner && props.states.showVerification ? (h("sl-dialog", { class: sheet.classes.Dialog, open: true, "onSl-hide": props.callbacks.onVerificationHide },
|
|
340
|
+
h("sqm-code-verification", { onVerification: props.callbacks.onVerification }))) : null,
|
|
320
341
|
h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
321
342
|
formInputsSlot: inputFields === null || inputFields === void 0 ? void 0 : inputFields.map(({ input }) => input),
|
|
322
343
|
countryInputSlot: (h("sl-select", Object.assign({ label: props.text.bankLocationLabel, disabled: props.states.saveLoading, required: true, name: "/bankCountry", id: "bankCountry", value: props.states.formState.bankCountry || "", "onSl-select": (e) => { var _a, _b; return props.callbacks.setBankCountry((_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value); } }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.bankCountry) && {
|
|
@@ -326,7 +347,7 @@ export class BankingInfoForm {
|
|
|
326
347
|
label: props.text.bankLocationLabel,
|
|
327
348
|
}),
|
|
328
349
|
})),
|
|
329
|
-
h("sl-input", { disabled: props.states.saveLoading, class:
|
|
350
|
+
h("sl-input", { disabled: props.states.saveLoading, class: sheet.classes.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
|
|
330
351
|
// Stop shoelace intercepting key presses
|
|
331
352
|
e.stopPropagation();
|
|
332
353
|
}, "onSl-input": (e) => {
|
|
@@ -1500,7 +1521,7 @@ export class BankingInfoForm {
|
|
|
1500
1521
|
"mutable": false,
|
|
1501
1522
|
"complexType": {
|
|
1502
1523
|
"original": "DemoData<BankingInfoFormViewProps>",
|
|
1503
|
-
"resolved": "{ states?: { showVerification: boolean; step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; }; slots?: { formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1524
|
+
"resolved": "{ states?: { showVerification: boolean; step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; }; slots?: { verificationDialogSlot?: VNode; formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1504
1525
|
"references": {
|
|
1505
1526
|
"DemoData": {
|
|
1506
1527
|
"location": "import",
|
|
@@ -1611,6 +1632,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1611
1632
|
hasPayPal: true,
|
|
1612
1633
|
},
|
|
1613
1634
|
callbacks: {
|
|
1635
|
+
onVerificationHide: () => { },
|
|
1614
1636
|
onSubmit: async () => {
|
|
1615
1637
|
setStep("/dashboard");
|
|
1616
1638
|
},
|
|
@@ -289,7 +289,8 @@ export function useBankingInfoForm(props) {
|
|
|
289
289
|
});
|
|
290
290
|
setShowVerification(false);
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
if (token)
|
|
293
|
+
await runMutation(formData, token);
|
|
293
294
|
};
|
|
294
295
|
const onVerification = async (token) => {
|
|
295
296
|
host.dispatchEvent(new CustomEvent(VERIFICATION_EVENT_KEY, {
|
|
@@ -322,6 +323,7 @@ export function useBankingInfoForm(props) {
|
|
|
322
323
|
onBack: () => setStep("/dashboard"),
|
|
323
324
|
setCountrySearch,
|
|
324
325
|
onVerification,
|
|
326
|
+
onVerificationHide: () => onVerification(null),
|
|
325
327
|
},
|
|
326
328
|
states: {
|
|
327
329
|
showVerification,
|
|
@@ -159,6 +159,7 @@ const style = {
|
|
|
159
159
|
PageDescriptionText: {
|
|
160
160
|
color: "var(--sl-color-neutral-500)",
|
|
161
161
|
fontSize: "var(--sl-font-size-medium)",
|
|
162
|
+
marginTop: "0",
|
|
162
163
|
},
|
|
163
164
|
Dialog: {
|
|
164
165
|
"&::part(panel)": {
|
|
@@ -327,20 +328,18 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
327
328
|
h("strong", null, text.error.generalTitle),
|
|
328
329
|
h("br", null),
|
|
329
330
|
text.error.generalDescription)),
|
|
330
|
-
states.payoutStatus &&
|
|
331
|
+
getAlert(states.payoutStatus) && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", name: (_b = getAlert(states.payoutStatus)) === null || _b === void 0 ? void 0 : _b.alertType, open: true, class: (_c = getAlert(states.payoutStatus)) === null || _c === void 0 ? void 0 : _c.class },
|
|
331
332
|
h("sl-icon", { slot: "icon", name: (_d = getAlert(states.payoutStatus)) === null || _d === void 0 ? void 0 : _d.icon }),
|
|
332
333
|
h("strong", null, getAlert(states.payoutStatus).header),
|
|
333
334
|
h("p", { style: { margin: "0" } }, getAlert(states.payoutStatus).description),
|
|
334
|
-
getAlert(states.payoutStatus).buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.
|
|
335
|
-
//AL: TODO hooks
|
|
336
|
-
onClick: () => callbacks.onClick }, getAlert(states.payoutStatus).buttonText)))),
|
|
335
|
+
getAlert(states.payoutStatus).buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, getAlert(states.payoutStatus).buttonText)))),
|
|
337
336
|
h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
|
|
338
337
|
h("p", null, text.replaceTaxFormModalBodyText),
|
|
339
338
|
h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
|
|
340
339
|
h("sl-button", { slot: "footer", type: "default", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
|
|
341
340
|
states.status === "INACTIVE" && alertMap[states.status],
|
|
342
341
|
h("div", null,
|
|
343
|
-
h("h3",
|
|
342
|
+
h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
|
|
344
343
|
h("p", { class: sheet.classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
345
344
|
h("div", { class: sheet.classes.BankingInformationContainer },
|
|
346
345
|
slots.payoutDetailsCardSlot,
|
|
@@ -12,7 +12,7 @@ import { u as useChildElements } from './useChildElements-fc84e640.js';
|
|
|
12
12
|
import { l as luxon } from './luxon-7600be8d.js';
|
|
13
13
|
import { g as generateUserError } from './useReferralTable-f6ffa103.js';
|
|
14
14
|
import { g as getProps, l as luxonLocale } from './utils-334c1e34.js';
|
|
15
|
-
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, E as ErrorView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-
|
|
15
|
+
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, E as ErrorView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-6601d8f2.js';
|
|
16
16
|
import { b as VERIFICATION_EVENT_KEY } from './keys-db1897ae.js';
|
|
17
17
|
import { T as TAX_FORM_UPDATED_EVENT_KEY, a as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY } from './usePayoutStatus-d613ff10.js';
|
|
18
18
|
import { e as extractProps } from './extractProps-ae1afbb3.js';
|
|
@@ -1186,7 +1186,8 @@ function useBankingInfoForm(props) {
|
|
|
1186
1186
|
});
|
|
1187
1187
|
setShowVerification(false);
|
|
1188
1188
|
}
|
|
1189
|
-
|
|
1189
|
+
if (token)
|
|
1190
|
+
await runMutation(formData, token);
|
|
1190
1191
|
};
|
|
1191
1192
|
const onVerification = async (token) => {
|
|
1192
1193
|
host.dispatchEvent(new CustomEvent(VERIFICATION_EVENT_KEY, {
|
|
@@ -1219,6 +1220,7 @@ function useBankingInfoForm(props) {
|
|
|
1219
1220
|
onBack: () => setStep("/dashboard"),
|
|
1220
1221
|
setCountrySearch,
|
|
1221
1222
|
onVerification,
|
|
1223
|
+
onVerificationHide: () => onVerification(null),
|
|
1222
1224
|
},
|
|
1223
1225
|
states: {
|
|
1224
1226
|
showVerification,
|
|
@@ -1552,15 +1554,33 @@ const BankingInfoForm = class {
|
|
|
1552
1554
|
bitset: props.states.bitset,
|
|
1553
1555
|
formMap,
|
|
1554
1556
|
});
|
|
1555
|
-
const
|
|
1557
|
+
const style = {
|
|
1558
|
+
Dialog: {
|
|
1559
|
+
"&::part(panel)": {
|
|
1560
|
+
maxWidth: "420px",
|
|
1561
|
+
},
|
|
1562
|
+
"&::part(close-button)": {
|
|
1563
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
1564
|
+
},
|
|
1565
|
+
"&::part(body)": {
|
|
1566
|
+
padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
1567
|
+
fontSize: "var(--sl-font-size-small)",
|
|
1568
|
+
},
|
|
1569
|
+
"&::part(footer)": {
|
|
1570
|
+
display: "flex",
|
|
1571
|
+
flexDirection: "column",
|
|
1572
|
+
gap: "var(--sl-spacing-small)",
|
|
1573
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
1574
|
+
alignItems: "center",
|
|
1575
|
+
flex: "1",
|
|
1576
|
+
},
|
|
1577
|
+
},
|
|
1556
1578
|
SearchInput: {
|
|
1557
1579
|
padding: "var(--sl-spacing-x-small)",
|
|
1558
1580
|
},
|
|
1559
1581
|
};
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
}
|
|
1563
|
-
return (h(Host, null, h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
1582
|
+
const sheet = createStyleSheet(style);
|
|
1583
|
+
return (h(Host, null, props.states.isPartner && props.states.showVerification ? (h("sl-dialog", { class: sheet.classes.Dialog, open: true, "onSl-hide": props.callbacks.onVerificationHide }, h("sqm-code-verification", { onVerification: props.callbacks.onVerification }))) : null, h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
1564
1584
|
formInputsSlot: inputFields === null || inputFields === void 0 ? void 0 : inputFields.map(({ input }) => input),
|
|
1565
1585
|
countryInputSlot: (h("sl-select", Object.assign({ label: props.text.bankLocationLabel, disabled: props.states.saveLoading, required: true, name: "/bankCountry", id: "bankCountry", value: props.states.formState.bankCountry || "", "onSl-select": (e) => { var _a, _b; return props.callbacks.setBankCountry((_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value); } }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.bankCountry) && {
|
|
1566
1586
|
class: "error-input",
|
|
@@ -1568,7 +1588,7 @@ const BankingInfoForm = class {
|
|
|
1568
1588
|
type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.bankCountry) === null || _c === void 0 ? void 0 : _c.type,
|
|
1569
1589
|
label: props.text.bankLocationLabel,
|
|
1570
1590
|
}),
|
|
1571
|
-
})), h("sl-input", { disabled: props.states.saveLoading, class:
|
|
1591
|
+
})), h("sl-input", { disabled: props.states.saveLoading, class: sheet.classes.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
|
|
1572
1592
|
// Stop shoelace intercepting key presses
|
|
1573
1593
|
e.stopPropagation();
|
|
1574
1594
|
}, "onSl-input": (e) => {
|
|
@@ -1684,6 +1704,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1684
1704
|
hasPayPal: true,
|
|
1685
1705
|
},
|
|
1686
1706
|
callbacks: {
|
|
1707
|
+
onVerificationHide: () => { },
|
|
1687
1708
|
onSubmit: async () => {
|
|
1688
1709
|
setStep("/dashboard");
|
|
1689
1710
|
},
|
|
@@ -5046,6 +5067,7 @@ const style$5 = {
|
|
|
5046
5067
|
PageDescriptionText: {
|
|
5047
5068
|
color: "var(--sl-color-neutral-500)",
|
|
5048
5069
|
fontSize: "var(--sl-font-size-medium)",
|
|
5070
|
+
marginTop: "0",
|
|
5049
5071
|
},
|
|
5050
5072
|
Dialog: {
|
|
5051
5073
|
"&::part(panel)": {
|
|
@@ -5214,20 +5236,18 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5214
5236
|
h("strong", null, text.error.generalTitle),
|
|
5215
5237
|
h("br", null),
|
|
5216
5238
|
text.error.generalDescription)),
|
|
5217
|
-
states.payoutStatus &&
|
|
5239
|
+
getAlert(states.payoutStatus) && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", name: (_b = getAlert(states.payoutStatus)) === null || _b === void 0 ? void 0 : _b.alertType, open: true, class: (_c = getAlert(states.payoutStatus)) === null || _c === void 0 ? void 0 : _c.class },
|
|
5218
5240
|
h("sl-icon", { slot: "icon", name: (_d = getAlert(states.payoutStatus)) === null || _d === void 0 ? void 0 : _d.icon }),
|
|
5219
5241
|
h("strong", null, getAlert(states.payoutStatus).header),
|
|
5220
5242
|
h("p", { style: { margin: "0" } }, getAlert(states.payoutStatus).description),
|
|
5221
|
-
getAlert(states.payoutStatus).buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.
|
|
5222
|
-
//AL: TODO hooks
|
|
5223
|
-
onClick: () => callbacks.onClick }, getAlert(states.payoutStatus).buttonText)))),
|
|
5243
|
+
getAlert(states.payoutStatus).buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, getAlert(states.payoutStatus).buttonText)))),
|
|
5224
5244
|
h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet$4.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
|
|
5225
5245
|
h("p", null, text.replaceTaxFormModalBodyText),
|
|
5226
5246
|
h("sl-button", { slot: "footer", type: "primary", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
|
|
5227
5247
|
h("sl-button", { slot: "footer", type: "default", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
|
|
5228
5248
|
states.status === "INACTIVE" && alertMap[states.status],
|
|
5229
5249
|
h("div", null,
|
|
5230
|
-
h("h3",
|
|
5250
|
+
h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
|
|
5231
5251
|
h("p", { class: sheet$4.classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
5232
5252
|
h("div", { class: sheet$4.classes.BankingInformationContainer },
|
|
5233
5253
|
slots.payoutDetailsCardSlot,
|
|
@@ -1739,6 +1739,41 @@ function PayoutButtonScrollView(props) {
|
|
|
1739
1739
|
h$1("p", { class: sheet$2.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
|
|
1740
1740
|
}
|
|
1741
1741
|
|
|
1742
|
+
const GET_PAYOUT_DETAILS = dist.gql `
|
|
1743
|
+
query getPayoutDetails {
|
|
1744
|
+
user: viewer {
|
|
1745
|
+
... on User {
|
|
1746
|
+
id
|
|
1747
|
+
impactConnection {
|
|
1748
|
+
connected
|
|
1749
|
+
publisher {
|
|
1750
|
+
id
|
|
1751
|
+
payoutsAccount {
|
|
1752
|
+
hold
|
|
1753
|
+
balance
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
`;
|
|
1761
|
+
function usePayoutButton(props) {
|
|
1762
|
+
var _a, _b, _c;
|
|
1763
|
+
const { data, refetch } = En(GET_PAYOUT_DETAILS, {});
|
|
1764
|
+
useEffect(() => {
|
|
1765
|
+
const cb = () => refetch();
|
|
1766
|
+
window.addEventListener("sqm:tax-form-updated", cb);
|
|
1767
|
+
return () => window.removeEventListener("sqm:tax-form-updated", cb);
|
|
1768
|
+
}, []);
|
|
1769
|
+
return {
|
|
1770
|
+
states: {
|
|
1771
|
+
payoutSettingsComplete: !!((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.payoutsAccount),
|
|
1772
|
+
},
|
|
1773
|
+
text: props.getTextProps(),
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1742
1777
|
const PayoutButtonScroll = class {
|
|
1743
1778
|
constructor(hostRef) {
|
|
1744
1779
|
registerInstance(this, hostRef);
|
|
@@ -1759,7 +1794,9 @@ const PayoutButtonScroll = class {
|
|
|
1759
1794
|
return getProps(this);
|
|
1760
1795
|
}
|
|
1761
1796
|
render() {
|
|
1762
|
-
const props =
|
|
1797
|
+
const props = isDemo()
|
|
1798
|
+
? useDemoPayoutButtonScroll(this)
|
|
1799
|
+
: usePayoutButton(this);
|
|
1763
1800
|
return h$1(PayoutButtonScrollView, Object.assign({}, props));
|
|
1764
1801
|
}
|
|
1765
1802
|
};
|