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,6 +1,6 @@
1
1
  import { isThemeColor } from 'ngx-tethys/core';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, Renderer2, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
3
+ import { inject, ElementRef, Renderer2, input, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
4
4
  import { CommonModule } from '@angular/common';
5
5
 
6
6
  const COMPONENT_CLASS_NAME = 'thy-dot';
@@ -17,68 +17,53 @@ class ThyDot {
17
17
  constructor() {
18
18
  this.el = inject(ElementRef);
19
19
  this.renderer = inject(Renderer2);
20
- this.size = DEFAULT_SIZE_NAME;
21
- this.theme = DEFAULT_THEME_NAME;
22
- this.shape = DEFAULT_SHAPE_NAME;
23
- this.color = DEFAULT_COLOR_NAME;
20
+ /**
21
+ * 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`
22
+ * @type ThyThemeColor | string
23
+ */
24
+ this.thyColor = input(DEFAULT_COLOR_NAME, {
25
+ transform: (value) => value || DEFAULT_COLOR_NAME
26
+ });
27
+ /**
28
+ * 大小
29
+ * @type xs | sm | md | lg | xlg
30
+ */
31
+ this.thySize = input(DEFAULT_SIZE_NAME, {
32
+ transform: (value) => value || DEFAULT_SIZE_NAME
33
+ });
34
+ /**
35
+ * 主题
36
+ * @type outline(线框) | fill(填充)
37
+ */
38
+ this.thyTheme = input(DEFAULT_THEME_NAME, {
39
+ transform: (value) => value || DEFAULT_THEME_NAME
40
+ });
41
+ /**
42
+ * 形状
43
+ * @type circle(圆形) | square(方形)
44
+ */
45
+ this.thyShape = input(DEFAULT_SHAPE_NAME, {
46
+ transform: (value) => value || DEFAULT_SHAPE_NAME
47
+ });
24
48
  this.nativeElement = this.el.nativeElement;
25
- this.updateColorStyle();
26
- }
27
- /**
28
- * 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`
29
- * @type ThyThemeColor | string
30
- * @default primary
31
- */
32
- set thyColor(value) {
33
- if (value) {
34
- this.color = value;
49
+ effect(() => {
35
50
  this.updateColorStyle();
36
- }
37
- }
38
- /**
39
- * 大小
40
- * @type xs | sm | md | lg | xlg
41
- * @default sm
42
- */
43
- set thySize(value) {
44
- if (value) {
45
- this.size = value;
46
- }
47
- }
48
- /**
49
- * 主题
50
- * @type outline(线框) | fill(填充)
51
- * @default fill
52
- */
53
- set thyTheme(value) {
54
- if (value) {
55
- this.theme = value;
56
- }
57
- }
58
- /**
59
- * 形状
60
- * @type circle(圆形) | square(方形)
61
- * @default circle
62
- */
63
- set thyShape(value) {
64
- if (value) {
65
- this.shape = value;
66
- }
51
+ });
67
52
  }
68
53
  updateColorStyle() {
69
54
  Array.from(this.nativeElement.classList)
70
55
  .filter(it => /^dot-color-[\w]+$/.test(it))
71
56
  .forEach(it => this.renderer.removeClass(this.nativeElement, it));
72
- if (isThemeColor(this.color)) {
57
+ if (isThemeColor(this.thyColor())) {
73
58
  this.renderer.setStyle(this.nativeElement, 'borderColor', 'none');
74
- this.renderer.addClass(this.nativeElement, `dot-color-${this.color}`);
59
+ this.renderer.addClass(this.nativeElement, `dot-color-${this.thyColor()}`);
75
60
  }
76
61
  else {
77
- this.renderer.setStyle(this.nativeElement, 'borderColor', this.color);
62
+ this.renderer.setStyle(this.nativeElement, 'borderColor', this.thyColor());
78
63
  }
79
64
  }
80
65
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
81
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyDot, isStandalone: true, selector: "thy-dot,[thy-dot],[thyDot]", inputs: { thyColor: "thyColor", thySize: "thySize", thyTheme: "thyTheme", thyShape: "thyShape" }, host: { properties: { "class.dot-theme-fill": "theme === \"fill\"", "class.dot-theme-outline": "theme === \"outline\"", "class.dot-shape-square": "shape === \"square\"", "class.dot-shape-circle": "shape === \"circle\"", "class.dot-size-md": "size === \"md\"", "class.dot-size-sm": "size === \"sm\"", "class.dot-size-xs": "size === \"xs\"", "class.dot-size-lg": "size === \"lg\"", "class.dot-size-xlg": "size === \"xlg\"" }, classAttribute: "thy-dot" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
66
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyDot, isStandalone: true, selector: "thy-dot,[thy-dot],[thyDot]", inputs: { thyColor: { classPropertyName: "thyColor", publicName: "thyColor", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyTheme: { classPropertyName: "thyTheme", publicName: "thyTheme", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dot-theme-fill": "thyTheme() === \"fill\"", "class.dot-theme-outline": "thyTheme() === \"outline\"", "class.dot-shape-square": "thyShape() === \"square\"", "class.dot-shape-circle": "thyShape() === \"circle\"", "class.dot-size-md": "thySize() === \"md\"", "class.dot-size-sm": "thySize() === \"sm\"", "class.dot-size-xs": "thySize() === \"xs\"", "class.dot-size-lg": "thySize() === \"lg\"", "class.dot-size-xlg": "thySize() === \"xlg\"" }, classAttribute: "thy-dot" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
82
67
  }
83
68
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDot, decorators: [{
84
69
  type: Component,
@@ -89,26 +74,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
89
74
  changeDetection: ChangeDetectionStrategy.OnPush,
90
75
  host: {
91
76
  class: 'thy-dot',
92
- '[class.dot-theme-fill]': 'theme === "fill"',
93
- '[class.dot-theme-outline]': 'theme === "outline"',
94
- '[class.dot-shape-square]': 'shape === "square"',
95
- '[class.dot-shape-circle]': 'shape === "circle"',
96
- '[class.dot-size-md]': 'size === "md"',
97
- '[class.dot-size-sm]': 'size === "sm"',
98
- '[class.dot-size-xs]': 'size === "xs"',
99
- '[class.dot-size-lg]': 'size === "lg"',
100
- '[class.dot-size-xlg]': 'size === "xlg"'
77
+ '[class.dot-theme-fill]': 'thyTheme() === "fill"',
78
+ '[class.dot-theme-outline]': 'thyTheme() === "outline"',
79
+ '[class.dot-shape-square]': 'thyShape() === "square"',
80
+ '[class.dot-shape-circle]': 'thyShape() === "circle"',
81
+ '[class.dot-size-md]': 'thySize() === "md"',
82
+ '[class.dot-size-sm]': 'thySize() === "sm"',
83
+ '[class.dot-size-xs]': 'thySize() === "xs"',
84
+ '[class.dot-size-lg]': 'thySize() === "lg"',
85
+ '[class.dot-size-xlg]': 'thySize() === "xlg"'
101
86
  }
102
87
  }]
103
- }], ctorParameters: () => [], propDecorators: { thyColor: [{
104
- type: Input
105
- }], thySize: [{
106
- type: Input
107
- }], thyTheme: [{
108
- type: Input
109
- }], thyShape: [{
110
- type: Input
111
- }] } });
88
+ }], ctorParameters: () => [] });
112
89
 
