@descope/web-components-ui 1.0.131 → 1.0.132
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +234 -186
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +234 -187
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/201.js +1 -1
- package/dist/umd/241.js +1 -1
- package/dist/umd/447.js +1 -1
- package/dist/umd/481.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-email-field-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-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/boolean-fields/descope-checkbox/CheckboxClass.js +11 -12
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +8 -9
- package/src/components/descope-button/ButtonClass.js +4 -5
- package/src/components/descope-combo-box/ComboBoxClass.js +24 -8
- package/src/components/descope-email-field/EmailFieldClass.js +2 -2
- package/src/components/descope-new-password/NewPasswordClass.js +5 -5
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +0 -1
- package/src/components/descope-number-field/NumberFieldClass.js +2 -2
- package/src/components/descope-passcode/PasscodeClass.js +5 -1
- package/src/components/descope-password/PasswordClass.js +22 -9
- package/src/components/descope-phone-field/PhoneFieldClass.js +9 -14
- package/src/components/descope-text/TextClass.js +1 -1
- package/src/components/descope-text-area/TextAreaClass.js +9 -10
- package/src/components/descope-text-field/TextFieldClass.js +2 -3
- package/src/components/descope-text-field/textFieldMappings.js +14 -21
- package/src/helpers/themeHelpers/resetHelpers.js +22 -6
- package/src/mixins/normalizeBooleanAttributesMixin.js +2 -1
- package/src/theme/components/comboBox.js +3 -0
- package/src/theme/components/emailField.js +2 -0
- package/src/theme/components/inputWrapper.js +5 -1
- package/src/theme/components/newPassword.js +1 -0
- package/src/theme/components/numberField.js +3 -1
- package/src/theme/components/passcode.js +1 -0
- package/src/theme/components/password.js +3 -1
- package/src/theme/components/phoneField.js +1 -1
- package/src/theme/components/textArea.js +1 -0
- package/src/theme/components/textField.js +2 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import { compose } from '../../helpers';
|
2
2
|
import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
|
3
|
-
import { resetInputCursor, resetInputPlaceholder, resetInputReadonlyStyle } from '../../helpers/themeHelpers/resetHelpers';
|
3
|
+
import { resetInputCursor, resetInputPlaceholder, resetInputReadonlyStyle, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
4
4
|
import {
|
5
5
|
createStyleMixin,
|
6
6
|
draggableMixin,
|
@@ -65,6 +65,7 @@ const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclas
|
|
65
65
|
const {
|
66
66
|
host,
|
67
67
|
inputField,
|
68
|
+
inputElement,
|
68
69
|
placeholder,
|
69
70
|
toggle,
|
70
71
|
label,
|
@@ -74,6 +75,7 @@ const {
|
|
74
75
|
} = {
|
75
76
|
host: { selector: () => ':host' },
|
76
77
|
inputField: { selector: '::part(input-field)' },
|
78
|
+
inputElement: { selector: 'input' },
|
77
79
|
placeholder: { selector: '> input:placeholder-shown' },
|
78
80
|
toggle: { selector: '::part(toggle-button)' },
|
79
81
|
label: { selector: '::part(label)' },
|
@@ -93,8 +95,8 @@ export const ComboBoxClass = compose(
|
|
93
95
|
hostWidth: { ...host, property: 'width' },
|
94
96
|
// we apply font-size also on the host so we can set its width with em
|
95
97
|
fontSize: [
|
96
|
-
{
|
97
|
-
|
98
|
+
{},
|
99
|
+
host,
|
98
100
|
],
|
99
101
|
fontFamily: [
|
100
102
|
label,
|
@@ -118,10 +120,19 @@ export const ComboBoxClass = compose(
|
|
118
120
|
inputPlaceholderTextColor: { ...placeholder, property: 'color' },
|
119
121
|
inputDropdownButtonCursor: { ...toggle, property: 'cursor' },
|
120
122
|
inputDropdownButtonColor: { ...toggle, property: 'color' },
|
123
|
+
inputDropdownButtonSize: { ...toggle, property: 'font-size' },
|
124
|
+
inputDropdownButtonOffset: [
|
125
|
+
{ ...toggle, property: 'margin-right' },
|
126
|
+
{ ...toggle, property: 'margin-left' },
|
127
|
+
],
|
121
128
|
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
122
129
|
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
123
130
|
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
124
131
|
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
132
|
+
inputHorizontalPadding: [
|
133
|
+
{ ...inputElement, property: 'padding-left' },
|
134
|
+
{ ...inputElement, property: 'padding-right' }
|
135
|
+
],
|
125
136
|
|
126
137
|
// we need to use the variables from the portal mixin
|
127
138
|
// so we need to use an arrow function on the selector
|
@@ -159,24 +170,29 @@ export const ComboBoxClass = compose(
|
|
159
170
|
display: inline-flex;
|
160
171
|
box-sizing: border-box;
|
161
172
|
-webkit-mask-image: none;
|
162
|
-
padding: calc(var(${ComboBoxClass.cssVarList.inputOutlineWidth}) + var(${ComboBoxClass.cssVarList.inputOutlineOffset}))
|
163
173
|
}
|
174
|
+
${useHostExternalPadding(ComboBoxClass.cssVarList)}
|
175
|
+
${resetInputReadonlyStyle('vaadin-combo-box')}
|
176
|
+
${resetInputPlaceholder('vaadin-combo-box')}
|
177
|
+
${resetInputCursor('vaadin-combo-box')}
|
178
|
+
|
164
179
|
vaadin-combo-box {
|
165
180
|
padding: 0;
|
166
181
|
width: 100%;
|
167
182
|
}
|
183
|
+
vaadin-combo-box::before {
|
184
|
+
height: initial;
|
185
|
+
}
|
168
186
|
vaadin-combo-box [slot="input"] {
|
169
187
|
-webkit-mask-image: none;
|
170
188
|
min-height: 0;
|
189
|
+
box-sizing: border-box;
|
171
190
|
}
|
172
191
|
|
173
192
|
vaadin-combo-box::part(input-field) {
|
174
193
|
padding: 0;
|
194
|
+
box-shadow: none;
|
175
195
|
}
|
176
|
-
|
177
|
-
${resetInputReadonlyStyle('vaadin-combo-box')}
|
178
|
-
${resetInputPlaceholder('vaadin-combo-box')}
|
179
|
-
${resetInputCursor('vaadin-combo-box')}
|
180
196
|
`,
|
181
197
|
// Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
|
182
198
|
// with the same name. Including it will cause Vaadin to calculate NaN size,
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
import textFieldMappings from '../descope-text-field/textFieldMappings';
|
9
9
|
import { compose } from '../../helpers';
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
-
import { resetInputOverrides } from '../../helpers/themeHelpers/resetHelpers';
|
11
|
+
import { resetInputOverrides, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
12
12
|
|
13
13
|
export const componentName = getComponentName('email-field');
|
14
14
|
|
@@ -27,9 +27,9 @@ export const EmailFieldClass = compose(
|
|
27
27
|
:host {
|
28
28
|
display: inline-block;
|
29
29
|
max-width: 100%;
|
30
|
-
min-width: 10em;
|
31
30
|
padding: calc(var(${EmailFieldClass.cssVarList.inputOutlineWidth}) + var(${EmailFieldClass.cssVarList.inputOutlineOffset}))
|
32
31
|
}
|
32
|
+
${useHostExternalPadding(EmailFieldClass.cssVarList)}
|
33
33
|
${resetInputOverrides('vaadin-email-field', EmailFieldClass.cssVarList)}
|
34
34
|
`,
|
35
35
|
excludeAttrsSync: ['tabindex'],
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
} from '../../mixins';
|
9
9
|
import { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';
|
10
10
|
import { PasswordClass } from '../descope-password/PasswordClass';
|
11
|
-
import {
|
11
|
+
import { useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
12
12
|
|
13
13
|
export const componentName = getComponentName('new-password');
|
14
14
|
|
@@ -73,6 +73,7 @@ export const NewPasswordClass = compose(
|
|
73
73
|
mappings: {
|
74
74
|
fontSize: [
|
75
75
|
host,
|
76
|
+
{},
|
76
77
|
{
|
77
78
|
selector: PasswordClass.componentName,
|
78
79
|
property: PasswordClass.cssVarList.fontSize
|
@@ -84,6 +85,7 @@ export const NewPasswordClass = compose(
|
|
84
85
|
helperText
|
85
86
|
],
|
86
87
|
hostWidth: { ...host, property: 'width' },
|
88
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
87
89
|
inputsRequiredIndicator: { ...host, property: 'content' },
|
88
90
|
spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },
|
89
91
|
}
|
@@ -99,10 +101,9 @@ export const NewPasswordClass = compose(
|
|
99
101
|
:host {
|
100
102
|
display: inline-block;
|
101
103
|
max-width: 100%;
|
102
|
-
min-width: 10em;
|
103
104
|
box-sizing: border-box;
|
104
105
|
}
|
105
|
-
${
|
106
|
+
${useHostExternalPadding(PasswordClass.cssVarList)}
|
106
107
|
vaadin-text-field {
|
107
108
|
padding: 0;
|
108
109
|
width: 100%;
|
@@ -111,7 +112,6 @@ export const NewPasswordClass = compose(
|
|
111
112
|
vaadin-text-field::part(input-field) {
|
112
113
|
min-height: 0;
|
113
114
|
background: transparent;
|
114
|
-
overflow: hidden;
|
115
115
|
box-shadow: none;
|
116
116
|
padding: 0;
|
117
117
|
}
|
@@ -130,7 +130,7 @@ export const NewPasswordClass = compose(
|
|
130
130
|
width: 100%;
|
131
131
|
height: 100%;
|
132
132
|
display: flex;
|
133
|
-
|
133
|
+
flex-direction: column;
|
134
134
|
}
|
135
135
|
descope-password {
|
136
136
|
display: block;
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
import textFieldMappings from '../descope-text-field/textFieldMappings';
|
9
9
|
import { compose } from '../../helpers';
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
-
import { resetInputOverrides } from '../../helpers/themeHelpers/resetHelpers';
|
11
|
+
import { resetInputOverrides, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
12
12
|
|
13
13
|
export const componentName = getComponentName('number-field');
|
14
14
|
|
@@ -27,9 +27,9 @@ export const NumberFieldClass = compose(
|
|
27
27
|
:host {
|
28
28
|
display: inline-block;
|
29
29
|
max-width: 100%;
|
30
|
-
min-width: 10em;
|
31
30
|
padding: calc(var(${NumberFieldClass.cssVarList.inputOutlineWidth}) + var(${NumberFieldClass.cssVarList.inputOutlineOffset}));
|
32
31
|
}
|
32
|
+
${useHostExternalPadding(NumberFieldClass.cssVarList)}
|
33
33
|
${resetInputOverrides('vaadin-number-field', NumberFieldClass.cssVarList)}
|
34
34
|
`,
|
35
35
|
excludeAttrsSync: ['tabindex'],
|
@@ -93,7 +93,11 @@ export const PasscodeClass = compose(
|
|
93
93
|
selector: TextFieldClass.componentName,
|
94
94
|
property: textVars.inputValueTextColor
|
95
95
|
},
|
96
|
-
|
96
|
+
digitSize: [
|
97
|
+
{ ...digitField, property: 'height' },
|
98
|
+
{ ...digitField, property: 'width' }
|
99
|
+
],
|
100
|
+
digitPadding: { ...digitField, property: textVars.inputHorizontalPadding },
|
97
101
|
digitTextAlign: { ...digitField, property: textVars.inputTextAlign },
|
98
102
|
digitCaretTextColor: { ...digitField, property: textVars.inputCaretTextColor },
|
99
103
|
digitSpacing: { ...internalWrapper, property: 'gap' },
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
import { compose } from '../../helpers';
|
9
9
|
import { getComponentName } from '../../helpers/componentHelpers';
|
10
10
|
import passwordDraggableMixin from './passwordDraggableMixin';
|
11
|
-
import { resetInputCursor } from '../../helpers/themeHelpers/resetHelpers';
|
11
|
+
import { resetInputCursor, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
12
12
|
|
13
13
|
export const componentName = getComponentName('password');
|
14
14
|
|
@@ -40,9 +40,10 @@ export const PasswordClass = compose(
|
|
40
40
|
createStyleMixin({
|
41
41
|
mappings: {
|
42
42
|
hostWidth: { ...host, property: 'width' },
|
43
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
43
44
|
fontSize: [
|
44
|
-
{
|
45
|
-
|
45
|
+
{},
|
46
|
+
host,
|
46
47
|
],
|
47
48
|
fontFamily: [
|
48
49
|
label,
|
@@ -51,6 +52,10 @@ export const PasswordClass = compose(
|
|
51
52
|
helperText
|
52
53
|
],
|
53
54
|
inputHeight: { ...inputField, property: 'height' },
|
55
|
+
inputHorizontalPadding: [
|
56
|
+
{ ...inputElement, property: 'padding-left' },
|
57
|
+
{ ...inputElement, property: 'padding-right' }
|
58
|
+
],
|
54
59
|
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
55
60
|
|
56
61
|
inputBorderStyle: { ...inputField, property: 'border-style' },
|
@@ -75,7 +80,12 @@ export const PasswordClass = compose(
|
|
75
80
|
],
|
76
81
|
inputPlaceholderTextColor: { ...inputElementPlaceholder, property: 'color' },
|
77
82
|
|
78
|
-
revealButtonOffset:
|
83
|
+
revealButtonOffset: [
|
84
|
+
{ ...revealButtonContainer, property: 'margin-right' },
|
85
|
+
{ ...revealButtonContainer, property: 'margin-left' }
|
86
|
+
],
|
87
|
+
revealButtonSize: { ...revealButtonContainer, property: 'font-size' },
|
88
|
+
|
79
89
|
}
|
80
90
|
}),
|
81
91
|
draggableMixin,
|
@@ -89,17 +99,22 @@ export const PasswordClass = compose(
|
|
89
99
|
style: () => `
|
90
100
|
:host {
|
91
101
|
display: inline-block;
|
92
|
-
min-width: 10em;
|
93
102
|
max-width: 100%;
|
94
|
-
|
95
|
-
padding: calc(var(${PasswordClass.cssVarList.inputOutlineWidth}) + var(${PasswordClass.cssVarList.inputOutlineOffset}));
|
103
|
+
min-width: 10em;
|
96
104
|
}
|
105
|
+
${useHostExternalPadding(PasswordClass.cssVarList)}
|
106
|
+
${resetInputCursor('vaadin-password-field')}
|
107
|
+
|
97
108
|
vaadin-password-field {
|
98
109
|
width: 100%;
|
99
110
|
box-sizing: border-box;
|
100
111
|
padding: 0;
|
101
112
|
}
|
113
|
+
vaadin-password-field > input {
|
114
|
+
box-sizing: border-box;
|
115
|
+
}
|
102
116
|
vaadin-password-field::part(input-field) {
|
117
|
+
box-sizing: border-box;
|
103
118
|
padding: 0;
|
104
119
|
}
|
105
120
|
vaadin-password-field[focus-ring]::part(input-field) {
|
@@ -122,8 +137,6 @@ export const PasswordClass = compose(
|
|
122
137
|
cursor: pointer;
|
123
138
|
}
|
124
139
|
|
125
|
-
${resetInputCursor('vaadin-password-field')}
|
126
|
-
|
127
140
|
[readonly] vaadin-password-field-button {
|
128
141
|
pointer-events: none;
|
129
142
|
}
|
@@ -10,7 +10,7 @@ import {
|
|
10
10
|
import { TextFieldClass } from '../descope-text-field/TextFieldClass';
|
11
11
|
import { ComboBoxClass } from '../descope-combo-box/ComboBoxClass';
|
12
12
|
import CountryCodes from './CountryCodes';
|
13
|
-
import { resetInputCursor, resetInputFieldInvalidBackgroundColor,
|
13
|
+
import { resetInputCursor, resetInputFieldInvalidBackgroundColor, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
14
14
|
|
15
15
|
const textVars = TextFieldClass.cssVarList;
|
16
16
|
const comboVars = ComboBoxClass.cssVarList;
|
@@ -84,8 +84,8 @@ export const PhoneFieldClass = compose(
|
|
84
84
|
createStyleMixin({
|
85
85
|
mappings: {
|
86
86
|
fontSize: [
|
87
|
-
|
88
|
-
|
87
|
+
host,
|
88
|
+
inputField,
|
89
89
|
{
|
90
90
|
selector: TextFieldClass.componentName,
|
91
91
|
property: TextFieldClass.cssVarList.fontSize
|
@@ -124,8 +124,6 @@ export const PhoneFieldClass = compose(
|
|
124
124
|
],
|
125
125
|
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
126
126
|
|
127
|
-
inputHeight: { ...inputField, property: 'height' },
|
128
|
-
|
129
127
|
countryCodeInputWidth: { ...countryCodeInput, property: comboVars.hostWidth },
|
130
128
|
countryCodeDropdownWidth: {
|
131
129
|
...countryCodeInput,
|
@@ -170,8 +168,11 @@ export const PhoneFieldClass = compose(
|
|
170
168
|
max-width: 100%;
|
171
169
|
min-width: 15em;
|
172
170
|
box-sizing: border-box;
|
173
|
-
padding: calc(var(${PhoneFieldClass.cssVarList.inputOutlineWidth}) + var(${PhoneFieldClass.cssVarList.inputOutlineOffset}))
|
174
171
|
}
|
172
|
+
${useHostExternalPadding(PhoneFieldClass.cssVarList)}
|
173
|
+
${resetInputCursor('vaadin-text-field')}
|
174
|
+
${resetInputFieldInvalidBackgroundColor('vaadin-text-field')}
|
175
|
+
|
175
176
|
div {
|
176
177
|
display: inline-flex;
|
177
178
|
}
|
@@ -210,7 +211,7 @@ export const PhoneFieldClass = compose(
|
|
210
211
|
}
|
211
212
|
descope-combo-box {
|
212
213
|
flex-shrink: 0;
|
213
|
-
|
214
|
+
min-width: 5.75em;
|
214
215
|
${comboVars.inputOutlineWidth}: 0;
|
215
216
|
${comboVars.inputOutlineOffset}: 0;
|
216
217
|
${comboVars.inputBorderWidth}: 0;
|
@@ -218,9 +219,8 @@ export const PhoneFieldClass = compose(
|
|
218
219
|
}
|
219
220
|
descope-text-field {
|
220
221
|
flex-grow: 1;
|
221
|
-
min-height: 0;
|
222
|
-
height: 100%;
|
223
222
|
${textVars.inputOutlineWidth}: 0;
|
223
|
+
${comboVars.inputOutlineOffset}: 0;
|
224
224
|
${textVars.inputBorderWidth}: 0;
|
225
225
|
${textVars.inputBorderRadius}: 0;
|
226
226
|
}
|
@@ -230,11 +230,6 @@ export const PhoneFieldClass = compose(
|
|
230
230
|
vaadin-text-field::part(input-field)::after {
|
231
231
|
border: none;
|
232
232
|
}
|
233
|
-
|
234
|
-
${resetInputFieldDefaultWidth()}
|
235
|
-
${resetInputCursor('vaadin-text-field')}
|
236
|
-
${resetInputFieldInvalidBackgroundColor('vaadin-text-field')}
|
237
|
-
|
238
233
|
`,
|
239
234
|
excludeAttrsSync: ['tabindex'],
|
240
235
|
componentName
|
@@ -32,7 +32,7 @@ export const TextClass = compose(
|
|
32
32
|
createStyleMixin({
|
33
33
|
mappings: {
|
34
34
|
hostWidth: { selector: () => ':host', property: 'width' },
|
35
|
-
fontSize: {
|
35
|
+
fontSize: {},
|
36
36
|
textColor: { property: 'color' },
|
37
37
|
textLineHeight: { property: 'line-height' },
|
38
38
|
textLetterSpacing: { property: 'letter-spacing' },
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
} from '../../mixins';
|
8
8
|
import { compose } from '../../helpers';
|
9
9
|
import { getComponentName } from '../../helpers/componentHelpers';
|
10
|
-
import { resetInputContainer, resetInputCursor, resetInputField, resetInputPlaceholder } from '../../helpers/themeHelpers/resetHelpers';
|
10
|
+
import { resetInputContainer, resetInputCursor, resetInputField, resetInputPlaceholder, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
11
11
|
|
12
12
|
export const componentName = getComponentName('text-area');
|
13
13
|
|
@@ -35,15 +35,16 @@ export const TextAreaClass = compose(
|
|
35
35
|
createStyleMixin({
|
36
36
|
mappings: {
|
37
37
|
hostWidth: { ...host, property: 'width' },
|
38
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
38
39
|
fontSize: [
|
39
|
-
|
40
|
-
|
40
|
+
host,
|
41
|
+
textArea,
|
41
42
|
],
|
42
43
|
fontFamily: [
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
label,
|
45
|
+
inputField,
|
46
|
+
helperText,
|
47
|
+
errorMessage,
|
47
48
|
],
|
48
49
|
labelTextColor: [
|
49
50
|
{ ...label, property: 'color' },
|
@@ -74,11 +75,9 @@ export const TextAreaClass = compose(
|
|
74
75
|
style: () => `
|
75
76
|
:host {
|
76
77
|
display: inline-block;
|
77
|
-
min-width: 10em;
|
78
78
|
max-width: 100%;
|
79
|
-
padding: calc(var(${TextAreaClass.cssVarList.inputOutlineWidth}) + var(${TextAreaClass.cssVarList.inputOutlineOffset}));
|
80
79
|
}
|
81
|
-
|
80
|
+
${useHostExternalPadding(TextAreaClass.cssVarList)}
|
82
81
|
${resetInputContainer('vaadin-text-area')}
|
83
82
|
${resetInputField('vaadin-text-area')}
|
84
83
|
${resetInputPlaceholder('vaadin-text-area', 'textarea')}
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
import textFieldMappings from './textFieldMappings';
|
9
9
|
import { compose } from '../../helpers';
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
-
import {
|
11
|
+
import { resetInputOverrides, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
12
12
|
|
13
13
|
export const componentName = getComponentName('text-field');
|
14
14
|
|
@@ -50,10 +50,9 @@ export const TextFieldClass = compose(
|
|
50
50
|
:host {
|
51
51
|
display: inline-block;
|
52
52
|
max-width: 100%;
|
53
|
-
min-width: 10em;
|
54
53
|
padding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${TextFieldClass.cssVarList.inputOutlineOffset}));
|
55
54
|
}
|
56
|
-
${
|
55
|
+
${useHostExternalPadding(TextFieldClass.cssVarList)}
|
57
56
|
${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}
|
58
57
|
`,
|
59
58
|
excludeAttrsSync: ['tabindex'],
|
@@ -5,7 +5,6 @@ const {
|
|
5
5
|
requiredIndicator,
|
6
6
|
inputField,
|
7
7
|
input,
|
8
|
-
readOnlyInput,
|
9
8
|
helperText,
|
10
9
|
errorMessage
|
11
10
|
} = {
|
@@ -15,7 +14,6 @@ const {
|
|
15
14
|
placeholder: { selector: '> input:placeholder-shown' },
|
16
15
|
inputField: { selector: '::part(input-field)' },
|
17
16
|
input: { selector: 'input' },
|
18
|
-
readOnlyInput: { selector: '[readonly]::part(input-field)::after' },
|
19
17
|
helperText: { selector: '::part(helper-text)' },
|
20
18
|
errorMessage: { selector: '::part(error-message)' }
|
21
19
|
};
|
@@ -23,17 +21,18 @@ const {
|
|
23
21
|
export default {
|
24
22
|
// we apply font-size also on the host so we can set its width with em
|
25
23
|
fontSize: [
|
26
|
-
{
|
27
|
-
|
24
|
+
{},
|
25
|
+
host,
|
28
26
|
],
|
29
27
|
fontFamily: [
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
label,
|
29
|
+
inputField,
|
30
|
+
helperText,
|
31
|
+
errorMessage,
|
34
32
|
],
|
35
33
|
|
36
34
|
hostWidth: { ...host, property: 'width' },
|
35
|
+
hostMinWidth: { ...host, property: 'min-width' },
|
37
36
|
|
38
37
|
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
39
38
|
|
@@ -47,22 +46,16 @@ export default {
|
|
47
46
|
|
48
47
|
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
49
48
|
|
50
|
-
inputBorderColor:
|
51
|
-
|
52
|
-
|
53
|
-
],
|
54
|
-
inputBorderWidth: [
|
55
|
-
{ ...inputField, property: 'border-width' },
|
56
|
-
{ ...readOnlyInput, property: 'border-width' }
|
57
|
-
],
|
58
|
-
inputBorderStyle: [
|
59
|
-
{ ...inputField, property: 'border-style' },
|
60
|
-
{ ...readOnlyInput, property: 'border-style' }
|
61
|
-
],
|
49
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
50
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
51
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
62
52
|
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
63
53
|
|
64
54
|
inputHeight: { ...inputField, property: 'height' },
|
65
|
-
|
55
|
+
inputHorizontalPadding: [
|
56
|
+
{ ...input, property: 'padding-left' },
|
57
|
+
{ ...input, property: 'padding-right' }
|
58
|
+
],
|
66
59
|
|
67
60
|
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
68
61
|
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
@@ -5,18 +5,34 @@ export const resetInputOverrides = (name, cssVarList) => `
|
|
5
5
|
${resetInputField(name)}
|
6
6
|
${resetInputAutoFill(name, cssVarList)}
|
7
7
|
${resetInputFieldInvalidBackgroundColor(name)}
|
8
|
+
${resetInitialHeight(name)}
|
9
|
+
${resetInputElement(name)}
|
10
|
+
${resetInputFieldunderlayingBorder(name)}
|
11
|
+
`;
|
12
|
+
|
13
|
+
export const useHostExternalPadding = (cssVarList) => `
|
14
|
+
:host {
|
15
|
+
padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))
|
16
|
+
}
|
17
|
+
`;
|
18
|
+
|
19
|
+
export const resetInputFieldunderlayingBorder = (name) => `
|
20
|
+
${name}::part(input-field)::after {
|
21
|
+
border: none;
|
22
|
+
}
|
23
|
+
`;
|
8
24
|
|
25
|
+
export const resetInitialHeight = (name) => `
|
9
26
|
${name}::before {
|
10
27
|
height: unset;
|
11
28
|
}
|
29
|
+
`;
|
12
30
|
|
31
|
+
export const resetInputElement = (name) => `
|
13
32
|
${name} > input {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
${name}::part(input-field)::after {
|
19
|
-
opacity: 0 !important;
|
33
|
+
-webkit-mask-image: none;
|
34
|
+
min-height: 0;
|
35
|
+
box-sizing: border-box;
|
20
36
|
}
|
21
37
|
`;
|
22
38
|
|
@@ -23,9 +23,12 @@ export const comboBox = {
|
|
23
23
|
[vars.inputValueTextColor]: refs.valueTextColor,
|
24
24
|
[vars.inputPlaceholderTextColor]: refs.placeholderTextColor,
|
25
25
|
[vars.inputBackgroundColor]: refs.backgroundColor,
|
26
|
+
[vars.inputHorizontalPadding]: refs.horizontalPadding,
|
26
27
|
[vars.inputHeight]: refs.inputHeight,
|
27
28
|
[vars.inputDropdownButtonColor]: globalRefs.colors.surface.contrast,
|
28
29
|
[vars.inputDropdownButtonCursor]: 'pointer',
|
30
|
+
[vars.inputDropdownButtonSize]: refs.toggleButtonSize,
|
31
|
+
[vars.inputDropdownButtonOffset]: globalRefs.spacing.xs,
|
29
32
|
|
30
33
|
_readonly: {
|
31
34
|
[vars.inputDropdownButtonCursor]: 'default'
|
@@ -5,6 +5,7 @@ const vars = EmailFieldClass.cssVarList;
|
|
5
5
|
|
6
6
|
const emailField = {
|
7
7
|
[vars.hostWidth]: refs.width,
|
8
|
+
[vars.hostMinWidth]: refs.minWidth,
|
8
9
|
[vars.fontSize]: refs.fontSize,
|
9
10
|
[vars.fontFamily]: refs.fontFamily,
|
10
11
|
[vars.labelTextColor]: refs.labelTextColor,
|
@@ -20,6 +21,7 @@ const emailField = {
|
|
20
21
|
[vars.inputOutlineColor]: refs.outlineColor,
|
21
22
|
[vars.inputOutlineOffset]: refs.outlineOffset,
|
22
23
|
[vars.inputBackgroundColor]: refs.backgroundColor,
|
24
|
+
[vars.inputHorizontalPadding]: refs.horizontalPadding,
|
23
25
|
[vars.inputHeight]: refs.inputHeight
|
24
26
|
};
|
25
27
|
|
@@ -21,7 +21,11 @@ const [theme, refs, vars] = createHelperVars({
|
|
21
21
|
outlineColor: 'transparent',
|
22
22
|
outlineOffset: '0px', // we need to keep the px unit even for 0 value, as this var is used for calc in different component classes
|
23
23
|
|
24
|
-
|
24
|
+
minWidth: '10em',
|
25
|
+
toggleButtonSize: '1.5em',
|
26
|
+
inputHeight: '3em',
|
27
|
+
horizontalPadding: '0.5em',
|
28
|
+
verticalPadding: '0.5em',
|
25
29
|
|
26
30
|
backgroundColor: globalRefs.colors.surface.light,
|
27
31
|
|
@@ -5,6 +5,7 @@ const vars = NumberFieldClass.cssVarList;
|
|
5
5
|
|
6
6
|
const numberField = {
|
7
7
|
[vars.hostWidth]: refs.width,
|
8
|
+
[vars.hostMinWidth]: refs.minWidth,
|
8
9
|
[vars.fontSize]: refs.fontSize,
|
9
10
|
[vars.fontFamily]: refs.fontFamily,
|
10
11
|
[vars.labelTextColor]: refs.labelTextColor,
|
@@ -20,7 +21,8 @@ const numberField = {
|
|
20
21
|
[vars.inputOutlineOffset]: refs.outlineOffset,
|
21
22
|
[vars.inputBackgroundColor]: refs.backgroundColor,
|
22
23
|
[vars.labelRequiredIndicator]: refs.requiredIndicator,
|
23
|
-
[vars.
|
24
|
+
[vars.inputHorizontalPadding]: refs.horizontalPadding,
|
25
|
+
[vars.inputHeight]: refs.inputHeight
|
24
26
|
};
|
25
27
|
|
26
28
|
export default numberField;
|
@@ -19,6 +19,7 @@ const passcode = {
|
|
19
19
|
[vars.digitOutlineColor]: 'transparent',
|
20
20
|
[vars.digitOutlineWidth]: refs.outlineWidth,
|
21
21
|
[vars.focusedDigitFieldOutlineColor]: refs.outlineColor,
|
22
|
+
[vars.digitSize]: refs.inputHeight,
|
22
23
|
|
23
24
|
_hideCursor: {
|
24
25
|
[vars.digitCaretTextColor]: 'transparent',
|
@@ -11,6 +11,7 @@ const password = {
|
|
11
11
|
[vars.fontSize]: refs.fontSize,
|
12
12
|
[vars.fontFamily]: refs.fontFamily,
|
13
13
|
[vars.labelTextColor]: refs.labelTextColor,
|
14
|
+
[vars.inputHorizontalPadding]: refs.horizontalPadding,
|
14
15
|
[vars.inputHeight]: refs.inputHeight,
|
15
16
|
[vars.inputBackgroundColor]: refs.backgroundColor,
|
16
17
|
[vars.labelRequiredIndicator]: refs.requiredIndicator,
|
@@ -24,7 +25,8 @@ const password = {
|
|
24
25
|
[vars.inputOutlineStyle]: refs.outlineStyle,
|
25
26
|
[vars.inputOutlineColor]: refs.outlineColor,
|
26
27
|
[vars.inputOutlineOffset]: refs.outlineOffset,
|
27
|
-
[vars.revealButtonOffset]: globalRefs.spacing.md
|
28
|
+
[vars.revealButtonOffset]: globalRefs.spacing.md,
|
29
|
+
[vars.revealButtonSize]: refs.toggleButtonSize
|
28
30
|
};
|
29
31
|
|
30
32
|
export default password;
|
@@ -20,7 +20,7 @@ const phoneField = {
|
|
20
20
|
[vars.inputOutlineColor]: refs.outlineColor,
|
21
21
|
[vars.inputOutlineOffset]: refs.outlineOffset,
|
22
22
|
[vars.inputHeight]: refs.inputHeight,
|
23
|
-
[vars.phoneInputWidth]:
|
23
|
+
[vars.phoneInputWidth]: refs.minWidth,
|
24
24
|
[vars.countryCodeInputWidth]: '5em',
|
25
25
|
[vars.countryCodeDropdownWidth]: '20em',
|
26
26
|
|