cmat 0.0.78 → 0.0.80
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 -46
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +104 -205
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +4 -8
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +21 -21
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +18 -24
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +21 -21
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +4 -22
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +181 -245
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +12 -184
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +3 -15
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +10 -100
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +4 -25
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +3 -21
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +7 -50
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +3 -9
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +6 -32
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +12 -24
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -12
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +11 -16
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +24 -18
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +8 -17
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +13 -34
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +80 -436
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +266 -816
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +7 -10
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +11 -11
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +8 -19
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +113 -108
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +13 -16
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +15 -151
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +16 -26
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +5 -11
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- 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 +4 -25
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +51 -79
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +204 -162
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +142 -97
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +4 -22
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +14 -19
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +3 -18
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +3 -15
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +18 -21
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +20 -20
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +159 -123
- 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 +35 -57
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -4
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -27
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +7 -9
- 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 +24 -33
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +14 -17
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +6 -23
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +4 -11
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -43
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- 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 -5
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +8 -12
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +50 -26
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +9 -11
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +56 -101
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +4 -32
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +49 -40
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +19 -25
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -10
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +8 -13
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +8 -12
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +5 -27
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +0 -8
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat.mjs +3477 -3795
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind/plugins/helpers.js +1 -10
- package/tailwind/plugins/scrollbar/index.js +0 -1
- package/tailwind/plugins/scrollbar/typedefs.js +1 -7
- package/tailwind/plugins/scrollbar/utilities.js +9 -58
- package/tailwind/plugins/scrollbar/variants.js +2 -17
- package/tailwind/plugins/theming.js +1 -57
- package/tailwind/utils/generate-contrasts.js +1 -12
- package/tailwind/utils/generate-palette.js +1 -32
- package/types/cmat-components-adapter.d.ts +0 -25
- package/types/cmat-components-breadcrumb.d.ts +25 -175
- package/types/cmat-components-carousel.d.ts +2 -20
- package/types/cmat-components-cascade.d.ts +4 -4
- package/types/cmat-components-chip-input.d.ts +4 -3
- package/types/cmat-components-code-editor.d.ts +0 -18
- package/types/cmat-components-custom-formly.d.ts +30 -37
- package/types/cmat-components-date-range.d.ts +1 -72
- package/types/cmat-components-date-time-display.d.ts +0 -15
- package/types/cmat-components-drawer.d.ts +2 -44
- package/types/cmat-components-empty-state.d.ts +0 -21
- package/types/cmat-components-file-preview.d.ts +0 -18
- package/types/cmat-components-filter-toolbar.d.ts +3 -43
- package/types/cmat-components-form-actions.d.ts +0 -6
- package/types/cmat-components-image-viewer.d.ts +5 -18
- package/types/cmat-components-inline-loading.d.ts +0 -9
- package/types/cmat-components-json-editor.d.ts +0 -1
- package/types/cmat-components-knob-input.d.ts +3 -3
- 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 +6 -272
- package/types/cmat-components-navigation.d.ts +34 -171
- package/types/cmat-components-opt-input.d.ts +1 -1
- package/types/cmat-components-page-header.d.ts +2 -16
- package/types/cmat-components-pagination.d.ts +26 -27
- package/types/cmat-components-password-strength.d.ts +1 -2
- package/types/cmat-components-popover.d.ts +1 -110
- package/types/cmat-components-progress-bar.d.ts +9 -11
- package/types/cmat-components-rating.d.ts +6 -7
- package/types/cmat-components-rich-text-editor.d.ts +0 -21
- package/types/cmat-components-select-search.d.ts +4 -20
- package/types/cmat-components-select-table.d.ts +24 -12
- package/types/cmat-components-select-tree.d.ts +29 -29
- package/types/cmat-components-skeleton.d.ts +0 -18
- package/types/cmat-components-speed-dial.d.ts +1 -2
- package/types/cmat-components-status-tag.d.ts +0 -15
- package/types/cmat-components-table-toolbar.d.ts +0 -12
- package/types/cmat-components-timeline.d.ts +3 -4
- package/types/cmat-components-toast.d.ts +2 -2
- package/types/cmat-components-transfer-picker.d.ts +42 -36
- package/types/cmat-components-treetable.d.ts +3 -4
- package/types/cmat-components-upload.d.ts +12 -17
- package/types/cmat-components-x6-angular-shape.d.ts +0 -1
- package/types/cmat-directives-arrow-cursor.d.ts +1 -1
- package/types/cmat-directives-debounce.d.ts +3 -4
- package/types/cmat-pipes-secure.d.ts +3 -4
- package/types/cmat-services-config.d.ts +35 -13
- package/types/cmat-services-data.d.ts +13 -12
- package/types/cmat-services-export-as.d.ts +0 -22
- package/types/cmat-services-loading.d.ts +15 -10
- package/types/cmat-services-media-watcher.d.ts +10 -13
- package/types/cmat-services-splash-screen.d.ts +2 -4
- package/types/cmat-services-title.d.ts +3 -5
- package/types/cmat.d.ts +733 -1391
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
2
2
|
import { NgClass, AsyncPipe } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, Directive, EventEmitter, inject,
|
|
4
|
+
import { InjectionToken, Directive, EventEmitter, inject, DestroyRef, signal, ElementRef, forwardRef, HostBinding, ContentChild, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
5
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
6
|
import * as i5 from '@angular/forms';
|
|
6
7
|
import { FormControl, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
8
|
import * as i7 from '@angular/material/button';
|
|
@@ -19,10 +20,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
|
19
20
|
import { MatSelect } from '@angular/material/select';
|
|
20
21
|
import * as i3 from '@angular/material/tooltip';
|
|
21
22
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
22
|
-
import {
|
|
23
|
-
import { switchMap, map, startWith,
|
|
23
|
+
import { of, combineLatest } from 'rxjs';
|
|
24
|
+
import { switchMap, map, startWith, tap, delay, take, filter } from 'rxjs/operators';
|
|
24
25
|
|
|
25
|
-
/** List of inputs of CmatSelectSearchComponent that can be configured with a global default. */
|
|
26
26
|
const configurableDefaultOptions = [
|
|
27
27
|
'ariaLabel',
|
|
28
28
|
'clearSearchInput',
|
|
@@ -38,10 +38,10 @@ const configurableDefaultOptions = [
|
|
|
38
38
|
const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken('mat-selectsearch-default-options');
|
|
39
39
|
|
|
40
40
|
class CmatSelectNoEntriesFoundDirective {
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
42
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
42
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: CmatSelectNoEntriesFoundDirective, isStandalone: true, selector: "[cmatSelectNoEntriesFound]", ngImport: i0 }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, decorators: [{
|
|
45
45
|
type: Directive,
|
|
46
46
|
args: [{
|
|
47
47
|
selector: '[cmatSelectNoEntriesFound]'
|
|
@@ -49,10 +49,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
|
|
|
49
49
|
}] });
|
|
50
50
|
|
|
51
51
|
class CmatSelectSearchClearDirective {
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchClearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
53
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: CmatSelectSearchClearDirective, isStandalone: true, selector: "[cmatSelectSearchClear]", ngImport: i0 }); }
|
|
54
54
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchClearDirective, decorators: [{
|
|
56
56
|
type: Directive,
|
|
57
57
|
args: [{
|
|
58
58
|
selector: '[cmatSelectSearchClear]'
|
|
@@ -62,7 +62,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
|
|
|
62
62
|
const SELECT_PANEL_MAX_HEIGHT = 256;
|
|
63
63
|
class CmatSelectSearchComponent {
|
|
64
64
|
constructor() {
|
|
65
|
-
this.placeholderLabel = '
|
|
65
|
+
this.placeholderLabel = '搜索';
|
|
66
66
|
this.type = 'text';
|
|
67
67
|
this.noEntriesFoundLabel = '无结果';
|
|
68
68
|
this.showNoFoundLabel = true;
|
|
@@ -72,38 +72,34 @@ class CmatSelectSearchComponent {
|
|
|
72
72
|
this.enableClearOnEscapePressed = false;
|
|
73
73
|
this.preventHomeEndKeyPropagation = false;
|
|
74
74
|
this.disableScrollToActiveOnOptionsChanged = false;
|
|
75
|
-
this.ariaLabel = '
|
|
76
|
-
/** Whether to show Select All Checkbox (for mat-select[multi=true]) */
|
|
75
|
+
this.ariaLabel = '下拉搜索';
|
|
77
76
|
this.showToggleAllCheckbox = false;
|
|
78
|
-
/** select all checkbox checked state */
|
|
79
77
|
this.toggleAllCheckboxChecked = false;
|
|
80
|
-
/** select all checkbox indeterminate state */
|
|
81
78
|
this.toggleAllCheckboxIndeterminate = false;
|
|
82
79
|
this.toggleAllCheckboxTooltipMessage = '';
|
|
83
80
|
this.toggleAllCheckboxTooltipPosition = 'below';
|
|
84
81
|
this.hideClearSearchButton = false;
|
|
85
82
|
this.alwaysRestoreSelectedOptionsMulti = false;
|
|
86
|
-
/** Output emitter to send to parent component with the toggle all boolean */
|
|
87
83
|
this.toggleAll = new EventEmitter();
|
|
88
84
|
this.formControl = new FormControl('');
|
|
89
85
|
this.matSelect = inject(MatSelect);
|
|
90
86
|
this.matFormField = inject(MatFormField, { optional: true }) ?? null;
|
|
91
|
-
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
92
87
|
this._viewportRuler = inject(ViewportRuler);
|
|
93
88
|
this._matOption = inject(MatOption, { optional: true }) ?? null;
|
|
94
89
|
this._defaultOptions = inject(MAT_SELECTSEARCH_DEFAULT_OPTIONS, { optional: true });
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
|
|
90
|
+
this._destroyRef = inject(DestroyRef);
|
|
91
|
+
this._options$ = signal(null, ...(ngDevMode ? [{ debugName: "_options$" }] : /* istanbul ignore next */ []));
|
|
92
|
+
this._optionsList$ = toObservable(this._options$).pipe(switchMap((_options) => _options ?
|
|
93
|
+
_options.changes.pipe(map((options) => options.toArray()), startWith(_options.toArray())) : of(null)));
|
|
98
94
|
this._optionsLength$ = this._optionsList$.pipe(map(options => options ? options.length : 0));
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
96
|
+
this.showNoEntriesFound = signal(false, ...(ngDevMode ? [{ debugName: "showNoEntriesFound" }] : /* istanbul ignore next */ []));
|
|
101
97
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
102
98
|
this.showNoEntriesFound$ = combineLatest([
|
|
103
99
|
this.formControl.valueChanges,
|
|
104
100
|
this._optionsLength$
|
|
105
101
|
]).pipe(map(([value, optionsLength]) => this.noEntriesFoundLabel && value
|
|
106
|
-
&& optionsLength === this._getOptionsLengthOffset()));
|
|
102
|
+
&& optionsLength === this._getOptionsLengthOffset()), tap(showNoEntriesFound => this.showNoEntriesFound.set(!!showNoEntriesFound)));
|
|
107
103
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
108
104
|
this.onTouched = () => { };
|
|
109
105
|
this._applyDefaultOptions(this._defaultOptions);
|
|
@@ -115,10 +111,10 @@ class CmatSelectSearchComponent {
|
|
|
115
111
|
return this.formControl.value;
|
|
116
112
|
}
|
|
117
113
|
get _options() {
|
|
118
|
-
return this._options
|
|
114
|
+
return this._options$();
|
|
119
115
|
}
|
|
120
116
|
set _options(_options) {
|
|
121
|
-
this._options$.
|
|
117
|
+
this._options$.set(_options);
|
|
122
118
|
}
|
|
123
119
|
ngOnInit() {
|
|
124
120
|
const panelClass = 'cmat-select-search-panel';
|
|
@@ -145,7 +141,7 @@ class CmatSelectSearchComponent {
|
|
|
145
141
|
console.error('<cmat-select-search> must be placed inside a <mat-option> element');
|
|
146
142
|
}
|
|
147
143
|
this.matSelect.openedChange
|
|
148
|
-
.pipe(delay(1),
|
|
144
|
+
.pipe(delay(1), takeUntilDestroyed(this._destroyRef))
|
|
149
145
|
.subscribe((opened) => {
|
|
150
146
|
if (opened) {
|
|
151
147
|
this.updateInputWidth();
|
|
@@ -161,10 +157,10 @@ class CmatSelectSearchComponent {
|
|
|
161
157
|
});
|
|
162
158
|
this.matSelect.openedChange
|
|
163
159
|
.pipe(take(1))
|
|
164
|
-
.pipe(
|
|
160
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
165
161
|
.subscribe(() => {
|
|
166
162
|
if (this.matSelect._keyManager) {
|
|
167
|
-
this.matSelect._keyManager.change.pipe(
|
|
163
|
+
this.matSelect._keyManager.change.pipe(takeUntilDestroyed(this._destroyRef))
|
|
168
164
|
.subscribe(() => this._adjustScrollTopToFitActiveOptionIntoView());
|
|
169
165
|
}
|
|
170
166
|
else {
|
|
@@ -173,26 +169,20 @@ class CmatSelectSearchComponent {
|
|
|
173
169
|
this._options = this.matSelect.options;
|
|
174
170
|
let previousFirstOption = this._options.toArray()[this._getOptionsLengthOffset()];
|
|
175
171
|
this._options.changes
|
|
176
|
-
.pipe(
|
|
172
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
177
173
|
.subscribe(() => {
|
|
178
|
-
// avoid "expression has been changed" error
|
|
179
174
|
setTimeout(() => {
|
|
180
175
|
if (this._options) {
|
|
181
|
-
// Convert the QueryList to an array
|
|
182
176
|
const options = this._options.toArray();
|
|
183
|
-
// The true first item is offset by 1
|
|
184
177
|
const currentFirstOption = options[this._getOptionsLengthOffset()];
|
|
185
178
|
const keyManager = this.matSelect._keyManager;
|
|
186
179
|
if (keyManager && this.matSelect.panelOpen) {
|
|
187
|
-
// set first item active and input width
|
|
188
|
-
// Check to see if the first option in these changes is different from the previous.
|
|
189
180
|
const firstOptionIsChanged = !this.matSelect.compareWith(previousFirstOption, currentFirstOption);
|
|
190
181
|
if (firstOptionIsChanged
|
|
191
182
|
|| !keyManager.activeItem
|
|
192
183
|
|| !options.find(option => this.matSelect.compareWith(option, keyManager.activeItem))) {
|
|
193
184
|
keyManager.setFirstItemActive();
|
|
194
185
|
}
|
|
195
|
-
// wait for panel width changes
|
|
196
186
|
setTimeout(() => {
|
|
197
187
|
this.updateInputWidth();
|
|
198
188
|
});
|
|
@@ -200,16 +190,12 @@ class CmatSelectSearchComponent {
|
|
|
200
190
|
this._adjustScrollTopToFitActiveOptionIntoView();
|
|
201
191
|
}
|
|
202
192
|
}
|
|
203
|
-
// Update our reference
|
|
204
193
|
previousFirstOption = currentFirstOption;
|
|
205
194
|
}
|
|
206
195
|
});
|
|
207
196
|
});
|
|
208
197
|
});
|
|
209
|
-
|
|
210
|
-
// note: this is hacky
|
|
211
|
-
this.showNoEntriesFound$.pipe(takeUntil(this._onDestroy)).subscribe((showNoEntriesFound) => {
|
|
212
|
-
// set no entries found class on mat option
|
|
198
|
+
this.showNoEntriesFound$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((showNoEntriesFound) => {
|
|
213
199
|
if (this._matOption) {
|
|
214
200
|
if (showNoEntriesFound) {
|
|
215
201
|
this._matOption._getHostElement().classList.add('cmat-select-search-no-entries-found');
|
|
@@ -219,31 +205,26 @@ class CmatSelectSearchComponent {
|
|
|
219
205
|
}
|
|
220
206
|
}
|
|
221
207
|
});
|
|
222
|
-
// resize the input width when the viewport is resized, i.e. the trigger width could potentially be resized
|
|
223
208
|
this._viewportRuler.change()
|
|
224
|
-
.pipe(
|
|
209
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
225
210
|
.subscribe(() => {
|
|
226
211
|
if (this.matSelect.panelOpen) {
|
|
227
212
|
this.updateInputWidth();
|
|
228
213
|
}
|
|
229
214
|
});
|
|
230
215
|
this._initMultipleHandling();
|
|
231
|
-
this._optionsList$.pipe(
|
|
232
|
-
// update view when available options change
|
|
233
|
-
this._changeDetectorRef.markForCheck();
|
|
234
|
-
});
|
|
216
|
+
this._optionsList$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe();
|
|
235
217
|
}
|
|
236
218
|
emitSelectAllBooleanToParent(state) {
|
|
219
|
+
// 通知父组件切换全选状态
|
|
237
220
|
this.toggleAll.emit(state);
|
|
238
221
|
}
|
|
239
|
-
ngOnDestroy() {
|
|
240
|
-
this._onDestroy.next(void 0);
|
|
241
|
-
this._onDestroy.complete();
|
|
242
|
-
}
|
|
243
222
|
isToggleAllCheckboxVisible() {
|
|
223
|
+
// 仅在多选模式下显示全选复选框
|
|
244
224
|
return this.matSelect.multiple && this.showToggleAllCheckbox;
|
|
245
225
|
}
|
|
246
226
|
handleKeydown(event) {
|
|
227
|
+
// 拦截输入事件,避免冒泡影响下拉面板行为
|
|
247
228
|
if ((event.key?.length === 1) ||
|
|
248
229
|
(event.code === 'KeyA') || (event.code === 'KeyB') || (event.code === 'KeyC') || (event.code === 'KeyD') || (event.code === 'KeyE') || (event.code === 'KeyF')
|
|
249
230
|
|| (event.code === 'KeyG') || (event.code === 'KeyH') || (event.code === 'KeyI') || (event.code === 'KeyJ') || (event.code === 'KeyK') || (event.code === 'KeyL')
|
|
@@ -257,20 +238,15 @@ class CmatSelectSearchComponent {
|
|
|
257
238
|
event.stopPropagation();
|
|
258
239
|
}
|
|
259
240
|
if (this.matSelect.multiple && event.key && event.code === 'Enter') {
|
|
260
|
-
// Regain focus after multiselect, so we can further type
|
|
261
241
|
setTimeout(() => this.focus());
|
|
262
242
|
}
|
|
263
|
-
// Special case if click Escape, if input is empty, close the dropdown, if not, empty out the search field
|
|
264
243
|
if (this.enableClearOnEscapePressed === true && event.code === 'Escape' && this.value) {
|
|
265
244
|
this.reset(true);
|
|
266
245
|
event.stopPropagation();
|
|
267
246
|
}
|
|
268
247
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Handles the key up event with MatSelect.
|
|
271
|
-
* Allows e.g. the announcing of the currently activeDescendant by screen readers.
|
|
272
|
-
*/
|
|
273
248
|
handleKeyup(event) {
|
|
249
|
+
// 方向键切换时同步当前高亮项
|
|
274
250
|
if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
|
|
275
251
|
const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();
|
|
276
252
|
const index = this._options?.toArray().findIndex(item => item.id === ariaActiveDescendantId);
|
|
@@ -283,21 +259,23 @@ class CmatSelectSearchComponent {
|
|
|
283
259
|
}
|
|
284
260
|
}
|
|
285
261
|
writeValue(value) {
|
|
262
|
+
// 外部写入时同步输入框值
|
|
286
263
|
this._lastExternalInputValue = value;
|
|
287
264
|
this.formControl.setValue(value);
|
|
288
|
-
this._changeDetectorRef.markForCheck();
|
|
289
265
|
}
|
|
290
266
|
onBlur() {
|
|
267
|
+
// 失焦时清理高亮并触发 touched
|
|
291
268
|
this._unselectActiveDescendant();
|
|
292
269
|
this.onTouched();
|
|
293
270
|
}
|
|
294
271
|
registerOnChange(fn) {
|
|
295
|
-
this.formControl.valueChanges.pipe(filter(value => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined),
|
|
272
|
+
this.formControl.valueChanges.pipe(filter(value => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined), takeUntilDestroyed(this._destroyRef)).subscribe(fn);
|
|
296
273
|
}
|
|
297
274
|
registerOnTouched(fn) {
|
|
298
275
|
this.onTouched = fn;
|
|
299
276
|
}
|
|
300
277
|
focus() {
|
|
278
|
+
// 聚焦并保持面板滚动位置
|
|
301
279
|
if (!this.searchSelectInput || !this.matSelect.panel) {
|
|
302
280
|
return;
|
|
303
281
|
}
|
|
@@ -307,12 +285,14 @@ class CmatSelectSearchComponent {
|
|
|
307
285
|
panel.scrollTop = scrollTop;
|
|
308
286
|
}
|
|
309
287
|
reset(focus) {
|
|
288
|
+
// 重置搜索内容
|
|
310
289
|
this.formControl.setValue('');
|
|
311
290
|
if (focus) {
|
|
312
291
|
this.focus();
|
|
313
292
|
}
|
|
314
293
|
}
|
|
315
294
|
updateInputWidth() {
|
|
295
|
+
// 根据面板宽度同步搜索输入宽度
|
|
316
296
|
if (!this.innerSelectSearch?.nativeElement) {
|
|
317
297
|
return;
|
|
318
298
|
}
|
|
@@ -329,12 +309,14 @@ class CmatSelectSearchComponent {
|
|
|
329
309
|
}
|
|
330
310
|
}
|
|
331
311
|
_getMatOptionHeight() {
|
|
312
|
+
// 获取首个选项高度,用于滚动计算
|
|
332
313
|
if (this.matSelect.options.length > 0) {
|
|
333
314
|
return this.matSelect.options.first._getHostElement().getBoundingClientRect().height;
|
|
334
315
|
}
|
|
335
316
|
return 0;
|
|
336
317
|
}
|
|
337
318
|
_getOptionsLengthOffset() {
|
|
319
|
+
// 如果嵌套在 mat-option 内,则偏移一个选项
|
|
338
320
|
if (this._matOption) {
|
|
339
321
|
return 1;
|
|
340
322
|
}
|
|
@@ -343,10 +325,12 @@ class CmatSelectSearchComponent {
|
|
|
343
325
|
}
|
|
344
326
|
}
|
|
345
327
|
_unselectActiveDescendant() {
|
|
328
|
+
// 清理当前高亮项的 aria 状态
|
|
346
329
|
this._activeDescendant?.removeAttribute('aria-selected');
|
|
347
330
|
this.searchSelectInput.nativeElement.removeAttribute('aria-activedescendant');
|
|
348
331
|
}
|
|
349
332
|
_applyDefaultOptions(defaultOptions) {
|
|
333
|
+
// 应用默认配置
|
|
350
334
|
if (!defaultOptions) {
|
|
351
335
|
return;
|
|
352
336
|
}
|
|
@@ -356,24 +340,17 @@ class CmatSelectSearchComponent {
|
|
|
356
340
|
}
|
|
357
341
|
}
|
|
358
342
|
}
|
|
359
|
-
/*
|
|
360
|
-
* Initializes handling <mat-select [multiple]="true">
|
|
361
|
-
* Note: to improve this code, mat-select should be extended to allow disabling resetting the selection while filtering.
|
|
362
|
-
*/
|
|
363
343
|
_initMultipleHandling() {
|
|
344
|
+
// 初始化多选场景下的已选值保留逻辑
|
|
345
|
+
// 处理多选场景下的已选值保留
|
|
364
346
|
if (!this.matSelect.ngControl) {
|
|
365
347
|
if (this.matSelect.multiple) {
|
|
366
|
-
// note: the access to matSelect.ngControl (instead of matSelect.value / matSelect.valueChanges)
|
|
367
|
-
// is necessary to properly work in multi-selection mode.
|
|
368
348
|
console.error('the mat-select containing cmat-select-search must have a ngModel or formControl directive when multiple=true');
|
|
369
349
|
}
|
|
370
350
|
return;
|
|
371
351
|
}
|
|
372
|
-
// if <mat-select [multiple]="true">
|
|
373
|
-
// store previously selected values and restore them when they are deselected
|
|
374
|
-
// because the option is not available while we are currently filtering
|
|
375
352
|
this._previousSelectedValues = this.matSelect.ngControl.value;
|
|
376
|
-
this.matSelect.ngControl.valueChanges?.pipe(
|
|
353
|
+
this.matSelect.ngControl.valueChanges?.pipe(takeUntilDestroyed(this._destroyRef))
|
|
377
354
|
.subscribe((values) => {
|
|
378
355
|
let restoreSelectedValues = false;
|
|
379
356
|
if (this.matSelect.multiple) {
|
|
@@ -386,8 +363,6 @@ class CmatSelectSearchComponent {
|
|
|
386
363
|
this._previousSelectedValues.forEach((previousValue) => {
|
|
387
364
|
if (!values.some((v) => this.matSelect.compareWith(v, previousValue))
|
|
388
365
|
&& !optionValues.some(v => this.matSelect.compareWith(v, previousValue))) {
|
|
389
|
-
// if a value that was selected before is deselected and not found in the options, it was deselected
|
|
390
|
-
// due to the filtering, so we restore it.
|
|
391
366
|
values.push(previousValue);
|
|
392
367
|
restoreSelectedValues = true;
|
|
393
368
|
}
|
|
@@ -400,15 +375,12 @@ class CmatSelectSearchComponent {
|
|
|
400
375
|
}
|
|
401
376
|
});
|
|
402
377
|
}
|
|
403
|
-
/**
|
|
404
|
-
* Scrolls the currently active option into the view if it is not yet visible.
|
|
405
|
-
*/
|
|
406
378
|
_adjustScrollTopToFitActiveOptionIntoView() {
|
|
379
|
+
// 滚动到当前高亮项附近
|
|
407
380
|
if (this.matSelect.panel && this.matSelect.options.length > 0) {
|
|
408
381
|
const matOptionHeight = this._getMatOptionHeight();
|
|
409
382
|
const activeOptionIndex = this.matSelect._keyManager.activeItemIndex ?? 0;
|
|
410
383
|
const labelCount = _countGroupLabelsBeforeOption(activeOptionIndex, this.matSelect.options, this.matSelect.optionGroups);
|
|
411
|
-
// If the component is in a MatOption, the activeItemIndex will be offset by one.
|
|
412
384
|
const indexOfOptionToFitIntoView = (this._matOption ? -1 : 0) + labelCount + activeOptionIndex;
|
|
413
385
|
const currentScrollTop = this.matSelect.panel.nativeElement.scrollTop;
|
|
414
386
|
const searchInputHeight = this.innerSelectSearch.nativeElement.offsetHeight;
|
|
@@ -423,16 +395,16 @@ class CmatSelectSearchComponent {
|
|
|
423
395
|
}
|
|
424
396
|
}
|
|
425
397
|
}
|
|
426
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
427
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
398
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
399
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatSelectSearchComponent, isStandalone: true, selector: "cmat-select-search", inputs: { placeholderLabel: "placeholderLabel", type: "type", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", clearSearchInput: "clearSearchInput", searching: "searching", disableInitialFocus: "disableInitialFocus", enableClearOnEscapePressed: "enableClearOnEscapePressed", preventHomeEndKeyPropagation: "preventHomeEndKeyPropagation", disableScrollToActiveOnOptionsChanged: "disableScrollToActiveOnOptionsChanged", ariaLabel: "ariaLabel", showToggleAllCheckbox: "showToggleAllCheckbox", toggleAllCheckboxChecked: "toggleAllCheckboxChecked", toggleAllCheckboxIndeterminate: "toggleAllCheckboxIndeterminate", toggleAllCheckboxTooltipMessage: "toggleAllCheckboxTooltipMessage", toggleAllCheckboxTooltipPosition: "toggleAllCheckboxTooltipPosition", hideClearSearchButton: "hideClearSearchButton", alwaysRestoreSelectedOptionsMulti: "alwaysRestoreSelectedOptionsMulti" }, outputs: { toggleAll: "toggleAll" }, host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } }, providers: [
|
|
428
400
|
{
|
|
429
401
|
provide: NG_VALUE_ACCESSOR,
|
|
430
402
|
useExisting: forwardRef(() => CmatSelectSearchComponent),
|
|
431
403
|
multi: true
|
|
432
404
|
}
|
|
433
|
-
], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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
|
|
405
|
+
], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[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 }); }
|
|
434
406
|
}
|
|
435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchComponent, decorators: [{
|
|
436
408
|
type: Component,
|
|
437
409
|
args: [{ selector: 'cmat-select-search', providers: [
|
|
438
410
|
{
|
|
@@ -441,7 +413,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
|
|
|
441
413
|
multi: true
|
|
442
414
|
}
|
|
443
415
|
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatSelectSearch', imports: [MatInputModule, NgClass, MatCheckboxModule, MatTooltipModule, MatFormFieldModule, MatIconModule,
|
|
444
|
-
FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, MatButtonModule, AsyncPipe], template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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
|
|
416
|
+
FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, MatButtonModule, AsyncPipe], template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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"] }]
|
|
445
417
|
}], ctorParameters: () => [], propDecorators: { placeholderLabel: [{
|
|
446
418
|
type: Input
|
|
447
419
|
}], type: [{
|