@dative-gpi/foundation-shared-components 1.0.7 → 1.0.10

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.
Files changed (84) hide show
  1. package/components/FSAccordionPanel.vue +8 -10
  2. package/components/FSBadge.vue +2 -4
  3. package/components/FSBreadcrumbs.vue +6 -6
  4. package/components/FSButton.vue +4 -4
  5. package/components/FSCalendar.vue +33 -31
  6. package/components/FSCalendarTwin.vue +75 -82
  7. package/components/FSCard.vue +7 -7
  8. package/components/FSCardPlaceholder.vue +1 -2
  9. package/components/FSCheckbox.vue +4 -6
  10. package/components/FSChip.vue +9 -11
  11. package/components/FSClickable.vue +44 -48
  12. package/components/FSClock.vue +2 -2
  13. package/components/FSCol.vue +2 -3
  14. package/components/FSColorIcon.vue +2 -4
  15. package/components/FSDialog.vue +1 -2
  16. package/components/FSDialogMenu.vue +2 -4
  17. package/components/FSDialogSubmit.vue +2 -4
  18. package/components/FSDivider.vue +6 -8
  19. package/components/FSEditImage.vue +6 -8
  20. package/components/FSErrorToast.vue +3 -4
  21. package/components/FSFadeOut.vue +9 -11
  22. package/components/FSGrid.vue +5 -9
  23. package/components/FSGridMosaic.vue +1 -2
  24. package/components/FSIcon.vue +4 -6
  25. package/components/FSIconCheck.vue +1 -2
  26. package/components/FSImage.vue +9 -10
  27. package/components/FSImageCard.vue +2 -2
  28. package/components/FSLabel.vue +17 -19
  29. package/components/FSLink.vue +18 -20
  30. package/components/FSLoader.vue +8 -11
  31. package/components/FSOptionGroup.vue +7 -9
  32. package/components/FSPagination.vue +3 -5
  33. package/components/FSRadio.vue +4 -6
  34. package/components/FSRadioGroup.vue +2 -4
  35. package/components/FSRow.vue +3 -4
  36. package/components/FSSlideGroup.vue +2 -3
  37. package/components/FSSlider.vue +8 -10
  38. package/components/FSSpan.vue +5 -8
  39. package/components/FSSwitch.vue +7 -9
  40. package/components/FSTab.vue +2 -4
  41. package/components/FSTabs.vue +9 -9
  42. package/components/FSTag.vue +9 -11
  43. package/components/FSTagGroup.vue +2 -4
  44. package/components/FSText.vue +7 -11
  45. package/components/FSWindow.vue +2 -2
  46. package/components/FSWrapGroup.vue +2 -3
  47. package/components/deviceOrganisations/FSConnectivityCard.vue +1 -2
  48. package/components/deviceOrganisations/FSStatusCard.vue +1 -2
  49. package/components/deviceOrganisations/FSStatusesRow.vue +1 -2
  50. package/components/deviceOrganisations/FSWorstAlert.vue +1 -2
  51. package/components/deviceOrganisations/FSWorstAlertCard.vue +1 -2
  52. package/components/fields/FSAutocompleteField.vue +2 -3
  53. package/components/fields/FSBaseField.vue +13 -10
  54. package/components/fields/FSColorField.vue +16 -16
  55. package/components/fields/FSDateTimeField.vue +2 -2
  56. package/components/fields/FSDateTimeRangeField.vue +4 -4
  57. package/components/fields/FSIconField.vue +2 -3
  58. package/components/fields/FSMagicConfigField.vue +1 -2
  59. package/components/fields/FSMagicField.vue +1 -2
  60. package/components/fields/FSNumberField.vue +1 -2
  61. package/components/fields/FSPasswordField.vue +2 -3
  62. package/components/fields/FSRichTextField.vue +3 -4
  63. package/components/fields/FSSearchField.vue +1 -2
  64. package/components/fields/FSSelectField.vue +2 -3
  65. package/components/fields/FSTagField.vue +3 -5
  66. package/components/fields/FSTermField.vue +6 -5
  67. package/components/fields/FSTextArea.vue +2 -3
  68. package/components/fields/FSTextField.vue +2 -3
  69. package/components/fields/FSTimeField.vue +1 -1
  70. package/components/fields/FSTimeSlotField.vue +2 -3
  71. package/components/fields/FSTranslateField.vue +2 -2
  72. package/components/fields/FSTreeViewField.vue +4 -6
  73. package/components/lists/FSDataIteratorItem.vue +8 -10
  74. package/components/lists/FSDataTableUI.vue +7 -11
  75. package/components/lists/FSFilterButton.vue +1 -2
  76. package/components/lists/FSLoadDataTable.vue +4 -6
  77. package/components/map/FSMap.vue +11 -14
  78. package/components/map/FSMapOverlay.vue +10 -10
  79. package/components/selects/FSSelectDateSetting.vue +1 -2
  80. package/components/tiles/FSLoadTile.vue +5 -7
  81. package/models/rules.ts +1 -1
  82. package/package.json +4 -4
  83. package/utils/badge.ts +9 -0
  84. package/utils/index.ts +1 -0
