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.
- package/CHANGELOG.md +126 -0
- package/README.md +0 -1
- package/action/action.component.d.ts +7 -8
- package/affix/affix.component.d.ts +3 -4
- package/arrow-switcher/arrow-switcher.component.d.ts +5 -1
- package/badge/badge.component.d.ts +1 -1
- 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/color-picker/coordinates.directive.d.ts +1 -2
- package/date-picker/abstract-picker.component.d.ts +50 -52
- package/date-picker/abstract-picker.directive.d.ts +15 -40
- package/date-picker/base-picker.component.d.ts +12 -40
- package/date-picker/date-picker.config.d.ts +3 -0
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +24 -19
- package/date-picker/lib/calendar/calendar-header.component.d.ts +15 -15
- package/date-picker/lib/calendar/calendar-table.component.d.ts +15 -16
- package/date-picker/lib/date/date-table-cell.component.d.ts +6 -3
- package/date-picker/lib/date/date-table.component.d.ts +2 -3
- package/date-picker/lib/date-carousel/date-carousel.component.d.ts +2 -3
- package/date-picker/lib/decade/decade-header.component.d.ts +2 -5
- package/date-picker/lib/decade/decade-table.component.d.ts +3 -5
- package/date-picker/lib/month/month-table.component.d.ts +1 -2
- package/date-picker/lib/popups/date-popup.component.d.ts +33 -34
- package/date-picker/lib/popups/inner-popup.component.d.ts +22 -29
- package/date-picker/lib/quarter/quarter-table.component.d.ts +1 -4
- package/date-picker/lib/year/year-header.component.d.ts +2 -4
- package/date-picker/lib/year/year-table.component.d.ts +2 -4
- package/date-picker/month-picker.component.d.ts +2 -2
- package/date-picker/picker.component.d.ts +31 -36
- package/date-picker/picker.pipes.d.ts +4 -5
- package/date-picker/picker.util.d.ts +5 -5
- package/date-picker/picker.validators.d.ts +4 -8
- package/date-picker/quarter-picker.component.d.ts +2 -3
- package/date-picker/styles/calendar.scss +1 -1
- package/date-picker/styles/range-picker.scss +1 -0
- package/date-picker/styles/week-picker.scss +1 -0
- package/date-picker/week-picker.component.d.ts +0 -1
- package/date-picker/year-picker.component.d.ts +2 -3
- 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 +15 -25
- package/empty/empty.component.d.ts +2 -1
- 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-arrow-switcher.mjs +15 -3
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +4 -4
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.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-cascader.mjs +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +2 -2
- package/fesm2022/ngx-tethys-checkbox.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-color-picker.mjs +4 -6
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +2 -2
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +861 -1078
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +5 -5
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +159 -209
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +5 -2
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-flexible-text.mjs +68 -88
- 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-i18n.mjs +26 -6
- 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 +44 -42
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs +291 -334
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +183 -217
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-message.mjs +29 -36
- package/fesm2022/ngx-tethys-message.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +33 -41
- package/fesm2022/ngx-tethys-notify.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 +46 -58
- 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 +100 -143
- 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-select.mjs +164 -228
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +423 -586
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +1 -2
- 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.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +2 -8
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- 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-table.mjs +1 -2
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +244 -271
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tooltip.mjs +109 -93
- package/fesm2022/ngx-tethys-tooltip.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 +216 -284
- 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 +2 -2
- 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/i18n/i18n.d.ts +7 -2
- package/i18n/locales/de-de.d.ts +5 -1
- package/i18n/locales/en-us.d.ts +5 -1
- package/i18n/locales/ja-jp.d.ts +5 -1
- package/i18n/locales/zh-hans.d.ts +5 -1
- package/i18n/locales/zh-hant.d.ts +5 -1
- 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/image/preview/image-preview.component.d.ts +2 -2
- package/input-number/input-number.component.d.ts +1 -1
- package/layout/header.component.d.ts +15 -19
- package/layout/layout.component.d.ts +3 -2
- package/layout/sidebar-header.component.d.ts +7 -8
- package/layout/sidebar.component.d.ts +32 -62
- package/list/list-item-meta.component.d.ts +7 -9
- package/list/list-item.component.d.ts +0 -2
- package/list/list.component.d.ts +2 -8
- package/list/selection/selection-list.d.ts +33 -46
- package/message/abstract/abstract-message.component.d.ts +2 -3
- package/message/message-container.component.d.ts +0 -1
- package/message/message.component.d.ts +1 -3
- package/notify/notify-container.component.d.ts +0 -1
- package/notify/notify.component.d.ts +7 -12
- 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 +20 -32
- 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/select/custom-select/custom-select.component.d.ts +33 -56
- package/select/native-select/native-select.component.d.ts +7 -13
- package/shared/base-form-check.component.d.ts +6 -8
- package/shared/directives/string-or-template-outlet.directive.d.ts +5 -6
- package/shared/directives/thy-autofocus.directive.d.ts +4 -6
- package/shared/directives/thy-contextmenu.directive.d.ts +2 -2
- package/shared/directives/thy-ctrl-enter.directive.d.ts +2 -2
- package/shared/directives/thy-enter.directive.d.ts +2 -2
- package/shared/directives/thy-scroll.directive.d.ts +5 -8
- package/shared/directives/thy-show.d.ts +5 -6
- package/shared/directives/thy-stop-propagation.directive.d.ts +4 -4
- package/shared/directives/view-outlet.directive.d.ts +6 -7
- package/shared/ng-transclude.directive.d.ts +2 -3
- package/shared/option/group/option-group.component.d.ts +5 -9
- package/shared/option/list-option/list-option.component.d.ts +9 -13
- package/shared/option/option.component.d.ts +10 -17
- package/shared/option/option.token.d.ts +4 -3
- package/shared/option/options-container.component.d.ts +1 -1
- package/shared/select/select-control/select-control.component.d.ts +38 -53
- 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/stepper/stepper.component.d.ts +1 -1
- package/strength/strength.component.d.ts +8 -13
- package/table/table-column.component.d.ts +15 -5
- package/time-picker/inner/inner-time-picker.class.d.ts +15 -13
- package/time-picker/inner/inner-time-picker.component.d.ts +26 -26
- package/time-picker/time-picker-panel.component.d.ts +18 -20
- package/time-picker/time-picker.component.d.ts +22 -30
- package/tooltip/tooltip.directive.d.ts +20 -22
- 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 +54 -71
- package/vote/vote.component.d.ts +13 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, computed, ChangeDetectionStrategy, Component, inject, NgZone, output, contentChild, viewChild, signal, effect, NgModule } from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, computed, ChangeDetectionStrategy, Component, inject, NgZone, DestroyRef, output, contentChild, viewChild, signal, effect, NgModule } from '@angular/core';
|
|
3
3
|
import { ThyClickDispatcher } from 'ngx-tethys/core';
|
|
4
4
|
import { ThyFlexibleText, ThyFlexibleTextModule } from 'ngx-tethys/flexible-text';
|
|
5
5
|
import { Subject, fromEvent, combineLatest, timer } from 'rxjs';
|
|
@@ -7,6 +7,7 @@ import { takeUntil, delay, take, filter } from 'rxjs/operators';
|
|
|
7
7
|
import { OverlayOutsideClickDispatcher } from '@angular/cdk/overlay';
|
|
8
8
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
9
9
|
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
10
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
10
11
|
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -18,12 +19,10 @@ class ThyProperties {
|
|
|
18
19
|
/**
|
|
19
20
|
* 展示布局
|
|
20
21
|
* @type "horizontal" | "vertical"
|
|
21
|
-
* @default horizontal
|
|
22
22
|
*/
|
|
23
23
|
this.layout = input('horizontal', { alias: 'thyLayout' });
|
|
24
24
|
/**
|
|
25
25
|
* 设置一行的可以 property-item 的数量
|
|
26
|
-
* @type number
|
|
27
26
|
*/
|
|
28
27
|
this.thyColumn = input(1, { transform: numberAttribute });
|
|
29
28
|
/**
|
|
@@ -60,21 +59,17 @@ class ThyPropertyItem {
|
|
|
60
59
|
this.ngZone = inject(NgZone);
|
|
61
60
|
this.overlayOutsideClickDispatcher = inject(OverlayOutsideClickDispatcher);
|
|
62
61
|
this.parent = inject(ThyProperties, { optional: true });
|
|
62
|
+
this.destroyRef = inject(DestroyRef);
|
|
63
63
|
/**
|
|
64
64
|
* 属性名称
|
|
65
|
-
* @type sting
|
|
66
|
-
* @default thyLabelText
|
|
67
65
|
*/
|
|
68
66
|
this.thyLabelText = input();
|
|
69
67
|
/**
|
|
70
68
|
* 设置属性是否是可编辑的
|
|
71
|
-
* @type sting
|
|
72
|
-
* @default false
|
|
73
69
|
*/
|
|
74
70
|
this.thyEditable = input(false, { transform: coerceBooleanProperty });
|
|
75
71
|
/**
|
|
76
72
|
* 设置跨列的数量
|
|
77
|
-
* @type number
|
|
78
73
|
*/
|
|
79
74
|
this.thySpan = input(1, { transform: numberAttribute });
|
|
80
75
|
/**
|
|
@@ -112,14 +107,14 @@ class ThyPropertyItem {
|
|
|
112
107
|
*/
|
|
113
108
|
this.itemContent = viewChild('item');
|
|
114
109
|
this.editing = signal(false);
|
|
115
|
-
this.changes$ = new Subject();
|
|
116
|
-
this.destroy$ = new Subject();
|
|
117
110
|
this.eventDestroy$ = new Subject();
|
|
118
111
|
this.originOverlays = [];
|
|
119
112
|
this.gridColumn = computed(() => {
|
|
120
113
|
return `span ${Math.min(this.thySpan(), this.parent?.thyColumn())}`;
|
|
121
114
|
});
|
|
122
|
-
this.isVertical =
|
|
115
|
+
this.isVertical = computed(() => {
|
|
116
|
+
return this.parent?.layout() === 'vertical';
|
|
117
|
+
});
|
|
123
118
|
this.originOverlays = [...this.overlayOutsideClickDispatcher._attachedOverlays];
|
|
124
119
|
effect(() => {
|
|
125
120
|
if (this.thyEditable()) {
|
|
@@ -135,10 +130,6 @@ class ThyPropertyItem {
|
|
|
135
130
|
}
|
|
136
131
|
}
|
|
137
132
|
});
|
|
138
|
-
effect(() => {
|
|
139
|
-
const layout = this.parent?.layout();
|
|
140
|
-
this.isVertical.set(layout === 'vertical');
|
|
141
|
-
});
|
|
142
133
|
}
|
|
143
134
|
setEditing(editing) {
|
|
144
135
|
this.ngZone.run(() => {
|
|
@@ -179,7 +170,7 @@ class ThyPropertyItem {
|
|
|
179
170
|
const overlaysDetachments$ = openedOverlays.map(overlay => overlay.detachments());
|
|
180
171
|
if (overlaysDetachments$.length) {
|
|
181
172
|
combineLatest(overlaysDetachments$)
|
|
182
|
-
.pipe(delay(50), take(1),
|
|
173
|
+
.pipe(delay(50), take(1), takeUntilDestroyed(this.destroyRef))
|
|
183
174
|
.subscribe(() => {
|
|
184
175
|
this.setEditing(false);
|
|
185
176
|
});
|
|
@@ -190,7 +181,7 @@ class ThyPropertyItem {
|
|
|
190
181
|
.clicked(0)
|
|
191
182
|
.pipe(filter(event => {
|
|
192
183
|
return !editorElement.contains(event.target);
|
|
193
|
-
}), take(1),
|
|
184
|
+
}), take(1), takeUntilDestroyed(this.destroyRef))
|
|
194
185
|
.subscribe(() => {
|
|
195
186
|
this.setEditing(false);
|
|
196
187
|
});
|
|
@@ -206,8 +197,6 @@ class ThyPropertyItem {
|
|
|
206
197
|
});
|
|
207
198
|
}
|
|
208
199
|
ngOnDestroy() {
|
|
209
|
-
this.destroy$.next();
|
|
210
|
-
this.destroy$.complete();
|
|
211
200
|
this.eventDestroy$.next();
|
|
212
201
|
this.eventDestroy$.complete();
|
|
213
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-property.mjs","sources":["../../../src/property/properties.component.ts","../../../src/property/properties.component.html","../../../src/property/property-item.component.ts","../../../src/property/property-item.component.html","../../../src/property/module.ts","../../../src/property/ngx-tethys-property.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, numberAttribute, input, computed, effect } from '@angular/core';\n\nexport type ThyPropertiesLayout = 'horizontal' | 'vertical';\n\n/**\n * 属性列表组件\n * @name thy-properties\n */\n@Component({\n selector: 'thy-properties',\n templateUrl: './properties.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-properties',\n '[class.thy-properties-vertical]': 'layout() === \"vertical\"',\n '[class.thy-properties-horizontal]': 'layout() === \"horizontal\"',\n '[class.thy-property-edit-trigger-hover]': 'thyEditTrigger() === \"hover\"',\n '[class.thy-property-edit-trigger-click]': 'thyEditTrigger() === \"click\"',\n '[style.grid-template-columns]': 'gridTemplateColumns()'\n }\n})\nexport class ThyProperties {\n /**\n * 展示布局\n * @type \"horizontal\" | \"vertical\"\n * @default horizontal\n */\n readonly layout = input<ThyPropertiesLayout>('horizontal', { alias: 'thyLayout' });\n\n /**\n * 设置一行的可以 property-item 的数量\n * @type number\n */\n readonly thyColumn = input(1, { transform: numberAttribute });\n\n /**\n * 设置编辑状态触发方法\n * @type 'hover' | 'click'\n */\n readonly thyEditTrigger = input<'hover' | 'click'>('hover');\n\n protected readonly gridTemplateColumns = computed(() => {\n return `repeat(${this.thyColumn()}, 1fr)`;\n });\n}\n","<ng-content></ng-content>\n","import { ThyClickDispatcher } from 'ngx-tethys/core';\nimport { ThyFlexibleText } from 'ngx-tethys/flexible-text';\nimport { combineLatest, fromEvent, Subject, Subscription, timer } from 'rxjs';\nimport { delay, filter, take, takeUntil } from 'rxjs/operators';\n\nimport { OverlayOutsideClickDispatcher, OverlayRef } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n numberAttribute,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n inject,\n input,\n computed,\n effect,\n output,\n contentChild,\n viewChild,\n signal\n} from '@angular/core';\n\nimport { ThyProperties } from './properties.component';\nimport { coerceBooleanProperty, ThyBooleanInput } from 'ngx-tethys/util';\n\nexport type ThyPropertyItemOperationTrigger = 'hover' | 'always';\n\n/**\n * 属性组件\n * @name thy-property-item\n */\n@Component({\n selector: 'thy-property-item',\n templateUrl: './property-item.component.html',\n host: {\n class: 'thy-property-item',\n '[class.thy-property-edit-trigger-hover]': 'thyEditTrigger() === \"hover\"',\n '[class.thy-property-edit-trigger-click]': 'thyEditTrigger() === \"click\"',\n '[class.thy-property-item-operational]': '!!operation()',\n '[class.thy-property-item-operational-hover]': \"thyOperationTrigger() === 'hover'\",\n '[style.grid-column]': 'gridColumn()',\n '[class.thy-property-item-single]': '!parent'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ThyFlexibleText, NgTemplateOutlet]\n})\nexport class ThyPropertyItem implements OnDestroy {\n private clickDispatcher = inject(ThyClickDispatcher);\n private ngZone = inject(NgZone);\n private overlayOutsideClickDispatcher = inject(OverlayOutsideClickDispatcher);\n private parent = inject(ThyProperties, { optional: true });\n\n /**\n * 属性名称\n * @type sting\n * @default thyLabelText\n */\n readonly thyLabelText = input<string>();\n\n /**\n * 设置属性是否是可编辑的\n * @type sting\n * @default false\n */\n readonly thyEditable = input<boolean, ThyBooleanInput>(false, { transform: coerceBooleanProperty });\n\n /**\n * 设置跨列的数量\n * @type number\n */\n readonly thySpan = input(1, { transform: numberAttribute });\n\n /**\n * 设置编辑状态触发方法\n * @type 'hover' | 'click'\n */\n readonly thyEditTrigger = input<'hover' | 'click'>();\n\n /**\n * 设置属性操作现实触发方式,默认 always 一直显示\n * @type 'hover' | 'always'\n */\n readonly thyOperationTrigger = input<ThyPropertyItemOperationTrigger>('always');\n\n readonly thyEditingChange = output<boolean>();\n\n /**\n * 属性名称自定义模板\n * @type TemplateRef\n */\n readonly label = contentChild<TemplateRef<void>>('label');\n\n /**\n * 属性内容编辑模板,只有在 thyEditable 为 true 时生效\n * @type TemplateRef\n */\n readonly editor = contentChild<TemplateRef<void>>('editor');\n\n /**\n * 操作区模板\n * @type TemplateRef\n */\n readonly operation = contentChild<TemplateRef<void>>('operation');\n\n /**\n * @private\n */\n readonly content = viewChild<TemplateRef<void>>('contentTemplate');\n\n /**\n * @private\n */\n readonly itemContent = viewChild<ElementRef<HTMLElement>>('item');\n\n editing = signal(false);\n\n changes$ = new Subject<SimpleChanges>();\n\n private destroy$ = new Subject<void>();\n\n private eventDestroy$ = new Subject<void>();\n\n private originOverlays: OverlayRef[] = [];\n\n private clickEventSubscription: Subscription;\n\n protected readonly gridColumn = computed(() => {\n return `span ${Math.min(this.thySpan(), this.parent?.thyColumn())}`;\n });\n\n isVertical = signal(false);\n\n constructor() {\n this.originOverlays = [...this.overlayOutsideClickDispatcher._attachedOverlays] as OverlayRef[];\n\n effect(() => {\n if (this.thyEditable()) {\n this.subscribeClick();\n } else {\n this.setEditing(false);\n this.eventDestroy$.next();\n this.eventDestroy$.complete();\n\n if (this.clickEventSubscription) {\n this.clickEventSubscription.unsubscribe();\n this.clickEventSubscription = null;\n }\n }\n });\n\n effect(() => {\n const layout = this.parent?.layout();\n this.isVertical.set(layout === 'vertical');\n });\n }\n\n setEditing(editing: boolean) {\n this.ngZone.run(() => {\n if (!!this.editing() !== !!editing) {\n this.thyEditingChange.emit(editing);\n }\n this.editing.set(editing);\n });\n }\n\n /**\n * @deprecated please use setEditing(editing: boolean)\n */\n setKeepEditing(keep: boolean) {\n this.setEditing(keep);\n }\n\n private hasOverlay() {\n return !!this.overlayOutsideClickDispatcher._attachedOverlays.filter(overlay => !this.originOverlays.includes(overlay)).length;\n }\n\n private subscribeClick() {\n if (this.thyEditable() === true) {\n this.ngZone.runOutsideAngular(() => {\n if (this.clickEventSubscription) {\n return;\n }\n const itemElement = this.itemContent().nativeElement;\n this.clickEventSubscription = fromEvent(itemElement, 'click')\n .pipe(takeUntil(this.eventDestroy$))\n .subscribe(() => {\n this.setEditing(true);\n this.bindEditorBlurEvent(itemElement);\n itemElement.querySelector('input')?.focus();\n });\n });\n }\n }\n\n private subscribeOverlayDetach() {\n const openedOverlays = this.overlayOutsideClickDispatcher._attachedOverlays.filter(\n overlay => !this.originOverlays.includes(overlay)\n );\n const overlaysDetachments$ = openedOverlays.map(overlay => overlay.detachments());\n if (overlaysDetachments$.length) {\n combineLatest(overlaysDetachments$)\n .pipe(delay(50), take(1), takeUntil(this.destroy$))\n .subscribe(() => {\n this.setEditing(false);\n });\n }\n }\n\n private subscribeDocumentClick(editorElement: HTMLElement) {\n this.clickDispatcher\n .clicked(0)\n .pipe(\n filter(event => {\n return !editorElement.contains(event.target as HTMLElement);\n }),\n take(1),\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.setEditing(false);\n });\n }\n\n private bindEditorBlurEvent(editorElement: HTMLElement) {\n timer(0).subscribe(() => {\n if (this.hasOverlay()) {\n this.subscribeOverlayDetach();\n } else {\n this.subscribeDocumentClick(editorElement);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n\n this.eventDestroy$.next();\n this.eventDestroy$.complete();\n }\n}\n","<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@let labelText = thyLabelText();\n@let labelTemplate = label();\n@let operationTemplate = operation();\n\n@if (labelText || labelTemplate || (operationTemplate && isVertical())) {\n <div class=\"thy-property-item-label\">\n @if (labelText) {\n <span thyFlexibleText [thyTooltipContent]=\"labelText\">{{ labelText }}</span>\n }\n @if (labelTemplate) {\n <span> <ng-template [ngTemplateOutlet]=\"labelTemplate\"></ng-template></span>\n }\n @if (operationTemplate && isVertical()) {\n <div class=\"thy-property-item-operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplate\"></ng-template>\n </div>\n }\n </div>\n}\n\n<div class=\"thy-property-item-wrapper\">\n <div\n #item\n class=\"thy-property-item-content\"\n [class.thy-property-item-content-editable]=\"thyEditable()\"\n [class.thy-property-item-content-editing]=\"editing()\">\n <div class=\"thy-property-item-content-text\">\n @if (content()) {\n <ng-template [ngTemplateOutlet]=\"content()\"></ng-template>\n }\n </div>\n @if (thyEditable()) {\n <div class=\"thy-property-item-content-editor\">\n @if (editor()) {\n <ng-template [ngTemplateOutlet]=\"editor()\"></ng-template>\n }\n </div>\n }\n </div>\n @if (operation() && !isVertical()) {\n <div class=\"thy-property-item-operation\">\n <ng-template [ngTemplateOutlet]=\"operation()\"></ng-template>\n </div>\n }\n</div>\n","import { ThyFlexibleTextModule } from 'ngx-tethys/flexible-text';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThyProperties } from './properties.component';\nimport { ThyPropertyItem } from './property-item.component';\nimport { ThyTooltipModule } from 'ngx-tethys/tooltip';\n\n@NgModule({\n imports: [CommonModule, ThyFlexibleTextModule, ThyTooltipModule, ThyProperties, ThyPropertyItem],\n exports: [ThyProperties, ThyPropertyItem]\n})\nexport class ThyPropertyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAIA;;;AAGG;MAcU,aAAa,CAAA;AAb1B,IAAA,WAAA,GAAA;AAcI;;;;AAIG;QACM,IAAM,CAAA,MAAA,GAAG,KAAK,CAAsB,YAAY,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAElF;;;AAGG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAE7D;;;AAGG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAoB,OAAO,CAAC;AAExC,QAAA,IAAA,CAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAK;AACnD,YAAA,OAAO,UAAU,IAAI,CAAC,SAAS,EAAE,QAAQ;AAC7C,SAAC,CAAC;AACL;8GAvBY,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAb,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,q3BCrB1B,6BACA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDoBa,aAAa,EAAA,UAAA,EAAA,CAAA;kBAbzB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAET,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,K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A;AAE/B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHhB,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAiB,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAGtF,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,CAAC;AAChG,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,eAAe;AAC3C,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-tethys-property.mjs","sources":["../../../src/property/properties.component.ts","../../../src/property/properties.component.html","../../../src/property/property-item.component.ts","../../../src/property/property-item.component.html","../../../src/property/module.ts","../../../src/property/ngx-tethys-property.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, numberAttribute, input, computed } from '@angular/core';\n\nexport type ThyPropertiesLayout = 'horizontal' | 'vertical';\n\n/**\n * 属性列表组件\n * @name thy-properties\n */\n@Component({\n selector: 'thy-properties',\n templateUrl: './properties.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-properties',\n '[class.thy-properties-vertical]': 'layout() === \"vertical\"',\n '[class.thy-properties-horizontal]': 'layout() === \"horizontal\"',\n '[class.thy-property-edit-trigger-hover]': 'thyEditTrigger() === \"hover\"',\n '[class.thy-property-edit-trigger-click]': 'thyEditTrigger() === \"click\"',\n '[style.grid-template-columns]': 'gridTemplateColumns()'\n }\n})\nexport class ThyProperties {\n /**\n * 展示布局\n * @type \"horizontal\" | \"vertical\"\n */\n readonly layout = input<ThyPropertiesLayout>('horizontal', { alias: 'thyLayout' });\n\n /**\n * 设置一行的可以 property-item 的数量\n */\n readonly thyColumn = input(1, { transform: numberAttribute });\n\n /**\n * 设置编辑状态触发方法\n * @type 'hover' | 'click'\n */\n readonly thyEditTrigger = input<'hover' | 'click'>('hover');\n\n protected readonly gridTemplateColumns = computed(() => {\n return `repeat(${this.thyColumn()}, 1fr)`;\n });\n}\n","<ng-content></ng-content>\n","import { ThyClickDispatcher } from 'ngx-tethys/core';\nimport { ThyFlexibleText } from 'ngx-tethys/flexible-text';\nimport { combineLatest, fromEvent, Subject, Subscription, timer } from 'rxjs';\nimport { delay, filter, take, takeUntil } from 'rxjs/operators';\nimport { OverlayOutsideClickDispatcher, OverlayRef } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n numberAttribute,\n OnDestroy,\n TemplateRef,\n inject,\n input,\n computed,\n effect,\n output,\n contentChild,\n viewChild,\n signal,\n DestroyRef\n} from '@angular/core';\nimport { ThyProperties } from './properties.component';\nimport { coerceBooleanProperty, ThyBooleanInput } from 'ngx-tethys/util';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nexport type ThyPropertyItemOperationTrigger = 'hover' | 'always';\n\n/**\n * 属性组件\n * @name thy-property-item\n */\n@Component({\n selector: 'thy-property-item',\n templateUrl: './property-item.component.html',\n host: {\n class: 'thy-property-item',\n '[class.thy-property-edit-trigger-hover]': 'thyEditTrigger() === \"hover\"',\n '[class.thy-property-edit-trigger-click]': 'thyEditTrigger() === \"click\"',\n '[class.thy-property-item-operational]': '!!operation()',\n '[class.thy-property-item-operational-hover]': \"thyOperationTrigger() === 'hover'\",\n '[style.grid-column]': 'gridColumn()',\n '[class.thy-property-item-single]': '!parent'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ThyFlexibleText, NgTemplateOutlet]\n})\nexport class ThyPropertyItem implements OnDestroy {\n private clickDispatcher = inject(ThyClickDispatcher);\n private ngZone = inject(NgZone);\n private overlayOutsideClickDispatcher = inject(OverlayOutsideClickDispatcher);\n private parent = inject(ThyProperties, { optional: true });\n private destroyRef = inject(DestroyRef);\n\n /**\n * 属性名称\n */\n readonly thyLabelText = input<string>();\n\n /**\n * 设置属性是否是可编辑的\n */\n readonly thyEditable = input<boolean, ThyBooleanInput>(false, { transform: coerceBooleanProperty });\n\n /**\n * 设置跨列的数量\n */\n readonly thySpan = input(1, { transform: numberAttribute });\n\n /**\n * 设置编辑状态触发方法\n * @type 'hover' | 'click'\n */\n readonly thyEditTrigger = input<'hover' | 'click'>();\n\n /**\n * 设置属性操作现实触发方式,默认 always 一直显示\n * @type 'hover' | 'always'\n */\n readonly thyOperationTrigger = input<ThyPropertyItemOperationTrigger>('always');\n\n readonly thyEditingChange = output<boolean>();\n\n /**\n * 属性名称自定义模板\n * @type TemplateRef\n */\n readonly label = contentChild<TemplateRef<void>>('label');\n\n /**\n * 属性内容编辑模板,只有在 thyEditable 为 true 时生效\n * @type TemplateRef\n */\n readonly editor = contentChild<TemplateRef<void>>('editor');\n\n /**\n * 操作区模板\n * @type TemplateRef\n */\n readonly operation = contentChild<TemplateRef<void>>('operation');\n\n /**\n * @private\n */\n readonly content = viewChild<TemplateRef<void>>('contentTemplate');\n\n /**\n * @private\n */\n readonly itemContent = viewChild<ElementRef<HTMLElement>>('item');\n\n editing = signal(false);\n\n private eventDestroy$ = new Subject<void>();\n\n private originOverlays: OverlayRef[] = [];\n\n private clickEventSubscription: Subscription;\n\n protected readonly gridColumn = computed(() => {\n return `span ${Math.min(this.thySpan(), this.parent?.thyColumn())}`;\n });\n\n readonly isVertical = computed(() => {\n return this.parent?.layout() === 'vertical';\n });\n\n constructor() {\n this.originOverlays = [...this.overlayOutsideClickDispatcher._attachedOverlays] as OverlayRef[];\n\n effect(() => {\n if (this.thyEditable()) {\n this.subscribeClick();\n } else {\n this.setEditing(false);\n this.eventDestroy$.next();\n this.eventDestroy$.complete();\n\n if (this.clickEventSubscription) {\n this.clickEventSubscription.unsubscribe();\n this.clickEventSubscription = null;\n }\n }\n });\n }\n\n setEditing(editing: boolean) {\n this.ngZone.run(() => {\n if (!!this.editing() !== !!editing) {\n this.thyEditingChange.emit(editing);\n }\n this.editing.set(editing);\n });\n }\n\n /**\n * @deprecated please use setEditing(editing: boolean)\n */\n setKeepEditing(keep: boolean) {\n this.setEditing(keep);\n }\n\n private hasOverlay() {\n return !!this.overlayOutsideClickDispatcher._attachedOverlays.filter(overlay => !this.originOverlays.includes(overlay)).length;\n }\n\n private subscribeClick() {\n if (this.thyEditable() === true) {\n this.ngZone.runOutsideAngular(() => {\n if (this.clickEventSubscription) {\n return;\n }\n const itemElement = this.itemContent().nativeElement;\n this.clickEventSubscription = fromEvent(itemElement, 'click')\n .pipe(takeUntil(this.eventDestroy$))\n .subscribe(() => {\n this.setEditing(true);\n this.bindEditorBlurEvent(itemElement);\n itemElement.querySelector('input')?.focus();\n });\n });\n }\n }\n\n private subscribeOverlayDetach() {\n const openedOverlays = this.overlayOutsideClickDispatcher._attachedOverlays.filter(\n overlay => !this.originOverlays.includes(overlay)\n );\n const overlaysDetachments$ = openedOverlays.map(overlay => overlay.detachments());\n if (overlaysDetachments$.length) {\n combineLatest(overlaysDetachments$)\n .pipe(delay(50), take(1), takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.setEditing(false);\n });\n }\n }\n\n private subscribeDocumentClick(editorElement: HTMLElement) {\n this.clickDispatcher\n .clicked(0)\n .pipe(\n filter(event => {\n return !editorElement.contains(event.target as HTMLElement);\n }),\n take(1),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(() => {\n this.setEditing(false);\n });\n }\n\n private bindEditorBlurEvent(editorElement: HTMLElement) {\n timer(0).subscribe(() => {\n if (this.hasOverlay()) {\n this.subscribeOverlayDetach();\n } else {\n this.subscribeDocumentClick(editorElement);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.eventDestroy$.next();\n this.eventDestroy$.complete();\n }\n}\n","<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@let labelText = thyLabelText();\n@let labelTemplate = label();\n@let operationTemplate = operation();\n\n@if (labelText || labelTemplate || (operationTemplate && isVertical())) {\n <div class=\"thy-property-item-label\">\n @if (labelText) {\n <span thyFlexibleText [thyTooltipContent]=\"labelText\">{{ labelText }}</span>\n }\n @if (labelTemplate) {\n <span> <ng-template [ngTemplateOutlet]=\"labelTemplate\"></ng-template></span>\n }\n @if (operationTemplate && isVertical()) {\n <div class=\"thy-property-item-operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplate\"></ng-template>\n </div>\n }\n </div>\n}\n\n<div class=\"thy-property-item-wrapper\">\n <div\n #item\n class=\"thy-property-item-content\"\n [class.thy-property-item-content-editable]=\"thyEditable()\"\n [class.thy-property-item-content-editing]=\"editing()\">\n <div class=\"thy-property-item-content-text\">\n @if (content()) {\n <ng-template [ngTemplateOutlet]=\"content()\"></ng-template>\n }\n </div>\n @if (thyEditable()) {\n <div class=\"thy-property-item-content-editor\">\n @if (editor()) {\n <ng-template [ngTemplateOutlet]=\"editor()\"></ng-template>\n }\n </div>\n }\n </div>\n @if (operation() && !isVertical()) {\n <div class=\"thy-property-item-operation\">\n <ng-template [ngTemplateOutlet]=\"operation()\"></ng-template>\n </div>\n }\n</div>\n","import { ThyFlexibleTextModule } from 'ngx-tethys/flexible-text';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThyProperties } from './properties.component';\nimport { ThyPropertyItem } from './property-item.component';\nimport { ThyTooltipModule } from 'ngx-tethys/tooltip';\n\n@NgModule({\n imports: [CommonModule, ThyFlexibleTextModule, ThyTooltipModule, ThyProperties, ThyPropertyItem],\n exports: [ThyProperties, ThyPropertyItem]\n})\nexport class ThyPropertyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA;;;AAGG;MAcU,aAAa,CAAA;AAb1B,IAAA,WAAA,GAAA;AAcI;;;AAG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
|
2
|
-
import { InjectionToken, inject, input, forwardRef, ChangeDetectionStrategy, Component, HostListener, HostBinding, ChangeDetectorRef, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, forwardRef, ChangeDetectionStrategy, Component, HostListener, HostBinding, ChangeDetectorRef, signal, effect, NgModule } from '@angular/core';
|
|
3
3
|
import { NgClass, CommonModule } from '@angular/common';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
5
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
@@ -47,7 +47,7 @@ class ThyRadio extends ThyFormCheckBaseComponent {
|
|
|
47
47
|
useExisting: forwardRef(() => ThyRadio),
|
|
48
48
|
multi: true
|
|
49
49
|
}
|
|
50
|
-
], usesInheritance: true, ngImport: i0, template: "<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText }\" />\n@if (_labelText) {\n <span class=\"form-check-label\">{{ _labelText }}</span>\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
50
|
+
], usesInheritance: true, ngImport: i0, template: "<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText() }\" />\n@if (_labelText()) {\n <span class=\"form-check-label\">{{ _labelText() }}</span>\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
51
51
|
}
|
|
52
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadio, decorators: [{
|
|
53
53
|
type: Component,
|
|
@@ -59,7 +59,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
59
59
|
}
|
|
60
60
|
], host: {
|
|
61
61
|
'[attr.tabindex]': `-1`
|
|
62
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass], template: "<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText }\" />\n@if (_labelText) {\n <span class=\"form-check-label\">{{ _labelText }}</span>\n}\n<ng-content></ng-content>\n" }]
|
|
62
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass], template: "<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText() }\" />\n@if (_labelText()) {\n <span class=\"form-check-label\">{{ _labelText() }}</span>\n}\n<ng-content></ng-content>\n" }]
|
|
63
63
|
}] });
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -92,13 +92,13 @@ class ThyRadioButton extends ThyRadio {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadioButton, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
95
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyRadioButton, isStandalone: true, selector: "[thy-radio-button],[thyRadioButton]", inputs: { thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "click($event)" }, properties: { "attr.tabindex": "tabIndex", "class.btn": "this.isButton", "class.active": "this.isActive", "class.disabled": "this.isDisabled" } }, usesInheritance: true, ngImport: i0, template: "<ng-container> {{ _labelText }}</ng-container>\n<ng-content></ng-content>\n" }); }
|
|
95
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyRadioButton, isStandalone: true, selector: "[thy-radio-button],[thyRadioButton]", inputs: { thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "click($event)" }, properties: { "attr.tabindex": "tabIndex", "class.btn": "this.isButton", "class.active": "this.isActive", "class.disabled": "this.isDisabled" } }, usesInheritance: true, ngImport: i0, template: "<ng-container> {{ _labelText() }}</ng-container>\n<ng-content></ng-content>\n" }); }
|
|
96
96
|
}
|
|
97
97
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadioButton, decorators: [{
|
|
98
98
|
type: Component,
|
|
99
99
|
args: [{ selector: '[thy-radio-button],[thyRadioButton]', host: {
|
|
100
100
|
'[attr.tabindex]': `tabIndex`
|
|
101
|
-
}, template: "<ng-container> {{ _labelText }}</ng-container>\n<ng-content></ng-content>\n" }]
|
|
101
|
+
}, template: "<ng-container> {{ _labelText() }}</ng-container>\n<ng-content></ng-content>\n" }]
|
|
102
102
|
}], propDecorators: { isButton: [{
|
|
103
103
|
type: HostBinding,
|
|
104
104
|
args: ['class.btn']
|
|
@@ -125,32 +125,6 @@ const radioGroupLayoutMap = {
|
|
|
125
125
|
* @order 20
|
|
126
126
|
*/
|
|
127
127
|
class ThyRadioGroup {
|
|
128
|
-
constructor() {
|
|
129
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
130
|
-
this.thyRadioGroup = true;
|
|
131
|
-
this.isButtonGroup = false;
|
|
132
|
-
this.isButtonGroupOutline = false;
|
|
133
|
-
/**
|
|
134
|
-
* 大小
|
|
135
|
-
* @type sm | md | lg
|
|
136
|
-
* @default md
|
|
137
|
-
*/
|
|
138
|
-
this.thySize = input('md');
|
|
139
|
-
/**
|
|
140
|
-
* 布局
|
|
141
|
-
* @type flex
|
|
142
|
-
*/
|
|
143
|
-
this.thyLayout = input();
|
|
144
|
-
this.radios = [];
|
|
145
|
-
this.hostRenderer = useHostRenderer();
|
|
146
|
-
/**
|
|
147
|
-
* 是否禁用单选组合框
|
|
148
|
-
* @default false
|
|
149
|
-
*/
|
|
150
|
-
this.thyDisabled = input(false, { transform: coerceBooleanProperty$1 });
|
|
151
|
-
this.onChange = () => null;
|
|
152
|
-
this.onTouched = () => null;
|
|
153
|
-
}
|
|
154
128
|
addRadio(radio) {
|
|
155
129
|
this.radios.push(radio);
|
|
156
130
|
radio.thyChecked = radio.thyValue() === this._innerValue;
|
|
@@ -181,24 +155,44 @@ class ThyRadioGroup {
|
|
|
181
155
|
});
|
|
182
156
|
}
|
|
183
157
|
setGroup() {
|
|
184
|
-
if (!this.isButtonGroup && !this.isButtonGroupOutline) {
|
|
185
|
-
this.isButtonGroup
|
|
186
|
-
this.isButtonGroupOutline
|
|
158
|
+
if (!this.isButtonGroup() && !this.isButtonGroupOutline()) {
|
|
159
|
+
this.isButtonGroup.set(true);
|
|
160
|
+
this.isButtonGroupOutline.set(true);
|
|
187
161
|
}
|
|
188
162
|
}
|
|
189
|
-
|
|
190
|
-
this.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
163
|
+
constructor() {
|
|
164
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
165
|
+
this.isButtonGroup = signal(false);
|
|
166
|
+
this.isButtonGroupOutline = signal(false);
|
|
167
|
+
/**
|
|
168
|
+
* 大小
|
|
169
|
+
* @type sm | md | lg
|
|
170
|
+
* @default md
|
|
171
|
+
*/
|
|
172
|
+
this.thySize = input('md');
|
|
173
|
+
/**
|
|
174
|
+
* 布局
|
|
175
|
+
* @type flex
|
|
176
|
+
*/
|
|
177
|
+
this.thyLayout = input();
|
|
178
|
+
this.radios = [];
|
|
179
|
+
this.hostRenderer = useHostRenderer();
|
|
180
|
+
/**
|
|
181
|
+
* 是否禁用单选组合框
|
|
182
|
+
* @default false
|
|
183
|
+
*/
|
|
184
|
+
this.thyDisabled = input(false, { transform: coerceBooleanProperty$1 });
|
|
185
|
+
this.onChange = () => null;
|
|
186
|
+
this.onTouched = () => null;
|
|
187
|
+
effect(() => {
|
|
188
|
+
this.setClasses();
|
|
189
|
+
});
|
|
190
|
+
effect(() => {
|
|
191
|
+
const disabled = this.thyDisabled();
|
|
192
|
+
this.setDisabledState(disabled);
|
|
193
|
+
});
|
|
200
194
|
}
|
|
201
|
-
|
|
195
|
+
setClasses() {
|
|
202
196
|
const classNames = [];
|
|
203
197
|
const size = this.thySize();
|
|
204
198
|
if (size && buttonGroupSizeMap[size]) {
|
|
@@ -211,7 +205,7 @@ class ThyRadioGroup {
|
|
|
211
205
|
this.hostRenderer.updateClass(classNames);
|
|
212
206
|
}
|
|
213
207
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
214
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyRadioGroup, isStandalone: true, selector: "thy-radio-group", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyLayout: { classPropertyName: "thyLayout", publicName: "thyLayout", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "
|
|
208
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyRadioGroup, isStandalone: true, selector: "thy-radio-group", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyLayout: { classPropertyName: "thyLayout", publicName: "thyLayout", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.btn-group": "isButtonGroup()", "class.btn-group-outline-default": "isButtonGroupOutline()", "attr.tabindex": "-1" }, classAttribute: "thy-radio-group" }, providers: [
|
|
215
209
|
{
|
|
216
210
|
provide: NG_VALUE_ACCESSOR,
|
|
217
211
|
useExisting: forwardRef(() => ThyRadioGroup),
|
|
@@ -221,7 +215,7 @@ class ThyRadioGroup {
|
|
|
221
215
|
provide: THY_RADIO_GROUP_COMPONENT,
|
|
222
216
|
useExisting: ThyRadioGroup
|
|
223
217
|
}
|
|
224
|
-
],
|
|
218
|
+
], ngImport: i0, template: "<ng-content></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
225
219
|
}
|
|
226
220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadioGroup, decorators: [{
|
|
227
221
|
type: Component,
|
|
@@ -236,18 +230,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
236
230
|
useExisting: ThyRadioGroup
|
|
237
231
|
}
|
|
238
232
|
], host: {
|
|
233
|
+
class: 'thy-radio-group',
|
|
234
|
+
'[class.btn-group]': 'isButtonGroup()',
|
|
235
|
+
'[class.btn-group-outline-default]': 'isButtonGroupOutline()',
|
|
239
236
|
'[attr.tabindex]': `-1`
|
|
240
237
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
241
|
-
}],
|
|
242
|
-
type: HostBinding,
|
|
243
|
-
args: ['class.thy-radio-group']
|
|
244
|
-
}], isButtonGroup: [{
|
|
245
|
-
type: HostBinding,
|
|
246
|
-
args: ['class.btn-group']
|
|
247
|
-
}], isButtonGroupOutline: [{
|
|
248
|
-
type: HostBinding,
|
|
249
|
-
args: ['class.btn-group-outline-default']
|
|
250
|
-
}] } });
|
|
238
|
+
}], ctorParameters: () => [] });
|
|
251
239
|
|
|
252
240
|
class ThyRadioModule {
|
|
253
241
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-radio.mjs","sources":["../../../src/radio/radio.token.ts","../../../src/radio/radio.component.ts","../../../src/radio/radio.component.html","../../../src/radio/button/radio-button.component.ts","../../../src/radio/button/radio-button.component.html","../../../src/radio/group/radio-group.component.ts","../../../src/radio/group/radio-group.component.html","../../../src/radio/module.ts","../../../src/radio/ngx-tethys-radio.ts"],"sourcesContent":["import { InjectionToken, InputSignal } from '@angular/core';\n\nexport interface IThyRadioComponent {\n thyValue: InputSignal<string>;\n thyChecked: boolean;\n setDisabledState?(isDisabled: boolean): void;\n}\n\nexport interface IThyRadioGroupComponent {\n addRadio(radio: IThyRadioComponent): void;\n updateValue(value: string, emit: boolean): void;\n setGroup(): void;\n}\n\nexport const THY_RADIO_GROUP_COMPONENT = new InjectionToken<IThyRadioGroupComponent>('THY_RADIO_GROUP_COMPONENT');\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, inject, input, OnInit } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThyFormCheckBaseComponent } from 'ngx-tethys/shared';\nimport { IThyRadioComponent, THY_RADIO_GROUP_COMPONENT } from './radio.token';\n\n/**\n * 单选框组件\n * @name thy-radio,[thyRadio]\n * @order 10\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[thy-radio],[thyRadio]',\n templateUrl: './radio.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRadio),\n multi: true\n }\n ],\n host: {\n '[attr.tabindex]': `-1`\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgClass]\n})\nexport class ThyRadio extends ThyFormCheckBaseComponent implements IThyRadioComponent, OnInit {\n thyRadioGroupComponent = inject(THY_RADIO_GROUP_COMPONENT, { optional: true })!;\n\n name: string;\n\n /**\n * 当和 thy-radio-group 配合使用时的值,选中后的 NgModel 值\n */\n readonly thyValue = input<string>();\n\n set thyChecked(value: boolean) {\n this.writeValue(coerceBooleanProperty(value));\n this.changeDetectorRef.markForCheck();\n }\n\n ngOnInit() {\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.addRadio(this);\n }\n }\n\n change() {\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.updateValue(this.thyValue(), true);\n } else {\n this.updateValue(!this._innerValue);\n }\n }\n}\n","<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText }\" />\n@if (_labelText) {\n <span class=\"form-check-label\">{{ _labelText }}</span>\n}\n<ng-content></ng-content>\n","import { Component, OnInit, HostBinding, HostListener, input } from '@angular/core';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ThyRadio } from '../radio.component';\n\n/**\n * @name [thy-radio-button],[thyRadioButton]\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[thy-radio-button],[thyRadioButton]',\n templateUrl: './radio-button.component.html',\n host: {\n '[attr.tabindex]': `tabIndex`\n }\n})\nexport class ThyRadioButton extends ThyRadio implements OnInit {\n @HostBinding('class.btn') isButton = true;\n @HostBinding('class.active') isActive = false;\n @HostBinding('class.disabled') get isDisabled() {\n return this._disabled;\n }\n\n name: string;\n\n readonly thyValue = input<string>();\n\n set thyChecked(value: boolean) {\n this.isActive = !!value;\n this.writeValue(coerceBooleanProperty(value));\n }\n\n ngOnInit() {\n this._isFormCheck = false;\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.addRadio(this);\n this.thyRadioGroupComponent.setGroup();\n }\n }\n\n @HostListener('click', ['$event'])\n click($event: MouseEvent) {\n if (!this._disabled) {\n this.change();\n }\n }\n}\n","<ng-container> {{ _labelText }}</ng-container>\n<ng-content></ng-content>\n","import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n HostBinding,\n inject,\n input,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { useHostRenderer } from '@tethys/cdk/dom';\n\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { ThyRadioButton } from '../button/radio-button.component';\nimport { ThyRadio } from '../radio.component';\nimport { IThyRadioGroupComponent, THY_RADIO_GROUP_COMPONENT } from '../radio.token';\n\nconst buttonGroupSizeMap = {\n sm: ['btn-group-sm'],\n lg: ['btn-group-lg']\n};\n\nconst radioGroupLayoutMap = {\n flex: ['radio-group-layout-flex']\n};\n\n/**\n * @name thy-radio-group\n * @order 20\n */\n@Component({\n selector: 'thy-radio-group',\n templateUrl: './radio-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRadioGroup),\n multi: true\n },\n {\n provide: THY_RADIO_GROUP_COMPONENT,\n useExisting: ThyRadioGroup\n }\n ],\n host: {\n '[attr.tabindex]': `-1`\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ThyRadioGroup implements IThyRadioGroupComponent, ControlValueAccessor, OnInit, OnChanges, AfterContentInit {\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n @HostBinding('class.thy-radio-group') thyRadioGroup = true;\n\n @HostBinding('class.btn-group') isButtonGroup = false;\n\n @HostBinding('class.btn-group-outline-default')\n isButtonGroupOutline = false;\n\n /**\n * 大小\n * @type sm | md | lg\n * @default md\n */\n readonly thySize = input<string>('md');\n\n /**\n * 布局\n * @type flex\n */\n readonly thyLayout = input<string>();\n\n _innerValue: string | number;\n\n radios: Array<ThyRadio | ThyRadioButton> = [];\n\n private hostRenderer = useHostRenderer();\n\n /**\n * 是否禁用单选组合框\n * @default false\n */\n readonly thyDisabled = input(false, { transform: coerceBooleanProperty });\n\n onChange: (_: string) => void = () => null;\n onTouched: () => void = () => null;\n\n addRadio(radio: ThyRadio | ThyRadioButton): void {\n this.radios.push(radio);\n radio.thyChecked = radio.thyValue() === this._innerValue;\n }\n\n updateValue(value: string, emit: boolean): void {\n this._innerValue = value;\n this.radios.forEach(radio => {\n radio.thyChecked = radio.thyValue() === this._innerValue;\n });\n if (emit) {\n this.onChange(value);\n }\n this.onTouched();\n this.changeDetectorRef.detectChanges();\n }\n\n writeValue(value: any): void {\n this.updateValue(value, false);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.radios.forEach(radio => {\n radio.setDisabledState(isDisabled);\n });\n }\n\n setGroup(): void {\n if (!this.isButtonGroup && !this.isButtonGroupOutline) {\n this.isButtonGroup = true;\n this.isButtonGroupOutline = true;\n }\n }\n\n ngOnInit() {\n this._setClasses();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { thyDisabled } = changes;\n if (thyDisabled) {\n this.setDisabledState(this.thyDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n this.setDisabledState(this.thyDisabled());\n }\n\n private _setClasses() {\n const classNames: string[] = [];\n const size = this.thySize();\n if (size && buttonGroupSizeMap[size]) {\n classNames.push(buttonGroupSizeMap[size]);\n }\n const layout = this.thyLayout();\n if (layout && radioGroupLayoutMap[layout]) {\n classNames.push(radioGroupLayoutMap[layout]);\n }\n this.hostRenderer.updateClass(classNames);\n }\n}\n","<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ThyRadio } from './radio.component';\nimport { ThyRadioButton } from './button/radio-button.component';\nimport { ThyRadioGroup } from './group/radio-group.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThyRadio, ThyRadioGroup, ThyRadioButton],\n exports: [ThyRadio, ThyRadioGroup, ThyRadioButton]\n})\nexport class ThyRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["coerceBooleanProperty"],"mappings":";;;;;;;;;AAcO,MAAM,yBAAyB,GAAG,IAAI,cAAc,CAA0B,2BAA2B,CAAC;;ACPjH;;;;AAIG;AAkBG,MAAO,QAAS,SAAQ,yBAAyB,CAAA;AAjBvD,IAAA,WAAA,GAAA;;QAkBI,IAAsB,CAAA,sBAAA,GAAG,MAAM,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE;AAI/E;;AAEG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;AAoBtC;IAlBG,IAAI,UAAU,CAAC,KAAc,EAAA;QACzB,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAC7C,QAAA,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;;IAGzC,QAAQ,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,sBAAsB,EAAE;AAC7B,YAAA,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC;;;IAIlD,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,sBAAsB,EAAE;AAC7B,YAAA,IAAI,CAAC,sBAAsB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.mjs","sources":["../../../src/radio/radio.token.ts","../../../src/radio/radio.component.ts","../../../src/radio/radio.component.html","../../../src/radio/button/radio-button.component.ts","../../../src/radio/button/radio-button.component.html","../../../src/radio/group/radio-group.component.ts","../../../src/radio/group/radio-group.component.html","../../../src/radio/module.ts","../../../src/radio/ngx-tethys-radio.ts"],"sourcesContent":["import { InjectionToken, InputSignal } from '@angular/core';\n\nexport interface IThyRadioComponent {\n thyValue: InputSignal<string>;\n thyChecked: boolean;\n setDisabledState?(isDisabled: boolean): void;\n}\n\nexport interface IThyRadioGroupComponent {\n addRadio(radio: IThyRadioComponent): void;\n updateValue(value: string, emit: boolean): void;\n setGroup(): void;\n}\n\nexport const THY_RADIO_GROUP_COMPONENT = new InjectionToken<IThyRadioGroupComponent>('THY_RADIO_GROUP_COMPONENT');\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, inject, input, OnInit } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThyFormCheckBaseComponent } from 'ngx-tethys/shared';\nimport { IThyRadioComponent, THY_RADIO_GROUP_COMPONENT } from './radio.token';\n\n/**\n * 单选框组件\n * @name thy-radio,[thyRadio]\n * @order 10\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[thy-radio],[thyRadio]',\n templateUrl: './radio.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRadio),\n multi: true\n }\n ],\n host: {\n '[attr.tabindex]': `-1`\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgClass]\n})\nexport class ThyRadio extends ThyFormCheckBaseComponent implements IThyRadioComponent, OnInit {\n thyRadioGroupComponent = inject(THY_RADIO_GROUP_COMPONENT, { optional: true })!;\n\n name: string;\n\n /**\n * 当和 thy-radio-group 配合使用时的值,选中后的 NgModel 值\n */\n readonly thyValue = input<string>();\n\n set thyChecked(value: boolean) {\n this.writeValue(coerceBooleanProperty(value));\n this.changeDetectorRef.markForCheck();\n }\n\n ngOnInit() {\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.addRadio(this);\n }\n }\n\n change() {\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.updateValue(this.thyValue(), true);\n } else {\n this.updateValue(!this._innerValue);\n }\n }\n}\n","<input\n class=\"form-check-input\"\n [checked]=\"_isChecked\"\n (change)=\"change()\"\n type=\"radio\"\n [attr.tabindex]=\"tabIndex\"\n [disabled]=\"_disabled\"\n [attr.name]=\"name\"\n [ngClass]=\"{ 'form-check-no-label-text': !_labelText() }\" />\n@if (_labelText()) {\n <span class=\"form-check-label\">{{ _labelText() }}</span>\n}\n<ng-content></ng-content>\n","import { Component, OnInit, HostBinding, HostListener, input } from '@angular/core';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ThyRadio } from '../radio.component';\n\n/**\n * @name [thy-radio-button],[thyRadioButton]\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[thy-radio-button],[thyRadioButton]',\n templateUrl: './radio-button.component.html',\n host: {\n '[attr.tabindex]': `tabIndex`\n }\n})\nexport class ThyRadioButton extends ThyRadio implements OnInit {\n @HostBinding('class.btn') isButton = true;\n @HostBinding('class.active') isActive = false;\n @HostBinding('class.disabled') get isDisabled() {\n return this._disabled;\n }\n\n name: string;\n\n readonly thyValue = input<string>();\n\n set thyChecked(value: boolean) {\n this.isActive = !!value;\n this.writeValue(coerceBooleanProperty(value));\n }\n\n ngOnInit() {\n this._isFormCheck = false;\n if (this.thyRadioGroupComponent) {\n this.thyRadioGroupComponent.addRadio(this);\n this.thyRadioGroupComponent.setGroup();\n }\n }\n\n @HostListener('click', ['$event'])\n click($event: MouseEvent) {\n if (!this._disabled) {\n this.change();\n }\n }\n}\n","<ng-container> {{ _labelText() }}</ng-container>\n<ng-content></ng-content>\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, effect, forwardRef, inject, input, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { useHostRenderer } from '@tethys/cdk/dom';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { ThyRadioButton } from '../button/radio-button.component';\nimport { ThyRadio } from '../radio.component';\nimport { IThyRadioGroupComponent, THY_RADIO_GROUP_COMPONENT } from '../radio.token';\n\nconst buttonGroupSizeMap = {\n sm: ['btn-group-sm'],\n lg: ['btn-group-lg']\n};\n\nconst radioGroupLayoutMap = {\n flex: ['radio-group-layout-flex']\n};\n\n/**\n * @name thy-radio-group\n * @order 20\n */\n@Component({\n selector: 'thy-radio-group',\n templateUrl: './radio-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRadioGroup),\n multi: true\n },\n {\n provide: THY_RADIO_GROUP_COMPONENT,\n useExisting: ThyRadioGroup\n }\n ],\n host: {\n class: 'thy-radio-group',\n '[class.btn-group]': 'isButtonGroup()',\n '[class.btn-group-outline-default]': 'isButtonGroupOutline()',\n '[attr.tabindex]': `-1`\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ThyRadioGroup implements IThyRadioGroupComponent, ControlValueAccessor {\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n isButtonGroup = signal(false);\n\n isButtonGroupOutline = signal(false);\n\n /**\n * 大小\n * @type sm | md | lg\n * @default md\n */\n readonly thySize = input<string>('md');\n\n /**\n * 布局\n * @type flex\n */\n readonly thyLayout = input<string>();\n\n _innerValue: string | number;\n\n radios: Array<ThyRadio | ThyRadioButton> = [];\n\n private hostRenderer = useHostRenderer();\n\n /**\n * 是否禁用单选组合框\n * @default false\n */\n readonly thyDisabled = input(false, { transform: coerceBooleanProperty });\n\n onChange: (_: string) => void = () => null;\n\n onTouched: () => void = () => null;\n\n addRadio(radio: ThyRadio | ThyRadioButton): void {\n this.radios.push(radio);\n radio.thyChecked = radio.thyValue() === this._innerValue;\n }\n\n updateValue(value: string, emit: boolean): void {\n this._innerValue = value;\n this.radios.forEach(radio => {\n radio.thyChecked = radio.thyValue() === this._innerValue;\n });\n if (emit) {\n this.onChange(value);\n }\n this.onTouched();\n this.changeDetectorRef.detectChanges();\n }\n\n writeValue(value: any): void {\n this.updateValue(value, false);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.radios.forEach(radio => {\n radio.setDisabledState(isDisabled);\n });\n }\n\n setGroup(): void {\n if (!this.isButtonGroup() && !this.isButtonGroupOutline()) {\n this.isButtonGroup.set(true);\n this.isButtonGroupOutline.set(true);\n }\n }\n\n constructor() {\n effect(() => {\n this.setClasses();\n });\n\n effect(() => {\n const disabled = this.thyDisabled();\n this.setDisabledState(disabled);\n });\n }\n\n private setClasses() {\n const classNames: string[] = [];\n const size = this.thySize();\n if (size && buttonGroupSizeMap[size]) {\n classNames.push(buttonGroupSizeMap[size]);\n }\n const layout = this.thyLayout();\n if (layout && radioGroupLayoutMap[layout]) {\n classNames.push(radioGroupLayoutMap[layout]);\n }\n this.hostRenderer.updateClass(classNames);\n }\n}\n","<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ThyRadio } from './radio.component';\nimport { ThyRadioButton } from './button/radio-button.component';\nimport { ThyRadioGroup } from './group/radio-group.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThyRadio, ThyRadioGroup, ThyRadioButton],\n exports: [ThyRadio, ThyRadioGroup, ThyRadioButton]\n})\nexport class ThyRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["coerceBooleanProperty"],"mappings":";;;;;;;;;AAcO,MAAM,yBAAyB,GAAG,IAAI,cAAc,CAA0B,2BAA2B,CAAC;;ACPjH;;;;AAIG;AAkBG,MAAO,QAA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