@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,328 @@
1
+ <template>
2
+ <FSCol
3
+ class="fs-agenda-month-container"
4
+ height="100%"
5
+ width="100%"
6
+ gap="0"
7
+ >
8
+ <FSRow
9
+ gap="0"
10
+ :wrap="false"
11
+ >
12
+ <FSCol
13
+ height="100%"
14
+ :width="$props.firstColumnWidth"
15
+ >
16
+ </FSCol>
17
+
18
+ <FSAgendaHoursRow
19
+ :displayNow="$props.nowIsInSelectedRange"
20
+ :modelValue="nowHour"
21
+ />
22
+ </FSRow>
23
+ <FSRow
24
+ class="fs-agenda-month"
25
+ height="100%"
26
+ :style="style"
27
+ :wrap="false"
28
+ gap="0px"
29
+ >
30
+ <FSCol
31
+ class="fs-agenda-label-day-container"
32
+ height="100%"
33
+ gap="0"
34
+ :width="$props.firstColumnWidth"
35
+ >
36
+ <FSCol
37
+ class="fs-agenda-label-day"
38
+ v-for="day in weekDays"
39
+ :style="getDayLabelStyle(day.isNowDay)"
40
+ :key="day.dayNumber"
41
+ height="100%"
42
+ width="100%"
43
+ >
44
+ <FSCard
45
+ height="100%"
46
+ width="100%"
47
+ :borderRadius="0"
48
+ :border="false"
49
+ variant="standard"
50
+ :color="day.isNowDay ? 'primary' : 'background'"
51
+ >
52
+ <FSCol
53
+ padding="6px"
54
+ height="100%"
55
+ width="100%"
56
+ gap="2px"
57
+ align="center-left"
58
+ >
59
+ <FSCol
60
+ gap="0px"
61
+ >
62
+ <FSSpan
63
+ font="text-overline"
64
+ >
65
+ {{ day.dayName }}
66
+ </FSSpan>
67
+ <FSSpan
68
+ font="text-h3"
69
+ >
70
+ {{ to2Digits(day.dayNumber) }}
71
+ </FSSpan>
72
+ </FSCol>
73
+ <FSText
74
+ font="text-overline"
75
+ class="fs-agenda-week-number-label"
76
+ :color="weekTextColor"
77
+ >
78
+ {{ $tr('ui.common.agenda.week-short', 'W{0}',day.weekNumber) }}
79
+ </FSText>
80
+ </FSCol>
81
+ </FSCard>
82
+ </FSCol>
83
+
84
+ </FSCol>
85
+ <FSCol
86
+ class="fs-agenda-body"
87
+ gap="0"
88
+ height="100%"
89
+ width="100%"
90
+ >
91
+ <slot />
92
+ <template
93
+ v-if="loading"
94
+ >
95
+ <FSLoader
96
+ height="100%"
97
+ width="100%"
98
+ padding="2px"
99
+ />
100
+ </template>
101
+ <template
102
+ v-else
103
+ >
104
+ <FSRow
105
+ v-for="day in weekDays"
106
+ :key="day.dayNumber"
107
+ class="fs-agenda-row-day"
108
+ height="100%"
109
+ width="fill"
110
+ align="center-left"
111
+ >
112
+ <FSAgendaHorizontalEvent
113
+ v-for="event in getDayEvents(day.dayStartEpoch)"
114
+ :key="event.id"
115
+ :variant="event.end < now ? 'past' : event.start > now ? 'future' : 'current'"
116
+ :now="now"
117
+ :dayStart="day.dayStartEpoch"
118
+ :label="event.label"
119
+ :start="event.start"
120
+ :end="event.end"
121
+ :icon="event.icon"
122
+ :iconBis="event.iconBis"
123
+ :id="event.id"
124
+ :color="event.color"
125
+ @click="() => $emit('click:eventId', event.id)"
126
+ >
127
+ <template
128
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
129
+ >
130
+ <FSRow
131
+ align="center-left"
132
+ gap="4px"
133
+ :wrap="false"
134
+ >
135
+ <FSCol
136
+ height="100%"
137
+ width="fill"
138
+ align="center-left"
139
+ padding="8px 0 8px 8px"
140
+ >
141
+ <FSSpan>
142
+ {{ `${timeStart} - ${timeEnd}` }}
143
+ </FSSpan>
144
+ <FSRow
145
+ align="center-left"
146
+ :wrap="false"
147
+ >
148
+ <FSIcon
149
+ v-if="icon"
150
+ :icon="icon"
151
+ size="24px"
152
+ />
153
+ <FSSpan
154
+ font="text-button"
155
+ >
156
+ {{ label }}
157
+ </FSSpan>
158
+ </FSRow>
159
+ </FSCol>
160
+ <FSCol
161
+ v-if="iconBis && variant !== 'current'"
162
+ align="center-right"
163
+ padding="8px 8px 8px 0"
164
+ width="hug"
165
+ >
166
+ <FSIcon
167
+ :icon="iconBis"
168
+ size="20px"
169
+ />
170
+ </FSCol>
171
+ </FSRow>
172
+ </template>
173
+ </FSAgendaHorizontalEvent>
174
+ </FSRow>
175
+ </template>
176
+ </FSCol>
177
+ </FSRow>
178
+ </FSCol>
179
+ </template>
180
+
181
+ <script lang="ts">
182
+ import { defineComponent, computed, type PropType, type StyleValue } from 'vue';
183
+
184
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
185
+ import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
186
+
187
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
188
+ import { ColorEnum, type FSAgendaEvent } from "@dative-gpi/foundation-shared-components/models";
189
+
190
+ import FSAgendaHorizontalEvent from './FSAgendaHorizontalEvent.vue';
191
+ import FSAgendaHoursRow from './FSAgendaHoursRow.vue';
192
+ import FSCard from '../FSCard.vue';
193
+ import FSCol from '../FSCol.vue';
194
+ import FSRow from '../FSRow.vue';
195
+ import FSLoader from '../FSLoader.vue';
196
+ import FSSpan from '../FSSpan.vue';
197
+ import FSIcon from '../FSIcon.vue';
198
+ import FSText from '../FSText.vue';
199
+
200
+ export default defineComponent({
201
+ name: 'FSWeekAgenda',
202
+ components: {
203
+ FSAgendaHorizontalEvent,
204
+ FSAgendaHoursRow,
205
+ FSCard,
206
+ FSCol,
207
+ FSIcon,
208
+ FSLoader,
209
+ FSRow,
210
+ FSSpan,
211
+ FSText
212
+ },
213
+ props: {
214
+ now: {
215
+ type: Number,
216
+ required: true
217
+ },
218
+ start: {
219
+ type: Number,
220
+ required: true
221
+ },
222
+ end: {
223
+ type: Number,
224
+ required: true
225
+ },
226
+ nowIsInSelectedRange: {
227
+ type: Boolean,
228
+ required: true
229
+ },
230
+ firstColumnWidth: {
231
+ type: String,
232
+ required: true
233
+ },
234
+ loading: {
235
+ type: Boolean,
236
+ default: false
237
+ },
238
+ events: {
239
+ type: Array as PropType<FSAgendaEvent[]>,
240
+ default: () => []
241
+ }
242
+ },
243
+ emits: ['click:eventId'],
244
+ setup(props) {
245
+ const { $tr } = useTranslationsProvider();
246
+ const { getColors } = useColors();
247
+ const { epochToWeekNumber } = useDateFormat();
248
+
249
+ const primaryColors = getColors(ColorEnum.Primary);
250
+ const lightColors = getColors(ColorEnum.Light);
251
+
252
+ const weekTextColor = lightColors.dark;
253
+
254
+ const nowHour = computed(() => new Date(props.now).getHours());
255
+
256
+ const weekDays = computed(() => {
257
+ const daysOfWeek = [
258
+ $tr('ui.common.sunday-short', 'SUN'),
259
+ $tr('ui.common.monday-short', 'MON'),
260
+ $tr('ui.common.tuesday-short', 'TUE'),
261
+ $tr('ui.common.wednesday-short', 'WED'),
262
+ $tr('uui.common.thursday-short', 'THU'),
263
+ $tr('ui.common.friday-short', 'FRI'),
264
+ $tr('ui.common.saturday-short', 'SAT')
265
+ ];
266
+ const weekDaysArray = [];
267
+ const nowDate = new Date(props.now);
268
+
269
+ let currentDay = new Date(props.start);
270
+ const endDate = new Date(props.end);
271
+
272
+ while (currentDay <= endDate) {
273
+ weekDaysArray.push({
274
+ dayNumber: currentDay.getDate(),
275
+ dayName: daysOfWeek[currentDay.getDay()],
276
+ dayStartEpoch: currentDay.getTime(),
277
+ weekNumber: epochToWeekNumber(currentDay.getTime()),
278
+ isNowDay: currentDay.toDateString() === nowDate.toDateString(),
279
+ });
280
+
281
+ currentDay.setDate(currentDay.getDate() + 1);
282
+ }
283
+
284
+ return weekDaysArray;
285
+ });
286
+
287
+ const style = computed((): StyleValue => {
288
+ return {
289
+ '--fs-agenda-row-day-border-bottom-color': lightColors.base,
290
+ };
291
+ });
292
+
293
+ const to2Digits = (value: number | string) => {
294
+ return value.toString().padStart(2, '0');
295
+ };
296
+
297
+ const getDayLabelStyle = (isNowDay: boolean = false) => {
298
+ if (isNowDay) {
299
+ return {
300
+ '--fs-agenda-label-day-border-bottom-color': primaryColors.base,
301
+ '--fs-agenda-label-day-border-right-color': lightColors.base,
302
+ };
303
+ }
304
+ return {
305
+ '--fs-agenda-label-day-border-bottom-color': lightColors.base,
306
+ '--fs-agenda-label-day-border-right-color': lightColors.base,
307
+ };
308
+ };
309
+
310
+ const getDayEvents = (dayStartEpoch: number) => {
311
+ return props.events.filter((event) => {
312
+ const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
313
+ return event.start < dayEndEpoch && event.end > dayStartEpoch;
314
+ });
315
+ };
316
+
317
+ return {
318
+ style,
319
+ nowHour,
320
+ weekDays,
321
+ weekTextColor,
322
+ getDayEvents,
323
+ getDayLabelStyle,
324
+ to2Digits
325
+ };
326
+ },
327
+ });
328
+ </script>
@@ -2,6 +2,7 @@
2
2
  <FSAutocompleteField
