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,845 +1,1283 @@
|
|
|
1
|
-
import { coerceBooleanProperty } from
|
|
2
|
-
import * as i4 from
|
|
3
|
-
import { CommonModule } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import {
|
|
6
|
-
import { takeUntilDestroyed } from
|
|
7
|
-
import * as i3 from
|
|
8
|
-
import { FormControl,
|
|
9
|
-
import * as i1 from
|
|
10
|
-
import {
|
|
11
|
-
import * as i5 from
|
|
12
|
-
import { MatIconModule } from
|
|
13
|
-
import * as i7 from
|
|
14
|
-
import { MatInputModule } from
|
|
15
|
-
import * as i2 from
|
|
16
|
-
import { MatOption, MatSelectModule } from
|
|
17
|
-
import * as i8 from
|
|
18
|
-
import { MatSort, MatSortModule } from
|
|
19
|
-
import * as i6 from
|
|
20
|
-
import { MatTable, MatTableModule } from
|
|
21
|
-
import { CmatSelectSearchComponent } from
|
|
22
|
-
import { CmatDigitOnlyDirective } from
|
|
23
|
-
import { isArray, isNil, isNumber, isString } from
|
|
24
|
-
import { Subject,
|
|
25
|
-
|
|
26
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
1
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
|
+
import * as i4 from "@angular/common";
|
|
3
|
+
import { CommonModule } from "@angular/common";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, HostListener, Input, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
6
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
7
|
+
import * as i3 from "@angular/forms";
|
|
8
|
+
import { FormControl, FormGroup, NgControl, ReactiveFormsModule } from "@angular/forms";
|
|
9
|
+
import * as i1 from "@angular/material/form-field";
|
|
10
|
+
import { MatFormFieldControl, MatFormFieldModule } from "@angular/material/form-field";
|
|
11
|
+
import * as i5 from "@angular/material/icon";
|
|
12
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
13
|
+
import * as i7 from "@angular/material/input";
|
|
14
|
+
import { MatInputModule } from "@angular/material/input";
|
|
15
|
+
import * as i2 from "@angular/material/select";
|
|
16
|
+
import { MatOption, MatSelectModule } from "@angular/material/select";
|
|
17
|
+
import * as i8 from "@angular/material/sort";
|
|
18
|
+
import { MatSort, MatSortModule } from "@angular/material/sort";
|
|
19
|
+
import * as i6 from "@angular/material/table";
|
|
20
|
+
import { MatTable, MatTableModule } from "@angular/material/table";
|
|
21
|
+
import { CmatSelectSearchComponent } from "cmat/components/select-search";
|
|
22
|
+
import { CmatDigitOnlyDirective } from "cmat/directives/digit-only";
|
|
23
|
+
import { isArray, isNil, isNumber, isString } from "lodash-es";
|
|
24
|
+
import { Subject, debounceTime, merge } from "rxjs";
|
|
27
25
|
const MAX_SAFE_INTEGER = 9007199254740991;
|
|
28
26
|
let NEXT_ID = 0;
|
|
29
|
-
class CmatSelectTableComponent {
|
|
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
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent, descendants: true, isSignal: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "_matOptions", predicate: MatOption, descendants: true, isSignal: true }, { propertyName: "_matSelectSignal", first: true, predicate: ["componentSelect"], descendants: true, isSignal: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if (multiple()) {\r\n<mat-select #componentSelect multiple disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search \r\n [showNoFoundLabel]=\"showNoFoundLabel()\" \r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" \r\n [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{ getCellValue(row, columnKey) }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n \r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n} @else {\r\n<mat-select #componentSelect disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel()\" [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if (row.id === null) {\r\n <mat-option></mat-option>\r\n } @else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell [colSpan]=\"\r\n hasNullRow && row.id === null && $index === 1\r\n ? tableColumns().length\r\n : 1\r\n \" [ngStyle]=\"{\r\n display:\r\n hasNullRow && row.id === null && $index !== 1\r\n ? 'none'\r\n : '',\r\n }\">\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{\r\n hasNullRow && row.id === null && $index === 1\r\n ? \"\u7A7A\"\r\n : getCellValue(row, columnKey)\r\n }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0;pointer-events:auto}.cmat-select-search-table-panel .overall-search-toggle mat-icon{pointer-events:auto;-webkit-user-select:none;user-select:none}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "debounceTime", "optionsCount"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
}, template: "@if (multiple()) {\r\n<mat-select #componentSelect multiple disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search \r\n [showNoFoundLabel]=\"showNoFoundLabel()\" \r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" \r\n [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{ getCellValue(row, columnKey) }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n \r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n} @else {\r\n<mat-select #componentSelect disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel()\" [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if (row.id === null) {\r\n <mat-option></mat-option>\r\n } @else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell [colSpan]=\"\r\n hasNullRow && row.id === null && $index === 1\r\n ? tableColumns().length\r\n : 1\r\n \" [ngStyle]=\"{\r\n display:\r\n hasNullRow && row.id === null && $index !== 1\r\n ? 'none'\r\n : '',\r\n }\">\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{\r\n hasNullRow && row.id === null && $index === 1\r\n ? \"\u7A7A\"\r\n : getCellValue(row, columnKey)\r\n }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0;pointer-events:auto}.cmat-select-search-table-panel .overall-search-toggle mat-icon{pointer-events:auto;-webkit-user-select:none;user-select:none}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"] }]
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
27
|
+
var CmatSelectTableComponent = class CmatSelectTableComponent {
|
|
28
|
+
get focused() {
|
|
29
|
+
return this._focusedSignal();
|
|
30
|
+
}
|
|
31
|
+
get touched() {
|
|
32
|
+
return this._touchedSignal();
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
this.id = `cmat-select-table-${NEXT_ID++}`;
|
|
36
|
+
this.dataSource = input(...ngDevMode ? [void 0, { debugName: "dataSource" }] : /* istanbul ignore next */ []);
|
|
37
|
+
this.noEntriesFoundLabel = input("无结果", ...ngDevMode ? [{ debugName: "noEntriesFoundLabel" }] : /* istanbul ignore next */ []);
|
|
38
|
+
this.showNoFoundLabel = input(true, ...ngDevMode ? [{ debugName: "showNoFoundLabel" }] : /* istanbul ignore next */ []);
|
|
39
|
+
this.isPhone = input(false, ...ngDevMode ? [{ debugName: "isPhone" }] : /* istanbul ignore next */ []);
|
|
40
|
+
this.multiple = input(false, ...ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []);
|
|
41
|
+
this.overallSearchEnabled = input(true, ...ngDevMode ? [{ debugName: "overallSearchEnabled" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this.overallSearchVisible = input(...ngDevMode ? [void 0, { debugName: "overallSearchVisible" }] : /* istanbul ignore next */ []);
|
|
43
|
+
this.resetSortOnOpen = input(...ngDevMode ? [void 0, { debugName: "resetSortOnOpen" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this.resetFiltersOnOpen = input(...ngDevMode ? [void 0, { debugName: "resetFiltersOnOpen" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.customTriggerLabelFn = input(...ngDevMode ? [void 0, { debugName: "customTriggerLabelFn" }] : /* istanbul ignore next */ []);
|
|
46
|
+
this.triggerLabelSort = input(...ngDevMode ? [void 0, { debugName: "triggerLabelSort" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this.customTriggerLabelTemplate = input(...ngDevMode ? [void 0, { debugName: "customTriggerLabelTemplate" }] : /* istanbul ignore next */ []);
|
|
48
|
+
this.canNull = input(...ngDevMode ? [void 0, { debugName: "canNull" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.defaultSort = input(...ngDevMode ? [void 0, { debugName: "defaultSort" }] : /* istanbul ignore next */ []);
|
|
50
|
+
this.resetOptionAction = input(...ngDevMode ? [void 0, { debugName: "resetOptionAction" }] : /* istanbul ignore next */ []);
|
|
51
|
+
this.keyParam = input("id", ...ngDevMode ? [{ debugName: "keyParam" }] : /* istanbul ignore next */ []);
|
|
52
|
+
this.compareWith = input((o1, o2) => {
|
|
53
|
+
return o1 && o2 ? o1?.name === o2?.name && o1?.id === o2?.id : o1 === o2;
|
|
54
|
+
}, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.closed = output();
|
|
56
|
+
this._matSelectSearch = viewChild(CmatSelectSearchComponent, ...ngDevMode ? [{ debugName: "_matSelectSearch" }] : /* istanbul ignore next */ []);
|
|
57
|
+
this._sort = viewChild(MatSort, ...ngDevMode ? [{ debugName: "_sort" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this._table = viewChild(MatTable, ...ngDevMode ? [{ debugName: "_table" }] : /* istanbul ignore next */ []);
|
|
59
|
+
this._matOptions = viewChildren(MatOption, ...ngDevMode ? [{ debugName: "_matOptions" }] : /* istanbul ignore next */ []);
|
|
60
|
+
this._matSelectSignal = viewChild("componentSelect", ...ngDevMode ? [{ debugName: "_matSelectSignal" }] : /* istanbul ignore next */ []);
|
|
61
|
+
this.tableDataSource = signal([], ...ngDevMode ? [{ debugName: "tableDataSource" }] : /* istanbul ignore next */ []);
|
|
62
|
+
this.tableColumns = signal([], ...ngDevMode ? [{ debugName: "tableColumns" }] : /* istanbul ignore next */ []);
|
|
63
|
+
this._rowById = /* @__PURE__ */ new Map();
|
|
64
|
+
this._columnKeys = [];
|
|
65
|
+
this.completeRowList = signal([], ...ngDevMode ? [{ debugName: "completeRowList" }] : /* istanbul ignore next */ []);
|
|
66
|
+
this.overallSearchVisibleState = signal(false, ...ngDevMode ? [{ debugName: "overallSearchVisibleState" }] : /* istanbul ignore next */ []);
|
|
67
|
+
this.overallFilterControl = new FormControl("");
|
|
68
|
+
this.selectControl = new FormControl();
|
|
69
|
+
this.stateChanges = new Subject();
|
|
70
|
+
this._focusedSignal = signal(false, ...ngDevMode ? [{ debugName: "_focusedSignal" }] : /* istanbul ignore next */ []);
|
|
71
|
+
this._touchedSignal = signal(false, ...ngDevMode ? [{ debugName: "_touchedSignal" }] : /* istanbul ignore next */ []);
|
|
72
|
+
this._placeholderSignal = signal("", ...ngDevMode ? [{ debugName: "_placeholderSignal" }] : /* istanbul ignore next */ []);
|
|
73
|
+
this._disabledSignal = signal(false, ...ngDevMode ? [{ debugName: "_disabledSignal" }] : /* istanbul ignore next */ []);
|
|
74
|
+
this._requiredSignal = signal(false, ...ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []);
|
|
75
|
+
this.ngControl = inject(NgControl, {
|
|
76
|
+
optional: true,
|
|
77
|
+
self: true
|
|
78
|
+
});
|
|
79
|
+
this._destroyRef = inject(DestroyRef);
|
|
80
|
+
this._cdr = inject(ChangeDetectorRef);
|
|
81
|
+
this._initRunning = false;
|
|
82
|
+
this._rawValue = null;
|
|
83
|
+
this._resolvingFromDataSource = false;
|
|
84
|
+
this._nullRow = { id: null };
|
|
85
|
+
this._value = null;
|
|
86
|
+
this._triggerLabel = computed(() => this.customTriggerLabelFn()?.(this.completeRowList()) ?? this.simpleTriggerLabelFn(this.completeRowList()), ...ngDevMode ? [{ debugName: "_triggerLabel" }] : /* istanbul ignore next */ []);
|
|
87
|
+
this._onModelChange = () => {};
|
|
88
|
+
this._onTouchedChange = () => {};
|
|
89
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
90
|
+
this.tableColumnsMap = /* @__PURE__ */ new Map();
|
|
91
|
+
this._filterControls = new FormGroup({});
|
|
92
|
+
effect(() => {
|
|
93
|
+
const matSelect = this._matSelectSignal();
|
|
94
|
+
if (matSelect && !this._matSelect) {
|
|
95
|
+
this._matSelect = matSelect;
|
|
96
|
+
untracked(() => {
|
|
97
|
+
this._init(this.value);
|
|
98
|
+
});
|
|
99
|
+
this._matSelect.setDisabledState(this._disabledSignal());
|
|
100
|
+
this._setPanelClass();
|
|
101
|
+
} else if (matSelect && this._matSelect !== matSelect) {
|
|
102
|
+
this._matSelect = matSelect;
|
|
103
|
+
this._setPanelClass();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
effect(() => {
|
|
107
|
+
const ds = this.dataSource();
|
|
108
|
+
if (!ds || !isArray(ds.data) || ds.data.length === 0) return;
|
|
109
|
+
untracked(() => {
|
|
110
|
+
const columns = ds.columns;
|
|
111
|
+
const data = ds.data;
|
|
112
|
+
this._columnKeys = columns.map((column) => column.key);
|
|
113
|
+
this.tableDataSource.set([...data]);
|
|
114
|
+
if (this.addNullRow()) this.tableDataSource.update((value) => [this._nullRow, ...value]);
|
|
115
|
+
this.tableColumns.set(["_selection", ...this._columnKeys]);
|
|
116
|
+
this.tableColumnsMap.clear();
|
|
117
|
+
columns.forEach((column) => this.tableColumnsMap.set(column.key, column));
|
|
118
|
+
this._rowById.clear();
|
|
119
|
+
data.forEach((row) => {
|
|
120
|
+
const rowKey = row[this.keyParam()];
|
|
121
|
+
if (!isNil(rowKey)) this._rowById.set(rowKey, row);
|
|
122
|
+
});
|
|
123
|
+
if (this._matSelect) {
|
|
124
|
+
this._resolvingFromDataSource = true;
|
|
125
|
+
try {
|
|
126
|
+
this._init(this._rawValue);
|
|
127
|
+
} finally {
|
|
128
|
+
this._resolvingFromDataSource = false;
|
|
129
|
+
}
|
|
130
|
+
this.stateChanges.next();
|
|
131
|
+
Promise.resolve().then(() => this._cdr.detectChanges());
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
clickedOut() {
|
|
137
|
+
if (!this._matSelect?.panelOpen) {
|
|
138
|
+
this._focusedSignal.set(false);
|
|
139
|
+
this.stateChanges.next();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
ngAfterViewInit() {
|
|
143
|
+
const sortInstance = this._sort();
|
|
144
|
+
if (!sortInstance) return;
|
|
145
|
+
merge(...[
|
|
146
|
+
sortInstance.sortChange,
|
|
147
|
+
this._filterControls.valueChanges,
|
|
148
|
+
this.overallFilterControl.valueChanges
|
|
149
|
+
]).pipe(takeUntilDestroyed(this._destroyRef), debounceTime(300)).subscribe(() => {
|
|
150
|
+
const dataClone = [...(this.dataSource() ?? { data: [] }).data || []];
|
|
151
|
+
if (this.addNullRow()) dataClone.unshift(this._nullRow);
|
|
152
|
+
if (this.overallSearchEnabled() && this.overallSearchVisibleState()) this._applyOverallFilter(dataClone);
|
|
153
|
+
else this._applyColumnLevelFilters(dataClone);
|
|
154
|
+
const currentSort = this._sort();
|
|
155
|
+
const defaultSort = this.defaultSort();
|
|
156
|
+
if (currentSort && !currentSort.active && !isNil(defaultSort) && defaultSort.active) {
|
|
157
|
+
currentSort.active = defaultSort.active;
|
|
158
|
+
currentSort.direction = defaultSort.direction;
|
|
159
|
+
}
|
|
160
|
+
const sortedData = !currentSort?.active ? dataClone : this._sortData(dataClone, currentSort.active, currentSort.direction);
|
|
161
|
+
this.tableDataSource.set(sortedData);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
ngOnDestroy() {
|
|
165
|
+
this.stateChanges.complete();
|
|
166
|
+
}
|
|
167
|
+
get placeholder() {
|
|
168
|
+
return this._placeholderSignal();
|
|
169
|
+
}
|
|
170
|
+
set placeholder(value) {
|
|
171
|
+
this._placeholderSignal.set(value);
|
|
172
|
+
this.stateChanges.next();
|
|
173
|
+
}
|
|
174
|
+
get value() {
|
|
175
|
+
return this._value;
|
|
176
|
+
}
|
|
177
|
+
set value(value) {
|
|
178
|
+
if (value !== this.value) {
|
|
179
|
+
this._value = value;
|
|
180
|
+
this.stateChanges.next();
|
|
181
|
+
this._onModelChange(value);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
get empty() {
|
|
185
|
+
return !this._value;
|
|
186
|
+
}
|
|
187
|
+
get errorState() {
|
|
188
|
+
if (this.ngControl == null) return false;
|
|
189
|
+
return (this.touched && this.ngControl?.invalid) ?? false;
|
|
190
|
+
}
|
|
191
|
+
get shouldLabelFloat() {
|
|
192
|
+
return this._focusedSignal() || !this.empty;
|
|
193
|
+
}
|
|
194
|
+
get required() {
|
|
195
|
+
return this._requiredSignal();
|
|
196
|
+
}
|
|
197
|
+
set required(value) {
|
|
198
|
+
this._requiredSignal.set(coerceBooleanProperty(value));
|
|
199
|
+
this.stateChanges.next();
|
|
200
|
+
}
|
|
201
|
+
get disabled() {
|
|
202
|
+
if (!isNil(this.ngControl?.disabled)) return this.ngControl.disabled;
|
|
203
|
+
return this._disabledSignal();
|
|
204
|
+
}
|
|
205
|
+
set disabled(value) {
|
|
206
|
+
const isDisabled = coerceBooleanProperty(value);
|
|
207
|
+
this._disabledSignal.set(isDisabled);
|
|
208
|
+
if (this._focusedSignal() && isDisabled) {
|
|
209
|
+
this._focusedSignal.set(false);
|
|
210
|
+
this.stateChanges.next();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
registerOnChange(fn) {
|
|
214
|
+
this._onModelChange = fn;
|
|
215
|
+
}
|
|
216
|
+
registerOnTouched(fn) {
|
|
217
|
+
this._onTouchedChange = fn;
|
|
218
|
+
this._matSelect?.registerOnTouched(fn);
|
|
219
|
+
}
|
|
220
|
+
setDisabledState(isDisabled) {
|
|
221
|
+
this._disabledSignal.set(isDisabled);
|
|
222
|
+
this._matSelect?.setDisabledState(isDisabled);
|
|
223
|
+
}
|
|
224
|
+
setDescribedByIds(ids) {
|
|
225
|
+
this._matSelect?.setDescribedByIds(ids);
|
|
226
|
+
}
|
|
227
|
+
onContainerClick() {
|
|
228
|
+
if (!this._focusedSignal()) this._matSelect?.focus();
|
|
229
|
+
}
|
|
230
|
+
onFocusIn() {
|
|
231
|
+
if (!this._focusedSignal()) {
|
|
232
|
+
this._focusedSignal.set(true);
|
|
233
|
+
this.stateChanges.next();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
onFocusOut(event) {
|
|
237
|
+
const matSelectPanel = this._matSelect?.panel?.nativeElement;
|
|
238
|
+
if (matSelectPanel && !matSelectPanel.contains(event.relatedTarget)) {
|
|
239
|
+
this._touchedSignal.set(true);
|
|
240
|
+
this._focusedSignal.set(false);
|
|
241
|
+
this._onTouchedChange();
|
|
242
|
+
this.stateChanges.next();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
writeValue(value) {
|
|
246
|
+
if (!this._resolvingFromDataSource) this._rawValue = value;
|
|
247
|
+
this._init(value);
|
|
248
|
+
}
|
|
249
|
+
ngOnChanges(changes) {
|
|
250
|
+
if (!isNil(changes.resetFiltersOnOpen) && changes.resetFiltersOnOpen.currentValue !== false) this._resetFilters();
|
|
251
|
+
}
|
|
252
|
+
emulateMatOptionClick(event) {
|
|
253
|
+
if (!(event.target instanceof HTMLElement)) return;
|
|
254
|
+
let rowElement = event.target;
|
|
255
|
+
while (rowElement != null && rowElement instanceof HTMLElement && rowElement.tagName.toLowerCase() !== "tr") rowElement = rowElement.parentElement;
|
|
256
|
+
if (rowElement === null) return;
|
|
257
|
+
const childOption = rowElement.querySelector("mat-option");
|
|
258
|
+
if (!childOption) return;
|
|
259
|
+
if (event.target.tagName.toLowerCase() != "mat-pseudo-checkbox") childOption.click();
|
|
260
|
+
const option = this._getMatOptionById(childOption.id);
|
|
261
|
+
if (!option) return;
|
|
262
|
+
const multiple = this.multiple();
|
|
263
|
+
if (multiple && this._matSelect.panelOpen) {
|
|
264
|
+
this._updateCompleteRowList(option.value, option.selected);
|
|
265
|
+
this.completeRowList.set([...this.completeRowList()]);
|
|
266
|
+
if (this.selectControl) this.selectControl.setValue([...this.completeRowList()], { emitEvent: false });
|
|
267
|
+
}
|
|
268
|
+
if (!multiple) {
|
|
269
|
+
const newRow = option.value ? [option.value] : [];
|
|
270
|
+
this.completeRowList.set(newRow);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
openedChange(opened) {
|
|
274
|
+
const overallSearchEnabled = this.overallSearchEnabled();
|
|
275
|
+
if (this.resetFiltersOnOpen() !== false || !this._matOptions().length && overallSearchEnabled || overallSearchEnabled && this._matOptions().length === 1) this._resetFilters();
|
|
276
|
+
this.overallSearchVisibleState.set(!!this.overallSearchVisible());
|
|
277
|
+
if (this.resetSortOnOpen() !== false) {
|
|
278
|
+
const sortInstance = this._sort();
|
|
279
|
+
if (sortInstance) sortInstance.sort({
|
|
280
|
+
id: "",
|
|
281
|
+
start: "asc",
|
|
282
|
+
disableClear: false
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
if (!opened) {
|
|
286
|
+
this.value = this._getCommittedValue();
|
|
287
|
+
if (this.value === null) {
|
|
288
|
+
this.completeRowList.set([]);
|
|
289
|
+
this._checkAndResetSelection();
|
|
290
|
+
}
|
|
291
|
+
this._syncMatSelectValue(this.value);
|
|
292
|
+
this.closed.emit(!opened);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const tableInstance = this._table();
|
|
296
|
+
if (tableInstance) {
|
|
297
|
+
const table = tableInstance;
|
|
298
|
+
table._headerRowDefChanged = true;
|
|
299
|
+
}
|
|
300
|
+
setTimeout(() => this._expandPanelForTableRows(), 1);
|
|
301
|
+
}
|
|
302
|
+
filterFormControl(key) {
|
|
303
|
+
if (!this._filterControls.contains(key)) this._filterControls.registerControl(key, new FormControl(""));
|
|
304
|
+
return this._filterControls.get(key);
|
|
305
|
+
}
|
|
306
|
+
simpleTriggerLabelFn(value) {
|
|
307
|
+
return this._getTriggerRows(value).map((row) => this._resolveTriggerLabel(row)).join(", ");
|
|
308
|
+
}
|
|
309
|
+
toggleOverallSearch() {
|
|
310
|
+
this.overallSearchVisibleState.update((value) => !value);
|
|
311
|
+
this._resetFilters();
|
|
312
|
+
if (this.overallSearchVisibleState()) {
|
|
313
|
+
const searchInstance = this._matSelectSearch();
|
|
314
|
+
if (searchInstance) setTimeout(() => searchInstance.focus());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
addNullRow() {
|
|
318
|
+
return !this.multiple() && (this.canNull() ?? false);
|
|
319
|
+
}
|
|
320
|
+
get hasNullRow() {
|
|
321
|
+
return this.addNullRow();
|
|
322
|
+
}
|
|
323
|
+
_init(value) {
|
|
324
|
+
if (this._initRunning) return;
|
|
325
|
+
this._initRunning = true;
|
|
326
|
+
try {
|
|
327
|
+
const list = [];
|
|
328
|
+
if (value) {
|
|
329
|
+
const multiple = this.multiple();
|
|
330
|
+
if (multiple && Array.isArray(value)) value.forEach((v) => this._updateCompleteRowList(v, true, list));
|
|
331
|
+
else if (!multiple) this._updateCompleteRowList(value, true, list);
|
|
332
|
+
}
|
|
333
|
+
this.completeRowList.set(list);
|
|
334
|
+
this._value = this.completeRowList().length > 0 ? [...this.completeRowList()] : value;
|
|
335
|
+
if (this._matSelect) this._matSelect.writeValue(this._value);
|
|
336
|
+
if (this.selectControl) {
|
|
337
|
+
const origOnChange = this._matSelect?._onChange;
|
|
338
|
+
if (this._matSelect) this._matSelect._onChange = () => {};
|
|
339
|
+
try {
|
|
340
|
+
this.selectControl.setValue(this.value, { emitEvent: false });
|
|
341
|
+
} finally {
|
|
342
|
+
if (this._matSelect && origOnChange) this._matSelect._onChange = origOnChange;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (this.completeRowList().length > 0) this._onModelChange(this._value);
|
|
346
|
+
} finally {
|
|
347
|
+
this._initRunning = false;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
_updateCompleteRowList(value, selected, list = this.completeRowList()) {
|
|
351
|
+
if (isNil(value)) return;
|
|
352
|
+
if (selected) {
|
|
353
|
+
const keyParam = this.keyParam();
|
|
354
|
+
const rowKey = value[keyParam];
|
|
355
|
+
if (isNil(rowKey)) return;
|
|
356
|
+
const row = this._rowById.get(rowKey);
|
|
357
|
+
if (!row) return;
|
|
358
|
+
if (!list.some((item) => item[keyParam] === row[keyParam])) list.push(row);
|
|
359
|
+
} else {
|
|
360
|
+
const keyParam = this.keyParam();
|
|
361
|
+
const keyValue = value[keyParam];
|
|
362
|
+
const rowIndex = list.findIndex((i) => i[keyParam] === keyValue);
|
|
363
|
+
if (rowIndex > -1) {
|
|
364
|
+
list.splice(rowIndex, 1);
|
|
365
|
+
if (list === this.completeRowList()) this.completeRowList.set([...list]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
_applyColumnLevelFilters(data) {
|
|
370
|
+
this.filteredOutRows = {};
|
|
371
|
+
const filters = {};
|
|
372
|
+
Object.keys(this._filterControls.controls).filter((key) => {
|
|
373
|
+
const column = this.tableColumnsMap.get(key);
|
|
374
|
+
return !isNil(column?.filter) && column.filter.enabled !== false;
|
|
375
|
+
}).filter((key) => {
|
|
376
|
+
const value = this._filterControls.get(key)?.value;
|
|
377
|
+
return !isNil(value) && (isArray(value) && value.length > 0 || typeof value === "string" && value.trim().length > 0 || typeof value === "number" && `${value}`.trim().length > 0);
|
|
378
|
+
}).forEach((key) => {
|
|
379
|
+
const column = this.tableColumnsMap.get(key);
|
|
380
|
+
const filterControl = this._filterControls.get(key);
|
|
381
|
+
filters[key] = {
|
|
382
|
+
filter: column?.filter,
|
|
383
|
+
value: filterControl?.value
|
|
384
|
+
};
|
|
385
|
+
});
|
|
386
|
+
const filterKeys = Object.keys(filters);
|
|
387
|
+
for (let i = data.length - 1; i >= 0; i--) for (let k = 0; k < filterKeys.length; k++) {
|
|
388
|
+
const filterKey = filterKeys[k];
|
|
389
|
+
const row = data[i];
|
|
390
|
+
const filter = filters[filterKey];
|
|
391
|
+
if (isNil(row)) {
|
|
392
|
+
this._removeFilteredRow(data, i);
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
395
|
+
if (!this._matchesColumnFilter(row, filterKey, filter)) {
|
|
396
|
+
this._removeFilteredRow(data, i);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
_applyOverallFilter(data) {
|
|
402
|
+
this.filteredOutRows = {};
|
|
403
|
+
if (isNil(this.overallFilterControl.value)) return;
|
|
404
|
+
const filterValueLC = (this.overallFilterControl.value ?? "").toLowerCase();
|
|
405
|
+
if (filterValueLC.trim().length === 0) return;
|
|
406
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
407
|
+
const row = data[i];
|
|
408
|
+
let rowShouldBeFiltered = true;
|
|
409
|
+
const rowKeys = this._columnKeys;
|
|
410
|
+
for (let j = rowKeys.length - 1; j >= 0; j--) {
|
|
411
|
+
const cellValue = row[rowKeys[j]];
|
|
412
|
+
if (isNil(cellValue)) continue;
|
|
413
|
+
if ((typeof cellValue === "string" ? cellValue.toLowerCase() : typeof cellValue === "number" || typeof cellValue === "boolean" || typeof cellValue === "bigint" ? String(cellValue).toLowerCase() : "").includes(filterValueLC)) {
|
|
414
|
+
rowShouldBeFiltered = false;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (rowShouldBeFiltered) this._removeFilteredRow(data, i);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
_resetFilters() {
|
|
422
|
+
this.overallFilterControl.setValue("");
|
|
423
|
+
Object.keys(this._filterControls.controls).forEach((key) => this._filterControls.get(key)?.setValue(""));
|
|
424
|
+
}
|
|
425
|
+
_sortingDataAccessor(data, active) {
|
|
426
|
+
const value = data[active];
|
|
427
|
+
if (isNumber(value)) {
|
|
428
|
+
const numberValue = Number(value);
|
|
429
|
+
return numberValue < MAX_SAFE_INTEGER ? numberValue : value;
|
|
430
|
+
}
|
|
431
|
+
return value;
|
|
432
|
+
}
|
|
433
|
+
_sortData(data, active, direction) {
|
|
434
|
+
if (!active || direction === "") return data;
|
|
435
|
+
return data.sort((a, b) => {
|
|
436
|
+
let aValue = this._sortingDataAccessor(a, active);
|
|
437
|
+
let bValue = this._sortingDataAccessor(b, active);
|
|
438
|
+
if (a.id === null) return -1;
|
|
439
|
+
else if (b.id === null) return 1;
|
|
440
|
+
if (aValue === bValue) return 0;
|
|
441
|
+
if (isNil(aValue) && !isNil(bValue)) return -1;
|
|
442
|
+
else if (!isNil(aValue) && isNil(bValue)) return 1;
|
|
443
|
+
if (aValue instanceof Date) aValue = aValue.getTime();
|
|
444
|
+
if (bValue instanceof Date) bValue = bValue.getTime();
|
|
445
|
+
if (isString(aValue) && isString(bValue)) return aValue.localeCompare(bValue) * (direction === "asc" ? 1 : -1);
|
|
446
|
+
aValue = isNaN(aValue) ? `${aValue}` : +aValue;
|
|
447
|
+
bValue = isNaN(bValue) ? `${bValue}` : +bValue;
|
|
448
|
+
if (isString(aValue) && isNumber(bValue)) return 1 * (direction === "asc" ? 1 : -1);
|
|
449
|
+
if (isNumber(aValue) && isString(bValue)) return -1 * (direction === "asc" ? 1 : -1);
|
|
450
|
+
return (aValue > bValue ? 1 : -1) * (direction === "asc" ? 1 : -1);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
_checkAndResetSelection() {
|
|
454
|
+
const resetOptionAction = this.resetOptionAction();
|
|
455
|
+
if (this._matSelect.value && isArray(this._matSelect.value) && this._matSelect.value.length < 1 && !isNil(resetOptionAction)) resetOptionAction();
|
|
456
|
+
}
|
|
457
|
+
_matchesColumnFilter(row, filterKey, filter) {
|
|
458
|
+
const cellValue = row[filterKey];
|
|
459
|
+
if (isNil(cellValue)) return false;
|
|
460
|
+
const columnFilter = filter.filter;
|
|
461
|
+
const comparator = columnFilter?.comparator;
|
|
462
|
+
const filterValue = filter.value;
|
|
463
|
+
let normalizedFilterValue;
|
|
464
|
+
if (columnFilter?.type === "number") normalizedFilterValue = Number(filterValue);
|
|
465
|
+
else if (filterValue === null || filterValue === void 0) normalizedFilterValue = "";
|
|
466
|
+
else if (typeof filterValue === "object") normalizedFilterValue = "";
|
|
467
|
+
else normalizedFilterValue = filterValue;
|
|
468
|
+
if (typeof columnFilter?.comparatorFn === "function") return columnFilter.comparatorFn.call(null, cellValue, normalizedFilterValue, row);
|
|
469
|
+
if (isNil(comparator) || comparator === "equals") return normalizedFilterValue === cellValue;
|
|
470
|
+
if (typeof cellValue !== "string" || typeof normalizedFilterValue !== "string") return false;
|
|
471
|
+
const cellValueLC = cellValue.toLowerCase();
|
|
472
|
+
const filterValueLC = normalizedFilterValue.toLowerCase();
|
|
473
|
+
if (isNil(comparator) || comparator === "equalsIgnoreCase") return filterValueLC === cellValueLC;
|
|
474
|
+
if (comparator === "contains") return cellValue.includes(normalizedFilterValue);
|
|
475
|
+
if (comparator === "containsIgnoreCase") return cellValueLC.includes(filterValueLC);
|
|
476
|
+
if (comparator === "startsWith") return cellValue.startsWith(normalizedFilterValue);
|
|
477
|
+
if (comparator === "startsWithIgnoreCase") return cellValueLC.startsWith(filterValueLC);
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
_getMatOptionById(id) {
|
|
481
|
+
return this._matOptions().find((option) => option.id === id);
|
|
482
|
+
}
|
|
483
|
+
getFilterContext(column) {
|
|
484
|
+
return { column };
|
|
485
|
+
}
|
|
486
|
+
getCellValue(row, key) {
|
|
487
|
+
return row[key];
|
|
488
|
+
}
|
|
489
|
+
_expandPanelForTableRows() {
|
|
490
|
+
let tableAdditionalHeight = 0;
|
|
491
|
+
const tableInstance = this._table();
|
|
492
|
+
if (!tableInstance) return;
|
|
493
|
+
tableInstance._getRenderedRows(tableInstance._headerRowOutlet).forEach((row) => tableAdditionalHeight += row.getBoundingClientRect().height);
|
|
494
|
+
tableInstance._getRenderedRows(tableInstance._footerRowOutlet).forEach((row) => tableAdditionalHeight += row.getBoundingClientRect().height);
|
|
495
|
+
const panelElement = this._matSelect?.panel?.nativeElement;
|
|
496
|
+
if (!panelElement) return;
|
|
497
|
+
const panelHeight = panelElement.getBoundingClientRect().height;
|
|
498
|
+
if (!isNaN(panelHeight)) panelElement.style.maxHeight = `${panelHeight + tableAdditionalHeight}px`;
|
|
499
|
+
}
|
|
500
|
+
_getCommittedValue() {
|
|
501
|
+
if (this.completeRowList().length === 0) return null;
|
|
502
|
+
return this.multiple() ? [...this.completeRowList()] : { ...this.completeRowList()[0] };
|
|
503
|
+
}
|
|
504
|
+
_syncMatSelectValue(value) {
|
|
505
|
+
this._matSelect.writeValue(value);
|
|
506
|
+
this._matSelect._onChange(value);
|
|
507
|
+
}
|
|
508
|
+
_removeFilteredRow(data, index) {
|
|
509
|
+
data.splice(index, 1).forEach((item) => this.filteredOutRows[`${item.id}`] = item);
|
|
510
|
+
}
|
|
511
|
+
_resolveTriggerLabel(row) {
|
|
512
|
+
if (isNil(row)) return "";
|
|
513
|
+
const customTriggerLabelTemplate = this.customTriggerLabelTemplate();
|
|
514
|
+
const template = typeof customTriggerLabelTemplate === "string" ? customTriggerLabelTemplate.trim() : "";
|
|
515
|
+
if (template.length === 0) return `${row.id}`;
|
|
516
|
+
const rowRecord = row;
|
|
517
|
+
let hasMatch = false;
|
|
518
|
+
const substitution = template.replace(/[$]{1}[{]{1}([^}]+)[}]{1}?/g, (_, key) => {
|
|
519
|
+
const value = rowRecord[String(key)];
|
|
520
|
+
if (isNil(value)) return "";
|
|
521
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean" && typeof value !== "bigint") return "";
|
|
522
|
+
hasMatch = true;
|
|
523
|
+
return String(value);
|
|
524
|
+
});
|
|
525
|
+
return hasMatch ? substitution.trim() : `${row.id}`;
|
|
526
|
+
}
|
|
527
|
+
_getTriggerRows(value) {
|
|
528
|
+
const triggerLabelSort = this.triggerLabelSort();
|
|
529
|
+
if (isNil(triggerLabelSort)) return value;
|
|
530
|
+
return this._sortData([...value], triggerLabelSort.active, triggerLabelSort.direction);
|
|
531
|
+
}
|
|
532
|
+
_setPanelClass() {
|
|
533
|
+
let panelClass = ["overflow-hidden", "cmat-select-search-table-panel"];
|
|
534
|
+
if (this._matSelect.panelClass) {
|
|
535
|
+
if (Array.isArray(this._matSelect.panelClass)) this._matSelect.panelClass = [this._matSelect.panelClass, ...panelClass];
|
|
536
|
+
else if (typeof this._matSelect.panelClass === "string") this._matSelect.panelClass = [this._matSelect.panelClass, ...panelClass];
|
|
537
|
+
else if (typeof this._matSelect.panelClass === "object") {
|
|
538
|
+
const panelClassObject = this._matSelect.panelClass;
|
|
539
|
+
panelClass.forEach((i) => {
|
|
540
|
+
panelClassObject[i] = true;
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
} else this._matSelect.panelClass = panelClass;
|
|
544
|
+
}
|
|
545
|
+
static {
|
|
546
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
547
|
+
minVersion: "12.0.0",
|
|
548
|
+
version: "22.2.3",
|
|
549
|
+
ngImport: i0,
|
|
550
|
+
type: CmatSelectTableComponent,
|
|
551
|
+
deps: [],
|
|
552
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
static {
|
|
556
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
557
|
+
minVersion: "17.0.0",
|
|
558
|
+
version: "22.2.3",
|
|
559
|
+
type: CmatSelectTableComponent,
|
|
560
|
+
isStandalone: true,
|
|
561
|
+
selector: "cmat-select-table",
|
|
562
|
+
inputs: {
|
|
563
|
+
dataSource: {
|
|
564
|
+
classPropertyName: "dataSource",
|
|
565
|
+
publicName: "dataSource",
|
|
566
|
+
isSignal: true,
|
|
567
|
+
isRequired: false,
|
|
568
|
+
transformFunction: null
|
|
569
|
+
},
|
|
570
|
+
noEntriesFoundLabel: {
|
|
571
|
+
classPropertyName: "noEntriesFoundLabel",
|
|
572
|
+
publicName: "noEntriesFoundLabel",
|
|
573
|
+
isSignal: true,
|
|
574
|
+
isRequired: false,
|
|
575
|
+
transformFunction: null
|
|
576
|
+
},
|
|
577
|
+
showNoFoundLabel: {
|
|
578
|
+
classPropertyName: "showNoFoundLabel",
|
|
579
|
+
publicName: "showNoFoundLabel",
|
|
580
|
+
isSignal: true,
|
|
581
|
+
isRequired: false,
|
|
582
|
+
transformFunction: null
|
|
583
|
+
},
|
|
584
|
+
isPhone: {
|
|
585
|
+
classPropertyName: "isPhone",
|
|
586
|
+
publicName: "isPhone",
|
|
587
|
+
isSignal: true,
|
|
588
|
+
isRequired: false,
|
|
589
|
+
transformFunction: null
|
|
590
|
+
},
|
|
591
|
+
multiple: {
|
|
592
|
+
classPropertyName: "multiple",
|
|
593
|
+
publicName: "multiple",
|
|
594
|
+
isSignal: true,
|
|
595
|
+
isRequired: false,
|
|
596
|
+
transformFunction: null
|
|
597
|
+
},
|
|
598
|
+
overallSearchEnabled: {
|
|
599
|
+
classPropertyName: "overallSearchEnabled",
|
|
600
|
+
publicName: "overallSearchEnabled",
|
|
601
|
+
isSignal: true,
|
|
602
|
+
isRequired: false,
|
|
603
|
+
transformFunction: null
|
|
604
|
+
},
|
|
605
|
+
overallSearchVisible: {
|
|
606
|
+
classPropertyName: "overallSearchVisible",
|
|
607
|
+
publicName: "overallSearchVisible",
|
|
608
|
+
isSignal: true,
|
|
609
|
+
isRequired: false,
|
|
610
|
+
transformFunction: null
|
|
611
|
+
},
|
|
612
|
+
resetSortOnOpen: {
|
|
613
|
+
classPropertyName: "resetSortOnOpen",
|
|
614
|
+
publicName: "resetSortOnOpen",
|
|
615
|
+
isSignal: true,
|
|
616
|
+
isRequired: false,
|
|
617
|
+
transformFunction: null
|
|
618
|
+
},
|
|
619
|
+
resetFiltersOnOpen: {
|
|
620
|
+
classPropertyName: "resetFiltersOnOpen",
|
|
621
|
+
publicName: "resetFiltersOnOpen",
|
|
622
|
+
isSignal: true,
|
|
623
|
+
isRequired: false,
|
|
624
|
+
transformFunction: null
|
|
625
|
+
},
|
|
626
|
+
customTriggerLabelFn: {
|
|
627
|
+
classPropertyName: "customTriggerLabelFn",
|
|
628
|
+
publicName: "customTriggerLabelFn",
|
|
629
|
+
isSignal: true,
|
|
630
|
+
isRequired: false,
|
|
631
|
+
transformFunction: null
|
|
632
|
+
},
|
|
633
|
+
triggerLabelSort: {
|
|
634
|
+
classPropertyName: "triggerLabelSort",
|
|
635
|
+
publicName: "triggerLabelSort",
|
|
636
|
+
isSignal: true,
|
|
637
|
+
isRequired: false,
|
|
638
|
+
transformFunction: null
|
|
639
|
+
},
|
|
640
|
+
customTriggerLabelTemplate: {
|
|
641
|
+
classPropertyName: "customTriggerLabelTemplate",
|
|
642
|
+
publicName: "customTriggerLabelTemplate",
|
|
643
|
+
isSignal: true,
|
|
644
|
+
isRequired: false,
|
|
645
|
+
transformFunction: null
|
|
646
|
+
},
|
|
647
|
+
canNull: {
|
|
648
|
+
classPropertyName: "canNull",
|
|
649
|
+
publicName: "canNull",
|
|
650
|
+
isSignal: true,
|
|
651
|
+
isRequired: false,
|
|
652
|
+
transformFunction: null
|
|
653
|
+
},
|
|
654
|
+
defaultSort: {
|
|
655
|
+
classPropertyName: "defaultSort",
|
|
656
|
+
publicName: "defaultSort",
|
|
657
|
+
isSignal: true,
|
|
658
|
+
isRequired: false,
|
|
659
|
+
transformFunction: null
|
|
660
|
+
},
|
|
661
|
+
resetOptionAction: {
|
|
662
|
+
classPropertyName: "resetOptionAction",
|
|
663
|
+
publicName: "resetOptionAction",
|
|
664
|
+
isSignal: true,
|
|
665
|
+
isRequired: false,
|
|
666
|
+
transformFunction: null
|
|
667
|
+
},
|
|
668
|
+
keyParam: {
|
|
669
|
+
classPropertyName: "keyParam",
|
|
670
|
+
publicName: "keyParam",
|
|
671
|
+
isSignal: true,
|
|
672
|
+
isRequired: false,
|
|
673
|
+
transformFunction: null
|
|
674
|
+
},
|
|
675
|
+
compareWith: {
|
|
676
|
+
classPropertyName: "compareWith",
|
|
677
|
+
publicName: "compareWith",
|
|
678
|
+
isSignal: true,
|
|
679
|
+
isRequired: false,
|
|
680
|
+
transformFunction: null
|
|
681
|
+
},
|
|
682
|
+
placeholder: {
|
|
683
|
+
classPropertyName: "placeholder",
|
|
684
|
+
publicName: "placeholder",
|
|
685
|
+
isSignal: false,
|
|
686
|
+
isRequired: false,
|
|
687
|
+
transformFunction: null
|
|
688
|
+
},
|
|
689
|
+
value: {
|
|
690
|
+
classPropertyName: "value",
|
|
691
|
+
publicName: "value",
|
|
692
|
+
isSignal: false,
|
|
693
|
+
isRequired: false,
|
|
694
|
+
transformFunction: null
|
|
695
|
+
},
|
|
696
|
+
required: {
|
|
697
|
+
classPropertyName: "required",
|
|
698
|
+
publicName: "required",
|
|
699
|
+
isSignal: false,
|
|
700
|
+
isRequired: false,
|
|
701
|
+
transformFunction: null
|
|
702
|
+
},
|
|
703
|
+
disabled: {
|
|
704
|
+
classPropertyName: "disabled",
|
|
705
|
+
publicName: "disabled",
|
|
706
|
+
isSignal: false,
|
|
707
|
+
isRequired: false,
|
|
708
|
+
transformFunction: null
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
outputs: { closed: "closed" },
|
|
712
|
+
host: {
|
|
713
|
+
listeners: { "document:click": "clickedOut()" },
|
|
714
|
+
properties: { "attr.id": "id" }
|
|
715
|
+
},
|
|
716
|
+
providers: [{
|
|
717
|
+
provide: MatFormFieldControl,
|
|
718
|
+
useExisting: CmatSelectTableComponent
|
|
719
|
+
}],
|
|
720
|
+
viewQueries: [
|
|
721
|
+
{
|
|
722
|
+
propertyName: "_matSelectSearch",
|
|
723
|
+
first: true,
|
|
724
|
+
predicate: CmatSelectSearchComponent,
|
|
725
|
+
descendants: true,
|
|
726
|
+
isSignal: true
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
propertyName: "_sort",
|
|
730
|
+
first: true,
|
|
731
|
+
predicate: MatSort,
|
|
732
|
+
descendants: true,
|
|
733
|
+
isSignal: true
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
propertyName: "_table",
|
|
737
|
+
first: true,
|
|
738
|
+
predicate: MatTable,
|
|
739
|
+
descendants: true,
|
|
740
|
+
isSignal: true
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
propertyName: "_matOptions",
|
|
744
|
+
predicate: MatOption,
|
|
745
|
+
descendants: true,
|
|
746
|
+
isSignal: true
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
propertyName: "_matSelectSignal",
|
|
750
|
+
first: true,
|
|
751
|
+
predicate: ["componentSelect"],
|
|
752
|
+
descendants: true,
|
|
753
|
+
isSignal: true
|
|
754
|
+
}
|
|
755
|
+
],
|
|
756
|
+
exportAs: ["cmatSelectTable"],
|
|
757
|
+
usesOnChanges: true,
|
|
758
|
+
ngImport: i0,
|
|
759
|
+
template: "@if (multiple()) {\r\n<mat-select #componentSelect multiple disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search \r\n [showNoFoundLabel]=\"showNoFoundLabel()\" \r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" \r\n [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{ getCellValue(row, columnKey) }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n \r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n} @else {\r\n<mat-select #componentSelect disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel()\" [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if (row.id === null) {\r\n <mat-option></mat-option>\r\n } @else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell [colSpan]=\"\r\n hasNullRow && row.id === null && $index === 1\r\n ? tableColumns().length\r\n : 1\r\n \" [ngStyle]=\"{\r\n display:\r\n hasNullRow && row.id === null && $index !== 1\r\n ? 'none'\r\n : '',\r\n }\">\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{\r\n hasNullRow && row.id === null && $index === 1\r\n ? \"空\"\r\n : getCellValue(row, columnKey)\r\n }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>",
|
|
760
|
+
styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0;pointer-events:auto}.cmat-select-search-table-panel .overall-search-toggle mat-icon{pointer-events:auto;-webkit-user-select:none;user-select:none}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"],
|
|
761
|
+
dependencies: [
|
|
762
|
+
{
|
|
763
|
+
kind: "component",
|
|
764
|
+
type: CmatSelectSearchComponent,
|
|
765
|
+
selector: "cmat-select-search",
|
|
766
|
+
inputs: [
|
|
767
|
+
"placeholderLabel",
|
|
768
|
+
"type",
|
|
769
|
+
"noEntriesFoundLabel",
|
|
770
|
+
"showNoFoundLabel",
|
|
771
|
+
"clearSearchInput",
|
|
772
|
+
"searching",
|
|
773
|
+
"disableInitialFocus",
|
|
774
|
+
"enableClearOnEscapePressed",
|
|
775
|
+
"preventHomeEndKeyPropagation",
|
|
776
|
+
"disableScrollToActiveOnOptionsChanged",
|
|
777
|
+
"ariaLabel",
|
|
778
|
+
"showToggleAllCheckbox",
|
|
779
|
+
"toggleAllCheckboxChecked",
|
|
780
|
+
"toggleAllCheckboxIndeterminate",
|
|
781
|
+
"toggleAllCheckboxTooltipMessage",
|
|
782
|
+
"toggleAllCheckboxTooltipPosition",
|
|
783
|
+
"hideClearSearchButton",
|
|
784
|
+
"alwaysRestoreSelectedOptionsMulti",
|
|
785
|
+
"debounceTime",
|
|
786
|
+
"optionsCount"
|
|
787
|
+
],
|
|
788
|
+
outputs: ["toggleAll"],
|
|
789
|
+
exportAs: ["cmatSelectSearch"]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
kind: "ngmodule",
|
|
793
|
+
type: MatFormFieldModule
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
kind: "component",
|
|
797
|
+
type: i1.MatFormField,
|
|
798
|
+
selector: "mat-form-field",
|
|
799
|
+
inputs: [
|
|
800
|
+
"hideRequiredMarker",
|
|
801
|
+
"color",
|
|
802
|
+
"floatLabel",
|
|
803
|
+
"appearance",
|
|
804
|
+
"subscriptSizing",
|
|
805
|
+
"hintLabel"
|
|
806
|
+
],
|
|
807
|
+
exportAs: ["matFormField"]
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
kind: "ngmodule",
|
|
811
|
+
type: MatSelectModule
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
kind: "component",
|
|
815
|
+
type: i2.MatSelect,
|
|
816
|
+
selector: "mat-select",
|
|
817
|
+
inputs: [
|
|
818
|
+
"aria-describedby",
|
|
819
|
+
"panelClass",
|
|
820
|
+
"disabled",
|
|
821
|
+
"disableRipple",
|
|
822
|
+
"tabIndex",
|
|
823
|
+
"hideSingleSelectionIndicator",
|
|
824
|
+
"placeholder",
|
|
825
|
+
"required",
|
|
826
|
+
"multiple",
|
|
827
|
+
"disableOptionCentering",
|
|
828
|
+
"compareWith",
|
|
829
|
+
"value",
|
|
830
|
+
"aria-label",
|
|
831
|
+
"aria-labelledby",
|
|
832
|
+
"errorStateMatcher",
|
|
833
|
+
"typeaheadDebounceInterval",
|
|
834
|
+
"sortComparator",
|
|
835
|
+
"id",
|
|
836
|
+
"panelWidth",
|
|
837
|
+
"canSelectNullableOptions"
|
|
838
|
+
],
|
|
839
|
+
outputs: [
|
|
840
|
+
"openedChange",
|
|
841
|
+
"opened",
|
|
842
|
+
"closed",
|
|
843
|
+
"selectionChange",
|
|
844
|
+
"valueChange"
|
|
845
|
+
],
|
|
846
|
+
exportAs: ["matSelect"]
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
kind: "directive",
|
|
850
|
+
type: i2.MatSelectTrigger,
|
|
851
|
+
selector: "mat-select-trigger"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
kind: "component",
|
|
855
|
+
type: i2.MatOption,
|
|
856
|
+
selector: "mat-option",
|
|
857
|
+
inputs: [
|
|
858
|
+
"value",
|
|
859
|
+
"id",
|
|
860
|
+
"disabled"
|
|
861
|
+
],
|
|
862
|
+
outputs: ["onSelectionChange"],
|
|
863
|
+
exportAs: ["matOption"]
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
kind: "ngmodule",
|
|
867
|
+
type: ReactiveFormsModule
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
kind: "directive",
|
|
871
|
+
type: i3.DefaultValueAccessor,
|
|
872
|
+
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]"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
kind: "directive",
|
|
876
|
+
type: i3.NgControlStatus,
|
|
877
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
kind: "directive",
|
|
881
|
+
type: i3.RequiredValidator,
|
|
882
|
+
selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
|
|
883
|
+
inputs: ["required"]
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
kind: "directive",
|
|
887
|
+
type: i3.FormControlDirective,
|
|
888
|
+
selector: "[formControl]",
|
|
889
|
+
inputs: [
|
|
890
|
+
"formControl",
|
|
891
|
+
"disabled",
|
|
892
|
+
"ngModel"
|
|
893
|
+
],
|
|
894
|
+
outputs: ["ngModelChange"],
|
|
895
|
+
exportAs: ["ngForm"]
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
kind: "ngmodule",
|
|
899
|
+
type: CommonModule
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
kind: "directive",
|
|
903
|
+
type: i4.NgClass,
|
|
904
|
+
selector: "[ngClass]",
|
|
905
|
+
inputs: ["class", "ngClass"]
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
kind: "directive",
|
|
909
|
+
type: i4.NgTemplateOutlet,
|
|
910
|
+
selector: "[ngTemplateOutlet]",
|
|
911
|
+
inputs: [
|
|
912
|
+
"ngTemplateOutletContext",
|
|
913
|
+
"ngTemplateOutlet",
|
|
914
|
+
"ngTemplateOutletInjector"
|
|
915
|
+
]
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
kind: "directive",
|
|
919
|
+
type: i4.NgStyle,
|
|
920
|
+
selector: "[ngStyle]",
|
|
921
|
+
inputs: ["ngStyle"]
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
kind: "ngmodule",
|
|
925
|
+
type: MatIconModule
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
kind: "component",
|
|
929
|
+
type: i5.MatIcon,
|
|
930
|
+
selector: "mat-icon",
|
|
931
|
+
inputs: [
|
|
932
|
+
"color",
|
|
933
|
+
"inline",
|
|
934
|
+
"svgIcon",
|
|
935
|
+
"fontSet",
|
|
936
|
+
"fontIcon"
|
|
937
|
+
],
|
|
938
|
+
exportAs: ["matIcon"]
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
kind: "ngmodule",
|
|
942
|
+
type: MatTableModule
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
kind: "component",
|
|
946
|
+
type: i6.MatTable,
|
|
947
|
+
selector: "mat-table, table[mat-table]",
|
|
948
|
+
exportAs: ["matTable"]
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
kind: "directive",
|
|
952
|
+
type: i6.MatHeaderCellDef,
|
|
953
|
+
selector: "[matHeaderCellDef]"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
kind: "directive",
|
|
957
|
+
type: i6.MatHeaderRowDef,
|
|
958
|
+
selector: "[matHeaderRowDef]",
|
|
959
|
+
inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
kind: "directive",
|
|
963
|
+
type: i6.MatColumnDef,
|
|
964
|
+
selector: "[matColumnDef]",
|
|
965
|
+
inputs: ["matColumnDef"]
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
kind: "directive",
|
|
969
|
+
type: i6.MatCellDef,
|
|
970
|
+
selector: "[matCellDef]"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
kind: "directive",
|
|
974
|
+
type: i6.MatRowDef,
|
|
975
|
+
selector: "[matRowDef]",
|
|
976
|
+
inputs: ["matRowDefColumns", "matRowDefWhen"]
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
kind: "directive",
|
|
980
|
+
type: i6.MatHeaderCell,
|
|
981
|
+
selector: "mat-header-cell, th[mat-header-cell]"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
kind: "directive",
|
|
985
|
+
type: i6.MatCell,
|
|
986
|
+
selector: "mat-cell, td[mat-cell]"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
kind: "component",
|
|
990
|
+
type: i6.MatHeaderRow,
|
|
991
|
+
selector: "mat-header-row, tr[mat-header-row]",
|
|
992
|
+
exportAs: ["matHeaderRow"]
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
kind: "component",
|
|
996
|
+
type: i6.MatRow,
|
|
997
|
+
selector: "mat-row, tr[mat-row]",
|
|
998
|
+
exportAs: ["matRow"]
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
kind: "ngmodule",
|
|
1002
|
+
type: MatInputModule
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
kind: "directive",
|
|
1006
|
+
type: i7.MatInput,
|
|
1007
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
1008
|
+
inputs: [
|
|
1009
|
+
"disabled",
|
|
1010
|
+
"id",
|
|
1011
|
+
"placeholder",
|
|
1012
|
+
"name",
|
|
1013
|
+
"required",
|
|
1014
|
+
"type",
|
|
1015
|
+
"errorStateMatcher",
|
|
1016
|
+
"aria-describedby",
|
|
1017
|
+
"value",
|
|
1018
|
+
"readonly",
|
|
1019
|
+
"disabledInteractive"
|
|
1020
|
+
],
|
|
1021
|
+
exportAs: ["matInput"]
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
kind: "ngmodule",
|
|
1025
|
+
type: MatSortModule
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
kind: "directive",
|
|
1029
|
+
type: i8.MatSort,
|
|
1030
|
+
selector: "[matSort]",
|
|
1031
|
+
inputs: [
|
|
1032
|
+
"matSortActive",
|
|
1033
|
+
"matSortStart",
|
|
1034
|
+
"matSortDirection",
|
|
1035
|
+
"matSortDisableClear",
|
|
1036
|
+
"matSortDisabled"
|
|
1037
|
+
],
|
|
1038
|
+
outputs: ["matSortChange"],
|
|
1039
|
+
exportAs: ["matSort"]
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
kind: "component",
|
|
1043
|
+
type: i8.MatSortHeader,
|
|
1044
|
+
selector: "[mat-sort-header]",
|
|
1045
|
+
inputs: [
|
|
1046
|
+
"mat-sort-header",
|
|
1047
|
+
"arrowPosition",
|
|
1048
|
+
"start",
|
|
1049
|
+
"disabled",
|
|
1050
|
+
"sortActionDescription",
|
|
1051
|
+
"disableClear"
|
|
1052
|
+
],
|
|
1053
|
+
exportAs: ["matSortHeader"]
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
kind: "directive",
|
|
1057
|
+
type: CmatDigitOnlyDirective,
|
|
1058
|
+
selector: "[cmatDigitOnly]",
|
|
1059
|
+
inputs: [
|
|
1060
|
+
"decimal",
|
|
1061
|
+
"decimalSeparator",
|
|
1062
|
+
"allowNegatives",
|
|
1063
|
+
"allowPaste",
|
|
1064
|
+
"negativeSign",
|
|
1065
|
+
"min",
|
|
1066
|
+
"max",
|
|
1067
|
+
"pattern"
|
|
1068
|
+
]
|
|
1069
|
+
}
|
|
1070
|
+
],
|
|
1071
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1072
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1077
|
+
minVersion: "12.0.0",
|
|
1078
|
+
version: "22.2.3",
|
|
1079
|
+
ngImport: i0,
|
|
1080
|
+
type: CmatSelectTableComponent,
|
|
1081
|
+
decorators: [{
|
|
1082
|
+
type: Component,
|
|
1083
|
+
args: [{
|
|
1084
|
+
selector: "cmat-select-table",
|
|
1085
|
+
exportAs: "cmatSelectTable",
|
|
1086
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1087
|
+
encapsulation: ViewEncapsulation.None,
|
|
1088
|
+
providers: [{
|
|
1089
|
+
provide: MatFormFieldControl,
|
|
1090
|
+
useExisting: CmatSelectTableComponent
|
|
1091
|
+
}],
|
|
1092
|
+
imports: [
|
|
1093
|
+
CmatSelectSearchComponent,
|
|
1094
|
+
MatFormFieldModule,
|
|
1095
|
+
MatSelectModule,
|
|
1096
|
+
ReactiveFormsModule,
|
|
1097
|
+
CommonModule,
|
|
1098
|
+
MatIconModule,
|
|
1099
|
+
MatTableModule,
|
|
1100
|
+
MatInputModule,
|
|
1101
|
+
MatSortModule,
|
|
1102
|
+
CmatDigitOnlyDirective
|
|
1103
|
+
],
|
|
1104
|
+
host: { "[attr.id]": "id" },
|
|
1105
|
+
template: "@if (multiple()) {\r\n<mat-select #componentSelect multiple disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search \r\n [showNoFoundLabel]=\"showNoFoundLabel()\" \r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" \r\n [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{ selection: true, hidden: !multiple() }\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{ getCellValue(row, columnKey) }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n \r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n} @else {\r\n<mat-select #componentSelect disableRipple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith()\" (focusin)=\"onFocusIn()\"\r\n (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>{{ _triggerLabel() }}</mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{ 'hidden-header': overallSearchVisibleState() }\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled()) {\r\n <mat-option [ngClass]=\"{ hidden: !overallSearchVisibleState() === true }\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel()\" [noEntriesFoundLabel]=\"noEntriesFoundLabel()\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen()??false\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if (!isPhone()) {\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{\r\n height: overallSearchVisibleState() ? '48px' : '55.4px',\r\n }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"\r\n overallSearchVisibleState()\r\n ? 'mat_outline:arrow_back'\r\n : 'mat_outline:search'\r\n \" (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource()\">\r\n @for (columnKey of tableColumns(); track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case (\"_selection\") {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if (row.id === null) {\r\n <mat-option></mat-option>\r\n } @else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header [disabled]=\"!column?.sortable\">\r\n @if (!column?.sortable) {\r\n <div>{{ column?.name }}</div>\r\n } @else {\r\n @switch (column?.filter.type) {\r\n @case (\"string\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @case (\"number\") {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"getFilterContext(column)\"></ng-container>\r\n }\r\n @default {\r\n <div>{{ column?.name }}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell [colSpan]=\"\r\n hasNullRow && row.id === null && $index === 1\r\n ? tableColumns().length\r\n : 1\r\n \" [ngStyle]=\"{\r\n display:\r\n hasNullRow && row.id === null && $index !== 1\r\n ? 'none'\r\n : '',\r\n }\">\r\n <div class=\"has-label-on-mobile\" [attr.data-label]=\"column?.name + ':'\">\r\n {{\r\n hasNullRow && row.id === null && $index === 1\r\n ? \"空\"\r\n : getCellValue(row, columnKey)\r\n }}\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns(); sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns()\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column=\"column\">\r\n <mat-form-field appearance=\"fill\" class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\" (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>",
|
|
1106
|
+
styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0;pointer-events:auto}.cmat-select-search-table-panel .overall-search-toggle mat-icon{pointer-events:auto;-webkit-user-select:none;user-select:none}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"]
|
|
1107
|
+
}]
|
|
1108
|
+
}],
|
|
1109
|
+
ctorParameters: () => [],
|
|
1110
|
+
propDecorators: {
|
|
1111
|
+
dataSource: [{
|
|
1112
|
+
type: i0.Input,
|
|
1113
|
+
args: [{
|
|
1114
|
+
isSignal: true,
|
|
1115
|
+
alias: "dataSource",
|
|
1116
|
+
required: false
|
|
1117
|
+
}]
|
|
1118
|
+
}],
|
|
1119
|
+
noEntriesFoundLabel: [{
|
|
1120
|
+
type: i0.Input,
|
|
1121
|
+
args: [{
|
|
1122
|
+
isSignal: true,
|
|
1123
|
+
alias: "noEntriesFoundLabel",
|
|
1124
|
+
required: false
|
|
1125
|
+
}]
|
|
1126
|
+
}],
|
|
1127
|
+
showNoFoundLabel: [{
|
|
1128
|
+
type: i0.Input,
|
|
1129
|
+
args: [{
|
|
1130
|
+
isSignal: true,
|
|
1131
|
+
alias: "showNoFoundLabel",
|
|
1132
|
+
required: false
|
|
1133
|
+
}]
|
|
1134
|
+
}],
|
|
1135
|
+
isPhone: [{
|
|
1136
|
+
type: i0.Input,
|
|
1137
|
+
args: [{
|
|
1138
|
+
isSignal: true,
|
|
1139
|
+
alias: "isPhone",
|
|
1140
|
+
required: false
|
|
1141
|
+
}]
|
|
1142
|
+
}],
|
|
1143
|
+
multiple: [{
|
|
1144
|
+
type: i0.Input,
|
|
1145
|
+
args: [{
|
|
1146
|
+
isSignal: true,
|
|
1147
|
+
alias: "multiple",
|
|
1148
|
+
required: false
|
|
1149
|
+
}]
|
|
1150
|
+
}],
|
|
1151
|
+
overallSearchEnabled: [{
|
|
1152
|
+
type: i0.Input,
|
|
1153
|
+
args: [{
|
|
1154
|
+
isSignal: true,
|
|
1155
|
+
alias: "overallSearchEnabled",
|
|
1156
|
+
required: false
|
|
1157
|
+
}]
|
|
1158
|
+
}],
|
|
1159
|
+
overallSearchVisible: [{
|
|
1160
|
+
type: i0.Input,
|
|
1161
|
+
args: [{
|
|
1162
|
+
isSignal: true,
|
|
1163
|
+
alias: "overallSearchVisible",
|
|
1164
|
+
required: false
|
|
1165
|
+
}]
|
|
1166
|
+
}],
|
|
1167
|
+
resetSortOnOpen: [{
|
|
1168
|
+
type: i0.Input,
|
|
1169
|
+
args: [{
|
|
1170
|
+
isSignal: true,
|
|
1171
|
+
alias: "resetSortOnOpen",
|
|
1172
|
+
required: false
|
|
1173
|
+
}]
|
|
1174
|
+
}],
|
|
1175
|
+
resetFiltersOnOpen: [{
|
|
1176
|
+
type: i0.Input,
|
|
1177
|
+
args: [{
|
|
1178
|
+
isSignal: true,
|
|
1179
|
+
alias: "resetFiltersOnOpen",
|
|
1180
|
+
required: false
|
|
1181
|
+
}]
|
|
1182
|
+
}],
|
|
1183
|
+
customTriggerLabelFn: [{
|
|
1184
|
+
type: i0.Input,
|
|
1185
|
+
args: [{
|
|
1186
|
+
isSignal: true,
|
|
1187
|
+
alias: "customTriggerLabelFn",
|
|
1188
|
+
required: false
|
|
1189
|
+
}]
|
|
1190
|
+
}],
|
|
1191
|
+
triggerLabelSort: [{
|
|
1192
|
+
type: i0.Input,
|
|
1193
|
+
args: [{
|
|
1194
|
+
isSignal: true,
|
|
1195
|
+
alias: "triggerLabelSort",
|
|
1196
|
+
required: false
|
|
1197
|
+
}]
|
|
1198
|
+
}],
|
|
1199
|
+
customTriggerLabelTemplate: [{
|
|
1200
|
+
type: i0.Input,
|
|
1201
|
+
args: [{
|
|
1202
|
+
isSignal: true,
|
|
1203
|
+
alias: "customTriggerLabelTemplate",
|
|
1204
|
+
required: false
|
|
1205
|
+
}]
|
|
1206
|
+
}],
|
|
1207
|
+
canNull: [{
|
|
1208
|
+
type: i0.Input,
|
|
1209
|
+
args: [{
|
|
1210
|
+
isSignal: true,
|
|
1211
|
+
alias: "canNull",
|
|
1212
|
+
required: false
|
|
1213
|
+
}]
|
|
1214
|
+
}],
|
|
1215
|
+
defaultSort: [{
|
|
1216
|
+
type: i0.Input,
|
|
1217
|
+
args: [{
|
|
1218
|
+
isSignal: true,
|
|
1219
|
+
alias: "defaultSort",
|
|
1220
|
+
required: false
|
|
1221
|
+
}]
|
|
1222
|
+
}],
|
|
1223
|
+
resetOptionAction: [{
|
|
1224
|
+
type: i0.Input,
|
|
1225
|
+
args: [{
|
|
1226
|
+
isSignal: true,
|
|
1227
|
+
alias: "resetOptionAction",
|
|
1228
|
+
required: false
|
|
1229
|
+
}]
|
|
1230
|
+
}],
|
|
1231
|
+
keyParam: [{
|
|
1232
|
+
type: i0.Input,
|
|
1233
|
+
args: [{
|
|
1234
|
+
isSignal: true,
|
|
1235
|
+
alias: "keyParam",
|
|
1236
|
+
required: false
|
|
1237
|
+
}]
|
|
1238
|
+
}],
|
|
1239
|
+
compareWith: [{
|
|
1240
|
+
type: i0.Input,
|
|
1241
|
+
args: [{
|
|
1242
|
+
isSignal: true,
|
|
1243
|
+
alias: "compareWith",
|
|
1244
|
+
required: false
|
|
1245
|
+
}]
|
|
1246
|
+
}],
|
|
1247
|
+
closed: [{
|
|
1248
|
+
type: i0.Output,
|
|
1249
|
+
args: ["closed"]
|
|
1250
|
+
}],
|
|
1251
|
+
_matSelectSearch: [{
|
|
1252
|
+
type: i0.ViewChild,
|
|
1253
|
+
args: [i0.forwardRef(() => CmatSelectSearchComponent), { isSignal: true }]
|
|
1254
|
+
}],
|
|
1255
|
+
_sort: [{
|
|
1256
|
+
type: i0.ViewChild,
|
|
1257
|
+
args: [i0.forwardRef(() => MatSort), { isSignal: true }]
|
|
1258
|
+
}],
|
|
1259
|
+
_table: [{
|
|
1260
|
+
type: i0.ViewChild,
|
|
1261
|
+
args: [i0.forwardRef(() => MatTable), { isSignal: true }]
|
|
1262
|
+
}],
|
|
1263
|
+
_matOptions: [{
|
|
1264
|
+
type: i0.ViewChildren,
|
|
1265
|
+
args: [i0.forwardRef(() => MatOption), { isSignal: true }]
|
|
1266
|
+
}],
|
|
1267
|
+
_matSelectSignal: [{
|
|
1268
|
+
type: i0.ViewChild,
|
|
1269
|
+
args: ["componentSelect", { isSignal: true }]
|
|
1270
|
+
}],
|
|
1271
|
+
clickedOut: [{
|
|
1272
|
+
type: HostListener,
|
|
1273
|
+
args: ["document:click"]
|
|
1274
|
+
}],
|
|
1275
|
+
placeholder: [{ type: Input }],
|
|
1276
|
+
value: [{ type: Input }],
|
|
1277
|
+
required: [{ type: Input }],
|
|
1278
|
+
disabled: [{ type: Input }]
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
844
1281
|
export { CmatSelectTableComponent };
|
|
845
|
-
|
|
1282
|
+
|
|
1283
|
+
//# sourceMappingURL=cmat-components-select-table.mjs.map
|