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,8 +1,7 @@
1
1
  import { NgTemplateOutlet, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, inject, ChangeDetectorRef, DestroyRef, TemplateRef, ContentChildren, Input, HostBinding, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import { Directive, inject, ChangeDetectorRef, DestroyRef, input, computed, contentChildren, TemplateRef, effect, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
4
  import { useHostRenderer } from '@tethys/cdk/dom';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
5
  import { getNumericSize } from 'ngx-tethys/core';
7
6
  import { coerceBooleanProperty } from 'ngx-tethys/util';
8
7
 
@@ -19,12 +18,7 @@ class ThySpaceItemDirective {
19
18
  }
20
19
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySpaceItemDirective, decorators: [{
21
20
  type: Directive,
22
- args: [{
23
- selector: '[thySpaceItem]',
24
- host: {
25
- class: 'thy-space-item'
26
- }
27
- }]
21
+ args: [{ selector: '[thySpaceItem]', host: { class: 'thy-space-item' } }]
28
22
  }], ctorParameters: () => [] });
29
23
  const DEFAULT_SIZE = 'md';
30
24
  /**
@@ -36,55 +30,41 @@ class ThySpace {
36
30
  constructor() {
37
31
  this.cdr = inject(ChangeDetectorRef);
38
32
  this.destroyRef = inject(DestroyRef);
39
- this.space = getNumericSize(DEFAULT_SIZE);
40
33
  this.hostRenderer = useHostRenderer();
34
+ /**
35
+ * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小
36
+ * @type string | number
37
+ */
38
+ this.thySize = input(DEFAULT_SIZE);
39
+ this.space = computed(() => {
40
+ return getNumericSize(this.thySize(), DEFAULT_SIZE);
41
+ });
41
42
  /**
42
43
  * 间距垂直方向,默认是水平方向
43
44
  */
44
- this.thyVertical = false;
45
- }
46
- /**
47
- * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小
48
- * @type string | number
49
- */
50
- set thySize(size) {
51
- this.space = getNumericSize(size, DEFAULT_SIZE);
52
- }
53
- // @ClassBinding(`align-items-{{value}}`)
54
- /**
55
- * 对齐方式,可选择 `start` | `end` | `baseline` | `center`
56
- */
57
- set thyAlign(align) {
58
- this.hostRenderer.updateClass(align ? [`align-items-${align}`] : []);
59
- }
60
- ngOnInit() { }
61
- ngAfterContentInit() {
62
- this.items.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
63
- this.cdr.markForCheck();
45
+ this.thyVertical = input(false, { transform: coerceBooleanProperty });
46
+ // @ClassBinding(`align-items-{{value}}`)
47
+ /**
48
+ * 对齐方式,可选择 `start` | `end` | `baseline` | `center`
49
+ */
50
+ this.thyAlign = input();
51
+ this.items = contentChildren(ThySpaceItemDirective, { read: (TemplateRef) });
52
+ effect(() => {
53
+ this.hostRenderer.updateClass(this.thyAlign() ? [`align-items-${this.thyAlign()}`] : []);
64
54
  });
65
55
  }
56
+ ngOnInit() { }
57
+ ngAfterContentInit() { }
66
58
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySpace, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
67
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySpace, isStandalone: true, selector: "thy-space", inputs: { thySize: "thySize", thyVertical: ["thyVertical", "thyVertical", coerceBooleanProperty], thyAlign: "thyAlign" }, host: { properties: { "class.thy-space-vertical": "this.thyVertical" }, classAttribute: "thy-space" }, queries: [{ propertyName: "items", predicate: ThySpaceItemDirective, read: TemplateRef }], ngImport: i0, template: "<ng-content></ng-content>\n\n@for (item of items; track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
59
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySpace, isStandalone: true, selector: "thy-space", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyVertical: { classPropertyName: "thyVertical", publicName: "thyVertical", isSignal: true, isRequired: false, transformFunction: null }, thyAlign: { classPropertyName: "thyAlign", publicName: "thyAlign", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-space": "true", "class.thy-space-vertical": "thyVertical()" } }, queries: [{ propertyName: "items", predicate: ThySpaceItemDirective, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ng-content></ng-content>\n\n@for (item of items(); track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space()\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
68
60
  }
69
61
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySpace, decorators: [{
70
62
  type: Component,
71
63
  args: [{ selector: 'thy-space', changeDetection: ChangeDetectionStrategy.OnPush, host: {
72
- class: 'thy-space'
73
- }, imports: [NgTemplateOutlet], template: "<ng-content></ng-content>\n\n@for (item of items; track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n" }]
74
- }], propDecorators: { thySize: [{
75
- type: Input
76
- }], thyVertical: [{
77
- type: HostBinding,
78
- args: [`class.thy-space-vertical`]
79
- }, {
80
- type: Input,
81
- args: [{ transform: coerceBooleanProperty }]
82
- }], thyAlign: [{
83
- type: Input
84
- }], items: [{
85
- type: ContentChildren,
86
- args: [ThySpaceItemDirective, { read: TemplateRef }]
87
- }] } });
64
+ '[class.thy-space]': 'true',
65
+ '[class.thy-space-vertical]': 'thyVertical()'
66
+ }, imports: [NgTemplateOutlet], template: "<ng-content></ng-content>\n\n@for (item of items(); track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space()\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n" }]
67
+ }], ctorParameters: () => [] });
88
68
 
