@dative-gpi/foundation-shared-components 0.0.90 → 0.0.92

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 (43) hide show
  1. package/components/FSChip.vue +34 -5
  2. package/components/FSClickable.vue +38 -16
  3. package/components/FSClock.vue +0 -3
  4. package/components/FSDialog.vue +46 -11
  5. package/components/FSDialogForm.vue +7 -28
  6. package/components/FSDialogRemove.vue +2 -1
  7. package/components/FSDialogSubmit.vue +7 -28
  8. package/components/FSDivider.vue +16 -6
  9. package/components/FSFadeOut.vue +49 -59
  10. package/components/FSSlideGroup.vue +14 -5
  11. package/components/FSSlider.vue +21 -9
  12. package/components/FSWindow.vue +13 -1
  13. package/components/FSWrapGroup.vue +2 -1
  14. package/components/deviceOrganisations/FSConnectivity.vue +4 -1
  15. package/components/deviceOrganisations/FSConnectivityCard.vue +31 -12
  16. package/components/deviceOrganisations/FSStatus.vue +4 -1
  17. package/components/deviceOrganisations/FSStatusCard.vue +48 -23
  18. package/components/deviceOrganisations/FSStatusesCarousel.vue +57 -39
  19. package/components/deviceOrganisations/FSWorstAlert.vue +4 -1
  20. package/components/deviceOrganisations/FSWorstAlertCard.vue +32 -14
  21. package/components/fields/FSAutocompleteField.vue +2 -7
  22. package/components/fields/FSSelectField.vue +1 -0
  23. package/components/lists/FSDataTableUI.vue +85 -33
  24. package/components/lists/FSFilterButton.vue +38 -24
  25. package/components/lists/FSHeaderButton.vue +21 -13
  26. package/components/lists/FSHiddenButton.vue +33 -15
  27. package/components/tiles/FSDeviceOrganisationTileUI.vue +3 -1
  28. package/components/tiles/FSFolderTileUI.vue +1 -1
  29. package/package.json +4 -4
  30. package/styles/components/fs_autocomplete_field.scss +7 -2
  31. package/styles/components/fs_chip.scss +1 -8
  32. package/styles/components/fs_dialog.scss +6 -18
  33. package/styles/components/fs_divider.scss +8 -2
  34. package/styles/components/fs_fade_out.scss +8 -23
  35. package/styles/components/fs_filter_button.scss +4 -4
  36. package/styles/components/fs_header_button.scss +4 -0
  37. package/styles/components/fs_select_field.scss +4 -3
  38. package/styles/components/fs_text_area.scss +0 -1
  39. package/styles/components/index.scss +0 -1
  40. package/styles/globals/overrides.scss +0 -4
  41. package/themes/default.ts +1 -1
  42. package/components/FSCarousel.vue +0 -72
  43. package/styles/components/fs_carousel.scss +0 -9
@@ -7,7 +7,10 @@
7
7
  :wrap="false"
8
8
  v-bind="$attrs"
9
9
  >
10
- <slot name="prepend" v-bind="{ color: $props.color, colors }">
10
+ <slot
11
+ name="prepend"
12
+ v-bind="{ color: $props.color, colors }"
13
+ >
11
14
  <FSIcon
12
15
  v-if="$props.prependIcon"
13
16
  size="s"
@@ -15,7 +18,9 @@
15
18
  {{ $props.prependIcon }}
16
19
  </FSIcon>
17
20
  </slot>
18
- <slot v-bind="{ color: $props.color, colors }">
21
+ <slot
22
+ v-bind="{ color: $props.color, colors }"
23
+ >
19
24
  <FSSpan
20
25
  v-if="$props.label"
21
26
  font="text-overline"
@@ -24,7 +29,10 @@
24
29
  {{ $props.label }}
25
30
  </FSSpan>
26
31
  </slot>
27
- <slot name="append" v-bind="{ color: $props.color, colors }">
32
+ <slot
33
+ name="append"
34
+ v-bind="{ color: $props.color, colors }"
35
+ >
28
36
  <FSIcon
