@saasquatch/mint-components 1.13.3-10 → 1.13.3-12
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-qr-code-view-15dfc0b6.js +103 -0
- package/dist/cjs/sqm-qr-code.cjs.entry.js +22 -15
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +25 -11
- package/dist/collection/components/sqm-qr-code/QRCode.stories.js +19 -9
- package/dist/collection/components/sqm-qr-code/sqm-qr-code-view.js +44 -35
- package/dist/collection/components/sqm-qr-code/sqm-qr-code.js +65 -1
- package/dist/collection/components/sqm-qr-code/useQRCode.js +8 -14
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-qr-code-view-f1d0763b.js +101 -0
- package/dist/esm/sqm-qr-code.entry.js +22 -15
- package/dist/esm/sqm-stencilbook.entry.js +25 -11
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-qr-code-view-f1d0763b.js +1 -0
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-47d5d99b.system.entry.js +1 -0
- package/dist/mint-components/p-aad32fb6.system.js +1 -0
- package/dist/mint-components/{p-dfcc0f0e.entry.js → p-ab8fba55.entry.js} +2 -2
- package/dist/mint-components/p-d70a5363.entry.js +17 -0
- package/dist/mint-components/{p-e706440c.system.entry.js → p-db6a5c9d.system.entry.js} +1 -1
- package/dist/mint-components/p-f56bedd5.js +1 -0
- package/dist/types/components/sqm-qr-code/QRCode.stories.d.ts +5 -1
- package/dist/types/components/sqm-qr-code/sqm-qr-code-view.d.ts +4 -6
- package/dist/types/components/sqm-qr-code/sqm-qr-code.d.ts +11 -0
- package/dist/types/components.d.ts +22 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-qr-code-view-3f30d2cd.js +0 -94
- package/dist/esm/sqm-qr-code-view-7c441329.js +0 -92
- package/dist/esm-es5/sqm-qr-code-view-7c441329.js +0 -1
- package/dist/mint-components/p-06267664.system.js +0 -1
- package/dist/mint-components/p-45e82465.entry.js +0 -17
- package/dist/mint-components/p-b630683c.system.entry.js +0 -1
- package/dist/mint-components/p-e6e2b28b.js +0 -1
|
@@ -34,7 +34,7 @@ require('./utilities-78f5e169.js');
|
|
|
34
34
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-fe602822.js');
|
|
35
35
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7b678f34.js');
|
|
36
36
|
require('./ErrorView-b2fcf954.js');
|
|
37
|
-
const sqmQrCodeView = require('./sqm-qr-code-view-
|
|
37
|
+
const sqmQrCodeView = require('./sqm-qr-code-view-15dfc0b6.js');
|
|
38
38
|
const ShadowViewAddon = require('./ShadowViewAddon-3ddee92b.js');
|
|
39
39
|
const sqmPortalContainerView = require('./sqm-portal-container-view-4f15143a.js');
|
|
40
40
|
const sqmInvoiceTableView = require('./sqm-invoice-table-view-16ac73d0.js');
|
|
@@ -15678,11 +15678,10 @@ const QRCode_stories = {
|
|
|
15678
15678
|
title: "Components/QR Code",
|
|
15679
15679
|
};
|
|
15680
15680
|
const defaultProps$r = {
|
|
15681
|
-
|
|
15681
|
+
hideTitle: false,
|
|
15682
|
+
loading: false,
|
|
15683
|
+
alignment: "center",
|
|
15682
15684
|
error: false,
|
|
15683
|
-
viewError: false,
|
|
15684
|
-
showDialog: () => void 0,
|
|
15685
|
-
hideDialog: () => void 0,
|
|
15686
15685
|
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
15687
15686
|
createDownloadable: async () => {
|
|
15688
15687
|
console.log("Download QR Code clicked");
|
|
@@ -15691,7 +15690,6 @@ const defaultProps$r = {
|
|
|
15691
15690
|
console.log("Print QR Code clicked");
|
|
15692
15691
|
},
|
|
15693
15692
|
titleText: "Share your QR code",
|
|
15694
|
-
viewCodeText: "View QR code",
|
|
15695
15693
|
downloadCodeText: "Download",
|
|
15696
15694
|
printCodeText: "Print",
|
|
15697
15695
|
errorHeaderText: "There was an error loading your QR code",
|
|
@@ -15700,21 +15698,37 @@ const defaultProps$r = {
|
|
|
15700
15698
|
const Default$o = () => {
|
|
15701
15699
|
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r));
|
|
15702
15700
|
};
|
|
15703
|
-
const
|
|
15704
|
-
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, {
|
|
15701
|
+
const HideTitle = () => {
|
|
15702
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { hideTitle: true }));
|
|
15703
|
+
};
|
|
15704
|
+
const LeftAlign$1 = () => {
|
|
15705
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { alignment: "left" }));
|
|
15706
|
+
};
|
|
15707
|
+
const CenterAlign = () => {
|
|
15708
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { alignment: "center" }));
|
|
15709
|
+
};
|
|
15710
|
+
const RightAlign$1 = () => {
|
|
15711
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { alignment: "right" }));
|
|
15712
|
+
};
|
|
15713
|
+
const Loading$b = () => {
|
|
15714
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { loading: true }));
|
|
15705
15715
|
};
|
|
15706
15716
|
const Error$b = () => {
|
|
15707
|
-
return
|
|
15717
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { error: true }));
|
|
15708
15718
|
};
|
|
15709
15719
|
const DownloadError = () => {
|
|
15710
|
-
return
|
|
15720
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$r, { error: true }));
|
|
15711
15721
|
};
|
|
15712
15722
|
|
|
15713
15723
|
const QRCode = /*#__PURE__*/Object.freeze({
|
|
15714
15724
|
__proto__: null,
|
|
15715
15725
|
'default': QRCode_stories,
|
|
15716
15726
|
Default: Default$o,
|
|
15717
|
-
|
|
15727
|
+
HideTitle: HideTitle,
|
|
15728
|
+
LeftAlign: LeftAlign$1,
|
|
15729
|
+
CenterAlign: CenterAlign,
|
|
15730
|
+
RightAlign: RightAlign$1,
|
|
15731
|
+
Loading: Loading$b,
|
|
15718
15732
|
Error: Error$b,
|
|
15719
15733
|
DownloadError: DownloadError
|
|
15720
15734
|
});
|
|
@@ -4,11 +4,10 @@ export default {
|
|
|
4
4
|
title: "Components/QR Code",
|
|
5
5
|
};
|
|
6
6
|
const defaultProps = {
|
|
7
|
-
|
|
7
|
+
hideTitle: false,
|
|
8
|
+
loading: false,
|
|
9
|
+
alignment: "center",
|
|
8
10
|
error: false,
|
|
9
|
-
viewError: false,
|
|
10
|
-
showDialog: () => void 0,
|
|
11
|
-
hideDialog: () => void 0,
|
|
12
11
|
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
13
12
|
createDownloadable: async () => {
|
|
14
13
|
console.log("Download QR Code clicked");
|
|
@@ -17,7 +16,6 @@ const defaultProps = {
|
|
|
17
16
|
console.log("Print QR Code clicked");
|
|
18
17
|
},
|
|
19
18
|
titleText: "Share your QR code",
|
|
20
|
-
viewCodeText: "View QR code",
|
|
21
19
|
downloadCodeText: "Download",
|
|
22
20
|
printCodeText: "Print",
|
|
23
21
|
errorHeaderText: "There was an error loading your QR code",
|
|
@@ -26,12 +24,24 @@ const defaultProps = {
|
|
|
26
24
|
export const Default = () => {
|
|
27
25
|
return h(QrCodeView, Object.assign({}, defaultProps));
|
|
28
26
|
};
|
|
29
|
-
export const
|
|
30
|
-
return h(QrCodeView, Object.assign({}, defaultProps, {
|
|
27
|
+
export const HideTitle = () => {
|
|
28
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { hideTitle: true }));
|
|
29
|
+
};
|
|
30
|
+
export const LeftAlign = () => {
|
|
31
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "left" }));
|
|
32
|
+
};
|
|
33
|
+
export const CenterAlign = () => {
|
|
34
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "center" }));
|
|
35
|
+
};
|
|
36
|
+
export const RightAlign = () => {
|
|
37
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "right" }));
|
|
38
|
+
};
|
|
39
|
+
export const Loading = () => {
|
|
40
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { loading: true }));
|
|
31
41
|
};
|
|
32
42
|
export const Error = () => {
|
|
33
|
-
return
|
|
43
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { error: true }));
|
|
34
44
|
};
|
|
35
45
|
export const DownloadError = () => {
|
|
36
|
-
return
|
|
46
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { error: true }));
|
|
37
47
|
};
|
|
@@ -6,15 +6,16 @@ const style = {
|
|
|
6
6
|
maxWidth: "390px !important",
|
|
7
7
|
},
|
|
8
8
|
Container: {
|
|
9
|
+
width: "100%",
|
|
9
10
|
display: "flex",
|
|
10
11
|
flexDirection: "row",
|
|
11
12
|
gap: "var(--sl-spacing-small)",
|
|
12
|
-
justifyContent: "space-between",
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
TextContainer: {
|
|
15
15
|
display: "flex",
|
|
16
16
|
gap: "var(--sl-spacing-medium)",
|
|
17
17
|
flexDirection: "column",
|
|
18
|
+
alignItems: "center",
|
|
18
19
|
},
|
|
19
20
|
ButtonContainer: {
|
|
20
21
|
display: "flex",
|
|
@@ -37,28 +38,20 @@ const style = {
|
|
|
37
38
|
height: "100%",
|
|
38
39
|
maxWidth: "335px",
|
|
39
40
|
},
|
|
41
|
+
TextButton: {
|
|
42
|
+
"&::part(base)": {
|
|
43
|
+
color: "var(--sl-color-gray-600)",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
LoadingSkeleton: {
|
|
47
|
+
"&::part(indicator)": {
|
|
48
|
+
borderRadius: "0px !important",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
40
51
|
};
|
|
41
52
|
const sheet = createStyleSheet(style);
|
|
42
53
|
const styleString = sheet.toString();
|
|
43
54
|
const vanillaStyle = `
|
|
44
|
-
sl-dialog::part(base) {
|
|
45
|
-
inset: auto;
|
|
46
|
-
position: absolute;
|
|
47
|
-
left: 25%;
|
|
48
|
-
}
|
|
49
|
-
sl-dialog::part(panel) {
|
|
50
|
-
max-width: 390px;
|
|
51
|
-
width: 100%;
|
|
52
|
-
}
|
|
53
|
-
sl-dialog::part(footer) {
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
gap: var(--sl-spacing-small);
|
|
57
|
-
width: 100%;
|
|
58
|
-
}
|
|
59
|
-
sl-dialog::part(body) {
|
|
60
|
-
padding: 0 var(--sl-spacing-large);
|
|
61
|
-
}
|
|
62
55
|
:host{
|
|
63
56
|
display: flex;
|
|
64
57
|
width: 100%;
|
|
@@ -67,23 +60,39 @@ const vanillaStyle = `
|
|
|
67
60
|
:host{
|
|
68
61
|
display: block;
|
|
69
62
|
}
|
|
63
|
+
|
|
70
64
|
}`;
|
|
71
|
-
export function QrCodeView({
|
|
72
|
-
|
|
65
|
+
export function QrCodeView({ error, qrLink, titleText, downloadCodeText, printCodeText, errorHeaderText, errorDescriptionText, createDownloadable, createPrintable, hideTitle, alignment, loading, }) {
|
|
66
|
+
const codeAlignment = alignment === "left"
|
|
67
|
+
? "flex-start"
|
|
68
|
+
: alignment === "right"
|
|
69
|
+
? "flex-end"
|
|
70
|
+
: "center";
|
|
71
|
+
const getCodeContent = (error, qrLink, loading) => {
|
|
72
|
+
if (error) {
|
|
73
|
+
return (h(ErrorView, { loadingErrorAlertDescription: errorHeaderText, loadingErrorAlertHeader: errorDescriptionText }));
|
|
74
|
+
}
|
|
75
|
+
else if (loading) {
|
|
76
|
+
return (h("sl-skeleton", { className: sheet.classes.LoadingSkeleton, effect: "sheen", style: {
|
|
77
|
+
width: "100px",
|
|
78
|
+
height: "100px",
|
|
79
|
+
borderRadius: "0px !important",
|
|
80
|
+
} }));
|
|
81
|
+
}
|
|
82
|
+
else if (qrLink) {
|
|
83
|
+
return (h("svg", { width: "100", height: "100" },
|
|
84
|
+
h("image", { href: qrLink, width: "100", height: "100" })));
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
};
|
|
88
|
+
const codeContent = getCodeContent(error, qrLink, loading);
|
|
89
|
+
return (h("div", { class: sheet.classes.Container, style: { justifyContent: codeAlignment }, part: "sqm-base" },
|
|
73
90
|
h("style", null, vanillaStyle),
|
|
74
91
|
h("style", null, styleString),
|
|
75
|
-
h("div", { class: sheet.classes.
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
h("div", { class: sheet.classes.TextContainer, style: { alignItems: codeAlignment } },
|
|
93
|
+
!hideTitle && h("span", { part: "sqm-title" }, titleText),
|
|
94
|
+
codeContent,
|
|
78
95
|
h("div", { class: sheet.classes.ButtonContainer },
|
|
79
|
-
h("sl-button", {
|
|
80
|
-
h("sl-button", { exportparts: "base: textbutton-base", type: "text", onClick:
|
|
81
|
-
h("sl-button", { exportparts: "base: textbutton-base", type: "text", onClick: createPrintable }, printCodeText))),
|
|
82
|
-
h("sl-dialog", { class: sheet.classes.DialogContainer, width: "250px", open: dialogIsOpen, label: titleText, "onSl-hide": hideDialog },
|
|
83
|
-
(viewError || error) && (h(ErrorView, { loadingErrorAlertDescription: errorHeaderText, loadingErrorAlertHeader: errorDescriptionText })),
|
|
84
|
-
qrLink && (h("div", { class: sheet.classes.CodeContainer },
|
|
85
|
-
h("img", { class: sheet.classes.Code, src: qrLink }))),
|
|
86
|
-
h("div", { slot: "footer", class: sheet.classes.FooterContainer },
|
|
87
|
-
h("sl-button", { exportparts: "base: button-base", disabled: error, variant: "default", onClick: createDownloadable }, downloadCodeText),
|
|
88
|
-
h("sl-button", { exportparts: "base: button-base", disabled: error, variant: "default", onClick: createPrintable }, printCodeText)))));
|
|
96
|
+
h("sl-button", { size: "small", exportparts: "base: defaultbutton-base", type: "default", onClick: createDownloadable }, downloadCodeText),
|
|
97
|
+
h("sl-button", { size: "small", exportparts: "base: textbutton-base", type: "text", onClick: createPrintable, class: sheet.classes.TextButton }, printCodeText)))));
|
|
89
98
|
}
|
|
@@ -36,6 +36,17 @@ export class QrCode {
|
|
|
36
36
|
* @uiName Description for error banner
|
|
37
37
|
*/
|
|
38
38
|
this.errorDescriptionText = "Please refresh this page and try again";
|
|
39
|
+
/**
|
|
40
|
+
* @uiName Hide title
|
|
41
|
+
*/
|
|
42
|
+
this.hideTitle = false;
|
|
43
|
+
/**
|
|
44
|
+
* @uiName QR code alignment
|
|
45
|
+
* @uiType string
|
|
46
|
+
* @uiEnum ["left", "center", "right"]
|
|
47
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
48
|
+
*/
|
|
49
|
+
this.alignment = "center";
|
|
39
50
|
withHooks(this);
|
|
40
51
|
}
|
|
41
52
|
disconnectedCallback() { }
|
|
@@ -173,12 +184,63 @@ export class QrCode {
|
|
|
173
184
|
"reflect": false,
|
|
174
185
|
"defaultValue": "\"Please refresh this page and try again\""
|
|
175
186
|
},
|
|
187
|
+
"hideTitle": {
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "boolean",
|
|
192
|
+
"resolved": "boolean",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": true,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [{
|
|
199
|
+
"text": "Hide title",
|
|
200
|
+
"name": "uiName"
|
|
201
|
+
}],
|
|
202
|
+
"text": ""
|
|
203
|
+
},
|
|
204
|
+
"attribute": "hide-title",
|
|
205
|
+
"reflect": false,
|
|
206
|
+
"defaultValue": "false"
|
|
207
|
+
},
|
|
208
|
+
"alignment": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"mutable": false,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "\"left\" | \"center\" | \"right\"",
|
|
213
|
+
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": true,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [{
|
|
220
|
+
"text": "QR code alignment",
|
|
221
|
+
"name": "uiName"
|
|
222
|
+
}, {
|
|
223
|
+
"text": "string",
|
|
224
|
+
"name": "uiType"
|
|
225
|
+
}, {
|
|
226
|
+
"text": "[\"left\", \"center\", \"right\"]",
|
|
227
|
+
"name": "uiEnum"
|
|
228
|
+
}, {
|
|
229
|
+
"text": "[\"Left\", \"Center\", \"Right\"]",
|
|
230
|
+
"name": "uiEnumNames"
|
|
231
|
+
}],
|
|
232
|
+
"text": ""
|
|
233
|
+
},
|
|
234
|
+
"attribute": "alignment",
|
|
235
|
+
"reflect": false,
|
|
236
|
+
"defaultValue": "\"center\""
|
|
237
|
+
},
|
|
176
238
|
"demoData": {
|
|
177
239
|
"type": "unknown",
|
|
178
240
|
"mutable": false,
|
|
179
241
|
"complexType": {
|
|
180
242
|
"original": "DemoData<QRCodeViewProps>",
|
|
181
|
-
"resolved": "{
|
|
243
|
+
"resolved": "{ loading?: boolean; titleText?: string; alignment?: \"left\" | \"right\" | \"center\"; error?: boolean; qrLink?: string; createDownloadable?: () => void; hideTitle?: boolean; downloadCodeText?: string; printCodeText?: string; errorHeaderText?: string; errorDescriptionText?: string; createPrintable?: () => void; }",
|
|
182
244
|
"references": {
|
|
183
245
|
"DemoData": {
|
|
184
246
|
"location": "import",
|
|
@@ -209,12 +271,14 @@ function useDemoQRCode(props) {
|
|
|
209
271
|
const [dialogIsOpen, setDialog] = useState(false);
|
|
210
272
|
return deepmerge({
|
|
211
273
|
dialogIsOpen,
|
|
274
|
+
hideTitle: props.hideTitle,
|
|
212
275
|
showDialog: () => setDialog(true),
|
|
213
276
|
hideDialog: () => setDialog(false),
|
|
214
277
|
titleText: props.titleText,
|
|
215
278
|
viewCodeText: props.viewCodeText,
|
|
216
279
|
downloadCodeText: props.downloadCodeText,
|
|
217
280
|
printCodeText: props.printCodeText,
|
|
281
|
+
alignment: props.alignment,
|
|
218
282
|
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
219
283
|
fireViewQrEvent: () => {
|
|
220
284
|
console.log("View QR Code clicked");
|
|
@@ -27,10 +27,9 @@ export function useQRCode(props) {
|
|
|
27
27
|
const user = useUserIdentity();
|
|
28
28
|
const engagementMedium = useEngagementMedium();
|
|
29
29
|
const contextData = useParentValue(REFERRAL_CODES_NAMESPACE);
|
|
30
|
-
const [dialogIsOpen, setDialog] = useState(false);
|
|
31
30
|
const [qrLink, setQrUrl] = useState(null);
|
|
32
31
|
const [error, setError] = useState(false);
|
|
33
|
-
const [
|
|
32
|
+
const [loading, setLoading] = useState(false);
|
|
34
33
|
const { data, errors } = useQuery(ShareLinkQuery, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
|
|
35
34
|
const [sendLoadEvent] = useMutation(WIDGET_ENGAGEMENT_EVENT);
|
|
36
35
|
const shareLink = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink;
|
|
@@ -39,14 +38,18 @@ export function useQRCode(props) {
|
|
|
39
38
|
if (!shareLink)
|
|
40
39
|
return;
|
|
41
40
|
const getQrCode = async () => {
|
|
41
|
+
setLoading(true);
|
|
42
42
|
try {
|
|
43
|
-
const res = await fetch(`${shareLink}?qrCode&qrCodeImageFormat=svg`);
|
|
43
|
+
const res = await fetch(`${shareLink}?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0`);
|
|
44
44
|
const blob = await res.blob();
|
|
45
45
|
const url = URL.createObjectURL(blob);
|
|
46
46
|
setQrUrl(url);
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
|
49
|
-
|
|
49
|
+
setError(true);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
setLoading(false);
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
getQrCode();
|
|
@@ -111,18 +114,9 @@ export function useQRCode(props) {
|
|
|
111
114
|
};
|
|
112
115
|
return {
|
|
113
116
|
...props,
|
|
117
|
+
loading,
|
|
114
118
|
qrLink,
|
|
115
|
-
dialogIsOpen,
|
|
116
119
|
error: error,
|
|
117
|
-
viewError: viewError || !!(errors === null || errors === void 0 ? void 0 : errors.message),
|
|
118
|
-
showDialog: () => {
|
|
119
|
-
setError(false);
|
|
120
|
-
setDialog(true);
|
|
121
|
-
},
|
|
122
|
-
hideDialog: () => {
|
|
123
|
-
setError(false);
|
|
124
|
-
setDialog(false);
|
|
125
|
-
},
|
|
126
120
|
createDownloadable,
|
|
127
121
|
createPrintable,
|
|
128
122
|
};
|