ngx-tethys 19.0.16 → 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 +31 -11
- package/README.md +0 -1
- package/action/action.component.d.ts +14 -23
- package/action/actions.component.d.ts +5 -7
- package/affix/affix.component.d.ts +9 -13
- package/alert/alert.component.d.ts +1 -1
- package/anchor/anchor-link.component.d.ts +8 -8
- package/anchor/anchor.component.d.ts +15 -21
- package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
- package/autocomplete/autocomplete.component.d.ts +10 -17
- package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
- package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
- package/avatar/avatar.component.d.ts +25 -39
- package/back-top/back-top.component.d.ts +9 -12
- package/badge/badge.component.d.ts +19 -59
- package/breadcrumb/breadcrumb.component.d.ts +15 -20
- package/button/button-group.component.d.ts +5 -12
- package/button/button-icon.component.d.ts +14 -27
- package/button/button.component.d.ts +17 -26
- package/calendar/calendar-header.component.d.ts +9 -8
- package/calendar/calendar.component.d.ts +16 -16
- package/card/card.component.d.ts +5 -11
- package/card/content.component.d.ts +3 -8
- package/card/header.component.d.ts +7 -8
- package/carousel/carousel.component.d.ts +22 -27
- package/cascader/cascader-li.component.d.ts +13 -21
- package/cascader/cascader-search-option.component.d.ts +8 -16
- package/cascader/cascader.component.d.ts +58 -80
- package/checkbox/checkbox.component.d.ts +2 -5
- package/collapse/collapse-item.component.d.ts +12 -19
- package/collapse/collapse.component.d.ts +6 -12
- package/collapse/collapse.token.d.ts +3 -3
- package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
- package/color-picker/color-picker-panel.component.d.ts +7 -11
- package/color-picker/color-picker.component.d.ts +19 -35
- package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
- package/color-picker/parts/hue/hue.component.d.ts +6 -6
- package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
- package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
- package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
- package/comment/comment.component.d.ts +4 -5
- package/copy/copy.directive.d.ts +8 -9
- package/date-picker/abstract-picker.component.d.ts +8 -7
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
- package/date-picker/picker.component.d.ts +2 -1
- package/date-range/date-range.component.d.ts +2 -2
- package/dialog/body/dialog-body.component.d.ts +2 -6
- package/dialog/confirm/confirm.component.d.ts +2 -2
- package/dialog/footer/dialog-footer.component.d.ts +6 -9
- package/dialog/header/dialog-header.component.d.ts +9 -11
- package/divider/divider.component.d.ts +12 -16
- package/dot/dot.component.d.ts +5 -13
- package/drag-drop/drag-handle.directive.d.ts +2 -1
- package/drag-drop/drag.directive.d.ts +2 -1
- package/drag-drop/drop-container.directive.d.ts +2 -1
- package/dropdown/dropdown-active.directive.d.ts +4 -5
- package/dropdown/dropdown-menu-item.directive.d.ts +7 -14
- package/dropdown/dropdown-menu.component.d.ts +6 -12
- package/dropdown/dropdown-submenu.component.d.ts +2 -4
- package/dropdown/dropdown.directive.d.ts +14 -24
- package/empty/empty.component.d.ts +21 -27
- package/fesm2022/ngx-tethys-action.mjs +63 -101
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +40 -41
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-anchor.mjs +91 -118
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +117 -162
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +33 -46
- package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.mjs +104 -208
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
- package/fesm2022/ngx-tethys-breadcrumb.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-calendar.mjs +85 -87
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +72 -77
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +83 -99
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +313 -468
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +66 -71
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +16 -10
- package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +25 -28
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +81 -82
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +49 -58
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +45 -68
- package/fesm2022/ngx-tethys-dot.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-empty.mjs +107 -95
- package/fesm2022/ngx-tethys-empty.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-form.mjs +161 -200
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +161 -158
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +25 -25
- package/fesm2022/ngx-tethys-i18n.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 +101 -114
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +268 -271
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +1 -1
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +17 -35
- package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
- package/fesm2022/ngx-tethys-mention.mjs +52 -74
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +106 -179
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +169 -201
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +230 -294
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +67 -70
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +194 -246
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +99 -113
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +60 -76
- 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-result.mjs +46 -28
- package/fesm2022/ngx-tethys-result.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-skeleton.mjs +339 -342
- package/fesm2022/ngx-tethys-skeleton.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 +75 -108
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +25 -51
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +114 -151
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +74 -107
- package/fesm2022/ngx-tethys-stepper.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-switch.mjs +80 -140
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +1 -1
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +69 -87
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +42 -64
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +104 -129
- package/fesm2022/ngx-tethys-timeline.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-typography.mjs +36 -33
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +93 -132
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.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-watermark.mjs +36 -40
- package/fesm2022/ngx-tethys-watermark.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/form/form-group-error/form-group-error.component.d.ts +2 -3
- package/form/form-group-label.directive.d.ts +2 -1
- package/form/form-group.component.d.ts +17 -24
- package/form/form-submit.directive.d.ts +2 -2
- package/form/form.directive.d.ts +6 -8
- package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
- package/form/validator/confirm-validator.directive.d.ts +2 -2
- package/form/validator/unique-validator.directive.d.ts +2 -2
- package/fullscreen/fullscreen.component.d.ts +7 -7
- package/grid/flex.d.ts +13 -20
- package/grid/thy-col.directive.d.ts +6 -9
- package/grid/thy-grid-item.component.d.ts +3 -4
- package/grid/thy-grid.component.d.ts +11 -12
- package/grid/thy-row.directive.d.ts +11 -14
- package/icon/icon.component.d.ts +10 -17
- package/image/image.directive.d.ts +10 -12
- package/image/image.token.d.ts +5 -5
- package/input/input-count.component.d.ts +4 -5
- package/input/input-group.component.d.ts +20 -20
- package/input/input-search.component.d.ts +15 -20
- package/input/input.component.d.ts +20 -21
- package/input/input.directive.d.ts +4 -6
- package/input-number/input-number.component.d.ts +21 -29
- package/layout/header.component.d.ts +4 -9
- package/layout/sidebar-header.component.d.ts +2 -1
- package/layout/sidebar.component.d.ts +8 -7
- package/list/list.component.d.ts +2 -1
- package/list/selection/selection-list.d.ts +4 -3
- package/loading/loading.component.d.ts +4 -10
- package/mention/mention.directive.d.ts +6 -7
- package/mention/suggestions/suggestions.component.d.ts +8 -9
- package/menu/group/menu-group.component.d.ts +16 -33
- package/menu/item/action/menu-item-action.component.d.ts +7 -8
- package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
- package/menu/item/menu-item.component.d.ts +4 -4
- package/menu/item/name/menu-item-name.component.d.ts +2 -3
- package/menu/menu.component.d.ts +3 -7
- package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
- package/nav/icon-nav/icon-nav.component.d.ts +3 -8
- package/nav/nav-ink-bar.directive.d.ts +4 -6
- package/nav/nav-item.directive.d.ts +7 -10
- package/nav/nav.component.d.ts +20 -48
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +48 -109
- package/popover/header/popover-header.component.d.ts +7 -6
- package/popover/popover.directive.d.ts +11 -18
- package/progress/progress-circle.component.d.ts +35 -26
- package/progress/progress-strip.component.d.ts +10 -14
- package/progress/progress.component.d.ts +16 -26
- package/property/examples/single/single.component.scss +6 -0
- package/property/properties.component.d.ts +6 -15
- package/property/property-item.component.d.ts +22 -34
- package/property/styles/properties.scss +124 -52
- package/property-operation/property-operation.component.d.ts +6 -5
- package/radio/button/radio-button.component.d.ts +2 -2
- package/radio/group/radio-group.component.d.ts +13 -16
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.token.d.ts +2 -2
- package/rate/rate-item.component.d.ts +8 -10
- package/rate/rate.component.d.ts +20 -30
- package/resizable/resizable.directive.d.ts +18 -36
- package/resizable/resize-handle.component.d.ts +6 -6
- package/resizable/resize-handles.component.d.ts +5 -8
- package/result/result.component.d.ts +9 -10
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +9 -14
- package/segment/segment.component.d.ts +11 -14
- package/segment/segment.token.d.ts +4 -3
- package/select/custom-select/custom-select.component.d.ts +11 -10
- package/select/native-select/native-select.component.d.ts +2 -1
- package/shared/base-form-check.component.d.ts +3 -2
- package/shared/directives/thy-autofocus.directive.d.ts +3 -2
- package/shared/directives/thy-scroll.directive.d.ts +2 -1
- package/shared/directives/thy-show.d.ts +2 -1
- package/shared/option/group/option-group.component.d.ts +2 -1
- package/shared/option/list-option/list-option.component.d.ts +2 -7
- package/shared/option/option.component.d.ts +2 -1
- package/shared/select/select-control/select-control.component.d.ts +7 -6
- package/skeleton/skeleton-circle.component.d.ts +16 -19
- package/skeleton/skeleton-rectangle.component.d.ts +20 -23
- package/skeleton/skeleton.component.d.ts +5 -6
- package/skeleton/stylized/bullet-list.component.d.ts +11 -13
- package/skeleton/stylized/list.component.d.ts +10 -12
- package/skeleton/stylized/paragraph.component.d.ts +12 -14
- package/slide/slide-body/slide-body-section.component.d.ts +2 -5
- package/slide/slide-header/slide-header.component.d.ts +6 -9
- package/slider/slider.component.d.ts +17 -24
- package/space/space.component.d.ts +10 -16
- package/statistic/statistic.component.d.ts +35 -40
- package/stepper/step-header.component.d.ts +6 -10
- package/stepper/step.component.d.ts +6 -6
- package/stepper/stepper.component.d.ts +15 -20
- package/strength/strength.component.d.ts +8 -13
- package/switch/switch.component.d.ts +24 -35
- package/table/table-column.component.d.ts +6 -5
- package/table/table-skeleton.component.d.ts +3 -10
- package/table/table.component.d.ts +11 -10
- package/tabs/tab-content.component.d.ts +4 -4
- package/tabs/tab.component.d.ts +4 -5
- package/tabs/tabs.component.d.ts +13 -15
- package/tag/tag.component.d.ts +10 -16
- package/time-picker/time-picker-panel.component.d.ts +3 -2
- package/time-picker/time-picker.component.d.ts +6 -5
- package/timeline/timeline-item.component.d.ts +9 -13
- package/timeline/timeline.component.d.ts +13 -17
- package/tooltip/tooltip.directive.d.ts +3 -2
- 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 -46
- package/tree/tree.class.d.ts +4 -4
- package/tree/tree.component.d.ts +47 -74
- package/tree/tree.service.d.ts +3 -4
- package/tree-select/tree-select.component.d.ts +10 -9
- package/typography/bg-color.directive.d.ts +3 -3
- package/typography/text/text.component.d.ts +2 -2
- package/typography/text-color.directive.d.ts +3 -3
- package/upload/file-drop.directive.d.ts +9 -11
- package/upload/file-select-base.d.ts +6 -10
- package/upload/file-select.component.d.ts +10 -20
- package/util/helpers/helpers.d.ts +2 -1
- package/vote/vote.component.d.ts +13 -32
- package/watermark/watermark.directive.d.ts +7 -9
|
@@ -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 }); }
|