@descope/web-components-ui 1.0.135 → 1.0.148
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +77 -56
- package/src/baseClasses/createBaseClass.js +18 -16
- package/src/baseClasses/createBaseInputClass.js +14 -8
- package/src/baseClasses/createCssVarImageClass.js +27 -23
- package/src/components/boolean-fields/booleanFieldMixin.js +18 -29
- package/src/components/boolean-fields/commonStyles.js +1 -1
- package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +46 -51
- package/src/components/boolean-fields/descope-boolean-field-internal/index.js +1 -1
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +80 -85
- package/src/components/boolean-fields/descope-checkbox/index.js +2 -2
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +88 -95
- package/src/components/boolean-fields/descope-switch-toggle/index.js +2 -2
- package/src/components/descope-button/ButtonClass.js +57 -47
- package/src/components/descope-button/clickableMixin.js +10 -0
- package/src/components/descope-combo-box/ComboBoxClass.js +156 -160
- package/src/components/descope-container/ContainerClass.js +32 -42
- package/src/components/descope-date-picker/index.js +9 -14
- package/src/components/descope-divider/DividerClass.js +52 -62
- package/src/components/descope-email-field/EmailFieldClass.js +25 -20
- package/src/components/descope-image/ImageClass.js +21 -24
- package/src/components/descope-link/LinkClass.js +31 -35
- package/src/components/descope-loader-linear/LoaderLinearClass.js +31 -36
- package/src/components/descope-loader-radial/LoaderRadialClass.js +23 -30
- package/src/components/descope-logo/LogoClass.js +5 -1
- package/src/components/descope-new-password/NewPasswordClass.js +63 -81
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +157 -162
- package/src/components/descope-new-password/descope-new-password-internal/componentName.js +1 -1
- package/src/components/descope-new-password/descope-new-password-internal/index.js +3 -3
- package/src/components/descope-new-password/index.js +3 -3
- package/src/components/descope-number-field/NumberFieldClass.js +25 -20
- package/src/components/descope-passcode/PasscodeClass.js +95 -95
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +151 -157
- package/src/components/descope-passcode/descope-passcode-internal/helpers.js +7 -8
- package/src/components/descope-passcode/descope-passcode-internal/index.js +2 -2
- package/src/components/descope-passcode/index.js +2 -2
- package/src/components/descope-password/PasswordClass.js +75 -83
- package/src/components/descope-password/passwordDraggableMixin.js +28 -27
- package/src/components/descope-phone-field/CountryCodes.js +1210 -1210
- package/src/components/descope-phone-field/PhoneFieldClass.js +139 -141
- package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +157 -173
- package/src/components/descope-phone-field/helpers.js +3 -3
- package/src/components/descope-text/TextClass.js +25 -29
- package/src/components/descope-text-area/TextAreaClass.js +68 -67
- package/src/components/descope-text-field/TextFieldClass.js +42 -37
- package/src/components/descope-text-field/textFieldMappings.js +40 -55
- package/src/components/descope-totp-image/TotpImageClass.js +5 -1
- package/src/components/descope-upload-file/UploadFileClass.js +202 -0
- package/src/components/descope-upload-file/helpers.js +11 -0
- package/src/components/descope-upload-file/index.js +6 -0
- package/src/constants.js +3 -3
- package/src/helpers/componentHelpers.js +68 -74
- package/src/helpers/index.js +17 -16
- package/src/helpers/mixinsHelpers.js +21 -10
- package/src/helpers/themeHelpers/colorsHelpers.js +18 -18
- package/src/helpers/themeHelpers/componentsThemeManager.js +7 -6
- package/src/helpers/themeHelpers/index.js +114 -124
- package/src/helpers/themeHelpers/resetHelpers.js +16 -16
- package/src/index.cjs.js +3 -3
- package/src/index.d.ts +22 -21
- package/src/index.js +5 -4
- package/src/index.umd.js +14 -13
- package/src/mixins/changeMixin.js +18 -17
- package/src/mixins/componentNameValidationMixin.js +19 -19
- package/src/mixins/createProxy.js +33 -33
- package/src/mixins/createStyleMixin/helpers.js +54 -64
- package/src/mixins/createStyleMixin/index.js +155 -141
- package/src/mixins/draggableMixin.js +61 -61
- package/src/mixins/hoverableMixin.js +11 -13
- package/src/mixins/index.js +6 -6
- package/src/mixins/inputEventsDispatchingMixin.js +61 -60
- package/src/mixins/inputValidationMixin.js +153 -148
- package/src/mixins/lifecycleEventsMixin.js +17 -15
- package/src/mixins/normalizeBooleanAttributesMixin.js +31 -23
- package/src/mixins/portalMixin.js +58 -52
- package/src/mixins/proxyInputMixin.js +138 -132
- package/src/theme/components/button.js +86 -81
- package/src/theme/components/checkbox.js +26 -28
- package/src/theme/components/comboBox.js +32 -31
- package/src/theme/components/container.js +99 -89
- package/src/theme/components/divider.js +30 -31
- package/src/theme/components/emailField.js +20 -19
- package/src/theme/components/image.js +3 -3
- package/src/theme/components/index.js +33 -25
- package/src/theme/components/inputWrapper.js +28 -25
- package/src/theme/components/link.js +29 -36
- package/src/theme/components/loader/index.js +3 -3
- package/src/theme/components/loader/loaderLinear.js +34 -34
- package/src/theme/components/loader/loaderRadial.js +40 -34
- package/src/theme/components/logo.js +4 -4
- package/src/theme/components/newPassword.js +14 -13
- package/src/theme/components/numberField.js +20 -19
- package/src/theme/components/passcode.js +20 -22
- package/src/theme/components/password.js +22 -21
- package/src/theme/components/phoneField.js +23 -23
- package/src/theme/components/switchToggle.js +47 -46
- package/src/theme/components/text.js +72 -72
- package/src/theme/components/textArea.js +27 -25
- package/src/theme/components/textField.js +23 -22
- package/src/theme/components/totpImage.js +4 -4
- package/src/theme/components/uploadFile.js +60 -0
- package/src/theme/globals.js +123 -124
- package/src/theme/index.js +1 -1
- package/dist/cjs/index.cjs.js +0 -5924
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/index.d.ts +0 -51
- package/dist/index.esm.js +0 -6606
- package/dist/index.esm.js.map +0 -1
- package/dist/umd/1018.js +0 -577
- package/dist/umd/1018.js.LICENSE.txt +0 -23
- package/dist/umd/2481.js +0 -1
- package/dist/umd/3208.js +0 -2
- package/dist/umd/3208.js.LICENSE.txt +0 -5
- package/dist/umd/3585.js +0 -1
- package/dist/umd/3878.js +0 -1
- package/dist/umd/4201.js +0 -1
- package/dist/umd/422.js +0 -2
- package/dist/umd/422.js.LICENSE.txt +0 -5
- package/dist/umd/4447.js +0 -1
- package/dist/umd/4513.js +0 -1
- package/dist/umd/4803.js +0 -1
- package/dist/umd/541.js +0 -744
- package/dist/umd/541.js.LICENSE.txt +0 -21
- package/dist/umd/5767.js +0 -2
- package/dist/umd/5767.js.LICENSE.txt +0 -15
- package/dist/umd/5806.js +0 -109
- package/dist/umd/5806.js.LICENSE.txt +0 -5
- package/dist/umd/7056.js +0 -48
- package/dist/umd/7056.js.LICENSE.txt +0 -5
- package/dist/umd/7101.js +0 -148
- package/dist/umd/7101.js.LICENSE.txt +0 -11
- package/dist/umd/729.js +0 -1
- package/dist/umd/7824.js +0 -229
- package/dist/umd/7824.js.LICENSE.txt +0 -27
- package/dist/umd/7840.js +0 -356
- package/dist/umd/7840.js.LICENSE.txt +0 -61
- package/dist/umd/8725.js +0 -37
- package/dist/umd/8725.js.LICENSE.txt +0 -11
- package/dist/umd/9211.js +0 -312
- package/dist/umd/9211.js.LICENSE.txt +0 -5
- package/dist/umd/9241.js +0 -1
- package/dist/umd/9314.js +0 -283
- package/dist/umd/9314.js.LICENSE.txt +0 -27
- package/dist/umd/9437.js +0 -19
- package/dist/umd/9437.js.LICENSE.txt +0 -5
- package/dist/umd/9515.js +0 -202
- package/dist/umd/9515.js.LICENSE.txt +0 -11
- package/dist/umd/9789.js +0 -1
- package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +0 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +0 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +0 -1
- package/dist/umd/descope-button-index-js.js +0 -1
- package/dist/umd/descope-combo-box-index-js.js +0 -1
- package/dist/umd/descope-container-index-js.js +0 -1
- package/dist/umd/descope-date-picker-index-js.js +0 -1
- package/dist/umd/descope-divider-index-js.js +0 -1
- package/dist/umd/descope-email-field-index-js.js +0 -1
- package/dist/umd/descope-image-index-js.js +0 -1
- package/dist/umd/descope-link-index-js.js +0 -1
- package/dist/umd/descope-loader-linear-index-js.js +0 -1
- package/dist/umd/descope-loader-radial-index-js.js +0 -1
- package/dist/umd/descope-logo-index-js.js +0 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +0 -1
- package/dist/umd/descope-new-password-index-js.js +0 -1
- package/dist/umd/descope-number-field-index-js.js +0 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +0 -1
- package/dist/umd/descope-passcode-index-js.js +0 -1
- package/dist/umd/descope-password-index-js.js +0 -1
- package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +0 -1
- package/dist/umd/descope-phone-field-index-js.js +0 -1
- package/dist/umd/descope-text-area-index-js.js +0 -1
- package/dist/umd/descope-text-field-index-js.js +0 -1
- package/dist/umd/descope-text-index-js.js +0 -1
- package/dist/umd/descope-totp-image-index-js.js +0 -1
- package/dist/umd/index.js +0 -1
package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js
CHANGED
@@ -3,22 +3,22 @@ import { observeAttributes } from '../../../helpers/componentHelpers';
|
|
3
3
|
import { NewPasswordClass } from '../NewPasswordClass';
|
4
4
|
import { componentName } from './componentName';
|
5
5
|
|
6
|
-
const passwordAttrPrefixRegex = /^password
|
7
|
-
const confirmAttrPrefixRegex = /^confirm
|
6
|
+
const passwordAttrPrefixRegex = /^password-/;
|
7
|
+
const confirmAttrPrefixRegex = /^confirm-/;
|
8
8
|
|
9
|
-
const removeAttrPrefix = (attr, prefix) => attr.replace(prefix, '')
|
9
|
+
const removeAttrPrefix = (attr, prefix) => attr.replace(prefix, '');
|
10
10
|
|
11
11
|
const passwordInputAttrs = ['password-label', 'password-placeholder'];
|
12
12
|
const confirmInputAttrs = ['confirm-label', 'confirm-placeholder'];
|
13
13
|
const commonAttrs = [
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
'disabled',
|
15
|
+
'bordered',
|
16
|
+
'size',
|
17
|
+
'full-width',
|
18
|
+
'maxlength',
|
19
|
+
'invalid',
|
20
|
+
'readonly',
|
21
|
+
'draggable',
|
22
22
|
];
|
23
23
|
|
24
24
|
const inputRelatedAttrs = [].concat(commonAttrs, passwordInputAttrs, confirmInputAttrs);
|
@@ -26,166 +26,161 @@ const inputRelatedAttrs = [].concat(commonAttrs, passwordInputAttrs, confirmInpu
|
|
26
26
|
const BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });
|
27
27
|
|
28
28
|
class NewPasswordInternal extends BaseInputClass {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
inputRelatedAttrs,
|
33
|
-
);
|
34
|
-
}
|
29
|
+
static get observedAttributes() {
|
30
|
+
return ['has-confirm'].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);
|
31
|
+
}
|
35
32
|
|
36
|
-
|
37
|
-
|
33
|
+
constructor() {
|
34
|
+
super();
|
38
35
|
|
39
|
-
|
36
|
+
this.innerHTML = `
|
40
37
|
<div class="wrapper"></div>
|
41
38
|
`;
|
42
39
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
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
|
-
|
40
|
+
this.wrapperEle = this.querySelector('.wrapper');
|
41
|
+
}
|
42
|
+
|
43
|
+
get value() {
|
44
|
+
return this.passwordInput?.value || '';
|
45
|
+
}
|
46
|
+
|
47
|
+
set value(val) {
|
48
|
+
if (val === this.value) return;
|
49
|
+
this.value = val;
|
50
|
+
}
|
51
|
+
|
52
|
+
get hasConfirm() {
|
53
|
+
return this.getAttribute('has-confirm') === 'true';
|
54
|
+
}
|
55
|
+
|
56
|
+
getValidity() {
|
57
|
+
if (this.isRequired && !this.value) {
|
58
|
+
return { valueMissing: true };
|
59
|
+
}
|
60
|
+
if (this.hasConfirm && this.confirmInput && this.value !== this.confirmInput.value) {
|
61
|
+
return { patternMismatch: true };
|
62
|
+
}
|
63
|
+
|
64
|
+
const min = this.getAttribute('minlength');
|
65
|
+
const minVal = parseInt(min, 10) || 0;
|
66
|
+
const minValid = this.value.length >= minVal;
|
67
|
+
if (!minValid) {
|
68
|
+
return { tooShort: true };
|
69
|
+
}
|
70
|
+
|
71
|
+
return {};
|
72
|
+
}
|
73
|
+
|
74
|
+
init() {
|
75
|
+
this.addEventListener('focus', (e) => {
|
76
|
+
// we want to ignore focus events we are dispatching
|
77
|
+
if (e.isTrusted) {
|
78
|
+
this.passwordInput.focus();
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
super.init?.();
|
83
|
+
this.renderInputs(this.hasConfirm);
|
84
|
+
}
|
85
|
+
|
86
|
+
renderInputs(shouldRenderConfirm) {
|
87
|
+
let template = `<descope-password data-id="password"></descope-password>`;
|
88
|
+
|
89
|
+
if (shouldRenderConfirm) {
|
90
|
+
template += `<descope-password data-id="confirm"></descope-password>`;
|
91
|
+
}
|
92
|
+
|
93
|
+
this.wrapperEle.innerHTML = template;
|
94
|
+
|
95
|
+
this.passwordInput = this.querySelector('[data-id="password"]');
|
96
|
+
this.confirmInput = this.querySelector('[data-id="confirm"]');
|
97
|
+
|
98
|
+
this.inputs = [this.passwordInput, this.confirmInput];
|
99
|
+
|
100
|
+
this.initInputs();
|
101
|
+
|
102
|
+
// we are calling attributeChangedCallback with all the input related attributes
|
103
|
+
// in order to set it on the newly generated input
|
104
|
+
[...passwordInputAttrs, ...confirmInputAttrs, ...commonAttrs].forEach((attr) => {
|
105
|
+
this.attributeChangedCallback(attr, null, this.getAttribute(attr));
|
106
|
+
});
|
107
|
+
}
|
108
|
+
|
109
|
+
// the inputs are not required but we still want it to have a required
|
110
|
+
// indicator in case the root component is required
|
111
|
+
handleIndicatorStyle() {
|
112
|
+
this.inputs.forEach((input) => {
|
113
|
+
const styleTag = document.createElement('style');
|
114
|
+
styleTag.innerHTML = `
|
118
115
|
:host::part(required-indicator)::after {
|
119
116
|
content: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});
|
120
117
|
}
|
121
118
|
`;
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
}
|
188
|
-
}
|
119
|
+
input?.shadowRoot.appendChild(styleTag);
|
120
|
+
});
|
121
|
+
}
|
122
|
+
|
123
|
+
get isInvalid() {
|
124
|
+
return this.hasAttribute('invalid') && this.getAttribute('invalid') !== 'false';
|
125
|
+
}
|
126
|
+
|
127
|
+
// for some reason, Vaadin is removing the invalid attribute on several events,
|
128
|
+
// e.g. focus, input, etc..., so we need to make sure the inputs will stay invalid
|
129
|
+
// if the root component is invalid
|
130
|
+
handleInputsInvalidAttribute() {
|
131
|
+
this.inputs.forEach((input) => {
|
132
|
+
input &&
|
133
|
+
observeAttributes(
|
134
|
+
input,
|
135
|
+
(changedAttributes) => {
|
136
|
+
if (changedAttributes.includes('invalid')) {
|
137
|
+
const inputInvalidValue = input.getAttribute('invalid');
|
138
|
+
const rootInvalidValue = this.getAttribute('invalid');
|
139
|
+
|
140
|
+
if (this.isInvalid && rootInvalidValue !== inputInvalidValue) {
|
141
|
+
input.setAttribute('invalid', 'true');
|
142
|
+
}
|
143
|
+
}
|
144
|
+
},
|
145
|
+
{}
|
146
|
+
);
|
147
|
+
});
|
148
|
+
}
|
149
|
+
|
150
|
+
initInputs() {
|
151
|
+
this.handleIndicatorStyle();
|
152
|
+
this.handleInputsInvalidAttribute();
|
153
|
+
this.handleFocusEventsDispatching(this.inputs);
|
154
|
+
}
|
155
|
+
|
156
|
+
// eslint-disable-next-line class-methods-use-this
|
157
|
+
toggleBooleanAttribute(ele, name, value) {
|
158
|
+
value === null ? ele?.removeAttribute(name) : ele?.setAttribute(name, value);
|
159
|
+
}
|
160
|
+
|
161
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
162
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
163
|
+
|
164
|
+
if (oldValue !== newValue) {
|
165
|
+
if (attrName === 'has-confirm') {
|
166
|
+
this.renderInputs(newValue !== null && newValue !== 'false');
|
167
|
+
} else if (commonAttrs.includes(attrName)) {
|
168
|
+
this.inputs.forEach((input) => this.toggleBooleanAttribute(input, attrName, newValue));
|
169
|
+
} else if (passwordInputAttrs.includes(attrName)) {
|
170
|
+
this.toggleBooleanAttribute(
|
171
|
+
this.passwordInput,
|
172
|
+
removeAttrPrefix(attrName, passwordAttrPrefixRegex),
|
173
|
+
newValue
|
174
|
+
);
|
175
|
+
} else if (confirmInputAttrs.includes(attrName)) {
|
176
|
+
this.toggleBooleanAttribute(
|
177
|
+
this.confirmInput,
|
178
|
+
removeAttrPrefix(attrName, confirmAttrPrefixRegex),
|
179
|
+
newValue
|
180
|
+
);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
189
184
|
}
|
190
185
|
|
191
186
|
export default NewPasswordInternal;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import NewPasswordInternal from
|
2
|
-
import { componentName } from
|
1
|
+
import NewPasswordInternal from './NewPasswordInternal';
|
2
|
+
import { componentName } from './componentName';
|
3
3
|
|
4
|
-
customElements.define(componentName, NewPasswordInternal)
|
4
|
+
customElements.define(componentName, NewPasswordInternal);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { componentName, NewPasswordClass } from './NewPasswordClass';
|
2
|
-
import '../descope-text-field'
|
3
|
-
import '../descope-password'
|
4
|
-
import './descope-new-password-internal'
|
2
|
+
import '../descope-text-field';
|
3
|
+
import '../descope-password';
|
4
|
+
import './descope-new-password-internal';
|
5
5
|
|
6
6
|
customElements.define(componentName, NewPasswordClass);
|
7
7
|
|
@@ -1,38 +1,43 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
createStyleMixin,
|
3
|
+
draggableMixin,
|
4
|
+
createProxy,
|
5
|
+
proxyInputMixin,
|
6
|
+
componentNameValidationMixin,
|
7
7
|
} from '../../mixins';
|
8
8
|
import textFieldMappings from '../descope-text-field/textFieldMappings';
|
9
9
|
import { compose } from '../../helpers';
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
11
|
-
import {
|
11
|
+
import {
|
12
|
+
resetInputOverrides,
|
13
|
+
useHostExternalPadding,
|
14
|
+
} from '../../helpers/themeHelpers/resetHelpers';
|
12
15
|
|
13
16
|
export const componentName = getComponentName('number-field');
|
14
17
|
|
15
18
|
export const NumberFieldClass = compose(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
createStyleMixin({
|
20
|
+
mappings: textFieldMappings,
|
21
|
+
}),
|
22
|
+
draggableMixin,
|
23
|
+
proxyInputMixin,
|
24
|
+
componentNameValidationMixin
|
22
25
|
)(
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
createProxy({
|
27
|
+
slots: ['prefix', 'suffix'],
|
28
|
+
wrappedEleName: 'vaadin-number-field',
|
29
|
+
style: () => `
|
27
30
|
:host {
|
28
31
|
display: inline-block;
|
29
32
|
max-width: 100%;
|
30
|
-
padding: calc(var(${NumberFieldClass.cssVarList.inputOutlineWidth}) + var(${
|
33
|
+
padding: calc(var(${NumberFieldClass.cssVarList.inputOutlineWidth}) + var(${
|
34
|
+
NumberFieldClass.cssVarList.inputOutlineOffset
|
35
|
+
}));
|
31
36
|
}
|
32
37
|
${useHostExternalPadding(NumberFieldClass.cssVarList)}
|
33
38
|
${resetInputOverrides('vaadin-number-field', NumberFieldClass.cssVarList)}
|
34
39
|
`,
|
35
|
-
|
36
|
-
|
37
|
-
|
40
|
+
excludeAttrsSync: ['tabindex'],
|
41
|
+
componentName,
|
42
|
+
})
|
38
43
|
);
|