@descope/web-components-ui 1.0.402 → 1.0.403
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/cjs/index.cjs.js +1565 -1208
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1612 -1208
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1053.js +1 -1
- package/dist/umd/4619.js +1 -1
- package/dist/umd/6726.js +1 -1
- package/dist/umd/7212.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +19 -0
- package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -1
- package/package.json +1 -1
- package/src/components/descope-hybrid-field/HybridFieldClass.js +289 -0
- package/src/components/descope-hybrid-field/helpers.js +5 -0
- package/src/components/descope-hybrid-field/index.js +9 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +45 -5
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +45 -11
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +21 -12
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +17 -5
- package/src/index.cjs.js +1 -0
- package/src/index.js +1 -0
- package/src/mixins/inputEventsDispatchingMixin.js +5 -5
- package/src/theme/components/hybridField.js +15 -0
- package/src/theme/components/index.js +2 -0
- package/dist/umd/4831.js +0 -148
- /package/dist/umd/{4831.js.LICENSE.txt → phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt} +0 -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', '
|
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
|
-
|
68
|
-
|
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
|
-
|
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
|
-
|
160
|
-
|
161
|
-
.
|
162
|
-
|
163
|
-
|
164
|
-
|
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);
|
package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js
CHANGED
@@ -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: { ...
|
97
|
-
inputBorderWidth: { ...
|
98
|
-
inputBorderColor: { ...
|
99
|
-
inputBorderRadius:
|
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
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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.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
|
-
|
64
|
-
|
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)}}]);
|
File without changes
|