@descope/web-components-ui 1.0.374 → 1.0.376

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -12,6 +12,7 @@ import '@vaadin/password-field';
12
12
  import MarkdownIt from 'markdown-it';
13
13
  import '@vaadin/text-area';
14
14
  import '@vaadin/combo-box';
15
+ import parsePhone from 'libphonenumber-js/min';
15
16
  import '@vaadin/grid';
16
17
  import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
17
18
  import { GridSelectionColumn } from '@vaadin/grid/vaadin-grid-selection-column';
@@ -1403,13 +1404,19 @@ const inputEventsDispatchingMixin = (superclass) =>
1403
1404
  // since on load we can only sample the color of the placeholder,
1404
1405
  // we need to temporarily populate the input in order to sample the value color
1405
1406
  const getValueColor = (ele, computedStyle) => {
1407
+ // to support setting dynamic values, we have to store the existing value
1408
+ // and re-set it if we are returning from this hack
1409
+ const origVal = ele.value;
1410
+
1406
1411
  // eslint-disable-next-line no-param-reassign
1407
1412
  ele.value = '_';
1408
1413
 
1409
1414
  const valueColor = computedStyle.getPropertyValue('color');
1410
1415
 
1411
- // eslint-disable-next-line no-param-reassign
1412
- ele.value = '';
1416
+ if (ele.value === '_') {
1417
+ // eslint-disable-next-line no-param-reassign
1418
+ ele.value = origVal;
1419
+ }
1413
1420
 
1414
1421
  return valueColor;
1415
1422
  };
@@ -6246,7 +6253,9 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$6 {
6246
6253
  }
6247
6254
 
6248
6255
  set value(val) {
6249
- const [countryCode = '', phoneNumber = ''] = val.split('-');
6256
+ const parsed = parsePhone(val);
6257
+ const countryCode = `+${parsed.countryCallingCode}`;
6258
+ const phoneNumber = parsed.nationalNumber;
6250
6259
 
6251
6260
  if (countryCode) {
6252
6261
  const countryCodeItem = this.getCountryByDialCode(countryCode);