@progress/kendo-angular-inputs 7.5.1 → 8.0.0-dev.202112211528
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/checkbox/checkbox.directive.js +79 -3
- 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 +279 -80
- 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/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/common/models/styling-classes.js +4 -0
- package/dist/{es2015/colorpicker/models/kendo-drag-event.js → es/common/models.js} +0 -0
- package/dist/es/common/utils.js +37 -0
- package/dist/es/index.js +5 -0
- package/dist/es/main.js +4 -2
- package/dist/es/maskedtextbox/maskedtextbox.component.js +101 -6
- package/dist/es/numerictextbox/numerictextbox.component.js +116 -20
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/radiobutton.directive.js +52 -3
- package/dist/es/shared/textarea.directive.js +3 -2
- package/dist/es/shared/utils.js +23 -0
- package/dist/es/switch/switch.component.js +167 -21
- package/dist/es/text-fields-common/text-fields-base.js +1 -1
- package/dist/es/textarea/textarea.component.js +101 -5
- package/dist/es/textbox/textbox.component.js +111 -12
- package/dist/es/textbox/textbox.directive.js +3 -2
- package/dist/es/textbox.module.js +0 -3
- package/dist/es2015/checkbox/checkbox.directive.d.ts +31 -0
- package/dist/es2015/checkbox/checkbox.directive.js +68 -10
- 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 +126 -93
- 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 +127 -25
- package/dist/es2015/colorpicker/colorpicker.component.js +305 -125
- 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/events/kendo-drag-event.js +4 -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/{colorpicker/models/color-picker-view.d.ts → common/models/fillmode.d.ts} +5 -5
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +23 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models.d.ts +8 -0
- package/dist/es2015/common/models.js +4 -0
- package/dist/es2015/common/utils.d.ts +7 -0
- package/dist/es2015/common/utils.js +37 -0
- 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 +5 -2
- package/dist/es2015/main.js +4 -2
- package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +39 -1
- package/dist/es2015/maskedtextbox/maskedtextbox.component.js +88 -6
- package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +39 -2
- package/dist/es2015/numerictextbox/numerictextbox.component.js +124 -40
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/radiobutton/radiobutton.directive.d.ts +18 -0
- package/dist/es2015/radiobutton/radiobutton.directive.js +46 -11
- package/dist/es2015/shared/textarea.directive.d.ts +1 -1
- package/dist/es2015/shared/textarea.directive.js +3 -2
- package/dist/es2015/shared/utils.d.ts +16 -0
- package/dist/es2015/shared/utils.js +23 -0
- package/dist/es2015/switch/switch.component.d.ts +48 -5
- package/dist/es2015/switch/switch.component.js +166 -24
- package/dist/es2015/text-fields-common/text-fields-base.js +1 -1
- package/dist/es2015/textarea/textarea.component.d.ts +39 -1
- package/dist/es2015/textarea/textarea.component.js +89 -5
- package/dist/es2015/textbox/textbox.component.d.ts +40 -1
- package/dist/es2015/textbox/textbox.component.js +99 -12
- package/dist/es2015/textbox/textbox.directive.d.ts +1 -1
- package/dist/es2015/textbox/textbox.directive.js +3 -2
- package/dist/es2015/textbox.module.js +0 -3
- package/dist/fesm2015/index.js +3118 -1477
- package/dist/fesm5/index.js +3040 -1387
- package/dist/npm/checkbox/checkbox.directive.js +78 -2
- 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 +285 -86
- 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/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/common/models.js +6 -0
- package/dist/npm/common/utils.js +37 -0
- package/dist/npm/index.js +10 -0
- package/dist/npm/main.js +7 -4
- package/dist/npm/maskedtextbox/maskedtextbox.component.js +100 -5
- package/dist/npm/numerictextbox/numerictextbox.component.js +115 -19
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/radiobutton.directive.js +51 -2
- package/dist/npm/shared/textarea.directive.js +3 -2
- package/dist/npm/shared/utils.js +25 -0
- package/dist/npm/switch/switch.component.js +166 -20
- package/dist/npm/text-fields-common/text-fields-base.js +1 -1
- package/dist/npm/textarea/textarea.component.js +100 -4
- package/dist/npm/textbox/textbox.component.js +113 -14
- package/dist/npm/textbox/textbox.directive.js +3 -2
- package/dist/npm/textbox.module.js +0 -3
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +15 -12
- package/dist/es/colorpicker/models/preventable-event.js +0 -29
- package/dist/es/textbox/floating-label-input-adapter.js +0 -58
- package/dist/es/textbox/textbox-container.component.js +0 -224
- package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
- package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
- package/dist/es2015/textbox/floating-label-input-adapter.d.ts +0 -20
- package/dist/es2015/textbox/floating-label-input-adapter.js +0 -52
- package/dist/es2015/textbox/textbox-container.component.d.ts +0 -59
- package/dist/es2015/textbox/textbox-container.component.js +0 -209
- package/dist/npm/colorpicker/models/preventable-event.js +0 -31
- package/dist/npm/textbox/floating-label-input-adapter.js +0 -60
- package/dist/npm/textbox/textbox-container.component.js +0 -226
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
|
+
var utils_1 = require("../common/utils");
|
|
9
10
|
/**
|
|
10
11
|
* Represents the directive that renders the [Kendo UI CheckBox]({% slug overview_checkbox %}) input component.
|
|
11
12
|
* The directive is placed on input type="checkbox" elements.
|
|
@@ -16,17 +17,92 @@ var core_1 = require("@angular/core");
|
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
var CheckBoxDirective = /** @class */ (function () {
|
|
19
|
-
function CheckBoxDirective() {
|
|
20
|
+
function CheckBoxDirective(renderer, hostElement) {
|
|
21
|
+
this.renderer = renderer;
|
|
22
|
+
this.hostElement = hostElement;
|
|
20
23
|
this.kendoClass = true;
|
|
24
|
+
this._size = 'medium';
|
|
25
|
+
this._rounded = 'medium';
|
|
21
26
|
}
|
|
27
|
+
Object.defineProperty(CheckBoxDirective.prototype, "size", {
|
|
28
|
+
get: function () {
|
|
29
|
+
return this._size;
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* The size property specifies the width and height of the CheckBox
|
|
33
|
+
* ([see example]({% slug appearance_checkboxdirective %}#toc-size)).
|
|
34
|
+
*
|
|
35
|
+
* The possible values are:
|
|
36
|
+
* * `'small'`
|
|
37
|
+
* * `'medium'` (default)
|
|
38
|
+
* * `'large'`
|
|
39
|
+
* * `null`
|
|
40
|
+
*/
|
|
41
|
+
set: function (size) {
|
|
42
|
+
this.handleClasses(size, 'size');
|
|
43
|
+
this._size = size;
|
|
44
|
+
},
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(CheckBoxDirective.prototype, "rounded", {
|
|
49
|
+
get: function () {
|
|
50
|
+
return this._rounded;
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* The rounded property specifies the border radius of the CheckBox
|
|
54
|
+
* ([see example]({% slug appearance_checkboxdirective %}#toc-rounded)).
|
|
55
|
+
*
|
|
56
|
+
* The possible values are:
|
|
57
|
+
* * `'small'`
|
|
58
|
+
* * `'medium'` (default)
|
|
59
|
+
* * `'large'`
|
|
60
|
+
* * `null`
|
|
61
|
+
*/
|
|
62
|
+
set: function (rounded) {
|
|
63
|
+
this.handleClasses(rounded, 'rounded');
|
|
64
|
+
this._rounded = rounded;
|
|
65
|
+
},
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
CheckBoxDirective.prototype.ngAfterViewInit = function () {
|
|
70
|
+
var _this = this;
|
|
71
|
+
var stylingInputs = ['size', 'rounded'];
|
|
72
|
+
stylingInputs.forEach(function (input) {
|
|
73
|
+
_this.handleClasses(_this[input], input);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
CheckBoxDirective.prototype.handleClasses = function (value, input) {
|
|
77
|
+
var elem = this.hostElement.nativeElement;
|
|
78
|
+
var classes = utils_1.getStylingClasses('checkbox', input, this[input], value);
|
|
79
|
+
if (classes.toRemove) {
|
|
80
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
81
|
+
}
|
|
82
|
+
if (classes.toAdd) {
|
|
83
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
22
86
|
tslib_1.__decorate([
|
|
23
87
|
core_1.HostBinding('class.k-checkbox'),
|
|
24
88
|
tslib_1.__metadata("design:type", Boolean)
|
|
25
89
|
], CheckBoxDirective.prototype, "kendoClass", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
core_1.Input(),
|
|
92
|
+
tslib_1.__metadata("design:type", String),
|
|
93
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
94
|
+
], CheckBoxDirective.prototype, "size", null);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
core_1.Input(),
|
|
97
|
+
tslib_1.__metadata("design:type", String),
|
|
98
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
99
|
+
], CheckBoxDirective.prototype, "rounded", null);
|
|
26
100
|
CheckBoxDirective = tslib_1.__decorate([
|
|
27
101
|
core_1.Directive({
|
|
28
102
|
selector: 'input[kendoCheckBox]'
|
|
29
|
-
})
|
|
103
|
+
}),
|
|
104
|
+
tslib_1.__metadata("design:paramtypes", [core_1.Renderer2,
|
|
105
|
+
core_1.ElementRef])
|
|
30
106
|
], CheckBoxDirective);
|
|
31
107
|
return CheckBoxDirective;
|
|
32
108
|
}());
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var rxjs_1 = require("rxjs");
|
|
10
|
+
var utils_1 = require("../common/utils");
|
|
11
|
+
var constants_1 = require("./constants");
|
|
12
|
+
var utils_2 = require("./utils");
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
var ColorContrastSvgComponent = /** @class */ (function () {
|
|
17
|
+
function ColorContrastSvgComponent() {
|
|
18
|
+
this.hostClass = true;
|
|
19
|
+
}
|
|
20
|
+
ColorContrastSvgComponent.prototype.ngAfterViewInit = function () {
|
|
21
|
+
var _this = this;
|
|
22
|
+
this.metrics = this.wrapper.getBoundingClientRect();
|
|
23
|
+
this.oldA = this.hsva.value.a;
|
|
24
|
+
this.oldH = this.hsva.value.h;
|
|
25
|
+
this.hsva.subscribe(function (value) {
|
|
26
|
+
if (value.h !== _this.oldH || value.a !== _this.oldA) {
|
|
27
|
+
_this.oldH = value.h;
|
|
28
|
+
_this.oldA = value.a;
|
|
29
|
+
_this.setPaths();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
ColorContrastSvgComponent.prototype.ngOnChanges = function (changes) {
|
|
34
|
+
if (utils_1.isPresent(changes.backgroundColor) && this.metrics) {
|
|
35
|
+
this.setPaths();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
ColorContrastSvgComponent.prototype.setPaths = function () {
|
|
39
|
+
var bezierCommandCalc = utils_2.bezierCommand(utils_2.controlPoint(utils_2.line));
|
|
40
|
+
this.paths = [utils_2.svgPath(this.getPaths(constants_1.AA_RATIO, constants_1.STEP_COUNT), bezierCommandCalc),
|
|
41
|
+
utils_2.svgPath(this.getPaths(constants_1.AA_RATIO, constants_1.STEP_COUNT, true), bezierCommandCalc),
|
|
42
|
+
utils_2.svgPath(this.getPaths(constants_1.AAA_RATIO, constants_1.STEP_COUNT), bezierCommandCalc),
|
|
43
|
+
utils_2.svgPath(this.getPaths(constants_1.AAA_RATIO, constants_1.STEP_COUNT, true), bezierCommandCalc)];
|
|
44
|
+
};
|
|
45
|
+
ColorContrastSvgComponent.prototype.findValue = function (contrast, saturation, low, high, comparer) {
|
|
46
|
+
var mid = (low + high) / 2;
|
|
47
|
+
var hsva = Object.assign({}, this.hsva.value, { s: saturation / this.metrics.width, v: 1 - mid / this.metrics.height });
|
|
48
|
+
var currentContrast = utils_2.getContrastFromTwoRGBAs(utils_2.getRGBA(utils_2.getColorFromHSV(hsva)), utils_2.getRGBA(this.backgroundColor || ''));
|
|
49
|
+
if (low + 0.5 > high) {
|
|
50
|
+
if (currentContrast < contrast + 1 && currentContrast > contrast - 1) {
|
|
51
|
+
return mid;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (comparer(currentContrast, contrast)) {
|
|
58
|
+
return this.findValue(contrast, saturation, low, high - (high - low) / 2, comparer);
|
|
59
|
+
}
|
|
60
|
+
return this.findValue(contrast, saturation, low + (high - low) / 2, high, comparer);
|
|
61
|
+
};
|
|
62
|
+
ColorContrastSvgComponent.prototype.getPaths = function (contrast, stepCount, reversed) {
|
|
63
|
+
if (reversed === void 0) { reversed = false; }
|
|
64
|
+
var points = [];
|
|
65
|
+
for (var i = 0; i <= this.metrics.width; i += this.metrics.width / stepCount) {
|
|
66
|
+
var value = this.findValue(contrast, i, 0, this.metrics.height, reversed ? (function (a, b) { return a < b; }) : (function (a, b) { return a > b; }));
|
|
67
|
+
if (value !== null) {
|
|
68
|
+
points.push([i, value]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return points;
|
|
72
|
+
};
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
core_1.HostBinding('class.k-color-contrast-svg'),
|
|
75
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
76
|
+
], ColorContrastSvgComponent.prototype, "hostClass", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
core_1.Input(),
|
|
79
|
+
tslib_1.__metadata("design:type", Object)
|
|
80
|
+
], ColorContrastSvgComponent.prototype, "wrapper", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
core_1.Input(),
|
|
83
|
+
tslib_1.__metadata("design:type", rxjs_1.BehaviorSubject)
|
|
84
|
+
], ColorContrastSvgComponent.prototype, "hsva", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
core_1.Input(),
|
|
87
|
+
tslib_1.__metadata("design:type", String)
|
|
88
|
+
], ColorContrastSvgComponent.prototype, "backgroundColor", void 0);
|
|
89
|
+
ColorContrastSvgComponent = tslib_1.__decorate([
|
|
90
|
+
core_1.Component({
|
|
91
|
+
selector: '[kendoColorContrastSvg]',
|
|
92
|
+
template: "\n <svg:path *ngFor=\"let path of paths\" [attr.d]=\"path\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"></svg:path>\n "
|
|
93
|
+
})
|
|
94
|
+
], ColorContrastSvgComponent);
|
|
95
|
+
return ColorContrastSvgComponent;
|
|
96
|
+
}());
|
|
97
|
+
exports.ColorContrastSvgComponent = ColorContrastSvgComponent;
|
|
@@ -7,16 +7,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
9
|
var forms_1 = require("@angular/forms");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var rxjs_1 = require("rxjs");
|
|
11
|
+
var operators_1 = require("rxjs/operators");
|
|
12
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
12
13
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
13
14
|
var dom_utils_1 = require("../common/dom-utils");
|
|
15
|
+
var utils_1 = require("./utils");
|
|
16
|
+
var utils_2 = require("../common/utils");
|
|
14
17
|
var slider_component_1 = require("../slider/slider.component");
|
|
15
|
-
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
16
|
-
var rxjs_1 = require("rxjs");
|
|
17
18
|
var colorgradient_localization_service_1 = require("./localization/colorgradient-localization.service");
|
|
18
19
|
var color_input_component_1 = require("./color-input.component");
|
|
19
|
-
var operators_1 = require("rxjs/operators");
|
|
20
20
|
var constants_1 = require("./constants");
|
|
21
21
|
var serial = 0;
|
|
22
22
|
/**
|
|
@@ -31,9 +31,6 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
31
31
|
this.renderer = renderer;
|
|
32
32
|
this.cdr = cdr;
|
|
33
33
|
this.localizationService = localizationService;
|
|
34
|
-
/**
|
|
35
|
-
* @hidden
|
|
36
|
-
*/
|
|
37
34
|
this.hostClasses = true;
|
|
38
35
|
/**
|
|
39
36
|
* @hidden
|
|
@@ -41,18 +38,26 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
41
38
|
this.id = "k-colorgradient-" + serial++;
|
|
42
39
|
/**
|
|
43
40
|
* Defines whether the alpha slider will be displayed.
|
|
41
|
+
*
|
|
42
|
+
* @default true
|
|
44
43
|
*/
|
|
45
44
|
this.opacity = true;
|
|
46
45
|
/**
|
|
47
46
|
* Sets the disabled state of the ColorGradient.
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
48
49
|
*/
|
|
49
50
|
this.disabled = false;
|
|
50
51
|
/**
|
|
51
52
|
* Sets the read-only state of the ColorGradient.
|
|
53
|
+
*
|
|
54
|
+
* @default false
|
|
52
55
|
*/
|
|
53
56
|
this.readonly = false;
|
|
54
57
|
/**
|
|
55
58
|
* Specifies whether the ColorGradient should display a 'Clear color' button.
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
56
61
|
*/
|
|
57
62
|
this.clearButton = false;
|
|
58
63
|
/**
|
|
@@ -61,6 +66,16 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
61
66
|
* @default 0
|
|
62
67
|
*/
|
|
63
68
|
this.delay = 0;
|
|
69
|
+
/**
|
|
70
|
+
* Specifies the output format of the ColorGradientComponent.
|
|
71
|
+
* The input value may be in a different format, but it will be parsed into the output `format`
|
|
72
|
+
* after the component processes it.
|
|
73
|
+
*
|
|
74
|
+
* The supported values are:
|
|
75
|
+
* * (Default) `rgba`
|
|
76
|
+
* * `hex`
|
|
77
|
+
*/
|
|
78
|
+
this.format = constants_1.DEFAULT_OUTPUT_FORMAT;
|
|
64
79
|
/**
|
|
65
80
|
* Fires each time the user selects a new color.
|
|
66
81
|
*/
|
|
@@ -76,17 +91,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
76
91
|
* The values are initially set in `ngOnInit` or in `ngOnChanges` and are
|
|
77
92
|
* updated on moving the drag handle or the sliders.
|
|
78
93
|
*/
|
|
79
|
-
this.hsva = {};
|
|
80
|
-
/**
|
|
81
|
-
* Specifies the output format of the ColorGradientComponent.
|
|
82
|
-
* The input value may be in a different format. However, it will be parsed into the output `format`
|
|
83
|
-
* after the component processes it.
|
|
84
|
-
*
|
|
85
|
-
* The supported values are:
|
|
86
|
-
* * (Default) `rgba`
|
|
87
|
-
* * `hex`
|
|
88
|
-
*/
|
|
89
|
-
this.format = constants_1.DEFAULT_OUTPUT_FORMAT;
|
|
94
|
+
this.hsva = new rxjs_1.BehaviorSubject({});
|
|
90
95
|
this._tabindex = 0;
|
|
91
96
|
this.listeners = [];
|
|
92
97
|
this.updateValues = new rxjs_1.Subject();
|
|
@@ -99,9 +104,6 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
99
104
|
}
|
|
100
105
|
ColorGradientComponent_1 = ColorGradientComponent;
|
|
101
106
|
Object.defineProperty(ColorGradientComponent.prototype, "readonlyAttribute", {
|
|
102
|
-
/**
|
|
103
|
-
* @hidden
|
|
104
|
-
*/
|
|
105
107
|
get: function () {
|
|
106
108
|
return this.readonly;
|
|
107
109
|
},
|
|
@@ -109,31 +111,22 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
109
111
|
configurable: true
|
|
110
112
|
});
|
|
111
113
|
Object.defineProperty(ColorGradientComponent.prototype, "disabledClass", {
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
114
|
get: function () {
|
|
116
115
|
return this.disabled;
|
|
117
116
|
},
|
|
118
117
|
enumerable: true,
|
|
119
118
|
configurable: true
|
|
120
119
|
});
|
|
121
|
-
Object.defineProperty(ColorGradientComponent.prototype, "
|
|
122
|
-
/**
|
|
123
|
-
* @hidden
|
|
124
|
-
*/
|
|
120
|
+
Object.defineProperty(ColorGradientComponent.prototype, "gradientId", {
|
|
125
121
|
get: function () {
|
|
126
|
-
return this.
|
|
122
|
+
return this.id;
|
|
127
123
|
},
|
|
128
124
|
enumerable: true,
|
|
129
125
|
configurable: true
|
|
130
126
|
});
|
|
131
|
-
Object.defineProperty(ColorGradientComponent.prototype, "
|
|
132
|
-
/**
|
|
133
|
-
* @hidden
|
|
134
|
-
*/
|
|
127
|
+
Object.defineProperty(ColorGradientComponent.prototype, "hostTabindex", {
|
|
135
128
|
get: function () {
|
|
136
|
-
return this.
|
|
129
|
+
return this.tabindex;
|
|
137
130
|
},
|
|
138
131
|
enumerable: true,
|
|
139
132
|
configurable: true
|
|
@@ -146,7 +139,21 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
146
139
|
* Specifies the value of the initially selected color.
|
|
147
140
|
*/
|
|
148
141
|
set: function (value) {
|
|
149
|
-
this._value = utils_1.parseColor(value, this.format);
|
|
142
|
+
this._value = utils_1.parseColor(value, this.format, this.opacity);
|
|
143
|
+
},
|
|
144
|
+
enumerable: true,
|
|
145
|
+
configurable: true
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(ColorGradientComponent.prototype, "contrastTool", {
|
|
148
|
+
get: function () {
|
|
149
|
+
return this._contrastTool;
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Enables the color contrast tool. Accepts the background color that will be compared to the selected value.
|
|
153
|
+
* The tool will calculate the contrast ratio between the two colors.
|
|
154
|
+
*/
|
|
155
|
+
set: function (value) {
|
|
156
|
+
this._contrastTool = utils_1.parseColor(value, this.format, this.opacity);
|
|
150
157
|
},
|
|
151
158
|
enumerable: true,
|
|
152
159
|
configurable: true
|
|
@@ -157,11 +164,18 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
157
164
|
},
|
|
158
165
|
/**
|
|
159
166
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
167
|
+
*
|
|
168
|
+
* @default 0
|
|
160
169
|
*/
|
|
161
170
|
set: function (value) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
if (utils_2.isPresent(value)) {
|
|
172
|
+
var tabindex = Number(value);
|
|
173
|
+
this._tabindex = !isNaN(tabindex) ? tabindex : 0;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Allows removal of the tabindex attribute
|
|
177
|
+
this._tabindex = value;
|
|
178
|
+
}
|
|
165
179
|
},
|
|
166
180
|
enumerable: true,
|
|
167
181
|
configurable: true
|
|
@@ -185,10 +199,10 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
185
199
|
*/
|
|
186
200
|
get: function () {
|
|
187
201
|
// setting the initial value to undefined to force the slider to recalculate the height of the slider track on the next cdr run
|
|
188
|
-
if (!(utils_2.isPresent(this.hsva) && utils_2.isPresent(this.hsva.a))) {
|
|
202
|
+
if (!(utils_2.isPresent(this.hsva.value) && utils_2.isPresent(this.hsva.value.a))) {
|
|
189
203
|
return;
|
|
190
204
|
}
|
|
191
|
-
return this.hsva.a * 100;
|
|
205
|
+
return this.hsva.value.a * 100;
|
|
192
206
|
},
|
|
193
207
|
enumerable: true,
|
|
194
208
|
configurable: true
|
|
@@ -205,7 +219,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
205
219
|
* @hidden
|
|
206
220
|
*/
|
|
207
221
|
get: function () {
|
|
208
|
-
return
|
|
222
|
+
return this.contrastTool && this.contrastTool.length > 0;
|
|
209
223
|
},
|
|
210
224
|
enumerable: true,
|
|
211
225
|
configurable: true
|
|
@@ -239,7 +253,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
239
253
|
if (this.disabled) {
|
|
240
254
|
return;
|
|
241
255
|
}
|
|
242
|
-
this.
|
|
256
|
+
this.gradientDragHandle.nativeElement.focus();
|
|
243
257
|
};
|
|
244
258
|
/**
|
|
245
259
|
* @hidden
|
|
@@ -277,7 +291,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
277
291
|
return;
|
|
278
292
|
}
|
|
279
293
|
this.renderer.removeClass(this.gradientWrapper.nativeElement, 'k-dragging');
|
|
280
|
-
this.handleValueChange(utils_1.getColorFromHSV(this.hsva));
|
|
294
|
+
this.handleValueChange(utils_1.getColorFromHSV(this.hsva.value, this.format, this.opacity));
|
|
281
295
|
};
|
|
282
296
|
/**
|
|
283
297
|
* @hidden
|
|
@@ -324,15 +338,19 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
324
338
|
return;
|
|
325
339
|
}
|
|
326
340
|
this.gradientDragHandle.nativeElement.focus();
|
|
327
|
-
var
|
|
328
|
-
var
|
|
341
|
+
var gradientRect = this.gradientRect;
|
|
342
|
+
var newX = position.clientX - gradientRect.left;
|
|
343
|
+
var newY = position.clientY - gradientRect.top;
|
|
329
344
|
this.ngZone.run(function () { return _this.moveDragHandle(newX, newY); });
|
|
330
345
|
};
|
|
331
346
|
/**
|
|
332
347
|
* @hidden
|
|
333
348
|
*/
|
|
334
349
|
ColorGradientComponent.prototype.handleHueSliderChange = function (hue) {
|
|
335
|
-
this.
|
|
350
|
+
var hsva = this.hsva.value;
|
|
351
|
+
hsva.h = hue;
|
|
352
|
+
this.hsva.next(hsva);
|
|
353
|
+
this.handleValueChange(utils_1.getColorFromHSV(this.hsva.value, this.format, this.opacity));
|
|
336
354
|
this.backgroundColor = utils_1.getColorFromHue(hue);
|
|
337
355
|
this.setAlphaSliderBackground(this.backgroundColor);
|
|
338
356
|
};
|
|
@@ -340,14 +358,16 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
340
358
|
* @hidden
|
|
341
359
|
*/
|
|
342
360
|
ColorGradientComponent.prototype.handleAlphaSliderChange = function (alpha) {
|
|
343
|
-
this.hsva.
|
|
344
|
-
|
|
361
|
+
var hsva = this.hsva.value;
|
|
362
|
+
hsva.a = alpha / 100;
|
|
363
|
+
this.hsva.next(hsva);
|
|
364
|
+
this.handleValueChange(utils_1.getColorFromHSV(this.hsva.value, this.format, this.opacity));
|
|
345
365
|
};
|
|
346
366
|
/**
|
|
347
367
|
* @hidden
|
|
348
368
|
*/
|
|
349
369
|
ColorGradientComponent.prototype.handleInputsValueChange = function (color) {
|
|
350
|
-
var parsed = utils_1.parseColor(color, this.format);
|
|
370
|
+
var parsed = utils_1.parseColor(color, this.format, this.opacity);
|
|
351
371
|
if (this.value !== parsed) {
|
|
352
372
|
this.handleValueChange(parsed);
|
|
353
373
|
this.updateUI();
|
|
@@ -396,7 +416,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
396
416
|
* @hidden
|
|
397
417
|
*/
|
|
398
418
|
get: function () {
|
|
399
|
-
var parsed = utils_1.parseColor(this.value, this.format);
|
|
419
|
+
var parsed = utils_1.parseColor(this.value, this.format, this.opacity);
|
|
400
420
|
return "" + (this.value ? parsed : this.localizationService.get('colorGradientHandle'));
|
|
401
421
|
},
|
|
402
422
|
enumerable: true,
|
|
@@ -434,29 +454,35 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
434
454
|
});
|
|
435
455
|
/**
|
|
436
456
|
* @hidden
|
|
437
|
-
* Used by the
|
|
457
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
438
458
|
*/
|
|
439
459
|
ColorGradientComponent.prototype.isEmpty = function () {
|
|
440
460
|
return false;
|
|
441
461
|
};
|
|
442
462
|
ColorGradientComponent.prototype.moveDragHandle = function (positionX, positionY) {
|
|
443
|
-
var
|
|
444
|
-
var
|
|
463
|
+
var gradientRect = this.gradientRect;
|
|
464
|
+
var gradientRectWidth = gradientRect.width;
|
|
465
|
+
var gradientRectHeight = gradientRect.height;
|
|
466
|
+
var top = utils_2.fitIntoBounds(positionY, 0, gradientRectHeight);
|
|
467
|
+
var left = utils_2.fitIntoBounds(positionX, 0, gradientRectWidth);
|
|
445
468
|
this.setDragHandleElementPosition(top, left);
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
this.
|
|
469
|
+
var hsva = this.hsva.value;
|
|
470
|
+
hsva.s = left / gradientRectWidth;
|
|
471
|
+
hsva.v = 1 - top / gradientRectHeight;
|
|
472
|
+
this.hsva.next(hsva);
|
|
473
|
+
this.updateValues.next(utils_1.getColorFromHSV(this.hsva.value, this.format, this.opacity));
|
|
474
|
+
this.setAlphaSliderBackground(utils_1.getColorFromHSV(tslib_1.__assign({}, this.hsva.value, { a: 1 }), this.format, this.opacity));
|
|
450
475
|
};
|
|
451
476
|
ColorGradientComponent.prototype.updateUI = function () {
|
|
452
477
|
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
453
478
|
return;
|
|
454
479
|
}
|
|
455
|
-
this.hsva
|
|
456
|
-
var
|
|
457
|
-
var
|
|
480
|
+
this.hsva.next(this.value ? utils_1.getHSV(this.value) : { h: 0, s: 0, v: 1, a: 1 });
|
|
481
|
+
var gradientRect = this.gradientRect;
|
|
482
|
+
var top = (1 - this.hsva.value.v) * gradientRect.height;
|
|
483
|
+
var left = this.hsva.value.s * gradientRect.width;
|
|
458
484
|
this.setDragHandleElementPosition(top, left);
|
|
459
|
-
this.backgroundColor = utils_1.getColorFromHue(this.hsva.h);
|
|
485
|
+
this.backgroundColor = utils_1.getColorFromHue(this.hsva.value.h);
|
|
460
486
|
this.setAlphaSliderBackground(this.backgroundColor);
|
|
461
487
|
this.setHostElementAriaLabel();
|
|
462
488
|
};
|
|
@@ -482,7 +508,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
482
508
|
this.renderer.setStyle(sliderTrack, 'background', "linear-gradient(to top, transparent, " + backgroundColor + ")");
|
|
483
509
|
};
|
|
484
510
|
ColorGradientComponent.prototype.setHostElementAriaLabel = function () {
|
|
485
|
-
var parsed = utils_1.parseColor(this.value, this.format);
|
|
511
|
+
var parsed = utils_1.parseColor(this.value, this.format, this.opacity);
|
|
486
512
|
this.renderer.setAttribute(this.host.nativeElement, 'aria-label', "" + (this.value ? parsed : this.localizationService.get('colorGradientNoColor')));
|
|
487
513
|
};
|
|
488
514
|
ColorGradientComponent.prototype.addEventListeners = function () {
|
|
@@ -499,7 +525,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
499
525
|
var keyupListener = _this.renderer.listen(_this.gradientDragHandle.nativeElement, 'keyup', function () {
|
|
500
526
|
_this.renderer.removeClass(_this.gradientWrapper.nativeElement, 'k-dragging');
|
|
501
527
|
if (!_this.readonly && !_this.disabled) {
|
|
502
|
-
_this.ngZone.run(function () { return _this.handleValueChange(utils_1.getColorFromHSV(_this.hsva)); });
|
|
528
|
+
_this.ngZone.run(function () { return _this.handleValueChange(utils_1.getColorFromHSV(_this.hsva.value, _this.format, _this.opacity)); });
|
|
503
529
|
}
|
|
504
530
|
});
|
|
505
531
|
var dragHandleFocusInListener = _this.renderer.listen(_this.gradientDragHandle.nativeElement, 'focusin', function () {
|
|
@@ -537,24 +563,24 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
537
563
|
tslib_1.__metadata("design:type", Boolean),
|
|
538
564
|
tslib_1.__metadata("design:paramtypes", [])
|
|
539
565
|
], ColorGradientComponent.prototype, "disabledClass", null);
|
|
540
|
-
tslib_1.__decorate([
|
|
541
|
-
core_1.HostBinding('attr.tabindex'),
|
|
542
|
-
tslib_1.__metadata("design:type", Number),
|
|
543
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
544
|
-
], ColorGradientComponent.prototype, "hostTabindex", null);
|
|
545
566
|
tslib_1.__decorate([
|
|
546
567
|
core_1.HostBinding('attr.id'),
|
|
547
568
|
tslib_1.__metadata("design:type", String),
|
|
548
569
|
tslib_1.__metadata("design:paramtypes", [])
|
|
549
570
|
], ColorGradientComponent.prototype, "gradientId", null);
|
|
550
|
-
tslib_1.__decorate([
|
|
551
|
-
core_1.Input(),
|
|
552
|
-
tslib_1.__metadata("design:type", String)
|
|
553
|
-
], ColorGradientComponent.prototype, "id", void 0);
|
|
554
571
|
tslib_1.__decorate([
|
|
555
572
|
core_1.HostBinding('attr.dir'),
|
|
556
573
|
tslib_1.__metadata("design:type", String)
|
|
557
574
|
], ColorGradientComponent.prototype, "direction", void 0);
|
|
575
|
+
tslib_1.__decorate([
|
|
576
|
+
core_1.HostBinding('attr.tabindex'),
|
|
577
|
+
tslib_1.__metadata("design:type", Number),
|
|
578
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
579
|
+
], ColorGradientComponent.prototype, "hostTabindex", null);
|
|
580
|
+
tslib_1.__decorate([
|
|
581
|
+
core_1.Input(),
|
|
582
|
+
tslib_1.__metadata("design:type", String)
|
|
583
|
+
], ColorGradientComponent.prototype, "id", void 0);
|
|
558
584
|
tslib_1.__decorate([
|
|
559
585
|
core_1.Input(),
|
|
560
586
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -582,21 +608,22 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
582
608
|
], ColorGradientComponent.prototype, "value", null);
|
|
583
609
|
tslib_1.__decorate([
|
|
584
610
|
core_1.Input(),
|
|
585
|
-
tslib_1.__metadata("design:type", String)
|
|
586
|
-
|
|
611
|
+
tslib_1.__metadata("design:type", String),
|
|
612
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
613
|
+
], ColorGradientComponent.prototype, "contrastTool", null);
|
|
587
614
|
tslib_1.__decorate([
|
|
588
615
|
core_1.Input(),
|
|
589
616
|
tslib_1.__metadata("design:type", Number),
|
|
590
617
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
591
618
|
], ColorGradientComponent.prototype, "tabindex", null);
|
|
592
|
-
tslib_1.__decorate([
|
|
593
|
-
core_1.Output(),
|
|
594
|
-
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
595
|
-
], ColorGradientComponent.prototype, "valueChange", void 0);
|
|
596
619
|
tslib_1.__decorate([
|
|
597
620
|
core_1.Input(),
|
|
598
621
|
tslib_1.__metadata("design:type", String)
|
|
599
622
|
], ColorGradientComponent.prototype, "format", void 0);
|
|
623
|
+
tslib_1.__decorate([
|
|
624
|
+
core_1.Output(),
|
|
625
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
626
|
+
], ColorGradientComponent.prototype, "valueChange", void 0);
|
|
600
627
|
tslib_1.__decorate([
|
|
601
628
|
core_1.ViewChild('gradientDragHandle', { read: core_1.ElementRef, static: false }),
|
|
602
629
|
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
@@ -615,6 +642,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
615
642
|
], ColorGradientComponent.prototype, "gradientWrapper", void 0);
|
|
616
643
|
ColorGradientComponent = ColorGradientComponent_1 = tslib_1.__decorate([
|
|
617
644
|
core_1.Component({
|
|
645
|
+
exportAs: 'kendoColorGradient',
|
|
618
646
|
selector: 'kendo-colorgradient',
|
|
619
647
|
providers: [
|
|
620
648
|
{
|
|
@@ -636,8 +664,8 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
636
664
|
useValue: 'kendo.colorgradient'
|
|
637
665
|
}
|
|
638
666
|
],
|
|
639
|
-
template: "\n <ng-container kendoColorGradientLocalizedMessages\n i18n-colorGradientNoColor=\"kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorgradient.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorgradient.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorgradient.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorgradient.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-
|
|
640
|
-
styles: ["\n .k-clear-color {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-align-self-end {\n height: 140px;\n }\n "]
|
|
667
|
+
template: "\n <ng-container kendoColorGradientLocalizedMessages\n i18n-colorGradientNoColor=\"kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorgradient.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorgradient.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorgradient.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorgradient.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-passContrast=\"kendo.colorgradient.passContrast|The pass message for the contrast tool.\"\n passContrast=\"Pass\"\n i18n-failContrast=\"kendo.colorgradient.failContrast|The fail message for the contrast tool.\"\n failContrast=\"Fail\"\n i18n-contrastRatio=\"kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-formatButton=\"kendo.colorgradient.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\">\n </ng-container>\n <div class=\"k-colorgradient-canvas k-hstack\">\n <div class=\"k-hsv-rectangle\" [style.background]=\"backgroundColor\">\n <div\n #gradientWrapper\n kendoDraggable\n class=\"k-hsv-gradient\"\n (click)=\"changePosition($event)\"\n (kendoPress)=\"handleDragPress($event)\"\n (kendoDrag)=\"onHandleDrag($event)\"\n (kendoRelease)=\"onHandleRelease()\">\n <div\n #gradientDragHandle\n class=\"k-hsv-draghandle k-draghandle\"\n tabindex=\"0\"\n [attr.title]=\"colorGradientHandleTitle\"\n [attr.aria-label]=\"colorGradientHandleAriaLabel\"\n >\n </div>\n </div>\n <svg kendoColorContrastSvg\n *ngIf=\"contrastToolVisible && gradientWrapper\"\n class=\"k-color-contrast-svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n [wrapper]=\"gradientWrapper ? gradientWrapper : undefined\"\n [hsva]=\"hsva\"\n [backgroundColor]=\"contrastTool\">\n </svg>\n </div>\n <div class=\"k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}\">\n <span class=\"k-clear-color k-button k-button-md k-button-flat k-button-flat-base k-button-icon\"\n *ngIf=\"clearButton\"\n (click)=\"reset()\"\n (keydown.enter)=\"reset()\"\n (keydown.space)=\"reset()\"\n [attr.aria-label]=\"clearButtonTitle\"\n [attr.title]=\"clearButtonTitle\"\n tabindex=\"0\">\n <span class=\"k-icon k-i-reset-color\"></span>\n </span>\n <kendo-slider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-hue-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"hueSliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"360\"\n [smallStep]=\"5\"\n [largeStep]=\"10\"\n [value]=\"hsva.value.h\"\n (valueChange)=\"handleHueSliderChange($event)\"\n >\n </kendo-slider>\n <kendo-slider\n *ngIf=\"opacity\"\n #alphaSlider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-alpha-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"opacitySliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"100\"\n [smallStep]=\"1\"\n [largeStep]=\"10\"\n [value]=\"alphaSliderValue\"\n (valueChange)=\"handleAlphaSliderChange($event)\"\n >\n </kendo-slider>\n </div>\n </div>\n <kendo-colorinput #inputs\n [opacity]=\"opacity\"\n [formatView]=\"format\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (valueChange)=\"handleInputsValueChange($event)\"\n >\n </kendo-colorinput>\n <div class=\"k-colorgradient-color-contrast k-vbox\" *ngIf=\"contrastToolVisible\"\n kendoContrastTool\n [value]=\"value\"\n [ratio]=\"contrastTool\">\n </div>\n ",
|
|
668
|
+
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 "]
|
|
641
669
|
}),
|
|
642
670
|
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
643
671
|
core_1.NgZone,
|