diff --git a/docs/components/button.md b/docs/components/button.md index 62bed800d..76fde234e 100644 --- a/docs/components/button.md +++ b/docs/components/button.md @@ -704,7 +704,7 @@ Token | Default value ## API -### MdElevatedButton <md-elevated-button> +### MdElevatedButton <md-elevated-button> #### Properties @@ -724,7 +724,7 @@ Property | Attribute | Type | Default | Description -### MdFilledButton <md-filled-button> +### MdFilledButton <md-filled-button> #### Properties @@ -744,7 +744,7 @@ Property | Attribute | Type | Default | Description -### MdFilledTonalButton <md-filled-tonal-button> +### MdFilledTonalButton <md-filled-tonal-button> #### Properties @@ -764,7 +764,7 @@ Property | Attribute | Type | Default | Description -### MdOutlinedButton <md-outlined-button> +### MdOutlinedButton <md-outlined-button> #### Properties @@ -784,7 +784,7 @@ Property | Attribute | Type | Default | Description -### MdTextButton <md-text-button> +### MdTextButton <md-text-button> #### Properties diff --git a/docs/components/checkbox.md b/docs/components/checkbox.md index def6c7983..0ed66e222 100644 --- a/docs/components/checkbox.md +++ b/docs/components/checkbox.md @@ -165,7 +165,7 @@ Token | Default value ## API -### MdCheckbox <md-checkbox> +### MdCheckbox <md-checkbox> #### Properties diff --git a/docs/components/chip.md b/docs/components/chip.md index f81137726..6f2dedc14 100644 --- a/docs/components/chip.md +++ b/docs/components/chip.md @@ -486,7 +486,7 @@ Token | Default value ## API -### MdChipSet <md-chip-set> +### MdChipSet <md-chip-set> #### Properties @@ -498,7 +498,7 @@ Property | Attribute | Type | Default | Description -### MdAssistChip <md-assist-chip> +### MdAssistChip <md-assist-chip> #### Properties @@ -515,7 +515,7 @@ Property | Attribute | Type | Default | Description -### MdFilterChip <md-filter-chip> +### MdFilterChip <md-filter-chip> #### Properties @@ -534,7 +534,7 @@ Property | Attribute | Type | Default | Description -### MdInputChip <md-input-chip> +### MdInputChip <md-input-chip> #### Properties @@ -555,7 +555,7 @@ Property | Attribute | Type | Default | Description -### MdSuggestionChip <md-suggestion-chip> +### MdSuggestionChip <md-suggestion-chip> #### Properties diff --git a/docs/components/dialog.md b/docs/components/dialog.md index f51e92c4e..136ef3a4f 100644 --- a/docs/components/dialog.md +++ b/docs/components/dialog.md @@ -244,7 +244,7 @@ Token | Default value ## API -### MdDialog <md-dialog> +### MdDialog <md-dialog> #### Properties diff --git a/docs/components/divider.md b/docs/components/divider.md index 439919d66..2cf5585ac 100644 --- a/docs/components/divider.md +++ b/docs/components/divider.md @@ -123,7 +123,7 @@ Token | Default value ## API -### MdDivider <md-divider> +### MdDivider <md-divider> #### Properties diff --git a/docs/components/fab.md b/docs/components/fab.md index b42b4101f..2be016107 100644 --- a/docs/components/fab.md +++ b/docs/components/fab.md @@ -479,7 +479,7 @@ Add with a different theme applied](images/fab/theming-branded.webp) ## API -### MdFab <md-fab> +### MdFab <md-fab> #### Properties @@ -494,17 +494,7 @@ Property | Attribute | Type | Default | Description -#### Methods - - - -Method | Parameters | Returns | Description ---- | --- | --- | --- -`getRenderClasses` | _None_ | `{ primary: boolean; secondary: boolean; tertiary: boolean; lowered: boolean; small: boolean; large: boolean; extended: boolean; }` | - - - -### MdBrandedFab <md-branded-fab> +### MdBrandedFab <md-branded-fab> #### Properties diff --git a/docs/components/focus-ring.md b/docs/components/focus-ring.md index 14afa85bd..baa0fc239 100644 --- a/docs/components/focus-ring.md +++ b/docs/components/focus-ring.md @@ -135,7 +135,7 @@ md-focus-ring { ## API -### MdFocusRing <md-focus-ring> +### MdFocusRing <md-focus-ring> #### Properties diff --git a/docs/components/icon-button.md b/docs/components/icon-button.md index d5dd8f2c4..8866a2ddc 100644 --- a/docs/components/icon-button.md +++ b/docs/components/icon-button.md @@ -430,7 +430,7 @@ Token | Default value ## API -### MdIconButton <md-icon-button> +### MdIconButton <md-icon-button> #### Properties @@ -453,7 +453,7 @@ Property | Attribute | Type | Default | Description -### MdFilledIconButton <md-filled-icon-button> +### MdFilledIconButton <md-filled-icon-button> #### Properties @@ -476,7 +476,7 @@ Property | Attribute | Type | Default | Description -### MdFilledTonalIconButton <md-filled-tonal-icon-button> +### MdFilledTonalIconButton <md-filled-tonal-icon-button> #### Properties @@ -499,7 +499,7 @@ Property | Attribute | Type | Default | Description -### MdOutlinedIconButton <md-outlined-icon-button> +### MdOutlinedIconButton <md-outlined-icon-button> #### Properties diff --git a/docs/components/list.md b/docs/components/list.md index 7706d097c..cd6881791 100644 --- a/docs/components/list.md +++ b/docs/components/list.md @@ -549,7 +549,7 @@ Token | Default value ## API -### MdList <md-list> +### MdList <md-list> #### Properties @@ -557,7 +557,7 @@ Token | Default value Property | Attribute | Type | Default | Description --- | --- | --- | --- | --- -`items` | | `ListItem[]` | `undefined` | An array of activatable and disableable list items. Queries every assigned element that has the `md-list-item` attribute.
_NOTE:_ This is a shallow, flattened query via `HTMLSlotElement.queryAssignedElements` and thus will _only_ include direct children / directly slotted elements. +`items` | | `ListItem[]` | `undefined` | @@ -572,7 +572,7 @@ Method | Parameters | Returns | Description -### MdListItem <md-list-item> +### MdListItem <md-list-item> #### Properties @@ -580,28 +580,20 @@ Method | Parameters | Returns | Description Property | Attribute | Type | Default | Description --- | --- | --- | --- | --- -`interactive` | `interactive` | `boolean` | `false` | Enables focusing the list item, and adds hover and click ripples when set to true. By default `interactive` is false. -`headline` | `headline` | `string` | `''` | The primary, headline text of the list item. -`supportingText` | `supporting-text` | `string` | `''` | The one-line supporting text below the headline. Set `multiLineSupportingText` to `true` to support multiple lines in the supporting text. -`multiLineSupportingText` | `multi-line-supporting-text` | `boolean` | `false` | Modifies `supportingText` to support multiple lines. -`trailingSupportingText` | `trailing-supporting-text` | `string` | `''` | The supporting text placed at the end of the item. Overridden by elements slotted into the `end` slot. `disabled` | `disabled` | `boolean` | `false` | Disables the item and makes it non-selectable and non-interactive. -`type` | `type` | `string` | `'listitem'` | Sets the role of the list item. Set to 'nothing' to clear the role. This property will be ignored if `href` is set since the underlying element will be a native anchor tag. +`type` | `type` | `string` | `'text'` | Sets the behavior of the list item, defaults to "text". Change to "link" or "button" for interactive items. `href` | `href` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. `target` | `target` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `target` attribute when `href` is set. -#### Methods +#### Events -Method | Parameters | Returns | Description ---- | --- | --- | --- -`getRenderClasses` | _None_ | `{ interactive: boolean; 'with-one-line': boolean; 'with-two-line': boolean; 'with-three-line': boolean; disabled: boolean; }` | -`renderRipple` | _None_ | `unique symbol \| TemplateResult` | -`renderFocusRing` | _None_ | `unique symbol \| TemplateResult` | -`onFocus` | _None_ | `void` | +Event | Description +--- | --- +`request-activation` | diff --git a/docs/components/menu.md b/docs/components/menu.md index 59b78d25f..d20f7d973 100644 --- a/docs/components/menu.md +++ b/docs/components/menu.md @@ -395,7 +395,8 @@ a sharp 0px border radius.](images/menu/theming.webp) ## API -### MdMenu <md-menu> + +### MdMenu <md-menu> #### Properties @@ -404,21 +405,20 @@ a sharp 0px border radius.](images/menu/theming.webp) Property | Attribute | Type | Default | Description --- | --- | --- | --- | --- `anchor` | `anchor` | `string` | `''` | The ID of the element in the same root node in which the menu should align to. Overrides setting `anchorElement = elementReference`.
__NOTE__: anchor or anchorElement must either be an HTMLElement or resolve to an HTMLElement in order for menu to open. -`fixed` | `fixed` | `boolean` | `false` | Makes the element use `position:fixed` instead of `position:absolute`. In most cases, the menu should position itself above most other `position:absolute` or `position:fixed` elements when placed inside of them. e.g. using a menu inside of an `md-dialog`.
__NOTE__: Fixed menus will not scroll with the page and will be fixed to the window instead. +`positioning` | `positioning` | `string` | `'absolute'` | Whether the positioning algorithim should calculate relative to the parent of the anchor element (absolute) or relative to the window (fixed).
Examples for `position = 'fixed'`:
- If there is no `position:relative` in the given parent tree and the surface is `position:absolute` - If the surface is `position:fixed` - If the surface is in the "top layer" - The anchor and the surface do not share a common `position:relative` ancestor
When using positioning = fixed, in most cases, the menu should position itself above most other `position:absolute` or `position:fixed` elements when placed inside of them. e.g. using a menu inside of an `md-dialog`.
__NOTE__: Fixed menus will not scroll with the page and will be fixed to the window instead. `quick` | `quick` | `boolean` | `false` | Skips the opening and closing animations. `hasOverflow` | `has-overflow` | `boolean` | `false` | Displays overflow content like a submenu.
__NOTE__: This may cause adverse effects if you set `md-menu {max-height:...}` and have items overflowing items in the "y" direction. `open` | `open` | `boolean` | `false` | Opens the menu and makes it visible. Alternative to the `.show()` and `.close()` methods `xOffset` | `x-offset` | `number` | `0` | Offsets the menu's inline alignment from the anchor by the given number in pixels. This value is direction aware and will follow the LTR / RTL direction.
e.g. LTR: positive -> right, negative -> left RTL: positive -> left, negative -> right `yOffset` | `y-offset` | `number` | `0` | Offsets the menu's block alignment from the anchor by the given number in pixels.
e.g. positive -> down, negative -> up -`listTabIndex` | `list-tabindex` | `number` | `-1` | The tabindex of the underlying list element. -`type` | `type` | `string` | `'menu'` | The role of the underlying list element. `typeaheadDelay` | `typeahead-delay` | `number` | `200` | The max time between the keystrokes of the typeahead menu behavior before it clears the typeahead buffer. `anchorCorner` | `anchor-corner` | `string` | `Corner.END_START` | The corner of the anchor which to align the menu in the standard logical property style of - e.g. `'end-start'`.
NOTE: This value may not be respected by the menu positioning algorithm if the menu would render outisde the viewport. `menuCorner` | `menu-corner` | `string` | `Corner.START_START` | The corner of the menu which to align the anchor in the standard logical property style of - e.g. `'start-start'`.
NOTE: This value may not be respected by the menu positioning algorithm if the menu would render outisde the viewport. `stayOpenOnOutsideClick` | `stay-open-on-outside-click` | `boolean` | `false` | Keeps the user clicks outside the menu.
NOTE: clicking outside may still cause focusout to close the menu so see `stayOpenOnFocusout`. `stayOpenOnFocusout` | `stay-open-on-focusout` | `boolean` | `false` | Keeps the menu open when focus leaves the menu's composed subtree.
NOTE: Focusout behavior will stop propagation of the focusout event. Set this property to true to opt-out of menu's focuout handling altogether. `skipRestoreFocus` | `skip-restore-focus` | `boolean` | `false` | After closing, does not restore focus to the last focused element before the menu was opened. -`defaultFocus` | `default-focus` | `string` | `FocusState.FIRST_ITEM` | The element that should be focused by default once opened.
NOTE: When setting default focus to 'LIST_ROOT', remember to change `list-tabindex` to `0` when necessary. +`defaultFocus` | `default-focus` | `string` | `FocusState.FIRST_ITEM` | The element that should be focused by default once opened.
NOTE: When setting default focus to 'LIST_ROOT', remember to change `tabindex` to `0` and change md-menu's display to something other than `display: contents` when necessary. +`isSubmenu` | | `boolean` | `false` | Whether or not the current menu is a submenu and should not handle specific navigation keys. `typeaheadController` | | `TypeaheadController` | `function { ... }` | Handles typeahead navigation through the menu. `anchorElement` | | `HTMLElement & Partial` | `undefined` | `items` | | `MenuItem[]` | `undefined` | @@ -451,7 +451,7 @@ Event | Description -### MdMenuItem <md-menu-item> +### MdMenuItem <md-menu-item> #### Properties @@ -459,15 +459,13 @@ Event | Description Property | Attribute | Type | Default | Description --- | --- | --- | --- | --- -`keepOpen` | `keep-open` | `boolean` | `false` | Keeps the menu open if clicked or keyboard selected. -`headline` | `headline` | `string` | `''` | The primary, headline text of the list item. -`supportingText` | `supporting-text` | `string` | `''` | The one-line supporting text below the headline. Set `multiLineSupportingText` to `true` to support multiple lines in the supporting text. -`multiLineSupportingText` | `multi-line-supporting-text` | `boolean` | `false` | Modifies `supportingText` to support multiple lines. -`trailingSupportingText` | `trailing-supporting-text` | `string` | `''` | The supporting text placed at the end of the item. Overridden by elements slotted into the `end` slot. `disabled` | `disabled` | `boolean` | `false` | Disables the item and makes it non-selectable and non-interactive. -`type` | `type` | `string` | `'listitem'` | Sets the role of the list item. Set to 'nothing' to clear the role. This property will be ignored if `href` is set since the underlying element will be a native anchor tag. +`type` | `type` | `string` | `'menuitem'` | Sets the behavior and role of the menu item, defaults to "menuitem". `href` | `href` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. `target` | `target` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `target` attribute when `href` is set. +`keepOpen` | `keep-open` | `boolean` | `false` | Keeps the menu open if clicked or keyboard selected. +`selected` | `selected` | `boolean` | `false` | Sets the item in the selected visual state when a submenu is opened. +`typeaheadText` | | `string` | `undefined` | @@ -481,7 +479,7 @@ Event | Description -### MdSubMenuItem <md-sub-menu-item> +### MdSubMenu <md-sub-menu> #### Properties @@ -493,16 +491,9 @@ Property | Attribute | Type | Default | Description `menuCorner` | `menu-corner` | `string` | `Corner.START_START` | The menuCorner to set on the submenu. `hoverOpenDelay` | `hover-open-delay` | `number` | `400` | The delay between mouseenter and submenu opening. `hoverCloseDelay` | `hover-close-delay` | `number` | `400` | The delay between ponterleave and the submenu closing. -`selected` | `selected` | `boolean` | `false` | Sets the item in the selected visual state when a submenu is opened. -`keepOpen` | `keep-open` | `boolean` | `false` | Keeps the menu open if clicked or keyboard selected. -`headline` | `headline` | `string` | `''` | The primary, headline text of the list item. -`supportingText` | `supporting-text` | `string` | `''` | The one-line supporting text below the headline. Set `multiLineSupportingText` to `true` to support multiple lines in the supporting text. -`multiLineSupportingText` | `multi-line-supporting-text` | `boolean` | `false` | Modifies `supportingText` to support multiple lines. -`trailingSupportingText` | `trailing-supporting-text` | `string` | `''` | The supporting text placed at the end of the item. Overridden by elements slotted into the `end` slot. -`disabled` | `disabled` | `boolean` | `false` | Disables the item and makes it non-selectable and non-interactive. -`type` | `type` | `string` | `'listitem'` | Sets the role of the list item. Set to 'nothing' to clear the role. This property will be ignored if `href` is set since the underlying element will be a native anchor tag. -`href` | `href` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. -`target` | `target` | `string` | `''` | Sets the underlying `HTMLAnchorElement`'s `target` attribute when `href` is set. +`isSubMenu` | `md-sub-menu` | `boolean` | `true` | READONLY: self-identifies as a menu item and sets its identifying attribute +`item` | | `MenuItem` | `undefined` | +`menu` | | `Menu` | `undefined` | @@ -512,8 +503,8 @@ Property | Attribute | Type | Default | Description Method | Parameters | Returns | Description --- | --- | --- | --- -`show` | `onOpened` | `void` | Shows the submenu. -`close` | `onClosed` | `void` | Closes the submenu. +`show` | _None_ | `Promise` | Shows the submenu. +`close` | _None_ | `Promise` | Closes the submenu. @@ -524,10 +515,9 @@ Method | Parameters | Returns | Description Event | Description --- | --- `deactivate-items` | Requests the parent menu to deselect other items when a submenu opens -`request-activation` | Requests the parent make the element focusable and focuses the item. +`request-activation` | Requests the parent make the slotted item focusable and focuses the item. `deactivate-typeahead` | Requests the parent menu to deactivate the typeahead functionality when a submenu opens `activate-typeahead` | Requests the parent menu to activate the typeahead functionality when a submenu closes -`close-menu` | diff --git a/docs/components/progress.md b/docs/components/progress.md index 8b4cdff08..a14c56f10 100644 --- a/docs/components/progress.md +++ b/docs/components/progress.md @@ -380,7 +380,7 @@ Token | Default value ## API -### MdLinearProgress <md-linear-progress> +### MdLinearProgress <md-linear-progress> #### Properties @@ -396,7 +396,7 @@ Property | Attribute | Type | Default | Description -### MdCircularProgress <md-circular-progress> +### MdCircularProgress <md-circular-progress> #### Properties diff --git a/docs/components/radio.md b/docs/components/radio.md index 067367eff..395abc809 100644 --- a/docs/components/radio.md +++ b/docs/components/radio.md @@ -211,7 +211,7 @@ Token | Default value ## API -### MdRadio <md-radio> +### MdRadio <md-radio> #### Properties diff --git a/docs/components/ripple.md b/docs/components/ripple.md index 90fd58dca..9bc7527af 100644 --- a/docs/components/ripple.md +++ b/docs/components/ripple.md @@ -266,7 +266,7 @@ Token | Default value ## API -### MdRipple <md-ripple> +### MdRipple <md-ripple> #### Properties diff --git a/docs/components/select.md b/docs/components/select.md index 3af479c21..b9cf481ab 100644 --- a/docs/components/select.md +++ b/docs/components/select.md @@ -207,4 +207,163 @@ md-outlined-select::part(menu) { ``` + +## API + + +### MdFilledSelect <md-filled-select> + +#### Properties + + + +Property | Attribute | Type | Default | Description +--- | --- | --- | --- | --- +`quick` | `quick` | `boolean` | `false` | Opens the menu synchronously with no animation. +`required` | `required` | `boolean` | `false` | Whether or not the select is required. +`disabled` | `disabled` | `boolean` | `false` | Disables the select. +`errorText` | `error-text` | `string` | `''` | The error message that replaces supporting text when `error` is true. If `errorText` is an empty string, then the supporting text will continue to show.
This error message overrides the error message displayed by `reportValidity()`. +`label` | `label` | `string` | `''` | The floating label for the field. +`supportingText` | `supporting-text` | `string` | `''` | Conveys additional information below the select, such as how it should be used. +`error` | `error` | `boolean` | `false` | Gets or sets whether or not the select is in a visually invalid state.
This error state overrides the error state controlled by `reportValidity()`. +`menuPositioning` | `menu-positioning` | `string` | `'absolute'` | Whether or not the underlying md-menu should be position: fixed to display in a top-level manner, or position: absolute.
position:fixed is useful for cases where select is inside of another element with stacking context and hidden overflows such as `md-dialog`. +`typeaheadDelay` | `typeahead-delay` | `number` | `DEFAULT_TYPEAHEAD_BUFFER_TIME` | The max time between the keystrokes of the typeahead select / menu behavior before it clears the typeahead buffer. +`hasLeadingIcon` | `has-leading-icon` | `boolean` | `false` | Whether or not the text field has a leading icon. Used for SSR. +`displayText` | `display-text` | `string` | `''` | Text to display in the field. Only set for SSR. +`value` | `value` | `string` | `undefined` | +`selectedIndex` | `selected-index` | `number` | `undefined` | +`options` | | `SelectOption[]` | `undefined` | +`selectedOptions` | | `SelectOption[]` | `undefined` | +`name` | | `string` | `undefined` | +`form` | | `HTMLFormElement` | `undefined` | +`labels` | | `NodeList` | `undefined` | +`validity` | | `ValidityState` | `undefined` | +`validationMessage` | | `string` | `undefined` | +`willValidate` | | `boolean` | `undefined` | + + + +#### Methods + + + +Method | Parameters | Returns | Description +--- | --- | --- | --- +`select` | `value` | `void` | Selects an option given the value of the option, and updates MdSelect's value. +`selectIndex` | `index` | `void` | Selects an option given the index of the option, and updates MdSelect's value. +`reset` | _None_ | `void` | Reset the select to its default value. +`checkValidity` | _None_ | `boolean` | Checks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the `invalid` event.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/checkValidity +`reportValidity` | _None_ | `boolean` | Checks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the `invalid` event.
This method will display or clear an error text message equal to the select's `validationMessage`, unless the invalid event is canceled.
Use `setCustomValidity()` to customize the `validationMessage`.
This method can also be used to re-announce error messages to screen readers. +`setCustomValidity` | `error` | `void` | Sets the select's native validation error message. This is used to customize `validationMessage`.
When the error is not an empty string, the select is considered invalid and `validity.customError` will be true.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/setCustomValidity +`getUpdateComplete` | _None_ | `Promise` | + + + +#### Events + + + +Event | Description +--- | --- +`input` | Fired when a selection is made by the user via mouse or keyboard interaction. +`change` | Fired when a selection is made by the user via mouse or keyboard interaction. +`opening` | Fired when the select's menu is about to open. +`opened` | Fired when the select's menu has finished animations and opened. +`closing` | Fired when the select's menu is about to close. +`closed` | Fired when the select's menu has finished animations and closed. + + + +### MdOutlinedSelect <md-outlined-select> + +#### Properties + + + +Property | Attribute | Type | Default | Description +--- | --- | --- | --- | --- +`quick` | `quick` | `boolean` | `false` | Opens the menu synchronously with no animation. +`required` | `required` | `boolean` | `false` | Whether or not the select is required. +`disabled` | `disabled` | `boolean` | `false` | Disables the select. +`errorText` | `error-text` | `string` | `''` | The error message that replaces supporting text when `error` is true. If `errorText` is an empty string, then the supporting text will continue to show.
This error message overrides the error message displayed by `reportValidity()`. +`label` | `label` | `string` | `''` | The floating label for the field. +`supportingText` | `supporting-text` | `string` | `''` | Conveys additional information below the select, such as how it should be used. +`error` | `error` | `boolean` | `false` | Gets or sets whether or not the select is in a visually invalid state.
This error state overrides the error state controlled by `reportValidity()`. +`menuPositioning` | `menu-positioning` | `string` | `'absolute'` | Whether or not the underlying md-menu should be position: fixed to display in a top-level manner, or position: absolute.
position:fixed is useful for cases where select is inside of another element with stacking context and hidden overflows such as `md-dialog`. +`typeaheadDelay` | `typeahead-delay` | `number` | `DEFAULT_TYPEAHEAD_BUFFER_TIME` | The max time between the keystrokes of the typeahead select / menu behavior before it clears the typeahead buffer. +`hasLeadingIcon` | `has-leading-icon` | `boolean` | `false` | Whether or not the text field has a leading icon. Used for SSR. +`displayText` | `display-text` | `string` | `''` | Text to display in the field. Only set for SSR. +`value` | `value` | `string` | `undefined` | +`selectedIndex` | `selected-index` | `number` | `undefined` | +`options` | | `SelectOption[]` | `undefined` | +`selectedOptions` | | `SelectOption[]` | `undefined` | +`name` | | `string` | `undefined` | +`form` | | `HTMLFormElement` | `undefined` | +`labels` | | `NodeList` | `undefined` | +`validity` | | `ValidityState` | `undefined` | +`validationMessage` | | `string` | `undefined` | +`willValidate` | | `boolean` | `undefined` | + + + +#### Methods + + + +Method | Parameters | Returns | Description +--- | --- | --- | --- +`select` | `value` | `void` | Selects an option given the value of the option, and updates MdSelect's value. +`selectIndex` | `index` | `void` | Selects an option given the index of the option, and updates MdSelect's value. +`reset` | _None_ | `void` | Reset the select to its default value. +`checkValidity` | _None_ | `boolean` | Checks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the `invalid` event.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/checkValidity +`reportValidity` | _None_ | `boolean` | Checks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the `invalid` event.
This method will display or clear an error text message equal to the select's `validationMessage`, unless the invalid event is canceled.
Use `setCustomValidity()` to customize the `validationMessage`.
This method can also be used to re-announce error messages to screen readers. +`setCustomValidity` | `error` | `void` | Sets the select's native validation error message. This is used to customize `validationMessage`.
When the error is not an empty string, the select is considered invalid and `validity.customError` will be true.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/setCustomValidity +`getUpdateComplete` | _None_ | `Promise` | + + + +#### Events + + + +Event | Description +--- | --- +`input` | Fired when a selection is made by the user via mouse or keyboard interaction. +`change` | Fired when a selection is made by the user via mouse or keyboard interaction. +`opening` | Fired when the select's menu is about to open. +`opened` | Fired when the select's menu has finished animations and opened. +`closing` | Fired when the select's menu is about to close. +`closed` | Fired when the select's menu has finished animations and closed. + + + +### MdSelectOption <md-select-option> + +#### Properties + + + +Property | Attribute | Type | Default | Description +--- | --- | --- | --- | --- +`disabled` | `disabled` | `boolean` | `false` | Disables the item and makes it non-selectable and non-interactive. +`selected` | `selected` | `boolean` | `false` | Sets the item in the selected visual state when a submenu is opened. +`value` | `value` | `string` | `''` | Form value of the option. +`type` | | `string` | `'option' as const` | +`typeaheadText` | | `string` | `undefined` | +`displayText` | | `string` | `undefined` | + + + +#### Events + + + +Event | Description +--- | --- +`close-menu` | Closes the encapsulating menu on +`request-selection` | Requests the parent md-select to select this element (and deselect others if single-selection) when `selected` changed to `true`. +`request-deselection` | Requests the parent md-select to deselect this element when `selected` changed to `false`. + + + diff --git a/docs/components/slider.md b/docs/components/slider.md index 71c1ffe47..09b0d39c1 100644 --- a/docs/components/slider.md +++ b/docs/components/slider.md @@ -161,7 +161,7 @@ Token | Default value ## API -### MdSlider <md-slider> +### MdSlider <md-slider> #### Properties diff --git a/docs/components/switch.md b/docs/components/switch.md index 7674b918d..ab4164248 100644 --- a/docs/components/switch.md +++ b/docs/components/switch.md @@ -233,7 +233,7 @@ Token | Default value ## API -### MdSwitch <md-switch> +### MdSwitch <md-switch> #### Properties diff --git a/docs/components/tabs.md b/docs/components/tabs.md index 40bd930a5..3c57cbd3f 100644 --- a/docs/components/tabs.md +++ b/docs/components/tabs.md @@ -375,7 +375,7 @@ Token | Default value ## API -### MdTabs <md-tabs> +### MdTabs <md-tabs> #### Properties @@ -410,7 +410,7 @@ Event | Description -### MdPrimaryTab <md-primary-tab> +### MdPrimaryTab <md-primary-tab> #### Properties @@ -426,7 +426,7 @@ Property | Attribute | Type | Default | Description -### MdSecondaryTab <md-secondary-tab> +### MdSecondaryTab <md-secondary-tab> #### Properties diff --git a/docs/components/text-field.md b/docs/components/text-field.md index d91c67b40..d33c38baa 100644 --- a/docs/components/text-field.md +++ b/docs/components/text-field.md @@ -480,7 +480,7 @@ Token | Default value ## API -### MdFilledTextField <md-filled-text-field> +### MdFilledTextField <md-filled-text-field> #### Properties @@ -544,7 +544,7 @@ Method | Parameters | Returns | Description -### MdOutlinedTextField <md-outlined-text-field> +### MdOutlinedTextField <md-outlined-text-field> #### Properties