pds-dev-kit-web 2.2.211 → 2.2.213
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/dist/src/common/services/i18n/resources/en.json +14 -14
- package/dist/src/common/styles/colorSet/UIColor.json +2 -1
- package/dist/src/common/styles/colorSet/index.d.ts +125 -124
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +1 -0
- package/dist/src/common/styles/scroll/scrollbarStyle.d.ts +2 -0
- package/dist/src/common/styles/scroll/scrollbarStyle.js +4 -3
- package/dist/src/desktop/components/Calendar/Calendar.js +46 -51
- package/dist/src/desktop/components/Calendar/CalendarContext.d.ts +3 -1
- package/dist/src/desktop/components/Calendar/CalendarContext.js +2 -1
- package/dist/src/desktop/components/Calendar/DailyView.d.ts +8 -2
- package/dist/src/desktop/components/Calendar/DailyView.js +88 -7
- package/dist/src/desktop/components/Calendar/MonthlyView.d.ts +2 -1
- package/dist/src/desktop/components/Calendar/MonthlyView.js +81 -6
- package/dist/src/desktop/components/Calendar/WeeklyView.d.ts +3 -0
- package/dist/src/desktop/components/Calendar/WeeklyView.js +113 -7
- package/dist/src/desktop/components/Calendar/calendarUtils.js +20 -10
- package/dist/src/desktop/components/Calendar/types.d.ts +8 -4
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.d.ts +1 -1
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +21 -8
- package/dist/src/desktop/panels/DesktopBasicModal/DesktopBasicModal.d.ts +2 -1
- package/dist/src/desktop/panels/DesktopBasicModal/DesktopBasicModal.js +13 -15
- package/dist/src/desktop/panels/DesktopBasicModalWithTab/DesktopBasicModalWithTab.d.ts +3 -1
- package/dist/src/desktop/panels/DesktopBasicModalWithTab/DesktopBasicModalWithTab.js +16 -10
- package/dist/src/desktop/panels/DesktopHeadlessModal/DesktopHeadlessModal.d.ts +2 -1
- package/dist/src/desktop/panels/DesktopHeadlessModal/DesktopHeadlessModal.js +7 -27
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.d.ts +3 -1
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.js +11 -5
- package/dist/src/desktop/panels/MultilingualModal/MultilingualModal.d.ts +3 -1
- package/dist/src/desktop/panels/MultilingualModal/MultilingualModal.js +11 -4
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.d.ts +3 -1
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.js +35 -15
- package/dist/src/mobile/panels/MobileBasicModal/MobileBasicModal.d.ts +3 -1
- package/dist/src/mobile/panels/MobileBasicModal/MobileBasicModal.js +13 -6
- package/package.json +1 -1
- package/release-note.md +3 -2
|
@@ -40,6 +40,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.DailyView = void 0;
|
|
42
42
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
+
var react_1 = require("react");
|
|
43
44
|
var react_i18next_1 = require("react-i18next");
|
|
44
45
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
45
46
|
var TextLabel_1 = require("../TextLabel");
|
|
@@ -48,9 +49,14 @@ var CalendarContext_1 = require("./CalendarContext");
|
|
|
48
49
|
var CurrentTimeIndicator_1 = require("./CurrentTimeIndicator");
|
|
49
50
|
var TimeBasedScheduleItem_1 = require("./TimeBasedScheduleItem");
|
|
50
51
|
var timeFormatUtils_1 = require("./timeFormatUtils");
|
|
51
|
-
var DailyView = function () {
|
|
52
|
+
var DailyView = function (_a) {
|
|
53
|
+
var schedules = _a.schedules, config = _a.config;
|
|
52
54
|
var i18n = (0, react_i18next_1.useTranslation)().i18n;
|
|
53
|
-
var
|
|
55
|
+
var _b = (0, CalendarContext_1.useCalendarContext)(), selectedDate = _b.selectedDate, selectedSchedules = _b.selectedSchedules, displayAllDayScheduleMode = _b.displayAllDayScheduleMode, getSchedulesForDate = _b.getSchedulesForDate, isDragOverDate = _b.isDragOverDate, handleDateDragOver = _b.handleDateDragOver, handleDateDragLeave = _b.handleDateDragLeave, handleDateDrop = _b.handleDateDrop, handleDateClick = _b.handleDateClick, handleDateDrag = _b.handleDateDrag, handleScheduleDragStart = _b.handleScheduleDragStart, handleScheduleDragEnd = _b.handleScheduleDragEnd, handleScheduleClick = _b.handleScheduleClick;
|
|
56
|
+
// 시간 드래그 상태
|
|
57
|
+
var _c = (0, react_1.useState)(null), timeSelectionStart = _c[0], setTimeSelectionStart = _c[1];
|
|
58
|
+
var _d = (0, react_1.useState)(null), timeSelectionEnd = _d[0], setTimeSelectionEnd = _d[1];
|
|
59
|
+
var _e = (0, react_1.useState)(false), isTimeDragging = _e[0], setIsTimeDragging = _e[1];
|
|
54
60
|
var currentDateForDaily = [selectedDate][0];
|
|
55
61
|
var HOURS_IN_DAY = Array.from({ length: 24 }, function (_, i) { return i; });
|
|
56
62
|
var getTimeSlotDate = function (baseDate, hour) {
|
|
@@ -58,10 +64,79 @@ var DailyView = function () {
|
|
|
58
64
|
date.setHours(hour, 0, 0, 0);
|
|
59
65
|
return date;
|
|
60
66
|
};
|
|
67
|
+
// 시간 드래그 시작
|
|
68
|
+
var handleTimeMouseDown = (0, react_1.useCallback)(function (hour, e) {
|
|
69
|
+
var _a;
|
|
70
|
+
if (!((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG))
|
|
71
|
+
return;
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
setTimeSelectionStart(hour);
|
|
74
|
+
setTimeSelectionEnd(hour);
|
|
75
|
+
setIsTimeDragging(true);
|
|
76
|
+
}, [config]);
|
|
77
|
+
// 시간 드래그 중
|
|
78
|
+
var handleTimeMouseEnter = (0, react_1.useCallback)(function (hour) {
|
|
79
|
+
if (!isTimeDragging)
|
|
80
|
+
return;
|
|
81
|
+
setTimeSelectionEnd(hour);
|
|
82
|
+
}, [isTimeDragging]);
|
|
83
|
+
// 드래그 종료 시 콜백 호출
|
|
84
|
+
(0, react_1.useEffect)(function () {
|
|
85
|
+
var handleMouseUp = function () {
|
|
86
|
+
var _a;
|
|
87
|
+
if (isTimeDragging &&
|
|
88
|
+
timeSelectionStart !== null &&
|
|
89
|
+
timeSelectionEnd !== null &&
|
|
90
|
+
((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG)) {
|
|
91
|
+
// 선택된 시간 범위 계산
|
|
92
|
+
var startHour = Math.min(timeSelectionStart, timeSelectionEnd);
|
|
93
|
+
var endHour = Math.max(timeSelectionStart, timeSelectionEnd);
|
|
94
|
+
var startDateTime_1 = new Date(selectedDate);
|
|
95
|
+
startDateTime_1.setHours(startHour, 0, 0, 0);
|
|
96
|
+
var endDateTime_1 = new Date(selectedDate);
|
|
97
|
+
endDateTime_1.setHours(endHour, 59, 59, 999);
|
|
98
|
+
// 선택된 시간 범위에 포함되는 스케줄들 찾기
|
|
99
|
+
var schedulesInRange_1 = [];
|
|
100
|
+
schedules.forEach(function (schedule) {
|
|
101
|
+
var scheduleStart = new Date(schedule.startDate);
|
|
102
|
+
var scheduleEnd = new Date(schedule.endDate);
|
|
103
|
+
// 스케줄이 선택된 시간 범위와 겹치는지 확인
|
|
104
|
+
if (scheduleStart <= endDateTime_1 && scheduleEnd >= startDateTime_1) {
|
|
105
|
+
schedulesInRange_1.push(schedule);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// 선택된 날짜 (현재 날짜만)
|
|
109
|
+
var selectedDates = [new Date(selectedDate)];
|
|
110
|
+
handleDateDrag({
|
|
111
|
+
action: 'DRAG',
|
|
112
|
+
target: 'DATE',
|
|
113
|
+
dates: selectedDates,
|
|
114
|
+
schedules: schedulesInRange_1,
|
|
115
|
+
startDate: startDateTime_1.toISOString(),
|
|
116
|
+
endDate: endDateTime_1.toISOString()
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
setIsTimeDragging(false);
|
|
120
|
+
setTimeSelectionStart(null);
|
|
121
|
+
setTimeSelectionEnd(null);
|
|
122
|
+
};
|
|
123
|
+
if (isTimeDragging) {
|
|
124
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
125
|
+
return function () { return document.removeEventListener('mouseup', handleMouseUp); };
|
|
126
|
+
}
|
|
127
|
+
}, [isTimeDragging, timeSelectionStart, timeSelectionEnd, config, schedules, selectedDate]);
|
|
128
|
+
// 선택한 시간이 드래그 범위에 포함되는지 확인
|
|
129
|
+
var isTimeSlotInDragRange = (0, react_1.useCallback)(function (hour) {
|
|
130
|
+
if (timeSelectionStart === null || timeSelectionEnd === null)
|
|
131
|
+
return false;
|
|
132
|
+
var startHour = Math.min(timeSelectionStart, timeSelectionEnd);
|
|
133
|
+
var endHour = Math.max(timeSelectionStart, timeSelectionEnd);
|
|
134
|
+
return hour >= startHour && hour <= endHour;
|
|
135
|
+
}, [timeSelectionStart, timeSelectionEnd]);
|
|
61
136
|
return ((0, jsx_runtime_1.jsxs)(S_DailyContainer, { children: [(0, jsx_runtime_1.jsx)(AllDaySchedulesSection_1.AllDaySchedulesSection, { calendarDates: [selectedDate], displayAllDayScheduleMode: displayAllDayScheduleMode, getSchedulesForDate: getSchedulesForDate, handleDateDragOver: handleDateDragOver, handleDateDragLeave: handleDateDragLeave, handleDateDrop: handleDateDrop }), (0, jsx_runtime_1.jsxs)(S_DailyTimeGrid, __assign({ "$displayAllDayScheduleMode": displayAllDayScheduleMode }, { children: [(0, jsx_runtime_1.jsx)(CurrentTimeIndicator_1.CurrentTimeIndicator, { show: true, leftOffset: "80px" }), HOURS_IN_DAY.map(function (hour) {
|
|
62
137
|
var timeSlotDate = getTimeSlotDate(currentDateForDaily, hour);
|
|
63
138
|
var isDragOver = (isDragOverDate === null || isDragOverDate === void 0 ? void 0 : isDragOverDate.getTime()) === timeSlotDate.getTime();
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)(S_DailyTimeRow, { children: [(0, jsx_runtime_1.jsx)(S_DailyTimeLabel, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { styleTheme: "caption2Bold", text: (0, timeFormatUtils_1.formatHour)(hour, 0, i18n.language), colorTheme: "sysTextTertiary" }) }), (0, jsx_runtime_1.jsx)(S_DailyTimeSlot, __assign({ "$isDragOver": isDragOver, onClick: function () { return handleDateClick(timeSlotDate, {}); }, onDragOver: function (e) { return handleDateDragOver(timeSlotDate, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(timeSlotDate, e); } }, { children: hour === 0 && ((0, jsx_runtime_1.jsx)(TimeBasedScheduleItem_1.TimeBasedScheduleItem, { schedules: getSchedulesForDate(currentDateForDaily), selectedSchedules: selectedSchedules, onClick: handleScheduleClick, handleScheduleDragStart: handleScheduleDragStart, handleScheduleDragEnd: handleScheduleDragEnd })) }))] }, hour));
|
|
139
|
+
return ((0, jsx_runtime_1.jsxs)(S_DailyTimeRow, { children: [(0, jsx_runtime_1.jsx)(S_DailyTimeLabel, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { styleTheme: "caption2Bold", text: (0, timeFormatUtils_1.formatHour)(hour, 0, i18n.language), colorTheme: "sysTextTertiary" }) }), (0, jsx_runtime_1.jsx)(S_DailyTimeSlot, __assign({ "$isDragOver": isDragOver, "$isInTimeDragRange": isTimeSlotInDragRange(hour), "$isTimeDragging": isTimeDragging, onClick: function () { return handleDateClick(timeSlotDate, {}); }, onDragOver: function (e) { return handleDateDragOver(timeSlotDate, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(timeSlotDate, e); }, onMouseDown: function (e) { return handleTimeMouseDown(hour, e); }, onMouseEnter: function () { return handleTimeMouseEnter(hour); } }, { children: hour === 0 && ((0, jsx_runtime_1.jsx)(TimeBasedScheduleItem_1.TimeBasedScheduleItem, { schedules: getSchedulesForDate(currentDateForDaily), selectedSchedules: selectedSchedules, onClick: handleScheduleClick, handleScheduleDragStart: handleScheduleDragStart, handleScheduleDragEnd: handleScheduleDragEnd })) }))] }, hour));
|
|
65
140
|
})] }))] }));
|
|
66
141
|
};
|
|
67
142
|
exports.DailyView = DailyView;
|
|
@@ -74,18 +149,24 @@ var S_DailyTimeGrid = styled_components_1.default.div(templateObject_3 || (templ
|
|
|
74
149
|
});
|
|
75
150
|
});
|
|
76
151
|
var S_DailyTimeRow = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n min-height: 60px;\n"], ["\n display: flex;\n min-height: 60px;\n"])));
|
|
77
|
-
var S_DailyTimeLabel = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n display: flex;\n justify-content: center;\n min-width:
|
|
152
|
+
var S_DailyTimeLabel = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n display: flex;\n justify-content: center;\n min-width: 63px;\n padding: 8px;\n"], ["\n align-items: center;\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n display: flex;\n justify-content: center;\n min-width: 63px;\n padding: 8px;\n"])), function (_a) {
|
|
78
153
|
var theme = _a.theme;
|
|
79
154
|
return theme.ui_cpnt_divider;
|
|
80
155
|
}, function (_a) {
|
|
81
156
|
var theme = _a.theme;
|
|
82
157
|
return theme.ui_cpnt_divider;
|
|
83
158
|
});
|
|
84
|
-
var S_DailyTimeSlot = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n border-bottom: 1px solid ", ";\n cursor:
|
|
159
|
+
var S_DailyTimeSlot = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n border-bottom: 1px solid ", ";\n cursor: ", ";\n flex: 1;\n min-width: 0;\n overflow: visible;\n padding: 4px;\n position: relative;\n user-select: ", ";\n\n &:hover {\n background: ", ";\n }\n"], ["\n background: ", ";\n border-bottom: 1px solid ", ";\n cursor: ", ";\n flex: 1;\n min-width: 0;\n overflow: visible;\n padding: 4px;\n position: relative;\n user-select: ", ";\n\n &:hover {\n background: ", ";\n }\n"])), function (props) {
|
|
160
|
+
if (props.$isInTimeDragRange)
|
|
161
|
+
return props.theme.ui_cpnt_sheet_base;
|
|
162
|
+
if (props.$isDragOver)
|
|
163
|
+
return props.theme.ui_cpnt_sheet_base;
|
|
164
|
+
return 'transparent';
|
|
165
|
+
}, function (_a) {
|
|
85
166
|
var theme = _a.theme;
|
|
86
167
|
return theme.ui_cpnt_divider;
|
|
87
|
-
}, function (_a) {
|
|
168
|
+
}, function (props) { return (props.$isTimeDragging ? 'grabbing' : 'pointer'); }, function (props) { return (props.$isTimeDragging ? 'none' : 'auto'); }, function (_a) {
|
|
88
169
|
var theme = _a.theme;
|
|
89
|
-
return theme.
|
|
170
|
+
return theme.ui_cpnt_sheet_base;
|
|
90
171
|
});
|
|
91
172
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Schedule } from './types';
|
|
1
|
+
import type { Schedule, Config } from './types';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
interface MonthlyViewProps {
|
|
4
4
|
getDayTextByDate: (date: Date) => string;
|
|
@@ -23,6 +23,7 @@ interface MonthlyViewProps {
|
|
|
23
23
|
handleScheduleDragEnd?: () => void;
|
|
24
24
|
isDraggable?: boolean;
|
|
25
25
|
onSwitchToWeeklyView?: (date: Date) => void;
|
|
26
|
+
config?: Config;
|
|
26
27
|
}
|
|
27
28
|
export declare const MonthlyView: React.FC<MonthlyViewProps>;
|
|
28
29
|
export {};
|
|
@@ -41,17 +41,85 @@ var CalendarContext_1 = require("./CalendarContext");
|
|
|
41
41
|
var calendarUtils_1 = require("./calendarUtils");
|
|
42
42
|
var MultiWeekSchedulesLayer_1 = require("./MultiWeekSchedulesLayer");
|
|
43
43
|
var MonthlyView = function (_a) {
|
|
44
|
-
var getDayTextByDate = _a.getDayTextByDate, startOfWeek = _a.startOfWeek, selectedDate = _a.selectedDate, selectedDates = _a.selectedDates, selectedSchedules = _a.selectedSchedules, dragStartDate = _a.dragStartDate, dragEndDate = _a.dragEndDate, isDragOverDate = _a.isDragOverDate, schedules = _a.schedules, getSchedulesForDate = _a.getSchedulesForDate, isToday = _a.isToday, isPastDate = _a.isPastDate, handleDateClick = _a.handleDateClick, handleScheduleClick = _a.handleScheduleClick, handleMouseUp = _a.handleMouseUp, handleDateDragOver = _a.handleDateDragOver, handleDateDragLeave = _a.handleDateDragLeave, handleDateDrop = _a.handleDateDrop, handleScheduleDragStart = _a.handleScheduleDragStart, handleScheduleDragEnd = _a.handleScheduleDragEnd, _b = _a.isDraggable, isDraggable = _b === void 0 ? false : _b, onSwitchToWeeklyView = _a.onSwitchToWeeklyView;
|
|
44
|
+
var getDayTextByDate = _a.getDayTextByDate, startOfWeek = _a.startOfWeek, selectedDate = _a.selectedDate, selectedDates = _a.selectedDates, selectedSchedules = _a.selectedSchedules, dragStartDate = _a.dragStartDate, dragEndDate = _a.dragEndDate, isDragOverDate = _a.isDragOverDate, schedules = _a.schedules, getSchedulesForDate = _a.getSchedulesForDate, isToday = _a.isToday, isPastDate = _a.isPastDate, handleDateClick = _a.handleDateClick, handleScheduleClick = _a.handleScheduleClick, handleMouseUp = _a.handleMouseUp, handleDateDragOver = _a.handleDateDragOver, handleDateDragLeave = _a.handleDateDragLeave, handleDateDrop = _a.handleDateDrop, handleScheduleDragStart = _a.handleScheduleDragStart, handleScheduleDragEnd = _a.handleScheduleDragEnd, _b = _a.isDraggable, isDraggable = _b === void 0 ? false : _b, onSwitchToWeeklyView = _a.onSwitchToWeeklyView, config = _a.config;
|
|
45
45
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
46
|
-
var
|
|
46
|
+
var _c = (0, CalendarContext_1.useCalendarContext)(), renderScheduleItem = _c.renderScheduleItem, handleDateDrag = _c.handleDateDrag;
|
|
47
47
|
var height = (0, useWindowSize_1.useWindowSize)().height;
|
|
48
48
|
var calendarCellRef = (0, react_1.useRef)(null);
|
|
49
|
-
var
|
|
49
|
+
var _d = (0, react_1.useState)(3), maxSchedulesPerDay = _d[0], setMaxSchedulesPerDay = _d[1];
|
|
50
50
|
var scheduleItemHeight = 22; // 스케줄 아이템 대략 높이
|
|
51
|
+
// 날짜 드래그 상태
|
|
52
|
+
var _e = (0, react_1.useState)(null), dateSelectionStart = _e[0], setDateSelectionStart = _e[1];
|
|
53
|
+
var _f = (0, react_1.useState)(null), dateSelectionEnd = _f[0], setDateSelectionEnd = _f[1];
|
|
54
|
+
var _g = (0, react_1.useState)(false), isDateDragging = _g[0], setIsDateDragging = _g[1];
|
|
51
55
|
var days = (0, react_1.useMemo)(function () {
|
|
52
56
|
var monthDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1);
|
|
53
57
|
return dateHelper_1.DateHelper.getCalendarDatesForCalendar(monthDate, startOfWeek);
|
|
54
58
|
}, [selectedDate, startOfWeek]);
|
|
59
|
+
// 날짜 드래그 시작
|
|
60
|
+
var handleDateMouseDown = function (date, e) {
|
|
61
|
+
var _a;
|
|
62
|
+
if (!((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG))
|
|
63
|
+
return;
|
|
64
|
+
e.preventDefault(); // 텍스트 선택 방지
|
|
65
|
+
setDateSelectionStart(date);
|
|
66
|
+
setDateSelectionEnd(date);
|
|
67
|
+
setIsDateDragging(true);
|
|
68
|
+
};
|
|
69
|
+
// 날짜 드래그 중
|
|
70
|
+
var handleDateMouseEnter = function (date) {
|
|
71
|
+
var _a;
|
|
72
|
+
if (!((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG))
|
|
73
|
+
return;
|
|
74
|
+
if (!isDateDragging)
|
|
75
|
+
return;
|
|
76
|
+
setDateSelectionEnd(date);
|
|
77
|
+
};
|
|
78
|
+
// 드래그 종료 시 콜백 호출
|
|
79
|
+
(0, react_1.useEffect)(function () {
|
|
80
|
+
var handleMouseUp = function () {
|
|
81
|
+
var _a;
|
|
82
|
+
if (isDateDragging && dateSelectionStart && dateSelectionEnd && ((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG)) {
|
|
83
|
+
var startDate_1 = new Date(Math.min(dateSelectionStart.getTime(), dateSelectionEnd.getTime()));
|
|
84
|
+
var endDate_1 = new Date(Math.max(dateSelectionStart.getTime(), dateSelectionEnd.getTime()));
|
|
85
|
+
// 선택된 날짜 구간의 모든 날짜를 생성
|
|
86
|
+
var selectedDates_1 = [];
|
|
87
|
+
var current = new Date(startDate_1);
|
|
88
|
+
while (current <= endDate_1) {
|
|
89
|
+
selectedDates_1.push(new Date(current));
|
|
90
|
+
current.setDate(current.getDate() + 1);
|
|
91
|
+
}
|
|
92
|
+
// 선택된 날짜 구간에 포함되는 스케줄들 찾기
|
|
93
|
+
var schedulesInRange_1 = [];
|
|
94
|
+
schedules.forEach(function (schedule) {
|
|
95
|
+
var scheduleStartDate = new Date(schedule.startDate);
|
|
96
|
+
scheduleStartDate.setHours(0, 0, 0, 0);
|
|
97
|
+
var scheduleEndDate = new Date(schedule.endDate);
|
|
98
|
+
scheduleEndDate.setHours(0, 0, 0, 0);
|
|
99
|
+
// 스케줄과 선택된 구간이 겹치는지 확인
|
|
100
|
+
// 스케줄 시작 <= 선택된 구간 끝 && 스케줄 끝 >= 선택된 구간 시작
|
|
101
|
+
if (scheduleStartDate <= endDate_1 && scheduleEndDate >= startDate_1) {
|
|
102
|
+
schedulesInRange_1.push(schedule);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
handleDateDrag({
|
|
106
|
+
action: 'DRAG',
|
|
107
|
+
target: 'DATE',
|
|
108
|
+
dates: selectedDates_1,
|
|
109
|
+
schedules: schedulesInRange_1,
|
|
110
|
+
startDate: startDate_1.toISOString(),
|
|
111
|
+
endDate: endDate_1.toISOString()
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
setIsDateDragging(false);
|
|
115
|
+
setDateSelectionStart(null);
|
|
116
|
+
setDateSelectionEnd(null);
|
|
117
|
+
};
|
|
118
|
+
if (isDateDragging) {
|
|
119
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
120
|
+
return function () { return document.removeEventListener('mouseup', handleMouseUp); };
|
|
121
|
+
}
|
|
122
|
+
}, [isDateDragging, dateSelectionStart, dateSelectionEnd, config, schedules]);
|
|
55
123
|
// 셀 높이 기반으로 최대 스케줄 개수 계산
|
|
56
124
|
var calculateMaxSchedules = (0, react_1.useCallback)(function () {
|
|
57
125
|
if (!calendarCellRef.current)
|
|
@@ -344,10 +412,14 @@ var MonthlyView = function (_a) {
|
|
|
344
412
|
!!(dragStartDate &&
|
|
345
413
|
dragEndDate &&
|
|
346
414
|
date.getTime() >= Math.min(dragStartDate.getTime(), dragEndDate.getTime()) &&
|
|
347
|
-
date.getTime() <= Math.max(dragStartDate.getTime(), dragEndDate.getTime()))
|
|
415
|
+
date.getTime() <= Math.max(dragStartDate.getTime(), dragEndDate.getTime())) ||
|
|
416
|
+
!!(dateSelectionStart &&
|
|
417
|
+
dateSelectionEnd &&
|
|
418
|
+
date.getTime() >= Math.min(dateSelectionStart.getTime(), dateSelectionEnd.getTime()) &&
|
|
419
|
+
date.getTime() <= Math.max(dateSelectionStart.getTime(), dateSelectionEnd.getTime()));
|
|
348
420
|
return ((0, jsx_runtime_1.jsxs)(S_CalendarCell, __assign({ ref: date.getMonth() === selectedDate.getMonth() && date.getDate() === 1
|
|
349
421
|
? calendarCellRef
|
|
350
|
-
: undefined, "data-calendar-cell": true, "$isCurrentMonth": date.getMonth() === selectedDate.getMonth(), "$isToday": isToday(date), "$isSelected": isCellSelected, "$isPast": isPastDate(date), "$isDragOver": (isDragOverDate === null || isDragOverDate === void 0 ? void 0 : isDragOverDate.toDateString()) === date.toDateString(), onClick: function (e) { return handleDateClick(date, e); }, onMouseUp: handleMouseUp, onDragOver: function (e) { return handleDateDragOver(date, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(date, e); } }, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { styleTheme: isToday(date) ? 'caption2Bold' : 'caption2Regular', textAlign: "center", colorTheme: isToday(date) ? 'sysTextBrandPrimary' : 'sysTextSecondary', text: date.getDate().toString() }), (0, jsx_runtime_1.jsxs)(S_SchedulesContainer, __assign({ "$multiWeekSchedulesCount": visibleRows.length, id: "schedule container" }, { children: [visibleRows.map(function (_a) {
|
|
422
|
+
: undefined, "data-calendar-cell": true, "$isCurrentMonth": date.getMonth() === selectedDate.getMonth(), "$isToday": isToday(date), "$isSelected": isCellSelected, "$isPast": isPastDate(date), "$isDragOver": (isDragOverDate === null || isDragOverDate === void 0 ? void 0 : isDragOverDate.toDateString()) === date.toDateString(), "$isDateDragging": isDateDragging, onClick: function (e) { return handleDateClick(date, e); }, onMouseUp: handleMouseUp, onDragOver: function (e) { return handleDateDragOver(date, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(date, e); }, onMouseDown: function (e) { return handleDateMouseDown(date, e); }, onMouseEnter: function () { return handleDateMouseEnter(date); } }, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { styleTheme: isToday(date) ? 'caption2Bold' : 'caption2Regular', textAlign: "center", colorTheme: isToday(date) ? 'sysTextBrandPrimary' : 'sysTextSecondary', text: date.getDate().toString() }), (0, jsx_runtime_1.jsxs)(S_SchedulesContainer, __assign({ "$multiWeekSchedulesCount": visibleRows.length, id: "schedule container" }, { children: [visibleRows.map(function (_a) {
|
|
351
423
|
var rowIndex = _a.rowIndex, items = _a.items;
|
|
352
424
|
return items.map(function (item) {
|
|
353
425
|
var schedule = item.data;
|
|
@@ -377,7 +449,7 @@ var S_DayHeader = styled_components_1.default.div(templateObject_2 || (templateO
|
|
|
377
449
|
var theme = _a.theme;
|
|
378
450
|
return theme.ui_cpnt_divider;
|
|
379
451
|
});
|
|
380
|
-
var S_CalendarCell = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n min-height: 80px;\n min-width: 0;\n overflow: hidden;\n padding: 4px;\n position: relative;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: ", ";\n }\n\n &:nth-child(7n + 1) {\n border-left: 1px solid ", ";\n }\n\n &:nth-child(-n + 7) {\n border-top: 1px solid ", ";\n }\n"], ["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n min-height: 80px;\n min-width: 0;\n overflow: hidden;\n padding: 4px;\n position: relative;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: ", ";\n }\n\n &:nth-child(7n + 1) {\n border-left: 1px solid ", ";\n }\n\n &:nth-child(-n + 7) {\n border-top: 1px solid ", ";\n }\n"])), function (_a) {
|
|
452
|
+
var S_CalendarCell = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n min-height: 80px;\n min-width: 0;\n overflow: hidden;\n padding: 4px;\n position: relative;\n transition: background-color 0.2s;\n user-select: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:nth-child(7n + 1) {\n border-left: 1px solid ", ";\n }\n\n &:nth-child(-n + 7) {\n border-top: 1px solid ", ";\n }\n"], ["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n min-height: 80px;\n min-width: 0;\n overflow: hidden;\n padding: 4px;\n position: relative;\n transition: background-color 0.2s;\n user-select: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:nth-child(7n + 1) {\n border-left: 1px solid ", ";\n }\n\n &:nth-child(-n + 7) {\n border-top: 1px solid ", ";\n }\n"])), function (_a) {
|
|
381
453
|
var $isSelected = _a.$isSelected, theme = _a.theme;
|
|
382
454
|
if ($isSelected)
|
|
383
455
|
return theme.ui_cpnt_sheet_base;
|
|
@@ -388,6 +460,9 @@ var S_CalendarCell = styled_components_1.default.div(templateObject_3 || (templa
|
|
|
388
460
|
}, function (_a) {
|
|
389
461
|
var theme = _a.theme;
|
|
390
462
|
return theme.ui_cpnt_divider;
|
|
463
|
+
}, function (_a) {
|
|
464
|
+
var $isDateDragging = _a.$isDateDragging;
|
|
465
|
+
return ($isDateDragging ? 'none' : 'auto');
|
|
391
466
|
}, function (_a) {
|
|
392
467
|
var theme = _a.theme;
|
|
393
468
|
return theme.ui_cpnt_sheet_base;
|
|
@@ -51,10 +51,12 @@ var CurrentTimeIndicator_1 = require("./CurrentTimeIndicator");
|
|
|
51
51
|
var TimeBasedScheduleItem_1 = require("./TimeBasedScheduleItem");
|
|
52
52
|
var timeFormatUtils_1 = require("./timeFormatUtils");
|
|
53
53
|
var WeeklyView = function (_a) {
|
|
54
|
-
var startOfWeek = _a.startOfWeek;
|
|
54
|
+
var startOfWeek = _a.startOfWeek, schedules = _a.schedules, config = _a.config;
|
|
55
55
|
var _b = (0, react_i18next_1.useTranslation)(), t = _b.t, i18n = _b.i18n;
|
|
56
|
-
var _c = (0, CalendarContext_1.useCalendarContext)(), selectedDate = _c.selectedDate, selectedSchedules = _c.selectedSchedules, displayAllDayScheduleMode = _c.displayAllDayScheduleMode, getSchedulesForDate = _c.getSchedulesForDate, isToday = _c.isToday, isDragOverDate = _c.isDragOverDate, handleDateDragOver = _c.handleDateDragOver, handleDateDragLeave = _c.handleDateDragLeave, handleDateDrop = _c.handleDateDrop, handleDateClick = _c.handleDateClick, handleScheduleDragStart = _c.handleScheduleDragStart, handleScheduleDragEnd = _c.handleScheduleDragEnd, isDraggable = _c.isDraggable, handleScheduleClick = _c.handleScheduleClick, getDayTextByDate = _c.getDayTextByDate;
|
|
57
|
-
|
|
56
|
+
var _c = (0, CalendarContext_1.useCalendarContext)(), selectedDate = _c.selectedDate, selectedSchedules = _c.selectedSchedules, displayAllDayScheduleMode = _c.displayAllDayScheduleMode, getSchedulesForDate = _c.getSchedulesForDate, isToday = _c.isToday, isDragOverDate = _c.isDragOverDate, handleDateDragOver = _c.handleDateDragOver, handleDateDragLeave = _c.handleDateDragLeave, handleDateDrop = _c.handleDateDrop, handleDateClick = _c.handleDateClick, handleDateDrag = _c.handleDateDrag, handleScheduleDragStart = _c.handleScheduleDragStart, handleScheduleDragEnd = _c.handleScheduleDragEnd, isDraggable = _c.isDraggable, handleScheduleClick = _c.handleScheduleClick, getDayTextByDate = _c.getDayTextByDate;
|
|
57
|
+
var _d = (0, react_1.useState)(null), timeSelectionStart = _d[0], setTimeSelectionStart = _d[1];
|
|
58
|
+
var _e = (0, react_1.useState)(null), timeSelectionEnd = _e[0], setTimeSelectionEnd = _e[1];
|
|
59
|
+
var _f = (0, react_1.useState)(false), isTimeDragging = _f[0], setIsTimeDragging = _f[1];
|
|
58
60
|
var calendarDates = (0, react_1.useMemo)(function () {
|
|
59
61
|
var dates = [];
|
|
60
62
|
var startIndex = startOfWeek === 'monday' ? 1 : 0;
|
|
@@ -65,10 +67,108 @@ var WeeklyView = function (_a) {
|
|
|
65
67
|
}
|
|
66
68
|
return dates;
|
|
67
69
|
}, [selectedDate, startOfWeek]);
|
|
70
|
+
// 시간 드래그 시작
|
|
71
|
+
var handleTimeMouseDown = (0, react_1.useCallback)(function (date, hour, e) {
|
|
72
|
+
var _a;
|
|
73
|
+
if (!((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG))
|
|
74
|
+
return;
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
var selection = { date: date, hour: hour };
|
|
77
|
+
setTimeSelectionStart(selection);
|
|
78
|
+
setTimeSelectionEnd(selection);
|
|
79
|
+
setIsTimeDragging(true);
|
|
80
|
+
}, [config]);
|
|
81
|
+
// 시간 드래그 중
|
|
82
|
+
var handleTimeMouseEnter = (0, react_1.useCallback)(function (date, hour) {
|
|
83
|
+
if (!isTimeDragging)
|
|
84
|
+
return;
|
|
85
|
+
setTimeSelectionEnd({ date: date, hour: hour });
|
|
86
|
+
}, [isTimeDragging]);
|
|
87
|
+
// 드래그 종료 시 콜백 호출
|
|
88
|
+
(0, react_1.useEffect)(function () {
|
|
89
|
+
var handleMouseUp = function () {
|
|
90
|
+
var _a;
|
|
91
|
+
if (isTimeDragging && timeSelectionStart && timeSelectionEnd && ((_a = config === null || config === void 0 ? void 0 : config.DATE) === null || _a === void 0 ? void 0 : _a.DRAG)) {
|
|
92
|
+
// 선택된 시간 범위 계산
|
|
93
|
+
var startDateTime = new Date(timeSelectionStart.date);
|
|
94
|
+
startDateTime.setHours(timeSelectionStart.hour, 0, 0, 0);
|
|
95
|
+
var endDateTime = new Date(timeSelectionEnd.date);
|
|
96
|
+
endDateTime.setHours(timeSelectionEnd.hour, 59, 59, 999);
|
|
97
|
+
// 실제 시작/종료 시간 (순서 보정)
|
|
98
|
+
var actualStartTime_1 = new Date(Math.min(startDateTime.getTime(), endDateTime.getTime()));
|
|
99
|
+
var actualEndTime_1 = new Date(Math.max(startDateTime.getTime(), endDateTime.getTime()));
|
|
100
|
+
// 선택된 시간 범위에 포함되는 스케줄들 찾기
|
|
101
|
+
var schedulesInRange_1 = [];
|
|
102
|
+
schedules.forEach(function (schedule) {
|
|
103
|
+
var scheduleStart = new Date(schedule.startDate);
|
|
104
|
+
var scheduleEnd = new Date(schedule.endDate);
|
|
105
|
+
// 스케줄이 선택된 시간 범위와 겹치는지 확인
|
|
106
|
+
if (scheduleStart <= actualEndTime_1 && scheduleEnd >= actualStartTime_1) {
|
|
107
|
+
schedulesInRange_1.push(schedule);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
// 선택된 날짜들 생성 (시간 범위에 포함된 모든 날짜)
|
|
111
|
+
var selectedDates = [];
|
|
112
|
+
var currentDate = new Date(actualStartTime_1);
|
|
113
|
+
currentDate.setHours(0, 0, 0, 0);
|
|
114
|
+
var endDate = new Date(actualEndTime_1);
|
|
115
|
+
endDate.setHours(0, 0, 0, 0);
|
|
116
|
+
while (currentDate <= endDate) {
|
|
117
|
+
selectedDates.push(new Date(currentDate));
|
|
118
|
+
currentDate.setDate(currentDate.getDate() + 1);
|
|
119
|
+
}
|
|
120
|
+
handleDateDrag({
|
|
121
|
+
action: 'DRAG',
|
|
122
|
+
target: 'DATE',
|
|
123
|
+
dates: selectedDates,
|
|
124
|
+
schedules: schedulesInRange_1,
|
|
125
|
+
startDate: actualStartTime_1.toISOString(),
|
|
126
|
+
endDate: actualEndTime_1.toISOString()
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
setIsTimeDragging(false);
|
|
130
|
+
setTimeSelectionStart(null);
|
|
131
|
+
setTimeSelectionEnd(null);
|
|
132
|
+
};
|
|
133
|
+
if (isTimeDragging) {
|
|
134
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
135
|
+
return function () { return document.removeEventListener('mouseup', handleMouseUp); };
|
|
136
|
+
}
|
|
137
|
+
}, [isTimeDragging, timeSelectionStart, timeSelectionEnd, config, schedules]);
|
|
138
|
+
// 선택한 시간이 드래그 범위에 포함되는지 확인
|
|
139
|
+
var isTimeSlotInDragRange = (0, react_1.useCallback)(function (date, hour) {
|
|
140
|
+
if (!timeSelectionStart || !timeSelectionEnd)
|
|
141
|
+
return false;
|
|
142
|
+
var slotDateTime = new Date(date);
|
|
143
|
+
slotDateTime.setHours(hour, 0, 0, 0);
|
|
144
|
+
var startDateTime = new Date(timeSelectionStart.date);
|
|
145
|
+
startDateTime.setHours(timeSelectionStart.hour, 0, 0, 0);
|
|
146
|
+
var endDateTime = new Date(timeSelectionEnd.date);
|
|
147
|
+
endDateTime.setHours(timeSelectionEnd.hour, 0, 0, 0);
|
|
148
|
+
var actualStartTime = Math.min(startDateTime.getTime(), endDateTime.getTime());
|
|
149
|
+
var actualEndTime = Math.max(startDateTime.getTime(), endDateTime.getTime());
|
|
150
|
+
return slotDateTime.getTime() >= actualStartTime && slotDateTime.getTime() <= actualEndTime;
|
|
151
|
+
}, [timeSelectionStart, timeSelectionEnd]);
|
|
68
152
|
return ((0, jsx_runtime_1.jsxs)(S_WeeklyContainer, { children: [(0, jsx_runtime_1.jsxs)(S_WeeklyHeader, { children: [(0, jsx_runtime_1.jsx)(S_TimeColumnHeader, {}), calendarDates.map(function (date, index) {
|
|
69
153
|
var dayText = getDayTextByDate(date);
|
|
154
|
+
var monthNames = [
|
|
155
|
+
'Jan',
|
|
156
|
+
'Feb',
|
|
157
|
+
'Mar',
|
|
158
|
+
'Apr',
|
|
159
|
+
'May',
|
|
160
|
+
'Jun',
|
|
161
|
+
'Jul',
|
|
162
|
+
'Aug',
|
|
163
|
+
'Sep',
|
|
164
|
+
'Oct',
|
|
165
|
+
'Nov',
|
|
166
|
+
'Dec'
|
|
167
|
+
];
|
|
168
|
+
var isEnglish = i18n.language === 'en'; // i18n 인스턴스에서 현재 언어 확인
|
|
169
|
+
var monthText = isEnglish ? monthNames[date.getMonth()] : date.getMonth() + 1;
|
|
70
170
|
var dateText = t('str_calendar_weekly_date', {
|
|
71
|
-
month:
|
|
171
|
+
month: monthText,
|
|
72
172
|
date: date.getDate(),
|
|
73
173
|
day: dayText
|
|
74
174
|
});
|
|
@@ -77,7 +177,7 @@ var WeeklyView = function (_a) {
|
|
|
77
177
|
var timeSlotDate = new Date(date);
|
|
78
178
|
timeSlotDate.setHours(hour, 0, 0, 0);
|
|
79
179
|
var isDragOver = (isDragOverDate === null || isDragOverDate === void 0 ? void 0 : isDragOverDate.getTime()) === timeSlotDate.getTime();
|
|
80
|
-
return ((0, jsx_runtime_1.jsx)(S_TimeSlot, __assign({ "$isDragOver": isDragOver, "$isDraggable": isDraggable, onClick: function () { return handleDateClick(date, {}); }, onDragOver: function (e) { return handleDateDragOver(timeSlotDate, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(timeSlotDate, e); } }, { children: hour === 0 && ((0, jsx_runtime_1.jsx)(TimeBasedScheduleItem_1.TimeBasedScheduleItem, { schedules: getSchedulesForDate(date), selectedSchedules: selectedSchedules, isDraggable: isDraggable, onClick: handleScheduleClick, handleScheduleDragStart: handleScheduleDragStart, handleScheduleDragEnd: handleScheduleDragEnd })) }), dayIndex));
|
|
180
|
+
return ((0, jsx_runtime_1.jsx)(S_TimeSlot, __assign({ "$isDragOver": isDragOver, "$isDraggable": isDraggable, "$isInTimeDragRange": isTimeSlotInDragRange(date, hour), "$isTimeDragging": isTimeDragging, onClick: function () { return handleDateClick(date, {}); }, onDragOver: function (e) { return handleDateDragOver(timeSlotDate, e); }, onDragLeave: handleDateDragLeave, onDrop: function (e) { return handleDateDrop(timeSlotDate, e); }, onMouseDown: function (e) { return handleTimeMouseDown(date, hour, e); }, onMouseEnter: function () { return handleTimeMouseEnter(date, hour); } }, { children: hour === 0 && ((0, jsx_runtime_1.jsx)(TimeBasedScheduleItem_1.TimeBasedScheduleItem, { schedules: getSchedulesForDate(date), selectedSchedules: selectedSchedules, isDraggable: isDraggable, onClick: handleScheduleClick, handleScheduleDragStart: handleScheduleDragStart, handleScheduleDragEnd: handleScheduleDragEnd })) }), dayIndex));
|
|
81
181
|
}) })] }, hour)); })] }))] }));
|
|
82
182
|
};
|
|
83
183
|
exports.WeeklyView = WeeklyView;
|
|
@@ -101,13 +201,19 @@ var S_TimeLabel = styled_components_1.default.div(templateObject_8 || (templateO
|
|
|
101
201
|
return theme.ui_cpnt_divider;
|
|
102
202
|
});
|
|
103
203
|
var S_TimeSlots = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: contents;\n"], ["\n display: contents;\n"])));
|
|
104
|
-
var S_TimeSlot = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n cursor:
|
|
204
|
+
var S_TimeSlot = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n cursor: ", ";\n min-width: 0;\n overflow: visible;\n position: relative;\n user-select: ", ";\n\n &:hover {\n background: ", ";\n }\n"], ["\n background: ", ";\n border-bottom: 1px solid ", ";\n border-right: 1px solid ", ";\n cursor: ", ";\n min-width: 0;\n overflow: visible;\n position: relative;\n user-select: ", ";\n\n &:hover {\n background: ", ";\n }\n"])), function (props) {
|
|
205
|
+
if (props.$isInTimeDragRange)
|
|
206
|
+
return props.theme.ui_cpnt_sheet_base;
|
|
207
|
+
if (props.$isDragOver)
|
|
208
|
+
return props.theme.ui_cpnt_sheet_base;
|
|
209
|
+
return 'transparent';
|
|
210
|
+
}, function (_a) {
|
|
105
211
|
var theme = _a.theme;
|
|
106
212
|
return theme.ui_cpnt_divider;
|
|
107
213
|
}, function (_a) {
|
|
108
214
|
var theme = _a.theme;
|
|
109
215
|
return theme.ui_cpnt_divider;
|
|
110
|
-
}, function (_a) {
|
|
216
|
+
}, function (props) { return (props.$isTimeDragging ? 'grabbing' : 'default'); }, function (props) { return (props.$isTimeDragging ? 'none' : 'auto'); }, function (_a) {
|
|
111
217
|
var theme = _a.theme;
|
|
112
218
|
return theme.ui_cpnt_sheet_base;
|
|
113
219
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.toUTC = exports.getHeaderText = exports.calculateDateRange = exports.calculateIsAllDay = void 0;
|
|
7
|
+
var i18n_1 = __importDefault(require("../../../common/services/i18n"));
|
|
4
8
|
var dateHelper_1 = require("../../../common/utils/dateHelper");
|
|
9
|
+
var constants_1 = require("./constants");
|
|
5
10
|
/**
|
|
6
11
|
* 일정이 종일 일정인지 확인하는 함수
|
|
7
12
|
* @param startDate 시작 날짜
|
|
@@ -22,16 +27,16 @@ var calculateIsAllDay = function (startDate, endDate) {
|
|
|
22
27
|
exports.calculateIsAllDay = calculateIsAllDay;
|
|
23
28
|
var calculateDateRange = function (viewType, baseDate) {
|
|
24
29
|
switch (viewType) {
|
|
25
|
-
case '
|
|
30
|
+
case 'str_fm_day':
|
|
26
31
|
return { startDate: baseDate, endDate: baseDate };
|
|
27
|
-
case '
|
|
32
|
+
case 'str_fm_week': {
|
|
28
33
|
var start = new Date(baseDate);
|
|
29
34
|
start.setDate(baseDate.getDate() - baseDate.getDay());
|
|
30
35
|
var end = new Date(start);
|
|
31
36
|
end.setDate(start.getDate() + 6);
|
|
32
37
|
return { startDate: start, endDate: end };
|
|
33
38
|
}
|
|
34
|
-
case '
|
|
39
|
+
case 'str_fm_month': {
|
|
35
40
|
var startDate = new Date(baseDate.getFullYear(), baseDate.getMonth(), 1);
|
|
36
41
|
// 실제 MonthlyView에서 보여지는 날짜 배열을 구함
|
|
37
42
|
var days = dateHelper_1.DateHelper.getCalendarDatesForCalendar(startDate, 'sunday');
|
|
@@ -40,7 +45,7 @@ var calculateDateRange = function (viewType, baseDate) {
|
|
|
40
45
|
endDate: days[days.length - 1]
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
|
-
case '
|
|
48
|
+
case 'str_fm_year':
|
|
44
49
|
return {
|
|
45
50
|
startDate: new Date(baseDate.getFullYear(), 0, 1),
|
|
46
51
|
endDate: new Date(baseDate.getFullYear(), 11, 31)
|
|
@@ -63,16 +68,21 @@ var getHeaderText = function (viewType, selectedDate, t) {
|
|
|
63
68
|
var year = selectedDate.getFullYear();
|
|
64
69
|
var monthNumber = selectedDate.getMonth() + 1;
|
|
65
70
|
var day = selectedDate.getDate();
|
|
66
|
-
|
|
71
|
+
var locale = (0, constants_1.getLocaleFromLang)(i18n_1.default.language);
|
|
72
|
+
// For English locale, use month names instead of numbers for WEEKLY and MONTHLY views
|
|
73
|
+
var monthValue = locale === 'en-US' && (viewType === 'str_fm_week' || viewType === 'str_fm_month')
|
|
74
|
+
? t("calendar_month_".concat(monthNumber))
|
|
75
|
+
: monthNumber;
|
|
76
|
+
if (viewType === 'str_fm_day') {
|
|
67
77
|
return t('str_calendar_daily_header', { year: year, month: monthNumber, day: day });
|
|
68
78
|
}
|
|
69
|
-
if (viewType === '
|
|
70
|
-
return t('str_calendar_weekly_header', { year: year, month:
|
|
79
|
+
if (viewType === 'str_fm_week') {
|
|
80
|
+
return t('str_calendar_weekly_header', { year: year, month: monthValue });
|
|
71
81
|
}
|
|
72
|
-
if (viewType === '
|
|
73
|
-
return t('str_calendar_monthly_header', { year: year, month:
|
|
82
|
+
if (viewType === 'str_fm_month') {
|
|
83
|
+
return t('str_calendar_monthly_header', { year: year, month: monthValue });
|
|
74
84
|
}
|
|
75
|
-
if (viewType === '
|
|
85
|
+
if (viewType === 'str_fm_year') {
|
|
76
86
|
return t('str_calendar_yearly_header', { year: year });
|
|
77
87
|
}
|
|
78
88
|
return '';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export type CalendarViewType = '
|
|
2
|
+
export type CalendarViewType = 'str_fm_month' | 'str_fm_week' | 'str_fm_day' | 'str_fm_year';
|
|
3
3
|
export type displayAllDayScheduleMode = 'none' | 'use';
|
|
4
4
|
export type StartOfWeek = 'sunday' | 'monday';
|
|
5
5
|
export type TodayBtnMode = 'none' | 'use';
|
|
6
|
-
export type ActionType = 'CLICK' | 'CLICK_WITH_SHIFT_KEY_DOWN' | 'DELETE_KEY_DOWN' | 'DRAG'
|
|
6
|
+
export type ActionType = 'CLICK' | 'CLICK_WITH_SHIFT_KEY_DOWN' | 'DELETE_KEY_DOWN' | 'DRAG';
|
|
7
7
|
export type TargetType = 'SCHEDULE' | 'DATE';
|
|
8
8
|
export type Action = {
|
|
9
9
|
action: ActionType;
|
|
@@ -40,8 +40,8 @@ export type CalendarAction = {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export type CalendarProps = {
|
|
43
|
-
defaultViewType?: CalendarViewType
|
|
44
|
-
viewTypes?:
|
|
43
|
+
defaultViewType?: CalendarViewType;
|
|
44
|
+
viewTypes?: CalendarViewType[];
|
|
45
45
|
displayAllDayScheduleMode?: displayAllDayScheduleMode;
|
|
46
46
|
startOfWeek?: StartOfWeek;
|
|
47
47
|
todayBtnMode?: TodayBtnMode;
|
|
@@ -59,3 +59,7 @@ export type EventItemProps = {
|
|
|
59
59
|
onDoubleClick: (schedule: Schedule) => void;
|
|
60
60
|
isSelected?: boolean;
|
|
61
61
|
};
|
|
62
|
+
export type TimeSelection = {
|
|
63
|
+
date: Date;
|
|
64
|
+
hour: number;
|
|
65
|
+
};
|
|
@@ -16,7 +16,7 @@ type TextObj = {
|
|
|
16
16
|
};
|
|
17
17
|
type DesktopTabBarProps = {
|
|
18
18
|
itemArray?: ItemArray[];
|
|
19
|
-
styleTheme?: 'main' | 'content' | 'content_black';
|
|
19
|
+
styleTheme?: 'main' | 'content' | 'content2' | 'content_black';
|
|
20
20
|
/** @deprecated v1.5 해당 필드 대신 itemArray를 사용하세요. */
|
|
21
21
|
textArray?: TextObj[];
|
|
22
22
|
};
|