@vaadin/multi-select-combo-box 24.8.0-alpha9 → 25.0.0-alpha2

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 (35) hide show
  1. package/README.md +0 -23
  2. package/package.json +16 -19
  3. package/src/vaadin-multi-select-combo-box-chip.js +15 -10
  4. package/src/vaadin-multi-select-combo-box-container.js +26 -34
  5. package/src/vaadin-multi-select-combo-box-internal.js +19 -14
  6. package/src/vaadin-multi-select-combo-box-item.js +17 -12
  7. package/src/vaadin-multi-select-combo-box-mixin.d.ts +0 -2
  8. package/src/vaadin-multi-select-combo-box-mixin.js +27 -11
  9. package/src/vaadin-multi-select-combo-box-overlay.js +12 -8
  10. package/src/vaadin-multi-select-combo-box-scroller.js +28 -23
  11. package/src/vaadin-multi-select-combo-box-styles.js +1 -0
  12. package/src/vaadin-multi-select-combo-box.d.ts +1 -3
  13. package/src/vaadin-multi-select-combo-box.js +75 -42
  14. package/web-types.json +1 -1
  15. package/web-types.lit.json +1 -1
  16. package/src/vaadin-lit-multi-select-combo-box-chip.js +0 -79
  17. package/src/vaadin-lit-multi-select-combo-box-container.js +0 -66
  18. package/src/vaadin-lit-multi-select-combo-box-internal.js +0 -56
  19. package/src/vaadin-lit-multi-select-combo-box-item.js +0 -50
  20. package/src/vaadin-lit-multi-select-combo-box-overlay.js +0 -64
  21. package/src/vaadin-lit-multi-select-combo-box-scroller.js +0 -96
  22. package/src/vaadin-lit-multi-select-combo-box.d.ts +0 -1
  23. package/src/vaadin-lit-multi-select-combo-box.js +0 -146
  24. package/theme/lumo/vaadin-lit-multi-select-combo-box.d.ts +0 -3
  25. package/theme/lumo/vaadin-lit-multi-select-combo-box.js +0 -3
  26. package/theme/material/vaadin-lit-multi-select-combo-box.d.ts +0 -3
  27. package/theme/material/vaadin-lit-multi-select-combo-box.js +0 -3
  28. package/theme/material/vaadin-multi-select-combo-box-chip-styles.d.ts +0 -8
  29. package/theme/material/vaadin-multi-select-combo-box-chip-styles.js +0 -102
  30. package/theme/material/vaadin-multi-select-combo-box-styles.d.ts +0 -9
  31. package/theme/material/vaadin-multi-select-combo-box-styles.js +0 -92
  32. package/theme/material/vaadin-multi-select-combo-box.d.ts +0 -8
  33. package/theme/material/vaadin-multi-select-combo-box.js +0 -8
  34. package/vaadin-lit-multi-select-combo-box.d.ts +0 -1
  35. package/vaadin-lit-multi-select-combo-box.js +0 -2
