feat(DateTimePicker): новый компонент с двухшаговым попапом и пресетами#55
Open
IgorShevchik wants to merge 4 commits into
Open
feat(DateTimePicker): новый компонент с двухшаговым попапом и пресетами#55IgorShevchik wants to merge 4 commits into
IgorShevchik wants to merge 4 commits into
Conversation
- Adds B24DateTimePicker built on B24Popover, B24Calendar and B24Input - Two-step UX: calendar → hour/minute grid with configurable minute step - Side preset list with localized defaults (Today, Tomorrow, End of week, In a week, End of month) and full override via the `presets` prop - `dateOnly` mode forces value to CalendarDate with 00:00:00 - Works with @internationalized/date types via v-model (CalendarDateTime, ZonedDateTime, CalendarDate) - Adds theme, locale messages for all 19 locales, demo+nuxt playground pages, docs page with five examples and skill references update
…er-component-NqwmO
…er-component-NqwmO
… i18n, docs) - tests: add DateTimePicker.spec.ts (snapshots + minuteStep clamp + axe a11y) — 42 tests across nuxt + vue projects, both green - security/correctness: guard `minuteStep` against `NaN` (Number.isFinite check) - correctness: memoize resolved preset values into `resolvedPresets` so factory presets evaluate once per render instead of twice (was called by both `:active` and `:data-active`) - a11y: add `role="group"` + `aria-labelledby` on hour/minute grids and `aria-pressed` on each cell - i18n: fix "endOfWeek" mistranslations in de/fr/it/br/tr — they meant "weekend" instead of "end of work week (Friday)" - docs: drop misleading `B24Button` from intro composition, fix "Pick a time" → "Pick a date and time", add "With min/max dates" section and matching example, show `open` slot prop in custom trigger, add `name`/`required` to form-field example - skills: mention `DateTimePickerPreset` type for custom presets - theme: correct `@memo` comment (uses `B24Input`, not `B24InputDate`)
This was referenced May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
О чём PR
Новый компонент
B24DateTimePicker— пикер даты и времени в стиле Битрикс24: попап с двумя шагами (календарь → сетка часов/минут), боковая колонка пресетов, режим «только дата» (date-only, время фиксируется на00:00:00). Закрывает пробел между сегментированнымиB24InputDate/B24InputTimeи более «нативным» UX Битрикс24.Что сделано
src/runtime/components/DateTimePicker.vueповерх штатныхB24Popover,B24Calendarи read-onlyB24Input(триггер по умолчанию). Модель —CalendarDateTime/ZonedDateTime(илиCalendarDateвdate-only).src/theme/date-time-picker.ts— минимум стилей, только классы из дизайн-системы.dateTimePicker.*добавлен в типMessagesи заполнен во всех 19 локалях.endOfWeekдля DE/FR/IT/BR/TR заменён на корректный «конец недели» (было «выходные»).role="group"+aria-labelledbyна сетках часов/минут,aria-pressedна ячейках, уникальный id черезuseId().Number.isFinite-защита наminute-stepотNaN.test/components/DateTimePicker.spec.ts+ 2 снапшота: 21 кейс × (nuxt + vue) = 42 теста зелёные, axe-проверка a11y.docs/content/docs/2.components/date-time-picker.md+ 6 примеров (Basic,DateOnly,CustomPresets,CustomTrigger,FormField,MinMaxDates). Адаптивность: пресеты переезжают вниз на мобиле (flex-col-reverse sm:flex-row).date-time-picker.vueс матрицей вариантов + регистрация вuseNavigation.ts.b24-ui-nuxt— обновленыcomponents.md,component-selection.mdи блок «Date» вforms.md.theme/index.ts, запись вThemeDefaults.API
Ключевые пропсы:
modelValue,defaultValue,dateOnly,minuteStep(5),locale,placeholder,presets,hidePresets,format,color,size,disabled,icon,timeIcon,popover,calendar,input.Слоты:
default(триггер),presets,preset,time-header.Чек-лист на ручную проверку
pnpm dev→/components/date-time-picker: открывается попап, выбор даты переключает на шаг времени, клик по минуте закрывает попапDate only— второй шаг исчезает, значение становитсяCalendarDateminute-step={5|10|15|30}— корректное количество ячеек;NaN/0/9999не ломают рендер (есть тесты)presets(factory-функция) — примерDateTimePickerCustomPresetsExample, factory вызывается один раз на рендер#default(DateTimePickerCustomTriggerExample) —openотрабатывает; стандартныйB24Inputтриггерlocale="ru"/locale="en"— формат значения, дни недели, текст пресетов меняютсяcolor,size,disabled— пробежаться по Matrix в плейграундеhide-presets— боковая колонка пропадаетB24FormField(DateTimePickerFormFieldExample) —name/required/label/hintработают:calendar="{ minValue, maxValue }"(DateTimePickerMinMaxDatesExample) — рамки соблюдаютсяaria-pressedна ячейкеpnpm test— снапшоты соседних компонентов не сломалисьЧто дальше
Follow-up issues уже заведены (по результатам ревью):
as anyкасты вокруг @internationalized/date #56 — убратьas anyкасты вокруг@internationalized/date(затрагивает Calendar/InputDate)min/max/isDateDisabledv-modelнаdefineModel(пачкой по компонентам)После мержа PR ничего срочного делать не нужно — компонент изолированный, breaking changes в публичный API не вносит.
Готов к squash-merge. CI зелёный:
pnpm lint,pnpm typecheck,pnpm exec vitest test/components/DateTimePicker.spec.ts— все три прошли локально.🤖 Generated with Claude Code