@progress/kendo-angular-inputs 18.1.0-develop.29 → 18.1.0-develop.3
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/colorpicker/color-gradient.component.d.ts +1 -19
- package/colorpicker/color-input.component.d.ts +3 -15
- package/colorpicker/color-palette.component.d.ts +6 -16
- package/colorpicker/colorpicker.component.d.ts +8 -55
- package/colorpicker/flatcolorpicker-actions.component.d.ts +1 -3
- package/colorpicker/flatcolorpicker-header.component.d.ts +1 -3
- package/colorpicker/flatcolorpicker.component.d.ts +1 -19
- package/colorpicker/localization/messages.d.ts +1 -9
- package/esm2022/colorpicker/color-gradient.component.mjs +17 -75
- package/esm2022/colorpicker/color-input.component.mjs +23 -56
- package/esm2022/colorpicker/color-palette.component.mjs +15 -45
- package/esm2022/colorpicker/colorpicker.component.mjs +41 -182
- package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +7 -22
- package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +3 -8
- package/esm2022/colorpicker/flatcolorpicker.component.mjs +17 -72
- package/esm2022/colorpicker/localization/messages.mjs +1 -13
- package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +3 -3
- package/esm2022/colorpicker.module.mjs +2 -3
- package/esm2022/inputs.module.mjs +2 -3
- package/esm2022/otpinput/otpinput.component.mjs +45 -75
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-inputs.mjs +3092 -3765
- package/otpinput/models/separator-icon.d.ts +3 -9
- package/otpinput/otpinput.component.d.ts +7 -4
- package/package.json +11 -13
- package/colorpicker/adaptiveness/adaptive-close-button.component.d.ts +0 -20
- package/colorpicker/adaptiveness/adaptive-renderer.component.d.ts +0 -38
- package/colorpicker/color-gradient-text-label.directive.d.ts +0 -19
- package/colorpicker/models/adaptive-mode.d.ts +0 -23
- package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
- package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -205
- package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
- package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -27
|
@@ -12,7 +12,7 @@ import { DraggableDirective, isChanged, isDocumentAvailable, KendoInput } from '
|
|
|
12
12
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
13
|
import { containsFocus, isUntouched } from '../common/dom-utils';
|
|
14
14
|
import { parseColor, getHSV, getColorFromHSV, getColorFromHue } from './utils';
|
|
15
|
-
import { isPresent, fitIntoBounds
|
|
15
|
+
import { isPresent, fitIntoBounds } from '../common/utils';
|
|
16
16
|
import { SliderComponent } from '../slider/slider.component';
|
|
17
17
|
import { ColorGradientLocalizationService } from './localization/colorgradient-localization.service';
|
|
18
18
|
import { ColorInputComponent } from './color-input.component';
|
|
@@ -27,7 +27,6 @@ import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
|
27
27
|
import * as i0 from "@angular/core";
|
|
28
28
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
29
29
|
let serial = 0;
|
|
30
|
-
const DEFAULT_SIZE = 'medium';
|
|
31
30
|
/**
|
|
32
31
|
* The ColorGradient component enables smooth color transitions and provides options for selecting specific colors over the drag handle.
|
|
33
32
|
* The ColorGradient is independently used by `kendo-colorpicker` and can be directly added to the page.
|
|
@@ -86,10 +85,6 @@ export class ColorGradientComponent {
|
|
|
86
85
|
focusHandler(ev) {
|
|
87
86
|
this.internalNavigation = ev.target !== this.host.nativeElement;
|
|
88
87
|
}
|
|
89
|
-
/**
|
|
90
|
-
* @hidden
|
|
91
|
-
*/
|
|
92
|
-
adaptiveMode = false;
|
|
93
88
|
/**
|
|
94
89
|
* @hidden
|
|
95
90
|
*/
|
|
@@ -100,23 +95,6 @@ export class ColorGradientComponent {
|
|
|
100
95
|
* @default true
|
|
101
96
|
*/
|
|
102
97
|
opacity = true;
|
|
103
|
-
/**
|
|
104
|
-
* The size property specifies the padding of the ColorGradient internal elements.
|
|
105
|
-
*
|
|
106
|
-
* The possible values are:
|
|
107
|
-
* * `small`
|
|
108
|
-
* * `medium` (default)
|
|
109
|
-
* * `large`
|
|
110
|
-
* * `none`
|
|
111
|
-
*/
|
|
112
|
-
set size(size) {
|
|
113
|
-
const newSize = size || DEFAULT_SIZE;
|
|
114
|
-
this.handleClasses(newSize, 'size');
|
|
115
|
-
this._size = newSize;
|
|
116
|
-
}
|
|
117
|
-
get size() {
|
|
118
|
-
return this._size;
|
|
119
|
-
}
|
|
120
98
|
/**
|
|
121
99
|
* Sets the disabled state of the ColorGradient. To learn how to disable the component in reactive forms, refer to the article on [Forms Support](slug:formssupport_colorgradient#toc-managing-the-colorgradient-disabled-state-in-reactive-forms).
|
|
122
100
|
*
|
|
@@ -254,7 +232,6 @@ export class ColorGradientComponent {
|
|
|
254
232
|
listeners = [];
|
|
255
233
|
hueSliderTouched = false;
|
|
256
234
|
alphaSliderTouched = false;
|
|
257
|
-
_size = 'medium';
|
|
258
235
|
updateValues = new Subject();
|
|
259
236
|
changeRequestsSubscription;
|
|
260
237
|
dynamicRTLSubscription;
|
|
@@ -297,10 +274,6 @@ export class ColorGradientComponent {
|
|
|
297
274
|
this.control = this.injector.get(NgControl, null);
|
|
298
275
|
}
|
|
299
276
|
ngAfterViewInit() {
|
|
300
|
-
const stylingInputs = ['size'];
|
|
301
|
-
stylingInputs.forEach(input => {
|
|
302
|
-
this.handleClasses(this[input], input);
|
|
303
|
-
});
|
|
304
277
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
305
278
|
this.updateUI();
|
|
306
279
|
this.cdr.detectChanges();
|
|
@@ -554,7 +527,7 @@ export class ColorGradientComponent {
|
|
|
554
527
|
return;
|
|
555
528
|
}
|
|
556
529
|
const sliderTrack = this.alphaSlider.track.nativeElement;
|
|
557
|
-
this.renderer.setStyle(sliderTrack, 'background', `linear-gradient(to
|
|
530
|
+
this.renderer.setStyle(sliderTrack, 'background', `linear-gradient(to top, transparent, ${backgroundColor})`);
|
|
558
531
|
}
|
|
559
532
|
setHostElementAriaLabel() {
|
|
560
533
|
const parsed = parseColor(this.value, this.format, this.opacity);
|
|
@@ -617,18 +590,8 @@ export class ColorGradientComponent {
|
|
|
617
590
|
this.changeRequestsSubscription.unsubscribe();
|
|
618
591
|
}
|
|
619
592
|
}
|
|
620
|
-
handleClasses(value, input) {
|
|
621
|
-
const elem = this.host.nativeElement;
|
|
622
|
-
const classes = getStylingClasses('colorgradient', input, this[input], value);
|
|
623
|
-
if (classes.toRemove) {
|
|
624
|
-
this.renderer.removeClass(elem, classes.toRemove);
|
|
625
|
-
}
|
|
626
|
-
if (classes.toAdd) {
|
|
627
|
-
this.renderer.addClass(elem, classes.toAdd);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
593
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", 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 });
|
|
631
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorGradientComponent, isStandalone: true, selector: "kendo-colorgradient", inputs: {
|
|
594
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorGradientComponent, isStandalone: true, 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", "class.k-colorgradient-md": "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", "class.k-readonly": "this.readonly" } }, providers: [
|
|
632
595
|
{
|
|
633
596
|
multi: true,
|
|
634
597
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -684,11 +647,7 @@ export class ColorGradientComponent {
|
|
|
684
647
|
i18n-hexInputPlaceholder="kendo.colorgradient.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
685
648
|
hexInputPlaceholder="HEX">
|
|
686
649
|
</ng-container>
|
|
687
|
-
<div
|
|
688
|
-
'k-colorgradient-canvas': true,
|
|
689
|
-
'k-vstack': adaptiveMode,
|
|
690
|
-
'k-hstack': !adaptiveMode
|
|
691
|
-
}">
|
|
650
|
+
<div class="k-colorgradient-canvas k-hstack">
|
|
692
651
|
<div class="k-hsv-rectangle" #hsvRectangle>
|
|
693
652
|
<div
|
|
694
653
|
#gradientWrapper
|
|
@@ -724,12 +683,8 @@ export class ColorGradientComponent {
|
|
|
724
683
|
[style]="'position: absolute; overflow: visible; pointer-events: none; left: 0px; top: 0px;'">
|
|
725
684
|
</svg>
|
|
726
685
|
</div>
|
|
727
|
-
<div
|
|
728
|
-
|
|
729
|
-
'k-sliders-wrap-clearable': clearButton,
|
|
730
|
-
'k-vstack': adaptiveMode,
|
|
731
|
-
'k-hstack': !adaptiveMode
|
|
732
|
-
}">
|
|
686
|
+
<div class="k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}">
|
|
687
|
+
|
|
733
688
|
<button
|
|
734
689
|
kendoButton
|
|
735
690
|
*ngIf="clearButton"
|
|
@@ -737,7 +692,6 @@ export class ColorGradientComponent {
|
|
|
737
692
|
fillMode="flat"
|
|
738
693
|
icon="droplet-slash"
|
|
739
694
|
[svgIcon]="dropletSlashIcon"
|
|
740
|
-
[size]="size"
|
|
741
695
|
(click)="reset()"
|
|
742
696
|
(keydown.enter)="reset()"
|
|
743
697
|
(keydown.space)="reset()"
|
|
@@ -757,7 +711,7 @@ export class ColorGradientComponent {
|
|
|
757
711
|
[readonly]="readonly"
|
|
758
712
|
[showButtons]="false"
|
|
759
713
|
tickPlacement="none"
|
|
760
|
-
[vertical]="
|
|
714
|
+
[vertical]="true"
|
|
761
715
|
[min]="0"
|
|
762
716
|
[max]="360"
|
|
763
717
|
[value]="hsva.value.h"
|
|
@@ -778,7 +732,7 @@ export class ColorGradientComponent {
|
|
|
778
732
|
[readonly]="readonly"
|
|
779
733
|
[showButtons]="false"
|
|
780
734
|
tickPlacement="none"
|
|
781
|
-
[vertical]="
|
|
735
|
+
[vertical]="true"
|
|
782
736
|
[min]="0"
|
|
783
737
|
[max]="100"
|
|
784
738
|
[smallStep]="1"
|
|
@@ -792,7 +746,6 @@ export class ColorGradientComponent {
|
|
|
792
746
|
<kendo-colorinput #inputs
|
|
793
747
|
[tabindex]="innerTabIndex"
|
|
794
748
|
[opacity]="opacity"
|
|
795
|
-
[size]="size"
|
|
796
749
|
[formatView]="format"
|
|
797
750
|
[value]="value"
|
|
798
751
|
[disabled]="disabled"
|
|
@@ -807,7 +760,7 @@ export class ColorGradientComponent {
|
|
|
807
760
|
[value]="value"
|
|
808
761
|
[ratio]="contrastTool">
|
|
809
762
|
</div>
|
|
810
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ColorContrastSvgComponent, selector: "[kendoColorContrastSvg]", inputs: ["wrapper", "hsva", "backgroundColor"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: SliderComponent, selector: "kendo-slider", inputs: ["focusableId", "dragHandleTitle", "incrementTitle", "animate", "decrementTitle", "showButtons", "value", "tabIndex"], exportAs: ["kendoSlider"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ColorInputComponent, selector: "kendo-colorinput", inputs: ["focusableId", "formatView", "
|
|
763
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ColorContrastSvgComponent, selector: "[kendoColorContrastSvg]", inputs: ["wrapper", "hsva", "backgroundColor"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: SliderComponent, selector: "kendo-slider", inputs: ["focusableId", "dragHandleTitle", "incrementTitle", "animate", "decrementTitle", "showButtons", "value", "tabIndex"], exportAs: ["kendoSlider"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ColorInputComponent, selector: "kendo-colorinput", inputs: ["focusableId", "formatView", "tabindex", "value", "opacity", "disabled", "readonly"], outputs: ["valueChange", "tabOut"] }, { kind: "component", type: ContrastComponent, selector: "[kendoContrastTool]", inputs: ["value", "ratio"] }] });
|
|
811
764
|
}
|
|
812
765
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorGradientComponent, decorators: [{
|
|
813
766
|
type: Component,
|
|
@@ -871,11 +824,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
871
824
|
i18n-hexInputPlaceholder="kendo.colorgradient.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
872
825
|
hexInputPlaceholder="HEX">
|
|
873
826
|
</ng-container>
|
|
874
|
-
<div
|
|
875
|
-
'k-colorgradient-canvas': true,
|
|
876
|
-
'k-vstack': adaptiveMode,
|
|
877
|
-
'k-hstack': !adaptiveMode
|
|
878
|
-
}">
|
|
827
|
+
<div class="k-colorgradient-canvas k-hstack">
|
|
879
828
|
<div class="k-hsv-rectangle" #hsvRectangle>
|
|
880
829
|
<div
|
|
881
830
|
#gradientWrapper
|
|
@@ -911,12 +860,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
911
860
|
[style]="'position: absolute; overflow: visible; pointer-events: none; left: 0px; top: 0px;'">
|
|
912
861
|
</svg>
|
|
913
862
|
</div>
|
|
914
|
-
<div
|
|
915
|
-
|
|
916
|
-
'k-sliders-wrap-clearable': clearButton,
|
|
917
|
-
'k-vstack': adaptiveMode,
|
|
918
|
-
'k-hstack': !adaptiveMode
|
|
919
|
-
}">
|
|
863
|
+
<div class="k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}">
|
|
864
|
+
|
|
920
865
|
<button
|
|
921
866
|
kendoButton
|
|
922
867
|
*ngIf="clearButton"
|
|
@@ -924,7 +869,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
924
869
|
fillMode="flat"
|
|
925
870
|
icon="droplet-slash"
|
|
926
871
|
[svgIcon]="dropletSlashIcon"
|
|
927
|
-
[size]="size"
|
|
928
872
|
(click)="reset()"
|
|
929
873
|
(keydown.enter)="reset()"
|
|
930
874
|
(keydown.space)="reset()"
|
|
@@ -944,7 +888,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
944
888
|
[readonly]="readonly"
|
|
945
889
|
[showButtons]="false"
|
|
946
890
|
tickPlacement="none"
|
|
947
|
-
[vertical]="
|
|
891
|
+
[vertical]="true"
|
|
948
892
|
[min]="0"
|
|
949
893
|
[max]="360"
|
|
950
894
|
[value]="hsva.value.h"
|
|
@@ -965,7 +909,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
965
909
|
[readonly]="readonly"
|
|
966
910
|
[showButtons]="false"
|
|
967
911
|
tickPlacement="none"
|
|
968
|
-
[vertical]="
|
|
912
|
+
[vertical]="true"
|
|
969
913
|
[min]="0"
|
|
970
914
|
[max]="100"
|
|
971
915
|
[smallStep]="1"
|
|
@@ -979,7 +923,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
979
923
|
<kendo-colorinput #inputs
|
|
980
924
|
[tabindex]="innerTabIndex"
|
|
981
925
|
[opacity]="opacity"
|
|
982
|
-
[size]="size"
|
|
983
926
|
[formatView]="format"
|
|
984
927
|
[value]="value"
|
|
985
928
|
[disabled]="disabled"
|
|
@@ -1001,6 +944,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1001
944
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.Injector }]; }, propDecorators: { hostClasses: [{
|
|
1002
945
|
type: HostBinding,
|
|
1003
946
|
args: ['class.k-colorgradient']
|
|
947
|
+
}, {
|
|
948
|
+
type: HostBinding,
|
|
949
|
+
args: ['class.k-colorgradient-md']
|
|
1004
950
|
}], readonlyAttribute: [{
|
|
1005
951
|
type: HostBinding,
|
|
1006
952
|
args: ['attr.aria-readonly']
|
|
@@ -1034,14 +980,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1034
980
|
}], focusHandler: [{
|
|
1035
981
|
type: HostListener,
|
|
1036
982
|
args: ['focusin', ['$event']]
|
|
1037
|
-
}], adaptiveMode: [{
|
|
1038
|
-
type: Input
|
|
1039
983
|
}], id: [{
|
|
1040
984
|
type: Input
|
|
1041
985
|
}], opacity: [{
|
|
1042
986
|
type: Input
|
|
1043
|
-
}], size: [{
|
|
1044
|
-
type: Input
|
|
1045
987
|
}], disabled: [{
|
|
1046
988
|
type: Input
|
|
1047
989
|
}], readonly: [{
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
-
import { Component, Input, Output, EventEmitter, ElementRef, HostBinding, ViewChild, Renderer2
|
|
6
|
+
import { Component, Input, Output, EventEmitter, ElementRef, HostBinding, ViewChild, Renderer2 } from '@angular/core';
|
|
7
7
|
import { getRGBA, parseColor, getColorFromRGBA } from './utils';
|
|
8
8
|
import { isPresent } from '../common/utils';
|
|
9
9
|
import { guid, isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
@@ -14,18 +14,14 @@ import { caretAltExpandIcon } from '@progress/kendo-svg-icons';
|
|
|
14
14
|
import { NumericLabelDirective } from './color-gradient-numeric-label.directive';
|
|
15
15
|
import { NgIf } from '@angular/common';
|
|
16
16
|
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
17
|
-
import { TextBoxComponent } from '../textbox/textbox.component';
|
|
18
|
-
import { TextLabelDirective } from './color-gradient-text-label.directive';
|
|
19
17
|
import * as i0 from "@angular/core";
|
|
20
18
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
21
|
-
const DEFAULT_SIZE = 'medium';
|
|
22
19
|
/**
|
|
23
20
|
* @hidden
|
|
24
21
|
*/
|
|
25
22
|
export class ColorInputComponent {
|
|
26
23
|
host;
|
|
27
24
|
renderer;
|
|
28
|
-
cdr;
|
|
29
25
|
localizationService;
|
|
30
26
|
/**
|
|
31
27
|
* The id of the hex input.
|
|
@@ -35,16 +31,6 @@ export class ColorInputComponent {
|
|
|
35
31
|
* The color format view.
|
|
36
32
|
*/
|
|
37
33
|
formatView;
|
|
38
|
-
/**
|
|
39
|
-
* The size property specifies the padding of the ColorInput.
|
|
40
|
-
*
|
|
41
|
-
* The possible values are:
|
|
42
|
-
* * `small`
|
|
43
|
-
* * `medium` (default)
|
|
44
|
-
* * `large`
|
|
45
|
-
* * `none`
|
|
46
|
-
*/
|
|
47
|
-
size = DEFAULT_SIZE;
|
|
48
34
|
/**
|
|
49
35
|
* The inputs tabindex.
|
|
50
36
|
*/
|
|
@@ -110,10 +96,9 @@ export class ColorInputComponent {
|
|
|
110
96
|
*/
|
|
111
97
|
caretAltExpandIcon = caretAltExpandIcon;
|
|
112
98
|
subscriptions = new Subscription();
|
|
113
|
-
constructor(host, renderer,
|
|
99
|
+
constructor(host, renderer, localizationService) {
|
|
114
100
|
this.host = host;
|
|
115
101
|
this.renderer = renderer;
|
|
116
|
-
this.cdr = cdr;
|
|
117
102
|
this.localizationService = localizationService;
|
|
118
103
|
}
|
|
119
104
|
ngAfterViewInit() {
|
|
@@ -177,8 +162,6 @@ export class ColorInputComponent {
|
|
|
177
162
|
}
|
|
178
163
|
toggleFormatView() {
|
|
179
164
|
this.formatView = this.formatView === 'hex' ? 'rgba' : 'hex';
|
|
180
|
-
// needed to update the view when ChangeDetectionStrategy.OnPush
|
|
181
|
-
this.cdr.markForCheck();
|
|
182
165
|
}
|
|
183
166
|
initDomEvents() {
|
|
184
167
|
if (!this.host) {
|
|
@@ -189,8 +172,8 @@ export class ColorInputComponent {
|
|
|
189
172
|
lastInput() {
|
|
190
173
|
return this.hexInput?.nativeElement || this.opacityInput || this.blueInput;
|
|
191
174
|
}
|
|
192
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token:
|
|
193
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorInputComponent, isStandalone: true, selector: "kendo-colorinput", inputs: { focusableId: "focusableId", formatView: "formatView",
|
|
175
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
176
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorInputComponent, isStandalone: true, selector: "kendo-colorinput", inputs: { focusableId: "focusableId", formatView: "formatView", tabindex: "tabindex", value: "value", opacity: "opacity", disabled: "disabled", readonly: "readonly" }, outputs: { valueChange: "valueChange", tabOut: "tabOut" }, host: { properties: { "class.k-colorgradient-inputs": "this.colorInputClass", "class.k-hstack": "this.colorInputClass" } }, viewQueries: [{ propertyName: "opacityInput", first: true, predicate: ["opacityInput"], descendants: true }, { propertyName: "hexInput", first: true, predicate: ["hexInput"], descendants: true }, { propertyName: "blueInput", first: true, predicate: ["blue"], descendants: true }, { propertyName: "toggleFormatButton", first: true, predicate: ["toggleFormatButton"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: `
|
|
194
177
|
<div class="k-vstack">
|
|
195
178
|
<button
|
|
196
179
|
kendoButton
|
|
@@ -199,7 +182,6 @@ export class ColorInputComponent {
|
|
|
199
182
|
#toggleFormatButton
|
|
200
183
|
icon="caret-alt-expand"
|
|
201
184
|
[svgIcon]="caretAltExpandIcon"
|
|
202
|
-
[size]="size"
|
|
203
185
|
class="k-colorgradient-toggle-mode"
|
|
204
186
|
[attr.aria-label]="formatButtonTitle"
|
|
205
187
|
[attr.title]="formatButtonTitle"
|
|
@@ -208,22 +190,20 @@ export class ColorInputComponent {
|
|
|
208
190
|
>
|
|
209
191
|
</button>
|
|
210
192
|
</div>
|
|
211
|
-
<div *ngIf="formatView === 'hex'" class="k-vstack
|
|
212
|
-
<
|
|
193
|
+
<div *ngIf="formatView === 'hex'" class="k-vstack">
|
|
194
|
+
<input
|
|
213
195
|
#hexInput
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
class="k-hex-value"
|
|
217
|
-
[size]="size"
|
|
196
|
+
[id]="focusableId"
|
|
197
|
+
class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"
|
|
218
198
|
[class.k-readonly]="readonly"
|
|
219
199
|
[disabled]="disabled"
|
|
220
200
|
[readonly]="readonly"
|
|
221
201
|
[value]="hex || ''"
|
|
222
202
|
(blur)="handleHexInputBlur()"
|
|
223
203
|
(input)="handleHexValueChange(hexInput.value)"
|
|
224
|
-
[tabindex]="tabindex"
|
|
225
|
-
(keydown.tab)="focusDragHandle($event)"
|
|
226
|
-
|
|
204
|
+
[tabindex]="tabindex.toString()"
|
|
205
|
+
(keydown.tab)="focusDragHandle($event)"
|
|
206
|
+
/>
|
|
227
207
|
<label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>
|
|
228
208
|
</div>
|
|
229
209
|
<ng-container *ngIf="formatView === 'rgba'">
|
|
@@ -233,7 +213,6 @@ export class ColorInputComponent {
|
|
|
233
213
|
kendoAdditionalNumericLabel="red"
|
|
234
214
|
[localizationService]="localizationService"
|
|
235
215
|
[disabled]="disabled"
|
|
236
|
-
[size]="size"
|
|
237
216
|
[readonly]="readonly"
|
|
238
217
|
[tabindex]="tabindex"
|
|
239
218
|
[min]="0"
|
|
@@ -256,7 +235,6 @@ export class ColorInputComponent {
|
|
|
256
235
|
[disabled]="disabled"
|
|
257
236
|
[readonly]="readonly"
|
|
258
237
|
[tabindex]="tabindex"
|
|
259
|
-
[size]="size"
|
|
260
238
|
[min]="0"
|
|
261
239
|
[max]="255"
|
|
262
240
|
[(value)]="rgba.g"
|
|
@@ -277,7 +255,6 @@ export class ColorInputComponent {
|
|
|
277
255
|
[disabled]="disabled"
|
|
278
256
|
[readonly]="readonly"
|
|
279
257
|
[tabindex]="tabindex"
|
|
280
|
-
[size]="size"
|
|
281
258
|
[min]="0"
|
|
282
259
|
[max]="255"
|
|
283
260
|
[(value)]="rgba.b"
|
|
@@ -292,14 +269,13 @@ export class ColorInputComponent {
|
|
|
292
269
|
<label [for]="blue.focusableId" class="k-colorgradient-input-label">B</label>
|
|
293
270
|
</div>
|
|
294
271
|
<div class="k-vstack" *ngIf="opacity">
|
|
295
|
-
<kendo-numerictextbox
|
|
272
|
+
<kendo-numerictextbox #opacityInput
|
|
296
273
|
#alpha
|
|
297
274
|
kendoAdditionalNumericLabel="alpha"
|
|
298
275
|
[localizationService]="localizationService"
|
|
299
276
|
[disabled]="disabled"
|
|
300
277
|
[readonly]="readonly"
|
|
301
278
|
[tabindex]="tabindex"
|
|
302
|
-
[size]="size"
|
|
303
279
|
[min]="0"
|
|
304
280
|
[max]="1"
|
|
305
281
|
[(value)]="rgba.a"
|
|
@@ -315,7 +291,7 @@ export class ColorInputComponent {
|
|
|
315
291
|
<label [for]="alpha.focusableId" class="k-colorgradient-input-label">A</label>
|
|
316
292
|
</div>
|
|
317
293
|
</ng-container>
|
|
318
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "directive", type: NumericLabelDirective, selector: "[kendoAdditionalNumericLabel]", inputs: ["kendoAdditionalNumericLabel", "localizationService"] }
|
|
294
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "directive", type: NumericLabelDirective, selector: "[kendoAdditionalNumericLabel]", inputs: ["kendoAdditionalNumericLabel", "localizationService"] }] });
|
|
319
295
|
}
|
|
320
296
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorInputComponent, decorators: [{
|
|
321
297
|
type: Component,
|
|
@@ -330,7 +306,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
330
306
|
#toggleFormatButton
|
|
331
307
|
icon="caret-alt-expand"
|
|
332
308
|
[svgIcon]="caretAltExpandIcon"
|
|
333
|
-
[size]="size"
|
|
334
309
|
class="k-colorgradient-toggle-mode"
|
|
335
310
|
[attr.aria-label]="formatButtonTitle"
|
|
336
311
|
[attr.title]="formatButtonTitle"
|
|
@@ -339,22 +314,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
339
314
|
>
|
|
340
315
|
</button>
|
|
341
316
|
</div>
|
|
342
|
-
<div *ngIf="formatView === 'hex'" class="k-vstack
|
|
343
|
-
<
|
|
317
|
+
<div *ngIf="formatView === 'hex'" class="k-vstack">
|
|
318
|
+
<input
|
|
344
319
|
#hexInput
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
class="k-hex-value"
|
|
348
|
-
[size]="size"
|
|
320
|
+
[id]="focusableId"
|
|
321
|
+
class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"
|
|
349
322
|
[class.k-readonly]="readonly"
|
|
350
323
|
[disabled]="disabled"
|
|
351
324
|
[readonly]="readonly"
|
|
352
325
|
[value]="hex || ''"
|
|
353
326
|
(blur)="handleHexInputBlur()"
|
|
354
327
|
(input)="handleHexValueChange(hexInput.value)"
|
|
355
|
-
[tabindex]="tabindex"
|
|
356
|
-
(keydown.tab)="focusDragHandle($event)"
|
|
357
|
-
|
|
328
|
+
[tabindex]="tabindex.toString()"
|
|
329
|
+
(keydown.tab)="focusDragHandle($event)"
|
|
330
|
+
/>
|
|
358
331
|
<label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>
|
|
359
332
|
</div>
|
|
360
333
|
<ng-container *ngIf="formatView === 'rgba'">
|
|
@@ -364,7 +337,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
364
337
|
kendoAdditionalNumericLabel="red"
|
|
365
338
|
[localizationService]="localizationService"
|
|
366
339
|
[disabled]="disabled"
|
|
367
|
-
[size]="size"
|
|
368
340
|
[readonly]="readonly"
|
|
369
341
|
[tabindex]="tabindex"
|
|
370
342
|
[min]="0"
|
|
@@ -387,7 +359,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
387
359
|
[disabled]="disabled"
|
|
388
360
|
[readonly]="readonly"
|
|
389
361
|
[tabindex]="tabindex"
|
|
390
|
-
[size]="size"
|
|
391
362
|
[min]="0"
|
|
392
363
|
[max]="255"
|
|
393
364
|
[(value)]="rgba.g"
|
|
@@ -408,7 +379,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
408
379
|
[disabled]="disabled"
|
|
409
380
|
[readonly]="readonly"
|
|
410
381
|
[tabindex]="tabindex"
|
|
411
|
-
[size]="size"
|
|
412
382
|
[min]="0"
|
|
413
383
|
[max]="255"
|
|
414
384
|
[(value)]="rgba.b"
|
|
@@ -423,14 +393,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
423
393
|
<label [for]="blue.focusableId" class="k-colorgradient-input-label">B</label>
|
|
424
394
|
</div>
|
|
425
395
|
<div class="k-vstack" *ngIf="opacity">
|
|
426
|
-
<kendo-numerictextbox
|
|
396
|
+
<kendo-numerictextbox #opacityInput
|
|
427
397
|
#alpha
|
|
428
398
|
kendoAdditionalNumericLabel="alpha"
|
|
429
399
|
[localizationService]="localizationService"
|
|
430
400
|
[disabled]="disabled"
|
|
431
401
|
[readonly]="readonly"
|
|
432
402
|
[tabindex]="tabindex"
|
|
433
|
-
[size]="size"
|
|
434
403
|
[min]="0"
|
|
435
404
|
[max]="1"
|
|
436
405
|
[(value)]="rgba.a"
|
|
@@ -448,14 +417,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
448
417
|
</ng-container>
|
|
449
418
|
`,
|
|
450
419
|
standalone: true,
|
|
451
|
-
imports: [ButtonComponent, NgIf, NumericTextBoxComponent, NumericLabelDirective
|
|
420
|
+
imports: [ButtonComponent, NgIf, NumericTextBoxComponent, NumericLabelDirective]
|
|
452
421
|
}]
|
|
453
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type:
|
|
422
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { focusableId: [{
|
|
454
423
|
type: Input
|
|
455
424
|
}], formatView: [{
|
|
456
425
|
type: Input
|
|
457
|
-
}], size: [{
|
|
458
|
-
type: Input
|
|
459
426
|
}], tabindex: [{
|
|
460
427
|
type: Input
|
|
461
428
|
}], value: [{
|