@progress/kendo-angular-inputs 8.0.0-dev.202201101634 → 8.0.0-dev.202201121416

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 (28) hide show
  1. package/dist/cdn/js/kendo-angular-inputs.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/colorpicker/color-gradient.component.js +3 -0
  4. package/dist/es/colorpicker/color-palette.component.js +6 -3
  5. package/dist/es/colorpicker/colorpicker.component.js +188 -48
  6. package/dist/es/colorpicker/flatcolorpicker.component.js +7 -4
  7. package/dist/es/package-metadata.js +1 -1
  8. package/dist/es/radiobutton/radiobutton.directive.js +3 -0
  9. package/dist/es2015/colorpicker/color-gradient.component.js +3 -0
  10. package/dist/es2015/colorpicker/color-palette.component.d.ts +1 -1
  11. package/dist/es2015/colorpicker/color-palette.component.js +6 -3
  12. package/dist/es2015/colorpicker/colorpicker.component.d.ts +18 -6
  13. package/dist/es2015/colorpicker/colorpicker.component.js +167 -69
  14. package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +2 -2
  15. package/dist/es2015/colorpicker/flatcolorpicker.component.js +7 -4
  16. package/dist/es2015/index.metadata.json +1 -1
  17. package/dist/es2015/package-metadata.js +1 -1
  18. package/dist/es2015/radiobutton/radiobutton.directive.js +3 -0
  19. package/dist/fesm2015/index.js +204 -104
  20. package/dist/fesm5/index.js +228 -86
  21. package/dist/npm/colorpicker/color-gradient.component.js +3 -0
  22. package/dist/npm/colorpicker/color-palette.component.js +6 -3
  23. package/dist/npm/colorpicker/colorpicker.component.js +187 -47
  24. package/dist/npm/colorpicker/flatcolorpicker.component.js +7 -4
  25. package/dist/npm/package-metadata.js +1 -1
  26. package/dist/npm/radiobutton/radiobutton.directive.js +3 -0
  27. package/dist/systemjs/kendo-angular-inputs.js +1 -1
  28. package/package.json +1 -1
@@ -6,13 +6,15 @@ import * as tslib_1 from "tslib";
6
6
  var ColorPaletteComponent_1;
7
7
  import { Component, Input, EventEmitter, Output, HostBinding, HostListener, forwardRef, ChangeDetectorRef, Renderer2, ElementRef } from '@angular/core';
8
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
+ import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
10
+ import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
11
+ import { validatePackage } from '@progress/kendo-licensing';
12
+ import { ColorPaletteLocalizationService } from './localization/colorpalette-localization.service';
13
+ import { packageMetadata } from '../package-metadata';
9
14
  import { PALETTEPRESETS } from './models';
10
15
  import { parseColor } from './utils';
11
16
  import { isPresent } from '../common/utils';
12
17
  import { ColorPaletteService } from './services/color-palette.service';
13
- import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
14
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
15
- import { ColorPaletteLocalizationService } from './localization/colorpalette-localization.service';
16
18
  const DEFAULT_TILE_SIZE = 24;
17
19
  const DEFAULT_COLUMNS_COUNT = 10;
18
20
  const DEFAULT_PRESET = 'office';
@@ -85,6 +87,7 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
85
87
  this._tabindex = 0;
86
88
  this.notifyNgTouched = () => { };
87
89
  this.notifyNgChanged = () => { };
90
+ validatePackage(packageMetadata);
88
91
  this.dynamicRTLSubscription = localizationService.changes.subscribe(({ rtl }) => {
89
92
  this.direction = rtl ? 'rtl' : 'ltr';
90
93
  });
@@ -23,7 +23,13 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
23
23
  private ngZone;
24
24
  private renderer;
25
25
  hostClasses: boolean;
26
+ readonly focusedClass: boolean;
27
+ readonly disabledClass: boolean;
28
+ readonly ariaReadonly: boolean;
29
+ readonly ariaExpanded: boolean;
30
+ readonly hostTabindex: number;
26
31
  direction: string;
