customized-fabric 1.8.1 → 1.8.3

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.
@@ -14,6 +14,13 @@ export declare const toCalendarObject: (object: Calendar) => {
14
14
  calendarSettings: {
15
15
  width: number | undefined;
16
16
  height: number | undefined;
17
+ backgroundColor: string | undefined;
18
+ titleColor: string | undefined;
19
+ dayColor: string | undefined;
20
+ dateColor: string | undefined;
21
+ markedDateColor: string | undefined;
22
+ markerUrl: string | undefined;
23
+ fontUrl: string | undefined;
17
24
  objectFit: string | undefined;
18
25
  };
19
26
  };
@@ -29,6 +36,13 @@ export default class Calendar extends fabric.Group {
29
36
  objectFit?: string;
30
37
  calendarWidth?: number;
31
38
  calendarHeight?: number;
39
+ calendarFontUrl?: string;
40
+ calendarBackgroundColor?: string;
41
+ calendarTitleColor?: string;
42
+ calendarDayColor?: string;
43
+ calendarDateColor?: string;
44
+ calendarMarkedDateColor?: string;
45
+ calendarMarkerUrl?: string;
32
46
  getSettings?: (attribute: string) => any;
33
47
  setSizes?: (options: {
34
48
  width?: number;
@@ -24,7 +24,7 @@ const CalendarClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
24
24
  this.setSizes({ width, height });
25
25
  this.canvas?.renderAll();
26
26
  });
27
- const { width, height, objectFit } = options?.calendarSettings ?? {};
27
+ const { width, height, backgroundColor, titleColor, dayColor, dateColor, markedDateColor, markerUrl, fontUrl, objectFit, } = options?.calendarSettings ?? {};
28
28
  this.set({
29
29
  _id: new objectId_1.ObjectId().toString(),
30
30
  name: constants_1.CALENDAR_OBJECT_ATTRIBUTES.name,
@@ -34,6 +34,13 @@ const CalendarClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
34
34
  objectCaching: false,
35
35
  calendarWidth: width ?? 400,
36
36
  calendarHeight: height ?? 400,
37
+ calendarBackgroundColor: backgroundColor,
38
+ calendarTitleColor: titleColor,
39
+ calendarDayColor: dayColor,
40
+ calendarDateColor: dateColor,
41
+ calendarMarkedDateColor: markedDateColor,
42
+ calendarMarkerUrl: markerUrl,
43
+ calendarFontUrl: fontUrl,
37
44
  objectFit: objectFit ?? "contain",
38
45
  });
39
46
  if (options?.isOriginal) {
@@ -113,6 +120,13 @@ const toCalendarObject = (object) => {
113
120
  calendarSettings: {
114
121
  width: object?.calendarWidth,
115
122
  height: object?.calendarHeight,
123
+ backgroundColor: object?.calendarBackgroundColor,
124
+ titleColor: object?.calendarTitleColor,
125
+ dayColor: object?.calendarDayColor,
126
+ dateColor: object?.calendarDateColor,
127
+ markedDateColor: object?.calendarMarkedDateColor,
128
+ markerUrl: object?.calendarMarkerUrl,
129
+ fontUrl: object?.calendarFontUrl,
116
130
  objectFit: object?.objectFit,
117
131
  },
118
132
  };
@@ -10,6 +10,13 @@ export interface ICalendarOptions extends fabric.IGroupOptions {
10
10
  calendarSettings?: {
11
11
  width?: number;
12
12
  height?: number;
13
+ backgroundColor: string;
14
+ titleColor: string;
15
+ dayColor: string;
16
+ dateColor: string;
17
+ markedDateColor: string;
18
+ markerUrl: string;
19
+ fontUrl: string;
13
20
  objectFit?: string;
14
21
  };
15
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",