@voplus/morpho-workspace 11.2.7 → 11.2.10
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/es/modules/board/components/Board/index.css +0 -21
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.d.ts +1 -3
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.js +6 -5
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.js.map +1 -1
- package/es/modules/calendar-board/components/CalendarEventChip/index.d.ts +7 -3
- package/es/modules/calendar-board/components/CalendarEventChip/index.js +12 -5
- package/es/modules/calendar-board/components/CalendarEventChip/index.js.map +1 -1
- package/es/modules/calendar-board/components/CalendarLegend/index.js +4 -4
- package/es/modules/calendar-board/components/CalendarLegend/index.js.map +1 -1
- package/es/modules/calendar-board/components/CalendarSidebar/index.d.ts +1 -1
- package/es/modules/calendar-board/components/CalendarSidebar/index.js +1 -2
- package/es/modules/calendar-board/components/CalendarSidebar/index.js.map +1 -1
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.d.ts +1 -1
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.js +1 -2
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.js.map +1 -1
- package/es/modules/calendar-board/event-meta.d.ts +52 -63
- package/es/modules/calendar-board/event-meta.js +221 -78
- package/es/modules/calendar-board/event-meta.js.map +1 -1
- package/es/modules/calendar-board/pages/CalendarBoard/index.css +2 -1
- package/es/modules/calendar-board/pages/CalendarBoard/index.js +2 -2
- package/es/modules/calendar-board/pages/CalendarBoard/index.js.map +1 -1
- package/es/modules/calendar-board/sidebar-data.d.ts +6 -3
- package/es/modules/calendar-board/sidebar-data.js +1 -1
- package/es/modules/calendar-board/sidebar-data.js.map +1 -1
- package/es/modules/meeting/components/MeetingHeader/index.js +1 -1
- package/es/modules/meeting/components/MeetingHeader/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingItem/index.js +44 -40
- package/es/modules/meeting/components/MeetingItem/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingProperties/index.js +1 -1
- package/es/modules/meeting/components/MeetingProperties/index.js.map +1 -1
- package/es/modules/meeting/components/NewMeetingForm/index.js +1 -1
- package/es/modules/meeting/components/NewMeetingForm/index.js.map +1 -1
- package/es/modules/meeting/pages/MeetingPrintView/index.js +1 -1
- package/es/modules/meeting/pages/MeetingPrintView/index.js.map +1 -1
- package/es/modules/menus/pages/ListOptions/Teams/index.js +1 -1
- package/es/modules/menus/pages/ListOptions/Teams/index.js.map +1 -1
- package/es/modules/notification/components/NotificationTableList/index.css +0 -10
- package/es/modules/notification/pages/NotificationListPage/index.css +0 -14
- package/es/modules/notification-workspace/components/NotificationList/index.css +0 -25
- package/es/modules/tasks/components/SubTaskList/index.css +0 -3
- package/es/modules/tasks/components/TaskCheckItem/index.js +1 -1
- package/es/modules/tasks/components/TaskCheckItem/index.js.map +1 -1
- package/es/modules/tasks/components/TaskItem/SubTaskItem.js +1 -1
- package/es/modules/tasks/components/TaskItem/SubTaskItem.js.map +1 -1
- package/es/modules/tasks/components/TaskProperties/index.js +1 -1
- package/es/modules/tasks/components/TaskProperties/index.js.map +1 -1
- package/es/modules/tasks/components/TaskSimpleProperties/index.js +1 -1
- package/es/modules/tasks/components/TaskSimpleProperties/index.js.map +1 -1
- package/es/modules/tasks/components/task-check/TaskCheckTableCard/TableCell.js +1 -1
- package/es/modules/tasks/components/task-check/TaskCheckTableCard/TableCell.js.map +1 -1
- package/es/modules/tasks/components/task-check/TaskCheckTableList/index.css +0 -16
- package/es/modules/tasks/pages/TaskListPage/index.css +0 -3
- package/es/modules/tasks/pages/TaskTabView/index.js +1 -1
- package/es/modules/tasks/pages/TaskTabView/index.js.map +1 -1
- package/es/modules/work/work-error/components/NewWorkErrorDialog/index.js +1 -1
- package/es/modules/work/work-error/components/NewWorkErrorDialog/index.js.map +1 -1
- package/es/modules/work/work-error/components/WorkErrorItem/index.js +1 -1
- package/es/modules/work/work-error/components/WorkErrorItem/index.js.map +1 -1
- package/es/modules/work/work-error/components/WorkErrorProperties/index.js +1 -1
- package/es/modules/work/work-error/components/WorkErrorProperties/index.js.map +1 -1
- package/es/modules/work/work-type/components/WorkTypeProperties/Properties.js +3 -3
- package/es/modules/work/work-type/components/WorkTypeProperties/Properties.js.map +1 -1
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js +1 -1
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js.map +1 -1
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js +1 -1
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -1
- package/es/obsolete/WorkTypeQA/index.js +1 -1
- package/es/obsolete/WorkTypeQA/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,27 +2,6 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
.list-view-header-tool {
|
|
6
|
-
padding: 20px 20px 0;
|
|
7
|
-
.search-header-tool .ant-input-outlined {
|
|
8
|
-
width: 310px;
|
|
9
|
-
}
|
|
10
|
-
.tree-view-btn,
|
|
11
|
-
.table-view-btn {
|
|
12
|
-
color: #868686;
|
|
13
|
-
border: 1px solid #868686;
|
|
14
|
-
padding: 0 10px;
|
|
15
|
-
margin-left: 10px;
|
|
16
|
-
&.current {
|
|
17
|
-
color: var(--purple-primary-color);
|
|
18
|
-
border-color: var(--purple-primary-color);
|
|
19
|
-
}
|
|
20
|
-
&:hover {
|
|
21
|
-
color: var(--purple-primary-color);
|
|
22
|
-
border-color: var(--purple-primary-color);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
5
|
.board-list {
|
|
27
6
|
height: 100%;
|
|
28
7
|
display: flex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type CalendarBoardEvent, type CalendarBoardSource
|
|
2
|
+
import { type CalendarBoardEvent, type CalendarBoardSource } from "../../event-meta";
|
|
3
3
|
import { type CalendarViewType } from "../../pages/CalendarBoard/state";
|
|
4
4
|
/**
|
|
5
5
|
* 一个日期格最多显示几条事件,其余收进 +N 徽标。
|
|
@@ -29,8 +29,6 @@ declare const CalendarBoardGrid: (props: {
|
|
|
29
29
|
* 而是看 FullCalendar 实际给出的 info.view.type —— 那样永远和当前视图一致。
|
|
30
30
|
*/
|
|
31
31
|
initialView: CalendarViewType;
|
|
32
|
-
/** 事件分类 → 颜色的稳定映射(来自 summarizeEvents) */
|
|
33
|
-
colorMap: Map<string, CategoryColor>;
|
|
34
32
|
/** 打开时定位到哪一天,默认今天(页面用默认值;固定日期的 story / 测试显式传入) */
|
|
35
33
|
initialDate?: string | Date;
|
|
36
34
|
/** FullCalendar 实例 ref:页面用它调用 today / prev / next / changeView */
|
|
@@ -5,7 +5,7 @@ import timeGridPlugin from "@fullcalendar/timegrid";
|
|
|
5
5
|
import interactionPlugin from "@fullcalendar/interaction";
|
|
6
6
|
import CalendarEventChip from "../CalendarEventChip";
|
|
7
7
|
import CalendarMoreLink from "../CalendarMoreLink";
|
|
8
|
-
import { DEFAULT_CATEGORY_TYPE,
|
|
8
|
+
import { DEFAULT_CATEGORY_TYPE, } from "../../event-meta";
|
|
9
9
|
import { FULL_CALENDAR_VIEW, FULL_CALENDAR_VIEW_OPTIONS, } from "../../pages/CalendarBoard/state";
|
|
10
10
|
/**
|
|
11
11
|
* 一个日期格最多显示几条事件,其余收进 +N 徽标。
|
|
@@ -27,14 +27,15 @@ export const DAY_MAX_EVENTS = 2;
|
|
|
27
27
|
*/
|
|
28
28
|
const CalendarBoardGrid = (props) => {
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 渲染事件:旧版 Calendar 的浅底卡片;日视图额外带上时间范围。
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* 颜色由卡片自己按 type 取(event-meta 的 resolveEventColor):
|
|
33
|
+
* Task / Case / Work 各用自己那一格,其余分类统一用 Others 那一格 ——
|
|
34
|
+
* 与图例圆点、侧栏 / 底部条圆点是同一个入口,所以同一分类在整页只有一种颜色。
|
|
34
35
|
*/
|
|
35
36
|
const renderEventContent = (info) => {
|
|
36
37
|
const source = info.event.extendedProps?.source;
|
|
37
|
-
return (React.createElement(CalendarEventChip, { title: info.event.title,
|
|
38
|
+
return (React.createElement(CalendarEventChip, { title: info.event.title, type: source?.type || DEFAULT_CATEGORY_TYPE, timeText: info.view.type === FULL_CALENDAR_VIEW.day ? info.timeText : undefined, onClick: () => props.onSelectEvent?.(source) }));
|
|
38
39
|
};
|
|
39
40
|
/**
|
|
40
41
|
* eventSources:外层数组一并 memo 掉。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarBoardGrid/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACN,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarBoardGrid/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,iBAA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AAY,EAAE,YAAY,EAC1B,SAAS,EAAE,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,kBAAkB,EAChC,eAAe,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,oBAAC,gBAAgB,IAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAI,EACrE,QAAQ,EAAE,KAAK,CAAC,UAAU,GACzB,CACG,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type CategoryColor } from "../../event-meta";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* 事件卡:旧版 Calendar 的观感 —— 每个分类一个固定的浅色满底,深色文字压在上面。
|
|
4
|
+
*
|
|
5
|
+
* 颜色走 resolveEventColor:Task / Case / Work 各用自己那一格,其余分类统一用 Others
|
|
6
|
+
* 那一格 —— 与图例圆点、侧栏 / 底部条圆点是同一个入口,所以同一条事件到处同色。
|
|
7
|
+
* 底色与描边同色;颜色是运行时算出的 hex,所以用内联 style 而不是 Tailwind 类。
|
|
5
8
|
*
|
|
6
9
|
* 月 / 周视图只显示标题;日视图由 FullCalendar 额外给出 timeText,
|
|
7
10
|
* 于是多渲染一行时间文案(对应日历稿里的 `10AM-10:30AM`)。
|
|
@@ -14,7 +17,8 @@ import { type CategoryColor } from "../../event-meta";
|
|
|
14
17
|
*/
|
|
15
18
|
declare const CalendarEventChip: (props: {
|
|
16
19
|
title: string;
|
|
17
|
-
|
|
20
|
+
/** 事件的分类名(source.type):卡片颜色只由它决定 */
|
|
21
|
+
type: string;
|
|
18
22
|
/** 日视图的时间范围文案;月 / 周视图不传 */
|
|
19
23
|
timeText?: string;
|
|
20
24
|
onClick?: () => void;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import { CHIP_BASE_CLASS,
|
|
3
|
+
import { CHIP_BASE_CLASS, resolveEventColor } from "../../event-meta";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 事件卡:旧版 Calendar 的观感 —— 每个分类一个固定的浅色满底,深色文字压在上面。
|
|
6
|
+
*
|
|
7
|
+
* 颜色走 resolveEventColor:Task / Case / Work 各用自己那一格,其余分类统一用 Others
|
|
8
|
+
* 那一格 —— 与图例圆点、侧栏 / 底部条圆点是同一个入口,所以同一条事件到处同色。
|
|
9
|
+
* 底色与描边同色;颜色是运行时算出的 hex,所以用内联 style 而不是 Tailwind 类。
|
|
6
10
|
*
|
|
7
11
|
* 月 / 周视图只显示标题;日视图由 FullCalendar 额外给出 timeText,
|
|
8
12
|
* 于是多渲染一行时间文案(对应日历稿里的 `10AM-10:30AM`)。
|
|
@@ -13,8 +17,11 @@ import { CHIP_BASE_CLASS, CHIP_COLOR_CLASS, CHIP_TIME_CLASS, } from "../../event
|
|
|
13
17
|
* 只负责「长什么样」——点击后打开属性面板的逻辑留在页面里
|
|
14
18
|
* (页面把节点的 source 交给 morpho-document-core 的 NodePropertiesView)。
|
|
15
19
|
*/
|
|
16
|
-
const CalendarEventChip = (props) =>
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
const CalendarEventChip = (props) => {
|
|
21
|
+
const color = resolveEventColor(props.type);
|
|
22
|
+
return (React.createElement("div", { className: classnames("calendar-event-chip", CHIP_BASE_CLASS), style: { backgroundColor: color, borderColor: color }, title: props.title, onClick: props.onClick },
|
|
23
|
+
React.createElement("div", { className: "truncate" }, props.title),
|
|
24
|
+
props.timeText ? (React.createElement("div", { className: "truncate font-normal normal-case" }, props.timeText)) : null));
|
|
25
|
+
};
|
|
19
26
|
export default CalendarEventChip;
|
|
20
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarEventChip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarEventChip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAO1B,EAAE,EAAE;IACJ,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE5C,OAAO,CACN,6BACC,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,eAAe,CAAC,EAC7D,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,EACrD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EAAE,KAAK,CAAC,OAAO;QAEtB,6BAAK,SAAS,EAAC,UAAU,IAAE,KAAK,CAAC,KAAK,CAAO;QAC5C,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjB,6BAAK,SAAS,EAAC,kCAAkC,IAAE,KAAK,CAAC,QAAQ,CAAO,CACxE,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -28,8 +28,8 @@ export const POPOVER_LIST_MAX_HEIGHT = POPOVER_MAX_HEIGHT - POPOVER_HEADER_HEIGH
|
|
|
28
28
|
* 通栏标题(分类圆点 + 大写分类名,浅底、贴顶)+ 可滚动的条目列表,
|
|
29
29
|
* 每条左侧标题、右侧日期(弱化色)。
|
|
30
30
|
*
|
|
31
|
-
* 圆点直接用 item.
|
|
32
|
-
*
|
|
31
|
+
* 圆点直接用 item.dotColor(buildLegendCategories 按 resolveEventColor 取好的值):
|
|
32
|
+
* 颜色是运行时算出的 hex,所以写内联 style;圆点与事件卡底色是同一个值。
|
|
33
33
|
*
|
|
34
34
|
* 列表用 Scrollbars 而不是 overflow-y-auto:浮层是「内容撑高、超过上限才滚」,
|
|
35
35
|
* 所以走 autoHeight + autoHeightMax —— 这种模式下容器与滚动视图都带 max-height,
|
|
@@ -42,7 +42,7 @@ const CategoryPopover = (props) => {
|
|
|
42
42
|
const { category, onSelectEvent } = props;
|
|
43
43
|
return (React.createElement("div", { className: "flex w-64 flex-col bg-bg-white" },
|
|
44
44
|
React.createElement("div", { className: "flex items-center gap-2 px-4 h-11 shrink-0 border-b border-border bg-bg-table" },
|
|
45
|
-
React.createElement("span", { className:
|
|
45
|
+
React.createElement("span", { className: "w-2 h-2 rounded-full inline-block shrink-0", style: { backgroundColor: category.dotColor } }),
|
|
46
46
|
React.createElement("span", { className: "text-xs font-bold uppercase tracking-wide text-font-primary truncate" }, category.type)),
|
|
47
47
|
React.createElement(Scrollbars, { autoHide: true, autoHeight: true, autoHeightMin: 0, autoHeightMax: POPOVER_LIST_MAX_HEIGHT, className: "calendar-legend-popover-list" },
|
|
48
48
|
React.createElement("ul", { className: "text-sm text-font-primary" }, category.events.map((event) => (React.createElement("li", { key: event.id, className: "flex items-center justify-between gap-3 px-4 py-2.5 cursor-pointer", onClick: () => onSelectEvent?.(event.source) },
|
|
@@ -81,7 +81,7 @@ const CalendarLegend = (props) => {
|
|
|
81
81
|
};
|
|
82
82
|
return (React.createElement("div", { className: "flex items-center gap-6 px-6 h-[60px] text-sm text-font-primary font-medium flex-wrap border-t border-b border-border bg-bg-table" }, buildLegendCategories(props.categories).map((item) => {
|
|
83
83
|
const label = (React.createElement("span", { key: item.type, className: classnames("flex items-center gap-1", item.count > 0 ? "cursor-pointer" : "cursor-default") },
|
|
84
|
-
React.createElement("span", { className:
|
|
84
|
+
React.createElement("span", { className: "w-2 h-2 rounded-full inline-block mr-0.5", style: { backgroundColor: item.dotColor } }),
|
|
85
85
|
React.createElement("span", { className: "font-bold" }, item.count),
|
|
86
86
|
item.type));
|
|
87
87
|
// 0 计数没有内容可看,只作占位
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarLegend/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACN,qBAAqB,EACrB,eAAe,EACf,aAAa,GAIb,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,MAAM,aAAa,GAClB,qLAAqL,CAAC;AAEvL,mCAAmC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAElF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,eAAe,GAAG,CAAC,KAGxB,EAAE,EAAE;IACJ,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAE1C,OAAO,CACN,6BAAK,SAAS,EAAC,gCAAgC;QAC9C,6BAAK,SAAS,EAAC,+EAA+E;YAC7F,8BACC,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarLegend/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAA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AAE,aAAa,EAAE,EACnC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC,IAAI,EAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EACjE,OAAO,EAAE,oBAAC,eAAe,IAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,GAAI,IAE7E,KAAK,CACG,CACV,CAAC;IACH,CAAC,CAAC,CACG,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { CalendarBoardSource, IUpcomingEvent } from "../../event-meta";
|
|
3
3
|
import type { CalendarSidebarTab } from "../../pages/CalendarBoard/state";
|
|
4
4
|
/**
|
|
5
5
|
* 右侧栏:Search / UPCOMING·ACTIVITY / UPCOMING DEADLINES。
|
|
@@ -3,7 +3,6 @@ import classnames from "classnames";
|
|
|
3
3
|
import { Empty } from "antd";
|
|
4
4
|
import { FontAwesomeIcon as FAIcon, faSearchRegular } from "@voplus/morpho-ui/es/faIcons";
|
|
5
5
|
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
6
|
-
import { DOT_COLOR_CLASS } from "../../event-meta";
|
|
7
6
|
/**
|
|
8
7
|
* 右侧栏:Search / UPCOMING·ACTIVITY / UPCOMING DEADLINES。
|
|
9
8
|
*
|
|
@@ -36,7 +35,7 @@ const CalendarSidebar = (props) => (React.createElement("aside", { className: cl
|
|
|
36
35
|
React.createElement("ul", { className: "flex flex-col gap-2.5 pb-4" },
|
|
37
36
|
props.upcoming.map((item) => (React.createElement("li", { key: item.id, className: "flex items-start justify-between gap-2 cursor-pointer border border-border rounded-base p-3.5", onClick: () => props.onSelectEvent(item.source) },
|
|
38
37
|
React.createElement("div", { className: "flex items-start gap-2 min-w-0" },
|
|
39
|
-
React.createElement("span", { className:
|
|
38
|
+
React.createElement("span", { className: "w-2 h-2 rounded-full mt-1.5 inline-block shrink-0", style: { backgroundColor: item.color } }),
|
|
40
39
|
React.createElement("div", { className: "min-w-0" },
|
|
41
40
|
React.createElement("div", { className: "text-sm font-bold text-font-primary truncate" }, item.title),
|
|
42
41
|
React.createElement("div", { className: "text-sm font-semibold text-font-grey" }, item.timeLabel))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarSidebar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarSidebar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,eAAe,GAAG,CAAC,KAcxB,EAAE,EAAE,CAAC,CACL,+BACC,SAAS,EAAE,UAAU,CACpB,kGAAkG,EAClG,KAAK,CAAC,SAAS,CACf;IAED,6BAAK,SAAS,EAAC,cAAc;QAC5B,6BAAK,SAAS,EAAC,UAAU;YACxB,oBAAC,MAAM,IACN,IAAI,EAAE,e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zG,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;oBAE/C,6BAAK,SAAS,EAAC,gCAAgC;wBAE9C,8BACC,SAAS,EAAC,mDAAmD,EAC7D,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,EAAE,GACrC;wBACF,6BAAK,SAAS,EAAC,SAAS;4BACvB,6BAAK,SAAS,EAAC,8CAA8C,IAC3D,IAAI,CAAC,KAAK,CACN;4BACN,6BAAK,SAAS,EAAC,sCAAsC,IAAE,IAAI,CAAC,SAAS,CAAO,CACvE,CACD;oBACN,8BAAM,SAAS,EAAC,oDAAoD,IAClE,IAAI,CAAC,cAAc,CACd,CACH,CACL,CAAC;gBACD,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CAC1E,CACA,CACN,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,kCAAkC;YAEhD,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CACzC,CACN,CACW,CACR,CACC,CACR,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { IUpcomingEvent } from "../../event-meta";
|
|
3
3
|
/** 没有 upcoming 时的圆点:中性灰,不拿某个分类色冒充 */
|
|
4
4
|
export declare const UPCOMING_BAR_EMPTY_DOT_CLASS = "bg-bg-grey";
|
|
5
5
|
/** 没有 upcoming 时的占位文案(面板里那块会显示 antd Empty) */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { FontAwesomeIcon as FAIcon, faAngleRightRegular } from "@voplus/morpho-ui/es/faIcons";
|
|
4
|
-
import { DOT_COLOR_CLASS } from "../../event-meta";
|
|
5
4
|
/** 没有 upcoming 时的圆点:中性灰,不拿某个分类色冒充 */
|
|
6
5
|
export const UPCOMING_BAR_EMPTY_DOT_CLASS = "bg-bg-grey";
|
|
7
6
|
/** 没有 upcoming 时的占位文案(面板里那块会显示 antd Empty) */
|
|
@@ -26,7 +25,7 @@ const CalendarUpcomingBar = (props) => (React.createElement("button", { type: "b
|
|
|
26
25
|
React.createElement("span", { className: "field-label shrink-0" }, "UPCOMING"),
|
|
27
26
|
React.createElement("span", { className: "h-4.5 px-1.5 leading-4 rounded-full bg-font-secondary text-2xs text-white" }, props.total),
|
|
28
27
|
React.createElement("span", { className: "min-w-0 flex-1 flex items-center gap-1.5 truncate text-sm font-bold text-font-primary" },
|
|
29
|
-
React.createElement("span", { className: classnames("calendar-upcoming-dot inline-block h-1.5 w-1.5 rounded-full", props.first ?
|
|
28
|
+
React.createElement("span", { className: classnames("calendar-upcoming-dot inline-block h-1.5 w-1.5 rounded-full", props.first ? undefined : UPCOMING_BAR_EMPTY_DOT_CLASS), style: props.first ? { backgroundColor: props.first.color } : undefined }),
|
|
30
29
|
props.first?.title ?? UPCOMING_BAR_EMPTY_TEXT,
|
|
31
30
|
React.createElement("span", { className: "font-medium" }, props.first?.timeLabel),
|
|
32
31
|
React.createElement("span", { className: "text-font-secondary" }, props.first?.remainingLabel)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarUpcomingBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar-board/components/CalendarUpcomingBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,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"source"> & {
|
|
|
26
26
|
source?: CalendarBoardSource;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
+
/** 哈希取色并按需缓存:生成函数内部要做一次 SHA-256,同一 type 没必要每次重渲染都算 */
|
|
30
|
+
export declare const eventColor: (type: string) => string;
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* 两个颜色的感知距离(CIE76 ΔE)。
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
* 与现有 CalendarMonth 用 generateLightColorFromHash(source.type) 的意图一致。
|
|
34
|
+
* 大致标尺:2.3 是刚能看出的差别,10 左右能分辨但容易混,18 以上才适合当分类色。
|
|
34
35
|
*/
|
|
35
|
-
export declare const
|
|
36
|
+
export declare const colorDistance: (a: string, b: string) => number;
|
|
37
|
+
/** 同一页里两个分类色的最小距离:低于它就该换色,否则一眼分不清谁是谁 */
|
|
38
|
+
export declare const MIN_COLOR_DISTANCE = 18;
|
|
36
39
|
/**
|
|
37
|
-
*
|
|
40
|
+
* 页面配色表:type → 唯一颜色。
|
|
38
41
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* 圆点都取它(见 resolveEventColor),所以「不属于固定分类」这件事一眼可辨。
|
|
42
|
+
* 进表的只有**展示用的四个颜色**:固定分类 Task / Case / Work 各一色,其余一切分类
|
|
43
|
+
* (Meeting / Deadline / Holiday … 以及没有 type 的 Other)折叠成 Others 一色。
|
|
42
44
|
*
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
45
|
+
* 哈希保证「同一 type 恒定一色」,但保证不了「同一页里几个颜色互相分得开」——
|
|
46
|
+
* 实测 Task(#97df97) 与 Deadline(#a5df83)、Meeting(#c0c0be) 与 Reminder(#b0cacd)
|
|
47
|
+
* 的 ΔE 都不到 11,放在同一页就是一堆近似色。所以这里在哈希之上再加一道去重:
|
|
48
|
+
*
|
|
49
|
+
* - 分配顺序固定为「固定分类 Task / Case / Work → Others → 其余 type 按字母序」,
|
|
50
|
+
* 与传入顺序无关;固定分类先占位,最常用的三个颜色不会被别的分类顶掉;
|
|
51
|
+
* - 每个 type 先用自己的哈希色;与已占位置冲突就换色相,色相转满一圈仍冲突再换亮度档,
|
|
52
|
+
* 两维都试过还排不下才退而取「距离最远」的那个;
|
|
53
|
+
* - 结果只取决于「有哪些 type 进表」,所以页面级配色表(getEventPalette)是常量,
|
|
54
|
+
* 整页各处查同一张表 —— 同一 type 的卡片与圆点必然是同一个颜色。
|
|
49
55
|
*
|
|
50
|
-
*
|
|
51
|
-
* (400 描边 + 50 浅底)。
|
|
56
|
+
* @param types 进表的分类名(页面用的是固定三项 + Others,见 getEventPalette)
|
|
52
57
|
*/
|
|
53
|
-
export declare const
|
|
54
|
-
/** 事件卡内的时间行配色,取自 calendar-day-view.html 的 `text-amber-600` / `text-red-500` */
|
|
55
|
-
export declare const CHIP_TIME_CLASS: Record<CategoryColor, string>;
|
|
58
|
+
export declare const buildEventPalette: (types: Iterable<string>) => Map<string, string>;
|
|
56
59
|
/**
|
|
57
|
-
*
|
|
60
|
+
* 事件的最终颜色:Task / Case / Work 各用自己那一格,其余一切(含没有 source.type 的
|
|
61
|
+
* Other)一律用 Others 那一格。
|
|
58
62
|
*
|
|
59
|
-
*
|
|
63
|
+
* 整页四个位置(事件卡底色、图例圆点、侧栏 UPCOMING 圆点、底部条圆点)都调这一个函数,
|
|
64
|
+
* 所以同一个分类在这几处永远是同一个颜色;「其他分类」也因此在整页是一种颜色,
|
|
65
|
+
* 不会出现「图例里 Others 是 A 色、网格里那几条却是各自的 B/C/D 色」。
|
|
60
66
|
*/
|
|
61
|
-
export declare const
|
|
67
|
+
export declare const resolveEventColor: (type: string) => string;
|
|
62
68
|
/**
|
|
63
|
-
*
|
|
69
|
+
* 事件卡外壳:旧版 Calendar 的卡片外观是「满底浅色 + 深色文字」,
|
|
70
|
+
* 字号沿用旧版的事件标题档位(14px,与 --font-size-sm 同值)。
|
|
64
71
|
*
|
|
72
|
+
* 其余保持 CalendarBoard 现有样式(大写字重、左侧粗描边、圆角、内边距)不动。
|
|
65
73
|
* 用 overflow-hidden 而不是 truncate:日视图的卡片里还有第二行时间文案,
|
|
66
74
|
* 文字截断交给内层每一行的 truncate。
|
|
67
75
|
*/
|
|
68
|
-
export declare const CHIP_BASE_CLASS = "border border-l-4 text-
|
|
76
|
+
export declare const CHIP_BASE_CLASS = "border border-l-4 text-sm text-font-primary font-bold uppercase rounded-base px-2 py-0.5 cursor-pointer overflow-hidden";
|
|
69
77
|
/** 没有 source.type 时归入的分类名 */
|
|
70
78
|
export declare const DEFAULT_CATEGORY_TYPE = "Other";
|
|
71
79
|
/** 事件的分类名(source.type) */
|
|
@@ -108,17 +116,9 @@ export declare const ACTION_SOURCE_TYPE = "Action";
|
|
|
108
116
|
* 判定只看 type:`nodeType` 运行时不一定下发(见 CalendarBoardSource.nodeType)。
|
|
109
117
|
*/
|
|
110
118
|
export declare const isActionSource: (source?: CalendarBoardSource) => boolean;
|
|
111
|
-
/**
|
|
112
|
-
* 按 source.type 去重排序后依次取色。
|
|
113
|
-
*
|
|
114
|
-
* 排序保证映射只取决于「出现了哪些 type」,与事件顺序无关,
|
|
115
|
-
* 因此事件卡、图例、侧栏分类三处拿到的颜色必然一致。
|
|
116
|
-
*/
|
|
117
|
-
export declare const buildColorMap: (types: Iterable<string>) => Map<string, CategoryColor>;
|
|
118
119
|
export interface ICategorySummary {
|
|
119
120
|
/** source.type */
|
|
120
121
|
type: string;
|
|
121
|
-
color: CategoryColor;
|
|
122
122
|
count: number;
|
|
123
123
|
/**
|
|
124
124
|
* 该分类下的事件,供图例 hover 时列出。
|
|
@@ -129,10 +129,14 @@ export interface ICategorySummary {
|
|
|
129
129
|
events: CalendarBoardEvent[];
|
|
130
130
|
}
|
|
131
131
|
export interface IEventSummary {
|
|
132
|
-
colorMap: Map<string, CategoryColor>;
|
|
133
132
|
categories: ICategorySummary[];
|
|
134
133
|
}
|
|
135
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 按 source.type 分组统计,供图例展开、侧栏与事件卡共用。
|
|
136
|
+
*
|
|
137
|
+
* 取色不挂在分类上:颜色由 resolveEventColor 按 type 现取(固定三项 + Others 一张常量表),
|
|
138
|
+
* 分类只负责计数与成员。
|
|
139
|
+
*/
|
|
136
140
|
export declare const summarizeEvents: (events: CalendarBoardEvent[]) => IEventSummary;
|
|
137
141
|
/**
|
|
138
142
|
* 图例固定展示的三个分类。
|
|
@@ -144,50 +148,31 @@ export declare const summarizeEvents: (events: CalendarBoardEvent[]) => IEventSu
|
|
|
144
148
|
export declare const LEGEND_FIXED_TYPES: readonly ["Task", "Case", "Work"];
|
|
145
149
|
/** 固定项之外的事件全部折叠进这一项 */
|
|
146
150
|
export declare const OTHERS_CATEGORY_TYPE = "Others";
|
|
147
|
-
/**
|
|
148
|
-
* Others 的圆点颜色 = 中性色。
|
|
149
|
-
*
|
|
150
|
-
* 与网格里「其他」事件卡同一个来源(NEUTRAL_COLOR 的三张表),
|
|
151
|
-
* 所以图例圆点、事件卡、侧栏圆点在「不属于固定分类」这件事上是一致的。
|
|
152
|
-
*/
|
|
153
|
-
export declare const OTHERS_DOT_CLASS: string;
|
|
154
151
|
/**
|
|
155
152
|
* 图例的一项。
|
|
156
153
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
154
|
+
* 只带圆点用的颜色值(hex)而不是分类名:渲染点照着写 style 即可,
|
|
155
|
+
* 颜色不该由组件再猜一次。
|
|
159
156
|
*/
|
|
160
157
|
export interface ILegendCategory {
|
|
161
158
|
type: string;
|
|
162
159
|
count: number;
|
|
163
160
|
events: CalendarBoardEvent[];
|
|
164
|
-
|
|
161
|
+
/** 圆点颜色:与事件卡底色同一个值(见 resolveEventColor) */
|
|
162
|
+
dotColor: string;
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* 把分类明细折叠成图例要渲染的项:固定 3 项(Task / Case / Work)+ Others。
|
|
168
166
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* 0 计数的固定项没有原色可用,按固定下标取兜底色(Task → blue、Case → red、
|
|
173
|
-
* Work → green),否则三项会一起退回首色、挤成一个颜色。
|
|
167
|
+
* 圆点颜色走 resolveEventColor,与网格里该 type 的事件卡底色是同一个值 ——
|
|
168
|
+
* 同一分类在图例与网格之间不会出现两种颜色。0 计数的固定项也照样有颜色
|
|
169
|
+
* (取色只看 type,与「当期有没有事件」无关),三项不会挤成一个颜色。
|
|
174
170
|
*
|
|
175
171
|
* Others 只在真有其他分类时出现(否则就是一个恒为 0 的多余项);它的条目是
|
|
176
172
|
* 其余分类的事件合并后按开始时间升序 —— 与单个分类浮层同一口径,不按原分类分块。
|
|
173
|
+
* 聚合项自己也是一个分类(配色表里永远占一格),所以它的圆点也是稳定一色。
|
|
177
174
|
*/
|
|
178
175
|
export declare const buildLegendCategories: (categories: ICategorySummary[]) => ILegendCategory[];
|
|
179
|
-
/**
|
|
180
|
-
* 整页事件的取色入口:固定分类(Task / Case / Work)用分类原色,其余一切用中性色。
|
|
181
|
-
*
|
|
182
|
-
* 网格里的事件卡、侧栏 UPCOMING 的圆点、小屏底部条的圆点都走这里,于是
|
|
183
|
-
* 「不在固定分类里」在整页是同一个灰 —— 否则同一条事件会出现「网格里是灰卡、
|
|
184
|
-
* 侧栏里还是蓝点」这种自相矛盾的呈现。
|
|
185
|
-
*
|
|
186
|
-
* 注意与 resolveColor 的区别:那个是纯「分类色轮转」,这里才是事件的最终颜色。
|
|
187
|
-
*/
|
|
188
|
-
export declare const resolveEventColor: (colorMap: Map<string, CategoryColor>, type: string) => CategoryColor;
|
|
189
|
-
/** 取某个分类色(按 type 轮转);映射缺失时退回色板首色。整页取色请走 resolveEventColor */
|
|
190
|
-
export declare const resolveColor: (colorMap: Map<string, CategoryColor>, type: string) => CategoryColor;
|
|
191
176
|
/**
|
|
192
177
|
* 本地过滤:搜索关键字 + 被隐藏的分类。
|
|
193
178
|
*
|
|
@@ -201,7 +186,8 @@ export interface IUpcomingEvent {
|
|
|
201
186
|
id: string;
|
|
202
187
|
title: string;
|
|
203
188
|
type: string;
|
|
204
|
-
|
|
189
|
+
/** 圆点颜色:与事件卡底色同一个值(见 resolveEventColor) */
|
|
190
|
+
color: string;
|
|
205
191
|
/** 形如 `Aug 20 | 4PM`;全天事件只有日期 */
|
|
206
192
|
timeLabel: string;
|
|
207
193
|
/** 剩余天数,形如 `10D` */
|
|
@@ -215,9 +201,12 @@ export declare const formatRemaining: (start: Date, from: dayjs.Dayjs) => string
|
|
|
215
201
|
/**
|
|
216
202
|
* UPCOMING DEADLINES:今天及以后的事件,按起始时间升序取前 N 条。
|
|
217
203
|
*
|
|
204
|
+
* 圆点颜色走 resolveEventColor(与图例、网格事件卡同一个入口):同一条事件在网格、
|
|
205
|
+
* 图例浮层、侧栏列表、小屏底部条里都是同一个颜色。
|
|
206
|
+
*
|
|
218
207
|
* @param from 以哪一天为「今天」,默认取当前时间;测试注入固定日期用。
|
|
219
208
|
*/
|
|
220
|
-
export declare const buildUpcoming: (events: CalendarBoardEvent[],
|
|
209
|
+
export declare const buildUpcoming: (events: CalendarBoardEvent[], options?: {
|
|
221
210
|
from?: dayjs.Dayjs;
|
|
222
211
|
limit?: number;
|
|
223
212
|
}) => IUpcomingEvent[];
|