@descope/web-components-ui 1.0.381 → 1.0.383

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -13,7 +13,7 @@ import debounce from 'lodash.debounce';
13
13
  import '@vaadin/password-field';
14
14
  import MarkdownIt from 'markdown-it';
15
15
  import '@vaadin/text-area';
16
- import parsePhone from 'libphonenumber-js/min';
16
+ import { parsePhoneNumberFromString } from 'libphonenumber-js/min';
17
17
  import '@vaadin/grid';
18
18
  import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
19
19
  import { GridSelectionColumn } from '@vaadin/grid/vaadin-grid-selection-column';
@@ -5139,6 +5139,7 @@ const DateFieldClass = compose(
5139
5139
  outlineWidth: { ...overlay },
5140
5140
  outlineColor: { ...overlay },
5141
5141
  outlineStyle: { ...overlay },
5142
+ direction: { ...overlay },
5142
5143
  },
5143
5144
  }),
5144
5145
  draggableMixin,
@@ -7941,6 +7942,32 @@ const comboBoxItem = ({ code, dialCode, name: country }) => `
7941
7942
  </div>
7942
7943
  `;
7943
7944
 
7945
+ const parsePhoneNumber = (val) => {
7946
+ const value = val || '';
7947
+ let countryCode = '';
7948
+ let phoneNumber = '';
7949
+
7950
+ // Attempt to parse the value using libphonenumber-js
7951
+ const parsed = parsePhoneNumberFromString(value);
7952
+
7953
+ if (parsed) {
7954
+ if (parsed.countryCallingCode) {
7955
+ countryCode = `+${parsed.countryCallingCode}`;
7956
+ }
7957
+
7958
+ if (parsed.nationalNumber) {
7959
+ phoneNumber = parsed.nationalNumber;
7960
+ }
7961
+ } else {
7962
+ // Fallback: assume a dash separates country code and phone number
7963
+ const [country, phone] = value.split('-');
7964
+ countryCode = country || '';
7965
+ phoneNumber = phone || '';
7966
+ }
7967
+
7968
+ return [countryCode, phoneNumber];
7969
+ };
7970
+
7944
7971
  const componentName$C = getComponentName('phone-field-internal');
7945
7972
 
7946
7973
  const commonAttrs$1 = ['disabled', 'size', 'bordered', 'invalid', 'readonly'];
@@ -8000,9 +8027,7 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$6 {
8000
8027
  }
8001
8028
 
8002
8029
  set value(val) {
8003
- const parsed = parsePhone(val || '');
8004
- const countryCode = parsed?.countryCallingCode ? `+${parsed.countryCallingCode}` : '';
8005
- const phoneNumber = parsed?.nationalNumber || '';
8030
+ const [countryCode, phoneNumber] = parsePhoneNumber(val);
8006
8031
 
8007
8032
  if (countryCode) {
8008
8033
  const countryCodeItem = this.getCountryByDialCode(countryCode);
@@ -17013,7 +17038,6 @@ const calendar = {
17013
17038
  [vars$5.calendarPadding]: '1em',
17014
17039
 
17015
17040
  [vars$5.topNavVerticalPadding]: '1em',
17016
- [vars$5.topNavHorizontalPadding]: '1em',
17017
17041
  [vars$5.topNavAlignment]: 'space-between',
17018
17042
  [vars$5.topNavGap]: '0',
17019
17043
  [vars$5.topNavSelectorsGap]: '0.5em',
@@ -17036,10 +17060,8 @@ const calendar = {
17036
17060
 
17037
17061
  [vars$5.weekdayFontSize]: '0.875em',
17038
17062
  [vars$5.weekdayFontWeight]: '500',
17039
- [vars$5.weekdayTextColor]: globalRefs$4.colors.surface.dark,
17040
17063
 
17041
17064
  // day table cell
17042
- [vars$5.dayWidth]: '2.705em',
17043
17065
  [vars$5.dayHeight]: '3.125em',
17044
17066
 
17045
17067
  // day value
@@ -17103,39 +17125,7 @@ const vars$4 = DateFieldClass.cssVarList;
17103
17125
 
17104
17126
  const dateField = {
17105
17127
  [vars$4.hostWidth]: refs.width,
17106
- [vars$4.hostMinWidth]: refs.minWidth,
17107
17128
  [vars$4.hostDirection]: refs.direction,
17108
- [vars$4.fontSize]: refs.fontSize,
17109
- [vars$4.fontFamily]: refs.fontFamily,
17110
- [vars$4.labelFontSize]: refs.labelFontSize,
17111
- [vars$4.labelFontWeight]: refs.labelFontWeight,
17112
- [vars$4.labelTextColor]: refs.labelTextColor,
17113
- [vars$4.errorMessageTextColor]: refs.errorMessageTextColor,
17114
- [vars$4.inputValueTextColor]: refs.valueTextColor,
17115
- [vars$4.inputPlaceholderColor]: refs.placeholderTextColor,
17116
- [vars$4.inputBorderWidth]: refs.borderWidth,
17117
- [vars$4.inputBorderStyle]: refs.borderStyle,
17118
- [vars$4.inputBorderColor]: refs.borderColor,
17119
- [vars$4.inputBorderRadius]: refs.borderRadius,
17120
- [vars$4.inputOutlineWidth]: refs.outlineWidth,
17121
- [vars$4.inputOutlineStyle]: refs.outlineStyle,
17122
- [vars$4.inputOutlineColor]: refs.outlineColor,
17123
- [vars$4.inputOutlineOffset]: refs.outlineOffset,
17124
- [vars$4.inputBackgroundColor]: refs.backgroundColor,
17125
- [vars$4.labelRequiredIndicator]: refs.requiredIndicator,
17126
- [vars$4.inputHorizontalPadding]: refs.horizontalPadding,
17127
- [vars$4.inputHeight]: refs.inputHeight,
17128
- [vars$4.labelPosition]: refs.labelPosition,
17129
- [vars$4.labelTopPosition]: refs.labelTopPosition,
17130
- [vars$4.labelHorizontalPosition]: refs.labelHorizontalPosition,
17131
- [vars$4.inputTransformY]: refs.inputTransformY,
17132
- [vars$4.inputTransition]: refs.inputTransition,
17133
- [vars$4.marginInlineStart]: refs.marginInlineStart,
17134
- [vars$4.placeholderOpacity]: refs.placeholderOpacity,
17135
- [vars$4.inputVerticalAlignment]: refs.inputVerticalAlignment,
17136
- [vars$4.valueInputHeight]: refs.valueInputHeight,
17137
- [vars$4.valueInputMarginBottom]: refs.valueInputMarginBottom,
17138
-
17139
17129
  [vars$4.iconMargin]: '0.375em',
17140
17130
 
17141
17131
  [vars$4.overlay.marginTop]: `calc(${refs.outlineWidth} + 1px)`,