customized-fabric 1.7.8 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ export declare const toCalendarObject: (object: Calendar) => {
11
11
  isAdditional: boolean | undefined;
12
12
  layoutGroupId: string | undefined;
13
13
  layoutGroupName: string | undefined;
14
- calendartSettings: {
14
+ calendarSettings: {
15
15
  width: number | undefined;
16
16
  height: number | undefined;
17
17
  objectFit: string | undefined;
@@ -24,6 +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
28
  this.set({
28
29
  _id: new objectId_1.ObjectId().toString(),
29
30
  name: constants_1.CALENDAR_OBJECT_ATTRIBUTES.name,
@@ -31,10 +32,9 @@ const CalendarClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
31
32
  ...options,
32
33
  layerId: options?.personalizeId ?? options?.layerId,
33
34
  objectCaching: false,
34
- calendarWidth: 400,
35
- calendarHeight: 400,
36
- objectFit: "contain",
37
- ...(options?.calendarSettings ?? {}),
35
+ calendarWidth: width ?? 400,
36
+ calendarHeight: height ?? 400,
37
+ objectFit: objectFit ?? "contain",
38
38
  });
39
39
  if (options?.isOriginal) {
40
40
  this.rectObject?.set({ strokeWidth: 0 });
@@ -110,7 +110,7 @@ const toCalendarObject = (object) => {
110
110
  isAdditional: object?.isAdditional,
111
111
  layoutGroupId: object?.layoutGroupId,
112
112
  layoutGroupName: object?.layoutGroupName,
113
- calendartSettings: {
113
+ calendarSettings: {
114
114
  width: object?.calendarWidth,
115
115
  height: object?.calendarHeight,
116
116
  objectFit: object?.objectFit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.7.8",
3
+ "version": "1.8.0",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",