Repository navigation
Commit b968dee
* refactor(DateField): shared segment field surfaces and navigation
Rename the internal segment composable to useDateFieldSegment; it now
commits through setModelValue(value, reason, event). Add segmentField.ts
with the segment and root part surfaces, the segment navigation, the
locale watcher and the change bridge that the six date and time
families share. Part of #2723.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(DateField)!: useDateField composable with change details
DateFieldRoot and DateFieldInput become thin shells over useDateField().
modelValue and placeholder go through useControllableState: a
cancellable beforeUpdate:* fires before update:*(value, details), with a
DateFieldChangeReason (segment-input, segment-increment,
segment-decrement, segment-clear, step-snap). A cancelled typed change
puts the segments back. null is a controlled empty field, and an
unchanged value emits nothing.
BREAKING CHANGE: update:modelValue and update:placeholder receive a
details argument. The root context's modelValue and placeholder are
writable computeds that report imperative-action; setModelValue and
setPlaceholder are new. The time zone segment renders data-readonly=""
instead of "true".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(TimeField)!: useTimeField composable with change details
TimeFieldRoot and TimeFieldInput become thin shells over useTimeField(),
with the same model contract as DateField and a TimeFieldChangeReason.
New isTimeUnavailable prop, which receives the time as a date-time and
marks the field invalid.
BREAKING CHANGE: update:modelValue and update:placeholder receive a
details argument. update:placeholder emits a Time when the placeholder
is a Time (it emitted a CalendarDateTime).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(DateRangeField)!: useDateRangeField composable with change details
DateRangeFieldRoot and DateRangeFieldInput become thin shells over
useDateRangeField(). A typed change to either end commits the whole
range with a DateRangeFieldChangeReason. New stepSnapping prop, as on
DateField. The context reuses DateRange and gains setModelValue,
setRangeValue and setPlaceholder.
BREAKING CHANGE: update:modelValue and update:placeholder receive a
details argument. The modelValue slot prop is typed DateRange, empty as
{ start: undefined, end: undefined } (it was DateRange | null).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(TimeRangeField)!: useTimeRangeField composable with change details
TimeRangeFieldRoot and TimeRangeFieldInput become thin shells over
useTimeRangeField(), with a TimeRangeFieldChangeReason and a new
stepSnapping prop.
BREAKING CHANGE: update:modelValue and update:placeholder receive a
details argument. The modelValue slot prop is typed TimeRange (it was
TimeRange | undefined).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(RangeCalendar)!: update:startValue carries change details
update:startValue receives (date, details) with the press reason and
event. The start watcher keeps its own copy of the pending reason: the
[startValue, endValue] watcher runs first and reset it, so the start
and the placeholder that follows it reported imperative-action instead
of cell-press.
BREAKING CHANGE: update:startValue receives a details argument.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(DatePicker)!: useDatePicker composes the field, popover and calendar
useDatePicker() owns the value, placeholder, open (through usePopover)
and view models. DatePickerRoot provides the Popover context itself
instead of rendering PopoverRoot. The field and calendar are controlled
by the picker: their beforeUpdate:modelValue runs the picker's change,
so each change emits one beforeUpdate/update pair from the root with a
DatePickerChangeReason, and a cancel on the root undoes the typed
segments. getFieldProps() and getCalendarProps() compose useDateField()
and useCalendar() standalone. stepSnapping now reaches the field.
BREAKING CHANGE: update:modelValue and update:placeholder receive a
details argument. DatePickerRoot no longer renders a PopoverRoot
component. onDateChange and onPlaceholderChange on the context take an
optional reason and event and return a boolean.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(DateRangePicker)!: useDateRangePicker composes the field, popover and calendar
The range picker follows DatePicker: useDateRangePicker() owns the
range, placeholder, start value, open and view models, the root
provides the Popover context, and the field and range calendar are
bridged into one emit pair with a DateRangePickerChangeReason.
startValue is a model with beforeUpdate:startValue; cancelling it only
suppresses update:startValue. stepSnapping is new and reaches the field.
BREAKING CHANGE: update:modelValue, update:placeholder and
update:startValue receive a details argument. DateRangePickerRoot no
longer renders a PopoverRoot component.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(DateField): migration notes and API meta for the date and time fields
Add the six roots to the converted list and their reason unions to both
migration pages, a "Date and time fields" section to the guide and
section 17 to the agent page, and regenerate the API meta.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(DateField): a cancelled typed change keeps the typed segments
A cancelled commit rolled the segments back to the committed value on
the next tick. A year is typed one digit at a time and every digit
commits, so a "no past dates" guard cancelled 0002 and reset the field:
the user could never type a date. A cancel now rolls back only the
model, as v2 did when a parent ignored the update, and a range field
never touches the other end's segments. The segments still follow a
real model change, including a parent that transforms the value.
Applies to DateField, TimeField, DateRangeField and TimeRangeField.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(Calendar): null is a controlled empty value
useCalendar mapped a null modelValue to undefined, which made the
calendar uncontrolled, so a pick the parent ignored still showed as
selected. null now keeps it controlled and reads as undefined, as with
v2's useVModel.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(DatePicker): keep the calendar controlled while the picker is empty
Pass null to the calendar when the picker has no value, so a
controlled-empty picker's calendar is controlled too. Add
onBeforeUpdatePlaceholder to useDatePicker, and move the explanatory
comments out of the template roots of DatePickerField and
DatePickerCalendar so they no longer create dev-only fragments.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(DateRangePicker): compare startValue with the calendar's real anchor
The picker deduped startValue against the last value it had emitted, so
a change made by the field or while the popover was closed could
swallow a later press of that day. The picker now tracks the real
anchor (moved by every calendar report and by the range's start) and
emits every change the calendar reports. startValue events are typed
with RangeCalendarChangeReason, stepSnapping defaults to false, and
useDateRangePicker gains onBeforeUpdatePlaceholder. The template-root
comments move into the script.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(RangeCalendar): only a press that moves an end leaves a reason
select() set the pending reasons before its early returns, so a press
that changed nothing left cell-press behind for the next programmatic
change. The reasons are now cleared when the press moved neither end,
and the range watcher consumes them before its early return.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(DateField): cancel, calendar system and null notes for the date fields
Document that a cancelled typed change keeps the typed segments, that
the inherited ConfigProvider locale also picks the calendar system of
the emitted values (with the Gregorian opt-out and an agent ask step),
null on CalendarRoot and the picker's calendar, attribute order in
snapshots, and regenerate the DateRangePickerRoot meta.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(DateField): per-root reason unions and controlled-null context reads
List the matching change reason union for each date and time root in
the agent page's wrapper emit rule, and say what each root context
reads for a controlled null: undefined modelValue on the single roots,
undefined startValue and endValue on the range fields, and an empty
range on DateRangePickerRoot.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(DateField): scope locale calendar note to date roots and type-clean tests
The ConfigProvider calendar note now names only the date-valued roots;
TimeFieldRoot and TimeRangeFieldRoot default to a Time and keep the
calendar of any date-time placeholder they are given.
Tests pass weekStartsOn to useRangeCalendar and hold date models in
shallowRef, since ref unwrapping strips the private fields of the
@internationalized/date classes and fails vue-tsc on test files.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 96d432a commit b968dee
49 files changed
Lines changed: 4724 additions & 1714 deletions
File tree
- docs/content
- docs/guides
- meta
- packages/core/src
- Calendar
- DateField
- DatePicker
- DateRangeField
- DateRangePicker
- RangeCalendar
- TimeField
- TimeRangeField
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
519 | 521 | | |
520 | 522 | | |
521 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
141 | | - | |
| 151 | + | |
142 | 152 | | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | | - | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| |||
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
197 | | - | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | | - | |
210 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
231 | 236 | | |
232 | 237 | | |
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| |||
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
244 | | - | |
| 254 | + | |
245 | 255 | | |
246 | 256 | | |
247 | 257 | | |
| |||
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
254 | | - | |
| 264 | + | |
255 | 265 | | |
256 | 266 | | |
257 | 267 | | |
| |||
287 | 297 | | |
288 | 298 | | |
289 | 299 | | |
290 | | - | |
| 300 | + | |
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
| |||
307 | 317 | | |
308 | 318 | | |
309 | 319 | | |
| 320 | + | |
310 | 321 | | |
| 322 | + | |
311 | 323 | | |
312 | | - | |
| 324 | + | |
313 | 325 | | |
314 | | - | |
| 326 | + | |
315 | 327 | | |
316 | 328 | | |
317 | 329 | | |
0 commit comments