@progress/kendo-angular-inputs 8.0.0-dev.202112161434 → 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-gradient.component.js +1 -1
- package/dist/es/colorpicker/color-input.component.js +1 -1
- package/dist/es/colorpicker/colorpicker.component.js +111 -6
- package/dist/es/colorpicker/flatcolorpicker-actions.component.js +1 -1
- package/dist/es/colorpicker/flatcolorpicker-header.component.js +1 -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/es/common/models.js +4 -0
- package/dist/es/common/utils.js +37 -0
- package/dist/es/main.js +0 -1
- 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/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 +108 -11
- 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-gradient.component.js +1 -1
- package/dist/es2015/colorpicker/color-input.component.js +1 -1
- package/dist/es2015/colorpicker/colorpicker.component.d.ts +45 -3
- package/dist/es2015/colorpicker/colorpicker.component.js +113 -16
- package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +2 -2
- package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +2 -2
- package/dist/es2015/common/models/fillmode.d.ts +13 -0
- 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.metadata.json +1 -1
- package/dist/es2015/main.d.ts +1 -1
- package/dist/es2015/main.js +0 -1
- 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/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 +96 -11
- 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 +936 -478
- package/dist/fesm5/index.js +1015 -484
- package/dist/npm/checkbox/checkbox.directive.js +78 -2
- package/dist/npm/colorpicker/color-gradient.component.js +1 -1
- package/dist/npm/colorpicker/color-input.component.js +1 -1
- package/dist/npm/colorpicker/colorpicker.component.js +109 -4
- package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +1 -1
- package/dist/npm/colorpicker/flatcolorpicker-header.component.js +1 -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/main.js +0 -2
- 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/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 +107 -10
- 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 +11 -11
- package/dist/es/textbox/floating-label-input-adapter.js +0 -58
- package/dist/es/textbox/textbox-container.component.js +0 -224
- 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/textbox/floating-label-input-adapter.js +0 -60
- package/dist/npm/textbox/textbox-container.component.js +0 -226
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, HostBinding } from '@angular/core';
|
|
6
|
+
import { Directive, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
|
|
7
|
+
import { getStylingClasses } from '../common/utils';
|
|
7
8
|
/**
|
|
8
9
|
* Represents the directive that renders the [Kendo UI CheckBox]({% slug overview_checkbox %}) input component.
|
|
9
10
|
* The directive is placed on input type="checkbox" elements.
|
|
@@ -14,17 +15,92 @@ import { Directive, HostBinding } from '@angular/core';
|
|
|
14
15
|
* ```
|
|
15
16
|
*/
|
|
16
17
|
var CheckBoxDirective = /** @class */ (function () {
|
|
17
|
-
function CheckBoxDirective() {
|
|
18
|
+
function CheckBoxDirective(renderer, hostElement) {
|
|
19
|
+
this.renderer = renderer;
|
|
20
|
+
this.hostElement = hostElement;
|
|
18
21
|
this.kendoClass = true;
|
|
22
|
+
this._size = 'medium';
|
|
23
|
+
this._rounded = 'medium';
|
|
19
24
|
}
|
|
25
|
+
Object.defineProperty(CheckBoxDirective.prototype, "size", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return this._size;
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* The size property specifies the width and height of the CheckBox
|
|
31
|
+
* ([see example]({% slug appearance_checkboxdirective %}#toc-size)).
|
|
32
|
+
*
|
|
33
|
+
* The possible values are:
|
|
34
|
+
* * `'small'`
|
|
35
|
+
* * `'medium'` (default)
|
|
36
|
+
* * `'large'`
|
|
37
|
+
* * `null`
|
|
38
|
+
*/
|
|
39
|
+
set: function (size) {
|
|
40
|
+
this.handleClasses(size, 'size');
|
|
41
|
+
this._size = size;
|
|
42
|
+
},
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(CheckBoxDirective.prototype, "rounded", {
|
|
47
|
+
get: function () {
|
|
48
|
+
return this._rounded;
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* The rounded property specifies the border radius of the CheckBox
|
|
52
|
+
* ([see example]({% slug appearance_checkboxdirective %}#toc-rounded)).
|
|
53
|
+
*
|
|
54
|
+
* The possible values are:
|
|
55
|
+
* * `'small'`
|
|
56
|
+
* * `'medium'` (default)
|
|
57
|
+
* * `'large'`
|
|
58
|
+
* * `null`
|
|
59
|
+
*/
|
|
60
|
+
set: function (rounded) {
|
|
61
|
+
this.handleClasses(rounded, 'rounded');
|
|
62
|
+
this._rounded = rounded;
|
|
63
|
+
},
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
CheckBoxDirective.prototype.ngAfterViewInit = function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
var stylingInputs = ['size', 'rounded'];
|
|
70
|
+
stylingInputs.forEach(function (input) {
|
|
71
|
+
_this.handleClasses(_this[input], input);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
CheckBoxDirective.prototype.handleClasses = function (value, input) {
|
|
75
|
+
var elem = this.hostElement.nativeElement;
|
|
76
|
+
var classes = getStylingClasses('checkbox', input, this[input], value);
|
|
77
|
+
if (classes.toRemove) {
|
|
78
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
79
|
+
}
|
|
80
|
+
if (classes.toAdd) {
|
|
81
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
20
84
|
tslib_1.__decorate([
|
|
21
85
|
HostBinding('class.k-checkbox'),
|
|
22
86
|
tslib_1.__metadata("design:type", Boolean)
|
|
23
87
|
], CheckBoxDirective.prototype, "kendoClass", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
Input(),
|
|
90
|
+
tslib_1.__metadata("design:type", String),
|
|
91
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
92
|
+
], CheckBoxDirective.prototype, "size", null);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
Input(),
|
|
95
|
+
tslib_1.__metadata("design:type", String),
|
|
96
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
97
|
+
], CheckBoxDirective.prototype, "rounded", null);
|
|
24
98
|
CheckBoxDirective = tslib_1.__decorate([
|
|
25
99
|
Directive({
|
|
26
100
|
selector: 'input[kendoCheckBox]'
|
|
27
|
-
})
|
|
101
|
+
}),
|
|
102
|
+
tslib_1.__metadata("design:paramtypes", [Renderer2,
|
|
103
|
+
ElementRef])
|
|
28
104
|
], CheckBoxDirective);
|
|
29
105
|
return CheckBoxDirective;
|
|
30
106
|
}());
|
|
@@ -662,7 +662,7 @@ var ColorGradientComponent = /** @class */ (function () {
|
|
|
662
662
|
useValue: 'kendo.colorgradient'
|
|
663
663
|
}
|
|
664
664
|
],
|
|
665
|
-
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-flat 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 ",
|
|
665
|
+
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 ",
|
|
666
666
|
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 "]
|
|
667
667
|
}),
|
|
668
668
|
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
@@ -182,7 +182,7 @@ var ColorInputComponent = /** @class */ (function () {
|
|
|
182
182
|
ColorInputComponent = tslib_1.__decorate([
|
|
183
183
|
Component({
|
|
184
184
|
selector: 'kendo-colorinput',
|
|
185
|
-
template: "\n <div class=\"k-vstack\">\n <button #toggleFormatButton\n class=\"k-colorgradient-toggle-mode k-button k-
|
|
185
|
+
template: "\n <div class=\"k-vstack\">\n <button #toggleFormatButton\n class=\"k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button\"\n [attr.aria-label]=\"formatButtonTitle\"\n [attr.title]=\"formatButtonTitle\"\n >\n <span class=\"k-button-icon k-icon k-i-arrows-kpi\"></span>\n </button>\n </div>\n <div *ngIf=\"formatView === 'hex'\" class=\"k-vstack\">\n <input\n #hexInput\n [id]=\"focusableId\"\n class=\"k-textbox k-hex-value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"hex || ''\"\n (blur)=\"handleHexInputBlur()\"\n (input)=\"handleHexValueChange(hexInput.value)\"\n />\n <label [for]=\"focusableId\" class=\"k-colorgradient-input-label\">HEX</label>\n </div>\n <ng-container *ngIf=\"formatView === 'rgba'\">\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #red\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.r\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"red.focusableId\" class=\"k-colorgradient-input-label\">R</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #green\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.g\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"green.focusableId\" class=\"k-colorgradient-input-label\">G</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #blue\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.b\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"blue.focusableId\" class=\"k-colorgradient-input-label\">B</label>\n </div>\n <div class=\"k-vstack\" *ngIf=\"opacity\">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"1\"\n [(value)]=\"rgba.a\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [step]=\"0.01\"\n [format]=\"'n2'\"\n [decimals]=\"2\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"alpha.focusableId\" class=\"k-colorgradient-input-label\">A</label>\n </div>\n </ng-container>\n "
|
|
186
186
|
}),
|
|
187
187
|
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
188
188
|
Renderer2,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone } from '@angular/core';
|
|
6
|
+
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
8
|
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
9
9
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
@@ -14,7 +14,7 @@ import { packageMetadata } from '../package-metadata';
|
|
|
14
14
|
import { PALETTEPRESETS } from './models';
|
|
15
15
|
import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
|
|
16
16
|
import { parseColor } from './utils';
|
|
17
|
-
import { isPresent } from '../common/utils';
|
|
17
|
+
import { getStylingClasses, isPresent } from '../common/utils';
|
|
18
18
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
19
19
|
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
20
20
|
var serial = 0;
|
|
@@ -25,12 +25,14 @@ var serial = 0;
|
|
|
25
25
|
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
26
26
|
*/
|
|
27
27
|
var ColorPickerComponent = /** @class */ (function () {
|
|
28
|
-
function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
|
|
28
|
+
function ColorPickerComponent(host, popupService, cdr, localizationService, ngZone, renderer) {
|
|
29
29
|
var _this = this;
|
|
30
|
+
this.host = host;
|
|
30
31
|
this.popupService = popupService;
|
|
31
32
|
this.cdr = cdr;
|
|
32
33
|
this.localizationService = localizationService;
|
|
33
34
|
this.ngZone = ngZone;
|
|
35
|
+
this.renderer = renderer;
|
|
34
36
|
this.hostClasses = true;
|
|
35
37
|
/**
|
|
36
38
|
* @hidden
|
|
@@ -135,6 +137,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
135
137
|
this._popupSettings = { animate: true };
|
|
136
138
|
this._paletteSettings = {};
|
|
137
139
|
this._gradientSettings = { opacity: true, delay: 0 };
|
|
140
|
+
this._size = 'medium';
|
|
141
|
+
this._rounded = 'medium';
|
|
142
|
+
this._fillMode = 'solid';
|
|
138
143
|
this.notifyNgTouched = function () { };
|
|
139
144
|
this.notifyNgChanged = function () { };
|
|
140
145
|
validatePackage(packageMetadata);
|
|
@@ -213,6 +218,70 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
213
218
|
enumerable: true,
|
|
214
219
|
configurable: true
|
|
215
220
|
});
|
|
221
|
+
Object.defineProperty(ColorPickerComponent.prototype, "size", {
|
|
222
|
+
get: function () {
|
|
223
|
+
return this._size;
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* The size property specifies the font size and line height of the ColorPicker
|
|
227
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-size)).
|
|
228
|
+
*
|
|
229
|
+
* The possible values are:
|
|
230
|
+
* * `'small'`
|
|
231
|
+
* * `'medium'` (default)
|
|
232
|
+
* * `'large'`
|
|
233
|
+
* * `null`
|
|
234
|
+
*/
|
|
235
|
+
set: function (size) {
|
|
236
|
+
this.handleClasses(size, 'size');
|
|
237
|
+
this._size = size;
|
|
238
|
+
},
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true
|
|
241
|
+
});
|
|
242
|
+
Object.defineProperty(ColorPickerComponent.prototype, "rounded", {
|
|
243
|
+
get: function () {
|
|
244
|
+
return this._rounded;
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* The rounded property specifies the border radius of the ColorPicker
|
|
248
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
|
|
249
|
+
*
|
|
250
|
+
* The possible values are:
|
|
251
|
+
* * `'small'`
|
|
252
|
+
* * `'medium'` (default)
|
|
253
|
+
* * `'large'`
|
|
254
|
+
* * `'full'`
|
|
255
|
+
* * `null`
|
|
256
|
+
*/
|
|
257
|
+
set: function (rounded) {
|
|
258
|
+
this.handleClasses(rounded, 'rounded');
|
|
259
|
+
this._rounded = rounded;
|
|
260
|
+
},
|
|
261
|
+
enumerable: true,
|
|
262
|
+
configurable: true
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(ColorPickerComponent.prototype, "fillMode", {
|
|
265
|
+
get: function () {
|
|
266
|
+
return this._fillMode;
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* The fillMode property specifies the background and border styles of the ColorPicker
|
|
270
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
|
|
271
|
+
*
|
|
272
|
+
* The possible values are:
|
|
273
|
+
* * `'flat'`
|
|
274
|
+
* * `'solid'` (default)
|
|
275
|
+
* * `'outline'`
|
|
276
|
+
* * `null`
|
|
277
|
+
*/
|
|
278
|
+
set: function (fillMode) {
|
|
279
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
280
|
+
this._fillMode = fillMode;
|
|
281
|
+
},
|
|
282
|
+
enumerable: true,
|
|
283
|
+
configurable: true
|
|
284
|
+
});
|
|
216
285
|
Object.defineProperty(ColorPickerComponent.prototype, "isOpen", {
|
|
217
286
|
/**
|
|
218
287
|
* Indicates whether the ColorPicker popup is open.
|
|
@@ -250,6 +319,13 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
250
319
|
columns: this._paletteSettings.columns || presetColumns || 10
|
|
251
320
|
};
|
|
252
321
|
};
|
|
322
|
+
ColorPickerComponent.prototype.ngAfterViewInit = function () {
|
|
323
|
+
var _this = this;
|
|
324
|
+
var stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
325
|
+
stylingInputs.forEach(function (input) {
|
|
326
|
+
_this.handleClasses(_this[input], input);
|
|
327
|
+
});
|
|
328
|
+
};
|
|
253
329
|
ColorPickerComponent.prototype.ngOnChanges = function (changes) {
|
|
254
330
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
255
331
|
this.activeView = 'palette';
|
|
@@ -443,6 +519,16 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
443
519
|
ColorPickerComponent.prototype.isEmpty = function () {
|
|
444
520
|
return false;
|
|
445
521
|
};
|
|
522
|
+
ColorPickerComponent.prototype.handleClasses = function (value, input) {
|
|
523
|
+
var elem = this.host.nativeElement;
|
|
524
|
+
var classes = getStylingClasses('picker', input, this[input], value);
|
|
525
|
+
if (classes.toRemove) {
|
|
526
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
527
|
+
}
|
|
528
|
+
if (classes.toAdd) {
|
|
529
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
530
|
+
}
|
|
531
|
+
};
|
|
446
532
|
ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
|
|
447
533
|
var focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
448
534
|
var wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
@@ -536,6 +622,8 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
536
622
|
var ColorPickerComponent_1;
|
|
537
623
|
tslib_1.__decorate([
|
|
538
624
|
HostBinding('class.k-colorpicker'),
|
|
625
|
+
HostBinding('class.k-icon-picker'),
|
|
626
|
+
HostBinding('class.k-picker'),
|
|
539
627
|
tslib_1.__metadata("design:type", Boolean)
|
|
540
628
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
541
629
|
tslib_1.__decorate([
|
|
@@ -611,6 +699,21 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
611
699
|
Input(),
|
|
612
700
|
tslib_1.__metadata("design:type", String)
|
|
613
701
|
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
702
|
+
tslib_1.__decorate([
|
|
703
|
+
Input(),
|
|
704
|
+
tslib_1.__metadata("design:type", String),
|
|
705
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
706
|
+
], ColorPickerComponent.prototype, "size", null);
|
|
707
|
+
tslib_1.__decorate([
|
|
708
|
+
Input(),
|
|
709
|
+
tslib_1.__metadata("design:type", String),
|
|
710
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
711
|
+
], ColorPickerComponent.prototype, "rounded", null);
|
|
712
|
+
tslib_1.__decorate([
|
|
713
|
+
Input(),
|
|
714
|
+
tslib_1.__metadata("design:type", String),
|
|
715
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
716
|
+
], ColorPickerComponent.prototype, "fillMode", null);
|
|
614
717
|
tslib_1.__decorate([
|
|
615
718
|
Output(),
|
|
616
719
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -681,12 +784,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
681
784
|
useValue: 'kendo.colorpicker'
|
|
682
785
|
}
|
|
683
786
|
],
|
|
684
|
-
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor=\"kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty.\"\n colorPickerNoColor=\"Colorpicker no color chosen\"\n i18n-flatColorPickerNoColor=\"kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.colorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.colorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.colorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.colorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.colorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.colorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.colorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <span\n #wrapper\n [ngClass]=\"{\n 'k-
|
|
787
|
+
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor=\"kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty.\"\n colorPickerNoColor=\"Colorpicker no color chosen\"\n i18n-flatColorPickerNoColor=\"kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.colorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.colorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.colorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.colorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.colorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.colorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.colorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <span\n #wrapper\n [ngClass]=\"{\n 'k-input-inner': true,\n 'k-disabled': this.disabled,\n 'k-focus': this.isFocused\n }\"\n role=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"colorPickerAriaLabel\"\n [id]=\"focusableId\"\n [attr.tabindex]=\"tabindex\"\n (focus)=\"handleWrapperFocus()\"\n (blur)=\"handleWrapperBlur()\"\n (mousedown)=\"$event.preventDefault()\"\n (keydown)=\"handleWrapperKeyDown($event)\"\n >\n <span\n class=\"k-value-icon k-color-preview\"\n [ngClass]=\"{'k-icon-color-preview': iconStyles, 'k-no-color': !value}\"\n (click)=\"handleActiveColorClick()\">\n <span *ngIf=\"iconClass || icon\" class=\"k-color-preview-icon k-icon\" [ngClass]=\"iconStyles\"></span>\n <span class=\"k-color-preview-mask\" [style.background-color]=\"value\"></span>\n </span>\n </span>\n <button\n type=\"button\"\n class=\"k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button\"\n [attr.aria-label]=\"colorPickerAriaLabel\"\n (click)=\"togglePopup()\">\n <span class=\"k-button-icon k-icon k-i-arrow-s\"></span>\n </button>\n <ng-template #popupTemplate>\n <kendo-flatcolorpicker\n #flatColorPicker\n [value]=\"value\"\n [format]=\"format\"\n [views]=\"views\"\n [activeView]=\"activeView\"\n [actionsLayout]=\"actionsLayout\"\n [preview]=\"preview\"\n [gradientSettings]=\"gradientSettings\"\n [paletteSettings]=\"paletteSettings\"\n [clearButton]=\"clearButton\"\n (focusout)=\"handlePopupBlur($event)\"\n (cancel)=\"handleCancelEvent($event)\"\n (valueChange)=\"handleValueChange($event)\"\n (keydown)=\"handlePopupKeyDown($event)\"\n (activeViewChange)=\"activeViewChange.emit($event)\"\n (actionButtonClick)=\"togglePopup()\">\n </kendo-flatcolorpicker>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
685
788
|
}),
|
|
686
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
789
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
790
|
+
PopupService,
|
|
687
791
|
ChangeDetectorRef,
|
|
688
792
|
LocalizationService,
|
|
689
|
-
NgZone
|
|
793
|
+
NgZone,
|
|
794
|
+
Renderer2])
|
|
690
795
|
], ColorPickerComponent);
|
|
691
796
|
return ColorPickerComponent;
|
|
692
797
|
}());
|
|
@@ -41,7 +41,7 @@ var FlatColorPickerActionButtonsComponent = /** @class */ (function () {
|
|
|
41
41
|
FlatColorPickerActionButtonsComponent = tslib_1.__decorate([
|
|
42
42
|
Component({
|
|
43
43
|
selector: '[kendoFlatColorPickerActionButtons]',
|
|
44
|
-
template: "\n <button\n class=\"k-coloreditor-cancel k-button\"\n [attr.title]=\"getText('cancelButton')\"\n (click)=\"onActionButtonClick('cancel', $event)\"\n >{{getText('cancelButton')}}</button>\n <button #last\n class=\"k-coloreditor-apply k-button k-primary\"\n [attr.title]=\"getText('applyButton')\"\n (click)=\"onActionButtonClick('apply', $event)\"\n >{{getText('applyButton')}}</button>\n "
|
|
44
|
+
template: "\n <button\n class=\"k-coloreditor-cancel k-button k-button-md k-button-solid k-button-solid-base\"\n [attr.title]=\"getText('cancelButton')\"\n (click)=\"onActionButtonClick('cancel', $event)\"\n >{{getText('cancelButton')}}</button>\n <button #last\n class=\"k-coloreditor-apply k-button k-button-md k-button-solid k-button-solid-primary\"\n [attr.title]=\"getText('applyButton')\"\n (click)=\"onActionButtonClick('apply', $event)\"\n >{{getText('applyButton')}}</button>\n "
|
|
45
45
|
}),
|
|
46
46
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
47
47
|
], FlatColorPickerActionButtonsComponent);
|
|
@@ -85,7 +85,7 @@ var FlatColorPickerHeaderComponent = /** @class */ (function () {
|
|
|
85
85
|
FlatColorPickerHeaderComponent = tslib_1.__decorate([
|
|
86
86
|
Component({
|
|
87
87
|
selector: '[kendoFlatColorPickerHeader]',
|
|
88
|
-
template: "\n <div class=\"k-coloreditor-header-actions k-hstack\">\n <div *ngIf=\"viewButtons\" class=\"k-button-group k-button-group-flat\">\n <button *ngFor=\"let view of views\"\n #viewButtons\n (click)=\"onViewButtonClick(view)\"\n class=\"k-button k-
|
|
88
|
+
template: "\n <div class=\"k-coloreditor-header-actions k-hstack\">\n <div *ngIf=\"viewButtons\" class=\"k-button-group k-button-group-flat\">\n <button *ngFor=\"let view of views\"\n #viewButtons\n (click)=\"onViewButtonClick(view)\"\n class=\"k-button k-button-md k-button-flat k-button-flat-base k-icon-button\"\n [attr.title]=\"getText(view === 'gradient' ? 'gradientView' : 'paletteView')\"\n [attr.aria-label]=\"getText(view === 'gradient' ? 'gradientView' : 'paletteView')\"\n [attr.aria-pressed]=\"activeView === view\"\n [ngClass]=\"activeView === view ? 'k-state-selected' : ''\"\n >\n <span\n class=\"k-button-icon k-icon\"\n [ngClass]=\"getViewButtonIcon(view)\">\n </span>\n </button>\n </div>\n </div>\n <div class=\"k-spacer\"></div>\n <div class=\"k-coloreditor-header-actions k-hstack\">\n <button *ngIf=\"clearButton\"\n #clearButton\n class=\"k-button k-button-md k-button-flat k-button-flat-base k-icon-button k-coloreditor-reset\"\n [attr.aria-label]=\"getText('clearButton')\"\n [attr.title]=\"getText('clearButton')\"\n (click)=\"clearButtonClick.emit()\">\n <span class=\"k-button-icon k-icon k-i-reset-color\"></span>\n </button>\n <div class=\"k-coloreditor-preview k-vstack\" *ngIf=\"preview\">\n <span\n class=\"k-coloreditor-preview-color k-color-preview\"\n [attr.title]=\"getText('previewColor')\"\n [style.background-color]=\"selection\">\n </span>\n <span class=\"k-coloreditor-current-color k-color-preview\"\n [style.background-color]=\"value\"\n [attr.title]=\"getText('revertSelection')\"\n (click)=\"valuePaneClick.emit($event)\">\n </span>\n </div>\n </div>\n "
|
|
89
89
|
}),
|
|
90
90
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
91
91
|
], FlatColorPickerHeaderComponent);
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
package/dist/es/common/utils.js
CHANGED
|
@@ -34,3 +34,40 @@ export var fitIntoBounds = function (contender, min, max) {
|
|
|
34
34
|
}
|
|
35
35
|
return contender <= min ? min : contender >= max ? max : contender;
|
|
36
36
|
};
|
|
37
|
+
var SIZES = {
|
|
38
|
+
small: 'sm',
|
|
39
|
+
medium: 'md',
|
|
40
|
+
large: 'lg'
|
|
41
|
+
};
|
|
42
|
+
var ROUNDNESS = {
|
|
43
|
+
small: 'sm',
|
|
44
|
+
medium: 'md',
|
|
45
|
+
large: 'lg',
|
|
46
|
+
full: 'full'
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*
|
|
51
|
+
* Returns the styling classes to be added and removed
|
|
52
|
+
*/
|
|
53
|
+
export var getStylingClasses = function (componentType, stylingOption, previousValue, newValue) {
|
|
54
|
+
switch (stylingOption) {
|
|
55
|
+
case 'size':
|
|
56
|
+
return {
|
|
57
|
+
toRemove: "k-" + componentType + "-" + SIZES[previousValue],
|
|
58
|
+
toAdd: newValue ? "k-" + componentType + "-" + SIZES[newValue] : null
|
|
59
|
+
};
|
|
60
|
+
case 'rounded':
|
|
61
|
+
return {
|
|
62
|
+
toRemove: "k-rounded-" + ROUNDNESS[previousValue],
|
|
63
|
+
toAdd: newValue ? "k-rounded-" + ROUNDNESS[newValue] : null
|
|
64
|
+
};
|
|
65
|
+
case 'fillMode':
|
|
66
|
+
return {
|
|
67
|
+
toRemove: "k-" + componentType + "-" + previousValue,
|
|
68
|
+
toAdd: newValue ? "k-" + componentType + "-" + newValue : null
|
|
69
|
+
};
|
|
70
|
+
default:
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
};
|
package/dist/es/main.js
CHANGED
|
@@ -6,7 +6,6 @@ export { SliderComponent } from './slider/slider.component';
|
|
|
6
6
|
export { RangeSliderComponent } from './rangeslider/rangeslider.component';
|
|
7
7
|
export { LabelTemplateDirective } from './sliders-common/label-template.directive';
|
|
8
8
|
export { SwitchComponent } from './switch/switch.component';
|
|
9
|
-
export { TextBoxContainerComponent } from './textbox/textbox-container.component';
|
|
10
9
|
export { TextBoxDirective } from './textbox/textbox.directive';
|
|
11
10
|
export { TextAreaDirective } from './shared/textarea.directive';
|
|
12
11
|
export { NumericTextBoxComponent } from './numerictextbox/numerictextbox.component';
|