ngx-tethys 19.0.13 → 19.1.0-next.0

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 (280) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/action/action.component.d.ts +12 -20
  3. package/action/actions.component.d.ts +5 -7
  4. package/affix/affix.component.d.ts +7 -10
  5. package/alert/alert.component.d.ts +1 -1
  6. package/anchor/anchor-link.component.d.ts +8 -8
  7. package/anchor/anchor.component.d.ts +15 -21
  8. package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
  9. package/autocomplete/autocomplete.component.d.ts +10 -17
  10. package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
  11. package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
  12. package/avatar/avatar.component.d.ts +25 -39
  13. package/back-top/back-top.component.d.ts +9 -12
  14. package/badge/badge.component.d.ts +19 -59
  15. package/breadcrumb/breadcrumb.component.d.ts +15 -20
  16. package/button/button-icon.component.d.ts +3 -2
  17. package/button/button.component.d.ts +3 -2
  18. package/calendar/calendar-header.component.d.ts +9 -8
  19. package/calendar/calendar.component.d.ts +16 -16
  20. package/card/card.component.d.ts +5 -11
  21. package/card/content.component.d.ts +3 -8
  22. package/card/header.component.d.ts +7 -8
  23. package/carousel/carousel.component.d.ts +22 -27
  24. package/cascader/cascader-li.component.d.ts +13 -21
  25. package/cascader/cascader-search-option.component.d.ts +8 -16
  26. package/cascader/cascader.component.d.ts +58 -80
  27. package/checkbox/checkbox.component.d.ts +2 -5
  28. package/collapse/collapse-item.component.d.ts +12 -19
  29. package/collapse/collapse.component.d.ts +6 -12
  30. package/collapse/collapse.token.d.ts +3 -3
  31. package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
  32. package/color-picker/color-picker-panel.component.d.ts +7 -11
  33. package/color-picker/color-picker.component.d.ts +19 -35
  34. package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
  35. package/color-picker/parts/hue/hue.component.d.ts +6 -6
  36. package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
  37. package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
  38. package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
  39. package/comment/comment.component.d.ts +4 -5
  40. package/copy/copy.directive.d.ts +8 -9
  41. package/date-picker/abstract-picker.component.d.ts +8 -7
  42. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
  43. package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
  44. package/date-picker/picker.component.d.ts +2 -1
  45. package/date-range/date-range.component.d.ts +2 -2
  46. package/dialog/body/dialog-body.component.d.ts +2 -6
  47. package/dialog/confirm/confirm.component.d.ts +2 -2
  48. package/dialog/footer/dialog-footer.component.d.ts +6 -9
  49. package/dialog/header/dialog-header.component.d.ts +9 -11
  50. package/divider/divider.component.d.ts +12 -16
  51. package/dot/dot.component.d.ts +5 -13
  52. package/drag-drop/drag-handle.directive.d.ts +2 -1
  53. package/drag-drop/drag.directive.d.ts +2 -1
  54. package/drag-drop/drop-container.directive.d.ts +2 -1
  55. package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
  56. package/dropdown/dropdown-menu.component.d.ts +2 -1
  57. package/dropdown/dropdown.directive.d.ts +2 -1
  58. package/empty/empty.component.d.ts +21 -27
  59. package/fesm2022/ngx-tethys-action.mjs +54 -91
  60. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-affix.mjs +29 -26
  62. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-anchor.mjs +91 -118
  64. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
  66. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
  68. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-avatar.mjs +117 -162
  70. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-back-top.mjs +33 -46
  72. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-badge.mjs +104 -208
  74. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
  76. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-calendar.mjs +85 -87
  78. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-card.mjs +72 -77
  80. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-carousel.mjs +82 -99
  82. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-cascader.mjs +313 -468
  84. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
  86. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-collapse.mjs +66 -71
  88. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  89. package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
  90. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  91. package/fesm2022/ngx-tethys-comment.mjs +16 -10
  92. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  93. package/fesm2022/ngx-tethys-copy.mjs +25 -28
  94. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  95. package/fesm2022/ngx-tethys-dialog.mjs +81 -82
  96. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  97. package/fesm2022/ngx-tethys-divider.mjs +49 -58
  98. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  99. package/fesm2022/ngx-tethys-dot.mjs +45 -68
  100. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-empty.mjs +107 -95
  102. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-form.mjs +161 -200
  104. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
  106. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  107. package/fesm2022/ngx-tethys-grid.mjs +160 -152
  108. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  109. package/fesm2022/ngx-tethys-i18n.mjs +25 -25
  110. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  111. package/fesm2022/ngx-tethys-input-number.mjs +101 -114
  112. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  113. package/fesm2022/ngx-tethys-input.mjs +268 -271
  114. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  115. package/fesm2022/ngx-tethys-list.mjs +1 -1
  116. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-loading.mjs +17 -35
  118. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-mention.mjs +52 -74
  120. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  121. package/fesm2022/ngx-tethys-menu.mjs +106 -179
  122. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  123. package/fesm2022/ngx-tethys-nav.mjs +169 -201
  124. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  125. package/fesm2022/ngx-tethys-pagination.mjs +230 -294
  126. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  127. package/fesm2022/ngx-tethys-popover.mjs +67 -70
  128. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  129. package/fesm2022/ngx-tethys-progress.mjs +196 -244
  130. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  131. package/fesm2022/ngx-tethys-property.mjs +102 -105
  132. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-radio.mjs +34 -38
  134. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-result.mjs +46 -28
  136. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
  138. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-slider.mjs +75 -108
  140. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-space.mjs +26 -46
  142. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-statistic.mjs +114 -151
  144. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys-stepper.mjs +74 -107
  146. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  147. package/fesm2022/ngx-tethys-switch.mjs +80 -140
  148. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  149. package/fesm2022/ngx-tethys-table.mjs +1 -1
  150. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  151. package/fesm2022/ngx-tethys-tabs.mjs +69 -87
  152. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  153. package/fesm2022/ngx-tethys-tag.mjs +42 -64
  154. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  155. package/fesm2022/ngx-tethys-timeline.mjs +104 -129
  156. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  157. package/fesm2022/ngx-tethys-typography.mjs +36 -33
  158. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  159. package/fesm2022/ngx-tethys-upload.mjs +91 -130
  160. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  161. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  162. package/fesm2022/ngx-tethys-watermark.mjs +36 -40
  163. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  164. package/fesm2022/ngx-tethys.mjs +1 -1
  165. package/fesm2022/ngx-tethys.mjs.map +1 -1
  166. package/form/form-group-error/form-group-error.component.d.ts +2 -3
  167. package/form/form-group-label.directive.d.ts +2 -1
  168. package/form/form-group.component.d.ts +17 -24
  169. package/form/form-submit.directive.d.ts +2 -2
  170. package/form/form.directive.d.ts +6 -8
  171. package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
  172. package/form/validator/confirm-validator.directive.d.ts +2 -2
  173. package/form/validator/unique-validator.directive.d.ts +2 -2
  174. package/fullscreen/fullscreen.component.d.ts +7 -7
  175. package/grid/flex.d.ts +14 -19
  176. package/grid/thy-col.directive.d.ts +6 -9
  177. package/grid/thy-grid-item.component.d.ts +3 -4
  178. package/grid/thy-grid.component.d.ts +11 -12
  179. package/grid/thy-row.directive.d.ts +12 -12
  180. package/icon/icon.component.d.ts +3 -2
  181. package/image/image.directive.d.ts +3 -2
  182. package/input/input-count.component.d.ts +4 -5
  183. package/input/input-group.component.d.ts +20 -20
  184. package/input/input-search.component.d.ts +15 -20
  185. package/input/input.component.d.ts +20 -21
  186. package/input/input.directive.d.ts +4 -6
  187. package/input-number/input-number.component.d.ts +21 -29
  188. package/layout/header.component.d.ts +4 -9
  189. package/layout/sidebar-header.component.d.ts +2 -1
  190. package/layout/sidebar.component.d.ts +8 -7
  191. package/list/list.component.d.ts +2 -1
  192. package/list/selection/selection-list.d.ts +4 -3
  193. package/loading/loading.component.d.ts +4 -10
  194. package/mention/mention.directive.d.ts +6 -7
  195. package/mention/suggestions/suggestions.component.d.ts +8 -9
  196. package/menu/group/menu-group.component.d.ts +16 -33
  197. package/menu/item/action/menu-item-action.component.d.ts +7 -8
  198. package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
  199. package/menu/item/menu-item.component.d.ts +4 -4
  200. package/menu/item/name/menu-item-name.component.d.ts +2 -3
  201. package/menu/menu.component.d.ts +3 -7
  202. package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
  203. package/nav/icon-nav/icon-nav.component.d.ts +3 -8
  204. package/nav/nav-ink-bar.directive.d.ts +4 -6
  205. package/nav/nav-item.directive.d.ts +7 -10
  206. package/nav/nav.component.d.ts +20 -48
  207. package/package.json +1 -1
  208. package/pagination/pagination.component.d.ts +48 -109
  209. package/popover/header/popover-header.component.d.ts +7 -6
  210. package/popover/popover.directive.d.ts +11 -18
  211. package/progress/progress-circle.component.d.ts +32 -21
  212. package/progress/progress-strip.component.d.ts +10 -14
  213. package/progress/progress.component.d.ts +15 -23
  214. package/property/examples/single/single.component.scss +6 -0
  215. package/property/properties.component.d.ts +6 -13
  216. package/property/property-item.component.d.ts +21 -26
  217. package/property/styles/properties.scss +124 -52
  218. package/property-operation/property-operation.component.d.ts +6 -5
  219. package/radio/button/radio-button.component.d.ts +2 -2
  220. package/radio/group/radio-group.component.d.ts +8 -7
  221. package/radio/radio.component.d.ts +2 -2
  222. package/radio/radio.token.d.ts +2 -2
  223. package/rate/rate-item.component.d.ts +2 -1
  224. package/rate/rate.component.d.ts +4 -3
  225. package/resizable/resizable.directive.d.ts +4 -9
  226. package/resizable/resize-handle.component.d.ts +2 -1
  227. package/resizable/resize-handles.component.d.ts +2 -1
  228. package/result/result.component.d.ts +9 -10
  229. package/schematics/version.d.ts +1 -1
  230. package/schematics/version.js +1 -1
  231. package/segment/segment-item.component.d.ts +2 -1
  232. package/segment/segment.component.d.ts +2 -1
  233. package/select/custom-select/custom-select.component.d.ts +11 -10
  234. package/select/native-select/native-select.component.d.ts +2 -1
  235. package/shared/base-form-check.component.d.ts +3 -2
  236. package/shared/directives/thy-autofocus.directive.d.ts +3 -2
  237. package/shared/directives/thy-scroll.directive.d.ts +2 -1
  238. package/shared/directives/thy-show.d.ts +2 -1
  239. package/shared/option/group/option-group.component.d.ts +2 -1
  240. package/shared/option/list-option/list-option.component.d.ts +2 -7
  241. package/shared/option/option.component.d.ts +2 -1
  242. package/shared/select/select-control/select-control.component.d.ts +7 -6
  243. package/skeleton/skeleton-circle.component.d.ts +16 -19
  244. package/skeleton/skeleton-rectangle.component.d.ts +20 -23
  245. package/skeleton/skeleton.component.d.ts +5 -6
  246. package/skeleton/stylized/bullet-list.component.d.ts +11 -13
  247. package/skeleton/stylized/list.component.d.ts +10 -12
  248. package/skeleton/stylized/paragraph.component.d.ts +12 -14
  249. package/slide/slide-body/slide-body-section.component.d.ts +2 -1
  250. package/slider/slider.component.d.ts +17 -24
  251. package/space/space.component.d.ts +8 -8
  252. package/statistic/statistic.component.d.ts +35 -40
  253. package/stepper/step-header.component.d.ts +6 -10
  254. package/stepper/step.component.d.ts +6 -6
  255. package/stepper/stepper.component.d.ts +15 -20
  256. package/switch/switch.component.d.ts +24 -35
  257. package/table/table-column.component.d.ts +6 -5
  258. package/table/table-skeleton.component.d.ts +3 -10
  259. package/table/table.component.d.ts +11 -10
  260. package/tabs/tab-content.component.d.ts +4 -4
  261. package/tabs/tab.component.d.ts +4 -5
  262. package/tabs/tabs.component.d.ts +13 -15
  263. package/tag/tag.component.d.ts +10 -16
  264. package/time-picker/time-picker-panel.component.d.ts +3 -2
  265. package/time-picker/time-picker.component.d.ts +6 -5
  266. package/timeline/timeline-item.component.d.ts +9 -13
  267. package/timeline/timeline.component.d.ts +13 -17
  268. package/tooltip/tooltip.directive.d.ts +3 -2
  269. package/tree/tree-node.component.d.ts +6 -15
  270. package/tree/tree.component.d.ts +8 -7
  271. package/tree-select/tree-select.component.d.ts +8 -7
  272. package/typography/bg-color.directive.d.ts +3 -3
  273. package/typography/text/text.component.d.ts +2 -2
  274. package/typography/text-color.directive.d.ts +3 -3
  275. package/upload/file-drop.directive.d.ts +9 -11
  276. package/upload/file-select-base.d.ts +6 -10
  277. package/upload/file-select.component.d.ts +10 -20
  278. package/util/helpers/helpers.d.ts +2 -1
  279. package/vote/vote.component.d.ts +4 -3
  280. package/watermark/watermark.directive.d.ts +7 -9
