ngx-tethys 19.1.0-next.0 → 19.1.0-next.10

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 (221) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +0 -1
  3. package/action/action.component.d.ts +7 -8
  4. package/affix/affix.component.d.ts +3 -4
  5. package/arrow-switcher/arrow-switcher.component.d.ts +5 -1
  6. package/badge/badge.component.d.ts +1 -1
  7. package/button/button-group.component.d.ts +5 -12
  8. package/button/button-icon.component.d.ts +14 -28
  9. package/button/button.component.d.ts +17 -27
  10. package/color-picker/coordinates.directive.d.ts +1 -2
  11. package/date-picker/abstract-picker.component.d.ts +50 -52
  12. package/date-picker/abstract-picker.directive.d.ts +15 -40
  13. package/date-picker/base-picker.component.d.ts +12 -40
  14. package/date-picker/date-picker.config.d.ts +3 -0
  15. package/date-picker/lib/calendar/calendar-footer.component.d.ts +24 -19
  16. package/date-picker/lib/calendar/calendar-header.component.d.ts +15 -15
  17. package/date-picker/lib/calendar/calendar-table.component.d.ts +15 -16
  18. package/date-picker/lib/date/date-table-cell.component.d.ts +6 -3
  19. package/date-picker/lib/date/date-table.component.d.ts +2 -3
  20. package/date-picker/lib/date-carousel/date-carousel.component.d.ts +2 -3
  21. package/date-picker/lib/decade/decade-header.component.d.ts +2 -5
  22. package/date-picker/lib/decade/decade-table.component.d.ts +3 -5
  23. package/date-picker/lib/month/month-table.component.d.ts +1 -2
  24. package/date-picker/lib/popups/date-popup.component.d.ts +33 -34
  25. package/date-picker/lib/popups/inner-popup.component.d.ts +22 -29
  26. package/date-picker/lib/quarter/quarter-table.component.d.ts +1 -4
  27. package/date-picker/lib/year/year-header.component.d.ts +2 -4
  28. package/date-picker/lib/year/year-table.component.d.ts +2 -4
  29. package/date-picker/month-picker.component.d.ts +2 -2
  30. package/date-picker/picker.component.d.ts +31 -36
  31. package/date-picker/picker.pipes.d.ts +4 -5
  32. package/date-picker/picker.util.d.ts +5 -5
  33. package/date-picker/picker.validators.d.ts +4 -8
  34. package/date-picker/quarter-picker.component.d.ts +2 -3
  35. package/date-picker/styles/calendar.scss +1 -1
  36. package/date-picker/styles/range-picker.scss +1 -0
  37. package/date-picker/styles/week-picker.scss +1 -0
  38. package/date-picker/week-picker.component.d.ts +0 -1
  39. package/date-picker/year-picker.component.d.ts +2 -3
  40. package/dropdown/dropdown-active.directive.d.ts +4 -5
  41. package/dropdown/dropdown-menu-item.directive.d.ts +7 -15
  42. package/dropdown/dropdown-menu.component.d.ts +6 -13
  43. package/dropdown/dropdown-submenu.component.d.ts +2 -4
  44. package/dropdown/dropdown.directive.d.ts +15 -25
  45. package/empty/empty.component.d.ts +2 -1
  46. package/fesm2022/ngx-tethys-action.mjs +15 -16
  47. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  48. package/fesm2022/ngx-tethys-affix.mjs +14 -18
  49. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  50. package/fesm2022/ngx-tethys-arrow-switcher.mjs +15 -3
  51. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  52. package/fesm2022/ngx-tethys-autocomplete.mjs +4 -4
  53. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  54. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  55. package/fesm2022/ngx-tethys-button.mjs +225 -322
  56. package/fesm2022/ngx-tethys-button.mjs.map +1 -1
  57. package/fesm2022/ngx-tethys-carousel.mjs +1 -0
  58. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  59. package/fesm2022/ngx-tethys-cascader.mjs +1 -1
  60. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-checkbox.mjs +2 -2
  62. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-collapse.mjs +2 -2
  64. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-color-picker.mjs +4 -6
  66. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-copy.mjs +2 -2
  68. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-date-picker.mjs +861 -1078
  70. package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-divider.mjs +5 -5
  72. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-dropdown.mjs +159 -209
  74. package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-empty.mjs +5 -2
  76. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-flexible-text.mjs +68 -88
  78. package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-grid.mjs +10 -15
  80. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-i18n.mjs +26 -6
  82. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-icon.mjs +44 -59
  84. package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-image.mjs +44 -42
  86. package/fesm2022/ngx-tethys-image.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  88. package/fesm2022/ngx-tethys-layout.mjs +291 -334
  89. package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
  90. package/fesm2022/ngx-tethys-list.mjs +183 -217
  91. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  92. package/fesm2022/ngx-tethys-message.mjs +29 -36
  93. package/fesm2022/ngx-tethys-message.mjs.map +1 -1
  94. package/fesm2022/ngx-tethys-notify.mjs +33 -41
  95. package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
  96. package/fesm2022/ngx-tethys-progress.mjs +7 -11
  97. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  98. package/fesm2022/ngx-tethys-property.mjs +8 -19
  99. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  100. package/fesm2022/ngx-tethys-radio.mjs +46 -58
  101. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  102. package/fesm2022/ngx-tethys-rate.mjs +115 -157
  103. package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
  104. package/fesm2022/ngx-tethys-resizable.mjs +100 -143
  105. package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
  106. package/fesm2022/ngx-tethys-segment.mjs +84 -103
  107. package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
  108. package/fesm2022/ngx-tethys-select.mjs +164 -228
  109. package/fesm2022/ngx-tethys-select.mjs.map +1 -1
  110. package/fesm2022/ngx-tethys-shared.mjs +423 -586
  111. package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
  112. package/fesm2022/ngx-tethys-skeleton.mjs +1 -2
  113. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  114. package/fesm2022/ngx-tethys-slide.mjs +37 -56
  115. package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
  116. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-space.mjs +2 -8
  118. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  120. package/fesm2022/ngx-tethys-strength.mjs +52 -66
  121. package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
  122. package/fesm2022/ngx-tethys-table.mjs +1 -2
  123. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  124. package/fesm2022/ngx-tethys-time-picker.mjs +244 -271
  125. package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
  126. package/fesm2022/ngx-tethys-tooltip.mjs +109 -93
  127. package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
  128. package/fesm2022/ngx-tethys-transfer.mjs +98 -119
  129. package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
  130. package/fesm2022/ngx-tethys-tree-select.mjs +216 -284
  131. package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
  132. package/fesm2022/ngx-tethys-tree.mjs +281 -401
  133. package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
  134. package/fesm2022/ngx-tethys-upload.mjs +2 -2
  135. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  136. package/fesm2022/ngx-tethys-vote.mjs +53 -99
  137. package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
  138. package/fesm2022/ngx-tethys.mjs +1 -1
  139. package/fesm2022/ngx-tethys.mjs.map +1 -1
  140. package/flexible-text/flexible-text.component.d.ts +9 -15
  141. package/grid/flex.d.ts +1 -3
  142. package/grid/thy-row.directive.d.ts +1 -4
  143. package/i18n/i18n.d.ts +7 -2
  144. package/i18n/locales/de-de.d.ts +5 -1
  145. package/i18n/locales/en-us.d.ts +5 -1
  146. package/i18n/locales/ja-jp.d.ts +5 -1
  147. package/i18n/locales/zh-hans.d.ts +5 -1
  148. package/i18n/locales/zh-hant.d.ts +5 -1
  149. package/icon/icon.component.d.ts +10 -18
  150. package/image/image.directive.d.ts +10 -13
  151. package/image/image.token.d.ts +5 -5
  152. package/image/preview/image-preview.component.d.ts +2 -2
  153. package/input-number/input-number.component.d.ts +1 -1
  154. package/layout/header.component.d.ts +15 -19
  155. package/layout/layout.component.d.ts +3 -2
  156. package/layout/sidebar-header.component.d.ts +7 -8
  157. package/layout/sidebar.component.d.ts +32 -62
  158. package/list/list-item-meta.component.d.ts +7 -9
  159. package/list/list-item.component.d.ts +0 -2
  160. package/list/list.component.d.ts +2 -8
  161. package/list/selection/selection-list.d.ts +33 -46
  162. package/message/abstract/abstract-message.component.d.ts +2 -3
  163. package/message/message-container.component.d.ts +0 -1
  164. package/message/message.component.d.ts +1 -3
  165. package/notify/notify-container.component.d.ts +0 -1
  166. package/notify/notify.component.d.ts +7 -12
  167. package/package.json +1 -1
  168. package/progress/progress-circle.component.d.ts +3 -5
  169. package/progress/progress.component.d.ts +2 -4
  170. package/property/properties.component.d.ts +0 -2
  171. package/property/property-item.component.d.ts +3 -10
  172. package/radio/group/radio-group.component.d.ts +5 -9
  173. package/rate/rate-item.component.d.ts +8 -11
  174. package/rate/rate.component.d.ts +18 -29
  175. package/resizable/resizable.directive.d.ts +20 -32
  176. package/resizable/resize-handle.component.d.ts +6 -7
  177. package/resizable/resize-handles.component.d.ts +5 -9
  178. package/schematics/version.d.ts +1 -1
  179. package/schematics/version.js +1 -1
  180. package/segment/segment-item.component.d.ts +9 -15
  181. package/segment/segment.component.d.ts +11 -15
  182. package/segment/segment.token.d.ts +4 -3
  183. package/select/custom-select/custom-select.component.d.ts +33 -56
  184. package/select/native-select/native-select.component.d.ts +7 -13
  185. package/shared/base-form-check.component.d.ts +6 -8
  186. package/shared/directives/string-or-template-outlet.directive.d.ts +5 -6
  187. package/shared/directives/thy-autofocus.directive.d.ts +4 -6
  188. package/shared/directives/thy-contextmenu.directive.d.ts +2 -2
  189. package/shared/directives/thy-ctrl-enter.directive.d.ts +2 -2
  190. package/shared/directives/thy-enter.directive.d.ts +2 -2
  191. package/shared/directives/thy-scroll.directive.d.ts +5 -8
  192. package/shared/directives/thy-show.d.ts +5 -6
  193. package/shared/directives/thy-stop-propagation.directive.d.ts +4 -4
  194. package/shared/directives/view-outlet.directive.d.ts +6 -7
  195. package/shared/ng-transclude.directive.d.ts +2 -3
  196. package/shared/option/group/option-group.component.d.ts +5 -9
  197. package/shared/option/list-option/list-option.component.d.ts +9 -13
  198. package/shared/option/option.component.d.ts +10 -17
  199. package/shared/option/option.token.d.ts +4 -3
  200. package/shared/option/options-container.component.d.ts +1 -1
  201. package/shared/select/select-control/select-control.component.d.ts +38 -53
  202. package/slide/slide-body/slide-body-section.component.d.ts +2 -6
  203. package/slide/slide-header/slide-header.component.d.ts +6 -9
  204. package/space/space.component.d.ts +5 -11
  205. package/stepper/stepper.component.d.ts +1 -1
  206. package/strength/strength.component.d.ts +8 -13
  207. package/table/table-column.component.d.ts +15 -5
  208. package/time-picker/inner/inner-time-picker.class.d.ts +15 -13
  209. package/time-picker/inner/inner-time-picker.component.d.ts +26 -26
  210. package/time-picker/time-picker-panel.component.d.ts +18 -20
  211. package/time-picker/time-picker.component.d.ts +22 -30
  212. package/tooltip/tooltip.directive.d.ts +20 -22
  213. package/transfer/transfer-list.component.d.ts +15 -15
  214. package/transfer/transfer.component.d.ts +20 -23
  215. package/tree/tree-abstract.d.ts +5 -5
  216. package/tree/tree-node.component.d.ts +24 -37
  217. package/tree/tree.class.d.ts +4 -4
  218. package/tree/tree.component.d.ts +47 -75
  219. package/tree/tree.service.d.ts +3 -4
  220. package/tree-select/tree-select.component.d.ts +54 -71
  221. package/vote/vote.component.d.ts +13 -33
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, NgZone, Injectable, ElementRef, Renderer2, ChangeDetectorRef, EventEmitter, DestroyRef, numberAttribute, Output, Input, Directive, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
2
+ import { inject, NgZone, Injectable, ElementRef, Renderer2, input, numberAttribute, output, signal, DestroyRef, Directive, ChangeDetectionStrategy, Component, computed, NgModule } from '@angular/core';
3
3
  import { DOCUMENT, CommonModule } from '@angular/common';
