@saasquatch/mint-components 1.15.4-0 → 1.15.4-1
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_17.cjs.entry.js +17 -35
- package/dist/cjs/{sqm-base-registration-form-view-8029d30e.js → sqm-base-registration-form-view-66f99821.js} +9 -4
- package/dist/cjs/{sqm-invoice-table-view-3f60fba9.js → sqm-invoice-table-view-5c74607f.js} +0 -1
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +29 -19
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +4 -4
- package/dist/collection/components/sqm-base-registration/BaseRegistrationForm.stories.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +9 -4
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +1 -1
- package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +1 -1
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +2 -2
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +7 -5
- package/dist/collection/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.js +23 -15
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +12 -23
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +4 -18
- package/dist/esm/sqm-banking-info-form_17.entry.js +17 -35
- package/dist/esm/{sqm-base-registration-form-view-dafba287.js → sqm-base-registration-form-view-d81e316a.js} +9 -4
- package/dist/esm/{sqm-invoice-table-view-01453fa3.js → sqm-invoice-table-view-3491dd80.js} +0 -1
- package/dist/esm/sqm-portal-google-registration-form.entry.js +29 -19
- package/dist/esm/sqm-stencilbook.entry.js +4 -4
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-d81e316a.js +1 -0
- package/dist/esm-es5/sqm-invoice-table-view-3491dd80.js +1 -0
- package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
- 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-4a731079.entry.js → p-268fad47.entry.js} +2 -2
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-6f6cd994.entry.js → p-3d73cd84.entry.js} +2 -2
- package/dist/mint-components/p-49932f12.system.js +1 -0
- package/dist/mint-components/p-7176a952.entry.js +1 -0
- package/dist/mint-components/p-8d0393d9.system.entry.js +1 -0
- package/dist/mint-components/p-9308221f.js +1 -0
- package/dist/mint-components/p-bc021969.system.js +1 -0
- package/dist/mint-components/{p-02832118.system.entry.js → p-e5186714.system.entry.js} +1 -1
- package/dist/mint-components/{p-2ba713d6.system.entry.js → p-e64e8354.system.entry.js} +1 -1
- package/dist/mint-components/p-e8e48982.js +1 -0
- package/dist/types/components/sqm-base-registration/sqm-base-registration-form-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -1
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -1
- package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +1 -1
- package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +1 -1
- package/dist/types/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.d.ts +2 -1
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -2
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +0 -1
- package/dist/types/components.d.ts +0 -13
- package/dist/types/global/android.d.ts +7 -0
- package/dist/types/global/demo.d.ts +2 -0
- package/dist/types/stories/features.d.ts +4 -0
- package/dist/types/stories/templates.d.ts +4 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-dafba287.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-01453fa3.js +0 -1
- package/dist/mint-components/p-2651ef99.system.js +0 -1
- package/dist/mint-components/p-35701119.js +0 -1
- package/dist/mint-components/p-59fe6066.js +0 -1
- package/dist/mint-components/p-86a5db85.system.js +0 -1
- package/dist/mint-components/p-9c4f4cd6.entry.js +0 -1
- package/dist/mint-components/p-a3647f70.system.entry.js +0 -1
package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js
CHANGED
|
@@ -154,12 +154,6 @@ export const UserInfoFormView = (props) => {
|
|
|
154
154
|
default:
|
|
155
155
|
regionLabel = text.state;
|
|
156
156
|
}
|
|
157
|
-
function isDisabledInput(field) {
|
|
158
|
-
var _a;
|
|
159
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
160
|
-
return true;
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
157
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
164
158
|
h("style", { type: "text/css" },
|
|
165
159
|
styleString,
|
|
@@ -207,22 +201,18 @@ export const UserInfoFormView = (props) => {
|
|
|
207
201
|
}))),
|
|
208
202
|
h("div", null,
|
|
209
203
|
h("div", { class: classes.InputContainer },
|
|
210
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
211
|
-
states.isUser ||
|
|
212
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
204
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
213
205
|
class: classes.ErrorInput,
|
|
214
206
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
215
207
|
}
|
|
216
208
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
217
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
218
|
-
states.isUser ||
|
|
219
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
209
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
220
210
|
class: classes.ErrorInput,
|
|
221
211
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
222
212
|
}
|
|
223
213
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
224
214
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
225
|
-
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled ||
|
|
215
|
+
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
226
216
|
class: classes.ErrorInput,
|
|
227
217
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
228
218
|
}
|
|
@@ -238,8 +228,7 @@ export const UserInfoFormView = (props) => {
|
|
|
238
228
|
h("div", { class: classes.PhoneInputsSection },
|
|
239
229
|
h("p", null, text.phoneNumber),
|
|
240
230
|
h("div", { class: classes.PhoneInputsContainer },
|
|
241
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
242
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
231
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
243
232
|
class: classes.ErrorInput,
|
|
244
233
|
}
|
|
245
234
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -265,7 +254,7 @@ export const UserInfoFormView = (props) => {
|
|
|
265
254
|
// Naive phone number validation
|
|
266
255
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
267
256
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
268
|
-
}, disabled: states.disabled ||
|
|
257
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
269
258
|
class: classes.ErrorInput,
|
|
270
259
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
271
260
|
}
|
|
@@ -273,7 +262,7 @@ export const UserInfoFormView = (props) => {
|
|
|
273
262
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
274
263
|
// Checks for non-ASCII characters
|
|
275
264
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
276
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
265
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
277
266
|
class: classes.ErrorInput,
|
|
278
267
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
279
268
|
}
|
|
@@ -281,22 +270,22 @@ export const UserInfoFormView = (props) => {
|
|
|
281
270
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
282
271
|
// Checks for non-ASCII characters
|
|
283
272
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
284
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
273
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
285
274
|
class: classes.ErrorInput,
|
|
286
275
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
287
276
|
}
|
|
288
277
|
: {}), { required: true })),
|
|
289
|
-
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
278
|
+
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
290
279
|
class: classes.ErrorInput,
|
|
291
280
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
292
281
|
}
|
|
293
282
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
294
|
-
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled ||
|
|
283
|
+
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
295
284
|
class: classes.ErrorInput,
|
|
296
285
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
297
286
|
}
|
|
298
287
|
: {}), { required: true })),
|
|
299
|
-
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled ||
|
|
288
|
+
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
300
289
|
class: classes.ErrorInput,
|
|
301
290
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
302
291
|
}
|
|
@@ -318,7 +307,7 @@ export const UserInfoFormView = (props) => {
|
|
|
318
307
|
h("div", { class: classes.CheckboxWrapper },
|
|
319
308
|
h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
320
309
|
e.target.value = e.target.checked;
|
|
321
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
310
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
322
311
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
323
|
-
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
312
|
+
h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
324
313
|
};
|
|
@@ -892,7 +892,7 @@ export class TaxForm {
|
|
|
892
892
|
"mutable": false,
|
|
893
893
|
"complexType": {
|
|
894
894
|
"original": "DemoData<UseUserInfoFormResult>",
|
|
895
|
-
"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; }[];
|
|
895
|
+
"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; }[]; }; setStep?: (value: string) => void; onSubmit?: (event: any) => Promise<void>; }",
|
|
896
896
|
"references": {
|
|
897
897
|
"DemoData": {
|
|
898
898
|
"location": "import",
|
|
@@ -5,7 +5,7 @@ import { objectIsFull } from "../utils";
|
|
|
5
5
|
import { useParent, useParentQueryValue, useParentValue, } from "@saasquatch/component-boilerplate";
|
|
6
6
|
import { ADDRESS_REGIONS } from "../subregions";
|
|
7
7
|
export function useUserInfoForm(props) {
|
|
8
|
-
var _a, _b, _c, _d
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
9
|
const currencyRef = useRef(undefined);
|
|
10
10
|
const phoneCountryRef = useRef(undefined);
|
|
11
11
|
const formRef = useRef(null);
|
|
@@ -157,22 +157,9 @@ export function useUserInfoForm(props) {
|
|
|
157
157
|
postalCode: userData.postalCode,
|
|
158
158
|
currency: userData.currency,
|
|
159
159
|
});
|
|
160
|
-
const
|
|
161
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
160
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
162
161
|
setStep(nextStep);
|
|
163
162
|
}
|
|
164
|
-
// TODO: get from backend
|
|
165
|
-
const hasIndirectTax = false;
|
|
166
|
-
const brandCountry = "";
|
|
167
|
-
function getSkipNextStep(userData) {
|
|
168
|
-
if (userData.countryCode === "US")
|
|
169
|
-
return true;
|
|
170
|
-
if (!hasIndirectTax)
|
|
171
|
-
return true;
|
|
172
|
-
if (hasIndirectTax && userData.countryCode !== brandCountry)
|
|
173
|
-
return true;
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
163
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
177
164
|
const regionObj = hasStates
|
|
178
165
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -200,7 +187,6 @@ export function useUserInfoForm(props) {
|
|
|
200
187
|
allCountries: countries,
|
|
201
188
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
202
189
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
203
|
-
partnerData: (_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,
|
|
204
190
|
},
|
|
205
191
|
states: {
|
|
206
192
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
@@ -209,8 +195,8 @@ export function useUserInfoForm(props) {
|
|
|
209
195
|
disabled: loading,
|
|
210
196
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
211
197
|
loading: loading,
|
|
212
|
-
isPartner: !!((
|
|
213
|
-
isUser: !!((
|
|
198
|
+
isPartner: !!((_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),
|
|
199
|
+
isUser: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
|
|
214
200
|
formState: {
|
|
215
201
|
...userFormContext,
|
|
216
202
|
errors: formErrors,
|
|
@@ -14,7 +14,7 @@ import { l as luxon } from './luxon-8d51c92b.js';
|
|
|
14
14
|
import { g as generateUserError } from './useReferralTable-b3876ed6.js';
|
|
15
15
|
import { T as TextSpanView } from './sqm-text-span-view-ca32495e.js';
|
|
16
16
|
import { E as ErrorView } from './ErrorView-48e2b969.js';
|
|
17
|
-
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, 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-
|
|
17
|
+
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, 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-3491dd80.js';
|
|
18
18
|
import { e as extractProps } from './extractProps-ae1afbb3.js';
|
|
19
19
|
import { b as VERIFICATION_EVENT_KEY, V as VERIFICATION_EMAIL_NAMESPACE, S as SHOW_CODE_NAMESPACE, a as VERIFICATION_PARENT_NAMESPACE } from './keys-406491dc.js';
|
|
20
20
|
import { T as TAX_FORM_UPDATED_EVENT_KEY, a as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY } from './usePayoutStatus-b89e8c49.js';
|
|
@@ -7747,12 +7747,6 @@ const UserInfoFormView = (props) => {
|
|
|
7747
7747
|
default:
|
|
7748
7748
|
regionLabel = text.state;
|
|
7749
7749
|
}
|
|
7750
|
-
function isDisabledInput(field) {
|
|
7751
|
-
var _a;
|
|
7752
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
7753
|
-
return true;
|
|
7754
|
-
return false;
|
|
7755
|
-
}
|
|
7756
7750
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
7757
7751
|
h("style", { type: "text/css" },
|
|
7758
7752
|
styleString$6,
|
|
@@ -7800,22 +7794,18 @@ const UserInfoFormView = (props) => {
|
|
|
7800
7794
|
}))),
|
|
7801
7795
|
h("div", null,
|
|
7802
7796
|
h("div", { class: classes.InputContainer },
|
|
7803
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7804
|
-
states.isUser ||
|
|
7805
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7797
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7806
7798
|
class: classes.ErrorInput,
|
|
7807
7799
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
7808
7800
|
}
|
|
7809
7801
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
7810
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7811
|
-
states.isUser ||
|
|
7812
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7802
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7813
7803
|
class: classes.ErrorInput,
|
|
7814
7804
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
7815
7805
|
}
|
|
7816
7806
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
7817
7807
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
7818
|
-
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled ||
|
|
7808
|
+
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
7819
7809
|
class: classes.ErrorInput,
|
|
7820
7810
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
7821
7811
|
}
|
|
@@ -7831,8 +7821,7 @@ const UserInfoFormView = (props) => {
|
|
|
7831
7821
|
h("div", { class: classes.PhoneInputsSection },
|
|
7832
7822
|
h("p", null, text.phoneNumber),
|
|
7833
7823
|
h("div", { class: classes.PhoneInputsContainer },
|
|
7834
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7835
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7824
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7836
7825
|
class: classes.ErrorInput,
|
|
7837
7826
|
}
|
|
7838
7827
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -7858,7 +7847,7 @@ const UserInfoFormView = (props) => {
|
|
|
7858
7847
|
// Naive phone number validation
|
|
7859
7848
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
7860
7849
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
7861
|
-
}, disabled: states.disabled ||
|
|
7850
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
7862
7851
|
class: classes.ErrorInput,
|
|
7863
7852
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
7864
7853
|
}
|
|
@@ -7866,7 +7855,7 @@ const UserInfoFormView = (props) => {
|
|
|
7866
7855
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
7867
7856
|
// Checks for non-ASCII characters
|
|
7868
7857
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7869
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7858
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
7870
7859
|
class: classes.ErrorInput,
|
|
7871
7860
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
7872
7861
|
}
|
|
@@ -7874,22 +7863,22 @@ const UserInfoFormView = (props) => {
|
|
|
7874
7863
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
7875
7864
|
// Checks for non-ASCII characters
|
|
7876
7865
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7877
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7866
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
7878
7867
|
class: classes.ErrorInput,
|
|
7879
7868
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
7880
7869
|
}
|
|
7881
7870
|
: {}), { required: true })),
|
|
7882
|
-
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
7871
|
+
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
7883
7872
|
class: classes.ErrorInput,
|
|
7884
7873
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
7885
7874
|
}
|
|
7886
7875
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
7887
|
-
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled ||
|
|
7876
|
+
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
7888
7877
|
class: classes.ErrorInput,
|
|
7889
7878
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
7890
7879
|
}
|
|
7891
7880
|
: {}), { required: true })),
|
|
7892
|
-
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled ||
|
|
7881
|
+
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
7893
7882
|
class: classes.ErrorInput,
|
|
7894
7883
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
7895
7884
|
}
|
|
@@ -7911,13 +7900,13 @@ const UserInfoFormView = (props) => {
|
|
|
7911
7900
|
h("div", { class: classes.CheckboxWrapper },
|
|
7912
7901
|
h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
7913
7902
|
e.target.value = e.target.checked;
|
|
7914
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7903
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7915
7904
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
7916
|
-
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7905
|
+
h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7917
7906
|
};
|
|
7918
7907
|
|
|
7919
7908
|
function useUserInfoForm(props) {
|
|
7920
|
-
var _a, _b, _c, _d
|
|
7909
|
+
var _a, _b, _c, _d;
|
|
7921
7910
|
const currencyRef = useRef(undefined);
|
|
7922
7911
|
const phoneCountryRef = useRef(undefined);
|
|
7923
7912
|
const formRef = useRef(null);
|
|
@@ -8069,15 +8058,9 @@ function useUserInfoForm(props) {
|
|
|
8069
8058
|
postalCode: userData.postalCode,
|
|
8070
8059
|
currency: userData.currency,
|
|
8071
8060
|
});
|
|
8072
|
-
const
|
|
8073
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
8061
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
8074
8062
|
setStep(nextStep);
|
|
8075
8063
|
}
|
|
8076
|
-
function getSkipNextStep(userData) {
|
|
8077
|
-
if (userData.countryCode === "US")
|
|
8078
|
-
return true;
|
|
8079
|
-
return true;
|
|
8080
|
-
}
|
|
8081
8064
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
8082
8065
|
const regionObj = hasStates
|
|
8083
8066
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -8105,7 +8088,6 @@ function useUserInfoForm(props) {
|
|
|
8105
8088
|
allCountries: countries,
|
|
8106
8089
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
8107
8090
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
8108
|
-
partnerData: (_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,
|
|
8109
8091
|
},
|
|
8110
8092
|
states: {
|
|
8111
8093
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
@@ -8114,8 +8096,8 @@ function useUserInfoForm(props) {
|
|
|
8114
8096
|
disabled: loading,
|
|
8115
8097
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
8116
8098
|
loading: loading,
|
|
8117
|
-
isPartner: !!((
|
|
8118
|
-
isUser: !!((
|
|
8099
|
+
isPartner: !!((_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),
|
|
8100
|
+
isUser: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
|
|
8119
8101
|
formState: {
|
|
8120
8102
|
...userFormContext,
|
|
8121
8103
|
errors: formErrors,
|
|
@@ -38,6 +38,7 @@ sqm-portal-register {
|
|
|
38
38
|
const sheet = createStyleSheet(style);
|
|
39
39
|
const styleString = sheet.toString();
|
|
40
40
|
function BaseRegistrationFormView(props) {
|
|
41
|
+
var _a, _b;
|
|
41
42
|
const { states, content, callbacks } = props;
|
|
42
43
|
return (h("div", { class: sheet.classes.Wrapper },
|
|
43
44
|
h("style", { type: "text/css" },
|
|
@@ -45,10 +46,8 @@ function BaseRegistrationFormView(props) {
|
|
|
45
46
|
styleString),
|
|
46
47
|
h(TextSpanView, { type: "h3" }, content.pageLabel),
|
|
47
48
|
h("sl-form", { class: sheet.classes.Column, "onSl-submit": callbacks.handleEmailSubmit, novalidate: true },
|
|
48
|
-
states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
|
|
49
|
-
h("div", { part: "erroralert-text" }, props.states.error))),
|
|
50
49
|
content.formData,
|
|
51
|
-
h("sl-input", { exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", required: true, validationError: ({ value }) => {
|
|
50
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", required: true, validationError: ({ value }) => {
|
|
52
51
|
if (!value) {
|
|
53
52
|
return content.requiredFieldErrorMessage;
|
|
54
53
|
}
|
|
@@ -56,7 +55,13 @@ function BaseRegistrationFormView(props) {
|
|
|
56
55
|
if (!value.includes("@")) {
|
|
57
56
|
return content.invalidEmailErrorMessage;
|
|
58
57
|
}
|
|
59
|
-
} })
|
|
58
|
+
} }, (((_a = states === null || states === void 0 ? void 0 : states.validationErrors) === null || _a === void 0 ? void 0 : _a.email) ? {
|
|
59
|
+
class: sheet.classes.ErrorStyle,
|
|
60
|
+
helpText: ((_b = states === null || states === void 0 ? void 0 : states.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ||
|
|
61
|
+
content.requiredFieldErrorMessage,
|
|
62
|
+
}
|
|
63
|
+
: []))),
|
|
64
|
+
content.terms,
|
|
60
65
|
h("div", { class: sheet.classes.ButtonsContainer },
|
|
61
66
|
h("sl-button", { submit: true, exportparts: "base: primarybutton-base", type: "primary", style: { margin: "0" } }, content.submitLabel || "Register"),
|
|
62
67
|
h("sl-menu-divider", { style: { margin: "0" } }),
|
|
@@ -7,7 +7,7 @@ import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
|
7
7
|
import './mixins-83f90fa1.js';
|
|
8
8
|
import './sqm-text-span-view-ca32495e.js';
|
|
9
9
|
import { a as useRegistrationForm } from './useRegistrationFormState-d6f33135.js';
|
|
10
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
10
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-d81e316a.js';
|
|
11
11
|
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-3c1f6000.js';
|
|
12
12
|
import './AsYouType-46f67d0d.js';
|
|
13
13
|
import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-4b35a357.js';
|
|
@@ -71,7 +71,6 @@ function jwtDecode(token, options) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function usePortalGoogleRegistrationForm(props) {
|
|
74
|
-
const [emailValidationError, setEmailValidationError] = useState(null);
|
|
75
74
|
const [registrationFormState, setRegistrationFormState] = useRegistrationForm();
|
|
76
75
|
const [showRegistrationForm, setShowRegistrationForm] = useState({
|
|
77
76
|
mode: "base",
|
|
@@ -79,33 +78,41 @@ function usePortalGoogleRegistrationForm(props) {
|
|
|
79
78
|
const handleEmailSubmit = async (event) => {
|
|
80
79
|
const formControls = event.target.getFormControls();
|
|
81
80
|
let formData = {};
|
|
82
|
-
let
|
|
81
|
+
let validationErrors = {};
|
|
83
82
|
formControls.forEach((control) => {
|
|
84
83
|
if (!control.name)
|
|
85
84
|
return;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
const key = control.name;
|
|
86
|
+
const value = control.value;
|
|
87
|
+
jsonpointer.set(formData, key, value);
|
|
88
|
+
if (control.required && !value) {
|
|
89
|
+
jsonpointer.set(validationErrors, key, props.requiredFieldErrorMessage);
|
|
90
|
+
}
|
|
91
|
+
// errorMessage = props.requiredFieldErrorMessage;
|
|
92
92
|
if (typeof control.validationError === "function") {
|
|
93
93
|
const validate = control.validationError;
|
|
94
94
|
const validationError = validate({
|
|
95
95
|
control,
|
|
96
|
-
key
|
|
97
|
-
value
|
|
96
|
+
key,
|
|
97
|
+
value,
|
|
98
98
|
});
|
|
99
99
|
if (validationError)
|
|
100
|
-
|
|
100
|
+
jsonpointer.set(validationErrors, key, validationError);
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
-
if (
|
|
104
|
-
|
|
103
|
+
if (Object.keys(validationErrors).length) {
|
|
104
|
+
// early return for validation errors
|
|
105
|
+
setRegistrationFormState({
|
|
106
|
+
...registrationFormState,
|
|
107
|
+
loading: false,
|
|
108
|
+
error: "",
|
|
109
|
+
validationErrors,
|
|
110
|
+
});
|
|
105
111
|
return;
|
|
106
112
|
}
|
|
107
113
|
setRegistrationFormState({
|
|
108
114
|
...registrationFormState,
|
|
115
|
+
validationErrors: {},
|
|
109
116
|
initialData: {
|
|
110
117
|
...registrationFormState === null || registrationFormState === void 0 ? void 0 : registrationFormState.initialData,
|
|
111
118
|
...formData,
|
|
@@ -135,8 +142,9 @@ function usePortalGoogleRegistrationForm(props) {
|
|
|
135
142
|
}
|
|
136
143
|
};
|
|
137
144
|
return {
|
|
145
|
+
registrationFormState,
|
|
138
146
|
showRegistrationForm,
|
|
139
|
-
|
|
147
|
+
validationErrors: registrationFormState.validationErrors,
|
|
140
148
|
handleGoogleInit,
|
|
141
149
|
handleEmailSubmit,
|
|
142
150
|
};
|
|
@@ -292,7 +300,7 @@ const PortalGoogleRegistrationForm = class {
|
|
|
292
300
|
};
|
|
293
301
|
const sheet = createStyleSheet(styles);
|
|
294
302
|
const styleString = sheet.toString();
|
|
295
|
-
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm,
|
|
303
|
+
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm, validationErrors, } = isDemo() ? useGoogleDemo(this) : usePortalGoogleRegistrationForm(this);
|
|
296
304
|
const content = {
|
|
297
305
|
formData: h$1("slot", { name: "formData" }),
|
|
298
306
|
googleButton: (h$1("sqm-google-sign-in", { text: this.googleButtonText, onInitComplete: handleGoogleInit })),
|
|
@@ -317,14 +325,16 @@ const PortalGoogleRegistrationForm = class {
|
|
|
317
325
|
};
|
|
318
326
|
if (showRegistrationForm.mode === "base") {
|
|
319
327
|
return (h$1(BaseRegistrationFormView, { states: {
|
|
320
|
-
|
|
328
|
+
validationErrors,
|
|
321
329
|
}, callbacks: { handleEmailSubmit }, content: content }));
|
|
322
330
|
}
|
|
323
331
|
return (h$1(PortalRegistrationFormView, { states: {
|
|
324
332
|
...states,
|
|
325
333
|
emailDisabled: true,
|
|
326
334
|
hidePasswords: showRegistrationForm.mode === "google",
|
|
327
|
-
}, callbacks: callbacks,
|
|
335
|
+
}, callbacks: callbacks,
|
|
336
|
+
// Show terms only on first screen
|
|
337
|
+
content: { ...content, terms: null }, refs: refs }));
|
|
328
338
|
}
|
|
329
339
|
};
|
|
330
340
|
function useRegisterDemo(props) {
|
|
@@ -360,7 +370,7 @@ function useGoogleDemo(props) {
|
|
|
360
370
|
mode: "base",
|
|
361
371
|
});
|
|
362
372
|
return cjs({
|
|
363
|
-
|
|
373
|
+
validationErrors: {},
|
|
364
374
|
handleEmailSubmit: () => setShowRegistrationForm({ mode: "manual" }),
|
|
365
375
|
showRegistrationForm,
|
|
366
376
|
handleGoogleInit: () => setShowRegistrationForm({ mode: "google" }),
|
|
@@ -24,7 +24,7 @@ import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-vi
|
|
|
24
24
|
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-35b4353b.js';
|
|
25
25
|
import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-3d3182f1.js';
|
|
26
26
|
import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
|
|
27
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
27
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-d81e316a.js';
|
|
28
28
|
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-3c1f6000.js';
|
|
29
29
|
import { P as PortalProfileView } from './sqm-portal-profile-view-93003974.js';
|
|
30
30
|
import './utilities-5b0ca040.js';
|
|
@@ -34,7 +34,7 @@ import './ErrorView-48e2b969.js';
|
|
|
34
34
|
import { Q as QrCodeView } from './sqm-qr-code-view-f1d0763b.js';
|
|
35
35
|
import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as LeadDropdownFieldView, U as autoColorScaleCss, V as ShadowViewAddon } from './ShadowViewAddon-f2176779.js';
|
|
36
36
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
|
|
37
|
-
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-
|
|
37
|
+
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-3491dd80.js';
|
|
38
38
|
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-4ede5d7f.js';
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -15636,7 +15636,7 @@ const BaseRegistrationForm_stories = {
|
|
|
15636
15636
|
};
|
|
15637
15637
|
const defaultProps$q = {
|
|
15638
15638
|
states: {
|
|
15639
|
-
|
|
15639
|
+
validationErrors: {},
|
|
15640
15640
|
},
|
|
15641
15641
|
callbacks: {
|
|
15642
15642
|
handleEmailSubmit: () => console.log("Submit!"),
|
|
@@ -15656,7 +15656,7 @@ const defaultProps$q = {
|
|
|
15656
15656
|
const errorProps$a = {
|
|
15657
15657
|
...defaultProps$q,
|
|
15658
15658
|
states: {
|
|
15659
|
-
error: "Something went wrong. Please try again.",
|
|
15659
|
+
validationErrors: { error: "Something went wrong. Please try again." },
|
|
15660
15660
|
},
|
|
15661
15661
|
};
|
|
15662
15662
|
const Default$o = () => {
|