@progress/kendo-angular-inputs 7.5.2 → 8.0.0-dev.202112161434

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.
Files changed (151) hide show
  1. package/dist/cdn/js/kendo-angular-inputs.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/colorpicker/color-contrast-svg.component.js +95 -0
  4. package/dist/es/colorpicker/color-gradient.component.js +109 -81
  5. package/dist/es/colorpicker/color-input.component.js +39 -18
  6. package/dist/es/colorpicker/color-palette.component.js +28 -18
  7. package/dist/es/colorpicker/colorpicker.component.js +170 -76
  8. package/dist/es/colorpicker/constants.js +12 -0
  9. package/dist/es/colorpicker/contrast-validation.component.js +8 -6
  10. package/dist/es/colorpicker/contrast.component.js +6 -8
  11. package/dist/es/colorpicker/{models → events}/active-color-click-event.js +0 -0
  12. package/dist/es/colorpicker/events/cancel-event.js +19 -0
  13. package/dist/es/colorpicker/events/close-event.js +17 -0
  14. package/dist/es/colorpicker/{models → events}/kendo-drag-event.js +0 -0
  15. package/dist/es/colorpicker/events/open-event.js +17 -0
  16. package/dist/es/colorpicker/events.js +8 -0
  17. package/dist/es/colorpicker/flatcolorpicker-actions.component.js +50 -0
  18. package/dist/es/colorpicker/flatcolorpicker-header.component.js +94 -0
  19. package/dist/es/colorpicker/flatcolorpicker.component.js +553 -0
  20. package/dist/es/colorpicker/localization/colorgradient-localization.service.js +7 -7
  21. package/dist/es/colorpicker/localization/colorpalette-localization.service.js +7 -7
  22. package/dist/es/colorpicker/localization/custom-messages.component.js +1 -1
  23. package/dist/es/colorpicker/localization/flatcolorpicker-localization.service.js +34 -0
  24. package/dist/es/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  25. package/dist/es/colorpicker/localization/messages.js +36 -0
  26. package/dist/es/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
  27. package/dist/{es2015/colorpicker/models/color-picker-view.js → es/colorpicker/models/colorpicker-view.js} +0 -0
  28. package/dist/es/colorpicker/{utils → models}/palette-presets.js +0 -0
  29. package/dist/es/colorpicker/models.js +1 -2
  30. package/dist/es/colorpicker/services/flatcolorpicker.service.js +41 -0
  31. package/dist/es/colorpicker/utils/color-parser.js +18 -5
  32. package/dist/es/colorpicker/utils/contrast-curve.js +91 -0
  33. package/dist/es/colorpicker/utils.js +1 -1
  34. package/dist/es/colorpicker.module.js +9 -1
  35. package/dist/es/index.js +5 -0
  36. package/dist/es/main.js +4 -1
  37. package/dist/es/package-metadata.js +1 -1
  38. package/dist/es2015/colorpicker/color-contrast-svg.component.d.ts +26 -0
  39. package/dist/es2015/colorpicker/color-contrast-svg.component.js +97 -0
  40. package/dist/es2015/colorpicker/color-gradient.component.d.ts +32 -43
  41. package/dist/es2015/colorpicker/color-gradient.component.js +125 -92
  42. package/dist/es2015/colorpicker/color-input.component.d.ts +11 -4
  43. package/dist/es2015/colorpicker/color-input.component.js +52 -32
  44. package/dist/es2015/colorpicker/color-palette.component.d.ts +8 -3
  45. package/dist/es2015/colorpicker/color-palette.component.js +28 -18
  46. package/dist/es2015/colorpicker/colorpicker.component.d.ts +84 -24
  47. package/dist/es2015/colorpicker/colorpicker.component.js +195 -112
  48. package/dist/es2015/colorpicker/constants.d.ts +12 -0
  49. package/dist/es2015/colorpicker/constants.js +12 -0
  50. package/dist/es2015/colorpicker/contrast-validation.component.d.ts +1 -1
  51. package/dist/es2015/colorpicker/contrast-validation.component.js +16 -12
  52. package/dist/es2015/colorpicker/contrast.component.d.ts +1 -3
  53. package/dist/es2015/colorpicker/contrast.component.js +17 -17
  54. package/dist/es2015/colorpicker/{models → events}/active-color-click-event.d.ts +0 -0
  55. package/dist/es2015/colorpicker/{models → events}/active-color-click-event.js +0 -0
  56. package/dist/es2015/colorpicker/events/cancel-event.d.ts +15 -0
  57. package/dist/es2015/colorpicker/events/cancel-event.js +14 -0
  58. package/dist/es2015/colorpicker/events/close-event.d.ts +10 -0
  59. package/dist/es2015/colorpicker/events/close-event.js +10 -0
  60. package/dist/es2015/colorpicker/{models → events}/kendo-drag-event.d.ts +0 -0
  61. package/dist/es2015/colorpicker/{models → events}/kendo-drag-event.js +0 -0
  62. package/dist/es2015/colorpicker/events/open-event.d.ts +10 -0
  63. package/dist/es2015/colorpicker/events/open-event.js +10 -0
  64. package/dist/es2015/colorpicker/events.d.ts +8 -0
  65. package/dist/es2015/colorpicker/events.js +8 -0
  66. package/dist/es2015/colorpicker/flatcolorpicker-actions.component.d.ts +18 -0
  67. package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +60 -0
  68. package/dist/es2015/colorpicker/flatcolorpicker-header.component.d.ts +30 -0
  69. package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +131 -0
  70. package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +214 -0
  71. package/dist/es2015/colorpicker/flatcolorpicker.component.js +593 -0
  72. package/dist/es2015/colorpicker/localization/colorgradient-localization.service.d.ts +3 -3
  73. package/dist/es2015/colorpicker/localization/colorgradient-localization.service.js +7 -7
  74. package/dist/es2015/colorpicker/localization/colorpalette-localization.service.d.ts +3 -3
  75. package/dist/es2015/colorpicker/localization/colorpalette-localization.service.js +7 -7
  76. package/dist/es2015/colorpicker/localization/custom-messages.component.js +1 -1
  77. package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.d.ts +14 -0
  78. package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.js +31 -0
  79. package/dist/es2015/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  80. package/dist/es2015/colorpicker/localization/messages.d.ts +36 -0
  81. package/dist/es2015/colorpicker/localization/messages.js +36 -0
  82. package/dist/es2015/colorpicker/models/actions-layout.d.ts +8 -0
  83. package/dist/es2015/colorpicker/models/actions-layout.js +4 -0
  84. package/dist/es2015/colorpicker/models/colorpicker-view.d.ts +8 -0
  85. package/dist/es2015/colorpicker/models/colorpicker-view.js +4 -0
  86. package/dist/es2015/colorpicker/models/gradient-settings.d.ts +4 -3
  87. package/dist/es2015/colorpicker/models/output-format.d.ts +0 -5
  88. package/dist/es2015/colorpicker/{utils → models}/palette-presets.d.ts +0 -0
  89. package/dist/es2015/colorpicker/{utils → models}/palette-presets.js +0 -0
  90. package/dist/es2015/colorpicker/models/palette-settings.d.ts +2 -3
  91. package/dist/es2015/colorpicker/models/tile-size.d.ts +1 -5
  92. package/dist/es2015/colorpicker/models.d.ts +10 -10
  93. package/dist/es2015/colorpicker/models.js +1 -2
  94. package/dist/es2015/colorpicker/{models/color-picker-view.d.ts → services/flatcolorpicker.service.d.ts} +6 -7
  95. package/dist/es2015/colorpicker/services/flatcolorpicker.service.js +38 -0
  96. package/dist/es2015/colorpicker/utils/color-parser.d.ts +8 -2
  97. package/dist/es2015/colorpicker/utils/color-parser.js +15 -5
  98. package/dist/es2015/colorpicker/utils/contrast-curve.d.ts +37 -0
  99. package/dist/es2015/colorpicker/utils/contrast-curve.js +85 -0
  100. package/dist/es2015/colorpicker/utils.d.ts +1 -1
  101. package/dist/es2015/colorpicker/utils.js +1 -1
  102. package/dist/es2015/colorpicker.module.js +9 -1
  103. package/dist/es2015/index.d.ts +5 -0
  104. package/dist/es2015/index.js +5 -0
  105. package/dist/es2015/index.metadata.json +1 -1
  106. package/dist/es2015/main.d.ts +4 -1
  107. package/dist/es2015/main.js +4 -1
  108. package/dist/es2015/package-metadata.js +1 -1
  109. package/dist/fesm2015/index.js +2207 -1043
  110. package/dist/fesm5/index.js +2010 -907
  111. package/dist/npm/colorpicker/color-contrast-svg.component.js +97 -0
  112. package/dist/npm/colorpicker/color-gradient.component.js +109 -81
  113. package/dist/npm/colorpicker/color-input.component.js +38 -17
  114. package/dist/npm/colorpicker/color-palette.component.js +29 -19
  115. package/dist/npm/colorpicker/colorpicker.component.js +177 -83
  116. package/dist/npm/colorpicker/constants.js +12 -0
  117. package/dist/npm/colorpicker/contrast-validation.component.js +8 -6
  118. package/dist/npm/colorpicker/contrast.component.js +6 -8
  119. package/dist/npm/colorpicker/{models → events}/active-color-click-event.js +0 -0
  120. package/dist/npm/colorpicker/events/cancel-event.js +21 -0
  121. package/dist/npm/colorpicker/events/close-event.js +19 -0
  122. package/dist/npm/colorpicker/{models → events}/kendo-drag-event.js +0 -0
  123. package/dist/npm/colorpicker/events/open-event.js +19 -0
  124. package/dist/npm/colorpicker/events.js +11 -0
  125. package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +52 -0
  126. package/dist/npm/colorpicker/flatcolorpicker-header.component.js +96 -0
  127. package/dist/npm/colorpicker/flatcolorpicker.component.js +555 -0
  128. package/dist/npm/colorpicker/localization/colorgradient-localization.service.js +7 -7
  129. package/dist/npm/colorpicker/localization/colorpalette-localization.service.js +7 -7
  130. package/dist/npm/colorpicker/localization/custom-messages.component.js +1 -1
  131. package/dist/npm/colorpicker/localization/flatcolorpicker-localization.service.js +36 -0
  132. package/dist/npm/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  133. package/dist/npm/colorpicker/localization/messages.js +36 -0
  134. package/dist/npm/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
  135. package/dist/npm/colorpicker/models/colorpicker-view.js +6 -0
  136. package/dist/npm/colorpicker/{utils → models}/palette-presets.js +0 -0
  137. package/dist/npm/colorpicker/models.js +1 -2
  138. package/dist/npm/colorpicker/services/flatcolorpicker.service.js +43 -0
  139. package/dist/npm/colorpicker/utils/color-parser.js +18 -5
  140. package/dist/npm/colorpicker/utils/contrast-curve.js +93 -0
  141. package/dist/npm/colorpicker/utils.js +1 -1
  142. package/dist/npm/colorpicker.module.js +9 -1
  143. package/dist/npm/index.js +10 -0
  144. package/dist/npm/main.js +7 -2
  145. package/dist/npm/package-metadata.js +1 -1
  146. package/dist/systemjs/kendo-angular-inputs.js +1 -1
  147. package/package.json +3 -2
  148. package/dist/es/colorpicker/models/preventable-event.js +0 -29
  149. package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
  150. package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
  151. package/dist/npm/colorpicker/models/preventable-event.js +0 -31
@@ -5,10 +5,10 @@
5
5
  import { __extends, __decorate, __param, __metadata, __assign } from 'tslib';
6
6
  import { isDevMode, Directive, Optional, TemplateRef, Input, Output, EventEmitter, HostBinding, ViewChild, ElementRef, ContentChild, Component, forwardRef, Injector, Renderer2, NgZone, ChangeDetectorRef, Inject, Injectable, HostListener, ViewChildren, QueryList, NgModule, ViewContainerRef, ContentChildren } from '@angular/core';
7
7
  import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, RadioControlValueAccessor } from '@angular/forms';
8
- import { Subscription, fromEvent, interval, merge, Observable, Subject } from 'rxjs';
8
+ import { Subscription, fromEvent, interval, merge, Observable, BehaviorSubject, Subject } from 'rxjs';
9
9
  import { take, filter, concatMap, startWith, takeUntil, skip, debounceTime, throttleTime } from 'rxjs/operators';
10
10
  import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages, MessageService } from '@progress/kendo-angular-l10n';
11
- import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, isChanged, DraggableModule, EventsModule, ResizeSensorModule } from '@progress/kendo-angular-common';
11
+ import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, isChanged, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent } from '@progress/kendo-angular-common';
12
12
  import { validatePackage } from '@progress/kendo-licensing';
