@voplus/morpho-workspace 11.2.4 → 11.2.6
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/{calendar/CalendarRoutes.d.ts → calendar-board/CalendarBoardRoutes.d.ts} +2 -1
- package/es/modules/{calendar/CalendarRoutes.js → calendar-board/CalendarBoardRoutes.js} +10 -9
- package/es/modules/calendar-board/CalendarBoardRoutes.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarActionProperties/index.d.ts +20 -0
- package/es/modules/calendar-board/components/CalendarActionProperties/index.js +36 -0
- package/es/modules/calendar-board/components/CalendarActionProperties/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.d.ts +45 -0
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.js +89 -0
- package/es/modules/calendar-board/components/CalendarBoardGrid/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarEventChip/index.d.ts +22 -0
- package/es/modules/calendar-board/components/CalendarEventChip/index.js +20 -0
- package/es/modules/calendar-board/components/CalendarEventChip/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarLegend/index.d.ts +42 -0
- package/es/modules/calendar-board/components/CalendarLegend/index.js +94 -0
- package/es/modules/calendar-board/components/CalendarLegend/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarMoreLink/index.d.ts +11 -0
- package/es/modules/calendar-board/components/CalendarMoreLink/index.js +12 -0
- package/es/modules/calendar-board/components/CalendarMoreLink/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarSidebar/index.d.ts +34 -0
- package/es/modules/calendar-board/components/CalendarSidebar/index.js +45 -0
- package/es/modules/calendar-board/components/CalendarSidebar/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarToolbar/index.d.ts +30 -0
- package/es/modules/calendar-board/components/CalendarToolbar/index.js +30 -0
- package/es/modules/calendar-board/components/CalendarToolbar/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.d.ts +30 -0
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.js +35 -0
- package/es/modules/calendar-board/components/CalendarUpcomingBar/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarUpcomingEntry/index.d.ts +25 -0
- package/es/modules/calendar-board/components/CalendarUpcomingEntry/index.js +35 -0
- package/es/modules/calendar-board/components/CalendarUpcomingEntry/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarViewFilter/index.d.ts +19 -0
- package/es/modules/calendar-board/components/CalendarViewFilter/index.js +29 -0
- package/es/modules/calendar-board/components/CalendarViewFilter/index.js.map +1 -0
- package/es/modules/calendar-board/components/CalendarViewSwitcher/index.d.ts +14 -0
- package/es/modules/calendar-board/components/CalendarViewSwitcher/index.js +15 -0
- package/es/modules/calendar-board/components/CalendarViewSwitcher/index.js.map +1 -0
- package/es/modules/calendar-board/event-meta.d.ts +262 -0
- package/es/modules/calendar-board/event-meta.js +329 -0
- package/es/modules/calendar-board/event-meta.js.map +1 -0
- package/es/modules/calendar-board/layout.d.ts +27 -0
- package/es/modules/calendar-board/layout.js +20 -0
- package/es/modules/calendar-board/layout.js.map +1 -0
- package/es/modules/calendar-board/pages/CalendarBoard/index.css +262 -0
- package/es/modules/calendar-board/pages/CalendarBoard/index.d.ts +4 -0
- package/es/modules/calendar-board/pages/CalendarBoard/index.js +323 -0
- package/es/modules/calendar-board/pages/CalendarBoard/index.js.map +1 -0
- package/es/modules/calendar-board/pages/CalendarBoard/state.d.ts +112 -0
- package/es/modules/calendar-board/pages/CalendarBoard/state.js +206 -0
- package/es/modules/calendar-board/pages/CalendarBoard/state.js.map +1 -0
- package/es/modules/calendar-board/sidebar-data.d.ts +35 -0
- package/es/modules/calendar-board/sidebar-data.js +28 -0
- package/es/modules/calendar-board/sidebar-data.js.map +1 -0
- package/es/modules/meeting/components/NewMeetingForm/index.js +1 -1
- package/es/modules/meeting/components/NewMeetingForm/index.js.map +1 -1
- package/es/modules/project/ProjectDefaultView/index.js +2 -2
- package/es/modules/project/ProjectDefaultView/index.js.map +1 -1
- package/es/routes.js +2 -2
- package/es/routes.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/calendar/CalendarRoutes.js.map +0 -1
- package/es/modules/calendar/components/ActionCard/index.d.ts +0 -7
- package/es/modules/calendar/components/ActionCard/index.js +0 -12
- package/es/modules/calendar/components/ActionCard/index.js.map +0 -1
- package/es/modules/calendar/components/CalendarEventContent/index.d.ts +0 -11
- package/es/modules/calendar/components/CalendarEventContent/index.js +0 -10
- package/es/modules/calendar/components/CalendarEventContent/index.js.map +0 -1
- package/es/modules/calendar/components/CalendarMenu/index.css +0 -30
- package/es/modules/calendar/components/CalendarMenu/index.d.ts +0 -7
- package/es/modules/calendar/components/CalendarMenu/index.js +0 -52
- package/es/modules/calendar/components/CalendarMenu/index.js.map +0 -1
- package/es/modules/calendar/pages/CalendarMonth/index.css +0 -248
- package/es/modules/calendar/pages/CalendarMonth/index.d.ts +0 -4
- package/es/modules/calendar/pages/CalendarMonth/index.js +0 -190
- package/es/modules/calendar/pages/CalendarMonth/index.js.map +0 -1
- package/es/modules/calendar/pages/CalendarMonth/state.d.ts +0 -11
- package/es/modules/calendar/pages/CalendarMonth/state.js +0 -58
- package/es/modules/calendar/pages/CalendarMonth/state.js.map +0 -1
- package/es/modules/my-document/SectionTemplate/documentGroups.test.d.ts +0 -1
- package/es/modules/my-document/SectionTemplate/documentGroups.test.js +0 -63
- package/es/modules/my-document/SectionTemplate/documentGroups.test.js.map +0 -1
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
.calendar-view {
|
|
2
|
-
background-color: var(--background-color-base);
|
|
3
|
-
.calendar-content {
|
|
4
|
-
height: 100%;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
background-color: var(--background-color-base);
|
|
8
|
-
padding: 20px 0;
|
|
9
|
-
}
|
|
10
|
-
.calendar-header {
|
|
11
|
-
display: flex;
|
|
12
|
-
height: 60px;
|
|
13
|
-
align-items: center;
|
|
14
|
-
background: #f4f5f6;
|
|
15
|
-
padding: 0 40px;
|
|
16
|
-
.calendar-left {
|
|
17
|
-
width: 20%;
|
|
18
|
-
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
|
|
19
|
-
border-radius: 27px;
|
|
20
|
-
padding: 0 0 0 30px;
|
|
21
|
-
}
|
|
22
|
-
.ant-select-selection-selected-value {
|
|
23
|
-
padding: 0 10px 0 18px;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
.calendar-center {
|
|
27
|
-
width: 60%;
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
align-items: center;
|
|
31
|
-
.calendar-today {
|
|
32
|
-
height: 30px;
|
|
33
|
-
line-height: 28px;
|
|
34
|
-
color: #2c3e50;
|
|
35
|
-
border-radius: 27px;
|
|
36
|
-
padding: 0 12px;
|
|
37
|
-
margin-right: 6px;
|
|
38
|
-
}
|
|
39
|
-
.calendar-title {
|
|
40
|
-
font-size: 20px;
|
|
41
|
-
color: #1ea7fd;
|
|
42
|
-
background: transparent;
|
|
43
|
-
border: none;
|
|
44
|
-
position: relative;
|
|
45
|
-
margin: 0 10px;
|
|
46
|
-
.calendar-ant-picker {
|
|
47
|
-
position: absolute;
|
|
48
|
-
left: 0;
|
|
49
|
-
top: 0;
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: 100%;
|
|
52
|
-
opacity: 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
.calendar-title:after {
|
|
56
|
-
border: 0 none;
|
|
57
|
-
opacity: 0;
|
|
58
|
-
animation: none 0 ease 0 1 normal;
|
|
59
|
-
}
|
|
60
|
-
.calendar-prev,
|
|
61
|
-
.calendar-next {
|
|
62
|
-
width: 28px;
|
|
63
|
-
height: 28px;
|
|
64
|
-
font-size: 22px;
|
|
65
|
-
line-height: 26px;
|
|
66
|
-
text-align: center;
|
|
67
|
-
color: #888a8b;
|
|
68
|
-
border-radius: 50%;
|
|
69
|
-
padding: 0;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
.calendar-right {
|
|
73
|
-
width: 20%;
|
|
74
|
-
text-align: right;
|
|
75
|
-
.ant-dropdown-trigger {
|
|
76
|
-
display: inline-block;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
.calendar-scrollbar {
|
|
81
|
-
height: 100%;
|
|
82
|
-
margin: 0 20px;
|
|
83
|
-
background-color: var(--component-background);
|
|
84
|
-
}
|
|
85
|
-
.fc-toolbar.fc-header-toolbar {
|
|
86
|
-
height: 60px;
|
|
87
|
-
margin: 0;
|
|
88
|
-
background: #f4f5f6;
|
|
89
|
-
> div {
|
|
90
|
-
flex: 1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
.fc-center {
|
|
94
|
-
display: flex;
|
|
95
|
-
justify-content: center;
|
|
96
|
-
> div {
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
}
|
|
100
|
-
h2 {
|
|
101
|
-
font-size: 18px;
|
|
102
|
-
color: #1ea7fd;
|
|
103
|
-
font-weight: normal;
|
|
104
|
-
margin: 0 6px;
|
|
105
|
-
display: inline-block;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
.fc-button-primary {
|
|
109
|
-
color: #2c3e50;
|
|
110
|
-
background-color: #ffffff;
|
|
111
|
-
border-color: #e3e4e5;
|
|
112
|
-
}
|
|
113
|
-
.fc-button-primary:focus {
|
|
114
|
-
outline: none;
|
|
115
|
-
border-color: #e3e4e5;
|
|
116
|
-
box-shadow: none;
|
|
117
|
-
}
|
|
118
|
-
.fc-button-primary:hover {
|
|
119
|
-
color: #2c3e50;
|
|
120
|
-
background-color: #ffffff;
|
|
121
|
-
border-color: #e3e4e5;
|
|
122
|
-
box-shadow: none;
|
|
123
|
-
}
|
|
124
|
-
.fc-today-button {
|
|
125
|
-
height: 30px;
|
|
126
|
-
line-height: 30px;
|
|
127
|
-
color: #2c3e50;
|
|
128
|
-
border-radius: 27px;
|
|
129
|
-
padding: 0 12px;
|
|
130
|
-
margin-right: 6px;
|
|
131
|
-
}
|
|
132
|
-
.fc-prev-button,
|
|
133
|
-
.fc-next-button {
|
|
134
|
-
display: flex;
|
|
135
|
-
justify-content: center;
|
|
136
|
-
width: 30px;
|
|
137
|
-
height: 30px;
|
|
138
|
-
padding: 0;
|
|
139
|
-
color: #888a8b;
|
|
140
|
-
border-radius: 50%;
|
|
141
|
-
}
|
|
142
|
-
.fc-day-grid-event,
|
|
143
|
-
.fc-time-grid-event {
|
|
144
|
-
.calendar-cell-title {
|
|
145
|
-
.avatar-img {
|
|
146
|
-
width: 24px;
|
|
147
|
-
height: 24px;
|
|
148
|
-
border-radius: 50%;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
.fc-nonbusiness {
|
|
153
|
-
background: #f0f0f0;
|
|
154
|
-
}
|
|
155
|
-
/** 自动换行 */
|
|
156
|
-
.fc-daygrid-event {
|
|
157
|
-
white-space: normal;
|
|
158
|
-
}
|
|
159
|
-
.fc-daygrid-body-unbalanced {
|
|
160
|
-
width: 100% !important;
|
|
161
|
-
}
|
|
162
|
-
table.fc-scrollgrid {
|
|
163
|
-
background: #ffffff;
|
|
164
|
-
}
|
|
165
|
-
table.fc-scrollgrid-sync-table {
|
|
166
|
-
width: 100% !important;
|
|
167
|
-
}
|
|
168
|
-
table.fc-col-header {
|
|
169
|
-
width: 100% !important;
|
|
170
|
-
}
|
|
171
|
-
/** 美化滾動條*/
|
|
172
|
-
.fc .fc-scroller {
|
|
173
|
-
overflow: initial;
|
|
174
|
-
position: initial;
|
|
175
|
-
&:hover {
|
|
176
|
-
&::-webkit-scrollbar {
|
|
177
|
-
display: block;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
&::-webkit-scrollbar {
|
|
181
|
-
width: 7px;
|
|
182
|
-
height: 7px;
|
|
183
|
-
display: none;
|
|
184
|
-
}
|
|
185
|
-
/*外层轨道。可以用display:none让其不显示,也可以添加背景图片,颜色改变显示效果*/
|
|
186
|
-
&::-webkit-scrollbar-track {
|
|
187
|
-
width: 7px;
|
|
188
|
-
background-color: transparent;
|
|
189
|
-
-webkit-border-radius: 2em;
|
|
190
|
-
-moz-border-radius: 2em;
|
|
191
|
-
border-radius: 2em;
|
|
192
|
-
}
|
|
193
|
-
/*滚动条的设置*/
|
|
194
|
-
&::-webkit-scrollbar-thumb {
|
|
195
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
196
|
-
background-clip: padding-box;
|
|
197
|
-
min-height: 28px;
|
|
198
|
-
-webkit-border-radius: 2em;
|
|
199
|
-
-moz-border-radius: 2em;
|
|
200
|
-
border-radius: 2em;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.calendar-dropdown {
|
|
206
|
-
.ant-calendar {
|
|
207
|
-
top: 40px;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.vo-plus-new-form {
|
|
212
|
-
padding: 20px;
|
|
213
|
-
.new-form-header {
|
|
214
|
-
display: flex;
|
|
215
|
-
justify-content: space-between;
|
|
216
|
-
margin-bottom: 20px;
|
|
217
|
-
font-size: 16px;
|
|
218
|
-
color: #000;
|
|
219
|
-
font-weight: 500;
|
|
220
|
-
line-height: 16px;
|
|
221
|
-
.close-icon {
|
|
222
|
-
cursor: pointer;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
.new-form-view {
|
|
226
|
-
min-width: 480px;
|
|
227
|
-
padding: 0 20px;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.calendar-document-card {
|
|
232
|
-
padding: 0;
|
|
233
|
-
background: transparent;
|
|
234
|
-
|
|
235
|
-
.document-name {
|
|
236
|
-
color: #000 !important;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
.calendar-action-card {
|
|
240
|
-
color: #000;
|
|
241
|
-
font-size: 15px;
|
|
242
|
-
font-weight: 500;
|
|
243
|
-
}
|
|
244
|
-
.calendar-no-document-card {
|
|
245
|
-
color: #000;
|
|
246
|
-
font-size: 15px;
|
|
247
|
-
font-weight: 500;
|
|
248
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { AsideContent, observe, useRenderOnChange, UTCDatePicker as DatePicker, } from "@voplus/morpho-ui";
|
|
3
|
-
import { useMetaStore, useOnDeleteDocument } from "@voplus/morpho-document-core";
|
|
4
|
-
import { useOnDeleteWorkSchedule } from "../../../../data/work-schedule/work-schedule-events";
|
|
5
|
-
import { FilterOptionsContext, FilterOptionsContextState } from "@voplus/morpho-ui/es/data";
|
|
6
|
-
import { useCalendarListEffect, useCalendarStore } from "../../../../data/calendar";
|
|
7
|
-
import NodePropertiesView from "@voplus/morpho-document-core/es/components/NodePropertiesView";
|
|
8
|
-
import { useDeepMemo, useTabItem } from "@voplus/morpho-data";
|
|
9
|
-
import { FontAwesomeIcon as FAIcon, faAngleLeftRegular, faAngleRightRegular, faCalendarSolid, } from "@voplus/morpho-ui/es/faIcons";
|
|
10
|
-
import { generateLightColorFromHash } from "@voplus/morpho-org/es/tools";
|
|
11
|
-
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
12
|
-
import { Button, message, Select } from "antd";
|
|
13
|
-
import { runInAction } from "mobx";
|
|
14
|
-
import { State } from "./state";
|
|
15
|
-
import CalendarEventContent from "../../components/CalendarEventContent";
|
|
16
|
-
import EventsFilter from "../../../../controls/filters/EventsFilter";
|
|
17
|
-
import FilterView from "@voplus/morpho-ui/es/controls/FilterView";
|
|
18
|
-
import interactionPlugin from "@fullcalendar/interaction";
|
|
19
|
-
import timeGridPlugin from "@fullcalendar/timegrid";
|
|
20
|
-
import FullCalendar from "@fullcalendar/react";
|
|
21
|
-
import dayGridPlugin from "@fullcalendar/daygrid";
|
|
22
|
-
import dayjs from "dayjs";
|
|
23
|
-
import "./index.css";
|
|
24
|
-
const CalendarMonth = () => {
|
|
25
|
-
const tab = useTabItem();
|
|
26
|
-
const meta = useMetaStore();
|
|
27
|
-
const filterState = useDeepMemo(() => new FilterOptionsContextState({
|
|
28
|
-
defaults: {
|
|
29
|
-
filters: [{ c: "OwnerType", o: "contains", v1: JSON.stringify(["My"]), l: "And" }],
|
|
30
|
-
page: { Page: 1, PageSize: 200 },
|
|
31
|
-
},
|
|
32
|
-
}), []);
|
|
33
|
-
const Option = Select.Option;
|
|
34
|
-
const [state] = useState(new State());
|
|
35
|
-
const [asideContext] = useState(AsideContent.createContext());
|
|
36
|
-
const [currentTime, setCurrentTime] = useState();
|
|
37
|
-
const [calendarApi, setCalendarApi] = useState();
|
|
38
|
-
const calendarRef = useRef(null);
|
|
39
|
-
const drops = useRef(new Map());
|
|
40
|
-
const dropRevision = useRef(0);
|
|
41
|
-
const listRevision = dropRevision.current;
|
|
42
|
-
const calendar = useCalendarStore();
|
|
43
|
-
/** 设置 日历 高度 */
|
|
44
|
-
const boxRef = useCallback((node) => {
|
|
45
|
-
if (node !== null) {
|
|
46
|
-
state.height = node.clientHeight - 60;
|
|
47
|
-
// calendarRef.current.calendar.setOption("height", state.height);
|
|
48
|
-
}
|
|
49
|
-
}, []);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
runInAction(() => (tab.title = "Calendar"));
|
|
52
|
-
}, []);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
setCalendarApi(calendarRef?.current?.getApi());
|
|
55
|
-
}, [calendarRef]);
|
|
56
|
-
useOnDeleteDocument((s, doc) => {
|
|
57
|
-
state.listOptions = state.listOptions.filter((i) => i.source.id !== doc.id);
|
|
58
|
-
});
|
|
59
|
-
useOnDeleteWorkSchedule((s, doc) => {
|
|
60
|
-
state.listOptions = state.listOptions.filter((i) => i.source.id !== doc.id);
|
|
61
|
-
});
|
|
62
|
-
useRenderOnChange(() => filterState.options);
|
|
63
|
-
useCalendarListEffect(null, (list) => {
|
|
64
|
-
runInAction(() => {
|
|
65
|
-
state.listOptions = list.map((item) => {
|
|
66
|
-
item.backgroundColor = generateLightColorFromHash(item?.source?.type);
|
|
67
|
-
item.borderColor = generateLightColorFromHash(item?.source?.type);
|
|
68
|
-
item.source.title = item.title;
|
|
69
|
-
const dropped = drops.current.get(String(item.id));
|
|
70
|
-
// A load registered before saving finished can still contain the old dates.
|
|
71
|
-
if (dropped && (dropped.pending || dropped.revision > listRevision)) {
|
|
72
|
-
return { ...item, start: dropped.start, end: dropped.end };
|
|
73
|
-
}
|
|
74
|
-
if (dropped) {
|
|
75
|
-
dropped.start = item.start;
|
|
76
|
-
dropped.end = item.end;
|
|
77
|
-
}
|
|
78
|
-
return item;
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
}, filterState.options);
|
|
82
|
-
// spec:3929 — WS: 点击日历事件打开属性侧栏
|
|
83
|
-
const eventContent = (info) => {
|
|
84
|
-
return (React.createElement(CalendarEventContent, { source: info.event.extendedProps.source, onClick: () => {
|
|
85
|
-
asideContext.openAside(React.createElement(NodePropertiesView, { node: info.event.extendedProps.source }), {
|
|
86
|
-
span: 10,
|
|
87
|
-
});
|
|
88
|
-
} }));
|
|
89
|
-
};
|
|
90
|
-
return observe(() => (React.createElement(AsideContent, { context: asideContext },
|
|
91
|
-
React.createElement(Scrollbars, { autoHide: true, className: "calendar-view" },
|
|
92
|
-
React.createElement("div", { className: "calendar-content", ref: boxRef },
|
|
93
|
-
React.createElement("div", { className: "calendar-header" },
|
|
94
|
-
React.createElement("div", { className: "calendar-left" },
|
|
95
|
-
React.createElement(Select, { defaultValue: "month", className: "w-[105px]", prefix: React.createElement(FAIcon, { icon: faCalendarSolid }), onChange: handleChange, options: [
|
|
96
|
-
{ value: "month", label: "Month" },
|
|
97
|
-
{ value: "week", label: "Week" },
|
|
98
|
-
{ value: "day", label: "Day" },
|
|
99
|
-
] })),
|
|
100
|
-
React.createElement("div", { className: "calendar-center" },
|
|
101
|
-
React.createElement(Button, { className: "calendar-today", onClick: () => calendarApi.today() }, "Today"),
|
|
102
|
-
React.createElement(Button, { className: "calendar-prev", onClick: () => calendarApi.prev() },
|
|
103
|
-
React.createElement(FAIcon, { icon: faAngleLeftRegular })),
|
|
104
|
-
React.createElement("div", { className: "calendar-title" },
|
|
105
|
-
React.createElement(DatePicker, { picker: state.type === "month" ? "month" : state.type === "week" ? "week" : "date", className: "calendar-ant-picker", defaultValue: currentTime,
|
|
106
|
-
// popupClassName={"calendar-dropdown"}
|
|
107
|
-
placeholder: `Select ${state.type === "month" ? "Month" : state.type === "week" ? "Week" : "Date"}`, onChange: onChange }),
|
|
108
|
-
state.title),
|
|
109
|
-
React.createElement(Button, { className: "calendar-next", onClick: () => calendarApi.next() },
|
|
110
|
-
React.createElement(FAIcon, { icon: faAngleRightRegular }))),
|
|
111
|
-
React.createElement("div", { className: "calendar-right" },
|
|
112
|
-
React.createElement(FilterOptionsContext.Provider, { value: filterState },
|
|
113
|
-
React.createElement(FilterView, { columns: [React.createElement(EventsFilter, { key: "EventsFilter", defaultValue: ["My"] })] })))),
|
|
114
|
-
React.createElement("div", { className: "calendar-scrollbar" },
|
|
115
|
-
React.createElement(FullCalendar, { ref: calendarRef, plugins: [interactionPlugin, dayGridPlugin, timeGridPlugin], editable: true,
|
|
116
|
-
/** 限制一天中显示的事件数。其余的将显示在弹出窗口中。*/
|
|
117
|
-
dayMaxEventRows: 3, headerToolbar: false,
|
|
118
|
-
// height={650}
|
|
119
|
-
height: "100%",
|
|
120
|
-
//events={(dataInfo)=>getDate(dataInfo)}//这个要放在eventSources前,不然eventSources数据会被覆盖
|
|
121
|
-
eventSources: [state.listOptions], eventDrop: eventDrop, eventContent: eventContent, datesSet: (info) => state.datesRender(info) })))))));
|
|
122
|
-
/** 切换month,week,day视图 */
|
|
123
|
-
function handleChange(value) {
|
|
124
|
-
runInAction(() => (state.type = value));
|
|
125
|
-
if (value === "month")
|
|
126
|
-
calendarApi.changeView("dayGridMonth");
|
|
127
|
-
if (value === "week")
|
|
128
|
-
calendarApi.changeView("timeGridWeek");
|
|
129
|
-
if (value === "day")
|
|
130
|
-
calendarApi.changeView("timeGridDay");
|
|
131
|
-
}
|
|
132
|
-
/** 时间发生变化的回调 */
|
|
133
|
-
function onChange(date, dateString) {
|
|
134
|
-
const dateText = Array.isArray(dateString) ? dateString[0] : dateString;
|
|
135
|
-
setCurrentTime(date);
|
|
136
|
-
if (state.type === "week") {
|
|
137
|
-
calendarApi.gotoDate(`${dayjs(date).format("YYYY-MM-DD")}`);
|
|
138
|
-
}
|
|
139
|
-
else if (dateText) {
|
|
140
|
-
calendarApi.gotoDate(dateText);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/** 当拖动停止并且事件已移至其他日期/时间时触发。 */
|
|
144
|
-
async function eventDrop(info) {
|
|
145
|
-
const id = info.event.id;
|
|
146
|
-
const start = info.event.start ? dayjs(info.event.start) : undefined;
|
|
147
|
-
if (!info.event.extendedProps.allowChangeStart ||
|
|
148
|
-
!id ||
|
|
149
|
-
!start?.isValid() ||
|
|
150
|
-
drops.current.get(id)?.pending) {
|
|
151
|
-
info.revert();
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const before = state.listOptions.find((item) => String(item.id) === id);
|
|
155
|
-
if (!before) {
|
|
156
|
-
info.revert();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const replaceEventDates = (dates) => {
|
|
160
|
-
runInAction(() => {
|
|
161
|
-
state.listOptions = state.listOptions.map((item) => String(item.id) === id ? { ...item, start: dates.start, end: dates.end } : item);
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
const change = {
|
|
165
|
-
start: info.event.start,
|
|
166
|
-
end: info.event.end,
|
|
167
|
-
revision: ++dropRevision.current,
|
|
168
|
-
pending: true,
|
|
169
|
-
};
|
|
170
|
-
drops.current.set(id, change);
|
|
171
|
-
replaceEventDates(change);
|
|
172
|
-
try {
|
|
173
|
-
// Calendar dates use local wall time; UTC conversion can shift the saved day.
|
|
174
|
-
await calendar.edit(id, { data: { Start: start.format("YYYY-MM-DDTHH:mm:ss.SSS") } });
|
|
175
|
-
}
|
|
176
|
-
catch (error) {
|
|
177
|
-
change.start = before.start;
|
|
178
|
-
change.end = before.end;
|
|
179
|
-
replaceEventDates(change);
|
|
180
|
-
info.revert();
|
|
181
|
-
message.error(error instanceof Error ? error.message : String(error));
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
change.pending = false;
|
|
185
|
-
change.revision = ++dropRevision.current;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
export default CalendarMonth;
|
|
190
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar/pages/CalendarMonth/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACN,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,aAAa,IAAI,UAAU,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAa,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,kBAAkB,MAAM,+DAA+D,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACN,eAAe,IAAI,MAAM,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,0B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
-
accessor listOptions: any[];
|
|
3
|
-
/** FullCalendar type:month,week,day */
|
|
4
|
-
accessor type: string;
|
|
5
|
-
/** FullCalendar contentHeight */
|
|
6
|
-
accessor height: number;
|
|
7
|
-
/** FullCalendar 头部 日期 */
|
|
8
|
-
accessor title: string;
|
|
9
|
-
/** 呈现一组新日期时触发。 */
|
|
10
|
-
datesRender(info: any): void;
|
|
11
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { action, observable } from "mobx";
|
|
3
|
-
let State = (() => {
|
|
4
|
-
let _instanceExtraInitializers = [];
|
|
5
|
-
let _listOptions_decorators;
|
|
6
|
-
let _listOptions_initializers = [];
|
|
7
|
-
let _listOptions_extraInitializers = [];
|
|
8
|
-
let _type_decorators;
|
|
9
|
-
let _type_initializers = [];
|
|
10
|
-
let _type_extraInitializers = [];
|
|
11
|
-
let _height_decorators;
|
|
12
|
-
let _height_initializers = [];
|
|
13
|
-
let _height_extraInitializers = [];
|
|
14
|
-
let _title_decorators;
|
|
15
|
-
let _title_initializers = [];
|
|
16
|
-
let _title_extraInitializers = [];
|
|
17
|
-
let _datesRender_decorators;
|
|
18
|
-
return class State {
|
|
19
|
-
static {
|
|
20
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
21
|
-
_listOptions_decorators = [observable];
|
|
22
|
-
_type_decorators = [observable];
|
|
23
|
-
_height_decorators = [observable];
|
|
24
|
-
_title_decorators = [observable];
|
|
25
|
-
_datesRender_decorators = [action];
|
|
26
|
-
__esDecorate(this, null, _listOptions_decorators, { kind: "accessor", name: "listOptions", static: false, private: false, access: { has: obj => "listOptions" in obj, get: obj => obj.listOptions, set: (obj, value) => { obj.listOptions = value; } }, metadata: _metadata }, _listOptions_initializers, _listOptions_extraInitializers);
|
|
27
|
-
__esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
28
|
-
__esDecorate(this, null, _height_decorators, { kind: "accessor", name: "height", static: false, private: false, access: { has: obj => "height" in obj, get: obj => obj.height, set: (obj, value) => { obj.height = value; } }, metadata: _metadata }, _height_initializers, _height_extraInitializers);
|
|
29
|
-
__esDecorate(this, null, _title_decorators, { kind: "accessor", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
30
|
-
__esDecorate(this, null, _datesRender_decorators, { kind: "method", name: "datesRender", static: false, private: false, access: { has: obj => "datesRender" in obj, get: obj => obj.datesRender }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
31
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
32
|
-
}
|
|
33
|
-
#listOptions_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _listOptions_initializers, []));
|
|
34
|
-
get listOptions() { return this.#listOptions_accessor_storage; }
|
|
35
|
-
set listOptions(value) { this.#listOptions_accessor_storage = value; }
|
|
36
|
-
#type_accessor_storage = (__runInitializers(this, _listOptions_extraInitializers), __runInitializers(this, _type_initializers, "month"));
|
|
37
|
-
/** FullCalendar type:month,week,day */
|
|
38
|
-
get type() { return this.#type_accessor_storage; }
|
|
39
|
-
set type(value) { this.#type_accessor_storage = value; }
|
|
40
|
-
#height_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _height_initializers, void 0));
|
|
41
|
-
/** FullCalendar contentHeight */
|
|
42
|
-
get height() { return this.#height_accessor_storage; }
|
|
43
|
-
set height(value) { this.#height_accessor_storage = value; }
|
|
44
|
-
#title_accessor_storage = (__runInitializers(this, _height_extraInitializers), __runInitializers(this, _title_initializers, void 0));
|
|
45
|
-
/** FullCalendar 头部 日期 */
|
|
46
|
-
get title() { return this.#title_accessor_storage; }
|
|
47
|
-
set title(value) { this.#title_accessor_storage = value; }
|
|
48
|
-
/** 呈现一组新日期时触发。 */
|
|
49
|
-
datesRender(info) {
|
|
50
|
-
this.title = info.view.title;
|
|
51
|
-
}
|
|
52
|
-
constructor() {
|
|
53
|
-
__runInitializers(this, _title_extraInitializers);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
})();
|
|
57
|
-
export { State };
|
|
58
|
-
//# sourceMappingURL=state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/calendar/pages/CalendarMonth/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;IAE7B,KAAK;;;;;;;;;;;;;;;iBAAL,KAAK;;;uCAChB,UAAU;gCAEV,UAAU;kCAEV,UAAU;iCAEV,UAAU;uCAGV,MAAM;YATK,sLAAgB,WAAW,6BAAX,WAAW,iGAAa;YAExC,iKAAgB,IAAI,6BAAJ,IAAI,mFAAW;YAE/B,uKAAgB,MAAM,6BAAN,MAAM,uFAAU;YAEhC,oKAAgB,KAAK,6BAAL,KAAK,qFAAU;YAGnC,oLAAO,WAAW,6DAEzB;;;QAXW,iCADA,mDAAK,qDACgC,EAAE,GAAC;QAAxC,IAAgB,WAAW,iDAAa;QAAxC,IAAgB,WAAW,uDAAa;QAExC,+HAAuB,OAAO,GAAC;QAD3C,uCAAuC;QAC3B,IAAgB,IAAI,0CAAW;QAA/B,IAAgB,IAAI,gDAAW;QAE/B,qIAAgC;QAD5C,iCAAiC;QACrB,IAAgB,MAAM,4CAAU;QAAhC,IAAgB,MAAM,kDAAU;QAEhC,qIAA+B;QAD3C,0BAA0B;QACd,IAAgB,KAAK,2CAAU;QAA/B,IAAgB,KAAK,iDAAU;QAE3C,kBAAkB;QACH,WAAW,CAAC,IAAS;YACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9B,CAAC;;;;;;SAZW,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { buildGroupTree, computeExpandedRowKeys, filterVisibleGroups, groupRowId, sumGroupTotals, toggleCollapsedKey, } from "./documentGroups";
|
|
3
|
-
/** 构造测试分组(list 仅提供 data,其余字段以 any 简化) */
|
|
4
|
-
const makeGroup = (flag, total, docIds = []) => ({
|
|
5
|
-
flag,
|
|
6
|
-
title: flag,
|
|
7
|
-
icon: undefined,
|
|
8
|
-
total,
|
|
9
|
-
list: { data: docIds.map((id) => ({ id })) },
|
|
10
|
-
});
|
|
11
|
-
describe("groupRowId", () => {
|
|
12
|
-
it("生成分组行唯一 id", () => {
|
|
13
|
-
expect(groupRowId("Star")).toBe("group-Star");
|
|
14
|
-
expect(groupRowId("Urgent")).toBe("group-Urgent");
|
|
15
|
-
expect(groupRowId("None")).toBe("group-None");
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe("filterVisibleGroups", () => {
|
|
19
|
-
it("隐藏 total 为 0 的分组并保持顺序", () => {
|
|
20
|
-
const groups = [makeGroup("Star", 2), makeGroup("Urgent", 0), makeGroup("None", 3)];
|
|
21
|
-
expect(filterVisibleGroups(groups).map((g) => g.flag)).toEqual(["Star", "None"]);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe("buildGroupTree", () => {
|
|
25
|
-
it("每个可见分组生成一个分组行,children 为该分组文档", () => {
|
|
26
|
-
const groups = [
|
|
27
|
-
makeGroup("Star", 2, ["s1", "s2"]),
|
|
28
|
-
makeGroup("Urgent", 0),
|
|
29
|
-
makeGroup("None", 1, ["n1"]),
|
|
30
|
-
];
|
|
31
|
-
const rows = buildGroupTree(groups);
|
|
32
|
-
expect(rows.map((r) => r.flag)).toEqual(["Star", "None"]);
|
|
33
|
-
expect(rows[0]).toMatchObject({ id: "group-Star", isGroup: true, count: 2, name: "Star" });
|
|
34
|
-
expect(rows[0].children?.map((c) => c.id)).toEqual(["s1", "s2"]);
|
|
35
|
-
expect(rows[1].children?.map((c) => c.id)).toEqual(["n1"]);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe("computeExpandedRowKeys", () => {
|
|
39
|
-
it("默认展开所有分组行", () => {
|
|
40
|
-
const rows = buildGroupTree([makeGroup("Star", 1, ["s1"]), makeGroup("Urgent", 1, ["u1"])]);
|
|
41
|
-
expect(computeExpandedRowKeys(rows, new Set())).toEqual(["group-Star", "group-Urgent"]);
|
|
42
|
-
});
|
|
43
|
-
it("折叠的分组被排除", () => {
|
|
44
|
-
const rows = buildGroupTree([makeGroup("Star", 1, ["s1"]), makeGroup("None", 1, ["n1"])]);
|
|
45
|
-
expect(computeExpandedRowKeys(rows, new Set(["group-Star"]))).toEqual(["group-None"]);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe("toggleCollapsedKey", () => {
|
|
49
|
-
it("向 Set 添加/移除 key 且不修改原 Set", () => {
|
|
50
|
-
const base = new Set(["group-Star"]);
|
|
51
|
-
const afterAdd = toggleCollapsedKey(base, "group-None");
|
|
52
|
-
expect(afterAdd.has("group-None")).toBe(true);
|
|
53
|
-
expect(base.has("group-None")).toBe(false);
|
|
54
|
-
const afterRemove = toggleCollapsedKey(afterAdd, "group-None");
|
|
55
|
-
expect(afterRemove.has("group-None")).toBe(false);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
describe("sumGroupTotals", () => {
|
|
59
|
-
it("返回各分组 total 之和", () => {
|
|
60
|
-
expect(sumGroupTotals([makeGroup("Star", 2), makeGroup("Urgent", 0), makeGroup("None", 3)])).toBe(5);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=documentGroups.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"documentGroups.test.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