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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Renderer2, ElementRef, ChangeDetectionStrategy, Component, ChangeDetectorRef, numberAttribute, ContentChild, Input, NgModule } from '@angular/core';
2
+ import { inject, Renderer2, ElementRef, ChangeDetectionStrategy, Component, input, computed, numberAttribute, contentChild, NgModule } from '@angular/core';
3
3
  import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
4
4
  import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
5
5
  import { ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuComponent, ThyDropdownModule } from 'ngx-tethys/dropdown';
@@ -60,74 +60,86 @@ const ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };
60
60
  */
61
61
  class ThyBreadcrumb {
62
62
  constructor() {
63
- this.cdr = inject(ChangeDetectorRef);
63
+ /**
64
+ * 面包屑的前缀 展示图标,如 folder-fill
65
+ */
66
+ this.thyIcon = input();
67
+ this.iconClasses = computed(() => {
68
+ const icon = this.thyIcon();
69
+ if (icon && icon.includes('wtf')) {
70
+ const classes = icon.split(' ');
71
+ if (classes.length === 1) {
72
+ classes.unshift('wtf');
73
+ }
74
+ return classes;
75
+ }
76
+ else {
77
+ return null;
78
+ }
79
+ });
80
+ this.svgIconName = computed(() => {
81
+ const icon = this.thyIcon();
82
+ if (icon && !icon.includes('wtf')) {
83
+ return icon;
84
+ }
85
+ else {
86
+ return null;
87
+ }
88
+ });
89
+ /**
90
+ * 面包屑的分隔符,不传值默认为 ">"
91
+ * @type slash | backslash | vertical-line
92
+ */
93
+ this.thySeparator = input();
94
+ /**
95
+ * 面包屑的每一项数据
96
+ */
97
+ this.items = input(undefined, { alias: 'thyItems' });
64
98
  /**
65
99
  * 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)
66
100
  */
67
- this.thyMaxCount = 4;
101
+ this.thyMaxCount = input(4, { transform: numberAttribute });
68
102
  /**
69
103
  * 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)
70
104
  */
71
- this.thyExpandable = true;
105
+ this.thyExpandable = input(true, { transform: coerceBooleanProperty });
106
+ /**
107
+ * 面包屑的每一项模板(仅当传入 thyItems 时有效)
108
+ */
109
+ this.itemTemplate = contentChild('item');
72
110
  this.ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;
73
- }
74
- /**
75
- * 面包屑的前缀 展示图标,如 folder-fill
76
- */
77
- set thyIcon(icon) {
78
- this.setIcon(icon);
79
- }
80
- ngOnInit() {
81
- this.resetItems();
82
- }
83
- ngOnChanges(changes) {
84
- if ((changes.items && !changes.items.firstChange) || (changes.thyMaxCount && !changes.thyMaxCount.firstChange)) {
85
- this.resetItems();
86
- }
87
- }
88
- setIcon(icon) {
89
- if (icon) {
90
- if (icon.includes('wtf')) {
91
- const classes = icon.split(' ');
92
- if (classes.length === 1) {
93
- classes.unshift('wtf');
94
- }
95
- this.iconClasses = classes;
111
+ this.processedItems = computed(() => {
112
+ const items = this.items();
113
+ if (!items?.length) {
114
+ return;
115
+ }
116
+ const thyMaxCount = this.thyMaxCount();
117
+ if (thyMaxCount && items.length > thyMaxCount) {
118
+ const ellipsisIndex = items.length - thyMaxCount + 2;
119
+ return {
120
+ ellipsisItems: items.slice(1, ellipsisIndex),
121
+ showItems: [items[0], ELLIPSIS_ITEM, ...items.slice(ellipsisIndex)]
122
+ };
96
123
  }
97
124
  else {
98
- this.svgIconName = icon;
125
+ return {
126
+ ellipsisItems: [],
127
+ showItems: [...items]
128
+ };
99
129
  }
100
- }
101
- else {
102
- this.iconClasses = null;
103
- this.svgIconName = null;
104
- }
105
- }
106
- resetItems() {
107
- if (!this.items?.length) {
108
- return;
109
- }
110
- if (this.thyMaxCount && this.items.length > this.thyMaxCount) {
111
- const ellipsisIndex = this.items.length - this.thyMaxCount + 2;
112
- this.ellipsisItems = this.items.slice(1, ellipsisIndex);
113
- this.showItems = [this.items[0], ELLIPSIS_ITEM, ...this.items.slice(ellipsisIndex)];
114
- }
115
- else {
116
- this.showItems = [...this.items];
117
- this.ellipsisItems = [];
118
- }
130
+ });
119
131
  }
120
132
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
121
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyBreadcrumb, isStandalone: true, selector: "thy-breadcrumb", inputs: { thyIcon: "thyIcon", thySeparator: "thySeparator", items: ["thyItems", "items"], thyMaxCount: ["thyMaxCount", "thyMaxCount", numberAttribute], thyExpandable: ["thyExpandable", "thyExpandable", coerceBooleanProperty] }, host: { properties: { "class.thy-breadcrumb-separator": "!!thySeparator", "class.thy-breadcrumb-separator-slash": "thySeparator === \"slash\"", "class.thy-breadcrumb-separator-backslash": "thySeparator === \"backslash\"", "class.thy-breadcrumb-separator-vertical-line": "thySeparator === \"vertical-line\"" }, classAttribute: "thy-breadcrumb" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true }], exportAs: ["ThyBreadcrumb"], usesOnChanges: true, ngImport: i0, template: "@if (svgIconName || iconClasses) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses\"></i>\n }\n </div>\n}\n\n@for (item of showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate) {\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\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: "component", type: ThyBreadcrumbItem, selector: "thy-breadcrumb-item,[thyBreadcrumbItem]", exportAs: ["ThyBreadcrumbItem"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "directive", type: ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
133
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyBreadcrumb, isStandalone: true, selector: "thy-breadcrumb", inputs: { thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null }, thySeparator: { classPropertyName: "thySeparator", publicName: "thySeparator", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "thyItems", isSignal: true, isRequired: false, transformFunction: null }, thyMaxCount: { classPropertyName: "thyMaxCount", publicName: "thyMaxCount", isSignal: true, isRequired: false, transformFunction: null }, thyExpandable: { classPropertyName: "thyExpandable", publicName: "thyExpandable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-breadcrumb-separator": "!!thySeparator()", "class.thy-breadcrumb-separator-slash": "thySeparator() === \"slash\"", "class.thy-breadcrumb-separator-backslash": "thySeparator() === \"backslash\"", "class.thy-breadcrumb-separator-vertical-line": "thySeparator() === \"vertical-line\"" }, classAttribute: "thy-breadcrumb" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }], exportAs: ["ThyBreadcrumb"], ngImport: i0, template: "@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\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: "component", type: ThyBreadcrumbItem, selector: "thy-breadcrumb-item,[thyBreadcrumbItem]", exportAs: ["ThyBreadcrumbItem"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "directive", type: ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
122
134
  }
