@gataca/qr 3.0.9 → 3.0.11
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/gataca-autoqr.cjs.entry.js +9 -9
- package/dist/cjs/gataca-qr_2.cjs.entry.js +37 -47
- package/dist/cjs/gataca-qrws.cjs.entry.js +36 -43
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +34 -38
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{utils-ef28b844.js → utils-b4e62bc0.js} +1 -1
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +13 -13
- package/dist/collection/components/gataca-qr/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +4 -4
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qr/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qr/gataca-qr.js +46 -56
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +12 -12
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +4 -4
- package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qrws/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +50 -57
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +62 -52
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +12 -12
- package/dist/collection/index.js +2 -2
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/utils.js +1 -1
- package/dist/components/gat-icon-alert.js +1 -1
- package/dist/components/gataca-autoqr.js +9 -9
- package/dist/components/gataca-qr2.js +29 -39
- package/dist/components/gataca-qrdisplay2.js +7 -7
- package/dist/components/gataca-qrws2.js +35 -42
- package/dist/components/gataca-ssibutton2.js +27 -31
- package/dist/components/gataca-ssibuttonws2.js +6 -6
- package/dist/esm/gataca-autoqr.entry.js +9 -9
- package/dist/esm/gataca-qr_2.entry.js +37 -47
- package/dist/esm/gataca-qrws.entry.js +36 -43
- package/dist/esm/gataca-ssibutton_2.entry.js +34 -38
- package/dist/esm/index.js +1 -1
- package/dist/esm/{utils-63e7a33b.js → utils-21ffcc1e.js} +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/p-2adc0bcc.entry.js +1 -0
- package/dist/gatacaqr/p-2ddbc2fc.entry.js +1 -0
- package/dist/gatacaqr/p-d2dd7c85.entry.js +1 -0
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +7 -7
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +2 -2
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +5 -5
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +2 -2
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +5 -5
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +9 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +3 -3
- package/dist/types/components.d.ts +28 -36
- package/dist/types/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +30 -7
- package/dist/gatacaqr/p-92a2e6f0.entry.js +0 -1
- package/dist/gatacaqr/p-9af5d2fe.entry.js +0 -1
- package/dist/gatacaqr/p-dc592fa5.entry.js +0 -1
- /package/dist/gatacaqr/{p-2cd7b062.js → p-bce7e590.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { h
|
|
2
|
-
import logoGataca from
|
|
3
|
-
import
|
|
4
|
-
import { base64UrlEncode, checkMobile, RESULT_STATUS } from
|
|
5
|
-
import { Success } from
|
|
6
|
-
import { RetryButton } from
|
|
7
|
-
import { ReadQR } from
|
|
8
|
-
import { QR } from
|
|
9
|
-
const DEEP_LINK_PREFIX =
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import logoGataca from '../../assets/images/logo_gataca.svg';
|
|
3
|
+
import '../gataca-qrdisplay/gataca-qrdisplay';
|
|
4
|
+
import { base64UrlEncode, checkMobile, RESULT_STATUS } from '../../utils/utils';
|
|
5
|
+
import { Success } from './components/success/Success';
|
|
6
|
+
import { RetryButton } from './components/retryButton/RetryButton';
|
|
7
|
+
import { ReadQR } from './components/readQR/ReadQR';
|
|
8
|
+
import { QR } from './components/qr/QR';
|
|
9
|
+
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
10
10
|
//Default values
|
|
11
11
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
12
12
|
const DEFAULT_POLLING_FREQ = 3;
|
|
13
13
|
export class GatacaQR {
|
|
14
|
-
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType =
|
|
14
|
+
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType = 'svg'; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = '3'; this.qrModalTitle = 'Quick Access'; this.modalTitleColor = '#4745B7'; this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet'; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = 'QR Code expired'; this.credentialsNotValidatedLabel = 'User credentials not validated'; this.clickInsideBoxLabel = 'Click inside the box to'; this.refreshQrLabel = 'Refresh QR Code'; this.scanQrLabel = 'Scan QR Code'; this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time'; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = 'No successful login'; this.successLoginLabel = 'Successful Connection!'; this.byBrandLabel = 'by Gataca'; this.waitingStartSessionLabel = 'waiting to start a session'; this.readQrTitle = 'Processing...'; this.readQrDescription = 'Please wait a moment'; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
15
15
|
disconnectedCallback() {
|
|
16
16
|
this.stop();
|
|
17
17
|
}
|
|
@@ -41,9 +41,7 @@ export class GatacaQR {
|
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
if (err !== RESULT_STATUS.NOT_STARTED) {
|
|
44
|
-
let error = expired
|
|
45
|
-
? new Error(this.userNotScanInTimeErrorLabel)
|
|
46
|
-
: new Error(this.credsNotValidatedErrorLabel);
|
|
44
|
+
let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
|
|
47
45
|
this.result = err;
|
|
48
46
|
this.gatacaLoginFailed.emit(error);
|
|
49
47
|
this.errorCallback(error);
|
|
@@ -71,9 +69,7 @@ export class GatacaQR {
|
|
|
71
69
|
* Retrieve manually the session data on a successful login
|
|
72
70
|
*/
|
|
73
71
|
async getSessionData() {
|
|
74
|
-
return this.sessionData
|
|
75
|
-
? Promise.resolve(this.sessionData)
|
|
76
|
-
: Promise.reject(new Error(this.failedLoginErrorLabel));
|
|
72
|
+
return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error(this.failedLoginErrorLabel));
|
|
77
73
|
}
|
|
78
74
|
async getSessionId() {
|
|
79
75
|
if (this.sessionId) {
|
|
@@ -85,15 +81,14 @@ export class GatacaQR {
|
|
|
85
81
|
return this.sessionId;
|
|
86
82
|
}
|
|
87
83
|
getLink() {
|
|
88
|
-
if (this.v ===
|
|
84
|
+
if (this.v === '2') {
|
|
89
85
|
return this.authenticationRequest;
|
|
90
86
|
}
|
|
91
|
-
const authRequestEncoded =
|
|
87
|
+
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
92
88
|
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
93
89
|
}
|
|
94
90
|
async poll() {
|
|
95
|
-
let endTime = new Date().getTime() +
|
|
96
|
-
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
91
|
+
let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
97
92
|
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
98
93
|
let checkFunc = async (component) => {
|
|
99
94
|
if (component.result === RESULT_STATUS.NOT_STARTED) {
|
|
@@ -142,40 +137,35 @@ export class GatacaQR {
|
|
|
142
137
|
case RESULT_STATUS.READ:
|
|
143
138
|
return this.renderReadQR({
|
|
144
139
|
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
145
|
-
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
140
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
146
141
|
});
|
|
147
142
|
}
|
|
148
143
|
}
|
|
149
144
|
renderSuccess() {
|
|
150
|
-
return
|
|
145
|
+
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
|
|
151
146
|
}
|
|
152
147
|
renderRetryButton(errorMessage) {
|
|
153
148
|
return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
154
149
|
}
|
|
155
150
|
renderReadQR(readQrMessages) {
|
|
156
|
-
return
|
|
151
|
+
return h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) });
|
|
157
152
|
}
|
|
158
|
-
renderQR(value, useLogo) {
|
|
159
|
-
return
|
|
153
|
+
renderQR(value, useLogo, sizeQR) {
|
|
154
|
+
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
160
155
|
}
|
|
161
156
|
renderRetryQR(value, useLogo) {
|
|
162
|
-
return
|
|
157
|
+
return h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0, qrType: this.qrType, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
163
158
|
}
|
|
164
159
|
render() {
|
|
165
160
|
var _a, _b;
|
|
166
|
-
return (h("div", { class: "popUpContainer" }, h("div", { class: `is-visible modal-window ${this.hideModalTexts ?
|
|
167
|
-
width: (this.modalWidth - 2).toString() +
|
|
168
|
-
height: this.modalHeight
|
|
169
|
-
? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + "px"
|
|
170
|
-
: "",
|
|
161
|
+
return (h("div", { class: "popUpContainer" }, h("div", { class: `is-visible modal-window ${this.hideModalTexts ? '' : 'large-modal'} ${this.hideModalBoxShadow ? 'noBoxShadow' : ''}`, style: {
|
|
162
|
+
width: (this.modalWidth - 2).toString() + 'px',
|
|
163
|
+
height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
171
164
|
}, onClick: (event) => {
|
|
172
165
|
event.stopPropagation();
|
|
173
|
-
} }, h("div", { class: "modal-window__content" }, h("div", { class: `qrTitleContainer ${this.hideModalTexts ?
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
height: this.modalWidth
|
|
177
|
-
? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + "px"
|
|
178
|
-
: "",
|
|
166
|
+
} }, h("div", { class: "modal-window__content" }, h("div", { class: `qrTitleContainer ${this.hideModalTexts ? 'hidenText' : ''}` }, h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || '#1e1e20' } }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand modalText" }, this.byBrandLabel, ' ', h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS && !this.hideQrModalDescription && h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), h("div", { class: "qrSection", style: {
|
|
167
|
+
width: this.modalWidth.toString() + 'px',
|
|
168
|
+
height: this.modalWidth ? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + 'px' : ''
|
|
179
169
|
} }, this.renderQRSection())))));
|
|
180
170
|
}
|
|
181
171
|
static get is() { return "gataca-qr"; }
|
|
@@ -196,7 +186,7 @@ export class GatacaQR {
|
|
|
196
186
|
"type": "unknown",
|
|
197
187
|
"mutable": false,
|
|
198
188
|
"complexType": {
|
|
199
|
-
"original": "(
|
|
189
|
+
"original": "(id?: string) => Promise<{result: RESULT_STATUS; data?: any}>",
|
|
200
190
|
"resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
|
|
201
191
|
"references": {
|
|
202
192
|
"Promise": {
|
|
@@ -220,7 +210,7 @@ export class GatacaQR {
|
|
|
220
210
|
"type": "unknown",
|
|
221
211
|
"mutable": false,
|
|
222
212
|
"complexType": {
|
|
223
|
-
"original": "() => Promise<{\n
|
|
213
|
+
"original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
|
|
224
214
|
"resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
|
|
225
215
|
"references": {
|
|
226
216
|
"Promise": {
|
|
@@ -310,7 +300,7 @@ export class GatacaQR {
|
|
|
310
300
|
},
|
|
311
301
|
"attribute": "qr-type",
|
|
312
302
|
"reflect": false,
|
|
313
|
-
"defaultValue": "
|
|
303
|
+
"defaultValue": "'svg'"
|
|
314
304
|
},
|
|
315
305
|
"callbackServer": {
|
|
316
306
|
"type": "string",
|
|
@@ -381,7 +371,7 @@ export class GatacaQR {
|
|
|
381
371
|
},
|
|
382
372
|
"attribute": "v",
|
|
383
373
|
"reflect": false,
|
|
384
|
-
"defaultValue": "
|
|
374
|
+
"defaultValue": "'3'"
|
|
385
375
|
},
|
|
386
376
|
"qrModalTitle": {
|
|
387
377
|
"type": "string",
|
|
@@ -399,7 +389,7 @@ export class GatacaQR {
|
|
|
399
389
|
},
|
|
400
390
|
"attribute": "qr-modal-title",
|
|
401
391
|
"reflect": false,
|
|
402
|
-
"defaultValue": "
|
|
392
|
+
"defaultValue": "'Quick Access'"
|
|
403
393
|
},
|
|
404
394
|
"modalTitleColor": {
|
|
405
395
|
"type": "string",
|
|
@@ -417,7 +407,7 @@ export class GatacaQR {
|
|
|
417
407
|
},
|
|
418
408
|
"attribute": "modal-title-color",
|
|
419
409
|
"reflect": false,
|
|
420
|
-
"defaultValue": "
|
|
410
|
+
"defaultValue": "'#4745B7'"
|
|
421
411
|
},
|
|
422
412
|
"qrModalDescription": {
|
|
423
413
|
"type": "string",
|
|
@@ -435,7 +425,7 @@ export class GatacaQR {
|
|
|
435
425
|
},
|
|
436
426
|
"attribute": "qr-modal-description",
|
|
437
427
|
"reflect": false,
|
|
438
|
-
"defaultValue": "
|
|
428
|
+
"defaultValue": "'Sign up or sign in by scanning the QR Code with the Gataca Wallet'"
|
|
439
429
|
},
|
|
440
430
|
"hideModalTexts": {
|
|
441
431
|
"type": "boolean",
|
|
@@ -596,7 +586,7 @@ export class GatacaQR {
|
|
|
596
586
|
},
|
|
597
587
|
"attribute": "qr-code-expired-label",
|
|
598
588
|
"reflect": false,
|
|
599
|
-
"defaultValue": "
|
|
589
|
+
"defaultValue": "'QR Code expired'"
|
|
600
590
|
},
|
|
601
591
|
"credentialsNotValidatedLabel": {
|
|
602
592
|
"type": "string",
|
|
@@ -614,7 +604,7 @@ export class GatacaQR {
|
|
|
614
604
|
},
|
|
615
605
|
"attribute": "credentials-not-validated-label",
|
|
616
606
|
"reflect": false,
|
|
617
|
-
"defaultValue": "
|
|
607
|
+
"defaultValue": "'User credentials not validated'"
|
|
618
608
|
},
|
|
619
609
|
"clickInsideBoxLabel": {
|
|
620
610
|
"type": "string",
|
|
@@ -632,7 +622,7 @@ export class GatacaQR {
|
|
|
632
622
|
},
|
|
633
623
|
"attribute": "click-inside-box-label",
|
|
634
624
|
"reflect": false,
|
|
635
|
-
"defaultValue": "
|
|
625
|
+
"defaultValue": "'Click inside the box to'"
|
|
636
626
|
},
|
|
637
627
|
"refreshQrLabel": {
|
|
638
628
|
"type": "string",
|
|
@@ -650,7 +640,7 @@ export class GatacaQR {
|
|
|
650
640
|
},
|
|
651
641
|
"attribute": "refresh-qr-label",
|
|
652
642
|
"reflect": false,
|
|
653
|
-
"defaultValue": "
|
|
643
|
+
"defaultValue": "'Refresh QR Code'"
|
|
654
644
|
},
|
|
655
645
|
"scanQrLabel": {
|
|
656
646
|
"type": "string",
|
|
@@ -668,7 +658,7 @@ export class GatacaQR {
|
|
|
668
658
|
},
|
|
669
659
|
"attribute": "scan-qr-label",
|
|
670
660
|
"reflect": false,
|
|
671
|
-
"defaultValue": "
|
|
661
|
+
"defaultValue": "'Scan QR Code'"
|
|
672
662
|
},
|
|
673
663
|
"userNotScanInTimeErrorLabel": {
|
|
674
664
|
"type": "string",
|
|
@@ -686,7 +676,7 @@ export class GatacaQR {
|
|
|
686
676
|
},
|
|
687
677
|
"attribute": "user-not-scan-in-time-error-label",
|
|
688
678
|
"reflect": false,
|
|
689
|
-
"defaultValue": "
|
|
679
|
+
"defaultValue": "'User did not scan the QR in the allowed time'"
|
|
690
680
|
},
|
|
691
681
|
"credsNotValidatedErrorLabel": {
|
|
692
682
|
"type": "string",
|
|
@@ -722,7 +712,7 @@ export class GatacaQR {
|
|
|
722
712
|
},
|
|
723
713
|
"attribute": "failed-login-error-label",
|
|
724
714
|
"reflect": false,
|
|
725
|
-
"defaultValue": "
|
|
715
|
+
"defaultValue": "'No successful login'"
|
|
726
716
|
},
|
|
727
717
|
"successLoginLabel": {
|
|
728
718
|
"type": "string",
|
|
@@ -740,7 +730,7 @@ export class GatacaQR {
|
|
|
740
730
|
},
|
|
741
731
|
"attribute": "success-login-label",
|
|
742
732
|
"reflect": false,
|
|
743
|
-
"defaultValue": "
|
|
733
|
+
"defaultValue": "'Successful Connection!'"
|
|
744
734
|
},
|
|
745
735
|
"byBrandLabel": {
|
|
746
736
|
"type": "string",
|
|
@@ -758,7 +748,7 @@ export class GatacaQR {
|
|
|
758
748
|
},
|
|
759
749
|
"attribute": "by-brand-label",
|
|
760
750
|
"reflect": false,
|
|
761
|
-
"defaultValue": "
|
|
751
|
+
"defaultValue": "'by Gataca'"
|
|
762
752
|
},
|
|
763
753
|
"waitingStartSessionLabel": {
|
|
764
754
|
"type": "string",
|
|
@@ -776,7 +766,7 @@ export class GatacaQR {
|
|
|
776
766
|
},
|
|
777
767
|
"attribute": "waiting-start-session-label",
|
|
778
768
|
"reflect": false,
|
|
779
|
-
"defaultValue": "
|
|
769
|
+
"defaultValue": "'waiting to start a session'"
|
|
780
770
|
},
|
|
781
771
|
"readQrTitle": {
|
|
782
772
|
"type": "string",
|
|
@@ -794,7 +784,7 @@ export class GatacaQR {
|
|
|
794
784
|
},
|
|
795
785
|
"attribute": "read-qr-title",
|
|
796
786
|
"reflect": false,
|
|
797
|
-
"defaultValue": "
|
|
787
|
+
"defaultValue": "'Processing...'"
|
|
798
788
|
},
|
|
799
789
|
"readQrDescription": {
|
|
800
790
|
"type": "string",
|
|
@@ -812,7 +802,7 @@ export class GatacaQR {
|
|
|
812
802
|
},
|
|
813
803
|
"attribute": "read-qr-description",
|
|
814
804
|
"reflect": false,
|
|
815
|
-
"defaultValue": "
|
|
805
|
+
"defaultValue": "'Please wait a moment'"
|
|
816
806
|
},
|
|
817
807
|
"hideQrModalDescription": {
|
|
818
808
|
"type": "boolean",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import QRCodeStyling from
|
|
3
|
-
import logoGataca from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import QRCodeStyling from 'qr-code-styling';
|
|
3
|
+
import logoGataca from '../../assets/images/logo_gataca.svg';
|
|
4
4
|
export class GatacaQRDisplay {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.qrData = undefined;
|
|
7
|
-
this.qrType =
|
|
7
|
+
this.qrType = 'svg';
|
|
8
8
|
this.size = 256;
|
|
9
9
|
this.logoSize = 0;
|
|
10
10
|
this.logoSrc = undefined;
|
|
11
|
-
this.qrColor =
|
|
11
|
+
this.qrColor = '#1E1E20';
|
|
12
12
|
this.rounded = true;
|
|
13
13
|
}
|
|
14
14
|
componentDidLoad() {
|
|
@@ -21,18 +21,18 @@ export class GatacaQRDisplay {
|
|
|
21
21
|
type: this.qrType,
|
|
22
22
|
dotsOptions: {
|
|
23
23
|
color: this.qrColor,
|
|
24
|
-
type: this.rounded ?
|
|
24
|
+
type: this.rounded ? 'dots' : 'square'
|
|
25
25
|
},
|
|
26
26
|
cornersSquareOptions: {
|
|
27
|
-
type: this.rounded ?
|
|
27
|
+
type: this.rounded ? 'extra-rounded' : 'square'
|
|
28
28
|
},
|
|
29
29
|
cornersDotOptions: {
|
|
30
|
-
type: this.rounded ?
|
|
30
|
+
type: this.rounded ? 'dot' : 'square'
|
|
31
31
|
},
|
|
32
32
|
imageOptions: {
|
|
33
33
|
margin: 2,
|
|
34
|
-
imageSize: this.logoSize
|
|
35
|
-
}
|
|
34
|
+
imageSize: this.logoSize
|
|
35
|
+
}
|
|
36
36
|
});
|
|
37
37
|
qrCode.append(this.qr);
|
|
38
38
|
}
|
|
@@ -82,7 +82,7 @@ export class GatacaQRDisplay {
|
|
|
82
82
|
},
|
|
83
83
|
"attribute": "qr-type",
|
|
84
84
|
"reflect": false,
|
|
85
|
-
"defaultValue": "
|
|
85
|
+
"defaultValue": "'svg'"
|
|
86
86
|
},
|
|
87
87
|
"size": {
|
|
88
88
|
"type": "number",
|
|
@@ -153,7 +153,7 @@ export class GatacaQRDisplay {
|
|
|
153
153
|
},
|
|
154
154
|
"attribute": "qr-color",
|
|
155
155
|
"reflect": false,
|
|
156
|
-
"defaultValue": "
|
|
156
|
+
"defaultValue": "'#1E1E20'"
|
|
157
157
|
},
|
|
158
158
|
"rounded": {
|
|
159
159
|
"type": "boolean",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export const QR = (props) => {
|
|
3
3
|
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
4
|
-
return
|
|
4
|
+
return h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
5
5
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import { AnimatedLoader } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { AnimatedLoader } from './components/AnimatedLoader';
|
|
3
3
|
export const ReadQR = (props) => {
|
|
4
4
|
var _a;
|
|
5
5
|
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
6
6
|
return (h("div", { class: "blured", style: {
|
|
7
|
-
width: (modalWidth - 48).toString() +
|
|
8
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
7
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
8
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
9
9
|
} }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
10
10
|
readQrMessages.title, " "), h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)), h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
11
11
|
};
|
package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export const AnimatedLoader = () => {
|
|
3
3
|
return (h("div", { class: "containerLoader" }, h("div", { class: "loader" }, h("div", { class: "loader__item loader__item__1" }), h("div", { class: "loader__item loader__item__2" }), h("div", { class: "loader__item loader__item__3" }), h("div", { class: "loader__item loader__item__4" }), h("div", { class: "loader__item loader__item__5" }), h("div", { class: "loader__item loader__item__6" }), h("div", { class: "loader__item loader__item__7" }), h("div", { class: "loader__item loader__item__8" }))));
|
|
4
4
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import refreshIcon from
|
|
3
|
-
import alertIcon from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import refreshIcon from '../../../../assets/icons/gat-icon-refresh.svg';
|
|
3
|
+
import alertIcon from '../../../../assets/icons/gat-icon-alert.svg';
|
|
4
4
|
export const RetryButton = (props) => {
|
|
5
5
|
var _a;
|
|
6
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR
|
|
6
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR } = props;
|
|
7
7
|
return (h("div", { class: "reload", style: {
|
|
8
|
-
width: (modalWidth - 48).toString() +
|
|
9
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
10
|
-
} }, h("div", { id: "notify", onClick: () => display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "notify-text" }, clickInsideBoxLabel, " "), errorMessage ?
|
|
11
|
-
width: (modalWidth - 48).toString() +
|
|
8
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
9
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
10
|
+
} }, h("div", { id: "notify", onClick: () => display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "notify-text" }, clickInsideBoxLabel, " "), errorMessage ? h("p", { class: "notify-text bold" }, refreshQrLabel) : h("p", { class: "notify-text bold" }, scanQrLabel), errorMessage && (h("div", { class: "alert", style: {
|
|
11
|
+
width: (modalWidth - 48).toString() + 'px'
|
|
12
12
|
} }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
|
|
13
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import successIcon from
|
|
2
|
-
import { h } from
|
|
1
|
+
import successIcon from '../../../../assets/icons/gat-icon-check.svg';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
3
|
export const Success = (props) => {
|
|
4
4
|
const { modalHeight, successLoginLabel } = props;
|
|
5
|
-
return (h("div", { class:
|
|
6
|
-
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) +
|
|
5
|
+
return (h("div", { class: 'success', style: {
|
|
6
|
+
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + 'px' : '300px'
|
|
7
7
|
} }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, successLoginLabel)));
|
|
8
8
|
};
|