@saooti/octopus-sdk 40.2.2-SNAPSHOT → 40.2.3-SNAPSHOT

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "40.2.2-SNAPSHOT",
3
+ "version": "40.2.3-SNAPSHOT",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -15,7 +15,7 @@
15
15
  :data-color="color"
16
16
  />
17
17
  </div>
18
- <qrcode-vue
18
+ <qrcode-svg
19
19
  :value="url"
20
20
  :size="size"
21
21
  level="H"
@@ -34,7 +34,7 @@
34
34
  import { VSwatches } from "vue3-swatches";
35
35
  import "vue3-swatches/dist/style.css";
36
36
  import SnackBar from "../../misc/SnackBar.vue";
37
- import QrcodeVue from "qrcode.vue";
37
+ import { QrcodeSvg } from "qrcode.vue";
38
38
  import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
39
39
  import { mapActions } from "pinia";
40
40
  import { defineComponent } from "vue";
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
 
44
44
  components: {
45
45
  SnackBar,
46
- QrcodeVue,
46
+ QrcodeSvg,
47
47
  VSwatches,
48
48
  },
49
49
  props: {
@@ -62,12 +62,15 @@ export default defineComponent({
62
62
  methods: {
63
63
  ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
64
64
  download(): void {
65
- const link = document.createElement("a");
66
- link.download = "qrcode.png";
67
65
  const canvas = document.getElementsByClassName("myQrCode");
68
66
  if (canvas && canvas.length > 0 && canvas[0]) {
69
- link.href = (canvas[0] as HTMLCanvasElement).toDataURL();
70
- link.click();
67
+ var svgData = canvas[0].outerHTML;
68
+ var svgBlob = new Blob([svgData], {type:"image/svg+xml;charset=utf-8"});
69
+ var svgUrl = URL.createObjectURL(svgBlob);
70
+ var downloadLink = document.createElement("a");
71
+ downloadLink.href = svgUrl;
72
+ downloadLink.download = "qrcode.svg";
73
+ downloadLink.click();
71
74
  (this.$refs.snackbar as InstanceType<typeof SnackBar>).open(
72
75
  this.$t("Download started"),
73
76
  );