|
@@ -2289,10 +2289,11 @@ function clearEvents(calendarData) {
|
|
|
calendarData.idsOfDay = {};
|
|
|
calendarData.events.clear();
|
|
|
}
|
|
|
-function createCalendarSlice(calendars = []) {
|
|
|
+function createCalendarSlice(calendars = [], attendees = []) {
|
|
|
return {
|
|
|
calendar: {
|
|
|
calendars,
|
|
|
+ attendees,
|
|
|
events: createEventCollection(),
|
|
|
idsOfDay: {}
|
|
|
}
|
|
@@ -2315,6 +2316,9 @@ function createCalendarDispatchers(set) {
|
|
|
setCalendars: (calendars) => set(produce((state) => {
|
|
|
state.calendar.calendars = calendars;
|
|
|
})),
|
|
|
+ setAttendees: (attendees) => set(produce((state) => {
|
|
|
+ state.calendar.attendees = attendees;
|
|
|
+ })),
|
|
|
setCalendarColor: (calendarId, colorOptions) => set(produce((state) => {
|
|
|
const calendars = state.calendar.calendars.map((calendar) => {
|
|
|
if (calendar.id === calendarId) {
|
|
@@ -2716,20 +2720,27 @@ const templates = {
|
|
|
milestoneTitle() {
|
|
|
return /* @__PURE__ */ h$3("span", {
|
|
|
className: cls("left-content")
|
|
|
- }, "Milestone");
|
|
|
+ }, "里程碑");
|
|
|
},
|
|
|
task(model) {
|
|
|
- return `#${model.title}`;
|
|
|
+ const classNames2 = cls("icon", "ic-task");
|
|
|
+ return /* @__PURE__ */ h$3(p$3, null, /* @__PURE__ */ h$3("span", {
|
|
|
+ className: classNames2
|
|
|
+ }), /* @__PURE__ */ h$3("span", {
|
|
|
+ style: {
|
|
|
+ backgroundColor: model.backgroundColor
|
|
|
+ }
|
|
|
+ }, stripTags(model.title)));
|
|
|
},
|
|
|
taskTitle() {
|
|
|
return /* @__PURE__ */ h$3("span", {
|
|
|
className: cls("left-content")
|
|
|
- }, "Task");
|
|
|
+ }, "任务");
|
|
|
},
|
|
|
alldayTitle() {
|
|
|
return /* @__PURE__ */ h$3("span", {
|
|
|
className: cls("left-content")
|
|
|
- }, "All Day");
|
|
|
+ }, "全天");
|
|
|
},
|
|
|
allday(model) {
|
|
|
return stripTags(model.title);
|
|
@@ -2818,7 +2829,7 @@ const templates = {
|
|
|
},
|
|
|
timegridDisplayPrimaryTime(props) {
|
|
|
const { time } = props;
|
|
|
- return toFormat(time, "hh tt");
|
|
|
+ return toFormat(time, "HH:mm");
|
|
|
},
|
|
|
timegridDisplayTime(props) {
|
|
|
const { time } = props;
|
|
@@ -2829,7 +2840,7 @@ const templates = {
|
|
|
return toFormat(time, format);
|
|
|
},
|
|
|
popupIsAllday() {
|
|
|
- return "All day";
|
|
|
+ return "全天";
|
|
|
},
|
|
|
popupStateFree() {
|
|
|
return "Free";
|
|
@@ -2838,13 +2849,26 @@ const templates = {
|
|
|
return "Busy";
|
|
|
},
|
|
|
popupCategory(category) {
|
|
|
+ switch(category){
|
|
|
+ case "milestone":
|
|
|
+ return "里程碑";
|
|
|
+ case "task":
|
|
|
+ return "任务";
|
|
|
+ case "allday":
|
|
|
+ return "全天";
|
|
|
+ case "time":
|
|
|
+ return "时间段";
|
|
|
+ }
|
|
|
return category;
|
|
|
},
|
|
|
titlePlaceholder() {
|
|
|
- return "Subject";
|
|
|
+ return "标题";
|
|
|
},
|
|
|
locationPlaceholder() {
|
|
|
- return "Location";
|
|
|
+ return "地点";
|
|
|
+ },
|
|
|
+ bodyPlaceholder() {
|
|
|
+ return "备注";
|
|
|
},
|
|
|
startDatePlaceholder() {
|
|
|
return "Start date";
|
|
@@ -2853,23 +2877,23 @@ const templates = {
|
|
|
return "End date";
|
|
|
},
|
|
|
popupSave() {
|
|
|
- return "Save";
|
|
|
+ return "保存";
|
|
|
},
|
|
|
popupUpdate() {
|
|
|
- return "Update";
|
|
|
+ return "保存";
|
|
|
},
|
|
|
popupEdit() {
|
|
|
- return "Edit";
|
|
|
+ return "编辑";
|
|
|
},
|
|
|
popupDelete() {
|
|
|
- return "Delete";
|
|
|
+ return "删除";
|
|
|
},
|
|
|
popupDetailTitle({ title }) {
|
|
|
return title;
|
|
|
},
|
|
|
popupDetailDate({ isAllday: isAllday2, start, end }) {
|
|
|
const dayFormat = "YYYY.MM.DD";
|
|
|
- const timeFormat = "hh:mm tt";
|
|
|
+ const timeFormat = "HH:mm";
|
|
|
const detailFormat = `${dayFormat} ${timeFormat}`;
|
|
|
const startDate = toFormat(start, isAllday2 ? dayFormat : timeFormat);
|
|
|
const endDateFormat = isSameDate(start, end) ? timeFormat : detailFormat;
|
|
@@ -2887,6 +2911,19 @@ const templates = {
|
|
|
popupDetailState({ state }) {
|
|
|
return state || "Busy";
|
|
|
},
|
|
|
+ popupDetailCategory({ category }) {
|
|
|
+ switch(category){
|
|
|
+ case "milestone":
|
|
|
+ return "里程碑";
|
|
|
+ case "task":
|
|
|
+ return "任务";
|
|
|
+ case "allday":
|
|
|
+ return "全天";
|
|
|
+ case "time":
|
|
|
+ return "时间段";
|
|
|
+ }
|
|
|
+ return category;
|
|
|
+ },
|
|
|
popupDetailRecurrenceRule({ recurrenceRule }) {
|
|
|
return recurrenceRule;
|
|
|
},
|
|
@@ -3041,7 +3078,7 @@ function createStore(storeCreator2) {
|
|
|
return internal;
|
|
|
}
|
|
|
const storeCreator = (options) => (set) => {
|
|
|
- return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createOptionsSlice(options)), createTemplateSlice(options.template)), createPopupSlice()), createWeekViewLayoutSlice()), createCalendarSlice(options.calendars)), createViewSlice(options.defaultView)), createDndSlice()), createGridSelectionSlice()), {
|
|
|
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createOptionsSlice(options)), createTemplateSlice(options.template)), createPopupSlice()), createWeekViewLayoutSlice()), createCalendarSlice(options.calendars, options.attendees)), createViewSlice(options.defaultView)), createDndSlice()), createGridSelectionSlice()), {
|
|
|
dispatch: {
|
|
|
options: createOptionsDispatchers(set),
|
|
|
popup: createPopupDispatchers(set),
|
|
@@ -5751,7 +5788,7 @@ function HorizontalEvent({
|
|
|
onMoveStart(e2);
|
|
|
};
|
|
|
const isDotEvent = !isDraggingTarget && currentView === "month" && uiModel.model.category === "time" && isSameDate(uiModel.model.start, uiModel.model.end);
|
|
|
- const shouldHideResizeHandler = !isDraggableEvent2 || flat || isDraggingTarget || uiModel.exceedRight;
|
|
|
+ const shouldHideResizeHandler = !isDraggableEvent2 || flat || isDraggingTarget || uiModel.exceedRight || uiModel.model.category === "milestone" || uiModel.model.category === "task";
|
|
|
const containerStyle = getContainerStyle({
|
|
|
uiModel,
|
|
|
eventHeight,
|
|
@@ -5879,7 +5916,7 @@ function useAlldayGridRowEventMove({ rowStyleInfo, gridPositionFinder }) {
|
|
|
return null;
|
|
|
}
|
|
|
const newColumnIndex = targetEventStartGridX + columnIndex - startGridXRef.current;
|
|
|
- return newColumnIndex < 0 ? -rowStyleInfo[-newColumnIndex].left : rowStyleInfo[newColumnIndex].left;
|
|
|
+ return newColumnIndex < 0 ? (rowStyleInfo[-newColumnIndex] ? -rowStyleInfo[-newColumnIndex].left : 0) : (rowStyleInfo[newColumnIndex] ? rowStyleInfo[newColumnIndex].left : 0);
|
|
|
}, [columnIndex, rowStyleInfo, targetEventStartGridX]);
|
|
|
_$2(() => {
|
|
|
if (isNil(startGridXRef.current) && isPresent(columnIndex)) {
|
|
@@ -6342,9 +6379,12 @@ const classNames$j = {
|
|
|
locationIcon: cls("icon", "ic-location-b"),
|
|
|
repeatIcon: cls("icon", "ic-repeat-b"),
|
|
|
userIcon: cls("icon", "ic-user-b"),
|
|
|
+ attendeesIconB: cls("icon", "ic-attendees-b"),
|
|
|
+ attendeesIcon: cls("icon", "ic-attendees"),
|
|
|
stateIcon: cls("icon", "ic-state-b"),
|
|
|
categoryIcon: cls("icon", "ic-category-b"),
|
|
|
- calendarDotIcon: cls("icon", "calendar-dot")
|
|
|
+ calendarDotIcon: cls("icon", "calendar-dot"),
|
|
|
+ detailAttendees: cls("detail-attendees")
|
|
|
};
|
|
|
function EventDetailSectionDetail({ event }) {
|
|
|
var _a, _b;
|
|
@@ -6375,23 +6415,13 @@ function EventDetailSectionDetail({ event }) {
|
|
|
}))), attendees && /* @__PURE__ */ h$3("div", {
|
|
|
className: classNames$j.detailItemIndent
|
|
|
}, /* @__PURE__ */ h$3("span", {
|
|
|
- className: classNames$j.userIcon
|
|
|
+ className: classNames$j.attendeesIconB
|
|
|
}), /* @__PURE__ */ h$3("span", {
|
|
|
className: classNames$j.content
|
|
|
}, /* @__PURE__ */ h$3(Template, {
|
|
|
template: "popupDetailAttendees",
|
|
|
param: event,
|
|
|
as: "span"
|
|
|
- }))), state && /* @__PURE__ */ h$3("div", {
|
|
|
- className: classNames$j.detailItem
|
|
|
- }, /* @__PURE__ */ h$3("span", {
|
|
|
- className: classNames$j.stateIcon
|
|
|
- }), /* @__PURE__ */ h$3("span", {
|
|
|
- className: classNames$j.content
|
|
|
- }, /* @__PURE__ */ h$3(Template, {
|
|
|
- template: "popupDetailState",
|
|
|
- param: event,
|
|
|
- as: "span"
|
|
|
}))), category && /* @__PURE__ */ h$3("div", {
|
|
|
className: classNames$j.detailItem
|
|
|
}, /* @__PURE__ */ h$3("span", {
|
|
@@ -6590,8 +6620,10 @@ function EventDetailPopup() {
|
|
|
end = new TZDate(),
|
|
|
location: location2,
|
|
|
state,
|
|
|
+ category,
|
|
|
isReadOnly,
|
|
|
- isPrivate
|
|
|
+ isPrivate,
|
|
|
+ body,
|
|
|
} = event;
|
|
|
const popupArrowPointPosition = {
|
|
|
top: eventRect.top + eventRect.height / 2,
|
|
@@ -6609,6 +6641,8 @@ function EventDetailPopup() {
|
|
|
isAllday: isAllday2,
|
|
|
isPrivate,
|
|
|
eventState: state,
|
|
|
+ eventCategory: category,
|
|
|
+ body,
|
|
|
popupArrowPointPosition
|
|
|
});
|
|
|
} else {
|
|
@@ -6725,6 +6759,7 @@ var FormStateActionType = /* @__PURE__ */ ((FormStateActionType2) => {
|
|
|
FormStateActionType2["setAllday"] = "setAllday";
|
|
|
FormStateActionType2["setState"] = "setState";
|
|
|
FormStateActionType2["setCategory"] = "setCategory";
|
|
|
+ FormStateActionType2["setBody"] = "setBody";
|
|
|
FormStateActionType2["reset"] = "reset";
|
|
|
return FormStateActionType2;
|
|
|
})(FormStateActionType || {});
|
|
@@ -6735,6 +6770,8 @@ const defaultFormState = {
|
|
|
isPrivate: false,
|
|
|
state: "Busy",
|
|
|
category: "task",
|
|
|
+ attendees: null,
|
|
|
+ body: "",
|
|
|
};
|
|
|
function formStateReducer(state, action) {
|
|
|
switch (action.type) {
|
|
@@ -6754,6 +6791,8 @@ function formStateReducer(state, action) {
|
|
|
return __spreadProps(__spreadValues({}, state), { state: action.state });
|
|
|
case "setCategory":
|
|
|
return __spreadProps(__spreadValues({}, state), { category: action.category });
|
|
|
+ case "setBody":
|
|
|
+ return __spreadProps(__spreadValues({}, state), { body: action.body });
|
|
|
case "reset":
|
|
|
return __spreadValues(__spreadValues({}, state), defaultFormState);
|
|
|
default:
|
|
@@ -7060,6 +7099,33 @@ function EventCategorySelector({ eventCategory = "task", formStateDispatch }) {
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
+const classNames$body = {
|
|
|
+ popupSectionItem: cls("popup-section-item", "popup-section-body"),
|
|
|
+ bodyIcon: cls("icon", "ic-body"),
|
|
|
+ content: cls("content")
|
|
|
+};
|
|
|
+
|
|
|
+function BodyInputBox({ body, formStateDispatch }) {
|
|
|
+ const bodyPlaceholder = useStringOnlyTemplate({
|
|
|
+ template: "bodyPlaceholder",
|
|
|
+ defaultValue: "comments"
|
|
|
+ });
|
|
|
+ const handleBodyChange = (e2) => {
|
|
|
+ formStateDispatch({ type: FormStateActionType.setBody, body: e2.currentTarget.value });
|
|
|
+ };
|
|
|
+ return /* @__PURE__ */ h$3(PopupSection, null, /* @__PURE__ */ h$3("div", {
|
|
|
+ className: classNames$body.popupSectionItem
|
|
|
+ }, /* @__PURE__ */ h$3("span", {
|
|
|
+ className: classNames$body.bodyIcon
|
|
|
+ }), /* @__PURE__ */ h$3("input", {
|
|
|
+ name: "body",
|
|
|
+ className: classNames$body.content,
|
|
|
+ placeholder: bodyPlaceholder,
|
|
|
+ value: body,
|
|
|
+ onChange: handleBodyChange
|
|
|
+ })));
|
|
|
+}
|
|
|
+
|
|
|
const classNames$9 = {
|
|
|
popupSectionItem: cls("popup-section-item", "popup-section-location"),
|
|
|
locationIcon: cls("icon", "ic-location"),
|
|
@@ -7169,13 +7235,16 @@ function getChanges(event, eventObject) {
|
|
|
}
|
|
|
function EventFormPopup() {
|
|
|
var _a;
|
|
|
- const { calendars } = useStore(calendarSelector);
|
|
|
+ const { calendars, attendees } = useStore(calendarSelector);
|
|
|
const { hideAllPopup } = useDispatch("popup");
|
|
|
const popupParams = useStore(eventFormPopupParamSelector);
|
|
|
const { start, end, popupArrowPointPosition, close, isCreationPopup, event } = popupParams != null ? popupParams : {};
|
|
|
const eventBus = useEventBus();
|
|
|
const formPopupSlot = useFloatingLayer("formPopupSlot");
|
|
|
const [formState, formStateDispatch] = useFormState((_a = calendars[0]) == null ? void 0 : _a.id);
|
|
|
+ if (!formState.attendees) {
|
|
|
+ formState.attendees = attendees;
|
|
|
+ }
|
|
|
const datePickerRef = s$2(null);
|
|
|
const popupContainerRef = s$2(null);
|
|
|
const [style, setStyle] = y$1({});
|
|
@@ -7204,11 +7273,14 @@ function EventFormPopup() {
|
|
|
type: FormStateActionType.init,
|
|
|
event: {
|
|
|
title: popupParams.title,
|
|
|
+ body: popupParams.body,
|
|
|
location: popupParams.location,
|
|
|
isAllday: popupParams.isAllday,
|
|
|
isPrivate: popupParams.isPrivate,
|
|
|
calendarId: event.calendarId,
|
|
|
- state: popupParams.eventState
|
|
|
+ state: popupParams.eventState,
|
|
|
+ category: popupParams.eventCategory,
|
|
|
+ attendees: event.attendees,
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -7256,8 +7328,8 @@ function EventFormPopup() {
|
|
|
title: formState.title,
|
|
|
isPrivate: formState.isPrivate,
|
|
|
formStateDispatch
|
|
|
- }), /* @__PURE__ */ h$3(LocationInputBox, {
|
|
|
- location: formState.location,
|
|
|
+ }), /* @__PURE__ */ h$3(BodyInputBox, {
|
|
|
+ body: formState.body,
|
|
|
formStateDispatch
|
|
|
}), /* @__PURE__ */ h$3(DateSelector, {
|
|
|
start,
|
|
@@ -7268,7 +7340,17 @@ function EventFormPopup() {
|
|
|
}), /* @__PURE__ */ h$3(EventCategorySelector, {
|
|
|
eventCategory: formState.category,
|
|
|
formStateDispatch
|
|
|
- }), /* @__PURE__ */ h$3(ClosePopupButton, {
|
|
|
+ }), /* @__PURE__ */ h$3("div", {
|
|
|
+ className: classNames$j.detailAttendees
|
|
|
+ }, /* @__PURE__ */ h$3("div", {
|
|
|
+ className: classNames$j.attendeesIcon
|
|
|
+ }), /* @__PURE__ */ h$3("span", {
|
|
|
+ className: classNames$j.content
|
|
|
+ }, /* @__PURE__ */ h$3(Template, {
|
|
|
+ template: "popupDetailAttendees",
|
|
|
+ param: formState,
|
|
|
+ as: "span"
|
|
|
+ }))), /* @__PURE__ */ h$3(ClosePopupButton, {
|
|
|
type: "form",
|
|
|
close
|
|
|
}), /* @__PURE__ */ h$3(PopupSection, null, /* @__PURE__ */ h$3(ConfirmPopupButton, null, isCreationPopup ? /* @__PURE__ */ h$3(Template, {
|
|
@@ -10598,10 +10680,14 @@ class CalendarCore {
|
|
|
const { setCalendars } = this.getStoreDispatchers().calendar;
|
|
|
setCalendars(calendars);
|
|
|
}
|
|
|
+ setAttendees(attendees) {
|
|
|
+ const { setAttendees } = this.getStoreDispatchers().calendar;
|
|
|
+ setAttendees(attendees);
|
|
|
+ }
|
|
|
openFormPopup(event) {
|
|
|
const { showFormPopup } = this.getStoreDispatchers().popup;
|
|
|
const eventModel = new EventModel(event);
|
|
|
- const { title, location: location2, start, end, isAllday: isAllday2, isPrivate, state: eventState } = eventModel;
|
|
|
+ const { title, location: location2, start, end, isAllday: isAllday2, isPrivate, state: eventState, category: eventCategory } = eventModel;
|
|
|
showFormPopup({
|
|
|
isCreationPopup: true,
|
|
|
event: eventModel,
|
|
@@ -10611,7 +10697,8 @@ class CalendarCore {
|
|
|
end,
|
|
|
isAllday: isAllday2,
|
|
|
isPrivate,
|
|
|
- eventState
|
|
|
+ eventState,
|
|
|
+ eventCategory,
|
|
|
});
|
|
|
}
|
|
|
clearGridSelections() {
|