4
4
  import { isTouchEvent, coerceBooleanProperty } from 'ngx-tethys/util';
5
5
  import { Subject, fromEvent, merge } from 'rxjs';
@@ -89,105 +89,112 @@ function setCompatibleStyle(element, key, value) {
89
89
  * @name thyResizable
90
90
  */
91
91
  class ThyResizableDirective {
92
+ get nativeElement() {
93
+ return this.elementRef.nativeElement;
94
+ }
92
95
  constructor() {
93
96
  this.elementRef = inject(ElementRef);
94
97
  this.renderer = inject(Renderer2);
95
98
  this.platform = inject(Platform);
96
99
  this.ngZone = inject(NgZone);
97
100
  this.thyResizableService = inject(ThyResizableService);
98
- this.changeDetectorRef = inject(ChangeDetectorRef);
99
101
  /**
100
102
  * 调整尺寸的边界
101
103
  * @default parent
102
104
  * @type 'window' | 'parent' | ElementRef<HTMLElement>
103
105
  */
104
- this.thyBounds = 'parent';
106
+ this.thyBounds = input('parent');
107
+ /**
108
+ * 最大高度(超过边界部分忽略)
109
+ */
110
+ this.thyMaxHeight = input(undefined, { transform: numberAttribute });
111
+ /**
112
+ * 最大宽度(超过边界部分忽略)
113
+ */
114
+ this.thyMaxWidth = input(undefined, { transform: numberAttribute });
105
115
  /**
106
116
  * 最小高度
107
117
  */
108
- this.thyMinHeight = 40;
118
+ this.thyMinHeight = input(40, { transform: numberAttribute });
109
119
  /**
110
120
  * 最小宽度
111
121
  */
112
- this.thyMinWidth = 40;
122
+ this.thyMinWidth = input(40, { transform: numberAttribute });
113
123
  /**
114
124
  * 栅格列数(-1 为不栅格)
115
125
  */
116
- this.thyGridColumnCount = -1;
126
+ this.thyGridColumnCount = input(-1, { transform: numberAttribute });
117
127
  /**
118
128
  * 栅格最大列数
119
129
  */
120
- this.thyMaxColumn = -1;
130
+ this.thyMaxColumn = input(-1, { transform: numberAttribute });
121
131
  /**
122
132
  * 栅格最小列数
123
133
  */
124
- this.thyMinColumn = -1;
134
+ this.thyMinColumn = input(-1, { transform: numberAttribute });
125
135
  /**
126
136
  * 锁定宽高比
127
137
  */
128
- this.thyLockAspectRatio = false;
138
+ this.thyLockAspectRatio = input(false, { transform: coerceBooleanProperty });
129
139
  /**
130
140
  * 是否预览模式
131
141
  */
132
- this.thyPreview = false;
142
+ this.thyPreview = input(false, { transform: coerceBooleanProperty });
133
143
  /**
134
144
  * 是否禁用调整大小
135
145
  */
136
- this.thyDisabled = false;
146
+ this.thyDisabled = input(false, { transform: coerceBooleanProperty });
137
147
  /**
138
148
  * 调整尺寸时的事件
139
149
  */
140
- this.thyResize = new EventEmitter();
150
+ this.thyResize = output();
141
151
  /**
142
152
  * 开始调整尺寸时的事件
143
153
  */
144
- this.thyResizeStart = new EventEmitter();
154
+ this.thyResizeStart = output();
145
155
  /**
146
156
  * 结束调整尺寸时的事件
147
157
  */
148
- this.thyResizeEnd = new EventEmitter();
149
- this.resizing = false;
158
+ this.thyResizeEnd = output();
159
+ this.resizing = signal(false);
150
160
  this.sizeCache = null;
151
161
  this.ghostElement = null;
152
162
  this.currentHandleEvent = null;
153
163
  this.destroyRef = inject(DestroyRef);
154
164
  this.thyResizableService.handleMouseDownOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
155
- if (this.thyDisabled) {
165
+ if (this.thyDisabled()) {
156
166
  return;
157
167
  }
158
- this.resizing = true;
168
+ this.resizing.set(true);
159
169
  const { mouseEvent } = event;
160
170
  this.thyResizableService.startResizing(mouseEvent);
161
171
  this.currentHandleEvent = event;
162
172
  this.setCursor();
163
173
  // Re-enter the Angular zone and run the change detection only if there're any `thyResizeStart` listeners,
164
174
  // e.g.: `<div thyResizable (thyResizeStart)="..."></div>`.
165
- if (this.thyResizeStart.observers.length) {
166
- this.ngZone.run(() => this.thyResizeStart.emit({ mouseEvent }));
167
- }
175
+ this.ngZone.run(() => this.thyResizeStart.emit({ mouseEvent }));
168
176
  this.nativeElementRect = this.nativeElement.getBoundingClientRect();
169
177
  });
170
178
  this.thyResizableService.documentMouseUpOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
171
- if (this.resizing) {
179
+ if (this.resizing()) {
172
180
  this.ngZone.run(() => {
173
- this.resizing = false;
174
- this.changeDetectorRef.markForCheck();
181
+ this.resizing.set(false);
175
182
  });
176
183
  this.thyResizableService.documentMouseUpOutsideAngular$.next(event);
177
184
  this.endResize(event);
178
185
  }
179
186
  });
180
187
  this.thyResizableService.documentMouseMoveOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
181
- if (this.resizing) {
188
+ if (this.resizing()) {
182
189
  this.resize(event);
183
190
  }
184
191
  });
