react-big-schedule 4.4.3 → 4.4.4-beta.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.
@@ -9,8 +9,8 @@ import React, { useState } from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import { Col, Row } from 'antd';
11
11
  import { CloseOutlined } from '@ant-design/icons';
12
- import EventItem from './EventItem';
13
- import DnDSource from './DnDSource';
12
+ import EventItem from './EventItem.jsx';
13
+ import DnDSource from './DnDSource.js';
14
14
  function AddMorePopover(props) {
15
15
  var schedulerData = props.schedulerData,
16
16
  headerItem = props.headerItem,
@@ -2,7 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { Popover } from 'antd';
5
- import EventItemPopover from './EventItemPopover';
5
+ import EventItemPopover from './EventItemPopover.jsx';
6
6
  function AgendaEventItem(props) {
7
7
  var eventItem = props.eventItem,
8
8
  isStart = props.isStart,
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import AgendaEventItem from './AgendaEventItem';
4
+ import AgendaEventItem from './AgendaEventItem.jsx';
5
5
  function AgendaResourceEvents(props) {
6
6
  var schedulerData = props.schedulerData,
7
7
  resourceEvents = props.resourceEvents,
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import AgendaResourceEvents from './AgendaResourceEvents';
4
+ import AgendaResourceEvents from './AgendaResourceEvents.jsx';
5
5
  function AgendaView(props) {
6
6
  var schedulerData = props.schedulerData;
7
7
  var config = schedulerData.config,
@@ -16,12 +16,13 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
16
16
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
18
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
- /* eslint-disable no-return-assign */
19
+ /* eslint-disable */
20
+
20
21
  import React, { Component } from 'react';
21
22
  import { PropTypes } from 'prop-types';
22
23
  import { Popover } from 'antd';
23
- import EventItemPopover from './EventItemPopover';
24
- import { DnDTypes, CellUnit, DATETIME_FORMAT } from '../config/default';
24
+ import { DnDTypes, CellUnit, DATETIME_FORMAT } from '../config/default.js';
25
+ import EventItemPopover from './EventItemPopover.jsx';
25
26
  var stopDragHelper = function stopDragHelper(_ref) {
26
27
  var count = _ref.count,
27
28
  cellUnit = _ref.cellUnit,
@@ -39,7 +40,7 @@ var stopDragHelper = function stopDragHelper(_ref) {
39
40
  while (whileTrue) {
40
41
  i = count > 0 ? i + 1 : i - 1;
41
42
  var date = localeDayjs(new Date(eventItem[dragType])).add(i, 'days');
42
- var dayOfWeek = date.weekday();
43
+ var dayOfWeek = date.day();
43
44
  if (dayOfWeek !== 0 && dayOfWeek !== 6) {
44
45
  tCount = count > 0 ? tCount + 1 : tCount - 1;
45
46
  if (tCount === count) {
@@ -21,11 +21,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
21
21
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
22
  import React, { Component } from 'react';
23
23
  import { PropTypes } from 'prop-types';
24
- import AddMore from './AddMore';
25
- import Summary from './Summary';
26
- import SelectedArea from './SelectedArea';
27
24
  import { CellUnit, DATETIME_FORMAT, SummaryPos, DnDTypes } from '../config/default';
28
- import { getPos } from '../helper/utility';
25
+ import { getPos } from '../helper/utility.js';
26
+ import AddMore from './AddMore.jsx';
27
+ import Summary from './Summary.jsx';
28
+ import SelectedArea from './SelectedArea.jsx';
29
29
  var ResourceEvents = /*#__PURE__*/function (_Component) {
30
30
  function ResourceEvents(props) {
31
31
  var _this;
@@ -736,7 +736,7 @@ var SchedulerData = /*#__PURE__*/function () {
736
736
  } else if (this.cellUnit === CellUnit.Day) {
737
737
  while (header >= start && header <= end) {
738
738
  var _time = header.format(DATETIME_FORMAT);
739
- var dayOfWeek = header.weekday();
739
+ var dayOfWeek = header.day();
740
740
  if (this.config.displayWeekend || dayOfWeek !== 0 && dayOfWeek !== 6) {
741
741
  var _nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, _time);
742
742
  headers.push({
@@ -21,9 +21,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
21
21
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
22
22
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
23
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
- import React, { Component } from 'react';
25
- import PropTypes from 'prop-types';
26
-
27
24
  // Col, Row and Icon do not have their own less files for styling. They use
28
25
  // rules declared in antd's global css. If these styles are imported directly
29
26
  // from within antd, they'll include, for instance, reset rules. These will
@@ -41,27 +38,28 @@ import PropTypes from 'prop-types';
41
38
  // The next components have their own specific stylesheets which we import
42
39
  // separately here to avoid importing from files which have required the global
43
40
  // antd styles.
44
-
45
- import EventItem from './EventItem';
46
- import DnDSource from './DnDSource';
47
- import DnDContext from './DnDContext';
48
- import ResourceView from './ResourceView';
49
- import HeaderView from './HeaderView';
50
- import BodyView from './BodyView';
51
- import ResourceEvents from './ResourceEvents';
52
- import AgendaView from './AgendaView';
53
- import AddMorePopover from './AddMorePopover';
54
- import SchedulerData from './SchedulerData';
55
- import DemoData from '../sample-data/sample1';
56
- import SchedulerHeader from './SchedulerHeader';
57
- import { ViewType, CellUnit, DATETIME_FORMAT, DATE_FORMAT, SummaryPos } from '../config/default';
58
- import wrapperFun from './WrapperFun';
41
+ import React, { Component } from 'react';
42
+ import PropTypes from 'prop-types';
43
+ import DemoData from '../sample-data/sample1.js';
44
+ import { ViewType, CellUnit, DATETIME_FORMAT, DATE_FORMAT, SummaryPos } from '../config/default.js';
45
+ import EventItem from './EventItem.jsx';
46
+ import DnDSource from './DnDSource.js';
47
+ import DnDContext from './DnDContext.js';
48
+ import ResourceView from './ResourceView.jsx';
49
+ import HeaderView from './HeaderView.jsx';
50
+ import BodyView from './BodyView.jsx';
51
+ import ResourceEvents from './ResourceEvents.jsx';
52
+ import AgendaView from './AgendaView.jsx';
53
+ import AddMorePopover from './AddMorePopover.jsx';
54
+ import SchedulerData from './SchedulerData.js';
55
+ import SchedulerHeader from './SchedulerHeader.jsx';
56
+ import wrapperFun from './WrapperFun.jsx';
59
57
  var Scheduler = /*#__PURE__*/function (_Component) {
60
58
  function Scheduler(props) {
61
59
  var _this;
62
60
  _classCallCheck(this, Scheduler);
63
61
  _this = _callSuper(this, Scheduler, [props]);
64
- _defineProperty(_this, "onWindowResize", function (e) {
62
+ _defineProperty(_this, "onWindowResize", function (_e) {
65
63
  var schedulerData = _this.props.schedulerData;
66
64
  schedulerData._setDocumentWidth(document.documentElement.clientWidth);
67
65
  _this.setState({
@@ -70,7 +68,6 @@ var Scheduler = /*#__PURE__*/function (_Component) {
70
68
  });
71
69
  });
72
70
  _defineProperty(_this, "resolveScrollbarSize", function () {
73
- var schedulerData = _this.props.schedulerData;
74
71
  var contentScrollbarHeight = 17;
75
72
  var contentScrollbarWidth = 17;
76
73
  var resourceScrollbarHeight = 17;
@@ -120,7 +117,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
120
117
  _defineProperty(_this, "onSchedulerHeadMouseOut", function () {
121
118
  _this.currentArea = -1;
122
119
  });
123
- _defineProperty(_this, "onSchedulerHeadScroll", function (proxy, event) {
120
+ _defineProperty(_this, "onSchedulerHeadScroll", function (_proxy, _event) {
124
121
  if ((_this.currentArea === 2 || _this.currentArea === -1) && _this.schedulerContent.scrollLeft !== _this.schedulerHead.scrollLeft) {
125
122
  _this.schedulerContent.scrollLeft = _this.schedulerHead.scrollLeft;
126
123
  }
@@ -134,7 +131,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
134
131
  _defineProperty(_this, "onSchedulerResourceMouseOut", function () {
135
132
  _this.currentArea = -1;
136
133
  });
137
- _defineProperty(_this, "onSchedulerResourceScroll", function (proxy, event) {
134
+ _defineProperty(_this, "onSchedulerResourceScroll", function (_proxy, _event) {
138
135
  if (_this.schedulerResource) {
139
136
  if ((_this.currentArea === 1 || _this.currentArea === -1) && _this.schedulerContent.scrollTop !== _this.schedulerResource.scrollTop) {
140
137
  _this.schedulerContent.scrollTop = _this.schedulerResource.scrollTop;
@@ -153,7 +150,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
153
150
  _defineProperty(_this, "onSchedulerContentMouseOut", function () {
154
151
  _this.currentArea = -1;
155
152
  });
156
- _defineProperty(_this, "onSchedulerContentScroll", function (proxy, event) {
153
+ _defineProperty(_this, "onSchedulerContentScroll", function (_proxy, _event) {
157
154
  if (_this.schedulerResource) {
158
155
  if (_this.currentArea === 0 || _this.currentArea === -1) {
159
156
  if (_this.schedulerHead.scrollLeft !== _this.schedulerContent.scrollLeft) _this.schedulerHead.scrollLeft = _this.schedulerContent.scrollLeft;
@@ -250,7 +247,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
250
247
  _inherits(Scheduler, _Component);
251
248
  return _createClass(Scheduler, [{
252
249
  key: "componentDidMount",
253
- value: function componentDidMount(props, state) {
250
+ value: function componentDidMount(_props, _state) {
254
251
  var _this2 = this;
255
252
  var _this$props6 = this.props,
256
253
  schedulerData = _this$props6.schedulerData,
@@ -259,7 +256,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
259
256
  if (parentRef !== undefined) {
260
257
  if (schedulerData.config.responsiveByParent && !!parentRef.current) {
261
258
  schedulerData._setDocumentWidth(parentRef.current.offsetWidth);
262
- this.ulObserver = new ResizeObserver(function (entries, observer) {
259
+ this.ulObserver = new ResizeObserver(function (_entries, _observer) {
263
260
  if (parentRef.current) {
264
261
  var width = parentRef.current.offsetWidth;
265
262
  var height = parentRef.current.offsetHeight;
@@ -276,7 +273,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
276
273
  }
277
274
  }, {
278
275
  key: "componentDidUpdate",
279
- value: function componentDidUpdate(props, state) {
276
+ value: function componentDidUpdate(_props, _state) {
280
277
  this.resolveScrollbarSize();
281
278
  var schedulerData = this.props.schedulerData;
282
279
  var localeDayjs = schedulerData.localeDayjs,
@@ -393,7 +390,9 @@ var Scheduler = /*#__PURE__*/function (_Component) {
393
390
  style: resourceContentStyle,
394
391
  ref: this.schedulerResourceRef,
395
392
  onMouseOver: this.onSchedulerResourceMouseOver,
393
+ onFocus: this.onSchedulerResourceMouseOver,
396
394
  onMouseOut: this.onSchedulerResourceMouseOut,
395
+ onBlur: this.onSchedulerResourceMouseOut,
397
396
  onScroll: this.onSchedulerResourceScroll
398
397
  }, /*#__PURE__*/React.createElement(ResourceView, _extends({}, this.props, {
399
398
  contentScrollbarHeight: resourcePaddingBottom
@@ -417,7 +416,9 @@ var Scheduler = /*#__PURE__*/function (_Component) {
417
416
  },
418
417
  ref: this.schedulerHeadRef,
419
418
  onMouseOver: this.onSchedulerHeadMouseOver,
419
+ onFocus: this.onSchedulerHeadMouseOver,
420
420
  onMouseOut: this.onSchedulerHeadMouseOut,
421
+ onBlur: this.onSchedulerHeadMouseOut,
421
422
  onScroll: this.onSchedulerHeadScroll
422
423
  }, /*#__PURE__*/React.createElement("div", {
423
424
  style: {
@@ -430,7 +431,9 @@ var Scheduler = /*#__PURE__*/function (_Component) {
430
431
  style: schedulerContentStyle,
431
432
  ref: this.schedulerContentRef,
432
433
  onMouseOver: this.onSchedulerContentMouseOver,
434
+ onFocus: this.onSchedulerContentMouseOver,
433
435
  onMouseOut: this.onSchedulerContentMouseOut,
436
+ onBlur: this.onSchedulerContentMouseOut,
434
437
  onScroll: this.onSchedulerContentScroll
435
438
  }, /*#__PURE__*/React.createElement("div", {
436
439
  style: {
@@ -83,7 +83,7 @@ export var isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
83
83
  var hour = localeDayjs(new Date(time)).hour();
84
84
  return hour < 9 || hour > 18;
85
85
  }
86
- var dayOfWeek = localeDayjs(new Date(time)).weekday();
86
+ var dayOfWeek = localeDayjs(new Date(time)).day();
87
87
  return dayOfWeek === 0 || dayOfWeek === 6;
88
88
  };
89
89
  export default {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DnDContext, DnDSource, DemoData, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun } from './components/index';
1
+ export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DnDContext, DnDSource, DemoData, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun } from './components/index.jsx';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-big-schedule",
3
- "version": "4.4.3",
3
+ "version": "4.4.4-beta.2",
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",
@@ -39,7 +39,6 @@
39
39
  "README.md",
40
40
  "License"
41
41
  ],
42
- "type": "module",
43
42
  "main": "dist/index.js",
44
43
  "homepage": "https://react-big-schedule.vercel.app",
45
44
  "repository": {
@@ -53,17 +52,18 @@
53
52
  "registry": "https://registry.npmjs.org/"
54
53
  },
55
54
  "scripts": {
56
- "start": "vite",
57
- "build": "vite build",
58
- "build-lib": "node scripts/build.js",
59
- "clean": "rimraf ./dist && mkdir dist",
60
- "lint": "eslint ./src"
55
+ "dev": "webpack serve --open",
56
+ "build": "webpack --mode production",
57
+ "build:lib": "node scripts/build.js",
58
+ "clean": "npx rimraf dist",
59
+ "lint": "eslint ./src",
60
+ "lint:fix": "eslint ./src/**/*.{js,jsx} --fix"
61
61
  },
62
62
  "dependencies": {
63
63
  "@ant-design/icons": "^5.5.1",
64
- "@babel/cli": "^7.25.7",
65
64
  "antd": "^5.21.3",
66
65
  "dayjs": "^1.11.13",
66
+ "fs-extra": "^11.2.0",
67
67
  "prop-types": "^15.8.1",
68
68
  "react": "^18.3.1",
69
69
  "react-dnd": "^14.0.5",
@@ -73,22 +73,23 @@
73
73
  "rrule": "^2.8.1"
74
74
  },
75
75
  "devDependencies": {
76
- "@babel/core": "^7.25.8",
77
- "@babel/preset-env": "^7.25.8",
78
- "@babel/preset-react": "^7.25.7",
79
- "@eslint/js": "^9.11.1",
80
- "@types/react": "^18.3.10",
81
- "@types/react-dom": "^18.3.0",
82
- "@vitejs/plugin-react": "^4.3.2",
83
- "babel-plugin-transform-runtime": "^6.23.0",
84
- "eslint": "^8.2.0",
85
- "eslint-config-airbnb": "^19.0.4",
76
+ "@babel/cli": "^7.25.9",
77
+ "@babel/core": "^7.26.0",
78
+ "@babel/preset-env": "^7.26.0",
79
+ "@babel/preset-react": "^7.25.9",
80
+ "babel-loader": "^9.2.1",
81
+ "css-loader": "^7.1.2",
82
+ "eslint": "^8.57.1",
86
83
  "eslint-plugin-import": "^2.31.0",
87
- "eslint-plugin-jsx-a11y": "^6.10.0",
88
- "eslint-plugin-react": "^7.37.1",
89
- "eslint-plugin-react-hooks": "^4.6.2",
90
- "fs-extra": "^11.2.0",
91
- "globals": "^15.9.0",
92
- "vite": "^5.4.8"
84
+ "eslint-plugin-jsx-a11y": "^6.10.2",
85
+ "eslint-plugin-react": "^7.37.2",
86
+ "eslint-plugin-react-hooks": "^5.0.0",
87
+ "eslint-webpack-plugin": "^4.2.0",
88
+ "html-webpack-plugin": "^5.6.3",
89
+ "style-loader": "^4.0.0",
90
+ "url-loader": "^4.1.1",
91
+ "webpack": "^5.96.1",
92
+ "webpack-cli": "^5.1.4",
93
+ "webpack-dev-server": "^5.1.0"
93
94
  }
94
95
  }