@@ -1,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Output, Input, HostBinding, Component, inject, ElementRef, HostListener, Directive, Renderer2, ViewChild, ChangeDetectionStrategy, ViewContainerRef, NgZone, forwardRef, numberAttribute, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, HostListener, Output, Directive, Renderer2, input, viewChild, output, effect, HostBinding, ChangeDetectionStrategy, Component, ViewChild, computed, signal, model, ViewContainerRef, NgZone, numberAttribute, forwardRef, Input, NgModule } from '@angular/core';
3
+ import { Subject, fromEvent } from 'rxjs';
4
+ import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
3
5
  import * as i1 from '@angular/forms';
4
6
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
7
  import { ThyInputDirective, ThyInputGroup, ThyInputModule } from 'ngx-tethys/input';
6
8
  import { ThyInputNumber, ThyInputNumberModule } from 'ngx-tethys/input-number';
7
9
  import { ThyEnterDirective, ThySharedModule } from 'ngx-tethys/shared';
8
- import { Subject, fromEvent } from 'rxjs';
9
- import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
10
- import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
11
- import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
12
10
  import { NgClass, NgTemplateOutlet, NgStyle, CommonModule } from '@angular/common';
13
- import { coerceBooleanProperty } from 'ngx-tethys/util';
14
11
  import { injectLocale } from 'ngx-tethys/i18n';
12
+ import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
13
+ import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
14
+ import { coerceBooleanProperty } from 'ngx-tethys/util';
15
15
  import { FocusMonitor } from '@angular/cdk/a11y';
16
16
  import { Platform } from '@angular/cdk/platform';
17
17
  import { ThyOverlayDirectiveBase, mixinTabIndex, mixinDisabled } from 'ngx-tethys/core';
@@ -484,82 +484,6 @@ class ThyColor {
484
484
  }
485
485
  }
486
486
 
487
- /**
488
- * @internal
489
- */
490
- class ThyColorInputs {
491
- constructor() {
492
- this.className = true;
493
- this.colorChange = new EventEmitter(false);
494
- }
495
- set color(value) {
496
- this.alpha = Math.round(value.rgba.alpha * 100);
497
- this.innerColor = value;
498
- this.hex = this.innerColor.toHexString(false).slice(1, 7);
499
- }
500
- get color() {
501
- return this.innerColor;
502
- }
503
- onInputChange(event, type) {
504
- let newColor;
505
- const alpha = this.alpha / 100;
506
- if (type === 'hex') {
507
- let finalDisplayValue = this.hex;
508
- if (this.hex.length === 3) {
509
- finalDisplayValue = this.hex
510
- .split('')
511
- .map(value => value + value)
512
- .join('');
513
- }
514
- finalDisplayValue = `#${finalDisplayValue}`;
515
- if (alpha !== 1) {
516
- finalDisplayValue += ((1 << 8) | Math.round(alpha * 255)).toString(16).substr(1);
517
- }
518
- newColor = new ThyColor(finalDisplayValue);
519
- }
520
- else {
521
- newColor = new ThyColor().setRgba(this.innerColor.rgba.red, this.innerColor.rgba.green, this.innerColor.rgba.blue, alpha);
522
- }
523
- this.colorChange.emit(newColor);
524
- }
525
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorInputs, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
526
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyColorInputs, isStandalone: true, selector: "thy-color-inputs", inputs: { color: "color" }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-color-inputs": "this.className" } }, ngImport: i0, template: "<div class=\"hex-column\">\n <thy-input-group class=\"hex-input-group\">\n <ng-template #prefix>\n <span>#</span>\n </ng-template>\n <input\n class=\"px-0 form-control-xs\"\n thyInput\n [(ngModel)]=\"hex\"\n maxlength=\"6\"\n (blur)=\"onInputChange($event, 'hex')\"\n (thyEnter)=\"onInputChange($event, 'hex')\" />\n </thy-input-group>\n <span>HEX</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.red\"\n (thyBlur)=\"onInputChange($event, 'R')\"\n (thyEnter)=\"onInputChange($event, 'R')\"></thy-input-number>\n <span>R</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.green\"\n (thyBlur)=\"onInputChange($event, 'G')\"\n (thyEnter)=\"onInputChange($event, 'G')\"></thy-input-number>\n <span>G</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.blue\"\n (thyBlur)=\"onInputChange($event, 'B')\"\n (thyEnter)=\"onInputChange($event, 'B')\"></thy-input-number>\n <span>B</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n [thyMin]=\"0\"\n [thyMax]=\"100\"\n thySize=\"xs\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"alpha\"\n (thyBlur)=\"onInputChange($event, 'A')\"\n (thyEnter)=\"onInputChange($event, 'A')\"></thy-input-number>\n <span>A</span>\n</div>\n", dependencies: [{ kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }, { kind: "component", type: ThyInputNumber, selector: "thy-input-number", inputs: ["thyAutoFocus", "thyPlaceholder", "thyDisabled", "thyMax", "thyMin", "thyStep", "thyStepDelay", "thySize", "thyPrecision", "thySuffix"], outputs: ["thyBlur", "thyFocus", "thyStepChange"] }, { kind: "component", type: ThyInputGroup, selector: "thy-input-group", inputs: ["thyAppendText", "thyAppendTextTranslateKey", "thyPrependText", "thyPrependTextTranslateKey", "thySize"] }] }); }
527
- }
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorInputs, decorators: [{
529
- type: Component,
530
- args: [{ selector: 'thy-color-inputs', imports: [ThyInputDirective, FormsModule, ThyEnterDirective, ThyInputNumber, ThyInputGroup], template: "<div class=\"hex-column\">\n <thy-input-group class=\"hex-input-group\">\n <ng-template #prefix>\n <span>#</span>\n </ng-template>\n <input\n class=\"px-0 form-control-xs\"\n thyInput\n [(ngModel)]=\"hex\"\n maxlength=\"6\"\n (blur)=\"onInputChange($event, 'hex')\"\n (thyEnter)=\"onInputChange($event, 'hex')\" />\n </thy-input-group>\n <span>HEX</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.red\"\n (thyBlur)=\"onInputChange($event, 'R')\"\n (thyEnter)=\"onInputChange($event, 'R')\"></thy-input-number>\n <span>R</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.green\"\n (thyBlur)=\"onInputChange($event, 'G')\"\n (thyEnter)=\"onInputChange($event, 'G')\"></thy-input-number>\n <span>G</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color.rgba.blue\"\n (thyBlur)=\"onInputChange($event, 'B')\"\n (thyEnter)=\"onInputChange($event, 'B')\"></thy-input-number>\n <span>B</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n [thyMin]=\"0\"\n [thyMax]=\"100\"\n thySize=\"xs\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"alpha\"\n (thyBlur)=\"onInputChange($event, 'A')\"\n (thyEnter)=\"onInputChange($event, 'A')\"></thy-input-number>\n <span>A</span>\n</div>\n" }]
531
- }], propDecorators: { className: [{
532
- type: HostBinding,
533
- args: ['class.thy-color-inputs']
534
- }], color: [{
535
- type: Input
536
- }], colorChange: [{
537
- type: Output
538
- }] } });
539
-
540
- /**
541
- * @internal
542
- */
543
- class ThyIndicator {
544
- constructor() {
545
- this.className = true;
546
- }
547
- get backgroundColor() {
548
- return this.color.rgba.toString();
549
- }
550
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
551
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyIndicator, isStandalone: true, selector: "thy-indicator", inputs: { color: "color" }, host: { properties: { "class.thy-indicator": "this.className" } }, ngImport: i0, template: "<div [style.backgroundColor]=\"backgroundColor\" class=\"icon-container\"></div>\n" }); }
552
- }
553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIndicator, decorators: [{
554
- type: Component,
555
- args: [{ selector: 'thy-indicator', template: "<div [style.backgroundColor]=\"backgroundColor\" class=\"icon-container\"></div>\n" }]
556
- }], propDecorators: { className: [{
557
- type: HostBinding,
558
- args: ['class.thy-indicator']
559
- }], color: [{
560
- type: Input
561
- }] } });
562
-
563
487
  /**
564
488
  * @internal
565
489
  */
