makula-schedule 1.0.7 → 1.0.9

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,8 @@ 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;
118
119
 
119
120
  // Initialize DnD context
120
121
  var initDndContext = function initDndContext() {
@@ -525,7 +526,8 @@ function Scheduler(props) {
525
526
  onBlur: onSchedulerResourceMouseOut,
526
527
  onScroll: onSchedulerResourceScroll,
527
528
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResourceView["default"], _objectSpread(_objectSpread({}, props), {}, {
528
- contentScrollbarHeight: resourcePaddingBottom
529
+ contentScrollbarHeight: resourcePaddingBottom,
530
+ CustomResourceCell: CustomResourceCell
529
531
  }))
530
532
  })]
531
533
  })
@@ -671,5 +673,6 @@ Scheduler.propTypes = {
671
673
  onScrollTop: _propTypes["default"].func,
672
674
  onScrollBottom: _propTypes["default"].func,
673
675
  showWeekNumber: _propTypes["default"].bool,
674
- CustomResourceHeader: _propTypes["default"].func
676
+ CustomResourceHeader: _propTypes["default"].func,
677
+ CustomResourceCell: _propTypes["default"].func
675
678
  };
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,19 @@ 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
122
  dndSources?: DnDSource[];
123
123
  parentRef?: React.RefObject<any>;
124
124
  }
125
125
 
126
+ export interface CustomResourceCellProps<EventType extends EventItem = EventItem> {
127
+ schedulerData: SchedulerData<EventType>;
128
+ item: ResourceEvent<EventType>;
129
+ indents: React.ReactNode[];
130
+ slotClickedFunc?: (schedulerData: SchedulerData<EventType>, slot: ResourceEvent<EventType>) => void;
131
+ toggleExpandFunc: () => void;
132
+ }
133
+
126
134
  export interface AddMorePopoverProps<EventType extends EventItem = EventItem> {
127
135
  schedulerData: SchedulerData<EventType>;
128
136
  headerItem: HeaderItem<EventType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makula-schedule",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
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 --access public"
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",