@progress/kendo-angular-inputs 8.0.0-dev.202112251033 → 8.0.0-dev.202201190602

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 (78) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/README.md +1 -1
  4. package/dist/cdn/js/kendo-angular-inputs.js +1 -1
  5. package/dist/cdn/main.js +1 -1
  6. package/dist/es/colorpicker/color-gradient.component.js +3 -0
  7. package/dist/es/colorpicker/color-input.component.js +1 -1
  8. package/dist/es/colorpicker/color-palette.component.js +6 -3
  9. package/dist/es/colorpicker/colorpicker.component.js +189 -49
  10. package/dist/es/colorpicker/flatcolorpicker.component.js +7 -4
  11. package/dist/es/maskedtextbox/maskedtextbox.component.js +1 -1
  12. package/dist/es/numerictextbox/numerictextbox.component.js +1 -1
  13. package/dist/es/package-metadata.js +1 -1
  14. package/dist/es/radiobutton/radiobutton.directive.js +3 -0
  15. package/dist/es/rangeslider/rangeslider-model.js +4 -7
  16. package/dist/es/rangeslider/rangeslider.component.js +1 -1
  17. package/dist/es/slider/slider-model.js +3 -5
  18. package/dist/es/slider/slider.component.js +2 -2
  19. package/dist/es/sliders-common/slider-model.base.js +7 -10
  20. package/dist/es/sliders-common/slider-ticks.component.js +3 -10
  21. package/dist/es/sliders-common/sliders-util.js +2 -3
  22. package/dist/es/switch/switch.component.js +1 -1
  23. package/dist/es/textarea/textarea.component.js +3 -2
  24. package/dist/es/textbox/textbox.component.js +2 -2
  25. package/dist/es2015/colorpicker/color-gradient.component.js +3 -0
  26. package/dist/es2015/colorpicker/color-input.component.js +1 -1
  27. package/dist/es2015/colorpicker/color-palette.component.d.ts +1 -1
  28. package/dist/es2015/colorpicker/color-palette.component.js +6 -3
  29. package/dist/es2015/colorpicker/colorpicker.component.d.ts +19 -7
  30. package/dist/es2015/colorpicker/colorpicker.component.js +168 -70
  31. package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +2 -2
  32. package/dist/es2015/colorpicker/flatcolorpicker.component.js +7 -4
  33. package/dist/es2015/index.metadata.json +1 -1
  34. package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +1 -1
  35. package/dist/es2015/maskedtextbox/maskedtextbox.component.js +1 -1
  36. package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +1 -1
  37. package/dist/es2015/numerictextbox/numerictextbox.component.js +1 -1
  38. package/dist/es2015/package-metadata.js +1 -1
  39. package/dist/es2015/radiobutton/radiobutton.directive.js +3 -0
  40. package/dist/es2015/rangeslider/rangeslider-model.js +4 -7
  41. package/dist/es2015/rangeslider/rangeslider.component.js +55 -54
  42. package/dist/es2015/slider/slider-model.d.ts +1 -1
  43. package/dist/es2015/slider/slider-model.js +3 -5
  44. package/dist/es2015/slider/slider.component.js +56 -59
  45. package/dist/es2015/sliders-common/slider-model.base.js +7 -10
  46. package/dist/es2015/sliders-common/slider-ticks.component.d.ts +0 -2
  47. package/dist/es2015/sliders-common/slider-ticks.component.js +6 -10
  48. package/dist/es2015/sliders-common/sliders-util.d.ts +2 -2
  49. package/dist/es2015/sliders-common/sliders-util.js +2 -3
  50. package/dist/es2015/switch/switch.component.d.ts +1 -1
  51. package/dist/es2015/switch/switch.component.js +1 -1
  52. package/dist/es2015/textarea/textarea.component.d.ts +1 -1
  53. package/dist/es2015/textarea/textarea.component.js +10 -2
  54. package/dist/es2015/textbox/textbox.component.d.ts +1 -1
  55. package/dist/es2015/textbox/textbox.component.js +19 -20
  56. package/dist/fesm2015/index.js +369 -285
  57. package/dist/fesm5/index.js +258 -140
  58. package/dist/npm/colorpicker/color-gradient.component.js +3 -0
  59. package/dist/npm/colorpicker/color-input.component.js +1 -1
  60. package/dist/npm/colorpicker/color-palette.component.js +6 -3
  61. package/dist/npm/colorpicker/colorpicker.component.js +188 -48
  62. package/dist/npm/colorpicker/flatcolorpicker.component.js +7 -4
  63. package/dist/npm/maskedtextbox/maskedtextbox.component.js +1 -1
  64. package/dist/npm/numerictextbox/numerictextbox.component.js +1 -1
  65. package/dist/npm/package-metadata.js +1 -1
  66. package/dist/npm/radiobutton/radiobutton.directive.js +3 -0
  67. package/dist/npm/rangeslider/rangeslider-model.js +4 -7
  68. package/dist/npm/rangeslider/rangeslider.component.js +1 -1
  69. package/dist/npm/slider/slider-model.js +3 -5
  70. package/dist/npm/slider/slider.component.js +2 -2
  71. package/dist/npm/sliders-common/slider-model.base.js +6 -9
  72. package/dist/npm/sliders-common/slider-ticks.component.js +2 -9
  73. package/dist/npm/sliders-common/sliders-util.js +2 -3
  74. package/dist/npm/switch/switch.component.js +1 -1
  75. package/dist/npm/textarea/textarea.component.js +3 -2
  76. package/dist/npm/textbox/textbox.component.js +2 -2
  77. package/dist/systemjs/kendo-angular-inputs.js +1 -1
  78. package/package.json +6 -6
@@ -8,7 +8,7 @@ import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, RadioControlValueAccessor
8
8
  import { Subscription, fromEvent, interval, merge, 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, PreventableEvent } from '@progress/kendo-angular-common';
11
+ import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, isChanged, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent, closest } 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';
@@ -150,15 +150,6 @@ const remainder = (dividend, divisor) => {
150
150
  * @hidden
151
151
  */
152
152
  const calculateFixedTrackSize = ({ max, min, smallStep, fixedTickWidth }) => ((max - min) / smallStep) * fixedTickWidth;
153
- /**
154
- * @hidden
155
- */
156
- const calculateTrackSize = (wrapperWidth, offset, showButtons = true) => {
157
- const BUTTONS_COUNT = 2;
158
- const trackOffset = showButtons ? parseFloat(offset) * BUTTONS_COUNT : 0;
159
- const trackWidth = wrapperWidth - trackOffset;
160
- return Math.floor(trackWidth);
161
- };
162
153
  /**
163
154
  * @hidden
164
155
  */
@@ -181,14 +172,13 @@ const calculateValueFromTick = (index, { max, min, smallStep, reverse, vertical
181
172
  /**
182
173
  * @hidden
183
174
  */
184
- const calculateHandlePosition = ({ handleWidth, trackWidth, min, max, reverse, value }) => {
185
- const halfHandleWidth = Math.floor(handleWidth / 2);
175
+ const calculateHandlePosition = ({ trackWidth, min, max, reverse, value }) => {
186
176
  const step = trackWidth / Math.abs(max - min);
187
177
  let pos = isPresent(value) ? step * (value - min) : min;
188
178
  if (reverse) {
189
179
  pos = trackWidth - pos;
190
180
  }
191
- return Math.floor(pos - halfHandleWidth);
181
+ return Math.floor(pos);
192
182
  };
193
183
  /**
194
184
  * @hidden
@@ -351,8 +341,10 @@ class SliderModelBase {
351
341
  }
352
342
  resizeTrack() {
353
343
  const orientation = this.props.vertical ? 'height' : 'width';
344
+ const altOrientation = this.props.vertical ? 'width' : 'height';
354
345
  const trackWidth = this.trackWidth();
355
- this.track.style[orientation] = `${trackWidth}px`;
346
+ this.track.parentElement.style[orientation] = `${trackWidth}px`;
347
+ this.track.parentElement.style[altOrientation] = '';
356
348
  }
357
349
  resizeTicks(ticksContainer, ticks) {
358
350
  const dimension = this.props.vertical ? "height" : "width";
@@ -363,22 +355,17 @@ class SliderModelBase {
363
355
  }
364
356
  resizeWrapper() {
365
357
  const dimension = this.props.vertical ? "height" : "width";
366
- const wrapperSize = this.elementSize(this.wrapper);
367
- const trackWidth = calculateTrackSize(wrapperSize, this.elementOffset(this.track));
368
358
  const fixedTrackWidth = calculateFixedTrackSize(this.props);
369
359
  const wrapperParentEl = this.wrapper.parentElement;
370
- if (trackWidth > fixedTrackWidth) {
371
- wrapperParentEl.style[dimension] = `${wrapperSize - (trackWidth - fixedTrackWidth)}px`;
372
- }
373
- else {
374
- wrapperParentEl.style[dimension] = `${wrapperSize + (fixedTrackWidth - trackWidth)}px`;
360
+ if (fixedTrackWidth) {
361
+ wrapperParentEl.style[dimension] = "auto";
375
362
  }
376
363
  }
377
364
  trackWidth() {
378
365
  if (this.props.fixedTickWidth) {
379
366
  return calculateFixedTrackSize(this.props);
380
367
  }
381
- return calculateTrackSize(this.elementSize(this.wrapper), this.elementOffset(this.track), this.props.buttons);
368
+ return this.elementSize(this.track.parentElement);
382
369
  }
383
370
  getTickSizes() {
384
371
  const { min, max, smallStep } = this.props;
@@ -440,16 +427,14 @@ class SliderModel extends SliderModelBase {
440
427
  max,
441
428
  reverse,
442
429
  value,
443
- trackWidth,
444
- handleWidth: dragHandle.offsetWidth
430
+ trackWidth
445
431
  });
446
432
  this.renderer.setStyle(dragHandle, position, `${this.handlePosition}px`);
447
433
  }
448
- positionSelection(dragHandle, selection) {
434
+ positionSelection(selection) {
449
435
  const { reverse, vertical } = this.props;
450
436
  const dimension = vertical ? 'height' : 'width';
451
- const handleWidth = Math.floor(dragHandle.offsetWidth / 2);
452
- let size = this.handlePosition + handleWidth;
437
+ let size = this.handlePosition;
453
438
  if (reverse) {
454
439
  size = this.trackWidth() - size;
455
440
  }
@@ -482,7 +467,7 @@ const containsFocus = (hostElement, contender) => hostElement && contender && (h
482
467
  /**
483
468
  * @hidden
484
469
  */
485
- const closest = (node, predicate) => {
470
+ const closest$1 = (node, predicate) => {
486
471
  while (node && !predicate(node)) {
487
472
  node = node.parentNode;
488
473
  }
@@ -496,7 +481,7 @@ const packageMetadata = {
496
481
  name: '@progress/kendo-angular-inputs',
497
482
  productName: 'Kendo UI for Angular',
498
483
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
499
- publishDate: 1640428155,
484
+ publishDate: 1642571836,
500
485
  version: '',
501
486
  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'
502
487
  };
@@ -1068,7 +1053,7 @@ let SliderComponent = SliderComponent_1 = class SliderComponent extends SliderBa
1068
1053
  model.resizeTicks(this.ticksContainer.nativeElement, this.ticks.tickElements.map(element => element.nativeElement));
1069
1054
  }
1070
1055
  model.positionHandle(dragHandleEl);
1071
- model.positionSelection(dragHandleEl, selectionEl);
1056
+ model.positionSelection(selectionEl);
1072
1057
  if (!animate) {
1073
1058
  this.hostElement.nativeElement.getBoundingClientRect();
1074
1059
  this.renderer.addClass(this.hostElement.nativeElement, 'k-slider-transitions');
@@ -1246,69 +1231,66 @@ SliderComponent = SliderComponent_1 = __decorate([
1246
1231
  [class.k-slider-bottomright]="tickPlacement === 'after'"
1247
1232
  [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
1248
1233
  >
1249
- <span
1250
- #decreaseButton
1251
- *ngIf="showButtons"
1252
- class="k-button k-button-decrease"
1234
+ <button *ngIf="showButtons" type="button" #decreaseButton
1235
+ class="k-button-decrease k-button k-button-md k-rounded-full k-button-rectangle k-button-solid k-button-solid-base k-icon-button"
1253
1236
  [title]="decrementMessage"
1254
- role="presentation"
1255
- >
1256
- <span class="k-icon"
1257
- [class.k-i-arrow-w]="!vertical"
1258
- [class.k-i-arrow-s]="vertical"
1237
+ [attr.tabindex]="-1"
1238
+ role="presentation">
1239
+ <span class="k-button-icon k-icon"
1240
+ [class.k-i-arrow-w]="!vertical"
1241
+ [class.k-i-arrow-s]="vertical">
1242
+ </span>
1243
+ </button>
1244
+ <div class="k-slider-track-wrap">
1245
+ <ul kendoSliderTicks
1246
+ #ticks
1247
+ *ngIf="tickPlacement !== 'none'"
1248
+ [tickTitle]="title"
1249
+ [vertical]="vertical"
1250
+ [step]="smallStep"
1251
+ [largeStep]="largeStep"
1252
+ [min]="min"
1253
+ [max]="max"
1254
+ [labelTemplate]="labelTemplate?.templateRef"
1255
+ [attr.aria-hidden]="true"
1259
1256
  >
1260
- </span>
1261
- </span>
1262
- <span
1263
- *ngIf="showButtons"
1264
- #increaseButton
1265
- class="k-button k-button-increase"
1257
+ </ul>
1258
+ <div #track class="k-slider-track">
1259
+ <div #sliderSelection class="k-slider-selection">
1260
+ </div>
1261
+ <a #draghandle
1262
+ role="slider"
1263
+ [attr.aria-valuemin]="min"
1264
+ [attr.aria-valuemax]="max"
1265
+ [attr.aria-valuenow]="currentValue"
1266
+ [attr.aria-valuetext]="currentValue"
1267
+ [attr.aria-disabled]="disabled ? true : undefined"
1268
+ [attr.aria-readonly]="readonly ? true : undefined"
1269
+ [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1270
+ [style.touch-action]="isDisabled ? '' : 'none'"
1271
+ class="k-draghandle"
1272
+ [title]="dragHandleMessage"
1273
+ [attr.tabindex]="disabled ? '-1' : tabIndex"
1274
+ [id]="focusableId"
1275
+ kendoDraggable
1276
+ (kendoPress)="ifEnabled(handleDragPress, $event)"
1277
+ (kendoDrag)="ifEnabled(onHandleDrag, $event)"
1278
+ (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1279
+ ></a>
1280
+ </div>
1281
+ </div>
1282
+ <button *ngIf="showButtons" type="button" #increaseButton
1283
+ class="k-button-increase k-button k-button-md k-rounded-full k-button-rectangle k-button-solid k-button-solid-base k-icon-button"
1266
1284
  [title]="incrementMessage"
1267
1285
  (click)="$event.preventDefault()"
1286
+ [attr.tabindex]="-1"
1268
1287
  [attr.aria-label]="currentValue"
1269
- >
1270
- <span class="k-icon"
1271
- [class.k-i-arrow-e]="!vertical"
1272
- [class.k-i-arrow-n]="vertical"
1273
- >
1274
- </span>
1275
- </span>
1276
- <ul kendoSliderTicks
1277
- #ticks
1278
- *ngIf="tickPlacement !== 'none'"
1279
- [tickTitle]="title"
1280
- [vertical]="vertical"
1281
- [step]="smallStep"
1282
- [largeStep]="largeStep"
1283
- [min]="min"
1284
- [max]="max"
1285
- [labelTemplate]="labelTemplate?.templateRef"
1286
- [attr.aria-hidden]="true"
1287
- >
1288
- </ul>
1289
- <div #track class="k-slider-track">
1290
- <div #sliderSelection class="k-slider-selection">
1291
- </div>
1292
- <a #draghandle
1293
- role="slider"
1294
- [attr.aria-valuemin]="min"
1295
- [attr.aria-valuemax]="max"
1296
- [attr.aria-valuenow]="currentValue"
1297
- [attr.aria-valuetext]="currentValue"
1298
- [attr.aria-disabled]="disabled ? true : undefined"
1299
- [attr.aria-readonly]="readonly ? true : undefined"
1300
- [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1301
- [style.touch-action]="isDisabled ? '' : 'none'"
1302
- class="k-draghandle"
1303
- [title]="dragHandleMessage"
1304
- [attr.tabindex]="disabled ? '-1' : tabIndex"
1305
- [id]="focusableId"
1306
- kendoDraggable
1307
- (kendoPress)="ifEnabled(handleDragPress, $event)"
1308
- (kendoDrag)="ifEnabled(onHandleDrag, $event)"
1309
- (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1310
- ></a>
1311
- </div>
1288
+ role="presentation">
1289
+ <span class="k-button-icon k-icon"
1290
+ [class.k-i-arrow-e]="!vertical"
1291
+ [class.k-i-arrow-n]="vertical">
1292
+ </span>
1293
+ </button>
1312
1294
  <kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>
1313
1295
  </div>
1314
1296
  `
@@ -1340,8 +1322,7 @@ class RangeSliderModel extends SliderModelBase {
1340
1322
  max,
1341
1323
  reverse,
1342
1324
  value,
1343
- trackWidth,
1344
- handleWidth: dragHandle.offsetWidth
1325
+ trackWidth
1345
1326
  });
1346
1327
  this.renderer.setStyle(dragHandle, position, `${this.startHandlePosition}px`);
1347
1328
  }
@@ -1351,8 +1332,7 @@ class RangeSliderModel extends SliderModelBase {
1351
1332
  max,
1352
1333
  reverse,
1353
1334
  value,
1354
- trackWidth,
1355
- handleWidth: dragHandle.offsetWidth
1335
+ trackWidth
1356
1336
  });
1357
1337
  this.renderer.setStyle(dragHandle, position, `${this.endHandlePosition}px`);
1358
1338
  }
@@ -1361,12 +1341,11 @@ class RangeSliderModel extends SliderModelBase {
1361
1341
  const { reverse, vertical } = this.props;
1362
1342
  const dimension = vertical ? 'height' : 'width';
1363
1343
  const position = vertical ? 'bottom' : reverse ? 'right' : 'left';
1364
- const handleWidth = Math.floor(dragHandle.offsetWidth / 2);
1365
1344
  const size = Math.abs(this.endHandlePosition - this.startHandlePosition);
1366
1345
  const currentSelectionPosition = vertical ? dragHandle.style.bottom : dragHandle.style.left;
1367
1346
  this.renderer.setStyle(selection, dimension, `${size}px`);
1368
- this.renderer.setStyle(selection, position, reverse ? this.trackWidth() - parseFloat(currentSelectionPosition) - handleWidth + 'px'
1369
- : parseFloat(currentSelectionPosition) + handleWidth + 'px');
1347
+ this.renderer.setStyle(selection, position, reverse ? this.trackWidth() - parseFloat(currentSelectionPosition) + 'px'
1348
+ : parseFloat(currentSelectionPosition) + 'px');
1370
1349
  }
1371
1350
  }
1372
1351
 
@@ -1799,62 +1778,63 @@ RangeSliderComponent = RangeSliderComponent_1 = __decorate([
1799
1778
  [class.k-slider-bottomright]="tickPlacement === 'after'"
1800
1779
  [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"
1801
1780
  >
1802
- <ul kendoSliderTicks
1803
- #ticks
1804
- *ngIf="tickPlacement !== 'none'"
1805
- [tickTitle]="title"
1806
- [vertical]="vertical"
1807
- [step]="smallStep"
1808
- [largeStep]="largeStep"
1809
- [min]="min"
1810
- [max]="max"
1811
- [labelTemplate]="labelTemplate?.templateRef"
1812
- [attr.aria-hidden]="true"
1813
- >
1814
- </ul>
1815
- <div #track class="k-slider-track">
1816
- <div #sliderSelection class="k-slider-selection">
1781
+ <div class="k-slider-track-wrap">
1782
+ <ul kendoSliderTicks
1783
+ #ticks
1784
+ *ngIf="tickPlacement !== 'none'"
1785
+ [tickTitle]="title"
1786
+ [vertical]="vertical"
1787
+ [step]="smallStep"
1788
+ [largeStep]="largeStep"
1789
+ [min]="min"
1790
+ [max]="max"
1791
+ [labelTemplate]="labelTemplate?.templateRef"
1792
+ [attr.aria-hidden]="true"
1793
+ >
1794
+ </ul>
1795
+ <div #track class="k-slider-track">
1796
+ <div #sliderSelection class="k-slider-selection">
1797
+ </div>
1798
+ <a #draghandleStart
1799
+ role="slider"
1800
+ [id]="startHandleId"
1801
+ [attr.tabindex]="disabled ? undefined : tabindex"
1802
+ [attr.aria-valuemin]="min"
1803
+ [attr.aria-valuemax]="max"
1804
+ [attr.aria-valuenow]="value ? value[0] : null"
1805
+ [attr.aria-valuetext]="valueText"
1806
+ [attr.aria-disabled]="disabled ? true : undefined"
1807
+ [attr.aria-readonly]="readonly ? true : undefined"
1808
+ [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1809
+ [style.touch-action]="isDisabled ? '' : 'none'"
1810
+ class="k-draghandle"
1811
+ [title]="textFor('dragHandleStart')"
1812
+ kendoDraggable
1813
+ (kendoPress)="ifEnabled(handleDragPress ,$event)"
1814
+ (kendoDrag)="ifEnabled(onHandleDrag ,$event)"
1815
+ (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1816
+ ></a>
1817
+ <a #draghandleEnd
1818
+ role="slider"
1819
+ [id]="endHandleId"
1820
+ [attr.tabindex]="disabled ? undefined : tabindex"
1821
+ [attr.aria-valuemin]="min"
1822
+ [attr.aria-valuemax]="max"
1823
+ [attr.aria-valuenow]="value ? value[1] : null"
1824
+ [attr.aria-valuetext]="valueText"
1825
+ [attr.aria-disabled]="disabled ? true : undefined"
1826
+ [attr.aria-readonly]="readonly ? true : undefined"
1827
+ [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1828
+ [style.touch-action]="isDisabled ? '' : 'none'"
1829
+ class="k-draghandle"
1830
+ [title]="textFor('dragHandleEnd')"
1831
+ kendoDraggable
1832
+ (kendoPress)="ifEnabled(handleDragPress ,$event)"
1833
+ (kendoDrag)="ifEnabled(onHandleDrag ,$event)"
1834
+ (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1835
+ ></a>
1817
1836
  </div>
1818
- <a #draghandleStart
1819
- role="slider"
1820
- [id]="startHandleId"
1821
- [attr.tabindex]="disabled ? undefined : tabindex"
1822
- [attr.aria-valuemin]="min"
1823
- [attr.aria-valuemax]="max"
1824
- [attr.aria-valuenow]="value ? value[0] : null"
1825
- [attr.aria-valuetext]="valueText"
1826
- [attr.aria-disabled]="disabled ? true : undefined"
1827
- [attr.aria-readonly]="readonly ? true : undefined"
1828
- [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1829
- [style.touch-action]="isDisabled ? '' : 'none'"
1830
- class="k-draghandle"
1831
- [title]="textFor('dragHandleStart')"
1832
- kendoDraggable
1833
- (kendoPress)="ifEnabled(handleDragPress ,$event)"
1834
- (kendoDrag)="ifEnabled(onHandleDrag ,$event)"
1835
- (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1836
- ></a>
1837
- <a #draghandleEnd
1838
- role="slider"
1839
- [id]="endHandleId"
1840
- [attr.tabindex]="disabled ? undefined : tabindex"
1841
- [attr.aria-valuemin]="min"
1842
- [attr.aria-valuemax]="max"
1843
- [attr.aria-valuenow]="value ? value[1] : null"
1844
- [attr.aria-valuetext]="valueText"
1845
- [attr.aria-disabled]="disabled ? true : undefined"
1846
- [attr.aria-readonly]="readonly ? true : undefined"
1847
- [attr.aria-orientation]="vertical ? 'vertical' : 'horizontal'"
1848
- [style.touch-action]="isDisabled ? '' : 'none'"
1849
- class="k-draghandle"
1850
- [title]="textFor('dragHandleEnd')"
1851
- kendoDraggable
1852
- (kendoPress)="ifEnabled(handleDragPress ,$event)"
1853
- (kendoDrag)="ifEnabled(onHandleDrag ,$event)"
1854
- (kendoRelease)="ifEnabled(onHandleRelease, $event)"
1855
- ></a>
1856
1837
  </div>
1857
-
1858
1838
  <kendo-resize-sensor (resize)="sizeComponent()"></kendo-resize-sensor>
1859
1839
  </div>
1860
1840
  `
@@ -1967,7 +1947,7 @@ let SwitchComponent = SwitchComponent_1 = class SwitchComponent {
1967
1947
  return this._checked;
1968
1948
  }
1969
1949
  /**
1970
- * Specifies the size of the Switch.
1950
+ * Specifies the width and height of the Switch.
1971
1951
  *
1972
1952
  * The possible values are:
1973
1953
  * * `'small'`
@@ -3198,7 +3178,7 @@ let NumericTextBoxComponent = NumericTextBoxComponent_1 = class NumericTextBoxCo
3198
3178
  return this.tabindex;
3199
3179
  }
3200
3180
  /**
3201
- * The size property specifies the font size and line height of the NumericTextBox
3181
+ * The size property specifies padding of the NumericTextBox internal input element
3202
3182
  * ([see example]({% slug appearance_numerictextbox %}#toc-size)).
3203
3183
  * The possible values are:
3204
3184
  * * `'small'`
@@ -4580,7 +4560,7 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
4580
4560
  this.updateService();
4581
4561
  }
4582
4562
  /**
4583
- * The size property specifies the font size and line height of the MaskedTextBox
4563
+ * The size property specifies the padding of the MaskedTextBox internal input element
4584
4564
  * ([see example]({% slug appearance_maskedtextbox %}#toc-size)).
4585
4565
  * The possible values are:
4586
4566
  * * `'small'`
@@ -5095,8 +5075,10 @@ class SliderTick {
5095
5075
  * @hidden
5096
5076
  */
5097
5077
  let SliderTicksComponent = class SliderTicksComponent {
5098
- constructor(rtl) {
5099
- this.rtl = rtl;
5078
+ /**
5079
+ * @hidden
5080
+ */
5081
+ constructor() {
5100
5082
  this.wrapperClasses = 'k-reset k-slider-items';
5101
5083
  this.ticks = [];
5102
5084
  }
@@ -5119,9 +5101,6 @@ let SliderTicksComponent = class SliderTicksComponent {
5119
5101
  result[i].classes['k-tick-large'] = true;
5120
5102
  }
5121
5103
  }
5122
- if (this.rtl || this.vertical) {
5123
- result = result.reverse();
5124
- }
5125
5104
  if (result.length > 0) {
5126
5105
  Object.assign(result[0].classes, this.endTickClasses(true));
5127
5106
  Object.assign(result[result.length - 1].classes, this.endTickClasses(false));
@@ -5193,9 +5172,7 @@ SliderTicksComponent = __decorate([
5193
5172
  {{ tickTitle(value) }}
5194
5173
  </ng-template>
5195
5174
  `
5196
- }),
5197
- __param(0, Optional()), __param(0, Inject(RTL)),
5198
- __metadata("design:paramtypes", [Boolean])
5175
+ })
5199
5176
  ], SliderTicksComponent);
5200
5177
 
5201
5178
  /**
@@ -5953,7 +5930,7 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
5953
5930
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
5954
5931
  }
5955
5932
  /**
5956
- * The size property specifies the font size and line height of the TextBox
5933
+ * The size property specifies the padding of the TextBox internal input element
5957
5934
  * ([see example]({% slug appearance_textbox %}#toc-size)).
5958
5935
  *
5959
5936
  * The possible values are:
@@ -6042,7 +6019,7 @@ let TextBoxComponent = TextBoxComponent_1 = class TextBoxComponent {
6042
6019
  return;
6043
6020
  }
6044
6021
  if (tabbing) {
6045
- const closestTextbox = closest(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
6022
+ const closestTextbox = closest$1(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
6046
6023
  if (!closestTextbox) {
6047
6024
  this.handleBlur();
6048
6025
  }
@@ -6446,9 +6423,8 @@ TextBoxComponent = TextBoxComponent_1 = __decorate([
6446
6423
  [ngTemplateOutlet]="prefixTemplate?.templateRef">
6447
6424
  </ng-template>
6448
6425
  </span>
6449
- <input
6426
+ <input #input
6450
6427
  class="k-input-inner"
6451
- #input
6452
6428
  [id]="focusableId"
6453
6429
  [disabled]="disabled"
6454
6430
  [readonly]="readonly"
@@ -6460,24 +6436,24 @@ TextBoxComponent = TextBoxComponent_1 = __decorate([
6460
6436
  [kendoEventsOutsideAngular]="{
6461
6437
  focus: handleInputFocus,
6462
6438
  blur: handleInputBlur,
6463
- input: handleInput}"/>
6464
- <span class="k-input-suffix">
6465
- <span *ngIf="hasErrors" [ngClass]="errorIconClasses"></span>
6466
- <span *ngIf="isSuccessful" [ngClass]="successIconClasses"></span>
6467
- <span
6468
- role="button"
6469
- class="k-clear-value"
6470
- *ngIf="showClearButton"
6471
- (click)="clearValue()"
6472
- (mousedown)="$event.preventDefault()"
6473
- [tabindex]="tabIndex"
6474
- [attr.aria-label]="clearTitle()"
6475
- [title]="clearTitle()"
6476
- (keydown.enter)="clearValue($event)"
6477
- (keydown.space)="clearValue($event)"
6478
- >
6439
+ input: handleInput}"
6440
+ />
6441
+ <span
6442
+ role="button"
6443
+ class="k-clear-value"
6444
+ *ngIf="showClearButton"
6445
+ (click)="clearValue()"
6446
+ (mousedown)="$event.preventDefault()"
6447
+ [tabindex]="tabIndex"
6448
+ [attr.aria-label]="clearTitle()"
6449
+ [title]="clearTitle()"
6450
+ (keydown.enter)="clearValue($event)"
6451
+ (keydown.space)="clearValue($event)">
6479
6452
  <span [ngClass]="clearButtonClasses"></span>
6480
- </span>
6453
+ </span>
6454
+ <span *ngIf="hasErrors" [ngClass]="errorIconClasses"></span>
6455
+ <span *ngIf="isSuccessful" [ngClass]="successIconClasses"></span>
6456
+ <span class="k-input-suffix">
6481
6457
  <ng-template
6482
6458
  *ngIf="suffixTemplate"
6483
6459
  [ngTemplateOutlet]="suffixTemplate?.templateRef">
@@ -6968,7 +6944,7 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
6968
6944
  return this.tabindex;
6969
6945
  }
6970
6946
  /**
6971
- * The size property specifies the font size and line height of the TextArea
6947
+ * The size property specifies the padding of the internal textarea element
6972
6948
  * ([see example]({% slug appearance_textarea %}#toc-size)).
6973
6949
  *
6974
6950
  * The possible values are:
@@ -7037,7 +7013,7 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent extends Te
7037
7013
  return;
7038
7014
  }
7039
7015
  if (tabbing) {
7040
- const closestTextbox = closest(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
7016
+ const closestTextbox = closest$1(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
7041
7017
  if (!closestTextbox) {
7042
7018
  this.handleBlur();
7043
7019
  }
@@ -7353,7 +7329,15 @@ TextAreaComponent = TextAreaComponent_1 = __decorate([
7353
7329
  input: handleInput}">
7354
7330
  </textarea>
7355
7331
  <ng-content select="kendo-textarea-suffix"></ng-content>
7356
- `
7332
+ `,
7333
+ styles: [`
7334
+ :host(.k-flex-col) {
7335
+ flex-direction: column !important;
7336
+ }
7337
+ :host(.k-flex-row) {
7338
+ flex-direction: row !important;
7339
+ }
7340
+ `]
7357
7341
  }),
7358
7342
  __metadata("design:paramtypes", [LocalizationService,
7359
7343
  NgZone,
@@ -8122,7 +8106,7 @@ ColorInputComponent = __decorate([
8122
8106
  <input
8123
8107
  #hexInput
8124
8108
  [id]="focusableId"
8125
- class="k-textbox k-hex-value"
8109
+ class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"
8126
8110
  [disabled]="disabled"
8127
8111
  [readonly]="readonly"
8128
8112
  [value]="hex || ''"
@@ -8288,6 +8272,7 @@ let ColorGradientComponent = ColorGradientComponent_1 = class ColorGradientCompo
8288
8272
  this.updateValues = new Subject();
8289
8273
  this.notifyNgChanged = () => { };
8290
8274
  this.notifyNgTouched = () => { };
8275
+ validatePackage(packageMetadata);
8291
8276
  this.dynamicRTLSubscription = localizationService.changes.subscribe(({ rtl }) => {
8292
8277
  this.direction = rtl ? 'rtl' : 'ltr';
8293
8278
  });
@@ -8925,6 +8910,29 @@ ColorGradientComponent = ColorGradientComponent_1 = __decorate([
8925
8910
  LocalizationService])
8926
8911
  ], ColorGradientComponent);
8927
8912
 
8913
+ /**
8914
+ * @hidden
8915
+ */
8916
+ let ColorPaletteLocalizationService = class ColorPaletteLocalizationService extends LocalizationService {
8917
+ constructor(prefix, messageService, _rtl, flatColorPickerLocalization) {
8918
+ super(prefix, messageService, _rtl);
8919
+ this.flatColorPickerLocalization = flatColorPickerLocalization;
8920
+ }
8921
+ get(shortKey) {
8922
+ if (this.flatColorPickerLocalization) {
8923
+ return this.flatColorPickerLocalization.get(shortKey);
8924
+ }
8925
+ return super.get(shortKey);
8926
+ }
8927
+ };
8928
+ ColorPaletteLocalizationService = __decorate([
8929
+ __param(0, Inject(L10N_PREFIX)),
8930
+ __param(1, Optional()),
8931
+ __param(2, Optional()), __param(2, Inject(RTL)),
8932
+ __param(3, Optional()), __param(3, Inject(FlatColorPickerLocalizationService)),
8933
+ __metadata("design:paramtypes", [String, MessageService, Boolean, FlatColorPickerLocalizationService])
8934
+ ], ColorPaletteLocalizationService);
8935
+
8928
8936
  /**
8929
8937
  * @hidden
8930
8938
  */
@@ -8987,29 +8995,6 @@ ColorPaletteService = __decorate([
8987
8995
  Injectable()
8988
8996
  ], ColorPaletteService);
8989
8997
 
8990
- /**
8991
- * @hidden
8992
- */
8993
- let ColorPaletteLocalizationService = class ColorPaletteLocalizationService extends LocalizationService {
8994
- constructor(prefix, messageService, _rtl, flatColorPickerLocalization) {
8995
- super(prefix, messageService, _rtl);
8996
- this.flatColorPickerLocalization = flatColorPickerLocalization;
8997
- }
8998
- get(shortKey) {
8999
- if (this.flatColorPickerLocalization) {
9000
- return this.flatColorPickerLocalization.get(shortKey);
9001
- }
9002
- return super.get(shortKey);
9003
- }
9004
- };
9005
- ColorPaletteLocalizationService = __decorate([
9006
- __param(0, Inject(L10N_PREFIX)),
9007
- __param(1, Optional()),
9008
- __param(2, Optional()), __param(2, Inject(RTL)),
9009
- __param(3, Optional()), __param(3, Inject(FlatColorPickerLocalizationService)),
9010
- __metadata("design:paramtypes", [String, MessageService, Boolean, FlatColorPickerLocalizationService])
9011
- ], ColorPaletteLocalizationService);
9012
-
9013
8998
  var ColorPaletteComponent_1;
9014
8999
  const DEFAULT_TILE_SIZE = 24;
9015
9000
  const DEFAULT_COLUMNS_COUNT = 10;
@@ -9083,6 +9068,7 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
9083
9068
  this._tabindex = 0;
9084
9069
  this.notifyNgTouched = () => { };
9085
9070
  this.notifyNgChanged = () => { };
9071
+ validatePackage(packageMetadata);
9086
9072
  this.dynamicRTLSubscription = localizationService.changes.subscribe(({ rtl }) => {
9087
9073
  this.direction = rtl ? 'rtl' : 'ltr';
9088
9074
  });
@@ -9675,9 +9661,9 @@ var FlatColorPickerComponent_1;
9675
9661
  * through a gradient that renders an hsv canvas. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
9676
9662
  */
9677
9663
  let FlatColorPickerComponent = FlatColorPickerComponent_1 = class FlatColorPickerComponent {
9678
- constructor(service, host, localizationService, cdr, renderer, ngZone) {
9679
- this.service = service;
9664
+ constructor(host, service, localizationService, cdr, renderer, ngZone) {
9680
9665
  this.host = host;
9666
+ this.service = service;
9681
9667
  this.localizationService = localizationService;
9682
9668
  this.cdr = cdr;
9683
9669
  this.renderer = renderer;
@@ -9760,6 +9746,7 @@ let FlatColorPickerComponent = FlatColorPickerComponent_1 = class FlatColorPicke
9760
9746
  this.subscriptions = new Subscription();
9761
9747
  this.notifyNgChanged = () => { };
9762
9748
  this.notifyNgTouched = () => { };
9749
+ validatePackage(packageMetadata);
9763
9750
  this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
9764
9751
  this.direction = rtl ? 'rtl' : 'ltr';
9765
9752
  });
@@ -10233,8 +10220,8 @@ FlatColorPickerComponent = FlatColorPickerComponent_1 = __decorate([
10233
10220
  </div>
10234
10221
  `
10235
10222
  }),
10236
- __metadata("design:paramtypes", [FlatColorPickerService,
10237
- ElementRef,
10223
+ __metadata("design:paramtypes", [ElementRef,
10224
+ FlatColorPickerService,
10238
10225
  LocalizationService,
10239
10226
  ChangeDetectorRef,
10240
10227
  Renderer2,
@@ -10242,7 +10229,7 @@ FlatColorPickerComponent = FlatColorPickerComponent_1 = __decorate([
10242
10229
  ], FlatColorPickerComponent);
10243
10230
 
10244
10231
  var ColorPickerComponent_1;
10245
- let serial$2 = 0;
10232
+ const DOM_FOCUS_EVENTS = ['focus', 'blur'];
10246
10233
  /**
10247
10234
  * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
10248
10235
  *
@@ -10258,10 +10245,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10258
10245
  this.ngZone = ngZone;
10259
10246
  this.renderer = renderer;
10260
10247
  this.hostClasses = true;
10261
- /**
10262
- * @hidden
10263
- */
10264
- this.focusableId = `k-colorpicker-${serial$2++}`;
10248
+ this.role = 'listbox';
10265
10249
  /**
10266
10250
  * Specifies the views that will be rendered in the popup.
10267
10251
  * By default both the gradient and palette views will be rendered.
@@ -10357,6 +10341,10 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10357
10341
  * Used to provide a two-way binding for the `activeView` property.
10358
10342
  */
10359
10343
  this.activeViewChange = new EventEmitter();
10344
+ /**
10345
+ * Indicates whether the ColorPicker wrapper is focused.
10346
+ */
10347
+ this.isFocused = false;
10360
10348
  this._tabindex = 0;
10361
10349
  this._popupSettings = { animate: true };
10362
10350
  this._paletteSettings = {};
@@ -10364,13 +10352,30 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10364
10352
  this._size = 'medium';
10365
10353
  this._rounded = 'medium';
10366
10354
  this._fillMode = 'solid';
10355
+ this.subscriptions = new Subscription();
10367
10356
  this.notifyNgTouched = () => { };
10368
10357
  this.notifyNgChanged = () => { };
10358
+ this.domFocusListener = (event) => event.stopImmediatePropagation();
10369
10359
  validatePackage(packageMetadata);
10370
10360
  this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
10371
10361
  this.direction = rtl ? 'rtl' : 'ltr';
10372
10362
  });
10373
10363
  }
10364
+ get focusedClass() {
10365
+ return this.isFocused;
10366
+ }
10367
+ get disabledClass() {
10368
+ return this.disabled;
10369
+ }
10370
+ get ariaReadonly() {
10371
+ return this.readonly;
10372
+ }
10373
+ get ariaExpanded() {
10374
+ return this.isOpen;
10375
+ }
10376
+ get hostTabindex() {
10377
+ return this.tabindex;
10378
+ }
10374
10379
  /**
10375
10380
  * @hidden
10376
10381
  */
@@ -10430,7 +10435,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10430
10435
  return !this.disabled ? this._tabindex : undefined;
10431
10436
  }
10432
10437
  /**
10433
- * The size property specifies the font size and line height of the ColorPicker
10438
+ * The size property specifies the padding of the ColorPicker internal elements
10434
10439
  * ([see example]({% slug appearance_colorpicker %}#toc-size)).
10435
10440
  *
10436
10441
  * The possible values are:
@@ -10515,6 +10520,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10515
10520
  stylingInputs.forEach(input => {
10516
10521
  this.handleClasses(this[input], input);
10517
10522
  });
10523
+ this.setHostElementAriaLabel();
10524
+ this.handleHostId();
10525
+ this.initDomEvents();
10518
10526
  }
10519
10527
  ngOnChanges(changes) {
10520
10528
  if (changes.format && changes.format.currentValue === 'name') {
@@ -10524,18 +10532,17 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10524
10532
  this.format = 'rgba';
10525
10533
  this.value = parseColor$1(this.value, this.format, this.gradientSettings.opacity);
10526
10534
  }
10535
+ if (isChanged('value', changes)) {
10536
+ this.setHostElementAriaLabel();
10537
+ }
10527
10538
  }
10528
10539
  ngOnDestroy() {
10529
10540
  this.closePopup();
10530
10541
  if (this.dynamicRTLSubscription) {
10531
10542
  this.dynamicRTLSubscription.unsubscribe();
10532
10543
  }
10533
- }
10534
- /**
10535
- * @hidden
10536
- */
10537
- get colorPickerAriaLabel() {
10538
- return this.value ? this.value : this.localizationService.get('colorPickerNoColor');
10544
+ this.subscriptions.unsubscribe();
10545
+ this.handleDomEvents('remove', DOM_FOCUS_EVENTS);
10539
10546
  }
10540
10547
  /**
10541
10548
  * @hidden
@@ -10547,28 +10554,33 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10547
10554
  * @hidden
10548
10555
  */
10549
10556
  togglePopup() {
10550
- this.toggleWithEvents(!this.isOpen);
10551
10557
  this.focus();
10558
+ this.toggleWithEvents(!this.isOpen);
10552
10559
  }
10553
10560
  /**
10554
10561
  * @hidden
10555
10562
  */
10556
- handleActiveColorClick() {
10563
+ handleWrapperClick(event) {
10564
+ if (this.disabled) {
10565
+ return;
10566
+ }
10557
10567
  this.focus();
10558
- const event = new ActiveColorClickEvent(this.value);
10559
- this.activeColorClick.emit(event);
10560
- if (!event.isOpenPrevented() || this.isOpen) {
10561
- this.togglePopup();
10568
+ if (closest(event.target, (element) => element === this.activeColor.nativeElement)) {
10569
+ const event = new ActiveColorClickEvent(this.value);
10570
+ this.activeColorClick.emit(event);
10571
+ if (!event.isOpenPrevented() || this.isOpen) {
10572
+ this.toggleWithEvents(!this.isOpen);
10573
+ }
10574
+ return;
10562
10575
  }
10576
+ this.toggleWithEvents(!this.isOpen);
10563
10577
  }
10564
10578
  /**
10565
10579
  * Focuses the wrapper of the ColorPicker.
10566
10580
  */
10567
10581
  focus() {
10568
- if (this.disabled) {
10569
- return;
10570
- }
10571
- this.wrapper.nativeElement.focus();
10582
+ this.isFocused = true;
10583
+ this.host.nativeElement.focus();
10572
10584
  }
10573
10585
  /**
10574
10586
  * @hidden
@@ -10577,14 +10589,18 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10577
10589
  if (this.isFocused) {
10578
10590
  return;
10579
10591
  }
10580
- this.isFocused = true;
10581
- this.onFocus.emit();
10592
+ this.ngZone.run(() => {
10593
+ this.focus();
10594
+ this.onFocus.emit();
10595
+ });
10582
10596
  }
10583
10597
  /**
10584
10598
  * Blurs the ColorPicker.
10585
10599
  */
10586
10600
  blur() {
10587
- this.wrapper.nativeElement.blur();
10601
+ this.isFocused = false;
10602
+ this.host.nativeElement.blur();
10603
+ this.notifyNgTouched();
10588
10604
  }
10589
10605
  /**
10590
10606
  * @hidden
@@ -10593,9 +10609,16 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10593
10609
  if (this.isOpen) {
10594
10610
  return;
10595
10611
  }
10596
- this.isFocused = false;
10597
- this.onBlur.emit();
10598
- this.notifyNgTouched();
10612
+ this.ngZone.run(() => {
10613
+ this.onBlur.emit();
10614
+ this.isFocused = false;
10615
+ });
10616
+ }
10617
+ /**
10618
+ * @hidden
10619
+ */
10620
+ arrowButtonMouseDown(ev) {
10621
+ ev.preventDefault();
10599
10622
  }
10600
10623
  /**
10601
10624
  * Clears the value of the ColorPicker.
@@ -10605,6 +10628,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10605
10628
  return;
10606
10629
  }
10607
10630
  this._value = undefined;
10631
+ this.setHostElementAriaLabel();
10608
10632
  this.notifyNgChanged(undefined);
10609
10633
  }
10610
10634
  /**
@@ -10632,6 +10656,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10632
10656
  if (valueChange) {
10633
10657
  this.value = parsedColor;
10634
10658
  this.valueChange.emit(parsedColor);
10659
+ this.setHostElementAriaLabel();
10635
10660
  this.notifyNgChanged(parsedColor);
10636
10661
  }
10637
10662
  }
@@ -10678,7 +10703,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10678
10703
  handleWrapperKeyDown(event) {
10679
10704
  if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
10680
10705
  event.preventDefault();
10681
- this.toggleWithEvents(true);
10706
+ this.ngZone.run(() => {
10707
+ this.toggleWithEvents(true);
10708
+ });
10682
10709
  }
10683
10710
  }
10684
10711
  /**
@@ -10687,14 +10714,14 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10687
10714
  handlePopupKeyDown(event) {
10688
10715
  if (event.keyCode === Keys.Escape) {
10689
10716
  this.toggleWithEvents(false);
10690
- this.wrapper.nativeElement.focus();
10717
+ this.host.nativeElement.focus();
10691
10718
  }
10692
10719
  if (event.keyCode === Keys.Tab) {
10693
10720
  const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
10694
10721
  const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
10695
10722
  if (event.target === currentElement) {
10696
10723
  event.preventDefault();
10697
- nextElement.nativeElement.focus();
10724
+ nextElement.focus();
10698
10725
  }
10699
10726
  }
10700
10727
  }
@@ -10705,6 +10732,10 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10705
10732
  isEmpty() {
10706
10733
  return false;
10707
10734
  }
10735
+ setHostElementAriaLabel() {
10736
+ const ariaLabelValue = `${this.value ? this.value : this.localizationService.get('colorPickerNoColor')}`;
10737
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
10738
+ }
10708
10739
  handleClasses(value, input) {
10709
10740
  const elem = this.host.nativeElement;
10710
10741
  const classes = getStylingClasses('picker', input, this[input], value);
@@ -10716,9 +10747,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10716
10747
  }
10717
10748
  }
10718
10749
  popupBlurInvalid(ev) {
10719
- const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
10720
- const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
10721
- return !this.isFocused || wrapperClicked || focusInPopupElement;
10750
+ const focusInFlatColorPickerElement = this.popupRef.popupElement.contains(ev.relatedTarget);
10751
+ const hostClicked = closest(ev.relatedTarget, (element) => element === this.host.nativeElement);
10752
+ return hostClicked || focusInFlatColorPickerElement;
10722
10753
  }
10723
10754
  toggleWithEvents(open) {
10724
10755
  const sameState = this.isOpen === open;
@@ -10742,12 +10773,12 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10742
10773
  }
10743
10774
  }
10744
10775
  focusFirstElement() {
10745
- this.ngZone.runOutsideAngular(() => {
10746
- setTimeout(() => {
10776
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
10777
+ if (this.flatColorPicker) {
10747
10778
  const elementToFocus = this.flatColorPicker.gradient ? this.flatColorPicker.gradient.gradientDragHandle :
10748
10779
  this.flatColorPicker.palette.host;
10749
10780
  elementToFocus.nativeElement.focus();
10750
- });
10781
+ }
10751
10782
  });
10752
10783
  }
10753
10784
  openPopup() {
@@ -10755,7 +10786,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10755
10786
  const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
10756
10787
  const popupPosition = { horizontal: horizontalAlign, vertical: "top" };
10757
10788
  this.popupRef = this.popupService.open({
10758
- anchor: this.wrapper,
10789
+ anchor: this.activeColor,
10759
10790
  animate: this.popupSettings.animate,
10760
10791
  appendTo: this.popupSettings.appendTo,
10761
10792
  popupAlign: popupPosition,
@@ -10767,7 +10798,7 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10767
10798
  this.popupRef.popupAnchorViewportLeave.subscribe(() => {
10768
10799
  this.toggleWithEvents(false);
10769
10800
  if (!this.isOpen) {
10770
- this.wrapper.nativeElement.focus({
10801
+ this.host.nativeElement.focus({
10771
10802
  preventScroll: true
10772
10803
  });
10773
10804
  }
@@ -10795,6 +10826,51 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
10795
10826
  }
10796
10827
  return this.gradientSettings.opacity ? this.flatColorPicker.gradient.inputs.opacityInput.numericInput : this.flatColorPicker.gradient.inputs.blueInput;
10797
10828
  }
10829
+ handleDomEvents(action, events) {
10830
+ const hostElement = this.host.nativeElement;
10831
+ events.forEach(ev => hostElement[`${action}EventListener`](ev, this.domFocusListener, true));
10832
+ }
10833
+ initDomEvents() {
10834
+ if (!this.host) {
10835
+ return;
10836
+ }
10837
+ let hostElement = this.host.nativeElement;
10838
+ this.ngZone.runOutsideAngular(() => {
10839
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
10840
+ this.handleWrapperFocus();
10841
+ }));
10842
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (event) => {
10843
+ const closestPopup = this.popupRef ?
10844
+ closest(event.relatedTarget, (element) => element === this.flatColorPicker.host.nativeElement) :
10845
+ false;
10846
+ const closestWrapper = closest(event.relatedTarget, (element) => element === this.host.nativeElement);
10847
+ if (!closestPopup && !closestWrapper) {
10848
+ this.handleWrapperBlur();
10849
+ }
10850
+ }));
10851
+ this.handleDomEvents('add', DOM_FOCUS_EVENTS);
10852
+ this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (event) => {
10853
+ this.handleWrapperKeyDown(event);
10854
+ }));
10855
+ this.subscriptions.add(this.renderer.listen(hostElement, 'click', (event) => {
10856
+ this.ngZone.run(() => {
10857
+ this.handleWrapperClick(event);
10858
+ });
10859
+ }));
10860
+ });
10861
+ }
10862
+ handleHostId() {
10863
+ const hostElement = this.host.nativeElement;
10864
+ const existingId = hostElement.getAttribute('id');
10865
+ if (existingId) {
10866
+ this.focusableId = existingId;
10867
+ }
10868
+ else {
10869
+ const id = `k-${guid()}`;
10870
+ hostElement.setAttribute('id', id);
10871
+ this.focusableId = id;
10872
+ }
10873
+ }
10798
10874
  };
10799
10875
  __decorate([
10800
10876
  HostBinding('class.k-colorpicker'),
@@ -10802,14 +10878,40 @@ __decorate([
10802
10878
  HostBinding('class.k-picker'),
10803
10879
  __metadata("design:type", Boolean)
10804
10880
  ], ColorPickerComponent.prototype, "hostClasses", void 0);
10881
+ __decorate([
10882
+ HostBinding('class.k-focus'),
10883
+ __metadata("design:type", Boolean),
10884
+ __metadata("design:paramtypes", [])
10885
+ ], ColorPickerComponent.prototype, "focusedClass", null);
10886
+ __decorate([
10887
+ HostBinding('attr.aria-disabled'),
10888
+ HostBinding('class.k-disabled'),
10889
+ __metadata("design:type", Boolean),
10890
+ __metadata("design:paramtypes", [])
10891
+ ], ColorPickerComponent.prototype, "disabledClass", null);
10892
+ __decorate([
10893
+ HostBinding('attr.aria-readonly'),
10894
+ __metadata("design:type", Boolean),
10895
+ __metadata("design:paramtypes", [])
10896
+ ], ColorPickerComponent.prototype, "ariaReadonly", null);
10897
+ __decorate([
10898
+ HostBinding('attr.aria-expanded'),
10899
+ __metadata("design:type", Boolean),
10900
+ __metadata("design:paramtypes", [])
10901
+ ], ColorPickerComponent.prototype, "ariaExpanded", null);
10902
+ __decorate([
10903
+ HostBinding('attr.tabindex'),
10904
+ __metadata("design:type", Number),
10905
+ __metadata("design:paramtypes", [])
10906
+ ], ColorPickerComponent.prototype, "hostTabindex", null);
10805
10907
  __decorate([
10806
10908
  HostBinding('attr.dir'),
10807
10909
  __metadata("design:type", String)
10808
10910
  ], ColorPickerComponent.prototype, "direction", void 0);
10809
10911
  __decorate([
10810
- Input(),
10912
+ HostBinding('attr.role'),
10811
10913
  __metadata("design:type", String)
10812
- ], ColorPickerComponent.prototype, "focusableId", void 0);
10914
+ ], ColorPickerComponent.prototype, "role", void 0);
10813
10915
  __decorate([
10814
10916
  Input(),
10815
10917
  __metadata("design:type", Array)
@@ -10932,9 +11034,9 @@ __decorate([
10932
11034
  __metadata("design:type", ViewContainerRef)
10933
11035
  ], ColorPickerComponent.prototype, "container", void 0);
10934
11036
  __decorate([
10935
- ViewChild('wrapper', { static: true }),
11037
+ ViewChild('activeColor', { static: true }),
10936
11038
  __metadata("design:type", ElementRef)
10937
- ], ColorPickerComponent.prototype, "wrapper", void 0);
11039
+ ], ColorPickerComponent.prototype, "activeColor", void 0);
10938
11040
  __decorate([
10939
11041
  ViewChild('popupTemplate', { static: true }),
10940
11042
  __metadata("design:type", TemplateRef)
@@ -11000,38 +11102,19 @@ ColorPickerComponent = ColorPickerComponent_1 = __decorate([
11000
11102
  i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
11001
11103
  cancelButton="Cancel">
11002
11104
  </ng-container>
11003
- <span
11004
- #wrapper
11005
- [ngClass]="{
11006
- 'k-input-inner': true,
11007
- 'k-disabled': this.disabled,
11008
- 'k-focus': this.isFocused
11009
- }"
11010
- role="listbox"
11011
- [attr.aria-expanded]="isOpen"
11012
- [attr.aria-readonly]="readonly"
11013
- [attr.aria-disabled]="disabled"
11014
- [attr.aria-label]="colorPickerAriaLabel"
11015
- [id]="focusableId"
11016
- [attr.tabindex]="tabindex"
11017
- (focus)="handleWrapperFocus()"
11018
- (blur)="handleWrapperBlur()"
11019
- (mousedown)="$event.preventDefault()"
11020
- (keydown)="handleWrapperKeyDown($event)"
11021
- >
11105
+ <span #activeColor class="k-input-inner">
11022
11106
  <span
11023
11107
  class="k-value-icon k-color-preview"
11024
- [ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}"
11025
- (click)="handleActiveColorClick()">
11108
+ [ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}">
11026
11109
  <span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>
11027
11110
  <span class="k-color-preview-mask" [style.background-color]="value"></span>
11028
11111
  </span>
11029
11112
  </span>
11030
11113
  <button
11031
- type="button"
11032
- class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button"
11033
- [attr.aria-label]="colorPickerAriaLabel"
11034
- (click)="togglePopup()">
11114
+ #arrowButton
11115
+ tabindex="-1"
11116
+ role="button"
11117
+ class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button">
11035
11118
  <span class="k-button-icon k-icon k-i-arrow-s"></span>
11036
11119
  </button>
11037
11120
  <ng-template #popupTemplate>
@@ -11046,8 +11129,8 @@ ColorPickerComponent = ColorPickerComponent_1 = __decorate([
11046
11129
  [gradientSettings]="gradientSettings"
11047
11130
  [paletteSettings]="paletteSettings"
11048
11131
  [clearButton]="clearButton"
11049
- (focusout)="handlePopupBlur($event)"
11050
11132
  (cancel)="handleCancelEvent($event)"
11133
+ (focusout)="handlePopupBlur($event)"
11051
11134
  (valueChange)="handleValueChange($event)"
11052
11135
  (keydown)="handlePopupKeyDown($event)"
11053
11136
  (activeViewChange)="activeViewChange.emit($event)"
@@ -11622,6 +11705,7 @@ let RadioButtonDirective = class RadioButtonDirective {
11622
11705
  this.hostElement = hostElement;
11623
11706
  this.kendoClass = true;
11624
11707
  this._size = 'medium';
11708
+ validatePackage(packageMetadata);
11625
11709
  }
11626
11710
  /**
11627
11711
  * The size property specifies the width and height of the RadioButton
@@ -11715,7 +11799,7 @@ RadioButtonModule = __decorate([
11715
11799
  })
11716
11800
  ], RadioButtonModule);
11717
11801
 
11718
- let serial$3 = 0;
11802
+ let serial$2 = 0;
11719
11803
  /**
11720
11804
  * Represents an error message that will be shown underneath
11721
11805
  * a Kendo control or native HTML form-bound component after a validation.
@@ -11738,7 +11822,7 @@ let ErrorComponent = class ErrorComponent {
11738
11822
  /**
11739
11823
  * @hidden
11740
11824
  */
11741
- this.id = `kendo-error-${serial$3++}`;
11825
+ this.id = `kendo-error-${serial$2++}`;
11742
11826
  this.roleAttribute = 'alert';
11743
11827
  }
11744
11828
  get startClass() {
@@ -11787,7 +11871,7 @@ ErrorComponent = __decorate([
11787
11871
  })
11788
11872
  ], ErrorComponent);
11789
11873
 
11790
- let serial$4 = 0;
11874
+ let serial$3 = 0;
11791
11875
  /**
11792
11876
  * Represents a hint message that will be shown underneath a form-bound component.
11793
11877
  */
@@ -11807,7 +11891,7 @@ let HintComponent = class HintComponent {
11807
11891
  /**
11808
11892
  * @hidden
11809
11893
  */
11810
- this.id = `kendo-hint-${serial$4++}`;
11894
+ this.id = `kendo-hint-${serial$3++}`;
11811
11895
  this.hostClass = true;
11812
11896
  }
11813
11897
  get startClass() {