@vaadin/multi-select-combo-box 24.8.4 → 25.0.0-alpha10

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.
Files changed (44) hide show
  1. package/README.md +0 -23
  2. package/package.json +18 -19
  3. package/src/{vaadin-multi-select-combo-box-styles.d.ts → styles/vaadin-multi-select-combo-box-base-styles.d.ts} +1 -3
  4. package/src/styles/vaadin-multi-select-combo-box-base-styles.js +58 -0
  5. package/src/styles/vaadin-multi-select-combo-box-chip-base-styles.js +112 -0
  6. package/src/styles/vaadin-multi-select-combo-box-chip-core-styles.js +33 -0
  7. package/{theme/material/vaadin-multi-select-combo-box-chip-styles.d.ts → src/styles/vaadin-multi-select-combo-box-core-styles.d.ts} +3 -3
  8. package/src/{vaadin-multi-select-combo-box-styles.js → styles/vaadin-multi-select-combo-box-core-styles.js} +6 -29
  9. package/src/styles/vaadin-multi-select-combo-box-overlay-base-styles.js +19 -0
  10. package/src/styles/vaadin-multi-select-combo-box-overlay-core-styles.js +21 -0
  11. package/src/styles/vaadin-multi-select-combo-box-scroller-base-styles.js +8 -0
  12. package/src/styles/vaadin-multi-select-combo-box-scroller-core-styles.js +27 -0
  13. package/src/vaadin-multi-select-combo-box-chip.js +17 -11
  14. package/src/vaadin-multi-select-combo-box-container.js +27 -34
  15. package/src/vaadin-multi-select-combo-box-item.js +13 -12
  16. package/src/vaadin-multi-select-combo-box-mixin.d.ts +9 -82
  17. package/src/vaadin-multi-select-combo-box-mixin.js +380 -268
  18. package/src/vaadin-multi-select-combo-box-overlay.js +15 -25
  19. package/src/vaadin-multi-select-combo-box-scroller.js +10 -26
  20. package/src/vaadin-multi-select-combo-box.d.ts +14 -10
  21. package/src/vaadin-multi-select-combo-box.js +52 -69
  22. package/theme/lumo/vaadin-multi-select-combo-box-styles.js +4 -1
  23. package/web-types.json +207 -230
  24. package/web-types.lit.json +78 -78
  25. package/src/vaadin-lit-multi-select-combo-box-chip.js +0 -88
  26. package/src/vaadin-lit-multi-select-combo-box-container.js +0 -66
  27. package/src/vaadin-lit-multi-select-combo-box-internal.js +0 -56
  28. package/src/vaadin-lit-multi-select-combo-box-item.js +0 -68
  29. package/src/vaadin-lit-multi-select-combo-box-overlay.js +0 -64
  30. package/src/vaadin-lit-multi-select-combo-box-scroller.js +0 -96
  31. package/src/vaadin-lit-multi-select-combo-box.js +0 -146
  32. package/src/vaadin-multi-select-combo-box-internal-mixin.js +0 -449
  33. package/src/vaadin-multi-select-combo-box-internal.js +0 -51
  34. package/theme/lumo/vaadin-lit-multi-select-combo-box.d.ts +0 -3
  35. package/theme/lumo/vaadin-lit-multi-select-combo-box.js +0 -3
  36. package/theme/material/vaadin-lit-multi-select-combo-box.d.ts +0 -3
  37. package/theme/material/vaadin-lit-multi-select-combo-box.js +0 -3
  38. package/theme/material/vaadin-multi-select-combo-box-chip-styles.js +0 -102
  39. package/theme/material/vaadin-multi-select-combo-box-styles.d.ts +0 -9
  40. package/theme/material/vaadin-multi-select-combo-box-styles.js +0 -92
  41. package/theme/material/vaadin-multi-select-combo-box.d.ts +0 -8
  42. package/theme/material/vaadin-multi-select-combo-box.js +0 -8
  43. package/vaadin-lit-multi-select-combo-box.d.ts +0 -1
  44. package/vaadin-lit-multi-select-combo-box.js +0 -2
