@descope/web-components-ui 1.0.402 → 1.0.404

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 (33) hide show
  1. package/dist/cjs/index.cjs.js +1582 -1208
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.esm.js +1629 -1208
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1053.js +1 -1
  7. package/dist/umd/4619.js +1 -1
  8. package/dist/umd/6726.js +1 -1
  9. package/dist/umd/7212.js +1 -1
  10. package/dist/umd/DescopeDev.js +1 -1
  11. package/dist/umd/descope-hybrid-field-index-js.js +19 -0
  12. package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
  13. package/dist/umd/index.js +1 -1
  14. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  15. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  16. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  17. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -1
  18. package/package.json +1 -1
  19. package/src/components/descope-hybrid-field/HybridFieldClass.js +306 -0
  20. package/src/components/descope-hybrid-field/helpers.js +5 -0
  21. package/src/components/descope-hybrid-field/index.js +9 -0
  22. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +45 -5
  23. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +45 -11
  24. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +21 -12
  25. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +17 -5
  26. package/src/index.cjs.js +1 -0
  27. package/src/index.d.ts +2 -1
  28. package/src/index.js +1 -0
  29. package/src/mixins/inputEventsDispatchingMixin.js +5 -5
  30. package/src/theme/components/hybridField.js +15 -0
  31. package/src/theme/components/index.js +2 -0
  32. package/dist/umd/4831.js +0 -148
  33. /package/dist/umd/{4831.js.LICENSE.txt → phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt} +0 -0
@@ -56,9 +56,28 @@ const customMixin = (superclass) =>
56
56
  'readonly',
57
57
  'label',
58
58
  'label-type',
59
+ 'allow-alphanumeric-input',
59
60
  ],
60
61
  });
61
62
  }
63
+
64
+ get countryCodeItems() {
65
+ return this.inputElement?.countryCodeValue;
66
+ }
67
+
68
+ get phoneNumberInputEle() {
69
+ return this.inputElement?.phoneNumberInputEle;
70
+ }
71
+
72
+ get countryCodeInputData() {
73
+ return this.inputElement?.countryCodeInputData;
74
+ }
75
+
76
+ get countryCodes() {
77
+ return Array.from(this.inputElement.countryCodeInputData).map((ele) =>
78
+ ele.getAttribute('data-country-code')
79
+ );
80
+ }
62
81
  };
63
82
 
