@progress/kendo-angular-inputs 7.5.2-dev.202111191702 → 8.0.0-dev.202112251033
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 +297 -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/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-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 +129 -23
- package/dist/es2015/colorpicker/colorpicker.component.js +319 -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/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 +3114 -1478
- package/dist/fesm5/index.js +3114 -1462
- 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 +303 -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/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 -10
- 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
|
@@ -3,66 +3,96 @@
|
|
|
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
|
+
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
8
9
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
9
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import { packageMetadata } from '../package-metadata';
|
|
11
|
-
import { PreventableEvent, ActiveColorClickEvent } from './models';
|
|
12
|
-
import { parseColor } from './utils/color-parser';
|
|
13
|
-
import { isPresent } from '../common/utils';
|
|
14
11
|
import { Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
15
12
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
16
|
-
import {
|
|
13
|
+
import { packageMetadata } from '../package-metadata';
|
|
14
|
+
import { PALETTEPRESETS } from './models';
|
|
15
|
+
import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
|
|
16
|
+
import { parseColor } from './utils';
|
|
17
|
+
import { getStylingClasses, isPresent } from '../common/utils';
|
|
17
18
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
18
|
-
import {
|
|
19
|
-
var DEFAULT_PRESET = 'office';
|
|
20
|
-
var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
19
|
+
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
21
20
|
var serial = 0;
|
|
22
21
|
/**
|
|
23
22
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
24
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
|
|
25
|
+
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
25
26
|
*/
|
|
26
27
|
var ColorPickerComponent = /** @class */ (function () {
|
|
27
|
-
function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
|
|
28
|
+
function ColorPickerComponent(host, popupService, cdr, localizationService, ngZone, renderer) {
|
|
28
29
|
var _this = this;
|
|
30
|
+
this.host = host;
|
|
29
31
|
this.popupService = popupService;
|
|
30
32
|
this.cdr = cdr;
|
|
31
33
|
this.localizationService = localizationService;
|
|
32
34
|
this.ngZone = ngZone;
|
|
33
|
-
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
35
|
+
this.renderer = renderer;
|
|
36
36
|
this.hostClasses = true;
|
|
37
37
|
/**
|
|
38
38
|
* @hidden
|
|
39
39
|
*/
|
|
40
40
|
this.focusableId = "k-colorpicker-" + serial++;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Specifies the views that will be rendered in the popup.
|
|
43
|
+
* By default both the gradient and palette views will be rendered.
|
|
43
44
|
*/
|
|
44
|
-
this.
|
|
45
|
+
this.views = ['gradient', 'palette'];
|
|
45
46
|
/**
|
|
46
47
|
* Sets the read-only state of the ColorPicker.
|
|
48
|
+
*
|
|
49
|
+
* @default false
|
|
47
50
|
*/
|
|
48
51
|
this.readonly = false;
|
|
49
52
|
/**
|
|
50
53
|
* Sets the disabled state of the ColorPicker.
|
|
54
|
+
*
|
|
55
|
+
* @default false
|
|
51
56
|
*/
|
|
52
57
|
this.disabled = false;
|
|
53
58
|
/**
|
|
54
59
|
* Specifies the output format of the ColorPicker.
|
|
55
|
-
* The input value may be in a different format. However, it will be parsed into the output `format`
|
|
56
|
-
* after the component processes it.
|
|
57
60
|
*
|
|
58
|
-
* If the
|
|
61
|
+
* If the input value is in a different format, it will be parsed into the specified output `format`.
|
|
59
62
|
*
|
|
60
63
|
* The supported values are:
|
|
61
64
|
* * `rgba` (default)
|
|
62
65
|
* * `hex`
|
|
63
|
-
* * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
|
|
64
66
|
*/
|
|
65
67
|
this.format = 'rgba';
|
|
68
|
+
/**
|
|
69
|
+
* Specifies whether the ColorPicker should display a 'Clear color' button.
|
|
70
|
+
*
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
this.clearButton = true;
|
|
74
|
+
/**
|
|
75
|
+
* Displays `Apply` and `Cancel` action buttons and color preview panes.
|
|
76
|
+
*
|
|
77
|
+
* When enabled, the component value will not change immediately upon
|
|
78
|
+
* color selection, but only after the `Apply` button is clicked.
|
|
79
|
+
*
|
|
80
|
+
* The `Cancel` button reverts the current selection to its
|
|
81
|
+
* previous state i.e. to the current value.
|
|
82
|
+
*
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
this.preview = false;
|
|
86
|
+
/**
|
|
87
|
+
* Configures the layout of the `Apply` and `Cancel` action buttons.
|
|
88
|
+
*
|
|
89
|
+
* The possible values are:
|
|
90
|
+
* * `start`
|
|
91
|
+
* * `center`
|
|
92
|
+
* * `end` (default)
|
|
93
|
+
* * `stretch`
|
|
94
|
+
*/
|
|
95
|
+
this.actionsLayout = 'end';
|
|
66
96
|
/**
|
|
67
97
|
* Fires each time the value is changed.
|
|
68
98
|
*/
|
|
@@ -85,6 +115,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
85
115
|
* Fires each time the ColorPicker is blurred.
|
|
86
116
|
*/
|
|
87
117
|
this.onBlur = new EventEmitter();
|
|
118
|
+
/**
|
|
119
|
+
* Fires when the user cancels the current color selection.
|
|
120
|
+
*
|
|
121
|
+
* Fires on preview pane or 'Cancel' button click.
|
|
122
|
+
*/
|
|
123
|
+
this.cancel = new EventEmitter();
|
|
88
124
|
/**
|
|
89
125
|
* Fires each time the left side of the ColorPicker wrapper is clicked.
|
|
90
126
|
* The event is triggered regardless of whether a ColorPicker icon is set or not.
|
|
@@ -92,10 +128,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
92
128
|
* The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
|
|
93
129
|
*/
|
|
94
130
|
this.activeColorClick = new EventEmitter();
|
|
131
|
+
/**
|
|
132
|
+
* Fires each time the view is about to change.
|
|
133
|
+
* Used to provide a two-way binding for the `activeView` property.
|
|
134
|
+
*/
|
|
135
|
+
this.activeViewChange = new EventEmitter();
|
|
95
136
|
this._tabindex = 0;
|
|
96
137
|
this._popupSettings = { animate: true };
|
|
97
138
|
this._paletteSettings = {};
|
|
98
|
-
this._gradientSettings = { opacity: true,
|
|
139
|
+
this._gradientSettings = { opacity: true, delay: 0 };
|
|
140
|
+
this._size = 'medium';
|
|
141
|
+
this._rounded = 'medium';
|
|
142
|
+
this._fillMode = 'solid';
|
|
99
143
|
this.notifyNgTouched = function () { };
|
|
100
144
|
this.notifyNgChanged = function () { };
|
|
101
145
|
validatePackage(packageMetadata);
|
|
@@ -105,6 +149,19 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
105
149
|
});
|
|
106
150
|
}
|
|
107
151
|
ColorPickerComponent_1 = ColorPickerComponent;
|
|
152
|
+
Object.defineProperty(ColorPickerComponent.prototype, "view", {
|
|
153
|
+
get: function () {
|
|
154
|
+
return (this.views && this.views.length > 0) ? this.views[0] : null;
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* @hidden
|
|
158
|
+
*/
|
|
159
|
+
set: function (view) {
|
|
160
|
+
this.views = [view];
|
|
161
|
+
},
|
|
162
|
+
enumerable: true,
|
|
163
|
+
configurable: true
|
|
164
|
+
});
|
|
108
165
|
Object.defineProperty(ColorPickerComponent.prototype, "value", {
|
|
109
166
|
get: function () {
|
|
110
167
|
return this._value;
|
|
@@ -113,7 +170,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
113
170
|
* Specifies the value of the initially selected color.
|
|
114
171
|
*/
|
|
115
172
|
set: function (value) {
|
|
116
|
-
this._value = parseColor(value, this.format);
|
|
173
|
+
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
117
174
|
},
|
|
118
175
|
enumerable: true,
|
|
119
176
|
configurable: true
|
|
@@ -163,6 +220,8 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
163
220
|
},
|
|
164
221
|
/**
|
|
165
222
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
223
|
+
*
|
|
224
|
+
* @default 0
|
|
166
225
|
*/
|
|
167
226
|
set: function (value) {
|
|
168
227
|
var tabindex = Number(value);
|
|
@@ -172,6 +231,70 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
172
231
|
enumerable: true,
|
|
173
232
|
configurable: true
|
|
174
233
|
});
|
|
234
|
+
Object.defineProperty(ColorPickerComponent.prototype, "size", {
|
|
235
|
+
get: function () {
|
|
236
|
+
return this._size;
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* The size property specifies the font size and line height of the ColorPicker
|
|
240
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-size)).
|
|
241
|
+
*
|
|
242
|
+
* The possible values are:
|
|
243
|
+
* * `'small'`
|
|
244
|
+
* * `'medium'` (default)
|
|
245
|
+
* * `'large'`
|
|
246
|
+
* * `null`
|
|
247
|
+
*/
|
|
248
|
+
set: function (size) {
|
|
249
|
+
this.handleClasses(size, 'size');
|
|
250
|
+
this._size = size;
|
|
251
|
+
},
|
|
252
|
+
enumerable: true,
|
|
253
|
+
configurable: true
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(ColorPickerComponent.prototype, "rounded", {
|
|
256
|
+
get: function () {
|
|
257
|
+
return this._rounded;
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* The rounded property specifies the border radius of the ColorPicker
|
|
261
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
|
|
262
|
+
*
|
|
263
|
+
* The possible values are:
|
|
264
|
+
* * `'small'`
|
|
265
|
+
* * `'medium'` (default)
|
|
266
|
+
* * `'large'`
|
|
267
|
+
* * `'full'`
|
|
268
|
+
* * `null`
|
|
269
|
+
*/
|
|
270
|
+
set: function (rounded) {
|
|
271
|
+
this.handleClasses(rounded, 'rounded');
|
|
272
|
+
this._rounded = rounded;
|
|
273
|
+
},
|
|
274
|
+
enumerable: true,
|
|
275
|
+
configurable: true
|
|
276
|
+
});
|
|
277
|
+
Object.defineProperty(ColorPickerComponent.prototype, "fillMode", {
|
|
278
|
+
get: function () {
|
|
279
|
+
return this._fillMode;
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* The fillMode property specifies the background and border styles of the ColorPicker
|
|
283
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
|
|
284
|
+
*
|
|
285
|
+
* The possible values are:
|
|
286
|
+
* * `'flat'`
|
|
287
|
+
* * `'solid'` (default)
|
|
288
|
+
* * `'outline'`
|
|
289
|
+
* * `null`
|
|
290
|
+
*/
|
|
291
|
+
set: function (fillMode) {
|
|
292
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
293
|
+
this._fillMode = fillMode;
|
|
294
|
+
},
|
|
295
|
+
enumerable: true,
|
|
296
|
+
configurable: true
|
|
297
|
+
});
|
|
175
298
|
Object.defineProperty(ColorPickerComponent.prototype, "isOpen", {
|
|
176
299
|
/**
|
|
177
300
|
* Indicates whether the ColorPicker popup is open.
|
|
@@ -209,13 +332,20 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
209
332
|
columns: this._paletteSettings.columns || presetColumns || 10
|
|
210
333
|
};
|
|
211
334
|
};
|
|
335
|
+
ColorPickerComponent.prototype.ngAfterViewInit = function () {
|
|
336
|
+
var _this = this;
|
|
337
|
+
var stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
338
|
+
stylingInputs.forEach(function (input) {
|
|
339
|
+
_this.handleClasses(_this[input], input);
|
|
340
|
+
});
|
|
341
|
+
};
|
|
212
342
|
ColorPickerComponent.prototype.ngOnChanges = function (changes) {
|
|
213
343
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
214
|
-
this.
|
|
344
|
+
this.activeView = 'palette';
|
|
215
345
|
}
|
|
216
|
-
if (this.
|
|
346
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
217
347
|
this.format = 'rgba';
|
|
218
|
-
this.value = parseColor(this.value, this.format);
|
|
348
|
+
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
219
349
|
}
|
|
220
350
|
};
|
|
221
351
|
ColorPickerComponent.prototype.ngOnDestroy = function () {
|
|
@@ -224,10 +354,26 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
224
354
|
this.dynamicRTLSubscription.unsubscribe();
|
|
225
355
|
}
|
|
226
356
|
};
|
|
357
|
+
Object.defineProperty(ColorPickerComponent.prototype, "colorPickerAriaLabel", {
|
|
358
|
+
/**
|
|
359
|
+
* @hidden
|
|
360
|
+
*/
|
|
361
|
+
get: function () {
|
|
362
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
363
|
+
},
|
|
364
|
+
enumerable: true,
|
|
365
|
+
configurable: true
|
|
366
|
+
});
|
|
227
367
|
/**
|
|
228
368
|
* @hidden
|
|
229
369
|
*/
|
|
230
|
-
ColorPickerComponent.prototype.
|
|
370
|
+
ColorPickerComponent.prototype.handleCancelEvent = function (ev) {
|
|
371
|
+
this.cancel.emit(ev);
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* @hidden
|
|
375
|
+
*/
|
|
376
|
+
ColorPickerComponent.prototype.togglePopup = function () {
|
|
231
377
|
this.toggleWithEvents(!this.isOpen);
|
|
232
378
|
this.focus();
|
|
233
379
|
};
|
|
@@ -239,7 +385,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
239
385
|
var event = new ActiveColorClickEvent(this.value);
|
|
240
386
|
this.activeColorClick.emit(event);
|
|
241
387
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
242
|
-
this.
|
|
388
|
+
this.togglePopup();
|
|
243
389
|
}
|
|
244
390
|
};
|
|
245
391
|
/**
|
|
@@ -255,9 +401,6 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
255
401
|
* @hidden
|
|
256
402
|
*/
|
|
257
403
|
ColorPickerComponent.prototype.handleWrapperFocus = function () {
|
|
258
|
-
if (isPresent(this.palette)) {
|
|
259
|
-
this.palette.nativeElement.focus();
|
|
260
|
-
}
|
|
261
404
|
if (this.isFocused) {
|
|
262
405
|
return;
|
|
263
406
|
}
|
|
@@ -282,7 +425,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
282
425
|
this.notifyNgTouched();
|
|
283
426
|
};
|
|
284
427
|
/**
|
|
285
|
-
* Clears the
|
|
428
|
+
* Clears the value of the ColorPicker.
|
|
286
429
|
*/
|
|
287
430
|
ColorPickerComponent.prototype.reset = function () {
|
|
288
431
|
if (!isPresent(this.value)) {
|
|
@@ -310,13 +453,9 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
310
453
|
/**
|
|
311
454
|
* @hidden
|
|
312
455
|
*/
|
|
313
|
-
ColorPickerComponent.prototype.handleValueChange = function (color
|
|
314
|
-
var parsedColor = parseColor(color, this.format);
|
|
456
|
+
ColorPickerComponent.prototype.handleValueChange = function (color) {
|
|
457
|
+
var parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
|
|
315
458
|
var valueChange = parsedColor !== this.value;
|
|
316
|
-
if (closePopup) {
|
|
317
|
-
this.toggleWithEvents(false);
|
|
318
|
-
this.focus();
|
|
319
|
-
}
|
|
320
459
|
if (valueChange) {
|
|
321
460
|
this.value = parsedColor;
|
|
322
461
|
this.valueChange.emit(parsedColor);
|
|
@@ -327,9 +466,7 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
327
466
|
* @hidden
|
|
328
467
|
*/
|
|
329
468
|
ColorPickerComponent.prototype.handlePopupBlur = function (event) {
|
|
330
|
-
|
|
331
|
-
var wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
332
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
469
|
+
if (this.popupBlurInvalid(event)) {
|
|
333
470
|
return;
|
|
334
471
|
}
|
|
335
472
|
this.isFocused = false;
|
|
@@ -380,53 +517,67 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
380
517
|
this.wrapper.nativeElement.focus();
|
|
381
518
|
}
|
|
382
519
|
if (event.keyCode === Keys.Tab) {
|
|
383
|
-
var
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
event.preventDefault();
|
|
389
|
-
lastElement.focus();
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
if (event.target === lastElement) {
|
|
395
|
-
event.preventDefault();
|
|
396
|
-
firstElement.focus();
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
520
|
+
var currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
521
|
+
var nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
522
|
+
if (event.target === currentElement) {
|
|
523
|
+
event.preventDefault();
|
|
524
|
+
nextElement.nativeElement.focus();
|
|
399
525
|
}
|
|
400
526
|
}
|
|
401
527
|
};
|
|
402
528
|
/**
|
|
403
529
|
* @hidden
|
|
404
|
-
* Used by the
|
|
530
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
405
531
|
*/
|
|
406
532
|
ColorPickerComponent.prototype.isEmpty = function () {
|
|
407
533
|
return false;
|
|
408
534
|
};
|
|
535
|
+
ColorPickerComponent.prototype.handleClasses = function (value, input) {
|
|
536
|
+
var elem = this.host.nativeElement;
|
|
537
|
+
var classes = getStylingClasses('picker', input, this[input], value);
|
|
538
|
+
if (classes.toRemove) {
|
|
539
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
540
|
+
}
|
|
541
|
+
if (classes.toAdd) {
|
|
542
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
|
|
546
|
+
var focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
547
|
+
var wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
548
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
549
|
+
};
|
|
409
550
|
ColorPickerComponent.prototype.toggleWithEvents = function (open) {
|
|
410
|
-
var _this = this;
|
|
411
551
|
var sameState = this.isOpen === open;
|
|
412
552
|
if (this.disabled || this.readonly || sameState) {
|
|
413
553
|
return;
|
|
414
554
|
}
|
|
415
|
-
var eventArgs
|
|
416
|
-
|
|
555
|
+
var eventArgs;
|
|
556
|
+
if (open) {
|
|
557
|
+
eventArgs = new ColorPickerOpenEvent();
|
|
558
|
+
this.open.emit(eventArgs);
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
eventArgs = new ColorPickerCloseEvent();
|
|
562
|
+
this.close.emit(eventArgs);
|
|
563
|
+
}
|
|
417
564
|
if (!eventArgs.isDefaultPrevented()) {
|
|
418
565
|
this.toggle(open);
|
|
419
566
|
}
|
|
420
567
|
if (open) {
|
|
421
|
-
this.
|
|
422
|
-
setTimeout(function () {
|
|
423
|
-
if (_this.colorGradient) {
|
|
424
|
-
_this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
});
|
|
568
|
+
this.focusFirstElement();
|
|
428
569
|
}
|
|
429
570
|
};
|
|
571
|
+
ColorPickerComponent.prototype.focusFirstElement = function () {
|
|
572
|
+
var _this = this;
|
|
573
|
+
this.ngZone.runOutsideAngular(function () {
|
|
574
|
+
setTimeout(function () {
|
|
575
|
+
var elementToFocus = _this.flatColorPicker.gradient ? _this.flatColorPicker.gradient.gradientDragHandle :
|
|
576
|
+
_this.flatColorPicker.palette.host;
|
|
577
|
+
elementToFocus.nativeElement.focus();
|
|
578
|
+
});
|
|
579
|
+
});
|
|
580
|
+
};
|
|
430
581
|
ColorPickerComponent.prototype.openPopup = function () {
|
|
431
582
|
var _this = this;
|
|
432
583
|
var horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
@@ -457,12 +608,35 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
457
608
|
}
|
|
458
609
|
this.popupRef.close();
|
|
459
610
|
this.popupRef = null;
|
|
460
|
-
this.palette = null;
|
|
461
611
|
};
|
|
612
|
+
Object.defineProperty(ColorPickerComponent.prototype, "firstFocusableElement", {
|
|
613
|
+
get: function () {
|
|
614
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
615
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
616
|
+
}
|
|
617
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
618
|
+
},
|
|
619
|
+
enumerable: true,
|
|
620
|
+
configurable: true
|
|
621
|
+
});
|
|
622
|
+
Object.defineProperty(ColorPickerComponent.prototype, "lastFocusableElement", {
|
|
623
|
+
get: function () {
|
|
624
|
+
if (this.preview) {
|
|
625
|
+
return this.flatColorPicker.footer.lastButton;
|
|
626
|
+
}
|
|
627
|
+
if (this.flatColorPicker.palette) {
|
|
628
|
+
return this.flatColorPicker.palette.host;
|
|
629
|
+
}
|
|
630
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
631
|
+
},
|
|
632
|
+
enumerable: true,
|
|
633
|
+
configurable: true
|
|
634
|
+
});
|
|
462
635
|
var ColorPickerComponent_1;
|
|
463
636
|
tslib_1.__decorate([
|
|
464
|
-
HostBinding('class.k-widget'),
|
|
465
637
|
HostBinding('class.k-colorpicker'),
|
|
638
|
+
HostBinding('class.k-icon-picker'),
|
|
639
|
+
HostBinding('class.k-picker'),
|
|
466
640
|
tslib_1.__metadata("design:type", Boolean)
|
|
467
641
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
468
642
|
tslib_1.__decorate([
|
|
@@ -473,10 +647,19 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
473
647
|
Input(),
|
|
474
648
|
tslib_1.__metadata("design:type", String)
|
|
475
649
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
650
|
+
tslib_1.__decorate([
|
|
651
|
+
Input(),
|
|
652
|
+
tslib_1.__metadata("design:type", Array)
|
|
653
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
654
|
+
tslib_1.__decorate([
|
|
655
|
+
Input(),
|
|
656
|
+
tslib_1.__metadata("design:type", String),
|
|
657
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
658
|
+
], ColorPickerComponent.prototype, "view", null);
|
|
476
659
|
tslib_1.__decorate([
|
|
477
660
|
Input(),
|
|
478
661
|
tslib_1.__metadata("design:type", String)
|
|
479
|
-
], ColorPickerComponent.prototype, "
|
|
662
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
480
663
|
tslib_1.__decorate([
|
|
481
664
|
Input(),
|
|
482
665
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -517,11 +700,38 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
517
700
|
Input(),
|
|
518
701
|
tslib_1.__metadata("design:type", Object)
|
|
519
702
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
703
|
+
tslib_1.__decorate([
|
|
704
|
+
Input(),
|
|
705
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
706
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
520
707
|
tslib_1.__decorate([
|
|
521
708
|
Input(),
|
|
522
709
|
tslib_1.__metadata("design:type", Number),
|
|
523
710
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
524
711
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
712
|
+
tslib_1.__decorate([
|
|
713
|
+
Input(),
|
|
714
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
715
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
716
|
+
tslib_1.__decorate([
|
|
717
|
+
Input(),
|
|
718
|
+
tslib_1.__metadata("design:type", String)
|
|
719
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
720
|
+
tslib_1.__decorate([
|
|
721
|
+
Input(),
|
|
722
|
+
tslib_1.__metadata("design:type", String),
|
|
723
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
724
|
+
], ColorPickerComponent.prototype, "size", null);
|
|
725
|
+
tslib_1.__decorate([
|
|
726
|
+
Input(),
|
|
727
|
+
tslib_1.__metadata("design:type", String),
|
|
728
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
729
|
+
], ColorPickerComponent.prototype, "rounded", null);
|
|
730
|
+
tslib_1.__decorate([
|
|
731
|
+
Input(),
|
|
732
|
+
tslib_1.__metadata("design:type", String),
|
|
733
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
734
|
+
], ColorPickerComponent.prototype, "fillMode", null);
|
|
525
735
|
tslib_1.__decorate([
|
|
526
736
|
Output(),
|
|
527
737
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -542,10 +752,18 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
542
752
|
Output('blur'),
|
|
543
753
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
544
754
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
755
|
+
tslib_1.__decorate([
|
|
756
|
+
Output(),
|
|
757
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
758
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
545
759
|
tslib_1.__decorate([
|
|
546
760
|
Output(),
|
|
547
761
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
548
762
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
763
|
+
tslib_1.__decorate([
|
|
764
|
+
Output(),
|
|
765
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
766
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
549
767
|
tslib_1.__decorate([
|
|
550
768
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
551
769
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -559,15 +777,12 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
559
777
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
560
778
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
561
779
|
tslib_1.__decorate([
|
|
562
|
-
ViewChild('
|
|
563
|
-
tslib_1.__metadata("design:type",
|
|
564
|
-
], ColorPickerComponent.prototype, "
|
|
565
|
-
tslib_1.__decorate([
|
|
566
|
-
ViewChild('colorGradient', { static: false }),
|
|
567
|
-
tslib_1.__metadata("design:type", ColorGradientComponent)
|
|
568
|
-
], ColorPickerComponent.prototype, "colorGradient", void 0);
|
|
780
|
+
ViewChild('flatColorPicker', { static: false }),
|
|
781
|
+
tslib_1.__metadata("design:type", FlatColorPickerComponent)
|
|
782
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
569
783
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
570
784
|
Component({
|
|
785
|
+
exportAs: 'kendoColorPicker',
|
|
571
786
|
selector: 'kendo-colorpicker',
|
|
572
787
|
providers: [{
|
|
573
788
|
multi: true,
|
|
@@ -587,12 +802,14 @@ var ColorPickerComponent = /** @class */ (function () {
|
|
|
587
802
|
useValue: 'kendo.colorpicker'
|
|
588
803
|
}
|
|
589
804
|
],
|
|
590
|
-
template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-
|
|
805
|
+
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 "
|
|
591
806
|
}),
|
|
592
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
807
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
808
|
+
PopupService,
|
|
593
809
|
ChangeDetectorRef,
|
|
594
810
|
LocalizationService,
|
|
595
|
-
NgZone
|
|
811
|
+
NgZone,
|
|
812
|
+
Renderer2])
|
|
596
813
|
], ColorPickerComponent);
|
|
597
814
|
return ColorPickerComponent;
|
|
598
815
|
}());
|
|
@@ -22,3 +22,15 @@ export var AAA_RATIO = 7.0;
|
|
|
22
22
|
* @hidden
|
|
23
23
|
*/
|
|
24
24
|
export var AA_RATIO = 4.5;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export var DEFAULT_PRESET = 'office';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export var STEP_COUNT = 16;
|