13
13
  import { browser, mobileOS, detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
14
14
  import { IntlService } from '@progress/kendo-angular-intl';
@@ -493,7 +493,7 @@ var packageMetadata = {
493
493
  name: '@progress/kendo-angular-inputs',
494
494
  productName: 'Kendo UI for Angular',
495
495
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
496
- publishDate: 1637576485,
496
+ publishDate: 1639665048,
497
497
  version: '',
498
498
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
499
499
  };
@@ -7354,28 +7354,206 @@ var TextAreaModule = /** @class */ (function () {
7354
7354
  /**
7355
7355
  * @hidden
7356
7356
  */
7357
- var PreventableEvent = /** @class */ (function () {
7358
- function PreventableEvent() {
7359
- this.prevented = false;
7357
+ var ColorPickerLocalizationService = /** @class */ (function (_super) {
7358
+ __extends(ColorPickerLocalizationService, _super);
7359
+ function ColorPickerLocalizationService(prefix, messageService, _rtl) {
7360
+ return _super.call(this, prefix, messageService, _rtl) || this;
7360
7361
  }
7361
- /**
7362
- * Prevents the default action for a specified event.
7363
- * In this way, the source component suppresses the built-in behavior that follows the event.
7364
- */
7365
- PreventableEvent.prototype.preventDefault = function () {
7366
- this.prevented = true;
7362
+ ColorPickerLocalizationService = __decorate([
7363
+ __param(0, Inject(L10N_PREFIX)),
7364
+ __param(1, Optional()),
7365
+ __param(2, Optional()), __param(2, Inject(RTL)),
7366
+ __metadata("design:paramtypes", [String, MessageService, Boolean])
7367
+ ], ColorPickerLocalizationService);
7368
+ return ColorPickerLocalizationService;
7369
+ }(LocalizationService));
7370
+
7371
+ /**
7372
+ * @hidden
7373
+ */
7374
+ var FlatColorPickerLocalizationService = /** @class */ (function (_super) {
7375
+ __extends(FlatColorPickerLocalizationService, _super);
7376
+ function FlatColorPickerLocalizationService(prefix, messageService, _rtl, colorPickerLocalization) {
7377
+ var _this = _super.call(this, prefix, messageService, _rtl) || this;
7378
+ _this.colorPickerLocalization = colorPickerLocalization;
7379
+ return _this;
7380
+ }
7381
+ FlatColorPickerLocalizationService.prototype.get = function (shortKey) {
7382
+ if (this.colorPickerLocalization) {
7383
+ return this.colorPickerLocalization.get(shortKey);
7384
+ }
7385
+ return _super.prototype.get.call(this, shortKey);
7367
7386
  };
7368
- /**
7369
- * If the event is prevented by any of its subscribers, returns `true`.
7370
- *
7371
- * @returns - `true` if the default action was prevented. Otherwise, returns `false`.
7372
- */
7373
- PreventableEvent.prototype.isDefaultPrevented = function () {
7374
- return this.prevented;
7387
+ FlatColorPickerLocalizationService = __decorate([
7388
+ __param(0, Inject(L10N_PREFIX)),
7389
+ __param(1, Optional()),
7390
+ __param(2, Optional()), __param(2, Inject(RTL)),
7391
+ __param(3, Optional()), __param(3, Inject(ColorPickerLocalizationService)),
7392
+ __metadata("design:paramtypes", [String, MessageService, Boolean, ColorPickerLocalizationService])
7393
+ ], FlatColorPickerLocalizationService);
7394
+ return FlatColorPickerLocalizationService;
7395
+ }(LocalizationService));
7396
+
7397
+ /**
7398
+ * @hidden
7399
+ */
7400
+ var DEFAULT_OUTPUT_FORMAT = 'rgba';
7401
+ /**
7402
+ * @hidden
7403
+ */
7404
+ var DEFAULT_GRADIENT_BACKGROUND_COLOR = 'rgba(255, 0, 0, 1)';
7405
+ /**
7406
+ * @hidden
7407
+ */
7408
+ var DRAGHANDLE_MOVE_SPEED = 5;
7409
+ /**
7410
+ * @hidden
7411
+ */
7412
+ var AAA_RATIO = 7.0;
7413
+ /**
7414
+ * @hidden
7415
+ */
7416
+ var AA_RATIO = 4.5;
7417
+ /**
7418
+ * @hidden
7419
+ */
7420
+ var DEFAULT_PRESET = 'office';
7421
+ /**
7422
+ * @hidden
7423
+ */
7424
+ var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
7425
+ /**
7426
+ * @hidden
7427
+ */
7428
+ var STEP_COUNT = 16;
7429
+
7430
+ // tslint:disable:max-line-length
7431
+ /**
7432
+ * @hidden
7433
+ */
7434
+ var PALETTEPRESETS = {
7435
+ basic: {
7436
+ colors: '000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7',
7437
+ columns: 10
7438
+ },
7439
+ office: {
7440
+ colors: 'ffffff, 000000, e6e6e6, 435569, 4371c4, ed7e32, a5a4a5, febf04, 5a9bd5, 71ae48, f2f2f3, 7f7f7f, d1cece, d5dde3, dae1f4, fce5d4, deeded, fff2cc, deeaf6, e1efd9, d7d8d8, 585959, aeabab, adbaca, b4c5e7, f6caac, dbdbdb, ffe498, bcd6ee, c5e0b2, bfbfc0, 3f3f3f, 767070, 8595b1, 8fabdb, f5b183, c9c8c9, fed965, 9bc4e5, a8d08d, a5a5a6, 262625, 393939, 334050, 2e5496, c45a11, 7b7b7a, bf9000, 2f75b5, 548235, 7f7f7f, 0b0c0c, 161616, 222a34, 203764, 843d0b, 525252, 7f6000, 1d4d79, 375623',
7441
+ columns: 10
7442
+ },
7443
+ apex: {
7444
+ colors: 'ffffff, 000000, c9c2d1, 69676d, ceb966, 9cb084, 6bb1c9, 6585cf, 7e6bc9, a379bb, f2f2f2, 7f7f7f, f4f2f5, e0e0e2, f5f1e0, ebefe6, e1eff4, e0e6f5, e5e1f4, ece4f1, d8d8d8, 595959, e9e6ec, c2c1c5, ebe3c1, d7dfcd, c3dfe9, c1ceeb, cbc3e9, dac9e3, bfbfbf, 3f3f3f, dedae3, a4a3a8, e1d5a3, c3cfb5, a6d0de, a2b5e2, b1a6de, c7aed6, a5a5a5, 262626, 9688a5, 4e4d51, ae9638, 758c5a, 3d8da9, 365bb0, 533da9, 7d4d99, 7f7f7f, 0c0c0c, 635672, 343336, 746425, 4e5d3c, 295e70, 243c75, 372970, 533366',
7445
+ columns: 10
7446
+ },
7447
+ austin: {
7448
+ colors: 'ffffff, 000000, caf278, 3e3d2d, 94c600, 71685a, ff6700, 909465, 956b43, fea022, f2f2f2, 7f7f7f, f4fce4, dddcd0, efffc0, e3e1dc, ffe0cb, e8e9df, ece1d6, feecd2, d8d8d8, 595959, e9f9c9, bbb9a1, dfff82, c8c3ba, ffc299, d2d4c0, dac3ad, fed9a6, bfbfbf, 3f3f3f, dff7ae, ada598, cfff43, ada598, ffa365, bcbfa1, c8a585, fec67a, a5a5a5, 262626, a9ea25, 2e2d21, 6f9400, 544e43, bf4d00, 6c6f4b, 6f5032, d77b00, 7f7f7f, 0c0c0c, 74a50f, 1f1e16, 4a6300, 38342d, 7f3300, 484a32, 4a3521, 8f5200',
7449
+ columns: 10
7450
+ },
7451
+ clarity: {
7452
+ colors: 'ffffff, 292934, f3f2dc, d2533c, 93a299, ad8f67, 726056, 4c5a6a, 808da0, 79463d, f2f2f2, e7e7ec, e7e5b9, f6dcd8, e9ecea, eee8e0, e4dedb, d8dde3, e5e8ec, e9d6d3, d8d8d8, c4c4d1, d5d185, edbab1, d3d9d6, ded2c2, c9beb8, b2bcc8, ccd1d9, d3aea7, bfbfbf, 8a8aa3, aca73b, e4978a, bec7c1, cdbba3, af9e94, 8c9bac, b2bac6, bd857c, a5a5a5, 56566e, 56531d, a43925, 6b7c72, 866b48, 554840, 39434f, 5c697b, 5a342d, 7f7f7f, 3b3b4b, 22210b, 6d2619, 47534c, 594730, 39302b, 262d35, 3d4652, 3c231e',
7453
+ columns: 10
7454
+ },
7455
+ slipstream: {
7456
+ colors: 'ffffff, 000000, b4dcfa, 212745, 4e67c8, 5eccf3, a7ea52, 5dceaf, ff8021, f14124, f2f2f2, 7f7f7f, 8bc9f7, c7cce4, dbe0f4, def4fc, edfadc, def5ef, ffe5d2, fcd9d3, d8d8d8, 595959, 4facf3, 909aca, b8c2e9, beeafa, dbf6b9, beebdf, ffcca6, f9b3a7, bfbfbf, 3f3f3f, 0d78c9, 5967af, 94a3de, 9ee0f7, caf297, 9de1cf, ffb279, f68d7b, a5a5a5, 262626, 063c64, 181d33, 31479f, 11b2eb, 81d319, 34ac8b, d85c00, c3260c, 7f7f7f, 0c0c0c, 021828, 101322, 202f6a, 0b769c, 568c11, 22725c, 903d00, 821908',
7457
+ columns: 10
7458
+ },
7459
+ metro: {
7460
+ colors: 'ffffff, 000000, d6ecff, 4e5b6f, 7fd13b, ea157a, feb80a, 00addc, 738ac8, 1ab39f, f2f2f2, 7f7f7f, a7d6ff, d9dde4, e5f5d7, fad0e4, fef0cd, c5f2ff, e2e7f4, c9f7f1, d8d8d8, 595959, 60b5ff, b3bcca, cbecb0, f6a1c9, fee29c, 8be6ff, c7d0e9, 94efe3, bfbfbf, 3f3f3f, 007dea, 8d9baf, b2e389, f272af, fed46b, 51d9ff, aab8de, 5fe7d5, a5a5a5, 262626, 003e75, 3a4453, 5ea226, af0f5b, c58c00, 0081a5, 425ea9, 138677, 7f7f7f, 0c0c0c, 00192e, 272d37, 3f6c19, 750a3d, 835d00, 00566e, 2c3f71, 0c594f',
7461
+ columns: 10
7462
+ },
7463
+ flow: {
7464
+ colors: 'ffffff, 000000, dbf5f9, 04617b, 0f6fc6, 009dd9, 0bd0d9, 10cf9b, 7cca62, a5c249, f2f2f2, 7f7f7f, b2e9f2, b4ecfc, c7e2fa, c4eeff, c9fafc, c9faed, e4f4df, edf2da, d8d8d8, 595959, 76d9e8, 6adafa, 90c6f6, 89deff, 93f5f9, 94f6db, cae9c0, dbe6b6, bfbfbf, 3f3f3f, 21b2c8, 20c8f7, 59a9f2, 4fceff, 5df0f6, 5ff2ca, b0dfa0, c9da91, a5a5a5, 262626, 105964, 02485c, 0b5394, 0075a2, 089ca2, 0b9b74, 54a838, 7e9532, 7f7f7f, 0c0c0c, 062328, 01303d, 073763, 004e6c, 05686c, 07674d, 387025, 546321',
7465
+ columns: 10
7466
+ },
7467
+ hardcover: {
7468
+ colors: 'ffffff, 000000, ece9c6, 895d1d, 873624, d6862d, d0be40, 877f6c, 972109, aeb795, f2f2f2, 7f7f7f, e1dca5, f2e0c6, f0d0c9, f6e6d5, f5f2d8, e7e5e1, fbc7bc, eef0e9, d8d8d8, 595959, d0c974, e6c28d, e2a293, eeceaa, ece5b2, cfccc3, f78f7a, dee2d4, bfbfbf, 3f3f3f, a29a36, daa454, d4735e, e6b681, e2d88c, b7b2a5, f35838, ced3bf, a5a5a5, 262626, 514d1b, 664515, 65281a, a2641f, a39428, 655f50, 711806, 879464, 7f7f7f, 0c0c0c, 201e0a, 442e0e, 431b11, 6c4315, 6d621a, 433f35, 4b1004, 5a6243',
7469
+ columns: 10
7470
+ },
7471
+ trek: {
7472
+ colors: 'ffffff, 000000, fbeec9, 4e3b30, f0a22e, a5644e, b58b80, c3986d, a19574, c17529, f2f2f2, 7f7f7f, f7e09e, e1d6cf, fcecd5, eddfda, f0e7e5, f3eae1, ece9e3, f5e3d1, d8d8d8, 595959, f3cc5f, c4ad9f, f9d9ab, dcc0b6, e1d0cc, e7d5c4, d9d4c7, ebc7a3, bfbfbf, 3f3f3f, d29f0f, a78470, f6c781, cba092, d2b9b2, dbc1a7, c6bfab, e1ac76, a5a5a5, 262626, 694f07, 3a2c24, c87d0e, 7b4b3a, 926255, a17242, 7b7153, 90571e, 7f7f7f, 0c0c0c, 2a1f03, 271d18, 855309, 523226, 614138, 6b4c2c, 524b37, 603a14',
7473
+ columns: 10
7474
+ },
7475
+ verve: {
7476
+ colors: 'ffffff, 000000, d2d2d2, 666666, ff388c, e40059, 9c007f, 68007f, 005bd3, 00349e, f2f2f2, 7f7f7f, bdbdbd, e0e0e0, ffd7e8, ffc6dc, ffb8f1, f1b2ff, c3dcff, b8cfff, d8d8d8, 595959, 9d9d9d, c1c1c1, ffafd1, ff8eba, ff71e4, e365ff, 87baff, 72a0ff, bfbfbf, 3f3f3f, 696969, a3a3a3, ff87ba, ff5597, ff2ad7, d519ff, 4b98ff, 2b71ff, a5a5a5, 262626, 343434, 4c4c4c, e90062, ab0042, 75005f, 4e005f, 00449e, 002676, 7f7f7f, 0c0c0c, 151515, 333333, 9b0041, 72002c, 4e003f, 34003f, 002d69, 00194f',
7477
+ columns: 10
7478
+ },
7479
+ monochrome: {
7480
+ colors: '000000, 1a1a1a, 333333, 4d4d4d, 666666, 808080, 999999, b3b3b3, cccccc, e6e6e6, f2f2f2, ffffff',
7481
+ columns: 12
7482
+ },
7483
+ accessible: {
7484
+ colors: 'black, grey, darkred, red, darkorange, gold, green, blue, darkblue, purple, white, darkgrey, saddlebrown, pink, orange, yellow, lightgreen, lightskyblue, lightblue, mediumpurple',
7485
+ columns: 10
7486
+ }
7487
+ };
7488
+
7489
+ /**
7490
+ * @hidden
7491
+ */
7492
+ var FlatColorPickerService = /** @class */ (function () {
7493
+ function FlatColorPickerService() {
7494
+ }
7495
+ FlatColorPickerService.prototype.getPaletteSettings = function (settings, format) {
7496
+ var defaultPreset = (format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
7497
+ var settingsPalette = settings.palette;
7498
+ var presetColumns = typeof settingsPalette === 'string' && PALETTEPRESETS[settingsPalette] ?
7499
+ PALETTEPRESETS[settingsPalette].columns :
7500
+ undefined;
7501
+ return {
7502
+ palette: settingsPalette || defaultPreset,
7503
+ tileSize: settings.tileSize || 24,
7504
+ columns: settings.columns || presetColumns || 10
7505
+ };
7506
+ };
7507
+ FlatColorPickerService.prototype.paletteTileLayout = function (tileSize) {
7508
+ if (typeof tileSize === 'number') {
7509
+ return { width: tileSize, height: tileSize };
7510
+ }
7511
+ return {
7512
+ width: tileSize.width ? tileSize.width : tileSize.height,
7513
+ height: tileSize.height ? tileSize.height : tileSize.width
7514
+ };
7375
7515
  };
7376
- return PreventableEvent;
7516
+ FlatColorPickerService = __decorate([
7517
+ Injectable()
7518
+ ], FlatColorPickerService);
7519
+ return FlatColorPickerService;
7377
7520
  }());
7378
7521
 
7522
+ /**
7523
+ * Arguments for the `cancel` event of the ColorPicker and FlatColorPicker components.
7524
+ */
7525
+ var ColorPickerCancelEvent = /** @class */ (function (_super) {
7526
+ __extends(ColorPickerCancelEvent, _super);
7527
+ function ColorPickerCancelEvent(originalEvent) {
7528
+ var _this = _super.call(this) || this;
7529
+ _this.originalEvent = originalEvent;
7530
+ return _this;
7531
+ }
7532
+ return ColorPickerCancelEvent;
7533
+ }(PreventableEvent));
7534
+
7535
+ /**
7536
+ * Arguments for the `close` event of the ColorPicker component.
7537
+ */
7538
+ var ColorPickerCloseEvent = /** @class */ (function (_super) {
7539
+ __extends(ColorPickerCloseEvent, _super);
7540
+ function ColorPickerCloseEvent() {
7541
+ return _super !== null && _super.apply(this, arguments) || this;
7542
+ }
7543
+ return ColorPickerCloseEvent;
7544
+ }(PreventableEvent));
7545
+
7546
+ /**
7547
+ * Arguments for the `open` event of the ColorPicker component.
7548
+ */
7549
+ var ColorPickerOpenEvent = /** @class */ (function (_super) {
7550
+ __extends(ColorPickerOpenEvent, _super);
7551
+ function ColorPickerOpenEvent() {
7552
+ return _super !== null && _super.apply(this, arguments) || this;
7553
+ }
7554
+ return ColorPickerOpenEvent;
7555
+ }(PreventableEvent));
7556
+
7379
7557
  /**
7380
7558
  * Fires each time the left side of the ColorPicker wrapper is clicked.
7381
7559
  * The event is triggered regardless of whether a ColorPicker icon is set or not.
@@ -7437,7 +7615,8 @@ var ActiveColorClickEvent = /** @class */ (function () {
7437
7615
  *
7438
7616
  * Returns the hex or rgba string representation of the color.
7439
7617
  */
7440
- var parseColor$1 = function (value, format, safe) {
7618
+ var parseColor$1 = function (value, format, opacityEnabled, safe) {
7619
+ if (opacityEnabled === void 0) { opacityEnabled = false; }
7441
7620
  if (safe === void 0) { safe = true; }
7442
7621
  var allowedFormats = ['hex', 'rgba', 'name'];
7443
7622
  if (allowedFormats.indexOf(format) === -1) {
@@ -7453,7 +7632,8 @@ var parseColor$1 = function (value, format, safe) {
7453
7632
  if (!isPresent(parsedColor)) {
7454
7633
  return;
7455
7634
  }
7456
- return format === 'hex' ? parsedColor.toCss() : parsedColor.toCssRgba();
7635
+ var parsedColorResult = format === 'hex' ? getHexValue(parsedColor, opacityEnabled) : parsedColor.toCssRgba();
7636
+ return parsedColorResult;
7457
7637
  };
7458
7638
  /**
7459
7639
  * @hidden
@@ -7486,12 +7666,23 @@ var getRGBA = function (value, safe) {
7486
7666
  *
7487
7667
  * Returns the RGBA string representation of the color.
7488
7668
  */
7489
- var getColorFromHSV = function (hsva) {
7669
+ var getColorFromHSV = function (hsva, format, opacityEnabled) {
7670
+ if (format === void 0) { format = 'rgba'; }
7671
+ if (opacityEnabled === void 0) { opacityEnabled = false; }
7490
7672
  var hue = fitIntoBounds(hsva.h, 0, 359.9);
7491
7673
  var saturation = fitIntoBounds(hsva.s, 0, 1);
7492
7674
  var value = fitIntoBounds(hsva.v, 0, 1);
7493
7675
  var alpha = fitIntoBounds(hsva.a, 0, 1);
7494
- return Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
7676
+ var color = Color.fromHSV(hue, saturation, value, alpha);
7677
+ return format === 'hex' ? getHexValue(color, opacityEnabled) : color.toCssRgba();
7678
+ };
7679
+ /**
7680
+ * @hidden
7681
+ *
7682
+ * Returns the HEX value.
7683
+ */
7684
+ var getHexValue = function (color, opacity) {
7685
+ return opacity && color.a < 1 ? color.toCss({ alpha: true }) : color.toCss();
7495
7686
  };
7496
7687
  /**
7497
7688
  * @hidden
@@ -7527,7 +7718,7 @@ function nameFormat(value, safe) {
7527
7718
  }
7528
7719
  var key = Object.keys(namedColors).find(function (key) { return namedColors[key] === value; });
7529
7720
  if (!key && !safe) {
7530
- throw new Error("The provided color " + value + " is not supported for 'format=\"name\"' property.To display " + value + " color, the component 'format' property shoud be set to 'hex' or 'rgba' ");
7721
+ 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' ");
7531
7722
  }
7532
7723
  return key;
7533
7724
  }
@@ -7584,95 +7775,90 @@ var getContrastFromTwoRGBAs = function (a, b) {
7584
7775
  return getContrast(getLuminance(getRGBFromRGBA(a, b)), getLuminance(getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
7585
7776
  };
7586
7777
 
7587
- // tslint:disable:max-line-length
7588
7778
  /**
7589
7779
  * @hidden
7590
7780
  */
7591
- var PALETTEPRESETS = {
7592
- basic: {
7593
- colors: '000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7',
7594
- columns: 10
7595
- },
7596
- office: {
7597
- colors: 'ffffff, 000000, e6e6e6, 435569, 4371c4, ed7e32, a5a4a5, febf04, 5a9bd5, 71ae48, f2f2f3, 7f7f7f, d1cece, d5dde3, dae1f4, fce5d4, deeded, fff2cc, deeaf6, e1efd9, d7d8d8, 585959, aeabab, adbaca, b4c5e7, f6caac, dbdbdb, ffe498, bcd6ee, c5e0b2, bfbfc0, 3f3f3f, 767070, 8595b1, 8fabdb, f5b183, c9c8c9, fed965, 9bc4e5, a8d08d, a5a5a6, 262625, 393939, 334050, 2e5496, c45a11, 7b7b7a, bf9000, 2f75b5, 548235, 7f7f7f, 0b0c0c, 161616, 222a34, 203764, 843d0b, 525252, 7f6000, 1d4d79, 375623',
7598
- columns: 10
7599
- },
7600
- apex: {
7601
- colors: 'ffffff, 000000, c9c2d1, 69676d, ceb966, 9cb084, 6bb1c9, 6585cf, 7e6bc9, a379bb, f2f2f2, 7f7f7f, f4f2f5, e0e0e2, f5f1e0, ebefe6, e1eff4, e0e6f5, e5e1f4, ece4f1, d8d8d8, 595959, e9e6ec, c2c1c5, ebe3c1, d7dfcd, c3dfe9, c1ceeb, cbc3e9, dac9e3, bfbfbf, 3f3f3f, dedae3, a4a3a8, e1d5a3, c3cfb5, a6d0de, a2b5e2, b1a6de, c7aed6, a5a5a5, 262626, 9688a5, 4e4d51, ae9638, 758c5a, 3d8da9, 365bb0, 533da9, 7d4d99, 7f7f7f, 0c0c0c, 635672, 343336, 746425, 4e5d3c, 295e70, 243c75, 372970, 533366',
7602
- columns: 10
7603
- },
7604
- austin: {
7605
- colors: 'ffffff, 000000, caf278, 3e3d2d, 94c600, 71685a, ff6700, 909465, 956b43, fea022, f2f2f2, 7f7f7f, f4fce4, dddcd0, efffc0, e3e1dc, ffe0cb, e8e9df, ece1d6, feecd2, d8d8d8, 595959, e9f9c9, bbb9a1, dfff82, c8c3ba, ffc299, d2d4c0, dac3ad, fed9a6, bfbfbf, 3f3f3f, dff7ae, ada598, cfff43, ada598, ffa365, bcbfa1, c8a585, fec67a, a5a5a5, 262626, a9ea25, 2e2d21, 6f9400, 544e43, bf4d00, 6c6f4b, 6f5032, d77b00, 7f7f7f, 0c0c0c, 74a50f, 1f1e16, 4a6300, 38342d, 7f3300, 484a32, 4a3521, 8f5200',
7606
- columns: 10
7607
- },
7608
- clarity: {
7609
- colors: 'ffffff, 292934, f3f2dc, d2533c, 93a299, ad8f67, 726056, 4c5a6a, 808da0, 79463d, f2f2f2, e7e7ec, e7e5b9, f6dcd8, e9ecea, eee8e0, e4dedb, d8dde3, e5e8ec, e9d6d3, d8d8d8, c4c4d1, d5d185, edbab1, d3d9d6, ded2c2, c9beb8, b2bcc8, ccd1d9, d3aea7, bfbfbf, 8a8aa3, aca73b, e4978a, bec7c1, cdbba3, af9e94, 8c9bac, b2bac6, bd857c, a5a5a5, 56566e, 56531d, a43925, 6b7c72, 866b48, 554840, 39434f, 5c697b, 5a342d, 7f7f7f, 3b3b4b, 22210b, 6d2619, 47534c, 594730, 39302b, 262d35, 3d4652, 3c231e',
7610
- columns: 10
7611
- },
7612
- slipstream: {
7613
- colors: 'ffffff, 000000, b4dcfa, 212745, 4e67c8, 5eccf3, a7ea52, 5dceaf, ff8021, f14124, f2f2f2, 7f7f7f, 8bc9f7, c7cce4, dbe0f4, def4fc, edfadc, def5ef, ffe5d2, fcd9d3, d8d8d8, 595959, 4facf3, 909aca, b8c2e9, beeafa, dbf6b9, beebdf, ffcca6, f9b3a7, bfbfbf, 3f3f3f, 0d78c9, 5967af, 94a3de, 9ee0f7, caf297, 9de1cf, ffb279, f68d7b, a5a5a5, 262626, 063c64, 181d33, 31479f, 11b2eb, 81d319, 34ac8b, d85c00, c3260c, 7f7f7f, 0c0c0c, 021828, 101322, 202f6a, 0b769c, 568c11, 22725c, 903d00, 821908',
7614
- columns: 10
7615
- },
7616
- metro: {
7617
- colors: 'ffffff, 000000, d6ecff, 4e5b6f, 7fd13b, ea157a, feb80a, 00addc, 738ac8, 1ab39f, f2f2f2, 7f7f7f, a7d6ff, d9dde4, e5f5d7, fad0e4, fef0cd, c5f2ff, e2e7f4, c9f7f1, d8d8d8, 595959, 60b5ff, b3bcca, cbecb0, f6a1c9, fee29c, 8be6ff, c7d0e9, 94efe3, bfbfbf, 3f3f3f, 007dea, 8d9baf, b2e389, f272af, fed46b, 51d9ff, aab8de, 5fe7d5, a5a5a5, 262626, 003e75, 3a4453, 5ea226, af0f5b, c58c00, 0081a5, 425ea9, 138677, 7f7f7f, 0c0c0c, 00192e, 272d37, 3f6c19, 750a3d, 835d00, 00566e, 2c3f71, 0c594f',
7618
- columns: 10
7619
- },
7620
- flow: {
7621
- colors: 'ffffff, 000000, dbf5f9, 04617b, 0f6fc6, 009dd9, 0bd0d9, 10cf9b, 7cca62, a5c249, f2f2f2, 7f7f7f, b2e9f2, b4ecfc, c7e2fa, c4eeff, c9fafc, c9faed, e4f4df, edf2da, d8d8d8, 595959, 76d9e8, 6adafa, 90c6f6, 89deff, 93f5f9, 94f6db, cae9c0, dbe6b6, bfbfbf, 3f3f3f, 21b2c8, 20c8f7, 59a9f2, 4fceff, 5df0f6, 5ff2ca, b0dfa0, c9da91, a5a5a5, 262626, 105964, 02485c, 0b5394, 0075a2, 089ca2, 0b9b74, 54a838, 7e9532, 7f7f7f, 0c0c0c, 062328, 01303d, 073763, 004e6c, 05686c, 07674d, 387025, 546321',
7622
- columns: 10
7623
- },
7624
- hardcover: {
7625
- colors: 'ffffff, 000000, ece9c6, 895d1d, 873624, d6862d, d0be40, 877f6c, 972109, aeb795, f2f2f2, 7f7f7f, e1dca5, f2e0c6, f0d0c9, f6e6d5, f5f2d8, e7e5e1, fbc7bc, eef0e9, d8d8d8, 595959, d0c974, e6c28d, e2a293, eeceaa, ece5b2, cfccc3, f78f7a, dee2d4, bfbfbf, 3f3f3f, a29a36, daa454, d4735e, e6b681, e2d88c, b7b2a5, f35838, ced3bf, a5a5a5, 262626, 514d1b, 664515, 65281a, a2641f, a39428, 655f50, 711806, 879464, 7f7f7f, 0c0c0c, 201e0a, 442e0e, 431b11, 6c4315, 6d621a, 433f35, 4b1004, 5a6243',
7626
- columns: 10
7627
- },
7628
- trek: {
7629
- colors: 'ffffff, 000000, fbeec9, 4e3b30, f0a22e, a5644e, b58b80, c3986d, a19574, c17529, f2f2f2, 7f7f7f, f7e09e, e1d6cf, fcecd5, eddfda, f0e7e5, f3eae1, ece9e3, f5e3d1, d8d8d8, 595959, f3cc5f, c4ad9f, f9d9ab, dcc0b6, e1d0cc, e7d5c4, d9d4c7, ebc7a3, bfbfbf, 3f3f3f, d29f0f, a78470, f6c781, cba092, d2b9b2, dbc1a7, c6bfab, e1ac76, a5a5a5, 262626, 694f07, 3a2c24, c87d0e, 7b4b3a, 926255, a17242, 7b7153, 90571e, 7f7f7f, 0c0c0c, 2a1f03, 271d18, 855309, 523226, 614138, 6b4c2c, 524b37, 603a14',
7630
- columns: 10
7631
- },
7632
- verve: {
7633
- colors: 'ffffff, 000000, d2d2d2, 666666, ff388c, e40059, 9c007f, 68007f, 005bd3, 00349e, f2f2f2, 7f7f7f, bdbdbd, e0e0e0, ffd7e8, ffc6dc, ffb8f1, f1b2ff, c3dcff, b8cfff, d8d8d8, 595959, 9d9d9d, c1c1c1, ffafd1, ff8eba, ff71e4, e365ff, 87baff, 72a0ff, bfbfbf, 3f3f3f, 696969, a3a3a3, ff87ba, ff5597, ff2ad7, d519ff, 4b98ff, 2b71ff, a5a5a5, 262626, 343434, 4c4c4c, e90062, ab0042, 75005f, 4e005f, 00449e, 002676, 7f7f7f, 0c0c0c, 151515, 333333, 9b0041, 72002c, 4e003f, 34003f, 002d69, 00194f',
7634
- columns: 10
7635
- },
7636
- monochrome: {
7637
- colors: '000000, 1a1a1a, 333333, 4d4d4d, 666666, 808080, 999999, b3b3b3, cccccc, e6e6e6, f2f2f2, ffffff',
7638
- columns: 12
7639
- },
7640
- accessible: {
7641
- colors: 'black, grey, darkred, red, darkorange, gold, green, blue, darkblue, purple, white, darkgrey, saddlebrown, pink, orange, yellow, lightgreen, lightskyblue, lightblue, mediumpurple',
7642
- columns: 10
7643
- }
7781
+ var bezierCommand = function (controlPointCalc) { return function (point, i, a) {
7782
+ // start control point
7783
+ var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
7784
+ // end control point
7785
+ var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
7786
+ return "C " + cpsX + "," + cpsY + " " + cpeX + "," + cpeY + " " + point[0] + "," + point[1];
7787
+ }; };
7788
+ /**
7789
+ * @hidden
7790
+ */
7791
+ var controlPoint = function (lineCalc) {
7792
+ return function (current, previous, next, reverse) {
7793
+ // when 'current' is the first or last point of the array
7794
+ // 'previous' and 'next' are undefined
7795
+ // replace with 'current'
7796
+ var p = previous || current;
7797
+ var n = next || current;
7798
+ var smooth = 0.1;
7799
+ // properties of the line between previous and next
7800
+ var l = lineCalc(p, n);
7801
+ // If is end-control-point, add PI to the angle to go backward
7802
+ var angle = l.angle + (reverse ? Math.PI : 0);
7803
+ var length = l.length * smooth;
7804
+ // The control point position is relative to the current point
7805
+ var x = current[0] + Math.cos(angle) * length;
7806
+ var y = current[1] + Math.sin(angle) * length;
7807
+ return [x, y];
7808
+ };
7644
7809
  };
7645
-
7646
7810
  /**
7647
7811
  * @hidden
7648
7812
  */
7649
- var ColorPickerLocalizationService = /** @class */ (function (_super) {
7650
- __extends(ColorPickerLocalizationService, _super);
7651
- function ColorPickerLocalizationService(prefix, messageService, _rtl) {
7652
- return _super.call(this, prefix, messageService, _rtl) || this;
7813
+ var line = function (pointA, pointB) {
7814
+ var lengthX = pointB[0] - pointA[0];
7815
+ var lengthY = pointB[1] - pointA[1];
7816
+ return {
7817
+ length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
7818
+ angle: Math.atan2(lengthY, lengthX)
7819
+ };
7820
+ };
7821
+ /**
7822
+ * @hidden
7823
+ *
7824
+ * Render the svg <path> element.
7825
+ *
7826
+ * @param points (array) Represents the points coordinates as an array of tuples.
7827
+ * @param command (function) The command that is used (bezierCommand, lineCommand).
7828
+ * @param point (array) [x,y] Represents the current point coordinates.
7829
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
7830
+ * @param a (array) Represents the complete array of points coordinates.
7831
+ * @output (string) a svg path command.
7832
+ * @output (string) a Svg <path> element
7833
+ */
7834
+ var svgPath = function (points, command) {
7835
+ if (points.length === 0) {
7836
+ return '';
7653
7837
  }
7654
- ColorPickerLocalizationService = __decorate([
7655
- __param(0, Inject(L10N_PREFIX)),
7656
- __param(1, Optional()),
7657
- __param(2, Optional()), __param(2, Inject(RTL)),
7658
- __metadata("design:paramtypes", [String, MessageService, Boolean])
7659
- ], ColorPickerLocalizationService);
7660
- return ColorPickerLocalizationService;
7661
- }(LocalizationService));
7838
+ // build the d attributes by looping over the points
7839
+ var d = points.reduce(function (acc, point, i, a) {
7840
+ return i === 0 ?
7841
+ // if first point
7842
+ "M " + point[0] + "," + point[1] :
7843
+ // else
7844
+ acc + " " + command(point, i, a);
7845
+ }, '');
7846
+ return d;
7847
+ };
7662
7848
 
7663
7849
  /**
7664
7850
  * @hidden
7665
7851
  */
7666
7852
  var ColorGradientLocalizationService = /** @class */ (function (_super) {
7667
7853
  __extends(ColorGradientLocalizationService, _super);
7668
- function ColorGradientLocalizationService(prefix, messageService, _rtl, colorPickerLocalization) {
7854
+ function ColorGradientLocalizationService(prefix, messageService, _rtl, flatColorPickerLocalization) {
7669
7855
  var _this = _super.call(this, prefix, messageService, _rtl) || this;
7670
- _this.colorPickerLocalization = colorPickerLocalization;
7856
+ _this.flatColorPickerLocalization = flatColorPickerLocalization;
7671
7857
  return _this;
7672
7858
  }
7673
7859
  ColorGradientLocalizationService.prototype.get = function (shortKey) {
7674
- if (this.colorPickerLocalization) {
7675
- return this.colorPickerLocalization.get(shortKey);
7860
+ if (this.flatColorPickerLocalization) {
7861
+ return this.flatColorPickerLocalization.get(shortKey);
7676
7862
  }
7677
7863
  return _super.prototype.get.call(this, shortKey);
7678
7864
  };
@@ -7680,8 +7866,8 @@ var ColorGradientLocalizationService = /** @class */ (function (_super) {
7680
7866
  __param(0, Inject(L10N_PREFIX)),
7681
7867
  __param(1, Optional()),
7682
7868
  __param(2, Optional()), __param(2, Inject(RTL)),
7683
- __param(3, Optional()), __param(3, Inject(ColorPickerLocalizationService)),
7684
- __metadata("design:paramtypes", [String, MessageService, Boolean, ColorPickerLocalizationService])
7869
+ __param(3, Optional()), __param(3, Inject(FlatColorPickerLocalizationService)),
7870
+ __metadata("design:paramtypes", [String, MessageService, Boolean, FlatColorPickerLocalizationService])
7685
7871
  ], ColorGradientLocalizationService);
7686
7872
  return ColorGradientLocalizationService;
7687
7873
  }(LocalizationService));
@@ -7690,10 +7876,14 @@ var ColorGradientLocalizationService = /** @class */ (function (_super) {
7690
7876
  * @hidden
7691
7877
  */
7692
7878
  var ColorInputComponent = /** @class */ (function () {
7693
- function ColorInputComponent(localization, host, renderer) {
7694
- this.localization = localization;
7879
+ function ColorInputComponent(host, renderer, localizationService) {
7695
7880
  this.host = host;
7696
7881
  this.renderer = renderer;
7882
+ this.localizationService = localizationService;
7883
+ /**
7884
+ * The id of the hex input.
7885
+ */
7886
+ this.focusableId = "k-" + guid();
7697
7887
  /**
7698
7888
  * Sets whether the alpha slider will be shown.
7699
7889
  */
@@ -7752,24 +7942,31 @@ var ColorInputComponent = /** @class */ (function () {
7752
7942
  };
7753
7943
  ColorInputComponent.prototype.ngOnChanges = function (changes) {
7754
7944
  if (isPresent(changes.value) && !this.isFocused) {
7755
- this.hex = parseColor$1(this.value, 'hex');
7945
+ this.hex = parseColor$1(this.value, 'hex', this.opacity);
7756
7946
  this.rgba = getRGBA(this.value);
7757
- this.rgba.a = parseColor$1(this.value, 'rgba') ? this.rgba.a : 1;
7947
+ this.rgba.a = parseColor$1(this.value, 'rgba', this.opacity) ? this.rgba.a : 1;
7758
7948
  }
7759
7949
  };
7760
- ColorInputComponent.prototype.handleRgbaValueChange = function () {
7761
- var color = getColorFromRGBA(this.rgba);
7762
- if (!this.rgbaInputValid || color === this.value) {
7763
- return;
7950
+ Object.defineProperty(ColorInputComponent.prototype, "formatButtonTitle", {
7951
+ get: function () {
7952
+ return this.localizationService.get('formatButton');
7953
+ },
7954
+ enumerable: true,
7955
+ configurable: true
7956
+ });
7957
+ ColorInputComponent.prototype.handleRgbaValueChange = function () {
7958
+ var color = getColorFromRGBA(this.rgba);
7959
+ if (!this.rgbaInputValid || color === this.value) {
7960
+ return;
7764
7961
  }
7765
7962
  this.value = color;
7766
7963
  this.rgba = getRGBA(this.value);
7767
- this.hex = parseColor$1(color, 'hex');
7964
+ this.hex = parseColor$1(color, 'hex', this.opacity);
7768
7965
  this.valueChange.emit(color);
7769
7966
  };
7770
7967
  ColorInputComponent.prototype.handleHexValueChange = function (hex) {
7771
7968
  this.hex = hex;
7772
- var color = parseColor$1(hex, 'rgba');
7969
+ var color = parseColor$1(hex, 'rgba', this.opacity);
7773
7970
  if (!isPresent(color) || color === this.value) {
7774
7971
  return;
7775
7972
  }
@@ -7783,10 +7980,7 @@ var ColorInputComponent = /** @class */ (function () {
7783
7980
  }
7784
7981
  };
7785
7982
  ColorInputComponent.prototype.handleHexInputBlur = function () {
7786
- this.hex = parseColor$1(this.value, 'hex');
7787
- };
7788
- ColorInputComponent.prototype.textFor = function (key) {
7789
- return this.localization.get(key);
7983
+ this.hex = parseColor$1(this.value, 'hex', this.opacity);
7790
7984
  };
7791
7985
  ColorInputComponent.prototype.toggleFormatView = function () {
7792
7986
  this.formatView = this.formatView === 'hex' ? 'rgba' : 'hex';
@@ -7798,6 +7992,10 @@ var ColorInputComponent = /** @class */ (function () {
7798
7992
  }
7799
7993
  this.subscriptions.add(this.renderer.listen(this.toggleFormatButton.nativeElement, 'click', function () { return _this.toggleFormatView(); }));
7800
7994
  };
7995
+ __decorate([
7996
+ Input(),
7997
+ __metadata("design:type", String)
7998
+ ], ColorInputComponent.prototype, "focusableId", void 0);
7801
7999
  __decorate([
7802
8000
  Input(),
7803
8001
  __metadata("design:type", String)
@@ -7828,9 +8026,17 @@ var ColorInputComponent = /** @class */ (function () {
7828
8026
  __metadata("design:type", Boolean)
7829
8027
  ], ColorInputComponent.prototype, "colorInputClass", void 0);
7830
8028
  __decorate([
7831
- ViewChild('opacityInput', { read: ElementRef, static: false }),
7832
- __metadata("design:type", ElementRef)
8029
+ ViewChild('opacityInput', { static: false }),
8030
+ __metadata("design:type", NumericTextBoxComponent)
7833
8031
  ], ColorInputComponent.prototype, "opacityInput", void 0);
8032
+ __decorate([
8033
+ ViewChild('hexInput', { read: ElementRef, static: false }),
8034
+ __metadata("design:type", ElementRef)
8035
+ ], ColorInputComponent.prototype, "hexInput", void 0);
8036
+ __decorate([
8037
+ ViewChild('blueInput', { read: ElementRef, static: false }),
8038
+ __metadata("design:type", ElementRef)
8039
+ ], ColorInputComponent.prototype, "blueInput", void 0);
7834
8040
  __decorate([
7835
8041
  ViewChild('toggleFormatButton', { static: false }),
7836
8042
  __metadata("design:type", ElementRef)
@@ -7838,36 +8044,15 @@ var ColorInputComponent = /** @class */ (function () {
7838
8044
  ColorInputComponent = __decorate([
7839
8045
  Component({
7840
8046
  selector: 'kendo-colorinput',
7841
- template: "\n <div class=\"k-vstack\">\n <button class=\"k-colorgradient-toggle-mode k-button k-icon-button k-flat\" #toggleFormatButton>\n <span class=\"k-button-icon k-icon k-i-arrows-kpi\"></span>\n </button>\n </div>\n <input *ngIf=\"formatView === 'hex'\"\n #hexInput\n class=\"k-textbox k-hex-value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"hex || ''\"\n [placeholder]=\"textFor('hexInputPlaceholder')\"\n (blur)=\"handleHexInputBlur()\"\n (input)=\"handleHexValueChange(hexInput.value)\"\n />\n <ng-container *ngIf=\"formatView === 'rgba'\">\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #red\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [placeholder]=\"textFor('redInputPlaceholder')\"\n [(value)]=\"rgba.r\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"red.focusableId\" class=\"k-colorgradient-input-label\">R</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #green\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [placeholder]=\"textFor('greenInputPlaceholder')\"\n [(value)]=\"rgba.g\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"green.focusableId\" class=\"k-colorgradient-input-label\">G</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #blue\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [placeholder]=\"textFor('blueInputPlaceholder')\"\n [(value)]=\"rgba.b\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"blue.focusableId\" class=\"k-colorgradient-input-label\">B</label>\n </div>\n <div class=\"k-vstack\" *ngIf=\"opacity\">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"1\"\n [placeholder]=\"textFor('alphaInputPlaceholder')\"\n [(value)]=\"rgba.a\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [step]=\"0.01\"\n [format]=\"'n2'\"\n [decimals]=\"2\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"alpha.focusableId\" class=\"k-colorgradient-input-label\">A</label>\n </div>\n </ng-container>\n "
8047
+ template: "\n <div class=\"k-vstack\">\n <button #toggleFormatButton\n class=\"k-colorgradient-toggle-mode k-button k-icon-button k-flat\"\n [attr.aria-label]=\"formatButtonTitle\"\n [attr.title]=\"formatButtonTitle\"\n >\n <span class=\"k-button-icon k-icon k-i-arrows-kpi\"></span>\n </button>\n </div>\n <div *ngIf=\"formatView === 'hex'\" class=\"k-vstack\">\n <input\n #hexInput\n [id]=\"focusableId\"\n class=\"k-textbox k-hex-value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"hex || ''\"\n (blur)=\"handleHexInputBlur()\"\n (input)=\"handleHexValueChange(hexInput.value)\"\n />\n <label [for]=\"focusableId\" class=\"k-colorgradient-input-label\">HEX</label>\n </div>\n <ng-container *ngIf=\"formatView === 'rgba'\">\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #red\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.r\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"red.focusableId\" class=\"k-colorgradient-input-label\">R</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #green\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.g\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"green.focusableId\" class=\"k-colorgradient-input-label\">G</label>\n </div>\n <div class=\"k-vstack\">\n <kendo-numerictextbox\n #blue\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"255\"\n [(value)]=\"rgba.b\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [format]=\"'n'\"\n [decimals]=\"0\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"blue.focusableId\" class=\"k-colorgradient-input-label\">B</label>\n </div>\n <div class=\"k-vstack\" *ngIf=\"opacity\">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [min]=\"0\"\n [max]=\"1\"\n [(value)]=\"rgba.a\"\n [autoCorrect]=\"true\"\n [spinners]=\"false\"\n [step]=\"0.01\"\n [format]=\"'n2'\"\n [decimals]=\"2\"\n (blur)=\"handleRgbaInputBlur()\"\n (valueChange)=\"handleRgbaValueChange()\">\n </kendo-numerictextbox>\n <label [for]=\"alpha.focusableId\" class=\"k-colorgradient-input-label\">A</label>\n </div>\n </ng-container>\n "
7842
8048
  }),
7843
- __metadata("design:paramtypes", [LocalizationService,
7844
- ElementRef,
7845
- Renderer2])
8049
+ __metadata("design:paramtypes", [ElementRef,
8050
+ Renderer2,
8051
+ LocalizationService])
7846
8052
  ], ColorInputComponent);
7847
8053
  return ColorInputComponent;
7848
8054
  }());
7849
8055
 
7850
- /**
7851
- * @hidden
7852
- */
7853
- var DEFAULT_OUTPUT_FORMAT = 'rgba';
7854
- /**
7855
- * @hidden
7856
- */
7857
- var DEFAULT_GRADIENT_BACKGROUND_COLOR = 'rgba(255, 0, 0, 1)';
7858
- /**
7859
- * @hidden
7860
- */
7861
- var DRAGHANDLE_MOVE_SPEED = 5;
7862
- /**
7863
- * @hidden
7864
- */
7865
- var AAA_RATIO = 7.0;
7866
- /**
7867
- * @hidden
7868
- */
7869
- var AA_RATIO = 4.5;
7870
-
7871
8056
  var serial = 0;
7872
8057
  /**
7873
8058
  * The ColorGradient component enables smooth color transitions and provides options for selecting specific colors over the drag handle.
@@ -7881,9 +8066,6 @@ var ColorGradientComponent = /** @class */ (function () {
7881
8066
  this.renderer = renderer;
7882
8067
  this.cdr = cdr;
7883
8068
  this.localizationService = localizationService;
7884
- /**
7885
- * @hidden
7886
- */
7887
8069
  this.hostClasses = true;
7888
8070
  /**
7889
8071
  * @hidden
@@ -7891,18 +8073,26 @@ var ColorGradientComponent = /** @class */ (function () {
7891
8073
  this.id = "k-colorgradient-" + serial++;
7892
8074
  /**
7893
8075
  * Defines whether the alpha slider will be displayed.
8076
+ *
8077
+ * @default true
7894
8078
  */
7895
8079
  this.opacity = true;
7896
8080
  /**
7897
8081
  * Sets the disabled state of the ColorGradient.
8082
+ *
8083
+ * @default false
7898
8084
  */
7899
8085
  this.disabled = false;
7900
8086
  /**
7901
8087
  * Sets the read-only state of the ColorGradient.
8088
+ *
8089
+ * @default false
7902
8090
  */
7903
8091
  this.readonly = false;
7904
8092
  /**
7905
8093
  * Specifies whether the ColorGradient should display a 'Clear color' button.
8094
+ *
8095
+ * @default false
7906
8096
  */
7907
8097
  this.clearButton = false;
7908
8098
  /**
@@ -7911,6 +8101,16 @@ var ColorGradientComponent = /** @class */ (function () {
7911
8101
  * @default 0
7912
8102
  */
7913
8103
  this.delay = 0;
8104
+ /**
8105
+ * Specifies the output format of the ColorGradientComponent.
8106
+ * The input value may be in a different format, but it will be parsed into the output `format`
8107
+ * after the component processes it.
8108
+ *
8109
+ * The supported values are:
8110
+ * * (Default) `rgba`
8111
+ * * `hex`
8112
+ */
8113
+ this.format = DEFAULT_OUTPUT_FORMAT;
7914
8114
  /**
7915
8115
  * Fires each time the user selects a new color.
7916
8116
  */
@@ -7926,17 +8126,7 @@ var ColorGradientComponent = /** @class */ (function () {
7926
8126
  * The values are initially set in `ngOnInit` or in `ngOnChanges` and are
7927
8127
  * updated on moving the drag handle or the sliders.
7928
8128
  */
7929
- this.hsva = {};
7930
- /**
7931
- * Specifies the output format of the ColorGradientComponent.
7932
- * The input value may be in a different format. However, it will be parsed into the output `format`
7933
- * after the component processes it.
7934
- *
7935
- * The supported values are:
7936
- * * (Default) `rgba`
7937
- * * `hex`
7938
- */
7939
- this.format = DEFAULT_OUTPUT_FORMAT;
8129
+ this.hsva = new BehaviorSubject({});
7940
8130
  this._tabindex = 0;
7941
8131
  this.listeners = [];
7942
8132
  this.updateValues = new Subject();
@@ -7949,9 +8139,6 @@ var ColorGradientComponent = /** @class */ (function () {
7949
8139
  }
7950
8140
  ColorGradientComponent_1 = ColorGradientComponent;
7951
8141
  Object.defineProperty(ColorGradientComponent.prototype, "readonlyAttribute", {
7952
- /**
7953
- * @hidden
7954
- */
7955
8142
  get: function () {
7956
8143
  return this.readonly;
7957
8144
  },
@@ -7959,31 +8146,22 @@ var ColorGradientComponent = /** @class */ (function () {
7959
8146
  configurable: true
7960
8147
  });
7961
8148
  Object.defineProperty(ColorGradientComponent.prototype, "disabledClass", {
7962
- /**
7963
- * @hidden
7964
- */
7965
8149
  get: function () {
7966
8150
  return this.disabled;
7967
8151
  },
7968
8152
  enumerable: true,
7969
8153
  configurable: true
7970
8154
  });
7971
- Object.defineProperty(ColorGradientComponent.prototype, "hostTabindex", {
7972
- /**
7973
- * @hidden
7974
- */
8155
+ Object.defineProperty(ColorGradientComponent.prototype, "gradientId", {
7975
8156
  get: function () {
7976
- return this.tabindex;
8157
+ return this.id;
7977
8158
  },
7978
8159
  enumerable: true,
7979
8160
  configurable: true
7980
8161
  });
7981
- Object.defineProperty(ColorGradientComponent.prototype, "gradientId", {
7982
- /**
7983
- * @hidden
7984
- */
8162
+ Object.defineProperty(ColorGradientComponent.prototype, "hostTabindex", {
7985
8163
  get: function () {
7986
- return this.id;
8164
+ return this.tabindex;
7987
8165
  },
7988
8166
  enumerable: true,
7989
8167
  configurable: true
@@ -7996,7 +8174,21 @@ var ColorGradientComponent = /** @class */ (function () {
7996
8174
  * Specifies the value of the initially selected color.
7997
8175
  */
7998
8176
  set: function (value) {
7999
- this._value = parseColor$1(value, this.format);
8177
+ this._value = parseColor$1(value, this.format, this.opacity);
8178
+ },
8179
+ enumerable: true,
8180
+ configurable: true
8181
+ });
8182
+ Object.defineProperty(ColorGradientComponent.prototype, "contrastTool", {
8183
+ get: function () {
8184
+ return this._contrastTool;
8185
+ },
8186
+ /**
8187
+ * Enables the color contrast tool. Accepts the background color that will be compared to the selected value.
8188
+ * The tool will calculate the contrast ratio between the two colors.
8189
+ */
8190
+ set: function (value) {
8191
+ this._contrastTool = parseColor$1(value, this.format, this.opacity);
8000
8192
  },
8001
8193
  enumerable: true,
8002
8194
  configurable: true
@@ -8007,11 +8199,18 @@ var ColorGradientComponent = /** @class */ (function () {
8007
8199
  },
8008
8200
  /**
8009
8201
  * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
8202
+ *
8203
+ * @default 0
8010
8204
  */
8011
8205
  set: function (value) {
8012
- var tabindex = Number(value);
8013
- var defaultValue = 0;
8014
- this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
8206
+ if (isPresent(value)) {
8207
+ var tabindex = Number(value);
8208
+ this._tabindex = !isNaN(tabindex) ? tabindex : 0;
8209
+ }
8210
+ else {
8211
+ // Allows removal of the tabindex attribute
8212
+ this._tabindex = value;
8213
+ }
8015
8214
  },
8016
8215
  enumerable: true,
8017
8216
  configurable: true
@@ -8035,10 +8234,10 @@ var ColorGradientComponent = /** @class */ (function () {
8035
8234
  */
8036
8235
  get: function () {
8037
8236
  // setting the initial value to undefined to force the slider to recalculate the height of the slider track on the next cdr run
8038
- if (!(isPresent(this.hsva) && isPresent(this.hsva.a))) {
8237
+ if (!(isPresent(this.hsva.value) && isPresent(this.hsva.value.a))) {
8039
8238
  return;
8040
8239
  }
8041
- return this.hsva.a * 100;
8240
+ return this.hsva.value.a * 100;
8042
8241
  },
8043
8242
  enumerable: true,
8044
8243
  configurable: true
@@ -8055,7 +8254,7 @@ var ColorGradientComponent = /** @class */ (function () {
8055
8254
  * @hidden
8056
8255
  */
8057
8256
  get: function () {
8058
- return typeof this.contrastTool === 'string' && this.contrastTool !== '';
8257
+ return this.contrastTool && this.contrastTool.length > 0;
8059
8258
  },
8060
8259
  enumerable: true,
8061
8260
  configurable: true
@@ -8089,7 +8288,7 @@ var ColorGradientComponent = /** @class */ (function () {
8089
8288
  if (this.disabled) {
8090
8289
  return;
8091
8290
  }
8092
- this.host.nativeElement.focus();
8291
+ this.gradientDragHandle.nativeElement.focus();
8093
8292
  };
8094
8293
  /**
8095
8294
  * @hidden
@@ -8127,7 +8326,7 @@ var ColorGradientComponent = /** @class */ (function () {
8127
8326
  return;
8128
8327
  }
8129
8328
  this.renderer.removeClass(this.gradientWrapper.nativeElement, 'k-dragging');
8130
- this.handleValueChange(getColorFromHSV(this.hsva));
8329
+ this.handleValueChange(getColorFromHSV(this.hsva.value, this.format, this.opacity));
8131
8330
  };
8132
8331
  /**
8133
8332
  * @hidden
@@ -8174,15 +8373,19 @@ var ColorGradientComponent = /** @class */ (function () {
8174
8373
  return;
8175
8374
  }
8176
8375
  this.gradientDragHandle.nativeElement.focus();
8177
- var newX = position.clientX - this.gradientRect.left;
8178
- var newY = position.clientY - this.gradientRect.top;
8376
+ var gradientRect = this.gradientRect;
8377
+ var newX = position.clientX - gradientRect.left;
8378
+ var newY = position.clientY - gradientRect.top;
8179
8379
  this.ngZone.run(function () { return _this.moveDragHandle(newX, newY); });
8180
8380
  };
8181
8381
  /**
8182
8382
  * @hidden
8183
8383
  */
8184
8384
  ColorGradientComponent.prototype.handleHueSliderChange = function (hue) {
8185
- this.handleValueChange(getColorFromHSV(this.hsva));
8385
+ var hsva = this.hsva.value;
8386
+ hsva.h = hue;
8387
+ this.hsva.next(hsva);
8388
+ this.handleValueChange(getColorFromHSV(this.hsva.value, this.format, this.opacity));
8186
8389
  this.backgroundColor = getColorFromHue(hue);
8187
8390
  this.setAlphaSliderBackground(this.backgroundColor);
8188
8391
  };
@@ -8190,14 +8393,16 @@ var ColorGradientComponent = /** @class */ (function () {
8190
8393
  * @hidden
8191
8394
  */
8192
8395
  ColorGradientComponent.prototype.handleAlphaSliderChange = function (alpha) {
8193
- this.hsva.a = alpha / 100;
8194
- this.handleValueChange(getColorFromHSV(this.hsva));
8396
+ var hsva = this.hsva.value;
8397
+ hsva.a = alpha / 100;
8398
+ this.hsva.next(hsva);
8399
+ this.handleValueChange(getColorFromHSV(this.hsva.value, this.format, this.opacity));
8195
8400
  };
8196
8401
  /**
8197
8402
  * @hidden
8198
8403
  */
8199
8404
  ColorGradientComponent.prototype.handleInputsValueChange = function (color) {
8200
- var parsed = parseColor$1(color, this.format);
8405
+ var parsed = parseColor$1(color, this.format, this.opacity);
8201
8406
  if (this.value !== parsed) {
8202
8407
  this.handleValueChange(parsed);
8203
8408
  this.updateUI();
@@ -8246,7 +8451,7 @@ var ColorGradientComponent = /** @class */ (function () {
8246
8451
  * @hidden
8247
8452
  */
8248
8453
  get: function () {
8249
- var parsed = parseColor$1(this.value, this.format);
8454
+ var parsed = parseColor$1(this.value, this.format, this.opacity);
8250
8455
  return "" + (this.value ? parsed : this.localizationService.get('colorGradientHandle'));
8251
8456
  },
8252
8457
  enumerable: true,
@@ -8284,29 +8489,35 @@ var ColorGradientComponent = /** @class */ (function () {
8284
8489
  });
8285
8490
  /**
8286
8491
  * @hidden
8287
- * Used by the TextBoxContainer to determine if the component is empty.
8492
+ * Used by the FloatingLabel to determine if the component is empty.
8288
8493
  */
8289
8494
  ColorGradientComponent.prototype.isEmpty = function () {
8290
8495
  return false;
8291
8496
  };
8292
8497
  ColorGradientComponent.prototype.moveDragHandle = function (positionX, positionY) {
8293
- var top = fitIntoBounds(positionY, 0, this.gradientRect.height);
8294
- var left = fitIntoBounds(positionX, 0, this.gradientRect.width);
8498
+ var gradientRect = this.gradientRect;
8499
+ var gradientRectWidth = gradientRect.width;
8500
+ var gradientRectHeight = gradientRect.height;
8501
+ var top = fitIntoBounds(positionY, 0, gradientRectHeight);
8502
+ var left = fitIntoBounds(positionX, 0, gradientRectWidth);
8295
8503
  this.setDragHandleElementPosition(top, left);
8296
- this.hsva.s = left / this.gradientRect.width;
8297
- this.hsva.v = 1 - top / this.gradientRect.height;
8298
- this.updateValues.next(getColorFromHSV(this.hsva));
8299
- this.setAlphaSliderBackground(getColorFromHSV(__assign({}, this.hsva, { a: 1 })));
8504
+ var hsva = this.hsva.value;
8505
+ hsva.s = left / gradientRectWidth;
8506
+ hsva.v = 1 - top / gradientRectHeight;
8507
+ this.hsva.next(hsva);
8508
+ this.updateValues.next(getColorFromHSV(this.hsva.value, this.format, this.opacity));
8509
+ this.setAlphaSliderBackground(getColorFromHSV(__assign({}, this.hsva.value, { a: 1 }), this.format, this.opacity));
8300
8510
  };
8301
8511
  ColorGradientComponent.prototype.updateUI = function () {
8302
8512
  if (!isDocumentAvailable()) {
8303
8513
  return;
8304
8514
  }
8305
- this.hsva = this.value ? getHSV(this.value) : { h: 0, s: 0, v: 1, a: 1 };
8306
- var top = (1 - this.hsva.v) * this.gradientRect.height;
8307
- var left = this.hsva.s * this.gradientRect.width;
8515
+ this.hsva.next(this.value ? getHSV(this.value) : { h: 0, s: 0, v: 1, a: 1 });
8516
+ var gradientRect = this.gradientRect;
8517
+ var top = (1 - this.hsva.value.v) * gradientRect.height;
8518
+ var left = this.hsva.value.s * gradientRect.width;
8308
8519
  this.setDragHandleElementPosition(top, left);
8309
- this.backgroundColor = getColorFromHue(this.hsva.h);
8520
+ this.backgroundColor = getColorFromHue(this.hsva.value.h);
8310
8521
  this.setAlphaSliderBackground(this.backgroundColor);
8311
8522
  this.setHostElementAriaLabel();
8312
8523
  };
@@ -8332,7 +8543,7 @@ var ColorGradientComponent = /** @class */ (function () {
8332
8543
  this.renderer.setStyle(sliderTrack, 'background', "linear-gradient(to top, transparent, " + backgroundColor + ")");
8333
8544
  };
8334
8545
  ColorGradientComponent.prototype.setHostElementAriaLabel = function () {
8335
- var parsed = parseColor$1(this.value, this.format);
8546
+ var parsed = parseColor$1(this.value, this.format, this.opacity);
8336
8547
  this.renderer.setAttribute(this.host.nativeElement, 'aria-label', "" + (this.value ? parsed : this.localizationService.get('colorGradientNoColor')));
8337
8548
  };
8338
8549
  ColorGradientComponent.prototype.addEventListeners = function () {
@@ -8349,7 +8560,7 @@ var ColorGradientComponent = /** @class */ (function () {
8349
8560
  var keyupListener = _this.renderer.listen(_this.gradientDragHandle.nativeElement, 'keyup', function () {
8350
8561
  _this.renderer.removeClass(_this.gradientWrapper.nativeElement, 'k-dragging');
8351
8562
  if (!_this.readonly && !_this.disabled) {
8352
- _this.ngZone.run(function () { return _this.handleValueChange(getColorFromHSV(_this.hsva)); });
8563
+ _this.ngZone.run(function () { return _this.handleValueChange(getColorFromHSV(_this.hsva.value, _this.format, _this.opacity)); });
8353
8564
  }
8354
8565
  });
8355
8566
  var dragHandleFocusInListener = _this.renderer.listen(_this.gradientDragHandle.nativeElement, 'focusin', function () {
@@ -8387,24 +8598,24 @@ var ColorGradientComponent = /** @class */ (function () {
8387
8598
  __metadata("design:type", Boolean),
8388
8599
  __metadata("design:paramtypes", [])
8389
8600
  ], ColorGradientComponent.prototype, "disabledClass", null);
8390
- __decorate([
8391
- HostBinding('attr.tabindex'),
8392
- __metadata("design:type", Number),
8393
- __metadata("design:paramtypes", [])
8394
- ], ColorGradientComponent.prototype, "hostTabindex", null);
8395
8601
  __decorate([
8396
8602
  HostBinding('attr.id'),
8397
8603
  __metadata("design:type", String),
8398
8604
  __metadata("design:paramtypes", [])
8399
8605
  ], ColorGradientComponent.prototype, "gradientId", null);
8400
- __decorate([
8401
- Input(),
8402
- __metadata("design:type", String)
8403
- ], ColorGradientComponent.prototype, "id", void 0);
8404
8606
  __decorate([
8405
8607
  HostBinding('attr.dir'),
8406
8608
  __metadata("design:type", String)
8407
8609
  ], ColorGradientComponent.prototype, "direction", void 0);
8610
+ __decorate([
8611
+ HostBinding('attr.tabindex'),
8612
+ __metadata("design:type", Number),
8613
+ __metadata("design:paramtypes", [])
8614
+ ], ColorGradientComponent.prototype, "hostTabindex", null);
8615
+ __decorate([
8616
+ Input(),
8617
+ __metadata("design:type", String)
8618
+ ], ColorGradientComponent.prototype, "id", void 0);
8408
8619
  __decorate([
8409
8620
  Input(),
8410
8621
  __metadata("design:type", Boolean)
@@ -8432,21 +8643,22 @@ var ColorGradientComponent = /** @class */ (function () {
8432
8643
  ], ColorGradientComponent.prototype, "value", null);
8433
8644
  __decorate([
8434
8645
  Input(),
8435
- __metadata("design:type", String)
8436
- ], ColorGradientComponent.prototype, "contrastTool", void 0);
8646
+ __metadata("design:type", String),
8647
+ __metadata("design:paramtypes", [String])
8648
+ ], ColorGradientComponent.prototype, "contrastTool", null);
8437
8649
  __decorate([
8438
8650
  Input(),
8439
8651
  __metadata("design:type", Number),
8440
8652
  __metadata("design:paramtypes", [Number])
8441
8653
  ], ColorGradientComponent.prototype, "tabindex", null);
8442
- __decorate([
8443
- Output(),
8444
- __metadata("design:type", EventEmitter)
8445
- ], ColorGradientComponent.prototype, "valueChange", void 0);
8446
8654
  __decorate([
8447
8655
  Input(),
8448
8656
  __metadata("design:type", String)
8449
8657
  ], ColorGradientComponent.prototype, "format", void 0);
8658
+ __decorate([
8659
+ Output(),
8660
+ __metadata("design:type", EventEmitter)
8661
+ ], ColorGradientComponent.prototype, "valueChange", void 0);
8450
8662
  __decorate([
8451
8663
  ViewChild('gradientDragHandle', { read: ElementRef, static: false }),
8452
8664
  __metadata("design:type", ElementRef)
@@ -8465,6 +8677,7 @@ var ColorGradientComponent = /** @class */ (function () {
8465
8677
  ], ColorGradientComponent.prototype, "gradientWrapper", void 0);
8466
8678
  ColorGradientComponent = ColorGradientComponent_1 = __decorate([
8467
8679
  Component({
8680
+ exportAs: 'kendoColorGradient',
8468
8681
  selector: 'kendo-colorgradient',
8469
8682
  providers: [
8470
8683
  {
@@ -8486,8 +8699,8 @@ var ColorGradientComponent = /** @class */ (function () {
8486
8699
  useValue: 'kendo.colorgradient'
8487
8700
  }
8488
8701
  ],
8489
- template: "\n <ng-container kendoColorGradientLocalizedMessages\n i18n-colorGradientNoColor=\"kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorgradient.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorgradient.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorgradient.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorgradient.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-hexInputPlaceholder=\"kendo.colorgradient.hexInputPlaceholder|The placeholder for the HEX color input.\"\n hexInputPlaceholder=\"HEX Color\"\n i18n-redInputPlaceholder=\"kendo.colorgradient.redInputPlaceholder|The placeholder for the red color input.\"\n redInputPlaceholder=\"Red\"\n i18n-greenInputPlaceholder=\"kendo.colorgradient.greenInputPlaceholder|The placeholder for the green color input.\"\n greenInputPlaceholder=\"Green\"\n i18n-blueInputPlaceholder=\"kendo.colorgradient.blueInputPlaceholder|The placeholder for the blue color input.\"\n blueInputPlaceholder=\"Blue\"\n i18n-alphaInputPlaceholder=\"kendo.colorgradient.alphaInputPlaceholder|The placeholder for the alpha input.\"\n alphaInputPlaceholder=\"Alpha\"\n i18n-passContrast=\"kendo.colorgradient.passContrast|The pass message for the contrast tool.\"\n passContrast=\"Pass\"\n i18n-failContrast=\"kendo.colorgradient.failContrast|The fail message for the contrast tool.\"\n failContrast=\"Fail\"\n i18n-contrastRatio=\"kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\">\n </ng-container>\n <div class=\"k-colorgradient-canvas k-hstack\">\n <div class=\"k-hsv-rectangle\" [style.background]=\"backgroundColor\">\n <div\n #gradientWrapper\n kendoDraggable\n class=\"k-hsv-gradient\"\n (click)=\"changePosition($event)\"\n (kendoPress)=\"handleDragPress($event)\"\n (kendoDrag)=\"onHandleDrag($event)\"\n (kendoRelease)=\"onHandleRelease()\">\n <div\n #gradientDragHandle\n class=\"k-hsv-draghandle k-draghandle\"\n tabindex=\"0\"\n [attr.title]=\"colorGradientHandleTitle\"\n [attr.aria-label]=\"colorGradientHandleAriaLabel\"\n >\n </div>\n </div>\n </div>\n <div class=\"k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}\">\n <span class=\"k-clear-color k-button k-flat k-button-icon\"\n *ngIf=\"clearButton\"\n (click)=\"reset()\"\n (keydown.enter)=\"reset()\"\n (keydown.space)=\"reset()\"\n [attr.aria-label]=\"clearButtonTitle\"\n [attr.title]=\"clearButtonTitle\"\n tabindex=\"0\">\n <span class=\"k-icon k-i-reset-color\"></span>\n </span>\n <kendo-slider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-hue-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"hueSliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"360\"\n [smallStep]=\"5\"\n [largeStep]=\"10\"\n [(value)]=\"hsva.h\"\n (valueChange)=\"handleHueSliderChange($event)\"\n >\n </kendo-slider>\n <kendo-slider\n *ngIf=\"opacity && format === 'rgba'\"\n #alphaSlider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-alpha-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"opacitySliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"100\"\n [smallStep]=\"1\"\n [largeStep]=\"10\"\n [value]=\"alphaSliderValue\"\n (valueChange)=\"handleAlphaSliderChange($event)\"\n >\n </kendo-slider>\n </div>\n </div>\n <kendo-colorinput #inputs\n [opacity]=\"opacity\"\n [formatView]=\"format\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (valueChange)=\"handleInputsValueChange($event)\"\n >\n </kendo-colorinput>\n <div class=\"k-colorgradient-color-contrast k-vbox\" *ngIf=\"contrastToolVisible\"\n kendoContrastTool\n [value]=\"value\"\n [ratio]=\"contrastTool\">\n </div>\n ",
8490
- styles: ["\n .k-clear-color {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-align-self-end {\n height: 140px;\n }\n "]
8702
+ template: "\n <ng-container kendoColorGradientLocalizedMessages\n i18n-colorGradientNoColor=\"kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorgradient.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorgradient.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorgradient.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorgradient.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-passContrast=\"kendo.colorgradient.passContrast|The pass message for the contrast tool.\"\n passContrast=\"Pass\"\n i18n-failContrast=\"kendo.colorgradient.failContrast|The fail message for the contrast tool.\"\n failContrast=\"Fail\"\n i18n-contrastRatio=\"kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-formatButton=\"kendo.colorgradient.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\">\n </ng-container>\n <div class=\"k-colorgradient-canvas k-hstack\">\n <div class=\"k-hsv-rectangle\" [style.background]=\"backgroundColor\">\n <div\n #gradientWrapper\n kendoDraggable\n class=\"k-hsv-gradient\"\n (click)=\"changePosition($event)\"\n (kendoPress)=\"handleDragPress($event)\"\n (kendoDrag)=\"onHandleDrag($event)\"\n (kendoRelease)=\"onHandleRelease()\">\n <div\n #gradientDragHandle\n class=\"k-hsv-draghandle k-draghandle\"\n tabindex=\"0\"\n [attr.title]=\"colorGradientHandleTitle\"\n [attr.aria-label]=\"colorGradientHandleAriaLabel\"\n >\n </div>\n </div>\n <svg kendoColorContrastSvg\n *ngIf=\"contrastToolVisible && gradientWrapper\"\n class=\"k-color-contrast-svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n [wrapper]=\"gradientWrapper ? gradientWrapper : undefined\"\n [hsva]=\"hsva\"\n [backgroundColor]=\"contrastTool\">\n </svg>\n </div>\n <div class=\"k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}\">\n <span class=\"k-clear-color k-button k-flat k-button-icon\"\n *ngIf=\"clearButton\"\n (click)=\"reset()\"\n (keydown.enter)=\"reset()\"\n (keydown.space)=\"reset()\"\n [attr.aria-label]=\"clearButtonTitle\"\n [attr.title]=\"clearButtonTitle\"\n tabindex=\"0\">\n <span class=\"k-icon k-i-reset-color\"></span>\n </span>\n <kendo-slider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-hue-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"hueSliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"360\"\n [smallStep]=\"5\"\n [largeStep]=\"10\"\n [value]=\"hsva.value.h\"\n (valueChange)=\"handleHueSliderChange($event)\"\n >\n </kendo-slider>\n <kendo-slider\n *ngIf=\"opacity\"\n #alphaSlider\n [ngClass]=\"{'k-align-self-end': clearButton}\"\n class=\"k-alpha-slider k-colorgradient-slider\"\n [dragHandleTitle]=\"opacitySliderTitle\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [showButtons]=\"false\"\n [tickPlacement]=\"'none'\"\n [vertical]=\"true\"\n [min]=\"0\"\n [max]=\"100\"\n [smallStep]=\"1\"\n [largeStep]=\"10\"\n [value]=\"alphaSliderValue\"\n (valueChange)=\"handleAlphaSliderChange($event)\"\n >\n </kendo-slider>\n </div>\n </div>\n <kendo-colorinput #inputs\n [opacity]=\"opacity\"\n [formatView]=\"format\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (valueChange)=\"handleInputsValueChange($event)\"\n >\n </kendo-colorinput>\n <div class=\"k-colorgradient-color-contrast k-vbox\" *ngIf=\"contrastToolVisible\"\n kendoContrastTool\n [value]=\"value\"\n [ratio]=\"contrastTool\">\n </div>\n ",
8703
+ styles: ["\n .k-clear-color {\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-colorgradient-slider.k-align-self-end {\n height: 140px;\n }\n\n .k-color-contrast-svg {\n position: absolute;\n overflow: visible;\n pointer-events: none;\n left: 0px;\n top: 0px;\n }\n "]
8491
8704
  }),
8492
8705
  __metadata("design:paramtypes", [ElementRef,
8493
8706
  NgZone,
@@ -8498,148 +8711,237 @@ var ColorGradientComponent = /** @class */ (function () {
8498
8711
  return ColorGradientComponent;
8499
8712
  }());
8500
8713
 
8501
- var DEFAULT_PRESET = 'office';
8502
- var DEFAULT_ACCESSIBLE_PRESET = 'accessible';
8714
+ /**
8715
+ * @hidden
8716
+ */
8717
+ var ColorPaletteService = /** @class */ (function () {
8718
+ function ColorPaletteService() {
8719
+ this.colorRows = [];
8720
+ }
8721
+ ColorPaletteService.prototype.setColorMatrix = function (palette, columns) {
8722
+ this.colorRows = [];
8723
+ if (!(isPresent(palette) && palette.length)) {
8724
+ return;
8725
+ }
8726
+ columns = columns || palette.length;
8727
+ for (var start = 0; start < palette.length; start += columns) {
8728
+ var row = palette.slice(start, columns + start);
8729
+ this.colorRows.push(row);
8730
+ }
8731
+ };
8732
+ ColorPaletteService.prototype.getCellCoordsFor = function (color) {
8733
+ if (!isPresent(color)) {
8734
+ return;
8735
+ }
8736
+ for (var row = 0; row < this.colorRows.length; row++) {
8737
+ for (var col = 0; col < this.colorRows[row].length; col++) {
8738
+ if (this.colorRows[row][col] === color) {
8739
+ return { row: row, col: col };
8740
+ }
8741
+ }
8742
+ }
8743
+ };
8744
+ ColorPaletteService.prototype.getColorAt = function (cellCoords) {
8745
+ if (!(isPresent(cellCoords) && isPresent(this.colorRows[cellCoords.row]))) {
8746
+ return;
8747
+ }
8748
+ return this.colorRows[cellCoords.row][cellCoords.col];
8749
+ };
8750
+ ColorPaletteService.prototype.getNextCell = function (current, horizontalStep, verticalStep) {
8751
+ if (!(isPresent(current) && isPresent(current.row) && isPresent(current.col))) {
8752
+ return { row: 0, col: 0 };
8753
+ }
8754
+ var row = this.clampIndex(current.row + verticalStep, this.colorRows.length - 1);
8755
+ var col = this.clampIndex(current.col + horizontalStep, this.colorRows[row].length - 1);
8756
+ return { row: row, col: col };
8757
+ };
8758
+ ColorPaletteService.prototype.clampIndex = function (index, max) {
8759
+ var minArrayIndex = 0;
8760
+ if (index < minArrayIndex) {
8761
+ return minArrayIndex;
8762
+ }
8763
+ if (index > max) {
8764
+ return max;
8765
+ }
8766
+ return index;
8767
+ };
8768
+ ColorPaletteService = __decorate([
8769
+ Injectable()
8770
+ ], ColorPaletteService);
8771
+ return ColorPaletteService;
8772
+ }());
8773
+
8774
+ /**
8775
+ * @hidden
8776
+ */
8777
+ var ColorPaletteLocalizationService = /** @class */ (function (_super) {
8778
+ __extends(ColorPaletteLocalizationService, _super);
8779
+ function ColorPaletteLocalizationService(prefix, messageService, _rtl, flatColorPickerLocalization) {
8780
+ var _this = _super.call(this, prefix, messageService, _rtl) || this;
8781
+ _this.flatColorPickerLocalization = flatColorPickerLocalization;
8782
+ return _this;
8783
+ }
8784
+ ColorPaletteLocalizationService.prototype.get = function (shortKey) {
8785
+ if (this.flatColorPickerLocalization) {
8786
+ return this.flatColorPickerLocalization.get(shortKey);
8787
+ }
8788
+ return _super.prototype.get.call(this, shortKey);
8789
+ };
8790
+ ColorPaletteLocalizationService = __decorate([
8791
+ __param(0, Inject(L10N_PREFIX)),
8792
+ __param(1, Optional()),
8793
+ __param(2, Optional()), __param(2, Inject(RTL)),
8794
+ __param(3, Optional()), __param(3, Inject(FlatColorPickerLocalizationService)),
8795
+ __metadata("design:paramtypes", [String, MessageService, Boolean, FlatColorPickerLocalizationService])
8796
+ ], ColorPaletteLocalizationService);
8797
+ return ColorPaletteLocalizationService;
8798
+ }(LocalizationService));
8799
+
8800
+ var DEFAULT_TILE_SIZE = 24;
8801
+ var DEFAULT_COLUMNS_COUNT = 10;
8802
+ var DEFAULT_PRESET$1 = 'office';
8803
+ var DEFAULT_ACCESSIBLE_PRESET$1 = 'accessible';
8503
8804
  var serial$1 = 0;
8504
8805
  /**
8505
- * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
8506
- * Designed to replace the `<input type="color">` HTML5 tag which is not widely supported in browsers.
8806
+ * The ColorPalette component provides a set of predefined palette presets and enables you to implement a custom color palette.
8807
+ * The ColorPalette is independently used by `kendo-colorpicker` and can be directly added to the page.
8507
8808
  */
8508
- var ColorPickerComponent = /** @class */ (function () {
8509
- function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
8809
+ var ColorPaletteComponent = /** @class */ (function () {
8810
+ function ColorPaletteComponent(host, service, cdr, renderer, localizationService) {
8510
8811
  var _this = this;
8511
- this.popupService = popupService;
8812
+ this.host = host;
8813
+ this.service = service;
8512
8814
  this.cdr = cdr;
8815
+ this.renderer = renderer;
8513
8816
  this.localizationService = localizationService;
8514
- this.ngZone = ngZone;
8515
8817
  /**
8516
8818
  * @hidden
8517
8819
  */
8518
- this.hostClasses = true;
8820
+ this.id = "k-colorpalette-" + serial$1++;
8519
8821
  /**
8520
- * @hidden
8822
+ * Specifies the output format of the ColorPaletteComponent.
8823
+ * The input value may be in a different format. However, it will be parsed into the output `format`
8824
+ * after the component processes it.
8825
+ *
8826
+ * The supported values are:
8827
+ * * (Default) `hex`
8828
+ * * `rgba`
8829
+ * * `name`
8521
8830
  */
8522
- this.focusableId = "k-colorpicker-" + serial$1++;
8831
+ this.format = 'hex';
8523
8832
  /**
8524
- * Sets what view the ColorPicker will render in the popup.
8833
+ * Sets the disabled state of the ColorPalette.
8525
8834
  */
8526
- this.view = 'gradient';
8835
+ this.disabled = false;
8527
8836
  /**
8528
- * Sets the read-only state of the ColorPicker.
8837
+ * Sets the read-only state of the ColorPalette.
8529
8838
  */
8530
8839
  this.readonly = false;
8531
8840
  /**
8532
- * Sets the disabled state of the ColorPicker.
8841
+ * Specifies the size of a color cell.
8842
+ *
8843
+ * The possible values are:
8844
+ * * (Default) `tileSize = 24`
8845
+ * * `{ width: number, height: number }`
8533
8846
  */
8534
- this.disabled = false;
8847
+ this.tileSize = { width: DEFAULT_TILE_SIZE, height: DEFAULT_TILE_SIZE };
8535
8848
  /**
8536
- * Specifies the output format of the ColorPicker.
8537
- * The input value may be in a different format. However, it will be parsed into the output `format`
8538
- * after the component processes it.
8539
- *
8540
- * If the `gradient` view is used with the `opacity` option set to true, this setting will be ignored and `rgba` will be used instead.
8541
- *
8542
- * The supported values are:
8543
- * * `rgba` (default)
8544
- * * `hex`
8545
- * * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
8849
+ * Fires each time the color selection is changed.
8546
8850
  */
8547
- this.format = 'rgba';
8851
+ this.selectionChange = new EventEmitter();
8548
8852
  /**
8549
8853
  * Fires each time the value is changed.
8550
8854
  */
8551
8855
  this.valueChange = new EventEmitter();
8552
8856
  /**
8553
- * Fires each time the popup is about to open.
8554
- * This event is preventable. If you cancel it, the popup will remain closed.
8555
- */
8556
- this.open = new EventEmitter();
8557
- /**
8558
- * Fires each time the popup is about to close.
8559
- * This event is preventable. If you cancel it, the popup will remain open.
8560
- */
8561
- this.close = new EventEmitter();
8562
- /**
8563
- * Fires each time ColorPicker is focused.
8857
+ * Fires each time the user selects a cell with the mouse or presses `Enter`.
8858
+ *
8859
+ * @hidden
8564
8860
  */
8565
- this.onFocus = new EventEmitter();
8861
+ this.cellSelection = new EventEmitter();
8566
8862
  /**
8567
- * Fires each time the ColorPicker is blurred.
8863
+ * @hidden
8568
8864
  */
8569
- this.onBlur = new EventEmitter();
8865
+ this.hostClasses = true;
8570
8866
  /**
8571
- * Fires each time the left side of the ColorPicker wrapper is clicked.
8572
- * The event is triggered regardless of whether a ColorPicker icon is set or not.
8573
- *
8574
- * The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
8867
+ * @hidden
8575
8868
  */
8576
- this.activeColorClick = new EventEmitter();
8869
+ this.uniqueId = guid();
8577
8870
  this._tabindex = 0;
8578
- this._popupSettings = { animate: true };
8579
- this._paletteSettings = {};
8580
- this._gradientSettings = { opacity: true, clearButton: false, delay: 0 };
8581
8871
  this.notifyNgTouched = function () { };
8582
8872
  this.notifyNgChanged = function () { };
8583
- validatePackage(packageMetadata);
8584
- this.dynamicRTLSubscription = this.localizationService.changes.subscribe(function (_a) {
8873
+ this.dynamicRTLSubscription = localizationService.changes.subscribe(function (_a) {
8585
8874
  var rtl = _a.rtl;
8586
8875
  _this.direction = rtl ? 'rtl' : 'ltr';
8587
8876
  });
8588
8877
  }
8589
- ColorPickerComponent_1 = ColorPickerComponent;
8590
- Object.defineProperty(ColorPickerComponent.prototype, "value", {
8591
- get: function () {
8592
- return this._value;
8593
- },
8878
+ ColorPaletteComponent_1 = ColorPaletteComponent;
8879
+ Object.defineProperty(ColorPaletteComponent.prototype, "paletteId", {
8594
8880
  /**
8595
- * Specifies the value of the initially selected color.
8881
+ * @hidden
8596
8882
  */
8597
- set: function (value) {
8598
- this._value = parseColor$1(value, this.format);
8883
+ get: function () {
8884
+ return this.id;
8599
8885
  },
8600
8886
  enumerable: true,
8601
8887
  configurable: true
8602
8888
  });
8603
- Object.defineProperty(ColorPickerComponent.prototype, "popupSettings", {
8889
+ Object.defineProperty(ColorPaletteComponent.prototype, "value", {
8604
8890
  get: function () {
8605
- return this._popupSettings;
8891
+ return this._value;
8606
8892
  },
8607
8893
  /**
8608
- * Configures the popup of the ColorPicker.
8894
+ * Specifies the value of the initially selected color.
8609
8895
  */
8610
8896
  set: function (value) {
8611
- this._popupSettings = Object.assign(this._popupSettings, value);
8897
+ this._value = parseColor$1(value, this.format);
8612
8898
  },
8613
8899
  enumerable: true,
8614
8900
  configurable: true
8615
8901
  });
8616
- Object.defineProperty(ColorPickerComponent.prototype, "paletteSettings", {
8902
+ Object.defineProperty(ColorPaletteComponent.prototype, "columns", {
8617
8903
  get: function () {
8618
- return this._paletteSettings;
8904
+ return this._columns;
8619
8905
  },
8620
8906
  /**
8621
- * Configures the palette that is displayed in the ColorPicker popup.
8907
+ * Specifies the number of columns that will be displayed.
8908
+ * Defaults to `10`.
8622
8909
  */
8623
8910
  set: function (value) {
8624
- this._paletteSettings = Object.assign(this._paletteSettings, value);
8911
+ var minColumnsCount = 1;
8912
+ this._columns = value > minColumnsCount ? value : minColumnsCount;
8625
8913
  },
8626
8914
  enumerable: true,
8627
8915
  configurable: true
8628
8916
  });
8629
- Object.defineProperty(ColorPickerComponent.prototype, "gradientSettings", {
8917
+ Object.defineProperty(ColorPaletteComponent.prototype, "palette", {
8630
8918
  get: function () {
8631
- return this._gradientSettings;
8919
+ return this._palette;
8632
8920
  },
8633
8921
  /**
8634
- * Configures the gradient that is displayed in the ColorPicker popup.
8922
+ * The color palette that will be displayed.
8923
+ *
8924
+ * The supported values are:
8925
+ * * The name of the predefined palette preset (for example, `office`, `basic`, and `apex`).
8926
+ * * A string with comma-separated colors.
8927
+ * * A string array.
8635
8928
  */
8636
8929
  set: function (value) {
8637
- this._gradientSettings = Object.assign(this._gradientSettings, value);
8930
+ var _this = this;
8931
+ if (!isPresent(value)) {
8932
+ value = DEFAULT_PRESET$1;
8933
+ }
8934
+ if (typeof value === 'string' && isPresent(PALETTEPRESETS[value])) {
8935
+ this.columns = this.columns || PALETTEPRESETS[value].columns;
8936
+ value = PALETTEPRESETS[value].colors;
8937
+ }
8938
+ var colors = (typeof value === 'string') ? value.split(',') : value;
8939
+ this._palette = colors.map(function (color) { return parseColor$1(color, _this.format, false, false); });
8638
8940
  },
8639
8941
  enumerable: true,
8640
8942
  configurable: true
8641
8943
  });
8642
- Object.defineProperty(ColorPickerComponent.prototype, "tabindex", {
8944
+ Object.defineProperty(ColorPaletteComponent.prototype, "tabindex", {
8643
8945
  get: function () {
8644
8946
  return !this.disabled ? this._tabindex : undefined;
8645
8947
  },
@@ -8654,603 +8956,1133 @@ var ColorPickerComponent = /** @class */ (function () {
8654
8956
  enumerable: true,
8655
8957
  configurable: true
8656
8958
  });
8657
- Object.defineProperty(ColorPickerComponent.prototype, "isOpen", {
8959
+ Object.defineProperty(ColorPaletteComponent.prototype, "tileLayout", {
8658
8960
  /**
8659
- * Indicates whether the ColorPicker popup is open.
8961
+ * @hidden
8660
8962
  */
8661
8963
  get: function () {
8662
- return isPresent(this.popupRef);
8964
+ if (typeof this.tileSize !== 'number') {
8965
+ return this.tileSize;
8966
+ }
8967
+ return { width: this.tileSize, height: this.tileSize };
8663
8968
  },
8664
8969
  enumerable: true,
8665
8970
  configurable: true
8666
8971
  });
8667
- Object.defineProperty(ColorPickerComponent.prototype, "iconStyles", {
8972
+ Object.defineProperty(ColorPaletteComponent.prototype, "colorRows", {
8668
8973
  /**
8669
8974
  * @hidden
8670
8975
  */
8671
8976
  get: function () {
8672
- if (this.iconClass) {
8673
- return this.iconClass;
8674
- }
8675
- if (this.icon) {
8676
- return "k-icon k-i-" + this.icon;
8677
- }
8977
+ return this.service.colorRows;
8678
8978
  },
8679
8979
  enumerable: true,
8680
8980
  configurable: true
8681
8981
  });
8682
- ColorPickerComponent.prototype.ngOnInit = function () {
8683
- var defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
8684
- var settingsPalette = this._paletteSettings.palette;
8685
- var presetColumns = typeof settingsPalette === 'string' && PALETTEPRESETS[settingsPalette] ?
8686
- PALETTEPRESETS[settingsPalette].columns :
8687
- undefined;
8688
- this._paletteSettings = {
8689
- palette: settingsPalette || defaultPreset,
8690
- tileSize: this._paletteSettings.tileSize || 24,
8691
- columns: this._paletteSettings.columns || presetColumns || 10
8692
- };
8693
- };
8694
- ColorPickerComponent.prototype.ngOnChanges = function (changes) {
8695
- if (changes.format && changes.format.currentValue === 'name') {
8696
- this.view = 'palette';
8697
- }
8698
- if (this.view === 'gradient' && this.gradientSettings.opacity) {
8699
- this.format = 'rgba';
8700
- this.value = parseColor$1(this.value, this.format);
8982
+ Object.defineProperty(ColorPaletteComponent.prototype, "hostTabindex", {
8983
+ /**
8984
+ * @hidden
8985
+ */
8986
+ get: function () { return this.tabindex; },
8987
+ enumerable: true,
8988
+ configurable: true
8989
+ });
8990
+ Object.defineProperty(ColorPaletteComponent.prototype, "disabledClass", {
8991
+ /**
8992
+ * @hidden
8993
+ */
8994
+ get: function () { return this.disabled; },
8995
+ enumerable: true,
8996
+ configurable: true
8997
+ });
8998
+ Object.defineProperty(ColorPaletteComponent.prototype, "readonlyAttribute", {
8999
+ /**
9000
+ * @hidden
9001
+ */
9002
+ get: function () { return this.readonly; },
9003
+ enumerable: true,
9004
+ configurable: true
9005
+ });
9006
+ ColorPaletteComponent.prototype.ngOnInit = function () {
9007
+ if (this.colorRows.length === 0) {
9008
+ var defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET$1 : DEFAULT_ACCESSIBLE_PRESET$1;
9009
+ this.palette = this.palette || defaultPreset;
9010
+ this.setRows();
9011
+ this.focusedCell = this.service.getCellCoordsFor(this.value);
8701
9012
  }
8702
9013
  };
8703
- ColorPickerComponent.prototype.ngOnDestroy = function () {
8704
- this.closePopup();
9014
+ ColorPaletteComponent.prototype.ngAfterViewInit = function () {
9015
+ this.setHostElementAriaLabel();
9016
+ };
9017
+ ColorPaletteComponent.prototype.ngOnDestroy = function () {
8705
9018
  if (this.dynamicRTLSubscription) {
8706
9019
  this.dynamicRTLSubscription.unsubscribe();
8707
9020
  }
8708
9021
  };
8709
- /**
8710
- * @hidden
8711
- */
8712
- ColorPickerComponent.prototype.handleWrapperClick = function () {
8713
- this.toggleWithEvents(!this.isOpen);
8714
- this.focus();
9022
+ ColorPaletteComponent.prototype.ngOnChanges = function (changes) {
9023
+ if (changes.palette || changes.columns) {
9024
+ this.setRows();
9025
+ }
9026
+ if (changes.palette || changes.value || changes.columns) {
9027
+ this.focusedCell = this.service.getCellCoordsFor(this.value);
9028
+ this.setHostElementAriaLabel();
9029
+ }
8715
9030
  };
8716
9031
  /**
8717
9032
  * @hidden
8718
9033
  */
8719
- ColorPickerComponent.prototype.handleActiveColorClick = function () {
8720
- this.focus();
8721
- var event = new ActiveColorClickEvent(this.value);
8722
- this.activeColorClick.emit(event);
8723
- if (!event.isOpenPrevented() || this.isOpen) {
8724
- this.handleWrapperClick();
9034
+ ColorPaletteComponent.prototype.handleKeydown = function (event) {
9035
+ var isRTL = this.direction === 'rtl';
9036
+ switch (event.keyCode) {
9037
+ case Keys.ArrowDown:
9038
+ this.handleCellNavigation(0, 1);
9039
+ break;
9040
+ case Keys.ArrowUp:
9041
+ this.handleCellNavigation(0, -1);
9042
+ break;
9043
+ case Keys.ArrowRight:
9044
+ this.handleCellNavigation(isRTL ? -1 : 1, 0);
9045
+ break;
9046
+ case Keys.ArrowLeft:
9047
+ this.handleCellNavigation(isRTL ? 1 : -1, 0);
9048
+ break;
9049
+ case Keys.Enter:
9050
+ this.handleEnter();
9051
+ break;
9052
+ default: return;
8725
9053
  }
9054
+ event.preventDefault();
8726
9055
  };
8727
9056
  /**
8728
- * Focuses the wrapper of the ColorPicker.
9057
+ * @hidden
8729
9058
  */
8730
- ColorPickerComponent.prototype.focus = function () {
8731
- if (this.disabled) {
8732
- return;
8733
- }
8734
- this.wrapper.nativeElement.focus();
9059
+ ColorPaletteComponent.prototype.handleHostBlur = function () {
9060
+ this.notifyNgTouched();
9061
+ this.handleCellFocusOnBlur();
8735
9062
  };
8736
9063
  /**
8737
9064
  * @hidden
8738
9065
  */
8739
- ColorPickerComponent.prototype.handleWrapperFocus = function () {
8740
- if (isPresent(this.palette)) {
8741
- this.palette.nativeElement.focus();
8742
- }
8743
- if (this.isFocused) {
9066
+ ColorPaletteComponent.prototype.handleCellSelection = function (value, focusedCell) {
9067
+ if (this.readonly) {
8744
9068
  return;
8745
9069
  }
8746
- this.isFocused = true;
8747
- this.onFocus.emit();
9070
+ this.selectedCell = focusedCell;
9071
+ this.focusedCell = this.selectedCell;
9072
+ this.focusInComponent = true;
9073
+ var parsedColor = parseColor$1(value, this.format, false, false);
9074
+ this.cellSelection.emit(parsedColor);
9075
+ this.handleValueChange(parsedColor);
9076
+ if (this.selection !== parsedColor) {
9077
+ this.selection = parsedColor;
9078
+ this.selectionChange.emit(parsedColor);
9079
+ }
9080
+ if (focusedCell) {
9081
+ this.activeCellId = "k-" + this.selectedCell.row + "-" + this.selectedCell.col + "-" + this.uniqueId;
9082
+ }
8748
9083
  };
8749
9084
  /**
8750
- * Blurs the ColorPicker.
9085
+ * @hidden
8751
9086
  */
8752
- ColorPickerComponent.prototype.blur = function () {
8753
- this.wrapper.nativeElement.blur();
9087
+ ColorPaletteComponent.prototype.writeValue = function (value) {
9088
+ this.value = value;
9089
+ this.focusedCell = this.service.getCellCoordsFor(this.value);
8754
9090
  };
8755
9091
  /**
8756
9092
  * @hidden
8757
9093
  */
8758
- ColorPickerComponent.prototype.handleWrapperBlur = function () {
8759
- if (this.isOpen) {
8760
- return;
8761
- }
8762
- this.isFocused = false;
8763
- this.onBlur.emit();
8764
- this.notifyNgTouched();
9094
+ ColorPaletteComponent.prototype.registerOnChange = function (fn) {
9095
+ this.notifyNgChanged = fn;
8765
9096
  };
8766
9097
  /**
8767
- * Clears the color value of the ColorPicker.
9098
+ * @hidden
9099
+ */
9100
+ ColorPaletteComponent.prototype.registerOnTouched = function (fn) {
9101
+ this.notifyNgTouched = fn;
9102
+ };
9103
+ /**
9104
+ * @hidden
9105
+ */
9106
+ ColorPaletteComponent.prototype.setDisabledState = function (isDisabled) {
9107
+ this.cdr.markForCheck();
9108
+ this.disabled = isDisabled;
9109
+ };
9110
+ /**
9111
+ * @hidden
9112
+ * Used by the FloatingLabel to determine if the component is empty.
9113
+ */
9114
+ ColorPaletteComponent.prototype.isEmpty = function () {
9115
+ return false;
9116
+ };
9117
+ /**
9118
+ * Clears the color value of the ColorPalette.
9119
+ */
9120
+ ColorPaletteComponent.prototype.reset = function () {
9121
+ this.focusedCell = null;
9122
+ if (isPresent(this.value)) {
9123
+ this.handleValueChange(undefined);
9124
+ }
9125
+ this.selectedCell = undefined;
9126
+ };
9127
+ ColorPaletteComponent.prototype.handleValueChange = function (color) {
9128
+ if (this.value === color) {
9129
+ return;
9130
+ }
9131
+ this.value = color;
9132
+ this.valueChange.emit(color);
9133
+ this.notifyNgChanged(color);
9134
+ this.setHostElementAriaLabel();
9135
+ };
9136
+ ColorPaletteComponent.prototype.handleCellFocusOnBlur = function () {
9137
+ this.focusInComponent = false;
9138
+ this.focusedCell = this.selectedCell;
9139
+ };
9140
+ ColorPaletteComponent.prototype.setRows = function () {
9141
+ if (!isPresent(this.palette)) {
9142
+ return;
9143
+ }
9144
+ this.columns = this.columns || DEFAULT_COLUMNS_COUNT;
9145
+ this.service.setColorMatrix(this.palette, this.columns);
9146
+ };
9147
+ ColorPaletteComponent.prototype.handleCellNavigation = function (horizontalStep, verticalStep) {
9148
+ if (this.readonly) {
9149
+ return;
9150
+ }
9151
+ this.focusedCell = this.service.getNextCell(this.focusedCell, horizontalStep, verticalStep);
9152
+ this.focusInComponent = true;
9153
+ };
9154
+ ColorPaletteComponent.prototype.setHostElementAriaLabel = function () {
9155
+ var parsed = parseColor$1(this.value, this.format);
9156
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-label', "" + (this.value ? parsed : this.localizationService.get('colorPaletteNoColor')));
9157
+ };
9158
+ ColorPaletteComponent.prototype.handleEnter = function () {
9159
+ if (!isPresent(this.focusedCell)) {
9160
+ return;
9161
+ }
9162
+ var selectedColor = this.service.getColorAt(this.focusedCell);
9163
+ this.handleCellSelection(selectedColor, this.focusedCell);
9164
+ };
9165
+ var ColorPaletteComponent_1;
9166
+ __decorate([
9167
+ HostBinding('attr.dir'),
9168
+ __metadata("design:type", String)
9169
+ ], ColorPaletteComponent.prototype, "direction", void 0);
9170
+ __decorate([
9171
+ HostBinding('attr.id'),
9172
+ __metadata("design:type", String),
9173
+ __metadata("design:paramtypes", [])
9174
+ ], ColorPaletteComponent.prototype, "paletteId", null);
9175
+ __decorate([
9176
+ Input(),
9177
+ __metadata("design:type", String)
9178
+ ], ColorPaletteComponent.prototype, "id", void 0);
9179
+ __decorate([
9180
+ Input(),
9181
+ __metadata("design:type", String)
9182
+ ], ColorPaletteComponent.prototype, "format", void 0);
9183
+ __decorate([
9184
+ Input(),
9185
+ __metadata("design:type", String),
9186
+ __metadata("design:paramtypes", [String])
9187
+ ], ColorPaletteComponent.prototype, "value", null);
9188
+ __decorate([
9189
+ Input(),
9190
+ __metadata("design:type", Number),
9191
+ __metadata("design:paramtypes", [Number])
9192
+ ], ColorPaletteComponent.prototype, "columns", null);
9193
+ __decorate([
9194
+ Input(),
9195
+ __metadata("design:type", Object),
9196
+ __metadata("design:paramtypes", [Object])
9197
+ ], ColorPaletteComponent.prototype, "palette", null);
9198
+ __decorate([
9199
+ Input(),
9200
+ __metadata("design:type", Number),
9201
+ __metadata("design:paramtypes", [Number])
9202
+ ], ColorPaletteComponent.prototype, "tabindex", null);
9203
+ __decorate([
9204
+ Input(),
9205
+ __metadata("design:type", Boolean)
9206
+ ], ColorPaletteComponent.prototype, "disabled", void 0);
9207
+ __decorate([
9208
+ Input(),
9209
+ __metadata("design:type", Boolean)
9210
+ ], ColorPaletteComponent.prototype, "readonly", void 0);
9211
+ __decorate([
9212
+ Input(),
9213
+ __metadata("design:type", Object)
9214
+ ], ColorPaletteComponent.prototype, "tileSize", void 0);
9215
+ __decorate([
9216
+ Output(),
9217
+ __metadata("design:type", EventEmitter)
9218
+ ], ColorPaletteComponent.prototype, "selectionChange", void 0);
9219
+ __decorate([
9220
+ Output(),
9221
+ __metadata("design:type", EventEmitter)
9222
+ ], ColorPaletteComponent.prototype, "valueChange", void 0);
9223
+ __decorate([
9224
+ Output(),
9225
+ __metadata("design:type", EventEmitter)
9226
+ ], ColorPaletteComponent.prototype, "cellSelection", void 0);
9227
+ __decorate([
9228
+ HostBinding('attr.tabindex'),
9229
+ __metadata("design:type", Number),
9230
+ __metadata("design:paramtypes", [])
9231
+ ], ColorPaletteComponent.prototype, "hostTabindex", null);
9232
+ __decorate([
9233
+ HostBinding('class.k-colorpalette'),
9234
+ __metadata("design:type", Boolean)
9235
+ ], ColorPaletteComponent.prototype, "hostClasses", void 0);
9236
+ __decorate([
9237
+ HostBinding('attr.aria-disabled'),
9238
+ HostBinding('class.k-state-disabled'),
9239
+ __metadata("design:type", Boolean),
9240
+ __metadata("design:paramtypes", [])
9241
+ ], ColorPaletteComponent.prototype, "disabledClass", null);
9242
+ __decorate([
9243
+ HostBinding('attr.aria-readonly'),
9244
+ __metadata("design:type", Boolean),
9245
+ __metadata("design:paramtypes", [])
9246
+ ], ColorPaletteComponent.prototype, "readonlyAttribute", null);
9247
+ __decorate([
9248
+ HostListener('keydown', ['$event']),
9249
+ __metadata("design:type", Function),
9250
+ __metadata("design:paramtypes", [Object]),
9251
+ __metadata("design:returntype", void 0)
9252
+ ], ColorPaletteComponent.prototype, "handleKeydown", null);
9253
+ __decorate([
9254
+ HostListener('blur'),
9255
+ __metadata("design:type", Function),
9256
+ __metadata("design:paramtypes", []),
9257
+ __metadata("design:returntype", void 0)
9258
+ ], ColorPaletteComponent.prototype, "handleHostBlur", null);
9259
+ ColorPaletteComponent = ColorPaletteComponent_1 = __decorate([
9260
+ Component({
9261
+ exportAs: 'kendoColorPalette',
9262
+ selector: 'kendo-colorpalette',
9263
+ providers: [
9264
+ {
9265
+ multi: true,
9266
+ provide: NG_VALUE_ACCESSOR,
9267
+ useExisting: forwardRef(function () { return ColorPaletteComponent_1; }) // tslint:disable-line:no-forward-ref
9268
+ }, {
9269
+ provide: KendoInput,
9270
+ useExisting: forwardRef(function () { return ColorPaletteComponent_1; })
9271
+ },
9272
+ ColorPaletteService,
9273
+ ColorPaletteLocalizationService,
9274
+ {
9275
+ provide: LocalizationService,
9276
+ useExisting: ColorPaletteLocalizationService
9277
+ },
9278
+ {
9279
+ provide: L10N_PREFIX,
9280
+ useValue: 'kendo.colorpalette'
9281
+ }
9282
+ ],
9283
+ template: "\n <ng-container kendoColorPaletteLocalizedMessages\n i18n-colorPaletteNoColor=\"kendo.colorpalette.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\">\n </ng-container>\n <div role=\"listbox\" class=\"k-colorpalette-table-wrap\"\n [attr.aria-activedescendant]=\"activeCellId\">\n <table class=\"k-colorpalette-table k-palette\">\n <tbody>\n <tr *ngFor=\"let row of colorRows; let rowIndex = index\">\n <td *ngFor=\"let color of row; let colIndex = index\"\n role=\"option\"\n [class.k-state-selected]=\"selectedCell?.row === rowIndex && selectedCell?.col === colIndex\"\n [class.k-state-focus]=\"focusInComponent && focusedCell?.row === rowIndex && focusedCell?.col === colIndex\"\n [attr.aria-selected]=\"selectedCell?.row === rowIndex && selectedCell?.col === colIndex\"\n [attr.aria-label]=\"color\"\n class=\"k-colorpalette-tile\"\n [id]=\"'k-' + rowIndex + '-' + colIndex + '-' + uniqueId\"\n [attr.value]=\"color\"\n (click)=\"handleCellSelection(color, { row: rowIndex, col: colIndex })\"\n [ngStyle]=\"{\n backgroundColor: color,\n width: tileLayout.width + 'px',\n height: tileLayout.height + 'px',\n minWidth: tileLayout.width + 'px'\n }\">\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n "
9284
+ }),
9285
+ __metadata("design:paramtypes", [ElementRef,
9286
+ ColorPaletteService,
9287
+ ChangeDetectorRef,
9288
+ Renderer2,
9289
+ LocalizationService])
9290
+ ], ColorPaletteComponent);
9291
+ return ColorPaletteComponent;
9292
+ }());
9293
+
9294
+ /**
9295
+ * @hidden
9296
+ */
9297
+ var FlatColorPickerHeaderComponent = /** @class */ (function () {
9298
+ function FlatColorPickerHeaderComponent(localizationService) {
9299
+ this.localizationService = localizationService;
9300
+ this.hostClasses = true;
9301
+ this.viewChange = new EventEmitter();
9302
+ this.valuePaneClick = new EventEmitter();
9303
+ this.clearButtonClick = new EventEmitter();
9304
+ }
9305
+ FlatColorPickerHeaderComponent.prototype.onViewButtonClick = function (view) {
9306
+ this.activeView = view;
9307
+ this.viewChange.emit(view);
9308
+ };
9309
+ Object.defineProperty(FlatColorPickerHeaderComponent.prototype, "viewButtons", {
9310
+ get: function () {
9311
+ return this.views && this.views.indexOf('gradient') >= 0 && this.views.indexOf('palette') >= 0;
9312
+ },
9313
+ enumerable: true,
9314
+ configurable: true
9315
+ });
9316
+ FlatColorPickerHeaderComponent.prototype.getViewButtonIcon = function (view) {
9317
+ return view === 'gradient' ? 'k-i-color-canvas' : 'k-i-palette';
9318
+ };
9319
+ FlatColorPickerHeaderComponent.prototype.getText = function (text) {
9320
+ return this.localizationService.get(text);
9321
+ };
9322
+ __decorate([
9323
+ HostBinding('class.k-coloreditor-header'),
9324
+ HostBinding('class.k-hstack'),
9325
+ __metadata("design:type", Boolean)
9326
+ ], FlatColorPickerHeaderComponent.prototype, "hostClasses", void 0);
9327
+ __decorate([
9328
+ Input(),
9329
+ __metadata("design:type", Boolean)
9330
+ ], FlatColorPickerHeaderComponent.prototype, "clearButton", void 0);
9331
+ __decorate([
9332
+ Input(),
9333
+ __metadata("design:type", String)
9334
+ ], FlatColorPickerHeaderComponent.prototype, "activeView", void 0);
9335
+ __decorate([
9336
+ Input(),
9337
+ __metadata("design:type", Array)
9338
+ ], FlatColorPickerHeaderComponent.prototype, "views", void 0);
9339
+ __decorate([
9340
+ Input(),
9341
+ __metadata("design:type", Boolean)
9342
+ ], FlatColorPickerHeaderComponent.prototype, "preview", void 0);
9343
+ __decorate([
9344
+ Input(),
9345
+ __metadata("design:type", String)
9346
+ ], FlatColorPickerHeaderComponent.prototype, "value", void 0);
9347
+ __decorate([
9348
+ Input(),
9349
+ __metadata("design:type", String)
9350
+ ], FlatColorPickerHeaderComponent.prototype, "selection", void 0);
9351
+ __decorate([
9352
+ Output(),
9353
+ __metadata("design:type", EventEmitter)
9354
+ ], FlatColorPickerHeaderComponent.prototype, "viewChange", void 0);
9355
+ __decorate([
9356
+ Output(),
9357
+ __metadata("design:type", EventEmitter)
9358
+ ], FlatColorPickerHeaderComponent.prototype, "valuePaneClick", void 0);
9359
+ __decorate([
9360
+ Output(),
9361
+ __metadata("design:type", EventEmitter)
9362
+ ], FlatColorPickerHeaderComponent.prototype, "clearButtonClick", void 0);
9363
+ __decorate([
9364
+ ViewChildren('viewButtons', { read: ElementRef }),
9365
+ __metadata("design:type", QueryList)
9366
+ ], FlatColorPickerHeaderComponent.prototype, "viewButtonsCollection", void 0);
9367
+ __decorate([
9368
+ ViewChild('clearButton', { read: ElementRef, static: false }),
9369
+ __metadata("design:type", ElementRef)
9370
+ ], FlatColorPickerHeaderComponent.prototype, "clearButtonElement", void 0);
9371
+ FlatColorPickerHeaderComponent = __decorate([
9372
+ Component({
9373
+ selector: '[kendoFlatColorPickerHeader]',
9374
+ template: "\n <div class=\"k-coloreditor-header-actions k-hstack\">\n <div *ngIf=\"viewButtons\" class=\"k-button-group k-button-group-flat\">\n <button *ngFor=\"let view of views\"\n #viewButtons\n (click)=\"onViewButtonClick(view)\"\n class=\"k-button k-icon-button k-flat\"\n [attr.title]=\"getText(view === 'gradient' ? 'gradientView' : 'paletteView')\"\n [attr.aria-label]=\"getText(view === 'gradient' ? 'gradientView' : 'paletteView')\"\n [attr.aria-pressed]=\"activeView === view\"\n [ngClass]=\"activeView === view ? 'k-state-selected' : ''\"\n >\n <span\n class=\"k-button-icon k-icon\"\n [ngClass]=\"getViewButtonIcon(view)\">\n </span>\n </button>\n </div>\n </div>\n <div class=\"k-spacer\"></div>\n <div class=\"k-coloreditor-header-actions k-hstack\">\n <button *ngIf=\"clearButton\"\n #clearButton\n class=\"k-button k-icon-button k-flat k-coloreditor-reset\"\n [attr.aria-label]=\"getText('clearButton')\"\n [attr.title]=\"getText('clearButton')\"\n (click)=\"clearButtonClick.emit()\">\n <span class=\"k-button-icon k-icon k-i-reset-color\"></span>\n </button>\n <div class=\"k-coloreditor-preview k-vstack\" *ngIf=\"preview\">\n <span\n class=\"k-coloreditor-preview-color k-color-preview\"\n [attr.title]=\"getText('previewColor')\"\n [style.background-color]=\"selection\">\n </span>\n <span class=\"k-coloreditor-current-color k-color-preview\"\n [style.background-color]=\"value\"\n [attr.title]=\"getText('revertSelection')\"\n (click)=\"valuePaneClick.emit($event)\">\n </span>\n </div>\n </div>\n "
9375
+ }),
9376
+ __metadata("design:paramtypes", [LocalizationService])
9377
+ ], FlatColorPickerHeaderComponent);
9378
+ return FlatColorPickerHeaderComponent;
9379
+ }());
9380
+
9381
+ /**
9382
+ * @hidden
9383
+ */
9384
+ var FlatColorPickerActionButtonsComponent = /** @class */ (function () {
9385
+ function FlatColorPickerActionButtonsComponent(localizationService) {
9386
+ this.localizationService = localizationService;
9387
+ this.hostClasses = true;
9388
+ this.actionButtonClick = new EventEmitter();
9389
+ }
9390
+ FlatColorPickerActionButtonsComponent.prototype.getText = function (text) {
9391
+ return this.localizationService.get(text);
9392
+ };
9393
+ FlatColorPickerActionButtonsComponent.prototype.onActionButtonClick = function (type, ev) {
9394
+ var args = {
9395
+ target: type,
9396
+ originalEvent: ev
9397
+ };
9398
+ this.actionButtonClick.emit(args);
9399
+ };
9400
+ __decorate([
9401
+ HostBinding('class.k-coloreditor-footer'),
9402
+ HostBinding('class.k-actions'),
9403
+ HostBinding('class.k-hstack'),
9404
+ __metadata("design:type", Boolean)
9405
+ ], FlatColorPickerActionButtonsComponent.prototype, "hostClasses", void 0);
9406
+ __decorate([
9407
+ Output(),
9408
+ __metadata("design:type", EventEmitter)
9409
+ ], FlatColorPickerActionButtonsComponent.prototype, "actionButtonClick", void 0);
9410
+ __decorate([
9411
+ ViewChild('last', { read: ElementRef, static: false }),
9412
+ __metadata("design:type", ElementRef)
9413
+ ], FlatColorPickerActionButtonsComponent.prototype, "lastButton", void 0);
9414
+ FlatColorPickerActionButtonsComponent = __decorate([
9415
+ Component({
9416
+ selector: '[kendoFlatColorPickerActionButtons]',
9417
+ template: "\n <button\n class=\"k-coloreditor-cancel k-button\"\n [attr.title]=\"getText('cancelButton')\"\n (click)=\"onActionButtonClick('cancel', $event)\"\n >{{getText('cancelButton')}}</button>\n <button #last\n class=\"k-coloreditor-apply k-button k-primary\"\n [attr.title]=\"getText('applyButton')\"\n (click)=\"onActionButtonClick('apply', $event)\"\n >{{getText('applyButton')}}</button>\n "
9418
+ }),
9419
+ __metadata("design:paramtypes", [LocalizationService])
9420
+ ], FlatColorPickerActionButtonsComponent);
9421
+ return FlatColorPickerActionButtonsComponent;
9422
+ }());
9423
+
9424
+ /**
9425
+ * Represents the [Kendo UI FlatColorPicker component for Angular]({% slug overview_flatcolorpicker %}).
9426
+ *
9427
+ * The FlatColorPicker is a powerful tool which allows the user to choose colors through palettes with predefined sets of colors and
9428
+ * through a gradient that renders an hsv canvas. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
9429
+ */
9430
+ var FlatColorPickerComponent = /** @class */ (function () {
9431
+ function FlatColorPickerComponent(service, host, localizationService, cdr, renderer, ngZone) {
9432
+ var _this = this;
9433
+ this.service = service;
9434
+ this.host = host;
9435
+ this.localizationService = localizationService;
9436
+ this.cdr = cdr;
9437
+ this.renderer = renderer;
9438
+ this.ngZone = ngZone;
9439
+ this.hostClasses = true;
9440
+ /**
9441
+ * Sets the read-only state of the FlatColorPicker.
9442
+ *
9443
+ * @default false
9444
+ */
9445
+ this.readonly = false;
9446
+ /**
9447
+ * Sets the disabled state of the FlatColorPicker.
9448
+ *
9449
+ * @default false
9450
+ */
9451
+ this.disabled = false;
9452
+ /**
9453
+ * Specifies the output format of the FlatColorPicker.
9454
+ *
9455
+ * If the input value is in a different format, it will be parsed into the specified output `format`.
9456
+ *
9457
+ * The supported values are:
9458
+ * * `rgba` (default)
9459
+ * * `hex`
9460
+ */
9461
+ this.format = 'rgba';
9462
+ /**
9463
+ * Specifies whether the FlatColorPicker should display a 'Clear color' button.
9464
+ *
9465
+ * @default true
9466
+ */
9467
+ this.clearButton = true;
9468
+ /**
9469
+ * Displays `Apply` and `Cancel` action buttons and a color preview pane.
9470
+ *
9471
+ * When enabled, the component value will not change immediately upon
9472
+ * color selection, but only after the `Apply` button is clicked.
9473
+ *
9474
+ * The `Cancel` button reverts the current selection to its
9475
+ * initial state i.e. to the current value.
9476
+ *
9477
+ * @default true
9478
+ */
9479
+ this.preview = true;
9480
+ /**
9481
+ * Configures the layout of the `Apply` and `Cancel` action buttons.
9482
+ * * `start`
9483
+ * * `center`
9484
+ * * `end` (default)
9485
+ * * `stretch`
9486
+ */
9487
+ this.actionsLayout = 'end';
9488
+ /**
9489
+ * Specifies the views that will be rendered. Default value is gradient and palette.
9490
+ */
9491
+ this.views = ['gradient', 'palette'];
9492
+ /**
9493
+ * Fires each time the component value is changed.
9494
+ */
9495
+ this.valueChange = new EventEmitter();
9496
+ /**
9497
+ * Fires when the user cancels the current color selection.
9498
+ *
9499
+ * The event is emitted on preview pane or on 'Cancel' button click.
9500
+ */
9501
+ this.cancel = new EventEmitter();
9502
+ /**
9503
+ * Fires each time the view is about to change.
9504
+ * Used to provide a two-way binding for the `activeView` property.
9505
+ */
9506
+ this.activeViewChange = new EventEmitter();
9507
+ /**
9508
+ * @hidden
9509
+ */
9510
+ this.actionButtonClick = new EventEmitter();
9511
+ this._tabindex = 0;
9512
+ this._gradientSettings = { opacity: true, delay: 0 };
9513
+ this._paletteSettings = {};
9514
+ this.subscriptions = new Subscription();
9515
+ this.notifyNgChanged = function () { };
9516
+ this.notifyNgTouched = function () { };
9517
+ this.dynamicRTLSubscription = this.localizationService.changes.subscribe(function (_a) {
9518
+ var rtl = _a.rtl;
9519
+ _this.direction = rtl ? 'rtl' : 'ltr';
9520
+ });
9521
+ }
9522
+ FlatColorPickerComponent_1 = FlatColorPickerComponent;
9523
+ Object.defineProperty(FlatColorPickerComponent.prototype, "disabledClass", {
9524
+ get: function () {
9525
+ return this.disabled;
9526
+ },
9527
+ enumerable: true,
9528
+ configurable: true
9529
+ });
9530
+ Object.defineProperty(FlatColorPickerComponent.prototype, "ariaReadonly", {
9531
+ get: function () {
9532
+ return this.readonly;
9533
+ },
9534
+ enumerable: true,
9535
+ configurable: true
9536
+ });
9537
+ Object.defineProperty(FlatColorPickerComponent.prototype, "hostTabindex", {
9538
+ get: function () {
9539
+ return this.tabindex;
9540
+ },
9541
+ enumerable: true,
9542
+ configurable: true
9543
+ });
9544
+ Object.defineProperty(FlatColorPickerComponent.prototype, "value", {
9545
+ get: function () {
9546
+ return this._value;
9547
+ },
9548
+ /**
9549
+ * Specifies the initially selected color.
9550
+ */
9551
+ set: function (value) {
9552
+ this._value = parseColor$1(value, this.format, this.gradientSettings.opacity);
9553
+ },
9554
+ enumerable: true,
9555
+ configurable: true
9556
+ });
9557
+ Object.defineProperty(FlatColorPickerComponent.prototype, "tabindex", {
9558
+ get: function () {
9559
+ return !this.disabled ? this._tabindex : undefined;
9560
+ },
9561
+ /**
9562
+ * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
9563
+ *
9564
+ * @default 0
9565
+ */
9566
+ set: function (value) {
9567
+ var tabindex = Number(value);
9568
+ var defaultValue = 0;
9569
+ this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
9570
+ },
9571
+ enumerable: true,
9572
+ configurable: true
9573
+ });
9574
+ Object.defineProperty(FlatColorPickerComponent.prototype, "gradientSettings", {
9575
+ get: function () {
9576
+ return this._gradientSettings;
9577
+ },
9578
+ /**
9579
+ * Configures the gradient view.
9580
+ */
9581
+ set: function (value) {
9582
+ Object.assign(this._gradientSettings, value);
9583
+ },
9584
+ enumerable: true,
9585
+ configurable: true
9586
+ });
9587
+ Object.defineProperty(FlatColorPickerComponent.prototype, "paletteSettings", {
9588
+ get: function () {
9589
+ return this._paletteSettings;
9590
+ },
9591
+ /**
9592
+ * Configures the palette view.
9593
+ */
9594
+ set: function (value) {
9595
+ Object.assign(this._paletteSettings, value);
9596
+ },
9597
+ enumerable: true,
9598
+ configurable: true
9599
+ });
9600
+ FlatColorPickerComponent.prototype.ngOnInit = function () {
9601
+ this.selection = this.value;
9602
+ this._paletteSettings = this.service.getPaletteSettings(this._paletteSettings, this.format);
9603
+ this.setActiveView();
9604
+ };
9605
+ FlatColorPickerComponent.prototype.ngAfterViewInit = function () {
9606
+ this.setHostElementAriaLabel();
9607
+ this.initDomEvents();
9608
+ this.setSizingVariables();
9609
+ };
9610
+ FlatColorPickerComponent.prototype.ngOnChanges = function (changes) {
9611
+ if (isChanged('value', changes)) {
9612
+ this.setHostElementAriaLabel();
9613
+ }
9614
+ if (isChanged('paletteSettings', changes)) {
9615
+ this.setSizingVariables();
9616
+ }
9617
+ };
9618
+ FlatColorPickerComponent.prototype.ngOnDestroy = function () {
9619
+ if (this.dynamicRTLSubscription) {
9620
+ this.dynamicRTLSubscription.unsubscribe();
9621
+ }
9622
+ this.subscriptions.unsubscribe();
9623
+ };
9624
+ Object.defineProperty(FlatColorPickerComponent.prototype, "headerHasContent", {
9625
+ /**
9626
+ * @hidden
9627
+ */
9628
+ get: function () {
9629
+ return this.preview || this.views.length > 1 || this.clearButton;
9630
+ },
9631
+ enumerable: true,
9632
+ configurable: true
9633
+ });
9634
+ /**
9635
+ * @hidden
9636
+ * Used by the FloatingLabel to determine if the component is empty.
8768
9637
  */
8769
- ColorPickerComponent.prototype.reset = function () {
8770
- if (!isPresent(this.value)) {
9638
+ FlatColorPickerComponent.prototype.isEmpty = function () {
9639
+ return false;
9640
+ };
9641
+ /**
9642
+ * Focuses the wrapper of the FlatColorPicker.
9643
+ */
9644
+ FlatColorPickerComponent.prototype.focus = function () {
9645
+ if (this.disabled && this.focused) {
8771
9646
  return;
8772
9647
  }
8773
- this._value = undefined;
8774
- this.notifyNgChanged(undefined);
9648
+ this.host.nativeElement.focus();
9649
+ this.focused = true;
8775
9650
  };
8776
9651
  /**
8777
- * Toggles the popup of the ColorPicker.
8778
- * Does not trigger the `open` and `close` events of the component.
8779
- *
8780
- * @param open An optional parameter. Specifies whether the popup will be opened or closed.
9652
+ * Blurs the wrapper of the FlatColorPicker.
8781
9653
  */
8782
- ColorPickerComponent.prototype.toggle = function (open) {
8783
- if (this.disabled || this.readonly) {
9654
+ FlatColorPickerComponent.prototype.blur = function () {
9655
+ if (!this.focused) {
8784
9656
  return;
8785
9657
  }
8786
- this.closePopup();
8787
- open = isPresent(open) ? open : !this.isOpen;
8788
- if (open) {
8789
- this.openPopup();
9658
+ this.notifyNgTouched();
9659
+ this.host.nativeElement.blur();
9660
+ this.focused = false;
9661
+ };
9662
+ /**
9663
+ * Clears the value of the FlatColorPicker.
9664
+ */
9665
+ FlatColorPickerComponent.prototype.reset = function () {
9666
+ if (!isPresent(this.value)) {
9667
+ return;
8790
9668
  }
9669
+ this.value = undefined;
9670
+ this.notifyNgChanged(undefined);
9671
+ this.setHostElementAriaLabel();
8791
9672
  };
8792
9673
  /**
8793
9674
  * @hidden
8794
9675
  */
8795
- ColorPickerComponent.prototype.handleValueChange = function (color, closePopup) {
8796
- var parsedColor = parseColor$1(color, this.format);
8797
- var valueChange = parsedColor !== this.value;
8798
- if (closePopup) {
8799
- this.toggleWithEvents(false);
8800
- this.focus();
9676
+ FlatColorPickerComponent.prototype.onViewChange = function (view) {
9677
+ var _this = this;
9678
+ if (this.activeView === view) {
9679
+ return;
8801
9680
  }
8802
- if (valueChange) {
8803
- this.value = parsedColor;
8804
- this.valueChange.emit(parsedColor);
8805
- this.notifyNgChanged(parsedColor);
9681
+ this.activeView = view;
9682
+ this.activeViewChange.emit(view);
9683
+ if (this.activeView === 'gradient') {
9684
+ this.ngZone.runOutsideAngular(function () {
9685
+ setTimeout(function () {
9686
+ _this.gradient.gradientDragHandle.nativeElement.focus();
9687
+ });
9688
+ });
8806
9689
  }
8807
9690
  };
8808
9691
  /**
8809
9692
  * @hidden
8810
9693
  */
8811
- ColorPickerComponent.prototype.handlePopupBlur = function (event) {
8812
- var focusInPopupElement = this.popupRef.popupElement.contains(event.relatedTarget);
8813
- var wrapperClicked = event.relatedTarget === this.wrapper.nativeElement;
8814
- if (!this.isFocused || wrapperClicked || focusInPopupElement) {
9694
+ FlatColorPickerComponent.prototype.onClearButtonClick = function () {
9695
+ this.resetInnerComponentValue();
9696
+ this.host.nativeElement.focus();
9697
+ };
9698
+ /**
9699
+ * @hidden
9700
+ */
9701
+ FlatColorPickerComponent.prototype.handleValueChange = function (color) {
9702
+ if (this.value === color) {
8815
9703
  return;
8816
9704
  }
8817
- this.isFocused = false;
8818
- this.onBlur.emit();
8819
- this.notifyNgTouched();
8820
- this.toggleWithEvents(false);
9705
+ if (this.preview) {
9706
+ this.changeCurrentValue(color);
9707
+ }
9708
+ else {
9709
+ this.setFlatColorPickerValue(color);
9710
+ }
8821
9711
  };
8822
9712
  /**
8823
9713
  * @hidden
8824
9714
  */
8825
- ColorPickerComponent.prototype.writeValue = function (value) {
9715
+ FlatColorPickerComponent.prototype.onAction = function (ev) {
9716
+ ev.target === 'apply' ? this.setFlatColorPickerValue(this.selection) : this.resetSelection(ev.originalEvent);
9717
+ this.actionButtonClick.emit();
9718
+ };
9719
+ /**
9720
+ * @hidden
9721
+ */
9722
+ FlatColorPickerComponent.prototype.writeValue = function (value) {
8826
9723
  this.value = value;
8827
9724
  };
8828
9725
  /**
8829
9726
  * @hidden
8830
9727
  */
8831
- ColorPickerComponent.prototype.registerOnChange = function (fn) {
9728
+ FlatColorPickerComponent.prototype.registerOnChange = function (fn) {
8832
9729
  this.notifyNgChanged = fn;
8833
9730
  };
8834
9731
  /**
8835
9732
  * @hidden
8836
9733
  */
8837
- ColorPickerComponent.prototype.registerOnTouched = function (fn) {
9734
+ FlatColorPickerComponent.prototype.registerOnTouched = function (fn) {
8838
9735
  this.notifyNgTouched = fn;
8839
9736
  };
8840
9737
  /**
8841
9738
  * @hidden
8842
9739
  */
8843
- ColorPickerComponent.prototype.setDisabledState = function (isDisabled) {
9740
+ FlatColorPickerComponent.prototype.setDisabledState = function (isDisabled) {
8844
9741
  this.cdr.markForCheck();
8845
9742
  this.disabled = isDisabled;
8846
9743
  };
8847
9744
  /**
8848
9745
  * @hidden
8849
9746
  */
8850
- ColorPickerComponent.prototype.handleWrapperKeyDown = function (event) {
8851
- if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
8852
- event.preventDefault();
8853
- this.toggleWithEvents(true);
9747
+ FlatColorPickerComponent.prototype.resetSelection = function (ev) {
9748
+ var eventArgs = new ColorPickerCancelEvent(ev);
9749
+ this.cancel.emit(eventArgs);
9750
+ if (!eventArgs.isDefaultPrevented()) {
9751
+ this.selection = this.value;
8854
9752
  }
9753
+ this.notifyNgTouched();
8855
9754
  };
8856
- /**
8857
- * @hidden
8858
- */
8859
- ColorPickerComponent.prototype.handlePopupKeyDown = function (event) {
8860
- if (event.keyCode === Keys.Escape) {
8861
- this.toggleWithEvents(false);
8862
- this.wrapper.nativeElement.focus();
8863
- }
8864
- if (event.keyCode === Keys.Tab) {
8865
- var firstElement = this.colorGradient ? this.colorGradient.gradientDragHandle.nativeElement : this.palette.nativeElement;
8866
- var lastElement = this.palette ? this.palette.nativeElement :
8867
- this.colorGradient.inputs.opacityInput.nativeElement.childNodes[1].children[0];
8868
- if (event.shiftKey) {
8869
- if (event.target === firstElement) {
8870
- event.preventDefault();
8871
- lastElement.focus();
8872
- return;
8873
- }
8874
- }
8875
- else {
8876
- if (event.target === lastElement) {
8877
- event.preventDefault();
8878
- firstElement.focus();
8879
- return;
8880
- }
8881
- }
8882
- }
9755
+ FlatColorPickerComponent.prototype.setHostElementAriaLabel = function () {
9756
+ var parsed = parseColor$1(this.value, this.format, this.gradientSettings.opacity);
9757
+ var ariaLabelValue = "" + (this.value ? parsed : this.localizationService.get('flatColorPickerNoColor'));
9758
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
8883
9759
  };
8884
- /**
8885
- * @hidden
8886
- * Used by the TextBoxContainer to determine if the component is empty.
8887
- */
8888
- ColorPickerComponent.prototype.isEmpty = function () {
8889
- return false;
9760
+ FlatColorPickerComponent.prototype.setSizingVariables = function () {
9761
+ var paletteTileSize = this.service.paletteTileLayout(this.paletteSettings.tileSize);
9762
+ var value = "--kendo-color-preview-columns: " + this.paletteSettings.columns + ";\n --kendo-color-preview-width: " + paletteTileSize.width + "px;\n --kendo-color-preview-height: " + paletteTileSize.height + "px;";
9763
+ this.host.nativeElement.querySelector('.k-coloreditor-views.k-vstack').setAttribute('style', value);
8890
9764
  };
8891
- ColorPickerComponent.prototype.toggleWithEvents = function (open) {
8892
- var _this = this;
8893
- var sameState = this.isOpen === open;
8894
- if (this.disabled || this.readonly || sameState) {
9765
+ FlatColorPickerComponent.prototype.changeCurrentValue = function (color) {
9766
+ this.selection = color;
9767
+ this.notifyNgTouched();
9768
+ };
9769
+ FlatColorPickerComponent.prototype.resetInnerComponentValue = function () {
9770
+ this.selection = null;
9771
+ if (this.gradient) {
9772
+ this.gradient.reset();
8895
9773
  return;
8896
9774
  }
8897
- var eventArgs = new PreventableEvent();
8898
- open ? this.open.emit(eventArgs) : this.close.emit(eventArgs);
8899
- if (!eventArgs.isDefaultPrevented()) {
8900
- this.toggle(open);
9775
+ this.palette.reset();
9776
+ };
9777
+ FlatColorPickerComponent.prototype.setFlatColorPickerValue = function (color) {
9778
+ if (this.value === color) {
9779
+ return;
8901
9780
  }
8902
- if (open) {
8903
- this.ngZone.runOutsideAngular(function () {
8904
- setTimeout(function () {
8905
- if (_this.colorGradient) {
8906
- _this.colorGradient.gradientDragHandle.nativeElement.focus();
8907
- }
8908
- });
8909
- });
9781
+ this.value = color;
9782
+ this.valueChange.emit(color);
9783
+ this.notifyNgChanged(color);
9784
+ this.setHostElementAriaLabel();
9785
+ };
9786
+ FlatColorPickerComponent.prototype.setActiveView = function () {
9787
+ if (!isPresent(this.activeView)) {
9788
+ this.activeView = this.views[0];
9789
+ return;
9790
+ }
9791
+ if (isDevMode() && this.views.indexOf(this.activeView) === -1) {
9792
+ throw new Error("Invalid configuration: The current activeView is not present in the views collection");
8910
9793
  }
8911
9794
  };
8912
- ColorPickerComponent.prototype.openPopup = function () {
9795
+ FlatColorPickerComponent.prototype.initDomEvents = function () {
8913
9796
  var _this = this;
8914
- var horizontalAlign = this.direction === "rtl" ? "right" : "left";
8915
- var anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
8916
- var popupPosition = { horizontal: horizontalAlign, vertical: "top" };
8917
- this.popupRef = this.popupService.open({
8918
- anchor: this.wrapper,
8919
- animate: this.popupSettings.animate,
8920
- appendTo: this.popupSettings.appendTo,
8921
- popupAlign: popupPosition,
8922
- anchorAlign: anchorPosition,
8923
- popupClass: 'k-colorpicker-popup',
8924
- content: this.popupTemplate,
8925
- positionMode: 'absolute'
8926
- });
8927
- this.popupRef.popupAnchorViewportLeave.subscribe(function () {
8928
- _this.toggleWithEvents(false);
8929
- if (!_this.isOpen) {
8930
- _this.wrapper.nativeElement.focus({
8931
- preventScroll: true
8932
- });
8933
- }
8934
- });
8935
- };
8936
- ColorPickerComponent.prototype.closePopup = function () {
8937
- if (!this.isOpen) {
9797
+ if (!this.host) {
8938
9798
  return;
8939
9799
  }
8940
- this.popupRef.close();
8941
- this.popupRef = null;
8942
- this.palette = null;
9800
+ var hostElement = this.host.nativeElement;
9801
+ this.ngZone.runOutsideAngular(function () {
9802
+ _this.subscriptions.add(_this.renderer.listen(hostElement, 'focus', function () {
9803
+ _this.focused = true;
9804
+ }));
9805
+ _this.subscriptions.add(_this.renderer.listen(hostElement, 'blur', function () {
9806
+ _this.focused = false;
9807
+ _this.notifyNgTouched();
9808
+ }));
9809
+ });
8943
9810
  };
8944
- var ColorPickerComponent_1;
9811
+ var FlatColorPickerComponent_1;
8945
9812
  __decorate([
8946
- HostBinding('class.k-widget'),
8947
- HostBinding('class.k-colorpicker'),
9813
+ HostBinding('class.k-flatcolorpicker'),
9814
+ HostBinding('class.k-coloreditor'),
8948
9815
  __metadata("design:type", Boolean)
8949
- ], ColorPickerComponent.prototype, "hostClasses", void 0);
9816
+ ], FlatColorPickerComponent.prototype, "hostClasses", void 0);
8950
9817
  __decorate([
8951
- HostBinding('attr.dir'),
8952
- __metadata("design:type", String)
8953
- ], ColorPickerComponent.prototype, "direction", void 0);
9818
+ HostBinding('class.k-state-disabled'),
9819
+ HostBinding('attr.aria-disabled'),
9820
+ __metadata("design:type", Boolean),
9821
+ __metadata("design:paramtypes", [])
9822
+ ], FlatColorPickerComponent.prototype, "disabledClass", null);
8954
9823
  __decorate([
8955
- Input(),
8956
- __metadata("design:type", String)
8957
- ], ColorPickerComponent.prototype, "focusableId", void 0);
9824
+ HostBinding('attr.aria-readonly'),
9825
+ __metadata("design:type", Boolean),
9826
+ __metadata("design:paramtypes", [])
9827
+ ], FlatColorPickerComponent.prototype, "ariaReadonly", null);
8958
9828
  __decorate([
8959
- Input(),
9829
+ HostBinding('attr.dir'),
8960
9830
  __metadata("design:type", String)
8961
- ], ColorPickerComponent.prototype, "view", void 0);
9831
+ ], FlatColorPickerComponent.prototype, "direction", void 0);
9832
+ __decorate([
9833
+ HostBinding('attr.tabindex'),
9834
+ __metadata("design:type", Number),
9835
+ __metadata("design:paramtypes", [])
9836
+ ], FlatColorPickerComponent.prototype, "hostTabindex", null);
8962
9837
  __decorate([
8963
9838
  Input(),
8964
9839
  __metadata("design:type", Boolean)
8965
- ], ColorPickerComponent.prototype, "readonly", void 0);
9840
+ ], FlatColorPickerComponent.prototype, "readonly", void 0);
8966
9841
  __decorate([
8967
9842
  Input(),
8968
9843
  __metadata("design:type", Boolean)
8969
- ], ColorPickerComponent.prototype, "disabled", void 0);
9844
+ ], FlatColorPickerComponent.prototype, "disabled", void 0);
8970
9845
  __decorate([
8971
9846
  Input(),
8972
9847
  __metadata("design:type", String)
8973
- ], ColorPickerComponent.prototype, "format", void 0);
9848
+ ], FlatColorPickerComponent.prototype, "format", void 0);
8974
9849
  __decorate([
8975
9850
  Input(),
8976
9851
  __metadata("design:type", String),
8977
9852
  __metadata("design:paramtypes", [String])
8978
- ], ColorPickerComponent.prototype, "value", null);
9853
+ ], FlatColorPickerComponent.prototype, "value", null);
8979
9854
  __decorate([
8980
9855
  Input(),
8981
- __metadata("design:type", Object),
8982
- __metadata("design:paramtypes", [Object])
8983
- ], ColorPickerComponent.prototype, "popupSettings", null);
9856
+ __metadata("design:type", Number),
9857
+ __metadata("design:paramtypes", [Number])
9858
+ ], FlatColorPickerComponent.prototype, "tabindex", null);
8984
9859
  __decorate([
8985
9860
  Input(),
8986
- __metadata("design:type", Object),
8987
- __metadata("design:paramtypes", [Object])
8988
- ], ColorPickerComponent.prototype, "paletteSettings", null);
9861
+ __metadata("design:type", Boolean)
9862
+ ], FlatColorPickerComponent.prototype, "clearButton", void 0);
8989
9863
  __decorate([
8990
9864
  Input(),
8991
- __metadata("design:type", Object),
8992
- __metadata("design:paramtypes", [Object])
8993
- ], ColorPickerComponent.prototype, "gradientSettings", null);
9865
+ __metadata("design:type", Boolean)
9866
+ ], FlatColorPickerComponent.prototype, "preview", void 0);
8994
9867
  __decorate([
8995
9868
  Input(),
8996
9869
  __metadata("design:type", String)
8997
- ], ColorPickerComponent.prototype, "icon", void 0);
9870
+ ], FlatColorPickerComponent.prototype, "actionsLayout", void 0);
8998
9871
  __decorate([
8999
9872
  Input(),
9000
- __metadata("design:type", Object)
9001
- ], ColorPickerComponent.prototype, "iconClass", void 0);
9873
+ __metadata("design:type", String)
9874
+ ], FlatColorPickerComponent.prototype, "activeView", void 0);
9002
9875
  __decorate([
9003
9876
  Input(),
9004
- __metadata("design:type", Number),
9005
- __metadata("design:paramtypes", [Number])
9006
- ], ColorPickerComponent.prototype, "tabindex", null);
9877
+ __metadata("design:type", Array)
9878
+ ], FlatColorPickerComponent.prototype, "views", void 0);
9007
9879
  __decorate([
9008
- Output(),
9009
- __metadata("design:type", EventEmitter)
9010
- ], ColorPickerComponent.prototype, "valueChange", void 0);
9880
+ Input(),
9881
+ __metadata("design:type", Object),
9882
+ __metadata("design:paramtypes", [Object])
9883
+ ], FlatColorPickerComponent.prototype, "gradientSettings", null);
9011
9884
  __decorate([
9012
- Output(),
9013
- __metadata("design:type", EventEmitter)
9014
- ], ColorPickerComponent.prototype, "open", void 0);
9885
+ Input(),
9886
+ __metadata("design:type", Object),
9887
+ __metadata("design:paramtypes", [Object])
9888
+ ], FlatColorPickerComponent.prototype, "paletteSettings", null);
9015
9889
  __decorate([
9016
9890
  Output(),
9017
9891
  __metadata("design:type", EventEmitter)
9018
- ], ColorPickerComponent.prototype, "close", void 0);
9892
+ ], FlatColorPickerComponent.prototype, "valueChange", void 0);
9019
9893
  __decorate([
9020
- Output('focus'),
9894
+ Output(),
9021
9895
  __metadata("design:type", EventEmitter)
9022
- ], ColorPickerComponent.prototype, "onFocus", void 0);
9896
+ ], FlatColorPickerComponent.prototype, "cancel", void 0);
9023
9897
  __decorate([
9024
- Output('blur'),
9898
+ Output(),
9025
9899
  __metadata("design:type", EventEmitter)
9026
- ], ColorPickerComponent.prototype, "onBlur", void 0);
9900
+ ], FlatColorPickerComponent.prototype, "activeViewChange", void 0);
9027
9901
  __decorate([
9028
9902
  Output(),
9029
9903
  __metadata("design:type", EventEmitter)
9030
- ], ColorPickerComponent.prototype, "activeColorClick", void 0);
9031
- __decorate([
9032
- ViewChild('container', { read: ViewContainerRef, static: true }),
9033
- __metadata("design:type", ViewContainerRef)
9034
- ], ColorPickerComponent.prototype, "container", void 0);
9904
+ ], FlatColorPickerComponent.prototype, "actionButtonClick", void 0);
9035
9905
  __decorate([
9036
- ViewChild('wrapper', { static: true }),
9037
- __metadata("design:type", ElementRef)
9038
- ], ColorPickerComponent.prototype, "wrapper", void 0);
9906
+ ViewChild('header', { static: false }),
9907
+ __metadata("design:type", FlatColorPickerHeaderComponent)
9908
+ ], FlatColorPickerComponent.prototype, "header", void 0);
9039
9909
  __decorate([
9040
- ViewChild('popupTemplate', { static: true }),
9041
- __metadata("design:type", TemplateRef)
9042
- ], ColorPickerComponent.prototype, "popupTemplate", void 0);
9910
+ ViewChild('gradient', { static: false }),
9911
+ __metadata("design:type", ColorGradientComponent)
9912
+ ], FlatColorPickerComponent.prototype, "gradient", void 0);
9043
9913
  __decorate([
9044
- ViewChild('palette', { read: ElementRef, static: false }),
9045
- __metadata("design:type", ElementRef)
9046
- ], ColorPickerComponent.prototype, "palette", void 0);
9914
+ ViewChild('palette', { static: false }),
9915
+ __metadata("design:type", ColorPaletteComponent)
9916
+ ], FlatColorPickerComponent.prototype, "palette", void 0);
9047
9917
  __decorate([
9048
- ViewChild('colorGradient', { static: false }),
9049
- __metadata("design:type", ColorGradientComponent)
9050
- ], ColorPickerComponent.prototype, "colorGradient", void 0);
9051
- ColorPickerComponent = ColorPickerComponent_1 = __decorate([
9918
+ ViewChild('footer', { static: false }),
9919
+ __metadata("design:type", FlatColorPickerActionButtonsComponent)
9920
+ ], FlatColorPickerComponent.prototype, "footer", void 0);
9921
+ FlatColorPickerComponent = FlatColorPickerComponent_1 = __decorate([
9052
9922
  Component({
9053
- selector: 'kendo-colorpicker',
9054
- providers: [{
9923
+ exportAs: 'kendoFlatColorPicker',
9924
+ selector: 'kendo-flatcolorpicker',
9925
+ providers: [
9926
+ {
9055
9927
  multi: true,
9056
9928
  provide: NG_VALUE_ACCESSOR,
9057
- useExisting: forwardRef(function () { return ColorPickerComponent_1; })
9058
- }, {
9929
+ useExisting: forwardRef(function () { return FlatColorPickerComponent_1; })
9930
+ },
9931
+ {
9059
9932
  provide: KendoInput,
9060
- useExisting: forwardRef(function () { return ColorPickerComponent_1; })
9933
+ useExisting: forwardRef(function () { return FlatColorPickerComponent_1; })
9061
9934
  },
9062
- ColorPickerLocalizationService,
9935
+ FlatColorPickerService,
9936
+ FlatColorPickerLocalizationService,
9063
9937
  {
9064
9938
  provide: LocalizationService,
9065
- useExisting: ColorPickerLocalizationService
9939
+ useExisting: FlatColorPickerLocalizationService
9066
9940
  },
9067
9941
  {
9068
9942
  provide: L10N_PREFIX,
9069
- useValue: 'kendo.colorpicker'
9943
+ useValue: 'kendo.flatcolorpicker'
9070
9944
  }
9071
9945
  ],
9072
- template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorGradient=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorGradient=\"kendo.colorpalette.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-hexInputPlaceholder=\"kendo.colorpicker.hexInputPlaceholder|The placeholder for the HEX color input.\"\n hexInputPlaceholder=\"HEX Color\"\n i18n-redInputPlaceholder=\"kendo.colorpicker.redInputPlaceholder|The placeholder for the red color input.\"\n redInputPlaceholder=\"Red\"\n i18n-greenInputPlaceholder=\"kendo.colorpicker.greenInputPlaceholder|The placeholder for the green color input.\"\n greenInputPlaceholder=\"Green\"\n i18n-blueInputPlaceholder=\"kendo.colorpicker.blueInputPlaceholder|The placeholder for the blue color input.\"\n blueInputPlaceholder=\"Blue\"\n i18n-alphaInputPlaceholder=\"kendo.colorpicker.alphaInputPlaceholder|The placeholder for the alpha input.\"\n alphaInputPlaceholder=\"Alpha\">\n </ng-container>\n <span\n #wrapper\n [ngClass]=\"{\n 'k-picker-wrap': true,\n 'k-state-disabled': this.disabled,\n 'k-state-focused': this.isFocused\n }\"\n role=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"value\"\n [id]=\"focusableId\"\n [attr.tabindex]=\"tabindex\"\n (focus)=\"handleWrapperFocus()\"\n (blur)=\"handleWrapperBlur()\"\n (mousedown)=\"$event.preventDefault()\"\n (keydown)=\"handleWrapperKeyDown($event)\"\n >\n <span *ngIf=\"!iconStyles\" class=\"k-selected-color\" [style.background-color]=\"value\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-icon k-i-line\" *ngIf=\"!value\"></span>\n </span>\n <span *ngIf=\"iconStyles\" class=\"k-tool-icon\" [ngClass]=\"iconStyles\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-selected-color\" [style.background-color]=\"value\"></span>\n </span>\n <span class=\"k-select\" (click)=\"handleWrapperClick()\">\n <span class=\"k-icon k-i-arrow-s\"></span>\n </span>\n </span>\n <ng-template #popupTemplate>\n <kendo-colorgradient #colorGradient\n *ngIf=\"view === 'gradient' || view === 'combo'\"\n [value]=\"value\"\n [format]=\"format\"\n [opacity]=\"gradientSettings.opacity\"\n [clearButton]=\"gradientSettings.clearButton\"\n [delay]=\"gradientSettings.delay\"\n (focusout)=\"handlePopupBlur($event)\"\n (valueChange)=\"handleValueChange($event, false)\"\n (keydown)=\"handlePopupKeyDown($event)\"\n >\n </kendo-colorgradient>\n <kendo-colorpalette\n #palette\n *ngIf=\"view === 'palette' || view === 'combo'\"\n kendoFocusOnDomReady\n [palette]=\"paletteSettings.palette\"\n [columns]=\"paletteSettings.columns\"\n [tileSize]=\"paletteSettings.tileSize\"\n [format]=\"format\"\n [value]=\"value\"\n (blur)=\"handlePopupBlur($event)\"\n (cellSelection)=\"handleValueChange($event, true)\"\n (mousedown)=\"$event.preventDefault()\"\n (keydown)=\"handlePopupKeyDown($event)\"\n >\n </kendo-colorpalette>\n </ng-template>\n <ng-container #container></ng-container>\n "
9073
- }),
9074
- __metadata("design:paramtypes", [PopupService,
9075
- ChangeDetectorRef,
9946
+ template: "\n <ng-container kendoFlatColorPickerLocalizedMessages\n i18n-flatColorPickerNoColor=\"kendo.flatcolorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.flatcolorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.flatcolorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.flatcolorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.flatcolorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.flatcolorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.flatcolorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.flatcolorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.flatcolorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.flatcolorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.flatcolorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.flatcolorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.flatcolorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.flatcolorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.flatcolorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <div kendoFlatColorPickerHeader\n *ngIf=\"headerHasContent\"\n #header\n [clearButton]=\"clearButton\"\n [activeView]=\"activeView\"\n [views]=\"views\"\n [value]=\"value\"\n [selection]=\"selection\"\n [preview]=\"preview\"\n (clearButtonClick)=\"onClearButtonClick()\"\n (viewChange)=\"onViewChange($event)\"\n (valuePaneClick)=\"resetSelection($event)\">\n </div>\n <div class=\"k-coloreditor-views k-vstack\">\n <kendo-colorgradient #gradient\n *ngIf=\"activeView === 'gradient'\"\n [tabindex]=\"null\"\n [value]=\"selection\"\n [format]=\"format\"\n [opacity]=\"gradientSettings.opacity\"\n [delay]=\"gradientSettings.delay\"\n [contrastTool]=\"gradientSettings.contrastTool\"\n [readonly]=\"readonly\"\n (valueChange)=\"handleValueChange($event)\"\n >\n </kendo-colorgradient>\n <kendo-colorpalette #palette\n *ngIf=\"activeView === 'palette'\"\n kendoFocusOnDomReady\n [palette]=\"paletteSettings.palette\"\n [columns]=\"paletteSettings.columns\"\n [tileSize]=\"paletteSettings.tileSize\"\n [format]=\"format\"\n [value]=\"selection\"\n (valueChange)=\"handleValueChange($event)\"\n >\n </kendo-colorpalette>\n </div>\n <div kendoFlatColorPickerActionButtons *ngIf=\"preview\"\n #footer\n [ngClass]=\"'k-justify-content-' + actionsLayout\"\n (actionButtonClick)=\"onAction($event)\">\n </div>\n"
9947
+ }),
9948
+ __metadata("design:paramtypes", [FlatColorPickerService,
9949
+ ElementRef,
9076
9950
  LocalizationService,
9951
+ ChangeDetectorRef,
9952
+ Renderer2,
9077
9953
  NgZone])
9078
- ], ColorPickerComponent);
9079
- return ColorPickerComponent;
9080
- }());
9081
-
9082
- /**
9083
- * @hidden
9084
- */
9085
- var ColorPaletteService = /** @class */ (function () {
9086
- function ColorPaletteService() {
9087
- this.colorRows = [];
9088
- }
9089
- ColorPaletteService.prototype.setColorMatrix = function (palette, columns) {
9090
- this.colorRows = [];
9091
- if (!(isPresent(palette) && palette.length)) {
9092
- return;
9093
- }
9094
- columns = columns || palette.length;
9095
- for (var start = 0; start < palette.length; start += columns) {
9096
- var row = palette.slice(start, columns + start);
9097
- this.colorRows.push(row);
9098
- }
9099
- };
9100
- ColorPaletteService.prototype.getCellCoordsFor = function (color) {
9101
- if (!isPresent(color)) {
9102
- return;
9103
- }
9104
- for (var row = 0; row < this.colorRows.length; row++) {
9105
- for (var col = 0; col < this.colorRows[row].length; col++) {
9106
- if (this.colorRows[row][col] === color) {
9107
- return { row: row, col: col };
9108
- }
9109
- }
9110
- }
9111
- };
9112
- ColorPaletteService.prototype.getColorAt = function (cellCoords) {
9113
- if (!(isPresent(cellCoords) && isPresent(this.colorRows[cellCoords.row]))) {
9114
- return;
9115
- }
9116
- return this.colorRows[cellCoords.row][cellCoords.col];
9117
- };
9118
- ColorPaletteService.prototype.getNextCell = function (current, horizontalStep, verticalStep) {
9119
- if (!(isPresent(current) && isPresent(current.row) && isPresent(current.col))) {
9120
- return { row: 0, col: 0 };
9121
- }
9122
- var row = this.clampIndex(current.row + verticalStep, this.colorRows.length - 1);
9123
- var col = this.clampIndex(current.col + horizontalStep, this.colorRows[row].length - 1);
9124
- return { row: row, col: col };
9125
- };
9126
- ColorPaletteService.prototype.clampIndex = function (index, max) {
9127
- var minArrayIndex = 0;
9128
- if (index < minArrayIndex) {
9129
- return minArrayIndex;
9130
- }
9131
- if (index > max) {
9132
- return max;
9133
- }
9134
- return index;
9135
- };
9136
- ColorPaletteService = __decorate([
9137
- Injectable()
9138
- ], ColorPaletteService);
9139
- return ColorPaletteService;
9954
+ ], FlatColorPickerComponent);
9955
+ return FlatColorPickerComponent;
9140
9956
  }());
9141
9957
 
9142
- /**
9143
- * @hidden
9144
- */
9145
- var ColorPaletteLocalizationService = /** @class */ (function (_super) {
9146
- __extends(ColorPaletteLocalizationService, _super);
9147
- function ColorPaletteLocalizationService(prefix, messageService, _rtl, colorPickerLocalization) {
9148
- var _this = _super.call(this, prefix, messageService, _rtl) || this;
9149
- _this.colorPickerLocalization = colorPickerLocalization;
9150
- return _this;
9151
- }
9152
- ColorPaletteLocalizationService.prototype.get = function (shortKey) {
9153
- if (this.colorPickerLocalization) {
9154
- return this.colorPickerLocalization.get(shortKey);
9155
- }
9156
- return _super.prototype.get.call(this, shortKey);
9157
- };
9158
- ColorPaletteLocalizationService = __decorate([
9159
- __param(0, Inject(L10N_PREFIX)),
9160
- __param(1, Optional()),
9161
- __param(2, Optional()), __param(2, Inject(RTL)),
9162
- __param(3, Optional()), __param(3, Inject(ColorPickerLocalizationService)),
9163
- __metadata("design:paramtypes", [String, MessageService, Boolean, ColorPickerLocalizationService])
9164
- ], ColorPaletteLocalizationService);
9165
- return ColorPaletteLocalizationService;
9166
- }(LocalizationService));
9167
-
9168
- var DEFAULT_TILE_SIZE = 24;
9169
- var DEFAULT_COLUMNS_COUNT = 10;
9170
- var DEFAULT_PRESET$1 = 'office';
9171
- var DEFAULT_ACCESSIBLE_PRESET$1 = 'accessible';
9172
9958
  var serial$2 = 0;
9173
9959
  /**
9174
- * The ColorPalette component provides a set of predefined palette presets and enables you to implement a custom color palette.
9175
- * The ColorPalette is independently used by `kendo-colorpicker` and can be directly added to the page.
9960
+ * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
9961
+ *
9962
+ * The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
9963
+ * which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
9176
9964
  */
9177
- var ColorPaletteComponent = /** @class */ (function () {
9178
- function ColorPaletteComponent(host, service, cdr, renderer, localizationService) {
9965
+ var ColorPickerComponent = /** @class */ (function () {
9966
+ function ColorPickerComponent(popupService, cdr, localizationService, ngZone) {
9179
9967
  var _this = this;
9180
- this.host = host;
9181
- this.service = service;
9968
+ this.popupService = popupService;
9182
9969
  this.cdr = cdr;
9183
- this.renderer = renderer;
9184
9970
  this.localizationService = localizationService;
9971
+ this.ngZone = ngZone;
9972
+ this.hostClasses = true;
9185
9973
  /**
9186
9974
  * @hidden
9187
9975
  */
9188
- this.id = "k-colorpalette-" + serial$2++;
9976
+ this.focusableId = "k-colorpicker-" + serial$2++;
9189
9977
  /**
9190
- * Specifies the output format of the ColorPaletteComponent.
9191
- * The input value may be in a different format. However, it will be parsed into the output `format`
9192
- * after the component processes it.
9978
+ * Specifies the views that will be rendered in the popup.
9979
+ * By default both the gradient and palette views will be rendered.
9980
+ */
9981
+ this.views = ['gradient', 'palette'];
9982
+ /**
9983
+ * Sets the read-only state of the ColorPicker.
9193
9984
  *
9194
- * The supported values are:
9195
- * * (Default) `hex`
9196
- * * `rgba`
9197
- * * `name`
9985
+ * @default false
9198
9986
  */
9199
- this.format = 'hex';
9987
+ this.readonly = false;
9200
9988
  /**
9201
- * Sets the disabled state of the ColorPalette.
9989
+ * Sets the disabled state of the ColorPicker.
9990
+ *
9991
+ * @default false
9202
9992
  */
9203
9993
  this.disabled = false;
9204
9994
  /**
9205
- * Sets the read-only state of the ColorPalette.
9995
+ * Specifies the output format of the ColorPicker.
9996
+ *
9997
+ * If the input value is in a different format, it will be parsed into the specified output `format`.
9998
+ *
9999
+ * The supported values are:
10000
+ * * `rgba` (default)
10001
+ * * `hex`
9206
10002
  */
9207
- this.readonly = false;
10003
+ this.format = 'rgba';
9208
10004
  /**
9209
- * Specifies the size of a color cell.
10005
+ * Specifies whether the ColorPicker should display a 'Clear color' button.
9210
10006
  *
9211
- * The possible values are:
9212
- * * (Default) `tileSize = 24`
9213
- * * `{ width: number, height: number }`
10007
+ * @default true
9214
10008
  */
9215
- this.tileSize = { width: DEFAULT_TILE_SIZE, height: DEFAULT_TILE_SIZE };
10009
+ this.clearButton = true;
9216
10010
  /**
9217
- * Fires each time the color selection is changed.
10011
+ * Displays `Apply` and `Cancel` action buttons and color preview panes.
10012
+ *
10013
+ * When enabled, the component value will not change immediately upon
10014
+ * color selection, but only after the `Apply` button is clicked.
10015
+ *
10016
+ * The `Cancel` button reverts the current selection to its
10017
+ * previous state i.e. to the current value.
10018
+ *
10019
+ * @default false
9218
10020
  */
9219
- this.selectionChange = new EventEmitter();
10021
+ this.preview = false;
10022
+ /**
10023
+ * Configures the layout of the `Apply` and `Cancel` action buttons.
10024
+ *
10025
+ * The possible values are:
10026
+ * * `start`
10027
+ * * `center`
10028
+ * * `end` (default)
10029
+ * * `stretch`
10030
+ */
10031
+ this.actionsLayout = 'end';
9220
10032
  /**
9221
10033
  * Fires each time the value is changed.
9222
10034
  */
9223
10035
  this.valueChange = new EventEmitter();
9224
10036
  /**
9225
- * Fires each time the user selects a cell with the mouse or presses `Enter`.
10037
+ * Fires each time the popup is about to open.
10038
+ * This event is preventable. If you cancel it, the popup will remain closed.
10039
+ */
10040
+ this.open = new EventEmitter();
10041
+ /**
10042
+ * Fires each time the popup is about to close.
10043
+ * This event is preventable. If you cancel it, the popup will remain open.
10044
+ */
10045
+ this.close = new EventEmitter();
10046
+ /**
10047
+ * Fires each time ColorPicker is focused.
10048
+ */
10049
+ this.onFocus = new EventEmitter();
10050
+ /**
10051
+ * Fires each time the ColorPicker is blurred.
10052
+ */
10053
+ this.onBlur = new EventEmitter();
10054
+ /**
10055
+ * Fires when the user cancels the current color selection.
9226
10056
  *
9227
- * @hidden
10057
+ * Fires on preview pane or 'Cancel' button click.
9228
10058
  */
9229
- this.cellSelection = new EventEmitter();
10059
+ this.cancel = new EventEmitter();
9230
10060
  /**
9231
- * @hidden
10061
+ * Fires each time the left side of the ColorPicker wrapper is clicked.
10062
+ * The event is triggered regardless of whether a ColorPicker icon is set or not.
10063
+ *
10064
+ * The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
9232
10065
  */
9233
- this.hostClasses = true;
10066
+ this.activeColorClick = new EventEmitter();
10067
+ /**
10068
+ * Fires each time the view is about to change.
10069
+ * Used to provide a two-way binding for the `activeView` property.
10070
+ */
10071
+ this.activeViewChange = new EventEmitter();
9234
10072
  this._tabindex = 0;
10073
+ this._popupSettings = { animate: true };
10074
+ this._paletteSettings = {};
10075
+ this._gradientSettings = { opacity: true, delay: 0 };
9235
10076
  this.notifyNgTouched = function () { };
9236
10077
  this.notifyNgChanged = function () { };
9237
- this.dynamicRTLSubscription = localizationService.changes.subscribe(function (_a) {
10078
+ validatePackage(packageMetadata);
10079
+ this.dynamicRTLSubscription = this.localizationService.changes.subscribe(function (_a) {
9238
10080
  var rtl = _a.rtl;
9239
10081
  _this.direction = rtl ? 'rtl' : 'ltr';
9240
10082
  });
9241
10083
  }
9242
- ColorPaletteComponent_1 = ColorPaletteComponent;
9243
- Object.defineProperty(ColorPaletteComponent.prototype, "paletteId", {
9244
- /**
9245
- * @hidden
9246
- */
9247
- get: function () {
9248
- return this.id;
9249
- },
9250
- enumerable: true,
9251
- configurable: true
9252
- });
9253
- Object.defineProperty(ColorPaletteComponent.prototype, "value", {
10084
+ ColorPickerComponent_1 = ColorPickerComponent;
10085
+ Object.defineProperty(ColorPickerComponent.prototype, "value", {
9254
10086
  get: function () {
9255
10087
  return this._value;
9256
10088
  },
@@ -9258,396 +10090,543 @@ var ColorPaletteComponent = /** @class */ (function () {
9258
10090
  * Specifies the value of the initially selected color.
9259
10091
  */
9260
10092
  set: function (value) {
9261
- this._value = parseColor$1(value, this.format);
10093
+ this._value = parseColor$1(value, this.format, this.gradientSettings.opacity);
9262
10094
  },
9263
10095
  enumerable: true,
9264
10096
  configurable: true
9265
10097
  });
9266
- Object.defineProperty(ColorPaletteComponent.prototype, "columns", {
10098
+ Object.defineProperty(ColorPickerComponent.prototype, "popupSettings", {
9267
10099
  get: function () {
9268
- return this._columns;
10100
+ return this._popupSettings;
9269
10101
  },
9270
10102
  /**
9271
- * Specifies the number of columns that will be displayed.
9272
- * Defaults to `10`.
10103
+ * Configures the popup of the ColorPicker.
9273
10104
  */
9274
10105
  set: function (value) {
9275
- var minColumnsCount = 1;
9276
- this._columns = value > minColumnsCount ? value : minColumnsCount;
10106
+ this._popupSettings = Object.assign(this._popupSettings, value);
9277
10107
  },
9278
10108
  enumerable: true,
9279
10109
  configurable: true
9280
10110
  });
9281
- Object.defineProperty(ColorPaletteComponent.prototype, "palette", {
10111
+ Object.defineProperty(ColorPickerComponent.prototype, "paletteSettings", {
9282
10112
  get: function () {
9283
- return this._palette;
10113
+ return this._paletteSettings;
9284
10114
  },
9285
10115
  /**
9286
- * The color palette that will be displayed.
9287
- *
9288
- * The supported values are:
9289
- * * The name of the predefined palette preset (for example, `office`, `basic`, and `apex`).
9290
- * * A string with comma-separated colors.
9291
- * * A string array.
10116
+ * Configures the palette that is displayed in the ColorPicker popup.
9292
10117
  */
9293
10118
  set: function (value) {
9294
- var _this = this;
9295
- if (!isPresent(value)) {
9296
- value = DEFAULT_PRESET$1;
9297
- }
9298
- if (typeof value === 'string' && isPresent(PALETTEPRESETS[value])) {
9299
- this.columns = this.columns || PALETTEPRESETS[value].columns;
9300
- value = PALETTEPRESETS[value].colors;
9301
- }
9302
- var colors = (typeof value === 'string') ? value.split(',') : value;
9303
- this._palette = colors.map(function (color) { return parseColor$1(color, _this.format, false); });
10119
+ this._paletteSettings = Object.assign(this._paletteSettings, value);
9304
10120
  },
9305
10121
  enumerable: true,
9306
10122
  configurable: true
9307
10123
  });
9308
- Object.defineProperty(ColorPaletteComponent.prototype, "tabindex", {
10124
+ Object.defineProperty(ColorPickerComponent.prototype, "gradientSettings", {
9309
10125
  get: function () {
9310
- return !this.disabled ? this._tabindex : undefined;
10126
+ return this._gradientSettings;
9311
10127
  },
9312
10128
  /**
9313
- * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
10129
+ * Configures the gradient that is displayed in the ColorPicker popup.
9314
10130
  */
9315
10131
  set: function (value) {
9316
- var tabindex = Number(value);
9317
- var defaultValue = 0;
9318
- this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
10132
+ this._gradientSettings = Object.assign(this._gradientSettings, value);
9319
10133
  },
9320
10134
  enumerable: true,
9321
10135
  configurable: true
9322
10136
  });
9323
- Object.defineProperty(ColorPaletteComponent.prototype, "tileLayout", {
9324
- /**
9325
- * @hidden
9326
- */
10137
+ Object.defineProperty(ColorPickerComponent.prototype, "tabindex", {
9327
10138
  get: function () {
9328
- if (typeof this.tileSize !== 'number') {
9329
- return this.tileSize;
9330
- }
9331
- return { width: this.tileSize, height: this.tileSize };
9332
- },
9333
- enumerable: true,
9334
- configurable: true
9335
- });
9336
- Object.defineProperty(ColorPaletteComponent.prototype, "colorRows", {
10139
+ return !this.disabled ? this._tabindex : undefined;
10140
+ },
9337
10141
  /**
9338
- * @hidden
10142
+ * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
10143
+ *
10144
+ * @default 0
9339
10145
  */
9340
- get: function () {
9341
- return this.service.colorRows;
10146
+ set: function (value) {
10147
+ var tabindex = Number(value);
10148
+ var defaultValue = 0;
10149
+ this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
9342
10150
  },
9343
10151
  enumerable: true,
9344
10152
  configurable: true
9345
10153
  });
9346
- Object.defineProperty(ColorPaletteComponent.prototype, "hostTabindex", {
10154
+ Object.defineProperty(ColorPickerComponent.prototype, "isOpen", {
9347
10155
  /**
9348
- * @hidden
10156
+ * Indicates whether the ColorPicker popup is open.
9349
10157
  */
9350
- get: function () { return this.tabindex; },
10158
+ get: function () {
10159
+ return isPresent(this.popupRef);
10160
+ },
9351
10161
  enumerable: true,
9352
10162
  configurable: true
9353
10163
  });
9354
- Object.defineProperty(ColorPaletteComponent.prototype, "disabledClass", {
10164
+ Object.defineProperty(ColorPickerComponent.prototype, "iconStyles", {
9355
10165
  /**
9356
10166
  * @hidden
9357
10167
  */
9358
- get: function () { return this.disabled; },
10168
+ get: function () {
10169
+ if (this.iconClass) {
10170
+ return this.iconClass;
10171
+ }
10172
+ if (this.icon) {
10173
+ return "k-icon k-i-" + this.icon;
10174
+ }
10175
+ },
9359
10176
  enumerable: true,
9360
10177
  configurable: true
9361
10178
  });
9362
- Object.defineProperty(ColorPaletteComponent.prototype, "readonlyAttribute", {
10179
+ ColorPickerComponent.prototype.ngOnInit = function () {
10180
+ var defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
10181
+ var settingsPalette = this._paletteSettings.palette;
10182
+ var presetColumns = typeof settingsPalette === 'string' && PALETTEPRESETS[settingsPalette] ?
10183
+ PALETTEPRESETS[settingsPalette].columns :
10184
+ undefined;
10185
+ this._paletteSettings = {
10186
+ palette: settingsPalette || defaultPreset,
10187
+ tileSize: this._paletteSettings.tileSize || 24,
10188
+ columns: this._paletteSettings.columns || presetColumns || 10
10189
+ };
10190
+ };
10191
+ ColorPickerComponent.prototype.ngOnChanges = function (changes) {
10192
+ if (changes.format && changes.format.currentValue === 'name') {
10193
+ this.activeView = 'palette';
10194
+ }
10195
+ if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
10196
+ this.format = 'rgba';
10197
+ this.value = parseColor$1(this.value, this.format, this.gradientSettings.opacity);
10198
+ }
10199
+ };
10200
+ ColorPickerComponent.prototype.ngOnDestroy = function () {
10201
+ this.closePopup();
10202
+ if (this.dynamicRTLSubscription) {
10203
+ this.dynamicRTLSubscription.unsubscribe();
10204
+ }
10205
+ };
10206
+ Object.defineProperty(ColorPickerComponent.prototype, "colorPickerAriaLabel", {
9363
10207
  /**
9364
10208
  * @hidden
9365
10209
  */
9366
- get: function () { return this.readonly; },
10210
+ get: function () {
10211
+ return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
10212
+ },
9367
10213
  enumerable: true,
9368
10214
  configurable: true
9369
10215
  });
9370
- ColorPaletteComponent.prototype.ngOnInit = function () {
9371
- if (this.colorRows.length === 0) {
9372
- var defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET$1 : DEFAULT_ACCESSIBLE_PRESET$1;
9373
- this.palette = this.palette || defaultPreset;
9374
- this.setRows();
9375
- this.focusedCell = this.service.getCellCoordsFor(this.value);
9376
- }
10216
+ /**
10217
+ * @hidden
10218
+ */
10219
+ ColorPickerComponent.prototype.handleCancelEvent = function (ev) {
10220
+ this.cancel.emit(ev);
9377
10221
  };
9378
- ColorPaletteComponent.prototype.ngAfterViewInit = function () {
9379
- this.setHostElementAriaLabel();
10222
+ /**
10223
+ * @hidden
10224
+ */
10225
+ ColorPickerComponent.prototype.togglePopup = function () {
10226
+ this.toggleWithEvents(!this.isOpen);
10227
+ this.focus();
9380
10228
  };
9381
- ColorPaletteComponent.prototype.ngOnDestroy = function () {
9382
- if (this.dynamicRTLSubscription) {
9383
- this.dynamicRTLSubscription.unsubscribe();
10229
+ /**
10230
+ * @hidden
10231
+ */
10232
+ ColorPickerComponent.prototype.handleActiveColorClick = function () {
10233
+ this.focus();
10234
+ var event = new ActiveColorClickEvent(this.value);
10235
+ this.activeColorClick.emit(event);
10236
+ if (!event.isOpenPrevented() || this.isOpen) {
10237
+ this.togglePopup();
9384
10238
  }
9385
10239
  };
9386
- ColorPaletteComponent.prototype.ngOnChanges = function (changes) {
9387
- if (changes.palette || changes.columns) {
9388
- this.setRows();
9389
- }
9390
- if (changes.palette || changes.value || changes.columns) {
9391
- this.focusedCell = this.service.getCellCoordsFor(this.value);
9392
- this.setHostElementAriaLabel();
10240
+ /**
10241
+ * Focuses the wrapper of the ColorPicker.
10242
+ */
10243
+ ColorPickerComponent.prototype.focus = function () {
10244
+ if (this.disabled) {
10245
+ return;
9393
10246
  }
10247
+ this.wrapper.nativeElement.focus();
9394
10248
  };
9395
10249
  /**
9396
10250
  * @hidden
9397
10251
  */
9398
- ColorPaletteComponent.prototype.handleKeydown = function (event) {
9399
- var isRTL = this.direction === 'rtl';
9400
- switch (event.keyCode) {
9401
- case Keys.ArrowDown:
9402
- this.handleCellNavigation(0, 1);
9403
- break;
9404
- case Keys.ArrowUp:
9405
- this.handleCellNavigation(0, -1);
9406
- break;
9407
- case Keys.ArrowRight:
9408
- this.handleCellNavigation(isRTL ? -1 : 1, 0);
9409
- break;
9410
- case Keys.ArrowLeft:
9411
- this.handleCellNavigation(isRTL ? 1 : -1, 0);
9412
- break;
9413
- case Keys.Enter:
9414
- this.handleEnter();
9415
- break;
9416
- default: return;
10252
+ ColorPickerComponent.prototype.handleWrapperFocus = function () {
10253
+ if (this.isFocused) {
10254
+ return;
9417
10255
  }
9418
- event.preventDefault();
10256
+ this.isFocused = true;
10257
+ this.onFocus.emit();
10258
+ };
10259
+ /**
10260
+ * Blurs the ColorPicker.
10261
+ */
10262
+ ColorPickerComponent.prototype.blur = function () {
10263
+ this.wrapper.nativeElement.blur();
9419
10264
  };
9420
10265
  /**
9421
10266
  * @hidden
9422
10267
  */
9423
- ColorPaletteComponent.prototype.handleHostBlur = function () {
10268
+ ColorPickerComponent.prototype.handleWrapperBlur = function () {
10269
+ if (this.isOpen) {
10270
+ return;
10271
+ }
10272
+ this.isFocused = false;
10273
+ this.onBlur.emit();
9424
10274
  this.notifyNgTouched();
9425
- this.handleCellFocusOnBlur();
9426
10275
  };
9427
10276
  /**
9428
- * @hidden
10277
+ * Clears the value of the ColorPicker.
9429
10278
  */
9430
- ColorPaletteComponent.prototype.handleCellSelection = function (value, cell) {
9431
- if (this.readonly) {
10279
+ ColorPickerComponent.prototype.reset = function () {
10280
+ if (!isPresent(this.value)) {
9432
10281
  return;
9433
10282
  }
9434
- this.selectedCell = cell;
9435
- this.focusedCell = this.selectedCell;
9436
- this.focusInComponent = true;
9437
- var parsedColor = parseColor$1(value, this.format, false);
9438
- this.cellSelection.emit(parsedColor);
9439
- if (this.value !== parsedColor) {
10283
+ this._value = undefined;
10284
+ this.notifyNgChanged(undefined);
10285
+ };
10286
+ /**
10287
+ * Toggles the popup of the ColorPicker.
10288
+ * Does not trigger the `open` and `close` events of the component.
10289
+ *
10290
+ * @param open An optional parameter. Specifies whether the popup will be opened or closed.
10291
+ */
10292
+ ColorPickerComponent.prototype.toggle = function (open) {
10293
+ if (this.disabled || this.readonly) {
10294
+ return;
10295
+ }
10296
+ this.closePopup();
10297
+ open = isPresent(open) ? open : !this.isOpen;
10298
+ if (open) {
10299
+ this.openPopup();
10300
+ }
10301
+ };
10302
+ /**
10303
+ * @hidden
10304
+ */
10305
+ ColorPickerComponent.prototype.handleValueChange = function (color) {
10306
+ var parsedColor = parseColor$1(color, this.format, this.gradientSettings.opacity);
10307
+ var valueChange = parsedColor !== this.value;
10308
+ if (valueChange) {
9440
10309
  this.value = parsedColor;
9441
10310
  this.valueChange.emit(parsedColor);
9442
10311
  this.notifyNgChanged(parsedColor);
9443
- this.setHostElementAriaLabel();
9444
- }
9445
- if (this.selection !== parsedColor) {
9446
- this.selection = parsedColor;
9447
- this.selectionChange.emit(parsedColor);
9448
10312
  }
9449
- if (cell) {
9450
- this.activeCellId = this.selectedCell.row + "-" + this.selectedCell.col;
10313
+ };
10314
+ /**
10315
+ * @hidden
10316
+ */
10317
+ ColorPickerComponent.prototype.handlePopupBlur = function (event) {
10318
+ if (this.popupBlurInvalid(event)) {
10319
+ return;
9451
10320
  }
10321
+ this.isFocused = false;
10322
+ this.onBlur.emit();
10323
+ this.notifyNgTouched();
10324
+ this.toggleWithEvents(false);
9452
10325
  };
9453
10326
  /**
9454
10327
  * @hidden
9455
10328
  */
9456
- ColorPaletteComponent.prototype.writeValue = function (value) {
10329
+ ColorPickerComponent.prototype.writeValue = function (value) {
9457
10330
  this.value = value;
9458
- this.focusedCell = this.service.getCellCoordsFor(this.value);
9459
10331
  };
9460
10332
  /**
9461
10333
  * @hidden
9462
10334
  */
9463
- ColorPaletteComponent.prototype.registerOnChange = function (fn) {
10335
+ ColorPickerComponent.prototype.registerOnChange = function (fn) {
9464
10336
  this.notifyNgChanged = fn;
9465
10337
  };
9466
10338
  /**
9467
10339
  * @hidden
9468
10340
  */
9469
- ColorPaletteComponent.prototype.registerOnTouched = function (fn) {
10341
+ ColorPickerComponent.prototype.registerOnTouched = function (fn) {
9470
10342
  this.notifyNgTouched = fn;
9471
10343
  };
9472
10344
  /**
9473
10345
  * @hidden
9474
10346
  */
9475
- ColorPaletteComponent.prototype.setDisabledState = function (isDisabled) {
10347
+ ColorPickerComponent.prototype.setDisabledState = function (isDisabled) {
9476
10348
  this.cdr.markForCheck();
9477
10349
  this.disabled = isDisabled;
9478
10350
  };
9479
10351
  /**
9480
10352
  * @hidden
9481
- * Used by the TextBoxContainer to determine if the component is empty.
9482
10353
  */
9483
- ColorPaletteComponent.prototype.isEmpty = function () {
9484
- return false;
10354
+ ColorPickerComponent.prototype.handleWrapperKeyDown = function (event) {
10355
+ if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
10356
+ event.preventDefault();
10357
+ this.toggleWithEvents(true);
10358
+ }
9485
10359
  };
9486
10360
  /**
9487
- * Clears the color value of the ColorPalette.
10361
+ * @hidden
9488
10362
  */
9489
- ColorPaletteComponent.prototype.reset = function () {
9490
- this.focusedCell = null;
9491
- if (isPresent(this.value)) {
9492
- this._value = undefined;
9493
- this.notifyNgChanged(undefined);
10363
+ ColorPickerComponent.prototype.handlePopupKeyDown = function (event) {
10364
+ if (event.keyCode === Keys.Escape) {
10365
+ this.toggleWithEvents(false);
10366
+ this.wrapper.nativeElement.focus();
10367
+ }
10368
+ if (event.keyCode === Keys.Tab) {
10369
+ var currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
10370
+ var nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
10371
+ if (event.target === currentElement) {
10372
+ event.preventDefault();
10373
+ nextElement.nativeElement.focus();
10374
+ }
9494
10375
  }
9495
10376
  };
9496
- ColorPaletteComponent.prototype.handleCellFocusOnBlur = function () {
9497
- this.focusInComponent = false;
9498
- this.focusedCell = this.selectedCell;
10377
+ /**
10378
+ * @hidden
10379
+ * Used by the FloatingLabel to determine if the component is empty.
10380
+ */
10381
+ ColorPickerComponent.prototype.isEmpty = function () {
10382
+ return false;
9499
10383
  };
9500
- ColorPaletteComponent.prototype.setRows = function () {
9501
- if (!isPresent(this.palette)) {
9502
- return;
9503
- }
9504
- this.columns = this.columns || DEFAULT_COLUMNS_COUNT;
9505
- this.service.setColorMatrix(this.palette, this.columns);
10384
+ ColorPickerComponent.prototype.popupBlurInvalid = function (ev) {
10385
+ var focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
10386
+ var wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
10387
+ return !this.isFocused || wrapperClicked || focusInPopupElement;
9506
10388
  };
9507
- ColorPaletteComponent.prototype.handleCellNavigation = function (horizontalStep, verticalStep) {
9508
- if (this.readonly) {
10389
+ ColorPickerComponent.prototype.toggleWithEvents = function (open) {
10390
+ var sameState = this.isOpen === open;
10391
+ if (this.disabled || this.readonly || sameState) {
9509
10392
  return;
9510
10393
  }
9511
- this.focusedCell = this.service.getNextCell(this.focusedCell, horizontalStep, verticalStep);
9512
- this.focusInComponent = true;
10394
+ var eventArgs;
10395
+ if (open) {
10396
+ eventArgs = new ColorPickerOpenEvent();
10397
+ this.open.emit(eventArgs);
10398
+ }
10399
+ else {
10400
+ eventArgs = new ColorPickerCloseEvent();
10401
+ this.close.emit(eventArgs);
10402
+ }
10403
+ if (!eventArgs.isDefaultPrevented()) {
10404
+ this.toggle(open);
10405
+ }
10406
+ if (open) {
10407
+ this.focusFirstElement();
10408
+ }
9513
10409
  };
9514
- ColorPaletteComponent.prototype.setHostElementAriaLabel = function () {
9515
- var parsed = parseColor$1(this.value, this.format);
9516
- this.renderer.setAttribute(this.host.nativeElement, 'aria-label', "" + (this.value ? parsed : this.localizationService.get('colorPaletteNoColor')));
10410
+ ColorPickerComponent.prototype.focusFirstElement = function () {
10411
+ var _this = this;
10412
+ this.ngZone.runOutsideAngular(function () {
10413
+ setTimeout(function () {
10414
+ var elementToFocus = _this.flatColorPicker.gradient ? _this.flatColorPicker.gradient.gradientDragHandle :
10415
+ _this.flatColorPicker.palette.host;
10416
+ elementToFocus.nativeElement.focus();
10417
+ });
10418
+ });
10419
+ };
10420
+ ColorPickerComponent.prototype.openPopup = function () {
10421
+ var _this = this;
10422
+ var horizontalAlign = this.direction === "rtl" ? "right" : "left";
10423
+ var anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
10424
+ var popupPosition = { horizontal: horizontalAlign, vertical: "top" };
10425
+ this.popupRef = this.popupService.open({
10426
+ anchor: this.wrapper,
10427
+ animate: this.popupSettings.animate,
10428
+ appendTo: this.popupSettings.appendTo,
10429
+ popupAlign: popupPosition,
10430
+ anchorAlign: anchorPosition,
10431
+ popupClass: 'k-colorpicker-popup',
10432
+ content: this.popupTemplate,
10433
+ positionMode: 'absolute'
10434
+ });
10435
+ this.popupRef.popupAnchorViewportLeave.subscribe(function () {
10436
+ _this.toggleWithEvents(false);
10437
+ if (!_this.isOpen) {
10438
+ _this.wrapper.nativeElement.focus({
10439
+ preventScroll: true
10440
+ });
10441
+ }
10442
+ });
9517
10443
  };
9518
- ColorPaletteComponent.prototype.handleEnter = function () {
9519
- if (!isPresent(this.focusedCell)) {
10444
+ ColorPickerComponent.prototype.closePopup = function () {
10445
+ if (!this.isOpen) {
9520
10446
  return;
9521
10447
  }
9522
- var selectedColor = this.service.getColorAt(this.focusedCell);
9523
- this.handleCellSelection(selectedColor, this.focusedCell);
10448
+ this.popupRef.close();
10449
+ this.popupRef = null;
9524
10450
  };
9525
- var ColorPaletteComponent_1;
10451
+ Object.defineProperty(ColorPickerComponent.prototype, "firstFocusableElement", {
10452
+ get: function () {
10453
+ if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
10454
+ return this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle : this.flatColorPicker.palette.host;
10455
+ }
10456
+ return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
10457
+ },
10458
+ enumerable: true,
10459
+ configurable: true
10460
+ });
10461
+ Object.defineProperty(ColorPickerComponent.prototype, "lastFocusableElement", {
10462
+ get: function () {
10463
+ if (this.preview) {
10464
+ return this.flatColorPicker.footer.lastButton;
10465
+ }
10466
+ if (this.flatColorPicker.palette) {
10467
+ return this.flatColorPicker.palette.host;
10468
+ }
10469
+ return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
10470
+ },
10471
+ enumerable: true,
10472
+ configurable: true
10473
+ });
10474
+ var ColorPickerComponent_1;
10475
+ __decorate([
10476
+ HostBinding('class.k-colorpicker'),
10477
+ __metadata("design:type", Boolean)
10478
+ ], ColorPickerComponent.prototype, "hostClasses", void 0);
9526
10479
  __decorate([
9527
10480
  HostBinding('attr.dir'),
9528
10481
  __metadata("design:type", String)
9529
- ], ColorPaletteComponent.prototype, "direction", void 0);
10482
+ ], ColorPickerComponent.prototype, "direction", void 0);
9530
10483
  __decorate([
9531
- HostBinding('attr.id'),
9532
- __metadata("design:type", String),
9533
- __metadata("design:paramtypes", [])
9534
- ], ColorPaletteComponent.prototype, "paletteId", null);
10484
+ Input(),
10485
+ __metadata("design:type", String)
10486
+ ], ColorPickerComponent.prototype, "focusableId", void 0);
10487
+ __decorate([
10488
+ Input(),
10489
+ __metadata("design:type", Array)
10490
+ ], ColorPickerComponent.prototype, "views", void 0);
9535
10491
  __decorate([
9536
10492
  Input(),
9537
10493
  __metadata("design:type", String)
9538
- ], ColorPaletteComponent.prototype, "id", void 0);
10494
+ ], ColorPickerComponent.prototype, "activeView", void 0);
10495
+ __decorate([
10496
+ Input(),
10497
+ __metadata("design:type", Boolean)
10498
+ ], ColorPickerComponent.prototype, "readonly", void 0);
10499
+ __decorate([
10500
+ Input(),
10501
+ __metadata("design:type", Boolean)
10502
+ ], ColorPickerComponent.prototype, "disabled", void 0);
9539
10503
  __decorate([
9540
10504
  Input(),
9541
10505
  __metadata("design:type", String)
9542
- ], ColorPaletteComponent.prototype, "format", void 0);
10506
+ ], ColorPickerComponent.prototype, "format", void 0);
9543
10507
  __decorate([
9544
10508
  Input(),
9545
10509
  __metadata("design:type", String),
9546
10510
  __metadata("design:paramtypes", [String])
9547
- ], ColorPaletteComponent.prototype, "value", null);
10511
+ ], ColorPickerComponent.prototype, "value", null);
9548
10512
  __decorate([
9549
10513
  Input(),
9550
- __metadata("design:type", Number),
9551
- __metadata("design:paramtypes", [Number])
9552
- ], ColorPaletteComponent.prototype, "columns", null);
10514
+ __metadata("design:type", Object),
10515
+ __metadata("design:paramtypes", [Object])
10516
+ ], ColorPickerComponent.prototype, "popupSettings", null);
9553
10517
  __decorate([
9554
10518
  Input(),
9555
10519
  __metadata("design:type", Object),
9556
10520
  __metadata("design:paramtypes", [Object])
9557
- ], ColorPaletteComponent.prototype, "palette", null);
10521
+ ], ColorPickerComponent.prototype, "paletteSettings", null);
9558
10522
  __decorate([
9559
10523
  Input(),
9560
- __metadata("design:type", Number),
9561
- __metadata("design:paramtypes", [Number])
9562
- ], ColorPaletteComponent.prototype, "tabindex", null);
10524
+ __metadata("design:type", Object),
10525
+ __metadata("design:paramtypes", [Object])
10526
+ ], ColorPickerComponent.prototype, "gradientSettings", null);
10527
+ __decorate([
10528
+ Input(),
10529
+ __metadata("design:type", String)
10530
+ ], ColorPickerComponent.prototype, "icon", void 0);
10531
+ __decorate([
10532
+ Input(),
10533
+ __metadata("design:type", Object)
10534
+ ], ColorPickerComponent.prototype, "iconClass", void 0);
9563
10535
  __decorate([
9564
10536
  Input(),
9565
10537
  __metadata("design:type", Boolean)
9566
- ], ColorPaletteComponent.prototype, "disabled", void 0);
10538
+ ], ColorPickerComponent.prototype, "clearButton", void 0);
10539
+ __decorate([
10540
+ Input(),
10541
+ __metadata("design:type", Number),
10542
+ __metadata("design:paramtypes", [Number])
10543
+ ], ColorPickerComponent.prototype, "tabindex", null);
9567
10544
  __decorate([
9568
10545
  Input(),
9569
10546
  __metadata("design:type", Boolean)
9570
- ], ColorPaletteComponent.prototype, "readonly", void 0);
10547
+ ], ColorPickerComponent.prototype, "preview", void 0);
9571
10548
  __decorate([
9572
10549
  Input(),
9573
- __metadata("design:type", Object)
9574
- ], ColorPaletteComponent.prototype, "tileSize", void 0);
10550
+ __metadata("design:type", String)
10551
+ ], ColorPickerComponent.prototype, "actionsLayout", void 0);
9575
10552
  __decorate([
9576
10553
  Output(),
9577
10554
  __metadata("design:type", EventEmitter)
9578
- ], ColorPaletteComponent.prototype, "selectionChange", void 0);
10555
+ ], ColorPickerComponent.prototype, "valueChange", void 0);
9579
10556
  __decorate([
9580
10557
  Output(),
9581
10558
  __metadata("design:type", EventEmitter)
9582
- ], ColorPaletteComponent.prototype, "valueChange", void 0);
10559
+ ], ColorPickerComponent.prototype, "open", void 0);
9583
10560
  __decorate([
9584
10561
  Output(),
9585
10562
  __metadata("design:type", EventEmitter)
9586
- ], ColorPaletteComponent.prototype, "cellSelection", void 0);
10563
+ ], ColorPickerComponent.prototype, "close", void 0);
9587
10564
  __decorate([
9588
- HostBinding('attr.tabindex'),
9589
- __metadata("design:type", Number),
9590
- __metadata("design:paramtypes", [])
9591
- ], ColorPaletteComponent.prototype, "hostTabindex", null);
10565
+ Output('focus'),
10566
+ __metadata("design:type", EventEmitter)
10567
+ ], ColorPickerComponent.prototype, "onFocus", void 0);
9592
10568
  __decorate([
9593
- HostBinding('class.k-colorpalette'),
9594
- __metadata("design:type", Boolean)
9595
- ], ColorPaletteComponent.prototype, "hostClasses", void 0);
10569
+ Output('blur'),
10570
+ __metadata("design:type", EventEmitter)
10571
+ ], ColorPickerComponent.prototype, "onBlur", void 0);
9596
10572
  __decorate([
9597
- HostBinding('attr.aria-disabled'),
9598
- HostBinding('class.k-state-disabled'),
9599
- __metadata("design:type", Boolean),
9600
- __metadata("design:paramtypes", [])
9601
- ], ColorPaletteComponent.prototype, "disabledClass", null);
10573
+ Output(),
10574
+ __metadata("design:type", EventEmitter)
10575
+ ], ColorPickerComponent.prototype, "cancel", void 0);
9602
10576
  __decorate([
9603
- HostBinding('attr.aria-readonly'),
9604
- __metadata("design:type", Boolean),
9605
- __metadata("design:paramtypes", [])
9606
- ], ColorPaletteComponent.prototype, "readonlyAttribute", null);
10577
+ Output(),
10578
+ __metadata("design:type", EventEmitter)
10579
+ ], ColorPickerComponent.prototype, "activeColorClick", void 0);
9607
10580
  __decorate([
9608
- HostListener('keydown', ['$event']),
9609
- __metadata("design:type", Function),
9610
- __metadata("design:paramtypes", [Object]),
9611
- __metadata("design:returntype", void 0)
9612
- ], ColorPaletteComponent.prototype, "handleKeydown", null);
10581
+ Output(),
10582
+ __metadata("design:type", EventEmitter)
10583
+ ], ColorPickerComponent.prototype, "activeViewChange", void 0);
9613
10584
  __decorate([
9614
- HostListener('blur'),
9615
- __metadata("design:type", Function),
9616
- __metadata("design:paramtypes", []),
9617
- __metadata("design:returntype", void 0)
9618
- ], ColorPaletteComponent.prototype, "handleHostBlur", null);
9619
- ColorPaletteComponent = ColorPaletteComponent_1 = __decorate([
10585
+ ViewChild('container', { read: ViewContainerRef, static: true }),
10586
+ __metadata("design:type", ViewContainerRef)
10587
+ ], ColorPickerComponent.prototype, "container", void 0);
10588
+ __decorate([
10589
+ ViewChild('wrapper', { static: true }),
10590
+ __metadata("design:type", ElementRef)
10591
+ ], ColorPickerComponent.prototype, "wrapper", void 0);
10592
+ __decorate([
10593
+ ViewChild('popupTemplate', { static: true }),
10594
+ __metadata("design:type", TemplateRef)
10595
+ ], ColorPickerComponent.prototype, "popupTemplate", void 0);
10596
+ __decorate([
10597
+ ViewChild('flatColorPicker', { static: false }),
10598
+ __metadata("design:type", FlatColorPickerComponent)
10599
+ ], ColorPickerComponent.prototype, "flatColorPicker", void 0);
10600
+ ColorPickerComponent = ColorPickerComponent_1 = __decorate([
9620
10601
  Component({
9621
- selector: 'kendo-colorpalette',
9622
- providers: [
9623
- {
10602
+ exportAs: 'kendoColorPicker',
10603
+ selector: 'kendo-colorpicker',
10604
+ providers: [{
9624
10605
  multi: true,
9625
10606
  provide: NG_VALUE_ACCESSOR,
9626
- useExisting: forwardRef(function () { return ColorPaletteComponent_1; }) // tslint:disable-line:no-forward-ref
10607
+ useExisting: forwardRef(function () { return ColorPickerComponent_1; })
9627
10608
  }, {
9628
10609
  provide: KendoInput,
9629
- useExisting: forwardRef(function () { return ColorPaletteComponent_1; })
10610
+ useExisting: forwardRef(function () { return ColorPickerComponent_1; })
9630
10611
  },
9631
- ColorPaletteService,
9632
- ColorPaletteLocalizationService,
10612
+ ColorPickerLocalizationService,
9633
10613
  {
9634
10614
  provide: LocalizationService,
9635
- useExisting: ColorPaletteLocalizationService
10615
+ useExisting: ColorPickerLocalizationService
9636
10616
  },
9637
10617
  {
9638
10618
  provide: L10N_PREFIX,
9639
- useValue: 'kendo.colorpalette'
10619
+ useValue: 'kendo.colorpicker'
9640
10620
  }
9641
10621
  ],
9642
- template: "\n <ng-container kendoColorPaletteLocalizedMessages\n i18n-colorPaletteNoColor=\"kendo.colorpalette.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\">\n </ng-container>\n <div role=\"listbox\" class=\"k-colorpalette-table-wrap\"\n [attr.aria-activedescendant]=\"activeCellId\">\n <table class=\"k-colorpalette-table k-palette\">\n <tbody>\n <tr *ngFor=\"let row of colorRows; let rowIndex = index\">\n <td *ngFor=\"let color of row; let colIndex = index\"\n role=\"option\"\n [class.k-state-selected]=\"selectedCell?.row === rowIndex && selectedCell?.col === colIndex\"\n [class.k-state-focus]=\"focusInComponent && focusedCell?.row === rowIndex && focusedCell?.col === colIndex\"\n [attr.aria-selected]=\"selectedCell?.row === rowIndex && selectedCell?.col === colIndex\"\n [attr.aria-label]=\"color\"\n class=\"k-colorpalette-tile\"\n [id]=\"rowIndex + '-' + colIndex\"\n [attr.value]=\"color\"\n (click)=\"handleCellSelection(color, { row: rowIndex, col: colIndex })\"\n [ngStyle]=\"{\n backgroundColor: color,\n width: tileLayout.width + 'px',\n height: tileLayout.height + 'px',\n minWidth: tileLayout.width + 'px'\n }\">\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n "
10622
+ template: "\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor=\"kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty.\"\n colorPickerNoColor=\"Colorpicker no color chosen\"\n i18n-flatColorPickerNoColor=\"kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty.\"\n flatColorPickerNoColor=\"Flatcolorpicker no color chosen\"\n i18n-colorGradientNoColor=\"kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty.\"\n colorGradientNoColor=\"Colorgradient no color chosen\"\n i18n-colorPaletteNoColor=\"kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty.\"\n colorPaletteNoColor=\"Colorpalette no color chosen\"\n i18n-colorGradientHandle=\"kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser.\"\n colorGradientHandle=\"Choose color\"\n i18n-clearButton=\"kendo.colorpicker.clearButton|The title for the clear button.\"\n clearButton=\"Clear value\"\n i18n-hueSliderHandle=\"kendo.colorpicker.hueSliderHandle|The title for the hue slider handle.\"\n hueSliderHandle=\"Set hue\"\n i18n-opacitySliderHandle=\"kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle.\"\n opacitySliderHandle=\"Set opacity\"\n i18n-contrastRatio=\"kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool.\"\n contrastRatio=\"Contrast ratio\"\n i18n-previewColor=\"kendo.colorpicker.previewColor|The message for the color preview pane.\"\n previewColor=\"Color preview\"\n i18n-revertSelection=\"kendo.colorpicker.revertSelection|The message for the selected color pane.\"\n revertSelection=\"Revert selection\"\n i18n-gradientView=\"kendo.colorpicker.gradientView|The message for the gradient view button.\"\n gradientView=\"Gradient view\"\n i18n-paletteView=\"kendo.colorpicker.paletteView|The message for the palette view button.\"\n paletteView=\"Palette view\"\n i18n-formatButton=\"kendo.colorpicker.formatButton|The message for the input format toggle button.\"\n formatButton=\"Change color format\"\n i18n-applyButton=\"kendo.colorpicker.applyButton|The message for the Apply action button.\"\n applyButton=\"Apply\"\n i18n-cancelButton=\"kendo.colorpicker.cancelButton|The message for the Cancel action button.\"\n cancelButton=\"Cancel\">\n </ng-container>\n <span\n #wrapper\n [ngClass]=\"{\n 'k-picker-wrap': true,\n 'k-state-disabled': this.disabled,\n 'k-state-focused': this.isFocused\n }\"\n role=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"colorPickerAriaLabel\"\n [id]=\"focusableId\"\n [attr.tabindex]=\"tabindex\"\n (focus)=\"handleWrapperFocus()\"\n (blur)=\"handleWrapperBlur()\"\n (mousedown)=\"$event.preventDefault()\"\n (keydown)=\"handleWrapperKeyDown($event)\"\n >\n <span *ngIf=\"!iconStyles\" class=\"k-selected-color\" [style.background]=\"value\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-icon k-i-line\" *ngIf=\"!value\"></span>\n </span>\n <span *ngIf=\"iconStyles\" class=\"k-tool-icon\" [ngClass]=\"iconStyles\" (click)=\"handleActiveColorClick()\">\n <span class=\"k-selected-color\" [style.background-color]=\"value\"></span>\n </span>\n <span class=\"k-select\" (click)=\"togglePopup()\">\n <span class=\"k-icon k-i-arrow-s\"></span>\n </span>\n </span>\n <ng-template #popupTemplate>\n <kendo-flatcolorpicker\n #flatColorPicker\n [value]=\"value\"\n [format]=\"format\"\n [views]=\"views\"\n [activeView]=\"activeView\"\n [actionsLayout]=\"actionsLayout\"\n [preview]=\"preview\"\n [gradientSettings]=\"gradientSettings\"\n [paletteSettings]=\"paletteSettings\"\n [clearButton]=\"clearButton\"\n (focusout)=\"handlePopupBlur($event)\"\n (cancel)=\"handleCancelEvent($event)\"\n (valueChange)=\"handleValueChange($event)\"\n (keydown)=\"handlePopupKeyDown($event)\"\n (activeViewChange)=\"activeViewChange.emit($event)\"\n (actionButtonClick)=\"togglePopup()\">\n </kendo-flatcolorpicker>\n </ng-template>\n <ng-container #container></ng-container>\n "
9643
10623
  }),
9644
- __metadata("design:paramtypes", [ElementRef,
9645
- ColorPaletteService,
10624
+ __metadata("design:paramtypes", [PopupService,
9646
10625
  ChangeDetectorRef,
9647
- Renderer2,
9648
- LocalizationService])
9649
- ], ColorPaletteComponent);
9650
- return ColorPaletteComponent;
10626
+ LocalizationService,
10627
+ NgZone])
10628
+ ], ColorPickerComponent);
10629
+ return ColorPickerComponent;
9651
10630
  }());
9652
10631
 
9653
10632
  /**
@@ -9666,6 +10645,14 @@ var ColorPickerMessages = /** @class */ (function (_super) {
9666
10645
  Input(),
9667
10646
  __metadata("design:type", String)
9668
10647
  ], ColorPickerMessages.prototype, "colorGradientNoColor", void 0);
10648
+ __decorate([
10649
+ Input(),
10650
+ __metadata("design:type", String)
10651
+ ], ColorPickerMessages.prototype, "flatColorPickerNoColor", void 0);
10652
+ __decorate([
10653
+ Input(),
10654
+ __metadata("design:type", String)
10655
+ ], ColorPickerMessages.prototype, "colorPickerNoColor", void 0);
9669
10656
  __decorate([
9670
10657
  Input(),
9671
10658
  __metadata("design:type", String)
@@ -9714,6 +10701,34 @@ var ColorPickerMessages = /** @class */ (function (_super) {
9714
10701
  Input(),
9715
10702
  __metadata("design:type", String)
9716
10703
  ], ColorPickerMessages.prototype, "contrastRatio", void 0);
10704
+ __decorate([
10705
+ Input(),
10706
+ __metadata("design:type", String)
10707
+ ], ColorPickerMessages.prototype, "previewColor", void 0);
10708
+ __decorate([
10709
+ Input(),
10710
+ __metadata("design:type", String)
10711
+ ], ColorPickerMessages.prototype, "revertSelection", void 0);
10712
+ __decorate([
10713
+ Input(),
10714
+ __metadata("design:type", String)
10715
+ ], ColorPickerMessages.prototype, "gradientView", void 0);
10716
+ __decorate([
10717
+ Input(),
10718
+ __metadata("design:type", String)
10719
+ ], ColorPickerMessages.prototype, "paletteView", void 0);
10720
+ __decorate([
10721
+ Input(),
10722
+ __metadata("design:type", String)
10723
+ ], ColorPickerMessages.prototype, "formatButton", void 0);
10724
+ __decorate([
10725
+ Input(),
10726
+ __metadata("design:type", String)
10727
+ ], ColorPickerMessages.prototype, "applyButton", void 0);
10728
+ __decorate([
10729
+ Input(),
10730
+ __metadata("design:type", String)
10731
+ ], ColorPickerMessages.prototype, "cancelButton", void 0);
9717
10732
  return ColorPickerMessages;
9718
10733
  }(ComponentMessages));
9719
10734
 
@@ -9744,7 +10759,7 @@ var ColorPickerCustomMessagesComponent = /** @class */ (function (_super) {
9744
10759
  useExisting: forwardRef(function () { return ColorPickerCustomMessagesComponent_1; }) // tslint:disable-line:no-forward-ref
9745
10760
  }
9746
10761
  ],
9747
- selector: 'kendo-colorpicker-messages, kendo-colorgradient-messages, kendo-colorpalette-messages',
10762
+ selector: 'kendo-colorpicker-messages, kendo-flatcolorpicker-messages, kendo-colorgradient-messages, kendo-colorpalette-messages',
9748
10763
  template: ""
9749
10764
  }),
9750
10765
  __metadata("design:paramtypes", [LocalizationService])
@@ -9772,7 +10787,7 @@ var LocalizedColorPickerMessagesDirective = /** @class */ (function (_super) {
9772
10787
  useExisting: forwardRef(function () { return LocalizedColorPickerMessagesDirective_1; }) // tslint:disable-line:no-forward-ref
9773
10788
  }
9774
10789
  ],
9775
- selector: '[kendoColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]'
10790
+ selector: '[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]'
9776
10791
  }),
9777
10792
  __metadata("design:paramtypes", [LocalizationService])
9778
10793
  ], LocalizedColorPickerMessagesDirective);
@@ -9827,7 +10842,8 @@ var ContrastValidationComponent = /** @class */ (function () {
9827
10842
  });
9828
10843
  Object.defineProperty(ContrastValidationComponent.prototype, "contrastText", {
9829
10844
  get: function () {
9830
- return this.type + ": " + this.ratio.toFixed(1);
10845
+ var ratio = this.type === 'AA' ? AA_RATIO : AAA_RATIO;
10846
+ return this.type + ": " + ratio.toFixed(1);
9831
10847
  },
9832
10848
  enumerable: true,
9833
10849
  configurable: true
@@ -9836,18 +10852,18 @@ var ContrastValidationComponent = /** @class */ (function () {
9836
10852
  Input(),
9837
10853
  __metadata("design:type", String)
9838
10854
  ], ContrastValidationComponent.prototype, "type", void 0);
9839
- __decorate([
9840
- Input(),
9841
- __metadata("design:type", Number)
9842
- ], ContrastValidationComponent.prototype, "ratio", void 0);
9843
10855
  __decorate([
9844
10856
  Input(),
9845
10857
  __metadata("design:type", Boolean)
9846
10858
  ], ContrastValidationComponent.prototype, "pass", void 0);
10859
+ __decorate([
10860
+ Input(),
10861
+ __metadata("design:type", String)
10862
+ ], ContrastValidationComponent.prototype, "value", void 0);
9847
10863
  ContrastValidationComponent = __decorate([
9848
10864
  Component({
9849
10865
  selector: '[kendoContrastValidation]',
9850
- template: "\n <span>{{contrastText}}</span>\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"pass\">\n {{passMessage}}\n <span class=\"k-icon k-i-check\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!pass\">\n {{failMessage}}\n <span class=\"k-icon k-i-close\"></span>\n </span>\n "
10866
+ template: "\n <span>{{contrastText}}</span>\n <ng-container *ngIf=\"value\">\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"pass\">\n {{passMessage}}\n <span class=\"k-icon k-i-check\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!pass\">\n {{failMessage}}\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </ng-container>\n "
9851
10867
  }),
9852
10868
  __metadata("design:paramtypes", [LocalizationService])
9853
10869
  ], ContrastValidationComponent);
@@ -9860,8 +10876,6 @@ var ContrastValidationComponent = /** @class */ (function () {
9860
10876
  var ContrastComponent = /** @class */ (function () {
9861
10877
  function ContrastComponent(localization) {
9862
10878
  this.localization = localization;
9863
- this.aaRatio = AA_RATIO;
9864
- this.aaaRatio = AAA_RATIO;
9865
10879
  }
9866
10880
  Object.defineProperty(ContrastComponent.prototype, "formatedRatio", {
9867
10881
  get: function () {
@@ -9870,23 +10884,23 @@ var ContrastComponent = /** @class */ (function () {
9870
10884
  enumerable: true,
9871
10885
  configurable: true
9872
10886
  });
9873
- Object.defineProperty(ContrastComponent.prototype, "contrastRatioMessage", {
10887
+ Object.defineProperty(ContrastComponent.prototype, "contrastRatioText", {
9874
10888
  get: function () {
9875
- return this.localization.get('contrastRatio');
10889
+ return this.localization.get('contrastRatio') + ": " + (this.value ? this.formatedRatio : 'n/a');
9876
10890
  },
9877
10891
  enumerable: true,
9878
10892
  configurable: true
9879
10893
  });
9880
10894
  Object.defineProperty(ContrastComponent.prototype, "satisfiesAACondition", {
9881
10895
  get: function () {
9882
- return this.contrastRatio >= this.aaRatio;
10896
+ return this.contrastRatio >= AA_RATIO;
9883
10897
  },
9884
10898
  enumerable: true,
9885
10899
  configurable: true
9886
10900
  });
9887
10901
  Object.defineProperty(ContrastComponent.prototype, "satisfiesAAACondition", {
9888
10902
  get: function () {
9889
- return this.contrastRatio >= this.aaaRatio;
10903
+ return this.contrastRatio >= AAA_RATIO;
9890
10904
  },
9891
10905
  enumerable: true,
9892
10906
  configurable: true
@@ -9910,17 +10924,103 @@ var ContrastComponent = /** @class */ (function () {
9910
10924
  ContrastComponent = __decorate([
9911
10925
  Component({
9912
10926
  selector: '[kendoContrastTool]',
9913
- template: "\n <div class=\"k-contrast-ratio\">\n <span class=\"k-contrast-ratio-text\">{{contrastRatioMessage}}: {{formatedRatio}}</span>\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"satisfiesAACondition\">\n <span class=\"k-icon k-i-check\"></span>\n <span class=\"k-icon k-i-check\" *ngIf=\"satisfiesAAACondition\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!satisfiesAACondition\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </div>\n <div kendoContrastValidation\n type=\"AA\"\n [ratio]=\"aaaRatio\"\n [pass]=\"satisfiesAACondition\">\n </div>\n <div kendoContrastValidation\n type=\"AAA\"\n [ratio]=\"aaaRatio\"\n [pass]=\"satisfiesAAACondition\">\n </div>\n "
10927
+ template: "\n <div class=\"k-contrast-ratio\">\n <span class=\"k-contrast-ratio-text\">{{contrastRatioText}}</span>\n <ng-container *ngIf=\"value\">\n <span class=\"k-contrast-validation k-text-success\" *ngIf=\"satisfiesAACondition\">\n <span class=\"k-icon k-i-check\"></span>\n <span class=\"k-icon k-i-check\" *ngIf=\"satisfiesAAACondition\"></span>\n </span>\n <span class=\"k-contrast-validation k-text-error\" *ngIf=\"!satisfiesAACondition\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </ng-container>\n </div>\n <div kendoContrastValidation\n type=\"AA\"\n [value]=\"value\"\n [pass]=\"satisfiesAACondition\">\n </div>\n <div kendoContrastValidation\n type=\"AAA\"\n [value]=\"value\"\n [pass]=\"satisfiesAAACondition\">\n </div>\n "
9914
10928
  }),
9915
10929
  __metadata("design:paramtypes", [LocalizationService])
9916
10930
  ], ContrastComponent);
9917
10931
  return ContrastComponent;
9918
10932
  }());
9919
10933
 
10934
+ /**
10935
+ * @hidden
10936
+ */
10937
+ var ColorContrastSvgComponent = /** @class */ (function () {
10938
+ function ColorContrastSvgComponent() {
10939
+ this.hostClass = true;
10940
+ }
10941
+ ColorContrastSvgComponent.prototype.ngAfterViewInit = function () {
10942
+ var _this = this;
10943
+ this.metrics = this.wrapper.getBoundingClientRect();
10944
+ this.oldA = this.hsva.value.a;
10945
+ this.oldH = this.hsva.value.h;
10946
+ this.hsva.subscribe(function (value) {
10947
+ if (value.h !== _this.oldH || value.a !== _this.oldA) {
10948
+ _this.oldH = value.h;
10949
+ _this.oldA = value.a;
10950
+ _this.setPaths();
10951
+ }
10952
+ });
10953
+ };
10954
+ ColorContrastSvgComponent.prototype.ngOnChanges = function (changes) {
10955
+ if (isPresent(changes.backgroundColor) && this.metrics) {
10956
+ this.setPaths();
10957
+ }
10958
+ };
10959
+ ColorContrastSvgComponent.prototype.setPaths = function () {
10960
+ var bezierCommandCalc = bezierCommand(controlPoint(line));
10961
+ this.paths = [svgPath(this.getPaths(AA_RATIO, STEP_COUNT), bezierCommandCalc),
10962
+ svgPath(this.getPaths(AA_RATIO, STEP_COUNT, true), bezierCommandCalc),
10963
+ svgPath(this.getPaths(AAA_RATIO, STEP_COUNT), bezierCommandCalc),
10964
+ svgPath(this.getPaths(AAA_RATIO, STEP_COUNT, true), bezierCommandCalc)];
10965
+ };
10966
+ ColorContrastSvgComponent.prototype.findValue = function (contrast, saturation, low, high, comparer) {
10967
+ var mid = (low + high) / 2;
10968
+ var hsva = Object.assign({}, this.hsva.value, { s: saturation / this.metrics.width, v: 1 - mid / this.metrics.height });
10969
+ var currentContrast = getContrastFromTwoRGBAs(getRGBA(getColorFromHSV(hsva)), getRGBA(this.backgroundColor || ''));
10970
+ if (low + 0.5 > high) {
10971
+ if (currentContrast < contrast + 1 && currentContrast > contrast - 1) {
10972
+ return mid;
10973
+ }
10974
+ else {
10975
+ return null;
10976
+ }
10977
+ }
10978
+ if (comparer(currentContrast, contrast)) {
10979
+ return this.findValue(contrast, saturation, low, high - (high - low) / 2, comparer);
10980
+ }
10981
+ return this.findValue(contrast, saturation, low + (high - low) / 2, high, comparer);
10982
+ };
10983
+ ColorContrastSvgComponent.prototype.getPaths = function (contrast, stepCount, reversed) {
10984
+ if (reversed === void 0) { reversed = false; }
10985
+ var points = [];
10986
+ for (var i = 0; i <= this.metrics.width; i += this.metrics.width / stepCount) {
10987
+ var value = this.findValue(contrast, i, 0, this.metrics.height, reversed ? (function (a, b) { return a < b; }) : (function (a, b) { return a > b; }));
10988
+ if (value !== null) {
10989
+ points.push([i, value]);
10990
+ }
10991
+ }
10992
+ return points;
10993
+ };
10994
+ __decorate([
10995
+ HostBinding('class.k-color-contrast-svg'),
10996
+ __metadata("design:type", Boolean)
10997
+ ], ColorContrastSvgComponent.prototype, "hostClass", void 0);
10998
+ __decorate([
10999
+ Input(),
11000
+ __metadata("design:type", Object)
11001
+ ], ColorContrastSvgComponent.prototype, "wrapper", void 0);
11002
+ __decorate([
11003
+ Input(),
11004
+ __metadata("design:type", BehaviorSubject)
11005
+ ], ColorContrastSvgComponent.prototype, "hsva", void 0);
11006
+ __decorate([
11007
+ Input(),
11008
+ __metadata("design:type", String)
11009
+ ], ColorContrastSvgComponent.prototype, "backgroundColor", void 0);
11010
+ ColorContrastSvgComponent = __decorate([
11011
+ Component({
11012
+ selector: '[kendoColorContrastSvg]',
11013
+ template: "\n <svg:path *ngFor=\"let path of paths\" [attr.d]=\"path\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"></svg:path>\n "
11014
+ })
11015
+ ], ColorContrastSvgComponent);
11016
+ return ColorContrastSvgComponent;
11017
+ }());
11018
+
9920
11019
  var PUBLIC_DIRECTIVES = [
9921
11020
  ColorPickerComponent,
9922
11021
  ColorPaletteComponent,
9923
11022
  ColorGradientComponent,
11023
+ FlatColorPickerComponent,
9924
11024
  LocalizedColorPickerMessagesDirective,
9925
11025
  ColorPickerCustomMessagesComponent
9926
11026
  ];
@@ -9928,7 +11028,10 @@ var INTERNAL_DIRECTIVES = [
9928
11028
  ColorInputComponent,
9929
11029
  FocusOnDomReadyDirective,
9930
11030
  ContrastComponent,
9931
- ContrastValidationComponent
11031
+ ContrastValidationComponent,
11032
+ FlatColorPickerHeaderComponent,
11033
+ FlatColorPickerActionButtonsComponent,
11034
+ ColorContrastSvgComponent
9932
11035
  ];
9933
11036
  /**
9934
11037
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
@@ -10632,4 +11735,4 @@ var InputsModule = /** @class */ (function () {
10632
11735
  * Generated bundle index. Do not edit.
10633
11736
  */
10634
11737
 
10635
- export { CheckBoxModule, ColorInputComponent, ContrastValidationComponent, ContrastComponent, FocusOnDomReadyDirective, ColorGradientLocalizationService, ColorPaletteLocalizationService, ColorPickerLocalizationService, ColorPickerCustomMessagesComponent, ColorPickerMessages, ColorPaletteService, MaskingService, NumericTextBoxMessages, RadioButtonModule, RangeSliderCustomMessagesComponent, RangeSliderMessages, SHARED_DIRECTIVES, SliderCustomMessagesComponent, SliderMessages, SliderBase, SlidersCommonModule, SwitchCustomMessagesComponent, Messages, TextFieldsBase, TextBoxCustomMessagesComponent, TextBoxMessages, SliderComponent, RangeSliderComponent, LabelTemplateDirective, SwitchComponent, TextBoxContainerComponent, TextBoxDirective, TextAreaDirective, NumericTextBoxComponent, NumericTextBoxCustomMessagesComponent, MaskedTextBoxComponent, InputsModule, SliderTicksComponent, SliderModule, RangeSliderModule, SwitchModule, NumericTextBoxModule, MaskedTextBoxModule, TextBoxModule, TextAreaModule, ColorPickerComponent, ColorPaletteComponent, ColorGradientComponent, ColorPickerModule, ActiveColorClickEvent, CheckBoxDirective, RadioButtonDirective, HintComponent, ErrorComponent, FormFieldComponent, FormFieldModule, TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective, TextAreaComponent, TextAreaSuffixComponent, InputSeparatorComponent, SharedModule, LocalizedColorPickerMessagesDirective, LocalizedNumericTextBoxMessagesDirective, LocalizedTextBoxMessagesDirective, LocalizedSliderMessagesDirective, LocalizedRangeSliderMessagesDirective, LocalizedSwitchMessagesDirective };
11738
+ export { CheckBoxModule, ColorContrastSvgComponent, ColorInputComponent, ContrastValidationComponent, ContrastComponent, FlatColorPickerActionButtonsComponent, FlatColorPickerHeaderComponent, FocusOnDomReadyDirective, ColorGradientLocalizationService, ColorPaletteLocalizationService, ColorPickerLocalizationService, ColorPickerCustomMessagesComponent, FlatColorPickerLocalizationService, ColorPickerMessages, ColorPaletteService, FlatColorPickerService, MaskingService, NumericTextBoxMessages, RadioButtonModule, RangeSliderCustomMessagesComponent, RangeSliderMessages, SHARED_DIRECTIVES, SliderCustomMessagesComponent, SliderMessages, SliderBase, SlidersCommonModule, SwitchCustomMessagesComponent, Messages, TextFieldsBase, TextBoxCustomMessagesComponent, TextBoxMessages, SliderComponent, RangeSliderComponent, LabelTemplateDirective, SwitchComponent, TextBoxContainerComponent, TextBoxDirective, TextAreaDirective, NumericTextBoxComponent, NumericTextBoxCustomMessagesComponent, MaskedTextBoxComponent, InputsModule, SliderTicksComponent, SliderModule, RangeSliderModule, SwitchModule, NumericTextBoxModule, MaskedTextBoxModule, TextBoxModule, TextAreaModule, ColorPickerComponent, ColorPaletteComponent, ColorGradientComponent, ColorPickerModule, FlatColorPickerComponent, ColorPickerCancelEvent, CheckBoxDirective, RadioButtonDirective, HintComponent, ErrorComponent, FormFieldComponent, FormFieldModule, TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective, TextAreaComponent, TextAreaSuffixComponent, InputSeparatorComponent, SharedModule, LocalizedColorPickerMessagesDirective, LocalizedNumericTextBoxMessagesDirective, LocalizedTextBoxMessagesDirective, LocalizedSliderMessagesDirective, LocalizedRangeSliderMessagesDirective, LocalizedSwitchMessagesDirective, ColorPickerCloseEvent, ColorPickerOpenEvent, ActiveColorClickEvent };