input-duration-element
v0.0.4
Published
<input-duration> imitates <input type=duration>.
Downloads
4
Readme
<input-duration>
A Custom Element for <input type="duration">
.
References:
- Browser support
- https://caniuse.com/?search=attachInternals
- 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
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