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

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 (225) 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-contrast-svg.component.js +95 -0
  5. package/dist/es/colorpicker/color-gradient.component.js +109 -81
  6. package/dist/es/colorpicker/color-input.component.js +39 -18
  7. package/dist/es/colorpicker/color-palette.component.js +28 -18
  8. package/dist/es/colorpicker/colorpicker.component.js +297 -80
  9. package/dist/es/colorpicker/constants.js +12 -0
  10. package/dist/es/colorpicker/contrast-validation.component.js +8 -6
  11. package/dist/es/colorpicker/contrast.component.js +6 -8
  12. package/dist/es/colorpicker/{models → events}/active-color-click-event.js +0 -0
  13. package/dist/es/colorpicker/events/cancel-event.js +19 -0
  14. package/dist/es/colorpicker/events/close-event.js +17 -0
  15. package/dist/es/colorpicker/{models → events}/kendo-drag-event.js +0 -0
  16. package/dist/es/colorpicker/events/open-event.js +17 -0
  17. package/dist/es/colorpicker/events.js +8 -0
  18. package/dist/es/colorpicker/flatcolorpicker-actions.component.js +50 -0
  19. package/dist/es/colorpicker/flatcolorpicker-header.component.js +94 -0
  20. package/dist/es/colorpicker/flatcolorpicker.component.js +553 -0
  21. package/dist/es/colorpicker/localization/colorgradient-localization.service.js +7 -7
  22. package/dist/es/colorpicker/localization/colorpalette-localization.service.js +7 -7
  23. package/dist/es/colorpicker/localization/custom-messages.component.js +1 -1
  24. package/dist/es/colorpicker/localization/flatcolorpicker-localization.service.js +34 -0
  25. package/dist/es/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  26. package/dist/es/colorpicker/localization/messages.js +36 -0
  27. package/dist/es/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
  28. package/dist/{es2015/colorpicker/models/color-picker-view.js → es/colorpicker/models/colorpicker-view.js} +0 -0
  29. package/dist/es/colorpicker/{utils → models}/palette-presets.js +0 -0
  30. package/dist/es/colorpicker/models.js +1 -2
  31. package/dist/es/colorpicker/services/flatcolorpicker.service.js +41 -0
  32. package/dist/es/colorpicker/utils/color-parser.js +18 -5
  33. package/dist/es/colorpicker/utils/contrast-curve.js +91 -0
  34. package/dist/es/colorpicker/utils.js +1 -1
  35. package/dist/es/colorpicker.module.js +9 -1
  36. package/dist/es/common/models/fillmode.js +4 -0
  37. package/dist/es/common/models/rounded.js +4 -0
  38. package/dist/es/common/models/size.js +4 -0
  39. package/dist/es/common/models/styling-classes.js +4 -0
  40. package/dist/{es2015/colorpicker/models/kendo-drag-event.js → es/common/models.js} +0 -0
  41. package/dist/es/common/utils.js +37 -0
  42. package/dist/es/index.js +5 -0
  43. package/dist/es/main.js +4 -2
  44. package/dist/es/maskedtextbox/maskedtextbox.component.js +101 -6
  45. package/dist/es/numerictextbox/numerictextbox.component.js +116 -20
  46. package/dist/es/package-metadata.js +1 -1
  47. package/dist/es/radiobutton/radiobutton.directive.js +52 -3
  48. package/dist/es/shared/textarea.directive.js +3 -2
  49. package/dist/es/switch/switch.component.js +167 -21
  50. package/dist/es/text-fields-common/text-fields-base.js +1 -1
  51. package/dist/es/textarea/textarea.component.js +101 -5
  52. package/dist/es/textbox/textbox.component.js +108 -11
  53. package/dist/es/textbox/textbox.directive.js +3 -2
  54. package/dist/es/textbox.module.js +0 -3
  55. package/dist/es2015/checkbox/checkbox.directive.d.ts +31 -0
  56. package/dist/es2015/checkbox/checkbox.directive.js +68 -10
  57. package/dist/es2015/colorpicker/color-contrast-svg.component.d.ts +26 -0
  58. package/dist/es2015/colorpicker/color-contrast-svg.component.js +97 -0
  59. package/dist/es2015/colorpicker/color-gradient.component.d.ts +32 -43
  60. package/dist/es2015/colorpicker/color-gradient.component.js +126 -93
  61. package/dist/es2015/colorpicker/color-input.component.d.ts +11 -4
  62. package/dist/es2015/colorpicker/color-input.component.js +52 -32
  63. package/dist/es2015/colorpicker/color-palette.component.d.ts +8 -3
  64. package/dist/es2015/colorpicker/color-palette.component.js +28 -18
  65. package/dist/es2015/colorpicker/colorpicker.component.d.ts +129 -23
  66. package/dist/es2015/colorpicker/colorpicker.component.js +319 -125
  67. package/dist/es2015/colorpicker/constants.d.ts +12 -0
  68. package/dist/es2015/colorpicker/constants.js +12 -0
  69. package/dist/es2015/colorpicker/contrast-validation.component.d.ts +1 -1
  70. package/dist/es2015/colorpicker/contrast-validation.component.js +16 -12
  71. package/dist/es2015/colorpicker/contrast.component.d.ts +1 -3
  72. package/dist/es2015/colorpicker/contrast.component.js +17 -17
  73. package/dist/es2015/colorpicker/{models → events}/active-color-click-event.d.ts +0 -0
  74. package/dist/es2015/colorpicker/{models → events}/active-color-click-event.js +0 -0
  75. package/dist/es2015/colorpicker/events/cancel-event.d.ts +15 -0
  76. package/dist/es2015/colorpicker/events/cancel-event.js +14 -0
  77. package/dist/es2015/colorpicker/events/close-event.d.ts +10 -0
  78. package/dist/es2015/colorpicker/events/close-event.js +10 -0
  79. package/dist/es2015/colorpicker/{models → events}/kendo-drag-event.d.ts +0 -0
  80. package/dist/es2015/colorpicker/events/kendo-drag-event.js +4 -0
  81. package/dist/es2015/colorpicker/events/open-event.d.ts +10 -0
  82. package/dist/es2015/colorpicker/events/open-event.js +10 -0
  83. package/dist/es2015/colorpicker/events.d.ts +8 -0
  84. package/dist/es2015/colorpicker/events.js +8 -0
  85. package/dist/es2015/colorpicker/flatcolorpicker-actions.component.d.ts +18 -0
  86. package/dist/es2015/colorpicker/flatcolorpicker-actions.component.js +60 -0
  87. package/dist/es2015/colorpicker/flatcolorpicker-header.component.d.ts +30 -0
  88. package/dist/es2015/colorpicker/flatcolorpicker-header.component.js +131 -0
  89. package/dist/es2015/colorpicker/flatcolorpicker.component.d.ts +214 -0
  90. package/dist/es2015/colorpicker/flatcolorpicker.component.js +593 -0
  91. package/dist/es2015/colorpicker/localization/colorgradient-localization.service.d.ts +3 -3
  92. package/dist/es2015/colorpicker/localization/colorgradient-localization.service.js +7 -7
  93. package/dist/es2015/colorpicker/localization/colorpalette-localization.service.d.ts +3 -3
  94. package/dist/es2015/colorpicker/localization/colorpalette-localization.service.js +7 -7
  95. package/dist/es2015/colorpicker/localization/custom-messages.component.js +1 -1
  96. package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.d.ts +14 -0
  97. package/dist/es2015/colorpicker/localization/flatcolorpicker-localization.service.js +31 -0
  98. package/dist/es2015/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  99. package/dist/es2015/colorpicker/localization/messages.d.ts +36 -0
  100. package/dist/es2015/colorpicker/localization/messages.js +36 -0
  101. package/dist/es2015/colorpicker/models/actions-layout.d.ts +8 -0
  102. package/dist/es2015/colorpicker/models/actions-layout.js +4 -0
  103. package/dist/es2015/colorpicker/models/colorpicker-view.d.ts +8 -0
  104. package/dist/es2015/colorpicker/models/colorpicker-view.js +4 -0
  105. package/dist/es2015/colorpicker/models/gradient-settings.d.ts +4 -3
  106. package/dist/es2015/colorpicker/models/output-format.d.ts +0 -5
  107. package/dist/es2015/colorpicker/{utils → models}/palette-presets.d.ts +0 -0
  108. package/dist/es2015/colorpicker/{utils → models}/palette-presets.js +0 -0
  109. package/dist/es2015/colorpicker/models/palette-settings.d.ts +2 -3
  110. package/dist/es2015/colorpicker/models/tile-size.d.ts +1 -5
  111. package/dist/es2015/colorpicker/models.d.ts +10 -10
  112. package/dist/es2015/colorpicker/models.js +1 -2
  113. package/dist/es2015/colorpicker/services/flatcolorpicker.service.d.ts +12 -0
  114. package/dist/es2015/colorpicker/services/flatcolorpicker.service.js +38 -0
  115. package/dist/es2015/colorpicker/utils/color-parser.d.ts +8 -2
  116. package/dist/es2015/colorpicker/utils/color-parser.js +15 -5
  117. package/dist/es2015/colorpicker/utils/contrast-curve.d.ts +37 -0
  118. package/dist/es2015/colorpicker/utils/contrast-curve.js +85 -0
  119. package/dist/es2015/colorpicker/utils.d.ts +1 -1
  120. package/dist/es2015/colorpicker/utils.js +1 -1
  121. package/dist/es2015/colorpicker.module.js +9 -1
  122. package/dist/es2015/{colorpicker/models/color-picker-view.d.ts → common/models/fillmode.d.ts} +5 -5
  123. package/dist/es2015/common/models/fillmode.js +4 -0
  124. package/dist/es2015/common/models/rounded.d.ts +23 -0
  125. package/dist/es2015/common/models/rounded.js +4 -0
  126. package/dist/es2015/common/models/size.d.ts +14 -0
  127. package/dist/es2015/common/models/size.js +4 -0
  128. package/dist/es2015/common/models/styling-classes.d.ts +11 -0
  129. package/dist/es2015/common/models/styling-classes.js +4 -0
  130. package/dist/es2015/common/models.d.ts +8 -0
  131. package/dist/es2015/common/models.js +4 -0
  132. package/dist/es2015/common/utils.d.ts +7 -0
  133. package/dist/es2015/common/utils.js +37 -0
  134. package/dist/es2015/index.d.ts +5 -0
  135. package/dist/es2015/index.js +5 -0
  136. package/dist/es2015/index.metadata.json +1 -1
  137. package/dist/es2015/main.d.ts +5 -2
  138. package/dist/es2015/main.js +4 -2
  139. package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +39 -1
  140. package/dist/es2015/maskedtextbox/maskedtextbox.component.js +88 -6
  141. package/dist/es2015/numerictextbox/numerictextbox.component.d.ts +39 -2
  142. package/dist/es2015/numerictextbox/numerictextbox.component.js +124 -40
  143. package/dist/es2015/package-metadata.js +1 -1
  144. package/dist/es2015/radiobutton/radiobutton.directive.d.ts +18 -0
  145. package/dist/es2015/radiobutton/radiobutton.directive.js +46 -11
  146. package/dist/es2015/shared/textarea.directive.d.ts +1 -1
  147. package/dist/es2015/shared/textarea.directive.js +3 -2
  148. package/dist/es2015/switch/switch.component.d.ts +48 -5
  149. package/dist/es2015/switch/switch.component.js +166 -24
  150. package/dist/es2015/text-fields-common/text-fields-base.js +1 -1
  151. package/dist/es2015/textarea/textarea.component.d.ts +39 -1
  152. package/dist/es2015/textarea/textarea.component.js +89 -5
  153. package/dist/es2015/textbox/textbox.component.d.ts +40 -1
  154. package/dist/es2015/textbox/textbox.component.js +96 -11
  155. package/dist/es2015/textbox/textbox.directive.d.ts +1 -1
  156. package/dist/es2015/textbox/textbox.directive.js +3 -2
  157. package/dist/es2015/textbox.module.js +0 -3
  158. package/dist/fesm2015/index.js +3114 -1478
  159. package/dist/fesm5/index.js +3114 -1462
  160. package/dist/npm/checkbox/checkbox.directive.js +78 -2
  161. package/dist/npm/colorpicker/color-contrast-svg.component.js +97 -0
  162. package/dist/npm/colorpicker/color-gradient.component.js +109 -81
  163. package/dist/npm/colorpicker/color-input.component.js +38 -17
  164. package/dist/npm/colorpicker/color-palette.component.js +29 -19
  165. package/dist/npm/colorpicker/colorpicker.component.js +303 -86
  166. package/dist/npm/colorpicker/constants.js +12 -0
  167. package/dist/npm/colorpicker/contrast-validation.component.js +8 -6
  168. package/dist/npm/colorpicker/contrast.component.js +6 -8
  169. package/dist/npm/colorpicker/{models → events}/active-color-click-event.js +0 -0
  170. package/dist/npm/colorpicker/events/cancel-event.js +21 -0
  171. package/dist/npm/colorpicker/events/close-event.js +19 -0
  172. package/dist/npm/colorpicker/{models → events}/kendo-drag-event.js +0 -0
  173. package/dist/npm/colorpicker/events/open-event.js +19 -0
  174. package/dist/npm/colorpicker/events.js +11 -0
  175. package/dist/npm/colorpicker/flatcolorpicker-actions.component.js +52 -0
  176. package/dist/npm/colorpicker/flatcolorpicker-header.component.js +96 -0
  177. package/dist/npm/colorpicker/flatcolorpicker.component.js +555 -0
  178. package/dist/npm/colorpicker/localization/colorgradient-localization.service.js +7 -7
  179. package/dist/npm/colorpicker/localization/colorpalette-localization.service.js +7 -7
  180. package/dist/npm/colorpicker/localization/custom-messages.component.js +1 -1
  181. package/dist/npm/colorpicker/localization/flatcolorpicker-localization.service.js +36 -0
  182. package/dist/npm/colorpicker/localization/localized-colorpicker-messages.directive.js +1 -1
  183. package/dist/npm/colorpicker/localization/messages.js +36 -0
  184. package/dist/npm/colorpicker/models/{color-picker-view.js → actions-layout.js} +0 -0
  185. package/dist/npm/colorpicker/models/colorpicker-view.js +6 -0
  186. package/dist/npm/colorpicker/{utils → models}/palette-presets.js +0 -0
  187. package/dist/npm/colorpicker/models.js +1 -2
  188. package/dist/npm/colorpicker/services/flatcolorpicker.service.js +43 -0
  189. package/dist/npm/colorpicker/utils/color-parser.js +18 -5
  190. package/dist/npm/colorpicker/utils/contrast-curve.js +93 -0
  191. package/dist/npm/colorpicker/utils.js +1 -1
  192. package/dist/npm/colorpicker.module.js +9 -1
  193. package/dist/npm/common/models/fillmode.js +6 -0
  194. package/dist/npm/common/models/rounded.js +6 -0
  195. package/dist/npm/common/models/size.js +6 -0
  196. package/dist/npm/common/models/styling-classes.js +6 -0
  197. package/dist/npm/common/models.js +6 -0
  198. package/dist/npm/common/utils.js +37 -0
  199. package/dist/npm/index.js +10 -0
  200. package/dist/npm/main.js +7 -4
  201. package/dist/npm/maskedtextbox/maskedtextbox.component.js +100 -5
  202. package/dist/npm/numerictextbox/numerictextbox.component.js +115 -19
  203. package/dist/npm/package-metadata.js +1 -1
  204. package/dist/npm/radiobutton/radiobutton.directive.js +51 -2
  205. package/dist/npm/shared/textarea.directive.js +3 -2
  206. package/dist/npm/switch/switch.component.js +166 -20
  207. package/dist/npm/text-fields-common/text-fields-base.js +1 -1
  208. package/dist/npm/textarea/textarea.component.js +100 -4
  209. package/dist/npm/textbox/textbox.component.js +107 -10
  210. package/dist/npm/textbox/textbox.directive.js +3 -2
  211. package/dist/npm/textbox.module.js +0 -3
  212. package/dist/systemjs/kendo-angular-inputs.js +1 -1
  213. package/package.json +11 -10
  214. package/dist/es/colorpicker/models/preventable-event.js +0 -29
  215. package/dist/es/textbox/floating-label-input-adapter.js +0 -58
  216. package/dist/es/textbox/textbox-container.component.js +0 -224
  217. package/dist/es2015/colorpicker/models/preventable-event.d.ts +0 -21
  218. package/dist/es2015/colorpicker/models/preventable-event.js +0 -27
  219. package/dist/es2015/textbox/floating-label-input-adapter.d.ts +0 -20
  220. package/dist/es2015/textbox/floating-label-input-adapter.js +0 -52
  221. package/dist/es2015/textbox/textbox-container.component.d.ts +0 -59
  222. package/dist/es2015/textbox/textbox-container.component.js +0 -209
  223. package/dist/npm/colorpicker/models/preventable-event.js +0 -31
  224. package/dist/npm/textbox/floating-label-input-adapter.js +0 -60
  225. package/dist/npm/textbox/textbox-container.component.js +0 -226
@@ -6,17 +6,22 @@ import * as tslib_1 from "tslib";
6
6
  import { Component, Input, Output, EventEmitter, ElementRef, HostBinding, ViewChild, Renderer2 } from '@angular/core';
7
7
  import { getRGBA, parseColor, getColorFromRGBA } from './utils';
8
8
  import { isPresent } from '../common/utils';
9
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
10
- import { LocalizationService } from '@progress/kendo-angular-l10n';
9
+ import { guid, isDocumentAvailable } from '@progress/kendo-angular-common';
11
10
  import { Subscription } from 'rxjs';
11
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
12
+ import { NumericTextBoxComponent } from './../numerictextbox/numerictextbox.component';
12
13
  /**
13
14
  * @hidden
14
15
  */
15
16
  let ColorInputComponent = class ColorInputComponent {
16
- constructor(localization, host, renderer) {
17
- this.localization = localization;
17
+ constructor(host, renderer, localizationService) {
18
18
  this.host = host;
19
19
  this.renderer = renderer;
20
+ this.localizationService = localizationService;
21
+ /**
22
+ * The id of the hex input.
23
+ */
24
+ this.focusableId = `k-${guid()}`;
20
25
  /**
21
26
  * Sets whether the alpha slider will be shown.
22
27
  */
@@ -66,11 +71,14 @@ let ColorInputComponent = class ColorInputComponent {
66
71
  }
67
72
  ngOnChanges(changes) {
68
73
  if (isPresent(changes.value) && !this.isFocused) {
69
- this.hex = parseColor(this.value, 'hex');
74
+ this.hex = parseColor(this.value, 'hex', this.opacity);
70
75
  this.rgba = getRGBA(this.value);
71
- this.rgba.a = parseColor(this.value, 'rgba') ? this.rgba.a : 1;
76
+ this.rgba.a = parseColor(this.value, 'rgba', this.opacity) ? this.rgba.a : 1;
72
77
  }
73
78
  }
79
+ get formatButtonTitle() {
80
+ return this.localizationService.get('formatButton');
81
+ }
74
82
  handleRgbaValueChange() {
75
83
  const color = getColorFromRGBA(this.rgba);
76
84
  if (!this.rgbaInputValid || color === this.value) {
@@ -78,12 +86,12 @@ let ColorInputComponent = class ColorInputComponent {
78
86
  }
79
87
  this.value = color;
80
88
  this.rgba = getRGBA(this.value);
81
- this.hex = parseColor(color, 'hex');
89
+ this.hex = parseColor(color, 'hex', this.opacity);
82
90
  this.valueChange.emit(color);
83
91
  }
84
92
  handleHexValueChange(hex) {
85
93
  this.hex = hex;
86
- const color = parseColor(hex, 'rgba');
94
+ const color = parseColor(hex, 'rgba', this.opacity);
87
95
  if (!isPresent(color) || color === this.value) {
88
96
  return;
89
97
  }
@@ -97,10 +105,7 @@ let ColorInputComponent = class ColorInputComponent {
97
105
  }
98
106
  }
99
107
  handleHexInputBlur() {
100
- this.hex = parseColor(this.value, 'hex');
101
- }
102
- textFor(key) {
103
- return this.localization.get(key);
108
+ this.hex = parseColor(this.value, 'hex', this.opacity);
104
109
  }
105
110
  toggleFormatView() {
106
111
  this.formatView = this.formatView === 'hex' ? 'rgba' : 'hex';
@@ -112,6 +117,10 @@ let ColorInputComponent = class ColorInputComponent {
112
117
  this.subscriptions.add(this.renderer.listen(this.toggleFormatButton.nativeElement, 'click', () => this.toggleFormatView()));
113
118
  }
114
119
  };
120
+ tslib_1.__decorate([
121
+ Input(),
122
+ tslib_1.__metadata("design:type", String)
123
+ ], ColorInputComponent.prototype, "focusableId", void 0);
115
124
  tslib_1.__decorate([
116
125
  Input(),
117
126
  tslib_1.__metadata("design:type", String)
@@ -142,9 +151,17 @@ tslib_1.__decorate([
142
151
  tslib_1.__metadata("design:type", Boolean)
143
152
  ], ColorInputComponent.prototype, "colorInputClass", void 0);
144
153
  tslib_1.__decorate([
145
- ViewChild('opacityInput', { read: ElementRef, static: false }),
146
- tslib_1.__metadata("design:type", ElementRef)
154
+ ViewChild('opacityInput', { static: false }),
155
+ tslib_1.__metadata("design:type", NumericTextBoxComponent)
147
156
  ], ColorInputComponent.prototype, "opacityInput", void 0);
157
+ tslib_1.__decorate([
158
+ ViewChild('hexInput', { read: ElementRef, static: false }),
159
+ tslib_1.__metadata("design:type", ElementRef)
160
+ ], ColorInputComponent.prototype, "hexInput", void 0);
161
+ tslib_1.__decorate([
162
+ ViewChild('blueInput', { read: ElementRef, static: false }),
163
+ tslib_1.__metadata("design:type", ElementRef)
164
+ ], ColorInputComponent.prototype, "blueInput", void 0);
148
165
  tslib_1.__decorate([
149
166
  ViewChild('toggleFormatButton', { static: false }),
150
167
  tslib_1.__metadata("design:type", ElementRef)
@@ -154,20 +171,27 @@ ColorInputComponent = tslib_1.__decorate([
154
171
  selector: 'kendo-colorinput',
155
172
  template: `
156
173
  <div class="k-vstack">
157
- <button class="k-colorgradient-toggle-mode k-button k-icon-button k-flat" #toggleFormatButton>
174
+ <button #toggleFormatButton
175
+ class="k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button"
176
+ [attr.aria-label]="formatButtonTitle"
177
+ [attr.title]="formatButtonTitle"
178
+ >
158
179
  <span class="k-button-icon k-icon k-i-arrows-kpi"></span>
159
180
  </button>
160
181
  </div>
161
- <input *ngIf="formatView === 'hex'"
162
- #hexInput
163
- class="k-textbox k-hex-value"
164
- [disabled]="disabled"
165
- [readonly]="readonly"
166
- [value]="hex || ''"
167
- [placeholder]="textFor('hexInputPlaceholder')"
168
- (blur)="handleHexInputBlur()"
169
- (input)="handleHexValueChange(hexInput.value)"
170
- />
182
+ <div *ngIf="formatView === 'hex'" class="k-vstack">
183
+ <input
184
+ #hexInput
185
+ [id]="focusableId"
186
+ class="k-textbox k-hex-value"
187
+ [disabled]="disabled"
188
+ [readonly]="readonly"
189
+ [value]="hex || ''"
190
+ (blur)="handleHexInputBlur()"
191
+ (input)="handleHexValueChange(hexInput.value)"
192
+ />
193
+ <label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>
194
+ </div>
171
195
  <ng-container *ngIf="formatView === 'rgba'">
172
196
  <div class="k-vstack">
173
197
  <kendo-numerictextbox
@@ -176,7 +200,6 @@ ColorInputComponent = tslib_1.__decorate([
176
200
  [readonly]="readonly"
177
201
  [min]="0"
178
202
  [max]="255"
179
- [placeholder]="textFor('redInputPlaceholder')"
180
203
  [(value)]="rgba.r"
181
204
  [autoCorrect]="true"
182
205
  [spinners]="false"
@@ -194,7 +217,6 @@ ColorInputComponent = tslib_1.__decorate([
194
217
  [readonly]="readonly"
195
218
  [min]="0"
196
219
  [max]="255"
197
- [placeholder]="textFor('greenInputPlaceholder')"
198
220
  [(value)]="rgba.g"
199
221
  [autoCorrect]="true"
200
222
  [spinners]="false"
@@ -212,7 +234,6 @@ ColorInputComponent = tslib_1.__decorate([
212
234
  [readonly]="readonly"
213
235
  [min]="0"
214
236
  [max]="255"
215
- [placeholder]="textFor('blueInputPlaceholder')"
216
237
  [(value)]="rgba.b"
217
238
  [autoCorrect]="true"
218
239
  [spinners]="false"
@@ -230,7 +251,6 @@ ColorInputComponent = tslib_1.__decorate([
230
251
  [readonly]="readonly"
231
252
  [min]="0"
232
253
  [max]="1"
233
- [placeholder]="textFor('alphaInputPlaceholder')"
234
254
  [(value)]="rgba.a"
235
255
  [autoCorrect]="true"
236
256
  [spinners]="false"
@@ -245,8 +265,8 @@ ColorInputComponent = tslib_1.__decorate([
245
265
  </ng-container>
246
266
  `
247
267
  }),
248
- tslib_1.__metadata("design:paramtypes", [LocalizationService,
249
- ElementRef,
250
- Renderer2])
268
+ tslib_1.__metadata("design:paramtypes", [ElementRef,
269
+ Renderer2,
270
+ LocalizationService])
251
271
  ], ColorInputComponent);
252
272
  export { ColorInputComponent };
@@ -12,7 +12,7 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
12
12
  * The ColorPalette is independently used by `kendo-colorpicker` and can be directly added to the page.
13
13
  */
14
14
  export declare class ColorPaletteComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges, ControlValueAccessor {
15
- private host;
15
+ host: ElementRef;
16
16
  private service;
17
17
  private cdr;
18
18
  private renderer;
@@ -132,6 +132,10 @@ export declare class ColorPaletteComponent implements OnInit, AfterViewInit, OnD
132
132
  * @hidden
133
133
  */
134
134
  focusInComponent: boolean;
135
+ /**
136
+ * @hidden
137
+ */
138
+ uniqueId: string;
135
139
  private selection;
136
140
  private _value;
137
141
  private _columns;
@@ -154,7 +158,7 @@ export declare class ColorPaletteComponent implements OnInit, AfterViewInit, OnD
154
158
  /**
155
159
  * @hidden
156
160
  */
157
- handleCellSelection(value: string, cell?: TableCell): void;
161
+ handleCellSelection(value: string, focusedCell?: TableCell): void;
158
162
  /**
159
163
  * @hidden
160
164
  */
@@ -173,13 +177,14 @@ export declare class ColorPaletteComponent implements OnInit, AfterViewInit, OnD
173
177
  setDisabledState(isDisabled: boolean): void;
174
178
  /**
175
179
  * @hidden
176
- * Used by the TextBoxContainer to determine if the component is empty.
180
+ * Used by the FloatingLabel to determine if the component is empty.
177
181
  */
178
182
  isEmpty(): boolean;
179
183
  /**
180
184
  * Clears the color value of the ColorPalette.
181
185
  */
182
186
  reset(): void;
187
+ private handleValueChange;
183
188
  private handleCellFocusOnBlur;
184
189
  private setRows;
185
190
  private handleCellNavigation;
@@ -6,10 +6,11 @@ import * as tslib_1 from "tslib";
6
6
  var ColorPaletteComponent_1;
7
7
  import { Component, Input, EventEmitter, Output, HostBinding, HostListener, forwardRef, ChangeDetectorRef, Renderer2, ElementRef } from '@angular/core';
8
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
- import { PALETTEPRESETS, parseColor } from './utils';
9
+ import { PALETTEPRESETS } from './models';
10
+ import { parseColor } from './utils';
10
11
  import { isPresent } from '../common/utils';
11
12
  import { ColorPaletteService } from './services/color-palette.service';
12
- import { Keys, KendoInput } from '@progress/kendo-angular-common';
13
+ import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
13
14
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
14
15
  import { ColorPaletteLocalizationService } from './localization/colorpalette-localization.service';
15
16
  const DEFAULT_TILE_SIZE = 24;
@@ -77,6 +78,10 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
77
78
  * @hidden
78
79
  */
79
80
  this.hostClasses = true;
81
+ /**
82
+ * @hidden
83
+ */
84
+ this.uniqueId = guid();
80
85
  this._tabindex = 0;
81
86
  this.notifyNgTouched = () => { };
82
87
  this.notifyNgChanged = () => { };
@@ -127,7 +132,7 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
127
132
  value = PALETTEPRESETS[value].colors;
128
133
  }
129
134
  const colors = (typeof value === 'string') ? value.split(',') : value;
130
- this._palette = colors.map(color => parseColor(color, this.format, false));
135
+ this._palette = colors.map(color => parseColor(color, this.format, false, false));
131
136
  }
132
137
  get palette() {
133
138
  return this._palette;
@@ -230,27 +235,22 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
230
235
  /**
231
236
  * @hidden
232
237
  */
233
- handleCellSelection(value, cell) {
238
+ handleCellSelection(value, focusedCell) {
234
239
  if (this.readonly) {
235
240
  return;
236
241
  }
237
- this.selectedCell = cell;
242
+ this.selectedCell = focusedCell;
238
243
  this.focusedCell = this.selectedCell;
239
244
  this.focusInComponent = true;
240
- const parsedColor = parseColor(value, this.format, false);
245
+ const parsedColor = parseColor(value, this.format, false, false);
241
246
  this.cellSelection.emit(parsedColor);
242
- if (this.value !== parsedColor) {
243
- this.value = parsedColor;
244
- this.valueChange.emit(parsedColor);
245
- this.notifyNgChanged(parsedColor);
246
- this.setHostElementAriaLabel();
247
- }
247
+ this.handleValueChange(parsedColor);
248
248
  if (this.selection !== parsedColor) {
249
249
  this.selection = parsedColor;
250
250
  this.selectionChange.emit(parsedColor);
251
251
  }
252
- if (cell) {
253
- this.activeCellId = `${this.selectedCell.row}-${this.selectedCell.col}`;
252
+ if (focusedCell) {
253
+ this.activeCellId = `k-${this.selectedCell.row}-${this.selectedCell.col}-${this.uniqueId}`;
254
254
  }
255
255
  }
256
256
  /**
@@ -281,7 +281,7 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
281
281
  }
282
282
  /**
283
283
  * @hidden
284
- * Used by the TextBoxContainer to determine if the component is empty.
284
+ * Used by the FloatingLabel to determine if the component is empty.
285
285
  */
286
286
  isEmpty() {
287
287
  return false;
@@ -292,9 +292,18 @@ let ColorPaletteComponent = ColorPaletteComponent_1 = class ColorPaletteComponen
292
292
  reset() {
293
293
  this.focusedCell = null;
294
294
  if (isPresent(this.value)) {
295
- this._value = undefined;
296
- this.notifyNgChanged(undefined);
295
+ this.handleValueChange(undefined);
297
296
  }
297
+ this.selectedCell = undefined;
298
+ }
299
+ handleValueChange(color) {
300
+ if (this.value === color) {
301
+ return;
302
+ }
303
+ this.value = color;
304
+ this.valueChange.emit(color);
305
+ this.notifyNgChanged(color);
306
+ this.setHostElementAriaLabel();
298
307
  }
299
308
  handleCellFocusOnBlur() {
300
309
  this.focusInComponent = false;
@@ -421,6 +430,7 @@ tslib_1.__decorate([
421
430
  ], ColorPaletteComponent.prototype, "handleHostBlur", null);
422
431
  ColorPaletteComponent = ColorPaletteComponent_1 = tslib_1.__decorate([
423
432
  Component({
433
+ exportAs: 'kendoColorPalette',
424
434
  selector: 'kendo-colorpalette',
425
435
  providers: [
426
436
  {
@@ -459,7 +469,7 @@ ColorPaletteComponent = ColorPaletteComponent_1 = tslib_1.__decorate([
459
469
  [attr.aria-selected]="selectedCell?.row === rowIndex && selectedCell?.col === colIndex"
460
470
  [attr.aria-label]="color"
461
471
  class="k-colorpalette-tile"
462
- [id]="rowIndex + '-' + colIndex"
472
+ [id]="'k-' + rowIndex + '-' + colIndex + '-' + uniqueId"
463
473
  [attr.value]="color"
464
474
  (click)="handleCellSelection(color, { row: rowIndex, col: colIndex })"
465
475
  [ngStyle]="{
@@ -2,55 +2,69 @@
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 } 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
- import { PopupSettings, PreventableEvent, PaletteSettings, OutputFormat, ActiveColorClickEvent, ColorPickerView, GradientSettings } from './models';
9
8
  import { LocalizationService } from '@progress/kendo-angular-l10n';
9
+ import { PopupSettings, PaletteSettings, OutputFormat, ColorPickerView, GradientSettings, ColorPickerActionsLayout } from './models';
10
+ import { ActiveColorClickEvent, ColorPickerCancelEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
11
+ import { InputFillMode, InputRounded, InputSize } from '../common/models';
10
12
  /**
11
13
  * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
12
- * Designed to replace the `<input type="color">` HTML5 tag which is not widely supported in browsers.
14
+ *
15
+ * The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
16
+ * which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
13
17
  */
14
- export declare class ColorPickerComponent implements OnDestroy, ControlValueAccessor {
18
+ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor {
19
+ private host;
15
20
  private popupService;
16
21
  private cdr;
17
22
  private localizationService;
18
23
  private ngZone;
24
+ private renderer;
25
+ hostClasses: boolean;
26
+ direction: string;
19
27
  /**
20
28
  * @hidden
21
29
  */
22
- hostClasses: boolean;
30
+ focusableId: string;
23
31
  /**
24
- * @hidden
32
+ * Specifies the views that will be rendered in the popup.
33
+ * By default both the gradient and palette views will be rendered.
25
34
  */
26
- direction: string;
35
+ views: Array<ColorPickerView>;
27
36
  /**
28
37
  * @hidden
29
38
  */
30
- focusableId: string;
39
+ view: ColorPickerView;
31
40
  /**
32
- * Sets what view the ColorPicker will render in the popup.
41
+ * Sets the initially active view in the popup. The property supports two-way binding.
42
+ *
43
+ * The supported values are:
44
+ * * `gradient`
45
+ * * `palette`
33
46
  */
34
- view: ColorPickerView;
47
+ activeView: ColorPickerView;
35
48
  /**
36
49
  * Sets the read-only state of the ColorPicker.
50
+ *
51
+ * @default false
37
52
  */
38
53
  readonly: boolean;
39
54
  /**
40
55
  * Sets the disabled state of the ColorPicker.
56
+ *
57
+ * @default false
41
58
  */
42
59
  disabled: boolean;
43
60
  /**
44
61
  * Specifies the output format of the ColorPicker.
45
- * The input value may be in a different format. However, it will be parsed into the output `format`
46
- * after the component processes it.
47
62
  *
48
- * If the `gradient` view is used with the `opacity` option set to true, this setting will be ignored and `rgba` will be used instead.
63
+ * If the input value is in a different format, it will be parsed into the specified output `format`.
49
64
  *
50
65
  * The supported values are:
51
66
  * * `rgba` (default)
52
67
  * * `hex`
53
- * * [name](https://www.w3.org/wiki/CSS/Properties/color/keywords)
54
68
  */
55
69
  format: OutputFormat;
56
70
  /**
@@ -72,6 +86,7 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
72
86
  /**
73
87
  * Defines the name of an [existing icon in the Kendo UI theme]({% slug icons %}).
74
88
  * Provide only the name of the icon without the `k-icon` or the `k-i-` prefixes.
89
+ *
75
90
  * For example, `edit-tools` will be parsed to `k-icon k-i-edit-tools`.
76
91
  */
77
92
  icon: string;
@@ -84,10 +99,74 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
84
99
  iconClass: string | Array<string> | {
85
100
  [key: string]: boolean;
86
101
  };
102
+ /**
103
+ * Specifies whether the ColorPicker should display a 'Clear color' button.
104
+ *
105
+ * @default true
106
+ */
107
+ clearButton: boolean;
87
108
  /**
88
109
  * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
110
+ *
111
+ * @default 0
89
112
  */
90
113
  tabindex: number;
114
+ /**
115
+ * Displays `Apply` and `Cancel` action buttons and color preview panes.
116
+ *
117
+ * When enabled, the component value will not change immediately upon
118
+ * color selection, but only after the `Apply` button is clicked.
119
+ *
120
+ * The `Cancel` button reverts the current selection to its
121
+ * previous state i.e. to the current value.
122
+ *
123
+ * @default false
124
+ */
125
+ preview: boolean;
126
+ /**
127
+ * Configures the layout of the `Apply` and `Cancel` action buttons.
128
+ *
129
+ * The possible values are:
130
+ * * `start`
131
+ * * `center`
132
+ * * `end` (default)
133
+ * * `stretch`
134
+ */
135
+ actionsLayout: ColorPickerActionsLayout;
136
+ /**
137
+ * The size property specifies the font size and line height of the ColorPicker
138
+ * ([see example]({% slug appearance_colorpicker %}#toc-size)).
139
+ *
140
+ * The possible values are:
141
+ * * `'small'`
142
+ * * `'medium'` (default)
143
+ * * `'large'`
144
+ * * `null`
145
+ */
146
+ size: InputSize;
147
+ /**
148
+ * The rounded property specifies the border radius of the ColorPicker
149
+ * ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
150
+ *
151
+ * The possible values are:
152
+ * * `'small'`
153
+ * * `'medium'` (default)
154
+ * * `'large'`
155
+ * * `'full'`
156
+ * * `null`
157
+ */
158
+ rounded: InputRounded;
159
+ /**
160
+ * The fillMode property specifies the background and border styles of the ColorPicker
161
+ * ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
162
+ *
163
+ * The possible values are:
164
+ * * `'flat'`
165
+ * * `'solid'` (default)
166
+ * * `'outline'`
167
+ * * `null`
168
+ */
169
+ fillMode: InputFillMode;
91
170
  /**
92
171
  * Fires each time the value is changed.
93
172
  */
@@ -96,12 +175,12 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
96
175
  * Fires each time the popup is about to open.
97
176
  * This event is preventable. If you cancel it, the popup will remain closed.
98
177
  */
99
- open: EventEmitter<PreventableEvent>;
178
+ open: EventEmitter<ColorPickerOpenEvent>;
100
179
  /**
101
180
  * Fires each time the popup is about to close.
102
181
  * This event is preventable. If you cancel it, the popup will remain open.
103
182
  */
104
- close: EventEmitter<PreventableEvent>;
183
+ close: EventEmitter<ColorPickerCloseEvent>;
105
184
  /**
106
185
  * Fires each time ColorPicker is focused.
107
186
  */
@@ -110,6 +189,12 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
110
189
  * Fires each time the ColorPicker is blurred.
111
190
  */
112
191
  onBlur: EventEmitter<any>;
192
+ /**
193
+ * Fires when the user cancels the current color selection.
194
+ *
195
+ * Fires on preview pane or 'Cancel' button click.
196
+ */
197
+ cancel: EventEmitter<ColorPickerCancelEvent>;
113
198
  /**
114
199
  * Fires each time the left side of the ColorPicker wrapper is clicked.
115
200
  * The event is triggered regardless of whether a ColorPicker icon is set or not.
@@ -117,6 +202,11 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
117
202
  * The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
118
203
  */
119
204
  activeColorClick: EventEmitter<ActiveColorClickEvent>;
205
+ /**
206
+ * Fires each time the view is about to change.
207
+ * Used to provide a two-way binding for the `activeView` property.
208
+ */
209
+ activeViewChange: EventEmitter<string>;
120
210
  /**
121
211
  * Indicates whether the ColorPicker wrapper is focused.
122
212
  */
@@ -139,23 +229,34 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
139
229
  container: ViewContainerRef;
140
230
  private wrapper;
141
231
  private popupTemplate;
142
- private palette;
143
- private colorGradient;
232
+ private flatColorPicker;
144
233
  private popupRef;
145
234
  private _value;
146
235
  private _tabindex;
147
236
  private _popupSettings;
148
237
  private _paletteSettings;
149
238
  private _gradientSettings;
239
+ private _size;
240
+ private _rounded;
241
+ private _fillMode;
150
242
  private dynamicRTLSubscription;
151
- constructor(popupService: PopupService, cdr: ChangeDetectorRef, localizationService: LocalizationService, ngZone: NgZone);
243
+ constructor(host: ElementRef, popupService: PopupService, cdr: ChangeDetectorRef, localizationService: LocalizationService, ngZone: NgZone, renderer: Renderer2);
152
244
  ngOnInit(): void;
245
+ ngAfterViewInit(): void;
153
246
  ngOnChanges(changes: any): void;
154
247
  ngOnDestroy(): void;
155
248
  /**
156
249
  * @hidden
157
250
  */
158
- handleWrapperClick(): void;
251
+ readonly colorPickerAriaLabel: string;
252
+ /**
253
+ * @hidden
254
+ */
255
+ handleCancelEvent(ev: ColorPickerCancelEvent): void;
256
+ /**
257
+ * @hidden
258
+ */
259
+ togglePopup(): void;
159
260
  /**
160
261
  * @hidden
161
262
  */
@@ -177,7 +278,7 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
177
278
  */
178
279
  handleWrapperBlur(): void;
179
280
  /**
180
- * Clears the color value of the ColorPicker.
281
+ * Clears the value of the ColorPicker.
181
282
  */
182
283
  reset(): void;
183
284
  /**
@@ -190,7 +291,7 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
190
291
  /**
191
292
  * @hidden
192
293
  */
193
- handleValueChange(color: string, closePopup: boolean): void;
294
+ handleValueChange(color: string): void;
194
295
  /**
195
296
  * @hidden
196
297
  */
@@ -221,12 +322,17 @@ export declare class ColorPickerComponent implements OnDestroy, ControlValueAcce
221
322
  handlePopupKeyDown(event: any): void;
222
323
  /**
223
324
  * @hidden
224
- * Used by the TextBoxContainer to determine if the component is empty.
325
+ * Used by the FloatingLabel to determine if the component is empty.
225
326
  */
226
327
  isEmpty(): boolean;
328
+ private handleClasses;
329
+ private popupBlurInvalid;
227
330
  private toggleWithEvents;
331
+ private focusFirstElement;
228
332
  private openPopup;
229
333
  private closePopup;
334
+ private readonly firstFocusableElement;
335
+ private readonly lastFocusableElement;
230
336
  private notifyNgTouched;
231
337
  private notifyNgChanged;
232
338
  }