Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/muan/input-duration-element

A Custom Element for <input type="duration">.
https://github.com/muan/input-duration-element

custom-elements input-type

Last synced: 2 months ago
JSON representation

A Custom Element for <input type="duration">.

Awesome Lists containing this project

README

        

# ``

A Custom Element for ``.

References:

- Browser support
- Stable: https://wpt.fyi/results/custom-elements/HTMLElement-attachInternals.html?label=master&label=stable&aligned&view=subtest
- Experimental: https://wpt.fyi/results/custom-elements/HTMLElement-attachInternals.html
- https://webkit.org/blog/13703/release-notes-for-safari-technology-preview-162/
- Web standards
- https://github.com/whatwg/html/issues/5488
- https://github.com/tc39/proposal-intl-duration-format

## Usage

```html

Duration

```

## Attributes

- `max` (`number`): Max value of duration in seconds.
- `name` (`string`): Input name.
- `value` (`number`): Default value of duration in seconds.

## Shadow Parts

- `::part(divider)`: Divider (`:`).

## Slots

- `hour`: Default to `:`.
- `minute`: Default to `:`.
- `second`: Default to empty.

## Methods

- `inputDuration.value = number` sets duration value to number in seconds.
- `inputDuration.value` gets duration value to number in seconds.

## Events

- `change` fires when duration value changes.

## Todo

- Support `min`
- Validation
- Figure out `maxLength`, `max`, `size`.