@dative-gpi/foundation-shared-components 1.0.57 → 1.0.58-groupings

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 (297) 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 +16 -16
  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/FSColorIcon.vue +23 -5
  16. package/components/FSDialog.vue +2 -1
  17. package/components/FSDialogContent.vue +12 -11
  18. package/components/FSDialogForm.vue +22 -2
  19. package/components/FSDialogFormBody.vue +50 -31
  20. package/components/FSDialogMenu.vue +17 -8
  21. package/components/FSDialogMultiFormBody.vue +23 -13
  22. package/components/FSDialogRemove.vue +7 -8
  23. package/components/FSDialogSubmit.vue +20 -11
  24. package/components/FSEditImage.vue +1 -1
  25. package/components/FSEditImageUI.vue +20 -10
  26. package/components/FSFadeOut.vue +53 -21
  27. package/components/FSForm.vue +10 -8
  28. package/components/FSGrid.vue +1 -1
  29. package/components/FSIcon.vue +4 -3
  30. package/components/FSIconCard.vue +68 -12
  31. package/components/FSImage.vue +9 -2
  32. package/components/FSImageUI.vue +8 -15
  33. package/components/FSInformationsMenu.vue +142 -0
  34. package/components/FSInstantPicker.vue +269 -0
  35. package/components/FSLink.vue +25 -9
  36. package/components/FSLoader.vue +28 -10
  37. package/components/FSMenu.vue +47 -0
  38. package/components/FSOptionGroup.vue +57 -9
  39. package/components/FSOptionItem.vue +4 -4
  40. package/components/FSPagination.vue +1 -1
  41. package/components/FSPlayButtons.vue +72 -0
  42. package/components/FSProgressBar.vue +94 -0
  43. package/components/FSRadio.vue +5 -4
  44. package/components/FSRadioGroup.vue +3 -3
  45. package/components/FSRouterLink.vue +42 -0
  46. package/components/FSSlideGroup.vue +19 -5
  47. package/components/FSSlider.vue +6 -5
  48. package/components/FSSpan.vue +12 -7
  49. package/components/FSSwitch.vue +47 -21
  50. package/components/FSTab.vue +15 -13
  51. package/components/FSTabs.vue +32 -7
  52. package/components/FSTag.vue +16 -5
  53. package/components/FSTagGroup.vue +4 -4
  54. package/components/FSText.vue +11 -7
  55. package/components/FSToggleSet.vue +7 -7
  56. package/components/FSWindow.vue +122 -5
  57. package/components/FSWrapGroup.vue +13 -1
  58. package/components/agenda/FSAgenda.vue +26 -7
  59. package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
  60. package/components/agenda/FSAgendaHeader.vue +35 -10
  61. package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
  62. package/components/agenda/FSAgendaHoursRow.vue +48 -8
  63. package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
  64. package/components/agenda/FSDayAgenda.vue +1 -2
  65. package/components/agenda/FSMonthAgenda.vue +3 -9
  66. package/components/agenda/FSSelectAgendaMode.vue +2 -2
  67. package/components/agenda/FSWeekAgenda.vue +7 -13
  68. package/components/autocompletes/FSAutoCompleteAddress.vue +25 -20
  69. package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
  70. package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
  71. package/components/buttons/FSButtonAdd.vue +1 -1
  72. package/components/buttons/FSButtonAddLabel.vue +1 -1
  73. package/components/buttons/FSButtonCancel.vue +1 -1
  74. package/components/buttons/FSButtonCancelLabel.vue +1 -1
  75. package/components/buttons/FSButtonCheckbox.vue +4 -4
  76. package/components/buttons/FSButtonCopy.vue +1 -1
  77. package/components/buttons/FSButtonCopyLabel.vue +1 -1
  78. package/components/buttons/FSButtonDuplicate.vue +1 -1
  79. package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
  80. package/components/buttons/FSButtonEdit.vue +1 -1
  81. package/components/buttons/FSButtonEditLabel.vue +1 -1
  82. package/components/buttons/FSButtonFile.vue +1 -1
  83. package/components/buttons/FSButtonFileLabel.vue +1 -1
  84. package/components/buttons/FSButtonNext.vue +1 -1
  85. package/components/buttons/FSButtonNextLabel.vue +1 -1
  86. package/components/buttons/FSButtonPrevious.vue +1 -1
  87. package/components/buttons/FSButtonPreviousLabel.vue +1 -1
  88. package/components/buttons/FSButtonRedo.vue +1 -1
  89. package/components/buttons/FSButtonRedoLabel.vue +1 -1
  90. package/components/buttons/FSButtonRemove.vue +1 -1
  91. package/components/buttons/FSButtonRemoveLabel.vue +1 -1
  92. package/components/buttons/FSButtonSave.vue +1 -1
  93. package/components/buttons/FSButtonSaveLabel.vue +1 -1
  94. package/components/buttons/FSButtonSearch.vue +1 -1
  95. package/components/buttons/FSButtonSearchLabel.vue +1 -1
  96. package/components/buttons/FSButtonUndo.vue +1 -1
  97. package/components/buttons/FSButtonUndoLabel.vue +1 -1
  98. package/components/buttons/FSButtonUpdate.vue +1 -1
  99. package/components/buttons/FSButtonUpdateLabel.vue +1 -1
  100. package/components/buttons/FSButtonValidate.vue +1 -1
  101. package/components/buttons/FSButtonValidateLabel.vue +1 -1
  102. package/components/calendar/FSSimpleCalendar.vue +145 -0
  103. package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
  104. package/components/calendar/FSSimpleMonthSelector.vue +138 -0
  105. package/components/deviceOrganisations/FSConnectivity.vue +16 -4
  106. package/components/deviceOrganisations/FSConnectivityCard.vue +17 -45
  107. package/components/deviceOrganisations/FSStatus.vue +16 -4
  108. package/components/deviceOrganisations/FSStatusCard.vue +33 -59
  109. package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
  110. package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
  111. package/components/deviceOrganisations/FSStatusesRow.vue +8 -2
  112. package/components/deviceOrganisations/FSWorstAlert.vue +37 -42
  113. package/components/deviceOrganisations/FSWorstAlertCard.vue +35 -84
  114. package/components/fields/FSAutocompleteField.vue +85 -82
  115. package/components/fields/FSAutocompleteTag.vue +1 -1
  116. package/components/fields/FSBaseField.vue +54 -30
  117. package/components/fields/FSClosableSearchField.vue +83 -0
  118. package/components/fields/FSColorField.vue +48 -44
  119. package/components/fields/FSCommentField.vue +28 -16
  120. package/components/fields/FSDateField.vue +13 -10
  121. package/components/fields/FSDateRangeField.vue +6 -5
  122. package/components/fields/FSDateTimeField.vue +14 -11
  123. package/components/fields/FSDateTimeRangeDialog.vue +160 -0
  124. package/components/fields/FSDateTimeRangeField.vue +23 -115
  125. package/components/fields/FSEntityFieldUI.vue +36 -19
  126. package/components/fields/FSGradientField.vue +5 -5
  127. package/components/fields/FSIconField.vue +16 -9
  128. package/components/fields/FSMagicConfigField.vue +15 -7
  129. package/components/fields/FSMagicField.vue +7 -2
  130. package/components/fields/FSNumberField.vue +9 -4
  131. package/components/fields/FSPasswordField.vue +7 -7
  132. package/components/fields/FSRichTextField.vue +78 -58
  133. package/components/fields/FSSearchField.vue +9 -115
  134. package/components/fields/FSSelectField.vue +69 -71
  135. package/components/fields/FSTagField.vue +10 -10
  136. package/components/fields/FSTermField.vue +72 -47
  137. package/components/fields/FSTextArea.vue +17 -11
  138. package/components/fields/FSTextField.vue +15 -10
  139. package/components/fields/FSTimeField.vue +14 -10
  140. package/components/fields/FSTimeRangeField.vue +310 -0
  141. package/components/fields/FSTimeStepField.vue +5 -5
  142. package/components/fields/FSTranslateField.vue +10 -10
  143. package/components/fields/FSTranslateRichTextField.vue +41 -20
  144. package/components/fields/FSTranslateTextArea.vue +10 -10
  145. package/components/fields/FSTreeViewField.vue +15 -13
  146. package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
  147. package/components/fields/periodicField/FSPeriodicField.vue +15 -15
  148. package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
  149. package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
  150. package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
  151. package/components/lists/FSDataIteratorItem.vue +23 -67
  152. package/components/lists/FSDataTableUI.vue +220 -137
  153. package/components/lists/FSDraggable.vue +2 -2
  154. package/components/lists/FSFilterButton.vue +14 -16
  155. package/components/lists/FSHeaderButton.vue +11 -9
  156. package/components/lists/FSHiddenButton.vue +9 -9
  157. package/components/lists/FSLoadDataTable.vue +10 -7
  158. package/components/lists/FSSimpleList.vue +95 -82
  159. package/components/lists/FSSimpleListItem.vue +131 -0
  160. package/components/map/FSMap.vue +146 -158
  161. package/components/map/FSMapFeatureGroup.vue +7 -1
  162. package/components/map/FSMapLayerButton.vue +4 -3
  163. package/components/map/FSMapMarker.vue +70 -48
  164. package/components/map/FSMapMarkerClusterGroup.vue +32 -7
  165. package/components/map/FSMapOverlay.vue +44 -24
  166. package/components/map/FSMapPolygon.vue +16 -4
  167. package/components/map/FSMapTileLayer.vue +26 -9
  168. package/components/map/layers.ts +0 -0
  169. package/components/selects/FSSelectAutoRefresh.vue +8 -8
  170. package/components/selects/FSSelectDashboardVariableType.vue +4 -3
  171. package/components/selects/FSSelectDateSetting.vue +2 -2
  172. package/components/selects/FSSelectDays.vue +8 -8
  173. package/components/selects/FSSelectListMode.vue +2 -2
  174. package/components/selects/FSSelectMapLayer.vue +68 -0
  175. package/components/selects/FSSelectMonths.vue +13 -13
  176. package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
  177. package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
  178. package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
  179. package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
  180. package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
  181. package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
  182. package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
  183. package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
  184. package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
  185. package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
  186. package/components/tiles/FSAlertTileUI.vue +90 -0
  187. package/components/tiles/FSChartTileUI.vue +61 -52
  188. package/components/tiles/FSCommentTileUI.vue +38 -13
  189. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
  190. package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
  191. package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -6
  192. package/components/tiles/FSGroupTileUI.vue +58 -110
  193. package/components/tiles/FSGroupingTileUI.vue +115 -0
  194. package/components/tiles/FSLoadTile.vue +16 -10
  195. package/components/tiles/FSLocationTileUI.vue +63 -55
  196. package/components/tiles/FSModelTileUI.vue +5 -46
  197. package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
  198. package/components/tiles/FSSimpleTileUI.vue +34 -29
  199. package/components/tiles/FSTile.vue +46 -39
  200. package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
  201. package/components/toggleSets/FSToggleSetPosition.vue +1 -1
  202. package/components/views/FSBaseView.vue +64 -0
  203. package/components/views/FSEntityView.vue +12 -140
  204. package/components/views/FSSimpleView.vue +29 -0
  205. package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
  206. package/components/views/desktop/FSBaseDesktopView.vue +53 -0
  207. package/components/views/desktop/FSBaseEntityDesktopView.vue +211 -0
  208. package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
  209. package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
  210. package/components/views/mobile/FSBaseMobileView.vue +53 -0
  211. package/composables/index.ts +1 -0
  212. package/composables/useAddress.ts +40 -8
  213. package/composables/useBreakpoints.ts +40 -4
  214. package/composables/useColors.ts +16 -7
  215. package/composables/useMagicFieldProvider.ts +1 -0
  216. package/composables/useMapLayers.ts +62 -0
  217. package/composables/useSlots.ts +2 -1
  218. package/models/colors.ts +2 -1
  219. package/models/deviceAlerts.ts +1 -0
  220. package/models/magicFields.ts +1 -0
  221. package/models/map.ts +12 -10
  222. package/models/rules.ts +6 -3
  223. package/models/tables.ts +5 -2
  224. package/models/variableNode.ts +8 -5
  225. package/package.json +5 -5
  226. package/styles/components/fs_agenda.scss +4 -0
  227. package/styles/components/fs_agenda_event.scss +1 -1
  228. package/styles/components/fs_agenda_hours_row.scss +0 -8
  229. package/styles/components/fs_autocomplete_field.scss +0 -13
  230. package/styles/components/fs_breadcrumbs.scss +18 -36
  231. package/styles/components/fs_button.scss +7 -5
  232. package/styles/components/fs_calendar.scss +1 -0
  233. package/styles/components/fs_card.scss +9 -0
  234. package/styles/components/fs_chip.scss +13 -7
  235. package/styles/components/fs_clickable.scss +16 -23
  236. package/styles/components/fs_clock.scss +0 -10
  237. package/styles/components/fs_col.scss +1 -1
  238. package/styles/components/fs_color_field.scss +1 -4
  239. package/styles/components/fs_data_table.scss +6 -9
  240. package/styles/components/fs_dialog.scss +4 -10
  241. package/styles/components/fs_dialog_menu.scss +4 -2
  242. package/styles/components/fs_draggable.scss +0 -5
  243. package/styles/components/fs_edit_image.scss +8 -0
  244. package/styles/components/fs_fade_out.scss +10 -2
  245. package/styles/components/fs_filter_button.scss +1 -6
  246. package/styles/components/fs_hidden_button.scss +2 -7
  247. package/styles/components/fs_image_card.scss +6 -4
  248. package/styles/components/fs_magic_config_field.scss +1 -2
  249. package/styles/components/fs_map.scss +57 -17
  250. package/styles/components/fs_meta_field.scss +3 -5
  251. package/styles/components/fs_option_group.scss +15 -5
  252. package/styles/components/fs_password_field.scss +4 -2
  253. package/styles/components/fs_progress_bar.scss +14 -0
  254. package/styles/components/fs_radio.scss +0 -11
  255. package/styles/components/fs_rich_text_field.scss +1 -10
  256. package/styles/components/fs_select_field.scss +4 -13
  257. package/styles/components/fs_slide_group.scss +7 -0
  258. package/styles/components/fs_span.scss +13 -5
  259. package/styles/components/fs_status_rich_card.scss +6 -0
  260. package/styles/components/fs_switch.scss +1 -0
  261. package/styles/components/fs_tabs.scss +19 -34
  262. package/styles/components/fs_tag.scss +8 -22
  263. package/styles/components/fs_text_area.scss +2 -21
  264. package/styles/components/fs_tile.scss +0 -19
  265. package/styles/components/fs_window.scss +3 -1
  266. package/styles/components/fs_wrap_group.scss +7 -0
  267. package/styles/components/index.scss +2 -6
  268. package/styles/globals/index.scss +1 -5
  269. package/styles/globals/overrides.scss +28 -61
  270. package/styles/globals/scrollbars.scss +8 -0
  271. package/styles/globals/text_fonts.scss +18 -66
  272. package/styles/globals/touchscreen.scss +2 -2
  273. package/tools/alertsTools.ts +87 -12
  274. package/tools/chartsTools.ts +143 -16
  275. package/tools/index.ts +3 -1
  276. package/tools/reportsTools.ts +38 -0
  277. package/tools/timeRangeTools.ts +125 -0
  278. package/utils/badge.ts +9 -5
  279. package/utils/filter.ts +7 -4
  280. package/utils/index.ts +1 -0
  281. package/utils/leafletMarkers.ts +4 -4
  282. package/utils/operations.ts +108 -0
  283. package/utils/sort.ts +2 -2
  284. package/utils/time.ts +16 -16
  285. package/components/fields/FSTimeSlotField.vue +0 -250
  286. package/components/views/FSEntityHeader.vue +0 -350
  287. package/components/views/FSListHeader.vue +0 -83
  288. package/components/views/FSListView.vue +0 -83
  289. package/components/views/FSSkeletonView.vue +0 -100
  290. package/styles/components/fs_data_iterator_item.scss +0 -33
  291. package/styles/components/fs_icon_field.scss +0 -12
  292. package/styles/components/fs_search_field.scss +0 -3
  293. package/styles/components/fs_tag_field.scss +0 -8
  294. package/styles/components/fs_time_field.scss +0 -12
  295. package/styles/components/fs_timeslot_field.scss +0 -12
  296. package/styles/globals/breakpoints.scss +0 -20
  297. package/styles/globals/fixes.scss +0 -5
