@dative-gpi/foundation-shared-components 1.1.0-fix01 → 1.1.1

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,146 @@
1
+ <template>
2
+ <v-snackbar
3
+ class="fs-snackbar"
4
+ :modelValue="$props.modelValue"
5
+ @update:modelValue="$emit('update:modelValue', $event)"
6
+ :multi-line="$props.multiLine"
7
+ :location="$props.location"
8
+ :timeout="$props.timeout"
9
+ :style="style"
10
+ >
11
+ <slot>
12
+ <FSRow
13
+ align="center-left"
14
+ :wrap="false"
15
+ gap="12px"
16
+ >
17
+ <FSIcon
18
+ v-if="$props.icon"
19
+ >
20
+ {{ $props.icon }}
21
+ </FSIcon>
22
+ <FSSpan
23
+ v-if="$props.text"
24
+ :ellipsis="!$props.multiLine"
25
+ >
26
+ {{ $props.text }}
27
+ </FSSpan>
28
+ </FSRow>
29
+ </slot>
30
+ <template
31
+ v-if="$slots.actions || $props.closeButton"
32
+ #actions
33
+ >
34
+ <slot
35
+ name="actions"
36
+ >
37
+ <FSButton
38
+ v-if="$props.closeButton"
39
+ icon="mdi-close"
40
+ variant="icon"
41
+ @click="$emit('update:modelValue', false)"
42
+ />
43
+ </slot>
44
+ </template>
45
+ </v-snackbar>
46
+ </template>
47
+
48
+ <script lang="ts">
49
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
50
+
51
+ import { type ColorBase, ColorEnum, type SnackbarVariant, SnackbarVariants } from "@dative-gpi/foundation-shared-components/models";
52
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
53
+ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
54
+
55
+ import FSButton from "./FSButton.vue";
56
+ import FSIcon from "./FSIcon.vue";
57
+ import FSSpan from "./FSSpan.vue";
58
+ import FSRow from "./FSRow.vue";
59
+
60
+ export default defineComponent({
61
+ name: "FSSnackbar",
62
+ components: {
63
+ FSButton,
64
+ FSIcon,
65
+ FSSpan,
66
+ FSRow
67
+ },
68
+ props: {
69
+ modelValue: {
70
+ type: Boolean,
71
+ required: false,
72
+ default: false
73
+ },
74
+ text: {
75
+ type: String as PropType<string | null>,
76
+ required: false,
77
+ default: null
78
+ },
79
+ icon: {
80
+ type: String as PropType<string | null>,
81
+ required: false,
82
+ default: null
83
+ },
84
+ color: {
85
+ type: String as PropType<ColorBase>,
86
+ required: false,
87
+ default: ColorEnum.Dark
88
+ },
89
+ timeout: {
90
+ type: Number,
91
+ required: false,
92
+ default: 5000
93
+ },
94
+ location: {
95
+ type: String as PropType<"top" | "bottom" | "left" | "right" | "top left" | "top right" | "bottom left" | "bottom right">,
96
+ required: false,
97
+ default: "bottom"
98
+ },
99
+ multiLine: {
100
+ type: Boolean,
101
+ required: false,
102
+ default: false
103
+ },
104
+ closeButton: {
105
+ type: Boolean,
106
+ required: false,
107
+ default: false
108
+ },
109
+ variant: {
110
+ type: String as PropType<SnackbarVariant>,
111
+ required: false,
112
+ default: SnackbarVariants.Full
113
+ },
114
+ borderRadius: {
115
+ type: [String, Number],
116
+ required: false,
117
+ default: "4px"
118
+ }
119
+ },
120
+ emits: ["update:modelValue"],
121
+ setup(props) {
122
+ const { getColors } = useColors();
123
+
124
+ const colors = computed(() => getColors(props.color));
125
+
126
+ const style = computed((): StyleValue => {
127
+ switch (props.variant) {
128
+ case "standard": return {
129
+ "--fs-snackbar-border-radius": sizeToVar(props.borderRadius),
130
+ "--fs-snackbar-background-color": colors.value.light,
131
+ "--fs-snackbar-color": colors.value.dark
132
+ };
133
+ default: return {
134
+ "--fs-snackbar-border-radius": sizeToVar(props.borderRadius),
135
+ "--fs-snackbar-background-color": colors.value.base,
136
+ "--fs-snackbar-color": colors.value.light
137
+ };
138
+ }
139
+ });
140
+
141
+ return {
142
+ style
143
+ };
144
+ }
145
+ });
146
+ </script>
@@ -2,12 +2,21 @@
2
2
  <FSCol
3
3
  gap="12px"
