@progress/kendo-angular-inputs 7.5.1 → 8.0.0-dev.202112211528
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/dist/cdn/js/kendo-angular-inputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/checkbox/checkbox.directive.js +79 -3
- package/dist/es/colorpicker/color-contrast-svg.component.js +95 -0
- package/dist/es/colorpicker/color-gradient.component.js +109 -81
- package/dist/es/colorpicker/color-input.component.js +39 -18
- package/dist/es/colorpicker/color-palette.component.js +28 -18
- package/dist/es/colorpicker/colorpicker.component.js +279 -80
- package/dist/es/colorpicker/constants.js +12 -0
- package/dist/es/colorpicker/contrast-validation.component.js +8 -6
- package/dist/es/colorpicker/contrast.component.js +6 -8
- package/dist/es/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/es/colorpicker/events/cancel-event.js +19 -0
- package/dist/es/colorpicker/events/close-event.js +17 -0
- package/dist/es/colorpicker/{models → events}/kendo-drag-event.js +0 -0
- package/dist/es/colorpicker/events/open-event.js +17 -0
- package/dist/es/colorpicker/events.js +8 -0
- package/dist/es/colorpicker/flatcolorpicker-actions.component.js +50 -0
- package/dist/es/colorpicker/flatcolorpicker-header.component.js +94 -0
- package/dist/es/colorpicker/flatcolorpicker.component.js +553 -0
- package/dist/es/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/es/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/es/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/es/colorpicker/localization/flatcolorpicker-localization.service.js +34 -0
- package/dist/es/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/es/colorpicker/localization/messages.js +36 -0
- package/dist/es/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
- package/dist/{es2015/colorpicker/models/color-picker-view.js → es/colorpicker/models/colorpicker-view.js} +0 -0
- package/dist/es/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/es/colorpicker/models.js +1 -2
- package/dist/es/colorpicker/services/flatcolorpicker.service.js +41 -0
- package/dist/es/colorpicker/utils/color-parser.js +18 -5
- package/dist/es/colorpicker/utils/contrast-curve.js +91 -0
- package/dist/es/colorpicker/utils.js +1 -1
- package/dist/es/colorpicker.module.js +9 -1
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/common/models/styling-classes.js +4 -0
- package/dist/{es2015/colorpicker/models/kendo-drag-event.js → es/common/models.js} +0 -0
- package/dist/es/common/utils.js +37 -0
- package/dist/es/index.js +5 -0
- package/dist/es/main.js +4 -2
- package/dist/es/maskedtextbox/maskedtextbox.component.js +101 -6
- package/dist/es/numerictextbox/numerictextbox.component.js +116 -20
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/radiobutton.directive.js +52 -3
- package/dist/es/shared/textarea.directive.js +3 -2
- package/dist/es/shared/utils.js +23 -0
- package/dist/es/switch/switch.component.js +167 -21
- package/dist/es/text-fields-common/text-fields-base.js +1 -1
- package/dist/es/textarea/textarea.component.js +101 -5
- package/dist/es/textbox/textbox.component.js +111 -12
- package/dist/es/textbox/textbox.directive.js +3 -2
- package/dist/es/textbox.module.js +0 -3
- package/dist/es2015/checkbox/checkbox.directive.d.ts +31 -0
- package/dist/es2015/checkbox/checkbox.directive.js +68 -10
- package/dist/es2015/colorpicker/color-contrast-svg.component.d.ts +26 -0
- package/dist/es2015/colorpicker/color-contrast-svg.component.js +97 -0
- package/dist/es2015/colorpicker/color-gradient.component.d.ts +32 -43
- package/dist/es2015/colorpicker/color-gradient.component.js +126 -93
- package/dist/es2015/colorpicker/color-input.component.d.ts +11 -4
- package/dist/es2015/colorpicker/color-input.component.js +52 -32
- package/dist/es2015/colorpicker/color-palette.component.d.ts +8 -3
- package/dist/es2015/colorpicker/color-palette.component.js +28 -18
- package/dist/es2015/colorpicker/colorpicker.component.d.ts +127 -25
- package/dist/es2015/colorpicker/colorpicker.component.js +305 -125
- package/dist/es2015/colorpicker/constants.d.ts +12 -0
- package/dist/es2015/colorpicker/constants.js +12 -0
- package/dist/es2015/colorpicker/contrast-validation.component.d.ts +1 -1
- package/dist/es2015/colorpicker/contrast-validation.component.js +16 -12
- package/dist/es2015/colorpicker/contrast.component.d.ts +1 -3
- package/dist/es2015/colorpicker/contrast.component.js +17 -17
- package/dist/es2015/colorpicker/{models → events}/active-color-click-event.d.ts +0 -0
- package/dist/es2015/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/es2015/colorpicker/events/cancel-event.d.ts +15 -0
- package/dist/es2015/colorpicker/events/cancel-event.js +14 -0
- package/dist/es2015/colorpicker/events/close-event.d.ts +10 -0
- package/dist/es2015/colorpicker/events/close-event.js +10 -0
- package/dist/es2015/colorpicker/{models → events}/kendo-drag-event.d.ts +0 -0
- package/dist/es2015/colorpicker/events/kendo-drag-event.js +4 -0
- package/dist/es2015/colorpicker/events/open-event.d.ts +10 -0
- package/dist/es2015/colorpicker/events/open-event.js +10 -0
- package/dist/es2015/colorpicker/events.d.ts +8 -0
- package/dist/es2015/colorpicker/events.js +8 -0
- package/dist/es2015/colorpicker/flatcolorpicker-actions.component.d.ts +18 -0
- package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +60 -0
- package/dist/es2015/colorpicker/flatcolorpicker-header.component.d.ts +30 -0
- package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +131 -0
- package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +214 -0
- package/dist/es2015/colorpicker/flatcolorpicker.component.js +593 -0
- package/dist/es2015/colorpicker/localization/colorgradient-localization.service.d.ts +3 -3
- package/dist/es2015/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/es2015/colorpicker/localization/colorpalette-localization.service.d.ts +3 -3
- package/dist/es2015/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/es2015/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.d.ts +14 -0
- package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.js +31 -0
- package/dist/es2015/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/es2015/colorpicker/localization/messages.d.ts +36 -0
- package/dist/es2015/colorpicker/localization/messages.js +36 -0
- package/dist/es2015/colorpicker/models/actions-layout.d.ts +8 -0
- package/dist/es2015/colorpicker/models/actions-layout.js +4 -0
- package/dist/es2015/colorpicker/models/colorpicker-view.d.ts +8 -0
- package/dist/es2015/colorpicker/models/colorpicker-view.js +4 -0
- package/dist/es2015/colorpicker/models/gradient-settings.d.ts +4 -3
- package/dist/es2015/colorpicker/models/output-format.d.ts +0 -5
- package/dist/es2015/colorpicker/{utils → models}/palette-presets.d.ts +0 -0
- package/dist/es2015/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/es2015/colorpicker/models/palette-settings.d.ts +2 -3
- package/dist/es2015/colorpicker/models/tile-size.d.ts +1 -5
- package/dist/es2015/colorpicker/models.d.ts +10 -10
- package/dist/es2015/colorpicker/models.js +1 -2
- package/dist/es2015/colorpicker/services/flatcolorpicker.service.d.ts +12 -0
- package/dist/es2015/colorpicker/services/flatcolorpicker.service.js +38 -0
- package/dist/es2015/colorpicker/utils/color-parser.d.ts +8 -2
- package/dist/es2015/colorpicker/utils/color-parser.js +15 -5
- package/dist/es2015/colorpicker/utils/contrast-curve.d.ts +37 -0
- package/dist/es2015/colorpicker/utils/contrast-curve.js +85 -0
- package/dist/es2015/colorpicker/utils.d.ts +1 -1
- package/dist/es2015/colorpicker/utils.js +1 -1
- package/dist/es2015/colorpicker.module.js +9 -1
- package/dist/es2015/{colorpicker/models/color-picker-view.d.ts → common/models/fillmode.d.ts} +5 -5
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +23 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models.d.ts +8 -0
- package/dist/es2015/common/models.js +4 -0
- package/dist/es2015/common/utils.d.ts +7 -0
- package/dist/es2015/common/utils.js +37 -0
- package/dist/es2015/index.d.ts +5 -0
- package/dist/es2015/index.js +5 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +5 -2
- package/dist/es2015/main.js +4 -2
- package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +39 -1
- package/dist/es2015/maskedtextbox/maskedtextbox.component.js +88 -6
- package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +39 -2
- package/dist/es2015/numerictextbox/numerictextbox.component.js +124 -40
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/radiobutton/radiobutton.directive.d.ts +18 -0
- package/dist/es2015/radiobutton/radiobutton.directive.js +46 -11
- package/dist/es2015/shared/textarea.directive.d.ts +1 -1
- package/dist/es2015/shared/textarea.directive.js +3 -2
- package/dist/es2015/shared/utils.d.ts +16 -0
- package/dist/es2015/shared/utils.js +23 -0
- package/dist/es2015/switch/switch.component.d.ts +48 -5
- package/dist/es2015/switch/switch.component.js +166 -24
- package/dist/es2015/text-fields-common/text-fields-base.js +1 -1
- package/dist/es2015/textarea/textarea.component.d.ts +39 -1
- package/dist/es2015/textarea/textarea.component.js +89 -5
- package/dist/es2015/textbox/textbox.component.d.ts +40 -1
- package/dist/es2015/textbox/textbox.component.js +99 -12
- package/dist/es2015/textbox/textbox.directive.d.ts +1 -1
- package/dist/es2015/textbox/textbox.directive.js +3 -2
- package/dist/es2015/textbox.module.js +0 -3
- package/dist/fesm2015/index.js +3118 -1477
- package/dist/fesm5/index.js +3040 -1387
- package/dist/npm/checkbox/checkbox.directive.js +78 -2
- package/dist/npm/colorpicker/color-contrast-svg.component.js +97 -0
- package/dist/npm/colorpicker/color-gradient.component.js +109 -81
- package/dist/npm/colorpicker/color-input.component.js +38 -17
- package/dist/npm/colorpicker/color-palette.component.js +29 -19
- package/dist/npm/colorpicker/colorpicker.component.js +285 -86
- package/dist/npm/colorpicker/constants.js +12 -0
- package/dist/npm/colorpicker/contrast-validation.component.js +8 -6
- package/dist/npm/colorpicker/contrast.component.js +6 -8
- package/dist/npm/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/npm/colorpicker/events/cancel-event.js +21 -0
- package/dist/npm/colorpicker/events/close-event.js +19 -0
- package/dist/npm/colorpicker/{models → events}/kendo-drag-event.js +0 -0
- package/dist/npm/colorpicker/events/open-event.js +19 -0
- package/dist/npm/colorpicker/events.js +11 -0
- package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +52 -0
- package/dist/npm/colorpicker/flatcolorpicker-header.component.js +96 -0
- package/dist/npm/colorpicker/flatcolorpicker.component.js +555 -0
- package/dist/npm/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/npm/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/npm/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/npm/colorpicker/localization/flatcolorpicker-localization.service.js +36 -0
- package/dist/npm/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/npm/colorpicker/localization/messages.js +36 -0
- package/dist/npm/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
- package/dist/npm/colorpicker/models/colorpicker-view.js +6 -0
- package/dist/npm/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/npm/colorpicker/models.js +1 -2
- package/dist/npm/colorpicker/services/flatcolorpicker.service.js +43 -0
- package/dist/npm/colorpicker/utils/color-parser.js +18 -5
- package/dist/npm/colorpicker/utils/contrast-curve.js +93 -0
- package/dist/npm/colorpicker/utils.js +1 -1
- package/dist/npm/colorpicker.module.js +9 -1
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/common/models.js +6 -0
- package/dist/npm/common/utils.js +37 -0
- package/dist/npm/index.js +10 -0
- package/dist/npm/main.js +7 -4
- package/dist/npm/maskedtextbox/maskedtextbox.component.js +100 -5
- package/dist/npm/numerictextbox/numerictextbox.component.js +115 -19
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/radiobutton.directive.js +51 -2
- package/dist/npm/shared/textarea.directive.js +3 -2
- package/dist/npm/shared/utils.js +25 -0
- package/dist/npm/switch/switch.component.js +166 -20
- package/dist/npm/text-fields-common/text-fields-base.js +1 -1
- package/dist/npm/textarea/textarea.component.js +100 -4
- package/dist/npm/textbox/textbox.component.js +113 -14
- package/dist/npm/textbox/textbox.directive.js +3 -2
- package/dist/npm/textbox.module.js +0 -3
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +15 -12
- package/dist/es/colorpicker/models/preventable-event.js +0 -29
- package/dist/es/textbox/floating-label-input-adapter.js +0 -58
- package/dist/es/textbox/textbox-container.component.js +0 -224
- package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
- package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
- package/dist/es2015/textbox/floating-label-input-adapter.d.ts +0 -20
- package/dist/es2015/textbox/floating-label-input-adapter.js +0 -52
- package/dist/es2015/textbox/textbox-container.component.d.ts +0 -59
- package/dist/es2015/textbox/textbox-container.component.js +0 -209
- package/dist/npm/colorpicker/models/preventable-event.js +0 -31
- package/dist/npm/textbox/floating-label-input-adapter.js +0 -60
- package/dist/npm/textbox/textbox-container.component.js +0 -226
|
@@ -11,7 +11,7 @@ import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
|
11
11
|
import { KendoInput, guid, isDocumentAvailable, hasObservers, Keys } from '@progress/kendo-angular-common';
|
|
12
12
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
13
13
|
import { TextFieldsBase } from '../text-fields-common/text-fields-base';
|
|
14
|
-
import { areSame, isPresent } from '../common/utils';
|
|
14
|
+
import { areSame, isPresent, getStylingClasses } from '../common/utils';
|
|
15
15
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
16
16
|
import { closest } from './../common/dom-utils';
|
|
17
17
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
@@ -23,7 +23,7 @@ const resizeClasses = {
|
|
|
23
23
|
'none': 'k-resize-none',
|
|
24
24
|
'auto': 'k-resize-none'
|
|
25
25
|
};
|
|
26
|
-
const FOCUSED = 'k-
|
|
26
|
+
const FOCUSED = 'k-focus';
|
|
27
27
|
/**
|
|
28
28
|
* Represents the [Kendo UI TextArea component for Angular]({% slug overview_textarea %}).
|
|
29
29
|
*/
|
|
@@ -40,7 +40,7 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
|
|
|
40
40
|
* @hidden
|
|
41
41
|
*/
|
|
42
42
|
this.focusableId = `k-${guid()}`;
|
|
43
|
-
this.
|
|
43
|
+
this.hostClasses = true;
|
|
44
44
|
/**
|
|
45
45
|
* Specifies the flow direction of the TextArea sections. This property is useful when adornments are used, in order to specify
|
|
46
46
|
* their position in relation to the textarea element.
|
|
@@ -114,6 +114,9 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
|
|
|
114
114
|
* When the component value is changed programmatically or via its form control binding, the valueChange event is not emitted.
|
|
115
115
|
*/
|
|
116
116
|
this.valueChange = new EventEmitter();
|
|
117
|
+
this._size = 'medium';
|
|
118
|
+
this._rounded = 'medium';
|
|
119
|
+
this._fillMode = 'solid';
|
|
117
120
|
/**
|
|
118
121
|
* @hidden
|
|
119
122
|
*/
|
|
@@ -169,6 +172,57 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
|
|
|
169
172
|
get tabIndex() {
|
|
170
173
|
return this.tabindex;
|
|
171
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* The size property specifies the font size and line height of the TextArea
|
|
177
|
+
* ([see example]({% slug appearance_textarea %}#toc-size)).
|
|
178
|
+
*
|
|
179
|
+
* The possible values are:
|
|
180
|
+
* * `'small'`
|
|
181
|
+
* * `'medium'` (default)
|
|
182
|
+
* * `'large'`
|
|
183
|
+
* * `null`
|
|
184
|
+
*/
|
|
185
|
+
set size(size) {
|
|
186
|
+
this.handleClasses(size, 'size');
|
|
187
|
+
this._size = size;
|
|
188
|
+
}
|
|
189
|
+
get size() {
|
|
190
|
+
return this._size;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The rounded property specifies the border radius of the TextArea
|
|
194
|
+
* ([see example]({% slug appearance_textarea %}#toc-rounded)).
|
|
195
|
+
*
|
|
196
|
+
* The possible values are:
|
|
197
|
+
* * `'small'`
|
|
198
|
+
* * `'medium'` (default)
|
|
199
|
+
* * `'large'`
|
|
200
|
+
* * `null`
|
|
201
|
+
*/
|
|
202
|
+
set rounded(rounded) {
|
|
203
|
+
this.handleClasses(rounded, 'rounded');
|
|
204
|
+
this._rounded = rounded;
|
|
205
|
+
}
|
|
206
|
+
get rounded() {
|
|
207
|
+
return this._rounded;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The fillMode property specifies the background and border styles of the TextArea
|
|
211
|
+
* ([see example]({% slug appearance_textarea %}#toc-fillMode)).
|
|
212
|
+
*
|
|
213
|
+
* The possible values are:
|
|
214
|
+
* * `'flat'`
|
|
215
|
+
* * `'solid'` (default)
|
|
216
|
+
* * `'outline'`
|
|
217
|
+
* * `null`
|
|
218
|
+
*/
|
|
219
|
+
set fillMode(fillMode) {
|
|
220
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
221
|
+
this._fillMode = fillMode;
|
|
222
|
+
}
|
|
223
|
+
get fillMode() {
|
|
224
|
+
return this._fillMode;
|
|
225
|
+
}
|
|
172
226
|
ngAfterViewInit() {
|
|
173
227
|
const hostElement = this.hostElement.nativeElement;
|
|
174
228
|
let cursorInsideWrapper = false;
|
|
@@ -215,6 +269,10 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
|
|
|
215
269
|
}
|
|
216
270
|
}));
|
|
217
271
|
});
|
|
272
|
+
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
273
|
+
stylingInputs.forEach(input => {
|
|
274
|
+
this.handleClasses(this[input], input);
|
|
275
|
+
});
|
|
218
276
|
}
|
|
219
277
|
ngOnInit() {
|
|
220
278
|
this.control = this.injector.get(NgControl, null);
|
|
@@ -376,6 +434,16 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
|
|
|
376
434
|
this.setSelection(0, this.value.length);
|
|
377
435
|
}
|
|
378
436
|
}
|
|
437
|
+
handleClasses(value, input) {
|
|
438
|
+
const elem = this.hostElement.nativeElement;
|
|
439
|
+
const classes = getStylingClasses('input', input, this[input], value);
|
|
440
|
+
if (classes.toRemove) {
|
|
441
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
442
|
+
}
|
|
443
|
+
if (classes.toAdd) {
|
|
444
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
379
447
|
};
|
|
380
448
|
tslib_1.__decorate([
|
|
381
449
|
Input(),
|
|
@@ -383,8 +451,9 @@ tslib_1.__decorate([
|
|
|
383
451
|
], TextAreaComponent.prototype, "focusableId", void 0);
|
|
384
452
|
tslib_1.__decorate([
|
|
385
453
|
HostBinding('class.k-textarea'),
|
|
454
|
+
HostBinding('class.k-input'),
|
|
386
455
|
tslib_1.__metadata("design:type", Boolean)
|
|
387
|
-
], TextAreaComponent.prototype, "
|
|
456
|
+
], TextAreaComponent.prototype, "hostClasses", void 0);
|
|
388
457
|
tslib_1.__decorate([
|
|
389
458
|
HostBinding('class.k-flex-col'),
|
|
390
459
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -424,6 +493,21 @@ tslib_1.__decorate([
|
|
|
424
493
|
Input(),
|
|
425
494
|
tslib_1.__metadata("design:type", String)
|
|
426
495
|
], TextAreaComponent.prototype, "resizable", void 0);
|
|
496
|
+
tslib_1.__decorate([
|
|
497
|
+
Input(),
|
|
498
|
+
tslib_1.__metadata("design:type", String),
|
|
499
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
500
|
+
], TextAreaComponent.prototype, "size", null);
|
|
501
|
+
tslib_1.__decorate([
|
|
502
|
+
Input(),
|
|
503
|
+
tslib_1.__metadata("design:type", String),
|
|
504
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
505
|
+
], TextAreaComponent.prototype, "rounded", null);
|
|
506
|
+
tslib_1.__decorate([
|
|
507
|
+
Input(),
|
|
508
|
+
tslib_1.__metadata("design:type", String),
|
|
509
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
510
|
+
], TextAreaComponent.prototype, "fillMode", null);
|
|
427
511
|
tslib_1.__decorate([
|
|
428
512
|
Output('focus'),
|
|
429
513
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -456,7 +540,7 @@ TextAreaComponent = TextAreaComponent_1 = tslib_1.__decorate([
|
|
|
456
540
|
[attr.aria-multiline]="true"
|
|
457
541
|
[attr.aria-disabled]="disabled ? true : undefined"
|
|
458
542
|
[attr.aria-readonly]="readonly ? true : undefined"
|
|
459
|
-
class="k-input"
|
|
543
|
+
class="k-input-inner"
|
|
460
544
|
[ngClass]="resizableClass"
|
|
461
545
|
[id]="focusableId"
|
|
462
546
|
[value]="value"
|
|
@@ -9,6 +9,7 @@ import { IconShowOptions } from './models/icon-show-options';
|
|
|
9
9
|
import { TextBoxSuffixTemplateDirective } from './textbox-suffix.directive';
|
|
10
10
|
import { TextBoxPrefixTemplateDirective } from './textbox-prefix.directive';
|
|
11
11
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import { InputSize, InputRounded, InputFillMode } from '../common/models';
|
|
12
13
|
export declare class TextBoxComponent implements ControlValueAccessor {
|
|
13
14
|
private localizationService;
|
|
14
15
|
private ngZone;
|
|
@@ -94,6 +95,40 @@ export declare class TextBoxComponent implements ControlValueAccessor {
|
|
|
94
95
|
* Sets a custom icon that will be rendered instead of the default one.
|
|
95
96
|
*/
|
|
96
97
|
clearButtonIcon: string;
|
|
98
|
+
/**
|
|
99
|
+
* The size property specifies the font size and line height of the TextBox
|
|
100
|
+
* ([see example]({% slug appearance_textbox %}#toc-size)).
|
|
101
|
+
*
|
|
102
|
+
* The possible values are:
|
|
103
|
+
* * `'small'`
|
|
104
|
+
* * `'medium'` (default)
|
|
105
|
+
* * `'large'`
|
|
106
|
+
* * `null`
|
|
107
|
+
*/
|
|
108
|
+
size: InputSize;
|
|
109
|
+
/**
|
|
110
|
+
* The rounded property specifies the border radius of the TextBox
|
|
111
|
+
* ([see example]({% slug appearance_textbox %}#toc-rounded)).
|
|
112
|
+
*
|
|
113
|
+
* The possible values are:
|
|
114
|
+
* * `'small'`
|
|
115
|
+
* * `'medium'` (default)
|
|
116
|
+
* * `'large'`
|
|
117
|
+
* * `'full'`
|
|
118
|
+
* * `null`
|
|
119
|
+
*/
|
|
120
|
+
rounded: InputRounded;
|
|
121
|
+
/**
|
|
122
|
+
* The fillMode property specifies the background and border styles of the TextBox
|
|
123
|
+
* ([see example]({% slug appearance_textbox %}#toc-fillMode)).
|
|
124
|
+
*
|
|
125
|
+
* The possible values are:
|
|
126
|
+
* * `'flat'`
|
|
127
|
+
* * `'solid'` (default)
|
|
128
|
+
* * `'outline'`
|
|
129
|
+
* * `null`
|
|
130
|
+
*/
|
|
131
|
+
fillMode: InputFillMode;
|
|
97
132
|
/**
|
|
98
133
|
* @hidden
|
|
99
134
|
*/
|
|
@@ -178,7 +213,7 @@ export declare class TextBoxComponent implements ControlValueAccessor {
|
|
|
178
213
|
*/
|
|
179
214
|
prefixTemplate: TextBoxPrefixTemplateDirective;
|
|
180
215
|
readonly disabledClass: boolean;
|
|
181
|
-
|
|
216
|
+
hostClasses: boolean;
|
|
182
217
|
direction: string;
|
|
183
218
|
/**
|
|
184
219
|
* @hidden
|
|
@@ -189,6 +224,9 @@ export declare class TextBoxComponent implements ControlValueAccessor {
|
|
|
189
224
|
private clearButtonClicked;
|
|
190
225
|
private _isFocused;
|
|
191
226
|
private focusChangedProgrammatically;
|
|
227
|
+
private _size;
|
|
228
|
+
private _rounded;
|
|
229
|
+
private _fillMode;
|
|
192
230
|
constructor(localizationService: LocalizationService, ngZone: NgZone, changeDetector: ChangeDetectorRef, renderer: Renderer2, injector: Injector, hostElement: ElementRef);
|
|
193
231
|
ngOnInit(): void;
|
|
194
232
|
ngAfterViewInit(): void;
|
|
@@ -293,4 +331,5 @@ export declare class TextBoxComponent implements ControlValueAccessor {
|
|
|
293
331
|
private updateValue;
|
|
294
332
|
private isFocused;
|
|
295
333
|
private handleBlur;
|
|
334
|
+
private handleClasses;
|
|
296
335
|
}
|
|
@@ -4,18 +4,20 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
var TextBoxComponent_1;
|
|
7
|
+
import { isJapanese } from './../shared/utils';
|
|
7
8
|
import { closest } from './../common/dom-utils';
|
|
8
9
|
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
9
10
|
import { Component, ElementRef, forwardRef, Input, Output, EventEmitter, HostBinding, ViewChild, NgZone, ChangeDetectorRef, Injector, ContentChild, Renderer2 } from '@angular/core';
|
|
10
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
12
|
import { packageMetadata } from '../package-metadata';
|
|
12
13
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
13
|
-
import { areSame, requiresZoneOnBlur } from '../common/utils';
|
|
14
|
+
import { areSame, requiresZoneOnBlur, getStylingClasses } from '../common/utils';
|
|
14
15
|
import { guid, hasObservers, KendoInput, Keys } from '@progress/kendo-angular-common';
|
|
15
16
|
import { TextBoxSuffixTemplateDirective } from './textbox-suffix.directive';
|
|
16
17
|
import { TextBoxPrefixTemplateDirective } from './textbox-prefix.directive';
|
|
17
18
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
18
|
-
|
|
19
|
+
import { isSafari } from '../shared/utils';
|
|
20
|
+
const FOCUSED = 'k-focus';
|
|
19
21
|
let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
20
22
|
constructor(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
|
|
21
23
|
this.localizationService = localizationService;
|
|
@@ -149,9 +151,12 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
149
151
|
* ```
|
|
150
152
|
*/
|
|
151
153
|
this.onBlur = new EventEmitter();
|
|
152
|
-
this.
|
|
154
|
+
this.hostClasses = true;
|
|
153
155
|
this._isFocused = false;
|
|
154
156
|
this.focusChangedProgrammatically = false;
|
|
157
|
+
this._size = 'medium';
|
|
158
|
+
this._rounded = 'medium';
|
|
159
|
+
this._fillMode = 'solid';
|
|
155
160
|
/**
|
|
156
161
|
* @hidden
|
|
157
162
|
*/
|
|
@@ -197,7 +202,7 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
197
202
|
* @hidden
|
|
198
203
|
*/
|
|
199
204
|
this.handleInput = (ev) => {
|
|
200
|
-
let incomingValue = ev.target.value;
|
|
205
|
+
let incomingValue = isSafari(navigator.userAgent) && isJapanese(ev.target.value) ? ev.data : ev.target.value;
|
|
201
206
|
this.updateValue(incomingValue);
|
|
202
207
|
};
|
|
203
208
|
this.ngChange = (_) => { };
|
|
@@ -205,6 +210,58 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
205
210
|
validatePackage(packageMetadata);
|
|
206
211
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
207
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* The size property specifies the font size and line height of the TextBox
|
|
215
|
+
* ([see example]({% slug appearance_textbox %}#toc-size)).
|
|
216
|
+
*
|
|
217
|
+
* The possible values are:
|
|
218
|
+
* * `'small'`
|
|
219
|
+
* * `'medium'` (default)
|
|
220
|
+
* * `'large'`
|
|
221
|
+
* * `null`
|
|
222
|
+
*/
|
|
223
|
+
set size(size) {
|
|
224
|
+
this.handleClasses(size, 'size');
|
|
225
|
+
this._size = size;
|
|
226
|
+
}
|
|
227
|
+
get size() {
|
|
228
|
+
return this._size;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The rounded property specifies the border radius of the TextBox
|
|
232
|
+
* ([see example]({% slug appearance_textbox %}#toc-rounded)).
|
|
233
|
+
*
|
|
234
|
+
* The possible values are:
|
|
235
|
+
* * `'small'`
|
|
236
|
+
* * `'medium'` (default)
|
|
237
|
+
* * `'large'`
|
|
238
|
+
* * `'full'`
|
|
239
|
+
* * `null`
|
|
240
|
+
*/
|
|
241
|
+
set rounded(rounded) {
|
|
242
|
+
this.handleClasses(rounded, 'rounded');
|
|
243
|
+
this._rounded = rounded;
|
|
244
|
+
}
|
|
245
|
+
get rounded() {
|
|
246
|
+
return this._rounded;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The fillMode property specifies the background and border styles of the TextBox
|
|
250
|
+
* ([see example]({% slug appearance_textbox %}#toc-fillMode)).
|
|
251
|
+
*
|
|
252
|
+
* The possible values are:
|
|
253
|
+
* * `'flat'`
|
|
254
|
+
* * `'solid'` (default)
|
|
255
|
+
* * `'outline'`
|
|
256
|
+
* * `null`
|
|
257
|
+
*/
|
|
258
|
+
set fillMode(fillMode) {
|
|
259
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
260
|
+
this._fillMode = fillMode;
|
|
261
|
+
}
|
|
262
|
+
get fillMode() {
|
|
263
|
+
return this._fillMode;
|
|
264
|
+
}
|
|
208
265
|
/**
|
|
209
266
|
* @hidden
|
|
210
267
|
*/
|
|
@@ -270,6 +327,10 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
270
327
|
}
|
|
271
328
|
}));
|
|
272
329
|
});
|
|
330
|
+
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
331
|
+
stylingInputs.forEach(input => {
|
|
332
|
+
this.handleClasses(this[input], input);
|
|
333
|
+
});
|
|
273
334
|
}
|
|
274
335
|
ngOnChanges(changes) {
|
|
275
336
|
if (changes.disabled || changes.readonly || changes.value) {
|
|
@@ -402,16 +463,16 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
402
463
|
*/
|
|
403
464
|
get successIconClasses() {
|
|
404
465
|
return this.successIcon
|
|
405
|
-
?
|
|
406
|
-
: `k-
|
|
466
|
+
? `${this.successIcon}`
|
|
467
|
+
: `k-validation-icon k-icon k-i-check`;
|
|
407
468
|
}
|
|
408
469
|
/**
|
|
409
470
|
* @hidden
|
|
410
471
|
*/
|
|
411
472
|
get errorIconClasses() {
|
|
412
473
|
return this.errorIcon
|
|
413
|
-
?
|
|
414
|
-
: `k-
|
|
474
|
+
? `${this.errorIcon}`
|
|
475
|
+
: `k-validation-icon k-icon k-i-warning`;
|
|
415
476
|
}
|
|
416
477
|
/**
|
|
417
478
|
* @hidden
|
|
@@ -419,7 +480,7 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
419
480
|
get clearButtonClasses() {
|
|
420
481
|
return this.clearButtonIcon
|
|
421
482
|
? this.clearButtonIcon
|
|
422
|
-
: `k-icon k-i-
|
|
483
|
+
: `k-icon k-i-x`;
|
|
423
484
|
}
|
|
424
485
|
/**
|
|
425
486
|
* @hidden
|
|
@@ -481,6 +542,16 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
|
|
|
481
542
|
this.isFocused = false;
|
|
482
543
|
});
|
|
483
544
|
}
|
|
545
|
+
handleClasses(value, input) {
|
|
546
|
+
const elem = this.hostElement.nativeElement;
|
|
547
|
+
const classes = getStylingClasses('input', input, this[input], value);
|
|
548
|
+
if (classes.toRemove) {
|
|
549
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
550
|
+
}
|
|
551
|
+
if (classes.toAdd) {
|
|
552
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
484
555
|
};
|
|
485
556
|
tslib_1.__decorate([
|
|
486
557
|
Input(),
|
|
@@ -534,6 +605,21 @@ tslib_1.__decorate([
|
|
|
534
605
|
Input(),
|
|
535
606
|
tslib_1.__metadata("design:type", String)
|
|
536
607
|
], TextBoxComponent.prototype, "clearButtonIcon", void 0);
|
|
608
|
+
tslib_1.__decorate([
|
|
609
|
+
Input(),
|
|
610
|
+
tslib_1.__metadata("design:type", String),
|
|
611
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
612
|
+
], TextBoxComponent.prototype, "size", null);
|
|
613
|
+
tslib_1.__decorate([
|
|
614
|
+
Input(),
|
|
615
|
+
tslib_1.__metadata("design:type", String),
|
|
616
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
617
|
+
], TextBoxComponent.prototype, "rounded", null);
|
|
618
|
+
tslib_1.__decorate([
|
|
619
|
+
Input(),
|
|
620
|
+
tslib_1.__metadata("design:type", String),
|
|
621
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
622
|
+
], TextBoxComponent.prototype, "fillMode", null);
|
|
537
623
|
tslib_1.__decorate([
|
|
538
624
|
Input(),
|
|
539
625
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -580,14 +666,15 @@ tslib_1.__decorate([
|
|
|
580
666
|
tslib_1.__metadata("design:type", TextBoxPrefixTemplateDirective)
|
|
581
667
|
], TextBoxComponent.prototype, "prefixTemplate", void 0);
|
|
582
668
|
tslib_1.__decorate([
|
|
583
|
-
HostBinding('class.k-
|
|
669
|
+
HostBinding('class.k-disabled'),
|
|
584
670
|
tslib_1.__metadata("design:type", Boolean),
|
|
585
671
|
tslib_1.__metadata("design:paramtypes", [])
|
|
586
672
|
], TextBoxComponent.prototype, "disabledClass", null);
|
|
587
673
|
tslib_1.__decorate([
|
|
588
674
|
HostBinding('class.k-textbox'),
|
|
675
|
+
HostBinding('class.k-input'),
|
|
589
676
|
tslib_1.__metadata("design:type", Boolean)
|
|
590
|
-
], TextBoxComponent.prototype, "
|
|
677
|
+
], TextBoxComponent.prototype, "hostClasses", void 0);
|
|
591
678
|
tslib_1.__decorate([
|
|
592
679
|
HostBinding('attr.dir'),
|
|
593
680
|
tslib_1.__metadata("design:type", String)
|
|
@@ -618,7 +705,7 @@ TextBoxComponent = TextBoxComponent_1 = tslib_1.__decorate([
|
|
|
618
705
|
</ng-template>
|
|
619
706
|
</span>
|
|
620
707
|
<input
|
|
621
|
-
class="k-input"
|
|
708
|
+
class="k-input-inner"
|
|
622
709
|
#input
|
|
623
710
|
[id]="focusableId"
|
|
624
711
|
[disabled]="disabled"
|
|
@@ -22,7 +22,7 @@ let TextBoxDirective = TextBoxDirective_1 = class TextBoxDirective {
|
|
|
22
22
|
this.renderer = renderer;
|
|
23
23
|
this.inputElement = inputElement;
|
|
24
24
|
this.ngZone = ngZone;
|
|
25
|
-
this.
|
|
25
|
+
this.hostClasses = true;
|
|
26
26
|
/**
|
|
27
27
|
* @hidden
|
|
28
28
|
*/
|
|
@@ -90,8 +90,9 @@ let TextBoxDirective = TextBoxDirective_1 = class TextBoxDirective {
|
|
|
90
90
|
};
|
|
91
91
|
tslib_1.__decorate([
|
|
92
92
|
HostBinding('class.k-textbox'),
|
|
93
|
+
HostBinding('class.k-input'),
|
|
93
94
|
tslib_1.__metadata("design:type", Boolean)
|
|
94
|
-
], TextBoxDirective.prototype, "
|
|
95
|
+
], TextBoxDirective.prototype, "hostClasses", void 0);
|
|
95
96
|
tslib_1.__decorate([
|
|
96
97
|
Input(),
|
|
97
98
|
tslib_1.__metadata("design:type", String),
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { NgModule } from "@angular/core";
|
|
7
7
|
import { TextBoxDirective } from "./textbox/textbox.directive";
|
|
8
|
-
import { TextBoxContainerComponent } from "./textbox/textbox-container.component";
|
|
9
8
|
import { TextBoxComponent } from "./textbox/textbox.component";
|
|
10
9
|
import { CommonModule } from "@angular/common";
|
|
11
10
|
import { EventsModule } from "@progress/kendo-angular-common";
|
|
@@ -51,7 +50,6 @@ TextBoxModule = tslib_1.__decorate([
|
|
|
51
50
|
NgModule({
|
|
52
51
|
declarations: [
|
|
53
52
|
TextBoxDirective,
|
|
54
|
-
TextBoxContainerComponent,
|
|
55
53
|
TextBoxComponent,
|
|
56
54
|
TextBoxSuffixTemplateDirective,
|
|
57
55
|
TextBoxPrefixTemplateDirective,
|
|
@@ -60,7 +58,6 @@ TextBoxModule = tslib_1.__decorate([
|
|
|
60
58
|
],
|
|
61
59
|
exports: [
|
|
62
60
|
TextBoxDirective,
|
|
63
|
-
TextBoxContainerComponent,
|
|
64
61
|
TextBoxComponent,
|
|
65
62
|
TextBoxSuffixTemplateDirective,
|
|
66
63
|
TextBoxPrefixTemplateDirective,
|