3
3
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
4
4
  :multiple="$props.multiple"
5
+ :placeholder="placeholder"
5
6
  :loading="loading"
6
7
  :items="languages"
7
8
  :modelValue="$props.modelValue"
@@ -9,64 +10,33 @@
9
10
  v-bind="$attrs"
10
11
  >
11
12
  <template
12
- #autocomplete-selection="{ item }"
13
+ #item-prepend="{ item }"
13
14
  >
14
- <FSRow
15
- v-if="$props.modelValue"
16
- align="center-center"
17
- :wrap="false"
15
+ <FSIcon
16
+ v-if="item.icon"
18
17
  >
19
- <FSIcon
20
- v-if="item.raw.icon"
21
- >
22
- {{ item.raw.icon }}
23
- </FSIcon>
24
- <FSSpan>
25
- {{ item.raw.label }}
26
- </FSSpan>
27
- </FSRow>
28
- </template>
29
- <template
30
- #item-label="{ item, font }"
31
- >
32
- <FSRow
33
- align="center-left"
34
- :wrap="false"
35
- >
36
- <FSIcon
37
- v-if="item.raw.icon"
38
- >
39
- {{ item.raw.icon }}
40
- </FSIcon>
41
- <FSSpan
42
- :font="font"
43
- >
44
- {{ item.raw.label }}
45
- </FSSpan>
46
- </FSRow>
18
+ {{ item.icon }}
19
+ </FSIcon>
47
20
  </template>