64
83
  const {
@@ -66,6 +85,7 @@ const {
66
85
  label,
67
86
  requiredIndicator,
68
87
  inputField,
88
+ internalAfter,
69
89
  countryCodeInput,
70
90
  phoneInput,
71
91
  separator,
@@ -76,6 +96,7 @@ const {
76
96
  label: { selector: '::part(label)' },
77
97
  requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
78
98
  inputField: { selector: '::part(input-field)' },
99
+ internalAfter: { selector: 'descope-phone-field-internal::after' },
79
100
  phoneInput: { selector: () => 'descope-text-field' },
80
101
  countryCodeInput: { selector: () => 'descope-combo-box' },
81
102
  separator: { selector: 'descope-phone-field-internal .separator' },
@@ -115,18 +136,21 @@ export const PhoneFieldClass = compose(
115
136
  hostDirection: { ...host, property: 'direction' },
116
137
 
117
138
  inputBorderStyle: [
118
- { ...inputField, property: 'border-style' },
139
+ { ...internalAfter, property: 'outline-style' },
119
140
  { ...separator, property: 'border-left-style' },
120
141
  ],
121
142
  inputBorderWidth: [
122
- { ...inputField, property: 'border-width' },
143
+ { ...internalAfter, property: 'outline-width' },
123
144
  { ...separator, property: 'border-left-width' },
124
145
  ],
125
146
  inputBorderColor: [
126
- { ...inputField, property: 'border-color' },
147
+ { ...internalAfter, property: 'outline-color' },
127
148
  { ...separator, property: 'border-left-color' },
128
149
  ],
129
- inputBorderRadius: { ...inputField, property: 'border-radius' },
150
+ inputBorderRadius: [
151
+ { ...inputField, property: 'border-radius' },
152
+ { ...internalAfter, property: 'border-radius' },
153
+ ],
130
154
 
131
155
  countryCodeInputWidth: { ...countryCodeInput, property: comboVars.hostWidth },
132
156
  countryCodeDropdownWidth: {
@@ -208,6 +232,10 @@ export const PhoneFieldClass = compose(
208
232
  vaadin-text-field::before {
209
233
  height: 0;
210
234
  }
235
+ vaadin-text-field::part(label) {
236
+ margin-left: 0;
237
+ margin-right: 0;
238
+ }
211
239
  vaadin-text-field::part(input-field) {
212
240
  padding: 0;
213
241
  background: transparent;
@@ -219,7 +247,19 @@ export const PhoneFieldClass = compose(
219
247
  width: 100%;
220
248
  height: 100%;
221
249
  direction: ltr;
250
+ position: relative;
222
251
  }
252
+ descope-phone-field-internal::after {
253
+ content: '';
254
+ position: absolute;
255
+ width: 100%;
256
+ height: 100%;
257
+ top: 0;
258
+ left: 0;
259
+ box-sizing: border-box;
260
+ outline-offset: calc(var(${PhoneFieldClass.cssVarList.inputBorderWidth}) * -1);
261
+ pointer-events: none;
262
+ }
223
263
  descope-phone-field-internal > div {
224
264
  width: 100%;
225
265
  height: 100%;
@@ -230,7 +270,7 @@ export const PhoneFieldClass = compose(
230
270
  }
231
271
  descope-combo-box {
232
272
  flex-shrink: 0;
233
- min-width: 5.75em;
273
+ min-width: 5.75em;
234
274
  ${comboVars.inputOutlineWidth}: 0;
235
275
  ${comboVars.inputOutlineOffset}: 0;
236
276
  ${comboVars.inputBorderWidth}: 0;
@@ -5,7 +5,7 @@ import { comboBoxItem, parsePhoneNumber } from '../helpers';
5
5
 
6
6
  export const componentName = getComponentName('phone-field-internal');
7
7
 
8
- const commonAttrs = ['disabled', 'size', 'bordered', 'invalid', 'readonly'];
8
+ const commonAttrs = ['disabled', 'size', 'bordered', 'readonly', 'allow-alphanumeric-input'];
9
9
  const countryAttrs = ['country-input-placeholder', 'default-code', 'restrict-countries'];
10
10
  const phoneAttrs = ['phone-input-placeholder', 'maxlength', 'autocomplete', 'name'];
11
11
  const labelTypeAttrs = ['label-type', 'country-input-label', 'label'];
@@ -28,7 +28,7 @@ class PhoneFieldInternal extends BaseInputClass {
28
28
  super();
29
29
 
30
30
  this.innerHTML = `
31
- <div>
31
+ <div class="wrapper">
32
32
  <descope-combo-box
33
33
  item-label-path="data-name"
34
34
  item-value-path="data-id"
@@ -54,6 +54,14 @@ class PhoneFieldInternal extends BaseInputClass {
54
54
  };
55
55
  }
56
56
 
57
+ get countryCodeInputData() {
58
+ return this.countryCodeInput.items;
59
+ }
60
+
61
+ get allowAlphanumericInput() {
62
+ return this.getAttribute('allow-alphanumeric-input') === 'true';
63
+ }
64
+
57
65
  get value() {
58
66
  if (!this.phoneNumberValue) {
59
67
  return '';
@@ -64,15 +72,35 @@ class PhoneFieldInternal extends BaseInputClass {
64
72
  set value(val) {
65
73
  const [countryCode, phoneNumber] = parsePhoneNumber(val);
66
74
 
67
- if (countryCode) {
68
- const countryCodeItem = this.getCountryByDialCode(countryCode);
75
+ this.#setCountryCode(countryCode);
76
+ this.#setPhoneNumber(phoneNumber);
77
+ }
78
+
79
+ setSelectionRange(...args) {
80
+ this.phoneNumberInput.setSelectionRange(...args);
81
+ }
82
+
83
+ get selectionStart() {
84
+ return this.phoneNumberInput.selectionStart;
85
+ }
86
+
87
+ #setCountryCode(val) {
88
+ if (val) {
89
+ const countryCodeItem = this.getCountryByDialCode(val);
69
90
  if (countryCodeItem) {
70
91
  this.countryCodeInput.selectedItem = countryCodeItem;
71
92
  }
72
93
  } else {
73
94
  this.countryCodeInput.selectedItem = undefined;
74
95
  }
75
- this.phoneNumberInput.value = this.phoneNumberInput.value || phoneNumber;
96
+ }
97
+
98
+ #setPhoneNumber(val) {
99
+ if (this.phoneNumberInput.value === val) {
100
+ return;
101
+ }
102
+
103
+ this.phoneNumberInput.value = val;
76
104
  }
77
105
 
78
106
  get phoneNumberValue() {
@@ -83,6 +111,10 @@ class PhoneFieldInternal extends BaseInputClass {
83
111
  return this.countryCodeInput.shadowRoot.querySelector('input').value;
84
112
  }
85
113
 
114
+ get phoneNumberInputEle() {
115
+ return this.phoneNumberInput.shadowRoot.querySelector('input');
116
+ }
117
+
86
118
  get minLength() {
87
119
  return parseInt(this.getAttribute('minlength'), 10) || 0;
88
120
  }
@@ -156,12 +188,14 @@ class PhoneFieldInternal extends BaseInputClass {
156
188
  initInputs() {
157
189
  // Sanitize phone input value to filter everything but digits
158
190
  this.phoneNumberInput.addEventListener('input', (e) => {
159
- const telDigitsRegExp = /^\d$/;
160
- const sanitizedInput = e.target.value
161
- .split('')
162
- .filter((char) => telDigitsRegExp.test(char))
163
- .join('');
164
- e.target.value = sanitizedInput;
191
+ if (!this.allowAlphanumericInput) {
192
+ const telDigitsRegExp = /^\d$/;
193
+ const sanitizedInput = e.target.value
194
+ .split('')
195
+ .filter((char) => telDigitsRegExp.test(char))
196
+ .join('');
197
+ e.target.value = sanitizedInput;
198
+ }
165
199
  });
166
200
 
167
201
  this.handleFocusEventsDispatching(this.inputs);
@@ -51,9 +51,14 @@ const customMixin = (superclass) =>
51
51
  'phone-input-placeholder',
52
52
  'label',
53
53
  'label-type',
54
+ 'allow-alphanumeric-input',
54
55
  ],
55
56
  });
56
57
  }
58
+
59
+ get phoneNumberInputEle() {
60
+ return this.inputElement?.phoneNumberInputEle;
61
+ }
57
62
  };
58
63
 
59
64
  const {
@@ -62,6 +67,7 @@ const {
62
67
  inputElement,
63
68
  requiredIndicator,
64
69
  inputField,
70
+ inputFieldInternal,
65
71
  phoneInput,
66
72
  errorMessage,
67
73
  helperText,
@@ -71,7 +77,10 @@ const {
71
77
  placeholder: { selector: '> input:placeholder-shown' },
72
78
  inputElement: { selector: 'input' },
73
79
  requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
74
- inputField: { selector: '::part(input-field)' },
80
+ inputField: { selector: () => 'vaadin-text-field::part(input-field)' },
81
+ inputFieldInternal: {
82
+ selector: () => 'descope-phone-field-internal-input-box vaadin-text-field::part(input-field)',
83
+ },
75
84
  phoneInput: { selector: () => 'descope-text-field' },
76
85
  helperText: { selector: '::part(helper-text)' },
77
86
  errorMessage: { selector: '::part(error-message)' },
@@ -93,10 +102,13 @@ export const PhoneFieldInputBoxClass = compose(
93
102
  hostMinWidth: { ...host, property: 'min-width' },
94
103
  hostDirection: { ...host, property: 'direction' },
95
104
 
96
- inputBorderStyle: { ...inputField, property: 'border-style' },
97
- inputBorderWidth: { ...inputField, property: 'border-width' },
98
- inputBorderColor: { ...inputField, property: 'border-color' },
99
- inputBorderRadius: { ...inputField, property: 'border-radius' },
105
+ inputBorderStyle: { ...inputFieldInternal, property: 'border-style' },
106
+ inputBorderWidth: { ...inputFieldInternal, property: 'border-width' },
107
+ inputBorderColor: { ...inputFieldInternal, property: 'border-color' },
108
+ inputBorderRadius: [
109
+ { ...inputField, property: 'border-radius' },
110
+ { ...inputFieldInternal, property: 'border-radius' },
111
+ ],
100
112
 
101
113
  inputHorizontalPadding: [
102
114
  { ...phoneInput, property: 'padding-left' },
@@ -157,7 +169,6 @@ export const PhoneFieldInputBoxClass = compose(
157
169
 
158
170
  vaadin-text-field {
159
171
  width: 100%;
160
- height: 100%;
161
172
  box-sizing: border-box;
162
173
  padding: 0;
163
174
  }
@@ -177,23 +188,21 @@ export const PhoneFieldInputBoxClass = compose(
177
188
  -webkit-mask-image: none;
178
189
  padding: 0;
179
190
  width: 100%;
180
- height: 100%;
181
191
  }
182
192
  descope-phone-field-internal-input-box > div {
183
193
  width: 100%;
184
- height: 100%;
185
194
  }
186
195
  descope-phone-field-internal-input-box .separator {
187
196
  flex: 0;
188
197
  border: none;
189
198
  }
199
+ descope-phone-field-internal-input-box descope-text-field {
200
+ ${textVars.inputOutlineWidth}: 0;
201
+ ${textVars.inputOutlineOffset}: 0;
202
+ }
190
203
  descope-text-field {
191
204
  flex-grow: 1;
192
205
  width: 100%;
193
- ${textVars.inputOutlineWidth}: 0;
194
- ${textVars.inputOutlineOffset}: 0;
195
- ${textVars.inputBorderWidth}: 0;
196
- ${textVars.inputBorderRadius}: 0;
197
206
  direction: ltr;
198
207
  }
199
208
  vaadin-text-field[readonly] > input:placeholder-shown {
@@ -14,6 +14,7 @@ const observedAttributes = [
14
14
  'name',
15
15
  'autocomplete',
16
16
  'label-type',
17
+ 'allow-alphanumeric-input',
17
18
  ];
18
19
  const mapAttrs = {
19
20
  'phone-input-placeholder': 'placeholder',
@@ -46,6 +47,10 @@ class PhoneFieldInternal extends BaseInputClass {
46
47
  return !!this.getAttribute('default-code');
47
48
  }
48
49
 
50
+ get allowAlphanumericInput() {
51
+ return this.getAttribute('allow-alphanumeric-input') === 'true';
52
+ }
53
+
49
54
  get value() {
50
55
  if (!this.phoneNumberValue) {
51
56
  return '';
@@ -76,6 +81,10 @@ class PhoneFieldInternal extends BaseInputClass {
76
81
  return this.phoneNumberInput.value;
77
82
  }
78
83
 
84
+ get phoneNumberInputEle() {
85
+ return this.phoneNumberInput.shadowRoot.querySelector('input');
86
+ }
87
+
79
88
  get minLength() {
80
89
  return parseInt(this.getAttribute('minlength'), 10) || 0;
81
90
  }
@@ -135,11 +144,14 @@ class PhoneFieldInternal extends BaseInputClass {
135
144
  .replace('--', '-')
136
145
  .replace('+-', '+');
137
146
 
138
- const telDigitsRegExp = /^[+\d-]+$/;
139
- const sanitizedInput = e.target.value
140
- .split('')
141
- .filter((char) => telDigitsRegExp.test(char))
142
- .join('');
147
+ let sanitizedInput = e.target.value;
148
+ if (!this.allowAlphanumericInput) {
149
+ const telDigitsRegExp = /^[+\d-]+$/;
150
+ sanitizedInput = e.target.value
151
+ .split('')
152
+ .filter((char) => telDigitsRegExp.test(char))
153
+ .join('');
154
+ }
143
155
 
144
156
  e.target.value = sanitizedInput;
145
157
  });
package/src/index.cjs.js CHANGED
@@ -56,3 +56,4 @@ export { ScopesListClass } from './components/descope-scopes-list/ScopesListClas
56
56
  export { ThirdPartyAppLogoClass } from './components/descope-third-party-app-logo/ThirdPartyAppLogoClass';
57
57
  export { SecurityQuestionsSetupClass } from './components/descope-security-questions-setup/SecurityQuestionsSetupClass';
58
58
  export { SecurityQuestionsVerifyClass } from './components/descope-security-questions-verify/SecurityQuestionsVerifyClass';
59
+ export { HybridFieldClass } from './components/descope-hybrid-field/HybridFieldClass';
package/src/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export {
7
7
  componentsThemeManager,
8
8
  } from './helpers/themeHelpers';
9
9
  export { genColor } from './helpers/themeHelpers/colorsHelpers';
10
- export { defaultTheme, themeVars } from './defaultTheme';
10
+ export { defaultTheme, themeVars } from './theme';
11
11
  export { default as darkTheme } from './darkTheme';
12
12
  export { ButtonClass } from './components/descope-button';
13
13
  export { CheckboxClass } from './components/boolean-fields/descope-checkbox';
@@ -49,6 +49,7 @@ export { PolicyValidationClass } from './components/descope-policy-validation/';
49
49
  export { CodeSnippetClass } from './components/descope-code-snippet/';
50
50
  export { CalendarClass } from './components/descope-date-field/descope-calendar';
51
51
  export { DateFieldClass } from './components/descope-date-field/';
52
+ export { HybridFieldClass } from './components/descope-hybrid-field';
52
53
 
53
54
  export type Theme = {
54
55
  globals: {
package/src/index.js CHANGED
@@ -48,6 +48,7 @@ export * from './components/descope-scopes-list';
48
48
  export * from './components/descope-third-party-app-logo';
49
49
  export * from './components/descope-security-questions-setup';
50
50
  export * from './components/descope-security-questions-verify';
51
+ export * from './components/descope-hybrid-field';
51
52
 
52
53
  export {
53
54
  globalsThemeToStyle,
@@ -59,13 +59,13 @@ export const inputEventsDispatchingMixin = (superclass) =>
59
59
  handleInputEventDispatching() {
60
60
  let previousRootComponentValue = this.value;
61
61
 
62
+ // we are comparing the previous value to the new one,
63
+ // and if they have the same value, we are blocking the input event
62
64
  this.addEventListener('input', (e) => {
63
- // we are comparing the previous value to the new one,
64
- // and if they have the same value, we are blocking the input event
65
- if (previousRootComponentValue === this.value) {
66
- e.stopImmediatePropagation();
67
- } else {
65
+ e.stopImmediatePropagation();
66
+ if (previousRootComponentValue !== this.value) {
68
67
  previousRootComponentValue = this.value;
68
+ createDispatchEvent.call(this, 'input', { bubbles: true });
69
69
  }
70
70
  });
71
71
  }
@@ -0,0 +1,15 @@
1
+ import { HybridFieldClass } from '../../components/descope-hybrid-field/HybridFieldClass';
2
+ import { refs } from './inputWrapper';
3
+
4
+ const vars = HybridFieldClass.cssVarList;
5
+
6
+ const hybridField = {
7
+ [vars.hostDirection]: refs.direction,
8
+
9
+ _fullWidth: {
10
+ [vars.hostWidth]: '100%',
11
+ },
12
+ };
13
+
14
+ export default hybridField;
15
+ export { vars };
@@ -50,6 +50,7 @@ import * as scopesList from './scopesList';
50
50
  import * as thirdPartyAppLogo from './thirdPartyAppLogo';
51
51
  import * as securityQuestionsSetup from './securityQuestionsSetup';
52
52
  import * as securityQuestionsVerify from './securityQuestionsVerify';
53
+ import * as hybridField from './hybridField';
53
54
 
54
55
  const components = {
55
56
  button,
@@ -105,6 +106,7 @@ const components = {
105
106
  thirdPartyAppLogo,
106
107
  securityQuestionsSetup,
107
108
  securityQuestionsVerify,
109
+ hybridField,
108
110
  };
109
111
 
110
112
  const theme = Object.keys(components).reduce(
package/dist/umd/4831.js DELETED
@@ -1,148 +0,0 @@
1
- /*! For license information please see 4831.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[4831,7212],{31111:(t,e,o)=>{o(46165),o(14968),o(37451),o(72815);var a=o(90500),i=o(6052);const r=i.AH`
3
- :host {
4
- outline: none;
5
- }
6
-
7
- [part='toggle-button']::before {
8
- content: var(--lumo-icons-dropdown);
9
- }
10
- `;(0,i.SF)("vaadin-combo-box",[a.k,r],{moduleId:"lumo-combo-box"}),o(9077);var s=o(33791),n=o(38735),l=o(35717),d=o(10187);class p extends((0,d.y)((0,i.cp)((0,l.v)(s.Pu)))){static get template(){return s.qy`
11
- <style>
12
- :host {
13
- display: block;
14
- }
15
-
16
- :host([hidden]) {
17
- display: none;
18
- }
19
- </style>
20
- <span part="checkmark" aria-hidden="true"></span>
21
- <div part="content">
22
- <slot></slot>
23
- </div>
24
- `}static get is(){return"vaadin-combo-box-item"}}(0,n.X)(p);var c=o(21380),u=o(52718),v=o(75482);const h=i.AH`
25
- #overlay {
26
- width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
27
- }
28
-
29
- [part='content'] {
30
- display: flex;
31
- flex-direction: column;
32
- height: 100%;
33
- }
34
- `;(0,i.SF)("vaadin-combo-box-overlay",[u.B,h],{moduleId:"vaadin-combo-box-overlay-styles"});class m extends((0,v.p)((0,c.c)((0,l.v)((0,i.cp)(s.Pu))))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return s.qy`
35
- <div id="backdrop" part="backdrop" hidden></div>
36
- <div part="overlay" id="overlay">
37
- <div part="loader"></div>
38
- <div part="content" id="content"><slot></slot></div>
39
- </div>
40
- `}}(0,n.X)(m);var g=o(44998);class b extends((0,g.N)(s.Pu)){static get is(){return"vaadin-combo-box-scroller"}static get template(){return s.qy`
41
- <style>
42
- :host {
43
- display: block;
44
- min-height: 1px;
45
- overflow: auto;
46
-
47
- /* Fixes item background from getting on top of scrollbars on Safari */
48
- transform: translate3d(0, 0, 0);
49
-
50
- /* Enable momentum scrolling on iOS */
51
- -webkit-overflow-scrolling: touch;
52
-
53
- /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
54
- box-shadow: 0 0 0 white;
55
- }
56
-
57
- #selector {
58
- border-width: var(--_vaadin-combo-box-items-container-border-width);
59
- border-style: var(--_vaadin-combo-box-items-container-border-style);
60
- border-color: var(--_vaadin-combo-box-items-container-border-color, transparent);
61
- position: relative;
62
- }
63
- </style>
64
- <div id="selector">
65
- <slot></slot>
66
- </div>
67
- `}}(0,n.X)(b);var y=o(31846),_=o(58074),x=o(32318),f=o(15408),C=o(3550),w=o(3410);const k=t=>class extends((0,w.U)(t)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};var S=o(89385),E=o(5792),A=o(93131);(0,i.SF)("vaadin-combo-box",S.k,{moduleId:"vaadin-combo-box-styles"});class q extends((0,E.K)((0,A.x)(k((0,x.R)((0,i.cp)((0,y.q)(s.Pu))))))){static get is(){return"vaadin-combo-box"}static get template(){return s.qy`
68
- <style>
69
- :host([opened]) {
70
- pointer-events: auto;
71
- }
72
- </style>
73
-
74
- <div class="vaadin-combo-box-container">
75
- <div part="label">
76
- <slot name="label"></slot>
77
- <span part="required-indicator" aria-hidden="true" on-click="focus"></span>
78
- </div>
79
-
80
- <vaadin-input-container
81
- part="input-field"
82
- readonly="[[readonly]]"
83
- disabled="[[disabled]]"
84
- invalid="[[invalid]]"
85
- theme$="[[_theme]]"
86
- >
87
- <slot name="prefix" slot="prefix"></slot>
88
- <slot name="input"></slot>
89
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
90
- <div id="toggleButton" part="toggle-button" slot="suffix" aria-hidden="true"></div>
91
- </vaadin-input-container>
92
-
93
- <div part="helper-text">
94
- <slot name="helper"></slot>
95
- </div>
96
-
97
- <div part="error-message">
98
- <slot name="error-message"></slot>
99
- </div>
100
- </div>
101
-
102
- <vaadin-combo-box-overlay
103
- id="overlay"
104
- opened="[[_overlayOpened]]"
105
- loading$="[[loading]]"
106
- theme$="[[_theme]]"
107
- position-target="[[_positionTarget]]"
108
- no-vertical-overlap
109
- restore-focus-node="[[inputElement]]"
110
- ></vaadin-combo-box-overlay>
111
-
112
- <slot name="tooltip"></slot>
113
- `}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new f.f(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new C.q(this.inputElement,this._labelController)),this._tooltipController=new _.I(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}(0,n.X)(q)},53430:(t,e,o)=>{o.d(e,{a:()=>i});var a=o(32318);const i=t=>class extends((0,a.R)(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},34068:(t,e,o)=>{o.d(e,{A:()=>v}),o(9077);var a=o(33791),i=o(38735),r=o(31846),s=o(58074),n=o(89385),l=o(6052),d=o(15408),p=o(53430),c=o(3550);const u=t=>class extends((0,p.a)(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.f(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new c.q(this.inputElement,this._labelController))}};(0,l.SF)("vaadin-text-field",n.k,{moduleId:"vaadin-text-field-styles"});class v extends(u((0,l.cp)((0,r.q)(a.Pu)))){static get is(){return"vaadin-text-field"}static get template(){return a.qy`
114
- <style>
115
- [part='input-field'] {
116
- flex-grow: 0;
117
- }
118
- </style>
119
-
120
- <div class="vaadin-field-container">
121
- <div part="label">
122
- <slot name="label"></slot>
123
- <span part="required-indicator" aria-hidden="true" on-click="focus"></span>
124
- </div>
125
-
126
- <vaadin-input-container
127
- part="input-field"
128
- readonly="[[readonly]]"
129
- disabled="[[disabled]]"
130
- invalid="[[invalid]]"
131
- theme$="[[_theme]]"
132
- >
133
- <slot name="prefix" slot="prefix"></slot>
134
- <slot name="input"></slot>
135
- <slot name="suffix" slot="suffix"></slot>
136
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
137
- </vaadin-input-container>
138
-
139
- <div part="helper-text">
140
- <slot name="helper"></slot>
141
- </div>
142
-
143
- <div part="error-message">
144
- <slot name="error-message"></slot>
145
- </div>
146
- </div>
147
- <slot name="tooltip"></slot>
148
- `}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new s.I(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,i.X)(v)},70297:(t,e,o)=>{o(37451);var a=o(90500);(0,o(6052).SF)("vaadin-text-field",a.k,{moduleId:"lumo-text-field-styles"}),o(34068)},39542:(t,e,o)=>{o(70297),o(34068)}}]);