@saasquatch/mint-components 2.1.9-3 → 2.1.9-5

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 (64) hide show
  1. package/dist/cjs/{extractProps-e9c55ba8.js → extractProps-fd93ba62.js} +0 -14
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/parseStates-d1effc19.js +16 -0
  5. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +1 -1
  6. package/dist/cjs/sqm-big-stat_45.cjs.entry.js +5 -4
  7. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +15 -1
  8. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
  9. package/dist/cjs/{sqm-user-info-form-view-e7260d61.js → sqm-user-info-form-view-923ff8d9.js} +3 -3
  10. package/dist/cjs/sqm-widget-verification.cjs.entry.js +4 -3
  11. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +43 -1
  12. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +4 -1
  13. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +1 -1
  14. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +3 -3
  15. package/dist/esm/{extractProps-54064fb0.js → extractProps-ae1afbb3.js} +1 -14
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/mint-components.js +1 -1
  18. package/dist/esm/parseStates-ed75e224.js +14 -0
  19. package/dist/esm/sqm-banking-info-form_10.entry.js +1 -1
  20. package/dist/esm/sqm-big-stat_45.entry.js +2 -1
  21. package/dist/esm/sqm-email-verification_2.entry.js +16 -2
  22. package/dist/esm/sqm-stencilbook.entry.js +1 -1
  23. package/dist/esm/{sqm-user-info-form-view-a18d6b15.js → sqm-user-info-form-view-ef04a79f.js} +3 -3
  24. package/dist/esm/sqm-widget-verification.entry.js +3 -2
  25. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  26. package/dist/esm-es5/loader.js +1 -1
  27. package/dist/esm-es5/mint-components.js +1 -1
  28. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  29. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  30. package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
  31. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  32. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  33. package/dist/esm-es5/{sqm-user-info-form-view-a18d6b15.js → sqm-user-info-form-view-ef04a79f.js} +1 -1
  34. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  35. package/dist/mint-components/mint-components.esm.js +1 -1
  36. package/dist/mint-components/p-115dfc03.system.js +1 -0
  37. package/dist/mint-components/p-13f3a647.js +1 -0
  38. package/dist/mint-components/p-26468242.js +1 -0
  39. package/dist/mint-components/p-4b365f1f.system.js +1 -1
  40. package/dist/mint-components/{p-725c542a.js → p-51b8ed78.js} +1 -1
  41. package/dist/mint-components/{p-66c070e2.entry.js → p-52713f92.entry.js} +8 -8
  42. package/dist/mint-components/{p-debe7d04.system.js → p-546a65c7.system.js} +1 -1
  43. package/dist/mint-components/{p-e6924adb.entry.js → p-5a446168.entry.js} +1 -1
  44. package/dist/mint-components/{p-1a0b9f0f.entry.js → p-5bbdeacd.entry.js} +2 -2
  45. package/dist/mint-components/{p-094edc0b.entry.js → p-6a754f51.entry.js} +1 -1
  46. package/dist/mint-components/p-a0cd6cc7.system.entry.js +1 -0
  47. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  48. package/dist/mint-components/{p-237a21c1.system.entry.js → p-adb56df3.system.entry.js} +1 -1
  49. package/dist/mint-components/p-aeb01a77.system.entry.js +1 -0
  50. package/dist/mint-components/{p-4fbfb954.system.entry.js → p-d2d2c4ea.system.entry.js} +1 -1
  51. package/dist/mint-components/{p-c7cac01e.entry.js → p-f50c3306.entry.js} +1 -1
  52. package/dist/mint-components/p-f5755143.system.entry.js +1 -0
  53. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +7 -0
  54. package/dist/types/components.d.ts +14 -0
  55. package/docs/docs.docx +0 -0
  56. package/docs/raisins.json +1 -1
  57. package/grapesjs/grapesjs.js +1 -1
  58. package/package.json +1 -1
  59. package/dist/esm-es5/extractProps-54064fb0.js +0 -1
  60. package/dist/mint-components/p-0797a946.js +0 -1
  61. package/dist/mint-components/p-4ea9b7ec.system.entry.js +0 -1
  62. package/dist/mint-components/p-6e6f19ea.system.entry.js +0 -1
  63. package/dist/mint-components/p-a9855b29.system.entry.js +0 -1
  64. package/dist/mint-components/p-e55aafe9.system.js +0 -1
@@ -1907,12 +1907,12 @@ const UserInfoFormView = (props) => {
1907
1907
  }
1908
1908
  // when creating an impact connection without sending phoneNumber data, the impactAPI defaults the value to "000000" and the phoneNumberCountryCode to "DZ"
