@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
@@ -1,11 +1,11 @@
|
|
1
1
|
import { getComponentName } from '../../../helpers/componentHelpers';
|
2
2
|
import { compose } from '../../../helpers';
|
3
3
|
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
createStyleMixin,
|
5
|
+
proxyInputMixin,
|
6
|
+
draggableMixin,
|
7
|
+
componentNameValidationMixin,
|
8
|
+
createProxy,
|
9
9
|
} from '../../../mixins';
|
10
10
|
import { booleanFieldMixin } from '../booleanFieldMixin';
|
11
11
|
import commonStyles from '../commonStyles';
|
@@ -14,98 +14,93 @@ import { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpe
|
|
14
14
|
export const componentName = getComponentName('checkbox');
|
15
15
|
|
16
16
|
const {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
host,
|
18
|
+
component,
|
19
|
+
checkboxElement,
|
20
|
+
checkboxSurface,
|
21
|
+
checkboxHiddenLabel,
|
22
|
+
label,
|
23
|
+
requiredIndicator,
|
24
|
+
helperText,
|
25
|
+
errorMessage,
|
26
26
|
} = {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
host: { selector: () => ':host' },
|
28
|
+
label: { selector: '::part(label)' },
|
29
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
30
|
+
component: { selector: 'vaadin-checkbox' },
|
31
|
+
checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },
|
32
|
+
checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },
|
33
|
+
checkboxHiddenLabel: { selector: 'vaadin-checkbox [slot="label"]' },
|
34
|
+
helperText: { selector: '::part(helper-text)' },
|
35
|
+
errorMessage: { selector: '::part(error-message)' },
|
36
36
|
};
|
37
37
|
|
38
38
|
export const CheckboxClass = compose(
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
createStyleMixin({
|
40
|
+
mappings: {
|
41
|
+
hostWidth: { ...host, property: 'width' },
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
checkboxElement,
|
46
|
-
label,
|
47
|
-
checkboxHiddenLabel,
|
48
|
-
],
|
49
|
-
fontFamily: [
|
50
|
-
label,
|
51
|
-
checkboxHiddenLabel,
|
52
|
-
helperText,
|
53
|
-
errorMessage,
|
54
|
-
],
|
43
|
+
fontSize: [host, checkboxElement, label, checkboxHiddenLabel],
|
44
|
+
fontFamily: [label, checkboxHiddenLabel, helperText, errorMessage],
|
55
45
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
46
|
+
labelTextColor: [
|
47
|
+
{ ...label, property: 'color' },
|
48
|
+
{ ...requiredIndicator, property: 'color' },
|
49
|
+
{ ...label, property: '-webkit-text-fill-color' },
|
50
|
+
],
|
51
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
52
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
62
53
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
54
|
+
labelFontWeight: [
|
55
|
+
{ ...label, property: 'font-weight' },
|
56
|
+
{ ...checkboxHiddenLabel, property: 'font-weight' },
|
57
|
+
],
|
58
|
+
labelSpacing: [
|
59
|
+
{ ...label, property: 'left' },
|
60
|
+
{ ...checkboxHiddenLabel, property: 'padding-left' },
|
61
|
+
],
|
62
|
+
inputValueTextColor: { ...checkboxSurface, property: 'color' },
|
63
|
+
inputBackgroundColor: { ...checkboxElement, property: 'background-color' },
|
73
64
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
65
|
+
inputBorderRadius: { ...checkboxElement, property: 'border-radius' },
|
66
|
+
inputBorderWidth: { ...checkboxElement, property: 'border-width' },
|
67
|
+
inputBorderOffset: { ...checkboxElement, property: 'border-offset' },
|
68
|
+
inputBorderColor: { ...checkboxElement, property: 'border-color' },
|
69
|
+
inputBorderStyle: { ...checkboxElement, property: 'border-style' },
|
79
70
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
71
|
+
inputOutlineWidth: { ...checkboxElement, property: 'outline-width' },
|
72
|
+
inputOutlineOffset: { ...checkboxElement, property: 'outline-offset' },
|
73
|
+
inputOutlineColor: { ...checkboxElement, property: 'outline-color' },
|
74
|
+
inputOutlineStyle: { ...checkboxElement, property: 'outline-style' },
|
84
75
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
76
|
+
inputSize: [
|
77
|
+
{ ...checkboxElement, property: 'width' },
|
78
|
+
{ ...checkboxElement, property: 'height' },
|
79
|
+
{ ...checkboxSurface, property: 'font-size' },
|
80
|
+
{ ...component, property: 'font-size' },
|
81
|
+
{ ...checkboxHiddenLabel, property: 'line-height' },
|
82
|
+
{ ...label, property: 'margin-left' },
|
83
|
+
{ ...label, property: 'line-height' },
|
84
|
+
],
|
85
|
+
},
|
86
|
+
}),
|
87
|
+
draggableMixin,
|
88
|
+
proxyInputMixin,
|
89
|
+
componentNameValidationMixin,
|
90
|
+
booleanFieldMixin
|
100
91
|
)(
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
92
|
+
createProxy({
|
93
|
+
slots: [],
|
94
|
+
wrappedEleName: 'vaadin-text-field',
|
95
|
+
style: () => `
|
105
96
|
${commonStyles}
|
97
|
+
vaadin-checkbox::part(checkbox)::after {
|
98
|
+
top: 0;
|
99
|
+
left: 0;
|
100
|
+
}
|
106
101
|
${useHostExternalPadding(CheckboxClass.cssVarList)}
|
107
102
|
`,
|
108
|
-
|
109
|
-
|
110
|
-
|
103
|
+
excludeAttrsSync: ['tabindex'],
|
104
|
+
componentName,
|
105
|
+
})
|
111
106
|
);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { componentName, CheckboxClass } from './CheckboxClass';
|
2
|
-
import '@vaadin/checkbox'
|
3
|
-
import '@vaadin/text-field'
|
2
|
+
import '@vaadin/checkbox';
|
3
|
+
import '@vaadin/text-field';
|
4
4
|
import '../descope-boolean-field-internal';
|
5
5
|
|
6
6
|
customElements.define(componentName, CheckboxClass);
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { getComponentName } from '../../../helpers/componentHelpers'
|
1
|
+
import { getComponentName } from '../../../helpers/componentHelpers';
|
2
2
|
import { compose } from '../../../helpers';
|
3
3
|
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
createStyleMixin,
|
5
|
+
proxyInputMixin,
|
6
|
+
draggableMixin,
|
7
|
+
componentNameValidationMixin,
|
8
|
+
createProxy,
|
9
9
|
} from '../../../mixins';
|
10
10
|
import { booleanFieldMixin } from '../booleanFieldMixin';
|
11
11
|
import commonStyles from '../commonStyles';
|
@@ -14,102 +14,95 @@ import { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpe
|
|
14
14
|
export const componentName = getComponentName('switch-toggle');
|
15
15
|
|
16
16
|
const {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
host,
|
18
|
+
component,
|
19
|
+
checkboxElement: track,
|
20
|
+
checkboxSurface: knob,
|
21
|
+
checkboxHiddenLabel,
|
22
|
+
label,
|
23
|
+
requiredIndicator,
|
24
|
+
helperText,
|
25
|
+
errorMessage,
|
26
26
|
} = {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
host: { selector: () => ':host' },
|
28
|
+
label: { selector: '::part(label)' },
|
29
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
30
|
+
component: { selector: 'vaadin-checkbox' },
|
31
|
+
checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },
|
32
|
+
checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },
|
33
|
+
checkboxHiddenLabel: { selector: 'vaadin-checkbox [slot="label"]' },
|
34
|
+
helperText: { selector: '::part(helper-text)' },
|
35
|
+
errorMessage: { selector: '::part(error-message)' },
|
36
36
|
};
|
37
37
|
|
38
38
|
export const SwitchToggleClass = compose(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
trackBorderColor: { ...track, property: 'border-color' },
|
55
|
-
trackBackgroundColor: { ...track, property: 'background-color' },
|
56
|
-
trackBorderRadius: { ...track, property: 'border-radius' },
|
57
|
-
trackWidth: [
|
58
|
-
{ ...track, property: 'width' },
|
59
|
-
],
|
60
|
-
trackHeight: [
|
61
|
-
{ ...knob, property: 'font-size' },
|
62
|
-
{ ...track, property: 'height' }
|
63
|
-
],
|
39
|
+
createStyleMixin({
|
40
|
+
mappings: {
|
41
|
+
hostWidth: { ...host, property: 'width' },
|
42
|
+
fontSize: [component, label, checkboxHiddenLabel],
|
43
|
+
fontFamily: [label, helperText, errorMessage],
|
44
|
+
trackBorderWidth: { ...track, property: 'border-width' },
|
45
|
+
trackBorderStyle: { ...track, property: 'border-style' },
|
46
|
+
trackBorderColor: { ...track, property: 'border-color' },
|
47
|
+
trackBackgroundColor: { ...track, property: 'background-color' },
|
48
|
+
trackBorderRadius: { ...track, property: 'border-radius' },
|
49
|
+
trackWidth: [{ ...track, property: 'width' }],
|
50
|
+
trackHeight: [
|
51
|
+
{ ...knob, property: 'font-size' },
|
52
|
+
{ ...track, property: 'height' },
|
53
|
+
],
|
64
54
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
55
|
+
knobSize: [
|
56
|
+
{ ...knob, property: 'width' },
|
57
|
+
{ ...knob, property: 'height' },
|
58
|
+
],
|
59
|
+
knobTextColor: { ...knob, property: 'color' },
|
60
|
+
knobRadius: { ...knob, property: 'border-radius' },
|
61
|
+
knobTransitionDuration: { ...knob, property: 'transition' },
|
62
|
+
knobColor: { ...knob, property: 'background-color' },
|
63
|
+
knobTopOffset: { ...knob, property: 'top' },
|
64
|
+
knobLeftOffset: { ...knob, property: 'left' },
|
75
65
|
|
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
|
-
|
66
|
+
labelSpacing: [
|
67
|
+
{ ...label, property: 'padding-left' },
|
68
|
+
{ ...checkboxHiddenLabel, property: 'padding-left' },
|
69
|
+
],
|
70
|
+
labelLineHeight: [
|
71
|
+
{ ...label, property: 'line-height' },
|
72
|
+
{ ...checkboxHiddenLabel, property: 'line-height' },
|
73
|
+
],
|
74
|
+
labelFontWeight: [
|
75
|
+
{ ...label, property: 'font-weight' },
|
76
|
+
{ ...checkboxHiddenLabel, property: 'font-weight' },
|
77
|
+
],
|
78
|
+
labelTextColor: [
|
79
|
+
{ ...label, property: 'color' },
|
80
|
+
{ ...requiredIndicator, property: 'color' },
|
81
|
+
{ ...label, property: '-webkit-text-fill-color' },
|
82
|
+
],
|
83
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
84
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
85
|
+
inputOutlineWidth: { ...track, property: 'outline-width' },
|
86
|
+
inputOutlineOffset: { ...track, property: 'outline-offset' },
|
87
|
+
inputOutlineColor: { ...track, property: 'outline-color' },
|
88
|
+
inputOutlineStyle: { ...track, property: 'outline-style' },
|
89
|
+
},
|
90
|
+
}),
|
91
|
+
draggableMixin,
|
92
|
+
proxyInputMixin,
|
93
|
+
componentNameValidationMixin,
|
94
|
+
booleanFieldMixin
|
104
95
|
)(
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
96
|
+
createProxy({
|
97
|
+
slots: [],
|
98
|
+
wrappedEleName: 'vaadin-text-field',
|
99
|
+
style: () => `
|
109
100
|
${commonStyles}
|
110
101
|
${useHostExternalPadding(SwitchToggleClass.cssVarList)}
|
111
102
|
vaadin-text-field::part(label) {
|
112
|
-
left: calc(var(${SwitchToggleClass.cssVarList.trackWidth}) + var(${
|
103
|
+
left: calc(var(${SwitchToggleClass.cssVarList.trackWidth}) + var(${
|
104
|
+
SwitchToggleClass.cssVarList.trackBorderWidth
|
105
|
+
}) * 2);
|
113
106
|
}
|
114
107
|
vaadin-checkbox[active]::part(checkbox) {
|
115
108
|
transform: none;
|
@@ -120,7 +113,7 @@ export const SwitchToggleClass = compose(
|
|
120
113
|
content: '';
|
121
114
|
}
|
122
115
|
`,
|
123
|
-
|
124
|
-
|
125
|
-
|
116
|
+
excludeAttrsSync: ['tabindex'],
|
117
|
+
componentName,
|
118
|
+
})
|
126
119
|
);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { componentName, SwitchToggleClass } from './SwitchToggleClass';
|
2
|
-
import '@vaadin/checkbox'
|
3
|
-
import '@vaadin/text-field'
|
2
|
+
import '@vaadin/checkbox';
|
3
|
+
import '@vaadin/text-field';
|
4
4
|
import '../descope-boolean-field-internal';
|
5
5
|
|
6
6
|
customElements.define(componentName, SwitchToggleClass);
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { compose } from '../../helpers';
|
2
2
|
import { getComponentName } from '../../helpers/componentHelpers';
|
3
|
-
import { useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
4
3
|
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
createStyleMixin,
|
5
|
+
draggableMixin,
|
6
|
+
createProxy,
|
7
|
+
componentNameValidationMixin,
|
9
8
|
} from '../../mixins';
|
9
|
+
import { clickableMixin } from './clickableMixin';
|
10
10
|
|
11
11
|
export const componentName = getComponentName('button');
|
12
12
|
|
@@ -15,6 +15,10 @@ const resetStyles = `
|
|
15
15
|
display: inline-block;
|
16
16
|
box-sizing: border-box;
|
17
17
|
}
|
18
|
+
vaadin-button::before,
|
19
|
+
vaadin-button::after {
|
20
|
+
opacity: 0;
|
21
|
+
}
|
18
22
|
vaadin-button {
|
19
23
|
margin: 0;
|
20
24
|
min-width: 0;
|
@@ -43,65 +47,67 @@ const iconStyles = `
|
|
43
47
|
const editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;
|
44
48
|
|
45
49
|
const { host, label } = {
|
46
|
-
|
47
|
-
|
50
|
+
host: { selector: () => ':host' },
|
51
|
+
label: { selector: '::part(label)' },
|
48
52
|
};
|
49
53
|
|
50
|
-
|
51
|
-
createStyleMixin({
|
52
|
-
mappings: {
|
53
|
-
hostWidth: { ...host, property: 'width' },
|
54
|
-
fontSize: {},
|
55
|
-
fontFamily: {},
|
54
|
+
let loadingIndicatorStyles;
|
56
55
|
|
57
|
-
|
58
|
-
|
56
|
+
export const ButtonClass = compose(
|
57
|
+
createStyleMixin({
|
58
|
+
mappings: {
|
59
|
+
hostWidth: { ...host, property: 'width' },
|
60
|
+
hostHeight: { property: 'height' },
|
61
|
+
fontSize: {},
|
62
|
+
fontFamily: {},
|
59
63
|
|
60
|
-
|
61
|
-
|
62
|
-
outlineStyle: {},
|
63
|
-
outlineWidth: {},
|
64
|
+
cursor: {},
|
65
|
+
backgroundColor: {},
|
64
66
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
outlineOffset: {},
|
68
|
+
outlineColor: {},
|
69
|
+
outlineStyle: {},
|
70
|
+
outlineWidth: {},
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
horizontalPadding: [
|
75
|
-
{ property: 'padding-left' },
|
76
|
-
{ property: 'padding-right' },
|
77
|
-
],
|
72
|
+
borderRadius: {},
|
73
|
+
borderColor: {},
|
74
|
+
borderStyle: {},
|
75
|
+
borderWidth: {},
|
78
76
|
|
79
|
-
|
80
|
-
|
81
|
-
labelSpacing: { ...label, property: 'gap' },
|
77
|
+
verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],
|
78
|
+
horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],
|
82
79
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
80
|
+
labelTextColor: { property: 'color' },
|
81
|
+
labelTextDecoration: { ...label, property: 'text-decoration' },
|
82
|
+
labelSpacing: { ...label, property: 'gap' },
|
83
|
+
},
|
84
|
+
}),
|
85
|
+
clickableMixin,
|
86
|
+
draggableMixin,
|
87
|
+
componentNameValidationMixin
|
87
88
|
)(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
createProxy({
|
90
|
+
slots: ['prefix', 'label', 'suffix'],
|
91
|
+
wrappedEleName: 'vaadin-button',
|
92
|
+
style: () => `
|
92
93
|
${resetStyles}
|
93
94
|
${iconStyles}
|
94
95
|
${loadingIndicatorStyles}
|
95
96
|
${editorOverrides}
|
96
|
-
|
97
|
+
:host {
|
98
|
+
padding: calc(var(${ButtonClass.cssVarList.outlineWidth}) + var(${ButtonClass.cssVarList.outlineOffset}));
|
99
|
+
}
|
100
|
+
vaadin-button {
|
101
|
+
height: calc(var(${ButtonClass.cssVarList.hostHeight}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));
|
102
|
+
}
|
97
103
|
`,
|
98
|
-
|
99
|
-
|
100
|
-
|
104
|
+
excludeAttrsSync: ['tabindex'],
|
105
|
+
componentName,
|
106
|
+
})
|
101
107
|
);
|
102
108
|
|
103
109
|
const { color, fontSize } = ButtonClass.cssVarList;
|
104
|
-
|
110
|
+
loadingIndicatorStyles = `
|
105
111
|
@keyframes spin {
|
106
112
|
0% { -webkit-transform: rotate(0deg); }
|
107
113
|
100% { -webkit-transform: rotate(360deg); }
|
@@ -123,6 +129,10 @@ const loadingIndicatorStyles = `
|
|
123
129
|
width: var(${fontSize});
|
124
130
|
height: var(${fontSize});
|
125
131
|
}
|
132
|
+
:host([disabled="true"]),
|
133
|
+
:host([loading="true"]) {
|
134
|
+
pointer-events: none;
|
135
|
+
}
|
126
136
|
:host([loading="true"])::part(prefix),
|
127
137
|
:host([loading="true"])::part(label) {
|
128
138
|
visibility: hidden;
|