113
90
  class ThyDotModule {
114
91
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDotModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-dot.mjs","sources":["../../../src/dot/dot.component.ts","../../../src/dot/dot.module.ts","../../../src/dot/ngx-tethys-dot.ts"],"sourcesContent":["import { isThemeColor, ThyThemeColor } from 'ngx-tethys/core';\n\nimport { ChangeDetectionStrategy, Component, ElementRef, Input, Renderer2, ViewEncapsulation, inject } from '@angular/core';\n\nexport type ThyColorType = ThyThemeColor | string;\nexport type ThySizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xlg';\nexport type ThyThemeType = 'outline' | 'fill';\nexport type ThyShapeType = 'square' | 'circle';\n\nexport const COMPONENT_CLASS_NAME = 'thy-dot';\n\nexport const DEFAULT_COLOR_NAME = 'primary';\nexport const DEFAULT_SIZE_NAME = 'sm';\nexport const DEFAULT_THEME_NAME = 'fill';\nexport const DEFAULT_SHAPE_NAME = 'circle';\n\n/**\n * 显示一个点的组件\n * @name thy-dot,[thy-dot],[thyDot]\n * @order 10\n */\n@Component({\n selector: 'thy-dot,[thy-dot],[thyDot]',\n template: '',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-dot',\n '[class.dot-theme-fill]': 'theme === \"fill\"',\n '[class.dot-theme-outline]': 'theme === \"outline\"',\n '[class.dot-shape-square]': 'shape === \"square\"',\n '[class.dot-shape-circle]': 'shape === \"circle\"',\n '[class.dot-size-md]': 'size === \"md\"',\n '[class.dot-size-sm]': 'size === \"sm\"',\n '[class.dot-size-xs]': 'size === \"xs\"',\n '[class.dot-size-lg]': 'size === \"lg\"',\n '[class.dot-size-xlg]': 'size === \"xlg\"'\n }\n})\nexport class ThyDot {\n private el = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n public size: ThySizeType = DEFAULT_SIZE_NAME;\n public theme: ThyThemeType = DEFAULT_THEME_NAME;\n public shape: ThyShapeType = DEFAULT_SHAPE_NAME;\n public color: ThyColorType = DEFAULT_COLOR_NAME;\n private nativeElement: HTMLElement;\n constructor() {\n this.nativeElement = this.el.nativeElement;\n this.updateColorStyle();\n }\n\n /**\n * 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`\n * @type ThyThemeColor | string\n * @default primary\n */\n @Input()\n set thyColor(value: ThyColorType) {\n if (value) {\n this.color = value;\n this.updateColorStyle();\n }\n }\n\n /**\n * 大小\n * @type xs | sm | md | lg | xlg\n * @default sm\n */\n @Input()\n set thySize(value: ThySizeType) {\n if (value) {\n this.size = value;\n }\n }\n\n /**\n * 主题\n * @type outline(线框) | fill(填充)\n * @default fill\n */\n @Input()\n set thyTheme(value: ThyThemeType) {\n if (value) {\n this.theme = value;\n }\n }\n\n /**\n * 形状\n * @type circle(圆形) | square(方形)\n * @default circle\n */\n @Input()\n set thyShape(value: ThyShapeType) {\n if (value) {\n this.shape = value;\n }\n }\n\n updateColorStyle() {\n Array.from(this.nativeElement.classList)\n .filter(it => /^dot-color-[\\w]+$/.test(it))\n .forEach(it => this.renderer.removeClass(this.nativeElement, it));\n\n if (isThemeColor(this.color)) {\n this.renderer.setStyle(this.nativeElement, 'borderColor', 'none');\n this.renderer.addClass(this.nativeElement, `dot-color-${this.color}`);\n } else {\n this.renderer.setStyle(this.nativeElement, 'borderColor', this.color);\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThyDot } from './dot.component';\n\n@NgModule({\n imports: [CommonModule, ThyDot],\n exports: [ThyDot]\n})\nexport class ThyDotModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASO,MAAM,oBAAoB,GAAG;AAE7B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,kBAAkB,GAAG;AAElC;;;;AAIG;MAmBU,MAAM,CAAA;AASf,IAAA,WAAA,GAAA;AARQ,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;QAE7B,IAAI,CAAA,IAAA,GAAgB,iBAAiB;QACrC,IAAK,CAAA,KAAA,GAAiB,kBAAkB;QACxC,IAAK,CAAA,KAAA,GAAiB,kBAAkB;QACxC,IAAK,CAAA,KAAA,GAAiB,kBAAkB;QAG3C,IAAI,CAAC,aAAa,GAAG,IAAI,C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EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAZ,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,YAAY,EAHX,OAAA,EAAA,CAAA,YAAY,EAAE,MAAM,aACpB,MAAM,CAAA,EAAA,CAAA,CAAA;AAEP,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,YAAY,YAHX,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGb,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;oBAC/B,OAAO,EAAE,CAAC,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-dot.mjs","sources":["../../../src/dot/dot.component.ts","../../../src/dot/dot.module.ts","../../../src/dot/ngx-tethys-dot.ts"],"sourcesContent":["import { isThemeColor, ThyThemeColor } from 'ngx-tethys/core';\n\nimport { ChangeDetectionStrategy, Component, ElementRef, Renderer2, ViewEncapsulation, effect, inject, input } from '@angular/core';\n\nexport type ThyColorType = ThyThemeColor | string;\nexport type ThySizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xlg';\nexport type ThyThemeType = 'outline' | 'fill';\nexport type ThyShapeType = 'square' | 'circle';\n\nexport const COMPONENT_CLASS_NAME = 'thy-dot';\n\nexport const DEFAULT_COLOR_NAME = 'primary';\nexport const DEFAULT_SIZE_NAME = 'sm';\nexport const DEFAULT_THEME_NAME = 'fill';\nexport const DEFAULT_SHAPE_NAME = 'circle';\n\n/**\n * 显示一个点的组件\n * @name thy-dot,[thy-dot],[thyDot]\n * @order 10\n */\n@Component({\n selector: 'thy-dot,[thy-dot],[thyDot]',\n template: '',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-dot',\n '[class.dot-theme-fill]': 'thyTheme() === \"fill\"',\n '[class.dot-theme-outline]': 'thyTheme() === \"outline\"',\n '[class.dot-shape-square]': 'thyShape() === \"square\"',\n '[class.dot-shape-circle]': 'thyShape() === \"circle\"',\n '[class.dot-size-md]': 'thySize() === \"md\"',\n '[class.dot-size-sm]': 'thySize() === \"sm\"',\n '[class.dot-size-xs]': 'thySize() === \"xs\"',\n '[class.dot-size-lg]': 'thySize() === \"lg\"',\n '[class.dot-size-xlg]': 'thySize() === \"xlg\"'\n }\n})\nexport class ThyDot {\n private el = inject(ElementRef);\n private renderer = inject(Renderer2);\n private nativeElement: HTMLElement;\n\n constructor() {\n this.nativeElement = this.el.nativeElement;\n\n effect(() => {\n this.updateColorStyle();\n });\n }\n\n /**\n * 颜色,可选值为:`primary` `success` `info` `warning` `danger` `default` `light`和自定义颜色,如`#2cccda` `red` `rgb(153, 153, 153)`\n * @type ThyThemeColor | string\n */\n readonly thyColor = input<ThyColorType, ThyColorType>(DEFAULT_COLOR_NAME, {\n transform: (value: ThyColorType) => value || DEFAULT_COLOR_NAME\n });\n\n /**\n * 大小\n * @type xs | sm | md | lg | xlg\n */\n readonly thySize = input<ThySizeType, ThySizeType>(DEFAULT_SIZE_NAME, {\n transform: (value: ThySizeType) => value || DEFAULT_SIZE_NAME\n });\n\n /**\n * 主题\n * @type outline(线框) | fill(填充)\n */\n readonly thyTheme = input<ThyThemeType, ThyThemeType>(DEFAULT_THEME_NAME, {\n transform: (value: ThyThemeType) => value || DEFAULT_THEME_NAME\n });\n\n /**\n * 形状\n * @type circle(圆形) | square(方形)\n */\n readonly thyShape = input<ThyShapeType, ThyShapeType>(DEFAULT_SHAPE_NAME, {\n transform: (value: ThyShapeType) => value || DEFAULT_SHAPE_NAME\n });\n\n updateColorStyle() {\n Array.from(this.nativeElement.classList)\n .filter(it => /^dot-color-[\\w]+$/.test(it))\n .forEach(it => this.renderer.removeClass(this.nativeElement, it));\n\n if (isThemeColor(this.thyColor())) {\n this.renderer.setStyle(this.nativeElement, 'borderColor', 'none');\n this.renderer.addClass(this.nativeElement, `dot-color-${this.thyColor()}`);\n } else {\n this.renderer.setStyle(this.nativeElement, 'borderColor', this.thyColor());\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThyDot } from './dot.component';\n\n@NgModule({\n imports: [CommonModule, ThyDot],\n exports: [ThyDot]\n})\nexport class ThyDotModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASO,MAAM,oBAAoB,GAAG;AAE7B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,kBAAkB,GAAG;AAElC;;;;AAIG;MAmBU,MAAM,CAAA;AAKf,IAAA,WAAA,GAAA;AAJQ,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAWpC;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAA6B,kBAAkB,EAAE;YACtE,SAAS,EAAE,CAAC,KAAmB,KAAK,KAAK,IAAI;AAChD,SAAA,CAAC;AAEF;;;AAGG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA2B,iBAAiB,EAAE;YAClE,SAAS,EAAE,CAAC,KAAkB,KAAK,KAAK,IAAI;AAC/C,SAAA,CAAC;AAEF;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAA6B,kBAAkB,EAAE;YACtE,SAAS,EAAE,CAAC,KA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AA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAHX,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGb,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;oBAC/B,OAAO,EAAE,CAAC,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
@@ -2,12 +2,12 @@ import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
2
2
  import { ThySharedModule } from 'ngx-tethys/shared';
3
3
  import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { Injectable, inject, ElementRef, NgZone, ContentChild, Input, Component, NgModule } from '@angular/core';
6
- import { ThyTranslate } from 'ngx-tethys/core';
5
+ import { Injectable, inject, ElementRef, NgZone, input, contentChild, computed, effect, Component, NgModule } from '@angular/core';
7
6
  import { useHostRenderer } from '@tethys/cdk/dom';
7
+ import { ThyTranslate } from 'ngx-tethys/core';
8
8
  import { DomSanitizer } from '@angular/platform-browser';
9
- import { coerceBooleanProperty } from 'ngx-tethys/util';
10
9
  import { injectLocale } from 'ngx-tethys/i18n';
10
+ import { coerceBooleanProperty } from 'ngx-tethys/util';
11
11
 
12
12
  /**
13
13
  * @deprecated
@@ -266,51 +266,109 @@ class ThyEmpty {
266
266
  this.ngZone = inject(NgZone);
267
267
  this.sanitizer = inject(DomSanitizer);
268
268
  this.locale = injectLocale('empty');
269
- this.size = 'md';
270
- this._initialized = false;
269
+ /**
270
+ * 显示文本提示信息。同时传入 thyMessage,thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
271
+ * @default 暂无数据
272
+ */
273
+ this.thyMessage = input();
274
+ /**
275
+ * 已废弃。显示文本提示信息多语言 Key。同时传入 thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
276
+ * @deprecated
277
+ */
278
+ this.thyTranslationKey = input();
279
+ /**
280
+ * 已废弃。显示文本提示信息多语言 Key 的 Values。传入 thyTranslationKey 后,传入这个才会生效
281
+ * @deprecated
282
+ */
283
+ this.thyTranslationValues = input();
284
+ /**
285
+ * 已废弃。显示默认提示信息,替换默认提示信息的目标对象,比如:没有 {thyEntityName}。同时传入 thyEntityName,thyEntityNameTranslateKey 时优先级较高
286
+ * @deprecated
287
+ */
288
+ this.thyEntityName = input();
289
+ /**
290
+ * 已废弃。thyEntityName 的多语言 Key。thyMessage,thyTranslationKey,thyEntityName 均未传入时才会生效
291
+ * @deprecated
292
+ */
293
+ this.thyEntityNameTranslateKey = input();
294
+ /**
295
+ * 提示图标名
296
+ */
297
+ this.thyIconName = input();
298
+ /**
299
+ * 大小
300
+ * @type sm | md | lg
301
+ * @default md
302
+ */
303
+ this.thySize = input('md');
304
+ /**
305
+ * 距上距离
306
+ */
307
+ this.thyMarginTop = input();
308
+ /**
309
+ * 是否自动根据父容器计算高度,垂直居中
310
+ * @default false
311
+ */
312
+ this.thyTopAuto = input(false, { transform: coerceBooleanProperty });
313
+ /**
314
+ * 自动计算高度垂直居中(即 thyTopAuto 为 true)时,支持传入自定义父容器
315
+ */
316
+ this.thyContainer = input();
317
+ /**
318
+ * 提示图片链接
319
+ */
320
+ this.thyImageUrl = input();
321
+ this.thyImageLoading = input();
322
+ this.thyImageFetchPriority = input();
323
+ /**
324
+ * 显示文本描述
325
+ */
326
+ this.thyDescription = input();
271
327
  this.hostRenderer = useHostRenderer();
272
- }
273
- /**
274
- * 大小
275
- * @type sm | md | lg
276
- * @default md
277
- */
278
- set thySize(value) {
279
- this.size = value;
280
- if (this._initialized) {
328
+ /**
329
+ * 除提示图片,文本外的其他信息传入模板
330
+ * @type TemplateRef
331
+ */
332
+ this.extraTemplateRef = contentChild('extra');
333
+ this.presetSvg = computed(() => {
334
+ let presetSvg = this.thyIconName() ? PRESET_SVG[this.thyIconName()] : PRESET_SVG.default;
335
+ return presetSvg ? this.sanitizer.bypassSecurityTrustHtml(presetSvg) : '';
336
+ });
337
+ this.displayText = computed(() => {
338
+ if (this.thyMessage()) {
339
+ return this.thyMessage();
340
+ }
341
+ else if (this.thyTranslationKey()) {
342
+ return this.thyTranslate.instant(this.thyTranslationKey(), this.thyTranslationValues());
343
+ }
344
+ else if (this.thyEntityName()) {
345
+ return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
346
+ target: this.thyEntityName()
347
+ });
348
+ }
349
+ else if (this.thyEntityNameTranslateKey()) {
350
+ return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
351
+ target: this.thyTranslate.instant(this.thyEntityNameTranslateKey())
352
+ });
353
+ }
354
+ else if (this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey) !== 'common.tips.NO_RESULT') {
355
+ return this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey);
356
+ }
357
+ else {
358
+ return this.locale().noDataText;
359
+ }
360
+ });
361
+ effect(() => {
281
362
  this.updateClass();
282
- }
283
- }
284
- get displayText() {
285
- if (this.thyMessage) {
286
- return this.thyMessage;
287
- }
288
- else if (this.thyTranslationKey) {
289
- return this.thyTranslate.instant(this.thyTranslationKey, this.thyTranslationValues);
290
- }
291
- else if (this.thyEntityName) {
292
- return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
293
- target: this.thyEntityName
294
- });
295
- }
296
- else if (this.thyEntityNameTranslateKey) {
297
- return this.thyTranslate.instant(this.thyEmptyConfig.noResultWithTargetTranslateKey, {
298
- target: this.thyTranslate.instant(this.thyEntityNameTranslateKey)
299
- });
300
- }
301
- else if (this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey) !== 'common.tips.NO_RESULT') {
302
- return this.thyTranslate.instant(this.thyEmptyConfig.noResultTranslateKey);
303
- }
304
- else {
305
- return this.locale().noDataText;
306
- }
363
+ });
307
364
  }