1909
1909
  function isDisabledPartnerInput(field) {
1910
- var _a;
1911
- if (data$1.partnerData.phoneNumber === "0000000" &&
1910
+ var _a, _b;
1911
+ if (((_a = data$1.partnerData) === null || _a === void 0 ? void 0 : _a.phoneNumber) === "0000000" &&
1912
1912
  (field === "phoneNumber" || field === "phoneNumberCountryCode")) {
1913
1913
  return false;
1914
1914
  }
1915
- return states.isPartner && !!((_a = data$1.partnerData) === null || _a === void 0 ? void 0 : _a[field]);
1915
+ return states.isPartner && !!((_b = data$1.partnerData) === null || _b === void 0 ? void 0 : _b[field]);
1916
1916
  }
1917
1917
  function isDisabledUserInput(field) {
1918
1918
  var _a;
@@ -7,7 +7,8 @@ const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js')
7
7
  const index_module = require('./index.module-42d413d9.js');
8
8
  const cjs = require('./cjs-1066ec21.js');
9
9
  const utils = require('./utils-6847bc06.js');
10
- const extractProps = require('./extractProps-e9c55ba8.js');
10
+ const parseStates = require('./parseStates-d1effc19.js');
11
+ const extractProps = require('./extractProps-fd93ba62.js');
11
12
  const keys = require('./keys-cff24974.js');
12
13
 
13
14
  const USER_LOOKUP = index_module.dist.gql `
@@ -74,7 +75,7 @@ function useWidgetVerification() {
74
75
  const WidgetVerification = class {
75
76
  constructor(hostRef) {
76
77
  index.registerInstance(this, hostRef);
77
- // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
78
+ // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification AND sqm-partner-info-modal
78
79
  /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79
80
  GENERAL PROPS
80
81
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -285,7 +286,7 @@ function useDemoWidgetVerificationInternal(props) {
285
286
  initialValue: undefined,
286
287
  });
287
288
  const setContext = index_module.En(keys.VERIFICATION_PARENT_NAMESPACE);
288
- const states = extractProps.parseStates(props.stateController);
289
+ const states = parseStates.parseStates(props.stateController);
289
290
  const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-widget-verification"
290
291
  ? { ...prev, ...states[key] }
291
292
  : { ...prev, [`${key}_stateController`]: states[key] }, {});
@@ -2,6 +2,7 @@ import { isDemo } from "@saasquatch/component-boilerplate";
2
2
  import { useState, withHooks } from "@saasquatch/stencil-hooks";
3
3
  import { Component, Prop, h } from "@stencil/core";
4
4
  import deepmerge from "deepmerge";
5
+ import { parseStates } from "../../utils/parseStates";
5
6
  import { getProps } from "../../utils/utils";
6
7
  import { PartnerInfoModalView, } from "./sqm-partner-info-modal-view";
7
8
  import { usePartnerInfoModal } from "./usePartnerInfoModal";
@@ -88,6 +89,13 @@ export class PartnerInfoModal {
88
89
  * @uiWidget textArea
89
90
  */
90
91
  this.missingFieldsErrorText = "Please select both a country and currency.";
92
+ /**
93
+ * @undocumented
94
+ * @componentState { "title": "New partner", "props": { "states": { "open": true, "isExistingPartner": false } } }
95
+ * @componentState { "title": "Existing partner", "props": { "states": { "open": true, "isExistingPartner": true } } }
96
+ * @componentState { "title": "Connected (hidden)", "props": { "states": { "open": false } } }
97
+ */
98
+ this.stateController = "{}";
91
99
  withHooks(this);
92
100
  }
93
101
  disconnectedCallback() { }
@@ -419,6 +427,36 @@ export class PartnerInfoModal {
419
427
  "reflect": false,
420
428
  "defaultValue": "\"Please select both a country and currency.\""
421
429
  },
430
+ "stateController": {
431
+ "type": "string",
432
+ "mutable": false,
433
+ "complexType": {
434
+ "original": "string",
435
+ "resolved": "string",
436
+ "references": {}
437
+ },
438
+ "required": false,
439
+ "optional": false,
440
+ "docs": {
441
+ "tags": [{
442
+ "text": undefined,
443
+ "name": "undocumented"
444
+ }, {
445
+ "text": "{ \"title\": \"New partner\", \"props\": { \"states\": { \"open\": true, \"isExistingPartner\": false } } }",
446
+ "name": "componentState"
447
+ }, {
448
+ "text": "{ \"title\": \"Existing partner\", \"props\": { \"states\": { \"open\": true, \"isExistingPartner\": true } } }",
449
+ "name": "componentState"
450
+ }, {
451
+ "text": "{ \"title\": \"Connected (hidden)\", \"props\": { \"states\": { \"open\": false } } }",
452
+ "name": "componentState"
453
+ }],
454
+ "text": ""
455
+ },
456
+ "attribute": "state-controller",
457
+ "reflect": false,
458
+ "defaultValue": "\"{}\""
459
+ },
422
460
  "demoData": {
423
461
  "type": "unknown",
424
462
  "mutable": false,
@@ -455,6 +493,10 @@ function useDemoPartnerInfoModal(props) {
455
493
  const [countryCode, setCountryCode] = useState("US");
456
494
  const [currency, setCurrency] = useState("");
457
495
  const [error, setError] = useState("");
496
+ const states = parseStates(props.stateController);
497
+ const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-partner-info-modal"
498
+ ? { ...prev, ...states[key] }
499
+ : { ...prev, [`${key}_stateController`]: states[key] }, {});
458
500
  return deepmerge({
459
501
  states: {
460
502
  brandName: "Test Brand",
@@ -508,5 +550,5 @@ function useDemoPartnerInfoModal(props) {
508
550
  supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
509
551
  modalHeaderExistingPartner: props.modalHeaderExistingPartner,
510
552
  },
511
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
553
+ }, formatted || {}, { arrayMerge: (_, a) => a });
512
554
  }
@@ -1,7 +1,8 @@
1
- import { useLocale, useMutation, useQuery, } from "@saasquatch/component-boilerplate";
1
+ import { useLocale, useMutation, useQuery, useSetParent, } from "@saasquatch/component-boilerplate";
2
2
  import { useEffect, useState } from "@saasquatch/universal-hooks";
3
3
  import { gql } from "graphql-request";
4
4
  import { TAX_FORM_UPDATED_EVENT_KEY } from "../tax-and-cash/eventKeys";
5
+ import { VERIFICATION_PARENT_NAMESPACE } from "../sqm-widget-verification/keys";
5
6
  // new field under impactConnection:{ resolvedByEmail: boolean } - determines if connection came from managed identity
6
7
  export const GET_USER_PARTNER_INFO = gql `
7
8
  query getUserPartnerInfo {
@@ -91,6 +92,7 @@ const GET_BRAND_NAME = gql `
91
92
  export function usePartnerInfoModal(props) {
92
93
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
94
  const locale = useLocale();
95
+ const setVerificationContext = useSetParent(VERIFICATION_PARENT_NAMESPACE);
94
96
  const { data: userData, loading: userLoading, refetch, } = useQuery(GET_USER_PARTNER_INFO, {});
95
97
  const user = userData === null || userData === void 0 ? void 0 : userData.user;
96
98
  const { data: currenciesData, loading: currenciesLoading } = useQuery(GET_CURRENCIES, { variables: { locale } });
@@ -191,6 +193,7 @@ export function usePartnerInfoModal(props) {
191
193
  window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
192
194
  await refetch();
193
195
  setSuccess(true);
196
+ setVerificationContext(true);
194
197
  }
195
198
  catch (e) {
196
199
  console.error("Partner creation error:", e);
@@ -14,7 +14,7 @@ import { useWidgetVerification } from "./useWidgetVerification";
14
14
  */
15
15
  export class WidgetVerification {
16
16
  constructor() {
17
- // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
17
+ // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification AND sqm-partner-info-modal
18
18
  /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
19
  GENERAL PROPS
20
20
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -289,12 +289,12 @@ export const UserInfoFormView = (props) => {
289
289
  }
290
290
  // when creating an impact connection without sending phoneNumber data, the impactAPI defaults the value to "000000" and the phoneNumberCountryCode to "DZ"
291
291
  function isDisabledPartnerInput(field) {
292
- var _a;
293
- if (data.partnerData.phoneNumber === "0000000" &&
292
+ var _a, _b;
293
+ if (((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a.phoneNumber) === "0000000" &&
294
294
  (field === "phoneNumber" || field === "phoneNumberCountryCode")) {
295
295
  return false;
296
296
  }
297
- return states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]);
297
+ return states.isPartner && !!((_b = data.partnerData) === null || _b === void 0 ? void 0 : _b[field]);
298
298
  }
299
299
  function isDisabledUserInput(field) {
300
300
  var _a;
@@ -1,16 +1,3 @@
1
- function parseStates(states) {
2
- if (typeof states === "string") {
3
- try {
4
- return JSON.parse(states);
5
- }
6
- catch (e) {
7
- return undefined;
8
- }
9
- }
10
- if (typeof states === "object")
11
- return states;
12
- }
13
-
14
1
  /**
15
2
  * Util function for getting just the props with a certain prefix.
16
3
  * @param props Text props on stencil component
@@ -29,4 +16,4 @@ function extractProps(props, prefix) {
29
16
  return formattedProps;
30
17
  }
31
18
 
32
- export { extractProps as e, parseStates as p };
19
+ export { extractProps as e };