@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,433 @@
|
|
|
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
|
+
import { Component, Input, Output, EventEmitter, ElementRef, HostBinding, ViewChild, Renderer2 } from '@angular/core';
|
|
7
|
+
import { getRGBA, parseColor, getColorFromRGBA } from './utils';
|
|
8
|
+
import { isPresent } from '../common/utils';
|
|
9
|
+
import { guid, isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
11
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import { NumericTextBoxComponent } from './../numerictextbox/numerictextbox.component';
|
|
13
|
+
import { caretAltExpandIcon } from '@progress/kendo-svg-icons';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "@progress/kendo-angular-buttons";
|
|
17
|
+
import * as i3 from "../numerictextbox/numerictextbox.component";
|
|
18
|
+
import * as i4 from "@angular/common";
|
|
19
|
+
import * as i5 from "./color-gradient-numeric-label.directive";
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export class ColorInputComponent {
|
|
24
|
+
constructor(host, renderer, localizationService) {
|
|
25
|
+
this.host = host;
|
|
26
|
+
this.renderer = renderer;
|
|
27
|
+
this.localizationService = localizationService;
|
|
28
|
+
/**
|
|
29
|
+
* The id of the hex input.
|
|
30
|
+
*/
|
|
31
|
+
this.focusableId = `k-${guid()}`;
|
|
32
|
+
/**
|
|
33
|
+
* The inputs tabindex.
|
|
34
|
+
*/
|
|
35
|
+
this.tabindex = -1;
|
|
36
|
+
/**
|
|
37
|
+
* Sets whether the alpha slider will be shown.
|
|
38
|
+
*/
|
|
39
|
+
this.opacity = true;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the disabled state of the ColorInput.
|
|
42
|
+
*/
|
|
43
|
+
this.disabled = false;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the read-only state of the ColorInput.
|
|
46
|
+
*/
|
|
47
|
+
this.readonly = false;
|
|
48
|
+
/**
|
|
49
|
+
* Emits a parsed rgba string color.
|
|
50
|
+
*/
|
|
51
|
+
this.valueChange = new EventEmitter();
|
|
52
|
+
/**
|
|
53
|
+
* Emits when the user tabs out of the last focusable input.
|
|
54
|
+
*/
|
|
55
|
+
this.tabOut = new EventEmitter();
|
|
56
|
+
this.colorInputClass = true;
|
|
57
|
+
/**
|
|
58
|
+
* The rgba inputs values.
|
|
59
|
+
*/
|
|
60
|
+
this.rgba = {};
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
this.caretAltExpandIcon = caretAltExpandIcon;
|
|
65
|
+
this.subscriptions = new Subscription();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Indicates whether any of the inputs are focused.
|
|
69
|
+
*/
|
|
70
|
+
get isFocused() {
|
|
71
|
+
if (!(isDocumentAvailable() && isPresent(this.host))) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const activeElement = document.activeElement;
|
|
75
|
+
return this.host.nativeElement.contains(activeElement);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Indicates whether any of the rgba inputs have value.
|
|
79
|
+
*/
|
|
80
|
+
get rgbaInputValid() {
|
|
81
|
+
return Object.keys(this.rgba).every(key => isPresent(this.rgba[key]));
|
|
82
|
+
}
|
|
83
|
+
ngAfterViewInit() {
|
|
84
|
+
this.initDomEvents();
|
|
85
|
+
}
|
|
86
|
+
ngOnDestroy() {
|
|
87
|
+
if (this.subscriptions) {
|
|
88
|
+
this.subscriptions.unsubscribe();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
ngOnChanges(changes) {
|
|
92
|
+
if (isPresent(changes['value']) && !this.isFocused) {
|
|
93
|
+
this.hex = parseColor(this.value, 'hex', this.opacity);
|
|
94
|
+
this.rgba = getRGBA(this.value);
|
|
95
|
+
this.rgba.a = parseColor(this.value, 'rgba', this.opacity) ? this.rgba.a : 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
get formatButtonTitle() {
|
|
99
|
+
return this.localizationService.get('formatButton');
|
|
100
|
+
}
|
|
101
|
+
handleRgbaValueChange() {
|
|
102
|
+
const color = getColorFromRGBA(this.rgba);
|
|
103
|
+
if (!this.rgbaInputValid || color === this.value) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.value = color;
|
|
107
|
+
this.rgba = getRGBA(this.value);
|
|
108
|
+
this.hex = parseColor(color, 'hex', this.opacity);
|
|
109
|
+
this.valueChange.emit(color);
|
|
110
|
+
}
|
|
111
|
+
focusDragHandle(event) {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
event.stopImmediatePropagation();
|
|
114
|
+
this.tabOut.emit();
|
|
115
|
+
}
|
|
116
|
+
handleHexValueChange(hex) {
|
|
117
|
+
this.hex = hex;
|
|
118
|
+
const color = parseColor(hex, 'rgba', this.opacity);
|
|
119
|
+
if (!isPresent(color) || color === this.value) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.value = color;
|
|
123
|
+
this.rgba = getRGBA(color);
|
|
124
|
+
this.valueChange.emit(color);
|
|
125
|
+
}
|
|
126
|
+
handleRgbaInputBlur() {
|
|
127
|
+
if (!this.rgbaInputValid) {
|
|
128
|
+
this.rgba = getRGBA(this.value);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
handleHexInputBlur() {
|
|
132
|
+
this.hex = parseColor(this.value, 'hex', this.opacity);
|
|
133
|
+
}
|
|
134
|
+
focusLast() {
|
|
135
|
+
this.lastInput().focus();
|
|
136
|
+
}
|
|
137
|
+
onTab() {
|
|
138
|
+
if (this.opacity) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
toggleFormatView() {
|
|
143
|
+
this.formatView = this.formatView === 'hex' ? 'rgba' : 'hex';
|
|
144
|
+
}
|
|
145
|
+
initDomEvents() {
|
|
146
|
+
if (!this.host) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.subscriptions.add(this.renderer.listen(this.toggleFormatButton.nativeElement, 'click', () => this.toggleFormatView()));
|
|
150
|
+
}
|
|
151
|
+
lastInput() {
|
|
152
|
+
return this.hexInput?.nativeElement || this.opacityInput || this.blueInput;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
ColorInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
156
|
+
ColorInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ColorInputComponent, selector: "kendo-colorinput", inputs: { focusableId: "focusableId", formatView: "formatView", tabindex: "tabindex", value: "value", opacity: "opacity", disabled: "disabled", readonly: "readonly" }, outputs: { valueChange: "valueChange", tabOut: "tabOut" }, host: { properties: { "class.k-colorgradient-inputs": "this.colorInputClass", "class.k-hstack": "this.colorInputClass" } }, viewQueries: [{ propertyName: "opacityInput", first: true, predicate: ["opacityInput"], descendants: true }, { propertyName: "hexInput", first: true, predicate: ["hexInput"], descendants: true }, { propertyName: "blueInput", first: true, predicate: ["blue"], descendants: true }, { propertyName: "toggleFormatButton", first: true, predicate: ["toggleFormatButton"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: `
|
|
157
|
+
<div class="k-vstack">
|
|
158
|
+
<button
|
|
159
|
+
kendoButton
|
|
160
|
+
type="button"
|
|
161
|
+
fillMode="flat"
|
|
162
|
+
#toggleFormatButton
|
|
163
|
+
icon="caret-alt-expand"
|
|
164
|
+
[svgIcon]="caretAltExpandIcon"
|
|
165
|
+
class="k-colorgradient-toggle-mode"
|
|
166
|
+
[attr.aria-label]="formatButtonTitle"
|
|
167
|
+
[attr.title]="formatButtonTitle"
|
|
168
|
+
[disabled]="disabled"
|
|
169
|
+
[tabindex]="tabindex.toString()"
|
|
170
|
+
>
|
|
171
|
+
</button>
|
|
172
|
+
</div>
|
|
173
|
+
<div *ngIf="formatView === 'hex'" class="k-vstack">
|
|
174
|
+
<input
|
|
175
|
+
#hexInput
|
|
176
|
+
[id]="focusableId"
|
|
177
|
+
class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"
|
|
178
|
+
[disabled]="disabled"
|
|
179
|
+
[readonly]="readonly"
|
|
180
|
+
[value]="hex || ''"
|
|
181
|
+
(blur)="handleHexInputBlur()"
|
|
182
|
+
(input)="handleHexValueChange(hexInput.value)"
|
|
183
|
+
[tabindex]="tabindex.toString()"
|
|
184
|
+
(keydown.tab)="focusDragHandle($event)"
|
|
185
|
+
/>
|
|
186
|
+
<label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>
|
|
187
|
+
</div>
|
|
188
|
+
<ng-container *ngIf="formatView === 'rgba'">
|
|
189
|
+
<div class="k-vstack">
|
|
190
|
+
<kendo-numerictextbox
|
|
191
|
+
#red
|
|
192
|
+
kendoAdditionalNumericLabel="red"
|
|
193
|
+
[localizationService]="localizationService"
|
|
194
|
+
[disabled]="disabled"
|
|
195
|
+
[readonly]="readonly"
|
|
196
|
+
[tabindex]="tabindex"
|
|
197
|
+
[min]="0"
|
|
198
|
+
[max]="255"
|
|
199
|
+
[(value)]="rgba.r"
|
|
200
|
+
[autoCorrect]="true"
|
|
201
|
+
[spinners]="false"
|
|
202
|
+
[format]="'n'"
|
|
203
|
+
[decimals]="0"
|
|
204
|
+
(blur)="handleRgbaInputBlur()"
|
|
205
|
+
(valueChange)="handleRgbaValueChange()">
|
|
206
|
+
</kendo-numerictextbox>
|
|
207
|
+
<label [for]="red.focusableId" class="k-colorgradient-input-label">R</label>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="k-vstack">
|
|
210
|
+
<kendo-numerictextbox
|
|
211
|
+
#green
|
|
212
|
+
kendoAdditionalNumericLabel="green"
|
|
213
|
+
[localizationService]="localizationService"
|
|
214
|
+
[disabled]="disabled"
|
|
215
|
+
[readonly]="readonly"
|
|
216
|
+
[tabindex]="tabindex"
|
|
217
|
+
[min]="0"
|
|
218
|
+
[max]="255"
|
|
219
|
+
[(value)]="rgba.g"
|
|
220
|
+
[autoCorrect]="true"
|
|
221
|
+
[spinners]="false"
|
|
222
|
+
[format]="'n'"
|
|
223
|
+
[decimals]="0"
|
|
224
|
+
(blur)="handleRgbaInputBlur()"
|
|
225
|
+
(valueChange)="handleRgbaValueChange()">
|
|
226
|
+
</kendo-numerictextbox>
|
|
227
|
+
<label [for]="green.focusableId" class="k-colorgradient-input-label">G</label>
|
|
228
|
+
</div>
|
|
229
|
+
<div class="k-vstack">
|
|
230
|
+
<kendo-numerictextbox
|
|
231
|
+
#blue
|
|
232
|
+
kendoAdditionalNumericLabel="blue"
|
|
233
|
+
[localizationService]="localizationService"
|
|
234
|
+
[disabled]="disabled"
|
|
235
|
+
[readonly]="readonly"
|
|
236
|
+
[tabindex]="tabindex"
|
|
237
|
+
[min]="0"
|
|
238
|
+
[max]="255"
|
|
239
|
+
[(value)]="rgba.b"
|
|
240
|
+
[autoCorrect]="true"
|
|
241
|
+
[spinners]="false"
|
|
242
|
+
[format]="'n'"
|
|
243
|
+
[decimals]="0"
|
|
244
|
+
(blur)="handleRgbaInputBlur()"
|
|
245
|
+
(valueChange)="handleRgbaValueChange()"
|
|
246
|
+
(keydown.tab)="onTab()">
|
|
247
|
+
</kendo-numerictextbox>
|
|
248
|
+
<label [for]="blue.focusableId" class="k-colorgradient-input-label">B</label>
|
|
249
|
+
</div>
|
|
250
|
+
<div class="k-vstack" *ngIf="opacity">
|
|
251
|
+
<kendo-numerictextbox #opacityInput
|
|
252
|
+
#alpha
|
|
253
|
+
kendoAdditionalNumericLabel="alpha"
|
|
254
|
+
[localizationService]="localizationService"
|
|
255
|
+
[disabled]="disabled"
|
|
256
|
+
[readonly]="readonly"
|
|
257
|
+
[tabindex]="tabindex"
|
|
258
|
+
[min]="0"
|
|
259
|
+
[max]="1"
|
|
260
|
+
[(value)]="rgba.a"
|
|
261
|
+
[autoCorrect]="true"
|
|
262
|
+
[spinners]="false"
|
|
263
|
+
[step]="0.01"
|
|
264
|
+
[format]="'n2'"
|
|
265
|
+
[decimals]="2"
|
|
266
|
+
(blur)="handleRgbaInputBlur()"
|
|
267
|
+
(valueChange)="handleRgbaValueChange()"
|
|
268
|
+
(keydown.tab)="focusDragHandle($event)">
|
|
269
|
+
</kendo-numerictextbox>
|
|
270
|
+
<label [for]="alpha.focusableId" class="k-colorgradient-input-label">A</label>
|
|
271
|
+
</div>
|
|
272
|
+
</ng-container>
|
|
273
|
+
`, isInline: true, components: [{ type: i2.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i3.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NumericLabelDirective, selector: "[kendoAdditionalNumericLabel]", inputs: ["kendoAdditionalNumericLabel", "localizationService"] }] });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorInputComponent, decorators: [{
|
|
275
|
+
type: Component,
|
|
276
|
+
args: [{
|
|
277
|
+
selector: 'kendo-colorinput',
|
|
278
|
+
template: `
|
|
279
|
+
<div class="k-vstack">
|
|
280
|
+
<button
|
|
281
|
+
kendoButton
|
|
282
|
+
type="button"
|
|
283
|
+
fillMode="flat"
|
|
284
|
+
#toggleFormatButton
|
|
285
|
+
icon="caret-alt-expand"
|
|
286
|
+
[svgIcon]="caretAltExpandIcon"
|
|
287
|
+
class="k-colorgradient-toggle-mode"
|
|
288
|
+
[attr.aria-label]="formatButtonTitle"
|
|
289
|
+
[attr.title]="formatButtonTitle"
|
|
290
|
+
[disabled]="disabled"
|
|
291
|
+
[tabindex]="tabindex.toString()"
|
|
292
|
+
>
|
|
293
|
+
</button>
|
|
294
|
+
</div>
|
|
295
|
+
<div *ngIf="formatView === 'hex'" class="k-vstack">
|
|
296
|
+
<input
|
|
297
|
+
#hexInput
|
|
298
|
+
[id]="focusableId"
|
|
299
|
+
class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"
|
|
300
|
+
[disabled]="disabled"
|
|
301
|
+
[readonly]="readonly"
|
|
302
|
+
[value]="hex || ''"
|
|
303
|
+
(blur)="handleHexInputBlur()"
|
|
304
|
+
(input)="handleHexValueChange(hexInput.value)"
|
|
305
|
+
[tabindex]="tabindex.toString()"
|
|
306
|
+
(keydown.tab)="focusDragHandle($event)"
|
|
307
|
+
/>
|
|
308
|
+
<label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>
|
|
309
|
+
</div>
|
|
310
|
+
<ng-container *ngIf="formatView === 'rgba'">
|
|
311
|
+
<div class="k-vstack">
|
|
312
|
+
<kendo-numerictextbox
|
|
313
|
+
#red
|
|
314
|
+
kendoAdditionalNumericLabel="red"
|
|
315
|
+
[localizationService]="localizationService"
|
|
316
|
+
[disabled]="disabled"
|
|
317
|
+
[readonly]="readonly"
|
|
318
|
+
[tabindex]="tabindex"
|
|
319
|
+
[min]="0"
|
|
320
|
+
[max]="255"
|
|
321
|
+
[(value)]="rgba.r"
|
|
322
|
+
[autoCorrect]="true"
|
|
323
|
+
[spinners]="false"
|
|
324
|
+
[format]="'n'"
|
|
325
|
+
[decimals]="0"
|
|
326
|
+
(blur)="handleRgbaInputBlur()"
|
|
327
|
+
(valueChange)="handleRgbaValueChange()">
|
|
328
|
+
</kendo-numerictextbox>
|
|
329
|
+
<label [for]="red.focusableId" class="k-colorgradient-input-label">R</label>
|
|
330
|
+
</div>
|
|
331
|
+
<div class="k-vstack">
|
|
332
|
+
<kendo-numerictextbox
|
|
333
|
+
#green
|
|
334
|
+
kendoAdditionalNumericLabel="green"
|
|
335
|
+
[localizationService]="localizationService"
|
|
336
|
+
[disabled]="disabled"
|
|
337
|
+
[readonly]="readonly"
|
|
338
|
+
[tabindex]="tabindex"
|
|
339
|
+
[min]="0"
|
|
340
|
+
[max]="255"
|
|
341
|
+
[(value)]="rgba.g"
|
|
342
|
+
[autoCorrect]="true"
|
|
343
|
+
[spinners]="false"
|
|
344
|
+
[format]="'n'"
|
|
345
|
+
[decimals]="0"
|
|
346
|
+
(blur)="handleRgbaInputBlur()"
|
|
347
|
+
(valueChange)="handleRgbaValueChange()">
|
|
348
|
+
</kendo-numerictextbox>
|
|
349
|
+
<label [for]="green.focusableId" class="k-colorgradient-input-label">G</label>
|
|
350
|
+
</div>
|
|
351
|
+
<div class="k-vstack">
|
|
352
|
+
<kendo-numerictextbox
|
|
353
|
+
#blue
|
|
354
|
+
kendoAdditionalNumericLabel="blue"
|
|
355
|
+
[localizationService]="localizationService"
|
|
356
|
+
[disabled]="disabled"
|
|
357
|
+
[readonly]="readonly"
|
|
358
|
+
[tabindex]="tabindex"
|
|
359
|
+
[min]="0"
|
|
360
|
+
[max]="255"
|
|
361
|
+
[(value)]="rgba.b"
|
|
362
|
+
[autoCorrect]="true"
|
|
363
|
+
[spinners]="false"
|
|
364
|
+
[format]="'n'"
|
|
365
|
+
[decimals]="0"
|
|
366
|
+
(blur)="handleRgbaInputBlur()"
|
|
367
|
+
(valueChange)="handleRgbaValueChange()"
|
|
368
|
+
(keydown.tab)="onTab()">
|
|
369
|
+
</kendo-numerictextbox>
|
|
370
|
+
<label [for]="blue.focusableId" class="k-colorgradient-input-label">B</label>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="k-vstack" *ngIf="opacity">
|
|
373
|
+
<kendo-numerictextbox #opacityInput
|
|
374
|
+
#alpha
|
|
375
|
+
kendoAdditionalNumericLabel="alpha"
|
|
376
|
+
[localizationService]="localizationService"
|
|
377
|
+
[disabled]="disabled"
|
|
378
|
+
[readonly]="readonly"
|
|
379
|
+
[tabindex]="tabindex"
|
|
380
|
+
[min]="0"
|
|
381
|
+
[max]="1"
|
|
382
|
+
[(value)]="rgba.a"
|
|
383
|
+
[autoCorrect]="true"
|
|
384
|
+
[spinners]="false"
|
|
385
|
+
[step]="0.01"
|
|
386
|
+
[format]="'n2'"
|
|
387
|
+
[decimals]="2"
|
|
388
|
+
(blur)="handleRgbaInputBlur()"
|
|
389
|
+
(valueChange)="handleRgbaValueChange()"
|
|
390
|
+
(keydown.tab)="focusDragHandle($event)">
|
|
391
|
+
</kendo-numerictextbox>
|
|
392
|
+
<label [for]="alpha.focusableId" class="k-colorgradient-input-label">A</label>
|
|
393
|
+
</div>
|
|
394
|
+
</ng-container>
|
|
395
|
+
`
|
|
396
|
+
}]
|
|
397
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { focusableId: [{
|
|
398
|
+
type: Input
|
|
399
|
+
}], formatView: [{
|
|
400
|
+
type: Input
|
|
401
|
+
}], tabindex: [{
|
|
402
|
+
type: Input
|
|
403
|
+
}], value: [{
|
|
404
|
+
type: Input
|
|
405
|
+
}], opacity: [{
|
|
406
|
+
type: Input
|
|
407
|
+
}], disabled: [{
|
|
408
|
+
type: Input
|
|
409
|
+
}], readonly: [{
|
|
410
|
+
type: Input
|
|
411
|
+
}], valueChange: [{
|
|
412
|
+
type: Output
|
|
413
|
+
}], tabOut: [{
|
|
414
|
+
type: Output
|
|
415
|
+
}], colorInputClass: [{
|
|
416
|
+
type: HostBinding,
|
|
417
|
+
args: ['class.k-colorgradient-inputs']
|
|
418
|
+
}, {
|
|
419
|
+
type: HostBinding,
|
|
420
|
+
args: ['class.k-hstack']
|
|
421
|
+
}], opacityInput: [{
|
|
422
|
+
type: ViewChild,
|
|
423
|
+
args: ['opacityInput']
|
|
424
|
+
}], hexInput: [{
|
|
425
|
+
type: ViewChild,
|
|
426
|
+
args: ['hexInput']
|
|
427
|
+
}], blueInput: [{
|
|
428
|
+
type: ViewChild,
|
|
429
|
+
args: ['blue']
|
|
430
|
+
}], toggleFormatButton: [{
|
|
431
|
+
type: ViewChild,
|
|
432
|
+
args: ['toggleFormatButton', { static: false, read: ElementRef }]
|
|
433
|
+
}] } });
|