cmat 0.0.79 → 0.0.81
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/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +9 -9
- package/fesm2022/cmat-components-card.mjs +3 -3
- package/fesm2022/cmat-components-carousel.mjs +55 -30
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +14 -14
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-custom-formly.mjs +119 -116
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +12 -12
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +3 -3
- package/fesm2022/cmat-components-drawer.mjs +59 -24
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +3 -3
- package/fesm2022/cmat-components-file-preview.mjs +3 -3
- package/fesm2022/cmat-components-filter-toolbar.mjs +3 -3
- package/fesm2022/cmat-components-form-actions.mjs +3 -3
- package/fesm2022/cmat-components-fullscreen.mjs +3 -3
- package/fesm2022/cmat-components-highlight.mjs +6 -7
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +12 -15
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +4 -6
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +11 -11
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +8 -11
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +13 -14
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +122 -108
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +182 -210
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +75 -65
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-page-header.mjs +3 -3
- package/fesm2022/cmat-components-pagination.mjs +34 -32
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +13 -15
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +35 -26
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +11 -14
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +14 -14
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +25 -37
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +19 -20
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +31 -32
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +3 -3
- package/fesm2022/cmat-components-speed-dial.mjs +57 -20
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +3 -3
- package/fesm2022/cmat-components-table-toolbar.mjs +3 -3
- package/fesm2022/cmat-components-timeline.mjs +12 -12
- package/fesm2022/cmat-components-toast.mjs +77 -28
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +103 -90
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +17 -19
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +24 -31
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -3
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-arrow-cursor.mjs +69 -46
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +21 -21
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +6 -6
- package/fesm2022/cmat-services-data.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat.mjs +1395 -1246
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cmat-components-carousel.d.ts +18 -11
- package/types/cmat-components-cascade.d.ts +3 -3
- package/types/cmat-components-custom-formly.d.ts +8 -9
- package/types/cmat-components-date-range.d.ts +1 -1
- package/types/cmat-components-drawer.d.ts +8 -2
- package/types/cmat-components-image-viewer.d.ts +5 -6
- package/types/cmat-components-json-editor.d.ts +0 -1
- package/types/cmat-components-knob-input.d.ts +2 -2
- package/types/cmat-components-masonry.d.ts +1 -2
- package/types/cmat-components-material-color-picker.d.ts +1 -2
- package/types/cmat-components-material-datetimepicker.d.ts +16 -16
- package/types/cmat-components-navigation.d.ts +16 -8
- package/types/cmat-components-opt-input.d.ts +11 -8
- package/types/cmat-components-pagination.d.ts +5 -4
- package/types/cmat-components-password-strength.d.ts +1 -2
- package/types/cmat-components-popover.d.ts +3 -4
- package/types/cmat-components-progress-bar.d.ts +6 -7
- package/types/cmat-components-rating.d.ts +6 -7
- package/types/cmat-components-select-search.d.ts +2 -2
- package/types/cmat-components-select-table.d.ts +7 -8
- package/types/cmat-components-select-tree.d.ts +10 -11
- package/types/cmat-components-speed-dial.d.ts +6 -3
- package/types/cmat-components-toast.d.ts +13 -4
- package/types/cmat-components-transfer-picker.d.ts +21 -11
- package/types/cmat-components-treetable.d.ts +3 -4
- package/types/cmat-components-upload.d.ts +5 -7
- package/types/cmat-directives-arrow-cursor.d.ts +9 -4
- package/types/cmat.d.ts +160 -122
|
@@ -5,7 +5,7 @@ import { PortalModule } from '@angular/cdk/portal';
|
|
|
5
5
|
import * as i3 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { signal, Injectable, inject, ViewChild, Input, ChangeDetectionStrategy, ViewEncapsulation, Component,
|
|
8
|
+
import { signal, Injectable, inject, ViewChild, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, computed, DestroyRef, EventEmitter, Output, Injector, afterNextRender } from '@angular/core';
|
|
9
9
|
import * as i5 from '@angular/material/button';
|
|
10
10
|
import { MatButtonModule } from '@angular/material/button';
|
|
11
11
|
import * as i1 from '@angular/material/button-toggle';
|
|
@@ -35,10 +35,11 @@ import { MatListModule } from '@angular/material/list';
|
|
|
35
35
|
class CmatTransferPickerService {
|
|
36
36
|
constructor() {
|
|
37
37
|
this._dataSourceChange = signal([], ...(ngDevMode ? [{ debugName: "_dataSourceChange" }] : /* istanbul ignore next */ []));
|
|
38
|
-
this._refreshDataSourceChange = signal(true, ...(ngDevMode ? [{ debugName: "_refreshDataSourceChange" }] : /* istanbul ignore next */ []));
|
|
38
|
+
this._refreshDataSourceChange = signal({ clear: true, nonce: 0 }, ...(ngDevMode ? [{ debugName: "_refreshDataSourceChange" }] : /* istanbul ignore next */ []));
|
|
39
39
|
this._filtersChange = signal([], ...(ngDevMode ? [{ debugName: "_filtersChange" }] : /* istanbul ignore next */ []));
|
|
40
40
|
this._sourceOptionsChange = signal(void 0, ...(ngDevMode ? [{ debugName: "_sourceOptionsChange" }] : /* istanbul ignore next */ []));
|
|
41
41
|
this._selectedValuesChange = signal([], ...(ngDevMode ? [{ debugName: "_selectedValuesChange" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this._refreshNonce = 0;
|
|
42
43
|
this._dataSourceChange$ = toObservable(this._dataSourceChange);
|
|
43
44
|
this._refreshDataSourceChange$ = toObservable(this._refreshDataSourceChange);
|
|
44
45
|
this._filtersChange$ = toObservable(this._filtersChange);
|
|
@@ -129,7 +130,7 @@ class CmatTransferPickerService {
|
|
|
129
130
|
resetDataSource(clear) {
|
|
130
131
|
this.dataSource = this._originalDataSource;
|
|
131
132
|
this._filteredDataSource = [];
|
|
132
|
-
this._refreshDataSourceChange.set(clear);
|
|
133
|
+
this._refreshDataSourceChange.set({ clear, nonce: ++this._refreshNonce });
|
|
133
134
|
}
|
|
134
135
|
_filterDataSourceByType(dataSource, type) {
|
|
135
136
|
this._filteredDataSource = [];
|
|
@@ -142,7 +143,7 @@ class CmatTransferPickerService {
|
|
|
142
143
|
break;
|
|
143
144
|
}
|
|
144
145
|
this.dataSource = this._filteredDataSource;
|
|
145
|
-
this._refreshDataSourceChange.set(false);
|
|
146
|
+
this._refreshDataSourceChange.set({ clear: false, nonce: ++this._refreshNonce });
|
|
146
147
|
}
|
|
147
148
|
_setFilteredDataSourceByFilters(dataSource) {
|
|
148
149
|
dataSource.map((data) => {
|
|
@@ -176,10 +177,10 @@ class CmatTransferPickerService {
|
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
179
|
}
|
|
179
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
180
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
180
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
181
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerService, providedIn: 'root' }); }
|
|
181
182
|
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerService, decorators: [{
|
|
183
184
|
type: Injectable,
|
|
184
185
|
args: [{
|
|
185
186
|
providedIn: 'root'
|
|
@@ -246,10 +247,10 @@ class CmatTransferPickerFilterComponent {
|
|
|
246
247
|
changeFilterData() {
|
|
247
248
|
this._service.filterDataSource({ filterData: this.filterData });
|
|
248
249
|
}
|
|
249
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
250
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
251
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTransferPickerFilterComponent, isStandalone: true, selector: "cmat-transfer-picker-filter", inputs: { filters: "filters" }, viewQueries: [{ propertyName: "overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true, static: true }, { propertyName: "filterTemplate", first: true, predicate: ["filterTemplate"], descendants: true, static: true }], exportAs: ["cmatTransferPickerFilter"], ngImport: i0, template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">\u6216</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">\u4E14</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters; track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i6.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
251
252
|
}
|
|
252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerFilterComponent, decorators: [{
|
|
253
254
|
type: Component,
|
|
254
255
|
args: [{ selector: 'cmat-transfer-picker-filter', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerFilter', imports: [MatButtonToggleModule, MatIconModule, CommonModule, PortalModule, MatButtonModule, OverlayModule], template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">\u6216</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">\u4E14</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters; track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"] }]
|
|
255
256
|
}], ctorParameters: () => [], propDecorators: { filters: [{
|
|
@@ -276,10 +277,10 @@ class CmatTransferPickerSearchComponent {
|
|
|
276
277
|
reset() {
|
|
277
278
|
this.keyword.setValue('');
|
|
278
279
|
}
|
|
279
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
280
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
280
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
281
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTransferPickerSearchComponent, isStandalone: true, selector: "cmat-transfer-picker-search", inputs: { searchPlaceholder: "searchPlaceholder" }, exportAs: ["cmatTransferPickerSearch"], ngImport: i0, template: "<mat-form-field>\r\n <input placeholder=\"{{searchPlaceholder}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>", styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
281
282
|
}
|
|
282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerSearchComponent, decorators: [{
|
|
283
284
|
type: Component,
|
|
284
285
|
args: [{ selector: 'cmat-transfer-picker-search', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerSearch', imports: [MatFormFieldModule, MatIconModule, ReactiveFormsModule, MatButtonModule, MatInputModule], template: "<mat-form-field>\r\n <input placeholder=\"{{searchPlaceholder}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>", styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"] }]
|
|
285
286
|
}], ctorParameters: () => [], propDecorators: { searchPlaceholder: [{
|
|
@@ -302,20 +303,20 @@ var CmatTransferFilterCondition;
|
|
|
302
303
|
class CmatTransferPickerSourceComponent {
|
|
303
304
|
constructor() {
|
|
304
305
|
this.nestedNodeMap = new Map();
|
|
305
|
-
this.dataSource = [];
|
|
306
|
-
this.dataFlatNodes = [];
|
|
306
|
+
this.dataSource = signal([], ...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
307
|
+
this.dataFlatNodes = signal([], ...(ngDevMode ? [{ debugName: "dataFlatNodes" }] : /* istanbul ignore next */ []));
|
|
307
308
|
this.checklistSelection = new SelectionModel(true /* multiple */);
|
|
308
|
-
this.options = {
|
|
309
|
+
this.options = signal({
|
|
309
310
|
title: '',
|
|
310
311
|
filterable: false,
|
|
311
312
|
searchable: false,
|
|
312
313
|
searchPlaceholder: '',
|
|
313
314
|
filters: []
|
|
314
|
-
};
|
|
315
|
-
this.
|
|
315
|
+
}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
316
|
+
this.committedSelection = signal([], ...(ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []));
|
|
317
|
+
this.committedValueSet = computed(() => new Set(this.committedSelection().map(node => node.value)), ...(ngDevMode ? [{ debugName: "committedValueSet" }] : /* istanbul ignore next */ []));
|
|
316
318
|
this._flatNodeByValue = new Map();
|
|
317
319
|
this._service = inject(CmatTransferPickerService);
|
|
318
|
-
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
319
320
|
this._destroyRef = inject(DestroyRef);
|
|
320
321
|
this.childrenAccessor = (node) => node.children ?? [];
|
|
321
322
|
this.hasChild = (_, node) => !!node.children && node.children.length > 0;
|
|
@@ -342,28 +343,20 @@ class CmatTransferPickerSourceComponent {
|
|
|
342
343
|
.dataSourceChange
|
|
343
344
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
344
345
|
.subscribe((data) => {
|
|
345
|
-
this.dataSource
|
|
346
|
+
this.dataSource.set(data);
|
|
346
347
|
this._flatNodeByValue.clear();
|
|
347
|
-
this.dataFlatNodes
|
|
348
|
-
this._changeDetectorRef.markForCheck();
|
|
348
|
+
this.dataFlatNodes.set(this._getFlattenNodes(this.dataSource()));
|
|
349
349
|
});
|
|
350
350
|
this._service.refreshDataSourceChange.pipe(takeUntilDestroyed(this._destroyRef))
|
|
351
|
-
.subscribe((
|
|
351
|
+
.subscribe(({ clear }) => {
|
|
352
352
|
// 刷新时按状态重置或恢复选择
|
|
353
|
-
if (
|
|
353
|
+
if (clear) {
|
|
354
354
|
this.checklistSelection.clear();
|
|
355
|
-
this.
|
|
355
|
+
this.committedSelection.set([]);
|
|
356
356
|
}
|
|
357
357
|
else {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
const matchedNode = this._flatNodeByValue.get(selectedNode.value);
|
|
361
|
-
if (matchedNode) {
|
|
362
|
-
this.checklistSelection.deselect(selectedNode);
|
|
363
|
-
this.checklistSelection.select(matchedNode);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
this.getSelectedList();
|
|
358
|
+
this._selectNodesByValues(this.checklistSelection.selected.map(node => node.value));
|
|
359
|
+
this.commitSelection();
|
|
367
360
|
}
|
|
368
361
|
});
|
|
369
362
|
this._service
|
|
@@ -371,44 +364,35 @@ class CmatTransferPickerSourceComponent {
|
|
|
371
364
|
.pipe(filter((values) => !!values.length), takeUntilDestroyed(this._destroyRef))
|
|
372
365
|
.subscribe((values) => {
|
|
373
366
|
// 根据外部值同步选中节点
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
if (node) {
|
|
377
|
-
this.checklistSelection.select(node);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
this._changeDetectorRef.markForCheck();
|
|
367
|
+
this._selectNodesByValues(values);
|
|
368
|
+
this.commitSelection();
|
|
381
369
|
});
|
|
382
370
|
this._service
|
|
383
371
|
.sourceOptionsChange
|
|
384
372
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
385
373
|
.subscribe((options) => { if (options)
|
|
386
|
-
this.options
|
|
374
|
+
this.options.set(options); });
|
|
387
375
|
}
|
|
388
376
|
ngAfterViewInit() {
|
|
389
377
|
// 初始化时展开整棵树
|
|
390
378
|
this.tree.expandAll();
|
|
391
379
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
this.checklistSelection.select(item);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
this._changeDetectorRef.markForCheck();
|
|
402
|
-
return this.selectedList;
|
|
380
|
+
getCommittedSelection() {
|
|
381
|
+
return this.committedSelection();
|
|
382
|
+
}
|
|
383
|
+
commitSelection() {
|
|
384
|
+
this.committedSelection.set(this._cloneFlatNodes(this.checklistSelection.selected));
|
|
385
|
+
return this.committedSelection();
|
|
403
386
|
}
|
|
404
387
|
resetSelectedItem(item) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
s.disabled = false;
|
|
409
|
-
this.checklistSelection.deselect(s);
|
|
410
|
-
this._changeDetectorRef.markForCheck();
|
|
388
|
+
const target = this._flatNodeByValue.get(item.value) ?? this.checklistSelection.selected.find(i => i.value === item.value);
|
|
389
|
+
if (!target) {
|
|
390
|
+
return;
|
|
411
391
|
}
|
|
392
|
+
const descendants = this._getDescendants(target);
|
|
393
|
+
this.checklistSelection.deselect(target, ...descendants.filter(node => this.checklistSelection.isSelected(node)));
|
|
394
|
+
this._checkAllParentsSelection(target);
|
|
395
|
+
this.commitSelection();
|
|
412
396
|
}
|
|
413
397
|
descendantsAllSelected(node) {
|
|
414
398
|
// 判断后代是否全部选中
|
|
@@ -425,7 +409,7 @@ class CmatTransferPickerSourceComponent {
|
|
|
425
409
|
// 切换分支节点选择状态
|
|
426
410
|
this.checklistSelection.toggle(node);
|
|
427
411
|
let descendants = this._getDescendants(node);
|
|
428
|
-
descendants = descendants.filter(n => !n
|
|
412
|
+
descendants = descendants.filter(n => !this.isNodeDisabled(n));
|
|
429
413
|
this.checklistSelection.isSelected(node)
|
|
430
414
|
? this.checklistSelection.select(...descendants)
|
|
431
415
|
: this.checklistSelection.deselect(...descendants);
|
|
@@ -437,12 +421,16 @@ class CmatTransferPickerSourceComponent {
|
|
|
437
421
|
this.checklistSelection.toggle(node);
|
|
438
422
|
this._checkAllParentsSelection(node);
|
|
439
423
|
}
|
|
424
|
+
isNodeDisabled(node) {
|
|
425
|
+
return !!node.disabled || this.committedValueSet().has(node.value);
|
|
426
|
+
}
|
|
440
427
|
_getDescendants(dataNode) {
|
|
441
428
|
// 收集当前节点的所有后代节点
|
|
442
|
-
const
|
|
429
|
+
const flatNodes = this.dataFlatNodes();
|
|
430
|
+
const startIndex = flatNodes.findIndex(j => j === dataNode);
|
|
443
431
|
const results = [];
|
|
444
|
-
for (let i = startIndex + 1; i <
|
|
445
|
-
results.push(
|
|
432
|
+
for (let i = startIndex + 1; i < flatNodes.length && this._getLevel(dataNode) < this._getLevel(flatNodes[i]); i++) {
|
|
433
|
+
results.push(flatNodes[i]);
|
|
446
434
|
}
|
|
447
435
|
return results;
|
|
448
436
|
}
|
|
@@ -477,28 +465,50 @@ class CmatTransferPickerSourceComponent {
|
|
|
477
465
|
this.checklistSelection.select(node);
|
|
478
466
|
}
|
|
479
467
|
}
|
|
468
|
+
_cloneFlatNode(node) {
|
|
469
|
+
return {
|
|
470
|
+
label: node.label,
|
|
471
|
+
value: node.value,
|
|
472
|
+
level: node.level,
|
|
473
|
+
disabled: node.disabled,
|
|
474
|
+
expandable: node.expandable
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
_cloneFlatNodes(nodes) {
|
|
478
|
+
return nodes.map(node => this._cloneFlatNode(node));
|
|
479
|
+
}
|
|
480
480
|
_getParentNode(node) {
|
|
481
481
|
// 获取当前节点的父节点
|
|
482
482
|
const currentLevel = this._getLevel(node);
|
|
483
|
+
const flatNodes = this.dataFlatNodes();
|
|
483
484
|
if (currentLevel < 1) {
|
|
484
485
|
return null;
|
|
485
486
|
}
|
|
486
|
-
const startIndex =
|
|
487
|
+
const startIndex = flatNodes.findIndex(j => j === node) - 1;
|
|
487
488
|
for (let i = startIndex; i >= 0; i--) {
|
|
488
|
-
const currentNode =
|
|
489
|
+
const currentNode = flatNodes[i];
|
|
489
490
|
if (this._getLevel(currentNode) < currentLevel) {
|
|
490
491
|
return currentNode;
|
|
491
492
|
}
|
|
492
493
|
}
|
|
493
494
|
return null;
|
|
494
495
|
}
|
|
495
|
-
|
|
496
|
-
|
|
496
|
+
_selectNodesByValues(values) {
|
|
497
|
+
this.checklistSelection.clear();
|
|
498
|
+
for (const value of values) {
|
|
499
|
+
const node = this._flatNodeByValue.get(value);
|
|
500
|
+
if (node) {
|
|
501
|
+
this.checklistSelection.select(node);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerSourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
506
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTransferPickerSourceComponent, isStandalone: true, selector: "cmat-transfer-picker-source", viewQueries: [{ propertyName: "tree", first: true, predicate: ["componentTree"], descendants: true }], exportAs: ["cmatTransferPickerSource"], ngImport: i0, template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options().title}}</mat-card-title>\r\n @if (options().filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options().filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options().searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options().searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$2.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$2.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i2$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i2$1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i2$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i2$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i2$1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatTransferPickerFilterComponent, selector: "cmat-transfer-picker-filter", inputs: ["filters"], exportAs: ["cmatTransferPickerFilter"] }, { kind: "component", type: CmatTransferPickerSearchComponent, selector: "cmat-transfer-picker-search", inputs: ["searchPlaceholder"], exportAs: ["cmatTransferPickerSearch"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i6.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i6.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
497
507
|
}
|
|
498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerSourceComponent, decorators: [{
|
|
499
509
|
type: Component,
|
|
500
510
|
args: [{ selector: 'cmat-transfer-picker-source', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerSource', imports: [MatCardModule, MatTreeModule, MatCheckboxModule, MatIconModule, MatButtonModule,
|
|
501
|
-
CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, ScrollingModule], template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options
|
|
511
|
+
CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, ScrollingModule], template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options().title}}</mat-card-title>\r\n @if (options().filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options().filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options().searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options().searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"] }]
|
|
502
512
|
}], propDecorators: { tree: [{
|
|
503
513
|
type: ViewChild,
|
|
504
514
|
args: ['componentTree', { static: false }]
|
|
@@ -509,16 +519,15 @@ class CmatTransferPickerTargetComponent {
|
|
|
509
519
|
this.clearItemChange = new EventEmitter();
|
|
510
520
|
}
|
|
511
521
|
clearItem(item) {
|
|
512
|
-
this.selectedList.splice(this.selectedList.findIndex(j => j === item), 1);
|
|
513
522
|
this.clearItemChange.emit(item);
|
|
514
523
|
}
|
|
515
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
516
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerTargetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
525
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatTransferPickerTargetComponent, isStandalone: true, selector: "cmat-transfer-picker-target", inputs: { committedSelection: "committedSelection" }, outputs: { clearItemChange: "clearItemChange" }, exportAs: ["cmatTransferPickerTarget"], ngImport: i0, template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">\u5DF2\u9009\u62E9 {{committedSelection.length}} \u9879</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection; track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection.length) {\r\n <div class=\"transfer-picker-target-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$2.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$2.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i6.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i6.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
517
526
|
}
|
|
518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerTargetComponent, decorators: [{
|
|
519
528
|
type: Component,
|
|
520
|
-
args: [{ selector: 'cmat-transfer-picker-target', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerTarget', imports: [MatCardModule, MatListModule, MatIconModule, ScrollingModule, MatButtonModule], template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">\u5DF2\u9009\u62E9 {{
|
|
521
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
529
|
+
args: [{ selector: 'cmat-transfer-picker-target', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerTarget', imports: [MatCardModule, MatListModule, MatIconModule, ScrollingModule, MatButtonModule], template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">\u5DF2\u9009\u62E9 {{committedSelection.length}} \u9879</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection; track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection.length) {\r\n <div class=\"transfer-picker-target-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"] }]
|
|
530
|
+
}], ctorParameters: () => [], propDecorators: { committedSelection: [{
|
|
522
531
|
type: Input
|
|
523
532
|
}], clearItemChange: [{
|
|
524
533
|
type: Output
|
|
@@ -526,12 +535,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
526
535
|
|
|
527
536
|
class CmatTransferPickerComponent {
|
|
528
537
|
constructor() {
|
|
538
|
+
this.committedSelection = signal([], ...(ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []));
|
|
529
539
|
this._service = inject(CmatTransferPickerService);
|
|
530
|
-
this.
|
|
540
|
+
this._injector = inject(Injector);
|
|
531
541
|
this.filterable = true;
|
|
532
542
|
this.dataSource = [];
|
|
533
543
|
this.filters = [];
|
|
534
|
-
this.
|
|
544
|
+
this.committedSelection.set([]);
|
|
535
545
|
this.selectedValues = [];
|
|
536
546
|
}
|
|
537
547
|
ngOnInit() {
|
|
@@ -548,36 +558,39 @@ class CmatTransferPickerComponent {
|
|
|
548
558
|
}
|
|
549
559
|
ngAfterViewInit() {
|
|
550
560
|
if (this.selectedValues.length) {
|
|
551
|
-
|
|
561
|
+
afterNextRender(() => {
|
|
562
|
+
this.pick();
|
|
563
|
+
}, { injector: this._injector });
|
|
552
564
|
}
|
|
553
565
|
}
|
|
554
566
|
pick() {
|
|
555
|
-
this.
|
|
556
|
-
this._emitterChange();
|
|
567
|
+
this._commitSelection(this.source.commitSelection());
|
|
557
568
|
}
|
|
558
569
|
reset() {
|
|
559
|
-
if (this.
|
|
560
|
-
this.
|
|
570
|
+
if (this.committedSelection().length) {
|
|
571
|
+
this._commitSelection([]);
|
|
561
572
|
this._service.resetDataSource(true);
|
|
562
|
-
this._emitterChange();
|
|
563
573
|
}
|
|
564
574
|
}
|
|
565
575
|
onClearItemChange(item) {
|
|
566
576
|
if (item) {
|
|
567
577
|
this.source.resetSelectedItem(item);
|
|
568
|
-
this.
|
|
578
|
+
this._commitSelection(this.source.getCommittedSelection());
|
|
569
579
|
}
|
|
570
580
|
}
|
|
581
|
+
_commitSelection(selectedList) {
|
|
582
|
+
this.committedSelection.set([...selectedList]);
|
|
583
|
+
this._emitterChange();
|
|
584
|
+
}
|
|
571
585
|
_emitterChange() {
|
|
572
|
-
this.selectChange.emit(this.
|
|
573
|
-
this._changeDetectorRef.detectChanges();
|
|
586
|
+
this.selectChange.emit(this.committedSelection());
|
|
574
587
|
}
|
|
575
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
576
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
588
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
589
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: CmatTransferPickerComponent, isStandalone: true, selector: "cmat-transfer-picker", inputs: { title: "title", filterable: "filterable", searchable: "searchable", searchPlaceholder: "searchPlaceholder", dataSource: "dataSource", filters: "filters", selectedValues: "selectedValues" }, outputs: { selectChange: "selectChange" }, viewQueries: [{ propertyName: "source", first: true, predicate: CmatTransferPickerSourceComponent, descendants: true, static: true }], exportAs: ["cmatTransferPicker"], ngImport: i0, template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n \u9009\u62E9<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>\u91CD\u7F6E\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n", styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatTransferPickerSourceComponent, selector: "cmat-transfer-picker-source", exportAs: ["cmatTransferPickerSource"] }, { kind: "component", type: CmatTransferPickerTargetComponent, selector: "cmat-transfer-picker-target", inputs: ["committedSelection"], outputs: ["clearItemChange"], exportAs: ["cmatTransferPickerTarget"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
577
590
|
}
|
|
578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatTransferPickerComponent, decorators: [{
|
|
579
592
|
type: Component,
|
|
580
|
-
args: [{ selector: 'cmat-transfer-picker', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPicker', imports: [MatIconModule, MatButtonModule, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent], template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n \u9009\u62E9<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>\u91CD\u7F6E\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [
|
|
593
|
+
args: [{ selector: 'cmat-transfer-picker', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPicker', imports: [MatIconModule, MatButtonModule, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent], template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n \u9009\u62E9<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>\u91CD\u7F6E\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n", styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"] }]
|
|
581
594
|
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
582
595
|
type: Input
|
|
583
596
|
}], filterable: [{
|