@saasquatch/mint-components 2.1.9-2 → 2.1.9-4

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 +12 -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 +5 -4
  11. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +42 -1
  12. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +3 -3
  13. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +3 -3
  14. package/dist/esm/{extractProps-54064fb0.js → extractProps-ae1afbb3.js} +1 -14
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/mint-components.js +1 -1
  17. package/dist/esm/parseStates-ed75e224.js +14 -0
  18. package/dist/esm/sqm-banking-info-form_10.entry.js +1 -1
  19. package/dist/esm/sqm-big-stat_45.entry.js +2 -1
  20. package/dist/esm/sqm-email-verification_2.entry.js +12 -1
  21. package/dist/esm/sqm-stencilbook.entry.js +1 -1
  22. package/dist/esm/{sqm-user-info-form-view-a18d6b15.js → sqm-user-info-form-view-ef04a79f.js} +3 -3
  23. package/dist/esm/sqm-widget-verification.entry.js +4 -3
  24. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  25. package/dist/esm-es5/loader.js +1 -1
  26. package/dist/esm-es5/mint-components.js +1 -1
  27. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  28. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  29. package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
  30. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  31. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  32. package/dist/esm-es5/{sqm-user-info-form-view-a18d6b15.js → sqm-user-info-form-view-ef04a79f.js} +1 -1
  33. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  34. package/dist/mint-components/mint-components.esm.js +1 -1
  35. package/dist/mint-components/{p-66c070e2.entry.js → p-10a54525.entry.js} +8 -8
  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-debe7d04.system.js → p-546a65c7.system.js} +1 -1
  42. package/dist/mint-components/{p-e6924adb.entry.js → p-5a446168.entry.js} +1 -1
  43. package/dist/mint-components/{p-1a0b9f0f.entry.js → p-5bbdeacd.entry.js} +2 -2
  44. package/dist/mint-components/{p-094edc0b.entry.js → p-6a754f51.entry.js} +1 -1
  45. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  46. package/dist/mint-components/{p-237a21c1.system.entry.js → p-adb56df3.system.entry.js} +1 -1
  47. package/dist/mint-components/p-aeb01a77.system.entry.js +1 -0
  48. package/dist/mint-components/p-cdc1f271.system.entry.js +1 -0
  49. package/dist/mint-components/{p-4fbfb954.system.entry.js → p-d2d2c4ea.system.entry.js} +1 -1
  50. package/dist/mint-components/{p-c7cac01e.entry.js → p-f50c3306.entry.js} +1 -1
  51. package/dist/mint-components/p-f5755143.system.entry.js +1 -0
  52. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +7 -0
  53. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +1 -1
  54. package/dist/types/components.d.ts +16 -2
  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
@@ -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
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -248,7 +249,7 @@ const WidgetVerification = class {
248
249
  * @undocumented
249
250
  * @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"], "uiGroup": "Email Verification Step" }
250
251
  * @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"], "uiGroup": "Code Verification Step" }
251
- * @componentState { "title": "Step 3: Create Partner", "props": { "showCode": false }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
252
+ * @componentState { "title": "Step 3: Create Partner", "props": { "showPartnerModal": true }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
252
253
  */
253
254
  this.stateController = "{}";
254
255
  domContextHooks_module.h$1(this);
@@ -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,7 @@ function useDemoPartnerInfoModal(props) {
455
493
  const [countryCode, setCountryCode] = useState("US");
456
494
  const [currency, setCurrency] = useState("");
457
495
  const [error, setError] = useState("");
496
+ const stateOverrides = parseStates(props.stateController) || {};
458
497
  return deepmerge({
459
498
  states: {
460
499
  brandName: "Test Brand",
@@ -508,5 +547,7 @@ function useDemoPartnerInfoModal(props) {
508
547
  supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
509
548
  modalHeaderExistingPartner: props.modalHeaderExistingPartner,
510
549
  },
511
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
550
+ }, deepmerge(stateOverrides, props.demoData || {}, {
551
+ arrayMerge: (_, a) => a,
552
+ }), { arrayMerge: (_, a) => a });
512
553
  }
@@ -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
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -188,7 +188,7 @@ export class WidgetVerification {
188
188
  * @undocumented
189
189
  * @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"], "uiGroup": "Email Verification Step" }
190
190
  * @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"], "uiGroup": "Code Verification Step" }
191
- * @componentState { "title": "Step 3: Create Partner", "props": { "showCode": false }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
191
+ * @componentState { "title": "Step 3: Create Partner", "props": { "showPartnerModal": true }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
192
192
  */
193
193
  this.stateController = "{}";
194
194
  withHooks(this);
@@ -958,7 +958,7 @@ export class WidgetVerification {
958
958
  "text": "{ \"title\": \"Step 2: Enter code\", \"props\": { \"showCode\": true }, \"dependencies\": [\"sqm-code-verification\"], \"uiGroup\": \"Code Verification Step\" }",
959
959
  "name": "componentState"
960
960
  }, {
961
- "text": "{ \"title\": \"Step 3: Create Partner\", \"props\": { \"showCode\": false }, \"dependencies\": [\"sqm-partner-info-modal\"], \"uiGroup\": \"Partner Creation Step\" }",
961
+ "text": "{ \"title\": \"Step 3: Create Partner\", \"props\": { \"showPartnerModal\": true }, \"dependencies\": [\"sqm-partner-info-modal\"], \"uiGroup\": \"Partner Creation Step\" }",
962
962
  "name": "componentState"
963
963
  }],
964
964
  "text": ""
@@ -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 };