@lion/ui 0.11.5 → 0.12.0

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 (72) hide show
  1. package/README.md +1 -1
  2. package/components/input-amount/src/parsers.js +1 -1
  3. package/components/input-amount/test/parsers.test.js +5 -0
  4. package/components/input-tel/src/LionInputTel.js +15 -2
  5. package/components/input-tel/test-suites/LionInputTel.suite.js +26 -1
  6. package/components/input-tel-dropdown/src/LionInputTelDropdown.js +3 -16
  7. package/components/input-tel-dropdown/src/regionCodeToLocale.js +10 -0
  8. package/components/input-tel-dropdown/test/regionCodeToLocale.test.js +10 -0
  9. package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +69 -1
  10. package/custom-elements.json +74 -17
  11. package/dist-types/components/input-tel/src/LionInputTel.d.ts +8 -0
  12. package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
  13. package/dist-types/components/input-tel/test-suites/LionInputTel.suite.d.ts.map +1 -1
  14. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +0 -10
  15. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
  16. package/dist-types/components/input-tel-dropdown/src/regionCodeToLocale.d.ts +7 -0
  17. package/dist-types/components/input-tel-dropdown/src/regionCodeToLocale.d.ts.map +1 -0
  18. package/dist-types/components/input-tel-dropdown/test/regionCodeToLocale.test.d.ts +2 -0
  19. package/dist-types/components/input-tel-dropdown/test/regionCodeToLocale.test.d.ts.map +1 -0
  20. package/dist-types/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.d.ts.map +1 -1
  21. package/dist-types/tsconfig.tsbuildinfo +1 -1
  22. package/docs/components/checkbox-group/overview.md +2 -2
  23. package/docs/components/collapsible/overview.md +1 -1
  24. package/docs/components/combobox/overview.md +1 -1
  25. package/docs/components/combobox/use-cases.md +1 -1
  26. package/docs/components/dialog/overview.md +1 -1
  27. package/docs/components/fieldset/overview.md +5 -5
  28. package/docs/components/form/overview.md +3 -3
  29. package/docs/components/form/use-cases.md +2 -2
  30. package/docs/components/icon/use-cases.md +1 -1
  31. package/docs/components/input/overview.md +1 -1
  32. package/docs/components/input-amount/overview.md +3 -3
  33. package/docs/components/input-date/overview.md +3 -3
  34. package/docs/components/input-datepicker/overview.md +5 -5
  35. package/docs/components/input-email/overview.md +2 -2
  36. package/docs/components/input-file/overview.md +1 -1
  37. package/docs/components/input-iban/overview.md +2 -2
  38. package/docs/components/input-range/overview.md +2 -2
  39. package/docs/components/input-stepper/overview.md +1 -1
  40. package/docs/components/input-tel/api-table.md +2 -0
  41. package/docs/components/input-tel/overview.md +1 -1
  42. package/docs/components/input-tel/use-cases.md +6 -6
  43. package/docs/components/input-tel-dropdown/api-table.md +2 -2
  44. package/docs/components/input-tel-dropdown/overview.md +1 -1
  45. package/docs/components/listbox/use-cases.md +1 -1
  46. package/docs/components/radio-group/overview.md +3 -3
  47. package/docs/components/select/use-cases.md +1 -1
  48. package/docs/components/select-rich/use-cases.md +1 -1
  49. package/docs/components/tabs/examples.md +1 -1
  50. package/docs/fundamentals/index.md +4 -4
  51. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  52. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  53. package/docs/fundamentals/rationales/accessibility.md +1 -1
  54. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  55. package/docs/fundamentals/systems/core/overview.md +1 -1
  56. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  57. package/docs/fundamentals/systems/form/model-value.md +1 -1
  58. package/docs/fundamentals/systems/form/overview.md +28 -28
  59. package/docs/fundamentals/systems/form/validate.md +2 -2
  60. package/docs/fundamentals/systems/localize/overview.md +4 -4
  61. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  62. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  63. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  64. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  65. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  66. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  67. package/docs/guides/how-to/create-a-form.md +4 -4
  68. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  69. package/docs/guides/index.md +8 -8
  70. package/docs/guides/principles/index.md +5 -5
  71. package/docs/guides/principles/styling.md +1 -1
  72. package/package.json +1 -1
package/README.md CHANGED
@@ -44,7 +44,7 @@ They provide an unopinionated, white-label layer that can be extended to your ow
44
44
  - **High Performance:** Focused on great performance in all relevant browsers with a minimal number of dependencies.
