@descope/web-components-ui 1.0.427 → 1.0.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/cjs/index.cjs.js +2520 -5270
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2022 -4815
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -16
- package/src/components/descope-apps-list/AppsListClass.js +1 -1
- package/src/components/descope-apps-list/index.js +2 -2
- package/src/components/descope-date-field/descope-calendar/index.js +1 -1
- package/src/components/descope-divider/DividerClass.js +1 -1
- package/src/components/descope-divider/index.js +1 -1
- package/src/components/descope-link/LinkClass.js +1 -1
- package/src/components/descope-link/index.js +1 -1
- package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +1 -1
- package/src/components/descope-security-questions-setup/index.js +1 -1
- package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +1 -1
- package/src/components/descope-security-questions-verify/index.js +1 -1
- package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
- package/src/components/descope-user-attribute/index.js +1 -1
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +1 -1
- package/src/components/descope-user-auth-method/index.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/index.js +2 -2
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +1 -1
- package/src/components/phone-fields/descope-phone-field/index.js +1 -1
- package/src/components/phone-fields/descope-phone-input-box-field/index.js +1 -1
- package/src/helpers/themeHelpers/index.js +1 -1
- package/src/theme/components/alert.js +1 -1
- package/src/theme/components/enrichedText.js +1 -1
- package/src/theme/components/index.js +3 -3
- package/dist/index.d.ts +0 -72
- package/node_modules/common/.eslintrc.json +0 -18
- package/node_modules/common/README.md +0 -7
- package/node_modules/common/package.json +0 -37
- package/node_modules/common/project.json +0 -7
- package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +0 -66
- package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +0 -14
- package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +0 -55
- package/node_modules/common/src/baseClasses/index.js +0 -3
- package/node_modules/common/src/componentsHelpers/index.js +0 -95
- package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +0 -10
- package/node_modules/common/src/componentsMixins/index.js +0 -1
- package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +0 -14
- package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +0 -22
- package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +0 -23
- package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +0 -12
- package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +0 -100
- package/node_modules/common/src/componentsMixins/mixins/createProxy.js +0 -58
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +0 -106
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +0 -167
- package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +0 -62
- package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +0 -93
- package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +0 -170
- package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +0 -13
- package/node_modules/common/src/componentsMixins/mixins/index.js +0 -14
- package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +0 -76
- package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +0 -210
- package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +0 -23
- package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +0 -59
- package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +0 -112
- package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +0 -242
- package/node_modules/common/src/constants.js +0 -4
- package/node_modules/common/src/icons/errorMessageIconBase64.js +0 -1
- package/node_modules/common/src/sbControls.js +0 -302
- package/node_modules/common/src/sbHelpers.js +0 -53
- package/node_modules/common/src/themeHelpers/colorsHelpers.js +0 -94
- package/node_modules/common/src/themeHelpers/componentsThemeManager.js +0 -45
- package/node_modules/common/src/themeHelpers/index.js +0 -191
- package/node_modules/common/src/themeHelpers/resetHelpers.js +0 -144
- package/node_modules/common/src/utils/index.js +0 -68
- package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +0 -54
- package/node_modules/descope-avatar/package.json +0 -34
- package/node_modules/descope-avatar/project.json +0 -7
- package/node_modules/descope-avatar/src/component/AvatarClass.js +0 -109
- package/node_modules/descope-avatar/src/component/index.js +0 -8
- package/node_modules/descope-avatar/src/theme.js +0 -44
- package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
- package/node_modules/descope-avatar/stories/descope-avatar.stories.js +0 -32
- package/node_modules/descope-combo-box/e2e/descope-combo-box.spec.ts +0 -462
- package/node_modules/descope-combo-box/package.json +0 -34
- package/node_modules/descope-combo-box/project.json +0 -7
- package/node_modules/descope-combo-box/src/component/ComboBoxClass.js +0 -619
- package/node_modules/descope-combo-box/src/component/index.js +0 -6
- package/node_modules/descope-combo-box/src/theme.js +0 -93
- package/node_modules/descope-combo-box/stories/descope-combo-box.stories.js +0 -180
- package/node_modules/descope-text/e2e/descope-text.spec.ts +0 -35
- package/node_modules/descope-text/package.json +0 -31
- package/node_modules/descope-text/project.json +0 -7
- package/node_modules/descope-text/src/component/TextClass.js +0 -63
- package/node_modules/descope-text/src/component/index.js +0 -5
- package/node_modules/descope-text/src/theme.js +0 -91
- package/node_modules/descope-text/stories/descope-text.stories.js +0 -55
- package/node_modules/theme-globals/package.json +0 -16
- package/node_modules/theme-globals/project.json +0 -7
- package/node_modules/theme-globals/src/index.js +0 -180
- package/node_modules/theme-input-wrapper/package.json +0 -17
- package/node_modules/theme-input-wrapper/project.json +0 -7
- package/node_modules/theme-input-wrapper/src/index.js +0 -130
- package/src/index.d.ts +0 -72
@@ -1,619 +0,0 @@
|
|
1
|
-
import { compose } from 'common/utils';
|
2
|
-
import {
|
3
|
-
getComponentName,
|
4
|
-
observeAttributes,
|
5
|
-
observeChildren,
|
6
|
-
} from 'common/components-helpers';
|
7
|
-
import {
|
8
|
-
resetInputLabelPosition,
|
9
|
-
resetInputCursor,
|
10
|
-
resetInputPlaceholder,
|
11
|
-
resetInputReadonlyStyle,
|
12
|
-
useHostExternalPadding,
|
13
|
-
inputFloatingLabelStyle,
|
14
|
-
} from 'common/theme-helpers';
|
15
|
-
import {
|
16
|
-
createStyleMixin,
|
17
|
-
draggableMixin,
|
18
|
-
createProxy,
|
19
|
-
componentNameValidationMixin,
|
20
|
-
portalMixin,
|
21
|
-
proxyInputMixin,
|
22
|
-
} from 'common/components-mixins';
|
23
|
-
|
24
|
-
export const componentName = getComponentName('combo-box');
|
25
|
-
|
26
|
-
const ComboBoxMixin = (superclass) =>
|
27
|
-
class ComboBoxMixinClass extends superclass {
|
28
|
-
static get observedAttributes() {
|
29
|
-
return ['label-type'];
|
30
|
-
}
|
31
|
-
|
32
|
-
// eslint-disable-next-line class-methods-use-this
|
33
|
-
#renderItem = ({ displayName, value, label }) => {
|
34
|
-
return `<span data-name="${label}" data-id="${value}">${
|
35
|
-
displayName || label
|
36
|
-
}</span>`;
|
37
|
-
};
|
38
|
-
|
39
|
-
#data;
|
40
|
-
|
41
|
-
get defaultValue() {
|
42
|
-
return this.getAttribute('default-value');
|
43
|
-
}
|
44
|
-
|
45
|
-
get renderItem() {
|
46
|
-
return this.#renderItem;
|
47
|
-
}
|
48
|
-
|
49
|
-
set renderItem(renderFn) {
|
50
|
-
this.#renderItem = renderFn;
|
51
|
-
this.renderItems();
|
52
|
-
}
|
53
|
-
|
54
|
-
set renderer(fn) {
|
55
|
-
// fn takes (root, comboBox, model) as arguments
|
56
|
-
this.baseElement.renderer = fn;
|
57
|
-
}
|
58
|
-
|
59
|
-
get loading() {
|
60
|
-
return this.getAttribute('loading') === 'true';
|
61
|
-
}
|
62
|
-
|
63
|
-
set loading(val) {
|
64
|
-
if (val) {
|
65
|
-
this.setAttribute('loading', 'true');
|
66
|
-
} else {
|
67
|
-
this.removeAttribute('loading');
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
get data() {
|
72
|
-
if (this.#data) return this.#data;
|
73
|
-
|
74
|
-
const dataAttr = this.getAttribute('data');
|
75
|
-
|
76
|
-
if (dataAttr) {
|
77
|
-
try {
|
78
|
-
const data = JSON.parse(dataAttr);
|
79
|
-
if (this.isValidDataType(data)) {
|
80
|
-
return data;
|
81
|
-
}
|
82
|
-
} catch (e) {
|
83
|
-
// eslint-disable-next-line no-console
|
84
|
-
console.error(
|
85
|
-
'could not parse data string from attribute "data" -',
|
86
|
-
e.message,
|
87
|
-
);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
return [];
|
92
|
-
}
|
93
|
-
|
94
|
-
set data(data) {
|
95
|
-
if (this.isValidDataType(data)) {
|
96
|
-
this.#data = data;
|
97
|
-
this.renderItems();
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
// eslint-disable-next-line class-methods-use-this
|
102
|
-
isValidDataType(data) {
|
103
|
-
const isValid = Array.isArray(data);
|
104
|
-
if (!isValid) {
|
105
|
-
// eslint-disable-next-line no-console
|
106
|
-
console.error('data must be an array, received:', data);
|
107
|
-
}
|
108
|
-
|
109
|
-
return isValid;
|
110
|
-
}
|
111
|
-
|
112
|
-
getItemsTemplate() {
|
113
|
-
return this.data?.reduce?.(
|
114
|
-
(acc, item) => acc + (this.renderItem?.(item || {}) || ''),
|
115
|
-
'',
|
116
|
-
);
|
117
|
-
}
|
118
|
-
|
119
|
-
renderItems() {
|
120
|
-
if (this.#data || this.getAttribute('data')) {
|
121
|
-
const template = this.getItemsTemplate();
|
122
|
-
this.innerHTML = template;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
|
-
handleSelectedItem() {
|
127
|
-
const { selectedItem } = this.baseElement;
|
128
|
-
const currentSelected = selectedItem?.['data-id'];
|
129
|
-
|
130
|
-
// If the selected item is still a child, there's no need to update the value
|
131
|
-
if (selectedItem && Array.from(this.children).includes(selectedItem)) {
|
132
|
-
return;
|
133
|
-
}
|
134
|
-
|
135
|
-
// if previously selected item ID exists in current children, set it as selected
|
136
|
-
if (currentSelected) {
|
137
|
-
this.value = currentSelected;
|
138
|
-
}
|
139
|
-
|
140
|
-
// otherwise, if default value is specified, set default value as selected item
|
141
|
-
if (!this.value) {
|
142
|
-
this.setDefaultValue();
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
// eslint-disable-next-line class-methods-use-this
|
147
|
-
customValueTransformFn(val) {
|
148
|
-
return val;
|
149
|
-
}
|
150
|
-
|
151
|
-
// We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the
|
152
|
-
// field that it searches the value, and the finaly display value of the input.
|
153
|
-
// We provide a custom transform function to override that behavior.
|
154
|
-
setComboBoxDescriptor() {
|
155
|
-
const valueDescriptor = Object.getOwnPropertyDescriptor(
|
156
|
-
this.inputElement.constructor.prototype,
|
157
|
-
'value',
|
158
|
-
);
|
159
|
-
|
160
|
-
const comboBox = this;
|
161
|
-
|
162
|
-
Object.defineProperties(this.inputElement, {
|
163
|
-
value: {
|
164
|
-
...valueDescriptor,
|
165
|
-
set(val) {
|
166
|
-
if (
|
167
|
-
!comboBox.baseElement.items?.length &&
|
168
|
-
!comboBox.allowCustomValue
|
169
|
-
) {
|
170
|
-
return;
|
171
|
-
}
|
172
|
-
|
173
|
-
const transformedValue = comboBox.customValueTransformFn(val) || '';
|
174
|
-
|
175
|
-
if (transformedValue === this.value) {
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
|
179
|
-
valueDescriptor.set.call(this, transformedValue);
|
180
|
-
},
|
181
|
-
},
|
182
|
-
});
|
183
|
-
}
|
184
|
-
|
185
|
-
// vaadin api is to set props on their combo box node,
|
186
|
-
// in order to avoid it, we are passing the children of this component
|
187
|
-
// to the items & renderer props, so it will be used as the combo box items
|
188
|
-
#onChildrenChange() {
|
189
|
-
const items = Array.from(this.children);
|
190
|
-
|
191
|
-
// we want the data-name attribute to be accessible as an object attribute
|
192
|
-
items.forEach((node) => {
|
193
|
-
Object.defineProperty(node, 'data-name', {
|
194
|
-
value: node.getAttribute('data-name'),
|
195
|
-
configurable: true,
|
196
|
-
writable: true,
|
197
|
-
});
|
198
|
-
Object.defineProperty(node, 'data-id', {
|
199
|
-
value: node.getAttribute('data-id'),
|
200
|
-
configurable: true,
|
201
|
-
writable: true,
|
202
|
-
});
|
203
|
-
});
|
204
|
-
|
205
|
-
this.baseElement.items = items;
|
206
|
-
setTimeout(() => {
|
207
|
-
// set timeout to ensure this runs after customValueTransformFn had the chance to be overriden
|
208
|
-
this.handleSelectedItem();
|
209
|
-
}, 0);
|
210
|
-
}
|
211
|
-
|
212
|
-
// the default vaadin behavior is to attach the overlay to the body when opened
|
213
|
-
// we do not want that because it's difficult to style the overlay in this way
|
214
|
-
// so we override it to open inside the shadow DOM
|
215
|
-
#overrideOverlaySettings() {
|
216
|
-
const overlay = this.baseElement.shadowRoot.querySelector(
|
217
|
-
'vaadin-combo-box-overlay',
|
218
|
-
);
|
219
|
-
overlay._attachOverlay = () => {
|
220
|
-
overlay.bringToFront();
|
221
|
-
};
|
222
|
-
overlay._detachOverlay = () => {};
|
223
|
-
overlay._enterModalState = () => {};
|
224
|
-
}
|
225
|
-
|
226
|
-
#overrideRenderer() {
|
227
|
-
// use vaadin combobox custom renderer to render options as HTML
|
228
|
-
// and not via default renderer, which renders only the data-name's value
|
229
|
-
// in its own HTML template
|
230
|
-
this.baseElement.renderer = (root, combo, model) => {
|
231
|
-
// eslint-disable-next-line no-param-reassign
|
232
|
-
root.innerHTML = model.item.outerHTML;
|
233
|
-
};
|
234
|
-
}
|
235
|
-
|
236
|
-
init() {
|
237
|
-
super.init?.();
|
238
|
-
|
239
|
-
// eslint-disable-next-line func-names
|
240
|
-
this.getValidity = function () {
|
241
|
-
if (!this.value && this.isRequired) {
|
242
|
-
return {
|
243
|
-
valueMissing: true,
|
244
|
-
};
|
245
|
-
}
|
246
|
-
return {};
|
247
|
-
};
|
248
|
-
|
249
|
-
this.setComboBoxDescriptor();
|
250
|
-
this.#overrideOverlaySettings();
|
251
|
-
this.#overrideRenderer();
|
252
|
-
|
253
|
-
// Set up observers - order matters here since renderItems can clear innerHTML
|
254
|
-
observeAttributes(this, this.renderItems.bind(this), {
|
255
|
-
includeAttrs: ['data'],
|
256
|
-
});
|
257
|
-
observeChildren(this, this.#onChildrenChange.bind(this));
|
258
|
-
|
259
|
-
this.setDefaultValue();
|
260
|
-
|
261
|
-
this.baseElement.addEventListener('selected-item-changed', () => {
|
262
|
-
this.dispatchEvent(
|
263
|
-
new Event('input', { bubbles: true, composed: true }),
|
264
|
-
);
|
265
|
-
});
|
266
|
-
}
|
267
|
-
|
268
|
-
onLabelClick() {
|
269
|
-
if (this.isReadOnly || this.isDisabled) {
|
270
|
-
return;
|
271
|
-
}
|
272
|
-
this.focus();
|
273
|
-
this.setAttribute('opened', 'true');
|
274
|
-
}
|
275
|
-
|
276
|
-
attributeChangedCallback(attrName, oldValue, newValue) {
|
277
|
-
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
278
|
-
|
279
|
-
if (oldValue !== newValue) {
|
280
|
-
if (attrName === 'label-type') {
|
281
|
-
if (newValue === 'floating') {
|
282
|
-
this.addEventListener('click', this.onLabelClick);
|
283
|
-
} else {
|
284
|
-
this.removeEventListener('click', this.onLabelClick);
|
285
|
-
}
|
286
|
-
}
|
287
|
-
}
|
288
|
-
}
|
289
|
-
|
290
|
-
setDefaultValue() {
|
291
|
-
if (this.defaultValue) {
|
292
|
-
this.value = this.defaultValue;
|
293
|
-
}
|
294
|
-
}
|
295
|
-
|
296
|
-
#getChildToSelect(val) {
|
297
|
-
return this.baseElement.items?.find((item) => item['data-id'] === val);
|
298
|
-
}
|
299
|
-
|
300
|
-
#preventSelectedItemChangeEventIfNeeded(val, selectedChild) {
|
301
|
-
// If the actual value didn't change, but the selected item did (the element changed),
|
302
|
-
// we want to stop the event propagation since it's not a real change
|
303
|
-
const shouldPreventItemChangeEvent =
|
304
|
-
val === this.value && selectedChild !== this.baseElement.selectedItem;
|
305
|
-
if (shouldPreventItemChangeEvent) {
|
306
|
-
this.baseElement.addEventListener(
|
307
|
-
'selected-item-changed',
|
308
|
-
(e) => {
|
309
|
-
e.stopImmediatePropagation();
|
310
|
-
},
|
311
|
-
{ once: true, capture: true },
|
312
|
-
);
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
set value(val) {
|
317
|
-
const selectedChild = this.#getChildToSelect(val);
|
318
|
-
this.#preventSelectedItemChangeEventIfNeeded(val, selectedChild);
|
319
|
-
if (val && selectedChild) {
|
320
|
-
this.baseElement.selectedItem = selectedChild;
|
321
|
-
} else if (!selectedChild && this.allowCustomValue) {
|
322
|
-
this.baseElement.value = val;
|
323
|
-
} else {
|
324
|
-
this.baseElement.selectedItem = undefined;
|
325
|
-
}
|
326
|
-
}
|
327
|
-
|
328
|
-
get value() {
|
329
|
-
return this.baseElement.selectedItem?.['data-id'] || this.allowCustomValue
|
330
|
-
? this.baseElement.__data.value || ''
|
331
|
-
: '';
|
332
|
-
}
|
333
|
-
|
334
|
-
get allowCustomValue() {
|
335
|
-
return this.getAttribute('allow-custom-value') === 'true';
|
336
|
-
}
|
337
|
-
};
|
338
|
-
|
339
|
-
const {
|
340
|
-
host,
|
341
|
-
inputField,
|
342
|
-
inputElement,
|
343
|
-
placeholder,
|
344
|
-
toggle,
|
345
|
-
clearButton,
|
346
|
-
label,
|
347
|
-
requiredIndicator,
|
348
|
-
helperText,
|
349
|
-
errorMessage,
|
350
|
-
} = {
|
351
|
-
host: { selector: () => ':host' },
|
352
|
-
inputField: { selector: '::part(input-field)' },
|
353
|
-
inputElement: { selector: 'input' },
|
354
|
-
placeholder: { selector: '> input:placeholder-shown' },
|
355
|
-
toggle: { selector: '::part(toggle-button)' },
|
356
|
-
clearButton: { selector: '::part(clear-button)' },
|
357
|
-
label: { selector: '::part(label)' },
|
358
|
-
requiredIndicator: {
|
359
|
-
selector: '[required]::part(required-indicator)::after',
|
360
|
-
},
|
361
|
-
helperText: { selector: '::part(helper-text)' },
|
362
|
-
errorMessage: { selector: '::part(error-message)' },
|
363
|
-
};
|
364
|
-
|
365
|
-
export const ComboBoxClass = compose(
|
366
|
-
createStyleMixin({
|
367
|
-
mappings: {
|
368
|
-
hostWidth: { ...host, property: 'width' },
|
369
|
-
hostDirection: { ...host, property: 'direction' },
|
370
|
-
// we apply font-size also on the host so we can set its width with em
|
371
|
-
fontSize: [{}, host],
|
372
|
-
fontFamily: [label, placeholder, inputField, helperText, errorMessage],
|
373
|
-
labelFontSize: { ...label, property: 'font-size' },
|
374
|
-
labelFontWeight: { ...label, property: 'font-weight' },
|
375
|
-
labelTextColor: [
|
376
|
-
{ ...label, property: 'color' },
|
377
|
-
{ ...requiredIndicator, property: 'color' },
|
378
|
-
],
|
379
|
-
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
380
|
-
errorMessageIcon: { ...errorMessage, property: 'background-image' },
|
381
|
-
errorMessageIconSize: { ...errorMessage, property: 'background-size' },
|
382
|
-
errorMessageIconPadding: {
|
383
|
-
...errorMessage,
|
384
|
-
property: 'padding-inline-start',
|
385
|
-
},
|
386
|
-
errorMessageIconRepeat: {
|
387
|
-
...errorMessage,
|
388
|
-
property: 'background-repeat',
|
389
|
-
},
|
390
|
-
errorMessageIconPosition: {
|
391
|
-
...errorMessage,
|
392
|
-
property: 'background-position',
|
393
|
-
},
|
394
|
-
inputHeight: { ...inputField, property: 'height' },
|
395
|
-
inputBackgroundColor: { ...inputField, property: 'background-color' },
|
396
|
-
inputBorderColor: { ...inputField, property: 'border-color' },
|
397
|
-
inputBorderWidth: { ...inputField, property: 'border-width' },
|
398
|
-
inputBorderStyle: { ...inputField, property: 'border-style' },
|
399
|
-
inputBorderRadius: { ...inputField, property: 'border-radius' },
|
400
|
-
labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
|
401
|
-
inputValueTextColor: { ...inputField, property: 'color' },
|
402
|
-
inputPlaceholderTextColor: { ...placeholder, property: 'color' },
|
403
|
-
inputDropdownButtonCursor: [
|
404
|
-
{ ...toggle, property: 'cursor' },
|
405
|
-
{ ...clearButton, property: 'cursor' },
|
406
|
-
],
|
407
|
-
inputDropdownButtonColor: [
|
408
|
-
{ ...toggle, property: 'color' },
|
409
|
-
{ ...clearButton, property: 'color' },
|
410
|
-
],
|
411
|
-
inputDropdownButtonSize: [
|
412
|
-
{ ...toggle, property: 'font-size' },
|
413
|
-
{ ...clearButton, property: 'font-size' },
|
414
|
-
],
|
415
|
-
inputDropdownButtonOffset: [
|
416
|
-
{ ...toggle, property: 'margin-right' },
|
417
|
-
{ ...toggle, property: 'margin-left' },
|
418
|
-
],
|
419
|
-
inputOutlineColor: { ...inputField, property: 'outline-color' },
|
420
|
-
inputOutlineWidth: { ...inputField, property: 'outline-width' },
|
421
|
-
inputOutlineStyle: { ...inputField, property: 'outline-style' },
|
422
|
-
inputOutlineOffset: { ...inputField, property: 'outline-offset' },
|
423
|
-
inputHorizontalPadding: [
|
424
|
-
{ ...inputElement, property: 'padding-left' },
|
425
|
-
{ ...inputElement, property: 'padding-right' },
|
426
|
-
],
|
427
|
-
|
428
|
-
labelPosition: { ...label, property: 'position' },
|
429
|
-
labelTopPosition: { ...label, property: 'top' },
|
430
|
-
labelHorizontalPosition: [
|
431
|
-
{ ...label, property: 'left' },
|
432
|
-
{ ...label, property: 'right' },
|
433
|
-
],
|
434
|
-
inputTransformY: { ...label, property: 'transform' },
|
435
|
-
inputTransition: { ...label, property: 'transition' },
|
436
|
-
marginInlineStart: { ...label, property: 'margin-inline-start' },
|
437
|
-
placeholderOpacity: { ...placeholder, property: 'opacity' },
|
438
|
-
inputVerticalAlignment: { ...inputField, property: 'align-items' },
|
439
|
-
valueInputHeight: { ...inputElement, property: 'height' },
|
440
|
-
valueInputMarginBottom: { ...inputElement, property: 'margin-bottom' },
|
441
|
-
|
442
|
-
// we need to use the variables from the portal mixin
|
443
|
-
// so we need to use an arrow function on the selector
|
444
|
-
// for that to work, because ComboBox is not available
|
445
|
-
// at this time.
|
446
|
-
overlayBackground: {
|
447
|
-
property: () => ComboBoxClass.cssVarList.overlay.backgroundColor,
|
448
|
-
},
|
449
|
-
overlayTextColor: {
|
450
|
-
property: () => ComboBoxClass.cssVarList.overlay.textColor,
|
451
|
-
},
|
452
|
-
overlayBorder: {
|
453
|
-
property: () => ComboBoxClass.cssVarList.overlay.border,
|
454
|
-
},
|
455
|
-
overlayFontSize: {
|
456
|
-
property: () => ComboBoxClass.cssVarList.overlay.fontSize,
|
457
|
-
},
|
458
|
-
overlayFontFamily: {
|
459
|
-
property: () => ComboBoxClass.cssVarList.overlay.fontFamily,
|
460
|
-
},
|
461
|
-
overlayCursor: {
|
462
|
-
property: () => ComboBoxClass.cssVarList.overlay.cursor,
|
463
|
-
},
|
464
|
-
overlayItemBoxShadow: {
|
465
|
-
property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow,
|
466
|
-
},
|
467
|
-
overlayItemPaddingInlineStart: {
|
468
|
-
property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,
|
469
|
-
},
|
470
|
-
overlayItemPaddingInlineEnd: {
|
471
|
-
property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,
|
472
|
-
},
|
473
|
-
},
|
474
|
-
}),
|
475
|
-
draggableMixin,
|
476
|
-
portalMixin({
|
477
|
-
name: 'overlay',
|
478
|
-
selector: '',
|
479
|
-
mappings: {
|
480
|
-
backgroundColor: [
|
481
|
-
{ selector: 'vaadin-combo-box-scroller' },
|
482
|
-
{ selector: 'vaadin-combo-box-overlay::part(overlay)' },
|
483
|
-
],
|
484
|
-
minHeight: { selector: 'vaadin-combo-box-overlay' },
|
485
|
-
margin: { selector: 'vaadin-combo-box-overlay' },
|
486
|
-
cursor: { selector: 'vaadin-combo-box-item' },
|
487
|
-
fontFamily: { selector: 'vaadin-combo-box-item' },
|
488
|
-
textColor: { selector: 'vaadin-combo-box-item', property: 'color' },
|
489
|
-
fontSize: { selector: 'vaadin-combo-box-item' },
|
490
|
-
itemBoxShadow: {
|
491
|
-
selector: 'vaadin-combo-box-item',
|
492
|
-
property: 'box-shadow',
|
493
|
-
},
|
494
|
-
itemPaddingInlineStart: {
|
495
|
-
selector: 'vaadin-combo-box-item',
|
496
|
-
property: 'padding-inline-start',
|
497
|
-
},
|
498
|
-
itemPaddingInlineEnd: {
|
499
|
-
selector: 'vaadin-combo-box-item',
|
500
|
-
property: 'padding-inline-end',
|
501
|
-
},
|
502
|
-
|
503
|
-
loaderTop: {
|
504
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
505
|
-
property: 'top',
|
506
|
-
},
|
507
|
-
loaderLeft: {
|
508
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
509
|
-
property: 'left',
|
510
|
-
},
|
511
|
-
loaderRight: {
|
512
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
513
|
-
property: 'right',
|
514
|
-
},
|
515
|
-
loaderMargin: {
|
516
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
517
|
-
property: 'margin',
|
518
|
-
},
|
519
|
-
loaderWidth: {
|
520
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
521
|
-
property: 'width',
|
522
|
-
},
|
523
|
-
loaderHeight: {
|
524
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
525
|
-
property: 'height',
|
526
|
-
},
|
527
|
-
loaderBorder: {
|
528
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
529
|
-
property: 'border',
|
530
|
-
},
|
531
|
-
loaderBorderColor: {
|
532
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
533
|
-
property: 'border-color',
|
534
|
-
},
|
535
|
-
loaderBorderRadius: {
|
536
|
-
selector: 'vaadin-combo-box-overlay::part(loader)',
|
537
|
-
property: 'border-radius',
|
538
|
-
},
|
539
|
-
contentHeight: {
|
540
|
-
selector: 'vaadin-combo-box-overlay::part(content)',
|
541
|
-
property: 'height',
|
542
|
-
},
|
543
|
-
contentOpacity: {
|
544
|
-
selector: 'vaadin-combo-box-overlay::part(content)',
|
545
|
-
property: 'opacity',
|
546
|
-
},
|
547
|
-
},
|
548
|
-
forward: {
|
549
|
-
include: false,
|
550
|
-
attributes: ['size'],
|
551
|
-
},
|
552
|
-
}),
|
553
|
-
proxyInputMixin({
|
554
|
-
proxyProps: ['selectionStart'],
|
555
|
-
inputEvent: 'selected-item-changed',
|
556
|
-
}),
|
557
|
-
componentNameValidationMixin,
|
558
|
-
ComboBoxMixin,
|
559
|
-
)(
|
560
|
-
createProxy({
|
561
|
-
slots: ['', 'prefix'],
|
562
|
-
wrappedEleName: 'vaadin-combo-box',
|
563
|
-
style: () => `
|
564
|
-
:host {
|
565
|
-
display: inline-flex;
|
566
|
-
box-sizing: border-box;
|
567
|
-
-webkit-mask-image: none;
|
568
|
-
}
|
569
|
-
${useHostExternalPadding(ComboBoxClass.cssVarList)}
|
570
|
-
${resetInputReadonlyStyle('vaadin-combo-box')}
|
571
|
-
${resetInputPlaceholder('vaadin-combo-box')}
|
572
|
-
${resetInputCursor('vaadin-combo-box')}
|
573
|
-
|
574
|
-
vaadin-combo-box {
|
575
|
-
padding: 0;
|
576
|
-
width: 100%;
|
577
|
-
}
|
578
|
-
vaadin-combo-box::before {
|
579
|
-
height: initial;
|
580
|
-
}
|
581
|
-
vaadin-combo-box [slot="input"] {
|
582
|
-
-webkit-mask-image: none;
|
583
|
-
min-height: 0;
|
584
|
-
box-sizing: border-box;
|
585
|
-
}
|
586
|
-
|
587
|
-
vaadin-combo-box::part(input-field) {
|
588
|
-
padding: 0;
|
589
|
-
box-shadow: none;
|
590
|
-
}
|
591
|
-
|
592
|
-
vaadin-combo-box::part(toggle-button),
|
593
|
-
vaadin-combo-box::part(clear-button) {
|
594
|
-
align-self: center;
|
595
|
-
}
|
596
|
-
|
597
|
-
vaadin-combo-box[hide-toggle-button="true"]::part(toggle-button) {
|
598
|
-
display: none;
|
599
|
-
}
|
600
|
-
|
601
|
-
vaadin-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {
|
602
|
-
opacity: 0;
|
603
|
-
}
|
604
|
-
vaadin-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {
|
605
|
-
opacity: 0;
|
606
|
-
}
|
607
|
-
|
608
|
-
${resetInputLabelPosition('vaadin-combo-box')}
|
609
|
-
${inputFloatingLabelStyle()}
|
610
|
-
`,
|
611
|
-
// Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
|
612
|
-
// with the same name. Including it will cause Vaadin to calculate NaN size,
|
613
|
-
// and reset items to an empty array, and opening the list box with no items
|
614
|
-
// to display.
|
615
|
-
excludeAttrsSync: ['tabindex', 'size', 'data', 'loading'],
|
616
|
-
componentName,
|
617
|
-
includeForwardProps: ['items', 'renderer', 'selectedItem'],
|
618
|
-
}),
|
619
|
-
);
|