Repository navigation
Check before upgrading
These changes can affect an existing setup. Each one is described under Changed or Fixed.
- AM/PM is a
role="radiogroup"witharia-checked. Selectors or tests that use[aria-pressed]on.tp-ui-am/.tp-ui-pmneed updating - The timezone
comboboxrole,aria-expandedandaria-activedescendantmoved from.tp-ui-timezone-dropdownto.tp-ui-timezone-selected - In range mode, the header, timezone row and clock or wheel body sit in
.tp-ui-range-panel. CSS or JS that uses>child selectors under.tp-ui-wrapperneeds a descendant selector aria-valuetextreads "7 of 12" instead of "07", and the minute announcement reads "Minute" instead of "Minutes"switch:viewnow carries{ view }, andwheel/compact-wheelno longer show the view-switch icon- In range mode,
setValue()writesfrom - to,setOptions()keeps both ends, and a typed time is saved to its end before OK - Clear emits
select:hour,clear,update, without the extra 12:00update - Activating the To tab keeps focus on the tab, and Enter in a time field now applies the typed value
- The
darktheme uses Material Design 3 tokens, so its colors change
Added
- The range plugin works in
wheelandcompact-wheel. Tabs,setActivePart(),setRange(), OK and Clear all work there setView('clock' | 'keyboard')andgetView(). They work withoutui.viewSwitch. Inwheelandcompact-wheel,setView()returnsfalseandgetView()returnsnullclear()empties a closed or open picker without needingui.clearButton, and emitsclearandupdategetActivePart()returns'from','to'ornullsetRange({ from })orsetRange({ to })changes one end and keeps the other.nullor""clears an endsetRangeCaptions({ from, to })shows a caption on each range tab. A missing key keeps the caption, andnullremoves itrange:changeevent with{ part, from, to }andcallbacks.onRangeChange, with theRangeChangeEventDatatype. It fires when the user changes an end, not for API calls or when a wheel fills an empty end- With a range,
wheel.commitOnScrollwritesfrom - toand emitsrange:confirmwithautoCommit: true. The picker stays open parseTime(),formatTime()andcreateDisabledTimeCheck()from the main entry work without a picker. They are SSR-safe, with the typesTimeValue,TimeFormatOptionsandDisabledTimeCheckOptionstimepicker-ui/plugins/timezoneexportsgetTimezoneList(),DEFAULT_TIMEZONESand theTimezoneInfotype- A
timezone.defaultthat is not in the list still falls back to a listed zone, and now emitserrorwith the zone it used TimepickerEventNametype.on(),once()andoff()now type the handler payload for each event nameui.inline.showTitle: falsehides the inline title visually and keeps it as the card's accessible name. Defaulttruelabels.valueText(default"{value} of {count}") sets thearia-valuetextof the time fields and the dial- CSS tokens
--tp-embedded-bg,--tp-embedded-radiusand--tp-embedded-backdrop-filterstyle the embedded inline card - CSS tokens
--tp-size-input-mobile,--tp-size-input-height,--tp-time-input-font-size,--tp-size-colon-heightand--tp-time-colon-gapsize the keyboard view, and--tp-size-hand-circlesizes the clock hand circle - The types
TimepickerView,PluginTimeView,RangeTimeInputandRangeCaptionInputare exported
Changed
- AM/PM is a
role="radiogroup"named bylabels.period, withrole="radio"segments,aria-checkedand arrow-key selection.aria-pressedis gone - The timezone
comboboxrole,aria-expandedandaria-activedescendantare on.tp-ui-timezone-selected. Type-ahead and Tab selection follow the APG select-only combobox - Range tabs control one
.tp-ui-range-panel(role="tabpanel") that wraps the header, timezone row and clock or wheel body - Time fields and the dial read "7 of 12" in
aria-valuetext. Setlabels.valueText: '{value}'for the bare number - The minute announcement default is "Minute" instead of "Minutes"
switch:viewcarries{ view }(SwitchViewEventData), andcallbacks.onSwitchViewreceives it.wheelandcompact-wheelhave no view-switch iconsetOptions()orupdate()that changesui.initialViewon an open picker switches the view and emitsswitch:viewonce- In range mode,
setValue()sets the active end and writesfrom - to setOptions()on an open range picker keeps both ends and the active end. Useclear()orsetRange()to drop an unconfirmed range- A typed range time is saved on blur, Enter or before the ends switch, so
getRange()can report it before OK - Enter in a time field applies the typed value, the same as blur
- Activating the To tab keeps focus on the tab. Tab then moves into the panel
- Clear emits
select:hour,clear,update, with no extra 12:00update. In range mode the Clear button emitsrange:change, thenrange:switch - In 12h range mode, AM/PM on a complete From changes only the period. It moves to To only when it completes From
- In
wheelandcompact-wheel, an empty range end is seeded with the other end's time, elseclock.currentTime, else 12:00 - The
darktheme follows the Material Design 3 baseline dark tokens - The clock dial uses Pointer Events when available, and
.tp-ui-clock-facehastouch-action: none clock.disabledTimeerrors namerangesinstead of the deprecatedinterval, for exampleInvalid disabledTime.ranges: Invalid 12h format: "00:00 - 04:59"
Fixed
- The compact-wheel dialog had no accessible name. It now uses
labels.timeas itsaria-label - The clock face and wheel lay out correctly when the picker is shown after its container was hidden. The wheel also applies a time set while hidden
- Pressing Escape with the timezone menu open closes only the menu, not the picker
- The closed timezone menu no longer takes up layout, so a scroll container around the picker gets no extra scroll height
- In
wheelandcompact-wheel, the wheel area fits the wheel instead of the clock's 256 px. With--tp-wheel-visible-items, 3 rows make the picker shorter and 7 rows are no longer cut off - Embedded inline fields no longer have a
name, so they do not submit stray fields inside a<form>. The embedded wrapper hastabindex="-1"and is no longer a tab stop - Changing
clock.typeorclock.showSecondsnow converts a half range such as09:00 - --:-- - The plugin UMD builds work from a
<script>tag. The UMD core now exposesTimepickerUI.PluginRegistry, soTimepickerUI.PluginRegistry.register(TimepickerUIRange.RangePlugin)works. Before, enabling a plugin there emittederror - A focused read-only time field no longer shows a text caret, for example after the dial moves on to minutes. Editable fields keep it
- With
ui.editable, picking a time on the dial by touch no longer opens the on-screen keyboard when the dial moves on to the next field - A compact-wheel popover with too little room shrinks the wheel area instead of scrolling, so Cancel and OK stay in view. It stays aligned to the input
Full Changelog: 4.6.0...4.7.0