@schedule-x/react 2.17.0 → 2.19.0

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/index.cjs CHANGED
@@ -17,11 +17,11 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
17
17
  const setComponent = (component) => {
18
18
  setCustomComponentsMeta((prev) => {
19
19
  var _a, _b;
20
- const ccid = (_b = (_a = component.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid;
20
+ const ccid = (_b = (_a = component.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid;
21
21
  if (!ccid)
22
22
  return prev;
23
23
  const newComponents = [...prev];
24
- const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid) === ccid; });
24
+ const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid) === ccid; });
25
25
  if (existingComponent) {
26
26
  newComponents.splice(newComponents.indexOf(existingComponent), 1);
27
27
  }
@@ -35,6 +35,8 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
35
35
  if (!calendarApp)
36
36
  return; // in SSR, calendarApp will be undefined
37
37
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
38
+ if (!Component)
39
+ continue;
38
40
  calendarApp._setCustomComponentFn(componentName, createCustomComponentFn(setComponent, Component));
39
41
  }
40
42
  const calendarElement = document.getElementById(randomId);
package/dist/index.cjs.js CHANGED
@@ -17,11 +17,11 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
17
17
  const setComponent = (component) => {
18
18
  setCustomComponentsMeta((prev) => {
19
19
  var _a, _b;
20
- const ccid = (_b = (_a = component.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid;
20
+ const ccid = (_b = (_a = component.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid;
21
21
  if (!ccid)
22
22
  return prev;
23
23
  const newComponents = [...prev];
24
- const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid) === ccid; });
24
+ const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid) === ccid; });
25
25
  if (existingComponent) {
26
26
  newComponents.splice(newComponents.indexOf(existingComponent), 1);
27
27
  }
@@ -35,6 +35,8 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
35
35
  if (!calendarApp)
36
36
  return; // in SSR, calendarApp will be undefined
37
37
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
38
+ if (!Component)
39
+ continue;
38
40
  calendarApp._setCustomComponentFn(componentName, createCustomComponentFn(setComponent, Component));
39
41
  }
40
42
  const calendarElement = document.getElementById(randomId);
package/dist/index.js CHANGED
@@ -15,11 +15,11 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
15
15
  const setComponent = (component) => {
16
16
  setCustomComponentsMeta((prev) => {
17
17
  var _a, _b;
18
- const ccid = (_b = (_a = component.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid;
18
+ const ccid = (_b = (_a = component.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid;
19
19
  if (!ccid)
20
20
  return prev;
21
21
  const newComponents = [...prev];
22
- const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === undefined ? undefined : _a.dataset) === null || _b === undefined ? undefined : _b.ccid) === ccid; });
22
+ const existingComponent = newComponents.find((c) => { var _a, _b; return ((_b = (_a = c.wrapperElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.ccid) === ccid; });
23
23
  if (existingComponent) {
24
24
  newComponents.splice(newComponents.indexOf(existingComponent), 1);
25
25
  }
@@ -33,6 +33,8 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
33
33
  if (!calendarApp)
34
34
  return; // in SSR, calendarApp will be undefined
35
35
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
36
+ if (!Component)
37
+ continue;
36
38
  calendarApp._setCustomComponentFn(componentName, createCustomComponentFn(setComponent, Component));
37
39
  }
38
40
  const calendarElement = document.getElementById(randomId);
@@ -1,20 +1,11 @@
1
1
  import { CalendarApp } from '@schedule-x/calendar';
2
2
  import React from 'react';
3
+ import { CustomComponentName } from "@schedule-x/shared";
3
4
  type ReactComponent = React.ComponentType<any>;
4
5
  type props = {
5
6
  calendarApp: CalendarApp | undefined;
6
7
  customComponents?: {
7
- timeGridEvent?: ReactComponent;
8
- dateGridEvent?: ReactComponent;
9
- monthGridEvent?: ReactComponent;
10
- monthAgendaEvent?: ReactComponent;
11
- eventModal?: ReactComponent;
12
- headerContentLeftPrepend?: ReactComponent;
13
- headerContentLeftAppend?: ReactComponent;
14
- headerContentRightPrepend?: ReactComponent;
15
- headerContentRightAppend?: ReactComponent;
16
- headerContent?: ReactComponent;
17
- interactiveModalAdditionalFields?: ReactComponent;
8
+ [key in CustomComponentName]?: ReactComponent;
18
9
  };
19
10
  };
20
11
  export declare function ScheduleXCalendar({ calendarApp, customComponents }: props): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "main": "dist/index.cjs",
16
16
  "module": "dist/index.js",
17
17
  "types": "dist/types/index.d.ts",
18
- "version": "2.17.0",
18
+ "version": "2.19.0",
19
19
  "type": "module",
20
20
  "files": [
21
21
  "dist"
@@ -31,7 +31,7 @@
31
31
  "build:publish": "npm run build && npm publish"
32
32
  },
33
33
  "peerDependencies": {
34
- "@schedule-x/calendar": "^2.15.1",
34
+ "@schedule-x/calendar": "^2.18.0",
35
35
  "react": "^16.7.0 || ^17 || ^18 || ^19",
36
36
  "react-dom": "^16.7.0 || ^17 || ^18 || ^19"
37
37
  },
@@ -40,15 +40,15 @@
40
40
  "@rollup/plugin-commonjs": "^28.0.0",
41
41
  "@rollup/plugin-node-resolve": "^16.0.0",
42
42
  "@rollup/plugin-typescript": "^11.1.5",
43
- "@schedule-x/calendar-controls": "^2.15.1",
44
- "@schedule-x/drag-and-drop": "^2.15.1",
45
- "@schedule-x/e2e-testing": "^2.15.1",
46
- "@schedule-x/eslint-config": "^2.15.1",
47
- "@schedule-x/event-modal": "^2.15.1",
48
- "@schedule-x/events-service": "^2.15.1",
49
- "@schedule-x/prettier-config": "^2.15.1",
50
- "@schedule-x/shared": "^2.15.1",
51
- "@schedule-x/theme-default": "^2.15.1",
43
+ "@schedule-x/calendar-controls": "^2.18.0",
44
+ "@schedule-x/drag-and-drop": "^2.18.0",
45
+ "@schedule-x/e2e-testing": "^2.18.0",
46
+ "@schedule-x/eslint-config": "^2.18.0",
47
+ "@schedule-x/event-modal": "^2.18.0",
48
+ "@schedule-x/events-service": "^2.18.0",
49
+ "@schedule-x/prettier-config": "^2.18.0",
50
+ "@schedule-x/shared": "^2.18.0",
51
+ "@schedule-x/theme-default": "^2.18.0",
52
52
  "@semantic-release/changelog": "^6.0.3",
53
53
  "@semantic-release/git": "^10.0.1",
54
54
  "@types/react": "^18.2.43",