ngx-tethys 19.1.0-next.0 → 19.1.0-next.1
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.
- package/CHANGELOG.md +21 -0
- package/README.md +0 -1
- package/action/action.component.d.ts +7 -8
- package/affix/affix.component.d.ts +3 -4
- package/button/button-group.component.d.ts +5 -12
- package/button/button-icon.component.d.ts +14 -28
- package/button/button.component.d.ts +17 -27
- package/date-picker/styles/calendar.scss +1 -1
- package/date-picker/styles/week-picker.scss +1 -0
- package/dropdown/dropdown-active.directive.d.ts +4 -5
- package/dropdown/dropdown-menu-item.directive.d.ts +7 -15
- package/dropdown/dropdown-menu.component.d.ts +6 -13
- package/dropdown/dropdown-submenu.component.d.ts +2 -4
- package/dropdown/dropdown.directive.d.ts +14 -25
- package/fesm2022/ngx-tethys-action.mjs +15 -16
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +14 -18
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +225 -322
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +1 -0
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +2 -2
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +6 -6
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +155 -203
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-flexible-text.mjs +67 -86
- package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +10 -15
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-icon.mjs +44 -59
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +40 -36
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +7 -11
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +8 -19
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +42 -54
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +115 -157
- package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +111 -157
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-segment.mjs +84 -103
- package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +2 -1
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +37 -56
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +2 -8
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +52 -66
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +98 -119
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +2 -4
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +281 -401
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +53 -99
- package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/flexible-text/flexible-text.component.d.ts +9 -15
- package/grid/flex.d.ts +1 -3
- package/grid/thy-row.directive.d.ts +1 -4
- package/icon/icon.component.d.ts +10 -18
- package/image/image.directive.d.ts +10 -13
- package/image/image.token.d.ts +5 -5
- package/input-number/input-number.component.d.ts +1 -1
- package/package.json +1 -1
- package/progress/progress-circle.component.d.ts +3 -5
- package/progress/progress.component.d.ts +2 -4
- package/property/properties.component.d.ts +0 -2
- package/property/property-item.component.d.ts +3 -10
- package/radio/group/radio-group.component.d.ts +5 -9
- package/rate/rate-item.component.d.ts +8 -11
- package/rate/rate.component.d.ts +18 -29
- package/resizable/resizable.directive.d.ts +18 -31
- package/resizable/resize-handle.component.d.ts +6 -7
- package/resizable/resize-handles.component.d.ts +5 -9
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +9 -15
- package/segment/segment.component.d.ts +11 -15
- package/segment/segment.token.d.ts +4 -3
- package/slide/slide-body/slide-body-section.component.d.ts +2 -6
- package/slide/slide-header/slide-header.component.d.ts +6 -9
- package/space/space.component.d.ts +5 -11
- package/strength/strength.component.d.ts +8 -13
- package/transfer/transfer-list.component.d.ts +15 -15
- package/transfer/transfer.component.d.ts +20 -23
- package/tree/tree-abstract.d.ts +5 -5
- package/tree/tree-node.component.d.ts +24 -37
- package/tree/tree.class.d.ts +4 -4
- package/tree/tree.component.d.ts +47 -75
- package/tree/tree.service.d.ts +3 -4
- package/tree-select/tree-select.component.d.ts +2 -2
- 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,
|
|
2
|
+
import { inject, NgZone, Injectable, ElementRef, Renderer2, input, numberAttribute, output, signal, DestroyRef, afterNextRender, 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';
|
|
@@ -95,109 +95,113 @@ class ThyResizableDirective {
|
|
|
95
95
|
this.platform = inject(Platform);
|
|
96
96
|
this.ngZone = inject(NgZone);
|
|
97
97
|
this.thyResizableService = inject(ThyResizableService);
|
|
98
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
99
98
|
/**
|
|
100
99
|
* 调整尺寸的边界
|
|
101
100
|
* @default parent
|
|
102
101
|
* @type 'window' | 'parent' | ElementRef<HTMLElement>
|
|
103
102
|
*/
|
|
104
|
-
this.thyBounds = 'parent';
|
|
103
|
+
this.thyBounds = input('parent');
|
|
104
|
+
/**
|
|
105
|
+
* 最大高度(超过边界部分忽略)
|
|
106
|
+
*/
|
|
107
|
+
this.thyMaxHeight = input(undefined, { transform: numberAttribute });
|
|
108
|
+
/**
|
|
109
|
+
* 最大宽度(超过边界部分忽略)
|
|
110
|
+
*/
|
|
111
|
+
this.thyMaxWidth = input(undefined, { transform: numberAttribute });
|
|
105
112
|
/**
|
|
106
113
|
* 最小高度
|
|
107
114
|
*/
|
|
108
|
-
this.thyMinHeight = 40;
|
|
115
|
+
this.thyMinHeight = input(40, { transform: numberAttribute });
|
|
109
116
|
/**
|
|
110
117
|
* 最小宽度
|
|
111
118
|
*/
|
|
112
|
-
this.thyMinWidth = 40;
|
|
119
|
+
this.thyMinWidth = input(40, { transform: numberAttribute });
|
|
113
120
|
/**
|
|
114
121
|
* 栅格列数(-1 为不栅格)
|
|
115
122
|
*/
|
|
116
|
-
this.thyGridColumnCount = -1;
|
|
123
|
+
this.thyGridColumnCount = input(-1, { transform: numberAttribute });
|
|
117
124
|
/**
|
|
118
125
|
* 栅格最大列数
|
|
119
126
|
*/
|
|
120
|
-
this.thyMaxColumn = -1;
|
|
127
|
+
this.thyMaxColumn = input(-1, { transform: numberAttribute });
|
|
121
128
|
/**
|
|
122
129
|
* 栅格最小列数
|
|
123
130
|
*/
|
|
124
|
-
this.thyMinColumn = -1;
|
|
131
|
+
this.thyMinColumn = input(-1, { transform: numberAttribute });
|
|
125
132
|
/**
|
|
126
133
|
* 锁定宽高比
|
|
127
134
|
*/
|
|
128
|
-
this.thyLockAspectRatio = false;
|
|
135
|
+
this.thyLockAspectRatio = input(false, { transform: coerceBooleanProperty });
|
|
129
136
|
/**
|
|
130
137
|
* 是否预览模式
|
|
131
138
|
*/
|
|
132
|
-
this.thyPreview = false;
|
|
139
|
+
this.thyPreview = input(false, { transform: coerceBooleanProperty });
|
|
133
140
|
/**
|
|
134
141
|
* 是否禁用调整大小
|
|
135
142
|
*/
|
|
136
|
-
this.thyDisabled = false;
|
|
143
|
+
this.thyDisabled = input(false, { transform: coerceBooleanProperty });
|
|
137
144
|
/**
|
|
138
145
|
* 调整尺寸时的事件
|
|
139
146
|
*/
|
|
140
|
-
this.thyResize =
|
|
147
|
+
this.thyResize = output();
|
|
141
148
|
/**
|
|
142
149
|
* 开始调整尺寸时的事件
|
|
143
150
|
*/
|
|
144
|
-
this.thyResizeStart =
|
|
151
|
+
this.thyResizeStart = output();
|
|
145
152
|
/**
|
|
146
153
|
* 结束调整尺寸时的事件
|
|
147
154
|
*/
|
|
148
|
-
this.thyResizeEnd =
|
|
149
|
-
this.resizing = false;
|
|
155
|
+
this.thyResizeEnd = output();
|
|
156
|
+
this.resizing = signal(false);
|
|
150
157
|
this.sizeCache = null;
|
|
151
158
|
this.ghostElement = null;
|
|
152
159
|
this.currentHandleEvent = null;
|
|
153
160
|
this.destroyRef = inject(DestroyRef);
|
|
154
161
|
this.thyResizableService.handleMouseDownOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
|
|
155
|
-
if (this.thyDisabled) {
|
|
162
|
+
if (this.thyDisabled()) {
|
|
156
163
|
return;
|
|
157
164
|
}
|
|
158
|
-
this.resizing
|
|
165
|
+
this.resizing.set(true);
|
|
159
166
|
const { mouseEvent } = event;
|
|
160
167
|
this.thyResizableService.startResizing(mouseEvent);
|
|
161
168
|
this.currentHandleEvent = event;
|
|
162
169
|
this.setCursor();
|
|
163
170
|
// Re-enter the Angular zone and run the change detection only if there're any `thyResizeStart` listeners,
|
|
164
171
|
// e.g.: `<div thyResizable (thyResizeStart)="..."></div>`.
|
|
165
|
-
|
|
166
|
-
this.ngZone.run(() => this.thyResizeStart.emit({ mouseEvent }));
|
|
167
|
-
}
|
|
172
|
+
this.ngZone.run(() => this.thyResizeStart.emit({ mouseEvent }));
|
|
168
173
|
this.nativeElementRect = this.nativeElement.getBoundingClientRect();
|
|
169
174
|
});
|
|
170
175
|
this.thyResizableService.documentMouseUpOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
|
|
171
|
-
if (this.resizing) {
|
|
176
|
+
if (this.resizing()) {
|
|
172
177
|
this.ngZone.run(() => {
|
|
173
|
-
this.resizing
|
|
174
|
-
this.changeDetectorRef.markForCheck();
|
|
178
|
+
this.resizing.set(false);
|
|
175
179
|
});
|
|
176
180
|
this.thyResizableService.documentMouseUpOutsideAngular$.next(event);
|
|
177
181
|
this.endResize(event);
|
|
178
182
|
}
|
|
179
183
|
});
|
|
180
184
|
this.thyResizableService.documentMouseMoveOutsideAngular$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
|
|
181
|
-
if (this.resizing) {
|
|
185
|
+
if (this.resizing()) {
|
|
182
186
|
this.resize(event);
|
|
183
187
|
}
|
|
184
188
|
});
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
afterNextRender(() => {
|
|
190
|
+
if (!this.platform.isBrowser) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.nativeElement = this.elementRef.nativeElement;
|
|
194
|
+
this.ngZone.runOutsideAngular(() => {
|
|
195
|
+
fromEvent(this.nativeElement, 'mouseenter')
|
|
196
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
197
|
+
.subscribe(() => {
|
|
198
|
+
this.thyResizableService.mouseEnteredOutsideAngular$.next(true);
|
|
199
|
+
});
|
|
200
|
+
fromEvent(this.nativeElement, 'mouseleave')
|
|
201
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
202
|
+
.subscribe(() => {
|
|
203
|
+
this.thyResizableService.mouseEnteredOutsideAngular$.next(false);
|
|
204
|
+
});
|
|
201
205
|
});
|
|
202
206
|
});
|
|
203
207
|
}
|
|
@@ -234,14 +238,12 @@ class ThyResizableDirective {
|
|
|
234
238
|
};
|
|
235
239
|
// Re-enter the Angular zone and run the change detection only if there're any `thyResizeEnd` listeners,
|
|
236
240
|
// e.g.: `<div thyResizable (thyResizeEnd)="..."></div>`.
|
|
237
|
-
|
|
238
|
-
this.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
mouseEvent: event
|
|
242
|
-
});
|
|
241
|
+
this.ngZone.run(() => {
|
|
242
|
+
this.thyResizeEnd.emit({
|
|
243
|
+
...size,
|
|
244
|
+
mouseEvent: event
|
|
243
245
|
});
|
|
244
|
-
}
|
|
246
|
+
});
|
|
245
247
|
this.sizeCache = null;
|
|
246
248
|
this.currentHandleEvent = null;
|
|
247
249
|
}
|
|
@@ -251,7 +253,7 @@ class ThyResizableDirective {
|
|
|
251
253
|
const handleEvent = getEventWithPoint(this.currentHandleEvent.mouseEvent);
|
|
252
254
|
let width = nativeElementRect.width;
|
|
253
255
|
let height = nativeElementRect.height;
|
|
254
|
-
const ratio = this.thyLockAspectRatio ? width / height : -1;
|
|
256
|
+
const ratio = this.thyLockAspectRatio() ? width / height : -1;
|
|
255
257
|
switch (this.currentHandleEvent.direction) {
|
|
256
258
|
case 'bottomRight':
|
|
257
259
|
width = resizeEvent.clientX - nativeElementRect.left;
|
|
@@ -285,15 +287,13 @@ class ThyResizableDirective {
|
|
|
285
287
|
this.sizeCache = { ...size };
|
|
286
288
|
// Re-enter the Angular zone and run the change detection only if there're any `thyResize` listeners,
|
|
287
289
|
// e.g.: `<div thyResizable (thyResize)="..."></div>`.
|
|
288
|
-
|
|
289
|
-
this.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
mouseEvent: event
|
|
293
|
-
});
|
|
290
|
+
this.ngZone.run(() => {
|
|
291
|
+
this.thyResize.emit({
|
|
292
|
+
...size,
|
|
293
|
+
mouseEvent: event
|
|
294
294
|
});
|
|
295
|
-
}
|
|
296
|
-
if (this.thyPreview) {
|
|
295
|
+
});
|
|
296
|
+
if (this.thyPreview()) {
|
|
297
297
|
this.previewResize(size);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -304,10 +304,11 @@ class ThyResizableDirective {
|
|
|
304
304
|
let maxHeight;
|
|
305
305
|
let col = 0;
|
|
306
306
|
let spanWidth = 0;
|
|
307
|
-
let minWidth = this.thyMinWidth;
|
|
307
|
+
let minWidth = this.thyMinWidth();
|
|
308
308
|
let boundWidth = Infinity;
|
|
309
309
|
let boundHeight = Infinity;
|
|
310
|
-
|
|
310
|
+
const bounds = this.thyBounds();
|
|
311
|
+
if (bounds === 'parent') {
|
|
311
312
|
const parent = this.renderer.parentNode(this.nativeElement);
|
|
312
313
|
if (parent instanceof HTMLElement) {
|
|
313
314
|
const parentRect = parent.getBoundingClientRect();
|
|
@@ -315,45 +316,49 @@ class ThyResizableDirective {
|
|
|
315
316
|
boundHeight = parentRect.height;
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
|
-
else if (
|
|
319
|
+
else if (bounds === 'window') {
|
|
319
320
|
if (typeof window !== 'undefined') {
|
|
320
321
|
boundWidth = window.innerWidth;
|
|
321
322
|
boundHeight = window.innerHeight;
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
else if (
|
|
325
|
-
const boundsRect =
|
|
325
|
+
else if (bounds && bounds.nativeElement && bounds.nativeElement instanceof HTMLElement) {
|
|
326
|
+
const boundsRect = bounds.nativeElement.getBoundingClientRect();
|
|
326
327
|
boundWidth = boundsRect.width;
|
|
327
328
|
boundHeight = boundsRect.height;
|
|
328
329
|
}
|
|
329
|
-
maxWidth = ensureInBounds(this.thyMaxWidth, boundWidth);
|
|
330
|
-
maxHeight = ensureInBounds(this.thyMaxHeight, boundHeight);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
330
|
+
maxWidth = ensureInBounds(this.thyMaxWidth(), boundWidth);
|
|
331
|
+
maxHeight = ensureInBounds(this.thyMaxHeight(), boundHeight);
|
|
332
|
+
const gridColumnCount = this.thyGridColumnCount();
|
|
333
|
+
if (gridColumnCount !== -1) {
|
|
334
|
+
spanWidth = maxWidth / gridColumnCount;
|
|
335
|
+
const minColumn = this.thyMinColumn();
|
|
336
|
+
minWidth = minColumn !== -1 ? spanWidth * minColumn : minWidth;
|
|
337
|
+
const maxColumn = this.thyMaxColumn();
|
|
338
|
+
maxWidth = maxColumn !== -1 ? spanWidth * maxColumn : maxWidth;
|
|
335
339
|
}
|
|
340
|
+
const minHeight = this.thyMinHeight();
|
|
336
341
|
if (ratio !== -1) {
|
|
337
342
|
if (/(left|right)/i.test(this.currentHandleEvent.direction)) {
|
|
338
343
|
newWidth = Math.min(Math.max(width, minWidth), maxWidth);
|
|
339
|
-
newHeight = Math.min(Math.max(newWidth / ratio,
|
|
340
|
-
if (newHeight >= maxHeight || newHeight <=
|
|
344
|
+
newHeight = Math.min(Math.max(newWidth / ratio, minHeight), maxHeight);
|
|
345
|
+
if (newHeight >= maxHeight || newHeight <= minHeight) {
|
|
341
346
|
newWidth = Math.min(Math.max(newHeight * ratio, minWidth), maxWidth);
|
|
342
347
|
}
|
|
343
348
|
}
|
|
344
349
|
else {
|
|
345
|
-
newHeight = Math.min(Math.max(height,
|
|
350
|
+
newHeight = Math.min(Math.max(height, minHeight), maxHeight);
|
|
346
351
|
newWidth = Math.min(Math.max(newHeight * ratio, minWidth), maxWidth);
|
|
347
352
|
if (newWidth >= maxWidth || newWidth <= minWidth) {
|
|
348
|
-
newHeight = Math.min(Math.max(newWidth / ratio,
|
|
353
|
+
newHeight = Math.min(Math.max(newWidth / ratio, minHeight), maxHeight);
|
|
349
354
|
}
|
|
350
355
|
}
|
|
351
356
|
}
|
|
352
357
|
else {
|
|
353
358
|
newWidth = Math.min(Math.max(width, minWidth), maxWidth);
|
|
354
|
-
newHeight = Math.min(Math.max(height,
|
|
359
|
+
newHeight = Math.min(Math.max(height, minHeight), maxHeight);
|
|
355
360
|
}
|
|
356
|
-
if (
|
|
361
|
+
if (gridColumnCount !== -1) {
|
|
357
362
|
col = Math.round(newWidth / spanWidth);
|
|
358
363
|
newWidth = col * spanWidth;
|
|
359
364
|
}
|
|
@@ -385,7 +390,7 @@ class ThyResizableDirective {
|
|
|
385
390
|
this.sizeCache = null;
|
|
386
391
|
}
|
|
387
392
|
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: "
|
|
393
|
+
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
394
|
}
|
|
390
395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizableDirective, decorators: [{
|
|
391
396
|
type: Directive,
|
|
@@ -394,49 +399,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
394
399
|
providers: [ThyResizableService],
|
|
395
400
|
host: {
|
|
396
401
|
class: 'thy-resizable',
|
|
397
|
-
'[class.thy-resizable-resizing]': 'resizing',
|
|
398
|
-
'[class.thy-resizable-disabled]': 'thyDisabled'
|
|
402
|
+
'[class.thy-resizable-resizing]': 'resizing()',
|
|
403
|
+
'[class.thy-resizable-disabled]': 'thyDisabled()'
|
|
399
404
|
}
|
|
400
405
|
}]
|
|
401
|
-
}], ctorParameters: () => []
|
|
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
|
-
}] } });
|
|
406
|
+
}], ctorParameters: () => [] });
|
|
440
407
|
|
|
441
408
|
class ThyResizeHandleMouseDownEvent {
|
|
442
409
|
constructor(direction, mouseEvent) {
|
|
@@ -459,15 +426,16 @@ class ThyResizeHandle {
|
|
|
459
426
|
* 调整方向
|
|
460
427
|
* @type top | right | bottom | left | topRight | bottomRight | bottomLeft | topLeft
|
|
461
428
|
*/
|
|
462
|
-
this.thyDirection = 'bottomRight';
|
|
429
|
+
this.thyDirection = input('bottomRight');
|
|
463
430
|
/**
|
|
464
431
|
* 是否展示拖拽线
|
|
432
|
+
* @type boolean
|
|
465
433
|
*/
|
|
466
|
-
this.thyLine = false;
|
|
434
|
+
this.thyLine = input(false, { transform: coerceBooleanProperty });
|
|
467
435
|
/**
|
|
468
436
|
* MouseDown 回调事件
|
|
469
437
|
*/
|
|
470
|
-
this.thyMouseDown =
|
|
438
|
+
this.thyMouseDown = output();
|
|
471
439
|
this.hostRenderer = useHostRenderer();
|
|
472
440
|
this.destroyRef = inject(DestroyRef);
|
|
473
441
|
}
|
|
@@ -487,14 +455,14 @@ class ThyResizeHandle {
|
|
|
487
455
|
merge(fromEvent(this.host.nativeElement, 'mousedown', passiveEventListenerOptions), fromEvent(this.host.nativeElement, 'touchstart', passiveEventListenerOptions))
|
|
488
456
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
489
457
|
.subscribe((event) => {
|
|
490
|
-
this.thyResizableService.handleMouseDownOutsideAngular$.next(new ThyResizeHandleMouseDownEvent(this.thyDirection, event));
|
|
458
|
+
this.thyResizableService.handleMouseDownOutsideAngular$.next(new ThyResizeHandleMouseDownEvent(this.thyDirection(), event));
|
|
491
459
|
});
|
|
492
460
|
});
|
|
493
461
|
}
|
|
494
462
|
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:
|
|
463
|
+
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
464
|
<ng-content></ng-content>
|
|
497
|
-
@if (thyLine) {
|
|
465
|
+
@if (thyLine()) {
|
|
498
466
|
<div class="thy-resizable-handle-line"></div>
|
|
499
467
|
}
|
|
500
468
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -506,33 +474,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
506
474
|
exportAs: 'thyResizeHandle',
|
|
507
475
|
template: `
|
|
508
476
|
<ng-content></ng-content>
|
|
509
|
-
@if (thyLine) {
|
|
477
|
+
@if (thyLine()) {
|
|
510
478
|
<div class="thy-resizable-handle-line"></div>
|
|
511
479
|
}
|
|
512
480
|
`,
|
|
513
481
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
514
482
|
host: {
|
|
515
483
|
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'`,
|
|
484
|
+
'[class.thy-resizable-handle-top]': `thyDirection() === 'top'`,
|
|
485
|
+
'[class.thy-resizable-handle-right]': `thyDirection() === 'right'`,
|
|
486
|
+
'[class.thy-resizable-handle-bottom]': `thyDirection() === 'bottom'`,
|
|
487
|
+
'[class.thy-resizable-handle-left]': `thyDirection() === 'left'`,
|
|
488
|
+
'[class.thy-resizable-handle-topRight]': `thyDirection() === 'topRight'`,
|
|
489
|
+
'[class.thy-resizable-handle-bottomRight]': `thyDirection() === 'bottomRight'`,
|
|
490
|
+
'[class.thy-resizable-handle-bottomLeft]': `thyDirection() === 'bottomLeft'`,
|
|
491
|
+
'[class.thy-resizable-handle-topLeft]': `thyDirection() === 'topLeft'`,
|
|
524
492
|
'[class.thy-resizable-handle-box-hover]': 'entered'
|
|
525
493
|
},
|
|
526
494
|
imports: []
|
|
527
495
|
}]
|
|
528
|
-
}]
|
|
529
|
-
type: Input
|
|
530
|
-
}], thyLine: [{
|
|
531
|
-
type: Input,
|
|
532
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
533
|
-
}], thyMouseDown: [{
|
|
534
|
-
type: Output
|
|
535
|
-
}] } });
|
|
496
|
+
}] });
|
|
536
497
|
|
|
537
498
|
const DEFAULT_RESIZE_DIRECTION = [
|
|
538
499
|
'bottomRight',
|
|
@@ -554,22 +515,20 @@ class ThyResizeHandles {
|
|
|
554
515
|
* 定义调整手柄的方向
|
|
555
516
|
* @type ThyResizeDirection[]
|
|
556
517
|
*/
|
|
557
|
-
this.thyDirections = DEFAULT_RESIZE_DIRECTION;
|
|
518
|
+
this.thyDirections = input(DEFAULT_RESIZE_DIRECTION);
|
|
558
519
|
/**
|
|
559
520
|
* 是否展示拖拽线
|
|
560
521
|
*/
|
|
561
|
-
this.thyLine = false;
|
|
562
|
-
this.directions =
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
this.directions = new Set(changes.thyDirections.currentValue);
|
|
567
|
-
}
|
|
522
|
+
this.thyLine = input(false, { transform: coerceBooleanProperty });
|
|
523
|
+
this.directions = computed(() => {
|
|
524
|
+
const directions = this.thyDirections();
|
|
525
|
+
return new Set(directions);
|
|
526
|
+
});
|
|
568
527
|
}
|
|
569
528
|
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:
|
|
571
|
-
@for (dir of directions; track $index) {
|
|
572
|
-
<thy-resize-handle [thyLine]="thyLine" [thyDirection]="dir"></thy-resize-handle>
|
|
529
|
+
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: `
|
|
530
|
+
@for (dir of directions(); track $index) {
|
|
531
|
+
<thy-resize-handle [thyLine]="thyLine()" [thyDirection]="dir"></thy-resize-handle>
|
|
573
532
|
}
|
|
574
533
|
`, 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
534
|
}
|
|
@@ -579,19 +538,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
579
538
|
selector: 'thy-resize-handles',
|
|
580
539
|
exportAs: 'thyResizeHandles',
|
|
581
540
|
template: `
|
|
582
|
-
@for (dir of directions; track $index) {
|
|
583
|
-
<thy-resize-handle [thyLine]="thyLine" [thyDirection]="dir"></thy-resize-handle>
|
|
541
|
+
@for (dir of directions(); track $index) {
|
|
542
|
+
<thy-resize-handle [thyLine]="thyLine()" [thyDirection]="dir"></thy-resize-handle>
|
|
584
543
|
}
|
|
585
544
|
`,
|
|
586
545
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
587
546
|
imports: [ThyResizeHandle]
|
|
588
547
|
}]
|
|
589
|
-
}]
|
|
590
|
-
type: Input
|
|
591
|
-
}], thyLine: [{
|
|
592
|
-
type: Input,
|
|
593
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
594
|
-
}] } });
|
|
548
|
+
}] });
|
|
595
549
|
|
|
596
550
|
class ThyResizableModule {
|
|
597
551
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyResizableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|