@dative-gpi/foundation-shared-components 1.1.24-unit-formatter → 1.1.24-unit-formatter-2

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 (74) hide show
  1. package/assets/images/map/open-street-map.png +0 -0
  2. package/components/FSAccordionPanel.vue +2 -0
  3. package/components/FSButton.vue +43 -87
  4. package/components/FSCard.vue +208 -100
  5. package/components/FSCardPlaceholder.vue +29 -25
  6. package/components/FSChip.vue +54 -127
  7. package/components/FSChipGroup.vue +141 -23
  8. package/components/FSClickable.vue +24 -326
  9. package/components/FSColor.vue +3 -3
  10. package/components/FSColorIcon.vue +1 -0
  11. package/components/FSDialogContent.vue +39 -28
  12. package/components/FSDialogFormBody.vue +2 -0
  13. package/components/FSDialogMenu.vue +8 -1
  14. package/components/FSDialogMultiFormBody.vue +6 -5
  15. package/components/FSDivider.vue +5 -1
  16. package/components/FSEditImageUI.vue +21 -30
  17. package/components/FSGridMosaic.vue +2 -0
  18. package/components/FSGroupingChip.vue +115 -0
  19. package/components/FSIconCard.vue +3 -1
  20. package/components/FSIconCheck.vue +8 -0
  21. package/components/FSImageCard.vue +4 -4
  22. package/components/FSInstantPicker.vue +2 -0
  23. package/components/FSLink.vue +1 -13
  24. package/components/FSOptionItem.vue +4 -4
  25. package/components/FSOptionsMenu.vue +6 -6
  26. package/components/FSPlayButtons.vue +11 -9
  27. package/components/FSProgressBar.vue +142 -28
  28. package/components/FSRangePicker.vue +2 -0
  29. package/components/FSRouterLink.vue +84 -14
  30. package/components/FSSlideGroup.vue +5 -1
  31. package/components/FSSnackbar.vue +146 -0
  32. package/components/FSSubgroupingChip.vue +138 -0
  33. package/components/FSWindow.vue +2 -0
  34. package/components/agenda/FSAgendaHorizontalEvent.vue +4 -4
  35. package/components/agenda/FSAgendaVerticalEvent.vue +4 -4
  36. package/components/deviceOrganisations/FSStatusRichCard.vue +4 -7
  37. package/components/fields/FSAutocompleteField.vue +1 -0
  38. package/components/fields/FSDurationField.vue +184 -0
  39. package/components/fields/FSEntityFieldUI.vue +12 -0
  40. package/components/fields/FSRichTextField.vue +2 -0
  41. package/components/lists/FSDataIteratorItem.vue +2 -0
  42. package/components/lists/FSDataTableUI.vue +12 -0
  43. package/components/lists/FSFilterButton.vue +34 -23
  44. package/components/lists/FSHeaderButton.vue +6 -3
  45. package/components/lists/FSTileList.vue +23 -6
  46. package/components/map/FSMap.vue +1 -1
  47. package/components/map/FSMapMarker.vue +4 -3
  48. package/components/selects/FSSelectMapLayer.vue +5 -0
  49. package/components/tiles/FSChartTileUI.vue +2 -0
  50. package/components/tiles/FSFolderTileUI.vue +2 -2
  51. package/components/tiles/FSLocationTileUI.vue +2 -0
  52. package/components/tiles/FSPlaylistTileUI.vue +149 -0
  53. package/components/tiles/FSServiceAccountOrganisationTileUI.vue +2 -0
  54. package/components/tiles/FSSubgroupingTileUI.vue +97 -0
  55. package/components/tiles/FSTile.vue +32 -64
  56. package/components/tiles/FSUserOrganisationTileUI.vue +2 -0
  57. package/components/toggleSets/FSToggleSetPosition.vue +5 -0
  58. package/composables/useMapLayers.ts +12 -0
  59. package/models/index.ts +2 -1
  60. package/models/map.ts +2 -1
  61. package/models/tables.ts +1 -0
  62. package/models/variants.ts +33 -0
  63. package/package.json +4 -4
  64. package/styles/components/fs_button.scss +1 -7
  65. package/styles/components/fs_card.scss +75 -4
  66. package/styles/components/fs_chip.scss +0 -29
  67. package/styles/components/fs_filter_button.scss +6 -1
  68. package/styles/components/fs_map.scss +7 -1
  69. package/styles/components/fs_progress_bar.scss +62 -6
  70. package/styles/components/fs_snackbar.scss +7 -0
  71. package/styles/components/index.scss +1 -2
  72. package/styles/globals/overrides.scss +1 -1
  73. package/styles/components/fs_clickable.scss +0 -69
  74. package/styles/components/fs_color_icon.scss +0 -3
