@descope/web-components-ui 3.7.3 → 3.9.0

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.
@@ -1,684 +0,0 @@
1
- import { compose, compareArraysUnordered } from '../../helpers';
2
- import {
3
- forwardAttrs,
4
- getComponentName,
5
- observeAttributes,
6
- observeChildren,
7
- } from '../../helpers/componentHelpers';
8
- import {
9
- resetInputLabelPosition,
10
- resetInputCursor,
11
- resetInputPlaceholder,
12
- resetInputReadonlyStyle,
13
- useHostExternalPadding,
14
- inputFloatingLabelStyle,
15
- } from '../../helpers/themeHelpers/resetHelpers';
16
- import {
17
- createStyleMixin,
18
- draggableMixin,
19
- createProxy,
20
- componentNameValidationMixin,
21
- portalMixin,
22
- proxyInputMixin,
23
- changeMixin,
24
- } from '../../mixins';
25
-
26
- export const componentName = getComponentName('multi-select-combo-box');
27
-
28
- const multiSelectComboBoxMixin = (superclass) =>
29
- class MultiSelectComboBoxMixinClass extends superclass {
30
- static get observedAttributes() {
31
- return ['readonly'];
32
- }
33
-
34
- #renderItem = ({ displayName, value, label }) => {
35
- const ele = document.createElement('span');
36
- ele.setAttribute('data-name', label);
37
- ele.setAttribute('data-id', value);
38
- ele.textContent = displayName || label;
39
-
40
- return ele.outerHTML;
41
- };
42
-
43
- #data;
44
-
45
- #value = [];
46
-
47
- get defaultValues() {
48
- const defaultValuesAttr = this.getAttribute('default-values');
49
- if (defaultValuesAttr) {
50
- try {
51
- const defaultValues = JSON.parse(defaultValuesAttr);
52
- if (this.isValidDataType(defaultValues)) {
53
- return defaultValues;
54
- }
55
- } catch (e) {
56
- // eslint-disable-next-line no-console
57
- console.error('could not parse data string from attribute "default-values" -', e.message);
58
- }
59
- }
60
- return [];
61
- }
62
-
63
- get renderItem() {
64
- return this.#renderItem;
65
- }
66
-
67
- set renderItem(renderFn) {
68
- this.#renderItem = renderFn;
69
- this.renderItems();
70
- }
71
-
72
- get data() {
73
- if (this.#data) return this.#data;
74
-
75
- const dataAttr = this.getAttribute('data');
76
-
77
- if (dataAttr) {
78
- try {
79
- const data = JSON.parse(dataAttr);
80
- if (this.isValidDataType(data)) {
81
- return data;
82
- }
83
- } catch (e) {
84
- // eslint-disable-next-line no-console
85
- console.error('could not parse data string from attribute "data" -', e.message);
86
- }
87
- }
88
-
89
- return [];
90
- }
91
-
92
- set data(data) {
93
- if (this.isValidDataType(data)) {
94
- this.#data = data;
95
- this.renderItems();
96
- }
97
- }
98
-
99
- get allowCustomValues() {
100
- return this.getAttribute('allow-custom-value') === 'true';
101
- }
102
-
103
- get minItemsSelection() {
104
- return parseInt(this.getAttribute('min-items-selection'), 10) || 0;
105
- }
106
-
107
- get maxItemsSelection() {
108
- return parseInt(this.getAttribute('max-items-selection'), 10) || 0;
109
- }
110
-
111
- isValidDataType(data) {
112
- const isValid = Array.isArray(data);
113
- if (!isValid) {
114
- // eslint-disable-next-line no-console
115
- console.error('data and default-values must be an array, received:', data);
116
- }
117
-
118
- return isValid;
119
- }
120
-
121
- getItemsTemplate() {
122
- return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');
123
- }
124
-
125
- renderItems() {
126
- const template = this.getItemsTemplate();
127
- if (template) this.innerHTML = template;
128
- }
129
-
130
- updateSelectedItems() {
131
- // This is a list of all the selected items, including ones that may have been removed from the DOM
132
- const currentSelected =
133
- this.baseElement.selectedItems?.map((item) => item.getAttribute('data-id')) || [];
134
-
135
- // if there are selected items, we want to trigger a potential update to the value if some child elements were removed
136
- if (currentSelected.length > 0) {
137
- // setting the value checks that the selected items are still in the DOM and will not set the value if they are not
138
- this.value = currentSelected;
139
- }
140
-
141
- // otherwise, if default value is specified, set default value as selected item
142
- if (this.value.length === 0) {
143
- this.setDefaultValues();
144
- }
145
- }
146
-
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
- const transformedValue = comboBox.customValueTransformFn(val) || '';
167
-
168
- if (transformedValue === this.value) {
169
- return;
170
- }
171
-
172
- valueDescriptor.set.call(this, transformedValue);
173
- },
174
- },
175
- });
176
- }
177
-
178
- // To prevent duplicate items for the multi select options, we dedup them based on the "data-id" attribute
179
-
180
- #dedupItems(items) {
181
- return Array.from(
182
- new Map(items.map((item) => [item.getAttribute('data-id'), item])).values()
183
- );
184
- }
185
-
186
- // vaadin api is to set props on their combo box node,
187
- // in order to avoid it, we are passing the children of this component
188
- // to the items & renderer props, so it will be used as the combo box items
189
- #onChildrenChange() {
190
- const items = Array.from(this.children);
191
- const dedupItems = this.#dedupItems(items);
192
-
193
- // we want the data-name attribute to be accessible as an object attribute
194
- if (items.length) {
195
- this.removeAttribute('has-no-options');
196
-
197
- dedupItems.forEach((node) => {
198
- Object.defineProperty(node, 'data-name', {
199
- value: node.getAttribute('data-name'),
200
- configurable: true,
201
- writable: true,
202
- });
203
- Object.defineProperty(node, 'data-id', {
204
- value: node.getAttribute('data-id'),
205
- configurable: true,
206
- writable: true,
207
- });
208
- });
209
-
210
- this.baseElement.items = dedupItems;
211
-
212
- setTimeout(() => {
213
- // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden
214
- this.updateSelectedItems();
215
- }, 0);
216
- } else {
217
- this.baseElement.items = [];
218
- this.setAttribute('has-no-options', '');
219
- }
220
-
221
- // use vaadin combobox custom renderer to render options as HTML
222
- // and not via default renderer, which renders only the data-name's value
223
- // in its own HTML template
224
- this.baseElement.renderer = (root, combo, model) => {
225
- root.innerHTML = model.item.outerHTML;
226
- };
227
- }
228
-
229
- // the default vaadin behavior is to attach the overlay to the body when opened
230
- // we do not want that because it's difficult to style the overlay in this way
231
- // so we override it to open inside the shadow DOM
232
- #overrideOverlaySettings() {
233
- const overlay = this.baseElement.shadowRoot
234
- .querySelector('vaadin-multi-select-combo-box-internal')
235
- .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');
236
- overlay._attachOverlay = () => {
237
- overlay.bringToFront();
238
- };
239
- overlay._detachOverlay = () => {};
240
- overlay._enterModalState = () => {};
241
- }
242
-
243
- #handleCustomValues() {
244
- if (this.allowCustomValues) {
245
- this.baseElement.addEventListener('custom-value-set', (e) => {
246
- const newItemHtml = this.#renderItem({
247
- label: e.detail,
248
- displayName: e.detail,
249
- value: e.detail,
250
- });
251
- this.innerHTML += newItemHtml;
252
- // The internal filter needs to be removed, otherwise there's a bug where a new custom item
253
- // added can't be removed from the dropdown because of how the vaadin component is implemented
254
- this.baseElement._lastFilter = '';
255
- // The value needs to be set with a timeout because it needs to execute after
256
- // the custom value is added to items by the children change observer
257
- setTimeout(() => {
258
- this.value = [...this.value, e.detail];
259
- }, 0);
260
- });
261
- }
262
- }
263
-
264
- setGetValidity() {
265
- // eslint-disable-next-line func-names
266
- this.getValidity = function () {
267
- if (this.pattern) {
268
- const patternRegex = new RegExp(this.pattern);
269
- if (this.value.some((val) => !patternRegex.test(val)))
270
- return {
271
- patternMismatch: true,
272
- };
273
- }
274
-
275
- if (this.isRequired && !this.value.length) {
276
- return {
277
- valueMissing: true,
278
- };
279
- }
280
- // If the field is not required, no minimum selection can be set
281
- if (
282
- this.isRequired &&
283
- this.minItemsSelection &&
284
- this.value.length < this.minItemsSelection
285
- ) {
286
- return {
287
- rangeUnderflow: true,
288
- };
289
- }
290
- if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {
291
- return {
292
- rangeOverflow: true,
293
- };
294
- }
295
- return {};
296
- };
297
-
298
- // This is required to override the default validity check of the vaadin component
299
- // which is triggered when the component is checked for validity after blur
300
- // Without this, our minItemsSelection and maxItemsSelection constraints will not be checked
301
- const that = this;
302
-
303
- this.baseElement.checkValidity = () => that.validity.valid;
304
- }
305
-
306
- init() {
307
- super.init?.();
308
-
309
- this.setGetValidity();
310
-
311
- this.#handleCustomValues();
312
-
313
- this.renderItems();
314
-
315
- observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });
316
-
317
- observeChildren(this, this.#onChildrenChange.bind(this));
318
-
319
- // Note: we need to forward the `placeholder` because the vaadin component observes it and
320
- // tries to override it, causing us to lose the user set placeholder.
321
- forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });
322
-
323
- // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to
324
- // set the component's descriptor and override the overlay settings.
325
- // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.
326
- setTimeout(() => {
327
- this.setComboBoxDescriptor();
328
- this.#overrideOverlaySettings();
329
- });
330
-
331
- this.setDefaultValues();
332
-
333
- this.baseElement.addEventListener('selected-items-changed', () => {
334
- this.#updateInternalValue();
335
- this.dispatchEvent(new CustomEvent('input', { bubbles: true }));
336
- });
337
- }
338
-
339
- setDefaultValues() {
340
- const initialDefaultValues = this.defaultValues;
341
- if (initialDefaultValues.length > 0) {
342
- this.value = this.defaultValues;
343
- }
344
- }
345
-
346
- #updateInternalValue() {
347
- // This is done here because we don't want to return a different copy of the same array
348
- // every time get value is called if a new value wasn't set
349
- this.#value =
350
- this.baseElement.selectedItems?.map((elem) => elem.getAttribute('data-id')) || [];
351
- }
352
-
353
- // Updating the value will update the selectedItems, which will trigger an event 'selected-items-changed'
354
- // which we listen to in the init function to update the internal value
355
- set value(vals) {
356
- if (vals && vals.length > 0) {
357
- // Filters the children of the component to find the ones that match the values,
358
- // since it's possible that some values that are trying to set are not in the children
359
- const selectedChildren = this.baseElement.items?.filter((item) =>
360
- vals.includes(item['data-id'])
361
- );
362
-
363
- // If the component allows custom values, we need to add the values that are not present in the children
364
- if (this.allowCustomValues) {
365
- const existingValues =
366
- selectedChildren?.map((child) => child.getAttribute('data-id')) || [];
367
- const missingValues = vals.filter((val) => !existingValues.includes(val));
368
-
369
- if (missingValues.length) {
370
- const newItemsHtml = missingValues.reduce((acc, val) => {
371
- const newItemHtml = this.#renderItem({
372
- label: val,
373
- displayName: val,
374
- value: val,
375
- });
376
- return acc + newItemHtml;
377
- }, '');
378
- this.innerHTML += newItemsHtml;
379
-
380
- // The value needs to be set with a timeout because it needs to execute after
381
- // the custom values are added to the items by the children change observer
382
- setTimeout(() => {
383
- this.value = vals;
384
- }, 0);
385
- return;
386
- }
387
- }
388
-
389
- const newSelectedValues =
390
- selectedChildren?.map((child) => child.getAttribute('data-id')) || [];
391
- if (!compareArraysUnordered(this.#value, newSelectedValues)) {
392
- this.baseElement.selectedItems = selectedChildren;
393
- }
394
- } else {
395
- this.baseElement.selectedItems = [];
396
- }
397
- }
398
-
399
- get value() {
400
- return this.#value;
401
- }
402
-
403
- attributeChangedCallback(attrName, oldValue, newValue) {
404
- super.attributeChangedCallback?.(attrName, oldValue, newValue);
405
-
406
- if (attrName === 'readonly') {
407
- this.onReadOnlyChange(newValue !== null && newValue === 'true');
408
- }
409
- }
410
-
411
- onReadOnlyChange(val) {
412
- if (val) {
413
- this.baseElement?.shadowRoot
414
- ?.querySelector('vaadin-multi-select-combo-box-internal')
415
- ?.setAttribute('inert', val);
416
- } else {
417
- this.baseElement?.shadowRoot
418
- ?.querySelector('vaadin-multi-select-combo-box-internal')
419
- ?.removeAttribute('inert');
420
- }
421
- }
422
- };
423
-
424
- const {
425
- host,
426
- inputField,
427
- inputElement,
428
- placeholder,
429
- toggle,
430
- clearButton,
431
- label,
432
- requiredIndicator,
433
- helperText,
434
- errorMessage,
435
- chip,
436
- chipLabel,
437
- overflowChipFirstBorder,
438
- overflowChipSecondBorder,
439
- } = {
440
- host: { selector: () => ':host' },
441
- inputField: { selector: '::part(input-field)' },
442
- inputElement: { selector: 'input' },
443
- placeholder: { selector: '> input:placeholder-shown' },
444
- toggle: { selector: '::part(toggle-button)' },
445
- clearButton: { selector: '::part(clear-button)' },
446
- label: { selector: '::part(label)' },
447
- requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
448
- helperText: { selector: '::part(helper-text)' },
449
- errorMessage: { selector: '::part(error-message)' },
450
- chip: { selector: 'vaadin-multi-select-combo-box-chip' },
451
- chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },
452
- overflowChipFirstBorder: {
453
- selector: "vaadin-multi-select-combo-box-chip[slot='overflow']::before",
454
- },
455
- overflowChipSecondBorder: {
456
- selector: "vaadin-multi-select-combo-box-chip[slot='overflow']::after",
457
- },
458
- };
459
-
460
- export const MultiSelectComboBoxClass = compose(
461
- createStyleMixin({
462
- mappings: {
463
- hostWidth: { ...host, property: 'width' },
464
- hostDirection: { ...host, property: 'direction' },
465
- // we apply font-size also on the host so we can set its width with em
466
- fontSize: [{}, host],
467
- chipFontSize: { ...chipLabel, property: 'font-size' },
468
- fontFamily: [label, placeholder, inputField, helperText, errorMessage, chipLabel],
469
- labelFontSize: { ...label, property: 'font-size' },
470
- labelFontWeight: { ...label, property: 'font-weight' },
471
- inputValueFontWeight: { ...inputField, property: 'font-weight' },
472
- inputPlaceholderFontWeight: { ...placeholder, property: 'font-weight' },
473
- helperTextFontWeight: { ...helperText, property: 'font-weight' },
474
- errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },
475
- labelTextColor: [
476
- { ...label, property: 'color' },
477
- { ...requiredIndicator, property: 'color' },
478
- ],
479
- errorMessageTextColor: { ...errorMessage, property: 'color' },
480
- errorMessageIcon: { ...errorMessage, property: 'background-image' },
481
- errorMessageIconSize: { ...errorMessage, property: 'background-size' },
482
- errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
483
- errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
484
- errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
485
- errorMessageFontSize: { ...errorMessage, property: 'font-size' },
486
- inputHeight: { ...inputField, property: 'min-height' },
487
- inputBackgroundColor: { ...inputField, property: 'background-color' },
488
- inputBorderColor: { ...inputField, property: 'border-color' },
489
- inputBorderWidth: { ...inputField, property: 'border-width' },
490
- inputBorderStyle: { ...inputField, property: 'border-style' },
491
- inputBorderRadius: { ...inputField, property: 'border-radius' },
492
- labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
493
- inputValueTextColor: { ...inputField, property: 'color' },
494
- inputPlaceholderTextColor: { ...placeholder, property: 'color' },
495
- inputDropdownButtonCursor: [
496
- { ...toggle, property: 'cursor' },
497
- { ...clearButton, property: 'cursor' },
498
- ],
499
- inputDropdownButtonColor: [
500
- { ...toggle, property: 'color' },
501
- { ...clearButton, property: 'color' },
502
- ],
503
- inputDropdownButtonSize: [
504
- { ...toggle, property: 'font-size' },
505
- { ...clearButton, property: 'font-size' },
506
- ],
507
- inputDropdownButtonOffset: [
508
- { ...toggle, property: 'margin-right' },
509
- { ...toggle, property: 'margin-left' },
510
- ],
511
- inputOutlineColor: { ...inputField, property: 'outline-color' },
512
- inputOutlineWidth: { ...inputField, property: 'outline-width' },
513
- inputOutlineStyle: { ...inputField, property: 'outline-style' },
514
- inputOutlineOffset: { ...inputField, property: 'outline-offset' },
515
- inputHorizontalPadding: [
516
- { ...inputElement, property: 'padding-left' },
517
- { ...inputElement, property: 'padding-right' },
518
- { ...inputField, property: 'padding-inline-start' },
519
- ],
520
- inputVerticalPadding: [
521
- { ...inputField, property: 'padding-top' },
522
- { ...inputField, property: 'padding-bottom' },
523
- ],
524
- chipTextColor: { ...chipLabel, property: 'color' },
525
- chipBackgroundColor: [
526
- { ...chip, property: 'background-color' },
527
- { ...overflowChipFirstBorder, property: 'border-color' },
528
- { ...overflowChipSecondBorder, property: 'border-color' },
529
- ],
530
-
531
- labelPosition: { ...label, property: 'position' },
532
- labelTopPosition: { ...label, property: 'top' },
533
- labelLeftPosition: { ...label, property: 'left' },
534
- labelHorizontalPosition: [
535
- { ...label, property: 'left' },
536
- { ...label, property: 'right' },
537
- ],
538
- inputTransformY: { ...label, property: 'transform' },
539
- inputTransition: { ...label, property: 'transition' },
540
- marginInlineStart: { ...label, property: 'margin-inline-start' },
541
- placeholderOpacity: { ...placeholder, property: 'opacity' },
542
- inputVerticalAlignment: { ...inputField, property: 'align-items' },
543
-
544
- // we need to use the variables from the portal mixin
545
- // so we need to use an arrow function on the selector
546
- // for that to work, because ComboBox is not available
547
- // at this time.
548
- overlayBackground: {
549
- property: () => MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,
550
- },
551
- overlayTextColor: {
552
- property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,
553
- },
554
- overlayBorder: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.border },
555
- overlayFontSize: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize },
556
- overlayFontFamily: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily },
557
- overlayCursor: { property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor },
558
- overlayItemBoxShadow: {
559
- property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,
560
- },
561
- overlayItemPaddingInlineStart: {
562
- property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,
563
- },
564
- overlayItemPaddingInlineEnd: {
565
- property: () => MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,
566
- },
567
- },
568
- }),
569
- draggableMixin,
570
- portalMixin({
571
- name: 'overlay',
572
- selector: 'vaadin-multi-select-combo-box-internal',
573
- mappings: {
574
- backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },
575
- minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },
576
- margin: { selector: 'vaadin-multi-select-combo-box-overlay' },
577
- cursor: { selector: 'vaadin-multi-select-combo-box-item' },
578
- fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },
579
- textColor: { selector: 'vaadin-multi-select-combo-box-item', property: 'color' },
580
- fontSize: { selector: 'vaadin-multi-select-combo-box-item' },
581
- itemBoxShadow: { selector: 'vaadin-multi-select-combo-box-item', property: 'box-shadow' },
582
- itemPaddingInlineStart: {
583
- selector: 'vaadin-multi-select-combo-box-item',
584
- property: 'padding-inline-start',
585
- },
586
- itemPaddingInlineEnd: {
587
- selector: 'vaadin-multi-select-combo-box-item',
588
- property: 'padding-inline-end',
589
- },
590
- },
591
- forward: {
592
- include: false,
593
- attributes: ['size'],
594
- },
595
- }),
596
- proxyInputMixin({ proxyProps: ['selectionStart'], inputEvent: 'selected-items-changed' }),
597
- changeMixin,
598
- componentNameValidationMixin,
599
- multiSelectComboBoxMixin
600
- )(
601
- createProxy({
602
- slots: ['', 'prefix'],
603
- wrappedEleName: 'vaadin-multi-select-combo-box',
604
- style: () => `
605
- :host {
606
- display: inline-flex;
607
- box-sizing: border-box;
608
- -webkit-mask-image: none;
609
- }
610
- ${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}
611
- ${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}
612
- ${resetInputPlaceholder('vaadin-multi-select-combo-box')}
613
- ${resetInputCursor('vaadin-multi-select-combo-box')}
614
-
615
- vaadin-multi-select-combo-box {
616
- padding: 0;
617
- width: 100%;
618
- }
619
- vaadin-multi-select-combo-box::before {
620
- height: initial;
621
- }
622
- vaadin-multi-select-combo-box [slot="input"] {
623
- -webkit-mask-image: none;
624
- min-height: 0;
625
- align-self: center;
626
- box-sizing: border-box;
627
- }
628
- vaadin-multi-select-combo-box[readonly] [slot="input"] {
629
- flex-grow: 1;
630
- flex-basis: 4em;
631
- }
632
-
633
- ::part(input-field) {
634
- padding: 0;
635
- box-shadow: none;
636
- }
637
- ${resetInputLabelPosition('vaadin-multi-select-combo-box')}
638
- :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {
639
- display: block;
640
- }
641
-
642
- vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,
643
- vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {
644
- left: -4px;
645
- right: -4px;
646
- border-left-width: 0;
647
- border-inline-start-style: solid;
648
- border-inline-start-width: 2px;
649
- }
650
- vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {
651
- left: -8px;
652
- right: -8px;
653
- }
654
-
655
- :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {
656
- display: none;
657
- }
658
-
659
- ${inputFloatingLabelStyle()}
660
-
661
- vaadin-multi-select-combo-box::part(toggle-button),
662
- vaadin-multi-select-combo-box::part(clear-button) {
663
- align-self: center;
664
- }
665
-
666
- vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {
667
- opacity: 0;
668
- }
669
- vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {
670
- opacity: 0;
671
- }
672
-
673
- `,
674
- // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
675
- // with the same name. Including it will cause Vaadin to calculate NaN size,
676
- // and reset items to an empty array, and opening the list box with no items
677
- // to display.
678
- // Note: we exclude `placeholder` because the vaadin component observes it and
679
- // tries to override it, causing us to lose the user set placeholder.
680
- excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder', 'style'],
681
- componentName,
682
- includeForwardProps: ['items', 'renderer', 'selectedItems'],
683
- })
684
- );
@@ -1,6 +0,0 @@
1
- import '@vaadin/multi-select-combo-box';
2
- import { componentName, MultiSelectComboBoxClass } from './MultiSelectComboBoxClass';
3
-
4
- customElements.define(componentName, MultiSelectComboBoxClass);
5
-
6
- export { MultiSelectComboBoxClass, componentName };