192
+ this.bindMouseEnterAndLeaveEvents();
185
193
  }
186
- ngAfterViewInit() {
194
+ bindMouseEnterAndLeaveEvents() {
187
195
  if (!this.platform.isBrowser) {
188
196
  return;
189
197
  }
190
- this.nativeElement = this.elementRef.nativeElement;
191
198
  this.ngZone.runOutsideAngular(() => {
192
199
  fromEvent(this.nativeElement, 'mouseenter')
193
200
  .pipe(takeUntilDestroyed(this.destroyRef))
@@ -234,14 +241,12 @@ class ThyResizableDirective {
234
241
  };
235
242
  // Re-enter the Angular zone and run the change detection only if there're any `thyResizeEnd` listeners,
236
243
  // e.g.: `<div thyResizable (thyResizeEnd)="..."></div>`.
237
- if (this.thyResizeEnd.observers.length) {
238
- this.ngZone.run(() => {
239
- this.thyResizeEnd.emit({
240
- ...size,
241
- mouseEvent: event
242
- });
244
+ this.ngZone.run(() => {
245
+ this.thyResizeEnd.emit({
246
+ ...size,
247
+ mouseEvent: event
243
248
  });
244
- }
249
+ });
245
250
  this.sizeCache = null;
246
251
  this.currentHandleEvent = null;
247
252
  }
@@ -251,7 +256,7 @@ class ThyResizableDirective {
251
256
  const handleEvent = getEventWithPoint(this.currentHandleEvent.mouseEvent);
252
257
  let width = nativeElementRect.width;
253
258
  let height = nativeElementRect.height;
254
- const ratio = this.thyLockAspectRatio ? width / height : -1;
259
+ const ratio = this.thyLockAspectRatio() ? width / height : -1;
255
260
  switch (this.currentHandleEvent.direction) {
256
261
  case 'bottomRight':
257
262
  width = resizeEvent.clientX - nativeElementRect.left;
@@ -285,15 +290,13 @@ class ThyResizableDirective {
285
290
  this.sizeCache = { ...size };
286
291
  // Re-enter the Angular zone and run the change detection only if there're any `thyResize` listeners,
287
292
  // e.g.: `<div thyResizable (thyResize)="..."></div>`.
288
- if (this.thyResize.observers.length) {
289
- this.ngZone.run(() => {
290
- this.thyResize.emit({
291
- ...size,
292
- mouseEvent: event
293
- });
293
+ this.ngZone.run(() => {
294
+ this.thyResize.emit({
295
+ ...size,
296
+ mouseEvent: event
294
297
  });
295
- }
296
- if (this.thyPreview) {
298
+ });
299
+ if (this.thyPreview()) {
297
300
  this.previewResize(size);
298
301
  }
299
302
  }
@@ -304,10 +307,11 @@ class ThyResizableDirective {
304
307
  let maxHeight;
305
308
  let col = 0;
306
309
  let spanWidth = 0;
307
- let minWidth = this.thyMinWidth;
310
+ let minWidth = this.thyMinWidth();
308
311
  let boundWidth = Infinity;
309
312
  let boundHeight = Infinity;
310
- if (this.thyBounds === 'parent') {
313
+ const bounds = this.thyBounds();
314
+ if (bounds === 'parent') {
311
315
  const parent = this.renderer.parentNode(this.nativeElement);
312
316
  if (parent instanceof HTMLElement) {
313
317
  const parentRect = parent.getBoundingClientRect();
@@ -315,45 +319,49 @@ class ThyResizableDirective {
315
319
  boundHeight = parentRect.height;
316
320
  }
317
321
  }
318
- else if (this.thyBounds === 'window') {
322
+ else if (bounds === 'window') {
319
323
  if (typeof window !== 'undefined') {
320
324
  boundWidth = window.innerWidth;
321
325
  boundHeight = window.innerHeight;
322
326
  }
323
327
  }
324
- else if (this.thyBounds && this.thyBounds.nativeElement && this.thyBounds.nativeElement instanceof HTMLElement) {
325
- const boundsRect = this.thyBounds.nativeElement.getBoundingClientRect();
328
+ else if (bounds && bounds.nativeElement && bounds.nativeElement instanceof HTMLElement) {
329
+ const boundsRect = bounds.nativeElement.getBoundingClientRect();
326
330
  boundWidth = boundsRect.width;
327
331
  boundHeight = boundsRect.height;
328
332
  }
329
- maxWidth = ensureInBounds(this.thyMaxWidth, boundWidth);
330
- maxHeight = ensureInBounds(this.thyMaxHeight, boundHeight);
331
- if (this.thyGridColumnCount !== -1) {
332
- spanWidth = maxWidth / this.thyGridColumnCount;
333
- minWidth = this.thyMinColumn !== -1 ? spanWidth * this.thyMinColumn : minWidth;
334
- maxWidth = this.thyMaxColumn !== -1 ? spanWidth * this.thyMaxColumn : maxWidth;
333
+ maxWidth = ensureInBounds(this.thyMaxWidth(), boundWidth);
334
+ maxHeight = ensureInBounds(this.thyMaxHeight(), boundHeight);
335
+ const gridColumnCount = this.thyGridColumnCount();
336
+ if (gridColumnCount !== -1) {
337
+ spanWidth = maxWidth / gridColumnCount;
338
+ const minColumn = this.thyMinColumn();
339
+ minWidth = minColumn !== -1 ? spanWidth * minColumn : minWidth;
340
+ const maxColumn = this.thyMaxColumn();
341
+ maxWidth = maxColumn !== -1 ? spanWidth * maxColumn : maxWidth;
335
342
  }
343
+ const minHeight = this.thyMinHeight();
336
344
  if (ratio !== -1) {
337
345
  if (/(left|right)/i.test(this.currentHandleEvent.direction)) {
338
346
  newWidth = Math.min(Math.max(width, minWidth), maxWidth);
339
- newHeight = Math.min(Math.max(newWidth / ratio, this.thyMinHeight), maxHeight);
340
- if (newHeight >= maxHeight || newHeight <= this.thyMinHeight) {
347
+ newHeight = Math.min(Math.max(newWidth / ratio, minHeight), maxHeight);
348
+ if (newHeight >= maxHeight || newHeight <= minHeight) {
341
349
  newWidth = Math.min(Math.max(newHeight * ratio, minWidth), maxWidth);
342
350
  }
343
351
  }
344
352
  else {
345
- newHeight = Math.min(Math.max(height, this.thyMinHeight), maxHeight);
353
+ newHeight = Math.min(Math.max(height, minHeight), maxHeight);
346
354
  newWidth = Math.min(Math.max(newHeight * ratio, minWidth), maxWidth);
347
355
  if (newWidth >= maxWidth || newWidth <= minWidth) {
348
- newHeight = Math.min(Math.max(newWidth / ratio, this.thyMinHeight), maxHeight);
356
+ newHeight = Math.min(Math.max(newWidth / ratio, minHeight), maxHeight);
349
357
  }
350
358
  }
351
359
  }
352
360
  else {
353
361
  newWidth = Math.min(Math.max(width, minWidth), maxWidth);
354
- newHeight = Math.min(Math.max(height, this.thyMinHeight), maxHeight);
362
+ newHeight = Math.min(Math.max(height, minHeight), maxHeight);
355
363
  }
356
- if (this.thyGridColumnCount !== -1) {
364
+ if (gridColumnCount !== -1) {
357
365
  col = Math.round(newWidth / spanWidth);
358
366
  newWidth = col * spanWidth;
359
367
  }
@@ -385,7 +393,7 @@ class ThyResizableDirective {
385
393
  this.sizeCache = null;
386
394
  }
387
395
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
388
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.8", type: ThyResizableDirective, isStandalone: true, selector: "[thyResizable]", inputs: { thyBounds: "thyBounds", thyMaxHeight: ["thyMaxHeight", "thyMaxHeight", numberAttribute], thyMaxWidth: ["thyMaxWidth", "thyMaxWidth", numberAttribute], thyMinHeight: ["thyMinHeight", "thyMinHeight", numberAttribute], thyMinWidth: ["thyMinWidth", "thyMinWidth", numberAttribute], thyGridColumnCount: ["thyGridColumnCount", "thyGridColumnCount", numberAttribute], thyMaxColumn: ["thyMaxColumn", "thyMaxColumn", numberAttribute], thyMinColumn: ["thyMinColumn", "thyMinColumn", numberAttribute], thyLockAspectRatio: ["thyLockAspectRatio", "thyLockAspectRatio", coerceBooleanProperty], thyPreview: ["thyPreview", "thyPreview", coerceBooleanProperty], thyDisabled: ["thyDisabled", "thyDisabled", coerceBooleanProperty] }, outputs: { thyResize: "thyResize", thyResizeStart: "thyResizeStart", thyResizeEnd: "thyResizeEnd" }, host: { properties: { "class.thy-resizable-resizing": "resizing", "class.thy-resizable-disabled": "thyDisabled" }, classAttribute: "thy-resizable" }, providers: [ThyResizableService], ngImport: i0 }); }
396
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyResizableDirective, isStandalone: true, selector: "[thyResizable]", inputs: { thyBounds: { classPropertyName: "thyBounds", publicName: "thyBounds", isSignal: true, isRequired: false, transformFunction: null }, thyMaxHeight: { classPropertyName: "thyMaxHeight", publicName: "thyMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, thyMaxWidth: { classPropertyName: "thyMaxWidth", publicName: "thyMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, thyMinHeight: { classPropertyName: "thyMinHeight", publicName: "thyMinHeight", isSignal: true, isRequired: false, transformFunction: null }, thyMinWidth: { classPropertyName: "thyMinWidth", publicName: "thyMinWidth", isSignal: true, isRequired: false, transformFunction: null }, thyGridColumnCount: { classPropertyName: "thyGridColumnCount", publicName: "thyGridColumnCount", isSignal: true, isRequired: false, transformFunction: null }, thyMaxColumn: { classPropertyName: "thyMaxColumn", publicName: "thyMaxColumn", isSignal: true, isRequired: false, transformFunction: null }, thyMinColumn: { classPropertyName: "thyMinColumn", publicName: "thyMinColumn", isSignal: true, isRequired: false, transformFunction: null }, thyLockAspectRatio: { classPropertyName: "thyLockAspectRatio", publicName: "thyLockAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, thyPreview: { classPropertyName: "thyPreview", publicName: "thyPreview", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyResize: "thyResize", thyResizeStart: "thyResizeStart", thyResizeEnd: "thyResizeEnd" }, host: { properties: { "class.thy-resizable-resizing": "resizing()", "class.thy-resizable-disabled": "thyDisabled()" }, classAttribute: "thy-resizable" }, providers: [ThyResizableService], ngImport: i0 }); }
389
397
  }
390
398
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizableDirective, decorators: [{
391
399
  type: Directive,
@@ -394,49 +402,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
394
402
  providers: [ThyResizableService],
395
403
  host: {
396
404
  class: 'thy-resizable',
397
- '[class.thy-resizable-resizing]': 'resizing',
398
- '[class.thy-resizable-disabled]': 'thyDisabled'
405
+ '[class.thy-resizable-resizing]': 'resizing()',
406
+ '[class.thy-resizable-disabled]': 'thyDisabled()'
399
407
  }
400
408
  }]
401
- }], ctorParameters: () => [], propDecorators: { thyBounds: [{
402
- type: Input
403
- }], thyMaxHeight: [{
404
- type: Input,
405
- args: [{ transform: numberAttribute }]
406
- }], thyMaxWidth: [{
407
- type: Input,
408
- args: [{ transform: numberAttribute }]
409
- }], thyMinHeight: [{
410
- type: Input,
411
- args: [{ transform: numberAttribute }]
412
- }], thyMinWidth: [{
413
- type: Input,
414
- args: [{ transform: numberAttribute }]
415
- }], thyGridColumnCount: [{
416
- type: Input,
417
- args: [{ transform: numberAttribute }]
418
- }], thyMaxColumn: [{
419
- type: Input,
420
- args: [{ transform: numberAttribute }]
421
- }], thyMinColumn: [{
422
- type: Input,
423
- args: [{ transform: numberAttribute }]
424
- }], thyLockAspectRatio: [{
425
- type: Input,
426
- args: [{ transform: coerceBooleanProperty }]
427
- }], thyPreview: [{
428
- type: Input,
429
- args: [{ transform: coerceBooleanProperty }]
430
- }], thyDisabled: [{
431
- type: Input,
432
- args: [{ transform: coerceBooleanProperty }]
433
- }], thyResize: [{
434
- type: Output
435
- }], thyResizeStart: [{
436
- type: Output
437
- }], thyResizeEnd: [{
438
- type: Output
439
- }] } });
409
+ }], ctorParameters: () => [] });
440
410
 
441
411
  class ThyResizeHandleMouseDownEvent {
442
412
  constructor(direction, mouseEvent) {
@@ -459,15 +429,16 @@ class ThyResizeHandle {
459
429
  * 调整方向
460
430
  * @type top | right | bottom | left | topRight | bottomRight | bottomLeft | topLeft
461
431
  */
462
- this.thyDirection = 'bottomRight';
432
+ this.thyDirection = input('bottomRight');
463
433
  /**
464
434
  * 是否展示拖拽线
435
+ * @type boolean
465
436
  */
466
- this.thyLine = false;
437
+ this.thyLine = input(false, { transform: coerceBooleanProperty });
467
438
  /**
468
439
  * MouseDown 回调事件
469
440
  */
470
- this.thyMouseDown = new EventEmitter();
441
+ this.thyMouseDown = output();
471
442
  this.hostRenderer = useHostRenderer();
472
443
  this.destroyRef = inject(DestroyRef);
473
444
  }
@@ -487,14 +458,14 @@ class ThyResizeHandle {
487
458
  merge(fromEvent(this.host.nativeElement, 'mousedown', passiveEventListenerOptions), fromEvent(this.host.nativeElement, 'touchstart', passiveEventListenerOptions))
488
459
  .pipe(takeUntilDestroyed(this.destroyRef))
489
460
  .subscribe((event) => {
490
- this.thyResizableService.handleMouseDownOutsideAngular$.next(new ThyResizeHandleMouseDownEvent(this.thyDirection, event));
461
+ this.thyResizableService.handleMouseDownOutsideAngular$.next(new ThyResizeHandleMouseDownEvent(this.thyDirection(), event));
491
462
  });
492
463
  });
493
464
  }
494
465
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizeHandle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
495
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyResizeHandle, isStandalone: true, selector: "thy-resize-handle, [thy-resize-handle]", inputs: { thyDirection: "thyDirection", thyLine: ["thyLine", "thyLine", coerceBooleanProperty] }, outputs: { thyMouseDown: "thyMouseDown" }, host: { properties: { "class.thy-resizable-handle-top": "thyDirection === 'top'", "class.thy-resizable-handle-right": "thyDirection === 'right'", "class.thy-resizable-handle-bottom": "thyDirection === 'bottom'", "class.thy-resizable-handle-left": "thyDirection === 'left'", "class.thy-resizable-handle-topRight": "thyDirection === 'topRight'", "class.thy-resizable-handle-bottomRight": "thyDirection === 'bottomRight'", "class.thy-resizable-handle-bottomLeft": "thyDirection === 'bottomLeft'", "class.thy-resizable-handle-topLeft": "thyDirection === 'topLeft'", "class.thy-resizable-handle-box-hover": "entered" }, classAttribute: "thy-resizable-handle" }, exportAs: ["thyResizeHandle"], ngImport: i0, template: `
466
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyResizeHandle, isStandalone: true, selector: "thy-resize-handle, [thy-resize-handle]", inputs: { thyDirection: { classPropertyName: "thyDirection", publicName: "thyDirection", isSignal: true, isRequired: false, transformFunction: null }, thyLine: { classPropertyName: "thyLine", publicName: "thyLine", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyMouseDown: "thyMouseDown" }, host: { properties: { "class.thy-resizable-handle-top": "thyDirection() === 'top'", "class.thy-resizable-handle-right": "thyDirection() === 'right'", "class.thy-resizable-handle-bottom": "thyDirection() === 'bottom'", "class.thy-resizable-handle-left": "thyDirection() === 'left'", "class.thy-resizable-handle-topRight": "thyDirection() === 'topRight'", "class.thy-resizable-handle-bottomRight": "thyDirection() === 'bottomRight'", "class.thy-resizable-handle-bottomLeft": "thyDirection() === 'bottomLeft'", "class.thy-resizable-handle-topLeft": "thyDirection() === 'topLeft'", "class.thy-resizable-handle-box-hover": "entered" }, classAttribute: "thy-resizable-handle" }, exportAs: ["thyResizeHandle"], ngImport: i0, template: `
496
467
  <ng-content></ng-content>
497
- @if (thyLine) {
468
+ @if (thyLine()) {
498
469
  <div class="thy-resizable-handle-line"></div>
499
470
  }
500
471
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -506,33 +477,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
506
477
  exportAs: 'thyResizeHandle',
507
478
  template: `
508
479
  <ng-content></ng-content>
509
- @if (thyLine) {
480
+ @if (thyLine()) {
510
481
  <div class="thy-resizable-handle-line"></div>
511
482
  }
512
483
  `,
513
484
  changeDetection: ChangeDetectionStrategy.OnPush,
514
485
  host: {
515
486
  class: 'thy-resizable-handle',
516
- '[class.thy-resizable-handle-top]': `thyDirection === 'top'`,
517
- '[class.thy-resizable-handle-right]': `thyDirection === 'right'`,
518
- '[class.thy-resizable-handle-bottom]': `thyDirection === 'bottom'`,
519
- '[class.thy-resizable-handle-left]': `thyDirection === 'left'`,
520
- '[class.thy-resizable-handle-topRight]': `thyDirection === 'topRight'`,
521
- '[class.thy-resizable-handle-bottomRight]': `thyDirection === 'bottomRight'`,
522
- '[class.thy-resizable-handle-bottomLeft]': `thyDirection === 'bottomLeft'`,
523
- '[class.thy-resizable-handle-topLeft]': `thyDirection === 'topLeft'`,
487
+ '[class.thy-resizable-handle-top]': `thyDirection() === 'top'`,
488
+ '[class.thy-resizable-handle-right]': `thyDirection() === 'right'`,
489
+ '[class.thy-resizable-handle-bottom]': `thyDirection() === 'bottom'`,
490
+ '[class.thy-resizable-handle-left]': `thyDirection() === 'left'`,
491
+ '[class.thy-resizable-handle-topRight]': `thyDirection() === 'topRight'`,
492
+ '[class.thy-resizable-handle-bottomRight]': `thyDirection() === 'bottomRight'`,
493
+ '[class.thy-resizable-handle-bottomLeft]': `thyDirection() === 'bottomLeft'`,
494
+ '[class.thy-resizable-handle-topLeft]': `thyDirection() === 'topLeft'`,
524
495
  '[class.thy-resizable-handle-box-hover]': 'entered'
525
496
  },
526
497
  imports: []
527
498
  }]
528
- }], propDecorators: { thyDirection: [{
529
- type: Input
530
- }], thyLine: [{
531
- type: Input,
532
- args: [{ transform: coerceBooleanProperty }]
533
- }], thyMouseDown: [{
534
- type: Output
535
- }] } });
499
+ }] });
536
500
 
537
501
  const DEFAULT_RESIZE_DIRECTION = [
538
502
  'bottomRight',
@@ -554,22 +518,20 @@ class ThyResizeHandles {
554
518
  * 定义调整手柄的方向
555
519
  * @type ThyResizeDirection[]
556
520
  */
557
- this.thyDirections = DEFAULT_RESIZE_DIRECTION;
521
+ this.thyDirections = input(DEFAULT_RESIZE_DIRECTION);
558
522
  /**
559
523
  * 是否展示拖拽线
560
524
  */
561
- this.thyLine = false;
562
- this.directions = new Set(this.thyDirections);
563
- }
564
- ngOnChanges(changes) {
565
- if (changes.thyDirections) {
566
- this.directions = new Set(changes.thyDirections.currentValue);
567
- }
525
+ this.thyLine = input(false, { transform: coerceBooleanProperty });
526
+ this.directions = computed(() => {
527
+ const directions = this.thyDirections();
528
+ return new Set(directions);
529
+ });
568
530
  }
569
531
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizeHandles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyResizeHandles, isStandalone: true, selector: "thy-resize-handles", inputs: { thyDirections: "thyDirections", thyLine: ["thyLine", "thyLine", coerceBooleanProperty] }, exportAs: ["thyResizeHandles"], usesOnChanges: true, ngImport: i0, template: `
571
- @for (dir of directions; track $index) {
572
- <thy-resize-handle [thyLine]="thyLine" [thyDirection]="dir"></thy-resize-handle>
532
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyResizeHandles, isStandalone: true, selector: "thy-resize-handles", inputs: { thyDirections: { classPropertyName: "thyDirections", publicName: "thyDirections", isSignal: true, isRequired: false, transformFunction: null }, thyLine: { classPropertyName: "thyLine", publicName: "thyLine", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["thyResizeHandles"], ngImport: i0, template: `
533
+ @for (dir of directions(); track $index) {
534
+ <thy-resize-handle [thyLine]="thyLine()" [thyDirection]="dir"></thy-resize-handle>
573
535
  }
574
536
  `, isInline: true, dependencies: [{ kind: "component", type: ThyResizeHandle, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
575
537
  }
@@ -579,19 +541,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
579
541
  selector: 'thy-resize-handles',
580
542
  exportAs: 'thyResizeHandles',
581
543
  template: `
582
- @for (dir of directions; track $index) {
583
- <thy-resize-handle [thyLine]="thyLine" [thyDirection]="dir"></thy-resize-handle>
544
+ @for (dir of directions(); track $index) {
545
+ <thy-resize-handle [thyLine]="thyLine()" [thyDirection]="dir"></thy-resize-handle>
584
546
  }
585
547
  `,
586
548
  changeDetection: ChangeDetectionStrategy.OnPush,
587
549
  imports: [ThyResizeHandle]
588
550
  }]
589
- }], propDecorators: { thyDirections: [{
590
- type: Input
591
- }], thyLine: [{
592
- type: Input,
593
- args: [{ transform: coerceBooleanProperty }]
594
- }] } });
551
+ }] });
595
552
 
596
553
  class ThyResizableModule {
597
554
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }