cmat 0.0.110 → 0.0.112
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 +531 -536
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +150 -42
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +1120 -629
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +861 -441
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +580 -335
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +197 -105
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +1762 -825
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +701 -456
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +137 -30
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +410 -258
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +201 -41
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +198 -35
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +102 -26
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +167 -47
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +203 -112
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +489 -215
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +117 -27
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +276 -230
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +615 -420
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +120 -40
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +3080 -1404
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +540 -466
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +528 -125
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +141 -32
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +866 -534
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +873 -434
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +1012 -731
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +98 -35
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +463 -287
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +377 -203
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +926 -496
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +1280 -842
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +998 -690
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +143 -57
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +457 -303
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +136 -44
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +464 -168
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +346 -262
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +372 -112
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +904 -410
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +43 -25
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +162 -76
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +457 -356
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +207 -195
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +50 -30
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +41 -25
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +50 -38
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +44 -31
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +60 -49
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-reports.mjs +2751 -0
- package/fesm2022/cmat-reports.mjs.map +1 -0
- package/fesm2022/cmat-services-alert.mjs +249 -277
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +110 -81
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +184 -73
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +136 -125
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +165 -183
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +116 -95
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +75 -66
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +69 -64
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +48 -45
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-print.mjs +985 -669
- package/fesm2022/cmat-services-print.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +53 -38
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +57 -47
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +79 -68
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +424 -517
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +23 -33
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat-version.mjs +12 -16
- package/fesm2022/cmat-version.mjs.map +1 -1
- package/fesm2022/cmat.mjs +39806 -22071
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +5 -1
- package/types/cmat-components-adapter.d.ts +145 -156
- package/types/cmat-components-breadcrumb.d.ts +108 -86
- package/types/cmat-components-card.d.ts +34 -18
- package/types/cmat-components-carousel.d.ts +251 -134
- package/types/cmat-components-cascade.d.ts +158 -117
- package/types/cmat-components-chip-input.d.ts +105 -71
- package/types/cmat-components-code-editor.d.ts +59 -34
- package/types/cmat-components-color-picker.d.ts +378 -236
- package/types/cmat-components-custom-formly.d.ts +776 -814
- package/types/cmat-components-data-picker.d.ts +502 -360
- package/types/cmat-components-date-range.d.ts +106 -77
- package/types/cmat-components-date-time-display.d.ts +36 -13
- package/types/cmat-components-drawer.d.ts +91 -61
- package/types/cmat-components-empty-state.d.ts +47 -17
- package/types/cmat-components-file-preview.d.ts +42 -14
- package/types/cmat-components-filter-toolbar.d.ts +57 -25
- package/types/cmat-components-form-actions.d.ts +18 -10
- package/types/cmat-components-fullscreen.d.ts +21 -13
- package/types/cmat-components-highlight.d.ts +33 -26
- package/types/cmat-components-image-viewer.d.ts +119 -58
- package/types/cmat-components-inline-loading.d.ts +24 -11
- package/types/cmat-components-json-editor.d.ts +39 -28
- package/types/cmat-components-knob-input.d.ts +172 -101
- package/types/cmat-components-loading-overlay.d.ts +8 -11
- package/types/cmat-components-masonry.d.ts +27 -14
- package/types/cmat-components-material-color-picker.d.ts +56 -42
- package/types/cmat-components-material-datetimepicker.d.ts +817 -454
- package/types/cmat-components-navigation.d.ts +295 -221
- package/types/cmat-components-opt-input.d.ts +111 -90
- package/types/cmat-components-org-chart.d.ts +53 -35
- package/types/cmat-components-page-header.d.ts +37 -14
- package/types/cmat-components-pagination.d.ts +144 -107
- package/types/cmat-components-password-strength.d.ts +197 -86
- package/types/cmat-components-popover.d.ts +264 -166
- package/types/cmat-components-progress-bar.d.ts +17 -14
- package/types/cmat-components-qrcode.d.ts +111 -42
- package/types/cmat-components-rating.d.ts +105 -59
- package/types/cmat-components-rich-text-editor.d.ts +39 -16
- package/types/cmat-components-select-search.d.ts +195 -99
- package/types/cmat-components-select-table.d.ts +241 -142
- package/types/cmat-components-select-tree.d.ts +185 -118
- package/types/cmat-components-skeleton.d.ts +55 -32
- package/types/cmat-components-speed-dial.d.ts +86 -61
- package/types/cmat-components-status-tag.d.ts +42 -24
- package/types/cmat-components-table-toolbar.d.ts +30 -12
- package/types/cmat-components-timeline.d.ts +83 -51
- package/types/cmat-components-toast.d.ts +84 -85
- package/types/cmat-components-transfer-picker.d.ts +228 -181
- package/types/cmat-components-treetable.d.ts +63 -39
- package/types/cmat-components-upload.d.ts +205 -106
- package/types/cmat-components-x6-angular-shape.d.ts +29 -37
- package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
- package/types/cmat-directives-arrow-cursor.d.ts +55 -35
- package/types/cmat-directives-autofocus.d.ts +8 -11
- package/types/cmat-directives-data-exporter.d.ts +71 -40
- package/types/cmat-directives-debounce.d.ts +31 -28
- package/types/cmat-directives-digit-only.d.ts +90 -53
- package/types/cmat-directives-equal-validator.d.ts +11 -14
- package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
- package/types/cmat-lib-mock-api.d.ts +46 -55
- package/types/cmat-pipes-bytes.d.ts +7 -10
- package/types/cmat-pipes-date-format.d.ts +7 -10
- package/types/cmat-pipes-find-by-key.d.ts +8 -12
- package/types/cmat-pipes-group-by.d.ts +11 -15
- package/types/cmat-pipes-keys.d.ts +10 -13
- package/types/cmat-pipes-secure.d.ts +14 -17
- package/types/cmat-pipes-uppercase.d.ts +7 -10
- package/types/cmat-reports.d.ts +1131 -0
- package/types/cmat-services-alert.d.ts +80 -87
- package/types/cmat-services-config.d.ts +37 -43
- package/types/cmat-services-confirmation.d.ts +31 -37
- package/types/cmat-services-data.d.ts +18 -21
- package/types/cmat-services-export-as.d.ts +28 -33
- package/types/cmat-services-loading.d.ts +27 -31
- package/types/cmat-services-local-storage.d.ts +17 -21
- package/types/cmat-services-media-watcher.d.ts +14 -18
- package/types/cmat-services-platform.d.ts +8 -11
- package/types/cmat-services-print.d.ts +97 -92
- package/types/cmat-services-splash-screen.d.ts +11 -14
- package/types/cmat-services-title.d.ts +9 -12
- package/types/cmat-services-translation.d.ts +19 -22
- package/types/cmat-services-utils.d.ts +76 -80
- package/types/cmat-validators.d.ts +5 -8
- package/types/cmat-version.d.ts +8 -10
- package/types/cmat.d.ts +7551 -5194
|
@@ -1,337 +1,582 @@
|
|
|
1
|
-
import { coerceBooleanProperty } from
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import { takeUntilDestroyed } from
|
|
6
|
-
import * as i5 from
|
|
7
|
-
import {
|
|
8
|
-
import * as i3 from
|
|
9
|
-
import { MatAutocompleteModule } from
|
|
10
|
-
import * as i1 from
|
|
11
|
-
import { MatChipsModule } from
|
|
12
|
-
import { MatFormFieldControl } from
|
|
13
|
-
import * as i4 from
|
|
14
|
-
import { MatIconModule } from
|
|
15
|
-
import * as i2 from
|
|
16
|
-
import { MatInputModule } from
|
|
17
|
-
import {
|
|
18
|
-
import { Subject, filter } from
|
|
19
|
-
|
|
20
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
1
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
|
+
import { COMMA, ENTER } from "@angular/cdk/keycodes";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Input, ViewEncapsulation, computed, inject, input, signal, viewChild } from "@angular/core";
|
|
5
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import { FormControl, NgControl, ReactiveFormsModule } from "@angular/forms";
|
|
8
|
+
import * as i3 from "@angular/material/autocomplete";
|
|
9
|
+
import { MatAutocompleteModule } from "@angular/material/autocomplete";
|
|
10
|
+
import * as i1 from "@angular/material/chips";
|
|
11
|
+
import { MatChipsModule } from "@angular/material/chips";
|
|
12
|
+
import { MatFormFieldControl } from "@angular/material/form-field";
|
|
13
|
+
import * as i4 from "@angular/material/icon";
|
|
14
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
15
|
+
import * as i2 from "@angular/material/input";
|
|
16
|
+
import { MatInputModule } from "@angular/material/input";
|
|
17
|
+
import { isArray, isEmpty, isNil } from "lodash-es";
|
|
18
|
+
import { Subject, filter } from "rxjs";
|
|
21
19
|
let NEXT_ID = 0;
|
|
22
|
-
class CmatChipInputComponent {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
20
|
+
var CmatChipInputComponent = class CmatChipInputComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.id = `cmat-chip-input-${NEXT_ID++}`;
|
|
23
|
+
this.ngControl = inject(NgControl, {
|
|
24
|
+
optional: true,
|
|
25
|
+
self: true
|
|
26
|
+
});
|
|
27
|
+
this.selectableOptions = input(...ngDevMode ? [void 0, { debugName: "selectableOptions" }] : /* istanbul ignore next */ []);
|
|
28
|
+
this.hasAutocomplete = input(false, ...ngDevMode ? [{ debugName: "hasAutocomplete" }] : /* istanbul ignore next */ []);
|
|
29
|
+
this.outputIsString = input(false, ...ngDevMode ? [{ debugName: "outputIsString" }] : /* istanbul ignore next */ []);
|
|
30
|
+
this.separatorKey = input(",", ...ngDevMode ? [{ debugName: "separatorKey" }] : /* istanbul ignore next */ []);
|
|
31
|
+
this.inputControl = new FormControl(null);
|
|
32
|
+
this.separatorKeysCodes = [ENTER, COMMA];
|
|
33
|
+
this.controlType = "cmat-chip-input";
|
|
34
|
+
this.autocompleteOptionActive = signal(false, ...ngDevMode ? [{ debugName: "autocompleteOptionActive" }] : /* istanbul ignore next */ []);
|
|
35
|
+
this._inputValueSignal = signal(null, ...ngDevMode ? [{ debugName: "_inputValueSignal" }] : /* istanbul ignore next */ []);
|
|
36
|
+
this.stateChanges = new Subject();
|
|
37
|
+
this._focused = signal(false, ...ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []);
|
|
38
|
+
this._touched = signal(false, ...ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []);
|
|
39
|
+
this._placeholderSignal = signal("", ...ngDevMode ? [{ debugName: "_placeholderSignal" }] : /* istanbul ignore next */ []);
|
|
40
|
+
this._disabledSignal = signal(false, ...ngDevMode ? [{ debugName: "_disabledSignal" }] : /* istanbul ignore next */ []);
|
|
41
|
+
this._requiredSignal = signal(false, ...ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this._valueSignal = signal(null, ...ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []);
|
|
43
|
+
this.selectedOptions = signal([], ...ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this._inputElementRef = viewChild("input", ...ngDevMode ? [{ debugName: "_inputElementRef" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this._autoTrigger = viewChild("autoTrigger", ...ngDevMode ? [{ debugName: "_autoTrigger" }] : /* istanbul ignore next */ []);
|
|
46
|
+
this._suppressPanelOpen = false;
|
|
47
|
+
this._maxFilteredItems = 50;
|
|
48
|
+
this._destroyRef = inject(DestroyRef);
|
|
49
|
+
this.filteredOptions = computed(() => {
|
|
50
|
+
if (!this.hasAutocomplete()) return null;
|
|
51
|
+
const currentValue = this._inputValueSignal() ?? "";
|
|
52
|
+
return (currentValue ? this._filter(currentValue) : this.selectableOptions()?.slice() ?? []).filter((option) => !this.selectedOptions().includes(option)).slice(0, this._maxFilteredItems);
|
|
53
|
+
}, ...ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this._onModelChange = () => {};
|
|
55
|
+
this._onTouchedChange = () => {};
|
|
56
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
57
|
+
this.inputControl.valueChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
|
|
58
|
+
this._inputValueSignal.set(value ?? null);
|
|
59
|
+
});
|
|
60
|
+
this.inputControl.valueChanges.pipe(takeUntilDestroyed(this._destroyRef), filter((value) => this.hasAutocomplete() && this._focused() && (value === "" || value === null))).subscribe(() => {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this._autoTrigger()?.openPanel();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
ngOnDestroy() {
|
|
67
|
+
this.stateChanges.complete();
|
|
68
|
+
}
|
|
69
|
+
get focused() {
|
|
70
|
+
return this._focused();
|
|
71
|
+
}
|
|
72
|
+
get touched() {
|
|
73
|
+
return this._touched();
|
|
74
|
+
}
|
|
75
|
+
get placeholder() {
|
|
76
|
+
return this._placeholderSignal();
|
|
77
|
+
}
|
|
78
|
+
set placeholder(value) {
|
|
79
|
+
this._placeholderSignal.set(value);
|
|
80
|
+
this.stateChanges.next();
|
|
81
|
+
}
|
|
82
|
+
get value() {
|
|
83
|
+
return this._valueSignal();
|
|
84
|
+
}
|
|
85
|
+
set value(value) {
|
|
86
|
+
if (value !== this._valueSignal()) {
|
|
87
|
+
this._valueSignal.set(value);
|
|
88
|
+
this.stateChanges.next();
|
|
89
|
+
this._onModelChange(value);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
get empty() {
|
|
93
|
+
const val = this._valueSignal();
|
|
94
|
+
if (isNil(val)) return true;
|
|
95
|
+
if (Array.isArray(val)) return val.length === 0;
|
|
96
|
+
return val === "";
|
|
97
|
+
}
|
|
98
|
+
get errorState() {
|
|
99
|
+
if (this.ngControl == null) return false;
|
|
100
|
+
return (this._touched() && this.ngControl?.invalid) ?? false;
|
|
101
|
+
}
|
|
102
|
+
get shouldLabelFloat() {
|
|
103
|
+
return this._focused() || !this.empty;
|
|
104
|
+
}
|
|
105
|
+
get required() {
|
|
106
|
+
return this._requiredSignal();
|
|
107
|
+
}
|
|
108
|
+
set required(value) {
|
|
109
|
+
this._requiredSignal.set(coerceBooleanProperty(value));
|
|
110
|
+
this.stateChanges.next();
|
|
111
|
+
}
|
|
112
|
+
get disabled() {
|
|
113
|
+
if (!isNil(this.ngControl?.disabled)) return this.ngControl.disabled;
|
|
114
|
+
return this._disabledSignal();
|
|
115
|
+
}
|
|
116
|
+
set disabled(value) {
|
|
117
|
+
const isDisabled = coerceBooleanProperty(value);
|
|
118
|
+
this._disabledSignal.set(isDisabled);
|
|
119
|
+
if (isDisabled || this.ngControl?.disabled) this.inputControl.disable();
|
|
120
|
+
else this.inputControl.enable();
|
|
121
|
+
if (this._focused() && isDisabled) {
|
|
122
|
+
this._focused.set(false);
|
|
123
|
+
this.stateChanges.next();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
registerOnChange(fn) {
|
|
127
|
+
this._onModelChange = fn;
|
|
128
|
+
}
|
|
129
|
+
registerOnTouched(fn) {
|
|
130
|
+
this._onTouchedChange = fn;
|
|
131
|
+
}
|
|
132
|
+
writeValue(value) {
|
|
133
|
+
let options = [];
|
|
134
|
+
if (isArray(value)) options = value;
|
|
135
|
+
else if (!isNil(value) && !isEmpty(value)) options = value.split(this.separatorKey()).map((v) => v.trim()).filter((v) => v);
|
|
136
|
+
options = Array.from(new Set(options));
|
|
137
|
+
this.selectedOptions.set(options);
|
|
138
|
+
const finalValue = this.outputIsString() ? options.join(this.separatorKey()) : options;
|
|
139
|
+
if (this._valueSignal() !== finalValue) {
|
|
140
|
+
this._valueSignal.set(finalValue);
|
|
141
|
+
this.stateChanges.next();
|
|
142
|
+
}
|
|
143
|
+
this.inputControl.setValue(null);
|
|
144
|
+
}
|
|
145
|
+
setDisabledState(isDisabled) {
|
|
146
|
+
this.disabled = isDisabled;
|
|
147
|
+
}
|
|
148
|
+
setDescribedByIds(ids) {
|
|
149
|
+
if (ids.length) this._inputElementRef()?.nativeElement.setAttribute("aria-describedby", ids.join(" "));
|
|
150
|
+
else this._inputElementRef()?.nativeElement.removeAttribute("aria-describedby");
|
|
151
|
+
}
|
|
152
|
+
onContainerClick() {
|
|
153
|
+
if (!this._focused()) this._inputElementRef()?.nativeElement.focus();
|
|
154
|
+
}
|
|
155
|
+
onAdd(event) {
|
|
156
|
+
if (this.autocompleteOptionActive()) return;
|
|
157
|
+
const value = (event.value || "").trim();
|
|
158
|
+
if (value) {
|
|
159
|
+
if ((!this.hasAutocomplete() || this.selectableOptions()?.includes(value)) && !this.selectedOptions().includes(value)) {
|
|
160
|
+
const newValue = [...this.selectedOptions(), value];
|
|
161
|
+
this._updateValue(newValue);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
event.chipInput.clear();
|
|
165
|
+
this.inputControl.setValue(null);
|
|
166
|
+
}
|
|
167
|
+
onRemove(option) {
|
|
168
|
+
const index = this.selectedOptions().findIndex((i) => i === option);
|
|
169
|
+
if (index >= 0) {
|
|
170
|
+
const newOptions = [...this.selectedOptions()];
|
|
171
|
+
newOptions.splice(index, 1);
|
|
172
|
+
this._updateValue(newOptions);
|
|
173
|
+
this._suppressPanelOpen = true;
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
this._suppressPanelOpen = false;
|
|
176
|
+
}, 150);
|
|
177
|
+
this._inputElementRef()?.nativeElement.focus();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
onSelected(event) {
|
|
181
|
+
const selectedValue = event.option.viewValue;
|
|
182
|
+
if (!this.selectedOptions().includes(selectedValue)) {
|
|
183
|
+
const newValue = [...this.selectedOptions(), selectedValue];
|
|
184
|
+
this._updateValue(newValue);
|
|
185
|
+
}
|
|
186
|
+
this._autoTrigger()?.closePanel();
|
|
187
|
+
this.inputControl.setValue(null);
|
|
188
|
+
this._inputValueSignal.set(null);
|
|
189
|
+
this.autocompleteOptionActive.set(false);
|
|
190
|
+
this._suppressPanelOpen = true;
|
|
191
|
+
setTimeout(() => {
|
|
192
|
+
this._suppressPanelOpen = false;
|
|
193
|
+
}, 100);
|
|
194
|
+
}
|
|
195
|
+
onFocusIn(event) {
|
|
196
|
+
if (!this.focused) {
|
|
197
|
+
this._focused.set(true);
|
|
198
|
+
this.stateChanges.next();
|
|
199
|
+
if (this.hasAutocomplete() && !this._suppressPanelOpen) {
|
|
200
|
+
if ((event?.target)?.closest("mat-chip-row")) return;
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
if (!this._suppressPanelOpen) this._autoTrigger()?.openPanel();
|
|
203
|
+
}, 50);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
onFocusOut(event) {
|
|
208
|
+
const containerEl = this._inputElementRef()?.nativeElement;
|
|
209
|
+
if (containerEl && !containerEl.contains(event.relatedTarget)) {
|
|
210
|
+
this._touched.set(true);
|
|
211
|
+
this._focused.set(false);
|
|
212
|
+
this._onTouchedChange();
|
|
213
|
+
this.stateChanges.next();
|
|
214
|
+
if (this.hasAutocomplete()) setTimeout(() => {
|
|
215
|
+
if (!this._focused()) this._autoTrigger()?.closePanel();
|
|
216
|
+
}, 150);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
onActivated(event) {
|
|
220
|
+
this.autocompleteOptionActive.set(event.option != null);
|
|
221
|
+
}
|
|
222
|
+
_updateValue(newOptions) {
|
|
223
|
+
this.selectedOptions.set(newOptions);
|
|
224
|
+
if (this.outputIsString()) this.value = newOptions.join(this.separatorKey());
|
|
225
|
+
else this.value = newOptions;
|
|
226
|
+
}
|
|
227
|
+
_filter(value) {
|
|
228
|
+
const filterValue = value.toLowerCase();
|
|
229
|
+
return this.selectableOptions()?.filter((v) => v.toLowerCase().includes(filterValue)) ?? [];
|
|
230
|
+
}
|
|
231
|
+
static {
|
|
232
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
233
|
+
minVersion: "12.0.0",
|
|
234
|
+
version: "22.2.3",
|
|
235
|
+
ngImport: i0,
|
|
236
|
+
type: CmatChipInputComponent,
|
|
237
|
+
deps: [],
|
|
238
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
static {
|
|
242
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
243
|
+
minVersion: "17.0.0",
|
|
244
|
+
version: "22.2.3",
|
|
245
|
+
type: CmatChipInputComponent,
|
|
246
|
+
isStandalone: true,
|
|
247
|
+
selector: "cmat-chip-input",
|
|
248
|
+
inputs: {
|
|
249
|
+
selectableOptions: {
|
|
250
|
+
classPropertyName: "selectableOptions",
|
|
251
|
+
publicName: "selectableOptions",
|
|
252
|
+
isSignal: true,
|
|
253
|
+
isRequired: false,
|
|
254
|
+
transformFunction: null
|
|
255
|
+
},
|
|
256
|
+
hasAutocomplete: {
|
|
257
|
+
classPropertyName: "hasAutocomplete",
|
|
258
|
+
publicName: "hasAutocomplete",
|
|
259
|
+
isSignal: true,
|
|
260
|
+
isRequired: false,
|
|
261
|
+
transformFunction: null
|
|
262
|
+
},
|
|
263
|
+
outputIsString: {
|
|
264
|
+
classPropertyName: "outputIsString",
|
|
265
|
+
publicName: "outputIsString",
|
|
266
|
+
isSignal: true,
|
|
267
|
+
isRequired: false,
|
|
268
|
+
transformFunction: null
|
|
269
|
+
},
|
|
270
|
+
separatorKey: {
|
|
271
|
+
classPropertyName: "separatorKey",
|
|
272
|
+
publicName: "separatorKey",
|
|
273
|
+
isSignal: true,
|
|
274
|
+
isRequired: false,
|
|
275
|
+
transformFunction: null
|
|
276
|
+
},
|
|
277
|
+
placeholder: {
|
|
278
|
+
classPropertyName: "placeholder",
|
|
279
|
+
publicName: "placeholder",
|
|
280
|
+
isSignal: false,
|
|
281
|
+
isRequired: false,
|
|
282
|
+
transformFunction: null
|
|
283
|
+
},
|
|
284
|
+
value: {
|
|
285
|
+
classPropertyName: "value",
|
|
286
|
+
publicName: "value",
|
|
287
|
+
isSignal: false,
|
|
288
|
+
isRequired: false,
|
|
289
|
+
transformFunction: null
|
|
290
|
+
},
|
|
291
|
+
required: {
|
|
292
|
+
classPropertyName: "required",
|
|
293
|
+
publicName: "required",
|
|
294
|
+
isSignal: false,
|
|
295
|
+
isRequired: false,
|
|
296
|
+
transformFunction: null
|
|
297
|
+
},
|
|
298
|
+
disabled: {
|
|
299
|
+
classPropertyName: "disabled",
|
|
300
|
+
publicName: "disabled",
|
|
301
|
+
isSignal: false,
|
|
302
|
+
isRequired: false,
|
|
303
|
+
transformFunction: null
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
host: { properties: { "attr.id": "id" } },
|
|
307
|
+
providers: [{
|
|
308
|
+
provide: MatFormFieldControl,
|
|
309
|
+
useExisting: CmatChipInputComponent
|
|
310
|
+
}],
|
|
311
|
+
viewQueries: [{
|
|
312
|
+
propertyName: "_inputElementRef",
|
|
313
|
+
first: true,
|
|
314
|
+
predicate: ["input"],
|
|
315
|
+
descendants: true,
|
|
316
|
+
isSignal: true
|
|
317
|
+
}, {
|
|
318
|
+
propertyName: "_autoTrigger",
|
|
319
|
+
first: true,
|
|
320
|
+
predicate: ["autoTrigger"],
|
|
321
|
+
descendants: true,
|
|
322
|
+
isSignal: true
|
|
323
|
+
}],
|
|
324
|
+
exportAs: ["cmatChipInput"],
|
|
325
|
+
ngImport: i0,
|
|
326
|
+
template: "<mat-chip-grid #chipList class=\"items-center\" (focusin)=\"onFocusIn($event)\" (focusout)=\"onFocusOut($event)\">\r\n @for (option of selectedOptions(); track option) {\r\n <mat-chip-row (removed)=\"onRemove(option)\" (click)=\"$event.stopPropagation()\">\r\n {{ option }}\r\n <button matChipRemove class=\"print:hidden\" (click)=\"$event.stopPropagation()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_solid:cancel'\"></mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n\r\n @if (hasAutocomplete()) {\r\n <input #input #autoTrigger=\"matAutocompleteTrigger\" matInput [formControl]=\"inputControl\" [placeholder]=\"placeholder?placeholder:'开始选择...'\"\r\n [matAutocomplete]=\"autoComplete\" [required]=\"required\" [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"onAdd($event)\" />\r\n <mat-autocomplete #autoComplete=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\"\r\n (optionActivated)=\"onActivated($event)\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n } @else {\r\n <input #input [formControl]=\"inputControl\" [placeholder]=\"placeholder?placeholder:'开始填写...'\" [matChipInputFor]=\"chipList\"\r\n [required]=\"required\" [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"onAdd($event)\" />\r\n }\r\n</mat-chip-grid>",
|
|
327
|
+
dependencies: [
|
|
328
|
+
{
|
|
329
|
+
kind: "ngmodule",
|
|
330
|
+
type: MatChipsModule
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
kind: "component",
|
|
334
|
+
type: i1.MatChipGrid,
|
|
335
|
+
selector: "mat-chip-grid",
|
|
336
|
+
inputs: [
|
|
337
|
+
"disabled",
|
|
338
|
+
"placeholder",
|
|
339
|
+
"required",
|
|
340
|
+
"value",
|
|
341
|
+
"errorStateMatcher"
|
|
342
|
+
],
|
|
343
|
+
outputs: ["change", "valueChange"]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
kind: "directive",
|
|
347
|
+
type: i1.MatChipInput,
|
|
348
|
+
selector: "input[matChipInputFor]",
|
|
349
|
+
inputs: [
|
|
350
|
+
"matChipInputFor",
|
|
351
|
+
"matChipInputAddOnBlur",
|
|
352
|
+
"matChipInputSeparatorKeyCodes",
|
|
353
|
+
"placeholder",
|
|
354
|
+
"id",
|
|
355
|
+
"disabled",
|
|
356
|
+
"readonly",
|
|
357
|
+
"matChipInputDisabledInteractive"
|
|
358
|
+
],
|
|
359
|
+
outputs: ["matChipInputTokenEnd"],
|
|
360
|
+
exportAs: ["matChipInput", "matChipInputFor"]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
kind: "directive",
|
|
364
|
+
type: i1.MatChipRemove,
|
|
365
|
+
selector: "[matChipRemove]"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
kind: "component",
|
|
369
|
+
type: i1.MatChipRow,
|
|
370
|
+
selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]",
|
|
371
|
+
inputs: ["editable"],
|
|
372
|
+
outputs: ["edited"]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
kind: "ngmodule",
|
|
376
|
+
type: MatInputModule
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
kind: "directive",
|
|
380
|
+
type: i2.MatInput,
|
|
381
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
382
|
+
inputs: [
|
|
383
|
+
"disabled",
|
|
384
|
+
"id",
|
|
385
|
+
"placeholder",
|
|
386
|
+
"name",
|
|
387
|
+
"required",
|
|
388
|
+
"type",
|
|
389
|
+
"errorStateMatcher",
|
|
390
|
+
"aria-describedby",
|
|
391
|
+
"value",
|
|
392
|
+
"readonly",
|
|
393
|
+
"disabledInteractive"
|
|
394
|
+
],
|
|
395
|
+
exportAs: ["matInput"]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
kind: "ngmodule",
|
|
399
|
+
type: MatAutocompleteModule
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
kind: "component",
|
|
403
|
+
type: i3.MatAutocomplete,
|
|
404
|
+
selector: "mat-autocomplete",
|
|
405
|
+
inputs: [
|
|
406
|
+
"aria-label",
|
|
407
|
+
"aria-labelledby",
|
|
408
|
+
"displayWith",
|
|
409
|
+
"autoActiveFirstOption",
|
|
410
|
+
"autoSelectActiveOption",
|
|
411
|
+
"requireSelection",
|
|
412
|
+
"panelWidth",
|
|
413
|
+
"disableRipple",
|
|
414
|
+
"class",
|
|
415
|
+
"hideSingleSelectionIndicator"
|
|
416
|
+
],
|
|
417
|
+
outputs: [
|
|
418
|
+
"optionSelected",
|
|
419
|
+
"opened",
|
|
420
|
+
"closed",
|
|
421
|
+
"optionActivated"
|
|
422
|
+
],
|
|
423
|
+
exportAs: ["matAutocomplete"]
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
kind: "component",
|
|
427
|
+
type: i3.MatOption,
|
|
428
|
+
selector: "mat-option",
|
|
429
|
+
inputs: [
|
|
430
|
+
"value",
|
|
431
|
+
"id",
|
|
432
|
+
"disabled"
|
|
433
|
+
],
|
|
434
|
+
outputs: ["onSelectionChange"],
|
|
435
|
+
exportAs: ["matOption"]
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
kind: "directive",
|
|
439
|
+
type: i3.MatAutocompleteTrigger,
|
|
440
|
+
selector: "input[matAutocomplete], textarea[matAutocomplete]",
|
|
441
|
+
inputs: [
|
|
442
|
+
"matAutocomplete",
|
|
443
|
+
"matAutocompletePosition",
|
|
444
|
+
"matAutocompleteConnectedTo",
|
|
445
|
+
"autocomplete",
|
|
446
|
+
"matAutocompleteDisabled"
|
|
447
|
+
],
|
|
448
|
+
exportAs: ["matAutocompleteTrigger"]
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
kind: "ngmodule",
|
|
452
|
+
type: MatIconModule
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
kind: "component",
|
|
456
|
+
type: i4.MatIcon,
|
|
457
|
+
selector: "mat-icon",
|
|
458
|
+
inputs: [
|
|
459
|
+
"color",
|
|
460
|
+
"inline",
|
|
461
|
+
"svgIcon",
|
|
462
|
+
"fontSet",
|
|
463
|
+
"fontIcon"
|
|
464
|
+
],
|
|
465
|
+
exportAs: ["matIcon"]
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
kind: "ngmodule",
|
|
469
|
+
type: ReactiveFormsModule
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
kind: "directive",
|
|
473
|
+
type: i5.DefaultValueAccessor,
|
|
474
|
+
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]"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
kind: "directive",
|
|
478
|
+
type: i5.NgControlStatus,
|
|
479
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
kind: "directive",
|
|
483
|
+
type: i5.RequiredValidator,
|
|
484
|
+
selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
|
|
485
|
+
inputs: ["required"]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
kind: "directive",
|
|
489
|
+
type: i5.FormControlDirective,
|
|
490
|
+
selector: "[formControl]",
|
|
491
|
+
inputs: [
|
|
492
|
+
"formControl",
|
|
493
|
+
"disabled",
|
|
494
|
+
"ngModel"
|
|
495
|
+
],
|
|
496
|
+
outputs: ["ngModelChange"],
|
|
497
|
+
exportAs: ["ngForm"]
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
501
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
506
|
+
minVersion: "12.0.0",
|
|
507
|
+
version: "22.2.3",
|
|
508
|
+
ngImport: i0,
|
|
509
|
+
type: CmatChipInputComponent,
|
|
510
|
+
decorators: [{
|
|
511
|
+
type: Component,
|
|
512
|
+
args: [{
|
|
513
|
+
selector: "cmat-chip-input",
|
|
514
|
+
providers: [{
|
|
515
|
+
provide: MatFormFieldControl,
|
|
516
|
+
useExisting: CmatChipInputComponent
|
|
517
|
+
}],
|
|
518
|
+
exportAs: "cmatChipInput",
|
|
519
|
+
imports: [
|
|
520
|
+
MatChipsModule,
|
|
521
|
+
MatInputModule,
|
|
522
|
+
MatAutocompleteModule,
|
|
523
|
+
MatIconModule,
|
|
524
|
+
ReactiveFormsModule
|
|
525
|
+
],
|
|
526
|
+
encapsulation: ViewEncapsulation.None,
|
|
527
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
528
|
+
host: { "[attr.id]": "id" },
|
|
529
|
+
template: "<mat-chip-grid #chipList class=\"items-center\" (focusin)=\"onFocusIn($event)\" (focusout)=\"onFocusOut($event)\">\r\n @for (option of selectedOptions(); track option) {\r\n <mat-chip-row (removed)=\"onRemove(option)\" (click)=\"$event.stopPropagation()\">\r\n {{ option }}\r\n <button matChipRemove class=\"print:hidden\" (click)=\"$event.stopPropagation()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_solid:cancel'\"></mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n\r\n @if (hasAutocomplete()) {\r\n <input #input #autoTrigger=\"matAutocompleteTrigger\" matInput [formControl]=\"inputControl\" [placeholder]=\"placeholder?placeholder:'开始选择...'\"\r\n [matAutocomplete]=\"autoComplete\" [required]=\"required\" [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"onAdd($event)\" />\r\n <mat-autocomplete #autoComplete=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\"\r\n (optionActivated)=\"onActivated($event)\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n } @else {\r\n <input #input [formControl]=\"inputControl\" [placeholder]=\"placeholder?placeholder:'开始填写...'\" [matChipInputFor]=\"chipList\"\r\n [required]=\"required\" [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"onAdd($event)\" />\r\n }\r\n</mat-chip-grid>"
|
|
530
|
+
}]
|
|
531
|
+
}],
|
|
532
|
+
ctorParameters: () => [],
|
|
533
|
+
propDecorators: {
|
|
534
|
+
selectableOptions: [{
|
|
535
|
+
type: i0.Input,
|
|
536
|
+
args: [{
|
|
537
|
+
isSignal: true,
|
|
538
|
+
alias: "selectableOptions",
|
|
539
|
+
required: false
|
|
540
|
+
}]
|
|
541
|
+
}],
|
|
542
|
+
hasAutocomplete: [{
|
|
543
|
+
type: i0.Input,
|
|
544
|
+
args: [{
|
|
545
|
+
isSignal: true,
|
|
546
|
+
alias: "hasAutocomplete",
|
|
547
|
+
required: false
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
outputIsString: [{
|
|
551
|
+
type: i0.Input,
|
|
552
|
+
args: [{
|
|
553
|
+
isSignal: true,
|
|
554
|
+
alias: "outputIsString",
|
|
555
|
+
required: false
|
|
556
|
+
}]
|
|
557
|
+
}],
|
|
558
|
+
separatorKey: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "separatorKey",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
_inputElementRef: [{
|
|
567
|
+
type: i0.ViewChild,
|
|
568
|
+
args: ["input", { isSignal: true }]
|
|
569
|
+
}],
|
|
570
|
+
_autoTrigger: [{
|
|
571
|
+
type: i0.ViewChild,
|
|
572
|
+
args: ["autoTrigger", { isSignal: true }]
|
|
573
|
+
}],
|
|
574
|
+
placeholder: [{ type: Input }],
|
|
575
|
+
value: [{ type: Input }],
|
|
576
|
+
required: [{ type: Input }],
|
|
577
|
+
disabled: [{ type: Input }]
|
|
578
|
+
}
|
|
579
|
+
});
|
|
336
580
|
export { CmatChipInputComponent };
|
|
337
|
-
|
|
581
|
+
|
|
582
|
+
//# sourceMappingURL=cmat-components-chip-input.mjs.map
|