2.45.0 • Published 2 months ago

@vonage/vwc-select v2.45.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

vwc-select

vwc-select is a drop-down kind of input element.

This component is an extension of \<mwc-select>.

Usage

Import the component in your context, to get it initialized:

import '@vonage/vwc-select/vwc-select.js';

//	or, to be able to use casting in TypeScript, do

import { VWCSelect } from '@vonage/vwc-select/vwc-select.js';

import '@vonage/vwc-list/vwc-list-item.js';

We suggest as a rule of thumb to use vwc-list-item component to provide the list of options. vwc-list-item is capable of holding any content, from simple text to rich HTML.

The following should provide you with a working example:

<vwc-select outlined label="VWC Select" helper="Helper text">
	<vwc-list-item></vwc-list-item>
	<vwc-list-item value="0">Item 0</vwc-list-item>
	<vwc-list-item value="1">Item 1</vwc-list-item>
</vwc-select>

Few points to pay attention to, in order to get the expected result:

  • Select will preselect the first item in the list (much like the native HTML select), so if one would like to start with empty value, stare the list with an empty item
  • Items MUST HAVE an attribute value with an actual values that you'd like to use in your applicative logic (except the empty choice); the text/content within the items is for labeling purposes only, should be considered as not logically reliable (think of localization down the road, or some rich HTML)

API

vwc-select exposes the following properties, methods and events:

Properties

PropertyModifiersTypeDescription
disabledboolean
helperstring
iconstring
indexreadonlynumber
itemsreadonlyListItemBase[]
labelstring
naturalMenuWidthboolean
outlinedboolean
requiredboolean
selectedreadonlyListItemBase \ | null
validateOnInitialRenderboolean
validationMessagestring
valuestring
appearanceghostno input border

Methods

MethodType
blur(): void
checkValidity(): boolean
click(): void
focus(): void
layout(updateItems?: boolean \| undefined): Promise<void>
reportValidity(): boolean
select(index: number): void
setAriaLabel(label: string): void
setCustomValidity(message: string): void

Events

EventDescription
action{ActionDetail}
change
closed
invalid
opened
selected{SelectedDetail}
2.45.0

2 months ago

2.44.0

8 months ago

2.43.0

10 months ago

2.43.2

9 months ago

2.43.1

10 months ago

2.41.0

11 months ago

2.42.0

11 months ago

2.38.0

1 year ago

2.37.2

1 year ago

2.40.0

1 year ago

2.39.1

1 year ago

2.39.0

1 year ago

2.37.0

1 year ago

2.36.3

1 year ago

2.36.2

1 year ago

2.36.0

2 years ago

2.36.1

2 years ago

2.35.0

2 years ago

2.34.0

2 years ago

2.34.1

2 years ago

2.33.1

2 years ago

2.33.0

2 years ago

2.32.0

2 years ago

2.31.0

2 years ago

2.30.2

2 years ago

2.30.1

2 years ago

2.30.3

2 years ago

2.30.0

2 years ago

2.29.0

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.2

2 years ago

2.27.1

2 years ago

2.27.0

2 years ago

2.26.0

2 years ago

2.25.10

2 years ago

2.25.9

2 years ago

2.25.8

2 years ago

2.25.7

2 years ago

2.25.6

2 years ago

2.25.5

2 years ago

2.25.3

2 years ago

2.25.2

2 years ago

2.25.1

2 years ago

2.25.0

2 years ago

2.24.1

2 years ago

2.24.0

2 years ago

2.23.0

2 years ago

2.22.1

2 years ago

2.22.0

3 years ago

2.21.1

3 years ago

2.21.0

3 years ago

2.20.1

3 years ago

2.20.0

3 years ago

2.19.0

3 years ago

2.18.1

3 years ago

2.18.0

3 years ago

2.17.0

3 years ago

2.16.1

3 years ago

2.16.0

3 years ago

2.15.0

3 years ago

2.14.0

3 years ago

2.13.0

3 years ago

2.12.0

3 years ago

2.11.0

3 years ago

2.10.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago

2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.19.1

3 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.17.2

3 years ago

0.17.1

3 years ago

0.17.0

3 years ago

0.16.2

3 years ago

0.16.1

3 years ago

0.16.0

3 years ago

0.15.3

3 years ago

0.15.2

3 years ago

0.15.1

3 years ago

0.15.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.5

4 years ago

0.12.4

4 years ago

0.12.3

4 years ago

0.12.2

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago