@ozdao/prometheus-framework 0.2.235 → 0.2.236
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +51 -6
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +52 -7
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +16 -16
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +449 -422
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +449 -422
- package/package.json +1 -1
- package/src/modules/events/components/elements/ButtonCheck.vue +66 -10
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs
CHANGED
@@ -5,10 +5,18 @@ const index = require("../../../../../../node_modules/@capacitor-mlkit/barcode-s
|
|
5
5
|
const Button = require("../../../../components/Button/Button.vue2.cjs");
|
6
6
|
const tickets = require("../../store/tickets.cjs");
|
7
7
|
;/* empty css */
|
8
|
+
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");
|
9
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-7a4f2d02"), n = n(), vue.popScopeId(), n);
|
8
10
|
const _hoisted_1 = {
|
9
11
|
key: 0,
|
10
12
|
class: "barcode-scanner-modal"
|
11
13
|
};
|
14
|
+
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "square" }, null, -1));
|
15
|
+
const _hoisted_3 = {
|
16
|
+
key: 0,
|
17
|
+
class: "zoom-ratio-wrapper"
|
18
|
+
};
|
19
|
+
const _hoisted_4 = ["min", "max"];
|
12
20
|
const _sfc_main = {
|
13
21
|
__name: "ButtonCheck",
|
14
22
|
emits: ["qrcodecheck"],
|
@@ -16,18 +24,22 @@ const _sfc_main = {
|
|
16
24
|
const emits = __emit;
|
17
25
|
const error = vue.ref("");
|
18
26
|
const isScanning = vue.ref(false);
|
27
|
+
const isTorchAvailable = vue.ref(false);
|
28
|
+
const minZoomRatio = vue.ref(void 0);
|
29
|
+
const maxZoomRatio = vue.ref(void 0);
|
19
30
|
vue.onMounted(async () => {
|
20
31
|
const { supported } = await index.BarcodeScanner.isSupported();
|
21
32
|
if (!supported) {
|
22
33
|
error.value = "Barcode scanning is not supported on this device";
|
23
34
|
}
|
35
|
+
const { available } = await index.BarcodeScanner.isTorchAvailable();
|
36
|
+
isTorchAvailable.value = available;
|
24
37
|
});
|
25
38
|
vue.onUnmounted(async () => {
|
26
|
-
await
|
39
|
+
await stopScan();
|
27
40
|
});
|
28
41
|
async function startScan() {
|
29
42
|
var _a, _b;
|
30
|
-
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
31
43
|
try {
|
32
44
|
const { camera } = await index.BarcodeScanner.checkPermissions();
|
33
45
|
if (camera !== "granted") {
|
@@ -36,21 +48,27 @@ const _sfc_main = {
|
|
36
48
|
throw new Error("Camera permission is required to scan barcodes");
|
37
49
|
}
|
38
50
|
}
|
39
|
-
(
|
51
|
+
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
52
|
+
(_b = document.querySelector("html")) == null ? void 0 : _b.classList.add("barcode-scanner-active-html");
|
40
53
|
isScanning.value = true;
|
41
54
|
await index.BarcodeScanner.addListener("barcodeScanned", async (result) => {
|
42
55
|
await processBarcode(result.barcode);
|
43
56
|
});
|
44
57
|
await index.BarcodeScanner.startScan();
|
58
|
+
const { zoomRatio: min } = await index.BarcodeScanner.getMinZoomRatio();
|
59
|
+
const { zoomRatio: max } = await index.BarcodeScanner.getMaxZoomRatio();
|
60
|
+
minZoomRatio.value = min;
|
61
|
+
maxZoomRatio.value = max;
|
45
62
|
} catch (e) {
|
46
63
|
error.value = e.message;
|
47
64
|
alert(`Error: ${error.value}`);
|
48
65
|
}
|
49
66
|
}
|
50
67
|
async function stopScan() {
|
51
|
-
var _a;
|
68
|
+
var _a, _b;
|
52
69
|
try {
|
53
70
|
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.remove("barcode-scanner-active");
|
71
|
+
(_b = document.querySelector("html")) == null ? void 0 : _b.classList.remove("barcode-scanner-active-html");
|
54
72
|
isScanning.value = false;
|
55
73
|
await index.BarcodeScanner.stopScan();
|
56
74
|
await index.BarcodeScanner.removeAllListeners();
|
@@ -73,6 +91,13 @@ const _sfc_main = {
|
|
73
91
|
await stopScan();
|
74
92
|
}
|
75
93
|
}
|
94
|
+
async function setZoomRatio(event) {
|
95
|
+
const zoomRatio = parseFloat(event.target.value);
|
96
|
+
await index.BarcodeScanner.setZoomRatio({ zoomRatio });
|
97
|
+
}
|
98
|
+
async function toggleTorch() {
|
99
|
+
await index.BarcodeScanner.toggleTorch();
|
100
|
+
}
|
76
101
|
return (_ctx, _cache) => {
|
77
102
|
return vue.openBlock(), vue.createElementBlock("div", null, [
|
78
103
|
vue.createVNode(Button.default, {
|
@@ -85,6 +110,15 @@ const _sfc_main = {
|
|
85
110
|
_: 1
|
86
111
|
}),
|
87
112
|
isScanning.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
113
|
+
_hoisted_2,
|
114
|
+
minZoomRatio.value !== void 0 && maxZoomRatio.value !== void 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
115
|
+
vue.createElementVNode("input", {
|
116
|
+
type: "range",
|
117
|
+
min: minZoomRatio.value,
|
118
|
+
max: maxZoomRatio.value,
|
119
|
+
onInput: setZoomRatio
|
120
|
+
}, null, 40, _hoisted_4)
|
121
|
+
])) : vue.createCommentVNode("", true),
|
88
122
|
vue.createVNode(Button.default, {
|
89
123
|
onClick: stopScan,
|
90
124
|
class: "stop-scan-button"
|
@@ -93,11 +127,22 @@ const _sfc_main = {
|
|
93
127
|
vue.createTextVNode("Stop Scan")
|
94
128
|
]),
|
95
129
|
_: 1
|
96
|
-
})
|
130
|
+
}),
|
131
|
+
isTorchAvailable.value ? (vue.openBlock(), vue.createBlock(Button.default, {
|
132
|
+
key: 1,
|
133
|
+
onClick: toggleTorch,
|
134
|
+
class: "torch-button"
|
135
|
+
}, {
|
136
|
+
default: vue.withCtx(() => [
|
137
|
+
vue.createTextVNode(" Toggle Torch ")
|
138
|
+
]),
|
139
|
+
_: 1
|
140
|
+
})) : vue.createCommentVNode("", true)
|
97
141
|
])) : vue.createCommentVNode("", true)
|
98
142
|
]);
|
99
143
|
};
|
100
144
|
}
|
101
145
|
};
|
102
|
-
|
146
|
+
const ButtonCheck = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-7a4f2d02"]]);
|
147
|
+
exports.default = ButtonCheck;
|
103
148
|
//# sourceMappingURL=ButtonCheck.vue.cjs.map
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n try {\n if (!barcode) {\n throw new Error('Troubles with barcode reading')\n }\n const response = await tickets.actions.update({ _id: barcode, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n } catch (e) {\n alert(`Ticket is not found, already used or deactivated!`)\n } finally {\n emits('qrcodecheck')\n await stopScan()\n }\n}\n\nasync function setZoomRatio(event) {\n const zoomRatio = parseFloat(event.target.value)\n await BarcodeScanner.setZoomRatio({ zoomRatio })\n}\n\nasync function toggleTorch() {\n await BarcodeScanner.toggleTorch()\n}\n</script>\n\n<style scoped>\n.barcode-scanner-modal {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.square {\n width: 200px;\n height: 200px;\n border: 2px solid white;\n border-radius: 10px;\n}\n\n.zoom-ratio-wrapper {\n width: 80%;\n margin-top: 20px;\n}\n\n.stop-scan-button,\n.torch-button {\n margin-top: 20px;\n}\n\n/* Existing styles */\nbody.barcode-scanner-active {\n --background: transparent;\n --ion-background-color: transparent;\n}\n\nhtml.barcode-scanner-active-html {\n background: transparent !important;\n}\n\n@media (prefers-color-scheme: dark) {\n .barcode-scanner-modal {\n --background: transparent;\n --ion-background-color: transparent;\n }\n}\n</style>\n"],"names":["ref","onMounted","BarcodeScanner","onUnmounted","tickets.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAM,QAAQ;AACd,UAAM,QAAQA,IAAG,IAAC,EAAE;AACpB,UAAM,aAAaA,IAAG,IAAC,KAAK;AAC5B,UAAM,mBAAmBA,IAAG,IAAC,KAAK;AAClC,UAAM,eAAeA,IAAG,IAAC,MAAS;AAClC,UAAM,eAAeA,IAAG,IAAC,MAAS;AAElCC,QAAAA,UAAU,YAAY;AACpB,YAAM,EAAE,UAAS,IAAK,MAAMC,MAAAA,eAAe,YAAa;AACxD,UAAI,CAAC,WAAW;AACd,cAAM,QAAQ;AAAA,MACf;AACD,YAAM,EAA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cAAM,wBAAwB,MAAM,KAAK,EAAE;AAAA,MAC5C;AAAA,IACH;AAEA,mBAAe,eAAe,SAAS;AACrC,UAAI;AACF,YAAI,CAAC,SAAS;AACZ,gBAAM,IAAI,MAAM,+BAA+B;AAAA,QAChD;AACD,cAAM,WAAW,MAAME,gBAAgB,OAAO,EAAE,KAAK,SAAS,QAAQ,QAAQ,OAAO,KAAI,CAAE;AAC3F,cAAM,qCAAqC;AAAA,MAC5C,SAAQ,GAAG;AACV,cAAM,mDAAmD;AAAA,MAC7D,UAAY;AACR,cAAM,aAAa;AACnB,cAAM,SAAU;AAAA,MACjB;AAAA,IACH;AAEA,mBAAe,aAAa,OAAO;AACjC,YAAM,YAAY,WAAW,MAAM,OAAO,KAAK;AAC/C,YAAMF,qBAAe,aAAa,EAAE,WAAW;AAAA,IACjD;AAEA,mBAAe,cAAc;AAC3B,YAAMA,MAAAA,eAAe,YAAa;AAAA,IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,12 +1,20 @@
|
|
1
|
-
import { ref, onMounted, onUnmounted, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, createCommentVNode } from "vue";
|
1
|
+
import { ref, onMounted, onUnmounted, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, createElementVNode, createCommentVNode, createBlock, pushScopeId, popScopeId } from "vue";
|
2
2
|
import { BarcodeScanner } from "../../../../../../node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/index.js";
|
3
3
|
import _sfc_main$1 from "../../../../components/Button/Button.vue2.js";
|
4
4
|
import { actions } from "../../store/tickets.js";
|
5
5
|
/* empty css */
|
6
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-7a4f2d02"), n = n(), popScopeId(), n);
|
6
8
|
const _hoisted_1 = {
|
7
9
|
key: 0,
|
8
10
|
class: "barcode-scanner-modal"
|
9
11
|
};
|
12
|
+
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "square" }, null, -1));
|
13
|
+
const _hoisted_3 = {
|
14
|
+
key: 0,
|
15
|
+
class: "zoom-ratio-wrapper"
|
16
|
+
};
|
17
|
+
const _hoisted_4 = ["min", "max"];
|
10
18
|
const _sfc_main = {
|
11
19
|
__name: "ButtonCheck",
|
12
20
|
emits: ["qrcodecheck"],
|
@@ -14,18 +22,22 @@ const _sfc_main = {
|
|
14
22
|
const emits = __emit;
|
15
23
|
const error = ref("");
|
16
24
|
const isScanning = ref(false);
|
25
|
+
const isTorchAvailable = ref(false);
|
26
|
+
const minZoomRatio = ref(void 0);
|
27
|
+
const maxZoomRatio = ref(void 0);
|
17
28
|
onMounted(async () => {
|
18
29
|
const { supported } = await BarcodeScanner.isSupported();
|
19
30
|
if (!supported) {
|
20
31
|
error.value = "Barcode scanning is not supported on this device";
|
21
32
|
}
|
33
|
+
const { available } = await BarcodeScanner.isTorchAvailable();
|
34
|
+
isTorchAvailable.value = available;
|
22
35
|
});
|
23
36
|
onUnmounted(async () => {
|
24
|
-
await
|
37
|
+
await stopScan();
|
25
38
|
});
|
26
39
|
async function startScan() {
|
27
40
|
var _a, _b;
|
28
|
-
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
29
41
|
try {
|
30
42
|
const { camera } = await BarcodeScanner.checkPermissions();
|
31
43
|
if (camera !== "granted") {
|
@@ -34,21 +46,27 @@ const _sfc_main = {
|
|
34
46
|
throw new Error("Camera permission is required to scan barcodes");
|
35
47
|
}
|
36
48
|
}
|
37
|
-
(
|
49
|
+
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
50
|
+
(_b = document.querySelector("html")) == null ? void 0 : _b.classList.add("barcode-scanner-active-html");
|
38
51
|
isScanning.value = true;
|
39
52
|
await BarcodeScanner.addListener("barcodeScanned", async (result) => {
|
40
53
|
await processBarcode(result.barcode);
|
41
54
|
});
|
42
55
|
await BarcodeScanner.startScan();
|
56
|
+
const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio();
|
57
|
+
const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio();
|
58
|
+
minZoomRatio.value = min;
|
59
|
+
maxZoomRatio.value = max;
|
43
60
|
} catch (e) {
|
44
61
|
error.value = e.message;
|
45
62
|
alert(`Error: ${error.value}`);
|
46
63
|
}
|
47
64
|
}
|
48
65
|
async function stopScan() {
|
49
|
-
var _a;
|
66
|
+
var _a, _b;
|
50
67
|
try {
|
51
68
|
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.remove("barcode-scanner-active");
|
69
|
+
(_b = document.querySelector("html")) == null ? void 0 : _b.classList.remove("barcode-scanner-active-html");
|
52
70
|
isScanning.value = false;
|
53
71
|
await BarcodeScanner.stopScan();
|
54
72
|
await BarcodeScanner.removeAllListeners();
|
@@ -71,6 +89,13 @@ const _sfc_main = {
|
|
71
89
|
await stopScan();
|
72
90
|
}
|
73
91
|
}
|
92
|
+
async function setZoomRatio(event) {
|
93
|
+
const zoomRatio = parseFloat(event.target.value);
|
94
|
+
await BarcodeScanner.setZoomRatio({ zoomRatio });
|
95
|
+
}
|
96
|
+
async function toggleTorch() {
|
97
|
+
await BarcodeScanner.toggleTorch();
|
98
|
+
}
|
74
99
|
return (_ctx, _cache) => {
|
75
100
|
return openBlock(), createElementBlock("div", null, [
|
76
101
|
createVNode(_sfc_main$1, {
|
@@ -83,6 +108,15 @@ const _sfc_main = {
|
|
83
108
|
_: 1
|
84
109
|
}),
|
85
110
|
isScanning.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
111
|
+
_hoisted_2,
|
112
|
+
minZoomRatio.value !== void 0 && maxZoomRatio.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
113
|
+
createElementVNode("input", {
|
114
|
+
type: "range",
|
115
|
+
min: minZoomRatio.value,
|
116
|
+
max: maxZoomRatio.value,
|
117
|
+
onInput: setZoomRatio
|
118
|
+
}, null, 40, _hoisted_4)
|
119
|
+
])) : createCommentVNode("", true),
|
86
120
|
createVNode(_sfc_main$1, {
|
87
121
|
onClick: stopScan,
|
88
122
|
class: "stop-scan-button"
|
@@ -91,13 +125,24 @@ const _sfc_main = {
|
|
91
125
|
createTextVNode("Stop Scan")
|
92
126
|
]),
|
93
127
|
_: 1
|
94
|
-
})
|
128
|
+
}),
|
129
|
+
isTorchAvailable.value ? (openBlock(), createBlock(_sfc_main$1, {
|
130
|
+
key: 1,
|
131
|
+
onClick: toggleTorch,
|
132
|
+
class: "torch-button"
|
133
|
+
}, {
|
134
|
+
default: withCtx(() => [
|
135
|
+
createTextVNode(" Toggle Torch ")
|
136
|
+
]),
|
137
|
+
_: 1
|
138
|
+
})) : createCommentVNode("", true)
|
95
139
|
])) : createCommentVNode("", true)
|
96
140
|
]);
|
97
141
|
};
|
98
142
|
}
|
99
143
|
};
|
144
|
+
const ButtonCheck = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7a4f2d02"]]);
|
100
145
|
export {
|
101
|
-
|
146
|
+
ButtonCheck as default
|
102
147
|
};
|
103
148
|
//# sourceMappingURL=ButtonCheck.vue.js.map
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n try {\n if (!barcode) {\n throw new Error('Troubles with barcode reading')\n }\n const response = await tickets.actions.update({ _id: barcode, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n } catch (e) {\n alert(`Ticket is not found, already used or deactivated!`)\n } finally {\n emits('qrcodecheck')\n await stopScan()\n }\n}\n\nasync function setZoomRatio(event) {\n const zoomRatio = parseFloat(event.target.value)\n await BarcodeScanner.setZoomRatio({ zoomRatio })\n}\n\nasync function toggleTorch() {\n await BarcodeScanner.toggleTorch()\n}\n</script>\n\n<style scoped>\n.barcode-scanner-modal {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.square {\n width: 200px;\n height: 200px;\n border: 2px solid white;\n border-radius: 10px;\n}\n\n.zoom-ratio-wrapper {\n width: 80%;\n margin-top: 20px;\n}\n\n.stop-scan-button,\n.torch-button {\n margin-top: 20px;\n}\n\n/* Existing styles */\nbody.barcode-scanner-active {\n --background: transparent;\n --ion-background-color: transparent;\n}\n\nhtml.barcode-scanner-active-html {\n background: transparent !important;\n}\n\n@media (prefers-color-scheme: dark) {\n .barcode-scanner-modal {\n --background: transparent;\n --ion-background-color: transparent;\n }\n}\n</style>\n"],"names":["tickets.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,UAAM,QAAQ;AACd,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,aAAa,IAAI,KAAK;AAC5B,UAAM,mBAAmB,IAAI,KAAK;AAClC,UAAM,eAAe,IAAI,MAAS;AAClC,UAAM,eAAe,IAA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BAAoB;AAAA,MAC1C,SAAQ,GAAG;AACV,cAAM,QAAQ,EAAE;AAChB,cAAM,wBAAwB,MAAM,KAAK,EAAE;AAAA,MAC5C;AAAA,IACH;AAEA,mBAAe,eAAe,SAAS;AACrC,UAAI;AACF,YAAI,CAAC,SAAS;AACZ,gBAAM,IAAI,MAAM,+BAA+B;AAAA,QAChD;AACD,cAAM,WAAW,MAAMA,QAAgB,OAAO,EAAE,KAAK,SAAS,QAAQ,QAAQ,OAAO,KAAI,CAAE;AAC3F,cAAM,qCAAqC;AAAA,MAC5C,SAAQ,GAAG;AACV,cAAM,mDAAmD;AAAA,MAC7D,UAAY;AACR,cAAM,aAAa;AACnB,cAAM,SAAU;AAAA,MACjB;AAAA,IACH;AAEA,mBAAe,aAAa,OAAO;AACjC,YAAM,YAAY,WAAW,MAAM,OAAO,KAAK;AAC/C,YAAM,eAAe,aAAa,EAAE,WAAW;AAAA,IACjD;AAEA,mBAAe,cAAc;AAC3B,YAAM,eAAe,YAAa;AAAA,IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { ref, onMounted, unref, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, createTextVNode, toDisplayString, createBlock, createCommentVNode } from "vue";
|
2
|
-
import _sfc_main$
|
3
|
-
import _sfc_main$
|
4
|
-
import _sfc_main$
|
2
|
+
import _sfc_main$6 from "../../../../components/Feed/Feed.vue.js";
|
3
|
+
import _sfc_main$2 from "../../../../components/Block/Block.vue.js";
|
4
|
+
import _sfc_main$1 from "../../../../components/Popup/Popup.vue.js";
|
5
5
|
import Field from "../../../../components/Field/Field.vue2.js";
|
6
|
-
import _sfc_main$
|
7
|
-
import
|
8
|
-
import _sfc_main$
|
9
|
-
import _sfc_main$
|
6
|
+
import _sfc_main$5 from "../../../../components/Button/Button.vue2.js";
|
7
|
+
import ButtonCheck from "../elements/ButtonCheck.vue.js";
|
8
|
+
import _sfc_main$4 from "../../../icons/navigation/IconDelete.vue.js";
|
9
|
+
import _sfc_main$3 from "../../../icons/navigation/IconAdd.vue.js";
|
10
10
|
import { useRoute, useRouter } from "vue-router";
|
11
11
|
import { read } from "../../store/events.js";
|
12
12
|
import { state } from "../../../auth/views/store/auth.js";
|
@@ -87,19 +87,19 @@ const _sfc_main = {
|
|
87
87
|
onClick: _cache[0] || (_cache[0] = ($event) => openTicketsPopup()),
|
88
88
|
class: "radius-extra uppercase button-small flex-child flex-child-shrink-0 hover-scale-1 cursor-pointer t-white bg-second"
|
89
89
|
}, " Add Tickets "),
|
90
|
-
createVNode(
|
90
|
+
createVNode(ButtonCheck, {
|
91
91
|
onQrcodecheck: _cache[1] || (_cache[1] = ($event) => fetchTickets.value = !fetchTickets.value),
|
92
92
|
class: "w-100 pd-medium mn-auto"
|
93
93
|
})
|
94
94
|
]),
|
95
|
-
createVNode(_sfc_main$
|
95
|
+
createVNode(_sfc_main$1, {
|
96
96
|
title: "Добавить участника",
|
97
97
|
onClosePopup: closeTicketsPopup,
|
98
98
|
isPopupOpen: isOpenTicketsPopup.value,
|
99
99
|
class: "w-max-40r"
|
100
100
|
}, {
|
101
101
|
default: withCtx(() => [
|
102
|
-
createVNode(_sfc_main$
|
102
|
+
createVNode(_sfc_main$2, {
|
103
103
|
title: "Add tickets",
|
104
104
|
placeholder: "No parameters added yet",
|
105
105
|
class: "cols-1 mn-b-thin gap-thin"
|
@@ -134,7 +134,7 @@ const _sfc_main = {
|
|
134
134
|
onClick: _cache[2] || (_cache[2] = () => newTickets.value.push({ name: "", value: "", target: unref(event)._id, type: "event", quantity: 1 })),
|
135
135
|
class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"
|
136
136
|
}, [
|
137
|
-
createVNode(_sfc_main$
|
137
|
+
createVNode(_sfc_main$3, {
|
138
138
|
class: "i-medium",
|
139
139
|
fill: "rgb(var(--white)"
|
140
140
|
})
|
@@ -143,14 +143,14 @@ const _sfc_main = {
|
|
143
143
|
onClick: () => newTickets.value.splice(index, 1),
|
144
144
|
class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"
|
145
145
|
}, [
|
146
|
-
createVNode(_sfc_main$
|
146
|
+
createVNode(_sfc_main$4, {
|
147
147
|
class: "i-medium",
|
148
148
|
fill: "rgb(var(--white)"
|
149
149
|
})
|
150
150
|
], 8, _hoisted_4))
|
151
151
|
]);
|
152
152
|
}), 128)),
|
153
|
-
createVNode(_sfc_main$
|
153
|
+
createVNode(_sfc_main$5, {
|
154
154
|
submit: onSubmit,
|
155
155
|
callback: closeTicketsPopup,
|
156
156
|
class: "w-100 bg-black t-white"
|
@@ -166,7 +166,7 @@ const _sfc_main = {
|
|
166
166
|
]),
|
167
167
|
_: 1
|
168
168
|
}, 8, ["isPopupOpen"]),
|
169
|
-
createVNode(_sfc_main$
|
169
|
+
createVNode(_sfc_main$6, {
|
170
170
|
search: true,
|
171
171
|
states: {
|
172
172
|
empty: {
|
@@ -204,7 +204,7 @@ const _sfc_main = {
|
|
204
204
|
createElementVNode("p", _hoisted_10, toDisplayString(((_b = ticket.client_refactor) == null ? void 0 : _b.email) || "No email"), 1),
|
205
205
|
createElementVNode("span", _hoisted_11, toDisplayString(ticket.status), 1)
|
206
206
|
]),
|
207
|
-
ticket.status !== "deactivated" ? (openBlock(), createBlock(_sfc_main$
|
207
|
+
ticket.status !== "deactivated" ? (openBlock(), createBlock(_sfc_main$5, {
|
208
208
|
key: 0,
|
209
209
|
submit: () => changeStatus(ticket, "deactivated"),
|
210
210
|
callback: _ctx.redirectTo,
|
@@ -215,7 +215,7 @@ const _sfc_main = {
|
|
215
215
|
]),
|
216
216
|
_: 2
|
217
217
|
}, 1032, ["submit", "callback"])) : createCommentVNode("", true),
|
218
|
-
ticket.status === "deactivated" || ticket.status === "used" ? (openBlock(), createBlock(_sfc_main$
|
218
|
+
ticket.status === "deactivated" || ticket.status === "used" ? (openBlock(), createBlock(_sfc_main$5, {
|
219
219
|
key: 1,
|
220
220
|
submit: () => changeStatus(ticket, "unused"),
|
221
221
|
callback: _ctx.redirectTo,
|