@saasquatch/mint-components 2.3.0-7 → 2.3.0-8

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 (47) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +25 -25
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +2 -2
  3. package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
  4. package/dist/cjs/{sqm-user-info-form-view-42323dc5.js → sqm-user-info-form-view-374a3f01.js} +20 -980
  5. package/dist/cjs/subregions-984e30d7.js +1505 -0
  6. package/dist/cjs/{useIndirectTaxForm-d1cd23f7.js → useIndirectTaxForm-112914a0.js} +1 -1
  7. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -7
  8. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +22 -19
  9. package/dist/collection/components/tax-and-cash/utils.js +55 -0
  10. package/dist/esm/sqm-banking-info-form_10.entry.js +25 -25
  11. package/dist/esm/sqm-big-stat_47.entry.js +2 -2
  12. package/dist/esm/sqm-stencilbook.entry.js +2 -2
  13. package/dist/esm/{sqm-user-info-form-view-dc473cb8.js → sqm-user-info-form-view-5322525c.js} +18 -978
  14. package/dist/esm/subregions-7c9778d0.js +1492 -0
  15. package/dist/esm/{useIndirectTaxForm-27668ad4.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  16. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  17. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  18. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  19. package/dist/esm-es5/sqm-user-info-form-view-5322525c.js +1 -0
  20. package/dist/esm-es5/subregions-7c9778d0.js +1 -0
  21. package/dist/esm-es5/{useIndirectTaxForm-27668ad4.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  22. package/dist/mint-components/mint-components.esm.js +1 -1
  23. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  24. package/dist/mint-components/{p-2e462dd9.js → p-2d4132fb.js} +5 -5
  25. package/dist/mint-components/p-5623f1e0.js +1 -0
  26. package/dist/mint-components/{p-3c052d3d.entry.js → p-5bc707cf.entry.js} +1 -1
  27. package/dist/mint-components/{p-c2903e7d.entry.js → p-6eebbc59.entry.js} +2 -2
  28. package/dist/mint-components/{p-ed945efe.system.js → p-6ef373ed.system.js} +1 -1
  29. package/dist/mint-components/{p-df74f653.system.entry.js → p-7a4cf6c9.system.entry.js} +1 -1
  30. package/dist/mint-components/p-7f29622d.js +1 -0
  31. package/dist/mint-components/{p-4575f71b.system.entry.js → p-8a08cec6.system.entry.js} +1 -1
  32. package/dist/mint-components/{p-547f8243.system.entry.js → p-90200f08.system.entry.js} +1 -1
  33. package/dist/mint-components/{p-d30c8cb3.entry.js → p-91295327.entry.js} +1 -1
  34. package/dist/mint-components/p-bd03efe0.system.js +1 -0
  35. package/dist/mint-components/p-c13c20b2.system.js +1 -0
  36. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
  37. package/dist/types/components/tax-and-cash/utils.d.ts +5 -0
  38. package/docs/docs.docx +0 -0
  39. package/package.json +1 -1
  40. package/dist/cjs/subregions-e7273457.js +0 -478
  41. package/dist/esm/subregions-24c1c137.js +0 -467
  42. package/dist/esm-es5/sqm-user-info-form-view-dc473cb8.js +0 -1
  43. package/dist/esm-es5/subregions-24c1c137.js +0 -1
  44. package/dist/mint-components/p-3f68e4e3.js +0 -1
  45. package/dist/mint-components/p-66cb8bec.system.js +0 -1
  46. package/dist/mint-components/p-cb58a2c6.js +0 -1
  47. package/dist/mint-components/p-ec58628f.system.js +0 -1
@@ -16,12 +16,12 @@ const reRender = require('./re-render-72a0ef45.js');
16
16
  const useChildElements = require('./useChildElements-041127d7.js');
17
17
  const luxon = require('./luxon-c1ad356a.js');
18
18
  const useReferralTable = require('./useReferralTable-6e9de0d5.js');
19
- const sqmUserInfoFormView = require('./sqm-user-info-form-view-42323dc5.js');
20
- const subregions = require('./subregions-e7273457.js');
19
+ const sqmUserInfoFormView = require('./sqm-user-info-form-view-374a3f01.js');
20
+ const subregions = require('./subregions-984e30d7.js');
21
21
  const data = require('./data-89ac73dd.js');
22
22
  const keys = require('./keys-5a2c9ed2.js');
23
23
  const eventKeys = require('./eventKeys-7af4df4d.js');
24
- const useIndirectTaxForm = require('./useIndirectTaxForm-d1cd23f7.js');
24
+ const useIndirectTaxForm = require('./useIndirectTaxForm-112914a0.js');
25
25
 
26
26
  function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
27
27
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76;
@@ -4549,9 +4549,7 @@ function useUserInfoForm(props) {
4549
4549
  setFilteredPhoneCountries(countries || []);
4550
4550
  }
4551
4551
  else {
4552
- setFilteredPhoneCountries(countries.filter((c) => c.displayName
4553
- .toLowerCase()
4554
- .includes(phoneCountrySearch.toLowerCase())) || []);
4552
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
4555
4553
  }
4556
4554
  }, [phoneCountrySearch, countries]);