32
+ role: string;
27
33
  /**
28
34
  * @hidden
29
35
  */
@@ -227,7 +233,7 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
227
233
  * for example, inside the component markup.
228
234
  */
229
235
  container: ViewContainerRef;
230
- private wrapper;
236
+ private activeColor;
231
237
  private popupTemplate;
232
238
  private flatColorPicker;
233
239
  private popupRef;
@@ -240,15 +246,12 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
240
246
  private _rounded;
241
247
  private _fillMode;
242
248
  private dynamicRTLSubscription;
249
+ private subscriptions;
243
250
  constructor(host: ElementRef, popupService: PopupService, cdr: ChangeDetectorRef, localizationService: LocalizationService, ngZone: NgZone, renderer: Renderer2);
244
251
  ngOnInit(): void;
245
252
  ngAfterViewInit(): void;
246
253
  ngOnChanges(changes: any): void;
247
254
  ngOnDestroy(): void;
248
- /**
249
- * @hidden
250
- */
251
- readonly colorPickerAriaLabel: string;
252
255
  /**
253
256
  * @hidden
254
257
  */
@@ -260,7 +263,7 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
260
263
  /**
261
264
  * @hidden
262
265
  */
263
- handleActiveColorClick(): void;
266
+ handleWrapperClick(event: MouseEvent): void;
264
267
  /**
265
268
  * Focuses the wrapper of the ColorPicker.
266
269
  */
@@ -277,6 +280,10 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
277
280
  * @hidden
278
281
  */
279
282
  handleWrapperBlur(): void;
283
+ /**
284
+ * @hidden
285
+ */
286
+ arrowButtonMouseDown(ev: MouseEvent): void;
280
287
  /**
281
288
  * Clears the value of the ColorPicker.
282
289
  */
@@ -325,6 +332,7 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
325
332
  * Used by the FloatingLabel to determine if the component is empty.
326
333
  */
327
334
  isEmpty(): boolean;
335
+ private setHostElementAriaLabel;
328
336
  private handleClasses;
329
337
  private popupBlurInvalid;
330
338
  private toggleWithEvents;
@@ -335,4 +343,8 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
335
343
  private readonly lastFocusableElement;
336
344
  private notifyNgTouched;
337
345
  private notifyNgChanged;
346
+ private handleDomEvents;
347
+ private initDomEvents;
348
+ private domFocusListener;
349
+ private handleHostId;
338
350
  }
@@ -4,12 +4,14 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  var ColorPickerComponent_1;
7
+ import { take } from 'rxjs/operators';
7
8
  import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
8
9
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
10
+ import { Subscription } from 'rxjs';
9
11
  import { FlatColorPickerComponent } from './flatcolorpicker.component';
10
12
  import { PopupService } from '@progress/kendo-angular-popup';
11
13
  import { validatePackage } from '@progress/kendo-licensing';
12
- import { Keys, KendoInput } from '@progress/kendo-angular-common';
14
+ import { Keys, KendoInput, isChanged, closest, guid } from '@progress/kendo-angular-common';
13
15
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
14
16
  import { packageMetadata } from '../package-metadata';
15
17
  import { PALETTEPRESETS } from './models';
@@ -18,7 +20,7 @@ import { parseColor } from './utils';
18
20
  import { getStylingClasses, isPresent } from '../common/utils';
19
21
  import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
20
22
  import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
21
- let serial = 0;
23
+ const DOM_FOCUS_EVENTS = ['focus', 'blur'];
22
24
  /**
23
25
  * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
24
26
  *
@@ -34,10 +36,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
34
36
  this.ngZone = ngZone;
35
37
  this.renderer = renderer;
36
38
  this.hostClasses = true;
37
- /**
38
- * @hidden
39
- */
40
- this.focusableId = `k-colorpicker-${serial++}`;
39
+ this.role = 'listbox';
41
40
  /**
42
41
  * Specifies the views that will be rendered in the popup.
43
42
  * By default both the gradient and palette views will be rendered.
@@ -133,6 +132,10 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
133
132
  * Used to provide a two-way binding for the `activeView` property.
134
133
  */
