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

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 (34) hide show
  1. package/components/FSBreadcrumbs.vue +1 -0
  2. package/components/FSCard.vue +22 -5
  3. package/components/FSDialogContent.vue +2 -4
  4. package/components/FSDialogFormBody.vue +2 -8
  5. package/components/FSDialogMultiFormBody.vue +1 -4
  6. package/components/FSDialogRemove.vue +0 -1
  7. package/components/FSDialogSubmit.vue +1 -4
  8. package/components/FSFadeOut.vue +29 -12
  9. package/components/FSIconCard.vue +1 -1
  10. package/components/autocompletes/FSAutoCompleteAddress.vue +16 -20
  11. package/components/deviceOrganisations/FSWorstAlert.vue +15 -29
  12. package/components/deviceOrganisations/FSWorstAlertCard.vue +7 -46
  13. package/components/fields/FSAutocompleteField.vue +1 -0
  14. package/components/lists/FSFilterButton.vue +3 -6
  15. package/components/lists/FSHiddenButton.vue +1 -3
  16. package/components/lists/FSSimpleList.vue +0 -2
  17. package/components/map/FSMapLayerButton.vue +0 -1
  18. package/components/tiles/FSSimpleTileUI.vue +6 -1
  19. package/components/views/FSBaseView.vue +64 -0
  20. package/components/views/FSEntityView.vue +12 -146
  21. package/components/views/FSSimpleView.vue +29 -0
  22. package/components/views/desktop/FSBaseDefaultDesktopView.vue +132 -0
  23. package/components/views/desktop/FSBaseDesktopView.vue +53 -0
  24. package/components/views/desktop/FSBaseEntityDesktopView.vue +199 -0
  25. package/components/views/mobile/FSBaseDefaultMobileView.vue +132 -0
  26. package/components/views/mobile/FSBaseEntityMobileView.vue +199 -0
  27. package/components/views/mobile/FSBaseMobileView.vue +53 -0
  28. package/package.json +4 -4
  29. package/styles/components/fs_breadcrumbs.scss +6 -12
  30. package/styles/components/fs_clickable.scss +1 -0
  31. package/styles/components/fs_fade_out.scss +5 -1
  32. package/styles/components/fs_slide_group.scss +1 -1
  33. package/components/views/FSListView.vue +0 -83
  34. package/components/views/FSSkeletonView.vue +0 -100
@@ -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.74",
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.74",
14
+ "@dative-gpi/foundation-shared-services": "1.0.74"
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": "b9ba9b12c53de7d812e658a3438903e8e6998aad"
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;
@@ -4,8 +4,12 @@
4
4
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
5
5
  max-height: var(--fs-fade-out-max-height);
6
6
  padding: var(--fs-fade-out-padding);
7
+
8
+ // Petit hack pour que la barre de scroll elle soit à droite du container
9
+ padding-right: calc(var(--fs-fade-out-padding) + var(--fs-fade-out-padding-offset));
10
+ width: calc(var(--fs-fade-out-width) + var(--fs-fade-out-width-offset));
11
+
7
12
  height: var(--fs-fade-out-height);
8
- width: var(--fs-fade-out-width);
9
13
  flex-direction: column;
10
14
  position: relative;
11
15
  display: flex;
@@ -4,7 +4,7 @@
4
4
  max-width: 100%;
5
5
 
6
6
  & > .v-slide-group__container > .v-slide-group__content {
7
- margin: 0 2px 1px 0 !important;
7
+ // margin: 0 2px 1px 0 !important;
8
8
  padding: var(--fs-group-padding);
9
9
  gap: var(--fs-group-gap);
10
10
  }
