@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,577 @@
|
|
|
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
|
+
import { ElementRef, Renderer2, Component, EventEmitter, HostBinding, Input, Output, ViewChild, forwardRef, ChangeDetectorRef, NgZone, Injector } from '@angular/core';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
7
|
+
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { hasObservers, guid, Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
9
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
+
import { packageMetadata } from '../package-metadata';
|
|
11
|
+
import { requiresZoneOnBlur, getStylingClasses } from '../common/utils';
|
|
12
|
+
import { skip, take } from "rxjs/operators";
|
|
13
|
+
import { browser } from '@progress/kendo-common';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "./localization/localized-switch-messages.directive";
|
|
17
|
+
const FOCUSED = 'k-focus';
|
|
18
|
+
const DEFAULT_SIZE = 'medium';
|
|
19
|
+
const DEFAULT_THUMB_ROUNDED = 'full';
|
|
20
|
+
const DEFAULT_TRACK_ROUNDED = 'full';
|
|
21
|
+
/**
|
|
22
|
+
* Represents the [Kendo UI Switch component for Angular]({% slug overview_switch %}).
|
|
23
|
+
*/
|
|
24
|
+
export class SwitchComponent {
|
|
25
|
+
constructor(renderer, hostElement, localizationService, injector, changeDetector, ngZone) {
|
|
26
|
+
this.renderer = renderer;
|
|
27
|
+
this.hostElement = hostElement;
|
|
28
|
+
this.localizationService = localizationService;
|
|
29
|
+
this.injector = injector;
|
|
30
|
+
this.changeDetector = changeDetector;
|
|
31
|
+
this.ngZone = ngZone;
|
|
32
|
+
/**
|
|
33
|
+
* Determines whether the Switch is disabled ([see example]({% slug disabled_switch %})).
|
|
34
|
+
*/
|
|
35
|
+
this.disabled = false;
|
|
36
|
+
/**
|
|
37
|
+
* Determines whether the Switch is in its read-only state ([see example]({% slug readonly_switch %})).
|
|
38
|
+
*/
|
|
39
|
+
this.readonly = false;
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the Switch.
|
|
42
|
+
*/
|
|
43
|
+
this.tabindex = 0;
|
|
44
|
+
/**
|
|
45
|
+
* Fires each time the Switch component is focused as a result of user interaction.
|
|
46
|
+
*/
|
|
47
|
+
this.onFocus = new EventEmitter();
|
|
48
|
+
/**
|
|
49
|
+
* Fires each time the Switch component is blurred as a result of user interaction.
|
|
50
|
+
*/
|
|
51
|
+
this.onBlur = new EventEmitter();
|
|
52
|
+
/**
|
|
53
|
+
* Fires each time the user selects a new value.
|
|
54
|
+
*/
|
|
55
|
+
this.valueChange = new EventEmitter();
|
|
56
|
+
this.hostRole = 'switch';
|
|
57
|
+
this.hostClasses = true;
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
this.initialized = false;
|
|
62
|
+
this.domSubscriptions = [];
|
|
63
|
+
this._checked = false;
|
|
64
|
+
this._size = 'medium';
|
|
65
|
+
this._trackRounded = 'full';
|
|
66
|
+
this._thumbRounded = 'full';
|
|
67
|
+
this.ngChange = (_) => { };
|
|
68
|
+
this.ngTouched = () => { };
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
this.handleFocus = (event) => {
|
|
73
|
+
if (this.isFocused) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
event.stopImmediatePropagation();
|
|
77
|
+
this.focused = true;
|
|
78
|
+
if (hasObservers(this.onFocus)) {
|
|
79
|
+
this.ngZone.run(() => {
|
|
80
|
+
const eventArgs = { originalEvent: event };
|
|
81
|
+
this.onFocus.emit(eventArgs);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @hidden
|
|
87
|
+
*/
|
|
88
|
+
this.handleBlur = (event) => {
|
|
89
|
+
const relatedTarget = event && event.relatedTarget;
|
|
90
|
+
if (this.hostElement.nativeElement.contains(relatedTarget)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
event.stopImmediatePropagation();
|
|
94
|
+
this.changeDetector.markForCheck();
|
|
95
|
+
this.focused = false;
|
|
96
|
+
if (hasObservers(this.onBlur) || requiresZoneOnBlur(this.control)) {
|
|
97
|
+
this.ngZone.run(() => {
|
|
98
|
+
this.ngTouched();
|
|
99
|
+
const eventArgs = { originalEvent: event };
|
|
100
|
+
this.onBlur.emit(eventArgs);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
validatePackage(packageMetadata);
|
|
105
|
+
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
106
|
+
this.keyDownHandler = this.keyDownHandler.bind(this);
|
|
107
|
+
this.clickHandler = this.clickHandler.bind(this);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
get focusableId() {
|
|
113
|
+
if (this.hostElement.nativeElement.hasAttribute('id')) {
|
|
114
|
+
return this.hostElement.nativeElement.getAttribute('id');
|
|
115
|
+
}
|
|
116
|
+
return `k-${guid()}`;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sets the value of the Switch when it is initially displayed.
|
|
120
|
+
*/
|
|
121
|
+
set checked(value) {
|
|
122
|
+
this.setHostClasses(value);
|
|
123
|
+
this._checked = value;
|
|
124
|
+
}
|
|
125
|
+
get checked() {
|
|
126
|
+
return this._checked;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Specifies the width and height of the Switch.
|
|
130
|
+
*
|
|
131
|
+
* The possible values are:
|
|
132
|
+
* * `small`
|
|
133
|
+
* * `medium` (default)
|
|
134
|
+
* * `large`
|
|
135
|
+
* * `none`
|
|
136
|
+
*/
|
|
137
|
+
set size(size) {
|
|
138
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
139
|
+
this.handleClasses(newSize, 'size');
|
|
140
|
+
this._size = newSize;
|
|
141
|
+
}
|
|
142
|
+
get size() {
|
|
143
|
+
return this._size;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Specifies the border radius of the Switch thumb.
|
|
147
|
+
*
|
|
148
|
+
* The possible values are:
|
|
149
|
+
* * `full` (default)
|
|
150
|
+
* * `small`
|
|
151
|
+
* * `medium`
|
|
152
|
+
* * `large`
|
|
153
|
+
* * `none`
|
|
154
|
+
*/
|
|
155
|
+
set thumbRounded(thumbRounded) {
|
|
156
|
+
const newThumbRounded = thumbRounded ? thumbRounded : DEFAULT_THUMB_ROUNDED;
|
|
157
|
+
this.handleThumbClasses(newThumbRounded);
|
|
158
|
+
this._thumbRounded = newThumbRounded;
|
|
159
|
+
}
|
|
160
|
+
get thumbRounded() {
|
|
161
|
+
return this._thumbRounded;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Specifies the border radius of the Switch track.
|
|
165
|
+
*
|
|
166
|
+
* The possible values are:
|
|
167
|
+
* * `full` (default)
|
|
168
|
+
* * `small`
|
|
169
|
+
* * `medium`
|
|
170
|
+
* * `large`
|
|
171
|
+
* * `none`
|
|
172
|
+
*/
|
|
173
|
+
set trackRounded(trackRounded) {
|
|
174
|
+
const newTrackRounded = trackRounded ? trackRounded : DEFAULT_TRACK_ROUNDED;
|
|
175
|
+
this.handleTrackClasses(newTrackRounded);
|
|
176
|
+
this._trackRounded = newTrackRounded;
|
|
177
|
+
}
|
|
178
|
+
get trackRounded() {
|
|
179
|
+
return this._trackRounded;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @hidden
|
|
183
|
+
*/
|
|
184
|
+
set tabIndex(tabIndex) {
|
|
185
|
+
this.tabindex = tabIndex;
|
|
186
|
+
}
|
|
187
|
+
get tabIndex() {
|
|
188
|
+
return this.tabindex;
|
|
189
|
+
}
|
|
190
|
+
get ieClass() {
|
|
191
|
+
return browser && browser.msie;
|
|
192
|
+
}
|
|
193
|
+
get hostId() {
|
|
194
|
+
return this.focusableId;
|
|
195
|
+
}
|
|
196
|
+
get ariaChecked() {
|
|
197
|
+
return this.checked;
|
|
198
|
+
}
|
|
199
|
+
get ariaInvalid() {
|
|
200
|
+
return this.isControlInvalid ? true : undefined;
|
|
201
|
+
}
|
|
202
|
+
get hostTabIndex() {
|
|
203
|
+
return this.disabled ? undefined : this.tabIndex;
|
|
204
|
+
}
|
|
205
|
+
get ariaDisabled() {
|
|
206
|
+
return this.disabled ? true : undefined;
|
|
207
|
+
}
|
|
208
|
+
get ariaReadonly() {
|
|
209
|
+
return this.readonly;
|
|
210
|
+
}
|
|
211
|
+
get disabledClass() {
|
|
212
|
+
return this.disabled;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @hidden
|
|
216
|
+
*/
|
|
217
|
+
get onLabelMessage() {
|
|
218
|
+
return this.onLabel || this.localizationService.get('on');
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @hidden
|
|
222
|
+
*/
|
|
223
|
+
get offLabelMessage() {
|
|
224
|
+
return this.offLabel || this.localizationService.get('off');
|
|
225
|
+
}
|
|
226
|
+
get isEnabled() {
|
|
227
|
+
return !this.disabled && !this.readonly;
|
|
228
|
+
}
|
|
229
|
+
ngOnInit() {
|
|
230
|
+
if (this.hostElement) {
|
|
231
|
+
const wrapper = this.hostElement.nativeElement;
|
|
232
|
+
this.renderer.removeAttribute(wrapper, "tabindex");
|
|
233
|
+
}
|
|
234
|
+
this.localizationChangeSubscription = this.localizationService
|
|
235
|
+
.changes
|
|
236
|
+
.pipe(skip(1))
|
|
237
|
+
.subscribe(({ rtl }) => {
|
|
238
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
239
|
+
});
|
|
240
|
+
this.control = this.injector.get(NgControl, null);
|
|
241
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => this.initialized = true);
|
|
242
|
+
}
|
|
243
|
+
ngAfterViewInit() {
|
|
244
|
+
const wrapper = this.hostElement.nativeElement;
|
|
245
|
+
if (!this.checked && !wrapper.classList.contains('k-switch-off')) {
|
|
246
|
+
this.renderer.addClass(wrapper, 'k-switch-off');
|
|
247
|
+
}
|
|
248
|
+
this.handleClasses(this.size, 'size');
|
|
249
|
+
this.handleTrackClasses(this.trackRounded);
|
|
250
|
+
this.handleThumbClasses(this.thumbRounded);
|
|
251
|
+
this.attachHostHandlers();
|
|
252
|
+
}
|
|
253
|
+
ngOnDestroy() {
|
|
254
|
+
if (this.localizationChangeSubscription) {
|
|
255
|
+
this.localizationChangeSubscription.unsubscribe();
|
|
256
|
+
}
|
|
257
|
+
this.domSubscriptions.forEach(subscription => subscription());
|
|
258
|
+
const wrapper = this.hostElement.nativeElement;
|
|
259
|
+
wrapper.removeEventListener('focus', this.handleFocus, true);
|
|
260
|
+
wrapper.removeEventListener('blur', this.handleBlur, true);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Focuses the Switch.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```ts-no-run
|
|
267
|
+
* _@Component({
|
|
268
|
+
* selector: 'my-app',
|
|
269
|
+
* template: `
|
|
270
|
+
* <button (click)="switch.focus()">Focus</button>
|
|
271
|
+
* <kendo-switch #switch></kendo-switch>
|
|
272
|
+
* `
|
|
273
|
+
* })
|
|
274
|
+
* class AppComponent { }
|
|
275
|
+
* ```
|
|
276
|
+
*/
|
|
277
|
+
focus() {
|
|
278
|
+
if (!this.hostElement) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.hostElement.nativeElement.focus();
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Blurs the Switch.
|
|
285
|
+
*/
|
|
286
|
+
blur() {
|
|
287
|
+
if (!this.hostElement) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
this.hostElement.nativeElement.blur();
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* @hidden
|
|
294
|
+
* Called when the status of the component changes to or from `disabled`.
|
|
295
|
+
* Depending on the value, it enables or disables the appropriate DOM element.
|
|
296
|
+
*/
|
|
297
|
+
setDisabledState(isDisabled) {
|
|
298
|
+
this.disabled = isDisabled;
|
|
299
|
+
this.changeDetector.markForCheck();
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* @hidden
|
|
303
|
+
*/
|
|
304
|
+
get isControlInvalid() {
|
|
305
|
+
return this.control && this.control.touched && !this.control.valid;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* @hidden
|
|
309
|
+
*/
|
|
310
|
+
writeValue(value) {
|
|
311
|
+
this.checked = value === null ? false : value;
|
|
312
|
+
this.changeDetector.markForCheck();
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @hidden
|
|
316
|
+
*/
|
|
317
|
+
registerOnChange(fn) {
|
|
318
|
+
this.ngChange = fn;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* @hidden
|
|
322
|
+
*/
|
|
323
|
+
registerOnTouched(fn) {
|
|
324
|
+
this.ngTouched = fn;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @hidden
|
|
328
|
+
*/
|
|
329
|
+
keyDownHandler(e) {
|
|
330
|
+
const keyCode = e.keyCode;
|
|
331
|
+
if (this.isEnabled && (keyCode === Keys.Space || keyCode === Keys.Enter)) {
|
|
332
|
+
this.changeValue(!this.checked);
|
|
333
|
+
e.preventDefault();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* @hidden
|
|
338
|
+
*/
|
|
339
|
+
clickHandler() {
|
|
340
|
+
if (this.isEnabled) {
|
|
341
|
+
this.changeValue(!this.checked);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* @hidden
|
|
346
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
347
|
+
*/
|
|
348
|
+
isEmpty() {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
changeValue(value) {
|
|
352
|
+
if (this.checked !== value) {
|
|
353
|
+
this.ngZone.run(() => {
|
|
354
|
+
this.checked = value;
|
|
355
|
+
this.ngChange(value);
|
|
356
|
+
this.valueChange.emit(value);
|
|
357
|
+
this.changeDetector.markForCheck();
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
set focused(value) {
|
|
362
|
+
if (this.isFocused !== value && this.hostElement) {
|
|
363
|
+
const wrapper = this.hostElement.nativeElement;
|
|
364
|
+
if (value) {
|
|
365
|
+
this.renderer.addClass(wrapper, FOCUSED);
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
this.renderer.removeClass(wrapper, FOCUSED);
|
|
369
|
+
}
|
|
370
|
+
this.isFocused = value;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
attachHostHandlers() {
|
|
374
|
+
this.ngZone.runOutsideAngular(() => {
|
|
375
|
+
const wrapper = this.hostElement.nativeElement;
|
|
376
|
+
this.domSubscriptions.push(this.renderer.listen(wrapper, 'click', this.clickHandler), this.renderer.listen(wrapper, 'keydown', this.keyDownHandler));
|
|
377
|
+
wrapper.addEventListener('focus', this.handleFocus, true);
|
|
378
|
+
wrapper.addEventListener('blur', this.handleBlur, true);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
setHostClasses(value) {
|
|
382
|
+
const wrapper = this.hostElement.nativeElement;
|
|
383
|
+
if (value) {
|
|
384
|
+
this.renderer.removeClass(wrapper, 'k-switch-off');
|
|
385
|
+
this.renderer.addClass(wrapper, 'k-switch-on');
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
this.renderer.removeClass(wrapper, 'k-switch-on');
|
|
389
|
+
this.renderer.addClass(wrapper, 'k-switch-off');
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
handleClasses(value, input) {
|
|
393
|
+
const elem = this.hostElement.nativeElement;
|
|
394
|
+
const classes = getStylingClasses('switch', input, this[input], value);
|
|
395
|
+
if (classes.toRemove) {
|
|
396
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
397
|
+
}
|
|
398
|
+
if (classes.toAdd) {
|
|
399
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
handleTrackClasses(value) {
|
|
403
|
+
const elem = this.hostElement?.nativeElement;
|
|
404
|
+
const track = this.track?.nativeElement;
|
|
405
|
+
if (!elem || !track) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const classes = getStylingClasses('switch', 'rounded', this.trackRounded, value);
|
|
409
|
+
if (classes.toRemove) {
|
|
410
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
411
|
+
this.renderer.removeClass(track, classes.toRemove);
|
|
412
|
+
}
|
|
413
|
+
if (classes.toAdd) {
|
|
414
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
415
|
+
this.renderer.addClass(track, classes.toAdd);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
handleThumbClasses(value) {
|
|
419
|
+
const thumb = this.thumb?.nativeElement;
|
|
420
|
+
if (!thumb) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const classes = getStylingClasses('switch', 'rounded', this.thumbRounded, value);
|
|
424
|
+
if (classes.toRemove) {
|
|
425
|
+
this.renderer.removeClass(thumb, classes.toRemove);
|
|
426
|
+
}
|
|
427
|
+
if (classes.toAdd) {
|
|
428
|
+
this.renderer.addClass(thumb, classes.toAdd);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
SwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
433
|
+
SwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SwitchComponent, selector: "kendo-switch", inputs: { focusableId: "focusableId", onLabel: "onLabel", offLabel: "offLabel", checked: "checked", disabled: "disabled", readonly: "readonly", tabindex: "tabindex", size: "size", thumbRounded: "thumbRounded", trackRounded: "trackRounded", tabIndex: "tabIndex" }, outputs: { onFocus: "focus", onBlur: "blur", valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.direction", "class.k-ie": "this.ieClass", "attr.role": "this.hostRole", "attr.id": "this.hostId", "attr.aria-checked": "this.ariaChecked", "attr.aria-invalid": "this.ariaInvalid", "attr.tabindex": "this.hostTabIndex", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-readonly": "this.ariaReadonly", "class.k-switch": "this.hostClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
|
|
434
|
+
LocalizationService,
|
|
435
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.switch' },
|
|
436
|
+
{
|
|
437
|
+
multi: true,
|
|
438
|
+
provide: NG_VALUE_ACCESSOR,
|
|
439
|
+
useExisting: forwardRef(() => SwitchComponent) /* eslint-disable-line*/
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
provide: KendoInput,
|
|
443
|
+
useExisting: forwardRef(() => SwitchComponent)
|
|
444
|
+
}
|
|
445
|
+
], viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, static: true }, { propertyName: "thumb", first: true, predicate: ["thumb"], descendants: true, static: true }], exportAs: ["kendoSwitch"], ngImport: i0, template: `
|
|
446
|
+
<ng-container kendoSwitchLocalizedMessages
|
|
447
|
+
i18n-on="kendo.switch.on|The **On** label of the Switch."
|
|
448
|
+
on="ON"
|
|
449
|
+
i18n-off="kendo.switch.off|The **Off** label of the Switch."
|
|
450
|
+
off="OFF"
|
|
451
|
+
>
|
|
452
|
+
|
|
453
|
+
<span
|
|
454
|
+
#track
|
|
455
|
+
class="k-switch-track"
|
|
456
|
+
[style.transitionDuration]="initialized ? '200ms' : '0ms'"
|
|
457
|
+
>
|
|
458
|
+
<span class="k-switch-label-on" [attr.aria-hidden]="true" >{{onLabelMessage}}</span>
|
|
459
|
+
<span class="k-switch-label-off" [attr.aria-hidden]="true">{{offLabelMessage}}</span>
|
|
460
|
+
</span>
|
|
461
|
+
<span
|
|
462
|
+
class="k-switch-thumb-wrap"
|
|
463
|
+
[style.transitionDuration]="initialized ? '200ms' : '0ms'">
|
|
464
|
+
<span #thumb class="k-switch-thumb"></span>
|
|
465
|
+
</span>
|
|
466
|
+
`, isInline: true, directives: [{ type: i2.LocalizedSwitchMessagesDirective, selector: "[kendoSwitchLocalizedMessages]" }] });
|
|
467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
468
|
+
type: Component,
|
|
469
|
+
args: [{
|
|
470
|
+
exportAs: 'kendoSwitch',
|
|
471
|
+
providers: [
|
|
472
|
+
LocalizationService,
|
|
473
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.switch' },
|
|
474
|
+
{
|
|
475
|
+
multi: true,
|
|
476
|
+
provide: NG_VALUE_ACCESSOR,
|
|
477
|
+
useExisting: forwardRef(() => SwitchComponent) /* eslint-disable-line*/
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
provide: KendoInput,
|
|
481
|
+
useExisting: forwardRef(() => SwitchComponent)
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
selector: 'kendo-switch',
|
|
485
|
+
template: `
|
|
486
|
+
<ng-container kendoSwitchLocalizedMessages
|
|
487
|
+
i18n-on="kendo.switch.on|The **On** label of the Switch."
|
|
488
|
+
on="ON"
|
|
489
|
+
i18n-off="kendo.switch.off|The **Off** label of the Switch."
|
|
490
|
+
off="OFF"
|
|
491
|
+
>
|
|
492
|
+
|
|
493
|
+
<span
|
|
494
|
+
#track
|
|
495
|
+
class="k-switch-track"
|
|
496
|
+
[style.transitionDuration]="initialized ? '200ms' : '0ms'"
|
|
497
|
+
>
|
|
498
|
+
<span class="k-switch-label-on" [attr.aria-hidden]="true" >{{onLabelMessage}}</span>
|
|
499
|
+
<span class="k-switch-label-off" [attr.aria-hidden]="true">{{offLabelMessage}}</span>
|
|
500
|
+
</span>
|
|
501
|
+
<span
|
|
502
|
+
class="k-switch-thumb-wrap"
|
|
503
|
+
[style.transitionDuration]="initialized ? '200ms' : '0ms'">
|
|
504
|
+
<span #thumb class="k-switch-thumb"></span>
|
|
505
|
+
</span>
|
|
506
|
+
`
|
|
507
|
+
}]
|
|
508
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { focusableId: [{
|
|
509
|
+
type: Input
|
|
510
|
+
}], onLabel: [{
|
|
511
|
+
type: Input
|
|
512
|
+
}], offLabel: [{
|
|
513
|
+
type: Input
|
|
514
|
+
}], checked: [{
|
|
515
|
+
type: Input
|
|
516
|
+
}], disabled: [{
|
|
517
|
+
type: Input
|
|
518
|
+
}], readonly: [{
|
|
519
|
+
type: Input
|
|
520
|
+
}], tabindex: [{
|
|
521
|
+
type: Input
|
|
522
|
+
}], size: [{
|
|
523
|
+
type: Input
|
|
524
|
+
}], thumbRounded: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}], trackRounded: [{
|
|
527
|
+
type: Input
|
|
528
|
+
}], tabIndex: [{
|
|
529
|
+
type: Input
|
|
530
|
+
}], onFocus: [{
|
|
531
|
+
type: Output,
|
|
532
|
+
args: ['focus']
|
|
533
|
+
}], onBlur: [{
|
|
534
|
+
type: Output,
|
|
535
|
+
args: ['blur']
|
|
536
|
+
}], valueChange: [{
|
|
537
|
+
type: Output
|
|
538
|
+
}], direction: [{
|
|
539
|
+
type: HostBinding,
|
|
540
|
+
args: ['attr.dir']
|
|
541
|
+
}], ieClass: [{
|
|
542
|
+
type: HostBinding,
|
|
543
|
+
args: ['class.k-ie']
|
|
544
|
+
}], hostRole: [{
|
|
545
|
+
type: HostBinding,
|
|
546
|
+
args: ['attr.role']
|
|
547
|
+
}], hostId: [{
|
|
548
|
+
type: HostBinding,
|
|
549
|
+
args: ['attr.id']
|
|
550
|
+
}], ariaChecked: [{
|
|
551
|
+
type: HostBinding,
|
|
552
|
+
args: ['attr.aria-checked']
|
|
553
|
+
}], ariaInvalid: [{
|
|
554
|
+
type: HostBinding,
|
|
555
|
+
args: ['attr.aria-invalid']
|
|
556
|
+
}], hostTabIndex: [{
|
|
557
|
+
type: HostBinding,
|
|
558
|
+
args: ['attr.tabindex']
|
|
559
|
+
}], ariaDisabled: [{
|
|
560
|
+
type: HostBinding,
|
|
561
|
+
args: ['attr.aria-disabled']
|
|
562
|
+
}], ariaReadonly: [{
|
|
563
|
+
type: HostBinding,
|
|
564
|
+
args: ['attr.aria-readonly']
|
|
565
|
+
}], hostClasses: [{
|
|
566
|
+
type: HostBinding,
|
|
567
|
+
args: ['class.k-switch']
|
|
568
|
+
}], disabledClass: [{
|
|
569
|
+
type: HostBinding,
|
|
570
|
+
args: ['class.k-disabled']
|
|
571
|
+
}], track: [{
|
|
572
|
+
type: ViewChild,
|
|
573
|
+
args: ['track', { static: true }]
|
|
574
|
+
}], thumb: [{
|
|
575
|
+
type: ViewChild,
|
|
576
|
+
args: ['thumb', { static: true }]
|
|
577
|
+
}] } });
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { SwitchComponent } from './switch/switch.component';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import { ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
9
|
+
import { LocalizedSwitchMessagesDirective } from './switch/localization/localized-switch-messages.directive';
|
|
10
|
+
import { SwitchCustomMessagesComponent } from './switch/localization/custom-messages.component';
|
|
11
|
+
import { EventsModule } from '@progress/kendo-angular-common';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
/**
|
|
14
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
15
|
+
* definition for the Switch component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* ```ts-no-run
|
|
20
|
+
* // Import the Switch module
|
|
21
|
+
* import { SwitchModule } from '@progress/kendo-angular-inputs';
|
|
22
|
+
*
|
|
23
|
+
* // The browser platform with a compiler
|
|
24
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
25
|
+
*
|
|
26
|
+
* import { NgModule } from '@angular/core';
|
|
27
|
+
*
|
|
28
|
+
* // Import the app component
|
|
29
|
+
* import { AppComponent } from './app.component';
|
|
30
|
+
*
|
|
31
|
+
* // Define the app module
|
|
32
|
+
* _@NgModule({
|
|
33
|
+
* declarations: [AppComponent], // declare app component
|
|
34
|
+
* imports: [BrowserModule, SwitchModule], // import Switch module
|
|
35
|
+
* bootstrap: [AppComponent]
|
|
36
|
+
* })
|
|
37
|
+
* export class AppModule {}
|
|
38
|
+
*
|
|
39
|
+
* // Compile and launch the module
|
|
40
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
41
|
+
*
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export class SwitchModule {
|
|
45
|
+
}
|
|
46
|
+
SwitchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
47
|
+
SwitchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchModule, declarations: [SwitchComponent,
|
|
48
|
+
SwitchCustomMessagesComponent,
|
|
49
|
+
LocalizedSwitchMessagesDirective], imports: [CommonModule, EventsModule, ResizeSensorModule], exports: [SwitchComponent,
|
|
50
|
+
SwitchCustomMessagesComponent,
|
|
51
|
+
LocalizedSwitchMessagesDirective] });
|
|
52
|
+
SwitchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchModule, imports: [[CommonModule, EventsModule, ResizeSensorModule]] });
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SwitchModule, decorators: [{
|
|
54
|
+
type: NgModule,
|
|
55
|
+
args: [{
|
|
56
|
+
declarations: [
|
|
57
|
+
SwitchComponent,
|
|
58
|
+
SwitchCustomMessagesComponent,
|
|
59
|
+
LocalizedSwitchMessagesDirective
|
|
60
|
+
],
|
|
61
|
+
exports: [
|
|
62
|
+
SwitchComponent,
|
|
63
|
+
SwitchCustomMessagesComponent,
|
|
64
|
+
LocalizedSwitchMessagesDirective
|
|
65
|
+
],
|
|
66
|
+
imports: [CommonModule, EventsModule, ResizeSensorModule]
|
|
67
|
+
}]
|
|
68
|
+
}] });
|