@progress/kendo-angular-inputs 13.2.1-develop.11 → 13.2.1-develop.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +184 -0
- package/checkbox/checkbox.directive.d.ts +52 -0
- package/checkbox.module.d.ts +43 -0
- package/colorpicker/color-contrast-svg.component.d.ts +29 -0
- package/colorpicker/color-gradient-numeric-label.directive.d.ts +20 -0
- package/colorpicker/color-gradient.component.d.ts +281 -0
- package/colorpicker/color-input.component.d.ts +95 -0
- package/colorpicker/color-palette.component.d.ts +221 -0
- package/colorpicker/colorpicker.component.d.ts +383 -0
- package/colorpicker/constants.d.ts +41 -0
- package/colorpicker/contrast-validation.component.d.ts +24 -0
- package/colorpicker/contrast.component.d.ts +25 -0
- package/colorpicker/events/active-color-click-event.d.ts +53 -0
- package/colorpicker/events/cancel-event.d.ts +15 -0
- package/colorpicker/events/close-event.d.ts +10 -0
- package/colorpicker/events/kendo-drag-event.d.ts +21 -0
- package/colorpicker/events/open-event.d.ts +10 -0
- package/colorpicker/events.d.ts +8 -0
- package/colorpicker/flatcolorpicker-actions.component.d.ts +24 -0
- package/colorpicker/flatcolorpicker-header.component.d.ts +43 -0
- package/colorpicker/flatcolorpicker.component.d.ts +267 -0
- package/colorpicker/focus-on-dom-ready.directive.d.ts +18 -0
- package/colorpicker/localization/colorgradient-localization.service.d.ts +17 -0
- package/colorpicker/localization/colorpalette-localization.service.d.ts +17 -0
- package/colorpicker/localization/colorpicker-localization.service.d.ts +14 -0
- package/colorpicker/localization/custom-messages.component.d.ts +17 -0
- package/colorpicker/localization/flatcolorpicker-localization.service.d.ts +17 -0
- package/colorpicker/localization/localized-colorpicker-messages.directive.d.ts +16 -0
- package/colorpicker/localization/messages.d.ts +121 -0
- package/colorpicker/models/actions-layout.d.ts +8 -0
- package/colorpicker/models/colorpicker-view.d.ts +8 -0
- package/colorpicker/models/gradient-settings.d.ts +35 -0
- package/colorpicker/models/hsva.d.ts +13 -0
- package/colorpicker/models/output-format.d.ts +8 -0
- package/colorpicker/models/palette-presets.d.ts +61 -0
- package/colorpicker/models/palette-settings.d.ts +33 -0
- package/colorpicker/models/popup-settings.d.ts +18 -0
- package/colorpicker/models/rgb.d.ts +12 -0
- package/colorpicker/models/rgba.d.ts +13 -0
- package/colorpicker/models/table-cell.d.ts +11 -0
- package/colorpicker/models/tile-size.d.ts +11 -0
- package/colorpicker/models.d.ts +16 -0
- package/colorpicker/services/color-palette.service.d.ts +19 -0
- package/colorpicker/services/flatcolorpicker.service.d.ts +15 -0
- package/colorpicker/utils/color-parser.d.ts +77 -0
- package/colorpicker/utils/contrast-curve.d.ts +37 -0
- package/colorpicker/utils.d.ts +6 -0
- package/colorpicker.module.d.ts +35 -0
- package/common/dom-utils.d.ts +25 -0
- package/common/math.d.ts +36 -0
- package/common/models/fillmode.d.ts +9 -0
- package/common/models/rounded.d.ts +14 -0
- package/common/models/size.d.ts +9 -0
- package/common/models/styling-classes.d.ts +11 -0
- package/common/models.d.ts +8 -0
- package/common/utils.d.ts +56 -0
- package/esm2020/checkbox/checkbox.directive.mjs +94 -0
- package/esm2020/checkbox.module.mjs +52 -0
- package/esm2020/colorpicker/color-contrast-svg.component.mjs +97 -0
- package/esm2020/colorpicker/color-gradient-numeric-label.directive.mjs +31 -0
- package/esm2020/colorpicker/color-gradient.component.mjs +1003 -0
- package/esm2020/colorpicker/color-input.component.mjs +433 -0
- package/esm2020/colorpicker/color-palette.component.mjs +553 -0
- package/esm2020/colorpicker/colorpicker.component.mjs +1086 -0
- package/esm2020/colorpicker/constants.mjs +40 -0
- package/esm2020/colorpicker/contrast-validation.component.mjs +72 -0
- package/esm2020/colorpicker/contrast.component.mjs +100 -0
- package/esm2020/colorpicker/events/active-color-click-event.mjs +58 -0
- package/esm2020/colorpicker/events/cancel-event.mjs +14 -0
- package/esm2020/colorpicker/events/close-event.mjs +10 -0
- package/esm2020/colorpicker/events/kendo-drag-event.mjs +5 -0
- package/esm2020/colorpicker/events/open-event.mjs +10 -0
- package/esm2020/colorpicker/events.mjs +8 -0
- package/esm2020/colorpicker/flatcolorpicker-actions.component.mjs +93 -0
- package/esm2020/colorpicker/flatcolorpicker-header.component.mjs +217 -0
- package/esm2020/colorpicker/flatcolorpicker.component.mjs +829 -0
- package/esm2020/colorpicker/focus-on-dom-ready.directive.mjs +29 -0
- package/esm2020/colorpicker/localization/colorgradient-localization.service.mjs +45 -0
- package/esm2020/colorpicker/localization/colorpalette-localization.service.mjs +45 -0
- package/esm2020/colorpicker/localization/colorpicker-localization.service.mjs +31 -0
- package/esm2020/colorpicker/localization/custom-messages.component.mjs +41 -0
- package/esm2020/colorpicker/localization/flatcolorpicker-localization.service.mjs +45 -0
- package/esm2020/colorpicker/localization/localized-colorpicker-messages.directive.mjs +37 -0
- package/esm2020/colorpicker/localization/messages.mjs +75 -0
- package/esm2020/colorpicker/models/actions-layout.mjs +5 -0
- package/esm2020/colorpicker/models/colorpicker-view.mjs +5 -0
- package/esm2020/colorpicker/models/gradient-settings.mjs +5 -0
- package/esm2020/colorpicker/models/hsva.mjs +5 -0
- package/esm2020/colorpicker/models/output-format.mjs +5 -0
- package/esm2020/colorpicker/models/palette-presets.mjs +62 -0
- package/esm2020/colorpicker/models/palette-settings.mjs +5 -0
- package/esm2020/colorpicker/models/popup-settings.mjs +5 -0
- package/esm2020/colorpicker/models/rgb.mjs +5 -0
- package/esm2020/colorpicker/models/rgba.mjs +5 -0
- package/esm2020/colorpicker/models/table-cell.mjs +5 -0
- package/esm2020/colorpicker/models/tile-size.mjs +6 -0
- package/esm2020/colorpicker/models.mjs +16 -0
- package/esm2020/colorpicker/services/color-palette.service.mjs +67 -0
- package/esm2020/colorpicker/services/flatcolorpicker.service.mjs +39 -0
- package/esm2020/colorpicker/utils/color-parser.mjs +164 -0
- package/esm2020/colorpicker/utils/contrast-curve.mjs +85 -0
- package/esm2020/colorpicker/utils.mjs +6 -0
- package/esm2020/colorpicker.module.mjs +104 -0
- package/esm2020/common/dom-utils.mjs +36 -0
- package/esm2020/common/math.mjs +65 -0
- package/esm2020/common/models/fillmode.mjs +5 -0
- package/esm2020/common/models/rounded.mjs +5 -0
- package/esm2020/common/models/size.mjs +5 -0
- package/esm2020/common/models/styling-classes.mjs +5 -0
- package/esm2020/common/models.mjs +8 -0
- package/esm2020/common/utils.mjs +81 -0
- package/esm2020/formfield/error.component.mjs +68 -0
- package/esm2020/formfield/formfield.component.mjs +284 -0
- package/esm2020/formfield/hint.component.mjs +63 -0
- package/esm2020/formfield/models/message-align.mjs +5 -0
- package/esm2020/formfield/models/orientation.mjs +5 -0
- package/esm2020/formfield/models/show-options.mjs +5 -0
- package/esm2020/formfield.module.mjs +54 -0
- package/esm2020/index.mjs +66 -0
- package/esm2020/inputs.module.mjs +98 -0
- package/esm2020/maskedtextbox/maskedtextbox.component.mjs +711 -0
- package/esm2020/maskedtextbox/masking.service.mjs +191 -0
- package/esm2020/maskedtextbox/parsing/combinators.mjs +28 -0
- package/esm2020/maskedtextbox/parsing/parsers.mjs +147 -0
- package/esm2020/maskedtextbox/parsing/result.mjs +41 -0
- package/esm2020/maskedtextbox/parsing/stream.mjs +41 -0
- package/esm2020/maskedtextbox.module.mjs +53 -0
- package/esm2020/numerictextbox/arrow-direction.mjs +13 -0
- package/esm2020/numerictextbox/constants.mjs +28 -0
- package/esm2020/numerictextbox/localization/custom-messages.component.mjs +41 -0
- package/esm2020/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +37 -0
- package/esm2020/numerictextbox/localization/messages.mjs +25 -0
- package/esm2020/numerictextbox/numerictextbox.component.mjs +1105 -0
- package/esm2020/numerictextbox/utils.mjs +92 -0
- package/esm2020/numerictextbox.module.mjs +66 -0
- package/esm2020/package-metadata.mjs +15 -0
- package/esm2020/progress-kendo-angular-inputs.mjs +8 -0
- package/esm2020/radiobutton/radiobutton.directive.mjs +76 -0
- package/esm2020/radiobutton.module.mjs +52 -0
- package/esm2020/rangeslider/localization/custom-messages.component.mjs +41 -0
- package/esm2020/rangeslider/localization/localized-rangeslider-messages.directive.mjs +37 -0
- package/esm2020/rangeslider/localization/messages.mjs +25 -0
- package/esm2020/rangeslider/rangeslider-model.mjs +52 -0
- package/esm2020/rangeslider/rangeslider-value.type.mjs +5 -0
- package/esm2020/rangeslider/rangeslider.component.mjs +605 -0
- package/esm2020/rangeslider.module.mjs +71 -0
- package/esm2020/shared/input-separator.component.mjs +41 -0
- package/esm2020/shared/textarea.directive.mjs +260 -0
- package/esm2020/shared/utils.mjs +13 -0
- package/esm2020/shared.module.mjs +32 -0
- package/esm2020/signature/events/close-event.mjs +10 -0
- package/esm2020/signature/events/index.mjs +6 -0
- package/esm2020/signature/events/open-event.mjs +10 -0
- package/esm2020/signature/localization/custom-messages.component.mjs +41 -0
- package/esm2020/signature/localization/index.mjs +7 -0
- package/esm2020/signature/localization/localized-signature-messages.directive.mjs +37 -0
- package/esm2020/signature/localization/messages.mjs +29 -0
- package/esm2020/signature/signature.component.mjs +906 -0
- package/esm2020/signature.module.mjs +79 -0
- package/esm2020/slider/localization/custom-messages.component.mjs +41 -0
- package/esm2020/slider/localization/localized-slider-messages.directive.mjs +37 -0
- package/esm2020/slider/localization/messages.mjs +27 -0
- package/esm2020/slider/slider-model.mjs +34 -0
- package/esm2020/slider/slider.component.mjs +646 -0
- package/esm2020/slider.module.mjs +73 -0
- package/esm2020/sliders-common/label-template.directive.mjs +45 -0
- package/esm2020/sliders-common/slider-base.mjs +255 -0
- package/esm2020/sliders-common/slider-model.base.mjs +93 -0
- package/esm2020/sliders-common/slider-ticks.component.mjs +125 -0
- package/esm2020/sliders-common/sliders-common.module.mjs +42 -0
- package/esm2020/sliders-common/sliders-util.mjs +219 -0
- package/esm2020/sliders-common/title-callback.mjs +5 -0
- package/esm2020/switch/events/blur-event.mjs +9 -0
- package/esm2020/switch/events/focus-event.mjs +9 -0
- package/esm2020/switch/localization/custom-messages.component.mjs +41 -0
- package/esm2020/switch/localization/localized-switch-messages.directive.mjs +37 -0
- package/esm2020/switch/localization/messages.mjs +25 -0
- package/esm2020/switch/switch.component.mjs +577 -0
- package/esm2020/switch.module.mjs +68 -0
- package/esm2020/text-fields-common/text-fields-base.mjs +128 -0
- package/esm2020/textarea/models/flow.mjs +5 -0
- package/esm2020/textarea/models/resize.mjs +5 -0
- package/esm2020/textarea/textarea-suffix.component.mjs +40 -0
- package/esm2020/textarea/textarea.component.mjs +604 -0
- package/esm2020/textarea.module.mjs +68 -0
- package/esm2020/textbox/localization/custom-messages.component.mjs +41 -0
- package/esm2020/textbox/localization/localized-textbox-messages.directive.mjs +37 -0
- package/esm2020/textbox/localization/messages.mjs +23 -0
- package/esm2020/textbox/models/icon-show-options.mjs +5 -0
- package/esm2020/textbox/textbox-prefix.directive.mjs +38 -0
- package/esm2020/textbox/textbox-suffix.directive.mjs +37 -0
- package/esm2020/textbox/textbox.component.mjs +849 -0
- package/esm2020/textbox/textbox.directive.mjs +121 -0
- package/esm2020/textbox.module.mjs +89 -0
- package/esm2020/validators/max.validator.mjs +21 -0
- package/esm2020/validators/min.validator.mjs +21 -0
- package/fesm2015/progress-kendo-angular-inputs.mjs +15090 -0
- package/fesm2020/progress-kendo-angular-inputs.mjs +15055 -0
- package/formfield/error.component.d.ts +31 -0
- package/formfield/formfield.component.d.ts +98 -0
- package/formfield/hint.component.d.ts +29 -0
- package/formfield/models/message-align.d.ts +8 -0
- package/formfield/models/orientation.d.ts +9 -0
- package/formfield/models/show-options.d.ts +16 -0
- package/formfield.module.d.ts +45 -0
- package/index.d.ts +76 -0
- package/inputs.module.d.ts +55 -0
- package/maskedtextbox/maskedtextbox.component.d.ts +315 -0
- package/maskedtextbox/masking.service.d.ts +48 -0
- package/maskedtextbox/parsing/combinators.d.ts +13 -0
- package/maskedtextbox/parsing/parsers.d.ts +51 -0
- package/maskedtextbox/parsing/result.d.ts +27 -0
- package/maskedtextbox/parsing/stream.d.ts +26 -0
- package/maskedtextbox.module.d.ts +44 -0
- package/numerictextbox/arrow-direction.d.ts +12 -0
- package/numerictextbox/constants.d.ts +28 -0
- package/numerictextbox/localization/custom-messages.component.d.ts +17 -0
- package/numerictextbox/localization/localized-numerictextbox-messages.directive.d.ts +16 -0
- package/numerictextbox/localization/messages.d.ts +21 -0
- package/numerictextbox/numerictextbox.component.d.ts +364 -0
- package/numerictextbox/utils.d.ts +44 -0
- package/numerictextbox.module.d.ts +47 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +74 -0
- package/progress-kendo-angular-inputs.d.ts +9 -0
- package/radiobutton/radiobutton.directive.d.ts +38 -0
- package/radiobutton.module.d.ts +43 -0
- package/rangeslider/localization/custom-messages.component.d.ts +17 -0
- package/rangeslider/localization/localized-rangeslider-messages.directive.d.ts +16 -0
- package/rangeslider/localization/messages.d.ts +21 -0
- package/rangeslider/rangeslider-model.d.ts +15 -0
- package/rangeslider/rangeslider-value.type.d.ts +9 -0
- package/rangeslider/rangeslider.component.d.ts +139 -0
- package/rangeslider.module.d.ts +48 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +11 -0
- package/schematics/ngAdd/schema.json +28 -0
- package/shared/input-separator.component.d.ts +28 -0
- package/shared/textarea.directive.d.ts +99 -0
- package/shared/utils.d.ts +10 -0
- package/shared.module.d.ts +19 -0
- package/signature/events/close-event.d.ts +10 -0
- package/signature/events/index.d.ts +6 -0
- package/signature/events/open-event.d.ts +10 -0
- package/signature/localization/custom-messages.component.d.ts +17 -0
- package/signature/localization/index.d.ts +7 -0
- package/signature/localization/localized-signature-messages.directive.d.ts +16 -0
- package/signature/localization/messages.d.ts +29 -0
- package/signature/signature.component.d.ts +364 -0
- package/signature.module.d.ts +48 -0
- package/slider/localization/custom-messages.component.d.ts +17 -0
- package/slider/localization/localized-slider-messages.directive.d.ts +16 -0
- package/slider/localization/messages.d.ts +25 -0
- package/slider/slider-model.d.ts +14 -0
- package/slider/slider.component.d.ts +175 -0
- package/slider.module.d.ts +50 -0
- package/sliders-common/label-template.directive.d.ts +36 -0
- package/sliders-common/slider-base.d.ts +141 -0
- package/sliders-common/slider-model.base.d.ts +26 -0
- package/sliders-common/slider-ticks.component.d.ts +26 -0
- package/sliders-common/sliders-common.module.d.ts +17 -0
- package/sliders-common/sliders-util.d.ts +119 -0
- package/sliders-common/title-callback.d.ts +10 -0
- package/switch/events/blur-event.d.ts +13 -0
- package/switch/events/focus-event.d.ts +13 -0
- package/switch/localization/custom-messages.component.d.ts +17 -0
- package/switch/localization/localized-switch-messages.directive.d.ts +16 -0
- package/switch/localization/messages.d.ts +21 -0
- package/switch/switch.component.d.ts +216 -0
- package/switch.module.d.ts +46 -0
- package/text-fields-common/text-fields-base.d.ts +91 -0
- package/textarea/models/flow.d.ts +12 -0
- package/textarea/models/resize.d.ts +16 -0
- package/textarea/textarea-suffix.component.d.ts +26 -0
- package/textarea/textarea.component.d.ts +225 -0
- package/textarea.module.d.ts +48 -0
- package/textbox/localization/custom-messages.component.d.ts +17 -0
- package/textbox/localization/localized-textbox-messages.directive.d.ts +16 -0
- package/textbox/localization/messages.d.ts +17 -0
- package/textbox/models/icon-show-options.d.ts +13 -0
- package/textbox/textbox-prefix.directive.d.ts +29 -0
- package/textbox/textbox-suffix.directive.d.ts +28 -0
- package/textbox/textbox.component.d.ts +376 -0
- package/textbox/textbox.directive.d.ts +59 -0
- package/textbox.module.d.ts +53 -0
- package/validators/max.validator.d.ts +8 -0
- package/validators/min.validator.d.ts +8 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 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 } 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 } 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 * as i0 from "@angular/core";
|
|
20
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
21
|
+
import * as i2 from "@progress/kendo-angular-buttons";
|
|
22
|
+
import * as i3 from "../sliders-common/slider-ticks.component";
|
|
23
|
+
import * as i4 from "@progress/kendo-angular-common";
|
|
24
|
+
import * as i5 from "./localization/localized-slider-messages.directive";
|
|
25
|
+
import * as i6 from "@angular/common";
|
|
26
|
+
const PRESSED = 'k-pressed';
|
|
27
|
+
/**
|
|
28
|
+
* Represents the [Kendo UI Slider component for Angular]({% slug overview_slider %}).
|
|
29
|
+
*/
|
|
30
|
+
export class SliderComponent extends SliderBase {
|
|
31
|
+
constructor(localization, injector, renderer, ngZone, changeDetector, hostElement) {
|
|
32
|
+
super(localization, injector, renderer, ngZone, changeDetector, hostElement);
|
|
33
|
+
this.localization = localization;
|
|
34
|
+
this.injector = injector;
|
|
35
|
+
this.renderer = renderer;
|
|
36
|
+
this.ngZone = ngZone;
|
|
37
|
+
this.changeDetector = changeDetector;
|
|
38
|
+
this.hostElement = hostElement;
|
|
39
|
+
/**
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
this.focusableId = `k-${guid()}`;
|
|
43
|
+
/**
|
|
44
|
+
* Determines if the animation will be played on value change.
|
|
45
|
+
* Regardless of this setting, no animation will be played during the initial rendering.
|
|
46
|
+
*/
|
|
47
|
+
this.animate = true;
|
|
48
|
+
/**
|
|
49
|
+
* Renders the arrow side buttons of the Slider ([see example]({% slug sidebuttons_slider %}#toc-hidden-state)).
|
|
50
|
+
* When `showButtons` is set to `false`, the buttons are not displayed.
|
|
51
|
+
*/
|
|
52
|
+
this.showButtons = true;
|
|
53
|
+
/**
|
|
54
|
+
* The current value of the Slider when it is initially displayed.
|
|
55
|
+
* The component can use either NgModel or the `value` binding but not both of them at the same time.
|
|
56
|
+
*/
|
|
57
|
+
this.value = this.min;
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
this.arrowUpIcon = caretAltUpIcon;
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
this.arrowDownIcon = caretAltDownIcon;
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
this.arrowLeftIcon = caretAltLeftIcon;
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
this.arrowRightIcon = caretAltRightIcon;
|
|
74
|
+
this.focusChangedProgrammatically = false;
|
|
75
|
+
/**
|
|
76
|
+
* @hidden
|
|
77
|
+
*/
|
|
78
|
+
this.onWrapClick = (args) => {
|
|
79
|
+
const target = args.target;
|
|
80
|
+
if (!this.isDisabled && !(target.closest('.k-button'))) {
|
|
81
|
+
const value = eventValue(args, this.track.nativeElement, this.getProps());
|
|
82
|
+
this.changeValue(value);
|
|
83
|
+
}
|
|
84
|
+
invokeElementMethod(this.draghandle, 'focus');
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
this.onKeyDown = (e) => {
|
|
90
|
+
const options = this.getProps();
|
|
91
|
+
const { max, min } = options;
|
|
92
|
+
const handler = this.keyBinding[e.keyCode];
|
|
93
|
+
if (this.isDisabled || !handler) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const value = handler(options);
|
|
97
|
+
this.changeValue(trimValue(max, min, value));
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
};
|
|
100
|
+
this.ngChange = (_) => { };
|
|
101
|
+
this.ngTouched = () => { };
|
|
102
|
+
this.decreaseValue = () => {
|
|
103
|
+
this.changeValue(decreaseValueToStep(this.value, this.getProps()));
|
|
104
|
+
};
|
|
105
|
+
this.increaseValue = () => {
|
|
106
|
+
this.changeValue(increaseValueToStep(this.value, this.getProps()));
|
|
107
|
+
};
|
|
108
|
+
this.handleBlur = () => {
|
|
109
|
+
this.changeDetector.markForCheck();
|
|
110
|
+
this.focused = false;
|
|
111
|
+
if (hasObservers(this.onBlur) || requiresZoneOnBlur(this.control)) {
|
|
112
|
+
this.ngZone.run(() => {
|
|
113
|
+
this.ngTouched();
|
|
114
|
+
if (!this.focusChangedProgrammatically) {
|
|
115
|
+
this.onBlur.emit();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @hidden
|
|
123
|
+
*/
|
|
124
|
+
set tabIndex(tabIndex) {
|
|
125
|
+
this.tabindex = tabIndex;
|
|
126
|
+
}
|
|
127
|
+
get tabIndex() {
|
|
128
|
+
return this.tabindex;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @hidden
|
|
132
|
+
*/
|
|
133
|
+
get currentValue() {
|
|
134
|
+
return isPresent(this.value) ? this.value.toString() : '';
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Focuses the Slider.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts-no-run
|
|
141
|
+
* _@Component({
|
|
142
|
+
* selector: 'my-app',
|
|
143
|
+
* template: `
|
|
144
|
+
* <button (click)="slider.focus()">Focus</button>
|
|
145
|
+
* <kendo-slider #slider></kendo-slider>
|
|
146
|
+
* `
|
|
147
|
+
* })
|
|
148
|
+
* class AppComponent { }
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
focus() {
|
|
152
|
+
if (!this.disabled) {
|
|
153
|
+
this.focusChangedProgrammatically = true;
|
|
154
|
+
invokeElementMethod(this.draghandle, 'focus');
|
|
155
|
+
this.focusChangedProgrammatically = false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Blurs the Slider.
|
|
160
|
+
*/
|
|
161
|
+
blur() {
|
|
162
|
+
this.focusChangedProgrammatically = true;
|
|
163
|
+
invokeElementMethod(this.draghandle, 'blur');
|
|
164
|
+
this.handleBlur();
|
|
165
|
+
this.focusChangedProgrammatically = false;
|
|
166
|
+
}
|
|
167
|
+
ngOnChanges(changes) {
|
|
168
|
+
if (anyChanged(['value', 'fixedTickWidth', 'tickPlacement'], changes, true)) {
|
|
169
|
+
this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(() => {
|
|
170
|
+
this.sizeComponent(false);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
ngAfterViewInit() {
|
|
175
|
+
if (!isDocumentAvailable()) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (this.showButtons) {
|
|
179
|
+
this.setValueChangeInterval(this.increaseButton.nativeElement, () => this.increaseValue());
|
|
180
|
+
this.setValueChangeInterval(this.decreaseButton.nativeElement, () => this.decreaseValue());
|
|
181
|
+
}
|
|
182
|
+
this.sizeComponent(false);
|
|
183
|
+
if (this.ticks) {
|
|
184
|
+
this.ticks.tickElements
|
|
185
|
+
.changes
|
|
186
|
+
.subscribe(() => this.sizeComponent(false));
|
|
187
|
+
}
|
|
188
|
+
this.attachElementEventHandlers();
|
|
189
|
+
this.isSliderInvalid();
|
|
190
|
+
}
|
|
191
|
+
ngOnDestroy() {
|
|
192
|
+
if (this.subscriptions) {
|
|
193
|
+
this.subscriptions.unsubscribe();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @hidden
|
|
198
|
+
*/
|
|
199
|
+
get incrementMessage() {
|
|
200
|
+
return this.incrementTitle || this.localizationService.get('increment');
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @hidden
|
|
204
|
+
*/
|
|
205
|
+
get decrementMessage() {
|
|
206
|
+
return this.decrementTitle || this.localizationService.get('decrement');
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @hidden
|
|
210
|
+
*/
|
|
211
|
+
get dragHandleMessage() {
|
|
212
|
+
return this.dragHandleTitle || this.localizationService.get('dragHandle');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @hidden
|
|
216
|
+
*/
|
|
217
|
+
handleDragPress(args) {
|
|
218
|
+
if (args.originalEvent) {
|
|
219
|
+
args.originalEvent.preventDefault();
|
|
220
|
+
}
|
|
221
|
+
this.renderer.removeClass(this.hostElement.nativeElement, 'k-slider-transitions');
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @hidden
|
|
225
|
+
*/
|
|
226
|
+
onHandleDrag(args) {
|
|
227
|
+
this.dragging = true;
|
|
228
|
+
this.changeValue(eventValue(args, this.track.nativeElement, this.getProps()));
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @hidden
|
|
232
|
+
*/
|
|
233
|
+
onHandleRelease() {
|
|
234
|
+
this.dragging = false; //needed for animation
|
|
235
|
+
this.renderer.addClass(this.hostElement.nativeElement, 'k-slider-transitions');
|
|
236
|
+
}
|
|
237
|
+
//ngModel binding
|
|
238
|
+
/**
|
|
239
|
+
* @hidden
|
|
240
|
+
*/
|
|
241
|
+
writeValue(value) {
|
|
242
|
+
this.changeDetector.markForCheck();
|
|
243
|
+
this.value = value;
|
|
244
|
+
this.sizeComponent(this.animate);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @hidden
|
|
248
|
+
*/
|
|
249
|
+
registerOnChange(fn) {
|
|
250
|
+
this.ngChange = fn;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* @hidden
|
|
254
|
+
*/
|
|
255
|
+
registerOnTouched(fn) {
|
|
256
|
+
this.ngTouched = fn;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @hidden
|
|
260
|
+
*/
|
|
261
|
+
changeValue(value) {
|
|
262
|
+
if (!areSame(this.value, value)) {
|
|
263
|
+
this.ngZone.run(() => {
|
|
264
|
+
this.value = value;
|
|
265
|
+
this.ngChange(value);
|
|
266
|
+
this.valueChange.emit(value);
|
|
267
|
+
this.sizeComponent(this.animate);
|
|
268
|
+
this.changeDetector.markForCheck();
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
this.isSliderInvalid();
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* @hidden
|
|
275
|
+
*/
|
|
276
|
+
sizeComponent(animate) {
|
|
277
|
+
if (!isDocumentAvailable()) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const wrapper = this.wrapper.nativeElement;
|
|
281
|
+
const track = this.track.nativeElement;
|
|
282
|
+
const selectionEl = this.sliderSelection.nativeElement;
|
|
283
|
+
const dragHandleEl = this.draghandle.nativeElement;
|
|
284
|
+
const ticks = this.ticks ? this.ticksContainer.nativeElement : null;
|
|
285
|
+
if (!animate) {
|
|
286
|
+
this.renderer.removeClass(this.hostElement.nativeElement, 'k-slider-transitions');
|
|
287
|
+
}
|
|
288
|
+
this.resetStyles([track, selectionEl, dragHandleEl, ticks, this.hostElement.nativeElement]);
|
|
289
|
+
const props = this.getProps();
|
|
290
|
+
const model = new SliderModel(props, wrapper, track, this.renderer);
|
|
291
|
+
model.resizeTrack();
|
|
292
|
+
if (this.ticks) { //for case when tickPlacement: none
|
|
293
|
+
model.resizeTicks(this.ticksContainer.nativeElement, this.ticks.tickElements.map(element => element.nativeElement));
|
|
294
|
+
}
|
|
295
|
+
model.positionHandle(dragHandleEl);
|
|
296
|
+
model.positionSelection(selectionEl);
|
|
297
|
+
if (!animate) {
|
|
298
|
+
this.hostElement.nativeElement.getBoundingClientRect();
|
|
299
|
+
this.renderer.addClass(this.hostElement.nativeElement, 'k-slider-transitions');
|
|
300
|
+
}
|
|
301
|
+
if (this.fixedTickWidth) {
|
|
302
|
+
model.resizeWrapper();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
set focused(value) {
|
|
306
|
+
if (this.isFocused !== value && this.hostElement) {
|
|
307
|
+
this.isFocused = value;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
set dragging(value) {
|
|
311
|
+
if (this.isDragged !== value && this.sliderSelection && this.draghandle) {
|
|
312
|
+
const sliderSelection = this.sliderSelection.nativeElement;
|
|
313
|
+
const draghandle = this.draghandle.nativeElement;
|
|
314
|
+
if (value) {
|
|
315
|
+
this.renderer.addClass(sliderSelection, PRESSED);
|
|
316
|
+
this.renderer.addClass(draghandle, PRESSED);
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.renderer.removeClass(sliderSelection, PRESSED);
|
|
320
|
+
this.renderer.removeClass(draghandle, PRESSED);
|
|
321
|
+
}
|
|
322
|
+
this.isDragged = value;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
setValueChangeInterval(element, callback) {
|
|
326
|
+
this.ngZone.runOutsideAngular(() => {
|
|
327
|
+
const mousedown = fromEvent(element, 'mousedown');
|
|
328
|
+
const mouseup = fromEvent(element, 'mouseup');
|
|
329
|
+
const mouseout = fromEvent(element, 'mouseout');
|
|
330
|
+
const subscription = mousedown.pipe(filter((e) => e.button === 0 && !this.isDisabled), concatMap(() => interval(150).pipe(startWith(-1), takeUntil(merge(mouseup, mouseout))))).subscribe(() => {
|
|
331
|
+
if (!this.isFocused) {
|
|
332
|
+
invokeElementMethod(this.draghandle, 'focus');
|
|
333
|
+
}
|
|
334
|
+
callback();
|
|
335
|
+
});
|
|
336
|
+
this.subscriptions.add(subscription);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
getProps() {
|
|
340
|
+
return {
|
|
341
|
+
buttons: this.showButtons,
|
|
342
|
+
disabled: this.disabled,
|
|
343
|
+
fixedTickWidth: this.fixedTickWidth,
|
|
344
|
+
largeStep: this.largeStep,
|
|
345
|
+
max: this.max,
|
|
346
|
+
min: this.min,
|
|
347
|
+
readonly: this.readonly,
|
|
348
|
+
reverse: this.reverse,
|
|
349
|
+
rtl: this.localizationService.rtl,
|
|
350
|
+
smallStep: this.smallStep,
|
|
351
|
+
value: trimValue(this.max, this.min, this.value),
|
|
352
|
+
vertical: this.vertical
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
isSliderInvalid() {
|
|
356
|
+
const sliderClasses = this.hostElement.nativeElement.classList;
|
|
357
|
+
this.isInvalid = sliderClasses.contains('ng-invalid') ? true : false;
|
|
358
|
+
this.renderer.setAttribute(this.draghandle.nativeElement, 'aria-invalid', `${this.isInvalid}`);
|
|
359
|
+
}
|
|
360
|
+
attachElementEventHandlers() {
|
|
361
|
+
const hostElement = this.hostElement.nativeElement;
|
|
362
|
+
let tabbing = false;
|
|
363
|
+
let cursorInsideWrapper = false;
|
|
364
|
+
this.ngZone.runOutsideAngular(() => {
|
|
365
|
+
// focusIn and focusOut are relative to the host element
|
|
366
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
|
|
367
|
+
if (!this.isFocused) {
|
|
368
|
+
this.ngZone.run(() => {
|
|
369
|
+
if (!this.focusChangedProgrammatically) {
|
|
370
|
+
this.onFocus.emit();
|
|
371
|
+
}
|
|
372
|
+
this.focused = true;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}));
|
|
376
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (args) => {
|
|
377
|
+
if (!this.isFocused) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (tabbing) {
|
|
381
|
+
if (args.relatedTarget !== this.draghandle.nativeElement) {
|
|
382
|
+
this.handleBlur();
|
|
383
|
+
}
|
|
384
|
+
tabbing = false;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
if (!cursorInsideWrapper) {
|
|
388
|
+
this.handleBlur();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}));
|
|
392
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseenter', () => {
|
|
393
|
+
cursorInsideWrapper = true;
|
|
394
|
+
}));
|
|
395
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseleave', () => {
|
|
396
|
+
cursorInsideWrapper = false;
|
|
397
|
+
}));
|
|
398
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (args) => {
|
|
399
|
+
if (args.keyCode === Keys.Tab) {
|
|
400
|
+
tabbing = true;
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
tabbing = false;
|
|
404
|
+
}
|
|
405
|
+
}));
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
get decreaseButtonArrowIcon() {
|
|
409
|
+
const icon = !this.vertical ?
|
|
410
|
+
this.direction === 'ltr' ?
|
|
411
|
+
'caret-alt-left' :
|
|
412
|
+
'caret-alt-right' :
|
|
413
|
+
'caret-alt-down';
|
|
414
|
+
return icon;
|
|
415
|
+
}
|
|
416
|
+
get increaseButtonArrowIcon() {
|
|
417
|
+
const icon = !this.vertical ?
|
|
418
|
+
this.direction === 'ltr' ?
|
|
419
|
+
'caret-alt-right' :
|
|
420
|
+
'caret-alt-left' :
|
|
421
|
+
'caret-alt-up';
|
|
422
|
+
return icon;
|
|
423
|
+
}
|
|
424
|
+
get decreaseButtonArrowSVGIcon() {
|
|
425
|
+
const icon = !this.vertical ?
|
|
426
|
+
this.direction === 'ltr' ?
|
|
427
|
+
this.arrowLeftIcon :
|
|
428
|
+
this.arrowRightIcon :
|
|
429
|
+
this.arrowDownIcon;
|
|
430
|
+
return icon;
|
|
431
|
+
}
|
|
432
|
+
get increaseButtonArrowSVGIcon() {
|
|
433
|
+
const icon = !this.vertical ?
|
|
434
|
+
this.direction === 'ltr' ?
|
|
435
|
+
this.arrowRightIcon :
|
|
436
|
+
this.arrowLeftIcon :
|
|
437
|
+
this.arrowUpIcon;
|
|
438
|
+
return icon;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
SliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", 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 });
|
|
442
|
+
SliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SliderComponent, selector: "kendo-slider", inputs: { focusableId: "focusableId", dragHandleTitle: "dragHandleTitle", incrementTitle: "incrementTitle", animate: "animate", decrementTitle: "decrementTitle", showButtons: "showButtons", value: "value", tabIndex: "tabIndex" }, providers: [
|
|
443
|
+
LocalizationService,
|
|
444
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.slider' },
|
|
445
|
+
{ multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SliderComponent) },
|
|
446
|
+
{ provide: KendoInput, useExisting: forwardRef(() => SliderComponent) }
|
|
447
|
+
], 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: `
|
|
448
|
+
<ng-container kendoSliderLocalizedMessages
|
|
449
|
+
i18n-increment="kendo.slider.increment|The title of the **Increase** button of the Slider."
|
|
450
|
+
increment="increment"
|
|
451
|
+
i18n-decrement="kendo.slider.decrement|The title of the **Decrease** button of the Slider."
|
|
452
|
+
decrement="decrement"
|
|
453
|
+
i18n-dragHandle="kendo.slider.dragHandle|The title of the drag handle of the Slider."
|
|
454
|
+
dragHandle="Drag"
|
|
455
|
+
>
|
|
456
|
+
<button
|
|
457
|
+
kendoButton
|
|
458
|
+
#decreaseButton
|
|
459
|
+
*ngIf="showButtons"
|
|
460
|
+
type="button"
|
|
461
|
+
rounded="full"
|
|
462
|
+
[icon]="decreaseButtonArrowIcon"
|
|
463
|
+
[svgIcon]="decreaseButtonArrowSVGIcon"
|
|
464
|
+
class="k-button-decrease"
|
|
465
|
+
[title]="decrementMessage"
|
|
466
|
+
[attr.tabindex]="-1"
|
|
467
|
+
></button>
|
|
468
|
+
<div
|
|
469
|
+
#wrap
|
|
470
|
+
class="k-slider-track-wrap"
|
|
471
|
+
[class.k-slider-topleft]="tickPlacement === 'before'"
|
|
472
|
+
[class.k-slider-bottomright]="tickPlacement === 'after'"
|
|
473
|
+
[kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
|
|
474
|
+
>
|
|
475
|
+
<ul kendoSliderTicks
|
|
476
|
+
#ticks
|
|
477
|
+
*ngIf="tickPlacement !== 'none'"
|
|
478
|
+
[tickTitle]="title"
|
|
479
|
+
[vertical]="vertical"
|
|
480
|
+
[step]="smallStep"
|
|
481
|
+
[largeStep]="largeStep"
|
|
482
|
+
[min]="min"
|
|
483
|
+
[max]="max"
|
|
484
|
+
[labelTemplate]="labelTemplate?.templateRef"
|
|
485
|
+
[attr.aria-hidden]="true"
|
|
486
|
+
>
|
|
487
|
+
</ul>
|
|
488
|
+
<div #track class="k-slider-track">
|
|
489
|
+
<div #sliderSelection class="k-slider-selection">
|
|
490
|
+
</div>
|
|
491
|
+
<span #draghandle
|
|
492
|
+
role="slider"
|
|
493
|
+
[attr.aria-valuemin]="min"
|
|
494
|
+
[attr.aria-valuemax]="max"
|
|
495
|
+
[attr.aria-valuenow]="currentValue"
|
|
496
|
+
[attr.aria-valuetext]="currentValue"
|
|
497
|
+
[attr.aria-disabled]="disabled ? true : undefined"
|
|
498
|
+
[attr.aria-readonly]="readonly ? true : undefined"
|
|
499
|
+
[attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
|
|
500
|
+
[style.touch-action]="isDisabled ? '' : 'none'"
|
|
501
|
+
class="k-draghandle"
|
|
502
|
+
[title]="dragHandleMessage"
|
|
503
|
+
[attr.tabindex]="disabled ? '-1' : tabIndex"
|
|
504
|
+
[id]="focusableId"
|
|
505
|
+
kendoDraggable
|
|
506
|
+
(kendoPress)="ifEnabled(handleDragPress, $event)"
|
|
507
|
+
(kendoDrag)="ifEnabled(onHandleDrag, $event)"
|
|
508
|
+
(kendoRelease)="ifEnabled(onHandleRelease, $event)"
|
|
509
|
+
></span>
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
<button
|
|
513
|
+
kendoButton
|
|
514
|
+
#increaseButton
|
|
515
|
+
*ngIf="showButtons"
|
|
516
|
+
type="button"
|
|
517
|
+
rounded="full"
|
|
518
|
+
[icon]="increaseButtonArrowIcon"
|
|
519
|
+
[svgIcon]="increaseButtonArrowSVGIcon"
|
|
520
|
+
class="k-button-increase"
|
|
521
|
+
[title]="incrementMessage"
|
|
522
|
+
(click)="$event.preventDefault()"
|
|
523
|
+
[attr.tabindex]="-1"
|
|
524
|
+
[attr.aria-label]="currentValue"
|
|
525
|
+
></button>
|
|
526
|
+
<kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>
|
|
527
|
+
`, isInline: true, components: [{ type: i2.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i3.SliderTicksComponent, selector: "[kendoSliderTicks]", inputs: ["tickTitle", "vertical", "step", "largeStep", "min", "max", "labelTemplate"] }, { type: i4.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], directives: [{ type: i5.LocalizedSliderMessagesDirective, selector: "[kendoSliderLocalizedMessages]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i4.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }] });
|
|
528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SliderComponent, decorators: [{
|
|
529
|
+
type: Component,
|
|
530
|
+
args: [{
|
|
531
|
+
exportAs: 'kendoSlider',
|
|
532
|
+
providers: [
|
|
533
|
+
LocalizationService,
|
|
534
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.slider' },
|
|
535
|
+
{ multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SliderComponent) },
|
|
536
|
+
{ provide: KendoInput, useExisting: forwardRef(() => SliderComponent) }
|
|
537
|
+
],
|
|
538
|
+
selector: 'kendo-slider',
|
|
539
|
+
template: `
|
|
540
|
+
<ng-container kendoSliderLocalizedMessages
|
|
541
|
+
i18n-increment="kendo.slider.increment|The title of the **Increase** button of the Slider."
|
|
542
|
+
increment="increment"
|
|
543
|
+
i18n-decrement="kendo.slider.decrement|The title of the **Decrease** button of the Slider."
|
|
544
|
+
decrement="decrement"
|
|
545
|
+
i18n-dragHandle="kendo.slider.dragHandle|The title of the drag handle of the Slider."
|
|
546
|
+
dragHandle="Drag"
|
|
547
|
+
>
|
|
548
|
+
<button
|
|
549
|
+
kendoButton
|
|
550
|
+
#decreaseButton
|
|
551
|
+
*ngIf="showButtons"
|
|
552
|
+
type="button"
|
|
553
|
+
rounded="full"
|
|
554
|
+
[icon]="decreaseButtonArrowIcon"
|
|
555
|
+
[svgIcon]="decreaseButtonArrowSVGIcon"
|
|
556
|
+
class="k-button-decrease"
|
|
557
|
+
[title]="decrementMessage"
|
|
558
|
+
[attr.tabindex]="-1"
|
|
559
|
+
></button>
|
|
560
|
+
<div
|
|
561
|
+
#wrap
|
|
562
|
+
class="k-slider-track-wrap"
|
|
563
|
+
[class.k-slider-topleft]="tickPlacement === 'before'"
|
|
564
|
+
[class.k-slider-bottomright]="tickPlacement === 'after'"
|
|
565
|
+
[kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
|
|
566
|
+
>
|
|
567
|
+
<ul kendoSliderTicks
|
|
568
|
+
#ticks
|
|
569
|
+
*ngIf="tickPlacement !== 'none'"
|
|
570
|
+
[tickTitle]="title"
|
|
571
|
+
[vertical]="vertical"
|
|
572
|
+
[step]="smallStep"
|
|
573
|
+
[largeStep]="largeStep"
|
|
574
|
+
[min]="min"
|
|
575
|
+
[max]="max"
|
|
576
|
+
[labelTemplate]="labelTemplate?.templateRef"
|
|
577
|
+
[attr.aria-hidden]="true"
|
|
578
|
+
>
|
|
579
|
+
</ul>
|
|
580
|
+
<div #track class="k-slider-track">
|
|
581
|
+
<div #sliderSelection class="k-slider-selection">
|
|
582
|
+
</div>
|
|
583
|
+
<span #draghandle
|
|
584
|
+
role="slider"
|
|
585
|
+
[attr.aria-valuemin]="min"
|
|
586
|
+
[attr.aria-valuemax]="max"
|
|
587
|
+
[attr.aria-valuenow]="currentValue"
|
|
588
|
+
[attr.aria-valuetext]="currentValue"
|
|
589
|
+
[attr.aria-disabled]="disabled ? true : undefined"
|
|
590
|
+
[attr.aria-readonly]="readonly ? true : undefined"
|
|
591
|
+
[attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
|
|
592
|
+
[style.touch-action]="isDisabled ? '' : 'none'"
|
|
593
|
+
class="k-draghandle"
|
|
594
|
+
[title]="dragHandleMessage"
|
|
595
|
+
[attr.tabindex]="disabled ? '-1' : tabIndex"
|
|
596
|
+
[id]="focusableId"
|
|
597
|
+
kendoDraggable
|
|
598
|
+
(kendoPress)="ifEnabled(handleDragPress, $event)"
|
|
599
|
+
(kendoDrag)="ifEnabled(onHandleDrag, $event)"
|
|
600
|
+
(kendoRelease)="ifEnabled(onHandleRelease, $event)"
|
|
601
|
+
></span>
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
<button
|
|
605
|
+
kendoButton
|
|
606
|
+
#increaseButton
|
|
607
|
+
*ngIf="showButtons"
|
|
608
|
+
type="button"
|
|
609
|
+
rounded="full"
|
|
610
|
+
[icon]="increaseButtonArrowIcon"
|
|
611
|
+
[svgIcon]="increaseButtonArrowSVGIcon"
|
|
612
|
+
class="k-button-increase"
|
|
613
|
+
[title]="incrementMessage"
|
|
614
|
+
(click)="$event.preventDefault()"
|
|
615
|
+
[attr.tabindex]="-1"
|
|
616
|
+
[attr.aria-label]="currentValue"
|
|
617
|
+
></button>
|
|
618
|
+
<kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>
|
|
619
|
+
`
|
|
620
|
+
}]
|
|
621
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.Injector }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { focusableId: [{
|
|
622
|
+
type: Input
|
|
623
|
+
}], dragHandleTitle: [{
|
|
624
|
+
type: Input
|
|
625
|
+
}], incrementTitle: [{
|
|
626
|
+
type: Input
|
|
627
|
+
}], animate: [{
|
|
628
|
+
type: Input
|
|
629
|
+
}], decrementTitle: [{
|
|
630
|
+
type: Input
|
|
631
|
+
}], showButtons: [{
|
|
632
|
+
type: Input
|
|
633
|
+
}], value: [{
|
|
634
|
+
type: Input
|
|
635
|
+
}], tabIndex: [{
|
|
636
|
+
type: Input
|
|
637
|
+
}], draghandle: [{
|
|
638
|
+
type: ViewChild,
|
|
639
|
+
args: ['draghandle', { static: true }]
|
|
640
|
+
}], decreaseButton: [{
|
|
641
|
+
type: ViewChild,
|
|
642
|
+
args: ['decreaseButton', { read: ElementRef }]
|
|
643
|
+
}], increaseButton: [{
|
|
644
|
+
type: ViewChild,
|
|
645
|
+
args: ['increaseButton', { read: ElementRef }]
|
|
646
|
+
}] } });
|