29
37
  v-if="$props.appendIcon"
30
38
  size="s"
@@ -40,6 +48,7 @@ import { computed, defineComponent, PropType } from "vue";
40
48
 
41
49
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
42
50
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
51
+ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
43
52
 
44
53
  import FSIcon from "./FSIcon.vue";
45
54
  import FSSpan from "./FSSpan.vue";
@@ -68,8 +77,13 @@ export default defineComponent({
68
77
  required: false,
69
78
  default: null
70
79
  },
80
+ height: {
81
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
82
+ required: false,
83
+ default: () => [24, 20]
84
+ },
71
85
  variant: {
72
- type: String as PropType<"standard" | "full">,
86
+ type: String as PropType<"standard" | "full" | "borderless">,
73
87
  required: false,
74
88
  default: "full"
75
89
  },
@@ -89,10 +103,12 @@ export default defineComponent({
89
103
 
90
104
  const colors = computed(() => getColors(props.color));
91
105
  const backgrounds = getColors(ColorEnum.Background);
106
+ const darks = getColors(ColorEnum.Dark);
92
107
 
93
108
  const style = computed((): { [key: string] : string | undefined } => {
94
109
  switch (props.variant) {
95
110
  case "standard": return {
111
+ "--fs-chip-height" : sizeToVar(props.height),
96
112
  "--fs-chip-background-color" : backgrounds.base,
97
113
  "--fs-chip-border-color" : colors.value.base,
98
114
  "--fs-chip-color" : colors.value.base,
@@ -104,16 +120,29 @@ export default defineComponent({
104
120
  "--fs-chip-active-color" : colors.value.dark
105
121
  };
106
122
  case "full": return {
123
+ "--fs-chip-height" : sizeToVar(props.height),
107
124
  "--fs-chip-background-color" : colors.value.base,
108
125
  "--fs-chip-border-color" : colors.value.baseContrast,
109
126
  "--fs-chip-color" : colors.value.baseContrast,
110
127
  "--fs-chip-hover-background-color" : colors.value.base,
111
- "--fs-chip-hover-border-color" : colors.value.baseContrast,
128
+ "--fs-chip-hover-border-color" : colors.value.base,
112
129
  "--fs-chip-hover-color" : colors.value.baseContrast,
113
130
  "--fs-chip-active-background-color": colors.value.dark,
114
131
  "--fs-chip-active-border-color" : colors.value.darkContrast,
115
132
  "--fs-chip-active-color" : colors.value.darkContrast
116
133
  };
134
+ case "borderless": return {
135
+ "--fs-chip-height" : sizeToVar(props.height),
136
+ "--fs-chip-background-color" : backgrounds.base,
137
+ "--fs-chip-border-color" : backgrounds.base,
138
+ "--fs-chip-color" : darks.base,
139
+ "--fs-chip-hover-background-color" : colors.value.light,
140
+ "--fs-chip-hover-border-color" : colors.value.light,
141
+ "--fs-chip-hover-color" : colors.value.base,
142
+ "--fs-chip-active-background-color": colors.value.light,
143
+ "--fs-chip-active-border-color" : colors.value.light,
144
+ "--fs-chip-active-color" : colors.value.base
145
+ };
117
146
  }
118
147
  });
119
148
 
@@ -225,22 +225,44 @@ export default defineComponent({
225
225
  };
226
226
  }
227
227
  switch (props.variant) {
228
- case "standard": return {
229
- "--fs-clickable-border-size" : props.border ? "1px" : "0",
230
- "--fs-clickable-border-style" : props.borderStyle,
231
- "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
232
- "--fs-clickable-background-color" : colors.value.light,
233
- "--fs-clickable-border-color" : colors.value.lightContrast,
234
- "--fs-clickable-color" : colors.value.lightContrast,
235
- "--fs-clickable-hover-background-color" : colors.value.base,
236
- "--fs-clickable-hover-border-color" : colors.value.baseContrast,
237
- "--fs-clickable-hover-color" : colors.value.baseContrast,
238
- "--fs-clickable-active-background-color": colors.value.dark,
239
- "--fs-clickable-active-border-color" : colors.value.darkContrast,
240
- "--fs-clickable-active-color" : colors.value.darkContrast,
241
- "--fs-clickable-height" : sizeToVar(props.height),
242
- "--fs-clickable-width" : sizeToVar(props.width)
243
- };
228
+ case "standard":
229
+ switch (props.color) {
230
+ case ColorEnum.Dark:
231
+ case ColorEnum.Light:
232
+ return {
233
+ "--fs-clickable-border-size" : props.border ? "1px" : "0",
234
+ "--fs-clickable-border-style" : props.borderStyle,
235
+ "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
236
+ "--fs-clickable-background-color" : backgrounds.base,
237
+ "--fs-clickable-border-color" : lights.dark,
238
+ "--fs-clickable-color" : lights.lightContrast,
239
+ "--fs-clickable-hover-background-color" : lights.base,
240
+ "--fs-clickable-hover-border-color" : lights.dark,
241
+ "--fs-clickable-hover-color" : lights.baseContrast,
242
+ "--fs-clickable-active-background-color": lights.dark,
243
+ "--fs-clickable-active-border-color" : lights.dark,
244
+ "--fs-clickable-active-color" : lights.darkContrast,
245
+ "--fs-clickable-height" : sizeToVar(props.height),
246
+ "--fs-clickable-width" : sizeToVar(props.width)
247
+ };
248
+ default:
249
+ return {
250
+ "--fs-clickable-border-size" : props.border ? "1px" : "0",
251
+ "--fs-clickable-border-style" : props.borderStyle,
252
+ "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
253
+ "--fs-clickable-background-color" : colors.value.light,
254
+ "--fs-clickable-border-color" : colors.value.lightContrast,
255
+ "--fs-clickable-color" : colors.value.lightContrast,
256
+ "--fs-clickable-hover-background-color" : colors.value.base,
257
+ "--fs-clickable-hover-border-color" : colors.value.baseContrast,
258
+ "--fs-clickable-hover-color" : colors.value.baseContrast,
259
+ "--fs-clickable-active-background-color": colors.value.dark,
260
+ "--fs-clickable-active-border-color" : colors.value.darkContrast,
261
+ "--fs-clickable-active-color" : colors.value.darkContrast,
262
+ "--fs-clickable-height" : sizeToVar(props.height),
263
+ "--fs-clickable-width" : sizeToVar(props.width)
264
+ };
265
+ }
244
266
  case "background": return {
245
267
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
246
268
  "--fs-clickable-border-style" : props.borderStyle,
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <FSCol
3
3
  width="fill"
4
- gap="16px"
5
4
  >
6
5
  <FSRow
7
6
  align="center-center"
@@ -66,7 +65,6 @@ import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composabl
66
65
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
67
66
 
68
67
  import FSSlider from "./FSSlider.vue";
69
- import FSText from "./FSText.vue";
70
68
  import FSCol from "./FSCol.vue";
71
69
  import FSRow from "./FSRow.vue";
72
70
 
@@ -74,7 +72,6 @@ export default defineComponent({
74
72
  name: "FSClock",
75
73
  components: {
76
74
  FSSlider,
77
- FSText,
78
75
  FSCol,
79
76
  FSRow
80
77
  },
@@ -8,12 +8,40 @@
8
8
  >
9
9
  <FSCard
10
10
  padding="24px 8px 24px 24px"
11
- width="100%"
12
11
  gap="24px"
13
- :border="!isExtraSmall"
14
12
  :color="$props.color"
15
13
  :class="classes"
16
14
  >
15
+ <template
16
+ #header
17
+ >
18
+ <FSCol
19
+ padding="0 16px 0 0"
20
+ >
21
+ <FSRow
22
+ align="center-left"
23
+ :wrap="false"
24
+ >
25
+ <FSText
26
+ font="text-h2"
27
+ >
28
+ {{ $props.title }}
29
+ </FSText>
30
+ <v-spacer />
31
+ <FSButton
32
+ icon="mdi-close"
33
+ variant="icon"
34
+ :color="ColorEnum.Dark"
35
+ @click="$emit('update:modelValue', false)"
36
+ />
37
+ </FSRow>
38
+ <FSText
39
+ v-if="$props.subtitle"
40
+ >
41
+ {{ $props.subtitle }}
42
+ </FSText>
43
+ </FSCol>
44
+ </template>
17
45
  <template
18
46
  v-for="(_, name) in $slots"
19
47
  v-slot:[name]="slotData"
@@ -24,13 +52,6 @@
24
52
  />
25
53
  </template>
26
54
  </FSCard>
27
- <FSButton
28
- class="fs-dialog-close-button"
29
- icon="mdi-close"
30
- variant="icon"
31
- :color="ColorEnum.Dark"
32
- @click="$emit('update:modelValue', false)"
33
- />
34
55
  </v-dialog>
35
56
  </template>
36
57
 
@@ -43,18 +64,32 @@ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
43
64
 
44
65
  import FSButton from "./FSButton.vue";
45
66
  import FSCard from "./FSCard.vue";
67
+ import FSText from "./FSText.vue";
68
+ import FSRow from "./FSRow.vue";
46
69
 
47
70
  export default defineComponent({
48
71
  name: "FSDialog",
49
72
  components: {
50
73
  FSButton,
51
- FSCard
74
+ FSCard,
75
+ FSText,
76
+ FSRow
52
77
  },
53
78
  props: {
79
+ title: {
80
+ type: String as PropType<string | null>,
81
+ required: false,
82
+ default: null
83
+ },
84
+ subtitle: {
85
+ type: String as PropType<string | null>,
86
+ required: false,
87
+ default: null
88
+ },
54
89
  width: {
55
90
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
56
91
  required: false,
57
- default: "auto"
92
+ default: "fit-content"
58
93
  },
59
94
  cardClasses: {
60
95
  type: [Array, String] as PropType<string[] | string | null>,
@@ -1,33 +1,12 @@
1
1
  <template>
2
2
  <FSDialog
3
+ :title="$props.title"
4
+ :subtitle="$props.subtitle"
3
5
  :width="$props.width"
4
6
  :modelValue="$props.modelValue"
5
7
  @update:modelValue="$emit('update:modelValue', $event)"
6
8
  v-bind="$attrs"
7
9
  >
8
- <template
9
- #header
10
- >
11
- <slot
12
- name="header"
13
- >
14
- <FSCol
15
- v-if="$props.title"
16
- padding="0 16px 0 0"
17
- >
18
- <FSSpan
19
- font="text-h2"
20
- >
21
- {{ $props.title }}
22
- </FSSpan>
23
- <FSSpan
24
- v-if="$props.subtitle"
25
- >
26
- {{ $props.subtitle }}
27
- </FSSpan>
28
- </FSCol>
29
- </slot>
30
- </template>
31
10
  <template
32
11
  #body
33
12
  >
@@ -203,11 +182,11 @@ export default defineComponent({
203
182
  const valid = ref(false);
204
183
 
205
184
  const height = computed(() => {
206
- const other = 24 + 24 // Paddings
207
- + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
208
- + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
209
- + (isMobileSized.value ? 36 : 40) // Footer
210
- + 64; // Debug mask
185
+ const other = 24 + 24 // Paddings
186
+ + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
187
+ + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
188
+ + (isMobileSized.value ? 36 : 40) // Footer
189
+ + 64; // Debug mask
211
190
  return `calc(90vh - ${other}px)`;
212
191
  });
213
192
 
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <FSDialogSubmit
3
+ :title="title"
3
4
  :rightButtonLabel="$tr('ui.button.remove', 'Remove')"
4
5
  :rightButtonColor="ColorEnum.Error"
5
- :title="title"
6
6
  :modelValue="$props.modelValue"
7
7
  @update:modelValue="$emit('update:modelValue', $event)"
8
8
  v-bind="$attrs"
@@ -42,6 +42,7 @@
42
42
  v-if="$props.removing"
43
43
  >
44
44
  <FSRow
45
+ padding="0 16px 0 0"
45
46
  align="center-right"
46
47
  :height="footerHeight"
47
48
  >
@@ -1,33 +1,12 @@
1
1
  <template>
2
2
  <FSDialog
3
+ :title="$props.title"
4
+ :subtitle="$props.subtitle"
3
5
  :width="$props.width"
4
6
  :modelValue="$props.modelValue"
5
7
  @update:modelValue="$emit('update:modelValue', $event)"
6
8
  v-bind="$attrs"
7
9
  >
8
- <template
9
- #header
10
- >
11
- <slot
12
- name="header"
13
- >
14
- <FSCol
15
- v-if="$props.title"
16
- padding="0 16px 0 0"
17
- >
18
- <FSSpan
19
- font="text-h2"
20
- >
21
- {{ $props.title }}
22
- </FSSpan>
23
- <FSSpan
24
- v-if="$props.subtitle"
25
- >
26
- {{ $props.subtitle }}
27
- </FSSpan>
28
- </FSCol>
29
- </slot>
30
- </template>
31
10
  <template
32
11
  #body
33
12
  >
@@ -183,11 +162,11 @@ export default defineComponent({
183
162
  const { $tr } = useTranslationsProvider();
184
163
 
185
164
  const height = computed(() => {
186
- const other = 24 + 24 // Paddings
187
- + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
188
- + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
189
- + (isMobileSized.value ? 36 : 40) // Footer
190
- + 64; // Debug mask
165
+ const other = 24 + 24 // Paddings
166
+ + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
167
+ + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
168
+ + (isMobileSized.value ? 36 : 40) // Footer
169
+ + 64; // Debug mask
191
170
  return `calc(90vh - ${other}px)`;
192
171
  });
193
172
 
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <div
3
- v-if="isEmpty"
4
- class="fs-divider"
3
+ v-if="isEmpty && !vertical"
4
+ class="fs-divider-horizontal"
5
+ :style="style"
6
+ />
7
+ <div
8
+ v-else-if="isEmpty && vertical"
9
+ class="fs-divider-vertical"
5
10
  :style="style"
6
11
  />
7
12
  <FSRow
@@ -48,7 +53,7 @@ export default defineComponent({
48
53
  required: false,
49
54
  default: null
50
55
  },
51
- width: {
56
+ size: {
52
57
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
53
58
  required: false,
54
59
  default: "100%"
@@ -63,6 +68,11 @@ export default defineComponent({
63
68
  required: false,
64
69
  default: "dark"
65
70
  },
71
+ vertical: {
72
+ type: Boolean as PropType<boolean>,
73
+ required: false,
74
+ default: false
75
+ },
66
76
  color: {
67
77
  type: String as PropType<ColorBase>,
68
78
  required: false,
@@ -78,15 +88,15 @@ export default defineComponent({
78
88
  const style = computed((): { [key: string] : string | undefined } => {
79
89
  switch (props.variant) {
80
90
  case "base": return {
81
- "--fs-divider-width": sizeToVar(props.width),
91
+ "--fs-divider-size" : sizeToVar(props.size),
82
92
  "--fs-divider-color": colors.value.base
83
93
  };
84
94
  case "light": return {
85
- "--fs-divider-width": sizeToVar(props.width),
95
+ "--fs-divider-size" : sizeToVar(props.size),
86
96
  "--fs-divider-color": colors.value.light
87
97
  };
88
98
  case "dark": return {
89
- "--fs-divider-width": sizeToVar(props.width),
99
+ "--fs-divider-size" : sizeToVar(props.size),
90
100
  "--fs-divider-color": colors.value.dark
91
101
  };
92
102
  }
@@ -3,16 +3,14 @@
3
3
  class="fs-fade-out"
4
4
  ref="fadeOutRef"
5
5
  :style="style"
6
- @scroll="onScroll"
6
+ @scroll="debounceMasks"
7
7
  >
8
- <div class="fs-fade-out-top" />
9
8
  <slot />
10
- <div class="fs-fade-out-bottom" />
11
9
  </div>
12
10
  </template>
13
11
 
14
12
  <script lang="ts">
15
- import { computed, defineComponent, onMounted, PropType, ref, watch } from "vue";
13
+ import { computed, defineComponent, onMounted, onUnmounted, PropType, ref, watch } from "vue";
16
14
 
17
15
  import { useBreakpoints, useColors, useDebounce } from "@dative-gpi/foundation-shared-components/composables";
18
16
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -43,7 +41,7 @@ export default defineComponent({
43
41
  },
44
42
  emits: ["scroll"],
45
43
  setup(props, { emit }) {
46
- const { windowWidth } = useBreakpoints();
44
+ const { windowHeight, windowWidth } = useBreakpoints();
47
45
  const { debounce } = useDebounce();
48
46
  const { getColors } = useColors();
49
47
 
@@ -54,6 +52,8 @@ export default defineComponent({
54
52
  const topMaskHeight = ref("0px");
55
53
  const lastScroll = ref(0);
56
54
 
55
+ const resizeObserver = ref<ResizeObserver | null>(null);
56
+
57
57
  const style = computed((): { [key: string] : string | undefined } => {
58
58
  return {
59
59
  "--fs-fade-out-height" : sizeToVar(props.height),
@@ -65,75 +65,65 @@ export default defineComponent({
65
65
  };
66
66
  });
67
67
 
68
- const onScroll = ({ target }): void => debounce(() => {
69
- const currentTopMaskHeight = target.children[0].clientHeight;
70
- const currentBottomMaskHeight = target.children[target.children.length - 1].clientHeight;
71
- const contentHeight = target.scrollHeight - currentTopMaskHeight - currentBottomMaskHeight;
72
-
73
- if (target.clientHeight >= contentHeight) {
74
- bottomMaskHeight.value = "0px";
75
- topMaskHeight.value = "0px";
76
- return;
77
- }
78
- if (target.scrollHeight - target.scrollTop - target.clientHeight < 1) {
79
- bottomMaskHeight.value = "0px";
80
- }
81
- else {
82
- bottomMaskHeight.value = sizeToVar(props.maskHeight);
83
- }
84
- if (target.scrollTop === 0) {
85
- topMaskHeight.value = "0px";
86
- }
87
- else {
88
- topMaskHeight.value = sizeToVar(props.maskHeight);
89
- }
90
-
91
- const event = {
92
- target,
93
- onTop: topMaskHeight.value === "0px",
94
- onBottom: bottomMaskHeight.value === "0px",
95
- goingUp: (currentTopMaskHeight !== 0 && bottomMaskHeight.value !== "0px") && target.scrollTop < lastScroll.value,
96
- };
97
-
98
- emit("scroll", event);
99
- lastScroll.value = target.scrollTop;
100
- }, 25);
101
-
102
- const onResize = (): void => debounce(() => {
68
+ const handleMasks = () => {
103
69
  if (fadeOutRef.value) {
104
- const currentTopMaskHeight = (fadeOutRef.value as any).children[0].clientHeight;
105
- const currentBottomMaskHeight = (fadeOutRef.value as any).children[(fadeOutRef.value as any).children.length - 1].clientHeight;
106
- const contentHeight = (fadeOutRef.value as any).scrollHeight - currentTopMaskHeight - currentBottomMaskHeight;
107
-
108
- if ((fadeOutRef.value as any).clientHeight < contentHeight) {
109
- if ((fadeOutRef.value as any).scrollHeight - (fadeOutRef.value as any).scrollTop - (fadeOutRef.value as any).clientHeight > 0) {
110
- bottomMaskHeight.value = sizeToVar(props.maskHeight);
111
- }
112
- if ((fadeOutRef.value as any).scrollTop > 0) {
113
- topMaskHeight.value = sizeToVar(props.maskHeight);
114
- }
70
+ if ((fadeOutRef.value as any).clientHeight >= (fadeOutRef.value as any).scrollHeight) {
71
+ bottomMaskHeight.value = "0px";
72
+ topMaskHeight.value = "0px";
73
+ return;
115
74
  }
116
- else {
75
+ if ((fadeOutRef.value as any).scrollHeight - (fadeOutRef.value as any).scrollTop - (fadeOutRef.value as any).clientHeight < 1) {
117
76
  bottomMaskHeight.value = "0px";
77
+ }
78
+ else {
79
+ bottomMaskHeight.value = sizeToVar(props.maskHeight);
80
+ }
81
+ if ((fadeOutRef.value as any).scrollTop === 0) {
118
82
  topMaskHeight.value = "0px";
119
83
  }
84
+ else {
85
+ topMaskHeight.value = sizeToVar(props.maskHeight);
86
+ }
87
+
88
+ const event = {
89
+ target: fadeOutRef.value,
90
+ onTop: topMaskHeight.value === "0px",
91
+ onBottom: bottomMaskHeight.value === "0px",
92
+ goingUp: (fadeOutRef.value as any).scrollTop < lastScroll.value,
93
+ };
94
+
95
+ emit("scroll", event);
96
+ lastScroll.value = (fadeOutRef.value as any).scrollTop;
120
97
  }
121
- }, 200);
98
+ };
99
+
100
+ const debounceMasks = (): void => debounce(handleMasks, 50);
122
101
 
123
102
  onMounted((): void => {
124
- if (fadeOutRef.value) {
125
- if ((fadeOutRef.value as any).clientHeight < (fadeOutRef.value as any).scrollHeight) {
126
- bottomMaskHeight.value = sizeToVar(props.maskHeight);
127
- }
103
+ debounceMasks();
104
+
105
+ resizeObserver.value = new ResizeObserver(entries => {
106
+ entries.forEach(() => {
107
+ debounceMasks();
108
+ });
109
+ });
110
+ if (document.querySelector(".fs-fade-out")) {
111
+ resizeObserver.value.observe(document.querySelector(".fs-fade-out")!);
112
+ }
113
+ });
114
+
115
+ onUnmounted((): void => {
116
+ if (resizeObserver.value) {
117
+ resizeObserver.value.disconnect();
128
118
  }
129
119
  });
130
120
 
131
- watch(() => windowWidth.value, onResize);
121
+ watch([() => windowWidth.value, () => windowHeight.value], debounceMasks);
132
122
 
133
123
  return {
134
124
  fadeOutRef,
135
125
  style,
136
- onScroll
126
+ debounceMasks
137
127
  };
138
128
  }
139
129
  });
@@ -6,7 +6,9 @@
6
6
  :style="style"
7
7
  v-bind="$attrs"
8
8
  >
9
- <template #prev>
9
+ <template
10
+ #prev
11
+ >
10
12
  <FSButton
11
13
  v-if="$props.dash"
12
14
  icon="mdi-chevron-double-left"
@@ -18,14 +20,21 @@
18
20
  @click="goToPrev"
19
21
  />
20
22
  </template>
21
- <template #default>
23
+ <template
24
+ #default
25
+ >
22
26
  <v-slide-group-item
23
- v-for="(component) in getChildren()"
27
+ v-for="(component, index) in getChildren()"
28
+ :key="index"
24
29
  >
25
- <component :is="component" />
30
+ <component
31
+ :is="component"
32
+ />
26
33
  </v-slide-group-item>
27
34
  </template>
28
- <template #next>
35
+ <template
36
+ #next
37
+ >
29
38
  <FSButtonNextIcon
30
39
  :color="ColorEnum.Dark"
31
40
  @click="goToNext"