sapp-common-package-test-final 1.7.0 → 1.7.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.
@@ -134,68 +134,6 @@ var CALENDAR_TYPE;
134
134
  CALENDAR_TYPE["LMS"] = "LMS";
135
135
  })(CALENDAR_TYPE || (CALENDAR_TYPE = {}));
136
136
 
137
- var _convertType;
138
- var customDateFormat = function customDateFormat(value, formatStr) {
139
- return dayjs(value).format(formatStr);
140
- };
141
- var convertType = (_convertType = {}, _convertType[EVENT_TYPES.TEACHING] = 'info', _convertType[EVENT_TYPES.BUSY] = 'error', _convertType[EVENT_TYPES.HOLIDAY] = 'warning', _convertType[EVENT_TYPES.OTHER] = 'success', _convertType[EVENT_TYPES.LIVE_ONLINE] = 'purple', _convertType);
142
- var daysOfWeekKeys = Object.values(DAYS_OF_WEEK);
143
- var calculateNormOfWeek = function calculateNormOfWeek(norms, events, startDate, endDate) {
144
- var norm = norms.find(function (norm) {
145
- return startDate.isBetween(norm.startDate, norm.endDate, 'day', '[]') && endDate.isBetween(norm.startDate, norm.endDate, 'day', '[]');
146
- });
147
- if (!norm) {
148
- return {
149
- normOfWeek: 0,
150
- totalNorm: 0
151
- };
152
- }
153
- var normsOfWeek = events.filter(function (event) {
154
- return dayjs(event.startDate).isBetween(startDate, endDate, 'day', '[]') && endDate.isBetween(startDate, endDate, 'day', '[]') && event.type === EVENT_TYPES.TEACHING;
155
- });
156
- return {
157
- normOfWeek: normsOfWeek.length,
158
- totalNorm: norm.maxShift
159
- };
160
- };
161
- var splitEventsIntoDays = function splitEventsIntoDays(events) {
162
- var splittedEvents = [];
163
- for (var _iterator = _createForOfIteratorHelperLoose(events), _step; !(_step = _iterator()).done;) {
164
- var event = _step.value;
165
- var startDate = dayjs(event.startDate);
166
- var endDate = dayjs(event.endDate);
167
- var isSameDay = startDate.isSame(endDate, 'day');
168
- if (isSameDay) {
169
- splittedEvents.push(event);
170
- continue;
171
- }
172
- splittedEvents.push(_extends({}, event, {
173
- startDate: startDate.toDate(),
174
- endDate: startDate.endOf('day').toDate()
175
- }));
176
- var currentDate = startDate.startOf('day').add(1, 'day');
177
- while (currentDate.isBefore(endDate, 'day')) {
178
- splittedEvents.push(_extends({}, event, {
179
- startDate: currentDate.startOf('day').toDate(),
180
- endDate: currentDate.endOf('day').toDate()
181
- }));
182
- currentDate = currentDate.add(1, 'day');
183
- }
184
- splittedEvents.push(_extends({}, event, {
185
- startDate: endDate.startOf('day').toDate(),
186
- endDate: endDate.toDate()
187
- }));
188
- }
189
- return splittedEvents;
190
- };
191
- var checkIsAllday = function checkIsAllday(startDate, endDate) {
192
- if (!startDate.isValid() || !endDate.isValid()) {
193
- return false;
194
- }
195
- return startDate.format(TIME_FORMAT) === startDate.startOf('day').format(TIME_FORMAT) && endDate.format(TIME_FORMAT) === endDate.endOf('day').format(TIME_FORMAT) && startDate.isBefore(endDate);
196
- };
197
- var hoursOfDayKeys = Object.values(HOUR_OF_DAY);
198
-
199
137
  var _getIconEvent;
