pds-dev-kit-web-test 2.5.658 → 2.5.659
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/desktop/components/Calendar/Calendar.js +35 -21
- package/dist/src/desktop/components/Calendar/CurrentTimeIndicator.js +10 -12
- package/dist/src/desktop/components/Calendar/calendarUtils.d.ts +1 -1
- package/dist/src/desktop/components/Calendar/calendarUtils.js +5 -4
- package/dist/src/desktop/components/Calendar/index.d.ts +2 -1
- package/dist/src/desktop/components/Calendar/index.js +3 -1
- package/dist/src/desktop/components/Calendar/types.d.ts +6 -1
- package/dist/src/desktop/components/Calendar/types.js +8 -0
- package/package.json +1 -1
- package/release-note.md +2 -3
@@ -41,11 +41,17 @@ var calendarUtils_1 = require("./calendarUtils");
|
|
41
41
|
var constants_1 = require("./constants");
|
42
42
|
var DailyView_1 = require("./DailyView");
|
43
43
|
var MonthlyView_1 = require("./MonthlyView");
|
44
|
+
var types_1 = require("./types");
|
44
45
|
var WeeklyView_1 = require("./WeeklyView");
|
45
46
|
var YearlyView_1 = require("./YearlyView");
|
46
47
|
var Calendar = function (_a) {
|
47
48
|
var _b;
|
48
|
-
var _c = _a.defaultViewType, defaultViewType = _c === void 0 ?
|
49
|
+
var _c = _a.defaultViewType, defaultViewType = _c === void 0 ? types_1.CalendarViewType.MONTH : _c, _d = _a.viewTypes, viewTypes = _d === void 0 ? [
|
50
|
+
types_1.CalendarViewType.MONTH,
|
51
|
+
types_1.CalendarViewType.WEEK,
|
52
|
+
types_1.CalendarViewType.DAY,
|
53
|
+
types_1.CalendarViewType.YEAR
|
54
|
+
] : _d, _e = _a.displayAllDayScheduleMode, displayAllDayScheduleMode = _e === void 0 ? 'none' : _e, _f = _a.startOfWeek, startOfWeek = _f === void 0 ? 'sunday' : _f, _g = _a.todayBtnMode, todayBtnMode = _g === void 0 ? 'use' : _g, _h = _a.schedules, schedules = _h === void 0 ? [] : _h, config = _a.config, onActionDispatch = _a.onActionDispatch;
|
49
55
|
var _j = (0, react_i18next_1.useTranslation)('translation'), t = _j.t, i18n = _j.i18n;
|
50
56
|
var _k = (0, react_1.useState)(defaultViewType), currentViewType = _k[0], setCurrentViewType = _k[1];
|
51
57
|
var _l = (0, react_1.useState)(new Date()), selectedDate = _l[0], setSelectedDate = _l[1];
|
@@ -98,13 +104,13 @@ var Calendar = function (_a) {
|
|
98
104
|
var increment = direction === 'next' ? 1 : -1;
|
99
105
|
var getNewDateByViewType = function (viewType) {
|
100
106
|
switch (viewType) {
|
101
|
-
case
|
107
|
+
case types_1.CalendarViewType.DAY:
|
102
108
|
return dateHelper_1.DateHelper.addDays(selectedDate, increment);
|
103
|
-
case
|
109
|
+
case types_1.CalendarViewType.WEEK:
|
104
110
|
return dateHelper_1.DateHelper.addDays(selectedDate, increment * 7);
|
105
|
-
case
|
111
|
+
case types_1.CalendarViewType.MONTH:
|
106
112
|
return dateHelper_1.DateHelper.addMonths(selectedDate, increment);
|
107
|
-
case
|
113
|
+
case types_1.CalendarViewType.YEAR:
|
108
114
|
return new Date(selectedDate.getFullYear() + increment, selectedDate.getMonth(), selectedDate.getDate());
|
109
115
|
default:
|
110
116
|
return selectedDate;
|
@@ -255,7 +261,7 @@ var Calendar = function (_a) {
|
|
255
261
|
var duration = originalEndDate.getTime() - originalStartDate.getTime();
|
256
262
|
var getAdjustedStartDate = function () {
|
257
263
|
var baseDate = new Date(date);
|
258
|
-
if (currentViewType ===
|
264
|
+
if (currentViewType === types_1.CalendarViewType.MONTH) {
|
259
265
|
var target = e.target;
|
260
266
|
var gridContainer = target.closest('[data-calendar-grid]');
|
261
267
|
if (gridContainer) {
|
@@ -295,18 +301,26 @@ var Calendar = function (_a) {
|
|
295
301
|
t('str_3891'),
|
296
302
|
t('str_3892') // 토 - 6
|
297
303
|
]; }, [t]);
|
298
|
-
// 날짜의 실제 요일에 따른 요일 텍스트 가져오기
|
299
304
|
var getDayTextByDate = function (date) {
|
300
305
|
return defaultDayTexts[date.getDay()];
|
301
306
|
};
|
302
|
-
|
307
|
+
var getTranslationKey = function (viewType) {
|
308
|
+
var _a;
|
309
|
+
var _b;
|
310
|
+
var TRANSLATION_KEYS = (_a = {},
|
311
|
+
_a[types_1.CalendarViewType.MONTH] = 'str_fm_month',
|
312
|
+
_a[types_1.CalendarViewType.WEEK] = 'str_fm_week',
|
313
|
+
_a[types_1.CalendarViewType.DAY] = 'str_fm_day',
|
314
|
+
_a[types_1.CalendarViewType.YEAR] = 'str_fm_year',
|
315
|
+
_a);
|
316
|
+
return (_b = TRANSLATION_KEYS[viewType]) !== null && _b !== void 0 ? _b : 'str_fm_month';
|
317
|
+
};
|
303
318
|
var viewTypeOptions = (0, react_1.useMemo)(function () {
|
304
319
|
return viewTypes.map(function (viewType) { return ({
|
305
|
-
text: t(viewType),
|
320
|
+
text: t(getTranslationKey(viewType)),
|
306
321
|
value: viewType
|
307
322
|
}); });
|
308
323
|
}, [viewTypes, t]);
|
309
|
-
// 특정 월의 캘린더 날짜 생성 (연간 보기용)
|
310
324
|
var getMonthDates = (0, react_1.useCallback)(function (year, month) {
|
311
325
|
var monthDate = new Date(year, month, 1);
|
312
326
|
return dateHelper_1.DateHelper.getCalendarDates(monthDate, startOfWeek);
|
@@ -346,14 +360,14 @@ var Calendar = function (_a) {
|
|
346
360
|
};
|
347
361
|
// 주간 뷰로 전환하는 핸들러
|
348
362
|
var handleSwitchToWeeklyView = (0, react_1.useCallback)(function (date) {
|
349
|
-
setCurrentViewType(
|
363
|
+
setCurrentViewType(types_1.CalendarViewType.WEEK);
|
350
364
|
setSelectedDate(date);
|
351
365
|
// 주간 뷰로 전환할 때의 startDate와 endDate 계산
|
352
|
-
var _a = (0, calendarUtils_1.calculateDateRange)(
|
366
|
+
var _a = (0, calendarUtils_1.calculateDateRange)(types_1.CalendarViewType.WEEK, date), newStartDate = _a.startDate, newEndDate = _a.endDate;
|
353
367
|
onActionDispatch === null || onActionDispatch === void 0 ? void 0 : onActionDispatch({
|
354
368
|
type: 'CALENDAR_TYPE_CHANGE',
|
355
369
|
payload: {
|
356
|
-
type:
|
370
|
+
type: types_1.CalendarViewType.WEEK,
|
357
371
|
startDate: (0, calendarUtils_1.toUTC)(newStartDate),
|
358
372
|
endDate: (0, calendarUtils_1.toUTC)(newEndDate)
|
359
373
|
}
|
@@ -381,22 +395,22 @@ var Calendar = function (_a) {
|
|
381
395
|
var monthNumber = selectedDate.getMonth() + 1;
|
382
396
|
var day = selectedDate.getDate();
|
383
397
|
var locale = (0, constants_1.getLocaleFromLang)(i18n.language);
|
384
|
-
if (viewType ===
|
398
|
+
if (viewType === types_1.CalendarViewType.DAY) {
|
385
399
|
return t('str_calendar_daily_header', { year: year, month: monthNumber, day: day });
|
386
400
|
}
|
387
|
-
if (viewType ===
|
401
|
+
if (viewType === types_1.CalendarViewType.WEEK) {
|
388
402
|
return t('str_calendar_weekly_header', {
|
389
403
|
year: year,
|
390
404
|
month: locale === 'en-US' ? t(getMonthStringKey(monthNumber)) : monthNumber
|
391
405
|
});
|
392
406
|
}
|
393
|
-
if (viewType ===
|
407
|
+
if (viewType === types_1.CalendarViewType.MONTH) {
|
394
408
|
return t('str_calendar_monthly_header', {
|
395
409
|
year: year,
|
396
410
|
month: locale === 'en-US' ? t(getMonthStringKey(monthNumber)) : monthNumber
|
397
411
|
});
|
398
412
|
}
|
399
|
-
if (viewType ===
|
413
|
+
if (viewType === types_1.CalendarViewType.YEAR) {
|
400
414
|
return t('str_calendar_yearly_header', { year: year });
|
401
415
|
}
|
402
416
|
return '';
|
@@ -404,13 +418,13 @@ var Calendar = function (_a) {
|
|
404
418
|
// 뷰 타입에 따른 캘린더 콘텐츠 렌더링
|
405
419
|
var renderCalendarContent = function () {
|
406
420
|
switch (currentViewType) {
|
407
|
-
case
|
421
|
+
case types_1.CalendarViewType.MONTH:
|
408
422
|
return ((0, jsx_runtime_1.jsx)(MonthlyView_1.MonthlyView, { getDayTextByDate: getDayTextByDate, startOfWeek: startOfWeek, selectedDate: selectedDate, selectedDates: selectedDates, dragStartDate: dragStartDate, selectedSchedules: selectedSchedules, dragEndDate: dragEndDate, isDragOverDate: isDragOverDate, schedules: schedules, getSchedulesForDate: getSchedulesForDate, isToday: isToday, isPastDate: isPastDate, handleDateClick: handleDateClick, handleScheduleClick: handleScheduleClick, handleMouseUp: handleMouseUp, handleDateDragOver: handleDateDragOver, handleDateDragLeave: handleDateDragLeave, handleDateDrop: handleDateDrop, handleScheduleDragStart: handleScheduleDragStart, handleScheduleDragEnd: handleScheduleDragEnd, isDraggable: isDraggable, onSwitchToWeeklyView: handleSwitchToWeeklyView, config: config }));
|
409
|
-
case
|
423
|
+
case types_1.CalendarViewType.WEEK:
|
410
424
|
return (0, jsx_runtime_1.jsx)(WeeklyView_1.WeeklyView, { startOfWeek: startOfWeek, schedules: schedules, config: config });
|
411
|
-
case
|
425
|
+
case types_1.CalendarViewType.DAY:
|
412
426
|
return (0, jsx_runtime_1.jsx)(DailyView_1.DailyView, { schedules: schedules, config: config });
|
413
|
-
case
|
427
|
+
case types_1.CalendarViewType.YEAR:
|
414
428
|
return ((0, jsx_runtime_1.jsx)(YearlyView_1.YearlyView, { selectedDate: selectedDate, getMonthDates: getMonthDates, getDayTextByDate: getDayTextByDate, startOfWeek: startOfWeek, isToday: isToday, handleDateClick: handleDateClick, getSchedulesForDate: getSchedulesForDate }));
|
415
429
|
default:
|
416
430
|
return null;
|
@@ -9,24 +9,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
exports.CurrentTimeIndicator = void 0;
|
11
11
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
12
|
-
var i18next_1 = __importDefault(require("i18next"));
|
13
12
|
var react_1 = require("react");
|
14
|
-
var react_i18next_1 = require("react-i18next");
|
15
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
16
|
-
var constants_1 = require("./constants");
|
17
14
|
var CurrentTimeIndicator = function (_a) {
|
18
15
|
var show = _a.show, _b = _a.leftOffset, leftOffset = _b === void 0 ? '80px' : _b;
|
19
|
-
var i18n = (0, react_i18next_1.useTranslation)('translation').i18n;
|
20
16
|
var getCurrentTime = (0, react_1.useCallback)(function () {
|
21
|
-
var
|
22
|
-
var
|
23
|
-
var
|
17
|
+
var timeInTimezone = new Date();
|
18
|
+
var hour = timeInTimezone.getHours();
|
19
|
+
var minute = timeInTimezone.getMinutes();
|
20
|
+
// 절대 위치 계산 (각 시간 슬롯이 60px 높이)
|
21
|
+
var pixelPosition = hour * 60 + (minute / 60) * 60;
|
24
22
|
return {
|
25
|
-
hour:
|
26
|
-
minute:
|
27
|
-
|
23
|
+
hour: hour,
|
24
|
+
minute: minute,
|
25
|
+
pixelPosition: pixelPosition
|
28
26
|
};
|
29
|
-
}, [
|
27
|
+
}, []);
|
30
28
|
var _c = (0, react_1.useState)(getCurrentTime()), currentTime = _c[0], setCurrentTime = _c[1];
|
31
29
|
(0, react_1.useEffect)(function () {
|
32
30
|
var updateTime = function () {
|
@@ -36,7 +34,7 @@ var CurrentTimeIndicator = function (_a) {
|
|
36
34
|
var interval = setInterval(updateTime, 60000);
|
37
35
|
return function () { return clearInterval(interval); };
|
38
36
|
}, [getCurrentTime]);
|
39
|
-
return ((0, jsx_runtime_1.jsx)(S_CurrentTimeIndicator, { "$show": show, "$top": "".concat(currentTime.
|
37
|
+
return ((0, jsx_runtime_1.jsx)(S_CurrentTimeIndicator, { "$show": show, "$top": "".concat(currentTime.pixelPosition, "px"), "$leftOffset": leftOffset }));
|
40
38
|
};
|
41
39
|
exports.CurrentTimeIndicator = CurrentTimeIndicator;
|
42
40
|
var S_CurrentTimeIndicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n display: ", ";\n height: 2px;\n left: ", ";\n position: absolute;\n right: 0;\n top: ", ";\n z-index: 10;\n\n &::before {\n background: ", ";\n border-radius: 50%;\n content: '';\n height: 8px;\n left: -4px;\n position: absolute;\n top: -3px;\n width: 8px;\n }\n"], ["\n background: ", ";\n display: ", ";\n height: 2px;\n left: ", ";\n position: absolute;\n right: 0;\n top: ", ";\n z-index: 10;\n\n &::before {\n background: ", ";\n border-radius: 50%;\n content: '';\n height: 8px;\n left: -4px;\n position: absolute;\n top: -3px;\n width: 8px;\n }\n"])), function (_a) {
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.toUTC = exports.calculateDateRange = exports.calculateIsAllDay = void 0;
|
4
4
|
var dateHelper_1 = require("../../../common/utils/dateHelper");
|
5
|
+
var types_1 = require("./types");
|
5
6
|
/**
|
6
7
|
* 일정이 종일 일정인지 확인하는 함수
|
7
8
|
* @param startDate 시작 날짜
|
@@ -22,16 +23,16 @@ var calculateIsAllDay = function (startDate, endDate) {
|
|
22
23
|
exports.calculateIsAllDay = calculateIsAllDay;
|
23
24
|
var calculateDateRange = function (viewType, baseDate) {
|
24
25
|
switch (viewType) {
|
25
|
-
case
|
26
|
+
case types_1.CalendarViewType.DAY:
|
26
27
|
return { startDate: baseDate, endDate: baseDate };
|
27
|
-
case
|
28
|
+
case types_1.CalendarViewType.WEEK: {
|
28
29
|
var start = new Date(baseDate);
|
29
30
|
start.setDate(baseDate.getDate() - baseDate.getDay());
|
30
31
|
var end = new Date(start);
|
31
32
|
end.setDate(start.getDate() + 6);
|
32
33
|
return { startDate: start, endDate: end };
|
33
34
|
}
|
34
|
-
case
|
35
|
+
case types_1.CalendarViewType.MONTH: {
|
35
36
|
var startDate = new Date(baseDate.getFullYear(), baseDate.getMonth(), 1);
|
36
37
|
// 실제 MonthlyView에서 보여지는 날짜 배열을 구함
|
37
38
|
var days = dateHelper_1.DateHelper.getCalendarDatesForCalendar(startDate, 'sunday');
|
@@ -40,7 +41,7 @@ var calculateDateRange = function (viewType, baseDate) {
|
|
40
41
|
endDate: days[days.length - 1]
|
41
42
|
};
|
42
43
|
}
|
43
|
-
case
|
44
|
+
case types_1.CalendarViewType.YEAR:
|
44
45
|
return {
|
45
46
|
startDate: new Date(baseDate.getFullYear(), 0, 1),
|
46
47
|
endDate: new Date(baseDate.getFullYear(), 11, 31)
|
@@ -8,7 +8,8 @@ export { TimeBasedScheduleItem } from './TimeBasedScheduleItem';
|
|
8
8
|
export { WeeklyView } from './WeeklyView';
|
9
9
|
export { YearlyView } from './YearlyView';
|
10
10
|
export * from './timeFormatUtils';
|
11
|
-
export
|
11
|
+
export { CalendarViewType } from './types';
|
12
|
+
export type { CalendarProps, Schedule, displayAllDayScheduleMode, StartOfWeek, TodayBtnMode, Config, CalendarAction } from './types';
|
12
13
|
export { getLocaleFromLang } from './constants';
|
13
14
|
export type { ScheduleItemExtraProps } from './ScheduleItem';
|
14
15
|
export type { ScheduleItemExtraProps as CalendarContextExtraProps } from './CalendarContext';
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
18
18
|
};
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
20
|
-
exports.getLocaleFromLang = exports.YearlyView = exports.WeeklyView = exports.TimeBasedScheduleItem = exports.ScheduleItem = exports.MonthlyView = exports.DailyView = exports.useCalendarContext = exports.CalendarProvider = exports.Calendar = exports.AllDaySchedulesSection = void 0;
|
20
|
+
exports.getLocaleFromLang = exports.CalendarViewType = exports.YearlyView = exports.WeeklyView = exports.TimeBasedScheduleItem = exports.ScheduleItem = exports.MonthlyView = exports.DailyView = exports.useCalendarContext = exports.CalendarProvider = exports.Calendar = exports.AllDaySchedulesSection = void 0;
|
21
21
|
var AllDaySchedulesSection_1 = require("./AllDaySchedulesSection");
|
22
22
|
Object.defineProperty(exports, "AllDaySchedulesSection", { enumerable: true, get: function () { return AllDaySchedulesSection_1.AllDaySchedulesSection; } });
|
23
23
|
var Calendar_1 = require("./Calendar");
|
@@ -38,5 +38,7 @@ Object.defineProperty(exports, "WeeklyView", { enumerable: true, get: function (
|
|
38
38
|
var YearlyView_1 = require("./YearlyView");
|
39
39
|
Object.defineProperty(exports, "YearlyView", { enumerable: true, get: function () { return YearlyView_1.YearlyView; } });
|
40
40
|
__exportStar(require("./timeFormatUtils"), exports);
|
41
|
+
var types_1 = require("./types");
|
42
|
+
Object.defineProperty(exports, "CalendarViewType", { enumerable: true, get: function () { return types_1.CalendarViewType; } });
|
41
43
|
var constants_1 = require("./constants");
|
42
44
|
Object.defineProperty(exports, "getLocaleFromLang", { enumerable: true, get: function () { return constants_1.getLocaleFromLang; } });
|
@@ -1,5 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export
|
2
|
+
export declare enum CalendarViewType {
|
3
|
+
MONTH = "MONTH",
|
4
|
+
WEEK = "WEEK",
|
5
|
+
DAY = "DAY",
|
6
|
+
YEAR = "YEAR"
|
7
|
+
}
|
3
8
|
export type displayAllDayScheduleMode = 'none' | 'use';
|
4
9
|
export type StartOfWeek = 'sunday' | 'monday';
|
5
10
|
export type TodayBtnMode = 'none' | 'use';
|
@@ -1,2 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CalendarViewType = void 0;
|
4
|
+
var CalendarViewType;
|
5
|
+
(function (CalendarViewType) {
|
6
|
+
CalendarViewType["MONTH"] = "MONTH";
|
7
|
+
CalendarViewType["WEEK"] = "WEEK";
|
8
|
+
CalendarViewType["DAY"] = "DAY";
|
9
|
+
CalendarViewType["YEAR"] = "YEAR";
|
10
|
+
})(CalendarViewType = exports.CalendarViewType || (exports.CalendarViewType = {}));
|
package/package.json
CHANGED
package/release-note.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# PDS-DEV-KIT-WEB Release Notes
|
2
|
-
## [v2.2.
|
2
|
+
## [v2.2.224]
|
3
3
|
## daily|https://design.storybook.publ.biz/
|
4
4
|
|
5
5
|
### 업데이트 사항
|
6
|
-
* [PDS-
|
7
|
-
* [PDS-1347] BoxItem selectedState / checkboxMode 분리 업데이트
|
6
|
+
* [PDS-1351] RichTextEditor의 톤 적용이 되지 않는 현상
|