@progress/kendo-angular-inputs 10.1.1-dev.202210121020 → 10.1.1-dev.202210181135
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/bundles/kendo-angular-inputs.umd.js +1 -1
- package/colorpicker/color-gradient-numeric-label.directive.d.ts +20 -0
- package/colorpicker/color-gradient.component.d.ts +48 -5
- package/colorpicker/color-input.component.d.ts +14 -3
- package/colorpicker/color-palette.component.d.ts +16 -0
- package/colorpicker/colorpicker.component.d.ts +8 -2
- package/colorpicker/constants.d.ts +4 -0
- package/colorpicker/flatcolorpicker-actions.component.d.ts +4 -1
- package/colorpicker/flatcolorpicker-header.component.d.ts +4 -1
- package/colorpicker/flatcolorpicker.component.d.ts +40 -3
- package/colorpicker/localization/messages.d.ts +17 -1
- package/colorpicker/models/gradient-settings.d.ts +12 -0
- package/colorpicker.module.d.ts +14 -13
- package/esm2015/colorpicker/color-gradient-numeric-label.directive.js +29 -0
- package/esm2015/colorpicker/color-gradient.component.js +181 -34
- package/esm2015/colorpicker/color-input.component.js +71 -10
- package/esm2015/colorpicker/color-palette.component.js +49 -11
- package/esm2015/colorpicker/colorpicker.component.js +69 -11
- package/esm2015/colorpicker/constants.js +4 -0
- package/esm2015/colorpicker/flatcolorpicker-actions.component.js +20 -5
- package/esm2015/colorpicker/flatcolorpicker-header.component.js +36 -14
- package/esm2015/colorpicker/flatcolorpicker.component.js +206 -49
- package/esm2015/colorpicker/localization/messages.js +9 -1
- package/esm2015/colorpicker.module.js +4 -1
- package/esm2015/main.js +1 -0
- package/esm2015/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-inputs.js +686 -153
- package/main.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, Input, ViewChild,
|
|
6
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { Component, Input, ViewChild, Output, EventEmitter, HostBinding, forwardRef, HostListener } from '@angular/core';
|
|
6
|
+
import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
8
8
|
import { throttleTime } from 'rxjs/operators';
|
|
9
9
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
@@ -13,7 +13,7 @@ import { containsFocus, isUntouched } from '../common/dom-utils';
|
|
|
13
13
|
import { parseColor, getHSV, getColorFromHSV, getColorFromHue } from './utils';
|
|
14
14
|
import { isPresent, fitIntoBounds } from '../common/utils';
|
|
15
15
|
import { ColorGradientLocalizationService } from './localization/colorgradient-localization.service';
|
|
16
|
-
import { DEFAULT_GRADIENT_BACKGROUND_COLOR, DEFAULT_OUTPUT_FORMAT, DRAGHANDLE_MOVE_SPEED } from './constants';
|
|
16
|
+
import { DEFAULT_GRADIENT_BACKGROUND_COLOR, DEFAULT_OUTPUT_FORMAT, DRAGHANDLE_MOVE_SPEED, DRAGHANDLE_MOVE_SPEED_SMALL_STEP } from './constants';
|
|
17
17
|
import { packageMetadata } from '../package-metadata';
|
|
18
18
|
import * as i0 from "@angular/core";
|
|
19
19
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
@@ -30,13 +30,15 @@ let serial = 0;
|
|
|
30
30
|
* The ColorGradient is independently used by `kendo-colorpicker` and can be directly added to the page.
|
|
31
31
|
*/
|
|
32
32
|
export class ColorGradientComponent {
|
|
33
|
-
constructor(host, ngZone, renderer, cdr, localizationService) {
|
|
33
|
+
constructor(host, ngZone, renderer, cdr, localizationService, injector) {
|
|
34
34
|
this.host = host;
|
|
35
35
|
this.ngZone = ngZone;
|
|
36
36
|
this.renderer = renderer;
|
|
37
37
|
this.cdr = cdr;
|
|
38
38
|
this.localizationService = localizationService;
|
|
39
|
+
this.injector = injector;
|
|
39
40
|
this.hostClasses = true;
|
|
41
|
+
this.ariaRole = 'textbox';
|
|
40
42
|
/**
|
|
41
43
|
* @hidden
|
|
42
44
|
*/
|
|
@@ -97,11 +99,28 @@ export class ColorGradientComponent {
|
|
|
97
99
|
* updated on moving the drag handle or the sliders.
|
|
98
100
|
*/
|
|
99
101
|
this.hsva = new BehaviorSubject({});
|
|
102
|
+
/**
|
|
103
|
+
* Determines the step (in pixels) when moving the gradient drag handle using the keyboard arrow keys.
|
|
104
|
+
*
|
|
105
|
+
* @default 5
|
|
106
|
+
*/
|
|
107
|
+
this.gradientSliderStep = DRAGHANDLE_MOVE_SPEED;
|
|
108
|
+
/**
|
|
109
|
+
* Determines the step (in pixels) when moving the gradient drag handle using the keyboard arrow keys while holding the shift key.
|
|
110
|
+
*
|
|
111
|
+
* @default 2
|
|
112
|
+
*/
|
|
113
|
+
this.gradientSliderSmallStep = DRAGHANDLE_MOVE_SPEED_SMALL_STEP;
|
|
114
|
+
/**
|
|
115
|
+
* @hidden
|
|
116
|
+
*/
|
|
117
|
+
this.internalNavigation = false;
|
|
100
118
|
this._tabindex = 0;
|
|
101
119
|
this.listeners = [];
|
|
102
120
|
this.hueSliderTouched = false;
|
|
103
121
|
this.alphaSliderTouched = false;
|
|
104
122
|
this.updateValues = new Subject();
|
|
123
|
+
this.hsvHandleCoordinates = { x: 0, y: 0 };
|
|
105
124
|
this.notifyNgChanged = () => { };
|
|
106
125
|
this.notifyNgTouched = () => { };
|
|
107
126
|
validatePackage(packageMetadata);
|
|
@@ -119,7 +138,42 @@ export class ColorGradientComponent {
|
|
|
119
138
|
return this.id;
|
|
120
139
|
}
|
|
121
140
|
get hostTabindex() {
|
|
122
|
-
|
|
141
|
+
var _a;
|
|
142
|
+
return ((_a = this.tabindex) === null || _a === void 0 ? void 0 : _a.toString()) || '0';
|
|
143
|
+
}
|
|
144
|
+
get isControlInvalid() {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
return (_b = ((_a = this.control) === null || _a === void 0 ? void 0 : _a.invalid)) === null || _b === void 0 ? void 0 : _b.toString();
|
|
147
|
+
}
|
|
148
|
+
get isDisabled() {
|
|
149
|
+
var _a;
|
|
150
|
+
return ((_a = this.disabled) === null || _a === void 0 ? void 0 : _a.toString()) || undefined;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @hidden
|
|
154
|
+
*/
|
|
155
|
+
enterHandler(event) {
|
|
156
|
+
if (event.target !== this.host.nativeElement) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.internalNavigation = true;
|
|
160
|
+
this.gradientDragHandle.nativeElement.focus();
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @hidden
|
|
164
|
+
*/
|
|
165
|
+
escapeHandler(event) {
|
|
166
|
+
if (!this.host.nativeElement.matches(':focus')) {
|
|
167
|
+
event.stopImmediatePropagation();
|
|
168
|
+
}
|
|
169
|
+
this.internalNavigation = false;
|
|
170
|
+
this.host.nativeElement.focus();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @hidden
|
|
174
|
+
*/
|
|
175
|
+
focusHandler(ev) {
|
|
176
|
+
this.internalNavigation = ev.target !== this.host.nativeElement;
|
|
123
177
|
}
|
|
124
178
|
/**
|
|
125
179
|
* Specifies the value of the initially selected color.
|
|
@@ -180,12 +234,27 @@ export class ColorGradientComponent {
|
|
|
180
234
|
get gradientRect() {
|
|
181
235
|
return this.gradientWrapper.nativeElement.getBoundingClientRect();
|
|
182
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* @hidden
|
|
239
|
+
*/
|
|
240
|
+
get hsvSliderValueText() {
|
|
241
|
+
return `X: ${this.hsvHandleCoordinates.x} Y: ${this.hsvHandleCoordinates.y}`;
|
|
242
|
+
}
|
|
183
243
|
/**
|
|
184
244
|
* @hidden
|
|
185
245
|
*/
|
|
186
246
|
get contrastToolVisible() {
|
|
187
247
|
return this.contrastTool && this.contrastTool.length > 0;
|
|
188
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* @hidden
|
|
251
|
+
*/
|
|
252
|
+
get innerTabIndex() {
|
|
253
|
+
return this.internalNavigation ? 0 : -1;
|
|
254
|
+
}
|
|
255
|
+
ngOnInit() {
|
|
256
|
+
this.control = this.injector.get(NgControl, null);
|
|
257
|
+
}
|
|
189
258
|
ngAfterViewInit() {
|
|
190
259
|
this.updateUI();
|
|
191
260
|
this.cdr.detectChanges();
|
|
@@ -268,18 +337,19 @@ export class ColorGradientComponent {
|
|
|
268
337
|
this.renderer.addClass(this.gradientWrapper.nativeElement, 'k-dragging');
|
|
269
338
|
let keyboardMoveX = 0;
|
|
270
339
|
let keyboardMoveY = 0;
|
|
340
|
+
const shiftKey = args.shiftKey;
|
|
271
341
|
switch (args.key) {
|
|
272
342
|
case 'ArrowRight':
|
|
273
|
-
keyboardMoveX =
|
|
343
|
+
keyboardMoveX = shiftKey ? this.gradientSliderSmallStep : this.gradientSliderStep;
|
|
274
344
|
break;
|
|
275
345
|
case 'ArrowLeft':
|
|
276
|
-
keyboardMoveX = -
|
|
346
|
+
keyboardMoveX = shiftKey ? -this.gradientSliderSmallStep : -this.gradientSliderStep;
|
|
277
347
|
break;
|
|
278
348
|
case 'ArrowUp':
|
|
279
|
-
keyboardMoveY = -
|
|
349
|
+
keyboardMoveY = shiftKey ? -this.gradientSliderSmallStep : -this.gradientSliderStep;
|
|
280
350
|
break;
|
|
281
351
|
case 'ArrowDown':
|
|
282
|
-
keyboardMoveY =
|
|
352
|
+
keyboardMoveY = shiftKey ? this.gradientSliderSmallStep : this.gradientSliderStep;
|
|
283
353
|
break;
|
|
284
354
|
default: break;
|
|
285
355
|
}
|
|
@@ -375,7 +445,7 @@ export class ColorGradientComponent {
|
|
|
375
445
|
*/
|
|
376
446
|
get colorGradientHandleAriaLabel() {
|
|
377
447
|
const parsed = parseColor(this.value, this.format, this.opacity);
|
|
378
|
-
return `${this.value ? parsed : this.localizationService.get('
|
|
448
|
+
return `${this.value ? parsed : this.localizationService.get('colorGradientNoColor')}`;
|
|
379
449
|
}
|
|
380
450
|
/**
|
|
381
451
|
* @hidden
|
|
@@ -427,6 +497,7 @@ export class ColorGradientComponent {
|
|
|
427
497
|
}
|
|
428
498
|
setDragHandleElementPosition(top, left) {
|
|
429
499
|
const dragHandle = this.gradientDragHandle.nativeElement;
|
|
500
|
+
this.hsvHandleCoordinates = { x: left, y: top };
|
|
430
501
|
this.renderer.setStyle(dragHandle, 'top', `${top}px`);
|
|
431
502
|
this.renderer.setStyle(dragHandle, 'left', `${left}px`);
|
|
432
503
|
}
|
|
@@ -499,8 +570,8 @@ export class ColorGradientComponent {
|
|
|
499
570
|
}
|
|
500
571
|
}
|
|
501
572
|
}
|
|
502
|
-
ColorGradientComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColorGradientComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
503
|
-
ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ColorGradientComponent, selector: "kendo-colorgradient", inputs: { id: "id", opacity: "opacity", disabled: "disabled", readonly: "readonly", clearButton: "clearButton", delay: "delay", value: "value", contrastTool: "contrastTool", tabindex: "tabindex", format: "format" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.k-colorgradient": "this.hostClasses", "attr.aria-readonly": "this.readonlyAttribute", "class.k-disabled": "this.disabledClass", "attr.id": "this.gradientId", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabindex" } }, providers: [
|
|
573
|
+
ColorGradientComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColorGradientComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
574
|
+
ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ColorGradientComponent, selector: "kendo-colorgradient", inputs: { id: "id", opacity: "opacity", disabled: "disabled", readonly: "readonly", clearButton: "clearButton", delay: "delay", value: "value", contrastTool: "contrastTool", tabindex: "tabindex", format: "format", gradientSliderStep: "gradientSliderStep", gradientSliderSmallStep: "gradientSliderSmallStep" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown.enter": "enterHandler($event)", "keydown.escape": "escapeHandler($event)", "focusin": "focusHandler($event)" }, properties: { "class.k-colorgradient": "this.hostClasses", "attr.aria-readonly": "this.readonlyAttribute", "class.k-disabled": "this.disabledClass", "attr.id": "this.gradientId", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabindex", "attr.role": "this.ariaRole", "attr.aria-invalid": "this.isControlInvalid", "attr.aria-disabled": "this.isDisabled" } }, providers: [
|
|
504
575
|
{
|
|
505
576
|
multi: true,
|
|
506
577
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -519,7 +590,7 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
519
590
|
provide: L10N_PREFIX,
|
|
520
591
|
useValue: 'kendo.colorgradient'
|
|
521
592
|
}
|
|
522
|
-
], viewQueries: [{ propertyName: "gradientDragHandle", first: true, predicate: ["gradientDragHandle"], descendants: true
|
|
593
|
+
], viewQueries: [{ propertyName: "gradientDragHandle", first: true, predicate: ["gradientDragHandle"], descendants: true }, { propertyName: "inputs", first: true, predicate: ["inputs"], descendants: true }, { propertyName: "alphaSlider", first: true, predicate: ["alphaSlider"], descendants: true }, { propertyName: "gradientWrapper", first: true, predicate: ["gradientWrapper"], descendants: true }, { propertyName: "hsvRectangle", first: true, predicate: ["hsvRectangle"], descendants: true }], exportAs: ["kendoColorGradient"], usesOnChanges: true, ngImport: i0, template: `
|
|
523
594
|
<ng-container kendoColorGradientLocalizedMessages
|
|
524
595
|
i18n-colorGradientNoColor="kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
525
596
|
colorGradientNoColor="Colorgradient no color chosen"
|
|
@@ -538,7 +609,23 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
538
609
|
i18n-contrastRatio="kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool."
|
|
539
610
|
contrastRatio="Contrast ratio"
|
|
540
611
|
i18n-formatButton="kendo.colorgradient.formatButton|The message for the input format toggle button."
|
|
541
|
-
formatButton="Change color format"
|
|
612
|
+
formatButton="Change color format"
|
|
613
|
+
i18n-redChannelLabel="kendo.colorgradient.redChannelLabel|The label of the NumericTextBox representing the red color channel."
|
|
614
|
+
redChannelLabel="Red channel"
|
|
615
|
+
i18n-greenChannelLabel="kendo.colorgradient.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
|
|
616
|
+
greenChannelLabel="Green channel"
|
|
617
|
+
i18n-blueChannelLabel="kendo.colorgradient.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
|
|
618
|
+
blueChannelLabel="Blue channel"
|
|
619
|
+
i18n-alphaChannelLabel="kendo.colorgradient.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
|
|
620
|
+
alphaChannelLabel="Alpha channel"
|
|
621
|
+
i18n-redInputPlaceholder="kendo.colorgradient.redInputPlaceholder|The placeholder for the red color input."
|
|
622
|
+
redChannelLabel="R"
|
|
623
|
+
i18n-greenInputPlaceholder="kendo.colorgradient.greenInputPlaceholder|The placeholder for the green color input."
|
|
624
|
+
greenInputPlaceholder="G"
|
|
625
|
+
i18n-blueInputPlaceholder="kendo.colorgradient.blueInputPlaceholder|The placeholder for the blue color input."
|
|
626
|
+
blueInputPlaceholder="B"
|
|
627
|
+
i18n-hexInputPlaceholder="kendo.colorgradient.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
628
|
+
hexInputPlaceholder="HEX">
|
|
542
629
|
</ng-container>
|
|
543
630
|
<div class="k-colorgradient-canvas k-hstack">
|
|
544
631
|
<div class="k-hsv-rectangle" #hsvRectangle>
|
|
@@ -553,10 +640,16 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
553
640
|
<div
|
|
554
641
|
#gradientDragHandle
|
|
555
642
|
class="k-hsv-draghandle k-draghandle"
|
|
556
|
-
tabindex="
|
|
643
|
+
[tabindex]="innerTabIndex.toString()"
|
|
557
644
|
[attr.title]="colorGradientHandleTitle"
|
|
558
|
-
[attr.aria-label]="colorGradientHandleAriaLabel"
|
|
559
|
-
|
|
645
|
+
[attr.aria-label]="colorGradientHandleTitle + ' ' + colorGradientHandleAriaLabel"
|
|
646
|
+
role="slider"
|
|
647
|
+
[attr.aria-valuetext]="hsvSliderValueText"
|
|
648
|
+
[attr.aria-readonly]="readonly ? readonly : undefined"
|
|
649
|
+
[attr.aria-disabled]="disabled ? disabled : undefined"
|
|
650
|
+
[attr.aria-orientation]="'undefined'"
|
|
651
|
+
[attr.aria-valuenow]="'0'"
|
|
652
|
+
(keydown.shift.tab)="$event.preventDefault(); inputs.focusLast();">
|
|
560
653
|
</div>
|
|
561
654
|
</div>
|
|
562
655
|
<svg kendoColorContrastSvg
|
|
@@ -571,22 +664,24 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
571
664
|
<div class="k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}">
|
|
572
665
|
<span class="k-clear-color k-button k-button-md k-button-flat k-button-flat-base k-button-icon"
|
|
573
666
|
*ngIf="clearButton"
|
|
667
|
+
role="button"
|
|
574
668
|
(click)="reset()"
|
|
575
669
|
(keydown.enter)="reset()"
|
|
576
670
|
(keydown.space)="reset()"
|
|
577
671
|
[attr.aria-label]="clearButtonTitle"
|
|
578
672
|
[attr.title]="clearButtonTitle"
|
|
579
|
-
tabindex="
|
|
673
|
+
[tabindex]="innerTabIndex.toString()">
|
|
580
674
|
<span class="k-icon k-i-droplet-slash"></span>
|
|
581
675
|
</span>
|
|
582
676
|
<kendo-slider
|
|
583
677
|
[ngClass]="{'k-align-self-end': clearButton}"
|
|
584
678
|
class="k-hue-slider k-colorgradient-slider"
|
|
585
679
|
[dragHandleTitle]="hueSliderTitle"
|
|
680
|
+
[tabindex]="innerTabIndex"
|
|
586
681
|
[disabled]="disabled"
|
|
587
682
|
[readonly]="readonly"
|
|
588
683
|
[showButtons]="false"
|
|
589
|
-
|
|
684
|
+
tickPlacement="none"
|
|
590
685
|
[vertical]="true"
|
|
591
686
|
[min]="0"
|
|
592
687
|
[max]="360"
|
|
@@ -599,13 +694,14 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
599
694
|
<kendo-slider
|
|
600
695
|
*ngIf="opacity"
|
|
601
696
|
#alphaSlider
|
|
697
|
+
[tabindex]="innerTabIndex"
|
|
602
698
|
[ngClass]="{'k-align-self-end': clearButton}"
|
|
603
699
|
class="k-alpha-slider k-colorgradient-slider"
|
|
604
700
|
[dragHandleTitle]="opacitySliderTitle"
|
|
605
701
|
[disabled]="disabled"
|
|
606
702
|
[readonly]="readonly"
|
|
607
703
|
[showButtons]="false"
|
|
608
|
-
|
|
704
|
+
tickPlacement="none"
|
|
609
705
|
[vertical]="true"
|
|
610
706
|
[min]="0"
|
|
611
707
|
[max]="100"
|
|
@@ -618,12 +714,14 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
618
714
|
</div>
|
|
619
715
|
</div>
|
|
620
716
|
<kendo-colorinput #inputs
|
|
717
|
+
[tabindex]="innerTabIndex"
|
|
621
718
|
[opacity]="opacity"
|
|
622
719
|
[formatView]="format"
|
|
623
720
|
[value]="value"
|
|
624
721
|
[disabled]="disabled"
|
|
625
722
|
[readonly]="readonly"
|
|
626
723
|
(valueChange)="handleInputsValueChange($event)"
|
|
724
|
+
(tabOut)="gradientDragHandle.focus()"
|
|
627
725
|
>
|
|
628
726
|
</kendo-colorinput>
|
|
629
727
|
<div class="k-colorgradient-color-contrast k-vbox"
|
|
@@ -632,7 +730,7 @@ ColorGradientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
632
730
|
[value]="value"
|
|
633
731
|
[ratio]="contrastTool">
|
|
634
732
|
</div>
|
|
635
|
-
`, isInline: true, styles: ["\n .k-clear-color {\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-colorgradient-slider.k-align-self-end {\n height: 140px;\n }\n\n .k-color-contrast-svg {\n position: absolute;\n overflow: visible;\n pointer-events: none;\n left: 0px;\n top: 0px;\n }\n "], components: [{ type: i2.ColorContrastSvgComponent, selector: "[kendoColorContrastSvg]", inputs: ["wrapper", "hsva", "backgroundColor"] }, { type: i3.SliderComponent, selector: "kendo-slider", inputs: ["focusableId", "dragHandleTitle", "incrementTitle", "animate", "decrementTitle", "showButtons", "value", "tabIndex"], exportAs: ["kendoSlider"] }, { type: i4.ColorInputComponent, selector: "kendo-colorinput", inputs: ["focusableId", "formatView", "value", "opacity", "disabled", "readonly"], outputs: ["valueChange"] }, { type: i5.ContrastComponent, selector: "[kendoContrastTool]", inputs: ["value", "ratio"] }], directives: [{ type: i6.LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { type: i7.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
733
|
+
`, isInline: true, styles: ["\n .k-clear-color {\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-colorgradient-slider.k-align-self-end {\n height: 140px;\n }\n\n .k-color-contrast-svg {\n position: absolute;\n overflow: visible;\n pointer-events: none;\n left: 0px;\n top: 0px;\n }\n "], components: [{ type: i2.ColorContrastSvgComponent, selector: "[kendoColorContrastSvg]", inputs: ["wrapper", "hsva", "backgroundColor"] }, { type: i3.SliderComponent, selector: "kendo-slider", inputs: ["focusableId", "dragHandleTitle", "incrementTitle", "animate", "decrementTitle", "showButtons", "value", "tabIndex"], exportAs: ["kendoSlider"] }, { type: i4.ColorInputComponent, selector: "kendo-colorinput", inputs: ["focusableId", "formatView", "tabindex", "value", "opacity", "disabled", "readonly"], outputs: ["valueChange", "tabOut"] }, { type: i5.ContrastComponent, selector: "[kendoContrastTool]", inputs: ["value", "ratio"] }], directives: [{ type: i6.LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { type: i7.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
636
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColorGradientComponent, decorators: [{
|
|
637
735
|
type: Component,
|
|
638
736
|
args: [{
|
|
@@ -677,7 +775,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
677
775
|
i18n-contrastRatio="kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool."
|
|
678
776
|
contrastRatio="Contrast ratio"
|
|
679
777
|
i18n-formatButton="kendo.colorgradient.formatButton|The message for the input format toggle button."
|
|
680
|
-
formatButton="Change color format"
|
|
778
|
+
formatButton="Change color format"
|
|
779
|
+
i18n-redChannelLabel="kendo.colorgradient.redChannelLabel|The label of the NumericTextBox representing the red color channel."
|
|
780
|
+
redChannelLabel="Red channel"
|
|
781
|
+
i18n-greenChannelLabel="kendo.colorgradient.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
|
|
782
|
+
greenChannelLabel="Green channel"
|
|
783
|
+
i18n-blueChannelLabel="kendo.colorgradient.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
|
|
784
|
+
blueChannelLabel="Blue channel"
|
|
785
|
+
i18n-alphaChannelLabel="kendo.colorgradient.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
|
|
786
|
+
alphaChannelLabel="Alpha channel"
|
|
787
|
+
i18n-redInputPlaceholder="kendo.colorgradient.redInputPlaceholder|The placeholder for the red color input."
|
|
788
|
+
redChannelLabel="R"
|
|
789
|
+
i18n-greenInputPlaceholder="kendo.colorgradient.greenInputPlaceholder|The placeholder for the green color input."
|
|
790
|
+
greenInputPlaceholder="G"
|
|
791
|
+
i18n-blueInputPlaceholder="kendo.colorgradient.blueInputPlaceholder|The placeholder for the blue color input."
|
|
792
|
+
blueInputPlaceholder="B"
|
|
793
|
+
i18n-hexInputPlaceholder="kendo.colorgradient.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
794
|
+
hexInputPlaceholder="HEX">
|
|
681
795
|
</ng-container>
|
|
682
796
|
<div class="k-colorgradient-canvas k-hstack">
|
|
683
797
|
<div class="k-hsv-rectangle" #hsvRectangle>
|
|
@@ -692,10 +806,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
692
806
|
<div
|
|
693
807
|
#gradientDragHandle
|
|
694
808
|
class="k-hsv-draghandle k-draghandle"
|
|
695
|
-
tabindex="
|
|
809
|
+
[tabindex]="innerTabIndex.toString()"
|
|
696
810
|
[attr.title]="colorGradientHandleTitle"
|
|
697
|
-
[attr.aria-label]="colorGradientHandleAriaLabel"
|
|
698
|
-
|
|
811
|
+
[attr.aria-label]="colorGradientHandleTitle + ' ' + colorGradientHandleAriaLabel"
|
|
812
|
+
role="slider"
|
|
813
|
+
[attr.aria-valuetext]="hsvSliderValueText"
|
|
814
|
+
[attr.aria-readonly]="readonly ? readonly : undefined"
|
|
815
|
+
[attr.aria-disabled]="disabled ? disabled : undefined"
|
|
816
|
+
[attr.aria-orientation]="'undefined'"
|
|
817
|
+
[attr.aria-valuenow]="'0'"
|
|
818
|
+
(keydown.shift.tab)="$event.preventDefault(); inputs.focusLast();">
|
|
699
819
|
</div>
|
|
700
820
|
</div>
|
|
701
821
|
<svg kendoColorContrastSvg
|
|
@@ -710,22 +830,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
710
830
|
<div class="k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}">
|
|
711
831
|
<span class="k-clear-color k-button k-button-md k-button-flat k-button-flat-base k-button-icon"
|
|
712
832
|
*ngIf="clearButton"
|
|
833
|
+
role="button"
|
|
713
834
|
(click)="reset()"
|
|
714
835
|
(keydown.enter)="reset()"
|
|
715
836
|
(keydown.space)="reset()"
|
|
716
837
|
[attr.aria-label]="clearButtonTitle"
|
|
717
838
|
[attr.title]="clearButtonTitle"
|
|
718
|
-
tabindex="
|
|
839
|
+
[tabindex]="innerTabIndex.toString()">
|
|
719
840
|
<span class="k-icon k-i-droplet-slash"></span>
|
|
720
841
|
</span>
|
|
721
842
|
<kendo-slider
|
|
722
843
|
[ngClass]="{'k-align-self-end': clearButton}"
|
|
723
844
|
class="k-hue-slider k-colorgradient-slider"
|
|
724
845
|
[dragHandleTitle]="hueSliderTitle"
|
|
846
|
+
[tabindex]="innerTabIndex"
|
|
725
847
|
[disabled]="disabled"
|
|
726
848
|
[readonly]="readonly"
|
|
727
849
|
[showButtons]="false"
|
|
728
|
-
|
|
850
|
+
tickPlacement="none"
|
|
729
851
|
[vertical]="true"
|
|
730
852
|
[min]="0"
|
|
731
853
|
[max]="360"
|
|
@@ -738,13 +860,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
738
860
|
<kendo-slider
|
|
739
861
|
*ngIf="opacity"
|
|
740
862
|
#alphaSlider
|
|
863
|
+
[tabindex]="innerTabIndex"
|
|
741
864
|
[ngClass]="{'k-align-self-end': clearButton}"
|
|
742
865
|
class="k-alpha-slider k-colorgradient-slider"
|
|
743
866
|
[dragHandleTitle]="opacitySliderTitle"
|
|
744
867
|
[disabled]="disabled"
|
|
745
868
|
[readonly]="readonly"
|
|
746
869
|
[showButtons]="false"
|
|
747
|
-
|
|
870
|
+
tickPlacement="none"
|
|
748
871
|
[vertical]="true"
|
|
749
872
|
[min]="0"
|
|
750
873
|
[max]="100"
|
|
@@ -757,12 +880,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
757
880
|
</div>
|
|
758
881
|
</div>
|
|
759
882
|
<kendo-colorinput #inputs
|
|
883
|
+
[tabindex]="innerTabIndex"
|
|
760
884
|
[opacity]="opacity"
|
|
761
885
|
[formatView]="format"
|
|
762
886
|
[value]="value"
|
|
763
887
|
[disabled]="disabled"
|
|
764
888
|
[readonly]="readonly"
|
|
765
889
|
(valueChange)="handleInputsValueChange($event)"
|
|
890
|
+
(tabOut)="gradientDragHandle.focus()"
|
|
766
891
|
>
|
|
767
892
|
</kendo-colorinput>
|
|
768
893
|
<div class="k-colorgradient-color-contrast k-vbox"
|
|
@@ -792,7 +917,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
792
917
|
}
|
|
793
918
|
`]
|
|
794
919
|
}]
|
|
795
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }]; }, propDecorators: { hostClasses: [{
|
|
920
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.Injector }]; }, propDecorators: { hostClasses: [{
|
|
796
921
|
type: HostBinding,
|
|
797
922
|
args: ['class.k-colorgradient']
|
|
798
923
|
}], readonlyAttribute: [{
|
|
@@ -810,6 +935,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
810
935
|
}], hostTabindex: [{
|
|
811
936
|
type: HostBinding,
|
|
812
937
|
args: ['attr.tabindex']
|
|
938
|
+
}], ariaRole: [{
|
|
939
|
+
type: HostBinding,
|
|
940
|
+
args: ['attr.role']
|
|
941
|
+
}], isControlInvalid: [{
|
|
942
|
+
type: HostBinding,
|
|
943
|
+
args: ['attr.aria-invalid']
|
|
944
|
+
}], isDisabled: [{
|
|
945
|
+
type: HostBinding,
|
|
946
|
+
args: ['attr.aria-disabled']
|
|
947
|
+
}], enterHandler: [{
|
|
948
|
+
type: HostListener,
|
|
949
|
+
args: ['keydown.enter', ['$event']]
|
|
950
|
+
}], escapeHandler: [{
|
|
951
|
+
type: HostListener,
|
|
952
|
+
args: ['keydown.escape', ['$event']]
|
|
953
|
+
}], focusHandler: [{
|
|
954
|
+
type: HostListener,
|
|
955
|
+
args: ['focusin', ['$event']]
|
|
813
956
|
}], id: [{
|
|
814
957
|
type: Input
|
|
815
958
|
}], opacity: [{
|
|
@@ -832,19 +975,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
832
975
|
type: Input
|
|
833
976
|
}], valueChange: [{
|
|
834
977
|
type: Output
|
|
978
|
+
}], gradientSliderStep: [{
|
|
979
|
+
type: Input
|
|
980
|
+
}], gradientSliderSmallStep: [{
|
|
981
|
+
type: Input
|
|
835
982
|
}], gradientDragHandle: [{
|
|
836
983
|
type: ViewChild,
|
|
837
|
-
args: ['gradientDragHandle'
|
|
984
|
+
args: ['gradientDragHandle']
|
|
838
985
|
}], inputs: [{
|
|
839
986
|
type: ViewChild,
|
|
840
|
-
args: ['inputs'
|
|
987
|
+
args: ['inputs']
|
|
841
988
|
}], alphaSlider: [{
|
|
842
989
|
type: ViewChild,
|
|
843
|
-
args: ['alphaSlider'
|
|
990
|
+
args: ['alphaSlider']
|
|
844
991
|
}], gradientWrapper: [{
|
|
845
992
|
type: ViewChild,
|
|
846
|
-
args: ['gradientWrapper'
|
|
993
|
+
args: ['gradientWrapper']
|
|
847
994
|
}], hsvRectangle: [{
|
|
848
995
|
type: ViewChild,
|
|
849
|
-
args: ['hsvRectangle'
|
|
996
|
+
args: ['hsvRectangle']
|
|
850
997
|
}] } });
|