@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
|
@@ -7,64 +7,94 @@ 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 flatcolorpicker_component_1 = require("./flatcolorpicker.component");
|
|
10
11
|
var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
|
|
11
12
|
var kendo_licensing_1 = require("@progress/kendo-licensing");
|
|
12
|
-
var package_metadata_1 = require("../package-metadata");
|
|
13
|
-
var models_1 = require("./models");
|
|
14
|
-
var color_parser_1 = require("./utils/color-parser");
|
|
15
|
-
var utils_1 = require("../common/utils");
|
|
16
13
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
17
14
|
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
18
|
-
var
|
|
15
|
+
var package_metadata_1 = require("../package-metadata");
|
|
16
|
+
var models_1 = require("./models");
|
|
17
|
+
var events_1 = require("./events");
|
|
18
|
+
var utils_1 = require("./utils");
|
|
19
|
+
var utils_2 = require("../common/utils");
|
|
19
20
|
var colorpicker_localization_service_1 = require("./localization/colorpicker-localization.service");
|
|
20
|
-
var
|
|
21
|
-
var DEFAULT_PRESET = 'office';
|
|
22
|
-
var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
21
|
+
var constants_1 = require("./constants");
|
|
23
22
|
var serial = 0;
|
|
24
23
|
/**
|
|
25
24
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
26
|
-
*
|
|
25
|
+
*
|
|
26
|
+
* The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
|
|
27
|
+
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
27
28
|
*/
|
|
28
29
|
var ColorPickerComponent = /** @class */ (function () {
|
|
29
|
-
function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
|
|
30
|
+
function ColorPickerComponent(host, popupService, cdr, localizationService, ngZone, renderer) {
|
|
30
31
|
var _this = this;
|
|
32
|
+
this.host = host;
|
|
31
33
|
this.popupService = popupService;
|
|
32
34
|
this.cdr = cdr;
|
|
33
35
|
this.localizationService = localizationService;
|
|
34
36
|
this.ngZone = ngZone;
|
|
35
|
-
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
37
|
+
this.renderer = renderer;
|
|
38
38
|
this.hostClasses = true;
|
|
39
39
|
/**
|
|
40
40
|
* @hidden
|
|
41
41
|
*/
|
|
42
42
|
this.focusableId = "k-colorpicker-" + serial++;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Specifies the views that will be rendered in the popup.
|
|
45
|
+
* By default both the gradient and palette views will be rendered.
|
|
45
46
|
*/
|
|
46
|
-
this.
|
|
47
|
+
this.views = ['gradient', 'palette'];
|
|
47
48
|
/**
|
|
48
49
|
* Sets the read-only state of the ColorPicker.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
49
52
|
*/
|
|
50
53
|
this.readonly = false;
|
|
51
54
|
/**
|
|
52
55
|
* Sets the disabled state of the ColorPicker.
|
|
56
|
+
*
|
|
57
|
+
* @default false
|
|
53
58
|
*/
|
|
54
59
|
this.disabled = false;
|
|
55
60
|
/**
|
|
56
61
|
* Specifies the output format of the ColorPicker.
|
|
57
|
-
* The input value may be in a different format. However, it will be parsed into the output `format`
|
|
58
|
-
* after the component processes it.
|
|
59
62
|
*
|
|
60
|
-
* If the
|
|
63
|
+
* If the input value is in a different format, it will be parsed into the specified output `format`.
|
|
61
64
|
*
|
|
62
65
|
* The supported values are:
|
|
63
66
|
* * `rgba` (default)
|
|
64
67
|
* * `hex`
|
|
65
|
-
* * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
|
|
66
68
|
*/
|
|
67
69
|
this.format = 'rgba';
|
|
70
|
+
/**
|
|
71
|
+
* Specifies whether the ColorPicker should display a 'Clear color' button.
|
|
72
|
+
*
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
this.clearButton = true;
|
|
76
|
+
/**
|
|
77
|
+
* Displays `Apply` and `Cancel` action buttons and color preview panes.
|
|
78
|
+
*
|
|
79
|
+
* When enabled, the component value will not change immediately upon
|
|
80
|
+
* color selection, but only after the `Apply` button is clicked.
|
|
81
|
+
*
|
|
82
|
+
* The `Cancel` button reverts the current selection to its
|
|
83
|
+
* previous state i.e. to the current value.
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
this.preview = false;
|
|
88
|
+
/**
|
|
89
|
+
* Configures the layout of the `Apply` and `Cancel` action buttons.
|
|
90
|
+
*
|
|
91
|
+
* The possible values are:
|
|
92
|
+
* * `start`
|
|
93
|
+
* * `center`
|
|
94
|
+
* * `end` (default)
|
|
95
|
+
* * `stretch`
|
|
96
|
+
*/
|
|
97
|
+
this.actionsLayout = 'end';
|
|
68
98
|
/**
|
|
69
99
|
* Fires each time the value is changed.
|
|
70
100
|
*/
|
|
@@ -87,6 +117,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
87
117
|
* Fires each time the ColorPicker is blurred.
|
|
88
118
|
*/
|
|
89
119
|
this.onBlur = new core_1.EventEmitter();
|
|
120
|
+
/**
|
|
121
|
+
* Fires when the user cancels the current color selection.
|
|
122
|
+
*
|
|
123
|
+
* Fires on preview pane or 'Cancel' button click.
|
|
124
|
+
*/
|
|
125
|
+
this.cancel = new core_1.EventEmitter();
|
|
90
126
|
/**
|
|
91
127
|
* Fires each time the left side of the ColorPicker wrapper is clicked.
|
|
92
128
|
* The event is triggered regardless of whether a ColorPicker icon is set or not.
|
|
@@ -94,10 +130,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
94
130
|
* The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
|
|
95
131
|
*/
|
|
96
132
|
this.activeColorClick = new core_1.EventEmitter();
|
|
133
|
+
/**
|
|
134
|
+
* Fires each time the view is about to change.
|
|
135
|
+
* Used to provide a two-way binding for the `activeView` property.
|
|
136
|
+
*/
|
|
137
|
+
this.activeViewChange = new core_1.EventEmitter();
|
|
97
138
|
this._tabindex = 0;
|
|
98
139
|
this._popupSettings = { animate: true };
|
|
99
140
|
this._paletteSettings = {};
|
|
100
|
-
this._gradientSettings = { opacity: true,
|
|
141
|
+
this._gradientSettings = { opacity: true, delay: 0 };
|
|
142
|
+
this._size = 'medium';
|
|
143
|
+
this._rounded = 'medium';
|
|
144
|
+
this._fillMode = 'solid';
|
|
101
145
|
this.notifyNgTouched = function () { };
|
|
102
146
|
this.notifyNgChanged = function () { };
|
|
103
147
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
@@ -115,7 +159,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
115
159
|
* Specifies the value of the initially selected color.
|
|
116
160
|
*/
|
|
117
161
|
set: function (value) {
|
|
118
|
-
this._value =
|
|
162
|
+
this._value = utils_1.parseColor(value, this.format, this.gradientSettings.opacity);
|
|
119
163
|
},
|
|
120
164
|
enumerable: true,
|
|
121
165
|
configurable: true
|
|
@@ -165,6 +209,8 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
165
209
|
},
|
|
166
210
|
/**
|
|
167
211
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
212
|
+
*
|
|
213
|
+
* @default 0
|
|
168
214
|
*/
|
|
169
215
|
set: function (value) {
|
|
170
216
|
var tabindex = Number(value);
|
|
@@ -174,12 +220,76 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
174
220
|
enumerable: true,
|
|
175
221
|
configurable: true
|
|
176
222
|
});
|
|
223
|
+
Object.defineProperty(ColorPickerComponent.prototype, "size", {
|
|
224
|
+
get: function () {
|
|
225
|
+
return this._size;
|
|
226
|
+
},
|
|
227
|
+
/**
|
|
228
|
+
* The size property specifies the font size and line height of the ColorPicker
|
|
229
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-size)).
|
|
230
|
+
*
|
|
231
|
+
* The possible values are:
|
|
232
|
+
* * `'small'`
|
|
233
|
+
* * `'medium'` (default)
|
|
234
|
+
* * `'large'`
|
|
235
|
+
* * `null`
|
|
236
|
+
*/
|
|
237
|
+
set: function (size) {
|
|
238
|
+
this.handleClasses(size, 'size');
|
|
239
|
+
this._size = size;
|
|
240
|
+
},
|
|
241
|
+
enumerable: true,
|
|
242
|
+
configurable: true
|
|
243
|
+
});
|
|
244
|
+
Object.defineProperty(ColorPickerComponent.prototype, "rounded", {
|
|
245
|
+
get: function () {
|
|
246
|
+
return this._rounded;
|
|
247
|
+
},
|
|
248
|
+
/**
|
|
249
|
+
* The rounded property specifies the border radius of the ColorPicker
|
|
250
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
|
|
251
|
+
*
|
|
252
|
+
* The possible values are:
|
|
253
|
+
* * `'small'`
|
|
254
|
+
* * `'medium'` (default)
|
|
255
|
+
* * `'large'`
|
|
256
|
+
* * `'full'`
|
|
257
|
+
* * `null`
|
|
258
|
+
*/
|
|
259
|
+
set: function (rounded) {
|
|
260
|
+
this.handleClasses(rounded, 'rounded');
|
|
261
|
+
this._rounded = rounded;
|
|
262
|
+
},
|
|
263
|
+
enumerable: true,
|
|
264
|
+
configurable: true
|
|
265
|
+
});
|
|
266
|
+
Object.defineProperty(ColorPickerComponent.prototype, "fillMode", {
|
|
267
|
+
get: function () {
|
|
268
|
+
return this._fillMode;
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* The fillMode property specifies the background and border styles of the ColorPicker
|
|
272
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
|
|
273
|
+
*
|
|
274
|
+
* The possible values are:
|
|
275
|
+
* * `'flat'`
|
|
276
|
+
* * `'solid'` (default)
|
|
277
|
+
* * `'outline'`
|
|
278
|
+
* * `null`
|
|
279
|
+
*/
|
|
280
|
+
set: function (fillMode) {
|
|
281
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
282
|
+
this._fillMode = fillMode;
|
|
283
|
+
},
|
|
284
|
+
enumerable: true,
|
|
285
|
+
configurable: true
|
|
286
|
+
});
|
|
177
287
|
Object.defineProperty(ColorPickerComponent.prototype, "isOpen", {
|
|
178
288
|
/**
|
|
179
289
|
* Indicates whether the ColorPicker popup is open.
|
|
180
290
|
*/
|
|
181
291
|
get: function () {
|
|
182
|
-
return
|
|
292
|
+
return utils_2.isPresent(this.popupRef);
|
|
183
293
|
},
|
|
184
294
|
enumerable: true,
|
|
185
295
|
configurable: true
|
|
@@ -200,10 +310,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
200
310
|
configurable: true
|
|
201
311
|
});
|
|
202
312
|
ColorPickerComponent.prototype.ngOnInit = function () {
|
|
203
|
-
var defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
|
|
313
|
+
var defaultPreset = (this.format !== 'name') ? constants_1.DEFAULT_PRESET : constants_1.DEFAULT_ACCESSIBLE_PRESET;
|
|
204
314
|
var settingsPalette = this._paletteSettings.palette;
|
|
205
|
-
var presetColumns = typeof settingsPalette === 'string' &&
|
|
206
|
-
|
|
315
|
+
var presetColumns = typeof settingsPalette === 'string' && models_1.PALETTEPRESETS[settingsPalette] ?
|
|
316
|
+
models_1.PALETTEPRESETS[settingsPalette].columns :
|
|
207
317
|
undefined;
|
|
208
318
|
this._paletteSettings = {
|
|
209
319
|
palette: settingsPalette || defaultPreset,
|
|
@@ -211,13 +321,20 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
211
321
|
columns: this._paletteSettings.columns || presetColumns || 10
|
|
212
322
|
};
|
|
213
323
|
};
|
|
324
|
+
ColorPickerComponent.prototype.ngAfterViewInit = function () {
|
|
325
|
+
var _this = this;
|
|
326
|
+
var stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
327
|
+
stylingInputs.forEach(function (input) {
|
|
328
|
+
_this.handleClasses(_this[input], input);
|
|
329
|
+
});
|
|
330
|
+
};
|
|
214
331
|
ColorPickerComponent.prototype.ngOnChanges = function (changes) {
|
|
215
332
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
216
|
-
this.
|
|
333
|
+
this.activeView = 'palette';
|
|
217
334
|
}
|
|
218
|
-
if (this.
|
|
335
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
219
336
|
this.format = 'rgba';
|
|
220
|
-
this.value =
|
|
337
|
+
this.value = utils_1.parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
221
338
|
}
|
|
222
339
|
};
|
|
223
340
|
ColorPickerComponent.prototype.ngOnDestroy = function () {
|
|
@@ -226,10 +343,26 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
226
343
|
this.dynamicRTLSubscription.unsubscribe();
|
|
227
344
|
}
|
|
228
345
|
};
|
|
346
|
+
Object.defineProperty(ColorPickerComponent.prototype, "colorPickerAriaLabel", {
|
|
347
|
+
/**
|
|
348
|
+
* @hidden
|
|
349
|
+
*/
|
|
350
|
+
get: function () {
|
|
351
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
352
|
+
},
|
|
353
|
+
enumerable: true,
|
|
354
|
+
configurable: true
|
|
355
|
+
});
|
|
356
|
+
/**
|
|
357
|
+
* @hidden
|
|
358
|
+
*/
|
|
359
|
+
ColorPickerComponent.prototype.handleCancelEvent = function (ev) {
|
|
360
|
+
this.cancel.emit(ev);
|
|
361
|
+
};
|
|
229
362
|
/**
|
|
230
363
|
* @hidden
|
|
231
364
|
*/
|
|
232
|
-
ColorPickerComponent.prototype.
|
|
365
|
+
ColorPickerComponent.prototype.togglePopup = function () {
|
|
233
366
|
this.toggleWithEvents(!this.isOpen);
|
|
234
367
|
this.focus();
|
|
235
368
|
};
|
|
@@ -238,10 +371,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
238
371
|
*/
|
|
239
372
|
ColorPickerComponent.prototype.handleActiveColorClick = function () {
|
|
240
373
|
this.focus();
|
|
241
|
-
var event = new
|
|
374
|
+
var event = new events_1.ActiveColorClickEvent(this.value);
|
|
242
375
|
this.activeColorClick.emit(event);
|
|
243
376
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
244
|
-
this.
|
|
377
|
+
this.togglePopup();
|
|
245
378
|
}
|
|
246
379
|
};
|
|
247
380
|
/**
|
|
@@ -257,9 +390,6 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
257
390
|
* @hidden
|
|
258
391
|
*/
|
|
259
392
|
ColorPickerComponent.prototype.handleWrapperFocus = function () {
|
|
260
|
-
if (utils_1.isPresent(this.palette)) {
|
|
261
|
-
this.palette.nativeElement.focus();
|
|
262
|
-
}
|
|
263
393
|
if (this.isFocused) {
|
|
264
394
|
return;
|
|
265
395
|
}
|
|
@@ -284,10 +414,10 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
284
414
|
this.notifyNgTouched();
|
|
285
415
|
};
|
|
286
416
|
/**
|
|
287
|
-
* Clears the
|
|
417
|
+
* Clears the value of the ColorPicker.
|
|
288
418
|
*/
|
|
289
419
|
ColorPickerComponent.prototype.reset = function () {
|
|
290
|
-
if (!
|
|
420
|
+
if (!utils_2.isPresent(this.value)) {
|
|
291
421
|
return;
|
|
292
422
|
}
|
|
293
423
|
this._value = undefined;
|
|
@@ -304,7 +434,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
304
434
|
return;
|
|
305
435
|
}
|
|
306
436
|
this.closePopup();
|
|
307
|
-
open =
|
|
437
|
+
open = utils_2.isPresent(open) ? open : !this.isOpen;
|
|
308
438
|
if (open) {
|
|
309
439
|
this.openPopup();
|
|
310
440
|
}
|
|
@@ -312,13 +442,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
312
442
|
/**
|
|
313
443
|
* @hidden
|
|
314
444
|
*/
|
|
315
|
-
ColorPickerComponent.prototype.handleValueChange = function (color
|
|
316
|
-
var parsedColor =
|
|
445
|
+
ColorPickerComponent.prototype.handleValueChange = function (color) {
|
|
446
|
+
var parsedColor = utils_1.parseColor(color, this.format, this.gradientSettings.opacity);
|
|
317
447
|
var valueChange = parsedColor !== this.value;
|
|
318
|
-
if (closePopup) {
|
|
319
|
-
this.toggleWithEvents(false);
|
|
320
|
-
this.focus();
|
|
321
|
-
}
|
|
322
448
|
if (valueChange) {
|
|
323
449
|
this.value = parsedColor;
|
|
324
450
|
this.valueChange.emit(parsedColor);
|
|
@@ -329,9 +455,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
329
455
|
* @hidden
|
|
330
456
|
*/
|
|
331
457
|
ColorPickerComponent.prototype.handlePopupBlur = function (event) {
|
|
332
|
-
|
|
333
|
-
var wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
334
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
458
|
+
if (this.popupBlurInvalid(event)) {
|
|
335
459
|
return;
|
|
336
460
|
}
|
|
337
461
|
this.isFocused = false;
|
|
@@ -382,53 +506,67 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
382
506
|
this.wrapper.nativeElement.focus();
|
|
383
507
|
}
|
|
384
508
|
if (event.keyCode === kendo_angular_common_1.Keys.Tab) {
|
|
385
|
-
var
|
|
386
|
-
var
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
event.preventDefault();
|
|
391
|
-
lastElement.focus();
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
if (event.target === lastElement) {
|
|
397
|
-
event.preventDefault();
|
|
398
|
-
firstElement.focus();
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
509
|
+
var currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
510
|
+
var nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
511
|
+
if (event.target === currentElement) {
|
|
512
|
+
event.preventDefault();
|
|
513
|
+
nextElement.nativeElement.focus();
|
|
401
514
|
}
|
|
402
515
|
}
|
|
403
516
|
};
|
|
404
517
|
/**
|
|
405
518
|
* @hidden
|
|
406
|
-
* Used by the
|
|
519
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
407
520
|
*/
|
|
408
521
|
ColorPickerComponent.prototype.isEmpty = function () {
|
|
409
522
|
return false;
|
|
410
523
|
};
|
|
524
|
+
ColorPickerComponent.prototype.handleClasses = function (value, input) {
|
|
525
|
+
var elem = this.host.nativeElement;
|
|
526
|
+
var classes = utils_2.getStylingClasses('picker', input, this[input], value);
|
|
527
|
+
if (classes.toRemove) {
|
|
528
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
529
|
+
}
|
|
530
|
+
if (classes.toAdd) {
|
|
531
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
|
|
535
|
+
var focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
536
|
+
var wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
537
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
538
|
+
};
|
|
411
539
|
ColorPickerComponent.prototype.toggleWithEvents = function (open) {
|
|
412
|
-
var _this = this;
|
|
413
540
|
var sameState = this.isOpen === open;
|
|
414
541
|
if (this.disabled || this.readonly || sameState) {
|
|
415
542
|
return;
|
|
416
543
|
}
|
|
417
|
-
var eventArgs
|
|
418
|
-
|
|
544
|
+
var eventArgs;
|
|
545
|
+
if (open) {
|
|
546
|
+
eventArgs = new events_1.ColorPickerOpenEvent();
|
|
547
|
+
this.open.emit(eventArgs);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
eventArgs = new events_1.ColorPickerCloseEvent();
|
|
551
|
+
this.close.emit(eventArgs);
|
|
552
|
+
}
|
|
419
553
|
if (!eventArgs.isDefaultPrevented()) {
|
|
420
554
|
this.toggle(open);
|
|
421
555
|
}
|
|
422
556
|
if (open) {
|
|
423
|
-
this.
|
|
424
|
-
setTimeout(function () {
|
|
425
|
-
if (_this.colorGradient) {
|
|
426
|
-
_this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
});
|
|
557
|
+
this.focusFirstElement();
|
|
430
558
|
}
|
|
431
559
|
};
|
|
560
|
+
ColorPickerComponent.prototype.focusFirstElement = function () {
|
|
561
|
+
var _this = this;
|
|
562
|
+
this.ngZone.runOutsideAngular(function () {
|
|
563
|
+
setTimeout(function () {
|
|
564
|
+
var elementToFocus = _this.flatColorPicker.gradient ? _this.flatColorPicker.gradient.gradientDragHandle :
|
|
565
|
+
_this.flatColorPicker.palette.host;
|
|
566
|
+
elementToFocus.nativeElement.focus();
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
};
|
|
432
570
|
ColorPickerComponent.prototype.openPopup = function () {
|
|
433
571
|
var _this = this;
|
|
434
572
|
var horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
@@ -459,12 +597,35 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
459
597
|
}
|
|
460
598
|
this.popupRef.close();
|
|
461
599
|
this.popupRef = null;
|
|
462
|
-
this.palette = null;
|
|
463
600
|
};
|
|
601
|
+
Object.defineProperty(ColorPickerComponent.prototype, "firstFocusableElement", {
|
|
602
|
+
get: function () {
|
|
603
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
604
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
605
|
+
}
|
|
606
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
607
|
+
},
|
|
608
|
+
enumerable: true,
|
|
609
|
+
configurable: true
|
|
610
|
+
});
|
|
611
|
+
Object.defineProperty(ColorPickerComponent.prototype, "lastFocusableElement", {
|
|
612
|
+
get: function () {
|
|
613
|
+
if (this.preview) {
|
|
614
|
+
return this.flatColorPicker.footer.lastButton;
|
|
615
|
+
}
|
|
616
|
+
if (this.flatColorPicker.palette) {
|
|
617
|
+
return this.flatColorPicker.palette.host;
|
|
618
|
+
}
|
|
619
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
620
|
+
},
|
|
621
|
+
enumerable: true,
|
|
622
|
+
configurable: true
|
|
623
|
+
});
|
|
464
624
|
var ColorPickerComponent_1;
|
|
465
625
|
tslib_1.__decorate([
|
|
466
|
-
core_1.HostBinding('class.k-widget'),
|
|
467
626
|
core_1.HostBinding('class.k-colorpicker'),
|
|
627
|
+
core_1.HostBinding('class.k-icon-picker'),
|
|
628
|
+
core_1.HostBinding('class.k-picker'),
|
|
468
629
|
tslib_1.__metadata("design:type", Boolean)
|
|
469
630
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
470
631
|
tslib_1.__decorate([
|
|
@@ -475,10 +636,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
475
636
|
core_1.Input(),
|
|
476
637
|
tslib_1.__metadata("design:type", String)
|
|
477
638
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
639
|
+
tslib_1.__decorate([
|
|
640
|
+
core_1.Input(),
|
|
641
|
+
tslib_1.__metadata("design:type", Array)
|
|
642
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
478
643
|
tslib_1.__decorate([
|
|
479
644
|
core_1.Input(),
|
|
480
645
|
tslib_1.__metadata("design:type", String)
|
|
481
|
-
], ColorPickerComponent.prototype, "
|
|
646
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
482
647
|
tslib_1.__decorate([
|
|
483
648
|
core_1.Input(),
|
|
484
649
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -519,11 +684,38 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
519
684
|
core_1.Input(),
|
|
520
685
|
tslib_1.__metadata("design:type", Object)
|
|
521
686
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
687
|
+
tslib_1.__decorate([
|
|
688
|
+
core_1.Input(),
|
|
689
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
690
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
522
691
|
tslib_1.__decorate([
|
|
523
692
|
core_1.Input(),
|
|
524
693
|
tslib_1.__metadata("design:type", Number),
|
|
525
694
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
526
695
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
696
|
+
tslib_1.__decorate([
|
|
697
|
+
core_1.Input(),
|
|
698
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
699
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
700
|
+
tslib_1.__decorate([
|
|
701
|
+
core_1.Input(),
|
|
702
|
+
tslib_1.__metadata("design:type", String)
|
|
703
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
704
|
+
tslib_1.__decorate([
|
|
705
|
+
core_1.Input(),
|
|
706
|
+
tslib_1.__metadata("design:type", String),
|
|
707
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
708
|
+
], ColorPickerComponent.prototype, "size", null);
|
|
709
|
+
tslib_1.__decorate([
|
|
710
|
+
core_1.Input(),
|
|
711
|
+
tslib_1.__metadata("design:type", String),
|
|
712
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
713
|
+
], ColorPickerComponent.prototype, "rounded", null);
|
|
714
|
+
tslib_1.__decorate([
|
|
715
|
+
core_1.Input(),
|
|
716
|
+
tslib_1.__metadata("design:type", String),
|
|
717
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
718
|
+
], ColorPickerComponent.prototype, "fillMode", null);
|
|
527
719
|
tslib_1.__decorate([
|
|
528
720
|
core_1.Output(),
|
|
529
721
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -544,10 +736,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
544
736
|
core_1.Output('blur'),
|
|
545
737
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
546
738
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
739
|
+
tslib_1.__decorate([
|
|
740
|
+
core_1.Output(),
|
|
741
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
742
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
547
743
|
tslib_1.__decorate([
|
|
548
744
|
core_1.Output(),
|
|
549
745
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
550
746
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
747
|
+
tslib_1.__decorate([
|
|
748
|
+
core_1.Output(),
|
|
749
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
750
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
551
751
|
tslib_1.__decorate([
|
|
552
752
|
core_1.ViewChild('container', { read: core_1.ViewContainerRef, static: true }),
|
|
553
753
|
tslib_1.__metadata("design:type", core_1.ViewContainerRef)
|
|
@@ -561,15 +761,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
561
761
|
tslib_1.__metadata("design:type", core_1.TemplateRef)
|
|
562
762
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
563
763
|
tslib_1.__decorate([
|
|
564
|
-
core_1.ViewChild('
|
|
565
|
-
tslib_1.__metadata("design:type",
|
|
566
|
-
], ColorPickerComponent.prototype, "
|
|
567
|
-
tslib_1.__decorate([
|
|
568
|
-
core_1.ViewChild('colorGradient', { static: false }),
|
|
569
|
-
tslib_1.__metadata("design:type", color_gradient_component_1.ColorGradientComponent)
|
|
570
|
-
], ColorPickerComponent.prototype, "colorGradient", void 0);
|
|
764
|
+
core_1.ViewChild('flatColorPicker', { static: false }),
|
|
765
|
+
tslib_1.__metadata("design:type", flatcolorpicker_component_1.FlatColorPickerComponent)
|
|
766
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
571
767
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
572
768
|
core_1.Component({
|
|
769
|
+
exportAs: 'kendoColorPicker',
|
|
573
770
|
selector: 'kendo-colorpicker',
|
|
574
771
|
providers: [{
|
|
575
772
|
multi: true,
|
|
@@ -589,12 +786,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
589
786
|
useValue: 'kendo.colorpicker'
|
|
590
787
|
}
|
|
591
788
|
],
|
|
592
|
-
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-
|
|
789
|
+
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 "
|
|
593
790
|
}),
|
|
594
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
791
|
+
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
792
|
+
kendo_angular_popup_1.PopupService,
|
|
595
793
|
core_1.ChangeDetectorRef,
|
|
596
794
|
kendo_angular_l10n_1.LocalizationService,
|
|
597
|
-
core_1.NgZone
|
|
795
|
+
core_1.NgZone,
|
|
796
|
+
core_1.Renderer2])
|
|
598
797
|
], ColorPickerComponent);
|
|
599
798
|
return ColorPickerComponent;
|
|
600
799
|
}());
|
|
@@ -24,3 +24,15 @@ exports.AAA_RATIO = 7.0;
|
|
|
24
24
|
* @hidden
|
|
25
25
|
*/
|
|
26
26
|
exports.AA_RATIO = 4.5;
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
exports.DEFAULT_PRESET = 'office';
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
exports.DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
exports.STEP_COUNT = 16;
|