@@ -89,6 +89,7 @@ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
89
89
  import { computeTicks, TimePrecision } from '@dative-gpi/foundation-shared-components/utils';
90
90
 
91
91
  import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
92
+ import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
92
93
  import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
93
94
  import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
94
95
  import FSPlayButtons from '@dative-gpi/foundation-shared-components/components/FSPlayButtons.vue';
@@ -100,6 +101,7 @@ export default defineComponent({
100
101
  name: "FSRangePicker",
101
102
  components: {
102
103
  FSCol,
104
+ FSRow,
103
105
  FSSpan,
104
106
  FSText,
105
107
  FSTermField,
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <router-link
3
- :to="$props.to"
4
- @auxclick="handleRoutingEvent($event, $props.to)"
5
- @click="handleRoutingEvent($event, $props.to)"
6
- v-bind="$attrs"
2
+ <component
3
+ :is="wrapperComponent"
4
+ v-bind="mergedProps"
5
+ @click="onClick"
6
+ @auxclick="onAuxClick"
7
7
  >
8
8
  <template
9
9
  v-for="(_, name) in $slots"
@@ -14,29 +14,99 @@
14
14
  v-bind="{ ...slotData }"
15
15
  />
16
16
  </template>
17
- </router-link>
17
+ </component>
18
18
  </template>
19
19
 
20
20
  <script lang="ts">
21
- import { defineComponent, type PropType } from "vue";
22
- import { type RouteLocation } from "vue-router";
23
-
21
+ import { computed, defineComponent, type PropType } from "vue";
22
+ import { RouterLink, type RouteLocation } from "vue-router";
24
23
  import { useRouting } from "@dative-gpi/foundation-shared-services/composables";
25
24
 
26
25
  export default defineComponent({
27
26
  name: "FSRouterLink",
28
27
  props: {
29
28
  to: {
30
- type: Object as PropType<RouteLocation>,
31
- required: true
29
+ type: Object as PropType<RouteLocation | null>,
30
+ default: null
31
+ },
32
+ href: {
33
+ type: String as PropType<string | null>,
34
+ default: null
35
+ },
36
+ passive: {
37
+ type: Boolean as PropType<boolean | null>,
38
+ default: null
39
+ },
40
+ type: {
41
+ type: String as PropType<"button" | "submit" | "reset">,
42
+ default: "button"
43
+ },
44
+ defaultWrapper: {
45
+ type: String as PropType<"div" | "a" | "button">,
46
+ default: "button"
47
+ },
48
+ passiveWrapper: {
49
+ type: String as PropType<"div" | "a" | "button">,
50
+ default: "div"
32
51
  }
33
52
  },
34
- setup() {
53
+ setup(props, { attrs, slots }) {
35
54
  const { handleRoutingEvent } = useRouting();
36
55
 
56
+ const actualPassive = computed(() => {
57
+ if (props.passive !== null) {return props.passive;}
58
+ return !props.to && !props.href && !attrs.onClick;
59
+ });
60
+
61
+ const wrapperComponent = computed(() => {
62
+ if (actualPassive.value) {
63
+ return props.passiveWrapper;
64
+ }
65
+ if (props.href) {
66
+ return "a";
67
+ }
68
+ if (props.to) {
69
+ return RouterLink;
70
+ }
71
+ return props.defaultWrapper;
72
+ });
73
+
74
+ const componentProps = computed(() => {
75
+ if (wrapperComponent.value === RouterLink) {
76
+ return { to: props.to };
77
+ } else if (wrapperComponent.value === "a") {
78
+ return { href: props.href };
79
+ } else if (wrapperComponent.value === "button") {
80
+ return { type: props.type };
81
+ } else {
82
+ return {};
83
+ }
84
+ });
85
+
86
+ const mergedProps = computed(() => ({
87
+ ...componentProps.value,
88
+ ...attrs
89
+ }));
90
+
91
+ const onClick = (event: MouseEvent) => {
92
+ if (props.to) {
93
+ handleRoutingEvent(event, props.to);
94
+ }
95
+ };
96
+
97
+ const onAuxClick = (event: MouseEvent) => {
98
+ if (props.to) {
99
+ handleRoutingEvent(event, props.to);
100
+ }
101
+ };
102
+
37
103
  return {
38
- handleRoutingEvent
104
+ wrapperComponent,
105
+ mergedProps,
106
+ slots,
107
+ onClick,
108
+ onAuxClick
39
109
  };
40
110
  }
41
111
  });
42
- </script>
112
+ </script>
@@ -2,7 +2,7 @@
2
2
  <v-slide-group
3
3
  class="fs-slide-group"
4
4
  ref="slideGroupRef"
5
- :showArrows="true"
5
+ :showArrows="$props.showArrows"
6
6
  :id="elementId"
7
7
  :style="style"
8
8
  v-bind="$attrs"
@@ -83,6 +83,10 @@ export default defineComponent({
83
83
  type: Number,
84
84
  required: false,
85
85
  default: 250
86
+ },
87
+ showArrows: {
88
+ type: [Boolean, String] as PropType<boolean | string>,
89
+ default: true
86
90
  }
87
91
  },
88
92
  setup(props) {
@@ -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>
@@ -0,0 +1,138 @@
1
+ <template>
2
+ <FSChip
3
+ :color="chipColor"
4
+ :width="$props.width"
5
+ :height="$props.height"
6
+ :variant="$props.variant"
7
+ :disableHoverStyle="$props.disableHoverStyle"
8
+ :title="`${$props.groupingLabel} - ${$props.label}`"
9
+ >
10
+ <FSRow
11
+ align="center-left"
12
+ width="fill"
13
+ :wrap="false"
14
+ >
15
+ <FSRow
16
+ align="center-center"
17
+ width="hug"
18
+ gap="6px"
19
+ :wrap="false"
20
+ >
21
+ <FSIcon
22
+ :color="$props.groupingColor"
23
+ :size="$props.iconSize"
24
+ >
25
+ {{ $props.groupingIcon }}
26
+ </FSIcon>
27
+ <FSSpan
28
+ font="text-overline"
29
+ >
30
+ {{ $props.groupingLabel }}
31
+ </FSSpan>
32
+ </FSRow>
33
+ <FSRow
34
+ align="center-center"
35
+ width="hug"
36
+ gap="6px"
37
+ :wrap="false"
38
+ >
39
+ <FSIcon
40
+ :size="$props.iconSize"
41
+ >
42
+ {{ $props.icon }}
43
+ </FSIcon>
44
+ <FSSpan
45
+ font="text-overline"
46
+ >
47
+ {{ $props.label }}
48
+ </FSSpan>
49
+ </FSRow>
50
+ </FSRow>
51
+ </FSChip>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { defineComponent, type PropType } from "vue";
56
+
57
+ import { type CardVariant, CardVariants, type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
58
+
59
+ import FSIcon from "./FSIcon.vue";
60
+ import FSSpan from "./FSSpan.vue";
61
+ import FSChip from "./FSChip.vue";
62
+ import FSRow from "./FSRow.vue";
63
+
64
+ import { useColors } from "../composables";
65
+
66
+ export default defineComponent({
67
+ name: "FSSubgroupingChip",
68
+ components: {
69
+ FSChip,
70
+ FSIcon,
71
+ FSSpan,
72
+ FSRow
73
+ },
74
+ props: {
75
+ groupingLabel: {
76
+ type: String as PropType<string>,
77
+ required: true
78
+ },
79
+ groupingIcon: {
80
+ type: String as PropType<string>,
81
+ required: true
82
+ },
83
+ groupingColor: {
84
+ type: String as PropType<ColorBase>,
85
+ required: false,
86
+ default: ColorEnum.Dark
87
+ },
88
+ label: {
89
+ type: String as PropType<string>,
90
+ required: true
91
+ },
92
+ icon: {
93
+ type: String as PropType<string>,
94
+ required: true
95
+ },
96
+ height: {
97
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
98
+ required: false,
99
+ default: () => [24, 20]
100
+ },
101
+ width: {
102
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
103
+ required: false,
104
+ default: "hug"
105
+ },
106
+ variant: {
107
+ type: String as PropType<CardVariant>,
108
+ required: false,
109
+ default: CardVariants.Background
110
+ },
111
+ color: {
112
+ type: String as PropType<ColorBase>,
113
+ required: false,
114
+ default: ColorEnum.Light
115
+ },
116
+ iconSize: {
117
+ type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
118
+ required: false,
119
+ default: "18px"
120
+ },
121
+ disableHoverStyle: {
122
+ type: Boolean,
123
+ required: false,
124
+ default: true
125
+ }
126
+ },
127
+ setup(props) {
128
+ const { getColors } = useColors();
129
+
130
+ const chipColor = getColors(props.color).dark;
131
+
132
+ return {
133
+ chipColor,
134
+ ColorEnum
135
+ };
136
+ }
137
+ });
138
+ </script>
@@ -85,6 +85,7 @@ import FSButton from "./FSButton.vue";
85
85
  import FSCard from "./FSCard.vue";
86
86
  import FSIcon from "./FSIcon.vue";
87
87
  import FSText from "./FSText.vue";
88
+ import FSCol from "./FSCol.vue";
88
89
  import FSRow from "./FSRow.vue";
89
90
 
90
91
  export default defineComponent({
@@ -94,6 +95,7 @@ export default defineComponent({
94
95
  FSCard,
95
96
  FSIcon,
96
97
  FSText,
98
+ FSCol,
97
99
  FSRow
98
100
  },
99
101
  props: {
@@ -29,7 +29,7 @@
29
29
  />
30
30
  </template>
31
31
  </FSAgendaHorizontalEvent>
32
- <FSClickable
32
+ <FSCard
33
33
  v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
34
34
  :class="`fs-agenda-event fs-agenda-event-${$props.variant}`"
35
35
  :variant="$props.variant === 'current' ? 'full' : 'standard'"
@@ -50,7 +50,7 @@
50
50
  :variant="$props.variant"
51
51
  :width="width"
52
52
  />
53
- </FSClickable>
53
+ </FSCard>
54
54
  </template>
55
55
 
56
56
  <script lang="ts">
@@ -58,13 +58,13 @@ import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
58
58
 
59
59
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
60
60
 
61
- import FSClickable from '../FSClickable.vue';
61
+ import FSCard from '../FSCard.vue';
62
62
 
63
63
 
64
64
  export default defineComponent({
65
65
  name: 'FSAgendaHorizontalEvent',
66
66
  components: {
67
- FSClickable
67
+ FSCard
68
68
  },
69
69
  emits: ['click'],
70
70
  props: {
@@ -28,7 +28,7 @@
28
28
  />
29
29
  </template>
30
30
  </FSAgendaVerticalEvent>
31
- <FSClickable
31
+ <FSCard
32
32
  v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
33
33
  :class="`fs-agenda-event fs-agenda-vertical-event fs-agenda-event-${$props.variant}`"
34
34
  :variant="$props.variant === 'current' ? 'full' : 'standard'"
@@ -48,7 +48,7 @@
48
48
  :timeEnd="epochToShortTimeOnlyFormat($props.end)"
49
49
  :variant="$props.variant"
50
50
  />
51
- </FSClickable>
51
+ </FSCard>
52
52
  </template>
53
53
 
54
54
  <script lang="ts">
@@ -56,12 +56,12 @@ import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
56
56
 
57
57
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
58
58
 
59
- import FSClickable from '../FSClickable.vue';
59
+ import FSCard from '../FSCard.vue';
60
60
 
61
61
  export default defineComponent({
62
62
  name: 'FSAgendaVerticalEvent',
63
63
  components: {
64
- FSClickable
64
+ FSCard
65
65
  },
66
66
  emits: ['click'],
67
67
  props: {
@@ -1,10 +1,9 @@
1
1
  <template>
2
- <component
2
+ <FSCard
3
3
  v-if="$props.modelStatus"
4
4
  class="fs-status-rich-card"
5
5
  topRightPadding="2px"
6
6
  variant="standard"
7
- :is="$attrs.onClick ? FSClickable : FSCard"
8
7
  :padding="$props.padding"
9
8
  :height="$props.height"
10
9
  :width="$props.width"
@@ -50,7 +49,7 @@
50
49
  v-bind="{ color }"
51
50
  />
52
51
  </template>
53
- </component>
52
+ </FSCard>
54
53
  </template>
55
54
 
56
55
  <script lang="ts">
@@ -59,19 +58,19 @@ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
59
58
  import { ColorEnum, type FSDeviceStatusGroup, type FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
60
59
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
61
60
 
62
- import FSClickable from "../FSClickable.vue";
63
61
  import FSCard from "../FSCard.vue";
64
62
  import FSIcon from "../FSChip.vue";
65
63
  import FSText from "../FSText.vue";
64
+ import FSRow from "../FSRow.vue";
66
65
  import FSCol from "../FSCol.vue";
67
66
 
68
67
  export default defineComponent({
69
68
  name: "FSStatusRichCard",
70
69
  components: {
71
- FSClickable,
72
70
  FSCard,
73
71
  FSIcon,
74
72
  FSText,
73
+ FSRow,
75
74
  FSCol
76
75
  },
77
76
  props: {
@@ -158,8 +157,6 @@ export default defineComponent({
158
157
  }));
159
158
 
160
159
  return {
161
- FSClickable,
162
- FSCard,
163
160
  color,
164
161
  style,
165
162
  title,
@@ -291,6 +291,7 @@
291
291
  >
292
292
  <FSRow
293
293
  align="center-left"
294
+ :title="item.raw[$props.itemTitle!]"
294
295
  :wrap="false"
295
296
  >
296
297
  <FSCheckbox