@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,849 @@
|
|
|
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 { isJapanese } from './../shared/utils';
|
|
7
|
+
import { closest } from './../common/dom-utils';
|
|
8
|
+
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
9
|
+
import { Component, ElementRef, forwardRef, Input, Output, EventEmitter, HostBinding, ViewChild, NgZone, ChangeDetectorRef, Injector, ContentChild, Renderer2 } from '@angular/core';
|
|
10
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
+
import { packageMetadata } from '../package-metadata';
|
|
12
|
+
import { invokeElementMethod } from '../common/dom-utils';
|
|
13
|
+
import { areSame, requiresZoneOnBlur, getStylingClasses } from '../common/utils';
|
|
14
|
+
import { guid, hasObservers, KendoInput, Keys, isSafari } from '@progress/kendo-angular-common';
|
|
15
|
+
import { TextBoxSuffixTemplateDirective } from './textbox-suffix.directive';
|
|
16
|
+
import { TextBoxPrefixTemplateDirective } from './textbox-prefix.directive';
|
|
17
|
+
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
18
|
+
import { checkIcon, exclamationCircleIcon, xIcon } 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-icons";
|
|
22
|
+
import * as i3 from "./localization/localized-textbox-messages.directive";
|
|
23
|
+
import * as i4 from "@angular/common";
|
|
24
|
+
import * as i5 from "@progress/kendo-angular-common";
|
|
25
|
+
const FOCUSED = 'k-focus';
|
|
26
|
+
const DEFAULT_SIZE = 'medium';
|
|
27
|
+
const DEFAULT_ROUNDED = 'medium';
|
|
28
|
+
const DEFAULT_FILL_MODE = 'solid';
|
|
29
|
+
const iconsMap = { checkIcon, exclamationCircleIcon, xIcon };
|
|
30
|
+
export class TextBoxComponent {
|
|
31
|
+
constructor(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
|
|
32
|
+
this.localizationService = localizationService;
|
|
33
|
+
this.ngZone = ngZone;
|
|
34
|
+
this.changeDetector = changeDetector;
|
|
35
|
+
this.renderer = renderer;
|
|
36
|
+
this.injector = injector;
|
|
37
|
+
this.hostElement = hostElement;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
this.focusableId = `k-${guid()}`;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the `title` attribute of the `input` element of the TextBox.
|
|
44
|
+
*/
|
|
45
|
+
this.title = '';
|
|
46
|
+
/**
|
|
47
|
+
* Sets the disabled state of the component.
|
|
48
|
+
*
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
this.disabled = false;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the read-only state of the component.
|
|
54
|
+
*
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
this.readonly = false;
|
|
58
|
+
/**
|
|
59
|
+
* Specifies the `tabindex` of the TextBox.
|
|
60
|
+
*
|
|
61
|
+
* @default 0
|
|
62
|
+
*/
|
|
63
|
+
this.tabindex = 0;
|
|
64
|
+
/**
|
|
65
|
+
* Provides a value for the TextBox.
|
|
66
|
+
*/
|
|
67
|
+
this.value = null;
|
|
68
|
+
/**
|
|
69
|
+
* Determines whether the whole value will be selected when the TextBox is clicked. Defaults to `false`.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
this.selectOnFocus = false;
|
|
74
|
+
/**
|
|
75
|
+
* Specifies when the Success icon will be shown ([see example]({% slug validation_textbox %})).
|
|
76
|
+
*
|
|
77
|
+
* The possible values are:
|
|
78
|
+
*
|
|
79
|
+
* `boolean`—The Success icon is displayed, if the condition given by the developer is met.
|
|
80
|
+
*
|
|
81
|
+
* `initial`—The Success icon will be displayed when the component state is neither `invalid` nor `touched` or `dirty`.
|
|
82
|
+
*
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
this.showSuccessIcon = false;
|
|
86
|
+
/**
|
|
87
|
+
* Specifies when the Error icon will be shown ([see example]({% slug validation_textbox %})).
|
|
88
|
+
*
|
|
89
|
+
* The possible values are:
|
|
90
|
+
*
|
|
91
|
+
* * `initial`—The Error icon will be displayed when the component state is
|
|
92
|
+
* `invalid` and `touched` or `dirty`.
|
|
93
|
+
* * `boolean`—The Error icon is displayed, if the condition given by the developer is met.
|
|
94
|
+
*
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
this.showErrorIcon = false;
|
|
98
|
+
/**
|
|
99
|
+
* Specifies whether a Clear button will be rendered.
|
|
100
|
+
*
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
this.clearButton = false;
|
|
104
|
+
/**
|
|
105
|
+
* Fires each time the value is changed—
|
|
106
|
+
* when the component is blurred or the value is cleared through the **Clear** button
|
|
107
|
+
* ([see example]({% slug overview_textbox %}#toc-events)).
|
|
108
|
+
* When the value of the component is programmatically changed to `ngModel` or `formControl`
|
|
109
|
+
* through its API or form binding, the `valueChange` event is not triggered because it
|
|
110
|
+
* might cause a mix-up with the built-in `valueChange` mechanisms of the `ngModel` or `formControl` bindings.
|
|
111
|
+
*/
|
|
112
|
+
this.valueChange = new EventEmitter();
|
|
113
|
+
/**
|
|
114
|
+
* Fires each time the user focuses the `input` element.
|
|
115
|
+
*/
|
|
116
|
+
this.inputFocus = new EventEmitter();
|
|
117
|
+
/**
|
|
118
|
+
* Fires each time the `input` element gets blurred.
|
|
119
|
+
*/
|
|
120
|
+
this.inputBlur = new EventEmitter();
|
|
121
|
+
/**
|
|
122
|
+
* Fires each time the user focuses the TextBox component.
|
|
123
|
+
*
|
|
124
|
+
* > To wire the event programmatically, use the `onFocus` property.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts-no-run
|
|
128
|
+
* _@Component({
|
|
129
|
+
* selector: 'my-app',
|
|
130
|
+
* template: `
|
|
131
|
+
* <kendo-textbox (focus)="handleFocus()"></kendo-textbox>
|
|
132
|
+
* `
|
|
133
|
+
* })
|
|
134
|
+
* class AppComponent {
|
|
135
|
+
* public handleFocus(): void {
|
|
136
|
+
* console.log('Component is isFocused');
|
|
137
|
+
* }
|
|
138
|
+
* }
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
this.onFocus = new EventEmitter();
|
|
142
|
+
/**
|
|
143
|
+
* Fires each time the TextBox component gets blurred.
|
|
144
|
+
*
|
|
145
|
+
* > To wire the event programmatically, use the `onBlur` property.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts-no-run
|
|
149
|
+
* _@Component({
|
|
150
|
+
* selector: 'my-app',
|
|
151
|
+
* template: `
|
|
152
|
+
* <kendo-textbox (blur)="handleBlur()"></kendo-textbox>
|
|
153
|
+
* `
|
|
154
|
+
* })
|
|
155
|
+
* class AppComponent {
|
|
156
|
+
* public handleBlur(): void {
|
|
157
|
+
* console.log('Component is blurred');
|
|
158
|
+
* }
|
|
159
|
+
* }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
this.onBlur = new EventEmitter();
|
|
163
|
+
this.hostClasses = true;
|
|
164
|
+
this._isFocused = false;
|
|
165
|
+
this.focusChangedProgrammatically = false;
|
|
166
|
+
this._size = 'medium';
|
|
167
|
+
this._rounded = 'medium';
|
|
168
|
+
this._fillMode = 'solid';
|
|
169
|
+
/**
|
|
170
|
+
* @hidden
|
|
171
|
+
*/
|
|
172
|
+
this.handleInputFocus = () => {
|
|
173
|
+
if (!this.disabled) {
|
|
174
|
+
if (this.selectOnFocus && this.value) {
|
|
175
|
+
this.ngZone.run(() => {
|
|
176
|
+
setTimeout(() => { this.selectAll(); });
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (hasObservers(this.onFocus)) {
|
|
180
|
+
if (!this.isFocused) {
|
|
181
|
+
this.ngZone.run(() => {
|
|
182
|
+
this.onFocus.emit();
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (hasObservers(this.inputFocus)) {
|
|
187
|
+
if (!this.focusChangedProgrammatically || (this.focusChangedProgrammatically && this.clearButtonClicked)) {
|
|
188
|
+
this.ngZone.run(() => {
|
|
189
|
+
this.inputFocus.emit();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
this.ngZone.run(() => {
|
|
194
|
+
this.isFocused = true;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* @hidden
|
|
200
|
+
*/
|
|
201
|
+
this.handleInputBlur = () => {
|
|
202
|
+
this.changeDetector.markForCheck();
|
|
203
|
+
if (hasObservers(this.inputBlur) || requiresZoneOnBlur(this.control)) {
|
|
204
|
+
this.ngZone.run(() => {
|
|
205
|
+
this.ngTouched();
|
|
206
|
+
this.inputBlur.emit();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @hidden
|
|
212
|
+
*/
|
|
213
|
+
this.handleInput = (ev) => {
|
|
214
|
+
const target = ev.target;
|
|
215
|
+
const isBrowserSafari = isSafari(navigator.userAgent);
|
|
216
|
+
const incomingValue = isBrowserSafari && isJapanese(target.value) ? ev.data : target.value;
|
|
217
|
+
const [caretStart, caretEnd] = [target.selectionStart, target.selectionEnd];
|
|
218
|
+
this.updateValue(incomingValue);
|
|
219
|
+
if (isBrowserSafari) {
|
|
220
|
+
target.setSelectionRange(caretStart, caretEnd);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
this.ngChange = (_) => { };
|
|
224
|
+
this.ngTouched = () => { };
|
|
225
|
+
validatePackage(packageMetadata);
|
|
226
|
+
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The size property specifies the padding of the TextBox internal input element
|
|
230
|
+
* ([see example]({% slug appearance_textbox %}#toc-size)).
|
|
231
|
+
*
|
|
232
|
+
* The possible values are:
|
|
233
|
+
* * `small`
|
|
234
|
+
* * `medium` (default)
|
|
235
|
+
* * `large`
|
|
236
|
+
* * `none`
|
|
237
|
+
*/
|
|
238
|
+
set size(size) {
|
|
239
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
240
|
+
this.handleClasses(newSize, 'size');
|
|
241
|
+
this._size = newSize;
|
|
242
|
+
}
|
|
243
|
+
get size() {
|
|
244
|
+
return this._size;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The rounded property specifies the border radius of the TextBox
|
|
248
|
+
* ([see example]({% slug appearance_textbox %}#toc-rounded)).
|
|
249
|
+
*
|
|
250
|
+
* The possible values are:
|
|
251
|
+
* * `small`
|
|
252
|
+
* * `medium` (default)
|
|
253
|
+
* * `large`
|
|
254
|
+
* * `full`
|
|
255
|
+
* * `none`
|
|
256
|
+
*/
|
|
257
|
+
set rounded(rounded) {
|
|
258
|
+
const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
|
|
259
|
+
this.handleClasses(newRounded, 'rounded');
|
|
260
|
+
this._rounded = newRounded;
|
|
261
|
+
}
|
|
262
|
+
get rounded() {
|
|
263
|
+
return this._rounded;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The fillMode property specifies the background and border styles of the TextBox
|
|
267
|
+
* ([see example]({% slug appearance_textbox %}#toc-fillMode)).
|
|
268
|
+
*
|
|
269
|
+
* The possible values are:
|
|
270
|
+
* * `flat`
|
|
271
|
+
* * `solid` (default)
|
|
272
|
+
* * `outline`
|
|
273
|
+
* * `none`
|
|
274
|
+
*/
|
|
275
|
+
set fillMode(fillMode) {
|
|
276
|
+
const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
|
|
277
|
+
this.handleClasses(newFillMode, 'fillMode');
|
|
278
|
+
this._fillMode = newFillMode;
|
|
279
|
+
}
|
|
280
|
+
get fillMode() {
|
|
281
|
+
return this._fillMode;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @hidden
|
|
285
|
+
*/
|
|
286
|
+
set tabIndex(tabIndex) {
|
|
287
|
+
this.tabindex = tabIndex;
|
|
288
|
+
}
|
|
289
|
+
get tabIndex() {
|
|
290
|
+
return this.tabindex;
|
|
291
|
+
}
|
|
292
|
+
get disabledClass() {
|
|
293
|
+
return this.disabled;
|
|
294
|
+
}
|
|
295
|
+
ngOnInit() {
|
|
296
|
+
this.control = this.injector.get(NgControl, null);
|
|
297
|
+
this.checkClearButton();
|
|
298
|
+
this.subscriptions = this.localizationService.changes.subscribe(({ rtl }) => {
|
|
299
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
ngAfterViewInit() {
|
|
303
|
+
const hostElement = this.hostElement.nativeElement;
|
|
304
|
+
let cursorInsideWrapper = false;
|
|
305
|
+
let tabbing = false;
|
|
306
|
+
this.ngZone.runOutsideAngular(() => {
|
|
307
|
+
// focusIn and focusOut are relative to the host element
|
|
308
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
|
|
309
|
+
if (!this.isFocused) {
|
|
310
|
+
this.ngZone.run(() => {
|
|
311
|
+
this.onFocus.emit();
|
|
312
|
+
this.isFocused = true;
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}));
|
|
316
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (args) => {
|
|
317
|
+
if (!this.isFocused) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
if (tabbing) {
|
|
321
|
+
const closestTextbox = closest(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
|
|
322
|
+
if (!closestTextbox) {
|
|
323
|
+
this.handleBlur();
|
|
324
|
+
}
|
|
325
|
+
tabbing = false;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
if (!cursorInsideWrapper && !this.clearButtonClicked) {
|
|
329
|
+
this.handleBlur();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}));
|
|
333
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseenter', () => {
|
|
334
|
+
cursorInsideWrapper = true;
|
|
335
|
+
}));
|
|
336
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseleave', () => {
|
|
337
|
+
cursorInsideWrapper = false;
|
|
338
|
+
}));
|
|
339
|
+
this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (args) => {
|
|
340
|
+
if (args.keyCode === Keys.Tab) {
|
|
341
|
+
tabbing = true;
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
tabbing = false;
|
|
345
|
+
}
|
|
346
|
+
}));
|
|
347
|
+
});
|
|
348
|
+
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
349
|
+
stylingInputs.forEach(input => {
|
|
350
|
+
this.handleClasses(this[input], input);
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
ngOnChanges(changes) {
|
|
354
|
+
if (changes['disabled'] || changes['readonly'] || changes['value']) {
|
|
355
|
+
this.checkClearButton();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
ngOnDestroy() {
|
|
359
|
+
if (this.subscriptions) {
|
|
360
|
+
this.subscriptions.unsubscribe();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* @hidden
|
|
365
|
+
*/
|
|
366
|
+
svgIcon(name) {
|
|
367
|
+
return iconsMap[name];
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Focuses the TextBox.
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```ts-no-run
|
|
374
|
+
* _@Component({
|
|
375
|
+
* selector: 'my-app',
|
|
376
|
+
* template: `
|
|
377
|
+
* <button (click)="input.focus()">Focus the input</button>
|
|
378
|
+
* <kendo-textbox #input></kendo-textbox>
|
|
379
|
+
* `
|
|
380
|
+
* })
|
|
381
|
+
* class AppComponent { }
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
focus() {
|
|
385
|
+
if (!this.input) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.focusChangedProgrammatically = true;
|
|
389
|
+
this.isFocused = true;
|
|
390
|
+
this.input.nativeElement.focus();
|
|
391
|
+
this.focusChangedProgrammatically = false;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Blurs the TextBox.
|
|
395
|
+
*/
|
|
396
|
+
blur() {
|
|
397
|
+
this.focusChangedProgrammatically = true;
|
|
398
|
+
const isFocusedElement = this.hostElement.nativeElement.querySelector(':focus');
|
|
399
|
+
if (isFocusedElement) {
|
|
400
|
+
isFocusedElement.blur();
|
|
401
|
+
}
|
|
402
|
+
this.isFocused = false;
|
|
403
|
+
this.focusChangedProgrammatically = false;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* @hidden
|
|
407
|
+
*/
|
|
408
|
+
clearTitle() {
|
|
409
|
+
return this.localizationService.get('clear');
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* @hidden
|
|
413
|
+
*/
|
|
414
|
+
checkClearButton() {
|
|
415
|
+
this.showClearButton =
|
|
416
|
+
!this.disabled &&
|
|
417
|
+
!this.readonly &&
|
|
418
|
+
this.clearButton &&
|
|
419
|
+
!!this.value;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* @hidden
|
|
423
|
+
*/
|
|
424
|
+
clearValue(ev) {
|
|
425
|
+
if (ev) {
|
|
426
|
+
ev.preventDefault();
|
|
427
|
+
}
|
|
428
|
+
this.clearButtonClicked = true;
|
|
429
|
+
this.input.nativeElement.value = '';
|
|
430
|
+
this.input.nativeElement.focus();
|
|
431
|
+
this.updateValue('');
|
|
432
|
+
this.checkClearButton();
|
|
433
|
+
this.clearButtonClicked = false;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* @hidden
|
|
437
|
+
*/
|
|
438
|
+
writeValue(value) {
|
|
439
|
+
this.value = value;
|
|
440
|
+
this.checkClearButton();
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @hidden
|
|
444
|
+
*/
|
|
445
|
+
registerOnChange(fn) {
|
|
446
|
+
this.ngChange = fn;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* @hidden
|
|
450
|
+
*/
|
|
451
|
+
registerOnTouched(fn) {
|
|
452
|
+
this.ngTouched = fn;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* @hidden
|
|
456
|
+
* Called when the status of the component changes to or from `disabled`.
|
|
457
|
+
* Depending on the value, it enables or disables the appropriate DOM element.
|
|
458
|
+
*
|
|
459
|
+
* @param isDisabled
|
|
460
|
+
*/
|
|
461
|
+
setDisabledState(isDisabled) {
|
|
462
|
+
this.changeDetector.markForCheck();
|
|
463
|
+
this.disabled = isDisabled;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* @hidden
|
|
467
|
+
*/
|
|
468
|
+
showErrorsInitial() {
|
|
469
|
+
if (!this.control) {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
const { invalid, dirty, touched } = this.control;
|
|
473
|
+
return invalid && (dirty || touched);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @hidden
|
|
477
|
+
*/
|
|
478
|
+
showSuccessInitial() {
|
|
479
|
+
if (!this.control) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
const { valid, dirty, touched } = this.control;
|
|
483
|
+
return valid && (dirty || touched);
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* @hidden
|
|
487
|
+
*/
|
|
488
|
+
get isControlInvalid() {
|
|
489
|
+
return this.control && this.control.touched && !this.control.valid;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @hidden
|
|
493
|
+
*/
|
|
494
|
+
get successIconClasses() {
|
|
495
|
+
if (!this.successIcon) {
|
|
496
|
+
return `check`;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* @hidden
|
|
501
|
+
*/
|
|
502
|
+
get customSuccessIconClasses() {
|
|
503
|
+
if (this.successIcon) {
|
|
504
|
+
return this.successIcon;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @hidden
|
|
509
|
+
*/
|
|
510
|
+
get errorIconClasses() {
|
|
511
|
+
if (!this.errorIcon) {
|
|
512
|
+
return `exclamation-circle`;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* @hidden
|
|
517
|
+
*/
|
|
518
|
+
get customIconClasses() {
|
|
519
|
+
if (this.errorIcon) {
|
|
520
|
+
return this.errorIcon;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @hidden
|
|
525
|
+
*/
|
|
526
|
+
get customClearButtonClasses() {
|
|
527
|
+
if (this.clearButtonIcon) {
|
|
528
|
+
return this.clearButtonIcon;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @hidden
|
|
533
|
+
*/
|
|
534
|
+
get clearButtonClass() {
|
|
535
|
+
if (!this.clearButtonIcon) {
|
|
536
|
+
return 'x';
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* @hidden
|
|
541
|
+
*/
|
|
542
|
+
get hasErrors() {
|
|
543
|
+
return this.showErrorIcon === 'initial'
|
|
544
|
+
? this.showErrorsInitial()
|
|
545
|
+
: this.showErrorIcon;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* @hidden
|
|
549
|
+
*/
|
|
550
|
+
get isSuccessful() {
|
|
551
|
+
return this.showSuccessIcon === 'initial'
|
|
552
|
+
? this.showSuccessInitial()
|
|
553
|
+
: this.showSuccessIcon;
|
|
554
|
+
}
|
|
555
|
+
setSelection(start, end) {
|
|
556
|
+
if (this.isFocused) {
|
|
557
|
+
invokeElementMethod(this.input, 'setSelectionRange', start, end);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
selectAll() {
|
|
561
|
+
if (this.value) {
|
|
562
|
+
this.setSelection(0, this.value.length);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
updateValue(value) {
|
|
566
|
+
if (!areSame(this.value, value)) {
|
|
567
|
+
this.ngZone.run(() => {
|
|
568
|
+
this.value = value;
|
|
569
|
+
this.ngChange(value);
|
|
570
|
+
this.valueChange.emit(value);
|
|
571
|
+
this.checkClearButton();
|
|
572
|
+
this.changeDetector.markForCheck();
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
get isFocused() {
|
|
577
|
+
return this._isFocused;
|
|
578
|
+
}
|
|
579
|
+
set isFocused(value) {
|
|
580
|
+
if (this._isFocused !== value && this.hostElement) {
|
|
581
|
+
const element = this.hostElement.nativeElement;
|
|
582
|
+
if (value && !this.disabled) {
|
|
583
|
+
this.renderer.addClass(element, FOCUSED);
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
this.renderer.removeClass(element, FOCUSED);
|
|
587
|
+
}
|
|
588
|
+
this._isFocused = value;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
handleBlur() {
|
|
592
|
+
this.ngZone.run(() => {
|
|
593
|
+
if (!this.focusChangedProgrammatically) {
|
|
594
|
+
this.onBlur.emit();
|
|
595
|
+
}
|
|
596
|
+
this.isFocused = false;
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
handleClasses(value, input) {
|
|
600
|
+
const elem = this.hostElement.nativeElement;
|
|
601
|
+
const classes = getStylingClasses('input', input, this[input], value);
|
|
602
|
+
if (classes.toRemove) {
|
|
603
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
604
|
+
}
|
|
605
|
+
if (classes.toAdd) {
|
|
606
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
TextBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextBoxComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
611
|
+
TextBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextBoxComponent, selector: "kendo-textbox", inputs: { focusableId: "focusableId", title: "title", disabled: "disabled", readonly: "readonly", tabindex: "tabindex", value: "value", selectOnFocus: "selectOnFocus", showSuccessIcon: "showSuccessIcon", showErrorIcon: "showErrorIcon", clearButton: "clearButton", successIcon: "successIcon", successSvgIcon: "successSvgIcon", errorIcon: "errorIcon", errorSvgIcon: "errorSvgIcon", clearButtonIcon: "clearButtonIcon", clearButtonSvgIcon: "clearButtonSvgIcon", size: "size", rounded: "rounded", fillMode: "fillMode", tabIndex: "tabIndex", placeholder: "placeholder", maxlength: "maxlength" }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-disabled": "this.disabledClass", "class.k-textbox": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.direction" } }, providers: [
|
|
612
|
+
LocalizationService,
|
|
613
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.textbox' },
|
|
614
|
+
{
|
|
615
|
+
provide: NG_VALUE_ACCESSOR,
|
|
616
|
+
useExisting: forwardRef(() => TextBoxComponent),
|
|
617
|
+
multi: true
|
|
618
|
+
},
|
|
619
|
+
{ provide: KendoInput, useExisting: forwardRef(() => TextBoxComponent) }
|
|
620
|
+
], queries: [{ propertyName: "suffixTemplate", first: true, predicate: TextBoxSuffixTemplateDirective, descendants: true }, { propertyName: "prefixTemplate", first: true, predicate: TextBoxPrefixTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], exportAs: ["kendoTextBox"], usesOnChanges: true, ngImport: i0, template: `
|
|
621
|
+
<ng-container kendoTextBoxLocalizedMessages
|
|
622
|
+
i18n-clear="kendo.textbox.clear|The title for the **Clear** button in the TextBox."
|
|
623
|
+
clear="Clear">
|
|
624
|
+
</ng-container>
|
|
625
|
+
<span class="k-input-prefix">
|
|
626
|
+
<ng-template
|
|
627
|
+
*ngIf="prefixTemplate"
|
|
628
|
+
[ngTemplateOutlet]="prefixTemplate?.templateRef">
|
|
629
|
+
</ng-template>
|
|
630
|
+
</span>
|
|
631
|
+
<input #input
|
|
632
|
+
class="k-input-inner"
|
|
633
|
+
[id]="focusableId"
|
|
634
|
+
[disabled]="disabled"
|
|
635
|
+
[readonly]="readonly"
|
|
636
|
+
[attr.tabindex]="disabled ? undefined : tabindex"
|
|
637
|
+
[value]="value"
|
|
638
|
+
[attr.placeholder]="placeholder"
|
|
639
|
+
[attr.title]="title"
|
|
640
|
+
[attr.maxlength]="maxlength"
|
|
641
|
+
[attr.aria-invalid]="isControlInvalid"
|
|
642
|
+
[kendoEventsOutsideAngular]="{
|
|
643
|
+
focus: handleInputFocus,
|
|
644
|
+
blur: handleInputBlur,
|
|
645
|
+
input: handleInput}"
|
|
646
|
+
/>
|
|
647
|
+
<span
|
|
648
|
+
role="button"
|
|
649
|
+
class="k-clear-value"
|
|
650
|
+
*ngIf="showClearButton"
|
|
651
|
+
(click)="clearValue()"
|
|
652
|
+
(mousedown)="$event.preventDefault()"
|
|
653
|
+
[tabindex]="tabIndex"
|
|
654
|
+
[attr.aria-label]="clearTitle()"
|
|
655
|
+
[title]="clearTitle()"
|
|
656
|
+
(keydown.enter)="clearValue($event)"
|
|
657
|
+
(keydown.space)="clearValue($event)">
|
|
658
|
+
<kendo-icon-wrapper
|
|
659
|
+
[name]="clearButtonClass"
|
|
660
|
+
[customFontClass]="customClearButtonClasses"
|
|
661
|
+
[svgIcon]="clearButtonSvgIcon || svgIcon('xIcon')"
|
|
662
|
+
>
|
|
663
|
+
</kendo-icon-wrapper>
|
|
664
|
+
</span>
|
|
665
|
+
<kendo-icon-wrapper
|
|
666
|
+
*ngIf="hasErrors"
|
|
667
|
+
innerCssClass="k-input-validation-icon"
|
|
668
|
+
[name]="errorIconClasses"
|
|
669
|
+
[customFontClass]="customIconClasses"
|
|
670
|
+
[svgIcon]="errorSvgIcon || svgIcon('exclamationCircleIcon')"
|
|
671
|
+
>
|
|
672
|
+
</kendo-icon-wrapper>
|
|
673
|
+
<kendo-icon-wrapper
|
|
674
|
+
*ngIf="isSuccessful"
|
|
675
|
+
innerCssClass="k-input-validation-icon"
|
|
676
|
+
[name]="successIconClasses"
|
|
677
|
+
[customFontClass]="customSuccessIconClasses"
|
|
678
|
+
[svgIcon]="successSvgIcon || svgIcon('checkIcon')"
|
|
679
|
+
>
|
|
680
|
+
</kendo-icon-wrapper>
|
|
681
|
+
<span class="k-input-suffix">
|
|
682
|
+
<ng-template
|
|
683
|
+
*ngIf="suffixTemplate"
|
|
684
|
+
[ngTemplateOutlet]="suffixTemplate?.templateRef">
|
|
685
|
+
</ng-template>
|
|
686
|
+
</span>
|
|
687
|
+
`, isInline: true, components: [{ type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.LocalizedTextBoxMessagesDirective, selector: "[kendoTextBoxLocalizedMessages]" }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextBoxComponent, decorators: [{
|
|
689
|
+
type: Component,
|
|
690
|
+
args: [{
|
|
691
|
+
exportAs: 'kendoTextBox',
|
|
692
|
+
providers: [
|
|
693
|
+
LocalizationService,
|
|
694
|
+
{ provide: L10N_PREFIX, useValue: 'kendo.textbox' },
|
|
695
|
+
{
|
|
696
|
+
provide: NG_VALUE_ACCESSOR,
|
|
697
|
+
useExisting: forwardRef(() => TextBoxComponent),
|
|
698
|
+
multi: true
|
|
699
|
+
},
|
|
700
|
+
{ provide: KendoInput, useExisting: forwardRef(() => TextBoxComponent) }
|
|
701
|
+
],
|
|
702
|
+
selector: 'kendo-textbox',
|
|
703
|
+
template: `
|
|
704
|
+
<ng-container kendoTextBoxLocalizedMessages
|
|
705
|
+
i18n-clear="kendo.textbox.clear|The title for the **Clear** button in the TextBox."
|
|
706
|
+
clear="Clear">
|
|
707
|
+
</ng-container>
|
|
708
|
+
<span class="k-input-prefix">
|
|
709
|
+
<ng-template
|
|
710
|
+
*ngIf="prefixTemplate"
|
|
711
|
+
[ngTemplateOutlet]="prefixTemplate?.templateRef">
|
|
712
|
+
</ng-template>
|
|
713
|
+
</span>
|
|
714
|
+
<input #input
|
|
715
|
+
class="k-input-inner"
|
|
716
|
+
[id]="focusableId"
|
|
717
|
+
[disabled]="disabled"
|
|
718
|
+
[readonly]="readonly"
|
|
719
|
+
[attr.tabindex]="disabled ? undefined : tabindex"
|
|
720
|
+
[value]="value"
|
|
721
|
+
[attr.placeholder]="placeholder"
|
|
722
|
+
[attr.title]="title"
|
|
723
|
+
[attr.maxlength]="maxlength"
|
|
724
|
+
[attr.aria-invalid]="isControlInvalid"
|
|
725
|
+
[kendoEventsOutsideAngular]="{
|
|
726
|
+
focus: handleInputFocus,
|
|
727
|
+
blur: handleInputBlur,
|
|
728
|
+
input: handleInput}"
|
|
729
|
+
/>
|
|
730
|
+
<span
|
|
731
|
+
role="button"
|
|
732
|
+
class="k-clear-value"
|
|
733
|
+
*ngIf="showClearButton"
|
|
734
|
+
(click)="clearValue()"
|
|
735
|
+
(mousedown)="$event.preventDefault()"
|
|
736
|
+
[tabindex]="tabIndex"
|
|
737
|
+
[attr.aria-label]="clearTitle()"
|
|
738
|
+
[title]="clearTitle()"
|
|
739
|
+
(keydown.enter)="clearValue($event)"
|
|
740
|
+
(keydown.space)="clearValue($event)">
|
|
741
|
+
<kendo-icon-wrapper
|
|
742
|
+
[name]="clearButtonClass"
|
|
743
|
+
[customFontClass]="customClearButtonClasses"
|
|
744
|
+
[svgIcon]="clearButtonSvgIcon || svgIcon('xIcon')"
|
|
745
|
+
>
|
|
746
|
+
</kendo-icon-wrapper>
|
|
747
|
+
</span>
|
|
748
|
+
<kendo-icon-wrapper
|
|
749
|
+
*ngIf="hasErrors"
|
|
750
|
+
innerCssClass="k-input-validation-icon"
|
|
751
|
+
[name]="errorIconClasses"
|
|
752
|
+
[customFontClass]="customIconClasses"
|
|
753
|
+
[svgIcon]="errorSvgIcon || svgIcon('exclamationCircleIcon')"
|
|
754
|
+
>
|
|
755
|
+
</kendo-icon-wrapper>
|
|
756
|
+
<kendo-icon-wrapper
|
|
757
|
+
*ngIf="isSuccessful"
|
|
758
|
+
innerCssClass="k-input-validation-icon"
|
|
759
|
+
[name]="successIconClasses"
|
|
760
|
+
[customFontClass]="customSuccessIconClasses"
|
|
761
|
+
[svgIcon]="successSvgIcon || svgIcon('checkIcon')"
|
|
762
|
+
>
|
|
763
|
+
</kendo-icon-wrapper>
|
|
764
|
+
<span class="k-input-suffix">
|
|
765
|
+
<ng-template
|
|
766
|
+
*ngIf="suffixTemplate"
|
|
767
|
+
[ngTemplateOutlet]="suffixTemplate?.templateRef">
|
|
768
|
+
</ng-template>
|
|
769
|
+
</span>
|
|
770
|
+
`
|
|
771
|
+
}]
|
|
772
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { focusableId: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], title: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], disabled: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], readonly: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], tabindex: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}], value: [{
|
|
783
|
+
type: Input
|
|
784
|
+
}], selectOnFocus: [{
|
|
785
|
+
type: Input
|
|
786
|
+
}], showSuccessIcon: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], showErrorIcon: [{
|
|
789
|
+
type: Input
|
|
790
|
+
}], clearButton: [{
|
|
791
|
+
type: Input
|
|
792
|
+
}], successIcon: [{
|
|
793
|
+
type: Input
|
|
794
|
+
}], successSvgIcon: [{
|
|
795
|
+
type: Input
|
|
796
|
+
}], errorIcon: [{
|
|
797
|
+
type: Input
|
|
798
|
+
}], errorSvgIcon: [{
|
|
799
|
+
type: Input
|
|
800
|
+
}], clearButtonIcon: [{
|
|
801
|
+
type: Input
|
|
802
|
+
}], clearButtonSvgIcon: [{
|
|
803
|
+
type: Input
|
|
804
|
+
}], size: [{
|
|
805
|
+
type: Input
|
|
806
|
+
}], rounded: [{
|
|
807
|
+
type: Input
|
|
808
|
+
}], fillMode: [{
|
|
809
|
+
type: Input
|
|
810
|
+
}], tabIndex: [{
|
|
811
|
+
type: Input
|
|
812
|
+
}], placeholder: [{
|
|
813
|
+
type: Input
|
|
814
|
+
}], maxlength: [{
|
|
815
|
+
type: Input
|
|
816
|
+
}], valueChange: [{
|
|
817
|
+
type: Output
|
|
818
|
+
}], inputFocus: [{
|
|
819
|
+
type: Output
|
|
820
|
+
}], inputBlur: [{
|
|
821
|
+
type: Output
|
|
822
|
+
}], onFocus: [{
|
|
823
|
+
type: Output,
|
|
824
|
+
args: ['focus']
|
|
825
|
+
}], onBlur: [{
|
|
826
|
+
type: Output,
|
|
827
|
+
args: ['blur']
|
|
828
|
+
}], input: [{
|
|
829
|
+
type: ViewChild,
|
|
830
|
+
args: ['input', { static: true }]
|
|
831
|
+
}], suffixTemplate: [{
|
|
832
|
+
type: ContentChild,
|
|
833
|
+
args: [TextBoxSuffixTemplateDirective, { static: false }]
|
|
834
|
+
}], prefixTemplate: [{
|
|
835
|
+
type: ContentChild,
|
|
836
|
+
args: [TextBoxPrefixTemplateDirective, { static: false }]
|
|
837
|
+
}], disabledClass: [{
|
|
838
|
+
type: HostBinding,
|
|
839
|
+
args: ['class.k-disabled']
|
|
840
|
+
}], hostClasses: [{
|
|
841
|
+
type: HostBinding,
|
|
842
|
+
args: ['class.k-textbox']
|
|
843
|
+
}, {
|
|
844
|
+
type: HostBinding,
|
|
845
|
+
args: ['class.k-input']
|
|
846
|
+
}], direction: [{
|
|
847
|
+
type: HostBinding,
|
|
848
|
+
args: ['attr.dir']
|
|
849
|
+
}] } });
|