@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
|
@@ -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);
|
|
@@ -107,7 +151,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
107
151
|
* Specifies the value of the initially selected color.
|
|
108
152
|
*/
|
|
109
153
|
set value(value) {
|
|
110
|
-
this._value = parseColor(value, this.format);
|
|
154
|
+
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
111
155
|
}
|
|
112
156
|
get value() {
|
|
113
157
|
return this._value;
|
|
@@ -141,6 +185,8 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
141
185
|
}
|
|
142
186
|
/**
|
|
143
187
|
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
188
|
+
*
|
|
189
|
+
* @default 0
|
|
144
190
|
*/
|
|
145
191
|
set tabindex(value) {
|
|
146
192
|
const tabindex = Number(value);
|
|
@@ -150,6 +196,58 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
150
196
|
get tabindex() {
|
|
151
197
|
return !this.disabled ? this._tabindex : undefined;
|
|
152
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* The size property specifies the font size and line height of the ColorPicker
|
|
201
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-size)).
|
|
202
|
+
*
|
|
203
|
+
* The possible values are:
|
|
204
|
+
* * `'small'`
|
|
205
|
+
* * `'medium'` (default)
|
|
206
|
+
* * `'large'`
|
|
207
|
+
* * `null`
|
|
208
|
+
*/
|
|
209
|
+
set size(size) {
|
|
210
|
+
this.handleClasses(size, 'size');
|
|
211
|
+
this._size = size;
|
|
212
|
+
}
|
|
213
|
+
get size() {
|
|
214
|
+
return this._size;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The rounded property specifies the border radius of the ColorPicker
|
|
218
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
|
|
219
|
+
*
|
|
220
|
+
* The possible values are:
|
|
221
|
+
* * `'small'`
|
|
222
|
+
* * `'medium'` (default)
|
|
223
|
+
* * `'large'`
|
|
224
|
+
* * `'full'`
|
|
225
|
+
* * `null`
|
|
226
|
+
*/
|
|
227
|
+
set rounded(rounded) {
|
|
228
|
+
this.handleClasses(rounded, 'rounded');
|
|
229
|
+
this._rounded = rounded;
|
|
230
|
+
}
|
|
231
|
+
get rounded() {
|
|
232
|
+
return this._rounded;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The fillMode property specifies the background and border styles of the ColorPicker
|
|
236
|
+
* ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
|
|
237
|
+
*
|
|
238
|
+
* The possible values are:
|
|
239
|
+
* * `'flat'`
|
|
240
|
+
* * `'solid'` (default)
|
|
241
|
+
* * `'outline'`
|
|
242
|
+
* * `null`
|
|
243
|
+
*/
|
|
244
|
+
set fillMode(fillMode) {
|
|
245
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
246
|
+
this._fillMode = fillMode;
|
|
247
|
+
}
|
|
248
|
+
get fillMode() {
|
|
249
|
+
return this._fillMode;
|
|
250
|
+
}
|
|
153
251
|
/**
|
|
154
252
|
* Indicates whether the ColorPicker popup is open.
|
|
155
253
|
*/
|
|
@@ -179,13 +277,19 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
179
277
|
columns: this._paletteSettings.columns || presetColumns || 10
|
|
180
278
|
};
|
|
181
279
|
}
|
|
280
|
+
ngAfterViewInit() {
|
|
281
|
+
const stylingInputs = ['size', 'rounded', 'fillMode'];
|
|
282
|
+
stylingInputs.forEach(input => {
|
|
283
|
+
this.handleClasses(this[input], input);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
182
286
|
ngOnChanges(changes) {
|
|
183
287
|
if (changes.format && changes.format.currentValue === 'name') {
|
|
184
|
-
this.
|
|
288
|
+
this.activeView = 'palette';
|
|
185
289
|
}
|
|
186
|
-
if (this.
|
|
290
|
+
if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
|
|
187
291
|
this.format = 'rgba';
|
|
188
|
-
this.value = parseColor(this.value, this.format);
|
|
292
|
+
this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
189
293
|
}
|
|
190
294
|
}
|
|
191
295
|
ngOnDestroy() {
|
|
@@ -197,7 +301,19 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
197
301
|
/**
|
|
198
302
|
* @hidden
|
|
199
303
|
*/
|
|
200
|
-
|
|
304
|
+
get colorPickerAriaLabel() {
|
|
305
|
+
return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* @hidden
|
|
309
|
+
*/
|
|
310
|
+
handleCancelEvent(ev) {
|
|
311
|
+
this.cancel.emit(ev);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* @hidden
|
|
315
|
+
*/
|
|
316
|
+
togglePopup() {
|
|
201
317
|
this.toggleWithEvents(!this.isOpen);
|
|
202
318
|
this.focus();
|
|
203
319
|
}
|
|
@@ -209,7 +325,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
209
325
|
const event = new ActiveColorClickEvent(this.value);
|
|
210
326
|
this.activeColorClick.emit(event);
|
|
211
327
|
if (!event.isOpenPrevented() || this.isOpen) {
|
|
212
|
-
this.
|
|
328
|
+
this.togglePopup();
|
|
213
329
|
}
|
|
214
330
|
}
|
|
215
331
|
/**
|
|
@@ -225,9 +341,6 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
225
341
|
* @hidden
|
|
226
342
|
*/
|
|
227
343
|
handleWrapperFocus() {
|
|
228
|
-
if (isPresent(this.palette)) {
|
|
229
|
-
this.palette.nativeElement.focus();
|
|
230
|
-
}
|
|
231
344
|
if (this.isFocused) {
|
|
232
345
|
return;
|
|
233
346
|
}
|
|
@@ -252,7 +365,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
252
365
|
this.notifyNgTouched();
|
|
253
366
|
}
|
|
254
367
|
/**
|
|
255
|
-
* Clears the
|
|
368
|
+
* Clears the value of the ColorPicker.
|
|
256
369
|
*/
|
|
257
370
|
reset() {
|
|
258
371
|
if (!isPresent(this.value)) {
|
|
@@ -280,13 +393,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
280
393
|
/**
|
|
281
394
|
* @hidden
|
|
282
395
|
*/
|
|
283
|
-
handleValueChange(color
|
|
284
|
-
const parsedColor = parseColor(color, this.format);
|
|
396
|
+
handleValueChange(color) {
|
|
397
|
+
const parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
|
|
285
398
|
const valueChange = parsedColor !== this.value;
|
|
286
|
-
if (closePopup) {
|
|
287
|
-
this.toggleWithEvents(false);
|
|
288
|
-
this.focus();
|
|
289
|
-
}
|
|
290
399
|
if (valueChange) {
|
|
291
400
|
this.value = parsedColor;
|
|
292
401
|
this.valueChange.emit(parsedColor);
|
|
@@ -297,9 +406,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
297
406
|
* @hidden
|
|
298
407
|
*/
|
|
299
408
|
handlePopupBlur(event) {
|
|
300
|
-
|
|
301
|
-
const wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
|
|
302
|
-
if (!this.isFocused || wrapperClicked || focusInPopupElement) {
|
|
409
|
+
if (this.popupBlurInvalid(event)) {
|
|
303
410
|
return;
|
|
304
411
|
}
|
|
305
412
|
this.isFocused = false;
|
|
@@ -350,52 +457,66 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
350
457
|
this.wrapper.nativeElement.focus();
|
|
351
458
|
}
|
|
352
459
|
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
|
-
}
|
|
460
|
+
const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
|
|
461
|
+
const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
|
|
462
|
+
if (event.target === currentElement) {
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
nextElement.nativeElement.focus();
|
|
369
465
|
}
|
|
370
466
|
}
|
|
371
467
|
}
|
|
372
468
|
/**
|
|
373
469
|
* @hidden
|
|
374
|
-
* Used by the
|
|
470
|
+
* Used by the FloatingLabel to determine if the component is empty.
|
|
375
471
|
*/
|
|
376
472
|
isEmpty() {
|
|
377
473
|
return false;
|
|
378
474
|
}
|
|
475
|
+
handleClasses(value, input) {
|
|
476
|
+
const elem = this.host.nativeElement;
|
|
477
|
+
const classes = getStylingClasses('picker', input, this[input], value);
|
|
478
|
+
if (classes.toRemove) {
|
|
479
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
480
|
+
}
|
|
481
|
+
if (classes.toAdd) {
|
|
482
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
popupBlurInvalid(ev) {
|
|
486
|
+
const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
|
|
487
|
+
const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
|
|
488
|
+
return !this.isFocused || wrapperClicked || focusInPopupElement;
|
|
489
|
+
}
|
|
379
490
|
toggleWithEvents(open) {
|
|
380
491
|
const sameState = this.isOpen === open;
|
|
381
492
|
if (this.disabled || this.readonly || sameState) {
|
|
382
493
|
return;
|
|
383
494
|
}
|
|
384
|
-
|
|
385
|
-
|
|
495
|
+
let eventArgs;
|
|
496
|
+
if (open) {
|
|
497
|
+
eventArgs = new ColorPickerOpenEvent();
|
|
498
|
+
this.open.emit(eventArgs);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
eventArgs = new ColorPickerCloseEvent();
|
|
502
|
+
this.close.emit(eventArgs);
|
|
503
|
+
}
|
|
386
504
|
if (!eventArgs.isDefaultPrevented()) {
|
|
387
505
|
this.toggle(open);
|
|
388
506
|
}
|
|
389
507
|
if (open) {
|
|
390
|
-
this.
|
|
391
|
-
setTimeout(() => {
|
|
392
|
-
if (this.colorGradient) {
|
|
393
|
-
this.colorGradient.gradientDragHandle.nativeElement.focus();
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
});
|
|
508
|
+
this.focusFirstElement();
|
|
397
509
|
}
|
|
398
510
|
}
|
|
511
|
+
focusFirstElement() {
|
|
512
|
+
this.ngZone.runOutsideAngular(() => {
|
|
513
|
+
setTimeout(() => {
|
|
514
|
+
const elementToFocus = this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle :
|
|
515
|
+
this.flatColorPicker.palette.host;
|
|
516
|
+
elementToFocus.nativeElement.focus();
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
}
|
|
399
520
|
openPopup() {
|
|
400
521
|
const horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
401
522
|
const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
|
|
@@ -425,12 +546,27 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
|
|
|
425
546
|
}
|
|
426
547
|
this.popupRef.close();
|
|
427
548
|
this.popupRef = null;
|
|
428
|
-
|
|
549
|
+
}
|
|
550
|
+
get firstFocusableElement() {
|
|
551
|
+
if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
|
|
552
|
+
return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
|
|
553
|
+
}
|
|
554
|
+
return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
|
|
555
|
+
}
|
|
556
|
+
get lastFocusableElement() {
|
|
557
|
+
if (this.preview) {
|
|
558
|
+
return this.flatColorPicker.footer.lastButton;
|
|
559
|
+
}
|
|
560
|
+
if (this.flatColorPicker.palette) {
|
|
561
|
+
return this.flatColorPicker.palette.host;
|
|
562
|
+
}
|
|
563
|
+
return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
|
|
429
564
|
}
|
|
430
565
|
};
|
|
431
566
|
tslib_1.__decorate([
|
|
432
|
-
HostBinding('class.k-widget'),
|
|
433
567
|
HostBinding('class.k-colorpicker'),
|
|
568
|
+
HostBinding('class.k-icon-picker'),
|
|
569
|
+
HostBinding('class.k-picker'),
|
|
434
570
|
tslib_1.__metadata("design:type", Boolean)
|
|
435
571
|
], ColorPickerComponent.prototype, "hostClasses", void 0);
|
|
436
572
|
tslib_1.__decorate([
|
|
@@ -441,10 +577,14 @@ tslib_1.__decorate([
|
|
|
441
577
|
Input(),
|
|
442
578
|
tslib_1.__metadata("design:type", String)
|
|
443
579
|
], ColorPickerComponent.prototype, "focusableId", void 0);
|
|
580
|
+
tslib_1.__decorate([
|
|
581
|
+
Input(),
|
|
582
|
+
tslib_1.__metadata("design:type", Array)
|
|
583
|
+
], ColorPickerComponent.prototype, "views", void 0);
|
|
444
584
|
tslib_1.__decorate([
|
|
445
585
|
Input(),
|
|
446
586
|
tslib_1.__metadata("design:type", String)
|
|
447
|
-
], ColorPickerComponent.prototype, "
|
|
587
|
+
], ColorPickerComponent.prototype, "activeView", void 0);
|
|
448
588
|
tslib_1.__decorate([
|
|
449
589
|
Input(),
|
|
450
590
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -485,11 +625,38 @@ tslib_1.__decorate([
|
|
|
485
625
|
Input(),
|
|
486
626
|
tslib_1.__metadata("design:type", Object)
|
|
487
627
|
], ColorPickerComponent.prototype, "iconClass", void 0);
|
|
628
|
+
tslib_1.__decorate([
|
|
629
|
+
Input(),
|
|
630
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
631
|
+
], ColorPickerComponent.prototype, "clearButton", void 0);
|
|
488
632
|
tslib_1.__decorate([
|
|
489
633
|
Input(),
|
|
490
634
|
tslib_1.__metadata("design:type", Number),
|
|
491
635
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
492
636
|
], ColorPickerComponent.prototype, "tabindex", null);
|
|
637
|
+
tslib_1.__decorate([
|
|
638
|
+
Input(),
|
|
639
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
640
|
+
], ColorPickerComponent.prototype, "preview", void 0);
|
|
641
|
+
tslib_1.__decorate([
|
|
642
|
+
Input(),
|
|
643
|
+
tslib_1.__metadata("design:type", String)
|
|
644
|
+
], ColorPickerComponent.prototype, "actionsLayout", void 0);
|
|
645
|
+
tslib_1.__decorate([
|
|
646
|
+
Input(),
|
|
647
|
+
tslib_1.__metadata("design:type", String),
|
|
648
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
649
|
+
], ColorPickerComponent.prototype, "size", null);
|
|
650
|
+
tslib_1.__decorate([
|
|
651
|
+
Input(),
|
|
652
|
+
tslib_1.__metadata("design:type", String),
|
|
653
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
654
|
+
], ColorPickerComponent.prototype, "rounded", null);
|
|
655
|
+
tslib_1.__decorate([
|
|
656
|
+
Input(),
|
|
657
|
+
tslib_1.__metadata("design:type", String),
|
|
658
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
659
|
+
], ColorPickerComponent.prototype, "fillMode", null);
|
|
493
660
|
tslib_1.__decorate([
|
|
494
661
|
Output(),
|
|
495
662
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -510,10 +677,18 @@ tslib_1.__decorate([
|
|
|
510
677
|
Output('blur'),
|
|
511
678
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
512
679
|
], ColorPickerComponent.prototype, "onBlur", void 0);
|
|
680
|
+
tslib_1.__decorate([
|
|
681
|
+
Output(),
|
|
682
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
683
|
+
], ColorPickerComponent.prototype, "cancel", void 0);
|
|
513
684
|
tslib_1.__decorate([
|
|
514
685
|
Output(),
|
|
515
686
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
516
687
|
], ColorPickerComponent.prototype, "activeColorClick", void 0);
|
|
688
|
+
tslib_1.__decorate([
|
|
689
|
+
Output(),
|
|
690
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
691
|
+
], ColorPickerComponent.prototype, "activeViewChange", void 0);
|
|
517
692
|
tslib_1.__decorate([
|
|
518
693
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
519
694
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -527,15 +702,12 @@ tslib_1.__decorate([
|
|
|
527
702
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
528
703
|
], ColorPickerComponent.prototype, "popupTemplate", void 0);
|
|
529
704
|
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);
|
|
705
|
+
ViewChild('flatColorPicker', { static: false }),
|
|
706
|
+
tslib_1.__metadata("design:type", FlatColorPickerComponent)
|
|
707
|
+
], ColorPickerComponent.prototype, "flatColorPicker", void 0);
|
|
537
708
|
ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
538
709
|
Component({
|
|
710
|
+
exportAs: 'kendoColorPicker',
|
|
539
711
|
selector: 'kendo-colorpicker',
|
|
540
712
|
providers: [{
|
|
541
713
|
multi: true,
|
|
@@ -557,9 +729,13 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
557
729
|
],
|
|
558
730
|
template: `
|
|
559
731
|
<ng-container kendoColorPickerLocalizedMessages
|
|
560
|
-
i18n-
|
|
732
|
+
i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."
|
|
733
|
+
colorPickerNoColor="Colorpicker no color chosen"
|
|
734
|
+
i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
|
|
735
|
+
flatColorPickerNoColor="Flatcolorpicker no color chosen"
|
|
736
|
+
i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
561
737
|
colorGradientNoColor="Colorgradient no color chosen"
|
|
562
|
-
i18n-
|
|
738
|
+
i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
|
|
563
739
|
colorPaletteNoColor="Colorpalette no color chosen"
|
|
564
740
|
i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
|
|
565
741
|
colorGradientHandle="Choose color"
|
|
@@ -569,29 +745,35 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
569
745
|
hueSliderHandle="Set hue"
|
|
570
746
|
i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."
|
|
571
747
|
opacitySliderHandle="Set opacity"
|
|
572
|
-
i18n-
|
|
573
|
-
|
|
574
|
-
i18n-
|
|
575
|
-
|
|
576
|
-
i18n-
|
|
577
|
-
|
|
578
|
-
i18n-
|
|
579
|
-
|
|
580
|
-
i18n-
|
|
581
|
-
|
|
748
|
+
i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."
|
|
749
|
+
contrastRatio="Contrast ratio"
|
|
750
|
+
i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."
|
|
751
|
+
previewColor="Color preview"
|
|
752
|
+
i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."
|
|
753
|
+
revertSelection="Revert selection"
|
|
754
|
+
i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."
|
|
755
|
+
gradientView="Gradient view"
|
|
756
|
+
i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."
|
|
757
|
+
paletteView="Palette view"
|
|
758
|
+
i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."
|
|
759
|
+
formatButton="Change color format"
|
|
760
|
+
i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."
|
|
761
|
+
applyButton="Apply"
|
|
762
|
+
i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
|
|
763
|
+
cancelButton="Cancel">
|
|
582
764
|
</ng-container>
|
|
583
765
|
<span
|
|
584
766
|
#wrapper
|
|
585
767
|
[ngClass]="{
|
|
586
|
-
'k-
|
|
587
|
-
'k-
|
|
588
|
-
'k-
|
|
768
|
+
'k-input-inner': true,
|
|
769
|
+
'k-disabled': this.disabled,
|
|
770
|
+
'k-focus': this.isFocused
|
|
589
771
|
}"
|
|
590
772
|
role="listbox"
|
|
591
773
|
[attr.aria-expanded]="isOpen"
|
|
592
774
|
[attr.aria-readonly]="readonly"
|
|
593
775
|
[attr.aria-disabled]="disabled"
|
|
594
|
-
[attr.aria-label]="
|
|
776
|
+
[attr.aria-label]="colorPickerAriaLabel"
|
|
595
777
|
[id]="focusableId"
|
|
596
778
|
[attr.tabindex]="tabindex"
|
|
597
779
|
(focus)="handleWrapperFocus()"
|
|
@@ -599,51 +781,49 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
|
|
|
599
781
|
(mousedown)="$event.preventDefault()"
|
|
600
782
|
(keydown)="handleWrapperKeyDown($event)"
|
|
601
783
|
>
|
|
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>
|
|
784
|
+
<span
|
|
785
|
+
class="k-value-icon k-color-preview"
|
|
786
|
+
[ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}"
|
|
787
|
+
(click)="handleActiveColorClick()">
|
|
788
|
+
<span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>
|
|
789
|
+
<span class="k-color-preview-mask" [style.background-color]="value"></span>
|
|
610
790
|
</span>
|
|
611
791
|
</span>
|
|
792
|
+
<button
|
|
793
|
+
type="button"
|
|
794
|
+
class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button"
|
|
795
|
+
[attr.aria-label]="colorPickerAriaLabel"
|
|
796
|
+
(click)="togglePopup()">
|
|
797
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
798
|
+
</button>
|
|
612
799
|
<ng-template #popupTemplate>
|
|
613
|
-
<kendo-
|
|
614
|
-
|
|
800
|
+
<kendo-flatcolorpicker
|
|
801
|
+
#flatColorPicker
|
|
615
802
|
[value]="value"
|
|
616
803
|
[format]="format"
|
|
617
|
-
[
|
|
618
|
-
[
|
|
619
|
-
[
|
|
804
|
+
[views]="views"
|
|
805
|
+
[activeView]="activeView"
|
|
806
|
+
[actionsLayout]="actionsLayout"
|
|
807
|
+
[preview]="preview"
|
|
808
|
+
[gradientSettings]="gradientSettings"
|
|
809
|
+
[paletteSettings]="paletteSettings"
|
|
810
|
+
[clearButton]="clearButton"
|
|
620
811
|
(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()"
|
|
812
|
+
(cancel)="handleCancelEvent($event)"
|
|
813
|
+
(valueChange)="handleValueChange($event)"
|
|
637
814
|
(keydown)="handlePopupKeyDown($event)"
|
|
638
|
-
|
|
639
|
-
|
|
815
|
+
(activeViewChange)="activeViewChange.emit($event)"
|
|
816
|
+
(actionButtonClick)="togglePopup()">
|
|
817
|
+
</kendo-flatcolorpicker>
|
|
640
818
|
</ng-template>
|
|
641
819
|
<ng-container #container></ng-container>
|
|
642
820
|
`
|
|
643
821
|
}),
|
|
644
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
822
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
823
|
+
PopupService,
|
|
645
824
|
ChangeDetectorRef,
|
|
646
825
|
LocalizationService,
|
|
647
|
-
NgZone
|
|
826
|
+
NgZone,
|
|
827
|
+
Renderer2])
|
|
648
828
|
], ColorPickerComponent);
|
|
649
829
|
export { ColorPickerComponent };
|