@syncfusion/ej2-inputs 19.3.47 → 19.4.38

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.
Files changed (150) hide show
  1. package/.eslintrc.json +244 -0
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +1 -1
  4. package/common.d.ts +4 -0
  5. package/common.js +4 -0
  6. package/dist/ej2-inputs.umd.min.js +2 -2
  7. package/dist/ej2-inputs.umd.min.js.map +1 -1
  8. package/dist/es6/ej2-inputs.es2015.js +1124 -12
  9. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  10. package/dist/es6/ej2-inputs.es5.js +1158 -11
  11. package/dist/es6/ej2-inputs.es5.js.map +1 -1
  12. package/dist/global/ej2-inputs.min.js +2 -2
  13. package/dist/global/ej2-inputs.min.js.map +1 -1
  14. package/dist/global/index.d.ts +1 -1
  15. package/package.json +9 -9
  16. package/signature.d.ts +4 -0
  17. package/signature.js +4 -0
  18. package/src/color-picker/color-picker-model.d.ts +7 -0
  19. package/src/color-picker/color-picker.d.ts +6 -0
  20. package/src/color-picker/color-picker.js +10 -1
  21. package/src/common/index.d.ts +4 -0
  22. package/src/common/index.js +4 -0
  23. package/src/common/signature-base.d.ts +320 -0
  24. package/src/common/signature-base.js +946 -0
  25. package/src/index.d.ts +2 -0
  26. package/src/index.js +2 -0
  27. package/src/input/input.js +10 -6
  28. package/src/maskedtextbox/base/mask-base.js +1 -1
  29. package/src/numerictextbox/numerictextbox.js +6 -1
  30. package/src/signature/index.d.ts +5 -0
  31. package/src/signature/index.js +4 -0
  32. package/src/signature/signature-model.d.ts +131 -0
  33. package/src/signature/signature.d.ts +167 -0
  34. package/src/signature/signature.js +171 -0
  35. package/src/slider/slider.d.ts +1 -0
  36. package/src/slider/slider.js +9 -0
  37. package/src/textbox/textbox.js +1 -1
  38. package/styles/bootstrap-dark.css +23 -16
  39. package/styles/bootstrap-dark.scss +1 -0
  40. package/styles/bootstrap.css +23 -16
  41. package/styles/bootstrap.scss +1 -0
  42. package/styles/bootstrap4.css +23 -16
  43. package/styles/bootstrap4.scss +1 -0
  44. package/styles/bootstrap5-dark.css +27 -42
  45. package/styles/bootstrap5-dark.scss +1 -0
  46. package/styles/bootstrap5.css +27 -42
  47. package/styles/bootstrap5.scss +1 -0
  48. package/styles/color-picker/_fabric-dark-definition.scss +1 -1
  49. package/styles/color-picker/_fluent-definition.scss +134 -0
  50. package/styles/color-picker/_layout.scss +5 -5
  51. package/styles/color-picker/_theme.scss +1 -15
  52. package/styles/color-picker/bootstrap5-dark.css +3 -21
  53. package/styles/color-picker/bootstrap5.css +3 -21
  54. package/styles/color-picker/fabric-dark.css +3 -3
  55. package/styles/color-picker/icons/_fluent.scss +10 -0
  56. package/styles/fabric-dark.css +26 -19
  57. package/styles/fabric-dark.scss +1 -0
  58. package/styles/fabric.css +23 -16
  59. package/styles/fabric.scss +1 -0
  60. package/styles/highcontrast-light.css +23 -16
  61. package/styles/highcontrast-light.scss +1 -0
  62. package/styles/highcontrast.css +23 -16
  63. package/styles/highcontrast.scss +1 -0
  64. package/styles/input/_fluent-definition.scss +321 -0
  65. package/styles/input/_layout.scss +138 -37
  66. package/styles/input/_theme.scss +42 -24
  67. package/styles/input/bootstrap-dark.css +13 -16
  68. package/styles/input/bootstrap.css +13 -16
  69. package/styles/input/bootstrap4.css +13 -16
  70. package/styles/input/bootstrap5-dark.css +13 -16
  71. package/styles/input/bootstrap5.css +13 -16
  72. package/styles/input/fabric-dark.css +13 -16
  73. package/styles/input/fabric.css +13 -16
  74. package/styles/input/highcontrast-light.css +13 -16
  75. package/styles/input/highcontrast.css +13 -16
  76. package/styles/input/icons/_fluent.scss +17 -0
  77. package/styles/input/material-dark.css +13 -16
  78. package/styles/input/material.css +13 -16
  79. package/styles/input/tailwind-dark.css +13 -16
  80. package/styles/input/tailwind.css +13 -16
  81. package/styles/maskedtextbox/_fluent-definition.scss +7 -0
  82. package/styles/maskedtextbox/_theme.scss +2 -2
  83. package/styles/material-dark.css +23 -16
  84. package/styles/material-dark.scss +1 -0
  85. package/styles/material.css +23 -16
  86. package/styles/material.scss +1 -0
  87. package/styles/numerictextbox/_fluent-definition.scss +5 -0
  88. package/styles/numerictextbox/_theme.scss +18 -0
  89. package/styles/numerictextbox/icons/_fluent.scss +12 -0
  90. package/styles/signature/_all.scss +2 -0
  91. package/styles/signature/_bootstrap-dark-definition.scss +3 -0
  92. package/styles/signature/_bootstrap-definition.scss +3 -0
  93. package/styles/signature/_bootstrap4-definition.scss +3 -0
  94. package/styles/signature/_bootstrap5-dark-definition.scss +1 -0
  95. package/styles/signature/_bootstrap5-definition.scss +3 -0
  96. package/styles/signature/_fabric-dark-definition.scss +3 -0
  97. package/styles/signature/_fabric-definition.scss +3 -0
  98. package/styles/signature/_fluent-definition.scss +3 -0
  99. package/styles/signature/_highcontrast-definition.scss +3 -0
  100. package/styles/signature/_highcontrast-light-definition.scss +3 -0
  101. package/styles/signature/_layout.scss +5 -0
  102. package/styles/signature/_material-dark-definition.scss +3 -0
  103. package/styles/signature/_material-definition.scss +3 -0
  104. package/styles/signature/_tailwind-dark-definition.scss +1 -0
  105. package/styles/signature/_tailwind-definition.scss +3 -0
  106. package/styles/signature/_theme.scss +7 -0
  107. package/styles/signature/bootstrap-dark.css +9 -0
  108. package/styles/signature/bootstrap-dark.scss +3 -0
  109. package/styles/signature/bootstrap.css +9 -0
  110. package/styles/signature/bootstrap.scss +3 -0
  111. package/styles/signature/bootstrap4.css +9 -0
  112. package/styles/signature/bootstrap4.scss +3 -0
  113. package/styles/signature/bootstrap5-dark.css +9 -0
  114. package/styles/signature/bootstrap5-dark.scss +3 -0
  115. package/styles/signature/bootstrap5.css +9 -0
  116. package/styles/signature/bootstrap5.scss +3 -0
  117. package/styles/signature/fabric-dark.css +9 -0
  118. package/styles/signature/fabric-dark.scss +3 -0
  119. package/styles/signature/fabric.css +9 -0
  120. package/styles/signature/fabric.scss +3 -0
  121. package/styles/signature/highcontrast-light.css +9 -0
  122. package/styles/signature/highcontrast-light.scss +3 -0
  123. package/styles/signature/highcontrast.css +9 -0
  124. package/styles/signature/highcontrast.scss +3 -0
  125. package/styles/signature/material-dark.css +10 -0
  126. package/styles/signature/material-dark.scss +3 -0
  127. package/styles/signature/material.css +10 -0
  128. package/styles/signature/material.scss +3 -0
  129. package/styles/signature/tailwind-dark.css +10 -0
  130. package/styles/signature/tailwind-dark.scss +3 -0
  131. package/styles/signature/tailwind.css +10 -0
  132. package/styles/signature/tailwind.scss +3 -0
  133. package/styles/slider/_bootstrap5-definition.scss +2 -2
  134. package/styles/slider/_fluent-definition.scss +94 -0
  135. package/styles/slider/_layout.scss +7 -2
  136. package/styles/slider/_tailwind-definition.scss +2 -2
  137. package/styles/slider/bootstrap5-dark.css +1 -5
  138. package/styles/slider/bootstrap5.css +1 -5
  139. package/styles/slider/tailwind-dark.css +1 -5
  140. package/styles/slider/tailwind.css +1 -5
  141. package/styles/tailwind-dark.css +25 -21
  142. package/styles/tailwind-dark.scss +1 -0
  143. package/styles/tailwind.css +25 -21
  144. package/styles/tailwind.scss +1 -0
  145. package/styles/textbox/_fluent-definition.scss +0 -0
  146. package/styles/uploader/_fluent-definition.scss +234 -0
  147. package/styles/uploader/_layout.scss +99 -8
  148. package/styles/uploader/_theme.scss +5 -2
  149. package/styles/uploader/icons/_fluent.scss +34 -0
  150. package/tslint.json +111 -0