45
45
  - **Accessibility:** Aimed at compliance with the WCAG 2.2 AA standard to create components that are accessible for everybody.
46
46
  - **Flexibility:** Provides solutions through Web Components and JavaScript classes which can be used, adopted and extended to fit all needs.
47
- - **Modern Code:** Lion is distributed as pure es modules.
47
+ - **Modern Code:** Lion is distributed as pure ES modules.
48
48
  - **Exposes functions/classes and Web Components:** Ships a functionality in its most appropriate form.
49
49
 
50
50
  > Note: Our demo examples might look simple and not very stylish. This is on purpose. They are designed to be basic so you can easily add your own styles to them to match your intended design, without dealing with styles that are already there.
@@ -31,7 +31,7 @@ function round(value, decimals) {
31
31
  * @param {FormatNumberOptions} [givenOptions] Locale Options
32
32
  */
33
33
  export function parseAmount(value, givenOptions) {
34
- const unmatchedInput = value.match(/[^0-9,.\- ]/g);
34
+ const unmatchedInput = value.match(/[^0-9,.\-\u2212 ]/g);
35
35
  // for the full paste behavior documentation:
36
36
  // ./docs/components/input-amount/use-cases.md#paste-behavior
37
37
  if (unmatchedInput && givenOptions?.mode !== 'pasted') {
@@ -71,4 +71,9 @@ describe('parseAmount()', async () => {
71
71
  parseAmount('123.456,78', { mode: 'user-edited', viewValueStates: ['formatted'] }),
72
72
  ).to.equal(123456.78);
73
73
  });
74
+
75
+ it('parses negative numbers', async () => {
76
+ expect(parseAmount('−15.00')).to.equal(-15);
77
+ expect(parseAmount('-333.33')).to.equal(-333.33);
78
+ });
74
79
  });
@@ -27,6 +27,7 @@ export class LionInputTel extends LocalizeMixin(LionInput) {
27
27
  formatStrategy: { type: String, attribute: 'format-strategy' },
28
28
  formatCountryCodeStyle: { type: String, attribute: 'format-country-code-style' },
29
29
  activeRegion: { type: String },
30
+ preferredRegions: { type: Array },
30
31
  _phoneUtil: { type: Object, state: true },
31
32
  };
32
33
 
@@ -156,6 +157,12 @@ export class LionInputTel extends LocalizeMixin(LionInput) {
156
157
  */
157
158
  this.allowedRegions = [];
158
159
 
160
+ /**
161
+ * Regions that will be shown on top of the dropdown
162
+ * @type {RegionCode[]}
163
+ */
164
+ this.preferredRegions = [];
165
+
159
166
  /** @private */
160
167
  this.__isPhoneNumberValidatorInstance = new PhoneNumber();
161
168
  /** @configures ValidateMixin */
@@ -326,13 +333,19 @@ export class LionInputTel extends LocalizeMixin(LionInput) {
326
333
  return;
327
334
  }
328
335
 
329
- // 3. Try to get the region from locale
336
+ // 3. Get the first region in the list of preferred regions
337
+ if (this.preferredRegions?.length > 0) {
338
+ this._setActiveRegion(this.preferredRegions[0]);
339
+ return;
340
+ }
341
+
342
+ // 4. Try to get the region from locale
330
343
  if (this._langIso && this._allowedOrAllRegions.includes(this._langIso)) {
331
344
  this._setActiveRegion(this._langIso);
332
345
  return;
333
346
  }
334
347
 
335
- // 4. Not derivable
348
+ // 5. Not derivable
336
349
  this._setActiveRegion(undefined);
337
350
  }
338
351
  }
@@ -100,6 +100,20 @@ function runActiveRegionTests({ tag, phoneUtilLoadedAfterInit }) {
100
100
  expect(el.activeRegion).to.equal('NL');
101
101
  });
102
102
 
