grantthomas-nuxt 1.0.5 → 1.0.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grantthomas/nuxt",
3
3
  "configKey": "grantThomasNuxt",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -9,12 +9,15 @@ const props = defineProps({
9
9
  },
10
10
  aspectRatio: {
11
11
  type: String,
12
- default: "1:1"
12
+ default: null
13
13
  }
14
14
  });
15
15
  const emit = defineEmits(["crop", "cancel"]);
16
16
  const cropper = ref(null);
17
17
  const parsedAspectRatio = computed(() => {
18
+ if (!props.aspectRatio) {
19
+ return void 0;
20
+ }
18
21
  const parts = props.aspectRatio.split(":");
19
22
  if (parts.length === 2) {
20
23
  const width = parseFloat(parts[0]);
@@ -23,7 +26,14 @@ const parsedAspectRatio = computed(() => {
23
26
  return width / height;
24
27
  }
25
28
  }
26
- return 1;
29
+ return void 0;
30
+ });
31
+ const stencilProps = computed(() => {
32
+ const props2 = {};
33
+ if (parsedAspectRatio.value !== void 0) {
34
+ props2.aspectRatio = parsedAspectRatio.value;
35
+ }
36
+ return props2;
27
37
  });
28
38
  const crop = () => {
29
39
  if (cropper.value) {
@@ -51,9 +61,7 @@ const cancel = () => {
51
61
  <Cropper
52
62
  ref="cropper"
53
63
  :src="imageUrl"
54
- :stencil-props="{
55
- aspectRatio: parsedAspectRatio
56
- }"
64
+ :stencil-props="stencilProps"
57
65
  class="cropper"
58
66
  />
59
67
  </div>
@@ -55,7 +55,7 @@ const props = defineProps({
55
55
  },
56
56
  aspectRatio: {
57
57
  type: String,
58
- default: "1:1"
58
+ default: null
59
59
  }
60
60
  });
61
61
  const model = defineModel();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grantthomas-nuxt",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Crud module for Nuxt 3 interacting with sibling .net project",
5
5
  "repository": "Tap-Leagues/GrantThomas.Nuxt",
6
6
  "license": "MIT",