ngx-tethys 19.1.0-next.0 → 19.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +0 -1
- package/action/action.component.d.ts +7 -8
- package/affix/affix.component.d.ts +3 -4
- package/button/button-group.component.d.ts +5 -12
- package/button/button-icon.component.d.ts +14 -28
- package/button/button.component.d.ts +17 -27
- package/date-picker/styles/calendar.scss +1 -1
- package/date-picker/styles/week-picker.scss +1 -0
- package/dropdown/dropdown-active.directive.d.ts +4 -5
- package/dropdown/dropdown-menu-item.directive.d.ts +7 -15
- package/dropdown/dropdown-menu.component.d.ts +6 -13
- package/dropdown/dropdown-submenu.component.d.ts +2 -4
- package/dropdown/dropdown.directive.d.ts +14 -25
- package/fesm2022/ngx-tethys-action.mjs +15 -16
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +14 -18
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +225 -322
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +1 -0
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +2 -2
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +6 -6
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +155 -203
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-flexible-text.mjs +67 -86
- package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +10 -15
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-icon.mjs +44 -59
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +40 -36
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +7 -11
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +8 -19
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +42 -54
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +115 -157
- package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +111 -157
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-segment.mjs +84 -103
- package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +2 -1
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +37 -56
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +2 -8
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +52 -66
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +98 -119
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +2 -4
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +281 -401
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +53 -99
- package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/flexible-text/flexible-text.component.d.ts +9 -15
- package/grid/flex.d.ts +1 -3
- package/grid/thy-row.directive.d.ts +1 -4
- package/icon/icon.component.d.ts +10 -18
- package/image/image.directive.d.ts +10 -13
- package/image/image.token.d.ts +5 -5
- package/input-number/input-number.component.d.ts +1 -1
- package/package.json +1 -1
- package/progress/progress-circle.component.d.ts +3 -5
- package/progress/progress.component.d.ts +2 -4
- package/property/properties.component.d.ts +0 -2
- package/property/property-item.component.d.ts +3 -10
- package/radio/group/radio-group.component.d.ts +5 -9
- package/rate/rate-item.component.d.ts +8 -11
- package/rate/rate.component.d.ts +18 -29
- package/resizable/resizable.directive.d.ts +18 -31
- package/resizable/resize-handle.component.d.ts +6 -7
- package/resizable/resize-handles.component.d.ts +5 -9
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +9 -15
- package/segment/segment.component.d.ts +11 -15
- package/segment/segment.token.d.ts +4 -3
- package/slide/slide-body/slide-body-section.component.d.ts +2 -6
- package/slide/slide-header/slide-header.component.d.ts +6 -9
- package/space/space.component.d.ts +5 -11
- package/strength/strength.component.d.ts +8 -13
- package/transfer/transfer-list.component.d.ts +15 -15
- package/transfer/transfer.component.d.ts +20 -23
- package/tree/tree-abstract.d.ts +5 -5
- package/tree/tree-node.component.d.ts +24 -37
- package/tree/tree.class.d.ts +4 -4
- package/tree/tree.component.d.ts +47 -75
- package/tree/tree.service.d.ts +3 -4
- package/tree-select/tree-select.component.d.ts +2 -2
- package/vote/vote.component.d.ts +13 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, computed, input, forwardRef, HostBinding, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { ThyTranslate } from 'ngx-tethys/core';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
@@ -21,61 +21,57 @@ class ThyStrength {
|
|
|
21
21
|
this.translate = inject(ThyTranslate);
|
|
22
22
|
this.styleClass = true;
|
|
23
23
|
this.locale = injectLocale('strength');
|
|
24
|
-
this.strengthMap = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
this.strengthMap = computed(() => {
|
|
25
|
+
return {
|
|
26
|
+
[ThyStrengthEnum.highest]: {
|
|
27
|
+
level: 'highest',
|
|
28
|
+
text: this.highestKey()
|
|
29
|
+
},
|
|
30
|
+
[ThyStrengthEnum.high]: {
|
|
31
|
+
level: 'high',
|
|
32
|
+
text: this.highKey()
|
|
33
|
+
},
|
|
34
|
+
[ThyStrengthEnum.average]: {
|
|
35
|
+
level: 'average',
|
|
36
|
+
text: this.averageKey()
|
|
37
|
+
},
|
|
38
|
+
[ThyStrengthEnum.low]: {
|
|
39
|
+
level: 'low',
|
|
40
|
+
text: this.lowKey()
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* 组件标题,描述程度所指类型
|
|
46
|
+
*/
|
|
47
|
+
this.titleKey = input('', { transform: (value) => this.translate.instant(value) || '' });
|
|
48
|
+
/**
|
|
49
|
+
* 程度最高值文本
|
|
50
|
+
*/
|
|
51
|
+
this.highestKey = input(this.locale().highest, {
|
|
52
|
+
transform: (value) => this.translate.instant(value) || this.locale().highest
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* 程度为高值时展示的文本
|
|
56
|
+
*/
|
|
57
|
+
this.highKey = input(this.locale().high, {
|
|
58
|
+
transform: (value) => this.translate.instant(value) || this.locale().high
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* 程度为中值时展示的文本
|
|
62
|
+
*/
|
|
63
|
+
this.averageKey = input(this.locale().medium, {
|
|
64
|
+
transform: (value) => this.translate.instant(value) || this.locale().medium
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* 程度为低值时展示的文本
|
|
68
|
+
*/
|
|
69
|
+
this.lowKey = input(this.locale().low, {
|
|
70
|
+
transform: (value) => this.translate.instant(value) || this.locale().low
|
|
71
|
+
});
|
|
42
72
|
this._onChange = Function.prototype;
|
|
43
73
|
this._onTouched = Function.prototype;
|
|
44
74
|
}
|
|
45
|
-
/**
|
|
46
|
-
* 组件标题,描述程度所指类型
|
|
47
|
-
*/
|
|
48
|
-
set titleKey(value) {
|
|
49
|
-
this.strengthTitle = this.translate.instant(value);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* 程度最高值文本
|
|
53
|
-
* @default 最高
|
|
54
|
-
*/
|
|
55
|
-
set highestKey(value) {
|
|
56
|
-
this.strengthMap[ThyStrengthEnum.highest].text = this.translate.instant(value);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 程度为高值时展示的文本
|
|
60
|
-
* @default 高
|
|
61
|
-
*/
|
|
62
|
-
set highKey(value) {
|
|
63
|
-
this.strengthMap[ThyStrengthEnum.high].text = this.translate.instant(value);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* 程度为中值时展示的文本
|
|
67
|
-
* @default 中
|
|
68
|
-
*/
|
|
69
|
-
set averageKey(value) {
|
|
70
|
-
this.strengthMap[ThyStrengthEnum.average].text = this.translate.instant(value);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* 程度为低值时展示的文本
|
|
74
|
-
* @default 低
|
|
75
|
-
*/
|
|
76
|
-
set lowKey(value) {
|
|
77
|
-
this.strengthMap[ThyStrengthEnum.low].text = this.translate.instant(value);
|
|
78
|
-
}
|
|
79
75
|
ngOnInit() { }
|
|
80
76
|
writeValue(value) {
|
|
81
77
|
this.strength = value;
|
|
@@ -89,13 +85,13 @@ class ThyStrength {
|
|
|
89
85
|
this._onTouched = fn;
|
|
90
86
|
}
|
|
91
87
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStrength, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
92
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
88
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyStrength, isStandalone: true, selector: "thy-strength", inputs: { titleKey: { classPropertyName: "titleKey", publicName: "titleKey", isSignal: true, isRequired: false, transformFunction: null }, highestKey: { classPropertyName: "highestKey", publicName: "highestKey", isSignal: true, isRequired: false, transformFunction: null }, highKey: { classPropertyName: "highKey", publicName: "highKey", isSignal: true, isRequired: false, transformFunction: null }, averageKey: { classPropertyName: "averageKey", publicName: "averageKey", isSignal: true, isRequired: false, transformFunction: null }, lowKey: { classPropertyName: "lowKey", publicName: "lowKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.password-strength-container": "this.styleClass" } }, providers: [
|
|
93
89
|
{
|
|
94
90
|
provide: NG_VALUE_ACCESSOR,
|
|
95
91
|
useExisting: forwardRef(() => ThyStrength),
|
|
96
92
|
multi: true
|
|
97
93
|
}
|
|
98
|
-
], ngImport: i0, template: "<div>\n {{
|
|
94
|
+
], ngImport: i0, template: "<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n" }); }
|
|
99
95
|
}
|
|
100
96
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyStrength, decorators: [{
|
|
101
97
|
type: Component,
|
|
@@ -105,20 +101,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
105
101
|
useExisting: forwardRef(() => ThyStrength),
|
|
106
102
|
multi: true
|
|
107
103
|
}
|
|
108
|
-
], template: "<div>\n {{
|
|
104
|
+
], template: "<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n" }]
|
|
109
105
|
}], propDecorators: { styleClass: [{
|
|
110
106
|
type: HostBinding,
|
|
111
107
|
args: ['class.password-strength-container']
|
|
112
|
-
}], titleKey: [{
|
|
113
|
-
type: Input
|
|
114
|
-
}], highestKey: [{
|
|
115
|
-
type: Input
|
|
116
|
-
}], highKey: [{
|
|
117
|
-
type: Input
|
|
118
|
-
}], averageKey: [{
|
|
119
|
-
type: Input
|
|
120
|
-
}], lowKey: [{
|
|
121
|
-
type: Input
|
|
122
108
|
}] } });
|
|
123
109
|
|
|
124
110
|
class ThyStrengthModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-strength.mjs","sources":["../../../src/strength/strength.component.ts","../../../src/strength/strength.component.html","../../../src/strength/strength.module.ts","../../../src/strength/ngx-tethys-strength.ts"],"sourcesContent":["import { ThyTranslate } from 'ngx-tethys/core';\n\nimport { Component, forwardRef, HostBinding,
|
|
1
|
+
{"version":3,"file":"ngx-tethys-strength.mjs","sources":["../../../src/strength/strength.component.ts","../../../src/strength/strength.component.html","../../../src/strength/strength.module.ts","../../../src/strength/ngx-tethys-strength.ts"],"sourcesContent":["import { ThyTranslate } from 'ngx-tethys/core';\n\nimport { Component, computed, forwardRef, HostBinding, inject, input, OnInit, Signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { injectLocale, ThyStrengthLocale } from 'ngx-tethys/i18n';\n\nenum ThyStrengthEnum {\n highest = 4,\n high = 3,\n average = 2,\n low = 1\n}\n\n/**\n * 程度展示组件\n * @name thy-strength\n * @order 10\n */\n@Component({\n selector: 'thy-strength',\n templateUrl: 'strength.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyStrength),\n multi: true\n }\n ]\n})\nexport class ThyStrength implements OnInit, ControlValueAccessor {\n translate = inject(ThyTranslate);\n\n @HostBinding('class.password-strength-container') styleClass = true;\n\n strength: ThyStrengthEnum;\n\n locale: Signal<ThyStrengthLocale> = injectLocale('strength');\n\n readonly strengthMap = computed(() => {\n return {\n [ThyStrengthEnum.highest]: {\n level: 'highest',\n text: this.highestKey()\n },\n [ThyStrengthEnum.high]: {\n level: 'high',\n text: this.highKey()\n },\n [ThyStrengthEnum.average]: {\n level: 'average',\n text: this.averageKey()\n },\n [ThyStrengthEnum.low]: {\n level: 'low',\n text: this.lowKey()\n }\n };\n });\n\n /**\n * 组件标题,描述程度所指类型\n */\n readonly titleKey = input<string, string>('', { transform: (value: string) => this.translate.instant(value) || '' });\n\n /**\n * 程度最高值文本\n */\n readonly highestKey = input<string, string>(this.locale().highest, {\n transform: (value: string) => this.translate.instant(value) || this.locale().highest\n });\n\n /**\n * 程度为高值时展示的文本\n */\n readonly highKey = input<string, string>(this.locale().high, {\n transform: (value: string) => this.translate.instant(value) || this.locale().high\n });\n\n /**\n * 程度为中值时展示的文本\n */\n readonly averageKey = input<string, string>(this.locale().medium, {\n transform: (value: string) => this.translate.instant(value) || this.locale().medium\n });\n\n /**\n * 程度为低值时展示的文本\n */\n readonly lowKey = input<string, string>(this.locale().low, {\n transform: (value: string) => this.translate.instant(value) || this.locale().low\n });\n\n private _onChange = Function.prototype;\n\n private _onTouched = Function.prototype;\n\n ngOnInit() {}\n\n writeValue(value: ThyStrengthEnum) {\n this.strength = value;\n this._onChange(value);\n this._onTouched();\n }\n\n registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n}\n","<div>\n {{ titleKey() }} <span class=\"strength-text strength-text-{{ strengthMap()[strength]?.level }}\">{{ strengthMap()[strength]?.text }}</span>\n</div>\n<div class=\"strength-level strength-level-{{ strengthMap()[strength]?.level }}\">\n <span></span>\n</div>\n","import { NgModule } from '@angular/core';\nimport { ThyStrength } from './strength.component';\n\n@NgModule({\n imports: [ThyStrength],\n exports: [ThyStrength],\n providers: []\n})\nexport class ThyStrengthModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA,IAAK,eAKJ;AALD,CAAA,UAAK,eAAe,EAAA;AAChB,IAAA,eAAA,CAAA,eAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACX,IAAA,eAAA,CAAA,eAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,eAAA,CAAA,eAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACX,IAAA,eAAA,CAAA,eAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAO;AACX,CAAC,EALI,eAAe,KAAf,eAAe,GAKnB,EAAA,CAAA,CAAA;AAED;;;;AAIG;MAYU,WAAW,CAAA;AAXxB,IAAA,WAAA,GAAA;AAYI,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAEkB,IAAU,CAAA,UAAA,GAAG,IAAI;AAInE,QAAA,IAAA,CAAA,MAAM,GAA8B,YAAY,CAAC,UAAU,CAAC;AAEnD,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;YACjC,OAAO;AACH,gBAAA,CAAC,eAAe,CAAC,OAAO,GAAG;AACvB,oBAAA,KAAK,EAAE,SAAS;AAChB,oBAAA,IAAI,EAAE,IAAI,CAAC,UAAU;AACxB,iBAAA;AACD,gBAAA,CA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C,iBAAiB,CAAA;8GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAjB,iBAAiB,EAAA,OAAA,EAAA,CAJhB,WAAW,CAAA,EAAA,OAAA,EAAA,CACX,WAAW,CAAA,EAAA,CAAA,CAAA;+GAGZ,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,WAAW,CAAC;oBACtB,OAAO,EAAE,CAAC,WAAW,CAAC;AACtB,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, IterableDiffers,
|
|
2
|
+
import { inject, IterableDiffers, input, numberAttribute, output, ViewEncapsulation, Component, contentChild, computed, effect, NgModule } from '@angular/core';
|
|
3
3
|
import { ThyFlexibleText, ThyFlexibleTextModule } from 'ngx-tethys/flexible-text';
|
|
4
4
|
import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
5
5
|
import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
@@ -7,6 +7,7 @@ import { moveItemInArray, transferArrayItem, CdkDropListGroup, CdkDropList, CdkD
|
|
|
7
7
|
import { ThyList, ThyListItem, ThyListModule } from 'ngx-tethys/list';
|
|
8
8
|
import { ThyDragDropDirective, ThySharedModule } from 'ngx-tethys/shared';
|
|
9
9
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
10
|
+
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
10
11
|
import { ThyButtonModule } from 'ngx-tethys/button';
|
|
11
12
|
|
|
12
13
|
var TransferDirection;
|
|
@@ -24,12 +25,20 @@ class ThyTransferList {
|
|
|
24
25
|
this.lockItems = [];
|
|
25
26
|
this.unlockItems = [];
|
|
26
27
|
this.locale = injectLocale('transfer');
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
28
|
+
this.title = input();
|
|
29
|
+
this.items = input();
|
|
30
|
+
this.draggable = input(false, { transform: coerceBooleanProperty });
|
|
31
|
+
this.canLock = input(false, { transform: coerceBooleanProperty });
|
|
32
|
+
this.maxLock = input(undefined, { transform: numberAttribute });
|
|
33
|
+
this.max = input(undefined, { transform: numberAttribute });
|
|
34
|
+
this.disabled = input(false, { transform: coerceBooleanProperty });
|
|
35
|
+
this.template = input();
|
|
36
|
+
this.renderContentRef = input();
|
|
37
|
+
this.draggableUpdate = output();
|
|
38
|
+
this.selectItem = output();
|
|
39
|
+
this.unselectItem = output();
|
|
31
40
|
this.lockListEnterPredicate = () => {
|
|
32
|
-
return this.lockItems.length < this.maxLock;
|
|
41
|
+
return this.lockItems.length < this.maxLock();
|
|
33
42
|
};
|
|
34
43
|
this.unlockListEnterPredicate = (event) => {
|
|
35
44
|
return !event.data.isFixed;
|
|
@@ -43,20 +52,20 @@ class ThyTransferList {
|
|
|
43
52
|
}
|
|
44
53
|
ngOnInit() {
|
|
45
54
|
this._combineTransferData();
|
|
46
|
-
if (this.canLock) {
|
|
55
|
+
if (this.canLock()) {
|
|
47
56
|
this._lockDiff = this.differs.find(this.lockItems).create();
|
|
48
57
|
this._unlockDiff = this.differs.find(this.unlockItems).create();
|
|
49
58
|
}
|
|
50
59
|
else {
|
|
51
60
|
this._unlockDiff = this.differs.find(this.unlockItems).create();
|
|
52
61
|
}
|
|
53
|
-
this._diff = this.differs.find(this.items).create();
|
|
62
|
+
this._diff = this.differs.find(this.items()).create();
|
|
54
63
|
}
|
|
55
64
|
_combineTransferData() {
|
|
56
65
|
this.lockItems = [];
|
|
57
66
|
this.unlockItems = [];
|
|
58
|
-
if (this.canLock) {
|
|
59
|
-
(this.items || []).forEach(item => {
|
|
67
|
+
if (this.canLock()) {
|
|
68
|
+
(this.items() || []).forEach(item => {
|
|
60
69
|
if (item.isLock) {
|
|
61
70
|
this.lockItems.push(item);
|
|
62
71
|
}
|
|
@@ -66,7 +75,7 @@ class ThyTransferList {
|
|
|
66
75
|
});
|
|
67
76
|
}
|
|
68
77
|
else {
|
|
69
|
-
this.unlockItems = this.items;
|
|
78
|
+
this.unlockItems = this.items();
|
|
70
79
|
}
|
|
71
80
|
}
|
|
72
81
|
_afterChangeItems(changes, items) {
|
|
@@ -86,9 +95,9 @@ class ThyTransferList {
|
|
|
86
95
|
});
|
|
87
96
|
}
|
|
88
97
|
ngDoCheck() {
|
|
89
|
-
const changes = this._diff.diff(this.items);
|
|
98
|
+
const changes = this._diff.diff(this.items());
|
|
90
99
|
if (changes) {
|
|
91
|
-
this._afterChangeItems(changes, this.items);
|
|
100
|
+
this._afterChangeItems(changes, this.items());
|
|
92
101
|
this._combineTransferData();
|
|
93
102
|
}
|
|
94
103
|
if (this._lockDiff) {
|
|
@@ -127,40 +136,14 @@ class ThyTransferList {
|
|
|
127
136
|
});
|
|
128
137
|
}
|
|
129
138
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyTransferList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
130
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyTransferList, isStandalone: true, selector: "thy-transfer-list", inputs: { title: "title", items: "items", draggable: "draggable", canLock: "canLock", maxLock: "maxLock", max: "max", disabled: "disabled", template: "template",
|
|
139
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyTransferList, isStandalone: true, selector: "thy-transfer-list", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, canLock: { classPropertyName: "canLock", publicName: "canLock", isSignal: true, isRequired: false, transformFunction: null }, maxLock: { classPropertyName: "maxLock", publicName: "maxLock", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, renderContentRef: { classPropertyName: "renderContentRef", publicName: "renderContentRef", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { draggableUpdate: "draggableUpdate", selectItem: "selectItem", unselectItem: "unselectItem" }, host: { classAttribute: "thy-transfer-list" }, ngImport: i0, template: "<div class=\"thy-transfer-list-header\">\n <span class=\"thy-transfer-list-header-title\"\n >{{ title() }} \u00B7 {{ items()?.length }}\n @if (max()) {\n <span>{{ locale().maxLimit.replace('{max}', max()?.toString() ?? '') }}</span>\n }\n </span>\n</div>\n@if (!renderContentRef()) {\n <div class=\"thy-transfer-list-body\" cdkDropListGroup [cdkDropListGroupDisabled]=\"!draggable()\">\n @if (canLock()) {\n <div class=\"thy-transfer-list-group-name\">{{ locale().maxLockLimit.replace('{maxLock}', maxLock()?.toString() ?? '') }}</div>\n <thy-list\n class=\"thy-transfer-list-content\"\n cdkDropList\n thyDragDrop\n id=\"lock\"\n [cdkDropListData]=\"lockItems\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListEnterPredicate]=\"lockListEnterPredicate\">\n @if (lockItems.length === 0) {\n <div class=\"cdk-drop-list-empty\"></div>\n }\n @for (item of lockItems; track $index) {\n <thy-list-item\n class=\"thy-transfer-list-content-item text-truncate\"\n cdkDrag\n [cdkDragData]=\"item\"\n [ngClass]=\"{ active: item.checked }\">\n <ng-template [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </thy-list-item>\n }\n </thy-list>\n <div class=\"thy-transfer-list-group-name\">{{ locale().unlocked }}</div>\n }\n <thy-list\n class=\"thy-transfer-list-content\"\n cdkDropList\n thyDragDrop\n [cdkDropListDisabled]=\"!draggable()\"\n id=\"unlock\"\n [cdkDropListData]=\"unlockItems\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListEnterPredicate]=\"unlockListEnterPredicate\">\n @if (unlockItems.length === 0) {\n <div class=\"cdk-drop-list-empty\"></div>\n }\n @for (item of unlockItems; track $index) {\n <thy-list-item\n class=\"thy-transfer-list-content-item text-truncate\"\n cdkDrag\n [cdkDragData]=\"item\"\n [ngClass]=\"{ active: item.checked, disabled: disabled() && item.direction === 'left' }\">\n <ng-template [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </thy-list-item>\n }\n </thy-list>\n </div>\n} @else {\n <div class=\"thy-transfer-list-body\">\n <ng-container\n *ngTemplateOutlet=\"\n renderContentRef();\n context: {\n $implicit: items(),\n onSelectItem: onSelectItem,\n onUnselectItem: onUnselectItem\n }\n \"></ng-container>\n </div>\n}\n", dependencies: [{ kind: "directive", type: CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "component", type: ThyList, selector: "thy-list", inputs: ["thyDivided"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: ThyDragDropDirective, selector: "[thyDragDrop]" }, { kind: "component", type: ThyListItem, selector: "thy-list-item,[thy-list-item]" }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
131
140
|
}
|
|
132
141
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyTransferList, decorators: [{
|
|
133
142
|
type: Component,
|
|
134
|
-
args: [{ selector: 'thy-transfer-list',
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
type: Input
|
|
139
|
-
}], draggable: [{
|
|
140
|
-
type: Input
|
|
141
|
-
}], canLock: [{
|
|
142
|
-
type: Input
|
|
143
|
-
}], maxLock: [{
|
|
144
|
-
type: Input
|
|
145
|
-
}], max: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}], disabled: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}], template: [{
|
|
150
|
-
type: Input
|
|
151
|
-
}], contentRef: [{
|
|
152
|
-
type: Input,
|
|
153
|
-
args: ['renderContentRef']
|
|
154
|
-
}], draggableUpdate: [{
|
|
155
|
-
type: Output
|
|
156
|
-
}], selectItem: [{
|
|
157
|
-
type: Output
|
|
158
|
-
}], unselectItem: [{
|
|
159
|
-
type: Output
|
|
160
|
-
}], hostClass: [{
|
|
161
|
-
type: HostBinding,
|
|
162
|
-
args: ['class']
|
|
163
|
-
}] } });
|
|
143
|
+
args: [{ selector: 'thy-transfer-list', host: {
|
|
144
|
+
class: 'thy-transfer-list'
|
|
145
|
+
}, encapsulation: ViewEncapsulation.None, imports: [CdkDropListGroup, ThyList, CdkDropList, ThyDragDropDirective, ThyListItem, CdkDrag, NgClass, NgTemplateOutlet], template: "<div class=\"thy-transfer-list-header\">\n <span class=\"thy-transfer-list-header-title\"\n >{{ title() }} \u00B7 {{ items()?.length }}\n @if (max()) {\n <span>{{ locale().maxLimit.replace('{max}', max()?.toString() ?? '') }}</span>\n }\n </span>\n</div>\n@if (!renderContentRef()) {\n <div class=\"thy-transfer-list-body\" cdkDropListGroup [cdkDropListGroupDisabled]=\"!draggable()\">\n @if (canLock()) {\n <div class=\"thy-transfer-list-group-name\">{{ locale().maxLockLimit.replace('{maxLock}', maxLock()?.toString() ?? '') }}</div>\n <thy-list\n class=\"thy-transfer-list-content\"\n cdkDropList\n thyDragDrop\n id=\"lock\"\n [cdkDropListData]=\"lockItems\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListEnterPredicate]=\"lockListEnterPredicate\">\n @if (lockItems.length === 0) {\n <div class=\"cdk-drop-list-empty\"></div>\n }\n @for (item of lockItems; track $index) {\n <thy-list-item\n class=\"thy-transfer-list-content-item text-truncate\"\n cdkDrag\n [cdkDragData]=\"item\"\n [ngClass]=\"{ active: item.checked }\">\n <ng-template [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </thy-list-item>\n }\n </thy-list>\n <div class=\"thy-transfer-list-group-name\">{{ locale().unlocked }}</div>\n }\n <thy-list\n class=\"thy-transfer-list-content\"\n cdkDropList\n thyDragDrop\n [cdkDropListDisabled]=\"!draggable()\"\n id=\"unlock\"\n [cdkDropListData]=\"unlockItems\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListEnterPredicate]=\"unlockListEnterPredicate\">\n @if (unlockItems.length === 0) {\n <div class=\"cdk-drop-list-empty\"></div>\n }\n @for (item of unlockItems; track $index) {\n <thy-list-item\n class=\"thy-transfer-list-content-item text-truncate\"\n cdkDrag\n [cdkDragData]=\"item\"\n [ngClass]=\"{ active: item.checked, disabled: disabled() && item.direction === 'left' }\">\n <ng-template [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </thy-list-item>\n }\n </thy-list>\n </div>\n} @else {\n <div class=\"thy-transfer-list-body\">\n <ng-container\n *ngTemplateOutlet=\"\n renderContentRef();\n context: {\n $implicit: items(),\n onSelectItem: onSelectItem,\n onUnselectItem: onUnselectItem\n }\n \"></ng-container>\n </div>\n}\n" }]
|
|
146
|
+
}], ctorParameters: () => [] });
|
|
164
147
|
|
|
165
148
|
/**
|
|
166
149
|
* 穿梭框组件
|
|
@@ -169,54 +152,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
169
152
|
*/
|
|
170
153
|
class ThyTransfer {
|
|
171
154
|
constructor() {
|
|
172
|
-
this.hostClass = 'thy-transfer';
|
|
173
155
|
this.leftDataSource = [];
|
|
174
156
|
this.rightDataSource = [];
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
157
|
+
/**
|
|
158
|
+
* 数据源
|
|
159
|
+
* @type ThyTransferItem[]
|
|
160
|
+
*/
|
|
161
|
+
this.thyData = input([]);
|
|
162
|
+
this.thyRenderLeftTemplateRef = input();
|
|
163
|
+
this.thyRenderRightTemplateRef = input();
|
|
164
|
+
/**
|
|
165
|
+
* title集合,title[0]为左标题,title[1]为右标题
|
|
166
|
+
* @type string[]
|
|
167
|
+
*/
|
|
168
|
+
this.thyTitles = input([]);
|
|
169
|
+
/**
|
|
170
|
+
* 右侧列表是否可以锁定
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
173
|
+
this.thyRightCanLock = input(false, { transform: coerceBooleanProperty });
|
|
174
|
+
/**
|
|
175
|
+
* 右侧锁定最大数量
|
|
176
|
+
*/
|
|
177
|
+
this.thyRightLockMax = input(undefined, { transform: numberAttribute });
|
|
178
|
+
/**
|
|
179
|
+
* 右侧选择最大数量
|
|
180
|
+
*/
|
|
181
|
+
this.thyRightMax = input(undefined, { transform: numberAttribute });
|
|
182
|
+
/**
|
|
183
|
+
* 设置是否自动移动
|
|
184
|
+
* @description.en-us Currently not implemented, in order to support the selections move
|
|
185
|
+
* @default true
|
|
186
|
+
*/
|
|
187
|
+
this.thyAutoMove = input(true, { transform: coerceBooleanProperty });
|
|
188
|
+
/**
|
|
189
|
+
* 左侧列表是否拖动
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
this.thyLeftDraggable = input(false, { transform: coerceBooleanProperty });
|
|
193
|
+
/**
|
|
194
|
+
* 右侧列表是否拖动
|
|
195
|
+
* @default false
|
|
196
|
+
*/
|
|
197
|
+
this.thyRightDraggable = input(false, { transform: coerceBooleanProperty });
|
|
178
198
|
/**
|
|
179
199
|
* @type EventEmitter<ThyTransferDragEvent>
|
|
180
200
|
*/
|
|
181
|
-
this.thyDraggableUpdate =
|
|
201
|
+
this.thyDraggableUpdate = output();
|
|
182
202
|
/**
|
|
183
203
|
* Transfer变化的回调事件
|
|
184
204
|
* @type EventEmitter<ThyTransferChangeEvent>
|
|
185
205
|
*/
|
|
186
|
-
this.thyChange =
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
this.leftTitle =
|
|
203
|
-
this.rightTitle =
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
* @description.en-us Currently not implemented, in order to support the selections move
|
|
208
|
-
* @default true
|
|
209
|
-
*/
|
|
210
|
-
set thyAutoMove(value) {
|
|
211
|
-
this._autoMove = value;
|
|
206
|
+
this.thyChange = output();
|
|
207
|
+
/**
|
|
208
|
+
* 设置自定义Item渲染数据模板
|
|
209
|
+
* @type TemplateRef
|
|
210
|
+
*/
|
|
211
|
+
this.templateRef = contentChild('renderTemplate');
|
|
212
|
+
/**
|
|
213
|
+
* 设置自定义左侧内容模板
|
|
214
|
+
* @type TemplateRef
|
|
215
|
+
*/
|
|
216
|
+
this.leftContentRef = contentChild('renderLeftTemplate');
|
|
217
|
+
/**
|
|
218
|
+
* 设置自定义右侧内容模板
|
|
219
|
+
* @type TemplateRef
|
|
220
|
+
*/
|
|
221
|
+
this.rightContentRef = contentChild('renderRightTemplate');
|
|
222
|
+
this.leftTitle = computed(() => this.thyTitles()[0] || '');
|
|
223
|
+
this.rightTitle = computed(() => this.thyTitles()[1] || '');
|
|
224
|
+
effect(() => {
|
|
225
|
+
this.initializeTransferData();
|
|
226
|
+
});
|
|
212
227
|
}
|
|
213
228
|
ngOnInit() { }
|
|
214
229
|
initializeTransferData(data = []) {
|
|
215
|
-
this.allDataSource = [];
|
|
216
230
|
this.leftDataSource = [];
|
|
217
231
|
this.rightDataSource = [];
|
|
218
|
-
|
|
219
|
-
this.allDataSource.push(item);
|
|
232
|
+
this.thyData().forEach(item => {
|
|
220
233
|
if (item.direction === TransferDirection.left) {
|
|
221
234
|
this.leftDataSource.push(item);
|
|
222
235
|
}
|
|
@@ -229,12 +242,12 @@ class ThyTransfer {
|
|
|
229
242
|
if (event.item.isFixed) {
|
|
230
243
|
return;
|
|
231
244
|
}
|
|
232
|
-
if (this.thyRightMax <= this.rightDataSource.length && from === TransferDirection.left) {
|
|
245
|
+
if (this.thyRightMax() <= this.rightDataSource.length && from === TransferDirection.left) {
|
|
233
246
|
return;
|
|
234
247
|
}
|
|
235
248
|
const to = from === TransferDirection.left ? TransferDirection.right : TransferDirection.left;
|
|
236
249
|
event.item.checked = !event.item.checked;
|
|
237
|
-
if (this.
|
|
250
|
+
if (this.thyAutoMove()) {
|
|
238
251
|
this.onMove(to);
|
|
239
252
|
}
|
|
240
253
|
}
|
|
@@ -292,48 +305,14 @@ class ThyTransfer {
|
|
|
292
305
|
: [...otherListData.lock, ...otherListData.unlock];
|
|
293
306
|
}
|
|
294
307
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyTransfer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
295
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyTransfer, isStandalone: true, selector: "thy-transfer", inputs: { thyData: "thyData",
|
|
308
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyTransfer, isStandalone: true, selector: "thy-transfer", inputs: { thyData: { classPropertyName: "thyData", publicName: "thyData", isSignal: true, isRequired: false, transformFunction: null }, thyRenderLeftTemplateRef: { classPropertyName: "thyRenderLeftTemplateRef", publicName: "thyRenderLeftTemplateRef", isSignal: true, isRequired: false, transformFunction: null }, thyRenderRightTemplateRef: { classPropertyName: "thyRenderRightTemplateRef", publicName: "thyRenderRightTemplateRef", isSignal: true, isRequired: false, transformFunction: null }, thyTitles: { classPropertyName: "thyTitles", publicName: "thyTitles", isSignal: true, isRequired: false, transformFunction: null }, thyRightCanLock: { classPropertyName: "thyRightCanLock", publicName: "thyRightCanLock", isSignal: true, isRequired: false, transformFunction: null }, thyRightLockMax: { classPropertyName: "thyRightLockMax", publicName: "thyRightLockMax", isSignal: true, isRequired: false, transformFunction: null }, thyRightMax: { classPropertyName: "thyRightMax", publicName: "thyRightMax", isSignal: true, isRequired: false, transformFunction: null }, thyAutoMove: { classPropertyName: "thyAutoMove", publicName: "thyAutoMove", isSignal: true, isRequired: false, transformFunction: null }, thyLeftDraggable: { classPropertyName: "thyLeftDraggable", publicName: "thyLeftDraggable", isSignal: true, isRequired: false, transformFunction: null }, thyRightDraggable: { classPropertyName: "thyRightDraggable", publicName: "thyRightDraggable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyDraggableUpdate: "thyDraggableUpdate", thyChange: "thyChange" }, host: { classAttribute: "thy-transfer" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["renderTemplate"], descendants: true, isSignal: true }, { propertyName: "leftContentRef", first: true, predicate: ["renderLeftTemplate"], descendants: true, isSignal: true }, { propertyName: "rightContentRef", first: true, predicate: ["renderRightTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<thy-transfer-list\n [items]=\"thyData()\"\n [title]=\"leftTitle()\"\n [draggable]=\"thyLeftDraggable()\"\n [disabled]=\"thyRightMax() <= rightDataSource.length\"\n [renderContentRef]=\"leftContentRef()\"\n (draggableUpdate)=\"onDragUpdate('left', $event)\"\n [template]=\"leftTemplateRef\"\n (selectItem)=\"selectItem($event)\"\n (unselectItem)=\"unselectItem($event)\">\n <ng-template #leftTemplateRef let-item>\n <div (click)=\"onSelect(item.direction === 'left' ? 'left' : 'right', { item: item })\" class=\"list-item-content\">\n @if (thyLeftDraggable()) {\n <thy-icon thyIconName=\"drag\" class=\"drag-handle\"></thy-icon>\n }\n <div class=\"item-name\" [ngClass]=\"{ 'un-select-item': item.direction !== 'right' }\">\n <ng-template [ngTemplateOutlet]=\"thyTransferListItem\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </div>\n @if (item.direction === 'right') {\n <thy-icon class=\"text-primary item-status\" thyIconName=\"check\"></thy-icon>\n }\n </div>\n </ng-template>\n</thy-transfer-list>\n\n<div class=\"thy-transfer-operation\">\n <div class=\"thy-transfer-operation-body\">\n <thy-icon thyIconName=\"angle-right\" class=\"operation-link\"></thy-icon>\n <br />\n <thy-icon thyIconName=\"angle-left\" class=\"operation-link\"></thy-icon>\n </div>\n</div>\n\n<thy-transfer-list\n [items]=\"rightDataSource\"\n [title]=\"rightTitle()\"\n [draggable]=\"thyRightDraggable()\"\n (draggableUpdate)=\"onDragUpdate('right', $event)\"\n [canLock]=\"thyRightCanLock()\"\n [maxLock]=\"thyRightLockMax()\"\n [max]=\"thyRightMax()\"\n [template]=\"rightTemplateRef\"\n [renderContentRef]=\"rightContentRef()\"\n (selectItem)=\"selectItem($event)\"\n (unselectItem)=\"unselectItem($event)\">\n <ng-template #rightTemplateRef let-item>\n @if (thyRightDraggable()) {\n <thy-icon thyIconName=\"drag\" class=\"drag-handle\"></thy-icon>\n }\n <div class=\"item-name\">\n <ng-template [ngTemplateOutlet]=\"thyTransferListItem\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </div>\n @if (item.direction === 'right' && !item.isFixed) {\n <a class=\"link-secondary\" (click)=\"onSelect('right', { item: item })\">\n <thy-icon class=\"item-status\" thyIconName=\"close\"></thy-icon>\n </a>\n }\n </ng-template>\n</thy-transfer-list>\n\n<ng-template #thyTransferListItem let-item>\n @if (templateRef()) {\n <ng-template [ngTemplateOutlet]=\"templateRef()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (!templateRef()) {\n <thy-flexible-text [thyTooltipContent]=\"item.title\">\n {{ item.title }}\n </thy-flexible-text>\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: ThyTransferList, selector: "thy-transfer-list", inputs: ["title", "items", "draggable", "canLock", "maxLock", "max", "disabled", "template", "renderContentRef"], outputs: ["draggableUpdate", "selectItem", "unselectItem"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyFlexibleText, selector: "thy-flexible-text,[thyFlexibleText]", inputs: ["thyTooltipTrigger", "thyContainerClass", "thyTooltipContent", "thyTooltipPlacement", "thyTooltipOffset"], exportAs: ["thyFlexibleText"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
296
309
|
}
|
|
297
310
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyTransfer, decorators: [{
|
|
298
311
|
type: Component,
|
|
299
|
-
args: [{ selector: 'thy-transfer',
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}], thyData: [{
|
|
304
|
-
type: Input
|
|
305
|
-
}], thyrenderLeftTemplateRef: [{
|
|
306
|
-
type: Input
|
|
307
|
-
}], thyrenderRightTemplateRef: [{
|
|
308
|
-
type: Input
|
|
309
|
-
}], thyTitles: [{
|
|
310
|
-
type: Input
|
|
311
|
-
}], thyRightCanLock: [{
|
|
312
|
-
type: Input
|
|
313
|
-
}], thyRightLockMax: [{
|
|
314
|
-
type: Input
|
|
315
|
-
}], thyRightMax: [{
|
|
316
|
-
type: Input
|
|
317
|
-
}], thyAutoMove: [{
|
|
318
|
-
type: Input
|
|
319
|
-
}], thyLeftDraggable: [{
|
|
320
|
-
type: Input
|
|
321
|
-
}], thyRightDraggable: [{
|
|
322
|
-
type: Input
|
|
323
|
-
}], thyDraggableUpdate: [{
|
|
324
|
-
type: Output
|
|
325
|
-
}], thyChange: [{
|
|
326
|
-
type: Output
|
|
327
|
-
}], templateRef: [{
|
|
328
|
-
type: ContentChild,
|
|
329
|
-
args: ['renderTemplate']
|
|
330
|
-
}], leftContentRef: [{
|
|
331
|
-
type: ContentChild,
|
|
332
|
-
args: ['renderLeftTemplate']
|
|
333
|
-
}], rightContentRef: [{
|
|
334
|
-
type: ContentChild,
|
|
335
|
-
args: ['renderRightTemplate']
|
|
336
|
-
}] } });
|
|
312
|
+
args: [{ selector: 'thy-transfer', host: {
|
|
313
|
+
class: 'thy-transfer'
|
|
314
|
+
}, encapsulation: ViewEncapsulation.None, imports: [ThyTransferList, ThyIcon, NgClass, NgTemplateOutlet, ThyFlexibleText], template: "<thy-transfer-list\n [items]=\"thyData()\"\n [title]=\"leftTitle()\"\n [draggable]=\"thyLeftDraggable()\"\n [disabled]=\"thyRightMax() <= rightDataSource.length\"\n [renderContentRef]=\"leftContentRef()\"\n (draggableUpdate)=\"onDragUpdate('left', $event)\"\n [template]=\"leftTemplateRef\"\n (selectItem)=\"selectItem($event)\"\n (unselectItem)=\"unselectItem($event)\">\n <ng-template #leftTemplateRef let-item>\n <div (click)=\"onSelect(item.direction === 'left' ? 'left' : 'right', { item: item })\" class=\"list-item-content\">\n @if (thyLeftDraggable()) {\n <thy-icon thyIconName=\"drag\" class=\"drag-handle\"></thy-icon>\n }\n <div class=\"item-name\" [ngClass]=\"{ 'un-select-item': item.direction !== 'right' }\">\n <ng-template [ngTemplateOutlet]=\"thyTransferListItem\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </div>\n @if (item.direction === 'right') {\n <thy-icon class=\"text-primary item-status\" thyIconName=\"check\"></thy-icon>\n }\n </div>\n </ng-template>\n</thy-transfer-list>\n\n<div class=\"thy-transfer-operation\">\n <div class=\"thy-transfer-operation-body\">\n <thy-icon thyIconName=\"angle-right\" class=\"operation-link\"></thy-icon>\n <br />\n <thy-icon thyIconName=\"angle-left\" class=\"operation-link\"></thy-icon>\n </div>\n</div>\n\n<thy-transfer-list\n [items]=\"rightDataSource\"\n [title]=\"rightTitle()\"\n [draggable]=\"thyRightDraggable()\"\n (draggableUpdate)=\"onDragUpdate('right', $event)\"\n [canLock]=\"thyRightCanLock()\"\n [maxLock]=\"thyRightLockMax()\"\n [max]=\"thyRightMax()\"\n [template]=\"rightTemplateRef\"\n [renderContentRef]=\"rightContentRef()\"\n (selectItem)=\"selectItem($event)\"\n (unselectItem)=\"unselectItem($event)\">\n <ng-template #rightTemplateRef let-item>\n @if (thyRightDraggable()) {\n <thy-icon thyIconName=\"drag\" class=\"drag-handle\"></thy-icon>\n }\n <div class=\"item-name\">\n <ng-template [ngTemplateOutlet]=\"thyTransferListItem\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </div>\n @if (item.direction === 'right' && !item.isFixed) {\n <a class=\"link-secondary\" (click)=\"onSelect('right', { item: item })\">\n <thy-icon class=\"item-status\" thyIconName=\"close\"></thy-icon>\n </a>\n }\n </ng-template>\n</thy-transfer-list>\n\n<ng-template #thyTransferListItem let-item>\n @if (templateRef()) {\n <ng-template [ngTemplateOutlet]=\"templateRef()\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n }\n @if (!templateRef()) {\n <thy-flexible-text [thyTooltipContent]=\"item.title\">\n {{ item.title }}\n </thy-flexible-text>\n }\n</ng-template>\n" }]
|
|
315
|
+
}], ctorParameters: () => [] });
|
|
337
316
|
|
|
338
317
|
class ThyTransferModule {
|
|
339
318
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyTransferModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|