123
135
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumb, decorators: [{
124
136
  type: Component,
125
137
  args: [{ selector: 'thy-breadcrumb', exportAs: 'ThyBreadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, host: {
126
138
  class: 'thy-breadcrumb',
127
- '[class.thy-breadcrumb-separator]': '!!thySeparator',
128
- '[class.thy-breadcrumb-separator-slash]': 'thySeparator === "slash"',
129
- '[class.thy-breadcrumb-separator-backslash]': 'thySeparator === "backslash"',
130
- '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator === "vertical-line"'
139
+ '[class.thy-breadcrumb-separator]': '!!thySeparator()',
140
+ '[class.thy-breadcrumb-separator-slash]': 'thySeparator() === "slash"',
141
+ '[class.thy-breadcrumb-separator-backslash]': 'thySeparator() === "backslash"',
142
+ '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator() === "vertical-line"'
131
143
  }, imports: [
132
144
  ThyIcon,
133
145
  NgClass,
@@ -138,24 +150,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
138
150
  ThyDropdownMenuItemDirective,
139
151
  ThyDropdownMenuComponent,
140
152
  ThyIcon
141
- ], template: "@if (svgIconName || iconClasses) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses\"></i>\n }\n </div>\n}\n\n@for (item of showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate) {\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n" }]
142
- }], propDecorators: { thyIcon: [{
143
- type: Input
144
- }], thySeparator: [{
145
- type: Input
146
- }], items: [{
147
- type: Input,
148
- args: [{ alias: 'thyItems' }]
149
- }], thyMaxCount: [{
150
- type: Input,
151
- args: [{ transform: numberAttribute }]
152
- }], thyExpandable: [{
153
- type: Input,
154
- args: [{ transform: coerceBooleanProperty }]
155
- }], itemTemplate: [{
156
- type: ContentChild,
157
- args: ['item']
158
- }] } });
153
+ ], template: "@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n" }]
154
+ }] });
159
155
 
