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

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 (104) 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/checkbox/checkbox.directive.js +79 -3
  4. package/dist/es/colorpicker/color-gradient.component.js +1 -1
  5. package/dist/es/colorpicker/color-input.component.js +1 -1
  6. package/dist/es/colorpicker/colorpicker.component.js +111 -6
  7. package/dist/es/colorpicker/flatcolorpicker-actions.component.js +1 -1
  8. package/dist/es/colorpicker/flatcolorpicker-header.component.js +1 -1
  9. package/dist/es/common/models/fillmode.js +4 -0
  10. package/dist/es/common/models/rounded.js +4 -0
  11. package/dist/es/common/models/size.js +4 -0
  12. package/dist/es/common/models/styling-classes.js +4 -0
  13. package/dist/es/common/models.js +4 -0
  14. package/dist/es/common/utils.js +37 -0
  15. package/dist/es/main.js +0 -1
  16. package/dist/es/maskedtextbox/maskedtextbox.component.js +101 -6
  17. package/dist/es/numerictextbox/numerictextbox.component.js +116 -20
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/es/radiobutton/radiobutton.directive.js +52 -3
  20. package/dist/es/shared/textarea.directive.js +3 -2
  21. package/dist/es/switch/switch.component.js +167 -21
  22. package/dist/es/text-fields-common/text-fields-base.js +1 -1
  23. package/dist/es/textarea/textarea.component.js +101 -5
  24. package/dist/es/textbox/textbox.component.js +108 -11
  25. package/dist/es/textbox/textbox.directive.js +3 -2
  26. package/dist/es/textbox.module.js +0 -3
  27. package/dist/es2015/checkbox/checkbox.directive.d.ts +31 -0
  28. package/dist/es2015/checkbox/checkbox.directive.js +68 -10
  29. package/dist/es2015/colorpicker/color-gradient.component.js +1 -1
  30. package/dist/es2015/colorpicker/color-input.component.js +1 -1
  31. package/dist/es2015/colorpicker/colorpicker.component.d.ts +45 -3
  32. package/dist/es2015/colorpicker/colorpicker.component.js +113 -16
  33. package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +2 -2
  34. package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +2 -2
  35. package/dist/es2015/common/models/fillmode.d.ts +13 -0
  36. package/dist/es2015/common/models/fillmode.js +4 -0
  37. package/dist/es2015/common/models/rounded.d.ts +23 -0
  38. package/dist/es2015/common/models/rounded.js +4 -0
  39. package/dist/es2015/common/models/size.d.ts +14 -0
  40. package/dist/es2015/common/models/size.js +4 -0
  41. package/dist/es2015/common/models/styling-classes.d.ts +11 -0
  42. package/dist/es2015/common/models/styling-classes.js +4 -0
  43. package/dist/es2015/common/models.d.ts +8 -0
  44. package/dist/es2015/common/models.js +4 -0
  45. package/dist/es2015/common/utils.d.ts +7 -0
  46. package/dist/es2015/common/utils.js +37 -0
  47. package/dist/es2015/index.metadata.json +1 -1
  48. package/dist/es2015/main.d.ts +1 -1
  49. package/dist/es2015/main.js +0 -1
  50. package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +39 -1
  51. package/dist/es2015/maskedtextbox/maskedtextbox.component.js +88 -6
  52. package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +39 -2
  53. package/dist/es2015/numerictextbox/numerictextbox.component.js +124 -40
  54. package/dist/es2015/package-metadata.js +1 -1
  55. package/dist/es2015/radiobutton/radiobutton.directive.d.ts +18 -0
  56. package/dist/es2015/radiobutton/radiobutton.directive.js +46 -11
  57. package/dist/es2015/shared/textarea.directive.d.ts +1 -1
  58. package/dist/es2015/shared/textarea.directive.js +3 -2
  59. package/dist/es2015/switch/switch.component.d.ts +48 -5
  60. package/dist/es2015/switch/switch.component.js +166 -24
  61. package/dist/es2015/text-fields-common/text-fields-base.js +1 -1
  62. package/dist/es2015/textarea/textarea.component.d.ts +39 -1
  63. package/dist/es2015/textarea/textarea.component.js +89 -5
  64. package/dist/es2015/textbox/textbox.component.d.ts +40 -1
  65. package/dist/es2015/textbox/textbox.component.js +96 -11
  66. package/dist/es2015/textbox/textbox.directive.d.ts +1 -1
  67. package/dist/es2015/textbox/textbox.directive.js +3 -2
  68. package/dist/es2015/textbox.module.js +0 -3
  69. package/dist/fesm2015/index.js +936 -478
  70. package/dist/fesm5/index.js +1015 -484
  71. package/dist/npm/checkbox/checkbox.directive.js +78 -2
  72. package/dist/npm/colorpicker/color-gradient.component.js +1 -1
  73. package/dist/npm/colorpicker/color-input.component.js +1 -1
  74. package/dist/npm/colorpicker/colorpicker.component.js +109 -4
  75. package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +1 -1
  76. package/dist/npm/colorpicker/flatcolorpicker-header.component.js +1 -1
  77. package/dist/npm/common/models/fillmode.js +6 -0
  78. package/dist/npm/common/models/rounded.js +6 -0
  79. package/dist/npm/common/models/size.js +6 -0
  80. package/dist/npm/common/models/styling-classes.js +6 -0
  81. package/dist/npm/common/models.js +6 -0
  82. package/dist/npm/common/utils.js +37 -0
  83. package/dist/npm/main.js +0 -2
  84. package/dist/npm/maskedtextbox/maskedtextbox.component.js +100 -5
  85. package/dist/npm/numerictextbox/numerictextbox.component.js +115 -19
  86. package/dist/npm/package-metadata.js +1 -1
  87. package/dist/npm/radiobutton/radiobutton.directive.js +51 -2
  88. package/dist/npm/shared/textarea.directive.js +3 -2
  89. package/dist/npm/switch/switch.component.js +166 -20
  90. package/dist/npm/text-fields-common/text-fields-base.js +1 -1
  91. package/dist/npm/textarea/textarea.component.js +100 -4
  92. package/dist/npm/textbox/textbox.component.js +107 -10
  93. package/dist/npm/textbox/textbox.directive.js +3 -2
  94. package/dist/npm/textbox.module.js +0 -3
  95. package/dist/systemjs/kendo-angular-inputs.js +1 -1
  96. package/package.json +11 -11
  97. package/dist/es/textbox/floating-label-input-adapter.js +0 -58
  98. package/dist/es/textbox/textbox-container.component.js +0 -224
  99. package/dist/es2015/textbox/floating-label-input-adapter.d.ts +0 -20
  100. package/dist/es2015/textbox/floating-label-input-adapter.js +0 -52
  101. package/dist/es2015/textbox/textbox-container.component.d.ts +0 -59
  102. package/dist/es2015/textbox/textbox-container.component.js +0 -209
  103. package/dist/npm/textbox/floating-label-input-adapter.js +0 -60
  104. package/dist/npm/textbox/textbox-container.component.js +0 -226
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  var ColorPickerComponent_1;
7
- import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone } from '@angular/core';
7
+ import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
8
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
9
  import { FlatColorPickerComponent } from './flatcolorpicker.component';
10
10
  import { PopupService } from '@progress/kendo-angular-popup';
@@ -15,7 +15,7 @@ import { packageMetadata } from '../package-metadata';
15
15
  import { PALETTEPRESETS } from './models';
16
16
  import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
17
17
  import { parseColor } from './utils';
18
- import { isPresent } from '../common/utils';
18
+ import { getStylingClasses, isPresent } from '../common/utils';
19
19
  import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
20
20
  import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
21
21
  let serial = 0;
@@ -26,11 +26,13 @@ let serial = 0;
26
26
  * which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
27
27
  */
28
28
  let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
29
- constructor(popupService, cdr, localizationService, ngZone) {
29
+ constructor(host, popupService, cdr, localizationService, ngZone, renderer) {
30
+ this.host = host;
30
31
  this.popupService = popupService;
31
32
  this.cdr = cdr;
32
33
  this.localizationService = localizationService;
33
34
  this.ngZone = ngZone;
35
+ this.renderer = renderer;
34
36
  this.hostClasses = true;
35
37
  /**
36
38
  * @hidden
@@ -135,6 +137,9 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
135
137
  this._popupSettings = { animate: true };
136
138
  this._paletteSettings = {};
137
139
  this._gradientSettings = { opacity: true, delay: 0 };
140
+ this._size = 'medium';
141
+ this._rounded = 'medium';
142
+ this._fillMode = 'solid';
138
143
  this.notifyNgTouched = () => { };
139
144
  this.notifyNgChanged = () => { };
140
145
  validatePackage(packageMetadata);
@@ -191,6 +196,58 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
191
196
  get tabindex() {
192
197
  return !this.disabled ? this._tabindex : undefined;
193
198
  }
199
+ /**
200
+ * The size property specifies the font size and line height of the ColorPicker
201
+ * ([see example]({% slug appearance_colorpicker %}#toc-size)).
202
+ *
203
+ * The possible values are:
204
+ * * `'small'`
205
+ * * `'medium'` (default)
206
+ * * `'large'`
207
+ * * `null`
208
+ */
209
+ set size(size) {
210
+ this.handleClasses(size, 'size');
211
+ this._size = size;
212
+ }
213
+ get size() {
214
+ return this._size;
215
+ }
216
+ /**
217
+ * The rounded property specifies the border radius of the ColorPicker
218
+ * ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
219
+ *
220
+ * The possible values are:
221
+ * * `'small'`
222
+ * * `'medium'` (default)
223
+ * * `'large'`
224
+ * * `'full'`
225
+ * * `null`
226
+ */
227
+ set rounded(rounded) {
228
+ this.handleClasses(rounded, 'rounded');
229
+ this._rounded = rounded;
230
+ }
231
+ get rounded() {
232
+ return this._rounded;
233
+ }
234
+ /**
235
+ * The fillMode property specifies the background and border styles of the ColorPicker
236
+ * ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
237
+ *
238
+ * The possible values are:
239
+ * * `'flat'`
240
+ * * `'solid'` (default)
241
+ * * `'outline'`
242
+ * * `null`
243
+ */
244
+ set fillMode(fillMode) {
245
+ this.handleClasses(fillMode, 'fillMode');
246
+ this._fillMode = fillMode;
247
+ }
248
+ get fillMode() {
249
+ return this._fillMode;
250
+ }
194
251
  /**
195
252
  * Indicates whether the ColorPicker popup is open.
196
253
  */
@@ -220,6 +277,12 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
220
277
  columns: this._paletteSettings.columns || presetColumns || 10
221
278
  };
222
279
  }