@@ -7,8 +7,8 @@
7
7
  :elevation="true"
8
8
  >
9
9
  <FSCol
10
- gap="12px"
11
10
  padding="16px"
11
+ gap="12px"
12
12
  >
13
13
  <FSCalendar
14
14
  v-model="calendarValue"
@@ -16,7 +16,7 @@
16
16
  <FSButton
17
17
  color="primary"
18
18
  width="100%"
19
- :label="$tr('ui.agenda.calendar.dialog.submit', 'Validate')"
19
+ :label="$tr('ui.common.submit', 'Validate')"
20
20
  @click="onSubmit"
21
21
  />
22
22
  </FSCol>
@@ -16,12 +16,18 @@
16
16
  @click="onPrevious"
17
17
  />
18
18
  <FSButton
19
- width="180px"
19
+ width="220px"
20
20
  color="primary"
21
21
  :border="false"
22
- :label="epochToMonthYearOnlyFormat($props.start)"
23
22
  @click="showCalendarDialog = true"
24
- />
23
+ >
24
+ <FSSpan
25
+ class="fs-agenda-header-text"
26
+ font="text-button"
27
+ >
28
+ {{ epochToMonthYearOnlyFormat($props.start) }}
29
+ </FSSpan>
30
+ </FSButton>
25
31
  <FSButton