135
134
  this.activeViewChange = new EventEmitter();
135
+ /**
136
+ * Indicates whether the ColorPicker wrapper is focused.
137
+ */
138
+ this.isFocused = false;
136
139
  this._tabindex = 0;
137
140
  this._popupSettings = { animate: true };
138
141
  this._paletteSettings = {};
@@ -140,13 +143,30 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
140
143
  this._size = 'medium';
141
144
  this._rounded = 'medium';
142
145
  this._fillMode = 'solid';
146
+ this.subscriptions = new Subscription();
143
147
  this.notifyNgTouched = () => { };
144
148
  this.notifyNgChanged = () => { };
149
+ this.domFocusListener = (event) => event.stopImmediatePropagation();
145
150
  validatePackage(packageMetadata);
146
151
  this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
147
152
  this.direction = rtl ? 'rtl' : 'ltr';
148
153
  });
149
154
  }
155
+ get focusedClass() {
156
+ return this.isFocused;
157
+ }
158
+ get disabledClass() {
159
+ return this.disabled;
160
+ }
161
+ get ariaReadonly() {
162
+ return this.readonly;
163
+ }
164
+ get ariaExpanded() {
165
+ return this.isOpen;
166
+ }
167
+ get hostTabindex() {
168
+ return this.tabindex;
169
+ }
150
170
  /**
151
171
  * @hidden
152
172
  */
@@ -291,6 +311,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
291
311
  stylingInputs.forEach(input => {
292
312
  this.handleClasses(this[input], input);
293
313
  });
314
+ this.setHostElementAriaLabel();
315
+ this.handleHostId();
316
+ this.initDomEvents();
294
317
  }
295
318
  ngOnChanges(changes) {
296
319
  if (changes.format && changes.format.currentValue === 'name') {
@@ -300,18 +323,17 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
300
323
  this.format = 'rgba';
301
324
  this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
302
325
  }
326
+ if (isChanged('value', changes)) {
327
+ this.setHostElementAriaLabel();
328
+ }
303
329
  }
304
330
  ngOnDestroy() {
305
331
  this.closePopup();
306
332
  if (this.dynamicRTLSubscription) {
307
333
  this.dynamicRTLSubscription.unsubscribe();
308
334
  }
309
- }
310
- /**
311
- * @hidden
312
- */
313
- get colorPickerAriaLabel() {
314
- return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
335
+ this.subscriptions.unsubscribe();
336
+ this.handleDomEvents('remove', DOM_FOCUS_EVENTS);
315
337
  }
316
338
  /**
317
339
  * @hidden
@@ -323,28 +345,33 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
323
345
  * @hidden
324
346
  */
325
347
  togglePopup() {
326
- this.toggleWithEvents(!this.isOpen);
327
348
  this.focus();
349
+ this.toggleWithEvents(!this.isOpen);
328
350
  }
329
351
  /**
330
352
  * @hidden
331
353
  */