@@ -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 };
@@ -1,3 +0,0 @@
1
- import './vaadin-multi-select-combo-box-chip-styles.js';
2
- import './vaadin-multi-select-combo-box-styles.js';
3
- import '../../src/vaadin-lit-multi-select-combo-box.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-multi-select-combo-box-chip-styles.js';
2
- import './vaadin-multi-select-combo-box-styles.js';
3
- import '../../src/vaadin-lit-multi-select-combo-box.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-multi-select-combo-box-chip-styles.js';
2
- import './vaadin-multi-select-combo-box-styles.js';
3
- import '../../src/vaadin-lit-multi-select-combo-box.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-multi-select-combo-box-chip-styles.js';
2
- import './vaadin-multi-select-combo-box-styles.js';
3
- import '../../src/vaadin-lit-multi-select-combo-box.js';
@@ -1,8 +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/vaadin-material-styles/color.js';
7
- import '@vaadin/vaadin-material-styles/font-icons.js';
8
- import '@vaadin/vaadin-material-styles/typography.js';
@@ -1,102 +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/vaadin-material-styles/color.js';
7
- import '@vaadin/vaadin-material-styles/font-icons.js';
8
- import '@vaadin/vaadin-material-styles/typography.js';
9
- import { fieldButton } from '@vaadin/vaadin-material-styles/mixins/field-button.js';
10
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
-
12
- const chip = css`
13
- :host {
14
- height: 1.25rem;
15
- margin-inline-end: 0.25rem;
16
- border-radius: 4px;
17
- background-color: rgba(0, 0, 0, 0.08);
18
- cursor: default;
19
- font-family: var(--material-font-family);
20
- -webkit-font-smoothing: antialiased;
21
- -moz-osx-font-smoothing: grayscale;
22
- }
23
-
24
- :host([focused]) {
25
- background-color: rgba(0, 0, 0, 0.16);
26
- }
27
-
28
- :host([slot='overflow']) {
29
- position: relative;
30
- margin-inline-start: 0.5rem;
31
- }
32
-
33
- :host([slot='overflow'])::before,
34
- :host([slot='overflow'])::after {
35
- position: absolute;
36
- content: '';
37
- width: 100%;
38
- height: 100%;
39
- border-left: 0.125rem solid;
40
- border-radius: 0.25rem;
41
- border-color: rgba(0, 0, 0, 0.08);
42
- }
43
-
44
- :host([slot='overflow'])::before {
45
- left: -0.25rem;
46
- }
47
-
48
- :host([slot='overflow'])::after {
49
- left: -0.5rem;
50
- }
51
-
52
- :host([count='2']) {
53
- margin-inline-start: 0.25rem;
54
- }
55
-
56
- :host([count='2'])::after {
57
- display: none;
58
- }
59
-
60
- :host([count='1']) {
61
- margin-inline-start: 0;
62
- }
63
-
64
- :host([count='1'])::before,
65
- :host([count='1'])::after {
66
- display: none;
67
- }
68
-
69
- [part='label'] {
70
- font-size: var(--material-caption-font-size);
71
- line-height: 1;
72
- color: var(--material-body-text-color);
73
- }
74
-
75
- /* Override field button */
76
- [part='remove-button'] {
77
- display: flex;
78
- align-items: center;
79
- justify-content: center;
80
- box-sizing: border-box;
81
- width: 20px;
82
- height: 20px;
83
- margin-inline-start: auto;
84
- line-height: 20px;
85
- padding: 0;
86
- font-size: 0.75em;
87
- }
88
-
89
- [part='remove-button']::before {
90
- content: var(--material-icons-clear);
91
- }
92
-
93
- :host([disabled]) [part='label'] {
94
- color: var(--material-disabled-text-color);
95
- -webkit-text-fill-color: var(--material-disabled-text-color);
96
- pointer-events: none;
97
- }
98
- `;
99
-
100
- registerStyles('vaadin-multi-select-combo-box-chip', [fieldButton, chip], {
101
- moduleId: 'material-multi-select-combo-box-chip',
102
- });
@@ -1,9 +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/input-container/theme/material/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-material-styles/color.js';
8
- import '@vaadin/vaadin-material-styles/font-icons.js';
9
- import '@vaadin/vaadin-material-styles/typography.js';
@@ -1,92 +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/input-container/theme/material/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-material-styles/color.js';
8
- import '@vaadin/vaadin-material-styles/font-icons.js';
9
- import '@vaadin/vaadin-material-styles/typography.js';
10
- import { comboBoxItem } from '@vaadin/combo-box/theme/material/vaadin-combo-box-item-styles.js';
11
- import { comboBoxLoader, comboBoxOverlay } from '@vaadin/combo-box/theme/material/vaadin-combo-box-overlay-styles.js';
12
- import { item } from '@vaadin/item/theme/material/vaadin-item-styles.js';
13
- import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
14
- import { loader } from '@vaadin/vaadin-material-styles/mixins/loader.js';
15
- import { menuOverlay } from '@vaadin/vaadin-material-styles/mixins/menu-overlay.js';
16
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
17
-
18
- const multiSelectComboBoxItem = css`
19
- @media (any-hover: hover) {
20
- :host(:hover[readonly]) {
21
- background-color: transparent;
22
- cursor: default;
23
- }
24
- }
25
- `;
26
-
27
- registerStyles('vaadin-multi-select-combo-box-item', [item, comboBoxItem, multiSelectComboBoxItem], {
28
- moduleId: 'material-multi-select-combo-box-item',
29
- });
30
-
31
- registerStyles(
32
- 'vaadin-multi-select-combo-box-overlay',
33
- [
34
- menuOverlay,
35
- comboBoxOverlay,
36
- loader,
37
- comboBoxLoader,
38
- css`
39
- :host {
40
- --_vaadin-multi-select-combo-box-items-container-border-width: 8px 0;
41
- --_vaadin-multi-select-combo-box-items-container-border-style: solid;
42
- }
43
- `,
44
- ],
45
- { moduleId: 'material-multi-select-combo-box-overlay' },
46
- );
47
-
48
- const multiSelectComboBox = css`
49
- :host([has-value]) ::slotted(input:placeholder-shown) {
50
- caret-color: var(--material-body-text-color) !important;
51
- }
52
-
53
- /* Override input-container styles */
54
- ::slotted([slot='chip']),
55
- ::slotted([slot='overflow']) {
56
- padding: 0 0.5rem;
57
- }
58
-
59
- :host([auto-expand-vertically]) ::slotted([slot='chip']) {
60
- margin-top: 0.25rem;
61
- align-self: flex-start;
62
- }
63
-
64
- ::slotted([slot='chip']:not([readonly]):not([disabled])) {
65
- padding-inline-end: 0;
66
- }
67
-
68
- [part='input-field'] {
69
- height: auto;
70
- min-height: 32px;
71
- }
72
-
73
- [part='input-field'] ::slotted(input) {
74
- padding: 6px 0;
75
- }
76
-
77
- [part='toggle-button']::before {
78
- content: var(--material-icons-dropdown);
79
- }
80
-
81
- :host([opened]) [part='toggle-button'] {
82
- transform: rotate(180deg);
83
- }
84
-
85
- :host([readonly][has-value]) [part='toggle-button'] {
86
- color: var(--material-secondary-text-color);
87
- }
88
- `;
89
-
90
- registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectComboBox], {
91
- moduleId: 'material-multi-select-combo-box',
92
- });
@@ -1,8 +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-multi-select-combo-box-chip-styles.js';
7
- import './vaadin-multi-select-combo-box-styles.js';
8
- import '../../src/vaadin-multi-select-combo-box.js';
@@ -1,8 +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-multi-select-combo-box-chip-styles.js';
7
- import './vaadin-multi-select-combo-box-styles.js';
8
- import '../../src/vaadin-multi-select-combo-box.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-multi-select-combo-box.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-multi-select-combo-box.js';
2
- export * from './src/vaadin-lit-multi-select-combo-box.js';