103
+ it('.modelValue takes precedence over .preferredRegions when both preconfigured and .modelValue updated', async () => {
104
+ const el = await fixture(
105
+ html` <${tag} .preferredRegions="${[
106
+ 'DE',
107
+ 'BE',
108
+ ]}" .modelValue="${'+31612345678'}" ></${tag}> `,
109
+ );
110
+ if (resolvePhoneUtilLoaded) {
111
+ resolvePhoneUtilLoaded(undefined);
112
+ await el.updateComplete;
113
+ }
114
+ expect(el.activeRegion).to.equal('NL');
115
+ });
116
+
103
117
  it('deducts it from value when modelValue is unparseable', async () => {
104
118
  const modelValue = new Unparseable('+316');
105
119
  const el = await fixture(html` <${tag} .modelValue=${modelValue}></${tag}> `);
@@ -122,7 +136,18 @@ function runActiveRegionTests({ tag, phoneUtilLoadedAfterInit }) {
122
136
  expect(el.activeRegion).to.equal('NL');
123
137
  });
124
138
 
125
- // 3. **locale**: try to get the region from locale (`html[lang]` attribute)
139
+ // 3. **preferred-region**: get the first element in the preferred regions list
140
+ it('deducts it from the .preferredRegions when provided', async () => {
141
+ const el = await fixture(html` <${tag} .preferredRegions="${['DE', 'NL']}"></${tag}> `);
142
+ if (resolvePhoneUtilLoaded) {
143
+ resolvePhoneUtilLoaded(undefined);
144
+ await el.updateComplete;
145
+ }
146
+ // Region code for country code '+49' is 'DE'
147
+ expect(el.activeRegion).to.equal('DE');
148
+ });
149
+
150
+ // 4. **locale**: try to get the region from locale (`html[lang]` attribute)
126
151
  it('automatically bases it on current locale when nothing preconfigured', async () => {
127
152
  const el = await fixture(html` <${tag}></${tag}> `);
128
153
  if (resolvePhoneUtilLoaded) {
@@ -4,6 +4,7 @@ import { ref, createRef } from 'lit/directives/ref.js';
4
4
  import { LionInputTel } from '@lion/ui/input-tel.js';
5
5
  import { getLocalizeManager } from '@lion/ui/localize-no-side-effects.js';
6
6
  import { getFlagSymbol } from './getFlagSymbol.js';
7
+ import { regionCodeToLocale } from './regionCodeToLocale.js';
7
8
 
8
9
  /**
9
10
  * Note: one could consider to implement LionInputTelDropdown as a
@@ -41,14 +42,6 @@ import { getFlagSymbol } from './getFlagSymbol.js';
41
42
  * `e164` format that contains all info (both region code and national phone number).
42
43
  */
43
44
  export class LionInputTelDropdown extends LionInputTel {
44
- /**
45
- * @configure LitElement
46
- * @type {any}
47
- */
48
- static properties = {
49
- preferredRegions: { type: Array },
50
- };
51
-
52
45
  refs = {
53
46
  /** @type {DropdownRef} */
54
47
  dropdown: /** @type {DropdownRef} */ (createRef()),
@@ -193,8 +186,7 @@ export class LionInputTelDropdown extends LionInputTel {
193
186
  onLocaleUpdated() {
194
187
  super.onLocaleUpdated();
195
188
 
196
- // @ts-expect-error relatively new platform api
197
- this.__namesForLocale = new Intl.DisplayNames([this._langIso], {
189
+ this.__namesForLocale = new Intl.DisplayNames([this._localizeManager.locale], {
198
190
  type: 'region',
199
191
  });
200
192
  this.__createRegionMeta();
@@ -214,11 +206,6 @@ export class LionInputTelDropdown extends LionInputTel {
214
206
  constructor() {
215
207
  super();
216
208
 
217
- /**
218
- * Regions that will be shown on top of the dropdown
219
- * @type {string[]}
220
- */
221
- this.preferredRegions = [];
222
209
  /**
223
210
  * Group label for all countries, when preferredCountries are shown
224
211
  * @protected
@@ -408,7 +395,7 @@ export class LionInputTelDropdown extends LionInputTel {
408
395
  this.__regionMetaListPreferred = [];
409
396
  this._allowedOrAllRegions.forEach(regionCode => {
410
397
  // @ts-ignore relatively new platform api
411
- const namesForRegion = new Intl.DisplayNames([regionCode.toLowerCase()], {
398
+ const namesForRegion = new Intl.DisplayNames([regionCodeToLocale(regionCode)], {
412
399
  type: 'region',
413
400
  });
414
401
  const countryCode =
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Get the full locale for a region.
3
+ * As we don't know the language for that region, we first set it as 'und', which stands for 'undetermined'.
4
+ * @param {string} regionCode
5
+ */
6
+ export function regionCodeToLocale(regionCode) {
7
+ const locale = new Intl.Locale('und', { region: regionCode }); // Set language as undetermined.
8
+ const maximizedLocale = locale.maximize(); // Determine the most likely full locale for a region with an undetermined language.
9
+ return maximizedLocale.baseName;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import { regionCodeToLocale } from '../src/regionCodeToLocale.js';
3
+
4
+ describe('regionCodeToLocale', () => {
5
+ it('returns the most likely locale basename for a region', () => {
6
+ expect(regionCodeToLocale('NL')).to.equal('nl-Latn-NL');
7
+ expect(regionCodeToLocale('FR')).to.equal('fr-Latn-FR');
8
+ expect(regionCodeToLocale('DE')).to.equal('de-Latn-DE');
9
+ });
10
+ });
@@ -133,7 +133,7 @@ export function runInputTelDropdownSuite({ klass } = { klass: LionInputTelDropdo
133
133
  countryCode: 63,
134
134
  flagSymbol: '🇵🇭',
135
135
  nameForLocale: 'Philippines',
136
- nameForRegion: 'Philippines',
136
+ nameForRegion: 'Pilipinas',
137
137
  regionCode: 'PH',
138
138
  },
139
139
  ],
@@ -239,6 +239,74 @@ export function runInputTelDropdownSuite({ klass } = { klass: LionInputTelDropdo
239
239
  restorePhoneUtilManager();
240
240
  spy.restore();
241
241
  });
242
+
243
+ it('has the correct nameForLocale, based on browser language', async () => {
244
+ const el = fixtureSync(html` <${tag}
245
+ .modelValue="${'+31612345678'}"
246
+ .allowedRegions="${['NL', 'PH']}"
247
+ .preferredRegions="${['PH']}"
248
+ ></${tag}> `);
249
+ const spy = sinon.spy(
250
+ /** @type {typeof LionInputTelDropdown} */ (el.constructor).templates,
251
+ 'dropdown',
252
+ );
253
+ // @ts-ignore
254
+ const originalLocale = el._localizeManager.locale;
255
+ // @ts-ignore
256
+ el._localizeManager.locale = 'fr-BE';
257
+ await el.updateComplete;
258
+ const dropdownNode = el.refs.dropdown.value;
259
+ const templateDataForDropdown = /** @type {TemplateDataForDropdownInputTel} */ (
260
+ spy.args[0][0]
261
+ );
262
+ expect(templateDataForDropdown).to.eql(
263
+ /** @type {TemplateDataForDropdownInputTel} */ ({
264
+ data: {
265
+ activeRegion: 'NL',
266
+ regionMetaList: [
267
+ {
268
+ countryCode: 31,
269
+ flagSymbol: '🇳🇱',
270
+ nameForLocale: 'Pays-Bas',
271
+ nameForRegion: 'Nederland',
272
+ regionCode: 'NL',
273
+ },
274
+ ],
275
+ regionMetaListPreferred: [
276
+ {
277
+ countryCode: 63,
278
+ flagSymbol: '🇵🇭',
279
+ nameForLocale: 'Philippines',
280
+ nameForRegion: 'Pilipinas',
281
+ regionCode: 'PH',
282
+ },
283
+ ],
284
+ },
285
+ refs: {
286
+ dropdown: {
287
+ labels: {
288
+ allCountries: 'Tous les pays',
289
+ preferredCountries: 'Pays suggérés',
290
+ selectCountry: 'Sélectionnez un pays',
291
+ },
292
+ listeners: {
293
+ // @ts-expect-error [allow-protected]
294
+ change: el._onDropdownValueChange,
295
+ // @ts-expect-error [allow-protected]
296
+ 'model-value-changed': el._onDropdownValueChange,
297
+ },
298
+ props: { style: 'height: 100%;' },
299
+ ref: { value: dropdownNode },
300
+ },
301
+ // @ts-expect-error [allow-protected]
302
+ input: el._inputNode,
303
+ },
304
+ }),
305
+ );
306
+ spy.restore();
307
+ // @ts-ignore
308
+ el._localizeManager.locale = originalLocale; // restore the locale back to original
309
+ });
242
310
  });
243
311
 
244
312
  describe('On dropdown value change', () => {
@@ -97081,11 +97081,15 @@
97081
97081
  "name": "preferredRegions",
97082
97082
  "privacy": "public",
97083
97083
  "type": {
97084
- "text": "string[]"
97084
+ "text": "RegionCode[]"
97085
97085
  },
97086
97086
  "description": "Regions that will be shown on top of the dropdown",
97087
97087
  "default": "[]",
97088
- "attribute": "preferredRegions"
97088
+ "attribute": "preferredRegions",
97089
+ "inheritedFrom": {
97090
+ "name": "LionInputTel",
97091
+ "module": "components/input-tel/src/LionInputTel.js"
97092
+ }
97089
97093
  },
97090
97094
  {
97091
97095
  "kind": "field",
@@ -99277,16 +99281,13 @@
99277
99281
  }
99278
99282
  }
99279
99283
  ],
99284
+ "superclass": {
99285
+ "name": "LionInputTel",
99286
+ "package": "@lion/ui/input-tel.js"
99287
+ },
99288
+ "tagName": "lion-input-tel-dropdown",
99289
+ "customElement": true,
99280
99290
  "attributes": [
99281
- {
99282
- "name": "preferredRegions",
99283
- "type": {
99284
- "text": "string[]"
99285
- },
99286
- "description": "Regions that will be shown on top of the dropdown",
99287
- "default": "[]",
99288
- "fieldName": "preferredRegions"
99289
- },
99290
99291
  {
99291
99292
  "name": "allowedRegions",
99292
99293
  "type": {
@@ -99339,6 +99340,19 @@
99339
99340
  "module": "components/input-tel/src/LionInputTel.js"
99340
99341
  }
99341
99342
  },
99343
+ {
99344
+ "name": "preferredRegions",
99345
+ "type": {
99346
+ "text": "RegionCode[]"
99347
+ },
99348
+ "description": "Regions that will be shown on top of the dropdown",
99349
+ "default": "[]",
99350
+ "fieldName": "preferredRegions",
99351
+ "inheritedFrom": {
99352
+ "name": "LionInputTel",
99353
+ "module": "components/input-tel/src/LionInputTel.js"
99354
+ }
99355
+ },
99342
99356
  {
99343
99357
  "name": "_phoneUtil",
99344
99358
  "type": {
@@ -99605,12 +99619,6 @@
99605
99619
  }
99606
99620
  }
99607
99621
  ],
99608
- "superclass": {
99609
- "name": "LionInputTel",
99610
- "package": "@lion/ui/input-tel.js"
99611
- },
99612
- "tagName": "lion-input-tel-dropdown",
99613
- "customElement": true,
99614
99622
  "events": [
99615
99623
  {
99616
99624
  "name": "model-value-changed",
@@ -100655,6 +100663,17 @@
100655
100663
  "module": "components/input/src/LionInput.js"
100656
100664
  }
100657
100665
  },
100666
+ {
100667
+ "kind": "field",
100668
+ "name": "preferredRegions",
100669
+ "privacy": "public",
100670
+ "type": {
100671
+ "text": "RegionCode[]"
100672
+ },
100673
+ "description": "Regions that will be shown on top of the dropdown",
100674
+ "default": "[]",
100675
+ "attribute": "preferredRegions"
100676
+ },
100658
100677
  {
100659
100678
  "kind": "field",
100660
100679
  "name": "prefilled",
@@ -102750,6 +102769,15 @@
102750
102769
  "readonly": true,
102751
102770
  "fieldName": "activeRegion"
102752
102771
  },
102772
+ {
102773
+ "name": "preferredRegions",
102774
+ "type": {
102775
+ "text": "RegionCode[]"
102776
+ },
102777
+ "description": "Regions that will be shown on top of the dropdown",
102778
+ "default": "[]",
102779
+ "fieldName": "preferredRegions"
102780
+ },
102753
102781
  {
102754
102782
  "name": "_phoneUtil",
102755
102783
  "type": {
@@ -145405,6 +145433,35 @@
145405
145433
  }
145406
145434
  ]
145407
145435
  },
145436
+ {
145437
+ "kind": "javascript-module",
145438
+ "path": "components/input-tel-dropdown/src/regionCodeToLocale.js",
145439
+ "declarations": [
145440
+ {
145441
+ "kind": "function",
145442
+ "name": "regionCodeToLocale",
145443
+ "parameters": [
145444
+ {
145445
+ "name": "regionCode",
145446
+ "type": {
145447
+ "text": "string"
145448
+ }
145449
+ }
145450
+ ],
145451
+ "description": "Get the full locale for a region.\nAs we don't know the language for that region, we first set it as 'und', which stands for 'undetermined'."
145452
+ }
145453
+ ],
145454
+ "exports": [
145455
+ {
145456
+ "kind": "js",
145457
+ "name": "regionCodeToLocale",
145458
+ "declaration": {
145459
+ "name": "regionCodeToLocale",
145460
+ "module": "components/input-tel-dropdown/src/regionCodeToLocale.js"
145461
+ }
145462
+ }
145463
+ ]
145464
+ },
145408
145465
  {
145409
145466
  "kind": "javascript-module",
145410
145467
  "path": "components/input-tel/src/parsers.js",
@@ -26,6 +26,9 @@ export class LionInputTel extends LionInputTel_base {
26
26
  activeRegion: {
27
27
  type: StringConstructor;
28
28
  };
29
+ preferredRegions: {
30
+ type: ArrayConstructor;
31
+ };
29
32
  _phoneUtil: {
30
33
  type: ObjectConstructor;
31
34
  state: boolean;
@@ -105,6 +108,11 @@ export class LionInputTel extends LionInputTel_base {
105
108
  * @type {RegionCode[]}
106
109
  */
107
110
  allowedRegions: RegionCode[];
111
+ /**
112
+ * Regions that will be shown on top of the dropdown
113
+ * @type {RegionCode[]}
114
+ */
115
+ preferredRegions: RegionCode[];
108
116
  /** @private */
109
117
  private __isPhoneNumberValidatorInstance;
110
118
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"LionInputTel.d.ts","sourceRoot":"","sources":["../../../../components/input-tel/src/LionInputTel.js"],"names":[],"mappings":";AAWA;;;;;;;GAOG;AAEH;IACE;;OAEG;IACH;;;;;;;;;;;;;;;;;;;MAME;IAEF,kGAGE;IAgBF,mFAAsB;IAdtB;;;;;;;OAOG;IACH,gFAEC;IAoCD,6CAA+B;IA9B/B;;;;;;;;;;;;;;;;OAgBG;IACH,0CASC;IAMD;;;;OAIG;IACH,qCAFW,UAAU,GAAC,SAAS,QAM9B;IAFC,mEAA8B;IAIhC;;;;OAIG;IACH,qEAMC;IAED;;;;OAIG;IAEH,6DAEC;IAED;;;;OAIG;IAGH,wBAEC;IAQC;;;;;OAKG;IACH,gBAFU,iBAAiB,CAEU;IAErC;;;;OAIG;IACH,wBAFU,MAAM,CAEuB;IAEvC;;;;OAIG;IACH,gBAFU,UAAU,EAAE,CAEE;IAExB,eAAe;IACf,yCAAyD;IAKzD;;;OAGG;IACH,sBAFU,kBAAkB,GAAC,IAAI,CAIzB;IA2BN,oDAAkD;IAiCpD;;;OAGG;IACH,uEAEC;IAIH;;;;OAIG;IACH,sBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;;OAOG;IACH,wBANW,MAAM;QAEU,aAAa,EAA7B,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACJ;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;KAAE,GAAG,SAAS,CAUlE;IAaD;;OAEG;IACH,0CAOC;IAED;;OAEG;IACH,gCA4BC;CACF;yBArUY,OAAO,mBAAmB,EAAE,UAAU;gCACtC,OAAO,qBAAqB,EAAE,iBAAiB;+BAC/C,OAAO,qBAAqB,EAAE,gBAAgB;4BAC9C,OAAO,2CAA2C,EAAE,aAAa;iCACjE,0CAAiC;+BACjC,aAAa,GAAG;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,iBAAiB,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAC;CAAC"}
1
+ {"version":3,"file":"LionInputTel.d.ts","sourceRoot":"","sources":["../../../../components/input-tel/src/LionInputTel.js"],"names":[],"mappings":";AAWA;;;;;;;GAOG;AAEH;IACE;;OAEG;IACH;;;;;;;;;;;;;;;;;;;;;;MAOE;IAEF,kGAGE;IAgBF,mFAAsB;IAdtB;;;;;;;OAOG;IACH,gFAEC;IAoCD,6CAA+B;IA9B/B;;;;;;;;;;;;;;;;OAgBG;IACH,0CASC;IAMD;;;;OAIG;IACH,qCAFW,UAAU,GAAC,SAAS,QAM9B;IAFC,mEAA8B;IAIhC;;;;OAIG;IACH,qEAMC;IAED;;;;OAIG;IAEH,6DAEC;IAED;;;;OAIG;IAGH,wBAEC;IAQC;;;;;OAKG;IACH,gBAFU,iBAAiB,CAEU;IAErC;;;;OAIG;IACH,wBAFU,MAAM,CAEuB;IAEvC;;;;OAIG;IACH,gBAFU,UAAU,EAAE,CAEE;IAExB;;;OAGG;IACH,kBAFU,UAAU,EAAE,CAEI;IAE1B,eAAe;IACf,yCAAyD;IAKzD;;;OAGG;IACH,sBAFU,kBAAkB,GAAC,IAAI,CAIzB;IA2BN,oDAAkD;IAiCpD;;;OAGG;IACH,uEAEC;IAIH;;;;OAIG;IACH,sBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;;OAOG;IACH,wBANW,MAAM;QAEU,aAAa,EAA7B,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACJ;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;KAAE,GAAG,SAAS,CAUlE;IAaD;;OAEG;IACH,0CAOC;IAED;;OAEG;IACH,gCAkCC;CACF;yBAlVY,OAAO,mBAAmB,EAAE,UAAU;gCACtC,OAAO,qBAAqB,EAAE,iBAAiB;+BAC/C,OAAO,qBAAqB,EAAE,gBAAgB;4BAC9C,OAAO,2CAA2C,EAAE,aAAa;iCACjE,0CAAiC;+BACjC,aAAa,GAAG;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,iBAAiB,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAC;CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LionInputTel.suite.d.ts","sourceRoot":"","sources":["../../../../components/input-tel/test-suites/LionInputTel.suite.js"],"names":[],"mappings":"AAwJA;;GAEG;AAEH,6CAHW;IAAE,KAAK,EAAC,YAAY,CAAA;CAAE,QAkThC;6BA1bY,OAAO,KAAK,EAAE,cAAc;yBAC5B,OAAO,mBAAmB,EAAE,UAAU"}
1
+ {"version":3,"file":"LionInputTel.suite.d.ts","sourceRoot":"","sources":["../../../../components/input-tel/test-suites/LionInputTel.suite.js"],"names":[],"mappings":"AAiLA;;GAEG;AAEH,6CAHW;IAAE,KAAK,EAAC,YAAY,CAAA;CAAE,QAkThC;6BAndY,OAAO,KAAK,EAAE,cAAc;yBAC5B,OAAO,mBAAmB,EAAE,UAAU"}
@@ -32,11 +32,6 @@
32
32
  * `e164` format that contains all info (both region code and national phone number).
33
33
  */
34
34
  export class LionInputTelDropdown extends LionInputTel {
35
- /**
36
- * @configure LitElement
37
- * @type {any}
38
- */
39
- static properties: any;
40
35
  static templates: {
41
36
  dropdown: (templateDataForDropdown: TemplateDataForDropdownInputTel) => import("lit-html").TemplateResult<1>;
42
37
  /**
@@ -91,11 +86,6 @@ export class LionInputTelDropdown extends LionInputTel {
91
86
  input: () => HTMLInputElement;
92
87
  };
93
88
  __namesForLocale: Intl.DisplayNames | undefined;
94
- /**
95
- * Regions that will be shown on top of the dropdown
96
- * @type {string[]}
97
- */
98
- preferredRegions: string[];
99
89
  /**
100
90
  * Group label for all countries, when preferredCountries are shown
101
91
  * @protected
@@ -1 +1 @@
1
- {"version":3,"file":"LionInputTelDropdown.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/src/LionInputTelDropdown.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH;IACE;;;OAGG;IACH,mBAFU,GAAG,CAIX;IAkEF;4CACwB,+BAA+B;QA0BrD;;;WAGG;kDAFQ,+BAA+B,2CAC/B,UAAU;MAMrB;IAEF;;;OAGG;IACH,0EAaE;IAtHF;QACE,0BAA0B;kBAAf,WAAW;MAEtB;IAEF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,yFAgCC;IA0DD;;OAEG;IACH;;;;;;MAaC;IASC,gDAEE;IAkBF;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEQ;IAC1B;;;OAGG;IACH,qCAA4B;IAC5B;;;OAGG;IACH,2CAAkC;IAElC;;;;;OAKG;IACH,yBAA0B;IAE1B;;;;OAIG;IACH,kCAAmC;IA8ErC;;;OAGG;IACH,wCAFW,qBAAqB,QAoC/B;IAED;;OAEG;IACH,iCAwBC;IAlGD;;OAEG;IACH,iDAaC;IATK,4CAAkD;IAWxD;;;;;;;OAOG;IACH,gCAJW,MAAM,GACL,OAAO,CAMlB;IAuED;;;;;;;;OAQG;IACH,2BA6BC;IAED;;;;;;;;OAQG;IAEH,6CAEC;CACF;kBAxaY,OAAO,uBAAuB,EAAE,GAAG;4BACnC,OAAO,KAAK,EAAE,aAAa;yBAC3B,OAAO,2CAA2C,EAAE,UAAU;yBAC9D,OAAO,gCAAgC,EAAE,UAAU;8CACnD,OAAO,mBAAmB,EAAE,+BAA+B;oCAC3D,OAAO,mBAAmB,EAAE,qBAAqB;0BACjD,OAAO,mBAAmB,EAAE,WAAW;yBACvC,OAAO,mBAAmB,EAAE,UAAU;6BACtC,OAAO,yCAAyC,EAAE,cAAc;gCAChE,OAAO,yCAAyC,EAAE,iBAAiB;0CACnE,+BAA+B,GAAG;IAAC,IAAI,EAAE;QAAC,cAAc,EAAC,UAAU,EAAE,CAAA;KAAC,CAAA;CAAC"}
1
+ {"version":3,"file":"LionInputTelDropdown.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/src/LionInputTelDropdown.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH;IAiEE;4CACwB,+BAA+B;QA0BrD;;;WAGG;kDAFQ,+BAA+B,2CAC/B,UAAU;MAMrB;IAEF;;;OAGG;IACH,0EAaE;IAtHF;QACE,0BAA0B;kBAAf,WAAW;MAEtB;IAEF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,yFAgCC;IA0DD;;OAEG;IACH;;;;;;MAaC;IAQC,gDAEE;IAkBF;;;OAGG;IACH,qCAA4B;IAC5B;;;OAGG;IACH,2CAAkC;IAElC;;;;;OAKG;IACH,yBAA0B;IAE1B;;;;OAIG;IACH,kCAAmC;IA8ErC;;;OAGG;IACH,wCAFW,qBAAqB,QAoC/B;IAED;;OAEG;IACH,iCAwBC;IAlGD;;OAEG;IACH,iDAaC;IATK,4CAAkD;IAWxD;;;;;;;OAOG;IACH,gCAJW,MAAM,GACL,OAAO,CAMlB;IAuED;;;;;;;;OAQG;IACH,2BA6BC;IAED;;;;;;;;OAQG;IAEH,6CAEC;CACF;kBA1ZY,OAAO,uBAAuB,EAAE,GAAG;4BACnC,OAAO,KAAK,EAAE,aAAa;yBAC3B,OAAO,2CAA2C,EAAE,UAAU;yBAC9D,OAAO,gCAAgC,EAAE,UAAU;8CACnD,OAAO,mBAAmB,EAAE,+BAA+B;oCAC3D,OAAO,mBAAmB,EAAE,qBAAqB;0BACjD,OAAO,mBAAmB,EAAE,WAAW;yBACvC,OAAO,mBAAmB,EAAE,UAAU;6BACtC,OAAO,yCAAyC,EAAE,cAAc;gCAChE,OAAO,yCAAyC,EAAE,iBAAiB;0CACnE,+BAA+B,GAAG;IAAC,IAAI,EAAE;QAAC,cAAc,EAAC,UAAU,EAAE,CAAA;KAAC,CAAA;CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get the full locale for a region.
3
+ * As we don't know the language for that region, we first set it as 'und', which stands for 'undetermined'.
4
+ * @param {string} regionCode
5
+ */
6
+ export function regionCodeToLocale(regionCode: string): string;
7
+ //# sourceMappingURL=regionCodeToLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regionCodeToLocale.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/src/regionCodeToLocale.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+CAFW,MAAM,UAMhB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=regionCodeToLocale.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regionCodeToLocale.test.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/test/regionCodeToLocale.test.js"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"LionInputTelDropdown.suite.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js"],"names":[],"mappings":"AAyCA;;GAEG;AAEH,qDAHW;IAAE,KAAK,EAAC,oBAAoB,CAAA;CAAE,QAkVxC;8CA1WY,OAAO,mBAAmB,EAAE,+BAA+B;8BAC3D,iBAAiB,IAAC,WAAW,GAAG;IAAC,UAAU,EAAC,MAAM,CAAA;CAAC,CAAA;6BACnD,OAAO,KAAK,EAAE,cAAc"}
1
+ {"version":3,"file":"LionInputTelDropdown.suite.d.ts","sourceRoot":"","sources":["../../../../components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js"],"names":[],"mappings":"AAyCA;;GAEG;AAEH,qDAHW;IAAE,KAAK,EAAC,oBAAoB,CAAA;CAAE,QAsZxC;8CA9aY,OAAO,mBAAmB,EAAE,+BAA+B;8BAC3D,iBAAiB,IAAC,WAAW,GAAG;IAAC,UAAU,EAAC,MAAM,CAAA;CAAC,CAAA;6BACnD,OAAO,KAAK,EAAE,cAAc"}