react-big-schedule 4.4.2 → 4.4.3

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.
@@ -1,13 +1,8 @@
1
- "use strict";
1
+ import { ViewType, CellUnit } from '../config/default';
2
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
3
  // getSummary func example
9
4
  // export const getSummary = (schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd) => ({ text: 'Summary', color: 'red', fontSize: '1.2rem' });
10
- var getSummary = exports.getSummary = function getSummary() {
5
+ export var getSummary = function getSummary() {
11
6
  return {
12
7
  text: 'Summary',
13
8
  color: 'red',
@@ -16,27 +11,27 @@ var getSummary = exports.getSummary = function getSummary() {
16
11
  };
17
12
 
18
13
  // getCustomDate example
19
- var getCustomDate = exports.getCustomDate = function getCustomDate(schedulerData, num) {
14
+ export var getCustomDate = function getCustomDate(schedulerData, num) {
20
15
  var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : schedulerData.startDate;
21
16
  var viewType = schedulerData.viewType,
22
17
  localeDayjs = schedulerData.localeDayjs;
23
18
  var startDate;
24
19
  var endDate;
25
20
  var cellUnit;
26
- if (viewType === _default2.ViewType.Custom1) {
21
+ if (viewType === ViewType.Custom1) {
27
22
  var monday = localeDayjs(new Date(date)).startOf('week');
28
23
  startDate = num === 0 ? monday : localeDayjs(new Date(monday)).add(2 * num, 'weeks');
29
24
  endDate = localeDayjs(new Date(startDate)).add(1, 'weeks').endOf('week');
30
- cellUnit = _default2.CellUnit.Day;
31
- } else if (viewType === _default2.ViewType.Custom2) {
25
+ cellUnit = CellUnit.Day;
26
+ } else if (viewType === ViewType.Custom2) {
32
27
  var firstDayOfMonth = localeDayjs(new Date(date)).startOf('month');
33
28
  startDate = num === 0 ? firstDayOfMonth : localeDayjs(new Date(firstDayOfMonth)).add(2 * num, 'months');
34
29
  endDate = localeDayjs(new Date(startDate)).add(1, 'months').endOf('month');
35
- cellUnit = _default2.CellUnit.Day;
30
+ cellUnit = CellUnit.Day;
36
31
  } else {
37
32
  startDate = num === 0 ? date : localeDayjs(new Date(date)).add(2 * num, 'days');
38
33
  endDate = localeDayjs(new Date(startDate)).add(1, 'days');
39
- cellUnit = _default2.CellUnit.Hour;
34
+ cellUnit = CellUnit.Hour;
40
35
  }
41
36
  return {
42
37
  startDate: startDate,
@@ -46,52 +41,52 @@ var getCustomDate = exports.getCustomDate = function getCustomDate(schedulerData
46
41
  };
47
42
 
48
43
  // getNonAgendaViewBodyCellBgColor example
49
- var getNonAgendaViewBodyCellBgColor = exports.getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
44
+ export var getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
50
45
  return header.nonWorkingTime ? undefined : '#87e8de';
51
46
  };
52
47
 
53
48
  // getDateLabel func example
54
- var getDateLabel = exports.getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
49
+ export var getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
55
50
  var localeDayjs = schedulerData.localeDayjs;
56
51
  var start = localeDayjs(new Date(startDate));
57
52
  var end = localeDayjs(endDate);
58
53
  var dateLabel = '';
59
- if (viewType === _default2.ViewType.Week || start !== end && (viewType === _default2.ViewType.Custom || viewType === _default2.ViewType.Custom1 || viewType === _default2.ViewType.Custom2)) {
54
+ if (viewType === ViewType.Week || start !== end && (viewType === ViewType.Custom || viewType === ViewType.Custom1 || viewType === ViewType.Custom2)) {
60
55
  dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('D, YYYY'));
61
56
  if (start.month() !== end.month()) dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
62
57
  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) {
58
+ } else if (viewType === ViewType.Month) {
64
59
  dateLabel = start.format('MMMM YYYY');
65
- } else if (viewType === _default2.ViewType.Quarter) {
60
+ } else if (viewType === ViewType.Quarter) {
66
61
  dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
67
- } else if (viewType === _default2.ViewType.Year) {
62
+ } else if (viewType === ViewType.Year) {
68
63
  dateLabel = start.format('YYYY');
69
64
  } else {
70
65
  dateLabel = start.format('MMM D, YYYY');
71
66
  }
72
67
  return dateLabel;
73
68
  };
74
- var getEventText = exports.getEventText = function getEventText(schedulerData, event) {
69
+ export var getEventText = function getEventText(schedulerData, event) {
75
70
  var _schedulerData$resour;
76
71
  return schedulerData.isEventPerspective ? ((_schedulerData$resour = schedulerData.resources.find(function (item) {
77
72
  return item.id === event.resourceId;
78
73
  })) === null || _schedulerData$resour === void 0 ? void 0 : _schedulerData$resour.name) || event.title : event.title;
79
74
  };
80
- var getScrollSpecialDayjs = exports.getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
75
+ export var getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
81
76
  var localeDayjs = schedulerData.localeDayjs;
82
77
  return localeDayjs(new Date());
83
78
  };
84
- var isNonWorkingTime = exports.isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
79
+ export var isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
85
80
  var localeDayjs = schedulerData.localeDayjs,
86
81
  cellUnit = schedulerData.cellUnit;
87
- if (cellUnit === _default2.CellUnit.Hour) {
82
+ if (cellUnit === CellUnit.Hour) {
88
83
  var hour = localeDayjs(new Date(time)).hour();
89
84
  return hour < 9 || hour > 18;
90
85
  }
91
86
  var dayOfWeek = localeDayjs(new Date(time)).weekday();
92
87
  return dayOfWeek === 0 || dayOfWeek === 6;
93
88
  };
94
- var _default = exports["default"] = {
89
+ export default {
95
90
  getSummaryFunc: undefined,
96
91
  getCustomDateFunc: undefined,
97
92
  getNonAgendaViewBodyCellBgColorFunc: undefined,
@@ -1,10 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- exports.getPos = getPos;
8
1
  function getPos(element) {
9
2
  var x = 0;
10
3
  var y = 0;
@@ -19,4 +12,5 @@ function getPos(element) {
19
12
  y: y
20
13
  };
21
14
  }
22
- var _default = exports["default"] = getPos;
15
+ export { getPos };
16
+ export default getPos;
package/dist/index.js CHANGED
@@ -1,78 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AddMorePopover", {
7
- enumerable: true,
8
- get: function get() {
9
- return _index.AddMorePopover;
10
- }
11
- });
12
- Object.defineProperty(exports, "CellUnit", {
13
- enumerable: true,
14
- get: function get() {
15
- return _index.CellUnit;
16
- }
17
- });
18
- Object.defineProperty(exports, "DATETIME_FORMAT", {
19
- enumerable: true,
20
- get: function get() {
21
- return _index.DATETIME_FORMAT;
22
- }
23
- });
24
- Object.defineProperty(exports, "DATE_FORMAT", {
25
- enumerable: true,
26
- get: function get() {
27
- return _index.DATE_FORMAT;
28
- }
29
- });
30
- Object.defineProperty(exports, "DemoData", {
31
- enumerable: true,
32
- get: function get() {
33
- return _index.DemoData;
34
- }
35
- });
36
- Object.defineProperty(exports, "DnDContext", {
37
- enumerable: true,
38
- get: function get() {
39
- return _index.DnDContext;
40
- }
41
- });
42
- Object.defineProperty(exports, "DnDSource", {
43
- enumerable: true,
44
- get: function get() {
45
- return _index.DnDSource;
46
- }
47
- });
48
- Object.defineProperty(exports, "Scheduler", {
49
- enumerable: true,
50
- get: function get() {
51
- return _index.Scheduler;
52
- }
53
- });
54
- Object.defineProperty(exports, "SchedulerData", {
55
- enumerable: true,
56
- get: function get() {
57
- return _index.SchedulerData;
58
- }
59
- });
60
- Object.defineProperty(exports, "SummaryPos", {
61
- enumerable: true,
62
- get: function get() {
63
- return _index.SummaryPos;
64
- }
65
- });
66
- Object.defineProperty(exports, "ViewType", {
67
- enumerable: true,
68
- get: function get() {
69
- return _index.ViewType;
70
- }
71
- });
72
- Object.defineProperty(exports, "wrapperFun", {
73
- enumerable: true,
74
- get: function get() {
75
- return _index.wrapperFun;
76
- }
77
- });
78
- var _index = require("./components/index");
1
+ export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DnDContext, DnDSource, DemoData, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun } from './components/index';
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
1
  var DemoData = {
8
2
  resources: [{
9
3
  id: 'r0',
@@ -334,4 +328,4 @@ var DemoData = {
334
328
  type: 3
335
329
  }]
336
330
  };
337
- var _default = exports["default"] = DemoData;
331
+ export default DemoData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-big-schedule",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler",
5
5
  "keywords": [
6
6
  "react-big-schedule",
@@ -55,7 +55,7 @@
55
55
  "scripts": {
56
56
  "start": "vite",
57
57
  "build": "vite build",
58
- "build-lib": "node scripts/build.cjs",
58
+ "build-lib": "node scripts/build.js",
59
59
  "clean": "rimraf ./dist && mkdir dist",
60
60
  "lint": "eslint ./src"
61
61
  },