@tectra-ng/blocks 0.0.0-stage → 0.1.6
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/README.md +16 -2
- package/action-tile/README.md +33 -0
- package/actions-menu/README.md +42 -0
- package/app-footer/README.md +30 -0
- package/app-layout/README.md +51 -0
- package/command-palette/README.md +63 -0
- package/console-layout/README.md +70 -0
- package/cookie-notice/README.md +45 -0
- package/empty-state/README.md +35 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs +294 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs +380 -0
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-app-footer.mjs +276 -0
- package/fesm2022/tectra-ng-blocks-app-footer.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-app-layout.mjs +544 -0
- package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-command-palette.mjs +663 -0
- package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs +1060 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +416 -0
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs +278 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs +959 -0
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-kanban.mjs +864 -0
- package/fesm2022/tectra-ng-blocks-kanban.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-network-status.mjs +303 -0
- package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-page-header.mjs +195 -0
- package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +692 -0
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-public-header.mjs +372 -0
- package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-qr-code.mjs +487 -0
- package/fesm2022/tectra-ng-blocks-qr-code.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-switch-language.mjs +316 -0
- package/fesm2022/tectra-ng-blocks-switch-language.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs +416 -0
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs +260 -0
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs +1284 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks.mjs +4 -0
- package/fesm2022/tectra-ng-blocks.mjs.map +1 -0
- package/filters-panel/README.md +68 -0
- package/kanban/README.md +55 -0
- package/network-status/README.md +33 -0
- package/package.json +137 -3
- package/page-header/README.md +32 -0
- package/pinned-tabs/README.md +42 -0
- package/public-header/README.md +44 -0
- package/qr-code/README.md +52 -0
- package/switch-language/README.md +33 -0
- package/switch-theme/README.md +32 -0
- package/topbar-preferences/README.md +35 -0
- package/types/tectra-ng-blocks-action-tile.d.ts +114 -0
- package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -0
- package/types/tectra-ng-blocks-actions-menu.d.ts +112 -0
- package/types/tectra-ng-blocks-actions-menu.d.ts.map +1 -0
- package/types/tectra-ng-blocks-app-footer.d.ts +111 -0
- package/types/tectra-ng-blocks-app-footer.d.ts.map +1 -0
- package/types/tectra-ng-blocks-app-layout.d.ts +212 -0
- package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -0
- package/types/tectra-ng-blocks-command-palette.d.ts +291 -0
- package/types/tectra-ng-blocks-command-palette.d.ts.map +1 -0
- package/types/tectra-ng-blocks-console-layout.d.ts +454 -0
- package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts +168 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -0
- package/types/tectra-ng-blocks-empty-state.d.ts +138 -0
- package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -0
- package/types/tectra-ng-blocks-filters-panel.d.ts +314 -0
- package/types/tectra-ng-blocks-filters-panel.d.ts.map +1 -0
- package/types/tectra-ng-blocks-kanban.d.ts +260 -0
- package/types/tectra-ng-blocks-kanban.d.ts.map +1 -0
- package/types/tectra-ng-blocks-network-status.d.ts +108 -0
- package/types/tectra-ng-blocks-network-status.d.ts.map +1 -0
- package/types/tectra-ng-blocks-page-header.d.ts +86 -0
- package/types/tectra-ng-blocks-page-header.d.ts.map +1 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts +159 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -0
- package/types/tectra-ng-blocks-public-header.d.ts +142 -0
- package/types/tectra-ng-blocks-public-header.d.ts.map +1 -0
- package/types/tectra-ng-blocks-qr-code.d.ts +160 -0
- package/types/tectra-ng-blocks-qr-code.d.ts.map +1 -0
- package/types/tectra-ng-blocks-switch-language.d.ts +106 -0
- package/types/tectra-ng-blocks-switch-language.d.ts.map +1 -0
- package/types/tectra-ng-blocks-switch-theme.d.ts +108 -0
- package/types/tectra-ng-blocks-switch-theme.d.ts.map +1 -0
- package/types/tectra-ng-blocks-topbar-preferences.d.ts +103 -0
- package/types/tectra-ng-blocks-topbar-preferences.d.ts.map +1 -0
- package/types/tectra-ng-blocks-wizard.d.ts +682 -0
- package/types/tectra-ng-blocks-wizard.d.ts.map +1 -0
- package/types/tectra-ng-blocks.d.ts +2 -0
- package/types/tectra-ng-blocks.d.ts.map +1 -0
- package/wizard/README.md +77 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, computed, inject, input, numberAttribute, viewChild } from "@angular/core";
|
|
3
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
4
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
7
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
8
|
+
import { inlineSvgImages, qrGradientLine, qrLayout, svgDataUrl, svgToPng } from "@tectra-ng/qr";
|
|
9
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
10
|
+
const PAINTED = ".tx-qr-code__background, .tx-qr-code__dots, .tx-qr-code__eye-frames, .tx-qr-code__eye-balls";
|
|
11
|
+
var TxQrCode = class TxQrCode {
|
|
12
|
+
document = inject(DOCUMENT);
|
|
13
|
+
svg = viewChild("svg", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
|
|
14
|
+
data = input.required(...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
15
|
+
size = input(200, {
|
|
16
|
+
...ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {},
|
|
17
|
+
transform: numberAttribute
|
|
18
|
+
});
|
|
19
|
+
margin = input(1, {
|
|
20
|
+
...ngDevMode ? { debugName: "margin" } : /* istanbul ignore next */ {},
|
|
21
|
+
transform: numberAttribute
|
|
22
|
+
});
|
|
23
|
+
errorCorrection = input(void 0, ...ngDevMode ? [{ debugName: "errorCorrection" }] : /* istanbul ignore next */ []);
|
|
24
|
+
dotStyle = input("square", ...ngDevMode ? [{ debugName: "dotStyle" }] : /* istanbul ignore next */ []);
|
|
25
|
+
eyeFrameStyle = input("square", ...ngDevMode ? [{ debugName: "eyeFrameStyle" }] : /* istanbul ignore next */ []);
|
|
26
|
+
eyeBallStyle = input("square", ...ngDevMode ? [{ debugName: "eyeBallStyle" }] : /* istanbul ignore next */ []);
|
|
27
|
+
color = input(void 0, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
28
|
+
background = input(void 0, ...ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []);
|
|
29
|
+
eyeColor = input(void 0, ...ngDevMode ? [{ debugName: "eyeColor" }] : /* istanbul ignore next */ []);
|
|
30
|
+
eyeBallColor = input(void 0, ...ngDevMode ? [{ debugName: "eyeBallColor" }] : /* istanbul ignore next */ []);
|
|
31
|
+
gradient = input(void 0, ...ngDevMode ? [{ debugName: "gradient" }] : /* istanbul ignore next */ []);
|
|
32
|
+
logo = input(void 0, ...ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []);
|
|
33
|
+
logoSize = input(.22, {
|
|
34
|
+
...ngDevMode ? { debugName: "logoSize" } : /* istanbul ignore next */ {},
|
|
35
|
+
transform: numberAttribute
|
|
36
|
+
});
|
|
37
|
+
logoMargin = input(1, {
|
|
38
|
+
...ngDevMode ? { debugName: "logoMargin" } : /* istanbul ignore next */ {},
|
|
39
|
+
transform: numberAttribute
|
|
40
|
+
});
|
|
41
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
42
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
43
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
44
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
45
|
+
unstyled = input(void 0, {
|
|
46
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
47
|
+
transform: optionalBoolean
|
|
48
|
+
});
|
|
49
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
50
|
+
passThrough = injectPassThrough("qrCode", this, this.pt, this.ptOptions);
|
|
51
|
+
translations = injectTranslations();
|
|
52
|
+
gradientId = uniqueId("tx-qr-code-gradient");
|
|
53
|
+
hostStyle = computed(() => ({
|
|
54
|
+
...toStyleObject(this.dt(), "--tx-qr-code"),
|
|
55
|
+
...this.passThrough().root?.style
|
|
56
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
57
|
+
layout = computed(() => {
|
|
58
|
+
const data = this.data();
|
|
59
|
+
if (!data) return null;
|
|
60
|
+
try {
|
|
61
|
+
return qrLayout(data, {
|
|
62
|
+
margin: this.margin(),
|
|
63
|
+
errorCorrection: this.errorCorrection(),
|
|
64
|
+
dotStyle: this.dotStyle(),
|
|
65
|
+
eyeFrameStyle: this.eyeFrameStyle(),
|
|
66
|
+
eyeBallStyle: this.eyeBallStyle(),
|
|
67
|
+
logo: this.logo(),
|
|
68
|
+
logoSize: this.logoSize(),
|
|
69
|
+
logoMargin: this.logoMargin()
|
|
70
|
+
});
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
75
|
+
matrix = computed(() => this.layout()?.matrix ?? null, ...ngDevMode ? [{ debugName: "matrix" }] : /* istanbul ignore next */ []);
|
|
76
|
+
hasError = computed(() => !!this.data() && !this.layout(), ...ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []);
|
|
77
|
+
gradientLine = computed(() => {
|
|
78
|
+
const gradient = this.gradient();
|
|
79
|
+
const matrix = this.matrix();
|
|
80
|
+
return gradient && matrix ? qrGradientLine(gradient, matrix.size) : null;
|
|
81
|
+
}, ...ngDevMode ? [{ debugName: "gradientLine" }] : /* istanbul ignore next */ []);
|
|
82
|
+
dotFill = computed(() => this.gradient() ? `url(#${this.gradientId})` : this.color() ?? null, ...ngDevMode ? [{ debugName: "dotFill" }] : /* istanbul ignore next */ []);
|
|
83
|
+
label = computed(() => this.ariaLabel() ?? this.translations().qrCode, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
84
|
+
toSvgString() {
|
|
85
|
+
const svg = this.svg()?.nativeElement;
|
|
86
|
+
const view = this.document.defaultView;
|
|
87
|
+
if (!svg || !view) return "";
|
|
88
|
+
const clone = svg.cloneNode(true);
|
|
89
|
+
const source = Array.from(svg.querySelectorAll(PAINTED));
|
|
90
|
+
Array.from(clone.querySelectorAll(PAINTED)).forEach((element, index) => {
|
|
91
|
+
const fill = view.getComputedStyle(source[index]).fill;
|
|
92
|
+
element.setAttribute("fill", fill.startsWith("url(") ? `url(#${this.gradientId})` : fill);
|
|
93
|
+
});
|
|
94
|
+
clone.querySelectorAll("*").forEach((element) => {
|
|
95
|
+
element.removeAttribute("class");
|
|
96
|
+
element.removeAttribute("style");
|
|
97
|
+
Array.from(element.attributes).filter((attribute) => attribute.name.startsWith("_ng")).forEach((attribute) => element.removeAttribute(attribute.name));
|
|
98
|
+
});
|
|
99
|
+
clone.removeAttribute("class");
|
|
100
|
+
clone.removeAttribute("style");
|
|
101
|
+
clone.removeAttribute("role");
|
|
102
|
+
clone.removeAttribute("aria-label");
|
|
103
|
+
Array.from(clone.attributes).filter((attribute) => attribute.name.startsWith("_ng")).forEach((attribute) => clone.removeAttribute(attribute.name));
|
|
104
|
+
const comments = this.document.createTreeWalker(clone, NodeFilter.SHOW_COMMENT);
|
|
105
|
+
const found = [];
|
|
106
|
+
while (comments.nextNode()) found.push(comments.currentNode);
|
|
107
|
+
found.forEach((comment) => comment.parentNode?.removeChild(comment));
|
|
108
|
+
clone.setAttribute("xmlns", SVG_NS);
|
|
109
|
+
return new view.XMLSerializer().serializeToString(clone);
|
|
110
|
+
}
|
|
111
|
+
async toDataUrl(format = "png", pixelSize = 1024) {
|
|
112
|
+
const svg = this.toSvgString();
|
|
113
|
+
return format === "svg" ? svgDataUrl(await inlineSvgImages(svg)) : svgToPng(svg, pixelSize);
|
|
114
|
+
}
|
|
115
|
+
async download(format = "png", fileName = "qr-code", pixelSize = 1024) {
|
|
116
|
+
const link = this.document.createElement("a");
|
|
117
|
+
link.href = await this.toDataUrl(format, pixelSize);
|
|
118
|
+
link.download = `${fileName}.${format}`;
|
|
119
|
+
link.click();
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
122
|
+
minVersion: "12.0.0",
|
|
123
|
+
version: "22.2.3",
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
type: TxQrCode,
|
|
126
|
+
deps: [],
|
|
127
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
128
|
+
});
|
|
129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
130
|
+
minVersion: "17.0.0",
|
|
131
|
+
version: "22.2.3",
|
|
132
|
+
type: TxQrCode,
|
|
133
|
+
isStandalone: true,
|
|
134
|
+
selector: "tx-qr-code",
|
|
135
|
+
inputs: {
|
|
136
|
+
data: {
|
|
137
|
+
classPropertyName: "data",
|
|
138
|
+
publicName: "data",
|
|
139
|
+
isSignal: true,
|
|
140
|
+
isRequired: true,
|
|
141
|
+
transformFunction: null
|
|
142
|
+
},
|
|
143
|
+
size: {
|
|
144
|
+
classPropertyName: "size",
|
|
145
|
+
publicName: "size",
|
|
146
|
+
isSignal: true,
|
|
147
|
+
isRequired: false,
|
|
148
|
+
transformFunction: null
|
|
149
|
+
},
|
|
150
|
+
margin: {
|
|
151
|
+
classPropertyName: "margin",
|
|
152
|
+
publicName: "margin",
|
|
153
|
+
isSignal: true,
|
|
154
|
+
isRequired: false,
|
|
155
|
+
transformFunction: null
|
|
156
|
+
},
|
|
157
|
+
errorCorrection: {
|
|
158
|
+
classPropertyName: "errorCorrection",
|
|
159
|
+
publicName: "errorCorrection",
|
|
160
|
+
isSignal: true,
|
|
161
|
+
isRequired: false,
|
|
162
|
+
transformFunction: null
|
|
163
|
+
},
|
|
164
|
+
dotStyle: {
|
|
165
|
+
classPropertyName: "dotStyle",
|
|
166
|
+
publicName: "dotStyle",
|
|
167
|
+
isSignal: true,
|
|
168
|
+
isRequired: false,
|
|
169
|
+
transformFunction: null
|
|
170
|
+
},
|
|
171
|
+
eyeFrameStyle: {
|
|
172
|
+
classPropertyName: "eyeFrameStyle",
|
|
173
|
+
publicName: "eyeFrameStyle",
|
|
174
|
+
isSignal: true,
|
|
175
|
+
isRequired: false,
|
|
176
|
+
transformFunction: null
|
|
177
|
+
},
|
|
178
|
+
eyeBallStyle: {
|
|
179
|
+
classPropertyName: "eyeBallStyle",
|
|
180
|
+
publicName: "eyeBallStyle",
|
|
181
|
+
isSignal: true,
|
|
182
|
+
isRequired: false,
|
|
183
|
+
transformFunction: null
|
|
184
|
+
},
|
|
185
|
+
color: {
|
|
186
|
+
classPropertyName: "color",
|
|
187
|
+
publicName: "color",
|
|
188
|
+
isSignal: true,
|
|
189
|
+
isRequired: false,
|
|
190
|
+
transformFunction: null
|
|
191
|
+
},
|
|
192
|
+
background: {
|
|
193
|
+
classPropertyName: "background",
|
|
194
|
+
publicName: "background",
|
|
195
|
+
isSignal: true,
|
|
196
|
+
isRequired: false,
|
|
197
|
+
transformFunction: null
|
|
198
|
+
},
|
|
199
|
+
eyeColor: {
|
|
200
|
+
classPropertyName: "eyeColor",
|
|
201
|
+
publicName: "eyeColor",
|
|
202
|
+
isSignal: true,
|
|
203
|
+
isRequired: false,
|
|
204
|
+
transformFunction: null
|
|
205
|
+
},
|
|
206
|
+
eyeBallColor: {
|
|
207
|
+
classPropertyName: "eyeBallColor",
|
|
208
|
+
publicName: "eyeBallColor",
|
|
209
|
+
isSignal: true,
|
|
210
|
+
isRequired: false,
|
|
211
|
+
transformFunction: null
|
|
212
|
+
},
|
|
213
|
+
gradient: {
|
|
214
|
+
classPropertyName: "gradient",
|
|
215
|
+
publicName: "gradient",
|
|
216
|
+
isSignal: true,
|
|
217
|
+
isRequired: false,
|
|
218
|
+
transformFunction: null
|
|
219
|
+
},
|
|
220
|
+
logo: {
|
|
221
|
+
classPropertyName: "logo",
|
|
222
|
+
publicName: "logo",
|
|
223
|
+
isSignal: true,
|
|
224
|
+
isRequired: false,
|
|
225
|
+
transformFunction: null
|
|
226
|
+
},
|
|
227
|
+
logoSize: {
|
|
228
|
+
classPropertyName: "logoSize",
|
|
229
|
+
publicName: "logoSize",
|
|
230
|
+
isSignal: true,
|
|
231
|
+
isRequired: false,
|
|
232
|
+
transformFunction: null
|
|
233
|
+
},
|
|
234
|
+
logoMargin: {
|
|
235
|
+
classPropertyName: "logoMargin",
|
|
236
|
+
publicName: "logoMargin",
|
|
237
|
+
isSignal: true,
|
|
238
|
+
isRequired: false,
|
|
239
|
+
transformFunction: null
|
|
240
|
+
},
|
|
241
|
+
ariaLabel: {
|
|
242
|
+
classPropertyName: "ariaLabel",
|
|
243
|
+
publicName: "ariaLabel",
|
|
244
|
+
isSignal: true,
|
|
245
|
+
isRequired: false,
|
|
246
|
+
transformFunction: null
|
|
247
|
+
},
|
|
248
|
+
dt: {
|
|
249
|
+
classPropertyName: "dt",
|
|
250
|
+
publicName: "dt",
|
|
251
|
+
isSignal: true,
|
|
252
|
+
isRequired: false,
|
|
253
|
+
transformFunction: null
|
|
254
|
+
},
|
|
255
|
+
pt: {
|
|
256
|
+
classPropertyName: "pt",
|
|
257
|
+
publicName: "pt",
|
|
258
|
+
isSignal: true,
|
|
259
|
+
isRequired: false,
|
|
260
|
+
transformFunction: null
|
|
261
|
+
},
|
|
262
|
+
ptOptions: {
|
|
263
|
+
classPropertyName: "ptOptions",
|
|
264
|
+
publicName: "ptOptions",
|
|
265
|
+
isSignal: true,
|
|
266
|
+
isRequired: false,
|
|
267
|
+
transformFunction: null
|
|
268
|
+
},
|
|
269
|
+
unstyled: {
|
|
270
|
+
classPropertyName: "unstyled",
|
|
271
|
+
publicName: "unstyled",
|
|
272
|
+
isSignal: true,
|
|
273
|
+
isRequired: false,
|
|
274
|
+
transformFunction: null
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
host: {
|
|
278
|
+
properties: {
|
|
279
|
+
"class": "passThrough().root?.class",
|
|
280
|
+
"style": "hostStyle()",
|
|
281
|
+
"attr.data-styled": "!isUnstyled() || null"
|
|
282
|
+
},
|
|
283
|
+
classAttribute: "tx-qr-code"
|
|
284
|
+
},
|
|
285
|
+
viewQueries: [{
|
|
286
|
+
propertyName: "svg",
|
|
287
|
+
first: true,
|
|
288
|
+
predicate: ["svg"],
|
|
289
|
+
descendants: true,
|
|
290
|
+
isSignal: true
|
|
291
|
+
}],
|
|
292
|
+
ngImport: i0,
|
|
293
|
+
template: "@if (layout(); as layout) {\n <svg\n #svg\n class=\"tx-qr-code__svg\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n [attr.viewBox]=\"layout.viewBox.value\"\n [attr.shape-rendering]=\"dotStyle() === 'square' ? 'crispEdges' : null\"\n [class]=\"passThrough().svg?.class\"\n [style]=\"passThrough().svg?.style\"\n >\n @if (gradientLine(); as line) {\n <defs>\n @if (line.radial) {\n <radialGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.cx]=\"line.center\" [attr.cy]=\"line.center\" [attr.r]=\"line.radius\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </radialGradient>\n } @else {\n <linearGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.x1]=\"line.x1\" [attr.y1]=\"line.y1\" [attr.x2]=\"line.x2\" [attr.y2]=\"line.y2\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </linearGradient>\n }\n </defs>\n }\n <rect\n class=\"tx-qr-code__background\"\n [attr.x]=\"layout.viewBox.x\"\n [attr.y]=\"layout.viewBox.y\"\n [attr.width]=\"layout.viewBox.size\"\n [attr.height]=\"layout.viewBox.size\"\n [style.fill]=\"background() ?? null\"\n />\n <path class=\"tx-qr-code__dots\" [attr.d]=\"layout.paths.dots\" [style.fill]=\"dotFill()\" />\n <path class=\"tx-qr-code__eye-frames\" fill-rule=\"evenodd\" [attr.d]=\"layout.paths.eyeFrames\" [style.fill]=\"eyeColor() ?? dotFill()\" />\n <path class=\"tx-qr-code__eye-balls\" [attr.d]=\"layout.paths.eyeBalls\" [style.fill]=\"eyeBallColor() ?? eyeColor() ?? dotFill()\" />\n @if (layout.logoBox; as box) {\n <image\n class=\"tx-qr-code__logo\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.href]=\"logo()\"\n [attr.x]=\"box.x\"\n [attr.y]=\"box.y\"\n [attr.width]=\"box.size\"\n [attr.height]=\"box.size\"\n />\n }\n </svg>\n} @else if (hasError()) {\n <div class=\"tx-qr-code__error\" role=\"alert\" [style.width.px]=\"size()\" [style.height.px]=\"size()\" [class]=\"passThrough().error?.class\" [style]=\"passThrough().error?.style\">\n {{ translations().qrCodeError }}\n </div>\n}\n",
|
|
294
|
+
styles: [":host{display:inline-flex}.tx-qr-code__svg{display:block;max-width:100%;height:auto}.tx-qr-code__error{display:flex;align-items:center;justify-content:center;max-width:100%;box-sizing:border-box;text-align:center}:host([data-styled]) .tx-qr-code__svg{border-radius:var(--tx-qr-code-border-radius)}:host([data-styled]) .tx-qr-code__background{fill:var(--tx-qr-code-background)}:host([data-styled]) .tx-qr-code__dots,:host([data-styled]) .tx-qr-code__eye-frames,:host([data-styled]) .tx-qr-code__eye-balls{fill:var(--tx-qr-code-color)}:host([data-styled]) .tx-qr-code__error{color:var(--tx-qr-code-error-color);font-family:var(--tx-font-family);font-size:var(--tx-qr-code-error-font-size)}\n"],
|
|
295
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
299
|
+
minVersion: "12.0.0",
|
|
300
|
+
version: "22.2.3",
|
|
301
|
+
ngImport: i0,
|
|
302
|
+
type: TxQrCode,
|
|
303
|
+
decorators: [{
|
|
304
|
+
type: Component,
|
|
305
|
+
args: [{
|
|
306
|
+
selector: "tx-qr-code",
|
|
307
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
308
|
+
host: {
|
|
309
|
+
class: "tx-qr-code",
|
|
310
|
+
"[class]": "passThrough().root?.class",
|
|
311
|
+
"[style]": "hostStyle()",
|
|
312
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
313
|
+
},
|
|
314
|
+
template: "@if (layout(); as layout) {\n <svg\n #svg\n class=\"tx-qr-code__svg\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n [attr.viewBox]=\"layout.viewBox.value\"\n [attr.shape-rendering]=\"dotStyle() === 'square' ? 'crispEdges' : null\"\n [class]=\"passThrough().svg?.class\"\n [style]=\"passThrough().svg?.style\"\n >\n @if (gradientLine(); as line) {\n <defs>\n @if (line.radial) {\n <radialGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.cx]=\"line.center\" [attr.cy]=\"line.center\" [attr.r]=\"line.radius\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </radialGradient>\n } @else {\n <linearGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.x1]=\"line.x1\" [attr.y1]=\"line.y1\" [attr.x2]=\"line.x2\" [attr.y2]=\"line.y2\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </linearGradient>\n }\n </defs>\n }\n <rect\n class=\"tx-qr-code__background\"\n [attr.x]=\"layout.viewBox.x\"\n [attr.y]=\"layout.viewBox.y\"\n [attr.width]=\"layout.viewBox.size\"\n [attr.height]=\"layout.viewBox.size\"\n [style.fill]=\"background() ?? null\"\n />\n <path class=\"tx-qr-code__dots\" [attr.d]=\"layout.paths.dots\" [style.fill]=\"dotFill()\" />\n <path class=\"tx-qr-code__eye-frames\" fill-rule=\"evenodd\" [attr.d]=\"layout.paths.eyeFrames\" [style.fill]=\"eyeColor() ?? dotFill()\" />\n <path class=\"tx-qr-code__eye-balls\" [attr.d]=\"layout.paths.eyeBalls\" [style.fill]=\"eyeBallColor() ?? eyeColor() ?? dotFill()\" />\n @if (layout.logoBox; as box) {\n <image\n class=\"tx-qr-code__logo\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.href]=\"logo()\"\n [attr.x]=\"box.x\"\n [attr.y]=\"box.y\"\n [attr.width]=\"box.size\"\n [attr.height]=\"box.size\"\n />\n }\n </svg>\n} @else if (hasError()) {\n <div class=\"tx-qr-code__error\" role=\"alert\" [style.width.px]=\"size()\" [style.height.px]=\"size()\" [class]=\"passThrough().error?.class\" [style]=\"passThrough().error?.style\">\n {{ translations().qrCodeError }}\n </div>\n}\n",
|
|
315
|
+
styles: [":host{display:inline-flex}.tx-qr-code__svg{display:block;max-width:100%;height:auto}.tx-qr-code__error{display:flex;align-items:center;justify-content:center;max-width:100%;box-sizing:border-box;text-align:center}:host([data-styled]) .tx-qr-code__svg{border-radius:var(--tx-qr-code-border-radius)}:host([data-styled]) .tx-qr-code__background{fill:var(--tx-qr-code-background)}:host([data-styled]) .tx-qr-code__dots,:host([data-styled]) .tx-qr-code__eye-frames,:host([data-styled]) .tx-qr-code__eye-balls{fill:var(--tx-qr-code-color)}:host([data-styled]) .tx-qr-code__error{color:var(--tx-qr-code-error-color);font-family:var(--tx-font-family);font-size:var(--tx-qr-code-error-font-size)}\n"]
|
|
316
|
+
}]
|
|
317
|
+
}],
|
|
318
|
+
propDecorators: {
|
|
319
|
+
svg: [{
|
|
320
|
+
type: i0.ViewChild,
|
|
321
|
+
args: ["svg", { isSignal: true }]
|
|
322
|
+
}],
|
|
323
|
+
data: [{
|
|
324
|
+
type: i0.Input,
|
|
325
|
+
args: [{
|
|
326
|
+
isSignal: true,
|
|
327
|
+
alias: "data",
|
|
328
|
+
required: true
|
|
329
|
+
}]
|
|
330
|
+
}],
|
|
331
|
+
size: [{
|
|
332
|
+
type: i0.Input,
|
|
333
|
+
args: [{
|
|
334
|
+
isSignal: true,
|
|
335
|
+
alias: "size",
|
|
336
|
+
required: false
|
|
337
|
+
}]
|
|
338
|
+
}],
|
|
339
|
+
margin: [{
|
|
340
|
+
type: i0.Input,
|
|
341
|
+
args: [{
|
|
342
|
+
isSignal: true,
|
|
343
|
+
alias: "margin",
|
|
344
|
+
required: false
|
|
345
|
+
}]
|
|
346
|
+
}],
|
|
347
|
+
errorCorrection: [{
|
|
348
|
+
type: i0.Input,
|
|
349
|
+
args: [{
|
|
350
|
+
isSignal: true,
|
|
351
|
+
alias: "errorCorrection",
|
|
352
|
+
required: false
|
|
353
|
+
}]
|
|
354
|
+
}],
|
|
355
|
+
dotStyle: [{
|
|
356
|
+
type: i0.Input,
|
|
357
|
+
args: [{
|
|
358
|
+
isSignal: true,
|
|
359
|
+
alias: "dotStyle",
|
|
360
|
+
required: false
|
|
361
|
+
}]
|
|
362
|
+
}],
|
|
363
|
+
eyeFrameStyle: [{
|
|
364
|
+
type: i0.Input,
|
|
365
|
+
args: [{
|
|
366
|
+
isSignal: true,
|
|
367
|
+
alias: "eyeFrameStyle",
|
|
368
|
+
required: false
|
|
369
|
+
}]
|
|
370
|
+
}],
|
|
371
|
+
eyeBallStyle: [{
|
|
372
|
+
type: i0.Input,
|
|
373
|
+
args: [{
|
|
374
|
+
isSignal: true,
|
|
375
|
+
alias: "eyeBallStyle",
|
|
376
|
+
required: false
|
|
377
|
+
}]
|
|
378
|
+
}],
|
|
379
|
+
color: [{
|
|
380
|
+
type: i0.Input,
|
|
381
|
+
args: [{
|
|
382
|
+
isSignal: true,
|
|
383
|
+
alias: "color",
|
|
384
|
+
required: false
|
|
385
|
+
}]
|
|
386
|
+
}],
|
|
387
|
+
background: [{
|
|
388
|
+
type: i0.Input,
|
|
389
|
+
args: [{
|
|
390
|
+
isSignal: true,
|
|
391
|
+
alias: "background",
|
|
392
|
+
required: false
|
|
393
|
+
}]
|
|
394
|
+
}],
|
|
395
|
+
eyeColor: [{
|
|
396
|
+
type: i0.Input,
|
|
397
|
+
args: [{
|
|
398
|
+
isSignal: true,
|
|
399
|
+
alias: "eyeColor",
|
|
400
|
+
required: false
|
|
401
|
+
}]
|
|
402
|
+
}],
|
|
403
|
+
eyeBallColor: [{
|
|
404
|
+
type: i0.Input,
|
|
405
|
+
args: [{
|
|
406
|
+
isSignal: true,
|
|
407
|
+
alias: "eyeBallColor",
|
|
408
|
+
required: false
|
|
409
|
+
}]
|
|
410
|
+
}],
|
|
411
|
+
gradient: [{
|
|
412
|
+
type: i0.Input,
|
|
413
|
+
args: [{
|
|
414
|
+
isSignal: true,
|
|
415
|
+
alias: "gradient",
|
|
416
|
+
required: false
|
|
417
|
+
}]
|
|
418
|
+
}],
|
|
419
|
+
logo: [{
|
|
420
|
+
type: i0.Input,
|
|
421
|
+
args: [{
|
|
422
|
+
isSignal: true,
|
|
423
|
+
alias: "logo",
|
|
424
|
+
required: false
|
|
425
|
+
}]
|
|
426
|
+
}],
|
|
427
|
+
logoSize: [{
|
|
428
|
+
type: i0.Input,
|
|
429
|
+
args: [{
|
|
430
|
+
isSignal: true,
|
|
431
|
+
alias: "logoSize",
|
|
432
|
+
required: false
|
|
433
|
+
}]
|
|
434
|
+
}],
|
|
435
|
+
logoMargin: [{
|
|
436
|
+
type: i0.Input,
|
|
437
|
+
args: [{
|
|
438
|
+
isSignal: true,
|
|
439
|
+
alias: "logoMargin",
|
|
440
|
+
required: false
|
|
441
|
+
}]
|
|
442
|
+
}],
|
|
443
|
+
ariaLabel: [{
|
|
444
|
+
type: i0.Input,
|
|
445
|
+
args: [{
|
|
446
|
+
isSignal: true,
|
|
447
|
+
alias: "ariaLabel",
|
|
448
|
+
required: false
|
|
449
|
+
}]
|
|
450
|
+
}],
|
|
451
|
+
dt: [{
|
|
452
|
+
type: i0.Input,
|
|
453
|
+
args: [{
|
|
454
|
+
isSignal: true,
|
|
455
|
+
alias: "dt",
|
|
456
|
+
required: false
|
|
457
|
+
}]
|
|
458
|
+
}],
|
|
459
|
+
pt: [{
|
|
460
|
+
type: i0.Input,
|
|
461
|
+
args: [{
|
|
462
|
+
isSignal: true,
|
|
463
|
+
alias: "pt",
|
|
464
|
+
required: false
|
|
465
|
+
}]
|
|
466
|
+
}],
|
|
467
|
+
ptOptions: [{
|
|
468
|
+
type: i0.Input,
|
|
469
|
+
args: [{
|
|
470
|
+
isSignal: true,
|
|
471
|
+
alias: "ptOptions",
|
|
472
|
+
required: false
|
|
473
|
+
}]
|
|
474
|
+
}],
|
|
475
|
+
unstyled: [{
|
|
476
|
+
type: i0.Input,
|
|
477
|
+
args: [{
|
|
478
|
+
isSignal: true,
|
|
479
|
+
alias: "unstyled",
|
|
480
|
+
required: false
|
|
481
|
+
}]
|
|
482
|
+
}]
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
export { TxQrCode };
|
|
486
|
+
|
|
487
|
+
//# sourceMappingURL=tectra-ng-blocks-qr-code.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-qr-code.mjs","names":[],"sources":["../../../../packages/blocks/qr-code/src/qr-code.component.ts","../../../../packages/blocks/qr-code/src/qr-code.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, computed, inject, input, numberAttribute, viewChild } from '@angular/core';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraQrCodeTokens, toStyleObject } from '@tectra-ng/themes';\nimport {\n TxQrDotStyle,\n TxQrErrorCorrection,\n TxQrEyeBallStyle,\n TxQrEyeFrameStyle,\n TxQrGradient,\n TxQrImageFormat,\n TxQrLayout,\n qrGradientLine,\n qrLayout,\n svgDataUrl,\n svgToPng,\n inlineSvgImages,\n} from '@tectra-ng/qr';\nimport { TxQrCodePart } from './qr-code.types';\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\nconst PAINTED = '.tx-qr-code__background, .tx-qr-code__dots, .tx-qr-code__eye-frames, .tx-qr-code__eye-balls';\n\n@Component({\n selector: 'tx-qr-code',\n templateUrl: './qr-code.component.html',\n styleUrl: './qr-code.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-qr-code',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxQrCode {\n private readonly document = inject(DOCUMENT);\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n readonly data = input.required<string>();\n readonly size = input<number, unknown>(200, { transform: numberAttribute });\n readonly margin = input<number, unknown>(1, { transform: numberAttribute });\n readonly errorCorrection = input<TxQrErrorCorrection | undefined>(undefined);\n readonly dotStyle = input<TxQrDotStyle>('square');\n readonly eyeFrameStyle = input<TxQrEyeFrameStyle>('square');\n readonly eyeBallStyle = input<TxQrEyeBallStyle>('square');\n readonly color = input<string | undefined>(undefined);\n readonly background = input<string | undefined>(undefined);\n readonly eyeColor = input<string | undefined>(undefined);\n readonly eyeBallColor = input<string | undefined>(undefined);\n readonly gradient = input<TxQrGradient | undefined>(undefined);\n readonly logo = input<string | undefined>(undefined);\n readonly logoSize = input<number, unknown>(0.22, { transform: numberAttribute });\n readonly logoMargin = input<number, unknown>(1, { transform: numberAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraQrCodeTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxQrCodePart, TxQrCode> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('qrCode', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly gradientId = uniqueId('tx-qr-code-gradient');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-qr-code'), ...this.passThrough().root?.style }));\n\n readonly layout = computed<TxQrLayout | null>(() => {\n const data = this.data();\n if (!data) {\n return null;\n }\n try {\n return qrLayout(data, {\n margin: this.margin(),\n errorCorrection: this.errorCorrection(),\n dotStyle: this.dotStyle(),\n eyeFrameStyle: this.eyeFrameStyle(),\n eyeBallStyle: this.eyeBallStyle(),\n logo: this.logo(),\n logoSize: this.logoSize(),\n logoMargin: this.logoMargin(),\n });\n } catch {\n return null;\n }\n });\n readonly matrix = computed(() => this.layout()?.matrix ?? null);\n readonly hasError = computed(() => !!this.data() && !this.layout());\n protected readonly gradientLine = computed(() => {\n const gradient = this.gradient();\n const matrix = this.matrix();\n return gradient && matrix ? qrGradientLine(gradient, matrix.size) : null;\n });\n\n protected readonly dotFill = computed(() => (this.gradient() ? `url(#${this.gradientId})` : (this.color() ?? null)));\n protected readonly label = computed(() => this.ariaLabel() ?? this.translations().qrCode);\n\n toSvgString(): string {\n const svg = this.svg()?.nativeElement;\n const view = this.document.defaultView;\n if (!svg || !view) {\n return '';\n }\n const clone = svg.cloneNode(true) as SVGSVGElement;\n const source = Array.from(svg.querySelectorAll<SVGElement>(PAINTED));\n Array.from(clone.querySelectorAll<SVGElement>(PAINTED)).forEach((element, index) => {\n const fill = view.getComputedStyle(source[index]).fill;\n element.setAttribute('fill', fill.startsWith('url(') ? `url(#${this.gradientId})` : fill);\n });\n clone.querySelectorAll('*').forEach((element) => {\n element.removeAttribute('class');\n element.removeAttribute('style');\n Array.from(element.attributes)\n .filter((attribute) => attribute.name.startsWith('_ng'))\n .forEach((attribute) => element.removeAttribute(attribute.name));\n });\n clone.removeAttribute('class');\n clone.removeAttribute('style');\n clone.removeAttribute('role');\n clone.removeAttribute('aria-label');\n Array.from(clone.attributes)\n .filter((attribute) => attribute.name.startsWith('_ng'))\n .forEach((attribute) => clone.removeAttribute(attribute.name));\n const comments = this.document.createTreeWalker(clone, NodeFilter.SHOW_COMMENT);\n const found: Node[] = [];\n while (comments.nextNode()) {\n found.push(comments.currentNode);\n }\n found.forEach((comment) => comment.parentNode?.removeChild(comment));\n clone.setAttribute('xmlns', SVG_NS);\n return new view.XMLSerializer().serializeToString(clone);\n }\n\n async toDataUrl(format: TxQrImageFormat = 'png', pixelSize = 1024): Promise<string> {\n const svg = this.toSvgString();\n return format === 'svg' ? svgDataUrl(await inlineSvgImages(svg)) : svgToPng(svg, pixelSize);\n }\n\n async download(format: TxQrImageFormat = 'png', fileName = 'qr-code', pixelSize = 1024): Promise<void> {\n const link = this.document.createElement('a');\n link.href = await this.toDataUrl(format, pixelSize);\n link.download = `${fileName}.${format}`;\n link.click();\n }\n}\n","@if (layout(); as layout) {\n <svg\n #svg\n class=\"tx-qr-code__svg\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n [attr.viewBox]=\"layout.viewBox.value\"\n [attr.shape-rendering]=\"dotStyle() === 'square' ? 'crispEdges' : null\"\n [class]=\"passThrough().svg?.class\"\n [style]=\"passThrough().svg?.style\"\n >\n @if (gradientLine(); as line) {\n <defs>\n @if (line.radial) {\n <radialGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.cx]=\"line.center\" [attr.cy]=\"line.center\" [attr.r]=\"line.radius\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </radialGradient>\n } @else {\n <linearGradient gradientUnits=\"userSpaceOnUse\" [attr.id]=\"gradientId\" [attr.x1]=\"line.x1\" [attr.y1]=\"line.y1\" [attr.x2]=\"line.x2\" [attr.y2]=\"line.y2\">\n <stop offset=\"0\" [attr.stop-color]=\"line.colors[0]\" />\n <stop offset=\"1\" [attr.stop-color]=\"line.colors[1]\" />\n </linearGradient>\n }\n </defs>\n }\n <rect\n class=\"tx-qr-code__background\"\n [attr.x]=\"layout.viewBox.x\"\n [attr.y]=\"layout.viewBox.y\"\n [attr.width]=\"layout.viewBox.size\"\n [attr.height]=\"layout.viewBox.size\"\n [style.fill]=\"background() ?? null\"\n />\n <path class=\"tx-qr-code__dots\" [attr.d]=\"layout.paths.dots\" [style.fill]=\"dotFill()\" />\n <path class=\"tx-qr-code__eye-frames\" fill-rule=\"evenodd\" [attr.d]=\"layout.paths.eyeFrames\" [style.fill]=\"eyeColor() ?? dotFill()\" />\n <path class=\"tx-qr-code__eye-balls\" [attr.d]=\"layout.paths.eyeBalls\" [style.fill]=\"eyeBallColor() ?? eyeColor() ?? dotFill()\" />\n @if (layout.logoBox; as box) {\n <image\n class=\"tx-qr-code__logo\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.href]=\"logo()\"\n [attr.x]=\"box.x\"\n [attr.y]=\"box.y\"\n [attr.width]=\"box.size\"\n [attr.height]=\"box.size\"\n />\n }\n </svg>\n} @else if (hasError()) {\n <div class=\"tx-qr-code__error\" role=\"alert\" [style.width.px]=\"size()\" [style.height.px]=\"size()\" [class]=\"passThrough().error?.class\" [style]=\"passThrough().error?.style\">\n {{ translations().qrCodeError }}\n </div>\n}\n"],"mappings":";;;;;;;;AAsBA,MAAM,SAAS;AACf,MAAM,UAAU;AAchB,IAAa,WAAb,MAAa,SAAQ;CACF,WAAW,OAAO,QAAQ;CAC1B,MAAM,UAAqC,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,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