cmat 0.0.106 → 0.0.108
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 +12 -12
- package/fesm2022/cmat-components-cascade.mjs +9 -9
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-color-picker.mjs +27 -27
- package/fesm2022/cmat-components-custom-formly.mjs +96 -96
- package/fesm2022/cmat-components-data-picker.mjs +15 -15
- package/fesm2022/cmat-components-date-range.mjs +3 -3
- package/fesm2022/cmat-components-date-time-display.mjs +3 -3
- package/fesm2022/cmat-components-drawer.mjs +6 -6
- 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 -6
- package/fesm2022/cmat-components-image-viewer.mjs +3 -3
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-knob-input.mjs +3 -3
- package/fesm2022/cmat-components-loading-overlay.mjs +3 -3
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs +3 -3
- package/fesm2022/cmat-components-material-datetimepicker.mjs +42 -42
- package/fesm2022/cmat-components-navigation.mjs +39 -39
- package/fesm2022/cmat-components-opt-input.mjs +3 -3
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-page-header.mjs +3 -3
- package/fesm2022/cmat-components-pagination.mjs +12 -12
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs +9 -9
- package/fesm2022/cmat-components-progress-bar.mjs +3 -3
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +9 -9
- package/fesm2022/cmat-components-select-table.mjs +68 -41
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +3 -3
- package/fesm2022/cmat-components-skeleton.mjs +3 -3
- package/fesm2022/cmat-components-speed-dial.mjs +9 -9
- 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 +9 -9
- package/fesm2022/cmat-components-transfer-picker.mjs +18 -18
- package/fesm2022/cmat-components-treetable.mjs +6 -6
- package/fesm2022/cmat-components-upload.mjs +9 -9
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- 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 +620 -593
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/overrides/angular-material.scss +1 -1
- package/types/cmat-components-adapter.d.ts +3 -3
- package/types/cmat-components-breadcrumb.d.ts +1 -1
- package/types/cmat-components-custom-formly.d.ts +1 -1
- package/types/cmat-components-drawer.d.ts +1 -1
- package/types/cmat-components-highlight.d.ts +1 -1
- package/types/cmat-components-material-datetimepicker.d.ts +1 -1
- package/types/cmat-components-navigation.d.ts +1 -1
- package/types/cmat-components-pagination.d.ts +1 -1
- package/types/cmat-components-select-table.d.ts +4 -0
- package/types/cmat-components-toast.d.ts +1 -1
- package/types/cmat-components-transfer-picker.d.ts +1 -1
- package/types/cmat-components-upload.d.ts +1 -1
- package/types/cmat-lib-mock-api.d.ts +2 -2
- package/types/cmat-services-alert.d.ts +1 -1
- package/types/cmat-services-config.d.ts +2 -2
- package/types/cmat-services-confirmation.d.ts +1 -1
- package/types/cmat-services-data.d.ts +1 -1
- package/types/cmat-services-export-as.d.ts +1 -1
- package/types/cmat-services-loading.d.ts +2 -2
- package/types/cmat-services-local-storage.d.ts +1 -1
- package/types/cmat-services-media-watcher.d.ts +1 -1
- package/types/cmat-services-platform.d.ts +1 -1
- package/types/cmat-services-splash-screen.d.ts +1 -1
- package/types/cmat-services-title.d.ts +1 -1
- package/types/cmat-services-translation.d.ts +1 -1
- package/types/cmat-services-utils.d.ts +1 -1
- package/types/cmat.d.ts +32 -28
|
@@ -266,10 +266,10 @@ class CmatQRCodeComponent {
|
|
|
266
266
|
console.error('生成QRCode错误:', e instanceof Error ? e.message : String(e));
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
270
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.
|
|
269
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatQRCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
270
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: CmatQRCodeComponent, isStandalone: true, selector: "cmat-qrcode", inputs: { allowEmptyString: { classPropertyName: "allowEmptyString", publicName: "allowEmptyString", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, elementType: { classPropertyName: "elementType", publicName: "elementType", isSignal: true, isRequired: false, transformFunction: null }, errorCorrectionLevel: { classPropertyName: "errorCorrectionLevel", publicName: "errorCorrectionLevel", isSignal: true, isRequired: false, transformFunction: null }, imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null }, imageHeight: { classPropertyName: "imageHeight", publicName: "imageHeight", isSignal: true, isRequired: false, transformFunction: null }, imageWidth: { classPropertyName: "imageWidth", publicName: "imageWidth", isSignal: true, isRequired: false, transformFunction: null }, margin: { classPropertyName: "margin", publicName: "margin", isSignal: true, isRequired: false, transformFunction: null }, qrdata: { classPropertyName: "qrdata", publicName: "qrdata", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { qrCodeURL: "qrCodeURL" }, viewQueries: [{ propertyName: "qrcElement", first: true, predicate: ["qrcElement"], descendants: true, isSignal: true }], exportAs: ["cmatQRCode"], ngImport: i0, template: '<div #qrcElement [class]="cssClass()"></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
271
271
|
}
|
|
272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatQRCodeComponent, decorators: [{
|
|
273
273
|
type: Component,
|
|
274
274
|
args: [{
|
|
275
275
|
selector: 'cmat-qrcode',
|
|
@@ -174,12 +174,12 @@ class CmatRatingComponent {
|
|
|
174
174
|
_initializeStarArray() {
|
|
175
175
|
this.starArray.set(Array.from({ length: this.stars() }, (_, i) => i));
|
|
176
176
|
}
|
|
177
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
177
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatRatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
178
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CmatRatingComponent, isStandalone: true, selector: "cmat-rating", inputs: { stars: { classPropertyName: "stars", publicName: "stars", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, showMode: { classPropertyName: "showMode", publicName: "showMode", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.id": "id" } }, providers: [
|
|
179
179
|
{ provide: MatFormFieldControl, useExisting: CmatRatingComponent },
|
|
180
180
|
], viewQueries: [{ propertyName: "_ratingElementRef", first: true, predicate: ["rating"], descendants: true, isSignal: true }], exportAs: ["cmatRating"], ngImport: i0, template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>", styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
181
181
|
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatRatingComponent, decorators: [{
|
|
183
183
|
type: Component,
|
|
184
184
|
args: [{ selector: 'cmat-rating', providers: [
|
|
185
185
|
{ provide: MatFormFieldControl, useExisting: CmatRatingComponent },
|
|
@@ -22,11 +22,11 @@ class CmatRichTextEditorComponent {
|
|
|
22
22
|
this.control.setValue(val ?? '', { emitEvent: false });
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatRichTextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CmatRichTextEditorComponent, isStandalone: true, selector: "cmat-rich-text-editor", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card shadow-sm\">\r\n <quill-editor class=\"w-full\" [formControl]=\"control\" [placeholder]=\"placeholder()\" [readOnly]=\"readOnly()\" [theme]=\"theme()\" [styles]=\"{ minHeight: minHeight() }\"></quill-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"minHeight()\">\r\n \u5BCC\u6587\u672C\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [/* @ts-ignore */
|
|
27
27
|
import('ngx-quill').then(m => m.QuillEditorComponent), i1.NgControlStatus, i1.FormControlDirective]] }); }
|
|
28
28
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.
|
|
29
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.7", ngImport: i0, type: CmatRichTextEditorComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
30
30
|
import('ngx-quill').then(m => m.QuillEditorComponent)], resolveMetadata: QuillEditorComponent => ({ decorators: [{
|
|
31
31
|
type: Component,
|
|
32
32
|
args: [{ selector: 'cmat-rich-text-editor', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [QuillEditorComponent, ReactiveFormsModule], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n@defer (on viewport) {\r\n <div class=\"rounded-2xl border border-default bg-card shadow-sm\">\r\n <quill-editor class=\"w-full\" [formControl]=\"control\" [placeholder]=\"placeholder()\" [readOnly]=\"readOnly()\" [theme]=\"theme()\" [styles]=\"{ minHeight: minHeight() }\"></quill-editor>\r\n </div>\r\n} @placeholder {\r\n <div class=\"flex items-center justify-center rounded-2xl border border-dashed border-default bg-card px-4 py-6 text-sm text-secondary shadow-sm\" [style.minHeight]=\"minHeight()\">\r\n \u5BCC\u6587\u672C\u7F16\u8F91\u5668\u52A0\u8F7D\u4E2D...\r\n </div>\r\n}\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n", styles: [":host{display:block}\n"] }]
|
|
@@ -37,10 +37,10 @@ const configurableDefaultOptions = [
|
|
|
37
37
|
const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken('mat-selectsearch-default-options');
|
|
38
38
|
|
|
39
39
|
class CmatSelectNoEntriesFoundDirective {
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
41
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
41
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CmatSelectNoEntriesFoundDirective, isStandalone: true, selector: "[cmatSelectNoEntriesFound]", ngImport: i0 }); }
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, decorators: [{
|
|
44
44
|
type: Directive,
|
|
45
45
|
args: [{
|
|
46
46
|
selector: '[cmatSelectNoEntriesFound]'
|
|
@@ -48,10 +48,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
48
48
|
}] });
|
|
49
49
|
|
|
50
50
|
class CmatSelectSearchClearDirective {
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
52
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectSearchClearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
52
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CmatSelectSearchClearDirective, isStandalone: true, selector: "[cmatSelectSearchClear]", ngImport: i0 }); }
|
|
53
53
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectSearchClearDirective, decorators: [{
|
|
55
55
|
type: Directive,
|
|
56
56
|
args: [{
|
|
57
57
|
selector: '[cmatSelectSearchClear]'
|
|
@@ -458,8 +458,8 @@ class CmatSelectSearchComponent {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CmatSelectSearchComponent, isStandalone: true, selector: "cmat-select-search", inputs: { placeholderLabel: { classPropertyName: "placeholderLabel", publicName: "placeholderLabel", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, noEntriesFoundLabel: { classPropertyName: "noEntriesFoundLabel", publicName: "noEntriesFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, showNoFoundLabel: { classPropertyName: "showNoFoundLabel", publicName: "showNoFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, clearSearchInput: { classPropertyName: "clearSearchInput", publicName: "clearSearchInput", isSignal: true, isRequired: false, transformFunction: null }, searching: { classPropertyName: "searching", publicName: "searching", isSignal: true, isRequired: false, transformFunction: null }, disableInitialFocus: { classPropertyName: "disableInitialFocus", publicName: "disableInitialFocus", isSignal: true, isRequired: false, transformFunction: null }, enableClearOnEscapePressed: { classPropertyName: "enableClearOnEscapePressed", publicName: "enableClearOnEscapePressed", isSignal: true, isRequired: false, transformFunction: null }, preventHomeEndKeyPropagation: { classPropertyName: "preventHomeEndKeyPropagation", publicName: "preventHomeEndKeyPropagation", isSignal: true, isRequired: false, transformFunction: null }, disableScrollToActiveOnOptionsChanged: { classPropertyName: "disableScrollToActiveOnOptionsChanged", publicName: "disableScrollToActiveOnOptionsChanged", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, showToggleAllCheckbox: { classPropertyName: "showToggleAllCheckbox", publicName: "showToggleAllCheckbox", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxChecked: { classPropertyName: "toggleAllCheckboxChecked", publicName: "toggleAllCheckboxChecked", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxIndeterminate: { classPropertyName: "toggleAllCheckboxIndeterminate", publicName: "toggleAllCheckboxIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxTooltipMessage: { classPropertyName: "toggleAllCheckboxTooltipMessage", publicName: "toggleAllCheckboxTooltipMessage", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxTooltipPosition: { classPropertyName: "toggleAllCheckboxTooltipPosition", publicName: "toggleAllCheckboxTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, hideClearSearchButton: { classPropertyName: "hideClearSearchButton", publicName: "hideClearSearchButton", isSignal: true, isRequired: false, transformFunction: null }, alwaysRestoreSelectedOptionsMulti: { classPropertyName: "alwaysRestoreSelectedOptionsMulti", publicName: "alwaysRestoreSelectedOptionsMulti", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null }, optionsCount: { classPropertyName: "optionsCount", publicName: "optionsCount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleAll: "toggleAll" }, host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } }, providers: [
|
|
463
463
|
{
|
|
464
464
|
provide: NG_VALUE_ACCESSOR,
|
|
465
465
|
useExisting: forwardRef(() => CmatSelectSearchComponent),
|
|
@@ -467,7 +467,7 @@ class CmatSelectSearchComponent {
|
|
|
467
467
|
},
|
|
468
468
|
], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true, isSignal: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, isSignal: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, isSignal: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n", styles: ["cmat-select-search .cmat-select-search-hidden{visibility:hidden}cmat-select-search .cmat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;display:flex;border-bottom-width:1px;border-bottom-style:solid}cmat-select-search .cmat-select-search-inner.cmat-select-search-inner-multiple.cmat-select-search-inner-toggle-all{display:flex;align-items:center}cmat-select-search .cmat-select-search-inner .cmat-input-element{flex-basis:auto;vertical-align:middle!important}cmat-select-search .cmat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:none;padding:0 44px 0 16px;height:47px!important;line-height:47px!important}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-input{padding-right:16px;padding-left:44px}cmat-select-search .cmat-select-search-no-entries-found{padding-top:8px}cmat-select-search .cmat-select-search-clear{position:absolute;right:4px;top:5px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-clear{right:auto;left:4px}cmat-select-search .cmat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-spinner{right:auto;left:16px}cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:5px;padding-bottom:2px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}cmat-select-search .cmat-select-search-toggle-all-checkbox .mdc-checkbox{opacity:1!important}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search{position:sticky;top:0;z-index:1;opacity:1;pointer-events:all;background:var(--mat-select-panel-background-color)}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mat-icon{margin-right:0;margin-left:0}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search mat-pseudo-checkbox{display:none}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mdc-list-item__primary-text{opacity:1}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search.cmat-select-search-no-entries-found{height:96px}.cmat-select-search-panel{transform:none!important;overflow-x:hidden;position:relative;padding:0!important}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.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"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.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: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.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 }); }
|
|
469
469
|
}
|
|
470
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectSearchComponent, decorators: [{
|
|
471
471
|
type: Component,
|
|
472
472
|
args: [{ selector: 'cmat-select-search', providers: [
|
|
473
473
|
{
|
|
@@ -2,7 +2,7 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
|
2
2
|
import * as i4 from '@angular/common';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { input, output, viewChild, viewChildren, signal, inject, DestroyRef, computed, effect, untracked, Input, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { input, output, viewChild, viewChildren, signal, inject, DestroyRef, ChangeDetectorRef, computed, effect, untracked, Input, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
7
|
import * as i3 from '@angular/forms';
|
|
8
8
|
import { FormControl, NgControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -107,6 +107,14 @@ class CmatSelectTableComponent {
|
|
|
107
107
|
...(ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []));
|
|
108
108
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
109
109
|
this._destroyRef = inject(DestroyRef);
|
|
110
|
+
this._cdr = inject(ChangeDetectorRef);
|
|
111
|
+
// _init 重入守卫:selectControl.setValue 触发 MatSelect._onChange → writeValue → _init 递归
|
|
112
|
+
this._initRunning = false;
|
|
113
|
+
// 保存 writeValue 传入的原始值(可能是部分行对象),
|
|
114
|
+
// dataSource 变更时始终用原始值重新解析,避免 _init 解析后覆盖 _value 导致原始值丢失
|
|
115
|
+
this._rawValue = null;
|
|
116
|
+
// dataSource effect 解析期间为 true,阻止 writeValue 覆盖 _rawValue
|
|
117
|
+
this._resolvingFromDataSource = false;
|
|
110
118
|
this._nullRow = { id: null };
|
|
111
119
|
this._value = null;
|
|
112
120
|
this._triggerLabel = computed(() => this.customTriggerLabelFn()?.(this.completeRowList()) ??
|
|
@@ -135,8 +143,7 @@ class CmatSelectTableComponent {
|
|
|
135
143
|
this._setPanelClass();
|
|
136
144
|
}
|
|
137
145
|
});
|
|
138
|
-
// 监听 dataSource signal
|
|
139
|
-
// signal input 不触发 ngOnChanges,此处为 dataSource 的唯一处理入口
|
|
146
|
+
// 监听 dataSource signal 变化,重建数据结构并解析表单值
|
|
140
147
|
effect(() => {
|
|
141
148
|
const ds = this.dataSource();
|
|
142
149
|
if (!ds || !isArray(ds.data) || ds.data.length === 0)
|
|
@@ -159,28 +166,19 @@ class CmatSelectTableComponent {
|
|
|
159
166
|
this._rowById.set(rowKey, row);
|
|
160
167
|
}
|
|
161
168
|
});
|
|
162
|
-
//
|
|
163
|
-
if (this.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
currentValue.forEach((v) => this._updateCompleteRowList(v, true, list));
|
|
169
|
+
// matSelect 就绪后,用原始值重新解析(不用 this.value,它可能已被上次 _init 覆盖为解析后的完整行)
|
|
170
|
+
if (this._matSelect) {
|
|
171
|
+
this._resolvingFromDataSource = true;
|
|
172
|
+
try {
|
|
173
|
+
this._init(this._rawValue);
|
|
168
174
|
}
|
|
169
|
-
|
|
170
|
-
this.
|
|
175
|
+
finally {
|
|
176
|
+
this._resolvingFromDataSource = false;
|
|
171
177
|
}
|
|
172
|
-
this.completeRowList.set(list);
|
|
173
|
-
this._value =
|
|
174
|
-
list.length > 0 ? [...list] : currentValue;
|
|
175
|
-
if (this._matSelect) {
|
|
176
|
-
this._matSelect.writeValue(this._value);
|
|
177
|
-
}
|
|
178
|
-
// 确保 selectControl 与解析后的值同步,否则 MatSelect 仍持有旧的部分行对象
|
|
179
|
-
if (this.selectControl) {
|
|
180
|
-
this.selectControl.setValue(this._value, { emitEvent: false });
|
|
181
|
-
}
|
|
182
|
-
// 通知 MatFormField 重新读取触发器状态
|
|
183
178
|
this.stateChanges.next();
|
|
179
|
+
// effect 在 CD 之后执行,当前 CD 已处理过投影内容,
|
|
180
|
+
// 推迟到微任务强制第二轮 CD 刷新 <mat-select-trigger>
|
|
181
|
+
Promise.resolve().then(() => this._cdr.detectChanges());
|
|
184
182
|
}
|
|
185
183
|
});
|
|
186
184
|
});
|
|
@@ -315,6 +313,10 @@ class CmatSelectTableComponent {
|
|
|
315
313
|
}
|
|
316
314
|
}
|
|
317
315
|
writeValue(value) {
|
|
316
|
+
// dataSource effect 解析期间,_onModelChange 级联触发的 writeValue 不覆盖原始值
|
|
317
|
+
if (!this._resolvingFromDataSource) {
|
|
318
|
+
this._rawValue = value;
|
|
319
|
+
}
|
|
318
320
|
this._init(value);
|
|
319
321
|
}
|
|
320
322
|
ngOnChanges(changes) {
|
|
@@ -419,25 +421,50 @@ class CmatSelectTableComponent {
|
|
|
419
421
|
return this.addNullRow();
|
|
420
422
|
}
|
|
421
423
|
_init(value) {
|
|
422
|
-
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
// selectControl.setValue 触发 MatSelect._onChange → writeValue → _init 递归,直接跳过
|
|
425
|
+
if (this._initRunning)
|
|
426
|
+
return;
|
|
427
|
+
this._initRunning = true;
|
|
428
|
+
try {
|
|
429
|
+
const list = [];
|
|
430
|
+
if (value) {
|
|
431
|
+
const multiple = this.multiple();
|
|
432
|
+
if (multiple && Array.isArray(value)) {
|
|
433
|
+
value.forEach((v) => this._updateCompleteRowList(v, true, list));
|
|
434
|
+
}
|
|
435
|
+
else if (!multiple) {
|
|
436
|
+
this._updateCompleteRowList(value, true, list);
|
|
437
|
+
}
|
|
427
438
|
}
|
|
428
|
-
|
|
429
|
-
|
|
439
|
+
this.completeRowList.set(list);
|
|
440
|
+
this._value =
|
|
441
|
+
this.completeRowList().length > 0 ? [...this.completeRowList()] : value;
|
|
442
|
+
if (this._matSelect) {
|
|
443
|
+
this._matSelect.writeValue(this._value);
|
|
444
|
+
}
|
|
445
|
+
// 同步 selectControl,临时替换 MatSelect._onChange 为 no-op
|
|
446
|
+
// 阻断 selectControl.setValue → MatSelect._onChange → _onModelChange → 父 FormControl 级联
|
|
447
|
+
if (this.selectControl) {
|
|
448
|
+
const origOnChange = this._matSelect?._onChange;
|
|
449
|
+
if (this._matSelect) {
|
|
450
|
+
this._matSelect._onChange = () => { };
|
|
451
|
+
}
|
|
452
|
+
try {
|
|
453
|
+
this.selectControl.setValue(this.value, { emitEvent: false });
|
|
454
|
+
}
|
|
455
|
+
finally {
|
|
456
|
+
if (this._matSelect && origOnChange) {
|
|
457
|
+
this._matSelect._onChange = origOnChange;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
// 将解析后的完整行传播回父表单(_resolvingFromDataSource 阻止 writeValue 覆盖 _rawValue)
|
|
462
|
+
if (this.completeRowList().length > 0) {
|
|
463
|
+
this._onModelChange(this._value);
|
|
430
464
|
}
|
|
431
465
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
this.completeRowList().length > 0 ? [...this.completeRowList()] : value;
|
|
435
|
-
if (this._matSelect) {
|
|
436
|
-
this._matSelect.writeValue(this._value);
|
|
437
|
-
}
|
|
438
|
-
// 确保 selectControl 与当前值同步
|
|
439
|
-
if (this.selectControl) {
|
|
440
|
-
this.selectControl.setValue(this.value, { emitEvent: false });
|
|
466
|
+
finally {
|
|
467
|
+
this._initRunning = false;
|
|
441
468
|
}
|
|
442
469
|
}
|
|
443
470
|
_updateCompleteRowList(value, selected, list = this.completeRowList()) {
|
|
@@ -771,12 +798,12 @@ class CmatSelectTableComponent {
|
|
|
771
798
|
this._matSelect.panelClass = panelClass;
|
|
772
799
|
}
|
|
773
800
|
}
|
|
774
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
775
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
801
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
802
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CmatSelectTableComponent, isStandalone: true, selector: "cmat-select-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, noEntriesFoundLabel: { classPropertyName: "noEntriesFoundLabel", publicName: "noEntriesFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, showNoFoundLabel: { classPropertyName: "showNoFoundLabel", publicName: "showNoFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, isPhone: { classPropertyName: "isPhone", publicName: "isPhone", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, overallSearchEnabled: { classPropertyName: "overallSearchEnabled", publicName: "overallSearchEnabled", isSignal: true, isRequired: false, transformFunction: null }, overallSearchVisible: { classPropertyName: "overallSearchVisible", publicName: "overallSearchVisible", isSignal: true, isRequired: false, transformFunction: null }, resetSortOnOpen: { classPropertyName: "resetSortOnOpen", publicName: "resetSortOnOpen", isSignal: true, isRequired: false, transformFunction: null }, resetFiltersOnOpen: { classPropertyName: "resetFiltersOnOpen", publicName: "resetFiltersOnOpen", isSignal: true, isRequired: false, transformFunction: null }, customTriggerLabelFn: { classPropertyName: "customTriggerLabelFn", publicName: "customTriggerLabelFn", isSignal: true, isRequired: false, transformFunction: null }, triggerLabelSort: { classPropertyName: "triggerLabelSort", publicName: "triggerLabelSort", isSignal: true, isRequired: false, transformFunction: null }, customTriggerLabelTemplate: { classPropertyName: "customTriggerLabelTemplate", publicName: "customTriggerLabelTemplate", isSignal: true, isRequired: false, transformFunction: null }, canNull: { classPropertyName: "canNull", publicName: "canNull", isSignal: true, isRequired: false, transformFunction: null }, defaultSort: { classPropertyName: "defaultSort", publicName: "defaultSort", isSignal: true, isRequired: false, transformFunction: null }, resetOptionAction: { classPropertyName: "resetOptionAction", publicName: "resetOptionAction", isSignal: true, isRequired: false, transformFunction: null }, keyParam: { classPropertyName: "keyParam", publicName: "keyParam", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "id" } }, providers: [
|
|
776
803
|
{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent },
|
|
777
804
|
], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent, descendants: true, isSignal: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "_matOptions", predicate: MatOption, descendants: true, isSignal: true }, { propertyName: "_matSelectSignal", first: true, predicate: ["componentSelect"], descendants: true, isSignal: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if (multiple()) {\r\n<mat-select #componentSelect multiple disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search \r\n [showNoFoundLabel]=\"showNoFoundLabel()\" \r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" \r\n [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{ getCellValue(row, columnKey) }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n \r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n} @else {\r\n<mat-select #componentSelect disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel()\" [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if (row.id === null) {\r\n <mat-option></mat-option>\r\n } @else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell [colSpan]=\"\r\n hasNullRow && row.id === null && $index === 1\r\n ? tableColumns().length\r\n : 1\r\n \" [ngStyle]=\"{\r\n display:\r\n hasNullRow && row.id === null && $index !== 1\r\n ? 'none'\r\n : '',\r\n }\">\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{\r\n hasNullRow && row.id === null && $index === 1\r\n ? \"\u7A7A\"\r\n : getCellValue(row, columnKey)\r\n }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0;pointer-events:auto}.cmat-select-search-table-panel .overall-search-toggle mat-icon{pointer-events:auto;-webkit-user-select:none;user-select:none}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "debounceTime", "optionsCount"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
778
805
|
}
|
|
779
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CmatSelectTableComponent, decorators: [{
|
|
780
807
|
type: Component,
|
|
781
808
|
args: [{ selector: 'cmat-select-table', exportAs: 'cmatSelectTable', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
782
809
|
{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent },
|