332
- handleActiveColorClick() {
354
+ handleWrapperClick(event) {
355
+ if (this.disabled) {
356
+ return;
357
+ }
333
358
  this.focus();
334
- const event = new ActiveColorClickEvent(this.value);
335
- this.activeColorClick.emit(event);
336
- if (!event.isOpenPrevented() || this.isOpen) {
337
- this.togglePopup();
359
+ if (closest(event.target, (element) => element === this.activeColor.nativeElement)) {
360
+ const event = new ActiveColorClickEvent(this.value);
361
+ this.activeColorClick.emit(event);
362
+ if (!event.isOpenPrevented() || this.isOpen) {
363
+ this.toggleWithEvents(!this.isOpen);
364
+ }
365
+ return;
338
366
  }
367
+ this.toggleWithEvents(!this.isOpen);
339
368
  }
340
369
  /**
341
370
  * Focuses the wrapper of the ColorPicker.
342
371
  */
343
372
  focus() {
344
- if (this.disabled) {
345
- return;
346
- }
347
- this.wrapper.nativeElement.focus();
373
+ this.isFocused = true;
374
+ this.host.nativeElement.focus();
348
375
  }
349
376
  /**
350
377
  * @hidden
@@ -353,14 +380,18 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
353
380
  if (this.isFocused) {
354
381
  return;
355
382
  }
356
- this.isFocused = true;
357
- this.onFocus.emit();
383
+ this.ngZone.run(() => {
384
+ this.focus();
385
+ this.onFocus.emit();
386
+ });
358
387
  }
359
388
  /**
360
389
  * Blurs the ColorPicker.
361
390
  */
362
391
  blur() {
363
- this.wrapper.nativeElement.blur();
392
+ this.isFocused = false;
393
+ this.host.nativeElement.blur();
394
+ this.notifyNgTouched();
364
395
  }
365
396
  /**
366
397
  * @hidden
@@ -369,9 +400,16 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
369
400
  if (this.isOpen) {
370
401
  return;
371
402
  }
372
- this.isFocused = false;
373
- this.onBlur.emit();
374
- this.notifyNgTouched();
403
+ this.ngZone.run(() => {
404
+ this.onBlur.emit();
405
+ this.isFocused = false;
406
+ });
407
+ }
408
+ /**
409
+ * @hidden
410
+ */
411
+ arrowButtonMouseDown(ev) {
412
+ ev.preventDefault();
375
413
  }
376
414
  /**
377
415
  * Clears the value of the ColorPicker.
@@ -381,6 +419,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
381
419
  return;
382
420
  }
383
421
  this._value = undefined;
422
+ this.setHostElementAriaLabel();
384
423
  this.notifyNgChanged(undefined);
385
424
  }
386
425
  /**
@@ -408,6 +447,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
408
447
  if (valueChange) {
409
448
  this.value = parsedColor;
410
449
  this.valueChange.emit(parsedColor);
450
+ this.setHostElementAriaLabel();
411
451
  this.notifyNgChanged(parsedColor);
412
452
  }
413
453
  }
@@ -454,7 +494,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
454
494
  handleWrapperKeyDown(event) {
455
495
  if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
456
496
  event.preventDefault();
457
- this.toggleWithEvents(true);
497
+ this.ngZone.run(() => {
498
+ this.toggleWithEvents(true);
499
+ });
458
500
  }
459
501
  }
460
502
  /**
@@ -463,14 +505,14 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
463
505
  handlePopupKeyDown(event) {
464
506
  if (event.keyCode === Keys.Escape) {
465
507
  this.toggleWithEvents(false);
466
- this.wrapper.nativeElement.focus();
508
+ this.host.nativeElement.focus();
467
509
  }
468
510
  if (event.keyCode === Keys.Tab) {
469
511
  const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
470
512
  const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
471
513
  if (event.target === currentElement) {
472
514
  event.preventDefault();
473
- nextElement.nativeElement.focus();
515
+ nextElement.focus();
474
516
  }
475
517
  }
476
518
  }
@@ -481,6 +523,10 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
481
523
  isEmpty() {
482
524
  return false;
483
525
  }
526
+ setHostElementAriaLabel() {
527
+ const ariaLabelValue = `${this.value ? this.value : this.localizationService.get('colorPickerNoColor')}`;
528
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
529
+ }
484
530
  handleClasses(value, input) {
485
531
  const elem = this.host.nativeElement;
486
532
  const classes = getStylingClasses('picker', input, this[input], value);
@@ -492,9 +538,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
492
538
  }
493
539
  }
494
540
  popupBlurInvalid(ev) {
495
- const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
496
- const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
497
- return !this.isFocused || wrapperClicked || focusInPopupElement;
541
+ const focusInFlatColorPickerElement = this.popupRef.popupElement.contains(ev.relatedTarget);
542
+ const hostClicked = closest(ev.relatedTarget, (element) => element === this.host.nativeElement);
543
+ return hostClicked || focusInFlatColorPickerElement;
498
544
  }
499
545
  toggleWithEvents(open) {
500
546
  const sameState = this.isOpen === open;
@@ -518,12 +564,12 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
518
564
  }
519
565
  }
520
566
  focusFirstElement() {
521
- this.ngZone.runOutsideAngular(() => {
522
- setTimeout(() => {
567
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
568
+ if (this.flatColorPicker) {
523
569
  const elementToFocus = this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle :
524
570
  this.flatColorPicker.palette.host;
525
571
  elementToFocus.nativeElement.focus();
526
- });
572
+ }
527
573
  });
528
574
  }
529
575
  openPopup() {
@@ -531,7 +577,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
531
577
  const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
532
578
  const popupPosition = { horizontal: horizontalAlign, vertical: "top" };
533
579
  this.popupRef = this.popupService.open({
534
- anchor: this.wrapper,
580
+ anchor: this.activeColor,
535
581
  animate: this.popupSettings.animate,
536
582
  appendTo: this.popupSettings.appendTo,
537
583
  popupAlign: popupPosition,
@@ -543,7 +589,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
543
589
  this.popupRef.popupAnchorViewportLeave.subscribe(() => {
544
590
  this.toggleWithEvents(false);
545
591
  if (!this.isOpen) {
546
- this.wrapper.nativeElement.focus({
592
+ this.host.nativeElement.focus({
547
593
  preventScroll: true
548
594
  });
549
595
  }
@@ -571,6 +617,51 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
571
617
  }
572
618
  return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
573
619
  }
620
+ handleDomEvents(action, events) {
621
+ const hostElement = this.host.nativeElement;
622
+ events.forEach(ev => hostElement[`${action}EventListener`](ev, this.domFocusListener, true));
623
+ }
624
+ initDomEvents() {
625
+ if (!this.host) {
626
+ return;
627
+ }
628
+ let hostElement = this.host.nativeElement;
629
+ this.ngZone.runOutsideAngular(() => {
630
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
631
+ this.handleWrapperFocus();
632
+ }));
633
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (event) => {
634
+ const closestPopup = this.popupRef ?
635
+ closest(event.relatedTarget, (element) => element === this.flatColorPicker.host.nativeElement) :
636
+ false;
637
+ const closestWrapper = closest(event.relatedTarget, (element) => element === this.host.nativeElement);
638
+ if (!closestPopup && !closestWrapper) {
639
+ this.handleWrapperBlur();
640
+ }
641
+ }));
642
+ this.handleDomEvents('add', DOM_FOCUS_EVENTS);
643
+ this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (event) => {
644
+ this.handleWrapperKeyDown(event);
645
+ }));
646
+ this.subscriptions.add(this.renderer.listen(hostElement, 'click', (event) => {
647
+ this.ngZone.run(() => {
648
+ this.handleWrapperClick(event);
649
+ });
650
+ }));
651
+ });
652
+ }
653
+ handleHostId() {
654
+ const hostElement = this.host.nativeElement;
655
+ const existingId = hostElement.getAttribute('id');
656
+ if (existingId) {
657
+ this.focusableId = existingId;
658
+ }
659
+ else {
660
+ const id = `k-${guid()}`;
661
+ hostElement.setAttribute('id', id);
662
+ this.focusableId = id;
663
+ }
664
+ }
574
665
  };
575
666
  tslib_1.__decorate([
576
667
  HostBinding('class.k-colorpicker'),
@@ -578,14 +669,40 @@ tslib_1.__decorate([
578
669
  HostBinding('class.k-picker'),
579
670
  tslib_1.__metadata("design:type", Boolean)
580
671
  ], ColorPickerComponent.prototype, "hostClasses", void 0);
672
+ tslib_1.__decorate([
673
+ HostBinding('class.k-focus'),
674
+ tslib_1.__metadata("design:type", Boolean),
675
+ tslib_1.__metadata("design:paramtypes", [])
676
+ ], ColorPickerComponent.prototype, "focusedClass", null);
677
+ tslib_1.__decorate([
678
+ HostBinding('attr.aria-disabled'),
679
+ HostBinding('class.k-disabled'),
680
+ tslib_1.__metadata("design:type", Boolean),
681
+ tslib_1.__metadata("design:paramtypes", [])
682
+ ], ColorPickerComponent.prototype, "disabledClass", null);
683
+ tslib_1.__decorate([
684
+ HostBinding('attr.aria-readonly'),
685
+ tslib_1.__metadata("design:type", Boolean),
686
+ tslib_1.__metadata("design:paramtypes", [])
687
+ ], ColorPickerComponent.prototype, "ariaReadonly", null);
688
+ tslib_1.__decorate([
689
+ HostBinding('attr.aria-expanded'),
690
+ tslib_1.__metadata("design:type", Boolean),
691
+ tslib_1.__metadata("design:paramtypes", [])
692
+ ], ColorPickerComponent.prototype, "ariaExpanded", null);
693
+ tslib_1.__decorate([
694
+ HostBinding('attr.tabindex'),
695
+ tslib_1.__metadata("design:type", Number),
696
+ tslib_1.__metadata("design:paramtypes", [])
697
+ ], ColorPickerComponent.prototype, "hostTabindex", null);
581
698
  tslib_1.__decorate([
582
699
  HostBinding('attr.dir'),
583
700
  tslib_1.__metadata("design:type", String)
584
701
  ], ColorPickerComponent.prototype, "direction", void 0);
585
702
  tslib_1.__decorate([
586
- Input(),
703
+ HostBinding('attr.role'),
587
704
  tslib_1.__metadata("design:type", String)
588
- ], ColorPickerComponent.prototype, "focusableId", void 0);
705
+ ], ColorPickerComponent.prototype, "role", void 0);
589
706
  tslib_1.__decorate([
590
707
  Input(),
591
708
  tslib_1.__metadata("design:type", Array)
@@ -708,9 +825,9 @@ tslib_1.__decorate([
708
825
  tslib_1.__metadata("design:type", ViewContainerRef)
709
826
  ], ColorPickerComponent.prototype, "container", void 0);
710
827
  tslib_1.__decorate([
711
- ViewChild('wrapper', { static: true }),
828
+ ViewChild('activeColor', { static: true }),
712
829
  tslib_1.__metadata("design:type", ElementRef)
713
- ], ColorPickerComponent.prototype, "wrapper", void 0);
830
+ ], ColorPickerComponent.prototype, "activeColor", void 0);
714
831
  tslib_1.__decorate([
715
832
  ViewChild('popupTemplate', { static: true }),
716
833
  tslib_1.__metadata("design:type", TemplateRef)
@@ -776,38 +893,19 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
776
893
  i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
777
894
  cancelButton="Cancel">
778
895
  </ng-container>
779
- <span
780
- #wrapper
781
- [ngClass]="{
782
- 'k-input-inner': true,
783
- 'k-disabled': this.disabled,
784
- 'k-focus': this.isFocused
785
- }"
786
- role="listbox"
787
- [attr.aria-expanded]="isOpen"
788
- [attr.aria-readonly]="readonly"
789
- [attr.aria-disabled]="disabled"
790
- [attr.aria-label]="colorPickerAriaLabel"
791
- [id]="focusableId"
792
- [attr.tabindex]="tabindex"
793
- (focus)="handleWrapperFocus()"
794
- (blur)="handleWrapperBlur()"
795
- (mousedown)="$event.preventDefault()"
796
- (keydown)="handleWrapperKeyDown($event)"
797
- >
896
+ <span #activeColor class="k-input-inner">
798
897
  <span
799
898
  class="k-value-icon k-color-preview"
800
- [ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}"
801
- (click)="handleActiveColorClick()">
899
+ [ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}">
802
900
  <span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>
803
901
  <span class="k-color-preview-mask" [style.background-color]="value"></span>
804
902
  </span>
805
903
  </span>
806
904
  <button
807
- type="button"
808
- class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button"
809
- [attr.aria-label]="colorPickerAriaLabel"
810
- (click)="togglePopup()">
905
+ #arrowButton
906
+ tabindex="-1"
907
+ role="button"
908
+ class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button">
811
909
  <span class="k-button-icon k-icon k-i-arrow-s"></span>
812
910
  </button>
813
911
  <ng-template #popupTemplate>
@@ -822,8 +920,8 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
822
920
  [gradientSettings]="gradientSettings"
823
921
  [paletteSettings]="paletteSettings"
824
922
  [clearButton]="clearButton"
825
- (focusout)="handlePopupBlur($event)"
826
923
  (cancel)="handleCancelEvent($event)"
924
+ (focusout)="handlePopupBlur($event)"
827
925
  (valueChange)="handleValueChange($event)"
828
926
  (keydown)="handlePopupKeyDown($event)"
829
927
  (activeViewChange)="activeViewChange.emit($event)"
@@ -19,8 +19,8 @@ import { FlatColorPickerActionButtonsComponent } from './flatcolorpicker-actions
19
19
  * through a gradient that renders an hsv canvas. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
20
20
  */
21
21
  export declare class FlatColorPickerComponent implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor {
22
+ host: ElementRef;
22
23
  private service;
23
- private host;
24
24
  private localizationService;
25
25
  private cdr;
26
26
  private renderer;
@@ -140,7 +140,7 @@ export declare class FlatColorPickerComponent implements OnInit, AfterViewInit,
140
140
  private _paletteSettings;
141
141
  private dynamicRTLSubscription;
142
142
  private subscriptions;
143
- constructor(service: FlatColorPickerService, host: ElementRef, localizationService: LocalizationService, cdr: ChangeDetectorRef, renderer: Renderer2, ngZone: NgZone);
143
+ constructor(host: ElementRef, service: FlatColorPickerService, localizationService: LocalizationService, cdr: ChangeDetectorRef, renderer: Renderer2, ngZone: NgZone);
144
144
  ngOnInit(): void;
145
145
  ngAfterViewInit(): void;
146
146
  ngOnChanges(changes: SimpleChanges): void;
@@ -9,8 +9,10 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
9
  import { Subscription } from 'rxjs';
10
10
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
11
11
  import { isChanged, KendoInput } from '@progress/kendo-angular-common';
12
+ import { validatePackage } from "@progress/kendo-licensing";
12
13
  import { FlatColorPickerLocalizationService } from './localization/flatcolorpicker-localization.service';
13
14
  import { FlatColorPickerService } from './services/flatcolorpicker.service';
15
+ import { packageMetadata } from "../package-metadata";
14
16
  import { ColorPickerCancelEvent } from './events';
15
17
  import { parseColor } from './utils';
16
18
  import { isPresent } from '../common/utils';
@@ -25,9 +27,9 @@ import { FlatColorPickerActionButtonsComponent } from './flatcolorpicker-actions
25
27
  * through a gradient that renders an hsv canvas. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
26
28
  */
27
29
  let FlatColorPickerComponent = FlatColorPickerComponent_1 = class FlatColorPickerComponent {
28
- constructor(service, host, localizationService, cdr, renderer, ngZone) {
29
- this.service = service;
30
+ constructor(host, service, localizationService, cdr, renderer, ngZone) {
30
31
  this.host = host;
32
+ this.service = service;
31
33
  this.localizationService = localizationService;
32
34
  this.cdr = cdr;
33
35
  this.renderer = renderer;
@@ -110,6 +112,7 @@ let FlatColorPickerComponent = FlatColorPickerComponent_1 = class FlatColorPicke
110
112
  this.subscriptions = new Subscription();
111
113
  this.notifyNgChanged = () => { };
112
114
  this.notifyNgTouched = () => { };
115
+ validatePackage(packageMetadata);
113
116
  this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
114
117
  this.direction = rtl ? 'rtl' : 'ltr';
115
118
  });
@@ -583,8 +586,8 @@ FlatColorPickerComponent = FlatColorPickerComponent_1 = tslib_1.__decorate([
583
586
  </div>
584
587
  `
585
588
  }),
586
- tslib_1.__metadata("design:paramtypes", [FlatColorPickerService,
587
- ElementRef,
589
+ tslib_1.__metadata("design:paramtypes", [ElementRef,
590
+ FlatColorPickerService,
588
591
  LocalizationService,
589
592
  ChangeDetectorRef,
590
593
  Renderer2,