@progress/kendo-angular-inputs 14.4.0-develop.8 → 15.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +146 -593
- package/esm2020/colorpicker/color-input.component.mjs +1 -1
- package/esm2020/index.mjs +4 -0
- package/esm2020/maskedtextbox/maskedtextbox.component.mjs +144 -56
- package/esm2020/maskedtextbox.module.mjs +30 -6
- package/esm2020/numerictextbox/numerictextbox.component.mjs +186 -91
- package/esm2020/numerictextbox.module.mjs +10 -6
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/shared/input-separator.component.mjs +21 -3
- package/esm2020/shared/shared-events.directive.mjs +95 -0
- package/esm2020/shared-events.module.mjs +22 -0
- package/esm2020/textarea/models/adornments-orientation.mjs +5 -0
- package/esm2020/textarea/textarea-prefix.component.mjs +70 -0
- package/esm2020/textarea/textarea-suffix.component.mjs +33 -3
- package/esm2020/textarea/textarea.component.mjs +198 -131
- package/esm2020/textarea.module.mjs +14 -5
- package/esm2020/textbox/textbox-prefix.directive.mjs +17 -3
- package/esm2020/textbox/textbox-suffix.directive.mjs +17 -3
- package/esm2020/textbox/textbox.component.mjs +205 -203
- package/esm2020/textbox.module.mjs +9 -5
- package/fesm2015/progress-kendo-angular-inputs.mjs +1131 -609
- package/fesm2020/progress-kendo-angular-inputs.mjs +1131 -609
- package/index.d.ts +6 -0
- package/maskedtextbox/maskedtextbox.component.d.ts +37 -6
- package/maskedtextbox.module.d.ts +3 -1
- package/numerictextbox/numerictextbox.component.d.ts +38 -7
- package/numerictextbox.module.d.ts +3 -1
- package/package.json +10 -10
- package/shared/input-separator.component.d.ts +8 -1
- package/shared/shared-events.directive.d.ts +27 -0
- package/shared-events.module.d.ts +14 -0
- package/textarea/models/adornments-orientation.d.ts +12 -0
- package/textarea/textarea-prefix.component.d.ts +37 -0
- package/textarea/textarea-suffix.component.d.ts +12 -1
- package/textarea/textarea.component.d.ts +62 -6
- package/textarea.module.d.ts +9 -7
- package/textbox/textbox-prefix.directive.d.ts +9 -1
- package/textbox/textbox-suffix.directive.d.ts +9 -1
- package/textbox/textbox.component.d.ts +36 -9
- package/textbox.module.d.ts +4 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { SharedInputEventsDirective } from './shared/shared-events.directive';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export class SharedEventsModule {
|
|
12
|
+
}
|
|
13
|
+
SharedEventsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedEventsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
14
|
+
SharedEventsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedEventsModule, declarations: [SharedInputEventsDirective], exports: [SharedInputEventsDirective] });
|
|
15
|
+
SharedEventsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedEventsModule });
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedEventsModule, decorators: [{
|
|
17
|
+
type: NgModule,
|
|
18
|
+
args: [{
|
|
19
|
+
declarations: [SharedInputEventsDirective],
|
|
20
|
+
exports: [SharedInputEventsDirective],
|
|
21
|
+
}]
|
|
22
|
+
}] });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, HostBinding, Input } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the adornments in the prefix container ([see example]({% slug textarea_adornments %})).
|
|
9
|
+
* ```ts-no-run
|
|
10
|
+
* _@Component({
|
|
11
|
+
* selector: 'my-app',
|
|
12
|
+
* template: `
|
|
13
|
+
* <kendo-textarea>
|
|
14
|
+
* <kendo-textarea-prefix>
|
|
15
|
+
* <button kendoButton look="clear" icon="image"></button>
|
|
16
|
+
* </kendo-textarea-prefix>
|
|
17
|
+
* </kendo-textarea>
|
|
18
|
+
* `
|
|
19
|
+
* })
|
|
20
|
+
* class AppComponent {}
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export class TextAreaPrefixComponent {
|
|
24
|
+
constructor() {
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
this.flow = 'vertical';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
this.orientation = 'horizontal';
|
|
33
|
+
this.hostClass = true;
|
|
34
|
+
}
|
|
35
|
+
get verticalOrientation() {
|
|
36
|
+
return this.orientation === 'vertical';
|
|
37
|
+
}
|
|
38
|
+
get horizontalOrientation() {
|
|
39
|
+
return this.orientation === 'horizontal';
|
|
40
|
+
}
|
|
41
|
+
get alignItems() {
|
|
42
|
+
return this.flow === this.orientation;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
TextAreaPrefixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaPrefixComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
+
TextAreaPrefixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaPrefixComponent, selector: "kendo-textarea-prefix", inputs: { flow: "flow", orientation: "orientation" }, host: { properties: { "class.k-input-prefix": "this.hostClass", "class.k-input-prefix-vertical": "this.verticalOrientation", "class.k-input-prefix-horizontal": "this.horizontalOrientation", "class.!k-align-items-start": "this.alignItems" } }, exportAs: ["kendoTextAreaPrefix"], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaPrefixComponent, decorators: [{
|
|
48
|
+
type: Component,
|
|
49
|
+
args: [{
|
|
50
|
+
exportAs: 'kendoTextAreaPrefix',
|
|
51
|
+
selector: 'kendo-textarea-prefix',
|
|
52
|
+
template: `<ng-content></ng-content>`
|
|
53
|
+
}]
|
|
54
|
+
}], propDecorators: { flow: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], orientation: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], hostClass: [{
|
|
59
|
+
type: HostBinding,
|
|
60
|
+
args: ['class.k-input-prefix']
|
|
61
|
+
}], verticalOrientation: [{
|
|
62
|
+
type: HostBinding,
|
|
63
|
+
args: ['class.k-input-prefix-vertical']
|
|
64
|
+
}], horizontalOrientation: [{
|
|
65
|
+
type: HostBinding,
|
|
66
|
+
args: ['class.k-input-prefix-horizontal']
|
|
67
|
+
}], alignItems: [{
|
|
68
|
+
type: HostBinding,
|
|
69
|
+
args: ['class.!k-align-items-start']
|
|
70
|
+
}] } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, HostBinding } from '@angular/core';
|
|
5
|
+
import { Component, HostBinding, Input } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Specifies the adornments in the suffix container ([see example]({% slug textarea_adornments %})).
|
|
@@ -22,11 +22,28 @@ import * as i0 from "@angular/core";
|
|
|
22
22
|
*/
|
|
23
23
|
export class TextAreaSuffixComponent {
|
|
24
24
|
constructor() {
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
this.flow = 'vertical';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
this.orientation = 'horizontal';
|
|
25
33
|
this.hostClass = true;
|
|
26
34
|
}
|
|
35
|
+
get verticalOrientation() {
|
|
36
|
+
return this.orientation === 'vertical';
|
|
37
|
+
}
|
|
38
|
+
get horizontalOrientation() {
|
|
39
|
+
return this.orientation === 'horizontal';
|
|
40
|
+
}
|
|
41
|
+
get alignItems() {
|
|
42
|
+
return this.flow === this.orientation;
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
TextAreaSuffixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaSuffixComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
-
TextAreaSuffixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", host: { properties: { "class.k-input-suffix": "this.hostClass" } }, exportAs: ["kendoTextAreaSuffix"], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
46
|
+
TextAreaSuffixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaSuffixComponent, selector: "kendo-textarea-suffix", inputs: { flow: "flow", orientation: "orientation" }, host: { properties: { "class.k-input-suffix": "this.hostClass", "class.k-input-suffix-vertical": "this.verticalOrientation", "class.k-input-suffix-horizontal": "this.horizontalOrientation", "class.!k-align-items-start": "this.alignItems" } }, exportAs: ["kendoTextAreaSuffix"], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
30
47
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaSuffixComponent, decorators: [{
|
|
31
48
|
type: Component,
|
|
32
49
|
args: [{
|
|
@@ -34,7 +51,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
34
51
|
selector: 'kendo-textarea-suffix',
|
|
35
52
|
template: `<ng-content></ng-content>`
|
|
36
53
|
}]
|
|
37
|
-
}], propDecorators: {
|
|
54
|
+
}], propDecorators: { flow: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], orientation: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], hostClass: [{
|
|
38
59
|
type: HostBinding,
|
|
39
60
|
args: ['class.k-input-suffix']
|
|
61
|
+
}], verticalOrientation: [{
|
|
62
|
+
type: HostBinding,
|
|
63
|
+
args: ['class.k-input-suffix-vertical']
|
|
64
|
+
}], horizontalOrientation: [{
|
|
65
|
+
type: HostBinding,
|
|
66
|
+
args: ['class.k-input-suffix-horizontal']
|
|
67
|
+
}], alignItems: [{
|
|
68
|
+
type: HostBinding,
|
|
69
|
+
args: ['class.!k-align-items-start']
|
|
40
70
|
}] } });
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, HostBinding, Input, Output, ElementRef, EventEmitter, NgZone, Renderer2, ChangeDetectorRef, Injector, forwardRef } from '@angular/core';
|
|
5
|
+
import { Component, HostBinding, Input, Output, ElementRef, EventEmitter, NgZone, Renderer2, ChangeDetectorRef, Injector, forwardRef, ContentChild } from '@angular/core';
|
|
6
6
|
import { fromEvent } from 'rxjs';
|
|
7
7
|
import { debounceTime } from 'rxjs/operators';
|
|
8
8
|
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
9
|
-
import { KendoInput, guid, isDocumentAvailable, hasObservers
|
|
9
|
+
import { KendoInput, guid, isDocumentAvailable, hasObservers } from '@progress/kendo-angular-common';
|
|
10
10
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
11
11
|
import { TextFieldsBase } from '../text-fields-common/text-fields-base';
|
|
12
12
|
import { areSame, isPresent, getStylingClasses } from '../common/utils';
|
|
13
13
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
14
|
-
import { closest } from './../common/dom-utils';
|
|
15
14
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
16
15
|
import { packageMetadata } from '../package-metadata';
|
|
16
|
+
import { TextAreaPrefixComponent } from './textarea-prefix.component';
|
|
17
|
+
import { TextAreaSuffixComponent } from './textarea-suffix.component';
|
|
17
18
|
import * as i0 from "@angular/core";
|
|
18
19
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
19
|
-
import * as i2 from "
|
|
20
|
-
import * as i3 from "
|
|
20
|
+
import * as i2 from "../shared/input-separator.component";
|
|
21
|
+
import * as i3 from "../shared/shared-events.directive";
|
|
22
|
+
import * as i4 from "@angular/common";
|
|
23
|
+
import * as i5 from "@progress/kendo-angular-common";
|
|
21
24
|
const resizeClasses = {
|
|
22
25
|
'vertical': 'k-resize-y',
|
|
23
26
|
'horizontal': 'k-resize-x',
|
|
@@ -46,15 +49,7 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
46
49
|
*/
|
|
47
50
|
this.focusableId = `k-${guid()}`;
|
|
48
51
|
this.hostClasses = true;
|
|
49
|
-
|
|
50
|
-
* Specifies the flow direction of the TextArea sections. This property is useful when adornments are used, in order to specify
|
|
51
|
-
* their position in relation to the textarea element.
|
|
52
|
-
*
|
|
53
|
-
* The possible values are:
|
|
54
|
-
* * `vertical`(Default) —TextArea sections are placed from top to bottom.
|
|
55
|
-
* * `horizontal`—TextArea sections are placed from left to right in `ltr`, and from right to left in `rtl` mode.
|
|
56
|
-
*/
|
|
57
|
-
this.flow = 'vertical';
|
|
52
|
+
this._flow = 'vertical';
|
|
58
53
|
/**
|
|
59
54
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
60
55
|
*/
|
|
@@ -71,6 +66,20 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
71
66
|
*
|
|
72
67
|
*/
|
|
73
68
|
this.resizable = 'vertical';
|
|
69
|
+
/**
|
|
70
|
+
* Specifies whether the prefix separator of the TextArea is rendered.
|
|
71
|
+
* If a prefix template is not declared, the separator will not be rendered, regardless of the parameter value.
|
|
72
|
+
*
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
this.showPrefixSeparator = false;
|
|
76
|
+
/**
|
|
77
|
+
* Specifies whether the suffix separator of the TextArea is rendered.
|
|
78
|
+
* If a suffix template is not declared, the separator will not be rendered, regardless of the parameter value.
|
|
79
|
+
*
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
this.showSuffixSeparator = false;
|
|
74
83
|
/**
|
|
75
84
|
* Fires each time the user focuses the TextArea component.
|
|
76
85
|
*
|
|
@@ -122,6 +131,7 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
122
131
|
this._size = 'medium';
|
|
123
132
|
this._rounded = 'medium';
|
|
124
133
|
this._fillMode = 'solid';
|
|
134
|
+
this._adornmentsOrientation = 'horizontal';
|
|
125
135
|
/**
|
|
126
136
|
* @hidden
|
|
127
137
|
*/
|
|
@@ -140,12 +150,8 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
140
150
|
setTimeout(() => { this.selectAll(); });
|
|
141
151
|
});
|
|
142
152
|
}
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
this.ngZone.run(() => {
|
|
146
|
-
this.onFocus.emit();
|
|
147
|
-
});
|
|
148
|
-
}
|
|
153
|
+
if (!this.isFocused) {
|
|
154
|
+
this.handleFocus();
|
|
149
155
|
}
|
|
150
156
|
if (hasObservers(this.inputFocus)) {
|
|
151
157
|
if (!this.focusChangedProgrammatically) {
|
|
@@ -154,9 +160,6 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
154
160
|
});
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
this.ngZone.run(() => {
|
|
158
|
-
this.isFocused = true;
|
|
159
|
-
});
|
|
160
163
|
}
|
|
161
164
|
};
|
|
162
165
|
validatePackage(packageMetadata);
|
|
@@ -168,6 +171,46 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
168
171
|
get flowRow() {
|
|
169
172
|
return this.flow === 'horizontal';
|
|
170
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Specifies the flow direction of the TextArea sections. This property is useful when adornments are used, in order to specify
|
|
176
|
+
* their position in relation to the textarea element.
|
|
177
|
+
*
|
|
178
|
+
* The possible values are:
|
|
179
|
+
* * `vertical`(Default) —TextArea sections are placed from top to bottom.
|
|
180
|
+
* * `horizontal`—TextArea sections are placed from left to right in `ltr`, and from right to left in `rtl` mode.
|
|
181
|
+
*/
|
|
182
|
+
set flow(flow) {
|
|
183
|
+
this._flow = flow;
|
|
184
|
+
if (this.prefix) {
|
|
185
|
+
this.prefix.flow = flow;
|
|
186
|
+
}
|
|
187
|
+
if (this.suffix) {
|
|
188
|
+
this.suffix.flow = flow;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
get flow() {
|
|
192
|
+
return this._flow;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Specifies the orientation of the TextArea adornments. This property is used in order to specify
|
|
196
|
+
* the adornments' position relative to themselves.
|
|
197
|
+
*
|
|
198
|
+
* The possible values are:
|
|
199
|
+
* * `horizontal`(Default) —TextArea adornments are placed from left to right in `ltr`, and from right to left in `rtl` mode.
|
|
200
|
+
* * `vertical`—TextArea adornments are placed from top to bottom.
|
|
201
|
+
*/
|
|
202
|
+
set adornmentsOrientation(orientation) {
|
|
203
|
+
this._adornmentsOrientation = orientation;
|
|
204
|
+
if (this.prefix) {
|
|
205
|
+
this.prefix.orientation = orientation;
|
|
206
|
+
}
|
|
207
|
+
if (this.suffix) {
|
|
208
|
+
this.suffix.orientation = orientation;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
get adornmentsOrientation() {
|
|
212
|
+
return this._adornmentsOrientation;
|
|
213
|
+
}
|
|
171
214
|
/**
|
|
172
215
|
* @hidden
|
|
173
216
|
*/
|
|
@@ -232,50 +275,7 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
232
275
|
return this._fillMode;
|
|
233
276
|
}
|
|
234
277
|
ngAfterViewInit() {
|
|
235
|
-
const hostElement = this.hostElement.nativeElement;
|
|
236
|
-
let cursorInsideWrapper = false;
|
|
237
|
-
let tabbing = false;
|
|
238
278
|
this.ngZone.runOutsideAngular(() => {
|
|
239
|
-
// focusIn and focusOut are relative to the host element
|
|
240
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
|
|
241
|
-
if (!this.isFocused) {
|
|
242
|
-
this.ngZone.run(() => {
|
|
243
|
-
this.onFocus.emit();
|
|
244
|
-
this.isFocused = true;
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}));
|
|
248
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (args) => {
|
|
249
|
-
if (!this.isFocused) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (tabbing) {
|
|
253
|
-
const closestTextbox = closest(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
|
|
254
|
-
if (!closestTextbox) {
|
|
255
|
-
this.handleBlur();
|
|
256
|
-
}
|
|
257
|
-
tabbing = false;
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
if (!cursorInsideWrapper) {
|
|
261
|
-
this.handleBlur();
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}));
|
|
265
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseenter', () => {
|
|
266
|
-
cursorInsideWrapper = true;
|
|
267
|
-
}));
|
|
268
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'mouseleave', () => {
|
|
269
|
-
cursorInsideWrapper = false;
|
|
270
|
-
}));
|
|
271
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (args) => {
|
|
272
|
-
if (args.keyCode === Keys.Tab) {
|
|
273
|
-
tabbing = true;
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
tabbing = false;
|
|
277
|
-
}
|
|
278
|
-
}));
|
|
279
279
|
this.handleFlow();
|
|
280
280
|
});
|
|
281
281
|
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
@@ -372,6 +372,33 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
372
372
|
get isControlInvalid() {
|
|
373
373
|
return this.control && this.control.touched && !this.control.valid;
|
|
374
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* @hidden
|
|
377
|
+
*/
|
|
378
|
+
get separatorOrientation() {
|
|
379
|
+
return this.flow === 'horizontal' ? 'vertical' : 'horizontal';
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* @hidden
|
|
383
|
+
*/
|
|
384
|
+
get isFocused() {
|
|
385
|
+
return this._isFocused;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* @hidden
|
|
389
|
+
*/
|
|
390
|
+
set isFocused(value) {
|
|
391
|
+
if (this._isFocused !== value && this.hostElement) {
|
|
392
|
+
const element = this.hostElement.nativeElement;
|
|
393
|
+
if (value && !this.disabled) {
|
|
394
|
+
this.renderer.addClass(element, FOCUSED);
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
this.renderer.removeClass(element, FOCUSED);
|
|
398
|
+
}
|
|
399
|
+
this._isFocused = value;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
375
402
|
/**
|
|
376
403
|
* Focuses the TextArea component.
|
|
377
404
|
*
|
|
@@ -427,21 +454,20 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
427
454
|
}, 0);
|
|
428
455
|
});
|
|
429
456
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
this.renderer.addClass(element, FOCUSED);
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
this.renderer.removeClass(element, FOCUSED);
|
|
457
|
+
/**
|
|
458
|
+
* @hidden
|
|
459
|
+
*/
|
|
460
|
+
handleFocus() {
|
|
461
|
+
this.ngZone.run(() => {
|
|
462
|
+
if (!this.focusChangedProgrammatically && hasObservers(this.onFocus)) {
|
|
463
|
+
this.onFocus.emit();
|
|
441
464
|
}
|
|
442
|
-
this.
|
|
443
|
-
}
|
|
465
|
+
this.isFocused = true;
|
|
466
|
+
});
|
|
444
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* @hidden
|
|
470
|
+
*/
|
|
445
471
|
handleBlur() {
|
|
446
472
|
this.ngZone.run(() => {
|
|
447
473
|
if (!this.focusChangedProgrammatically) {
|
|
@@ -472,17 +498,12 @@ export class TextAreaComponent extends TextFieldsBase {
|
|
|
472
498
|
}
|
|
473
499
|
handleFlow() {
|
|
474
500
|
const isVertical = this.flow === 'vertical';
|
|
475
|
-
const hostElement = this.hostElement.nativeElement;
|
|
476
501
|
const element = this.input.nativeElement;
|
|
477
|
-
const suffix = hostElement.children[1];
|
|
478
502
|
this.renderer[isVertical ? 'addClass' : 'removeClass'](element, '\!k-flex-none');
|
|
479
|
-
if (suffix) {
|
|
480
|
-
this.renderer[isVertical ? 'removeClass' : 'addClass'](suffix, '\!k-align-items-start');
|
|
481
|
-
}
|
|
482
503
|
}
|
|
483
504
|
}
|
|
484
505
|
TextAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
485
|
-
TextAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaComponent, selector: "kendo-textarea", inputs: { focusableId: "focusableId", flow: "flow", rows: "rows", cols: "cols", maxlength: "maxlength", tabindex: "tabindex", tabIndex: "tabIndex", resizable: "resizable", size: "size", rounded: "rounded", fillMode: "fillMode" }, outputs: { onFocus: "focus", onBlur: "blur", valueChange: "valueChange" }, host: { properties: { "class.k-textarea": "this.hostClasses", "class.k-input": "this.hostClasses", "class.!k-flex-col": "this.flowCol", "class.!k-flex-row": "this.flowRow" } }, providers: [
|
|
506
|
+
TextAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaComponent, selector: "kendo-textarea", inputs: { focusableId: "focusableId", flow: "flow", adornmentsOrientation: "adornmentsOrientation", rows: "rows", cols: "cols", maxlength: "maxlength", tabindex: "tabindex", tabIndex: "tabIndex", resizable: "resizable", size: "size", rounded: "rounded", fillMode: "fillMode", showPrefixSeparator: "showPrefixSeparator", showSuffixSeparator: "showSuffixSeparator" }, outputs: { onFocus: "focus", onBlur: "blur", valueChange: "valueChange" }, host: { properties: { "class.k-textarea": "this.hostClasses", "class.k-input": "this.hostClasses", "class.!k-flex-col": "this.flowCol", "class.!k-flex-row": "this.flowRow" } }, providers: [
|
|
486
507
|
LocalizationService,
|
|
487
508
|
{ provide: L10N_PREFIX, useValue: 'kendo.textarea' },
|
|
488
509
|
{
|
|
@@ -491,32 +512,49 @@ TextAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
491
512
|
multi: true
|
|
492
513
|
},
|
|
493
514
|
{ provide: KendoInput, useExisting: forwardRef(() => TextAreaComponent) }
|
|
494
|
-
], exportAs: ["kendoTextArea"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
495
|
-
<
|
|
496
|
-
|
|
497
|
-
[
|
|
498
|
-
[
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
], queries: [{ propertyName: "prefix", first: true, predicate: TextAreaPrefixComponent, descendants: true }, { propertyName: "suffix", first: true, predicate: TextAreaSuffixComponent, descendants: true }], exportAs: ["kendoTextArea"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
516
|
+
<ng-container
|
|
517
|
+
kendoInputSharedEvents
|
|
518
|
+
[hostElement]="hostElement"
|
|
519
|
+
[(isFocused)]="isFocused"
|
|
520
|
+
(handleBlur)="handleBlur()"
|
|
521
|
+
(onFocus)="handleFocus()"
|
|
522
|
+
>
|
|
523
|
+
<ng-content select="kendo-textarea-prefix"></ng-content>
|
|
524
|
+
<kendo-input-separator
|
|
525
|
+
*ngIf="prefix && showPrefixSeparator"
|
|
526
|
+
[orientation]="separatorOrientation"
|
|
527
|
+
></kendo-input-separator>
|
|
528
|
+
<textarea
|
|
529
|
+
#input
|
|
530
|
+
[attr.aria-multiline]="true"
|
|
531
|
+
[attr.aria-disabled]="disabled ? true : undefined"
|
|
532
|
+
[attr.aria-readonly]="readonly ? true : undefined"
|
|
533
|
+
class="k-input-inner !k-overflow-auto"
|
|
534
|
+
[ngClass]="resizableClass"
|
|
535
|
+
[id]="focusableId"
|
|
536
|
+
[value]="value"
|
|
537
|
+
[attr.placeholder]="placeholder"
|
|
538
|
+
[disabled]="disabled"
|
|
539
|
+
[readonly]="readonly"
|
|
540
|
+
[attr.rows]="rows"
|
|
541
|
+
[attr.cols]="cols"
|
|
542
|
+
[attr.tabindex]="tabIndex"
|
|
543
|
+
[attr.title]="title"
|
|
544
|
+
[attr.maxlength]="maxlength"
|
|
545
|
+
[attr.aria-invalid]="isControlInvalid"
|
|
546
|
+
[kendoEventsOutsideAngular]="{
|
|
547
|
+
focus: handleInputFocus,
|
|
548
|
+
blur: handleInputBlur,
|
|
549
|
+
input: handleInput}">
|
|
517
550
|
</textarea>
|
|
551
|
+
<kendo-input-separator
|
|
552
|
+
*ngIf="suffix && showSuffixSeparator"
|
|
553
|
+
[orientation]="separatorOrientation"
|
|
554
|
+
></kendo-input-separator>
|
|
518
555
|
<ng-content select="kendo-textarea-suffix"></ng-content>
|
|
519
|
-
|
|
556
|
+
</ng-container>
|
|
557
|
+
`, isInline: true, components: [{ type: i2.InputSeparatorComponent, selector: "kendo-input-separator, kendo-textbox-separator", inputs: ["orientation"] }], directives: [{ type: i3.SharedInputEventsDirective, selector: "[kendoInputSharedEvents]", inputs: ["hostElement", "clearButtonClicked", "isFocused"], outputs: ["isFocusedChange", "onFocus", "handleBlur"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
|
|
520
558
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaComponent, decorators: [{
|
|
521
559
|
type: Component,
|
|
522
560
|
args: [{
|
|
@@ -533,30 +571,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
533
571
|
],
|
|
534
572
|
selector: 'kendo-textarea',
|
|
535
573
|
template: `
|
|
536
|
-
<
|
|
537
|
-
|
|
538
|
-
[
|
|
539
|
-
[
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
574
|
+
<ng-container
|
|
575
|
+
kendoInputSharedEvents
|
|
576
|
+
[hostElement]="hostElement"
|
|
577
|
+
[(isFocused)]="isFocused"
|
|
578
|
+
(handleBlur)="handleBlur()"
|
|
579
|
+
(onFocus)="handleFocus()"
|
|
580
|
+
>
|
|
581
|
+
<ng-content select="kendo-textarea-prefix"></ng-content>
|
|
582
|
+
<kendo-input-separator
|
|
583
|
+
*ngIf="prefix && showPrefixSeparator"
|
|
584
|
+
[orientation]="separatorOrientation"
|
|
585
|
+
></kendo-input-separator>
|
|
586
|
+
<textarea
|
|
587
|
+
#input
|
|
588
|
+
[attr.aria-multiline]="true"
|
|
589
|
+
[attr.aria-disabled]="disabled ? true : undefined"
|
|
590
|
+
[attr.aria-readonly]="readonly ? true : undefined"
|
|
591
|
+
class="k-input-inner !k-overflow-auto"
|
|
592
|
+
[ngClass]="resizableClass"
|
|
593
|
+
[id]="focusableId"
|
|
594
|
+
[value]="value"
|
|
595
|
+
[attr.placeholder]="placeholder"
|
|
596
|
+
[disabled]="disabled"
|
|
597
|
+
[readonly]="readonly"
|
|
598
|
+
[attr.rows]="rows"
|
|
599
|
+
[attr.cols]="cols"
|
|
600
|
+
[attr.tabindex]="tabIndex"
|
|
601
|
+
[attr.title]="title"
|
|
602
|
+
[attr.maxlength]="maxlength"
|
|
603
|
+
[attr.aria-invalid]="isControlInvalid"
|
|
604
|
+
[kendoEventsOutsideAngular]="{
|
|
605
|
+
focus: handleInputFocus,
|
|
606
|
+
blur: handleInputBlur,
|
|
607
|
+
input: handleInput}">
|
|
558
608
|
</textarea>
|
|
609
|
+
<kendo-input-separator
|
|
610
|
+
*ngIf="suffix && showSuffixSeparator"
|
|
611
|
+
[orientation]="separatorOrientation"
|
|
612
|
+
></kendo-input-separator>
|
|
559
613
|
<ng-content select="kendo-textarea-suffix"></ng-content>
|
|
614
|
+
</ng-container>
|
|
560
615
|
`
|
|
561
616
|
}]
|
|
562
617
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { focusableId: [{
|
|
@@ -575,6 +630,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
575
630
|
args: ['class.\!k-flex-row']
|
|
576
631
|
}], flow: [{
|
|
577
632
|
type: Input
|
|
633
|
+
}], adornmentsOrientation: [{
|
|
634
|
+
type: Input
|
|
578
635
|
}], rows: [{
|
|
579
636
|
type: Input
|
|
580
637
|
}], cols: [{
|
|
@@ -593,6 +650,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
593
650
|
type: Input
|
|
594
651
|
}], fillMode: [{
|
|
595
652
|
type: Input
|
|
653
|
+
}], showPrefixSeparator: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], showSuffixSeparator: [{
|
|
656
|
+
type: Input
|
|
596
657
|
}], onFocus: [{
|
|
597
658
|
type: Output,
|
|
598
659
|
args: ['focus']
|
|
@@ -601,4 +662,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
601
662
|
args: ['blur']
|
|
602
663
|
}], valueChange: [{
|
|
603
664
|
type: Output
|
|
665
|
+
}], prefix: [{
|
|
666
|
+
type: ContentChild,
|
|
667
|
+
args: [TextAreaPrefixComponent]
|
|
668
|
+
}], suffix: [{
|
|
669
|
+
type: ContentChild,
|
|
670
|
+
args: [TextAreaSuffixComponent]
|
|
604
671
|
}] } });
|