@progress/kendo-angular-inputs 21.4.1 → 22.0.0

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 (189) hide show
  1. package/colorpicker/localization/messages.d.ts +1 -1
  2. package/common/radio-checkbox.base.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-inputs.mjs +321 -321
  4. package/numerictextbox/localization/messages.d.ts +1 -1
  5. package/otpinput/localization/messages.d.ts +1 -1
  6. package/package.json +17 -25
  7. package/rangeslider/localization/messages.d.ts +1 -1
  8. package/signature/localization/messages.d.ts +1 -1
  9. package/slider/localization/messages.d.ts +1 -1
  10. package/sliders-common/slider-base.d.ts +1 -1
  11. package/switch/localization/messages.d.ts +1 -1
  12. package/text-fields-common/text-fields-base.d.ts +1 -1
  13. package/textbox/localization/messages.d.ts +1 -1
  14. package/esm2022/checkbox/checkbox.component.mjs +0 -227
  15. package/esm2022/checkbox/checkbox.directive.mjs +0 -96
  16. package/esm2022/checkbox/checked-state.mjs +0 -5
  17. package/esm2022/checkbox.module.mjs +0 -42
  18. package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
  19. package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -219
  20. package/esm2022/colorpicker/color-contrast-svg.component.mjs +0 -108
  21. package/esm2022/colorpicker/color-gradient-numeric-label.directive.mjs +0 -37
  22. package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
  23. package/esm2022/colorpicker/color-gradient.component.mjs +0 -1110
  24. package/esm2022/colorpicker/color-input.component.mjs +0 -498
  25. package/esm2022/colorpicker/color-palette.component.mjs +0 -629
  26. package/esm2022/colorpicker/colorpicker.component.mjs +0 -1315
  27. package/esm2022/colorpicker/constants.mjs +0 -40
  28. package/esm2022/colorpicker/contrast-validation.component.mjs +0 -83
  29. package/esm2022/colorpicker/contrast.component.mjs +0 -114
  30. package/esm2022/colorpicker/events/active-color-click-event.mjs +0 -55
  31. package/esm2022/colorpicker/events/cancel-event.mjs +0 -18
  32. package/esm2022/colorpicker/events/close-event.mjs +0 -10
  33. package/esm2022/colorpicker/events/kendo-drag-event.mjs +0 -5
  34. package/esm2022/colorpicker/events/open-event.mjs +0 -10
  35. package/esm2022/colorpicker/events.mjs +0 -8
  36. package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +0 -112
  37. package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +0 -244
  38. package/esm2022/colorpicker/flatcolorpicker.component.mjs +0 -942
  39. package/esm2022/colorpicker/localization/colorgradient-localization.service.mjs +0 -46
  40. package/esm2022/colorpicker/localization/colorpalette-localization.service.mjs +0 -46
  41. package/esm2022/colorpicker/localization/colorpicker-localization.service.mjs +0 -31
  42. package/esm2022/colorpicker/localization/custom-messages.component.mjs +0 -51
  43. package/esm2022/colorpicker/localization/flatcolorpicker-localization.service.mjs +0 -46
  44. package/esm2022/colorpicker/localization/localized-colorpicker-messages.directive.mjs +0 -39
  45. package/esm2022/colorpicker/localization/messages.mjs +0 -201
  46. package/esm2022/colorpicker/models/actions-layout.mjs +0 -5
  47. package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -8
  48. package/esm2022/colorpicker/models/colorpicker-view.mjs +0 -5
  49. package/esm2022/colorpicker/models/gradient-settings.mjs +0 -5
  50. package/esm2022/colorpicker/models/hsva.mjs +0 -5
  51. package/esm2022/colorpicker/models/output-format.mjs +0 -5
  52. package/esm2022/colorpicker/models/palette-presets.mjs +0 -62
  53. package/esm2022/colorpicker/models/palette-settings.mjs +0 -5
  54. package/esm2022/colorpicker/models/popup-settings.mjs +0 -5
  55. package/esm2022/colorpicker/models/rgb.mjs +0 -5
  56. package/esm2022/colorpicker/models/rgba.mjs +0 -5
  57. package/esm2022/colorpicker/models/table-cell.mjs +0 -5
  58. package/esm2022/colorpicker/models/tile-size.mjs +0 -5
  59. package/esm2022/colorpicker/models.mjs +0 -16
  60. package/esm2022/colorpicker/services/color-palette.service.mjs +0 -65
  61. package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +0 -39
  62. package/esm2022/colorpicker/utils/color-parser.mjs +0 -164
  63. package/esm2022/colorpicker/utils/contrast-curve.mjs +0 -85
  64. package/esm2022/colorpicker/utils.mjs +0 -6
  65. package/esm2022/colorpicker.module.mjs +0 -50
  66. package/esm2022/common/dom-utils.mjs +0 -36
  67. package/esm2022/common/formservice.service.mjs +0 -21
  68. package/esm2022/common/math.mjs +0 -65
  69. package/esm2022/common/models/fillmode.mjs +0 -5
  70. package/esm2022/common/models/gutters.mjs +0 -5
  71. package/esm2022/common/models/responsive-breakpoints.mjs +0 -5
  72. package/esm2022/common/models/rounded.mjs +0 -5
  73. package/esm2022/common/models/size.mjs +0 -5
  74. package/esm2022/common/models/styling-classes.mjs +0 -5
  75. package/esm2022/common/models/type.mjs +0 -5
  76. package/esm2022/common/models.mjs +0 -9
  77. package/esm2022/common/radio-checkbox.base.mjs +0 -295
  78. package/esm2022/common/utils.mjs +0 -88
  79. package/esm2022/directives.mjs +0 -430
  80. package/esm2022/form/form.component.mjs +0 -163
  81. package/esm2022/form/formseparator.component.mjs +0 -80
  82. package/esm2022/form/utils.mjs +0 -147
  83. package/esm2022/form.module.mjs +0 -46
  84. package/esm2022/formfield/error.component.mjs +0 -70
  85. package/esm2022/formfield/formfield.component.mjs +0 -353
  86. package/esm2022/formfield/hint.component.mjs +0 -65
  87. package/esm2022/formfield/models/message-align.mjs +0 -5
  88. package/esm2022/formfield/models/orientation.mjs +0 -5
  89. package/esm2022/formfield/models/show-options.mjs +0 -5
  90. package/esm2022/formfield.module.mjs +0 -43
  91. package/esm2022/formfieldset/formfieldset.component.mjs +0 -174
  92. package/esm2022/index.mjs +0 -91
  93. package/esm2022/inputs.module.mjs +0 -91
  94. package/esm2022/maskedtextbox/maskedtextbox.component.mjs +0 -876
  95. package/esm2022/maskedtextbox/masking.service.mjs +0 -189
  96. package/esm2022/maskedtextbox/parsing/combinators.mjs +0 -28
  97. package/esm2022/maskedtextbox/parsing/parsers.mjs +0 -148
  98. package/esm2022/maskedtextbox/parsing/result.mjs +0 -44
  99. package/esm2022/maskedtextbox/parsing/stream.mjs +0 -43
  100. package/esm2022/maskedtextbox.module.mjs +0 -43
  101. package/esm2022/numerictextbox/arrow-direction.mjs +0 -13
  102. package/esm2022/numerictextbox/constants.mjs +0 -28
  103. package/esm2022/numerictextbox/localization/custom-messages.component.mjs +0 -55
  104. package/esm2022/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +0 -39
  105. package/esm2022/numerictextbox/localization/messages.mjs +0 -33
  106. package/esm2022/numerictextbox/numerictextbox.component.mjs +0 -1314
  107. package/esm2022/numerictextbox/utils.mjs +0 -92
  108. package/esm2022/numerictextbox.module.mjs +0 -46
  109. package/esm2022/otp.module.mjs +0 -44
  110. package/esm2022/otpinput/localization/custom-messages.component.mjs +0 -45
  111. package/esm2022/otpinput/localization/localized-textbox-messages.directive.mjs +0 -39
  112. package/esm2022/otpinput/localization/messages.mjs +0 -34
  113. package/esm2022/otpinput/models/otpinput-type.mjs +0 -5
  114. package/esm2022/otpinput/models/separator-icon.mjs +0 -5
  115. package/esm2022/otpinput/otpinput-separator.component.mjs +0 -93
  116. package/esm2022/otpinput/otpinput.component.mjs +0 -936
  117. package/esm2022/package-metadata.mjs +0 -16
  118. package/esm2022/progress-kendo-angular-inputs.mjs +0 -8
  119. package/esm2022/radiobutton/radiobutton.component.mjs +0 -212
  120. package/esm2022/radiobutton/radiobutton.directive.mjs +0 -81
  121. package/esm2022/radiobutton.module.mjs +0 -43
  122. package/esm2022/rangeslider/localization/custom-messages.component.mjs +0 -53
  123. package/esm2022/rangeslider/localization/localized-rangeslider-messages.directive.mjs +0 -39
  124. package/esm2022/rangeslider/localization/messages.mjs +0 -33
  125. package/esm2022/rangeslider/rangeslider-model.mjs +0 -53
  126. package/esm2022/rangeslider/rangeslider-value.type.mjs +0 -5
  127. package/esm2022/rangeslider/rangeslider.component.mjs +0 -625
  128. package/esm2022/rangeslider.module.mjs +0 -46
  129. package/esm2022/rating/directives/rating-hovered-item.directive.mjs +0 -35
  130. package/esm2022/rating/directives/rating-item.directive.mjs +0 -34
  131. package/esm2022/rating/directives/rating-selected-item.directive.mjs +0 -36
  132. package/esm2022/rating/models/precision.mjs +0 -5
  133. package/esm2022/rating/models/rating-item.interface.mjs +0 -5
  134. package/esm2022/rating/models/selection.mjs +0 -5
  135. package/esm2022/rating/rating.component.mjs +0 -754
  136. package/esm2022/rating.module.mjs +0 -46
  137. package/esm2022/shared/input-separator.component.mjs +0 -55
  138. package/esm2022/shared/input-spacer.component.mjs +0 -56
  139. package/esm2022/shared/shared-events.directive.mjs +0 -102
  140. package/esm2022/shared/utils.mjs +0 -13
  141. package/esm2022/signature/events/close-event.mjs +0 -10
  142. package/esm2022/signature/events/index.mjs +0 -6
  143. package/esm2022/signature/events/open-event.mjs +0 -10
  144. package/esm2022/signature/localization/custom-messages.component.mjs +0 -43
  145. package/esm2022/signature/localization/index.mjs +0 -7
  146. package/esm2022/signature/localization/localized-signature-messages.directive.mjs +0 -39
  147. package/esm2022/signature/localization/messages.mjs +0 -45
  148. package/esm2022/signature/signature.component.mjs +0 -981
  149. package/esm2022/signature.module.mjs +0 -47
  150. package/esm2022/slider/localization/custom-messages.component.mjs +0 -43
  151. package/esm2022/slider/localization/localized-slider-messages.directive.mjs +0 -39
  152. package/esm2022/slider/localization/messages.mjs +0 -39
  153. package/esm2022/slider/slider-model.mjs +0 -32
  154. package/esm2022/slider/slider.component.mjs +0 -671
  155. package/esm2022/slider.module.mjs +0 -48
  156. package/esm2022/sliders-common/label-template.directive.mjs +0 -37
  157. package/esm2022/sliders-common/slider-base.mjs +0 -300
  158. package/esm2022/sliders-common/slider-model.base.mjs +0 -118
  159. package/esm2022/sliders-common/slider-ticks.component.mjs +0 -147
  160. package/esm2022/sliders-common/sliders-util.mjs +0 -206
  161. package/esm2022/sliders-common/title-callback.mjs +0 -5
  162. package/esm2022/switch/events/blur-event.mjs +0 -13
  163. package/esm2022/switch/events/focus-event.mjs +0 -13
  164. package/esm2022/switch/localization/custom-messages.component.mjs +0 -43
  165. package/esm2022/switch/localization/localized-switch-messages.directive.mjs +0 -39
  166. package/esm2022/switch/localization/messages.mjs +0 -33
  167. package/esm2022/switch/switch.component.mjs +0 -585
  168. package/esm2022/switch.module.mjs +0 -44
  169. package/esm2022/text-fields-common/text-fields-base.mjs +0 -150
  170. package/esm2022/textarea/models/adornments-orientation.mjs +0 -5
  171. package/esm2022/textarea/models/flow.mjs +0 -5
  172. package/esm2022/textarea/models/resize.mjs +0 -5
  173. package/esm2022/textarea/models/textarea-settings.mjs +0 -5
  174. package/esm2022/textarea/textarea-prefix.component.mjs +0 -67
  175. package/esm2022/textarea/textarea-suffix.component.mjs +0 -67
  176. package/esm2022/textarea/textarea.component.mjs +0 -740
  177. package/esm2022/textarea/textarea.directive.mjs +0 -288
  178. package/esm2022/textarea.module.mjs +0 -46
  179. package/esm2022/textbox/localization/custom-messages.component.mjs +0 -43
  180. package/esm2022/textbox/localization/localized-textbox-messages.directive.mjs +0 -39
  181. package/esm2022/textbox/localization/messages.mjs +0 -27
  182. package/esm2022/textbox/models/icon-show-options.mjs +0 -5
  183. package/esm2022/textbox/textbox-prefix.directive.mjs +0 -50
  184. package/esm2022/textbox/textbox-suffix.directive.mjs +0 -49
  185. package/esm2022/textbox/textbox.component.mjs +0 -933
  186. package/esm2022/textbox/textbox.directive.mjs +0 -125
  187. package/esm2022/textbox.module.mjs +0 -51
  188. package/esm2022/validators/max.validator.mjs +0 -21
  189. package/esm2022/validators/min.validator.mjs +0 -21