160
156
  class ThyBreadcrumbModule {
161
157
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyBreadcrumbModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-breadcrumb.mjs","sources":["../../../src/breadcrumb/breadcrumb-item.component.ts","../../../src/breadcrumb/breadcrumb.component.ts","../../../src/breadcrumb/breadcrumb.component.html","../../../src/breadcrumb/module.ts","../../../src/breadcrumb/ngx-tethys-breadcrumb.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, AfterViewInit, ElementRef, Renderer2, inject } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\n/**\n * 面包屑 Item 组件\n * @name thy-breadcrumb-item,[thyBreadcrumbItem]\n * @order 20\n */\n@Component({\n selector: 'thy-breadcrumb-item,[thyBreadcrumbItem]',\n template: '<ng-content></ng-content><thy-icon class=\"separator-icon\" thyIconName=\"angle-right\"></thy-icon>',\n exportAs: 'ThyBreadcrumbItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb-item'\n },\n imports: [ThyIcon]\n})\nexport class ThyBreadcrumbItem implements AfterViewInit {\n private renderer = inject(Renderer2);\n private elementRef = inject(ElementRef);\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n const link: HTMLElement = this.elementRef.nativeElement.querySelector('a');\n if (link && link.childNodes) {\n this.wrapSpanForText(link.childNodes);\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n this.renderer.addClass(span, 'thy-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n ContentChild,\n TemplateRef,\n numberAttribute,\n OnChanges,\n SimpleChanges,\n OnInit,\n ChangeDetectorRef,\n inject\n} from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { SafeAny } from 'ngx-tethys/types';\nimport {\n ThyDropdownDirective,\n ThyDropdownMenuComponent,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuItemNameDirective\n} from 'ngx-tethys/dropdown';\nimport { ThyAction } from 'ngx-tethys/action';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst THY_BREADCRUMB_ITEM_ELLIPSIS_ID = 'THY_BREADCRUMB_ITEM_ELLIPSIS_ID';\n\nconst ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };\n\n/**\n * 面包屑组件\n * @name thy-breadcrumb\n * @order 10\n */\n@Component({\n selector: 'thy-breadcrumb',\n templateUrl: './breadcrumb.component.html',\n exportAs: 'ThyBreadcrumb',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb',\n '[class.thy-breadcrumb-separator]': '!!thySeparator',\n '[class.thy-breadcrumb-separator-slash]': 'thySeparator === \"slash\"',\n '[class.thy-breadcrumb-separator-backslash]': 'thySeparator === \"backslash\"',\n '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator === \"vertical-line\"'\n },\n imports: [\n ThyIcon,\n NgClass,\n ThyBreadcrumbItem,\n NgTemplateOutlet,\n ThyAction,\n ThyDropdownDirective,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuComponent,\n ThyIcon\n ]\n})\nexport class ThyBreadcrumb implements OnInit, OnChanges {\n private cdr = inject(ChangeDetectorRef);\n\n iconClasses: string[];\n svgIconName: string;\n\n /**\n * 面包屑的前缀 展示图标,如 folder-fill\n */\n @Input()\n set thyIcon(icon: string) {\n this.setIcon(icon);\n }\n\n /**\n * 面包屑的分隔符,不传值默认为 \">\"\n * @type slash | backslash | vertical-line\n */\n @Input() thySeparator: 'slash' | 'backslash' | 'vertical-line';\n\n /**\n * 面包屑的每一项数据\n */\n @Input({ alias: 'thyItems' }) items: SafeAny[];\n\n /**\n * 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)\n */\n @Input({ transform: numberAttribute }) thyMaxCount = 4;\n\n /**\n * 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)\n */\n @Input({ transform: coerceBooleanProperty }) thyExpandable = true;\n\n /**\n * 面包屑的每一项模板(仅当传入 thyItems 时有效)\n */\n @ContentChild('item') itemTemplate: TemplateRef<SafeAny>;\n\n public ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;\n\n public ellipsisItems: SafeAny[];\n\n public showItems: SafeAny[];\n\n ngOnInit() {\n this.resetItems();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.items && !changes.items.firstChange) || (changes.thyMaxCount && !changes.thyMaxCount.firstChange)) {\n this.resetItems();\n }\n }\n\n private setIcon(icon: string) {\n if (icon) {\n if (icon.includes('wtf')) {\n const classes = icon.split(' ');\n if (classes.length === 1) {\n classes.unshift('wtf');\n }\n this.iconClasses = classes;\n } else {\n this.svgIconName = icon;\n }\n } else {\n this.iconClasses = null;\n this.svgIconName = null;\n }\n }\n\n private resetItems() {\n if (!this.items?.length) {\n return;\n }\n if (this.thyMaxCount && this.items.length > this.thyMaxCount) {\n const ellipsisIndex = this.items.length - this.thyMaxCount + 2;\n this.ellipsisItems = this.items.slice(1, ellipsisIndex);\n this.showItems = [this.items[0], ELLIPSIS_ITEM, ...this.items.slice(ellipsisIndex)];\n } else {\n this.showItems = [...this.items];\n this.ellipsisItems = [];\n }\n }\n}\n","@if (svgIconName || iconClasses) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses\"></i>\n }\n </div>\n}\n\n@for (item of showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate) {\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyBreadcrumb } from './breadcrumb.component';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyActionModule } from 'ngx-tethys/action';\nimport { ThyDropdownModule } from 'ngx-tethys/dropdown';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyBreadcrumb, ThyBreadcrumbItem, ThyActionModule, ThyDropdownModule],\n exports: [ThyBreadcrumb, ThyBreadcrumbItem]\n})\nexport class ThyBreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;AAIG;MAWU,iBAAiB,CAAA;AAV9B,IAAA,WAAA,GAAA;AAWY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAqB1C;IAnBG,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;AAC9D,QAAA,MAAM,IAAI,GAAgB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC;AAC1E,QAAA,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC;;;AAIrC,IAAA,eAAe,CAAC,KAAe,EAAA;AACnC,QAAA,KAAK,CAAC,OAAO,CAAC,IAAI,IAAG;AACjB,YAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE;gBAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAA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EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;;2FAGlG,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAC5G,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB;AAC7C,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-breadcrumb.mjs","sources":["../../../src/breadcrumb/breadcrumb-item.component.ts","../../../src/breadcrumb/breadcrumb.component.ts","../../../src/breadcrumb/breadcrumb.component.html","../../../src/breadcrumb/module.ts","../../../src/breadcrumb/ngx-tethys-breadcrumb.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, AfterViewInit, ElementRef, Renderer2, inject } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\n/**\n * 面包屑 Item 组件\n * @name thy-breadcrumb-item,[thyBreadcrumbItem]\n * @order 20\n */\n@Component({\n selector: 'thy-breadcrumb-item,[thyBreadcrumbItem]',\n template: '<ng-content></ng-content><thy-icon class=\"separator-icon\" thyIconName=\"angle-right\"></thy-icon>',\n exportAs: 'ThyBreadcrumbItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb-item'\n },\n imports: [ThyIcon]\n})\nexport class ThyBreadcrumbItem implements AfterViewInit {\n private renderer = inject(Renderer2);\n private elementRef = inject(ElementRef);\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n const link: HTMLElement = this.elementRef.nativeElement.querySelector('a');\n if (link && link.childNodes) {\n this.wrapSpanForText(link.childNodes);\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n this.renderer.addClass(span, 'thy-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n}\n","import { Component, ChangeDetectionStrategy, TemplateRef, numberAttribute, input, contentChild, Signal, computed } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { SafeAny } from 'ngx-tethys/types';\nimport { ThyDropdownDirective, ThyDropdownMenuComponent, ThyDropdownMenuItemDirective } from 'ngx-tethys/dropdown';\nimport { ThyAction } from 'ngx-tethys/action';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst THY_BREADCRUMB_ITEM_ELLIPSIS_ID = 'THY_BREADCRUMB_ITEM_ELLIPSIS_ID';\n\nconst ELLIPSIS_ITEM = { _id: THY_BREADCRUMB_ITEM_ELLIPSIS_ID };\n\n/**\n * 面包屑组件\n * @name thy-breadcrumb\n * @order 10\n */\n@Component({\n selector: 'thy-breadcrumb',\n templateUrl: './breadcrumb.component.html',\n exportAs: 'ThyBreadcrumb',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-breadcrumb',\n '[class.thy-breadcrumb-separator]': '!!thySeparator()',\n '[class.thy-breadcrumb-separator-slash]': 'thySeparator() === \"slash\"',\n '[class.thy-breadcrumb-separator-backslash]': 'thySeparator() === \"backslash\"',\n '[class.thy-breadcrumb-separator-vertical-line]': 'thySeparator() === \"vertical-line\"'\n },\n imports: [\n ThyIcon,\n NgClass,\n ThyBreadcrumbItem,\n NgTemplateOutlet,\n ThyAction,\n ThyDropdownDirective,\n ThyDropdownMenuItemDirective,\n ThyDropdownMenuComponent,\n ThyIcon\n ]\n})\nexport class ThyBreadcrumb {\n /**\n * 面包屑的前缀 展示图标,如 folder-fill\n */\n readonly thyIcon = input<string>();\n\n iconClasses: Signal<string[]> = computed(() => {\n const icon = this.thyIcon();\n if (icon && icon.includes('wtf')) {\n const classes = icon.split(' ');\n if (classes.length === 1) {\n classes.unshift('wtf');\n }\n return classes;\n } else {\n return null;\n }\n });\n\n svgIconName: Signal<string> = computed(() => {\n const icon = this.thyIcon();\n if (icon && !icon.includes('wtf')) {\n return icon;\n } else {\n return null;\n }\n });\n\n /**\n * 面包屑的分隔符,不传值默认为 \">\"\n * @type slash | backslash | vertical-line\n */\n readonly thySeparator = input<'slash' | 'backslash' | 'vertical-line'>();\n\n /**\n * 面包屑的每一项数据\n */\n readonly items = input<SafeAny[]>(undefined, { alias: 'thyItems' });\n\n /**\n * 最大显示数量,超出此数量后,面包屑会被省略, 0 表示不省略(仅当传入 thyItems 时有效)\n */\n readonly thyMaxCount = input(4, { transform: numberAttribute });\n\n /**\n * 是否可点击弹出已被省略的面包屑项(仅当传入 thyItems 时有效)\n */\n readonly thyExpandable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * 面包屑的每一项模板(仅当传入 thyItems 时有效)\n */\n readonly itemTemplate = contentChild<TemplateRef<SafeAny>>('item');\n\n public ellipsisItemId = THY_BREADCRUMB_ITEM_ELLIPSIS_ID;\n\n public readonly processedItems: Signal<{\n ellipsisItems: SafeAny[];\n showItems: SafeAny[];\n }> = computed(() => {\n const items = this.items();\n if (!items?.length) {\n return;\n }\n const thyMaxCount = this.thyMaxCount();\n if (thyMaxCount && items.length > thyMaxCount) {\n const ellipsisIndex = items.length - thyMaxCount + 2;\n return {\n ellipsisItems: items.slice(1, ellipsisIndex),\n showItems: [items[0], ELLIPSIS_ITEM, ...items.slice(ellipsisIndex)]\n };\n } else {\n return {\n ellipsisItems: [],\n showItems: [...items]\n };\n }\n });\n}\n","@if (svgIconName() || iconClasses()) {\n <div class=\"thy-breadcrumb-icon\">\n @if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n <i [ngClass]=\"iconClasses()\"></i>\n }\n </div>\n}\n\n@for (item of processedItems()?.showItems; track $index) {\n <thy-breadcrumb-item class=\"thy-breadcrumb-item-ellipsis\">\n @if (item?._id !== ellipsisItemId) {\n <ng-container *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-container>\n } @else {\n <a\n thyAction\n href=\"javascript:;\"\n thyActionIcon=\"more\"\n thyActiveClass=\"active\"\n [class.disabled]=\"!thyExpandable()\"\n class=\"ellipsis-action ml-n1 mr-n1\"\n [thyDropdown]=\"ellipsisList\"></a>\n }\n </thy-breadcrumb-item>\n}\n\n<ng-template #ellipsisList>\n <thy-dropdown-menu thyImmediateRender>\n @for (item of processedItems()?.ellipsisItems; track $index) {\n <a thyDropdownMenuItem href=\"javascript:;\">\n <ng-template *ngTemplateOutlet=\"itemContentTpl; context: { $implicit: item }\"></ng-template>\n </a>\n }\n </thy-dropdown-menu>\n</ng-template>\n\n<ng-template #itemContentTpl let-item>\n @if (itemTemplate()) {\n <ng-template *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-template>\n } @else {\n @if (item?.icon) {\n <thy-icon [thyIconName]=\"item.icon\" class=\"mr-2\"></thy-icon>\n }\n @if (item?.name) {\n <span>{{ item.name }}</span>\n }\n }\n</ng-template>\n\n<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyBreadcrumb } from './breadcrumb.component';\nimport { ThyBreadcrumbItem } from './breadcrumb-item.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyActionModule } from 'ngx-tethys/action';\nimport { ThyDropdownModule } from 'ngx-tethys/dropdown';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyBreadcrumb, ThyBreadcrumbItem, ThyActionModule, ThyDropdownModule],\n exports: [ThyBreadcrumb, ThyBreadcrumbItem]\n})\nexport class ThyBreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;AAIG;MAWU,iBAAiB,CAAA;AAV9B,I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AAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAHlB,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CACjG,EAAA,OAAA,EAAA,CAAA,aAAa,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAEjC,mBAAmB,EAAA,OAAA,EAAA,CAHlB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAA,EAAA,CAAA,CAAA;;2FAGlG,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAC5G,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB;AAC7C,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, EventEmitter, Output, Input, HostBinding, Component, Directive, TemplateRef, forwardRef, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
2
+ import { inject, ChangeDetectorRef, input, output, effect, HostBinding, Component, Directive, contentChild, TemplateRef, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
3
3
  import { NgTemplateOutlet, JsonPipe, CommonModule } from '@angular/common';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
@@ -24,18 +24,26 @@ class ThyCalendarHeader {
24
24
  this.dateHelper = inject(DateHelperService);
25
25
  this.locale = injectLocale('calendar');
26
26
  this.className = true;
27
+ /**
28
+ * 当前选中日期
29
+ */
30
+ this.currentDate = input();
31
+ /**
32
+ * 自定义渲染右侧操作项
33
+ */
34
+ this.operationRender = input();
27
35
  /**
28
36
  * 日期选择范围(年)发生变化的回调
29
37
  */
30
- this.yearChange = new EventEmitter();
38
+ this.yearChange = output();
31
39
  /**
32
40
  * 日期选择范围(月)发生变化的回调
33
41
  */
34
- this.monthChange = new EventEmitter();
42
+ this.monthChange = output();
35
43
  /**
36
44
  * 日期选择范围(日期)发生变化的回调
37
45
  */
38
- this.dateRangeChange = new EventEmitter();
46
+ this.dateRangeChange = output();
39
47
  this.pickerFormat = this.locale().yearMonthFormat;
40
48
  this.dateRanges = [
41
49
  {
@@ -49,12 +57,9 @@ class ThyCalendarHeader {
49
57
  }
50
58
  }
51
59
  ];
52
- }
53
- /**
54
- * 当前选中日期
55
- */
56
- set currentDate(value) {
57
- this.setDate(value);
60
+ effect(() => {
61
+ this.setDate();
62
+ });
58
63
  }
59
64
  ngOnInit() { }
60
65
  onChangeMonth(month) {
@@ -77,10 +82,11 @@ class ThyCalendarHeader {
77
82
  this.onChangeRange(this.date);
78
83
  this.cdr.detectChanges();
79
84
  }
80
- setDate(value) {
81
- this.isCurrentDate(value);
85
+ setDate() {
86
+ const currentDate = this.currentDate();
87
+ this.isCurrentDate(currentDate);
82
88
  if (this.isCurrent) {
83
- this._currentDate = value;
89
+ this._currentDate = currentDate;
84
90
  const dateRange = {
85
91
  ...this.dateRanges[0],
86
92
  key: 'exception',
@@ -100,24 +106,14 @@ class ThyCalendarHeader {
100
106
  currentDate.getMonth() !== getMonth(new TinyDate().getTime()) || currentDate.getYear() !== getYear(new TinyDate().getTime());
101
107
  }
102
108
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendarHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
103
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendarHeader, isStandalone: true, selector: "thy-calendar-header", inputs: { currentDate: "currentDate", operationRender: "operationRender" }, outputs: { yearChange: "yearChange", monthChange: "monthChange", dateRangeChange: "dateRangeChange" }, host: { properties: { "class.thy-calendar-full-header-container": "this.className" } }, ngImport: i0, template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender); context: { $implicit: operationRender }\">\n <span>{{ operationRender | json }}</span>\n </ng-container>\n</div>\n", dependencies: [{ kind: "component", type: ThyDateRange, selector: "thy-date-range", inputs: ["thyOptionalDateRanges", "thyHiddenMenu", "thyDisabledSwitch", "thyCustomTextValue", "thyMinDate", "thyMaxDate", "thyCustomKey", "thyPickerFormat", "thyDisabledDate", "thySeparator"], outputs: ["thyOnCalendarChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
109
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendarHeader, isStandalone: true, selector: "thy-calendar-header", inputs: { currentDate: { classPropertyName: "currentDate", publicName: "currentDate", isSignal: true, isRequired: false, transformFunction: null }, operationRender: { classPropertyName: "operationRender", publicName: "operationRender", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearChange: "yearChange", monthChange: "monthChange", dateRangeChange: "dateRangeChange" }, host: { properties: { "class.thy-calendar-full-header-container": "this.className" } }, ngImport: i0, template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender()); context: { $implicit: operationRender() }\">\n <span>{{ operationRender() | json }}</span>\n </ng-container>\n</div>\n", dependencies: [{ kind: "component", type: ThyDateRange, selector: "thy-date-range", inputs: ["thyOptionalDateRanges", "thyHiddenMenu", "thyDisabledSwitch", "thyCustomTextValue", "thyMinDate", "thyMaxDate", "thyCustomKey", "thyPickerFormat", "thyDisabledDate", "thySeparator"], outputs: ["thyOnCalendarChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
104
110
  }
105
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendarHeader, decorators: [{
106
112
  type: Component,
107
- args: [{ selector: 'thy-calendar-header', imports: [ThyDateRange, FormsModule, ThyButton, NgTemplateOutlet, JsonPipe], template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender); context: { $implicit: operationRender }\">\n <span>{{ operationRender | json }}</span>\n </ng-container>\n</div>\n" }]
108
- }], propDecorators: { className: [{
113
+ args: [{ selector: 'thy-calendar-header', imports: [ThyDateRange, FormsModule, ThyButton, NgTemplateOutlet, JsonPipe], template: "<div class=\"thy-calendar-full-header-left\">\n <thy-date-range\n class=\"select-date-range\"\n [ngModel]=\"date\"\n [thyHiddenMenu]=\"true\"\n [thyCustomKey]=\"'exception'\"\n [thyPickerFormat]=\"pickerFormat\"\n (ngModelChange)=\"onChangeRange($event)\"></thy-date-range>\n @if (isCurrent) {\n <button thyButton=\"outline-default-square\" thySize=\"md\" (click)=\"backToday()\">{{ locale().today }}</button>\n }\n</div>\n<div class=\"thy-calendar-full-header-right\">\n <ng-container *ngTemplateOutlet=\"$any(operationRender()); context: { $implicit: operationRender() }\">\n <span>{{ operationRender() | json }}</span>\n </ng-container>\n</div>\n" }]
114
+ }], ctorParameters: () => [], propDecorators: { className: [{
109
115
  type: HostBinding,
110
116
  args: ['class.thy-calendar-full-header-container']
111
- }], currentDate: [{
112
- type: Input
113
- }], operationRender: [{
114
- type: Input
115
- }], yearChange: [{
116
- type: Output
117
- }], monthChange: [{
118
- type: Output
119
- }], dateRangeChange: [{
120
- type: Output
121
117
  }] } });
122
118
 
123
119
  /**
@@ -157,38 +153,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
157
153
  * @order 10
158
154
  */
159
155
  class ThyCalendar {
160
- constructor() {
161
- this.cdr = inject(ChangeDetectorRef);
162
- this.className = true;
163
- this.className1 = true;
164
- /**
165
- * 展示模式
166
- * @type month | year
167
- */
168
- this.thyMode = 'month';
169
- /**
170
- * 日期选择变化的回调
171
- */
172
- this.thySelectChange = new EventEmitter();
173
- /**
174
- * 日期选择变化的回调
175
- */
176
- this.thyValueChange = new EventEmitter();
177
- /**
178
- * 日期选择范围变化的回调
179
- */
180
- this.thyDateRangeChange = new EventEmitter();
181
- this.currentDate = new TinyDate();
182
- this.prefixCls = 'thy-calendar-full';
183
- this.onChangeFn = () => { };
184
- this.onTouchFn = () => { };
185
- }
186
- get dateCell() {
187
- return (this.thyDateCell || this.thyDateCellChild);
188
- }
189
- get headerOperation() {
190
- return (this.thyCalendarHeaderOperation || this.thyCalendarHeaderOperationChild);
191
- }
192
156
  ngOnInit() { }
193
157
  onYearSelect(year) {
194
158
  const date = this.currentDate.setYear(year);
@@ -225,45 +189,79 @@ class ThyCalendar {
225
189
  this.thyValueChange.emit(date.nativeDate);
226
190
  }
227
191
  }
228
- ngOnChanges(changes) {
229
- if (changes.thyValue) {
230
- this.updateDate(new TinyDate(this.thyValue), false);
231
- }
192
+ constructor() {
193
+ this.cdr = inject(ChangeDetectorRef);
194
+ this.className = true;
195
+ this.className1 = true;
196
+ /**
197
+ * 展示模式
198
+ * @type month | year
199
+ */
200
+ this.thyMode = input('month');
201
+ /**
202
+ * (可双向绑定)展示日期,默认为当前日期
203
+ */
204
+ this.thyValue = input();
205
+ /**
206
+ * 不可选择的日期
207
+ */
208
+ this.thyDisabledDate = input();
209
+ /**
210
+ * 日期选择变化的回调
211
+ */
212
+ this.thySelectChange = output();
213
+ /**
214
+ * 日期选择变化的回调
215
+ */
216
+ this.thyValueChange = output();
217
+ /**
218
+ * 日期选择范围变化的回调
219
+ */
220
+ this.thyDateRangeChange = output();
221
+ /**
222
+ * (可作为内容)自定义渲染日期单元格,模板内容会被追加到单元格
223
+ */
224
+ this.thyDateCell = input();
225
+ /**
226
+ * 追加到单元格的自定义模板
227
+ */
228
+ this.thyDateCellChild = contentChild(ThyDateCellDirective, { read: TemplateRef });
229
+ this.dateCell = computed(() => {
230
+ return (this.thyDateCell() || this.thyDateCellChild());
231
+ });
232
+ /**
233
+ * (可作为内容)自定义渲染右上角操作项
234
+ */
235
+ this.thyCalendarHeaderOperation = input();
236
+ /**
237
+ * 右上角操作项的自定义模板
238
+ */
239
+ this.thyCalendarHeaderOperationChild = contentChild(ThyCalendarHeaderOperationDirective, { read: TemplateRef });
240
+ this.headerOperation = computed(() => {
241
+ return (this.thyCalendarHeaderOperation() || this.thyCalendarHeaderOperationChild());
242
+ });
243
+ this.currentDate = new TinyDate();
244
+ this.prefixCls = 'thy-calendar-full';
245
+ this.onChangeFn = () => { };
246
+ this.onTouchFn = () => { };
247
+ effect(() => {
248
+ if (this.thyValue()) {
249
+ this.updateDate(new TinyDate(this.thyValue()), false);
250
+ }
251
+ });
232
252
  }
233
253
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
234
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendar, isStandalone: true, selector: "thy-calendar", inputs: { thyMode: "thyMode", thyValue: "thyValue", thyDisabledDate: "thyDisabledDate", thyDateCell: "thyDateCell", thyCalendarHeaderOperation: "thyCalendarHeaderOperation" }, outputs: { thySelectChange: "thySelectChange", thyValueChange: "thyValueChange", thyDateRangeChange: "thyDateRangeChange" }, host: { properties: { "class.thy-calendar-container": "this.className", "class.thy-calendar-full": "this.className1" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], queries: [{ propertyName: "thyDateCellChild", first: true, predicate: ThyDateCellDirective, descendants: true, read: TemplateRef }, { propertyName: "thyCalendarHeaderOperationChild", first: true, predicate: ThyCalendarHeaderOperationDirective, descendants: true, read: TemplateRef }], usesOnChanges: true, ngImport: i0, template: "<thy-calendar-header\n [operationRender]=\"headerOperation\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"\n></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell\"\n [disabledDate]=\"thyDisabledDate\"\n (valueChange)=\"onDateSelect($event)\"\n ></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n\n", dependencies: [{ kind: "component", type: ThyCalendarHeader, selector: "thy-calendar-header", inputs: ["currentDate", "operationRender"], outputs: ["yearChange", "monthChange", "dateRangeChange"] }, { kind: "component", type: DateTable, selector: "date-table", outputs: ["dayHover"], exportAs: ["dateTable"] }, { kind: "component", type: MonthTable, selector: "month-table", exportAs: ["monthTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
254
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyCalendar, isStandalone: true, selector: "thy-calendar", inputs: { thyMode: { classPropertyName: "thyMode", publicName: "thyMode", isSignal: true, isRequired: false, transformFunction: null }, thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, thyDisabledDate: { classPropertyName: "thyDisabledDate", publicName: "thyDisabledDate", isSignal: true, isRequired: false, transformFunction: null }, thyDateCell: { classPropertyName: "thyDateCell", publicName: "thyDateCell", isSignal: true, isRequired: false, transformFunction: null }, thyCalendarHeaderOperation: { classPropertyName: "thyCalendarHeaderOperation", publicName: "thyCalendarHeaderOperation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thySelectChange: "thySelectChange", thyValueChange: "thyValueChange", thyDateRangeChange: "thyDateRangeChange" }, host: { properties: { "class.thy-calendar-container": "this.className", "class.thy-calendar-full": "this.className1" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], queries: [{ propertyName: "thyDateCellChild", first: true, predicate: ThyDateCellDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "thyCalendarHeaderOperationChild", first: true, predicate: ThyCalendarHeaderOperationDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<thy-calendar-header\n [operationRender]=\"headerOperation()\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode() === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode() === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell()\"\n [disabledDate]=\"thyDisabledDate()\"\n (valueChange)=\"onDateSelect($event)\"></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate()\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ThyCalendarHeader, selector: "thy-calendar-header", inputs: ["currentDate", "operationRender"], outputs: ["yearChange", "monthChange", "dateRangeChange"] }, { kind: "component", type: DateTable, selector: "date-table", outputs: ["dayHover"], exportAs: ["dateTable"] }, { kind: "component", type: MonthTable, selector: "month-table", exportAs: ["monthTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
235
255
  }
236
256
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCalendar, decorators: [{
237
257
  type: Component,
238
- args: [{ selector: 'thy-calendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], imports: [ThyCalendarHeader, DateTable, MonthTable], template: "<thy-calendar-header\n [operationRender]=\"headerOperation\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"\n></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell\"\n [disabledDate]=\"thyDisabledDate\"\n (valueChange)=\"onDateSelect($event)\"\n ></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n\n" }]
239
- }], propDecorators: { className: [{
258
+ args: [{ selector: 'thy-calendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ThyCalendar), multi: true }], imports: [ThyCalendarHeader, DateTable, MonthTable], template: "<thy-calendar-header\n [operationRender]=\"headerOperation()\"\n (monthChange)=\"onMonthSelect($event)\"\n (yearChange)=\"onYearSelect($event)\"\n (dateRangeChange)=\"onDateRangeSelect($event)\"\n [currentDate]=\"currentDate\"></thy-calendar-header>\n\n<div class=\"thy-calendar-panel\">\n <div class=\"thy-calendar-{{ thyMode() === 'month' ? 'date' : 'month' }}-panel\">\n <div class=\"thy-calendar-body\">\n @if (thyMode() === 'month') {\n <date-table\n [prefixCls]=\"prefixCls\"\n [value]=\"currentDate\"\n [activeDate]=\"currentDate\"\n [selectedValue]=\"currentDate\"\n [cellRender]=\"dateCell()\"\n [disabledDate]=\"thyDisabledDate()\"\n (valueChange)=\"onDateSelect($event)\"></date-table>\n } @else {\n <month-table [value]=\"currentDate\" [disabledDate]=\"thyDisabledDate()\" (valueChange)=\"onDateSelect($event)\"></month-table>\n }\n </div>\n </div>\n</div>\n" }]
259
+ }], ctorParameters: () => [], propDecorators: { className: [{
240
260
  type: HostBinding,
241
261
  args: ['class.thy-calendar-container']
242
262
  }], className1: [{
243
263
  type: HostBinding,
244
264
  args: ['class.thy-calendar-full']
245
- }], thyMode: [{
246
- type: Input
247
- }], thyValue: [{
248
- type: Input
249
- }], thyDisabledDate: [{
250
- type: Input
251
- }], thySelectChange: [{
252
- type: Output
253
- }], thyValueChange: [{
254
- type: Output
255
- }], thyDateRangeChange: [{
256
- type: Output
257
- }], thyDateCell: [{
258
- type: Input
259
- }], thyDateCellChild: [{
260
- type: ContentChild,
261
- args: [ThyDateCellDirective, { read: TemplateRef }]
262
- }], thyCalendarHeaderOperation: [{
263
- type: Input
264
- }], thyCalendarHeaderOperationChild: [{
265
- type: ContentChild,
266
- args: [ThyCalendarHeaderOperationDirective, { read: TemplateRef }]
267
265
  }] } });
268
266
 
269
267
  class ThyCalendarModule {