@dative-gpi/foundation-shared-components 0.0.229 → 0.1.68

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 (228) hide show
  1. package/components/FSAccordionPanel.vue +8 -10
  2. package/components/FSBadge.vue +2 -4
  3. package/components/FSBreadcrumbs.vue +9 -10
  4. package/components/FSButton.vue +81 -31
  5. package/components/FSCalendar.vue +35 -33
  6. package/components/FSCalendarTwin.vue +77 -84
  7. package/components/FSCard.vue +29 -16
  8. package/components/FSCardPlaceholder.vue +1 -2
  9. package/components/FSCheckbox.vue +5 -7
  10. package/components/FSChip.vue +9 -11
  11. package/components/FSClickable.vue +67 -57
  12. package/components/FSClock.vue +4 -4
  13. package/components/FSCol.vue +2 -3
  14. package/components/FSColor.vue +13 -31
  15. package/components/FSColorIcon.vue +25 -9
  16. package/components/FSDialog.vue +1 -2
  17. package/components/FSDialogFormBody.vue +4 -4
  18. package/components/FSDialogMenu.vue +2 -4
  19. package/components/FSDialogMultiFormBody.vue +63 -50
  20. package/components/FSDialogRemove.vue +1 -0
  21. package/components/FSDialogSubmit.vue +5 -7
  22. package/components/FSDivider.vue +7 -9
  23. package/components/FSEditImage.vue +27 -274
  24. package/components/FSEditImageUI.vue +303 -0
  25. package/components/FSErrorToast.vue +3 -4
  26. package/components/FSFadeOut.vue +18 -13
  27. package/components/FSGrid.vue +6 -9
  28. package/components/FSGridMosaic.vue +1 -2
  29. package/components/FSIcon.vue +7 -8
  30. package/components/FSIconCard.vue +23 -30
  31. package/components/FSIconCheck.vue +1 -2
  32. package/components/FSImage.vue +21 -193
  33. package/components/FSImageCard.vue +2 -2
  34. package/components/FSImageUI.vue +212 -0
  35. package/components/FSLabel.vue +18 -20
  36. package/components/FSLink.vue +19 -21
  37. package/components/FSLoader.vue +10 -14
  38. package/components/FSOptionGroup.vue +58 -12
  39. package/components/FSPagination.vue +3 -5
  40. package/components/FSRadio.vue +5 -7
  41. package/components/FSRadioGroup.vue +2 -4
  42. package/components/FSRow.vue +3 -4
  43. package/components/FSSlideGroup.vue +15 -4
  44. package/components/FSSlider.vue +9 -11
  45. package/components/FSSpan.vue +11 -9
  46. package/components/FSSwitch.vue +65 -37
  47. package/components/FSTab.vue +2 -4
  48. package/components/FSTabs.vue +36 -16
  49. package/components/FSTag.vue +23 -14
  50. package/components/FSTagGroup.vue +3 -5
  51. package/components/FSText.vue +8 -12
  52. package/components/FSWindow.vue +11 -5
  53. package/components/FSWrapGroup.vue +15 -4
  54. package/components/agenda/FSAgenda.vue +204 -0
  55. package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
  56. package/components/agenda/FSAgendaHeader.vue +190 -0
  57. package/components/agenda/FSAgendaHorizontalEvent.vue +162 -0
  58. package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
  59. package/components/agenda/FSAgendaHoursCol.vue +103 -0
  60. package/components/agenda/FSAgendaHoursRow.vue +124 -0
  61. package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
  62. package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
  63. package/components/agenda/FSDayAgenda.vue +200 -0
  64. package/components/agenda/FSMonthAgenda.vue +257 -0
  65. package/components/agenda/FSSelectAgendaMode.vue +54 -0
  66. package/components/agenda/FSWeekAgenda.vue +328 -0
  67. package/components/autocompletes/FSAutocompleteLanguage.vue +18 -39
  68. package/components/autocompletes/FSAutocompleteTimeZone.vue +20 -38
  69. package/components/buttons/FSButtonCancelMini.vue +1 -0
  70. package/components/buttons/FSButtonCopy.vue +28 -0
  71. package/components/buttons/FSButtonCopyIcon.vue +28 -0
  72. package/components/buttons/FSButtonCopyLabel.vue +27 -0
  73. package/components/buttons/FSButtonCopyMini.vue +28 -0
  74. package/components/buttons/FSButtonDragIcon.vue +27 -0
  75. package/components/buttons/FSButtonDuplicateMini.vue +1 -0
  76. package/components/buttons/FSButtonEditMini.vue +1 -0
  77. package/components/buttons/FSButtonFileMini.vue +1 -0
  78. package/components/buttons/FSButtonNextMini.vue +1 -0
  79. package/components/buttons/FSButtonPreviousMini.vue +1 -0
  80. package/components/buttons/FSButtonRedoMini.vue +1 -0
  81. package/components/buttons/FSButtonRemoveMini.vue +1 -0
  82. package/components/buttons/FSButtonSaveMini.vue +1 -0
  83. package/components/buttons/FSButtonSearchMini.vue +1 -0
  84. package/components/buttons/FSButtonUndoMini.vue +1 -0
  85. package/components/buttons/FSButtonUpdateMini.vue +1 -0
  86. package/components/buttons/FSButtonValidateMini.vue +1 -0
  87. package/components/deviceOrganisations/FSConnectivity.vue +11 -1
  88. package/components/deviceOrganisations/FSConnectivityCard.vue +20 -49
  89. package/components/deviceOrganisations/FSStatus.vue +11 -1
  90. package/components/deviceOrganisations/FSStatusCard.vue +40 -60
  91. package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
  92. package/components/deviceOrganisations/FSStatusesRow.vue +10 -5
  93. package/components/deviceOrganisations/FSWorstAlert.vue +19 -13
  94. package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -47
  95. package/components/fields/FSAutocompleteField.vue +501 -323
  96. package/components/fields/FSAutocompleteTag.vue +100 -0
  97. package/components/fields/FSBaseField.vue +26 -16
  98. package/components/fields/FSColorField.vue +63 -55
  99. package/components/fields/FSCommentField.vue +93 -0
  100. package/components/fields/FSDateField.vue +2 -2
  101. package/components/fields/FSDateRangeField.vue +2 -2
  102. package/components/fields/FSDateTimeField.vue +4 -3
  103. package/components/fields/FSDateTimeRangeField.vue +7 -6
  104. package/components/fields/FSEntityFieldUI.vue +271 -0
  105. package/components/fields/FSGradientField.vue +27 -33
  106. package/components/fields/FSIconField.vue +2 -3
  107. package/components/fields/FSMagicConfigField.vue +28 -19
  108. package/components/fields/FSMagicField.vue +25 -17
  109. package/components/fields/FSNumberField.vue +9 -7
  110. package/components/fields/FSPasswordField.vue +2 -3
  111. package/components/fields/FSRichTextField.vue +32 -5
  112. package/components/fields/FSSearchField.vue +2 -2
  113. package/components/fields/FSSelectField.vue +483 -251
  114. package/components/fields/FSTagField.vue +4 -6
  115. package/components/fields/FSTermField.vue +25 -13
  116. package/components/fields/FSTextArea.vue +18 -6
  117. package/components/fields/FSTextField.vue +13 -10
  118. package/components/fields/FSTimeField.vue +1 -1
  119. package/components/fields/FSTimeSlotField.vue +3 -4
  120. package/components/fields/FSTimeStepField.vue +157 -0
  121. package/components/fields/FSTranslateField.vue +3 -2
  122. package/components/fields/FSTranslateRichTextField.vue +4 -3
  123. package/components/fields/FSTranslateTextArea.vue +233 -0
  124. package/components/fields/FSTreeViewField.vue +7 -9
  125. package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
  126. package/components/fields/periodicField/FSPeriodicField.vue +131 -0
  127. package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
  128. package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
  129. package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
  130. package/components/lists/FSDataIteratorItem.vue +8 -10
  131. package/components/lists/FSDataTableUI.vue +47 -39
  132. package/components/lists/FSFilterButton.vue +20 -22
  133. package/components/lists/FSHiddenButton.vue +10 -12
  134. package/components/lists/FSLoadDataTable.vue +4 -6
  135. package/components/lists/FSSimpleList.vue +229 -0
  136. package/components/map/FSMap.vue +256 -405
  137. package/components/map/FSMapFeatureGroup.vue +51 -0
  138. package/components/map/FSMapLayerButton.vue +6 -3
  139. package/components/map/FSMapMarker.vue +116 -0
  140. package/components/map/FSMapMarkerClusterGroup.vue +72 -0
  141. package/components/map/FSMapOverlay.vue +69 -83
  142. package/components/map/FSMapPolygon.vue +81 -0
  143. package/components/map/FSMapTileLayer.vue +50 -0
  144. package/components/map/keys.ts +4 -0
  145. package/components/selects/FSSelectAutoRefresh.vue +1 -1
  146. package/components/selects/FSSelectDashboardVariableType.vue +1 -1
  147. package/components/selects/FSSelectDateSetting.vue +3 -3
  148. package/components/selects/FSSelectDays.vue +1 -1
  149. package/components/selects/FSSelectListMode.vue +51 -0
  150. package/components/selects/FSSelectMonths.vue +67 -0
  151. package/components/tiles/FSChartTileUI.vue +116 -0
  152. package/components/tiles/FSCommentTileUI.vue +149 -0
  153. package/components/tiles/FSDashboardOrganisationTileUI.vue +6 -8
  154. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +6 -8
  155. package/components/tiles/FSDashboardShallowTileUI.vue +6 -8
  156. package/components/tiles/FSDeviceOrganisationTileUI.vue +30 -18
  157. package/components/tiles/FSFolderTileUI.vue +6 -6
  158. package/components/tiles/FSGroupTileUI.vue +31 -22
  159. package/components/tiles/FSLoadTile.vue +5 -7
  160. package/components/tiles/FSLocationTileUI.vue +157 -0
  161. package/components/tiles/FSModelTileUI.vue +18 -0
  162. package/components/tiles/FSServiceAccountOrganisationTileUI.vue +142 -0
  163. package/components/tiles/FSSimpleTileUI.vue +57 -36
  164. package/components/tiles/FSTile.vue +115 -55
  165. package/components/tiles/FSUserOrganisationTileUI.vue +25 -35
  166. package/components/toggleSets/FSToggleSetPosition.vue +1 -1
  167. package/components/views/FSEntityHeader.vue +343 -0
  168. package/components/views/FSEntityView.vue +163 -0
  169. package/components/views/FSListHeader.vue +83 -0
  170. package/components/views/FSListView.vue +83 -0
  171. package/components/views/FSSkeletonView.vue +100 -0
  172. package/composables/useAddress.ts +2 -2
  173. package/composables/useColors.ts +15 -5
  174. package/composables/useMagicFieldProvider.ts +7 -6
  175. package/composables/useSlots.ts +51 -28
  176. package/models/agenda.ts +9 -0
  177. package/models/deviceAlerts.ts +1 -1
  178. package/models/deviceConnectivities.ts +1 -1
  179. package/models/index.ts +1 -0
  180. package/models/magicFields.ts +1 -0
  181. package/models/map.ts +2 -2
  182. package/models/rules.ts +10 -5
  183. package/models/tables.ts +3 -1
  184. package/package.json +4 -4
  185. package/styles/components/fs_agenda.scss +32 -0
  186. package/styles/components/fs_agenda_event.scss +41 -0
  187. package/styles/components/fs_agenda_hours_col.scss +4 -0
  188. package/styles/components/fs_agenda_hours_row.scss +13 -0
  189. package/styles/components/fs_agenda_time_line_marker.scss +19 -0
  190. package/styles/components/fs_card.scss +0 -1
  191. package/styles/components/fs_clickable.scss +5 -3
  192. package/styles/components/fs_color_field.scss +1 -0
  193. package/styles/components/fs_data_table.scss +2 -0
  194. package/styles/components/fs_dialog.scss +11 -15
  195. package/styles/components/fs_edit_image.scss +8 -0
  196. package/styles/components/fs_fade_out.scss +2 -1
  197. package/styles/components/fs_filter_button.scss +1 -6
  198. package/styles/components/fs_gradient_field.scss +11 -11
  199. package/styles/components/fs_magic_config_field.scss +2 -2
  200. package/styles/components/fs_map.scss +36 -30
  201. package/styles/components/fs_option_group.scss +15 -5
  202. package/styles/components/fs_radio.scss +11 -0
  203. package/styles/components/fs_rich_text_field.scss +2 -1
  204. package/styles/components/fs_search_field.scss +3 -0
  205. package/styles/components/fs_select_date_settings.scss +3 -0
  206. package/styles/components/fs_slide_group.scss +5 -0
  207. package/styles/components/fs_span.scss +2 -1
  208. package/styles/components/fs_switch.scss +1 -0
  209. package/styles/components/fs_tabs.scss +9 -0
  210. package/styles/components/fs_text_area.scss +15 -1
  211. package/styles/components/fs_tile.scss +22 -6
  212. package/styles/components/fs_window.scss +5 -0
  213. package/styles/components/fs_wrap_group.scss +4 -0
  214. package/styles/components/index.scss +6 -1
  215. package/styles/globals/overrides.scss +22 -19
  216. package/styles/globals/text_fonts.scss +17 -55
  217. package/tools/alertsTools.ts +54 -0
  218. package/tools/chartsTools.ts +300 -0
  219. package/tools/index.ts +2 -0
  220. package/utils/badge.ts +9 -0
  221. package/utils/filter.ts +18 -0
  222. package/utils/index.ts +2 -0
  223. package/utils/leafletMarkers.ts +8 -2
  224. package/utils/statuses.ts +1 -1
  225. package/utils/time.ts +27 -1
  226. package/components/autocompletes/FSAutocompleteTag.vue +0 -138
  227. package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
  228. package/styles/components/fs_map_overlay.scss +0 -38
@@ -0,0 +1,190 @@
1
+ <template>
2
+ <FSRow
3
+ align="center-center"
4
+ >
5
+ <template
6
+ v-if="$props.mode !== AgendaMode.Day"
7
+ >
8
+ <FSRow
9
+ align="center-left"
10
+ :wrap="false"
11
+ width="hug"
12
+ >
13
+ <FSButton
14
+ variant="icon"
15
+ icon="mdi-chevron-left"
16
+ @click="onPrevious"
17
+ />
18
+ <FSButton
19
+ width="180px"
20
+ color="primary"
21
+ :border="false"
22
+ :label="epochToMonthYearOnlyFormat($props.start)"
23
+ @click="showCalendarDialog = true"
24
+ />
25
+ <FSButton
26
+ variant="icon"
27
+ icon="mdi-chevron-right"
28
+ @click="onNext"
29
+ />
30
+ </FSRow>
31
+ <FSRow
32
+ align="center-right"
33
+ >
34
+ <FSRow
35
+ width="hug"
36
+ >
37
+ <FSSelectAgendaMode
38
+ :modelValue="$props.mode"
39
+ :hideHeader="true"
40
+ @update:modelValue="$emit('update:mode', $event)"
41
+ />
42
+ <FSButton
43
+ prependIcon="mdi-calendar-today-outline"
44
+ :label="$tr('ui.agenda.today', 'Today')"
45
+ @click="onToday"
46
+ />
47
+ </FSRow>
48
+ </FSRow>
49
+ </template>
50
+ <FSCol
51
+ v-else
52
+ >
53
+ <FSButton
54
+ prependIcon="mdi-calendar-today-outline"
55
+ :label="$tr('ui.agenda.today', 'Today')"
56
+ width="100%"
57
+ @click="onToday"
58
+ />
59
+ <FSRow
60
+ :wrap="false"
61
+ align="center-center"
62
+ padding="0 4px"
63
+ >
64
+ <FSButton
65
+ variant="icon"
66
+ icon="mdi-chevron-left"
67
+ @click="onPrevious"
68
+ />
69
+ <FSButton
70
+ width="100%"
71
+ color="primary"
72
+ :border="false"
73
+ :label="epochToDayMonthLongOnly($props.start)"
74
+ @click="showCalendarDialog = true"
75
+ />
76
+ <FSButton
77
+ variant="icon"
78
+ icon="mdi-chevron-right"
79
+ @click="onNext"
80
+ />
81
+ </FSRow>
82
+ </FSCol>
83
+ </FSRow>
84
+ <FSAgendaDialogCalendar
85
+ v-model:dialog="showCalendarDialog"
86
+ :modelValue="$props.start"
87
+ @update:modelValue="updateDateRange($event)"
88
+ />
89
+ </template>
90
+
91
+ <script lang="ts">
92
+ import { defineComponent, type PropType, ref } from 'vue';
93
+
94
+ import { useDateFormat } from '@dative-gpi/foundation-shared-services/composables';
95
+
96
+ import { AgendaMode } from '@dative-gpi/foundation-shared-domain/enums/agendas';
97
+
98
+ import FSCol from '../FSCol.vue';
99
+ import FSRow from '../FSRow.vue';
100
+ import FSButton from '../FSButton.vue';
101
+ import FSSelectAgendaMode from './FSSelectAgendaMode.vue';
102
+ import FSAgendaDialogCalendar from './FSAgendaDialogCalendar.vue';
103
+
104
+ export default defineComponent({
105
+ name: 'FSAgendaHeader',
106
+ components: {
107
+ FSAgendaDialogCalendar,
108
+ FSSelectAgendaMode,
109
+ FSCol,
110
+ FSButton,
111
+ FSRow
112
+ },
113
+ props: {
114
+ mode: {
115
+ type: Number as PropType<AgendaMode>,
116
+ required: true
117
+ },
118
+ start: {
119
+ type: Number,
120
+ required: true
121
+ },
122
+ end: {
123
+ type: Number,
124
+ required: true
125
+ },
126
+ now: {
127
+ type: Number,
128
+ required: true
129
+ }
130
+ },
131
+ emits: ['update:start', 'update:end', 'update:mode'],
132
+ setup(props, { emit }) {
133
+ const { epochToMonthYearOnlyFormat, epochToDayMonthLongOnly, epochToLocalDayStart, epochToLocalDayEnd } = useDateFormat();
134
+
135
+ const showCalendarDialog = ref(false);
136
+
137
+ const updateDateRange = (dayStart: number) => {
138
+ const newStart = epochToLocalDayStart(dayStart);
139
+ if (props.mode === AgendaMode.Week) {
140
+ emit('update:start', newStart);
141
+ emit('update:end', epochToLocalDayEnd(newStart + (7 - new Date(newStart).getDay()) * 24 * 60 * 60 * 1000));
142
+ return;
143
+ }
144
+ if (props.mode === AgendaMode.Month) {
145
+ emit('update:start', newStart);
146
+ const lastDayOfMonth = new Date(new Date(newStart).getFullYear(), new Date(newStart).getMonth() + 1, 0);
147
+ emit('update:end', epochToLocalDayEnd(lastDayOfMonth.getTime()));
148
+ return;
149
+ }
150
+ emit('update:start', newStart);
151
+ emit('update:end', epochToLocalDayEnd(newStart));
152
+ }
153
+
154
+ const onNext = () => {
155
+ updateDateRange(props.end + 1000 * 60);
156
+ }
157
+
158
+ const onPrevious = () => {
159
+ if (props.mode === AgendaMode.Week) {
160
+ updateDateRange(props.start - 7 * 24 * 60 * 60 * 1000);
161
+ } else if (props.mode === AgendaMode.Month) {
162
+ updateDateRange(new Date(props.start).setMonth(new Date(props.start).getMonth() - 1));
163
+ } else if (props.mode === AgendaMode.Day) {
164
+ updateDateRange(props.start - 24 * 60 * 60 * 1000);
165
+ }
166
+ }
167
+
168
+ const onToday = () => {
169
+ if (props.mode === AgendaMode.Week) {
170
+ updateDateRange(props.now - (new Date(props.now).getDay() - 1) * 24 * 60 * 60 * 1000);
171
+ } else if (props.mode === AgendaMode.Month) {
172
+ updateDateRange(new Date(props.now).setDate(1));
173
+ } else if (props.mode === AgendaMode.Day) {
174
+ updateDateRange(props.now);
175
+ }
176
+ }
177
+
178
+ return {
179
+ AgendaMode,
180
+ showCalendarDialog,
181
+ epochToDayMonthLongOnly,
182
+ epochToMonthYearOnlyFormat,
183
+ onNext,
184
+ onPrevious,
185
+ onToday,
186
+ updateDateRange
187
+ }
188
+ }
189
+ });
190
+ </script>
@@ -0,0 +1,162 @@
1
+ <template>
2
+ <FSAgendaHorizontalEvent
3
+ v-if="$props.variant === 'current'"
4
+ :key="$props.id"
5
+ variant="future"
6
+ :now="$props.now"
7
+ :dayStart="$props.dayStart"
8
+ :label="$props.label"
9
+ :start="$props.start"
10
+ :end="$props.end"
11
+ :icon="$props.icon"
12
+ :iconBis="$props.iconBis"
13
+ :id="$props.id"
14
+ :color="$props.color"
15
+ @click="$emit('click', $props.id)"
16
+ >
17
+ <template
18
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
19
+ >
20
+ <slot
21
+ name="default"
22
+ :label="label"
23
+ :icon="icon"
24
+ :iconBis="iconBis"
25
+ :timeStart="timeStart"
26
+ :timeEnd="timeEnd"
27
+ :variant="variant"
28
+ />
29
+ </template>
30
+ </FSAgendaHorizontalEvent>
31
+ <FSClickable
32
+ v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
33
+ :class="`fs-agenda-event fs-agenda-event-${$props.variant}`"
34
+ :variant="$props.variant === 'current' ? 'full' : 'standard'"
35
+ :style="style"
36
+ :color="$props.color"
37
+ :width="`${width}%`"
38
+ height="calc(100% - 4px)"
39
+ :border="false"
40
+ @click="$emit('click', $props.id)"
41
+ >
42
+ <slot
43
+ name="default"
44
+ :label="label"
45
+ :icon="icon"
46
+ :iconBis="iconBis"
47
+ :timeStart="epochToShortTimeOnlyFormat($props.start)"
48
+ :timeEnd="epochToShortTimeOnlyFormat($props.end)"
49
+ :variant="$props.variant"
50
+ />
51
+ </FSClickable>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
56
+
57
+ import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
58
+
59
+ import FSClickable from '../FSClickable.vue';
60
+
61
+
62
+ export default defineComponent({
63
+ name: 'FSAgendaHorizontalEvent',
64
+ components: {
65
+ FSClickable
66
+ },
67
+ emits: ['click'],
68
+ props: {
69
+ variant: {
70
+ type: String as PropType<'past' | 'current' | 'future'>,
71
+ default: 'future'
72
+ },
73
+ label: {
74
+ type: String,
75
+ required: true
76
+ },
77
+ start: {
78
+ type: Number,
79
+ required: true
80
+ },
81
+ end: {
82
+ type: Number,
83
+ required: true
84
+ },
85
+ icon: {
86
+ type: String,
87
+ required: false
88
+ },
89
+ iconBis: {
90
+ type: String,
91
+ required: false
92
+ },
93
+ id: {
94
+ type: String,
95
+ required: true
96
+ },
97
+ color: {
98
+ type: String,
99
+ required: true
100
+ },
101
+ dayStart: {
102
+ type: Number,
103
+ required: true
104
+ },
105
+ now: {
106
+ type: Number,
107
+ required: true
108
+ }
109
+ },
110
+ setup(props) {
111
+ const { dayToMillisecond, epochToShortTimeOnlyFormat, millisecondToDay } = useDateFormat();
112
+
113
+ const dayEnd = computed(() => {
114
+ return new Date(props.dayStart).setHours(23, 59, 59, 999);
115
+ });
116
+
117
+ const dayDuration = computed(() => {
118
+ return dayEnd.value - props.dayStart;
119
+ });
120
+
121
+ const dayDurationOffset = computed(() => {
122
+ return dayDuration.value - dayToMillisecond(1);
123
+ });
124
+
125
+ const leftPosition = computed(() => {
126
+ if (props.start < props.dayStart) {
127
+ return 0;
128
+ }
129
+ return millisecondToDay(props.start - props.dayStart - dayDurationOffset.value) * 100;
130
+ });
131
+
132
+ const width = computed(() => {
133
+ let start = props.start - dayDurationOffset.value;
134
+ let end = props.end - dayDurationOffset.value;
135
+ if(props.variant === 'current') {
136
+ end = props.now;
137
+ } else if (props.end > dayEnd.value) {
138
+ end = dayEnd.value - dayDurationOffset.value;
139
+ }
140
+ if (props.start < props.dayStart) {
141
+ start = props.dayStart;
142
+ }
143
+
144
+ const duration = millisecondToDay(end - start);
145
+ return duration > 0 ? (duration * 100) : 0;
146
+ });
147
+
148
+ const style = computed((): StyleValue => {
149
+ return {
150
+ '--fs-agenda-event-left': `${leftPosition.value}%`,
151
+ };
152
+ });
153
+
154
+ return {
155
+ style,
156
+ width,
157
+ epochToShortTimeOnlyFormat
158
+ };
159
+ }
160
+ });
161
+
162
+ </script>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div
3
+ class="fs-agenda-horizontal-time-line-marker"
4
+ :style="style"
5
+ >
6
+ </div>
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent, computed, type StyleValue } from 'vue';
11
+
12
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
13
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
14
+
15
+ export default defineComponent({
16
+ name: 'FSAgendaHorizontalTimeLineMarker',
17
+ props: {
18
+ modelValue: {
19
+ type: Number,
20
+ required: true,
21
+ }
22
+ },
23
+ setup(props) {
24
+ const { getColors } = useColors();
25
+
26
+ const primaryColor = getColors(ColorEnum.Primary);
27
+
28
+ const nowDate = computed(() => {
29
+ return new Date(props.modelValue);
30
+ });
31
+
32
+ const leftOffset = computed(() => {
33
+ return nowDate.value.getHours() * 100 / 24 + nowDate.value.getMinutes() * 100 / 24 / 60;
34
+ });
35
+
36
+ const style = computed((): StyleValue => ({
37
+ "--fs-agenda-horizontal-time-line-marker-left": `${leftOffset.value}%`,
38
+ "--fs-agenda-horizontal-time-line-marker-color": primaryColor.base
39
+ }));
40
+
41
+ return {
42
+ style,
43
+ };
44
+ },
45
+ });
46
+ </script>
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <FSRow
3
+ padding="0 0 0 4px"
4
+ gap="0"
5
+ width="hug"
6
+ height="100%"
7
+ >
8
+ <FSCol
9
+ class="fs-agenda-hours-col"
10
+ :wrap="false"
11
+ gap="0"
12
+ height="100%"
13
+ align="center-center"
14
+ >
15
+ <FSRow
16
+ v-for="hour in hours"
17
+ :key="hour"
18
+ width="100%"
19
+ height="100%"
20
+ align="center-center"
21
+ >
22
+ <FSCard
23
+ class="fs-agenda-hours-col-now"
24
+ color="primary"
25
+ variant="full"
26
+ width="100%"
27
+ v-if="displayNow && hour === modelValue"
28
+ >
29
+ <FSCol
30
+ align="center-center"
31
+ >
32
+ <FSSpan
33
+ class="fs-agenda-hours-col-text fs-agenda-hours-col-text-now"
34
+ >
35
+ {{ $tr('ui.common.hours-only', '{0}h', to2Digits(hour)) }}
36
+ </FSSpan>
37
+ </FSCol>
38
+ </FSCard>
39
+ <FSText
40
+ v-else
41
+ class="fs-agenda-hours-col-text"
42
+ :color="fontColor"
43
+ >
44
+ {{ $tr('ui.common.hours-only', '{0}h', to2Digits(hour)) }}
45
+ </FSText>
46
+ </FSRow>
47
+ </FSCol>
48
+ </FSRow>
49
+ </template>
50
+
51
+ <script lang="ts">
52
+ import { defineComponent, computed } from 'vue';
53
+
54
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
55
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
56
+
57
+ import FSText from '../FSText.vue';
58
+ import FSRow from '../FSRow.vue';
59
+ import FSCard from '../FSCard.vue';
60
+ import FSSpan from '../FSSpan.vue';
61
+ import FSCol from '../FSCol.vue';
62
+
63
+ export default defineComponent({
64
+ name: 'FSAgendaHoursCol',
65
+ components: {
66
+ FSCard,
67
+ FSCol,
68
+ FSSpan,
69
+ FSText,
70
+ FSRow,
71
+ },
72
+ props: {
73
+ modelValue: {
74
+ type: Number,
75
+ required: true,
76
+ },
77
+ displayNow: {
78
+ type: Boolean,
79
+ required: false,
80
+ default: false,
81
+ },
82
+ },
83
+ setup() {
84
+ const { getColors } = useColors();
85
+
86
+ const lightColors = getColors(ColorEnum.Light);
87
+ const fontColor = lightColors.dark;
88
+
89
+ const hours = computed(() => {
90
+ return Array.from({ length: 24 }, (_, i) => i);
91
+ });
92
+
93
+ const to2Digits = (value: number) => value.toString().padStart(2, '0');
94
+
95
+ return {
96
+ fontColor,
97
+ hours,
98
+ to2Digits
99
+ };
100
+ },
101
+ });
102
+
103
+ </script>
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <FSCol
3
+ gap="0"
4
+ >
5
+ <FSRow
6
+ class="fs-agenda-hours-row"
7
+ :wrap="false"
8
+ gap="0"
9
+ align="center-center"
10
+ >
11
+ <FSRow
12
+ v-for="hour in hours"
13
+ :key="hour"
14
+ width="100%"
15
+ align="center-center"
16
+ >
17
+ <FSCard
18
+ class="fs-agenda-hours-row-now"
19
+ color="primary"
20
+ variant="full"
21
+ v-if="displayNow && hour === modelValue"
22
+ >
23
+ <FSSpan
24
+ class="fs-agenda-hours-row-text fs-agenda-hours-row-text-now"
25
+ >
26
+ {{ $tr('ui.common.hours-only', '{0}h', to2Digits(hour)) }}
27
+ </FSSpan>
28
+ </FSCard>
29
+ <FSText
30
+ v-else
31
+ class="fs-agenda-hours-row-text"
32
+ :color="fontColor"
33
+ >
34
+ {{ $tr('ui.common.hours-only', '{0}h', to2Digits(hour)) }}
35
+ </FSText>
36
+ </FSRow>
37
+ </FSRow>
38
+ <FSRow
39
+ class="fs-agenda-hours-row"
40
+ :wrap="false"
41
+ gap="0"
42
+ >
43
+ <FSRow
44
+ v-for="hour in hours"
45
+ :key="hour"
46
+ :style="getMarkerStyle(displayNow && hour === modelValue)"
47
+ width="100%"
48
+ height="0"
49
+ align="center-center"
50
+ >
51
+ <span
52
+ class="fs-agenda-hours-row-marker"
53
+ />
54
+ </FSRow>
55
+ </FSRow>
56
+ </FSCol>
57
+ </template>
58
+
59
+ <script lang="ts">
60
+ import { defineComponent, computed, type StyleValue } from 'vue';
61
+
62
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
63
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
64
+
65
+ import FSText from '../FSText.vue';
66
+ import FSRow from '../FSRow.vue';
67
+ import FSCard from '../FSCard.vue';
68
+ import FSSpan from '../FSSpan.vue';
69
+ import FSCol from '../FSCol.vue';
70
+
71
+ export default defineComponent({
72
+ name: 'FSAgendaHoursRow',
73
+ components: {
74
+ FSCard,
75
+ FSCol,
76
+ FSSpan,
77
+ FSText,
78
+ FSRow,
79
+ },
80
+ props: {
81
+ modelValue: {
82
+ type: Number,
83
+ required: true,
84
+ },
85
+ displayNow: {
86
+ type: Boolean,
87
+ required: false,
88
+ default: false,
89
+ },
90
+ },
91
+ setup() {
92
+ const { getColors } = useColors();
93
+
94
+ const lightColors = getColors(ColorEnum.Light);
95
+ const primaryColors = getColors(ColorEnum.Primary);
96
+ const fontColor = lightColors.dark;
97
+
98
+ const hours = computed(() => {
99
+ return Array.from({ length: 24 }, (_, i) => i);
100
+ });
101
+
102
+ const getMarkerStyle = (isNowHour: boolean): StyleValue => {
103
+ if(isNowHour) {
104
+ return {
105
+ '--fs-agenda-hours-row-marker-color': primaryColors.base,
106
+ }
107
+ }
108
+ return {
109
+ '--fs-agenda-hours-row-marker-color': lightColors.base,
110
+ }
111
+ };
112
+
113
+ const to2Digits = (value: number) => value.toString().padStart(2, '0');
114
+
115
+ return {
116
+ fontColor,
117
+ hours,
118
+ getMarkerStyle,
119
+ to2Digits
120
+ };
121
+ },
122
+ });
123
+
124
+ </script>