customized-fabric 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,7 @@ export declare const toCurvedTextObject: (object: CurvedText) => {
32
32
  curvedWidth: any;
33
33
  pathSide: any;
34
34
  pathStartOffset: any;
35
+ isAllCapital: any;
35
36
  };
36
37
  };
37
38
  export default class CurvedText extends fabric.Group {
@@ -111,7 +111,9 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
111
111
  },
112
112
  getText: function () {
113
113
  const { prefix = "", infix = "", suffix = "" } = this.textObject;
114
- this.setText(infix?.length > 0 ? prefix + infix + suffix : "");
114
+ const isAllCapital = this.textObject.isAllCapital;
115
+ const text = prefix + infix + suffix;
116
+ this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
115
117
  },
116
118
  setMaxFontSize: function (fontSize) {
117
119
  this.textObject.set({
@@ -225,6 +227,7 @@ const toCurvedTextObject = (object) => {
225
227
  curvedWidth: textObject?.curvedWidth,
226
228
  pathSide: textObject?.pathSide,
227
229
  pathStartOffset: textObject?.pathStartOffset,
230
+ isAllCapital: textObject?.isAllCapital,
228
231
  },
229
232
  };
230
233
  };
@@ -10,7 +10,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
10
10
  height?: number;
11
11
  textAlign?: string;
12
12
  fontWeight?: string;
13
- text: string;
13
+ text?: string;
14
14
  fontFamily?: string;
15
15
  maxFontSize: number;
16
16
  stroke?: string;
@@ -19,6 +19,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
19
19
  infix?: string;
20
20
  suffix?: string;
21
21
  curvedWidth?: number;
22
+ isAllCapital?: boolean;
22
23
  };
23
24
  fontUrl?: string;
24
25
  isOriginal?: boolean;
@@ -29,6 +29,7 @@ export declare const toTextInputObject: (object: TextInput) => {
29
29
  prefix: any;
30
30
  infix: any;
31
31
  suffix: any;
32
+ isAllCapital: any;
32
33
  };
33
34
  };
34
35
  export default class TextInput extends fabric.Group {
@@ -117,7 +117,9 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
117
117
  },
118
118
  getText: function () {
119
119
  const { prefix = "", infix = "", suffix = "" } = this.textObject;
120
- this.setText(infix?.length > 0 ? prefix + infix + suffix : "");
120
+ const isAllCapital = this.textObject.isAllCapital;
121
+ const text = prefix + infix + suffix;
122
+ this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
121
123
  },
122
124
  setMaxFontSize: function (fontSize) {
123
125
  this.textObject.set({
@@ -205,6 +207,7 @@ const toTextInputObject = (object) => {
205
207
  prefix: textObject?.prefix,
206
208
  infix: textObject?.infix,
207
209
  suffix: textObject?.suffix,
210
+ isAllCapital: textObject?.isAllCapital,
208
211
  },
209
212
  };
210
213
  };
@@ -10,7 +10,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
10
10
  height?: number;
11
11
  textAlign?: string;
12
12
  fontWeight?: string;
13
- text: string;
13
+ text?: string;
14
14
  fontFamily?: string;
15
15
  maxFontSize: number;
16
16
  stroke?: string;
@@ -18,6 +18,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
18
18
  prefix?: string;
19
19
  infix?: string;
20
20
  suffix?: string;
21
+ isAllCapital?: boolean;
21
22
  };
22
23
  fontUrl?: string;
23
24
  isOriginal?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",