@steroidsjs/core 3.0.0-beta.99 → 3.0.0
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/actions/notifications.js +7 -1
- package/actions/router.js +16 -2
- package/components/HttpComponent.d.ts +7 -7
- package/components/JwtHttpComponent.d.ts +2 -2
- package/components/LocaleComponent.d.ts +6 -6
- package/components/MetaComponent.d.ts +90 -1
- package/components/MetricsComponent.js +2 -1
- package/components/ResourceComponent.d.ts +4 -4
- package/components/UiComponent.d.ts +7 -7
- package/components/WebSocketComponent.d.ts +11 -11
- package/docs-autogen-result.json +15147 -6371
- package/en.json +151 -92
- package/hooks/index.d.ts +4 -3
- package/hooks/index.js +7 -5
- package/hooks/useAbsolutePositioning.js +0 -1
- package/hooks/useAddressBar.js +0 -1
- package/hooks/useApplication.js +8 -1
- package/hooks/useDataProvider.d.ts +17 -2
- package/hooks/useDataSelect.js +21 -4
- package/hooks/useFetch.js +6 -1
- package/hooks/useFile.d.ts +1 -0
- package/hooks/useFile.js +2 -0
- package/hooks/useList.d.ts +53 -14
- package/hooks/useList.js +31 -70
- package/hooks/useTree.d.ts +104 -0
- package/hooks/useTree.js +169 -0
- package/index.d.ts +3 -3
- package/package.json +94 -93
- package/reducers/router.d.ts +2 -1
- package/ui/content/Accordion/Accordion.d.ts +8 -5
- package/ui/content/Accordion/Accordion.js +6 -1
- package/ui/content/Accordion/AccordionItem.d.ts +2 -2
- package/ui/content/Accordion/AccordionItem.js +1 -12
- package/ui/content/Alert/Alert.d.ts +5 -2
- package/ui/content/Alert/Alert.js +13 -12
- package/ui/content/Avatar/Avatar.js +18 -12
- package/ui/content/Badge/Badge.d.ts +5 -1
- package/ui/content/Badge/Badge.js +14 -12
- package/ui/content/Calendar/Calendar.d.ts +6 -1
- package/ui/content/Calendar/Calendar.js +19 -12
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +40 -18
- package/ui/content/CalendarSystem/CalendarSystem.js +65 -76
- package/ui/content/CalendarSystem/hooks/useCalendarControls.d.ts +1 -2
- package/ui/content/CalendarSystem/hooks/useCalendarControls.js +14 -17
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +11 -3
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarType.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useCalendarType.js +22 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +49 -0
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.d.ts → useMonthGrid.d.ts} +4 -5
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.js → useMonthGrid.js} +24 -15
- package/ui/content/CalendarSystem/hooks/{useWeekCalendar.d.ts → useWeekGrid.d.ts} +6 -5
- package/ui/content/CalendarSystem/hooks/useWeekGrid.js +72 -0
- package/ui/content/CalendarSystem/utils/utils.d.ts +8 -0
- package/ui/content/CalendarSystem/utils/utils.js +27 -1
- package/ui/content/Card/Card.d.ts +33 -27
- package/ui/content/Card/Card.js +1 -12
- package/ui/content/Chart/Chart.d.ts +38 -8
- package/ui/content/Chart/Chart.js +16 -12
- package/ui/content/Chat/Chat.d.ts +90 -5
- package/ui/content/Chat/Chat.js +40 -14
- package/ui/content/Chat/constants/timeTemplatesAndUnits.d.ts +1 -0
- package/ui/content/Chat/constants/timeTemplatesAndUnits.js +2 -1
- package/ui/content/Chat/hooks/useChat.d.ts +5 -6
- package/ui/content/Chat/hooks/useChat.js +49 -3
- package/ui/content/Chat/utils/addNewMessageIntoGroupedMessages.d.ts +5 -0
- package/ui/content/Chat/utils/addNewMessageIntoGroupedMessages.js +61 -0
- package/ui/content/Chat/utils/getMessagesGroupedByDate.d.ts +1 -0
- package/ui/content/Chat/utils/getMessagesGroupedByDate.js +3 -2
- package/ui/content/Chat/utils/index.d.ts +4 -2
- package/ui/content/Chat/utils/index.js +6 -1
- package/ui/content/Chat/utils/isTodayMessage.d.ts +1 -0
- package/ui/content/Chat/utils/isTodayMessage.js +13 -0
- package/ui/content/CopyToClipboard/CopyToClipboard.d.ts +3 -3
- package/ui/content/CopyToClipboard/CopyToClipboard.js +10 -12
- package/ui/content/Dashboard/Dashboard.d.ts +5 -2
- package/ui/content/Dashboard/Dashboard.js +27 -3
- package/ui/content/Detail/Detail.d.ts +15 -2
- package/ui/content/Detail/Detail.js +12 -1
- package/ui/content/DropDown/DropDown.d.ts +1 -1
- package/ui/content/DropDown/DropDown.js +16 -4
- package/ui/content/Icon/Icon.js +13 -15
- package/ui/content/Kanban/Kanban.d.ts +15 -4
- package/ui/content/Kanban/Kanban.js +8 -12
- package/ui/content/Kanban/hooks/useKanban.d.ts +33 -26
- package/ui/content/Menu/Menu.js +10 -12
- package/ui/content/Slider/Slider.js +1 -12
- package/ui/crud/index.d.ts +3 -0
- package/ui/form/AutoCompleteField/AutoCompleteField.js +1 -1
- package/ui/form/Button/Button.js +8 -2
- package/ui/form/CheckboxField/CheckboxField.d.ts +1 -0
- package/ui/form/CheckboxField/CheckboxField.js +2 -2
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +18 -2
- package/ui/form/CheckboxListField/CheckboxListField.js +1 -1
- package/ui/form/CheckboxTreeField/CheckboxTreeField.d.ts +67 -0
- package/ui/form/CheckboxTreeField/CheckboxTreeField.js +126 -0
- package/ui/form/CheckboxTreeField/index.d.ts +2 -0
- package/ui/form/CheckboxTreeField/index.js +7 -0
- package/ui/form/DateField/DateField.js +4 -1
- package/ui/form/DateField/useDateRange.d.ts +1 -0
- package/ui/form/DateField/useDateRange.js +13 -2
- package/ui/form/DateRangeField/DateRangeField.d.ts +34 -1
- package/ui/form/DateRangeField/DateRangeField.js +59 -8
- package/ui/form/DateTimeField/DateTimeField.d.ts +10 -0
- package/ui/form/DateTimeField/DateTimeField.js +11 -3
- package/ui/form/DateTimeRangeField/DateTimeRangeField.d.ts +25 -1
- package/ui/form/DateTimeRangeField/DateTimeRangeField.js +66 -13
- package/ui/form/DropDownField/DropDownField.d.ts +23 -3
- package/ui/form/DropDownField/DropDownField.js +1 -1
- package/ui/form/EmailField/EmailField.d.ts +6 -0
- package/ui/form/EmailField/EmailField.js +0 -4
- package/ui/form/Field/Field.d.ts +9 -1
- package/ui/form/Field/Field.js +1 -1
- package/ui/form/Field/fieldWrapper.d.ts +9 -1
- package/ui/form/FieldList/FieldList.d.ts +13 -7
- package/ui/form/FieldList/FieldList.js +30 -4
- package/ui/form/FileField/FileField.js +5 -0
- package/ui/form/Form/Form.d.ts +26 -3
- package/ui/form/Form/Form.js +5 -3
- package/ui/form/ImageField/ImageField.d.ts +9 -1
- package/ui/form/InputField/InputField.d.ts +5 -2
- package/ui/form/InputField/hooks/useInputFieldWarningByType.js +1 -0
- package/ui/form/NumberField/NumberField.js +34 -7
- package/ui/form/SliderField/SliderField.d.ts +10 -2
- package/ui/form/TimeRangeField/TimeRangeField.d.ts +10 -1
- package/ui/form/TimeRangeField/TimeRangeField.js +3 -1
- package/ui/form/WizardForm/WizardForm.d.ts +119 -0
- package/ui/form/WizardForm/WizardForm.js +167 -0
- package/ui/form/WizardForm/index.d.ts +2 -0
- package/ui/form/WizardForm/index.js +7 -0
- package/ui/form/WizardForm/utils.d.ts +12 -0
- package/ui/form/WizardForm/utils.js +111 -0
- package/ui/form/index.d.ts +3 -1
- package/ui/form/index.js +4 -1
- package/ui/layout/ProgressBar/ProgressBar.js +8 -2
- package/ui/layout/Skeleton/Skeleton.d.ts +3 -1
- package/ui/layout/Tooltip/Tooltip.d.ts +4 -1
- package/ui/list/ControlsColumn/ControlsColumn.d.ts +17 -3
- package/ui/list/FlexGrid/FlexGrid.d.ts +11 -1
- package/ui/list/Grid/Grid.d.ts +42 -6
- package/ui/list/Grid/Grid.js +1 -2
- package/ui/list/LayoutNames/LayoutNames.d.ts +11 -1
- package/ui/list/Steps/Steps.d.ts +19 -7
- package/ui/list/Steps/Steps.js +46 -26
- package/ui/list/TreeTable/TreeTable.d.ts +34 -33
- package/ui/list/TreeTable/TreeTable.js +19 -8
- package/ui/modal/Modal/Modal.d.ts +7 -1
- package/ui/nav/Breadcrumbs/Breadcrumbs.d.ts +11 -1
- package/ui/nav/ButtonGroup/ButtonGroup.d.ts +13 -4
- package/ui/nav/Controls/Controls.d.ts +7 -1
- package/ui/nav/Link/Link.d.ts +1 -1
- package/ui/nav/Nav/Nav.d.ts +19 -4
- package/ui/nav/Router/Router.d.ts +19 -3
- package/ui/nav/Router/Router.js +11 -6
- package/ui/nav/Router/helpers.d.ts +2 -2
- package/ui/nav/Router/helpers.js +39 -7
- package/ui/nav/Tree/Tree.d.ts +32 -62
- package/ui/nav/Tree/Tree.js +18 -165
- package/utils/calculateComponentAbsolutePosition.js +74 -24
- package/utils/calendar.d.ts +8 -0
- package/utils/calendar.js +76 -1
- package/utils/data.js +1 -0
- package/utils/form.d.ts +1 -0
- package/utils/form.js +16 -1
- package/ui/content/CalendarSystem/hooks/useWeekCalendar.js +0 -86
- package/utils/list.d.ts +0 -1
- package/utils/list.js +0 -5
package/utils/calendar.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.convertDate = void 0;
|
|
6
|
+
exports.customLocaleUtils = exports.convertDate = void 0;
|
|
7
7
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
8
8
|
/* eslint-disable import/prefer-default-export */
|
|
9
9
|
var dayjs_1 = __importDefault(require("dayjs"));
|
|
@@ -45,6 +45,81 @@ var convertDate = function (date, fromFormats, toFormat, isUtc, dateInUtc) {
|
|
|
45
45
|
return toFormat ? dayjsDate.format(toFormat) : dayjsDate.toDate();
|
|
46
46
|
};
|
|
47
47
|
exports.convertDate = convertDate;
|
|
48
|
+
/**
|
|
49
|
+
* Функции форматирования для локализации Day Picker.
|
|
50
|
+
*/
|
|
51
|
+
var WEEKDAYS_LONG = {
|
|
52
|
+
en: [
|
|
53
|
+
'Sunday',
|
|
54
|
+
'Monday',
|
|
55
|
+
'Tuesday',
|
|
56
|
+
'Wednesday',
|
|
57
|
+
'Thursday',
|
|
58
|
+
'Friday',
|
|
59
|
+
'Saturday',
|
|
60
|
+
],
|
|
61
|
+
ru: [
|
|
62
|
+
'Понедельник',
|
|
63
|
+
'Вторник',
|
|
64
|
+
'Среда',
|
|
65
|
+
'Четверг',
|
|
66
|
+
'Пятница',
|
|
67
|
+
'Суббота',
|
|
68
|
+
'Воскресенье',
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
var WEEKDAYS_SHORT = {
|
|
72
|
+
en: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
73
|
+
ru: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']
|
|
74
|
+
};
|
|
75
|
+
var MONTHS = {
|
|
76
|
+
en: [
|
|
77
|
+
'January',
|
|
78
|
+
'February',
|
|
79
|
+
'March',
|
|
80
|
+
'April',
|
|
81
|
+
'May',
|
|
82
|
+
'June',
|
|
83
|
+
'July',
|
|
84
|
+
'August',
|
|
85
|
+
'September',
|
|
86
|
+
'October',
|
|
87
|
+
'November',
|
|
88
|
+
'December',
|
|
89
|
+
],
|
|
90
|
+
ru: [
|
|
91
|
+
'Январь',
|
|
92
|
+
'Февраль',
|
|
93
|
+
'Март',
|
|
94
|
+
'Апрель',
|
|
95
|
+
'Май',
|
|
96
|
+
'Июнь',
|
|
97
|
+
'Июль',
|
|
98
|
+
'Август',
|
|
99
|
+
'Сентябрь',
|
|
100
|
+
'Октябрь',
|
|
101
|
+
'Ноябрь',
|
|
102
|
+
'Декабрь',
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
var FIRST_DAY = {
|
|
106
|
+
en: 0,
|
|
107
|
+
ru: 1
|
|
108
|
+
};
|
|
109
|
+
var formatDay = function (day, locale) { return "".concat(WEEKDAYS_LONG[locale][day.getDay()], ", ").concat(day.getDate(), " ").concat(MONTHS[locale][day.getMonth()], " ").concat(day.getFullYear()); };
|
|
110
|
+
var formatMonthTitle = function (month, locale) { return "".concat(MONTHS[locale][month.getMonth()], " ").concat(month.getFullYear()); };
|
|
111
|
+
var formatWeekdayShort = function (weekday, locale) { return WEEKDAYS_SHORT[locale][weekday]; };
|
|
112
|
+
var formatWeekdayLong = function (weekday, locale) { return WEEKDAYS_SHORT[locale][weekday]; };
|
|
113
|
+
var getFirstDayOfWeek = function (locale) { return FIRST_DAY[locale]; };
|
|
114
|
+
var getMonths = function (locale) { return MONTHS[locale]; };
|
|
115
|
+
exports.customLocaleUtils = {
|
|
116
|
+
formatDay: formatDay,
|
|
117
|
+
formatMonthTitle: formatMonthTitle,
|
|
118
|
+
formatWeekdayShort: formatWeekdayShort,
|
|
119
|
+
formatWeekdayLong: formatWeekdayLong,
|
|
120
|
+
getFirstDayOfWeek: getFirstDayOfWeek,
|
|
121
|
+
getMonths: getMonths
|
|
122
|
+
};
|
|
48
123
|
/**
|
|
49
124
|
* Регулярка проверяет соответствие введенной строки формату 'hh:mm'
|
|
50
125
|
* Максимальная величина - 23:59
|
package/utils/data.js
CHANGED
|
@@ -144,6 +144,7 @@ var shouldUpdate = function (objA, objB, deepPaths) {
|
|
|
144
144
|
? (0, exports.shouldUpdate)(objA[key], objB[key], deepPath)
|
|
145
145
|
: (0, exports.shouldUpdateSingle)(objA[key], objB[key]);
|
|
146
146
|
if (hasChanges) {
|
|
147
|
+
// eslint-disable-next-line no-console
|
|
147
148
|
console.log(0, 'shouldUpdate changed key:', key, objA[key], objB[key]);
|
|
148
149
|
return { value: true };
|
|
149
150
|
}
|
package/utils/form.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const setInWithPath: (state: any, value: any, path: string[], pathIndex?: number) => any;
|
|
3
3
|
export declare const cleanEmptyObject: (object: any) => any;
|
|
4
|
+
export declare const clearErrors: (values: any, prevValues: any, errors: any, setErrors: any) => void;
|
|
4
5
|
export declare const providers: {
|
|
5
6
|
redux: {
|
|
6
7
|
useForm: (formId: any, initialValues: any) => any;
|
package/utils/form.js
CHANGED
|
@@ -14,11 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
|
-
exports.providers = exports.cleanEmptyObject = exports.setInWithPath = void 0;
|
|
17
|
+
exports.providers = exports.clearErrors = exports.cleanEmptyObject = exports.setInWithPath = void 0;
|
|
18
18
|
var isPlainObject_1 = __importDefault(require("lodash-es/isPlainObject"));
|
|
19
19
|
var isArray_1 = __importDefault(require("lodash-es/isArray"));
|
|
20
20
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
21
21
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
22
|
+
var differenceWith_1 = __importDefault(require("lodash-es/differenceWith"));
|
|
23
|
+
var toPairs_1 = __importDefault(require("lodash-es/toPairs"));
|
|
24
|
+
var omit_1 = __importDefault(require("lodash-es/omit"));
|
|
25
|
+
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
22
26
|
var react_1 = require("react");
|
|
23
27
|
var react_use_1 = require("react-use");
|
|
24
28
|
var useDispatch_1 = __importDefault(require("../hooks/useDispatch"));
|
|
@@ -75,6 +79,17 @@ var cleanEmptyObject = function (object) {
|
|
|
75
79
|
return object;
|
|
76
80
|
};
|
|
77
81
|
exports.cleanEmptyObject = cleanEmptyObject;
|
|
82
|
+
var clearErrors = function (values, prevValues, errors, setErrors) {
|
|
83
|
+
if (!(0, isEmpty_1["default"])(errors) && !(0, isEqual_1["default"])(prevValues || {}, values)) {
|
|
84
|
+
// compare arrays of key-value pairs in previous and new field objects to identify the changed field
|
|
85
|
+
var changedField = (0, differenceWith_1["default"])((0, toPairs_1["default"])(values), (0, toPairs_1["default"])(prevValues), isEqual_1["default"]);
|
|
86
|
+
if (!(0, isEmpty_1["default"])(changedField)) {
|
|
87
|
+
var cleanedErrors = (0, omit_1["default"])(errors, changedField[0]);
|
|
88
|
+
setErrors((0, isEmpty_1["default"])(cleanedErrors) ? null : cleanedErrors);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.clearErrors = clearErrors;
|
|
78
93
|
// Form state providers
|
|
79
94
|
exports.providers = {
|
|
80
95
|
// Redux
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var calendar_1 = require("../../../../utils/calendar");
|
|
19
|
-
var DateControlType_1 = __importDefault(require("../enums/DateControlType"));
|
|
20
|
-
var useCalendarControls_1 = require("./useCalendarControls");
|
|
21
|
-
var utils_1 = require("../utils/utils");
|
|
22
|
-
var WEEK_DAY_FORMAT = 'dd, D MMM';
|
|
23
|
-
var ONE_DAY = 1;
|
|
24
|
-
var getFormattedWeekFromDate = function (fromDate) {
|
|
25
|
-
if (fromDate === void 0) { fromDate = null; }
|
|
26
|
-
var currentWeek = (0, utils_1.getWeekDaysFromDate)(fromDate || new Date());
|
|
27
|
-
return currentWeek.map(function (dayOfWeek) {
|
|
28
|
-
var copyOfDayWeek = __assign({}, dayOfWeek);
|
|
29
|
-
copyOfDayWeek.formattedDisplay = (0, calendar_1.convertDate)(dayOfWeek.date, null, WEEK_DAY_FORMAT);
|
|
30
|
-
// eslint-disable-next-line no-unused-expressions
|
|
31
|
-
(0, utils_1.isDateIsToday)(copyOfDayWeek.date) ? copyOfDayWeek.isToday = true : copyOfDayWeek.isToday = false;
|
|
32
|
-
return copyOfDayWeek;
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var useWeekCalendar = function (currentMonthDate) {
|
|
36
|
-
var _a;
|
|
37
|
-
var _b = react_1["default"].useState(getFormattedWeekFromDate()), currentWeek = _b[0], setCurrentWeek = _b[1];
|
|
38
|
-
var forceUpdateWeekOnMonthChange = react_1["default"].useCallback(function (newMonthDate) {
|
|
39
|
-
setCurrentWeek(getFormattedWeekFromDate(newMonthDate));
|
|
40
|
-
}, []);
|
|
41
|
-
var changeMonthAfterWeekChanged = react_1["default"].useCallback(function (formattedWeek) {
|
|
42
|
-
var firstDayOfWeek = formattedWeek[0].date;
|
|
43
|
-
var currentMonthNumber = currentMonthDate.getMonth();
|
|
44
|
-
var isWeekOutOfMonth = formattedWeek.every(function (dayOfWeek) { return dayOfWeek.date.getMonth() !== currentMonthNumber; });
|
|
45
|
-
if (!isWeekOutOfMonth) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (currentMonthNumber - firstDayOfWeek.getMonth() === 1) {
|
|
49
|
-
var lastDayOfWeekInNewMonth = formattedWeek[formattedWeek.length - 1].date;
|
|
50
|
-
var prevMonthControl = (0, useCalendarControls_1.getSourceCalendarControl)(DateControlType_1["default"].PREV_ONE);
|
|
51
|
-
prevMonthControl.click();
|
|
52
|
-
forceUpdateWeekOnMonthChange(lastDayOfWeekInNewMonth);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
var firstDayOfWeekInNewMonth = formattedWeek[0].date;
|
|
56
|
-
var nextMonthControl = (0, useCalendarControls_1.getSourceCalendarControl)(DateControlType_1["default"].NEXT_ONE);
|
|
57
|
-
nextMonthControl.click();
|
|
58
|
-
forceUpdateWeekOnMonthChange(firstDayOfWeekInNewMonth);
|
|
59
|
-
}
|
|
60
|
-
}, [currentMonthDate, forceUpdateWeekOnMonthChange]);
|
|
61
|
-
var setNextWeek = react_1["default"].useCallback(function () {
|
|
62
|
-
var lastDayOfWeek = currentWeek[currentWeek.length - 1].date;
|
|
63
|
-
lastDayOfWeek.setDate(lastDayOfWeek.getDate() + ONE_DAY);
|
|
64
|
-
var formattedNextWeek = getFormattedWeekFromDate(lastDayOfWeek);
|
|
65
|
-
setCurrentWeek(formattedNextWeek);
|
|
66
|
-
changeMonthAfterWeekChanged(formattedNextWeek);
|
|
67
|
-
}, [currentWeek, changeMonthAfterWeekChanged]);
|
|
68
|
-
var setPrevWeek = react_1["default"].useCallback(function () {
|
|
69
|
-
var firstDayOfWeek = currentWeek[0].date;
|
|
70
|
-
firstDayOfWeek.setDate(firstDayOfWeek.getDate() - ONE_DAY);
|
|
71
|
-
var formattedPrevWeek = getFormattedWeekFromDate(firstDayOfWeek);
|
|
72
|
-
setCurrentWeek(formattedPrevWeek);
|
|
73
|
-
changeMonthAfterWeekChanged(formattedPrevWeek);
|
|
74
|
-
}, [currentWeek, changeMonthAfterWeekChanged]);
|
|
75
|
-
return {
|
|
76
|
-
currentWeek: currentWeek,
|
|
77
|
-
weekControls: (_a = {},
|
|
78
|
-
_a[DateControlType_1["default"].NEXT_DOUBLE] = DateControlType_1["default"].NEXT_ONE,
|
|
79
|
-
_a[DateControlType_1["default"].NEXT_ONE] = setNextWeek,
|
|
80
|
-
_a[DateControlType_1["default"].PREV_ONE] = setPrevWeek,
|
|
81
|
-
_a[DateControlType_1["default"].PREV_DOUBLE] = DateControlType_1["default"].PREV_ONE,
|
|
82
|
-
_a),
|
|
83
|
-
forceUpdateWeekOnMonthChange: forceUpdateWeekOnMonthChange
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
exports["default"] = useWeekCalendar;
|
package/utils/list.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getTreeItemUniqId: (item: any, index: any, parentId: any) => string;
|
package/utils/list.js
DELETED