@@ -635,23 +559,24 @@ class ThyAlpha {
635
559
  constructor() {
636
560
  this.renderer = inject(Renderer2);
637
561
  this.className = true;
638
- this.colorChange = new EventEmitter(false);
562
+ this.color = input();
563
+ this.pointer = viewChild('pointer');
564
+ this.gradient = viewChild('gradient');
565
+ this.colorChange = output();
566
+ effect(() => {
567
+ this.setBackground();
568
+ this.changePointerPosition();
569
+ });
639
570
  }
640
571
  setBackground() {
641
- this.renderer.setStyle(this.gradient.nativeElement, 'background', `linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(${this.color.rgba.red},
642
- ${this.color.rgba.green},
643
- ${this.color.rgba.blue},
572
+ this.renderer.setStyle(this.gradient().nativeElement, 'background', `linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(${this.color().rgba.red},
573
+ ${this.color().rgba.green},
574
+ ${this.color().rgba.blue},
644
575
  1) 100%)`);
645
576
  }
646
- ngOnChanges(changes) {
647
- if (changes.color && changes.color.previousValue !== changes.color.currentValue) {
648
- this.setBackground();
649
- this.changePointerPosition(this.color.alpha);
650
- }
651
- }
652
577
  changePointerPosition(alpha) {
653
- const x = alpha * 100;
654
- this.renderer.setStyle(this.pointer.nativeElement, 'left', `${x}%`);
578
+ const x = (alpha ?? this.color().alpha) * 100;
579
+ this.renderer.setStyle(this.pointer().nativeElement, 'left', `${x}%`);
655
580
  }
656
581
  handleChange(event) {
657
582
  let x;
@@ -665,27 +590,17 @@ class ThyAlpha {
665
590
  x = Math.round((event.left * 100) / event.containerWidth) / 100;
666
591
  }
667
592
  this.changePointerPosition(x);
668
- this.colorChange.emit(new ThyColor({ h: this.color.hue, s: this.color.saturation, v: this.color.value, alpha: x }));
593
+ this.colorChange.emit(new ThyColor({ h: this.color().hue, s: this.color().saturation, v: this.color().value, alpha: x }));
669
594
  }
670
595
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyAlpha, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
671
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyAlpha, isStandalone: true, selector: "thy-alpha", inputs: { color: "color" }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-alpha": "this.className" } }, viewQueries: [{ propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, static: true }, { propertyName: "gradient", first: true, predicate: ["gradient"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"gradient-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"gradient-color\" #gradient>\n <div class=\"pointer-container\">\n <div class=\"pointer\" #pointer></div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
596
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: ThyAlpha, isStandalone: true, selector: "thy-alpha", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-alpha": "this.className" } }, viewQueries: [{ propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, isSignal: true }, { propertyName: "gradient", first: true, predicate: ["gradient"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"gradient-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"gradient-color\" #gradient>\n <div class=\"pointer-container\">\n <div class=\"pointer\" #pointer></div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
672
597
  }
673
598
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyAlpha, decorators: [{
674
599
  type: Component,
675
600
  args: [{ selector: 'thy-alpha', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyCoordinatesDirective], template: "<div class=\"gradient-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"gradient-color\" #gradient>\n <div class=\"pointer-container\">\n <div class=\"pointer\" #pointer></div>\n </div>\n </div>\n</div>\n" }]
676
- }], propDecorators: { className: [{
601
+ }], ctorParameters: () => [], propDecorators: { className: [{
677
602
  type: HostBinding,
678
603
  args: ['class.thy-alpha']
679
- }], color: [{
680
- type: Input
681
- }], pointer: [{
682
- type: ViewChild,
683
- args: ['pointer', { static: true }]
684
- }], gradient: [{
685
- type: ViewChild,
686
- args: ['gradient', { static: true }]
687
- }], colorChange: [{
688
- type: Output
689
604
  }] } });
690
605
 
691
606
  /**
@@ -695,15 +610,15 @@ class ThyHue {
695
610
  constructor() {
696
611
  this.renderer = inject(Renderer2);
697
612
  this.className = true;
698
- this.colorChange = new EventEmitter(false);
699
- }
700
- ngOnChanges(changes) {
701
- if (changes.color && changes.color.previousValue !== changes.color.currentValue) {
702
- this.changePointerPosition(this.color.hue);
703
- }
613
+ this.color = input();
614
+ this.colorChange = output();
615
+ effect(() => {
616
+ this.changePointerPosition();
617
+ });
704
618
  }
705
619
  changePointerPosition(hue) {
706
- const x = (hue / 360) * 100;
620
+ const newHue = hue ?? this.color().hue;
621
+ const x = (newHue / 360) * 100;
707
622
  this.renderer.setStyle(this.pointer.nativeElement, 'left', `${x}%`);
708
623
  }
709
624
  handleChange(event) {
@@ -718,26 +633,93 @@ class ThyHue {
718
633
  x = Math.round((event.left * 100) / event.containerWidth) / 100;
719
634
  }
720
635
  this.changePointerPosition(x * 360);
721
- this.colorChange.emit(new ThyColor({ h: x * 360, s: this.color.saturation, v: this.color.value, alpha: this.color.alpha }));
636
+ this.colorChange.emit(new ThyColor({ h: x * 360, s: this.color().saturation, v: this.color().value, alpha: this.color().alpha }));
722
637
  }
723
638
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHue, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
724
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyHue, isStandalone: true, selector: "thy-hue", inputs: { color: "color" }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-hue": "this.className" } }, viewQueries: [{ propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"hue-contianer\">\n <div class=\"pointer-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"pointer\" #pointer></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
639
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyHue, isStandalone: true, selector: "thy-hue", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-hue": "this.className" } }, viewQueries: [{ propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"hue-contianer\">\n <div class=\"pointer-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"pointer\" #pointer></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
725
640
  }
726
641
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHue, decorators: [{
727
642
  type: Component,
728
643
  args: [{ selector: 'thy-hue', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyCoordinatesDirective], template: "<div class=\"hue-contianer\">\n <div class=\"pointer-container\" thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"pointer\" #pointer></div>\n </div>\n</div>\n" }]
729
- }], propDecorators: { className: [{
644
+ }], ctorParameters: () => [], propDecorators: { className: [{
730
645
  type: HostBinding,
731
646
  args: ['class.thy-hue']
732
- }], color: [{
733
- type: Input
734
- }], colorChange: [{
735
- type: Output
736
647
  }], pointer: [{
737
648
  type: ViewChild,
738
649
  args: ['pointer', { static: true }]
739
650
  }] } });
740
651
 
652
+ /**
653
+ * @internal
654
+ */
655
+ class ThyIndicator {
656
+ constructor() {
657
+ this.className = true;
658
+ this.color = input();
659
+ this.backgroundColor = computed(() => {
660
+ return this.color()?.rgba.toString() || '';
661
+ });
662
+ }
663
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
664
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyIndicator, isStandalone: true, selector: "thy-indicator", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-indicator": "this.className" } }, ngImport: i0, template: "<div [style.backgroundColor]=\"backgroundColor()\" class=\"icon-container\"></div>\n" }); }
665
+ }
666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIndicator, decorators: [{
667
+ type: Component,
668
+ args: [{ selector: 'thy-indicator', template: "<div [style.backgroundColor]=\"backgroundColor()\" class=\"icon-container\"></div>\n" }]
669
+ }], propDecorators: { className: [{
670
+ type: HostBinding,
671
+ args: ['class.thy-indicator']
672
+ }] } });
673
+
674
+ /**
675
+ * @internal
676
+ */
677
+ class ThyColorInputs {
678
+ constructor() {
679
+ this.className = true;
680
+ this.color = input();
681
+ this.colorChange = output();
682
+ this.hex = signal('');
683
+ this.alpha = signal(100);
684
+ effect(() => {
685
+ this.hex.set(this.color()?.toHexString(false).slice(1, 7) || '');
686
+ this.alpha.set(Math.round(this.color()?.rgba.alpha * 100) || 100);
687
+ });
688
+ }
689
+ ngOnInit() { }
690
+ onInputChange(event, type) {
691
+ let newColor;
692
+ const alpha = this.alpha() / 100;
693
+ if (type === 'hex') {
694
+ let finalDisplayValue = this.hex();
695
+ if (this.hex().length === 3) {
696
+ finalDisplayValue = this.hex()
697
+ .split('')
698
+ .map(value => value + value)
699
+ .join('');
700
+ }
701
+ finalDisplayValue = `#${finalDisplayValue}`;
702
+ if (alpha !== 1) {
703
+ finalDisplayValue += ((1 << 8) | Math.round(alpha * 255)).toString(16).substr(1);
704
+ }
705
+ newColor = new ThyColor(finalDisplayValue);
706
+ }
707
+ else {
708
+ newColor = new ThyColor().setRgba(this.color().rgba.red, this.color().rgba.green, this.color().rgba.blue, alpha);
709
+ }
710
+ this.colorChange.emit(newColor);
711
+ }
712
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorInputs, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
713
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyColorInputs, isStandalone: true, selector: "thy-color-inputs", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-color-inputs": "this.className" } }, ngImport: i0, template: "<div class=\"hex-column\">\n <thy-input-group class=\"hex-input-group\">\n <ng-template #prefix>\n <span>#</span>\n </ng-template>\n <input\n class=\"px-0 form-control-xs\"\n thyInput\n [(ngModel)]=\"hex\"\n maxlength=\"6\"\n (blur)=\"onInputChange($event, 'hex')\"\n (thyEnter)=\"onInputChange($event, 'hex')\" />\n </thy-input-group>\n <span>HEX</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.red\"\n (thyBlur)=\"onInputChange($event, 'R')\"\n (thyEnter)=\"onInputChange($event, 'R')\"></thy-input-number>\n <span>R</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.green\"\n (thyBlur)=\"onInputChange($event, 'G')\"\n (thyEnter)=\"onInputChange($event, 'G')\"></thy-input-number>\n <span>G</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.blue\"\n (thyBlur)=\"onInputChange($event, 'B')\"\n (thyEnter)=\"onInputChange($event, 'B')\"></thy-input-number>\n <span>B</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n [thyMin]=\"0\"\n [thyMax]=\"100\"\n thySize=\"xs\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"alpha\"\n (thyBlur)=\"onInputChange($event, 'A')\"\n (thyEnter)=\"onInputChange($event, 'A')\"></thy-input-number>\n <span>A</span>\n</div>\n", dependencies: [{ kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }, { kind: "component", type: ThyInputNumber, selector: "thy-input-number", inputs: ["thyAutoFocus", "thyPlaceholder", "thyDisabled", "thyMax", "thyMin", "thyStep", "thyStepDelay", "thySize", "thyPrecision", "thySuffix"], outputs: ["thyBlur", "thyFocus", "thyStepChange"] }, { kind: "component", type: ThyInputGroup, selector: "thy-input-group", inputs: ["thyAppendText", "thyAppendTextTranslateKey", "thyPrependText", "thyPrependTextTranslateKey", "thySize"] }] }); }
714
+ }
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorInputs, decorators: [{
716
+ type: Component,
717
+ args: [{ selector: 'thy-color-inputs', imports: [ThyInputDirective, FormsModule, ThyEnterDirective, ThyInputNumber, ThyInputGroup], template: "<div class=\"hex-column\">\n <thy-input-group class=\"hex-input-group\">\n <ng-template #prefix>\n <span>#</span>\n </ng-template>\n <input\n class=\"px-0 form-control-xs\"\n thyInput\n [(ngModel)]=\"hex\"\n maxlength=\"6\"\n (blur)=\"onInputChange($event, 'hex')\"\n (thyEnter)=\"onInputChange($event, 'hex')\" />\n </thy-input-group>\n <span>HEX</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.red\"\n (thyBlur)=\"onInputChange($event, 'R')\"\n (thyEnter)=\"onInputChange($event, 'R')\"></thy-input-number>\n <span>R</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.green\"\n (thyBlur)=\"onInputChange($event, 'G')\"\n (thyEnter)=\"onInputChange($event, 'G')\"></thy-input-number>\n <span>G</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n thySize=\"xs\"\n [thyMin]=\"0\"\n [thyMax]=\"255\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"color().rgba.blue\"\n (thyBlur)=\"onInputChange($event, 'B')\"\n (thyEnter)=\"onInputChange($event, 'B')\"></thy-input-number>\n <span>B</span>\n</div>\n<div class=\"column\">\n <thy-input-number\n [thyMin]=\"0\"\n [thyMax]=\"100\"\n thySize=\"xs\"\n class=\"px-0 text-center\"\n [(ngModel)]=\"alpha\"\n (thyBlur)=\"onInputChange($event, 'A')\"\n (thyEnter)=\"onInputChange($event, 'A')\"></thy-input-number>\n <span>A</span>\n</div>\n" }]
718
+ }], ctorParameters: () => [], propDecorators: { className: [{
719
+ type: HostBinding,
720
+ args: ['class.thy-color-inputs']
721
+ }] } });
722
+
741
723
  /**
742
724
  * @internal
743
725
  */