4
4
  >
5
- <FSSearchField
6
- v-if="$props.searchable"
7
- :hideHeader="true"
8
- :modelValue="actualSearch"
9
- @update:modelValue="onSearch"
10
- />
5
+ <FSRow
6
+ v-if="$props.searchable || $slots.action"
7
+ :wrap="false"
8
+ align="center-left"
9
+ >
10
+ <FSSearchField
11
+ v-if="$props.searchable"
12
+ :hideHeader="true"
13
+ :modelValue="actualSearch"
14
+ @update:modelValue="onSearch"
15
+ />
16
+ <slot
17
+ name="action"
18
+ />
19
+ </FSRow>
11
20
  <FSFadeOut
12
21
  v-if="$props.direction == ListDirections.Column"
13
22
  :maxHeight="$props.maxHeight"
@@ -109,11 +118,13 @@ import FSFadeOut from "../FSFadeOut.vue";
109
118
  import FSSlideGroup from "../FSSlideGroup.vue"
110
119
  import FSSearchField from "../fields/FSSearchField.vue";
111
120
  import FSSimpleTileUI from "../tiles/FSSimpleTileUI.vue";
121
+ import FSRow from "../FSRow.vue";
112
122
 
113
123
  export default defineComponent({
114
124
  name: "FSTileList",
115
125
  components: {
116
126
  FSCol,
127
+ FSRow,
117
128
  FSFadeOut,
118
129
  FSLoader,
119
130
  FSSlideGroup,
@@ -223,6 +234,12 @@ export default defineComponent({
223
234
  actualSearch.value = value;
224
235
  });
225
236
 
237
+ watch(() => props.singleSelect, () => {
238
+ if(props.singleSelect && props.modelValue.length > 1) {
239
+ emit("update:modelValue", []);
240
+ }
241
+ }, { immediate: true });
242
+
226
243
  return {
227
244
  actualSearch,
228
245
  filteredItems,
@@ -11,8 +11,9 @@ import { type Map, divIcon, type LatLng, marker, type Marker, type MarkerCluster
11
11
  import { useColors } from "../../composables";
12
12
  import { useRouting } from '@dative-gpi/foundation-shared-services/composables';
13
13
 
14
- import { gpsMarkerHtml, locationMarkerHtml, pinMarkerHtml } from '../../utils/leafletMarkers';
15
14
  import { MAP, MARKERCLUSTERGROUP } from './keys';
15
+ import { ColorEnum, type ColorBase } from '@dative-gpi/foundation-shared-components/models';
16
+ import { gpsMarkerHtml, locationMarkerHtml, pinMarkerHtml } from '../../utils/leafletMarkers';
16
17
 
17
18
  export default {
18
19
  name: 'FSMapMarker',
@@ -23,8 +24,8 @@ export default {
23
24
  required: false
24
25
  },
25
26
  color: {
26
- type: String,
27
- default: 'primary',
27
+ type: String as PropType<ColorBase>,
28
+ default: ColorEnum.Primary,
28
29
  required: false
29
30
  },
30
31
  latlng: {
@@ -0,0 +1,149 @@
1
+ <template>
2
+ <FSTile
3
+ :activeColor="ColorEnum.Primary"
4
+ :modelValue="$props.modelValue"
5
+ :width="$props.width"
6
+ :height="$props.height"
7
+ padding="16px 24px"
8
+ v-bind="$attrs"
9
+ >
10
+ <FSRow
11
+ :wrap="false"
12
+ >
13
+ <FSCol
14
+ gap="16px"
15
+ width="fill"
16
+ >
17
+ <FSText
18
+ font="text-button"
19
+ >
20
+ {{ $props.label }}
21
+ </FSText>
22
+ <FSRow
23
+ :wrap="false"
24
+ align="center-left"
25
+ >
26
+ <FSIcon>
27
+ mdi-view-dashboard-outline
28
+ </FSIcon>
29
+ <FSText
30
+ font="text-overline"
31
+ >
32
+ {{ $tr('ui.dashboards.dynamic', '{0} dashboard(s)', $props.dashboardsCount) }}
33
+ </FSText>
34
+ </FSRow>
35
+ <FSRow
36
+ :wrap="false"
37
+ align="center-left"
38
+ >
39
+ <FSIconCheck
40
+ variant="fill"
41
+ :value="automaticTransition"
42
+ />
43
+ <FSText
44
+ font="text-overline"
45
+ v-if="automaticTransition"
46
+ >
47
+ {{$tr('ui.playlist.transition-delay.dynamic', 'Transition : {0}', getTimeBestString($props.delay ?? 0))}}
48
+ </FSText>
49
+ <FSText
50
+ font="text-overline"
51
+ v-else
52
+ >
53
+ {{ $tr('ui.playlist.automatic-transition', 'Automatic transition') }}
54
+ </FSText>
55
+ </FSRow>
56
+ <FSRow
57
+ :wrap="false"
58
+ align="center-left"
59
+ >
60
+ <FSIconCheck
61
+ variant="fill"
62
+ :value="$props.looped"
63
+ />
64
+ <FSText
65
+ font="text-overline"
66
+ >
67
+ {{ $tr('entity.playlist.looped', 'Looped') }}
68
+ </FSText>
69
+ </FSRow>
70
+ </FSCol>
71
+ <slot
72
+ name="actions"
73
+ />
74
+ </FSRow>
75
+ </FSTile>
76
+ </template>
77
+
78
+ <script lang="ts">
79
+ import { computed, defineComponent, type PropType } from "vue";
80
+
81
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
82
+
83
+ import { getTimeBestString } from "@dative-gpi/foundation-shared-components/utils";
84
+
85
+ import FSIconCheck from "../FSIconCheck.vue";
86
+ import FSTile from "../tiles/FSTile.vue";
87
+ import FSIcon from "../FSIcon.vue";
88
+ import FSText from "../FSText.vue";
89
+ import FSRow from "../FSRow.vue";
90
+ import FSCol from "../FSCol.vue";
91
+
92
+ export default defineComponent({
93
+ name: "FSPlaylistTileUI",
94
+ components: {
95
+ FSIconCheck,
96
+ FSIcon,
97
+ FSTile,
98
+ FSText,
99
+ FSRow,
100
+ FSCol
101
+ },
102
+ inheritAttrs: false,
103
+ props: {
104
+ width: {
105
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
106
+ required: false,
107
+ default: () => [352, 336]
108
+ },
109
+ height: {
110
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
111
+ required: false,
112
+ default: () => 'hug'
113
+ },
114
+ label: {
115
+ type: String as PropType<string>,
116
+ required: true
117
+ },
118
+ dashboardsCount: {
119
+ type: Number,
120
+ required: true
121
+ },
122
+ delay: {
123
+ type: Number ,
124
+ required: false
125
+ },
126
+ looped: {
127
+ type: Boolean,
128
+ required: true
129
+ },
130
+ modelValue: {
131
+ type: Boolean,
132
+ required: false,
133
+ default: false
134
+ }
135
+ },
136
+ setup(props) {
137
+
138
+ const automaticTransition = computed((): boolean => {
139
+ return props.delay ? props.delay > 0 : false;
140
+ });
141
+
142
+ return {
143
+ getTimeBestString,
144
+ automaticTransition,
145
+ ColorEnum
146
+ };
147
+ }
148
+ });
149
+ </script>
@@ -4,4 +4,10 @@ export enum CardVariants {
4
4
  Standard = "standard",
5
5
  Full = "full",
6
6
  Gradient = "gradient"
7
+ }
8
+
9
+ export type SnackbarVariant = "standard" | "full";
10
+ export enum SnackbarVariants {
11
+ Standard = "standard",
12
+ Full = "full"
7
13
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.1.0-fix01",
7
+ "version": "1.1.1",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,8 +13,8 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-shared-domain": "1.1.0-fix01",
17
- "@dative-gpi/foundation-shared-services": "1.1.0-fix01"
16
+ "@dative-gpi/foundation-shared-domain": "1.1.1",
17
+ "@dative-gpi/foundation-shared-services": "1.1.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -38,5 +38,5 @@
38
38
  "sass": "1.71.1",
39
39
  "sass-loader": "13.3.2"
40
40
  },
41
- "gitHead": "278e797abb199f1bf32f7758b2eec5e101537874"
41
+ "gitHead": "e216573a785fa74dba8daac116173fcdd42311c8"
42
42
  }
@@ -0,0 +1,7 @@
1
+ .fs-snackbar {
2
+ .v-snackbar__wrapper {
3
+ border-radius: var(--fs-snackbar-border-radius);
4
+ background-color: var(--fs-snackbar-background-color);
5
+ color: var(--fs-snackbar-color);
6
+ }
7
+ }
@@ -51,6 +51,7 @@
51
51
  @import "fs_select_field.scss";
52
52
  @import "fs_slide_group.scss";
53
53
  @import "fs_slider.scss";
54
+ @import "fs_snackbar.scss";
54
55
  @import "fs_span.scss";
55
56
  @import "fs_status_rich_card.scss";
56
57
  @import "fs_switch.scss";