cmat 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +26 -34
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +467 -556
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +270 -259
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +200 -116
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +85 -38
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +841 -0
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +996 -0
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +310 -264
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +16 -20
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +120 -137
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +17 -24
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +18 -24
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +12 -12
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +10 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +48 -41
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +104 -107
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +12 -15
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +118 -75
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +196 -178
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +26 -41
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +467 -450
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +143 -132
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +68 -83
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +18 -24
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +220 -136
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +262 -215
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +227 -195
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +15 -34
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +95 -88
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +70 -67
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +190 -159
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +276 -213
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +178 -128
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +44 -28
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +107 -163
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +29 -36
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +111 -118
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +65 -66
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +32 -39
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +186 -176
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +16 -19
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +60 -69
- 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-directives-seamless-auto-scroll.mjs +31 -30
- package/fesm2022/cmat-directives-seamless-auto-scroll.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 +7 -13
- 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 +26 -27
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +14 -23
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +8 -8
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +6 -10
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +30 -47
- 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 +43 -34
- 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 +11 -11
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +4 -4
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9229 -7508
- package/fesm2022/cmat.mjs.map +1 -1
- package/icons/material-icons/heroicons-outline.svg +3 -0
- package/icons/material-icons/heroicons-solid.svg +3 -0
- package/package.json +10 -1
- package/styles/components/bundle.scss +21 -0
- package/styles/overrides/angular-material.scss +22 -1
- package/tailwind/plugins/theming.js +183 -183
- package/types/cmat-components-breadcrumb.d.ts +40 -37
- package/types/cmat-components-card.d.ts +11 -13
- package/types/cmat-components-carousel.d.ts +87 -113
- package/types/cmat-components-cascade.d.ts +84 -65
- package/types/cmat-components-chip-input.d.ts +29 -24
- package/types/cmat-components-code-editor.d.ts +28 -12
- package/types/cmat-components-color-picker.d.ts +236 -0
- package/types/cmat-components-custom-formly.d.ts +316 -184
- package/types/cmat-components-data-picker.d.ts +372 -0
- package/types/cmat-components-date-range.d.ts +31 -36
- package/types/cmat-components-date-time-display.d.ts +8 -8
- package/types/cmat-components-drawer.d.ts +30 -32
- package/types/cmat-components-empty-state.d.ts +9 -10
- package/types/cmat-components-file-preview.d.ts +9 -9
- package/types/cmat-components-filter-toolbar.d.ts +15 -15
- package/types/cmat-components-form-actions.d.ts +5 -5
- package/types/cmat-components-fullscreen.d.ts +5 -5
- package/types/cmat-components-highlight.d.ts +13 -14
- package/types/cmat-components-image-viewer.d.ts +29 -33
- package/types/cmat-components-inline-loading.d.ts +6 -6
- package/types/cmat-components-json-editor.d.ts +15 -17
- package/types/cmat-components-knob-input.d.ts +58 -55
- package/types/cmat-components-masonry.d.ts +9 -12
- package/types/cmat-components-material-color-picker.d.ts +16 -21
- package/types/cmat-components-material-datetimepicker.d.ts +174 -216
- package/types/cmat-components-navigation.d.ts +34 -39
- package/types/cmat-components-opt-input.d.ts +35 -33
- package/types/cmat-components-org-chart.d.ts +8 -9
- package/types/cmat-components-page-header.d.ts +9 -9
- package/types/cmat-components-pagination.d.ts +36 -40
- package/types/cmat-components-password-strength.d.ts +58 -64
- package/types/cmat-components-popover.d.ts +22 -32
- package/types/cmat-components-progress-bar.d.ts +7 -10
- package/types/cmat-components-qrcode.d.ts +22 -22
- package/types/cmat-components-rating.d.ts +17 -19
- package/types/cmat-components-rich-text-editor.d.ts +11 -12
- package/types/cmat-components-select-search.d.ts +48 -36
- package/types/cmat-components-select-table.d.ts +38 -34
- package/types/cmat-components-select-tree.d.ts +17 -15
- package/types/cmat-components-skeleton.d.ts +27 -10
- package/types/cmat-components-speed-dial.d.ts +24 -33
- package/types/cmat-components-status-tag.d.ts +19 -9
- package/types/cmat-components-table-toolbar.d.ts +7 -7
- package/types/cmat-components-timeline.d.ts +33 -34
- package/types/cmat-components-toast.d.ts +26 -30
- package/types/cmat-components-transfer-picker.d.ts +51 -56
- package/types/cmat-components-treetable.d.ts +12 -13
- package/types/cmat-components-upload.d.ts +33 -38
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
- package/types/cmat-directives-arrow-cursor.d.ts +18 -20
- package/types/cmat-directives-data-exporter.d.ts +10 -10
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +13 -13
- package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
- package/types/cmat-pipes-secure.d.ts +1 -3
- package/types/cmat-services-alert.d.ts +11 -12
- package/types/cmat-services-config.d.ts +2 -7
- package/types/cmat-services-confirmation.d.ts +2 -2
- package/types/cmat-services-data.d.ts +0 -1
- package/types/cmat-services-loading.d.ts +14 -22
- package/types/cmat-services-media-watcher.d.ts +5 -5
- package/types/cmat-services-translation.d.ts +4 -5
- package/types/cmat.d.ts +2167 -1746
|
@@ -1,27 +1,65 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, viewChild, inject, Renderer2, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import { toDataURL, toCanvas, toString } from 'qrcode';
|
|
5
5
|
|
|
6
6
|
class CmatQRCodeComponent {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.allowEmptyString = false
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
this.
|
|
8
|
+
this.allowEmptyString = input(false, /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "allowEmptyString" }] : /* istanbul ignore next */ []));
|
|
10
|
+
this.cssClass = input('qrcode', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "cssClass" }] : /* istanbul ignore next */ []));
|
|
12
|
+
this.elementType = input('canvas', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "elementType" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.errorCorrectionLevel = input('M', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "errorCorrectionLevel" }] : /* istanbul ignore next */ []));
|
|
16
|
+
this.imageSrc = input(/* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [undefined, { debugName: "imageSrc" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.imageHeight = input(/* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [undefined, { debugName: "imageHeight" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.imageWidth = input(/* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [undefined, { debugName: "imageWidth" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.margin = input(4, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "margin" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.qrdata = input('', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "qrdata" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.scale = input(4, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.width = input(10, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.alt = input(/* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [undefined, { debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.ariaLabel = input(/* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.title = input(/* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
36
|
+
this.qrCodeURL = output();
|
|
37
|
+
this.qrcElement = viewChild.required('qrcElement');
|
|
17
38
|
this.context = null;
|
|
18
39
|
this._renderer = inject(Renderer2);
|
|
19
40
|
this._sanitizer = inject(DomSanitizer);
|
|
20
41
|
this._currentOperationId = 0;
|
|
21
42
|
this._previousObjectUrl = null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
// 监听输入变化并重新生成二维码
|
|
44
|
+
effect(() => {
|
|
45
|
+
// 读取所有 input signal,任何一项变化都会触发重新生成
|
|
46
|
+
this.allowEmptyString();
|
|
47
|
+
this.elementType();
|
|
48
|
+
this.errorCorrectionLevel();
|
|
49
|
+
this.imageSrc();
|
|
50
|
+
this.imageHeight();
|
|
51
|
+
this.imageWidth();
|
|
52
|
+
this.margin();
|
|
53
|
+
this.qrdata();
|
|
54
|
+
this.scale();
|
|
55
|
+
this.width();
|
|
56
|
+
this.alt();
|
|
57
|
+
this.ariaLabel();
|
|
58
|
+
this.title();
|
|
59
|
+
untracked(() => {
|
|
60
|
+
this._createQRCode();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
25
63
|
}
|
|
26
64
|
convertBase64ImageUrlToBlob(base64ImageUrl) {
|
|
27
65
|
const parts = base64ImageUrl.split(';base64,');
|
|
@@ -62,7 +100,7 @@ class CmatQRCodeComponent {
|
|
|
62
100
|
this.qrCodeURL.emit(urlSanitized);
|
|
63
101
|
}
|
|
64
102
|
_isValidQrCodeText(data) {
|
|
65
|
-
if (this.allowEmptyString === false) {
|
|
103
|
+
if (this.allowEmptyString() === false) {
|
|
66
104
|
return !(typeof data === 'undefined' ||
|
|
67
105
|
data === '' ||
|
|
68
106
|
data === 'null' ||
|
|
@@ -70,9 +108,9 @@ class CmatQRCodeComponent {
|
|
|
70
108
|
}
|
|
71
109
|
return !(typeof data === 'undefined');
|
|
72
110
|
}
|
|
73
|
-
_toDataURL(qrCodeConfig) {
|
|
111
|
+
_toDataURL(qrCodeConfig, qrData) {
|
|
74
112
|
return new Promise((resolve, reject) => {
|
|
75
|
-
toDataURL(
|
|
113
|
+
toDataURL(qrData, qrCodeConfig, (err, url) => {
|
|
76
114
|
if (err) {
|
|
77
115
|
reject(err);
|
|
78
116
|
}
|
|
@@ -82,9 +120,9 @@ class CmatQRCodeComponent {
|
|
|
82
120
|
});
|
|
83
121
|
});
|
|
84
122
|
}
|
|
85
|
-
_toCanvas(canvas, qrCodeConfig) {
|
|
123
|
+
_toCanvas(canvas, qrCodeConfig, qrData) {
|
|
86
124
|
return new Promise((resolve, reject) => {
|
|
87
|
-
toCanvas(canvas,
|
|
125
|
+
toCanvas(canvas, qrData, qrCodeConfig, (error) => {
|
|
88
126
|
if (error) {
|
|
89
127
|
reject(error);
|
|
90
128
|
}
|
|
@@ -94,9 +132,9 @@ class CmatQRCodeComponent {
|
|
|
94
132
|
});
|
|
95
133
|
});
|
|
96
134
|
}
|
|
97
|
-
_toSVG(qrCodeConfig) {
|
|
135
|
+
_toSVG(qrCodeConfig, qrData) {
|
|
98
136
|
return new Promise((resolve, reject) => {
|
|
99
|
-
toString(
|
|
137
|
+
toString(qrData, qrCodeConfig, (err, url) => {
|
|
100
138
|
if (err) {
|
|
101
139
|
reject(err);
|
|
102
140
|
}
|
|
@@ -107,43 +145,45 @@ class CmatQRCodeComponent {
|
|
|
107
145
|
});
|
|
108
146
|
}
|
|
109
147
|
_renderElement(element) {
|
|
110
|
-
|
|
111
|
-
|
|
148
|
+
const qrcEl = this.qrcElement();
|
|
149
|
+
for (const node of Array.from(qrcEl.nativeElement.childNodes)) {
|
|
150
|
+
this._renderer.removeChild(qrcEl.nativeElement, node);
|
|
112
151
|
}
|
|
113
|
-
this._renderer.appendChild(
|
|
152
|
+
this._renderer.appendChild(qrcEl.nativeElement, element);
|
|
114
153
|
}
|
|
115
154
|
_createQRCode() {
|
|
116
155
|
const operationId = ++this._currentOperationId;
|
|
117
156
|
try {
|
|
118
|
-
|
|
157
|
+
let qrData = this.qrdata();
|
|
158
|
+
if (!this._isValidQrCodeText(qrData)) {
|
|
119
159
|
throw new Error('`qrdata` 配置为空,请设置 `allowEmptyString="true"` 来覆盖此特性。');
|
|
120
160
|
}
|
|
121
|
-
if (this._isValidQrCodeText(
|
|
122
|
-
|
|
161
|
+
if (this._isValidQrCodeText(qrData) && qrData === '') {
|
|
162
|
+
qrData = ' ';
|
|
123
163
|
}
|
|
124
164
|
const config = {
|
|
125
|
-
errorCorrectionLevel: this.errorCorrectionLevel,
|
|
126
|
-
margin: this.margin,
|
|
127
|
-
scale: this.scale,
|
|
128
|
-
width: this.width,
|
|
165
|
+
errorCorrectionLevel: this.errorCorrectionLevel(),
|
|
166
|
+
margin: this.margin(),
|
|
167
|
+
scale: this.scale(),
|
|
168
|
+
width: this.width(),
|
|
129
169
|
};
|
|
130
|
-
const centerImageSrc = this.imageSrc;
|
|
131
|
-
const centerImageHeight = this.imageHeight ?? 40;
|
|
132
|
-
const centerImageWidth = this.imageWidth ?? 40;
|
|
133
|
-
switch (this.elementType) {
|
|
170
|
+
const centerImageSrc = this.imageSrc();
|
|
171
|
+
const centerImageHeight = this.imageHeight() ?? 40;
|
|
172
|
+
const centerImageWidth = this.imageWidth() ?? 40;
|
|
173
|
+
switch (this.elementType()) {
|
|
134
174
|
case 'canvas': {
|
|
135
175
|
const canvasElement = this._renderer.createElement('canvas');
|
|
136
176
|
this.context = canvasElement.getContext('2d');
|
|
137
|
-
this._toCanvas(canvasElement, config)
|
|
177
|
+
this._toCanvas(canvasElement, config, qrData)
|
|
138
178
|
.then(() => {
|
|
139
179
|
if (operationId !== this._currentOperationId) {
|
|
140
|
-
return;
|
|
180
|
+
return;
|
|
141
181
|
}
|
|
142
|
-
if (this.ariaLabel) {
|
|
143
|
-
this._renderer.setAttribute(canvasElement, 'aria-label', `${this.ariaLabel}`);
|
|
182
|
+
if (this.ariaLabel()) {
|
|
183
|
+
this._renderer.setAttribute(canvasElement, 'aria-label', `${this.ariaLabel()}`);
|
|
144
184
|
}
|
|
145
|
-
if (this.title) {
|
|
146
|
-
this._renderer.setAttribute(canvasElement, 'title', `${this.title}`);
|
|
185
|
+
if (this.title()) {
|
|
186
|
+
this._renderer.setAttribute(canvasElement, 'title', `${this.title()}`);
|
|
147
187
|
}
|
|
148
188
|
if (centerImageSrc && this.context) {
|
|
149
189
|
this._centerImage = new Image(centerImageWidth, centerImageHeight);
|
|
@@ -176,15 +216,15 @@ class CmatQRCodeComponent {
|
|
|
176
216
|
}
|
|
177
217
|
case 'svg': {
|
|
178
218
|
const svgParentElement = this._renderer.createElement('div');
|
|
179
|
-
this._toSVG(config)
|
|
219
|
+
this._toSVG(config, qrData)
|
|
180
220
|
.then((svgString) => {
|
|
181
221
|
if (operationId !== this._currentOperationId) {
|
|
182
222
|
return;
|
|
183
223
|
}
|
|
184
224
|
this._renderer.setProperty(svgParentElement, 'innerHTML', svgString);
|
|
185
225
|
const svgElement = svgParentElement.firstChild;
|
|
186
|
-
this._renderer.setAttribute(svgElement, 'height', `${this.width}`);
|
|
187
|
-
this._renderer.setAttribute(svgElement, 'width', `${this.width}`);
|
|
226
|
+
this._renderer.setAttribute(svgElement, 'height', `${this.width()}`);
|
|
227
|
+
this._renderer.setAttribute(svgElement, 'width', `${this.width()}`);
|
|
188
228
|
this._renderElement(svgElement);
|
|
189
229
|
this.emitQRCodeURL(svgElement);
|
|
190
230
|
})
|
|
@@ -197,20 +237,20 @@ class CmatQRCodeComponent {
|
|
|
197
237
|
case 'img':
|
|
198
238
|
default: {
|
|
199
239
|
const imgElement = this._renderer.createElement('img');
|
|
200
|
-
this._toDataURL(config)
|
|
240
|
+
this._toDataURL(config, qrData)
|
|
201
241
|
.then((dataUrl) => {
|
|
202
242
|
if (operationId !== this._currentOperationId) {
|
|
203
243
|
return;
|
|
204
244
|
}
|
|
205
|
-
if (this.alt) {
|
|
206
|
-
imgElement.setAttribute('alt', this.alt);
|
|
245
|
+
if (this.alt()) {
|
|
246
|
+
imgElement.setAttribute('alt', this.alt());
|
|
207
247
|
}
|
|
208
|
-
if (this.ariaLabel) {
|
|
209
|
-
imgElement.setAttribute('aria-label', this.ariaLabel);
|
|
248
|
+
if (this.ariaLabel()) {
|
|
249
|
+
imgElement.setAttribute('aria-label', this.ariaLabel());
|
|
210
250
|
}
|
|
211
251
|
imgElement.setAttribute('src', dataUrl);
|
|
212
|
-
if (this.title) {
|
|
213
|
-
imgElement.setAttribute('title', this.title);
|
|
252
|
+
if (this.title()) {
|
|
253
|
+
imgElement.setAttribute('title', this.title());
|
|
214
254
|
}
|
|
215
255
|
this._renderElement(imgElement);
|
|
216
256
|
this.emitQRCodeURL(imgElement);
|
|
@@ -225,52 +265,19 @@ class CmatQRCodeComponent {
|
|
|
225
265
|
console.error('生成QRCode错误:', e instanceof Error ? e.message : String(e));
|
|
226
266
|
}
|
|
227
267
|
}
|
|
228
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
229
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatQRCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
269
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.2", type: CmatQRCodeComponent, isStandalone: true, selector: "cmat-qrcode", inputs: { allowEmptyString: { classPropertyName: "allowEmptyString", publicName: "allowEmptyString", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, elementType: { classPropertyName: "elementType", publicName: "elementType", isSignal: true, isRequired: false, transformFunction: null }, errorCorrectionLevel: { classPropertyName: "errorCorrectionLevel", publicName: "errorCorrectionLevel", isSignal: true, isRequired: false, transformFunction: null }, imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null }, imageHeight: { classPropertyName: "imageHeight", publicName: "imageHeight", isSignal: true, isRequired: false, transformFunction: null }, imageWidth: { classPropertyName: "imageWidth", publicName: "imageWidth", isSignal: true, isRequired: false, transformFunction: null }, margin: { classPropertyName: "margin", publicName: "margin", isSignal: true, isRequired: false, transformFunction: null }, qrdata: { classPropertyName: "qrdata", publicName: "qrdata", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { qrCodeURL: "qrCodeURL" }, viewQueries: [{ propertyName: "qrcElement", first: true, predicate: ["qrcElement"], descendants: true, isSignal: true }], exportAs: ["cmatQRCode"], ngImport: i0, template: '<div #qrcElement [class]="cssClass()"></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
230
270
|
}
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatQRCodeComponent, decorators: [{
|
|
232
272
|
type: Component,
|
|
233
273
|
args: [{
|
|
234
274
|
selector: 'cmat-qrcode',
|
|
235
275
|
encapsulation: ViewEncapsulation.None,
|
|
236
276
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
237
|
-
template: '<div #qrcElement [class]="cssClass"></div>',
|
|
277
|
+
template: '<div #qrcElement [class]="cssClass()"></div>',
|
|
238
278
|
exportAs: 'cmatQRCode',
|
|
239
279
|
}]
|
|
240
|
-
}], propDecorators: { allowEmptyString: [{
|
|
241
|
-
type: Input
|
|
242
|
-
}], cssClass: [{
|
|
243
|
-
type: Input
|
|
244
|
-
}], elementType: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}], errorCorrectionLevel: [{
|
|
247
|
-
type: Input
|
|
248
|
-
}], imageSrc: [{
|
|
249
|
-
type: Input
|
|
250
|
-
}], imageHeight: [{
|
|
251
|
-
type: Input
|
|
252
|
-
}], imageWidth: [{
|
|
253
|
-
type: Input
|
|
254
|
-
}], margin: [{
|
|
255
|
-
type: Input
|
|
256
|
-
}], qrdata: [{
|
|
257
|
-
type: Input
|
|
258
|
-
}], scale: [{
|
|
259
|
-
type: Input
|
|
260
|
-
}], width: [{
|
|
261
|
-
type: Input
|
|
262
|
-
}], alt: [{
|
|
263
|
-
type: Input
|
|
264
|
-
}], ariaLabel: [{
|
|
265
|
-
type: Input
|
|
266
|
-
}], title: [{
|
|
267
|
-
type: Input
|
|
268
|
-
}], qrCodeURL: [{
|
|
269
|
-
type: Output
|
|
270
|
-
}], qrcElement: [{
|
|
271
|
-
type: ViewChild,
|
|
272
|
-
args: ['qrcElement', { static: true }]
|
|
273
|
-
}] } });
|
|
280
|
+
}], ctorParameters: () => [], propDecorators: { allowEmptyString: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmptyString", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], elementType: [{ type: i0.Input, args: [{ isSignal: true, alias: "elementType", required: false }] }], errorCorrectionLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorCorrectionLevel", required: false }] }], imageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSrc", required: false }] }], imageHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageHeight", required: false }] }], imageWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageWidth", required: false }] }], margin: [{ type: i0.Input, args: [{ isSignal: true, alias: "margin", required: false }] }], qrdata: [{ type: i0.Input, args: [{ isSignal: true, alias: "qrdata", required: false }] }], scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], qrCodeURL: [{ type: i0.Output, args: ["qrCodeURL"] }], qrcElement: [{ type: i0.ViewChild, args: ['qrcElement', { isSignal: true }] }] } });
|
|
274
281
|
|
|
275
282
|
/**
|
|
276
283
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-qrcode.mjs","sources":["../../../projects/cmat/components/qrcode/qrcode.component.ts","../../../projects/cmat/components/qrcode/cmat-components-qrcode.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n inject,\r\n Input,\r\n OnChanges,\r\n Output,\r\n Renderer2,\r\n ViewChild,\r\n ViewEncapsulation,\r\n} from '@angular/core';\r\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\r\nimport {\r\n QRCodeRenderersOptions,\r\n QRCodeToDataURLOptions,\r\n QRCodeToStringOptions,\r\n toCanvas,\r\n toDataURL,\r\n toString\r\n} from 'qrcode';\r\nimport { FixMeLater, QRCodeConfigType, QRCodeElementType, QRCodeErrorCorrectionLevel } from './qrcode.types';\r\n\r\n@Component({\r\n selector: 'cmat-qrcode',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<div #qrcElement [class]=\"cssClass\"></div>',\r\n exportAs: 'cmatQRCode',\r\n})\r\nexport class CmatQRCodeComponent implements OnChanges {\r\n @Input() public allowEmptyString: boolean = false;\r\n @Input() public cssClass: string = 'qrcode';\r\n @Input() public elementType: QRCodeElementType = 'canvas';\r\n @Input()\r\n public errorCorrectionLevel: QRCodeErrorCorrectionLevel = 'M';\r\n @Input() public imageSrc?: string;\r\n @Input() public imageHeight?: number;\r\n @Input() public imageWidth?: number;\r\n @Input() public margin:number = 4;\r\n @Input() public qrdata: string = '';\r\n @Input() public scale: number = 4;\r\n @Input() public width: number = 10;\r\n\r\n @Input() public alt?: string;\r\n @Input() public ariaLabel?: string;\r\n @Input() public title?: string;\r\n\r\n @Output() qrCodeURL = new EventEmitter<SafeUrl>();\r\n\r\n @ViewChild('qrcElement', { static: true }) public qrcElement!: ElementRef<HTMLDivElement>;\r\n\r\n public context: CanvasRenderingContext2D | null = null;\r\n private _centerImage?: HTMLImageElement;\r\n private _renderer = inject(Renderer2);\r\n private _sanitizer = inject(DomSanitizer);\r\n private _currentOperationId = 0;\r\n private _previousObjectUrl: string | null = null;\r\n\r\n ngOnChanges(): void {\r\n this._createQRCode();\r\n }\r\n\r\n convertBase64ImageUrlToBlob(base64ImageUrl: string): Blob {\r\n const parts = base64ImageUrl.split(';base64,');\r\n const imageType = parts[0].split(':')[1];\r\n const decodedData = atob(parts[1]);\r\n const uInt8Array = new Uint8Array(decodedData.length);\r\n for (let i = 0; i < decodedData.length; ++i) {\r\n uInt8Array[i] = decodedData.charCodeAt(i)\r\n }\r\n return new Blob([uInt8Array], { type: imageType });\r\n }\r\n\r\n emitQRCodeURL(element: HTMLCanvasElement | HTMLImageElement | SVGSVGElement): void {\r\n if (this._previousObjectUrl) {\r\n URL.revokeObjectURL(this._previousObjectUrl);\r\n this._previousObjectUrl = null;\r\n }\r\n const className = element.constructor.name;\r\n if (className === SVGSVGElement.name) {\r\n const svgHTML = element.outerHTML;\r\n const blob = new Blob([svgHTML], { type: 'image/svg+xml' });\r\n const urlSvg = URL.createObjectURL(blob);\r\n this._previousObjectUrl = urlSvg;\r\n const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlSvg);\r\n this.qrCodeURL.emit(urlSanitized);\r\n return;\r\n }\r\n\r\n let urlImage = '';\r\n\r\n if (className === HTMLCanvasElement.name) {\r\n urlImage = (element as HTMLCanvasElement).toDataURL('image/png');\r\n }\r\n\r\n if (className === HTMLImageElement.name) {\r\n urlImage = (element as HTMLImageElement).src;\r\n }\r\n\r\n const blobData: Blob = this.convertBase64ImageUrlToBlob(urlImage);\r\n const urlBlob = URL.createObjectURL(blobData);\r\n this._previousObjectUrl = urlBlob;\r\n const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlBlob);\r\n this.qrCodeURL.emit(urlSanitized);\r\n }\r\n private _isValidQrCodeText(data: string | null): boolean {\r\n if (this.allowEmptyString === false) {\r\n return !(\r\n typeof data === 'undefined' ||\r\n data === '' ||\r\n data === 'null' ||\r\n data === null\r\n );\r\n }\r\n return !(typeof data === 'undefined');\r\n }\r\n\r\n private _toDataURL(qrCodeConfig: QRCodeToDataURLOptions): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toDataURL(\r\n this.qrdata,\r\n qrCodeConfig,\r\n (err: Error | null | undefined, url: string) => {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(url);\r\n }\r\n }\r\n );\r\n }\r\n );\r\n }\r\n\r\n private _toCanvas(\r\n canvas: HTMLCanvasElement,\r\n qrCodeConfig: QRCodeRenderersOptions\r\n ): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toCanvas(\r\n canvas,\r\n this.qrdata,\r\n qrCodeConfig,\r\n (error: Error | null | undefined) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve('success');\r\n }\r\n }\r\n )\r\n }\r\n );\r\n }\r\n\r\n private _toSVG(qrCodeConfig: QRCodeToStringOptions): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toString(\r\n this.qrdata,\r\n qrCodeConfig,\r\n (err: Error | null | undefined, url: string) => {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(url);\r\n }\r\n }\r\n )\r\n }\r\n );\r\n }\r\n\r\n private _renderElement(element: Element): void {\r\n for (const node of Array.from(this.qrcElement.nativeElement.childNodes)) {\r\n this._renderer.removeChild(this.qrcElement.nativeElement, node);\r\n }\r\n\r\n this._renderer.appendChild(this.qrcElement.nativeElement, element);\r\n\r\n }\r\n\r\n private _createQRCode(): void {\r\n const operationId = ++this._currentOperationId;\r\n\r\n try {\r\n if (!this._isValidQrCodeText(this.qrdata)) {\r\n throw new Error(\r\n '`qrdata` 配置为空,请设置 `allowEmptyString=\"true\"` 来覆盖此特性。'\r\n );\r\n }\r\n\r\n if (this._isValidQrCodeText(this.qrdata) && this.qrdata === '') {\r\n this.qrdata = ' ';\r\n }\r\n\r\n const config: QRCodeConfigType = {\r\n errorCorrectionLevel: this.errorCorrectionLevel,\r\n margin: this.margin,\r\n scale: this.scale,\r\n width: this.width,\r\n };\r\n\r\n const centerImageSrc = this.imageSrc;\r\n const centerImageHeight = this.imageHeight ?? 40;\r\n const centerImageWidth = this.imageWidth ?? 40;\r\n\r\n switch (this.elementType) {\r\n case 'canvas': {\r\n const canvasElement = this._renderer.createElement('canvas') as HTMLCanvasElement;\r\n this.context = canvasElement.getContext('2d');\r\n this._toCanvas(canvasElement, config)\r\n .then(() => {\r\n if (operationId !== this._currentOperationId) {\r\n return; // 不是最新操作,直接返回\r\n }\r\n\r\n if (this.ariaLabel) {\r\n this._renderer.setAttribute(\r\n canvasElement,\r\n 'aria-label',\r\n `${this.ariaLabel}`\r\n );\r\n }\r\n if (this.title) {\r\n this._renderer.setAttribute(\r\n canvasElement,\r\n 'title',\r\n `${this.title}`\r\n );\r\n }\r\n\r\n if (centerImageSrc && this.context) {\r\n this._centerImage = new Image(\r\n centerImageWidth,\r\n centerImageHeight\r\n );\r\n\r\n if (centerImageSrc !== this._centerImage.src) {\r\n this._centerImage.crossOrigin = 'anonymous';\r\n this._centerImage.src = centerImageSrc;\r\n }\r\n\r\n if (centerImageHeight !== this._centerImage.height) {\r\n this._centerImage.height = centerImageHeight;\r\n }\r\n\r\n if (centerImageWidth !== this._centerImage.width) {\r\n this._centerImage.width = centerImageWidth;\r\n }\r\n\r\n const centerImage = this._centerImage;\r\n\r\n if (centerImage) {\r\n centerImage.onload = (): void => {\r\n if (operationId === this._currentOperationId) {\r\n this.context?.drawImage(\r\n centerImage,\r\n canvasElement.width / 2 - centerImageWidth / 2,\r\n canvasElement.height / 2 - centerImageHeight / 2,\r\n centerImageWidth,\r\n centerImageHeight\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._renderElement(canvasElement);\r\n this.emitQRCodeURL(canvasElement);\r\n })\r\n .catch((e) => {\r\n console.error('canvas error:', e);\r\n });\r\n break;\r\n }\r\n case 'svg': {\r\n const svgParentElement = this._renderer.createElement('div') as HTMLDivElement;\r\n this._toSVG(config)\r\n .then((svgString: string) => {\r\n if (operationId !== this._currentOperationId) {\r\n return;\r\n }\r\n\r\n this._renderer.setProperty(\r\n svgParentElement,\r\n 'innerHTML',\r\n svgString\r\n );\r\n const svgElement = svgParentElement.firstChild as SVGSVGElement;\r\n this._renderer.setAttribute(svgElement, 'height', `${this.width}`);\r\n this._renderer.setAttribute(svgElement, 'width', `${this.width}`);\r\n this._renderElement(svgElement);\r\n this.emitQRCodeURL(svgElement);\r\n })\r\n .catch((e) => {\r\n console.error('svg error:', e);\r\n })\r\n break;\r\n }\r\n case 'url':\r\n case 'img':\r\n default: {\r\n const imgElement = this._renderer.createElement('img') as HTMLImageElement;\r\n this._toDataURL(config)\r\n .then((dataUrl: string) => {\r\n if (operationId !== this._currentOperationId) {\r\n return;\r\n }\r\n\r\n if (this.alt) {\r\n imgElement.setAttribute('alt', this.alt);\r\n }\r\n if (this.ariaLabel) {\r\n imgElement.setAttribute('aria-label', this.ariaLabel);\r\n }\r\n imgElement.setAttribute('src', dataUrl);\r\n if (this.title) {\r\n imgElement.setAttribute('title', this.title);\r\n }\r\n this._renderElement(imgElement);\r\n this.emitQRCodeURL(imgElement);\r\n })\r\n .catch((e) => {\r\n console.error('img/url error:', e)\r\n });\r\n }\r\n }\r\n } catch (e: unknown) {\r\n console.error('生成QRCode错误:', e instanceof Error ? e.message : String(e));\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA+Ba,mBAAmB,CAAA;AAPhC,IAAA,WAAA,GAAA;QAQoB,IAAA,CAAA,gBAAgB,GAAY,KAAK;QACjC,IAAA,CAAA,QAAQ,GAAW,QAAQ;QAC3B,IAAA,CAAA,WAAW,GAAsB,QAAQ;QAElD,IAAA,CAAA,oBAAoB,GAA+B,GAAG;QAI7C,IAAA,CAAA,MAAM,GAAU,CAAC;QACjB,IAAA,CAAA,MAAM,GAAW,EAAE;QACnB,IAAA,CAAA,KAAK,GAAW,CAAC;QACjB,IAAA,CAAA,KAAK,GAAW,EAAE;AAMxB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAW;QAI1C,IAAA,CAAA,OAAO,GAAoC,IAAI;AAE9C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;QACjC,IAAA,CAAA,mBAAmB,GAAG,CAAC;QACvB,IAAA,CAAA,kBAAkB,GAAkB,IAAI;AA+RnD,IAAA;IA7RG,WAAW,GAAA;QACP,IAAI,CAAC,aAAa,EAAE;IACxB;AAEA,IAAA,2BAA2B,CAAC,cAAsB,EAAA;QAC9C,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC;AAC9C,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CA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S;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;oBACvB,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,4CAA4C;AACtD,oBAAA,QAAQ,EAAE,YAAY;AACzB,iBAAA;;sBAEI;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBAEA;;sBAEA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;ACnD7C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-qrcode.mjs","sources":["../../../projects/cmat/components/qrcode/qrcode.component.ts","../../../projects/cmat/components/qrcode/cmat-components-qrcode.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n effect,\r\n ElementRef,\r\n inject,\r\n input,\r\n output,\r\n Renderer2,\r\n untracked,\r\n viewChild,\r\n ViewEncapsulation,\r\n} from '@angular/core';\r\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\r\nimport {\r\n QRCodeRenderersOptions,\r\n QRCodeToDataURLOptions,\r\n QRCodeToStringOptions,\r\n toCanvas,\r\n toDataURL,\r\n toString\r\n} from 'qrcode';\r\nimport { FixMeLater, QRCodeConfigType, QRCodeElementType, QRCodeErrorCorrectionLevel } from './qrcode.types';\r\n\r\n@Component({\r\n selector: 'cmat-qrcode',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<div #qrcElement [class]=\"cssClass()\"></div>',\r\n exportAs: 'cmatQRCode',\r\n})\r\nexport class CmatQRCodeComponent {\r\n readonly allowEmptyString = input<boolean>(false);\r\n readonly cssClass = input<string>('qrcode');\r\n readonly elementType = input<QRCodeElementType>('canvas');\r\n readonly errorCorrectionLevel = input<QRCodeErrorCorrectionLevel>('M');\r\n readonly imageSrc = input<string>();\r\n readonly imageHeight = input<number>();\r\n readonly imageWidth = input<number>();\r\n readonly margin = input<number>(4);\r\n readonly qrdata = input<string>('');\r\n readonly scale = input<number>(4);\r\n readonly width = input<number>(10);\r\n\r\n readonly alt = input<string>();\r\n readonly ariaLabel = input<string>();\r\n readonly title = input<string>();\r\n\r\n readonly qrCodeURL = output<SafeUrl>();\r\n\r\n readonly qrcElement = viewChild.required<ElementRef<HTMLDivElement>>('qrcElement');\r\n\r\n public context: CanvasRenderingContext2D | null = null;\r\n private _centerImage?: HTMLImageElement;\r\n private _renderer = inject(Renderer2);\r\n private _sanitizer = inject(DomSanitizer);\r\n private _currentOperationId = 0;\r\n private _previousObjectUrl: string | null = null;\r\n\r\n constructor() {\r\n // 监听输入变化并重新生成二维码\r\n effect(() => {\r\n // 读取所有 input signal,任何一项变化都会触发重新生成\r\n this.allowEmptyString();\r\n this.elementType();\r\n this.errorCorrectionLevel();\r\n this.imageSrc();\r\n this.imageHeight();\r\n this.imageWidth();\r\n this.margin();\r\n this.qrdata();\r\n this.scale();\r\n this.width();\r\n this.alt();\r\n this.ariaLabel();\r\n this.title();\r\n\r\n untracked(() => {\r\n this._createQRCode();\r\n })\r\n\r\n });\r\n }\r\n\r\n convertBase64ImageUrlToBlob(base64ImageUrl: string): Blob {\r\n const parts = base64ImageUrl.split(';base64,');\r\n const imageType = parts[0].split(':')[1];\r\n const decodedData = atob(parts[1]);\r\n const uInt8Array = new Uint8Array(decodedData.length);\r\n for (let i = 0; i < decodedData.length; ++i) {\r\n uInt8Array[i] = decodedData.charCodeAt(i)\r\n }\r\n return new Blob([uInt8Array], { type: imageType });\r\n }\r\n\r\n emitQRCodeURL(element: HTMLCanvasElement | HTMLImageElement | SVGSVGElement): void {\r\n if (this._previousObjectUrl) {\r\n URL.revokeObjectURL(this._previousObjectUrl);\r\n this._previousObjectUrl = null;\r\n }\r\n const className = element.constructor.name;\r\n if (className === SVGSVGElement.name) {\r\n const svgHTML = element.outerHTML;\r\n const blob = new Blob([svgHTML], { type: 'image/svg+xml' });\r\n const urlSvg = URL.createObjectURL(blob);\r\n this._previousObjectUrl = urlSvg;\r\n const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlSvg);\r\n this.qrCodeURL.emit(urlSanitized);\r\n return;\r\n }\r\n\r\n let urlImage = '';\r\n\r\n if (className === HTMLCanvasElement.name) {\r\n urlImage = (element as HTMLCanvasElement).toDataURL('image/png');\r\n }\r\n\r\n if (className === HTMLImageElement.name) {\r\n urlImage = (element as HTMLImageElement).src;\r\n }\r\n\r\n const blobData: Blob = this.convertBase64ImageUrlToBlob(urlImage);\r\n const urlBlob = URL.createObjectURL(blobData);\r\n this._previousObjectUrl = urlBlob;\r\n const urlSanitized = this._sanitizer.bypassSecurityTrustUrl(urlBlob);\r\n this.qrCodeURL.emit(urlSanitized);\r\n }\r\n\r\n private _isValidQrCodeText(data: string | null): boolean {\r\n if (this.allowEmptyString() === false) {\r\n return !(\r\n typeof data === 'undefined' ||\r\n data === '' ||\r\n data === 'null' ||\r\n data === null\r\n );\r\n }\r\n return !(typeof data === 'undefined');\r\n }\r\n\r\n private _toDataURL(qrCodeConfig: QRCodeToDataURLOptions, qrData: string): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toDataURL(\r\n qrData,\r\n qrCodeConfig,\r\n (err: Error | null | undefined, url: string) => {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(url);\r\n }\r\n }\r\n );\r\n }\r\n );\r\n }\r\n\r\n private _toCanvas(\r\n canvas: HTMLCanvasElement,\r\n qrCodeConfig: QRCodeRenderersOptions,\r\n qrData: string\r\n ): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toCanvas(\r\n canvas,\r\n qrData,\r\n qrCodeConfig,\r\n (error: Error | null | undefined) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve('success');\r\n }\r\n }\r\n )\r\n }\r\n );\r\n }\r\n\r\n private _toSVG(qrCodeConfig: QRCodeToStringOptions, qrData: string): Promise<FixMeLater> {\r\n return new Promise(\r\n (\r\n resolve: (arg: FixMeLater) => FixMeLater,\r\n reject: (arg: FixMeLater) => FixMeLater\r\n ) => {\r\n toString(\r\n qrData,\r\n qrCodeConfig,\r\n (err: Error | null | undefined, url: string) => {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(url);\r\n }\r\n }\r\n )\r\n }\r\n );\r\n }\r\n\r\n private _renderElement(element: Element): void {\r\n const qrcEl = this.qrcElement();\r\n for (const node of Array.from(qrcEl.nativeElement.childNodes)) {\r\n this._renderer.removeChild(qrcEl.nativeElement, node);\r\n }\r\n\r\n this._renderer.appendChild(qrcEl.nativeElement, element);\r\n }\r\n\r\n private _createQRCode(): void {\r\n const operationId = ++this._currentOperationId;\r\n\r\n try {\r\n let qrData = this.qrdata();\r\n\r\n if (!this._isValidQrCodeText(qrData)) {\r\n throw new Error(\r\n '`qrdata` 配置为空,请设置 `allowEmptyString=\"true\"` 来覆盖此特性。'\r\n );\r\n }\r\n\r\n if (this._isValidQrCodeText(qrData) && qrData === '') {\r\n qrData = ' ';\r\n }\r\n\r\n const config: QRCodeConfigType = {\r\n errorCorrectionLevel: this.errorCorrectionLevel(),\r\n margin: this.margin(),\r\n scale: this.scale(),\r\n width: this.width(),\r\n };\r\n\r\n const centerImageSrc = this.imageSrc();\r\n const centerImageHeight = this.imageHeight() ?? 40;\r\n const centerImageWidth = this.imageWidth() ?? 40;\r\n\r\n switch (this.elementType()) {\r\n case 'canvas': {\r\n const canvasElement = this._renderer.createElement('canvas') as HTMLCanvasElement;\r\n this.context = canvasElement.getContext('2d');\r\n this._toCanvas(canvasElement, config, qrData)\r\n .then(() => {\r\n if (operationId !== this._currentOperationId) {\r\n return;\r\n }\r\n\r\n if (this.ariaLabel()) {\r\n this._renderer.setAttribute(\r\n canvasElement,\r\n 'aria-label',\r\n `${this.ariaLabel()}`\r\n );\r\n }\r\n if (this.title()) {\r\n this._renderer.setAttribute(\r\n canvasElement,\r\n 'title',\r\n `${this.title()}`\r\n );\r\n }\r\n\r\n if (centerImageSrc && this.context) {\r\n this._centerImage = new Image(\r\n centerImageWidth,\r\n centerImageHeight\r\n );\r\n\r\n if (centerImageSrc !== this._centerImage.src) {\r\n this._centerImage.crossOrigin = 'anonymous';\r\n this._centerImage.src = centerImageSrc;\r\n }\r\n\r\n if (centerImageHeight !== this._centerImage.height) {\r\n this._centerImage.height = centerImageHeight;\r\n }\r\n\r\n if (centerImageWidth !== this._centerImage.width) {\r\n this._centerImage.width = centerImageWidth;\r\n }\r\n\r\n const centerImage = this._centerImage;\r\n\r\n if (centerImage) {\r\n centerImage.onload = (): void => {\r\n if (operationId === this._currentOperationId) {\r\n this.context?.drawImage(\r\n centerImage,\r\n canvasElement.width / 2 - centerImageWidth / 2,\r\n canvasElement.height / 2 - centerImageHeight / 2,\r\n centerImageWidth,\r\n centerImageHeight\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._renderElement(canvasElement);\r\n this.emitQRCodeURL(canvasElement);\r\n })\r\n .catch((e) => {\r\n console.error('canvas error:', e);\r\n });\r\n break;\r\n }\r\n case 'svg': {\r\n const svgParentElement = this._renderer.createElement('div') as HTMLDivElement;\r\n this._toSVG(config, qrData)\r\n .then((svgString: string) => {\r\n if (operationId !== this._currentOperationId) {\r\n return;\r\n }\r\n\r\n this._renderer.setProperty(\r\n svgParentElement,\r\n 'innerHTML',\r\n svgString\r\n );\r\n const svgElement = svgParentElement.firstChild as SVGSVGElement;\r\n this._renderer.setAttribute(svgElement, 'height', `${this.width()}`);\r\n this._renderer.setAttribute(svgElement, 'width', `${this.width()}`);\r\n this._renderElement(svgElement);\r\n this.emitQRCodeURL(svgElement);\r\n })\r\n .catch((e) => {\r\n console.error('svg error:', e);\r\n })\r\n break;\r\n }\r\n case 'url':\r\n case 'img':\r\n default: {\r\n const imgElement = this._renderer.createElement('img') as HTMLImageElement;\r\n this._toDataURL(config, qrData)\r\n .then((dataUrl: string) => {\r\n if (operationId !== this._currentOperationId) {\r\n return;\r\n }\r\n\r\n if (this.alt()) {\r\n imgElement.setAttribute('alt', this.alt()!);\r\n }\r\n if (this.ariaLabel()) {\r\n imgElement.setAttribute('aria-label', this.ariaLabel()!);\r\n }\r\n imgElement.setAttribute('src', dataUrl);\r\n if (this.title()) {\r\n imgElement.setAttribute('title', this.title()!);\r\n }\r\n this._renderElement(imgElement);\r\n this.emitQRCodeURL(imgElement);\r\n })\r\n .catch((e) => {\r\n console.error('img/url error:', e)\r\n });\r\n }\r\n }\r\n } catch (e: unknown) {\r\n console.error('生成QRCode错误:', e instanceof Error ? e.message : String(e));\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA+Ba,mBAAmB,CAAA;AA4B5B,IAAA,WAAA,GAAA;QA3BS,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK;6FAAC;QACxC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,QAAQ;qFAAC;QAClC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAoB,QAAQ;wFAAC;QAChD,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAA6B,GAAG;iGAAC;AAC7D,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;AAC1B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;AAC7B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAAU;QAC5B,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,CAAC;mFAAC;QACzB,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,EAAE;mFAAC;QAC1B,IAAA,CAAA,KAAK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