@ng-nest/ui 15.0.3 → 15.0.5
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/core/config/config.d.ts +2 -0
- package/dropdown/dropdown-portal.component.d.ts +4 -0
- package/esm2020/core/config/config.mjs +1 -1
- package/esm2020/dropdown/dropdown-portal.component.mjs +16 -4
- package/esm2020/input/input.component.mjs +2 -2
- package/esm2020/pagination/pagination.component.mjs +33 -4
- package/esm2020/pagination/pagination.property.mjs +15 -3
- package/esm2020/select/select.component.mjs +15 -3
- package/esm2020/select/select.property.mjs +4 -2
- package/esm2020/table/table-body.component.mjs +6 -6
- package/esm2020/table/table-head.component.mjs +46 -7
- package/esm2020/table/table.component.mjs +16 -5
- package/esm2020/table/table.module.mjs +5 -1
- package/esm2020/table/table.property.mjs +23 -2
- package/esm2020/transfer/transfer.component.mjs +130 -20
- package/esm2020/transfer/transfer.module.mjs +12 -4
- package/esm2020/transfer/transfer.property.mjs +11 -2
- package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-date-picker.mjs +1 -0
- package/fesm2015/ng-nest-ui-dropdown.mjs +15 -3
- package/fesm2015/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-input.mjs +2 -2
- package/fesm2015/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-pagination.mjs +46 -5
- package/fesm2015/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-select.mjs +17 -3
- package/fesm2015/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-table.mjs +89 -16
- package/fesm2015/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-transfer.mjs +154 -26
- package/fesm2015/ng-nest-ui-transfer.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-date-picker.mjs +1 -0
- package/fesm2020/ng-nest-ui-dropdown.mjs +15 -3
- package/fesm2020/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-input.mjs +2 -2
- package/fesm2020/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-pagination.mjs +46 -5
- package/fesm2020/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-select.mjs +17 -3
- package/fesm2020/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-table.mjs +89 -16
- package/fesm2020/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-transfer.mjs +151 -24
- package/fesm2020/ng-nest-ui-transfer.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +3 -1
- package/pagination/pagination.property.d.ts +13 -3
- package/select/select.component.d.ts +4 -1
- package/select/select.property.d.ts +9 -4
- package/table/table-head.component.d.ts +9 -1
- package/table/table.component.d.ts +4 -2
- package/table/table.module.d.ts +4 -3
- package/table/table.property.d.ts +26 -1
- package/transfer/transfer.component.d.ts +12 -2
- package/transfer/transfer.module.d.ts +3 -1
- package/transfer/transfer.property.d.ts +29 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
2
|
+
import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
4
|
import * as i1 from '@ng-nest/ui/core';
|
|
5
|
-
import { XDataConvert, XWithConfig, XInputBoolean, XIsArray, XIsObjectArray, XIsEmpty, XIsChange, XRemove, XSetData, XIsFunction, XIsObject, XIsBoolean } from '@ng-nest/ui/core';
|
|
5
|
+
import { XDataConvert, XWithConfig, XInputBoolean, XIsArray, XIsObjectArray, XIsEmpty, XIsChange, XIsUndefined, XRemove, XSetData, XIsFunction, XIsObject, XIsBoolean } from '@ng-nest/ui/core';
|
|
6
6
|
import { XControlValueAccessor, XValueAccessor, XBaseFormModule } from '@ng-nest/ui/base-form';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
|
-
import { map, takeUntil } from 'rxjs/operators';
|
|
8
|
+
import { map, takeUntil, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
9
9
|
import * as i5 from '@angular/cdk/drag-drop';
|
|
10
10
|
import { transferArrayItem, moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
11
|
import * as i2 from '@ng-nest/ui/i18n';
|
|
@@ -19,11 +19,16 @@ import * as i7 from '@ng-nest/ui/checkbox';
|
|
|
19
19
|
import { XCheckboxModule } from '@ng-nest/ui/checkbox';
|
|
20
20
|
import * as i8 from '@ng-nest/ui/button';
|
|
21
21
|
import { XButtonModule } from '@ng-nest/ui/button';
|
|
22
|
-
import * as i9 from '@ng-nest/ui/
|
|
22
|
+
import * as i9 from '@ng-nest/ui/input';
|
|
23
|
+
import { XInputModule } from '@ng-nest/ui/input';
|
|
24
|
+
import * as i10 from '@ng-nest/ui/tree';
|
|
23
25
|
import { XTreeModule } from '@ng-nest/ui/tree';
|
|
24
|
-
import * as
|
|
26
|
+
import * as i11 from '@ng-nest/ui/table';
|
|
25
27
|
import { XTableModule } from '@ng-nest/ui/table';
|
|
26
|
-
import
|
|
28
|
+
import * as i12 from '@ng-nest/ui/keyword';
|
|
29
|
+
import { XKeywordModule } from '@ng-nest/ui/keyword';
|
|
30
|
+
import * as i13 from '@ng-nest/ui/link';
|
|
31
|
+
import { XLinkModule } from '@ng-nest/ui/link';
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Transfer
|
|
@@ -56,7 +61,7 @@ class XTransferProperty extends XControlValueAccessor {
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
/** @nocollapse */ XTransferProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
-
/** @nocollapse */ XTransferProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTransferProperty, selector: "ng-component", inputs: { data: "data", type: "type", titles: "titles", listStyle: "listStyle", hiddenCheckAll: "hiddenCheckAll", drag: "drag", search: "search", nodeTpl: "nodeTpl", titleTpl: "titleTpl", tableColumns: "tableColumns", tableIndex: "tableIndex", tableSize: "tableSize", tableQuery: "tableQuery", tableTotal: "tableTotal" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
64
|
+
/** @nocollapse */ XTransferProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTransferProperty, selector: "ng-component", inputs: { data: "data", type: "type", titles: "titles", listStyle: "listStyle", hiddenCheckAll: "hiddenCheckAll", drag: "drag", search: "search", tableHeadSearchTpl: "tableHeadSearchTpl", nodeTpl: "nodeTpl", titleTpl: "titleTpl", footerTpl: "footerTpl", tableColumns: "tableColumns", tableIndex: "tableIndex", tableSize: "tableSize", tableQuery: "tableQuery", tableTotal: "tableTotal", inverse: "inverse" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
60
65
|
__decorate([
|
|
61
66
|
XDataConvert()
|
|
62
67
|
], XTransferProperty.prototype, "data", void 0);
|
|
@@ -82,6 +87,9 @@ __decorate([
|
|
|
82
87
|
__decorate([
|
|
83
88
|
XWithConfig(X_CONFIG_NAME, 10)
|
|
84
89
|
], XTransferProperty.prototype, "tableSize", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
XInputBoolean()
|
|
92
|
+
], XTransferProperty.prototype, "inverse", void 0);
|
|
85
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferProperty, decorators: [{
|
|
86
94
|
type: Component,
|
|
87
95
|
args: [{ template: '' }]
|
|
@@ -99,10 +107,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
99
107
|
type: Input
|
|
100
108
|
}], search: [{
|
|
101
109
|
type: Input
|
|
110
|
+
}], tableHeadSearchTpl: [{
|
|
111
|
+
type: Input
|
|
102
112
|
}], nodeTpl: [{
|
|
103
113
|
type: Input
|
|
104
114
|
}], titleTpl: [{
|
|
105
115
|
type: Input
|
|
116
|
+
}], footerTpl: [{
|
|
117
|
+
type: Input
|
|
106
118
|
}], tableColumns: [{
|
|
107
119
|
type: Input
|
|
108
120
|
}], tableIndex: [{
|
|
@@ -113,6 +125,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
113
125
|
type: Input
|
|
114
126
|
}], tableTotal: [{
|
|
115
127
|
type: Input
|
|
128
|
+
}], inverse: [{
|
|
129
|
+
type: Input
|
|
116
130
|
}] } });
|
|
117
131
|
|
|
118
132
|
class XTransferComponent extends XTransferProperty {
|
|
@@ -139,6 +153,9 @@ class XTransferComponent extends XTransferProperty {
|
|
|
139
153
|
disabledButton: true
|
|
140
154
|
};
|
|
141
155
|
this.searchInput = '';
|
|
156
|
+
this.searchInputLeftChange = new Subject();
|
|
157
|
+
this.searchInputRightChange = new Subject();
|
|
158
|
+
this.searchDebounceTime = 200;
|
|
142
159
|
this.locale = {};
|
|
143
160
|
this._unSubject = new Subject();
|
|
144
161
|
this.treeActivatedId = [];
|
|
@@ -176,6 +193,8 @@ class XTransferComponent extends XTransferProperty {
|
|
|
176
193
|
this.setListStyle();
|
|
177
194
|
this.setHiddenCheckAll();
|
|
178
195
|
this.getTableCheckColumn();
|
|
196
|
+
this.setFooterTpl();
|
|
197
|
+
this.setTableHeadSearchTpl();
|
|
179
198
|
this.i18n.localeChange
|
|
180
199
|
.pipe(map((x) => x.transfer), takeUntil(this._unSubject))
|
|
181
200
|
.subscribe((x) => {
|
|
@@ -183,6 +202,16 @@ class XTransferComponent extends XTransferProperty {
|
|
|
183
202
|
XIsEmpty(this.titles) && this.setTitles();
|
|
184
203
|
this.cdr.markForCheck();
|
|
185
204
|
});
|
|
205
|
+
this.searchInputLeftChange
|
|
206
|
+
.pipe(debounceTime(this.searchDebounceTime), distinctUntilChanged(), takeUntil(this._unSubject))
|
|
207
|
+
.subscribe(() => {
|
|
208
|
+
this.setSearchInputChange(this.left);
|
|
209
|
+
});
|
|
210
|
+
this.searchInputRightChange
|
|
211
|
+
.pipe(debounceTime(this.searchDebounceTime), distinctUntilChanged(), takeUntil(this._unSubject))
|
|
212
|
+
.subscribe(() => {
|
|
213
|
+
this.setSearchInputChange(this.right);
|
|
214
|
+
});
|
|
186
215
|
}
|
|
187
216
|
ngOnChanges(changes) {
|
|
188
217
|
const { data } = changes;
|
|
@@ -192,9 +221,54 @@ class XTransferComponent extends XTransferProperty {
|
|
|
192
221
|
this._unSubject.next();
|
|
193
222
|
this._unSubject.unsubscribe();
|
|
194
223
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
224
|
+
onSearchInputChange(source) {
|
|
225
|
+
if (source.direction === 'left') {
|
|
226
|
+
this.searchInputLeftChange.next(source.searchInput);
|
|
227
|
+
}
|
|
228
|
+
else if (source.direction === 'right') {
|
|
229
|
+
this.searchInputRightChange.next(source.searchInput);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
setSearchInputChange(source) {
|
|
233
|
+
var _a, _b, _c;
|
|
234
|
+
if (XIsUndefined(source.searchInput))
|
|
235
|
+
return;
|
|
236
|
+
if (XIsEmpty(source.searchInput)) {
|
|
237
|
+
source.list = [...source.searchList];
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
switch (this.type) {
|
|
241
|
+
case 'list':
|
|
242
|
+
source.list = (_a = source.searchList) === null || _a === void 0 ? void 0 : _a.filter((x) => x.label.indexOf(source.searchInput) >= 0);
|
|
243
|
+
break;
|
|
244
|
+
case 'tree':
|
|
245
|
+
if (source.direction === 'right') {
|
|
246
|
+
source.list = (_b = source.searchList) === null || _b === void 0 ? void 0 : _b.filter((x) => x.label.indexOf(source.searchInput) >= 0);
|
|
247
|
+
}
|
|
248
|
+
else if (source.direction === 'left') {
|
|
249
|
+
let searchList = (_c = source.searchList) === null || _c === void 0 ? void 0 : _c.filter((x) => x.label.indexOf(source.searchInput) >= 0);
|
|
250
|
+
let parents = [];
|
|
251
|
+
const findParent = (item) => {
|
|
252
|
+
var _a;
|
|
253
|
+
if (!item.pid)
|
|
254
|
+
return;
|
|
255
|
+
let parent = (_a = source.searchList) === null || _a === void 0 ? void 0 : _a.find((x) => x.id === item.pid);
|
|
256
|
+
if (parent && !parents.some((x) => x.id === parent.id)) {
|
|
257
|
+
parents.push(parent);
|
|
258
|
+
findParent(parent);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
for (let item of searchList) {
|
|
262
|
+
findParent(item);
|
|
263
|
+
}
|
|
264
|
+
source.list = [...searchList, ...parents];
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case 'table':
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
this.setListCount(this.type, source);
|
|
198
272
|
this.cdr.detectChanges();
|
|
199
273
|
}
|
|
200
274
|
checkedAllChange($event, source) {
|
|
@@ -239,10 +313,14 @@ class XTransferComponent extends XTransferProperty {
|
|
|
239
313
|
let checkedItems = (_a = from.list) === null || _a === void 0 ? void 0 : _a.filter((x) => !x.disabled && x.checked);
|
|
240
314
|
let j = 0;
|
|
241
315
|
checkedItems.forEach((x) => {
|
|
242
|
-
var _a;
|
|
243
|
-
|
|
316
|
+
var _a, _b;
|
|
317
|
+
let index = (_a = from.list) === null || _a === void 0 ? void 0 : _a.indexOf(x);
|
|
244
318
|
x.checked = false;
|
|
245
319
|
transferArrayItem(from.list, to.list, index, j);
|
|
320
|
+
if (this.search) {
|
|
321
|
+
index = (_b = from.searchList) === null || _b === void 0 ? void 0 : _b.indexOf(x);
|
|
322
|
+
transferArrayItem(from.searchList, to.searchList, index, j);
|
|
323
|
+
}
|
|
246
324
|
j++;
|
|
247
325
|
});
|
|
248
326
|
from.list = [...from.list];
|
|
@@ -275,6 +353,9 @@ class XTransferComponent extends XTransferProperty {
|
|
|
275
353
|
}
|
|
276
354
|
else {
|
|
277
355
|
checkedItems = XRemove(from.list, (x) => !x.disabled && x.checked);
|
|
356
|
+
if (this.search) {
|
|
357
|
+
XRemove(from.searchList, (x) => !x.disabled && x.checked);
|
|
358
|
+
}
|
|
278
359
|
for (let item of checkedItems) {
|
|
279
360
|
let node = (_c = to.list) === null || _c === void 0 ? void 0 : _c.find((x) => x.id === item.id);
|
|
280
361
|
if (node) {
|
|
@@ -402,6 +483,21 @@ class XTransferComponent extends XTransferProperty {
|
|
|
402
483
|
this.setCheckedCount('table', source);
|
|
403
484
|
this.setButtonDisabled(source);
|
|
404
485
|
}
|
|
486
|
+
onInverse(source) {
|
|
487
|
+
for (let item of source.list) {
|
|
488
|
+
if (!item.disabled) {
|
|
489
|
+
item.checked = !item.checked;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
let type = `${this.type}`;
|
|
493
|
+
if (type === 'tree' && source.direction === 'right') {
|
|
494
|
+
type = 'list';
|
|
495
|
+
}
|
|
496
|
+
this.setCheckedCount(type, source);
|
|
497
|
+
this.setCheckedAll(source);
|
|
498
|
+
this.setButtonDisabled(source);
|
|
499
|
+
this.cdr.detectChanges();
|
|
500
|
+
}
|
|
405
501
|
getTableCheckColumn() {
|
|
406
502
|
var _a;
|
|
407
503
|
if (this.type !== 'table' || XIsEmpty(this.tableColumns))
|
|
@@ -451,14 +547,14 @@ class XTransferComponent extends XTransferProperty {
|
|
|
451
547
|
}
|
|
452
548
|
this.onChange(this.value);
|
|
453
549
|
}
|
|
454
|
-
setSearchList(...
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
550
|
+
setSearchList(...sources) {
|
|
551
|
+
if (this.search) {
|
|
552
|
+
for (let source of sources) {
|
|
553
|
+
if (XIsEmpty(source.searchInput)) {
|
|
554
|
+
source.searchList = [...source.list];
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
462
558
|
}
|
|
463
559
|
setData() {
|
|
464
560
|
if (this.type === 'table') {
|
|
@@ -593,13 +689,39 @@ class XTransferComponent extends XTransferProperty {
|
|
|
593
689
|
this.right.hiddenCheckAll = this.hiddenCheckAll[1];
|
|
594
690
|
this.cdr.detectChanges();
|
|
595
691
|
}
|
|
692
|
+
setFooterTpl() {
|
|
693
|
+
if (XIsUndefined(this.footerTpl))
|
|
694
|
+
return;
|
|
695
|
+
if (this.footerTpl.length > 0) {
|
|
696
|
+
this.left.footerTpl = this.footerTpl[0];
|
|
697
|
+
}
|
|
698
|
+
if (this.footerTpl.length > 1) {
|
|
699
|
+
this.right.footerTpl = this.footerTpl[1];
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
setTableHeadSearchTpl() {
|
|
703
|
+
if (XIsUndefined(this.tableHeadSearchTpl))
|
|
704
|
+
return;
|
|
705
|
+
if (this.tableHeadSearchTpl.length > 0) {
|
|
706
|
+
this.left.tableHeadSearchTpl = this.tableHeadSearchTpl[0];
|
|
707
|
+
}
|
|
708
|
+
if (this.tableHeadSearchTpl.length > 1) {
|
|
709
|
+
this.right.tableHeadSearchTpl = this.tableHeadSearchTpl[1];
|
|
710
|
+
}
|
|
711
|
+
}
|
|
596
712
|
}
|
|
597
713
|
/** @nocollapse */ XTransferComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.XConfigService }, { token: i2.XI18nService }], target: i0.ɵɵFactoryTarget.Component });
|
|
598
|
-
/** @nocollapse */ XTransferComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTransferComponent, selector: "x-transfer", providers: [XValueAccessor(XTransferComponent)], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #transfer class=\"x-transfer\" cdkDropListGroup [ngClass]=\"classMap\">\r\n <div class=\"x-transfer-box\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: left }\"></ng-container>\r\n <div [ngStyle]=\"left.listStyle!\" class=\"x-transfer-list\">\r\n <ng-container [ngSwitch]=\"type\">\r\n <ul\r\n *ngSwitchCase=\"'list'\"\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"left.list\"\r\n [cdkDropListDisabled]=\"!drag && type === 'list'\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of left.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: left }\"></ng-container>\r\n </li>\r\n </ul>\r\n <x-tree\r\n *ngSwitchCase=\"'tree'\"\r\n [data]=\"left.list!\"\r\n multiple\r\n allowManyActivated\r\n [(activatedId)]=\"treeActivatedId\"\r\n (nodeClick)=\"onTreeNodeClick($event)\"\r\n ></x-tree>\r\n <x-table\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns!\"\r\n [(size)]=\"tableSize\"\r\n [(index)]=\"tableIndex\"\r\n (indexChange)=\"getTableData()\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, left)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, left)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n ></x-table>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"x-transfer-buttons\">\r\n <x-button type=\"primary\" icon=\"fto-chevron-right\" [disabled]=\"left.disabledButton\" (click)=\"move(left, right)\"></x-button>\r\n <x-button type=\"primary\" icon=\"fto-chevron-left\" [disabled]=\"right.disabledButton\" (click)=\"move(right, left)\"></x-button>\r\n </div>\r\n <div class=\"x-transfer-box\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: right }\"></ng-container>\r\n <div [ngSwitch]=\"type\" [ngStyle]=\"right.listStyle!\" class=\"x-transfer-list\">\r\n <x-table\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"right.list!\"\r\n [columns]=\"tableColumns!\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, right)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, right)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showPagination=\"false\"\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n ></x-table>\r\n <ul\r\n *ngSwitchDefault\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"right.list\"\r\n [cdkDropListDisabled]=\"!drag || (drag && type !== 'list')\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of right.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: right }\"></ng-container>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #sourceTitleTpl let-source=\"source\">\r\n <div class=\"x-transfer-title\">\r\n <x-checkbox\r\n *ngIf=\"source.title && !source.hiddenCheckAll\"\r\n [data]=\"[titleTpl ? '' : source.title]\"\r\n [(ngModel)]=\"source.checkedAll\"\r\n (ngModelChange)=\"checkedAllChange($event, source)\"\r\n [indeterminate]=\"source.indeterminate\"\r\n ></x-checkbox>\r\n <span *ngIf=\"source.title && source.hiddenCheckAll\">{{ source.title }}</span>\r\n <ng-container *xOutlet=\"titleTpl; context: { $title: source.title, $checkedCount: source.checkedCount, $count: source.count }\"\r\n ><span class=\"x-transfer-total\">{{ source.checkedCount }} / {{ source.count }}</span></ng-container\r\n >\r\n </div>\r\n <!-- <div class=\"x-transfer-search\" *ngIf=\"search\">\r\n <x-input\r\n icon=\"fto-search\"\r\n [(ngModel)]=\"source.searchInput\"\r\n (ngModelChange)=\"searchInputChange(source)\"\r\n clearable\r\n ></x-input>\r\n </div> -->\r\n</ng-template>\r\n\r\n<ng-template #sourceNodeTpl let-node=\"node\" let-source=\"source\">\r\n <x-checkbox\r\n [data]=\"[{ id: node.id, label: nodeTpl ? nodeTpl : node.label, node: node }]\"\r\n [disabled]=\"node.disabled\"\r\n [(ngModel)]=\"node.checked\"\r\n (ngModelChange)=\"checkedChange($event, source)\"\r\n ></x-checkbox>\r\n</ng-template>\r\n", styles: [".x-transfer{margin:0;padding:0;display:inline-flex;align-items:center}.x-transfer-title{padding:.25rem .5625rem;display:flex;align-items:center;justify-content:space-between;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-top-left-radius:var(--x-border-radius);border-top-right-radius:var(--x-border-radius);border-bottom:none;background-color:var(--x-background);color:var(--x-text-300)}.x-transfer-total{margin-left:.325rem}.x-transfer-list{display:flex;flex-direction:column;height:18rem;width:12rem;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-bottom-left-radius:var(--x-border-radius);border-bottom-right-radius:var(--x-border-radius);overflow:auto}.x-transfer-item{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;transition:border-color var(--x-animation-duration-base),background-color var(--x-animation-duration-base),color var(--x-animation-duration-base)}.x-transfer-droplist{height:100%;padding:.25rem}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:hover{background-color:transparent}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item.cdk-drag-placeholder{border-color:var(--x-primary);color:var(--x-primary);background-color:var(--x-background);opacity:.8}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:not(.cdk-drag-placeholder){transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}.x-transfer-buttons{margin:0 1rem;display:flex;flex-direction:column}.x-transfer-buttons>x-button:not(:first-child){margin-top:.5rem}.x-transfer-search{padding:.5rem;border-bottom:.0625rem solid var(--x-border)}body>li.x-transfer-item.cdk-drag-preview{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;border-color:var(--x-border);color:var(--x-text-400);background-color:var(--x-background-a100);opacity:.9}body>li.x-transfer-item.cdk-drag-animating{transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i5.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "directive", type: i5.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: i7.XCheckboxComponent, selector: "x-checkbox" }, { kind: "component", type: i8.XButtonComponent, selector: "x-button" }, { kind: "component", type: i9.XTreeComponent, selector: "x-tree" }, { kind: "component", type: i10.XTableComponent, selector: "x-table" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
714
|
+
/** @nocollapse */ XTransferComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTransferComponent, selector: "x-transfer", providers: [XValueAccessor(XTransferComponent)], viewQueries: [{ propertyName: "leftTableCom", first: true, predicate: ["leftTableCom"], descendants: true }, { propertyName: "rightTableCom", first: true, predicate: ["rightTableCom"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #transfer class=\"x-transfer\" cdkDropListGroup [ngClass]=\"classMap\">\r\n <div class=\"x-transfer-box\" [class.x-transfer-has-footer]=\"left.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: left }\"></ng-container>\r\n <div [ngStyle]=\"left.listStyle!\" class=\"x-transfer-list\">\r\n <ng-container [ngSwitch]=\"type\">\r\n <ul\r\n *ngSwitchCase=\"'list'\"\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"left.list\"\r\n [cdkDropListDisabled]=\"!drag && type === 'list'\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of left.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: left }\"></ng-container>\r\n </li>\r\n </ul>\r\n <x-tree\r\n *ngSwitchCase=\"'tree'\"\r\n [data]=\"left.list!\"\r\n multiple\r\n allowManyActivated\r\n [(activatedId)]=\"treeActivatedId\"\r\n (nodeClick)=\"onTreeNodeClick($event)\"\r\n [labelTpl]=\"treeLabelTpl\"\r\n ></x-tree>\r\n <ng-template #treeLabelTpl let-node=\"$node\">\r\n <span class=\"x-transfer-tree-label\" x-keyword [text]=\"left.searchInput!\">{{ node.label }}</span>\r\n </ng-template>\r\n <x-table\r\n #leftTableCom\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns!\"\r\n [(size)]=\"tableSize\"\r\n [(index)]=\"tableIndex\"\r\n (indexChange)=\"getTableData()\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, left)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, left)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n [headSearchTpl]=\"left.tableHeadSearchTpl\"\r\n ></x-table>\r\n </ng-container>\r\n </div>\r\n <div class=\"x-transfer-footer\" *ngIf=\"left.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"left.footerTpl; context: { $source: left }\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"x-transfer-buttons\">\r\n <x-button type=\"primary\" icon=\"fto-chevron-right\" [disabled]=\"left.disabledButton\" (click)=\"move(left, right)\"></x-button>\r\n <x-button type=\"primary\" icon=\"fto-chevron-left\" [disabled]=\"right.disabledButton\" (click)=\"move(right, left)\"></x-button>\r\n </div>\r\n <div class=\"x-transfer-box\" [class.x-transfer-has-footer]=\"right.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: right }\"></ng-container>\r\n <div [ngSwitch]=\"type\" [ngStyle]=\"right.listStyle!\" class=\"x-transfer-list\">\r\n <x-table\r\n #rightTableCom\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"right.list!\"\r\n [columns]=\"tableColumns!\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, right)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, right)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showPagination=\"false\"\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n [headSearchTpl]=\"right.tableHeadSearchTpl\"\r\n ></x-table>\r\n <ul\r\n *ngSwitchDefault\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"right.list\"\r\n [cdkDropListDisabled]=\"!drag || (drag && type !== 'list')\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of right.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: right }\"></ng-container>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"x-transfer-footer\" *ngIf=\"right.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"right.footerTpl; context: { $source: right }\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #sourceTitleTpl let-source=\"source\">\r\n <div class=\"x-transfer-title\">\r\n <div class=\"x-transfer-title-left\">\r\n <x-checkbox\r\n *ngIf=\"source.title && !source.hiddenCheckAll\"\r\n [data]=\"[titleTpl ? '' : source.title]\"\r\n [(ngModel)]=\"source.checkedAll\"\r\n (ngModelChange)=\"checkedAllChange($event, source)\"\r\n [indeterminate]=\"source.indeterminate\"\r\n ></x-checkbox>\r\n <span *ngIf=\"source.title && source.hiddenCheckAll\">{{ source.title }}</span>\r\n <x-link *ngIf=\"inverse && type === 'list'\" class=\"x-transfer-inverse\" type=\"primary\" (click)=\"onInverse(source)\">\u53CD\u9009</x-link>\r\n </div>\r\n <ng-container *xOutlet=\"titleTpl; context: { $title: source.title, $checkedCount: source.checkedCount, $count: source.count }\"\r\n ><span class=\"x-transfer-total\">{{ source.checkedCount }} / {{ source.count }}</span></ng-container\r\n >\r\n </div>\r\n <div class=\"x-transfer-search\" *ngIf=\"search && type !== 'table'\">\r\n <x-input icon=\"fto-search\" [(ngModel)]=\"source.searchInput\" (ngModelChange)=\"onSearchInputChange(source)\" clearable></x-input>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #sourceNodeTpl let-node=\"node\" let-source=\"source\">\r\n <x-checkbox\r\n [data]=\"[{ id: node.id, label: nodeTpl ? nodeTpl : labelTpl, node: node }]\"\r\n [disabled]=\"node.disabled\"\r\n [(ngModel)]=\"node.checked\"\r\n (ngModelChange)=\"checkedChange($event, source)\"\r\n ></x-checkbox>\r\n <ng-template #labelTpl>\r\n <span x-keyword [text]=\"source.searchInput!\">{{ node.label }}</span>\r\n </ng-template>\r\n</ng-template>\r\n", styles: [".x-transfer{margin:0;padding:0;display:inline-flex;align-items:center}.x-transfer-title{padding:.25rem .5625rem;display:flex;align-items:center;justify-content:space-between;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-top-left-radius:var(--x-border-radius);border-top-right-radius:var(--x-border-radius);background-color:var(--x-background);color:var(--x-text-300)}.x-transfer-title-left{display:inline-flex;align-items:center}.x-transfer-inverse{margin:0 .5rem}.x-transfer-total{margin-left:.325rem}.x-transfer-box{min-width:12rem}.x-transfer-list{display:flex;flex-direction:column;height:18rem;width:100%;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-top:none;border-bottom-left-radius:var(--x-border-radius);border-bottom-right-radius:var(--x-border-radius);overflow:auto}.x-transfer-item{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;transition:border-color var(--x-animation-duration-base),background-color var(--x-animation-duration-base),color var(--x-animation-duration-base)}.x-transfer-droplist{height:100%;padding:.25rem}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:hover{background-color:transparent}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item.cdk-drag-placeholder{border-color:var(--x-primary);color:var(--x-primary);background-color:var(--x-background);opacity:.8}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:not(.cdk-drag-placeholder){transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}.x-transfer-buttons{margin:0 1rem;display:flex;flex-direction:column}.x-transfer-buttons>x-button:not(:first-child){margin-top:.5rem}.x-transfer-search{padding:.5rem;border-left:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-transfer-search x-input{width:100%}.x-transfer-tree-label{flex:1}.x-transfer-footer{padding:.25rem .5625rem;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-bottom-left-radius:var(--x-border-radius);border-bottom-right-radius:var(--x-border-radius)}.x-transfer-has-footer .x-transfer-list{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none}body>li.x-transfer-item.cdk-drag-preview{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;border-color:var(--x-border);color:var(--x-text-400);background-color:var(--x-background-a100);opacity:.9}body>li.x-transfer-item.cdk-drag-animating{transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i5.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "directive", type: i5.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: i7.XCheckboxComponent, selector: "x-checkbox" }, { kind: "component", type: i8.XButtonComponent, selector: "x-button" }, { kind: "component", type: i9.XInputComponent, selector: "x-input" }, { kind: "component", type: i10.XTreeComponent, selector: "x-tree" }, { kind: "component", type: i11.XTableComponent, selector: "x-table" }, { kind: "directive", type: i12.XKeywordDirective, selector: "[x-keyword]" }, { kind: "component", type: i13.XLinkComponent, selector: "x-link" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
599
715
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferComponent, decorators: [{
|
|
600
716
|
type: Component,
|
|
601
|
-
args: [{ selector: `${XTransferPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XTransferComponent)], template: "<div #transfer class=\"x-transfer\" cdkDropListGroup [ngClass]=\"classMap\">\r\n <div class=\"x-transfer-box\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: left }\"></ng-container>\r\n <div [ngStyle]=\"left.listStyle!\" class=\"x-transfer-list\">\r\n <ng-container [ngSwitch]=\"type\">\r\n <ul\r\n *ngSwitchCase=\"'list'\"\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"left.list\"\r\n [cdkDropListDisabled]=\"!drag && type === 'list'\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of left.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: left }\"></ng-container>\r\n </li>\r\n </ul>\r\n <x-tree\r\n *ngSwitchCase=\"'tree'\"\r\n [data]=\"left.list!\"\r\n multiple\r\n allowManyActivated\r\n [(activatedId)]=\"treeActivatedId\"\r\n (nodeClick)=\"onTreeNodeClick($event)\"\r\n ></x-tree>\r\n <x-table\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns!\"\r\n [(size)]=\"tableSize\"\r\n [(index)]=\"tableIndex\"\r\n (indexChange)=\"getTableData()\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, left)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, left)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n ></x-table>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"x-transfer-buttons\">\r\n <x-button type=\"primary\" icon=\"fto-chevron-right\" [disabled]=\"left.disabledButton\" (click)=\"move(left, right)\"></x-button>\r\n <x-button type=\"primary\" icon=\"fto-chevron-left\" [disabled]=\"right.disabledButton\" (click)=\"move(right, left)\"></x-button>\r\n </div>\r\n <div class=\"x-transfer-box\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: right }\"></ng-container>\r\n <div [ngSwitch]=\"type\" [ngStyle]=\"right.listStyle!\" class=\"x-transfer-list\">\r\n <x-table\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"right.list!\"\r\n [columns]=\"tableColumns!\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, right)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, right)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showPagination=\"false\"\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n ></x-table>\r\n <ul\r\n *ngSwitchDefault\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"right.list\"\r\n [cdkDropListDisabled]=\"!drag || (drag && type !== 'list')\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of right.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: right }\"></ng-container>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #sourceTitleTpl let-source=\"source\">\r\n <div class=\"x-transfer-title\">\r\n <x-checkbox\r\n
|
|
602
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.XConfigService }, { type: i2.XI18nService }]; }
|
|
717
|
+
args: [{ selector: `${XTransferPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XTransferComponent)], template: "<div #transfer class=\"x-transfer\" cdkDropListGroup [ngClass]=\"classMap\">\r\n <div class=\"x-transfer-box\" [class.x-transfer-has-footer]=\"left.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: left }\"></ng-container>\r\n <div [ngStyle]=\"left.listStyle!\" class=\"x-transfer-list\">\r\n <ng-container [ngSwitch]=\"type\">\r\n <ul\r\n *ngSwitchCase=\"'list'\"\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"left.list\"\r\n [cdkDropListDisabled]=\"!drag && type === 'list'\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of left.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: left }\"></ng-container>\r\n </li>\r\n </ul>\r\n <x-tree\r\n *ngSwitchCase=\"'tree'\"\r\n [data]=\"left.list!\"\r\n multiple\r\n allowManyActivated\r\n [(activatedId)]=\"treeActivatedId\"\r\n (nodeClick)=\"onTreeNodeClick($event)\"\r\n [labelTpl]=\"treeLabelTpl\"\r\n ></x-tree>\r\n <ng-template #treeLabelTpl let-node=\"$node\">\r\n <span class=\"x-transfer-tree-label\" x-keyword [text]=\"left.searchInput!\">{{ node.label }}</span>\r\n </ng-template>\r\n <x-table\r\n #leftTableCom\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns!\"\r\n [(size)]=\"tableSize\"\r\n [(index)]=\"tableIndex\"\r\n (indexChange)=\"getTableData()\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, left)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, left)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n [headSearchTpl]=\"left.tableHeadSearchTpl\"\r\n ></x-table>\r\n </ng-container>\r\n </div>\r\n <div class=\"x-transfer-footer\" *ngIf=\"left.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"left.footerTpl; context: { $source: left }\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"x-transfer-buttons\">\r\n <x-button type=\"primary\" icon=\"fto-chevron-right\" [disabled]=\"left.disabledButton\" (click)=\"move(left, right)\"></x-button>\r\n <x-button type=\"primary\" icon=\"fto-chevron-left\" [disabled]=\"right.disabledButton\" (click)=\"move(right, left)\"></x-button>\r\n </div>\r\n <div class=\"x-transfer-box\" [class.x-transfer-has-footer]=\"right.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"sourceTitleTpl; context: { source: right }\"></ng-container>\r\n <div [ngSwitch]=\"type\" [ngStyle]=\"right.listStyle!\" class=\"x-transfer-list\">\r\n <x-table\r\n #rightTableCom\r\n *ngSwitchCase=\"'table'\"\r\n [data]=\"right.list!\"\r\n [columns]=\"tableColumns!\"\r\n (activatedRowChange)=\"onTableCheckedRow($event, right)\"\r\n (headCheckboxChange)=\"onTableCheckedAll($event, right)\"\r\n hiddenWrapBorder\r\n hiddenPaginationBorder\r\n showPagination=\"false\"\r\n showEllipsis=\"false\"\r\n showTotal=\"false\"\r\n paginationPosition=\"bottom-center\"\r\n allowSelectRow=\"false\"\r\n [headSearchTpl]=\"right.tableHeadSearchTpl\"\r\n ></x-table>\r\n <ul\r\n *ngSwitchDefault\r\n cdkDropList\r\n (cdkDropListDropped)=\"dropCdk($event)\"\r\n [cdkDropListData]=\"right.list\"\r\n [cdkDropListDisabled]=\"!drag || (drag && type !== 'list')\"\r\n [cdkDropListEnterPredicate]=\"predicate\"\r\n class=\"x-transfer-droplist\"\r\n >\r\n <li class=\"x-transfer-item\" *ngFor=\"let node of right.list; trackBy: trackByNode\" cdkDrag [cdkDragData]=\"node\">\r\n <ng-container *ngTemplateOutlet=\"sourceNodeTpl; context: { node: node, source: right }\"></ng-container>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"x-transfer-footer\" *ngIf=\"right.footerTpl\">\r\n <ng-container *ngTemplateOutlet=\"right.footerTpl; context: { $source: right }\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #sourceTitleTpl let-source=\"source\">\r\n <div class=\"x-transfer-title\">\r\n <div class=\"x-transfer-title-left\">\r\n <x-checkbox\r\n *ngIf=\"source.title && !source.hiddenCheckAll\"\r\n [data]=\"[titleTpl ? '' : source.title]\"\r\n [(ngModel)]=\"source.checkedAll\"\r\n (ngModelChange)=\"checkedAllChange($event, source)\"\r\n [indeterminate]=\"source.indeterminate\"\r\n ></x-checkbox>\r\n <span *ngIf=\"source.title && source.hiddenCheckAll\">{{ source.title }}</span>\r\n <x-link *ngIf=\"inverse && type === 'list'\" class=\"x-transfer-inverse\" type=\"primary\" (click)=\"onInverse(source)\">\u53CD\u9009</x-link>\r\n </div>\r\n <ng-container *xOutlet=\"titleTpl; context: { $title: source.title, $checkedCount: source.checkedCount, $count: source.count }\"\r\n ><span class=\"x-transfer-total\">{{ source.checkedCount }} / {{ source.count }}</span></ng-container\r\n >\r\n </div>\r\n <div class=\"x-transfer-search\" *ngIf=\"search && type !== 'table'\">\r\n <x-input icon=\"fto-search\" [(ngModel)]=\"source.searchInput\" (ngModelChange)=\"onSearchInputChange(source)\" clearable></x-input>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #sourceNodeTpl let-node=\"node\" let-source=\"source\">\r\n <x-checkbox\r\n [data]=\"[{ id: node.id, label: nodeTpl ? nodeTpl : labelTpl, node: node }]\"\r\n [disabled]=\"node.disabled\"\r\n [(ngModel)]=\"node.checked\"\r\n (ngModelChange)=\"checkedChange($event, source)\"\r\n ></x-checkbox>\r\n <ng-template #labelTpl>\r\n <span x-keyword [text]=\"source.searchInput!\">{{ node.label }}</span>\r\n </ng-template>\r\n</ng-template>\r\n", styles: [".x-transfer{margin:0;padding:0;display:inline-flex;align-items:center}.x-transfer-title{padding:.25rem .5625rem;display:flex;align-items:center;justify-content:space-between;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-top-left-radius:var(--x-border-radius);border-top-right-radius:var(--x-border-radius);background-color:var(--x-background);color:var(--x-text-300)}.x-transfer-title-left{display:inline-flex;align-items:center}.x-transfer-inverse{margin:0 .5rem}.x-transfer-total{margin-left:.325rem}.x-transfer-box{min-width:12rem}.x-transfer-list{display:flex;flex-direction:column;height:18rem;width:100%;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-top:none;border-bottom-left-radius:var(--x-border-radius);border-bottom-right-radius:var(--x-border-radius);overflow:auto}.x-transfer-item{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;transition:border-color var(--x-animation-duration-base),background-color var(--x-animation-duration-base),color var(--x-animation-duration-base)}.x-transfer-droplist{height:100%;padding:.25rem}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:hover{background-color:transparent}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item.cdk-drag-placeholder{border-color:var(--x-primary);color:var(--x-primary);background-color:var(--x-background);opacity:.8}.x-transfer-droplist.cdk-drop-list-dragging .x-transfer-item:not(.cdk-drag-placeholder){transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}.x-transfer-buttons{margin:0 1rem;display:flex;flex-direction:column}.x-transfer-buttons>x-button:not(:first-child){margin-top:.5rem}.x-transfer-search{padding:.5rem;border-left:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-transfer-search x-input{width:100%}.x-transfer-tree-label{flex:1}.x-transfer-footer{padding:.25rem .5625rem;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-bottom-left-radius:var(--x-border-radius);border-bottom-right-radius:var(--x-border-radius)}.x-transfer-has-footer .x-transfer-list{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none}body>li.x-transfer-item.cdk-drag-preview{padding:.125rem .25rem;border-radius:var(--x-border-radius);display:flex;align-items:center;border:.0625rem dashed transparent;border-color:var(--x-border);color:var(--x-text-400);background-color:var(--x-background-a100);opacity:.9}body>li.x-transfer-item.cdk-drag-animating{transition:transform var(--x-animation-duration-base) cubic-bezier(0,0,.2,1)}\n"] }]
|
|
718
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.XConfigService }, { type: i2.XI18nService }]; }, propDecorators: { leftTableCom: [{
|
|
719
|
+
type: ViewChild,
|
|
720
|
+
args: ['leftTableCom']
|
|
721
|
+
}], rightTableCom: [{
|
|
722
|
+
type: ViewChild,
|
|
723
|
+
args: ['rightTableCom']
|
|
724
|
+
}] } });
|
|
603
725
|
|
|
604
726
|
class XTransferModule {
|
|
605
727
|
}
|
|
@@ -613,7 +735,9 @@ class XTransferModule {
|
|
|
613
735
|
XInputModule,
|
|
614
736
|
XBaseFormModule,
|
|
615
737
|
XTreeModule,
|
|
616
|
-
XTableModule
|
|
738
|
+
XTableModule,
|
|
739
|
+
XKeywordModule,
|
|
740
|
+
XLinkModule], exports: [XTransferComponent] });
|
|
617
741
|
/** @nocollapse */ XTransferModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferModule, imports: [CommonModule,
|
|
618
742
|
FormsModule,
|
|
619
743
|
DragDropModule,
|
|
@@ -623,7 +747,9 @@ class XTransferModule {
|
|
|
623
747
|
XInputModule,
|
|
624
748
|
XBaseFormModule,
|
|
625
749
|
XTreeModule,
|
|
626
|
-
XTableModule
|
|
750
|
+
XTableModule,
|
|
751
|
+
XKeywordModule,
|
|
752
|
+
XLinkModule] });
|
|
627
753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTransferModule, decorators: [{
|
|
628
754
|
type: NgModule,
|
|
629
755
|
args: [{
|
|
@@ -639,7 +765,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
639
765
|
XInputModule,
|
|
640
766
|
XBaseFormModule,
|
|
641
767
|
XTreeModule,
|
|
642
|
-
XTableModule
|
|
768
|
+
XTableModule,
|
|
769
|
+
XKeywordModule,
|
|
770
|
+
XLinkModule
|
|
643
771
|
]
|
|
644
772
|
}]
|
|
645
773
|
}] });
|