@dative-gpi/foundation-shared-components 1.0.58 → 1.0.59

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.
@@ -10,8 +10,7 @@
10
10
  <script lang="ts">
11
11
  import { computed, defineComponent, type PropType } from "vue";
12
12
 
13
- import { IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config/urls";
14
-
13
+ import { IMAGE_THUMBNAIL_URL, IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config/urls";
15
14
  import { useAppAuthToken, useImage } from "@dative-gpi/foundation-shared-services/composables";
16
15
 
17
16
  import FSImageUI from "./FSImageUI.vue";
@@ -26,6 +25,11 @@ export default defineComponent({
26
25
  type: String as PropType<string | null>,
27
26
  required: false,
28
27
  default: null
28
+ },
29
+ thumbnail: {
30
+ type: Boolean as PropType<boolean>,
31
+ required: false,
32
+ default: false
29
33
  }
30
34
  },
31
35
  setup(props) {
@@ -33,6 +37,9 @@ export default defineComponent({
33
37
  const { authToken } = useAppAuthToken();
34
38
 
35
39
  const source = computed(() => {
40
+ if (props.thumbnail) {
41
+ return props.imageId ? IMAGE_THUMBNAIL_URL(props.imageId, authToken.value) : null;
42
+ }
36
43
  return props.imageId ? IMAGE_RAW_URL(props.imageId, authToken.value) : null;
37
44
  });
38
45
 
@@ -42,9 +42,8 @@
42
42
  import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
43
43
  import { decode, isBlurhashValid } from "blurhash";
44
44
 
45
- import type { ImageDetails } from "@dative-gpi/foundation-shared-domain/models";
46
-
47
45
  import { sizeToVar, varToSize } from "@dative-gpi/foundation-shared-components/utils";
46
+ import { type ImageDetails } from "@dative-gpi/foundation-shared-domain/models";
48
47
 
49
48
  import FSLoader from "./FSLoader.vue";
50
49
 
@@ -64,6 +63,11 @@ export default defineComponent({
64
63
  required: false,
65
64
  default: null
66
65
  },
66
+ aspectRatio: {
67
+ type: Number as PropType<number | null>,
68
+ required: false,
69
+ default: 1
70
+ },
67
71
  imageB64: {
68
72
  type: String as PropType<string | null>,
69
73
  required: false,
@@ -79,11 +83,6 @@ export default defineComponent({
79
83
  required: false,
80
84
  default: null
81
85
  },
82
- aspectRatio: {
83
- type: String as PropType<string | null>,
84
- required: false,
85
- default: null
86
- },
87
86
  borderRadius: {
88
87
  type: [String, Number],
89
88
  required: false,
@@ -127,10 +126,7 @@ export default defineComponent({
127
126
  return undefined;
128
127
  }
129
128
  if (props.aspectRatio) {
130
- const split = props.aspectRatio.split('/');
131
- if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
132
- return sizeToVar(varToSize(props.width) * (parseFloat(split[1]) / parseFloat(split[0])));
133
- }
129
+ return sizeToVar(varToSize(props.width) / props.aspectRatio);
134
130
  }
135
131
  return sizeToVar(props.width);
136
132
  }
@@ -146,10 +142,7 @@ export default defineComponent({
146
142
  return undefined;
147
143
  }
148
144
  if (props.aspectRatio) {
149
- const split = props.aspectRatio.split('/');
150
- if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
151
- return sizeToVar(varToSize(props.height) * (parseFloat(split[0]) / parseFloat(split[1])));
152
- }
145
+ return sizeToVar(varToSize(props.height) * props.aspectRatio);
153
146
  }
154
147
  return sizeToVar(props.height);
155
148
  }
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <FSRow
3
- class="fs-tag"
4
- width="hug"
5
3
  align="center-left"
4
+ class="fs-tag"
5
+ :height="$props.height"
6
+ :width="$props.width"
6
7
  :style="style"
7
8
  :wrap="false"
8
9
  v-bind="$attrs"
@@ -55,6 +56,16 @@ export default defineComponent({
55
56
  FSRow
56
57
  },
57
58
  props: {
59
+ height: {
60
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
61
+ required: false,
62
+ default: "hug"
63
+ },
64
+ width: {
65
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
66
+ required: false,
67
+ default: "hug"
68
+ },
58
69
  label: {
59
70
  type: String as PropType<string | null>,
60
71
  required: false,
@@ -180,7 +180,7 @@ export default defineComponent({
180
180
 
181
181
  const dayEvents = computed(() => {
182
182
  return props.events.filter((event) => {
183
- return (event.start <= props.end && event.start >= props.start) || (event.end <= props.end && event.end >= props.start);
183
+ return event.start < props.end && event.end > props.start;
184
184
  });
185
185
  });
186
186
 
@@ -240,9 +240,8 @@ export default defineComponent({
240
240
 
241
241
  const getDayEvents = (dayStartEpoch: number) => {
242
242
  return props.events.filter((event) => {
243
- const isStartingInDay = event.start >= dayStartEpoch && event.start < (dayStartEpoch + 1000 * 60 * 60 * 24);
244
- const isEndingInDay = event.end >= dayStartEpoch && event.end < (dayStartEpoch + 1000 * 60 * 60 * 24);
245
- return isStartingInDay || isEndingInDay;
243
+ const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
244
+ return event.start < dayEndEpoch && event.end > dayStartEpoch;
246
245
  });
247
246
  };
248
247
 
@@ -309,9 +309,8 @@ export default defineComponent({
309
309
 
310
310
  const getDayEvents = (dayStartEpoch: number) => {
311
311
  return props.events.filter((event) => {
312
- const isStartingInDay = event.start >= dayStartEpoch && event.start < (dayStartEpoch + 1000 * 60 * 60 * 24);
313
- const isEndingInDay = event.end >= dayStartEpoch && event.end < (dayStartEpoch + 1000 * 60 * 60 * 24);
314
- return isStartingInDay || isEndingInDay;
312
+ const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
313
+ return event.start < dayEndEpoch && event.end > dayStartEpoch;
315
314
  });
316
315
  };
317
316
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.58",
4
+ "version": "1.0.59",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.58",
14
- "@dative-gpi/foundation-shared-services": "1.0.58"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.59",
14
+ "@dative-gpi/foundation-shared-services": "1.0.59"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "ee85735c6816c9c5f6264ac108a05e8bc6b2bec2"
38
+ "gitHead": "583e582d2f2185269a2d2880806be36bdc4dffdd"
39
39
  }