@progress/kendo-angular-inputs 8.0.0-dev.202112211528 → 8.0.0-dev.202201181548
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-inputs.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/colorpicker/color-gradient.component.js +3 -0
- package/dist/es/colorpicker/color-input.component.js +1 -1
- package/dist/es/colorpicker/color-palette.component.js +6 -3
- package/dist/es/colorpicker/colorpicker.component.js +206 -48
- package/dist/es/colorpicker/flatcolorpicker.component.js +7 -4
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/radiobutton.directive.js +3 -0
- package/dist/es/rangeslider/rangeslider-model.js +4 -7
- package/dist/es/rangeslider/rangeslider.component.js +1 -1
- package/dist/es/slider/slider-model.js +3 -5
- package/dist/es/slider/slider.component.js +2 -2
- package/dist/es/sliders-common/slider-model.base.js +7 -10
- package/dist/es/sliders-common/slider-ticks.component.js +3 -10
- package/dist/es/sliders-common/sliders-util.js +2 -3
- package/dist/es/textbox/textbox.component.js +1 -1
- package/dist/es2015/colorpicker/color-gradient.component.js +3 -0
- package/dist/es2015/colorpicker/color-input.component.js +1 -1
- package/dist/es2015/colorpicker/color-palette.component.d.ts +1 -1
- package/dist/es2015/colorpicker/color-palette.component.js +6 -3
- package/dist/es2015/colorpicker/colorpicker.component.d.ts +22 -6
- package/dist/es2015/colorpicker/colorpicker.component.js +181 -69
- package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +2 -2
- package/dist/es2015/colorpicker/flatcolorpicker.component.js +7 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/radiobutton/radiobutton.directive.js +3 -0
- package/dist/es2015/rangeslider/rangeslider-model.js +4 -7
- package/dist/es2015/rangeslider/rangeslider.component.js +55 -54
- package/dist/es2015/slider/slider-model.d.ts +1 -1
- package/dist/es2015/slider/slider-model.js +3 -5
- package/dist/es2015/slider/slider.component.js +56 -59
- package/dist/es2015/sliders-common/slider-model.base.js +7 -10
- package/dist/es2015/sliders-common/slider-ticks.component.d.ts +0 -2
- package/dist/es2015/sliders-common/slider-ticks.component.js +6 -10
- package/dist/es2015/sliders-common/sliders-util.d.ts +2 -2
- package/dist/es2015/sliders-common/sliders-util.js +2 -3
- package/dist/es2015/textbox/textbox.component.js +18 -19
- package/dist/fesm2015/index.js +368 -278
- package/dist/fesm5/index.js +268 -133
- package/dist/npm/colorpicker/color-gradient.component.js +3 -0
- package/dist/npm/colorpicker/color-input.component.js +1 -1
- package/dist/npm/colorpicker/color-palette.component.js +6 -3
- package/dist/npm/colorpicker/colorpicker.component.js +205 -47
- package/dist/npm/colorpicker/flatcolorpicker.component.js +7 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/radiobutton.directive.js +3 -0
- package/dist/npm/rangeslider/rangeslider-model.js +4 -7
- package/dist/npm/rangeslider/rangeslider.component.js +1 -1
- package/dist/npm/slider/slider-model.js +3 -5
- package/dist/npm/slider/slider.component.js +2 -2
- package/dist/npm/sliders-common/slider-model.base.js +6 -9
- package/dist/npm/sliders-common/slider-ticks.component.js +2 -9
- package/dist/npm/sliders-common/sliders-util.js +2 -3
- package/dist/npm/textbox/textbox.component.js +1 -1
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +5 -5
|
@@ -9,6 +9,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
|
|
|
9
9
|
import { throttleTime } from 'rxjs/operators';
|
|
10
10
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
11
11
|
import { isChanged, isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
|
|
12
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
13
|
import { containsFocus, isUntouched } from '../common/dom-utils';
|
|
13
14
|
import { parseColor, getHSV, getColorFromHSV, getColorFromHue } from './utils';
|
|
14
15
|
import { isPresent, fitIntoBounds } from '../common/utils';
|
|
@@ -16,6 +17,7 @@ import { SliderComponent } from '../slider/slider.component';
|
|
|
16
17
|
import { ColorGradientLocalizationService } from './localization/colorgradient-localization.service';
|
|
17
18
|
import { ColorInputComponent } from './color-input.component';
|
|
18
19
|
import { DEFAULT_GRADIENT_BACKGROUND_COLOR, DEFAULT_OUTPUT_FORMAT, DRAGHANDLE_MOVE_SPEED } from './constants';
|
|
20
|
+
import { packageMetadata } from '../package-metadata';
|
|
19
21
|
var serial = 0;
|
|
20
22
|
/**
|
|
21
23
|
* The ColorGradient component enables smooth color transitions and provides options for selecting specific colors over the drag handle.
|
|
@@ -95,6 +97,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
95
97
|
this.updateValues = new Subject();
|
|
96
98
|
this.notifyNgChanged = function () { };
|
|
97
99
|
this.notifyNgTouched = function () { };
|
|
100
|
+
validatePackage(packageMetadata);
|
|
98
101
|
this.dynamicRTLSubscription = localizationService.changes.subscribe(function (_a) {
|
|
99
102
|
var rtl = _a.rtl;
|
|
100
103
|
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
@@ -182,7 +182,7 @@ var ColorInputComponent = /** @class */ (function () {
|
|
|
182
182
|
ColorInputComponent = tslib_1.__decorate([
|
|
183
183
|
Component({
|
|
184
184
|
selector: 'kendo-colorinput',
|
|
185
|
-
template: "\n <div class=\"k-vstack\">\n <button #toggleFormatButton\n class=\"k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button\"\n [attr.aria-label]=\"formatButtonTitle\"\n [attr.title]=\"formatButtonTitle\"\n >\n <span class=\"k-button-icon k-icon k-i-arrows-kpi\"></span>\n </button>\n </div>\n <div *ngIf=\"formatView === 'hex'\" class=\"k-vstack\">\n <input\n #hexInput\n [id]=\"focusableId\"\n class=\"k-textbox k-hex-value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"hex || ''\"\n (blur)=\"handleHexInputBlur()\"\n (input)=\"handleHexValueChange(hexInput.value)\"\n />\n <label [for]=\"focusableId\" class=\"k-colorgradient-input-label\">HEX</label>\n </div>\n <ng-container *ngIf=\"formatView === 'rgba'\">\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #red\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.r\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"red.focusableId\" class=\"k-colorgradient-input-label\">R</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #green\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.g\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"green.focusableId\" class=\"k-colorgradient-input-label\">G</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #blue\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.b\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"blue.focusableId\" class=\"k-colorgradient-input-label\">B</label>\n </div>\n <div class=\"k-vstack\" *ngIf=\"opacity\">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"1\"\n [(value)]=\"rgba.a\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [step]=\"0.01\"\n [format]=\"'n2'\"\n [decimals]=\"2\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"alpha.focusableId\" class=\"k-colorgradient-input-label\">A</label>\n </div>\n </ng-container>\n "
|
|
185
|
+
template: "\n <div class=\"k-vstack\">\n <button #toggleFormatButton\n class=\"k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button\"\n [attr.aria-label]=\"formatButtonTitle\"\n [attr.title]=\"formatButtonTitle\"\n >\n <span class=\"k-button-icon k-icon k-i-arrows-kpi\"></span>\n </button>\n </div>\n <div *ngIf=\"formatView === 'hex'\" class=\"k-vstack\">\n <input\n #hexInput\n [id]=\"focusableId\"\n class=\"k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"hex || ''\"\n (blur)=\"handleHexInputBlur()\"\n (input)=\"handleHexValueChange(hexInput.value)\"\n />\n <label [for]=\"focusableId\" class=\"k-colorgradient-input-label\">HEX</label>\n </div>\n <ng-container *ngIf=\"formatView === 'rgba'\">\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #red\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.r\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"red.focusableId\" class=\"k-colorgradient-input-label\">R</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #green\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.g\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"green.focusableId\" class=\"k-colorgradient-input-label\">G</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #blue\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.b\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"blue.focusableId\" class=\"k-colorgradient-input-label\">B</label>\n </div>\n <div class=\"k-vstack\" *ngIf=\"opacity\">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"1\"\n [(value)]=\"rgba.a\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [step]=\"0.01\"\n [format]=\"'n2'\"\n [decimals]=\"2\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"alpha.focusableId\" class=\"k-colorgradient-input-label\">A</label>\n </div>\n </ng-container>\n "
|
|
186
186
|
}),
|
|
187
187
|
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
188
188
|
Renderer2,
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, Input, EventEmitter, Output, HostBinding, HostListener, forwardRef, ChangeDetectorRef, Renderer2, ElementRef } from '@angular/core';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
|
|
9
|
+
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
10
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
+
import { ColorPaletteLocalizationService } from './localization/colorpalette-localization.service';
|
|
12
|
+
import { packageMetadata } from '../package-metadata';
|
|
8
13
|
import { PALETTEPRESETS } from './models';
|
|
9
14
|
import { parseColor } from './utils';
|
|
10
15
|
import { isPresent } from '../common/utils';
|
|
11
16
|
import { ColorPaletteService } from './services/color-palette.service';
|
|
12
|
-
import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
|
|
13
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
14
|
-
import { ColorPaletteLocalizationService } from './localization/colorpalette-localization.service';
|
|
15
17
|
var DEFAULT_TILE_SIZE = 24;
|
|
16
18
|
var DEFAULT_COLUMNS_COUNT = 10;
|
|
17
19
|
var DEFAULT_PRESET = 'office';
|
|
@@ -85,6 +87,7 @@ var ColorPaletteComponent = /** @class */ (function () {
|
|
|
85
87
|
this._tabindex = 0;
|
|
86
88
|
this.notifyNgTouched = function () { };
|
|
87
89
|
this.notifyNgChanged = function () { };
|
|
90
|
+
validatePackage(packageMetadata);
|
|
88
91
|
this.dynamicRTLSubscription = localizationService.changes.subscribe(function (_a) {
|
|
89
92
|
var rtl = _a.rtl;
|
|
90
93
|
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
+
import { take } from 'rxjs/operators';
|
|
6
7
|
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
|
|
7
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { Subscription } from 'rxjs';
|
|
8
10
|
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
9
11
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
10
12
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
-
import { Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
13
|
+
import { Keys, KendoInput, isChanged, closest, guid } from '@progress/kendo-angular-common';
|
|
12
14
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
13
15
|
import { packageMetadata } from '../package-metadata';
|
|
14
16
|
import { PALETTEPRESETS } from './models';
|
|
@@ -17,7 +19,7 @@ import { parseColor } from './utils';
|
|
|
17
19
|
import { getStylingClasses, isPresent } from '../common/utils';
|
|
18
20
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
19
21
|
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
20
|
-
var
|
|
22
|
+
var DOM_FOCUS_EVENTS = ['focus', 'blur'];
|
|
21
23
|
/**
|
|
22
24
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
23
25
|
*
|
|
@@ -34,10 +36,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
34
36
|
this.ngZone = ngZone;
|
|
35
37
|
this.renderer = renderer;
|
|
36
38
|
this.hostClasses = true;
|
|
37
|
-
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
this.focusableId = "k-colorpicker-" + serial++;
|
|
39
|
+
this.role = 'listbox';
|
|
41
40
|
/**
|
|
42
41
|
* Specifies the views that will be rendered in the popup.
|
|
43
42
|
* By default both the gradient and palette views will be rendered.
|
|
@@ -133,6 +132,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
133
132
|
* Used to provide a two-way binding for the `activeView` property.
|
|
134
133
|
*/
|
|
135
134
|
this.activeViewChange = new EventEmitter();
|
|
135
|
+
/**
|
|
136
|
+
* Indicates whether the ColorPicker wrapper is focused.
|
|
137
|
+
*/
|
|
138
|
+
this.isFocused = false;
|
|
136
139
|
this._tabindex = 0;
|
|
137
140
|
this._popupSettings = { animate: true };
|
|
138
141
|
this._paletteSettings = {};
|
|
@@ -140,8 +143,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
140
143
|
this._size = 'medium';
|
|
141
144
|
this._rounded = 'medium';
|
|
142
145
|
this._fillMode = 'solid';
|
|
146
|
+
this.subscriptions = new Subscription();
|
|
143
147
|
this.notifyNgTouched = function () { };
|
|
144
148
|
this.notifyNgChanged = function () { };
|
|
149
|
+
this.domFocusListener = function (event) { return event.stopImmediatePropagation(); };
|
|
145
150
|
validatePackage(packageMetadata);
|
|
146
151
|
this.dynamicRTLSubscription = this.localizationService.changes.subscribe(function (_a) {
|
|
147
152
|
var rtl = _a.rtl;
|
|
@@ -149,6 +154,54 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
149
154
|
});
|
|
150
155
|
}
|
|
151
156
|
ColorPickerComponent_1 = ColorPickerComponent;
|
|
157
|
+
Object.defineProperty(ColorPickerComponent.prototype, "focusedClass", {
|
|
158
|
+
get: function () {
|
|
159
|
+
return this.isFocused;
|
|
160
|
+
},
|
|
161
|
+
enumerable: true,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(ColorPickerComponent.prototype, "disabledClass", {
|
|
165
|
+
get: function () {
|
|
166
|
+
return this.disabled;
|
|
167
|
+
},
|
|
168
|
+
enumerable: true,
|
|
169
|
+
configurable: true
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(ColorPickerComponent.prototype, "ariaReadonly", {
|
|
172
|
+
get: function () {
|
|
173
|
+
return this.readonly;
|
|
174
|
+
},
|
|
175
|
+
enumerable: true,
|
|
176
|
+
configurable: true
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(ColorPickerComponent.prototype, "ariaExpanded", {
|
|
179
|
+
get: function () {
|
|
180
|
+
return this.isOpen;
|
|
181
|
+
},
|
|
182
|
+
enumerable: true,
|
|
183
|
+
configurable: true
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(ColorPickerComponent.prototype, "hostTabindex", {
|
|
186
|
+
get: function () {
|
|
187
|
+
return this.tabindex;
|
|
188
|
+
},
|
|
189
|
+
enumerable: true,
|
|
190
|
+
configurable: true
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(ColorPickerComponent.prototype, "view", {
|
|
193
|
+
get: function () {
|
|
194
|
+
return (this.views && this.views.length > 0) ? this.views[0] : null;
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* @hidden
|
|
198
|
+
*/
|
|
199
|
+
set: function (view) {
|
|
200
|
+
this.views = [view];
|
|
201
|
+
},
|
|
202
|
+
enumerable: true,
|
|
203
|
+
configurable: true
|
|
204
|
+
});
|
|
152
205
|
Object.defineProperty(ColorPickerComponent.prototype, "value", {
|
|
153
206
|
get: function () {
|
|
154
207
|
return this._value;
|
|
@@ -325,6 +378,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
325
378
|
stylingInputs.forEach(function (input) {
|
|
326
379
|
_this.handleClasses(_this[input], input);
|
|
327
380
|
});
|
|
381
|
+
this.setHostElementAriaLabel();
|
|
382
|
+
this.handleHostId();
|
|
383
|
+
this.initDomEvents();
|
|
328
384
|
};
|
|
329
385
|
ColorPickerComponent.prototype.ngOnChanges = function (changes) {
|
|
330
386
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
@@ -334,23 +390,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
334
390
|
this.format = 'rgba';
|
|
335
391
|
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
336
392
|
}
|
|
393
|
+
if (isChanged('value', changes)) {
|
|
394
|
+
this.setHostElementAriaLabel();
|
|
395
|
+
}
|
|
337
396
|
};
|
|
338
397
|
ColorPickerComponent.prototype.ngOnDestroy = function () {
|
|
339
398
|
this.closePopup();
|
|
340
399
|
if (this.dynamicRTLSubscription) {
|
|
341
400
|
this.dynamicRTLSubscription.unsubscribe();
|
|
342
401
|
}
|
|
402
|
+
this.subscriptions.unsubscribe();
|
|
403
|
+
this.handleDomEvents('remove', DOM_FOCUS_EVENTS);
|
|
343
404
|
};
|
|
344
|
-
Object.defineProperty(ColorPickerComponent.prototype, "colorPickerAriaLabel", {
|
|
345
|
-
/**
|
|
346
|
-
* @hidden
|
|
347
|
-
*/
|
|
348
|
-
get: function () {
|
|
349
|
-
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
350
|
-
},
|
|
351
|
-
enumerable: true,
|
|
352
|
-
configurable: true
|
|
353
|
-
});
|
|
354
405
|
/**
|
|
355
406
|
* @hidden
|
|
356
407
|
*/
|
|
@@ -361,55 +412,74 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
361
412
|
* @hidden
|
|
362
413
|
*/
|
|
363
414
|
ColorPickerComponent.prototype.togglePopup = function () {
|
|
364
|
-
this.toggleWithEvents(!this.isOpen);
|
|
365
415
|
this.focus();
|
|
416
|
+
this.toggleWithEvents(!this.isOpen);
|
|
366
417
|
};
|
|
367
418
|
/**
|
|
368
419
|
* @hidden
|
|
369
420
|
*/
|
|
370
|
-
ColorPickerComponent.prototype.
|
|
421
|
+
ColorPickerComponent.prototype.handleWrapperClick = function (event) {
|
|
422
|
+
var _this = this;
|
|
423
|
+
if (this.disabled) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
371
426
|
this.focus();
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
427
|
+
if (closest(event.target, function (element) { return element === _this.activeColor.nativeElement; })) {
|
|
428
|
+
var event_1 = new ActiveColorClickEvent(this.value);
|
|
429
|
+
this.activeColorClick.emit(event_1);
|
|
430
|
+
if (!event_1.isOpenPrevented() || this.isOpen) {
|
|
431
|
+
this.toggleWithEvents(!this.isOpen);
|
|
432
|
+
}
|
|
433
|
+
return;
|
|
376
434
|
}
|
|
435
|
+
this.toggleWithEvents(!this.isOpen);
|
|
377
436
|
};
|
|
378
437
|
/**
|
|
379
438
|
* Focuses the wrapper of the ColorPicker.
|
|
380
439
|
*/
|
|
381
440
|
ColorPickerComponent.prototype.focus = function () {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
this.wrapper.nativeElement.focus();
|
|
441
|
+
this.isFocused = true;
|
|
442
|
+
this.host.nativeElement.focus();
|
|
386
443
|
};
|
|
387
444
|
/**
|
|
388
445
|
* @hidden
|
|
389
446
|
*/
|
|
390
447
|
ColorPickerComponent.prototype.handleWrapperFocus = function () {
|
|
448
|
+
var _this = this;
|
|
391
449
|
if (this.isFocused) {
|
|
392
450
|
return;
|
|
393
451
|
}
|
|
394
|
-
this.
|
|
395
|
-
|
|
452
|
+
this.ngZone.run(function () {
|
|
453
|
+
_this.focus();
|
|
454
|
+
_this.onFocus.emit();
|
|
455
|
+
});
|
|
396
456
|
};
|
|
397
457
|
/**
|
|
398
458
|
* Blurs the ColorPicker.
|
|
399
459
|
*/
|
|
400
460
|
ColorPickerComponent.prototype.blur = function () {
|
|
401
|
-
this.
|
|
461
|
+
this.isFocused = false;
|
|
462
|
+
this.host.nativeElement.blur();
|
|
463
|
+
this.notifyNgTouched();
|
|
402
464
|
};
|
|
403
465
|
/**
|
|
404
466
|
* @hidden
|
|
405
467
|
*/
|
|
406
468
|
ColorPickerComponent.prototype.handleWrapperBlur = function () {
|
|
469
|
+
var _this = this;
|
|
407
470
|
if (this.isOpen) {
|
|
408
471
|
return;
|
|
409
472
|
}
|
|
410
|
-
this.
|
|
411
|
-
|
|
412
|
-
|
|
473
|
+
this.ngZone.run(function () {
|
|
474
|
+
_this.onBlur.emit();
|
|
475
|
+
_this.isFocused = false;
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* @hidden
|
|
480
|
+
*/
|
|
481
|
+
ColorPickerComponent.prototype.arrowButtonMouseDown = function (ev) {
|
|
482
|
+
ev.preventDefault();
|
|
413
483
|
};
|
|
414
484
|
/**
|
|
415
485
|
* Clears the value of the ColorPicker.
|
|
@@ -419,6 +489,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
419
489
|
return;
|
|
420
490
|
}
|
|
421
491
|
this._value = undefined;
|
|
492
|
+
this.setHostElementAriaLabel();
|
|
422
493
|
this.notifyNgChanged(undefined);
|
|
423
494
|
};
|
|
424
495
|
/**
|
|
@@ -446,6 +517,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
446
517
|
if (valueChange) {
|
|
447
518
|
this.value = parsedColor;
|
|
448
519
|
this.valueChange.emit(parsedColor);
|
|
520
|
+
this.setHostElementAriaLabel();
|
|
449
521
|
this.notifyNgChanged(parsedColor);
|
|
450
522
|
}
|
|
451
523
|
};
|
|
@@ -490,9 +562,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
490
562
|
* @hidden
|
|
491
563
|
*/
|
|
492
564
|
ColorPickerComponent.prototype.handleWrapperKeyDown = function (event) {
|
|
565
|
+
var _this = this;
|
|
493
566
|
if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
|
|
494
567
|
event.preventDefault();
|
|
495
|
-
this.
|
|
568
|
+
this.ngZone.run(function () {
|
|
569
|
+
_this.toggleWithEvents(true);
|
|
570
|
+
});
|
|
496
571
|
}
|
|
497
572
|
};
|
|
498
573
|
/**
|
|
@@ -501,14 +576,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
501
576
|
ColorPickerComponent.prototype.handlePopupKeyDown = function (event) {
|
|
502
577
|
if (event.keyCode === Keys.Escape) {
|
|
503
578
|
this.toggleWithEvents(false);
|
|
504
|
-
this.
|
|
579
|
+
this.host.nativeElement.focus();
|
|
505
580
|
}
|
|
506
581
|
if (event.keyCode === Keys.Tab) {
|
|
507
582
|
var currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
508
583
|
var nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
509
584
|
if (event.target === currentElement) {
|
|
510
585
|
event.preventDefault();
|
|
511
|
-
nextElement.
|
|
586
|
+
nextElement.focus();
|
|
512
587
|
}
|
|
513
588
|
}
|
|
514
589
|
};
|
|
@@ -519,6 +594,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
519
594
|
ColorPickerComponent.prototype.isEmpty = function () {
|
|
520
595
|
return false;
|
|
521
596
|
};
|
|
597
|
+
ColorPickerComponent.prototype.setHostElementAriaLabel = function () {
|
|
598
|
+
var ariaLabelValue = "" + (this.value ? this.value : this.localizationService.get('colorPickerNoColor'));
|
|
599
|
+
this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
|
|
600
|
+
};
|
|
522
601
|
ColorPickerComponent.prototype.handleClasses = function (value, input) {
|
|
523
602
|
var elem = this.host.nativeElement;
|
|
524
603
|
var classes = getStylingClasses('picker', input, this[input], value);
|
|
@@ -530,9 +609,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
530
609
|
}
|
|
531
610
|
};
|
|
532
611
|
ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
|
|
533
|
-
var
|
|
534
|
-
var
|
|
535
|
-
|
|
612
|
+
var _this = this;
|
|
613
|
+
var focusInFlatColorPickerElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
614
|
+
var hostClicked = closest(ev.relatedTarget, function (element) { return element === _this.host.nativeElement; });
|
|
615
|
+
return hostClicked || focusInFlatColorPickerElement;
|
|
536
616
|
};
|
|
537
617
|
ColorPickerComponent.prototype.toggleWithEvents = function (open) {
|
|
538
618
|
var sameState = this.isOpen === open;
|
|
@@ -557,12 +637,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
557
637
|
};
|
|
558
638
|
ColorPickerComponent.prototype.focusFirstElement = function () {
|
|
559
639
|
var _this = this;
|
|
560
|
-
this.ngZone.
|
|
561
|
-
|
|
640
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(function () {
|
|
641
|
+
if (_this.flatColorPicker) {
|
|
562
642
|
var elementToFocus = _this.flatColorPicker.gradient ? _this.flatColorPicker.gradient.gradientDragHandle :
|
|
563
643
|
_this.flatColorPicker.palette.host;
|
|
564
644
|
elementToFocus.nativeElement.focus();
|
|
565
|
-
}
|
|
645
|
+
}
|
|
566
646
|
});
|
|
567
647
|
};
|
|
568
648
|
ColorPickerComponent.prototype.openPopup = function () {
|
|
@@ -571,7 +651,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
571
651
|
var anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
|
|
572
652
|
var popupPosition = { horizontal: horizontalAlign, vertical: "top" };
|
|
573
653
|
this.popupRef = this.popupService.open({
|
|
574
|
-
anchor: this.
|
|
654
|
+
anchor: this.activeColor,
|
|
575
655
|
animate: this.popupSettings.animate,
|
|
576
656
|
appendTo: this.popupSettings.appendTo,
|
|
577
657
|
popupAlign: popupPosition,
|
|
@@ -583,7 +663,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
583
663
|
this.popupRef.popupAnchorViewportLeave.subscribe(function () {
|
|
584
664
|
_this.toggleWithEvents(false);
|
|
585
665
|
if (!_this.isOpen) {
|
|
586
|
-
_this.
|
|
666
|
+
_this.host.nativeElement.focus({
|
|
587
667
|
preventScroll: true
|
|
588
668
|
});
|
|
589
669
|
}
|
|
@@ -619,6 +699,53 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
619
699
|
enumerable: true,
|
|
620
700
|
configurable: true
|
|
621
701
|
});
|
|
702
|
+
ColorPickerComponent.prototype.handleDomEvents = function (action, events) {
|
|
703
|
+
var _this = this;
|
|
704
|
+
var hostElement = this.host.nativeElement;
|
|
705
|
+
events.forEach(function (ev) { return hostElement[action + "EventListener"](ev, _this.domFocusListener, true); });
|
|
706
|
+
};
|
|
707
|
+
ColorPickerComponent.prototype.initDomEvents = function () {
|
|
708
|
+
var _this = this;
|
|
709
|
+
if (!this.host) {
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
var hostElement = this.host.nativeElement;
|
|
713
|
+
this.ngZone.runOutsideAngular(function () {
|
|
714
|
+
_this.subscriptions.add(_this.renderer.listen(hostElement, 'focusin', function () {
|
|
715
|
+
_this.handleWrapperFocus();
|
|
716
|
+
}));
|
|
717
|
+
_this.subscriptions.add(_this.renderer.listen(hostElement, 'focusout', function (event) {
|
|
718
|
+
var closestPopup = _this.popupRef ?
|
|
719
|
+
closest(event.relatedTarget, function (element) { return element === _this.flatColorPicker.host.nativeElement; }) :
|
|
720
|
+
false;
|
|
721
|
+
var closestWrapper = closest(event.relatedTarget, function (element) { return element === _this.host.nativeElement; });
|
|
722
|
+
if (!closestPopup && !closestWrapper) {
|
|
723
|
+
_this.handleWrapperBlur();
|
|
724
|
+
}
|
|
725
|
+
}));
|
|
726
|
+
_this.handleDomEvents('add', DOM_FOCUS_EVENTS);
|
|
727
|
+
_this.subscriptions.add(_this.renderer.listen(hostElement, 'keydown', function (event) {
|
|
728
|
+
_this.handleWrapperKeyDown(event);
|
|
729
|
+
}));
|
|
730
|
+
_this.subscriptions.add(_this.renderer.listen(hostElement, 'click', function (event) {
|
|
731
|
+
_this.ngZone.run(function () {
|
|
732
|
+
_this.handleWrapperClick(event);
|
|
733
|
+
});
|
|
734
|
+
}));
|
|
735
|
+
});
|
|
736
|
+
};
|
|
737
|
+
ColorPickerComponent.prototype.handleHostId = function () {
|
|
738
|
+
var hostElement = this.host.nativeElement;
|
|
739
|
+
var existingId = hostElement.getAttribute('id');
|
|
740
|
+
if (existingId) {
|
|
741
|
+
this.focusableId = existingId;
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
var id = "k-" + guid();
|
|
745
|
+
hostElement.setAttribute('id', id);
|
|
746
|
+
this.focusableId = id;
|
|
747
|
+
}
|
|
748
|
+
};
|
|
622
749
|
var ColorPickerComponent_1;
|
|
623
750
|
tslib_1.__decorate([
|
|
624
751
|
HostBinding('class.k-colorpicker'),
|
|
@@ -626,18 +753,49 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
626
753
|
HostBinding('class.k-picker'),
|
|
627
754
|
tslib_1.__metadata("design:type", Boolean)
|
|
628
755
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
756
|
+
tslib_1.__decorate([
|
|
757
|
+
HostBinding('class.k-focus'),
|
|
758
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
759
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
760
|
+
], ColorPickerComponent.prototype, "focusedClass", null);
|
|
761
|
+
tslib_1.__decorate([
|
|
762
|
+
HostBinding('attr.aria-disabled'),
|
|
763
|
+
HostBinding('class.k-disabled'),
|
|
764
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
765
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
766
|
+
], ColorPickerComponent.prototype, "disabledClass", null);
|
|
767
|
+
tslib_1.__decorate([
|
|
768
|
+
HostBinding('attr.aria-readonly'),
|
|
769
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
770
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
771
|
+
], ColorPickerComponent.prototype, "ariaReadonly", null);
|
|
772
|
+
tslib_1.__decorate([
|
|
773
|
+
HostBinding('attr.aria-expanded'),
|
|
774
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
775
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
776
|
+
], ColorPickerComponent.prototype, "ariaExpanded", null);
|
|
777
|
+
tslib_1.__decorate([
|
|
778
|
+
HostBinding('attr.tabindex'),
|
|
779
|
+
tslib_1.__metadata("design:type", Number),
|
|
780
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
781
|
+
], ColorPickerComponent.prototype, "hostTabindex", null);
|
|
629
782
|
tslib_1.__decorate([
|
|
630
783
|
HostBinding('attr.dir'),
|
|
631
784
|
tslib_1.__metadata("design:type", String)
|
|
632
785
|
], ColorPickerComponent.prototype, "direction", void 0);
|
|
633
786
|
tslib_1.__decorate([
|
|
634
|
-
|
|
787
|
+
HostBinding('attr.role'),
|
|
635
788
|
tslib_1.__metadata("design:type", String)
|
|
636
|
-
], ColorPickerComponent.prototype, "
|
|
789
|
+
], ColorPickerComponent.prototype, "role", void 0);
|
|
637
790
|
tslib_1.__decorate([
|
|
638
791
|
Input(),
|
|
639
792
|
tslib_1.__metadata("design:type", Array)
|
|
640
793
|
], ColorPickerComponent.prototype, "views", void 0);
|
|
794
|
+
tslib_1.__decorate([
|
|
795
|
+
Input(),
|
|
796
|
+
tslib_1.__metadata("design:type", String),
|
|
797
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
798
|
+
], ColorPickerComponent.prototype, "view", null);
|
|
641
799
|
tslib_1.__decorate([
|
|
642
800
|
Input(),
|
|
643
801
|
tslib_1.__metadata("design:type", String)
|
|
@@ -751,9 +909,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
751
909
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
752
910
|
], ColorPickerComponent.prototype, "container", void 0);
|
|
753
911
|
tslib_1.__decorate([
|
|
754
|
-
ViewChild('
|
|
912
|
+
ViewChild('activeColor', { static: true }),
|
|
755
913
|
tslib_1.__metadata("design:type", ElementRef)
|
|
756
|
-
], ColorPickerComponent.prototype, "
|
|
914
|
+
], ColorPickerComponent.prototype, "activeColor", void 0);
|
|
757
915
|
tslib_1.__decorate([
|
|
758
916
|
ViewChild('popupTemplate', { static: true }),
|
|
759
917
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
@@ -784,7 +942,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
784
942
|
useValue: 'kendo.colorpicker'
|
|
785
943
|
}
|
|
786
944
|
],
|
|
787
|
-
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor=\"kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty.\"\n colorPickerNoColor=\"Colorpicker no color chosen\"\n i18n-flatColorPickerNoColor=\"kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.colorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.colorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.colorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.colorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.colorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.colorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.colorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <span
|
|
945
|
+
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor=\"kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty.\"\n colorPickerNoColor=\"Colorpicker no color chosen\"\n i18n-flatColorPickerNoColor=\"kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.colorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.colorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.colorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.colorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.colorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.colorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.colorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <span #activeColor class=\"k-input-inner\">\n <span\n class=\"k-value-icon k-color-preview\"\n [ngClass]=\"{'k-icon-color-preview': iconStyles, 'k-no-color': !value}\">\n <span *ngIf=\"iconClass || icon\" class=\"k-color-preview-icon k-icon\" [ngClass]=\"iconStyles\"></span>\n <span class=\"k-color-preview-mask\" [style.background-color]=\"value\"></span>\n </span>\n </span>\n <button\n #arrowButton\n tabindex=\"-1\"\n role=\"button\"\n class=\"k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button\">\n <span class=\"k-button-icon k-icon k-i-arrow-s\"></span>\n </button>\n <ng-template #popupTemplate>\n <kendo-flatcolorpicker\n #flatColorPicker\n [value]=\"value\"\n [format]=\"format\"\n [views]=\"views\"\n [activeView]=\"activeView\"\n [actionsLayout]=\"actionsLayout\"\n [preview]=\"preview\"\n [gradientSettings]=\"gradientSettings\"\n [paletteSettings]=\"paletteSettings\"\n [clearButton]=\"clearButton\"\n (cancel)=\"handleCancelEvent($event)\"\n (focusout)=\"handlePopupBlur($event)\"\n (valueChange)=\"handleValueChange($event)\"\n (keydown)=\"handlePopupKeyDown($event)\"\n (activeViewChange)=\"activeViewChange.emit($event)\"\n (actionButtonClick)=\"togglePopup()\">\n </kendo-flatcolorpicker>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
788
946
|
}),
|
|
789
947
|
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
790
948
|
PopupService,
|
|
@@ -8,8 +8,10 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
8
8
|
import { Subscription } from 'rxjs';
|
|
9
9
|
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
10
|
import { isChanged, KendoInput } from '@progress/kendo-angular-common';
|
|
11
|
+
import { validatePackage } from "@progress/kendo-licensing";
|
|
11
12
|
import { FlatColorPickerLocalizationService } from './localization/flatcolorpicker-localization.service';
|
|
12
13
|
import { FlatColorPickerService } from './services/flatcolorpicker.service';
|
|
14
|
+
import { packageMetadata } from "../package-metadata";
|
|
13
15
|
import { ColorPickerCancelEvent } from './events';
|
|
14
16
|
import { parseColor } from './utils';
|
|
15
17
|
import { isPresent } from '../common/utils';
|
|
@@ -24,10 +26,10 @@ import { FlatColorPickerActionButtonsComponent } from './flatcolorpicker-actions
|
|
|
24
26
|
* through a gradient that renders an hsv canvas. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
25
27
|
*/
|
|
26
28
|
var FlatColorPickerComponent = /** @class */ (function () {
|
|
27
|
-
function FlatColorPickerComponent(
|
|
29
|
+
function FlatColorPickerComponent(host, service, localizationService, cdr, renderer, ngZone) {
|
|
28
30
|
var _this = this;
|
|
29
|
-
this.service = service;
|
|
30
31
|
this.host = host;
|
|
32
|
+
this.service = service;
|
|
31
33
|
this.localizationService = localizationService;
|
|
32
34
|
this.cdr = cdr;
|
|
33
35
|
this.renderer = renderer;
|
|
@@ -110,6 +112,7 @@ var FlatColorPickerComponent = /** @class */ (function () {
|
|
|
110
112
|
this.subscriptions = new Subscription();
|
|
111
113
|
this.notifyNgChanged = function () { };
|
|
112
114
|
this.notifyNgTouched = function () { };
|
|
115
|
+
validatePackage(packageMetadata);
|
|
113
116
|
this.dynamicRTLSubscription = this.localizationService.changes.subscribe(function (_a) {
|
|
114
117
|
var rtl = _a.rtl;
|
|
115
118
|
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
@@ -541,8 +544,8 @@ var FlatColorPickerComponent = /** @class */ (function () {
|
|
|
541
544
|
],
|
|
542
545
|
template: "\n <ng-container kendoFlatColorPickerLocalizedMessages\n i18n-flatColorPickerNoColor=\"kendo.flatcolorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.flatcolorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.flatcolorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.flatcolorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.flatcolorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.flatcolorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.flatcolorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.flatcolorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.flatcolorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.flatcolorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.flatcolorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.flatcolorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.flatcolorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.flatcolorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.flatcolorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <div kendoFlatColorPickerHeader\n *ngIf=\"headerHasContent\"\n #header\n [clearButton]=\"clearButton\"\n [activeView]=\"activeView\"\n [views]=\"views\"\n [value]=\"value\"\n [selection]=\"selection\"\n [preview]=\"preview\"\n (clearButtonClick)=\"onClearButtonClick()\"\n (viewChange)=\"onViewChange($event)\"\n (valuePaneClick)=\"resetSelection($event)\">\n </div>\n <div class=\"k-coloreditor-views k-vstack\">\n <kendo-colorgradient #gradient\n *ngIf=\"activeView === 'gradient'\"\n [tabindex]=\"null\"\n [value]=\"selection\"\n [format]=\"format\"\n [opacity]=\"gradientSettings.opacity\"\n [delay]=\"gradientSettings.delay\"\n [contrastTool]=\"gradientSettings.contrastTool\"\n [readonly]=\"readonly\"\n (valueChange)=\"handleValueChange($event)\"\n >\n </kendo-colorgradient>\n <kendo-colorpalette #palette\n *ngIf=\"activeView === 'palette'\"\n kendoFocusOnDomReady\n [palette]=\"paletteSettings.palette\"\n [columns]=\"paletteSettings.columns\"\n [tileSize]=\"paletteSettings.tileSize\"\n [format]=\"format\"\n [value]=\"selection\"\n (valueChange)=\"handleValueChange($event)\"\n >\n </kendo-colorpalette>\n </div>\n <div kendoFlatColorPickerActionButtons *ngIf=\"preview\"\n #footer\n [ngClass]=\"'k-justify-content-' + actionsLayout\"\n (actionButtonClick)=\"onAction($event)\">\n </div>\n"
|
|
543
546
|
}),
|
|
544
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
545
|
-
|
|
547
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
548
|
+
FlatColorPickerService,
|
|
546
549
|
LocalizationService,
|
|
547
550
|
ChangeDetectorRef,
|
|
548
551
|
Renderer2,
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-inputs',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1642520654,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Directive, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
|
|
7
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
8
|
import { getStylingClasses } from '../common/utils';
|
|
9
|
+
import { packageMetadata } from '../package-metadata';
|
|
8
10
|
/**
|
|
9
11
|
* Represents the directive that renders the [Kendo UI RadioButton]({% slug overview_checkbox %}) input component.
|
|
10
12
|
* The directive is placed on input type="radio" elements.
|
|
@@ -20,6 +22,7 @@ var RadioButtonDirective = /** @class */ (function () {
|
|
|
20
22
|
this.hostElement = hostElement;
|
|
21
23
|
this.kendoClass = true;
|
|
22
24
|
this._size = 'medium';
|
|
25
|
+
validatePackage(packageMetadata);
|
|
23
26
|
}
|
|
24
27
|
Object.defineProperty(RadioButtonDirective.prototype, "size", {
|
|
25
28
|
get: function () {
|