@dative-gpi/foundation-shared-components 1.0.71 → 1.0.73

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.
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <v-breadcrumbs
3
+ class="fs-breadcrumbs"
3
4
  :items="$props.items"
4
5
  :style="style"
5
6
  v-bind="$attrs"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSCard
3
- padding="24px 8px 24px 24px"
3
+ padding="24px"
4
4
  gap="24px"
5
5
  :class="$props.cardClasses"
6
6
  :color="$props.color"
@@ -9,9 +9,7 @@
9
9
  <template
10
10
  #header
11
11
  >
12
- <FSCol
13
- padding="0 16px 0 0"
14
- >
12
+ <FSCol>
15
13
  <FSRow
16
14
  align="center-left"
17
15
  :wrap="false"
@@ -12,16 +12,13 @@
12
12
  gap="24px"
13
13
  >
14
14
  <FSFadeOut
15
- padding="0 8px 0 0"
16
15
  :maxHeight="maxHeight"
17
16
  >
18
17
  <slot
19
18
  name="body"
20
19
  />
21
20
  </FSFadeOut>
22
- <FSRow
23
- padding="0 16px 0 0"
24
- >
21
+ <FSRow>
25
22
  <slot
26
23
  name="left-footer"
27
24
  />
@@ -60,16 +57,13 @@
60
57
  gap="24px"
61
58
  >
62
59
  <FSFadeOut
63
- padding="0 8px 0 0"
64
60
  :maxHeight="maxHeight"
65
61
  >
66
62
  <slot
67
63
  name="validation"
68
64
  />
69
65
  </FSFadeOut>
70
- <FSRow
71
- padding="0 16px 0 0"
72
- >
66
+ <FSRow>
73
67
  <slot
74
68
  name="left-footer"
75
69
  />
@@ -22,16 +22,13 @@
22
22
  gap="24px"
23
23
  >
24
24
  <FSFadeOut
25
- padding="0 8px 0 0"
26
25
  :maxHeight="maxHeight"
27
26
  >
28
27
  <slot
29
28
  :name="`step-${step}`"
30
29
  />
31
30
  </FSFadeOut>
32
- <FSRow
33
- padding="0 16px 0 0"
34
- >
31
+ <FSRow>
35
32
  <slot
36
33
  name="left-footer"
37
34
  />
@@ -43,7 +43,6 @@
43
43
  v-if="$props.removing"
44
44
  >
45
45
  <FSRow
46
- padding="0 16px 0 0"
47
46
  align="center-right"
48
47
  :height="footerHeight"
49
48
  >
@@ -11,7 +11,6 @@
11
11
  #body
12
12
  >
13
13
  <FSFadeOut
14
- padding="0 8px 0 0"
15
14
  :maxHeight="maxHeight"
16
15
  >
17
16
  <slot
@@ -25,9 +24,7 @@
25
24
  <slot
26
25
  name="footer"
27
26
  >
28
- <FSRow
29
- padding="0 16px 0 0"
30
- >
27
+ <FSRow>
31
28
  <slot
32
29
  name="left-footer"
33
30
  />
@@ -4,7 +4,7 @@
4
4
  ref="fadeOutRef"
5
5
  :id="elementId"
6
6
  :style="style"
7
- @scroll="debounceMasks"
7
+ @scroll="$emit('scroll', $event); debounceMasks()"
8
8
  >
9
9
  <slot />
10
10
  </div>
@@ -45,10 +45,25 @@ export default defineComponent({
45
45
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
46
46
  required: false,
47
47
  default: "64px"
48
+ },
49
+ scrollOutside: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: true
53
+ },
54
+ disableTopMask: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false
58
+ },
59
+ disableBottomMask: {
60
+ type: Boolean,
61
+ required: false,
62
+ default: false
48
63
  }
49
64
  },
50
65
  emits: ["scroll"],