89
69
  class ThySpaceModule {
90
70
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySpaceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-space.mjs","sources":["../../../src/space/space.component.ts","../../../src/space/space.component.html","../../../src/space/space.module.ts","../../../src/space/ngx-tethys-space.ts"],"sourcesContent":["import { useHostRenderer } from '@tethys/cdk/dom';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DestroyRef,\n Directive,\n HostBinding,\n inject,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\nimport { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * 间距组件项,使用结构性指令 *thySpaceItem 传入模板\n * @name thySpaceItem\n * @order 20\n */\n@Directive({\n selector: '[thySpaceItem]',\n host: {\n class: 'thy-space-item'\n }\n})\nexport class ThySpaceItemDirective implements OnInit {\n constructor() {}\n\n ngOnInit(): void {}\n}\n\nconst DEFAULT_SIZE: ThySpacingSize = 'md';\n\n/**\n * 间距组件\n * @name thy-space\n * @order 10\n */\n@Component({\n selector: 'thy-space',\n templateUrl: './space.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-space'\n },\n imports: [NgTemplateOutlet]\n})\nexport class ThySpace implements OnInit, AfterContentInit {\n private cdr = inject(ChangeDetectorRef);\n\n private readonly destroyRef = inject(DestroyRef);\n\n public space: number = getNumericSize(DEFAULT_SIZE);\n\n private hostRenderer = useHostRenderer();\n\n /**\n * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小\n * @type string | number\n */\n @Input() set thySize(size: ThySpacingSize) {\n this.space = getNumericSize(size, DEFAULT_SIZE);\n }\n\n /**\n * 间距垂直方向,默认是水平方向\n */\n @HostBinding(`class.thy-space-vertical`)\n @Input({ transform: coerceBooleanProperty })\n thyVertical: boolean = false;\n\n // @ClassBinding(`align-items-{{value}}`)\n /**\n * 对齐方式,可选择 `start` | `end` | `baseline` | `center`\n */\n @Input()\n set thyAlign(align: string) {\n this.hostRenderer.updateClass(align ? [`align-items-${align}`] : []);\n }\n\n @ContentChildren(ThySpaceItemDirective, { read: TemplateRef }) items!: QueryList<TemplateRef<HTMLElement>>;\n\n ngOnInit(): void {}\n\n ngAfterContentInit(): void {\n this.items.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-content></ng-content>\n\n@for (item of items; track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThySpace, ThySpaceItemDirective } from './space.component';\n\n@NgModule({\n imports: [CommonModule, ThySpace, ThySpaceItemDirective],\n exports: [ThySpace, ThySpaceItemDirective]\n})\nexport class ThySpaceModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA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AAC,EAAA,QAAA,EAAA,yQAAA,EAAA;8BAed,OAAO,EAAA,CAAA;sBAAnB;gBASD,WAAW,EAAA,CAAA;sBAFV,WAAW;uBAAC,CAA0B,wBAAA,CAAA;;sBACtC,KAAK;uBAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE;gBAQvC,QAAQ,EAAA,CAAA;sBADX;gBAK8D,KAAK,EAAA,CAAA;sBAAnE,eAAe;AAAC,gBAAA,IAAA,EAAA,CAAA,qBAAqB,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;;ME/EpD,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,OAAA,EAAA,CAHb,YAAY,EAAE,QAAQ,EAAE,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC7C,QAAQ,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAEhC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHb,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGb,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,qBAAqB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,QAAQ,EAAE,qBAAqB;AAC5C,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-space.mjs","sources":["../../../src/space/space.component.ts","../../../src/space/space.component.html","../../../src/space/space.module.ts","../../../src/space/ngx-tethys-space.ts"],"sourcesContent":["import { useHostRenderer } from '@tethys/cdk/dom';\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Directive,\n inject,\n input,\n OnInit,\n TemplateRef,\n computed,\n effect,\n contentChildren\n} from '@angular/core';\nimport { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * 间距组件项,使用结构性指令 *thySpaceItem 传入模板\n * @name thySpaceItem\n * @order 20\n */\n@Directive({ selector: '[thySpaceItem]', host: { class: 'thy-space-item' } })\nexport class ThySpaceItemDirective implements OnInit {\n constructor() {}\n\n ngOnInit(): void {}\n}\n\nconst DEFAULT_SIZE: ThySpacingSize = 'md';\n\n/**\n * 间距组件\n * @name thy-space\n * @order 10\n */\n@Component({\n selector: 'thy-space',\n templateUrl: './space.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.thy-space]': 'true',\n '[class.thy-space-vertical]': 'thyVertical()'\n },\n imports: [NgTemplateOutlet]\n})\nexport class ThySpace implements OnInit, AfterContentInit {\n private cdr = inject(ChangeDetectorRef);\n\n private readonly destroyRef = inject(DestroyRef);\n\n private hostRenderer = useHostRenderer();\n\n /**\n * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小\n * @type string | number\n */\n readonly thySize = input<ThySpacingSize>(DEFAULT_SIZE);\n\n space = computed(() => {\n return getNumericSize(this.thySize(), DEFAULT_SIZE);\n });\n\n /**\n * 间距垂直方向,默认是水平方向\n */\n readonly thyVertical = input<string | boolean, boolean>(false, { transform: coerceBooleanProperty });\n\n // @ClassBinding(`align-items-{{value}}`)\n /**\n * 对齐方式,可选择 `start` | `end` | `baseline` | `center`\n */\n readonly thyAlign = input<string>();\n\n items = contentChildren(ThySpaceItemDirective, { read: TemplateRef<HTMLElement> });\n\n constructor() {\n effect(() => {\n this.hostRenderer.updateClass(this.thyAlign() ? [`align-items-${this.thyAlign()}`] : []);\n });\n }\n\n ngOnInit(): void {}\n\n ngAfterContentInit(): void {}\n}\n","<ng-content></ng-content>\n\n@for (item of items(); track $index; let last = $last; let index = $index) {\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space()\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThySpace, ThySpaceItemDirective } from './space.component';\n\n@NgModule({\n imports: [CommonModule, ThySpace, ThySpaceItemDirective],\n exports: [ThySpace, ThySpaceItemDirective]\n})\nexport class ThySpaceModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAqBA;;;;AAIG;MAEU,qBAAqB,CAAA;AAC9B,IAAA,WAAA,GAAA;AAEA,IAAA,QAAQ;8GAHC,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,SAAS;mBAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE;;AAO5E,MAAM,YAAY,GAAmB,IAAI;AAEzC;;;;AAIG;MAWU,QAAQ,CAAA;AA8BjB,IAAA,WAAA,GAAA;AA7BQ,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEtB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAExC,IAAY,CAAA,YAAA,GAAG,eAAe,EAAE;AAExC;;;AAGG;AACM,QAAA,IAAA,CAAA,OAA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AA,CAAA,CAAA;;2FAEjB,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAVpB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAEJ,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,mBAAmB,EAAE,MAAM;AAC3B,wBAAA,4BAA4B,EAAE;qBACjC,EACQ,OAAA,EAAA,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,6QAAA,EAAA;;;MEvClB,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,OAAA,EAAA,CAHb,YAAY,EAAE,QAAQ,EAAE,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC7C,QAAQ,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAEhC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHb,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGb,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,qBAAqB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,QAAQ,EAAE,qBAAqB;AAC5C,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { NgTemplateOutlet, NgStyle, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, ContentChild, Input, HostBinding, Component, NgModule } from '@angular/core';
3
+ import { input, contentChild, computed, effect, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
4
  import { ThySharedModule } from 'ngx-tethys/shared';
5
5
  import { hexToRgb } from 'ngx-tethys/util';
6
6
  import { useHostRenderer } from '@tethys/cdk/dom';
@@ -12,178 +12,141 @@ import { ThyIconModule } from 'ngx-tethys/icon';
12
12
  */
13
13
  class ThyStatistic {
14
14
  constructor() {
15
- this.elementRef = inject(ElementRef);
16
- this._initialized = false;
17
- this.hostRenderer = useHostRenderer();
18
- this.class = true;
15
+ /**
16
+ * @description 展示数据
17
+ * @type number | string
18
+ */
19
+ this.thyValue = input();
19
20
  /**
20
21
  * @description 展示数据的 css 样式
21
22
  * @type { [key: string]: string; }
22
23
  */
23
- this.thyValueStyle = {};
24
+ this.thyValueStyle = input({});
25
+ /**
26
+ * @description 展示数据的前缀
27
+ * @type string
28
+ */
29
+ this.thyPrefix = input();
30
+ /**
31
+ * @description 展示数据的后缀
32
+ * @type string
33
+ */
34
+ this.thySuffix = input();
35
+ /**
36
+ * @description 展示数据的标题
37
+ * @type string
38
+ */
39
+ this.thyTitle = input();
24
40
  /**
25
41
  * @description 展示数据标题的位置,可设置 `top`|`bottom`
26
42
  * @type ThyStatisticTitlePosition
27
43
  */
28
- this.thyTitlePosition = 'bottom';
44
+ this.thyTitlePosition = input('bottom');
45
+ /**
46
+ * @description 展示形状
47
+ * @type ThyStatisticShape
48
+ * @default card
49
+ */
50
+ this.thyShape = input();
51
+ /**
52
+ * @description 主题颜色,可以使用提供的主题色,也可以自定义颜色。 `ThyStatisticColorType` 中包含 `primary` | `success` | `warning` | `danger` | `info`
53
+ * @type ThyStatisticColorType | string
54
+ */
55
+ this.thyColor = input();
56
+ /**
57
+ * @description 前缀和展示数据字体大小
58
+ * @type ThyStatisticSizes
59
+ * @default default
60
+ */
61
+ this.thySize = input('default');
62
+ /**
63
+ * @description 自定义展示数据模板
64
+ * @type TemplateRef<void>
65
+ */
66
+ this.thyValueTemplate = input();
67
+ /**
68
+ * @description 自定义标题模板
69
+ * @type TemplateRef<void>
70
+ */
71
+ this.thyTitleTemplate = input();
72
+ /**
73
+ * @description 自定义前缀模板
74
+ * @type TemplateRef<void>
75
+ */
76
+ this.thyPrefixTemplate = input();
77
+ /**
78
+ * @description 自定义后缀模板
79
+ * @type TemplateRef<void>
80
+ */
81
+ this.thySuffixTemplate = input();
82
+ /**
83
+ * @description 自定义展示数据模板
84
+ * @type TemplateRef<void>
85
+ */
86
+ this.contentValueTemplate = contentChild('value');
87
+ /**
88
+ * @description 自定义标题模板
89
+ * @type TemplateRef<void>
90
+ */
91
+ this.contentTitleTemplate = contentChild('title');
92
+ /**
93
+ * @description 自定义前缀模板
94
+ * @type TemplateRef<void>
95
+ */
96
+ this.contentPrefixTemplate = contentChild('prefix');
97
+ /**
98
+ * @description 自定义后缀模板
99
+ * @type TemplateRef<void>
100
+ */
101
+ this.contentSuffixTemplate = contentChild('suffix');
102
+ this.valueTemplate = computed(() => {
103
+ return this.thyValueTemplate() || this.contentValueTemplate();
104
+ });
105
+ this.titleTemplate = computed(() => {
106
+ return this.thyTitleTemplate() || this.contentTitleTemplate();
107
+ });
108
+ this.prefixTemplate = computed(() => {
109
+ return this.thyPrefixTemplate() || this.contentPrefixTemplate();
110
+ });
111
+ this.suffixTemplate = computed(() => {
112
+ return this.thySuffixTemplate() || this.contentSuffixTemplate();
113
+ });
114
+ this.hostRenderer = useHostRenderer();
115
+ effect(() => {
116
+ this.setClassesByType();
117
+ });
29
118
  }
30
- /**
31
- * @description 展示形状
32
- * @type ThyStatisticShape
33
- * @default card
34
- */
35
- set thyShape(value) {
36
- this._shape = value;
37
- if (this._initialized) {
38
- this._setClassesByType();
119
+ setClassesByType() {
120
+ const classNames = [];
121
+ if (this.thyColor()) {
122
+ if (RegExp(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/).test(this.thyColor())) {
123
+ this.setColor(this.thyColor());
124
+ }
125
+ else {
126
+ classNames.push(`thy-statistic-${this.thyColor()}`);
127
+ }
39
128
  }
40
- }
41
- /**
42
- * @description 前缀和展示数据字体大小
43
- * @type ThyStatisticSizes
44
- * @default default
45
- */
46
- set thySize(value) {
47
- this._size = value;
48
- if (this._initialized) {
49
- this._setClassesByType();
129
+ if (this.thyShape()) {
130
+ classNames.push(`thy-statistic-${this.thyShape()}`);
50
131
  }
51
- }
52
- /**
53
- * @description 自定义展示数据模板
54
- * @type TemplateRef<void>
55
- */
56
- set thyValueTemplate(value) {
57
- this.valueTemplate = value;
58
- }
59
- /**
60
- * @description 自定义展示数据模板
61
- * @type TemplateRef<void>
62
- */
63
- set value(value) {
64
- this.valueTemplate = value;
65
- }
66
- /**
67
- * @description 自定义标题模板
68
- * @type TemplateRef<void>
69
- */
70
- set thyTitleTemplate(value) {
71
- this.titleTemplate = value;
72
- }
73
- /**
74
- * @description 自定义标题模板
75
- * @type TemplateRef<void>
76
- */
77
- set title(value) {
78
- this.titleTemplate = value;
79
- }
80
- /**
81
- * @description 自定义前缀模板
82
- * @type TemplateRef<void>
83
- */
84
- set thyPrefixTemplate(value) {
85
- this.prefixTemplate = value;
86
- }
87
- /**
88
- * @description 自定义前缀模板
89
- * @type TemplateRef<void>
90
- */
91
- set prefix(value) {
92
- this.prefixTemplate = value;
93
- }
94
- /**
95
- * @description 自定义后缀模板
96
- * @type TemplateRef<void>
97
- */
98
- set thySuffixTemplate(value) {
99
- this.suffixTemplate = value;
100
- }
101
- /**
102
- * @description 自定义后缀模板
103
- * @type TemplateRef<void>
104
- */
105
- set suffix(value) {
106
- this.suffixTemplate = value;
107
- }
108
- ngOnInit() {
109
- this._setClassesByType();
110
- this._initialized = true;
132
+ classNames.push(`thy-statistic-${this.thySize()}`);
133
+ this.hostRenderer.setStyle('font-size', this.thySize());
134
+ this.hostRenderer.updateClass(classNames);
111
135
  }
112
136
  setColor(color) {
113
137
  this.hostRenderer.setStyle('color', color);
114
- if (this._shape === 'card') {
138
+ if (this.thyShape() === 'card') {
115
139
  this.hostRenderer.setStyle('border-color', color);
116
140
  this.hostRenderer.setStyle('background-color', hexToRgb(color, 0.05));
117
141
  }
118
142
  }
119
- _setClassesByType() {
120
- const classNames = [];
121
- if (this.thyColor) {
122
- if (RegExp(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/).test(this.thyColor)) {
123
- this.setColor(this.thyColor);
124
- }
125
- else {
126
- classNames.push(`thy-statistic-${this.thyColor}`);
127
- }
128
- }
129
- if (this._shape) {
130
- classNames.push(`thy-statistic-${this._shape}`);
131
- }
132
- if (!this._size) {
133
- this._size = 'default';
134
- }
135
- classNames.push(`thy-statistic-${this._size}`);
136
- this.hostRenderer.setStyle('font-size', this.thySize);
137
- this.hostRenderer.updateClass(classNames);
138
- }
139
143
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStatistic, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
140
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyStatistic, isStandalone: true, selector: "thy-statistic", inputs: { thyValue: "thyValue", thyValueStyle: "thyValueStyle", thyPrefix: "thyPrefix", thySuffix: "thySuffix", thyTitle: "thyTitle", thyTitlePosition: "thyTitlePosition", thyShape: "thyShape", thyColor: "thyColor", thySize: "thySize", thyValueTemplate: "thyValueTemplate", thyTitleTemplate: "thyTitleTemplate", thyPrefixTemplate: "thyPrefixTemplate", thySuffixTemplate: "thySuffixTemplate" }, host: { properties: { "class.thy-statistic": "this.class" } }, queries: [{ propertyName: "value", first: true, predicate: ["value"], descendants: true, static: true }, { propertyName: "title", first: true, predicate: ["title"], descendants: true, static: true }, { propertyName: "prefix", first: true, predicate: ["prefix"], descendants: true, static: true }, { propertyName: "suffix", first: true, predicate: ["suffix"], descendants: true, static: true }], ngImport: i0, template: "@if ((thyTitle || titleTemplate) && thyTitlePosition === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle\">\n @if (thyPrefix || prefixTemplate) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix) {\n <span>{{ thyPrefix }}</span>\n }\n @if (prefixTemplate) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate) {\n <span>{{ thyValue }}</span>\n }\n @if (valueTemplate) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate\"></ng-container>\n }\n </span>\n\n @if (thySuffix || suffixTemplate) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix) {\n <span>{{ thySuffix }}</span>\n }\n @if (suffixTemplate) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle || titleTemplate) && thyTitlePosition === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle) {\n <span>{{ thyTitle }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate\"></ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
144
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyStatistic, isStandalone: true, selector: "thy-statistic", inputs: { thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyValueStyle: { classPropertyName: "thyValueStyle", publicName: "thyValueStyle", isSignal: true, isRequired: false, transformFunction: null }, thyPrefix: { classPropertyName: "thyPrefix", publicName: "thyPrefix", isSignal: true, isRequired: false, transformFunction: null }, thySuffix: { classPropertyName: "thySuffix", publicName: "thySuffix", isSignal: true, isRequired: false, transformFunction: null }, thyTitle: { classPropertyName: "thyTitle", publicName: "thyTitle", isSignal: true, isRequired: false, transformFunction: null }, thyTitlePosition: { classPropertyName: "thyTitlePosition", publicName: "thyTitlePosition", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null }, thyColor: { classPropertyName: "thyColor", publicName: "thyColor", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyValueTemplate: { classPropertyName: "thyValueTemplate", publicName: "thyValueTemplate", isSignal: true, isRequired: false, transformFunction: null }, thyTitleTemplate: { classPropertyName: "thyTitleTemplate", publicName: "thyTitleTemplate", isSignal: true, isRequired: false, transformFunction: null }, thyPrefixTemplate: { classPropertyName: "thyPrefixTemplate", publicName: "thyPrefixTemplate", isSignal: true, isRequired: false, transformFunction: null }, thySuffixTemplate: { classPropertyName: "thySuffixTemplate", publicName: "thySuffixTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-statistic": "true" } }, queries: [{ propertyName: "contentValueTemplate", first: true, predicate: ["value"], descendants: true, isSignal: true }, { propertyName: "contentTitleTemplate", first: true, predicate: ["title"], descendants: true, isSignal: true }, { propertyName: "contentPrefixTemplate", first: true, predicate: ["prefix"], descendants: true, isSignal: true }, { propertyName: "contentSuffixTemplate", first: true, predicate: ["suffix"], descendants: true, isSignal: true }], ngImport: i0, template: "@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle()\">\n @if (thyPrefix() || prefixTemplate()) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix()) {\n <span>{{ thyPrefix() }}</span>\n }\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate()) {\n <span>{{ thyValue() }}</span>\n }\n @if (valueTemplate()) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate()\"></ng-container>\n }\n </span>\n\n @if (thySuffix() || suffixTemplate()) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix()) {\n <span>{{ thySuffix() }}</span>\n }\n @if (suffixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle()) {\n <span>{{ thyTitle() }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\"></ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
141
145
  }
142
146
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStatistic, decorators: [{
143
147
  type: Component,
144
- args: [{ selector: 'thy-statistic', imports: [NgTemplateOutlet, NgStyle], template: "@if ((thyTitle || titleTemplate) && thyTitlePosition === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle\">\n @if (thyPrefix || prefixTemplate) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix) {\n <span>{{ thyPrefix }}</span>\n }\n @if (prefixTemplate) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate) {\n <span>{{ thyValue }}</span>\n }\n @if (valueTemplate) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate\"></ng-container>\n }\n </span>\n\n @if (thySuffix || suffixTemplate) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix) {\n <span>{{ thySuffix }}</span>\n }\n @if (suffixTemplate) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle || titleTemplate) && thyTitlePosition === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle) {\n <span>{{ thyTitle }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate\"></ng-container>\n </div>\n</ng-template>\n" }]
145
- }], propDecorators: { class: [{
146
- type: HostBinding,
147
- args: [`class.thy-statistic`]
148
- }], thyValue: [{
149
- type: Input
150
- }], thyValueStyle: [{
151
- type: Input
152
- }], thyPrefix: [{
153
- type: Input
154
- }], thySuffix: [{
155
- type: Input
156
- }], thyTitle: [{
157
- type: Input
158
- }], thyTitlePosition: [{
159
- type: Input
160
- }], thyShape: [{
161
- type: Input
162
- }], thyColor: [{
163
- type: Input
164
- }], thySize: [{
165
- type: Input
166
- }], thyValueTemplate: [{
167
- type: Input
168
- }], value: [{
169
- type: ContentChild,
170
- args: ['value', { static: true }]
171
- }], thyTitleTemplate: [{
172
- type: Input
173
- }], title: [{
174
- type: ContentChild,
175
- args: ['title', { static: true }]
176
- }], thyPrefixTemplate: [{
177
- type: Input
178
- }], prefix: [{
179
- type: ContentChild,
180
- args: ['prefix', { static: true }]
181
- }], thySuffixTemplate: [{
182
- type: Input
183
- }], suffix: [{
184
- type: ContentChild,
185
- args: ['suffix', { static: true }]
186
- }] } });
148
+ args: [{ selector: 'thy-statistic', imports: [NgTemplateOutlet, NgStyle], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class.thy-statistic]': 'true' }, template: "@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle()\">\n @if (thyPrefix() || prefixTemplate()) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix()) {\n <span>{{ thyPrefix() }}</span>\n }\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate()) {\n <span>{{ thyValue() }}</span>\n }\n @if (valueTemplate()) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate()\"></ng-container>\n }\n </span>\n\n @if (thySuffix() || suffixTemplate()) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix()) {\n <span>{{ thySuffix() }}</span>\n }\n @if (suffixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle()) {\n <span>{{ thyTitle() }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\"></ng-container>\n </div>\n</ng-template>\n" }]
149
+ }], ctorParameters: () => [] });
187
150
 
188
151
  class ThyStatisticModule {
189
152
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStatisticModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-statistic.mjs","sources":["../../../src/statistic/statistic.component.ts","../../../src/statistic/statistic.component.html","../../../src/statistic/statistic.module.ts","../../../src/statistic/ngx-tethys-statistic.ts"],"sourcesContent":["import { OnInit, Component, Input, HostBinding, ElementRef, TemplateRef, ContentChild, inject } from '@angular/core';\nimport { hexToRgb } from 'ngx-tethys/util';\nimport { useHostRenderer } from '@tethys/cdk/dom';\nimport { NgTemplateOutlet, NgStyle } from '@angular/common';\n\nexport type ThyStatisticColorType = 'primary' | 'success' | 'warning' | 'danger' | 'info';\n\nexport type ThyStatisticShape = 'card';\n\nexport type ThyStatisticSizes = 'default';\n\nexport type ThyStatisticTitlePosition = 'top' | 'bottom';\n\n/**\n * 用于展示数据统计\n * @name thy-statistic\n */\n@Component({\n selector: 'thy-statistic',\n templateUrl: './statistic.component.html',\n imports: [NgTemplateOutlet, NgStyle]\n})\nexport class ThyStatistic implements OnInit {\n private elementRef = inject(ElementRef);\n\n _shape: ThyStatisticShape;\n\n _initialized = false;\n\n _size: ThyStatisticSizes;\n\n prefixTemplate: TemplateRef<void>;\n\n suffixTemplate: TemplateRef<void>;\n\n valueTemplate: TemplateRef<void>;\n\n titleTemplate: TemplateRef<void>;\n\n private hostRenderer = useHostRenderer();\n\n @HostBinding(`class.thy-statistic`) class = true;\n\n /**\n * @description 展示数据\n * @type number | string\n */\n @Input() thyValue: number | string;\n\n /**\n * @description 展示数据的 css 样式\n * @type { [key: string]: string; }\n */\n @Input() thyValueStyle: { [key: string]: string } = {};\n\n /**\n * @description 展示数据的前缀\n * @type string\n */\n @Input() thyPrefix: string;\n\n /**\n * @description 展示数据的后缀\n * @type string\n */\n @Input() thySuffix: string;\n\n /**\n * @description 展示数据的标题\n * @type string\n */\n @Input() thyTitle: string;\n\n /**\n * @description 展示数据标题的位置,可设置 `top`|`bottom`\n * @type ThyStatisticTitlePosition\n */\n @Input() thyTitlePosition: ThyStatisticTitlePosition = 'bottom';\n\n /**\n * @description 展示形状\n * @type ThyStatisticShape\n * @default card\n */\n @Input()\n set thyShape(value: ThyStatisticShape) {\n this._shape = value;\n if (this._initialized) {\n this._setClassesByType();\n }\n }\n\n /**\n * @description 主题颜色,可以使用提供的主题色,也可以自定义颜色。 `ThyStatisticColorType` 中包含 `primary` | `success` | `warning` | `danger` | `info`\n * @type ThyStatisticColorType | string\n */\n @Input() thyColor: string | ThyStatisticColorType;\n\n /**\n * @description 前缀和展示数据字体大小\n * @type ThyStatisticSizes\n * @default default\n */\n @Input()\n set thySize(value: ThyStatisticSizes) {\n this._size = value;\n if (this._initialized) {\n this._setClassesByType();\n }\n }\n\n /**\n * @description 自定义展示数据模板\n * @type TemplateRef<void>\n */\n @Input() set thyValueTemplate(value: TemplateRef<void>) {\n this.valueTemplate = value;\n }\n\n /**\n * @description 自定义展示数据模板\n * @type TemplateRef<void>\n */\n @ContentChild('value', { static: true }) set value(value: TemplateRef<void>) {\n this.valueTemplate = value;\n }\n\n /**\n * @description 自定义标题模板\n * @type TemplateRef<void>\n */\n @Input() set thyTitleTemplate(value: TemplateRef<void>) {\n this.titleTemplate = value;\n }\n\n /**\n * @description 自定义标题模板\n * @type TemplateRef<void>\n */\n @ContentChild('title', { static: true }) set title(value: TemplateRef<void>) {\n this.titleTemplate = value;\n }\n\n /**\n * @description 自定义前缀模板\n * @type TemplateRef<void>\n */\n @Input() set thyPrefixTemplate(value: TemplateRef<void>) {\n this.prefixTemplate = value;\n }\n\n /**\n * @description 自定义前缀模板\n * @type TemplateRef<void>\n */\n @ContentChild('prefix', { static: true }) set prefix(value: TemplateRef<void>) {\n this.prefixTemplate = value;\n }\n\n /**\n * @description 自定义后缀模板\n * @type TemplateRef<void>\n */\n @Input() set thySuffixTemplate(value: TemplateRef<void>) {\n this.suffixTemplate = value;\n }\n /**\n * @description 自定义后缀模板\n * @type TemplateRef<void>\n */\n @ContentChild('suffix', { static: true }) set suffix(value: TemplateRef<void>) {\n this.suffixTemplate = value;\n }\n\n ngOnInit() {\n this._setClassesByType();\n this._initialized = true;\n }\n\n setColor(color: string) {\n this.hostRenderer.setStyle('color', color);\n if (this._shape === 'card') {\n this.hostRenderer.setStyle('border-color', color);\n this.hostRenderer.setStyle('background-color', hexToRgb(color, 0.05));\n }\n }\n\n _setClassesByType() {\n const classNames = [];\n if (this.thyColor) {\n if (RegExp(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/).test(this.thyColor)) {\n this.setColor(this.thyColor);\n } else {\n classNames.push(`thy-statistic-${this.thyColor}`);\n }\n }\n if (this._shape) {\n classNames.push(`thy-statistic-${this._shape}`);\n }\n if (!this._size) {\n this._size = 'default';\n }\n classNames.push(`thy-statistic-${this._size}`);\n\n this.hostRenderer.setStyle('font-size', this.thySize);\n this.hostRenderer.updateClass(classNames);\n }\n}\n","@if ((thyTitle || titleTemplate) && thyTitlePosition === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle\">\n @if (thyPrefix || prefixTemplate) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix) {\n <span>{{ thyPrefix }}</span>\n }\n @if (prefixTemplate) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate) {\n <span>{{ thyValue }}</span>\n }\n @if (valueTemplate) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate\"></ng-container>\n }\n </span>\n\n @if (thySuffix || suffixTemplate) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix) {\n <span>{{ thySuffix }}</span>\n }\n @if (suffixTemplate) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle || titleTemplate) && thyTitlePosition === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle) {\n <span>{{ thyTitle }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate\"></ng-container>\n </div>\n</ng-template>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyStatistic } from './statistic.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyIconModule, ThyStatistic],\n exports: [ThyStatistic],\n providers: []\n})\nexport class ThyStatisticModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;;;AAGG;MAMU,YAAY,CAAA;AALzB,IAAA,WAAA,GAAA;AAMY,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAIvC,IAAY,CAAA,YAAA,GAAG,KAAK;QAYZ,IAAY,CAAA,YAAA,GAAG,eAAe,EAAE;QAEJ,IAAK,CAAA,KAAA,GAAG,IAAI;AAQhD;;;AAGG;QACM,IAAa,CAAA,aAAA,GAA8B,EAAE;AAoBtD;;;AAGG;QACM,IAAgB,CAAA,gBAAA,GAA8B,QAAQ;AAkIlE;AAhIG;;;;AAIG;IACH,IACI,QAAQ,CAAC,KAAwB,EAAA;AACjC,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;AACnB,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,iBAAiB,EAAE;;;AAUhC;;;;AAIG;IACH,IACI,OAAO,CAAC,KAAwB,EAAA;AAChC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,iBAAiB,EAAE;;;AAIhC;;;AAGG;IACH,IAAa,gBAAgB,CAAC,KAAwB,EAAA;AAClD,QAAA,IAAI,CAAC,aAAa,GAAG,KAAK;;AAG9B;;;AAGG;IACH,IAA6C,KAAK,CAAC,KAAwB,EAAA;AACvE,QAAA,IAAI,CAAC,aAAa,GAAG,KAAK;;AAG9B;;;AAGG;IACH,IAAa,gBAAgB,CAAC,KAAwB,EAAA;AAClD,QAAA,IAAI,CAAC,aAAa,GAAG,KAAK;;AAG9B;;;AAGG;IACH,IAA6C,KAAK,CAAC,KAAwB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;;2FAI7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,CAAC;oBACrE,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-statistic.mjs","sources":["../../../src/statistic/statistic.component.ts","../../../src/statistic/statistic.component.html","../../../src/statistic/statistic.module.ts","../../../src/statistic/ngx-tethys-statistic.ts"],"sourcesContent":["import { Component, TemplateRef, ChangeDetectionStrategy, input, contentChild, effect, computed } from '@angular/core';\nimport { hexToRgb } from 'ngx-tethys/util';\nimport { useHostRenderer } from '@tethys/cdk/dom';\nimport { NgTemplateOutlet, NgStyle } from '@angular/common';\n\nexport type ThyStatisticColorType = 'primary' | 'success' | 'warning' | 'danger' | 'info';\n\nexport type ThyStatisticShape = 'card';\n\nexport type ThyStatisticSizes = 'default';\n\nexport type ThyStatisticTitlePosition = 'top' | 'bottom';\n\n/**\n * 用于展示数据统计\n * @name thy-statistic\n */\n@Component({\n selector: 'thy-statistic',\n templateUrl: './statistic.component.html',\n imports: [NgTemplateOutlet, NgStyle],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.thy-statistic]': 'true' }\n})\nexport class ThyStatistic {\n /**\n * @description 展示数据\n * @type number | string\n */\n readonly thyValue = input<number | string>();\n\n /**\n * @description 展示数据的 css 样式\n * @type { [key: string]: string; }\n */\n readonly thyValueStyle = input<{ [key: string]: string }>({});\n\n /**\n * @description 展示数据的前缀\n * @type string\n */\n readonly thyPrefix = input<string>();\n\n /**\n * @description 展示数据的后缀\n * @type string\n */\n readonly thySuffix = input<string>();\n\n /**\n * @description 展示数据的标题\n * @type string\n */\n readonly thyTitle = input<string>();\n\n /**\n * @description 展示数据标题的位置,可设置 `top`|`bottom`\n * @type ThyStatisticTitlePosition\n */\n readonly thyTitlePosition = input<ThyStatisticTitlePosition>('bottom');\n\n /**\n * @description 展示形状\n * @type ThyStatisticShape\n * @default card\n */\n readonly thyShape = input<ThyStatisticShape>();\n\n /**\n * @description 主题颜色,可以使用提供的主题色,也可以自定义颜色。 `ThyStatisticColorType` 中包含 `primary` | `success` | `warning` | `danger` | `info`\n * @type ThyStatisticColorType | string\n */\n readonly thyColor = input<string | ThyStatisticColorType>();\n\n /**\n * @description 前缀和展示数据字体大小\n * @type ThyStatisticSizes\n * @default default\n */\n readonly thySize = input<ThyStatisticSizes>('default');\n\n /**\n * @description 自定义展示数据模板\n * @type TemplateRef<void>\n */\n readonly thyValueTemplate = input<TemplateRef<void>>();\n\n /**\n * @description 自定义标题模板\n * @type TemplateRef<void>\n */\n readonly thyTitleTemplate = input<TemplateRef<void>>();\n\n /**\n * @description 自定义前缀模板\n * @type TemplateRef<void>\n */\n readonly thyPrefixTemplate = input<TemplateRef<void>>();\n\n /**\n * @description 自定义后缀模板\n * @type TemplateRef<void>\n */\n readonly thySuffixTemplate = input<TemplateRef<void>>();\n\n /**\n * @description 自定义展示数据模板\n * @type TemplateRef<void>\n */\n readonly contentValueTemplate = contentChild<TemplateRef<void>>('value');\n\n /**\n * @description 自定义标题模板\n * @type TemplateRef<void>\n */\n readonly contentTitleTemplate = contentChild<TemplateRef<void>>('title');\n\n /**\n * @description 自定义前缀模板\n * @type TemplateRef<void>\n */\n readonly contentPrefixTemplate = contentChild<TemplateRef<void>>('prefix');\n\n /**\n * @description 自定义后缀模板\n * @type TemplateRef<void>\n */\n readonly contentSuffixTemplate = contentChild<TemplateRef<void>>('suffix');\n\n readonly valueTemplate = computed(() => {\n return this.thyValueTemplate() || this.contentValueTemplate();\n });\n\n readonly titleTemplate = computed(() => {\n return this.thyTitleTemplate() || this.contentTitleTemplate();\n });\n\n readonly prefixTemplate = computed(() => {\n return this.thyPrefixTemplate() || this.contentPrefixTemplate();\n });\n\n readonly suffixTemplate = computed(() => {\n return this.thySuffixTemplate() || this.contentSuffixTemplate();\n });\n\n private hostRenderer = useHostRenderer();\n\n constructor() {\n effect(() => {\n this.setClassesByType();\n });\n }\n\n private setClassesByType() {\n const classNames = [];\n if (this.thyColor()) {\n if (RegExp(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/).test(this.thyColor())) {\n this.setColor(this.thyColor());\n } else {\n classNames.push(`thy-statistic-${this.thyColor()}`);\n }\n }\n if (this.thyShape()) {\n classNames.push(`thy-statistic-${this.thyShape()}`);\n }\n classNames.push(`thy-statistic-${this.thySize()}`);\n\n this.hostRenderer.setStyle('font-size', this.thySize());\n this.hostRenderer.updateClass(classNames);\n }\n\n private setColor(color: string) {\n this.hostRenderer.setStyle('color', color);\n if (this.thyShape() === 'card') {\n this.hostRenderer.setStyle('border-color', color);\n this.hostRenderer.setStyle('background-color', hexToRgb(color, 0.05));\n }\n }\n}\n","@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n<div class=\"thy-statistic-content\" [ngStyle]=\"thyValueStyle()\">\n @if (thyPrefix() || prefixTemplate()) {\n <span class=\"thy-statistic-content-prefix\">\n @if (thyPrefix()) {\n <span>{{ thyPrefix() }}</span>\n }\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n </span>\n }\n\n <span class=\"thy-statistic-content-value\">\n @if (!valueTemplate()) {\n <span>{{ thyValue() }}</span>\n }\n @if (valueTemplate()) {\n <ng-container [ngTemplateOutlet]=\"valueTemplate()\"></ng-container>\n }\n </span>\n\n @if (thySuffix() || suffixTemplate()) {\n <span class=\"thy-statistic-content-suffix\">\n @if (thySuffix()) {\n <span>{{ thySuffix() }}</span>\n }\n @if (suffixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n }\n </span>\n }\n</div>\n@if ((thyTitle() || titleTemplate()) && thyTitlePosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"title\"></ng-container>\n}\n\n<ng-template #title>\n <div class=\"thy-statistic-title\">\n @if (thyTitle()) {\n <span>{{ thyTitle() }}</span>\n }\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\"></ng-container>\n </div>\n</ng-template>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyStatistic } from './statistic.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyIconModule, ThyStatistic],\n exports: [ThyStatistic],\n providers: []\n})\nexport class ThyStatisticModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;;;AAGG;MAQU,YAAY,CAAA;AA2HrB,IAAA,WAAA,GAAA;AA1HA;;;AAGG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAmB;AAE5C;;;AAGG;AACM,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAA4B,EAAE,CAAC;AAE7D;;;AAGG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,EAAU;AAEpC;;;AAGG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,EAAU;AAEpC;;;AAGG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;AAEnC;;;AAGG;AACM,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA4B,QAAQ,CAAC;AAEtE;;;;AAIG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAqB;AAE9C;;;AAGG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAkC;AAE3D;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAoB,SAAS,CAAC;AAEtD;;;AAGG;QACM,IAAgB,CAAA,gBAAA,GAAG,KAAK,EAAqB;AAEtD;;;AAGG;QACM,IAAgB,CAAA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