@@ -1,83 +0,0 @@
1
- <template>
2
- <FSSkeletonView>
3
- <template
4
- #header
5
- >
6
- <FSListHeader
7
- ref="headerRef"
8
- :breadcrumbs="$props.breadcrumbs"
9
- :title="$props.title"
10
- padding="0 14px 0 0"
11
- >
12
- <template
13
- #toolbar
14
- >
15
- <slot
16
- name="toolbar"
17
- />
18
- </template>
19
- </FSListHeader>
20
- </template>
21
- <template
22
- #default
23
- >
24
- <FSFadeOut
25
- padding="0 8px 0 0"
26
- :height="height"
27
- >
28
- <slot
29
- name="default"
30
- />
31
- </FSFadeOut>
32
- </template>
33
- </FSSkeletonView>
34
- </template>
35
-
36
- <script lang="ts">
37
- import { computed, defineComponent, type PropType, ref } from "vue";
38
-
39
- import { type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
40
- import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
41
-
42
- import FSSkeletonView from "./FSSkeletonView.vue";
43
- import FSListHeader from "./FSListHeader.vue";
44
- import FSFadeOut from "../FSFadeOut.vue";
45
-
46
- export default defineComponent({
47
- name: "FSListView",
48
- components: {
49
- FSSkeletonView,
50
- FSListHeader,
51
- FSFadeOut
52
- },
53
- props: {
54
- title: {
55
- type: String as PropType<string | null>,
56
- required: false,
57
- default: null
58
- },
59
- breadcrumbs: {
60
- type: Array as PropType<FSBreadcrumbItem[]>,
61
- required: false,
62
- default: () => []
63
- }
64
- },
65
- setup() {
66
- const { isExtraSmall, windowHeight } = useBreakpoints();
67
-
68
- const headerRef = ref<HTMLElement | null>(null);
69
-
70
- const height = computed((): string => {
71
- let other = isExtraSmall.value ? 16 + 16 : 24 + 24 // Paddings
72
- + (headerRef.value?.clientHeight ?? 0); // Header
73
-
74
- return `${windowHeight.value - other}px`;
75
- });
76
-
77
- return {
78
- headerRef,
79
- height
80
- };
81
- }
82
- });
83
- </script>
@@ -1,100 +0,0 @@
1
- <template>
2
- <template
3
- v-if="isExtraSmall"
4
- >
5
- <FSCol
6
- padding="16px 4px 16px 12px"
7
- height="100%"
8
- gap="16px"
9
- >
10
- <slot
11
- name="header"
12
- >
13
- <slot
14
- name="title"
15
- >
16
- <FSRow
17
- gap="12px"
18
- >
19
- <slot
20
- name="title-image"
21
- />
22
- <slot
23
- name="title-texts"
24
- />
25
- </FSRow>
26
- </slot>
27
- </slot>
28
- <slot
29
- name="breadcrumbs"
30
- />
31
- <slot
32
- name="toolbar"
33
- />
34
- <slot
35
- name="title-append"
36
- />
37
- <slot
38
- name="default"
39
- />
40
- </FSCol>
41
- </template>
42
- <template
43
- v-else
44
- >
45
- <FSCol
46
- padding="24px 8px 24px 24px"
47
- height="100vh"
48
- gap="16px"
49
- >
50
- <slot
51
- name="header"
52
- >
53
- <slot
54
- name="title"
55
- >
56
- <FSRow
57
- gap="32px"
58
- >
59
- <slot
60
- name="title-image"
61
- />
62
- <slot
63
- name="title-texts"
64
- />
65
- <v-spacer />
66
- <slot
67
- name="title-append"
68
- />
69
- </FSRow>
70
- </slot>
71
- </slot>
72
- <slot
73
- name="breadcrumbs"
74
- />
75
- <slot
76
- name="toolbar"
77
- />
78
- <slot
79
- name="default"
80
- />
81
- </FSCol>
82
- </template>
83
- </template>
84
-
85
- <script lang="ts">
86
- import { defineComponent } from "vue";
87
-
88
- import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
89
-
90
- export default defineComponent({
91
- name: "FSSkeletonView",
92
- setup() {
93
- const { isExtraSmall } = useBreakpoints();
94
-
95
- return {
96
- isExtraSmall
97
- };
98
- }
99
- });
100
- </script>