51
- setup(props, { emit }) {
66
+ setup(props) {
52
67
  const { windowHeight, windowWidth } = useBreakpoints();
53
68
  const { debounce } = useDebounce();
54
69
  const { getColors } = useColors();
@@ -69,9 +84,11 @@ export default defineComponent({
69
84
  "--fs-fade-out-max-height" : props.maxHeight ? sizeToVar(props.maxHeight) : undefined,
70
85
  "--fs-fade-out-width" : sizeToVar(props.width),
71
86
  "--fs-fade-out-padding" : sizeToVar(props.padding),
87
+ "--fs-fade-out-with-offset" : props.scrollOutside ? '12px' : '0px',
88
+ "--fs-fade-out-padding-offset" : props.scrollOutside ? '4px' : '0px',
72
89
  "--fs-fade-out-mask-color" : backgrounds.base,
73
- "--fs-fade-out-top-mask-height" : topMaskHeight.value,
74
- "--fs-fade-out-bottom-mask-height": bottomMaskHeight.value
90
+ "--fs-fade-out-top-mask-height" : props.disableTopMask ? '0px' : topMaskHeight.value,
91
+ "--fs-fade-out-bottom-mask-height": props.disableBottomMask ? '0px' : bottomMaskHeight.value
75
92
  }));
76
93
 
77
94
  const handleMasks = () => {
@@ -94,19 +111,19 @@ export default defineComponent({
94
111
  topMaskHeight.value = sizeToVar(props.maskHeight);
95
112
  }
96
113
 
97
- const event = {
98
- target: fadeOutRef.value,
99
- onTop: topMaskHeight.value === "0px",
100
- onBottom: bottomMaskHeight.value === "0px",
101
- goingUp: (fadeOutRef.value as any).scrollTop < lastScroll.value,
102
- };
114
+ // const event = {
115
+ // target: fadeOutRef.value,
116
+ // onTop: topMaskHeight.value === "0px",
117
+ // onBottom: bottomMaskHeight.value === "0px",
118
+ // goingUp: (fadeOutRef.value as any).scrollTop < lastScroll.value,
119
+ // };
103
120
 
104
- emit("scroll", event);
121
+ // emit("scroll", event);
105
122
  lastScroll.value = (fadeOutRef.value as any).scrollTop;
106
123
  }
107
124
  };
108
125
 
109
- const debounceMasks = (): void => debounce(handleMasks, 50);
126
+ const debounceMasks = (): void => debounce(handleMasks, 1);
110
127
 
111
128
  onMounted((): void => {
112
129
  debounceMasks();
@@ -23,11 +23,10 @@
23
23
  :border="false"
24
24
  >
25
25
  <FSCol
26
- padding="16px 0 24px 16px"
26
+ padding="20px"
27
27
  gap="12px"
28
28
  >
29
29
  <FSCol
30
- padding="0 16px 0 0"
31
30
  gap="12px"
32
31
  >
33
32
  <FSSpan
@@ -44,17 +43,15 @@
44
43
  :editable="true"
45
44
  @click="onToggleAll"
46
45
  />
47
- <FSDivider
48
- padding="0 8px 0 0"
49
- />
46
+ <FSDivider />
50
47
  <FSSearchField
48
+ :hideHeader="true"
51
49
  class="fs-filter-button-search"
52
50
  prependInnerIcon="mdi-magnify"
53
51
  v-model="search"
54
52
  />
55
53
  </FSCol>
56
54
  <FSFadeOut
57
- padding="0 8px 0 0"
58
55
  maxHeight="360px"
59
56
  >
60
57
  <FSCol
@@ -21,11 +21,10 @@
21
21
  :border="false"
22
22
  >
23
23
  <FSCol
24
- padding="16px 0px 24px 16px"
24
+ padding="24px"
25
25
  gap="12px"
26
26
  >
27
27
  <FSCol
28
- padding="0 16px 0 0"
29
28
  gap="12px"
30
29
  >
31
30
  <FSSpan
@@ -35,7 +34,6 @@
35
34
  </FSSpan>
36
35
  </FSCol>
37
36
  <FSFadeOut
38
- padding="0 8px 0 0"
39
37
  maxHeight="360px"
40
38
  >
41
39
  <FSCol
@@ -5,14 +5,12 @@
5
5
  >
6
6
  <FSSearchField
7
7
  v-if="$props.searchable"
8
- padding="0 12px 0 0"
9
8
  :hideHeader="true"
10
9
  :modelValue="actualSearch"
11
10
  placeholder="Search"
12
11
  @update:modelValue="onSearch"
13
12
  />
14
13
  <FSFadeOut
15
- padding="0 4px 0 0"
16
14
  :maxHeight="$props.maxHeight"
17
15
  :maskHeight="0"
18
16
  >
@@ -16,7 +16,6 @@
16
16
  >
17
17
  <FSRow
18
18
  align="center-center"
19
- padding="0 16px 0 0"
20
19
  >
21
20
  <FSImageCard
22
21
  v-for="layer in layers"
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <FSBaseMobileView
3
+ v-if="isExtraSmall"
4
+ :variant="$props.variant"
5
+ v-bind="$attrs"
6
+ >
7
+ <template
8
+ v-for="(_, name) in $slots"
9
+ v-slot:[name]="slotData"
10
+ >
11
+ <slot
12
+ :name="name"
13
+ v-bind="slotData"
14
+ />
15
+ </template>
16
+ </FSBaseMobileView>
17
+
18
+ <FSBaseDesktopView
19
+ v-else
20
+ :variant="$props.variant"
21
+ v-bind="$attrs"
22
+ >
23
+ <template
24
+ v-for="(_, name) in $slots"
25
+ v-slot:[name]="slotData"
26
+ >
27
+ <slot
28
+ :name="name"
29
+ v-bind="slotData"
30
+ />
31
+ </template>
32
+ </FSBaseDesktopView>
33
+ </template>
34
+
35
+ <script lang="ts">
36
+ import { defineComponent, type PropType } from "vue";
37
+
38
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
39
+
40
+ import FSBaseDesktopView from "./desktop/FSBaseDesktopView.vue";
41
+ import FSBaseMobileView from "./mobile/FSBaseMobileView.vue";
42
+
43
+ export default defineComponent({
44
+ name: "FSBaseView",
45
+ components: {
46
+ FSBaseDesktopView,
47
+ FSBaseMobileView
48
+ },
49
+ props: {
50
+ variant: {
51
+ type: String as PropType<"default" | "entity">,
52
+ required: true,
53
+ default: "default"
54
+ }
55
+ },
56
+ setup() {
57
+ const { isExtraSmall } = useBreakpoints();
58
+
59
+ return {
60
+ isExtraSmall
61
+ };
62
+ }
63
+ });
64
+ </script>
@@ -1,163 +1,29 @@
1
1
  <template>
2
- <FSSkeletonView>
2
+ <FSBaseView
3
+ variant="entity"
4
+ v-bind="$attrs"
5
+ >
3
6
  <template
4
- #header
7
+ v-for="(_, name) in $slots"
8
+ v-slot:[name]="slotData"
5
9
  >
6
- <FSEntityHeader
7
- ref="headerRef"
8
- :breadcrumbs="$props.breadcrumbs"
9
- :description="$props.description"
10
- :subtitle="$props.subtitle"
11
- :title="$props.title"
12
- :light="lightHeader"
13
- :imageId="imageId"
14
- :iconBackgroundVariant="$props.iconBackgroundVariant"
15
- :icon="$props.icon"
16
- :color="$props.color"
17
- :iconBackgroundColors="$props.iconBackgroundColors"
18
- :imageCover="$props.imageCover"
19
- >
20
- <template
21
- v-if="$slots.image"
22
- #image="props"
23
- >
24
- <slot
25
- name="image"
26
- v-bind="props"
27
- />
28
- </template>
29
- <template
30
- #title-append
31
- >
32
- <slot
33
- name="title-append"
34
- />
35
- </template>
36
- <template
37
- #toolbar
38
- v-if="slots['toolbar']"
39
- >
40
- <slot
41
- name="toolbar"
42
- />
43
- </template>
44
- </FSEntityHeader>
45
- </template>
46
- <template
47
- #default
48
- >
49
- <!-- <FSFadeOut
50
- padding="0 8px 0 0"
51
- :height="height"
52
- @scroll="onScroll"
53
- > -->
54
10
  <slot
55
- name="default"
11
+ :name="name"
12
+ v-bind="slotData"
56
13
  />
57
- <!-- </FSFadeOut> -->
58
14
  </template>
59
- </FSSkeletonView>
15
+ </FSBaseView>
60
16
  </template>
61
17
 
62
18
  <script lang="ts">
63
- import { computed, defineComponent, type PropType, ref } from "vue";
19
+ import { defineComponent } from "vue";
64
20
 
65
- import { type ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
66
- import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
67
-
68
- import FSEntityHeader from "./FSEntityHeader.vue";
69
- import FSSkeletonView from "./FSSkeletonView.vue";
70
- // import FSFadeOut from "../FSFadeOut.vue";
21
+ import FSBaseView from "./FSBaseView.vue";
71
22
 
72
23
  export default defineComponent({
73
24
  name: "FSEntityView",
74
25
  components: {
75
- FSEntityHeader,
76
- FSSkeletonView
77
- // FSFadeOut
78
- },
79
- props: {
80
- imageId: {
81
- type: String as PropType<string | null>,
82
- required: false,
83
- default: null
84
- },
85
- imageCover: {
86
- type: Boolean,
87
- required: false,
88
- default: true
89
- },
90
- icon: {
91
- type: String as PropType<string | null>,
92
- required: false,
93
- default: null
94
- },
95
- color : {
96
- type: Object as PropType<ColorEnum | null>,
97
- required: false,
98
- default: null
99
- },
100
- iconBackgroundColors: {
101
- type: Array as PropType<string[]>,
102
- required: false,
103
- default: () => []
104
- },
105
- title: {
106
- type: String as PropType<string | null>,
107
- required: false,
108
- default: null
109
- },
110
- subtitle: {
111
- type: String as PropType<string | null>,
112
- required: false,
113
- default: null
114
- },
115
- description: {
116
- type: String as PropType<string | null>,
117
- required: false,
118
- default: null
119
- },
120
- breadcrumbs: {
121
- type: Array as PropType<FSBreadcrumbItem[]>,
122
- required: false,
123
- default: () => []
124
- },
125
- iconBackgroundVariant: {
126
- type: String as PropType<"background" | "standard" | "full" | "gradient">,
127
- required: false,
128
- default: "background"
129
- }
130
- },
131
- setup() {
132
- const { isExtraSmall, windowHeight } = useBreakpoints();
133
- const { slots } = useSlots();
134
-
135
- const headerRef = ref<HTMLElement | null>(null);
136
-
137
- const lightHeader = ref(false);
138
-
139
- const height = computed((): string => {
140
- let other = isExtraSmall.value ? 16 + 16 : 24 + 24; // Paddings
141
-
142
- return `${windowHeight.value - other}px`;
143
- });
144
-
145
- // const onScroll = (event: any): void => {
146
- // if (event.onTop) {
147
- // lightHeader.value = false;
148
- // }
149
- // else if (event.target.scrollTop > (headerRef.value as any)?.$el.clientHeight) {
150
- // lightHeader.value = true;
151
- // }
152
- // };
153
-
154
- return {
155
- lightHeader,
156
- headerRef,
157
- height,
158
- slots
159
- // onScroll
160
- };
26
+ FSBaseView
161
27
  }
162
28
  });
163
29
  </script>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <FSBaseView
3
+ variant="default"
4
+ v-bind="$attrs"
5
+ >
6
+ <template
7
+ v-for="(_, name) in $slots"
8
+ v-slot:[name]="slotData"
9
+ >
10
+ <slot
11
+ :name="name"
12
+ v-bind="slotData"
13
+ />
14
+ </template>
15
+ </FSBaseView>
16
+ </template>
17
+
18
+ <script lang="ts">
19
+ import { defineComponent } from "vue";
20
+
21
+ import FSBaseView from "./FSBaseView.vue";
22
+
23
+ export default defineComponent({
24
+ name: "FSEntityView",
25
+ components: {
26
+ FSBaseView
27
+ },
28
+ });
29
+ </script>
@@ -0,0 +1,132 @@
1
+ <template>
2
+ <FSFadeOut
3
+ height="100%"
4
+ maxHeight="100%"
5
+ :scrollOutside="false"
6
+ :disableTopMask="true"
7
+ >
8
+ <FSCol
9
+ height="fill"
10
+ gap="0px"
11
+ >
12
+ <slot
13
+ name="header"
14
+ >
15
+
16
+ <FSRow
17
+ padding="24px 16px 16px 24px"
18
+ style="position: sticky; top: 0px; z-index: 1;"
19
+ :style="{ backgroundColor, marginTop: $props.stickyTitleTopOffset }"
20
+ >
21
+ <slot
22
+ name="title"
23
+ >
24
+ <FSText
25
+ font="text-h2"
26
+ >
27
+ {{ $props.title }}
28
+ </FSText>
29
+ </slot>
30
+ </FSRow>
31
+ <FSCol
32
+ v-if="$props.breadcrumbs && $props.breadcrumbs.length > 0"
33
+ :padding="$slots.toolbar ? '0px 24px 8px 24px' : '0px 24px'"
34
+ gap="16px"
35
+ >
36
+ <FSCol>
37
+ <slot
38
+ name="breadcrumbs"
39
+ >
40
+ <FSBreadcrumbs
41
+ :items="$props.breadcrumbs"
42
+ />
43
+ </slot>
44
+ </FSCol>
45
+ </FSCol>
46
+ <FSRow
47
+ v-if="$slots.toolbar"
48
+ padding="0px 16px 8px 24px"
49
+ :style="stickyToolbar ? `position: sticky; top: ${$props.toolbarTopOffset}; z-index: 1; background-color: ${backgroundColor}` : undefined"
50
+ >
51
+ <FSSlideGroup>
52
+ <slot
53
+ name="toolbar"
54
+ />
55
+ </FSSlideGroup>
56
+ </FSRow>
57
+ </slot>
58
+
59
+ <FSCol
60
+ height="fill"
61
+ :padding="$slots.toolbar ? '8px 16px 24px 24px' : '16px 16px 24px 24px'"
62
+ gap="0px"
63
+ >
64
+ <slot />
65
+ </FSCol>
66
+ </FSCol>
67
+ </FSFadeOut>
68
+ </template>
69
+
70
+ <script lang="ts">
71
+ import { defineComponent, type PropType, computed } from "vue";
72
+
73
+ import { type FSBreadcrumbItem, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
74
+
75
+ import { useColors } from "../../../composables"
76
+
77
+ import FSCol from "../../FSCol.vue";
78
+ import FSRow from "../../FSRow.vue"
79
+ import FSText from "../../FSText.vue";
80
+ import FSBreadcrumbs from "../../FSBreadcrumbs.vue";
81
+ import FSSlideGroup from "../../FSSlideGroup.vue";
82
+ import FSFadeOut from "../../FSFadeOut.vue"
83
+
84
+ export default defineComponent({
85
+ name: "FSBaseDefaultDesktopView",
86
+ components: {
87
+ FSCol,
88
+ FSRow,
89
+ FSText,
90
+ FSBreadcrumbs,
91
+ FSSlideGroup,
92
+ FSFadeOut
93
+ },
94
+ props: {
95
+ title: {
96
+ type: String,
97
+ required: false
98
+ },
99
+ breadcrumbs: {
100
+ type: Array as PropType<FSBreadcrumbItem[]>,
101
+ required: false,
102
+ default: () => []
103
+ },
104
+ stickyToolbar: {
105
+ type: Boolean,
106
+ required: false,
107
+ default: true
108
+ },
109
+ toolbarTopOffset: {
110
+ type: String,
111
+ required: false,
112
+ default: "72px"
113
+ },
114
+ stickyTitleTopOffset: {
115
+ type: String,
116
+ required: false,
117
+ default: "0px"
118
+ }
119
+ },
120
+ setup(){
121
+ const { getColors } = useColors();
122
+
123
+ const backgroundColor = computed(() => {
124
+ return getColors(ColorEnum.Background).base;
125
+ });
126
+
127
+ return {
128
+ backgroundColor
129
+ }
130
+ }
131
+ });
132
+ </script>