@syncfusion/ej2-inputs 30.2.4 → 31.1.17
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/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +1 -1
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +1 -1
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/color-picker/color-picker-model.d.ts +186 -0
- package/dist/ts/color-picker/color-picker.d.ts +398 -0
- package/dist/ts/color-picker/color-picker.ts +2209 -0
- package/dist/ts/color-picker/index.d.ts +5 -0
- package/dist/ts/color-picker/index.ts +5 -0
- package/dist/ts/common/index.d.ts +4 -0
- package/dist/ts/common/index.ts +4 -0
- package/dist/ts/common/signature-base.d.ts +340 -0
- package/dist/ts/common/signature-base.ts +1170 -0
- package/dist/ts/form-validator/form-validator-model.d.ts +121 -0
- package/dist/ts/form-validator/form-validator.d.ts +312 -0
- package/dist/ts/form-validator/form-validator.ts +1068 -0
- package/dist/ts/form-validator/index.d.ts +5 -0
- package/dist/ts/form-validator/index.ts +5 -0
- package/dist/ts/index.d.ts +18 -0
- package/dist/ts/index.ts +18 -0
- package/dist/ts/input/index.d.ts +4 -0
- package/dist/ts/input/index.ts +4 -0
- package/dist/ts/input/input.d.ts +345 -0
- package/dist/ts/input/input.ts +1277 -0
- package/dist/ts/maskedtextbox/base/index.d.ts +4 -0
- package/dist/ts/maskedtextbox/base/index.ts +4 -0
- package/dist/ts/maskedtextbox/base/mask-base.d.ts +134 -0
- package/dist/ts/maskedtextbox/base/mask-base.ts +1207 -0
- package/dist/ts/maskedtextbox/index.d.ts +5 -0
- package/dist/ts/maskedtextbox/index.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/index.d.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/index.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox-model.d.ts +167 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox.d.ts +307 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox.ts +709 -0
- package/dist/ts/numerictextbox/index.d.ts +5 -0
- package/dist/ts/numerictextbox/index.ts +5 -0
- package/dist/ts/numerictextbox/numerictextbox-model.d.ts +228 -0
- package/dist/ts/numerictextbox/numerictextbox.d.ts +431 -0
- package/dist/ts/numerictextbox/numerictextbox.ts +1672 -0
- package/dist/ts/otp-input/index.d.ts +5 -0
- package/dist/ts/otp-input/index.ts +5 -0
- package/dist/ts/otp-input/otp-input-model.d.ts +165 -0
- package/dist/ts/otp-input/otp-input.d.ts +365 -0
- package/dist/ts/otp-input/otp-input.ts +924 -0
- package/dist/ts/rating/index.d.ts +5 -0
- package/dist/ts/rating/index.ts +5 -0
- package/dist/ts/rating/rating-model.d.ts +239 -0
- package/dist/ts/rating/rating.d.ts +416 -0
- package/dist/ts/rating/rating.ts +1101 -0
- package/dist/ts/signature/index.d.ts +5 -0
- package/dist/ts/signature/index.ts +5 -0
- package/dist/ts/signature/signature-model.d.ts +131 -0
- package/dist/ts/signature/signature.d.ts +167 -0
- package/dist/ts/signature/signature.ts +266 -0
- package/dist/ts/slider/index.d.ts +5 -0
- package/dist/ts/slider/index.ts +5 -0
- package/dist/ts/slider/slider-model.d.ts +401 -0
- package/dist/ts/slider/slider.d.ts +721 -0
- package/dist/ts/slider/slider.ts +3497 -0
- package/dist/ts/smart-textarea/caret-helper.d.ts +17 -0
- package/dist/ts/smart-textarea/caret-helper.ts +95 -0
- package/dist/ts/smart-textarea/index.d.ts +5 -0
- package/dist/ts/smart-textarea/index.ts +5 -0
- package/dist/ts/smart-textarea/smart-textarea-model.d.ts +44 -0
- package/dist/ts/smart-textarea/smart-textarea.d.ts +80 -0
- package/dist/ts/smart-textarea/smart-textarea.ts +518 -0
- package/dist/ts/speech-to-text/index.d.ts +5 -0
- package/dist/ts/speech-to-text/index.ts +5 -0
- package/dist/ts/speech-to-text/speech-to-text-model.d.ts +270 -0
- package/dist/ts/speech-to-text/speech-to-text.d.ts +487 -0
- package/dist/ts/speech-to-text/speech-to-text.ts +1008 -0
- package/dist/ts/textarea/index.d.ts +5 -0
- package/dist/ts/textarea/index.ts +5 -0
- package/dist/ts/textarea/textarea-model.d.ts +161 -0
- package/dist/ts/textarea/textarea.d.ts +237 -0
- package/dist/ts/textarea/textarea.ts +812 -0
- package/dist/ts/textbox/index.d.ts +5 -0
- package/dist/ts/textbox/index.ts +5 -0
- package/dist/ts/textbox/textbox-model.d.ts +155 -0
- package/dist/ts/textbox/textbox.d.ts +288 -0
- package/dist/ts/textbox/textbox.ts +872 -0
- package/dist/ts/uploader/index.d.ts +5 -0
- package/dist/ts/uploader/index.ts +5 -0
- package/dist/ts/uploader/uploader-model.d.ts +555 -0
- package/dist/ts/uploader/uploader.d.ts +1216 -0
- package/dist/ts/uploader/uploader.ts +4391 -0
- package/package.json +62 -12
- package/src/input/input.js +1 -1
- package/styles/bootstrap5.3-lite.css +3 -3
- package/styles/bootstrap5.3.css +5 -5
- package/styles/input/_layout.scss +0 -1
- package/styles/input/tailwind3.css +0 -1
- package/styles/tailwind-dark-lite.css +3 -3
- package/styles/tailwind-dark.css +5 -5
- package/styles/tailwind-lite.css +3 -3
- package/styles/tailwind.css +5 -5
- package/styles/tailwind3-lite.css +0 -1
- package/styles/tailwind3.css +0 -1
- package/styles/uploader/_bootstrap5.3-definition.scss +1 -1
- package/styles/uploader/_tailwind-definition.scss +1 -1
- package/styles/uploader/bootstrap5.3.css +5 -5
- package/styles/uploader/tailwind-dark.css +5 -5
- package/styles/uploader/tailwind.css +5 -5
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Event, EmitType, INotifyPropertyChanged } from '@syncfusion/ej2-base';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for a class Signature
|
|
5
|
+
*/
|
|
6
|
+
export interface SignatureModel {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gets or sets the background color of the component.
|
|
10
|
+
* The background color of the component that accepts hex value, rgb and text (like 'red'). The default value is ''.
|
|
11
|
+
*
|
|
12
|
+
* @default ''
|
|
13
|
+
*/
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gets or sets the background image for the component.
|
|
18
|
+
* An image that used to fill the background of the component. The default value is ''.
|
|
19
|
+
*
|
|
20
|
+
* @default ''
|
|
21
|
+
*/
|
|
22
|
+
backgroundImage?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Gets or sets whether to disable the signature component where the opacity is set to show disabled state.
|
|
26
|
+
* True, if the signature component is disabled for user interaction. The default value is false.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Gets or sets whether to prevent the interaction in signature component.
|
|
34
|
+
* True, if the signature component is read only state where the user interaction is prevented. The default value is false.
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
isReadOnly?: boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gets or sets whether to save the signature along with Background Color and background Image while saving.
|
|
42
|
+
* True, if signature component to save with background. The default value is true.
|
|
43
|
+
*
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
saveWithBackground?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Gets or sets the stroke color of the signature.
|
|
50
|
+
* The color of the signature stroke that accepts hex value, rgb and text (like 'red'). The default value is "#000000".
|
|
51
|
+
*
|
|
52
|
+
* @default '#000000'
|
|
53
|
+
*/
|
|
54
|
+
strokeColor?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Gets or sets the minimum stroke width for signature.
|
|
58
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
59
|
+
* The minimum width of stroke. The default value is 0.5.
|
|
60
|
+
*
|
|
61
|
+
* @default 0.5
|
|
62
|
+
*/
|
|
63
|
+
minStrokeWidth?: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Gets or sets the maximum stroke width for signature.
|
|
67
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
68
|
+
* The maximum width of stroke. The default value is 2.0.
|
|
69
|
+
*
|
|
70
|
+
* @default 2
|
|
71
|
+
*/
|
|
72
|
+
maxStrokeWidth?: number;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gets or sets the velocity to calculate the stroke thickness based on the pressure of the contact on the digitizer surface.
|
|
76
|
+
* The Signature component calculates stroke thickness based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
77
|
+
* The default value is 0.7.
|
|
78
|
+
*
|
|
79
|
+
* @default 0.7
|
|
80
|
+
*/
|
|
81
|
+
velocity?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
|
|
85
|
+
*
|
|
86
|
+
* @default 'en-US'
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
locale?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Specifies the Signature in RTL mode that displays the content in the right-to-left direction.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
enableRtl?: boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets or sets whether to persist component's state between page reloads.
|
|
101
|
+
* True, if the component's state persistence is enabled. The default value is false.
|
|
102
|
+
* Component's property will be stored in browser local storage to persist component's state when page reloads.
|
|
103
|
+
*
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
enablePersistence?: boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Gets or sets an event callback that is raised while saving the signature.
|
|
110
|
+
* The file name and the file type can be changed using SignatureBeforeSaveEventArgs and SignatureFileType.
|
|
111
|
+
* The event callback is raised only for the keyboard action (Ctrl + S).
|
|
112
|
+
*
|
|
113
|
+
* @event beforeSave
|
|
114
|
+
*/
|
|
115
|
+
beforeSave?: EmitType<SignatureBeforeSaveEventArgs>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets or sets an event callback that is raised for the actions like undo, redo, clear and while user complete signing on signature component.
|
|
119
|
+
*
|
|
120
|
+
* @event change
|
|
121
|
+
*/
|
|
122
|
+
change?: EmitType<SignatureChangeEventArgs>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Triggers once the component rendering is completed.
|
|
126
|
+
*
|
|
127
|
+
* @event created
|
|
128
|
+
*/
|
|
129
|
+
created?: EmitType<Event>;
|
|
130
|
+
|
|
131
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { EmitType, INotifyPropertyChanged } from '@syncfusion/ej2-base';
|
|
2
|
+
import { SignatureBase, SignatureBeforeSaveEventArgs, SignatureChangeEventArgs } from '../common/signature-base';
|
|
3
|
+
import { SignatureModel } from './signature-model';
|
|
4
|
+
/**
|
|
5
|
+
* The Signature component allows user to draw smooth signatures as vector outline of strokes using variable width bezier curve interpolation.
|
|
6
|
+
* It allows to save signature as image.
|
|
7
|
+
* You can use your finger, pen, or mouse on a tablet, touchscreen, etc., to draw your own signature on this Signature component.
|
|
8
|
+
* Signature component is a user interface to draw the Signature or Text.
|
|
9
|
+
* It provides supports for various Background color, Stroke color and Background Image.
|
|
10
|
+
* ```html
|
|
11
|
+
* <canvas id="signature"></canvas>
|
|
12
|
+
* ```
|
|
13
|
+
* ```typescript
|
|
14
|
+
* <script>
|
|
15
|
+
* let signatureObj: Signature = new Signature(null , "#signature");
|
|
16
|
+
* </script>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class Signature extends SignatureBase implements INotifyPropertyChanged {
|
|
20
|
+
/**
|
|
21
|
+
* Gets or sets the background color of the component.
|
|
22
|
+
* The background color of the component that accepts hex value, rgb and text (like 'red'). The default value is ''.
|
|
23
|
+
*
|
|
24
|
+
* @default ''
|
|
25
|
+
*/
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
/**
|
|
28
|
+
* Gets or sets the background image for the component.
|
|
29
|
+
* An image that used to fill the background of the component. The default value is ''.
|
|
30
|
+
*
|
|
31
|
+
* @default ''
|
|
32
|
+
*/
|
|
33
|
+
backgroundImage: string;
|
|
34
|
+
/**
|
|
35
|
+
* Gets or sets whether to disable the signature component where the opacity is set to show disabled state.
|
|
36
|
+
* True, if the signature component is disabled for user interaction. The default value is false.
|
|
37
|
+
*
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Gets or sets whether to prevent the interaction in signature component.
|
|
43
|
+
* True, if the signature component is read only state where the user interaction is prevented. The default value is false.
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
isReadOnly: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Gets or sets whether to save the signature along with Background Color and background Image while saving.
|
|
50
|
+
* True, if signature component to save with background. The default value is true.
|
|
51
|
+
*
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
saveWithBackground: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Gets or sets the stroke color of the signature.
|
|
57
|
+
* The color of the signature stroke that accepts hex value, rgb and text (like 'red'). The default value is "#000000".
|
|
58
|
+
*
|
|
59
|
+
* @default '#000000'
|
|
60
|
+
*/
|
|
61
|
+
strokeColor: string;
|
|
62
|
+
/**
|
|
63
|
+
* Gets or sets the minimum stroke width for signature.
|
|
64
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
65
|
+
* The minimum width of stroke. The default value is 0.5.
|
|
66
|
+
*
|
|
67
|
+
* @default 0.5
|
|
68
|
+
*/
|
|
69
|
+
minStrokeWidth: number;
|
|
70
|
+
/**
|
|
71
|
+
* Gets or sets the maximum stroke width for signature.
|
|
72
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
73
|
+
* The maximum width of stroke. The default value is 2.0.
|
|
74
|
+
*
|
|
75
|
+
* @default 2
|
|
76
|
+
*/
|
|
77
|
+
maxStrokeWidth: number;
|
|
78
|
+
/**
|
|
79
|
+
* Gets or sets the velocity to calculate the stroke thickness based on the pressure of the contact on the digitizer surface.
|
|
80
|
+
* The Signature component calculates stroke thickness based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
81
|
+
* The default value is 0.7.
|
|
82
|
+
*
|
|
83
|
+
* @default 0.7
|
|
84
|
+
*/
|
|
85
|
+
velocity: number;
|
|
86
|
+
/**
|
|
87
|
+
* Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
|
|
88
|
+
*
|
|
89
|
+
* @default 'en-US'
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
locale: string;
|
|
93
|
+
/**
|
|
94
|
+
* Specifies the Signature in RTL mode that displays the content in the right-to-left direction.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
* @private
|
|
98
|
+
*/
|
|
99
|
+
enableRtl: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Gets or sets whether to persist component's state between page reloads.
|
|
102
|
+
* True, if the component's state persistence is enabled. The default value is false.
|
|
103
|
+
* Component's property will be stored in browser local storage to persist component's state when page reloads.
|
|
104
|
+
*
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
enablePersistence: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Gets or sets an event callback that is raised while saving the signature.
|
|
110
|
+
* The file name and the file type can be changed using SignatureBeforeSaveEventArgs and SignatureFileType.
|
|
111
|
+
* The event callback is raised only for the keyboard action (Ctrl + S).
|
|
112
|
+
*
|
|
113
|
+
* @event beforeSave
|
|
114
|
+
*/
|
|
115
|
+
beforeSave: EmitType<SignatureBeforeSaveEventArgs>;
|
|
116
|
+
/**
|
|
117
|
+
* Gets or sets an event callback that is raised for the actions like undo, redo, clear and while user complete signing on signature component.
|
|
118
|
+
*
|
|
119
|
+
* @event change
|
|
120
|
+
*/
|
|
121
|
+
change: EmitType<SignatureChangeEventArgs>;
|
|
122
|
+
/**
|
|
123
|
+
* Triggers once the component rendering is completed.
|
|
124
|
+
*
|
|
125
|
+
* @event created
|
|
126
|
+
*/
|
|
127
|
+
created: EmitType<Event>;
|
|
128
|
+
/**
|
|
129
|
+
* Constructor for creating the widget.
|
|
130
|
+
*
|
|
131
|
+
* @param {SignatureModel} options - Specifies the Signature model.
|
|
132
|
+
* @param {string | HTMLCanvasElement} element - Specifies the element.
|
|
133
|
+
* @private
|
|
134
|
+
*/
|
|
135
|
+
constructor(options?: SignatureModel, element?: string | HTMLCanvasElement);
|
|
136
|
+
protected preRender(): void;
|
|
137
|
+
/**
|
|
138
|
+
* To Initialize the component rendering
|
|
139
|
+
*
|
|
140
|
+
* @private
|
|
141
|
+
* @returns {void}
|
|
142
|
+
*/
|
|
143
|
+
protected render(): void;
|
|
144
|
+
initialize(): void;
|
|
145
|
+
/**
|
|
146
|
+
* To get component name.
|
|
147
|
+
*
|
|
148
|
+
* @returns {string} - Module Name
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
protected getModuleName(): string;
|
|
152
|
+
/**
|
|
153
|
+
* To get the properties to be maintained in the persisted state.
|
|
154
|
+
*
|
|
155
|
+
* @returns {string} - Persist data
|
|
156
|
+
*/
|
|
157
|
+
protected getPersistData(): string;
|
|
158
|
+
/**
|
|
159
|
+
* Called internally if any of the property value changed.
|
|
160
|
+
*
|
|
161
|
+
* @param {SignatureModel} newProp - Specifies new properties
|
|
162
|
+
* @param {SignatureModel} oldProp - Specifies old properties
|
|
163
|
+
* @returns {void}
|
|
164
|
+
* @private
|
|
165
|
+
*/
|
|
166
|
+
onPropertyChanged(newProp: SignatureModel, oldProp: SignatureModel): void;
|
|
167
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { Event, EmitType, INotifyPropertyChanged } from '@syncfusion/ej2-base';
|
|
2
|
+
import { NotifyPropertyChanges, Property, addClass } from '@syncfusion/ej2-base';
|
|
3
|
+
import { SignatureBase, SignatureBeforeSaveEventArgs, SignatureChangeEventArgs } from '../common/signature-base';
|
|
4
|
+
import { SignatureModel } from './signature-model';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Signature component allows user to draw smooth signatures as vector outline of strokes using variable width bezier curve interpolation.
|
|
8
|
+
* It allows to save signature as image.
|
|
9
|
+
* You can use your finger, pen, or mouse on a tablet, touchscreen, etc., to draw your own signature on this Signature component.
|
|
10
|
+
* Signature component is a user interface to draw the Signature or Text.
|
|
11
|
+
* It provides supports for various Background color, Stroke color and Background Image.
|
|
12
|
+
* ```html
|
|
13
|
+
* <canvas id="signature"></canvas>
|
|
14
|
+
* ```
|
|
15
|
+
* ```typescript
|
|
16
|
+
* <script>
|
|
17
|
+
* let signatureObj: Signature = new Signature(null , "#signature");
|
|
18
|
+
* </script>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
@NotifyPropertyChanges
|
|
23
|
+
export class Signature extends SignatureBase implements INotifyPropertyChanged {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Gets or sets the background color of the component.
|
|
27
|
+
* The background color of the component that accepts hex value, rgb and text (like 'red'). The default value is ''.
|
|
28
|
+
*
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
@Property('')
|
|
32
|
+
public backgroundColor: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Gets or sets the background image for the component.
|
|
36
|
+
* An image that used to fill the background of the component. The default value is ''.
|
|
37
|
+
*
|
|
38
|
+
* @default ''
|
|
39
|
+
*/
|
|
40
|
+
@Property('')
|
|
41
|
+
public backgroundImage: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets or sets whether to disable the signature component where the opacity is set to show disabled state.
|
|
45
|
+
* True, if the signature component is disabled for user interaction. The default value is false.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
@Property(false)
|
|
50
|
+
public disabled: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Gets or sets whether to prevent the interaction in signature component.
|
|
54
|
+
* True, if the signature component is read only state where the user interaction is prevented. The default value is false.
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
@Property(false)
|
|
59
|
+
public isReadOnly: boolean;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Gets or sets whether to save the signature along with Background Color and background Image while saving.
|
|
63
|
+
* True, if signature component to save with background. The default value is true.
|
|
64
|
+
*
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
@Property(true)
|
|
68
|
+
public saveWithBackground: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Gets or sets the stroke color of the signature.
|
|
72
|
+
* The color of the signature stroke that accepts hex value, rgb and text (like 'red'). The default value is "#000000".
|
|
73
|
+
*
|
|
74
|
+
* @default '#000000'
|
|
75
|
+
*/
|
|
76
|
+
@Property('#000000')
|
|
77
|
+
public strokeColor: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Gets or sets the minimum stroke width for signature.
|
|
81
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
82
|
+
* The minimum width of stroke. The default value is 0.5.
|
|
83
|
+
*
|
|
84
|
+
* @default 0.5
|
|
85
|
+
*/
|
|
86
|
+
@Property(0.5)
|
|
87
|
+
public minStrokeWidth: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets or sets the maximum stroke width for signature.
|
|
91
|
+
* The signature component calculates stroke width based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
92
|
+
* The maximum width of stroke. The default value is 2.0.
|
|
93
|
+
*
|
|
94
|
+
* @default 2
|
|
95
|
+
*/
|
|
96
|
+
@Property(2)
|
|
97
|
+
public maxStrokeWidth: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets or sets the velocity to calculate the stroke thickness based on the pressure of the contact on the digitizer surface.
|
|
101
|
+
* The Signature component calculates stroke thickness based on Velocity, MinStrokeWidth and MaxStrokeWidth.
|
|
102
|
+
* The default value is 0.7.
|
|
103
|
+
*
|
|
104
|
+
* @default 0.7
|
|
105
|
+
*/
|
|
106
|
+
@Property(0.7)
|
|
107
|
+
public velocity: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
|
|
111
|
+
*
|
|
112
|
+
* @default 'en-US'
|
|
113
|
+
* @private
|
|
114
|
+
*/
|
|
115
|
+
@Property('en-US')
|
|
116
|
+
public locale: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the Signature in RTL mode that displays the content in the right-to-left direction.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
124
|
+
@Property(false)
|
|
125
|
+
public enableRtl: boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Gets or sets whether to persist component's state between page reloads.
|
|
129
|
+
* True, if the component's state persistence is enabled. The default value is false.
|
|
130
|
+
* Component's property will be stored in browser local storage to persist component's state when page reloads.
|
|
131
|
+
*
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
@Property(false)
|
|
135
|
+
public enablePersistence: boolean;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Gets or sets an event callback that is raised while saving the signature.
|
|
139
|
+
* The file name and the file type can be changed using SignatureBeforeSaveEventArgs and SignatureFileType.
|
|
140
|
+
* The event callback is raised only for the keyboard action (Ctrl + S).
|
|
141
|
+
*
|
|
142
|
+
* @event beforeSave
|
|
143
|
+
*/
|
|
144
|
+
@Event()
|
|
145
|
+
public beforeSave: EmitType<SignatureBeforeSaveEventArgs>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gets or sets an event callback that is raised for the actions like undo, redo, clear and while user complete signing on signature component.
|
|
149
|
+
*
|
|
150
|
+
* @event change
|
|
151
|
+
*/
|
|
152
|
+
@Event()
|
|
153
|
+
public change: EmitType<SignatureChangeEventArgs>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Triggers once the component rendering is completed.
|
|
157
|
+
*
|
|
158
|
+
* @event created
|
|
159
|
+
*/
|
|
160
|
+
@Event()
|
|
161
|
+
public created: EmitType<Event>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Constructor for creating the widget.
|
|
165
|
+
*
|
|
166
|
+
* @param {SignatureModel} options - Specifies the Signature model.
|
|
167
|
+
* @param {string | HTMLCanvasElement} element - Specifies the element.
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
constructor(options?: SignatureModel, element?: string | HTMLCanvasElement) {
|
|
171
|
+
super(options, <HTMLCanvasElement | string> element);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
protected preRender(): void {
|
|
175
|
+
// pre render code snippets
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* To Initialize the component rendering
|
|
180
|
+
*
|
|
181
|
+
* @private
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
184
|
+
protected render(): void {
|
|
185
|
+
this.initialize();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public initialize(): void {
|
|
189
|
+
this.element.setAttribute('role', 'img');
|
|
190
|
+
this.element.setAttribute('aria-label', 'signature');
|
|
191
|
+
addClass([this.element], 'e-' + this.getModuleName());
|
|
192
|
+
super.initialize(this.element);
|
|
193
|
+
if (this.enablePersistence) {
|
|
194
|
+
this.loadPersistedSignature();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* To get component name.
|
|
200
|
+
*
|
|
201
|
+
* @returns {string} - Module Name
|
|
202
|
+
* @private
|
|
203
|
+
*/
|
|
204
|
+
protected getModuleName(): string {
|
|
205
|
+
return super.getModuleName();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* To get the properties to be maintained in the persisted state.
|
|
210
|
+
*
|
|
211
|
+
* @returns {string} - Persist data
|
|
212
|
+
*/
|
|
213
|
+
protected getPersistData(): string {
|
|
214
|
+
return super.getPersistData();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Called internally if any of the property value changed.
|
|
219
|
+
*
|
|
220
|
+
* @param {SignatureModel} newProp - Specifies new properties
|
|
221
|
+
* @param {SignatureModel} oldProp - Specifies old properties
|
|
222
|
+
* @returns {void}
|
|
223
|
+
* @private
|
|
224
|
+
*/
|
|
225
|
+
public onPropertyChanged(newProp: SignatureModel, oldProp: SignatureModel): void {
|
|
226
|
+
for (const prop of Object.keys(newProp)) {
|
|
227
|
+
switch (prop) {
|
|
228
|
+
case 'backgroundColor':
|
|
229
|
+
super.propertyChanged(prop, newProp.backgroundColor);
|
|
230
|
+
break;
|
|
231
|
+
case 'backgroundImage':
|
|
232
|
+
super.propertyChanged(prop, newProp.backgroundImage);
|
|
233
|
+
break;
|
|
234
|
+
case 'strokeColor':
|
|
235
|
+
if (newProp.strokeColor !== oldProp.strokeColor) {
|
|
236
|
+
super.propertyChanged(prop, newProp.strokeColor);
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
case 'maxStrokeWidth':
|
|
240
|
+
if (newProp.maxStrokeWidth !== oldProp.maxStrokeWidth) {
|
|
241
|
+
super.propertyChanged(prop, newProp.maxStrokeWidth);
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
case 'minStrokeWidth':
|
|
245
|
+
if (newProp.minStrokeWidth !== oldProp.minStrokeWidth) {
|
|
246
|
+
super.propertyChanged(prop, newProp.minStrokeWidth);
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
case 'velocity':
|
|
250
|
+
if (newProp.velocity !== oldProp.velocity) {
|
|
251
|
+
super.propertyChanged(prop, newProp.velocity);
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
case 'saveWithBackground':
|
|
255
|
+
super.propertyChanged(prop, newProp.saveWithBackground);
|
|
256
|
+
break;
|
|
257
|
+
case 'isReadOnly':
|
|
258
|
+
super.propertyChanged(prop, newProp.isReadOnly);
|
|
259
|
+
break;
|
|
260
|
+
case 'disabled':
|
|
261
|
+
super.propertyChanged(prop, newProp.disabled);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|