@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
@@ -10,13 +10,13 @@ import { Component, ElementRef, forwardRef, Input, Output, EventEmitter, HostBin
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
11
  import { packageMetadata } from '../package-metadata';
12
12
  import { invokeElementMethod } from '../common/dom-utils';
13
- import { areSame, requiresZoneOnBlur } from '../common/utils';
13
+ import { areSame, requiresZoneOnBlur, getStylingClasses } from '../common/utils';
14
14
  import { guid, hasObservers, KendoInput, Keys } from '@progress/kendo-angular-common';
15
15
  import { TextBoxSuffixTemplateDirective } from './textbox-suffix.directive';
16
16
  import { TextBoxPrefixTemplateDirective } from './textbox-prefix.directive';
17
17
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
18
18
  import { isSafari } from '../shared/utils';
19
- var FOCUSED = 'k-state-focused';
19
+ var FOCUSED = 'k-focus';
20
20
  var TextBoxComponent = /** @class */ (function () {
21
21
  function TextBoxComponent(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
22
22
  var _this = this;
@@ -151,9 +151,12 @@ var TextBoxComponent = /** @class */ (function () {
151
151
  * ```
152
152
  */
153
153
  this.onBlur = new EventEmitter();
154
- this.hostClass = true;
154
+ this.hostClasses = true;
155
155
  this._isFocused = false;
156
156
  this.focusChangedProgrammatically = false;
157
+ this._size = 'medium';
158
+ this._rounded = 'medium';
159
+ this._fillMode = 'solid';
157
160
  /**
158
161
  * @hidden
159
162
  */
@@ -208,6 +211,70 @@ var TextBoxComponent = /** @class */ (function () {
208
211
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
209
212
  }
210
213
  TextBoxComponent_1 = TextBoxComponent;
214
+ Object.defineProperty(TextBoxComponent.prototype, "size", {
215
+ get: function () {
216
+ return this._size;
217
+ },
218
+ /**
219
+ * The size property specifies the font size and line height of the TextBox
220
+ * ([see example]({% slug appearance_textbox %}#toc-size)).
221
+ *
222
+ * The possible values are:
223
+ * * `'small'`
224
+ * * `'medium'` (default)
225
+ * * `'large'`
226
+ * * `null`
227
+ */
228
+ set: function (size) {
229
+ this.handleClasses(size, 'size');
230
+ this._size = size;
231
+ },
232
+ enumerable: true,
233
+ configurable: true
234
+ });
235
+ Object.defineProperty(TextBoxComponent.prototype, "rounded", {
236
+ get: function () {
237
+ return this._rounded;
238
+ },
239
+ /**
240
+ * The rounded property specifies the border radius of the TextBox
241
+ * ([see example]({% slug appearance_textbox %}#toc-rounded)).
242
+ *
243
+ * The possible values are:
244
+ * * `'small'`
245
+ * * `'medium'` (default)
246
+ * * `'large'`
247
+ * * `'full'`
248
+ * * `null`
249
+ */
250
+ set: function (rounded) {
251
+ this.handleClasses(rounded, 'rounded');
252
+ this._rounded = rounded;
253
+ },
254
+ enumerable: true,
255
+ configurable: true
256
+ });
257
+ Object.defineProperty(TextBoxComponent.prototype, "fillMode", {
258
+ get: function () {
259
+ return this._fillMode;
260
+ },
261
+ /**
262
+ * The fillMode property specifies the background and border styles of the TextBox
263
+ * ([see example]({% slug appearance_textbox %}#toc-fillMode)).
264
+ *
265
+ * The possible values are:
266
+ * * `'flat'`
267
+ * * `'solid'` (default)
268
+ * * `'outline'`
269
+ * * `null`
270
+ */
271
+ set: function (fillMode) {
272
+ this.handleClasses(fillMode, 'fillMode');
273
+ this._fillMode = fillMode;
274
+ },
275
+ enumerable: true,
276
+ configurable: true
277
+ });
211
278
  Object.defineProperty(TextBoxComponent.prototype, "tabIndex", {
212
279
  get: function () {
213
280
  return this.tabindex;
@@ -284,6 +351,10 @@ var TextBoxComponent = /** @class */ (function () {
284
351
  }
285
352
  }));
286
353
  });
354
+ var stylingInputs = ['size', 'rounded', 'fillMode'];
355
+ stylingInputs.forEach(function (input) {
356
+ _this.handleClasses(_this[input], input);
357
+ });
287
358
  };
288
359
  TextBoxComponent.prototype.ngOnChanges = function (changes) {
289
360
  if (changes.disabled || changes.readonly || changes.value) {
@@ -417,8 +488,8 @@ var TextBoxComponent = /** @class */ (function () {
417
488
  */
418
489
  get: function () {
419
490
  return this.successIcon
420
- ? "k-text-success " + this.successIcon
421
- : "k-text-success k-icon k-i-check-outline";
491
+ ? "" + this.successIcon
492
+ : "k-validation-icon k-icon k-i-check";
422
493
  },
423
494
  enumerable: true,
424
495
  configurable: true
@@ -429,8 +500,8 @@ var TextBoxComponent = /** @class */ (function () {
429
500
  */
430
501
  get: function () {
431
502
  return this.errorIcon
432
- ? "k-text-error " + this.errorIcon
433
- : "k-text-error k-icon k-i-warning";
503
+ ? "" + this.errorIcon
504
+ : "k-validation-icon k-icon k-i-warning";
434
505
  },
435
506
  enumerable: true,
436
507
  configurable: true
@@ -442,7 +513,7 @@ var TextBoxComponent = /** @class */ (function () {
442
513
  get: function () {
443
514
  return this.clearButtonIcon
444
515
  ? this.clearButtonIcon
445
- : "k-icon k-i-close-circle";
516
+ : "k-icon k-i-x";
446
517
  },
447
518
  enumerable: true,
448
519
  configurable: true
@@ -521,6 +592,16 @@ var TextBoxComponent = /** @class */ (function () {
521
592
  _this.isFocused = false;
522
593
  });
523
594
  };
595
+ TextBoxComponent.prototype.handleClasses = function (value, input) {
596
+ var elem = this.hostElement.nativeElement;
597
+ var classes = getStylingClasses('input', input, this[input], value);
598
+ if (classes.toRemove) {
599
+ this.renderer.removeClass(elem, classes.toRemove);
600
+ }
601
+ if (classes.toAdd) {
602
+ this.renderer.addClass(elem, classes.toAdd);
603
+ }
604
+ };
524
605
  var TextBoxComponent_1;
525
606
  tslib_1.__decorate([
526
607
  Input(),
@@ -574,6 +655,21 @@ var TextBoxComponent = /** @class */ (function () {
574
655
  Input(),
575
656
  tslib_1.__metadata("design:type", String)
576
657
  ], TextBoxComponent.prototype, "clearButtonIcon", void 0);
658
+ tslib_1.__decorate([
659
+ Input(),
660
+ tslib_1.__metadata("design:type", String),
661
+ tslib_1.__metadata("design:paramtypes", [String])
662
+ ], TextBoxComponent.prototype, "size", null);
663
+ tslib_1.__decorate([
664
+ Input(),
665
+ tslib_1.__metadata("design:type", String),
666
+ tslib_1.__metadata("design:paramtypes", [String])
667
+ ], TextBoxComponent.prototype, "rounded", null);
668
+ tslib_1.__decorate([
669
+ Input(),
670
+ tslib_1.__metadata("design:type", String),
671
+ tslib_1.__metadata("design:paramtypes", [String])
672
+ ], TextBoxComponent.prototype, "fillMode", null);
577
673
  tslib_1.__decorate([
578
674
  Input(),
579
675
  tslib_1.__metadata("design:type", Number),
@@ -620,14 +716,15 @@ var TextBoxComponent = /** @class */ (function () {
620
716
  tslib_1.__metadata("design:type", TextBoxPrefixTemplateDirective)
621
717
  ], TextBoxComponent.prototype, "prefixTemplate", void 0);
622
718
  tslib_1.__decorate([
623
- HostBinding('class.k-state-disabled'),
719
+ HostBinding('class.k-disabled'),
624
720
  tslib_1.__metadata("design:type", Boolean),
625
721
  tslib_1.__metadata("design:paramtypes", [])
626
722
  ], TextBoxComponent.prototype, "disabledClass", null);
627
723
  tslib_1.__decorate([
628
724
  HostBinding('class.k-textbox'),
725
+ HostBinding('class.k-input'),
629
726
  tslib_1.__metadata("design:type", Boolean)
630
- ], TextBoxComponent.prototype, "hostClass", void 0);
727
+ ], TextBoxComponent.prototype, "hostClasses", void 0);
631
728
  tslib_1.__decorate([
632
729
  HostBinding('attr.dir'),
633
730
  tslib_1.__metadata("design:type", String)
@@ -646,7 +743,7 @@ var TextBoxComponent = /** @class */ (function () {
646
743
  { provide: KendoInput, useExisting: forwardRef(function () { return TextBoxComponent_1; }) }
647
744
  ],
648
745
  selector: 'kendo-textbox',
649
- template: "\n <ng-container kendoTextBoxLocalizedMessages\n i18n-clear=\"kendo.textbox.clear|The title for the **Clear** button in the TextBox.\"\n clear=\"Clear\">\n </ng-container>\n <span class=\"k-input-prefix\">\n <ng-template\n *ngIf=\"prefixTemplate\"\n [ngTemplateOutlet]=\"prefixTemplate?.templateRef\">\n </ng-template>\n </span>\n <input\n class=\"k-input\"\n #input\n [id]=\"focusableId\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.tabindex]=\"disabled ? undefined : tabindex\"\n [value]=\"value\"\n [attr.placeholder]=\"placeholder\"\n [attr.title]=\"title\"\n [attr.maxlength]=\"maxlength\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleInputFocus,\n blur: handleInputBlur,\n input: handleInput}\"/>\n <span class=\"k-input-suffix\">\n <span *ngIf=\"hasErrors\" [ngClass]=\"errorIconClasses\"></span>\n <span *ngIf=\"isSuccessful\" [ngClass]=\"successIconClasses\"></span>\n <span\n role=\"button\"\n class=\"k-clear-value\"\n *ngIf=\"showClearButton\"\n (click)=\"clearValue()\"\n (mousedown)=\"$event.preventDefault()\"\n [tabindex]=\"tabIndex\"\n [attr.aria-label]=\"clearTitle()\"\n [title]=\"clearTitle()\"\n (keydown.enter)=\"clearValue($event)\"\n (keydown.space)=\"clearValue($event)\"\n >\n <span [ngClass]=\"clearButtonClasses\"></span>\n </span>\n <ng-template\n *ngIf=\"suffixTemplate\"\n [ngTemplateOutlet]=\"suffixTemplate?.templateRef\">\n </ng-template>\n </span>\n "
746
+ template: "\n <ng-container kendoTextBoxLocalizedMessages\n i18n-clear=\"kendo.textbox.clear|The title for the **Clear** button in the TextBox.\"\n clear=\"Clear\">\n </ng-container>\n <span class=\"k-input-prefix\">\n <ng-template\n *ngIf=\"prefixTemplate\"\n [ngTemplateOutlet]=\"prefixTemplate?.templateRef\">\n </ng-template>\n </span>\n <input\n class=\"k-input-inner\"\n #input\n [id]=\"focusableId\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.tabindex]=\"disabled ? undefined : tabindex\"\n [value]=\"value\"\n [attr.placeholder]=\"placeholder\"\n [attr.title]=\"title\"\n [attr.maxlength]=\"maxlength\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleInputFocus,\n blur: handleInputBlur,\n input: handleInput}\"/>\n <span class=\"k-input-suffix\">\n <span *ngIf=\"hasErrors\" [ngClass]=\"errorIconClasses\"></span>\n <span *ngIf=\"isSuccessful\" [ngClass]=\"successIconClasses\"></span>\n <span\n role=\"button\"\n class=\"k-clear-value\"\n *ngIf=\"showClearButton\"\n (click)=\"clearValue()\"\n (mousedown)=\"$event.preventDefault()\"\n [tabindex]=\"tabIndex\"\n [attr.aria-label]=\"clearTitle()\"\n [title]=\"clearTitle()\"\n (keydown.enter)=\"clearValue($event)\"\n (keydown.space)=\"clearValue($event)\"\n >\n <span [ngClass]=\"clearButtonClasses\"></span>\n </span>\n <ng-template\n *ngIf=\"suffixTemplate\"\n [ngTemplateOutlet]=\"suffixTemplate?.templateRef\">\n </ng-template>\n </span>\n "
650
747
  }),
651
748
  tslib_1.__metadata("design:paramtypes", [LocalizationService,
652
749
  NgZone,
@@ -21,7 +21,7 @@ var TextBoxDirective = /** @class */ (function () {
21
21
  this.renderer = renderer;
22
22
  this.inputElement = inputElement;
23
23
  this.ngZone = ngZone;
24
- this.hostClass = true;
24
+ this.hostClasses = true;
25
25
  /**
26
26
  * @hidden
27
27
  */
@@ -99,8 +99,9 @@ var TextBoxDirective = /** @class */ (function () {
99
99
  var TextBoxDirective_1;
100
100
  tslib_1.__decorate([
101
101
  HostBinding('class.k-textbox'),
102
+ HostBinding('class.k-input'),
102
103
  tslib_1.__metadata("design:type", Boolean)
103
- ], TextBoxDirective.prototype, "hostClass", void 0);
104
+ ], TextBoxDirective.prototype, "hostClasses", void 0);
104
105
  tslib_1.__decorate([
105
106
  Input(),
106
107
  tslib_1.__metadata("design:type", String),
@@ -5,7 +5,6 @@
5
5
  import * as tslib_1 from "tslib";
6
6
  import { NgModule } from "@angular/core";
7
7
  import { TextBoxDirective } from "./textbox/textbox.directive";
8
- import { TextBoxContainerComponent } from "./textbox/textbox-container.component";
9
8
  import { TextBoxComponent } from "./textbox/textbox.component";
10
9
  import { CommonModule } from "@angular/common";
11
10
  import { EventsModule } from "@progress/kendo-angular-common";
@@ -52,7 +51,6 @@ var TextBoxModule = /** @class */ (function () {
52
51
  NgModule({
53
52
  declarations: [
54
53
  TextBoxDirective,
55
- TextBoxContainerComponent,
56
54
  TextBoxComponent,
57
55
  TextBoxSuffixTemplateDirective,
58
56
  TextBoxPrefixTemplateDirective,
@@ -61,7 +59,6 @@ var TextBoxModule = /** @class */ (function () {
61
59
  ],
62
60
  exports: [
63
61
  TextBoxDirective,
64
- TextBoxContainerComponent,
65
62
  TextBoxComponent,
66
63
  TextBoxSuffixTemplateDirective,
67
64
  TextBoxPrefixTemplateDirective,
@@ -2,6 +2,8 @@
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 { ElementRef, Renderer2 } from '@angular/core';
6
+ import { CheckBoxRounded, InputSize } from '../common/models';
5
7
  /**
6
8
  * Represents the directive that renders the [Kendo UI CheckBox]({% slug overview_checkbox %}) input component.
7
9
  * The directive is placed on input type="checkbox" elements.
@@ -12,5 +14,34 @@
12
14
  * ```
13
15
  */
14
16
  export declare class CheckBoxDirective {
17
+ private renderer;
18
+ private hostElement;
15
19
  kendoClass: boolean;
20
+ /**
21
+ * The size property specifies the width and height of the CheckBox
22
+ * ([see example]({% slug appearance_checkboxdirective %}#toc-size)).
23
+ *
24
+ * The possible values are:
25
+ * * `'small'`
26
+ * * `'medium'` (default)
27
+ * * `'large'`
28
+ * * `null`
29
+ */
30
+ size: InputSize;
31
+ /**
32
+ * The rounded property specifies the border radius of the CheckBox
33
+ * ([see example]({% slug appearance_checkboxdirective %}#toc-rounded)).
34
+ *
35
+ * The possible values are:
36
+ * * `'small'`
37
+ * * `'medium'` (default)
38
+ * * `'large'`
39
+ * * `null`
40
+ */
41
+ rounded: CheckBoxRounded;
42
+ private _size;
43
+ private _rounded;
44
+ constructor(renderer: Renderer2, hostElement: ElementRef);
45
+ ngAfterViewInit(): void;
46
+ private handleClasses;
16
47
  }
@@ -3,7 +3,8 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Directive, HostBinding } from '@angular/core';
6
+ import { Directive, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
7
+ import { getStylingClasses } from '../common/utils';
7
8
  /**
8
9
  * Represents the directive that renders the [Kendo UI CheckBox]({% slug overview_checkbox %}) input component.
9
10
  * The directive is placed on input type="checkbox" elements.
@@ -14,26 +15,83 @@ import { Directive, HostBinding } from '@angular/core';
14
15
  * ```
15
16
  */
16
17
  let CheckBoxDirective = class CheckBoxDirective {
18
+ constructor(renderer, hostElement) {
19
+ this.renderer = renderer;
20
+ this.hostElement = hostElement;
21
+ this.kendoClass = true;
22
+ this._size = 'medium';
23
+ this._rounded = 'medium';
24
+ }
17
25
  /**
18
- * Represents the directive that renders the [Kendo UI CheckBox]({% slug overview_checkbox %}) input component.
19
- * The directive is placed on input type="checkbox" elements.
26
+ * The size property specifies the width and height of the CheckBox
27
+ * ([see example]({% slug appearance_checkboxdirective %}#toc-size)).
20
28
  *
21
- * @example
22
- * ```ts-no-run
23
- * <input type="checkbox" kendoCheckBox />
24
- * ```
29
+ * The possible values are:
30
+ * * `'small'`
31
+ * * `'medium'` (default)
32
+ * * `'large'`
33
+ * * `null`
25
34
  */
26
- constructor() {
27
- this.kendoClass = true;
35
+ set size(size) {
36
+ this.handleClasses(size, 'size');
37
+ this._size = size;
38
+ }
39
+ get size() {
40
+ return this._size;
41
+ }
42
+ /**
43
+ * The rounded property specifies the border radius of the CheckBox
44
+ * ([see example]({% slug appearance_checkboxdirective %}#toc-rounded)).
45
+ *
46
+ * The possible values are:
47
+ * * `'small'`
48
+ * * `'medium'` (default)
49
+ * * `'large'`
50
+ * * `null`
51
+ */
52
+ set rounded(rounded) {
53
+ this.handleClasses(rounded, 'rounded');
54
+ this._rounded = rounded;
55
+ }
56
+ get rounded() {
57
+ return this._rounded;
58
+ }
59
+ ngAfterViewInit() {
60
+ const stylingInputs = ['size', 'rounded'];
61
+ stylingInputs.forEach(input => {
62
+ this.handleClasses(this[input], input);
63
+ });
64
+ }
65
+ handleClasses(value, input) {
66
+ const elem = this.hostElement.nativeElement;
67
+ const classes = getStylingClasses('checkbox', input, this[input], value);
68
+ if (classes.toRemove) {
69
+ this.renderer.removeClass(elem, classes.toRemove);
70
+ }
71
+ if (classes.toAdd) {
72
+ this.renderer.addClass(elem, classes.toAdd);
73
+ }
28
74
  }
29
75
  };
30
76
  tslib_1.__decorate([
31
77
  HostBinding('class.k-checkbox'),
32
78
  tslib_1.__metadata("design:type", Boolean)
33
79
  ], CheckBoxDirective.prototype, "kendoClass", void 0);
80
+ tslib_1.__decorate([
81
+ Input(),
82
+ tslib_1.__metadata("design:type", String),
83
+ tslib_1.__metadata("design:paramtypes", [String])
84
+ ], CheckBoxDirective.prototype, "size", null);
85
+ tslib_1.__decorate([
86
+ Input(),
87
+ tslib_1.__metadata("design:type", String),
88
+ tslib_1.__metadata("design:paramtypes", [String])
89
+ ], CheckBoxDirective.prototype, "rounded", null);
34
90
  CheckBoxDirective = tslib_1.__decorate([
35
91
  Directive({
36
92
  selector: 'input[kendoCheckBox]'
37
- })
93
+ }),
94
+ tslib_1.__metadata("design:paramtypes", [Renderer2,
95
+ ElementRef])
38
96
  ], CheckBoxDirective);
39
97
  export { CheckBoxDirective };
@@ -642,7 +642,7 @@ ColorGradientComponent = ColorGradientComponent_1 = tslib_1.__decorate([
642
642
  </svg>
643
643
  </div>
644
644
  <div class="k-hsv-controls k-hstack {{ clearButton ? 'k-sliders-wrap-clearable' : '' }}">
645
- <span class="k-clear-color k-button k-flat k-button-icon"
645
+ <span class="k-clear-color k-button k-button-md k-button-flat k-button-flat-base k-button-icon"
646
646
  *ngIf="clearButton"
647
647
  (click)="reset()"
648
648
  (keydown.enter)="reset()"
@@ -172,7 +172,7 @@ ColorInputComponent = tslib_1.__decorate([
172
172
  template: `
173
173
  <div class="k-vstack">
174
174
  <button #toggleFormatButton
175
- class="k-colorgradient-toggle-mode k-button k-icon-button k-flat"
175
+ class="k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button"
176
176
  [attr.aria-label]="formatButtonTitle"
177
177
  [attr.title]="formatButtonTitle"
178
178
  >
@@ -2,23 +2,26 @@
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 { EventEmitter, OnDestroy, ViewContainerRef, ChangeDetectorRef, NgZone, OnChanges, OnInit } from '@angular/core';
5
+ import { EventEmitter, ElementRef, OnDestroy, ViewContainerRef, ChangeDetectorRef, NgZone, OnChanges, OnInit, AfterViewInit, Renderer2 } from '@angular/core';
6
6
  import { ControlValueAccessor } from '@angular/forms';
7
7
  import { PopupService } from '@progress/kendo-angular-popup';
8
8
  import { LocalizationService } from '@progress/kendo-angular-l10n';
9
9
  import { PopupSettings, PaletteSettings, OutputFormat, ColorPickerView, GradientSettings, ColorPickerActionsLayout } from './models';
10
10
  import { ActiveColorClickEvent, ColorPickerCancelEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
11
+ import { InputFillMode, InputRounded, InputSize } from '../common/models';
11
12
  /**
12
13
  * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
13
14
  *
14
15
  * The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
15
16
  * which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
16
17
  */
17
- export declare class ColorPickerComponent implements OnInit, OnChanges, OnDestroy, ControlValueAccessor {
18
+ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor {
19
+ private host;
18
20
  private popupService;
19
21
  private cdr;
20
22
  private localizationService;
21
23
  private ngZone;
24
+ private renderer;
22
25
  hostClasses: boolean;
23
26
  direction: string;
24
27
  /**
@@ -126,6 +129,40 @@ export declare class ColorPickerComponent implements OnInit, OnChanges, OnDestro
126
129
  * * `stretch`
127
130
  */
128
131
  actionsLayout: ColorPickerActionsLayout;
132
+ /**
133
+ * The size property specifies the font size and line height of the ColorPicker
134
+ * ([see example]({% slug appearance_colorpicker %}#toc-size)).
135
+ *
136
+ * The possible values are:
137
+ * * `'small'`
138
+ * * `'medium'` (default)
139
+ * * `'large'`
140
+ * * `null`
141
+ */
142
+ size: InputSize;
143
+ /**
144
+ * The rounded property specifies the border radius of the ColorPicker
145
+ * ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
146
+ *
147
+ * The possible values are:
148
+ * * `'small'`
149
+ * * `'medium'` (default)
150
+ * * `'large'`
151
+ * * `'full'`
152
+ * * `null`
153
+ */
154
+ rounded: InputRounded;
155
+ /**
156
+ * The fillMode property specifies the background and border styles of the ColorPicker
157
+ * ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
158
+ *
159
+ * The possible values are:
160
+ * * `'flat'`
161
+ * * `'solid'` (default)
162
+ * * `'outline'`
163
+ * * `null`
164
+ */
165
+ fillMode: InputFillMode;
129
166
  /**
130
167
  * Fires each time the value is changed.
131
168
  */
@@ -195,9 +232,13 @@ export declare class ColorPickerComponent implements OnInit, OnChanges, OnDestro
195
232
  private _popupSettings;
196
233
  private _paletteSettings;
197
234
  private _gradientSettings;
235
+ private _size;
236
+ private _rounded;
237
+ private _fillMode;
198
238
  private dynamicRTLSubscription;
199
- constructor(popupService: PopupService, cdr: ChangeDetectorRef, localizationService: LocalizationService, ngZone: NgZone);
239
+ constructor(host: ElementRef, popupService: PopupService, cdr: ChangeDetectorRef, localizationService: LocalizationService, ngZone: NgZone, renderer: Renderer2);
200
240
  ngOnInit(): void;
241
+ ngAfterViewInit(): void;
201
242
  ngOnChanges(changes: any): void;
202
243
  ngOnDestroy(): void;
203
244
  /**
@@ -280,6 +321,7 @@ export declare class ColorPickerComponent implements OnInit, OnChanges, OnDestro
280
321
  * Used by the FloatingLabel to determine if the component is empty.
281
322
  */
282
323
  isEmpty(): boolean;
324
+ private handleClasses;
283
325
  private popupBlurInvalid;
284
326
  private toggleWithEvents;
285
327
  private focusFirstElement;