200
138
  var Left = function Left() {
201
139
  return React.createElement("svg", {
@@ -463,6 +401,75 @@ var getIconforEvent = function getIconforEvent(event) {
463
401
  }
464
402
  };
465
403
 
404
+ var _convertType;
405
+ var customDateFormat = function customDateFormat(value, formatStr) {
406
+ return dayjs(value).format(formatStr);
407
+ };
408
+ var convertType = (_convertType = {}, _convertType[EVENT_TYPES.TEACHING] = 'info', _convertType[EVENT_TYPES.BUSY] = 'error', _convertType[EVENT_TYPES.HOLIDAY] = 'warning', _convertType[EVENT_TYPES.OTHER] = 'success', _convertType[EVENT_TYPES.LIVE_ONLINE] = 'purple', _convertType);
409
+ var daysOfWeekKeys = Object.values(DAYS_OF_WEEK);
410
+ var calculateNormOfWeek = function calculateNormOfWeek(norms, events, startDate, endDate) {
411
+ var norm = norms.find(function (norm) {
412
+ return startDate.isBetween(norm.startDate, norm.endDate, 'day', '[]') && endDate.isBetween(norm.startDate, norm.endDate, 'day', '[]');
413
+ });
414
+ if (!norm) {
415
+ return {
416
+ normOfWeek: 0,
417
+ totalNorm: 0
418
+ };
419
+ }
420
+ var normsOfWeek = events.filter(function (event) {
421
+ return dayjs(event.startDate).isBetween(startDate, endDate, 'day', '[]') && endDate.isBetween(startDate, endDate, 'day', '[]') && event.type === EVENT_TYPES.TEACHING;
422
+ });
423
+ return {
424
+ normOfWeek: normsOfWeek.length,
425
+ totalNorm: norm.maxShift
426
+ };
427
+ };
428
+ var splitEventsIntoDays = function splitEventsIntoDays(events) {
429
+ var splittedEvents = [];
430
+ for (var _iterator = _createForOfIteratorHelperLoose(events), _step; !(_step = _iterator()).done;) {
431
+ var event = _step.value;
432
+ var startDate = dayjs(event.startDate);
433
+ var endDate = dayjs(event.endDate);
434
+ var isSameDay = startDate.isSame(endDate, 'day');
435
+ if (isSameDay) {
436
+ splittedEvents.push(event);
437
+ continue;
438
+ }
439
+ splittedEvents.push(_extends({}, event, {
440
+ startDate: startDate.toDate(),
441
+ endDate: startDate.endOf('day').toDate()
442
+ }));
443
+ var currentDate = startDate.startOf('day').add(1, 'day');
444
+ while (currentDate.isBefore(endDate, 'day')) {
445
+ splittedEvents.push(_extends({}, event, {
446
+ startDate: currentDate.startOf('day').toDate(),
447
+ endDate: currentDate.endOf('day').toDate()
448
+ }));
449
+ currentDate = currentDate.add(1, 'day');
450
+ }
451
+ splittedEvents.push(_extends({}, event, {
452
+ startDate: endDate.startOf('day').toDate(),
453
+ endDate: endDate.toDate()
454
+ }));
455
+ }
456
+ return splittedEvents;
457
+ };
458
+ var checkIsAllday = function checkIsAllday(startDate, endDate) {
459
+ if (!startDate.isValid() || !endDate.isValid()) {
460
+ return false;
461
+ }
462
+ return startDate.format(TIME_FORMAT) === startDate.startOf('day').format(TIME_FORMAT) && endDate.format(TIME_FORMAT) === endDate.endOf('day').format(TIME_FORMAT) && startDate.isBefore(endDate);
463
+ };
464
+ var hoursOfDayKeys = Object.values(HOUR_OF_DAY);
465
+ var isDisplayIcon = function isDisplayIcon(event) {
466
+ var iconList = getIconforEvent(event);
467
+ if (event.source === 'LMS') {
468
+ return Array.isArray(iconList) && iconList.length > 0;
469
+ }
470
+ return !!iconList;
471
+ };
472
+
466
473
  var styles = {"transform":"_3-Pu9","cursor-pointer":"_2Mcv6","resize":"_uCXxT","rounded-none":"_3EfQZ","border":"_3-abu","border-gray-4":"_3-NVJ","bg-button":"_3-gs3","bg-info/10":"_2ENMR","bg-white":"_rF-HF","!text-error":"_3mBZd","text-black":"_Irb_H","text-gray-600":"_1pL5w","text-info":"_NLvfI","text-secondary-text":"_H-zEU","!filter":"_3vIFr","filter":"_p0OEu","sapp-calendar":"_18t93","btn":"_1oiD_","icon":"_-E7rn","btn-default":"_3WrnL","btn-primary":"_2-qBL","event-info":"_xYqjb","event-warning":"_1oq3N","event-success":"_1hTMm","event-purple":"_30cym","event-error":"_1hEJk","event-default":"_8FWXy","sapp-calendar__container":"_102cL","header-calendar":"_3Yvs5","header-calendar__nav":"_18m93","header-calendar__date-picker":"_2GTYD","header-calendar__title":"_35LQ0","header-calendar__controls":"_FqVqb","header-calendar__divider":"_3kHog","monthly-calendar":"_2NDGW","weekly-calendar":"_1QrJs","monthly-calendar__title":"_3Tsy4","monthly-calendar__title-active":"_1Dyjm","weekly-norm__cell":"_sGK9m","weekly-norm__value":"_1Jsb-","monthly-calendar__cell":"_2hVZ4","monthly-calendar__cell--active":"_1uenJ","calendar-tooltip":"_2Uo1f","monthly-event__title":"_2gsg7","monthly-event__date":"_2GtPn","weekly-calendar__title":"_5WuQ8","weekly-calendar__cell":"_3lPkV","event--min-height":"_ZZSJH","weekly-event":"_hnHem","weekly-event__title":"_21a0T","weekly-event__date":"_PiKmX","weekly-event--collapse":"_1pvXT","btn-lms-default":"_1GA3p","ant-select-dropdown":"__OFBr","text-lms-primary":"_1gLzS","header-calendar_filter":"_1fd_Y","ant-picker-calendar-header":"_2IWLV","ant-picker-calendar-mode-switch":"_2jvy8","hover-item":"_3im6B","weekly-event__title_icon":"_3OUWM","monthly-event__date_tablet":"_2HhKK","calendar-filter":"_2n63y","see-more":"_1uakm","weekly-calendar-lms__cell":"__PqI3","truncate-text":"_184xQ"};
467
474
 
468
475
  var Button = function Button(_ref) {
@@ -573,14 +580,6 @@ var MonthlyEvent = function MonthlyEvent(_ref) {
573
580
  var formattedDate = customDateFormat(event.startDate, TIME_FORMAT) + ' - ' + customDateFormat(event.endDate, TIME_FORMAT);
574
581
  var formattedDateStart = customDateFormat(event.startDate, TIME_FORMAT);
575
582
  var iconList = getIconforEvent(event);
576
- var isDisplayIcon = function isDisplayIcon() {
577
- var iconList = getIconforEvent(event);
578
- if (event.source === 'LMS' && Array.isArray(iconList) && iconList.length > 0) {
579
- return true;
580
- } else {
581
- return !!iconList;
582
- }
583
- };
584
583
  return React.createElement(React.Fragment, null, React.createElement("li", {
585
584
  className: styles["event-" + (isSameMonth ? convertType[event.type] : 'default')],
586
585
  style: {
@@ -591,7 +590,7 @@ var MonthlyEvent = function MonthlyEvent(_ref) {
591
590
  }
592
591
  }, React.createElement("div", {
593
592
  className: styles['monthly-event__title']
594
- }, isDisplayIcon() && React.createElement("div", {
593
+ }, isDisplayIcon(event) && React.createElement("div", {
595
594
  className: styles['weekly-event__title_icon']
596
595
  }, iconList), React.createElement(CustomTooltip, {
597
596
  title: event.title
@@ -785,14 +784,6 @@ var WeeklyEvent = function WeeklyEvent(_ref) {
785
784
  var isMinHeight = height < MIN_HEIGHT_EVENT;
786
785
  var formattedDate = customDateFormat(event.startDate, TIME_FORMAT) + ' - ' + customDateFormat(event.endDate, TIME_FORMAT);
787
786
  var iconList = getIconforEvent(event);
788
- var isDisplayIcon = function isDisplayIcon() {
789
- var iconList = getIconforEvent(event);
790
- if (event.source === 'LMS' && Array.isArray(iconList) && iconList.length > 0) {
791
- return true;
792
- } else {
793
- return !!iconList;
794
- }
795
- };
796
787
  return React.createElement("div", {
797
788
  className: clsx$1(styles["event-" + convertType[event.type]], isMinHeight && styles['event--min-height']),
798
789
  onClick: function onClick() {
@@ -810,7 +801,7 @@ var WeeklyEvent = function WeeklyEvent(_ref) {
810
801
  className: clsx$1(height <= MIN_HEIGHT_HIDE_DETAILS && styles['weekly-event--collapse'])
811
802
  }, React.createElement("div", {
812
803
  className: styles['weekly-event__title']
813
- }, isDisplayIcon() && React.createElement("div", {
804
+ }, isDisplayIcon(event) && React.createElement("div", {
814
805
  className: styles['weekly-event__title_icon']
815
806
  }, iconList), React.createElement(CustomTooltip, {
816
807
  title: event.title
@@ -1005,14 +996,6 @@ var LMSWeeklyEvent = function LMSWeeklyEvent(_ref) {
1005
996
  width = _calculateBoxSize.width,
1006
997
  left = _calculateBoxSize.left;
1007
998
  var iconList = getIconforEvent(event);
1008
- var isDisplayIcon = function isDisplayIcon() {
1009
- var iconList = getIconforEvent(event);
1010
- if (event.source === 'LMS' && Array.isArray(iconList) && iconList.length > 0) {
1011
- return true;
1012
- } else {
1013
- return !!iconList;
1014
- }
1015
- };
1016
999
  return React.createElement("div", {
1017
1000
  className: styles["event-" + convertType[event.type]],
1018
1001
  onClick: function onClick() {
@@ -1032,7 +1015,7 @@ var LMSWeeklyEvent = function LMSWeeklyEvent(_ref) {
1032
1015
  className: clsx$1(styles['weekly-event--collapse'])
1033
1016
  }, React.createElement("div", {
1034
1017
  className: styles['weekly-event__title']
1035
- }, isDisplayIcon() && React.createElement("div", {
1018
+ }, isDisplayIcon(event) && React.createElement("div", {
1036
1019
  className: styles['weekly-event__title_icon']
1037
1020
  }, iconList), React.createElement(CustomTooltip, {
1038
1021
  title: event.title