Repository navigation
Overview
🚀 Features
- createCalendar: add a Gregorian month grid (#1116)
- createOverflow: measure() takes a width in pixels and returns the recorded width (#1147)
- createTimePicker: add a segmented time value (#1161)
- useDate: add a
calendaroption toV0DateAdapterfor non-Gregorian calendars (#1110) - useDate: default to a plain JavaScript Date (#1086)
- useDate: name the default date adapter
V0PlainDateAdapter(#1122) - Kanban: mark the card a pointer drop is anchored to (#1136)
- TimePicker: add hour, minute, and second spinbuttons (#1161)
🔧 Bug Fixes
- useLocale: format numbers on the server the way the client does (#1161)
Minor Changes
-
#1161
9fefa00Thanks @johnleider! - feat(createTimePicker): add a segmented time value (#1161)createTimePickerkeeps a time as separate hour, minute, and optional second fields. The value is a 24-hourHH:mmstring, orHH:mm:sswhensecondsis on, and it stays null until every enabled field has a value.hourCycle: 'h12'shows the hour as 1–12 with an AM/PM period while the stored hour stays 24-hour.hourStep,minuteStep, andsecondStepkeep each field on the multiples of its step.stepmoves a field by a signed number of intervals and wraps at either end,commitsets a field to the nearest multiple without wrapping, andgridreports the lowest value, highest value, and step a field can show. A complete value outsideminandmaxmoves to the nearest time inside them that is on every field's step, sominuteStep: 15withmin: '10:07'starts at10:15. When no such time lies between the bounds, the picker clamps the value to the bound itself.The picker normalizes the initial value at creation. It normalizes a string that reaches
valuelater before the next flush and writes it back in canonical form. A string that is not a valid time empties the fields and logs a warning in development. When the model's owner refuses a value the picker wrote, the fields take the model's value as given and the picker writes nothing more; the picker normalizes a value the owner substitutes and writes it back once.displayreports the time the fields show. Whiledisabledorreadonlyis on,commit,step, andcleardo nothing and the picker never writesvalue.required,rules,error, anderrorMessagesvalidate the value throughcreateInput, which the picker returns asinputwithvalidate,reset,errors,isValid,isPristine,isDirty, andisTouched. The picker registers with a parent form. A value the picker normalized is still pristine, andinput.reset()puts the initial value back and drops a partly entered time; whiledisabledorreadonlyit does not writevalue.revisiongoes up when the model holds a new settled value worth validating. An edit the owner took counts, and so does a value from outside. The picker's own normalizing counts only once the value already has a validity.input.reset()does not count unlesserrororerrorMessagesis set. Under an owner that accepts late, the picker's normalizing of the initial value comes back as a value from outside and counts. Watch it to validate on input.Call it inside a component
setupor aneffectScope; stopping the scope disposes the picker. -
#1110
4cda0bdThanks @johnleider! - feat(useDate): add acalendaroption toV0DateAdapterfor non-Gregorian calendarsnew V0DateAdapter('fa-IR', { calendar: 'persian' })reads, computes and formats dates in that calendar. ISO strings andDatevalues stay Gregorian.Until V8 implements calendar duration math, a calendar other than
iso8601is computed with@js-temporal/polyfill. Theiso8601path keeps the runtime's Temporal.Without the option, formatting is now always Gregorian. Locales whose Intl default is another calendar, such as
fa-IR, previously formatted month names and years in that calendar while date fields stayed Gregorian. -
#1136
1a4ad81Thanks @johnleider! - feat(Kanban): mark the card a pointer drop is anchored to (#1136)A pointer drag sets
data-targeton the column and list under the pointer, anddata-dropon the card the drop line is anchored to. Keyboard moves keep the same attributes. The board context exposespointerandaimfor that hover. -
#1147
d3e635aThanks @johnleider! - feat(createOverflow): measure() takes a width in pixels and returns the recorded widthmeasure(index, source)accepts a number as well as an element and returns the width it recorded, so an item that moves to another index can keep the width it had while visible. Breadcrumbs and Overflow do this now: removing a crumb or item no longer leaves its width behind or records a collapsed sibling as zero, so the ellipsis and the indicator match a fresh mount of the remaining items. -
#1086
39de444Thanks @johnleider! - feat(useDate): default to a plain JavaScript DatecreateDate()anduseDate()inside a component work without an adapter. PassV0DateAdapterwhen you want Temporal.useDate()outside a component still throws. -
#1116
9f7c351Thanks @johnleider! - feat(createCalendar): add a Gregorian month gridcreateCalendaris a Gregorian month grid with single and range selection.modemay be a ref, and changing it clears the selection. Days outsideminandmaxare disabled.disabledcan also name individual days with a list or a predicate. A day that is not a real calendar day is ignored. A month outside 1 through 12 is ignored. Paging stops at year 0000 and year 9999. A move past those years stops onminormaxwhen one is set. A spill day outsideYYYY-MM-DDstays disabled. An omitted month is today on the server as well as in the browser. When the grid owns its adapter, a locale ref also updates the week columns. -
#1161
9fefa00Thanks @johnleider! - feat(TimePicker): add hour, minute, and second spinbuttons (#1161)TimePickeredits a 24-hour time string throughTimePicker.Hour,TimePicker.Minute,TimePicker.Second, andTimePicker.Periodspinbuttons insideTimePicker.Root. The second field renders only withseconds, and the AM/PM field only withhour-cycle="h12". The model stays null until the hour, the minute, and, withseconds, the second all have a value.Arrow keys move a field one interval, PageUp and PageDown move the hour about 2 hours and the minute or second about 15, Home and End set its lowest and highest value, and Backspace or Delete clears it. The fields do not take typed digits.
hour-step,minute-step, andsecond-stepkeep each field on the multiples of its step,minandmaxkeep a complete time inside a window on those steps, anddisabledandreadonlyignore every key.Root and each field take
ariaLabelandariaLabelledby, and Root takesariaDescribedby; names default to the locale catalog. The digits a field shows follow the locale's numerals, while the model stays in Latin digits. Fields carrydata-state="empty"or"filled", and Root carriesdata-completewhile the fields show a complete time.required,rules,error,errorMessages, andvalidateOnvalidate the model, and the picker registers with a parentForm. Focus moving between the fields is not a blur, andvalidateOn="input"validates an edit or a value from outside. The picker normalizing a value on its own validates only once the picker has a validity, from a validation or fromerrororerrorMessages, and a reset does not unlesserrororerrorMessagesis set; when a parent accepts an update late, the picker reads its answer as a value from outside, which validates.TimePicker.DescriptionandTimePicker.Errorhold the help text and the messages; the fields point at them witharia-describedbyandaria-errormessageand carryaria-requiredandaria-invalid. Root carriesdata-state="pristine","valid", or"invalid", plusdata-dirtyanddata-focused, and its slot exposeserrors,isValid,isPristine,isFocused,validate, andreset.Set
nameto submit the displayed time with a form through aTimePicker.HiddenInputthat Root renders, andformto associate it with a form Root sits outside. -
#1122
70ba978Thanks @johnleider! - feat(useDate): name the default date adapterV0PlainDateAdapterPlainDateAdapterstill imports that class.constructor.nameisV0PlainDateAdapter.
Patch Changes
-
#1161
9fefa00Thanks @johnleider! - fix(useLocale): format numbers on the server the way the client doeslocale.n()returned the bare number during a server render and theIntl.NumberFormatresult in the browser, so a locale with its own digits or grouping, such asar-EG, rendered7on the server and٧on the client and failed hydration. It now formats for the selected locale in both places. Without a selected locale it still returns the bare number. A locale id that is not a language tagIntl.NumberFormataccepts, such asen_US, also returns the bare number, with a warning in development, instead of throwing.