@progress/kendo-angular-inputs 7.5.2 → 8.0.0-dev.202201101634
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-inputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/checkbox/checkbox.directive.js +79 -3
- package/dist/es/colorpicker/color-contrast-svg.component.js +95 -0
- package/dist/es/colorpicker/color-gradient.component.js +109 -81
- package/dist/es/colorpicker/color-input.component.js +39 -18
- package/dist/es/colorpicker/color-palette.component.js +28 -18
- package/dist/es/colorpicker/colorpicker.component.js +297 -80
- package/dist/es/colorpicker/constants.js +12 -0
- package/dist/es/colorpicker/contrast-validation.component.js +8 -6
- package/dist/es/colorpicker/contrast.component.js +6 -8
- package/dist/es/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/es/colorpicker/events/cancel-event.js +19 -0
- package/dist/es/colorpicker/events/close-event.js +17 -0
- package/dist/es/colorpicker/{models → events}/kendo-drag-event.js +0 -0
- package/dist/es/colorpicker/events/open-event.js +17 -0
- package/dist/es/colorpicker/events.js +8 -0
- package/dist/es/colorpicker/flatcolorpicker-actions.component.js +50 -0
- package/dist/es/colorpicker/flatcolorpicker-header.component.js +94 -0
- package/dist/es/colorpicker/flatcolorpicker.component.js +553 -0
- package/dist/es/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/es/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/es/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/es/colorpicker/localization/flatcolorpicker-localization.service.js +34 -0
- package/dist/es/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/es/colorpicker/localization/messages.js +36 -0
- package/dist/es/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
- package/dist/{es2015/colorpicker/models/color-picker-view.js → es/colorpicker/models/colorpicker-view.js} +0 -0
- package/dist/es/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/es/colorpicker/models.js +1 -2
- package/dist/es/colorpicker/services/flatcolorpicker.service.js +41 -0
- package/dist/es/colorpicker/utils/color-parser.js +18 -5
- package/dist/es/colorpicker/utils/contrast-curve.js +91 -0
- package/dist/es/colorpicker/utils.js +1 -1
- package/dist/es/colorpicker.module.js +9 -1
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/common/models/styling-classes.js +4 -0
- package/dist/{es2015/colorpicker/models/kendo-drag-event.js → es/common/models.js} +0 -0
- package/dist/es/common/utils.js +37 -0
- package/dist/es/index.js +5 -0
- package/dist/es/main.js +4 -2
- package/dist/es/maskedtextbox/maskedtextbox.component.js +101 -6
- package/dist/es/numerictextbox/numerictextbox.component.js +116 -20
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/radiobutton.directive.js +52 -3
- package/dist/es/shared/textarea.directive.js +3 -2
- package/dist/es/slider/slider.component.js +1 -1
- package/dist/es/switch/switch.component.js +167 -21
- package/dist/es/text-fields-common/text-fields-base.js +1 -1
- package/dist/es/textarea/textarea.component.js +101 -5
- package/dist/es/textbox/textbox.component.js +108 -11
- package/dist/es/textbox/textbox.directive.js +3 -2
- package/dist/es/textbox.module.js +0 -3
- package/dist/es2015/checkbox/checkbox.directive.d.ts +31 -0
- package/dist/es2015/checkbox/checkbox.directive.js +68 -10
- package/dist/es2015/colorpicker/color-contrast-svg.component.d.ts +26 -0
- package/dist/es2015/colorpicker/color-contrast-svg.component.js +97 -0
- package/dist/es2015/colorpicker/color-gradient.component.d.ts +32 -43
- package/dist/es2015/colorpicker/color-gradient.component.js +126 -93
- package/dist/es2015/colorpicker/color-input.component.d.ts +11 -4
- package/dist/es2015/colorpicker/color-input.component.js +52 -32
- package/dist/es2015/colorpicker/color-palette.component.d.ts +8 -3
- package/dist/es2015/colorpicker/color-palette.component.js +28 -18
- package/dist/es2015/colorpicker/colorpicker.component.d.ts +129 -23
- package/dist/es2015/colorpicker/colorpicker.component.js +319 -125
- package/dist/es2015/colorpicker/constants.d.ts +12 -0
- package/dist/es2015/colorpicker/constants.js +12 -0
- package/dist/es2015/colorpicker/contrast-validation.component.d.ts +1 -1
- package/dist/es2015/colorpicker/contrast-validation.component.js +16 -12
- package/dist/es2015/colorpicker/contrast.component.d.ts +1 -3
- package/dist/es2015/colorpicker/contrast.component.js +17 -17
- package/dist/es2015/colorpicker/{models → events}/active-color-click-event.d.ts +0 -0
- package/dist/es2015/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/es2015/colorpicker/events/cancel-event.d.ts +15 -0
- package/dist/es2015/colorpicker/events/cancel-event.js +14 -0
- package/dist/es2015/colorpicker/events/close-event.d.ts +10 -0
- package/dist/es2015/colorpicker/events/close-event.js +10 -0
- package/dist/es2015/colorpicker/{models → events}/kendo-drag-event.d.ts +0 -0
- package/dist/es2015/colorpicker/events/kendo-drag-event.js +4 -0
- package/dist/es2015/colorpicker/events/open-event.d.ts +10 -0
- package/dist/es2015/colorpicker/events/open-event.js +10 -0
- package/dist/es2015/colorpicker/events.d.ts +8 -0
- package/dist/es2015/colorpicker/events.js +8 -0
- package/dist/es2015/colorpicker/flatcolorpicker-actions.component.d.ts +18 -0
- package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +60 -0
- package/dist/es2015/colorpicker/flatcolorpicker-header.component.d.ts +30 -0
- package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +131 -0
- package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +214 -0
- package/dist/es2015/colorpicker/flatcolorpicker.component.js +593 -0
- package/dist/es2015/colorpicker/localization/colorgradient-localization.service.d.ts +3 -3
- package/dist/es2015/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/es2015/colorpicker/localization/colorpalette-localization.service.d.ts +3 -3
- package/dist/es2015/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/es2015/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.d.ts +14 -0
- package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.js +31 -0
- package/dist/es2015/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/es2015/colorpicker/localization/messages.d.ts +36 -0
- package/dist/es2015/colorpicker/localization/messages.js +36 -0
- package/dist/es2015/colorpicker/models/actions-layout.d.ts +8 -0
- package/dist/es2015/colorpicker/models/actions-layout.js +4 -0
- package/dist/es2015/colorpicker/models/colorpicker-view.d.ts +8 -0
- package/dist/es2015/colorpicker/models/colorpicker-view.js +4 -0
- package/dist/es2015/colorpicker/models/gradient-settings.d.ts +4 -3
- package/dist/es2015/colorpicker/models/output-format.d.ts +0 -5
- package/dist/es2015/colorpicker/{utils → models}/palette-presets.d.ts +0 -0
- package/dist/es2015/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/es2015/colorpicker/models/palette-settings.d.ts +2 -3
- package/dist/es2015/colorpicker/models/tile-size.d.ts +1 -5
- package/dist/es2015/colorpicker/models.d.ts +10 -10
- package/dist/es2015/colorpicker/models.js +1 -2
- package/dist/es2015/colorpicker/services/flatcolorpicker.service.d.ts +12 -0
- package/dist/es2015/colorpicker/services/flatcolorpicker.service.js +38 -0
- package/dist/es2015/colorpicker/utils/color-parser.d.ts +8 -2
- package/dist/es2015/colorpicker/utils/color-parser.js +15 -5
- package/dist/es2015/colorpicker/utils/contrast-curve.d.ts +37 -0
- package/dist/es2015/colorpicker/utils/contrast-curve.js +85 -0
- package/dist/es2015/colorpicker/utils.d.ts +1 -1
- package/dist/es2015/colorpicker/utils.js +1 -1
- package/dist/es2015/colorpicker.module.js +9 -1
- package/dist/es2015/{colorpicker/models/color-picker-view.d.ts → common/models/fillmode.d.ts} +5 -5
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +23 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models.d.ts +8 -0
- package/dist/es2015/common/models.js +4 -0
- package/dist/es2015/common/utils.d.ts +7 -0
- package/dist/es2015/common/utils.js +37 -0
- package/dist/es2015/index.d.ts +5 -0
- package/dist/es2015/index.js +5 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +5 -2
- package/dist/es2015/main.js +4 -2
- package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +39 -1
- package/dist/es2015/maskedtextbox/maskedtextbox.component.js +88 -6
- package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +39 -2
- package/dist/es2015/numerictextbox/numerictextbox.component.js +124 -40
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/radiobutton/radiobutton.directive.d.ts +18 -0
- package/dist/es2015/radiobutton/radiobutton.directive.js +46 -11
- package/dist/es2015/shared/textarea.directive.d.ts +1 -1
- package/dist/es2015/shared/textarea.directive.js +3 -2
- package/dist/es2015/slider/slider.component.js +18 -23
- package/dist/es2015/switch/switch.component.d.ts +48 -5
- package/dist/es2015/switch/switch.component.js +166 -24
- package/dist/es2015/text-fields-common/text-fields-base.js +1 -1
- package/dist/es2015/textarea/textarea.component.d.ts +39 -1
- package/dist/es2015/textarea/textarea.component.js +89 -5
- package/dist/es2015/textbox/textbox.component.d.ts +40 -1
- package/dist/es2015/textbox/textbox.component.js +114 -30
- package/dist/es2015/textbox/textbox.directive.d.ts +1 -1
- package/dist/es2015/textbox/textbox.directive.js +3 -2
- package/dist/es2015/textbox.module.js +0 -3
- package/dist/fesm2015/index.js +3332 -1702
- package/dist/fesm5/index.js +3115 -1463
- package/dist/npm/checkbox/checkbox.directive.js +78 -2
- package/dist/npm/colorpicker/color-contrast-svg.component.js +97 -0
- package/dist/npm/colorpicker/color-gradient.component.js +109 -81
- package/dist/npm/colorpicker/color-input.component.js +38 -17
- package/dist/npm/colorpicker/color-palette.component.js +29 -19
- package/dist/npm/colorpicker/colorpicker.component.js +303 -86
- package/dist/npm/colorpicker/constants.js +12 -0
- package/dist/npm/colorpicker/contrast-validation.component.js +8 -6
- package/dist/npm/colorpicker/contrast.component.js +6 -8
- package/dist/npm/colorpicker/{models → events}/active-color-click-event.js +0 -0
- package/dist/npm/colorpicker/events/cancel-event.js +21 -0
- package/dist/npm/colorpicker/events/close-event.js +19 -0
- package/dist/npm/colorpicker/{models → events}/kendo-drag-event.js +0 -0
- package/dist/npm/colorpicker/events/open-event.js +19 -0
- package/dist/npm/colorpicker/events.js +11 -0
- package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +52 -0
- package/dist/npm/colorpicker/flatcolorpicker-header.component.js +96 -0
- package/dist/npm/colorpicker/flatcolorpicker.component.js +555 -0
- package/dist/npm/colorpicker/localization/colorgradient-localization.service.js +7 -7
- package/dist/npm/colorpicker/localization/colorpalette-localization.service.js +7 -7
- package/dist/npm/colorpicker/localization/custom-messages.component.js +1 -1
- package/dist/npm/colorpicker/localization/flatcolorpicker-localization.service.js +36 -0
- package/dist/npm/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
- package/dist/npm/colorpicker/localization/messages.js +36 -0
- package/dist/npm/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
- package/dist/npm/colorpicker/models/colorpicker-view.js +6 -0
- package/dist/npm/colorpicker/{utils → models}/palette-presets.js +0 -0
- package/dist/npm/colorpicker/models.js +1 -2
- package/dist/npm/colorpicker/services/flatcolorpicker.service.js +43 -0
- package/dist/npm/colorpicker/utils/color-parser.js +18 -5
- package/dist/npm/colorpicker/utils/contrast-curve.js +93 -0
- package/dist/npm/colorpicker/utils.js +1 -1
- package/dist/npm/colorpicker.module.js +9 -1
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/common/models.js +6 -0
- package/dist/npm/common/utils.js +37 -0
- package/dist/npm/index.js +10 -0
- package/dist/npm/main.js +7 -4
- package/dist/npm/maskedtextbox/maskedtextbox.component.js +100 -5
- package/dist/npm/numerictextbox/numerictextbox.component.js +115 -19
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/radiobutton.directive.js +51 -2
- package/dist/npm/shared/textarea.directive.js +3 -2
- package/dist/npm/slider/slider.component.js +1 -1
- package/dist/npm/switch/switch.component.js +166 -20
- package/dist/npm/text-fields-common/text-fields-base.js +1 -1
- package/dist/npm/textarea/textarea.component.js +100 -4
- package/dist/npm/textbox/textbox.component.js +107 -10
- package/dist/npm/textbox/textbox.directive.js +3 -2
- package/dist/npm/textbox.module.js +0 -3
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +12 -11
- package/dist/es/colorpicker/models/preventable-event.js +0 -29
- package/dist/es/textbox/floating-label-input-adapter.js +0 -58
- package/dist/es/textbox/textbox-container.component.js +0 -224
- package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
- package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
- package/dist/es2015/textbox/floating-label-input-adapter.d.ts +0 -20
- package/dist/es2015/textbox/floating-label-input-adapter.js +0 -52
- package/dist/es2015/textbox/textbox-container.component.d.ts +0 -59
- package/dist/es2015/textbox/textbox-container.component.js +0 -209
- package/dist/npm/colorpicker/models/preventable-event.js +0 -31
- package/dist/npm/textbox/floating-label-input-adapter.js +0 -60
- package/dist/npm/textbox/textbox-container.component.js +0 -226
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Inject, Optional } from '@angular/core';
|
|
7
7
|
import { LocalizationService, L10N_PREFIX, MessageService, RTL } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import {
|
|
8
|
+
import { FlatColorPickerLocalizationService } from './flatcolorpicker-localization.service';
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
let ColorPaletteLocalizationService = class ColorPaletteLocalizationService extends LocalizationService {
|
|
13
|
-
constructor(prefix, messageService, _rtl,
|
|
13
|
+
constructor(prefix, messageService, _rtl, flatColorPickerLocalization) {
|
|
14
14
|
super(prefix, messageService, _rtl);
|
|
15
|
-
this.
|
|
15
|
+
this.flatColorPickerLocalization = flatColorPickerLocalization;
|
|
16
16
|
}
|
|
17
17
|
get(shortKey) {
|
|
18
|
-
if (this.
|
|
19
|
-
return this.
|
|
18
|
+
if (this.flatColorPickerLocalization) {
|
|
19
|
+
return this.flatColorPickerLocalization.get(shortKey);
|
|
20
20
|
}
|
|
21
21
|
return super.get(shortKey);
|
|
22
22
|
}
|
|
@@ -25,7 +25,7 @@ ColorPaletteLocalizationService = tslib_1.__decorate([
|
|
|
25
25
|
tslib_1.__param(0, Inject(L10N_PREFIX)),
|
|
26
26
|
tslib_1.__param(1, Optional()),
|
|
27
27
|
tslib_1.__param(2, Optional()), tslib_1.__param(2, Inject(RTL)),
|
|
28
|
-
tslib_1.__param(3, Optional()), tslib_1.__param(3, Inject(
|
|
29
|
-
tslib_1.__metadata("design:paramtypes", [String, MessageService, Boolean,
|
|
28
|
+
tslib_1.__param(3, Optional()), tslib_1.__param(3, Inject(FlatColorPickerLocalizationService)),
|
|
29
|
+
tslib_1.__metadata("design:paramtypes", [String, MessageService, Boolean, FlatColorPickerLocalizationService])
|
|
30
30
|
], ColorPaletteLocalizationService);
|
|
31
31
|
export { ColorPaletteLocalizationService };
|
|
@@ -27,7 +27,7 @@ ColorPickerCustomMessagesComponent = ColorPickerCustomMessagesComponent_1 = tsli
|
|
|
27
27
|
useExisting: forwardRef(() => ColorPickerCustomMessagesComponent_1) // tslint:disable-line:no-forward-ref
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
|
-
selector: 'kendo-colorpicker-messages, kendo-colorgradient-messages, kendo-colorpalette-messages',
|
|
30
|
+
selector: 'kendo-colorpicker-messages, kendo-flatcolorpicker-messages, kendo-colorgradient-messages, kendo-colorpalette-messages',
|
|
31
31
|
template: ``
|
|
32
32
|
}),
|
|
33
33
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { LocalizationService, MessageService } from '@progress/kendo-angular-l10n';
|
|
6
|
+
import { ColorPickerLocalizationService } from './colorpicker-localization.service';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare class FlatColorPickerLocalizationService extends LocalizationService {
|
|
11
|
+
private colorPickerLocalization?;
|
|
12
|
+
constructor(prefix: string, messageService: MessageService, _rtl: boolean, colorPickerLocalization?: ColorPickerLocalizationService);
|
|
13
|
+
get(shortKey: string): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Inject, Optional } from '@angular/core';
|
|
7
|
+
import { LocalizationService, L10N_PREFIX, MessageService, RTL } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { ColorPickerLocalizationService } from './colorpicker-localization.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
let FlatColorPickerLocalizationService = class FlatColorPickerLocalizationService extends LocalizationService {
|
|
13
|
+
constructor(prefix, messageService, _rtl, colorPickerLocalization) {
|
|
14
|
+
super(prefix, messageService, _rtl);
|
|
15
|
+
this.colorPickerLocalization = colorPickerLocalization;
|
|
16
|
+
}
|
|
17
|
+
get(shortKey) {
|
|
18
|
+
if (this.colorPickerLocalization) {
|
|
19
|
+
return this.colorPickerLocalization.get(shortKey);
|
|
20
|
+
}
|
|
21
|
+
return super.get(shortKey);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
FlatColorPickerLocalizationService = tslib_1.__decorate([
|
|
25
|
+
tslib_1.__param(0, Inject(L10N_PREFIX)),
|
|
26
|
+
tslib_1.__param(1, Optional()),
|
|
27
|
+
tslib_1.__param(2, Optional()), tslib_1.__param(2, Inject(RTL)),
|
|
28
|
+
tslib_1.__param(3, Optional()), tslib_1.__param(3, Inject(ColorPickerLocalizationService)),
|
|
29
|
+
tslib_1.__metadata("design:paramtypes", [String, MessageService, Boolean, ColorPickerLocalizationService])
|
|
30
|
+
], FlatColorPickerLocalizationService);
|
|
31
|
+
export { FlatColorPickerLocalizationService };
|
|
@@ -24,7 +24,7 @@ LocalizedColorPickerMessagesDirective = LocalizedColorPickerMessagesDirective_1
|
|
|
24
24
|
useExisting: forwardRef(() => LocalizedColorPickerMessagesDirective_1) // tslint:disable-line:no-forward-ref
|
|
25
25
|
}
|
|
26
26
|
],
|
|
27
|
-
selector: '[kendoColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]'
|
|
27
|
+
selector: '[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]'
|
|
28
28
|
}),
|
|
29
29
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
30
30
|
], LocalizedColorPickerMessagesDirective);
|
|
@@ -15,6 +15,14 @@ export declare class ColorPickerMessages extends ComponentMessages {
|
|
|
15
15
|
* The aria-label applied to the ColorGradient component when the value is empty.
|
|
16
16
|
*/
|
|
17
17
|
colorGradientNoColor: string;
|
|
18
|
+
/**
|
|
19
|
+
* The aria-label applied to the FlatColorPicker component when the value is empty.
|
|
20
|
+
*/
|
|
21
|
+
flatColorPickerNoColor: string;
|
|
22
|
+
/**
|
|
23
|
+
* The aria-label applied to the ColorPicker component when the value is empty.
|
|
24
|
+
*/
|
|
25
|
+
colorPickerNoColor: string;
|
|
18
26
|
/**
|
|
19
27
|
* The title for the gradient color drag handle chooser.
|
|
20
28
|
*/
|
|
@@ -63,4 +71,32 @@ export declare class ColorPickerMessages extends ComponentMessages {
|
|
|
63
71
|
* The "Contrast ratio" message for the contrast tool.
|
|
64
72
|
*/
|
|
65
73
|
contrastRatio: string;
|
|
74
|
+
/**
|
|
75
|
+
* The message for the color preview pane.
|
|
76
|
+
*/
|
|
77
|
+
previewColor: string;
|
|
78
|
+
/**
|
|
79
|
+
* The message for the selected color pane.
|
|
80
|
+
*/
|
|
81
|
+
revertSelection: string;
|
|
82
|
+
/**
|
|
83
|
+
* The message for the gradient view button.
|
|
84
|
+
*/
|
|
85
|
+
gradientView: string;
|
|
86
|
+
/**
|
|
87
|
+
* The message for the palette view button.
|
|
88
|
+
*/
|
|
89
|
+
paletteView: string;
|
|
90
|
+
/**
|
|
91
|
+
* The message for the input format toggle button.
|
|
92
|
+
*/
|
|
93
|
+
formatButton: string;
|
|
94
|
+
/**
|
|
95
|
+
* The message for the Apply action button.
|
|
96
|
+
*/
|
|
97
|
+
applyButton: string;
|
|
98
|
+
/**
|
|
99
|
+
* The message for the Cancel action button.
|
|
100
|
+
*/
|
|
101
|
+
cancelButton: string;
|
|
66
102
|
}
|
|
@@ -18,6 +18,14 @@ tslib_1.__decorate([
|
|
|
18
18
|
Input(),
|
|
19
19
|
tslib_1.__metadata("design:type", String)
|
|
20
20
|
], ColorPickerMessages.prototype, "colorGradientNoColor", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
Input(),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], ColorPickerMessages.prototype, "flatColorPickerNoColor", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
Input(),
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
28
|
+
], ColorPickerMessages.prototype, "colorPickerNoColor", void 0);
|
|
21
29
|
tslib_1.__decorate([
|
|
22
30
|
Input(),
|
|
23
31
|
tslib_1.__metadata("design:type", String)
|
|
@@ -66,3 +74,31 @@ tslib_1.__decorate([
|
|
|
66
74
|
Input(),
|
|
67
75
|
tslib_1.__metadata("design:type", String)
|
|
68
76
|
], ColorPickerMessages.prototype, "contrastRatio", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
Input(),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], ColorPickerMessages.prototype, "previewColor", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
Input(),
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
84
|
+
], ColorPickerMessages.prototype, "revertSelection", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
Input(),
|
|
87
|
+
tslib_1.__metadata("design:type", String)
|
|
88
|
+
], ColorPickerMessages.prototype, "gradientView", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
Input(),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], ColorPickerMessages.prototype, "paletteView", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
Input(),
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
96
|
+
], ColorPickerMessages.prototype, "formatButton", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
Input(),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], ColorPickerMessages.prototype, "applyButton", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
Input(),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], ColorPickerMessages.prototype, "cancelButton", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* The possible layouts of the ColorPicker and FlatColorPicker action buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare type ColorPickerActionsLayout = 'start' | 'center' | 'end' | 'stretch';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* The possible popup views of the ColorPicker and FlatColorPicker components.
|
|
7
|
+
*/
|
|
8
|
+
export declare type ColorPickerView = 'gradient' | 'palette';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -11,10 +11,11 @@ export interface GradientSettings {
|
|
|
11
11
|
*/
|
|
12
12
|
opacity?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Enables the color contrast tool.
|
|
15
|
+
* Accepts the background color that will be compared to the selected value.
|
|
16
|
+
* The tool will calculate the contrast ratio between two colors.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
contrastTool?: string;
|
|
18
19
|
/**
|
|
19
20
|
* Determines the delay time (in milliseconds) before the ColorGradient value is changed on handle drag. A value of 0 indicates no delay.
|
|
20
21
|
*/
|
|
@@ -4,10 +4,5 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
6
|
* Specifies the output format of the ColorPicker.
|
|
7
|
-
*
|
|
8
|
-
* The possible values are:
|
|
9
|
-
* * `hex`
|
|
10
|
-
* * `rgba`
|
|
11
|
-
* * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
|
|
12
7
|
*/
|
|
13
8
|
export declare type OutputFormat = 'hex' | 'rgba' | 'name';
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { TileSize } from '
|
|
5
|
+
import { TileSize } from '../models';
|
|
6
6
|
/**
|
|
7
7
|
* Configures the color palette that opens in the popup.
|
|
8
8
|
*/
|
|
@@ -20,14 +20,13 @@ export interface PaletteSettings {
|
|
|
20
20
|
palette?: string | Array<string>;
|
|
21
21
|
/**
|
|
22
22
|
* Specifies the number of columns that will be displayed.
|
|
23
|
-
* Defaults to `10`.
|
|
24
23
|
*/
|
|
25
24
|
columns?: number;
|
|
26
25
|
/**
|
|
27
26
|
* Specifies the size of a color cell.
|
|
28
27
|
*
|
|
29
28
|
* The possible values are:
|
|
30
|
-
* *
|
|
29
|
+
* * `number`
|
|
31
30
|
* * `{ width: number, height: number }`
|
|
32
31
|
*/
|
|
33
32
|
tileSize?: number | TileSize;
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Specifies the size of a color cell.
|
|
7
|
-
*
|
|
8
|
-
* The possible values are:
|
|
9
|
-
* * (Default) `number = 24`
|
|
10
|
-
* * `{ width: number, height: number }`
|
|
6
|
+
* Specifies the size of a color cell in the ColorPalette component.
|
|
11
7
|
*/
|
|
12
8
|
export declare type TileSize = {
|
|
13
9
|
width: number;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export * from './models/
|
|
6
|
-
export * from './models/
|
|
7
|
-
export * from './models/
|
|
8
|
-
export * from './models/palette-settings';
|
|
9
|
-
export * from './models/output-format';
|
|
10
|
-
export * from './models/table-cell';
|
|
11
|
-
export * from './models/active-color-click-event';
|
|
12
|
-
export * from './models/kendo-drag-event';
|
|
5
|
+
export * from './models/actions-layout';
|
|
6
|
+
export * from './models/colorpicker-view';
|
|
7
|
+
export * from './models/gradient-settings';
|
|
13
8
|
export * from './models/hsva';
|
|
9
|
+
export * from './models/output-format';
|
|
10
|
+
export * from './models/palette-presets';
|
|
11
|
+
export * from './models/palette-settings';
|
|
12
|
+
export * from './models/popup-settings';
|
|
13
|
+
export * from './models/rgb';
|
|
14
14
|
export * from './models/rgba';
|
|
15
|
-
export * from './models/
|
|
16
|
-
export * from './models/
|
|
15
|
+
export * from './models/table-cell';
|
|
16
|
+
export * from './models/tile-size';
|
|
@@ -2,5 +2,4 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export * from './models/
|
|
6
|
-
export * from './models/active-color-click-event';
|
|
5
|
+
export * from './models/palette-presets';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { TileSize, PaletteSettings } from "../models";
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export declare class FlatColorPickerService {
|
|
10
|
+
getPaletteSettings(settings: PaletteSettings, format: string): PaletteSettings;
|
|
11
|
+
paletteTileLayout(tileSize: number | TileSize): TileSize;
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Injectable } from "@angular/core";
|
|
7
|
+
import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from "../constants";
|
|
8
|
+
import { PALETTEPRESETS } from "../models";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
let FlatColorPickerService = class FlatColorPickerService {
|
|
13
|
+
getPaletteSettings(settings, format) {
|
|
14
|
+
const defaultPreset = (format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
|
|
15
|
+
const settingsPalette = settings.palette;
|
|
16
|
+
const presetColumns = typeof settingsPalette === 'string' && PALETTEPRESETS[settingsPalette] ?
|
|
17
|
+
PALETTEPRESETS[settingsPalette].columns :
|
|
18
|
+
undefined;
|
|
19
|
+
return {
|
|
20
|
+
palette: settingsPalette || defaultPreset,
|
|
21
|
+
tileSize: settings.tileSize || 24,
|
|
22
|
+
columns: settings.columns || presetColumns || 10
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
paletteTileLayout(tileSize) {
|
|
26
|
+
if (typeof tileSize === 'number') {
|
|
27
|
+
return { width: tileSize, height: tileSize };
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
width: tileSize.width ? tileSize.width : tileSize.height,
|
|
31
|
+
height: tileSize.height ? tileSize.height : tileSize.width
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
FlatColorPickerService = tslib_1.__decorate([
|
|
36
|
+
Injectable()
|
|
37
|
+
], FlatColorPickerService);
|
|
38
|
+
export { FlatColorPickerService };
|
|
@@ -9,7 +9,7 @@ import { RGB } from '../models/rgb';
|
|
|
9
9
|
*
|
|
10
10
|
* Returns the hex or rgba string representation of the color.
|
|
11
11
|
*/
|
|
12
|
-
export declare const parseColor: (value: string, format: OutputFormat, safe?: boolean) => string;
|
|
12
|
+
export declare const parseColor: (value: string, format: OutputFormat, opacityEnabled?: boolean, safe?: boolean) => string;
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*
|
|
@@ -27,7 +27,13 @@ export declare const getRGBA: (value: string, safe?: boolean) => RGBA;
|
|
|
27
27
|
*
|
|
28
28
|
* Returns the RGBA string representation of the color.
|
|
29
29
|
*/
|
|
30
|
-
export declare const getColorFromHSV: (hsva: HSVA) => string;
|
|
30
|
+
export declare const getColorFromHSV: (hsva: HSVA, format?: OutputFormat, opacityEnabled?: boolean) => string;
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*
|
|
34
|
+
* Returns the HEX value.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getHexValue: (color: any, opacity: boolean) => string;
|
|
31
37
|
/**
|
|
32
38
|
* @hidden
|
|
33
39
|
*
|
|
@@ -9,7 +9,7 @@ import { isPresent, fitIntoBounds } from '../../common/utils';
|
|
|
9
9
|
*
|
|
10
10
|
* Returns the hex or rgba string representation of the color.
|
|
11
11
|
*/
|
|
12
|
-
export const parseColor = (value, format, safe = true) => {
|
|
12
|
+
export const parseColor = (value, format, opacityEnabled = false, safe = true) => {
|
|
13
13
|
const allowedFormats = ['hex', 'rgba', 'name'];
|
|
14
14
|
if (allowedFormats.indexOf(format) === -1) {
|
|
15
15
|
throw new Error(`Unsupported color output format '${format}'. The available options are 'hex', 'rgba' or 'name'.`);
|
|
@@ -24,7 +24,8 @@ export const parseColor = (value, format, safe = true) => {
|
|
|
24
24
|
if (!isPresent(parsedColor)) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const parsedColorResult = format === 'hex' ? getHexValue(parsedColor, opacityEnabled) : parsedColor.toCssRgba();
|
|
28
|
+
return parsedColorResult;
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* @hidden
|
|
@@ -55,12 +56,21 @@ export const getRGBA = (value, safe = true) => {
|
|
|
55
56
|
*
|
|
56
57
|
* Returns the RGBA string representation of the color.
|
|
57
58
|
*/
|
|
58
|
-
export const getColorFromHSV = (hsva) => {
|
|
59
|
+
export const getColorFromHSV = (hsva, format = 'rgba', opacityEnabled = false) => {
|
|
59
60
|
const hue = fitIntoBounds(hsva.h, 0, 359.9);
|
|
60
61
|
const saturation = fitIntoBounds(hsva.s, 0, 1);
|
|
61
62
|
const value = fitIntoBounds(hsva.v, 0, 1);
|
|
62
63
|
const alpha = fitIntoBounds(hsva.a, 0, 1);
|
|
63
|
-
|
|
64
|
+
const color = Color.fromHSV(hue, saturation, value, alpha);
|
|
65
|
+
return format === 'hex' ? getHexValue(color, opacityEnabled) : color.toCssRgba();
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*
|
|
70
|
+
* Returns the HEX value.
|
|
71
|
+
*/
|
|
72
|
+
export const getHexValue = (color, opacity) => {
|
|
73
|
+
return opacity && color.a < 1 ? color.toCss({ alpha: true }) : color.toCss();
|
|
64
74
|
};
|
|
65
75
|
/**
|
|
66
76
|
* @hidden
|
|
@@ -96,7 +106,7 @@ export function nameFormat(value, safe) {
|
|
|
96
106
|
}
|
|
97
107
|
const key = Object.keys(colors).find(key => colors[key] === value);
|
|
98
108
|
if (!key && !safe) {
|
|
99
|
-
throw new Error(`The provided color ${value} is not supported for 'format="name"' property.To display ${value} color, the component 'format' property
|
|
109
|
+
throw new Error(`The provided color ${value} is not supported for 'format="name"' property.To display ${value} color, the component 'format' property should be set to 'hex' or 'rgba' `);
|
|
100
110
|
}
|
|
101
111
|
return key;
|
|
102
112
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const bezierCommand: (controlPointCalc: Function) => (point: number[], i: number, a: number[]) => string;
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const controlPoint: (lineCalc: Function) => (current: number[], previous: number[], next: number[], reverse?: boolean) => number[];
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const line: (pointA: number[], pointB: number[]) => {
|
|
17
|
+
length: number;
|
|
18
|
+
angle: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export declare const d: (points: number[][], command: Function) => string;
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*
|
|
27
|
+
* Render the svg <path> element.
|
|
28
|
+
*
|
|
29
|
+
* @param points (array) Represents the points coordinates as an array of tuples.
|
|
30
|
+
* @param command (function) The command that is used (bezierCommand, lineCommand).
|
|
31
|
+
* @param point (array) [x,y] Represents the current point coordinates.
|
|
32
|
+
* @param i (integer) Represents the index of 'point' in the array 'a'.
|
|
33
|
+
* @param a (array) Represents the complete array of points coordinates.
|
|
34
|
+
* @output (string) a svg path command.
|
|
35
|
+
* @output (string) a Svg <path> element
|
|
36
|
+
*/
|
|
37
|
+
export declare const svgPath: (points: number[][], command: Function) => string;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export const bezierCommand = (controlPointCalc) => (point, i, a) => {
|
|
9
|
+
// start control point
|
|
10
|
+
const [cpsX, cpsY] = controlPointCalc(a[i - 1], a[i - 2], point);
|
|
11
|
+
// end control point
|
|
12
|
+
const [cpeX, cpeY] = controlPointCalc(point, a[i - 1], a[i + 1], true);
|
|
13
|
+
return `C ${cpsX},${cpsY} ${cpeX},${cpeY} ${point[0]},${point[1]}`;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export const controlPoint = (lineCalc) => (current, previous, next, reverse) => {
|
|
19
|
+
// when 'current' is the first or last point of the array
|
|
20
|
+
// 'previous' and 'next' are undefined
|
|
21
|
+
// replace with 'current'
|
|
22
|
+
const p = previous || current;
|
|
23
|
+
const n = next || current;
|
|
24
|
+
const smooth = 0.1;
|
|
25
|
+
// properties of the line between previous and next
|
|
26
|
+
const l = lineCalc(p, n);
|
|
27
|
+
// If is end-control-point, add PI to the angle to go backward
|
|
28
|
+
const angle = l.angle + (reverse ? Math.PI : 0);
|
|
29
|
+
const length = l.length * smooth;
|
|
30
|
+
// The control point position is relative to the current point
|
|
31
|
+
const x = current[0] + Math.cos(angle) * length;
|
|
32
|
+
const y = current[1] + Math.sin(angle) * length;
|
|
33
|
+
return [x, y];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
export const line = (pointA, pointB) => {
|
|
39
|
+
const lengthX = pointB[0] - pointA[0];
|
|
40
|
+
const lengthY = pointB[1] - pointA[1];
|
|
41
|
+
return {
|
|
42
|
+
length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
|
|
43
|
+
angle: Math.atan2(lengthY, lengthX)
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
export const d = (points, command) => {
|
|
50
|
+
if (points.length === 0) {
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
// build the d attributes by looping over the points
|
|
54
|
+
const d = points.reduce((acc, point, i, a) => i === 0 ?
|
|
55
|
+
// if first point
|
|
56
|
+
`M ${point[0]},${point[1]}` :
|
|
57
|
+
// else
|
|
58
|
+
`${acc} ${command(point, i, a)}`, '');
|
|
59
|
+
return d;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*
|
|
64
|
+
* Render the svg <path> element.
|
|
65
|
+
*
|
|
66
|
+
* @param points (array) Represents the points coordinates as an array of tuples.
|
|
67
|
+
* @param command (function) The command that is used (bezierCommand, lineCommand).
|
|
68
|
+
* @param point (array) [x,y] Represents the current point coordinates.
|
|
69
|
+
* @param i (integer) Represents the index of 'point' in the array 'a'.
|
|
70
|
+
* @param a (array) Represents the complete array of points coordinates.
|
|
71
|
+
* @output (string) a svg path command.
|
|
72
|
+
* @output (string) a Svg <path> element
|
|
73
|
+
*/
|
|
74
|
+
export const svgPath = (points, command) => {
|
|
75
|
+
if (points.length === 0) {
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
// build the d attributes by looping over the points
|
|
79
|
+
const d = points.reduce((acc, point, i, a) => i === 0 ?
|
|
80
|
+
// if first point
|
|
81
|
+
`M ${point[0]},${point[1]}` :
|
|
82
|
+
// else
|
|
83
|
+
`${acc} ${command(point, i, a)}`, '');
|
|
84
|
+
return d;
|
|
85
|
+
};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export * from './utils/palette-presets';
|
|
6
5
|
export * from './utils/color-parser';
|
|
6
|
+
export * from './utils/contrast-curve';
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export * from './utils/palette-presets';
|
|
6
5
|
export * from './utils/color-parser';
|
|
6
|
+
export * from './utils/contrast-curve';
|
|
@@ -13,15 +13,20 @@ import { ColorPickerComponent } from './colorpicker/colorpicker.component';
|
|
|
13
13
|
import { ColorPaletteComponent } from './colorpicker/color-palette.component';
|
|
14
14
|
import { ColorGradientComponent } from './colorpicker/color-gradient.component';
|
|
15
15
|
import { ColorInputComponent } from './colorpicker/color-input.component';
|
|
16
|
+
import { FlatColorPickerHeaderComponent } from './colorpicker/flatcolorpicker-header.component';
|
|
17
|
+
import { FlatColorPickerActionButtonsComponent } from './colorpicker/flatcolorpicker-actions.component';
|
|
18
|
+
import { FlatColorPickerComponent } from './colorpicker/flatcolorpicker.component';
|
|
16
19
|
import { ColorPickerCustomMessagesComponent } from './colorpicker/localization/custom-messages.component';
|
|
17
20
|
import { LocalizedColorPickerMessagesDirective } from './colorpicker/localization/localized-colorpicker-messages.directive';
|
|
18
21
|
import { FocusOnDomReadyDirective } from './colorpicker/focus-on-dom-ready.directive';
|
|
19
22
|
import { ContrastValidationComponent } from './colorpicker/contrast-validation.component';
|
|
20
23
|
import { ContrastComponent } from './colorpicker/contrast.component';
|
|
24
|
+
import { ColorContrastSvgComponent } from './colorpicker/color-contrast-svg.component';
|
|
21
25
|
const PUBLIC_DIRECTIVES = [
|
|
22
26
|
ColorPickerComponent,
|
|
23
27
|
ColorPaletteComponent,
|
|
24
28
|
ColorGradientComponent,
|
|
29
|
+
FlatColorPickerComponent,
|
|
25
30
|
LocalizedColorPickerMessagesDirective,
|
|
26
31
|
ColorPickerCustomMessagesComponent
|
|
27
32
|
];
|
|
@@ -29,7 +34,10 @@ const INTERNAL_DIRECTIVES = [
|
|
|
29
34
|
ColorInputComponent,
|
|
30
35
|
FocusOnDomReadyDirective,
|
|
31
36
|
ContrastComponent,
|
|
32
|
-
ContrastValidationComponent
|
|
37
|
+
ContrastValidationComponent,
|
|
38
|
+
FlatColorPickerHeaderComponent,
|
|
39
|
+
FlatColorPickerActionButtonsComponent,
|
|
40
|
+
ColorContrastSvgComponent
|
|
33
41
|
];
|
|
34
42
|
/**
|
|
35
43
|
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|