@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.
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <FSBaseDefaultDesktopView
3
+ v-if="$props.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
+ </FSBaseDefaultDesktopView>
16
+
17
+ <FSBaseEntityDesktopView
18
+ v-if="$props.variant === 'entity'"
19
+ v-bind="$attrs"
20
+ >
21
+ <template
22
+ v-for="(_, name) in $slots"
23
+ v-slot:[name]="slotData"
24
+ >
25
+ <slot
26
+ :name="name"
27
+ v-bind="slotData"
28
+ />
29
+ </template>
30
+ </FSBaseEntityDesktopView>
31
+ </template>
32
+
33
+ <script lang="ts">
34
+ import { defineComponent, type PropType } from "vue";
35
+
36
+ import FSBaseDefaultDesktopView from "./FSBaseDefaultDesktopView.vue";
37
+ import FSBaseEntityDesktopView from "./FSBaseEntityDesktopView.vue";
38
+
39
+ export default defineComponent({
40
+ name: "FSBaseDesktopView",
41
+ components: {
42
+ FSBaseDefaultDesktopView,
43
+ FSBaseEntityDesktopView
44
+ },
45
+ props: {
46
+ variant: {
47
+ type: String as PropType<"default" | "entity">,
48
+ required: false,
49
+ default: "default"
50
+ }
51
+ }
52
+ });
53
+ </script>
@@ -0,0 +1,199 @@
1
+ <template>
2
+ <FSBaseDefaultDesktopView
3
+ :toolbarTopOffset="topOffset + 'px'"
4
+ :stickyTitleTopOffset="topOffset + 'px'"
5
+ @scroll="onScroll"
6
+ >
7
+ <template
8
+ #title
9
+ >
10
+ <FSRow
11
+ gap="24px"
12
+ :wrap="false"
13
+ >
14
+ <FSImage
15
+ v-if="$props.imageId"
16
+ :imageId="$props.imageId"
17
+ :cover="$props.imageCover"
18
+ :height="actualImageSize"
19
+ :width="actualImageSize"
20
+ />
21
+ <FSIconCard
22
+ v-else-if="$props.icon"
23
+ :backgroundVariant="$props.iconBackgroundVariant"
24
+ :backgroundColor="$props.iconBackgroundColors"
25
+ :border="$props.iconBorder"
26
+ :icon="$props.icon"
27
+ :iconColor="$props.color"
28
+ :size="actualImageSize"
29
+ />
30
+ <FSCol
31
+ align="center-left"
32
+ height="fill"
33
+ >
34
+ <slot
35
+ name="title"
36
+ >
37
+ <FSText
38
+ font="text-h3"
39
+ >
40
+ {{ $props.title }}
41
+ </FSText>
42
+ <slot
43
+ name="title-extra"
44
+ v-bind="{ topOffset }"
45
+ >
46
+ <slot
47
+ name="subtitle"
48
+ >
49
+ <FSText
50
+ v-if="$props.subtitle && topOffset < 60"
51
+ font="text-button"
52
+ >
53
+ {{ $props.subtitle }}
54
+ </FSText>
55
+ </slot>
56
+ <slot
57
+ name="description"
58
+ >
59
+ <FSText
60
+ v-if="$props.description && topOffset < 20"
61
+ font="text-body"
62
+ >
63
+ {{ $props.description }}
64
+ </FSText>
65
+ </slot>
66
+ </slot>
67
+ </slot>
68
+ </FSCol>
69
+ </FSRow>
70
+ </template>
71
+
72
+ <template
73
+ v-for="(_, name) in slots"
74
+ v-slot:[name]="slotData"
75
+ >
76
+ <slot
77
+ :name="name"
78
+ v-bind="slotData"
79
+ />
80
+ </template>
81
+ </FSBaseDefaultDesktopView>
82
+ </template>
83
+
84
+ <script lang="ts">
85
+ import { defineComponent, useSlots, type PropType, computed, ref } from "vue";
86
+
87
+ import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
88
+
89
+ import { sizeToVar } from "../../../utils"
90
+
91
+ import FSCol from "../../FSCol.vue";
92
+ import FSRow from "../../FSRow.vue"
93
+ import FSText from "../../FSText.vue";
94
+ import FSImage from "../../FSImage.vue";
95
+ import FSIconCard from "../../FSIconCard.vue"
96
+
97
+ import FSBaseDefaultDesktopView from "./FSBaseDefaultDesktopView.vue";
98
+
99
+ export default defineComponent({
100
+ name: "FSBaseEntityDesktopView",
101
+ components: {
102
+ FSCol,
103
+ FSRow,
104
+ FSText,
105
+ FSBaseDefaultDesktopView,
106
+ FSImage,
107
+ FSIconCard,
108
+ },
109
+ props: {
110
+ title: {
111
+ type: String,
112
+ required: false
113
+ },
114
+ subtitle: {
115
+ type: String,
116
+ required: false
117
+ },
118
+ description: {
119
+ type: String,
120
+ required: false
121
+ },
122
+ imageId: {
123
+ type: String as PropType<string | null>,
124
+ required: false,
125
+ default: null
126
+ },
127
+ imageCover: {
128
+ type: Boolean,
129
+ required: false,
130
+ default: true
131
+ },
132
+ imageSize: {
133
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
134
+ required: false,
135
+ default: () => ["124px", "96px", "80px"]
136
+ },
137
+ color: {
138
+ type: String as PropType<ColorBase>,
139
+ required: false,
140
+ default: null
141
+ },
142
+ icon: {
143
+ type: String as PropType<string>,
144
+ required: false,
145
+ default: "mdi-ab-testing"
146
+ },
147
+ iconBackgroundVariant: {
148
+ type: String as PropType<"background" | "standard" | "full" | "gradient">,
149
+ required: false,
150
+ default: "background"
151
+ },
152
+ iconBackgroundColors: {
153
+ type: Array as PropType<string[]>,
154
+ required: false,
155
+ default: () => []
156
+ },
157
+ iconBorder: {
158
+ type: Boolean as PropType<boolean>,
159
+ required: false,
160
+ default: true
161
+ },
162
+ minImageSize: {
163
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
164
+ required: false,
165
+ default: () => ["48px", "48px", "48px"]
166
+ }
167
+ },
168
+ setup(props){
169
+ const slots = { ...useSlots() };
170
+
171
+ const topOffset = ref(0);
172
+
173
+ const actualImageSize = computed(() => {
174
+ const size = sizeToVar(props.imageSize);
175
+ const minSize = sizeToVar(props.minImageSize);
176
+ return `max(calc(${size} - ${topOffset.value}px), ${minSize})`;
177
+ });
178
+
179
+ const onScroll = (event: Event) => {
180
+ const actualScrollTop = (event.target as HTMLElement).scrollTop;
181
+
182
+ const minSize = sizeToVar(props.minImageSize);
183
+ const actualMinSize = parseInt(minSize);
184
+
185
+ topOffset.value = Math.max(0, Math.min(actualScrollTop, actualMinSize + 16 + 24));
186
+ }
187
+
188
+
189
+ delete slots.title;
190
+
191
+ return {
192
+ slots,
193
+ onScroll,
194
+ topOffset,
195
+ actualImageSize
196
+ }
197
+ }
198
+ });
199
+ </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>
@@ -0,0 +1,199 @@
1
+ <template>
2
+ <FSBaseDefaultMobileView
3
+ :toolbarTopOffset="topOffset + 'px'"
4
+ :stickyTitleTopOffset="topOffset + 'px'"
5
+ @scroll="onScroll"
6
+ >
7
+ <template
8
+ #title
9
+ >
10
+ <FSRow
11
+ gap="24px"
12
+ :wrap="false"
13
+ >
14
+ <FSImage
15
+ v-if="$props.imageId"
16
+ :imageId="$props.imageId"
17
+ :cover="$props.imageCover"
18
+ :height="actualImageSize"
19
+ :width="actualImageSize"
20
+ />
21
+ <FSIconCard
22
+ v-else-if="$props.icon"
23
+ :backgroundVariant="$props.iconBackgroundVariant"
24
+ :backgroundColor="$props.iconBackgroundColors"
25
+ :border="$props.iconBorder"
26
+ :icon="$props.icon"
27
+ :iconColor="$props.color"
28
+ :size="actualImageSize"
29
+ />
30
+ <FSCol
31
+ align="center-left"
32
+ height="fill"
33
+ >
34
+ <slot
35
+ name="title"
36
+ >
37
+ <FSText
38
+ font="text-h3"
39
+ >
40
+ {{ $props.title }}
41
+ </FSText>
42
+ <slot
43
+ name="title-extra"
44
+ v-bind="{ topOffset }"
45
+ >
46
+ <slot
47
+ name="subtitle"
48
+ >
49
+ <FSText
50
+ v-if="$props.subtitle && topOffset < 60"
51
+ font="text-button"
52
+ >
53
+ {{ $props.subtitle }}
54
+ </FSText>
55
+ </slot>
56
+ <slot
57
+ name="description"
58
+ >
59
+ <FSText
60
+ v-if="$props.description && topOffset < 20"
61
+ font="text-body"
62
+ >
63
+ {{ $props.description }}
64
+ </FSText>
65
+ </slot>
66
+ </slot>
67
+ </slot>
68
+ </FSCol>
69
+ </FSRow>
70
+ </template>
71
+
72
+ <template
73
+ v-for="(_, name) in slots"
74
+ v-slot:[name]="slotData"
75
+ >
76
+ <slot
77
+ :name="name"
78
+ v-bind="slotData"
79
+ />
80
+ </template>
81
+ </FSBaseDefaultMobileView>
82
+ </template>
83
+
84
+ <script lang="ts">
85
+ import { defineComponent, useSlots, type PropType, computed, ref } from "vue";
86
+
87
+ import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
88
+
89
+ import { sizeToVar } from "../../../utils"
90
+
91
+ import FSCol from "../../FSCol.vue";
92
+ import FSRow from "../../FSRow.vue"
93
+ import FSText from "../../FSText.vue";
94
+ import FSImage from "../../FSImage.vue";
95
+ import FSIconCard from "../../FSIconCard.vue"
96
+
97
+ import FSBaseDefaultMobileView from "./FSBaseDefaultMobileView.vue";
98
+
99
+ export default defineComponent({
100
+ name: "FSBaseEntityMobileView",
101
+ components: {
102
+ FSCol,
103
+ FSRow,
104
+ FSText,
105
+ FSBaseDefaultMobileView,
106
+ FSImage,
107
+ FSIconCard,
108
+ },
109
+ props: {
110
+ title: {
111
+ type: String,
112
+ required: false
113
+ },
114
+ subtitle: {
115
+ type: String,
116
+ required: false
117
+ },
118
+ description: {
119
+ type: String,
120
+ required: false
121
+ },
122
+ imageId: {
123
+ type: String as PropType<string | null>,
124
+ required: false,
125
+ default: null
126
+ },
127
+ imageCover: {
128
+ type: Boolean,
129
+ required: false,
130
+ default: true
131
+ },
132
+ imageSize: {
133
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
134
+ required: false,
135
+ default: () => ["124px", "96px", "80px"]
136
+ },
137
+ color: {
138
+ type: String as PropType<ColorBase>,
139
+ required: false,
140
+ default: null
141
+ },
142
+ icon: {
143
+ type: String as PropType<string>,
144
+ required: false,
145
+ default: "mdi-ab-testing"
146
+ },
147
+ iconBackgroundVariant: {
148
+ type: String as PropType<"background" | "standard" | "full" | "gradient">,
149
+ required: false,
150
+ default: "background"
151
+ },
152
+ iconBackgroundColors: {
153
+ type: Array as PropType<string[]>,
154
+ required: false,
155
+ default: () => []
156
+ },
157
+ iconBorder: {
158
+ type: Boolean as PropType<boolean>,
159
+ required: false,
160
+ default: true
161
+ },
162
+ minImageSize: {
163
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
164
+ required: false,
165
+ default: () => ["48px", "48px", "48px"]
166
+ }
167
+ },
168
+ setup(props){
169
+ const slots = { ...useSlots() };
170
+
171
+ const topOffset = ref(0);
172
+
173
+ const actualImageSize = computed(() => {
174
+ const size = sizeToVar(props.imageSize);
175
+ const minSize = sizeToVar(props.minImageSize);
176
+ return `max(calc(${size} - ${topOffset.value}px), ${minSize})`;
177
+ });
178
+
179
+ const onScroll = (event: Event) => {
180
+ const actualScrollTop = (event.target as HTMLElement).scrollTop;
181
+
182
+ const minSize = sizeToVar(props.minImageSize);
183
+ const actualMinSize = parseInt(minSize);
184
+
185
+ topOffset.value = Math.max(0, Math.min(actualScrollTop, actualMinSize + 16 + 24));
186
+ }
187
+
188
+
189
+ delete slots.title;
190
+
191
+ return {
192
+ slots,
193
+ onScroll,
194
+ topOffset,
195
+ actualImageSize
196
+ }
197
+ }
198
+ });
199
+ </script>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <FSBaseDefaultMobileView
3
+ v-if="$props.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
+ </FSBaseDefaultMobileView>
16
+
17
+ <FSBaseEntityMobileView
18
+ v-if="$props.variant === 'entity'"
19
+ v-bind="$attrs"
20
+ >
21
+ <template
22
+ v-for="(_, name) in $slots"
23
+ v-slot:[name]="slotData"
24
+ >
25
+ <slot
26
+ :name="name"
27
+ v-bind="slotData"
28
+ />
29
+ </template>
30
+ </FSBaseEntityMobileView>
31
+ </template>
32
+
33
+ <script lang="ts">
34
+ import { defineComponent, type PropType } from "vue";
35
+
36
+ import FSBaseDefaultMobileView from "./FSBaseDefaultMobileView.vue";
37
+ import FSBaseEntityMobileView from "./FSBaseEntityMobileView.vue";
38
+
39
+ export default defineComponent({
40
+ name: "FSBaseMobileView",
41
+ components: {
42
+ FSBaseDefaultMobileView,
43
+ FSBaseEntityMobileView
44
+ },
45
+ props: {
46
+ variant: {
47
+ type: String as PropType<"default" | "entity">,
48
+ required: false,
49
+ default: "default"
50
+ }
51
+ }
52
+ });
53
+ </script>
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.71",
4
+ "version": "1.0.73",
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.71",
14
- "@dative-gpi/foundation-shared-services": "1.0.71"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.73",
14
+ "@dative-gpi/foundation-shared-services": "1.0.73"
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": "c8c96076d853890bdfa50e805e7797fb390da2b5"
38
+ "gitHead": "b603eafcaf25f621ed41de64599ffabe0e58ced4"
39
39
  }
@@ -16,21 +16,15 @@
16
16
  }
17
17
  }
18
18
 
19
- .fs-breadcrumbs-divider {
20
- margin-bottom: 2px !important;
21
- }
19
+ // .fs-breadcrumbs-divider {
20
+ // margin-bottom: 2px !important;
21
+ // }
22
22
 
23
- .v-breadcrumbs {
23
+ .fs-breadcrumbs.v-breadcrumbs {
24
+ line-height: normal!important;
24
25
  padding: 0 !important;
25
26
  gap: 8px !important;
26
-
27
- @include web {
28
- height: 24px;
29
- }
30
-
31
- @include mobile {
32
- height: 20px;
33
- }
27
+ height: 20px;
34
28
  }
35
29
 
36
30
  .v-breadcrumbs-item {
@@ -7,6 +7,7 @@
7
7
  background-color: var(--fs-clickable-background-color) !important;
8
8
  border-color: var(--fs-clickable-border-color) !important;
9
9
  color: var(--fs-clickable-color) !important;
10
+ box-sizing: border-box;
10
11
 
11
12
  &.fs-clickable-disabled {
12
13
  cursor: default;