@progress/kendo-angular-inputs 21.4.1 → 22.0.0
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/colorpicker/localization/messages.d.ts +1 -1
- package/common/radio-checkbox.base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-inputs.mjs +321 -321
- package/numerictextbox/localization/messages.d.ts +1 -1
- package/otpinput/localization/messages.d.ts +1 -1
- package/package.json +17 -25
- package/rangeslider/localization/messages.d.ts +1 -1
- package/signature/localization/messages.d.ts +1 -1
- package/slider/localization/messages.d.ts +1 -1
- package/sliders-common/slider-base.d.ts +1 -1
- package/switch/localization/messages.d.ts +1 -1
- package/text-fields-common/text-fields-base.d.ts +1 -1
- package/textbox/localization/messages.d.ts +1 -1
- package/esm2022/checkbox/checkbox.component.mjs +0 -227
- package/esm2022/checkbox/checkbox.directive.mjs +0 -96
- package/esm2022/checkbox/checked-state.mjs +0 -5
- package/esm2022/checkbox.module.mjs +0 -42
- package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
- package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -219
- package/esm2022/colorpicker/color-contrast-svg.component.mjs +0 -108
- package/esm2022/colorpicker/color-gradient-numeric-label.directive.mjs +0 -37
- package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
- package/esm2022/colorpicker/color-gradient.component.mjs +0 -1110
- package/esm2022/colorpicker/color-input.component.mjs +0 -498
- package/esm2022/colorpicker/color-palette.component.mjs +0 -629
- package/esm2022/colorpicker/colorpicker.component.mjs +0 -1315
- package/esm2022/colorpicker/constants.mjs +0 -40
- package/esm2022/colorpicker/contrast-validation.component.mjs +0 -83
- package/esm2022/colorpicker/contrast.component.mjs +0 -114
- package/esm2022/colorpicker/events/active-color-click-event.mjs +0 -55
- package/esm2022/colorpicker/events/cancel-event.mjs +0 -18
- package/esm2022/colorpicker/events/close-event.mjs +0 -10
- package/esm2022/colorpicker/events/kendo-drag-event.mjs +0 -5
- package/esm2022/colorpicker/events/open-event.mjs +0 -10
- package/esm2022/colorpicker/events.mjs +0 -8
- package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +0 -112
- package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +0 -244
- package/esm2022/colorpicker/flatcolorpicker.component.mjs +0 -942
- package/esm2022/colorpicker/localization/colorgradient-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/colorpalette-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/colorpicker-localization.service.mjs +0 -31
- package/esm2022/colorpicker/localization/custom-messages.component.mjs +0 -51
- package/esm2022/colorpicker/localization/flatcolorpicker-localization.service.mjs +0 -46
- package/esm2022/colorpicker/localization/localized-colorpicker-messages.directive.mjs +0 -39
- package/esm2022/colorpicker/localization/messages.mjs +0 -201
- package/esm2022/colorpicker/models/actions-layout.mjs +0 -5
- package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -8
- package/esm2022/colorpicker/models/colorpicker-view.mjs +0 -5
- package/esm2022/colorpicker/models/gradient-settings.mjs +0 -5
- package/esm2022/colorpicker/models/hsva.mjs +0 -5
- package/esm2022/colorpicker/models/output-format.mjs +0 -5
- package/esm2022/colorpicker/models/palette-presets.mjs +0 -62
- package/esm2022/colorpicker/models/palette-settings.mjs +0 -5
- package/esm2022/colorpicker/models/popup-settings.mjs +0 -5
- package/esm2022/colorpicker/models/rgb.mjs +0 -5
- package/esm2022/colorpicker/models/rgba.mjs +0 -5
- package/esm2022/colorpicker/models/table-cell.mjs +0 -5
- package/esm2022/colorpicker/models/tile-size.mjs +0 -5
- package/esm2022/colorpicker/models.mjs +0 -16
- package/esm2022/colorpicker/services/color-palette.service.mjs +0 -65
- package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +0 -39
- package/esm2022/colorpicker/utils/color-parser.mjs +0 -164
- package/esm2022/colorpicker/utils/contrast-curve.mjs +0 -85
- package/esm2022/colorpicker/utils.mjs +0 -6
- package/esm2022/colorpicker.module.mjs +0 -50
- package/esm2022/common/dom-utils.mjs +0 -36
- package/esm2022/common/formservice.service.mjs +0 -21
- package/esm2022/common/math.mjs +0 -65
- package/esm2022/common/models/fillmode.mjs +0 -5
- package/esm2022/common/models/gutters.mjs +0 -5
- package/esm2022/common/models/responsive-breakpoints.mjs +0 -5
- package/esm2022/common/models/rounded.mjs +0 -5
- package/esm2022/common/models/size.mjs +0 -5
- package/esm2022/common/models/styling-classes.mjs +0 -5
- package/esm2022/common/models/type.mjs +0 -5
- package/esm2022/common/models.mjs +0 -9
- package/esm2022/common/radio-checkbox.base.mjs +0 -295
- package/esm2022/common/utils.mjs +0 -88
- package/esm2022/directives.mjs +0 -430
- package/esm2022/form/form.component.mjs +0 -163
- package/esm2022/form/formseparator.component.mjs +0 -80
- package/esm2022/form/utils.mjs +0 -147
- package/esm2022/form.module.mjs +0 -46
- package/esm2022/formfield/error.component.mjs +0 -70
- package/esm2022/formfield/formfield.component.mjs +0 -353
- package/esm2022/formfield/hint.component.mjs +0 -65
- package/esm2022/formfield/models/message-align.mjs +0 -5
- package/esm2022/formfield/models/orientation.mjs +0 -5
- package/esm2022/formfield/models/show-options.mjs +0 -5
- package/esm2022/formfield.module.mjs +0 -43
- package/esm2022/formfieldset/formfieldset.component.mjs +0 -174
- package/esm2022/index.mjs +0 -91
- package/esm2022/inputs.module.mjs +0 -91
- package/esm2022/maskedtextbox/maskedtextbox.component.mjs +0 -876
- package/esm2022/maskedtextbox/masking.service.mjs +0 -189
- package/esm2022/maskedtextbox/parsing/combinators.mjs +0 -28
- package/esm2022/maskedtextbox/parsing/parsers.mjs +0 -148
- package/esm2022/maskedtextbox/parsing/result.mjs +0 -44
- package/esm2022/maskedtextbox/parsing/stream.mjs +0 -43
- package/esm2022/maskedtextbox.module.mjs +0 -43
- package/esm2022/numerictextbox/arrow-direction.mjs +0 -13
- package/esm2022/numerictextbox/constants.mjs +0 -28
- package/esm2022/numerictextbox/localization/custom-messages.component.mjs +0 -55
- package/esm2022/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +0 -39
- package/esm2022/numerictextbox/localization/messages.mjs +0 -33
- package/esm2022/numerictextbox/numerictextbox.component.mjs +0 -1314
- package/esm2022/numerictextbox/utils.mjs +0 -92
- package/esm2022/numerictextbox.module.mjs +0 -46
- package/esm2022/otp.module.mjs +0 -44
- package/esm2022/otpinput/localization/custom-messages.component.mjs +0 -45
- package/esm2022/otpinput/localization/localized-textbox-messages.directive.mjs +0 -39
- package/esm2022/otpinput/localization/messages.mjs +0 -34
- package/esm2022/otpinput/models/otpinput-type.mjs +0 -5
- package/esm2022/otpinput/models/separator-icon.mjs +0 -5
- package/esm2022/otpinput/otpinput-separator.component.mjs +0 -93
- package/esm2022/otpinput/otpinput.component.mjs +0 -936
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-inputs.mjs +0 -8
- package/esm2022/radiobutton/radiobutton.component.mjs +0 -212
- package/esm2022/radiobutton/radiobutton.directive.mjs +0 -81
- package/esm2022/radiobutton.module.mjs +0 -43
- package/esm2022/rangeslider/localization/custom-messages.component.mjs +0 -53
- package/esm2022/rangeslider/localization/localized-rangeslider-messages.directive.mjs +0 -39
- package/esm2022/rangeslider/localization/messages.mjs +0 -33
- package/esm2022/rangeslider/rangeslider-model.mjs +0 -53
- package/esm2022/rangeslider/rangeslider-value.type.mjs +0 -5
- package/esm2022/rangeslider/rangeslider.component.mjs +0 -625
- package/esm2022/rangeslider.module.mjs +0 -46
- package/esm2022/rating/directives/rating-hovered-item.directive.mjs +0 -35
- package/esm2022/rating/directives/rating-item.directive.mjs +0 -34
- package/esm2022/rating/directives/rating-selected-item.directive.mjs +0 -36
- package/esm2022/rating/models/precision.mjs +0 -5
- package/esm2022/rating/models/rating-item.interface.mjs +0 -5
- package/esm2022/rating/models/selection.mjs +0 -5
- package/esm2022/rating/rating.component.mjs +0 -754
- package/esm2022/rating.module.mjs +0 -46
- package/esm2022/shared/input-separator.component.mjs +0 -55
- package/esm2022/shared/input-spacer.component.mjs +0 -56
- package/esm2022/shared/shared-events.directive.mjs +0 -102
- package/esm2022/shared/utils.mjs +0 -13
- package/esm2022/signature/events/close-event.mjs +0 -10
- package/esm2022/signature/events/index.mjs +0 -6
- package/esm2022/signature/events/open-event.mjs +0 -10
- package/esm2022/signature/localization/custom-messages.component.mjs +0 -43
- package/esm2022/signature/localization/index.mjs +0 -7
- package/esm2022/signature/localization/localized-signature-messages.directive.mjs +0 -39
- package/esm2022/signature/localization/messages.mjs +0 -45
- package/esm2022/signature/signature.component.mjs +0 -981
- package/esm2022/signature.module.mjs +0 -47
- package/esm2022/slider/localization/custom-messages.component.mjs +0 -43
- package/esm2022/slider/localization/localized-slider-messages.directive.mjs +0 -39
- package/esm2022/slider/localization/messages.mjs +0 -39
- package/esm2022/slider/slider-model.mjs +0 -32
- package/esm2022/slider/slider.component.mjs +0 -671
- package/esm2022/slider.module.mjs +0 -48
- package/esm2022/sliders-common/label-template.directive.mjs +0 -37
- package/esm2022/sliders-common/slider-base.mjs +0 -300
- package/esm2022/sliders-common/slider-model.base.mjs +0 -118
- package/esm2022/sliders-common/slider-ticks.component.mjs +0 -147
- package/esm2022/sliders-common/sliders-util.mjs +0 -206
- package/esm2022/sliders-common/title-callback.mjs +0 -5
- package/esm2022/switch/events/blur-event.mjs +0 -13
- package/esm2022/switch/events/focus-event.mjs +0 -13
- package/esm2022/switch/localization/custom-messages.component.mjs +0 -43
- package/esm2022/switch/localization/localized-switch-messages.directive.mjs +0 -39
- package/esm2022/switch/localization/messages.mjs +0 -33
- package/esm2022/switch/switch.component.mjs +0 -585
- package/esm2022/switch.module.mjs +0 -44
- package/esm2022/text-fields-common/text-fields-base.mjs +0 -150
- package/esm2022/textarea/models/adornments-orientation.mjs +0 -5
- package/esm2022/textarea/models/flow.mjs +0 -5
- package/esm2022/textarea/models/resize.mjs +0 -5
- package/esm2022/textarea/models/textarea-settings.mjs +0 -5
- package/esm2022/textarea/textarea-prefix.component.mjs +0 -67
- package/esm2022/textarea/textarea-suffix.component.mjs +0 -67
- package/esm2022/textarea/textarea.component.mjs +0 -740
- package/esm2022/textarea/textarea.directive.mjs +0 -288
- package/esm2022/textarea.module.mjs +0 -46
- package/esm2022/textbox/localization/custom-messages.component.mjs +0 -43
- package/esm2022/textbox/localization/localized-textbox-messages.directive.mjs +0 -39
- package/esm2022/textbox/localization/messages.mjs +0 -27
- package/esm2022/textbox/models/icon-show-options.mjs +0 -5
- package/esm2022/textbox/textbox-prefix.directive.mjs +0 -50
- package/esm2022/textbox/textbox-suffix.directive.mjs +0 -49
- package/esm2022/textbox/textbox.component.mjs +0 -933
- package/esm2022/textbox/textbox.directive.mjs +0 -125
- package/esm2022/textbox.module.mjs +0 -51
- package/esm2022/validators/max.validator.mjs +0 -21
- package/esm2022/validators/min.validator.mjs +0 -21
|
@@ -1,942 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
-
/* eslint-disable no-unused-expressions */
|
|
7
|
-
import { Component, ElementRef, EventEmitter, forwardRef, HostBinding, Input, isDevMode, NgZone, ChangeDetectorRef, Output, Renderer2, ViewChild, Injector, HostListener } from "@angular/core";
|
|
8
|
-
import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
-
import { Subscription } from 'rxjs';
|
|
10
|
-
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { findFocusableChild, isChanged, KendoInput } from '@progress/kendo-angular-common';
|
|
12
|
-
import { validatePackage } from "@progress/kendo-licensing";
|
|
13
|
-
import { FlatColorPickerLocalizationService } from './localization/flatcolorpicker-localization.service';
|
|
14
|
-
import { FlatColorPickerService } from './services/flatcolorpicker.service';
|
|
15
|
-
import { packageMetadata } from "../package-metadata";
|
|
16
|
-
import { ColorPickerCancelEvent } from './events';
|
|
17
|
-
import { parseColor } from './utils';
|
|
18
|
-
import { getStylingClasses, isPresent } from '../common/utils';
|
|
19
|
-
import { ColorGradientComponent } from './color-gradient.component';
|
|
20
|
-
import { ColorPaletteComponent } from './color-palette.component';
|
|
21
|
-
import { FlatColorPickerHeaderComponent } from './flatcolorpicker-header.component';
|
|
22
|
-
import { FlatColorPickerActionButtonsComponent } from './flatcolorpicker-actions.component';
|
|
23
|
-
import { DRAGHANDLE_MOVE_SPEED, DRAGHANDLE_MOVE_SPEED_SMALL_STEP } from "./constants";
|
|
24
|
-
import { take } from "rxjs/operators";
|
|
25
|
-
import { NgClass } from "@angular/common";
|
|
26
|
-
import { LocalizedColorPickerMessagesDirective } from "./localization/localized-colorpicker-messages.directive";
|
|
27
|
-
import * as i0 from "@angular/core";
|
|
28
|
-
import * as i1 from "./services/flatcolorpicker.service";
|
|
29
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
30
|
-
const DEFAULT_SIZE = 'medium';
|
|
31
|
-
/**
|
|
32
|
-
* Represents the Kendo UI FlatColorPicker component for Angular.
|
|
33
|
-
*
|
|
34
|
-
* The `FlatColorPickerComponent` lets you choose colors through palettes with predefined sets of colors and through a gradient that renders an HSV canvas. You can preview the selected color, revert it to its previous state, or clear it.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```html
|
|
38
|
-
* <kendo-flatcolorpicker [(value)]="selectedColor"></kendo-flatcolorpicker>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* Supported children components are: {@link ColorPickerMessages}.
|
|
43
|
-
*/
|
|
44
|
-
export class FlatColorPickerComponent {
|
|
45
|
-
host;
|
|
46
|
-
service;
|
|
47
|
-
localizationService;
|
|
48
|
-
cdr;
|
|
49
|
-
renderer;
|
|
50
|
-
ngZone;
|
|
51
|
-
injector;
|
|
52
|
-
hostClasses = true;
|
|
53
|
-
get disabledClass() {
|
|
54
|
-
return this.disabled;
|
|
55
|
-
}
|
|
56
|
-
get ariaReadonly() {
|
|
57
|
-
return this.readonly;
|
|
58
|
-
}
|
|
59
|
-
direction;
|
|
60
|
-
get hostTabindex() {
|
|
61
|
-
return this.tabindex?.toString() || '0';
|
|
62
|
-
}
|
|
63
|
-
ariaRole = 'textbox';
|
|
64
|
-
get isControlInvalid() {
|
|
65
|
-
return (this.control?.invalid)?.toString();
|
|
66
|
-
}
|
|
67
|
-
get isDisabled() {
|
|
68
|
-
return this.disabled?.toString() || undefined;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @hidden
|
|
72
|
-
*/
|
|
73
|
-
enterHandler(event) {
|
|
74
|
-
if (event.target !== this.host.nativeElement) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
this.internalNavigation = true;
|
|
79
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => this.firstFocusable?.focus());
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @hidden
|
|
83
|
-
*/
|
|
84
|
-
escapeHandler() {
|
|
85
|
-
this.internalNavigation = false;
|
|
86
|
-
this.host.nativeElement.focus();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* @hidden
|
|
90
|
-
*/
|
|
91
|
-
focusHandler(ev) {
|
|
92
|
-
this.internalNavigation = ev.target !== this.host.nativeElement;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Sets the read-only state of the FlatColorPicker.
|
|
96
|
-
*
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
readonly = false;
|
|
100
|
-
/**
|
|
101
|
-
* Sets the disabled state of the FlatColorPicker. To disable it in reactive forms, see [Forms Support](slug:formssupport_flatcolorpicker#toc-managing-the-flatcolorpicker-disabled-state-in-reactive-forms).
|
|
102
|
-
*
|
|
103
|
-
* @default false
|
|
104
|
-
*/
|
|
105
|
-
disabled = false;
|
|
106
|
-
/**
|
|
107
|
-
* Specifies the output format of the FlatColorPicker.
|
|
108
|
-
*
|
|
109
|
-
* If the input value is in a different format, the component parses it into the specified output `format`.
|
|
110
|
-
*
|
|
111
|
-
* @default 'rgba'
|
|
112
|
-
*/
|
|
113
|
-
format = 'rgba';
|
|
114
|
-
/**
|
|
115
|
-
* Specifies the initially selected color.
|
|
116
|
-
*/
|
|
117
|
-
set value(value) {
|
|
118
|
-
this._value = parseColor(value, this.format, this.gradientSettings.opacity);
|
|
119
|
-
}
|
|
120
|
-
get value() {
|
|
121
|
-
return this._value;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
125
|
-
*
|
|
126
|
-
* @default 0
|
|
127
|
-
*/
|
|
128
|
-
set tabindex(value) {
|
|
129
|
-
if (isPresent(value)) {
|
|
130
|
-
const tabindex = Number(value);
|
|
131
|
-
this._tabindex = !isNaN(tabindex) ? tabindex : 0;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
// Allows removal of the tabindex attribute
|
|
135
|
-
this._tabindex = value;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
get tabindex() {
|
|
139
|
-
return !this.disabled ? this._tabindex : undefined;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Specifies whether the FlatColorPicker displays a **Clear color** button.
|
|
143
|
-
*
|
|
144
|
-
* @default true
|
|
145
|
-
*/
|
|
146
|
-
clearButton = true;
|
|
147
|
-
/**
|
|
148
|
-
* Displays `Apply` and `Cancel` action buttons and a color preview pane.
|
|
149
|
-
*
|
|
150
|
-
* When enabled, the component value does not change immediately upon
|
|
151
|
-
* color selection, but only after the **Apply** button is clicked.
|
|
152
|
-
*
|
|
153
|
-
* The **Cancel** button reverts the current selection to its
|
|
154
|
-
* initial state, i.e., to the current value.
|
|
155
|
-
*
|
|
156
|
-
* @default true
|
|
157
|
-
*/
|
|
158
|
-
preview = true;
|
|
159
|
-
/**
|
|
160
|
-
* Configures the layout of the `Apply` and `Cancel` action buttons.
|
|
161
|
-
*
|
|
162
|
-
* @default 'end'
|
|
163
|
-
*/
|
|
164
|
-
actionsLayout = 'end';
|
|
165
|
-
/**
|
|
166
|
-
* Sets the initially active view in the FlatColorPicker. Supports two-way binding.
|
|
167
|
-
*/
|
|
168
|
-
activeView;
|
|
169
|
-
/**
|
|
170
|
-
* Specifies the views to render. The default value is gradient and palette.
|
|
171
|
-
*/
|
|
172
|
-
views = ['gradient', 'palette'];
|
|
173
|
-
/**
|
|
174
|
-
* Configures the gradient view.
|
|
175
|
-
*/
|
|
176
|
-
set gradientSettings(value) {
|
|
177
|
-
Object.assign(this._gradientSettings, value);
|
|
178
|
-
}
|
|
179
|
-
get gradientSettings() {
|
|
180
|
-
return this._gradientSettings;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* @hidden
|
|
184
|
-
*/
|
|
185
|
-
adaptiveMode = false;
|
|
186
|
-
/**
|
|
187
|
-
* Configures the palette view.
|
|
188
|
-
*/
|
|
189
|
-
set paletteSettings(value) {
|
|
190
|
-
Object.assign(this._paletteSettings, value);
|
|
191
|
-
}
|
|
192
|
-
get paletteSettings() {
|
|
193
|
-
return this._paletteSettings;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Sets the size of the FlatColorPicker internal elements.
|
|
197
|
-
*
|
|
198
|
-
* @default 'medium'
|
|
199
|
-
*/
|
|
200
|
-
set size(size) {
|
|
201
|
-
const newSize = size || DEFAULT_SIZE;
|
|
202
|
-
this.handleClasses(newSize, 'size');
|
|
203
|
-
this._size = newSize;
|
|
204
|
-
}
|
|
205
|
-
get size() {
|
|
206
|
-
return this._size;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Fires when the component value changes.
|
|
210
|
-
*/
|
|
211
|
-
valueChange = new EventEmitter();
|
|
212
|
-
/**
|
|
213
|
-
* Fires when the user cancels the current color selection.
|
|
214
|
-
*
|
|
215
|
-
* The event is emitted on preview pane or on 'Cancel' button click.
|
|
216
|
-
*/
|
|
217
|
-
cancel = new EventEmitter();
|
|
218
|
-
/**
|
|
219
|
-
* Fires when the view is about to change.
|
|
220
|
-
* Used to provide a two-way binding for the `activeView` property.
|
|
221
|
-
*/
|
|
222
|
-
activeViewChange = new EventEmitter();
|
|
223
|
-
/**
|
|
224
|
-
* @hidden
|
|
225
|
-
* Fires each time the clear button is clicked.
|
|
226
|
-
*/
|
|
227
|
-
clearButtonClick = new EventEmitter();
|
|
228
|
-
/**
|
|
229
|
-
* @hidden
|
|
230
|
-
*/
|
|
231
|
-
actionButtonClick = new EventEmitter();
|
|
232
|
-
header;
|
|
233
|
-
headerElement;
|
|
234
|
-
gradient;
|
|
235
|
-
gradientElement;
|
|
236
|
-
palette;
|
|
237
|
-
footer;
|
|
238
|
-
/**
|
|
239
|
-
* @hidden
|
|
240
|
-
*/
|
|
241
|
-
selection;
|
|
242
|
-
focused;
|
|
243
|
-
_value;
|
|
244
|
-
_tabindex = 0;
|
|
245
|
-
_gradientSettings = {
|
|
246
|
-
opacity: true,
|
|
247
|
-
delay: 0,
|
|
248
|
-
gradientSliderStep: DRAGHANDLE_MOVE_SPEED,
|
|
249
|
-
gradientSliderSmallStep: DRAGHANDLE_MOVE_SPEED_SMALL_STEP
|
|
250
|
-
};
|
|
251
|
-
_paletteSettings = {};
|
|
252
|
-
dynamicRTLSubscription;
|
|
253
|
-
subscriptions = new Subscription();
|
|
254
|
-
internalNavigation = false;
|
|
255
|
-
_size = 'medium';
|
|
256
|
-
control;
|
|
257
|
-
/**
|
|
258
|
-
* @hidden
|
|
259
|
-
*/
|
|
260
|
-
get innerTabIndex() {
|
|
261
|
-
return this.internalNavigation ? 0 : -1;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* @hidden
|
|
265
|
-
*/
|
|
266
|
-
get firstFocusable() {
|
|
267
|
-
if (this.headerHasContent) {
|
|
268
|
-
return this.headerElement.nativeElement.querySelector('.k-button');
|
|
269
|
-
}
|
|
270
|
-
return this.activeView === 'gradient' ? this.gradient : this.palette;
|
|
271
|
-
}
|
|
272
|
-
constructor(host, service, localizationService, cdr, renderer, ngZone, injector) {
|
|
273
|
-
this.host = host;
|
|
274
|
-
this.service = service;
|
|
275
|
-
this.localizationService = localizationService;
|
|
276
|
-
this.cdr = cdr;
|
|
277
|
-
this.renderer = renderer;
|
|
278
|
-
this.ngZone = ngZone;
|
|
279
|
-
this.injector = injector;
|
|
280
|
-
validatePackage(packageMetadata);
|
|
281
|
-
this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
|
|
282
|
-
this.direction = rtl ? 'rtl' : 'ltr';
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
ngOnInit() {
|
|
286
|
-
this.selection = this.value;
|
|
287
|
-
this.control = this.injector.get(NgControl, null);
|
|
288
|
-
this._paletteSettings = this.service.getPaletteSettings(this._paletteSettings, this.format);
|
|
289
|
-
this.setActiveView();
|
|
290
|
-
}
|
|
291
|
-
ngAfterViewInit() {
|
|
292
|
-
const stylingInputs = ['size'];
|
|
293
|
-
stylingInputs.forEach(input => {
|
|
294
|
-
this.handleClasses(this[input], input);
|
|
295
|
-
});
|
|
296
|
-
this.setHostElementAriaLabel();
|
|
297
|
-
this.initDomEvents();
|
|
298
|
-
this.setSizingVariables();
|
|
299
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => this.removeGradientAttributes());
|
|
300
|
-
}
|
|
301
|
-
ngOnChanges(changes) {
|
|
302
|
-
if (isChanged('value', changes)) {
|
|
303
|
-
this.selection = this.value;
|
|
304
|
-
this.setHostElementAriaLabel();
|
|
305
|
-
}
|
|
306
|
-
if (isChanged('paletteSettings', changes)) {
|
|
307
|
-
this.setSizingVariables();
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
ngOnDestroy() {
|
|
311
|
-
if (this.dynamicRTLSubscription) {
|
|
312
|
-
this.dynamicRTLSubscription.unsubscribe();
|
|
313
|
-
}
|
|
314
|
-
this.subscriptions.unsubscribe();
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @hidden
|
|
318
|
-
*/
|
|
319
|
-
focusFirstHeaderButton() {
|
|
320
|
-
if (this.gradientElement.nativeElement === document.activeElement) {
|
|
321
|
-
if (this.headerHasContent && !this.preview) {
|
|
322
|
-
const firstHeaderButton = this.headerElement.nativeElement.querySelector('.k-button');
|
|
323
|
-
firstHeaderButton.focus();
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* @hidden
|
|
329
|
-
*/
|
|
330
|
-
lastFocusable(event) {
|
|
331
|
-
if (this.preview) {
|
|
332
|
-
this.footer.lastButton.nativeElement.focus();
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
event.stopImmediatePropagation();
|
|
336
|
-
const gradient = this.gradientElement?.nativeElement;
|
|
337
|
-
const palette = this.palette?.host.nativeElement;
|
|
338
|
-
if (this.activeView === 'gradient') {
|
|
339
|
-
gradient.focus();
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
palette.focus();
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* @hidden
|
|
347
|
-
*/
|
|
348
|
-
onTab(ev) {
|
|
349
|
-
const { shiftKey } = ev;
|
|
350
|
-
const nextTabStop = this.preview ? this.footer.firstButton.nativeElement : this.headerHasContent ? findFocusableChild(this.headerElement.nativeElement) : null;
|
|
351
|
-
const previousTabStop = this.headerHasContent ? findFocusableChild(this.headerElement.nativeElement) : this.preview ? this.footer.lastButton.nativeElement : null;
|
|
352
|
-
if (!nextTabStop && !previousTabStop) {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
ev.preventDefault();
|
|
356
|
-
if (shiftKey) {
|
|
357
|
-
previousTabStop?.focus();
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
nextTabStop?.focus();
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* @hidden
|
|
365
|
-
*/
|
|
366
|
-
get headerHasContent() {
|
|
367
|
-
return this.preview || this.views.length > 1 || this.clearButton;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* @hidden
|
|
371
|
-
* Used by the FloatingLabel to determine if the component is empty.
|
|
372
|
-
*/
|
|
373
|
-
isEmpty() {
|
|
374
|
-
return false;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Focuses the wrapper of the FlatColorPicker.
|
|
378
|
-
*/
|
|
379
|
-
focus() {
|
|
380
|
-
if (this.disabled || this.focused) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
this.host.nativeElement.focus();
|
|
384
|
-
this.focused = true;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Blurs the wrapper of the FlatColorPicker.
|
|
388
|
-
*/
|
|
389
|
-
blur() {
|
|
390
|
-
if (!this.focused) {
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
this.notifyNgTouched();
|
|
394
|
-
this.host.nativeElement.blur();
|
|
395
|
-
this.focused = false;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Clears the value of the FlatColorPicker.
|
|
399
|
-
*/
|
|
400
|
-
reset() {
|
|
401
|
-
if (!isPresent(this.value)) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
this.value = undefined;
|
|
405
|
-
this.notifyNgChanged(undefined);
|
|
406
|
-
this.setHostElementAriaLabel();
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* @hidden
|
|
410
|
-
*/
|
|
411
|
-
onViewChange(view) {
|
|
412
|
-
if (this.activeView === view) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
this.activeView = view;
|
|
416
|
-
this.activeViewChange.emit(view);
|
|
417
|
-
this.ngZone.runOutsideAngular(() => {
|
|
418
|
-
setTimeout(() => {
|
|
419
|
-
this[this.activeView]?.focus();
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
if (this.activeView === 'gradient') {
|
|
423
|
-
this.removeGradientAttributes();
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* @hidden
|
|
428
|
-
*/
|
|
429
|
-
onClearButtonClick() {
|
|
430
|
-
this.resetInnerComponentValue();
|
|
431
|
-
this.clearButtonClick.emit();
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* @hidden
|
|
435
|
-
*/
|
|
436
|
-
handleValueChange(color) {
|
|
437
|
-
if (this.preview) {
|
|
438
|
-
this.changeCurrentValue(color);
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
this.setFlatColorPickerValue(color);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* @hidden
|
|
446
|
-
*/
|
|
447
|
-
onAction(ev) {
|
|
448
|
-
if (ev.target === 'apply') {
|
|
449
|
-
this.setFlatColorPickerValue(this.selection);
|
|
450
|
-
}
|
|
451
|
-
else {
|
|
452
|
-
this.resetSelection(ev.originalEvent);
|
|
453
|
-
}
|
|
454
|
-
this.actionButtonClick.emit();
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* @hidden
|
|
458
|
-
*/
|
|
459
|
-
writeValue(value) {
|
|
460
|
-
this.value = value;
|
|
461
|
-
this.cdr.markForCheck();
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* @hidden
|
|
465
|
-
*/
|
|
466
|
-
registerOnChange(fn) {
|
|
467
|
-
this.notifyNgChanged = fn;
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* @hidden
|
|
471
|
-
*/
|
|
472
|
-
registerOnTouched(fn) {
|
|
473
|
-
this.notifyNgTouched = fn;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* @hidden
|
|
477
|
-
*/
|
|
478
|
-
setDisabledState(isDisabled) {
|
|
479
|
-
this.cdr.markForCheck();
|
|
480
|
-
this.disabled = isDisabled;
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* @hidden
|
|
484
|
-
*/
|
|
485
|
-
resetSelection(ev) {
|
|
486
|
-
const eventArgs = new ColorPickerCancelEvent(ev);
|
|
487
|
-
this.cancel.emit(eventArgs);
|
|
488
|
-
if (!eventArgs.isDefaultPrevented()) {
|
|
489
|
-
this.selection = this.value;
|
|
490
|
-
}
|
|
491
|
-
this.notifyNgTouched();
|
|
492
|
-
}
|
|
493
|
-
setHostElementAriaLabel() {
|
|
494
|
-
const parsed = parseColor(this.value, this.format, this.gradientSettings.opacity);
|
|
495
|
-
const ariaLabelValue = `${this.value ? parsed : this.localizationService.get('flatColorPickerNoColor')}`;
|
|
496
|
-
this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
|
|
497
|
-
}
|
|
498
|
-
setSizingVariables() {
|
|
499
|
-
const paletteTileSize = this.service.paletteTileLayout(this.paletteSettings.tileSize);
|
|
500
|
-
const element = this.host.nativeElement.querySelector('.k-coloreditor-views.k-vstack');
|
|
501
|
-
const cssProperties = [`--kendo-color-preview-columns: ${this.paletteSettings.columns};`];
|
|
502
|
-
if (paletteTileSize.width) {
|
|
503
|
-
cssProperties.push(`--kendo-color-preview-width: ${paletteTileSize.width}px;`);
|
|
504
|
-
}
|
|
505
|
-
if (paletteTileSize.height) {
|
|
506
|
-
cssProperties.push(`--kendo-color-preview-height: ${paletteTileSize.height}px;`);
|
|
507
|
-
}
|
|
508
|
-
this.renderer.setProperty(element, 'style', cssProperties.join(' '));
|
|
509
|
-
}
|
|
510
|
-
changeCurrentValue(color) {
|
|
511
|
-
this.selection = color;
|
|
512
|
-
this.notifyNgTouched();
|
|
513
|
-
}
|
|
514
|
-
resetInnerComponentValue() {
|
|
515
|
-
this.selection = null;
|
|
516
|
-
if (this.gradient) {
|
|
517
|
-
this.gradient.reset();
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
this.palette.reset();
|
|
521
|
-
}
|
|
522
|
-
setFlatColorPickerValue(color) {
|
|
523
|
-
if (this.value === color) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
this.value = color;
|
|
527
|
-
this.valueChange.emit(color);
|
|
528
|
-
this.notifyNgChanged(color);
|
|
529
|
-
this.setHostElementAriaLabel();
|
|
530
|
-
}
|
|
531
|
-
setActiveView() {
|
|
532
|
-
if (!isPresent(this.activeView)) {
|
|
533
|
-
this.activeView = this.views[0];
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
if (isDevMode() && this.views.indexOf(this.activeView) === -1) {
|
|
537
|
-
throw new Error("Invalid configuration: The current activeView is not present in the views collection");
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
notifyNgChanged = () => { };
|
|
541
|
-
notifyNgTouched = () => { };
|
|
542
|
-
initDomEvents() {
|
|
543
|
-
if (!this.host) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
const hostElement = this.host.nativeElement;
|
|
547
|
-
this.ngZone.runOutsideAngular(() => {
|
|
548
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'focus', () => {
|
|
549
|
-
this.focused = true;
|
|
550
|
-
}));
|
|
551
|
-
this.subscriptions.add(this.renderer.listen(hostElement, 'blur', () => {
|
|
552
|
-
this.focused = false;
|
|
553
|
-
this.notifyNgTouched();
|
|
554
|
-
}));
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
removeGradientAttributes() {
|
|
558
|
-
if (this.gradientElement) {
|
|
559
|
-
this.renderer.removeAttribute(this.gradientElement.nativeElement, 'role');
|
|
560
|
-
this.renderer.removeAttribute(this.gradientElement.nativeElement, 'aria-label');
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
handleClasses(value, input) {
|
|
564
|
-
const elem = this.host.nativeElement;
|
|
565
|
-
const classes = getStylingClasses('coloreditor', input, this[input], value);
|
|
566
|
-
if (classes.toRemove) {
|
|
567
|
-
this.renderer.removeClass(elem, classes.toRemove);
|
|
568
|
-
}
|
|
569
|
-
if (classes.toAdd) {
|
|
570
|
-
this.renderer.addClass(elem, classes.toAdd);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FlatColorPickerComponent, deps: [{ token: i0.ElementRef }, { token: i1.FlatColorPickerService }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FlatColorPickerComponent, isStandalone: true, selector: "kendo-flatcolorpicker", inputs: { readonly: "readonly", disabled: "disabled", format: "format", value: "value", tabindex: "tabindex", clearButton: "clearButton", preview: "preview", actionsLayout: "actionsLayout", activeView: "activeView", views: "views", gradientSettings: "gradientSettings", adaptiveMode: "adaptiveMode", paletteSettings: "paletteSettings", size: "size" }, outputs: { valueChange: "valueChange", cancel: "cancel", activeViewChange: "activeViewChange", clearButtonClick: "clearButtonClick", actionButtonClick: "actionButtonClick" }, host: { listeners: { "keydown.enter": "enterHandler($event)", "keydown.escape": "escapeHandler()", "focusin": "focusHandler($event)" }, properties: { "class.k-flatcolorpicker": "this.hostClasses", "class.k-coloreditor": "this.hostClasses", "class.k-disabled": "this.disabledClass", "attr.aria-disabled": "this.isDisabled", "attr.aria-readonly": "this.ariaReadonly", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabindex", "attr.role": "this.ariaRole", "attr.aria-invalid": "this.isControlInvalid", "class.k-readonly": "this.readonly" } }, providers: [
|
|
575
|
-
{
|
|
576
|
-
multi: true,
|
|
577
|
-
provide: NG_VALUE_ACCESSOR,
|
|
578
|
-
useExisting: forwardRef(() => FlatColorPickerComponent)
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
provide: KendoInput,
|
|
582
|
-
useExisting: forwardRef(() => FlatColorPickerComponent)
|
|
583
|
-
},
|
|
584
|
-
FlatColorPickerService,
|
|
585
|
-
FlatColorPickerLocalizationService,
|
|
586
|
-
{
|
|
587
|
-
provide: LocalizationService,
|
|
588
|
-
useExisting: FlatColorPickerLocalizationService
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
provide: L10N_PREFIX,
|
|
592
|
-
useValue: 'kendo.flatcolorpicker'
|
|
593
|
-
}
|
|
594
|
-
], viewQueries: [{ propertyName: "header", first: true, predicate: ["header"], descendants: true }, { propertyName: "headerElement", first: true, predicate: ["header"], descendants: true, read: ElementRef }, { propertyName: "gradient", first: true, predicate: ["gradient"], descendants: true }, { propertyName: "gradientElement", first: true, predicate: ["gradient"], descendants: true, read: ElementRef }, { propertyName: "palette", first: true, predicate: ["palette"], descendants: true }, { propertyName: "footer", first: true, predicate: ["footer"], descendants: true }], exportAs: ["kendoFlatColorPicker"], usesOnChanges: true, ngImport: i0, template: `
|
|
595
|
-
<ng-container kendoFlatColorPickerLocalizedMessages
|
|
596
|
-
i18n-flatColorPickerNoColor="kendo.flatcolorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
|
|
597
|
-
flatColorPickerNoColor="Flatcolorpicker no color chosen"
|
|
598
|
-
i18n-colorGradientNoColor="kendo.flatcolorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
599
|
-
colorGradientNoColor="Colorgradient no color chosen"
|
|
600
|
-
i18n-colorPaletteNoColor="kendo.flatcolorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
|
|
601
|
-
colorPaletteNoColor="Colorpalette no color chosen"
|
|
602
|
-
i18n-colorGradientHandle="kendo.flatcolorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
|
|
603
|
-
colorGradientHandle="Choose color"
|
|
604
|
-
i18n-clearButton="kendo.flatcolorpicker.clearButton|The title for the clear button."
|
|
605
|
-
clearButton="Clear value"
|
|
606
|
-
i18n-hueSliderHandle="kendo.flatcolorpicker.hueSliderHandle|The title for the hue slider handle."
|
|
607
|
-
hueSliderHandle="Set hue"
|
|
608
|
-
i18n-opacitySliderHandle="kendo.flatcolorpicker.opacitySliderHandle|The title for the opacity slider handle."
|
|
609
|
-
opacitySliderHandle="Set opacity"
|
|
610
|
-
i18n-contrastRatio="kendo.flatcolorpicker.contrastRatio|The contrast ratio message for the contrast tool."
|
|
611
|
-
contrastRatio="Contrast ratio"
|
|
612
|
-
i18n-previewColor="kendo.flatcolorpicker.previewColor|The message for the color preview pane."
|
|
613
|
-
previewColor="Color preview"
|
|
614
|
-
i18n-revertSelection="kendo.flatcolorpicker.revertSelection|The message for the selected color pane."
|
|
615
|
-
revertSelection="Revert selection"
|
|
616
|
-
i18n-gradientView="kendo.flatcolorpicker.gradientView|The message for the gradient view button."
|
|
617
|
-
gradientView="Gradient view"
|
|
618
|
-
i18n-paletteView="kendo.flatcolorpicker.paletteView|The message for the palette view button."
|
|
619
|
-
paletteView="Palette view"
|
|
620
|
-
i18n-formatButton="kendo.flatcolorpicker.formatButton|The message for the input format toggle button."
|
|
621
|
-
formatButton="Change color format"
|
|
622
|
-
i18n-applyButton="kendo.flatcolorpicker.applyButton|The message for the Apply action button."
|
|
623
|
-
applyButton="Apply"
|
|
624
|
-
i18n-cancelButton="kendo.flatcolorpicker.cancelButton|The message for the Cancel action button."
|
|
625
|
-
cancelButton="Cancel"
|
|
626
|
-
i18n-redChannelLabel="kendo.flatcolorpicker.redChannelLabel|The label of the NumericTextBox representing the red color channel."
|
|
627
|
-
redChannelLabel="Red channel"
|
|
628
|
-
i18n-greenChannelLabel="kendo.flatcolorpicker.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
|
|
629
|
-
greenChannelLabel="Green channel"
|
|
630
|
-
i18n-blueChannelLabel="kendo.flatcolorpicker.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
|
|
631
|
-
blueChannelLabel="Blue channel"
|
|
632
|
-
i18n-alphaChannelLabel="kendo.flatcolorpicker.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
|
|
633
|
-
alphaChannelLabel="Alpha channel"
|
|
634
|
-
i18n-redInputPlaceholder="kendo.flatcolorpicker.redInputPlaceholder|The placeholder for the red color input."
|
|
635
|
-
redChannelLabel="R"
|
|
636
|
-
i18n-greenInputPlaceholder="kendo.flatcolorpicker.greenInputPlaceholder|The placeholder for the green color input."
|
|
637
|
-
greenInputPlaceholder="G"
|
|
638
|
-
i18n-blueInputPlaceholder="kendo.flatcolorpicker.blueInputPlaceholder|The placeholder for the blue color input."
|
|
639
|
-
blueInputPlaceholder="B"
|
|
640
|
-
i18n-hexInputPlaceholder="kendo.flatcolorpicker.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
641
|
-
hexInputPlaceholder="HEX">
|
|
642
|
-
</ng-container>
|
|
643
|
-
@if (headerHasContent) {
|
|
644
|
-
<div kendoFlatColorPickerHeader
|
|
645
|
-
[innerTabIndex]="innerTabIndex"
|
|
646
|
-
#header
|
|
647
|
-
[clearButton]="clearButton"
|
|
648
|
-
[activeView]="activeView"
|
|
649
|
-
[views]="views"
|
|
650
|
-
[size]="size"
|
|
651
|
-
[value]="value"
|
|
652
|
-
[selection]="selection"
|
|
653
|
-
[preview]="preview"
|
|
654
|
-
(clearButtonClick)="onClearButtonClick()"
|
|
655
|
-
(viewChange)="onViewChange($event)"
|
|
656
|
-
(valuePaneClick)="resetSelection($event)"
|
|
657
|
-
(tabOut)="lastFocusable($event)"></div>
|
|
658
|
-
}
|
|
659
|
-
<div class="k-coloreditor-views k-vstack">
|
|
660
|
-
@if (activeView === 'gradient') {
|
|
661
|
-
<kendo-colorgradient #gradient
|
|
662
|
-
[tabindex]="innerTabIndex"
|
|
663
|
-
[value]="selection"
|
|
664
|
-
[size]="size"
|
|
665
|
-
[adaptiveMode]="adaptiveMode"
|
|
666
|
-
[format]="format"
|
|
667
|
-
[opacity]="gradientSettings.opacity"
|
|
668
|
-
[delay]="gradientSettings.delay"
|
|
669
|
-
[contrastTool]="gradientSettings.contrastTool"
|
|
670
|
-
[gradientSliderSmallStep]="gradientSettings.gradientSliderSmallStep"
|
|
671
|
-
[gradientSliderStep]="gradientSettings.gradientSliderStep"
|
|
672
|
-
[readonly]="readonly"
|
|
673
|
-
[ariaAttributesEnabled]="false"
|
|
674
|
-
(keydown.tab)="focusFirstHeaderButton()"
|
|
675
|
-
(valueChange)="handleValueChange($event)"
|
|
676
|
-
></kendo-colorgradient>
|
|
677
|
-
}
|
|
678
|
-
@if (activeView === 'palette') {
|
|
679
|
-
<kendo-colorpalette #palette
|
|
680
|
-
[tabindex]="innerTabIndex"
|
|
681
|
-
[palette]="paletteSettings.palette"
|
|
682
|
-
[size]="size"
|
|
683
|
-
[columns]="paletteSettings.columns"
|
|
684
|
-
[tileSize]="paletteSettings.tileSize"
|
|
685
|
-
[format]="format"
|
|
686
|
-
[value]="selection"
|
|
687
|
-
[readonly]="readonly"
|
|
688
|
-
(valueChange)="handleValueChange($event)"
|
|
689
|
-
></kendo-colorpalette>
|
|
690
|
-
}
|
|
691
|
-
</div>
|
|
692
|
-
@if (preview && !adaptiveMode) {
|
|
693
|
-
<div
|
|
694
|
-
#footer
|
|
695
|
-
kendoFlatColorPickerActionButtons
|
|
696
|
-
[innerTabIndex]="innerTabIndex"
|
|
697
|
-
[size]="size"
|
|
698
|
-
[ngClass]="'k-justify-content-' + actionsLayout"
|
|
699
|
-
(actionButtonClick)="onAction($event)"
|
|
700
|
-
(tabOut)="firstFocusable.focus()">
|
|
701
|
-
</div>
|
|
702
|
-
}
|
|
703
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { kind: "component", type: FlatColorPickerHeaderComponent, selector: "[kendoFlatColorPickerHeader]", inputs: ["clearButton", "activeView", "views", "preview", "innerTabIndex", "value", "selection", "size"], outputs: ["viewChange", "valuePaneClick", "clearButtonClick", "tabOut"] }, { kind: "component", type: ColorGradientComponent, selector: "kendo-colorgradient", inputs: ["adaptiveMode", "id", "opacity", "size", "disabled", "readonly", "clearButton", "delay", "value", "contrastTool", "tabindex", "format", "gradientSliderStep", "gradientSliderSmallStep", "ariaAttributesEnabled"], outputs: ["valueChange"], exportAs: ["kendoColorGradient"] }, { kind: "component", type: ColorPaletteComponent, selector: "kendo-colorpalette", inputs: ["id", "format", "value", "columns", "palette", "size", "tabindex", "disabled", "readonly", "tileSize"], outputs: ["selectionChange", "valueChange", "cellSelection"], exportAs: ["kendoColorPalette"] }, { kind: "component", type: FlatColorPickerActionButtonsComponent, selector: "[kendoFlatColorPickerActionButtons]", inputs: ["innerTabIndex", "size"], outputs: ["actionButtonClick", "tabOut"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
704
|
-
}
|
|
705
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FlatColorPickerComponent, decorators: [{
|
|
706
|
-
type: Component,
|
|
707
|
-
args: [{
|
|
708
|
-
exportAs: 'kendoFlatColorPicker',
|
|
709
|
-
selector: 'kendo-flatcolorpicker',
|
|
710
|
-
providers: [
|
|
711
|
-
{
|
|
712
|
-
multi: true,
|
|
713
|
-
provide: NG_VALUE_ACCESSOR,
|
|
714
|
-
useExisting: forwardRef(() => FlatColorPickerComponent)
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
provide: KendoInput,
|
|
718
|
-
useExisting: forwardRef(() => FlatColorPickerComponent)
|
|
719
|
-
},
|
|
720
|
-
FlatColorPickerService,
|
|
721
|
-
FlatColorPickerLocalizationService,
|
|
722
|
-
{
|
|
723
|
-
provide: LocalizationService,
|
|
724
|
-
useExisting: FlatColorPickerLocalizationService
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
provide: L10N_PREFIX,
|
|
728
|
-
useValue: 'kendo.flatcolorpicker'
|
|
729
|
-
}
|
|
730
|
-
],
|
|
731
|
-
template: `
|
|
732
|
-
<ng-container kendoFlatColorPickerLocalizedMessages
|
|
733
|
-
i18n-flatColorPickerNoColor="kendo.flatcolorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
|
|
734
|
-
flatColorPickerNoColor="Flatcolorpicker no color chosen"
|
|
735
|
-
i18n-colorGradientNoColor="kendo.flatcolorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
|
|
736
|
-
colorGradientNoColor="Colorgradient no color chosen"
|
|
737
|
-
i18n-colorPaletteNoColor="kendo.flatcolorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
|
|
738
|
-
colorPaletteNoColor="Colorpalette no color chosen"
|
|
739
|
-
i18n-colorGradientHandle="kendo.flatcolorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
|
|
740
|
-
colorGradientHandle="Choose color"
|
|
741
|
-
i18n-clearButton="kendo.flatcolorpicker.clearButton|The title for the clear button."
|
|
742
|
-
clearButton="Clear value"
|
|
743
|
-
i18n-hueSliderHandle="kendo.flatcolorpicker.hueSliderHandle|The title for the hue slider handle."
|
|
744
|
-
hueSliderHandle="Set hue"
|
|
745
|
-
i18n-opacitySliderHandle="kendo.flatcolorpicker.opacitySliderHandle|The title for the opacity slider handle."
|
|
746
|
-
opacitySliderHandle="Set opacity"
|
|
747
|
-
i18n-contrastRatio="kendo.flatcolorpicker.contrastRatio|The contrast ratio message for the contrast tool."
|
|
748
|
-
contrastRatio="Contrast ratio"
|
|
749
|
-
i18n-previewColor="kendo.flatcolorpicker.previewColor|The message for the color preview pane."
|
|
750
|
-
previewColor="Color preview"
|
|
751
|
-
i18n-revertSelection="kendo.flatcolorpicker.revertSelection|The message for the selected color pane."
|
|
752
|
-
revertSelection="Revert selection"
|
|
753
|
-
i18n-gradientView="kendo.flatcolorpicker.gradientView|The message for the gradient view button."
|
|
754
|
-
gradientView="Gradient view"
|
|
755
|
-
i18n-paletteView="kendo.flatcolorpicker.paletteView|The message for the palette view button."
|
|
756
|
-
paletteView="Palette view"
|
|
757
|
-
i18n-formatButton="kendo.flatcolorpicker.formatButton|The message for the input format toggle button."
|
|
758
|
-
formatButton="Change color format"
|
|
759
|
-
i18n-applyButton="kendo.flatcolorpicker.applyButton|The message for the Apply action button."
|
|
760
|
-
applyButton="Apply"
|
|
761
|
-
i18n-cancelButton="kendo.flatcolorpicker.cancelButton|The message for the Cancel action button."
|
|
762
|
-
cancelButton="Cancel"
|
|
763
|
-
i18n-redChannelLabel="kendo.flatcolorpicker.redChannelLabel|The label of the NumericTextBox representing the red color channel."
|
|
764
|
-
redChannelLabel="Red channel"
|
|
765
|
-
i18n-greenChannelLabel="kendo.flatcolorpicker.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
|
|
766
|
-
greenChannelLabel="Green channel"
|
|
767
|
-
i18n-blueChannelLabel="kendo.flatcolorpicker.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
|
|
768
|
-
blueChannelLabel="Blue channel"
|
|
769
|
-
i18n-alphaChannelLabel="kendo.flatcolorpicker.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
|
|
770
|
-
alphaChannelLabel="Alpha channel"
|
|
771
|
-
i18n-redInputPlaceholder="kendo.flatcolorpicker.redInputPlaceholder|The placeholder for the red color input."
|
|
772
|
-
redChannelLabel="R"
|
|
773
|
-
i18n-greenInputPlaceholder="kendo.flatcolorpicker.greenInputPlaceholder|The placeholder for the green color input."
|
|
774
|
-
greenInputPlaceholder="G"
|
|
775
|
-
i18n-blueInputPlaceholder="kendo.flatcolorpicker.blueInputPlaceholder|The placeholder for the blue color input."
|
|
776
|
-
blueInputPlaceholder="B"
|
|
777
|
-
i18n-hexInputPlaceholder="kendo.flatcolorpicker.hexInputPlaceholder|The placeholder for the HEX color input."
|
|
778
|
-
hexInputPlaceholder="HEX">
|
|
779
|
-
</ng-container>
|
|
780
|
-
@if (headerHasContent) {
|
|
781
|
-
<div kendoFlatColorPickerHeader
|
|
782
|
-
[innerTabIndex]="innerTabIndex"
|
|
783
|
-
#header
|
|
784
|
-
[clearButton]="clearButton"
|
|
785
|
-
[activeView]="activeView"
|
|
786
|
-
[views]="views"
|
|
787
|
-
[size]="size"
|
|
788
|
-
[value]="value"
|
|
789
|
-
[selection]="selection"
|
|
790
|
-
[preview]="preview"
|
|
791
|
-
(clearButtonClick)="onClearButtonClick()"
|
|
792
|
-
(viewChange)="onViewChange($event)"
|
|
793
|
-
(valuePaneClick)="resetSelection($event)"
|
|
794
|
-
(tabOut)="lastFocusable($event)"></div>
|
|
795
|
-
}
|
|
796
|
-
<div class="k-coloreditor-views k-vstack">
|
|
797
|
-
@if (activeView === 'gradient') {
|
|
798
|
-
<kendo-colorgradient #gradient
|
|
799
|
-
[tabindex]="innerTabIndex"
|
|
800
|
-
[value]="selection"
|
|
801
|
-
[size]="size"
|
|
802
|
-
[adaptiveMode]="adaptiveMode"
|
|
803
|
-
[format]="format"
|
|
804
|
-
[opacity]="gradientSettings.opacity"
|
|
805
|
-
[delay]="gradientSettings.delay"
|
|
806
|
-
[contrastTool]="gradientSettings.contrastTool"
|
|
807
|
-
[gradientSliderSmallStep]="gradientSettings.gradientSliderSmallStep"
|
|
808
|
-
[gradientSliderStep]="gradientSettings.gradientSliderStep"
|
|
809
|
-
[readonly]="readonly"
|
|
810
|
-
[ariaAttributesEnabled]="false"
|
|
811
|
-
(keydown.tab)="focusFirstHeaderButton()"
|
|
812
|
-
(valueChange)="handleValueChange($event)"
|
|
813
|
-
></kendo-colorgradient>
|
|
814
|
-
}
|
|
815
|
-
@if (activeView === 'palette') {
|
|
816
|
-
<kendo-colorpalette #palette
|
|
817
|
-
[tabindex]="innerTabIndex"
|
|
818
|
-
[palette]="paletteSettings.palette"
|
|
819
|
-
[size]="size"
|
|
820
|
-
[columns]="paletteSettings.columns"
|
|
821
|
-
[tileSize]="paletteSettings.tileSize"
|
|
822
|
-
[format]="format"
|
|
823
|
-
[value]="selection"
|
|
824
|
-
[readonly]="readonly"
|
|
825
|
-
(valueChange)="handleValueChange($event)"
|
|
826
|
-
></kendo-colorpalette>
|
|
827
|
-
}
|
|
828
|
-
</div>
|
|
829
|
-
@if (preview && !adaptiveMode) {
|
|
830
|
-
<div
|
|
831
|
-
#footer
|
|
832
|
-
kendoFlatColorPickerActionButtons
|
|
833
|
-
[innerTabIndex]="innerTabIndex"
|
|
834
|
-
[size]="size"
|
|
835
|
-
[ngClass]="'k-justify-content-' + actionsLayout"
|
|
836
|
-
(actionButtonClick)="onAction($event)"
|
|
837
|
-
(tabOut)="firstFocusable.focus()">
|
|
838
|
-
</div>
|
|
839
|
-
}
|
|
840
|
-
`,
|
|
841
|
-
standalone: true,
|
|
842
|
-
imports: [LocalizedColorPickerMessagesDirective, FlatColorPickerHeaderComponent, ColorGradientComponent, ColorPaletteComponent, FlatColorPickerActionButtonsComponent, NgClass]
|
|
843
|
-
}]
|
|
844
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.FlatColorPickerService }, { type: i2.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.Injector }], propDecorators: { hostClasses: [{
|
|
845
|
-
type: HostBinding,
|
|
846
|
-
args: ['class.k-flatcolorpicker']
|
|
847
|
-
}, {
|
|
848
|
-
type: HostBinding,
|
|
849
|
-
args: ['class.k-coloreditor']
|
|
850
|
-
}], disabledClass: [{
|
|
851
|
-
type: HostBinding,
|
|
852
|
-
args: ['class.k-disabled']
|
|
853
|
-
}, {
|
|
854
|
-
type: HostBinding,
|
|
855
|
-
args: ['attr.aria-disabled']
|
|
856
|
-
}], ariaReadonly: [{
|
|
857
|
-
type: HostBinding,
|
|
858
|
-
args: ['attr.aria-readonly']
|
|
859
|
-
}], direction: [{
|
|
860
|
-
type: HostBinding,
|
|
861
|
-
args: ['attr.dir']
|
|
862
|
-
}], hostTabindex: [{
|
|
863
|
-
type: HostBinding,
|
|
864
|
-
args: ['attr.tabindex']
|
|
865
|
-
}], ariaRole: [{
|
|
866
|
-
type: HostBinding,
|
|
867
|
-
args: ['attr.role']
|
|
868
|
-
}], isControlInvalid: [{
|
|
869
|
-
type: HostBinding,
|
|
870
|
-
args: ['attr.aria-invalid']
|
|
871
|
-
}], isDisabled: [{
|
|
872
|
-
type: HostBinding,
|
|
873
|
-
args: ['attr.aria-disabled']
|
|
874
|
-
}], enterHandler: [{
|
|
875
|
-
type: HostListener,
|
|
876
|
-
args: ['keydown.enter', ['$event']]
|
|
877
|
-
}], escapeHandler: [{
|
|
878
|
-
type: HostListener,
|
|
879
|
-
args: ['keydown.escape']
|
|
880
|
-
}], focusHandler: [{
|
|
881
|
-
type: HostListener,
|
|
882
|
-
args: ['focusin', ['$event']]
|
|
883
|
-
}], readonly: [{
|
|
884
|
-
type: Input
|
|
885
|
-
}, {
|
|
886
|
-
type: HostBinding,
|
|
887
|
-
args: ['class.k-readonly']
|
|
888
|
-
}], disabled: [{
|
|
889
|
-
type: Input
|
|
890
|
-
}], format: [{
|
|
891
|
-
type: Input
|
|
892
|
-
}], value: [{
|
|
893
|
-
type: Input
|
|
894
|
-
}], tabindex: [{
|
|
895
|
-
type: Input
|
|
896
|
-
}], clearButton: [{
|
|
897
|
-
type: Input
|
|
898
|
-
}], preview: [{
|
|
899
|
-
type: Input
|
|
900
|
-
}], actionsLayout: [{
|
|
901
|
-
type: Input
|
|
902
|
-
}], activeView: [{
|
|
903
|
-
type: Input
|
|
904
|
-
}], views: [{
|
|
905
|
-
type: Input
|
|
906
|
-
}], gradientSettings: [{
|
|
907
|
-
type: Input
|
|
908
|
-
}], adaptiveMode: [{
|
|
909
|
-
type: Input
|
|
910
|
-
}], paletteSettings: [{
|
|
911
|
-
type: Input
|
|
912
|
-
}], size: [{
|
|
913
|
-
type: Input
|
|
914
|
-
}], valueChange: [{
|
|
915
|
-
type: Output
|
|
916
|
-
}], cancel: [{
|
|
917
|
-
type: Output
|
|
918
|
-
}], activeViewChange: [{
|
|
919
|
-
type: Output
|
|
920
|
-
}], clearButtonClick: [{
|
|
921
|
-
type: Output
|
|
922
|
-
}], actionButtonClick: [{
|
|
923
|
-
type: Output
|
|
924
|
-
}], header: [{
|
|
925
|
-
type: ViewChild,
|
|
926
|
-
args: ['header']
|
|
927
|
-
}], headerElement: [{
|
|
928
|
-
type: ViewChild,
|
|
929
|
-
args: ['header', { read: ElementRef }]
|
|
930
|
-
}], gradient: [{
|
|
931
|
-
type: ViewChild,
|
|
932
|
-
args: ['gradient']
|
|
933
|
-
}], gradientElement: [{
|
|
934
|
-
type: ViewChild,
|
|
935
|
-
args: ['gradient', { read: ElementRef }]
|
|
936
|
-
}], palette: [{
|
|
937
|
-
type: ViewChild,
|
|
938
|
-
args: ['palette']
|
|
939
|
-
}], footer: [{
|
|
940
|
-
type: ViewChild,
|
|
941
|
-
args: ['footer']
|
|
942
|
-
}] } });
|