@@ -1,981 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /* eslint-disable @typescript-eslint/no-explicit-any */
6
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, HostBinding, Input, NgZone, Output, Renderer2, ViewChild } from '@angular/core';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { anyChanged, closest, isDocumentAvailable, Keys } from '@progress/kendo-angular-common';
9
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
10
- import { SignaturePad } from '@progress/kendo-inputs-common';
11
- import { validatePackage } from '@progress/kendo-licensing';
12
- import { isNone, isPresent, ROUNDED_MAP, SIZE_MAP } from '../common/utils';
13
- import { packageMetadata } from '../package-metadata';
14
- import { SignatureCloseEvent, SignatureOpenEvent } from './events';
15
- import { xIcon, hyperlinkOpenIcon } from '@progress/kendo-svg-icons';
16
- import { take } from 'rxjs/operators';
17
- import { LocalizedSignatureMessagesDirective } from './localization/localized-signature-messages.directive';
18
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
19
- import { DialogComponent } from '@progress/kendo-angular-dialog';
20
- import * as i0 from "@angular/core";
21
- import * as i1 from "@progress/kendo-angular-l10n";
22
- const noop = () => { };
23
- let _id = 0;
24
- const nextId = () => 'k-signature-focusable-' + _id++;
25
- const FOCUSED_CLASS = 'k-focus';
26
- const DEFAULT_SIZE = 'medium';
27
- const DEFAULT_ROUNDED = 'medium';
28
- const DEFAULT_FILL_MODE = 'solid';
29
- const DEFAULT_POPUP_SCALE = 3;
30
- const DEFAULT_EXPORT_SCALE = 2;
31
- const DEFAULT_COLOR = '#000000';
32
- const DEFAULT_BACKGROUND_COLOR = '#ffffff';
33
- const iconsMap = { xIcon, hyperlinkOpenIcon };
34
- /**
35
- * Represents the [Kendo UI Signature component for Angular]({% slug overview_signature %}).
36
- *
37
- * Use the Signature to let users add a hand-drawn signature to forms.
38
- *
39
- * @example
40
- * ```html
41
- * <kendo-signature [(ngModel)]="signatureValue"></kendo-signature>
42
- * ```
43
- *
44
- * @remarks
45
- * Supported children components are: {@link SignatureCustomMessagesComponent}.
46
- */
47
- export class SignatureComponent {
48
- element;
49
- renderer;
50
- ngZone;
51
- cd;
52
- localization;
53
- cdr;
54
- staticHostClasses = true;
55
- /**
56
- * @hidden
57
- */
58
- focusableId = nextId();
59
- direction;
60
- /**
61
- * Sets the read-only state of the Signature.
62
- *
63
- * Set to `true` to prevent editing.
64
- *
65
- * @default false
66
- */
67
- readonly = false;
68
- /**
69
- * Sets the disabled state of the Signature.
70
- *
71
- * Set to `true` to disable the component and prevent any user interaction.
72
- * To disable the component in reactive forms, see [Managing the Signature Disabled State in Reactive Forms](slug:formssupport_signature#toc-managing-the-signature-disabled-state-in-reactive-forms).
73
- *
74
- * @default false
75
- */
76
- disabled = false;
77
- /**
78
- * Sets the width of the Signature in pixels.
79
- *
80
- * You can also set the width using inline styles or CSS.
81
- */
82
- width;
83
- /**
84
- * Sets the height of the Signature in pixels.
85
- *
86
- * You can also set the height using inline styles or CSS.
87
- */
88
- height;
89
- /**
90
- * Gets or sets the value of the Signature.
91
- *
92
- * The value is a Base64-encoded PNG image.
93
- */
94
- set value(value) {
95
- if (value !== this._value) {
96
- this._value = value;
97
- if (this.instance) {
98
- this.instance.loadImage(value);
99
- }
100
- }
101
- }
102
- get value() {
103
- return this._value;
104
- }
105
- /**
106
- * @hidden
107
- */
108
- svgIcon(name) {
109
- return iconsMap[name];
110
- }
111
- /**
112
- * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
113
- *
114
- * @default 0
115
- */
116
- set tabindex(value) {
117
- const tabindex = Number(value);
118
- const defaultValue = 0;
119
- this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
120
- }
121
- get tabindex() {
122
- return !this.disabled ? this._tabindex : undefined;
123
- }
124
- /**
125
- * Sets the padding of the Signature internal controls
126
- * ([ee example]({% slug appearance_signature %}#toc-size)).
127
- *
128
- * @default 'medium'
129
- */
130
- size = DEFAULT_SIZE;
131
- /**
132
- * Sets the border radius of the Signature
133
- * ([see example](slug:appearance_signature#rounded-corners)).
134
- *
135
- * @default 'medium'
136
- */
137
- rounded = DEFAULT_ROUNDED;
138
- /**
139
- * Sets the background and border styles of the Signature
140
- * ([see example](slug:appearance_signature#toc-fill-mode)).
141
- *
142
- * @default 'solid'
143
- */
144
- fillMode = DEFAULT_FILL_MODE;
145
- /**
146
- * Sets the stroke color of the Signature.
147
- *
148
- * Accepts CSS color names and hex values.
149
- * The default value is determined by the theme `$kendo-input-text` variable.
150
- */
151
- color;
152
- /**
153
- * Sets the background color of the Signature.
154
- *
155
- * Accepts CSS color names and hex values.
156
- * The default value is determined by the theme `$kendo-input-bg` variable.
157
- */
158
- backgroundColor;
159
- /**
160
- * Sets the stroke width of the Signature.
161
- *
162
- * @default 1
163
- */
164
- strokeWidth = 1;
165
- /**
166
- * When set to `true`, smooths out signature lines.
167
- *
168
- * @default false
169
- */
170
- smooth = false;
171
- /**
172
- * When set to `true`, allows the Signature to be maximized.
173
- *
174
- * @default true
175
- */
176
- maximizable = true;
177
- /**
178
- * @hidden
179
- */
180
- maximized = false;
181
- /**
182
- * Sets the scale factor for the popup.
183
- *
184
- * The Signature width and height are multiplied by this value when showing the popup.
185
- *
186
- * @default 3
187
- */
188
- popupScale = DEFAULT_POPUP_SCALE;
189
- /**
190
- * Sets the scale factor for the exported image.
191
- *
192
- * The Signature width and height are multiplied by this value when converting the signature to an image.
193
- *
194
- * @default 2
195
- */
196
- exportScale = DEFAULT_EXPORT_SCALE;
197
- /**
198
- * @hidden
199
- */
200
- parentLocalization;
201
- /**
202
- * When set to `true`, hides the dotted line in the background.
203
- *
204
- * @default false
205
- */
206
- hideLine = false;
207
- /**
208
- * Fires when the signature value changes.
209
- */
210
- valueChange = new EventEmitter();
211
- /**
212
- * Fires before the popup opens.
213
- *
214
- * This event is preventable. If you cancel it, the popup stays closed.
215
- */
216
- open = new EventEmitter();
217
- /**
218
- * Fires before the popup closes.
219
- *
220
- * This event is preventable. If you cancel it, the popup stays open.
221
- */
222
- close = new EventEmitter();
223
- /**
224
- * Fires when the Signature receives focus.
225
- */
226
- onFocus = new EventEmitter();
227
- /**
228
- * Fires when the Signature loses focus.
229
- */
230
- onBlur = new EventEmitter();
231
- /**
232
- * @hidden
233
- */
234
- minimize = new EventEmitter();
235
- canvas;
236
- minimizeButton;
237
- maximizeButton;
238
- /**
239
- * Indicates if the Signature wrapper is focused.
240
- */
241
- isFocused = false;
242
- /**
243
- * Indicates if the Signature popup is open.
244
- */
245
- isOpen;
246
- /**
247
- * @hidden
248
- */
249
- get isEmpty() {
250
- return !this.value;
251
- }
252
- /**
253
- * @hidden
254
- */
255
- get canvasLabel() {
256
- return this.getMessage('canvasLabel');
257
- }
258
- /**
259
- * @hidden
260
- */
261
- get clearTitle() {
262
- return this.getMessage('clear');
263
- }
264
- /**
265
- * @hidden
266
- */
267
- get minimizeTitle() {
268
- return this.getMessage('minimize');
269
- }
270
- /**
271
- * @hidden
272
- */
273
- get maximizeTitle() {
274
- return this.getMessage('maximize');
275
- }
276
- /**
277
- * @hidden
278
- */
279
- get baseWidth() {
280
- return this.width || this.element.nativeElement.offsetWidth;
281
- }
282
- /**
283
- * @hidden
284
- */
285
- get baseHeight() {
286
- return this.height || this.element.nativeElement.offsetHeight;
287
- }
288
- /**
289
- * @hidden
290
- */
291
- get popupWidth() {
292
- return this.baseWidth * this.popupScale;
293
- }
294
- /**
295
- * @hidden
296
- */
297
- get popupHeight() {
298
- return this.baseHeight * this.popupScale;
299
- }
300
- /**
301
- * @hidden
302
- */
303
- isDrawing = false;
304
- /**
305
- * @hidden
306
- */
307
- get showMaximize() {
308
- return !(this.maximized || this.isDrawing || !this.maximizable || this.disabled);
309
- }
310
- /**
311
- * @hidden
312
- */
313
- get showMinimize() {
314
- return this.maximized && !this.isDrawing;
315
- }
316
- /**
317
- * @hidden
318
- */
319
- get showClear() {
320
- return !(this.isEmpty || this.isDrawing || this.readonly || this.disabled);
321
- }
322
- /**
323
- * @hidden
324
- */
325
- get focused() {
326
- return this.isFocused;
327
- }
328
- set focused(value) {
329
- if (this.isFocused !== value && this.element) {
330
- const wrap = this.element.nativeElement;
331
- if (value && !this.maximized) {
332
- this.renderer.addClass(wrap, FOCUSED_CLASS);
333
- }
334
- else {
335
- this.renderer.removeClass(wrap, FOCUSED_CLASS);
336
- }
337
- this.isFocused = value;
338
- }
339
- }
340
- get options() {
341
- return {
342
- scale: this.maximized ? this.popupScale : 1,
343
- color: this.color,
344
- backgroundColor: this.backgroundColor,
345
- strokeWidth: this.strokeWidth,
346
- smooth: this.smooth,
347
- readonly: this.readonly
348
- };
349
- }
350
- notifyNgTouched = noop;
351
- notifyNgChanged = noop;
352
- instance;
353
- _value;
354
- _tabindex = 0;
355
- subscriptions;
356
- unsubscribe;
357
- hostClasses = [];
358
- constructor(element, renderer, ngZone, cd, localization, cdr) {
359
- this.element = element;
360
- this.renderer = renderer;
361
- this.ngZone = ngZone;
362
- this.cd = cd;
363
- this.localization = localization;
364
- this.cdr = cdr;
365
- validatePackage(packageMetadata);
366
- this.direction = localization.rtl ? 'rtl' : 'ltr';
367
- }
368
- ngOnInit() {
369
- this.subscriptions = this.localization
370
- .changes
371
- .subscribe(({ rtl }) => {
372
- this.direction = rtl ? 'rtl' : 'ltr';
373
- });
374
- }
375
- ngAfterViewInit() {
376
- if (!isDocumentAvailable()) {
377
- return;
378
- }
379
- this.applyHostClasses();
380
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
381
- this.readThemeColors();
382
- this.instance.setOptions(this.options);
383
- });
384
- this.ngZone.runOutsideAngular(() => {
385
- const element = this.canvas.nativeElement;
386
- this.instance = new SignaturePad(element, {
387
- ...this.options,
388
- onChange: () => this.onValueChange(),
389
- onDraw: () => this.onDraw(),
390
- onDrawEnd: () => this.onDrawEnd()
391
- });
392
- if (this.value) {
393
- this.instance.loadImage(this.value);
394
- }
395
- if (this.maximized) {
396
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
397
- this.minimizeButton?.nativeElement.focus();
398
- });
399
- }
400
- this.addEventListeners();
401
- });
402
- }
403
- ngOnChanges(changes) {
404
- if (anyChanged(['readonly', 'color', 'backgroundColor', 'strokeWidth', 'smooth'], changes, true)) {
405
- this.instance.setOptions(this.options);
406
- }
407
- this.applyHostClasses();
408
- }
409
- ngOnDestroy() {
410
- if (this.instance) {
411
- this.instance.destroy();
412
- this.instance = null;
413
- }
414
- if (this.subscriptions) {
415
- this.subscriptions.unsubscribe();
416
- this.subscriptions = null;
417
- }
418
- if (this.unsubscribe) {
419
- this.unsubscribe();
420
- this.unsubscribe = null;
421
- }
422
- }
423
- /**
424
- * @hidden
425
- */
426
- onClear() {
427
- this.reset();
428
- this.valueChange.emit(undefined);
429
- this.canvas.nativeElement.focus();
430
- }
431
- /**
432
- * @hidden
433
- */
434
- async onValueChange() {
435
- const value = await this.instance.exportImage({
436
- width: this.baseWidth * this.exportScale,
437
- height: this.baseHeight * this.exportScale
438
- });
439
- this._value = value;
440
- this.cd.markForCheck();
441
- this.ngZone.run(() => {
442
- this.valueChange.emit(value);
443
- this.notifyNgChanged(value);
444
- });
445
- }
446
- /**
447
- * @hidden
448
- */
449
- onDialogValueChange(value) {
450
- this.value = value;
451
- this.valueChange.emit(value);
452
- this.notifyNgTouched();
453
- this.notifyNgChanged(value);
454
- }
455
- /**
456
- * @hidden
457
- */
458
- onDialogClick(e) {
459
- if (e.target.classList.contains('k-overlay')) {
460
- this.isOpen = false;
461
- this.maximizeButton?.nativeElement.focus();
462
- }
463
- }
464
- /**
465
- * @hidden
466
- */
467
- onDialogKeydown(e) {
468
- if (e.code === Keys.Escape) {
469
- this.isOpen = false;
470
- this.cd.detectChanges();
471
- this.maximizeButton?.nativeElement.focus();
472
- }
473
- }
474
- /**
475
- * @hidden
476
- */
477
- onDialogClose() {
478
- const args = new SignatureCloseEvent();
479
- this.close.next(args);
480
- if (!args.isDefaultPrevented()) {
481
- this.isOpen = false;
482
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
483
- (this.maximizeButton || this.element)?.nativeElement?.focus();
484
- });
485
- }
486
- }
487
- /**
488
- * Clears the value of the Signature.
489
- */
490
- reset() {
491
- if (!isPresent(this.value)) {
492
- return;
493
- }
494
- this.instance?.clear();
495
- this.value = this._value = undefined;
496
- this.notifyNgChanged(undefined);
497
- }
498
- /**
499
- * Toggles the popup of the Signature.
500
- *
501
- * Does not trigger the `open` and `close` events.
502
- *
503
- * @param open Optional. Set to `true` to open or `false` to close the popup.
504
- */
505
- toggle(open) {
506
- if (this.disabled || this.readonly) {
507
- return;
508
- }
509
- open = isPresent(open) ? open : !this.isOpen;
510
- this.isOpen = open;
511
- }
512
- /**
513
- * @hidden
514
- */
515
- async onMaximize() {
516
- const args = new SignatureOpenEvent();
517
- this.open.next(args);
518
- if (!args.isDefaultPrevented()) {
519
- this.popupValue = await this.instance.exportImage({
520
- width: this.popupWidth * this.exportScale,
521
- height: this.popupHeight * this.exportScale
522
- });
523
- this.isOpen = true;
524
- this.cd.detectChanges();
525
- }
526
- }
527
- /**
528
- * @hidden
529
- */
530
- onMinimize() {
531
- this.minimize.next();
532
- }
533
- applyHostClasses() {
534
- const classList = this.element.nativeElement.classList;
535
- this.hostClasses.forEach(([name]) => classList.remove(name));
536
- this.hostClasses = [
537
- [`k-signature-${SIZE_MAP[this.size || DEFAULT_SIZE]}`, !isNone(this.size)],
538
- [`k-input-${this.fillMode || DEFAULT_FILL_MODE}`, !isNone(this.fillMode)],
539
- [`k-rounded-${ROUNDED_MAP[this.rounded || DEFAULT_ROUNDED]}`, !isNone(this.rounded)]
540
- ];
541
- this.hostClasses.forEach(([name, enabled]) => classList.toggle(name, enabled));
542
- }
543
- readThemeColors() {
544
- let defaultColor = DEFAULT_COLOR;
545
- let defaultBackgroundColor = DEFAULT_BACKGROUND_COLOR;
546
- if (isDocumentAvailable()) {
547
- const el = this.element.nativeElement;
548
- defaultColor = getComputedStyle(el).color;
549
- defaultBackgroundColor = getComputedStyle(el).backgroundColor;
550
- }
551
- this.color = this.color || defaultColor;
552
- this.backgroundColor = this.backgroundColor || defaultBackgroundColor;
553
- }
554
- /**
555
- * Focuses the Signature wrapper container.
556
- */
557
- focus() {
558
- this.focused = true;
559
- this.element.nativeElement.focus();
560
- }
561
- /**
562
- * @hidden
563
- */
564
- onWrapperFocus() {
565
- if (this.focused) {
566
- return;
567
- }
568
- this.ngZone.run(() => {
569
- this.focus();
570
- this.onFocus.emit();
571
- });
572
- }
573
- /**
574
- * Blurs the Signature.
575
- */
576
- blur() {
577
- this.focused = false;
578
- this.element.nativeElement.blur();
579
- this.notifyNgTouched();
580
- }
581
- /**
582
- * @hidden
583
- */
584
- onWrapperBlur() {
585
- if (this.isOpen) {
586
- return;
587
- }
588
- this.ngZone.run(() => {
589
- this.onBlur.emit();
590
- this.focused = false;
591
- this.notifyNgTouched();
592
- });
593
- }
594
- /**
595
- * @hidden
596
- */
597
- onWrapperClick(_event) {
598
- if (this.disabled) {
599
- return;
600
- }
601
- this.focus();
602
- }
603
- /**
604
- * @hidden
605
- */
606
- writeValue(value) {
607
- this.value = value;
608
- this.cd.markForCheck();
609
- }
610
- /**
611
- * @hidden
612
- */
613
- registerOnChange(fn) {
614
- this.notifyNgChanged = fn;
615
- }
616
- /**
617
- * @hidden
618
- */
619
- registerOnTouched(fn) {
620
- this.notifyNgTouched = fn;
621
- }
622
- /**
623
- * @hidden
624
- */
625
- setDisabledState(isDisabled) {
626
- this.disabled = isDisabled;
627
- this.cdr.markForCheck();
628
- }
629
- /**
630
- * @hidden
631
- */
632
- popupValue;
633
- onDraw() {
634
- this.isDrawing = true;
635
- this.cd.markForCheck();
636
- }
637
- onDrawEnd() {
638
- this.isDrawing = false;
639
- this.cd.markForCheck();
640
- }
641
- addEventListeners() {
642
- const element = this.element.nativeElement;
643
- const focusIn = this.renderer.listen(element, 'focusin', () => this.onWrapperFocus());
644
- const focusOut = this.renderer.listen(element, 'focusout', (e) => {
645
- const insideWrapper = closest(e.relatedTarget, element => element === this.element.nativeElement);
646
- if (!insideWrapper) {
647
- this.onWrapperBlur();
648
- }
649
- });
650
- const click = this.renderer.listen(element, 'click', () => {
651
- this.ngZone.run((e) => {
652
- this.onWrapperClick(e);
653
- });
654
- });
655
- this.unsubscribe = () => {
656
- focusIn();
657
- focusOut();
658
- click();
659
- };
660
- }
661
- getMessage(key) {
662
- if (this.maximized && this.parentLocalization) {
663
- return this.parentLocalization.get(key);
664
- }
665
- return this.localization.get(key);
666
- }
667
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SignatureComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
668
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SignatureComponent, isStandalone: true, selector: "kendo-signature", inputs: { focusableId: "focusableId", readonly: "readonly", disabled: "disabled", width: "width", height: "height", value: "value", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", color: "color", backgroundColor: "backgroundColor", strokeWidth: "strokeWidth", smooth: "smooth", maximizable: "maximizable", maximized: "maximized", popupScale: "popupScale", exportScale: "exportScale", parentLocalization: "parentLocalization", hideLine: "hideLine" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur", minimize: "minimize" }, host: { properties: { "class.k-signature": "this.staticHostClasses", "class.k-input": "this.staticHostClasses", "attr.dir": "this.direction", "class.k-readonly": "this.readonly", "class.k-disabled": "this.disabled", "style.width.px": "this.width", "style.height.px": "this.height" } }, providers: [
669
- LocalizationService,
670
- { provide: L10N_PREFIX, useValue: 'kendo.signature' },
671
- { multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SignatureComponent) }
672
- ], viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true }, { propertyName: "minimizeButton", first: true, predicate: ["minimize"], descendants: true, read: ElementRef }, { propertyName: "maximizeButton", first: true, predicate: ["maximize"], descendants: true, read: ElementRef }], exportAs: ["kendoSignature"], usesOnChanges: true, ngImport: i0, template: `
673
- <ng-container kendoSignatureLocalizedMessages
674
- i18n-clear="kendo.signature.clear|The message for the Clear button."
675
- clear="Clear"
676
- i18n-maximize="kendo.signature.maximize|The message for the Maximize button."
677
- maximize="Maximize"
678
- i18n-minimize="kendo.signature.minimize|The message for the Minimize button."
679
- minimize="Minimize"
680
- i18n-canvasLabel="kendo.signature.canvasLabel|The message for the Canvas element aria-label."
681
- canvasLabel="Signature canvas">
682
- </ng-container>
683
-
684
- <div
685
- #canvas
686
- class="k-signature-canvas"
687
- [attr.tabindex]="tabindex"
688
- [id]="focusableId"
689
- role="img"
690
- [attr.aria-label]="canvasLabel"
691
- ></div>
692
-
693
- <div class="k-signature-actions k-signature-actions-top">
694
- @if (showMaximize) {
695
- <button
696
- #maximize
697
- kendoButton
698
- type="button"
699
- class="k-signature-action k-signature-maximize"
700
- icon="hyperlink-open"
701
- [svgIcon]="svgIcon('hyperlinkOpenIcon')"
702
- fillMode="flat"
703
- [size]="size"
704
- (click)="onMaximize()"
705
- [attr.aria-label]="maximizeTitle"
706
- [title]="maximizeTitle">
707
- </button>
708
- }
709
- @if (showMinimize) {
710
- <button
711
- #minimize
712
- kendoButton
713
- type="button"
714
- class="k-signature-action k-signature-minimize k-rotate-180"
715
- icon="hyperlink-open"
716
- [svgIcon]="svgIcon('hyperlinkOpenIcon')"
717
- fillMode="flat"
718
- [size]="size"
719
- (click)="onMinimize()"
720
- [attr.aria-label]="minimizeTitle"
721
- [title]="minimizeTitle">
722
- </button>
723
- }
724
- </div>
725
- @if (!hideLine) {
726
- <div
727
- class="k-signature-line"
728
- ></div>
729
- }
730
- <div class="k-signature-actions k-signature-actions-bottom">
731
- @if (showClear) {
732
- <button
733
- kendoButton
734
- class="k-signature-action k-signature-clear"
735
- icon="close"
736
- type="button"
737
- [svgIcon]="svgIcon('xIcon')"
738
- fillMode="flat"
739
- [size]="size"
740
- [attr.aria-label]="clearTitle"
741
- [title]="clearTitle"
742
- (click)="onClear()" >
743
- </button>
744
- }
745
- </div>
746
-
747
- @if (isOpen) {
748
- <kendo-dialog
749
- autoFocusedElement=".k-signature-action.k-signature-minimize"
750
- (click)="onDialogClick($event)"
751
- (keydown)="onDialogKeydown($event)">
752
- <kendo-signature
753
- [readonly]="readonly"
754
- [disabled]="disabled"
755
- [size]="size"
756
- [rounded]="rounded"
757
- [fillMode]="fillMode"
758
- [color]="color"
759
- [backgroundColor]="backgroundColor"
760
- [strokeWidth]="strokeWidth"
761
- [smooth]="smooth"
762
- [value]="popupValue"
763
- (valueChange)="onDialogValueChange($event)"
764
- [hideLine]="hideLine"
765
- [class.k-signature-maximized]="true"
766
- [maximized]="true"
767
- (minimize)="onDialogClose()"
768
- [width]="popupWidth"
769
- [height]="popupHeight"
770
- [popupScale]="popupScale"
771
- [exportScale]="(1 / popupScale) * exportScale"
772
- [parentLocalization]="localization">
773
- </kendo-signature>
774
- </kendo-dialog>
775
- }
776
- `, isInline: true, dependencies: [{ kind: "component", type: SignatureComponent, selector: "kendo-signature", inputs: ["focusableId", "readonly", "disabled", "width", "height", "value", "tabindex", "size", "rounded", "fillMode", "color", "backgroundColor", "strokeWidth", "smooth", "maximizable", "maximized", "popupScale", "exportScale", "parentLocalization", "hideLine"], outputs: ["valueChange", "open", "close", "focus", "blur", "minimize"], exportAs: ["kendoSignature"] }, { kind: "directive", type: LocalizedSignatureMessagesDirective, selector: "[kendoSignatureLocalizedMessages]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "animation", "themeColor"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
777
- }
778
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SignatureComponent, decorators: [{
779
- type: Component,
780
- args: [{
781
- exportAs: 'kendoSignature',
782
- selector: 'kendo-signature',
783
- changeDetection: ChangeDetectionStrategy.OnPush,
784
- providers: [
785
- LocalizationService,
786
- { provide: L10N_PREFIX, useValue: 'kendo.signature' },
787
- { multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SignatureComponent) }
788
- ],
789
- template: `
790
- <ng-container kendoSignatureLocalizedMessages
791
- i18n-clear="kendo.signature.clear|The message for the Clear button."
792
- clear="Clear"
793
- i18n-maximize="kendo.signature.maximize|The message for the Maximize button."
794
- maximize="Maximize"
795
- i18n-minimize="kendo.signature.minimize|The message for the Minimize button."
796
- minimize="Minimize"
797
- i18n-canvasLabel="kendo.signature.canvasLabel|The message for the Canvas element aria-label."
798
- canvasLabel="Signature canvas">
799
- </ng-container>
800
-
801
- <div
802
- #canvas
803
- class="k-signature-canvas"
804
- [attr.tabindex]="tabindex"
805
- [id]="focusableId"
806
- role="img"
807
- [attr.aria-label]="canvasLabel"
808
- ></div>
809
-
810
- <div class="k-signature-actions k-signature-actions-top">
811
- @if (showMaximize) {
812
- <button
813
- #maximize
814
- kendoButton
815
- type="button"
816
- class="k-signature-action k-signature-maximize"
817
- icon="hyperlink-open"
818
- [svgIcon]="svgIcon('hyperlinkOpenIcon')"
819
- fillMode="flat"
820
- [size]="size"
821
- (click)="onMaximize()"
822
- [attr.aria-label]="maximizeTitle"
823
- [title]="maximizeTitle">
824
- </button>
825
- }
826
- @if (showMinimize) {
827
- <button
828
- #minimize
829
- kendoButton
830
- type="button"
831
- class="k-signature-action k-signature-minimize k-rotate-180"
832
- icon="hyperlink-open"
833
- [svgIcon]="svgIcon('hyperlinkOpenIcon')"
834
- fillMode="flat"
835
- [size]="size"
836
- (click)="onMinimize()"
837
- [attr.aria-label]="minimizeTitle"
838
- [title]="minimizeTitle">
839
- </button>
840
- }
841
- </div>
842
- @if (!hideLine) {
843
- <div
844
- class="k-signature-line"
845
- ></div>
846
- }
847
- <div class="k-signature-actions k-signature-actions-bottom">
848
- @if (showClear) {
849
- <button
850
- kendoButton
851
- class="k-signature-action k-signature-clear"
852
- icon="close"
853
- type="button"
854
- [svgIcon]="svgIcon('xIcon')"
855
- fillMode="flat"
856
- [size]="size"
857
- [attr.aria-label]="clearTitle"
858
- [title]="clearTitle"
859
- (click)="onClear()" >
860
- </button>
861
- }
862
- </div>
863
-
864
- @if (isOpen) {
865
- <kendo-dialog
866
- autoFocusedElement=".k-signature-action.k-signature-minimize"
867
- (click)="onDialogClick($event)"
868
- (keydown)="onDialogKeydown($event)">
869
- <kendo-signature
870
- [readonly]="readonly"
871
- [disabled]="disabled"
872
- [size]="size"
873
- [rounded]="rounded"
874
- [fillMode]="fillMode"
875
- [color]="color"
876
- [backgroundColor]="backgroundColor"
877
- [strokeWidth]="strokeWidth"
878
- [smooth]="smooth"
879
- [value]="popupValue"
880
- (valueChange)="onDialogValueChange($event)"
881
- [hideLine]="hideLine"
882
- [class.k-signature-maximized]="true"
883
- [maximized]="true"
884
- (minimize)="onDialogClose()"
885
- [width]="popupWidth"
886
- [height]="popupHeight"
887
- [popupScale]="popupScale"
888
- [exportScale]="(1 / popupScale) * exportScale"
889
- [parentLocalization]="localization">
890
- </kendo-signature>
891
- </kendo-dialog>
892
- }
893
- `,
894
- standalone: true,
895
- imports: [LocalizedSignatureMessagesDirective, ButtonComponent, DialogComponent]
896
- }]
897
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }], propDecorators: { staticHostClasses: [{
898
- type: HostBinding,
899
- args: ['class.k-signature']
900
- }, {
901
- type: HostBinding,
902
- args: ['class.k-input']
903
- }], focusableId: [{
904
- type: Input
905
- }], direction: [{
906
- type: HostBinding,
907
- args: ['attr.dir']
908
- }], readonly: [{
909
- type: HostBinding,
910
- args: ['class.k-readonly']
911
- }, {
912
- type: Input
913
- }], disabled: [{
914
- type: HostBinding,
915
- args: ['class.k-disabled']
916
- }, {
917
- type: Input
918
- }], width: [{
919
- type: Input
920
- }, {
921
- type: HostBinding,
922
- args: ['style.width.px']
923
- }], height: [{
924
- type: Input
925
- }, {
926
- type: HostBinding,
927
- args: ['style.height.px']
928
- }], value: [{
929
- type: Input
930
- }], tabindex: [{
931
- type: Input
932
- }], size: [{
933
- type: Input
934
- }], rounded: [{
935
- type: Input
936
- }], fillMode: [{
937
- type: Input
938
- }], color: [{
939
- type: Input
940
- }], backgroundColor: [{
941
- type: Input
942
- }], strokeWidth: [{
943
- type: Input
944
- }], smooth: [{
945
- type: Input
946
- }], maximizable: [{
947
- type: Input
948
- }], maximized: [{
949
- type: Input
950
- }], popupScale: [{
951
- type: Input
952
- }], exportScale: [{
953
- type: Input
954
- }], parentLocalization: [{
955
- type: Input
956
- }], hideLine: [{
957
- type: Input
958
- }], valueChange: [{
959
- type: Output
960
- }], open: [{
961
- type: Output
962
- }], close: [{
963
- type: Output
964
- }], onFocus: [{
965
- type: Output,
966
- args: ['focus']
967
- }], onBlur: [{
968
- type: Output,
969
- args: ['blur']
970
- }], minimize: [{
971
- type: Output
972
- }], canvas: [{
973
- type: ViewChild,
974
- args: ['canvas']
975
- }], minimizeButton: [{
976
- type: ViewChild,
977
- args: ['minimize', { read: ElementRef }]
978
- }], maximizeButton: [{
979
- type: ViewChild,
980
- args: ['maximize', { read: ElementRef }]
981
- }] } });