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,15 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, Component, inject, Renderer2, ElementRef, NgZone, ChangeDetectorRef, computed, output, effect, forwardRef, ContentChildren, ChangeDetectionStrategy, contentChild, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import { coerceBooleanProperty, dom, helpers, keycodes } from 'ngx-tethys/util';
|
|
5
5
|
import { ScrollToService } from 'ngx-tethys/core';
|
|
6
6
|
import { ThyListOption, THY_LIST_OPTION_PARENT_COMPONENT, ThyOptionModule } from 'ngx-tethys/shared';
|
|
7
|
-
import { Subscription } from 'rxjs';
|
|
8
|
-
import { startWith } from 'rxjs/operators';
|
|
9
7
|
import { useHostRenderer } from '@tethys/cdk/dom';
|
|
10
8
|
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
11
9
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
12
10
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
11
|
+
import { startWith } from 'rxjs/operators';
|
|
13
12
|
import { ThyAvatar, ThyAvatarModule } from 'ngx-tethys/avatar';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -18,58 +17,45 @@ import { ThyAvatar, ThyAvatarModule } from 'ngx-tethys/avatar';
|
|
|
18
17
|
* @order 10
|
|
19
18
|
*/
|
|
20
19
|
class ThyList {
|
|
21
|
-
/**
|
|
22
|
-
* 控制分割线的显示与隐藏
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
set thyDivided(value) {
|
|
26
|
-
this._isDivided = value;
|
|
27
|
-
}
|
|
28
20
|
constructor() {
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
/**
|
|
22
|
+
* 控制分割线的显示与隐藏
|
|
23
|
+
*/
|
|
24
|
+
this.thyDivided = input(false, { transform: coerceBooleanProperty });
|
|
31
25
|
}
|
|
32
26
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
27
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyList, isStandalone: true, selector: "thy-list", inputs: { thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-list-divided": "thyDivided()" }, classAttribute: "thy-list" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
|
|
34
28
|
}
|
|
35
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyList, decorators: [{
|
|
36
30
|
type: Component,
|
|
37
31
|
args: [{
|
|
38
32
|
selector: 'thy-list',
|
|
33
|
+
host: {
|
|
34
|
+
class: 'thy-list',
|
|
35
|
+
'[class.thy-list-divided]': 'thyDivided()'
|
|
36
|
+
},
|
|
39
37
|
template: '<ng-content></ng-content>'
|
|
40
38
|
}]
|
|
41
|
-
}]
|
|
42
|
-
type: Input,
|
|
43
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
44
|
-
}], _isDivided: [{
|
|
45
|
-
type: HostBinding,
|
|
46
|
-
args: [`class.thy-list-divided`]
|
|
47
|
-
}], _isList: [{
|
|
48
|
-
type: HostBinding,
|
|
49
|
-
args: [`class.thy-list`]
|
|
50
|
-
}] } });
|
|
39
|
+
}] });
|
|
51
40
|
|
|
52
41
|
/**
|
|
53
42
|
* @name thy-list-item,[thy-list-item]
|
|
54
43
|
* @order 15
|
|
55
44
|
*/
|
|
56
45
|
class ThyListItem {
|
|
57
|
-
constructor() {
|
|
58
|
-
this._isListItem = true;
|
|
59
|
-
}
|
|
60
46
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyListItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyListItem, isStandalone: true, selector: "thy-list-item,[thy-list-item]", host: {
|
|
47
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyListItem, isStandalone: true, selector: "thy-list-item,[thy-list-item]", host: { classAttribute: "thy-list-item" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
|
|
62
48
|
}
|
|
63
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyListItem, decorators: [{
|
|
64
50
|
type: Component,
|
|
65
51
|
args: [{
|
|
66
52
|
selector: 'thy-list-item,[thy-list-item]',
|
|
67
|
-
template: '<ng-content></ng-content>'
|
|
53
|
+
template: '<ng-content></ng-content>',
|
|
54
|
+
host: {
|
|
55
|
+
class: 'thy-list-item'
|
|
56
|
+
}
|
|
68
57
|
}]
|
|
69
|
-
}]
|
|
70
|
-
type: HostBinding,
|
|
71
|
-
args: [`class.thy-list-item`]
|
|
72
|
-
}] } });
|
|
58
|
+
}] });
|
|
73
59
|
|
|
74
60
|
const listSizesMap = {
|
|
75
61
|
sm: 'thy-list-sm'
|
|
@@ -84,177 +70,190 @@ class ThySelectionList {
|
|
|
84
70
|
this.elementRef = inject(ElementRef);
|
|
85
71
|
this.ngZone = inject(NgZone);
|
|
86
72
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
87
|
-
this._selectionChangesUnsubscribe$ = Subscription.EMPTY;
|
|
88
73
|
this.hostRenderer = useHostRenderer();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.multiple = true;
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
/**
|
|
75
|
+
* 改变 grid item 的选择模式,使其支持多选
|
|
76
|
+
*/
|
|
77
|
+
this.multiple = input(true, { alias: 'thyMultiple', transform: coerceBooleanProperty });
|
|
78
|
+
/**
|
|
79
|
+
* 绑定键盘事件的容器
|
|
80
|
+
* @type HTMLElement | ElementRef | string
|
|
81
|
+
* @default thy-selection-list 组件绑定的元素
|
|
82
|
+
*/
|
|
83
|
+
this.thyBindKeyEventContainer = input();
|
|
84
|
+
/**
|
|
85
|
+
* 出现滚动条的容器
|
|
86
|
+
* @type HTMLElement | ElementRef | string
|
|
87
|
+
* @default thy-selection-list 组件绑定的元素
|
|
88
|
+
*/
|
|
89
|
+
this.thyScrollContainer = input();
|
|
90
|
+
/**
|
|
91
|
+
* 键盘事件触发 Before 调用,如果返回 false 则停止继续执行
|
|
92
|
+
*/
|
|
93
|
+
this.thyBeforeKeydown = input();
|
|
94
|
+
/**
|
|
95
|
+
* Option Value 唯一的 Key,用于存储哪些选择被选中的唯一值,只有 Option 的 thyValue 是对象的时才可以传入该选项
|
|
96
|
+
*/
|
|
97
|
+
this.thyUniqueKey = input();
|
|
98
|
+
/**
|
|
99
|
+
* 比较2个选项的 Value 是否相同
|
|
100
|
+
*/
|
|
101
|
+
this.thyCompareWith = input();
|
|
102
|
+
/**
|
|
103
|
+
* grid item 的展示样式
|
|
104
|
+
* @type list | grid
|
|
105
|
+
*/
|
|
106
|
+
this.layout = input('list', { alias: 'thyLayout' });
|
|
107
|
+
this.isLayoutGrid = computed(() => this.layout() === 'grid');
|
|
108
|
+
/**
|
|
109
|
+
* 是否自动激活第一项
|
|
110
|
+
*/
|
|
111
|
+
this.thyAutoActiveFirstItem = input(false, { transform: coerceBooleanProperty });
|
|
112
|
+
/**
|
|
113
|
+
* 改变 grid item 的大小,支持默认以及 sm 两种大小
|
|
114
|
+
* @type sm | md | lg
|
|
115
|
+
*/
|
|
116
|
+
this.thySize = input();
|
|
117
|
+
/**
|
|
118
|
+
* 是否按下空格切换聚焦选项
|
|
119
|
+
*/
|
|
120
|
+
this.thySpaceKeyEnabled = input(true, { transform: coerceBooleanProperty });
|
|
95
121
|
/**
|
|
96
122
|
* 每当选项的选定状态发生更改时,都会触发更改事件
|
|
97
|
-
* @type EventEmitter<ThySelectionListChange>
|
|
98
123
|
*/
|
|
99
|
-
this.thySelectionChange =
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const previousValue = this.multiple;
|
|
109
|
-
this.multiple = value;
|
|
110
|
-
if (previousValue !== this.multiple) {
|
|
111
|
-
this._instanceSelectionModel();
|
|
112
|
-
}
|
|
124
|
+
this.thySelectionChange = output();
|
|
125
|
+
this.onTouched = () => { };
|
|
126
|
+
this.onChange = (_) => { };
|
|
127
|
+
effect(() => {
|
|
128
|
+
this.setListSize();
|
|
129
|
+
});
|
|
130
|
+
effect(() => {
|
|
131
|
+
this.instanceSelectionModel();
|
|
132
|
+
});
|
|
113
133
|
}
|
|
114
|
-
|
|
115
|
-
* grid item 的展示样式
|
|
116
|
-
* @type list | grid
|
|
117
|
-
* @default list
|
|
118
|
-
*/
|
|
119
|
-
set thyLayout(value) {
|
|
120
|
-
this.layout = value;
|
|
121
|
-
this.isLayoutGrid = value === 'grid';
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 是否自动激活第一项
|
|
125
|
-
*/
|
|
126
|
-
set thyAutoActiveFirstItem(value) {
|
|
127
|
-
this.autoActiveFirstItem = value;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* 改变 grid item 的大小,支持默认以及 sm 两种大小
|
|
131
|
-
* @type sm | md | lg
|
|
132
|
-
*/
|
|
133
|
-
set thySize(value) {
|
|
134
|
-
this._setListSize(value);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* 是否按下空格切换聚焦选项
|
|
138
|
-
*/
|
|
139
|
-
set thySpaceKeyEnabled(value) {
|
|
140
|
-
this.spaceEnabled = value;
|
|
141
|
-
}
|
|
142
|
-
_emitChangeEvent(option, event) {
|
|
134
|
+
emitChangeEvent(option, event) {
|
|
143
135
|
this.thySelectionChange.emit({
|
|
144
136
|
source: this,
|
|
145
|
-
value: option.thyValue,
|
|
137
|
+
value: option.thyValue(),
|
|
146
138
|
option: option,
|
|
147
139
|
event: event,
|
|
148
140
|
selected: this.isSelected(option)
|
|
149
141
|
});
|
|
150
142
|
}
|
|
151
|
-
|
|
143
|
+
emitModelValueChange() {
|
|
144
|
+
const uniqueKey = this.thyUniqueKey();
|
|
152
145
|
if (this.options) {
|
|
153
146
|
let selectedValues = this.selectionModel.selected;
|
|
154
|
-
if (
|
|
147
|
+
if (uniqueKey) {
|
|
155
148
|
selectedValues = selectedValues.map(selectedValue => {
|
|
156
149
|
const selectedOption = this.options.find(option => {
|
|
157
|
-
return option.thyValue[
|
|
150
|
+
return option.thyValue()[uniqueKey] === selectedValue;
|
|
158
151
|
});
|
|
159
152
|
if (selectedOption) {
|
|
160
|
-
return selectedOption.thyValue;
|
|
153
|
+
return selectedOption.thyValue();
|
|
161
154
|
}
|
|
162
155
|
else {
|
|
163
|
-
return this.
|
|
164
|
-
return value[
|
|
156
|
+
return this.modelValues.find(value => {
|
|
157
|
+
return value[uniqueKey] === selectedValue;
|
|
165
158
|
});
|
|
166
159
|
}
|
|
167
160
|
});
|
|
168
161
|
}
|
|
169
|
-
this.
|
|
162
|
+
this.modelValues = selectedValues;
|
|
170
163
|
let changeValue = selectedValues;
|
|
171
|
-
if (!this.multiple && selectedValues && selectedValues.length > 0) {
|
|
164
|
+
if (!this.multiple() && selectedValues && selectedValues.length > 0) {
|
|
172
165
|
changeValue = selectedValues[0];
|
|
173
166
|
}
|
|
174
|
-
this.
|
|
167
|
+
this.onChange(changeValue);
|
|
175
168
|
}
|
|
176
169
|
}
|
|
177
|
-
|
|
178
|
-
if (this.
|
|
170
|
+
toggleFocusedOption(event) {
|
|
171
|
+
if (this.keyManager.activeItem) {
|
|
179
172
|
this.ngZone.run(() => {
|
|
180
|
-
this.toggleOption(this.
|
|
173
|
+
this.toggleOption(this.keyManager.activeItem, event);
|
|
181
174
|
});
|
|
182
175
|
}
|
|
183
176
|
}
|
|
184
|
-
|
|
185
|
-
this.
|
|
177
|
+
initializeFocusKeyManager() {
|
|
178
|
+
this.keyManager = new ActiveDescendantKeyManager(this.options)
|
|
186
179
|
.withWrap()
|
|
187
180
|
// .withTypeAhead()
|
|
188
181
|
// Allow disabled items to be focusable. For accessibility reasons, there must be a way for
|
|
189
182
|
// screenreader users, that allows reading the different options of the list.
|
|
190
183
|
.skipPredicate(() => false);
|
|
191
184
|
}
|
|
192
|
-
|
|
193
|
-
this.selectionModel = new SelectionModel(this.multiple);
|
|
185
|
+
instanceSelectionModel() {
|
|
186
|
+
this.selectionModel = new SelectionModel(this.multiple());
|
|
194
187
|
}
|
|
195
|
-
|
|
188
|
+
getElementBySelector(element) {
|
|
196
189
|
return dom.getHTMLElementBySelector(element, this.elementRef);
|
|
197
190
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
compareValue(value1, value2) {
|
|
192
|
+
const thyUniqueKey = this.thyUniqueKey();
|
|
193
|
+
const thyCompareWith = this.thyCompareWith();
|
|
194
|
+
if (thyCompareWith) {
|
|
195
|
+
const compareFn = thyCompareWith;
|
|
201
196
|
return compareFn(value1, value2);
|
|
202
197
|
}
|
|
203
|
-
else if (
|
|
204
|
-
return value1 && value1[
|
|
198
|
+
else if (thyUniqueKey) {
|
|
199
|
+
return value1 && value1[thyUniqueKey] === value2 && value2[thyUniqueKey];
|
|
205
200
|
}
|
|
206
201
|
else {
|
|
207
202
|
return value1 === value2;
|
|
208
203
|
}
|
|
209
204
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
getOptionSelectionValue(option) {
|
|
206
|
+
const thyValue = option.thyValue();
|
|
207
|
+
if (thyValue) {
|
|
208
|
+
const thyUniqueKey = this.thyUniqueKey();
|
|
209
|
+
return thyUniqueKey ? thyValue[thyUniqueKey] : thyValue;
|
|
213
210
|
}
|
|
214
211
|
else {
|
|
215
212
|
return option;
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
|
-
|
|
215
|
+
setSelectionByValues(values) {
|
|
219
216
|
this.selectionModel.clear();
|
|
220
217
|
values.forEach(value => {
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
const thyUniqueKey = this.thyUniqueKey();
|
|
219
|
+
if (thyUniqueKey) {
|
|
220
|
+
this.selectionModel.select(value[thyUniqueKey]);
|
|
223
221
|
}
|
|
224
222
|
else {
|
|
225
223
|
this.selectionModel.select(value);
|
|
226
224
|
}
|
|
227
225
|
});
|
|
228
226
|
}
|
|
229
|
-
|
|
227
|
+
setAllOptionsSelected(toIsSelected) {
|
|
230
228
|
// Keep track of whether anything changed, because we only want to
|
|
231
229
|
// emit the changed event when something actually changed.
|
|
232
230
|
let hasChanged = false;
|
|
233
231
|
this.options.forEach(option => {
|
|
234
|
-
const fromIsSelected = this.selectionModel.isSelected(option.thyValue);
|
|
232
|
+
const fromIsSelected = this.selectionModel.isSelected(option.thyValue());
|
|
235
233
|
if (fromIsSelected !== toIsSelected) {
|
|
236
234
|
hasChanged = true;
|
|
237
|
-
this.selectionModel.toggle(option.thyValue);
|
|
235
|
+
this.selectionModel.toggle(option.thyValue());
|
|
238
236
|
}
|
|
239
237
|
});
|
|
240
238
|
if (hasChanged) {
|
|
241
|
-
this.
|
|
239
|
+
this.emitModelValueChange();
|
|
242
240
|
}
|
|
243
241
|
}
|
|
244
|
-
|
|
242
|
+
getOptionByValue(value) {
|
|
245
243
|
return this.options.find(option => {
|
|
246
|
-
return this.
|
|
244
|
+
return this.compareValue(option.thyValue(), value);
|
|
247
245
|
});
|
|
248
246
|
}
|
|
249
|
-
|
|
250
|
-
if (this.
|
|
251
|
-
return this.
|
|
247
|
+
getActiveOption() {
|
|
248
|
+
if (this.keyManager.activeItem) {
|
|
249
|
+
return this.getOptionByValue(this.keyManager.activeItem.thyValue());
|
|
252
250
|
}
|
|
253
251
|
else {
|
|
254
252
|
return null;
|
|
255
253
|
}
|
|
256
254
|
}
|
|
257
|
-
|
|
255
|
+
setListSize() {
|
|
256
|
+
const size = this.thySize();
|
|
258
257
|
for (const key in listSizesMap) {
|
|
259
258
|
if (listSizesMap.hasOwnProperty(key)) {
|
|
260
259
|
this.hostRenderer.removeClass(listSizesMap[key]);
|
|
@@ -265,55 +264,57 @@ class ThySelectionList {
|
|
|
265
264
|
}
|
|
266
265
|
}
|
|
267
266
|
ngOnInit() {
|
|
268
|
-
const bindKeyEventElement = this.
|
|
267
|
+
const bindKeyEventElement = this.getElementBySelector(this.thyBindKeyEventContainer());
|
|
269
268
|
this.ngZone.runOutsideAngular(() => {
|
|
270
|
-
this.
|
|
269
|
+
this.bindKeyEventUnsubscribe = this.renderer.listen(bindKeyEventElement, 'keydown', this.onKeydown.bind(this));
|
|
271
270
|
});
|
|
272
|
-
this.
|
|
271
|
+
this.instanceSelectionModel();
|
|
273
272
|
}
|
|
274
273
|
writeValue(value) {
|
|
275
274
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) && value) {
|
|
276
|
-
|
|
275
|
+
const multiple = this.multiple();
|
|
276
|
+
if (multiple && !helpers.isArray(value)) {
|
|
277
277
|
throw new Error(`The multiple selection ngModel must be an array.`);
|
|
278
278
|
}
|
|
279
|
-
if (!
|
|
279
|
+
if (!multiple && helpers.isArray(value)) {
|
|
280
280
|
throw new Error(`The single selection ngModel should not be an array.`);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
const values = helpers.isArray(value) ? value : value ? [value] : [];
|
|
284
|
-
this.
|
|
284
|
+
this.modelValues = values;
|
|
285
285
|
if (this.options) {
|
|
286
|
-
this.
|
|
286
|
+
this.setSelectionByValues(values);
|
|
287
287
|
}
|
|
288
288
|
this.changeDetectorRef.markForCheck();
|
|
289
289
|
}
|
|
290
290
|
registerOnChange(fn) {
|
|
291
|
-
this.
|
|
291
|
+
this.onChange = fn;
|
|
292
292
|
}
|
|
293
293
|
registerOnTouched(fn) {
|
|
294
|
-
this.
|
|
294
|
+
this.onTouched = fn;
|
|
295
295
|
}
|
|
296
296
|
setDisabledState(isDisabled) {
|
|
297
297
|
this.disabled = isDisabled;
|
|
298
298
|
}
|
|
299
299
|
onKeydown(event) {
|
|
300
|
-
|
|
300
|
+
const thyBeforeKeydown = this.thyBeforeKeydown();
|
|
301
|
+
if (thyBeforeKeydown) {
|
|
301
302
|
// stop key down event
|
|
302
|
-
const isContinue =
|
|
303
|
+
const isContinue = thyBeforeKeydown(event);
|
|
303
304
|
if (!isContinue) {
|
|
304
305
|
return;
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
308
|
const keyCode = event.keyCode || event.which;
|
|
308
|
-
const manager = this.
|
|
309
|
+
const manager = this.keyManager;
|
|
309
310
|
const previousFocusIndex = manager.activeItemIndex;
|
|
310
311
|
switch (keyCode) {
|
|
311
312
|
case keycodes.SPACE:
|
|
312
313
|
case keycodes.ENTER:
|
|
313
|
-
if (keyCode === keycodes.SPACE && !this.
|
|
314
|
+
if (keyCode === keycodes.SPACE && !this.thySpaceKeyEnabled()) {
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
|
-
this.
|
|
317
|
+
this.toggleFocusedOption(event);
|
|
317
318
|
// Always prevent space from scrolling the page since the list has focus
|
|
318
319
|
event.preventDefault();
|
|
319
320
|
break;
|
|
@@ -323,64 +324,63 @@ class ThySelectionList {
|
|
|
323
324
|
if ((keyCode === keycodes.UP_ARROW || keyCode === keycodes.DOWN_ARROW) &&
|
|
324
325
|
event.shiftKey &&
|
|
325
326
|
manager.activeItemIndex !== previousFocusIndex) {
|
|
326
|
-
this.
|
|
327
|
+
this.toggleFocusedOption(event);
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
330
|
toggleOption(option, event) {
|
|
330
|
-
if (option && !option.
|
|
331
|
-
this.selectionModel.toggle(this.
|
|
331
|
+
if (option && !option.thyDisabled()) {
|
|
332
|
+
this.selectionModel.toggle(this.getOptionSelectionValue(option));
|
|
332
333
|
// Emit a change event because the focused option changed its state through user
|
|
333
334
|
// interaction.
|
|
334
|
-
this.
|
|
335
|
-
this.
|
|
335
|
+
this.emitModelValueChange();
|
|
336
|
+
this.emitChangeEvent(option, event);
|
|
336
337
|
}
|
|
337
338
|
}
|
|
338
339
|
setActiveOption(option) {
|
|
339
|
-
this.
|
|
340
|
+
this.keyManager.updateActiveItem(option); // .updateActiveItemIndex(this._getOptionIndex(option));
|
|
340
341
|
}
|
|
341
342
|
scrollIntoView(option) {
|
|
342
|
-
const scrollContainerElement = dom.getHTMLElementBySelector(this.thyScrollContainer, this.elementRef);
|
|
343
|
+
const scrollContainerElement = dom.getHTMLElementBySelector(this.thyScrollContainer(), this.elementRef);
|
|
343
344
|
ScrollToService.scrollToElement(option.element.nativeElement, scrollContainerElement);
|
|
344
345
|
}
|
|
345
346
|
isSelected(option) {
|
|
346
|
-
return this.selectionModel.isSelected(this.
|
|
347
|
+
return this.selectionModel.isSelected(this.getOptionSelectionValue(option));
|
|
347
348
|
}
|
|
348
349
|
clearActiveItem() {
|
|
349
|
-
if (this.
|
|
350
|
-
this.
|
|
350
|
+
if (this.keyManager.activeItem) {
|
|
351
|
+
this.keyManager.setActiveItem(-1);
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
354
|
determineClearActiveItem() {
|
|
354
|
-
if (!this.
|
|
355
|
+
if (!this.getActiveOption()) {
|
|
355
356
|
this.clearActiveItem();
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
359
|
/** Selects all of the options. */
|
|
359
360
|
selectAll() {
|
|
360
|
-
this.
|
|
361
|
+
this.setAllOptionsSelected(true);
|
|
361
362
|
}
|
|
362
363
|
/** Deselects all of the options. */
|
|
363
364
|
deselectAll() {
|
|
364
|
-
this.
|
|
365
|
+
this.setAllOptionsSelected(false);
|
|
365
366
|
}
|
|
366
367
|
ngAfterContentInit() {
|
|
367
|
-
this.
|
|
368
|
+
this.initializeFocusKeyManager();
|
|
368
369
|
this.options.changes.pipe(startWith(true)).subscribe(() => {
|
|
369
|
-
if (this.
|
|
370
|
-
if (!this.
|
|
371
|
-
this.
|
|
370
|
+
if (this.thyAutoActiveFirstItem()) {
|
|
371
|
+
if (!this.keyManager.activeItem || this.options.toArray().indexOf(this.keyManager.activeItem) < 0) {
|
|
372
|
+
this.keyManager.setFirstItemActive();
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
});
|
|
375
376
|
}
|
|
376
377
|
ngOnDestroy() {
|
|
377
|
-
this.
|
|
378
|
-
|
|
379
|
-
this._bindKeyEventUnsubscribe();
|
|
378
|
+
if (this.bindKeyEventUnsubscribe) {
|
|
379
|
+
this.bindKeyEventUnsubscribe();
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySelectionList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
383
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
383
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThySelectionList, isStandalone: true, selector: "thy-selection-list,[thy-selection-list]", inputs: { multiple: { classPropertyName: "multiple", publicName: "thyMultiple", isSignal: true, isRequired: false, transformFunction: null }, thyBindKeyEventContainer: { classPropertyName: "thyBindKeyEventContainer", publicName: "thyBindKeyEventContainer", isSignal: true, isRequired: false, transformFunction: null }, thyScrollContainer: { classPropertyName: "thyScrollContainer", publicName: "thyScrollContainer", isSignal: true, isRequired: false, transformFunction: null }, thyBeforeKeydown: { classPropertyName: "thyBeforeKeydown", publicName: "thyBeforeKeydown", isSignal: true, isRequired: false, transformFunction: null }, thyUniqueKey: { classPropertyName: "thyUniqueKey", publicName: "thyUniqueKey", isSignal: true, isRequired: false, transformFunction: null }, thyCompareWith: { classPropertyName: "thyCompareWith", publicName: "thyCompareWith", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "thyLayout", isSignal: true, isRequired: false, transformFunction: null }, thyAutoActiveFirstItem: { classPropertyName: "thyAutoActiveFirstItem", publicName: "thyAutoActiveFirstItem", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thySpaceKeyEnabled: { classPropertyName: "thySpaceKeyEnabled", publicName: "thySpaceKeyEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thySelectionChange: "thySelectionChange" }, host: { properties: { "class.thy-multiple-selection-list": "multiple()", "class.thy-grid-list": "isLayoutGrid()" }, classAttribute: "thy-list thy-selection-list" }, providers: [
|
|
384
384
|
{
|
|
385
385
|
provide: THY_LIST_OPTION_PARENT_COMPONENT,
|
|
386
386
|
useExisting: ThySelectionList
|
|
@@ -408,48 +408,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
408
408
|
multi: true
|
|
409
409
|
}
|
|
410
410
|
],
|
|
411
|
+
host: {
|
|
412
|
+
class: 'thy-list thy-selection-list',
|
|
413
|
+
'[class.thy-multiple-selection-list]': 'multiple()',
|
|
414
|
+
'[class.thy-grid-list]': 'isLayoutGrid()'
|
|
415
|
+
},
|
|
411
416
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
412
417
|
}]
|
|
413
|
-
}], propDecorators: {
|
|
414
|
-
type: HostBinding,
|
|
415
|
-
args: [`class.thy-list`]
|
|
416
|
-
}], _isSelectionList: [{
|
|
417
|
-
type: HostBinding,
|
|
418
|
-
args: [`class.thy-selection-list`]
|
|
419
|
-
}], multiple: [{
|
|
420
|
-
type: HostBinding,
|
|
421
|
-
args: [`class.thy-multiple-selection-list`]
|
|
422
|
-
}], isLayoutGrid: [{
|
|
423
|
-
type: HostBinding,
|
|
424
|
-
args: [`class.thy-grid-list`]
|
|
425
|
-
}], options: [{
|
|
418
|
+
}], ctorParameters: () => [], propDecorators: { options: [{
|
|
426
419
|
type: ContentChildren,
|
|
427
420
|
args: [ThyListOption, { descendants: true }]
|
|
428
|
-
}], thyMultiple: [{
|
|
429
|
-
type: Input,
|
|
430
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
431
|
-
}], thyBindKeyEventContainer: [{
|
|
432
|
-
type: Input
|
|
433
|
-
}], thyScrollContainer: [{
|
|
434
|
-
type: Input
|
|
435
|
-
}], thyBeforeKeydown: [{
|
|
436
|
-
type: Input
|
|
437
|
-
}], thyUniqueKey: [{
|
|
438
|
-
type: Input
|
|
439
|
-
}], thyCompareWith: [{
|
|
440
|
-
type: Input
|
|
441
|
-
}], thyLayout: [{
|
|
442
|
-
type: Input
|
|
443
|
-
}], thyAutoActiveFirstItem: [{
|
|
444
|
-
type: Input,
|
|
445
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
446
|
-
}], thySize: [{
|
|
447
|
-
type: Input
|
|
448
|
-
}], thySpaceKeyEnabled: [{
|
|
449
|
-
type: Input,
|
|
450
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
451
|
-
}], thySelectionChange: [{
|
|
452
|
-
type: Output
|
|
453
421
|
}] } });
|
|
454
422
|
|
|
455
423
|
/**
|
|
@@ -458,33 +426,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
458
426
|
*/
|
|
459
427
|
class ThyListItemMeta {
|
|
460
428
|
constructor() {
|
|
461
|
-
|
|
429
|
+
/**
|
|
430
|
+
* 列表项的左侧图片
|
|
431
|
+
*/
|
|
432
|
+
this.thyAvatar = input();
|
|
433
|
+
/**
|
|
434
|
+
* 列表项的标题
|
|
435
|
+
*/
|
|
436
|
+
this.thyTitle = input();
|
|
437
|
+
/**
|
|
438
|
+
* 列表项的描述文本
|
|
439
|
+
*/
|
|
440
|
+
this.thyDescription = input();
|
|
441
|
+
this.avatarTemplateRef = contentChild('metaAvatar');
|
|
442
|
+
this.titleTemplateRef = contentChild('metaTitle');
|
|
443
|
+
this.descriptionTemplateRef = contentChild('metaDescription');
|
|
462
444
|
}
|
|
463
445
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyListItemMeta, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
464
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyListItemMeta, isStandalone: true, selector: "thy-list-item-meta,[thy-list-item-meta]", inputs: { thyAvatar: "thyAvatar", thyTitle: "thyTitle",
|
|
446
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyListItemMeta, isStandalone: true, selector: "thy-list-item-meta,[thy-list-item-meta]", inputs: { thyAvatar: { classPropertyName: "thyAvatar", publicName: "thyAvatar", isSignal: true, isRequired: false, transformFunction: null }, thyTitle: { classPropertyName: "thyTitle", publicName: "thyTitle", isSignal: true, isRequired: false, transformFunction: null }, thyDescription: { classPropertyName: "thyDescription", publicName: "thyDescription", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-list-item-meta" }, queries: [{ propertyName: "avatarTemplateRef", first: true, predicate: ["metaAvatar"], descendants: true, isSignal: true }, { propertyName: "titleTemplateRef", first: true, predicate: ["metaTitle"], descendants: true, isSignal: true }, { propertyName: "descriptionTemplateRef", first: true, predicate: ["metaDescription"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"thy-list-item-meta-avatar\">\n @if (thyAvatar()) {\n <thy-avatar [thySrc]=\"thyAvatar()\"></thy-avatar>\n } @else {\n <ng-template [ngTemplateOutlet]=\"avatarTemplateRef()\"></ng-template>\n }\n</div>\n<div class=\"thy-list-item-meta-content\">\n <div class=\"thy-list-item-meta-title\">\n @if (thyTitle()) {\n {{ thyTitle() }}\n } @else {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n }\n </div>\n <div class=\"thy-list-item-meta-description\">\n @if (thyDescription()) {\n {{ thyDescription() }}\n } @else {\n <ng-template [ngTemplateOutlet]=\"descriptionTemplateRef()\"></ng-template>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ThyAvatar, selector: "thy-avatar", inputs: ["thyShowName", "thySrc", "thyName", "thySize", "thyShowRemove", "thyRemovable", "thyImgClass", "thyDisabled", "thyLoading", "thyFetchPriority"], outputs: ["thyOnRemove", "thyRemove", "thyError", "thySizeChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
465
447
|
}
|
|
466
448
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyListItemMeta, decorators: [{
|
|
467
449
|
type: Component,
|
|
468
|
-
args: [{ selector: 'thy-list-item-meta,[thy-list-item-meta]',
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
type: Input
|
|
473
|
-
}], thyDescription: [{
|
|
474
|
-
type: Input
|
|
475
|
-
}], avatarTemplateRef: [{
|
|
476
|
-
type: ContentChild,
|
|
477
|
-
args: ['metaAvatar']
|
|
478
|
-
}], titleTemplateRef: [{
|
|
479
|
-
type: ContentChild,
|
|
480
|
-
args: ['metaTitle']
|
|
481
|
-
}], descriptionTemplateRef: [{
|
|
482
|
-
type: ContentChild,
|
|
483
|
-
args: ['metaDescription']
|
|
484
|
-
}], className: [{
|
|
485
|
-
type: HostBinding,
|
|
486
|
-
args: ['class']
|
|
487
|
-
}] } });
|
|
450
|
+
args: [{ selector: 'thy-list-item-meta,[thy-list-item-meta]', host: {
|
|
451
|
+
class: 'thy-list-item-meta'
|
|
452
|
+
}, imports: [ThyAvatar, NgTemplateOutlet], template: "<div class=\"thy-list-item-meta-avatar\">\n @if (thyAvatar()) {\n <thy-avatar [thySrc]=\"thyAvatar()\"></thy-avatar>\n } @else {\n <ng-template [ngTemplateOutlet]=\"avatarTemplateRef()\"></ng-template>\n }\n</div>\n<div class=\"thy-list-item-meta-content\">\n <div class=\"thy-list-item-meta-title\">\n @if (thyTitle()) {\n {{ thyTitle() }}\n } @else {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n }\n </div>\n <div class=\"thy-list-item-meta-description\">\n @if (thyDescription()) {\n {{ thyDescription() }}\n } @else {\n <ng-template [ngTemplateOutlet]=\"descriptionTemplateRef()\"></ng-template>\n }\n </div>\n</div>\n" }]
|
|
453
|
+
}] });
|
|
488
454
|
|
|
489
455
|
class ThyListModule {
|
|
490
456
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|