@descope/flow-components 3.1.4 → 3.1.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.
- package/dist/fm/119.js +1 -1
- package/dist/fm/119.js.map +1 -1
- package/dist/fm/222.js +1 -1
- package/dist/fm/222.js.map +1 -1
- package/dist/fm/467.js +1 -1
- package/dist/fm/467.js.map +1 -1
- package/dist/fm/985.js +1 -1
- package/dist/fm/985.js.map +1 -1
- package/dist/fm/@mf-types.zip +0 -0
- package/dist/fm/__federation_expose_componentClasses.js +1 -1
- package/dist/fm/__federation_expose_componentClasses.js.map +1 -1
- package/dist/fm/__federation_expose_components.js +1 -1
- package/dist/fm/__federation_expose_theme.js +1 -1
- package/dist/fm/__federation_expose_theme.js.map +1 -1
- package/dist/fm/flowComponents.js +1 -1
- package/dist/fm/flowComponents.js.map +1 -1
- package/dist/fm/main.js +1 -1
- package/dist/fm/main.js.map +1 -1
- package/dist/fm/mf-manifest.json +1 -1
- package/dist/fm/mf-stats.json +1 -1
- package/dist/index.cjs.js +34 -12
- package/package.json +2 -2
package/dist/fm/mf-manifest.json
CHANGED
package/dist/fm/mf-stats.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -88530,10 +88530,14 @@ function requireIndex_cjs () {
|
|
|
88530
88530
|
return `<div data-id="${escapedStateCode}" data-name="${escapedSearchTerms}" data-label="${escapedLabel}">${escapedLabel}</div>`;
|
|
88531
88531
|
};
|
|
88532
88532
|
|
|
88533
|
-
const cityItem = ({ name }) => {
|
|
88533
|
+
const cityItem = ({ name, translations, lang }) => {
|
|
88534
|
+
const displayName = resolveTranslation({ name, translations }, lang);
|
|
88535
|
+
const searchTerms = [displayName];
|
|
88536
|
+
if (displayName !== name) searchTerms.push(name);
|
|
88534
88537
|
const escapedId = escapeHtml(name);
|
|
88535
|
-
const
|
|
88536
|
-
|
|
88538
|
+
const escapedSearchTerms = escapeHtml(searchTerms.join(' '));
|
|
88539
|
+
const escapedLabel = escapeHtml(displayName);
|
|
88540
|
+
return `<div data-id="${escapedId}" data-name="${escapedSearchTerms}" data-label="${escapedLabel}">${escapedLabel}</div>`;
|
|
88537
88541
|
};
|
|
88538
88542
|
|
|
88539
88543
|
const comboBoxHTML = (id) =>
|
|
@@ -88593,6 +88597,7 @@ function requireIndex_cjs () {
|
|
|
88593
88597
|
#countriesMap = new Map();
|
|
88594
88598
|
#cachedCountries = null;
|
|
88595
88599
|
#cachedSubdivisions = null;
|
|
88600
|
+
#cachedCities = null;
|
|
88596
88601
|
#labels = null;
|
|
88597
88602
|
|
|
88598
88603
|
// Value requested programmatically before data has loaded.
|
|
@@ -88639,8 +88644,8 @@ function requireIndex_cjs () {
|
|
|
88639
88644
|
const lang = this.getAttribute('lang') || undefined;
|
|
88640
88645
|
if (!lang) return undefined;
|
|
88641
88646
|
try {
|
|
88642
|
-
Intl.getCanonicalLocales(lang);
|
|
88643
|
-
return
|
|
88647
|
+
const [canonical] = Intl.getCanonicalLocales(lang);
|
|
88648
|
+
return canonical;
|
|
88644
88649
|
} catch {
|
|
88645
88650
|
return undefined; // invalid BCP47 tag — fall back to English
|
|
88646
88651
|
}
|
|
@@ -88823,8 +88828,11 @@ function requireIndex_cjs () {
|
|
|
88823
88828
|
|
|
88824
88829
|
#setupValueTransform() {
|
|
88825
88830
|
// Display only the item name in the input, while data-name includes ISO codes for search
|
|
88826
|
-
[
|
|
88827
|
-
|
|
88831
|
+
[
|
|
88832
|
+
this.#countryComboBox,
|
|
88833
|
+
this.#subdivisionComboBox,
|
|
88834
|
+
this.#cityComboBox,
|
|
88835
|
+
].forEach((combo) => {
|
|
88828
88836
|
combo.customValueTransformFn = (val) => {
|
|
88829
88837
|
const item = combo.baseElement?.items?.find(
|
|
88830
88838
|
(i) => i['data-name'] === val,
|
|
@@ -88969,7 +88977,11 @@ function requireIndex_cjs () {
|
|
|
88969
88977
|
if (cities) {
|
|
88970
88978
|
this.#cityVisible = cities.length > 0;
|
|
88971
88979
|
if (cities.length > 0) {
|
|
88972
|
-
this.#
|
|
88980
|
+
this.#cachedCities = cities;
|
|
88981
|
+
this.#cityComboBox.data = cities.map((c) => ({
|
|
88982
|
+
...c,
|
|
88983
|
+
lang: this.#lang,
|
|
88984
|
+
}));
|
|
88973
88985
|
if (pendingCity) toSelect.push([this.#cityComboBox, pendingCity]);
|
|
88974
88986
|
}
|
|
88975
88987
|
}
|
|
@@ -89080,7 +89092,6 @@ function requireIndex_cjs () {
|
|
|
89080
89092
|
if (!this.#pendingValue && this.#defaultCountry)
|
|
89081
89093
|
this.#onCountrySelected(this.#defaultCountry);
|
|
89082
89094
|
} catch (e) {
|
|
89083
|
-
|
|
89084
89095
|
console.error(`[${componentName$V}] Failed to load countries`, e);
|
|
89085
89096
|
} finally {
|
|
89086
89097
|
this.#countryComboBox.removeAttribute('loading');
|
|
@@ -89105,7 +89116,6 @@ function requireIndex_cjs () {
|
|
|
89105
89116
|
this.#loadCities(countryIso2);
|
|
89106
89117
|
}
|
|
89107
89118
|
} catch (e) {
|
|
89108
|
-
|
|
89109
89119
|
console.error(
|
|
89110
89120
|
`[${componentName$V}] Failed to load subdivisions for ${countryIso2}`,
|
|
89111
89121
|
e,
|
|
@@ -89127,10 +89137,13 @@ function requireIndex_cjs () {
|
|
|
89127
89137
|
this.#cityVisible = cities.length > 0;
|
|
89128
89138
|
this.#refreshState();
|
|
89129
89139
|
if (cities.length > 0) {
|
|
89130
|
-
this.#
|
|
89140
|
+
this.#cachedCities = cities;
|
|
89141
|
+
this.#cityComboBox.data = cities.map((c) => ({
|
|
89142
|
+
...c,
|
|
89143
|
+
lang: this.#lang,
|
|
89144
|
+
}));
|
|
89131
89145
|
}
|
|
89132
89146
|
} catch (e) {
|
|
89133
|
-
|
|
89134
89147
|
console.error(
|
|
89135
89148
|
`[${componentName$V}] Failed to load cities for ${countryIso2}${stateCode ? `/${stateCode}` : ''}`,
|
|
89136
89149
|
e,
|
|
@@ -89155,6 +89168,14 @@ function requireIndex_cjs () {
|
|
|
89155
89168
|
if (prevSubdivision)
|
|
89156
89169
|
this.#selectItemById(this.#subdivisionComboBox, prevSubdivision);
|
|
89157
89170
|
}
|
|
89171
|
+
if (this.#cachedCities && this.#cityVisible) {
|
|
89172
|
+
const prevCity = this.#cityComboBox.value;
|
|
89173
|
+
this.#cityComboBox.data = this.#cachedCities.map((c) => ({
|
|
89174
|
+
...c,
|
|
89175
|
+
lang: this.#lang,
|
|
89176
|
+
}));
|
|
89177
|
+
if (prevCity) this.#selectItemById(this.#cityComboBox, prevCity);
|
|
89178
|
+
}
|
|
89158
89179
|
// Re-apply translated subdivision type label for the new lang
|
|
89159
89180
|
const currentIso2 = this.#countryComboBox.value;
|
|
89160
89181
|
if (currentIso2) {
|
|
@@ -89268,6 +89289,7 @@ function requireIndex_cjs () {
|
|
|
89268
89289
|
#resetCity() {
|
|
89269
89290
|
this.#cityComboBox.value = '';
|
|
89270
89291
|
this.#cityComboBox.data = [];
|
|
89292
|
+
this.#cachedCities = null;
|
|
89271
89293
|
this.#cityVisible = false;
|
|
89272
89294
|
this.#refreshState();
|
|
89273
89295
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/flow-components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -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.
|
|
100
|
+
"@descope/web-components-ui": "3.1.5"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"react": ">= 18"
|