280
+ ngAfterViewInit() {
281
+ const stylingInputs = ['size', 'rounded', 'fillMode'];
282
+ stylingInputs.forEach(input => {
283
+ this.handleClasses(this[input], input);
284
+ });
285
+ }
223
286
  ngOnChanges(changes) {
224
287
  if (changes.format && changes.format.currentValue === 'name') {
225
288
  this.activeView = 'palette';
@@ -409,6 +472,16 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
409
472
  isEmpty() {
410
473
  return false;
411
474
  }
475
+ handleClasses(value, input) {
476
+ const elem = this.host.nativeElement;
477
+ const classes = getStylingClasses('picker', input, this[input], value);
478
+ if (classes.toRemove) {
479
+ this.renderer.removeClass(elem, classes.toRemove);
480
+ }
481
+ if (classes.toAdd) {
482
+ this.renderer.addClass(elem, classes.toAdd);
483
+ }
484
+ }
412
485
  popupBlurInvalid(ev) {
413
486
  const focusInPopupElement = this.popupRef.popupElement.contains(ev.relatedTarget);
414
487
  const wrapperClicked = ev.relatedTarget === this.wrapper.nativeElement;
@@ -492,6 +565,8 @@ let ColorPickerComponent = ColorPickerComponent_1 = class ColorPickerComponent {
492
565
  };
493
566
  tslib_1.__decorate([
494
567
  HostBinding('class.k-colorpicker'),
568
+ HostBinding('class.k-icon-picker'),
569
+ HostBinding('class.k-picker'),
495
570
  tslib_1.__metadata("design:type", Boolean)
496
571
  ], ColorPickerComponent.prototype, "hostClasses", void 0);
497
572
  tslib_1.__decorate([
@@ -567,6 +642,21 @@ tslib_1.__decorate([
567
642
  Input(),
568
643
  tslib_1.__metadata("design:type", String)
569
644
  ], ColorPickerComponent.prototype, "actionsLayout", void 0);
645
+ tslib_1.__decorate([
646
+ Input(),
647
+ tslib_1.__metadata("design:type", String),
648
+ tslib_1.__metadata("design:paramtypes", [String])
649
+ ], ColorPickerComponent.prototype, "size", null);
650
+ tslib_1.__decorate([
651
+ Input(),
652
+ tslib_1.__metadata("design:type", String),
653
+ tslib_1.__metadata("design:paramtypes", [String])
654
+ ], ColorPickerComponent.prototype, "rounded", null);
655
+ tslib_1.__decorate([
656
+ Input(),
657
+ tslib_1.__metadata("design:type", String),
658
+ tslib_1.__metadata("design:paramtypes", [String])
659
+ ], ColorPickerComponent.prototype, "fillMode", null);
570
660
  tslib_1.__decorate([
571
661
  Output(),
572
662
  tslib_1.__metadata("design:type", EventEmitter)
@@ -675,9 +765,9 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
675
765
  <span
676
766
  #wrapper
677
767
  [ngClass]="{
678
- 'k-picker-wrap': true,
679
- 'k-state-disabled': this.disabled,
680
- 'k-state-focused': this.isFocused
768
+ 'k-input-inner': true,
769
+ 'k-disabled': this.disabled,
770
+ 'k-focus': this.isFocused
681
771
  }"
682
772
  role="listbox"
683
773
  [attr.aria-expanded]="isOpen"
@@ -691,16 +781,21 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
691
781
  (mousedown)="$event.preventDefault()"
692
782
  (keydown)="handleWrapperKeyDown($event)"
693
783
  >
694
- <span *ngIf="!iconStyles" class="k-selected-color" [style.background]="value" (click)="handleActiveColorClick()">
695
- <span class="k-icon k-i-line" *ngIf="!value"></span>
696
- </span>
697
- <span *ngIf="iconStyles" class="k-tool-icon" [ngClass]="iconStyles" (click)="handleActiveColorClick()">
698
- <span class="k-selected-color" [style.background-color]="value"></span>
699
- </span>
700
- <span class="k-select" (click)="togglePopup()">
701
- <span class="k-icon k-i-arrow-s"></span>
784
+ <span
785
+ class="k-value-icon k-color-preview"
786
+ [ngClass]="{'k-icon-color-preview': iconStyles, 'k-no-color': !value}"
787
+ (click)="handleActiveColorClick()">
788
+ <span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>
789
+ <span class="k-color-preview-mask" [style.background-color]="value"></span>
702
790
  </span>
703
791
  </span>
792
+ <button
793
+ type="button"
794
+ class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button"
795
+ [attr.aria-label]="colorPickerAriaLabel"
796
+ (click)="togglePopup()">
797
+ <span class="k-button-icon k-icon k-i-arrow-s"></span>
798
+ </button>
704
799
  <ng-template #popupTemplate>
705
800
  <kendo-flatcolorpicker
706
801
  #flatColorPicker
@@ -724,9 +819,11 @@ ColorPickerComponent = ColorPickerComponent_1 = tslib_1.__decorate([
724
819
  <ng-container #container></ng-container>
725
820
  `
726
821
  }),
727
- tslib_1.__metadata("design:paramtypes", [PopupService,
822
+ tslib_1.__metadata("design:paramtypes", [ElementRef,
823
+ PopupService,
728
824
  ChangeDetectorRef,
729
825
  LocalizationService,
730
- NgZone])
826
+ NgZone,
827
+ Renderer2])
731
828
  ], ColorPickerComponent);
732
829
  export { ColorPickerComponent };
@@ -44,12 +44,12 @@ FlatColorPickerActionButtonsComponent = tslib_1.__decorate([
44
44
  selector: '[kendoFlatColorPickerActionButtons]',
45
45
  template: `
46
46
  <button
47
- class="k-coloreditor-cancel k-button"
47
+ class="k-coloreditor-cancel k-button k-button-md k-button-solid k-button-solid-base"
48
48
  [attr.title]="getText('cancelButton')"
49
49
  (click)="onActionButtonClick('cancel', $event)"
50
50
  >{{getText('cancelButton')}}</button>
51
51
  <button #last
52
- class="k-coloreditor-apply k-button k-primary"
52
+ class="k-coloreditor-apply k-button k-button-md k-button-solid k-button-solid-primary"
53
53
  [attr.title]="getText('applyButton')"
54
54
  (click)="onActionButtonClick('apply', $event)"
55
55
  >{{getText('applyButton')}}</button>
@@ -88,7 +88,7 @@ FlatColorPickerHeaderComponent = tslib_1.__decorate([
88
88
  <button *ngFor="let view of views"
89
89
  #viewButtons
90
90
  (click)="onViewButtonClick(view)"
91
- class="k-button k-icon-button k-flat"
91
+ class="k-button k-button-md k-button-flat k-button-flat-base k-icon-button"
92
92
  [attr.title]="getText(view === 'gradient' ? 'gradientView' : 'paletteView')"
93
93
  [attr.aria-label]="getText(view === 'gradient' ? 'gradientView' : 'paletteView')"
94
94
  [attr.aria-pressed]="activeView === view"
@@ -105,7 +105,7 @@ FlatColorPickerHeaderComponent = tslib_1.__decorate([
105
105
  <div class="k-coloreditor-header-actions k-hstack">
106
106
  <button *ngIf="clearButton"
107
107
  #clearButton
108
- class="k-button k-icon-button k-flat k-coloreditor-reset"
108
+ class="k-button k-button-md k-button-flat k-button-flat-base k-icon-button k-coloreditor-reset"
109
109
  [attr.aria-label]="getText('clearButton')"
110
110
  [attr.title]="getText('clearButton')"
111
111
  (click)="clearButtonClick.emit()">
@@ -0,0 +1,13 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the possible fillMode options of the inputs.
7
+ *
8
+ * The possible values are:
9
+ * - `solid`
10
+ * - `flat`
11
+ * - `outline`
12
+ */
13
+ export declare type InputFillMode = 'solid' | 'flat' | 'outline';
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,23 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the possible rounded options of the inputs.
7
+ *
8
+ * The possible values are:
9
+ * - `'small'`
10
+ * - `'medium'`
11
+ * - `'large'`
12
+ * - `'full'`
13
+ */
14
+ export declare type InputRounded = 'small' | 'medium' | 'large' | 'full';
15
+ /**
16
+ * Represents the possible rounded options of the CheckBox.
17
+ *
18
+ * The possible values are:
19
+ * - `'small'`
20
+ * - `'medium'`
21
+ * - `'large'`
22
+ */
23
+ export declare type CheckBoxRounded = 'small' | 'medium' | 'large';
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,14 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the possible size options of the inputs.
7
+ *
8
+ * The possible values are:
9
+ * - `'small'`
10
+ * - `'medium'`
11
+ * - `'large'`
12
+ * - `null`
13
+ */
14
+ export declare type InputSize = 'small' | 'medium' | 'large' | null;
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,11 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export interface InputStylingClasses {
9
+ toRemove?: string;
10
+ toAdd?: string;
11
+ }
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ export * from './models/fillmode';
6
+ export * from './models/rounded';
7
+ export * from './models/size';
8
+ export * from './models/styling-classes';
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -2,6 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ import { InputStylingClasses } from "./models";
5
6
  /**
6
7
  * @hidden
7
8
  *
@@ -26,3 +27,9 @@ export declare const requiresZoneOnBlur: (ngControl: any) => any;
26
27
  * @param max The inclusive upper bound number.
27
28
  */
28
29
  export declare const fitIntoBounds: (contender: number, min: number, max: number) => number;
30
+ /**
31
+ * @hidden
32
+ *
33
+ * Returns the styling classes to be added and removed
34
+ */
35
+ export declare const getStylingClasses: (componentType: any, stylingOption: string, previousValue: any, newValue: any) => InputStylingClasses;
@@ -32,3 +32,40 @@ export const fitIntoBounds = (contender, min, max) => {
32
32
  }
33
33
  return contender <= min ? min : contender >= max ? max : contender;
34
34
  };
35
+ const SIZES = {
36
+ small: 'sm',
37
+ medium: 'md',
38
+ large: 'lg'
39
+ };
40
+ const ROUNDNESS = {
41
+ small: 'sm',
42
+ medium: 'md',
43
+ large: 'lg',
44
+ full: 'full'
45
+ };
46
+ /**
47
+ * @hidden
48
+ *
49
+ * Returns the styling classes to be added and removed
50
+ */
51
+ export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
52
+ switch (stylingOption) {
53
+ case 'size':
54
+ return {
55
+ toRemove: `k-${componentType}-${SIZES[previousValue]}`,
56
+ toAdd: newValue ? `k-${componentType}-${SIZES[newValue]}` : null
57
+ };
58
+ case 'rounded':
59
+ return {
60
+ toRemove: `k-rounded-${ROUNDNESS[previousValue]}`,
61
+ toAdd: newValue ? `k-rounded-${ROUNDNESS[newValue]}` : null
62
+ };
63
+ case 'fillMode':
64
+ return {
65
+ toRemove: `k-${componentType}-${previousValue}`,
66
+ toAdd: newValue ? `k-${componentType}-${newValue}` : null
67
+ };
68
+ default:
69
+ break;
70
+ }
71
+ };