@syncfusion/ej2-inputs 19.3.53 → 19.4.42
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/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/common.d.ts +4 -0
- package/common.js +4 -0
- 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 +1116 -8
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +1150 -7
- 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/package.json +9 -9
- package/signature.d.ts +4 -0
- package/signature.js +4 -0
- package/src/common/index.d.ts +4 -0
- package/src/common/index.js +4 -0
- package/src/common/signature-base.d.ts +320 -0
- package/src/common/signature-base.js +946 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/input/input.js +10 -6
- package/src/numerictextbox/numerictextbox.js +10 -0
- package/src/signature/index.d.ts +5 -0
- package/src/signature/index.js +4 -0
- package/src/signature/signature-model.d.ts +131 -0
- package/src/signature/signature.d.ts +167 -0
- package/src/signature/signature.js +171 -0
- package/src/slider/slider.d.ts +1 -0
- package/src/slider/slider.js +9 -0
- package/styles/bootstrap-dark.css +43 -16
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +43 -16
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +43 -16
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +46 -41
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +46 -41
- package/styles/bootstrap5.scss +1 -0
- package/styles/color-picker/_fabric-dark-definition.scss +1 -1
- package/styles/color-picker/_fluent-definition.scss +134 -0
- package/styles/color-picker/_layout.scss +5 -5
- package/styles/color-picker/_theme.scss +16 -15
- package/styles/color-picker/bootstrap-dark.css +20 -0
- package/styles/color-picker/bootstrap.css +20 -0
- package/styles/color-picker/bootstrap4.css +20 -0
- package/styles/color-picker/bootstrap5-dark.css +22 -20
- package/styles/color-picker/bootstrap5.css +22 -20
- package/styles/color-picker/fabric-dark.css +23 -3
- package/styles/color-picker/fabric.css +20 -0
- package/styles/color-picker/highcontrast-light.css +20 -0
- package/styles/color-picker/highcontrast.css +20 -0
- package/styles/color-picker/icons/_fluent.scss +10 -0
- package/styles/color-picker/material-dark.css +20 -0
- package/styles/color-picker/material.css +20 -0
- package/styles/color-picker/tailwind-dark.css +20 -0
- package/styles/color-picker/tailwind.css +20 -0
- package/styles/fabric-dark.css +46 -19
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +43 -16
- package/styles/fabric.scss +1 -0
- package/styles/highcontrast-light.css +43 -16
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +43 -16
- package/styles/highcontrast.scss +1 -0
- package/styles/input/_fluent-definition.scss +321 -0
- package/styles/input/_layout.scss +138 -37
- package/styles/input/_theme.scss +42 -24
- package/styles/input/bootstrap-dark.css +13 -16
- package/styles/input/bootstrap.css +13 -16
- package/styles/input/bootstrap4.css +13 -16
- package/styles/input/bootstrap5-dark.css +13 -16
- package/styles/input/bootstrap5.css +13 -16
- package/styles/input/fabric-dark.css +13 -16
- package/styles/input/fabric.css +13 -16
- package/styles/input/highcontrast-light.css +13 -16
- package/styles/input/highcontrast.css +13 -16
- package/styles/input/icons/_fluent.scss +17 -0
- package/styles/input/material-dark.css +13 -16
- package/styles/input/material.css +13 -16
- package/styles/input/tailwind-dark.css +13 -16
- package/styles/input/tailwind.css +13 -16
- package/styles/maskedtextbox/_fluent-definition.scss +7 -0
- package/styles/maskedtextbox/_theme.scss +2 -2
- package/styles/material-dark.css +43 -16
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +43 -16
- package/styles/material.scss +1 -0
- package/styles/numerictextbox/_fluent-definition.scss +5 -0
- package/styles/numerictextbox/_theme.scss +18 -0
- package/styles/numerictextbox/icons/_fluent.scss +12 -0
- package/styles/signature/_all.scss +2 -0
- package/styles/signature/_bootstrap-dark-definition.scss +3 -0
- package/styles/signature/_bootstrap-definition.scss +3 -0
- package/styles/signature/_bootstrap4-definition.scss +3 -0
- package/styles/signature/_bootstrap5-dark-definition.scss +1 -0
- package/styles/signature/_bootstrap5-definition.scss +3 -0
- package/styles/signature/_fabric-dark-definition.scss +3 -0
- package/styles/signature/_fabric-definition.scss +3 -0
- package/styles/signature/_fluent-definition.scss +3 -0
- package/styles/signature/_highcontrast-definition.scss +3 -0
- package/styles/signature/_highcontrast-light-definition.scss +3 -0
- package/styles/signature/_layout.scss +5 -0
- package/styles/signature/_material-dark-definition.scss +3 -0
- package/styles/signature/_material-definition.scss +3 -0
- package/styles/signature/_tailwind-dark-definition.scss +1 -0
- package/styles/signature/_tailwind-definition.scss +3 -0
- package/styles/signature/_theme.scss +7 -0
- package/styles/signature/bootstrap-dark.css +9 -0
- package/styles/signature/bootstrap-dark.scss +3 -0
- package/styles/signature/bootstrap.css +9 -0
- package/styles/signature/bootstrap.scss +3 -0
- package/styles/signature/bootstrap4.css +9 -0
- package/styles/signature/bootstrap4.scss +3 -0
- package/styles/signature/bootstrap5-dark.css +9 -0
- package/styles/signature/bootstrap5-dark.scss +3 -0
- package/styles/signature/bootstrap5.css +9 -0
- package/styles/signature/bootstrap5.scss +3 -0
- package/styles/signature/fabric-dark.css +9 -0
- package/styles/signature/fabric-dark.scss +3 -0
- package/styles/signature/fabric.css +9 -0
- package/styles/signature/fabric.scss +3 -0
- package/styles/signature/highcontrast-light.css +9 -0
- package/styles/signature/highcontrast-light.scss +3 -0
- package/styles/signature/highcontrast.css +9 -0
- package/styles/signature/highcontrast.scss +3 -0
- package/styles/signature/material-dark.css +10 -0
- package/styles/signature/material-dark.scss +3 -0
- package/styles/signature/material.css +10 -0
- package/styles/signature/material.scss +3 -0
- package/styles/signature/tailwind-dark.css +10 -0
- package/styles/signature/tailwind-dark.scss +3 -0
- package/styles/signature/tailwind.css +10 -0
- package/styles/signature/tailwind.scss +3 -0
- package/styles/slider/_bootstrap5-definition.scss +2 -2
- package/styles/slider/_fluent-definition.scss +94 -0
- package/styles/slider/_layout.scss +7 -2
- package/styles/slider/_tailwind-definition.scss +2 -2
- package/styles/slider/bootstrap5-dark.css +1 -5
- package/styles/slider/bootstrap5.css +1 -5
- package/styles/slider/tailwind-dark.css +1 -5
- package/styles/slider/tailwind.css +1 -5
- package/styles/tailwind-dark.css +45 -21
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +45 -21
- package/styles/tailwind.scss +1 -0
- package/styles/textbox/_fluent-definition.scss +0 -0
- package/styles/uploader/_fluent-definition.scss +234 -0
- package/styles/uploader/_layout.scss +99 -8
- package/styles/uploader/_theme.scss +5 -2
- package/styles/uploader/icons/_fluent.scss +34 -0
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/input/input.js
CHANGED
|
@@ -192,7 +192,7 @@ export var Input;
|
|
|
192
192
|
if (args.floatLabelType === 'Auto') {
|
|
193
193
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
194
194
|
args.element.addEventListener('input', function (event) {
|
|
195
|
-
updateLabelState(args.element.value, floatLabelElement);
|
|
195
|
+
updateLabelState(args.element.value, floatLabelElement, args.element);
|
|
196
196
|
});
|
|
197
197
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
198
198
|
args.element.addEventListener('blur', function (event) {
|
|
@@ -242,7 +242,8 @@ export var Input;
|
|
|
242
242
|
addClass([button], CLASSNAMES.CLEARICONHIDE);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
function updateLabelState(value, label) {
|
|
245
|
+
function updateLabelState(value, label, element) {
|
|
246
|
+
if (element === void 0) { element = null; }
|
|
246
247
|
if (value) {
|
|
247
248
|
addClass([label], CLASSNAMES.LABELTOP);
|
|
248
249
|
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
|
|
@@ -250,10 +251,13 @@ export var Input;
|
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
253
|
else {
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
var isNotFocused = element != null ? element !== document.activeElement : true;
|
|
255
|
+
if (isNotFocused) {
|
|
256
|
+
if (label.classList.contains(CLASSNAMES.LABELTOP)) {
|
|
257
|
+
removeClass([label], CLASSNAMES.LABELTOP);
|
|
258
|
+
}
|
|
259
|
+
addClass([label], CLASSNAMES.LABELBOTTOM);
|
|
255
260
|
}
|
|
256
|
-
addClass([label], CLASSNAMES.LABELBOTTOM);
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
function getParentNode(element) {
|
|
@@ -322,7 +326,7 @@ export var Input;
|
|
|
322
326
|
var parent = getParentNode(element);
|
|
323
327
|
if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') {
|
|
324
328
|
var label = getParentNode(element).getElementsByClassName('e-float-text')[0];
|
|
325
|
-
updateLabelState(element.value, label);
|
|
329
|
+
updateLabelState(element.value, label, element);
|
|
326
330
|
}
|
|
327
331
|
}
|
|
328
332
|
/**
|
|
@@ -615,6 +615,10 @@ var NumericTextBox = /** @class */ (function (_super) {
|
|
|
615
615
|
}
|
|
616
616
|
_this.element.setSelectionRange(_this.element.selectionStart, _this.element.selectionStart);
|
|
617
617
|
}
|
|
618
|
+
if (_this.element.value[_this.element.selectionStart - 1] === decimalSeparator && _this.decimals === 0 && _this.validateDecimalOnType) {
|
|
619
|
+
_this.element.value = _this.element.value.substring(0, prevPos) +
|
|
620
|
+
_this.element.value.substring(currentPos, _this.element.value.length);
|
|
621
|
+
}
|
|
618
622
|
}
|
|
619
623
|
_this.prevVal = _this.element.value;
|
|
620
624
|
}
|
|
@@ -662,6 +666,11 @@ var NumericTextBox = /** @class */ (function (_super) {
|
|
|
662
666
|
if (this.isVue) {
|
|
663
667
|
var current = this.instance.getNumberParser({ format: 'n' })(this.element.value);
|
|
664
668
|
var previous = this.instance.getNumberParser({ format: 'n' })(this.elementPrevValue);
|
|
669
|
+
//EJ2-54963-if type "." or ".0" or "-.0" it converts to "0" automatically when binding v-model
|
|
670
|
+
var nonZeroRegex = new RegExp('[^1-9]+$');
|
|
671
|
+
if (nonZeroRegex.test(this.element.value)) {
|
|
672
|
+
current = this.value;
|
|
673
|
+
}
|
|
665
674
|
var eventArgs = {
|
|
666
675
|
event: event,
|
|
667
676
|
value: (current === null || isNaN(current) ? null : current),
|
|
@@ -979,6 +988,7 @@ var NumericTextBox = /** @class */ (function (_super) {
|
|
|
979
988
|
}
|
|
980
989
|
};
|
|
981
990
|
NumericTextBox.prototype.mouseUpOnSpinner = function (event) {
|
|
991
|
+
this.prevValue = this.value;
|
|
982
992
|
if (this.isPrevFocused) {
|
|
983
993
|
this.element.focus();
|
|
984
994
|
if (!Browser.isDevice) {
|
|
@@ -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,171 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
|
+
import { Event } from '@syncfusion/ej2-base';
|
|
21
|
+
import { NotifyPropertyChanges, Property, addClass } from '@syncfusion/ej2-base';
|
|
22
|
+
import { SignatureBase } from '../common/signature-base';
|
|
23
|
+
/**
|
|
24
|
+
* The Signature component allows user to draw smooth signatures as vector outline of strokes using variable width bezier curve interpolation.
|
|
25
|
+
* It allows to save signature as image.
|
|
26
|
+
* You can use your finger, pen, or mouse on a tablet, touchscreen, etc., to draw your own signature on this Signature component.
|
|
27
|
+
* Signature component is a user interface to draw the Signature or Text.
|
|
28
|
+
* It provides supports for various Background color, Stroke color and Background Image.
|
|
29
|
+
* ```html
|
|
30
|
+
* <canvas id="signature"></canvas>
|
|
31
|
+
* ```
|
|
32
|
+
* ```typescript
|
|
33
|
+
* <script>
|
|
34
|
+
* let signatureObj: Signature = new Signature(null , "#signature");
|
|
35
|
+
* </script>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
var Signature = /** @class */ (function (_super) {
|
|
39
|
+
__extends(Signature, _super);
|
|
40
|
+
/**
|
|
41
|
+
* Constructor for creating the widget.
|
|
42
|
+
*
|
|
43
|
+
* @param {SignatureModel} options - Specifies the Signature model.
|
|
44
|
+
* @param {string | HTMLCanvasElement} element - Specifies the element.
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
function Signature(options, element) {
|
|
48
|
+
return _super.call(this, options, element) || this;
|
|
49
|
+
}
|
|
50
|
+
Signature.prototype.preRender = function () {
|
|
51
|
+
// pre render code snippets
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* To Initialize the component rendering
|
|
55
|
+
*
|
|
56
|
+
* @private
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
Signature.prototype.render = function () {
|
|
60
|
+
this.initialize();
|
|
61
|
+
};
|
|
62
|
+
Signature.prototype.initialize = function () {
|
|
63
|
+
addClass([this.element], 'e-' + this.getModuleName());
|
|
64
|
+
_super.prototype.initialize.call(this, this.element);
|
|
65
|
+
if (this.enablePersistence) {
|
|
66
|
+
this.loadPersistedSignature();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* To get component name.
|
|
71
|
+
*
|
|
72
|
+
* @returns {string} - Module Name
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
Signature.prototype.getModuleName = function () {
|
|
76
|
+
return 'signature';
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* To get the properties to be maintained in the persisted state.
|
|
80
|
+
*
|
|
81
|
+
* @returns {string} - Persist data
|
|
82
|
+
*/
|
|
83
|
+
Signature.prototype.getPersistData = function () {
|
|
84
|
+
return this.addOnPersist(['signatureValue']);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Called internally if any of the property value changed.
|
|
88
|
+
*
|
|
89
|
+
* @param {SignatureModel} newProp - Specifies new properties
|
|
90
|
+
* @param {SignatureModel} oldProp - Specifies old properties
|
|
91
|
+
* @returns {void}
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
Signature.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
95
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
96
|
+
var prop = _a[_i];
|
|
97
|
+
switch (prop) {
|
|
98
|
+
case 'backgroundColor':
|
|
99
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.backgroundColor);
|
|
100
|
+
break;
|
|
101
|
+
case 'backgroundImage':
|
|
102
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.backgroundImage);
|
|
103
|
+
break;
|
|
104
|
+
case 'strokeColor':
|
|
105
|
+
if (newProp.strokeColor !== oldProp.strokeColor) {
|
|
106
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.strokeColor);
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
case 'saveWithBackground':
|
|
110
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.saveWithBackground);
|
|
111
|
+
break;
|
|
112
|
+
case 'isReadOnly':
|
|
113
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.isReadOnly);
|
|
114
|
+
break;
|
|
115
|
+
case 'disabled':
|
|
116
|
+
_super.prototype.propertyChanged.call(this, prop, newProp.disabled);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
__decorate([
|
|
122
|
+
Property('')
|
|
123
|
+
], Signature.prototype, "backgroundColor", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
Property('')
|
|
126
|
+
], Signature.prototype, "backgroundImage", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
Property(false)
|
|
129
|
+
], Signature.prototype, "disabled", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
Property(false)
|
|
132
|
+
], Signature.prototype, "isReadOnly", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
Property(true)
|
|
135
|
+
], Signature.prototype, "saveWithBackground", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
Property('#000000')
|
|
138
|
+
], Signature.prototype, "strokeColor", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
Property(0.5)
|
|
141
|
+
], Signature.prototype, "minStrokeWidth", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
Property(2)
|
|
144
|
+
], Signature.prototype, "maxStrokeWidth", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
Property(0.7)
|
|
147
|
+
], Signature.prototype, "velocity", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
Property('en-US')
|
|
150
|
+
], Signature.prototype, "locale", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
Property(false)
|
|
153
|
+
], Signature.prototype, "enableRtl", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
Property(false)
|
|
156
|
+
], Signature.prototype, "enablePersistence", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
Event()
|
|
159
|
+
], Signature.prototype, "beforeSave", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
Event()
|
|
162
|
+
], Signature.prototype, "change", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
Event()
|
|
165
|
+
], Signature.prototype, "created", void 0);
|
|
166
|
+
Signature = __decorate([
|
|
167
|
+
NotifyPropertyChanges
|
|
168
|
+
], Signature);
|
|
169
|
+
return Signature;
|
|
170
|
+
}(SignatureBase));
|
|
171
|
+
export { Signature };
|
package/src/slider/slider.d.ts
CHANGED
|
@@ -534,6 +534,7 @@ export declare class Slider extends Component<HTMLElement> implements INotifyPro
|
|
|
534
534
|
private repeatButton;
|
|
535
535
|
private repeatHandlerMouse;
|
|
536
536
|
private materialChange;
|
|
537
|
+
private focusHandle;
|
|
537
538
|
private repeatHandlerUp;
|
|
538
539
|
private customTickCounter;
|
|
539
540
|
private renderScale;
|
package/src/slider/slider.js
CHANGED
|
@@ -614,9 +614,11 @@ var Slider = /** @class */ (function (_super) {
|
|
|
614
614
|
this.sliderBarClick(e);
|
|
615
615
|
if (e.currentTarget === this.firstHandle) {
|
|
616
616
|
this.firstHandle.classList.add(classNames.sliderHandleFocused);
|
|
617
|
+
this.firstHandle.classList.add(classNames.sliderTabHandle);
|
|
617
618
|
}
|
|
618
619
|
else {
|
|
619
620
|
this.secondHandle.classList.add(classNames.sliderHandleFocused);
|
|
621
|
+
this.secondHandle.classList.add(classNames.sliderTabHandle);
|
|
620
622
|
}
|
|
621
623
|
EventHandler.add(document, 'mousemove touchmove', this.sliderBarMove, this);
|
|
622
624
|
EventHandler.add(document, 'mouseup touchend', this.sliderBarUp, this);
|
|
@@ -1030,6 +1032,11 @@ var Slider = /** @class */ (function (_super) {
|
|
|
1030
1032
|
this.getHandle().classList.add('e-large-thumb-size');
|
|
1031
1033
|
}
|
|
1032
1034
|
};
|
|
1035
|
+
Slider.prototype.focusHandle = function () {
|
|
1036
|
+
if (!this.getHandle().classList.contains(classNames.sliderTabHandle)) {
|
|
1037
|
+
this.getHandle().classList.add(classNames.sliderTabHandle);
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1033
1040
|
Slider.prototype.repeatHandlerUp = function (e) {
|
|
1034
1041
|
this.changeEvent('changed', e);
|
|
1035
1042
|
this.closeTooltip();
|
|
@@ -1427,6 +1434,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
1427
1434
|
}
|
|
1428
1435
|
this.tooltipToggle(this.getHandle());
|
|
1429
1436
|
this.getHandle().focus();
|
|
1437
|
+
this.focusHandle();
|
|
1430
1438
|
if (args.currentTarget.classList.contains(classNames.firstButton)) {
|
|
1431
1439
|
EventHandler.add(this.firstBtn, 'mouseup touchend', this.buttonUp, this);
|
|
1432
1440
|
}
|
|
@@ -2371,6 +2379,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
2371
2379
|
event.preventDefault();
|
|
2372
2380
|
this.focusSliderElement();
|
|
2373
2381
|
this.sliderBarClick(event);
|
|
2382
|
+
this.focusHandle();
|
|
2374
2383
|
};
|
|
2375
2384
|
Slider.prototype.wireEvents = function () {
|
|
2376
2385
|
this.onresize = this.reposition.bind(this);
|