@vaadin/select 24.2.0-alpha3 → 24.2.0-alpha5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/select",
3
- "version": "24.2.0-alpha3",
3
+ "version": "24.2.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,6 +23,14 @@
23
23
  "lit.d.ts",
24
24
  "lit.js",
25
25
  "src",
26
+ "!src/vaadin-lit-select-item.d.ts",
27
+ "!src/vaadin-lit-select-item.js",
28
+ "!src/vaadin-lit-select-list-box.d.ts",
29
+ "!src/vaadin-lit-select-list-box.js",
30
+ "!src/vaadin-lit-select-overlay.js",
31
+ "!src/vaadin-lit-select-value-button.js",
32
+ "!src/vaadin-lit-select.d.ts",
33
+ "!src/vaadin-lit-select.js",
26
34
  "theme",
27
35
  "vaadin-*.d.ts",
28
36
  "vaadin-*.js",
@@ -37,23 +45,24 @@
37
45
  "polymer"
38
46
  ],
39
47
  "dependencies": {
48
+ "@open-wc/dedupe-mixin": "^1.3.0",
40
49
  "@polymer/polymer": "^3.2.0",
41
- "@vaadin/a11y-base": "24.2.0-alpha3",
42
- "@vaadin/button": "24.2.0-alpha3",
43
- "@vaadin/component-base": "24.2.0-alpha3",
44
- "@vaadin/field-base": "24.2.0-alpha3",
45
- "@vaadin/input-container": "24.2.0-alpha3",
46
- "@vaadin/item": "24.2.0-alpha3",
47
- "@vaadin/list-box": "24.2.0-alpha3",
48
- "@vaadin/lit-renderer": "24.2.0-alpha3",
49
- "@vaadin/overlay": "24.2.0-alpha3",
50
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha3",
51
- "@vaadin/vaadin-material-styles": "24.2.0-alpha3",
52
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha3"
50
+ "@vaadin/a11y-base": "24.2.0-alpha5",
51
+ "@vaadin/button": "24.2.0-alpha5",
52
+ "@vaadin/component-base": "24.2.0-alpha5",
53
+ "@vaadin/field-base": "24.2.0-alpha5",
54
+ "@vaadin/input-container": "24.2.0-alpha5",
55
+ "@vaadin/item": "24.2.0-alpha5",
56
+ "@vaadin/list-box": "24.2.0-alpha5",
57
+ "@vaadin/lit-renderer": "24.2.0-alpha5",
58
+ "@vaadin/overlay": "24.2.0-alpha5",
59
+ "@vaadin/vaadin-lumo-styles": "24.2.0-alpha5",
60
+ "@vaadin/vaadin-material-styles": "24.2.0-alpha5",
61
+ "@vaadin/vaadin-themable-mixin": "24.2.0-alpha5"
53
62
  },
54
63
  "devDependencies": {
55
64
  "@esm-bundle/chai": "^4.3.4",
56
- "@vaadin/testing-helpers": "^0.4.2",
65
+ "@vaadin/testing-helpers": "^0.4.3",
57
66
  "lit": "^2.0.0",
58
67
  "sinon": "^13.0.2"
59
68
  },
@@ -61,5 +70,5 @@
61
70
  "web-types.json",
62
71
  "web-types.lit.json"
63
72
  ],
64
- "gitHead": "e5d1e1ed2d01b56d5922e18a3fcb7cd306351954"
73
+ "gitHead": "73db22a5e8993e3ce48d1e6540d30eff9cb5c257"
65
74
  }
@@ -3,12 +3,12 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import type { TemplateResult } from 'lit';
7
6
  import type { DirectiveResult } from 'lit/directive.js';
7
+ import type { LitRendererResult } from '@vaadin/lit-renderer';
8
8
  import { LitRendererDirective } from '@vaadin/lit-renderer';
9
9
  import type { Select } from '../vaadin-select.js';
10
10
 
