@saasquatch/mint-components 2.1.9-20 → 2.1.9-21

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.
Files changed (53) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mint-components.cjs.js +1 -1
  3. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +1 -1
  4. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +42 -2
  5. package/dist/cjs/{sqm-partner-info-modal-view-d5c997e6.js → sqm-partner-info-modal-view-464c52c9.js} +20 -2
  6. package/dist/cjs/sqm-partner-info-modal.cjs.entry.js +493 -0
  7. package/dist/cjs/sqm-stencilbook.cjs.entry.js +10 -2
  8. package/dist/cjs/{sqm-user-info-form-view-db47a968.js → sqm-user-info-form-view-01bf2f41.js} +2 -7
  9. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +8 -0
  10. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +20 -2
  11. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +91 -2
  12. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +17 -0
  13. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +2 -7
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/mint-components.js +1 -1
  16. package/dist/esm/sqm-banking-info-form_10.entry.js +1 -1
  17. package/dist/esm/sqm-email-verification_2.entry.js +42 -2
  18. package/dist/esm/{sqm-partner-info-modal-view-08b7c5f6.js → sqm-partner-info-modal-view-a6324934.js} +20 -2
  19. package/dist/esm/sqm-partner-info-modal.entry.js +489 -0
  20. package/dist/esm/sqm-stencilbook.entry.js +10 -2
  21. package/dist/esm/{sqm-user-info-form-view-712cd51b.js → sqm-user-info-form-view-365cef98.js} +2 -7
  22. package/dist/esm-es5/loader.js +1 -1
  23. package/dist/esm-es5/mint-components.js +1 -1
  24. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  25. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  26. package/dist/esm-es5/sqm-partner-info-modal-view-a6324934.js +1 -0
  27. package/dist/esm-es5/sqm-partner-info-modal.entry.js +1 -0
  28. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  29. package/dist/esm-es5/{sqm-user-info-form-view-712cd51b.js → sqm-user-info-form-view-365cef98.js} +1 -1
  30. package/dist/mint-components/mint-components.esm.js +1 -1
  31. package/dist/mint-components/{p-fc783749.entry.js → p-038d0b8f.entry.js} +1 -1
  32. package/dist/mint-components/p-1c413a06.system.js +1 -1
  33. package/dist/mint-components/p-1e35f151.system.js +1 -0
  34. package/dist/mint-components/{p-842f45b9.js → p-52eca331.js} +1 -1
  35. package/dist/mint-components/{p-0dc17c6a.entry.js → p-6530c3f1.entry.js} +2 -2
  36. package/dist/mint-components/{p-1b7dfd6f.system.entry.js → p-9b790948.system.entry.js} +1 -1
  37. package/dist/mint-components/{p-0a126d1b.system.entry.js → p-a0986077.system.entry.js} +1 -1
  38. package/dist/mint-components/p-a1e1c42a.js +1 -0
  39. package/dist/mint-components/{p-8e1acd9a.system.js → p-a2db4345.system.js} +1 -1
  40. package/dist/mint-components/{p-45e72bed.system.entry.js → p-b6ac3080.system.entry.js} +1 -1
  41. package/dist/mint-components/{p-91a00693.entry.js → p-bc4b2728.entry.js} +5 -5
  42. package/dist/mint-components/sqm-partner-info-modal.entry.js +489 -0
  43. package/dist/mint-components/sqm-partner-info-modal.system.entry.js +1 -0
  44. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +7 -0
  45. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +16 -0
  46. package/dist/types/components.d.ts +32 -0
  47. package/docs/docs.docx +0 -0
  48. package/docs/raisins.json +1 -1
  49. package/grapesjs/grapesjs.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/esm-es5/sqm-partner-info-modal-view-08b7c5f6.js +0 -1
  52. package/dist/mint-components/p-b077d478.js +0 -1
  53. package/dist/mint-components/p-da6c5d98.system.js +0 -1