@@ -123,12 +123,10 @@
123
123
  </template>
124
124
 
125
125
  <script lang="ts">
126
- import type { PropType} from "vue";
127
- import { computed, defineComponent, ref } from "vue";
128
- import type { RouteLocation } from "vue-router";
126
+ import { computed, defineComponent, type PropType, ref, type StyleValue } from "vue";
127
+ import { type RouteLocation } from "vue-router";
129
128
 
130
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
131
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
129
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
132
130
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
133
131
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
134
132
 
@@ -213,7 +211,7 @@ export default defineComponent({
213
211
  const hover = ref(false);
214
212
  const active = ref(false);
215
213
 
216
- const style = computed((): { [key: string] : string | null | undefined } => {
214
+ const style = computed((): StyleValue => {
217
215
  if (!props.editable) {
218
216
  return {
219
217
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
@@ -229,41 +227,39 @@ export default defineComponent({
229
227
  switch (props.variant) {
230
228
  case "standard":
231
229
  switch (props.color) {
232
- case ColorEnum.Dark:
233
- case ColorEnum.Light:
234
- return {
235
- "--fs-clickable-border-size" : props.border ? "1px" : "0",
236
- "--fs-clickable-border-style" : props.borderStyle,
237
- "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
238
- "--fs-clickable-background-color" : backgrounds.base,
239
- "--fs-clickable-border-color" : lights.dark,
240
- "--fs-clickable-color" : lights.lightContrast,
241
- "--fs-clickable-hover-background-color" : lights.base,
242
- "--fs-clickable-hover-border-color" : lights.dark,
243
- "--fs-clickable-hover-color" : lights.baseContrast,
244
- "--fs-clickable-active-background-color": lights.dark,
245
- "--fs-clickable-active-border-color" : lights.dark,
246
- "--fs-clickable-active-color" : lights.darkContrast,
247
- "--fs-clickable-height" : sizeToVar(props.height),
248
- "--fs-clickable-width" : sizeToVar(props.width)
249
- };
250
- default:
251
- return {
252
- "--fs-clickable-border-size" : props.border ? "1px" : "0",
253
- "--fs-clickable-border-style" : props.borderStyle,
254
- "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
255
- "--fs-clickable-background-color" : colors.value.light,
256
- "--fs-clickable-border-color" : colors.value.lightContrast,
257
- "--fs-clickable-color" : colors.value.lightContrast,
258
- "--fs-clickable-hover-background-color" : colors.value.base,
259
- "--fs-clickable-hover-border-color" : colors.value.base,
260
- "--fs-clickable-hover-color" : colors.value.baseContrast,
261
- "--fs-clickable-active-background-color": colors.value.dark,
262
- "--fs-clickable-active-border-color" : colors.value.darkContrast,
263
- "--fs-clickable-active-color" : colors.value.darkContrast,
264
- "--fs-clickable-height" : sizeToVar(props.height),
265
- "--fs-clickable-width" : sizeToVar(props.width)
266
- };
230
+ case ColorEnum.Dark :
231
+ case ColorEnum.Light: return {
232
+ "--fs-clickable-border-size" : props.border ? "1px" : "0",
233
+ "--fs-clickable-border-style" : props.borderStyle,
234
+ "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
235
+ "--fs-clickable-background-color" : backgrounds.base,
236
+ "--fs-clickable-border-color" : lights.dark,
237
+ "--fs-clickable-color" : lights.lightContrast!,
238
+ "--fs-clickable-hover-background-color" : lights.base,
239
+ "--fs-clickable-hover-border-color" : lights.dark,
240
+ "--fs-clickable-hover-color" : lights.baseContrast!,
241
+ "--fs-clickable-active-background-color": lights.dark,
242
+ "--fs-clickable-active-border-color" : lights.dark,
243
+ "--fs-clickable-active-color" : lights.darkContrast!,
244
+ "--fs-clickable-height" : sizeToVar(props.height),
245
+ "--fs-clickable-width" : sizeToVar(props.width)
246
+ };
247
+ default: return {
248
+ "--fs-clickable-border-size" : props.border ? "1px" : "0",
249
+ "--fs-clickable-border-style" : props.borderStyle,
250
+ "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
251
+ "--fs-clickable-background-color" : colors.value.light,
252
+ "--fs-clickable-border-color" : colors.value.lightContrast!,
253
+ "--fs-clickable-color" : colors.value.lightContrast!,
254
+ "--fs-clickable-hover-background-color" : colors.value.base,
255
+ "--fs-clickable-hover-border-color" : colors.value.base,
256
+ "--fs-clickable-hover-color" : colors.value.baseContrast!,
257
+ "--fs-clickable-active-background-color": colors.value.dark,
258
+ "--fs-clickable-active-border-color" : colors.value.darkContrast!,
259
+ "--fs-clickable-active-color" : colors.value.darkContrast!,
260
+ "--fs-clickable-height" : sizeToVar(props.height),
261
+ "--fs-clickable-width" : sizeToVar(props.width)
262
+ };
267
263
  }
268
264
  case "background": return {
269
265
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
@@ -273,11 +269,11 @@ export default defineComponent({
273
269
  "--fs-clickable-border-color" : lights.dark,
274
270
  "--fs-clickable-color" : darks.base,
275
271
  "--fs-clickable-hover-background-color" : colors.value.base,
276
- "--fs-clickable-hover-border-color" : colors.value.baseContrast,
277
- "--fs-clickable-hover-color" : colors.value.baseContrast,
272
+ "--fs-clickable-hover-border-color" : colors.value.baseContrast!,
273
+ "--fs-clickable-hover-color" : colors.value.baseContrast!,
278
274
  "--fs-clickable-active-background-color": colors.value.dark,
279
- "--fs-clickable-active-border-color" : colors.value.darkContrast,
280
- "--fs-clickable-active-color" : colors.value.darkContrast,
275
+ "--fs-clickable-active-border-color" : colors.value.darkContrast!,
276
+ "--fs-clickable-active-color" : colors.value.darkContrast!,
281
277
  "--fs-clickable-height" : sizeToVar(props.height),
282
278
  "--fs-clickable-width" : sizeToVar(props.width)
283
279
  };
@@ -287,13 +283,13 @@ export default defineComponent({
287
283
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
288
284
  "--fs-clickable-background-color" : colors.value.base,
289
285
  "--fs-clickable-border-color" : colors.value.base,
290
- "--fs-clickable-color" : colors.value.baseContrast,
286
+ "--fs-clickable-color" : colors.value.baseContrast!,
291
287
  "--fs-clickable-hover-background-color" : colors.value.base,
292
288
  "--fs-clickable-hover-border-color" : colors.value.base,
293
- "--fs-clickable-hover-color" : colors.value.baseContrast,
289
+ "--fs-clickable-hover-color" : colors.value.baseContrast!,
294
290
  "--fs-clickable-active-background-color": colors.value.dark,
295
291
  "--fs-clickable-active-border-color" : colors.value.dark,
296
- "--fs-clickable-active-color" : colors.value.darkContrast,
292
+ "--fs-clickable-active-color" : colors.value.darkContrast!,
297
293
  "--fs-clickable-height" : sizeToVar(props.height),
298
294
  "--fs-clickable-width" : sizeToVar(props.width)
299
295
  };
@@ -52,7 +52,7 @@
52
52
  </template>
53
53
 
54
54
  <script lang="ts">
55
- import { computed, defineComponent, type PropType, ref, watch } from "vue";
55
+ import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
56
56
 
57
57
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
58
58
  import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
@@ -109,7 +109,7 @@ export default defineComponent({
109
109
  const innerHours = ref(0);
110
110
  const innerMinutes = ref(0);
111
111
 
112
- const style = computed((): { [key: string] : string | null | undefined } => {
112
+ const style = computed((): StyleValue => {
113
113
  if (!props.editable) {
114
114
  return {
115
115
  "--fs-clock-field-cursor" : "default",
@@ -9,8 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script lang="ts">
12
- import type { PropType } from "vue";
13
- import { computed, defineComponent } from "vue";
12
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
14
13
 
15
14
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
16
15
 
@@ -49,7 +48,7 @@ export default defineComponent({
49
48
  }
50
49
  },
51
50
  setup(props) {
52
- const style = computed((): { [key: string] : string | null | undefined } => ({
51
+ const style = computed((): StyleValue => ({
53
52
  "--fs-col-overflow": props.overflow,
54
53
  "--fs-col-padding" : sizeToVar(props.padding),
55
54
  "--fs-col-gap" : sizeToVar(props.gap),
@@ -20,11 +20,9 @@
20
20
  </template>
21
21
 
22
22
  <script lang="ts">
23
- import type { PropType } from "vue";
24
- import { computed, defineComponent } from "vue";
23
+ import { computed, defineComponent, type PropType } from "vue";
25
24
 
26
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
27
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
25
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
28
26
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
29
27
 
30
28
  import FSColor from "./FSColor.vue";
@@ -29,8 +29,7 @@
29
29
  </template>
30
30
 
31
31
  <script lang="ts">
32
- import type { PropType } from "vue";
33
- import { computed, defineComponent } from "vue";
32
+ import { computed, defineComponent, type PropType } from "vue";
34
33
 
35
34
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
36
35
 
@@ -25,11 +25,9 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
- import type { PropType } from "vue";
29
- import { computed, defineComponent } from "vue";
28
+ import { computed, defineComponent, type PropType } from "vue";
30
29
 
31
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
32
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
30
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
33
31
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
34
32
 
35
33
  import FSCard from "./FSCard.vue";
@@ -61,12 +61,10 @@
61
61
  </template>
62
62
 
63
63
  <script lang="ts">
64
- import type { PropType } from "vue";
65
- import { computed, defineComponent } from "vue";
64
+ import { computed, defineComponent, type PropType } from "vue";
66
65
 
67
66
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
68
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
69
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
67
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
70
68
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
71
69
 
72
70
  import FSFadeOut from "./FSFadeOut.vue";
@@ -34,12 +34,10 @@
34
34
  </template>
35
35
 
36
36
  <script lang="ts">
37
- import type { PropType } from "vue";
38
- import { computed, defineComponent } from "vue";
37
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
39
38
 
39
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
40
40
  import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
41
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
42
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
43
41
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
44
42
 
45
43
  import FSText from "./FSText.vue";
@@ -87,7 +85,7 @@ export default defineComponent({
87
85
 
88
86
  const colors = computed(() => getColors(props.color));
89
87
 
90
- const style = computed((): { [key: string] : string | null | undefined } => {
88
+ const style = computed((): StyleValue => {
91
89
  switch (props.variant) {
92
90
  case "base": return {
93
91
  "--fs-divider-size" : sizeToVar(props.size),
@@ -109,9 +107,9 @@ export default defineComponent({
109
107
  });
110
108
 
111
109
  return {
112
- style,
113
- isEmpty
110
+ isEmpty,
111
+ style
114
112
  };
115
113
  }
116
114
  });
117
- </script>
115
+ </script>
@@ -165,7 +165,7 @@
165
165
  </template>
166
166
 
167
167
  <script lang="ts">
168
- import { computed, defineComponent, type PropType, ref, watch } from "vue";
168
+ import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
169
169
 
170
170
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
171
171
  import { ColorEnum, type FileImage } from "@dative-gpi/foundation-shared-components/models";
@@ -252,13 +252,11 @@ export default defineComponent({
252
252
  const lights = getColors(ColorEnum.Light);
253
253
  const darks = getColors(ColorEnum.Dark);
254
254
 
255
- const style = computed((): { [key: string]: string | undefined } => {
256
- return {
257
- "--fs-edit-image-overline-text-color": lights.dark,
258
- "--fs-edit-image-color" : darks.base,
259
- "--fs-edit-image-error-color" : errors.base
260
- };
261
- });
255
+ const style = computed((): StyleValue => ({
256
+ "--fs-edit-image-overline-text-color": lights.dark,
257
+ "--fs-edit-image-color" : darks.base,
258
+ "--fs-edit-image-error-color" : errors.base
259
+ }));
262
260
 
263
261
  const onUpload = async (payload: File) => {
264
262
  const content = (await readFile(payload)) as string;
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <FSCol
3
- padding="18px 32px"
4
3
  class="fs-error-toast"
5
4
  align="center-center"
5
+ padding="18px 32px"
6
6
  gap="24px"
7
7
  :style="style"
8
8
  >
@@ -28,8 +28,7 @@
28
28
  </template>
29
29
 
30
30
  <script lang="ts">
31
- import type { PropType } from "vue";
32
- import { computed, defineComponent } from "vue";
31
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
33
32
 
34
33
  import { getError, sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
35
34
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
@@ -69,7 +68,7 @@ export default defineComponent({
69
68
 
70
69
  const errors = getColors(ColorEnum.Error);
71
70
 
72
- const style = computed((): { [key: string]: string | undefined } => {
71
+ const style = computed((): StyleValue => {
73
72
  switch (props.variant) {
74
73
  case "standard": return {
75
74
  "--fs-error-toast-border-radius": sizeToVar(props.borderRadius),
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script lang="ts">
14
- import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, watch } from "vue";
14
+ import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, type StyleValue, watch } from "vue";
15
15
 
16
16
  import { useBreakpoints, useColors, useDebounce } from "@dative-gpi/foundation-shared-components/composables";
17
17
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -58,16 +58,14 @@ export default defineComponent({
58
58
 
59
59
  const elementId = `id${uuidv4()}`;
60
60
 
61
- const style = computed((): { [key: string] : string | null | undefined } => {
62
- return {
63
- "--fs-fade-out-height" : sizeToVar(props.height),
64
- "--fs-fade-out-width" : sizeToVar(props.width),
65
- "--fs-fade-out-padding" : sizeToVar(props.padding),
66
- "--fs-fade-out-mask-color" : backgrounds.base,
67
- "--fs-fade-out-top-mask-height" : topMaskHeight.value,
68
- "--fs-fade-out-bottom-mask-height" : bottomMaskHeight.value,
69
- };
70
- });
61
+ const style = computed((): StyleValue => ({
62
+ "--fs-fade-out-height" : sizeToVar(props.height),
63
+ "--fs-fade-out-width" : sizeToVar(props.width),
64
+ "--fs-fade-out-padding" : sizeToVar(props.padding),
65
+ "--fs-fade-out-mask-color" : backgrounds.base,
66
+ "--fs-fade-out-top-mask-height" : topMaskHeight.value,
67
+ "--fs-fade-out-bottom-mask-height": bottomMaskHeight.value
68
+ }));
71
69
 
72
70
  const handleMasks = () => {
73
71
  if (fadeOutRef.value) {
@@ -66,12 +66,10 @@
66
66
  </template>
67
67
 
68
68
  <script lang="ts">
69
- import type { PropType } from "vue";
70
- import { computed, defineComponent } from "vue";
69
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
71
70
 
71
+ import { ColorEnum, type FSGridItem } from "@dative-gpi/foundation-shared-components/models";
72
72
  import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
73
- import type { FSGridItem } from "@dative-gpi/foundation-shared-components/models";
74
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
75
73
 
76
74
  import FSText from "./FSText.vue";
77
75
  import FSCol from "./FSCol.vue";
@@ -97,11 +95,9 @@ export default defineComponent({
97
95
 
98
96
  const lights = getColors(ColorEnum.Light);
99
97
 
100
- const style = computed((): { [key: string] : string | null | undefined } => {
101
- return {
102
- "--fs-grid-border-color": lights.dark
103
- };
104
- });
98
+ const style = computed((): StyleValue => ({
99
+ "--fs-grid-border-color": lights.dark
100
+ }));
105
101
 
106
102
  const headerSlot = (code: string) => {
107
103
  if (slots[`header.${code}`]) {
@@ -34,8 +34,7 @@
34
34
  </template>
35
35
 
36
36
  <script lang="ts">
37
- import type { PropType } from "vue";
38
- import { computed, defineComponent } from "vue";
37
+ import { computed, defineComponent, type PropType } from "vue";
39
38
 
40
39
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
41
40
  import type { FSGridMosaic } from "@dative-gpi/foundation-shared-components/models";
@@ -10,11 +10,10 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts">
13
- import type { PropType } from "vue";
14
- import { computed, defineComponent } from "vue";
13
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
15
14
 
16
15
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
17
- import type { ColorBase } from "@dative-gpi/foundation-shared-components/models";
16
+ import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
18
17
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
19
18
 
20
19
  export default defineComponent({
@@ -40,14 +39,13 @@ export default defineComponent({
40
39
  const { isMobileSized } = useBreakpoints();
41
40
  const { getColors } = useColors();
42
41
 
43
- const color = computed((): string | null => {
42
+ const color = computed((): string | undefined => {
44
43
  if (props.color) {
45
44
  return getColors(props.color)[props.variant]!;
46
45
  }
47
- return null;
48
46
  });
49
47
 
50
- const style = computed((): { [key: string] : string | null | undefined } => {
48
+ const style = computed((): StyleValue => {
51
49
  switch(props.size) {
52
50
  case "s": return {
53
51
  "--fs-icon-font-size": isMobileSized.value ? "14px" : "16px"
@@ -9,8 +9,7 @@
9
9
  <script lang="ts">
10
10
  import { computed, defineComponent } from "vue";
11
11
 
12
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
13
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
12
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
14
13
 
15
14
  import FSIcon from "./FSIcon.vue";
16
15
 
@@ -39,8 +39,7 @@
39
39
  </template>
40
40
 
41
41
  <script lang="ts">
42
- import type { PropType} from "vue";
43
- import { computed, defineComponent, ref, watch } from "vue";
42
+ import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
44
43
  import { decode, isBlurhashValid } from "blurhash";
45
44
 
46
45
  import { IMAGE_RAW_EXTENSION_URL, IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config/urls";
@@ -111,12 +110,10 @@ export default defineComponent({
111
110
  "/9j/" : "image/jpg",
112
111
  });
113
112
 
114
- const style = computed((): { [key: string] : string | null | undefined } => {
115
- return {
116
- "--fs-image-border-radius" : sizeToVar(props.borderRadius),
117
- "--fs-image-blurhash-opacity": blurHash.value ? "1" : "0"
118
- }
119
- });
113
+ const style = computed((): StyleValue => ({
114
+ "--fs-image-border-radius" : sizeToVar(props.borderRadius),
115
+ "--fs-image-blurhash-opacity": blurHash.value ? "1" : "0"
116
+ }));
120
117
 
121
118
  const computedHeight = computed((): string | undefined => {
122
119
  if (props.height) {
@@ -156,7 +153,7 @@ export default defineComponent({
156
153
  return undefined;
157
154
  });
158
155
 
159
- const realSource = computed((): string | null => {
156
+ const realSource = computed((): string | undefined => {
160
157
  if (props.imageB64) {
161
158
  if (imageType.value && imageData.value) {
162
159
  return `${imageType.value},${imageData.value}`;
@@ -168,7 +165,9 @@ export default defineComponent({
168
165
  }
169
166
  return IMAGE_RAW_URL(props.imageId);
170
167
  }
171
- return props.source;
168
+ else if (props.source) {
169
+ return props.source;
170
+ }
172
171
  });
173
172
 
174
173
  const imageData = computed((): string | null => {
@@ -26,7 +26,7 @@
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
29
- import { computed, defineComponent, type PropType } from "vue";
29
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
30
30
 
31
31
  import FSClickable from "./FSClickable.vue";
32
32
  import FSSpan from "./FSSpan.vue";
@@ -60,7 +60,7 @@ export default defineComponent({
60
60
  }
61
61
  },
62
62
  setup(props) {
63
- const style = computed(() => ({
63
+ const style = computed((): StyleValue => ({
64
64
  "--fs-image-card-background": `url(${props.src})`
65
65
  }));
66
66
 
@@ -16,12 +16,10 @@
16
16
  </template>
17
17
 
18
18
  <script lang="ts">
19
- import type { PropType } from "vue";
20
- import { computed, defineComponent } from "vue";
19
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
21
20
 
21
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
22
22
  import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
23
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
24
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
25
23
 
26
24
  import FSLoader from "./FSLoader.vue";
27
25
 
@@ -68,21 +66,7 @@ export default defineComponent({
68
66
 
69
67
  const colors = computed(() => getColors(props.color));
70
68
 
71
- const classes = computed((): string[] => {
72
- const classNames = ["fs-label", props.font];
73
- if (!slots.default) {
74
- classNames.push("fs-span-pre-wrap");
75
- }
76
- if (props.lineClamp > 1) {
77
- classNames.push("fs-span-line-clamp");
78
- }
79
- else if (props.ellipsis) {
80
- classNames.push("fs-span-ellipsis");
81
- }
82
- return classNames;
83
- });
84
-
85
- const style = computed((): { [key: string] : string | null | undefined } => {
69
+ const style = computed((): StyleValue => {
86
70
  switch (props.variant) {
87
71
  case "base": return {
88
72
  "--fs-span-line-clamp": props.lineClamp.toString(),
@@ -99,6 +83,20 @@ export default defineComponent({
99
83
  }
100
84
  });
101
85
 
86
+ const classes = computed((): string[] => {
87
+ const classNames = ["fs-label", props.font];
88
+ if (!slots.default) {
89
+ classNames.push("fs-span-pre-wrap");
90
+ }
91
+ if (props.lineClamp > 1) {
92
+ classNames.push("fs-span-line-clamp");
93
+ }
94
+ else if (props.ellipsis) {
95
+ classNames.push("fs-span-ellipsis");
96
+ }
97
+ return classNames;
98
+ });
99
+
102
100
  return {
103
101
  classes,
104
102
  style
@@ -25,13 +25,11 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
- import type { PropType } from "vue";
29
- import { computed, defineComponent } from "vue";
30
- import type { RouteLocation } from "vue-router";
28
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
29
+ import { type RouteLocation } from "vue-router";
31
30
 
31
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
32
32
  import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
33
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
34
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
35
33
 
36
34
  export default defineComponent({
37
35
  name: "FSLink",
@@ -83,21 +81,7 @@ export default defineComponent({
83
81
 
84
82
  const colors = computed(() => getColors(props.color));
85
83
 
86
- const classes = computed((): string[] => {
87
- const classNames = ["fs-link", props.font];
88
- if (!slots.default) {
89
- classNames.push("fs-span-pre-wrap");
90
- }
91
- if (props.lineClamp > 1) {
92
- classNames.push("fs-span-line-clamp");
93
- }
94
- else if (props.ellipsis) {
95
- classNames.push("fs-span-ellipsis");
96
- }
97
- return classNames;
98
- });
99
-
100
- const style = computed((): { [key: string] : string | null | undefined } => {
84
+ const style = computed((): StyleValue => {
101
85
  switch (props.variant) {
102
86
  case "base": return {
103
87
  "--fs-span-line-clamp": props.lineClamp.toString(),
@@ -114,6 +98,20 @@ export default defineComponent({
114
98
  }
115
99
  });
116
100
 
101
+ const classes = computed((): string[] => {
102
+ const classNames = ["fs-link", props.font];
103
+ if (!slots.default) {
104
+ classNames.push("fs-span-pre-wrap");
105
+ }
106
+ if (props.lineClamp > 1) {
107
+ classNames.push("fs-span-line-clamp");
108
+ }
109
+ else if (props.ellipsis) {
110
+ classNames.push("fs-span-ellipsis");
111
+ }
112
+ return classNames;
113
+ });
114
+
117
115
  return {
118
116
  classes,
119
117
  style