cmat 0.0.17 → 0.0.19
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/components/carousel/carousel.component.d.ts +136 -0
- package/components/carousel/carousel.interface.d.ts +38 -0
- package/components/carousel/index.d.ts +5 -0
- package/components/carousel/public-api.d.ts +2 -0
- package/components/custom-formly/public-api.d.ts +2 -0
- package/components/custom-formly/types/knob/knob.component.d.ts +36 -0
- package/components/custom-formly/types/select-table/select-table.component.d.ts +40 -0
- package/components/custom-formly/types/table/table.component.d.ts +3 -8
- package/components/custom-formly/wrappers/form-field/form-field.component.d.ts +4 -4
- package/components/image-viewer/image-viewer.component.d.ts +76 -0
- package/components/image-viewer/index.d.ts +5 -0
- package/components/image-viewer/public-api.d.ts +1 -0
- package/components/knob-input/index.d.ts +5 -0
- package/components/knob-input/knob-input.component.d.ts +95 -0
- package/components/knob-input/public-api.d.ts +1 -0
- package/components/material-datetimepicker/datetimepicker-input.d.ts +2 -2
- package/components/opt-input/index.d.ts +5 -0
- package/components/opt-input/models/config.d.ts +14 -0
- package/components/opt-input/otp-input.component.d.ts +70 -0
- package/components/opt-input/public-api.d.ts +1 -0
- package/components/opt-input/utils/keyboard-util.d.ts +9 -0
- package/components/opt-input/utils/object-util.d.ts +3 -0
- package/components/org-chart/designer/chart-designer.component.d.ts +17 -0
- package/components/org-chart/index.d.ts +5 -0
- package/components/org-chart/node/chart-node.component.d.ts +17 -0
- package/components/org-chart/node/node.type.d.ts +22 -0
- package/components/org-chart/org-chart.component.d.ts +12 -0
- package/components/org-chart/public-api.d.ts +2 -0
- package/components/popover/popover.interfaces.d.ts +1 -1
- package/components/select-table/index.d.ts +5 -0
- package/components/select-table/public-api.d.ts +2 -0
- package/components/select-table/select-table.component.d.ts +96 -0
- package/components/select-table/select-table.type.d.ts +20 -0
- package/components/select-tree/select-tree.component.d.ts +11 -12
- package/components/speed-dial/index.d.ts +5 -0
- package/components/speed-dial/public-api.d.ts +2 -0
- package/components/speed-dial/speed-dial.component.d.ts +63 -0
- package/components/transfer-picker/interface.d.ts +0 -1
- package/components/transfer-picker/transfer-picker-source/transfer-picker-source.component.d.ts +8 -6
- package/components/treetable/index.d.ts +5 -0
- package/components/treetable/public-api.d.ts +2 -0
- package/components/treetable/treetable.component.d.ts +32 -0
- package/components/treetable/treetable.interface.d.ts +9 -0
- package/directives/animate-on-scroll/animate-on-scroll.directive.d.ts +4 -4
- package/directives/arrow-cursor/arrow-cursor.directive.d.ts +31 -0
- package/directives/arrow-cursor/index.d.ts +5 -0
- package/directives/arrow-cursor/public-api.d.ts +1 -0
- package/directives/data-exporter/constants.d.ts +26 -0
- package/directives/data-exporter/data-exporter.directive.d.ts +18 -0
- package/directives/data-exporter/index.d.ts +5 -0
- package/directives/data-exporter/mime.d.ts +5 -0
- package/directives/data-exporter/options.d.ts +21 -0
- package/directives/data-exporter/public-api.d.ts +2 -0
- package/directives/data-exporter/services/exporters/csv-exporter.service.d.ts +12 -0
- package/directives/data-exporter/services/exporters/exporter.d.ts +4 -0
- package/directives/data-exporter/services/exporters/file-exporter.d.ts +8 -0
- package/directives/data-exporter/services/exporters/json-exporter.service.d.ts +11 -0
- package/directives/data-exporter/services/exporters/txt-exporter.service.d.ts +12 -0
- package/directives/data-exporter/services/exporters/worksheet-exporter.d.ts +10 -0
- package/directives/data-exporter/services/exporters/xls-exporter.service.d.ts +14 -0
- package/directives/data-exporter/services/exporters/xlsx-exporter.service.d.ts +9 -0
- package/directives/data-exporter/services/file-util.d.ts +8 -0
- package/directives/data-exporter/services/service-locator.service.d.ts +11 -0
- package/directives/debounce/abstract-debounce.directive.d.ts +1 -1
- package/fesm2022/cmat-animations.mjs.map +1 -1
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +10 -10
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +4 -4
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +711 -0
- package/fesm2022/cmat-components-carousel.mjs.map +1 -0
- package/fesm2022/cmat-components-cascade.mjs +12 -12
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +5 -5
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +225 -155
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +5 -5
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +6 -6
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +7 -7
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +227 -0
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -0
- package/fesm2022/cmat-components-json-editor.mjs +4 -4
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +404 -0
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -0
- package/fesm2022/cmat-components-masonry.mjs +4 -4
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +4 -4
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +53 -53
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +51 -51
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +457 -0
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -0
- package/fesm2022/cmat-components-org-chart.mjs +141 -0
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -0
- package/fesm2022/cmat-components-pagination.mjs +13 -13
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +12 -12
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +10 -10
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +4 -4
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +4 -4
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +11 -11
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +658 -0
- package/fesm2022/cmat-components-select-table.mjs.map +1 -0
- package/fesm2022/cmat-components-select-tree.mjs +75 -57
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +312 -0
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -0
- package/fesm2022/cmat-components-timeline.mjs +14 -14
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +11 -11
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +60 -41
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +122 -0
- package/fesm2022/cmat-components-treetable.mjs.map +1 -0
- package/fesm2022/cmat-components-upload.mjs +11 -11
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +21 -21
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +184 -0
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -0
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +324 -0
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -0
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +8 -6
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +7 -7
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +3 -3
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +211 -0
- package/fesm2022/cmat-services-export-as.mjs.map +1 -0
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat-version.mjs.map +1 -1
- package/icons/arrow-cursor.svg +1 -1
- package/package.json +78 -144
- package/services/export-as/export-as-config.model.d.ts +8 -0
- package/services/export-as/export-as.service.d.ts +43 -0
- package/services/export-as/index.d.ts +5 -0
- package/services/export-as/public-api.d.ts +2 -0
- package/styles/overrides/angular-material.scss +95 -13
- package/esm2022/animations/cmat-animations.mjs +0 -5
- package/esm2022/animations/defaults.mjs +0 -12
- package/esm2022/animations/dropdown.mjs +0 -26
- package/esm2022/animations/expand-collapse.mjs +0 -17
- package/esm2022/animations/fade.mjs +0 -170
- package/esm2022/animations/public-api.mjs +0 -19
- package/esm2022/animations/shake.mjs +0 -59
- package/esm2022/animations/slide.mjs +0 -124
- package/esm2022/animations/transform.mjs +0 -16
- package/esm2022/animations/zoom.mjs +0 -38
- package/esm2022/cmat.mjs +0 -5
- package/esm2022/components/adapter/cmat-components-adapter.mjs +0 -5
- package/esm2022/components/adapter/datetime-adapter.mjs +0 -127
- package/esm2022/components/adapter/datetime-formats.mjs +0 -3
- package/esm2022/components/adapter/dayjs-date-adapter.mjs +0 -198
- package/esm2022/components/adapter/dayjs-date-formats.mjs +0 -12
- package/esm2022/components/adapter/dayjs-datetime-adapter.mjs +0 -100
- package/esm2022/components/adapter/dayjs-datetime-formats.mjs +0 -21
- package/esm2022/components/adapter/native-datetime-adapter.mjs +0 -130
- package/esm2022/components/adapter/native-datetime-formats.mjs +0 -15
- package/esm2022/components/adapter/public-api.mjs +0 -9
- package/esm2022/components/breadcrumb/breadcrumb-item.directive.mjs +0 -19
- package/esm2022/components/breadcrumb/breadcrumb.component.mjs +0 -94
- package/esm2022/components/breadcrumb/breadcrumb.service.mjs +0 -333
- package/esm2022/components/breadcrumb/cmat-components-breadcrumb.mjs +0 -5
- package/esm2022/components/breadcrumb/public-api.mjs +0 -6
- package/esm2022/components/breadcrumb/types/breadcrumb.config.mjs +0 -2
- package/esm2022/components/breadcrumb/types/breadcrumb.mjs +0 -2
- package/esm2022/components/card/card.component.mjs +0 -49
- package/esm2022/components/card/card.types.mjs +0 -2
- package/esm2022/components/card/cmat-components-card.mjs +0 -5
- package/esm2022/components/card/public-api.mjs +0 -3
- package/esm2022/components/cascade/cascade-bottom-sheet/cascade-bottom-sheet.component.mjs +0 -49
- package/esm2022/components/cascade/cascade-list/cascade-list.component.mjs +0 -384
- package/esm2022/components/cascade/cascade-menu/cascade-menu.component.mjs +0 -22
- package/esm2022/components/cascade/cmat-components-cascade.mjs +0 -5
- package/esm2022/components/cascade/options.interface.mjs +0 -2
- package/esm2022/components/cascade/public-api.mjs +0 -4
- package/esm2022/components/chip-input/chip-input.component.mjs +0 -251
- package/esm2022/components/chip-input/cmat-components-chip-input.mjs +0 -5
- package/esm2022/components/chip-input/public-api.mjs +0 -2
- package/esm2022/components/custom-formly/cmat-components-custom-formly.mjs +0 -5
- package/esm2022/components/custom-formly/extension/addons.extension.mjs +0 -13
- package/esm2022/components/custom-formly/public-api.mjs +0 -29
- package/esm2022/components/custom-formly/types/button/button.component.mjs +0 -81
- package/esm2022/components/custom-formly/types/cascade/cascade.component.mjs +0 -71
- package/esm2022/components/custom-formly/types/checklist/checklist.component.mjs +0 -161
- package/esm2022/components/custom-formly/types/chips/chips.component.mjs +0 -55
- package/esm2022/components/custom-formly/types/color-picker/color-picker.component.mjs +0 -15
- package/esm2022/components/custom-formly/types/date-range/date-range.component.mjs +0 -25
- package/esm2022/components/custom-formly/types/datepicker/datepicker.component.mjs +0 -51
- package/esm2022/components/custom-formly/types/multicheckbox/multicheckbox.component.mjs +0 -88
- package/esm2022/components/custom-formly/types/number/number.component.mjs +0 -27
- package/esm2022/components/custom-formly/types/quill/quill.component.mjs +0 -171
- package/esm2022/components/custom-formly/types/radio/radio.component.mjs +0 -87
- package/esm2022/components/custom-formly/types/rating/rating.component.mjs +0 -27
- package/esm2022/components/custom-formly/types/repeat/repeat.component.mjs +0 -25
- package/esm2022/components/custom-formly/types/select/select.component.mjs +0 -167
- package/esm2022/components/custom-formly/types/select-tree/select-tree.component.mjs +0 -66
- package/esm2022/components/custom-formly/types/stepper/horizontal/stepper.component.mjs +0 -28
- package/esm2022/components/custom-formly/types/stepper/stepper.type.mjs +0 -2
- package/esm2022/components/custom-formly/types/stepper/vertical/stepper.component.mjs +0 -28
- package/esm2022/components/custom-formly/types/table/table.component.mjs +0 -127
- package/esm2022/components/custom-formly/types/tabs/tab.component.mjs +0 -16
- package/esm2022/components/custom-formly/types/tags/tags.component.mjs +0 -146
- package/esm2022/components/custom-formly/types/textarea/textarea.component.mjs +0 -25
- package/esm2022/components/custom-formly/types/upload/upload.component.mjs +0 -58
- package/esm2022/components/custom-formly/wrappers/addons/addons.component.mjs +0 -92
- package/esm2022/components/custom-formly/wrappers/card/card.component.mjs +0 -14
- package/esm2022/components/custom-formly/wrappers/expansion/expansion.component.mjs +0 -14
- package/esm2022/components/custom-formly/wrappers/form-field/form-field.component.mjs +0 -47
- package/esm2022/components/custom-formly/wrappers/panel/panel.component.mjs +0 -12
- package/esm2022/components/date-range/cmat-components-date-range.mjs +0 -5
- package/esm2022/components/date-range/date-range.component.mjs +0 -558
- package/esm2022/components/date-range/public-api.mjs +0 -2
- package/esm2022/components/drawer/cmat-components-drawer.mjs +0 -5
- package/esm2022/components/drawer/drawer.component.mjs +0 -301
- package/esm2022/components/drawer/drawer.service.mjs +0 -41
- package/esm2022/components/drawer/drawer.types.mjs +0 -2
- package/esm2022/components/drawer/public-api.mjs +0 -4
- package/esm2022/components/fullscreen/cmat-components-fullscreen.mjs +0 -5
- package/esm2022/components/fullscreen/fullscreen.component.mjs +0 -44
- package/esm2022/components/fullscreen/public-api.mjs +0 -2
- package/esm2022/components/highlight/cmat-components-highlight.mjs +0 -5
- package/esm2022/components/highlight/highlight.component.mjs +0 -80
- package/esm2022/components/highlight/highlight.service.mjs +0 -47
- package/esm2022/components/highlight/public-api.mjs +0 -3
- package/esm2022/components/json-editor/cmat-components-json-editor.mjs +0 -5
- package/esm2022/components/json-editor/json-editor.component.mjs +0 -176
- package/esm2022/components/json-editor/public-api.mjs +0 -2
- package/esm2022/components/masonry/cmat-components-masonry.mjs +0 -5
- package/esm2022/components/masonry/masonry.component.mjs +0 -54
- package/esm2022/components/masonry/public-api.mjs +0 -2
- package/esm2022/components/material-color-picker/base-color.mjs +0 -13
- package/esm2022/components/material-color-picker/cmat-components-material-color-picker.mjs +0 -5
- package/esm2022/components/material-color-picker/material-color-picker.component.mjs +0 -147
- package/esm2022/components/material-color-picker/public-api.mjs +0 -3
- package/esm2022/components/material-color-picker/selected-color.mjs +0 -3
- package/esm2022/components/material-datetimepicker/calendar-body.mjs +0 -76
- package/esm2022/components/material-datetimepicker/calendar.mjs +0 -670
- package/esm2022/components/material-datetimepicker/clock.mjs +0 -290
- package/esm2022/components/material-datetimepicker/cmat-components-material-datetimepicker.mjs +0 -5
- package/esm2022/components/material-datetimepicker/datetimepicker-animations.mjs +0 -34
- package/esm2022/components/material-datetimepicker/datetimepicker-errors.mjs +0 -6
- package/esm2022/components/material-datetimepicker/datetimepicker-filtertype.mjs +0 -8
- package/esm2022/components/material-datetimepicker/datetimepicker-input.mjs +0 -341
- package/esm2022/components/material-datetimepicker/datetimepicker-intl.mjs +0 -63
- package/esm2022/components/material-datetimepicker/datetimepicker-toggle.mjs +0 -87
- package/esm2022/components/material-datetimepicker/datetimepicker-types.mjs +0 -2
- package/esm2022/components/material-datetimepicker/datetimepicker.mjs +0 -531
- package/esm2022/components/material-datetimepicker/month-view.mjs +0 -141
- package/esm2022/components/material-datetimepicker/multi-year-view.mjs +0 -197
- package/esm2022/components/material-datetimepicker/public-api.mjs +0 -11
- package/esm2022/components/material-datetimepicker/time.mjs +0 -455
- package/esm2022/components/material-datetimepicker/year-view.mjs +0 -124
- package/esm2022/components/navigation/cmat-components-navigation.mjs +0 -5
- package/esm2022/components/navigation/horizontal/components/basic/basic.component.mjs +0 -70
- package/esm2022/components/navigation/horizontal/components/branch/branch.component.mjs +0 -82
- package/esm2022/components/navigation/horizontal/components/divider/divider.component.mjs +0 -47
- package/esm2022/components/navigation/horizontal/components/spacer/spacer.component.mjs +0 -47
- package/esm2022/components/navigation/horizontal/horizontal.component.mjs +0 -87
- package/esm2022/components/navigation/navigation.service.mjs +0 -140
- package/esm2022/components/navigation/navigation.types.mjs +0 -3
- package/esm2022/components/navigation/public-api.mjs +0 -5
- package/esm2022/components/navigation/vertical/components/aside/aside.component.mjs +0 -162
- package/esm2022/components/navigation/vertical/components/basic/basic.component.mjs +0 -60
- package/esm2022/components/navigation/vertical/components/collapsable/collapsable.component.mjs +0 -277
- package/esm2022/components/navigation/vertical/components/divider/divider.component.mjs +0 -56
- package/esm2022/components/navigation/vertical/components/group/group.component.mjs +0 -78
- package/esm2022/components/navigation/vertical/components/spacer/spacer.component.mjs +0 -56
- package/esm2022/components/navigation/vertical/vertical.component.mjs +0 -584
- package/esm2022/components/pagination/cmat-components-pagination.mjs +0 -5
- package/esm2022/components/pagination/pagination.component.mjs +0 -67
- package/esm2022/components/pagination/pagination.directive.mjs +0 -197
- package/esm2022/components/pagination/pagination.instance.mjs +0 -2
- package/esm2022/components/pagination/pagination.pipe.mjs +0 -100
- package/esm2022/components/pagination/pagination.service.mjs +0 -90
- package/esm2022/components/pagination/public-api.mjs +0 -6
- package/esm2022/components/password-strength/animations/index.mjs +0 -48
- package/esm2022/components/password-strength/cmat-components-password-strength.mjs +0 -5
- package/esm2022/components/password-strength/enum.mjs +0 -17
- package/esm2022/components/password-strength/mat-pass-toggle-visibility/mat-pass-toggle-visibility.component.mjs +0 -27
- package/esm2022/components/password-strength/mat-password-strength/mat-password-strength.component.mjs +0 -206
- package/esm2022/components/password-strength/mat-password-strength-info/mat-password-strength-info.component.mjs +0 -150
- package/esm2022/components/password-strength/mat-password-strength-validator.mjs +0 -36
- package/esm2022/components/password-strength/public-api.mjs +0 -4
- package/esm2022/components/password-strength/regexp.class.mjs +0 -8
- package/esm2022/components/popover/cmat-components-popover.mjs +0 -5
- package/esm2022/components/popover/popover-trigger.mjs +0 -442
- package/esm2022/components/popover/popover.component.mjs +0 -348
- package/esm2022/components/popover/popover.errors.mjs +0 -27
- package/esm2022/components/popover/popover.interfaces.mjs +0 -2
- package/esm2022/components/popover/popover.target.mjs +0 -18
- package/esm2022/components/popover/popover.type.mjs +0 -2
- package/esm2022/components/popover/public-api.mjs +0 -5
- package/esm2022/components/progress-bar/cmat-components-progress-bar.mjs +0 -5
- package/esm2022/components/progress-bar/progress-bar.component.mjs +0 -58
- package/esm2022/components/progress-bar/public-api.mjs +0 -2
- package/esm2022/components/rating/cmat-components-rating.mjs +0 -5
- package/esm2022/components/rating/public-api.mjs +0 -2
- package/esm2022/components/rating/rating.component.mjs +0 -202
- package/esm2022/components/select-search/cmat-components-select-search.mjs +0 -5
- package/esm2022/components/select-search/default-options.mjs +0 -16
- package/esm2022/components/select-search/public-api.mjs +0 -3
- package/esm2022/components/select-search/select-no-entries-found.directive.mjs +0 -14
- package/esm2022/components/select-search/select-search-clear.directive.mjs +0 -14
- package/esm2022/components/select-search/select-search.component.mjs +0 -485
- package/esm2022/components/select-tree/cmat-components-select-tree.mjs +0 -5
- package/esm2022/components/select-tree/public-api.mjs +0 -4
- package/esm2022/components/select-tree/select-tree.component.mjs +0 -565
- package/esm2022/components/select-tree/select-tree.flatnode.mjs +0 -3
- package/esm2022/components/select-tree/select-tree.node.mjs +0 -3
- package/esm2022/components/timeline/cmat-components-timeline.mjs +0 -5
- package/esm2022/components/timeline/public-api.mjs +0 -3
- package/esm2022/components/timeline/timeline-item/timeline-item.component.mjs +0 -70
- package/esm2022/components/timeline/timeline.component.mjs +0 -107
- package/esm2022/components/toast/cmat-components-toast.mjs +0 -5
- package/esm2022/components/toast/models/global-config.model.mjs +0 -2
- package/esm2022/components/toast/models/toast.model.mjs +0 -2
- package/esm2022/components/toast/models/type.model.mjs +0 -2
- package/esm2022/components/toast/public-api.mjs +0 -7
- package/esm2022/components/toast/toast-modal.component.mjs +0 -53
- package/esm2022/components/toast/toast.component.mjs +0 -30
- package/esm2022/components/toast/toast.service.mjs +0 -122
- package/esm2022/components/transfer-picker/cmat-components-transfer-picker.mjs +0 -5
- package/esm2022/components/transfer-picker/filter/filter.component.mjs +0 -91
- package/esm2022/components/transfer-picker/interface.mjs +0 -17
- package/esm2022/components/transfer-picker/public-api.mjs +0 -8
- package/esm2022/components/transfer-picker/search/search.component.mjs +0 -38
- package/esm2022/components/transfer-picker/transfer-picker-source/transfer-picker-source.component.mjs +0 -201
- package/esm2022/components/transfer-picker/transfer-picker-target/transfer-picker-target.component.mjs +0 -32
- package/esm2022/components/transfer-picker/transfer-picker.component.mjs +0 -84
- package/esm2022/components/transfer-picker/transfer-picker.service.mjs +0 -137
- package/esm2022/components/upload/cmat-components-upload.mjs +0 -5
- package/esm2022/components/upload/files.type.mjs +0 -2
- package/esm2022/components/upload/files.util.service.mjs +0 -89
- package/esm2022/components/upload/public-api.mjs +0 -5
- package/esm2022/components/upload/upload-queue/upload-queue.component.mjs +0 -155
- package/esm2022/components/upload/upload.component.mjs +0 -118
- package/esm2022/directives/animate-on-scroll/animate-on-scroll.directive.mjs +0 -126
- package/esm2022/directives/animate-on-scroll/cmat-directives-animate-on-scroll.mjs +0 -5
- package/esm2022/directives/animate-on-scroll/public-api.mjs +0 -2
- package/esm2022/directives/animate-on-scroll/scroll.service.mjs +0 -38
- package/esm2022/directives/autofocus/autofocus.directive.mjs +0 -20
- package/esm2022/directives/autofocus/cmat-directives-autofocus.mjs +0 -5
- package/esm2022/directives/autofocus/public-api.mjs +0 -2
- package/esm2022/directives/debounce/abstract-debounce.directive.mjs +0 -34
- package/esm2022/directives/debounce/cmat-directives-debounce.mjs +0 -5
- package/esm2022/directives/debounce/debounce-click.directive.mjs +0 -25
- package/esm2022/directives/debounce/debounce-keyup.directive.mjs +0 -25
- package/esm2022/directives/debounce/public-api.mjs +0 -3
- package/esm2022/directives/digit-only/cmat-directives-digit-only.mjs +0 -5
- package/esm2022/directives/digit-only/digit-only.directive.mjs +0 -298
- package/esm2022/directives/digit-only/mask.directive.mjs +0 -84
- package/esm2022/directives/digit-only/public-api.mjs +0 -3
- package/esm2022/directives/equal-validator/cmat-directives-equal-validator.mjs +0 -5
- package/esm2022/directives/equal-validator/equal-validator.directive.mjs +0 -54
- package/esm2022/directives/equal-validator/public-api.mjs +0 -2
- package/esm2022/lib/mock-api/cmat-lib-mock-api.mjs +0 -5
- package/esm2022/lib/mock-api/mock-api.constants.mjs +0 -3
- package/esm2022/lib/mock-api/mock-api.interceptor.mjs +0 -73
- package/esm2022/lib/mock-api/mock-api.request-handler.mjs +0 -48
- package/esm2022/lib/mock-api/mock-api.service.mjs +0 -93
- package/esm2022/lib/mock-api/mock-api.types.mjs +0 -2
- package/esm2022/lib/mock-api/mock-api.utils.mjs +0 -16
- package/esm2022/lib/mock-api/public-api.mjs +0 -6
- package/esm2022/pipes/bytes/bytes.pipe.mjs +0 -25
- package/esm2022/pipes/bytes/cmat-pipes-bytes.mjs +0 -5
- package/esm2022/pipes/bytes/public-api.mjs +0 -2
- package/esm2022/pipes/date-format/cmat-pipes-date-format.mjs +0 -5
- package/esm2022/pipes/date-format/date-format.pipe.mjs +0 -20
- package/esm2022/pipes/date-format/public-api.mjs +0 -2
- package/esm2022/pipes/find-by-key/cmat-pipes-find-by-key.mjs +0 -5
- package/esm2022/pipes/find-by-key/find-by-key.pipe.mjs +0 -23
- package/esm2022/pipes/find-by-key/public-api.mjs +0 -2
- package/esm2022/pipes/group-by/cmat-pipes-group-by.mjs +0 -5
- package/esm2022/pipes/group-by/group-by.pipe.mjs +0 -29
- package/esm2022/pipes/group-by/public-api.mjs +0 -2
- package/esm2022/pipes/keys/cmat-pipes-keys.mjs +0 -5
- package/esm2022/pipes/keys/keys.pipe.mjs +0 -26
- package/esm2022/pipes/keys/public-api.mjs +0 -2
- package/esm2022/pipes/secure/cmat-pipes-secure.mjs +0 -5
- package/esm2022/pipes/secure/public-api.mjs +0 -2
- package/esm2022/pipes/secure/secure-pipe.mjs +0 -46
- package/esm2022/pipes/uppercase/cmat-pipes-uppercase.mjs +0 -5
- package/esm2022/pipes/uppercase/public-api.mjs +0 -2
- package/esm2022/pipes/uppercase/uppercase.pipe.mjs +0 -17
- package/esm2022/public-api.mjs +0 -2
- package/esm2022/services/alert/alert.dialog.mjs +0 -12
- package/esm2022/services/alert/alert.message.mjs +0 -9
- package/esm2022/services/alert/alert.service.mjs +0 -166
- package/esm2022/services/alert/cmat-services-alert.mjs +0 -5
- package/esm2022/services/alert/enum.mjs +0 -15
- package/esm2022/services/alert/public-api.mjs +0 -5
- package/esm2022/services/config/cmat-services-config.mjs +0 -5
- package/esm2022/services/config/config.constants.mjs +0 -3
- package/esm2022/services/config/config.service.mjs +0 -35
- package/esm2022/services/config/public-api.mjs +0 -4
- package/esm2022/services/config/urlStateConfig.service.mjs +0 -30
- package/esm2022/services/confirmation/cmat-services-confirmation.mjs +0 -5
- package/esm2022/services/confirmation/confirmation.service.mjs +0 -51
- package/esm2022/services/confirmation/confirmation.types.mjs +0 -2
- package/esm2022/services/confirmation/dialog/dialog.component.mjs +0 -25
- package/esm2022/services/confirmation/public-api.mjs +0 -3
- package/esm2022/services/data/cmat-services-data.mjs +0 -5
- package/esm2022/services/data/data.service.mjs +0 -169
- package/esm2022/services/data/public-api.mjs +0 -2
- package/esm2022/services/loading/cmat-services-loading.mjs +0 -5
- package/esm2022/services/loading/loading.interceptor.mjs +0 -29
- package/esm2022/services/loading/loading.service.mjs +0 -72
- package/esm2022/services/loading/public-api.mjs +0 -3
- package/esm2022/services/local-storage/cmat-services-local-storage.mjs +0 -5
- package/esm2022/services/local-storage/local-storage.service.mjs +0 -22
- package/esm2022/services/local-storage/public-api.mjs +0 -2
- package/esm2022/services/media-watcher/cmat-services-media-watcher.mjs +0 -5
- package/esm2022/services/media-watcher/media-watcher.service.mjs +0 -55
- package/esm2022/services/media-watcher/public-api.mjs +0 -2
- package/esm2022/services/platform/cmat-services-platform.mjs +0 -5
- package/esm2022/services/platform/platform.service.mjs +0 -46
- package/esm2022/services/platform/public-api.mjs +0 -2
- package/esm2022/services/splash-screen/cmat-services-splash-screen.mjs +0 -5
- package/esm2022/services/splash-screen/public-api.mjs +0 -2
- package/esm2022/services/splash-screen/splash-screen.service.mjs +0 -42
- package/esm2022/services/title/cmat-services-title.mjs +0 -5
- package/esm2022/services/title/public-api.mjs +0 -2
- package/esm2022/services/title/title.service.mjs +0 -46
- package/esm2022/services/translation/cmat-services-translation.mjs +0 -5
- package/esm2022/services/translation/public-api.mjs +0 -2
- package/esm2022/services/translation/translation.service.mjs +0 -62
- package/esm2022/services/utils/cmat-services-utils.mjs +0 -5
- package/esm2022/services/utils/public-api.mjs +0 -2
- package/esm2022/services/utils/utils.service.mjs +0 -467
- package/esm2022/validators/cmat-validators.mjs +0 -5
- package/esm2022/validators/public-api.mjs +0 -2
- package/esm2022/validators/validators.mjs +0 -33
- package/esm2022/version/cmat-version.mjs +0 -5
- package/esm2022/version/public-api.mjs +0 -2
- package/esm2022/version/version.mjs +0 -11
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as FileSaver from 'file-saver-es';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import * as XLSX from 'xlsx';
|
|
6
|
+
|
|
7
|
+
class CmatExportAsService {
|
|
8
|
+
/**
|
|
9
|
+
* Main base64 get method, it will return the file as base64 string
|
|
10
|
+
* @param config your config
|
|
11
|
+
*/
|
|
12
|
+
get(config) {
|
|
13
|
+
switch (config.type.toUpperCase()) {
|
|
14
|
+
case 'CSV':
|
|
15
|
+
return this._getCSV(config);
|
|
16
|
+
case 'TXT':
|
|
17
|
+
return this._getTXT(config);
|
|
18
|
+
case 'XLS':
|
|
19
|
+
return this._getXLS(config);
|
|
20
|
+
case 'XLSX':
|
|
21
|
+
return this._getXLSX(config);
|
|
22
|
+
case 'JSON':
|
|
23
|
+
return this._getJSON(config);
|
|
24
|
+
case 'XML':
|
|
25
|
+
return this._getXML(config);
|
|
26
|
+
default:
|
|
27
|
+
return new Observable((observer) => { observer.error('导出格式不支持.'); });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Save exported file in old javascript way
|
|
32
|
+
* @param config your custom config
|
|
33
|
+
* @param fileName Name of the file to be saved as
|
|
34
|
+
*/
|
|
35
|
+
save(config, fileName) {
|
|
36
|
+
// set download
|
|
37
|
+
config.download = true;
|
|
38
|
+
// get file name with type
|
|
39
|
+
config.fileName = fileName + '.' + config.type;
|
|
40
|
+
return this.get(config);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Converts content string to blob object
|
|
44
|
+
* @param content string to be converted
|
|
45
|
+
*/
|
|
46
|
+
contentToBlob(content) {
|
|
47
|
+
return new Observable((observer) => {
|
|
48
|
+
// get content string and extract mime type
|
|
49
|
+
const arr = content.split(','), mime = (/:(.*?);/.exec(arr[0]))?.[1], bstr = atob(arr[1]);
|
|
50
|
+
let n = bstr.length;
|
|
51
|
+
const u8arr = new Uint8Array(n);
|
|
52
|
+
while (n--) {
|
|
53
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
54
|
+
}
|
|
55
|
+
observer.next(new Blob([u8arr], { type: mime }));
|
|
56
|
+
observer.complete();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Removes base64 file type from a string like "data:text/csv;base64,"
|
|
61
|
+
* @param fileContent the base64 string to remove the type from
|
|
62
|
+
*/
|
|
63
|
+
removeFileTypeFromBase64(fileContent) {
|
|
64
|
+
const re = /^data:[^]*;base64,/g;
|
|
65
|
+
const newContent = re[Symbol.replace](fileContent, '');
|
|
66
|
+
return newContent;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Structure the base64 file content with the file type string
|
|
70
|
+
* @param fileContent file content
|
|
71
|
+
* @param fileMime file mime type "text/csv"
|
|
72
|
+
*/
|
|
73
|
+
addFileTypeToBase64(fileContent, fileMime) {
|
|
74
|
+
return `data:${fileMime};base64,${fileContent}`;
|
|
75
|
+
}
|
|
76
|
+
downloadFromDataURL(fileName, dataURL) {
|
|
77
|
+
// create blob
|
|
78
|
+
this.contentToBlob(dataURL).subscribe((blob) => {
|
|
79
|
+
// download the blob
|
|
80
|
+
this.downloadFromBlob(blob, fileName);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
downloadFromBlob(blob, fileName) {
|
|
84
|
+
FileSaver.saveAs(blob, fileName);
|
|
85
|
+
}
|
|
86
|
+
_getCSV(config) {
|
|
87
|
+
return new Observable((observer) => {
|
|
88
|
+
const element = document.getElementById(config.elementIdOrContent);
|
|
89
|
+
let csv = [];
|
|
90
|
+
const rows = element?.querySelectorAll('table tr');
|
|
91
|
+
rows.forEach((rowElement) => {
|
|
92
|
+
let row = [];
|
|
93
|
+
const cols = rowElement.querySelectorAll('td, th');
|
|
94
|
+
cols.array.forEach((col) => {
|
|
95
|
+
row.push('"' + col.innerText + '"');
|
|
96
|
+
});
|
|
97
|
+
csv.push(row.join(','));
|
|
98
|
+
});
|
|
99
|
+
const csvContent = 'data:text/csv;base64,' + this._btoa(csv.join('\n'));
|
|
100
|
+
if (config.download) {
|
|
101
|
+
this.downloadFromDataURL(config.fileName, csvContent);
|
|
102
|
+
observer.next();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
observer.next(csvContent);
|
|
106
|
+
}
|
|
107
|
+
observer.complete();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
_getTXT(config) {
|
|
111
|
+
const nameFrags = config.fileName?.split('.');
|
|
112
|
+
config.fileName = `${nameFrags?.[0]}.txt`;
|
|
113
|
+
return this._getCSV(config);
|
|
114
|
+
}
|
|
115
|
+
_getXLS(config) {
|
|
116
|
+
return new Observable((observer) => {
|
|
117
|
+
const element = document.getElementById(config.elementIdOrContent);
|
|
118
|
+
const ws3 = XLSX.utils.table_to_sheet(element, config.options);
|
|
119
|
+
const wb = XLSX.utils.book_new();
|
|
120
|
+
XLSX.utils.book_append_sheet(wb, ws3, config.fileName);
|
|
121
|
+
const out = XLSX.write(wb, { type: 'base64' });
|
|
122
|
+
const xlsContent = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,' + out;
|
|
123
|
+
if (config.download) {
|
|
124
|
+
this.downloadFromDataURL(config.fileName, xlsContent);
|
|
125
|
+
observer.next();
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
observer.next(xlsContent);
|
|
129
|
+
}
|
|
130
|
+
observer.complete();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
_getXLSX(config) {
|
|
134
|
+
return this._getXLS(config);
|
|
135
|
+
}
|
|
136
|
+
_getJSON(config) {
|
|
137
|
+
return new Observable((observer) => {
|
|
138
|
+
const data = []; // first row needs fto be headers
|
|
139
|
+
const headers = [];
|
|
140
|
+
const table = document.getElementById(config.elementIdOrContent);
|
|
141
|
+
for (let index = 0; index < table.rows[0].cells.length; index++) {
|
|
142
|
+
headers[index] = table.rows[0].cells[index].innerHTML.toLowerCase().replace(/ /gi, '');
|
|
143
|
+
}
|
|
144
|
+
// go through cells
|
|
145
|
+
for (let i = 1; i < table.rows.length; i++) {
|
|
146
|
+
const tableRow = table.rows[i];
|
|
147
|
+
let rowData = {};
|
|
148
|
+
for (let j = 0; j < tableRow.cells.length; j++) {
|
|
149
|
+
rowData[headers[j]] = tableRow.cells[j].innerHTML;
|
|
150
|
+
}
|
|
151
|
+
data.push(rowData);
|
|
152
|
+
}
|
|
153
|
+
const jsonString = JSON.stringify(data);
|
|
154
|
+
const jsonBase64 = this._btoa(jsonString);
|
|
155
|
+
const dataStr = 'data:text/json;base64,' + jsonBase64;
|
|
156
|
+
if (config.download) {
|
|
157
|
+
this.downloadFromDataURL(config.fileName, dataStr);
|
|
158
|
+
observer.next();
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
observer.next(data);
|
|
162
|
+
}
|
|
163
|
+
observer.complete();
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
_getXML(config) {
|
|
167
|
+
return new Observable((observer) => {
|
|
168
|
+
let xml = '<?xml version="1.0" encoding="UTF-8"?><Root><Classes>';
|
|
169
|
+
const tritem = document.getElementById(config.elementIdOrContent)?.getElementsByTagName('tr');
|
|
170
|
+
if (tritem) {
|
|
171
|
+
Array.from(tritem).forEach((celldata) => {
|
|
172
|
+
if (celldata.cells.length > 0) {
|
|
173
|
+
xml += '<Class name="' + celldata.cells[0].textContent + '">\n';
|
|
174
|
+
for (let m = 1; m < celldata.cells.length; ++m) {
|
|
175
|
+
xml += '\t<data>' + celldata.cells[m].textContent + '</data>\n';
|
|
176
|
+
}
|
|
177
|
+
xml += '</Class>\n';
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
xml += '</Classes></Root>';
|
|
182
|
+
const base64 = 'data:text/xml;base64,' + this._btoa(xml);
|
|
183
|
+
if (config.download) {
|
|
184
|
+
this.downloadFromDataURL(config.fileName, base64);
|
|
185
|
+
observer.next();
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
observer.next(base64);
|
|
189
|
+
}
|
|
190
|
+
observer.complete();
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
_btoa(content) {
|
|
194
|
+
return Buffer.from(content.toString(), 'utf-8').toString('base64');
|
|
195
|
+
}
|
|
196
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatExportAsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
197
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatExportAsService, providedIn: 'root' }); }
|
|
198
|
+
}
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatExportAsService, decorators: [{
|
|
200
|
+
type: Injectable,
|
|
201
|
+
args: [{
|
|
202
|
+
providedIn: 'root'
|
|
203
|
+
}]
|
|
204
|
+
}] });
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Generated bundle index. Do not edit.
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
export { CmatExportAsService };
|
|
211
|
+
//# sourceMappingURL=cmat-services-export-as.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmat-services-export-as.mjs","sources":["../../../projects/cmat/services/export-as/export-as.service.ts","../../../projects/cmat/services/export-as/cmat-services-export-as.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport * as FileSaver from 'file-saver-es';\r\nimport { Observable } from 'rxjs';\r\nimport * as XLSX from 'xlsx';\r\nimport { ExportAsConfig } from './export-as-config.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatExportAsService {\r\n /**\r\n * Main base64 get method, it will return the file as base64 string\r\n * @param config your config\r\n */\r\n get(config: ExportAsConfig): Observable<any> {\r\n switch (config.type.toUpperCase()) {\r\n case 'CSV':\r\n return this._getCSV(config);\r\n case 'TXT':\r\n return this._getTXT(config);\r\n case 'XLS':\r\n return this._getXLS(config);\r\n case 'XLSX':\r\n return this._getXLSX(config);\r\n case 'JSON':\r\n return this._getJSON(config);\r\n case 'XML':\r\n return this._getXML(config);\r\n default:\r\n return new Observable((observer) => { observer.error('导出格式不支持.'); });\r\n }\r\n }\r\n\r\n /**\r\n * Save exported file in old javascript way\r\n * @param config your custom config\r\n * @param fileName Name of the file to be saved as\r\n */\r\n save(config: ExportAsConfig, fileName: string): Observable<string | null> {\r\n // set download\r\n config.download = true;\r\n // get file name with type\r\n config.fileName = fileName + '.' + config.type;\r\n return this.get(config);\r\n }\r\n\r\n /**\r\n * Converts content string to blob object\r\n * @param content string to be converted\r\n */\r\n contentToBlob(content: string): Observable<Blob> {\r\n return new Observable((observer) => {\r\n // get content string and extract mime type\r\n const arr = content.split(','), mime = (/:(.*?);/.exec(arr[0]))?.[1],\r\n bstr = atob(arr[1]);\r\n let n = bstr.length;\r\n const u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n observer.next(new Blob([u8arr], { type: mime }));\r\n observer.complete();\r\n });\r\n }\r\n\r\n /**\r\n * Removes base64 file type from a string like \"data:text/csv;base64,\"\r\n * @param fileContent the base64 string to remove the type from\r\n */\r\n removeFileTypeFromBase64(fileContent: string): string {\r\n const re = /^data:[^]*;base64,/g;\r\n const newContent: string = re[Symbol.replace](fileContent, '');\r\n return newContent;\r\n }\r\n\r\n /**\r\n * Structure the base64 file content with the file type string\r\n * @param fileContent file content\r\n * @param fileMime file mime type \"text/csv\"\r\n */\r\n addFileTypeToBase64(fileContent: string, fileMime: string): string {\r\n return `data:${fileMime};base64,${fileContent}`;\r\n }\r\n\r\n downloadFromDataURL(fileName: string, dataURL: string): void {\r\n // create blob\r\n this.contentToBlob(dataURL).subscribe((blob) => {\r\n // download the blob\r\n this.downloadFromBlob(blob, fileName);\r\n });\r\n }\r\n\r\n downloadFromBlob(blob: Blob, fileName: string): void {\r\n FileSaver.saveAs(blob, fileName);\r\n }\r\n\r\n private _getCSV(config: ExportAsConfig): Observable<string | null> {\r\n return new Observable((observer) => {\r\n const element: HTMLElement | null = document.getElementById(config.elementIdOrContent);\r\n let csv: string[] = [];\r\n const rows: any = element?.querySelectorAll('table tr');\r\n rows.forEach((rowElement: { querySelectorAll: (arg0: string) => any; }) => {\r\n let row: string[] = [];\r\n const cols = rowElement.querySelectorAll('td, th');\r\n\r\n cols.array.forEach((col: { innerText: string; }) => {\r\n row.push('\"' + col.innerText + '\"');\r\n });\r\n csv.push(row.join(','));\r\n });\r\n\r\n const csvContent = 'data:text/csv;base64,' + this._btoa(csv.join('\\n'));\r\n if (config.download) {\r\n this.downloadFromDataURL(config.fileName, csvContent);\r\n observer.next();\r\n } else {\r\n observer.next(csvContent);\r\n }\r\n observer.complete();\r\n });\r\n }\r\n\r\n private _getTXT(config: ExportAsConfig): Observable<string | null> {\r\n const nameFrags = config.fileName?.split('.');\r\n config.fileName = `${nameFrags?.[0]}.txt`;\r\n return this._getCSV(config);\r\n }\r\n\r\n private _getXLS(config: ExportAsConfig): Observable<string | null> {\r\n return new Observable((observer) => {\r\n const element: HTMLElement | null = document.getElementById(config.elementIdOrContent);\r\n const ws3 = XLSX.utils.table_to_sheet(element, config.options);\r\n const wb = XLSX.utils.book_new();\r\n XLSX.utils.book_append_sheet(wb, ws3, config.fileName);\r\n const out = XLSX.write(wb, { type: 'base64' });\r\n const xlsContent = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,' + out;\r\n if (config.download) {\r\n this.downloadFromDataURL(config.fileName, xlsContent);\r\n observer.next();\r\n } else {\r\n observer.next(xlsContent);\r\n }\r\n observer.complete();\r\n });\r\n }\r\n\r\n private _getXLSX(config: ExportAsConfig): Observable<string | null> {\r\n return this._getXLS(config);\r\n }\r\n\r\n\r\n private _getJSON(config: ExportAsConfig): Observable<any[] | null> {\r\n return new Observable((observer) => {\r\n const data = []; // first row needs fto be headers\r\n const headers = [];\r\n const table = document.getElementById(config.elementIdOrContent) as HTMLTableElement;\r\n for (let index = 0; index < table.rows[0].cells.length; index++) {\r\n headers[index] = table.rows[0].cells[index].innerHTML.toLowerCase().replace(/ /gi, '');\r\n }\r\n // go through cells\r\n for (let i = 1; i < table.rows.length; i++) {\r\n const tableRow = table.rows[i];\r\n let rowData: Record<string, string> = {};\r\n for (let j = 0; j < tableRow.cells.length; j++) {\r\n rowData[headers[j]] = tableRow.cells[j].innerHTML;\r\n }\r\n data.push(rowData);\r\n }\r\n const jsonString = JSON.stringify(data);\r\n const jsonBase64 = this._btoa(jsonString);\r\n const dataStr = 'data:text/json;base64,' + jsonBase64;\r\n if (config.download) {\r\n this.downloadFromDataURL(config.fileName, dataStr);\r\n observer.next();\r\n } else {\r\n observer.next(data);\r\n }\r\n observer.complete();\r\n });\r\n }\r\n\r\n private _getXML(config: ExportAsConfig): Observable<string | null> {\r\n return new Observable((observer) => {\r\n let xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><Root><Classes>';\r\n const tritem = document.getElementById(config.elementIdOrContent)?.getElementsByTagName('tr');\r\n\r\n if (tritem) {\r\n Array.from(tritem).forEach((celldata) => {\r\n if (celldata.cells.length > 0) {\r\n xml += '<Class name=\"' + celldata.cells[0].textContent + '\">\\n';\r\n for (let m = 1; m < celldata.cells.length; ++m) {\r\n xml += '\\t<data>' + celldata.cells[m].textContent + '</data>\\n';\r\n }\r\n xml += '</Class>\\n';\r\n }\r\n });\r\n\r\n }\r\n\r\n xml += '</Classes></Root>';\r\n const base64 = 'data:text/xml;base64,' + this._btoa(xml);\r\n if (config.download) {\r\n this.downloadFromDataURL(config.fileName, base64);\r\n observer.next();\r\n } else {\r\n observer.next(base64);\r\n }\r\n observer.complete();\r\n });\r\n }\r\n\r\n private _btoa(content: string): string {\r\n return Buffer.from(content.toString(), 'utf-8').toString('base64')\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MASa,mBAAmB,CAAA;AAC5B;;;AAGG;AACH,IAAA,GAAG,CAAC,MAAsB,EAAA;AACtB,QAAA,QAAQ,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;AAC7B,YAAA,KAAK,KAAK;AACN,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,YAAA,KAAK,KAAK;AACN,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,YAAA,KAAK,KAAK;AACN,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,YAAA,KAAK,KAAK;AACN,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,YAAA;AACI,gBAAA,OAAO,IAAI,UAAU,CAAC,CAAC,QAAQ,KAAO,EAAA,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;;;AAIhF;;;;AAIG;IACH,IAAI,CAAC,MAAsB,EAAE,QAAgB,EAAA;;AAEzC,QAAA,MAAM,CAAC,QAAQ,GAAG,IAAI;;QAEtB,MAAM,CAAC,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI;AAC9C,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;;AAG3B;;;AAGG;AACH,IAAA,aAAa,CAAC,OAAe,EAAA;AACzB,QAAA,OAAO,IAAI,UAAU,CAAC,CAAC,QAAQ,KAAI;;AAE/B,YAAA,MAAM,GAA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AAA,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;;8GA3M7D,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFhB,MAAM,EAAA,CAAA,CAAA;;2FAET,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -61,10 +61,10 @@ class CmatLoadingService {
|
|
|
61
61
|
this._show$.next(false);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
65
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
65
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingService, providedIn: 'root' }); }
|
|
66
66
|
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingService, decorators: [{
|
|
68
68
|
type: Injectable,
|
|
69
69
|
args: [{
|
|
70
70
|
providedIn: 'root'
|
|
@@ -89,10 +89,10 @@ class CmatLoadingInterceptor {
|
|
|
89
89
|
this._cmatLoadingService.setLoadingStatus(false, req.url);
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingInterceptor, deps: [{ token: CmatLoadingService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
93
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingInterceptor }); }
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLoadingInterceptor, decorators: [{
|
|
96
96
|
type: Injectable
|
|
97
97
|
}], ctorParameters: () => [{ type: CmatLoadingService }] });
|
|
98
98
|
|
|
@@ -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","../../../projects/cmat/services/loading/cmat-services-loading.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { BehaviorSubject, Observable } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLoadingService {\r\n private _auto$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\r\n private _mode$: BehaviorSubject<'determinate' | 'indeterminate'> = new BehaviorSubject<'determinate' | 'indeterminate'>('indeterminate');\r\n private _progress$: BehaviorSubject<number | null> = new BehaviorSubject<number | null>(0);\r\n private _show$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\r\n private _urlMap: Map<string, boolean> = new Map<string, boolean>();\r\n\r\n constructor(private _httpClient: HttpClient) {\r\n }\r\n\r\n get auto$(): Observable<boolean> {\r\n return this._auto$.asObservable();\r\n }\r\n\r\n get mode$(): Observable<'determinate' | 'indeterminate'> {\r\n return this._mode$.asObservable();\r\n }\r\n\r\n get progress$(): Observable<number | null> {\r\n return this._progress$.asObservable();\r\n }\r\n\r\n get show$(): Observable<boolean> {\r\n return this._show$.asObservable();\r\n }\r\n\r\n show(): void {\r\n this._show$.next(true);\r\n }\r\n\r\n hide(): void {\r\n this._show$.next(false);\r\n }\r\n\r\n setAutoMode(value: boolean): void {\r\n this._auto$.next(value);\r\n }\r\n\r\n setMode(value: 'determinate' | 'indeterminate'): void {\r\n this._mode$.next(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$.next(value);\r\n }\r\n\r\n setLoadingStatus(status: boolean, url: string): void {\r\n // Return if the url was not provided\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 === true) {\r\n this._urlMap.set(url, status);\r\n this._show$.next(true);\r\n }\r\n else if (status === false && this._urlMap.has(url)) {\r\n this._urlMap.delete(url);\r\n }\r\n\r\n // Only set the status to 'false' if all outgoing requests are completed\r\n if (this._urlMap.size === 0) {\r\n this._show$.next(false);\r\n }\r\n }\r\n}\r\n\r\n","import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\r\nimport { Injectable } 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 handleRequestsAutomatically: boolean;\r\n\r\n constructor(\r\n private _cmatLoadingService: CmatLoadingService\r\n ) {\r\n this._cmatLoadingService.auto$\r\n .subscribe((value: boolean) => {\r\n this.handleRequestsAutomatically = value;\r\n });\r\n }\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n if (!this.handleRequestsAutomatically || 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 // Set the status to false if there are any errors or the request is completed\r\n this._cmatLoadingService.setLoadingStatus(false, req.url);\r\n }));\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CmatLoadingService"],"mappings":";;;;;MAOa,kBAAkB,CAAA;AAO3B,IAAA,WAAA,CAAoB,WAAuB,EAAA;QAAvB,IAAW,CAAA,WAAA,GAAX,WAAW
|
|
1
|
+
{"version":3,"file":"cmat-services-loading.mjs","sources":["../../../projects/cmat/services/loading/loading.service.ts","../../../projects/cmat/services/loading/loading.interceptor.ts","../../../projects/cmat/services/loading/cmat-services-loading.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { BehaviorSubject, Observable } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLoadingService {\r\n private _auto$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\r\n private _mode$: BehaviorSubject<'determinate' | 'indeterminate'> = new BehaviorSubject<'determinate' | 'indeterminate'>('indeterminate');\r\n private _progress$: BehaviorSubject<number | null> = new BehaviorSubject<number | null>(0);\r\n private _show$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\r\n private _urlMap: Map<string, boolean> = new Map<string, boolean>();\r\n\r\n constructor(private _httpClient: HttpClient) {\r\n }\r\n\r\n get auto$(): Observable<boolean> {\r\n return this._auto$.asObservable();\r\n }\r\n\r\n get mode$(): Observable<'determinate' | 'indeterminate'> {\r\n return this._mode$.asObservable();\r\n }\r\n\r\n get progress$(): Observable<number | null> {\r\n return this._progress$.asObservable();\r\n }\r\n\r\n get show$(): Observable<boolean> {\r\n return this._show$.asObservable();\r\n }\r\n\r\n show(): void {\r\n this._show$.next(true);\r\n }\r\n\r\n hide(): void {\r\n this._show$.next(false);\r\n }\r\n\r\n setAutoMode(value: boolean): void {\r\n this._auto$.next(value);\r\n }\r\n\r\n setMode(value: 'determinate' | 'indeterminate'): void {\r\n this._mode$.next(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$.next(value);\r\n }\r\n\r\n setLoadingStatus(status: boolean, url: string): void {\r\n // Return if the url was not provided\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 === true) {\r\n this._urlMap.set(url, status);\r\n this._show$.next(true);\r\n }\r\n else if (status === false && this._urlMap.has(url)) {\r\n this._urlMap.delete(url);\r\n }\r\n\r\n // Only set the status to 'false' if all outgoing requests are completed\r\n if (this._urlMap.size === 0) {\r\n this._show$.next(false);\r\n }\r\n }\r\n}\r\n\r\n","import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\r\nimport { Injectable } 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 handleRequestsAutomatically: boolean;\r\n\r\n constructor(\r\n private _cmatLoadingService: CmatLoadingService\r\n ) {\r\n this._cmatLoadingService.auto$\r\n .subscribe((value: boolean) => {\r\n this.handleRequestsAutomatically = value;\r\n });\r\n }\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n if (!this.handleRequestsAutomatically || 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 // Set the status to false if there are any errors or the request is completed\r\n this._cmatLoadingService.setLoadingStatus(false, req.url);\r\n }));\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CmatLoadingService"],"mappings":";;;;;MAOa,kBAAkB,CAAA;AAO3B,IAAA,WAAA,CAAoB,WAAuB,EAAA;QAAvB,IAAW,CAAA,WAAA,GAAX,WAAW;AANvB,QAAA,IAAA,CAAA,MAAM,GAA6B,IAAI,eAAe,CAAU,IAAI,CAAC;AACrE,QAAA,IAAA,CAAA,MAAM,GAAqD,IAAI,eAAe,CAAkC,eAAe,CAAC;AAChI,QAAA,IAAA,CAAA,UAAU,GAAmC,IAAI,eAAe,CAAgB,CAAC,CAAC;AAClF,QAAA,IAAA,CAAA,MAAM,GAA6B,IAAI,eAAe,CAAU,KAAK,CAAC;AACtE,QAAA,IAAA,CAAA,OAAO,GAAyB,IAAI,GAAG,EAAmB;;AAKlE,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;;AAGrC,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;;AAGrC,IAAA,IAAI,SAAS,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE;;AAGzC,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;;IAGrC,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;IAG1B,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;;AAG3B,IAAA,WAAW,CAAC,KAAc,EAAA;AACtB,QAAA,IAAI,C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11
|
removeItem(key) {
|
|
12
12
|
localStorage.removeItem(key);
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
15
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
15
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLocalStorageService, providedIn: 'root' }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatLocalStorageService, decorators: [{
|
|
18
18
|
type: Injectable,
|
|
19
19
|
args: [{
|
|
20
20
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-local-storage.mjs","sources":["../../../projects/cmat/services/local-storage/local-storage.service.ts","../../../projects/cmat/services/local-storage/cmat-services-local-storage.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLocalStorageService {\r\n getItem(key: string): string | null {\r\n return localStorage.getItem(key);\r\n }\r\n\r\n setItem(key: string, item: string): void {\r\n localStorage.setItem(key, item);\r\n }\r\n\r\n removeItem(key: string): void {\r\n localStorage.removeItem(key);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,uBAAuB,CAAA;AAChC,IAAA,OAAO,CAAC,GAAW,EAAA;AACf,QAAA,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"cmat-services-local-storage.mjs","sources":["../../../projects/cmat/services/local-storage/local-storage.service.ts","../../../projects/cmat/services/local-storage/cmat-services-local-storage.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatLocalStorageService {\r\n getItem(key: string): string | null {\r\n return localStorage.getItem(key);\r\n }\r\n\r\n setItem(key: string, item: string): void {\r\n localStorage.setItem(key, item);\r\n }\r\n\r\n removeItem(key: string): void {\r\n localStorage.removeItem(key);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,uBAAuB,CAAA;AAChC,IAAA,OAAO,CAAC,GAAW,EAAA;AACf,QAAA,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;;IAGpC,OAAO,CAAC,GAAW,EAAE,IAAY,EAAA;AAC7B,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC;;AAGnC,IAAA,UAAU,CAAC,GAAW,EAAA;AAClB,QAAA,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;;8GAVvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAET,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACJD;;AAEG;;;;"}
|
|
@@ -44,10 +44,10 @@ class CmatMediaWatcherService {
|
|
|
44
44
|
onMediaQueryChange$(query) {
|
|
45
45
|
return this._breakpointObserver.observe(query);
|
|
46
46
|
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
47
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatMediaWatcherService, deps: [{ token: i1.BreakpointObserver }, { token: i2.CmatConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
48
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatMediaWatcherService, providedIn: 'root' }); }
|
|
49
49
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatMediaWatcherService, decorators: [{
|
|
51
51
|
type: Injectable,
|
|
52
52
|
args: [{
|
|
53
53
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-media-watcher.mjs","sources":["../../../projects/cmat/services/media-watcher/media-watcher.service.ts","../../../projects/cmat/services/media-watcher/cmat-services-media-watcher.ts"],"sourcesContent":["import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';\r\nimport { Injectable, OnDestroy } from '@angular/core';\r\nimport { fromPairs } from 'lodash-es';\r\nimport { Observable, ReplaySubject, Subject } from 'rxjs';\r\nimport { map, switchMap, takeUntil } from 'rxjs/operators';\r\nimport { CmatConfigService } from 'cmat/services/config';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatMediaWatcherService implements OnDestroy {\r\n private _onMediaChange: ReplaySubject<{ matchingAliases: string[]; matchingQueries: any }> = new ReplaySubject<{ matchingAliases: string[]; matchingQueries: any }>(1);\r\n private _unsubscribeAll: Subject<void> = new Subject<void>();\r\n\r\n constructor(\r\n private _breakpointObserver: BreakpointObserver,\r\n private _cmatConfigService: CmatConfigService\r\n ) {\r\n this._cmatConfigService.config$.pipe(\r\n takeUntil(this._unsubscribeAll),\r\n map(config => fromPairs(Object.entries(config.screens).map(([alias, screen]) => ([alias, `(min-width: ${screen as string})`])))),\r\n switchMap(screens => this._breakpointObserver.observe(Object.values(screens)).pipe(\r\n map((state) => {\r\n // Prepare the observable values and set their defaults\r\n const matchingAliases: string[] = [];\r\n const matchingQueries: any = {};\r\n\r\n // Get the matching breakpoints and use them to fill the subject\r\n const matchingBreakpoints = Object.entries(state.breakpoints).filter(([, matches]) => matches) ?? [];\r\n for (const [query] of matchingBreakpoints) {\r\n // Find the alias of the matching query\r\n const matchingAlias = Object.entries(screens).find(([, q]) => q === query)?.[0];\r\n\r\n // Add the matching query to the observable values\r\n if (matchingAlias) {\r\n matchingAliases.push(matchingAlias);\r\n matchingQueries[matchingAlias] = query;\r\n }\r\n }\r\n\r\n // Execute the observable\r\n this._onMediaChange.next({\r\n matchingAliases,\r\n matchingQueries\r\n });\r\n })\r\n ))\r\n ).subscribe();\r\n }\r\n\r\n get onMediaChange$(): Observable<{ matchingAliases: string[]; matchingQueries: any }> {\r\n return this._onMediaChange.asObservable();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n }\r\n\r\n onMediaQueryChange$(query: string | string[]): Observable<BreakpointState> {\r\n return this._breakpointObserver.observe(query);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAUa,uBAAuB,CAAA;IAIhC,WACY,CAAA,mBAAuC,EACvC,kBAAqC,EAAA;QADrC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB
|
|
1
|
+
{"version":3,"file":"cmat-services-media-watcher.mjs","sources":["../../../projects/cmat/services/media-watcher/media-watcher.service.ts","../../../projects/cmat/services/media-watcher/cmat-services-media-watcher.ts"],"sourcesContent":["import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';\r\nimport { Injectable, OnDestroy } from '@angular/core';\r\nimport { fromPairs } from 'lodash-es';\r\nimport { Observable, ReplaySubject, Subject } from 'rxjs';\r\nimport { map, switchMap, takeUntil } from 'rxjs/operators';\r\nimport { CmatConfigService } from 'cmat/services/config';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatMediaWatcherService implements OnDestroy {\r\n private _onMediaChange: ReplaySubject<{ matchingAliases: string[]; matchingQueries: any }> = new ReplaySubject<{ matchingAliases: string[]; matchingQueries: any }>(1);\r\n private _unsubscribeAll: Subject<void> = new Subject<void>();\r\n\r\n constructor(\r\n private _breakpointObserver: BreakpointObserver,\r\n private _cmatConfigService: CmatConfigService\r\n ) {\r\n this._cmatConfigService.config$.pipe(\r\n takeUntil(this._unsubscribeAll),\r\n map(config => fromPairs(Object.entries(config.screens).map(([alias, screen]) => ([alias, `(min-width: ${screen as string})`])))),\r\n switchMap(screens => this._breakpointObserver.observe(Object.values(screens)).pipe(\r\n map((state) => {\r\n // Prepare the observable values and set their defaults\r\n const matchingAliases: string[] = [];\r\n const matchingQueries: any = {};\r\n\r\n // Get the matching breakpoints and use them to fill the subject\r\n const matchingBreakpoints = Object.entries(state.breakpoints).filter(([, matches]) => matches) ?? [];\r\n for (const [query] of matchingBreakpoints) {\r\n // Find the alias of the matching query\r\n const matchingAlias = Object.entries(screens).find(([, q]) => q === query)?.[0];\r\n\r\n // Add the matching query to the observable values\r\n if (matchingAlias) {\r\n matchingAliases.push(matchingAlias);\r\n matchingQueries[matchingAlias] = query;\r\n }\r\n }\r\n\r\n // Execute the observable\r\n this._onMediaChange.next({\r\n matchingAliases,\r\n matchingQueries\r\n });\r\n })\r\n ))\r\n ).subscribe();\r\n }\r\n\r\n get onMediaChange$(): Observable<{ matchingAliases: string[]; matchingQueries: any }> {\r\n return this._onMediaChange.asObservable();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n }\r\n\r\n onMediaQueryChange$(query: string | string[]): Observable<BreakpointState> {\r\n return this._breakpointObserver.observe(query);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAUa,uBAAuB,CAAA;IAIhC,WACY,CAAA,mBAAuC,EACvC,kBAAqC,EAAA;QADrC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB;QACnB,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB;AALtB,QAAA,IAAA,CAAA,cAAc,GAAuE,IAAI,aAAa,CAAsD,CAAC,CAAC;AAC9J,QAAA,IAAA,CAAA,eAAe,GAAkB,IAAI,OAAO,EAAQ;AAMxD,QAAA,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAChC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,EAC/B,GAAG,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAe,YAAA,EAAA,MAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAChI,SAAS,CAAC,OAAO,IAAI,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAC9E,GAAG,CAAC,CAAC,KAAK,KAAI;;YAEV,MAAM,eAAe,GAAa,EAAE;YACpC,MAAM,eAAe,GAAQ,EAAE;;YAG/B,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,OAAO,CAAC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uB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -35,10 +35,10 @@ class CmatPlatformService {
|
|
|
35
35
|
this.osName = 'os-android';
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatPlatformService, deps: [{ token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatPlatformService, providedIn: 'root' }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatPlatformService, decorators: [{
|
|
42
42
|
type: Injectable,
|
|
43
43
|
args: [{
|
|
44
44
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-platform.mjs","sources":["../../../projects/cmat/services/platform/platform.service.ts","../../../projects/cmat/services/platform/cmat-services-platform.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatPlatformService {\r\n osName = 'os-unknown';\r\n\r\n constructor(private _platform: Platform) {\r\n // If the platform is not a browser, return immediately\r\n if (!this._platform.isBrowser) {\r\n return;\r\n }\r\n\r\n // Windows\r\n if (navigator.userAgent.includes('Win')) {\r\n this.osName = 'os-windows';\r\n }\r\n\r\n // Mac OS\r\n if (navigator.userAgent.includes('Mac')) {\r\n this.osName = 'os-mac';\r\n }\r\n\r\n // Unix\r\n if (navigator.userAgent.includes('X11')) {\r\n this.osName = 'os-unix';\r\n }\r\n\r\n // Linux\r\n if (navigator.userAgent.includes('Linux')) {\r\n this.osName = 'os-linux';\r\n }\r\n\r\n // iOS\r\n if (this._platform.IOS) {\r\n this.osName = 'os-ios';\r\n }\r\n\r\n // Android\r\n if (this._platform.ANDROID) {\r\n this.osName = 'os-android';\r\n }\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,mBAAmB,CAAA;AAG5B,IAAA,WAAA,CAAoB,SAAmB,EAAA;QAAnB,IAAS,CAAA,SAAA,GAAT,SAAS
|
|
1
|
+
{"version":3,"file":"cmat-services-platform.mjs","sources":["../../../projects/cmat/services/platform/platform.service.ts","../../../projects/cmat/services/platform/cmat-services-platform.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatPlatformService {\r\n osName = 'os-unknown';\r\n\r\n constructor(private _platform: Platform) {\r\n // If the platform is not a browser, return immediately\r\n if (!this._platform.isBrowser) {\r\n return;\r\n }\r\n\r\n // Windows\r\n if (navigator.userAgent.includes('Win')) {\r\n this.osName = 'os-windows';\r\n }\r\n\r\n // Mac OS\r\n if (navigator.userAgent.includes('Mac')) {\r\n this.osName = 'os-mac';\r\n }\r\n\r\n // Unix\r\n if (navigator.userAgent.includes('X11')) {\r\n this.osName = 'os-unix';\r\n }\r\n\r\n // Linux\r\n if (navigator.userAgent.includes('Linux')) {\r\n this.osName = 'os-linux';\r\n }\r\n\r\n // iOS\r\n if (this._platform.IOS) {\r\n this.osName = 'os-ios';\r\n }\r\n\r\n // Android\r\n if (this._platform.ANDROID) {\r\n this.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AAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFhB,MAAM,EAAA,CAAA,CAAA;;2FAET,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -28,10 +28,10 @@ class CmatSplashScreenService {
|
|
|
28
28
|
hide() {
|
|
29
29
|
this._document.body.classList.add('cmat-splash-screen-hidden');
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatSplashScreenService, deps: [{ token: DOCUMENT }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatSplashScreenService, providedIn: 'root' }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatSplashScreenService, decorators: [{
|
|
35
35
|
type: Injectable,
|
|
36
36
|
args: [{
|
|
37
37
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-splash-screen.mjs","sources":["../../../projects/cmat/services/splash-screen/splash-screen.service.ts","../../../projects/cmat/services/splash-screen/cmat-services-splash-screen.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable, OnDestroy } from '@angular/core';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { Subject } from 'rxjs';\r\nimport { filter, take, takeUntil } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatSplashScreenService implements OnDestroy {\r\n private _unsubscribeAll: Subject<void> = new Subject<void>();\r\n\r\n constructor(\r\n @Inject(DOCUMENT) private _document: any,\r\n private _router: Router\r\n ) {\r\n // Hide it on the first NavigationEnd event\r\n this._router.events\r\n .pipe(\r\n takeUntil(this._unsubscribeAll),\r\n filter(event => event instanceof NavigationEnd),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.hide();\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n }\r\n\r\n show(): void {\r\n this._document.body.classList.remove('cmat-splash-screen-hidden');\r\n }\r\n\r\n hide(): void {\r\n this._document.body.classList.add('cmat-splash-screen-hidden');\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,uBAAuB,CAAA;IAGhC,WAC8B,CAAA,SAAc,EAChC,OAAe,EAAA;QADG,IAAS,CAAA,SAAA,GAAT,SAAS
|
|
1
|
+
{"version":3,"file":"cmat-services-splash-screen.mjs","sources":["../../../projects/cmat/services/splash-screen/splash-screen.service.ts","../../../projects/cmat/services/splash-screen/cmat-services-splash-screen.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable, OnDestroy } from '@angular/core';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { Subject } from 'rxjs';\r\nimport { filter, take, takeUntil } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatSplashScreenService implements OnDestroy {\r\n private _unsubscribeAll: Subject<void> = new Subject<void>();\r\n\r\n constructor(\r\n @Inject(DOCUMENT) private _document: any,\r\n private _router: Router\r\n ) {\r\n // Hide it on the first NavigationEnd event\r\n this._router.events\r\n .pipe(\r\n takeUntil(this._unsubscribeAll),\r\n filter(event => event instanceof NavigationEnd),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.hide();\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next(void 0);\r\n this._unsubscribeAll.complete();\r\n }\r\n\r\n show(): void {\r\n this._document.body.classList.remove('cmat-splash-screen-hidden');\r\n }\r\n\r\n hide(): void {\r\n this._document.body.classList.add('cmat-splash-screen-hidden');\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,uBAAuB,CAAA;IAGhC,WAC8B,CAAA,SAAc,EAChC,OAAe,EAAA;QADG,IAAS,CAAA,SAAA,GAAT,SAAS;QAC3B,IAAO,CAAA,OAAA,GAAP,OAAO;AAJX,QAAA,IAAA,CAAA,eAAe,GAAkB,IAAI,OAAO,EAAQ;;QAOxD,IAAI,CAAC,OAAO,CAAC;aACR,IAAI,CACD,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,EAC/B,MAAM,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa,CAAC,EAC/C,IAAI,CAAC,CAAC,CAAC;aAEV,SAAS,CAAC,MAAK;YACZ,IAAI,CAAC,IAAI,EAAE;AACf,SAAC,CAAC;;IAGV,WAAW,GAAA;QACP,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,QAAA,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;;IAGnC,IAAI,GAAA;QACA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,2BAA2B,CAAC;;IAGrE,IAAI,GAAA;QACA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC;;AA7BzD,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,kBAIpB,QAAQ,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAJX,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAET,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;0BAKQ,MAAM;2BAAC,QAAQ;;;ACbxB;;AAEG;;;;"}
|
|
@@ -35,10 +35,10 @@ class CmatTitleService {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTitleService, deps: [{ token: i1.Title }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTitleService, providedIn: 'root' }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTitleService, decorators: [{
|
|
42
42
|
type: Injectable,
|
|
43
43
|
args: [{
|
|
44
44
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-title.mjs","sources":["../../../projects/cmat/services/title/title.service.ts","../../../projects/cmat/services/title/cmat-services-title.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Title } from '@angular/platform-browser';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { Subscription } from 'rxjs';\r\nimport { filter, map, mergeMap } from 'rxjs/operators';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTitleService {\r\n sub: Subscription;\r\n appName: string;\r\n\r\n constructor(private _titleService: Title, private _router: Router) {\r\n this.sub = this._router.events.pipe(\r\n filter((event: any) => event instanceof NavigationEnd),\r\n map(() => this._router.routerState.root),\r\n map((route) => {\r\n\r\n while (route.firstChild) {\r\n route = route.firstChild;\r\n }\r\n\r\n return route;\r\n }),\r\n\r\n mergeMap(route => route.data))\r\n .subscribe((data: Record<string, any>) => {\r\n let title = data['title'];\r\n\r\n if (title) {\r\n const fragment = this._router.url.split('#')[1];\r\n\r\n if (fragment) {\r\n title += ' | ' + CmatUtilsService.toTitleCase(fragment);\r\n }\r\n }\r\n\r\n if (title && this.appName) {\r\n title += ' - ' + this.appName;\r\n } else if (this.appName) {\r\n title = this.appName;\r\n }\r\n\r\n if (title) {\r\n this._titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAUa,gBAAgB,CAAA;IAIzB,WAAoB,CAAA,aAAoB,EAAU,OAAe,EAAA;QAA7C,IAAa,CAAA,aAAA,GAAb,aAAa
|
|
1
|
+
{"version":3,"file":"cmat-services-title.mjs","sources":["../../../projects/cmat/services/title/title.service.ts","../../../projects/cmat/services/title/cmat-services-title.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Title } from '@angular/platform-browser';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { Subscription } from 'rxjs';\r\nimport { filter, map, mergeMap } from 'rxjs/operators';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTitleService {\r\n sub: Subscription;\r\n appName: string;\r\n\r\n constructor(private _titleService: Title, private _router: Router) {\r\n this.sub = this._router.events.pipe(\r\n filter((event: any) => event instanceof NavigationEnd),\r\n map(() => this._router.routerState.root),\r\n map((route) => {\r\n\r\n while (route.firstChild) {\r\n route = route.firstChild;\r\n }\r\n\r\n return route;\r\n }),\r\n\r\n mergeMap(route => route.data))\r\n .subscribe((data: Record<string, any>) => {\r\n let title = data['title'];\r\n\r\n if (title) {\r\n const fragment = this._router.url.split('#')[1];\r\n\r\n if (fragment) {\r\n title += ' | ' + CmatUtilsService.toTitleCase(fragment);\r\n }\r\n }\r\n\r\n if (title && this.appName) {\r\n title += ' - ' + this.appName;\r\n } else if (this.appName) {\r\n title = this.appName;\r\n }\r\n\r\n if (title) {\r\n this._titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAUa,gBAAgB,CAAA;IAIzB,WAAoB,CAAA,aAAoB,EAAU,OAAe,EAAA;QAA7C,IAAa,CAAA,aAAA,GAAb,aAAa;QAAiB,IAAO,CAAA,OAAA,GAAP,OAAO;AACrD,QAAA,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAC/B,MAAM,CAAC,CAAC,KAAU,KAAK,KAAK,YAAY,aAAa,CAAC,EACtD,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EACxC,GAAG,CAAC,CAAC,KAAK,K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;;2FAET,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -51,10 +51,10 @@ class CmatTranslationService {
|
|
|
51
51
|
getTranslationAsync(key, interpolateParams) {
|
|
52
52
|
return this._translate.get(key, interpolateParams);
|
|
53
53
|
}
|
|
54
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
55
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTranslationService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTranslationService, providedIn: 'root' }); }
|
|
56
56
|
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatTranslationService, decorators: [{
|
|
58
58
|
type: Injectable,
|
|
59
59
|
args: [{
|
|
60
60
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-services-translation.mjs","sources":["../../../projects/cmat/services/translation/translation.service.ts","../../../projects/cmat/services/translation/cmat-services-translation.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTranslationService {\r\n\r\n private readonly _defaultLanguage = 'zh';\r\n\r\n private _onLanguageChanged = new Subject<string>();\r\n\r\n constructor(private _translate: TranslateService) {\r\n this.setDefaultLanguage(this._defaultLanguage);\r\n }\r\n\r\n get languageChanged$(): Observable<string> {\r\n return this._onLanguageChanged.asObservable();\r\n }\r\n\r\n addLanguages(lang: string[]): void {\r\n this._translate.addLangs(lang);\r\n }\r\n\r\n\r\n setDefaultLanguage(lang: string): void {\r\n this._translate.setDefaultLang(lang);\r\n }\r\n\r\n getDefaultLanguage(): string {\r\n return this._translate.defaultLang;\r\n }\r\n\r\n getBrowserLanguage(): string | void {\r\n return this._translate.getBrowserLang();\r\n }\r\n\r\n\r\n useBrowserLanguage(): string | void {\r\n const browserLang = this.getBrowserLanguage();\r\n\r\n if (browserLang && (/en|zh/.exec(browserLang))) {\r\n this.changeLanguage(browserLang);\r\n return browserLang;\r\n }\r\n return browserLang;\r\n }\r\n\r\n changeLanguage(language: string = 'zh'): string {\r\n if (!language) {\r\n language = this._translate.defaultLang;\r\n }\r\n\r\n if (language !== this._translate.currentLang) {\r\n setTimeout(() => {\r\n this._translate.use(language);\r\n this._onLanguageChanged.next(language);\r\n });\r\n }\r\n return language;\r\n }\r\n\r\n\r\n getTranslation(key: string | string[], interpolateParams?: object): any {\r\n return this._translate.instant(key, interpolateParams);\r\n }\r\n\r\n\r\n getTranslationAsync(key: string | string[], interpolateParams?: object): Observable<any> {\r\n return this._translate.get(key, interpolateParams);\r\n }\r\n}\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,sBAAsB,CAAA;AAM/B,IAAA,WAAA,CAAoB,UAA4B,EAAA;QAA5B,IAAU,CAAA,UAAA,GAAV,UAAU
|
|
1
|
+
{"version":3,"file":"cmat-services-translation.mjs","sources":["../../../projects/cmat/services/translation/translation.service.ts","../../../projects/cmat/services/translation/cmat-services-translation.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTranslationService {\r\n\r\n private readonly _defaultLanguage = 'zh';\r\n\r\n private _onLanguageChanged = new Subject<string>();\r\n\r\n constructor(private _translate: TranslateService) {\r\n this.setDefaultLanguage(this._defaultLanguage);\r\n }\r\n\r\n get languageChanged$(): Observable<string> {\r\n return this._onLanguageChanged.asObservable();\r\n }\r\n\r\n addLanguages(lang: string[]): void {\r\n this._translate.addLangs(lang);\r\n }\r\n\r\n\r\n setDefaultLanguage(lang: string): void {\r\n this._translate.setDefaultLang(lang);\r\n }\r\n\r\n getDefaultLanguage(): string {\r\n return this._translate.defaultLang;\r\n }\r\n\r\n getBrowserLanguage(): string | void {\r\n return this._translate.getBrowserLang();\r\n }\r\n\r\n\r\n useBrowserLanguage(): string | void {\r\n const browserLang = this.getBrowserLanguage();\r\n\r\n if (browserLang && (/en|zh/.exec(browserLang))) {\r\n this.changeLanguage(browserLang);\r\n return browserLang;\r\n }\r\n return browserLang;\r\n }\r\n\r\n changeLanguage(language: string = 'zh'): string {\r\n if (!language) {\r\n language = this._translate.defaultLang;\r\n }\r\n\r\n if (language !== this._translate.currentLang) {\r\n setTimeout(() => {\r\n this._translate.use(language);\r\n this._onLanguageChanged.next(language);\r\n });\r\n }\r\n return language;\r\n }\r\n\r\n\r\n getTranslation(key: string | string[], interpolateParams?: object): any {\r\n return this._translate.instant(key, interpolateParams);\r\n }\r\n\r\n\r\n getTranslationAsync(key: string | string[], interpolateParams?: object): Observable<any> {\r\n return this._translate.get(key, interpolateParams);\r\n }\r\n}\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,sBAAsB,CAAA;AAM/B,IAAA,WAAA,CAAoB,UAA4B,EAAA;QAA5B,IAAU,CAAA,UAAA,GAAV,UAAU;QAJb,IAAgB,CAAA,gBAAA,GAAG,IAAI;AAEhC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,OAAO,EAAU;AAG9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AAC,GAAG,EAAE,iBAAiB,CAAC;;IAI1D,mBAAmB,CAAC,GAAsB,EAAE,iBAA0B,EAAA;QAClE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAC;;8GA/D7C,sBAAsB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cAFnB,MAAM,EAAA,CAAA,CAAA;;2FAET,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -456,10 +456,10 @@ class CmatUtilsService {
|
|
|
456
456
|
}
|
|
457
457
|
return id;
|
|
458
458
|
}
|
|
459
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
460
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
459
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatUtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
460
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatUtilsService, providedIn: 'root' }); }
|
|
461
461
|
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CmatUtilsService, decorators: [{
|
|
463
463
|
type: Injectable,
|
|
464
464
|
args: [{
|
|
465
465
|
providedIn: 'root'
|