@saasquatch/mint-components 2.3.0-9 → 2.3.0
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/{esm/usePortalRegistrationForm-3a1f36a2.js → cjs/AsYouType-d15caac8.js} +267 -222
- package/dist/cjs/{ShadowViewAddon-3b477e58.js → ShadowViewAddon-05c6968d.js} +4 -4
- package/dist/cjs/{global-b7b1b8fe.js → global-258c36b8.js} +7 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +49 -36
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +38 -25
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +6 -9
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-lead-checkbox-field-view-0af2a157.js → sqm-lead-checkbox-field-view-b3a85029.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-0cd7ebdb.js → sqm-lead-input-field-view-88de1b78.js} +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-partner-info-modal-view-2b6fee0f.js → sqm-partner-info-modal-view-243aad7b.js} +6 -7
- package/dist/cjs/{sqm-portal-email-verification-view-abb773a7.js → sqm-portal-email-verification-view-6cc7ef05.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +3 -2
- package/dist/cjs/{sqm-portal-profile-view-3515e1e5.js → sqm-portal-profile-view-a4ba4657.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -2
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +69 -12
- package/dist/cjs/{sqm-user-info-form-view-374a3f01.js → sqm-user-info-form-view-c5f9b79b.js} +1007 -11
- package/dist/cjs/subregions-3d27e279.js +1068 -0
- package/dist/cjs/{useIndirectTaxForm-112914a0.js → useIndirectTaxForm-5211013b.js} +6 -2
- package/dist/cjs/{useLeadFormState-b4c2ab5b.js → useLeadFormState-bf49984b.js} +1 -1
- package/dist/cjs/usePortalRegistrationForm-8a3a14ac.js +215 -0
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field-view.js +1 -1
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +1 -1
- package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +1 -1
- package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +2 -2
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +5 -6
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +3 -6
- package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +0 -1
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +1 -1
- package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +2 -0
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +3 -0
- package/dist/collection/components/tax-and-cash/phoneExtensions.js +12 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -3
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.js +3 -3
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +3 -2
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +5 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +29 -19
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.js +52 -0
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/small-views/IndirectTaxDetailsView.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -5
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +3 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +34 -28
- package/dist/collection/components/tax-and-cash/utils.js +30 -27
- package/dist/collection/global/styles.js +7 -3
- package/dist/collection/global/styles.ts +7 -3
- package/dist/{cjs/usePortalRegistrationForm-23ee2d62.js → esm/AsYouType-2d56519e.js} +248 -226
- package/dist/esm/{ShadowViewAddon-e115fa1c.js → ShadowViewAddon-543f0fef.js} +4 -4
- package/dist/esm/{global-75e96214.js → global-32d00a6e.js} +7 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +49 -36
- package/dist/esm/sqm-big-stat_47.entry.js +37 -24
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification_2.entry.js +6 -9
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/{sqm-lead-checkbox-field-view-bfafee56.js → sqm-lead-checkbox-field-view-aa977b97.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-b945edf4.js → sqm-lead-input-field-view-671ff96f.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +3 -3
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-8f141a4f.js} +6 -7
- package/dist/esm/{sqm-portal-email-verification-view-fde1eb35.js → sqm-portal-email-verification-view-29ca7a13.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/sqm-portal-forgot-password_6.entry.js +2 -1
- package/dist/esm/{sqm-portal-profile-view-2018590a.js → sqm-portal-profile-view-769aafeb.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -2
- package/dist/esm/sqm-stencilbook.entry.js +69 -12
- package/dist/esm/{sqm-user-info-form-view-5322525c.js → sqm-user-info-form-view-ceb3917a.js} +1005 -9
- package/dist/esm/subregions-810a5c2d.js +1055 -0
- package/dist/esm/{useIndirectTaxForm-a6ac7e7e.js → useIndirectTaxForm-4dc576f0.js} +6 -2
- package/dist/esm/{useLeadFormState-332b2796.js → useLeadFormState-6214b2d9.js} +1 -1
- package/dist/esm/usePortalRegistrationForm-78fdfd93.js +213 -0
- package/dist/esm-es5/AsYouType-2d56519e.js +1 -0
- package/dist/esm-es5/{ShadowViewAddon-e115fa1c.js → ShadowViewAddon-543f0fef.js} +1 -1
- package/dist/esm-es5/{global-75e96214.js → global-32d00a6e.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-bfafee56.js → sqm-lead-checkbox-field-view-aa977b97.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-b945edf4.js → sqm-lead-input-field-view-671ff96f.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-8f141a4f.js} +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-fde1eb35.js → sqm-portal-email-verification-view-29ca7a13.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-2018590a.js → sqm-portal-profile-view-769aafeb.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-user-info-form-view-ceb3917a.js +1 -0
- package/dist/esm-es5/subregions-810a5c2d.js +1 -0
- package/dist/esm-es5/{useIndirectTaxForm-a6ac7e7e.js → useIndirectTaxForm-4dc576f0.js} +2 -2
- package/dist/esm-es5/{useLeadFormState-332b2796.js → useLeadFormState-6214b2d9.js} +1 -1
- package/dist/esm-es5/usePortalRegistrationForm-78fdfd93.js +1 -0
- package/dist/mint-components/global/styles.ts +7 -3
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-ef32fa8f.entry.js → p-0436b138.entry.js} +1 -1
- package/dist/mint-components/{p-24f1d342.system.entry.js → p-058e5447.system.entry.js} +1 -1
- package/dist/mint-components/{p-8e148cb0.system.js → p-0607b068.system.js} +1 -1
- package/dist/mint-components/{p-2d4132fb.js → p-0ad64881.js} +7 -5
- package/dist/mint-components/{p-3354cc75.system.entry.js → p-141c5bdb.system.entry.js} +1 -1
- package/dist/mint-components/{p-37e24621.system.entry.js → p-241e7226.system.entry.js} +1 -1
- package/dist/mint-components/p-2a2332a6.entry.js +83 -0
- package/dist/mint-components/{p-3bbc0db2.entry.js → p-3ada35f5.entry.js} +1 -1
- package/dist/mint-components/{p-7d2d9ef9.system.js → p-3e7fb8a7.system.js} +1 -1
- package/dist/mint-components/{p-1d398dbc.entry.js → p-4f364438.entry.js} +1 -1
- package/dist/mint-components/p-55847fc2.system.entry.js +1 -0
- package/dist/mint-components/p-5c3bff99.entry.js +1 -0
- package/dist/mint-components/{p-7cbdf341.entry.js → p-5d3d0e0b.entry.js} +2 -2
- package/dist/mint-components/{p-b2ad3fca.system.js → p-5fa706cf.system.js} +1 -1
- package/dist/mint-components/{p-b3e1f2fa.entry.js → p-61f7bf8a.entry.js} +3 -3
- package/dist/mint-components/{p-b3309d9b.entry.js → p-62610658.entry.js} +2 -2
- package/dist/mint-components/{p-6ef373ed.system.js → p-6cd93ea3.system.js} +2 -2
- package/dist/mint-components/{p-c0f8f977.system.entry.js → p-6e92460d.system.entry.js} +1 -1
- package/dist/mint-components/{p-13d8ecad.js → p-6f8a3436.js} +1 -1
- package/dist/mint-components/{p-4d73a616.entry.js → p-714bf981.entry.js} +1 -1
- package/dist/mint-components/p-765e3379.js +1 -0
- package/dist/mint-components/p-76ad156b.entry.js +9 -0
- package/dist/mint-components/{p-51ae6716.system.entry.js → p-7727662f.system.entry.js} +1 -1
- package/dist/mint-components/{p-4eaa3eb7.js → p-7c0f5891.js} +1 -1
- package/dist/mint-components/{p-c0a85e22.js → p-7c482564.js} +1 -1
- package/dist/mint-components/{p-2ed13619.entry.js → p-7c657e1f.entry.js} +1 -1
- package/dist/mint-components/p-8dcd72fe.system.entry.js +1 -0
- package/dist/mint-components/{p-1efb42e2.js → p-92e81c72.js} +3 -3
- package/dist/mint-components/p-92f520c9.js +1 -0
- package/dist/mint-components/{p-99eecdcb.system.entry.js → p-933bae53.system.entry.js} +1 -1
- package/dist/mint-components/{p-c66e5217.system.js → p-989437c5.system.js} +1 -1
- package/dist/mint-components/p-990e73ba.system.js +1 -0
- package/dist/mint-components/{p-e8e7af06.js → p-9c982f7e.js} +1 -1
- package/dist/mint-components/p-a08157c4.js +1 -0
- package/dist/mint-components/{p-13e439bc.js → p-a094da68.js} +1 -1
- package/dist/mint-components/p-a779e577.js +13 -0
- package/dist/mint-components/p-aef2db59.system.js +1 -0
- package/dist/mint-components/p-b0d49a64.system.entry.js +1 -0
- package/dist/mint-components/{p-0815b973.system.js → p-b111d5d7.system.js} +1 -1
- package/dist/mint-components/{p-5bc707cf.entry.js → p-b1536972.entry.js} +23 -23
- package/dist/mint-components/{p-b871d158.js → p-b8e46769.js} +1 -1
- package/dist/mint-components/{p-1f387c7b.system.js → p-bfb00685.system.js} +1 -1
- package/dist/mint-components/{p-7628e56f.system.js → p-c05a4b0c.system.js} +1 -1
- package/dist/mint-components/{p-9a15cd5a.system.entry.js → p-c51ea96f.system.entry.js} +1 -1
- package/dist/mint-components/p-d463fa82.system.js +1 -0
- package/dist/mint-components/p-d47d0862.entry.js +1 -0
- package/dist/mint-components/{p-abd717d4.js → p-db45be67.js} +1 -1
- package/dist/mint-components/{p-86d20b47.system.entry.js → p-dc196a22.system.entry.js} +1 -1
- package/dist/mint-components/{p-432a44de.entry.js → p-e2fb11af.entry.js} +2 -2
- package/dist/mint-components/{p-24a867ab.system.js → p-e7f45f18.system.js} +1 -1
- package/dist/mint-components/{p-d08408b3.entry.js → p-e87d9982.entry.js} +1 -1
- package/dist/mint-components/{p-33ca28ba.system.entry.js → p-ee685659.system.entry.js} +1 -1
- package/dist/mint-components/p-ee91aeac.system.js +1 -0
- package/dist/mint-components/{p-025ddad2.system.entry.js → p-f194f4e5.system.entry.js} +1 -1
- package/dist/mint-components/p-f7218609.system.entry.js +1 -0
- package/dist/mint-components/p-fa477f5f.system.entry.js +1 -0
- package/dist/mint-components/p-fd231c49.system.js +1 -0
- package/dist/types/components/tax-and-cash/phoneExtensions.d.ts +12 -0
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +2 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +2 -0
- package/dist/types/components/tax-and-cash/utils.d.ts +8 -2
- package/docs/docs.docx +0 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +4 -2
- package/dist/cjs/subregions-984e30d7.js +0 -1505
- package/dist/esm/subregions-7c9778d0.js +0 -1492
- package/dist/esm-es5/sqm-user-info-form-view-5322525c.js +0 -1
- package/dist/esm-es5/subregions-7c9778d0.js +0 -1
- package/dist/esm-es5/usePortalRegistrationForm-3a1f36a2.js +0 -1
- package/dist/mint-components/p-335a5736.entry.js +0 -1
- package/dist/mint-components/p-3a41b39c.js +0 -13
- package/dist/mint-components/p-5623f1e0.js +0 -1
- package/dist/mint-components/p-5fdf0286.system.js +0 -1
- package/dist/mint-components/p-6eebbc59.entry.js +0 -83
- package/dist/mint-components/p-7f29622d.js +0 -1
- package/dist/mint-components/p-8a08cec6.system.entry.js +0 -1
- package/dist/mint-components/p-90200f08.system.entry.js +0 -1
- package/dist/mint-components/p-a8cfa8fd.entry.js +0 -9
- package/dist/mint-components/p-ae2f610e.system.js +0 -1
- package/dist/mint-components/p-b7188d47.system.entry.js +0 -1
- package/dist/mint-components/p-b9509a55.system.entry.js +0 -1
- package/dist/mint-components/p-bd03efe0.system.js +0 -1
- package/dist/mint-components/p-c13c20b2.system.js +0 -1
- package/dist/mint-components/p-c41d536d.entry.js +0 -1
- package/dist/mint-components/p-db6bf7cf.system.entry.js +0 -1
package/dist/collection/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.js
CHANGED
|
@@ -11,6 +11,11 @@ const mockCountries = [
|
|
|
11
11
|
{ countryCode: "DE", displayName: "Germany" },
|
|
12
12
|
{ countryCode: "FR", displayName: "France" },
|
|
13
13
|
{ countryCode: "ES", displayName: "Spain" },
|
|
14
|
+
// Show handling of long country names
|
|
15
|
+
{
|
|
16
|
+
countryCode: "CD",
|
|
17
|
+
displayName: "Congo, The Democratic Republic of the Congo",
|
|
18
|
+
},
|
|
14
19
|
];
|
|
15
20
|
const mockCurrencies = [
|
|
16
21
|
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
@@ -101,6 +106,8 @@ const baseProps = {
|
|
|
101
106
|
loading: false,
|
|
102
107
|
isPartner: false,
|
|
103
108
|
isUser: false,
|
|
109
|
+
isPartnerLegacy: false,
|
|
110
|
+
isUserLegacy: false,
|
|
104
111
|
formState: {
|
|
105
112
|
firstName: "",
|
|
106
113
|
lastName: "",
|
|
@@ -213,6 +220,7 @@ export const PartnerAccount = () => {
|
|
|
213
220
|
return (h(UserInfoFormView, Object.assign({}, baseProps, { states: {
|
|
214
221
|
...baseProps.states,
|
|
215
222
|
isPartner: true,
|
|
223
|
+
isPartnerLegacy: true,
|
|
216
224
|
formState: {
|
|
217
225
|
...baseProps.states.formState,
|
|
218
226
|
firstName: "Jane",
|
|
@@ -232,10 +240,53 @@ export const PartnerAccount = () => {
|
|
|
232
240
|
partnerData: mockPartnerData,
|
|
233
241
|
} })));
|
|
234
242
|
};
|
|
243
|
+
// Early partner created via <sqm-partner-info-modal>: connectionStatus is "STARTED",
|
|
244
|
+
// publisher has only countryCode + currency populated. Banner must NOT show; only
|
|
245
|
+
// country + currency disabled; firstName/lastName disabled via userData; everything
|
|
246
|
+
// else (phone, address, city, state, postalCode) stays editable.
|
|
247
|
+
export const EarlyPartnerFromModal = () => {
|
|
248
|
+
return (h(UserInfoFormView, Object.assign({}, baseProps, { states: {
|
|
249
|
+
...baseProps.states,
|
|
250
|
+
isPartner: true,
|
|
251
|
+
isUser: true,
|
|
252
|
+
isPartnerLegacy: false,
|
|
253
|
+
isUserLegacy: false,
|
|
254
|
+
formState: {
|
|
255
|
+
...baseProps.states.formState,
|
|
256
|
+
firstName: "Jane",
|
|
257
|
+
lastName: "Smith",
|
|
258
|
+
email: "jane.smith@example.com",
|
|
259
|
+
countryCode: "US",
|
|
260
|
+
currency: "USD",
|
|
261
|
+
phoneNumberCountryCode: undefined,
|
|
262
|
+
phoneNumber: undefined,
|
|
263
|
+
address: undefined,
|
|
264
|
+
city: undefined,
|
|
265
|
+
state: undefined,
|
|
266
|
+
postalCode: undefined,
|
|
267
|
+
},
|
|
268
|
+
}, data: {
|
|
269
|
+
...baseProps.data,
|
|
270
|
+
partnerData: {
|
|
271
|
+
...mockPartnerData,
|
|
272
|
+
billingAddress: undefined,
|
|
273
|
+
billingCity: undefined,
|
|
274
|
+
billingState: undefined,
|
|
275
|
+
billingPostalCode: undefined,
|
|
276
|
+
phoneNumber: undefined,
|
|
277
|
+
phoneNumberCountryCode: undefined,
|
|
278
|
+
},
|
|
279
|
+
userData: {
|
|
280
|
+
firstName: "Jane",
|
|
281
|
+
lastName: "Smith",
|
|
282
|
+
},
|
|
283
|
+
} })));
|
|
284
|
+
};
|
|
235
285
|
export const UserAccount = () => {
|
|
236
286
|
return (h(UserInfoFormView, Object.assign({}, baseProps, { states: {
|
|
237
287
|
...baseProps.states,
|
|
238
288
|
isUser: true,
|
|
289
|
+
isUserLegacy: true,
|
|
239
290
|
formState: {
|
|
240
291
|
...baseProps.states.formState,
|
|
241
292
|
firstName: "Bob",
|
|
@@ -254,6 +305,7 @@ export const UserAccountMissingLastName = () => {
|
|
|
254
305
|
return (h(UserInfoFormView, Object.assign({}, baseProps, { states: {
|
|
255
306
|
...baseProps.states,
|
|
256
307
|
isUser: true,
|
|
308
|
+
isUserLegacy: true,
|
|
257
309
|
formState: {
|
|
258
310
|
...baseProps.states.formState,
|
|
259
311
|
firstName: "Bob",
|
|
@@ -105,7 +105,7 @@ export const OtherRegionSlotView = (props) => {
|
|
|
105
105
|
helpText: formatErrorMessage(text.subRegion, text.error.fieldRequiredError),
|
|
106
106
|
}), { id: "subRegion", name: "/subRegion" }), props.data.esRegions.map((r) => (h("sl-menu-item", { value: r.regionCode }, r.displayName)))),
|
|
107
107
|
h(IndirectTaxNumberInput, { name: "indirectTaxNumber", label: getTaxFieldLabel("VAT"), error: getTaxFieldError("VAT") }),
|
|
108
|
-
h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", checked: formState.hasSubRegionTaxNumber, "onSl-change": callbacks.onSpainToggle, disabled: states.disabled
|
|
108
|
+
h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", checked: formState.hasSubRegionTaxNumber, "onSl-change": callbacks.onSpainToggle, disabled: states.disabled }, text.isRegisteredSubRegionIncomeTax),
|
|
109
109
|
formState.hasSubRegionTaxNumber && (h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, label: text.subRegionTaxNumberLabel, disabled: states.loading || states.disabled, value: formState.subRegionTaxNumber }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.subRegionTaxNumber) && {
|
|
110
110
|
class: classes.ErrorInput,
|
|
111
111
|
helpText: formatErrorMessage(text.subRegionTaxNumberLabel, text.error.fieldRequiredError),
|
|
@@ -123,7 +123,7 @@ export const OtherRegionSlotView = (props) => {
|
|
|
123
123
|
currentTaxType === "GST" && (h(IndirectTaxNumberInput, { label: getTaxFieldLabel("GST"), error: getTaxFieldError("GST"), name: "indirectTaxNumber" })),
|
|
124
124
|
currentTaxType === "HST" && (h(IndirectTaxNumberInput, { label: getTaxFieldLabel("HST"), error: getTaxFieldError("HST"), name: "indirectTaxNumber" })),
|
|
125
125
|
formState.province === "QUEBEC" && (h("div", { class: classes.ConditionalInputsContainer },
|
|
126
|
-
h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", "onSl-change": callbacks.onQstToggle, checked: formState.hasQst, disabled: states.
|
|
126
|
+
h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", "onSl-change": callbacks.onQstToggle, checked: formState.hasQst, disabled: states.disabled }, text.isRegisteredQST),
|
|
127
127
|
formState.hasQst && (h(IndirectTaxNumberInput, { name: "qstNumber", label: text.qstNumber, error: formatErrorMessage(text.qstNumber, text.error.fieldRequiredError) }))))));
|
|
128
128
|
};
|
|
129
129
|
const getActiveForm = (selectedRegion) => {
|
package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { AsYouType } from "libphonenumber-js";
|
|
2
3
|
import { intl } from "../../../global/global";
|
|
3
4
|
import { createStyleSheet } from "../../../styling/JSS";
|
|
4
5
|
import { FORM_STEPS } from "../data";
|
|
@@ -107,10 +108,6 @@ const vanillaStyle = `
|
|
|
107
108
|
flex-direction: column;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
sl-select#phoneNumberCountryCode::part(menu) {
|
|
111
|
-
min-width: 250px;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
111
|
sl-button[type="primary"]::part(base){
|
|
115
112
|
background-color: var(--sqm-primary-button-background);
|
|
116
113
|
color: var(--sqm-primary-button-color);
|
|
@@ -204,6 +201,7 @@ const vanillaStyle = `
|
|
|
204
201
|
background: var(--sqm-input-background, inherit);
|
|
205
202
|
color: var(--sqm-input-color, inherit);
|
|
206
203
|
border:none;
|
|
204
|
+
width: max-content;
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
sl-menu-item::part(base) {
|
|
@@ -336,6 +334,14 @@ export const UserInfoFormView = (props) => {
|
|
|
336
334
|
}, {
|
|
337
335
|
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
338
336
|
})))),
|
|
337
|
+
(states.isPartnerLegacy || states.isUserLegacy) && (h("sqm-form-message", { loading: states.loading, type: "info" },
|
|
338
|
+
h("p", { part: "alert-title" }, text.isPartnerAlertHeader),
|
|
339
|
+
h("p", { part: "alert-description" }, intl.formatMessage({
|
|
340
|
+
id: "isPartnerAlertDescription",
|
|
341
|
+
defaultMessage: text.isPartnerAlertDescription,
|
|
342
|
+
}, {
|
|
343
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
344
|
+
})))),
|
|
339
345
|
h("div", null,
|
|
340
346
|
h("div", { class: classes.InputContainer },
|
|
341
347
|
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || isDisabledUserInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
@@ -388,7 +394,14 @@ export const UserInfoFormView = (props) => {
|
|
|
388
394
|
h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
389
395
|
_b.dial_code));
|
|
390
396
|
})),
|
|
391
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber
|
|
397
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber !== null
|
|
398
|
+
? formState.phoneNumber
|
|
399
|
+
: "", "onSl-input": (e) => {
|
|
400
|
+
var _a;
|
|
401
|
+
const target = e.target;
|
|
402
|
+
const country = (((_a = refs.phoneCountryRef.current) === null || _a === void 0 ? void 0 : _a.value) || "US");
|
|
403
|
+
target.value = new AsYouType(country).input(target.value);
|
|
404
|
+
}, validationError: ({ control, value, formData }) => {
|
|
392
405
|
// skip validation for values the user can't edit
|
|
393
406
|
if (control === null || control === void 0 ? void 0 : control.disabled)
|
|
394
407
|
return undefined;
|
|
@@ -864,7 +864,7 @@ export class TaxForm {
|
|
|
864
864
|
"mutable": false,
|
|
865
865
|
"complexType": {
|
|
866
866
|
"original": "DemoData<UseUserInfoFormResult>",
|
|
867
|
-
"resolved": "{ states?: { step: string; hideState: boolean; hideSteps: boolean; disabled: boolean; loadingError: boolean; loading: boolean; isPartner: boolean; isUser: boolean; formState: { errors: {}; firstName: string; lastName: string; email: string; phoneNumberCountryCode: string; phoneNumber: string; countryCode: string; currency: string; address: string; city: string; state: string; postalCode: string; }; }; refs?: { formRef: Ref<HTMLFormElement>; currencyRef: Ref<HTMLSelectElement>; phoneCountryRef: Ref<HTMLSelectElement>; }; data?: { currencies: { displayName: string; currencyCode: string; }[]; countries: TaxCountry[]; phoneCountries: TaxCountry[]; allCurrencies: { displayName: string; currencyCode: string; }[]; allCountries: TaxCountry[]; regionLabelEnum: \"STATE\" | \"PROVINCE\" | \"REGION\"; regions: { label: string; value: string; }[]; partnerData: ImpactPublisher; userData: ImpactUser; }; setStep?: (value: string) => void; onSubmit?: (event: any) => Promise<void>; }",
|
|
867
|
+
"resolved": "{ states?: { step: string; hideState: boolean; hideSteps: boolean; disabled: boolean; loadingError: boolean; loading: boolean; isPartner: boolean; isUser: boolean; isUserLegacy: boolean; isPartnerLegacy: boolean; formState: { errors: {}; firstName: string; lastName: string; email: string; phoneNumberCountryCode: string; phoneNumber: string; countryCode: string; currency: string; address: string; city: string; state: string; postalCode: string; }; }; refs?: { formRef: Ref<HTMLFormElement>; currencyRef: Ref<HTMLSelectElement>; phoneCountryRef: Ref<HTMLSelectElement>; }; data?: { currencies: { displayName: string; currencyCode: string; }[]; countries: TaxCountry[]; phoneCountries: TaxCountry[]; allCurrencies: { displayName: string; currencyCode: string; }[]; allCountries: TaxCountry[]; regionLabelEnum: \"STATE\" | \"PROVINCE\" | \"REGION\"; regions: { label: string; value: string; }[]; partnerData: ImpactPublisher; userData: ImpactUser; }; setStep?: (value: string) => void; onSubmit?: (event: any) => Promise<void>; }",
|
|
868
868
|
"references": {
|
|
869
869
|
"DemoData": {
|
|
870
870
|
"location": "import",
|
|
@@ -927,6 +927,8 @@ function useDemoUserInfoForm(props) {
|
|
|
927
927
|
loading: false,
|
|
928
928
|
isPartner: false,
|
|
929
929
|
isUser: false,
|
|
930
|
+
isPartnerLegacy: false,
|
|
931
|
+
isUserLegacy: false,
|
|
930
932
|
loadingError: false,
|
|
931
933
|
formState: {
|
|
932
934
|
errors: {
|
|
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useRef, useState, } from "@saasquatch/universal-hoo
|
|
|
3
3
|
import jsonpointer from "jsonpointer";
|
|
4
4
|
import { CURRENCIES_NAMESPACE, SORTED_COUNTRIES_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../data";
|
|
5
5
|
import { ADDRESS_REGIONS } from "../subregions";
|
|
6
|
-
import { objectIsFull, validTaxDocument } from "../utils";
|
|
6
|
+
import { objectIsFull, toDomesticNumber, validTaxDocument } from "../utils";
|
|
7
7
|
import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
|
|
8
8
|
import { CONNECT_PARTNER, COMPLETE_PARTNER, } from "../sqm-indirect-tax-form/useIndirectTaxForm";
|
|
9
9
|
import { gql } from "graphql-request";
|
|
@@ -16,7 +16,7 @@ const GET_INDIRECT_TAX_COUNTRY_CODE = gql `
|
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
18
|
export function useUserInfoForm(props) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
20
20
|
const currencyRef = useRef(undefined);
|
|
21
21
|
const phoneCountryRef = useRef(undefined);
|
|
22
22
|
const formRef = useRef(null);
|
|
@@ -122,7 +122,9 @@ export function useUserInfoForm(props) {
|
|
|
122
122
|
setFilteredPhoneCountries(countries || []);
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
|
-
setFilteredPhoneCountries(countries.filter((c) => c.displayName
|
|
125
|
+
setFilteredPhoneCountries(countries.filter((c) => c.displayName
|
|
126
|
+
.toLowerCase()
|
|
127
|
+
.includes(phoneCountrySearch.toLowerCase())) || []);
|
|
126
128
|
}
|
|
127
129
|
}, [phoneCountrySearch, countries]);
|
|
128
130
|
useEffect(() => {
|
|
@@ -136,7 +138,7 @@ export function useUserInfoForm(props) {
|
|
|
136
138
|
}
|
|
137
139
|
}, [currencySearch, currencies]);
|
|
138
140
|
async function connectPartner(formData) {
|
|
139
|
-
var _a, _b, _c, _d;
|
|
141
|
+
var _a, _b, _c, _d, _e, _f;
|
|
140
142
|
const vars = {
|
|
141
143
|
user: {
|
|
142
144
|
id: user.id,
|
|
@@ -150,39 +152,34 @@ export function useUserInfoForm(props) {
|
|
|
150
152
|
city: formData.city,
|
|
151
153
|
state: formData.state,
|
|
152
154
|
postalCode: formData.postalCode,
|
|
153
|
-
phoneNumber: formData.phoneNumber,
|
|
155
|
+
phoneNumber: toDomesticNumber(formData.phoneNumberCountryCode, formData.phoneNumber),
|
|
154
156
|
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
155
157
|
};
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
+
// if user went through early partner creation, connectionStatus === "STARTED"
|
|
159
|
+
// otherwise trigger legacy partner creation
|
|
158
160
|
const userData = data === null || data === void 0 ? void 0 : data.user;
|
|
159
161
|
let result = null;
|
|
160
162
|
let connectionResult;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// });
|
|
175
|
-
// connectionResult = (result as ConnectPartnerResult)
|
|
176
|
-
// ?.createImpactConnection;
|
|
177
|
-
// }
|
|
178
|
-
if (!result || ((_b = result) === null || _b === void 0 ? void 0 : _b.message))
|
|
163
|
+
if (((_a = userData === null || userData === void 0 ? void 0 : userData.impactConnection) === null || _a === void 0 ? void 0 : _a.connectionStatus) === "STARTED") {
|
|
164
|
+
result = await completeImpactPartner({
|
|
165
|
+
vars,
|
|
166
|
+
});
|
|
167
|
+
connectionResult = (_b = result) === null || _b === void 0 ? void 0 : _b.completeImpactConnection;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
result = await connectImpactPartner({
|
|
171
|
+
vars,
|
|
172
|
+
});
|
|
173
|
+
connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.createImpactConnection;
|
|
174
|
+
}
|
|
175
|
+
if (!result || ((_d = result) === null || _d === void 0 ? void 0 : _d.message))
|
|
179
176
|
throw new Error();
|
|
180
177
|
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
|
|
181
178
|
console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
|
|
182
179
|
throw new Error();
|
|
183
180
|
}
|
|
184
181
|
await refetch();
|
|
185
|
-
const resultPublisher = (
|
|
182
|
+
const resultPublisher = (_f = (_e = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher;
|
|
186
183
|
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
187
184
|
// Fire form change event
|
|
188
185
|
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
@@ -220,12 +217,13 @@ export function useUserInfoForm(props) {
|
|
|
220
217
|
return;
|
|
221
218
|
}
|
|
222
219
|
const { allowBankingCollection, ...userData } = formData;
|
|
220
|
+
const normalizedPhoneNumber = toDomesticNumber(userData.phoneNumberCountryCode, userData.phoneNumber);
|
|
223
221
|
setUserFormContext({
|
|
224
222
|
...userFormContext,
|
|
225
223
|
firstName: userData.firstName,
|
|
226
224
|
lastName: userData.lastName,
|
|
227
225
|
phoneNumberCountryCode: userData.phoneNumberCountryCode,
|
|
228
|
-
phoneNumber:
|
|
226
|
+
phoneNumber: normalizedPhoneNumber,
|
|
229
227
|
countryCode: userData.countryCode,
|
|
230
228
|
address: userData.address,
|
|
231
229
|
city: userData.city,
|
|
@@ -236,7 +234,10 @@ export function useUserInfoForm(props) {
|
|
|
236
234
|
const skipNextStep = getSkipNextStep(userData);
|
|
237
235
|
if (skipNextStep) {
|
|
238
236
|
try {
|
|
239
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(
|
|
237
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner({
|
|
238
|
+
...formData,
|
|
239
|
+
phoneNumber: normalizedPhoneNumber,
|
|
240
|
+
});
|
|
240
241
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
241
242
|
!hasValidCurrentDocument) {
|
|
242
243
|
// Go to docusign form
|
|
@@ -312,6 +313,11 @@ export function useUserInfoForm(props) {
|
|
|
312
313
|
loading: loading || connectLoading || completeLoading,
|
|
313
314
|
isPartner: !!((_g = (_f = data === null || data === void 0 ? void 0 : data.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher),
|
|
314
315
|
isUser: !!((_j = (_h = data === null || data === void 0 ? void 0 : data.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.user),
|
|
316
|
+
// Show banner when pre-existing partner is created with legacy mutation createImpactConnection
|
|
317
|
+
isUserLegacy: !!((_l = (_k = data === null || data === void 0 ? void 0 : data.user) === null || _k === void 0 ? void 0 : _k.impactConnection) === null || _l === void 0 ? void 0 : _l.user) &&
|
|
318
|
+
((_o = (_m = data === null || data === void 0 ? void 0 : data.user) === null || _m === void 0 ? void 0 : _m.impactConnection) === null || _o === void 0 ? void 0 : _o.connectionStatus) !== "STARTED",
|
|
319
|
+
isPartnerLegacy: !!((_q = (_p = data === null || data === void 0 ? void 0 : data.user) === null || _p === void 0 ? void 0 : _p.impactConnection) === null || _q === void 0 ? void 0 : _q.publisher) &&
|
|
320
|
+
((_s = (_r = data === null || data === void 0 ? void 0 : data.user) === null || _r === void 0 ? void 0 : _r.impactConnection) === null || _s === void 0 ? void 0 : _s.connectionStatus) !== "STARTED",
|
|
315
321
|
formState: {
|
|
316
322
|
...userFormContext,
|
|
317
323
|
errors: formErrors,
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
+
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
1
2
|
import { intl } from "../../global/global";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Normalize user input to the domestic form Impact stores: digits only,
|
|
5
|
+
* with the country dial code and trunk-zero prefix removed.
|
|
6
|
+
*/
|
|
7
|
+
export function toDomesticNumber(phoneCountryCode, input) {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!input)
|
|
10
|
+
return "";
|
|
11
|
+
const parsed = parsePhoneNumberFromString(input, phoneCountryCode === null || phoneCountryCode === void 0 ? void 0 : phoneCountryCode.toUpperCase());
|
|
12
|
+
return (_a = parsed === null || parsed === void 0 ? void 0 : parsed.nationalNumber) !== null && _a !== void 0 ? _a : input.replace(/\D/g, "");
|
|
5
13
|
}
|
|
6
14
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
15
|
+
* Validates a phone number against both libphonenumber-js's per-country
|
|
16
|
+
* pattern rules AND Impact's I18nPhoneNumber length rules, applied to the
|
|
17
|
+
* sanitized value we'll submit.
|
|
9
18
|
*/
|
|
10
19
|
export function isValidI18nPhoneNumber(phoneCountryCode, phoneNumber) {
|
|
11
|
-
var _a, _b;
|
|
12
20
|
if (!phoneCountryCode || !(phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.trim()))
|
|
13
21
|
return false;
|
|
14
22
|
const country = phoneCountryCode.toUpperCase();
|
|
15
|
-
const
|
|
23
|
+
const parsed = parsePhoneNumberFromString(phoneNumber, country);
|
|
24
|
+
if (!(parsed === null || parsed === void 0 ? void 0 : parsed.isValid()))
|
|
25
|
+
return false;
|
|
26
|
+
return passesImpactBackendLengthCheck(country, toDomesticNumber(country, phoneNumber));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Mirrors estalea.bucket.phone.I18nPhoneNumber.isValidI18nPhoneNumber()
|
|
30
|
+
* length rules on the already-sanitized (digits-only) submission value.
|
|
31
|
+
*/
|
|
32
|
+
function passesImpactBackendLengthCheck(country, digits) {
|
|
33
|
+
if (!digits)
|
|
34
|
+
return false;
|
|
16
35
|
switch (country) {
|
|
17
36
|
case "US":
|
|
18
37
|
case "CA": {
|
|
19
|
-
// strip a single leading "1", then exactly 10 digits
|
|
20
38
|
const n = digits.startsWith("1") ? digits.slice(1) : digits;
|
|
21
39
|
return n.length === 10;
|
|
22
40
|
}
|
|
23
41
|
case "AU":
|
|
24
|
-
// 9 or 10 digits
|
|
25
42
|
return digits.length === 9 || digits.length === 10;
|
|
26
43
|
case "NZ": {
|
|
27
|
-
// trim "640" country prefix or leading "0" (only when >9 digits),
|
|
28
|
-
// then 8–10 digits
|
|
29
44
|
let n = digits;
|
|
30
45
|
if (n.length > 9) {
|
|
31
46
|
if (n.startsWith("640"))
|
|
@@ -35,25 +50,13 @@ export function isValidI18nPhoneNumber(phoneCountryCode, phoneNumber) {
|
|
|
35
50
|
}
|
|
36
51
|
return n.length >= 8 && n.length <= 10;
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
// >= 6 digits after stripping a single leading "0", no dialing-code check
|
|
53
|
+
default:
|
|
40
54
|
return stripLeadingZero(digits).length >= 6;
|
|
41
|
-
default: {
|
|
42
|
-
// All other countries: strip a single leading "0", then >= 6 digits
|
|
43
|
-
if (stripLeadingZero(digits).length < 6)
|
|
44
|
-
return false;
|
|
45
|
-
// If input starts with "+", the dialing code (first whitespace-split
|
|
46
|
-
// token) must match the selected country exactly. Splits on first
|
|
47
|
-
// whitespace, so "+4420 7946 0958" supplies "4420" (not "44") and fails.
|
|
48
|
-
if (phoneNumber.trim().startsWith("+")) {
|
|
49
|
-
const supplied = phoneNumber.trim().split(/\s/)[0].slice(1);
|
|
50
|
-
const expected = (_b = (_a = PHONE_EXTENSIONS[country]) === null || _a === void 0 ? void 0 : _a.dial_code) === null || _b === void 0 ? void 0 : _b.replace(/^\+/, "");
|
|
51
|
-
return expected === supplied;
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
function stripLeadingZero(digits) {
|
|
58
|
+
return digits.startsWith("0") ? digits.slice(1) : digits;
|
|
59
|
+
}
|
|
57
60
|
export function validTaxDocument(requiredType) {
|
|
58
61
|
const validTypes = ["W9", "W8BENE", "W8BEN"];
|
|
59
62
|
if (validTypes.includes(requiredType))
|
|
@@ -640,7 +640,7 @@ html {
|
|
|
640
640
|
--sqm-input-border-color-focus: ${((_68 = config === null || config === void 0 ? void 0 : config.formFields) === null || _68 === void 0 ? void 0 : _68.selectedStateColor) || "hsl(0, 0%, 7%)"};
|
|
641
641
|
--sqm-input-border-color-hover: ${((_69 = config === null || config === void 0 ? void 0 : config.formFields) === null || _69 === void 0 ? void 0 : _69.hoverStateColor) || "hsl(0, 0%, 91%)"};
|
|
642
642
|
|
|
643
|
-
--sqm-input-label-font-size:
|
|
643
|
+
--sqm-input-label-font-size: var(--sl-input-label-font-size-small);
|
|
644
644
|
--sqm-input-disabled-color: var(--sqm-text-subdued);
|
|
645
645
|
--sqm-input-disabled-background: ${((_70 = config === null || config === void 0 ? void 0 : config.formFields) === null || _70 === void 0 ? void 0 : _70.disabledBackgroundColor) || "#F4F4F5"};
|
|
646
646
|
|
|
@@ -836,7 +836,6 @@ sl-button[type="primary"]::part(base):hover{
|
|
|
836
836
|
color: var(--sqm-primary-button-color-hover);
|
|
837
837
|
}
|
|
838
838
|
|
|
839
|
-
|
|
840
839
|
*::part(primarybutton-base):focus,
|
|
841
840
|
sl-button[type="primary"]::part(base):focus {
|
|
842
841
|
box-shadow: none;
|
|
@@ -861,10 +860,15 @@ sl-button[type="secondary"]::part(base):hover {
|
|
|
861
860
|
*::part(input-label), *::part(select-label), *::part(textarea-label){
|
|
862
861
|
font-family: var(--sqm-primary-font);
|
|
863
862
|
font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
|
|
864
|
-
font-weight: var(--sl-font-weight-
|
|
863
|
+
font-weight: var(--sl-font-weight-bold);
|
|
865
864
|
color: var(--sqm-input-label-color, var(--sqm-text), black);
|
|
866
865
|
}
|
|
867
866
|
|
|
867
|
+
sl-input::part(label) {
|
|
868
|
+
font-weight: var(--sl-font-weight-bold);
|
|
869
|
+
font-size: var(--sl-input-font-size-small);
|
|
870
|
+
}
|
|
871
|
+
|
|
868
872
|
*::part(input-base), *::part(select-base), *::part(textarea-base){
|
|
869
873
|
font-family: var(--sqm-primary-font);
|
|
870
874
|
background-color: var(--sqm-input-background, #fff);
|
|
@@ -745,7 +745,7 @@ html {
|
|
|
745
745
|
config?.formFields?.hoverStateColor || "hsl(0, 0%, 91%)"
|
|
746
746
|
};
|
|
747
747
|
|
|
748
|
-
--sqm-input-label-font-size:
|
|
748
|
+
--sqm-input-label-font-size: var(--sl-input-label-font-size-small);
|
|
749
749
|
--sqm-input-disabled-color: var(--sqm-text-subdued);
|
|
750
750
|
--sqm-input-disabled-background: ${
|
|
751
751
|
config?.formFields?.disabledBackgroundColor || "#F4F4F5"
|
|
@@ -943,7 +943,6 @@ sl-button[type="primary"]::part(base):hover{
|
|
|
943
943
|
color: var(--sqm-primary-button-color-hover);
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
-
|
|
947
946
|
*::part(primarybutton-base):focus,
|
|
948
947
|
sl-button[type="primary"]::part(base):focus {
|
|
949
948
|
box-shadow: none;
|
|
@@ -968,10 +967,15 @@ sl-button[type="secondary"]::part(base):hover {
|
|
|
968
967
|
*::part(input-label), *::part(select-label), *::part(textarea-label){
|
|
969
968
|
font-family: var(--sqm-primary-font);
|
|
970
969
|
font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
|
|
971
|
-
font-weight: var(--sl-font-weight-
|
|
970
|
+
font-weight: var(--sl-font-weight-bold);
|
|
972
971
|
color: var(--sqm-input-label-color, var(--sqm-text), black);
|
|
973
972
|
}
|
|
974
973
|
|
|
974
|
+
sl-input::part(label) {
|
|
975
|
+
font-weight: var(--sl-font-weight-bold);
|
|
976
|
+
font-size: var(--sl-input-font-size-small);
|
|
977
|
+
}
|
|
978
|
+
|
|
975
979
|
*::part(input-base), *::part(select-base), *::part(textarea-base){
|
|
976
980
|
font-family: var(--sqm-primary-font);
|
|
977
981
|
background-color: var(--sqm-input-background, #fff);
|