@dative-gpi/foundation-shared-components 1.0.128 → 1.0.129

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.
@@ -3,7 +3,6 @@
3
3
  class="fs-fade-out"
4
4
  ref="fadeOutRef"
5
5
  :id="elementId"
6
- :style="style"
7
6
  @scroll="$emit('scroll', $event); debounceMasks()"
8
7
  >
9
8
  <slot />
@@ -11,7 +10,7 @@
11
10
  </template>
12
11
 
13
12
  <script lang="ts">
14
- import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, type StyleValue, watch } from "vue";
13
+ import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, watch } from "vue";
15
14
 
16
15
  import { useBreakpoints, useColors, useDebounce } from "@dative-gpi/foundation-shared-components/composables";
17
16
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -65,17 +64,21 @@ export default defineComponent({
65
64
  type: Boolean,
66
65
  required: false,
67
66
  default: false
67
+ },
68
+ style:{
69
+ type: Object,
70
+ required: false
68
71
  }
69
72
  },
70
73
  emits: ["scroll"],
71
74
  setup(props) {
72
- const { windowHeight, windowWidth } = useBreakpoints();
75
+ const { windowHeight, windowWidth, isTouchScreenEnabled } = useBreakpoints();
73
76
  const { debounce } = useDebounce();
74
77
  const { getColors } = useColors();
75
78
 
76
79
  const backgrounds = getColors(ColorEnum.Background);
77
80
 
78
- const fadeOutRef = ref(null);
81
+ const fadeOutRef = ref<HTMLElement | null>(null);
79
82
  const bottomMaskHeight = ref("0px");
80
83
  const topMaskHeight = ref("0px");
81
84
  const lastScroll = ref(0);
@@ -84,18 +87,21 @@ export default defineComponent({
84
87
 
85
88
  const elementId = `id${uuidv4()}`;
86
89
 
87
- const style = computed((): StyleValue => ({
90
+ const showOutsideScrollbar = computed(() => props.scrollOutside && !isTouchScreenEnabled);
91
+
92
+ const style = computed((): {[index: string]: string} => ({
88
93
  "--fs-fade-out-height" : props.height ? sizeToVar(props.height) : "initial",
89
94
  "--fs-fade-out-max-height" : props.maxHeight ? sizeToVar(props.maxHeight) : "initial",
90
95
  "--fs-fade-out-width" : sizeToVar(props.width),
91
96
  "--fs-fade-out-padding" : sizeToVar(props.padding),
92
- "--fs-fade-out-width-offset" : props.scrollOutside ? '12px' : '0px',
93
- "--fs-fade-out-padding-offset" : props.scrollOutside ? '4px' : '0px',
94
- "--fs-fade-out-margin-right" : props.scrollOutside ? '-12px' : '0px',
97
+ "--fs-fade-out-width-offset" : showOutsideScrollbar.value ? '12px' : '0px',
98
+ "--fs-fade-out-padding-offset" : showOutsideScrollbar.value ? '4px' : '0px',
99
+ "--fs-fade-out-margin-right" : showOutsideScrollbar.value ? '-12px' : '0px',
95
100
  "--fs-fade-out-mask-color" : backgrounds.base,
96
101
  "--fs-fade-out-top-mask-height" : props.disableTopMask ? '0px' : topMaskHeight.value,
97
102
  "--fs-fade-out-bottom-mask-height": props.disableBottomMask ? '0px' : bottomMaskHeight.value,
98
- "--fs-fade-out-x-overflow" : props.hideHorizontalOverflow ? 'hidden' : 'auto'
103
+ "--fs-fade-out-x-overflow" : props.hideHorizontalOverflow ? 'hidden' : 'auto',
104
+ ...props.style
99
105
  }));
100
106
 
101
107
  const handleMasks = () => {
@@ -146,6 +152,15 @@ export default defineComponent({
146
152
 
147
153
  watch([() => windowWidth.value, () => windowHeight.value], debounceMasks);
148
154
 
155
+ watch(() => [style.value, fadeOutRef.value], () => {
156
+ if(!fadeOutRef.value || !style.value) {
157
+ return;
158
+ }
159
+ for(const key in style.value){
160
+ fadeOutRef.value.style.setProperty(key, style.value[key])
161
+ }
162
+ }, { immediate: true})
163
+
149
164
  return {
150
165
  fadeOutRef,
151
166
  elementId,
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.128",
4
+ "version": "1.0.129",
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.128",
14
- "@dative-gpi/foundation-shared-services": "1.0.128"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.129",
14
+ "@dative-gpi/foundation-shared-services": "1.0.129"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "ca2de0b5abd0fb4f1fdfaafbc4267182ab609336"
38
+ "gitHead": "73ebbdb8cfd158e2748933ec57315bc1b5fc4835"
39
39
  }
@@ -1,73 +0,0 @@
1
- <template>
2
- <FSChartTileUI
3
- v-if="chart"
4
- :label="chart.label"
5
- :icon="chart.icon"
6
- :type="chart.chartType"
7
- :imageId="chart.imageId"
8
- v-bind="$attrs"
9
- />
10
- </template>
11
-
12
- <script lang="ts">
13
- import { defineComponent, watch, computed } from "vue";
14
- import type { PropType } from "vue";
15
-
16
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
17
- import { chartIcon } from "@dative-gpi/foundation-shared-components/tools";
18
-
19
- import { useChartOrganisation, useChartOrganisationType } from "@dative-gpi/foundation-core-services/composables";
20
-
21
- import { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
22
- import FSChartTileUI from "./FSChartTileUI.vue";
23
-
24
- export default defineComponent({
25
- name: "FSChartTile",
26
- components: {
27
- FSChartTileUI
28
- },
29
- props: {
30
- chartId: {
31
- type: String,
32
- required: true
33
- },
34
- scope: {
35
- type: Object as PropType<ApplicationScope | number>,
36
- required : true
37
- }
38
- },
39
- setup(props) {
40
-
41
- const {get : fetchChartOrganisation, entity : chartOrganisation } = useChartOrganisation();
42
- const {get : fetchChartOrganisationType, entity : chartOrganisationType } = useChartOrganisationType();
43
-
44
- const chart = computed(() =>{
45
- if(props.scope == ApplicationScope.Organisation){
46
- return chartOrganisation.value;
47
- }
48
- else if(props.scope == ApplicationScope.OrganisationType){
49
- return chartOrganisationType.value;
50
- }
51
- else{
52
- return null
53
- }
54
- })
55
-
56
- watch(() => [props.chartId, props.scope], () =>{
57
- if(props.scope == ApplicationScope.Organisation){
58
- fetchChartOrganisation(props.chartId);
59
- }
60
- else if(props.scope == ApplicationScope.OrganisationType)
61
- {
62
- fetchChartOrganisationType(props.chartId)
63
- }
64
- }, {immediate : true})
65
-
66
- return {
67
- ColorEnum,
68
- chart,
69
- chartIcon
70
- };
71
- }
72
- });
73
- </script>