@vaadin/select 25.3.0-alpha7 → 25.3.0-alpha9
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/custom-elements.json +137 -38
- package/package.json +16 -16
- package/src/vaadin-select-base-mixin.js +39 -66
- package/src/vaadin-select-item.js +1 -0
- package/src/vaadin-select-list-box.js +1 -0
- package/src/vaadin-select-overlay.js +4 -1
- package/src/vaadin-select-value-button.js +1 -0
- package/src/vaadin-select.js +1 -0
- package/web-types.json +27 -15
- package/web-types.lit.json +11 -4
package/custom-elements.json
CHANGED
|
@@ -56,6 +56,20 @@
|
|
|
56
56
|
"description": "",
|
|
57
57
|
"name": "SelectBaseMixin",
|
|
58
58
|
"members": [
|
|
59
|
+
{
|
|
60
|
+
"kind": "field",
|
|
61
|
+
"name": "accessibleDescriptionRef",
|
|
62
|
+
"privacy": "public",
|
|
63
|
+
"type": {
|
|
64
|
+
"text": "string"
|
|
65
|
+
},
|
|
66
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
67
|
+
"attribute": "accessible-description-ref",
|
|
68
|
+
"inheritedFrom": {
|
|
69
|
+
"name": "FieldMixin",
|
|
70
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
59
73
|
{
|
|
60
74
|
"kind": "field",
|
|
61
75
|
"name": "accessibleName",
|
|
@@ -63,7 +77,7 @@
|
|
|
63
77
|
"type": {
|
|
64
78
|
"text": "string"
|
|
65
79
|
},
|
|
66
|
-
"description": "String used to label the component
|
|
80
|
+
"description": "String used to label the component for screen reader users.",
|
|
67
81
|
"attribute": "accessible-name",
|
|
68
82
|
"inheritedFrom": {
|
|
69
83
|
"name": "FieldMixin",
|
|
@@ -77,7 +91,7 @@
|
|
|
77
91
|
"type": {
|
|
78
92
|
"text": "string"
|
|
79
93
|
},
|
|
80
|
-
"description": "
|
|
94
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
81
95
|
"attribute": "accessible-name-ref",
|
|
82
96
|
"inheritedFrom": {
|
|
83
97
|
"name": "FieldMixin",
|
|
@@ -331,12 +345,24 @@
|
|
|
331
345
|
}
|
|
332
346
|
],
|
|
333
347
|
"attributes": [
|
|
348
|
+
{
|
|
349
|
+
"name": "accessible-description-ref",
|
|
350
|
+
"type": {
|
|
351
|
+
"text": "string"
|
|
352
|
+
},
|
|
353
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
354
|
+
"fieldName": "accessibleDescriptionRef",
|
|
355
|
+
"inheritedFrom": {
|
|
356
|
+
"name": "FieldMixin",
|
|
357
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
334
360
|
{
|
|
335
361
|
"name": "accessible-name",
|
|
336
362
|
"type": {
|
|
337
363
|
"text": "string"
|
|
338
364
|
},
|
|
339
|
-
"description": "String used to label the component
|
|
365
|
+
"description": "String used to label the component for screen reader users.",
|
|
340
366
|
"fieldName": "accessibleName",
|
|
341
367
|
"inheritedFrom": {
|
|
342
368
|
"name": "FieldMixin",
|
|
@@ -348,7 +374,7 @@
|
|
|
348
374
|
"type": {
|
|
349
375
|
"text": "string"
|
|
350
376
|
},
|
|
351
|
-
"description": "
|
|
377
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
352
378
|
"fieldName": "accessibleNameRef",
|
|
353
379
|
"inheritedFrom": {
|
|
354
380
|
"name": "FieldMixin",
|
|
@@ -627,6 +653,13 @@
|
|
|
627
653
|
"name": "ItemMixin",
|
|
628
654
|
"package": "@vaadin/item/src/vaadin-item-mixin.js"
|
|
629
655
|
}
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"type": {
|
|
659
|
+
"text": "string"
|
|
660
|
+
},
|
|
661
|
+
"description": "The theme variants to apply to the component.",
|
|
662
|
+
"name": "theme"
|
|
630
663
|
}
|
|
631
664
|
],
|
|
632
665
|
"mixins": [
|
|
@@ -775,6 +808,13 @@
|
|
|
775
808
|
"name": "ListMixin",
|
|
776
809
|
"package": "@vaadin/a11y-base/src/list-mixin.js"
|
|
777
810
|
}
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
"type": {
|
|
814
|
+
"text": "string"
|
|
815
|
+
},
|
|
816
|
+
"description": "The theme variants to apply to the component.",
|
|
817
|
+
"name": "theme"
|
|
778
818
|
}
|
|
779
819
|
],
|
|
780
820
|
"mixins": [
|
|
@@ -828,6 +868,20 @@
|
|
|
828
868
|
"description": "",
|
|
829
869
|
"name": "SelectOverlayMixin",
|
|
830
870
|
"members": [
|
|
871
|
+
{
|
|
872
|
+
"kind": "field",
|
|
873
|
+
"name": "autofocus",
|
|
874
|
+
"privacy": "public",
|
|
875
|
+
"type": {
|
|
876
|
+
"text": "boolean"
|
|
877
|
+
},
|
|
878
|
+
"description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
879
|
+
"attribute": "autofocus",
|
|
880
|
+
"inheritedFrom": {
|
|
881
|
+
"name": "OverlayFocusMixin",
|
|
882
|
+
"package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
|
|
883
|
+
}
|
|
884
|
+
},
|
|
831
885
|
{
|
|
832
886
|
"kind": "method",
|
|
833
887
|
"name": "bringToFront",
|
|
@@ -860,7 +914,7 @@
|
|
|
860
914
|
"type": {
|
|
861
915
|
"text": "boolean"
|
|
862
916
|
},
|
|
863
|
-
"description": "
|
|
917
|
+
"description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
864
918
|
"attribute": "focus-trap",
|
|
865
919
|
"inheritedFrom": {
|
|
866
920
|
"name": "OverlayFocusMixin",
|
|
@@ -1131,12 +1185,24 @@
|
|
|
1131
1185
|
}
|
|
1132
1186
|
],
|
|
1133
1187
|
"attributes": [
|
|
1188
|
+
{
|
|
1189
|
+
"name": "autofocus",
|
|
1190
|
+
"type": {
|
|
1191
|
+
"text": "boolean"
|
|
1192
|
+
},
|
|
1193
|
+
"description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
1194
|
+
"fieldName": "autofocus",
|
|
1195
|
+
"inheritedFrom": {
|
|
1196
|
+
"name": "OverlayFocusMixin",
|
|
1197
|
+
"package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1134
1200
|
{
|
|
1135
1201
|
"name": "focus-trap",
|
|
1136
1202
|
"type": {
|
|
1137
1203
|
"text": "boolean"
|
|
1138
1204
|
},
|
|
1139
|
-
"description": "
|
|
1205
|
+
"description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
1140
1206
|
"fieldName": "focusTrap",
|
|
1141
1207
|
"inheritedFrom": {
|
|
1142
1208
|
"name": "OverlayFocusMixin",
|
|
@@ -1344,6 +1410,20 @@
|
|
|
1344
1410
|
"description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).\n- [`<vaadin-select-list-box>`](#/elements/vaadin-select-list-box) - a list-box element.\n- [`<vaadin-select-item>`](#/elements/vaadin-select-item) - an item element.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
1345
1411
|
"name": "Select",
|
|
1346
1412
|
"members": [
|
|
1413
|
+
{
|
|
1414
|
+
"kind": "field",
|
|
1415
|
+
"name": "accessibleDescriptionRef",
|
|
1416
|
+
"privacy": "public",
|
|
1417
|
+
"type": {
|
|
1418
|
+
"text": "string"
|
|
1419
|
+
},
|
|
1420
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
1421
|
+
"attribute": "accessible-description-ref",
|
|
1422
|
+
"inheritedFrom": {
|
|
1423
|
+
"name": "FieldMixin",
|
|
1424
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1347
1427
|
{
|
|
1348
1428
|
"kind": "field",
|
|
1349
1429
|
"name": "accessibleName",
|
|
@@ -1351,7 +1431,7 @@
|
|
|
1351
1431
|
"type": {
|
|
1352
1432
|
"text": "string"
|
|
1353
1433
|
},
|
|
1354
|
-
"description": "String used to label the component
|
|
1434
|
+
"description": "String used to label the component for screen reader users.",
|
|
1355
1435
|
"attribute": "accessible-name",
|
|
1356
1436
|
"inheritedFrom": {
|
|
1357
1437
|
"name": "FieldMixin",
|
|
@@ -1365,7 +1445,7 @@
|
|
|
1365
1445
|
"type": {
|
|
1366
1446
|
"text": "string"
|
|
1367
1447
|
},
|
|
1368
|
-
"description": "
|
|
1448
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
1369
1449
|
"attribute": "accessible-name-ref",
|
|
1370
1450
|
"inheritedFrom": {
|
|
1371
1451
|
"name": "FieldMixin",
|
|
@@ -1681,41 +1761,25 @@
|
|
|
1681
1761
|
"name": "value-changed"
|
|
1682
1762
|
}
|
|
1683
1763
|
],
|
|
1684
|
-
"
|
|
1685
|
-
{
|
|
1686
|
-
"name": "SelectBaseMixin",
|
|
1687
|
-
"module": "src/vaadin-select-base-mixin.js"
|
|
1688
|
-
},
|
|
1689
|
-
{
|
|
1690
|
-
"name": "ElementMixin",
|
|
1691
|
-
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
1692
|
-
},
|
|
1693
|
-
{
|
|
1694
|
-
"name": "ThemableMixin",
|
|
1695
|
-
"package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
|
|
1696
|
-
},
|
|
1764
|
+
"attributes": [
|
|
1697
1765
|
{
|
|
1698
|
-
"name": "
|
|
1699
|
-
"
|
|
1766
|
+
"name": "accessible-description-ref",
|
|
1767
|
+
"type": {
|
|
1768
|
+
"text": "string"
|
|
1769
|
+
},
|
|
1770
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
1771
|
+
"fieldName": "accessibleDescriptionRef",
|
|
1772
|
+
"inheritedFrom": {
|
|
1773
|
+
"name": "FieldMixin",
|
|
1774
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
1775
|
+
}
|
|
1700
1776
|
},
|
|
1701
|
-
{
|
|
1702
|
-
"name": "LumoInjectionMixin",
|
|
1703
|
-
"package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
|
|
1704
|
-
}
|
|
1705
|
-
],
|
|
1706
|
-
"superclass": {
|
|
1707
|
-
"name": "LitElement",
|
|
1708
|
-
"package": "lit"
|
|
1709
|
-
},
|
|
1710
|
-
"tagName": "vaadin-select",
|
|
1711
|
-
"customElement": true,
|
|
1712
|
-
"attributes": [
|
|
1713
1777
|
{
|
|
1714
1778
|
"name": "accessible-name",
|
|
1715
1779
|
"type": {
|
|
1716
1780
|
"text": "string"
|
|
1717
1781
|
},
|
|
1718
|
-
"description": "String used to label the component
|
|
1782
|
+
"description": "String used to label the component for screen reader users.",
|
|
1719
1783
|
"fieldName": "accessibleName",
|
|
1720
1784
|
"inheritedFrom": {
|
|
1721
1785
|
"name": "FieldMixin",
|
|
@@ -1727,7 +1791,7 @@
|
|
|
1727
1791
|
"type": {
|
|
1728
1792
|
"text": "string"
|
|
1729
1793
|
},
|
|
1730
|
-
"description": "
|
|
1794
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
1731
1795
|
"fieldName": "accessibleNameRef",
|
|
1732
1796
|
"inheritedFrom": {
|
|
1733
1797
|
"name": "FieldMixin",
|
|
@@ -1903,6 +1967,13 @@
|
|
|
1903
1967
|
"package": "@vaadin/field-base/src/validate-mixin.js"
|
|
1904
1968
|
}
|
|
1905
1969
|
},
|
|
1970
|
+
{
|
|
1971
|
+
"type": {
|
|
1972
|
+
"text": "string"
|
|
1973
|
+
},
|
|
1974
|
+
"description": "The theme variants to apply to the component.",
|
|
1975
|
+
"name": "theme"
|
|
1976
|
+
},
|
|
1906
1977
|
{
|
|
1907
1978
|
"name": "value",
|
|
1908
1979
|
"type": {
|
|
@@ -1915,7 +1986,35 @@
|
|
|
1915
1986
|
"module": "src/vaadin-select-base-mixin.js"
|
|
1916
1987
|
}
|
|
1917
1988
|
}
|
|
1918
|
-
]
|
|
1989
|
+
],
|
|
1990
|
+
"mixins": [
|
|
1991
|
+
{
|
|
1992
|
+
"name": "SelectBaseMixin",
|
|
1993
|
+
"module": "src/vaadin-select-base-mixin.js"
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
"name": "ElementMixin",
|
|
1997
|
+
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
"name": "ThemableMixin",
|
|
2001
|
+
"package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
"name": "PolylitMixin",
|
|
2005
|
+
"package": "@vaadin/component-base/src/polylit-mixin.js"
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
"name": "LumoInjectionMixin",
|
|
2009
|
+
"package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
|
|
2010
|
+
}
|
|
2011
|
+
],
|
|
2012
|
+
"superclass": {
|
|
2013
|
+
"name": "LitElement",
|
|
2014
|
+
"package": "lit"
|
|
2015
|
+
},
|
|
2016
|
+
"tagName": "vaadin-select",
|
|
2017
|
+
"customElement": true
|
|
1919
2018
|
}
|
|
1920
2019
|
],
|
|
1921
2020
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,24 +37,24 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
41
|
-
"@vaadin/button": "25.3.0-
|
|
42
|
-
"@vaadin/component-base": "25.3.0-
|
|
43
|
-
"@vaadin/field-base": "25.3.0-
|
|
44
|
-
"@vaadin/input-container": "25.3.0-
|
|
45
|
-
"@vaadin/item": "25.3.0-
|
|
46
|
-
"@vaadin/list-box": "25.3.0-
|
|
47
|
-
"@vaadin/lit-renderer": "25.3.0-
|
|
48
|
-
"@vaadin/overlay": "25.3.0-
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
40
|
+
"@vaadin/a11y-base": "25.3.0-alpha9",
|
|
41
|
+
"@vaadin/button": "25.3.0-alpha9",
|
|
42
|
+
"@vaadin/component-base": "25.3.0-alpha9",
|
|
43
|
+
"@vaadin/field-base": "25.3.0-alpha9",
|
|
44
|
+
"@vaadin/input-container": "25.3.0-alpha9",
|
|
45
|
+
"@vaadin/item": "25.3.0-alpha9",
|
|
46
|
+
"@vaadin/list-box": "25.3.0-alpha9",
|
|
47
|
+
"@vaadin/lit-renderer": "25.3.0-alpha9",
|
|
48
|
+
"@vaadin/overlay": "25.3.0-alpha9",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha9",
|
|
50
50
|
"lit": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@vaadin/aura": "25.3.0-
|
|
54
|
-
"@vaadin/chai-plugins": "25.3.0-
|
|
55
|
-
"@vaadin/test-runner-commands": "25.3.0-
|
|
53
|
+
"@vaadin/aura": "25.3.0-alpha9",
|
|
54
|
+
"@vaadin/chai-plugins": "25.3.0-alpha9",
|
|
55
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha9",
|
|
56
56
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
57
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
57
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha9",
|
|
58
58
|
"sinon": "^22.0.0"
|
|
59
59
|
},
|
|
60
60
|
"customElements": "custom-elements.json",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"web-types.json",
|
|
63
63
|
"web-types.lit.json"
|
|
64
64
|
],
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "cb915ebde095ec5b94a87af93dd4530f51984c52"
|
|
66
66
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { setAriaIDReference } from '@vaadin/a11y-base/src/aria-id-reference.js';
|
|
7
6
|
import { DelegateFocusMixin } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
|
|
8
7
|
import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
9
8
|
import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
9
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
10
10
|
import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
|
|
11
11
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
12
12
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
@@ -232,6 +232,15 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
232
232
|
this.__lastMenuElement = null;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
+
|
|
236
|
+
if (props.has('accessibleName')) {
|
|
237
|
+
this._srLabelController.setLabel(this.accessibleName);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Validate when the required constraint is removed.
|
|
241
|
+
if (props.has('required') && this.required === false) {
|
|
242
|
+
this._requestValidation();
|
|
243
|
+
}
|
|
235
244
|
}
|
|
236
245
|
|
|
237
246
|
/**
|
|
@@ -250,21 +259,6 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
250
259
|
this._overlayElement.requestContentUpdate();
|
|
251
260
|
}
|
|
252
261
|
|
|
253
|
-
/**
|
|
254
|
-
* Override an observer from `FieldMixin`
|
|
255
|
-
* to validate when required is removed.
|
|
256
|
-
*
|
|
257
|
-
* @protected
|
|
258
|
-
* @override
|
|
259
|
-
*/
|
|
260
|
-
_requiredChanged(required) {
|
|
261
|
-
super._requiredChanged(required);
|
|
262
|
-
|
|
263
|
-
if (required === false) {
|
|
264
|
-
this._requestValidation();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
262
|
/**
|
|
269
263
|
* Detects a `<vaadin-select-list-box>` slotted directly into the overlay
|
|
270
264
|
* slot (instead of the default one rendered into slotted `div` element).
|
|
@@ -473,11 +467,7 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
473
467
|
/** @private */
|
|
474
468
|
_updateAriaLive(ariaLive) {
|
|
475
469
|
if (this.focusElement) {
|
|
476
|
-
|
|
477
|
-
this.focusElement.setAttribute('aria-live', 'polite');
|
|
478
|
-
} else {
|
|
479
|
-
this.focusElement.removeAttribute('aria-live');
|
|
480
|
-
}
|
|
470
|
+
setOrRemoveAttribute(this.focusElement, 'aria-live', ariaLive && 'polite');
|
|
481
471
|
}
|
|
482
472
|
}
|
|
483
473
|
|
|
@@ -538,44 +528,6 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
538
528
|
itemElement.setAttribute('id', this._itemId);
|
|
539
529
|
}
|
|
540
530
|
|
|
541
|
-
/**
|
|
542
|
-
* @param {string} accessibleName
|
|
543
|
-
* @protected
|
|
544
|
-
*/
|
|
545
|
-
_accessibleNameChanged(accessibleName) {
|
|
546
|
-
this._srLabelController.setLabel(accessibleName);
|
|
547
|
-
this._setCustomAriaLabelledBy(accessibleName ? this._srLabelController.defaultId : null);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* @param {string} accessibleNameRef
|
|
552
|
-
* @protected
|
|
553
|
-
*/
|
|
554
|
-
_accessibleNameRefChanged(accessibleNameRef) {
|
|
555
|
-
this._setCustomAriaLabelledBy(accessibleNameRef);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* @param {string} ariaLabelledby
|
|
560
|
-
* @private
|
|
561
|
-
*/
|
|
562
|
-
_setCustomAriaLabelledBy(ariaLabelledby) {
|
|
563
|
-
const labelId = this._getLabelIdWithItemId(ariaLabelledby);
|
|
564
|
-
this._fieldAriaController.setLabelId(labelId, true);
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* @param {string | null} labelId
|
|
569
|
-
* @returns string | null
|
|
570
|
-
* @private
|
|
571
|
-
*/
|
|
572
|
-
_getLabelIdWithItemId(labelId) {
|
|
573
|
-
const selected = this._items ? this._items[this._menuElement.selected] : false;
|
|
574
|
-
const itemId = selected || this.placeholder ? this._itemId : '';
|
|
575
|
-
|
|
576
|
-
return labelId ? `${labelId} ${itemId}`.trim() : null;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
531
|
/** @private */
|
|
580
532
|
__updateValueButton() {
|
|
581
533
|
const valueButton = this.focusElement;
|
|
@@ -607,13 +559,7 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
607
559
|
delete this._selectedChanging;
|
|
608
560
|
}
|
|
609
561
|
|
|
610
|
-
|
|
611
|
-
selected || this.placeholder ? { newId: this._itemId } : { oldId: this._itemId };
|
|
612
|
-
|
|
613
|
-
setAriaIDReference(valueButton, 'aria-labelledby', labelledIdReferenceConfig);
|
|
614
|
-
if (this.accessibleName || this.accessibleNameRef) {
|
|
615
|
-
this._setCustomAriaLabelledBy(this.accessibleNameRef || this._srLabelController.defaultId);
|
|
616
|
-
}
|
|
562
|
+
this.__updateFieldAriaControllerLabelledBy();
|
|
617
563
|
}
|
|
618
564
|
|
|
619
565
|
/** @private */
|
|
@@ -709,4 +655,31 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
709
655
|
this.dispatchEvent(new CustomEvent('change', { bubbles: true }));
|
|
710
656
|
this.__dispatchChangePending = false;
|
|
711
657
|
}
|
|
658
|
+
|
|
659
|
+
/** @override */
|
|
660
|
+
__updateFieldAriaControllerLabel() {
|
|
661
|
+
// NO-OP
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** @override */
|
|
665
|
+
__updateFieldAriaControllerLabelledBy() {
|
|
666
|
+
let labelId;
|
|
667
|
+
if (this.accessibleNameRef) {
|
|
668
|
+
labelId = this.accessibleNameRef;
|
|
669
|
+
} else if (this.accessibleName) {
|
|
670
|
+
labelId = this._srLabelController.defaultId;
|
|
671
|
+
} else if (this.hasAttribute('has-label')) {
|
|
672
|
+
labelId = this._labelNode?.id;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
const selectedItem = this._items?.[this._menuElement.selected];
|
|
676
|
+
const itemId = selectedItem || this.placeholder ? this._itemId : null;
|
|
677
|
+
|
|
678
|
+
const ids = [labelId, itemId].filter(Boolean);
|
|
679
|
+
if (ids.length > 0) {
|
|
680
|
+
this._fieldAriaController.setLabelledBy(ids.join(' '));
|
|
681
|
+
} else {
|
|
682
|
+
this._fieldAriaController.setLabelledBy(null);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
712
685
|
};
|
|
@@ -48,6 +48,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
48
48
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
49
49
|
*
|
|
50
50
|
* @prop {string} label - String that can be set to visually represent the selected item in `vaadin-select`.
|
|
51
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
51
52
|
* @customElement vaadin-select-item
|
|
52
53
|
* @extends HTMLElement
|
|
53
54
|
*/
|
|
@@ -34,6 +34,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
34
34
|
*
|
|
35
35
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
36
36
|
*
|
|
37
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
37
38
|
* @customElement vaadin-select-list-box
|
|
38
39
|
* @extends HTMLElement
|
|
39
40
|
*/
|
|
@@ -15,11 +15,12 @@ import { SelectOverlayMixin } from './vaadin-select-overlay-mixin.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* An element used internally by `<vaadin-select>`. Not intended to be used separately.
|
|
17
17
|
*
|
|
18
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
18
19
|
* @customElement vaadin-select-overlay
|
|
19
20
|
* @extends HTMLElement
|
|
20
21
|
* @private
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
class SelectOverlay extends SelectOverlayMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
23
24
|
static get is() {
|
|
24
25
|
return 'vaadin-select-overlay';
|
|
25
26
|
}
|
|
@@ -51,3 +52,5 @@ export class SelectOverlay extends SelectOverlayMixin(ThemableMixin(PolylitMixin
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
defineCustomElement(SelectOverlay);
|
|
55
|
+
|
|
56
|
+
export { SelectOverlay };
|
|
@@ -14,6 +14,7 @@ import { valueButton } from './styles/vaadin-select-value-button-base-styles.js'
|
|
|
14
14
|
/**
|
|
15
15
|
* An element used internally by `<vaadin-select>`. Not intended to be used separately.
|
|
16
16
|
*
|
|
17
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
17
18
|
* @customElement vaadin-select-value-button
|
|
18
19
|
* @extends HTMLElement
|
|
19
20
|
* @protected
|
package/src/vaadin-select.js
CHANGED
|
@@ -150,6 +150,7 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
|
|
|
150
150
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
151
151
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
152
152
|
*
|
|
153
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
153
154
|
* @customElement vaadin-select
|
|
154
155
|
* @extends HTMLElement
|
|
155
156
|
*/
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/select",
|
|
4
|
-
"version": "25.3.0-
|
|
4
|
+
"version": "25.3.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -33,9 +33,7 @@
|
|
|
33
33
|
"description": "The theme variants to apply to the component.",
|
|
34
34
|
"value": {
|
|
35
35
|
"type": [
|
|
36
|
-
"string"
|
|
37
|
-
"null",
|
|
38
|
-
"undefined"
|
|
36
|
+
"string"
|
|
39
37
|
]
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -109,9 +107,7 @@
|
|
|
109
107
|
"description": "The theme variants to apply to the component.",
|
|
110
108
|
"value": {
|
|
111
109
|
"type": [
|
|
112
|
-
"string"
|
|
113
|
-
"null",
|
|
114
|
-
"undefined"
|
|
110
|
+
"string"
|
|
115
111
|
]
|
|
116
112
|
}
|
|
117
113
|
}
|
|
@@ -142,11 +138,20 @@
|
|
|
142
138
|
},
|
|
143
139
|
{
|
|
144
140
|
"name": "vaadin-select",
|
|
145
|
-
"description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
141
|
+
"description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-button).\n- [`<vaadin-select-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-select-list-box) - a list-box element.\n- [`<vaadin-select-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-select-item) - an item element.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
146
142
|
"attributes": [
|
|
143
|
+
{
|
|
144
|
+
"name": "accessible-description-ref",
|
|
145
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
146
|
+
"value": {
|
|
147
|
+
"type": [
|
|
148
|
+
"string"
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
147
152
|
{
|
|
148
153
|
"name": "accessible-name",
|
|
149
|
-
"description": "String used to label the component
|
|
154
|
+
"description": "String used to label the component for screen reader users.",
|
|
150
155
|
"value": {
|
|
151
156
|
"type": [
|
|
152
157
|
"string"
|
|
@@ -155,7 +160,7 @@
|
|
|
155
160
|
},
|
|
156
161
|
{
|
|
157
162
|
"name": "accessible-name-ref",
|
|
158
|
-
"description": "
|
|
163
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
159
164
|
"value": {
|
|
160
165
|
"type": [
|
|
161
166
|
"string"
|
|
@@ -284,9 +289,7 @@
|
|
|
284
289
|
"description": "The theme variants to apply to the component.",
|
|
285
290
|
"value": {
|
|
286
291
|
"type": [
|
|
287
|
-
"string"
|
|
288
|
-
"null",
|
|
289
|
-
"undefined"
|
|
292
|
+
"string"
|
|
290
293
|
]
|
|
291
294
|
}
|
|
292
295
|
},
|
|
@@ -302,9 +305,18 @@
|
|
|
302
305
|
],
|
|
303
306
|
"js": {
|
|
304
307
|
"properties": [
|
|
308
|
+
{
|
|
309
|
+
"name": "accessibleDescriptionRef",
|
|
310
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
311
|
+
"value": {
|
|
312
|
+
"type": [
|
|
313
|
+
"string"
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
},
|
|
305
317
|
{
|
|
306
318
|
"name": "accessibleName",
|
|
307
|
-
"description": "String used to label the component
|
|
319
|
+
"description": "String used to label the component for screen reader users.",
|
|
308
320
|
"value": {
|
|
309
321
|
"type": [
|
|
310
322
|
"string"
|
|
@@ -313,7 +325,7 @@
|
|
|
313
325
|
},
|
|
314
326
|
{
|
|
315
327
|
"name": "accessibleNameRef",
|
|
316
|
-
"description": "
|
|
328
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
317
329
|
"value": {
|
|
318
330
|
"type": [
|
|
319
331
|
"string"
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/select",
|
|
4
|
-
"version": "25.3.0-
|
|
4
|
+
"version": "25.3.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -72,19 +72,26 @@
|
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"name": "vaadin-select",
|
|
75
|
-
"description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
75
|
+
"description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-button).\n- [`<vaadin-select-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-select-list-box) - a list-box element.\n- [`<vaadin-select-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha9/#/elements/vaadin-select-item) - an item element.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
76
76
|
"extension": true,
|
|
77
77
|
"attributes": [
|
|
78
|
+
{
|
|
79
|
+
"name": ".accessibleDescriptionRef",
|
|
80
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
81
|
+
"value": {
|
|
82
|
+
"kind": "expression"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
78
85
|
{
|
|
79
86
|
"name": ".accessibleName",
|
|
80
|
-
"description": "String used to label the component
|
|
87
|
+
"description": "String used to label the component for screen reader users.",
|
|
81
88
|
"value": {
|
|
82
89
|
"kind": "expression"
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
{
|
|
86
93
|
"name": ".accessibleNameRef",
|
|
87
|
-
"description": "
|
|
94
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
88
95
|
"value": {
|
|
89
96
|
"kind": "expression"
|
|
90
97
|
}
|