react-big-schedule 4.3.0 → 4.3.2

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.
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default2 = require("./default");
8
+ var _default = exports["default"] = {
9
+ schedulerWidth: '100%',
10
+ besidesWidth: 20,
11
+ schedulerMaxHeight: 0,
12
+ tableHeaderHeight: 40,
13
+ schedulerContentHeight: '500px',
14
+ responsiveByParent: false,
15
+ agendaResourceTableWidth: 160,
16
+ agendaMaxEventWidth: 100,
17
+ dayResourceTableWidth: 160,
18
+ weekResourceTableWidth: '16%',
19
+ monthResourceTableWidth: 160,
20
+ quarterResourceTableWidth: 160,
21
+ yearResourceTableWidth: 160,
22
+ customResourceTableWidth: 160,
23
+ dayCellWidth: 30,
24
+ weekCellWidth: '12%',
25
+ monthCellWidth: 80,
26
+ quarterCellWidth: 80,
27
+ yearCellWidth: 80,
28
+ customCellWidth: 80,
29
+ dayMaxEvents: 99,
30
+ weekMaxEvents: 99,
31
+ monthMaxEvents: 99,
32
+ quarterMaxEvents: 99,
33
+ yearMaxEvents: 99,
34
+ customMaxEvents: 99,
35
+ eventItemPopoverTrigger: 'hover',
36
+ eventItemPopoverPlacement: 'bottomLeft',
37
+ eventItemPopoverWidth: 300,
38
+ eventItemHeight: 22,
39
+ eventItemLineHeight: 24,
40
+ nonAgendaSlotMinHeight: 0,
41
+ dayStartFrom: 0,
42
+ dayStopTo: 23,
43
+ defaultEventBgColor: '#80C5F6',
44
+ selectedAreaColor: '#7EC2F3',
45
+ nonWorkingTimeHeadColor: '#999999',
46
+ nonWorkingTimeHeadBgColor: '#fff0f6',
47
+ nonWorkingTimeBodyBgColor: '#fff0f6',
48
+ summaryColor: '#666',
49
+ summaryPos: _default2.SummaryPos.TopRight,
50
+ groupOnlySlotColor: '#F8F8F8',
51
+ startResizable: true,
52
+ endResizable: true,
53
+ movable: true,
54
+ creatable: true,
55
+ crossResourceMove: true,
56
+ checkConflict: false,
57
+ scrollToSpecialDayjsEnabled: true,
58
+ eventItemPopoverEnabled: true,
59
+ eventItemPopoverShowColor: true,
60
+ calendarPopoverEnabled: true,
61
+ recurringEventsEnabled: true,
62
+ viewChangeSpinEnabled: true,
63
+ dateChangeSpinEnabled: true,
64
+ headerEnabled: true,
65
+ resourceViewEnabled: true,
66
+ displayWeekend: true,
67
+ relativeMove: true,
68
+ defaultExpanded: true,
69
+ dragAndDropEnabled: true,
70
+ schedulerHeaderEventsFuncsTimeoutMs: 100,
71
+ resourceName: 'Resource Name',
72
+ taskName: 'Task Name',
73
+ agendaViewHeader: 'Agenda',
74
+ addMorePopoverHeaderFormat: 'MMM D, YYYY dddd',
75
+ eventItemPopoverDateFormat: 'MMM D',
76
+ nonAgendaDayCellHeaderFormat: 'ha',
77
+ nonAgendaWeekCellHeaderFormat: 'ww/YYYY',
78
+ nonAgendaMonthCellHeaderFormat: 'MMM YYYY',
79
+ nonAgendaYearCellHeaderFormat: 'YYYY',
80
+ nonAgendaOtherCellHeaderFormat: 'ddd M/D',
81
+ minuteStep: 30,
82
+ views: [{
83
+ viewName: 'Day',
84
+ viewType: _default2.ViewType.Day,
85
+ showAgenda: false,
86
+ isEventPerspective: false
87
+ }, {
88
+ viewName: 'Week',
89
+ viewType: _default2.ViewType.Week,
90
+ showAgenda: false,
91
+ isEventPerspective: false
92
+ }, {
93
+ viewName: 'Month',
94
+ viewType: _default2.ViewType.Month,
95
+ showAgenda: false,
96
+ isEventPerspective: false
97
+ }, {
98
+ viewName: 'Quarter',
99
+ viewType: _default2.ViewType.Quarter,
100
+ showAgenda: false,
101
+ isEventPerspective: false
102
+ }, {
103
+ viewName: 'Year',
104
+ viewType: _default2.ViewType.Year,
105
+ showAgenda: false,
106
+ isEventPerspective: false
107
+ }]
108
+ };
@@ -0,0 +1,257 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ .header1-text {
8
+ font-size: 25px;
9
+ color: #90cdf9;
10
+ font-weight: 500;
11
+ }
12
+
13
+ .header2-text {
14
+ font-size: 14px;
15
+ font-weight: 500;
16
+ }
17
+
18
+ .header3-text {
19
+ font-size: 12px;
20
+ font-weight: 500;
21
+ }
22
+
23
+ .base-text {
24
+ font-size: 12px;
25
+ }
26
+
27
+ .help-text {
28
+ font-size: 12px;
29
+ color: #999;
30
+ }
31
+
32
+ .disabled-text {
33
+ font-size: 12px;
34
+ color: #ccc;
35
+ }
36
+
37
+ .scheduler {
38
+ margin: 20px auto;
39
+ border-spacing: 0;
40
+ }
41
+
42
+ .scheduler td {
43
+ padding: 0px;
44
+ }
45
+
46
+ .expander-space {
47
+ overflow: hidden;
48
+ display: inline-block;
49
+ width: 1em;
50
+ height: 1em;
51
+ line-height: 1em;
52
+ font-size: 0.9em;
53
+ vertical-align: middle;
54
+ margin-top: -1%;
55
+ }
56
+
57
+ .resource-view {
58
+ border: 1px solid #e9e9e9;
59
+ overflow: hidden;
60
+ }
61
+
62
+ .scheduler-view {
63
+ border: 1px solid #e9e9e9;
64
+ margin: 0 0 0 -1px;
65
+ padding: 0;
66
+ }
67
+
68
+ .scheduler-content {
69
+ position: relative;
70
+ z-index: 2;
71
+ }
72
+
73
+ .scheduler-bg {
74
+ position: absolute;
75
+ top: 0;
76
+ left: 0;
77
+ right: 0;
78
+ bottom: 0;
79
+ z-index: 1;
80
+ }
81
+
82
+ table.resource-table,
83
+ table.scheduler-bg-table,
84
+ table.scheduler-table {
85
+ width: 100%;
86
+ margin: 0;
87
+ padding: 0;
88
+ border-spacing: 0;
89
+ text-align: center;
90
+ }
91
+
92
+ table.scheduler-table {
93
+ border: 1px solid #e9e9e9;
94
+ }
95
+
96
+ table.scheduler-content-table {
97
+ margin: 0;
98
+ padding: 0;
99
+ border: 0 solid #e9e9e9;
100
+ border-spacing: 0;
101
+ }
102
+
103
+ table.resource-table tr,
104
+ table.scheduler-bg-table tr,
105
+ table.scheduler-table tr {
106
+ border-bottom: 1px solid #e9e9e9;
107
+ }
108
+
109
+ table.resource-table th,
110
+ table.scheduler-table th,
111
+ table.resource-table td,
112
+ table.scheduler-bg-table td,
113
+ table.scheduler-table td {
114
+ border-right: 1px solid #e9e9e9;
115
+ border-bottom: 1px solid #e9e9e9;
116
+ }
117
+
118
+ table.scheduler-bg-table th {
119
+ border-right: 1px solid #e9e9e9;
120
+ }
121
+
122
+ table.resource-table tr th:last-child,
123
+ table.scheduler-table tr th:last-child,
124
+ table.resource-table tr td:last-child,
125
+ table.scheduler-table tr td:last-child {
126
+ border-right: 0;
127
+ }
128
+
129
+ table.scheduler-table tr:last-child td {
130
+ border-bottom: 0;
131
+ }
132
+
133
+ .timeline-event {
134
+ position: absolute;
135
+ cursor: pointer;
136
+ }
137
+
138
+ .day-event {
139
+ position: relative;
140
+ display: inline-block;
141
+ margin: 0px 5px;
142
+ }
143
+
144
+ .day-event-container {
145
+ text-align: left;
146
+ padding: 5px 5px 0;
147
+ }
148
+
149
+ .round-all {
150
+ border-radius: 14px;
151
+ }
152
+
153
+ .round-head {
154
+ border-radius: 14px 0px 0px 14px;
155
+ }
156
+
157
+ .round-tail {
158
+ border-radius: 0px 14px 14px 0px;
159
+ }
160
+
161
+ .round-none {
162
+ border-radius: 0px;
163
+ }
164
+
165
+ .event-container {
166
+ position: relative;
167
+ }
168
+
169
+ .event-item {
170
+ margin: 1px 0;
171
+ width: 100%;
172
+ overflow: hidden;
173
+ text-overflow: ellipsis;
174
+ white-space: nowrap;
175
+ color: #fff;
176
+ padding-right: 20px !important;
177
+ }
178
+
179
+ .overflow-text {
180
+ overflow: hidden;
181
+ text-overflow: ellipsis;
182
+ white-space: nowrap;
183
+ padding-right: 5px !important;
184
+ }
185
+
186
+ .status-dot {
187
+ width: 14px;
188
+ height: 14px;
189
+ border-radius: 7px;
190
+ }
191
+
192
+ .ant-radio-button-wrapper-checked {
193
+ background-color: #108ee9;
194
+ color: #ffffff;
195
+ }
196
+
197
+ .icon-nav:hover {
198
+ color: #1e90ff !important;
199
+ box-shadow: 0 0 0px !important;
200
+ cursor: pointer;
201
+ }
202
+
203
+ .add-more-popover-overlay {
204
+ position: absolute;
205
+ z-index: 5;
206
+ border: 1px solid #e5e5e5;
207
+ background-color: #fff;
208
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
209
+ padding: 10px;
210
+ }
211
+
212
+ .popover-calendar {
213
+ width: 300px;
214
+ }
215
+
216
+ .popover-calendar .ant-calendar {
217
+ box-shadow: 0 1px 6px rgba(0, 0, 0, 0) !important;
218
+ }
219
+
220
+ .event-resizer {
221
+ position: absolute;
222
+ z-index: 4;
223
+ display: block;
224
+ width: 7px;
225
+ top: -1px;
226
+ bottom: -1px;
227
+ }
228
+
229
+ .event-start-resizer {
230
+ cursor: w-resize;
231
+ left: -1px;
232
+ }
233
+
234
+ .event-end-resizer {
235
+ cursor: e-resize;
236
+ right: -1px;
237
+ }
238
+
239
+ .selected-area {
240
+ position: absolute;
241
+ }
242
+
243
+ .slot-cell {
244
+ padding-left: 4px;
245
+ padding-right: 4px;
246
+ }
247
+
248
+ .slot-text {
249
+ display: inline-block;
250
+ padding-left: 4px;
251
+ padding-right: 4px;
252
+ }
253
+
254
+ .txt-btn-dis {
255
+ border: none;
256
+ background-color: transparent;
257
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isNonWorkingTime = exports.getSummary = exports.getScrollSpecialDayjs = exports.getNonAgendaViewBodyCellBgColor = exports.getEventText = exports.getDateLabel = exports.getCustomDate = exports["default"] = void 0;
7
+ var _default2 = require("../config/default");
8
+ // getSummary func example
9
+ // export const getSummary = (schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd) => ({ text: 'Summary', color: 'red', fontSize: '1.2rem' });
10
+ var getSummary = exports.getSummary = function getSummary() {
11
+ return {
12
+ text: 'Summary',
13
+ color: 'red',
14
+ fontSize: '1.2rem'
15
+ };
16
+ };
17
+
18
+ // getCustomDate example
19
+ var getCustomDate = exports.getCustomDate = function getCustomDate(schedulerData, num) {
20
+ var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : schedulerData.startDate;
21
+ var viewType = schedulerData.viewType,
22
+ localeDayjs = schedulerData.localeDayjs;
23
+ var startDate;
24
+ var endDate;
25
+ var cellUnit;
26
+ if (viewType === _default2.ViewType.Custom1) {
27
+ var monday = localeDayjs(new Date(date)).startOf('week');
28
+ startDate = num === 0 ? monday : localeDayjs(new Date(monday)).add(2 * num, 'weeks');
29
+ endDate = localeDayjs(new Date(startDate)).add(1, 'weeks').endOf('week');
30
+ cellUnit = _default2.CellUnit.Day;
31
+ } else if (viewType === _default2.ViewType.Custom2) {
32
+ var firstDayOfMonth = localeDayjs(new Date(date)).startOf('month');
33
+ startDate = num === 0 ? firstDayOfMonth : localeDayjs(new Date(firstDayOfMonth)).add(2 * num, 'months');
34
+ endDate = localeDayjs(new Date(startDate)).add(1, 'months').endOf('month');
35
+ cellUnit = _default2.CellUnit.Day;
36
+ } else {
37
+ startDate = num === 0 ? date : localeDayjs(new Date(date)).add(2 * num, 'days');
38
+ endDate = localeDayjs(new Date(startDate)).add(1, 'days');
39
+ cellUnit = _default2.CellUnit.Hour;
40
+ }
41
+ return {
42
+ startDate: startDate,
43
+ endDate: endDate,
44
+ cellUnit: cellUnit
45
+ };
46
+ };
47
+
48
+ // getNonAgendaViewBodyCellBgColor example
49
+ var getNonAgendaViewBodyCellBgColor = exports.getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
50
+ return header.nonWorkingTime ? undefined : '#87e8de';
51
+ };
52
+
53
+ // getDateLabel func example
54
+ var getDateLabel = exports.getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
55
+ var localeDayjs = schedulerData.localeDayjs;
56
+ var start = localeDayjs(new Date(startDate));
57
+ var end = localeDayjs(endDate);
58
+ var dateLabel = '';
59
+ if (viewType === _default2.ViewType.Week || start !== end && (viewType === _default2.ViewType.Custom || viewType === _default2.ViewType.Custom1 || viewType === _default2.ViewType.Custom2)) {
60
+ dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('D, YYYY'));
61
+ if (start.month() !== end.month()) dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
62
+ if (start.year() !== end.year()) dateLabel = "".concat(start.format('MMM D, YYYY'), "-").concat(end.format('MMM D, YYYY'));
63
+ } else if (viewType === _default2.ViewType.Month) {
64
+ dateLabel = start.format('MMMM YYYY');
65
+ } else if (viewType === _default2.ViewType.Quarter) {
66
+ dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
67
+ } else if (viewType === _default2.ViewType.Year) {
68
+ dateLabel = start.format('YYYY');
69
+ } else {
70
+ dateLabel = start.format('MMM D, YYYY');
71
+ }
72
+ return dateLabel;
73
+ };
74
+ var getEventText = exports.getEventText = function getEventText(schedulerData, event) {
75
+ var _schedulerData$resour;
76
+ return schedulerData.isEventPerspective ? ((_schedulerData$resour = schedulerData.resources.find(function (item) {
77
+ return item.id === event.resourceId;
78
+ })) === null || _schedulerData$resour === void 0 ? void 0 : _schedulerData$resour.name) || event.title : event.title;
79
+ };
80
+ var getScrollSpecialDayjs = exports.getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
81
+ var localeDayjs = schedulerData.localeDayjs;
82
+ return localeDayjs(new Date());
83
+ };
84
+ var isNonWorkingTime = exports.isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
85
+ var localeDayjs = schedulerData.localeDayjs,
86
+ cellUnit = schedulerData.cellUnit;
87
+ if (cellUnit === _default2.CellUnit.Hour) {
88
+ var hour = localeDayjs(new Date(time)).hour();
89
+ return hour < 9 || hour > 18;
90
+ }
91
+ var dayOfWeek = localeDayjs(new Date(time)).weekday();
92
+ return dayOfWeek === 0 || dayOfWeek === 6;
93
+ };
94
+ var _default = exports["default"] = {
95
+ getSummaryFunc: undefined,
96
+ getCustomDateFunc: undefined,
97
+ getNonAgendaViewBodyCellBgColorFunc: undefined,
98
+ getScrollSpecialDayjsFunc: getScrollSpecialDayjs,
99
+ getDateLabelFunc: getDateLabel,
100
+ getEventTextFunc: getEventText,
101
+ isNonWorkingTimeFunc: isNonWorkingTime
102
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ exports.getPos = getPos;
8
+ function getPos(element) {
9
+ var x = 0;
10
+ var y = 0;
11
+ var currentElement = element;
12
+ while (currentElement) {
13
+ x += currentElement.offsetLeft - currentElement.scrollLeft;
14
+ y += currentElement.offsetTop - currentElement.scrollTop;
15
+ currentElement = currentElement.offsetParent;
16
+ }
17
+ return {
18
+ x: x,
19
+ y: y
20
+ };
21
+ }
22
+ var _default = exports["default"] = getPos;