@progress/kendo-angular-inputs 7.5.2 → 8.0.0-dev.202112161434
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/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 +170 -76
- 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/index.js +5 -0
- package/dist/es/main.js +4 -1
- package/dist/es/package-metadata.js +1 -1
- 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 +125 -92
- 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 +84 -24
- package/dist/es2015/colorpicker/colorpicker.component.js +195 -112
- 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/{models → events}/kendo-drag-event.js +0 -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/{models/color-picker-view.d.ts → services/flatcolorpicker.service.d.ts} +6 -7
- 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/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 +4 -1
- package/dist/es2015/main.js +4 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +2207 -1043
- package/dist/fesm5/index.js +2010 -907
- 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 +177 -83
- 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/index.js +10 -0
- package/dist/npm/main.js +7 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +3 -2
- package/dist/es/colorpicker/models/preventable-event.js +0 -29
- package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
- package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
- package/dist/npm/colorpicker/models/preventable-event.js +0 -31
|
@@ -5,23 +5,24 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone } from '@angular/core';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
8
9
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
9
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import { packageMetadata } from '../package-metadata';
|
|
11
|
-
import { PreventableEvent, ActiveColorClickEvent } from './models';
|
|
12
|
-
import { parseColor } from './utils/color-parser';
|
|
13
|
-
import { isPresent } from '../common/utils';
|
|
14
11
|
import { Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
15
12
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
16
|
-
import {
|
|
13
|
+
import { packageMetadata } from '../package-metadata';
|
|
14
|
+
import { PALETTEPRESETS } from './models';
|
|
15
|
+
import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
|
|
16
|
+
import { parseColor } from './utils';
|
|
17
|
+
import { isPresent } from '../common/utils';
|
|
17
18
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
18
|
-
import {
|
|
19
|
-
var DEFAULT_PRESET = 'office';
|
|
20
|
-
var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
19
|
+
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
21
20
|
var serial = 0;
|
|
22
21
|
/**
|
|
23
22
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
24
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
|
|
25
|
+
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
25
26
|
*/
|
|
26
27
|
var ColorPickerComponent = /** @class */ (function () {
|
|
27
28
|
function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
|
|
@@ -30,39 +31,66 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
30
31
|
this.cdr = cdr;
|
|
31
32
|
this.localizationService = localizationService;
|
|
32
33
|
this.ngZone = ngZone;
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
34
|
this.hostClasses = true;
|
|
37
35
|
/**
|
|
38
36
|
* @hidden
|
|
39
37
|
*/
|
|
40
38
|
this.focusableId = "k-colorpicker-" + serial++;
|
|
41
39
|
/**
|
|
42
|
-
*
|
|
40
|
+
* Specifies the views that will be rendered in the popup.
|
|
41
|
+
* By default both the gradient and palette views will be rendered.
|
|
43
42
|
*/
|
|
44
|
-
this.
|
|
43
|
+
this.views = ['gradient', 'palette'];
|
|
45
44
|
/**
|
|
46
45
|
* Sets the read-only state of the ColorPicker.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
47
48
|
*/
|
|
48
49
|
this.readonly = false;
|
|
49
50
|
/**
|
|
50
51
|
* Sets the disabled state of the ColorPicker.
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
51
54
|
*/
|
|
52
55
|
this.disabled = false;
|
|
53
56
|
/**
|
|
54
57
|
* Specifies the output format of the ColorPicker.
|
|
55
|
-
* The input value may be in a different format. However, it will be parsed into the output `format`
|
|
56
|
-
* after the component processes it.
|
|
57
58
|
*
|
|
58
|
-
* If the
|
|
59
|
+
* If the input value is in a different format, it will be parsed into the specified output `format`.
|
|
59
60
|
*
|
|
60
61
|
* The supported values are:
|
|
61
62
|
* * `rgba` (default)
|
|
62
63
|
* * `hex`
|
|
63
|
-
* * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
|
|
64
64
|
*/
|
|
65
65
|
this.format = 'rgba';
|
|
66
|
+
/**
|
|
67
|
+
* Specifies whether the ColorPicker should display a 'Clear color' button.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
this.clearButton = true;
|
|
72
|
+
/**
|
|
73
|
+
* Displays `Apply` and `Cancel` action buttons and color preview panes.
|
|
74
|
+
*
|
|
75
|
+
* When enabled, the component value will not change immediately upon
|
|
76
|
+
* color selection, but only after the `Apply` button is clicked.
|
|
77
|
+
*
|
|
78
|
+
* The `Cancel` button reverts the current selection to its
|
|
79
|
+
* previous state i.e. to the current value.
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
this.preview = false;
|
|
84
|
+
/**
|
|
85
|
+
* Configures the layout of the `Apply` and `Cancel` action buttons.
|
|
86
|
+
*
|
|
87
|
+
* The possible values are:
|
|
88
|
+
* * `start`
|
|
89
|
+
* * `center`
|
|
90
|
+
* * `end` (default)
|
|
91
|
+
* * `stretch`
|
|
92
|
+
*/
|
|
93
|
+
this.actionsLayout = 'end';
|
|
66
94
|
/**
|
|
67
95
|
* Fires each time the value is changed.
|
|
68
96
|
*/
|
|
@@ -85,6 +113,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
85
113
|
* Fires each time the ColorPicker is blurred.
|
|
86
114
|
*/
|
|
87
115
|
this.onBlur = new EventEmitter();
|
|
116
|
+
/**
|
|
117
|
+
* Fires when the user cancels the current color selection.
|
|
118
|
+
*
|
|
119
|
+
* Fires on preview pane or 'Cancel' button click.
|
|
120
|
+
*/
|
|
121
|
+
this.cancel = new EventEmitter();
|
|
88
122
|
/**
|
|
89
123
|
* Fires each time the left side of the ColorPicker wrapper is clicked.
|
|
90
124
|
* The event is triggered regardless of whether a ColorPicker icon is set or not.
|
|
@@ -92,10 +126,15 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
92
126
|
* The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
|
|
93
127
|
*/
|
|
94
128
|
this.activeColorClick = new EventEmitter();
|
|
129
|
+
/**
|
|
130
|
+
* Fires each time the view is about to change.
|
|
131
|
+
* Used to provide a two-way binding for the `activeView` property.
|
|
132
|
+
*/
|
|
133
|
+
this.activeViewChange = new EventEmitter();
|
|
95
134
|
this._tabindex = 0;
|
|
96
135
|
this._popupSettings = { animate: true };
|
|
97
136
|
this._paletteSettings = {};
|
|
98
|
-
this._gradientSettings = { opacity: true,
|
|
137
|
+
this._gradientSettings = { opacity: true, delay: 0 };
|
|
99
138
|
this.notifyNgTouched = function () { };
|
|
100
139
|
this.notifyNgChanged = function () { };
|
|
101
140
|
validatePackage(packageMetadata);
|
|
@@ -113,7 +152,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
113
152
|
* Specifies the value of the initially selected color.
|
|
114
153
|
*/
|
|
115
154
|
set: function (value) {
|
|
116
|
-
this._value = parseColor(value, this.format);
|
|
155
|
+
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
117
156
|
},
|
|
118
157
|
enumerable: true,
|
|
119
158
|
configurable: true
|
|
@@ -163,6 +202,8 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
163
202
|
},
|
|
164
203
|
/**
|
|
165
204
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
205
|
+
*
|
|
206
|
+
* @default 0
|
|
166
207
|
*/
|
|
167
208
|
set: function (value) {
|
|
168
209
|
var tabindex = Number(value);
|
|
@@ -211,11 +252,11 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
211
252
|
};
|
|
212
253
|
ColorPickerComponent.prototype.ngOnChanges = function (changes) {
|
|
213
254
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
214
|
-
this.
|
|
255
|
+
this.activeView = 'palette';
|
|
215
256
|
}
|
|
216
|
-
if (this.
|
|
257
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
217
258
|
this.format = 'rgba';
|
|
218
|
-
this.value = parseColor(this.value, this.format);
|
|
259
|
+
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
219
260
|
}
|
|
220
261
|
};
|
|
221
262
|
ColorPickerComponent.prototype.ngOnDestroy = function () {
|
|
@@ -224,10 +265,26 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
224
265
|
this.dynamicRTLSubscription.unsubscribe();
|
|
225
266
|
}
|
|
226
267
|
};
|
|
268
|
+
Object.defineProperty(ColorPickerComponent.prototype, "colorPickerAriaLabel", {
|
|
269
|
+
/**
|
|
270
|
+
* @hidden
|
|
271
|
+
*/
|
|
272
|
+
get: function () {
|
|
273
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
274
|
+
},
|
|
275
|
+
enumerable: true,
|
|
276
|
+
configurable: true
|
|
277
|
+
});
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
*/
|
|
281
|
+
ColorPickerComponent.prototype.handleCancelEvent = function (ev) {
|
|
282
|
+
this.cancel.emit(ev);
|
|
283
|
+
};
|
|
227
284
|
/**
|
|
228
285
|
* @hidden
|
|
229
286
|
*/
|
|
230
|
-
ColorPickerComponent.prototype.
|
|
287
|
+
ColorPickerComponent.prototype.togglePopup = function () {
|
|
231
288
|
this.toggleWithEvents(!this.isOpen);
|
|
232
289
|
this.focus();
|
|
233
290
|
};
|
|
@@ -239,7 +296,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
239
296
|
var event = new ActiveColorClickEvent(this.value);
|
|
240
297
|
this.activeColorClick.emit(event);
|
|
241
298
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
242
|
-
this.
|
|
299
|
+
this.togglePopup();
|
|
243
300
|
}
|
|
244
301
|
};
|
|
245
302
|
/**
|
|
@@ -255,9 +312,6 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
255
312
|
* @hidden
|
|
256
313
|
*/
|
|
257
314
|
ColorPickerComponent.prototype.handleWrapperFocus = function () {
|
|
258
|
-
if (isPresent(this.palette)) {
|
|
259
|
-
this.palette.nativeElement.focus();
|
|
260
|
-
}
|
|
261
315
|
if (this.isFocused) {
|
|
262
316
|
return;
|
|
263
317
|
}
|
|
@@ -282,7 +336,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
282
336
|
this.notifyNgTouched();
|
|
283
337
|
};
|
|
284
338
|
/**
|
|
285
|
-
* Clears the
|
|
339
|
+
* Clears the value of the ColorPicker.
|
|
286
340
|
*/
|
|
287
341
|
ColorPickerComponent.prototype.reset = function () {
|
|
288
342
|
if (!isPresent(this.value)) {
|
|
@@ -310,13 +364,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
310
364
|
/**
|
|
311
365
|
* @hidden
|
|
312
366
|
*/
|
|
313
|
-
ColorPickerComponent.prototype.handleValueChange = function (color
|
|
314
|
-
var parsedColor = parseColor(color, this.format);
|
|
367
|
+
ColorPickerComponent.prototype.handleValueChange = function (color) {
|
|
368
|
+
var parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
|
|
315
369
|
var valueChange = parsedColor !== this.value;
|
|
316
|
-
if (closePopup) {
|
|
317
|
-
this.toggleWithEvents(false);
|
|
318
|
-
this.focus();
|
|
319
|
-
}
|
|
320
370
|
if (valueChange) {
|
|
321
371
|
this.value = parsedColor;
|
|
322
372
|
this.valueChange.emit(parsedColor);
|
|
@@ -327,9 +377,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
327
377
|
* @hidden
|
|
328
378
|
*/
|
|
329
379
|
ColorPickerComponent.prototype.handlePopupBlur = function (event) {
|
|
330
|
-
|
|
331
|
-
var wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
332
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
380
|
+
if (this.popupBlurInvalid(event)) {
|
|
333
381
|
return;
|
|
334
382
|
}
|
|
335
383
|
this.isFocused = false;
|
|
@@ -380,53 +428,57 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
380
428
|
this.wrapper.nativeElement.focus();
|
|
381
429
|
}
|
|
382
430
|
if (event.keyCode === Keys.Tab) {
|
|
383
|
-
var
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
event.preventDefault();
|
|
389
|
-
lastElement.focus();
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
if (event.target === lastElement) {
|
|
395
|
-
event.preventDefault();
|
|
396
|
-
firstElement.focus();
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
431
|
+
var currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
432
|
+
var nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
433
|
+
if (event.target === currentElement) {
|
|
434
|
+
event.preventDefault();
|
|
435
|
+
nextElement.nativeElement.focus();
|
|
399
436
|
}
|
|
400
437
|
}
|
|
401
438
|
};
|
|
402
439
|
/**
|
|
403
440
|
* @hidden
|
|
404
|
-
* Used by the
|
|
441
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
405
442
|
*/
|
|
406
443
|
ColorPickerComponent.prototype.isEmpty = function () {
|
|
407
444
|
return false;
|
|
408
445
|
};
|
|
446
|
+
ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
|
|
447
|
+
var focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
448
|
+
var wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
449
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
450
|
+
};
|
|
409
451
|
ColorPickerComponent.prototype.toggleWithEvents = function (open) {
|
|
410
|
-
var _this = this;
|
|
411
452
|
var sameState = this.isOpen === open;
|
|
412
453
|
if (this.disabled || this.readonly || sameState) {
|
|
413
454
|
return;
|
|
414
455
|
}
|
|
415
|
-
var eventArgs
|
|
416
|
-
|
|
456
|
+
var eventArgs;
|
|
457
|
+
if (open) {
|
|
458
|
+
eventArgs = new ColorPickerOpenEvent();
|
|
459
|
+
this.open.emit(eventArgs);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
eventArgs = new ColorPickerCloseEvent();
|
|
463
|
+
this.close.emit(eventArgs);
|
|
464
|
+
}
|
|
417
465
|
if (!eventArgs.isDefaultPrevented()) {
|
|
418
466
|
this.toggle(open);
|
|
419
467
|
}
|
|
420
468
|
if (open) {
|
|
421
|
-
this.
|
|
422
|
-
setTimeout(function () {
|
|
423
|
-
if (_this.colorGradient) {
|
|
424
|
-
_this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
});
|
|
469
|
+
this.focusFirstElement();
|
|
428
470
|
}
|
|
429
471
|
};
|
|
472
|
+
ColorPickerComponent.prototype.focusFirstElement = function () {
|
|
473
|
+
var _this = this;
|
|
474
|
+
this.ngZone.runOutsideAngular(function () {
|
|
475
|
+
setTimeout(function () {
|
|
476
|
+
var elementToFocus = _this.flatColorPicker.gradient ? _this.flatColorPicker.gradient.gradientDragHandle :
|
|
477
|
+
_this.flatColorPicker.palette.host;
|
|
478
|
+
elementToFocus.nativeElement.focus();
|
|
479
|
+
});
|
|
480
|
+
});
|
|
481
|
+
};
|
|
430
482
|
ColorPickerComponent.prototype.openPopup = function () {
|
|
431
483
|
var _this = this;
|
|
432
484
|
var horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
@@ -457,11 +509,32 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
457
509
|
}
|
|
458
510
|
this.popupRef.close();
|
|
459
511
|
this.popupRef = null;
|
|
460
|
-
this.palette = null;
|
|
461
512
|
};
|
|
513
|
+
Object.defineProperty(ColorPickerComponent.prototype, "firstFocusableElement", {
|
|
514
|
+
get: function () {
|
|
515
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
516
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
517
|
+
}
|
|
518
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
519
|
+
},
|
|
520
|
+
enumerable: true,
|
|
521
|
+
configurable: true
|
|
522
|
+
});
|
|
523
|
+
Object.defineProperty(ColorPickerComponent.prototype, "lastFocusableElement", {
|
|
524
|
+
get: function () {
|
|
525
|
+
if (this.preview) {
|
|
526
|
+
return this.flatColorPicker.footer.lastButton;
|
|
527
|
+
}
|
|
528
|
+
if (this.flatColorPicker.palette) {
|
|
529
|
+
return this.flatColorPicker.palette.host;
|
|
530
|
+
}
|
|
531
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
532
|
+
},
|
|
533
|
+
enumerable: true,
|
|
534
|
+
configurable: true
|
|
535
|
+
});
|
|
462
536
|
var ColorPickerComponent_1;
|
|
463
537
|
tslib_1.__decorate([
|
|
464
|
-
HostBinding('class.k-widget'),
|
|
465
538
|
HostBinding('class.k-colorpicker'),
|
|
466
539
|
tslib_1.__metadata("design:type", Boolean)
|
|
467
540
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
@@ -473,10 +546,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
473
546
|
Input(),
|
|
474
547
|
tslib_1.__metadata("design:type", String)
|
|
475
548
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
549
|
+
tslib_1.__decorate([
|
|
550
|
+
Input(),
|
|
551
|
+
tslib_1.__metadata("design:type", Array)
|
|
552
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
476
553
|
tslib_1.__decorate([
|
|
477
554
|
Input(),
|
|
478
555
|
tslib_1.__metadata("design:type", String)
|
|
479
|
-
], ColorPickerComponent.prototype, "
|
|
556
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
480
557
|
tslib_1.__decorate([
|
|
481
558
|
Input(),
|
|
482
559
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -517,11 +594,23 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
517
594
|
Input(),
|
|
518
595
|
tslib_1.__metadata("design:type", Object)
|
|
519
596
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
597
|
+
tslib_1.__decorate([
|
|
598
|
+
Input(),
|
|
599
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
600
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
520
601
|
tslib_1.__decorate([
|
|
521
602
|
Input(),
|
|
522
603
|
tslib_1.__metadata("design:type", Number),
|
|
523
604
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
524
605
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
606
|
+
tslib_1.__decorate([
|
|
607
|
+
Input(),
|
|
608
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
609
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
610
|
+
tslib_1.__decorate([
|
|
611
|
+
Input(),
|
|
612
|
+
tslib_1.__metadata("design:type", String)
|
|
613
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
525
614
|
tslib_1.__decorate([
|
|
526
615
|
Output(),
|
|
527
616
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -542,10 +631,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
542
631
|
Output('blur'),
|
|
543
632
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
544
633
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
634
|
+
tslib_1.__decorate([
|
|
635
|
+
Output(),
|
|
636
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
637
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
545
638
|
tslib_1.__decorate([
|
|
546
639
|
Output(),
|
|
547
640
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
548
641
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
642
|
+
tslib_1.__decorate([
|
|
643
|
+
Output(),
|
|
644
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
645
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
549
646
|
tslib_1.__decorate([
|
|
550
647
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
551
648
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -559,15 +656,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
559
656
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
560
657
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
561
658
|
tslib_1.__decorate([
|
|
562
|
-
ViewChild('
|
|
563
|
-
tslib_1.__metadata("design:type",
|
|
564
|
-
], ColorPickerComponent.prototype, "
|
|
565
|
-
tslib_1.__decorate([
|
|
566
|
-
ViewChild('colorGradient', { static: false }),
|
|
567
|
-
tslib_1.__metadata("design:type", ColorGradientComponent)
|
|
568
|
-
], ColorPickerComponent.prototype, "colorGradient", void 0);
|
|
659
|
+
ViewChild('flatColorPicker', { static: false }),
|
|
660
|
+
tslib_1.__metadata("design:type", FlatColorPickerComponent)
|
|
661
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
569
662
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
570
663
|
Component({
|
|
664
|
+
exportAs: 'kendoColorPicker',
|
|
571
665
|
selector: 'kendo-colorpicker',
|
|
572
666
|
providers: [{
|
|
573
667
|
multi: true,
|
|
@@ -587,7 +681,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
587
681
|
useValue: 'kendo.colorpicker'
|
|
588
682
|
}
|
|
589
683
|
],
|
|
590
|
-
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-
|
|
684
|
+
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\n #wrapper\n [ngClass]=\"{\n 'k-picker-wrap': true,\n 'k-state-disabled': this.disabled,\n 'k-state-focused': this.isFocused\n }\"\n role=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"colorPickerAriaLabel\"\n [id]=\"focusableId\"\n [attr.tabindex]=\"tabindex\"\n (focus)=\"handleWrapperFocus()\"\n (blur)=\"handleWrapperBlur()\"\n (mousedown)=\"$event.preventDefault()\"\n (keydown)=\"handleWrapperKeyDown($event)\"\n >\n <span *ngIf=\"!iconStyles\" class=\"k-selected-color\" [style.background]=\"value\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-icon k-i-line\" *ngIf=\"!value\"></span>\n </span>\n <span *ngIf=\"iconStyles\" class=\"k-tool-icon\" [ngClass]=\"iconStyles\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-selected-color\" [style.background-color]=\"value\"></span>\n </span>\n <span class=\"k-select\" (click)=\"togglePopup()\">\n <span class=\"k-icon k-i-arrow-s\"></span>\n </span>\n </span>\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 (focusout)=\"handlePopupBlur($event)\"\n (cancel)=\"handleCancelEvent($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 "
|
|
591
685
|
}),
|
|
592
686
|
tslib_1.__metadata("design:paramtypes", [PopupService,
|
|
593
687
|
ChangeDetectorRef,
|
|
@@ -22,3 +22,15 @@ export var AAA_RATIO = 7.0;
|
|
|
22
22
|
* @hidden
|
|
23
23
|
*/
|
|
24
24
|
export var AA_RATIO = 4.5;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export var DEFAULT_PRESET = 'office';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export var STEP_COUNT = 16;
|
|
@@ -3,6 +3,7 @@
|
|
|
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 { AA_RATIO, AAA_RATIO } from './constants';
|
|
6
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
8
|
import { Component, Input } from '@angular/core';
|
|
8
9
|
/**
|
|
@@ -28,7 +29,8 @@ var ContrastValidationComponent = /** @class */ (function () {
|
|
|
28
29
|
});
|
|
29
30
|
Object.defineProperty(ContrastValidationComponent.prototype, "contrastText", {
|
|
30
31
|
get: function () {
|
|
31
|
-
|
|
32
|
+
var ratio = this.type === 'AA' ? AA_RATIO : AAA_RATIO;
|
|
33
|
+
return this.type + ": " + ratio.toFixed(1);
|
|
32
34
|
},
|
|
33
35
|
enumerable: true,
|
|
34
36
|
configurable: true
|
|
@@ -37,18 +39,18 @@ var ContrastValidationComponent = /** @class */ (function () {
|
|
|
37
39
|
Input(),
|
|
38
40
|
tslib_1.__metadata("design:type", String)
|
|
39
41
|
], ContrastValidationComponent.prototype, "type", void 0);
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
Input(),
|
|
42
|
-
tslib_1.__metadata("design:type", Number)
|
|
43
|
-
], ContrastValidationComponent.prototype, "ratio", void 0);
|
|
44
42
|
tslib_1.__decorate([
|
|
45
43
|
Input(),
|
|
46
44
|
tslib_1.__metadata("design:type", Boolean)
|
|
47
45
|
], ContrastValidationComponent.prototype, "pass", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
Input(),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], ContrastValidationComponent.prototype, "value", void 0);
|
|
48
50
|
ContrastValidationComponent = tslib_1.__decorate([
|
|
49
51
|
Component({
|
|
50
52
|
selector: '[kendoContrastValidation]',
|
|
51
|
-
template: "\n <span>{{contrastText}}</span>\n
|
|
53
|
+
template: "\n <span>{{contrastText}}</span>\n <ng-container *ngIf=\"value\">\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"pass\">\n {{passMessage}}\n <span class=\"k-icon k-i-check\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!pass\">\n {{failMessage}}\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </ng-container>\n "
|
|
52
54
|
}),
|
|
53
55
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
54
56
|
], ContrastValidationComponent);
|
|
@@ -3,8 +3,8 @@
|
|
|
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 { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
6
|
import { Component, Input } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { getContrastFromTwoRGBAs, getRGBA } from './utils';
|
|
9
9
|
import { AA_RATIO, AAA_RATIO } from './constants';
|
|
10
10
|
/**
|
|
@@ -13,8 +13,6 @@ import { AA_RATIO, AAA_RATIO } from './constants';
|
|
|
13
13
|
var ContrastComponent = /** @class */ (function () {
|
|
14
14
|
function ContrastComponent(localization) {
|
|
15
15
|
this.localization = localization;
|
|
16
|
-
this.aaRatio = AA_RATIO;
|
|
17
|
-
this.aaaRatio = AAA_RATIO;
|
|
18
16
|
}
|
|
19
17
|
Object.defineProperty(ContrastComponent.prototype, "formatedRatio", {
|
|
20
18
|
get: function () {
|
|
@@ -23,23 +21,23 @@ var ContrastComponent = /** @class */ (function () {
|
|
|
23
21
|
enumerable: true,
|
|
24
22
|
configurable: true
|
|
25
23
|
});
|
|
26
|
-
Object.defineProperty(ContrastComponent.prototype, "
|
|
24
|
+
Object.defineProperty(ContrastComponent.prototype, "contrastRatioText", {
|
|
27
25
|
get: function () {
|
|
28
|
-
return this.localization.get('contrastRatio');
|
|
26
|
+
return this.localization.get('contrastRatio') + ": " + (this.value ? this.formatedRatio : 'n/a');
|
|
29
27
|
},
|
|
30
28
|
enumerable: true,
|
|
31
29
|
configurable: true
|
|
32
30
|
});
|
|
33
31
|
Object.defineProperty(ContrastComponent.prototype, "satisfiesAACondition", {
|
|
34
32
|
get: function () {
|
|
35
|
-
return this.contrastRatio >=
|
|
33
|
+
return this.contrastRatio >= AA_RATIO;
|
|
36
34
|
},
|
|
37
35
|
enumerable: true,
|
|
38
36
|
configurable: true
|
|
39
37
|
});
|
|
40
38
|
Object.defineProperty(ContrastComponent.prototype, "satisfiesAAACondition", {
|
|
41
39
|
get: function () {
|
|
42
|
-
return this.contrastRatio >=
|
|
40
|
+
return this.contrastRatio >= AAA_RATIO;
|
|
43
41
|
},
|
|
44
42
|
enumerable: true,
|
|
45
43
|
configurable: true
|
|
@@ -63,7 +61,7 @@ var ContrastComponent = /** @class */ (function () {
|
|
|
63
61
|
ContrastComponent = tslib_1.__decorate([
|
|
64
62
|
Component({
|
|
65
63
|
selector: '[kendoContrastTool]',
|
|
66
|
-
template: "\n <div class=\"k-contrast-ratio\">\n <span class=\"k-contrast-ratio-text\">{{
|
|
64
|
+
template: "\n <div class=\"k-contrast-ratio\">\n <span class=\"k-contrast-ratio-text\">{{contrastRatioText}}</span>\n <ng-container *ngIf=\"value\">\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"satisfiesAACondition\">\n <span class=\"k-icon k-i-check\"></span>\n <span class=\"k-icon k-i-check\" *ngIf=\"satisfiesAAACondition\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!satisfiesAACondition\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </ng-container>\n </div>\n <div kendoContrastValidation\n type=\"AA\"\n [value]=\"value\"\n [pass]=\"satisfiesAACondition\">\n </div>\n <div kendoContrastValidation\n type=\"AAA\"\n [value]=\"value\"\n [pass]=\"satisfiesAAACondition\">\n </div>\n "
|
|
67
65
|
}),
|
|
68
66
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
69
67
|
], ContrastComponent);
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { PreventableEvent } from "@progress/kendo-angular-common";
|
|
7
|
+
/**
|
|
8
|
+
* Arguments for the `cancel` event of the ColorPicker and FlatColorPicker components.
|
|
9
|
+
*/
|
|
10
|
+
var ColorPickerCancelEvent = /** @class */ (function (_super) {
|
|
11
|
+
tslib_1.__extends(ColorPickerCancelEvent, _super);
|
|
12
|
+
function ColorPickerCancelEvent(originalEvent) {
|
|
13
|
+
var _this = _super.call(this) || this;
|
|
14
|
+
_this.originalEvent = originalEvent;
|
|
15
|
+
return _this;
|
|
16
|
+
}
|
|
17
|
+
return ColorPickerCancelEvent;
|
|
18
|
+
}(PreventableEvent));
|
|
19
|
+
export { ColorPickerCancelEvent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { PreventableEvent } from "@progress/kendo-angular-common";
|
|
7
|
+
/**
|
|
8
|
+
* Arguments for the `close` event of the ColorPicker component.
|
|
9
|
+
*/
|
|
10
|
+
var ColorPickerCloseEvent = /** @class */ (function (_super) {
|
|
11
|
+
tslib_1.__extends(ColorPickerCloseEvent, _super);
|
|
12
|
+
function ColorPickerCloseEvent() {
|
|
13
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
14
|
+
}
|
|
15
|
+
return ColorPickerCloseEvent;
|
|
16
|
+
}(PreventableEvent));
|
|
17
|
+
export { ColorPickerCloseEvent };
|
|
File without changes
|