@descope/flow-components 3.1.9 → 3.1.11

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.
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.1.9",
8
+ "buildVersion": "3.1.11",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.1.9",
8
+ "buildVersion": "3.1.11",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
package/dist/index.cjs.js CHANGED
@@ -103758,13 +103758,21 @@ descope-enriched-text {
103758
103758
  });
103759
103759
  }
103760
103760
 
103761
+ #getDefaultDialCode() {
103762
+ const code = this.getAttribute('default-code');
103763
+ const match = code && PhoneFieldClass.CountryCodes.find((c) => c.code === code);
103764
+ return match?.dialCode || PhoneFieldClass.CountryCodes[0]?.dialCode || '';
103765
+ }
103766
+
103761
103767
  setActiveInputValue(val) {
103762
103768
  const sanitizedVal = sanitizeCountryCodePrefix(val);
103763
103769
  const isPhoneField = this.activeInput.localName === PHONE_FIELD;
103764
- const value = isPhoneField
103765
- ? `${this.phoneCountryCodeInput.countryCodeItems}-${sanitizedVal}`
103766
- : sanitizedVal;
103767
- this.activeInput.value = value;
103770
+ if (isPhoneField) {
103771
+ const dialCode = this.phoneCountryCodeInput.countryCodeItems || this.#getDefaultDialCode();
103772
+ this.activeInput.value = `${dialCode}-${sanitizedVal}`;
103773
+ } else {
103774
+ this.activeInput.value = sanitizedVal;
103775
+ }
103768
103776
  }
103769
103777
 
103770
103778
  toggleInputVisibility() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "3.1.9",
3
+ "version": "3.1.11",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -59,7 +59,7 @@
59
59
  "eslint-config-standard": "17.1.0",
60
60
  "eslint-import-resolver-typescript": "4.4.4",
61
61
  "eslint-plugin-import": "2.32.0",
62
- "eslint-plugin-jest": "29.15.0",
62
+ "eslint-plugin-jest": "29.15.1",
63
63
  "eslint-plugin-jest-dom": "5.5.0",
64
64
  "eslint-plugin-jest-formatting": "3.1.0",
65
65
  "eslint-plugin-jsx-a11y": "^6.6.1",
@@ -97,7 +97,7 @@
97
97
  "webpack-subresource-integrity": "5.2.0-rc.1"
98
98
  },
99
99
  "dependencies": {
100
- "@descope/web-components-ui": "3.1.9"
100
+ "@descope/web-components-ui": "3.1.11"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "react": ">= 18"