@tano.page/workbench 0.14.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 +50 -16
- package/src/App.vue +82 -752
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- 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/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +425 -8
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -532
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/files.ts +5 -13
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/language.ts +10 -37
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -58
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +167 -327
- package/src/assistant/structures.ts +1 -155
- package/src/assistant/tasks.ts +8 -96
- package/src/assistant/tool-rules.ts +1 -7
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +40 -1021
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- 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/features.ts +1 -0
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +371 -3
- package/src/i18n/locales/en-US.json +371 -2
- package/src/i18n/locales/es-ES.json +371 -3
- package/src/i18n/locales/ja-JP.json +370 -2
- package/src/i18n/locales/zh-TW.json +370 -2
- package/src/mail/components/MailAccountDialog.vue +450 -0
- package/src/mail/components/MailComposerDialog.vue +326 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +821 -0
- package/src/mail/components/SidebarMail.vue +134 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +3 -4
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +65 -9
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- 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 +264 -748
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- 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/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +136 -57
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +21 -25
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +273 -288
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +37 -34
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +112 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- 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/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -94
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +1 -73
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/view-header.ts +2 -7
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +103 -4
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- 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/components/settings-search.ts +2 -3
- 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/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +58 -34
- package/src/shell/components/WorkbenchModals.vue +47 -62
- package/src/shell/components/WorkbenchPanes.vue +371 -1342
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- 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 +531 -1153
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +2 -114
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +254 -259
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +6 -44
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +184 -1363
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -14
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- 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/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/assistant/locales/de-DE.json +0 -126
- package/src/assistant/locales/en-US.json +0 -126
- package/src/assistant/locales/es-ES.json +0 -126
- package/src/assistant/locales/ja-JP.json +0 -126
- package/src/assistant/locales/zh-CN.json +0 -126
- package/src/assistant/locales/zh-TW.json +0 -126
- package/src/assistant/task-prompts.json +0 -39
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { Circle, CircleCheck, Flag } from 'lucide-vue-next';
|
|
4
|
+
import { t, uiLocale } from '../../i18n/i18n';
|
|
5
|
+
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
6
|
+
import {
|
|
7
|
+
calendarDayEntries,
|
|
8
|
+
isCheckableEvent,
|
|
9
|
+
isEventCompleted,
|
|
10
|
+
localDayKey,
|
|
11
|
+
visibleCalendarDays,
|
|
12
|
+
type CalendarViewMode,
|
|
13
|
+
} from '../calendar';
|
|
14
|
+
import { formatMinutesLabel } from '../calendar-interaction';
|
|
15
|
+
import { layoutDayTimedEvents } from '../timeline-layout';
|
|
16
|
+
import { planKey, sourcePlanKey } from '../personal-plans';
|
|
17
|
+
import type { CalendarInteractions } from '../composables/use-calendar-interactions';
|
|
18
|
+
import { CALENDAR_HOUR_HEIGHT } from '../composables/use-calendar-scroll';
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
date: Date;
|
|
22
|
+
mode: CalendarViewMode;
|
|
23
|
+
timelineDays: readonly Date[];
|
|
24
|
+
timelineDayWidth: number;
|
|
25
|
+
planned: readonly ObjectRecord[];
|
|
26
|
+
events: readonly ObjectRecord[];
|
|
27
|
+
today: string;
|
|
28
|
+
nowMinutes: number;
|
|
29
|
+
weekdays: readonly string[];
|
|
30
|
+
canCreate: boolean;
|
|
31
|
+
interactions: CalendarInteractions;
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<{
|
|
35
|
+
'select-event': [id: string];
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
const hours = Array.from({ length: 24 }, (_, hour) => hour);
|
|
39
|
+
const hourHeight = CALENDAR_HOUR_HEIGHT;
|
|
40
|
+
const nowLineTop = computed(() => `${(props.nowMinutes / 60) * hourHeight}px`);
|
|
41
|
+
|
|
42
|
+
const bannerEntries = (day: Date) =>
|
|
43
|
+
calendarDayEntries(props.planned, day).filter((entry) => entry.kind !== 'timed');
|
|
44
|
+
const hasVisibleBanner = computed(() =>
|
|
45
|
+
visibleCalendarDays(props.date, props.mode).some((day) => bannerEntries(day).length > 0),
|
|
46
|
+
);
|
|
47
|
+
const BANNER_ITEM_HEIGHT = 22;
|
|
48
|
+
const BANNER_GAP = 3;
|
|
49
|
+
const bannerRowHeight = computed(() => {
|
|
50
|
+
const most = Math.max(0, ...visibleCalendarDays(props.date, props.mode).map((day) => bannerEntries(day).length));
|
|
51
|
+
const rows = Math.min(3.5, Math.max(1, most));
|
|
52
|
+
return Math.round(12 + rows * BANNER_ITEM_HEIGHT + Math.max(0, Math.ceil(rows) - 1) * BANNER_GAP);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
function weekday(day: Date) {
|
|
56
|
+
return props.weekdays[(day.getDay() + 6) % 7];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function timedEvents(day: Date) {
|
|
60
|
+
return layoutDayTimedEvents(props.events, day, hourHeight).map((block) => {
|
|
61
|
+
const { start, end } = block.record.object.properties;
|
|
62
|
+
const time = props.interactions.entryTime({ record: block.record, kind: 'timed' });
|
|
63
|
+
return {
|
|
64
|
+
...block,
|
|
65
|
+
time:
|
|
66
|
+
block.point || !end || Date.parse(String(end)) === Date.parse(String(start))
|
|
67
|
+
? time
|
|
68
|
+
: `${time} – ${props.interactions.clockLabel(end)}`,
|
|
69
|
+
compact: !block.point && block.height < 44,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<div
|
|
77
|
+
class="calendar-view-inner"
|
|
78
|
+
:style="{
|
|
79
|
+
'--calendar-day-count': timelineDays.length,
|
|
80
|
+
'--calendar-day-width': `${timelineDayWidth}px`,
|
|
81
|
+
width: `${64 + timelineDays.length * timelineDayWidth}px`,
|
|
82
|
+
}"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="calendar-view-days"
|
|
86
|
+
:class="{ 'has-banner': hasVisibleBanner || interactions.draggingKey.value }"
|
|
87
|
+
:style="{ '--calendar-banner-height': `${bannerRowHeight}px` }"
|
|
88
|
+
>
|
|
89
|
+
<span class="calendar-view-zone">GMT{{ -new Date().getTimezoneOffset() / 60 >= 0 ? '+' : '' }}{{ -new Date().getTimezoneOffset() / 60 }}</span>
|
|
90
|
+
<div
|
|
91
|
+
v-for="day in timelineDays"
|
|
92
|
+
:key="localDayKey(day)"
|
|
93
|
+
class="calendar-view-day-heading"
|
|
94
|
+
:class="{ today: localDayKey(day) === today }"
|
|
95
|
+
>
|
|
96
|
+
<span>{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ weekday(day) }}</span>
|
|
97
|
+
<strong>{{ day.getDate() }}</strong>
|
|
98
|
+
</div>
|
|
99
|
+
<template v-if="hasVisibleBanner || interactions.draggingKey.value">
|
|
100
|
+
<span class="calendar-view-date-label">{{ t('全天') }}</span>
|
|
101
|
+
<div
|
|
102
|
+
v-for="day in timelineDays"
|
|
103
|
+
:key="`date-${localDayKey(day)}`"
|
|
104
|
+
class="calendar-view-date-events"
|
|
105
|
+
:class="{ 'is-drop-target': interactions.dropTarget.value?.zone === 'day' && interactions.dropTarget.value.dayKey === localDayKey(day) }"
|
|
106
|
+
:data-day="localDayKey(day)"
|
|
107
|
+
@dragover="interactions.onDayDragOver(day, $event)"
|
|
108
|
+
@dragleave="interactions.onDragLeave"
|
|
109
|
+
@drop.prevent="interactions.onDayDrop(day, $event)"
|
|
110
|
+
>
|
|
111
|
+
<div
|
|
112
|
+
v-for="entry in bannerEntries(day)"
|
|
113
|
+
:key="`${planKey(entry.record)}:${entry.kind}`"
|
|
114
|
+
class="calendar-view-date-event"
|
|
115
|
+
:class="interactions.itemClasses(entry.record, entry.kind)"
|
|
116
|
+
:draggable="entry.kind !== 'due' && interactions.canDragRecord(entry.record)"
|
|
117
|
+
:data-tooltip="interactions.entryTooltip(entry)"
|
|
118
|
+
@dragstart="interactions.onEventDragStart(entry.record, $event)"
|
|
119
|
+
@dragend="interactions.onEventDragEnd"
|
|
120
|
+
>
|
|
121
|
+
<button
|
|
122
|
+
v-if="isCheckableEvent(entry.record)"
|
|
123
|
+
type="button"
|
|
124
|
+
class="calendar-inline-check"
|
|
125
|
+
:aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
|
|
126
|
+
:disabled="!interactions.canToggleComplete(entry.record)"
|
|
127
|
+
@click.stop="interactions.toggleComplete(entry.record)"
|
|
128
|
+
>
|
|
129
|
+
<CircleCheck v-if="isEventCompleted(entry.record)" :size="12" aria-hidden="true" />
|
|
130
|
+
<Circle v-else :size="12" aria-hidden="true" />
|
|
131
|
+
</button>
|
|
132
|
+
<Flag v-if="entry.kind === 'due'" :size="11" class="calendar-due-flag" aria-hidden="true" />
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
class="calendar-item-trigger"
|
|
136
|
+
@click="emit('select-event', sourcePlanKey(entry.record))"
|
|
137
|
+
>{{ entry.record.object.name }}</button>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|
|
141
|
+
</div>
|
|
142
|
+
<div class="calendar-view-grid">
|
|
143
|
+
<div class="calendar-view-hours" aria-hidden="true">
|
|
144
|
+
<span v-for="hour in hours" :key="hour" :style="{ top: `${hour * hourHeight}px` }">{{ String(hour).padStart(2, '0') }}:00</span>
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
v-for="day in timelineDays"
|
|
148
|
+
:key="localDayKey(day)"
|
|
149
|
+
class="calendar-view-day-column"
|
|
150
|
+
:class="{ 'is-creatable': canCreate, 'is-today': localDayKey(day) === today }"
|
|
151
|
+
:data-day="localDayKey(day)"
|
|
152
|
+
@pointerdown="interactions.startSlotSelection(day, $event)"
|
|
153
|
+
@dragover="interactions.onTimelineDragOver(day, $event)"
|
|
154
|
+
@dragleave="interactions.onDragLeave"
|
|
155
|
+
@drop.prevent="interactions.onTimelineDrop(day, $event)"
|
|
156
|
+
>
|
|
157
|
+
<div v-if="localDayKey(day) === today" class="calendar-now-line" :style="{ top: nowLineTop }" aria-hidden="true" />
|
|
158
|
+
<div
|
|
159
|
+
v-if="interactions.slotPreview.value && interactions.slotPreview.value.dayKey === localDayKey(day)"
|
|
160
|
+
class="calendar-slot-preview"
|
|
161
|
+
:style="{ top: `${interactions.slotPreview.value.top}px`, height: `${interactions.slotPreview.value.height}px` }"
|
|
162
|
+
aria-hidden="true"
|
|
163
|
+
>{{ interactions.slotPreview.value.label }}</div>
|
|
164
|
+
<div
|
|
165
|
+
v-if="interactions.dropTarget.value?.zone === 'timeline' && interactions.dropTarget.value.dayKey === localDayKey(day) && interactions.dropTarget.value.minutes !== undefined"
|
|
166
|
+
class="calendar-drop-indicator"
|
|
167
|
+
:style="{ top: `${(interactions.dropTarget.value.minutes / 60) * hourHeight}px` }"
|
|
168
|
+
aria-hidden="true"
|
|
169
|
+
><span>{{ formatMinutesLabel(interactions.dropTarget.value.minutes) }}</span></div>
|
|
170
|
+
<div
|
|
171
|
+
v-for="item in timedEvents(day)"
|
|
172
|
+
:key="planKey(item.record)"
|
|
173
|
+
class="calendar-view-event"
|
|
174
|
+
:class="[
|
|
175
|
+
{ 'calendar-view-point': item.point, 'is-compact': item.compact, 'is-resizing': interactions.resizing.value?.key === planKey(item.record) },
|
|
176
|
+
interactions.itemClasses(item.record, 'timed'),
|
|
177
|
+
]"
|
|
178
|
+
:style="interactions.timedEventStyle(item, day)"
|
|
179
|
+
:draggable="interactions.canDragRecord(item.record) && !interactions.resizing.value"
|
|
180
|
+
:data-tooltip="interactions.entryTooltip({ record: item.record, kind: 'timed' }, item.time)"
|
|
181
|
+
@dragstart="interactions.onEventDragStart(item.record, $event)"
|
|
182
|
+
@dragend="interactions.onEventDragEnd"
|
|
183
|
+
>
|
|
184
|
+
<button
|
|
185
|
+
v-if="isCheckableEvent(item.record)"
|
|
186
|
+
type="button"
|
|
187
|
+
class="calendar-inline-check"
|
|
188
|
+
:aria-label="`${isEventCompleted(item.record) ? t('标记未完成') : t('完成')}:${item.record.object.name}`"
|
|
189
|
+
:disabled="!interactions.canToggleComplete(item.record)"
|
|
190
|
+
@click.stop="interactions.toggleComplete(item.record)"
|
|
191
|
+
>
|
|
192
|
+
<CircleCheck v-if="isEventCompleted(item.record)" :size="12" aria-hidden="true" />
|
|
193
|
+
<Circle v-else :size="12" aria-hidden="true" />
|
|
194
|
+
</button>
|
|
195
|
+
<button
|
|
196
|
+
type="button"
|
|
197
|
+
class="calendar-view-event-body"
|
|
198
|
+
@click="emit('select-event', sourcePlanKey(item.record))"
|
|
199
|
+
>
|
|
200
|
+
<strong>{{ item.record.object.name }}</strong>
|
|
201
|
+
<span>{{ item.time }}</span>
|
|
202
|
+
</button>
|
|
203
|
+
<div
|
|
204
|
+
v-if="!item.point && interactions.canDragRecord(item.record)"
|
|
205
|
+
class="calendar-event-resize-handle"
|
|
206
|
+
role="separator"
|
|
207
|
+
:aria-label="t('调整时长')"
|
|
208
|
+
@pointerdown.stop.prevent="interactions.startResize(item, day, $event)"
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</template>
|
|
215
|
+
|
|
216
|
+
<style scoped>
|
|
217
|
+
.calendar-view-days,
|
|
218
|
+
.calendar-view-grid {
|
|
219
|
+
display: grid;
|
|
220
|
+
grid-template-columns: 64px repeat(var(--calendar-day-count), var(--calendar-day-width));
|
|
221
|
+
}
|
|
222
|
+
.calendar-view-days {
|
|
223
|
+
position: sticky;
|
|
224
|
+
top: 0;
|
|
225
|
+
z-index: 4;
|
|
226
|
+
grid-template-rows: 70px;
|
|
227
|
+
min-height: 70px;
|
|
228
|
+
align-items: center;
|
|
229
|
+
background: var(--paper);
|
|
230
|
+
border-bottom: 1px solid var(--line);
|
|
231
|
+
transition: grid-template-rows var(--motion-spring) var(--ease-spring-smooth);
|
|
232
|
+
}
|
|
233
|
+
.calendar-view-days.has-banner { grid-template-rows: 70px var(--calendar-banner-height, auto); }
|
|
234
|
+
.calendar-view-zone {
|
|
235
|
+
position: sticky;
|
|
236
|
+
left: 0;
|
|
237
|
+
z-index: 3;
|
|
238
|
+
align-self: stretch;
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: flex-end;
|
|
241
|
+
padding: 0 0 10px 9px;
|
|
242
|
+
background: var(--paper);
|
|
243
|
+
font-size: 10px;
|
|
244
|
+
color: var(--muted);
|
|
245
|
+
}
|
|
246
|
+
.calendar-view-day-heading {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
gap: 7px;
|
|
251
|
+
align-self: stretch;
|
|
252
|
+
color: var(--text-secondary);
|
|
253
|
+
}
|
|
254
|
+
.calendar-view-day-heading span { font-size: 12px; color: var(--muted); }
|
|
255
|
+
.calendar-view-day-heading strong {
|
|
256
|
+
display: grid;
|
|
257
|
+
place-items: center;
|
|
258
|
+
min-width: 32px;
|
|
259
|
+
height: 32px;
|
|
260
|
+
padding: 0 4px;
|
|
261
|
+
border-radius: 16px;
|
|
262
|
+
font-size: 18px;
|
|
263
|
+
font-weight: 500;
|
|
264
|
+
font-variant-numeric: tabular-nums;
|
|
265
|
+
}
|
|
266
|
+
.calendar-view-day-heading.today span { color: var(--text); font-weight: 500; }
|
|
267
|
+
.calendar-view-date-label {
|
|
268
|
+
position: sticky;
|
|
269
|
+
left: 0;
|
|
270
|
+
z-index: 3;
|
|
271
|
+
align-self: stretch;
|
|
272
|
+
padding: 10px 9px;
|
|
273
|
+
border-top: 1px solid var(--line);
|
|
274
|
+
background: var(--paper);
|
|
275
|
+
color: var(--muted);
|
|
276
|
+
font-size: 10px;
|
|
277
|
+
}
|
|
278
|
+
.calendar-view-date-events {
|
|
279
|
+
display: flex;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
align-self: stretch;
|
|
282
|
+
gap: 3px;
|
|
283
|
+
min-height: 0;
|
|
284
|
+
overflow: auto;
|
|
285
|
+
overscroll-behavior: contain;
|
|
286
|
+
scrollbar-width: none;
|
|
287
|
+
padding: 6px 4px;
|
|
288
|
+
border-top: 1px solid var(--line);
|
|
289
|
+
border-left: 1px solid var(--line);
|
|
290
|
+
transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard);
|
|
291
|
+
}
|
|
292
|
+
.calendar-view-date-events::-webkit-scrollbar { display: none; }
|
|
293
|
+
.calendar-view-grid { height: 1344px; }
|
|
294
|
+
.calendar-view-hours { position: sticky; left: 0; z-index: 3; background: var(--paper); }
|
|
295
|
+
.calendar-view-hours span {
|
|
296
|
+
position: absolute;
|
|
297
|
+
right: 9px;
|
|
298
|
+
transform: translateY(-7px);
|
|
299
|
+
font-size: 10.5px;
|
|
300
|
+
color: var(--muted);
|
|
301
|
+
font-variant-numeric: tabular-nums;
|
|
302
|
+
}
|
|
303
|
+
.calendar-view-hours span:first-child { display: none; }
|
|
304
|
+
.calendar-view-day-column {
|
|
305
|
+
position: relative;
|
|
306
|
+
z-index: 0;
|
|
307
|
+
border-left: 1px solid var(--line);
|
|
308
|
+
background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 56px);
|
|
309
|
+
}
|
|
310
|
+
.calendar-view-day-column.is-today { background-color: var(--cal-today); }
|
|
311
|
+
.calendar-now-line {
|
|
312
|
+
position: absolute;
|
|
313
|
+
left: -1px;
|
|
314
|
+
right: 0;
|
|
315
|
+
z-index: 3;
|
|
316
|
+
height: 2px;
|
|
317
|
+
margin-top: -1px;
|
|
318
|
+
background: var(--cal-overdue);
|
|
319
|
+
pointer-events: none;
|
|
320
|
+
}
|
|
321
|
+
.calendar-now-line::before {
|
|
322
|
+
content: '';
|
|
323
|
+
position: absolute;
|
|
324
|
+
left: -4px;
|
|
325
|
+
top: -3px;
|
|
326
|
+
width: 8px;
|
|
327
|
+
height: 8px;
|
|
328
|
+
border-radius: 50%;
|
|
329
|
+
background: var(--cal-overdue);
|
|
330
|
+
box-shadow: 0 0 0 2px var(--paper);
|
|
331
|
+
}
|
|
332
|
+
.calendar-slot-preview {
|
|
333
|
+
position: absolute;
|
|
334
|
+
left: 3px;
|
|
335
|
+
right: 3px;
|
|
336
|
+
z-index: 4;
|
|
337
|
+
box-sizing: border-box;
|
|
338
|
+
padding: 4px 8px 4px 10px;
|
|
339
|
+
border-radius: var(--cal-radius);
|
|
340
|
+
background: color-mix(in srgb, var(--text) 9%, var(--paper));
|
|
341
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 28%, transparent), var(--cal-lift);
|
|
342
|
+
color: var(--text);
|
|
343
|
+
font-size: 11px;
|
|
344
|
+
font-weight: 500;
|
|
345
|
+
font-variant-numeric: tabular-nums;
|
|
346
|
+
pointer-events: none;
|
|
347
|
+
animation: tano-fade-in var(--motion-quick) var(--ease-standard);
|
|
348
|
+
}
|
|
349
|
+
.calendar-slot-preview::before {
|
|
350
|
+
content: '';
|
|
351
|
+
position: absolute;
|
|
352
|
+
left: 3px;
|
|
353
|
+
top: 3px;
|
|
354
|
+
bottom: 3px;
|
|
355
|
+
width: 3px;
|
|
356
|
+
border-radius: 2px;
|
|
357
|
+
background: color-mix(in srgb, var(--text) 55%, var(--paper));
|
|
358
|
+
}
|
|
359
|
+
.calendar-drop-indicator {
|
|
360
|
+
position: absolute;
|
|
361
|
+
left: -1px;
|
|
362
|
+
right: 0;
|
|
363
|
+
z-index: 6;
|
|
364
|
+
height: 0;
|
|
365
|
+
border-top: 2px solid var(--green-fill);
|
|
366
|
+
pointer-events: none;
|
|
367
|
+
transition: top 90ms var(--ease-standard);
|
|
368
|
+
}
|
|
369
|
+
.calendar-drop-indicator::before {
|
|
370
|
+
content: '';
|
|
371
|
+
position: absolute;
|
|
372
|
+
left: -4px;
|
|
373
|
+
top: -5px;
|
|
374
|
+
width: 8px;
|
|
375
|
+
height: 8px;
|
|
376
|
+
border-radius: 50%;
|
|
377
|
+
background: var(--green-fill);
|
|
378
|
+
}
|
|
379
|
+
.calendar-drop-indicator span {
|
|
380
|
+
position: absolute;
|
|
381
|
+
left: 8px;
|
|
382
|
+
top: 3px;
|
|
383
|
+
padding: 1px 6px;
|
|
384
|
+
border-radius: 4px;
|
|
385
|
+
background: var(--green-fill);
|
|
386
|
+
color: var(--on-accent, #fff);
|
|
387
|
+
font-size: 10px;
|
|
388
|
+
font-weight: 600;
|
|
389
|
+
font-variant-numeric: tabular-nums;
|
|
390
|
+
line-height: 16px;
|
|
391
|
+
}
|
|
392
|
+
.calendar-view-event {
|
|
393
|
+
position: absolute;
|
|
394
|
+
z-index: 1;
|
|
395
|
+
box-sizing: border-box;
|
|
396
|
+
display: flex;
|
|
397
|
+
align-items: flex-start;
|
|
398
|
+
gap: 4px;
|
|
399
|
+
overflow: hidden;
|
|
400
|
+
padding: 4px 6px 6px 11px;
|
|
401
|
+
border-radius: var(--cal-radius);
|
|
402
|
+
background: color-mix(in srgb, var(--tone) 8%, var(--paper));
|
|
403
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 9%, transparent);
|
|
404
|
+
color: var(--text);
|
|
405
|
+
text-align: left;
|
|
406
|
+
font-size: 11px;
|
|
407
|
+
animation: tano-fade-in var(--motion-base) var(--ease-standard);
|
|
408
|
+
transition:
|
|
409
|
+
background-color var(--motion-quick) var(--ease-standard),
|
|
410
|
+
box-shadow var(--motion-base) var(--ease-standard),
|
|
411
|
+
opacity var(--motion-base) var(--ease-standard),
|
|
412
|
+
height var(--motion-quick) var(--ease-standard);
|
|
413
|
+
}
|
|
414
|
+
.calendar-view-event::before {
|
|
415
|
+
content: '';
|
|
416
|
+
position: absolute;
|
|
417
|
+
left: 3px;
|
|
418
|
+
top: 3px;
|
|
419
|
+
bottom: 3px;
|
|
420
|
+
width: 3px;
|
|
421
|
+
border-radius: 2px;
|
|
422
|
+
background: color-mix(in srgb, var(--tone) 58%, var(--paper));
|
|
423
|
+
transition: background-color var(--motion-quick) var(--ease-standard);
|
|
424
|
+
}
|
|
425
|
+
.calendar-view-event:hover,
|
|
426
|
+
.calendar-view-event:focus-within {
|
|
427
|
+
z-index: 3;
|
|
428
|
+
background: color-mix(in srgb, var(--tone) 12%, var(--paper));
|
|
429
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 16%, transparent), var(--cal-lift);
|
|
430
|
+
}
|
|
431
|
+
.calendar-view-event:hover::before,
|
|
432
|
+
.calendar-view-event:focus-within::before { background: color-mix(in srgb, var(--tone) 80%, var(--paper)); }
|
|
433
|
+
.calendar-view-event.is-completed { opacity: 0.62; }
|
|
434
|
+
.calendar-view-event.is-completed:hover { opacity: 0.9; }
|
|
435
|
+
.calendar-view-event.is-dragging { opacity: 0.38; box-shadow: none; }
|
|
436
|
+
.calendar-view-event.is-resizing {
|
|
437
|
+
z-index: 5;
|
|
438
|
+
transition: none;
|
|
439
|
+
background: color-mix(in srgb, var(--tone) 14%, var(--paper));
|
|
440
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent), var(--cal-lift);
|
|
441
|
+
}
|
|
442
|
+
.calendar-view-event .calendar-inline-check { margin-top: 1px; }
|
|
443
|
+
.calendar-view-event-body {
|
|
444
|
+
flex: 1;
|
|
445
|
+
min-width: 0;
|
|
446
|
+
display: flex;
|
|
447
|
+
flex-direction: column;
|
|
448
|
+
align-items: flex-start;
|
|
449
|
+
gap: 1px;
|
|
450
|
+
padding: 0;
|
|
451
|
+
text-align: left;
|
|
452
|
+
color: inherit;
|
|
453
|
+
font: inherit;
|
|
454
|
+
}
|
|
455
|
+
.calendar-view-event-body:hover { color: inherit; }
|
|
456
|
+
.calendar-view-event-body strong,
|
|
457
|
+
.calendar-view-event-body span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
458
|
+
.calendar-view-event-body strong { font-size: 12px; font-weight: 500; line-height: 1.4; }
|
|
459
|
+
.calendar-view-event-body span {
|
|
460
|
+
color: color-mix(in srgb, var(--tone) 35%, var(--muted));
|
|
461
|
+
font-size: 11px;
|
|
462
|
+
font-variant-numeric: tabular-nums;
|
|
463
|
+
}
|
|
464
|
+
.calendar-view-event.is-compact { align-items: center; padding-top: 1px; padding-bottom: 1px; }
|
|
465
|
+
.calendar-view-event.is-compact .calendar-inline-check { margin-top: 0; }
|
|
466
|
+
.calendar-view-event.is-compact .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
|
|
467
|
+
.calendar-view-event.is-compact .calendar-view-event-body strong { flex: 0 1 auto; min-width: 2.5em; }
|
|
468
|
+
.calendar-view-event.is-compact .calendar-view-event-body span { flex: 1 1 0; min-width: 0; }
|
|
469
|
+
.calendar-event-resize-handle {
|
|
470
|
+
position: absolute;
|
|
471
|
+
left: 0;
|
|
472
|
+
right: 0;
|
|
473
|
+
bottom: 0;
|
|
474
|
+
height: 8px;
|
|
475
|
+
cursor: ns-resize;
|
|
476
|
+
}
|
|
477
|
+
.calendar-event-resize-handle::after {
|
|
478
|
+
content: '';
|
|
479
|
+
position: absolute;
|
|
480
|
+
left: 50%;
|
|
481
|
+
bottom: 3px;
|
|
482
|
+
width: 20px;
|
|
483
|
+
height: 3px;
|
|
484
|
+
margin-left: -10px;
|
|
485
|
+
border-radius: 2px;
|
|
486
|
+
background: color-mix(in srgb, var(--tone) 45%, transparent);
|
|
487
|
+
opacity: 0;
|
|
488
|
+
scale: 0.6 1;
|
|
489
|
+
transition: opacity var(--motion-quick) var(--ease-standard), scale var(--motion-spring) var(--ease-spring);
|
|
490
|
+
}
|
|
491
|
+
.calendar-view-event:hover .calendar-event-resize-handle::after,
|
|
492
|
+
.calendar-view-event.is-resizing .calendar-event-resize-handle::after { opacity: 1; scale: 1; }
|
|
493
|
+
.calendar-event-resize-handle:hover::after { background: color-mix(in srgb, var(--tone) 75%, transparent); }
|
|
494
|
+
.calendar-view-point {
|
|
495
|
+
align-items: center;
|
|
496
|
+
gap: 5px;
|
|
497
|
+
padding: 0 6px 0 15px;
|
|
498
|
+
background: transparent;
|
|
499
|
+
box-shadow: none;
|
|
500
|
+
}
|
|
501
|
+
.calendar-view-point::before {
|
|
502
|
+
top: 50%;
|
|
503
|
+
bottom: auto;
|
|
504
|
+
left: 6px;
|
|
505
|
+
width: 6px;
|
|
506
|
+
height: 6px;
|
|
507
|
+
margin-top: -3px;
|
|
508
|
+
border-radius: 50%;
|
|
509
|
+
background: var(--tone);
|
|
510
|
+
}
|
|
511
|
+
.calendar-view-point.is-task { padding-left: 4px; }
|
|
512
|
+
.calendar-view-point.is-task::before { display: none; }
|
|
513
|
+
.calendar-view-point:hover,
|
|
514
|
+
.calendar-view-point:focus-within { background: color-mix(in srgb, var(--tone) 9%, var(--paper)); box-shadow: var(--cal-lift); }
|
|
515
|
+
.calendar-view-point .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
|
|
516
|
+
.calendar-view-point .calendar-view-event-body span { flex: none; }
|
|
517
|
+
</style>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Archive, Check, ChevronDown, ChevronLeft, ChevronRight } from 'lucide-vue-next';
|
|
3
|
+
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
4
|
+
import { t } from '../../i18n/i18n';
|
|
5
|
+
import type { CalendarViewMode } from '../calendar';
|
|
6
|
+
|
|
7
|
+
defineProps<{
|
|
8
|
+
isVisible: (id: string) => boolean;
|
|
9
|
+
calendarPeriod: string;
|
|
10
|
+
calendarMode: CalendarViewMode;
|
|
11
|
+
calendarModeLabel: string;
|
|
12
|
+
calendarModeOptions: readonly { mode: CalendarViewMode; label: string }[];
|
|
13
|
+
calendarModeOpen: boolean;
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits<{
|
|
17
|
+
'go-today': [];
|
|
18
|
+
'move-period': [delta: -1 | 1];
|
|
19
|
+
'update:calendarModeOpen': [open: boolean];
|
|
20
|
+
'select-mode': [mode: CalendarViewMode];
|
|
21
|
+
'open-archive': [];
|
|
22
|
+
}>();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="calendar-topbar-controls" role="group" :aria-label="t('日历导航')">
|
|
27
|
+
<span v-if="isVisible('calendar-period')" class="calendar-topbar-period">{{ calendarPeriod }}</span>
|
|
28
|
+
<button
|
|
29
|
+
v-if="isVisible('calendar-today')"
|
|
30
|
+
type="button"
|
|
31
|
+
class="calendar-topbar-today"
|
|
32
|
+
@click="emit('go-today')"
|
|
33
|
+
>
|
|
34
|
+
{{ t('今天') }}
|
|
35
|
+
</button>
|
|
36
|
+
<button
|
|
37
|
+
v-if="isVisible('calendar-previous')"
|
|
38
|
+
type="button"
|
|
39
|
+
class="icon-button"
|
|
40
|
+
:aria-label="t('上一时段')"
|
|
41
|
+
:data-tooltip="t('上一时段')"
|
|
42
|
+
@click="emit('move-period', -1)"
|
|
43
|
+
>
|
|
44
|
+
<ChevronLeft :size="17" />
|
|
45
|
+
</button>
|
|
46
|
+
<button
|
|
47
|
+
v-if="isVisible('calendar-next')"
|
|
48
|
+
type="button"
|
|
49
|
+
class="icon-button"
|
|
50
|
+
:aria-label="t('下一时段')"
|
|
51
|
+
:data-tooltip="t('下一时段')"
|
|
52
|
+
@click="emit('move-period', 1)"
|
|
53
|
+
>
|
|
54
|
+
<ChevronRight :size="17" />
|
|
55
|
+
</button>
|
|
56
|
+
<div
|
|
57
|
+
v-if="isVisible('calendar-mode')"
|
|
58
|
+
class="calendar-view-picker"
|
|
59
|
+
@keydown.esc.stop.prevent="emit('update:calendarModeOpen', false)"
|
|
60
|
+
>
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
class="calendar-topbar-mode"
|
|
64
|
+
:aria-label="t('切换日历视图')"
|
|
65
|
+
:data-tooltip="t('Ctrl + 滚轮:切换日历视图')"
|
|
66
|
+
aria-haspopup="menu"
|
|
67
|
+
:aria-expanded="calendarModeOpen"
|
|
68
|
+
@click="emit('update:calendarModeOpen', !calendarModeOpen)"
|
|
69
|
+
>
|
|
70
|
+
{{ calendarModeLabel }}<ChevronDown :size="14" />
|
|
71
|
+
</button>
|
|
72
|
+
<div
|
|
73
|
+
v-surface-motion="'App:4'"
|
|
74
|
+
v-if="calendarModeOpen"
|
|
75
|
+
class="calendar-view-menu"
|
|
76
|
+
role="menu"
|
|
77
|
+
:aria-label="t('日历视图')"
|
|
78
|
+
>
|
|
79
|
+
<button
|
|
80
|
+
v-for="option in calendarModeOptions"
|
|
81
|
+
:key="option.mode"
|
|
82
|
+
type="button"
|
|
83
|
+
role="menuitemradio"
|
|
84
|
+
:aria-checked="calendarMode === option.mode"
|
|
85
|
+
@click="emit('select-mode', option.mode)"
|
|
86
|
+
>
|
|
87
|
+
{{ option.label }}<Check v-if="calendarMode === option.mode" :size="15" />
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<button
|
|
92
|
+
v-if="isVisible('calendar-events')"
|
|
93
|
+
type="button"
|
|
94
|
+
class="calendar-topbar-events"
|
|
95
|
+
:data-tooltip="t('查看和恢复已归档事项')"
|
|
96
|
+
@click="emit('open-archive')"
|
|
97
|
+
>
|
|
98
|
+
<Archive :size="15" />{{ t('已归档') }}
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
</template>
|