@progress/kendo-angular-inputs 21.4.1 → 22.0.0-develop.1

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,671 +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 { Renderer2, Component, ElementRef, Input, ViewChild, forwardRef, NgZone, Injector, ChangeDetectorRef } from '@angular/core';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { fromEvent, interval, merge } from 'rxjs';
9
- import { filter, concatMap, startWith, takeUntil, take, tap } from 'rxjs/operators';
10
- import { trimValue } from '../sliders-common/sliders-util';
11
- import { SliderModel } from './slider-model';
12
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
13
- import { areSame, isPresent, requiresZoneOnBlur } from '../common/utils';
14
- import { eventValue, decreaseValueToStep, increaseValueToStep } from '../sliders-common/sliders-util';
15
- import { invokeElementMethod } from '../common/dom-utils';
16
- import { guid, isDocumentAvailable, hasObservers, KendoInput, anyChanged, Keys, EventsOutsideAngularDirective, DraggableDirective, ResizeSensorComponent, normalizeKeys } from '@progress/kendo-angular-common';
17
- import { SliderBase } from '../sliders-common/slider-base';
18
- import { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon, caretAltUpIcon } from '@progress/kendo-svg-icons';
19
- import { SliderTicksComponent } from '../sliders-common/slider-ticks.component';
20
- import { LocalizedSliderMessagesDirective } from './localization/localized-slider-messages.directive';
21
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
22
- import * as i0 from "@angular/core";
23
- import * as i1 from "@progress/kendo-angular-l10n";
24
- const PRESSED = 'k-pressed';
25
- /**
26
- * Represents the [Kendo UI Slider component for Angular]({% slug overview_slider %}).
27
- *
28
- * @example
29
- * ```html
30
- * <kendo-slider [min]="0" [max]="10" [smallStep]="1" [(ngModel)]="value"></kendo-slider>
31
- * ```
32
- *
33
- * @remarks
34
- * Supported children components are: {@link SliderCustomMessagesComponent}.
35
- */
36
- export class SliderComponent extends SliderBase {
37
- localization;
38
- injector;
39
- renderer;
40
- ngZone;
41
- changeDetector;
42
- hostElement;
43
- /**
44
- * @hidden
45
- */
46
- focusableId = `k-${guid()}`;
47
- /**
48
- * Changes the `title` attribute of the drag handle. Use this property to localize the drag handle title.
49
- */
50
- dragHandleTitle;
51
- /**
52
- * Sets the title of the **Increase** button of the Slider ([see example]({% slug sidebuttons_slider %}#toc-titles)).
53
- */
54
- incrementTitle;
55
- /**
56
- * Determines if the component animates when the value changes.
57
- * The component does not animate during initial rendering.
58
- * @default true
59
- */
60
- animate = true;
61
- /**
62
- * Sets the title of the **Decrease** button of the Slider ([see example]({% slug sidebuttons_slider %}#toc-titles)).
63
- */
64
- decrementTitle;
65
- /**
66
- * Shows or hides the arrow side buttons of the Slider ([see example]({% slug sidebuttons_slider %}#toc-hidden-state)).
67
- * When you set `showButtons` to `false`, the component does not display the buttons.
68
- * @default true
69
- */
70
- showButtons = true;
71
- /**
72
- * Sets the current value of the Slider when it first appears.
73
- * Use either `ngModel` or the `value` binding, but not both at the same time.
74
- * @default 0
75
- */
76
- value = this.min;
77
- /**
78
- * @hidden
79
- */
80
- set tabIndex(tabIndex) {
81
- this.tabindex = tabIndex;
82
- }
83
- get tabIndex() {
84
- return this.tabindex;
85
- }
86
- /**
87
- * @hidden
88
- */
89
- get currentValue() {
90
- return isPresent(this.value) ? this.value.toString() : '';
91
- }
92
- /**
93
- * @hidden
94
- */
95
- arrowUpIcon = caretAltUpIcon;
96
- /**
97
- * @hidden
98
- */
99
- arrowDownIcon = caretAltDownIcon;
100
- /**
101
- * @hidden
102
- */
103
- arrowLeftIcon = caretAltLeftIcon;
104
- /**
105
- * @hidden
106
- */
107
- arrowRightIcon = caretAltRightIcon;
108
- draghandle;
109
- decreaseButton;
110
- increaseButton;
111
- focusChangedProgrammatically = false;
112
- isInvalid;
113
- constructor(localization, injector, renderer, ngZone, changeDetector, hostElement) {
114
- super(localization, injector, renderer, ngZone, changeDetector, hostElement);
115
- this.localization = localization;
116
- this.injector = injector;
117
- this.renderer = renderer;
118
- this.ngZone = ngZone;
119
- this.changeDetector = changeDetector;
120
- this.hostElement = hostElement;
121
- }
122
- /**
123
- * Focuses the Slider.
124
- */
125
- focus() {
126
- if (!this.disabled) {
127
- this.focusChangedProgrammatically = true;
128
- invokeElementMethod(this.draghandle, 'focus');
129
- this.focusChangedProgrammatically = false;
130
- }
131
- }
132
- /**
133
- * Blurs the Slider.
134
- */
135
- blur() {
136
- this.focusChangedProgrammatically = true;
137
- invokeElementMethod(this.draghandle, 'blur');
138
- this.handleBlur();
139
- this.focusChangedProgrammatically = false;
140
- }
141
- ngOnChanges(changes) {
142
- if (anyChanged(['value', 'fixedTickWidth', 'tickPlacement'], changes, true)) {
143
- this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(() => {
144
- this.sizeComponent(false);
145
- });
146
- }
147
- }
148
- ngAfterViewInit() {
149
- if (!isDocumentAvailable()) {
150
- return;
151
- }
152
- if (this.showButtons) {
153
- this.setValueChangeInterval(this.increaseButton.nativeElement, () => this.increaseValue());
154
- this.setValueChangeInterval(this.decreaseButton.nativeElement, () => this.decreaseValue());
155
- }
156
- this.sizeComponent(false);
157
- if (this.ticks) {
158
- this.ticks.tickElements
159
- .changes
160
- .subscribe(() => this.sizeComponent(false));
161
- }
162
- this.attachElementEventHandlers();
163
- this.isSliderInvalid();
164
- }
165
- ngOnDestroy() {
166
- if (this.subscriptions) {
167
- this.subscriptions.unsubscribe();
168
- }
169
- }
170
- /**
171
- * @hidden
172
- */
173
- get incrementMessage() {
174
- return this.incrementTitle || this.localizationService.get('increment');
175
- }
176
- /**
177
- * @hidden
178
- */
179
- get decrementMessage() {
180
- return this.decrementTitle || this.localizationService.get('decrement');
181
- }
182
- /**
183
- * @hidden
184
- */
185
- get dragHandleMessage() {
186
- return this.dragHandleTitle || this.localizationService.get('dragHandle');
187
- }
188
- /**
189
- * @hidden
190
- */
191
- onWrapClick = (args) => {
192
- const target = args.target;
193
- if (!this.isDisabled && !(target.closest('.k-button'))) {
194
- const value = eventValue(args, this.track.nativeElement, this.getProps());
195
- this.changeValue(value);
196
- }
197
- invokeElementMethod(this.draghandle, 'focus');
198
- };
199
- /**
200
- * @hidden
201
- */
202
- handleDragPress(args) {
203
- if (args.originalEvent) {
204
- args.originalEvent.preventDefault();
205
- }
206
- this.renderer.removeClass(this.hostElement.nativeElement, 'k-slider-transitions');
207
- }
208
- /**
209
- * @hidden
210
- */
211
- onHandleDrag(args) {
212
- this.dragging = true;
213
- this.changeValue(eventValue(args, this.track.nativeElement, this.getProps()));
214
- }
215
- /**
216
- * @hidden
217
- */
218
- onKeyDown = (e) => {
219
- const options = this.getProps();
220
- const { max, min } = options;
221
- // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
222
- const code = normalizeKeys(e);
223
- const handler = this.keyBinding[code];
224
- if (this.isDisabled || !handler) {
225
- return;
226
- }
227
- const value = handler(options);
228
- this.changeValue(trimValue(max, min, value));
229
- e.preventDefault();
230
- };
231
- /**
232
- * @hidden
233
- */
234
- onHandleRelease() {
235
- this.dragging = false; //needed for animation
236
- this.renderer.addClass(this.hostElement.nativeElement, 'k-slider-transitions');
237
- }
238
- //ngModel binding
239
- /**
240
- * @hidden
241
- */
242
- writeValue(value) {
243
- this.changeDetector.markForCheck();
244
- this.value = value;
245
- this.sizeComponent(this.animate);
246
- }
247
- /**
248
- * @hidden
249
- */
250
- registerOnChange(fn) {
251
- this.ngChange = fn;
252
- }
253
- /**
254
- * @hidden
255
- */
256
- registerOnTouched(fn) {
257
- this.ngTouched = fn;
258
- }
259
- /**
260
- * @hidden
261
- */
262
- changeValue(value) {
263
- if (!areSame(this.value, value)) {
264
- this.ngZone.run(() => {
265
- this.value = value;
266
- this.ngChange(value);
267
- this.valueChange.emit(value);
268
- this.sizeComponent(this.animate);
269
- this.changeDetector.markForCheck();
270
- });
271
- }
272
- this.isSliderInvalid();
273
- }
274
- /**
275
- * @hidden
276
- */
277
- sizeComponent(animate) {
278
- if (!isDocumentAvailable()) {
279
- return;
280
- }
281
- const wrapper = this.wrapper.nativeElement;
282
- const track = this.track.nativeElement;
283
- const selectionEl = this.sliderSelection.nativeElement;
284
- const dragHandleEl = this.draghandle.nativeElement;
285
- const ticks = this.ticks ? this.ticksContainer.nativeElement : null;
286
- if (!animate) {
287
- this.renderer.removeClass(this.hostElement.nativeElement, 'k-slider-transitions');
288
- }
289
- this.resetStyles([track, selectionEl, dragHandleEl, ticks, this.hostElement.nativeElement]);
290
- const props = this.getProps();
291
- const model = new SliderModel(props, wrapper, track, this.renderer, this.increaseButton);
292
- model.resizeTrack();
293
- if (this.ticks) { //for case when tickPlacement: none
294
- model.resizeTicks(this.ticksContainer.nativeElement, this.ticks.tickElements.map(element => element.nativeElement));
295
- }
296
- model.positionHandle(dragHandleEl);
297
- model.positionSelection(selectionEl);
298
- if (!animate) {
299
- this.hostElement.nativeElement.getBoundingClientRect();
300
- this.renderer.addClass(this.hostElement.nativeElement, 'k-slider-transitions');
301
- }
302
- if (this.fixedTickWidth) {
303
- model.resizeWrapper();
304
- }
305
- }
306
- set focused(value) {
307
- if (this.isFocused !== value && this.hostElement) {
308
- this.isFocused = value;
309
- }
310
- }
311
- set dragging(value) {
312
- if (this.isDragged !== value && this.sliderSelection && this.draghandle) {
313
- const sliderSelection = this.sliderSelection.nativeElement;
314
- const draghandle = this.draghandle.nativeElement;
315
- if (value) {
316
- this.renderer.addClass(sliderSelection, PRESSED);
317
- this.renderer.addClass(draghandle, PRESSED);
318
- }
319
- else {
320
- this.renderer.removeClass(sliderSelection, PRESSED);
321
- this.renderer.removeClass(draghandle, PRESSED);
322
- }
323
- this.isDragged = value;
324
- }
325
- }
326
- setValueChangeInterval(element, callback) {
327
- this.ngZone.runOutsideAngular(() => {
328
- const pointerdown = fromEvent(element, 'pointerdown');
329
- const pointerup = fromEvent(element, 'pointerup');
330
- const pointerout = fromEvent(element, 'pointerout');
331
- const subscription = pointerdown.pipe(tap((e) => e.preventDefault()), filter((e) => e.button === 0 && !this.isDisabled), concatMap(() => interval(150).pipe(startWith(-1), takeUntil(merge(pointerup, pointerout))))).subscribe(() => {
332
- if (!this.isFocused) {
333
- invokeElementMethod(this.draghandle, 'focus');
334
- }
335
- callback();
336
- });
337
- this.subscriptions.add(subscription);
338
- });
339
- }
340
- ngChange = (_) => { };
341
- ngTouched = () => { };
342
- decreaseValue = () => {
343
- this.changeValue(decreaseValueToStep(this.value, this.getProps()));
344
- };
345
- increaseValue = () => {
346
- this.changeValue(increaseValueToStep(this.value, this.getProps()));
347
- };
348
- getProps() {
349
- return {
350
- buttons: this.showButtons,
351
- disabled: this.disabled,
352
- fixedTickWidth: this.fixedTickWidth,
353
- largeStep: this.largeStep,
354
- max: this.max,
355
- min: this.min,
356
- readonly: this.readonly,
357
- reverse: this.reverse,
358
- rtl: this.localizationService.rtl,
359
- smallStep: this.smallStep,
360
- value: trimValue(this.max, this.min, this.value),
361
- vertical: this.vertical
362
- };
363
- }
364
- isSliderInvalid() {
365
- const sliderClasses = this.hostElement.nativeElement.classList;
366
- this.isInvalid = sliderClasses.contains('ng-invalid') ? true : false;
367
- this.renderer.setAttribute(this.draghandle.nativeElement, 'aria-invalid', `${this.isInvalid}`);
368
- }
369
- attachElementEventHandlers() {
370
- const hostElement = this.hostElement.nativeElement;
371
- let tabbing = false;
372
- let cursorInsideWrapper = false;
373
- this.ngZone.runOutsideAngular(() => {
374
- // focusIn and focusOut are relative to the host element
375
- this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
376
- if (!this.isFocused) {
377
- this.ngZone.run(() => {
378
- if (!this.focusChangedProgrammatically) {
379
- this.onFocus.emit();
380
- }
381
- this.focused = true;
382
- });
383
- }
384
- }));
385
- this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (args) => {
386
- if (!this.isFocused) {
387
- return;
388
- }
389
- if (tabbing) {
390
- if (args.relatedTarget !== this.draghandle.nativeElement) {
391
- this.handleBlur();
392
- }
393
- tabbing = false;
394
- }
395
- else {
396
- if (!cursorInsideWrapper) {
397
- this.handleBlur();
398
- }
399
- }
400
- }));
401
- this.subscriptions.add(this.renderer.listen(hostElement, 'mouseenter', () => {
402
- cursorInsideWrapper = true;
403
- }));
404
- this.subscriptions.add(this.renderer.listen(hostElement, 'mouseleave', () => {
405
- cursorInsideWrapper = false;
406
- }));
407
- this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (args) => {
408
- if (args.code === Keys.Tab) {
409
- tabbing = true;
410
- }
411
- else {
412
- tabbing = false;
413
- }
414
- }));
415
- });
416
- }
417
- handleBlur = () => {
418
- this.changeDetector.markForCheck();
419
- this.focused = false;
420
- if (hasObservers(this.onBlur) || requiresZoneOnBlur(this.control)) {
421
- this.ngZone.run(() => {
422
- this.ngTouched();
423
- if (!this.focusChangedProgrammatically) {
424
- this.onBlur.emit();
425
- }
426
- });
427
- }
428
- };
429
- get decreaseButtonArrowIcon() {
430
- const icon = !this.vertical ?
431
- this.direction === 'ltr' ?
432
- 'caret-alt-left' :
433
- 'caret-alt-right' :
434
- 'caret-alt-down';
435
- return icon;
436
- }
437
- get increaseButtonArrowIcon() {
438
- const icon = !this.vertical ?
439
- this.direction === 'ltr' ?
440
- 'caret-alt-right' :
441
- 'caret-alt-left' :
442
- 'caret-alt-up';
443
- return icon;
444
- }
445
- get decreaseButtonArrowSVGIcon() {
446
- const icon = !this.vertical ?
447
- this.direction === 'ltr' ?
448
- this.arrowLeftIcon :
449
- this.arrowRightIcon :
450
- this.arrowDownIcon;
451
- return icon;
452
- }
453
- get increaseButtonArrowSVGIcon() {
454
- const icon = !this.vertical ?
455
- this.direction === 'ltr' ?
456
- this.arrowRightIcon :
457
- this.arrowLeftIcon :
458
- this.arrowUpIcon;
459
- return icon;
460
- }
461
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SliderComponent, deps: [{ token: i1.LocalizationService }, { token: i0.Injector }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
462
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SliderComponent, isStandalone: true, selector: "kendo-slider", inputs: { focusableId: "focusableId", dragHandleTitle: "dragHandleTitle", incrementTitle: "incrementTitle", animate: "animate", decrementTitle: "decrementTitle", showButtons: "showButtons", value: "value", tabIndex: "tabIndex" }, providers: [
463
- LocalizationService,
464
- { provide: L10N_PREFIX, useValue: 'kendo.slider' },
465
- { multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SliderComponent) },
466
- { provide: KendoInput, useExisting: forwardRef(() => SliderComponent) }
467
- ], viewQueries: [{ propertyName: "draghandle", first: true, predicate: ["draghandle"], descendants: true, static: true }, { propertyName: "decreaseButton", first: true, predicate: ["decreaseButton"], descendants: true, read: ElementRef }, { propertyName: "increaseButton", first: true, predicate: ["increaseButton"], descendants: true, read: ElementRef }], exportAs: ["kendoSlider"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
468
- <ng-container kendoSliderLocalizedMessages
469
- i18n-increment="kendo.slider.increment|The title of the **Increase** button of the Slider."
470
- increment="increment"
471
- i18n-decrement="kendo.slider.decrement|The title of the **Decrease** button of the Slider."
472
- decrement="decrement"
473
- i18n-dragHandle="kendo.slider.dragHandle|The title of the drag handle of the Slider."
474
- dragHandle="Drag"
475
- >
476
- @if (showButtons) {
477
- <button
478
- kendoButton
479
- #decreaseButton
480
- type="button"
481
- rounded="full"
482
- [icon]="decreaseButtonArrowIcon"
483
- [svgIcon]="decreaseButtonArrowSVGIcon"
484
- class="k-button-decrease"
485
- [title]="decrementMessage"
486
- [attr.tabindex]="-1"
487
- ></button>
488
- }
489
- <div
490
- #wrap
491
- class="k-slider-track-wrap"
492
- [class.k-slider-topleft]="tickPlacement === 'before'"
493
- [class.k-slider-bottomright]="tickPlacement === 'after'"
494
- [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
495
- >
496
- @if (tickPlacement !== 'none') {
497
- <ul kendoSliderTicks
498
- #ticks
499
- [tickTitle]="title"
500
- [vertical]="vertical"
501
- [step]="smallStep"
502
- [largeStep]="largeStep"
503
- [min]="min"
504
- [max]="max"
505
- [labelTemplate]="labelTemplate?.templateRef"
506
- aria-hidden="true"
507
- >
508
- </ul>
509
- }
510
- <div #track class="k-slider-track">
511
- <div #sliderSelection class="k-slider-selection">
512
- </div>
513
- <span #draghandle
514
- role="slider"
515
- [attr.aria-valuemin]="min"
516
- [attr.aria-valuemax]="max"
517
- [attr.aria-valuenow]="currentValue"
518
- [attr.aria-valuetext]="currentValue"
519
- [attr.aria-disabled]="disabled ? true : undefined"
520
- [attr.aria-readonly]="readonly ? true : undefined"
521
- [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
522
- [style.touch-action]="isDisabled ? '' : 'none'"
523
- class="k-draghandle k-draghandle-end"
524
- [title]="dragHandleMessage"
525
- [attr.tabindex]="disabled ? '-1' : tabIndex"
526
- [id]="focusableId"
527
- kendoDraggable
528
- (kendoPress)="ifEnabled(handleDragPress, $event)"
529
- (kendoDrag)="ifEnabled(onHandleDrag, $event)"
530
- (kendoRelease)="ifEnabled(onHandleRelease, $event)"
531
- ></span>
532
- </div>
533
- </div>
534
- @if (showButtons) {
535
- <button
536
- kendoButton
537
- #increaseButton
538
- type="button"
539
- rounded="full"
540
- [icon]="increaseButtonArrowIcon"
541
- [svgIcon]="increaseButtonArrowSVGIcon"
542
- class="k-button-increase"
543
- [title]="incrementMessage"
544
- [attr.tabindex]="-1"
545
- ></button>
546
- }
547
- <kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>
548
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedSliderMessagesDirective, selector: "[kendoSliderLocalizedMessages]" }, { 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: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: SliderTicksComponent, selector: "[kendoSliderTicks]", inputs: ["tickTitle", "vertical", "step", "largeStep", "min", "max", "labelTemplate"] }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
549
- }
550
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SliderComponent, decorators: [{
551
- type: Component,
552
- args: [{
553
- exportAs: 'kendoSlider',
554
- providers: [
555
- LocalizationService,
556
- { provide: L10N_PREFIX, useValue: 'kendo.slider' },
557
- { multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SliderComponent) },
558
- { provide: KendoInput, useExisting: forwardRef(() => SliderComponent) }
559
- ],
560
- selector: 'kendo-slider',
561
- template: `
562
- <ng-container kendoSliderLocalizedMessages
563
- i18n-increment="kendo.slider.increment|The title of the **Increase** button of the Slider."
564
- increment="increment"
565
- i18n-decrement="kendo.slider.decrement|The title of the **Decrease** button of the Slider."
566
- decrement="decrement"
567
- i18n-dragHandle="kendo.slider.dragHandle|The title of the drag handle of the Slider."
568
- dragHandle="Drag"
569
- >
570
- @if (showButtons) {
571
- <button
572
- kendoButton
573
- #decreaseButton
574
- type="button"
575
- rounded="full"
576
- [icon]="decreaseButtonArrowIcon"
577
- [svgIcon]="decreaseButtonArrowSVGIcon"
578
- class="k-button-decrease"
579
- [title]="decrementMessage"
580
- [attr.tabindex]="-1"
581
- ></button>
582
- }
583
- <div
584
- #wrap
585
- class="k-slider-track-wrap"
586
- [class.k-slider-topleft]="tickPlacement === 'before'"
587
- [class.k-slider-bottomright]="tickPlacement === 'after'"
588
- [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
589
- >
590
- @if (tickPlacement !== 'none') {
591
- <ul kendoSliderTicks
592
- #ticks
593
- [tickTitle]="title"
594
- [vertical]="vertical"
595
- [step]="smallStep"
596
- [largeStep]="largeStep"
597
- [min]="min"
598
- [max]="max"
599
- [labelTemplate]="labelTemplate?.templateRef"
600
- aria-hidden="true"
601
- >
602
- </ul>
603
- }
604
- <div #track class="k-slider-track">
605
- <div #sliderSelection class="k-slider-selection">
606
- </div>
607
- <span #draghandle
608
- role="slider"
609
- [attr.aria-valuemin]="min"
610
- [attr.aria-valuemax]="max"
611
- [attr.aria-valuenow]="currentValue"
612
- [attr.aria-valuetext]="currentValue"
613
- [attr.aria-disabled]="disabled ? true : undefined"
614
- [attr.aria-readonly]="readonly ? true : undefined"
615
- [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
616
- [style.touch-action]="isDisabled ? '' : 'none'"
617
- class="k-draghandle k-draghandle-end"
618
- [title]="dragHandleMessage"
619
- [attr.tabindex]="disabled ? '-1' : tabIndex"
620
- [id]="focusableId"
621
- kendoDraggable
622
- (kendoPress)="ifEnabled(handleDragPress, $event)"
623
- (kendoDrag)="ifEnabled(onHandleDrag, $event)"
624
- (kendoRelease)="ifEnabled(onHandleRelease, $event)"
625
- ></span>
626
- </div>
627
- </div>
628
- @if (showButtons) {
629
- <button
630
- kendoButton
631
- #increaseButton
632
- type="button"
633
- rounded="full"
634
- [icon]="increaseButtonArrowIcon"
635
- [svgIcon]="increaseButtonArrowSVGIcon"
636
- class="k-button-increase"
637
- [title]="incrementMessage"
638
- [attr.tabindex]="-1"
639
- ></button>
640
- }
641
- <kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>
642
- `,
643
- standalone: true,
644
- imports: [LocalizedSliderMessagesDirective, ButtonComponent, EventsOutsideAngularDirective, SliderTicksComponent, DraggableDirective, ResizeSensorComponent]
645
- }]
646
- }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.Injector }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { focusableId: [{
647
- type: Input
648
- }], dragHandleTitle: [{
649
- type: Input
650
- }], incrementTitle: [{
651
- type: Input
652
- }], animate: [{
653
- type: Input
654
- }], decrementTitle: [{
655
- type: Input
656
- }], showButtons: [{
657
- type: Input
658
- }], value: [{
659
- type: Input
660
- }], tabIndex: [{
661
- type: Input
662
- }], draghandle: [{
663
- type: ViewChild,
664
- args: ['draghandle', { static: true }]
665
- }], decreaseButton: [{
666
- type: ViewChild,
667
- args: ['decreaseButton', { read: ElementRef }]
668
- }], increaseButton: [{
669
- type: ViewChild,
670
- args: ['increaseButton', { read: ElementRef }]
671
- }] } });