@vaadin/select 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.
- package/README.md +0 -29
- package/package.json +19 -20
- package/src/styles/vaadin-select-base-styles.js +38 -0
- package/{theme/material/vaadin-lit-select.d.ts → src/styles/vaadin-select-core-styles.d.ts} +3 -2
- package/src/{vaadin-select-core-styles.js → styles/vaadin-select-core-styles.js} +4 -0
- package/src/styles/vaadin-select-overlay-base-styles.js +21 -0
- package/src/{vaadin-select-overlay-core-styles.js → styles/vaadin-select-overlay-core-styles.js} +1 -1
- package/src/styles/vaadin-select-value-button-base-styles.js +30 -0
- package/src/vaadin-select-base-mixin.js +31 -29
- package/src/vaadin-select-item.js +30 -14
- package/src/vaadin-select-list-box.d.ts +1 -2
- package/src/vaadin-select-list-box.js +17 -14
- package/src/vaadin-select-overlay-mixin.js +31 -12
- package/src/vaadin-select-overlay.js +24 -12
- package/src/vaadin-select-value-button.js +12 -7
- package/src/vaadin-select.d.ts +14 -11
- package/src/vaadin-select.js +52 -73
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-select-item.js +0 -63
- package/src/vaadin-lit-select-list-box.js +0 -71
- package/src/vaadin-lit-select-overlay.js +0 -53
- package/src/vaadin-lit-select-value-button.js +0 -42
- package/src/vaadin-lit-select.js +0 -109
- package/theme/lumo/vaadin-lit-select.d.ts +0 -7
- package/theme/lumo/vaadin-lit-select.js +0 -7
- package/theme/material/vaadin-lit-select.js +0 -7
- package/theme/material/vaadin-select-styles.d.ts +0 -7
- package/theme/material/vaadin-select-styles.js +0 -77
- package/theme/material/vaadin-select.d.ts +0 -7
- package/theme/material/vaadin-select.js +0 -7
- package/vaadin-lit-select.d.ts +0 -1
- package/vaadin-lit-select.js +0 -2
- /package/src/{vaadin-select-core-styles.d.ts → styles/vaadin-select-base-styles.d.ts} +0 -0
- /package/src/{vaadin-select-value-button-core-styles.js → styles/vaadin-select-value-button-core-styles.js} +0 -0
package/src/vaadin-lit-select.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 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/src/vaadin-lit-input-container.js';
|
|
7
|
-
import './vaadin-lit-select-item.js';
|
|
8
|
-
import './vaadin-lit-select-list-box.js';
|
|
9
|
-
import './vaadin-lit-select-overlay.js';
|
|
10
|
-
import './vaadin-lit-select-value-button.js';
|
|
11
|
-
import { html, LitElement } from 'lit';
|
|
12
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
13
|
-
import { screenReaderOnly } from '@vaadin/a11y-base/src/styles/sr-only-styles.js';
|
|
14
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
15
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
16
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
17
|
-
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
18
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
19
|
-
import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
|
|
20
|
-
import { selectStyles } from './vaadin-select-core-styles.js';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* LitElement based version of `<vaadin-select>` web component.
|
|
24
|
-
*
|
|
25
|
-
* ## Disclaimer
|
|
26
|
-
*
|
|
27
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
28
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
29
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
30
|
-
*
|
|
31
|
-
* @extends HTMLElement
|
|
32
|
-
*/
|
|
33
|
-
class Select extends SelectBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
34
|
-
static get is() {
|
|
35
|
-
return 'vaadin-select';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static get styles() {
|
|
39
|
-
return [inputFieldShared, screenReaderOnly, selectStyles];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** @protected */
|
|
43
|
-
render() {
|
|
44
|
-
return html`
|
|
45
|
-
<div class="vaadin-select-container">
|
|
46
|
-
<div part="label" @click="${this._onClick}">
|
|
47
|
-
<slot name="label"></slot>
|
|
48
|
-
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<vaadin-input-container
|
|
52
|
-
part="input-field"
|
|
53
|
-
.readonly="${this.readonly}"
|
|
54
|
-
.disabled="${this.disabled}"
|
|
55
|
-
.invalid="${this.invalid}"
|
|
56
|
-
theme="${ifDefined(this._theme)}"
|
|
57
|
-
@click="${this._onClick}"
|
|
58
|
-
>
|
|
59
|
-
<slot name="prefix" slot="prefix"></slot>
|
|
60
|
-
<slot name="value"></slot>
|
|
61
|
-
<div part="toggle-button" slot="suffix" aria-hidden="true" @mousedown="${this._onToggleMouseDown}"></div>
|
|
62
|
-
</vaadin-input-container>
|
|
63
|
-
|
|
64
|
-
<div part="helper-text">
|
|
65
|
-
<slot name="helper"></slot>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div part="error-message">
|
|
69
|
-
<slot name="error-message"></slot>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<vaadin-select-overlay
|
|
74
|
-
id="overlay"
|
|
75
|
-
.owner="${this}"
|
|
76
|
-
.positionTarget="${this._inputContainer}"
|
|
77
|
-
.opened="${this.opened}"
|
|
78
|
-
.withBackdrop="${this._phone}"
|
|
79
|
-
.renderer="${this.renderer || this.__defaultRenderer}"
|
|
80
|
-
?phone="${this._phone}"
|
|
81
|
-
theme="${ifDefined(this._theme)}"
|
|
82
|
-
?no-vertical-overlap="${this.noVerticalOverlap}"
|
|
83
|
-
@opened-changed="${this._onOpenedChanged}"
|
|
84
|
-
@vaadin-overlay-open="${this._onOverlayOpen}"
|
|
85
|
-
></vaadin-select-overlay>
|
|
86
|
-
|
|
87
|
-
<slot name="tooltip"></slot>
|
|
88
|
-
<div class="sr-only">
|
|
89
|
-
<slot name="sr-label"></slot>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** @private */
|
|
95
|
-
_onOpenedChanged(event) {
|
|
96
|
-
this.opened = event.detail.value;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** @private */
|
|
100
|
-
_onOverlayOpen() {
|
|
101
|
-
if (this._menuElement) {
|
|
102
|
-
this._menuElement.focus();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
defineCustomElement(Select);
|
|
108
|
-
|
|
109
|
-
export { Select };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 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/font-icons.js';
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 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/font-icons.js';
|
|
8
|
-
import { item } from '@vaadin/item/theme/material/vaadin-item-styles.js';
|
|
9
|
-
import { listBox } from '@vaadin/list-box/theme/material/vaadin-list-box-styles.js';
|
|
10
|
-
import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
|
|
11
|
-
import { menuOverlay } from '@vaadin/vaadin-material-styles/mixins/menu-overlay.js';
|
|
12
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-select-item', item, { moduleId: 'material-select-item' });
|
|
15
|
-
|
|
16
|
-
registerStyles('vaadin-select-list-box', listBox, { moduleId: 'material-select-list-box' });
|
|
17
|
-
|
|
18
|
-
const select = css`
|
|
19
|
-
:host {
|
|
20
|
-
-webkit-tap-highlight-color: transparent;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* placeholder styles */
|
|
24
|
-
:host [part='input-field'] ::slotted([slot='value'][placeholder]) {
|
|
25
|
-
color: var(--material-disabled-text-color);
|
|
26
|
-
transition: opacity 0.175s 0.1s;
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
:host([has-label]:not([focused]):not([invalid]):not([theme='always-float-label']))
|
|
31
|
-
::slotted([slot='value'][placeholder]) {
|
|
32
|
-
opacity: 0;
|
|
33
|
-
/* Avoid a flash of the placeholder text on init */
|
|
34
|
-
transition: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host [part='input-field'] ::slotted([slot='value']) {
|
|
38
|
-
color: var(--material-body-text-color);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
[part='toggle-button']::before {
|
|
42
|
-
content: var(--material-icons-dropdown);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([opened]) [part='toggle-button'] {
|
|
46
|
-
transform: rotate(180deg);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([disabled]) {
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
registerStyles('vaadin-select', [inputFieldShared, select], { moduleId: 'material-select' });
|
|
55
|
-
|
|
56
|
-
registerStyles(
|
|
57
|
-
'vaadin-select-value-button',
|
|
58
|
-
css`
|
|
59
|
-
:host {
|
|
60
|
-
font: inherit;
|
|
61
|
-
letter-spacing: normal;
|
|
62
|
-
text-transform: none;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
::slotted(*) {
|
|
66
|
-
font: inherit;
|
|
67
|
-
padding: 4px 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
::slotted(*:hover) {
|
|
71
|
-
background-color: transparent;
|
|
72
|
-
}
|
|
73
|
-
`,
|
|
74
|
-
{ moduleId: 'material-select-value-button' },
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
registerStyles('vaadin-select-overlay', [menuOverlay], { moduleId: 'material-select-overlay' });
|
package/vaadin-lit-select.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-select.js';
|
package/vaadin-lit-select.js
DELETED
|
File without changes
|
|
File without changes
|