cmat 0.0.111 → 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 +984 -1109
- 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 +39805 -22511
- 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 -102
- 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 -5204
|
@@ -1,31 +1,51 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Pipe } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
i0.ɵɵ
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe } from "@angular/core";
|
|
3
|
+
var CmatBytesPipe = class CmatBytesPipe {
|
|
4
|
+
transform(bytes) {
|
|
5
|
+
if (isNaN(parseFloat("" + bytes)) || !isFinite(bytes)) return "-";
|
|
6
|
+
if (bytes <= 0) return "0";
|
|
7
|
+
const units = [
|
|
8
|
+
"bytes",
|
|
9
|
+
"KB",
|
|
10
|
+
"MB",
|
|
11
|
+
"GB",
|
|
12
|
+
"TB",
|
|
13
|
+
"PB"
|
|
14
|
+
];
|
|
15
|
+
const size = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
16
|
+
return (bytes / Math.pow(1024, Math.floor(size))).toFixed(1) + " " + units[size];
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
20
|
+
minVersion: "12.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: CmatBytesPipe,
|
|
24
|
+
deps: [],
|
|
25
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
30
|
+
minVersion: "14.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: CmatBytesPipe,
|
|
34
|
+
isStandalone: true,
|
|
35
|
+
name: "cmatBytes"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.3",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: CmatBytesPipe,
|
|
44
|
+
decorators: [{
|
|
45
|
+
type: Pipe,
|
|
46
|
+
args: [{ name: "cmatBytes" }]
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
30
49
|
export { CmatBytesPipe };
|
|
31
|
-
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=cmat-pipes-bytes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-bytes.mjs","sources":["../../../projects/cmat/pipes/bytes/bytes.pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-bytes.mjs","names":[],"sources":["../../../projects/cmat/pipes/bytes/bytes.pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'cmatBytes'\r\n})\r\nexport class CmatBytesPipe implements PipeTransform {\r\n public transform(bytes: number): string {\r\n if (isNaN(parseFloat('' + bytes)) || !isFinite(bytes)) {\r\n return '-';\r\n }\r\n if (bytes <= 0) {\r\n return '0';\r\n }\r\n const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\r\n const size = Math.floor(Math.log(bytes) / Math.log(1024));\r\n return (bytes / Math.pow(1024, Math.floor(size))).toFixed(1) + ' ' + units[size];\r\n }\r\n}\r\n"],"mappings":";;AAKA,IAAa,gBAAb,MAAa,cAAa;CACf,UAAU,OAAa;EAC1B,IAAI,MAAM,WAAW,KAAK,KAAK,CAAC,KAAK,CAAC,SAAS,KAAK,GAChD,OAAO;EAEX,IAAI,SAAS,GACT,OAAO;EAEX,MAAM,QAAQ;GAAC;GAAS;GAAM;GAAM;GAAM;GAAM;EAAI;EACpD,MAAM,OAAO,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC;EACxD,QAAQ,QAAQ,KAAK,IAAI,MAAM,KAAK,MAAM,IAAI,CAAC,EAAA,CAAG,QAAQ,CAAC,IAAI,MAAM,MAAM;CAC/E;CAXS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAb;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAa,cAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAHzB,MAAA;EAAK,MAAA,CAAA,EACF,MAAM,YACT,CAAA"}
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Pipe } from
|
|
3
|
-
import dayjs from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe } from "@angular/core";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
var CmatDateFormatPipe = class CmatDateFormatPipe {
|
|
5
|
+
transform(value, format) {
|
|
6
|
+
if (value) return dayjs(value).format(format);
|
|
7
|
+
return "";
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
11
|
+
minVersion: "12.0.0",
|
|
12
|
+
version: "22.2.3",
|
|
13
|
+
ngImport: i0,
|
|
14
|
+
type: CmatDateFormatPipe,
|
|
15
|
+
deps: [],
|
|
16
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
21
|
+
minVersion: "14.0.0",
|
|
22
|
+
version: "22.2.3",
|
|
23
|
+
ngImport: i0,
|
|
24
|
+
type: CmatDateFormatPipe,
|
|
25
|
+
isStandalone: true,
|
|
26
|
+
name: "cmatDateFormat"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: CmatDateFormatPipe,
|
|
35
|
+
decorators: [{
|
|
36
|
+
type: Pipe,
|
|
37
|
+
args: [{ name: "cmatDateFormat" }]
|
|
38
|
+
}]
|
|
39
|
+
});
|
|
25
40
|
export { CmatDateFormatPipe };
|
|
26
|
-
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=cmat-pipes-date-format.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-date-format.mjs","sources":["../../../projects/cmat/pipes/date-format/date-format.pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-date-format.mjs","names":[],"sources":["../../../projects/cmat/pipes/date-format/date-format.pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\nimport dayjs from 'dayjs';\r\n\r\n@Pipe({\r\n name: 'cmatDateFormat'\r\n})\r\nexport class CmatDateFormatPipe implements PipeTransform {\r\n transform(value: string | Date | void, format: string): string {\r\n if (value)\r\n return dayjs(value).format(format);\r\n\r\n return '';\r\n }\r\n}\r\n"],"mappings":";;;AAMA,IAAa,qBAAb,MAAa,mBAAkB;CAC3B,UAAU,OAA6B,QAAc;EACjD,IAAI,OACA,OAAO,MAAM,KAAK,CAAC,CAAC,OAAO,MAAM;EAErC,OAAO;CACX;CANS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAlB;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,cAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EAH9B,MAAA;EAAK,MAAA,CAAA,EACF,MAAM,iBACT,CAAA"}
|
|
@@ -1,27 +1,45 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Pipe } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe } from "@angular/core";
|
|
3
|
+
var CmatFindByKeyPipe = class CmatFindByKeyPipe {
|
|
4
|
+
transform(value, key, source) {
|
|
5
|
+
if (Array.isArray(value)) return value.map((item) => source.find((sourceItem) => sourceItem[key] === item)).filter((item) => !!item);
|
|
6
|
+
return source.find((sourceItem) => sourceItem[key] === value);
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
|
+
minVersion: "12.0.0",
|
|
11
|
+
version: "22.2.3",
|
|
12
|
+
ngImport: i0,
|
|
13
|
+
type: CmatFindByKeyPipe,
|
|
14
|
+
deps: [],
|
|
15
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
20
|
+
minVersion: "14.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: CmatFindByKeyPipe,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
name: "cmatFindByKey",
|
|
26
|
+
pure: false
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: CmatFindByKeyPipe,
|
|
35
|
+
decorators: [{
|
|
36
|
+
type: Pipe,
|
|
37
|
+
args: [{
|
|
38
|
+
name: "cmatFindByKey",
|
|
39
|
+
pure: false
|
|
40
|
+
}]
|
|
41
|
+
}]
|
|
42
|
+
});
|
|
26
43
|
export { CmatFindByKeyPipe };
|
|
27
|
-
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=cmat-pipes-find-by-key.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-find-by-key.mjs","sources":["../../../projects/cmat/pipes/find-by-key/find-by-key.pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-find-by-key.mjs","names":[],"sources":["../../../projects/cmat/pipes/find-by-key/find-by-key.pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nexport type CmatFindByKeySourceItem = Record<string, unknown>;\r\n\r\n@Pipe({\r\n name: 'cmatFindByKey',\r\n pure: false\r\n})\r\nexport class CmatFindByKeyPipe implements PipeTransform {\r\n transform(value: string | string[], key: string, source: CmatFindByKeySourceItem[]): CmatFindByKeySourceItem | CmatFindByKeySourceItem[] | undefined {\r\n if (Array.isArray(value)) {\r\n return value.map(item => source.find(sourceItem => sourceItem[key] === item)).filter((item): item is CmatFindByKeySourceItem => !!item);\r\n }\r\n return source.find(sourceItem => sourceItem[key] === value);\r\n }\r\n}\r\n"],"mappings":";;AAQA,IAAa,oBAAb,MAAa,kBAAiB;CAC1B,UAAU,OAA0B,KAAa,QAAiC;EAC9E,IAAI,MAAM,QAAQ,KAAK,GACnB,OAAO,MAAM,KAAI,SAAQ,OAAO,MAAK,eAAc,WAAW,SAAS,IAAI,CAAC,CAAC,CAAC,QAAQ,SAA0C,CAAC,CAAC,IAAI;EAE1I,OAAO,OAAO,MAAK,eAAc,WAAW,SAAS,KAAK;CAC9D;CANS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAiB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAjB;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAiB,cAAA;GAAA,MAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAjB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAJ7B,MAAA;EAAK,MAAA,CAAA;GACF,MAAM;GACN,MAAM;EACT,CAAA"}
|
|
@@ -1,39 +1,51 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Pipe } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe } from "@angular/core";
|
|
3
|
+
var CmatGroupByPipe = class CmatGroupByPipe {
|
|
4
|
+
transform(value, field) {
|
|
5
|
+
if (!value) return [];
|
|
6
|
+
const groupedObj = value.reduce((prev, cur) => {
|
|
7
|
+
const rawValue = cur[field];
|
|
8
|
+
const groupKey = typeof rawValue === "string" || typeof rawValue === "number" || typeof rawValue === "boolean" || typeof rawValue === "bigint" ? String(rawValue) : "";
|
|
9
|
+
if (!prev[groupKey]) prev[groupKey] = [cur];
|
|
10
|
+
else prev[groupKey].push(cur);
|
|
11
|
+
return prev;
|
|
12
|
+
}, {});
|
|
13
|
+
return Object.keys(groupedObj).map((key) => ({
|
|
14
|
+
key,
|
|
15
|
+
value: groupedObj[key]
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
20
|
+
minVersion: "12.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: CmatGroupByPipe,
|
|
24
|
+
deps: [],
|
|
25
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
30
|
+
minVersion: "14.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: CmatGroupByPipe,
|
|
34
|
+
isStandalone: true,
|
|
35
|
+
name: "cmatGroupBy"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.3",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: CmatGroupByPipe,
|
|
44
|
+
decorators: [{
|
|
45
|
+
type: Pipe,
|
|
46
|
+
args: [{ name: "cmatGroupBy" }]
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
38
49
|
export { CmatGroupByPipe };
|
|
39
|
-
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=cmat-pipes-group-by.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-group-by.mjs","sources":["../../../projects/cmat/pipes/group-by/group-by.pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-group-by.mjs","names":[],"sources":["../../../projects/cmat/pipes/group-by/group-by.pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nexport type GroupByItem = Record<string, unknown>;\r\n\r\nexport interface GroupByResult<T extends GroupByItem> {\r\n key: string;\r\n value: T[];\r\n}\r\n\r\n@Pipe({\r\n name: 'cmatGroupBy'\r\n})\r\nexport class CmatGroupByPipe implements PipeTransform {\r\n\r\n transform<T extends GroupByItem>(value: T[] | null | undefined, field: string): GroupByResult<T>[] {\r\n\r\n if (!value) {\r\n return [];\r\n }\r\n\r\n const groupedObj = value.reduce<Record<string, T[]>>((prev, cur) => {\r\n const rawValue = cur[field];\r\n const groupKey = typeof rawValue === 'string' || typeof rawValue === 'number' || typeof rawValue === 'boolean' || typeof rawValue === 'bigint'\r\n ? String(rawValue)\r\n : '';\r\n\r\n if (!prev[groupKey]) {\r\n prev[groupKey] = [cur];\r\n } else {\r\n prev[groupKey].push(cur);\r\n }\r\n\r\n return prev;\r\n }, {});\r\n\r\n return Object.keys(groupedObj).map((key): GroupByResult<T> => ({ key, value: groupedObj[key] }));\r\n }\r\n}\r\n"],"mappings":";;AAYA,IAAa,kBAAb,MAAa,gBAAe;CAExB,UAAiC,OAA+B,OAAa;EAEzE,IAAI,CAAC,OACD,OAAO,CAAA;EAGX,MAAM,aAAa,MAAM,QAA6B,MAAM,QAAO;GAC/D,MAAM,WAAW,IAAI;GACrB,MAAM,WAAW,OAAO,aAAa,YAAY,OAAO,aAAa,YAAY,OAAO,aAAa,aAAa,OAAO,aAAa,WAChI,OAAO,QAAQ,IACf;GAEN,IAAI,CAAC,KAAK,WACN,KAAK,YAAY,CAAC,GAAG;QAErB,KAAK,SAAS,CAAC,KAAK,GAAG;GAG3B,OAAO;EACX,GAAG,CAAA,CAAE;EAEL,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK,SAA2B;GAAE;GAAK,OAAO,WAAW;EAAI,EAAG;CACnG;CAxBS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAf;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,cAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAH3B,MAAA;EAAK,MAAA,CAAA,EACF,MAAM,cACT,CAAA"}
|
|
@@ -1,32 +1,45 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Pipe } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe } from "@angular/core";
|
|
3
|
+
var CmatKeysPipe = class CmatKeysPipe {
|
|
4
|
+
transform(value) {
|
|
5
|
+
const keys = [];
|
|
6
|
+
for (const key in value) if (Object.prototype.hasOwnProperty.call(value, key)) keys.push({
|
|
7
|
+
key,
|
|
8
|
+
value: value[key]
|
|
9
|
+
});
|
|
10
|
+
return keys;
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
14
|
+
minVersion: "12.0.0",
|
|
15
|
+
version: "22.2.3",
|
|
16
|
+
ngImport: i0,
|
|
17
|
+
type: CmatKeysPipe,
|
|
18
|
+
deps: [],
|
|
19
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
24
|
+
minVersion: "14.0.0",
|
|
25
|
+
version: "22.2.3",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: CmatKeysPipe,
|
|
28
|
+
isStandalone: true,
|
|
29
|
+
name: "cmatKeys"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
34
|
+
minVersion: "12.0.0",
|
|
35
|
+
version: "22.2.3",
|
|
36
|
+
ngImport: i0,
|
|
37
|
+
type: CmatKeysPipe,
|
|
38
|
+
decorators: [{
|
|
39
|
+
type: Pipe,
|
|
40
|
+
args: [{ name: "cmatKeys" }]
|
|
41
|
+
}]
|
|
42
|
+
});
|
|
31
43
|
export { CmatKeysPipe };
|
|
32
|
-
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=cmat-pipes-keys.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-keys.mjs","sources":["../../../projects/cmat/pipes/keys/keys.pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-keys.mjs","names":[],"sources":["../../../projects/cmat/pipes/keys/keys.pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'cmatKeys'\r\n})\r\nexport class CmatKeysPipe implements PipeTransform {\r\n transform(value: Record<string, unknown>): { key: string; value: unknown }[] {\r\n const keys: { key: string; value: unknown }[] = [];\r\n\r\n for (const key in value) {\r\n if (Object.prototype.hasOwnProperty.call(value, key)) {\r\n keys.push({\r\n key: key,\r\n value: value[key]\r\n });\r\n }\r\n }\r\n\r\n return keys;\r\n }\r\n}\r\n"],"mappings":";;AAKA,IAAa,eAAb,MAAa,aAAY;CACrB,UAAU,OAA8B;EACpC,MAAM,OAA0C,CAAA;EAEhD,KAAK,MAAM,OAAO,OACd,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,GAAG,GAC/C,KAAK,KAAK;GACD;GACL,OAAO,MAAM;EAChB,CAAA;EAIT,OAAO;CACX;CAdS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAY,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAZ;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAY,cAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAHxB,MAAA;EAAK,MAAA,CAAA,EACF,MAAM,WACT,CAAA"}
|
|
@@ -1,50 +1,61 @@
|
|
|
1
|
-
import { HttpClient } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { DomSanitizer } from
|
|
5
|
-
import { CmatUrlStateConfigService } from
|
|
6
|
-
import { CmatUtilsService } from
|
|
7
|
-
import { map } from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Pipe, inject } from "@angular/core";
|
|
4
|
+
import { DomSanitizer } from "@angular/platform-browser";
|
|
5
|
+
import { CmatUrlStateConfigService } from "cmat/services/config";
|
|
6
|
+
import { CmatUtilsService } from "cmat/services/utils";
|
|
7
|
+
import { map } from "rxjs/operators";
|
|
8
|
+
var CmatSecurePipe = class CmatSecurePipe {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._http = inject(HttpClient);
|
|
11
|
+
this._sanitizer = inject(DomSanitizer);
|
|
12
|
+
this._urlStateConfigService = inject(CmatUrlStateConfigService);
|
|
13
|
+
this._config = this._urlStateConfigService.config;
|
|
14
|
+
this._previousObjectUrl = null;
|
|
15
|
+
}
|
|
16
|
+
transform(fileId) {
|
|
17
|
+
return this._http.get(`${this._config().fileUrl}/download/${fileId}`, {
|
|
18
|
+
headers: CmatUtilsService.getRequestCryptoHeaders(fileId.toString()),
|
|
19
|
+
responseType: "blob",
|
|
20
|
+
params: { isStream: false }
|
|
21
|
+
}).pipe(map((val) => {
|
|
22
|
+
if (this._previousObjectUrl) URL.revokeObjectURL(this._previousObjectUrl);
|
|
23
|
+
const objectUrl = URL.createObjectURL(val);
|
|
24
|
+
this._previousObjectUrl = objectUrl;
|
|
25
|
+
return this._sanitizer.bypassSecurityTrustUrl(objectUrl);
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: CmatSecurePipe,
|
|
34
|
+
deps: [],
|
|
35
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
static {
|
|
39
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
40
|
+
minVersion: "14.0.0",
|
|
41
|
+
version: "22.2.3",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: CmatSecurePipe,
|
|
44
|
+
isStandalone: true,
|
|
45
|
+
name: "cmatSecure"
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
50
|
+
minVersion: "12.0.0",
|
|
51
|
+
version: "22.2.3",
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
type: CmatSecurePipe,
|
|
54
|
+
decorators: [{
|
|
55
|
+
type: Pipe,
|
|
56
|
+
args: [{ name: "cmatSecure" }]
|
|
57
|
+
}]
|
|
58
|
+
});
|
|
49
59
|
export { CmatSecurePipe };
|
|
50
|
-
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=cmat-pipes-secure.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-pipes-secure.mjs","sources":["../../../projects/cmat/pipes/secure/secure-pipe.ts"
|
|
1
|
+
{"version":3,"file":"cmat-pipes-secure.mjs","names":[],"sources":["../../../projects/cmat/pipes/secure/secure-pipe.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\r\nimport { CmatUrlStateConfigService } from 'cmat/services/config';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\n\r\n\r\n@Pipe({\r\n name: 'cmatSecure'\r\n})\r\nexport class CmatSecurePipe implements PipeTransform {\r\n private _http = inject(HttpClient);\r\n private _sanitizer = inject(DomSanitizer);\r\n private _urlStateConfigService = inject(CmatUrlStateConfigService);\r\n\r\n private readonly _config=this._urlStateConfigService.config;\r\n private _previousObjectUrl: string | null = null;\r\n\r\n\r\n transform(fileId: string): Observable<SafeUrl> {\r\n return this._http\r\n .get(`${this._config().fileUrl}/download/${fileId}`, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders(fileId.toString()),\r\n responseType: 'blob',\r\n params: {\r\n isStream: false\r\n }\r\n })\r\n .pipe(map((val: Blob | MediaSource) => {\r\n if (this._previousObjectUrl) {\r\n URL.revokeObjectURL(this._previousObjectUrl);\r\n }\r\n const objectUrl = URL.createObjectURL(val);\r\n this._previousObjectUrl = objectUrl;\r\n return this._sanitizer.bypassSecurityTrustUrl(objectUrl);\r\n }));\r\n }\r\n}"],"mappings":";;;;;;;AAYA,IAAa,iBAAb,MAAa,eAAc;CAH3B,cAAA;EAIY,KAAA,QAAQ,OAAO,UAAU;EACzB,KAAA,aAAa,OAAO,YAAY;EAChC,KAAA,yBAAyB,OAAO,yBAAyB;EAEhD,KAAA,UAAQ,KAAK,uBAAuB;EAC7C,KAAA,qBAAoC;CAqB/C;CAlBG,UAAU,QAAc;EACpB,OAAO,KAAK,MACP,IAAI,GAAG,KAAK,QAAO,CAAE,CAAC,QAAO,YAAa,UAAU;GACjD,SAAS,iBAAiB,wBAAwB,OAAO,SAAQ,CAAE;GACnE,cAAc;GACd,QAAQ,EACJ,UAAU,MACb;EACJ,CAAA,CAAC,CACD,KAAK,KAAK,QAA2B;GAClC,IAAI,KAAK,oBACL,IAAI,gBAAgB,KAAK,kBAAkB;GAE/C,MAAM,YAAY,IAAI,gBAAgB,GAAG;GACzC,KAAK,qBAAqB;GAC1B,OAAO,KAAK,WAAW,uBAAuB,SAAS;EAC3D,CAAC,CAAC;CACV;CA1BS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAc,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAd;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAc,cAAA;GAAA,MAAA;EAAA,CAAA;CAAA;;AAAd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAH1B,MAAA;EAAK,MAAA,CAAA,EACF,MAAM,aACT,CAAA"}
|