makula-schedule 1.0.8 → 1.0.10

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.
@@ -19,7 +19,8 @@ function ResourceView(_ref) {
19
19
  contentScrollbarHeight = _ref.contentScrollbarHeight,
20
20
  slotClickedFunc = _ref.slotClickedFunc,
21
21
  slotItemTemplateResolver = _ref.slotItemTemplateResolver,
22
- toggleExpandFunc = _ref.toggleExpandFunc;
22
+ toggleExpandFunc = _ref.toggleExpandFunc,
23
+ CustomResourceCell = _ref.CustomResourceCell;
23
24
  var renderData = schedulerData.renderData;
24
25
  var width = schedulerData.getResourceTableWidth() - 2;
25
26
  var paddingBottom = contentScrollbarHeight;
@@ -86,6 +87,23 @@ function ResourceView(_ref) {
86
87
  height: item.rowHeight,
87
88
  backgroundColor: item.groupOnly ? schedulerData.config.groupOnlySlotColor : undefined
88
89
  };
90
+ if (CustomResourceCell) {
91
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
92
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
93
+ "data-resource-id": item.slotId,
94
+ style: tdStyle,
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomResourceCell, {
96
+ schedulerData: schedulerData,
97
+ item: item,
98
+ indents: indents,
99
+ slotClickedFunc: slotClickedFunc,
100
+ toggleExpandFunc: function toggleExpandFunc() {
101
+ return handleToggleExpand(item);
102
+ }
103
+ })
104
+ })
105
+ }, item.slotId);
106
+ }
89
107
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
90
108
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
91
109
  "data-resource-id": item.slotId,
@@ -120,6 +138,7 @@ ResourceView.propTypes = {
120
138
  contentScrollbarHeight: _propTypes["default"].number.isRequired,
121
139
  slotClickedFunc: _propTypes["default"].func,
122
140
  slotItemTemplateResolver: _propTypes["default"].func,
123
- toggleExpandFunc: _propTypes["default"].func
141
+ toggleExpandFunc: _propTypes["default"].func,
142
+ CustomResourceCell: _propTypes["default"].func
124
143
  };
125
144
  var _default = exports["default"] = ResourceView;
@@ -114,7 +114,9 @@ function Scheduler(props) {
114
114
  leftCustomHeader = props.leftCustomHeader,
115
115
  rightCustomHeader = props.rightCustomHeader,
116
116
  showWeekNumber = props.showWeekNumber,
117
- CustomResourceHeader = props.CustomResourceHeader;
117
+ CustomResourceHeader = props.CustomResourceHeader,
118
+ CustomResourceCell = props.CustomResourceCell,
119
+ configTableHeaderStyle = props.configTableHeaderStyle;
118
120
 
119
121
  // Initialize DnD context
120
122
  var initDndContext = function initDndContext() {
@@ -477,10 +479,10 @@ function Scheduler(props) {
477
479
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
478
480
  className: "resource-view",
479
481
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
480
- style: {
482
+ style: _objectSpread({
481
483
  borderBottom: '1px solid #e9e9e9',
482
484
  height: showWeekNumber ? config.tableHeaderHeight + 24 : config.tableHeaderHeight
483
- },
485
+ }, configTableHeaderStyle),
484
486
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
485
487
  style: {
486
488
  overflowX: 'scroll',
@@ -525,7 +527,8 @@ function Scheduler(props) {
525
527
  onBlur: onSchedulerResourceMouseOut,
526
528
  onScroll: onSchedulerResourceScroll,
527
529
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResourceView["default"], _objectSpread(_objectSpread({}, props), {}, {
528
- contentScrollbarHeight: resourcePaddingBottom
530
+ contentScrollbarHeight: resourcePaddingBottom,
531
+ CustomResourceCell: CustomResourceCell
529
532
  }))
530
533
  })]
531
534
  })
@@ -671,5 +674,7 @@ Scheduler.propTypes = {
671
674
  onScrollTop: _propTypes["default"].func,
672
675
  onScrollBottom: _propTypes["default"].func,
673
676
  showWeekNumber: _propTypes["default"].bool,
674
- CustomResourceHeader: _propTypes["default"].func
677
+ CustomResourceHeader: _propTypes["default"].func,
678
+ CustomResourceCell: _propTypes["default"].func,
679
+ configTableHeaderStyle: _propTypes["default"].object
675
680
  };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { ConfigType, Dayjs, OptionType } from 'dayjs';
2
2
  import React, { CSSProperties } from 'react';
3
3
 
4
- export class Scheduler<EventType extends EventItem = EventItem> extends React.Component<
5
- SchedulerProps<EventType>,
6
- any
7
- > {}
4
+ export const Scheduler: <EventType extends EventItem = EventItem>(
5
+ props: SchedulerProps<EventType>
6
+ ) => React.ReactElement;
8
7
 
9
8
  export const AddMorePopover: <EventType extends EventItem = EventItem>(
10
9
  props: AddMorePopoverProps<EventType>
@@ -119,10 +118,20 @@ export interface SchedulerProps<EventType extends EventItem = EventItem> {
119
118
  rightCustomHeader?: React.ReactNode;
120
119
  showWeekNumber?: boolean;
121
120
  CustomResourceHeader?: React.ComponentType;
121
+ CustomResourceCell?: React.ComponentType<CustomResourceCellProps>;
122
+ configTableHeaderStyle?: CSSProperties;
122
123
  dndSources?: DnDSource[];
123
124
  parentRef?: React.RefObject<any>;
124
125
  }
125
126
 
127
+ export interface CustomResourceCellProps<EventType extends EventItem = EventItem> {
128
+ schedulerData: SchedulerData<EventType>;
129
+ item: ResourceEvent<EventType>;
130
+ indents: React.ReactNode[];
131
+ slotClickedFunc?: (schedulerData: SchedulerData<EventType>, slot: ResourceEvent<EventType>) => void;
132
+ toggleExpandFunc: () => void;
133
+ }
134
+
126
135
  export interface AddMorePopoverProps<EventType extends EventItem = EventItem> {
127
136
  schedulerData: SchedulerData<EventType>;
128
137
  headerItem: HeaderItem<EventType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makula-schedule",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
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",
@@ -62,7 +62,7 @@
62
62
  "prettier": "prettier --check \"src/**/*.{js,jsx,json,css}\"",
63
63
  "prettier:fix": "prettier --write \"src/**/*.{js,jsx,json,css}\"",
64
64
  "format": "npm run prettier:fix && npm run lint:fix",
65
- "publish": "npm run build && npm run build:lib && npm publish"
65
+ "publish-package": "npm run build && npm run build:lib && npm publish"
66
66
  },
67
67
  "dependencies": {
68
68
  "@ant-design/icons": "^4.8.0",