@progress/kendo-angular-inputs 7.5.2 → 8.0.0-dev.202201101634
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/slider/slider.component.js +1 -1
- 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/slider/slider.component.js +18 -23
- 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 +114 -30
- 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 +3332 -1702
- package/dist/fesm5/index.js +3115 -1463
- 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/slider/slider.component.js +1 -1
- 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 +12 -11
- 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
|
@@ -4,65 +4,95 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
var ColorPickerComponent_1;
|
|
7
|
-
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone } from '@angular/core';
|
|
7
|
+
import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { FlatColorPickerComponent } from './flatcolorpicker.component';
|
|
9
10
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
10
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
-
import { packageMetadata } from '../package-metadata';
|
|
12
|
-
import { PreventableEvent, ActiveColorClickEvent } from './models';
|
|
13
|
-
import { parseColor } from './utils/color-parser';
|
|
14
|
-
import { isPresent } from '../common/utils';
|
|
15
12
|
import { Keys, KendoInput } from '@progress/kendo-angular-common';
|
|
16
13
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
17
|
-
import {
|
|
14
|
+
import { packageMetadata } from '../package-metadata';
|
|
15
|
+
import { PALETTEPRESETS } from './models';
|
|
16
|
+
import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
|
|
17
|
+
import { parseColor } from './utils';
|
|
18
|
+
import { getStylingClasses, isPresent } from '../common/utils';
|
|
18
19
|
import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
|
|
19
|
-
import {
|
|
20
|
-
const DEFAULT_PRESET = 'office';
|
|
21
|
-
const DEFAULT_ACCESSIBLE_PRESET = 'accessible';
|
|
20
|
+
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
|
|
22
21
|
let serial = 0;
|
|
23
22
|
/**
|
|
24
23
|
* Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
|
|
25
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
|
|
26
|
+
* which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
|
|
26
27
|
*/
|
|
27
28
|
let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
28
|
-
constructor(popupService, cdr, localizationService, ngZone) {
|
|
29
|
+
constructor(host, popupService, cdr, localizationService, ngZone, renderer) {
|
|
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 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
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 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
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 = () => { };
|
|
100
144
|
this.notifyNgChanged = () => { };
|
|
101
145
|
validatePackage(packageMetadata);
|
|
@@ -103,11 +147,20 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
103
147
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
104
148
|
});
|
|
105
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* @hidden
|
|
152
|
+
*/
|
|
153
|
+
set view(view) {
|
|
154
|
+
this.views = [view];
|
|
155
|
+
}
|
|
156
|
+
get view() {
|
|
157
|
+
return (this.views && this.views.length > 0) ? this.views[0] : null;
|
|
158
|
+
}
|
|
106
159
|
/**
|
|
107
160
|
* Specifies the value of the initially selected color.
|
|
108
161
|
*/
|
|
109
162
|
set value(value) {
|
|
110
|
-
this._value = parseColor(value, this.format);
|
|
163
|
+
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
111
164
|
}
|
|
112
165
|
get value() {
|
|
113
166
|
return this._value;
|
|
@@ -141,6 +194,8 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
141
194
|
}
|
|
142
195
|
/**
|
|
143
196
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
197
|
+
*
|
|
198
|
+
* @default 0
|
|
144
199
|
*/
|
|
145
200
|
set tabindex(value) {
|
|
146
201
|
const tabindex = Number(value);
|
|
@@ -150,6 +205,58 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
150
205
|
get tabindex() {
|
|
151
206
|
return !this.disabled ? this._tabindex : undefined;
|
|
152
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* The size property specifies the font size and line height of the ColorPicker
|
|
210
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-size)).
|
|
211
|
+
*
|
|
212
|
+
* The possible values are:
|
|
213
|
+
* * `'small'`
|
|
214
|
+
* * `'medium'` (default)
|
|
215
|
+
* * `'large'`
|
|
216
|
+
* * `null`
|
|
217
|
+
*/
|
|
218
|
+
set size(size) {
|
|
219
|
+
this.handleClasses(size, 'size');
|
|
220
|
+
this._size = size;
|
|
221
|
+
}
|
|
222
|
+
get size() {
|
|
223
|
+
return this._size;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The rounded property specifies the border radius of the ColorPicker
|
|
227
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
|
|
228
|
+
*
|
|
229
|
+
* The possible values are:
|
|
230
|
+
* * `'small'`
|
|
231
|
+
* * `'medium'` (default)
|
|
232
|
+
* * `'large'`
|
|
233
|
+
* * `'full'`
|
|
234
|
+
* * `null`
|
|
235
|
+
*/
|
|
236
|
+
set rounded(rounded) {
|
|
237
|
+
this.handleClasses(rounded, 'rounded');
|
|
238
|
+
this._rounded = rounded;
|
|
239
|
+
}
|
|
240
|
+
get rounded() {
|
|
241
|
+
return this._rounded;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The fillMode property specifies the background and border styles of the ColorPicker
|
|
245
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
|
|
246
|
+
*
|
|
247
|
+
* The possible values are:
|
|
248
|
+
* * `'flat'`
|
|
249
|
+
* * `'solid'` (default)
|
|
250
|
+
* * `'outline'`
|
|
251
|
+
* * `null`
|
|
252
|
+
*/
|
|
253
|
+
set fillMode(fillMode) {
|
|
254
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
255
|
+
this._fillMode = fillMode;
|
|
256
|
+
}
|
|
257
|
+
get fillMode() {
|
|
258
|
+
return this._fillMode;
|
|
259
|
+
}
|
|
153
260
|
/**
|
|
154
261
|
* Indicates whether the ColorPicker popup is open.
|
|
155
262
|
*/
|
|
@@ -179,13 +286,19 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
179
286
|
columns: this._paletteSettings.columns || presetColumns || 10
|
|
180
287
|
};
|
|
181
288
|
}
|
|
289
|
+
ngAfterViewInit() {
|
|
290
|
+
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
291
|
+
stylingInputs.forEach(input => {
|
|
292
|
+
this.handleClasses(this[input], input);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
182
295
|
ngOnChanges(changes) {
|
|
183
296
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
184
|
-
this.
|
|
297
|
+
this.activeView = 'palette';
|
|
185
298
|
}
|
|
186
|
-
if (this.
|
|
299
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
187
300
|
this.format = 'rgba';
|
|
188
|
-
this.value = parseColor(this.value, this.format);
|
|
301
|
+
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
189
302
|
}
|
|
190
303
|
}
|
|
191
304
|
ngOnDestroy() {
|
|
@@ -197,7 +310,19 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
197
310
|
/**
|
|
198
311
|
* @hidden
|
|
199
312
|
*/
|
|
200
|
-
|
|
313
|
+
get colorPickerAriaLabel() {
|
|
314
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @hidden
|
|
318
|
+
*/
|
|
319
|
+
handleCancelEvent(ev) {
|
|
320
|
+
this.cancel.emit(ev);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @hidden
|
|
324
|
+
*/
|
|
325
|
+
togglePopup() {
|
|
201
326
|
this.toggleWithEvents(!this.isOpen);
|
|
202
327
|
this.focus();
|
|
203
328
|
}
|
|
@@ -209,7 +334,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
209
334
|
const event = new ActiveColorClickEvent(this.value);
|
|
210
335
|
this.activeColorClick.emit(event);
|
|
211
336
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
212
|
-
this.
|
|
337
|
+
this.togglePopup();
|
|
213
338
|
}
|
|
214
339
|
}
|
|
215
340
|
/**
|
|
@@ -225,9 +350,6 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
225
350
|
* @hidden
|
|
226
351
|
*/
|
|
227
352
|
handleWrapperFocus() {
|
|
228
|
-
if (isPresent(this.palette)) {
|
|
229
|
-
this.palette.nativeElement.focus();
|
|
230
|
-
}
|
|
231
353
|
if (this.isFocused) {
|
|
232
354
|
return;
|
|
233
355
|
}
|
|
@@ -252,7 +374,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
252
374
|
this.notifyNgTouched();
|
|
253
375
|
}
|
|
254
376
|
/**
|
|
255
|
-
* Clears the
|
|
377
|
+
* Clears the value of the ColorPicker.
|
|
256
378
|
*/
|
|
257
379
|
reset() {
|
|
258
380
|
if (!isPresent(this.value)) {
|
|
@@ -280,13 +402,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
280
402
|
/**
|
|
281
403
|
* @hidden
|
|
282
404
|
*/
|
|
283
|
-
handleValueChange(color
|
|
284
|
-
const parsedColor = parseColor(color, this.format);
|
|
405
|
+
handleValueChange(color) {
|
|
406
|
+
const parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
|
|
285
407
|
const valueChange = parsedColor !== this.value;
|
|
286
|
-
if (closePopup) {
|
|
287
|
-
this.toggleWithEvents(false);
|
|
288
|
-
this.focus();
|
|
289
|
-
}
|
|
290
408
|
if (valueChange) {
|
|
291
409
|
this.value = parsedColor;
|
|
292
410
|
this.valueChange.emit(parsedColor);
|
|
@@ -297,9 +415,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
297
415
|
* @hidden
|
|
298
416
|
*/
|
|
299
417
|
handlePopupBlur(event) {
|
|
300
|
-
|
|
301
|
-
const wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
302
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
418
|
+
if (this.popupBlurInvalid(event)) {
|
|
303
419
|
return;
|
|
304
420
|
}
|
|
305
421
|
this.isFocused = false;
|
|
@@ -350,52 +466,66 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
350
466
|
this.wrapper.nativeElement.focus();
|
|
351
467
|
}
|
|
352
468
|
if (event.keyCode === Keys.Tab) {
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
lastElement.focus();
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
if (event.target === lastElement) {
|
|
365
|
-
event.preventDefault();
|
|
366
|
-
firstElement.focus();
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
469
|
+
const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
470
|
+
const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
471
|
+
if (event.target === currentElement) {
|
|
472
|
+
event.preventDefault();
|
|
473
|
+
nextElement.nativeElement.focus();
|
|
369
474
|
}
|
|
370
475
|
}
|
|
371
476
|
}
|
|
372
477
|
/**
|
|
373
478
|
* @hidden
|
|
374
|
-
* Used by the
|
|
479
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
375
480
|
*/
|
|
376
481
|
isEmpty() {
|
|
377
482
|
return false;
|
|
378
483
|
}
|
|
484
|
+
handleClasses(value, input) {
|
|
485
|
+
const elem = this.host.nativeElement;
|
|
486
|
+
const classes = getStylingClasses('picker', input, this[input], value);
|
|
487
|
+
if (classes.toRemove) {
|
|
488
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
489
|
+
}
|
|
490
|
+
if (classes.toAdd) {
|
|
491
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
popupBlurInvalid(ev) {
|
|
495
|
+
const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
496
|
+
const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
497
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
498
|
+
}
|
|
379
499
|
toggleWithEvents(open) {
|
|
380
500
|
const sameState = this.isOpen === open;
|
|
381
501
|
if (this.disabled || this.readonly || sameState) {
|
|
382
502
|
return;
|
|
383
503
|
}
|
|
384
|
-
|
|
385
|
-
|
|
504
|
+
let eventArgs;
|
|
505
|
+
if (open) {
|
|
506
|
+
eventArgs = new ColorPickerOpenEvent();
|
|
507
|
+
this.open.emit(eventArgs);
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
eventArgs = new ColorPickerCloseEvent();
|
|
511
|
+
this.close.emit(eventArgs);
|
|
512
|
+
}
|
|
386
513
|
if (!eventArgs.isDefaultPrevented()) {
|
|
387
514
|
this.toggle(open);
|
|
388
515
|
}
|
|
389
516
|
if (open) {
|
|
390
|
-
this.
|
|
391
|
-
setTimeout(() => {
|
|
392
|
-
if (this.colorGradient) {
|
|
393
|
-
this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
});
|
|
517
|
+
this.focusFirstElement();
|
|
397
518
|
}
|
|
398
519
|
}
|
|
520
|
+
focusFirstElement() {
|
|
521
|
+
this.ngZone.runOutsideAngular(() => {
|
|
522
|
+
setTimeout(() => {
|
|
523
|
+
const elementToFocus = this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle :
|
|
524
|
+
this.flatColorPicker.palette.host;
|
|
525
|
+
elementToFocus.nativeElement.focus();
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
}
|
|
399
529
|
openPopup() {
|
|
400
530
|
const horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
401
531
|
const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
|
|
@@ -425,12 +555,27 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
425
555
|
}
|
|
426
556
|
this.popupRef.close();
|
|
427
557
|
this.popupRef = null;
|
|
428
|
-
|
|
558
|
+
}
|
|
559
|
+
get firstFocusableElement() {
|
|
560
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
561
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
562
|
+
}
|
|
563
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
564
|
+
}
|
|
565
|
+
get lastFocusableElement() {
|
|
566
|
+
if (this.preview) {
|
|
567
|
+
return this.flatColorPicker.footer.lastButton;
|
|
568
|
+
}
|
|
569
|
+
if (this.flatColorPicker.palette) {
|
|
570
|
+
return this.flatColorPicker.palette.host;
|
|
571
|
+
}
|
|
572
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
429
573
|
}
|
|
430
574
|
};
|
|
431
575
|
tslib_1.__decorate([
|
|
432
|
-
HostBinding('class.k-widget'),
|
|
433
576
|
HostBinding('class.k-colorpicker'),
|
|
577
|
+
HostBinding('class.k-icon-picker'),
|
|
578
|
+
HostBinding('class.k-picker'),
|
|
434
579
|
tslib_1.__metadata("design:type", Boolean)
|
|
435
580
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
436
581
|
tslib_1.__decorate([
|
|
@@ -441,10 +586,19 @@ tslib_1.__decorate([
|
|
|
441
586
|
Input(),
|
|
442
587
|
tslib_1.__metadata("design:type", String)
|
|
443
588
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
589
|
+
tslib_1.__decorate([
|
|
590
|
+
Input(),
|
|
591
|
+
tslib_1.__metadata("design:type", Array)
|
|
592
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
593
|
+
tslib_1.__decorate([
|
|
594
|
+
Input(),
|
|
595
|
+
tslib_1.__metadata("design:type", String),
|
|
596
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
597
|
+
], ColorPickerComponent.prototype, "view", null);
|
|
444
598
|
tslib_1.__decorate([
|
|
445
599
|
Input(),
|
|
446
600
|
tslib_1.__metadata("design:type", String)
|
|
447
|
-
], ColorPickerComponent.prototype, "
|
|
601
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
448
602
|
tslib_1.__decorate([
|
|
449
603
|
Input(),
|
|
450
604
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -485,11 +639,38 @@ tslib_1.__decorate([
|
|
|
485
639
|
Input(),
|
|
486
640
|
tslib_1.__metadata("design:type", Object)
|
|
487
641
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
642
|
+
tslib_1.__decorate([
|
|
643
|
+
Input(),
|
|
644
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
645
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
488
646
|
tslib_1.__decorate([
|
|
489
647
|
Input(),
|
|
490
648
|
tslib_1.__metadata("design:type", Number),
|
|
491
649
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
492
650
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
651
|
+
tslib_1.__decorate([
|
|
652
|
+
Input(),
|
|
653
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
654
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
655
|
+
tslib_1.__decorate([
|
|
656
|
+
Input(),
|
|
657
|
+
tslib_1.__metadata("design:type", String)
|
|
658
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
659
|
+
tslib_1.__decorate([
|
|
660
|
+
Input(),
|
|
661
|
+
tslib_1.__metadata("design:type", String),
|
|
662
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
663
|
+
], ColorPickerComponent.prototype, "size", null);
|
|
664
|
+
tslib_1.__decorate([
|
|
665
|
+
Input(),
|
|
666
|
+
tslib_1.__metadata("design:type", String),
|
|
667
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
668
|
+
], ColorPickerComponent.prototype, "rounded", null);
|
|
669
|
+
tslib_1.__decorate([
|
|
670
|
+
Input(),
|
|
671
|
+
tslib_1.__metadata("design:type", String),
|
|
672
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
673
|
+
], ColorPickerComponent.prototype, "fillMode", null);
|
|
493
674
|
tslib_1.__decorate([
|
|
494
675
|
Output(),
|
|
495
676
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -510,10 +691,18 @@ tslib_1.__decorate([
|
|
|
510
691
|
Output('blur'),
|
|
511
692
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
512
693
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
694
|
+
tslib_1.__decorate([
|
|
695
|
+
Output(),
|
|
696
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
697
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
513
698
|
tslib_1.__decorate([
|
|
514
699
|
Output(),
|
|
515
700
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
516
701
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
702
|
+
tslib_1.__decorate([
|
|
703
|
+
Output(),
|
|
704
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
705
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
517
706
|
tslib_1.__decorate([
|
|
518
707
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
519
708
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -527,15 +716,12 @@ tslib_1.__decorate([
|
|
|
527
716
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
528
717
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
529
718
|
tslib_1.__decorate([
|
|
530
|
-
ViewChild('
|
|
531
|
-
tslib_1.__metadata("design:type",
|
|
532
|
-
], ColorPickerComponent.prototype, "
|
|
533
|
-
tslib_1.__decorate([
|
|
534
|
-
ViewChild('colorGradient', { static: false }),
|
|
535
|
-
tslib_1.__metadata("design:type", ColorGradientComponent)
|
|
536
|
-
], ColorPickerComponent.prototype, "colorGradient", void 0);
|
|
719
|
+
ViewChild('flatColorPicker', { static: false }),
|
|
720
|
+
tslib_1.__metadata("design:type", FlatColorPickerComponent)
|
|
721
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
537
722
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
538
723
|
Component({
|
|
724
|
+
exportAs: 'kendoColorPicker',
|
|
539
725
|
selector: 'kendo-colorpicker',
|
|
540
726
|
providers: [{
|
|
541
727
|
multi: true,
|
|
@@ -557,9 +743,13 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
557
743
|
],
|
|
558
744
|
template: `
|
|
559
745
|
<ng-container kendoColorPickerLocalizedMessages
|
|
560
|
-
i18n-
|
|
746
|
+
i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."
|
|
747
|
+
colorPickerNoColor="Colorpicker no color chosen"
|
|
748
|
+
i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
|
|
749
|
+
flatColorPickerNoColor="Flatcolorpicker no color chosen"
|
|
750
|
+
i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
561
751
|
colorGradientNoColor="Colorgradient no color chosen"
|
|
562
|
-
i18n-
|
|
752
|
+
i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
|
|
563
753
|
colorPaletteNoColor="Colorpalette no color chosen"
|
|
564
754
|
i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
|
|
565
755
|
colorGradientHandle="Choose color"
|
|
@@ -569,29 +759,35 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
569
759
|
hueSliderHandle="Set hue"
|
|
570
760
|
i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."
|
|
571
761
|
opacitySliderHandle="Set opacity"
|
|
572
|
-
i18n-
|
|
573
|
-
|
|
574
|
-
i18n-
|
|
575
|
-
|
|
576
|
-
i18n-
|
|
577
|
-
|
|
578
|
-
i18n-
|
|
579
|
-
|
|
580
|
-
i18n-
|
|
581
|
-
|
|
762
|
+
i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."
|
|
763
|
+
contrastRatio="Contrast ratio"
|
|
764
|
+
i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."
|
|
765
|
+
previewColor="Color preview"
|
|
766
|
+
i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."
|
|
767
|
+
revertSelection="Revert selection"
|
|
768
|
+
i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."
|
|
769
|
+
gradientView="Gradient view"
|
|
770
|
+
i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."
|
|
771
|
+
paletteView="Palette view"
|
|
772
|
+
i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."
|
|
773
|
+
formatButton="Change color format"
|
|
774
|
+
i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."
|
|
775
|
+
applyButton="Apply"
|
|
776
|
+
i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
|
|
777
|
+
cancelButton="Cancel">
|
|
582
778
|
</ng-container>
|
|
583
779
|
<span
|
|
584
780
|
#wrapper
|
|
585
781
|
[ngClass]="{
|
|
586
|
-
'k-
|
|
587
|
-
'k-
|
|
588
|
-
'k-
|
|
782
|
+
'k-input-inner': true,
|
|
783
|
+
'k-disabled': this.disabled,
|
|
784
|
+
'k-focus': this.isFocused
|
|
589
785
|
}"
|
|
590
786
|
role="listbox"
|
|
591
787
|
[attr.aria-expanded]="isOpen"
|
|
592
788
|
[attr.aria-readonly]="readonly"
|
|
593
789
|
[attr.aria-disabled]="disabled"
|
|
594
|
-
[attr.aria-label]="
|
|
790
|
+
[attr.aria-label]="colorPickerAriaLabel"
|
|
595
791
|
[id]="focusableId"
|
|
596
792
|
[attr.tabindex]="tabindex"
|
|
597
793
|
(focus)="handleWrapperFocus()"
|
|
@@ -599,51 +795,49 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
599
795
|
(mousedown)="$event.preventDefault()"
|
|
600
796
|
(keydown)="handleWrapperKeyDown($event)"
|
|
601
797
|
>
|
|
602
|
-
<span
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
<span class="k-
|
|
607
|
-
|
|
608
|
-
<span class="k-select" (click)="handleWrapperClick()">
|
|
609
|
-
<span class="k-icon k-i-arrow-s"></span>
|
|
798
|
+
<span
|
|
799
|
+
class="k-value-icon k-color-preview"
|
|
800
|
+
[ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}"
|
|
801
|
+
(click)="handleActiveColorClick()">
|
|
802
|
+
<span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>
|
|
803
|
+
<span class="k-color-preview-mask" [style.background-color]="value"></span>
|
|
610
804
|
</span>
|
|
611
805
|
</span>
|
|
806
|
+
<button
|
|
807
|
+
type="button"
|
|
808
|
+
class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button"
|
|
809
|
+
[attr.aria-label]="colorPickerAriaLabel"
|
|
810
|
+
(click)="togglePopup()">
|
|
811
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
812
|
+
</button>
|
|
612
813
|
<ng-template #popupTemplate>
|
|
613
|
-
<kendo-
|
|
614
|
-
|
|
814
|
+
<kendo-flatcolorpicker
|
|
815
|
+
#flatColorPicker
|
|
615
816
|
[value]="value"
|
|
616
817
|
[format]="format"
|
|
617
|
-
[
|
|
618
|
-
[
|
|
619
|
-
[
|
|
818
|
+
[views]="views"
|
|
819
|
+
[activeView]="activeView"
|
|
820
|
+
[actionsLayout]="actionsLayout"
|
|
821
|
+
[preview]="preview"
|
|
822
|
+
[gradientSettings]="gradientSettings"
|
|
823
|
+
[paletteSettings]="paletteSettings"
|
|
824
|
+
[clearButton]="clearButton"
|
|
620
825
|
(focusout)="handlePopupBlur($event)"
|
|
621
|
-
(
|
|
622
|
-
(
|
|
623
|
-
>
|
|
624
|
-
</kendo-colorgradient>
|
|
625
|
-
<kendo-colorpalette
|
|
626
|
-
#palette
|
|
627
|
-
*ngIf="view === 'palette' || view === 'combo'"
|
|
628
|
-
kendoFocusOnDomReady
|
|
629
|
-
[palette]="paletteSettings.palette"
|
|
630
|
-
[columns]="paletteSettings.columns"
|
|
631
|
-
[tileSize]="paletteSettings.tileSize"
|
|
632
|
-
[format]="format"
|
|
633
|
-
[value]="value"
|
|
634
|
-
(blur)="handlePopupBlur($event)"
|
|
635
|
-
(cellSelection)="handleValueChange($event, true)"
|
|
636
|
-
(mousedown)="$event.preventDefault()"
|
|
826
|
+
(cancel)="handleCancelEvent($event)"
|
|
827
|
+
(valueChange)="handleValueChange($event)"
|
|
637
828
|
(keydown)="handlePopupKeyDown($event)"
|
|
638
|
-
|
|
639
|
-
|
|
829
|
+
(activeViewChange)="activeViewChange.emit($event)"
|
|
830
|
+
(actionButtonClick)="togglePopup()">
|
|
831
|
+
</kendo-flatcolorpicker>
|
|
640
832
|
</ng-template>
|
|
641
833
|
<ng-container #container></ng-container>
|
|
642
834
|
`
|
|
643
835
|
}),
|
|
644
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
836
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
837
|
+
PopupService,
|
|
645
838
|
ChangeDetectorRef,
|
|
646
839
|
LocalizationService,
|
|
647
|
-
NgZone
|
|
840
|
+
NgZone,
|
|
841
|
+
Renderer2])
|
|
648
842
|
], ColorPickerComponent);
|
|
649
843
|
export { ColorPickerComponent };
|