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