@descope/web-components-ui 1.0.101 → 1.0.103
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -156
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +411 -370
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/241.js +1 -0
- package/dist/umd/447.js +1 -1
- package/dist/umd/878.js +1 -1
- package/dist/umd/890.js +1 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-date-picker-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-image-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-loader-linear-index-js.js +1 -1
- package/dist/umd/descope-loader-radial-index-js.js +1 -1
- package/dist/umd/descope-logo-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/descope-phone-field-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-combo-box/ComboBox.js +1 -1
- package/src/components/descope-container/Container.js +2 -1
- package/src/components/descope-divider/Divider.js +1 -0
- package/src/components/descope-email-field/EmailField.js +6 -8
- package/src/components/descope-new-password/NewPassword.js +15 -13
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +2 -1
- package/src/components/descope-number-field/NumberField.js +7 -10
- package/src/components/descope-passcode/Passcode.js +83 -67
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +3 -7
- package/src/components/descope-password-field/PasswordField.js +17 -13
- package/src/components/descope-phone-field/PhoneField.js +15 -1
- package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +5 -2
- package/src/components/descope-text-area/TextArea.js +6 -7
- package/src/components/descope-text-field/TextField.js +4 -10
- package/src/components/descope-text-field/textFieldMappings.js +1 -0
- package/src/helpers/themeHelpers/index.js +1 -1
- package/src/mixins/createStyleMixin/index.js +4 -1
- package/src/mixins/inputValidationMixin.js +15 -6
- package/src/mixins/normalizeBooleanAttributesMixin.js +29 -4
- package/src/mixins/proxyInputMixin.js +3 -1
- package/src/theme/components/comboBox.js +4 -10
- package/src/theme/components/logo.js +1 -0
- package/src/theme/components/newPassword.js +11 -24
- package/src/theme/components/passcode.js +3 -3
- package/src/theme/components/passwordField.js +4 -8
- package/src/theme/components/phoneField.js +8 -16
- package/src/theme/components/text.js +0 -2
- package/src/theme/components/textArea.js +9 -2
- package/src/theme/components/textField.js +3 -5
- package/dist/umd/0.js +0 -1
@@ -35,6 +35,8 @@ const EmailField = compose(
|
|
35
35
|
overrides = `
|
36
36
|
:host {
|
37
37
|
display: inline-block;
|
38
|
+
min-width: 10em;
|
39
|
+
max-width: 100%;
|
38
40
|
}
|
39
41
|
vaadin-email-field {
|
40
42
|
margin: 0;
|
@@ -44,8 +46,12 @@ overrides = `
|
|
44
46
|
vaadin-email-field::before {
|
45
47
|
height: 0;
|
46
48
|
}
|
49
|
+
vaadin-email-field > input {
|
50
|
+
-webkit-mask-image: none;
|
51
|
+
}
|
47
52
|
vaadin-email-field::part(input-field) {
|
48
53
|
overflow: hidden;
|
54
|
+
padding: 0;
|
49
55
|
}
|
50
56
|
vaadin-email-field[readonly] > input:placeholder-shown {
|
51
57
|
opacity: 1;
|
@@ -58,14 +64,6 @@ overrides = `
|
|
58
64
|
-webkit-text-fill-color: var(${EmailField.cssVarList.color});
|
59
65
|
box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
|
60
66
|
}
|
61
|
-
vaadin-email-field > label,
|
62
|
-
vaadin-email-field::part(input-field) {
|
63
|
-
cursor: pointer;
|
64
|
-
color: var(${EmailField.cssVarList.color});
|
65
|
-
}
|
66
|
-
vaadin-email-field::part(input-field):focus {
|
67
|
-
cursor: text;
|
68
|
-
}
|
69
67
|
vaadin-email-field[required]::part(required-indicator)::after {
|
70
68
|
content: "*";
|
71
69
|
color: var(${EmailField.cssVarList.color});
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
createProxy,
|
8
8
|
} from '../../mixins';
|
9
9
|
import { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';
|
10
|
-
import PasswordField from
|
10
|
+
import PasswordField from '../descope-password-field/PasswordField';
|
11
11
|
|
12
12
|
export const componentName = getComponentName('new-password');
|
13
13
|
|
@@ -46,6 +46,7 @@ const customMixin = (superclass) =>
|
|
46
46
|
'label',
|
47
47
|
'has-confirm',
|
48
48
|
'invalid',
|
49
|
+
'readonly'
|
49
50
|
]
|
50
51
|
});
|
51
52
|
}
|
@@ -58,17 +59,16 @@ const { host, internalInputsWrapper } = {
|
|
58
59
|
const NewPassword = compose(
|
59
60
|
createStyleMixin({
|
60
61
|
mappings: {
|
62
|
+
fontSize: [
|
63
|
+
host,
|
64
|
+
{
|
65
|
+
selector: PasswordField.componentName,
|
66
|
+
property: PasswordField.cssVarList.fontSize
|
67
|
+
}
|
68
|
+
],
|
61
69
|
componentWidth: { ...host, property: 'width' },
|
62
70
|
requiredContent: { ...host, property: 'content' },
|
63
|
-
|
64
|
-
selector: PasswordField.componentName,
|
65
|
-
property: PasswordField.cssVarList.labelTextColor
|
66
|
-
},
|
67
|
-
inputTextColor: {
|
68
|
-
selector: PasswordField.componentName,
|
69
|
-
property: PasswordField.cssVarList.inputTextColor
|
70
|
-
},
|
71
|
-
inputsGap: { ...internalInputsWrapper, property: 'gap' }
|
71
|
+
inputsGap: { ...internalInputsWrapper, property: 'gap' },
|
72
72
|
}
|
73
73
|
}),
|
74
74
|
draggableMixin,
|
@@ -88,6 +88,8 @@ const overrides = `
|
|
88
88
|
:host {
|
89
89
|
--vaadin-field-default-width: auto;
|
90
90
|
display: inline-block;
|
91
|
+
min-width: 10em;
|
92
|
+
max-width: 100%;
|
91
93
|
}
|
92
94
|
vaadin-text-field {
|
93
95
|
padding: 0;
|
@@ -107,16 +109,16 @@ const overrides = `
|
|
107
109
|
}
|
108
110
|
descope-new-password-internal {
|
109
111
|
-webkit-mask-image: none;
|
110
|
-
padding: 0;
|
111
112
|
min-height: 0;
|
112
113
|
width: 100%;
|
113
|
-
height: 100%;
|
114
|
+
height: 100%;
|
115
|
+
padding: 0;
|
114
116
|
}
|
115
117
|
descope-new-password-internal > .wrapper {
|
116
118
|
width: 100%;
|
117
119
|
height: 100%;
|
118
120
|
display: flex;
|
119
|
-
|
121
|
+
flex-direction: column;
|
120
122
|
}
|
121
123
|
descope-password-field {
|
122
124
|
display: block;
|
package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js
CHANGED
@@ -17,6 +17,7 @@ const commonAttrs = [
|
|
17
17
|
'full-width',
|
18
18
|
'maxlength',
|
19
19
|
'invalid',
|
20
|
+
'readonly'
|
20
21
|
];
|
21
22
|
|
22
23
|
const inputRelatedAttrs = [].concat(commonAttrs, passwordInputAttrs, confirmInputAttrs);
|
@@ -80,7 +81,7 @@ class NewPasswordInternal extends BaseInputClass {
|
|
80
81
|
}
|
81
82
|
});
|
82
83
|
|
83
|
-
super.init();
|
84
|
+
super.init?.();
|
84
85
|
this.renderInputs(this.hasConfirm);
|
85
86
|
}
|
86
87
|
|
@@ -35,13 +35,19 @@ const NumberField = compose(
|
|
35
35
|
overrides = `
|
36
36
|
:host {
|
37
37
|
display: inline-block;
|
38
|
+
min-width: 10em;
|
39
|
+
max-width: 100%;
|
38
40
|
}
|
39
41
|
vaadin-number-field {
|
40
42
|
margin: 0;
|
41
43
|
padding: 0;
|
44
|
+
width: 100%;
|
45
|
+
}
|
46
|
+
vaadin-number-field > input {
|
47
|
+
-webkit-mask-image: none;
|
42
48
|
}
|
43
49
|
vaadin-number-field::part(input-field) {
|
44
|
-
|
50
|
+
padding: 0;
|
45
51
|
}
|
46
52
|
vaadin-number-field[readonly] > input:placeholder-shown {
|
47
53
|
opacity: 1;
|
@@ -54,16 +60,7 @@ overrides = `
|
|
54
60
|
-webkit-text-fill-color: var(${NumberField.cssVarList.color});
|
55
61
|
box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
|
56
62
|
}
|
57
|
-
vaadin-number-field > label,
|
58
|
-
vaadin-number-field::part(input-field) {
|
59
|
-
cursor: pointer;
|
60
|
-
color: var(${NumberField.cssVarList.color});
|
61
|
-
}
|
62
|
-
vaadin-number-field::part(input-field):focus {
|
63
|
-
cursor: text;
|
64
|
-
}
|
65
63
|
vaadin-number-field[required]::part(required-indicator)::after {
|
66
|
-
font-size: "12px";
|
67
64
|
content: "*";
|
68
65
|
color: var(${NumberField.cssVarList.color});
|
69
66
|
}
|
@@ -13,8 +13,16 @@ import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
|
13
13
|
|
14
14
|
export const componentName = getComponentName('passcode');
|
15
15
|
|
16
|
+
const observedAttributes = [
|
17
|
+
'digits'
|
18
|
+
];
|
19
|
+
|
16
20
|
const customMixin = (superclass) =>
|
17
21
|
class PasscodeClass extends superclass {
|
22
|
+
static get observedAttributes() {
|
23
|
+
return observedAttributes.concat(superclass.observedAttributes || []);
|
24
|
+
}
|
25
|
+
|
18
26
|
constructor() {
|
19
27
|
super();
|
20
28
|
}
|
@@ -42,6 +50,14 @@ const customMixin = (superclass) =>
|
|
42
50
|
|
43
51
|
forwardAttrs(this, this.inputElement, { includeAttrs: ['digits', 'size'] })
|
44
52
|
}
|
53
|
+
|
54
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
55
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
56
|
+
|
57
|
+
if (attrName === 'digits') {
|
58
|
+
this.style.setProperty('--passcode-digits-count', newValue);
|
59
|
+
}
|
60
|
+
}
|
45
61
|
};
|
46
62
|
|
47
63
|
const { borderStyle, borderWidth, ...restTextFieldMappings } =
|
@@ -50,7 +66,7 @@ const { borderStyle, borderWidth, ...restTextFieldMappings } =
|
|
50
66
|
const { digitField, label, requiredIndicator, internalWrapper, focusedDigitField } = {
|
51
67
|
focusedDigitField: { selector: () => `${TextField.componentName}[focused="true"]` },
|
52
68
|
digitField: { selector: () => TextField.componentName },
|
53
|
-
label: { selector: '
|
69
|
+
label: { selector: '::part(label)' },
|
54
70
|
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
55
71
|
internalWrapper: { selector: 'descope-passcode-internal .wrapper' }
|
56
72
|
}
|
@@ -75,10 +91,7 @@ const Passcode = compose(
|
|
75
91
|
textAlign: { ...digitField, property: textVars.textAlign },
|
76
92
|
caretColor: { ...digitField, property: textVars.caretColor },
|
77
93
|
digitsGap: { ...internalWrapper, property: 'gap' },
|
78
|
-
|
79
|
-
{ ...focusedDigitField, property: textVars.borderColor },
|
80
|
-
{ ...focusedDigitField, property: textVars.outlineColor }
|
81
|
-
]
|
94
|
+
focusedDigitFieldOutlineColor: { ...focusedDigitField, property: textVars.outlineColor }
|
82
95
|
},
|
83
96
|
}),
|
84
97
|
draggableMixin,
|
@@ -90,68 +103,71 @@ const Passcode = compose(
|
|
90
103
|
slots: [],
|
91
104
|
wrappedEleName: 'vaadin-text-field',
|
92
105
|
style: () => `
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
106
|
+
:host {
|
107
|
+
--vaadin-field-default-width: auto;
|
108
|
+
display: inline-block;
|
109
|
+
max-width: 100%;
|
110
|
+
min-width: calc(var(--passcode-digits-count) * 2em);
|
111
|
+
}
|
112
|
+
:host::after {
|
113
|
+
background-color: transparent;
|
114
|
+
}
|
115
|
+
:host::part(input-field)::after {
|
116
|
+
background-color: transparent;
|
117
|
+
}
|
118
|
+
|
119
|
+
descope-passcode-internal {
|
120
|
+
-webkit-mask-image: none;
|
121
|
+
padding: 0;
|
122
|
+
width: 100%;
|
123
|
+
height: 100%;
|
124
|
+
min-height: initial;
|
125
|
+
}
|
126
|
+
|
127
|
+
descope-passcode-internal .wrapper {
|
128
|
+
box-sizing: border-box;
|
129
|
+
min-height: initial;
|
130
|
+
height: 100%;
|
131
|
+
justify-content: space-between;
|
132
|
+
}
|
133
|
+
|
134
|
+
descope-passcode-internal descope-text-field {
|
135
|
+
min-width: 2em;
|
136
|
+
max-width: var(${textVars.height});
|
137
|
+
}
|
138
|
+
|
139
|
+
vaadin-text-field::part(input-field) {
|
140
|
+
background-color: transparent;
|
141
|
+
padding: 0;
|
142
|
+
overflow: hidden;
|
143
|
+
-webkit-mask-image: none;
|
144
|
+
}
|
145
|
+
|
146
|
+
vaadin-text-field {
|
147
|
+
margin: 0;
|
148
|
+
padding: 0;
|
149
|
+
width: 100%
|
150
|
+
}
|
151
|
+
|
152
|
+
vaadin-text-field::before {
|
153
|
+
height: 0;
|
154
|
+
}
|
155
|
+
|
156
|
+
vaadin-text-field[readonly] > input:placeholder-shown {
|
157
|
+
opacity: 1;
|
158
|
+
}
|
159
|
+
|
160
|
+
vaadin-text-field::part(input-field):focus {
|
161
|
+
cursor: text;
|
162
|
+
}
|
163
|
+
|
164
|
+
vaadin-text-field[required]::part(required-indicator)::after {
|
165
|
+
content: "*";
|
166
|
+
}
|
167
|
+
vaadin-text-field[readonly]::part(input-field)::after {
|
168
|
+
border: 0 solid;
|
169
|
+
}
|
170
|
+
`,
|
155
171
|
excludeAttrsSync: ['tabindex'],
|
156
172
|
componentName
|
157
173
|
})
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';
|
2
2
|
import { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';
|
3
|
-
import { createDispatchEvent } from '../../../helpers/mixinsHelpers';
|
4
3
|
import { getSanitizedCharacters, focusElement } from './helpers';
|
5
4
|
|
6
5
|
export const componentName = getComponentName('passcode-internal');
|
@@ -28,9 +27,6 @@ class PasscodeInternal extends BaseInputClass {
|
|
28
27
|
return componentName;
|
29
28
|
}
|
30
29
|
|
31
|
-
#dispatchBlur = createDispatchEvent.bind(this, 'blur')
|
32
|
-
#dispatchFocus = createDispatchEvent.bind(this, 'focus')
|
33
|
-
|
34
30
|
constructor() {
|
35
31
|
super();
|
36
32
|
|
@@ -53,7 +49,8 @@ class PasscodeInternal extends BaseInputClass {
|
|
53
49
|
<descope-text-field
|
54
50
|
data-id=${idx}
|
55
51
|
type="tel"
|
56
|
-
autocomplete="
|
52
|
+
autocomplete="one-time-code"
|
53
|
+
inputMode="numeric"
|
57
54
|
></descope-text-field>
|
58
55
|
`)
|
59
56
|
|
@@ -108,8 +105,7 @@ class PasscodeInternal extends BaseInputClass {
|
|
108
105
|
|
109
106
|
super.init?.();
|
110
107
|
|
111
|
-
this.renderInputs()
|
112
|
-
|
108
|
+
this.renderInputs();
|
113
109
|
}
|
114
110
|
|
115
111
|
getInputIdx(inputEle) {
|
@@ -21,20 +21,20 @@ const {
|
|
21
21
|
label,
|
22
22
|
requiredIndicator
|
23
23
|
} = {
|
24
|
-
host: () => ':host',
|
24
|
+
host: { selector: () => ':host' },
|
25
25
|
inputWrapper: { selector: '::part(input-field)' },
|
26
26
|
inputElement: { selector: '> input' },
|
27
27
|
inputElementPlaceholder: { selector: '> input:placeholder-shown' },
|
28
28
|
revealButton: { selector: 'vaadin-password-field-button' },
|
29
29
|
revealButtonIcon: { selector: () => '::part(reveal-button)::before' },
|
30
|
-
label: { selector: '
|
30
|
+
label: { selector: '::part(label)' },
|
31
31
|
requiredIndicator: { selector: '::part(required-indicator)::after' },
|
32
32
|
}
|
33
33
|
|
34
34
|
const PasswordField = compose(
|
35
35
|
createStyleMixin({
|
36
36
|
mappings: {
|
37
|
-
width:
|
37
|
+
width: host,
|
38
38
|
wrapperBorderStyle: { ...inputWrapper, property: 'border-style' },
|
39
39
|
wrapperBorderWidth: { ...inputWrapper, property: 'border-width' },
|
40
40
|
wrapperBorderColor: { ...inputWrapper, property: 'border-color' },
|
@@ -56,10 +56,10 @@ const PasswordField = compose(
|
|
56
56
|
{ ...label, property: 'cursor' },
|
57
57
|
{ ...requiredIndicator, property: 'cursor' }
|
58
58
|
],
|
59
|
-
outlineColor:
|
60
|
-
outlineStyle:
|
59
|
+
outlineColor: inputWrapper,
|
60
|
+
outlineStyle: inputWrapper,
|
61
61
|
outlineWidth: [
|
62
|
-
|
62
|
+
inputWrapper,
|
63
63
|
// we need to make sure there is enough space for the outline
|
64
64
|
{ property: 'padding' }
|
65
65
|
],
|
@@ -76,32 +76,36 @@ const PasswordField = compose(
|
|
76
76
|
wrappedEleName: 'vaadin-password-field',
|
77
77
|
style: `
|
78
78
|
:host {
|
79
|
-
display: inline-
|
79
|
+
display: inline-block;
|
80
|
+
min-width: 10em;
|
81
|
+
max-width: 100%;
|
80
82
|
}
|
81
83
|
vaadin-password-field {
|
82
84
|
width: 100%;
|
85
|
+
box-sizing: border-box;
|
83
86
|
}
|
84
87
|
vaadin-password-field::part(input-field) {
|
85
88
|
padding: 0;
|
86
89
|
}
|
87
90
|
vaadin-password-field > input {
|
88
91
|
min-height: 0;
|
92
|
+
-webkit-mask-image: none;
|
89
93
|
}
|
90
|
-
|
91
94
|
vaadin-password-field[readonly] > input:placeholder-shown {
|
92
95
|
opacity: 1;
|
93
96
|
}
|
94
|
-
|
95
|
-
vaadin-password-field::part(input-field)::after {
|
96
|
-
opacity: 0;
|
97
|
-
}
|
98
97
|
vaadin-password-field::before {
|
99
98
|
height: initial;
|
100
99
|
}
|
101
|
-
|
100
|
+
vaadin-password-field::part(input-field)::after {
|
101
|
+
opacity: 0;
|
102
|
+
}
|
102
103
|
vaadin-password-field[required]::part(required-indicator)::after {
|
103
104
|
content: "*";
|
104
105
|
}
|
106
|
+
[readonly] vaadin-password-field-button {
|
107
|
+
pointer-events: none;
|
108
|
+
}
|
105
109
|
`,
|
106
110
|
excludeAttrsSync: ['tabindex'],
|
107
111
|
componentName
|
@@ -78,6 +78,18 @@ const {
|
|
78
78
|
const PhoneField = compose(
|
79
79
|
createStyleMixin({
|
80
80
|
mappings: {
|
81
|
+
fontSize: [
|
82
|
+
host, inputWrapper,
|
83
|
+
{
|
84
|
+
selector: TextField.componentName,
|
85
|
+
property: TextField.cssVarList.fontSize
|
86
|
+
},
|
87
|
+
{
|
88
|
+
selector: ComboBox.componentName,
|
89
|
+
property: ComboBox.cssVarList.fontSize
|
90
|
+
}
|
91
|
+
],
|
92
|
+
|
81
93
|
componentWidth: { ...host, property: 'width' },
|
82
94
|
|
83
95
|
wrapperBorderStyle: [
|
@@ -137,6 +149,8 @@ const PhoneField = compose(
|
|
137
149
|
:host {
|
138
150
|
--vaadin-field-default-width: auto;
|
139
151
|
display: inline-block;
|
152
|
+
max-width: 100%;
|
153
|
+
min-width: 15em;
|
140
154
|
}
|
141
155
|
div {
|
142
156
|
display: inline-flex;
|
@@ -163,7 +177,7 @@ const PhoneField = compose(
|
|
163
177
|
padding: 0;
|
164
178
|
min-height: 0;
|
165
179
|
width: 100%;
|
166
|
-
height: 100%;
|
180
|
+
height: 100%;
|
167
181
|
}
|
168
182
|
descope-phone-field-internal > div {
|
169
183
|
width: 100%;
|
package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js
CHANGED
@@ -102,7 +102,7 @@ class PhoneFieldInternal extends BaseInputClass {
|
|
102
102
|
this.inputs[0].focus()
|
103
103
|
})
|
104
104
|
|
105
|
-
super.init();
|
105
|
+
super.init?.();
|
106
106
|
this.initInputs();
|
107
107
|
this.setComboBoxDescriptor();
|
108
108
|
}
|
@@ -115,7 +115,10 @@ class PhoneFieldInternal extends BaseInputClass {
|
|
115
115
|
// Vaadin resets the input's value. We use setTimeout in order to make sure this happens
|
116
116
|
// after the reset.
|
117
117
|
if (countryData) {
|
118
|
-
setTimeout(() =>
|
118
|
+
setTimeout(() => {
|
119
|
+
this.countryCodeInput.selectedItem = this.countryCodeInput.items.find(node => node['data-id'] === countryCode);
|
120
|
+
});
|
121
|
+
|
119
122
|
}
|
120
123
|
}
|
121
124
|
}
|
@@ -31,6 +31,7 @@ let overrides = ``;
|
|
31
31
|
const TextArea = compose(
|
32
32
|
createStyleMixin({
|
33
33
|
mappings: {
|
34
|
+
fontSize: [host, textArea],
|
34
35
|
resize: textArea,
|
35
36
|
color: textArea,
|
36
37
|
cursor: {},
|
@@ -45,10 +46,10 @@ const TextArea = compose(
|
|
45
46
|
borderStyle: input,
|
46
47
|
borderColor: input,
|
47
48
|
borderRadius: input,
|
48
|
-
outlineWidth: input,
|
49
|
+
outlineWidth: [input, { property: 'padding' }],
|
49
50
|
outlineStyle: input,
|
50
51
|
outlineColor: input,
|
51
|
-
outlineOffset:
|
52
|
+
outlineOffset: input,
|
52
53
|
}
|
53
54
|
}),
|
54
55
|
draggableMixin,
|
@@ -67,8 +68,9 @@ const TextArea = compose(
|
|
67
68
|
overrides = `
|
68
69
|
:host {
|
69
70
|
display: inline-block;
|
71
|
+
min-width: 10em;
|
72
|
+
max-width: 100%;
|
70
73
|
}
|
71
|
-
|
72
74
|
vaadin-text-area {
|
73
75
|
margin: 0;
|
74
76
|
width: 100%;
|
@@ -76,10 +78,7 @@ overrides = `
|
|
76
78
|
}
|
77
79
|
vaadin-text-area > label,
|
78
80
|
vaadin-text-area::part(input-field) {
|
79
|
-
|
80
|
-
}
|
81
|
-
vaadin-text-area[focused]::part(input-field) {
|
82
|
-
cursor: text;
|
81
|
+
padding: 0;
|
83
82
|
}
|
84
83
|
vaadin-text-area[required]::part(required-indicator)::after {
|
85
84
|
content: "*";
|
@@ -57,10 +57,12 @@ overrides = `
|
|
57
57
|
:host {
|
58
58
|
display: inline-block;
|
59
59
|
--vaadin-field-default-width: auto;
|
60
|
+
max-width: 100%;
|
61
|
+
min-width: 10em;
|
62
|
+
|
60
63
|
}
|
61
64
|
vaadin-text-field {
|
62
65
|
margin: 0;
|
63
|
-
padding: 0;
|
64
66
|
width: 100%;
|
65
67
|
height: 100%;
|
66
68
|
box-sizing: border-box;
|
@@ -83,18 +85,11 @@ overrides = `
|
|
83
85
|
box-shadow: 0 0 0 var(${TextField.cssVarList.height}) var(${TextField.cssVarList.backgroundColor}) inset;
|
84
86
|
}
|
85
87
|
|
86
|
-
vaadin-text-field input {
|
88
|
+
vaadin-text-field > input {
|
87
89
|
-webkit-mask-image: none;
|
88
90
|
min-height: 0;
|
89
91
|
}
|
90
92
|
|
91
|
-
vaadin-text-field > label,
|
92
|
-
vaadin-text-field::part(input-field) {
|
93
|
-
color: var(${TextField.cssVarList.color});
|
94
|
-
}
|
95
|
-
vaadin-text-field::part(input-field):focus {
|
96
|
-
cursor: text;
|
97
|
-
}
|
98
93
|
vaadin-text-field[required]::part(required-indicator)::after {
|
99
94
|
content: "*";
|
100
95
|
color: var(${TextField.cssVarList.color});
|
@@ -103,7 +98,6 @@ overrides = `
|
|
103
98
|
opacity: 0 !important;
|
104
99
|
}
|
105
100
|
|
106
|
-
|
107
101
|
vaadin-text-field::before {
|
108
102
|
height: unset;
|
109
103
|
}
|
@@ -9,6 +9,7 @@ const selectors = {
|
|
9
9
|
|
10
10
|
export default {
|
11
11
|
backgroundColor: { selector: selectors.inputWrapper },
|
12
|
+
labelTextColor: { selector: selectors.label, property: 'color' },
|
12
13
|
color: { selector: selectors.inputWrapper },
|
13
14
|
width: { selector: selectors.host },
|
14
15
|
borderColor: [
|
@@ -88,7 +88,10 @@ export const createStyleMixin =
|
|
88
88
|
);
|
89
89
|
|
90
90
|
if (value) style?.setProperty(varName, value);
|
91
|
-
else
|
91
|
+
else {
|
92
|
+
style?.removeProperty(varName);
|
93
|
+
this.removeAttribute(attrName)
|
94
|
+
}
|
92
95
|
}
|
93
96
|
|
94
97
|
#updateOverridesStyle(attrs = []) {
|
@@ -46,20 +46,29 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
46
46
|
}
|
47
47
|
|
48
48
|
getErrorMessage(flags) {
|
49
|
+
const {
|
50
|
+
valueMissing,
|
51
|
+
patternMismatch,
|
52
|
+
typeMismatch,
|
53
|
+
stepMismatch,
|
54
|
+
tooShort,
|
55
|
+
tooLong,
|
56
|
+
customError
|
57
|
+
} = flags;
|
49
58
|
switch (true) {
|
50
|
-
case
|
59
|
+
case valueMissing:
|
51
60
|
return this.getAttribute(errorAttributes.valueMissing) ||
|
52
61
|
this.defaultErrorMsgValueMissing
|
53
|
-
case
|
62
|
+
case patternMismatch || typeMismatch || stepMismatch:
|
54
63
|
return this.getAttribute(errorAttributes.patternMismatch) ||
|
55
64
|
this.defaultErrorMsgPatternMismatch
|
56
|
-
case
|
65
|
+
case tooShort:
|
57
66
|
return this.getAttribute(errorAttributes.tooShort) ||
|
58
67
|
this.defaultErrorMsgTooShort
|
59
|
-
case
|
68
|
+
case tooLong:
|
60
69
|
return this.getAttribute(errorAttributes.tooLong) ||
|
61
70
|
this.defaultErrorMsgTooLong
|
62
|
-
case
|
71
|
+
case customError:
|
63
72
|
return this.validationMessage
|
64
73
|
default:
|
65
74
|
return ''
|
@@ -91,7 +100,7 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
91
100
|
return this.#internals.validity
|
92
101
|
}
|
93
102
|
|
94
|
-
get validationTarget
|
103
|
+
get validationTarget() {
|
95
104
|
return this.inputElement
|
96
105
|
}
|
97
106
|
|