11
- export type SelectLitRenderer = (select: Select) => TemplateResult;
11
+ export type SelectLitRenderer = (select: Select) => LitRendererResult;
12
12
 
13
13
  export class SelectRendererDirective extends LitRendererDirective<Select, SelectLitRenderer> {
14
14
  /**
@@ -0,0 +1,106 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
8
+ import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
9
+ import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
10
+ import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
+ import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
12
+ import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
13
+ import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
14
+ import type { SelectItem, SelectRenderer } from './vaadin-select.js';
15
+
16
+ export declare function SelectBaseMixin<T extends Constructor<HTMLElement>>(
17
+ base: T,
18
+ ): Constructor<DelegateFocusMixinClass> &
19
+ Constructor<DelegateStateMixinClass> &
20
+ Constructor<FieldMixinClass> &
21
+ Constructor<KeyboardMixinClass> &
22
+ Constructor<LabelMixinClass> &
23
+ Constructor<OverlayClassMixinClass> &
24
+ Constructor<SelectBaseMixinClass> &
25
+ Constructor<ValidateMixinClass> &
26
+ T;
27
+
28
+ export declare class SelectBaseMixinClass {
29
+ /**
30
+ * An array containing items that will be rendered as the options of the select.
31
+ *
32
+ * #### Example
33
+ * ```js
34
+ * select.items = [
35
+ * { label: 'Most recent first', value: 'recent' },
36
+ * { component: 'hr' },
37
+ * { label: 'Rating: low to high', value: 'rating-asc' },
38
+ * { label: 'Rating: high to low', value: 'rating-desc' },
39
+ * { component: 'hr' },
40
+ * { label: 'Price: low to high', value: 'price-asc', disabled: true },
41
+ * { label: 'Price: high to low', value: 'price-desc', disabled: true }
42
+ * ];
43
+ * ```
44
+ *
45
+ * Note: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.
46
+ * To render the item with a custom component, provide a tag name by the `component` property.
47
+ *
48
+ * @type {!Array<!SelectItem>}
49
+ */
50
+ items: SelectItem[] | null | undefined;
51
+
52
+ /**
53
+ * Set when the select is open
54
+ */
55
+ opened: boolean;
56
+
57
+ /**
58
+ * Custom function for rendering the content of the `<vaadin-select>`.
59
+ * Receives two arguments:
60
+ *
61
+ * - `root` The `<vaadin-select-overlay>` internal container
62
+ * DOM element. Append your content to it.
63
+ * - `select` The reference to the `<vaadin-select>` element.
64
+ */
65
+ renderer: SelectRenderer | undefined;
66
+
67
+ /**
68
+ * The `value` property of the selected item, or an empty string
69
+ * if no item is selected.
70
+ * On change or initialization, the component finds the item which matches the
71
+ * value and displays it.
72
+ * If no value is provided to the component, it selects the first item without
73
+ * value or empty value.
74
+ * Hint: If you do not want to select any item by default, you can either set all
75
+ * the values of inner vaadin-items, or set the vaadin-select value to
76
+ * an inexistent value in the items list.
77
+ */
78
+ value: string;
79
+
80
+ /**
81
+ * The name of this element.
82
+ */
83
+ name: string | null | undefined;
84
+
85
+ /**
86
+ * A hint to the user of what can be entered in the control.
87
+ * The placeholder will be displayed in the case that there
88
+ * is no item selected, or the selected item has an empty
89
+ * string label, or the selected item has no label and it's
90
+ * DOM content is empty.
91
+ */
92
+ placeholder: string | null | undefined;
93
+
94
+ /**
95
+ * When present, it specifies that the element is read-only.
96
+ */
97
+ readonly: boolean;
98
+
99
+ /**
100
+ * Requests an update for the content of the select.
101
+ * While performing the update, it invokes the renderer passed in the `renderer` property.
102
+ *
103
+ * It is not guaranteed that the update happens immediately (synchronously) after it is requested.
104
+ */
105
+ requestContentUpdate(): void;
106
+ }