@@ -1,64 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css, html, LitElement } from 'lit';
7
- import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
8
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
- import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
- import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
12
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
13
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
-
15
- const multiSelectComboBoxOverlayStyles = css`
16
- #overlay {
17
- width: var(
18
- --vaadin-multi-select-combo-box-overlay-width,
19
- var(--_vaadin-multi-select-combo-box-overlay-default-width, auto)
20
- );
21
- }
22
-
23
- [part='content'] {
24
- display: flex;
25
- flex-direction: column;
26
- height: 100%;
27
- }
28
- `;
29
-
30
- /**
31
- * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
32
- *
33
- * @customElement
34
- * @extends HTMLElement
35
- * @mixes ComboBoxOverlayMixin
36
- * @mixes DirMixin
37
- * @mixes OverlayMixin
38
- * @mixes ThemableMixin
39
- * @private
40
- */
41
- class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
42
- OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))),
43
- ) {
44
- static get is() {
45
- return 'vaadin-multi-select-combo-box-overlay';
46
- }
47
-
48
- static get styles() {
49
- return [overlayStyles, multiSelectComboBoxOverlayStyles];
50
- }
51
-
52
- /** @protected */
53
- render() {
54
- return html`
55
- <div id="backdrop" part="backdrop" hidden></div>
56
- <div part="overlay" id="overlay">
57
- <div part="loader"></div>
58
- <div part="content" id="content"><slot></slot></div>
59
- </div>
60
- `;
61
- }
62
- }
63
-
64
- defineCustomElement(MultiSelectComboBoxOverlay);
@@ -1,96 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css, html, LitElement } from 'lit';
7
- import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
8
- import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
9
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
-
12
- /**
13
- * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
14
- *
15
- * @customElement
16
- * @extends HTMLElement
17
- * @mixes ComboBoxScrollerMixin
18
- * @private
19
- */
20
- export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(PolylitMixin(LitElement)) {
21
- static get is() {
22
- return 'vaadin-multi-select-combo-box-scroller';
23
- }
24
-
25
- static get styles() {
26
- return css`
27
- :host {
28
- display: block;
29
- min-height: 1px;
30
- overflow: auto;
31
-
32
- /* Fixes item background from getting on top of scrollbars on Safari */
33
- transform: translate3d(0, 0, 0);
34
-
35
- /* Enable momentum scrolling on iOS */
36
- -webkit-overflow-scrolling: touch;
37
-
38
- /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
39
- box-shadow: 0 0 0 white;
40
- }
41
-
42
- #selector {
43
- border-width: var(--_vaadin-multi-select-combo-box-items-container-border-width);
44
- border-style: var(--_vaadin-multi-select-combo-box-items-container-border-style);
45
- border-color: var(--_vaadin-multi-select-combo-box-items-container-border-color, transparent);
46
- position: relative;
47
- }
48
- `;
49
- }
50
-
51
- /** @protected */
52
- render() {
53
- return html`
54
- <div id="selector">
55
- <slot></slot>
56
- </div>
57
- `;
58
- }
59
-
60
- /** @protected */
61
- ready() {
62
- super.ready();
63
-
64
- this.setAttribute('aria-multiselectable', 'true');
65
- }
66
-
67
- /**
68
- * @protected
69
- * @override
70
- */
71
- _isItemSelected(item, _selectedItem, itemIdPath) {
72
- if (item instanceof ComboBoxPlaceholder) {
73
- return false;
74
- }
75
-
76
- if (this.owner.readonly) {
77
- return false;
78
- }
79
-
80
- return this.owner._findIndex(item, this.owner.selectedItems, itemIdPath) > -1;
81
- }
82
-
83
- /**
84
- * @param {HTMLElement} el
85
- * @param {number} index
86
- * @protected
87
- * @override
88
- */
89
- _updateElement(el, index) {
90
- super._updateElement(el, index);
91
-
92
- el.toggleAttribute('readonly', this.owner.readonly);
93
- }
94
- }
95
-
96
- defineCustomElement(MultiSelectComboBoxScroller);
@@ -1,146 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-lit-multi-select-combo-box-chip.js';
7
- import './vaadin-lit-multi-select-combo-box-container.js';
8
- import './vaadin-lit-multi-select-combo-box-internal.js';
9
- import { html, LitElement } from 'lit';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
13
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
14
- import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
15
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
16
- import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.js';
17
- import { multiSelectComboBox } from './vaadin-multi-select-combo-box-styles.js';
18
-
19
- /**
20
- * LitElement based version of `<vaadin-multi-select-combo-box>` web component.
21
- *
22
- * ## Disclaimer
23
- *
24
- * This component is an experiment and not yet a part of Vaadin platform.
25
- * There is no ETA regarding specific Vaadin version where it'll land.
26
- * Feel free to try this code in your apps as per Apache 2.0 license.
27
- */
28
- class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
29
- static get is() {
30
- return 'vaadin-multi-select-combo-box';
31
- }
32
-
33
- static get styles() {
34
- return [inputFieldShared, multiSelectComboBox];
35
- }
36
-
37
- /** @protected */
38
- render() {
39
- return html`
40
- <div class="vaadin-multi-select-combo-box-container">
41
- <div part="label">
42
- <slot name="label"></slot>
43
- <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
44
- </div>
45
-
46
- <vaadin-multi-select-combo-box-internal
47
- id="comboBox"
48
- .filteredItems="${this.filteredItems}"
49
- .items="${this.items}"
50
- .itemIdPath="${this.itemIdPath}"
51
- .itemLabelPath="${this.itemLabelPath}"
52
- .itemValuePath="${this.itemValuePath}"
53
- .disabled="${this.disabled}"
54
- .readonly="${this.readonly}"
55
- .autoOpenDisabled="${this.autoOpenDisabled}"
56
- .allowCustomValue="${this.allowCustomValue}"
57
- .overlayClass="${this.overlayClass}"
58
- .dataProvider="${this.dataProvider}"
59
- .filter="${this.filter}"
60
- .lastFilter="${this._lastFilter}"
61
- .loading="${this.loading}"
62
- .size="${this.size}"
63
- .selectedItems="${this.selectedItems}"
64
- .selectedItemsOnTop="${this.selectedItemsOnTop}"
65
- .itemClassNameGenerator="${this.itemClassNameGenerator}"
66
- .topGroup="${this._topGroup}"
67
- .opened="${this.opened}"
68
- .renderer="${this.renderer}"
69
- .keepFilter="${this.keepFilter}"
70
- theme="${ifDefined(this._theme)}"
71
- @combo-box-item-selected="${this._onComboBoxItemSelected}"
72
- @change="${this._onComboBoxChange}"
73
- @custom-value-set="${this._onCustomValueSet}"
74
- @filtered-items-changed="${this._onFilteredItemsChanged}"
75
- @filter-changed="${this._onComboBoxFilterChanged}"
76
- @last-filter-changed="${this._onComboBoxLastFilterChanged}"
77
- @loading-changed="${this._onComboBoxLoadingChanged}"
78
- @opened-changed="${this._onComboBoxOpenedChanged}"
79
- @size-changed="${this._onComboBoxSizeChanged}"
80
- >
81
- <vaadin-multi-select-combo-box-container
82
- part="input-field"
83
- .autoExpandVertically="${this.autoExpandVertically}"
84
- .readonly="${this.readonly}"
85
- .disabled="${this.disabled}"
86
- .invalid="${this.invalid}"
87
- theme="${ifDefined(this._theme)}"
88
- >
89
- <slot name="overflow" slot="prefix"></slot>
90
- <div id="chips" part="chips" slot="prefix">
91
- <slot name="chip"></slot>
92
- </div>
93
- <slot name="input"></slot>
94
- <div
95
- id="clearButton"
96
- part="clear-button"
97
- slot="suffix"
98
- @touchend="${this._onClearButtonTouchend}"
99
- aria-hidden="true"
100
- ></div>
101
- <div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
102
- </vaadin-multi-select-combo-box-container>
103
- </vaadin-multi-select-combo-box-internal>
104
-
105
- <div part="helper-text">
106
- <slot name="helper"></slot>
107
- </div>
108
-
109
- <div part="error-message">
110
- <slot name="error-message"></slot>
111
- </div>
112
- </div>
113
-
114
- <slot name="tooltip"></slot>
115
- `;
116
- }
117
-
118
- /** @private */
119
- _onComboBoxFilterChanged(event) {
120
- this.filter = event.detail.value;
121
- }
122
-
123
- /** @private */
124
- _onComboBoxLoadingChanged(event) {
125
- this.loading = event.detail.value;
126
- }
127
-
128
- /** @private */
129
- _onComboBoxLastFilterChanged(event) {
130
- this._lastFilter = event.detail.value;
131
- }
132
-
133
- /** @private */
134
- _onComboBoxOpenedChanged(event) {
135
- this.opened = event.detail.value;
136
- }
137
-
138
- /** @private */
139
- _onComboBoxSizeChanged(event) {
140
- this.size = event.detail.value;
141
- }
142
- }
143
-
144
- defineCustomElement(MultiSelectComboBox);
145
-
146
- export { MultiSelectComboBox };