@progress/kendo-angular-inputs 21.4.1 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/colorpicker/localization/messages.d.ts +1 -1
- package/common/radio-checkbox.base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-inputs.mjs +321 -321
- package/numerictextbox/localization/messages.d.ts +1 -1
- package/otpinput/localization/messages.d.ts +1 -1
- package/package.json +17 -25
- package/rangeslider/localization/messages.d.ts +1 -1
- package/signature/localization/messages.d.ts +1 -1
- package/slider/localization/messages.d.ts +1 -1
- package/sliders-common/slider-base.d.ts +1 -1
- package/switch/localization/messages.d.ts +1 -1
- package/text-fields-common/text-fields-base.d.ts +1 -1
- package/textbox/localization/messages.d.ts +1 -1
- package/esm2022/checkbox/checkbox.component.mjs +0 -227
- package/esm2022/checkbox/checkbox.directive.mjs +0 -96
- package/esm2022/checkbox/checked-state.mjs +0 -5
- package/esm2022/checkbox.module.mjs +0 -42
- package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
- package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -219
- package/esm2022/colorpicker/color-contrast-svg.component.mjs +0 -108
- package/esm2022/colorpicker/color-gradient-numeric-label.directive.mjs +0 -37
- package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
- package/esm2022/colorpicker/color-gradient.component.mjs +0 -1110
- package/esm2022/colorpicker/color-input.component.mjs +0 -498
- package/esm2022/colorpicker/color-palette.component.mjs +0 -629
- package/esm2022/colorpicker/colorpicker.component.mjs +0 -1315
- package/esm2022/colorpicker/constants.mjs +0 -40
- package/esm2022/colorpicker/contrast-validation.component.mjs +0 -83
- package/esm2022/colorpicker/contrast.component.mjs +0 -114
- package/esm2022/colorpicker/events/active-color-click-event.mjs +0 -55
- package/esm2022/colorpicker/events/cancel-event.mjs +0 -18
- package/esm2022/colorpicker/events/close-event.mjs +0 -10
- package/esm2022/colorpicker/events/kendo-drag-event.mjs +0 -5
- package/esm2022/colorpicker/events/open-event.mjs +0 -10
- package/esm2022/colorpicker/events.mjs +0 -8
- package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +0 -112
- package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +0 -244
- package/esm2022/colorpicker/flatcolorpicker.component.mjs +0 -942
- package/esm2022/colorpicker/localization/colorgradient-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/colorpalette-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/colorpicker-localization.service.mjs +0 -31
- package/esm2022/colorpicker/localization/custom-messages.component.mjs +0 -51
- package/esm2022/colorpicker/localization/flatcolorpicker-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/localized-colorpicker-messages.directive.mjs +0 -39
- package/esm2022/colorpicker/localization/messages.mjs +0 -201
- package/esm2022/colorpicker/models/actions-layout.mjs +0 -5
- package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -8
- package/esm2022/colorpicker/models/colorpicker-view.mjs +0 -5
- package/esm2022/colorpicker/models/gradient-settings.mjs +0 -5
- package/esm2022/colorpicker/models/hsva.mjs +0 -5
- package/esm2022/colorpicker/models/output-format.mjs +0 -5
- package/esm2022/colorpicker/models/palette-presets.mjs +0 -62
- package/esm2022/colorpicker/models/palette-settings.mjs +0 -5
- package/esm2022/colorpicker/models/popup-settings.mjs +0 -5
- package/esm2022/colorpicker/models/rgb.mjs +0 -5
- package/esm2022/colorpicker/models/rgba.mjs +0 -5
- package/esm2022/colorpicker/models/table-cell.mjs +0 -5
- package/esm2022/colorpicker/models/tile-size.mjs +0 -5
- package/esm2022/colorpicker/models.mjs +0 -16
- package/esm2022/colorpicker/services/color-palette.service.mjs +0 -65
- package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +0 -39
- package/esm2022/colorpicker/utils/color-parser.mjs +0 -164
- package/esm2022/colorpicker/utils/contrast-curve.mjs +0 -85
- package/esm2022/colorpicker/utils.mjs +0 -6
- package/esm2022/colorpicker.module.mjs +0 -50
- package/esm2022/common/dom-utils.mjs +0 -36
- package/esm2022/common/formservice.service.mjs +0 -21
- package/esm2022/common/math.mjs +0 -65
- package/esm2022/common/models/fillmode.mjs +0 -5
- package/esm2022/common/models/gutters.mjs +0 -5
- package/esm2022/common/models/responsive-breakpoints.mjs +0 -5
- package/esm2022/common/models/rounded.mjs +0 -5
- package/esm2022/common/models/size.mjs +0 -5
- package/esm2022/common/models/styling-classes.mjs +0 -5
- package/esm2022/common/models/type.mjs +0 -5
- package/esm2022/common/models.mjs +0 -9
- package/esm2022/common/radio-checkbox.base.mjs +0 -295
- package/esm2022/common/utils.mjs +0 -88
- package/esm2022/directives.mjs +0 -430
- package/esm2022/form/form.component.mjs +0 -163
- package/esm2022/form/formseparator.component.mjs +0 -80
- package/esm2022/form/utils.mjs +0 -147
- package/esm2022/form.module.mjs +0 -46
- package/esm2022/formfield/error.component.mjs +0 -70
- package/esm2022/formfield/formfield.component.mjs +0 -353
- package/esm2022/formfield/hint.component.mjs +0 -65
- package/esm2022/formfield/models/message-align.mjs +0 -5
- package/esm2022/formfield/models/orientation.mjs +0 -5
- package/esm2022/formfield/models/show-options.mjs +0 -5
- package/esm2022/formfield.module.mjs +0 -43
- package/esm2022/formfieldset/formfieldset.component.mjs +0 -174
- package/esm2022/index.mjs +0 -91
- package/esm2022/inputs.module.mjs +0 -91
- package/esm2022/maskedtextbox/maskedtextbox.component.mjs +0 -876
- package/esm2022/maskedtextbox/masking.service.mjs +0 -189
- package/esm2022/maskedtextbox/parsing/combinators.mjs +0 -28
- package/esm2022/maskedtextbox/parsing/parsers.mjs +0 -148
- package/esm2022/maskedtextbox/parsing/result.mjs +0 -44
- package/esm2022/maskedtextbox/parsing/stream.mjs +0 -43
- package/esm2022/maskedtextbox.module.mjs +0 -43
- package/esm2022/numerictextbox/arrow-direction.mjs +0 -13
- package/esm2022/numerictextbox/constants.mjs +0 -28
- package/esm2022/numerictextbox/localization/custom-messages.component.mjs +0 -55
- package/esm2022/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +0 -39
- package/esm2022/numerictextbox/localization/messages.mjs +0 -33
- package/esm2022/numerictextbox/numerictextbox.component.mjs +0 -1314
- package/esm2022/numerictextbox/utils.mjs +0 -92
- package/esm2022/numerictextbox.module.mjs +0 -46
- package/esm2022/otp.module.mjs +0 -44
- package/esm2022/otpinput/localization/custom-messages.component.mjs +0 -45
- package/esm2022/otpinput/localization/localized-textbox-messages.directive.mjs +0 -39
- package/esm2022/otpinput/localization/messages.mjs +0 -34
- package/esm2022/otpinput/models/otpinput-type.mjs +0 -5
- package/esm2022/otpinput/models/separator-icon.mjs +0 -5
- package/esm2022/otpinput/otpinput-separator.component.mjs +0 -93
- package/esm2022/otpinput/otpinput.component.mjs +0 -936
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-inputs.mjs +0 -8
- package/esm2022/radiobutton/radiobutton.component.mjs +0 -212
- package/esm2022/radiobutton/radiobutton.directive.mjs +0 -81
- package/esm2022/radiobutton.module.mjs +0 -43
- package/esm2022/rangeslider/localization/custom-messages.component.mjs +0 -53
- package/esm2022/rangeslider/localization/localized-rangeslider-messages.directive.mjs +0 -39
- package/esm2022/rangeslider/localization/messages.mjs +0 -33
- package/esm2022/rangeslider/rangeslider-model.mjs +0 -53
- package/esm2022/rangeslider/rangeslider-value.type.mjs +0 -5
- package/esm2022/rangeslider/rangeslider.component.mjs +0 -625
- package/esm2022/rangeslider.module.mjs +0 -46
- package/esm2022/rating/directives/rating-hovered-item.directive.mjs +0 -35
- package/esm2022/rating/directives/rating-item.directive.mjs +0 -34
- package/esm2022/rating/directives/rating-selected-item.directive.mjs +0 -36
- package/esm2022/rating/models/precision.mjs +0 -5
- package/esm2022/rating/models/rating-item.interface.mjs +0 -5
- package/esm2022/rating/models/selection.mjs +0 -5
- package/esm2022/rating/rating.component.mjs +0 -754
- package/esm2022/rating.module.mjs +0 -46
- package/esm2022/shared/input-separator.component.mjs +0 -55
- package/esm2022/shared/input-spacer.component.mjs +0 -56
- package/esm2022/shared/shared-events.directive.mjs +0 -102
- package/esm2022/shared/utils.mjs +0 -13
- package/esm2022/signature/events/close-event.mjs +0 -10
- package/esm2022/signature/events/index.mjs +0 -6
- package/esm2022/signature/events/open-event.mjs +0 -10
- package/esm2022/signature/localization/custom-messages.component.mjs +0 -43
- package/esm2022/signature/localization/index.mjs +0 -7
- package/esm2022/signature/localization/localized-signature-messages.directive.mjs +0 -39
- package/esm2022/signature/localization/messages.mjs +0 -45
- package/esm2022/signature/signature.component.mjs +0 -981
- package/esm2022/signature.module.mjs +0 -47
- package/esm2022/slider/localization/custom-messages.component.mjs +0 -43
- package/esm2022/slider/localization/localized-slider-messages.directive.mjs +0 -39
- package/esm2022/slider/localization/messages.mjs +0 -39
- package/esm2022/slider/slider-model.mjs +0 -32
- package/esm2022/slider/slider.component.mjs +0 -671
- package/esm2022/slider.module.mjs +0 -48
- package/esm2022/sliders-common/label-template.directive.mjs +0 -37
- package/esm2022/sliders-common/slider-base.mjs +0 -300
- package/esm2022/sliders-common/slider-model.base.mjs +0 -118
- package/esm2022/sliders-common/slider-ticks.component.mjs +0 -147
- package/esm2022/sliders-common/sliders-util.mjs +0 -206
- package/esm2022/sliders-common/title-callback.mjs +0 -5
- package/esm2022/switch/events/blur-event.mjs +0 -13
- package/esm2022/switch/events/focus-event.mjs +0 -13
- package/esm2022/switch/localization/custom-messages.component.mjs +0 -43
- package/esm2022/switch/localization/localized-switch-messages.directive.mjs +0 -39
- package/esm2022/switch/localization/messages.mjs +0 -33
- package/esm2022/switch/switch.component.mjs +0 -585
- package/esm2022/switch.module.mjs +0 -44
- package/esm2022/text-fields-common/text-fields-base.mjs +0 -150
- package/esm2022/textarea/models/adornments-orientation.mjs +0 -5
- package/esm2022/textarea/models/flow.mjs +0 -5
- package/esm2022/textarea/models/resize.mjs +0 -5
- package/esm2022/textarea/models/textarea-settings.mjs +0 -5
- package/esm2022/textarea/textarea-prefix.component.mjs +0 -67
- package/esm2022/textarea/textarea-suffix.component.mjs +0 -67
- package/esm2022/textarea/textarea.component.mjs +0 -740
- package/esm2022/textarea/textarea.directive.mjs +0 -288
- package/esm2022/textarea.module.mjs +0 -46
- package/esm2022/textbox/localization/custom-messages.component.mjs +0 -43
- package/esm2022/textbox/localization/localized-textbox-messages.directive.mjs +0 -39
- package/esm2022/textbox/localization/messages.mjs +0 -27
- package/esm2022/textbox/models/icon-show-options.mjs +0 -5
- package/esm2022/textbox/textbox-prefix.directive.mjs +0 -50
- package/esm2022/textbox/textbox-suffix.directive.mjs +0 -49
- package/esm2022/textbox/textbox.component.mjs +0 -933
- package/esm2022/textbox/textbox.directive.mjs +0 -125
- package/esm2022/textbox.module.mjs +0 -51
- package/esm2022/validators/max.validator.mjs +0 -21
- package/esm2022/validators/min.validator.mjs +0 -21
|
@@ -1,933 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
-
import { isJapanese } from './../shared/utils';
|
|
7
|
-
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
8
|
-
import { Component, ElementRef, forwardRef, Input, Output, EventEmitter, HostBinding, ViewChild, NgZone, ChangeDetectorRef, Injector, ContentChild, Renderer2, ContentChildren, QueryList } from '@angular/core';
|
|
9
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import { packageMetadata } from '../package-metadata';
|
|
11
|
-
import { invokeElementMethod } from '../common/dom-utils';
|
|
12
|
-
import { areSame, requiresZoneOnBlur, getStylingClasses } from '../common/utils';
|
|
13
|
-
import { guid, hasObservers, KendoInput, isSafari, SuffixTemplateDirective, PrefixTemplateDirective, setHTMLAttributes, isControlRequired, isObjectPresent, removeHTMLAttributes, parseAttributes, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
|
|
14
|
-
import { TextBoxSuffixTemplateDirective } from './textbox-suffix.directive';
|
|
15
|
-
import { TextBoxPrefixTemplateDirective } from './textbox-prefix.directive';
|
|
16
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
17
|
-
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
18
|
-
import { checkIcon, exclamationCircleIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
19
|
-
import { InputSeparatorComponent } from '../shared/input-separator.component';
|
|
20
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
21
|
-
import { SharedInputEventsDirective } from '../shared/shared-events.directive';
|
|
22
|
-
import { LocalizedTextBoxMessagesDirective } from './localization/localized-textbox-messages.directive';
|
|
23
|
-
import * as i0 from "@angular/core";
|
|
24
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
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
|
-
/**
|
|
31
|
-
* Represents the Kendo UI TextBox component for Angular.
|
|
32
|
-
* Use this component to create styled and feature-rich text input fields.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```html
|
|
36
|
-
* <kendo-textbox placeholder="Enter text"></kendo-textbox>
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Supported children components are: {@link TextBoxCustomMessagesComponent}.
|
|
41
|
-
*/
|
|
42
|
-
export class TextBoxComponent {
|
|
43
|
-
localizationService;
|
|
44
|
-
ngZone;
|
|
45
|
-
changeDetector;
|
|
46
|
-
renderer;
|
|
47
|
-
injector;
|
|
48
|
-
hostElement;
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
focusableId = `k-${guid()}`;
|
|
53
|
-
/**
|
|
54
|
-
* Sets the `title` attribute of the `input` element of the TextBox.
|
|
55
|
-
*/
|
|
56
|
-
title;
|
|
57
|
-
/**
|
|
58
|
-
* Sets the `type` attribute of the `input` element of the TextBox.
|
|
59
|
-
* @default 'text'
|
|
60
|
-
*/
|
|
61
|
-
type = 'text';
|
|
62
|
-
/**
|
|
63
|
-
* Sets the disabled state of the TextBox. To disable the component in reactive forms, see [Forms Support](slug:formssupport_textbox#toc-managing-the-textbox-disabled-state-in-reactive-forms).
|
|
64
|
-
* @default false
|
|
65
|
-
*/
|
|
66
|
-
disabled = false;
|
|
67
|
-
/**
|
|
68
|
-
* Sets the read-only state of the component.
|
|
69
|
-
* @default false
|
|
70
|
-
*/
|
|
71
|
-
readonly = false;
|
|
72
|
-
/**
|
|
73
|
-
* Specifies the `tabindex` of the TextBox.
|
|
74
|
-
* @default 0
|
|
75
|
-
*/
|
|
76
|
-
tabindex = 0;
|
|
77
|
-
/**
|
|
78
|
-
* Provides a value for the TextBox.
|
|
79
|
-
*/
|
|
80
|
-
value = null;
|
|
81
|
-
/**
|
|
82
|
-
* Highlights the whole value when you click the TextBox.
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
selectOnFocus = false;
|
|
86
|
-
/**
|
|
87
|
-
* Specifies when to show the Success icon ([see example]({% slug validation_textbox %})).
|
|
88
|
-
*
|
|
89
|
-
* @default false
|
|
90
|
-
*/
|
|
91
|
-
showSuccessIcon = false;
|
|
92
|
-
/**
|
|
93
|
-
* Specifies when to show the Error icon ([see example]({% slug validation_textbox %})).
|
|
94
|
-
*
|
|
95
|
-
* @default false
|
|
96
|
-
*/
|
|
97
|
-
showErrorIcon = false;
|
|
98
|
-
/**
|
|
99
|
-
* Shows a **Clear** button in the TextBox.
|
|
100
|
-
* @default false
|
|
101
|
-
*/
|
|
102
|
-
clearButton = false;
|
|
103
|
-
/**
|
|
104
|
-
* Sets a custom icon for valid user input.
|
|
105
|
-
*/
|
|
106
|
-
successIcon;
|
|
107
|
-
/**
|
|
108
|
-
* Sets a custom SVG icon for valid user input.
|
|
109
|
-
*/
|
|
110
|
-
successSvgIcon;
|
|
111
|
-
/**
|
|
112
|
-
* Sets a custom icon for invalid user input.
|
|
113
|
-
*/
|
|
114
|
-
errorIcon;
|
|
115
|
-
/**
|
|
116
|
-
* Sets a custom SVG icon for invalid user input.
|
|
117
|
-
*/
|
|
118
|
-
errorSvgIcon;
|
|
119
|
-
/**
|
|
120
|
-
* Sets a custom icon for the **Clear** button.
|
|
121
|
-
*/
|
|
122
|
-
clearButtonIcon;
|
|
123
|
-
/**
|
|
124
|
-
* Sets a custom SVG icon for the **Clear** button.
|
|
125
|
-
*/
|
|
126
|
-
clearButtonSvgIcon;
|
|
127
|
-
/**
|
|
128
|
-
* Sets the padding of the TextBox internal input element ([see example]({% slug appearance_textbox %}#toc-size)).
|
|
129
|
-
* @default 'medium'
|
|
130
|
-
*/
|
|
131
|
-
set size(size) {
|
|
132
|
-
const newSize = size ? size : DEFAULT_SIZE;
|
|
133
|
-
this.handleClasses(newSize, 'size');
|
|
134
|
-
this._size = newSize;
|
|
135
|
-
}
|
|
136
|
-
get size() {
|
|
137
|
-
return this._size;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Sets the border radius of the TextBox ([see example](slug:appearance_textbox#toc-roundness)).
|
|
141
|
-
* @default 'medium'
|
|
142
|
-
*/
|
|
143
|
-
set rounded(rounded) {
|
|
144
|
-
const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
|
|
145
|
-
this.handleClasses(newRounded, 'rounded');
|
|
146
|
-
this._rounded = newRounded;
|
|
147
|
-
}
|
|
148
|
-
get rounded() {
|
|
149
|
-
return this._rounded;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Sets the background and border styles of the TextBox ([see example]({% slug appearance_textbox %}#toc-fill-mode)).
|
|
153
|
-
* @default 'solid'
|
|
154
|
-
*/
|
|
155
|
-
set fillMode(fillMode) {
|
|
156
|
-
const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
|
|
157
|
-
this.handleClasses(newFillMode, 'fillMode');
|
|
158
|
-
this._fillMode = newFillMode;
|
|
159
|
-
}
|
|
160
|
-
get fillMode() {
|
|
161
|
-
return this._fillMode;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* @hidden
|
|
165
|
-
*/
|
|
166
|
-
set tabIndex(tabIndex) {
|
|
167
|
-
this.tabindex = tabIndex;
|
|
168
|
-
}
|
|
169
|
-
get tabIndex() {
|
|
170
|
-
return this.tabindex;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Sets the placeholder text displayed when the component is empty.
|
|
174
|
-
*/
|
|
175
|
-
placeholder;
|
|
176
|
-
/**
|
|
177
|
-
* Sets the maximum length of the TextBox value.
|
|
178
|
-
*/
|
|
179
|
-
maxlength;
|
|
180
|
-
/**
|
|
181
|
-
* Sets the HTML attributes of the inner focusable input element. You cannot change attributes that are essential for component functionality.
|
|
182
|
-
*/
|
|
183
|
-
set inputAttributes(attributes) {
|
|
184
|
-
if (isObjectPresent(this.parsedAttributes)) {
|
|
185
|
-
removeHTMLAttributes(this.parsedAttributes, this.renderer, this.input.nativeElement);
|
|
186
|
-
}
|
|
187
|
-
this._inputAttributes = attributes;
|
|
188
|
-
this.parsedAttributes = this.inputAttributes ?
|
|
189
|
-
parseAttributes(this.inputAttributes, this.defaultAttributes) :
|
|
190
|
-
this.inputAttributes;
|
|
191
|
-
this.setInputAttributes();
|
|
192
|
-
}
|
|
193
|
-
get inputAttributes() {
|
|
194
|
-
return this._inputAttributes;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Fires when the value changes—when the component is blurred or the value is cleared through the **Clear** button ([see example](slug:events_textbox)).
|
|
198
|
-
* Does not fire when you change the value programmatically through `ngModel` or `formControl`.
|
|
199
|
-
*/
|
|
200
|
-
valueChange = new EventEmitter();
|
|
201
|
-
/**
|
|
202
|
-
* Fires when the user focuses the `input` element.
|
|
203
|
-
*/
|
|
204
|
-
inputFocus = new EventEmitter();
|
|
205
|
-
/**
|
|
206
|
-
* Fires when the `input` element is blurred.
|
|
207
|
-
*/
|
|
208
|
-
inputBlur = new EventEmitter();
|
|
209
|
-
/**
|
|
210
|
-
* Fires when the user focuses the TextBox component.
|
|
211
|
-
*
|
|
212
|
-
*/
|
|
213
|
-
onFocus = new EventEmitter();
|
|
214
|
-
/**
|
|
215
|
-
* Fires when the TextBox component is blurred.
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
onBlur = new EventEmitter();
|
|
219
|
-
/**
|
|
220
|
-
* Gets a reference to the visible `input` element of the TextBox.
|
|
221
|
-
*/
|
|
222
|
-
input;
|
|
223
|
-
/**
|
|
224
|
-
* @hidden
|
|
225
|
-
*/
|
|
226
|
-
textBoxSuffixTemplate;
|
|
227
|
-
/**
|
|
228
|
-
* @hidden
|
|
229
|
-
*/
|
|
230
|
-
textBoxPrefixTemplate;
|
|
231
|
-
/**
|
|
232
|
-
* @hidden
|
|
233
|
-
*/
|
|
234
|
-
suffixTemplate;
|
|
235
|
-
/**
|
|
236
|
-
* @hidden
|
|
237
|
-
*/
|
|
238
|
-
prefixTemplate;
|
|
239
|
-
get disabledClass() {
|
|
240
|
-
return this.disabled;
|
|
241
|
-
}
|
|
242
|
-
hostClasses = true;
|
|
243
|
-
direction;
|
|
244
|
-
/**
|
|
245
|
-
* @hidden
|
|
246
|
-
*/
|
|
247
|
-
showClearButton;
|
|
248
|
-
/**
|
|
249
|
-
* @hidden
|
|
250
|
-
*/
|
|
251
|
-
clearButtonClicked;
|
|
252
|
-
/**
|
|
253
|
-
* @hidden
|
|
254
|
-
*/
|
|
255
|
-
suffix;
|
|
256
|
-
/**
|
|
257
|
-
* @hidden
|
|
258
|
-
*/
|
|
259
|
-
prefix;
|
|
260
|
-
control;
|
|
261
|
-
subscriptions;
|
|
262
|
-
_isFocused = false;
|
|
263
|
-
focusChangedProgrammatically = false;
|
|
264
|
-
_inputAttributes;
|
|
265
|
-
_size = 'medium';
|
|
266
|
-
_rounded = 'medium';
|
|
267
|
-
_fillMode = 'solid';
|
|
268
|
-
parsedAttributes = {};
|
|
269
|
-
get defaultAttributes() {
|
|
270
|
-
return {
|
|
271
|
-
id: this.focusableId,
|
|
272
|
-
disabled: this.disabled ? '' : null,
|
|
273
|
-
readonly: this.readonly ? '' : null,
|
|
274
|
-
tabindex: this.disabled ? undefined : this.tabindex,
|
|
275
|
-
type: this.type,
|
|
276
|
-
placeholder: this.placeholder,
|
|
277
|
-
title: this.title,
|
|
278
|
-
maxlength: this.maxlength,
|
|
279
|
-
'aria-invalid': this.isControlInvalid,
|
|
280
|
-
required: this.isControlRequired ? '' : null
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
constructor(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
|
|
284
|
-
this.localizationService = localizationService;
|
|
285
|
-
this.ngZone = ngZone;
|
|
286
|
-
this.changeDetector = changeDetector;
|
|
287
|
-
this.renderer = renderer;
|
|
288
|
-
this.injector = injector;
|
|
289
|
-
this.hostElement = hostElement;
|
|
290
|
-
validatePackage(packageMetadata);
|
|
291
|
-
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
292
|
-
}
|
|
293
|
-
ngOnInit() {
|
|
294
|
-
this.control = this.injector.get(NgControl, null);
|
|
295
|
-
this.checkClearButton();
|
|
296
|
-
this.subscriptions = this.localizationService.changes.subscribe(({ rtl }) => {
|
|
297
|
-
this.direction = rtl ? 'rtl' : 'ltr';
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
ngAfterViewInit() {
|
|
301
|
-
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
302
|
-
stylingInputs.forEach(input => {
|
|
303
|
-
this.handleClasses(this[input], input);
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
ngAfterContentInit() {
|
|
307
|
-
this.configureAdornments();
|
|
308
|
-
this.subscriptions.add(this.textBoxPrefixTemplate.changes.subscribe(this.configureAdornments.bind(this)));
|
|
309
|
-
this.subscriptions.add(this.textBoxSuffixTemplate.changes.subscribe(this.configureAdornments.bind(this)));
|
|
310
|
-
}
|
|
311
|
-
ngOnChanges(changes) {
|
|
312
|
-
if (changes['disabled'] || changes['readonly'] || changes['value']) {
|
|
313
|
-
this.checkClearButton();
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
ngOnDestroy() {
|
|
317
|
-
if (this.subscriptions) {
|
|
318
|
-
this.subscriptions.unsubscribe();
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* @hidden
|
|
323
|
-
*/
|
|
324
|
-
svgIcon(name) {
|
|
325
|
-
return iconsMap[name];
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Focuses the TextBox.
|
|
329
|
-
*/
|
|
330
|
-
focus() {
|
|
331
|
-
if (!this.input) {
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
this.focusChangedProgrammatically = true;
|
|
335
|
-
this.isFocused = true;
|
|
336
|
-
this.input.nativeElement.focus();
|
|
337
|
-
this.focusChangedProgrammatically = false;
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Removes focus from the TextBox.
|
|
341
|
-
*/
|
|
342
|
-
blur() {
|
|
343
|
-
this.focusChangedProgrammatically = true;
|
|
344
|
-
const isFocusedElement = this.hostElement.nativeElement.querySelector(':focus');
|
|
345
|
-
if (isFocusedElement) {
|
|
346
|
-
isFocusedElement.blur();
|
|
347
|
-
}
|
|
348
|
-
this.isFocused = false;
|
|
349
|
-
this.focusChangedProgrammatically = false;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* @hidden
|
|
353
|
-
*/
|
|
354
|
-
handleInputFocus = () => {
|
|
355
|
-
if (!this.disabled) {
|
|
356
|
-
if (this.selectOnFocus && this.value) {
|
|
357
|
-
this.ngZone.run(() => {
|
|
358
|
-
setTimeout(() => { this.selectAll(); });
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
if (!this.isFocused) {
|
|
362
|
-
this.handleFocus();
|
|
363
|
-
}
|
|
364
|
-
if (hasObservers(this.inputFocus)) {
|
|
365
|
-
if (!this.focusChangedProgrammatically || (this.focusChangedProgrammatically && this.clearButtonClicked)) {
|
|
366
|
-
this.ngZone.run(() => {
|
|
367
|
-
this.inputFocus.emit();
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
/**
|
|
374
|
-
* @hidden
|
|
375
|
-
*/
|
|
376
|
-
handleInputBlur = () => {
|
|
377
|
-
this.changeDetector.markForCheck();
|
|
378
|
-
if (hasObservers(this.inputBlur) || requiresZoneOnBlur(this.control)) {
|
|
379
|
-
this.ngZone.run(() => {
|
|
380
|
-
this.ngTouched();
|
|
381
|
-
this.inputBlur.emit();
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
/**
|
|
386
|
-
* @hidden
|
|
387
|
-
*/
|
|
388
|
-
handleInput = (ev) => {
|
|
389
|
-
const target = ev.target;
|
|
390
|
-
const isBrowserSafari = isSafari(navigator.userAgent);
|
|
391
|
-
const incomingValue = isBrowserSafari && isJapanese(target.value) ? ev.data : target.value;
|
|
392
|
-
const [caretStart, caretEnd] = [target.selectionStart, target.selectionEnd];
|
|
393
|
-
this.updateValue(incomingValue);
|
|
394
|
-
if (isBrowserSafari) {
|
|
395
|
-
target.setSelectionRange(caretStart, caretEnd);
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* @hidden
|
|
400
|
-
*/
|
|
401
|
-
clearTitle() {
|
|
402
|
-
return this.localizationService.get('clear');
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* @hidden
|
|
406
|
-
*/
|
|
407
|
-
checkClearButton() {
|
|
408
|
-
this.showClearButton =
|
|
409
|
-
!this.disabled &&
|
|
410
|
-
!this.readonly &&
|
|
411
|
-
this.clearButton &&
|
|
412
|
-
!!this.value;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* @hidden
|
|
416
|
-
*/
|
|
417
|
-
clearValue(ev) {
|
|
418
|
-
if (ev) {
|
|
419
|
-
ev.preventDefault();
|
|
420
|
-
}
|
|
421
|
-
this.clearButtonClicked = true;
|
|
422
|
-
this.input.nativeElement.value = '';
|
|
423
|
-
this.input.nativeElement.focus();
|
|
424
|
-
this.updateValue('');
|
|
425
|
-
this.checkClearButton();
|
|
426
|
-
this.clearButtonClicked = false;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* @hidden
|
|
430
|
-
*/
|
|
431
|
-
writeValue(value) {
|
|
432
|
-
this.value = value;
|
|
433
|
-
this.checkClearButton();
|
|
434
|
-
this.changeDetector.markForCheck();
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* @hidden
|
|
438
|
-
*/
|
|
439
|
-
registerOnChange(fn) {
|
|
440
|
-
this.ngChange = fn;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* @hidden
|
|
444
|
-
*/
|
|
445
|
-
registerOnTouched(fn) {
|
|
446
|
-
this.ngTouched = fn;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* @hidden
|
|
450
|
-
* Called when the status of the component changes to or from `disabled`.
|
|
451
|
-
* Depending on the value, it enables or disables the appropriate DOM element.
|
|
452
|
-
*
|
|
453
|
-
* @param isDisabled
|
|
454
|
-
*/
|
|
455
|
-
setDisabledState(isDisabled) {
|
|
456
|
-
this.changeDetector.markForCheck();
|
|
457
|
-
this.disabled = isDisabled;
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* @hidden
|
|
461
|
-
*/
|
|
462
|
-
showErrorsInitial() {
|
|
463
|
-
if (!this.control) {
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
const { invalid, dirty, touched } = this.control;
|
|
467
|
-
return invalid && (dirty || touched);
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* @hidden
|
|
471
|
-
*/
|
|
472
|
-
showSuccessInitial() {
|
|
473
|
-
if (!this.control) {
|
|
474
|
-
return false;
|
|
475
|
-
}
|
|
476
|
-
const { valid, dirty, touched } = this.control;
|
|
477
|
-
return valid && (dirty || touched);
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* @hidden
|
|
481
|
-
*/
|
|
482
|
-
get isControlInvalid() {
|
|
483
|
-
return this.control && this.control.touched && !this.control.valid;
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* @hidden
|
|
487
|
-
*/
|
|
488
|
-
get successIconClasses() {
|
|
489
|
-
if (!this.successIcon) {
|
|
490
|
-
return `check`;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* @hidden
|
|
495
|
-
*/
|
|
496
|
-
get customSuccessIconClasses() {
|
|
497
|
-
if (this.successIcon) {
|
|
498
|
-
return this.successIcon;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* @hidden
|
|
503
|
-
*/
|
|
504
|
-
get errorIconClasses() {
|
|
505
|
-
if (!this.errorIcon) {
|
|
506
|
-
return `exclamation-circle`;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* @hidden
|
|
511
|
-
*/
|
|
512
|
-
get customIconClasses() {
|
|
513
|
-
if (this.errorIcon) {
|
|
514
|
-
return this.errorIcon;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* @hidden
|
|
519
|
-
*/
|
|
520
|
-
get customClearButtonClasses() {
|
|
521
|
-
if (this.clearButtonIcon) {
|
|
522
|
-
return this.clearButtonIcon;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* @hidden
|
|
527
|
-
*/
|
|
528
|
-
get clearButtonClass() {
|
|
529
|
-
if (!this.clearButtonIcon) {
|
|
530
|
-
return 'x';
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* @hidden
|
|
535
|
-
*/
|
|
536
|
-
get hasErrors() {
|
|
537
|
-
return this.showErrorIcon === 'initial'
|
|
538
|
-
? this.showErrorsInitial()
|
|
539
|
-
: this.showErrorIcon;
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* @hidden
|
|
543
|
-
*/
|
|
544
|
-
get isSuccessful() {
|
|
545
|
-
return this.showSuccessIcon === 'initial'
|
|
546
|
-
? this.showSuccessInitial()
|
|
547
|
-
: this.showSuccessIcon;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* @hidden
|
|
551
|
-
*/
|
|
552
|
-
get isFocused() {
|
|
553
|
-
return this._isFocused;
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* @hidden
|
|
557
|
-
*/
|
|
558
|
-
set isFocused(value) {
|
|
559
|
-
if (this._isFocused !== value && this.hostElement) {
|
|
560
|
-
const element = this.hostElement.nativeElement;
|
|
561
|
-
if (value && !this.disabled) {
|
|
562
|
-
this.renderer.addClass(element, FOCUSED);
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
this.renderer.removeClass(element, FOCUSED);
|
|
566
|
-
}
|
|
567
|
-
this._isFocused = value;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* @hidden
|
|
572
|
-
*/
|
|
573
|
-
get isControlRequired() {
|
|
574
|
-
return isControlRequired(this.control?.control);
|
|
575
|
-
}
|
|
576
|
-
ngChange = (_) => { };
|
|
577
|
-
ngTouched = () => { };
|
|
578
|
-
setSelection(start, end) {
|
|
579
|
-
if (this.isFocused) {
|
|
580
|
-
invokeElementMethod(this.input, 'setSelectionRange', start, end);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
selectAll() {
|
|
584
|
-
if (this.value) {
|
|
585
|
-
this.setSelection(0, this.value.length);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
updateValue(value) {
|
|
589
|
-
if (!areSame(this.value, value)) {
|
|
590
|
-
this.ngZone.run(() => {
|
|
591
|
-
this.value = value;
|
|
592
|
-
this.ngChange(value);
|
|
593
|
-
this.valueChange.emit(value);
|
|
594
|
-
this.checkClearButton();
|
|
595
|
-
this.changeDetector.markForCheck();
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* @hidden
|
|
601
|
-
*/
|
|
602
|
-
handleFocus() {
|
|
603
|
-
this.ngZone.run(() => {
|
|
604
|
-
if (!this.focusChangedProgrammatically && hasObservers(this.onFocus)) {
|
|
605
|
-
this.onFocus.emit();
|
|
606
|
-
}
|
|
607
|
-
this.isFocused = true;
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* @hidden
|
|
612
|
-
*/
|
|
613
|
-
handleBlur() {
|
|
614
|
-
this.ngZone.run(() => {
|
|
615
|
-
if (!this.focusChangedProgrammatically) {
|
|
616
|
-
this.onBlur.emit();
|
|
617
|
-
}
|
|
618
|
-
this.isFocused = false;
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
handleClasses(value, input) {
|
|
622
|
-
const elem = this.hostElement.nativeElement;
|
|
623
|
-
const classes = getStylingClasses('input', input, this[input], value);
|
|
624
|
-
if (classes.toRemove) {
|
|
625
|
-
this.renderer.removeClass(elem, classes.toRemove);
|
|
626
|
-
}
|
|
627
|
-
if (classes.toAdd) {
|
|
628
|
-
this.renderer.addClass(elem, classes.toAdd);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
configureAdornments() {
|
|
632
|
-
this.prefix = this.textBoxPrefixTemplate.first || this.prefixTemplate;
|
|
633
|
-
this.suffix = this.textBoxSuffixTemplate.first || this.suffixTemplate;
|
|
634
|
-
}
|
|
635
|
-
setInputAttributes() {
|
|
636
|
-
setHTMLAttributes(this.parsedAttributes, this.renderer, this.input.nativeElement, this.ngZone);
|
|
637
|
-
}
|
|
638
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", 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 });
|
|
639
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TextBoxComponent, isStandalone: true, selector: "kendo-textbox", inputs: { focusableId: "focusableId", title: "title", type: "type", 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", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-disabled": "this.disabledClass", "class.k-textbox": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.direction" } }, providers: [
|
|
640
|
-
LocalizationService,
|
|
641
|
-
{ provide: L10N_PREFIX, useValue: 'kendo.textbox' },
|
|
642
|
-
{
|
|
643
|
-
provide: NG_VALUE_ACCESSOR,
|
|
644
|
-
useExisting: forwardRef(() => TextBoxComponent),
|
|
645
|
-
multi: true
|
|
646
|
-
},
|
|
647
|
-
{ provide: KendoInput, useExisting: forwardRef(() => TextBoxComponent) }
|
|
648
|
-
], queries: [{ propertyName: "suffixTemplate", first: true, predicate: SuffixTemplateDirective, descendants: true }, { propertyName: "prefixTemplate", first: true, predicate: PrefixTemplateDirective, descendants: true }, { propertyName: "textBoxSuffixTemplate", predicate: TextBoxSuffixTemplateDirective }, { propertyName: "textBoxPrefixTemplate", predicate: TextBoxPrefixTemplateDirective }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], exportAs: ["kendoTextBox"], usesOnChanges: true, ngImport: i0, template: `
|
|
649
|
-
<ng-container kendoTextBoxLocalizedMessages
|
|
650
|
-
i18n-clear="kendo.textbox.clear|The title for the **Clear** button in the TextBox."
|
|
651
|
-
clear="Clear">
|
|
652
|
-
</ng-container>
|
|
653
|
-
<ng-container
|
|
654
|
-
kendoInputSharedEvents
|
|
655
|
-
[hostElement]="hostElement"
|
|
656
|
-
[(isFocused)]="isFocused"
|
|
657
|
-
(handleBlur)="handleBlur()"
|
|
658
|
-
(onFocus)="handleFocus()"
|
|
659
|
-
[clearButtonClicked]="clearButtonClicked"
|
|
660
|
-
>
|
|
661
|
-
@if (prefix) {
|
|
662
|
-
<span class="k-input-prefix k-input-prefix-horizontal">
|
|
663
|
-
<ng-template [ngTemplateOutlet]="prefix?.templateRef">
|
|
664
|
-
</ng-template>
|
|
665
|
-
</span>
|
|
666
|
-
}
|
|
667
|
-
@if (prefix && prefix.showSeparator) {
|
|
668
|
-
<kendo-input-separator></kendo-input-separator>
|
|
669
|
-
}
|
|
670
|
-
<input #input
|
|
671
|
-
class="k-input-inner"
|
|
672
|
-
[id]="focusableId"
|
|
673
|
-
[disabled]="disabled"
|
|
674
|
-
[readonly]="readonly"
|
|
675
|
-
[attr.tabindex]="disabled ? undefined : tabindex"
|
|
676
|
-
[value]="value"
|
|
677
|
-
[attr.type]="type"
|
|
678
|
-
[attr.placeholder]="placeholder"
|
|
679
|
-
[attr.title]="title"
|
|
680
|
-
[attr.maxlength]="maxlength"
|
|
681
|
-
[attr.aria-invalid]="isControlInvalid"
|
|
682
|
-
[attr.required]="isControlRequired ? '' : null"
|
|
683
|
-
[kendoEventsOutsideAngular]="{
|
|
684
|
-
focus: handleInputFocus,
|
|
685
|
-
blur: handleInputBlur,
|
|
686
|
-
input: handleInput}"
|
|
687
|
-
/>
|
|
688
|
-
@if (showClearButton) {
|
|
689
|
-
<span
|
|
690
|
-
role="button"
|
|
691
|
-
class="k-clear-value"
|
|
692
|
-
(click)="clearValue()"
|
|
693
|
-
(mousedown)="$event.preventDefault()"
|
|
694
|
-
[tabindex]="tabIndex"
|
|
695
|
-
[attr.aria-label]="clearTitle()"
|
|
696
|
-
[title]="clearTitle()"
|
|
697
|
-
(keydown.enter)="clearValue($event)"
|
|
698
|
-
(keydown.space)="clearValue($event)">
|
|
699
|
-
<kendo-icon-wrapper
|
|
700
|
-
[name]="clearButtonClass"
|
|
701
|
-
[customFontClass]="customClearButtonClasses"
|
|
702
|
-
[svgIcon]="clearButtonSvgIcon || svgIcon('xIcon')"
|
|
703
|
-
>
|
|
704
|
-
</kendo-icon-wrapper>
|
|
705
|
-
</span>
|
|
706
|
-
}
|
|
707
|
-
@if (hasErrors) {
|
|
708
|
-
<kendo-icon-wrapper
|
|
709
|
-
innerCssClass="k-input-validation-icon"
|
|
710
|
-
[name]="errorIconClasses"
|
|
711
|
-
[customFontClass]="customIconClasses"
|
|
712
|
-
[svgIcon]="errorSvgIcon || svgIcon('exclamationCircleIcon')"
|
|
713
|
-
>
|
|
714
|
-
</kendo-icon-wrapper>
|
|
715
|
-
}
|
|
716
|
-
@if (isSuccessful) {
|
|
717
|
-
<kendo-icon-wrapper
|
|
718
|
-
innerCssClass="k-input-validation-icon"
|
|
719
|
-
[name]="successIconClasses"
|
|
720
|
-
[customFontClass]="customSuccessIconClasses"
|
|
721
|
-
[svgIcon]="successSvgIcon || svgIcon('checkIcon')"
|
|
722
|
-
>
|
|
723
|
-
</kendo-icon-wrapper>
|
|
724
|
-
}
|
|
725
|
-
@if (suffix && suffix.showSeparator) {
|
|
726
|
-
<kendo-input-separator></kendo-input-separator>
|
|
727
|
-
}
|
|
728
|
-
@if (suffix) {
|
|
729
|
-
<span class="k-input-suffix k-input-suffix-horizontal">
|
|
730
|
-
<ng-template [ngTemplateOutlet]="suffix?.templateRef">
|
|
731
|
-
</ng-template>
|
|
732
|
-
</span>
|
|
733
|
-
}
|
|
734
|
-
<ng-container>
|
|
735
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedTextBoxMessagesDirective, selector: "[kendoTextBoxLocalizedMessages]" }, { kind: "directive", type: SharedInputEventsDirective, selector: "[kendoInputSharedEvents]", inputs: ["hostElement", "clearButtonClicked", "isFocused"], outputs: ["isFocusedChange", "onFocus", "handleBlur"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputSeparatorComponent, selector: "kendo-input-separator, kendo-textbox-separator", inputs: ["orientation"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
736
|
-
}
|
|
737
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextBoxComponent, decorators: [{
|
|
738
|
-
type: Component,
|
|
739
|
-
args: [{
|
|
740
|
-
exportAs: 'kendoTextBox',
|
|
741
|
-
providers: [
|
|
742
|
-
LocalizationService,
|
|
743
|
-
{ provide: L10N_PREFIX, useValue: 'kendo.textbox' },
|
|
744
|
-
{
|
|
745
|
-
provide: NG_VALUE_ACCESSOR,
|
|
746
|
-
useExisting: forwardRef(() => TextBoxComponent),
|
|
747
|
-
multi: true
|
|
748
|
-
},
|
|
749
|
-
{ provide: KendoInput, useExisting: forwardRef(() => TextBoxComponent) }
|
|
750
|
-
],
|
|
751
|
-
selector: 'kendo-textbox',
|
|
752
|
-
template: `
|
|
753
|
-
<ng-container kendoTextBoxLocalizedMessages
|
|
754
|
-
i18n-clear="kendo.textbox.clear|The title for the **Clear** button in the TextBox."
|
|
755
|
-
clear="Clear">
|
|
756
|
-
</ng-container>
|
|
757
|
-
<ng-container
|
|
758
|
-
kendoInputSharedEvents
|
|
759
|
-
[hostElement]="hostElement"
|
|
760
|
-
[(isFocused)]="isFocused"
|
|
761
|
-
(handleBlur)="handleBlur()"
|
|
762
|
-
(onFocus)="handleFocus()"
|
|
763
|
-
[clearButtonClicked]="clearButtonClicked"
|
|
764
|
-
>
|
|
765
|
-
@if (prefix) {
|
|
766
|
-
<span class="k-input-prefix k-input-prefix-horizontal">
|
|
767
|
-
<ng-template [ngTemplateOutlet]="prefix?.templateRef">
|
|
768
|
-
</ng-template>
|
|
769
|
-
</span>
|
|
770
|
-
}
|
|
771
|
-
@if (prefix && prefix.showSeparator) {
|
|
772
|
-
<kendo-input-separator></kendo-input-separator>
|
|
773
|
-
}
|
|
774
|
-
<input #input
|
|
775
|
-
class="k-input-inner"
|
|
776
|
-
[id]="focusableId"
|
|
777
|
-
[disabled]="disabled"
|
|
778
|
-
[readonly]="readonly"
|
|
779
|
-
[attr.tabindex]="disabled ? undefined : tabindex"
|
|
780
|
-
[value]="value"
|
|
781
|
-
[attr.type]="type"
|
|
782
|
-
[attr.placeholder]="placeholder"
|
|
783
|
-
[attr.title]="title"
|
|
784
|
-
[attr.maxlength]="maxlength"
|
|
785
|
-
[attr.aria-invalid]="isControlInvalid"
|
|
786
|
-
[attr.required]="isControlRequired ? '' : null"
|
|
787
|
-
[kendoEventsOutsideAngular]="{
|
|
788
|
-
focus: handleInputFocus,
|
|
789
|
-
blur: handleInputBlur,
|
|
790
|
-
input: handleInput}"
|
|
791
|
-
/>
|
|
792
|
-
@if (showClearButton) {
|
|
793
|
-
<span
|
|
794
|
-
role="button"
|
|
795
|
-
class="k-clear-value"
|
|
796
|
-
(click)="clearValue()"
|
|
797
|
-
(mousedown)="$event.preventDefault()"
|
|
798
|
-
[tabindex]="tabIndex"
|
|
799
|
-
[attr.aria-label]="clearTitle()"
|
|
800
|
-
[title]="clearTitle()"
|
|
801
|
-
(keydown.enter)="clearValue($event)"
|
|
802
|
-
(keydown.space)="clearValue($event)">
|
|
803
|
-
<kendo-icon-wrapper
|
|
804
|
-
[name]="clearButtonClass"
|
|
805
|
-
[customFontClass]="customClearButtonClasses"
|
|
806
|
-
[svgIcon]="clearButtonSvgIcon || svgIcon('xIcon')"
|
|
807
|
-
>
|
|
808
|
-
</kendo-icon-wrapper>
|
|
809
|
-
</span>
|
|
810
|
-
}
|
|
811
|
-
@if (hasErrors) {
|
|
812
|
-
<kendo-icon-wrapper
|
|
813
|
-
innerCssClass="k-input-validation-icon"
|
|
814
|
-
[name]="errorIconClasses"
|
|
815
|
-
[customFontClass]="customIconClasses"
|
|
816
|
-
[svgIcon]="errorSvgIcon || svgIcon('exclamationCircleIcon')"
|
|
817
|
-
>
|
|
818
|
-
</kendo-icon-wrapper>
|
|
819
|
-
}
|
|
820
|
-
@if (isSuccessful) {
|
|
821
|
-
<kendo-icon-wrapper
|
|
822
|
-
innerCssClass="k-input-validation-icon"
|
|
823
|
-
[name]="successIconClasses"
|
|
824
|
-
[customFontClass]="customSuccessIconClasses"
|
|
825
|
-
[svgIcon]="successSvgIcon || svgIcon('checkIcon')"
|
|
826
|
-
>
|
|
827
|
-
</kendo-icon-wrapper>
|
|
828
|
-
}
|
|
829
|
-
@if (suffix && suffix.showSeparator) {
|
|
830
|
-
<kendo-input-separator></kendo-input-separator>
|
|
831
|
-
}
|
|
832
|
-
@if (suffix) {
|
|
833
|
-
<span class="k-input-suffix k-input-suffix-horizontal">
|
|
834
|
-
<ng-template [ngTemplateOutlet]="suffix?.templateRef">
|
|
835
|
-
</ng-template>
|
|
836
|
-
</span>
|
|
837
|
-
}
|
|
838
|
-
<ng-container>
|
|
839
|
-
`,
|
|
840
|
-
standalone: true,
|
|
841
|
-
imports: [LocalizedTextBoxMessagesDirective, SharedInputEventsDirective, NgTemplateOutlet, InputSeparatorComponent, EventsOutsideAngularDirective, IconWrapperComponent]
|
|
842
|
-
}]
|
|
843
|
-
}], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { focusableId: [{
|
|
844
|
-
type: Input
|
|
845
|
-
}], title: [{
|
|
846
|
-
type: Input
|
|
847
|
-
}], type: [{
|
|
848
|
-
type: Input
|
|
849
|
-
}], disabled: [{
|
|
850
|
-
type: Input
|
|
851
|
-
}], readonly: [{
|
|
852
|
-
type: Input
|
|
853
|
-
}, {
|
|
854
|
-
type: HostBinding,
|
|
855
|
-
args: ['class.k-readonly']
|
|
856
|
-
}], tabindex: [{
|
|
857
|
-
type: Input
|
|
858
|
-
}], value: [{
|
|
859
|
-
type: Input
|
|
860
|
-
}], selectOnFocus: [{
|
|
861
|
-
type: Input
|
|
862
|
-
}], showSuccessIcon: [{
|
|
863
|
-
type: Input
|
|
864
|
-
}], showErrorIcon: [{
|
|
865
|
-
type: Input
|
|
866
|
-
}], clearButton: [{
|
|
867
|
-
type: Input
|
|
868
|
-
}], successIcon: [{
|
|
869
|
-
type: Input
|
|
870
|
-
}], successSvgIcon: [{
|
|
871
|
-
type: Input
|
|
872
|
-
}], errorIcon: [{
|
|
873
|
-
type: Input
|
|
874
|
-
}], errorSvgIcon: [{
|
|
875
|
-
type: Input
|
|
876
|
-
}], clearButtonIcon: [{
|
|
877
|
-
type: Input
|
|
878
|
-
}], clearButtonSvgIcon: [{
|
|
879
|
-
type: Input
|
|
880
|
-
}], size: [{
|
|
881
|
-
type: Input
|
|
882
|
-
}], rounded: [{
|
|
883
|
-
type: Input
|
|
884
|
-
}], fillMode: [{
|
|
885
|
-
type: Input
|
|
886
|
-
}], tabIndex: [{
|
|
887
|
-
type: Input
|
|
888
|
-
}], placeholder: [{
|
|
889
|
-
type: Input
|
|
890
|
-
}], maxlength: [{
|
|
891
|
-
type: Input
|
|
892
|
-
}], inputAttributes: [{
|
|
893
|
-
type: Input
|
|
894
|
-
}], valueChange: [{
|
|
895
|
-
type: Output
|
|
896
|
-
}], inputFocus: [{
|
|
897
|
-
type: Output
|
|
898
|
-
}], inputBlur: [{
|
|
899
|
-
type: Output
|
|
900
|
-
}], onFocus: [{
|
|
901
|
-
type: Output,
|
|
902
|
-
args: ['focus']
|
|
903
|
-
}], onBlur: [{
|
|
904
|
-
type: Output,
|
|
905
|
-
args: ['blur']
|
|
906
|
-
}], input: [{
|
|
907
|
-
type: ViewChild,
|
|
908
|
-
args: ['input', { static: true }]
|
|
909
|
-
}], textBoxSuffixTemplate: [{
|
|
910
|
-
type: ContentChildren,
|
|
911
|
-
args: [TextBoxSuffixTemplateDirective, { descendants: false }]
|
|
912
|
-
}], textBoxPrefixTemplate: [{
|
|
913
|
-
type: ContentChildren,
|
|
914
|
-
args: [TextBoxPrefixTemplateDirective, { descendants: false }]
|
|
915
|
-
}], suffixTemplate: [{
|
|
916
|
-
type: ContentChild,
|
|
917
|
-
args: [SuffixTemplateDirective]
|
|
918
|
-
}], prefixTemplate: [{
|
|
919
|
-
type: ContentChild,
|
|
920
|
-
args: [PrefixTemplateDirective]
|
|
921
|
-
}], disabledClass: [{
|
|
922
|
-
type: HostBinding,
|
|
923
|
-
args: ['class.k-disabled']
|
|
924
|
-
}], hostClasses: [{
|
|
925
|
-
type: HostBinding,
|
|
926
|
-
args: ['class.k-textbox']
|
|
927
|
-
}, {
|
|
928
|
-
type: HostBinding,
|
|
929
|
-
args: ['class.k-input']
|
|
930
|
-
}], direction: [{
|
|
931
|
-
type: HostBinding,
|
|
932
|
-
args: ['attr.dir']
|
|
933
|
-
}] } });
|