react-big-schedule 4.2.4 → 4.2.5
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/dist/components/HeaderView.js +105 -78
- package/package.json +1 -1
|
@@ -4,102 +4,129 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _index = require("./index");
|
|
10
|
-
function
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
|
+
var HeaderView = /*#__PURE__*/function (_Component) {
|
|
27
|
+
_inherits(HeaderView, _Component);
|
|
28
|
+
var _super = _createSuper(HeaderView);
|
|
29
|
+
function HeaderView(props) {
|
|
30
|
+
_classCallCheck(this, HeaderView);
|
|
31
|
+
return _super.call(this, props);
|
|
32
|
+
}
|
|
33
|
+
_createClass(HeaderView, [{
|
|
34
|
+
key: "render",
|
|
35
|
+
value: function render() {
|
|
36
|
+
var _this$props = this.props,
|
|
37
|
+
schedulerData = _this$props.schedulerData,
|
|
38
|
+
nonAgendaCellHeaderTemplateResolver = _this$props.nonAgendaCellHeaderTemplateResolver;
|
|
39
|
+
var headers = schedulerData.headers,
|
|
40
|
+
cellUnit = schedulerData.cellUnit,
|
|
41
|
+
config = schedulerData.config,
|
|
42
|
+
localeDayjs = schedulerData.localeDayjs;
|
|
43
|
+
var headerHeight = schedulerData.getTableHeaderHeight();
|
|
44
|
+
var cellWidth = schedulerData.getContentCellWidth();
|
|
45
|
+
var minuteStepsInHour = schedulerData.getMinuteStepsInHour();
|
|
46
|
+
var headerList = [];
|
|
47
|
+
var style = {};
|
|
48
|
+
if (cellUnit === _index.CellUnit.Hour) {
|
|
49
|
+
headers.forEach(function (item, index) {
|
|
50
|
+
if (index % minuteStepsInHour === 0) {
|
|
51
|
+
var datetime = localeDayjs(new Date(item.time));
|
|
52
|
+
var isCurrentTime = datetime.isSame(new Date(), 'hour');
|
|
53
|
+
style = !!item.nonWorkingTime ? {
|
|
54
|
+
width: cellWidth * minuteStepsInHour,
|
|
55
|
+
color: config.nonWorkingTimeHeadColor,
|
|
56
|
+
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
57
|
+
} : {
|
|
58
|
+
width: cellWidth * minuteStepsInHour
|
|
59
|
+
};
|
|
60
|
+
if (index === headers.length - minuteStepsInHour) style = !!item.nonWorkingTime ? {
|
|
61
|
+
color: config.nonWorkingTimeHeadColor,
|
|
62
|
+
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
63
|
+
} : {};
|
|
64
|
+
var pFormattedList = config.nonAgendaDayCellHeaderFormat.split('|').map(function (item) {
|
|
65
|
+
return datetime.format(item);
|
|
66
|
+
});
|
|
67
|
+
var element;
|
|
68
|
+
if (typeof nonAgendaCellHeaderTemplateResolver === 'function') {
|
|
69
|
+
element = nonAgendaCellHeaderTemplateResolver(schedulerData, item, pFormattedList, style);
|
|
70
|
+
} else {
|
|
71
|
+
var pList = pFormattedList.map(function (item, index) {
|
|
72
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
|
+
key: index
|
|
74
|
+
}, item);
|
|
75
|
+
});
|
|
76
|
+
element = /*#__PURE__*/_react["default"].createElement("th", {
|
|
77
|
+
key: item.time,
|
|
78
|
+
className: "header3-text",
|
|
79
|
+
style: style
|
|
80
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, pList));
|
|
81
|
+
}
|
|
82
|
+
headerList.push(element);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
headerList = headers.map(function (item, index) {
|
|
87
|
+
var datetime = localeDayjs(new Date(item.time));
|
|
35
88
|
style = !!item.nonWorkingTime ? {
|
|
89
|
+
width: cellWidth,
|
|
90
|
+
color: config.nonWorkingTimeHeadColor,
|
|
91
|
+
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
92
|
+
} : {
|
|
93
|
+
width: cellWidth
|
|
94
|
+
};
|
|
95
|
+
if (index === headers.length - 1) style = !!item.nonWorkingTime ? {
|
|
36
96
|
color: config.nonWorkingTimeHeadColor,
|
|
37
97
|
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
38
98
|
} : {};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} else {
|
|
99
|
+
var cellFormat = cellUnit === _index.CellUnit.Week ? config.nonAgendaWeekCellHeaderFormat : cellUnit === _index.CellUnit.Month ? config.nonAgendaMonthCellHeaderFormat : cellUnit === _index.CellUnit.Year ? config.nonAgendaYearCellHeaderFormat : config.nonAgendaOtherCellHeaderFormat;
|
|
100
|
+
var pFormattedList = cellFormat.split('|').map(function (item) {
|
|
101
|
+
return datetime.format(item);
|
|
102
|
+
});
|
|
103
|
+
if (typeof nonAgendaCellHeaderTemplateResolver === 'function') {
|
|
104
|
+
return nonAgendaCellHeaderTemplateResolver(schedulerData, item, pFormattedList, style);
|
|
105
|
+
}
|
|
47
106
|
var pList = pFormattedList.map(function (item, index) {
|
|
48
107
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
108
|
key: index
|
|
50
109
|
}, item);
|
|
51
110
|
});
|
|
52
|
-
|
|
111
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
53
112
|
key: item.time,
|
|
54
113
|
className: "header3-text",
|
|
55
114
|
style: style
|
|
56
115
|
}, /*#__PURE__*/_react["default"].createElement("div", null, pList));
|
|
57
|
-
}
|
|
58
|
-
headerList.push(element);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
headerList = headers.map(function (item, index) {
|
|
63
|
-
var datetime = localeDayjs(new Date(item.time));
|
|
64
|
-
style = !!item.nonWorkingTime ? {
|
|
65
|
-
width: cellWidth,
|
|
66
|
-
color: config.nonWorkingTimeHeadColor,
|
|
67
|
-
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
68
|
-
} : {
|
|
69
|
-
width: cellWidth
|
|
70
|
-
};
|
|
71
|
-
if (index === headers.length - 1) style = !!item.nonWorkingTime ? {
|
|
72
|
-
color: config.nonWorkingTimeHeadColor,
|
|
73
|
-
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
74
|
-
} : {};
|
|
75
|
-
var cellFormat = cellUnit === _index.CellUnit.Week ? config.nonAgendaWeekCellHeaderFormat : cellUnit === _index.CellUnit.Month ? config.nonAgendaMonthCellHeaderFormat : cellUnit === _index.CellUnit.Year ? config.nonAgendaYearCellHeaderFormat : config.nonAgendaOtherCellHeaderFormat;
|
|
76
|
-
var pFormattedList = cellFormat.split('|').map(function (dateFormatPart) {
|
|
77
|
-
return datetime.format(dateFormatPart);
|
|
78
|
-
});
|
|
79
|
-
if (typeof nonAgendaCellHeaderTemplateResolver === 'function') {
|
|
80
|
-
return nonAgendaCellHeaderTemplateResolver(schedulerData, item, pFormattedList, style);
|
|
116
|
+
});
|
|
81
117
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
88
|
-
key: item.time,
|
|
89
|
-
className: "header3-text",
|
|
90
|
-
style: style
|
|
91
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, pList));
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
95
|
-
style: {
|
|
96
|
-
height: headerHeight
|
|
118
|
+
return /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
119
|
+
style: {
|
|
120
|
+
height: headerHeight
|
|
121
|
+
}
|
|
122
|
+
}, headerList));
|
|
97
123
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
124
|
+
}]);
|
|
125
|
+
return HeaderView;
|
|
126
|
+
}(_react.Component);
|
|
127
|
+
_defineProperty(HeaderView, "propTypes", {
|
|
101
128
|
schedulerData: _propTypes.PropTypes.object.isRequired,
|
|
102
129
|
nonAgendaCellHeaderTemplateResolver: _propTypes.PropTypes.func
|
|
103
|
-
};
|
|
130
|
+
});
|
|
104
131
|
var _default = HeaderView;
|
|
105
132
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-big-schedule",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5",
|
|
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",
|