@@ -55,6 +55,22 @@ export class PartnerInfoModal {
55
55
  * @uiWidget textArea
56
56
  */
57
57
  this.supportDescriptionExistingPartner = "If this is a mistake, please contact Support or sign up for this referral program with a different email.";
58
+ /**
59
+ * Edit the property called terms and conditions text to change what's displayed for {termsAndConditionsLink}.
60
+ * @uiName Terms and conditions checkbox
61
+ */
62
+ this.allowBankingCollection = "I have read the {termsAndConditionsLink} and allow impact.com to collect my tax and banking information";
63
+ /**
64
+ * The link text that appears in the terms and conditions checkbox
65
+ * @uiName Terms and conditions text
66
+ * @uiWidget textArea
67
+ */
68
+ this.termsAndConditionsLabel = "terms and conditions";
69
+ /**
70
+ * The link that appears in the terms and conditions checkbox
71
+ * @uiName Terms and conditions link
72
+ */
73
+ this.termsAndConditionsLink = "https://terms.advocate.impact.com/PayoutTermsAndConditions.html";
58
74
  /**
59
75
  * @uiName Country label
60
76
  */
@@ -260,6 +276,72 @@ export class PartnerInfoModal {
260
276
  "reflect": false,
261
277
  "defaultValue": "\"If this is a mistake, please contact Support or sign up for this referral program with a different email.\""
262
278
  },
279
+ "allowBankingCollection": {
280
+ "type": "string",
281
+ "mutable": false,
282
+ "complexType": {
283
+ "original": "string",
284
+ "resolved": "string",
285
+ "references": {}
286
+ },
287
+ "required": false,
288
+ "optional": false,
289
+ "docs": {
290
+ "tags": [{
291
+ "text": "Terms and conditions checkbox",
292
+ "name": "uiName"
293
+ }],
294
+ "text": "Edit the property called terms and conditions text to change what's displayed for {termsAndConditionsLink}."
295
+ },
296
+ "attribute": "allow-banking-collection",
297
+ "reflect": false,
298
+ "defaultValue": "\"I have read the {termsAndConditionsLink} and allow impact.com to collect my tax and banking information\""
299
+ },
300
+ "termsAndConditionsLabel": {
301
+ "type": "string",
302
+ "mutable": false,
303
+ "complexType": {
304
+ "original": "string",
305
+ "resolved": "string",
306
+ "references": {}
307
+ },
308
+ "required": false,
309
+ "optional": false,
310
+ "docs": {
311
+ "tags": [{
312
+ "text": "Terms and conditions text",
313
+ "name": "uiName"
314
+ }, {
315
+ "text": "textArea",
316
+ "name": "uiWidget"
317
+ }],
318
+ "text": "The link text that appears in the terms and conditions checkbox"
319
+ },
320
+ "attribute": "terms-and-conditions-label",
321
+ "reflect": false,
322
+ "defaultValue": "\"terms and conditions\""
323
+ },
324
+ "termsAndConditionsLink": {
325
+ "type": "string",
326
+ "mutable": false,
327
+ "complexType": {
328
+ "original": "string",
329
+ "resolved": "string",
330
+ "references": {}
331
+ },
332
+ "required": false,
333
+ "optional": false,
334
+ "docs": {
335
+ "tags": [{
336
+ "text": "Terms and conditions link",
337
+ "name": "uiName"
338
+ }],
339
+ "text": "The link that appears in the terms and conditions checkbox"
340
+ },
341
+ "attribute": "terms-and-conditions-link",
342
+ "reflect": false,
343
+ "defaultValue": "\"https://terms.advocate.impact.com/PayoutTermsAndConditions.html\""
344
+ },
263
345
  "countryLabel": {
264
346
  "type": "string",
265
347
  "mutable": false,
@@ -490,7 +572,7 @@ export class PartnerInfoModal {
490
572
  "mutable": false,
491
573
  "complexType": {
492
574
  "original": "DemoData<PartnerInfoModalResult>",
493
- "resolved": "{ states?: { open: boolean; loading: boolean; submitting: boolean; isExistingPartner: boolean; countryCode: string; currency: string; error: string; success: boolean; brandName: string; filteredCountries: { countryCode: string; displayName: string; }[]; filteredCurrencies: { currencyCode: string; displayName: string; }[]; }; }",
575
+ "resolved": "{ states?: { open: boolean; loading: boolean; submitting: boolean; isExistingPartner: boolean; countryCode: string; currency: string; error: string; success: boolean; brandName: string; filteredCountries: { countryCode: string; displayName: string; }[]; filteredCurrencies: { currencyCode: string; displayName: string; }[]; allowBankingCollection: boolean; checkboxError: string; disabled: boolean; }; }",
494
576
  "references": {
495
577
  "DemoData": {
496
578
  "location": "import",
@@ -521,13 +603,14 @@ function useDemoPartnerInfoModal(props) {
521
603
  const [countryCode, setCountryCode] = useState("US");
522
604
  const [currency, setCurrency] = useState("");
523
605
  const [error, setError] = useState("");
606
+ const [allowBankingCollection, setAllowBankingCollection] = useState(false);
524
607
  const parsed = parseStates(props.stateController);
525
608
  const stateOverride = (parsed === null || parsed === void 0 ? void 0 : parsed["sqm-partner-info-modal"]) || parsed || {};
526
609
  // @ts-ignore
527
610
  return deepmerge({
528
611
  states: {
529
612
  brandName: "Test Brand",
530
- open: true,
613
+ open: false,
531
614
  loading: false,
532
615
  submitting: false,
533
616
  isExistingPartner: false,
@@ -537,6 +620,9 @@ function useDemoPartnerInfoModal(props) {
537
620
  success: false,
538
621
  filteredCountries: [],
539
622
  filteredCurrencies: [],
623
+ allowBankingCollection,
624
+ checkboxError: "",
625
+ disabled: false,
540
626
  },
541
627
  callbacks: {
542
628
  onCountryChange: (e) => {
@@ -553,6 +639,9 @@ function useDemoPartnerInfoModal(props) {
553
639
  if (value)
554
640
  setCurrency(value);
555
641
  },
642
+ onCheckboxChange: (e) => {
643
+ setAllowBankingCollection(e.target.checked);
644
+ },
556
645
  setCountrySearch: () => { },
557
646
  setCurrencySearch: () => { },
558
647
  onSubmit: () => {
@@ -121,6 +121,8 @@ export function usePartnerInfoModal(props) {
121
121
  variables: { filter: {} },
122
122
  });
123
123
  const [startImpactConnection, { loading: connectLoading, errors: connectErrors },] = useMutation(START_IMPACT_CONNECTION);
124
+ const [allowBankingCollection, setAllowBankingCollection] = useState(false);
125
+ const [checkboxError, setCheckboxError] = useState("");
124
126
  // No pre-filled country, use locale to determine countryCode instead
125
127
  const [countryCode, setCountryCode] = useState(((_b = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.countryCode) ||
126
128
  locale.replace(/^.*_/, ""));
@@ -195,13 +197,24 @@ export function usePartnerInfoModal(props) {
195
197
  setCurrency(value);
196
198
  setError("");
197
199
  }
200
+ function onCheckboxChange(e) {
201
+ const checked = e.target.checked;
202
+ setAllowBankingCollection(checked);
203
+ if (checked)
204
+ setCheckboxError("");
205
+ }
198
206
  async function onSubmit() {
199
207
  var _a, _b;
208
+ if (!allowBankingCollection) {
209
+ setCheckboxError(props.missingFieldsErrorText);
210
+ return;
211
+ }
200
212
  if (!countryCode || !currency) {
201
213
  setError(props.missingFieldsErrorText);
202
214
  return;
203
215
  }
204
216
  setError("");
217
+ setCheckboxError("");
205
218
  try {
206
219
  const vars = {
207
220
  user: {
@@ -255,10 +268,14 @@ export function usePartnerInfoModal(props) {
255
268
  brandName: ((_g = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _g === void 0 ? void 0 : _g.companyName) || "",
256
269
  filteredCountries: filteredCountries || [],
257
270
  filteredCurrencies: filteredCurrencies || [],
271
+ allowBankingCollection,
272
+ checkboxError,
273
+ disabled: userLoading || connectLoading,
258
274
  },
259
275
  callbacks: {
260
276
  onCountryChange,
261
277
  onCurrencyChange,
278
+ onCheckboxChange,
262
279
  setCurrencySearch,
263
280
  setCountrySearch,
264
281
  onSubmit,
@@ -264,7 +264,7 @@ const vanillaStyle = `
264
264
  }
265
265
  `;
266
266
  export const UserInfoFormView = (props) => {
267
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
268
268
  const { states, states: { formState }, callbacks, text, refs, data, } = props;
269
269
  const { classes } = sheet;
270
270
  const bankingCollectionText = intl.formatMessage({
@@ -435,11 +435,6 @@ export const UserInfoFormView = (props) => {
435
435
  _t.map((c) => (h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
436
436
  c.currencyCode,
437
437
  " - ",
438
- c.displayName)))),
439
- h("div", { class: classes.CheckboxWrapper },
440
- h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
441
- e.target.value = e.target.checked;
442
- }, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
443
- ((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
438
+ c.displayName))))),
444
439
  h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
445
440
  };