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 +1 @@
1
- {"version":3,"file":"ngx-tethys-watermark.mjs","sources":["../../../src/watermark/config.ts","../../../src/watermark/watermark.directive.ts","../../../src/watermark/watermark.module.ts","../../../src/watermark/ngx-tethys-watermark.ts"],"sourcesContent":["export const DEFAULT_WATERMARK_CONFIG = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n opacity: '0.8',\n 'background-repeat': 'repeat',\n 'pointer-events': 'none',\n 'z-index': 2147483647,\n 'background-image': ''\n};\n\nexport const DEFAULT_CANVAS_CONFIG = {\n degree: 15,\n color: ['rgba(51, 51, 51, 0.12)', 'rgb(60, 65, 74)'],\n fontSize: 12,\n textLineHeight: 20,\n gutter: [250, 200]\n};\n","import { Directive, Input, ElementRef, OnInit, SimpleChanges, OnChanges, inject, DestroyRef, effect } from '@angular/core';\nimport { Subject, Observable } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DEFAULT_WATERMARK_CONFIG, DEFAULT_CANVAS_CONFIG } from './config';\nimport { MutationObserverFactory } from '@angular/cdk/observers';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { ThyThemeStore } from 'ngx-tethys/core';\n\n/**\n * @public\n * 水印样式配置\n */\nexport interface ThyCanvasConfigType {\n /**\n * 偏移角度\n */\n degree?: number;\n /**\n * 字体颜色。如果传的是数组,第一个为默认主题的字体颜色,第二个为黑暗主题的字体颜色\n */\n color?: string | string[];\n /**\n * 字体大小\n */\n fontSize?: number | string;\n /**\n * 文本行高\n */\n textLineHeight?: number;\n /**\n * 横纵间距\n */\n gutter?: number[];\n}\n\n/**\n * 水印指令\n * @name thyWatermark\n */\n@Directive({\n selector: '[thyWatermark]'\n})\nexport class ThyWatermarkDirective implements OnInit, OnChanges {\n private el = inject(ElementRef);\n\n /**\n * 是否禁用,默认为 false\n */\n @Input({ transform: coerceBooleanProperty })\n thyDisabled: boolean = false;\n\n content: string;\n /**\n * 水印内容\n */\n @Input()\n set thyWatermark(value: string) {\n value = value?.replace(/^\\\"|\\\"$/g, '');\n this.content = !!value ? value : '';\n }\n\n /**\n * 水印样式配置\n */\n @Input() thyCanvasConfig: ThyCanvasConfigType;\n\n private createWatermark$ = new Subject<string>();\n\n private observer: MutationObserver;\n\n private canvas: HTMLCanvasElement;\n\n private wmDiv: HTMLElement;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private thyThemeStore = inject(ThyThemeStore);\n\n constructor() {\n effect(() => {\n if (!this.thyDisabled && this.thyThemeStore.theme()) {\n this.refreshWatermark();\n }\n });\n }\n\n ngOnInit() {\n if (!this.thyDisabled) {\n this.createWatermark$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.observeAttributes()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {});\n });\n\n this.createWatermark();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { thyWatermark, thyDisabled } = changes;\n const thyWatermarkChange = () => {\n if (thyWatermark.firstChange) return;\n if (thyWatermark.currentValue) {\n this.refreshWatermark();\n }\n };\n const thyDisabledChange = () => {\n if (thyDisabled.firstChange) return;\n thyDisabled?.currentValue ? this.removeWatermark() : this.refreshWatermark();\n };\n thyWatermark && thyWatermarkChange();\n thyDisabled && thyDisabledChange();\n }\n\n private refreshWatermark() {\n this.removeWatermark();\n this.createWatermark();\n }\n\n private removeWatermark() {\n if (this.wmDiv) {\n this.wmDiv.remove();\n this.wmDiv = null;\n }\n }\n\n createCanvas() {\n let { gutter, fontSize, color, degree, textLineHeight } = {\n ...DEFAULT_CANVAS_CONFIG,\n ...(this.thyCanvasConfig || {})\n };\n color = this.thyThemeStore.normalizeColor(color);\n\n const [xGutter, yGutter] = gutter;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n const getFakeSize = () => {\n const fakeBox = document.createElement('div');\n const fakeBoxStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'inline-block',\n 'font-size': `${parseFloat('' + fontSize)}px`,\n 'word-wrap': 'break-word',\n 'font-family': 'inherit',\n 'white-space': 'pre-line'\n };\n const styleStr = Object.keys(fakeBoxStyle).reduce((pre, next) => ((pre += `${next}:${fakeBoxStyle[next]};`), pre), '');\n fakeBox.setAttribute('style', styleStr);\n\n fakeBox.innerHTML = this.content.replace(/(\\\\n)/gm, '</br>');\n document.querySelector('body').insertBefore(fakeBox, document.querySelector('body').firstChild);\n const { width, height } = fakeBox.getBoundingClientRect();\n fakeBox.remove();\n return { width, height };\n };\n const { width: fakeBoxWidth, height: fakeBoxHeight } = getFakeSize();\n\n const angle = (degree * Math.PI) / 180;\n const contentArr = this.content.split('\\\\n');\n const canvasHeight = Math.sin(angle) * fakeBoxWidth + fakeBoxHeight;\n\n let start = Math.ceil(Math.sin(angle) * fakeBoxWidth * Math.sin(angle));\n const canvasWidth = start + fakeBoxWidth;\n canvas.setAttribute('width', '' + (canvasWidth + xGutter));\n canvas.setAttribute('height', '' + (canvasHeight + yGutter));\n\n ctx.font = `${parseFloat('' + fontSize)}px microsoft yahei`;\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n ctx.fillStyle = color;\n ctx.rotate(0 - (degree * Math.PI) / 180);\n contentArr.map((k, i) => {\n ctx.fillText(k, -start + Math.ceil(canvasWidth / 2), Math.sin(angle) * canvasWidth + textLineHeight * i);\n start += Math.sin(angle) * textLineHeight;\n });\n this.canvas = canvas;\n return canvas;\n }\n\n private createWatermark(isRefresh = true) {\n const watermarkDiv = this.wmDiv || document.createElement('div');\n\n const background = !isRefresh ? this.canvas.toDataURL() : this.createCanvas().toDataURL();\n const watermarkStyle = {\n ...DEFAULT_WATERMARK_CONFIG,\n 'background-image': `url(${background})`\n };\n\n const styleStr = Object.keys(watermarkStyle).reduce((pre, next) => ((pre += `${next}:${watermarkStyle[next]};`), pre), '');\n watermarkDiv.setAttribute('style', styleStr);\n\n if (!this.wmDiv) {\n const parentNode = this.el.nativeElement;\n watermarkDiv.classList.add(`_vm`);\n this.wmDiv = watermarkDiv;\n parentNode.insertBefore(watermarkDiv, parentNode.firstChild);\n }\n this.createWatermark$.next('');\n }\n\n private observeAttributes() {\n this.observer?.disconnect();\n return new Observable(observe => {\n const stream = new Subject<MutationRecord[]>();\n this.observer = new MutationObserverFactory().create(mutations => stream.next(mutations));\n if (this.observer) {\n this.observer.observe(this.wmDiv, {\n attributes: true\n });\n }\n stream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.wmDiv) {\n this?.observer?.disconnect();\n this.createWatermark(false);\n }\n });\n observe.next(stream);\n return () => {\n this.observer?.disconnect();\n };\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyWatermarkDirective } from './watermark.directive';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyWatermarkDirective],\n exports: [ThyWatermarkDirective],\n providers: []\n})\nexport class ThyWatermarkModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,wBAAwB,GAAG;AACpC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,mBAAmB,EAAE,QAAQ;AAC7B,IAAA,gBAAgB,EAAE,MAAM;AACxB,IAAA,SAAS,EAAE,UAAU;AACrB,IAAA,kBAAkB,EAAE;CACvB;AAEM,MAAM,qBAAqB,GAAG;AACjC,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,KAAK,EAAE,CAAC,wBAAwB,EAAE,iBAAiB,CAAC;AACpD,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG;CACpB;;ACgBD;;;AAGG;MAIU,qBAAqB,CAAA;AAU9B;;AAEG;IACH,IACI,YAAY,CAAC,KAAa,EAAA;QAC1B,KAAK,GAAG,KAAK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,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,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,kBAAkB,YAJjB,YAAY,EAAE,eAAe,EAAE,qBAAqB,aACpD,qBAAqB,CAAA,EAAA,CAAA,CAAA;+GAGtB,kBAAkB,EAAA,OAAA,EAAA,CAJjB,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAI9B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,qBAAqB,CAAC;oBAC/D,OAAO,EAAE,CAAC,qBAAqB,CAAC;AAChC,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-watermark.mjs","sources":["../../../src/watermark/config.ts","../../../src/watermark/watermark.directive.ts","../../../src/watermark/watermark.module.ts","../../../src/watermark/ngx-tethys-watermark.ts"],"sourcesContent":["export const DEFAULT_WATERMARK_CONFIG = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n opacity: '0.8',\n 'background-repeat': 'repeat',\n 'pointer-events': 'none',\n 'z-index': 2147483647,\n 'background-image': ''\n};\n\nexport const DEFAULT_CANVAS_CONFIG = {\n degree: 15,\n color: ['rgba(51, 51, 51, 0.12)', 'rgb(60, 65, 74)'],\n fontSize: 12,\n textLineHeight: 20,\n gutter: [250, 200]\n};\n","import { Directive, ElementRef, OnInit, inject, DestroyRef, effect, input, computed } from '@angular/core';\nimport { Subject, Observable } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DEFAULT_WATERMARK_CONFIG, DEFAULT_CANVAS_CONFIG } from './config';\nimport { MutationObserverFactory } from '@angular/cdk/observers';\nimport { coerceBooleanProperty, ThyBooleanInput } from 'ngx-tethys/util';\nimport { ThyThemeStore } from 'ngx-tethys/core';\n\n/**\n * @public\n * 水印样式配置\n */\nexport interface ThyCanvasConfigType {\n /**\n * 偏移角度\n */\n degree?: number;\n /**\n * 字体颜色。如果传的是数组,第一个为默认主题的字体颜色,第二个为黑暗主题的字体颜色\n */\n color?: string | string[];\n /**\n * 字体大小\n */\n fontSize?: number | string;\n /**\n * 文本行高\n */\n textLineHeight?: number;\n /**\n * 横纵间距\n */\n gutter?: number[];\n}\n\n/**\n * 水印指令\n * @name thyWatermark\n */\n@Directive({\n selector: '[thyWatermark]'\n})\nexport class ThyWatermarkDirective implements OnInit {\n private el = inject(ElementRef);\n\n /**\n * 是否禁用,默认为 false\n */\n readonly thyDisabled = input<boolean, ThyBooleanInput>(false, { transform: coerceBooleanProperty });\n\n /**\n * 水印内容\n */\n readonly thyWatermark = input<string>(undefined);\n\n /**\n * 水印样式配置\n */\n readonly thyCanvasConfig = input<ThyCanvasConfigType>(undefined);\n\n readonly content = computed(() => {\n const value = this.thyWatermark()?.replace(/^\\\"|\\\"$/g, '');\n return value || '';\n });\n\n private createWatermark$ = new Subject<string>();\n\n private observer: MutationObserver;\n\n private canvas: HTMLCanvasElement;\n\n private wmDiv: HTMLElement;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private thyThemeStore = inject(ThyThemeStore);\n\n constructor() {\n effect(() => {\n if (!this.thyDisabled() && this.thyThemeStore.theme()) {\n this.refreshWatermark();\n }\n });\n\n effect(() => {\n const thyWatermark = this.thyWatermark();\n if (thyWatermark) {\n this.refreshWatermark();\n }\n });\n\n effect(() => {\n const thyDisabled = this.thyDisabled();\n if (thyDisabled) {\n this.removeWatermark();\n } else {\n this.refreshWatermark();\n }\n });\n }\n\n ngOnInit() {\n if (!this.thyDisabled()) {\n this.createWatermark$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.observeAttributes()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {});\n });\n\n this.createWatermark();\n }\n }\n\n private refreshWatermark() {\n this.removeWatermark();\n this.createWatermark();\n }\n\n private removeWatermark() {\n if (this.wmDiv) {\n this.wmDiv.remove();\n this.wmDiv = null;\n }\n }\n\n createCanvas() {\n let { gutter, fontSize, color, degree, textLineHeight } = {\n ...DEFAULT_CANVAS_CONFIG,\n ...(this.thyCanvasConfig() || {})\n };\n color = this.thyThemeStore.normalizeColor(color);\n\n const [xGutter, yGutter] = gutter;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n const getFakeSize = () => {\n const fakeBox = document.createElement('div');\n const fakeBoxStyle: Record<string, string | number> = {\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'inline-block',\n 'font-size': `${parseFloat('' + fontSize)}px`,\n 'word-wrap': 'break-word',\n 'font-family': 'inherit',\n 'white-space': 'pre-line'\n };\n const styleStr = Object.keys(fakeBoxStyle).reduce((pre, next) => ((pre += `${next}:${fakeBoxStyle[next]};`), pre), '');\n fakeBox.setAttribute('style', styleStr);\n\n fakeBox.innerHTML = this.content().replace(/(\\\\n)/gm, '</br>');\n document.querySelector('body').insertBefore(fakeBox, document.querySelector('body').firstChild);\n const { width, height } = fakeBox.getBoundingClientRect();\n fakeBox.remove();\n return { width, height };\n };\n const { width: fakeBoxWidth, height: fakeBoxHeight } = getFakeSize();\n\n const angle = (degree * Math.PI) / 180;\n const contentArr = this.content().split('\\\\n');\n const canvasHeight = Math.sin(angle) * fakeBoxWidth + fakeBoxHeight;\n\n let start = Math.ceil(Math.sin(angle) * fakeBoxWidth * Math.sin(angle));\n const canvasWidth = start + fakeBoxWidth;\n canvas.setAttribute('width', '' + (canvasWidth + xGutter));\n canvas.setAttribute('height', '' + (canvasHeight + yGutter));\n\n ctx.font = `${parseFloat('' + fontSize)}px microsoft yahei`;\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n ctx.fillStyle = color;\n ctx.rotate(0 - (degree * Math.PI) / 180);\n contentArr.map((k, i) => {\n ctx.fillText(k, -start + Math.ceil(canvasWidth / 2), Math.sin(angle) * canvasWidth + textLineHeight * i);\n start += Math.sin(angle) * textLineHeight;\n });\n this.canvas = canvas;\n return canvas;\n }\n\n private createWatermark(isRefresh = true) {\n const watermarkDiv = this.wmDiv || document.createElement('div');\n\n const background = !isRefresh ? this.canvas.toDataURL() : this.createCanvas().toDataURL();\n const watermarkStyle: Record<string, string | number> = {\n ...DEFAULT_WATERMARK_CONFIG,\n 'background-image': `url(${background})`\n };\n\n const styleStr = Object.keys(watermarkStyle).reduce((pre, next) => ((pre += `${next}:${watermarkStyle[next]};`), pre), '');\n watermarkDiv.setAttribute('style', styleStr);\n\n if (!this.wmDiv) {\n const parentNode = this.el.nativeElement;\n watermarkDiv.classList.add(`_vm`);\n this.wmDiv = watermarkDiv;\n parentNode.insertBefore(watermarkDiv, parentNode.firstChild);\n }\n this.createWatermark$.next('');\n }\n\n private observeAttributes() {\n this.observer?.disconnect();\n return new Observable(observe => {\n const stream = new Subject<MutationRecord[]>();\n this.observer = new MutationObserverFactory().create(mutations => stream.next(mutations));\n if (this.observer) {\n this.observer.observe(this.wmDiv, {\n attributes: true\n });\n }\n stream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.wmDiv) {\n this?.observer?.disconnect();\n this.createWatermark(false);\n }\n });\n observe.next(stream);\n return () => {\n this.observer?.disconnect();\n };\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyWatermarkDirective } from './watermark.directive';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyWatermarkDirective],\n exports: [ThyWatermarkDirective],\n providers: []\n})\nexport class ThyWatermarkModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;A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,EAAA,CAJjB,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAI9B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,qBAAqB,CAAC;oBAC/D,OAAO,EAAE,CAAC,qBAAqB,CAAC;AAChC,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACTD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { Version } from '@angular/core';
2
2
 
3
- const VERSION = new Version('19.0.13');
3
+ const VERSION = new Version('19.1.0-next.0');
4
4
 
5
5
  /**
6
6
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys.mjs","sources":["../../../src/version.ts","../../../src/ngx-tethys.ts"],"sourcesContent":["import { Version } from '@angular/core';\n\nexport const VERSION = new Version('19.0.13');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS;;ACF5C;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys.mjs","sources":["../../../src/version.ts","../../../src/ngx-tethys.ts"],"sourcesContent":["import { Version } from '@angular/core';\n\nexport const VERSION = new Version('19.1.0-next.0');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe;;ACFlD;;AAEG;;;;"}
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  export declare class ThyFormGroupError implements OnInit {
8
8
  private thyParentForm;
9
9
  errors: string[];
10
- thyShowFirst: boolean;
10
+ readonly thyShowFirst: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
11
11
  /**
12
12
  * @type string[]
13
13
  */
@@ -17,6 +17,5 @@ export declare class ThyFormGroupError implements OnInit {
17
17
  isHorizontal: boolean;
18
18
  ngOnInit(): void;
19
19
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormGroupError, never>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroupError, "thy-form-group-error", never, { "thyShowFirst": { "alias": "thyShowFirst"; "required": false; }; "thyErrors": { "alias": "thyErrors"; "required": false; }; }, {}, never, never, true, never>;
21
- static ngAcceptInputType_thyShowFirst: boolean | string | number;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroupError, "thy-form-group-error", never, { "thyShowFirst": { "alias": "thyShowFirst"; "required": false; "isSignal": true; }; "thyErrors": { "alias": "thyErrors"; "required": false; }; }, {}, never, never, true, never>;
22
21
  }
@@ -1,4 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
+ import * as i1 from "ngx-tethys/util";
2
3
  /**
3
4
  * @name thyFormGroupLabel
4
5
  * @order 45
@@ -13,5 +14,5 @@ export declare class ThyFormGroupLabelDirective {
13
14
  set thyLabelRequired(value: boolean);
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormGroupLabelDirective, never>;
15
16
  static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFormGroupLabelDirective, "[thyFormGroupLabel]", never, { "thyLabelText": { "alias": "thyLabelText"; "required": false; }; "thyLabelTranslateKey": { "alias": "thyLabelTranslateKey"; "required": false; }; "thyLabelRequired": { "alias": "thyLabelRequired"; "required": false; }; }, {}, never, never, true, never>;
16
- static ngAcceptInputType_thyLabelRequired: boolean | string | number;
17
+ static ngAcceptInputType_thyLabelRequired: i1.ThyBooleanInput;
17
18
  }
@@ -9,53 +9,48 @@ type TipsMode = 'default' | 'label';
9
9
  export declare class ThyFormGroup implements OnInit {
10
10
  private thyParentForm;
11
11
  private thyTranslate;
12
- labelText: string;
13
- labelRequired: boolean;
14
- labelPaddingTopClear: boolean;
15
- feedbackIcon: string;
16
- feedbackSvgIconName: string;
17
- tips: string;
18
- tipMode: TipsMode;
19
- _rowFill: boolean;
20
- _isFormGroup: boolean;
21
- isHorizontal: boolean;
22
- hasFeedback: boolean;
12
+ protected isHorizontalSignal: import("@angular/core").WritableSignal<boolean>;
23
13
  /**
24
14
  * Label 文本
25
15
  */
26
- set thyLabelText(value: string);
16
+ readonly thyLabelText: import("@angular/core").InputSignal<string>;
27
17
  /**
28
18
  * Label 文本多语言 Key
29
19
  */
30
- set thyLabelTextTranslateKey(value: string);
20
+ readonly thyLabelTextTranslateKey: import("@angular/core").InputSignal<string>;
21
+ protected labelTextSignal: import("@angular/core").Signal<any>;
31
22
  /**
32
23
  * Label 是否显示必填项样式
33
24
  */
34
- set thyLabelRequired(value: boolean);
35
- set thyLabelPaddingTopClear(value: boolean);
25
+ readonly thyLabelRequired: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
26
+ /**
27
+ * 清楚 Label padding 间距
28
+ */
29
+ readonly thyLabelPaddingTopClear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
36
30
  /**
37
31
  * 反馈图标,比如日期输入框显示日期的图标,常用输入 date 表示时间 wtf wtf-schedule-o
38
32
  */
39
- set thyFeedbackIcon(value: string);
33
+ thyFeedbackIcon: import("@angular/core").InputSignalWithTransform<string, string>;
40
34
  /**
41
35
  * 提示文字的显示模式,`label`模式表示在 label 后通过图标+Tooltip 提示, `default`模式在 Form Control 下方直接显示
42
36
  * @type default | label
43
37
  * @default default
44
38
  */
45
- set thyTipsMode(mode: TipsMode);
39
+ thyTipsMode: import("@angular/core").InputSignal<TipsMode>;
46
40
  /**
47
41
  * 提示文案
48
42
  */
49
- set thyTips(value: string);
43
+ readonly thyTips: import("@angular/core").InputSignal<string>;
50
44
  /**
51
45
  * 提示文案的多语言 Key
52
46
  */
53
- set thyTipsTranslateKey(value: string);
47
+ readonly thyTipsTranslateKey: import("@angular/core").InputSignal<string>;
48
+ protected readonly tipsSignal: import("@angular/core").Signal<any>;
54
49
  /**
55
50
  * 是否填充整行, 没有 Label 文本,只有输入框
56
51
  * @default false
57
52
  */
58
- set thyRowFill(value: boolean);
53
+ readonly thyRowFill: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
59
54
  /**
60
55
  * 已废弃
61
56
  * @deprecated please use content because formGroup is same name with angular formGroup directive
@@ -65,11 +60,9 @@ export declare class ThyFormGroup implements OnInit {
65
60
  * 内容自定义模板,`<ng-template #content></ng-template>`
66
61
  */
67
62
  contentTemplate: TemplateRef<any>;
63
+ constructor();
68
64
  ngOnInit(): void;
69
65
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormGroup, never>;
70
- static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroup, "thy-form-group", never, { "thyLabelText": { "alias": "thyLabelText"; "required": false; }; "thyLabelTextTranslateKey": { "alias": "thyLabelTextTranslateKey"; "required": false; }; "thyLabelRequired": { "alias": "thyLabelRequired"; "required": false; }; "thyLabelPaddingTopClear": { "alias": "thyLabelPaddingTopClear"; "required": false; }; "thyFeedbackIcon": { "alias": "thyFeedbackIcon"; "required": false; }; "thyTipsMode": { "alias": "thyTipsMode"; "required": false; }; "thyTips": { "alias": "thyTips"; "required": false; }; "thyTipsTranslateKey": { "alias": "thyTipsTranslateKey"; "required": false; }; "thyRowFill": { "alias": "thyRowFill"; "required": false; }; }, {}, ["contentTemplateRef", "contentTemplate"], ["*"], true, never>;
71
- static ngAcceptInputType_thyLabelRequired: boolean | string | number;
72
- static ngAcceptInputType_thyLabelPaddingTopClear: boolean | string | number;
73
- static ngAcceptInputType_thyRowFill: boolean | string | number;
66
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroup, "thy-form-group", never, { "thyLabelText": { "alias": "thyLabelText"; "required": false; "isSignal": true; }; "thyLabelTextTranslateKey": { "alias": "thyLabelTextTranslateKey"; "required": false; "isSignal": true; }; "thyLabelRequired": { "alias": "thyLabelRequired"; "required": false; "isSignal": true; }; "thyLabelPaddingTopClear": { "alias": "thyLabelPaddingTopClear"; "required": false; "isSignal": true; }; "thyFeedbackIcon": { "alias": "thyFeedbackIcon"; "required": false; "isSignal": true; }; "thyTipsMode": { "alias": "thyTipsMode"; "required": false; "isSignal": true; }; "thyTips": { "alias": "thyTips"; "required": false; "isSignal": true; }; "thyTipsTranslateKey": { "alias": "thyTipsTranslateKey"; "required": false; "isSignal": true; }; "thyRowFill": { "alias": "thyRowFill"; "required": false; "isSignal": true; }; }, {}, ["contentTemplateRef", "contentTemplate"], ["*"], true, never>;
74
67
  }
75
68
  export {};
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * 表单提交指令
@@ -10,7 +10,7 @@ export declare class ThyFormSubmitDirective implements OnInit {
10
10
  /**
11
11
  * Form 验证通过的提交函数
12
12
  */
13
- thyFormSubmit: EventEmitter<any>;
13
+ thyFormSubmit: import("@angular/core").OutputEmitterRef<Event>;
14
14
  ngOnInit(): void;
15
15
  onSubmit($event: Event): void;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormSubmitDirective, never>;
@@ -18,29 +18,27 @@ export declare class ThyFormDirective implements OnInit, AfterViewInit, OnDestro
18
18
  private elementRef;
19
19
  private renderer;
20
20
  private ngZone;
21
- validator: ThyFormValidatorService;
21
+ readonly validator: ThyFormValidatorService;
22
22
  private config;
23
- private layout;
24
- private initialized;
25
23
  private hostRenderer;
26
24
  /**
27
25
  * 布局,默认水平居中 horizontal,其他2种布局待开发
28
26
  * @type horizontal | vertical | inline
29
27
  * @default horizontal
30
28
  */
31
- set thyLayout(value: ThyFormLayout);
32
- get thyLayout(): ThyFormLayout;
29
+ readonly thyLayout: import("@angular/core").InputSignal<ThyFormLayout>;
33
30
  get isHorizontal(): boolean;
31
+ private get layout();
34
32
  /**
35
33
  * Enter 键提交模式。`submit`: Textarea 需要 Ctrl | Command + Enter 提交,其他元素直接 Enter 提交; `alwaysSubmit`: 不管是什么元素 Enter 都提交; `forbidSubmit`: Enter 不提交
36
34
  * @type submit | alwaysSubmit | forbidSubmit
37
35
  * @default submit
38
36
  */
39
- thyEnterKeyMode: ThyEnterKeyMode;
37
+ readonly thyEnterKeyMode: import("@angular/core").InputSignal<ThyEnterKeyMode>;
40
38
  /**
41
39
  * 表单验证规则配置项 (更多内容查看:thyFormValidatorConfig)
42
40
  */
43
- set thyFormValidatorConfig(config: ThyFormValidatorConfig);
41
+ readonly thyFormValidatorConfig: import("@angular/core").InputSignal<ThyFormValidatorConfig>;
44
42
  wasValidated: boolean;
45
43
  onSubmitSuccess: ($event: any) => void;
46
44
  private _unsubscribe;
@@ -54,5 +52,5 @@ export declare class ThyFormDirective implements OnInit, AfterViewInit, OnDestro
54
52
  onKeydown($event: KeyboardEvent): void;
55
53
  ngOnDestroy(): void;
56
54
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormDirective, never>;
57
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFormDirective, "[thyForm],[thy-form]", ["thyForm"], { "thyLayout": { "alias": "thyLayout"; "required": false; }; "thyEnterKeyMode": { "alias": "thyEnterKeyMode"; "required": false; }; "thyFormValidatorConfig": { "alias": "thyFormValidatorConfig"; "required": false; }; }, {}, ["controls"], never, true, never>;
55
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFormDirective, "[thyForm],[thy-form]", ["thyForm"], { "thyLayout": { "alias": "thyLayout"; "required": false; "isSignal": true; }; "thyEnterKeyMode": { "alias": "thyEnterKeyMode"; "required": false; "isSignal": true; }; "thyFormValidatorConfig": { "alias": "thyFormValidatorConfig"; "required": false; "isSignal": true; }; }, {}, ["controls"], never, true, never>;
58
56
  }
@@ -17,11 +17,11 @@ export declare class ThyFormGroupFooter implements OnInit {
17
17
  * @type left | right | center
18
18
  * @default left
19
19
  */
20
- thyAlign: ThyFormGroupFooterAlign;
20
+ readonly thyAlign: import("@angular/core").InputSignal<ThyFormGroupFooterAlign>;
21
21
  footerClassMap: {};
22
22
  private get align();
23
23
  ngOnInit(): void;
24
24
  setFooterClassMap(): void;
25
25
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFormGroupFooter, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroupFooter, "thy-form-group-footer", never, { "thyAlign": { "alias": "thyAlign"; "required": false; }; }, {}, ["description"], ["*"], true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThyFormGroupFooter, "thy-form-group-footer", never, { "thyAlign": { "alias": "thyAlign"; "required": false; "isSignal": true; }; }, {}, ["description"], ["*"], true, never>;
27
27
  }
@@ -10,8 +10,8 @@ export declare class ThyConfirmValidatorDirective implements Validator {
10
10
  /**
11
11
  * 表单控件的校验值
12
12
  */
13
- confirm: string;
13
+ readonly confirm: import("@angular/core").InputSignal<string>;
14
14
  validate(control: AbstractControl): import("@angular/forms").ValidationErrors;
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyConfirmValidatorDirective, never>;
16
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyConfirmValidatorDirective, "[confirm]", never, { "confirm": { "alias": "confirm"; "required": false; }; }, {}, never, never, true, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyConfirmValidatorDirective, "[confirm]", never, { "confirm": { "alias": "confirm"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
17
17
  }
@@ -9,8 +9,8 @@ import * as i0 from "@angular/core";
9
9
  export declare class ThyUniqueCheckValidator implements AsyncValidator {
10
10
  private elementRef;
11
11
  private thyForm;
12
- thyUniqueCheck: (value: any) => Observable<boolean>;
12
+ readonly thyUniqueCheck: import("@angular/core").InputSignal<(value: any) => Observable<boolean>>;
13
13
  validate(ctrl: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null>;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyUniqueCheckValidator, never>;
15
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyUniqueCheckValidator, "[thyUniqueCheck]", never, { "thyUniqueCheck": { "alias": "thyUniqueCheck"; "required": false; }; }, {}, never, never, true, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyUniqueCheckValidator, "[thyUniqueCheck]", never, { "thyUniqueCheck": { "alias": "thyUniqueCheck"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
16
16
  }
@@ -1,4 +1,4 @@
1
- import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
1
+ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ThyFullscreenMode } from './fullscreen.config';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -12,23 +12,23 @@ export declare class ThyFullscreenComponent implements OnInit, OnDestroy {
12
12
  /**
13
13
  * immersive 模式使用了浏览器提供的全屏,整个窗体都全屏,emulated 模式为仿真的,只会在 body 区域全屏
14
14
  * @type immersive | emulated
15
- * @default immersive
16
15
  */
17
- thyMode: ThyFullscreenMode;
16
+ readonly thyMode: import("@angular/core").InputSignal<ThyFullscreenMode>;
18
17
  /**
19
18
  * 打开全屏时需要添加的类名
20
19
  */
21
- thyFullscreenClasses: string;
20
+ readonly thyFullscreenClasses: import("@angular/core").InputSignal<string>;
22
21
  /**
23
22
  * 全屏之后的回调
24
23
  */
25
- thyFullscreenChange: EventEmitter<boolean>;
26
- set fullscreenLaunch(fullscreenLaunch: ElementRef<HTMLButtonElement> | undefined);
24
+ readonly thyFullscreenChange: import("@angular/core").OutputEmitterRef<boolean>;
25
+ readonly fullscreenLaunch: import("@angular/core").Signal<ElementRef<any>>;
27
26
  private ngUnsubscribe$;
28
27
  private fullscreenLaunch$;
28
+ constructor();
29
29
  ngOnInit(): void;
30
30
  private handleFullscreen;
31
31
  ngOnDestroy(): void;
32
32
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFullscreenComponent, never>;
33
- static ɵcmp: i0.ɵɵComponentDeclaration<ThyFullscreenComponent, "thy-fullscreen, [thyFullscreen]", never, { "thyMode": { "alias": "thyMode"; "required": false; }; "thyFullscreenClasses": { "alias": "thyFullscreenClasses"; "required": false; }; }, { "thyFullscreenChange": "thyFullscreenChange"; }, ["fullscreenLaunch"], ["*"], true, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThyFullscreenComponent, "thy-fullscreen, [thyFullscreen]", never, { "thyMode": { "alias": "thyMode"; "required": false; "isSignal": true; }; "thyFullscreenClasses": { "alias": "thyFullscreenClasses"; "required": false; "isSignal": true; }; }, { "thyFullscreenChange": "thyFullscreenChange"; }, ["fullscreenLaunch"], ["*"], true, never>;
34
34
  }
package/grid/flex.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
1
  import * as i0 from "@angular/core";
3
2
  export type ThyFlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
4
3
  export type ThyFlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
@@ -11,38 +10,36 @@ export type ThyFlexShrink = '1' | '0' | 0 | 1;
11
10
  * @name thy-flex, [thyFlex]
12
11
  * @order 20
13
12
  */
14
- export declare class ThyFlex implements OnInit, OnChanges {
13
+ export declare class ThyFlex {
15
14
  private hostRenderer;
16
15
  /**
17
16
  * Flex 方向,为 row 或者 column
18
17
  * @default row
19
18
  */
20
- thyDirection: ThyFlexDirection;
19
+ readonly thyDirection: import("@angular/core").InputSignal<ThyFlexDirection>;
21
20
  /**
22
21
  * Flex Wrap
23
22
  * @default nowrap
24
23
  */
25
- thyWrap: ThyFlexWrap;
24
+ readonly thyWrap: import("@angular/core").InputSignal<ThyFlexWrap>;
26
25
  /**
27
26
  * Justify Content
28
27
  */
29
- thyJustifyContent: ThyFlexJustifyContent;
28
+ readonly thyJustifyContent: import("@angular/core").InputSignal<ThyFlexJustifyContent>;
30
29
  /**
31
30
  * Align Items
32
31
  */
33
- thyAlignItems: ThyFlexAlignItems;
32
+ readonly thyAlignItems: import("@angular/core").InputSignal<ThyFlexAlignItems>;
34
33
  /**
35
34
  * Flex Item 之间的间隙 Gap
36
35
  * @default 0
37
36
  */
38
- thyGap: number;
39
- get direction(): ThyFlexDirection;
37
+ readonly thyGap: import("@angular/core").InputSignal<number>;
38
+ protected readonly direction: import("@angular/core").Signal<ThyFlexDirection>;
40
39
  constructor();
41
- ngOnInit(): void;
42
- ngOnChanges(changes: SimpleChanges): void;
43
40
  private updateClasses;
44
41
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFlex, never>;
45
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFlex, "[thyFlex]", never, { "thyDirection": { "alias": "thyDirection"; "required": false; }; "thyWrap": { "alias": "thyWrap"; "required": false; }; "thyJustifyContent": { "alias": "thyJustifyContent"; "required": false; }; "thyAlignItems": { "alias": "thyAlignItems"; "required": false; }; "thyGap": { "alias": "thyGap"; "required": false; }; }, {}, never, never, true, never>;
42
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFlex, "[thyFlex]", never, { "thyDirection": { "alias": "thyDirection"; "required": false; "isSignal": true; }; "thyWrap": { "alias": "thyWrap"; "required": false; "isSignal": true; }; "thyJustifyContent": { "alias": "thyJustifyContent"; "required": false; "isSignal": true; }; "thyAlignItems": { "alias": "thyAlignItems"; "required": false; "isSignal": true; }; "thyGap": { "alias": "thyGap"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
46
43
  }
47
44
  /**
48
45
  * @internal
@@ -56,32 +53,30 @@ export declare class ThyFlexComponent {
56
53
  * @name thy-flex-item, [thyFlexItem]
57
54
  * @order 25
58
55
  */
59
- export declare class ThyFlexItem implements OnInit, OnChanges {
56
+ export declare class ThyFlexItem {
60
57
  private hostRenderer;
61
58
  /**
62
59
  * Flex Item 属性,表示 grow 、shrink 、basis
63
60
  */
64
- thyFlexItem: 'fill' | string;
61
+ readonly thyFlexItem: import("@angular/core").InputSignal<string>;
65
62
  /**
66
63
  * Flew Grow,设置或检索弹性盒子的扩展比率,设置 1 为填充剩余区域
67
64
  */
68
- thyGrow: ThyFlexGrow;
65
+ readonly thyGrow: import("@angular/core").InputSignal<ThyFlexGrow>;
69
66
  /**
70
67
  * Flex Shrink,设置或检索弹性盒收缩比例
71
68
  * @default 1
72
69
  */
73
- thyShrink: ThyFlexShrink;
70
+ readonly thyShrink: import("@angular/core").InputSignal<ThyFlexShrink>;
74
71
  /**
75
72
  * Flex Basis,设置或检索弹性盒伸缩基准值
76
73
  * @default 1
77
74
  */
78
- thyBasis: string;
75
+ readonly thyBasis: import("@angular/core").InputSignal<string>;
79
76
  constructor();
80
- ngOnInit(): void;
81
- ngOnChanges(changes: SimpleChanges): void;
82
77
  private updateClasses;
83
78
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyFlexItem, never>;
84
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFlexItem, "[thyFlexItem]", never, { "thyFlexItem": { "alias": "thyFlexItem"; "required": false; }; "thyGrow": { "alias": "thyGrow"; "required": false; }; "thyShrink": { "alias": "thyShrink"; "required": false; }; "thyBasis": { "alias": "thyBasis"; "required": false; }; }, {}, never, never, true, never>;
79
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyFlexItem, "[thyFlexItem]", never, { "thyFlexItem": { "alias": "thyFlexItem"; "required": false; "isSignal": true; }; "thyGrow": { "alias": "thyGrow"; "required": false; "isSignal": true; }; "thyShrink": { "alias": "thyShrink"; "required": false; "isSignal": true; }; "thyBasis": { "alias": "thyBasis"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
85
80
  }
86
81
  /**
87
82
  * @internal
@@ -1,4 +1,3 @@
1
- import { OnChanges, AfterViewInit, OnInit, SimpleChanges } from '@angular/core';
2
1
  import { ThyRowDirective } from './thy-row.directive';
3
2
  import * as i0 from "@angular/core";
4
3
  export interface ThyColEmbeddedProperty {
@@ -14,23 +13,21 @@ export type ThySpan = number | null | 'auto';
14
13
  * @name thyCol
15
14
  * @order 35
16
15
  */
17
- export declare class ThyColDirective implements OnInit, OnChanges, AfterViewInit {
16
+ export declare class ThyColDirective {
18
17
  thyRowDirective: ThyRowDirective;
19
18
  /**
20
19
  * 栅格项的占位列数,thySpan 如果传递了值,以 thySpan 为准
21
20
  */
22
- thyCol: ThySpan;
21
+ readonly thyCol: import("@angular/core").InputSignal<ThySpan>;
23
22
  /**
24
23
  * 栅格项的占位列数
25
24
  */
26
- thySpan: ThySpan;
27
- get span(): ThySpan;
25
+ readonly thySpan: import("@angular/core").InputSignal<ThySpan>;
26
+ protected readonly span: import("@angular/core").Signal<ThySpan>;
28
27
  private hostRenderer;
29
28
  private takeUntilDestroyed;
30
- ngOnInit(): void;
31
- ngOnChanges(changes: SimpleChanges): void;
32
- ngAfterViewInit(): void;
29
+ constructor();
33
30
  private updateHostClass;
34
31
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyColDirective, never>;
35
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyColDirective, "[thyCol]", never, { "thyCol": { "alias": "thyCol"; "required": false; }; "thySpan": { "alias": "thySpan"; "required": false; }; }, {}, never, never, true, never>;
32
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyColDirective, "[thyCol]", never, { "thyCol": { "alias": "thyCol"; "required": false; "isSignal": true; }; "thySpan": { "alias": "thySpan"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
36
33
  }
@@ -1,5 +1,4 @@
1
1
  import { ElementRef, OnInit } from '@angular/core';
2
- import { ThyGridResponsiveDescription } from './grid.type';
3
2
  import * as i0 from "@angular/core";
4
3
  /**
5
4
  * 栅格项组件
@@ -13,11 +12,11 @@ export declare class ThyGridItem implements OnInit {
13
12
  * 栅格项的占位列数,为 0 时会隐藏该栅格项
14
13
  * @default 1
15
14
  */
16
- thySpan: number | ThyGridResponsiveDescription;
15
+ readonly thySpan: import("@angular/core").InputSignal<string | number>;
17
16
  /**
18
17
  * 栅格项左侧的偏移列数
19
18
  */
20
- thyOffset: number | ThyGridResponsiveDescription;
19
+ readonly thyOffset: import("@angular/core").InputSignal<string | number>;
21
20
  private readonly destroyRef;
22
21
  private hostRenderer;
23
22
  span: number;
@@ -25,5 +24,5 @@ export declare class ThyGridItem implements OnInit {
25
24
  ngOnInit(): void;
26
25
  private setGridItemStyle;
27
26
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyGridItem, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<ThyGridItem, "thy-grid-item,[thyGridItem]", never, { "thySpan": { "alias": "thySpan"; "required": false; }; "thyOffset": { "alias": "thyOffset"; "required": false; }; }, {}, never, ["*"], true, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThyGridItem, "thy-grid-item,[thyGridItem]", never, { "thySpan": { "alias": "thySpan"; "required": false; "isSignal": true; }; "thyOffset": { "alias": "thyOffset"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
29
28
  }
@@ -1,46 +1,46 @@
1
- import { AfterContentInit, OnChanges, OnInit, QueryList, SimpleChanges } from '@angular/core';
1
+ import { OnInit } from '@angular/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { ThyGridToken } from './grid.token';
4
4
  import { ThyGridItem } from './thy-grid-item.component';
5
- import { ThyGridResponsiveMode, ThyGridResponsiveDescription } from './grid.type';
5
+ import { ThyGridResponsiveMode } from './grid.type';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * 栅格组件
9
9
  * @name thy-grid, [thyGrid]
10
10
  * @order 10
11
11
  */
12
- export declare class ThyGrid implements ThyGridToken, OnInit, OnChanges, AfterContentInit {
12
+ export declare class ThyGrid implements ThyGridToken, OnInit {
13
13
  private elementRef;
14
14
  private viewportRuler;
15
15
  private ngZone;
16
16
  /**
17
17
  * @internal
18
18
  */
19
- gridItems: QueryList<ThyGridItem>;
19
+ readonly gridItems: import("@angular/core").Signal<readonly ThyGridItem[]>;
20
20
  /**
21
21
  * 栅格的列数
22
22
  * @default 24
23
23
  */
24
- thyCols: number | ThyGridResponsiveDescription;
24
+ readonly thyCols: import("@angular/core").InputSignal<string | number>;
25
25
  /**
26
26
  * 栅格的水平间隔
27
27
  */
28
- thyXGap: number | ThyGridResponsiveDescription;
28
+ readonly thyXGap: import("@angular/core").InputSignal<string | number>;
29
29
  /**
30
30
  * 栅格的垂直间隔
31
31
  */
32
- thyYGap: number | ThyGridResponsiveDescription;
32
+ readonly thyYGap: import("@angular/core").InputSignal<string | number>;
33
33
  /**
34
34
  * 栅格的水平和垂直间隔
35
35
  */
36
- thyGap: number | ThyGridResponsiveDescription;
36
+ readonly thyGap: import("@angular/core").InputSignal<string | number>;
37
37
  /**
38
38
  * 响应式栅格列数<br/>
39
39
  * none: 不进行响应式布局。<br/>
40
40
  * self:根据grid的自身宽度进行响应式布局。<br/>
41
41
  * screen:根据屏幕断点进行响应式布局,目前预设了5种响应式尺寸:`xs: 0, sm: 576, md: 768, lg: 992, xl: 1200`。
42
42
  */
43
- thyResponsive: ThyGridResponsiveMode;
43
+ readonly thyResponsive: import("@angular/core").InputSignal<ThyGridResponsiveMode>;
44
44
  private hostRenderer;
45
45
  private cols;
46
46
  xGap: number;
@@ -49,9 +49,8 @@ export declare class ThyGrid implements ThyGridToken, OnInit, OnChanges, AfterCo
49
49
  private responsiveContainerWidth;
50
50
  gridItemPropValueChange$: Subject<void>;
51
51
  private takeUntilDestroyed;
52
+ constructor();
52
53
  ngOnInit(): void;
53
- ngOnChanges(changes: SimpleChanges): void;
54
- ngAfterContentInit(): void;
55
54
  private setGridStyle;
56
55
  private listenResizeEvent;
57
56
  private handleGridItems;
@@ -60,7 +59,7 @@ export declare class ThyGrid implements ThyGridToken, OnInit, OnChanges, AfterCo
60
59
  private calculateBreakPoint;
61
60
  private gridResizeObserver;
62
61
  static ɵfac: i0.ɵɵFactoryDeclaration<ThyGrid, never>;
63
- static ɵdir: i0.ɵɵDirectiveDeclaration<ThyGrid, "[thyGrid]", never, { "thyCols": { "alias": "thyCols"; "required": false; }; "thyXGap": { "alias": "thyXGap"; "required": false; }; "thyYGap": { "alias": "thyYGap"; "required": false; }; "thyGap": { "alias": "thyGap"; "required": false; }; "thyResponsive": { "alias": "thyResponsive"; "required": false; }; }, {}, ["gridItems"], never, true, never>;
62
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ThyGrid, "[thyGrid]", never, { "thyCols": { "alias": "thyCols"; "required": false; "isSignal": true; }; "thyXGap": { "alias": "thyXGap"; "required": false; "isSignal": true; }; "thyYGap": { "alias": "thyYGap"; "required": false; "isSignal": true; }; "thyGap": { "alias": "thyGap"; "required": false; "isSignal": true; }; "thyResponsive": { "alias": "thyResponsive"; "required": false; "isSignal": true; }; }, {}, ["gridItems"], never, true, never>;
64
63
  }
65
64
  /**
66
65
  * @internal