308
365
  _calculatePosition() {
309
- const sizeOptions = sizeMap[this.thySize || 'md'];
366
+ const sizeOptions = sizeMap[this.thySize() || 'md'];
310
367
  let marginTop = null;
311
- if (this.thyTopAuto) {
368
+ if (this.thyTopAuto()) {
312
369
  // 选择参考父容器居中
313
- const containerElement = this.thyContainer ? this.thyContainer.nativeElement : this.elementRef.nativeElement.parentElement;
370
+ const thyContainer = this.thyContainer();
371
+ const containerElement = thyContainer ? thyContainer.nativeElement : this.elementRef.nativeElement.parentElement;
314
372
  // containerElement.height;
315
373
  let emptyStateHeight = this.elementRef.nativeElement.offsetHeight;
316
374
  // 高度没有自动计算出来使用默认值
@@ -324,8 +382,9 @@ class ThyEmpty {
324
382
  }
325
383
  }
326
384
  else {
327
- if (this.thyMarginTop) {
328
- marginTop = this.thyMarginTop;
385
+ const thyMarginTop = this.thyMarginTop();
386
+ if (thyMarginTop) {
387
+ marginTop = thyMarginTop;
329
388
  }
330
389
  else {
331
390
  marginTop = 0; // sizeOptions.defaultMarginTop;
@@ -335,13 +394,8 @@ class ThyEmpty {
335
394
  this.hostRenderer.setStyle('marginTop', marginTop + 'px');
336
395
  }
337
396
  }
338
- ngOnInit() {
339
- this.updateClass();
340
- this._initialized = true;
341
- this.setPresetSvg(this.thyIconName);
342
- }
343
397
  updateClass() {
344
- const classList = sizeClassMap[this.size] || sizeClassMap['md'];
398
+ const classList = sizeClassMap[this.thySize() || 'md'];
345
399
  if (classList) {
346
400
  this.hostRenderer.updateClass(classList);
347
401
  }
@@ -353,55 +407,13 @@ class ThyEmpty {
353
407
  }, 50);
354
408
  });
355
409
  }
356
- ngOnChanges(changes) {
357
- if (changes.thyIconName && changes.thyIconName.currentValue && !changes.thyIconName.firstChange) {
358
- this.setPresetSvg(changes.thyIconName.currentValue);
359
- }
360
- }
361
- setPresetSvg(icon) {
362
- this.presetSvg = '';
363
- let presetSvg = icon ? PRESET_SVG[icon] : PRESET_SVG.default;
364
- this.presetSvg = presetSvg ? this.sanitizer.bypassSecurityTrustHtml(presetSvg) : '';
365
- }
366
410
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmpty, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
367
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyEmpty, isStandalone: true, selector: "thy-empty", inputs: { thyMessage: "thyMessage", thyTranslationKey: "thyTranslationKey", thyTranslationValues: "thyTranslationValues", thyEntityName: "thyEntityName", thyEntityNameTranslateKey: "thyEntityNameTranslateKey", thyIconName: "thyIconName", thySize: "thySize", thyMarginTop: "thyMarginTop", thyTopAuto: ["thyTopAuto", "thyTopAuto", coerceBooleanProperty], thyContainer: "thyContainer", thyImageUrl: "thyImageUrl", thyImageLoading: "thyImageLoading", thyImageFetchPriority: "thyImageFetchPriority", thyDescription: "thyDescription" }, queries: [{ propertyName: "extraTemplateRef", first: true, predicate: ["extra"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl) {\n <img\n [src]=\"thyImageUrl\"\n [attr.loading]=\"thyImageLoading\"\n [attr.fetchpriority]=\"thyImageFetchPriority\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg) {\n <div [innerHTML]=\"presetSvg\"></div>\n } @else {\n @if (thyIconName) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription, 'thy-empty-text-with-extra': thyDescription }\">\n {{ displayText }}\n</div>\n\n@if (thyDescription) {\n <div class=\"thy-empty-description\">\n {{ thyDescription }}\n </div>\n}\n\n@if (extraTemplateRef) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef\"></ng-template>\n </div>\n}\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
411
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyEmpty, isStandalone: true, selector: "thy-empty", inputs: { thyMessage: { classPropertyName: "thyMessage", publicName: "thyMessage", isSignal: true, isRequired: false, transformFunction: null }, thyTranslationKey: { classPropertyName: "thyTranslationKey", publicName: "thyTranslationKey", isSignal: true, isRequired: false, transformFunction: null }, thyTranslationValues: { classPropertyName: "thyTranslationValues", publicName: "thyTranslationValues", isSignal: true, isRequired: false, transformFunction: null }, thyEntityName: { classPropertyName: "thyEntityName", publicName: "thyEntityName", isSignal: true, isRequired: false, transformFunction: null }, thyEntityNameTranslateKey: { classPropertyName: "thyEntityNameTranslateKey", publicName: "thyEntityNameTranslateKey", isSignal: true, isRequired: false, transformFunction: null }, thyIconName: { classPropertyName: "thyIconName", publicName: "thyIconName", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyMarginTop: { classPropertyName: "thyMarginTop", publicName: "thyMarginTop", isSignal: true, isRequired: false, transformFunction: null }, thyTopAuto: { classPropertyName: "thyTopAuto", publicName: "thyTopAuto", isSignal: true, isRequired: false, transformFunction: null }, thyContainer: { classPropertyName: "thyContainer", publicName: "thyContainer", isSignal: true, isRequired: false, transformFunction: null }, thyImageUrl: { classPropertyName: "thyImageUrl", publicName: "thyImageUrl", isSignal: true, isRequired: false, transformFunction: null }, thyImageLoading: { classPropertyName: "thyImageLoading", publicName: "thyImageLoading", isSignal: true, isRequired: false, transformFunction: null }, thyImageFetchPriority: { classPropertyName: "thyImageFetchPriority", publicName: "thyImageFetchPriority", isSignal: true, isRequired: false, transformFunction: null }, thyDescription: { classPropertyName: "thyDescription", publicName: "thyDescription", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "extraTemplateRef", first: true, predicate: ["extra"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl()) {\n <img\n [src]=\"thyImageUrl()\"\n [attr.loading]=\"thyImageLoading()\"\n [attr.fetchpriority]=\"thyImageFetchPriority()\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg()) {\n <div [innerHTML]=\"presetSvg()\"></div>\n } @else {\n @if (thyIconName()) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName()\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription(), 'thy-empty-text-with-extra': thyDescription() }\">\n {{ displayText() }}\n</div>\n\n@if (thyDescription()) {\n <div class=\"thy-empty-description\">\n {{ thyDescription() }}\n </div>\n}\n\n@if (extraTemplateRef()) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef()\"></ng-template>\n </div>\n}\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
368
412
  }
369
413
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmpty, decorators: [{
370
414
  type: Component,
371
- args: [{ selector: 'thy-empty', imports: [ThyIcon, NgClass, NgTemplateOutlet], template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl) {\n <img\n [src]=\"thyImageUrl\"\n [attr.loading]=\"thyImageLoading\"\n [attr.fetchpriority]=\"thyImageFetchPriority\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg) {\n <div [innerHTML]=\"presetSvg\"></div>\n } @else {\n @if (thyIconName) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription, 'thy-empty-text-with-extra': thyDescription }\">\n {{ displayText }}\n</div>\n\n@if (thyDescription) {\n <div class=\"thy-empty-description\">\n {{ thyDescription }}\n </div>\n}\n\n@if (extraTemplateRef) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef\"></ng-template>\n </div>\n}\n" }]
372
- }], propDecorators: { thyMessage: [{
373
- type: Input
374
- }], thyTranslationKey: [{
375
- type: Input
376
- }], thyTranslationValues: [{
377
- type: Input
378
- }], thyEntityName: [{
379
- type: Input
380
- }], thyEntityNameTranslateKey: [{
381
- type: Input
382
- }], thyIconName: [{
383
- type: Input
384
- }], thySize: [{
385
- type: Input
386
- }], thyMarginTop: [{
387
- type: Input
388
- }], thyTopAuto: [{
389
- type: Input,
390
- args: [{ transform: coerceBooleanProperty }]
391
- }], thyContainer: [{
392
- type: Input
393
- }], thyImageUrl: [{
394
- type: Input
395
- }], thyImageLoading: [{
396
- type: Input
397
- }], thyImageFetchPriority: [{
398
- type: Input
399
- }], thyDescription: [{
400
- type: Input
401
- }], extraTemplateRef: [{
402
- type: ContentChild,
403
- args: ['extra']
404
- }] } });
415
+ args: [{ selector: 'thy-empty', imports: [ThyIcon, NgClass, NgTemplateOutlet], template: "<div class=\"thy-empty-icon\">\n @if (thyImageUrl()) {\n <img\n [src]=\"thyImageUrl()\"\n [attr.loading]=\"thyImageLoading()\"\n [attr.fetchpriority]=\"thyImageFetchPriority()\"\n class=\"empty-img\"\n />\n } @else {\n @if (presetSvg()) {\n <div [innerHTML]=\"presetSvg()\"></div>\n } @else {\n @if (thyIconName()) {\n <thy-icon class=\"empty-icon\" [thyIconName]=\"thyIconName()\"></thy-icon>\n }\n }\n }\n</div>\n\n<div [ngClass]=\"{ 'thy-empty-text': !thyDescription(), 'thy-empty-text-with-extra': thyDescription() }\">\n {{ displayText() }}\n</div>\n\n@if (thyDescription()) {\n <div class=\"thy-empty-description\">\n {{ thyDescription() }}\n </div>\n}\n\n@if (extraTemplateRef()) {\n <div class=\"thy-empty-extra\">\n <ng-template [ngTemplateOutlet]=\"extraTemplateRef()\"></ng-template>\n </div>\n}\n" }]
416
+ }], ctorParameters: () => [] });
405
417
 
406
418
  class ThyEmptyModule {
407
419
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyEmptyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }