@dative-gpi/foundation-shared-components 1.0.70 → 1.0.71-groupings-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 (296) hide show
  1. package/assets/images/map/snow.png +0 -0
  2. package/components/FSAccordionPanel.vue +40 -21
  3. package/components/FSBreadcrumbs.vue +21 -12
  4. package/components/FSButton.vue +11 -9
  5. package/components/FSCalendar.vue +50 -12
  6. package/components/FSCalendarTwin.vue +95 -43
  7. package/components/FSCard.vue +61 -9
  8. package/components/FSCardPlaceholder.vue +8 -5
  9. package/components/FSCheckbox.vue +5 -4
  10. package/components/FSChip.vue +73 -45
  11. package/components/FSChipGroup.vue +69 -0
  12. package/components/FSClickable.vue +11 -9
  13. package/components/FSClock.vue +30 -12
  14. package/components/FSCol.vue +11 -5
  15. package/components/FSDialog.vue +2 -1
  16. package/components/FSDialogContent.vue +12 -11
  17. package/components/FSDialogForm.vue +22 -2
  18. package/components/FSDialogFormBody.vue +50 -31
  19. package/components/FSDialogMenu.vue +17 -8
  20. package/components/FSDialogMultiFormBody.vue +23 -13
  21. package/components/FSDialogRemove.vue +7 -8
  22. package/components/FSDialogSubmit.vue +20 -11
  23. package/components/FSEditImageUI.vue +13 -5
  24. package/components/FSFadeOut.vue +53 -21
  25. package/components/FSForm.vue +10 -8
  26. package/components/FSGrid.vue +0 -1
  27. package/components/FSIcon.vue +2 -2
  28. package/components/FSIconCard.vue +68 -12
  29. package/components/FSInformationsMenu.vue +142 -0
  30. package/components/FSInstantPicker.vue +268 -0
  31. package/components/FSLink.vue +25 -9
  32. package/components/FSLoader.vue +28 -10
  33. package/components/FSMenu.vue +47 -0
  34. package/components/FSOptionGroup.vue +8 -8
  35. package/components/FSOptionItem.vue +4 -4
  36. package/components/FSOptionsMenu.vue +165 -0
  37. package/components/FSPagination.vue +1 -1
  38. package/components/FSPlayButtons.vue +72 -0
  39. package/components/FSProgressBar.vue +94 -0
  40. package/components/FSRadio.vue +5 -4
  41. package/components/FSRadioGroup.vue +3 -3
  42. package/components/FSRangePicker.vue +275 -0
  43. package/components/FSRangeSlider.vue +84 -0
  44. package/components/FSRouterLink.vue +42 -0
  45. package/components/FSSlideGroup.vue +9 -7
  46. package/components/FSSlider.vue +44 -79
  47. package/components/FSSpan.vue +22 -8
  48. package/components/FSSwitch.vue +44 -48
  49. package/components/FSTab.vue +15 -13
  50. package/components/FSTabs.vue +5 -2
  51. package/components/FSTag.vue +3 -3
  52. package/components/FSTagGroup.vue +6 -4
  53. package/components/FSText.vue +21 -8
  54. package/components/FSToggleSet.vue +7 -7
  55. package/components/FSTreeView.vue +107 -0
  56. package/components/FSWindow.vue +122 -5
  57. package/components/agenda/FSAgenda.vue +26 -7
  58. package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
  59. package/components/agenda/FSAgendaHeader.vue +35 -10
  60. package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
  61. package/components/agenda/FSAgendaHoursRow.vue +48 -8
  62. package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
  63. package/components/agenda/FSDayAgenda.vue +0 -1
  64. package/components/agenda/FSMonthAgenda.vue +1 -6
  65. package/components/agenda/FSSelectAgendaMode.vue +2 -2
  66. package/components/agenda/FSWeekAgenda.vue +5 -10
  67. package/components/autocompletes/FSAutoCompleteAddress.vue +25 -20
  68. package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
  69. package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
  70. package/components/buttons/FSButtonAdd.vue +1 -1
  71. package/components/buttons/FSButtonAddLabel.vue +1 -1
  72. package/components/buttons/FSButtonCancel.vue +1 -1
  73. package/components/buttons/FSButtonCancelLabel.vue +1 -1
  74. package/components/buttons/FSButtonCheckbox.vue +4 -4
  75. package/components/buttons/FSButtonCopy.vue +1 -1
  76. package/components/buttons/FSButtonCopyLabel.vue +1 -1
  77. package/components/buttons/FSButtonDuplicate.vue +1 -1
  78. package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
  79. package/components/buttons/FSButtonEdit.vue +1 -1
  80. package/components/buttons/FSButtonEditLabel.vue +1 -1
  81. package/components/buttons/FSButtonFile.vue +1 -1
  82. package/components/buttons/FSButtonFileLabel.vue +1 -1
  83. package/components/buttons/FSButtonNext.vue +1 -1
  84. package/components/buttons/FSButtonNextLabel.vue +1 -1
  85. package/components/buttons/FSButtonPrevious.vue +1 -1
  86. package/components/buttons/FSButtonPreviousLabel.vue +1 -1
  87. package/components/buttons/FSButtonRedo.vue +1 -1
  88. package/components/buttons/FSButtonRedoLabel.vue +1 -1
  89. package/components/buttons/FSButtonRemove.vue +1 -1
  90. package/components/buttons/FSButtonRemoveLabel.vue +1 -1
  91. package/components/buttons/FSButtonSave.vue +1 -1
  92. package/components/buttons/FSButtonSaveLabel.vue +1 -1
  93. package/components/buttons/FSButtonSearch.vue +1 -1
  94. package/components/buttons/FSButtonSearchLabel.vue +1 -1
  95. package/components/buttons/FSButtonUndo.vue +1 -1
  96. package/components/buttons/FSButtonUndoLabel.vue +1 -1
  97. package/components/buttons/FSButtonUpdate.vue +1 -1
  98. package/components/buttons/FSButtonUpdateLabel.vue +1 -1
  99. package/components/buttons/FSButtonValidate.vue +1 -1
  100. package/components/buttons/FSButtonValidateLabel.vue +1 -1
  101. package/components/calendar/FSSimpleCalendar.vue +145 -0
  102. package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
  103. package/components/calendar/FSSimpleMonthSelector.vue +138 -0
  104. package/components/carousels/FSCarousel.vue +23 -0
  105. package/components/carousels/FSCarouselItem.vue +14 -0
  106. package/components/deviceOrganisations/FSConnectivity.vue +5 -3
  107. package/components/deviceOrganisations/FSStatus.vue +5 -3
  108. package/components/deviceOrganisations/FSStatusCard.vue +7 -9
  109. package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
  110. package/components/deviceOrganisations/FSWorstAlert.vue +24 -36
  111. package/components/deviceOrganisations/FSWorstAlertCard.vue +8 -47
  112. package/components/fields/FSAutocompleteField.vue +85 -82
  113. package/components/fields/FSAutocompleteTag.vue +1 -1
  114. package/components/fields/FSBaseField.vue +42 -25
  115. package/components/fields/FSClosableSearchField.vue +83 -0
  116. package/components/fields/FSColorField.vue +12 -10
  117. package/components/fields/FSCommentField.vue +28 -16
  118. package/components/fields/FSDateField.vue +13 -10
  119. package/components/fields/FSDateRangeField.vue +6 -5
  120. package/components/fields/FSDateTimeField.vue +14 -11
  121. package/components/fields/FSDateTimeRangeDialog.vue +160 -0
  122. package/components/fields/FSDateTimeRangeField.vue +23 -115
  123. package/components/fields/FSEntityFieldUI.vue +19 -16
  124. package/components/fields/FSGradientField.vue +5 -5
  125. package/components/fields/FSIconField.vue +16 -9
  126. package/components/fields/FSMapAddressField.vue +187 -0
  127. package/components/fields/FSNumberField.vue +8 -4
  128. package/components/fields/FSPasswordField.vue +7 -7
  129. package/components/fields/FSPoliciesValidationField.vue +101 -0
  130. package/components/fields/FSRichTextField.vue +78 -58
  131. package/components/fields/FSSearchField.vue +9 -115
  132. package/components/fields/FSSelectField.vue +69 -71
  133. package/components/fields/FSTagField.vue +9 -9
  134. package/components/fields/FSTermField.vue +69 -46
  135. package/components/fields/FSTextArea.vue +17 -11
  136. package/components/fields/FSTextField.vue +15 -10
  137. package/components/fields/FSTimeField.vue +14 -10
  138. package/components/fields/FSTimeRangeField.vue +117 -187
  139. package/components/fields/FSTimeStepField.vue +5 -5
  140. package/components/fields/FSTranslateField.vue +10 -10
  141. package/components/fields/FSTranslateRichTextField.vue +41 -20
  142. package/components/fields/FSTranslateTextArea.vue +10 -10
  143. package/components/fields/FSTreeViewField.vue +21 -19
  144. package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
  145. package/components/fields/periodicField/FSPeriodicField.vue +15 -15
  146. package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
  147. package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
  148. package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
  149. package/components/lists/FSDataIteratorItem.vue +23 -67
  150. package/components/lists/FSDataTableUI.vue +194 -119
  151. package/components/lists/FSFilterButton.vue +14 -16
  152. package/components/lists/FSHeaderButton.vue +11 -9
  153. package/components/lists/FSHiddenButton.vue +9 -9
  154. package/components/lists/FSLoadDataTable.vue +10 -7
  155. package/components/lists/FSSimpleList.vue +95 -88
  156. package/components/lists/FSSimpleListItem.vue +131 -0
  157. package/components/map/FSMap.vue +144 -158
  158. package/components/map/FSMapFeatureGroup.vue +7 -1
  159. package/components/map/FSMapLayerButton.vue +3 -3
  160. package/components/map/FSMapMarker.vue +103 -42
  161. package/components/map/FSMapMarkerClusterGroup.vue +32 -7
  162. package/components/map/FSMapOverlay.vue +44 -24
  163. package/components/map/FSMapPolygon.vue +16 -4
  164. package/components/map/FSMapTileLayer.vue +26 -9
  165. package/components/map/layers.ts +0 -0
  166. package/components/selects/FSSelectAutoRefresh.vue +8 -8
  167. package/components/selects/FSSelectDashboardVariableType.vue +4 -3
  168. package/components/selects/FSSelectDateSetting.vue +2 -2
  169. package/components/selects/FSSelectDays.vue +8 -8
  170. package/components/selects/FSSelectListMode.vue +2 -2
  171. package/components/selects/FSSelectMapLayer.vue +68 -0
  172. package/components/selects/FSSelectMonths.vue +13 -13
  173. package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
  174. package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
  175. package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
  176. package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
  177. package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
  178. package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
  179. package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
  180. package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
  181. package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
  182. package/components/tiles/FSAlertTileUI.vue +90 -0
  183. package/components/tiles/FSChartTileUI.vue +61 -52
  184. package/components/tiles/FSCommentTileUI.vue +38 -13
  185. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
  186. package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
  187. package/components/tiles/FSDeviceOrganisationTileUI.vue +0 -6
  188. package/components/tiles/FSEntityCountBadge.vue +83 -0
  189. package/components/tiles/FSFolderTileUI.vue +38 -4
  190. package/components/tiles/FSGroupTileUI.vue +32 -136
  191. package/components/tiles/FSGroupingTileUI.vue +52 -0
  192. package/components/tiles/FSLoadTile.vue +16 -10
  193. package/components/tiles/FSLocationTileUI.vue +50 -80
  194. package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
  195. package/components/tiles/FSSimpleTileUI.vue +32 -27
  196. package/components/tiles/FSTile.vue +46 -39
  197. package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
  198. package/components/tiles/FSUserTileUI.vue +119 -0
  199. package/components/toggleSets/FSToggleSetPosition.vue +1 -1
  200. package/components/views/FSBaseView.vue +64 -0
  201. package/components/views/FSEntityView.vue +12 -146
  202. package/components/views/FSSimpleView.vue +29 -0
  203. package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
  204. package/components/views/desktop/FSBaseDesktopView.vue +53 -0
  205. package/components/views/desktop/FSBaseEntityDesktopView.vue +211 -0
  206. package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
  207. package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
  208. package/components/views/mobile/FSBaseMobileView.vue +53 -0
  209. package/composables/index.ts +1 -1
  210. package/composables/useAddress.ts +40 -8
  211. package/composables/useBreakpoints.ts +40 -4
  212. package/composables/useColors.ts +16 -7
  213. package/composables/useMapLayers.ts +69 -0
  214. package/composables/useSlots.ts +2 -1
  215. package/models/colors.ts +2 -1
  216. package/models/deviceAlerts.ts +1 -0
  217. package/models/index.ts +0 -1
  218. package/models/map.ts +12 -10
  219. package/models/rules.ts +5 -2
  220. package/models/tables.ts +2 -1
  221. package/models/variableNode.ts +8 -5
  222. package/package.json +5 -5
  223. package/styles/components/fs_agenda.scss +4 -0
  224. package/styles/components/fs_agenda_event.scss +1 -1
  225. package/styles/components/fs_agenda_hours_row.scss +0 -8
  226. package/styles/components/fs_autocomplete_field.scss +0 -13
  227. package/styles/components/fs_breadcrumbs.scss +18 -36
  228. package/styles/components/fs_button.scss +7 -5
  229. package/styles/components/fs_calendar.scss +1 -0
  230. package/styles/components/fs_card.scss +9 -0
  231. package/styles/components/fs_chip.scss +13 -7
  232. package/styles/components/fs_clickable.scss +16 -23
  233. package/styles/components/fs_clock.scss +0 -10
  234. package/styles/components/fs_col.scss +1 -1
  235. package/styles/components/fs_color_field.scss +0 -4
  236. package/styles/components/fs_data_table.scss +6 -9
  237. package/styles/components/fs_dialog.scss +4 -10
  238. package/styles/components/fs_dialog_menu.scss +4 -2
  239. package/styles/components/fs_draggable.scss +0 -5
  240. package/styles/components/fs_fade_out.scss +10 -2
  241. package/styles/components/fs_filter_button.scss +1 -1
  242. package/styles/components/fs_hidden_button.scss +2 -7
  243. package/styles/components/fs_image_card.scss +6 -4
  244. package/styles/components/fs_magic_config_field.scss +1 -2
  245. package/styles/components/fs_map.scss +57 -17
  246. package/styles/components/fs_meta_field.scss +3 -5
  247. package/styles/components/fs_password_field.scss +4 -2
  248. package/styles/components/fs_progress_bar.scss +14 -0
  249. package/styles/components/fs_radio.scss +0 -11
  250. package/styles/components/fs_rich_text_field.scss +1 -10
  251. package/styles/components/fs_select_field.scss +4 -13
  252. package/styles/components/fs_slide_group.scss +3 -1
  253. package/styles/components/fs_slider.scss +0 -40
  254. package/styles/components/fs_span.scss +17 -5
  255. package/styles/components/fs_status_rich_card.scss +6 -0
  256. package/styles/components/fs_tabs.scss +18 -37
  257. package/styles/components/fs_tag.scss +8 -22
  258. package/styles/components/fs_text_area.scss +2 -21
  259. package/styles/components/fs_tile.scss +0 -19
  260. package/styles/components/fs_window.scss +3 -1
  261. package/styles/components/fs_wrap_group.scss +3 -0
  262. package/styles/components/index.scss +2 -6
  263. package/styles/globals/index.scss +1 -5
  264. package/styles/globals/overrides.scss +26 -44
  265. package/styles/globals/scrollbars.scss +8 -0
  266. package/styles/globals/text_fonts.scss +18 -66
  267. package/styles/globals/touchscreen.scss +2 -2
  268. package/tools/alertsTools.ts +94 -18
  269. package/tools/chartsTools.ts +156 -16
  270. package/tools/index.ts +1 -0
  271. package/tools/reportsTools.ts +38 -0
  272. package/tools/timeRangeTools.ts +99 -40
  273. package/utils/badge.ts +9 -5
  274. package/utils/index.ts +2 -0
  275. package/utils/leafletMarkers.ts +4 -4
  276. package/utils/operations.ts +108 -0
  277. package/utils/picker.ts +40 -0
  278. package/utils/sort.ts +2 -2
  279. package/utils/time.ts +13 -13
  280. package/components/fields/FSMagicConfigField.vue +0 -163
  281. package/components/fields/FSMagicField.vue +0 -193
  282. package/components/fields/FSTimeSlotField.vue +0 -250
  283. package/components/views/FSEntityHeader.vue +0 -343
  284. package/components/views/FSListHeader.vue +0 -83
  285. package/components/views/FSListView.vue +0 -83
  286. package/components/views/FSSkeletonView.vue +0 -100
  287. package/composables/useMagicFieldProvider.ts +0 -23
  288. package/models/magicFields.ts +0 -10
  289. package/styles/components/fs_data_iterator_item.scss +0 -33
  290. package/styles/components/fs_icon_field.scss +0 -12
  291. package/styles/components/fs_search_field.scss +0 -3
  292. package/styles/components/fs_tag_field.scss +0 -8
  293. package/styles/components/fs_time_field.scss +0 -12
  294. package/styles/components/fs_timeslot_field.scss +0 -12
  295. package/styles/globals/breakpoints.scss +0 -20
  296. package/styles/globals/fixes.scss +0 -5
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSButton
3
- :label="$tr('ui.button.validate', 'Validate')"
3
+ :label="$tr('ui.common.validate', 'Validate')"
4
4
  :color="ColorEnum.Primary"
5
5
  v-bind="$attrs"
6
6
  />
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <FSCol>
3
+ <FSRow
4
+ v-if="$props.showHeader"
5
+ :wrap="false"
6
+ >
7
+ <FSCol
8
+ v-for="i in 7"
9
+ :key="i"
10
+ :style="{
11
+ minWidth: `calc((100% - 8px * 7) / 7)`,
12
+ maxWidth: `calc((100% - 8px * 7) / 7)`
13
+ }"
14
+ align="center-center"
15
+ >
16
+ {{ dayLabel(i - 1) }}
17
+ </FSCol>
18
+ </FSRow>
19
+ <FSRow>
20
+ <FSCol
21
+ v-for="date in days"
22
+ :key="$props.month + $props.year + date.date.toISOString()"
23
+ :style="{
24
+ minWidth: `calc((100% - 8px * 7) / 7)`,
25
+ maxWidth: `calc((100% - 8px * 7) / 7)`
26
+ }"
27
+ align="center-center"
28
+ height="hug"
29
+ >
30
+ <slot
31
+ name="day"
32
+ v-bind="date"
33
+ />
34
+ </FSCol>
35
+ </FSRow>
36
+ </FSCol>
37
+ </template>
38
+
39
+ <script lang="ts">
40
+ import { startOfWeek, endOfWeek, endOfMonth, isSameDay, isBefore, isAfter, isSameMonth, addDays } from "date-fns";
41
+ import { defineComponent, computed } from "vue";
42
+
43
+ import { dayLabel } from "../../tools";
44
+
45
+ import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
46
+
47
+ import FSRow from "../FSRow.vue";
48
+ import FSCol from "../FSCol.vue";
49
+
50
+ export default defineComponent({
51
+ name: "FSCalendarHeader",
52
+ components: {
53
+ FSRow,
54
+ FSCol
55
+ },
56
+ props: {
57
+ year: {
58
+ type: Number,
59
+ required: true
60
+ },
61
+ month: {
62
+ type: Number,
63
+ required: true
64
+ },
65
+ showHeader: {
66
+ type: Boolean,
67
+ default: true
68
+ }
69
+ },
70
+ setup(props) {
71
+
72
+ const { getMachineOffset } = useAppTimeZone();
73
+
74
+ const firstDayOfMonth = computed(() => {
75
+ const date = new Date(props.year, props.month - 1, 1);
76
+ const offset = getMachineOffset(date.getTime());
77
+
78
+ date.setTime(date.getTime() + offset);
79
+
80
+ return date;
81
+ })
82
+
83
+ const firstMonday = computed(() => {
84
+ const day = new Date(firstDayOfMonth.value);
85
+
86
+ const date = startOfWeek(day, { weekStartsOn: 1 });
87
+ const offset = getMachineOffset(date.getTime());
88
+
89
+ date.setTime(date.getTime() + offset);
90
+
91
+ return date;
92
+ });
93
+
94
+ const endDayOfMonth = computed(() => {
95
+ const day = new Date(firstDayOfMonth.value);
96
+
97
+ const date = endOfMonth(day);
98
+ const offset = getMachineOffset(date.getTime());
99
+
100
+ date.setTime(date.getTime() + offset);
101
+
102
+ return date;
103
+ });
104
+
105
+ const lastSunday = computed(() => {
106
+ const day = new Date(endDayOfMonth.value);
107
+
108
+ const date = endOfWeek(day, { weekStartsOn: 1 });
109
+ const offset = getMachineOffset(date.getTime());
110
+
111
+ date.setTime(date.getTime() + offset);
112
+
113
+ return date;
114
+ });
115
+
116
+ const days = computed(() => {
117
+ const result = [];
118
+
119
+ let currentDay = new Date(firstMonday.value);
120
+ const today = new Date();
121
+
122
+ while (currentDay <= lastSunday.value) {
123
+ result.push({
124
+ date: new Date(currentDay),
125
+ isToday: isSameDay(currentDay, today),
126
+ isPast: isBefore(currentDay, today) && !isSameDay(currentDay, today),
127
+ isFutur: isAfter(currentDay, today) && !isSameDay(currentDay, today),
128
+ isPreviousMonth: isBefore(currentDay, firstDayOfMonth.value),
129
+ isNextMonth: isAfter(currentDay, endDayOfMonth.value),
130
+ isCurrentMonth: isSameMonth(currentDay, firstDayOfMonth.value)
131
+ });
132
+
133
+ currentDay = addDays(currentDay, 1);
134
+ }
135
+
136
+ return result;
137
+ });
138
+
139
+ return {
140
+ dayLabel,
141
+ days
142
+ };
143
+ }
144
+ });
145
+ </script>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <FSRow>
3
+ <FSSimpleMonthSelector
4
+ width="hug"
5
+ :year="$props.year"
6
+ :month="$props.month"
7
+ @update:year="$emit('update:year', $event)"
8
+ @update:month="$emit('update:month', $event)"
9
+ @update="$emit('update', $event)"
10
+ />
11
+ <FSButton
12
+ :label="$tr('ui.common.today', 'Today')"
13
+ icon="mdi-calendar-today"
14
+ @click="onToday"
15
+ />
16
+ </FSRow>
17
+ </template>
18
+
19
+ <script lang="ts">
20
+ import { defineComponent } from "vue";
21
+
22
+ import FSRow from "../FSRow.vue";
23
+ import FSButton from "../FSButton.vue";
24
+
25
+ import FSSimpleMonthSelector from "./FSSimpleMonthSelector.vue";
26
+
27
+ export default defineComponent({
28
+ name: "FSCalendarHeader",
29
+ components: {
30
+ FSRow,
31
+ FSButton,
32
+ FSSimpleMonthSelector
33
+ },
34
+ props: {
35
+ year: {
36
+ type: Number,
37
+ required: true
38
+ },
39
+ month: {
40
+ type: Number,
41
+ required: true
42
+ }
43
+ },
44
+ setup(_props, { emit }) {
45
+ const onToday = () => {
46
+ const now = new Date();
47
+ emit("update:year", now.getFullYear());
48
+ emit("update:month", now.getMonth() + 1);
49
+ emit("update", {
50
+ year: now.getFullYear(),
51
+ month: now.getMonth() + 1
52
+ });
53
+ };
54
+
55
+ return {
56
+ onToday
57
+ };
58
+ }
59
+ });
60
+ </script>
@@ -0,0 +1,138 @@
1
+ <template>
2
+ <FSRow
3
+ align="center-center"
4
+ >
5
+ <FSButtonPreviousIcon
6
+ @click="onPrevious"
7
+ />
8
+ <FSRow>
9
+ <!-- TODO : mettre un VMenu sur le FSColor pour pouvoir changer d'année plus vite -->
10
+ <FSColor
11
+ :border="false"
12
+ padding="0px 30px"
13
+ :color="$props.color"
14
+ width="100%"
15
+ :height="[40, 36]"
16
+ style="min-width: 210px;"
17
+ >
18
+ <FSRow
19
+ width="100%"
20
+ height="100%"
21
+ align="center-center"
22
+ >
23
+ <FSSpan
24
+ font="text-h3"
25
+ >
26
+ {{ monthToString($props.month) }}
27
+ </FSSpan>
28
+ <FSSpan
29
+ font="text-h3"
30
+ >
31
+ {{ $props.year }}
32
+ </FSSpan>
33
+ </FSRow>
34
+ </FSColor>
35
+ </FSRow>
36
+ <FSButtonNextIcon
37
+ @click="onNext"
38
+ />
39
+ </FSRow>
40
+ </template>
41
+
42
+ <script lang="ts">
43
+ import { defineComponent, type PropType } from "vue";
44
+
45
+ import { useTranslations } from "@dative-gpi/bones-ui";
46
+ import { Months } from '@dative-gpi/foundation-shared-domain/enums';
47
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
48
+
49
+ import FSRow from "../FSRow.vue";
50
+ import FSSpan from "../FSSpan.vue";
51
+ import FSColor from "../FSColor.vue";
52
+
53
+ import FSButtonNextIcon from "../buttons/FSButtonNextIcon.vue";
54
+ import FSButtonPreviousIcon from "../buttons/FSButtonPreviousIcon.vue";
55
+
56
+ export default defineComponent({
57
+ name: "FSMonthSelector",
58
+ components: {
59
+ FSRow,
60
+ FSSpan,
61
+ FSColor,
62
+ FSButtonNextIcon,
63
+ FSButtonPreviousIcon
64
+ },
65
+ props: {
66
+ color: {
67
+ type: String,
68
+ required: false,
69
+ default: ColorEnum.Primary
70
+ },
71
+ month: {
72
+ type: Number as PropType<Months>,
73
+ required: true
74
+ },
75
+ year: {
76
+ type: Number,
77
+ required: true
78
+ }
79
+ },
80
+ emits: ["update:month", "update:year", "update"],
81
+ setup(props, { emit }) {
82
+ const { $tr } = useTranslations();
83
+
84
+ const monthToString = (month: number) => {
85
+ switch(month) {
86
+ case Months.January:
87
+ return $tr("ui.common.january", "January");
88
+ case Months.February:
89
+ return $tr("ui.common.february", "February");
90
+ case Months.March:
91
+ return $tr("ui.common.march", "March");
92
+ case Months.April:
93
+ return $tr("ui.common.april", "April");
94
+ case Months.May:
95
+ return $tr("ui.common.may", "May");
96
+ case Months.June:
97
+ return $tr("ui.common.june", "June");
98
+ case Months.July:
99
+ return $tr("ui.common.july", "July");
100
+ case Months.August:
101
+ return $tr("ui.common.august", "August");
102
+ case Months.September:
103
+ return $tr("ui.common.september", "September");
104
+ case Months.October:
105
+ return $tr("ui.common.october", "October");
106
+ case Months.November:
107
+ return $tr("ui.common.november", "November");
108
+ case Months.December:
109
+ return $tr("ui.common.december", "December");
110
+ }
111
+ }
112
+
113
+ const onNext = () => {
114
+ emit("update:month", props.month === 12 ? 1 : props.month + 1);
115
+ emit("update:year", props.month === 12 ? props.year + 1 : props.year);
116
+ emit("update", {
117
+ month: props.month === 12 ? 1 : props.month + 1,
118
+ year: props.month === 12 ? props.year + 1 : props.year
119
+ })
120
+ }
121
+
122
+ const onPrevious = () => {
123
+ emit("update:month", props.month === 1 ? 12 : props.month - 1);
124
+ emit("update:year", props.month === 1 ? props.year - 1 : props.year);
125
+ emit("update", {
126
+ month: props.month === 1 ? 12 : props.month - 1,
127
+ year: props.month === 1 ? props.year - 1 : props.year
128
+ })
129
+ }
130
+
131
+ return {
132
+ monthToString,
133
+ onNext,
134
+ onPrevious
135
+ };
136
+ }
137
+ });
138
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <v-carousel
3
+ v-bind="$attrs"
4
+ >
5
+ <template
6
+ v-for="(_, name) in $slots"
7
+ v-slot:[name]="slotData"
8
+ >
9
+ <slot
10
+ :name="name"
11
+ v-bind="slotData"
12
+ />
13
+ </template>
14
+ </v-carousel>
15
+ </template>
16
+
17
+ <script lang="ts">
18
+ import { defineComponent } from "vue";
19
+
20
+ export default defineComponent({
21
+ name: "FSCarousel"
22
+ });
23
+ </script>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <v-carousel-item
3
+ v-bind="$attrs"
4
+ >
5
+ <slot/>
6
+ </v-carousel-item>
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent } from "vue";
11
+ export default defineComponent({
12
+ name: "FSCarouselItem"
13
+ });
14
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-menu
2
+ <FSMenu
3
3
  :closeOnContentClick="false"
4
4
  v-model="menu"
5
5
  location="bottom center"
@@ -22,7 +22,7 @@
22
22
  :deviceConnectivity="$props.deviceConnectivity"
23
23
  @close="menu = false"
24
24
  />
25
- </v-menu>
25
+ </FSMenu>
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
@@ -33,12 +33,14 @@ import type { FSDeviceConnectivity } from "@dative-gpi/foundation-shared-compone
33
33
 
34
34
  import FSConnectivityCard from "./FSConnectivityCard.vue";
35
35
  import FSColorIcon from "../FSColorIcon.vue";
36
+ import FSMenu from '../FSMenu.vue';
36
37
 
37
38
  export default defineComponent({
38
39
  name: "FSConnectivity",
39
40
  components: {
40
41
  FSConnectivityCard,
41
- FSColorIcon
42
+ FSColorIcon,
43
+ FSMenu
42
44
  },
43
45
  props: {
44
46
  deviceConnectivity: {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-menu
2
+ <FSMenu
3
3
  :closeOnContentClick="false"
4
4
  v-model="menu"
5
5
  location="bottom center"
@@ -23,7 +23,7 @@
23
23
  :statusGroup="$props.statusGroup"
24
24
  @close="menu = false"
25
25
  />
26
- </v-menu>
26
+ </FSMenu>
27
27
  </template>
28
28
 
29
29
  <script lang="ts">
@@ -34,12 +34,14 @@ import type { FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-
34
34
 
35
35
  import FSStatusCard from "./FSStatusCard.vue";
36
36
  import FSColorIcon from "../FSColorIcon.vue";
37
+ import FSMenu from '../FSMenu.vue';
37
38
 
38
39
  export default defineComponent({
39
40
  name: "FSStatus",
40
41
  components: {
41
42
  FSStatusCard,
42
- FSColorIcon
43
+ FSColorIcon,
44
+ FSMenu
43
45
  },
44
46
  props: {
45
47
  modelStatus: {
@@ -10,7 +10,7 @@
10
10
  <FSChip
11
11
  :prependIcon="$props.statusGroup.icon"
12
12
  :color="$props.statusGroup.color"
13
- :label="statusLabel"
13
+ :label="$props.modelStatus.label"
14
14
  />
15
15
  <FSCol
16
16
  v-if="$props.statusGroup.value"
@@ -27,7 +27,7 @@
27
27
  font="text-button"
28
28
  :color="$props.statusGroup.color"
29
29
  >
30
- {{ statusValue }} {{ $props.statusGroup.unit }}
30
+ {{ statusValue }}
31
31
  </FSText>
32
32
  </FSCol>
33
33
  <FSText
@@ -78,15 +78,14 @@ export default defineComponent({
78
78
  setup(props) {
79
79
  const { epochToLongTimeFormat } = useDateFormat();
80
80
 
81
- const statusLabel = computed((): string => {
82
- return props.statusGroup.label || props.modelStatus.label;
83
- });
84
-
85
81
  const statusValue = computed((): string => {
82
+ if (props.statusGroup.label) {
83
+ return props.statusGroup.label;
84
+ }
86
85
  if (props.statusGroup.value && !isNaN(parseFloat(props.statusGroup.value))) {
87
- return parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 });
86
+ return `${parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 })} ${props.statusGroup.unit}`;
88
87
  }
89
- return props.statusGroup.value || "";
88
+ return `${props.statusGroup.value} ${props.statusGroup.unit}`;
90
89
  });
91
90
 
92
91
  const deviceTimestamp = computed((): string => {
@@ -98,7 +97,6 @@ export default defineComponent({
98
97
 
99
98
  return {
100
99
  deviceTimestamp,
101
- statusLabel,
102
100
  statusValue
103
101
  };
104
102
  }
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <component
3
+ v-if="$props.modelStatus"
4
+ class="fs-status-rich-card"
5
+ topRightPadding="2px"
6
+ variant="standard"
7
+ :is="$attrs.onClick ? FSClickable : FSCard"
8
+ :padding="$props.padding"
9
+ :height="$props.height"
10
+ :width="$props.width"
11
+ :color="color"
12
+ :style="style"
13
+ >
14
+ <FSCol
15
+ align="center-center"
16
+ :gap="$props.gap"
17
+ >
18
+ <FSRow
19
+ align="top-center"
20
+ >
21
+ <FSIcon
22
+ v-if="icon"
23
+ >
24
+ {{ icon }}
25
+ </FSIcon>
26
+ <FSText
27
+ v-if="value"
28
+ font="text-button"
29
+ >
30
+ {{ value }}
31
+ </FSText>
32
+ </FSRow>
33
+ <FSText
34
+ font="text-overline"
35
+ align="center"
36
+ :lineClamp="$props.titleClamp"
37
+ >
38
+ {{ title }}
39
+ </FSText>
40
+ <slot
41
+ name="footer"
42
+ v-bind="{ color }"
43
+ />
44
+ </FSCol>
45
+ <template
46
+ #top-right
47
+ >
48
+ <slot
49
+ name="corner"
50
+ v-bind="{ color }"
51
+ />
52
+ </template>
53
+ </component>
54
+ </template>
55
+
56
+ <script lang="ts">
57
+ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
58
+
59
+ import { ColorEnum, type FSDeviceStatusGroup, type FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
60
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
61
+
62
+ import FSClickable from "../FSClickable.vue";
63
+ import FSCard from "../FSCard.vue";
64
+ import FSIcon from "../FSChip.vue";
65
+ import FSText from "../FSText.vue";
66
+ import FSCol from "../FSCol.vue";
67
+
68
+ export default defineComponent({
69
+ name: "FSStatusRichCard",
70
+ components: {
71
+ FSClickable,
72
+ FSCard,
73
+ FSIcon,
74
+ FSText,
75
+ FSCol
76
+ },
77
+ props: {
78
+ height: {
79
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
80
+ required: false,
81
+ default: "100px"
82
+ },
83
+ width: {
84
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
85
+ required: false,
86
+ default: "160px"
87
+ },
88
+ padding: {
89
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
90
+ required: false,
91
+ default: "12px"
92
+ },
93
+ gap: {
94
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
95
+ required: false,
96
+ default: "8px"
97
+ },
98
+ title: {
99
+ type: [String, null] as PropType<string | null>,
100
+ required: false,
101
+ default: null
102
+ },
103
+ titleClamp: {
104
+ type: Number,
105
+ required: false,
106
+ default: 2
107
+ },
108
+ color: {
109
+ type: [String, null] as PropType<string | null>,
110
+ required: false,
111
+ default: null
112
+ },
113
+ fillBackground: {
114
+ type: Boolean,
115
+ required: false,
116
+ default: false
117
+ },
118
+ modelStatus: {
119
+ type: Object as PropType<FSModelStatus | undefined>,
120
+ required: true
121
+ },
122
+ statusGroup: {
123
+ type: Object as PropType<FSDeviceStatusGroup | undefined>,
124
+ required: true
125
+ }
126
+ },
127
+ setup(props) {
128
+ const { getColors } = useColors();
129
+
130
+ const color = computed((): string => {
131
+ return props.color ?? props.statusGroup?.color ?? props.modelStatus?.colorDefault ?? ColorEnum.Primary;
132
+ });
133
+
134
+ const icon = computed((): string | null => {
135
+ return props.statusGroup?.icon ?? props.modelStatus?.iconDefault ?? null;
136
+ });
137
+
138
+ const title = computed((): string => {
139
+ return props.title ?? props.modelStatus?.label ?? "";
140
+ });
141
+
142
+ const value = computed((): string | null => {
143
+ if (props.statusGroup?.label) {
144
+ return props.statusGroup.label;
145
+ }
146
+ if (props.statusGroup?.value && !isNaN(parseFloat(props.statusGroup?.value))) {
147
+ return `${parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 })} ${props.statusGroup.unit}`;
148
+ }
149
+ if (props.statusGroup?.value) {
150
+ return `${props.statusGroup?.value} ${props.statusGroup?.unit}`;
151
+ }
152
+ return null;
153
+ });
154
+
155
+ const style = computed((): StyleValue => ({
156
+ "--fs-status-rich-card-background-color": props.fillBackground ? getColors(color.value).light : "transparent",
157
+ "--fs-status-rich-card-border-color": props.fillBackground ? getColors(color.value).base : getColors(ColorEnum.Light).dark
158
+ }));
159
+
160
+ return {
161
+ FSClickable,
162
+ FSCard,
163
+ color,
164
+ style,
165
+ title,
166
+ value,
167
+ icon
168
+ };
169
+ }
170
+ });
171
+ </script>