4557
4555
  domContextHooks_module.useEffect(() => {
@@ -4565,7 +4563,7 @@ function useUserInfoForm(props) {
4565
4563
  }
4566
4564
  }, [currencySearch, currencies]);
4567
4565
  async function connectPartner(formData) {
4568
- var _a, _b, _c, _d, _e, _f;
4566
+ var _a, _b, _c, _d;
4569
4567
  const vars = {
4570
4568
  user: {
4571
4569
  id: user.id,
@@ -4582,31 +4580,33 @@ function useUserInfoForm(props) {
4582
4580
  phoneNumber: formData.phoneNumber,
4583
4581
  phoneNumberCountryCode: formData.phoneNumberCountryCode,
4584
4582
  };
4585
- // If the partner has already been started call completeImpactPartner to
4586
- // update the remaining details. Otherwise create a new connection.
4587
- const userData = data$1 === null || data$1 === void 0 ? void 0 : data$1.user;
4588
4583
  let result = null;
4589
4584
  let connectionResult;
4590
- if (((_a = userData === null || userData === void 0 ? void 0 : userData.impactConnection) === null || _a === void 0 ? void 0 : _a.connectionStatus) === "STARTED") {
4591
- result = await completeImpactPartner({
4592
- vars,
4593
- });
4594
- connectionResult = (_b = result) === null || _b === void 0 ? void 0 : _b.completeImpactConnection;
4595
- }
4596
- else {
4597
- result = await connectImpactPartner({
4598
- vars,
4599
- });
4600
- connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.createImpactConnection;
4601
- }
4602
- if (!result || ((_d = result) === null || _d === void 0 ? void 0 : _d.message))
4585
+ result = await completeImpactPartner({
4586
+ vars,
4587
+ });
4588
+ connectionResult = (_a = result) === null || _a === void 0 ? void 0 : _a.completeImpactConnection;
4589
+ // if (userData?.impactConnection?.connectionStatus === "STARTED") {
4590
+ // result = await completeImpactPartner({
4591
+ // vars,
4592
+ // });
4593
+ // connectionResult = (result as CompletePartnerResult)
4594
+ // ?.completeImpactConnection;
4595
+ // } else {
4596
+ // result = await connectImpactPartner({
4597
+ // vars,
4598
+ // });
4599
+ // connectionResult = (result as ConnectPartnerResult)
4600
+ // ?.createImpactConnection;
4601
+ // }
4602
+ if (!result || ((_b = result) === null || _b === void 0 ? void 0 : _b.message))
4603
4603
  throw new Error();
4604
4604
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
4605
4605
  console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
4606
4606
  throw new Error();
4607
4607
  }
4608
4608
  await refetch();
4609
- 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;
4609
+ const resultPublisher = (_d = (_c = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.publisher;
4610
4610
  const hasValidCurrentDocument = subregions.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
4611
4611
  // Fire form change event
4612
4612
  window.dispatchEvent(new Event(eventKeys.TAX_FORM_UPDATED_EVENT_KEY));
@@ -4627,7 +4627,7 @@ function useUserInfoForm(props) {
4627
4627
  // custom validation
4628
4628
  if (typeof control.validationError === "function") {
4629
4629
  const validate = control.validationError;
4630
- const validationError = validate({ control, key, value });
4630
+ const validationError = validate({ control, key, value, formData });
4631
4631
  if (validationError)
4632
4632
  jsonpointer.jsonpointer.set(errors, key, validationError);
4633
4633
  }
@@ -29,11 +29,11 @@ const utilities = require('./utilities-fcdb9504.js');
29
29
  const ErrorView = require('./ErrorView-ee7b0f36.js');
30
30
  const ShadowViewAddon = require('./ShadowViewAddon-3b477e58.js');
31
31
  require('./sqm-portal-container-view-757f921b.js');
32
- const subregions = require('./subregions-e7273457.js');
32
+ const subregions = require('./subregions-984e30d7.js');
33
33
  const data = require('./data-89ac73dd.js');
34
34
  const keys = require('./keys-5a2c9ed2.js');
35
35
  require('./eventKeys-7af4df4d.js');
36
- const useIndirectTaxForm = require('./useIndirectTaxForm-d1cd23f7.js');
36
+ const useIndirectTaxForm = require('./useIndirectTaxForm-112914a0.js');
37
37
  const parseStates = require('./parseStates-d1effc19.js');
38
38
 
39
39
  /**
@@ -35,8 +35,8 @@ require('./ErrorView-ee7b0f36.js');
35
35
  const sqmQrCodeView = require('./sqm-qr-code-view-1f2daa76.js');
36
36
  const ShadowViewAddon = require('./ShadowViewAddon-3b477e58.js');
37
37
  const sqmPortalContainerView = require('./sqm-portal-container-view-757f921b.js');
38
- const sqmUserInfoFormView = require('./sqm-user-info-form-view-42323dc5.js');
39
- const subregions = require('./subregions-e7273457.js');
38
+ const sqmUserInfoFormView = require('./sqm-user-info-form-view-374a3f01.js');
39
+ const subregions = require('./subregions-984e30d7.js');
40
40
  const sqmLeadInputFieldView = require('./sqm-lead-input-field-view-0cd7ebdb.js');
41
41
  require('./data-89ac73dd.js');
42
42
  const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-65cc677a.js');