48
21
  </FSAutocompleteField>
49
22
  </template>
50
23
 
51
24
  <script lang="ts">
52
- import { computed, defineComponent, type PropType } from "vue"
25
+ import { computed, defineComponent, type PropType } from "vue";
53
26
 
54
27
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
55
28
  import { type LanguageFilters } from "@dative-gpi/foundation-shared-domain/models";
29
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
56
30
  import { useLanguages } from "@dative-gpi/foundation-shared-services/composables";
57
31
 
58
32
  import FSAutocompleteField from "../fields/FSAutocompleteField.vue";
59
33
  import FSIcon from "../FSIcon.vue";
60
- import FSSpan from "../FSSpan.vue";
61
- import FSRow from "../FSRow.vue";
62
34
 
63
35
  export default defineComponent({
64
36
  name: "FSAutocompleteLanguage",
65
37
  components: {
66
38
  FSAutocompleteField,
67
- FSIcon,
68
- FSSpan,
69
- FSRow
39
+ FSIcon
70
40
  },
71
41
  props: {
72
42
  languageFilters: {
@@ -93,11 +63,19 @@ export default defineComponent({
93
63
  emits: ["update:modelValue"],
94
64
  setup(props, { emit }) {
95
65
  const { getMany: getManyLanguages, fetching: fetchingLanguages, entities: languages } = useLanguages();
66
+ const { $tr } = useTranslationsProvider();
96
67
 
97
68
  const loading = computed((): boolean => {
98
69
  return init.value && fetchingLanguages.value;
99
70
  });
100
71
 
72
+ const placeholder = computed((): string | null => {
73
+ if (props.multiple && props.modelValue) {
74
+ return $tr("ui.autocomplete-language.placeholder", "{0} language(s) selected", props.modelValue.length);
75
+ }
76
+ return null;
77
+ });
78
+
101
79
  const fetch = (search: string | null) => {
102
80
  return getManyLanguages({ ...props.languageFilters, search: search ?? undefined });
103
81
  };
@@ -110,6 +88,7 @@ export default defineComponent({
110
88
  );
111
89
 
112
90
  return {
91
+ placeholder,
113
92
  languages,
114
93
  toggleSet,
115
94
  loading,
@@ -3,6 +3,7 @@
3
3
  itemTitle="id"
4
4
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
5
5
  :multiple="$props.multiple"
6
+ :placeholder="placeholder"
6
7
  :loading="loading"
7
8
  :items="timeZones"
8
9
  :modelValue="$props.modelValue"
@@ -10,37 +11,12 @@
10
11
  v-bind="$attrs"
11
12
  >
12
13
  <template
13
- #autocomplete-selection="{ item }"
14
+ #item-append="{ item }"
14
15
  >
15
- <FSRow
16
- v-if="$props.modelValue"
17
- align="center-center"
18
- :wrap="false"
19
- >
20
- <FSChip
21
- :label="item.raw.offset"
22
- />
23
- <FSSpan>
24
- {{ item.raw.id }}
25
- </FSSpan>
26
- </FSRow>
27
- </template>
28
- <template
29
- #item-label="{ item, font }"
30
- >
31
- <FSRow
32
- align="center-left"
33
- :wrap="false"
34
- >
35
- <FSChip
36
- :label="item.raw.offset"
37
- />
38
- <FSSpan
39
- :font="font"
40
- >
41
- {{ item.raw.id }}
42
- </FSSpan>
43
- </FSRow>
16
+ <FSChip
17
+ v-if="item.offset"
18
+ :label="item.offset.split(':')[0]"
19
+ />
44
20
  </template>
45
21
  <template
46
22
  #toggle-set-item="props"
@@ -53,9 +29,10 @@
53
29
  @click="props.toggle(props.item)"
54
30
  >
55
31
  <template
56
- #prepend
32
+ #append
57
33
  >
58
34
  <FSChip
35
+ v-if="props.item.offset"
59
36
  :label="props.item.offset.split(':')[0]"
60
37
  />
61
38
  </template>
@@ -69,23 +46,20 @@ import { computed, defineComponent, type PropType } from "vue";
69
46
 
70
47
  import { type TimeZoneFilters, type TimeZoneInfos } from "@dative-gpi/foundation-shared-domain/models";
71
48
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
49
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
72
50
  import { useTimeZones } from "@dative-gpi/foundation-shared-services/composables";
73
51
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
74
52
 
75
53
  import FSAutocompleteField from "../fields/FSAutocompleteField.vue";
76
54
  import FSButton from "../FSButton.vue";
77
55
  import FSChip from "../FSChip.vue";
78
- import FSSpan from "../FSSpan.vue";
79
- import FSRow from "../FSRow.vue";
80
56
 
81
57
  export default defineComponent({
82
58
  name: "FSAutocompleteTimeZone",
83
59
  components: {
84
60
  FSAutocompleteField,
85
61
  FSButton,
86
- FSChip,
87
- FSSpan,
88
- FSRow
62
+ FSChip
89
63
  },
90
64
  props: {
91
65
  timeZoneFilters: {
@@ -112,16 +86,24 @@ export default defineComponent({
112
86
  emits: ["update:modelValue"],
113
87
  setup(props, { emit }) {
114
88
  const { getMany: getManyTimeZones, fetching: fetchingTimeZones, entities: timeZones } = useTimeZones();
89
+ const { $tr } = useTranslationsProvider();
115
90
 
116
91
  const loading = computed((): boolean => {
117
92
  return init.value && fetchingTimeZones.value;
118
93
  });
119
94
 
95
+ const placeholder = computed((): string | null => {
96
+ if (props.multiple && props.modelValue) {
97
+ return $tr("ui.autocomplete-time-zone.placeholder", "{0} time zone(s) selected", props.modelValue.length);
98
+ }
99
+ return null;
100
+ });
101
+
120
102
  const fetch = (search: string | null) => {
121
103
  return getManyTimeZones({ ...props.timeZoneFilters, search: search ?? undefined });
122
104
  };
123
105
 
124
- const { toggleSet, search, init, onUpdate } = useAutocomplete(
106
+ const { toggleSet, init, onUpdate } = useAutocomplete(
125
107
  timeZones,
126
108
  [() => props.timeZoneFilters],
127
109
  emit,
@@ -132,11 +114,11 @@ export default defineComponent({
132
114
  );
133
115
 
134
116
  return {
117
+ placeholder,
135
118
  ColorEnum,
136
119
  timeZones,
137
120
  toggleSet,
138
121
  loading,
139
- search,
140
122
  onUpdate
141
123
  };
142
124
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSButton
3
3
  prependIcon="mdi-cancel"
4
+
4
5
  :color="ColorEnum.Light"
5
6
  v-bind="$attrs"
6
7
  />
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <FSButton
3
+ prependIcon="mdi-content-copy"
4
+ :label="$tr('ui.button.copy', 'Copy')"
5
+ :color="ColorEnum.Light"
6
+ v-bind="$attrs"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { defineComponent } from "vue";
12
+
13
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
14
+
15
+ import FSButton from "../FSButton.vue";
16
+
17
+ export default defineComponent({
18
+ name: "FSButtonCopy",
19
+ components: {
20
+ FSButton
21
+ },
22
+ setup() {
23
+ return {
24
+ ColorEnum
25
+ }
26
+ }
27
+ });
28
+ </script>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <FSButton
3
+ icon="mdi-content-copy"
4
+ variant="icon"
5
+ :color="ColorEnum.Light"
6
+ v-bind="$attrs"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { defineComponent } from "vue";
12
+
13
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
14
+
15
+ import FSButton from "../FSButton.vue";
16
+
17
+ export default defineComponent({
18
+ name: "FSButtonCopyIcon",
19
+ components: {
20
+ FSButton
21
+ },
22
+ setup() {
23
+ return {
24
+ ColorEnum
25
+ }
26
+ }
27
+ });
28
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <FSButton
3
+ :label="$tr('ui.button.copy', 'Copy')"
4
+ :color="ColorEnum.Light"
5
+ v-bind="$attrs"
6
+ />
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent } from "vue";
11
+
12
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
13
+
14
+ import FSButton from "../FSButton.vue";
15
+
16
+ export default defineComponent({
17
+ name: "FSButtonCopyLabel",
18
+ components: {
19
+ FSButton
20
+ },
21
+ setup() {
22
+ return {
23
+ ColorEnum
24
+ }
25
+ }
26
+ });
27
+ </script>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <FSButton
3
+ prependIcon="mdi-content-copy"
4
+
5
+ :color="ColorEnum.Light"
6
+ v-bind="$attrs"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { defineComponent } from "vue";
12
+
13
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
14
+
15
+ import FSButton from "../FSButton.vue";
16
+
17
+ export default defineComponent({
18
+ name: "FSButtonCopyMini",
19
+ components: {
20
+ FSButton
21
+ },
22
+ setup() {
23
+ return {
24
+ ColorEnum
25
+ }
26
+ }
27
+ });
28
+ </script>