@@ -745,20 +727,24 @@ class ThySaturation {
745
727
  constructor() {
746
728
  this.renderer = inject(Renderer2);
747
729
  this.className = true;
748
- this.colorChange = new EventEmitter(false);
749
- }
750
- ngOnChanges(changes) {
751
- if (changes.color && changes.color.previousValue !== changes.color.currentValue) {
730
+ this.panel = viewChild('panel');
731
+ this.pointer = viewChild('pointer');
732
+ this.colorChange = output();
733
+ this.color = input();
734
+ effect(() => {
752
735
  this.setBackground();
753
- this.changePointerPosition(this.color.saturation, this.color.value);
754
- }
736
+ this.changePointerPosition();
737
+ });
755
738
  }
756
739
  setBackground() {
757
- this.renderer.setStyle(this.panel.nativeElement, 'background', `hsl(${this.color.hue},100%,50%)`);
740
+ this.renderer.setStyle(this.panel().nativeElement, 'background', `hsl(${this.color().hue},100%,50%)`);
758
741
  }
759
742
  changePointerPosition(s, v) {
760
- this.renderer.setStyle(this.pointer.nativeElement, 'left', `${s}%`);
761
- this.renderer.setStyle(this.pointer.nativeElement, 'top', `${100 - v}%`);
743
+ const saturation = s ?? this.color().saturation;
744
+ const value = v ?? this.color().value;
745
+ const pointer = this.pointer();
746
+ this.renderer.setStyle(pointer.nativeElement, 'left', `${saturation}%`);
747
+ this.renderer.setStyle(pointer.nativeElement, 'top', `${100 - value}%`);
762
748
  }
763
749
  handleChange(event) {
764
750
  let x = event.left, y = event.top;
@@ -779,27 +765,17 @@ class ThySaturation {
779
765
  v = v > 0 ? v : 0;
780
766
  v = v > 1 ? 1 : v;
781
767
  this.changePointerPosition(s * 100, v * 100);
782
- this.colorChange.emit(new ThyColor({ h: this.color.hue, s: s * 100, v: v * 100, alpha: this.color.alpha }));
768
+ this.colorChange.emit(new ThyColor({ h: this.color().hue, s: s * 100, v: v * 100, alpha: this.color().alpha }));
783
769
  }
784
770
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySaturation, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
785
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThySaturation, isStandalone: true, selector: "thy-saturation", inputs: { color: "color" }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-saturation": "this.className" } }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, static: true }, { propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"color-panel\" #panel thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"color-panel-white\"></div>\n <div class=\"color-panel-black\"></div>\n <div class=\"color-panel-pointer\" #pointer></div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }] }); }
771
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: ThySaturation, isStandalone: true, selector: "thy-saturation", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChange: "colorChange" }, host: { properties: { "class.thy-saturation": "this.className" } }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "pointer", first: true, predicate: ["pointer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"color-panel\" #panel thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"color-panel-white\"></div>\n <div class=\"color-panel-black\"></div>\n <div class=\"color-panel-pointer\" #pointer></div>\n</div>\n", dependencies: [{ kind: "directive", type: ThyCoordinatesDirective, selector: "[thyColorCoordinates]", outputs: ["coordinatesChange"] }] }); }
786
772
  }
787
773
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySaturation, decorators: [{
788
774
  type: Component,
789
775
  args: [{ selector: 'thy-saturation', imports: [ThyCoordinatesDirective], template: "<div class=\"color-panel\" #panel thyColorCoordinates (coordinatesChange)=\"handleChange($event)\">\n <div class=\"color-panel-white\"></div>\n <div class=\"color-panel-black\"></div>\n <div class=\"color-panel-pointer\" #pointer></div>\n</div>\n" }]
790
- }], propDecorators: { className: [{
776
+ }], ctorParameters: () => [], propDecorators: { className: [{
791
777
  type: HostBinding,
792
778
  args: ['class.thy-saturation']
793
- }], panel: [{
794
- type: ViewChild,
795
- args: ['panel', { static: true }]
796
- }], pointer: [{
797
- type: ViewChild,
798
- args: ['pointer', { static: true }]
799
- }], colorChange: [{
800
- type: Output
801
- }], color: [{
802
- type: Input
803
779
  }] } });
804
780
 
805
781
  /**
@@ -808,28 +784,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
808
784
  class ThyColorPickerCustomPanel {
809
785
  constructor() {
810
786
  this.className = true;
787
+ this.color = model();
788
+ this.colorInstance = signal(null);
789
+ this.pickerColorChange = input();
811
790
  }
812
791
  ngOnInit() {
813
- this.colorInstance = new ThyColor(this.color);
792
+ this.colorInstance.set(new ThyColor(this.color()));
814
793
  }
815
794
  colorChangeEvent($event) {
816
- this.colorInstance = $event;
817
- this.color = this.colorInstance.displayValue;
818
- this.pickerColorChange(this.color);
795
+ this.colorInstance.set($event);
796
+ this.color.set(this.colorInstance().displayValue);
797
+ this.pickerColorChange()(this.color());
819
798
  }
820
799
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorPickerCustomPanel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
821
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyColorPickerCustomPanel, isStandalone: true, selector: "thy-color-picker-custom-panel", inputs: { color: "color", pickerColorChange: "pickerColorChange" }, host: { properties: { "class.thy-color-picker-custom-panel": "this.className" } }, ngImport: i0, template: "<thy-saturation [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-saturation>\n<div class=\"controls\">\n <div class=\"indicator-hue-alp\">\n <div class=\"rows\">\n <thy-hue [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-hue>\n <thy-alpha [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-alpha>\n </div>\n <thy-indicator [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-indicator>\n </div>\n</div>\n<thy-color-inputs [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-color-inputs>\n", dependencies: [{ kind: "component", type: ThySaturation, selector: "thy-saturation", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyHue, selector: "thy-hue", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyAlpha, selector: "thy-alpha", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyIndicator, selector: "thy-indicator", inputs: ["color"] }, { kind: "component", type: ThyColorInputs, selector: "thy-color-inputs", inputs: ["color"], outputs: ["colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
800
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyColorPickerCustomPanel, isStandalone: true, selector: "thy-color-picker-custom-panel", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, pickerColorChange: { classPropertyName: "pickerColorChange", publicName: "pickerColorChange", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { color: "colorChange" }, host: { properties: { "class.thy-color-picker-custom-panel": "this.className" } }, ngImport: i0, template: "<thy-saturation [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-saturation>\n<div class=\"controls\">\n <div class=\"indicator-hue-alp\">\n <div class=\"rows\">\n <thy-hue [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-hue>\n <thy-alpha [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-alpha>\n </div>\n <thy-indicator [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-indicator>\n </div>\n</div>\n<thy-color-inputs [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-color-inputs>\n", dependencies: [{ kind: "component", type: ThySaturation, selector: "thy-saturation", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyHue, selector: "thy-hue", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyAlpha, selector: "thy-alpha", inputs: ["color"], outputs: ["colorChange"] }, { kind: "component", type: ThyIndicator, selector: "thy-indicator", inputs: ["color"] }, { kind: "component", type: ThyColorInputs, selector: "thy-color-inputs", inputs: ["color"], outputs: ["colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
822
801
  }
823
802
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorPickerCustomPanel, decorators: [{
824
803
  type: Component,
825
- args: [{ selector: 'thy-color-picker-custom-panel', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThySaturation, ThyHue, ThyAlpha, ThyIndicator, ThyColorInputs], template: "<thy-saturation [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-saturation>\n<div class=\"controls\">\n <div class=\"indicator-hue-alp\">\n <div class=\"rows\">\n <thy-hue [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-hue>\n <thy-alpha [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-alpha>\n </div>\n <thy-indicator [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-indicator>\n </div>\n</div>\n<thy-color-inputs [color]=\"colorInstance\" (colorChange)=\"colorChangeEvent($event)\"></thy-color-inputs>\n" }]
804
+ args: [{ selector: 'thy-color-picker-custom-panel', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThySaturation, ThyHue, ThyAlpha, ThyIndicator, ThyColorInputs], template: "<thy-saturation [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-saturation>\n<div class=\"controls\">\n <div class=\"indicator-hue-alp\">\n <div class=\"rows\">\n <thy-hue [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-hue>\n <thy-alpha [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-alpha>\n </div>\n <thy-indicator [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-indicator>\n </div>\n</div>\n<thy-color-inputs [color]=\"colorInstance()\" (colorChange)=\"colorChangeEvent($event)\"></thy-color-inputs>\n" }]
826
805
  }], ctorParameters: () => [], propDecorators: { className: [{
827
806
  type: HostBinding,
828
807
  args: ['class.thy-color-picker-custom-panel']
829
- }], color: [{
830
- type: Input
831
- }], pickerColorChange: [{
832
- type: Input
833
808
  }] } });
834
809
 
835
810
  /**
@@ -841,15 +816,17 @@ class ThyColorPickerPanel {
841
816
  this.viewContainerRef = inject(ViewContainerRef);
842
817
  this.thyPopoverRef = inject(ThyPopoverRef);
843
818
  this.locale = injectLocale('colorPicker');
844
- this.className = true;
819
+ this.color = model();
820
+ this.colorChange = input();
821
+ this.defaultColor = input('', {
822
+ transform: (value) => {
823
+ return (value && new ThyColor(value).toHexString(true)) || '';
824
+ }
825
+ });
826
+ this.transparentColorSelectable = input(false, { transform: coerceBooleanProperty });
827
+ this.defaultColors = input();
845
828
  this.recentColors = [];
846
829
  }
847
- set defaultColor(value) {
848
- this.customDefaultColor = value;
849
- }
850
- get defaultColor() {
851
- return new ThyColor(this.customDefaultColor).toHexString(true);
852
- }
853
830
  ngOnInit() {
854
831
  const colors = localStorage.getItem('recentColors');
855
832
  if (colors) {
@@ -857,8 +834,8 @@ class ThyColorPickerPanel {
857
834
  }
858
835
  }
859
836
  selectColor(color) {
860
- this.color = color;
861
- this.colorChange(this.color);
837
+ this.color.set(color);
838
+ this.colorChange()(this.color());
862
839
  this.thyPopoverRef.close();
863
840
  }
864
841
  showMoreColor(event) {
@@ -873,10 +850,10 @@ class ThyColorPickerPanel {
873
850
  viewContainerRef: this.viewContainerRef,
874
851
  originActiveClass: 'thy-color-picker-active',
875
852
  initialState: {
876
- color: this.color,
853
+ color: this.color(),
877
854
  pickerColorChange: (value) => {
878
855
  this.newColor = value;
879
- this.colorChange(value);
856
+ this.colorChange()(value);
880
857
  }
881
858
  }
882
859
  });
@@ -900,28 +877,15 @@ class ThyColorPickerPanel {
900
877
  return hsp > 192 ? 'black' : 'white';
901
878
  }
902
879
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorPickerPanel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
903
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyColorPickerPanel, isStandalone: true, selector: "thy-color-picker-panel", inputs: { color: "color", colorChange: "colorChange", defaultColor: "defaultColor", transparentColorSelectable: ["transparentColorSelectable", "transparentColorSelectable", coerceBooleanProperty], defaultColors: "defaultColors" }, host: { properties: { "class.pt-4": "!transparentColorSelectable", "class.thy-color-picker-panel": "this.className" } }, ngImport: i0, template: "@if (customDefaultColor) {\n <div class=\"quick-color\" [ngClass]=\"transparentColorSelectable ? ' mb-0 pb-0' : ''\" (click)=\"selectColor(defaultColor)\">\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: defaultColor }\"></ng-template>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().defaultColor }}</span>\n </div>\n}\n@if (transparentColorSelectable) {\n <div class=\"quick-color\" [ngClass]=\"customDefaultColor ? 'mt-0 pt-0' : ''\" (click)=\"selectColor('transparent')\">\n <div class=\"color-block\"></div>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().noFillColor }}</span>\n </div>\n}\n<div class=\"main-content\">\n <div class=\"default-color\">\n @for (item of defaultColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n </div>\n <p class=\"font-size-sm text-secondary recent-text\">{{ locale().recentUsedColor }}</p>\n <div class=\"recent-color-container\">\n @for (item of recentColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (recentColors.length === 0) {\n <div class=\"font-size-sm px-1 text-muted\">{{ locale().none }}</div>\n }\n </div>\n</div>\n<div class=\"more-color\" (click)=\"showMoreColor($event)\">\n <thy-icon thyIconName=\"palette\" class=\"mr-2\"></thy-icon>\n <span class=\"font-size-sm custom-text\">{{ locale().customColor }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\"></thy-icon>\n</div>\n\n<ng-template #checkIconTpl let-colorItem>\n <div\n class=\"color-item\"\n [ngStyle]=\"{ background: colorItem }\"\n [ngClass]=\"colorItem === '#FFFFFF' ? 'item-border' : ''\"\n (click)=\"selectColor(colorItem)\">\n <thy-icon\n thyIconName=\"check-thick\"\n class=\"check-icon\"\n [ngClass]=\"\n color === colorItem ? (getIconColor(colorItem) === 'white' ? 'checked white-check' : 'checked black-check') : ''\n \"></thy-icon>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
880
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyColorPickerPanel, isStandalone: true, selector: "thy-color-picker-panel", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, colorChange: { classPropertyName: "colorChange", publicName: "colorChange", isSignal: true, isRequired: false, transformFunction: null }, defaultColor: { classPropertyName: "defaultColor", publicName: "defaultColor", isSignal: true, isRequired: false, transformFunction: null }, transparentColorSelectable: { classPropertyName: "transparentColorSelectable", publicName: "transparentColorSelectable", isSignal: true, isRequired: false, transformFunction: null }, defaultColors: { classPropertyName: "defaultColors", publicName: "defaultColors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { color: "colorChange" }, host: { properties: { "class.pt-4": "!transparentColorSelectable()", "class.thy-color-picker-panel": "true" } }, ngImport: i0, template: "@if (defaultColor()) {\n <div class=\"quick-color\" [ngClass]=\"transparentColorSelectable() ? ' mb-0 pb-0' : ''\" (click)=\"selectColor(defaultColor())\">\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: defaultColor() }\"></ng-template>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().defaultColor }}</span>\n </div>\n}\n@if (transparentColorSelectable()) {\n <div class=\"quick-color\" [ngClass]=\"defaultColor() ? 'mt-0 pt-0' : ''\" (click)=\"selectColor('transparent')\">\n <div class=\"color-block\"></div>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().noFillColor }}</span>\n </div>\n}\n<div class=\"main-content\">\n <div class=\"default-color\">\n @for (item of defaultColors(); track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n </div>\n <p class=\"font-size-sm text-secondary recent-text\">{{ locale().recentUsedColor }}</p>\n <div class=\"recent-color-container\">\n @for (item of recentColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (recentColors.length === 0) {\n <div class=\"font-size-sm px-1 text-muted\">{{ locale().none }}</div>\n }\n </div>\n</div>\n<div class=\"more-color\" (click)=\"showMoreColor($event)\">\n <thy-icon thyIconName=\"palette\" class=\"mr-2\"></thy-icon>\n <span class=\"font-size-sm custom-text\">{{ locale().customColor }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\"></thy-icon>\n</div>\n\n<ng-template #checkIconTpl let-colorItem>\n <div\n class=\"color-item\"\n [ngStyle]=\"{ background: colorItem }\"\n [ngClass]=\"colorItem === '#FFFFFF' ? 'item-border' : ''\"\n (click)=\"selectColor(colorItem)\">\n <thy-icon\n thyIconName=\"check-thick\"\n class=\"check-icon\"\n [ngClass]=\"\n color() === colorItem ? (getIconColor(colorItem) === 'white' ? 'checked white-check' : 'checked black-check') : ''\n \"></thy-icon>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
904
881
  }
905
882
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorPickerPanel, decorators: [{
906
883
  type: Component,
907
884
  args: [{ selector: 'thy-color-picker-panel', changeDetection: ChangeDetectionStrategy.OnPush, host: {
908
- '[class.pt-4]': '!transparentColorSelectable'
909
- }, imports: [NgClass, NgTemplateOutlet, ThyIcon, NgStyle], template: "@if (customDefaultColor) {\n <div class=\"quick-color\" [ngClass]=\"transparentColorSelectable ? ' mb-0 pb-0' : ''\" (click)=\"selectColor(defaultColor)\">\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: defaultColor }\"></ng-template>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().defaultColor }}</span>\n </div>\n}\n@if (transparentColorSelectable) {\n <div class=\"quick-color\" [ngClass]=\"customDefaultColor ? 'mt-0 pt-0' : ''\" (click)=\"selectColor('transparent')\">\n <div class=\"color-block\"></div>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().noFillColor }}</span>\n </div>\n}\n<div class=\"main-content\">\n <div class=\"default-color\">\n @for (item of defaultColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n </div>\n <p class=\"font-size-sm text-secondary recent-text\">{{ locale().recentUsedColor }}</p>\n <div class=\"recent-color-container\">\n @for (item of recentColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (recentColors.length === 0) {\n <div class=\"font-size-sm px-1 text-muted\">{{ locale().none }}</div>\n }\n </div>\n</div>\n<div class=\"more-color\" (click)=\"showMoreColor($event)\">\n <thy-icon thyIconName=\"palette\" class=\"mr-2\"></thy-icon>\n <span class=\"font-size-sm custom-text\">{{ locale().customColor }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\"></thy-icon>\n</div>\n\n<ng-template #checkIconTpl let-colorItem>\n <div\n class=\"color-item\"\n [ngStyle]=\"{ background: colorItem }\"\n [ngClass]=\"colorItem === '#FFFFFF' ? 'item-border' : ''\"\n (click)=\"selectColor(colorItem)\">\n <thy-icon\n thyIconName=\"check-thick\"\n class=\"check-icon\"\n [ngClass]=\"\n color === colorItem ? (getIconColor(colorItem) === 'white' ? 'checked white-check' : 'checked black-check') : ''\n \"></thy-icon>\n </div>\n</ng-template>\n" }]
910
- }], propDecorators: { className: [{
911
- type: HostBinding,
912
- args: ['class.thy-color-picker-panel']
913
- }], color: [{
914
- type: Input
915
- }], colorChange: [{
916
- type: Input
917
- }], defaultColor: [{
918
- type: Input
919
- }], transparentColorSelectable: [{
920
- type: Input,
921
- args: [{ transform: coerceBooleanProperty }]
922
- }], defaultColors: [{
923
- type: Input
924
- }] } });
885
+ '[class.pt-4]': '!transparentColorSelectable()',
886
+ '[class.thy-color-picker-panel]': 'true'
887
+ }, imports: [NgClass, NgTemplateOutlet, ThyIcon, NgStyle], template: "@if (defaultColor()) {\n <div class=\"quick-color\" [ngClass]=\"transparentColorSelectable() ? ' mb-0 pb-0' : ''\" (click)=\"selectColor(defaultColor())\">\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: defaultColor() }\"></ng-template>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().defaultColor }}</span>\n </div>\n}\n@if (transparentColorSelectable()) {\n <div class=\"quick-color\" [ngClass]=\"defaultColor() ? 'mt-0 pt-0' : ''\" (click)=\"selectColor('transparent')\">\n <div class=\"color-block\"></div>\n <span class=\"ml-2 font-size-sm text-secondary\">{{ locale().noFillColor }}</span>\n </div>\n}\n<div class=\"main-content\">\n <div class=\"default-color\">\n @for (item of defaultColors(); track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n </div>\n <p class=\"font-size-sm text-secondary recent-text\">{{ locale().recentUsedColor }}</p>\n <div class=\"recent-color-container\">\n @for (item of recentColors; track $index) {\n <ng-template [ngTemplateOutlet]=\"checkIconTpl\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (recentColors.length === 0) {\n <div class=\"font-size-sm px-1 text-muted\">{{ locale().none }}</div>\n }\n </div>\n</div>\n<div class=\"more-color\" (click)=\"showMoreColor($event)\">\n <thy-icon thyIconName=\"palette\" class=\"mr-2\"></thy-icon>\n <span class=\"font-size-sm custom-text\">{{ locale().customColor }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\"></thy-icon>\n</div>\n\n<ng-template #checkIconTpl let-colorItem>\n <div\n class=\"color-item\"\n [ngStyle]=\"{ background: colorItem }\"\n [ngClass]=\"colorItem === '#FFFFFF' ? 'item-border' : ''\"\n (click)=\"selectColor(colorItem)\">\n <thy-icon\n thyIconName=\"check-thick\"\n class=\"check-icon\"\n [ngClass]=\"\n color() === colorItem ? (getIconColor(colorItem) === 'white' ? 'checked white-check' : 'checked black-check') : ''\n \"></thy-icon>\n </div>\n</ng-template>\n" }]
888
+ }] });
925
889
 
926
890
  const DEFAULT_COLORS = [
927
891
  '#333333',
@@ -1011,26 +975,6 @@ const _BaseMixin = mixinTabIndex(mixinDisabled(OverlayBase));
1011
975
  * @name thyColorPicker
1012
976
  */
1013
977
  class ThyColorPickerDirective extends _BaseMixin {
1014
- /**
1015
- * 弹出悬浮层的触发方式
1016
- * @type 'hover' | 'click'
1017
- * @default click
1018
- */
1019
- set thyTrigger(trigger) {
1020
- this.trigger = trigger;
1021
- }
1022
- /**
1023
- * 显示延迟时间
1024
- */
1025
- set thyShowDelay(value) {
1026
- this.showDelay = value;
1027
- }
1028
- /**
1029
- * 隐藏延迟时间
1030
- */
1031
- set thyHideDelay(value) {
1032
- this.hideDelay = value;
1033
- }
1034
978
  /**
1035
979
  * 是否属于禁用状态
1036
980
  */
@@ -1054,39 +998,63 @@ class ThyColorPickerDirective extends _BaseMixin {
1054
998
  * 弹框偏移量
1055
999
  * @type number
1056
1000
  */
1057
- this.thyOffset = 0;
1001
+ this.thyOffset = input(0, { transform: numberAttribute });
1058
1002
  /**
1059
1003
  * 颜色选择面板是否有幕布
1060
1004
  */
1061
- this.thyHasBackdrop = true;
1005
+ this.thyHasBackdrop = input(true, { transform: coerceBooleanProperty });
1006
+ /**
1007
+ * 设置颜色选择面板的默认颜色选项值
1008
+ */
1009
+ this.thyDefaultColor = input();
1062
1010
  /**
1063
1011
  * 是否显示'无填充色'选项
1064
1012
  */
1065
- this.thyTransparentColorSelectable = true;
1013
+ this.thyTransparentColorSelectable = input(true, { transform: coerceBooleanProperty });
1066
1014
  /**
1067
1015
  * 预设的快捷选择颜色
1068
1016
  * @type string[]
1069
1017
  */
1070
- this.thyPresetColors = DEFAULT_COLORS;
1018
+ this.thyPresetColors = input(DEFAULT_COLORS);
1071
1019
  /**
1072
1020
  * 颜色面板弹出位置 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom'
1073
1021
  * @type ThyPlacement
1074
1022
  */
1075
- this.thyPlacement = 'bottom';
1023
+ this.thyPlacement = input('bottom');
1076
1024
  /**
1077
1025
  * panel 展开后触发
1078
1026
  */
1079
- this.thyPanelOpen = new EventEmitter();
1027
+ this.thyPanelOpen = output();
1080
1028
  /**
1081
1029
  * panel 关闭后触发
1082
1030
  */
1083
- this.thyPanelClose = new EventEmitter();
1031
+ this.thyPanelClose = output();
1032
+ /**
1033
+ * 弹出悬浮层的触发方式
1034
+ * @type 'hover' | 'click'
1035
+ */
1036
+ this.thyTrigger = input('click');
1037
+ /**
1038
+ * 显示延迟时间
1039
+ */
1040
+ this.thyShowDelay = input(100, { transform: numberAttribute });
1041
+ /**
1042
+ * 隐藏延迟时间
1043
+ */
1044
+ this.thyHideDelay = input(100, { transform: numberAttribute });
1084
1045
  this.onChangeFn = () => { };
1085
1046
  this.onTouchFn = () => { };
1086
1047
  this.closePanel = true;
1087
1048
  this.destroy$ = new Subject();
1049
+ effect(() => {
1050
+ // TODO: 基类参数
1051
+ this.showDelay = this.thyShowDelay() ?? 100;
1052
+ this.hideDelay = this.thyHideDelay() ?? 100;
1053
+ this.trigger = this.thyTrigger() || 'click';
1054
+ });
1088
1055
  }
1089
- ngOnInit() {
1056
+ ngOnInit() { }
1057
+ ngAfterViewInit() {
1090
1058
  this.initialize();
1091
1059
  if (this.trigger === 'hover') {
1092
1060
  this.ngZone.runOutsideAngular(() => {
@@ -1113,12 +1081,12 @@ class ThyColorPickerDirective extends _BaseMixin {
1113
1081
  this.closePanel = false;
1114
1082
  this.popoverRef = this.thyPopover.open(ThyColorPickerPanel, {
1115
1083
  origin: this.elementRef.nativeElement,
1116
- offset: this.thyOffset,
1084
+ offset: this.thyOffset(),
1117
1085
  manualClosure: true,
1118
1086
  width: '286px',
1119
- placement: this.thyPlacement,
1087
+ placement: this.thyPlacement(),
1120
1088
  originActiveClass: 'thy-default-picker-active',
1121
- hasBackdrop: this.thyHasBackdrop,
1089
+ hasBackdrop: this.thyHasBackdrop(),
1122
1090
  outsideClosable: false,
1123
1091
  canClose: () => {
1124
1092
  if (this.trigger === 'hover') {
@@ -1128,9 +1096,9 @@ class ThyColorPickerDirective extends _BaseMixin {
1128
1096
  },
1129
1097
  initialState: {
1130
1098
  color: new ThyColor(this.color).toHexString(true),
1131
- defaultColor: this.thyDefaultColor,
1132
- transparentColorSelectable: this.thyTransparentColorSelectable,
1133
- defaultColors: this.thyPresetColors,
1099
+ defaultColor: this.thyDefaultColor(),
1100
+ transparentColorSelectable: this.thyTransparentColorSelectable(),
1101
+ defaultColors: this.thyPresetColors(),
1134
1102
  colorChange: (value) => {
1135
1103
  this.closePanel = true;
1136
1104
  this.onModelChange(value);
@@ -1146,7 +1114,7 @@ class ThyColorPickerDirective extends _BaseMixin {
1146
1114
  this.elementRef.nativeElement.focus();
1147
1115
  });
1148
1116
  }
1149
- if (this.popoverRef && !this.thyHasBackdrop) {
1117
+ if (this.popoverRef && !this.thyHasBackdrop()) {
1150
1118
  this.popoverRef
1151
1119
  .getOverlayRef()
1152
1120
  .outsidePointerEvents()
@@ -1214,7 +1182,7 @@ class ThyColorPickerDirective extends _BaseMixin {
1214
1182
  this.popoverRef = null;
1215
1183
  }
1216
1184
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColorPickerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1217
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.8", type: ThyColorPickerDirective, isStandalone: true, selector: "[thyColorPicker]", inputs: { thyOffset: ["thyOffset", "thyOffset", numberAttribute], thyHasBackdrop: ["thyHasBackdrop", "thyHasBackdrop", coerceBooleanProperty], thyDefaultColor: "thyDefaultColor", thyTransparentColorSelectable: ["thyTransparentColorSelectable", "thyTransparentColorSelectable", coerceBooleanProperty], thyPresetColors: "thyPresetColors", thyPlacement: "thyPlacement", thyTrigger: "thyTrigger", thyShowDelay: ["thyShowDelay", "thyShowDelay", numberAttribute], thyHideDelay: ["thyHideDelay", "thyHideDelay", numberAttribute], thyDisabled: ["thyDisabled", "thyDisabled", coerceBooleanProperty] }, outputs: { thyPanelOpen: "thyPanelOpen", thyPanelClose: "thyPanelClose" }, host: { properties: { "attr.tabindex": "tabIndex", "class.thy-color-picker-disabled": "disabled" }, classAttribute: "thy-color-picker" }, providers: [
1185
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyColorPickerDirective, isStandalone: true, selector: "[thyColorPicker]", inputs: { thyOffset: { classPropertyName: "thyOffset", publicName: "thyOffset", isSignal: true, isRequired: false, transformFunction: null }, thyHasBackdrop: { classPropertyName: "thyHasBackdrop", publicName: "thyHasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, thyDefaultColor: { classPropertyName: "thyDefaultColor", publicName: "thyDefaultColor", isSignal: true, isRequired: false, transformFunction: null }, thyTransparentColorSelectable: { classPropertyName: "thyTransparentColorSelectable", publicName: "thyTransparentColorSelectable", isSignal: true, isRequired: false, transformFunction: null }, thyPresetColors: { classPropertyName: "thyPresetColors", publicName: "thyPresetColors", isSignal: true, isRequired: false, transformFunction: null }, thyPlacement: { classPropertyName: "thyPlacement", publicName: "thyPlacement", isSignal: true, isRequired: false, transformFunction: null }, thyTrigger: { classPropertyName: "thyTrigger", publicName: "thyTrigger", isSignal: true, isRequired: false, transformFunction: null }, thyShowDelay: { classPropertyName: "thyShowDelay", publicName: "thyShowDelay", isSignal: true, isRequired: false, transformFunction: null }, thyHideDelay: { classPropertyName: "thyHideDelay", publicName: "thyHideDelay", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: false, isRequired: false, transformFunction: coerceBooleanProperty } }, outputs: { thyPanelOpen: "thyPanelOpen", thyPanelClose: "thyPanelClose" }, host: { properties: { "attr.tabindex": "tabIndex", "class.thy-color-picker-disabled": "disabled" }, classAttribute: "thy-color-picker" }, providers: [
1218
1186
  {
1219
1187
  provide: NG_VALUE_ACCESSOR,
1220
1188
  multi: true,
@@ -1239,34 +1207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
1239
1207
  }
1240
1208
  ]
1241
1209
  }]
1242
- }], ctorParameters: () => [], propDecorators: { thyOffset: [{
1243
- type: Input,
1244
- args: [{ transform: numberAttribute }]
1245
- }], thyHasBackdrop: [{
1246
- type: Input,
1247
- args: [{ transform: coerceBooleanProperty }]
1248
- }], thyDefaultColor: [{
1249
- type: Input
1250
- }], thyTransparentColorSelectable: [{
1251
- type: Input,
1252
- args: [{ transform: coerceBooleanProperty }]
1253
- }], thyPresetColors: [{
1254
- type: Input
1255
- }], thyPlacement: [{
1256
- type: Input
1257
- }], thyPanelOpen: [{
1258
- type: Output
1259
- }], thyPanelClose: [{
1260
- type: Output
1261
- }], thyTrigger: [{
1262
- type: Input
1263
- }], thyShowDelay: [{
1264
- type: Input,
1265
- args: [{ transform: numberAttribute }]
1266
- }], thyHideDelay: [{
1267
- type: Input,
1268
- args: [{ transform: numberAttribute }]
1269
- }], thyDisabled: [{
1210
+ }], ctorParameters: () => [], propDecorators: { thyDisabled: [{
1270
1211
  type: Input,
1271
1212
  args: [{ transform: coerceBooleanProperty }]
1272
1213
  }] } });