@cocoar/vue-ui 3.4.0-beta.8 → 4.0.0-beta.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compact-fonts.d.ts +1 -0
- package/dist/compact-fonts.d.ts.map +1 -0
- package/dist/compact-fonts.js +4 -0
- package/dist/components/_internal/keyboardInset.d.ts +9 -0
- package/dist/components/_internal/keyboardInset.d.ts.map +1 -0
- package/dist/components/_internal/pageScrollLock.d.ts +17 -0
- package/dist/components/_internal/pageScrollLock.d.ts.map +1 -0
- package/dist/components/_internal/useFocusTrap.d.ts +9 -0
- package/dist/components/_internal/useFocusTrap.d.ts.map +1 -0
- package/dist/components/_internal/useVisualViewport.d.ts +26 -0
- package/dist/components/_internal/useVisualViewport.d.ts.map +1 -0
- package/dist/components/badge/CoarBadge.vue.d.ts.map +1 -1
- package/dist/components/card/CoarCard.vue.d.ts.map +1 -1
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts +2 -2
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -1
- package/dist/components/date-time/_shared/use-plain-date-picker.d.ts +95 -0
- package/dist/components/date-time/_shared/use-plain-date-picker.d.ts.map +1 -0
- package/dist/components/date-time/_shared/use-plain-date-time-picker.d.ts +113 -0
- package/dist/components/date-time/_shared/use-plain-date-time-picker.d.ts.map +1 -0
- package/dist/components/date-time/_shared/use-zoned-date-time-picker.d.ts +132 -0
- package/dist/components/date-time/_shared/use-zoned-date-time-picker.d.ts.map +1 -0
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +23 -6
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-or-date-picker/CoarPlainDateTimeOrDatePicker.vue.d.ts +4 -0
- package/dist/components/date-time/plain-date-time-or-date-picker/CoarPlainDateTimeOrDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +23 -6
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/scrollable-calendar/CoarScrollableCalendar.vue.d.ts.map +1 -1
- package/dist/components/date-time/time-picker/CoarTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-or-date-picker/CoarZonedDateTimeOrDatePicker.vue.d.ts +4 -0
- package/dist/components/date-time/zoned-date-time-or-date-picker/CoarZonedDateTimeOrDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +23 -6
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePickerPanel.vue.d.ts.map +1 -1
- package/dist/components/dialog/CoarDialogFooter.vue.d.ts +20 -0
- package/dist/components/dialog/CoarDialogFooter.vue.d.ts.map +1 -0
- package/dist/components/dialog/CoarDialogShell.vue.d.ts +2 -0
- package/dist/components/dialog/CoarDialogShell.vue.d.ts.map +1 -1
- package/dist/components/dialog/CoarSheetShell.vue.d.ts +50 -0
- package/dist/components/dialog/CoarSheetShell.vue.d.ts.map +1 -0
- package/dist/components/dialog/dialog-types.d.ts +27 -0
- package/dist/components/dialog/dialog-types.d.ts.map +1 -1
- package/dist/components/dialog/dialogFooter.d.ts +21 -0
- package/dist/components/dialog/dialogFooter.d.ts.map +1 -0
- package/dist/components/dialog/index.d.ts +2 -1
- package/dist/components/dialog/index.d.ts.map +1 -1
- package/dist/components/dialog/useDialog.d.ts +6 -15
- package/dist/components/dialog/useDialog.d.ts.map +1 -1
- package/dist/components/dialog/useSheetDrag.d.ts +46 -0
- package/dist/components/dialog/useSheetDrag.d.ts.map +1 -0
- package/dist/components/form-field/CoarFormField.vue.d.ts +2 -2
- package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
- package/dist/components/form-field/constants.d.ts +6 -0
- package/dist/components/form-field/constants.d.ts.map +1 -1
- package/dist/components/icon/CoarIcon.vue.d.ts +3 -3
- package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
- package/dist/components/icon/core-icons.d.ts +2 -0
- package/dist/components/icon/core-icons.d.ts.map +1 -1
- package/dist/components/input-frame/CoarInputFrame.vue.d.ts +17 -6
- package/dist/components/input-frame/CoarInputFrame.vue.d.ts.map +1 -1
- package/dist/components/input-frame/CoarInputFrameButton.vue.d.ts.map +1 -1
- package/dist/components/input-frame/types.d.ts +9 -0
- package/dist/components/input-frame/types.d.ts.map +1 -0
- package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarContextMenu.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarSubExpand.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarSubFlyout.vue.d.ts.map +1 -1
- package/dist/components/menu/useContextMenu.d.ts +7 -20
- package/dist/components/menu/useContextMenu.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +16 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts +2 -2
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
- package/dist/components/overlay/CoarOverlayOutlet.vue.d.ts.map +1 -1
- package/dist/components/overlay/compact-context.d.ts +10 -0
- package/dist/components/overlay/compact-context.d.ts.map +1 -0
- package/dist/components/overlay/index.d.ts +3 -1
- package/dist/components/overlay/index.d.ts.map +1 -1
- package/dist/components/overlay/overlay-presets.d.ts +9 -0
- package/dist/components/overlay/overlay-presets.d.ts.map +1 -1
- package/dist/components/overlay/overlay-service.d.ts +12 -0
- package/dist/components/overlay/overlay-service.d.ts.map +1 -1
- package/dist/components/overlay/overlay-types.d.ts +6 -0
- package/dist/components/overlay/overlay-types.d.ts.map +1 -1
- package/dist/components/overlay/useCompactPresentationContext.d.ts +33 -0
- package/dist/components/overlay/useCompactPresentationContext.d.ts.map +1 -0
- package/dist/components/pagination/CoarPagination.vue.d.ts.map +1 -1
- package/dist/components/panel-layout/internal/CoarPaneDivider.vue.d.ts.map +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts +5 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
- package/dist/components/scrollbar/index.d.ts +1 -1
- package/dist/components/scrollbar/index.d.ts.map +1 -1
- package/dist/components/scrollbar/vScrollbar.d.ts +9 -0
- package/dist/components/scrollbar/vScrollbar.d.ts.map +1 -1
- package/dist/components/segmented-control/CoarSegmentedControl.vue.d.ts.map +1 -1
- package/dist/components/select/CoarMultiSelect.vue.d.ts.map +1 -1
- package/dist/components/select/CoarMultiSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/select/CoarSelect.vue.d.ts +17 -3
- package/dist/components/select/CoarSelect.vue.d.ts.map +1 -1
- package/dist/components/select/CoarSelectDropdownPanel.vue.d.ts +7 -4
- package/dist/components/select/CoarSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/select/CoarTagSelect.vue.d.ts.map +1 -1
- package/dist/components/select/CoarTagSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/types.d.ts +13 -0
- package/dist/components/select/types.d.ts.map +1 -1
- package/dist/components/select/useSelectBase.d.ts +2 -1
- package/dist/components/select/useSelectBase.d.ts.map +1 -1
- package/dist/components/sidebar/CoarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts +2 -2
- package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
- package/dist/components/tabs/CoarTabGroup.vue.d.ts.map +1 -1
- package/dist/components/tag/CoarTag.vue.d.ts.map +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts +16 -2
- package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
- package/dist/components/theme-editor/CoarPaletteEditor.vue.d.ts +8 -2
- package/dist/components/theme-editor/CoarPaletteEditor.vue.d.ts.map +1 -1
- package/dist/components/theme-editor/color-preview.d.ts +22 -0
- package/dist/components/theme-editor/color-preview.d.ts.map +1 -0
- package/dist/components/theme-editor/font-preview.d.ts +46 -0
- package/dist/components/theme-editor/font-preview.d.ts.map +1 -0
- package/dist/components/theme-editor/scheme-values.d.ts +12 -0
- package/dist/components/theme-editor/scheme-values.d.ts.map +1 -0
- package/dist/components/theme-editor/theme-editor-state.d.ts +199 -183
- package/dist/components/theme-editor/theme-editor-state.d.ts.map +1 -1
- package/dist/components/theme-scope/CoarThemeScope.vue.d.ts.map +1 -1
- package/dist/components/tree/CoarTreeNode.vue.d.ts.map +1 -1
- package/dist/composables/useDragDrop.d.ts.map +1 -1
- package/dist/composables/useDragImage.d.ts +2 -14
- package/dist/composables/useDragImage.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6768 -4523
- package/dist/onest-fonts.d.ts +1 -0
- package/dist/onest-fonts.d.ts.map +1 -0
- package/dist/onest-fonts.js +4 -0
- package/dist/theme/color-contrast.d.ts +10 -0
- package/dist/theme/color-contrast.d.ts.map +1 -0
- package/dist/theme/compact-packages/calendar.d.ts +8 -0
- package/dist/theme/compact-packages/calendar.d.ts.map +1 -0
- package/dist/theme/compact-packages/data-grid.d.ts +8 -0
- package/dist/theme/compact-packages/data-grid.d.ts.map +1 -0
- package/dist/theme/compact-packages/document-viewer.d.ts +8 -0
- package/dist/theme/compact-packages/document-viewer.d.ts.map +1 -0
- package/dist/theme/compact-packages/map.d.ts +11 -0
- package/dist/theme/compact-packages/map.d.ts.map +1 -0
- package/dist/theme/compact-packages/markdown-editor.d.ts +8 -0
- package/dist/theme/compact-packages/markdown-editor.d.ts.map +1 -0
- package/dist/theme/compact-packages/markdown.d.ts +14 -0
- package/dist/theme/compact-packages/markdown.d.ts.map +1 -0
- package/dist/theme/compact-packages/mermaid.d.ts +8 -0
- package/dist/theme/compact-packages/mermaid.d.ts.map +1 -0
- package/dist/theme/compact-packages/page-builder.d.ts +8 -0
- package/dist/theme/compact-packages/page-builder.d.ts.map +1 -0
- package/dist/theme/compact-packages/script-editor.d.ts +8 -0
- package/dist/theme/compact-packages/script-editor.d.ts.map +1 -0
- package/dist/theme/compact-theme.d.ts +11 -0
- package/dist/theme/compact-theme.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/calendar.d.ts +3 -0
- package/dist/theme/enterprise-packages/calendar.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/document-viewer.d.ts +3 -0
- package/dist/theme/enterprise-packages/document-viewer.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/map.d.ts +3 -0
- package/dist/theme/enterprise-packages/map.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/markdown.d.ts +7 -0
- package/dist/theme/enterprise-packages/markdown.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/mermaid.d.ts +3 -0
- package/dist/theme/enterprise-packages/mermaid.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/page-builder.d.ts +3 -0
- package/dist/theme/enterprise-packages/page-builder.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/script-editor.d.ts +7 -0
- package/dist/theme/enterprise-packages/script-editor.d.ts.map +1 -0
- package/dist/theme/enterprise-theme.d.ts +8 -0
- package/dist/theme/enterprise-theme.d.ts.map +1 -0
- package/dist/theme/palette-inputs.d.ts +34 -0
- package/dist/theme/palette-inputs.d.ts.map +1 -0
- package/dist/theme/role-derived-tokens.d.ts +3 -0
- package/dist/theme/role-derived-tokens.d.ts.map +1 -0
- package/dist/theme/role-input-defaults.d.ts +5 -0
- package/dist/theme/role-input-defaults.d.ts.map +1 -0
- package/dist/theme/role-theme-contract.d.ts +8 -0
- package/dist/theme/role-theme-contract.d.ts.map +1 -0
- package/dist/theme/role-theme.d.ts +40 -0
- package/dist/theme/role-theme.d.ts.map +1 -0
- package/package.json +15 -4
- package/skills/cocoar-vue-ui/SKILL.md +8 -1
- package/skills/cocoar-vue-ui/references/components/calendar/board.md +212 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +32 -1
- package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +21 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +26 -1
- package/skills/cocoar-vue-ui/references/components/calendar/mini-month.md +59 -0
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +48 -1
- package/skills/cocoar-vue-ui/references/components/context-menu.md +1 -0
- package/skills/cocoar-vue-ui/references/components/data-grid.md +4 -0
- package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +30 -1
- package/skills/cocoar-vue-ui/references/components/date-picker.md +32 -1
- package/skills/cocoar-vue-ui/references/components/date-time-picker.md +28 -1
- package/skills/cocoar-vue-ui/references/components/dialog.md +188 -2
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +4 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +10 -6
- package/skills/cocoar-vue-ui/references/components/listbox.md +3 -1
- package/skills/cocoar-vue-ui/references/components/map/index.md +5 -1
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +10 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +9 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +10 -0
- package/skills/cocoar-vue-ui/references/components/menu.md +1 -1
- package/skills/cocoar-vue-ui/references/components/mermaid.md +11 -0
- package/skills/cocoar-vue-ui/references/components/number-input.md +81 -0
- package/skills/cocoar-vue-ui/references/components/object-editor.md +737 -0
- package/skills/cocoar-vue-ui/references/components/otp-input.md +1 -1
- package/skills/cocoar-vue-ui/references/components/pagination.md +1 -1
- package/skills/cocoar-vue-ui/references/components/password-input.md +32 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +10 -0
- package/skills/cocoar-vue-ui/references/components/segmented-control.md +1 -1
- package/skills/cocoar-vue-ui/references/components/select.md +136 -2
- package/skills/cocoar-vue-ui/references/components/tabs.md +1 -1
- package/skills/cocoar-vue-ui/references/components/tag.md +1 -1
- package/skills/cocoar-vue-ui/references/components/text-input.md +189 -0
- package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +42 -1
- package/skills/cocoar-vue-ui/references/foundations/colors.md +32 -3
- package/skills/cocoar-vue-ui/references/foundations/compact-presentation.md +248 -0
- package/skills/cocoar-vue-ui/references/foundations/theming.md +98 -11
- package/skills/cocoar-vue-ui/references/foundations/typography.md +3 -0
- package/skills/cocoar-vue-ui/references/guide/getting-started.md +2 -2
- package/skills/cocoar-vue-ui/references/guide/migration-color-roles.md +28 -0
- package/skills/cocoar-vue-ui/references/guide/migration-object-editor-values.md +40 -0
- package/skills/cocoar-vue-ui/references/guide/mobile.md +126 -27
- package/skills/cocoar-vue-ui/references/guide/theming.md +25 -0
- package/styles/tokens/all.css +6 -0
- package/styles/tokens/code-block.css +2 -2
- package/styles/tokens/colors-primitives-dark.css +50 -50
- package/styles/tokens/colors-primitives-light.css +50 -50
- package/styles/tokens/colors-usage.css +132 -111
- package/styles/tokens/compact.css +4442 -0
- package/styles/tokens/components-shared.css +4 -4
- package/styles/tokens/derived.css +525 -0
- package/styles/tokens/menu.css +21 -21
- package/styles/tokens/mobile.css +2 -0
- package/styles/tokens/new-components.css +42 -33
- package/styles/tokens/select-overlay.css +12 -12
- package/styles/tokens/sidebar.css +12 -12
- package/styles/tokens/theme-none.css +99 -93
- package/styles/tokens/tooltip.css +4 -4
- package/styles/tokens/typography.css +19 -19
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/calendar/board.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# `<CoarCalendarBoard>` — Board (Preview)
|
|
4
|
+
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — The grid works on touch; on a phone seven columns are narrow, so a week usually reads better as rows of days.
|
|
6
|
+
|
|
7
|
+
A board is a grid of day cells with bars running across them. Its **rows** decide what it shows, so the same component draws a week by morning, afternoon and evening, a week with one row per resource, and a year wall planner. What a row means stays with your app.
|
|
8
|
+
|
|
9
|
+
**Demo — `calendar/demos/BoardWeek.vue`**
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<template>
|
|
13
|
+
<div style="border: 1px solid var(--coar-border-neutral-tertiary); border-radius: var(--coar-radius-xs); overflow: hidden;">
|
|
14
|
+
<CoarCalendarBoard :builder="builder" :rows="rows">
|
|
15
|
+
<template #rowLabel="{ row }">{{ labels[row.key] }}</template>
|
|
16
|
+
<template #cell="{ row, date }">
|
|
17
|
+
<span v-if="row.key === 'meals'" style="color: var(--coar-text-subtle)">{{ meals[date.dayOfWeek - 1] }}</span>
|
|
18
|
+
</template>
|
|
19
|
+
</CoarCalendarBoard>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { ref } from 'vue';
|
|
25
|
+
import {
|
|
26
|
+
BOARD_ALL_DAY_ROW,
|
|
27
|
+
CoarCalendarBoard,
|
|
28
|
+
Temporal,
|
|
29
|
+
useCalendar,
|
|
30
|
+
weekBoardRows,
|
|
31
|
+
type BoardRowsContext,
|
|
32
|
+
type CalendarEvent,
|
|
33
|
+
type CalendarPeriod,
|
|
34
|
+
} from '@cocoar/vue-calendar';
|
|
35
|
+
|
|
36
|
+
const periods: CalendarPeriod[] = [
|
|
37
|
+
{ key: 'morning', startMinutes: 0, endMinutes: 12 * 60 },
|
|
38
|
+
{ key: 'afternoon', startMinutes: 12 * 60, endMinutes: 18 * 60 },
|
|
39
|
+
{ key: 'evening', startMinutes: 18 * 60, endMinutes: 24 * 60 },
|
|
40
|
+
];
|
|
41
|
+
const labels: Record<string, string> = {
|
|
42
|
+
[BOARD_ALL_DAY_ROW]: 'All day',
|
|
43
|
+
morning: 'Morning',
|
|
44
|
+
afternoon: 'Afternoon',
|
|
45
|
+
evening: 'Evening',
|
|
46
|
+
meals: 'Dinner',
|
|
47
|
+
};
|
|
48
|
+
const meals = ['Soup', 'Pasta', 'Curry', 'Tacos', 'Fish', 'Pizza', 'Roast'];
|
|
49
|
+
|
|
50
|
+
const zdt = (iso: string) => Temporal.ZonedDateTime.from(`${iso}[Europe/Vienna]`);
|
|
51
|
+
const events = ref<CalendarEvent[]>([
|
|
52
|
+
{ id: 'camp', start: Temporal.PlainDate.from('2026-11-17'), end: Temporal.PlainDate.from('2026-11-20'), meta: { title: 'Project week', color: '#7c3aed' } },
|
|
53
|
+
{ id: 'dentist', start: zdt('2026-11-16T09:00'), end: zdt('2026-11-16T10:00'), meta: { title: 'Dentist', color: '#0891b2' } },
|
|
54
|
+
{ id: 'training', start: zdt('2026-11-19T15:30'), end: zdt('2026-11-19T17:00'), meta: { title: 'Training', color: '#2f855a' } },
|
|
55
|
+
{ id: 'parents', start: zdt('2026-11-19T19:00'), end: zdt('2026-11-19T20:30'), meta: { title: 'Parents evening', color: '#c05621' } },
|
|
56
|
+
{ id: 'hike', start: zdt('2026-11-22T10:00'), end: zdt('2026-11-22T15:00'), meta: { title: 'Hike', color: '#2563eb' } },
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
const { builder } = useCalendar();
|
|
60
|
+
builder
|
|
61
|
+
.view('week')
|
|
62
|
+
.date(Temporal.PlainDate.from('2026-11-19'))
|
|
63
|
+
.timezone('Europe/Vienna')
|
|
64
|
+
.locale('en-GB')
|
|
65
|
+
.firstDayOfWeek(1)
|
|
66
|
+
.events(events);
|
|
67
|
+
|
|
68
|
+
const rows = (context: BoardRowsContext) =>
|
|
69
|
+
weekBoardRows({ dates: context.dates, periods, timezone: context.timezone, extraRows: ['meals'] });
|
|
70
|
+
</script>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## A week by parts of the day
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { CoarCalendarBoard, useCalendar, weekBoardRows, type BoardRowsContext } from '@cocoar/vue-calendar';
|
|
78
|
+
|
|
79
|
+
const { builder } = useCalendar();
|
|
80
|
+
const periods = [
|
|
81
|
+
{ key: 'morning', startMinutes: 0, endMinutes: 12 * 60 },
|
|
82
|
+
{ key: 'afternoon', startMinutes: 12 * 60, endMinutes: 18 * 60 },
|
|
83
|
+
{ key: 'evening', startMinutes: 18 * 60, endMinutes: 24 * 60 },
|
|
84
|
+
];
|
|
85
|
+
const rows = (context: BoardRowsContext) =>
|
|
86
|
+
weekBoardRows({ dates: context.dates, periods, timezone: context.timezone, extraRows: ['meals'] });
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<template>
|
|
90
|
+
<CoarCalendarBoard :builder="builder" :rows="rows">
|
|
91
|
+
<template #rowLabel="{ row }">{{ row.key }}</template>
|
|
92
|
+
<template #cell="{ row, date }">
|
|
93
|
+
<MealOfTheDay v-if="row.key === 'meals'" :date="date" />
|
|
94
|
+
</template>
|
|
95
|
+
</CoarCalendarBoard>
|
|
96
|
+
</template>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A timed event stands in the period it **starts** in. All-day and multi-day events run as bars in the all-day row (`BOARD_ALL_DAY_ROW`). A timed event outside every period goes to the next one, so it is never lost.
|
|
100
|
+
|
|
101
|
+
## A week per resource
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const rows = (context: BoardRowsContext) =>
|
|
105
|
+
resourceWeekRows({
|
|
106
|
+
dates: context.dates,
|
|
107
|
+
resources: ['emma', 'jonas'],
|
|
108
|
+
resourcesOf: (event) => event.meta.personIds,
|
|
109
|
+
extraRows: ['allFree'],
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
A shared event stands in the row of each of its resources. Events of no listed resource get the row `BOARD_UNASSIGNED_ROW`, which appears only when there are any. For "who is free", use [`computeOccupancy`](./coar-calendar.md#occupancy).
|
|
114
|
+
|
|
115
|
+
## A year wall planner
|
|
116
|
+
|
|
117
|
+
Twelve rows of 31 columns keep holidays readable as continuous bands, which twelve small month grids would tear apart.
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<CoarCalendarBoard
|
|
121
|
+
:builder="builder"
|
|
122
|
+
range="year"
|
|
123
|
+
:columns="yearWallColumns()"
|
|
124
|
+
:rows="(context) => yearWallRows({ year: context.year, locale: 'de-AT' })"
|
|
125
|
+
>
|
|
126
|
+
<template #cell="{ events }">
|
|
127
|
+
<span v-if="events.length" class="dot" />
|
|
128
|
+
</template>
|
|
129
|
+
</CoarCalendarBoard>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Multi-day events run as bands through each month and show their title where it fits. Single-day events are not drawn; they reach the `#cell` slot, so you decide what a dot means. A month's missing days stay as empty cells.
|
|
133
|
+
|
|
134
|
+
## Moving, selecting, paging
|
|
135
|
+
|
|
136
|
+
Dragging an event runs through the same drop pipeline as the other views: `onEventDrop`, `canDrop` and the DST policy apply. On another day the event keeps its time. In another part of the day it starts where that part starts, or at the period's `dropMinutes`, which you want for a morning that begins at 00:00. The duration always stays.
|
|
137
|
+
|
|
138
|
+
The payload's `target.rowKey` and `target.sourceRowKey` say which rows were involved, and `canDrop` gets `rowKey`. What a change of row means, such as another person, is for your `onEventDrop` to apply.
|
|
139
|
+
|
|
140
|
+
Enter, Space and `element.click()` on an event or bar fire `onEventClick` like a press without movement does.
|
|
141
|
+
|
|
142
|
+
With `selectable`, dragging across the days of a row emits `rangeSelect` with `{ rowKey, start, end, native }`, both days inclusive. A mouse selects at once, a touch after a long press. A horizontal swipe turns the page unless `swipeNavigation(false)` is set.
|
|
143
|
+
|
|
144
|
+
## Your own rows
|
|
145
|
+
|
|
146
|
+
A row is plain data, so you can build any set:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
interface BoardRow<TMeta> {
|
|
150
|
+
key: string;
|
|
151
|
+
dates: (Temporal.PlainDate | null)[]; // one per column, null = no day here
|
|
152
|
+
kind: 'cells' | 'bars' | 'custom';
|
|
153
|
+
match?: (event: CalendarEvent<TMeta>) => boolean;
|
|
154
|
+
hideWhenEmpty?: boolean;
|
|
155
|
+
period?: CalendarPeriod; // a drop onto this row starts in this period
|
|
156
|
+
label?: string; // default: key
|
|
157
|
+
class?: string; // extra class, to set tokens for this row
|
|
158
|
+
showCellEvents?: boolean; // false: single-day events only reach #cell
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
`cells` puts single-day events into their cell and runs multi-day events as bars. `bars` runs every event as a bar. `custom` shows no events and leaves the cells to the `#cell` slot.
|
|
163
|
+
|
|
164
|
+
## Props and slots
|
|
165
|
+
|
|
166
|
+
| Prop | Type | Description |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `builder` | `CalendarBuilder` | **Required.** Events, cursor, zone, locale and the click handlers. |
|
|
169
|
+
| `rows` | `BoardRow[] \| (context) => BoardRow[]` | **Required.** The function form gets the visible `dates`, `year` and `timezone`. |
|
|
170
|
+
| `range` | `'week' \| 'year'` | The window to load and page. Default `week`. |
|
|
171
|
+
| `columns` | `{ key, label }[]` | Column headers. Default: the dates of the first row. |
|
|
172
|
+
| `selectable` | `boolean` | Drag across days to select them. Default `false`. |
|
|
173
|
+
| `fill` | `boolean` | Take the parent's height; rows of cells share what the others leave. Default `false`. |
|
|
174
|
+
| `hideHeader` | `boolean` | Leave out the column headers, for rows that name their own day. Default `false`. |
|
|
175
|
+
|
|
176
|
+
| Event | Payload | Description |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `rangeSelect` | `{ rowKey, start, end, native }` | Days selected in one row, both inclusive. |
|
|
179
|
+
|
|
180
|
+
| Slot | Scope | Purpose |
|
|
181
|
+
|---|---|---|
|
|
182
|
+
| `rowLabel` | `{ row }` | The label at the start of a row. |
|
|
183
|
+
| `columnHeader` | `{ date, column, index, isToday }` | A column header. |
|
|
184
|
+
| `event` | `{ event, row, date }` | An event in a cell. |
|
|
185
|
+
| `bar` | `{ event, row, bar }` | A bar. |
|
|
186
|
+
| `cell` | `{ row, date, events, isToday, isPast }` | All of a `custom` cell, or content above the events of the others. |
|
|
187
|
+
|
|
188
|
+
## Styling tokens
|
|
189
|
+
|
|
190
|
+
`--coar-calendar-board-header-bg` colors the day headers and the empty corner above the row labels. `--coar-calendar-board-cell-today-frame` is a `box-shadow` around today's cell, drawn above the bars.
|
|
191
|
+
|
|
192
|
+
The events of a cell are ordered by start, all-day first, whether they are single or from a series.
|
|
193
|
+
|
|
194
|
+
| Token | Default |
|
|
195
|
+
|---|---|
|
|
196
|
+
| `--coar-calendar-board-label-width` | `88px` |
|
|
197
|
+
| `--coar-calendar-board-label-padding` | `8px` |
|
|
198
|
+
| `--coar-calendar-board-column-min-width` | `0` |
|
|
199
|
+
| `--coar-calendar-board-cell-min-height` | `48px` |
|
|
200
|
+
| `--coar-calendar-board-cell-padding` | `3px` |
|
|
201
|
+
| `--coar-calendar-board-bar-row-min-height` | `8px` |
|
|
202
|
+
| `--coar-calendar-board-cell-gap` / `-cell-bg` / `-cell-today-bg` | `2px` / none / today's tint |
|
|
203
|
+
| `--coar-calendar-board-cell-today-frame` / `-frame-radius` | none / `0` |
|
|
204
|
+
| `--coar-calendar-board-line` / `-row-line` | the calendar border |
|
|
205
|
+
| `--coar-calendar-board-header-bg` / `-today-bg` / `-padding` / `-line` | none / same / weekday padding / the line |
|
|
206
|
+
| `--coar-calendar-board-header-direction` / `-align` / `-justify` | `column` / `center` / `flex-start` |
|
|
207
|
+
| `--coar-calendar-board-label-font-size` / `-font-weight` / `-color` / `-letter-spacing` / `-transform` / `-align` | caption role, `stretch` |
|
|
208
|
+
| `--coar-calendar-board-bar-margin` / `-padding` / `-radius` / `-font-size` / `-font-weight` / `-gap` | `0` / event padding / pill radius / inherited / inherited / `2px` |
|
|
209
|
+
| `--coar-calendar-board-bars-padding` | `2px 0` |
|
|
210
|
+
| `--coar-calendar-board-row-gap` / `-column-gap` | `0` |
|
|
211
|
+
|
|
212
|
+
Events use the event tokens of the [month view](./month-view.md#styling-tokens).
|
|
@@ -17,7 +17,7 @@ The primary switcher follows iOS while keeping the fixed web time grids as usefu
|
|
|
17
17
|
| Primary view | Display choices |
|
|
18
18
|
|---|---|
|
|
19
19
|
| Year | Responsive twelve-month overview; selecting a day or month drills into Month. |
|
|
20
|
-
| Month | Compact, Stacked, Details, List. The first three use continuously scrolling 4–6-week month sections. |
|
|
20
|
+
| Month | Compact, Stacked, Details, List. The first three use continuously scrolling 4–6-week month sections, or [one month at a time](./month-view.md#paged-month) with `monthPresentation('paged')`. |
|
|
21
21
|
| Week | Fixed seven-day time grid. |
|
|
22
22
|
| Work week | The Week grid filtered by `workDays(...)`. |
|
|
23
23
|
| Day | One day or width-aware Multi-day (1–7 complete columns). |
|
|
@@ -1412,6 +1412,37 @@ builder
|
|
|
1412
1412
|
</script>
|
|
1413
1413
|
```
|
|
1414
1414
|
|
|
1415
|
+
## Who is busy, and where a day has room (Preview) {#occupancy}
|
|
1416
|
+
|
|
1417
|
+
Two pure functions from the core answer the questions behind views like "when does everyone have time". What a resource or a part of the day means stays with your app.
|
|
1418
|
+
|
|
1419
|
+
```ts
|
|
1420
|
+
import { computeOccupancy, findDayGaps } from '@cocoar/vue-calendar';
|
|
1421
|
+
|
|
1422
|
+
const parts = [
|
|
1423
|
+
{ key: 'morning', startMinutes: 0, endMinutes: 12 * 60 },
|
|
1424
|
+
{ key: 'afternoon', startMinutes: 12 * 60, endMinutes: 18 * 60 },
|
|
1425
|
+
{ key: 'evening', startMinutes: 18 * 60, endMinutes: 24 * 60 },
|
|
1426
|
+
];
|
|
1427
|
+
|
|
1428
|
+
const occupancy = computeOccupancy(events, {
|
|
1429
|
+
dates,
|
|
1430
|
+
periods: parts,
|
|
1431
|
+
resources: ['emma', 'jonas'],
|
|
1432
|
+
timezone: 'Europe/Vienna',
|
|
1433
|
+
resourcesOf: (event) => event.meta.personIds,
|
|
1434
|
+
});
|
|
1435
|
+
occupancy.busyResources(date, 'evening'); // ['emma']
|
|
1436
|
+
occupancy.isFree(date, 'evening', ['jonas']); // true
|
|
1437
|
+
|
|
1438
|
+
const gaps = findDayGaps(entriesOfTheDay, { date, timezone: 'Europe/Vienna', minMinutes: 60 });
|
|
1439
|
+
// [{ start, end, minutes: 120 }]
|
|
1440
|
+
```
|
|
1441
|
+
|
|
1442
|
+
- Periods are wall-clock minutes in the display zone, from `0` to `1440`, and half-open: an event ending at 18:00 leaves an evening from 18:00 free.
|
|
1443
|
+
- `computeOccupancy` counts events with a time. Pass `counts` to decide per event, also for all-day entries, which then cover their whole days.
|
|
1444
|
+
- `findDayGaps` takes any `{ start, end }`, so entries that are not calendar events can count. It merges overlaps, ignores all-day entries, and treats the time before the first and after the last entry as no gap.
|
|
1445
|
+
|
|
1415
1446
|
## Imperative API
|
|
1416
1447
|
|
|
1417
1448
|
The builder exposes an `api` object — same shape regardless of whether the calendar component has mounted yet. Stash it from `useCalendar()` and call methods directly:
|
|
@@ -456,6 +456,27 @@ builder
|
|
|
456
456
|
|
|
457
457
|
Web only for now: the iOS and Android calendars draw the vertical grid.
|
|
458
458
|
|
|
459
|
+
## One column per resource {#resources} (Preview)
|
|
460
|
+
|
|
461
|
+
With `resources` and `eventResources`, a single day shows one hour column per resource, for example per person or room.
|
|
462
|
+
|
|
463
|
+
```ts
|
|
464
|
+
builder
|
|
465
|
+
.view('day')
|
|
466
|
+
.resources([
|
|
467
|
+
{ id: 'emma', label: 'Emma' },
|
|
468
|
+
{ id: 'jonas', label: 'Jonas' },
|
|
469
|
+
])
|
|
470
|
+
.eventResources((event) => event.meta.personIds)
|
|
471
|
+
.dayOverlays((date) => mealsOn(date));
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
- A shared event is **one block** across neighbouring columns as long as it is alone in each of them. Otherwise it falls apart into a piece per column. Columns that are not neighbours get separate blocks of the same event, and dragging any of them moves the event.
|
|
475
|
+
- An event without a listed resource is never lost: it stands in an extra column that appears only when needed.
|
|
476
|
+
- `onEventDrop`, `canDrop`, `onTimeClick` and `onTimeRangeSelect` report `resourceId`, a drop also `sourceResourceId`. The library does not change the assignment; apply it in `onEventDrop`.
|
|
477
|
+
- `dayOverlays` lies across all columns, behind the events, and is drawn by the `#overlay` slot. `#resourceHeader` draws the head of a column and `#hourLabel` a label of the hour axis.
|
|
478
|
+
- It applies to one day on the vertical grid. Several days or the horizontal orientation show the regular grid, with a console warning. Events cannot be resized here yet.
|
|
479
|
+
|
|
459
480
|
## Touch paging
|
|
460
481
|
|
|
461
482
|
On touch devices a horizontal pan on the day columns moves the grid with the finger — header cells, all-day band and columns together, the hour axis stays put — and pages to the previous / next range on release past a quarter of the width or on a fast flick. Below that the grid settles back. A touch that never moves is a tap and reaches `onTimeClick` right after the click that follows the lift, so a swipe never starts with a stray slot click and an overlay the handler opens is not hit by that click. Vertical pans stay native scrolling. A mouse keeps its click-on-press semantics; a pen tap counts like a finger tap.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Calendar (Preview)
|
|
4
4
|
|
|
5
|
-
**Devices:** desktop ready · tablet partial · phone planned —
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone planned — Touch taps, paging and long-press selection work; legacy resize targets are 6 px. Compact targets stay smaller on short/crowded events.
|
|
6
6
|
|
|
7
7
|
A Vue 3 calendar whose visible hierarchy follows the iOS calendar: **Year**, **Month**, **Day** and **Agenda**, plus fixed **Week** and **Work week** time grids for web applications. Month and Day expose their display choices as nested variations instead of flattening every renderer into the primary view switcher.
|
|
8
8
|
|
|
@@ -293,6 +293,31 @@ To customize, redefine any token under the same trigger after the package styles
|
|
|
293
293
|
}
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
+
### Compact presentation (Preview)
|
|
297
|
+
|
|
298
|
+
Inside the library's experimental `.coar-compact` profile, the calendar takes its surfaces, lines, text and
|
|
299
|
+
state colours from the vue-ui semantic tokens (`--coar-background-neutral-*`, `--coar-border-neutral-tertiary`,
|
|
300
|
+
`--coar-text-neutral-*`, accent and error roles) in light and dark alike, and its type from the shared compact
|
|
301
|
+
roles: labels and day headers follow the UI text size, event cards, pills, bars and axis captions the caption
|
|
302
|
+
size, with weight 500 for labels and titles and 600 only for view titles and the today number. Today is marked
|
|
303
|
+
in the accent colour in every view. Radii, header and agenda-row padding follow the shared control, panel and
|
|
304
|
+
interactive-row roles, so agenda rows reach the 44 px touch row under `.coar-mobile`.
|
|
305
|
+
|
|
306
|
+
Fixed week columns retain a 128 px geometry floor and scroll inside the shell on narrow screens; a horizontal
|
|
307
|
+
gesture scrolls rather than paging while the grid overflows. Month overflow actions and timed resize targets
|
|
308
|
+
have independent roles (`--coar-calendar-month-overflow-target-size` and `--coar-calendar-resize-target-size`).
|
|
309
|
+
The resize side rail is bounded by half the card to avoid overlapping targets and preserve its move area.
|
|
310
|
+
All-day lanes measure their own CSS height before positioning bars and overflow actions.
|
|
311
|
+
|
|
312
|
+
Outside the profile the presentation is unchanged: role usages retain their historical fallbacks, and compact-only
|
|
313
|
+
overflow rules do not apply. The roles are set on the outermost calendar element, so a scheme or mobile
|
|
314
|
+
scope between `.coar-compact` and the calendar still applies, and a value you set on the calendar element
|
|
315
|
+
itself (`.my-calendar { --coar-calendar-bg: … }`) wins over the profile.
|
|
316
|
+
|
|
317
|
+
Not part of the profile: event colours (`meta.color`, `meta.textColor`), assignee and band colours you pass,
|
|
318
|
+
and the geometry the views compute in script — `pixelsPerHour`, `timelineRowHeight`, the
|
|
319
|
+
pill and chip line boxes, `--coar-time-grid-axis-width` and `--coar-calendar-scroll-inset-bottom`.
|
|
320
|
+
|
|
296
321
|
> **Tip: RTL**
|
|
297
322
|
>
|
|
298
323
|
> Layout-mirroring for `direction: rtl` is **not yet** wired (multi-day bars, resize handles, sticky-header positioning all assume LTR). If you need RTL support, open an issue — the math is mostly localised to the bar / handle inset calc()s, but it deserves a deliberate pass with proper test coverage rather than a one-shot patch.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/calendar/mini-month.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# `<CoarMiniMonth>` — Mini Month (Preview)
|
|
4
|
+
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
7
|
+
A small month for picking a day, for example in a sidebar next to the calendar. It needs no builder, leafs through months on its own and follows `v-model` when that moves to another month. It always shows six rows, so nothing below it jumps.
|
|
8
|
+
|
|
9
|
+
**Demo — `calendar/demos/MiniMonthBasic.vue`**
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<template>
|
|
13
|
+
<CoarMiniMonth v-model="day" locale="en-GB" :first-day-of-week="1" />
|
|
14
|
+
<p>Selected: {{ day }}</p>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { ref } from 'vue';
|
|
19
|
+
import { CoarMiniMonth, Temporal } from '@cocoar/vue-calendar';
|
|
20
|
+
|
|
21
|
+
const day = ref(Temporal.PlainDate.from('2026-11-19'));
|
|
22
|
+
</script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<CoarMiniMonth v-model="day" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To drive a calendar with it, pass the day to `api.goTo(day)`.
|
|
30
|
+
|
|
31
|
+
## Props, events and slots
|
|
32
|
+
|
|
33
|
+
| Prop | Type | Default | Description |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| `modelValue` | `Temporal.PlainDate \| null` | `null` | The selected day. |
|
|
36
|
+
| `locale` | `string` | the app's localization | Month and weekday names. |
|
|
37
|
+
| `firstDayOfWeek` | `0..6` | from the locale | `0` = Sunday. |
|
|
38
|
+
| `timezone` | `string` | the system's | Decides which day is today. |
|
|
39
|
+
| `highlightWeek` | `boolean` | `true` | Tints the week of the selected day. |
|
|
40
|
+
|
|
41
|
+
| Event | Payload | Description |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `update:modelValue` | `Temporal.PlainDate` | A day was picked. |
|
|
44
|
+
|
|
45
|
+
| Slot | Scope | Purpose |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `day` | `{ date, isToday, isSelected, isOtherMonth }` | The content of a day, for example with a mark. |
|
|
48
|
+
| `title` | `{ month, label }` | The heading. `month` is a `Temporal.PlainYearMonth`, `label` the month and year in the locale. |
|
|
49
|
+
|
|
50
|
+
The arrow keys move between days and `Page Up` / `Page Down` between months.
|
|
51
|
+
|
|
52
|
+
| Token | Default | Sets |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `--coar-calendar-mini-month-day-size` | `26px` | The size of a day. |
|
|
55
|
+
| `--coar-calendar-mini-month-max-width` | `280px` | The width of the month. |
|
|
56
|
+
| `--coar-calendar-mini-month-day-font-size` | inherited | The type size of the days. |
|
|
57
|
+
| `--coar-calendar-mini-month-weekday-font-size` | inherited | The type size of the weekdays. |
|
|
58
|
+
| `--coar-calendar-mini-month-weekday-font-weight` | inherited | The weight of the weekdays. |
|
|
59
|
+
| `--coar-calendar-mini-month-week-radius` | `0` | The corners of each day in the highlighted week. |
|
|
@@ -42,6 +42,16 @@ Only the month in view and the next one render on mount. Every other section sta
|
|
|
42
42
|
<CoarMonthListView :builder="builder" />
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## One month at a time {#paged-month} (Preview)
|
|
46
|
+
|
|
47
|
+
`monthPresentation('paged')` replaces the endless list with a single month that is turned by swiping. The finger pulls the page and it snaps in, while `api.next()` and `api.prev()` slide it. All rows stay equally high (`uniform`, or `fill` when `monthRowSizing('fill')` is set), so the grid never jumps between months. The neighbouring months are loaded with the visible window.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
builder.view('month').monthPresentation('paged').monthRowSizing('fill');
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
A swipe that starts on an event belongs to its drag, and a vertical pan stays with the page. A tap on a day of a neighbouring month fires `onDateClick`; whether that also turns the page is up to the host. Standalone, the same surface is `<CoarPagedMonthView :builder="builder" />`, with the slots of `<CoarMonthView>`.
|
|
54
|
+
|
|
45
55
|
## Single month section {#single-month-section}
|
|
46
56
|
|
|
47
57
|
`<CoarMonthView>` renders the fixed single-section grid used internally by the continuous composition. Multi-day events render as continuous **bars** across the rows they touch; single-day events render as **pills** inside cells. A timed event counts as multi-day when it ends on a later day than it starts in the display zone (Thu 15:30 → Sun 18:00 is a Thu–Sun bar); its end is exclusive, so an end at the start of a day (00:00, or 01:00 where DST skips midnight) does not reach into that day. Its bar stops a third of a day short of the outer edges of its first and last day — the same fixed inset whatever the clock times are — so it never reads as an all-day event; an edge cut by a week row or by the edge of a continuous month's section keeps running to the border. Use it directly when the host owns pagination or needs a compact embedded month.
|
|
@@ -454,6 +464,10 @@ Full reference: see [the composer's API reference](./coar-calendar.md#api-refere
|
|
|
454
464
|
|---|---|---|---|
|
|
455
465
|
| `firstDayOfWeek(d)` | `0..6 \| undefined` | locale-aware | `0` = Sunday, `1` = Monday, … |
|
|
456
466
|
| `monthDensity(d)` | `'compact' \| 'stacked' \| 'details'` | `'details'` | Presentation used by continuous Month. |
|
|
467
|
+
| `monthPresentation(p)` (Preview) | `'continuous' \| 'paged'` | `'continuous'` | The month of `<CoarCalendar>`: the endless list or [one month at a time](#paged-month). |
|
|
468
|
+
| `monthRowSizing(s)` (Preview) | `'auto' \| 'uniform' \| 'fill'` | `'auto'` | `auto` grows a row with its multi-day lanes. `uniform` keeps all rows equal, so the grid never jumps. `fill` shares the height of the view between the rows and needs a parent with a height; a continuous month treats it as `uniform`. In `uniform` and `fill`, what does not fit folds into `+N`. |
|
|
469
|
+
| `weekdayFormat(f)` (Preview) | `'narrow' \| 'short' \| null` | `null` | Weekday names of the month header, the year and the day agenda's week strip. `null` keeps each view's own format. |
|
|
470
|
+
| `dayClass(fn)` (Preview) | `(date) => class value` | — | Extra classes of a month cell, read per day on every render, for example to highlight free days. |
|
|
457
471
|
| `shadeWeekends(b)` | `MaybeRefOrGetter<boolean>` | `true` | Shades Saturday / Sunday cells and weekday headers. Set `false` for an unshaded appearance. |
|
|
458
472
|
| `selectedDate(d)` | `MaybeRefOrGetter<Temporal.PlainDate \| null>` | `null` | The host's selected day: a filled circle around the day number (iOS selection decoration, `--coar-calendar-selection-fill`). Independent of the cursor — pass the day a companion pane follows, e.g. from `onDateClick`. |
|
|
459
473
|
| `maxEventsPerCell(n)` | `MaybeRefOrGetter<number>` | `2` | Single-day pills a **Details** cell shows before the rest fold into the `+N` row. Stacked and Compact use fixed limits (2 marks / 6 capsule segments) like iOS. |
|
|
@@ -465,7 +479,7 @@ Full reference: see [the composer's API reference](./coar-calendar.md#api-refere
|
|
|
465
479
|
|
|
466
480
|
Month rows have a fixed height per density plus the height of the week's multi-day lane band, and that band is capped too: a row shows at most `monthMaxVisibleLanes` lanes (default **2**). A multi-day bar past the cap leaves the band entirely — it is never clipped mid-row — and counts into the `+N` of every day it covers. `null` restores the unbounded band of the iOS port, where a week grows with every lane.
|
|
467
481
|
|
|
468
|
-
A Details cell
|
|
482
|
+
A Details cell orders its single-day pills by start, all-day first, whether they are single or from a series. It renders the first `maxEventsPerCell` (default **2**) and folds the rest, together with the folded bars covering the day, into one `+N` row in the subtle text colour. The Details base row is the iOS 94 px or, if the host's styling needs more, the measured height of the day-number row plus `maxEventsPerCell` pills plus the `+N` row — the view measures its own rendered cells (`useMonthMetrics`), so a `:deep()` override that makes pills or the day-number row taller never clips the marker. Details multi-day bars take the measured pill height, so bars and pills in one row are always the same size. In a row of fixed height (`uniform`, `fill`) a day gives up only the lanes of its own bars, and it takes the `+N` row's place for a pill when nothing is folded, so `maxEventsPerCell(3)` shows three lines wherever they fit. Stacked shows 2 marks and Compact 6 capsule segments and, like iOS, cap silently — their marks carry no titles, so the day has to be opened either way. Cells never scroll, and there is no per-cell menu or row expansion.
|
|
469
483
|
|
|
470
484
|
On the web the `+N` row is a button (accessible name "N more events", `aria-haspopup="dialog"`). It opens a **day sheet** over that one cell: a small dialog aligned to the cell's top-left edge that lists every event of the day — the multi-day events covering it first (visible lanes, then folded ones), then the single-day pills — and scrolls when the list is long. The sheet opens downward and flips upward when the space below inside the scroll container is short; it never expands the row or the grid. Every pill in the sheet is a live pill with the grid's own wiring — drag it onto any other day, move it with the keyboard, double-click it for `onEventDoubleClick`. The sheet closes on Escape, its close control, a pointerdown outside it, another `+N`, or when the month changes; focus returns to the `+N` button.
|
|
471
485
|
|
|
@@ -504,6 +518,36 @@ interface CalendarApi<TMeta> {
|
|
|
504
518
|
|
|
505
519
|
`scrollToTime` / `scrollToDate` are not month operations. `api.goTo(...)`, `next()`, and `prev()` align the continuous surface to the requested month; a standalone `<CoarContinuousMonthView>` additionally exposes `scrollToMonth(...)` on its component ref.
|
|
506
520
|
|
|
521
|
+
## Styling tokens (Preview)
|
|
522
|
+
|
|
523
|
+
Set these on the calendar or a parent. Without them everything keeps its look. A custom `#pill` or `#event` that draws its own card can clear the built-in surface with `--coar-calendar-event-surface-bg: transparent`, `--coar-calendar-event-border-left: 0` and `--coar-calendar-event-padding: 0`.
|
|
524
|
+
|
|
525
|
+
| Token | Default | Applies to |
|
|
526
|
+
|---|---|---|
|
|
527
|
+
| `--coar-calendar-day-number-font-size` | label size | Day number |
|
|
528
|
+
| `--coar-calendar-day-number-font-weight` | label weight | Day number |
|
|
529
|
+
| `--coar-calendar-month-selected-frame` | `none` | A `box-shadow` around the selected day, drawn above the multi-day bars |
|
|
530
|
+
| `--coar-calendar-day-number-row-height` | `24px`, continuous `31px` | Row of the day number |
|
|
531
|
+
| `--coar-calendar-day-number-row-padding` | `4px 6px`, continuous `2px 6px` | Row of the day number |
|
|
532
|
+
| `--coar-calendar-today-font-weight` | day number weight | Today's number |
|
|
533
|
+
| `--coar-calendar-today-marker-size` | `27px` | Today and selection circle of the continuous month |
|
|
534
|
+
| `--coar-calendar-weekday-color` | subtle text | Weekday header |
|
|
535
|
+
| `--coar-calendar-weekday-font-size` | caption size | Weekday header |
|
|
536
|
+
| `--coar-calendar-weekday-font-weight` | caption weight | Weekday header |
|
|
537
|
+
| `--coar-calendar-weekday-bg` / `-border` | calendar background / border | Weekday header |
|
|
538
|
+
| `--coar-calendar-weekday-letter-spacing` / `-transform` / `-align` | `0.04em` / `uppercase` / inherited | Weekday header |
|
|
539
|
+
| `--coar-calendar-day-number-row-direction` / `-align` / `-justify` / `-gap` / `-flex` | `row` / `center` / `flex-start` / `0` / `0 1 auto` | Row of the day number, to stack the number and `#dayContent` |
|
|
540
|
+
| `--coar-calendar-day-content-flex` | `1 1 auto` | The `#dayContent` box |
|
|
541
|
+
| `--coar-calendar-section-title-padding` | `20px 16px 10px` | Month title of the continuous month |
|
|
542
|
+
| `--coar-calendar-pill-font-size` | event size | Pills and bars |
|
|
543
|
+
| `--coar-calendar-pill-line-height` | `16px` | Pills |
|
|
544
|
+
| `--coar-calendar-pill-radius` | event radius | Pills and bars |
|
|
545
|
+
| `--coar-calendar-event-surface-bg` | the event's colour | Pills, bars, all-day bars, timed cards |
|
|
546
|
+
| `--coar-calendar-event-border-left` | `3px` in the event's colour | Pills, bars, all-day bars, timed cards |
|
|
547
|
+
| `--coar-calendar-event-padding` | `1px 6px` | Pills, bars, all-day bars |
|
|
548
|
+
|
|
549
|
+
Weekend columns of the continuous header keep their own `--coar-calendar-continuous-weekday-weekend-color`.
|
|
550
|
+
|
|
507
551
|
## Month component props + slots
|
|
508
552
|
|
|
509
553
|
| Prop | Type | Description |
|
|
@@ -514,3 +558,6 @@ interface CalendarApi<TMeta> {
|
|
|
514
558
|
|---|---|---|
|
|
515
559
|
| `pill` | `{ event, pill }` | Single-day pill renderer. `pill` is the `MonthCellPill` (event + visual order in the cell). |
|
|
516
560
|
| `multiDayBar` | `{ event, bar }` | Multi-day bar renderer. `bar` is the `MonthMultiDayBar` (lane / startCol / endCol / clipping flags). |
|
|
561
|
+
| `dayNumber` (Preview) | `{ date, isToday, isSelected, isOtherMonth }` | Replaces the day number. |
|
|
562
|
+
| `dayFooter` (Preview) | `{ date, isToday, isSelected, isOtherMonth }` | Content at the foot of a day, such as its meal. Its measured height is counted before events fold into `+N`, and a row with `auto` sizing grows by it. A day that renders nothing here keeps its room. |
|
|
563
|
+
| `dayContent` (Preview) | `{ date, isToday, isSelected, isOtherMonth }` | Content beside the day number, also on the neighbouring months' days. Keep it within the height of the day-number row. |
|
|
@@ -337,6 +337,7 @@ Returns a `ContextMenuContext` object:
|
|
|
337
337
|
|------------|-------------------------------|------------------------------------------------|
|
|
338
338
|
| `isOpen` | `Readonly<Ref<boolean>>` | Whether the menu is currently visible |
|
|
339
339
|
| `position` | `Readonly<Ref<{x, y}>>` | Cursor position where the menu was opened |
|
|
340
|
+
| `target` (Preview) | `Readonly<Ref<Element \| null>>` | Element that was right-clicked (`null` when `open()` got no element target). `CoarContextMenu` passes it as the overlay's context, so a menu opened in a local `coar-mobile` area keeps the [mobile presentation](../guide/mobile.md#overlays). Optional in the `ContextMenuContext` type |
|
|
340
341
|
| `open` | `(event: MouseEvent) => void` | Open at the event's cursor position |
|
|
341
342
|
| `close` | `() => void` | Close the menu |
|
|
342
343
|
|
|
@@ -142,6 +142,10 @@ const builder = CoarGridBuilder.create<User>()
|
|
|
142
142
|
|
|
143
143
|
Dark styles ship with the package. The theme maps AG Grid's variables onto the semantic `--coar-*` tokens (with hardcoded fallbacks), so the grid follows your design-system theme in both modes. Dark values activate via the `.dark-mode` class — on `<html>` or any ancestor (the Cocoar convention, same as `@cocoar/vue-ui`), or directly on the grid element. `[data-theme="dark"]` is **not** a trigger here.
|
|
144
144
|
|
|
145
|
+
### Compact presentation (Preview)
|
|
146
|
+
|
|
147
|
+
Inside the experimental `.coar-compact` profile — on an ancestor or on the grid itself (`class="coar-compact"`) — the grid uses the library's compact roles: 13px UI text (14px with `.coar-mobile`), rows, header and AG Grid's list items at the interactive-row height (36px, 44px with `.coar-mobile`), 12px cell padding, the header in the label weight, and AG Grid's accent, icons, checkboxes, inputs, menus and drop markers on the semantic tokens. The same `cocoarTheme` serves both looks; outside the profile nothing changes. Override a role on the grid or inside the compact area: `--coar-data-grid-row-height`, `--coar-data-grid-header-height`, `--coar-data-grid-list-item-height`, `--coar-data-grid-font-size`, `--coar-data-grid-cell-padding-x`, `--coar-data-grid-header-font-weight`, `--coar-data-grid-control-radius`, `--coar-data-grid-radius`, `--coar-data-grid-tree-indent` and `--coar-data-grid-tree-toggle-size` (the last two apply in every presentation).
|
|
148
|
+
|
|
145
149
|
## Column Types
|
|
146
150
|
|
|
147
151
|
Built-in renderers for dates, numbers, currency, tags, and icons — no custom cell components needed. Date, number, and currency columns are locale-aware and update reactively when the locale changes. Try the locale switcher in the nav bar.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Date · optional time
|
|
4
4
|
|
|
5
|
-
**Devices:** desktop ready · tablet ready · phone
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile field sizes under .coar-mobile (Preview); the panel keeps its desktop layout, a phone sheet is planned.
|
|
6
6
|
|
|
7
7
|
Sometimes a field is "a date, and *maybe* a time" — a due date that's usually
|
|
8
8
|
just a day but occasionally needs an hour, a reminder that can be all-day or
|
|
@@ -151,6 +151,34 @@ gives a round toggle), and the gap uses `--coar-spacing-xs`. Nothing to register
|
|
|
151
151
|
in the theme editor — tuning the existing input / button / spacing / accent
|
|
152
152
|
tokens restyles these too.
|
|
153
153
|
|
|
154
|
+
## Inline (Preview) {#inline}
|
|
155
|
+
|
|
156
|
+
`appearance="inline"` is passed to the date or date-time field, which then shows only its value until it is
|
|
157
|
+
hovered, edited or its panel is open ([Text Input](./text-input.md#inline) describes the fills). The clock
|
|
158
|
+
toggle is a ghost button already and stays as it is.
|
|
159
|
+
|
|
160
|
+
**Demo — `date-or-time-picker/demos/OptionalTimeInline.vue`**
|
|
161
|
+
|
|
162
|
+
```vue
|
|
163
|
+
<template>
|
|
164
|
+
<div style="display: grid; gap: 4px; max-width: 480px;">
|
|
165
|
+
<div style="display: grid; grid-template-columns: 120px 1fr; align-items: center;">
|
|
166
|
+
<span>Due</span>
|
|
167
|
+
<CoarZonedDateTimeOrDatePicker v-model="due" v-model:with-time="withTime" appearance="inline" />
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
<script setup lang="ts">
|
|
173
|
+
import { ref } from 'vue';
|
|
174
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
175
|
+
import { CoarZonedDateTimeOrDatePicker } from '@cocoar/vue-ui';
|
|
176
|
+
|
|
177
|
+
const due = ref<Temporal.ZonedDateTime | Temporal.PlainDate | null>(Temporal.PlainDate.from('2026-12-01'));
|
|
178
|
+
const withTime = ref(false);
|
|
179
|
+
</script>
|
|
180
|
+
```
|
|
181
|
+
|
|
154
182
|
## Accessibility
|
|
155
183
|
|
|
156
184
|
The clock is a toggle button: it exposes `aria-pressed` for its state and a
|
|
@@ -174,6 +202,7 @@ Both components share this surface (the zoned variant adds the timezone props).
|
|
|
174
202
|
| `v-model:withTime` | `boolean` | `false` | The clock toggle / mode. |
|
|
175
203
|
| `placeholder` | `string` | `''` | Placeholder text. |
|
|
176
204
|
| `size` | `'xs' \| 's' \| 'm' \| 'l'` | `'m'` | Field + toggle size. |
|
|
205
|
+
| `appearance` (Preview) | `'outline' \| 'inline'` | `'outline'` | Passed to the field: `inline` shows no border or surface until hovered or edited, see [Inline](#inline). |
|
|
177
206
|
| `disabled` | `boolean` | `false` | Disable the field and toggle. |
|
|
178
207
|
| `readonly` | `boolean` | `false` | Read-only (toggle disabled too). |
|
|
179
208
|
| `required` | `boolean` | `false` | Mark as required. |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Date Picker
|
|
4
4
|
|
|
5
|
-
**Devices:** desktop ready · tablet ready · phone
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile field sizes under .coar-mobile (Preview); the panel keeps its desktop layout, a phone sheet is planned.
|
|
6
6
|
|
|
7
7
|
A calendar-backed date picker that returns a `Temporal.PlainDate` -- a date without time or timezone. Perfect for birthdays, deadlines, due dates, and any scenario where "which day" is all that matters.
|
|
8
8
|
|
|
@@ -153,6 +153,35 @@ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
|
|
|
153
153
|
>
|
|
154
154
|
> **Temporal.PlainDate:** This component uses the TC39 Temporal API (`@js-temporal/polyfill`). PlainDate represents a calendar date without time or timezone -- no more wrestling with midnight UTC offsets.
|
|
155
155
|
|
|
156
|
+
## Inline (Preview) {#inline}
|
|
157
|
+
|
|
158
|
+
`appearance="inline"` shows only the date until the field is hovered, edited or its calendar is open; the calendar
|
|
159
|
+
button stays and loses its segment background. `width="content"` fits the field to the shown date or the format
|
|
160
|
+
placeholder. Typing a date works as usual. How both behave and how to change the fills:
|
|
161
|
+
[Text Input](./text-input.md#inline).
|
|
162
|
+
|
|
163
|
+
**Demo — `date-picker/demos/DatePickerInline.vue`**
|
|
164
|
+
|
|
165
|
+
```vue
|
|
166
|
+
<template>
|
|
167
|
+
<p style="margin: 0; line-height: 2.4;">
|
|
168
|
+
Valid from
|
|
169
|
+
<CoarPlainDatePicker v-model="from" appearance="inline" width="content" />
|
|
170
|
+
to
|
|
171
|
+
<CoarPlainDatePicker v-model="to" appearance="inline" width="content" />
|
|
172
|
+
</p>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<script setup lang="ts">
|
|
176
|
+
import { ref } from 'vue';
|
|
177
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
178
|
+
import { CoarPlainDatePicker } from '@cocoar/vue-ui';
|
|
179
|
+
|
|
180
|
+
const from = ref<Temporal.PlainDate | null>(Temporal.PlainDate.from('2026-12-01'));
|
|
181
|
+
const to = ref<Temporal.PlainDate | null>(null);
|
|
182
|
+
</script>
|
|
183
|
+
```
|
|
184
|
+
|
|
156
185
|
## Accessibility
|
|
157
186
|
|
|
158
187
|
### Keyboard Navigation
|
|
@@ -182,6 +211,8 @@ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
|
|
|
182
211
|
| `min` | `Temporal.PlainDate` | `undefined` | Minimum selectable date |
|
|
183
212
|
| `max` | `Temporal.PlainDate` | `undefined` | Maximum selectable date |
|
|
184
213
|
| `size` | `'xs' \| 's' \| 'm' \| 'l'` | `'m'` | Input size |
|
|
214
|
+
| `appearance` (Preview) | `'outline' \| 'inline'` | `'outline'` | `inline`: no border or surface until hovered or edited, see [Inline](#inline) |
|
|
215
|
+
| `width` (Preview) | `'fill' \| 'content'` | `'fill'` | `content`: as wide as the shown value or placeholder |
|
|
185
216
|
| `disabled` | `boolean` | `false` | Disable the picker |
|
|
186
217
|
| `readonly` | `boolean` | `false` | Make read-only |
|
|
187
218
|
| `required` | `boolean` | `false` | Mark as required |
|