@descope/web-components-ui 1.0.114 → 1.0.116
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +1299 -1305
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1384 -1390
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/201.js +1 -0
- package/dist/umd/241.js +1 -1
- package/dist/umd/447.js +1 -1
- package/dist/umd/65.js +1 -1
- package/dist/umd/803.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-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-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-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/commonStyles.js +13 -5
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +40 -37
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +43 -37
- package/src/components/descope-button/ButtonClass.js +22 -6
- package/src/components/descope-combo-box/ComboBoxClass.js +49 -36
- package/src/components/descope-container/ContainerClass.js +4 -4
- package/src/components/descope-divider/DividerClass.js +74 -55
- package/src/components/descope-email-field/EmailFieldClass.js +11 -47
- package/src/components/descope-link/LinkClass.js +8 -5
- package/src/components/descope-loader-linear/LoaderLinearClass.js +16 -12
- package/src/components/descope-loader-radial/LoaderRadialClass.js +12 -11
- package/src/components/descope-new-password/NewPasswordClass.js +65 -51
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +1 -1
- package/src/components/descope-number-field/NumberFieldClass.js +11 -43
- package/src/components/descope-passcode/PasscodeClass.js +36 -29
- package/src/components/descope-password-field/PasswordFieldClass.js +52 -41
- package/src/components/descope-phone-field/PhoneFieldClass.js +61 -41
- package/src/components/descope-text/TextClass.js +8 -8
- package/src/components/descope-text-area/TextAreaClass.js +50 -48
- package/src/components/descope-text-field/TextFieldClass.js +11 -53
- package/src/components/descope-text-field/textFieldMappings.js +66 -38
- package/src/helpers/themeHelpers/index.js +10 -8
- package/src/helpers/themeHelpers/resetHelpers.js +76 -0
- package/src/index.d.ts +2 -1
- package/src/mixins/createStyleMixin/index.js +38 -27
- package/src/mixins/inputValidationMixin.js +4 -1
- package/src/mixins/proxyInputMixin.js +11 -3
- package/src/theme/components/button.js +31 -16
- package/src/theme/components/checkbox.js +18 -47
- package/src/theme/components/comboBox.js +24 -36
- package/src/theme/components/container.js +34 -47
- package/src/theme/components/divider.js +31 -20
- package/src/theme/components/emailField.js +21 -3
- package/src/theme/components/image.js +1 -1
- package/src/theme/components/index.js +4 -3
- package/src/theme/components/inputWrapper.js +72 -0
- package/src/theme/components/link.js +15 -22
- package/src/theme/components/loader/loaderLinear.js +19 -24
- package/src/theme/components/loader/loaderRadial.js +32 -47
- package/src/theme/components/logo.js +1 -1
- package/src/theme/components/newPassword.js +11 -26
- package/src/theme/components/numberField.js +21 -3
- package/src/theme/components/passcode.js +17 -28
- package/src/theme/components/passwordField.js +19 -65
- package/src/theme/components/phoneField.js +18 -57
- package/src/theme/components/switchToggle.js +20 -34
- package/src/theme/components/text.js +14 -9
- package/src/theme/components/textArea.js +20 -37
- package/src/theme/components/textField.js +21 -68
@@ -8,16 +8,13 @@ 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
12
|
|
12
13
|
export const componentName = getComponentName('email-field');
|
13
14
|
|
14
|
-
let overrides = ``;
|
15
|
-
|
16
15
|
export const EmailFieldClass = compose(
|
17
16
|
createStyleMixin({
|
18
|
-
mappings:
|
19
|
-
...textFieldMappings
|
20
|
-
}
|
17
|
+
mappings: textFieldMappings
|
21
18
|
}),
|
22
19
|
draggableMixin,
|
23
20
|
proxyInputMixin,
|
@@ -26,49 +23,16 @@ export const EmailFieldClass = compose(
|
|
26
23
|
createProxy({
|
27
24
|
slots: ['suffix'],
|
28
25
|
wrappedEleName: 'vaadin-email-field',
|
29
|
-
style: () =>
|
26
|
+
style: () => `
|
27
|
+
:host {
|
28
|
+
display: inline-block;
|
29
|
+
max-width: 100%;
|
30
|
+
min-width: 10em;
|
31
|
+
padding: calc(var(${EmailFieldClass.cssVarList.inputOutlineWidth}) + var(${EmailFieldClass.cssVarList.inputOutlineOffset}))
|
32
|
+
}
|
33
|
+
${resetInputOverrides('vaadin-email-field', EmailFieldClass.cssVarList)}
|
34
|
+
`,
|
30
35
|
excludeAttrsSync: ['tabindex'],
|
31
36
|
componentName
|
32
37
|
})
|
33
38
|
);
|
34
|
-
|
35
|
-
overrides = `
|
36
|
-
:host {
|
37
|
-
display: inline-block;
|
38
|
-
min-width: 10em;
|
39
|
-
max-width: 100%;
|
40
|
-
}
|
41
|
-
vaadin-email-field {
|
42
|
-
margin: 0;
|
43
|
-
width: 100%;
|
44
|
-
box-sizing: border-box;
|
45
|
-
}
|
46
|
-
vaadin-email-field::before {
|
47
|
-
height: 0;
|
48
|
-
}
|
49
|
-
vaadin-email-field > input {
|
50
|
-
-webkit-mask-image: none;
|
51
|
-
}
|
52
|
-
vaadin-email-field::part(input-field) {
|
53
|
-
overflow: hidden;
|
54
|
-
padding: 0;
|
55
|
-
}
|
56
|
-
vaadin-email-field[readonly] > input:placeholder-shown {
|
57
|
-
opacity: 1;
|
58
|
-
}
|
59
|
-
vaadin-email-field input:-webkit-autofill,
|
60
|
-
vaadin-email-field input:-webkit-autofill::first-line,
|
61
|
-
vaadin-email-field input:-webkit-autofill:hover,
|
62
|
-
vaadin-email-field input:-webkit-autofill:active,
|
63
|
-
vaadin-email-field input:-webkit-autofill:focus {
|
64
|
-
-webkit-text-fill-color: var(${EmailFieldClass.cssVarList.color});
|
65
|
-
box-shadow: 0 0 0 var(${EmailFieldClass.cssVarList.height}) var(${EmailFieldClass.cssVarList.backgroundColor}) inset;
|
66
|
-
}
|
67
|
-
vaadin-email-field[required]::part(required-indicator)::after {
|
68
|
-
content: "*";
|
69
|
-
color: var(${EmailFieldClass.cssVarList.color});
|
70
|
-
}
|
71
|
-
vaadin-email-field[readonly]::part(input-field)::after {
|
72
|
-
border: 0 solid;
|
73
|
-
}
|
74
|
-
`;
|
@@ -57,13 +57,16 @@ const { anchor, text, host, wrapper } = selectors;
|
|
57
57
|
export const LinkClass = compose(
|
58
58
|
createStyleMixin({
|
59
59
|
mappings: {
|
60
|
-
|
60
|
+
hostWidth: { ...host, property: 'width' },
|
61
61
|
textAlign: wrapper,
|
62
|
-
|
62
|
+
textColor: [
|
63
|
+
{ ...anchor, property: 'color' },
|
64
|
+
{ ...text, property: TextClass.cssVarList.textColor }
|
65
|
+
],
|
63
66
|
cursor: anchor,
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
+
textUnderlineWidth: { ...anchor, property: 'border-bottom-width' },
|
68
|
+
textUnderlineStyle: { ...anchor, property: 'border-bottom-style' },
|
69
|
+
textUnderlineColor: { ...anchor, property: 'border-bottom-color' }
|
67
70
|
},
|
68
71
|
}),
|
69
72
|
draggableMixin,
|
@@ -32,7 +32,6 @@ class RawLoaderLinear extends createBaseClass({ componentName, baseSelector: ':h
|
|
32
32
|
position: absolute;
|
33
33
|
left: 0;
|
34
34
|
}
|
35
|
-
|
36
35
|
:host > div {
|
37
36
|
width: 100%;
|
38
37
|
}
|
@@ -43,26 +42,31 @@ class RawLoaderLinear extends createBaseClass({ componentName, baseSelector: ':h
|
|
43
42
|
}
|
44
43
|
|
45
44
|
const selectors = {
|
46
|
-
root: {},
|
47
45
|
after: { selector: '::after' },
|
48
46
|
host: { selector: () => ':host' }
|
49
47
|
};
|
50
48
|
|
51
|
-
const {
|
49
|
+
const { after, host } = selectors;
|
52
50
|
|
53
51
|
export const LoaderLinearClass = compose(
|
54
52
|
createStyleMixin({
|
55
53
|
mappings: {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
54
|
+
hostDisplay: {},
|
55
|
+
hostWidth: { ...host, property: 'width' },
|
56
|
+
barHeight: [
|
57
|
+
{ property: 'height' },
|
58
|
+
{ ...after, property: 'height' }
|
59
|
+
],
|
60
|
+
barBorderRadius: [
|
61
|
+
{ property: 'border-radius' },
|
62
|
+
{ ...after, property: 'border-radius' }
|
63
|
+
],
|
64
|
+
barBackgroundColor: { property: 'background-color' },
|
65
|
+
barColor: { ...after, property: 'background-color' },
|
62
66
|
barWidth: { ...after, property: 'width' },
|
63
|
-
animationDuration: [
|
64
|
-
animationTimingFunction: [
|
65
|
-
animationIterationCount: [
|
67
|
+
animationDuration: [{}, after],
|
68
|
+
animationTimingFunction: [{}, after],
|
69
|
+
animationIterationCount: [{}, after]
|
66
70
|
}
|
67
71
|
}),
|
68
72
|
draggableMixin,
|
@@ -35,17 +35,18 @@ class RawLoaderRadial extends createBaseClass({ componentName, baseSelector: ':h
|
|
35
35
|
export const LoaderRadialClass = compose(
|
36
36
|
createStyleMixin({
|
37
37
|
mappings: {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
hostDisplay: { property: 'display' },
|
39
|
+
spinnerSize: [
|
40
|
+
{ property: 'width' },
|
41
|
+
{ property: 'height' }
|
42
|
+
],
|
43
|
+
spinnerBorderWidth: { property: 'border-width' },
|
44
|
+
spinnerBorderStyle: { property: 'border-style' },
|
45
|
+
spinnerBorderRadius: { property: 'border-radius' },
|
46
|
+
spinnerQuadrant1Color: { property: 'border-top-color' },
|
47
|
+
spinnerQuadrant2Color: { property: 'border-bottom-color' },
|
48
|
+
spinnerQuadrant3Color: { property: 'border-right-color' },
|
49
|
+
spinnerQuadrant4Color: { property: 'border-left-color' },
|
49
50
|
animationDuration: {},
|
50
51
|
animationTimingFunction: {},
|
51
52
|
animationIterationCount: {}
|
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
} from '../../mixins';
|
9
9
|
import { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';
|
10
10
|
import { PasswordFieldClass } from '../descope-password-field/PasswordFieldClass';
|
11
|
+
import { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';
|
11
12
|
|
12
13
|
export const componentName = getComponentName('new-password');
|
13
14
|
|
@@ -53,9 +54,18 @@ const customMixin = (superclass) =>
|
|
53
54
|
}
|
54
55
|
};
|
55
56
|
|
56
|
-
const {
|
57
|
+
const {
|
58
|
+
host,
|
59
|
+
label,
|
60
|
+
internalInputsWrapper,
|
61
|
+
errorMessage,
|
62
|
+
helperText
|
63
|
+
} = {
|
57
64
|
host: { selector: () => ':host' },
|
58
|
-
|
65
|
+
label: { selector: '::part(label)' },
|
66
|
+
internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },
|
67
|
+
helperText: { selector: '::part(helper-text)' },
|
68
|
+
errorMessage: { selector: '::part(error-message)' }
|
59
69
|
}
|
60
70
|
|
61
71
|
export const NewPasswordClass = compose(
|
@@ -68,9 +78,14 @@ export const NewPasswordClass = compose(
|
|
68
78
|
property: PasswordFieldClass.cssVarList.fontSize
|
69
79
|
}
|
70
80
|
],
|
71
|
-
|
72
|
-
|
73
|
-
|
81
|
+
fontFamily: [
|
82
|
+
label,
|
83
|
+
errorMessage,
|
84
|
+
helperText
|
85
|
+
],
|
86
|
+
hostWidth: { ...host, property: 'width' },
|
87
|
+
inputsRequiredIndicator: { ...host, property: 'content' },
|
88
|
+
spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },
|
74
89
|
}
|
75
90
|
}),
|
76
91
|
draggableMixin,
|
@@ -80,53 +95,52 @@ export const NewPasswordClass = compose(
|
|
80
95
|
createProxy({
|
81
96
|
slots: [],
|
82
97
|
wrappedEleName: 'vaadin-text-field',
|
83
|
-
style: () =>
|
98
|
+
style: () => `
|
99
|
+
:host {
|
100
|
+
display: inline-block;
|
101
|
+
max-width: 100%;
|
102
|
+
min-width: 10em;
|
103
|
+
box-sizing: border-box;
|
104
|
+
}
|
105
|
+
${resetInputFieldDefaultWidth()}
|
106
|
+
vaadin-text-field {
|
107
|
+
padding: 0;
|
108
|
+
width: 100%;
|
109
|
+
height: 100%;
|
110
|
+
}
|
111
|
+
vaadin-text-field::part(input-field) {
|
112
|
+
min-height: 0;
|
113
|
+
background: transparent;
|
114
|
+
overflow: hidden;
|
115
|
+
box-shadow: none;
|
116
|
+
padding: 0;
|
117
|
+
}
|
118
|
+
vaadin-text-field::part(input-field)::after {
|
119
|
+
background: transparent;
|
120
|
+
opacity: 0;
|
121
|
+
}
|
122
|
+
descope-new-password-internal {
|
123
|
+
-webkit-mask-image: none;
|
124
|
+
min-height: 0;
|
125
|
+
width: 100%;
|
126
|
+
height: 100%;
|
127
|
+
padding: 0;
|
128
|
+
}
|
129
|
+
descope-new-password-internal > .wrapper {
|
130
|
+
width: 100%;
|
131
|
+
height: 100%;
|
132
|
+
display: flex;
|
133
|
+
flex-direction: column;
|
134
|
+
}
|
135
|
+
descope-password-field {
|
136
|
+
display: block;
|
137
|
+
width: 100%;
|
138
|
+
}
|
139
|
+
descope-new-password-internal vaadin-password-field::before {
|
140
|
+
height: initial;
|
141
|
+
},
|
142
|
+
`,
|
84
143
|
excludeAttrsSync: ['tabindex'],
|
85
144
|
componentName
|
86
145
|
})
|
87
146
|
);
|
88
|
-
|
89
|
-
const overrides = `
|
90
|
-
:host {
|
91
|
-
--vaadin-field-default-width: auto;
|
92
|
-
display: inline-block;
|
93
|
-
min-width: 10em;
|
94
|
-
max-width: 100%;
|
95
|
-
}
|
96
|
-
vaadin-text-field {
|
97
|
-
padding: 0;
|
98
|
-
width: 100%;
|
99
|
-
height: 100%;
|
100
|
-
}
|
101
|
-
vaadin-text-field::part(input-field) {
|
102
|
-
min-height: 0;
|
103
|
-
background: transparent;
|
104
|
-
overflow: hidden;
|
105
|
-
box-shadow: none;
|
106
|
-
padding: 0;
|
107
|
-
}
|
108
|
-
vaadin-text-field::part(input-field)::after {
|
109
|
-
background: transparent;
|
110
|
-
opacity: 0;
|
111
|
-
}
|
112
|
-
descope-new-password-internal {
|
113
|
-
-webkit-mask-image: none;
|
114
|
-
min-height: 0;
|
115
|
-
width: 100%;
|
116
|
-
height: 100%;
|
117
|
-
padding: 0;
|
118
|
-
}
|
119
|
-
descope-new-password-internal > .wrapper {
|
120
|
-
width: 100%;
|
121
|
-
height: 100%;
|
122
|
-
display: flex;
|
123
|
-
flex-direction: column;
|
124
|
-
}
|
125
|
-
descope-password-field {
|
126
|
-
display: block;
|
127
|
-
width: 100%;
|
128
|
-
}
|
129
|
-
descope-new-password-internal vaadin-password-field::before {
|
130
|
-
height: initial;
|
131
|
-
}
|
132
|
-
`;
|
package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js
CHANGED
@@ -117,7 +117,7 @@ class NewPasswordInternal extends BaseInputClass {
|
|
117
117
|
const styleTag = document.createElement('style');
|
118
118
|
styleTag.innerHTML = `
|
119
119
|
:host::part(required-indicator)::after {
|
120
|
-
content: var(${NewPasswordClass.cssVarList.
|
120
|
+
content: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});
|
121
121
|
}
|
122
122
|
`;
|
123
123
|
input?.shadowRoot.appendChild(styleTag);
|
@@ -8,16 +8,13 @@ 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
12
|
|
12
13
|
export const componentName = getComponentName('number-field');
|
13
14
|
|
14
|
-
let overrides = ``;
|
15
|
-
|
16
15
|
export const NumberFieldClass = compose(
|
17
16
|
createStyleMixin({
|
18
|
-
mappings:
|
19
|
-
...textFieldMappings
|
20
|
-
}
|
17
|
+
mappings: textFieldMappings
|
21
18
|
}),
|
22
19
|
draggableMixin,
|
23
20
|
proxyInputMixin,
|
@@ -26,45 +23,16 @@ export const NumberFieldClass = compose(
|
|
26
23
|
createProxy({
|
27
24
|
slots: ['prefix', 'suffix'],
|
28
25
|
wrappedEleName: 'vaadin-number-field',
|
29
|
-
style: () =>
|
26
|
+
style: () => `
|
27
|
+
:host {
|
28
|
+
display: inline-block;
|
29
|
+
max-width: 100%;
|
30
|
+
min-width: 10em;
|
31
|
+
padding: calc(var(${NumberFieldClass.cssVarList.inputOutlineWidth}) + var(${NumberFieldClass.cssVarList.inputOutlineOffset}));
|
32
|
+
}
|
33
|
+
${resetInputOverrides('vaadin-number-field', NumberFieldClass.cssVarList)}
|
34
|
+
`,
|
30
35
|
excludeAttrsSync: ['tabindex'],
|
31
36
|
componentName
|
32
37
|
})
|
33
38
|
);
|
34
|
-
|
35
|
-
overrides = `
|
36
|
-
:host {
|
37
|
-
display: inline-block;
|
38
|
-
min-width: 10em;
|
39
|
-
max-width: 100%;
|
40
|
-
}
|
41
|
-
vaadin-number-field {
|
42
|
-
margin: 0;
|
43
|
-
padding: 0;
|
44
|
-
width: 100%;
|
45
|
-
}
|
46
|
-
vaadin-number-field > input {
|
47
|
-
-webkit-mask-image: none;
|
48
|
-
}
|
49
|
-
vaadin-number-field::part(input-field) {
|
50
|
-
padding: 0;
|
51
|
-
}
|
52
|
-
vaadin-number-field[readonly] > input:placeholder-shown {
|
53
|
-
opacity: 1;
|
54
|
-
}
|
55
|
-
vaadin-number-field input:-webkit-autofill,
|
56
|
-
vaadin-number-field input:-webkit-autofill::first-line,
|
57
|
-
vaadin-number-field input:-webkit-autofill:hover,
|
58
|
-
vaadin-number-field input:-webkit-autofill:active,
|
59
|
-
vaadin-number-field input:-webkit-autofill:focus {
|
60
|
-
-webkit-text-fill-color: var(${NumberFieldClass.cssVarList.color});
|
61
|
-
box-shadow: 0 0 0 var(${NumberFieldClass.cssVarList.height}) var(${NumberFieldClass.cssVarList.backgroundColor}) inset;
|
62
|
-
}
|
63
|
-
vaadin-number-field[required]::part(required-indicator)::after {
|
64
|
-
content: "*";
|
65
|
-
color: var(${NumberFieldClass.cssVarList.color});
|
66
|
-
}
|
67
|
-
vaadin-number-field[readonly]::part(input-field)::after {
|
68
|
-
border: 0 solid;
|
69
|
-
}
|
70
|
-
`;
|
@@ -5,11 +5,11 @@ import {
|
|
5
5
|
proxyInputMixin,
|
6
6
|
componentNameValidationMixin
|
7
7
|
} from '../../mixins';
|
8
|
-
import textFieldMappings from '../descope-text-field/textFieldMappings';
|
9
8
|
import { componentName as descopeInternalComponentName } from './descope-passcode-internal/PasscodeInternal';
|
10
9
|
import { TextFieldClass } from '../descope-text-field/TextFieldClass'
|
11
10
|
import { compose } from '../../helpers';
|
12
11
|
import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
12
|
+
import { resetInputCursor, resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';
|
13
13
|
|
14
14
|
export const componentName = getComponentName('passcode');
|
15
15
|
|
@@ -60,10 +60,15 @@ const customMixin = (superclass) =>
|
|
60
60
|
}
|
61
61
|
};
|
62
62
|
|
63
|
-
const {
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
const {
|
64
|
+
host,
|
65
|
+
digitField,
|
66
|
+
label,
|
67
|
+
requiredIndicator,
|
68
|
+
internalWrapper,
|
69
|
+
focusedDigitField
|
70
|
+
} = {
|
71
|
+
host: () => ':host',
|
67
72
|
focusedDigitField: { selector: () => `${TextFieldClass.componentName}[focused="true"]` },
|
68
73
|
digitField: { selector: () => TextFieldClass.componentName },
|
69
74
|
label: { selector: '::part(label)' },
|
@@ -76,22 +81,25 @@ const textVars = TextFieldClass.cssVarList
|
|
76
81
|
export const PasscodeClass = compose(
|
77
82
|
createStyleMixin({
|
78
83
|
mappings: {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
{ ...
|
84
|
-
// we want to leave enough space to the digits outline,
|
85
|
-
// ideally, this would be part of the text field
|
86
|
-
{ ...internalWrapper, property: 'padding' }
|
84
|
+
hostWidth: { property: 'width' },
|
85
|
+
fontFamily: host,
|
86
|
+
labelTextColor: [
|
87
|
+
{ ...label, property: 'color' },
|
88
|
+
{ ...requiredIndicator, property: 'color' },
|
87
89
|
],
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
91
|
+
digitValueTextColor: {
|
92
|
+
selector: TextFieldClass.componentName,
|
93
|
+
property: textVars.inputValueTextColor
|
94
|
+
},
|
95
|
+
digitPadding: { ...digitField, property: textVars.inputPadding },
|
96
|
+
digitTextAlign: { ...digitField, property: textVars.inputTextAlign },
|
97
|
+
digitCaretTextColor: { ...digitField, property: textVars.inputCaretTextColor },
|
98
|
+
digitSpacing: { ...internalWrapper, property: 'gap' },
|
99
|
+
digitOutlineColor: { ...digitField, property: textVars.inputOutlineColor },
|
100
|
+
digitOutlineWidth: { ...digitField, property: textVars.inputOutlineWidth },
|
101
|
+
|
102
|
+
focusedDigitFieldOutlineColor: { ...focusedDigitField, property: textVars.inputOutlineColor }
|
95
103
|
},
|
96
104
|
}),
|
97
105
|
draggableMixin,
|
@@ -104,11 +112,11 @@ export const PasscodeClass = compose(
|
|
104
112
|
wrappedEleName: 'vaadin-text-field',
|
105
113
|
style: () => `
|
106
114
|
:host {
|
107
|
-
--vaadin-field-default-width: auto;
|
108
115
|
display: inline-block;
|
109
116
|
max-width: 100%;
|
110
117
|
min-width: calc(var(--passcode-digits-count) * 2em);
|
111
118
|
}
|
119
|
+
${resetInputFieldDefaultWidth()}
|
112
120
|
:host::after {
|
113
121
|
background-color: transparent;
|
114
122
|
}
|
@@ -133,7 +141,7 @@ export const PasscodeClass = compose(
|
|
133
141
|
|
134
142
|
descope-passcode-internal descope-text-field {
|
135
143
|
min-width: 2em;
|
136
|
-
max-width: var(${textVars.
|
144
|
+
max-width: var(${textVars.inputHeight});
|
137
145
|
}
|
138
146
|
|
139
147
|
vaadin-text-field::part(input-field) {
|
@@ -157,16 +165,15 @@ export const PasscodeClass = compose(
|
|
157
165
|
opacity: 1;
|
158
166
|
}
|
159
167
|
|
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
168
|
vaadin-text-field[readonly]::part(input-field)::after {
|
168
169
|
border: 0 solid;
|
169
170
|
}
|
171
|
+
|
172
|
+
vaadin-text-field::part(input-field) {
|
173
|
+
box-shadow: none;
|
174
|
+
}
|
175
|
+
|
176
|
+
${resetInputCursor('vaadin-text-field')}
|
170
177
|
`,
|
171
178
|
excludeAttrsSync: ['tabindex'],
|
172
179
|
componentName
|
@@ -8,72 +8,70 @@ 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
12
|
|
12
13
|
export const componentName = getComponentName('password-field');
|
13
14
|
|
14
15
|
const {
|
15
16
|
host,
|
16
|
-
|
17
|
+
inputField,
|
17
18
|
inputElement,
|
18
19
|
inputElementPlaceholder,
|
19
|
-
revealButton,
|
20
20
|
revealButtonIcon,
|
21
|
-
revealButtonIconOutline,
|
22
21
|
label,
|
23
|
-
requiredIndicator
|
22
|
+
requiredIndicator,
|
23
|
+
errorMessage,
|
24
|
+
helperText
|
24
25
|
} = {
|
25
26
|
host: { selector: () => ':host' },
|
26
|
-
|
27
|
+
inputField: { selector: '::part(input-field)' },
|
27
28
|
inputElement: { selector: '> input' },
|
28
29
|
inputElementPlaceholder: { selector: '> input:placeholder-shown' },
|
29
|
-
revealButton: { selector: 'vaadin-password-field-button' },
|
30
30
|
revealButtonIcon: { selector: () => '::part(reveal-button)::before' },
|
31
|
-
revealButtonIconOutline: { selector: () => 'vaadin-password-field-button[focus-ring]' },
|
32
31
|
label: { selector: '::part(label)' },
|
33
|
-
requiredIndicator: { selector: '::part(required-indicator)::after' },
|
32
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
33
|
+
helperText: { selector: '::part(helper-text)' },
|
34
|
+
errorMessage: { selector: '::part(error-message)' }
|
34
35
|
}
|
35
36
|
|
36
37
|
export const PasswordFieldClass = compose(
|
37
38
|
createStyleMixin({
|
38
39
|
mappings: {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}
|
40
|
+
hostWidth: { ...host, property: 'width' },
|
41
|
+
fontSize: [
|
42
|
+
{ property: 'font-size' },
|
43
|
+
{ ...host, property: 'font-size' }
|
44
|
+
],
|
45
|
+
fontFamily: [
|
46
|
+
label,
|
47
|
+
inputField,
|
48
|
+
errorMessage,
|
49
|
+
helperText
|
50
50
|
],
|
51
|
+
inputHeight: { ...inputField, property: 'height' },
|
52
|
+
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
53
|
+
|
54
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
55
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
56
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
57
|
+
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
58
|
+
|
59
|
+
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
60
|
+
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
61
|
+
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
62
|
+
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
51
63
|
|
52
64
|
labelTextColor: [
|
53
65
|
{ ...label, property: 'color' },
|
54
66
|
{ ...requiredIndicator, property: 'color' }
|
55
67
|
],
|
56
|
-
|
68
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
69
|
+
|
70
|
+
inputValueTextColor: [
|
57
71
|
{ ...inputElement, property: 'color' },
|
58
72
|
{ ...revealButtonIcon, property: 'color' }
|
59
73
|
],
|
60
|
-
|
61
|
-
fontSize: [{}, host],
|
62
|
-
height: inputWrapper,
|
63
|
-
padding: inputWrapper,
|
64
|
-
pointerCursor: [
|
65
|
-
{ ...revealButton, property: 'cursor' },
|
66
|
-
{ ...label, property: 'cursor' },
|
67
|
-
{ ...requiredIndicator, property: 'cursor' }
|
68
|
-
],
|
69
|
-
outlineColor: inputWrapper,
|
70
|
-
outlineStyle: inputWrapper,
|
71
|
-
outlineWidth: [
|
72
|
-
inputWrapper,
|
73
|
-
// we need to make sure there is enough space for the outline
|
74
|
-
{ property: 'padding' }
|
75
|
-
],
|
76
|
-
backgroundColor: inputWrapper
|
74
|
+
inputPlaceholderTextColor: { ...inputElementPlaceholder, property: 'color' },
|
77
75
|
}
|
78
76
|
}),
|
79
77
|
draggableMixin,
|
@@ -84,19 +82,25 @@ export const PasswordFieldClass = compose(
|
|
84
82
|
createProxy({
|
85
83
|
slots: ['suffix'],
|
86
84
|
wrappedEleName: 'vaadin-password-field',
|
87
|
-
style: `
|
85
|
+
style: () => `
|
88
86
|
:host {
|
89
87
|
display: inline-block;
|
90
88
|
min-width: 10em;
|
91
89
|
max-width: 100%;
|
90
|
+
box-sizing: border-box;
|
91
|
+
padding: calc(var(${PasswordFieldClass.cssVarList.inputOutlineWidth}) + var(${PasswordFieldClass.cssVarList.inputOutlineOffset}));
|
92
92
|
}
|
93
93
|
vaadin-password-field {
|
94
94
|
width: 100%;
|
95
95
|
box-sizing: border-box;
|
96
|
+
padding: 0;
|
96
97
|
}
|
97
98
|
vaadin-password-field::part(input-field) {
|
98
99
|
padding: 0;
|
99
100
|
}
|
101
|
+
vaadin-password-field[focus-ring]::part(input-field) {
|
102
|
+
box-shadow: none;
|
103
|
+
}
|
100
104
|
vaadin-password-field > input {
|
101
105
|
min-height: 0;
|
102
106
|
-webkit-mask-image: none;
|
@@ -109,13 +113,20 @@ export const PasswordFieldClass = compose(
|
|
109
113
|
}
|
110
114
|
vaadin-password-field::part(input-field)::after {
|
111
115
|
opacity: 0;
|
112
|
-
}
|
113
|
-
vaadin-password-field[required]::part(required-indicator)::after {
|
114
|
-
content: "*";
|
115
116
|
}
|
117
|
+
vaadin-password-field-button {
|
118
|
+
cursor: pointer;
|
119
|
+
}
|
120
|
+
|
121
|
+
${resetInputCursor('vaadin-password-field')}
|
122
|
+
|
116
123
|
[readonly] vaadin-password-field-button {
|
117
124
|
pointer-events: none;
|
118
125
|
}
|
126
|
+
|
127
|
+
vaadin-password-field-button[focus-ring] {
|
128
|
+
box-shadow: 0 0 0 2px var(${PasswordFieldClass.cssVarList.inputOutlineColor});
|
129
|
+
}
|
119
130
|
`,
|
120
131
|
excludeAttrsSync: ['tabindex'],
|
121
132
|
componentName
|