cmat 0.0.111 → 0.0.113
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 +2761 -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 +1138 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-loading.mjs","sources":["../../../projects/cmat/services/loading/loading.service.ts","../../../projects/cmat/services/loading/loading.interceptor.ts"
|
|
1
|
+
{"version":3,"file":"cmat-services-loading.mjs","names":[],"sources":["../../../projects/cmat/services/loading/loading.service.ts","../../../projects/cmat/services/loading/loading.interceptor.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLoadingService {\r\n private readonly _auto = signal<boolean>(true);\r\n private readonly _mode = signal<'determinate' | 'indeterminate'>('indeterminate');\r\n private readonly _progress = signal<number | null>(0);\r\n private readonly _show = signal<boolean>(false);\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly auto = this._auto.asReadonly();\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly mode = this._mode.asReadonly();\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly progress = this._progress.asReadonly();\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly isShowing = this._show.asReadonly();\r\n\r\n private readonly _urlSet = new Set<string>();\r\n\r\n show(): void {\r\n this._show.set(true);\r\n }\r\n\r\n hide(): void {\r\n this._show.set(false);\r\n }\r\n\r\n setAutoMode(value: boolean): void {\r\n this._auto.set(value);\r\n }\r\n\r\n setMode(value: 'determinate' | 'indeterminate'): void {\r\n this._mode.set(value);\r\n }\r\n\r\n setProgress(value: number): void {\r\n if (value < 0 || value > 100) {\r\n console.error('Progress value must be between 0 and 100!');\r\n return;\r\n }\r\n\r\n this._progress.set(value);\r\n }\r\n\r\n setLoadingStatus(status: boolean, url: string): void {\r\n if (!url) {\r\n console.error('The request URL must be provided!');\r\n return;\r\n }\r\n\r\n if (status) {\r\n this._urlSet.add(url);\r\n this._show.set(true);\r\n return;\r\n }\r\n\r\n if (this._urlSet.has(url)) {\r\n this._urlSet.delete(url);\r\n }\r\n\r\n if (this._urlSet.size === 0) {\r\n this._show.set(false);\r\n }\r\n }\r\n}\r\n\r\n","import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { finalize, Observable } from 'rxjs';\r\nimport { CmatLoadingService } from './loading.service';\r\n\r\n@Injectable()\r\nexport class CmatLoadingInterceptor implements HttpInterceptor {\r\n private readonly _cmatLoadingService = inject(CmatLoadingService);\r\n\r\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n if (!this._cmatLoadingService.auto() || req.url.includes('file/download/')) {\r\n return next.handle(req);\r\n }\r\n\r\n this._cmatLoadingService.setLoadingStatus(true, req.url);\r\n\r\n return next.handle(req).pipe(\r\n finalize(() => {\r\n this._cmatLoadingService.setLoadingStatus(false, req.url);\r\n }));\r\n }\r\n}\r\n"],"mappings":";;;AAKA,IAAa,qBAAb,MAAa,mBAAkB;CAH/B,cAAA;EAIqB,KAAA,QAAQ,OAAgB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAC7B,KAAA,QAAQ,OAAwC,iBAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAChE,KAAA,YAAY,OAAsB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EACpC,KAAA,QAAQ,OAAgB,OAAM,GAAA,YAAA,CA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|
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
|
-
i0.ɵɵ
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable } from "@angular/core";
|
|
3
|
+
var CmatLocalStorageService = class CmatLocalStorageService {
|
|
4
|
+
constructor() {
|
|
5
|
+
this._encryptionPrefix = "__enc__";
|
|
6
|
+
}
|
|
7
|
+
getItem(key, options) {
|
|
8
|
+
const raw = localStorage.getItem(key);
|
|
9
|
+
if (raw === null) return null;
|
|
10
|
+
let entry;
|
|
11
|
+
try {
|
|
12
|
+
entry = JSON.parse(raw);
|
|
13
|
+
} catch {
|
|
14
|
+
return raw;
|
|
15
|
+
}
|
|
16
|
+
if (entry.expiry && Date.now() > entry.expiry) {
|
|
17
|
+
this.removeItem(key);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
let data = entry.data ?? raw;
|
|
21
|
+
if (options?.encrypt || key.startsWith(this._encryptionPrefix)) data = this._decrypt(data);
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
setItem(key, item, options) {
|
|
25
|
+
let data = item;
|
|
26
|
+
const storageKey = options?.encrypt ? this._encryptionPrefix + key : key;
|
|
27
|
+
if (options?.encrypt) data = this._encrypt(item);
|
|
28
|
+
const entry = {
|
|
29
|
+
data,
|
|
30
|
+
...options?.ttl ? { expiry: Date.now() + options.ttl } : {}
|
|
31
|
+
};
|
|
32
|
+
localStorage.setItem(storageKey, JSON.stringify(entry));
|
|
33
|
+
}
|
|
34
|
+
removeItem(key) {
|
|
35
|
+
localStorage.removeItem(key);
|
|
36
|
+
localStorage.removeItem(this._encryptionPrefix + key);
|
|
37
|
+
}
|
|
38
|
+
_encrypt(value) {
|
|
39
|
+
return btoa(encodeURIComponent(value));
|
|
40
|
+
}
|
|
41
|
+
_decrypt(value) {
|
|
42
|
+
return decodeURIComponent(atob(value));
|
|
43
|
+
}
|
|
44
|
+
static {
|
|
45
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
46
|
+
minVersion: "12.0.0",
|
|
47
|
+
version: "22.2.3",
|
|
48
|
+
ngImport: i0,
|
|
49
|
+
type: CmatLocalStorageService,
|
|
50
|
+
deps: [],
|
|
51
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
static {
|
|
55
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
56
|
+
minVersion: "12.0.0",
|
|
57
|
+
version: "22.2.3",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: CmatLocalStorageService,
|
|
60
|
+
providedIn: "root"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
65
|
+
minVersion: "12.0.0",
|
|
66
|
+
version: "22.2.3",
|
|
67
|
+
ngImport: i0,
|
|
68
|
+
type: CmatLocalStorageService,
|
|
69
|
+
decorators: [{
|
|
70
|
+
type: Injectable,
|
|
71
|
+
args: [{ providedIn: "root" }]
|
|
72
|
+
}]
|
|
73
|
+
});
|
|
66
74
|
export { CmatLocalStorageService };
|
|
67
|
-
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=cmat-services-local-storage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-local-storage.mjs","sources":["../../../projects/cmat/services/local-storage/local-storage.service.ts"
|
|
1
|
+
{"version":3,"file":"cmat-services-local-storage.mjs","names":[],"sources":["../../../projects/cmat/services/local-storage/local-storage.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\nexport interface StorageOptions {\r\n encrypt?: boolean;\r\n ttl?: number;\r\n}\r\n\r\nexport interface StorageEntry {\r\n data: string;\r\n expiry?: number;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLocalStorageService {\r\n private _encryptionPrefix = '__enc__';\r\n\r\n getItem(key: string, options?: StorageOptions): string | null {\r\n const raw = localStorage.getItem(key);\r\n if (raw === null) {\r\n return null;\r\n }\r\n\r\n let entry: StorageEntry;\r\n try {\r\n entry = JSON.parse(raw) as StorageEntry;\r\n } catch {\r\n return raw;\r\n }\r\n\r\n if (entry.expiry && Date.now() > entry.expiry) {\r\n this.removeItem(key);\r\n return null;\r\n }\r\n\r\n let data = entry.data ?? raw;\r\n\r\n if (options?.encrypt || key.startsWith(this._encryptionPrefix)) {\r\n data = this._decrypt(data);\r\n }\r\n\r\n return data;\r\n }\r\n\r\n setItem(key: string, item: string, options?: StorageOptions): void {\r\n let data = item;\r\n const storageKey = options?.encrypt ? this._encryptionPrefix + key : key;\r\n\r\n if (options?.encrypt) {\r\n data = this._encrypt(item);\r\n }\r\n\r\n const entry: StorageEntry = {\r\n data,\r\n ...(options?.ttl ? { expiry: Date.now() + options.ttl } : {})\r\n };\r\n\r\n localStorage.setItem(storageKey, JSON.stringify(entry));\r\n }\r\n\r\n removeItem(key: string): void {\r\n localStorage.removeItem(key);\r\n localStorage.removeItem(this._encryptionPrefix + key);\r\n }\r\n\r\n private _encrypt(value: string): string {\r\n return btoa(encodeURIComponent(value));\r\n }\r\n\r\n private _decrypt(value: string): string {\r\n return decodeURIComponent(atob(value));\r\n }\r\n}\r\n"],"mappings":";;AAeA,IAAa,0BAAb,MAAa,wBAAuB;CAHpC,cAAA;EAIY,KAAA,oBAAoB;CA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AA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAHnC,MAAA;EAAW,MAAA,CAAA,EACR,YAAY,OACf,CAAA"}
|
|
@@ -1,65 +1,70 @@
|
|
|
1
|
-
import { BreakpointObserver } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { CmatConfigService } from
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
import { BreakpointObserver } from "@angular/cdk/layout";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Injectable, effect, inject, signal } from "@angular/core";
|
|
4
|
+
import { CmatConfigService } from "cmat/services/config";
|
|
5
|
+
var CmatMediaWatcherService = class CmatMediaWatcherService {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._breakpointObserver = inject(BreakpointObserver);
|
|
8
|
+
this._cmatConfigService = inject(CmatConfigService);
|
|
9
|
+
this._mediaChange = signal({
|
|
10
|
+
matchingAliases: [],
|
|
11
|
+
matchingQueries: {}
|
|
12
|
+
}, ...ngDevMode ? [{ debugName: "_mediaChange" }] : /* istanbul ignore next */ []);
|
|
13
|
+
this.mediaChange = this._mediaChange.asReadonly();
|
|
14
|
+
this._breakpointSubscription = null;
|
|
15
|
+
effect(() => {
|
|
16
|
+
const screens = this._cmatConfigService.config().screens;
|
|
17
|
+
if (this._breakpointSubscription) this._breakpointSubscription.unsubscribe();
|
|
18
|
+
const screenQueries = Object.fromEntries(Object.entries(screens).map(([alias, screen]) => [alias, `(min-width: ${screen})`]));
|
|
19
|
+
this._breakpointSubscription = this._breakpointObserver.observe(Object.values(screenQueries)).subscribe((state) => {
|
|
20
|
+
const matchingAliases = [];
|
|
21
|
+
const matchingQueries = {};
|
|
22
|
+
const matchingBreakpoints = Object.entries(state.breakpoints).filter(([, matches]) => matches) ?? [];
|
|
23
|
+
for (const [query] of matchingBreakpoints) {
|
|
24
|
+
const matchingAlias = Object.entries(screenQueries).find(([, q]) => q === query)?.[0];
|
|
25
|
+
if (matchingAlias) {
|
|
26
|
+
matchingAliases.push(matchingAlias);
|
|
27
|
+
matchingQueries[matchingAlias] = query;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
this._mediaChange.set({
|
|
31
|
+
matchingAliases,
|
|
32
|
+
matchingQueries
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static {
|
|
38
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: CmatMediaWatcherService,
|
|
43
|
+
deps: [],
|
|
44
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static {
|
|
48
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
49
|
+
minVersion: "12.0.0",
|
|
50
|
+
version: "22.2.3",
|
|
51
|
+
ngImport: i0,
|
|
52
|
+
type: CmatMediaWatcherService,
|
|
53
|
+
providedIn: "root"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
58
|
+
minVersion: "12.0.0",
|
|
59
|
+
version: "22.2.3",
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
type: CmatMediaWatcherService,
|
|
62
|
+
decorators: [{
|
|
63
|
+
type: Injectable,
|
|
64
|
+
args: [{ providedIn: "root" }]
|
|
65
|
+
}],
|
|
66
|
+
ctorParameters: () => []
|
|
67
|
+
});
|
|
64
68
|
export { CmatMediaWatcherService };
|
|
65
|
-
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=cmat-services-media-watcher.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-media-watcher.mjs","sources":["../../../projects/cmat/services/media-watcher/media-watcher.service.ts"
|
|
1
|
+
{"version":3,"file":"cmat-services-media-watcher.mjs","names":[],"sources":["../../../projects/cmat/services/media-watcher/media-watcher.service.ts"],"sourcesContent":["import { BreakpointObserver } from '@angular/cdk/layout';\r\nimport { Injectable, inject, signal, effect } from '@angular/core';\r\nimport { CmatConfigService } from 'cmat/services/config';\r\nimport { Subscription } from 'rxjs';\r\n\r\nexport interface CmatMediaChange {\r\n matchingAliases: string[];\r\n matchingQueries: Record<string, string>;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatMediaWatcherService {\r\n private readonly _breakpointObserver = inject(BreakpointObserver);\r\n private readonly _cmatConfigService = inject(CmatConfigService);\r\n\r\n private readonly _mediaChange = signal<CmatMediaChange>({\r\n matchingAliases: [],\r\n matchingQueries: {}\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly mediaChange = this._mediaChange.asReadonly();\r\n\r\n private _breakpointSubscription: Subscription | null = null;\r\n\r\n constructor() {\r\n effect(() => {\r\n // 读取配置,建立响应式依赖\r\n const config = this._cmatConfigService.config();\r\n const screens = config.screens;\r\n\r\n // 取消之前的订阅(如果存在)\r\n if (this._breakpointSubscription) {\r\n this._breakpointSubscription.unsubscribe();\r\n }\r\n\r\n // 转换为断点观察器格式\r\n const screenQueries = Object.fromEntries(\r\n Object.entries(screens).map(([alias, screen]) => [\r\n alias,\r\n `(min-width: ${screen})`\r\n ])\r\n );\r\n\r\n // 观察断点变化\r\n this._breakpointSubscription = this._breakpointObserver.observe(Object.values(screenQueries)).subscribe((state) => {\r\n const matchingAliases: string[] = [];\r\n const matchingQueries: Record<string, string> = {};\r\n const matchingBreakpoints = Object.entries(state.breakpoints).filter(([, matches]) => matches) ?? [];\r\n\r\n for (const [query] of matchingBreakpoints) {\r\n const matchingAlias = Object.entries(screenQueries).find(([, q]) => q === query)?.[0];\r\n if (matchingAlias) {\r\n matchingAliases.push(matchingAlias);\r\n matchingQueries[matchingAlias] = query;\r\n }\r\n }\r\n\r\n this._mediaChange.set({\r\n matchingAliases,\r\n matchingQueries\r\n });\r\n });\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;AAaA,IAAa,0BAAb,MAAa,wBAAuB;CAchC,cAAA;EAbiB,KAAA,sBAAsB,OAAO,kBAAkB;EAC/C,KAAA,qBAAqB,OAAO,iBAAiB;EAE7C,KAAA,eAAe,OAAwB;GACpD,iBAAiB,CAAA;GACjB,iBAAiB,CAAA;EACpB,GAAC,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EAGO,KAAA,cAAc,KAAK,aAAa,WAAU;EAE3C,KAAA,0BAA+C;EAGnD,aAAY;GAGR,MAAM,UADS,KAAK,mBAAmB,OACvB,CAAA,CAAO;GAGvB,IAAI,KAAK,yBACL,KAAK,wBAAwB,YAAW;GAI5C,MAAM,gBAAgB,OAAO,YACzB,OAAO,QAAQ,OA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
|
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
|
-
|
|
1
|
+
import { Platform } from "@angular/cdk/platform";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Injectable, inject } from "@angular/core";
|
|
4
|
+
var CmatPlatformService = class CmatPlatformService {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.osName = "os-unknown";
|
|
7
|
+
this._platform = inject(Platform);
|
|
8
|
+
if (!this._platform.isBrowser) return;
|
|
9
|
+
if (navigator.userAgent.includes("Win")) this.osName = "os-windows";
|
|
10
|
+
if (navigator.userAgent.includes("Mac")) this.osName = "os-mac";
|
|
11
|
+
if (navigator.userAgent.includes("X11")) this.osName = "os-unix";
|
|
12
|
+
if (navigator.userAgent.includes("Linux")) this.osName = "os-linux";
|
|
13
|
+
if (this._platform.IOS) this.osName = "os-ios";
|
|
14
|
+
if (this._platform.ANDROID) this.osName = "os-android";
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
18
|
+
minVersion: "12.0.0",
|
|
19
|
+
version: "22.2.3",
|
|
20
|
+
ngImport: i0,
|
|
21
|
+
type: CmatPlatformService,
|
|
22
|
+
deps: [],
|
|
23
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
28
|
+
minVersion: "12.0.0",
|
|
29
|
+
version: "22.2.3",
|
|
30
|
+
ngImport: i0,
|
|
31
|
+
type: CmatPlatformService,
|
|
32
|
+
providedIn: "root"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
37
|
+
minVersion: "12.0.0",
|
|
38
|
+
version: "22.2.3",
|
|
39
|
+
ngImport: i0,
|
|
40
|
+
type: CmatPlatformService,
|
|
41
|
+
decorators: [{
|
|
42
|
+
type: Injectable,
|
|
43
|
+
args: [{ providedIn: "root" }]
|
|
44
|
+
}],
|
|
45
|
+
ctorParameters: () => []
|
|
46
|
+
});
|
|
45
47
|
export { CmatPlatformService };
|
|
46
|
-
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=cmat-services-platform.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-platform.mjs","sources":["../../../projects/cmat/services/platform/platform.service.ts"
|
|
1
|
+
{"version":3,"file":"cmat-services-platform.mjs","names":[],"sources":["../../../projects/cmat/services/platform/platform.service.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform';\r\nimport { Injectable, inject } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatPlatformService {\r\n\r\n osName = 'os-unknown';\r\n\r\n private _platform = inject(Platform);\r\n constructor() {\r\n if (!this._platform.isBrowser) {\r\n return;\r\n }\r\n if (navigator.userAgent.includes('Win')) {\r\n this.osName = 'os-windows';\r\n }\r\n if (navigator.userAgent.includes('Mac')) {\r\n this.osName = 'os-mac';\r\n }\r\n if (navigator.userAgent.includes('X11')) {\r\n this.osName = 'os-unix';\r\n }\r\n if (navigator.userAgent.includes('Linux')) {\r\n this.osName = 'os-linux';\r\n }\r\n if (this._platform.IOS) {\r\n this.osName = 'os-ios';\r\n }\r\n if (this._platform.ANDROID) {\r\n this.osName = 'os-android';\r\n }\r\n }\r\n\r\n}\r\n"],"mappings":";;;AAMA,IAAa,sBAAb,MAAa,oBAAmB;CAK5B,cAAA;EAHA,KAAA,SAAS;EAED,KAAA,YAAY,OAAO,QAAQ;EAE/B,IAAI,CAAC,KAAK,UAAU,WAChB;EAEJ,IAAI,UAAU,UAAU,SAAS,KAAK,GAClC,KAAK,SAAS;EAElB,IAAI,UAAU,UAAU,SAAS,KAAK,GAClC,KAAK,SAAS;EAElB,IAAI,UAAU,UAAU,SAAS,KAAK,GAClC,KAAK,SAAS;EAElB,IAAI,UAAU,UAAU,SAAS,OAAO,GACpC,KAAK,SAAS;EAElB,IAAI,KAAK,UAAU,KACf,KAAK,SAAS;EAElB,IAAI,KAAK,UAAU,SACf,KAAK,SAAS;CAEtB;CA3BS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAnB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,YAFhB;EAAM,CAAA;CAAA;;AAET,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAH/B,MAAA;EAAW,MAAA,CAAA,EACR,YAAY,OACf,CAAA"}
|