26
32
  variant="icon"
27
33
  icon="mdi-chevron-right"
@@ -41,7 +47,7 @@
41
47
  />
42
48
  <FSButton
43
49
  prependIcon="mdi-calendar-today-outline"
44
- :label="$tr('ui.agenda.today', 'Today')"
50
+ :label="$tr('ui.common.today', 'Today')"
45
51
  @click="onToday"
46
52
  />
47
53
  </FSRow>
@@ -52,7 +58,7 @@
52
58
  >
53
59
  <FSButton
54
60
  prependIcon="mdi-calendar-today-outline"
55
- :label="$tr('ui.agenda.today', 'Today')"
61
+ :label="$tr('ui.common.today', 'Today')"
56
62
  width="100%"
57
63
  @click="onToday"
58
64
  />
@@ -89,7 +95,7 @@
89
95
  </template>
90
96
 
91
97
  <script lang="ts">
92
- import { defineComponent, type PropType, ref } from 'vue';
98
+ import { defineComponent, type PropType, ref, watch } from 'vue';
93
99
 
94
100
  import { useDateFormat } from '@dative-gpi/foundation-shared-services/composables';
95
101
 
@@ -100,6 +106,7 @@ import FSRow from '../FSRow.vue';
100
106
  import FSButton from '../FSButton.vue';
101
107
  import FSSelectAgendaMode from './FSSelectAgendaMode.vue';
102
108
  import FSAgendaDialogCalendar from './FSAgendaDialogCalendar.vue';
109
+ import FSSpan from '../FSSpan.vue';
103
110
 
104
111
  export default defineComponent({
105
112
  name: 'FSAgendaHeader',
@@ -108,6 +115,7 @@ export default defineComponent({
108
115
  FSSelectAgendaMode,
109
116
  FSCol,
110
117
  FSButton,
118
+ FSSpan,
111
119
  FSRow
112
120
  },
113
121
  props: {
@@ -128,7 +136,7 @@ export default defineComponent({
128
136
  required: true
129
137
  }
130
138
  },
131
- emits: ['update:start', 'update:end', 'update:mode'],
139
+ emits: ['update', 'update:start', 'update:end', 'update:mode'],
132
140
  setup(props, { emit }) {
133
141
  const { epochToMonthYearOnlyFormat, epochToDayMonthLongOnly, epochToLocalDayStart, epochToLocalDayEnd } = useDateFormat();
134
142
 
@@ -137,18 +145,24 @@ export default defineComponent({
137
145
  const updateDateRange = (dayStart: number) => {
138
146
  const newStart = epochToLocalDayStart(dayStart);
139
147
  if (props.mode === AgendaMode.Week) {
148
+ const newEnd = epochToLocalDayEnd(newStart + (7 - new Date(newStart).getDay()) * 24 * 60 * 60 * 1000)
140
149
  emit('update:start', newStart);
141
- emit('update:end', epochToLocalDayEnd(newStart + (7 - new Date(newStart).getDay()) * 24 * 60 * 60 * 1000));
150
+ emit('update:end', newEnd);
151
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
142
152
  return;
143
153
  }
144
154
  if (props.mode === AgendaMode.Month) {
145
155
  emit('update:start', newStart);
146
156
  const lastDayOfMonth = new Date(new Date(newStart).getFullYear(), new Date(newStart).getMonth() + 1, 0);
147
- emit('update:end', epochToLocalDayEnd(lastDayOfMonth.getTime()));
157
+ const newEnd = epochToLocalDayEnd(lastDayOfMonth.getTime());
158
+ emit('update:end', newEnd);
159
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
148
160
  return;
149
161
  }
162
+ const newEnd = epochToLocalDayEnd(newStart);
150
163
  emit('update:start', newStart);
151
- emit('update:end', epochToLocalDayEnd(newStart));
164
+ emit('update:end', newEnd);
165
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
152
166
  }
153
167
 
154
168
  const onNext = () => {
@@ -175,6 +189,17 @@ export default defineComponent({
175
189
  }
176
190
  }
177
191
 
192
+ watch(() => props.mode, (newMode) => {
193
+ const dayBtwStartAndEnd = props.start + (props.end - props.start) / 2;
194
+ if (newMode === AgendaMode.Week) {
195
+ updateDateRange(dayBtwStartAndEnd - (new Date(dayBtwStartAndEnd).getDay() - 1) * 24 * 60 * 60 * 1000);
196
+ } else if (newMode === AgendaMode.Month) {
197
+ updateDateRange(new Date(dayBtwStartAndEnd).setDate(1));
198
+ } else if (newMode === AgendaMode.Day) {
199
+ updateDateRange(dayBtwStartAndEnd);
200
+ }
201
+ });
202
+
178
203
  return {
179
204
  AgendaMode,
180
205
  showCalendarDialog,
@@ -15,7 +15,7 @@
15
15
  @click="$emit('click', $props.id)"
16
16
  >
17
17
  <template
18
- #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
18
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant, width }"
19
19
  >
20
20
  <slot
21
21
  name="default"
@@ -25,6 +25,7 @@
25
25
  :timeStart="timeStart"
26
26
  :timeEnd="timeEnd"
27
27
  :variant="variant"
28
+ :width="width"
28
29
  />
29
30
  </template>
30
31
  </FSAgendaHorizontalEvent>
@@ -43,10 +44,11 @@
43
44
  name="default"
44
45
  :label="label"
45
46
  :icon="icon"
46
- :iconBis="iconBis"
47
+ :iconBis="endToday ? iconBis : null"
47
48
  :timeStart="epochToShortTimeOnlyFormat($props.start)"
48
49
  :timeEnd="epochToShortTimeOnlyFormat($props.end)"
49
50
  :variant="$props.variant"
51
+ :width="width"
50
52
  />
51
53
  </FSClickable>
52
54
  </template>
@@ -118,12 +120,20 @@ export default defineComponent({
118
120
  return dayEnd.value - props.dayStart;
119
121
  });
120
122
 
123
+ const startToday = computed(() => {
124
+ return props.start >= props.dayStart;
125
+ });
126
+
127
+ const endToday = computed(() => {
128
+ return props.end <= dayEnd.value;
129
+ });
130
+
121
131
  const dayDurationOffset = computed(() => {
122
132
  return dayDuration.value - dayToMillisecond(1);
123
133
  });
124
134
 
125
135
  const leftPosition = computed(() => {
126
- if (props.start < props.dayStart) {
136
+ if (!startToday.value) {
127
137
  return 0;
128
138
  }
129
139
  return millisecondToDay(props.start - props.dayStart - dayDurationOffset.value) * 100;
@@ -132,12 +142,12 @@ export default defineComponent({
132
142
  const width = computed(() => {
133
143
  let start = props.start - dayDurationOffset.value;
134
144
  let end = props.end - dayDurationOffset.value;
135
- if(props.variant === 'current') {
145
+ if(props.variant === 'current' && dayEnd.value > props.now) {
136
146
  end = props.now;
137
- } else if (props.end > dayEnd.value) {
147
+ } else if (!endToday.value) {
138
148
  end = dayEnd.value - dayDurationOffset.value;
139
149
  }
140
- if (props.start < props.dayStart) {
150
+ if (!startToday.value) {
141
151
  start = props.dayStart;
142
152
  }
143
153
 
@@ -148,12 +158,14 @@ export default defineComponent({
148
158
  const style = computed((): StyleValue => {
149
159
  return {
150
160
  '--fs-agenda-event-left': `${leftPosition.value}%`,
161
+ '--fs-agenda-event-border-width': startToday.value ? '3px' : '0px',
151
162
  };
152
163
  });
153
164
 
154
165
  return {
155
166
  style,
156
167
  width,
168
+ endToday,
157
169
  epochToShortTimeOnlyFormat
158
170
  };
159
171
  }
@@ -3,6 +3,7 @@
3
3
  gap="0"
4
4
  >
5
5
  <FSRow
6
+ :padding="`0 ${paddingRightHours} 0 ${paddingLeftHours}`"
6
7
  class="fs-agenda-hours-row"
7
8
  :wrap="false"
8
9
  gap="0"
@@ -36,14 +37,15 @@
36
37
  </FSRow>
37
38
  </FSRow>
38
39
  <FSRow
39
- class="fs-agenda-hours-row"
40
+ :padding="`0 ${paddingRightMarkers} 0 ${paddingLeftMarkers}`"
41
+ class="fs-agenda-hours-row-markers"
40
42
  :wrap="false"
41
43
  gap="0"
42
44
  >
43
45
  <FSRow
44
- v-for="hour in hours"
45
- :key="hour"
46
- :style="getMarkerStyle(displayNow && hour === modelValue)"
46
+ v-for="hour in 24"
47
+ :key="hour-1"
48
+ :style="getMarkerStyle(displayNow && hour-1 === modelValue)"
47
49
  width="100%"
48
50
  height="0"
49
51
  align="center-center"
@@ -59,7 +61,7 @@
59
61
  <script lang="ts">
60
62
  import { defineComponent, computed, type StyleValue } from 'vue';
61
63
 
62
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
64
+ import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
63
65
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
64
66
 
65
67
  import FSText from '../FSText.vue';
@@ -87,18 +89,51 @@ export default defineComponent({
87
89
  required: false,
88
90
  default: false,
89
91
  },
92
+ firstColumnWidth: {
93
+ type: String,
94
+ required: true,
95
+ },
90
96
  },
91
- setup() {
97
+ setup(props) {
92
98
  const { getColors } = useColors();
99
+ const { isMobileSized } = useBreakpoints();
93
100
 
94
101
  const lightColors = getColors(ColorEnum.Light);
95
102
  const primaryColors = getColors(ColorEnum.Primary);
96
103
  const fontColor = lightColors.dark;
97
104
 
105
+ const hoursToShow = computed(() => {
106
+ if(isMobileSized.value) {
107
+ return 12;
108
+ }
109
+ return 24;
110
+ });
111
+
98
112
  const hours = computed(() => {
99
- return Array.from({ length: 24 }, (_, i) => i);
113
+ return Array.from({ length: hoursToShow.value }, (_, i) => i * (24 / hoursToShow.value));
114
+ });
115
+
116
+ const paddingLeftHours = computed(() => {
117
+ // ((100% - ${props.firstColumnWidth}) / ${hoursToShow.value}) is the width of each hour slot (2 hour if 12 hours are shown, 1 hour if 24 hours are shown)
118
+ // 0.5 * ((100% - ${props.firstColumnWidth}) / ${hoursToShow.value}) is half of the width of each hour slot
119
+ // So we have : ${props.firstColumnWidth} - Half of the width of each hour slot
120
+ return `calc(${props.firstColumnWidth} - 0.5 * ((100% - ${props.firstColumnWidth}) / ${hoursToShow.value}))`;
100
121
  });
101
122
 
123
+ const paddingRightHours = computed(() => {
124
+ return `calc(0.5 * ((100% - ${props.firstColumnWidth}) / ${hoursToShow.value}))`;
125
+ });
126
+
127
+ const paddingLeftMarkers = computed(() => {
128
+ return `calc(${props.firstColumnWidth} - 0.5 * ((100% - ${props.firstColumnWidth}) / 24))`;
129
+ });
130
+
131
+ const paddingRightMarkers = computed(() => {
132
+ return `calc(0.5 * ((100% - ${props.firstColumnWidth}) / 24))`;
133
+ });
134
+
135
+
136
+
102
137
  const getMarkerStyle = (isNowHour: boolean): StyleValue => {
103
138
  if(isNowHour) {
104
139
  return {
@@ -113,8 +148,13 @@ export default defineComponent({
113
148
  const to2Digits = (value: number) => value.toString().padStart(2, '0');
114
149
 
115
150
  return {
116
- fontColor,
117
151
  hours,
152
+ fontColor,
153
+ hoursToShow,
154
+ paddingLeftHours,
155
+ paddingRightHours,
156
+ paddingLeftMarkers,
157
+ paddingRightMarkers,
118
158
  getMarkerStyle,
119
159
  to2Digits
120
160
  };
@@ -131,7 +131,7 @@ export default defineComponent({
131
131
  const height = computed(() => {
132
132
  let start = props.start - dayDurationOffset.value;
133
133
  let end = props.end - dayDurationOffset.value;
134
- if (props.variant === 'current') {
134
+ if (props.variant === 'current' && dayEnd.value > props.now) {
135
135
  end = props.now;
136
136
  } else if (props.end > dayEnd.value) {
137
137
  end = dayEnd.value - dayDurationOffset.value;
@@ -2,7 +2,6 @@
2
2
  <FSRow
3
3
  class="fs-day-agenda"
4
4
  height="100%"
5
- padding="8px 0 0 0"
6
5
  :wrap="false"
7
6
  gap="0px"
8
7
  :style="style"
@@ -180,7 +179,7 @@ export default defineComponent({
180
179
 
181
180
  const dayEvents = computed(() => {
182
181
  return props.events.filter((event) => {
183
- return (event.start <= props.end && event.start >= props.start) || (event.end <= props.end && event.end >= props.start);
182
+ return event.start < props.end && event.end > props.start;
184
183
  });
185
184
  });
186
185
 
@@ -9,13 +9,8 @@
9
9
  gap="0"
10
10
  :wrap="false"
11
11
  >
12
- <FSCol
13
- height="100%"
14
- :width="$props.firstColumnWidth"
15
- >
16
- </FSCol>
17
-
18
12
  <FSAgendaHoursRow
13
+ :firstColumnWidth="$props.firstColumnWidth"
19
14
  :displayNow="$props.nowIsInSelectedRange"
20
15
  :modelValue="nowHour"
21
16
  />
@@ -240,9 +235,8 @@ export default defineComponent({
240
235
 
241
236
  const getDayEvents = (dayStartEpoch: number) => {
242
237
  return props.events.filter((event) => {
243
- const isStartingInDay = event.start >= dayStartEpoch && event.start < (dayStartEpoch + 1000 * 60 * 60 * 24);
244
- const isEndingInDay = event.end >= dayStartEpoch && event.end < (dayStartEpoch + 1000 * 60 * 60 * 24);
245
- return isStartingInDay || isEndingInDay;
238
+ const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
239
+ return event.start < dayEndEpoch && event.end > dayStartEpoch;
246
240
  });
247
241
  };
248
242
 
@@ -42,8 +42,8 @@ export default defineComponent({
42
42
  const { $tr } = useTranslationsProvider();
43
43
 
44
44
  const items = [
45
- { id: AgendaMode.Week, label: $tr('ui.agenda.week', 'Week'), icon: 'mdi-calendar-week' },
46
- { id: AgendaMode.Month, label: $tr('ui.agenda.month', 'Month'), icon: 'mdi-calendar-month' },
45
+ { id: AgendaMode.Week, label: $tr('ui.common.week', 'Week'), icon: 'mdi-calendar-week' },
46
+ { id: AgendaMode.Month, label: $tr('ui.common.month', 'Month'), icon: 'mdi-calendar-month' },
47
47
  ];
48
48
 
49
49
  return {
@@ -9,13 +9,8 @@
9
9
  gap="0"
10
10
  :wrap="false"
11
11
  >
12
- <FSCol
13
- height="100%"
14
- :width="$props.firstColumnWidth"
15
- >
16
- </FSCol>
17
-
18
12
  <FSAgendaHoursRow
13
+ :firstColumnWidth="$props.firstColumnWidth"
19
14
  :displayNow="$props.nowIsInSelectedRange"
20
15
  :modelValue="nowHour"
21
16
  />
@@ -75,7 +70,7 @@
75
70
  class="fs-agenda-week-number-label"
76
71
  :color="weekTextColor"
77
72
  >
78
- {{ $tr('ui.common.agenda.week-short', 'W{0}',day.weekNumber) }}
73
+ {{ $tr('ui.common.week-short', 'W{0}',day.weekNumber) }}
79
74
  </FSText>
80
75
  </FSCol>
81
76
  </FSCard>
@@ -125,7 +120,7 @@
125
120
  @click="() => $emit('click:eventId', event.id)"
126
121
  >
127
122
  <template
128
- #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
123
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant, width }"
129
124
  >
130
125
  <FSRow
131
126
  align="center-left"
@@ -158,7 +153,7 @@
158
153
  </FSRow>
159
154
  </FSCol>
160
155
  <FSCol
161
- v-if="iconBis && variant !== 'current'"
156
+ v-if="iconBis && variant !== 'current' && width > 13"
162
157
  align="center-right"
163
158
  padding="8px 8px 8px 0"
164
159
  width="hug"
@@ -259,7 +254,7 @@ export default defineComponent({
259
254
  $tr('ui.common.monday-short', 'MON'),
260
255
  $tr('ui.common.tuesday-short', 'TUE'),
261
256
  $tr('ui.common.wednesday-short', 'WED'),
262
- $tr('uui.common.thursday-short', 'THU'),
257
+ $tr('ui.common.thursday-short', 'THU'),
263
258
  $tr('ui.common.friday-short', 'FRI'),
264
259
  $tr('ui.common.saturday-short', 'SAT')
265
260
  ];
@@ -309,9 +304,8 @@ export default defineComponent({
309
304
 
310
305
  const getDayEvents = (dayStartEpoch: number) => {
311
306
  return props.events.filter((event) => {
312
- const isStartingInDay = event.start >= dayStartEpoch && event.start < (dayStartEpoch + 1000 * 60 * 60 * 24);
313
- const isEndingInDay = event.end >= dayStartEpoch && event.end < (dayStartEpoch + 1000 * 60 * 60 * 24);
314
- return isStartingInDay || isEndingInDay;
307
+ const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
308
+ return event.start < dayEndEpoch && event.end > dayStartEpoch;
315
309
  });
316
310
  };
317
311
 
@@ -1,10 +1,14 @@
1
1
  <template>
2
2
  <FSAutocompleteField
3
+ :label="$props.label ?? $tr('ui.common.address', 'Address')"
3
4
  :clearable="false"
4
5
  :toggleSet="false"
5
6
  :multiple="false"
6
- :items="places"
7
- :modelValue="modelValuePlace"
7
+ :items="items"
8
+ :customFilter="(_label: string, _query: string, item: any) => {
9
+ return item.value !== $props.modelValue?.placeId;
10
+ }"
11
+ :modelValue="$props.modelValue?.placeId"
8
12
  @update:modelValue="onUpdate"
9
13
  v-model:search="search"
10
14
  v-bind="$attrs"
@@ -12,7 +16,7 @@
12
16
  </template>
13
17
 
14
18
  <script lang="ts">
15
- import { defineComponent, onMounted, ref, watch } from "vue";
19
+ import { computed, defineComponent, ref } from "vue";
16
20
 
17
21
  import { type Address, type Place } from "@dative-gpi/foundation-shared-domain/models";
18
22
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
@@ -32,13 +36,26 @@ export default defineComponent({
32
36
  required: false,
33
37
  default: null
34
38
  },
39
+ label: {
40
+ type: String,
41
+ required: false,
42
+ default: null
43
+ }
35
44
  },
36
45
  emits: ["update:modelValue"],
37
46
  setup(props, { emit }) {
38
47
  const { search: searchAddress, get: getAddress } = useAddress();
39
48
 
40
49
  const places = ref<Place[]>([]);
41
- const modelValuePlace = ref<Place | null>(null);
50
+
51
+ const items = computed(() => {
52
+ if(props.modelValue) {
53
+ const currentPlace = addressToPlace(props.modelValue);
54
+ const searchedPlaces = places.value.filter((place) => place.id !== currentPlace.id);
55
+ return [currentPlace, ...searchedPlaces];
56
+ }
57
+ return places.value;
58
+ });
42
59
 
43
60
  const fetch = async (search: string | null) => {
44
61
  if (search === null) {
@@ -69,7 +86,9 @@ export default defineComponent({
69
86
  (item) => (item).id,
70
87
  (item) => (item).label,
71
88
  true,
72
- false
89
+ false,
90
+ 0,
91
+ 500
73
92
  );
74
93
 
75
94
  const addressToPlace = (address: Address): Place => {
@@ -79,23 +98,9 @@ export default defineComponent({
79
98
  };
80
99
  };
81
100
 
82
- onMounted(() => {
83
- if(!props.modelValue) {
84
- return;
85
- }
86
- modelValuePlace.value = addressToPlace(props.modelValue);
87
- });
88
-
89
- watch(() => props.modelValue, (newValue) => {
90
- if(!newValue) {
91
- return;
92
- }
93
- modelValuePlace.value = addressToPlace(newValue);
94
- });
95
-
96
101
  return {
97
- modelValuePlace,
98
102
  places,
103
+ items,
99
104
  search,
100
105
  onUpdate
101
106
  };
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSAutocompleteField
3
+ :label="$tr('ui.common.language', 'Language')"
3
4
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
4
5
  :multiple="$props.multiple"
5
6
  :placeholder="placeholder"
@@ -58,6 +59,11 @@ export default defineComponent({
58
59
  type: Boolean,
59
60
  required: false,
60
61
  default: false
62
+ },
63
+ label: {
64
+ type: String as PropType<string | null>,
65
+ required: false,
66
+ default: null
61
67
  }
62
68
  },
63
69
  emits: ["update:modelValue"],
@@ -71,7 +77,7 @@ export default defineComponent({
71
77
 
72
78
  const placeholder = computed((): string | null => {
73
79
  if (props.multiple && props.modelValue) {
74
- return $tr("ui.autocomplete-language.placeholder", "{0} language(s) selected", props.modelValue.length);
80
+ return $tr("autocomplete.language.placeholder", "{0} language(s) selected", props.modelValue.length);
75
81
  }
76
82
  return null;
77
83
  });
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSAutocompleteField
3
3
  itemTitle="id"
4
+ :label="$tr('ui.common.time-zone', 'Time zone')"
4
5
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
5
6
  :multiple="$props.multiple"
6
7
  :placeholder="placeholder"
@@ -81,6 +82,11 @@ export default defineComponent({
81
82
  type: Boolean,
82
83
  required: false,
83
84
  default: false
85
+ },
86
+ label: {
87
+ type: String as PropType<string | null>,
88
+ required: false,
89
+ default: null
84
90
  }
85
91
  },
86
92
  emits: ["update:modelValue"],
@@ -94,7 +100,7 @@ export default defineComponent({
94
100
 
95
101
  const placeholder = computed((): string | null => {
96
102
  if (props.multiple && props.modelValue) {
97
- return $tr("ui.autocomplete-time-zone.placeholder", "{0} time zone(s) selected", props.modelValue.length);
103
+ return $tr("autocomplete.time-zone.placeholder", "{0} time zone(s) selected", props.modelValue.length);
98
104
  }
99
105
  return null;
100
106
  });
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSButton
3
3
  prependIcon="mdi-plus-circle-outline"
4
- :label="$tr('ui.button.add', 'Add')"
4
+ :label="$tr('ui.common.add', 'Add')"
5
5
  :color="ColorEnum.Primary"
6
6
  v-bind="$attrs"
7
7
  />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSButton
3
- :label="$tr('ui.button.add', 'Add')"
3
+ :label="$tr('ui.common.add', 'Add')"
4
4
  :color="ColorEnum.Primary"
5
5
  v-bind="$attrs"
6
6
  />
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSButton
3
3
  prependIcon="mdi-cancel"
4
- :label="$tr('ui.button.cancel', 'Cancel')"
4
+ :label="$tr('ui.common.cancel', 'Cancel')"
5
5
  :color="ColorEnum.Light"
6
6
  v-bind="$attrs"
7
7
  />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSButton
3
- :label="$tr('ui.button.cancel', 'Cancel')"
3
+ :label="$tr('ui.common.cancel', 'Cancel')"
4
4
  :color="ColorEnum.Light"
5
5
  v-bind="$attrs"
6
6
  />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSButton
3
- :editable="$props.editable"
3
+ :disabled="$props.disabled"
4
4
  :prependIcon="prependIcon"
5
5
  :load="$props.load"
6
6
  :variant="variant"
@@ -40,10 +40,10 @@ export default defineComponent({
40
40
  required: false,
41
41
  default: false
42
42
  },
43
- editable: {
43
+ disabled: {
44
44
  type: Boolean,
45
45
  required: false,
46
- default: true
46
+ default: false
47
47
  }
48
48
  },
49
49
  emits: ["update:modelValue"],
@@ -57,7 +57,7 @@ export default defineComponent({
57
57
  });
58
58
 
59
59
  const onClick = (): void => {
60
- if (props.editable && !props.load) {
60
+ if (!props.disabled && !props.load) {
61
61
  emit("update:modelValue", !props.modelValue);
62
62
  }
63
63
  };
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSButton
3
3
  prependIcon="mdi-content-copy"
4
- :label="$tr('ui.button.copy', 'Copy')"
4
+ :label="$tr('ui.common.copy', 'Copy')"
5
5
  :color="ColorEnum.Light"
6
6
  v-bind="$attrs"
7
7
  />