@progress/kendo-angular-inputs 7.5.1-dev.202110280909 → 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/es/shared/utils.js +23 -0
- package/dist/es/textbox/textbox.component.js +3 -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/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/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/es2015/{colorpicker/models/color-picker-view.d.ts → shared/utils.d.ts} +9 -6
- package/dist/es2015/shared/utils.js +23 -0
- package/dist/es2015/textbox/textbox.component.js +3 -1
- package/dist/fesm2015/index.js +2229 -1046
- package/dist/fesm5/index.js +2026 -904
- 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/npm/shared/utils.js +25 -0
- package/dist/npm/textbox/textbox.component.js +6 -4
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +10 -7
- 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
|
@@ -6,23 +6,24 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var ColorPickerComponent_1;
|
|
7
7
|
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone } from '@angular/core';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
9
10
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
10
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
-
import { packageMetadata } from '../package-metadata';
|
|
12
|
-
import { PreventableEvent, ActiveColorClickEvent } from './models';
|
|
13
|
-
import { parseColor } from './utils/color-parser';
|
|
14
|
-
import { isPresent } from '../common/utils';
|
|
15
12
|
import { Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
16
13
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
17
|
-
import {
|
|
14
|
+
import { packageMetadata } from '../package-metadata';
|
|
15
|
+
import { PALETTEPRESETS } from './models';
|
|
16
|
+
import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
|
|
17
|
+
import { parseColor } from './utils';
|
|
18
|
+
import { isPresent } from '../common/utils';
|
|
18
19
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
19
|
-
import {
|
|
20
|
-
const DEFAULT_PRESET = 'office';
|
|
21
|
-
const DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
20
|
+
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
22
21
|
let serial = 0;
|
|
23
22
|
/**
|
|
24
23
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
25
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
|
|
26
|
+
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
26
27
|
*/
|
|
27
28
|
let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
28
29
|
constructor(popupService, cdr, localizationService, ngZone) {
|
|
@@ -30,39 +31,66 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
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 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
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 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
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 = () => { };
|
|
100
139
|
this.notifyNgChanged = () => { };
|
|
101
140
|
validatePackage(packageMetadata);
|
|
@@ -107,7 +146,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
107
146
|
* Specifies the value of the initially selected color.
|
|
108
147
|
*/
|
|
109
148
|
set value(value) {
|
|
110
|
-
this._value = parseColor(value, this.format);
|
|
149
|
+
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
111
150
|
}
|
|
112
151
|
get value() {
|
|
113
152
|
return this._value;
|
|
@@ -141,6 +180,8 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
141
180
|
}
|
|
142
181
|
/**
|
|
143
182
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
183
|
+
*
|
|
184
|
+
* @default 0
|
|
144
185
|
*/
|
|
145
186
|
set tabindex(value) {
|
|
146
187
|
const tabindex = Number(value);
|
|
@@ -181,11 +222,11 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
181
222
|
}
|
|
182
223
|
ngOnChanges(changes) {
|
|
183
224
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
184
|
-
this.
|
|
225
|
+
this.activeView = 'palette';
|
|
185
226
|
}
|
|
186
|
-
if (this.
|
|
227
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
187
228
|
this.format = 'rgba';
|
|
188
|
-
this.value = parseColor(this.value, this.format);
|
|
229
|
+
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
189
230
|
}
|
|
190
231
|
}
|
|
191
232
|
ngOnDestroy() {
|
|
@@ -197,7 +238,19 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
197
238
|
/**
|
|
198
239
|
* @hidden
|
|
199
240
|
*/
|
|
200
|
-
|
|
241
|
+
get colorPickerAriaLabel() {
|
|
242
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @hidden
|
|
246
|
+
*/
|
|
247
|
+
handleCancelEvent(ev) {
|
|
248
|
+
this.cancel.emit(ev);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @hidden
|
|
252
|
+
*/
|
|
253
|
+
togglePopup() {
|
|
201
254
|
this.toggleWithEvents(!this.isOpen);
|
|
202
255
|
this.focus();
|
|
203
256
|
}
|
|
@@ -209,7 +262,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
209
262
|
const event = new ActiveColorClickEvent(this.value);
|
|
210
263
|
this.activeColorClick.emit(event);
|
|
211
264
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
212
|
-
this.
|
|
265
|
+
this.togglePopup();
|
|
213
266
|
}
|
|
214
267
|
}
|
|
215
268
|
/**
|
|
@@ -225,9 +278,6 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
225
278
|
* @hidden
|
|
226
279
|
*/
|
|
227
280
|
handleWrapperFocus() {
|
|
228
|
-
if (isPresent(this.palette)) {
|
|
229
|
-
this.palette.nativeElement.focus();
|
|
230
|
-
}
|
|
231
281
|
if (this.isFocused) {
|
|
232
282
|
return;
|
|
233
283
|
}
|
|
@@ -252,7 +302,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
252
302
|
this.notifyNgTouched();
|
|
253
303
|
}
|
|
254
304
|
/**
|
|
255
|
-
* Clears the
|
|
305
|
+
* Clears the value of the ColorPicker.
|
|
256
306
|
*/
|
|
257
307
|
reset() {
|
|
258
308
|
if (!isPresent(this.value)) {
|
|
@@ -280,13 +330,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
280
330
|
/**
|
|
281
331
|
* @hidden
|
|
282
332
|
*/
|
|
283
|
-
handleValueChange(color
|
|
284
|
-
const parsedColor = parseColor(color, this.format);
|
|
333
|
+
handleValueChange(color) {
|
|
334
|
+
const parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
|
|
285
335
|
const valueChange = parsedColor !== this.value;
|
|
286
|
-
if (closePopup) {
|
|
287
|
-
this.toggleWithEvents(false);
|
|
288
|
-
this.focus();
|
|
289
|
-
}
|
|
290
336
|
if (valueChange) {
|
|
291
337
|
this.value = parsedColor;
|
|
292
338
|
this.valueChange.emit(parsedColor);
|
|
@@ -297,9 +343,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
297
343
|
* @hidden
|
|
298
344
|
*/
|
|
299
345
|
handlePopupBlur(event) {
|
|
300
|
-
|
|
301
|
-
const wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
302
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
346
|
+
if (this.popupBlurInvalid(event)) {
|
|
303
347
|
return;
|
|
304
348
|
}
|
|
305
349
|
this.isFocused = false;
|
|
@@ -350,52 +394,56 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
350
394
|
this.wrapper.nativeElement.focus();
|
|
351
395
|
}
|
|
352
396
|
if (event.keyCode === Keys.Tab) {
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
lastElement.focus();
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
if (event.target === lastElement) {
|
|
365
|
-
event.preventDefault();
|
|
366
|
-
firstElement.focus();
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
397
|
+
const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
398
|
+
const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
399
|
+
if (event.target === currentElement) {
|
|
400
|
+
event.preventDefault();
|
|
401
|
+
nextElement.nativeElement.focus();
|
|
369
402
|
}
|
|
370
403
|
}
|
|
371
404
|
}
|
|
372
405
|
/**
|
|
373
406
|
* @hidden
|
|
374
|
-
* Used by the
|
|
407
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
375
408
|
*/
|
|
376
409
|
isEmpty() {
|
|
377
410
|
return false;
|
|
378
411
|
}
|
|
412
|
+
popupBlurInvalid(ev) {
|
|
413
|
+
const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
414
|
+
const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
415
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
416
|
+
}
|
|
379
417
|
toggleWithEvents(open) {
|
|
380
418
|
const sameState = this.isOpen === open;
|
|
381
419
|
if (this.disabled || this.readonly || sameState) {
|
|
382
420
|
return;
|
|
383
421
|
}
|
|
384
|
-
|
|
385
|
-
|
|
422
|
+
let eventArgs;
|
|
423
|
+
if (open) {
|
|
424
|
+
eventArgs = new ColorPickerOpenEvent();
|
|
425
|
+
this.open.emit(eventArgs);
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
eventArgs = new ColorPickerCloseEvent();
|
|
429
|
+
this.close.emit(eventArgs);
|
|
430
|
+
}
|
|
386
431
|
if (!eventArgs.isDefaultPrevented()) {
|
|
387
432
|
this.toggle(open);
|
|
388
433
|
}
|
|
389
434
|
if (open) {
|
|
390
|
-
this.
|
|
391
|
-
setTimeout(() => {
|
|
392
|
-
if (this.colorGradient) {
|
|
393
|
-
this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
});
|
|
435
|
+
this.focusFirstElement();
|
|
397
436
|
}
|
|
398
437
|
}
|
|
438
|
+
focusFirstElement() {
|
|
439
|
+
this.ngZone.runOutsideAngular(() => {
|
|
440
|
+
setTimeout(() => {
|
|
441
|
+
const elementToFocus = this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle :
|
|
442
|
+
this.flatColorPicker.palette.host;
|
|
443
|
+
elementToFocus.nativeElement.focus();
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
}
|
|
399
447
|
openPopup() {
|
|
400
448
|
const horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
401
449
|
const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
|
|
@@ -425,11 +473,24 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
425
473
|
}
|
|
426
474
|
this.popupRef.close();
|
|
427
475
|
this.popupRef = null;
|
|
428
|
-
|
|
476
|
+
}
|
|
477
|
+
get firstFocusableElement() {
|
|
478
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
479
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
480
|
+
}
|
|
481
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
482
|
+
}
|
|
483
|
+
get lastFocusableElement() {
|
|
484
|
+
if (this.preview) {
|
|
485
|
+
return this.flatColorPicker.footer.lastButton;
|
|
486
|
+
}
|
|
487
|
+
if (this.flatColorPicker.palette) {
|
|
488
|
+
return this.flatColorPicker.palette.host;
|
|
489
|
+
}
|
|
490
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
429
491
|
}
|
|
430
492
|
};
|
|
431
493
|
tslib_1.__decorate([
|
|
432
|
-
HostBinding('class.k-widget'),
|
|
433
494
|
HostBinding('class.k-colorpicker'),
|
|
434
495
|
tslib_1.__metadata("design:type", Boolean)
|
|
435
496
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
@@ -441,10 +502,14 @@ tslib_1.__decorate([
|
|
|
441
502
|
Input(),
|
|
442
503
|
tslib_1.__metadata("design:type", String)
|
|
443
504
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
505
|
+
tslib_1.__decorate([
|
|
506
|
+
Input(),
|
|
507
|
+
tslib_1.__metadata("design:type", Array)
|
|
508
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
444
509
|
tslib_1.__decorate([
|
|
445
510
|
Input(),
|
|
446
511
|
tslib_1.__metadata("design:type", String)
|
|
447
|
-
], ColorPickerComponent.prototype, "
|
|
512
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
448
513
|
tslib_1.__decorate([
|
|
449
514
|
Input(),
|
|
450
515
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -485,11 +550,23 @@ tslib_1.__decorate([
|
|
|
485
550
|
Input(),
|
|
486
551
|
tslib_1.__metadata("design:type", Object)
|
|
487
552
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
553
|
+
tslib_1.__decorate([
|
|
554
|
+
Input(),
|
|
555
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
556
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
488
557
|
tslib_1.__decorate([
|
|
489
558
|
Input(),
|
|
490
559
|
tslib_1.__metadata("design:type", Number),
|
|
491
560
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
492
561
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
562
|
+
tslib_1.__decorate([
|
|
563
|
+
Input(),
|
|
564
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
565
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
566
|
+
tslib_1.__decorate([
|
|
567
|
+
Input(),
|
|
568
|
+
tslib_1.__metadata("design:type", String)
|
|
569
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
493
570
|
tslib_1.__decorate([
|
|
494
571
|
Output(),
|
|
495
572
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -510,10 +587,18 @@ tslib_1.__decorate([
|
|
|
510
587
|
Output('blur'),
|
|
511
588
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
512
589
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
590
|
+
tslib_1.__decorate([
|
|
591
|
+
Output(),
|
|
592
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
593
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
513
594
|
tslib_1.__decorate([
|
|
514
595
|
Output(),
|
|
515
596
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
516
597
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
598
|
+
tslib_1.__decorate([
|
|
599
|
+
Output(),
|
|
600
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
601
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
517
602
|
tslib_1.__decorate([
|
|
518
603
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
519
604
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -527,15 +612,12 @@ tslib_1.__decorate([
|
|
|
527
612
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
528
613
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
529
614
|
tslib_1.__decorate([
|
|
530
|
-
ViewChild('
|
|
531
|
-
tslib_1.__metadata("design:type",
|
|
532
|
-
], ColorPickerComponent.prototype, "
|
|
533
|
-
tslib_1.__decorate([
|
|
534
|
-
ViewChild('colorGradient', { static: false }),
|
|
535
|
-
tslib_1.__metadata("design:type", ColorGradientComponent)
|
|
536
|
-
], ColorPickerComponent.prototype, "colorGradient", void 0);
|
|
615
|
+
ViewChild('flatColorPicker', { static: false }),
|
|
616
|
+
tslib_1.__metadata("design:type", FlatColorPickerComponent)
|
|
617
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
537
618
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
538
619
|
Component({
|
|
620
|
+
exportAs: 'kendoColorPicker',
|
|
539
621
|
selector: 'kendo-colorpicker',
|
|
540
622
|
providers: [{
|
|
541
623
|
multi: true,
|
|
@@ -557,9 +639,13 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
557
639
|
],
|
|
558
640
|
template: `
|
|
559
641
|
<ng-container kendoColorPickerLocalizedMessages
|
|
560
|
-
i18n-
|
|
642
|
+
i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."
|
|
643
|
+
colorPickerNoColor="Colorpicker no color chosen"
|
|
644
|
+
i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
|
|
645
|
+
flatColorPickerNoColor="Flatcolorpicker no color chosen"
|
|
646
|
+
i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
561
647
|
colorGradientNoColor="Colorgradient no color chosen"
|
|
562
|
-
i18n-
|
|
648
|
+
i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
|
|
563
649
|
colorPaletteNoColor="Colorpalette no color chosen"
|
|
564
650
|
i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
|
|
565
651
|
colorGradientHandle="Choose color"
|
|
@@ -569,16 +655,22 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
569
655
|
hueSliderHandle="Set hue"
|
|
570
656
|
i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."
|
|
571
657
|
opacitySliderHandle="Set opacity"
|
|
572
|
-
i18n-
|
|
573
|
-
|
|
574
|
-
i18n-
|
|
575
|
-
|
|
576
|
-
i18n-
|
|
577
|
-
|
|
578
|
-
i18n-
|
|
579
|
-
|
|
580
|
-
i18n-
|
|
581
|
-
|
|
658
|
+
i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."
|
|
659
|
+
contrastRatio="Contrast ratio"
|
|
660
|
+
i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."
|
|
661
|
+
previewColor="Color preview"
|
|
662
|
+
i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."
|
|
663
|
+
revertSelection="Revert selection"
|
|
664
|
+
i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."
|
|
665
|
+
gradientView="Gradient view"
|
|
666
|
+
i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."
|
|
667
|
+
paletteView="Palette view"
|
|
668
|
+
i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."
|
|
669
|
+
formatButton="Change color format"
|
|
670
|
+
i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."
|
|
671
|
+
applyButton="Apply"
|
|
672
|
+
i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
|
|
673
|
+
cancelButton="Cancel">
|
|
582
674
|
</ng-container>
|
|
583
675
|
<span
|
|
584
676
|
#wrapper
|
|
@@ -591,7 +683,7 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
591
683
|
[attr.aria-expanded]="isOpen"
|
|
592
684
|
[attr.aria-readonly]="readonly"
|
|
593
685
|
[attr.aria-disabled]="disabled"
|
|
594
|
-
[attr.aria-label]="
|
|
686
|
+
[attr.aria-label]="colorPickerAriaLabel"
|
|
595
687
|
[id]="focusableId"
|
|
596
688
|
[attr.tabindex]="tabindex"
|
|
597
689
|
(focus)="handleWrapperFocus()"
|
|
@@ -599,44 +691,35 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
599
691
|
(mousedown)="$event.preventDefault()"
|
|
600
692
|
(keydown)="handleWrapperKeyDown($event)"
|
|
601
693
|
>
|
|
602
|
-
<span *ngIf="!iconStyles" class="k-selected-color" [style.background
|
|
694
|
+
<span *ngIf="!iconStyles" class="k-selected-color" [style.background]="value" (click)="handleActiveColorClick()">
|
|
603
695
|
<span class="k-icon k-i-line" *ngIf="!value"></span>
|
|
604
696
|
</span>
|
|
605
697
|
<span *ngIf="iconStyles" class="k-tool-icon" [ngClass]="iconStyles" (click)="handleActiveColorClick()">
|
|
606
698
|
<span class="k-selected-color" [style.background-color]="value"></span>
|
|
607
699
|
</span>
|
|
608
|
-
<span class="k-select" (click)="
|
|
700
|
+
<span class="k-select" (click)="togglePopup()">
|
|
609
701
|
<span class="k-icon k-i-arrow-s"></span>
|
|
610
702
|
</span>
|
|
611
703
|
</span>
|
|
612
704
|
<ng-template #popupTemplate>
|
|
613
|
-
<kendo-
|
|
614
|
-
|
|
705
|
+
<kendo-flatcolorpicker
|
|
706
|
+
#flatColorPicker
|
|
615
707
|
[value]="value"
|
|
616
708
|
[format]="format"
|
|
617
|
-
[
|
|
618
|
-
[
|
|
619
|
-
[
|
|
709
|
+
[views]="views"
|
|
710
|
+
[activeView]="activeView"
|
|
711
|
+
[actionsLayout]="actionsLayout"
|
|
712
|
+
[preview]="preview"
|
|
713
|
+
[gradientSettings]="gradientSettings"
|
|
714
|
+
[paletteSettings]="paletteSettings"
|
|
715
|
+
[clearButton]="clearButton"
|
|
620
716
|
(focusout)="handlePopupBlur($event)"
|
|
621
|
-
(
|
|
622
|
-
(
|
|
623
|
-
>
|
|
624
|
-
</kendo-colorgradient>
|
|
625
|
-
<kendo-colorpalette
|
|
626
|
-
#palette
|
|
627
|
-
*ngIf="view === 'palette' || view === 'combo'"
|
|
628
|
-
kendoFocusOnDomReady
|
|
629
|
-
[palette]="paletteSettings.palette"
|
|
630
|
-
[columns]="paletteSettings.columns"
|
|
631
|
-
[tileSize]="paletteSettings.tileSize"
|
|
632
|
-
[format]="format"
|
|
633
|
-
[value]="value"
|
|
634
|
-
(blur)="handlePopupBlur($event)"
|
|
635
|
-
(cellSelection)="handleValueChange($event, true)"
|
|
636
|
-
(mousedown)="$event.preventDefault()"
|
|
717
|
+
(cancel)="handleCancelEvent($event)"
|
|
718
|
+
(valueChange)="handleValueChange($event)"
|
|
637
719
|
(keydown)="handlePopupKeyDown($event)"
|
|
638
|
-
|
|
639
|
-
|
|
720
|
+
(activeViewChange)="activeViewChange.emit($event)"
|
|
721
|
+
(actionButtonClick)="togglePopup()">
|
|
722
|
+
</kendo-flatcolorpicker>
|
|
640
723
|
</ng-template>
|
|
641
724
|
<ng-container #container></ng-container>
|
|
642
725
|
`
|
|
@@ -23,3 +23,15 @@ export declare const AAA_RATIO = 7;
|
|
|
23
23
|
* @hidden
|
|
24
24
|
*/
|
|
25
25
|
export declare const AA_RATIO = 4.5;
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
export declare const DEFAULT_PRESET = "office";
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_ACCESSIBLE_PRESET = "accessible";
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
export declare const STEP_COUNT = 16;
|
|
@@ -22,3 +22,15 @@ export const AAA_RATIO = 7.0;
|
|
|
22
22
|
* @hidden
|
|
23
23
|
*/
|
|
24
24
|
export const AA_RATIO = 4.5;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export const DEFAULT_PRESET = 'office';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export const STEP_COUNT = 16;
|
|
@@ -9,8 +9,8 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
9
9
|
export declare class ContrastValidationComponent {
|
|
10
10
|
private localization;
|
|
11
11
|
type: string;
|
|
12
|
-
ratio: number;
|
|
13
12
|
pass: boolean;
|
|
13
|
+
value: string;
|
|
14
14
|
constructor(localization: LocalizationService);
|
|
15
15
|
readonly passMessage: string;
|
|
16
16
|
readonly failMessage: string;
|
|
@@ -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
|
/**
|
|
@@ -19,34 +20,37 @@ let ContrastValidationComponent = class ContrastValidationComponent {
|
|
|
19
20
|
return this.localization.get('failContrast');
|
|
20
21
|
}
|
|
21
22
|
get contrastText() {
|
|
22
|
-
|
|
23
|
+
let ratio = this.type === 'AA' ? AA_RATIO : AAA_RATIO;
|
|
24
|
+
return `${this.type}: ${ratio.toFixed(1)}`;
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
tslib_1.__decorate([
|
|
26
28
|
Input(),
|
|
27
29
|
tslib_1.__metadata("design:type", String)
|
|
28
30
|
], ContrastValidationComponent.prototype, "type", void 0);
|
|
29
|
-
tslib_1.__decorate([
|
|
30
|
-
Input(),
|
|
31
|
-
tslib_1.__metadata("design:type", Number)
|
|
32
|
-
], ContrastValidationComponent.prototype, "ratio", void 0);
|
|
33
31
|
tslib_1.__decorate([
|
|
34
32
|
Input(),
|
|
35
33
|
tslib_1.__metadata("design:type", Boolean)
|
|
36
34
|
], ContrastValidationComponent.prototype, "pass", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
Input(),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], ContrastValidationComponent.prototype, "value", void 0);
|
|
37
39
|
ContrastValidationComponent = tslib_1.__decorate([
|
|
38
40
|
Component({
|
|
39
41
|
selector: '[kendoContrastValidation]',
|
|
40
42
|
template: `
|
|
41
43
|
<span>{{contrastText}}</span>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
<ng-container *ngIf="value">
|
|
45
|
+
<span class="k-contrast-validation k-text-success" *ngIf="pass">
|
|
46
|
+
{{passMessage}}
|
|
47
|
+
<span class="k-icon k-i-check"></span>
|
|
48
|
+
</span>
|
|
49
|
+
<span class="k-contrast-validation k-text-error" *ngIf="!pass">
|
|
50
|
+
{{failMessage}}
|
|
48
51
|
<span class="k-icon k-i-close"></span>
|
|
49
|
-
|
|
52
|
+
</span>
|
|
53
|
+
</ng-container>
|
|
50
54
|
`
|
|
51
55
|
}),
|
|
52
56
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
@@ -10,11 +10,9 @@ export declare class ContrastComponent {
|
|
|
10
10
|
private localization;
|
|
11
11
|
value: string;
|
|
12
12
|
ratio: string;
|
|
13
|
-
aaRatio: number;
|
|
14
|
-
aaaRatio: number;
|
|
15
13
|
constructor(localization: LocalizationService);
|
|
16
14
|
readonly formatedRatio: string;
|
|
17
|
-
readonly
|
|
15
|
+
readonly contrastRatioText: string;
|
|
18
16
|
readonly satisfiesAACondition: boolean;
|
|
19
17
|
readonly satisfiesAAACondition: boolean;
|
|
20
18
|
readonly contrastRatio: number;
|