package/src/index.d.ts CHANGED
@@ -9,3 +9,5 @@ export * from './form-validator/index';
9
9
  export * from './uploader/index';
10
10
  export * from './color-picker/index';
11
11
  export * from './textbox/index';
12
+ export * from './signature/index';
13
+ export * from './common/index';
package/src/index.js CHANGED
@@ -9,3 +9,5 @@ export * from './form-validator/index';
9
9
  export * from './uploader/index';
10
10
  export * from './color-picker/index';
11
11
  export * from './textbox/index';
12
+ export * from './signature/index';
13
+ export * from './common/index';
@@ -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
- if (label.classList.contains(CLASSNAMES.LABELTOP)) {
254
- removeClass([label], CLASSNAMES.LABELTOP);
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
  /**
@@ -180,7 +180,7 @@ export function bindClearEvent() {
180
180
  }
181
181
  function resetHandler(e) {
182
182
  e.preventDefault();
183
- if (!this.inputObj.clearButton.classList.contains('e-clear-icon-hide')) {
183
+ if (!this.inputObj.clearButton.classList.contains('e-clear-icon-hide') || (this.inputObj.container.classList.contains('e-static-clear'))) {
184
184
  clear.call(this, e);
185
185
  this.value = '';
186
186
  }
@@ -416,7 +416,7 @@ var NumericTextBox = /** @class */ (function (_super) {
416
416
  };
417
417
  NumericTextBox.prototype.resetHandler = function (e) {
418
418
  e.preventDefault();
419
- if (!(this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide'))) {
419
+ if (!(this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) || this.inputWrapper.container.classList.contains('e-static-clear')) {
420
420
  this.clear(e);
421
421
  }
422
422
  this.isInteract = true;
@@ -662,6 +662,11 @@ var NumericTextBox = /** @class */ (function (_super) {
662
662
  if (this.isVue) {
663
663
  var current = this.instance.getNumberParser({ format: 'n' })(this.element.value);
664
664
  var previous = this.instance.getNumberParser({ format: 'n' })(this.elementPrevValue);
665
+ //EJ2-54963-if type "." or ".0" or "-.0" it converts to "0" automatically when binding v-model
666
+ var nonZeroRegex = new RegExp('[^1-9]+$');
667
+ if (nonZeroRegex.test(this.element.value)) {
668
+ current = this.value;
669
+ }
665
670
  var eventArgs = {
666
671
  event: event,
667
672
  value: (current === null || isNaN(current) ? null : current),
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Signature modules
3
+ */
4
+ export * from './signature';
5
+ export * from './signature-model';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Signature modules
3
+ */
4
+ export * from './signature';
@@ -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 };
@@ -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;
@@ -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);
@@ -503,7 +503,7 @@ var TextBox = /** @class */ (function (_super) {
503
503
  };
504
504
  TextBox.prototype.resetInputHandler = function (event) {
505
505
  event.preventDefault();
506
- if (!(this.textboxWrapper.clearButton.classList.contains(HIDE_CLEAR))) {
506
+ if (!(this.textboxWrapper.clearButton.classList.contains(HIDE_CLEAR)) || this.textboxWrapper.container.classList.contains('e-static-clear')) {
507
507
  Input.setValue('', this.respectiveElement, this.floatLabelType, this.showClearButton);
508
508
  if (this.isHiddenInput) {
509
509
  this.element.value = this.respectiveElement.value;