@tano.page/workbench 0.15.0 → 0.16.0
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/package.json +35 -14
- package/src/App.vue +68 -797
- package/src/assistant/agent-identities.ts +1 -97
- package/src/assistant/agent-task-context.ts +1 -54
- package/src/assistant/attachments.ts +1 -1
- package/src/assistant/completion.ts +1 -61
- package/src/assistant/components/AssistantPanel.vue +1 -1
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -585
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/language.ts +10 -37
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -65
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/store.ts +87 -554
- package/src/assistant/structures.ts +1 -157
- package/src/assistant/tasks.ts +8 -94
- package/src/assistant/tool-rules.ts +1 -7
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +37 -1022
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentInspector.vue +168 -0
- package/src/documents/components/DocumentPane.vue +482 -0
- package/src/documents/description-merge.ts +1 -9
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +23 -1
- package/src/i18n/locales/en-US.json +23 -1
- package/src/i18n/locales/es-ES.json +23 -1
- package/src/i18n/locales/ja-JP.json +23 -1
- package/src/i18n/locales/zh-TW.json +23 -1
- package/src/mail/components/MailAccountDialog.vue +1 -0
- package/src/mail/components/MailComposerDialog.vue +1 -0
- package/src/mail/components/MailWorkspaceView.vue +1 -0
- package/src/mail/components/SidebarMail.vue +1 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +2 -3
- package/src/plans/calendar.ts +2 -2
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarFilterBar.vue +128 -0
- package/src/plans/components/CalendarMonthView.vue +224 -0
- package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
- package/src/plans/components/CalendarTimelineView.vue +517 -0
- package/src/plans/components/CalendarTopbarControls.vue +101 -0
- package/src/plans/components/CalendarView.vue +162 -2106
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/calendar-shared.css +192 -0
- package/src/plans/composables/use-calendar-interactions.ts +396 -0
- package/src/plans/composables/use-calendar-scroll.ts +420 -0
- package/src/plugins/components/PluginDetailPage.vue +10 -6
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginExplorer.vue +6 -4
- package/src/plugins/components/PluginImportDialog.vue +1 -1
- package/src/plugins/components/PluginInstaller.vue +269 -178
- package/src/plugins/components/PluginMaintenance.vue +37 -49
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginSettingsForm.vue +2 -1
- package/src/plugins/components/PluginsTabPage.vue +61 -0
- package/src/plugins/components/plugin-center.css +5 -0
- package/src/plugins/data.ts +9 -86
- package/src/plugins/editor-plugin-adapters.ts +169 -0
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -260
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/queries.ts +1 -75
- package/src/plugins/view-header.ts +2 -7
- package/src/runtime.ts +3 -2
- package/src/settings/components/SettingsPanel.vue +8 -3
- package/src/settings/components/WorkbenchSettings.vue +20 -7
- package/src/settings/components/settings-context.ts +1 -1
- package/src/settings/settings-tab.ts +1 -0
- package/src/shell/command-palette.ts +3 -3
- package/src/shell/components/EditorToolbar.vue +8 -9
- package/src/shell/components/EditorTools.vue +1 -5
- package/src/shell/components/PaneTopbar.vue +393 -0
- package/src/shell/components/SelectionToolbar.vue +0 -2
- package/src/shell/components/WorkbenchContextMenus.vue +37 -26
- package/src/shell/components/WorkbenchModals.vue +22 -18
- package/src/shell/components/WorkbenchPanes.vue +358 -1512
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/pane-registry.ts +69 -0
- package/src/shell/use-surface-dismissal.ts +219 -0
- package/src/shell/use-workbench-commands.ts +599 -0
- package/src/shell/use-workbench-keybindings.ts +337 -0
- package/src/shell/use-workbench.ts +488 -1081
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +1 -1
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +71 -599
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +1 -1
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +163 -1345
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -11
- package/src/windows/AuxiliaryWindows.vue +2 -2
- package/src/windows/use-window-event-bridge.ts +152 -0
- package/src/workspace/components/TemplateLibrary.vue +1 -1
- package/src/workspace/components/WorkspaceIconPicker.vue +5 -4
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/assistant/locales/de-DE.json +0 -129
- package/src/assistant/locales/en-US.json +0 -129
- package/src/assistant/locales/es-ES.json +0 -129
- package/src/assistant/locales/ja-JP.json +0 -129
- package/src/assistant/locales/zh-CN.json +0 -129
- package/src/assistant/locales/zh-TW.json +0 -129
- package/src/assistant/task-prompts.json +0 -39
|
@@ -1,53 +1,32 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
2
|
+
import './calendar-shared.css';
|
|
3
|
+
import { computed, onMounted, onUnmounted, ref, shallowRef, useId } from 'vue';
|
|
4
|
+
import { X } from 'lucide-vue-next';
|
|
6
5
|
import LoadingSkeleton from '../../shell/components/LoadingSkeleton.vue';
|
|
7
6
|
import { t, uiLocale } from '../../i18n/i18n';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import type { WorkspaceObject } from '@tano/protocol';
|
|
7
|
+
import { useWindowContext } from '../../windows/context';
|
|
8
|
+
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
9
|
+
import { usePlanStore, type PlanScope } from '../../stores/plans';
|
|
12
10
|
import {
|
|
13
11
|
calendarDayEntries,
|
|
14
12
|
calendarEvents,
|
|
15
13
|
filterCalendarRecords,
|
|
16
|
-
hasEventTime,
|
|
17
|
-
isCheckableEvent,
|
|
18
|
-
isEventCompleted,
|
|
19
|
-
isEventOverdue,
|
|
20
14
|
localDayKey,
|
|
21
|
-
monthDays,
|
|
22
15
|
planningEvents,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
weekDays,
|
|
16
|
+
type CalendarFilter,
|
|
17
|
+
type CalendarViewMode,
|
|
26
18
|
} from '../calendar';
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
minutesFromOffsetY,
|
|
32
|
-
moveRecordToDay,
|
|
33
|
-
moveRecordToSlot,
|
|
34
|
-
PLAN_DRAG_MIME,
|
|
35
|
-
planDateFromSlot,
|
|
36
|
-
resizeRecordEnd,
|
|
37
|
-
selectionRangeFromOffsets,
|
|
38
|
-
snapMinutes,
|
|
39
|
-
} from '../calendar-interaction';
|
|
40
|
-
import { layoutDayTimedEvents } from '../timeline-layout';
|
|
41
|
-
import type { TimedEventBlock } from '../timeline-layout';
|
|
42
|
-
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
43
|
-
import { usePlanStore } from '../../stores/plans';
|
|
44
|
-
import type { PlanScope } from '../../stores/plans';
|
|
45
|
-
import { planKey, planSourceLabel, sourcePlanKey } from '../personal-plans';
|
|
46
|
-
import { expandRecurringPlans, isVirtualOccurrence } from '../recurrence';
|
|
47
|
-
import { writePlanDate } from '../plan-date';
|
|
48
|
-
import type { PlanDateValue } from '../plan-date';
|
|
49
|
-
import PlanDateField from './PlanDateField.vue';
|
|
19
|
+
import { expandRecurringPlans } from '../recurrence';
|
|
20
|
+
import { writePlanDate, type PlanDateValue } from '../plan-date';
|
|
21
|
+
import { useCalendarScroll } from '../composables/use-calendar-scroll';
|
|
22
|
+
import { useCalendarInteractions } from '../composables/use-calendar-interactions';
|
|
50
23
|
import CalendarDayPopover from './CalendarDayPopover.vue';
|
|
24
|
+
import CalendarFilterBar from './CalendarFilterBar.vue';
|
|
25
|
+
import CalendarQuickCreateDialog, { type QuickCreateDraft } from './CalendarQuickCreateDialog.vue';
|
|
26
|
+
import CalendarTimelineView from './CalendarTimelineView.vue';
|
|
27
|
+
import CalendarMonthView from './CalendarMonthView.vue';
|
|
28
|
+
import CalendarYearView from './CalendarYearView.vue';
|
|
29
|
+
import CalendarAgendaView from './CalendarAgendaView.vue';
|
|
51
30
|
|
|
52
31
|
const props = defineProps<{ date: Date; mode: CalendarViewMode; records?: ObjectRecord[]; loading?: boolean }>();
|
|
53
32
|
const emit = defineEmits<{
|
|
@@ -59,11 +38,11 @@ const emit = defineEmits<{
|
|
|
59
38
|
'visible-year': [date: Date];
|
|
60
39
|
'visible-timeline': [date: Date];
|
|
61
40
|
}>();
|
|
41
|
+
|
|
42
|
+
const { window } = useWindowContext();
|
|
62
43
|
const plans = usePlanStore();
|
|
63
44
|
const scroll = ref<HTMLElement>();
|
|
64
45
|
const filter = ref<CalendarFilter>({ kind: 'all', showCompleted: true, query: '' });
|
|
65
|
-
const pending = ref<string[]>([]);
|
|
66
|
-
const interactionError = ref('');
|
|
67
46
|
const nowMinutes = ref(currentMinutes());
|
|
68
47
|
let nowTimer: ReturnType<typeof setInterval> | undefined;
|
|
69
48
|
|
|
@@ -72,23 +51,42 @@ function currentMinutes() {
|
|
|
72
51
|
return now.getHours() * 60 + now.getMinutes();
|
|
73
52
|
}
|
|
74
53
|
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
54
|
+
const dayPopover = shallowRef<{ date: Date; anchor: HTMLElement; scrollTop: number; scrollLeft: number }>();
|
|
55
|
+
const dayPopoverId = useId();
|
|
56
|
+
const dayPopoverKey = computed(() => dayPopover.value && localDayKey(dayPopover.value.date));
|
|
57
|
+
|
|
58
|
+
const {
|
|
59
|
+
timeline,
|
|
60
|
+
timelineDays,
|
|
61
|
+
timelineDayWidth,
|
|
62
|
+
scrollingWeeks,
|
|
63
|
+
scrollingYears,
|
|
64
|
+
visibleWindow,
|
|
65
|
+
onCalendarScroll,
|
|
66
|
+
onCalendarWheel,
|
|
67
|
+
} = useCalendarScroll({
|
|
68
|
+
date: () => props.date,
|
|
69
|
+
mode: () => props.mode,
|
|
70
|
+
scroll,
|
|
71
|
+
window,
|
|
72
|
+
onVisibleMonth: (value) => emit('visible-month', value),
|
|
73
|
+
onVisibleYear: (value) => emit('visible-year', value),
|
|
74
|
+
onVisibleTimeline: (value) => emit('visible-timeline', value),
|
|
75
|
+
onSelectMode: (value) => emit('select-mode', value),
|
|
76
|
+
onBeforeViewChange: () => { dayPopover.value = undefined; },
|
|
77
|
+
onScrolled: () => {
|
|
78
|
+
if (
|
|
79
|
+
dayPopover.value &&
|
|
80
|
+
scroll.value &&
|
|
81
|
+
(dayPopover.value.scrollTop !== scroll.value.scrollTop ||
|
|
82
|
+
dayPopover.value.scrollLeft !== scroll.value.scrollLeft)
|
|
83
|
+
) {
|
|
84
|
+
dayPopover.value = undefined;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
91
87
|
});
|
|
88
|
+
|
|
89
|
+
const rawPlanned = computed(() => planningEvents(props.records ?? plans.records));
|
|
92
90
|
const expandedPlanned = computed(() =>
|
|
93
91
|
expandRecurringPlans(rawPlanned.value, visibleWindow.value[0], visibleWindow.value[1]),
|
|
94
92
|
);
|
|
@@ -101,90 +99,32 @@ const canCreate = computed(
|
|
|
101
99
|
() => typeof plans.create === 'function' && (canCreateWorkspace.value || canCreatePersonal.value),
|
|
102
100
|
);
|
|
103
101
|
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
const today = computed(() => localDayKey(new Date()));
|
|
103
|
+
const weekdays = computed(() =>
|
|
104
|
+
uiLocale.value === 'zh-CN'
|
|
105
|
+
? ['一', '二', '三', '四', '五', '六', '日']
|
|
106
|
+
: Array.from({ length: 7 }, (_, index) =>
|
|
107
|
+
new Intl.DateTimeFormat(uiLocale.value, { weekday: 'short' }).format(new Date(2024, 0, 1 + index)),
|
|
108
|
+
),
|
|
109
|
+
);
|
|
110
|
+
const viewLabel = computed(
|
|
111
|
+
() =>
|
|
112
|
+
({
|
|
113
|
+
day: t('日视图'),
|
|
114
|
+
'four-days': t('4 天视图'),
|
|
115
|
+
week: t('周视图'),
|
|
116
|
+
month: t('月视图'),
|
|
117
|
+
year: t('年视图'),
|
|
118
|
+
agenda: t('日程视图'),
|
|
119
|
+
})[props.mode],
|
|
108
120
|
);
|
|
109
|
-
// The all-day row is shared by every rendered day, including the buffered
|
|
110
|
-
// days off screen. Size it from the days in view so a busy day two weeks away
|
|
111
|
-
// does not leave a tall empty band; busier cells scroll inside themselves.
|
|
112
|
-
const BANNER_ITEM_HEIGHT = 22;
|
|
113
|
-
const BANNER_GAP = 3;
|
|
114
|
-
const bannerRowHeight = computed(() => {
|
|
115
|
-
const most = Math.max(0, ...visibleCalendarDays(props.date, props.mode).map((day) => bannerEntries(day).length));
|
|
116
|
-
// Show half of a fourth row so an overflowing cell reads as scrollable.
|
|
117
|
-
const rows = Math.min(3.5, Math.max(1, most));
|
|
118
|
-
return Math.round(12 + rows * BANNER_ITEM_HEIGHT + Math.max(0, Math.ceil(rows) - 1) * BANNER_GAP);
|
|
119
|
-
});
|
|
120
|
-
const dayPopover = shallowRef<{ date: Date; anchor: HTMLElement; scrollTop: number; scrollLeft: number }>();
|
|
121
|
-
const dayPopoverId = useId();
|
|
122
|
-
const dayPopoverKey = computed(() => dayPopover.value && localDayKey(dayPopover.value.date));
|
|
123
|
-
const dayPopoverEntries = (day: Date) => calendarDayEntries(planned.value, day);
|
|
124
|
-
|
|
125
|
-
function openDayPopover(day: Date, event: MouseEvent) {
|
|
126
|
-
dayPopover.value = dayPopoverKey.value === localDayKey(day)
|
|
127
|
-
? undefined
|
|
128
|
-
: {
|
|
129
|
-
date: day,
|
|
130
|
-
anchor: event.currentTarget as HTMLElement,
|
|
131
|
-
scrollTop: scroll.value?.scrollTop ?? 0,
|
|
132
|
-
scrollLeft: scroll.value?.scrollLeft ?? 0,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function canEditRecord(record: ObjectRecord) {
|
|
137
|
-
if (isVirtualOccurrence(record)) return false;
|
|
138
|
-
return typeof plans.canEdit === 'function' ? plans.canEdit(record) : false;
|
|
139
|
-
}
|
|
140
|
-
function canDragRecord(record: ObjectRecord) {
|
|
141
|
-
return (
|
|
142
|
-
canEditRecord(record) &&
|
|
143
|
-
typeof plans.update === 'function' &&
|
|
144
|
-
!pending.value.includes(planKey(record))
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
function canToggleComplete(record: ObjectRecord) {
|
|
148
|
-
return (
|
|
149
|
-
isCheckableEvent(record) &&
|
|
150
|
-
!isPlanCompletionLocked(record.object) &&
|
|
151
|
-
canEditRecord(record) &&
|
|
152
|
-
typeof plans.update === 'function' &&
|
|
153
|
-
!pending.value.includes(planKey(record))
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
async function updateRecordObject(record: ObjectRecord, next: WorkspaceObject) {
|
|
157
|
-
const key = planKey(record);
|
|
158
|
-
if (!canEditRecord(record) || typeof plans.update !== 'function' || pending.value.includes(key)) return;
|
|
159
|
-
pending.value.push(key);
|
|
160
|
-
interactionError.value = '';
|
|
161
|
-
try {
|
|
162
|
-
await plans.update(record, next);
|
|
163
|
-
} catch (reason) {
|
|
164
|
-
interactionError.value = String(reason);
|
|
165
|
-
} finally {
|
|
166
|
-
pending.value = pending.value.filter((id) => id !== key);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function toggleComplete(record: ObjectRecord) {
|
|
170
|
-
if (!canToggleComplete(record)) return;
|
|
171
|
-
return updateRecordObject(record, withPlanCompleted(record.object, !isEventCompleted(record)));
|
|
172
|
-
}
|
|
173
121
|
|
|
174
|
-
// ---
|
|
175
|
-
interface QuickCreateDraft {
|
|
176
|
-
name: string;
|
|
177
|
-
checkable: boolean;
|
|
178
|
-
planDate: PlanDateValue;
|
|
179
|
-
scope: PlanScope;
|
|
180
|
-
}
|
|
122
|
+
// --- Quick-Create State ---
|
|
181
123
|
const createDraft = ref<QuickCreateDraft>();
|
|
182
124
|
const createSaving = ref(false);
|
|
183
125
|
const createError = ref('');
|
|
184
|
-
const createNameInput = ref<HTMLInputElement>();
|
|
185
|
-
const createScopeId = useId();
|
|
186
126
|
|
|
187
|
-
|
|
127
|
+
function openQuickCreate(planDate: PlanDateValue, checkable = false) {
|
|
188
128
|
if (!canCreate.value || createSaving.value) return;
|
|
189
129
|
const preferred: PlanScope = plans.defaultScope === 'personal' ? 'personal' : 'workspace';
|
|
190
130
|
const scope: PlanScope =
|
|
@@ -193,14 +133,14 @@ async function openQuickCreate(planDate: PlanDateValue, checkable = false) {
|
|
|
193
133
|
: (canCreateWorkspace.value ? 'workspace' : 'personal');
|
|
194
134
|
createError.value = '';
|
|
195
135
|
createDraft.value = { name: '', checkable, planDate, scope };
|
|
196
|
-
await nextTick();
|
|
197
|
-
createNameInput.value?.focus();
|
|
198
136
|
}
|
|
137
|
+
|
|
199
138
|
function closeQuickCreate() {
|
|
200
139
|
if (createSaving.value) return;
|
|
201
140
|
createDraft.value = undefined;
|
|
202
141
|
createError.value = '';
|
|
203
142
|
}
|
|
143
|
+
|
|
204
144
|
async function submitQuickCreate() {
|
|
205
145
|
const draft = createDraft.value;
|
|
206
146
|
if (!draft || createSaving.value || !draft.name.trim() || typeof plans.create !== 'function') return;
|
|
@@ -227,651 +167,42 @@ async function submitQuickCreate() {
|
|
|
227
167
|
}
|
|
228
168
|
}
|
|
229
169
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
const slotSelect = ref<SlotSelection>();
|
|
239
|
-
const slotPreview = computed(() => {
|
|
240
|
-
if (!slotSelect.value) return undefined;
|
|
241
|
-
const range = selectionRangeFromOffsets(slotSelect.value.anchorY, slotSelect.value.currentY, hourHeight);
|
|
242
|
-
return {
|
|
243
|
-
dayKey: slotSelect.value.dayKey,
|
|
244
|
-
top: (range.startMinutes / 60) * hourHeight,
|
|
245
|
-
height: Math.max(22, ((range.endMinutes - range.startMinutes) / 60) * hourHeight),
|
|
246
|
-
label: `${formatMinutesLabel(range.startMinutes)} – ${formatMinutesLabel(range.endMinutes)}`,
|
|
247
|
-
...range,
|
|
248
|
-
};
|
|
170
|
+
const interactions = useCalendarInteractions({
|
|
171
|
+
plans,
|
|
172
|
+
records: () => props.records,
|
|
173
|
+
today,
|
|
174
|
+
canCreate,
|
|
175
|
+
window,
|
|
176
|
+
openQuickCreate,
|
|
249
177
|
});
|
|
250
178
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if (!slotSelect.value) return;
|
|
263
|
-
const rect = slotSelect.value.column.getBoundingClientRect();
|
|
264
|
-
slotSelect.value.currentY = Math.max(0, Math.min(rect.height || 24 * hourHeight, event.clientY - rect.top));
|
|
265
|
-
}
|
|
266
|
-
function cleanupSlotListeners() {
|
|
267
|
-
window.removeEventListener('pointermove', moveSlotSelection);
|
|
268
|
-
window.removeEventListener('pointerup', endSlotSelection);
|
|
269
|
-
window.removeEventListener('pointercancel', cancelSlotSelection);
|
|
270
|
-
}
|
|
271
|
-
function cancelSlotSelection() {
|
|
272
|
-
cleanupSlotListeners();
|
|
273
|
-
slotSelect.value = undefined;
|
|
274
|
-
}
|
|
275
|
-
function endSlotSelection() {
|
|
276
|
-
const current = slotSelect.value;
|
|
277
|
-
const preview = slotPreview.value;
|
|
278
|
-
cleanupSlotListeners();
|
|
279
|
-
slotSelect.value = undefined;
|
|
280
|
-
if (!current || !preview) return;
|
|
281
|
-
void openQuickCreate(planDateFromSlot(current.day, preview.startMinutes, preview.endMinutes), false);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// --- Direct Manipulation: Bottom-Edge Resize ---
|
|
285
|
-
interface ResizeState {
|
|
286
|
-
record: ObjectRecord;
|
|
287
|
-
key: string;
|
|
288
|
-
day: Date;
|
|
289
|
-
dayKey: string;
|
|
290
|
-
startY: number;
|
|
291
|
-
startMinutes: number;
|
|
292
|
-
initialEndMinutes: number;
|
|
293
|
-
previewEndMinutes: number;
|
|
294
|
-
}
|
|
295
|
-
const resizing = ref<ResizeState>();
|
|
296
|
-
|
|
297
|
-
function startResize(item: TimedEventBlock, day: Date, event: PointerEvent) {
|
|
298
|
-
if (event.button !== 0 || !canDragRecord(item.record) || item.point) return;
|
|
299
|
-
const dayStart = new Date(day.getFullYear(), day.getMonth(), day.getDate()).getTime();
|
|
300
|
-
const startMinutes = Math.max(0, Math.round((item.visibleStart - dayStart) / 60_000));
|
|
301
|
-
const initialEndMinutes = Math.max(startMinutes + MIN_DURATION_MINUTES, Math.round((item.visibleEnd - dayStart) / 60_000));
|
|
302
|
-
resizing.value = {
|
|
303
|
-
record: item.record,
|
|
304
|
-
key: planKey(item.record),
|
|
305
|
-
day,
|
|
306
|
-
dayKey: localDayKey(day),
|
|
307
|
-
startY: event.clientY,
|
|
308
|
-
startMinutes,
|
|
309
|
-
initialEndMinutes,
|
|
310
|
-
previewEndMinutes: initialEndMinutes,
|
|
311
|
-
};
|
|
312
|
-
window.addEventListener('pointermove', moveResize);
|
|
313
|
-
window.addEventListener('pointerup', endResize);
|
|
314
|
-
window.addEventListener('pointercancel', cancelResize);
|
|
315
|
-
}
|
|
316
|
-
function moveResize(event: PointerEvent) {
|
|
317
|
-
if (!resizing.value) return;
|
|
318
|
-
const deltaMinutes = ((event.clientY - resizing.value.startY) / hourHeight) * 60;
|
|
319
|
-
resizing.value.previewEndMinutes = Math.max(
|
|
320
|
-
resizing.value.startMinutes + MIN_DURATION_MINUTES,
|
|
321
|
-
Math.min(24 * 60, snapMinutes(resizing.value.initialEndMinutes + deltaMinutes)),
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
function cleanupResizeListeners() {
|
|
325
|
-
window.removeEventListener('pointermove', moveResize);
|
|
326
|
-
window.removeEventListener('pointerup', endResize);
|
|
327
|
-
window.removeEventListener('pointercancel', cancelResize);
|
|
328
|
-
}
|
|
329
|
-
function cancelResize() {
|
|
330
|
-
cleanupResizeListeners();
|
|
331
|
-
resizing.value = undefined;
|
|
332
|
-
}
|
|
333
|
-
function endResize() {
|
|
334
|
-
const state = resizing.value;
|
|
335
|
-
cleanupResizeListeners();
|
|
336
|
-
resizing.value = undefined;
|
|
337
|
-
if (!state || state.previewEndMinutes === state.initialEndMinutes) return;
|
|
338
|
-
const next = resizeRecordEnd(state.record.object, state.day, state.previewEndMinutes);
|
|
339
|
-
void updateRecordObject(state.record, next);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
// --- Direct Manipulation: Drag Move & Sidebar Drop Timeblocking ---
|
|
343
|
-
const draggingKey = ref<string>();
|
|
344
|
-
const dropTarget = ref<{ zone: 'timeline' | 'day'; dayKey: string; minutes?: number }>();
|
|
345
|
-
|
|
346
|
-
function allEditablePool(): readonly ObjectRecord[] {
|
|
347
|
-
const fromStore = typeof plans.recordsFor === 'function' ? plans.recordsFor('all') : [];
|
|
348
|
-
if (fromStore.length) return fromStore;
|
|
349
|
-
return props.records ?? plans.records;
|
|
350
|
-
}
|
|
351
|
-
function resolveDraggedRecord(event: DragEvent): ObjectRecord | undefined {
|
|
352
|
-
const key = event.dataTransfer?.getData(PLAN_DRAG_MIME) || draggingKey.value;
|
|
353
|
-
if (!key) return undefined;
|
|
354
|
-
return allEditablePool().find((record) => planKey(record) === key);
|
|
355
|
-
}
|
|
356
|
-
function hasPlanDrag(event: DragEvent) {
|
|
357
|
-
const types = event.dataTransfer?.types;
|
|
358
|
-
return Boolean(draggingKey.value || (types && [...types].includes(PLAN_DRAG_MIME)));
|
|
359
|
-
}
|
|
360
|
-
function onEventDragStart(record: ObjectRecord, event: DragEvent) {
|
|
361
|
-
if (!canDragRecord(record) || !event.dataTransfer) {
|
|
362
|
-
event.preventDefault();
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
const key = planKey(record);
|
|
366
|
-
draggingKey.value = key;
|
|
367
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
368
|
-
event.dataTransfer.setData(PLAN_DRAG_MIME, key);
|
|
369
|
-
event.dataTransfer.setData('text/plain', record.object.name);
|
|
370
|
-
}
|
|
371
|
-
function onEventDragEnd() {
|
|
372
|
-
draggingKey.value = undefined;
|
|
373
|
-
dropTarget.value = undefined;
|
|
374
|
-
}
|
|
375
|
-
function onTimelineDragOver(day: Date, event: DragEvent) {
|
|
376
|
-
if (!hasPlanDrag(event)) return;
|
|
377
|
-
event.preventDefault();
|
|
378
|
-
if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';
|
|
379
|
-
const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();
|
|
380
|
-
const minutes = minutesFromOffsetY(event.clientY - rect.top, hourHeight);
|
|
381
|
-
dropTarget.value = { zone: 'timeline', dayKey: localDayKey(day), minutes };
|
|
382
|
-
}
|
|
383
|
-
function onTimelineDrop(day: Date, event: DragEvent) {
|
|
384
|
-
const record = resolveDraggedRecord(event);
|
|
385
|
-
const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();
|
|
386
|
-
const minutes = minutesFromOffsetY(event.clientY - rect.top, hourHeight);
|
|
387
|
-
draggingKey.value = undefined;
|
|
388
|
-
dropTarget.value = undefined;
|
|
389
|
-
if (!record || !canDragRecord(record)) return;
|
|
390
|
-
const next = moveRecordToSlot(record.object, day, minutes);
|
|
391
|
-
void updateRecordObject(record, next);
|
|
392
|
-
}
|
|
393
|
-
function onDayDragOver(day: Date, event: DragEvent) {
|
|
394
|
-
if (!hasPlanDrag(event)) return;
|
|
395
|
-
event.preventDefault();
|
|
396
|
-
if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';
|
|
397
|
-
dropTarget.value = { zone: 'day', dayKey: localDayKey(day) };
|
|
398
|
-
}
|
|
399
|
-
function onDayDrop(day: Date, event: DragEvent) {
|
|
400
|
-
const record = resolveDraggedRecord(event);
|
|
401
|
-
draggingKey.value = undefined;
|
|
402
|
-
dropTarget.value = undefined;
|
|
403
|
-
if (!record || !canDragRecord(record)) return;
|
|
404
|
-
const next = moveRecordToDay(record.object, day);
|
|
405
|
-
void updateRecordObject(record, next);
|
|
406
|
-
}
|
|
407
|
-
function onDragLeave(event: DragEvent) {
|
|
408
|
-
const related = event.relatedTarget as Node | null;
|
|
409
|
-
if (!related || !(event.currentTarget as HTMLElement).contains(related)) {
|
|
410
|
-
dropTarget.value = undefined;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function itemClasses(record: ObjectRecord, kind?: CalendarDayEntry['kind']) {
|
|
415
|
-
const checkable = isCheckableEvent(record);
|
|
416
|
-
const completed = isEventCompleted(record);
|
|
417
|
-
const overdue = isEventOverdue(record, today.value);
|
|
418
|
-
return {
|
|
419
|
-
'is-task': checkable,
|
|
420
|
-
'is-schedule': !checkable,
|
|
421
|
-
'is-completed': completed,
|
|
422
|
-
'is-overdue': overdue,
|
|
423
|
-
'is-due': kind === 'due',
|
|
424
|
-
'is-timed': kind === 'timed',
|
|
425
|
-
'is-personal': record.source?.scope === 'personal',
|
|
426
|
-
'is-synced': !!record.object.properties.syncConnection,
|
|
427
|
-
'is-draggable': kind !== 'due' && canDragRecord(record),
|
|
428
|
-
'is-dragging': draggingKey.value === planKey(record),
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const timeline = computed(() => props.mode === 'day' || props.mode === 'four-days' || props.mode === 'week');
|
|
433
|
-
const timelineDays = ref<Date[]>([]);
|
|
434
|
-
const timelineDayWidth = ref(120);
|
|
435
|
-
const timelineVisibleCount = computed(() => props.mode === 'week' ? 7 : props.mode === 'four-days' ? 4 : 1);
|
|
436
|
-
const scrollingWeeks = ref<Date[]>([]);
|
|
437
|
-
const scrollingYears = ref<number[]>([]);
|
|
438
|
-
const monthsForYear = (year: number) => Array.from({ length: 12 }, (_, month) => {
|
|
439
|
-
const date = new Date(year, month, 1);
|
|
440
|
-
return { date, days: monthDays(date) };
|
|
441
|
-
});
|
|
442
|
-
const agendaDates = computed(() => {
|
|
443
|
-
const year = props.date.getFullYear();
|
|
444
|
-
const month = props.date.getMonth();
|
|
445
|
-
const length = new Date(year, month + 1, 0).getDate();
|
|
446
|
-
return Array.from({ length }, (_, index) => new Date(year, month, index + 1))
|
|
447
|
-
.filter((day) => dayEntries(day).length > 0);
|
|
448
|
-
});
|
|
449
|
-
const weekdays = computed(() => uiLocale.value === 'zh-CN' ? ['一', '二', '三', '四', '五', '六', '日']
|
|
450
|
-
: Array.from({ length: 7 }, (_, index) => new Intl.DateTimeFormat(uiLocale.value, { weekday: 'short' }).format(new Date(2024, 0, 1 + index))));
|
|
451
|
-
const hours = Array.from({ length: 24 }, (_, hour) => hour);
|
|
452
|
-
const hourHeight = 56;
|
|
453
|
-
const today = computed(() => localDayKey(new Date()));
|
|
454
|
-
const nowLineTop = computed(() => `${(nowMinutes.value / 60) * hourHeight}px`);
|
|
455
|
-
const viewLabel = computed(() => ({
|
|
456
|
-
day: t('日视图'), 'four-days': t('4 天视图'), week: t('周视图'),
|
|
457
|
-
month: t('月视图'), year: t('年视图'), agenda: t('日程视图'),
|
|
458
|
-
})[props.mode]);
|
|
459
|
-
const monthKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}`;
|
|
460
|
-
const weekKey = localDayKey;
|
|
461
|
-
const weekOffset = (date: Date, weeks: number) =>
|
|
462
|
-
new Date(date.getFullYear(), date.getMonth(), date.getDate() + weeks * 7);
|
|
463
|
-
let reportedMonthKey = '';
|
|
464
|
-
let extendingWeeks = false;
|
|
465
|
-
let reportedYear: number | undefined;
|
|
466
|
-
let extendingYears = false;
|
|
467
|
-
let positioningYear = false;
|
|
468
|
-
let reportedTimelineKey = '';
|
|
469
|
-
let extendingTimeline = false;
|
|
470
|
-
let positioningTimeline = false;
|
|
471
|
-
let timelineResizeObserver: ResizeObserver | undefined;
|
|
472
|
-
|
|
473
|
-
const dayOffset = (date: Date, days: number) =>
|
|
474
|
-
new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
475
|
-
|
|
476
|
-
function fillTimelineDays(date: Date) {
|
|
477
|
-
const first = visibleCalendarDays(date, props.mode)[0]!;
|
|
478
|
-
timelineDays.value = Array.from({ length: 42 }, (_, index) => dayOffset(first, index - 14));
|
|
479
|
-
}
|
|
480
|
-
async function scrollToTimelineDate(date: Date) {
|
|
481
|
-
positioningTimeline = true;
|
|
482
|
-
const first = visibleCalendarDays(date, props.mode)[0]!;
|
|
483
|
-
let index = timelineDays.value.findIndex(day => localDayKey(day) === localDayKey(first));
|
|
484
|
-
if (index < 0) {
|
|
485
|
-
fillTimelineDays(date);
|
|
486
|
-
index = 14;
|
|
487
|
-
}
|
|
488
|
-
await nextTick();
|
|
489
|
-
if (scroll.value) scroll.value.scrollLeft = index * timelineDayWidth.value;
|
|
490
|
-
positioningTimeline = false;
|
|
491
|
-
}
|
|
492
|
-
async function extendTimelineDays(direction: -1 | 1) {
|
|
493
|
-
const container = scroll.value;
|
|
494
|
-
if (extendingTimeline || !container || !timelineDays.value.length) return;
|
|
495
|
-
extendingTimeline = true;
|
|
496
|
-
const width = timelineDayWidth.value;
|
|
497
|
-
const anchorIndex = Math.min(timelineDays.value.length - 1, Math.floor(container.scrollLeft / width));
|
|
498
|
-
const anchorKey = localDayKey(timelineDays.value[anchorIndex]!);
|
|
499
|
-
const anchorOffset = container.scrollLeft - anchorIndex * width;
|
|
500
|
-
const edge = direction < 0 ? timelineDays.value[0]! : timelineDays.value.at(-1)!;
|
|
501
|
-
const additions = Array.from({ length: 14 }, (_, index) => dayOffset(edge, direction * (index + 1)));
|
|
502
|
-
const expanded = direction < 0
|
|
503
|
-
? [...additions.reverse(), ...timelineDays.value]
|
|
504
|
-
: [...timelineDays.value, ...additions];
|
|
505
|
-
timelineDays.value = direction < 0 ? expanded.slice(0, 70) : expanded.slice(-70);
|
|
506
|
-
await nextTick();
|
|
507
|
-
const retainedIndex = timelineDays.value.findIndex(day => localDayKey(day) === anchorKey);
|
|
508
|
-
if (retainedIndex >= 0) container.scrollLeft = retainedIndex * width + anchorOffset;
|
|
509
|
-
extendingTimeline = false;
|
|
510
|
-
}
|
|
511
|
-
function onTimelineScroll() {
|
|
512
|
-
const container = scroll.value;
|
|
513
|
-
if (!timeline.value || !container || !timelineDays.value.length || positioningTimeline || extendingTimeline) return;
|
|
514
|
-
const width = timelineDayWidth.value;
|
|
515
|
-
const index = Math.min(timelineDays.value.length - 1, Math.max(0, Math.round(container.scrollLeft / width)));
|
|
516
|
-
const visible = timelineDays.value[index]!;
|
|
517
|
-
const date = visibleCalendarDays(visible, props.mode)[0]!;
|
|
518
|
-
const key = localDayKey(date);
|
|
519
|
-
if (key !== localDayKey(visibleCalendarDays(props.date, props.mode)[0]!)) {
|
|
520
|
-
reportedTimelineKey = key;
|
|
521
|
-
emit('visible-timeline', date);
|
|
522
|
-
}
|
|
523
|
-
const edgeDistance = Math.max(container.clientWidth, width * 2);
|
|
524
|
-
if (container.scrollLeft < edgeDistance)
|
|
525
|
-
void extendTimelineDays(-1);
|
|
526
|
-
else if (container.scrollWidth - container.scrollLeft - container.clientWidth < edgeDistance)
|
|
527
|
-
void extendTimelineDays(1);
|
|
528
|
-
}
|
|
529
|
-
const zoomModes: CalendarViewMode[] = ['day', 'four-days', 'week', 'month', 'year'];
|
|
530
|
-
let zoomDelta = 0;
|
|
531
|
-
let lastZoomWheel = -Infinity;
|
|
532
|
-
let lastZoomChange = -Infinity;
|
|
533
|
-
function onCalendarWheel(event: WheelEvent) {
|
|
534
|
-
if (event.ctrlKey) {
|
|
535
|
-
// Keep browser zoom disabled here, even at the smallest/largest calendar scale.
|
|
536
|
-
event.preventDefault();
|
|
537
|
-
event.stopPropagation();
|
|
538
|
-
if (!event.deltaY || Math.abs(event.deltaX) > Math.abs(event.deltaY)) return;
|
|
539
|
-
const now = performance.now();
|
|
540
|
-
if (now - lastZoomWheel > 200 || Math.sign(zoomDelta) !== Math.sign(event.deltaY)) zoomDelta = 0;
|
|
541
|
-
lastZoomWheel = now;
|
|
542
|
-
if (now - lastZoomChange < 200) return;
|
|
543
|
-
const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? scroll.value?.clientHeight || 800 : 1;
|
|
544
|
-
zoomDelta += event.deltaY * unit;
|
|
545
|
-
if (Math.abs(zoomDelta) < 40) return;
|
|
546
|
-
// The agenda lists one month, so zoom from the same scale as the month grid.
|
|
547
|
-
const index = zoomModes.indexOf(props.mode === 'agenda' ? 'month' : props.mode);
|
|
548
|
-
const mode = zoomModes[Math.max(0, Math.min(zoomModes.length - 1, index + Math.sign(zoomDelta)))]!;
|
|
549
|
-
zoomDelta = 0;
|
|
550
|
-
if (mode !== props.mode) {
|
|
551
|
-
lastZoomChange = now;
|
|
552
|
-
emit('select-mode', mode);
|
|
553
|
-
}
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
zoomDelta = 0;
|
|
557
|
-
if (!timeline.value || !event.shiftKey || !scroll.value) return;
|
|
558
|
-
event.preventDefault();
|
|
559
|
-
const delta = Math.abs(event.deltaX) > Math.abs(event.deltaY) ? event.deltaX : event.deltaY;
|
|
560
|
-
scroll.value.scrollLeft += delta * Math.max(1, timelineDayWidth.value / 360);
|
|
561
|
-
}
|
|
562
|
-
async function resizeTimeline() {
|
|
563
|
-
const container = scroll.value;
|
|
564
|
-
if (!timeline.value || !container) return;
|
|
565
|
-
const width = Math.max(90, (container.clientWidth - 64) / timelineVisibleCount.value);
|
|
566
|
-
if (Math.abs(width - timelineDayWidth.value) < 0.5) return;
|
|
567
|
-
const dayPosition = container.scrollLeft / timelineDayWidth.value;
|
|
568
|
-
positioningTimeline = true;
|
|
569
|
-
timelineDayWidth.value = width;
|
|
570
|
-
await nextTick();
|
|
571
|
-
container.scrollLeft = dayPosition * width;
|
|
572
|
-
positioningTimeline = false;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
function fillWeeks(date: Date) {
|
|
576
|
-
const monday = weekDays(date)[0]!;
|
|
577
|
-
scrollingWeeks.value = Array.from({ length: 37 }, (_, index) => weekOffset(monday, index - 18));
|
|
578
|
-
}
|
|
579
|
-
function weekRow(date: Date) {
|
|
580
|
-
const key = weekKey(weekDays(date)[0]!);
|
|
581
|
-
return [...scroll.value?.querySelectorAll<HTMLElement>('.calendar-month-week') ?? []]
|
|
582
|
-
.find(row => row.dataset.week === key);
|
|
583
|
-
}
|
|
584
|
-
async function scrollToWeek(date: Date) {
|
|
585
|
-
// Month navigation lands on the week holding the 1st, so the whole month is
|
|
586
|
-
// in view and the dominant-month check in onMonthScroll agrees with it.
|
|
587
|
-
const monthStart = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
588
|
-
const key = weekKey(weekDays(monthStart)[0]!);
|
|
589
|
-
if (!scrollingWeeks.value.some(week => weekKey(week) === key)) fillWeeks(monthStart);
|
|
590
|
-
await nextTick();
|
|
591
|
-
const container = scroll.value;
|
|
592
|
-
const row = weekRow(monthStart);
|
|
593
|
-
if (!container || !row) return;
|
|
594
|
-
container.scrollTop += row.getBoundingClientRect().top - container.getBoundingClientRect().top - 40;
|
|
595
|
-
}
|
|
596
|
-
async function extendWeeks(direction: -1 | 1) {
|
|
597
|
-
if (extendingWeeks || !scroll.value || !scrollingWeeks.value.length) return;
|
|
598
|
-
extendingWeeks = true;
|
|
599
|
-
const container = scroll.value;
|
|
600
|
-
const anchor = [...container.querySelectorAll<HTMLElement>('.calendar-month-week')]
|
|
601
|
-
.find(row => row.getBoundingClientRect().bottom > container.getBoundingClientRect().top + 80);
|
|
602
|
-
const anchorKey = anchor?.dataset.week;
|
|
603
|
-
const anchorTop = anchor?.getBoundingClientRect().top;
|
|
604
|
-
const edge = direction < 0 ? scrollingWeeks.value[0]! : scrollingWeeks.value.at(-1)!;
|
|
605
|
-
const additions = Array.from({ length: 8 }, (_, index) => weekOffset(edge, direction * (index + 1)));
|
|
606
|
-
const expanded = direction < 0
|
|
607
|
-
? [...additions.reverse(), ...scrollingWeeks.value]
|
|
608
|
-
: [...scrollingWeeks.value, ...additions];
|
|
609
|
-
scrollingWeeks.value = direction < 0 ? expanded.slice(0, 85) : expanded.slice(-85);
|
|
610
|
-
await nextTick();
|
|
611
|
-
const retained = [...container.querySelectorAll<HTMLElement>('.calendar-month-week')]
|
|
612
|
-
.find(row => row.dataset.week === anchorKey);
|
|
613
|
-
if (retained && anchorTop !== undefined)
|
|
614
|
-
container.scrollTop += retained.getBoundingClientRect().top - anchorTop;
|
|
615
|
-
extendingWeeks = false;
|
|
616
|
-
}
|
|
617
|
-
function onMonthScroll() {
|
|
618
|
-
const container = scroll.value;
|
|
619
|
-
if (props.mode !== 'month' || !container || !scrollingWeeks.value.length || extendingWeeks) return;
|
|
620
|
-
// The month in view is the one with the most on-screen day area. A week that
|
|
621
|
-
// straddles two months no longer decides it on its own.
|
|
622
|
-
const bounds = container.getBoundingClientRect();
|
|
623
|
-
const viewTop = bounds.top + (container.querySelector<HTMLElement>('.calendar-month-weekdays')?.offsetHeight ?? 0);
|
|
624
|
-
const area = new Map<string, { month: Date; size: number }>();
|
|
625
|
-
for (const row of container.querySelectorAll<HTMLElement>('.calendar-month-week')) {
|
|
626
|
-
const rect = row.getBoundingClientRect();
|
|
627
|
-
const size = Math.min(rect.bottom, bounds.bottom) - Math.max(rect.top, viewTop);
|
|
628
|
-
if (size <= 0) continue;
|
|
629
|
-
const week = scrollingWeeks.value.find(item => weekKey(item) === row.dataset.week);
|
|
630
|
-
if (!week) continue;
|
|
631
|
-
for (const day of weekDays(week)) {
|
|
632
|
-
const key = monthKey(day);
|
|
633
|
-
const entry = area.get(key) ?? { month: day, size: 0 };
|
|
634
|
-
entry.size += size;
|
|
635
|
-
area.set(key, entry);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
// A little hysteresis keeps the label from flickering when two months
|
|
639
|
-
// share the screen almost evenly.
|
|
640
|
-
let visibleMonth: Date | undefined;
|
|
641
|
-
let best = (area.get(monthKey(props.date))?.size ?? 0) * 1.15;
|
|
642
|
-
for (const { month, size } of area.values())
|
|
643
|
-
if (size > best) { best = size; visibleMonth = month; }
|
|
644
|
-
if (visibleMonth && monthKey(visibleMonth) !== monthKey(props.date)) {
|
|
645
|
-
reportedMonthKey = monthKey(visibleMonth);
|
|
646
|
-
emit('visible-month', new Date(visibleMonth.getFullYear(), visibleMonth.getMonth(), 1));
|
|
647
|
-
}
|
|
648
|
-
if (container.scrollTop < container.clientHeight)
|
|
649
|
-
void extendWeeks(-1);
|
|
650
|
-
else if (container.scrollHeight - container.scrollTop - container.clientHeight < container.clientHeight)
|
|
651
|
-
void extendWeeks(1);
|
|
652
|
-
}
|
|
653
|
-
function fillYears(date: Date) {
|
|
654
|
-
const year = date.getFullYear();
|
|
655
|
-
scrollingYears.value = [year - 1, year, year + 1];
|
|
656
|
-
}
|
|
657
|
-
function yearSection(year: number) {
|
|
658
|
-
return [...scroll.value?.querySelectorAll<HTMLElement>('.calendar-year-section') ?? []]
|
|
659
|
-
.find(section => Number(section.dataset.year) === year);
|
|
660
|
-
}
|
|
661
|
-
async function scrollToYear(date: Date) {
|
|
662
|
-
const year = date.getFullYear();
|
|
663
|
-
positioningYear = true;
|
|
664
|
-
if (!scrollingYears.value.includes(year)) fillYears(date);
|
|
665
|
-
await nextTick();
|
|
666
|
-
const container = scroll.value;
|
|
667
|
-
const section = yearSection(year);
|
|
668
|
-
if (container && section)
|
|
669
|
-
container.scrollTop += section.getBoundingClientRect().top - container.getBoundingClientRect().top - 12;
|
|
670
|
-
positioningYear = false;
|
|
671
|
-
}
|
|
672
|
-
async function extendYears(direction: -1 | 1) {
|
|
673
|
-
if (extendingYears || !scroll.value || !scrollingYears.value.length) return;
|
|
674
|
-
extendingYears = true;
|
|
675
|
-
const container = scroll.value;
|
|
676
|
-
const anchor = [...container.querySelectorAll<HTMLElement>('.calendar-year-section')]
|
|
677
|
-
.find(section => section.getBoundingClientRect().bottom > container.getBoundingClientRect().top + 60);
|
|
678
|
-
const anchorYear = Number(anchor?.dataset.year);
|
|
679
|
-
const anchorTop = anchor?.getBoundingClientRect().top;
|
|
680
|
-
const nextYear = direction < 0 ? scrollingYears.value[0]! - 1 : scrollingYears.value.at(-1)! + 1;
|
|
681
|
-
const expanded = direction < 0
|
|
682
|
-
? [nextYear, ...scrollingYears.value]
|
|
683
|
-
: [...scrollingYears.value, nextYear];
|
|
684
|
-
scrollingYears.value = direction < 0 ? expanded.slice(0, 5) : expanded.slice(-5);
|
|
685
|
-
await nextTick();
|
|
686
|
-
const retained = yearSection(anchorYear);
|
|
687
|
-
if (retained && anchorTop !== undefined)
|
|
688
|
-
container.scrollTop += retained.getBoundingClientRect().top - anchorTop;
|
|
689
|
-
extendingYears = false;
|
|
690
|
-
}
|
|
691
|
-
function onYearScroll() {
|
|
692
|
-
const container = scroll.value;
|
|
693
|
-
if (props.mode !== 'year' || !container || !scrollingYears.value.length || extendingYears || positioningYear) return;
|
|
694
|
-
const marker = container.getBoundingClientRect().top + 60;
|
|
695
|
-
const section = [...container.querySelectorAll<HTMLElement>('.calendar-year-section')]
|
|
696
|
-
.find(element => element.getBoundingClientRect().bottom > marker);
|
|
697
|
-
const year = Number(section?.dataset.year);
|
|
698
|
-
if (section && year !== props.date.getFullYear()) {
|
|
699
|
-
reportedYear = year;
|
|
700
|
-
emit('visible-year', shiftCalendarDate(props.date, 'year', year - props.date.getFullYear()));
|
|
701
|
-
}
|
|
702
|
-
const edgeDistance = Math.min(400, container.clientHeight / 2);
|
|
703
|
-
if (container.scrollTop < edgeDistance)
|
|
704
|
-
void extendYears(-1);
|
|
705
|
-
else if (container.scrollHeight - container.scrollTop - container.clientHeight < edgeDistance)
|
|
706
|
-
void extendYears(1);
|
|
707
|
-
}
|
|
708
|
-
function onCalendarScroll() {
|
|
709
|
-
// Focusing a date can queue a scroll event before its click opens the panel.
|
|
710
|
-
// Only dismiss for a scroll that actually moves the calendar after opening.
|
|
711
|
-
if (dayPopover.value && scroll.value && (
|
|
712
|
-
dayPopover.value.scrollTop !== scroll.value.scrollTop || dayPopover.value.scrollLeft !== scroll.value.scrollLeft
|
|
713
|
-
)) dayPopover.value = undefined;
|
|
714
|
-
if (timeline.value) onTimelineScroll();
|
|
715
|
-
else if (props.mode === 'month') onMonthScroll();
|
|
716
|
-
else if (props.mode === 'year') onYearScroll();
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// Alternate months get a faint fill. Keep it clearly lighter than the sidebar
|
|
720
|
-
// (--sidebar) so the first column never reads as part of it.
|
|
721
|
-
function monthShade(day: Date) {
|
|
722
|
-
return (day.getFullYear() * 12 + day.getMonth()) % 2 === 1;
|
|
179
|
+
const dayPopoverEntries = (day: Date) => calendarDayEntries(planned.value, day);
|
|
180
|
+
function openDayPopover(day: Date, event: MouseEvent) {
|
|
181
|
+
dayPopover.value =
|
|
182
|
+
dayPopoverKey.value === localDayKey(day)
|
|
183
|
+
? undefined
|
|
184
|
+
: {
|
|
185
|
+
date: day,
|
|
186
|
+
anchor: event.currentTarget as HTMLElement,
|
|
187
|
+
scrollTop: scroll.value?.scrollTop ?? 0,
|
|
188
|
+
scrollLeft: scroll.value?.scrollLeft ?? 0,
|
|
189
|
+
};
|
|
723
190
|
}
|
|
724
191
|
|
|
725
|
-
function dayEntries(day: Date) {
|
|
726
|
-
return calendarDayEntries(planned.value, day);
|
|
727
|
-
}
|
|
728
|
-
function clockLabel(value: unknown) {
|
|
729
|
-
return new Date(String(value)).toLocaleTimeString(uiLocale.value, { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
730
|
-
}
|
|
731
|
-
function timedEvents(day: Date) {
|
|
732
|
-
return layoutDayTimedEvents(events.value, day, hourHeight).map((block) => {
|
|
733
|
-
const { start, end } = block.record.object.properties;
|
|
734
|
-
const time = entryTime({ record: block.record, kind: 'timed' });
|
|
735
|
-
return {
|
|
736
|
-
...block,
|
|
737
|
-
time: block.point || !end || Date.parse(String(end)) === Date.parse(String(start))
|
|
738
|
-
? time
|
|
739
|
-
: `${time} – ${clockLabel(end)}`,
|
|
740
|
-
// Short blocks put the time beside the title instead of below it.
|
|
741
|
-
compact: !block.point && block.height < 44,
|
|
742
|
-
};
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
function timedEventStyle(item: TimedEventBlock, day: Date) {
|
|
746
|
-
const widthPct = 100 / item.columnCount;
|
|
747
|
-
const leftPct = item.column * widthPct;
|
|
748
|
-
let height = item.height;
|
|
749
|
-
if (resizing.value && resizing.value.key === planKey(item.record) && resizing.value.dayKey === localDayKey(day)) {
|
|
750
|
-
height = Math.max(22, ((resizing.value.previewEndMinutes - resizing.value.startMinutes) / 60) * hourHeight);
|
|
751
|
-
}
|
|
752
|
-
return {
|
|
753
|
-
top: `${item.top}px`,
|
|
754
|
-
height: `${height}px`,
|
|
755
|
-
left: `calc(${leftPct}% + 2px)`,
|
|
756
|
-
width: `calc(${widthPct}% - 4px)`,
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
function entryTime(entry: CalendarDayEntry) {
|
|
760
|
-
if (entry.kind === 'due') return t('截止');
|
|
761
|
-
const { record } = entry;
|
|
762
|
-
if (record.object.properties.allDay === true) return t('全天');
|
|
763
|
-
if (!hasEventTime(record)) return t('仅日期');
|
|
764
|
-
return new Date(String(record.object.properties.start)).toLocaleTimeString(uiLocale.value, {
|
|
765
|
-
hour: '2-digit', minute: '2-digit', hour12: false,
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
function entryTooltip(entry: CalendarDayEntry, time = entryTime(entry)) {
|
|
769
|
-
const suffix = isEventOverdue(entry.record, today.value)
|
|
770
|
-
? ` · ${t('逾期')}`
|
|
771
|
-
: isEventCompleted(entry.record)
|
|
772
|
-
? t(' · 已完成')
|
|
773
|
-
: '';
|
|
774
|
-
return `${entry.record.object.name} · ${time} · ${planSourceLabel(entry.record)}${suffix}`;
|
|
775
|
-
}
|
|
776
|
-
function weekday(day: Date) {
|
|
777
|
-
return weekdays.value[(day.getDay() + 6) % 7];
|
|
778
|
-
}
|
|
779
|
-
async function positionTimeline() {
|
|
780
|
-
await nextTick();
|
|
781
|
-
if (!timeline.value && scroll.value) scroll.value.scrollLeft = 0;
|
|
782
|
-
if (timeline.value) {
|
|
783
|
-
const container = scroll.value;
|
|
784
|
-
if (!container) return;
|
|
785
|
-
timelineDayWidth.value = Math.max(90, (container.clientWidth - 64) / timelineVisibleCount.value);
|
|
786
|
-
fillTimelineDays(props.date);
|
|
787
|
-
await scrollToTimelineDate(props.date);
|
|
788
|
-
container.scrollTop = hourHeight * 7;
|
|
789
|
-
} else if (props.mode === 'month') {
|
|
790
|
-
fillWeeks(props.date);
|
|
791
|
-
await scrollToWeek(props.date);
|
|
792
|
-
} else if (props.mode === 'year') {
|
|
793
|
-
fillYears(props.date);
|
|
794
|
-
await scrollToYear(props.date);
|
|
795
|
-
} else if (scroll.value) scroll.value.scrollTop = 0;
|
|
796
|
-
}
|
|
797
192
|
onMounted(() => {
|
|
798
|
-
void positionTimeline();
|
|
799
193
|
nowTimer = setInterval(() => { nowMinutes.value = currentMinutes(); }, 60_000);
|
|
800
|
-
if (scroll.value && typeof ResizeObserver !== 'undefined') {
|
|
801
|
-
timelineResizeObserver = new ResizeObserver(() => { void resizeTimeline(); });
|
|
802
|
-
timelineResizeObserver.observe(scroll.value);
|
|
803
|
-
}
|
|
804
194
|
});
|
|
805
195
|
onUnmounted(() => {
|
|
806
196
|
if (nowTimer) clearInterval(nowTimer);
|
|
807
|
-
cleanupSlotListeners();
|
|
808
|
-
cleanupResizeListeners();
|
|
809
|
-
timelineResizeObserver?.disconnect();
|
|
810
|
-
});
|
|
811
|
-
watch(() => props.mode, () => {
|
|
812
|
-
dayPopover.value = undefined;
|
|
813
|
-
void positionTimeline();
|
|
814
|
-
});
|
|
815
|
-
watch(() => props.date, (date) => {
|
|
816
|
-
dayPopover.value = undefined;
|
|
817
|
-
if (props.mode === 'month') {
|
|
818
|
-
if (reportedMonthKey === monthKey(date)) {
|
|
819
|
-
reportedMonthKey = '';
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
void scrollToWeek(date);
|
|
823
|
-
} else if (props.mode === 'year') {
|
|
824
|
-
if (reportedYear === date.getFullYear()) {
|
|
825
|
-
reportedYear = undefined;
|
|
826
|
-
return;
|
|
827
|
-
}
|
|
828
|
-
void scrollToYear(date);
|
|
829
|
-
} else if (timeline.value) {
|
|
830
|
-
const key = localDayKey(visibleCalendarDays(date, props.mode)[0]!);
|
|
831
|
-
if (reportedTimelineKey === key) {
|
|
832
|
-
reportedTimelineKey = '';
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
void scrollToTimelineDate(date);
|
|
836
|
-
}
|
|
837
197
|
});
|
|
838
|
-
|
|
839
198
|
</script>
|
|
840
199
|
|
|
841
200
|
<template>
|
|
842
201
|
<div class="calendar-shell">
|
|
843
|
-
<
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
{ value: 'all', label: t('全部') },
|
|
848
|
-
{ value: 'task', label: t('任务') },
|
|
849
|
-
{ value: 'event', label: t('日程') },
|
|
850
|
-
] as const)"
|
|
851
|
-
:key="option.value"
|
|
852
|
-
type="button"
|
|
853
|
-
:aria-pressed="filter.kind === option.value"
|
|
854
|
-
@click="filter.kind = option.value"
|
|
855
|
-
>{{ option.label }}</button>
|
|
856
|
-
</div>
|
|
857
|
-
<label class="calendar-filter-completed">
|
|
858
|
-
<input v-model="filter.showCompleted" type="checkbox" />
|
|
859
|
-
<span>{{ t('显示已完成') }}</span>
|
|
860
|
-
</label>
|
|
861
|
-
<label class="calendar-filter-search">
|
|
862
|
-
<Search :size="13" aria-hidden="true" />
|
|
863
|
-
<input
|
|
864
|
-
v-model="filter.query"
|
|
865
|
-
type="search"
|
|
866
|
-
:aria-label="t('搜索事项…')"
|
|
867
|
-
:placeholder="t('搜索事项…')"
|
|
868
|
-
maxlength="100"
|
|
869
|
-
/>
|
|
870
|
-
</label>
|
|
871
|
-
</div>
|
|
872
|
-
<p v-if="interactionError" class="calendar-error-banner" role="alert">
|
|
873
|
-
<span>{{ interactionError }}</span>
|
|
874
|
-
<button type="button" :aria-label="t('关闭')" @click="interactionError = ''"><X :size="14" /></button>
|
|
202
|
+
<CalendarFilterBar v-model="filter" />
|
|
203
|
+
<p v-if="interactions.interactionError.value" class="calendar-error-banner" role="alert">
|
|
204
|
+
<span>{{ interactions.interactionError.value }}</span>
|
|
205
|
+
<button type="button" :aria-label="t('关闭')" @click="interactions.interactionError.value = ''"><X :size="14" /></button>
|
|
875
206
|
</p>
|
|
876
207
|
<main
|
|
877
208
|
ref="scroll"
|
|
@@ -883,378 +214,69 @@ watch(() => props.date, (date) => {
|
|
|
883
214
|
>
|
|
884
215
|
<LoadingSkeleton v-if="loading" variant="document" :rows="6" />
|
|
885
216
|
<div v-show="!loading" class="component-loading-content">
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
:
|
|
898
|
-
:
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
:aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
|
|
937
|
-
:disabled="!canToggleComplete(entry.record)"
|
|
938
|
-
@click.stop="toggleComplete(entry.record)"
|
|
939
|
-
>
|
|
940
|
-
<CircleCheck v-if="isEventCompleted(entry.record)" :size="12" aria-hidden="true" />
|
|
941
|
-
<Circle v-else :size="12" aria-hidden="true" />
|
|
942
|
-
</button>
|
|
943
|
-
<Flag v-if="entry.kind === 'due'" :size="11" class="calendar-due-flag" aria-hidden="true" />
|
|
944
|
-
<button
|
|
945
|
-
type="button"
|
|
946
|
-
class="calendar-item-trigger"
|
|
947
|
-
@click="emit('select-event', sourcePlanKey(entry.record))"
|
|
948
|
-
>{{ entry.record.object.name }}</button>
|
|
949
|
-
</div>
|
|
950
|
-
</div>
|
|
951
|
-
</template>
|
|
952
|
-
</div>
|
|
953
|
-
<div class="calendar-view-grid">
|
|
954
|
-
<div class="calendar-view-hours" aria-hidden="true">
|
|
955
|
-
<span v-for="hour in hours" :key="hour" :style="{ top: `${hour * hourHeight}px` }">{{ String(hour).padStart(2, '0') }}:00</span>
|
|
956
|
-
</div>
|
|
957
|
-
<div
|
|
958
|
-
v-for="day in timelineDays"
|
|
959
|
-
:key="localDayKey(day)"
|
|
960
|
-
class="calendar-view-day-column"
|
|
961
|
-
:class="{ 'is-creatable': canCreate, 'is-today': localDayKey(day) === today }"
|
|
962
|
-
:data-day="localDayKey(day)"
|
|
963
|
-
@pointerdown="startSlotSelection(day, $event)"
|
|
964
|
-
@dragover="onTimelineDragOver(day, $event)"
|
|
965
|
-
@dragleave="onDragLeave"
|
|
966
|
-
@drop.prevent="onTimelineDrop(day, $event)"
|
|
967
|
-
>
|
|
968
|
-
<div v-if="localDayKey(day) === today" class="calendar-now-line" :style="{ top: nowLineTop }" aria-hidden="true" />
|
|
969
|
-
<div
|
|
970
|
-
v-if="slotPreview && slotPreview.dayKey === localDayKey(day)"
|
|
971
|
-
class="calendar-slot-preview"
|
|
972
|
-
:style="{ top: `${slotPreview.top}px`, height: `${slotPreview.height}px` }"
|
|
973
|
-
aria-hidden="true"
|
|
974
|
-
>{{ slotPreview.label }}</div>
|
|
975
|
-
<div
|
|
976
|
-
v-if="dropTarget?.zone === 'timeline' && dropTarget.dayKey === localDayKey(day) && dropTarget.minutes !== undefined"
|
|
977
|
-
class="calendar-drop-indicator"
|
|
978
|
-
:style="{ top: `${(dropTarget.minutes / 60) * hourHeight}px` }"
|
|
979
|
-
aria-hidden="true"
|
|
980
|
-
><span>{{ formatMinutesLabel(dropTarget.minutes) }}</span></div>
|
|
981
|
-
<div
|
|
982
|
-
v-for="item in timedEvents(day)"
|
|
983
|
-
:key="planKey(item.record)"
|
|
984
|
-
class="calendar-view-event"
|
|
985
|
-
:class="[
|
|
986
|
-
{ 'calendar-view-point': item.point, 'is-compact': item.compact, 'is-resizing': resizing?.key === planKey(item.record) },
|
|
987
|
-
itemClasses(item.record, 'timed'),
|
|
988
|
-
]"
|
|
989
|
-
:style="timedEventStyle(item, day)"
|
|
990
|
-
:draggable="canDragRecord(item.record) && !resizing"
|
|
991
|
-
:data-tooltip="entryTooltip({ record: item.record, kind: 'timed' }, item.time)"
|
|
992
|
-
@dragstart="onEventDragStart(item.record, $event)"
|
|
993
|
-
@dragend="onEventDragEnd"
|
|
994
|
-
>
|
|
995
|
-
<button
|
|
996
|
-
v-if="isCheckableEvent(item.record)"
|
|
997
|
-
type="button"
|
|
998
|
-
class="calendar-inline-check"
|
|
999
|
-
:aria-label="`${isEventCompleted(item.record) ? t('标记未完成') : t('完成')}:${item.record.object.name}`"
|
|
1000
|
-
:disabled="!canToggleComplete(item.record)"
|
|
1001
|
-
@click.stop="toggleComplete(item.record)"
|
|
1002
|
-
>
|
|
1003
|
-
<CircleCheck v-if="isEventCompleted(item.record)" :size="12" aria-hidden="true" />
|
|
1004
|
-
<Circle v-else :size="12" aria-hidden="true" />
|
|
1005
|
-
</button>
|
|
1006
|
-
<button
|
|
1007
|
-
type="button"
|
|
1008
|
-
class="calendar-view-event-body"
|
|
1009
|
-
@click="emit('select-event', sourcePlanKey(item.record))"
|
|
1010
|
-
>
|
|
1011
|
-
<strong>{{ item.record.object.name }}</strong>
|
|
1012
|
-
<span>{{ item.time }}</span>
|
|
1013
|
-
</button>
|
|
1014
|
-
<div
|
|
1015
|
-
v-if="!item.point && canDragRecord(item.record)"
|
|
1016
|
-
class="calendar-event-resize-handle"
|
|
1017
|
-
role="separator"
|
|
1018
|
-
:aria-label="t('调整时长')"
|
|
1019
|
-
@pointerdown.stop.prevent="startResize(item, day, $event)"
|
|
1020
|
-
/>
|
|
1021
|
-
</div>
|
|
1022
|
-
</div>
|
|
1023
|
-
</div>
|
|
1024
|
-
</div>
|
|
1025
|
-
|
|
1026
|
-
<div v-else-if="mode === 'month'" class="calendar-month-view">
|
|
1027
|
-
<div class="calendar-month-weekdays" aria-hidden="true">
|
|
1028
|
-
<span v-for="name in weekdays" :key="name">{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ name }}</span>
|
|
1029
|
-
</div>
|
|
1030
|
-
<div
|
|
1031
|
-
v-for="week in scrollingWeeks"
|
|
1032
|
-
:key="weekKey(week)"
|
|
1033
|
-
class="calendar-month-week"
|
|
1034
|
-
:data-week="weekKey(week)"
|
|
1035
|
-
>
|
|
1036
|
-
<div
|
|
1037
|
-
v-for="day in weekDays(week)"
|
|
1038
|
-
:key="localDayKey(day)"
|
|
1039
|
-
class="calendar-month-cell"
|
|
1040
|
-
:class="{
|
|
1041
|
-
shaded: monthShade(day),
|
|
1042
|
-
'is-drop-target': dropTarget?.zone === 'day' && dropTarget.dayKey === localDayKey(day),
|
|
1043
|
-
}"
|
|
1044
|
-
:data-day="localDayKey(day)"
|
|
1045
|
-
@dblclick.self="openQuickCreate({ date: localDayKey(day), time: '', end: '' }, false)"
|
|
1046
|
-
@dragover="onDayDragOver(day, $event)"
|
|
1047
|
-
@dragleave="onDragLeave"
|
|
1048
|
-
@drop.prevent="onDayDrop(day, $event)"
|
|
1049
|
-
>
|
|
1050
|
-
<div class="calendar-month-cell-header">
|
|
1051
|
-
<button
|
|
1052
|
-
v-if="canCreate"
|
|
1053
|
-
type="button"
|
|
1054
|
-
class="calendar-month-add"
|
|
1055
|
-
:aria-label="t('为 {0} 添加事件', [localDayKey(day)])"
|
|
1056
|
-
@click.stop="openQuickCreate({ date: localDayKey(day), time: '', end: '' }, false)"
|
|
1057
|
-
><Plus :size="12" aria-hidden="true" /></button>
|
|
1058
|
-
<button
|
|
1059
|
-
type="button"
|
|
1060
|
-
class="calendar-month-date"
|
|
1061
|
-
:class="{ today: localDayKey(day) === today, 'month-start': day.getDate() === 1 }"
|
|
1062
|
-
:aria-label="t('{0},查看日视图', [localDayKey(day)])"
|
|
1063
|
-
@click="emit('select-date', day)"
|
|
1064
|
-
>{{ day.getDate() === 1 ? t('{0} 月 1 日', [day.getMonth() + 1]) : day.getDate() }}</button>
|
|
1065
|
-
</div>
|
|
1066
|
-
<div
|
|
1067
|
-
v-for="entry in dayEntries(day).slice(0, 3)"
|
|
1068
|
-
:key="`${planKey(entry.record)}:${entry.kind}`"
|
|
1069
|
-
class="calendar-month-event"
|
|
1070
|
-
:class="itemClasses(entry.record, entry.kind)"
|
|
1071
|
-
:draggable="entry.kind !== 'due' && canDragRecord(entry.record)"
|
|
1072
|
-
:data-tooltip="entryTooltip(entry)"
|
|
1073
|
-
@dragstart="onEventDragStart(entry.record, $event)"
|
|
1074
|
-
@dragend="onEventDragEnd"
|
|
1075
|
-
>
|
|
1076
|
-
<button
|
|
1077
|
-
v-if="isCheckableEvent(entry.record)"
|
|
1078
|
-
type="button"
|
|
1079
|
-
class="calendar-inline-check"
|
|
1080
|
-
:aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
|
|
1081
|
-
:disabled="!canToggleComplete(entry.record)"
|
|
1082
|
-
@click.stop="toggleComplete(entry.record)"
|
|
1083
|
-
>
|
|
1084
|
-
<CircleCheck v-if="isEventCompleted(entry.record)" :size="11" aria-hidden="true" />
|
|
1085
|
-
<Circle v-else :size="11" aria-hidden="true" />
|
|
1086
|
-
</button>
|
|
1087
|
-
<Flag v-if="entry.kind === 'due'" :size="10" class="calendar-due-flag" aria-hidden="true" />
|
|
1088
|
-
<button
|
|
1089
|
-
type="button"
|
|
1090
|
-
class="calendar-item-trigger"
|
|
1091
|
-
@click="emit('select-event', sourcePlanKey(entry.record))"
|
|
1092
|
-
><time v-if="entry.kind === 'timed'" class="calendar-item-time">{{ entryTime(entry) }}</time>{{ entry.record.object.name }}</button>
|
|
1093
|
-
</div>
|
|
1094
|
-
<button
|
|
1095
|
-
v-if="dayEntries(day).length > 3"
|
|
1096
|
-
type="button"
|
|
1097
|
-
class="calendar-month-more"
|
|
1098
|
-
aria-haspopup="dialog"
|
|
1099
|
-
:aria-expanded="localDayKey(day) === dayPopoverKey"
|
|
1100
|
-
:aria-controls="localDayKey(day) === dayPopoverKey ? dayPopoverId : undefined"
|
|
1101
|
-
@click="openDayPopover(day, $event)"
|
|
1102
|
-
>{{ t('另有 {0} 项', [dayEntries(day).length - 3]) }}</button>
|
|
1103
|
-
</div>
|
|
1104
|
-
</div>
|
|
1105
|
-
</div>
|
|
1106
|
-
|
|
1107
|
-
<div v-else-if="mode === 'year'" class="calendar-year-view">
|
|
1108
|
-
<section v-for="year in scrollingYears" :key="year" class="calendar-year-section" :data-year="year">
|
|
1109
|
-
<h2 class="calendar-year-heading">{{ new Date(year, 0, 1).toLocaleDateString(uiLocale, { year: 'numeric' }) }}</h2>
|
|
1110
|
-
<div class="calendar-year-grid">
|
|
1111
|
-
<section v-for="month in monthsForYear(year)" :key="month.date.getMonth()" class="calendar-year-month">
|
|
1112
|
-
<button type="button" class="calendar-year-month-title" @click="emit('select-month', month.date)">
|
|
1113
|
-
{{ month.date.toLocaleDateString(uiLocale, { month: 'long' }) }}
|
|
1114
|
-
</button>
|
|
1115
|
-
<div class="calendar-year-weekdays" aria-hidden="true">
|
|
1116
|
-
<span v-for="name in weekdays" :key="name">{{ name }}</span>
|
|
1117
|
-
</div>
|
|
1118
|
-
<div class="calendar-year-days">
|
|
1119
|
-
<template v-for="day in month.days" :key="localDayKey(day)">
|
|
1120
|
-
<span v-if="day.getMonth() !== month.date.getMonth()" aria-hidden="true" />
|
|
1121
|
-
<button
|
|
1122
|
-
v-else
|
|
1123
|
-
type="button"
|
|
1124
|
-
:class="{ today: localDayKey(day) === today, selected: localDayKey(day) === dayPopoverKey }"
|
|
1125
|
-
:aria-label="t('{0},{1} 个事件', [localDayKey(day), dayPopoverEntries(day).length])"
|
|
1126
|
-
aria-haspopup="dialog"
|
|
1127
|
-
:aria-expanded="localDayKey(day) === dayPopoverKey"
|
|
1128
|
-
:aria-controls="localDayKey(day) === dayPopoverKey ? dayPopoverId : undefined"
|
|
1129
|
-
@click="openDayPopover(day, $event)"
|
|
1130
|
-
>
|
|
1131
|
-
<span class="calendar-year-date">{{ day.getDate() }}</span>
|
|
1132
|
-
<i v-if="dayPopoverEntries(day).length" class="calendar-year-event-dot" aria-hidden="true" />
|
|
1133
|
-
</button>
|
|
1134
|
-
</template>
|
|
1135
|
-
</div>
|
|
1136
|
-
</section>
|
|
1137
|
-
</div>
|
|
1138
|
-
</section>
|
|
1139
|
-
</div>
|
|
1140
|
-
|
|
1141
|
-
<div v-else class="calendar-agenda-view">
|
|
1142
|
-
<p v-if="!agendaDates.length" class="calendar-agenda-empty">{{ t('本月没有日程') }}</p>
|
|
1143
|
-
<section v-for="day in agendaDates" :key="localDayKey(day)" class="calendar-agenda-day">
|
|
1144
|
-
<time
|
|
1145
|
-
class="calendar-agenda-date"
|
|
1146
|
-
:class="{ today: localDayKey(day) === today }"
|
|
1147
|
-
:datetime="localDayKey(day)"
|
|
1148
|
-
:aria-label="day.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric', weekday: 'long' })"
|
|
1149
|
-
>
|
|
1150
|
-
<strong>{{ day.getDate() }}</strong>
|
|
1151
|
-
<span>{{ day.toLocaleDateString(uiLocale, { month: 'short' }) }} · {{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ weekday(day) }}</span>
|
|
1152
|
-
</time>
|
|
1153
|
-
<div class="calendar-agenda-events">
|
|
1154
|
-
<div
|
|
1155
|
-
v-for="entry in dayEntries(day)"
|
|
1156
|
-
:key="`${planKey(entry.record)}:${entry.kind}`"
|
|
1157
|
-
class="calendar-agenda-row"
|
|
1158
|
-
:class="itemClasses(entry.record, entry.kind)"
|
|
1159
|
-
>
|
|
1160
|
-
<button
|
|
1161
|
-
v-if="isCheckableEvent(entry.record)"
|
|
1162
|
-
type="button"
|
|
1163
|
-
class="calendar-inline-check"
|
|
1164
|
-
:aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
|
|
1165
|
-
:disabled="!canToggleComplete(entry.record)"
|
|
1166
|
-
@click.stop="toggleComplete(entry.record)"
|
|
1167
|
-
>
|
|
1168
|
-
<CircleCheck v-if="isEventCompleted(entry.record)" :size="15" aria-hidden="true" />
|
|
1169
|
-
<Circle v-else :size="15" aria-hidden="true" />
|
|
1170
|
-
</button>
|
|
1171
|
-
<span v-else class="calendar-agenda-marker" aria-hidden="true" />
|
|
1172
|
-
<button
|
|
1173
|
-
type="button"
|
|
1174
|
-
class="calendar-agenda-item"
|
|
1175
|
-
@click="emit('select-event', sourcePlanKey(entry.record))"
|
|
1176
|
-
>
|
|
1177
|
-
<time>{{ entryTime(entry) }}</time>
|
|
1178
|
-
<span>
|
|
1179
|
-
<Flag v-if="entry.kind === 'due'" :size="12" class="calendar-due-flag" aria-hidden="true" />
|
|
1180
|
-
{{ entry.record.object.name }}
|
|
1181
|
-
<small>{{ planSourceLabel(entry.record) }}<template v-if="isEventOverdue(entry.record, today)"> · {{ t('逾期') }}</template></small>
|
|
1182
|
-
</span>
|
|
1183
|
-
</button>
|
|
1184
|
-
</div>
|
|
1185
|
-
</div>
|
|
1186
|
-
</section>
|
|
1187
|
-
</div>
|
|
217
|
+
<CalendarTimelineView
|
|
218
|
+
v-if="timeline"
|
|
219
|
+
:date="date"
|
|
220
|
+
:mode="mode"
|
|
221
|
+
:timeline-days="timelineDays"
|
|
222
|
+
:timeline-day-width="timelineDayWidth"
|
|
223
|
+
:planned="planned"
|
|
224
|
+
:events="events"
|
|
225
|
+
:today="today"
|
|
226
|
+
:now-minutes="nowMinutes"
|
|
227
|
+
:weekdays="weekdays"
|
|
228
|
+
:can-create="canCreate"
|
|
229
|
+
:interactions="interactions"
|
|
230
|
+
@select-event="emit('select-event', $event)"
|
|
231
|
+
/>
|
|
232
|
+
<CalendarMonthView
|
|
233
|
+
v-else-if="mode === 'month'"
|
|
234
|
+
:scrolling-weeks="scrollingWeeks"
|
|
235
|
+
:planned="planned"
|
|
236
|
+
:today="today"
|
|
237
|
+
:weekdays="weekdays"
|
|
238
|
+
:can-create="canCreate"
|
|
239
|
+
:day-popover-key="dayPopoverKey"
|
|
240
|
+
:day-popover-id="dayPopoverId"
|
|
241
|
+
:interactions="interactions"
|
|
242
|
+
@select-date="emit('select-date', $event)"
|
|
243
|
+
@select-event="emit('select-event', $event)"
|
|
244
|
+
@open-day-popover="openDayPopover"
|
|
245
|
+
@open-quick-create="openQuickCreate"
|
|
246
|
+
/>
|
|
247
|
+
<CalendarYearView
|
|
248
|
+
v-else-if="mode === 'year'"
|
|
249
|
+
:scrolling-years="scrollingYears"
|
|
250
|
+
:planned="planned"
|
|
251
|
+
:today="today"
|
|
252
|
+
:weekdays="weekdays"
|
|
253
|
+
:day-popover-key="dayPopoverKey"
|
|
254
|
+
:day-popover-id="dayPopoverId"
|
|
255
|
+
@select-month="emit('select-month', $event)"
|
|
256
|
+
@open-day-popover="openDayPopover"
|
|
257
|
+
/>
|
|
258
|
+
<CalendarAgendaView
|
|
259
|
+
v-else
|
|
260
|
+
:date="date"
|
|
261
|
+
:planned="planned"
|
|
262
|
+
:today="today"
|
|
263
|
+
:weekdays="weekdays"
|
|
264
|
+
:interactions="interactions"
|
|
265
|
+
@select-event="emit('select-event', $event)"
|
|
266
|
+
/>
|
|
1188
267
|
</div>
|
|
1189
268
|
</main>
|
|
1190
269
|
</div>
|
|
1191
|
-
<
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
aria-modal="true"
|
|
1202
|
-
:aria-label="t('新建事件')"
|
|
1203
|
-
@keydown.esc.stop.prevent="closeQuickCreate"
|
|
1204
|
-
>
|
|
1205
|
-
<header>
|
|
1206
|
-
<h2>{{ t('新建事件') }}</h2>
|
|
1207
|
-
<button type="button" class="calendar-create-close" :aria-label="t('关闭')" :disabled="createSaving" @click="closeQuickCreate"><X :size="16" /></button>
|
|
1208
|
-
</header>
|
|
1209
|
-
<form @submit.prevent="submitQuickCreate">
|
|
1210
|
-
<input
|
|
1211
|
-
ref="createNameInput"
|
|
1212
|
-
v-model="createDraft.name"
|
|
1213
|
-
class="calendar-create-title"
|
|
1214
|
-
:aria-label="t('事件名称')"
|
|
1215
|
-
:placeholder="t('记下一件事…')"
|
|
1216
|
-
autocomplete="off"
|
|
1217
|
-
required
|
|
1218
|
-
maxlength="200"
|
|
1219
|
-
:disabled="createSaving"
|
|
1220
|
-
/>
|
|
1221
|
-
<div class="calendar-create-properties">
|
|
1222
|
-
<div class="calendar-create-row calendar-create-time">
|
|
1223
|
-
<span class="calendar-create-label"><CalendarDays :size="15" aria-hidden="true" />{{ t('时间安排') }}</span>
|
|
1224
|
-
<PlanDateField
|
|
1225
|
-
v-model="createDraft.planDate"
|
|
1226
|
-
:default-date="localDayKey(date)"
|
|
1227
|
-
:required="!createDraft.checkable"
|
|
1228
|
-
:disabled="createSaving"
|
|
1229
|
-
compact
|
|
1230
|
-
/>
|
|
1231
|
-
</div>
|
|
1232
|
-
<div class="calendar-create-row">
|
|
1233
|
-
<span class="calendar-create-label"><ListTodo :size="15" aria-hidden="true" />{{ t('类型') }}</span>
|
|
1234
|
-
<label class="calendar-create-checkable">
|
|
1235
|
-
<input v-model="createDraft.checkable" type="checkbox" :disabled="createSaving" />
|
|
1236
|
-
<span>{{ t('需要完成') }}</span>
|
|
1237
|
-
</label>
|
|
1238
|
-
</div>
|
|
1239
|
-
<div class="calendar-create-row">
|
|
1240
|
-
<label class="calendar-create-label" :for="createScopeId"><FolderOpen :size="15" aria-hidden="true" />{{ t('保存到') }}</label>
|
|
1241
|
-
<select :id="createScopeId" v-model="createDraft.scope" class="calendar-create-scope" :disabled="createSaving">
|
|
1242
|
-
<option value="workspace" :disabled="!canCreateWorkspace">{{ t('工作区') }}</option>
|
|
1243
|
-
<option value="personal" :disabled="!canCreatePersonal">{{ t('个人') }}</option>
|
|
1244
|
-
</select>
|
|
1245
|
-
</div>
|
|
1246
|
-
</div>
|
|
1247
|
-
<p v-if="createError" class="calendar-create-error" role="alert">{{ createError }}</p>
|
|
1248
|
-
<footer>
|
|
1249
|
-
<button type="button" :disabled="createSaving" @click="closeQuickCreate">{{ t('取消') }}</button>
|
|
1250
|
-
<button type="submit" class="calendar-create-submit" :disabled="createSaving || !createDraft.name.trim()">
|
|
1251
|
-
{{ createSaving ? t('保存中…') : t('创建') }}
|
|
1252
|
-
</button>
|
|
1253
|
-
</footer>
|
|
1254
|
-
</form>
|
|
1255
|
-
</section>
|
|
1256
|
-
</div>
|
|
1257
|
-
</Teleport>
|
|
270
|
+
<CalendarQuickCreateDialog
|
|
271
|
+
:draft="createDraft"
|
|
272
|
+
:saving="createSaving"
|
|
273
|
+
:error="createError"
|
|
274
|
+
:default-date="localDayKey(date)"
|
|
275
|
+
:can-create-workspace="canCreateWorkspace"
|
|
276
|
+
:can-create-personal="canCreatePersonal"
|
|
277
|
+
@close="closeQuickCreate"
|
|
278
|
+
@submit="submitQuickCreate"
|
|
279
|
+
/>
|
|
1258
280
|
<CalendarDayPopover
|
|
1259
281
|
v-if="(mode === 'year' || mode === 'month') && dayPopover"
|
|
1260
282
|
:id="dayPopoverId"
|
|
@@ -1262,165 +284,15 @@ watch(() => props.date, (date) => {
|
|
|
1262
284
|
:anchor="dayPopover.anchor"
|
|
1263
285
|
:records="dayPopoverEntries(dayPopover.date).map(entry => entry.record)"
|
|
1264
286
|
:entries="dayPopoverEntries(dayPopover.date)"
|
|
1265
|
-
:can-edit="canEditRecord"
|
|
1266
|
-
:pending="pending"
|
|
287
|
+
:can-edit="interactions.canEditRecord"
|
|
288
|
+
:pending="interactions.pending.value"
|
|
1267
289
|
@close="dayPopover = undefined"
|
|
1268
290
|
@select-event="emit('select-event', $event)"
|
|
1269
|
-
@toggle-complete="toggleComplete"
|
|
291
|
+
@toggle-complete="interactions.toggleComplete"
|
|
1270
292
|
/>
|
|
1271
293
|
</template>
|
|
1272
294
|
|
|
1273
295
|
<style scoped>
|
|
1274
|
-
/* ---- Calendar palette -----------------------------------------------------
|
|
1275
|
-
Items read their colour from --tone: workspace items use the product ink,
|
|
1276
|
-
personal items a quiet blue, deadlines amber, overdue the danger colour.
|
|
1277
|
-
Fills and seams are mixed from the tone so every theme stays consistent. */
|
|
1278
|
-
.calendar-shell {
|
|
1279
|
-
--cal-ink: var(--text);
|
|
1280
|
-
--cal-personal: #3d6cc9;
|
|
1281
|
-
--cal-due: #b7791f;
|
|
1282
|
-
--cal-overdue: var(--danger, #c24141);
|
|
1283
|
-
--cal-radius: 6px;
|
|
1284
|
-
--cal-today: color-mix(in srgb, var(--text) 2.5%, transparent);
|
|
1285
|
-
--cal-lift: 0 1px 2px rgb(15 15 15 / 0.06), 0 6px 16px -6px rgb(15 15 15 / 0.18);
|
|
1286
|
-
display: flex;
|
|
1287
|
-
flex-direction: column;
|
|
1288
|
-
flex: 1;
|
|
1289
|
-
min-height: 0;
|
|
1290
|
-
min-width: 0;
|
|
1291
|
-
background: var(--paper);
|
|
1292
|
-
}
|
|
1293
|
-
:root[data-theme='dark'] .calendar-shell {
|
|
1294
|
-
--cal-personal: #86a6ea;
|
|
1295
|
-
--cal-due: #d9b26a;
|
|
1296
|
-
--cal-today: color-mix(in srgb, var(--text) 3.5%, transparent);
|
|
1297
|
-
--cal-lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -6px rgb(0 0 0 / 0.55);
|
|
1298
|
-
}
|
|
1299
|
-
:where(.calendar-view-event, .calendar-view-date-event, .calendar-month-event, .calendar-agenda-row) {
|
|
1300
|
-
--tone: var(--cal-ink);
|
|
1301
|
-
}
|
|
1302
|
-
.is-personal { --tone: var(--cal-personal); }
|
|
1303
|
-
.is-due { --tone: var(--cal-due); }
|
|
1304
|
-
.is-overdue { --tone: var(--cal-overdue); }
|
|
1305
|
-
|
|
1306
|
-
/* ---- Filter bar -------------------------------------------------------- */
|
|
1307
|
-
.calendar-filter-bar {
|
|
1308
|
-
display: flex;
|
|
1309
|
-
flex-wrap: wrap;
|
|
1310
|
-
align-items: center;
|
|
1311
|
-
gap: 12px;
|
|
1312
|
-
padding: 8px 14px;
|
|
1313
|
-
border-bottom: 1px solid var(--line);
|
|
1314
|
-
background: var(--paper);
|
|
1315
|
-
font-size: 12px;
|
|
1316
|
-
}
|
|
1317
|
-
.calendar-filter-kinds {
|
|
1318
|
-
display: inline-flex;
|
|
1319
|
-
gap: 2px;
|
|
1320
|
-
padding: 2px;
|
|
1321
|
-
border-radius: 7px;
|
|
1322
|
-
background: var(--surface);
|
|
1323
|
-
box-shadow: inset 0 0 0 1px var(--line);
|
|
1324
|
-
}
|
|
1325
|
-
.calendar-filter-kinds button {
|
|
1326
|
-
min-height: 24px;
|
|
1327
|
-
padding: 0 10px;
|
|
1328
|
-
border-radius: 5px;
|
|
1329
|
-
font-size: 12px;
|
|
1330
|
-
color: var(--muted);
|
|
1331
|
-
}
|
|
1332
|
-
.calendar-filter-kinds button:hover { color: var(--text); background: color-mix(in srgb, var(--hover) 70%, transparent); }
|
|
1333
|
-
.calendar-filter-kinds button[aria-pressed='true'] {
|
|
1334
|
-
background: var(--paper);
|
|
1335
|
-
color: var(--text);
|
|
1336
|
-
font-weight: 500;
|
|
1337
|
-
box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(15 15 15 / 0.08);
|
|
1338
|
-
}
|
|
1339
|
-
.calendar-filter-completed {
|
|
1340
|
-
display: inline-flex;
|
|
1341
|
-
align-items: center;
|
|
1342
|
-
gap: 6px;
|
|
1343
|
-
min-height: 28px;
|
|
1344
|
-
padding: 0 8px 0 6px;
|
|
1345
|
-
border-radius: 6px;
|
|
1346
|
-
color: var(--text-secondary);
|
|
1347
|
-
cursor: pointer;
|
|
1348
|
-
user-select: none;
|
|
1349
|
-
transition: background-color var(--motion-quick) var(--ease-standard), color var(--motion-quick) var(--ease-standard);
|
|
1350
|
-
}
|
|
1351
|
-
.calendar-filter-completed:hover { background: var(--hover); color: var(--text); }
|
|
1352
|
-
.calendar-filter-completed input,
|
|
1353
|
-
.calendar-create-checkable input {
|
|
1354
|
-
appearance: none;
|
|
1355
|
-
position: relative;
|
|
1356
|
-
flex: none;
|
|
1357
|
-
width: 14px;
|
|
1358
|
-
height: 14px;
|
|
1359
|
-
margin: 0;
|
|
1360
|
-
border: 1.5px solid var(--control-border);
|
|
1361
|
-
border-radius: 4px;
|
|
1362
|
-
background: var(--paper);
|
|
1363
|
-
cursor: pointer;
|
|
1364
|
-
transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard);
|
|
1365
|
-
}
|
|
1366
|
-
.calendar-filter-completed input::after,
|
|
1367
|
-
.calendar-create-checkable input::after {
|
|
1368
|
-
content: '';
|
|
1369
|
-
position: absolute;
|
|
1370
|
-
left: 3.5px;
|
|
1371
|
-
top: 0.5px;
|
|
1372
|
-
width: 3.5px;
|
|
1373
|
-
height: 7px;
|
|
1374
|
-
border: solid var(--on-accent, #fff);
|
|
1375
|
-
border-width: 0 1.5px 1.5px 0;
|
|
1376
|
-
rotate: 45deg;
|
|
1377
|
-
scale: 0.4;
|
|
1378
|
-
opacity: 0;
|
|
1379
|
-
transition: scale var(--motion-spring) var(--ease-spring-bouncy), opacity var(--motion-quick) var(--ease-standard);
|
|
1380
|
-
}
|
|
1381
|
-
.calendar-filter-completed input:checked,
|
|
1382
|
-
.calendar-create-checkable input:checked { border-color: var(--green-fill); background: var(--green-fill); }
|
|
1383
|
-
.calendar-filter-completed input:checked::after,
|
|
1384
|
-
.calendar-create-checkable input:checked::after { scale: 1; opacity: 1; }
|
|
1385
|
-
.calendar-filter-completed:hover input:not(:checked),
|
|
1386
|
-
.calendar-create-checkable:hover input:not(:checked, :disabled) { border-color: var(--text-secondary); }
|
|
1387
|
-
.calendar-filter-completed input:focus-visible,
|
|
1388
|
-
.calendar-create-checkable input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
|
|
1389
|
-
.calendar-filter-search {
|
|
1390
|
-
display: inline-flex;
|
|
1391
|
-
align-items: center;
|
|
1392
|
-
gap: 6px;
|
|
1393
|
-
margin-left: auto;
|
|
1394
|
-
min-height: 28px;
|
|
1395
|
-
padding: 0 9px;
|
|
1396
|
-
border: 1px solid var(--line);
|
|
1397
|
-
border-radius: 7px;
|
|
1398
|
-
background: var(--surface);
|
|
1399
|
-
color: var(--muted);
|
|
1400
|
-
cursor: text;
|
|
1401
|
-
transition: border-color var(--motion-base) var(--ease-standard), background-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
|
|
1402
|
-
}
|
|
1403
|
-
.calendar-filter-search:hover { border-color: var(--control-border); }
|
|
1404
|
-
.calendar-filter-search:focus-within {
|
|
1405
|
-
border-color: color-mix(in srgb, var(--text) 35%, var(--line));
|
|
1406
|
-
background: var(--paper);
|
|
1407
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
|
|
1408
|
-
color: var(--text-secondary);
|
|
1409
|
-
}
|
|
1410
|
-
.calendar-filter-search input {
|
|
1411
|
-
width: 140px;
|
|
1412
|
-
border: 0;
|
|
1413
|
-
padding: 0;
|
|
1414
|
-
background: transparent;
|
|
1415
|
-
color: var(--text);
|
|
1416
|
-
font: inherit;
|
|
1417
|
-
font-size: 12px;
|
|
1418
|
-
outline: none;
|
|
1419
|
-
transition: width var(--motion-spring) var(--ease-spring-smooth);
|
|
1420
|
-
}
|
|
1421
|
-
.calendar-filter-search input:focus,
|
|
1422
|
-
.calendar-filter-search input:not(:placeholder-shown) { width: 200px; }
|
|
1423
|
-
.calendar-filter-search input:focus-visible { outline: none; }
|
|
1424
296
|
.calendar-error-banner {
|
|
1425
297
|
display: flex;
|
|
1426
298
|
align-items: center;
|
|
@@ -1443,820 +315,4 @@ watch(() => props.date, (date) => {
|
|
|
1443
315
|
color: inherit;
|
|
1444
316
|
}
|
|
1445
317
|
.calendar-error-banner button:hover { background: color-mix(in srgb, var(--danger, #c24141) 14%, transparent); color: inherit; }
|
|
1446
|
-
|
|
1447
|
-
/* ---- Scroll container ---------------------------------------------------- */
|
|
1448
|
-
.calendar-view {
|
|
1449
|
-
flex: 1;
|
|
1450
|
-
min-height: 0;
|
|
1451
|
-
overflow: auto;
|
|
1452
|
-
background: var(--paper);
|
|
1453
|
-
}
|
|
1454
|
-
.calendar-view-timeline { overflow-anchor: none; }
|
|
1455
|
-
.calendar-view-month,
|
|
1456
|
-
.calendar-view-year { overflow-anchor: none; }
|
|
1457
|
-
/* Switching between views fades the new layout in instead of snapping. */
|
|
1458
|
-
.calendar-view-inner,
|
|
1459
|
-
.calendar-month-view,
|
|
1460
|
-
.calendar-year-view,
|
|
1461
|
-
.calendar-agenda-view { animation: tano-fade-in var(--motion-base) var(--ease-standard); }
|
|
1462
|
-
|
|
1463
|
-
/* ---- Shared item pieces -------------------------------------------------- */
|
|
1464
|
-
.calendar-inline-check {
|
|
1465
|
-
flex: none;
|
|
1466
|
-
display: grid;
|
|
1467
|
-
place-items: center;
|
|
1468
|
-
width: 16px;
|
|
1469
|
-
height: 16px;
|
|
1470
|
-
padding: 0;
|
|
1471
|
-
border-radius: 50%;
|
|
1472
|
-
color: color-mix(in srgb, var(--tone, var(--text)) 55%, var(--muted));
|
|
1473
|
-
}
|
|
1474
|
-
.calendar-inline-check:hover:not(:disabled) {
|
|
1475
|
-
color: var(--tone, var(--text));
|
|
1476
|
-
background: color-mix(in srgb, var(--tone, var(--text)) 12%, transparent);
|
|
1477
|
-
}
|
|
1478
|
-
/* Checks sit inside draggable items, which the global press motion skips. */
|
|
1479
|
-
.calendar-inline-check:active:not(:disabled) { scale: 0.86; }
|
|
1480
|
-
.calendar-inline-check:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
1481
|
-
.is-completed .calendar-inline-check { color: var(--tone, var(--text)); }
|
|
1482
|
-
.calendar-due-flag { flex: none; color: var(--cal-due); }
|
|
1483
|
-
.is-overdue .calendar-due-flag { color: var(--cal-overdue); }
|
|
1484
|
-
.calendar-item-trigger {
|
|
1485
|
-
flex: 1;
|
|
1486
|
-
min-width: 0;
|
|
1487
|
-
overflow: hidden;
|
|
1488
|
-
text-overflow: ellipsis;
|
|
1489
|
-
white-space: nowrap;
|
|
1490
|
-
text-align: left;
|
|
1491
|
-
color: inherit;
|
|
1492
|
-
font: inherit;
|
|
1493
|
-
}
|
|
1494
|
-
.calendar-item-trigger:hover { color: inherit; }
|
|
1495
|
-
.calendar-item-time {
|
|
1496
|
-
margin-right: 5px;
|
|
1497
|
-
color: var(--muted);
|
|
1498
|
-
font-variant-numeric: tabular-nums;
|
|
1499
|
-
}
|
|
1500
|
-
.is-draggable { cursor: grab; }
|
|
1501
|
-
.is-draggable:active { cursor: grabbing; }
|
|
1502
|
-
.is-dragging { opacity: 0.38; }
|
|
1503
|
-
.is-completed .calendar-item-trigger,
|
|
1504
|
-
.is-completed .calendar-view-event-body strong,
|
|
1505
|
-
.is-completed .calendar-agenda-item span {
|
|
1506
|
-
color: var(--muted);
|
|
1507
|
-
text-decoration: line-through;
|
|
1508
|
-
text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent);
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
/* ---- Timeline (day / 4 days / week) ------------------------------------- */
|
|
1512
|
-
.calendar-view-days,
|
|
1513
|
-
.calendar-view-grid {
|
|
1514
|
-
display: grid;
|
|
1515
|
-
grid-template-columns: 64px repeat(var(--calendar-day-count), var(--calendar-day-width));
|
|
1516
|
-
}
|
|
1517
|
-
.calendar-view-days {
|
|
1518
|
-
position: sticky;
|
|
1519
|
-
top: 0;
|
|
1520
|
-
z-index: 4;
|
|
1521
|
-
grid-template-rows: 70px;
|
|
1522
|
-
min-height: 70px;
|
|
1523
|
-
align-items: center;
|
|
1524
|
-
background: var(--paper);
|
|
1525
|
-
border-bottom: 1px solid var(--line);
|
|
1526
|
-
transition: grid-template-rows var(--motion-spring) var(--ease-spring-smooth);
|
|
1527
|
-
}
|
|
1528
|
-
.calendar-view-days.has-banner { grid-template-rows: 70px var(--calendar-banner-height, auto); }
|
|
1529
|
-
.calendar-view-zone {
|
|
1530
|
-
position: sticky;
|
|
1531
|
-
left: 0;
|
|
1532
|
-
z-index: 3;
|
|
1533
|
-
align-self: stretch;
|
|
1534
|
-
display: flex;
|
|
1535
|
-
align-items: flex-end;
|
|
1536
|
-
padding: 0 0 10px 9px;
|
|
1537
|
-
background: var(--paper);
|
|
1538
|
-
font-size: 10px;
|
|
1539
|
-
color: var(--muted);
|
|
1540
|
-
}
|
|
1541
|
-
.calendar-view-day-heading {
|
|
1542
|
-
display: flex;
|
|
1543
|
-
align-items: center;
|
|
1544
|
-
justify-content: center;
|
|
1545
|
-
gap: 7px;
|
|
1546
|
-
align-self: stretch;
|
|
1547
|
-
color: var(--text-secondary);
|
|
1548
|
-
}
|
|
1549
|
-
.calendar-view-day-heading span { font-size: 12px; color: var(--muted); }
|
|
1550
|
-
.calendar-view-day-heading strong {
|
|
1551
|
-
display: grid;
|
|
1552
|
-
place-items: center;
|
|
1553
|
-
min-width: 32px;
|
|
1554
|
-
height: 32px;
|
|
1555
|
-
padding: 0 4px;
|
|
1556
|
-
border-radius: 16px;
|
|
1557
|
-
font-size: 18px;
|
|
1558
|
-
font-weight: 500;
|
|
1559
|
-
font-variant-numeric: tabular-nums;
|
|
1560
|
-
}
|
|
1561
|
-
.calendar-view-day-heading.today span { color: var(--text); font-weight: 500; }
|
|
1562
|
-
.calendar-view-day-heading.today strong,
|
|
1563
|
-
.calendar-month-date.today,
|
|
1564
|
-
.calendar-year-days button.today > .calendar-year-date {
|
|
1565
|
-
color: var(--on-accent, white);
|
|
1566
|
-
background: var(--green-fill);
|
|
1567
|
-
}
|
|
1568
|
-
.calendar-view-date-label {
|
|
1569
|
-
position: sticky;
|
|
1570
|
-
left: 0;
|
|
1571
|
-
z-index: 3;
|
|
1572
|
-
align-self: stretch;
|
|
1573
|
-
padding: 10px 9px;
|
|
1574
|
-
border-top: 1px solid var(--line);
|
|
1575
|
-
background: var(--paper);
|
|
1576
|
-
color: var(--muted);
|
|
1577
|
-
font-size: 10px;
|
|
1578
|
-
}
|
|
1579
|
-
.calendar-view-date-events {
|
|
1580
|
-
display: flex;
|
|
1581
|
-
flex-direction: column;
|
|
1582
|
-
align-self: stretch;
|
|
1583
|
-
gap: 3px;
|
|
1584
|
-
min-height: 0;
|
|
1585
|
-
overflow: auto;
|
|
1586
|
-
overscroll-behavior: contain;
|
|
1587
|
-
scrollbar-width: none;
|
|
1588
|
-
padding: 6px 4px;
|
|
1589
|
-
border-top: 1px solid var(--line);
|
|
1590
|
-
border-left: 1px solid var(--line);
|
|
1591
|
-
transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard);
|
|
1592
|
-
}
|
|
1593
|
-
.calendar-view-date-events::-webkit-scrollbar { display: none; }
|
|
1594
|
-
.calendar-view-date-events.is-drop-target,
|
|
1595
|
-
.calendar-month-cell.is-drop-target {
|
|
1596
|
-
background: color-mix(in srgb, var(--text) 5%, var(--paper));
|
|
1597
|
-
box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 45%, transparent);
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
/* All-day chips in the timeline header and every chip in the month grid. */
|
|
1601
|
-
.calendar-view-date-event,
|
|
1602
|
-
.calendar-month-event {
|
|
1603
|
-
flex-shrink: 0;
|
|
1604
|
-
display: flex;
|
|
1605
|
-
align-items: center;
|
|
1606
|
-
gap: 5px;
|
|
1607
|
-
box-sizing: border-box;
|
|
1608
|
-
height: 22px;
|
|
1609
|
-
padding: 0 7px 0 5px;
|
|
1610
|
-
border-radius: 5px;
|
|
1611
|
-
background: color-mix(in srgb, var(--tone) 8%, var(--paper));
|
|
1612
|
-
color: var(--text);
|
|
1613
|
-
font-size: 11px;
|
|
1614
|
-
line-height: 22px;
|
|
1615
|
-
transition:
|
|
1616
|
-
background-color var(--motion-quick) var(--ease-standard),
|
|
1617
|
-
box-shadow var(--motion-base) var(--ease-standard),
|
|
1618
|
-
opacity var(--motion-base) var(--ease-standard);
|
|
1619
|
-
}
|
|
1620
|
-
.calendar-view-date-event:not(:has(.calendar-inline-check, .calendar-due-flag)),
|
|
1621
|
-
.calendar-month-event:not(:has(.calendar-inline-check, .calendar-due-flag)) { padding-left: 8px; }
|
|
1622
|
-
.calendar-view-date-event:hover,
|
|
1623
|
-
.calendar-month-event:hover,
|
|
1624
|
-
.calendar-view-date-event:focus-within,
|
|
1625
|
-
.calendar-month-event:focus-within { background: color-mix(in srgb, var(--tone) 14%, var(--paper)); }
|
|
1626
|
-
/* Deadlines are not time on the calendar: an outlined chip in the deadline tone. */
|
|
1627
|
-
.calendar-view-date-event.is-due,
|
|
1628
|
-
.calendar-month-event.is-due {
|
|
1629
|
-
background: color-mix(in srgb, var(--tone) 7%, var(--paper));
|
|
1630
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
|
|
1631
|
-
}
|
|
1632
|
-
.calendar-view-date-event.is-due:hover,
|
|
1633
|
-
.calendar-month-event.is-due:hover { background: color-mix(in srgb, var(--tone) 13%, var(--paper)); }
|
|
1634
|
-
.is-overdue .calendar-item-trigger { color: color-mix(in srgb, var(--tone) 75%, var(--text)); }
|
|
1635
|
-
.calendar-view-date-event.is-completed,
|
|
1636
|
-
.calendar-month-event.is-completed { background: color-mix(in srgb, var(--tone) 4%, var(--paper)); }
|
|
1637
|
-
|
|
1638
|
-
.calendar-view-grid { height: 1344px; }
|
|
1639
|
-
.calendar-view-hours { position: sticky; left: 0; z-index: 3; background: var(--paper); }
|
|
1640
|
-
.calendar-view-hours span {
|
|
1641
|
-
position: absolute;
|
|
1642
|
-
right: 9px;
|
|
1643
|
-
transform: translateY(-7px);
|
|
1644
|
-
font-size: 10.5px;
|
|
1645
|
-
color: var(--muted);
|
|
1646
|
-
font-variant-numeric: tabular-nums;
|
|
1647
|
-
}
|
|
1648
|
-
.calendar-view-hours span:first-child { display: none; }
|
|
1649
|
-
.calendar-view-day-column {
|
|
1650
|
-
position: relative;
|
|
1651
|
-
/* Own stacking context: event, preview and drop layers stay under the sticky header. */
|
|
1652
|
-
z-index: 0;
|
|
1653
|
-
border-left: 1px solid var(--line);
|
|
1654
|
-
background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 56px);
|
|
1655
|
-
}
|
|
1656
|
-
.calendar-view-day-column.is-today { background-color: var(--cal-today); }
|
|
1657
|
-
.calendar-now-line {
|
|
1658
|
-
position: absolute;
|
|
1659
|
-
left: -1px;
|
|
1660
|
-
right: 0;
|
|
1661
|
-
z-index: 3;
|
|
1662
|
-
height: 2px;
|
|
1663
|
-
margin-top: -1px;
|
|
1664
|
-
background: var(--cal-overdue);
|
|
1665
|
-
pointer-events: none;
|
|
1666
|
-
}
|
|
1667
|
-
.calendar-now-line::before {
|
|
1668
|
-
content: '';
|
|
1669
|
-
position: absolute;
|
|
1670
|
-
left: -4px;
|
|
1671
|
-
top: -3px;
|
|
1672
|
-
width: 8px;
|
|
1673
|
-
height: 8px;
|
|
1674
|
-
border-radius: 50%;
|
|
1675
|
-
background: var(--cal-overdue);
|
|
1676
|
-
box-shadow: 0 0 0 2px var(--paper);
|
|
1677
|
-
}
|
|
1678
|
-
.calendar-slot-preview {
|
|
1679
|
-
position: absolute;
|
|
1680
|
-
left: 3px;
|
|
1681
|
-
right: 3px;
|
|
1682
|
-
z-index: 4;
|
|
1683
|
-
box-sizing: border-box;
|
|
1684
|
-
padding: 4px 8px 4px 10px;
|
|
1685
|
-
border-radius: var(--cal-radius);
|
|
1686
|
-
background: color-mix(in srgb, var(--text) 9%, var(--paper));
|
|
1687
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 28%, transparent), var(--cal-lift);
|
|
1688
|
-
color: var(--text);
|
|
1689
|
-
font-size: 11px;
|
|
1690
|
-
font-weight: 500;
|
|
1691
|
-
font-variant-numeric: tabular-nums;
|
|
1692
|
-
pointer-events: none;
|
|
1693
|
-
animation: tano-fade-in var(--motion-quick) var(--ease-standard);
|
|
1694
|
-
}
|
|
1695
|
-
.calendar-slot-preview::before {
|
|
1696
|
-
content: '';
|
|
1697
|
-
position: absolute;
|
|
1698
|
-
left: 3px;
|
|
1699
|
-
top: 3px;
|
|
1700
|
-
bottom: 3px;
|
|
1701
|
-
width: 3px;
|
|
1702
|
-
border-radius: 2px;
|
|
1703
|
-
background: color-mix(in srgb, var(--text) 55%, var(--paper));
|
|
1704
|
-
}
|
|
1705
|
-
.calendar-drop-indicator {
|
|
1706
|
-
position: absolute;
|
|
1707
|
-
left: -1px;
|
|
1708
|
-
right: 0;
|
|
1709
|
-
z-index: 6;
|
|
1710
|
-
height: 0;
|
|
1711
|
-
border-top: 2px solid var(--green-fill);
|
|
1712
|
-
pointer-events: none;
|
|
1713
|
-
transition: top 90ms var(--ease-standard);
|
|
1714
|
-
}
|
|
1715
|
-
.calendar-drop-indicator::before {
|
|
1716
|
-
content: '';
|
|
1717
|
-
position: absolute;
|
|
1718
|
-
left: -4px;
|
|
1719
|
-
top: -5px;
|
|
1720
|
-
width: 8px;
|
|
1721
|
-
height: 8px;
|
|
1722
|
-
border-radius: 50%;
|
|
1723
|
-
background: var(--green-fill);
|
|
1724
|
-
}
|
|
1725
|
-
.calendar-drop-indicator span {
|
|
1726
|
-
position: absolute;
|
|
1727
|
-
left: 8px;
|
|
1728
|
-
top: 3px;
|
|
1729
|
-
padding: 1px 6px;
|
|
1730
|
-
border-radius: 4px;
|
|
1731
|
-
background: var(--green-fill);
|
|
1732
|
-
color: var(--on-accent, #fff);
|
|
1733
|
-
font-size: 10px;
|
|
1734
|
-
font-weight: 600;
|
|
1735
|
-
font-variant-numeric: tabular-nums;
|
|
1736
|
-
line-height: 16px;
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
/* Timed blocks: a tinted card with an inset tone bar. */
|
|
1740
|
-
.calendar-view-event {
|
|
1741
|
-
position: absolute;
|
|
1742
|
-
z-index: 1;
|
|
1743
|
-
box-sizing: border-box;
|
|
1744
|
-
display: flex;
|
|
1745
|
-
align-items: flex-start;
|
|
1746
|
-
gap: 4px;
|
|
1747
|
-
overflow: hidden;
|
|
1748
|
-
padding: 4px 6px 6px 11px;
|
|
1749
|
-
border-radius: var(--cal-radius);
|
|
1750
|
-
background: color-mix(in srgb, var(--tone) 8%, var(--paper));
|
|
1751
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 9%, transparent);
|
|
1752
|
-
color: var(--text);
|
|
1753
|
-
text-align: left;
|
|
1754
|
-
font-size: 11px;
|
|
1755
|
-
animation: tano-fade-in var(--motion-base) var(--ease-standard);
|
|
1756
|
-
transition:
|
|
1757
|
-
background-color var(--motion-quick) var(--ease-standard),
|
|
1758
|
-
box-shadow var(--motion-base) var(--ease-standard),
|
|
1759
|
-
opacity var(--motion-base) var(--ease-standard),
|
|
1760
|
-
height var(--motion-quick) var(--ease-standard);
|
|
1761
|
-
}
|
|
1762
|
-
.calendar-view-event::before {
|
|
1763
|
-
content: '';
|
|
1764
|
-
position: absolute;
|
|
1765
|
-
left: 3px;
|
|
1766
|
-
top: 3px;
|
|
1767
|
-
bottom: 3px;
|
|
1768
|
-
width: 3px;
|
|
1769
|
-
border-radius: 2px;
|
|
1770
|
-
background: color-mix(in srgb, var(--tone) 58%, var(--paper));
|
|
1771
|
-
transition: background-color var(--motion-quick) var(--ease-standard);
|
|
1772
|
-
}
|
|
1773
|
-
.calendar-view-event:hover,
|
|
1774
|
-
.calendar-view-event:focus-within {
|
|
1775
|
-
z-index: 3;
|
|
1776
|
-
background: color-mix(in srgb, var(--tone) 12%, var(--paper));
|
|
1777
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 16%, transparent), var(--cal-lift);
|
|
1778
|
-
}
|
|
1779
|
-
.calendar-view-event:hover::before,
|
|
1780
|
-
.calendar-view-event:focus-within::before { background: color-mix(in srgb, var(--tone) 80%, var(--paper)); }
|
|
1781
|
-
.calendar-view-event.is-completed { opacity: 0.62; }
|
|
1782
|
-
.calendar-view-event.is-completed:hover { opacity: 0.9; }
|
|
1783
|
-
.calendar-view-event.is-dragging { opacity: 0.38; box-shadow: none; }
|
|
1784
|
-
.calendar-view-event.is-resizing {
|
|
1785
|
-
z-index: 5;
|
|
1786
|
-
transition: none;
|
|
1787
|
-
background: color-mix(in srgb, var(--tone) 14%, var(--paper));
|
|
1788
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent), var(--cal-lift);
|
|
1789
|
-
}
|
|
1790
|
-
.calendar-view-event .calendar-inline-check { margin-top: 1px; }
|
|
1791
|
-
.calendar-view-event-body {
|
|
1792
|
-
flex: 1;
|
|
1793
|
-
min-width: 0;
|
|
1794
|
-
display: flex;
|
|
1795
|
-
flex-direction: column;
|
|
1796
|
-
align-items: flex-start;
|
|
1797
|
-
gap: 1px;
|
|
1798
|
-
padding: 0;
|
|
1799
|
-
text-align: left;
|
|
1800
|
-
color: inherit;
|
|
1801
|
-
font: inherit;
|
|
1802
|
-
}
|
|
1803
|
-
.calendar-view-event-body:hover { color: inherit; }
|
|
1804
|
-
.calendar-view-event-body strong,
|
|
1805
|
-
.calendar-view-event-body span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1806
|
-
.calendar-view-event-body strong { font-size: 12px; font-weight: 500; line-height: 1.4; }
|
|
1807
|
-
.calendar-view-event-body span {
|
|
1808
|
-
color: color-mix(in srgb, var(--tone) 35%, var(--muted));
|
|
1809
|
-
font-size: 11px;
|
|
1810
|
-
font-variant-numeric: tabular-nums;
|
|
1811
|
-
}
|
|
1812
|
-
.calendar-view-event.is-compact { align-items: center; padding-top: 1px; padding-bottom: 1px; }
|
|
1813
|
-
.calendar-view-event.is-compact .calendar-inline-check { margin-top: 0; }
|
|
1814
|
-
.calendar-view-event.is-compact .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
|
|
1815
|
-
.calendar-view-event.is-compact .calendar-view-event-body strong { flex: 0 1 auto; min-width: 2.5em; }
|
|
1816
|
-
.calendar-view-event.is-compact .calendar-view-event-body span { flex: 1 1 0; min-width: 0; }
|
|
1817
|
-
.calendar-event-resize-handle {
|
|
1818
|
-
position: absolute;
|
|
1819
|
-
left: 0;
|
|
1820
|
-
right: 0;
|
|
1821
|
-
bottom: 0;
|
|
1822
|
-
height: 8px;
|
|
1823
|
-
cursor: ns-resize;
|
|
1824
|
-
}
|
|
1825
|
-
.calendar-event-resize-handle::after {
|
|
1826
|
-
content: '';
|
|
1827
|
-
position: absolute;
|
|
1828
|
-
left: 50%;
|
|
1829
|
-
bottom: 3px;
|
|
1830
|
-
width: 20px;
|
|
1831
|
-
height: 3px;
|
|
1832
|
-
margin-left: -10px;
|
|
1833
|
-
border-radius: 2px;
|
|
1834
|
-
background: color-mix(in srgb, var(--tone) 45%, transparent);
|
|
1835
|
-
opacity: 0;
|
|
1836
|
-
scale: 0.6 1;
|
|
1837
|
-
transition: opacity var(--motion-quick) var(--ease-standard), scale var(--motion-spring) var(--ease-spring);
|
|
1838
|
-
}
|
|
1839
|
-
.calendar-view-event:hover .calendar-event-resize-handle::after,
|
|
1840
|
-
.calendar-view-event.is-resizing .calendar-event-resize-handle::after { opacity: 1; scale: 1; }
|
|
1841
|
-
.calendar-event-resize-handle:hover::after { background: color-mix(in srgb, var(--tone) 75%, transparent); }
|
|
1842
|
-
/* Zero-length items: a slim row with a tone dot rather than a card. */
|
|
1843
|
-
.calendar-view-point {
|
|
1844
|
-
align-items: center;
|
|
1845
|
-
gap: 5px;
|
|
1846
|
-
padding: 0 6px 0 15px;
|
|
1847
|
-
background: transparent;
|
|
1848
|
-
box-shadow: none;
|
|
1849
|
-
}
|
|
1850
|
-
.calendar-view-point::before {
|
|
1851
|
-
top: 50%;
|
|
1852
|
-
bottom: auto;
|
|
1853
|
-
left: 6px;
|
|
1854
|
-
width: 6px;
|
|
1855
|
-
height: 6px;
|
|
1856
|
-
margin-top: -3px;
|
|
1857
|
-
border-radius: 50%;
|
|
1858
|
-
background: var(--tone);
|
|
1859
|
-
}
|
|
1860
|
-
.calendar-view-point.is-task { padding-left: 4px; }
|
|
1861
|
-
.calendar-view-point.is-task::before { display: none; }
|
|
1862
|
-
.calendar-view-point:hover,
|
|
1863
|
-
.calendar-view-point:focus-within { background: color-mix(in srgb, var(--tone) 9%, var(--paper)); box-shadow: var(--cal-lift); }
|
|
1864
|
-
.calendar-view-point .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
|
|
1865
|
-
.calendar-view-point .calendar-view-event-body span { flex: none; }
|
|
1866
|
-
|
|
1867
|
-
/* ---- Month ---------------------------------------------------------------- */
|
|
1868
|
-
.calendar-month-view { min-width: 630px; }
|
|
1869
|
-
.calendar-month-weekdays,
|
|
1870
|
-
.calendar-month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
|
|
1871
|
-
.calendar-month-weekdays {
|
|
1872
|
-
position: sticky;
|
|
1873
|
-
top: 0;
|
|
1874
|
-
z-index: 2;
|
|
1875
|
-
background: var(--paper);
|
|
1876
|
-
border-bottom: 1px solid var(--line);
|
|
1877
|
-
}
|
|
1878
|
-
.calendar-month-weekdays span {
|
|
1879
|
-
padding: 11px 8px;
|
|
1880
|
-
color: var(--muted);
|
|
1881
|
-
font-size: 12px;
|
|
1882
|
-
text-align: center;
|
|
1883
|
-
}
|
|
1884
|
-
.calendar-month-cell {
|
|
1885
|
-
display: flex;
|
|
1886
|
-
flex-direction: column;
|
|
1887
|
-
gap: 2px;
|
|
1888
|
-
min-height: 108px;
|
|
1889
|
-
min-width: 0;
|
|
1890
|
-
padding: 6px;
|
|
1891
|
-
border-right: 1px solid var(--line);
|
|
1892
|
-
border-bottom: 1px solid var(--line);
|
|
1893
|
-
overflow: hidden;
|
|
1894
|
-
transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard);
|
|
1895
|
-
}
|
|
1896
|
-
.calendar-month-cell.shaded { background: color-mix(in srgb, var(--surface) 55%, var(--paper)); }
|
|
1897
|
-
.calendar-month-cell-header {
|
|
1898
|
-
display: flex;
|
|
1899
|
-
align-items: center;
|
|
1900
|
-
justify-content: flex-end;
|
|
1901
|
-
gap: 4px;
|
|
1902
|
-
margin-bottom: 3px;
|
|
1903
|
-
}
|
|
1904
|
-
.calendar-month-add {
|
|
1905
|
-
display: grid;
|
|
1906
|
-
place-items: center;
|
|
1907
|
-
width: 22px;
|
|
1908
|
-
height: 22px;
|
|
1909
|
-
margin-right: auto;
|
|
1910
|
-
border-radius: 6px;
|
|
1911
|
-
color: var(--muted);
|
|
1912
|
-
opacity: 0;
|
|
1913
|
-
scale: 0.8;
|
|
1914
|
-
transition:
|
|
1915
|
-
opacity var(--motion-quick) var(--ease-standard),
|
|
1916
|
-
scale var(--motion-spring) var(--ease-spring),
|
|
1917
|
-
background-color var(--motion-quick) var(--ease-standard),
|
|
1918
|
-
color var(--motion-quick) var(--ease-standard);
|
|
1919
|
-
}
|
|
1920
|
-
.calendar-month-cell:hover .calendar-month-add,
|
|
1921
|
-
.calendar-month-add:focus-visible { opacity: 1; scale: 1; }
|
|
1922
|
-
.calendar-month-add:hover { background: var(--hover); color: var(--text); }
|
|
1923
|
-
.calendar-month-date,
|
|
1924
|
-
.calendar-year-days button {
|
|
1925
|
-
display: grid;
|
|
1926
|
-
place-items: center;
|
|
1927
|
-
width: 26px;
|
|
1928
|
-
height: 26px;
|
|
1929
|
-
border-radius: 13px;
|
|
1930
|
-
font-variant-numeric: tabular-nums;
|
|
1931
|
-
}
|
|
1932
|
-
.calendar-month-date { margin: 0; color: var(--text-secondary); font-size: 12px; }
|
|
1933
|
-
.calendar-month-date.month-start { width: auto; min-width: 26px; padding: 0 8px; color: var(--text); font-weight: 600; }
|
|
1934
|
-
.calendar-month-date:hover:not(.today) { background: var(--hover); color: var(--text); }
|
|
1935
|
-
.calendar-month-date.today:hover { background: var(--green-fill-hover); color: var(--on-accent, white); }
|
|
1936
|
-
.calendar-month-event { width: 100%; }
|
|
1937
|
-
/* Timed items in a day cell are listed, not blocked out: dot + time + title. */
|
|
1938
|
-
.calendar-month-event.is-timed:not(.is-due) { background: transparent; }
|
|
1939
|
-
.calendar-month-event.is-timed:not(.is-due):not(:has(.calendar-inline-check))::before {
|
|
1940
|
-
content: '';
|
|
1941
|
-
flex: none;
|
|
1942
|
-
width: 6px;
|
|
1943
|
-
height: 6px;
|
|
1944
|
-
margin-left: -2px;
|
|
1945
|
-
border-radius: 50%;
|
|
1946
|
-
background: color-mix(in srgb, var(--tone) 70%, var(--paper));
|
|
1947
|
-
}
|
|
1948
|
-
.calendar-month-event.is-timed:not(.is-due):hover,
|
|
1949
|
-
.calendar-month-event.is-timed:not(.is-due):focus-within { background: color-mix(in srgb, var(--tone) 8%, var(--paper)); }
|
|
1950
|
-
.calendar-month-more {
|
|
1951
|
-
display: block;
|
|
1952
|
-
width: 100%;
|
|
1953
|
-
margin-top: 1px;
|
|
1954
|
-
padding: 2px 6px;
|
|
1955
|
-
border-radius: 5px;
|
|
1956
|
-
color: var(--muted);
|
|
1957
|
-
font-size: 11px;
|
|
1958
|
-
font-weight: 500;
|
|
1959
|
-
text-align: left;
|
|
1960
|
-
}
|
|
1961
|
-
.calendar-month-more:hover,
|
|
1962
|
-
.calendar-month-more[aria-expanded='true'] { background: var(--hover); color: var(--text); }
|
|
1963
|
-
|
|
1964
|
-
/* ---- Year ----------------------------------------------------------------- */
|
|
1965
|
-
.calendar-year-heading {
|
|
1966
|
-
max-width: 1200px;
|
|
1967
|
-
margin: 0 auto;
|
|
1968
|
-
padding: 26px 28px 0;
|
|
1969
|
-
color: var(--text);
|
|
1970
|
-
font-size: 18px;
|
|
1971
|
-
font-weight: 600;
|
|
1972
|
-
}
|
|
1973
|
-
.calendar-year-grid {
|
|
1974
|
-
display: grid;
|
|
1975
|
-
grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
|
|
1976
|
-
gap: 12px 14px;
|
|
1977
|
-
max-width: 1200px;
|
|
1978
|
-
margin: 0 auto;
|
|
1979
|
-
padding: 18px 20px 28px;
|
|
1980
|
-
}
|
|
1981
|
-
.calendar-year-month {
|
|
1982
|
-
min-width: 0;
|
|
1983
|
-
padding: 10px 8px 12px;
|
|
1984
|
-
border-radius: 10px;
|
|
1985
|
-
transition: background-color var(--motion-base) var(--ease-standard);
|
|
1986
|
-
}
|
|
1987
|
-
.calendar-year-month:hover { background: color-mix(in srgb, var(--surface) 45%, var(--paper)); }
|
|
1988
|
-
.calendar-year-month-title {
|
|
1989
|
-
margin: 0 0 8px;
|
|
1990
|
-
padding: 3px 8px;
|
|
1991
|
-
border-radius: 6px;
|
|
1992
|
-
color: var(--text);
|
|
1993
|
-
font-size: 14px;
|
|
1994
|
-
font-weight: 600;
|
|
1995
|
-
}
|
|
1996
|
-
.calendar-year-month-title:hover { background: var(--hover); color: var(--text); }
|
|
1997
|
-
.calendar-year-weekdays,
|
|
1998
|
-
.calendar-year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
|
|
1999
|
-
.calendar-year-weekdays span { padding-bottom: 4px; color: var(--muted); font-size: 10px; }
|
|
2000
|
-
.calendar-year-days button,
|
|
2001
|
-
.calendar-year-days > span { width: 28px; height: 28px; margin: auto; font-size: 11px; }
|
|
2002
|
-
.calendar-year-days button { position: relative; padding: 0; border-radius: 50%; color: var(--text-secondary); }
|
|
2003
|
-
.calendar-year-days button:hover { background: none; }
|
|
2004
|
-
.calendar-year-date {
|
|
2005
|
-
display: grid;
|
|
2006
|
-
place-items: center;
|
|
2007
|
-
width: 22px;
|
|
2008
|
-
height: 22px;
|
|
2009
|
-
border-radius: 50%;
|
|
2010
|
-
transition: background-color var(--motion-quick) var(--ease-standard), color var(--motion-quick) var(--ease-standard), scale var(--motion-spring) var(--ease-spring);
|
|
2011
|
-
}
|
|
2012
|
-
.calendar-year-days button:hover:not(.today) > .calendar-year-date { background: var(--hover); color: var(--text); }
|
|
2013
|
-
.calendar-year-event-dot {
|
|
2014
|
-
position: absolute;
|
|
2015
|
-
bottom: 0;
|
|
2016
|
-
left: 50%;
|
|
2017
|
-
width: 4px;
|
|
2018
|
-
height: 4px;
|
|
2019
|
-
margin-left: -2px;
|
|
2020
|
-
border-radius: 50%;
|
|
2021
|
-
background: color-mix(in srgb, var(--text) 55%, var(--paper));
|
|
2022
|
-
}
|
|
2023
|
-
.calendar-year-days button.selected:not(.today) > .calendar-year-date { color: var(--text); background: var(--selected); box-shadow: inset 0 0 0 1px var(--control-border); }
|
|
2024
|
-
.calendar-year-days button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
|
|
2025
|
-
|
|
2026
|
-
/* ---- Agenda --------------------------------------------------------------- */
|
|
2027
|
-
.calendar-agenda-view { max-width: 900px; margin: 0 auto; padding: 20px 32px 40px; }
|
|
2028
|
-
.calendar-agenda-empty { padding: 60px 0; color: var(--muted); text-align: center; }
|
|
2029
|
-
.calendar-agenda-day { display: flex; align-items: flex-start; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 20px; }
|
|
2030
|
-
.calendar-agenda-day:last-child { border-bottom: 0; }
|
|
2031
|
-
.calendar-agenda-date {
|
|
2032
|
-
position: sticky;
|
|
2033
|
-
top: 12px;
|
|
2034
|
-
display: flex;
|
|
2035
|
-
align-items: baseline;
|
|
2036
|
-
gap: 8px;
|
|
2037
|
-
width: 112px;
|
|
2038
|
-
flex-shrink: 0;
|
|
2039
|
-
padding: 7px 0;
|
|
2040
|
-
color: var(--muted);
|
|
2041
|
-
font-size: 12px;
|
|
2042
|
-
font-variant-numeric: tabular-nums;
|
|
2043
|
-
white-space: nowrap;
|
|
2044
|
-
}
|
|
2045
|
-
.calendar-agenda-date strong {
|
|
2046
|
-
display: inline-grid;
|
|
2047
|
-
place-items: center;
|
|
2048
|
-
min-width: 28px;
|
|
2049
|
-
height: 28px;
|
|
2050
|
-
padding: 0 4px;
|
|
2051
|
-
border-radius: 14px;
|
|
2052
|
-
color: var(--text);
|
|
2053
|
-
font-size: 18px;
|
|
2054
|
-
font-weight: 500;
|
|
2055
|
-
}
|
|
2056
|
-
.calendar-agenda-date.today strong { color: var(--on-accent, white); background: var(--green-fill); font-size: 14px; }
|
|
2057
|
-
.calendar-agenda-date.today span { color: var(--text); }
|
|
2058
|
-
.calendar-agenda-events { flex: 1; min-width: 0; }
|
|
2059
|
-
.calendar-agenda-row {
|
|
2060
|
-
display: flex;
|
|
2061
|
-
align-items: center;
|
|
2062
|
-
gap: 10px;
|
|
2063
|
-
padding: 0 8px;
|
|
2064
|
-
border-radius: 7px;
|
|
2065
|
-
transition: background-color var(--motion-quick) var(--ease-standard);
|
|
2066
|
-
}
|
|
2067
|
-
.calendar-agenda-row:hover,
|
|
2068
|
-
.calendar-agenda-row:focus-within { background: var(--hover); }
|
|
2069
|
-
.calendar-agenda-row .calendar-inline-check { width: 18px; height: 18px; }
|
|
2070
|
-
.calendar-agenda-marker {
|
|
2071
|
-
flex: none;
|
|
2072
|
-
display: grid;
|
|
2073
|
-
place-items: center;
|
|
2074
|
-
width: 18px;
|
|
2075
|
-
height: 18px;
|
|
2076
|
-
}
|
|
2077
|
-
.calendar-agenda-marker::before {
|
|
2078
|
-
content: '';
|
|
2079
|
-
width: 7px;
|
|
2080
|
-
height: 7px;
|
|
2081
|
-
border-radius: 50%;
|
|
2082
|
-
background: color-mix(in srgb, var(--tone) 65%, var(--paper));
|
|
2083
|
-
}
|
|
2084
|
-
.calendar-agenda-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 8px 0; color: var(--text); text-align: left; }
|
|
2085
|
-
.calendar-agenda-item:hover { color: var(--text); }
|
|
2086
|
-
.calendar-agenda-item time { width: 46px; flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
2087
|
-
.calendar-agenda-item span { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
|
|
2088
|
-
.calendar-agenda-item span .calendar-due-flag { align-self: center; }
|
|
2089
|
-
.calendar-agenda-item small { color: var(--muted); font-size: 11px; }
|
|
2090
|
-
.calendar-agenda-row.is-overdue .calendar-agenda-item small { color: var(--cal-overdue); }
|
|
2091
|
-
|
|
2092
|
-
/* ---- Quick create dialog (teleported: keep its own tokens) ------------------ */
|
|
2093
|
-
.calendar-create-backdrop {
|
|
2094
|
-
position: fixed;
|
|
2095
|
-
inset: 0;
|
|
2096
|
-
z-index: 80;
|
|
2097
|
-
display: grid;
|
|
2098
|
-
place-items: center;
|
|
2099
|
-
padding: 16px;
|
|
2100
|
-
background: #161a2233;
|
|
2101
|
-
backdrop-filter: blur(3px);
|
|
2102
|
-
}
|
|
2103
|
-
.calendar-create-dialog {
|
|
2104
|
-
--create-label: 92px;
|
|
2105
|
-
width: min(520px, 100%);
|
|
2106
|
-
padding: 16px 20px 18px;
|
|
2107
|
-
border: 1px solid var(--line);
|
|
2108
|
-
border-radius: var(--radius-dialog, 14px);
|
|
2109
|
-
background: var(--paper);
|
|
2110
|
-
color: var(--text);
|
|
2111
|
-
box-shadow: var(--dialog-shadow, 0 16px 48px #0003);
|
|
2112
|
-
}
|
|
2113
|
-
.calendar-create-dialog header {
|
|
2114
|
-
display: flex;
|
|
2115
|
-
align-items: center;
|
|
2116
|
-
justify-content: space-between;
|
|
2117
|
-
gap: 12px;
|
|
2118
|
-
margin-bottom: 6px;
|
|
2119
|
-
}
|
|
2120
|
-
.calendar-create-dialog h2 { margin: 0; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
|
|
2121
|
-
.calendar-create-close {
|
|
2122
|
-
display: grid;
|
|
2123
|
-
place-items: center;
|
|
2124
|
-
width: 28px;
|
|
2125
|
-
height: 28px;
|
|
2126
|
-
margin-right: -6px;
|
|
2127
|
-
border-radius: 7px;
|
|
2128
|
-
color: var(--muted);
|
|
2129
|
-
}
|
|
2130
|
-
.calendar-create-close:hover:not(:disabled) { background: var(--hover); color: var(--text); }
|
|
2131
|
-
/* The title is the dialog's headline, written in place like the detail panel. */
|
|
2132
|
-
.calendar-create-title {
|
|
2133
|
-
box-sizing: border-box;
|
|
2134
|
-
width: calc(100% + 16px);
|
|
2135
|
-
margin: 0 -8px 10px;
|
|
2136
|
-
padding: 6px 8px;
|
|
2137
|
-
border: 1px solid transparent;
|
|
2138
|
-
border-radius: 8px;
|
|
2139
|
-
background: transparent;
|
|
2140
|
-
color: var(--text);
|
|
2141
|
-
font: inherit;
|
|
2142
|
-
font-size: 20px;
|
|
2143
|
-
font-weight: 600;
|
|
2144
|
-
line-height: 1.4;
|
|
2145
|
-
}
|
|
2146
|
-
.calendar-create-title::placeholder { color: var(--muted); opacity: 0.7; font-weight: 500; }
|
|
2147
|
-
.calendar-create-title:hover:not(:disabled, :focus) { background: var(--hover); }
|
|
2148
|
-
.calendar-create-title:focus,
|
|
2149
|
-
.calendar-create-title:focus-visible { outline: none; background: transparent; }
|
|
2150
|
-
/* Property rows share the detail panel's layout: label column + quiet values. */
|
|
2151
|
-
.calendar-create-properties { display: grid; gap: 4px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
|
|
2152
|
-
.calendar-create-row { display: grid; grid-template-columns: var(--create-label) minmax(0, 1fr); column-gap: 12px; align-items: start; min-width: 0; }
|
|
2153
|
-
.calendar-create-label { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--muted); font-size: 13px; }
|
|
2154
|
-
.calendar-create-label svg { flex: none; }
|
|
2155
|
-
.calendar-create-dialog .calendar-create-scope,
|
|
2156
|
-
.calendar-create-dialog .calendar-create-time :deep(.plan-date-field input) {
|
|
2157
|
-
box-sizing: border-box;
|
|
2158
|
-
height: 32px;
|
|
2159
|
-
min-width: 140px;
|
|
2160
|
-
max-width: 100%;
|
|
2161
|
-
justify-self: start;
|
|
2162
|
-
margin: 0;
|
|
2163
|
-
padding: 0 8px;
|
|
2164
|
-
border: 1px solid transparent;
|
|
2165
|
-
border-radius: 6px;
|
|
2166
|
-
background-color: transparent;
|
|
2167
|
-
color: var(--text);
|
|
2168
|
-
font: inherit;
|
|
2169
|
-
font-size: 13px;
|
|
2170
|
-
transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
|
|
2171
|
-
}
|
|
2172
|
-
.calendar-create-dialog .calendar-create-time :deep(.plan-date-field input) { width: auto; }
|
|
2173
|
-
.calendar-create-dialog .calendar-create-scope {
|
|
2174
|
-
appearance: none;
|
|
2175
|
-
padding-right: 26px;
|
|
2176
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8985' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
|
2177
|
-
background-repeat: no-repeat;
|
|
2178
|
-
background-position: right 8px center;
|
|
2179
|
-
cursor: pointer;
|
|
2180
|
-
}
|
|
2181
|
-
.calendar-create-dialog .calendar-create-scope:hover:not(:disabled, :focus),
|
|
2182
|
-
.calendar-create-dialog .calendar-create-time :deep(.plan-date-field input:hover:not(:disabled, :focus)) { border-color: transparent; background-color: var(--hover); }
|
|
2183
|
-
.calendar-create-dialog .calendar-create-scope:focus-visible,
|
|
2184
|
-
.calendar-create-dialog .calendar-create-time :deep(.plan-date-field input:focus-visible) {
|
|
2185
|
-
outline: none;
|
|
2186
|
-
border-color: color-mix(in srgb, var(--text) 35%, var(--line));
|
|
2187
|
-
background-color: var(--paper);
|
|
2188
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
|
|
2189
|
-
}
|
|
2190
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-date-heading) { justify-content: flex-start; gap: 2px; min-height: 32px; }
|
|
2191
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-schedule-trigger) { gap: 4px; min-height: 32px; padding: 0 6px 0 8px; border-radius: 6px; color: var(--text); font-size: 13px; }
|
|
2192
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:first-child) { display: none; }
|
|
2193
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:last-child) { color: var(--muted); }
|
|
2194
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .compact-precision) { color: var(--muted); border-radius: 6px; }
|
|
2195
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-date-inputs) { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 4px; }
|
|
2196
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-date-input) { display: grid; gap: 0; }
|
|
2197
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-date-label) { min-height: 0; padding: 2px 9px 0; }
|
|
2198
|
-
.calendar-create-time :deep(.plan-date-field.is-compact .plan-date-label label) { font-size: 11px; color: var(--muted); }
|
|
2199
|
-
.calendar-create-checkable {
|
|
2200
|
-
display: inline-flex;
|
|
2201
|
-
align-items: center;
|
|
2202
|
-
justify-self: start;
|
|
2203
|
-
gap: 7px;
|
|
2204
|
-
min-height: 32px;
|
|
2205
|
-
padding: 0 8px;
|
|
2206
|
-
border-radius: 6px;
|
|
2207
|
-
font-size: 13px;
|
|
2208
|
-
color: var(--text);
|
|
2209
|
-
cursor: pointer;
|
|
2210
|
-
user-select: none;
|
|
2211
|
-
transition: background-color var(--motion-quick) var(--ease-standard);
|
|
2212
|
-
}
|
|
2213
|
-
.calendar-create-checkable:hover { background: var(--hover); }
|
|
2214
|
-
.calendar-create-error { margin: 10px 0 0; color: var(--danger, #c24141); font-size: 12px; }
|
|
2215
|
-
.calendar-create-dialog footer {
|
|
2216
|
-
display: flex;
|
|
2217
|
-
justify-content: flex-end;
|
|
2218
|
-
gap: 8px;
|
|
2219
|
-
margin-top: 14px;
|
|
2220
|
-
padding-top: 14px;
|
|
2221
|
-
border-top: 1px solid var(--line);
|
|
2222
|
-
}
|
|
2223
|
-
.calendar-create-dialog footer button {
|
|
2224
|
-
min-height: 32px;
|
|
2225
|
-
padding: 0 14px;
|
|
2226
|
-
border: 1px solid var(--line);
|
|
2227
|
-
border-radius: 7px;
|
|
2228
|
-
color: var(--text-secondary);
|
|
2229
|
-
font-size: 13px;
|
|
2230
|
-
}
|
|
2231
|
-
.calendar-create-dialog footer button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
|
|
2232
|
-
.calendar-create-dialog footer .calendar-create-submit {
|
|
2233
|
-
min-width: 72px;
|
|
2234
|
-
border-color: transparent;
|
|
2235
|
-
background: var(--green-fill);
|
|
2236
|
-
color: var(--on-accent, #fff);
|
|
2237
|
-
font-weight: 500;
|
|
2238
|
-
}
|
|
2239
|
-
.calendar-create-dialog footer .calendar-create-submit:hover:not(:disabled) { background: var(--green-fill-hover); color: var(--on-accent, #fff); }
|
|
2240
|
-
.calendar-create-dialog footer .calendar-create-submit:disabled { opacity: 1; background: var(--hover); color: var(--muted); }
|
|
2241
|
-
@media (prefers-reduced-motion: reduce) {
|
|
2242
|
-
.calendar-view-inner,
|
|
2243
|
-
.calendar-month-view,
|
|
2244
|
-
.calendar-year-view,
|
|
2245
|
-
.calendar-agenda-view,
|
|
2246
|
-
.calendar-view-event,
|
|
2247
|
-
.calendar-slot-preview,
|
|
2248
|
-
.calendar-error-banner { animation: none; }
|
|
2249
|
-
}
|
|
2250
|
-
@media (max-width: 700px) {
|
|
2251
|
-
.calendar-filter-bar { padding: 6px 10px; gap: 8px; }
|
|
2252
|
-
.calendar-filter-search input,
|
|
2253
|
-
.calendar-filter-search input:focus,
|
|
2254
|
-
.calendar-filter-search input:not(:placeholder-shown) { width: 110px; }
|
|
2255
|
-
.calendar-year-heading { padding: 18px 18px 0; }
|
|
2256
|
-
.calendar-year-grid { padding: 12px; }
|
|
2257
|
-
.calendar-agenda-view { padding: 18px; }
|
|
2258
|
-
.calendar-agenda-day { gap: 10px; }
|
|
2259
|
-
.calendar-agenda-date { width: 88px; flex-direction: column; gap: 2px; }
|
|
2260
|
-
.calendar-create-row { grid-template-columns: minmax(0, 1fr); }
|
|
2261
|
-
}
|
|
2262
318
|
</style>
|