@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,88 +1,93 @@
|
|
1
1
|
import { compose } from '../../helpers';
|
2
2
|
import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
|
3
|
-
import { resetInputCursor, resetInputPlaceholder, resetInputReadonlyStyle, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
|
4
3
|
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
resetInputCursor,
|
5
|
+
resetInputPlaceholder,
|
6
|
+
resetInputReadonlyStyle,
|
7
|
+
useHostExternalPadding,
|
8
|
+
} from '../../helpers/themeHelpers/resetHelpers';
|
9
|
+
import {
|
10
|
+
createStyleMixin,
|
11
|
+
draggableMixin,
|
12
|
+
createProxy,
|
13
|
+
componentNameValidationMixin,
|
14
|
+
portalMixin,
|
15
|
+
proxyInputMixin,
|
11
16
|
} from '../../mixins';
|
12
17
|
|
13
18
|
export const componentName = getComponentName('combo-box');
|
14
19
|
|
15
|
-
const ComboBoxMixin = (superclass) =>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
20
|
+
const ComboBoxMixin = (superclass) =>
|
21
|
+
class ComboBoxMixinClass extends superclass {
|
22
|
+
// vaadin api is to set props on their combo box node,
|
23
|
+
// in order to avoid it, we are passing the children of this component
|
24
|
+
// to the items & renderer props, so it will be used as the combo box items
|
25
|
+
#onChildrenChange() {
|
26
|
+
const baseElement = this.shadowRoot.querySelector(this.baseSelector);
|
27
|
+
const items = Array.from(this.children);
|
28
|
+
|
29
|
+
// we want the data-name attribute to be accessible as an object attribute
|
30
|
+
if (items.length) {
|
31
|
+
items.forEach((node) => {
|
32
|
+
Object.defineProperty(node, 'data-name', {
|
33
|
+
value: node.getAttribute('data-name'),
|
34
|
+
});
|
35
|
+
Object.defineProperty(node, 'data-id', {
|
36
|
+
value: node.getAttribute('data-id'),
|
37
|
+
});
|
38
|
+
});
|
39
|
+
|
40
|
+
baseElement.items = items;
|
41
|
+
|
42
|
+
baseElement.renderer = (root, combo, model) => {
|
43
|
+
// eslint-disable-next-line no-param-reassign
|
44
|
+
root.innerHTML = model.item.outerHTML;
|
45
|
+
};
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
// the default vaadin behavior is to attach the overlay to the body when opened
|
50
|
+
// we do not want that because it's difficult to style the overlay in this way
|
51
|
+
// so we override it to open inside the shadow DOM
|
52
|
+
#overrideOverlaySettings() {
|
53
|
+
const overlay = this.baseElement.shadowRoot.querySelector('vaadin-combo-box-overlay');
|
54
|
+
|
55
|
+
overlay._attachOverlay = () => {
|
56
|
+
this.bringToFront();
|
57
|
+
};
|
58
|
+
overlay._detachOverlay = () => {};
|
59
|
+
overlay._enterModalState = () => {};
|
60
|
+
}
|
61
|
+
|
62
|
+
init() {
|
63
|
+
super.init?.();
|
64
|
+
|
65
|
+
this.#overrideOverlaySettings.bind(this);
|
66
|
+
observeChildren(this, this.#onChildrenChange.bind(this));
|
67
|
+
}
|
68
|
+
};
|
64
69
|
|
65
70
|
const {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
host,
|
72
|
+
inputField,
|
73
|
+
inputElement,
|
74
|
+
placeholder,
|
75
|
+
toggle,
|
76
|
+
label,
|
77
|
+
requiredIndicator,
|
78
|
+
helperText,
|
79
|
+
errorMessage,
|
75
80
|
} = {
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
}
|
81
|
+
host: { selector: () => ':host' },
|
82
|
+
inputField: { selector: '::part(input-field)' },
|
83
|
+
inputElement: { selector: 'input' },
|
84
|
+
placeholder: { selector: '> input:placeholder-shown' },
|
85
|
+
toggle: { selector: '::part(toggle-button)' },
|
86
|
+
label: { selector: '::part(label)' },
|
87
|
+
requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
|
88
|
+
helperText: { selector: '::part(helper-text)' },
|
89
|
+
errorMessage: { selector: '::part(error-message)' },
|
90
|
+
};
|
86
91
|
|
87
92
|
// const { slotted, selected } = {
|
88
93
|
// slotted: { selector: () => '::slotted(*)' },
|
@@ -90,82 +95,74 @@ const {
|
|
90
95
|
// }
|
91
96
|
|
92
97
|
export const ComboBoxClass = compose(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
forward: {
|
157
|
-
include: false,
|
158
|
-
attributes: ['size']
|
159
|
-
},
|
160
|
-
}),
|
161
|
-
proxyInputMixin,
|
162
|
-
componentNameValidationMixin,
|
163
|
-
ComboBoxMixin
|
98
|
+
createStyleMixin({
|
99
|
+
mappings: {
|
100
|
+
hostWidth: { ...host, property: 'width' },
|
101
|
+
// we apply font-size also on the host so we can set its width with em
|
102
|
+
fontSize: [{}, host],
|
103
|
+
fontFamily: [label, placeholder, inputField, helperText, errorMessage],
|
104
|
+
labelTextColor: [
|
105
|
+
{ ...label, property: 'color' },
|
106
|
+
{ ...requiredIndicator, property: 'color' },
|
107
|
+
],
|
108
|
+
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
109
|
+
inputHeight: { ...inputField, property: 'height' },
|
110
|
+
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
111
|
+
inputBorderColor: { ...inputField, property: 'border-color' },
|
112
|
+
inputBorderWidth: { ...inputField, property: 'border-width' },
|
113
|
+
inputBorderStyle: { ...inputField, property: 'border-style' },
|
114
|
+
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
115
|
+
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
116
|
+
inputValueTextColor: { ...inputField, property: 'color' },
|
117
|
+
inputPlaceholderTextColor: { ...placeholder, property: 'color' },
|
118
|
+
inputDropdownButtonCursor: { ...toggle, property: 'cursor' },
|
119
|
+
inputDropdownButtonColor: { ...toggle, property: 'color' },
|
120
|
+
inputDropdownButtonSize: { ...toggle, property: 'font-size' },
|
121
|
+
inputDropdownButtonOffset: [
|
122
|
+
{ ...toggle, property: 'margin-right' },
|
123
|
+
{ ...toggle, property: 'margin-left' },
|
124
|
+
],
|
125
|
+
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
126
|
+
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
127
|
+
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
128
|
+
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
129
|
+
inputHorizontalPadding: [
|
130
|
+
{ ...inputElement, property: 'padding-left' },
|
131
|
+
{ ...inputElement, property: 'padding-right' },
|
132
|
+
],
|
133
|
+
|
134
|
+
// we need to use the variables from the portal mixin
|
135
|
+
// so we need to use an arrow function on the selector
|
136
|
+
// for that to work, because ComboBox is not available
|
137
|
+
// at this time.
|
138
|
+
overlayBackground: { property: () => ComboBoxClass.cssVarList.overlay.backgroundColor },
|
139
|
+
overlayBorder: { property: () => ComboBoxClass.cssVarList.overlay.border },
|
140
|
+
},
|
141
|
+
}),
|
142
|
+
draggableMixin,
|
143
|
+
portalMixin({
|
144
|
+
name: 'overlay',
|
145
|
+
selector: '',
|
146
|
+
mappings: {
|
147
|
+
backgroundColor: { selector: 'vaadin-combo-box-scroller' },
|
148
|
+
cursor: { selector: 'vaadin-combo-box-item' }, // TODO: this mapping doesn't work, needs fixing.
|
149
|
+
minHeight: { selector: 'vaadin-combo-box-overlay' },
|
150
|
+
margin: { selector: 'vaadin-combo-box-overlay' },
|
151
|
+
fontFamily: { selector: 'vaadin-combo-box-item' },
|
152
|
+
},
|
153
|
+
forward: {
|
154
|
+
include: false,
|
155
|
+
attributes: ['size'],
|
156
|
+
},
|
157
|
+
}),
|
158
|
+
proxyInputMixin,
|
159
|
+
componentNameValidationMixin,
|
160
|
+
ComboBoxMixin
|
164
161
|
)(
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
162
|
+
createProxy({
|
163
|
+
slots: ['prefix'],
|
164
|
+
wrappedEleName: 'vaadin-combo-box',
|
165
|
+
style: () => `
|
169
166
|
:host {
|
170
167
|
display: inline-flex;
|
171
168
|
box-sizing: border-box;
|
@@ -175,7 +172,7 @@ export const ComboBoxClass = compose(
|
|
175
172
|
${resetInputReadonlyStyle('vaadin-combo-box')}
|
176
173
|
${resetInputPlaceholder('vaadin-combo-box')}
|
177
174
|
${resetInputCursor('vaadin-combo-box')}
|
178
|
-
|
175
|
+
|
179
176
|
vaadin-combo-box {
|
180
177
|
padding: 0;
|
181
178
|
width: 100%;
|
@@ -194,13 +191,12 @@ export const ComboBoxClass = compose(
|
|
194
191
|
box-shadow: none;
|
195
192
|
}
|
196
193
|
`,
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
194
|
+
// Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
|
195
|
+
// with the same name. Including it will cause Vaadin to calculate NaN size,
|
196
|
+
// and reset items to an empty array, and opening the list box with no items
|
197
|
+
// to display.
|
198
|
+
excludeAttrsSync: ['tabindex', 'size'],
|
199
|
+
componentName,
|
200
|
+
includeForwardProps: ['items', 'renderer', 'selectedItem'],
|
201
|
+
})
|
205
202
|
);
|
206
|
-
|
@@ -1,8 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
createStyleMixin,
|
3
|
-
draggableMixin,
|
4
|
-
componentNameValidationMixin
|
5
|
-
} from '../../mixins';
|
1
|
+
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
6
2
|
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
7
3
|
import { compose } from '../../helpers';
|
8
4
|
import { getComponentName } from '../../helpers/componentHelpers';
|
@@ -10,10 +6,10 @@ import { getComponentName } from '../../helpers/componentHelpers';
|
|
10
6
|
export const componentName = getComponentName('container');
|
11
7
|
|
12
8
|
class RawContainer extends createBaseClass({ componentName, baseSelector: ':host > slot' }) {
|
13
|
-
|
14
|
-
|
9
|
+
constructor() {
|
10
|
+
super();
|
15
11
|
|
16
|
-
|
12
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
17
13
|
<style>
|
18
14
|
:host > slot {
|
19
15
|
box-sizing: border-box;
|
@@ -28,41 +24,35 @@ class RawContainer extends createBaseClass({ componentName, baseSelector: ':host
|
|
28
24
|
</style>
|
29
25
|
<slot></slot>
|
30
26
|
`;
|
31
|
-
|
27
|
+
}
|
32
28
|
}
|
33
29
|
|
34
30
|
export const ContainerClass = compose(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
boxShadow: {}
|
64
|
-
}
|
65
|
-
}),
|
66
|
-
draggableMixin,
|
67
|
-
componentNameValidationMixin
|
31
|
+
createStyleMixin({
|
32
|
+
mappings: {
|
33
|
+
hostHeight: { selector: () => ':host', property: 'height' },
|
34
|
+
hostWidth: { selector: () => ':host', property: 'width' },
|
35
|
+
|
36
|
+
verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],
|
37
|
+
horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],
|
38
|
+
|
39
|
+
flexDirection: {},
|
40
|
+
justifyContent: {},
|
41
|
+
alignItems: {},
|
42
|
+
gap: {},
|
43
|
+
flexWrap: {},
|
44
|
+
|
45
|
+
backgroundColor: {},
|
46
|
+
color: {},
|
47
|
+
borderRadius: {},
|
48
|
+
|
49
|
+
borderColor: {},
|
50
|
+
borderStyle: {},
|
51
|
+
borderWidth: {},
|
52
|
+
|
53
|
+
boxShadow: {},
|
54
|
+
},
|
55
|
+
}),
|
56
|
+
draggableMixin,
|
57
|
+
componentNameValidationMixin
|
68
58
|
)(RawContainer);
|
@@ -1,25 +1,20 @@
|
|
1
1
|
import '@vaadin/date-picker';
|
2
|
-
import {
|
3
|
-
draggableMixin,
|
4
|
-
createProxy,
|
5
|
-
componentNameValidationMixin
|
6
|
-
} from '../../mixins';
|
2
|
+
import { draggableMixin, createProxy, componentNameValidationMixin } from '../../mixins';
|
7
3
|
import { compose } from '../../helpers';
|
8
4
|
import { getComponentName } from '../../helpers/componentHelpers';
|
9
5
|
|
10
6
|
const componentName = getComponentName('date-picker');
|
11
7
|
|
12
8
|
export const DatePickerClass = compose(
|
13
|
-
|
14
|
-
|
9
|
+
draggableMixin,
|
10
|
+
componentNameValidationMixin
|
15
11
|
)(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
createProxy({
|
13
|
+
componentName,
|
14
|
+
slots: ['prefix', 'suffix'],
|
15
|
+
wrappedEleName: 'vaadin-date-picker',
|
16
|
+
style: ``,
|
17
|
+
})
|
22
18
|
);
|
23
19
|
|
24
20
|
customElements.define(componentName, DatePickerClass);
|
25
|
-
|
@@ -1,18 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
createStyleMixin,
|
3
|
-
draggableMixin,
|
4
|
-
componentNameValidationMixin
|
5
|
-
} from '../../mixins';
|
1
|
+
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
6
2
|
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
7
3
|
import { compose } from '../../helpers';
|
8
4
|
import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
9
5
|
|
10
6
|
export const componentName = getComponentName('divider');
|
11
7
|
class RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
|
12
|
-
|
13
|
-
|
8
|
+
constructor() {
|
9
|
+
super();
|
14
10
|
|
15
|
-
|
11
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
16
12
|
<style>
|
17
13
|
:host {
|
18
14
|
display: inline-block;
|
@@ -45,67 +41,61 @@ class RawDivider extends createBaseClass({ componentName, baseSelector: ':host >
|
|
45
41
|
</div>
|
46
42
|
`;
|
47
43
|
|
48
|
-
|
44
|
+
this.textComponent = this.shadowRoot.querySelector('descope-text');
|
49
45
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
46
|
+
forwardAttrs(this, this.textComponent, {
|
47
|
+
includeAttrs: ['mode', 'variant', 'italic'],
|
48
|
+
});
|
49
|
+
}
|
54
50
|
}
|
55
51
|
|
56
|
-
const {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
} = {
|
62
|
-
host: { selector: () => ':host' },
|
63
|
-
before: { selector: '::before' },
|
64
|
-
after: { selector: '::after' },
|
65
|
-
text: { selector: 'descope-text' },
|
52
|
+
const { host, before, after, text } = {
|
53
|
+
host: { selector: () => ':host' },
|
54
|
+
before: { selector: '::before' },
|
55
|
+
after: { selector: '::after' },
|
56
|
+
text: { selector: 'descope-text' },
|
66
57
|
};
|
67
58
|
|
68
59
|
export const DividerClass = compose(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
createStyleMixin({
|
61
|
+
mappings: {
|
62
|
+
hostWidth: { ...host, property: 'width' },
|
63
|
+
hostPadding: { ...host, property: 'padding' },
|
73
64
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
65
|
+
minHeight: {},
|
66
|
+
alignItems: {},
|
67
|
+
alignSelf: {},
|
68
|
+
flexDirection: {},
|
78
69
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
70
|
+
labelTextWidth: { ...text, property: 'width' },
|
71
|
+
labelTextMaxWidth: { ...text, property: 'max-width' },
|
72
|
+
labelTextVerticalSpacing: [
|
73
|
+
{ ...text, property: 'padding-top' },
|
74
|
+
{ ...text, property: 'padding-bottom' },
|
75
|
+
],
|
76
|
+
labelTextHorizontalSpacing: [
|
77
|
+
{ ...text, property: 'padding-right' },
|
78
|
+
{ ...text, property: 'padding-left' },
|
79
|
+
],
|
89
80
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
81
|
+
stripeColor: [
|
82
|
+
{ ...before, property: 'background-color' },
|
83
|
+
{ ...after, property: 'background-color' },
|
84
|
+
],
|
85
|
+
stripeHorizontalThickness: [
|
86
|
+
{ ...before, property: 'height' },
|
87
|
+
{ ...after, property: 'height' },
|
88
|
+
],
|
89
|
+
stripeVerticalThickness: [
|
90
|
+
{ ...before, property: 'width' },
|
91
|
+
{ ...after, property: 'width' },
|
92
|
+
],
|
93
|
+
stripeColorOpacity: [
|
94
|
+
{ ...before, property: 'opacity' },
|
95
|
+
{ ...after, property: 'opacity' },
|
96
|
+
],
|
97
|
+
},
|
98
|
+
}),
|
99
|
+
draggableMixin,
|
100
|
+
componentNameValidationMixin
|
110
101
|
)(RawDivider);
|
111
|
-
|