@dative-gpi/foundation-shared-components 1.0.65 → 1.0.67-map-edit

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 (294) hide show
  1. package/assets/images/map/snow.png +0 -0
  2. package/components/FSAccordionPanel.vue +40 -21
  3. package/components/FSBreadcrumbs.vue +21 -12
  4. package/components/FSButton.vue +11 -9
  5. package/components/FSCalendar.vue +50 -12
  6. package/components/FSCalendarTwin.vue +95 -43
  7. package/components/FSCard.vue +61 -9
  8. package/components/FSCardPlaceholder.vue +8 -5
  9. package/components/FSCheckbox.vue +5 -4
  10. package/components/FSChip.vue +73 -45
  11. package/components/FSChipGroup.vue +69 -0
  12. package/components/FSClickable.vue +11 -9
  13. package/components/FSClock.vue +30 -12
  14. package/components/FSCol.vue +11 -5
  15. package/components/FSDialog.vue +2 -1
  16. package/components/FSDialogContent.vue +12 -11
  17. package/components/FSDialogForm.vue +22 -2
  18. package/components/FSDialogFormBody.vue +50 -31
  19. package/components/FSDialogMenu.vue +17 -8
  20. package/components/FSDialogMultiFormBody.vue +23 -13
  21. package/components/FSDialogRemove.vue +7 -8
  22. package/components/FSDialogSubmit.vue +20 -11
  23. package/components/FSEditImageUI.vue +13 -5
  24. package/components/FSFadeOut.vue +53 -21
  25. package/components/FSForm.vue +10 -8
  26. package/components/FSGrid.vue +0 -1
  27. package/components/FSIcon.vue +2 -2
  28. package/components/FSIconCard.vue +68 -12
  29. package/components/FSInformationsMenu.vue +142 -0
  30. package/components/FSInstantPicker.vue +268 -0
  31. package/components/FSLink.vue +25 -9
  32. package/components/FSLoader.vue +28 -10
  33. package/components/FSMenu.vue +47 -0
  34. package/components/FSOptionGroup.vue +8 -8
  35. package/components/FSOptionItem.vue +4 -4
  36. package/components/FSOptionsMenu.vue +165 -0
  37. package/components/FSPagination.vue +1 -1
  38. package/components/FSPlayButtons.vue +72 -0
  39. package/components/FSProgressBar.vue +94 -0
  40. package/components/FSRadio.vue +5 -4
  41. package/components/FSRadioGroup.vue +3 -3
  42. package/components/FSRangePicker.vue +275 -0
  43. package/components/FSRangeSlider.vue +84 -0
  44. package/components/FSRouterLink.vue +42 -0
  45. package/components/FSSlideGroup.vue +19 -5
  46. package/components/FSSlider.vue +44 -79
  47. package/components/FSSpan.vue +12 -7
  48. package/components/FSSwitch.vue +44 -48
  49. package/components/FSTab.vue +15 -13
  50. package/components/FSTabs.vue +32 -7
  51. package/components/FSTag.vue +3 -3
  52. package/components/FSTagGroup.vue +6 -4
  53. package/components/FSText.vue +11 -7
  54. package/components/FSToggleSet.vue +7 -7
  55. package/components/FSWindow.vue +122 -5
  56. package/components/FSWrapGroup.vue +13 -1
  57. package/components/agenda/FSAgenda.vue +26 -7
  58. package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
  59. package/components/agenda/FSAgendaHeader.vue +35 -10
  60. package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
  61. package/components/agenda/FSAgendaHoursRow.vue +48 -8
  62. package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
  63. package/components/agenda/FSDayAgenda.vue +0 -1
  64. package/components/agenda/FSMonthAgenda.vue +1 -6
  65. package/components/agenda/FSSelectAgendaMode.vue +2 -2
  66. package/components/agenda/FSWeekAgenda.vue +5 -10
  67. package/components/autocompletes/FSAutoCompleteAddress.vue +25 -20
  68. package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
  69. package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
  70. package/components/buttons/FSButtonAdd.vue +1 -1
  71. package/components/buttons/FSButtonAddLabel.vue +1 -1
  72. package/components/buttons/FSButtonCancel.vue +1 -1
  73. package/components/buttons/FSButtonCancelLabel.vue +1 -1
  74. package/components/buttons/FSButtonCheckbox.vue +4 -4
  75. package/components/buttons/FSButtonCopy.vue +1 -1
  76. package/components/buttons/FSButtonCopyLabel.vue +1 -1
  77. package/components/buttons/FSButtonDuplicate.vue +1 -1
  78. package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
  79. package/components/buttons/FSButtonEdit.vue +1 -1
  80. package/components/buttons/FSButtonEditLabel.vue +1 -1
  81. package/components/buttons/FSButtonFile.vue +1 -1
  82. package/components/buttons/FSButtonFileLabel.vue +1 -1
  83. package/components/buttons/FSButtonNext.vue +1 -1
  84. package/components/buttons/FSButtonNextLabel.vue +1 -1
  85. package/components/buttons/FSButtonPrevious.vue +1 -1
  86. package/components/buttons/FSButtonPreviousLabel.vue +1 -1
  87. package/components/buttons/FSButtonRedo.vue +1 -1
  88. package/components/buttons/FSButtonRedoLabel.vue +1 -1
  89. package/components/buttons/FSButtonRemove.vue +1 -1
  90. package/components/buttons/FSButtonRemoveLabel.vue +1 -1
  91. package/components/buttons/FSButtonSave.vue +1 -1
  92. package/components/buttons/FSButtonSaveLabel.vue +1 -1
  93. package/components/buttons/FSButtonSearch.vue +1 -1
  94. package/components/buttons/FSButtonSearchLabel.vue +1 -1
  95. package/components/buttons/FSButtonUndo.vue +1 -1
  96. package/components/buttons/FSButtonUndoLabel.vue +1 -1
  97. package/components/buttons/FSButtonUpdate.vue +1 -1
  98. package/components/buttons/FSButtonUpdateLabel.vue +1 -1
  99. package/components/buttons/FSButtonValidate.vue +1 -1
  100. package/components/buttons/FSButtonValidateLabel.vue +1 -1
  101. package/components/calendar/FSSimpleCalendar.vue +145 -0
  102. package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
  103. package/components/calendar/FSSimpleMonthSelector.vue +138 -0
  104. package/components/deviceOrganisations/FSConnectivity.vue +5 -3
  105. package/components/deviceOrganisations/FSStatus.vue +5 -3
  106. package/components/deviceOrganisations/FSStatusCard.vue +7 -9
  107. package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
  108. package/components/deviceOrganisations/FSWorstAlert.vue +24 -36
  109. package/components/deviceOrganisations/FSWorstAlertCard.vue +8 -47
  110. package/components/fields/FSAutocompleteField.vue +85 -82
  111. package/components/fields/FSAutocompleteTag.vue +1 -1
  112. package/components/fields/FSBaseField.vue +42 -25
  113. package/components/fields/FSClosableSearchField.vue +83 -0
  114. package/components/fields/FSColorField.vue +12 -10
  115. package/components/fields/FSCommentField.vue +28 -16
  116. package/components/fields/FSDateField.vue +13 -10
  117. package/components/fields/FSDateRangeField.vue +6 -5
  118. package/components/fields/FSDateTimeField.vue +14 -11
  119. package/components/fields/FSDateTimeRangeDialog.vue +160 -0
  120. package/components/fields/FSDateTimeRangeField.vue +23 -115
  121. package/components/fields/FSEntityFieldUI.vue +19 -16
  122. package/components/fields/FSGradientField.vue +5 -5
  123. package/components/fields/FSIconField.vue +16 -9
  124. package/components/fields/FSMagicConfigField.vue +15 -7
  125. package/components/fields/FSMagicField.vue +7 -2
  126. package/components/fields/FSNumberField.vue +8 -4
  127. package/components/fields/FSPasswordField.vue +7 -7
  128. package/components/fields/FSRichTextField.vue +78 -58
  129. package/components/fields/FSSearchField.vue +9 -115
  130. package/components/fields/FSSelectField.vue +69 -71
  131. package/components/fields/FSTagField.vue +9 -9
  132. package/components/fields/FSTermField.vue +69 -46
  133. package/components/fields/FSTextArea.vue +17 -11
  134. package/components/fields/FSTextField.vue +15 -10
  135. package/components/fields/FSTimeField.vue +14 -10
  136. package/components/fields/FSTimeRangeField.vue +310 -0
  137. package/components/fields/FSTimeStepField.vue +5 -5
  138. package/components/fields/FSTranslateField.vue +10 -10
  139. package/components/fields/FSTranslateRichTextField.vue +41 -20
  140. package/components/fields/FSTranslateTextArea.vue +10 -10
  141. package/components/fields/FSTreeViewField.vue +15 -13
  142. package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
  143. package/components/fields/periodicField/FSPeriodicField.vue +15 -15
  144. package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
  145. package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
  146. package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
  147. package/components/lists/FSDataIteratorItem.vue +23 -67
  148. package/components/lists/FSDataTableUI.vue +198 -123
  149. package/components/lists/FSDraggable.vue +2 -2
  150. package/components/lists/FSFilterButton.vue +14 -16
  151. package/components/lists/FSHeaderButton.vue +11 -9
  152. package/components/lists/FSHiddenButton.vue +9 -9
  153. package/components/lists/FSLoadDataTable.vue +10 -7
  154. package/components/lists/FSSimpleList.vue +95 -88
  155. package/components/lists/FSSimpleListItem.vue +131 -0
  156. package/components/map/FSMap.vue +144 -158
  157. package/components/map/FSMapEditLocationAddress.vue +189 -0
  158. package/components/map/FSMapFeatureGroup.vue +7 -1
  159. package/components/map/FSMapLayerButton.vue +4 -3
  160. package/components/map/FSMapMarker.vue +103 -42
  161. package/components/map/FSMapMarkerClusterGroup.vue +32 -7
  162. package/components/map/FSMapOverlay.vue +44 -24
  163. package/components/map/FSMapPolygon.vue +16 -4
  164. package/components/map/FSMapTileLayer.vue +26 -9
  165. package/components/map/layers.ts +0 -0
  166. package/components/selects/FSSelectAutoRefresh.vue +8 -8
  167. package/components/selects/FSSelectDashboardVariableType.vue +4 -3
  168. package/components/selects/FSSelectDateSetting.vue +2 -2
  169. package/components/selects/FSSelectDays.vue +8 -8
  170. package/components/selects/FSSelectListMode.vue +2 -2
  171. package/components/selects/FSSelectMapLayer.vue +68 -0
  172. package/components/selects/FSSelectMonths.vue +13 -13
  173. package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
  174. package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
  175. package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
  176. package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
  177. package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
  178. package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
  179. package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
  180. package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
  181. package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
  182. package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
  183. package/components/tiles/FSAlertTileUI.vue +90 -0
  184. package/components/tiles/FSChartTileUI.vue +61 -52
  185. package/components/tiles/FSCommentTileUI.vue +38 -13
  186. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
  187. package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
  188. package/components/tiles/FSDeviceOrganisationTileUI.vue +0 -6
  189. package/components/tiles/FSEntityCountBadge.vue +72 -0
  190. package/components/tiles/FSFolderTileUI.vue +38 -4
  191. package/components/tiles/FSGroupTileUI.vue +32 -136
  192. package/components/tiles/FSLoadTile.vue +16 -10
  193. package/components/tiles/FSLocationTileUI.vue +45 -63
  194. package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
  195. package/components/tiles/FSSimpleTileUI.vue +30 -24
  196. package/components/tiles/FSTile.vue +46 -39
  197. package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
  198. package/components/tiles/FSUserTileUI.vue +119 -0
  199. package/components/toggleSets/FSToggleSetPosition.vue +1 -1
  200. package/components/views/FSBaseView.vue +64 -0
  201. package/components/views/FSEntityView.vue +12 -146
  202. package/components/views/FSSimpleView.vue +29 -0
  203. package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
  204. package/components/views/desktop/FSBaseDesktopView.vue +53 -0
  205. package/components/views/desktop/FSBaseEntityDesktopView.vue +211 -0
  206. package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
  207. package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
  208. package/components/views/mobile/FSBaseMobileView.vue +53 -0
  209. package/composables/index.ts +1 -0
  210. package/composables/useAddress.ts +40 -8
  211. package/composables/useBreakpoints.ts +40 -4
  212. package/composables/useColors.ts +16 -7
  213. package/composables/useMagicFieldProvider.ts +1 -0
  214. package/composables/useMapLayers.ts +69 -0
  215. package/composables/useSlots.ts +2 -1
  216. package/models/colors.ts +2 -1
  217. package/models/deviceAlerts.ts +1 -0
  218. package/models/magicFields.ts +1 -0
  219. package/models/map.ts +12 -10
  220. package/models/rules.ts +5 -2
  221. package/models/tables.ts +2 -1
  222. package/models/variableNode.ts +8 -5
  223. package/package.json +5 -5
  224. package/styles/components/fs_agenda.scss +4 -0
  225. package/styles/components/fs_agenda_event.scss +1 -1
  226. package/styles/components/fs_agenda_hours_row.scss +0 -8
  227. package/styles/components/fs_autocomplete_field.scss +0 -13
  228. package/styles/components/fs_breadcrumbs.scss +18 -36
  229. package/styles/components/fs_button.scss +7 -5
  230. package/styles/components/fs_calendar.scss +1 -0
  231. package/styles/components/fs_card.scss +9 -0
  232. package/styles/components/fs_chip.scss +13 -7
  233. package/styles/components/fs_clickable.scss +16 -23
  234. package/styles/components/fs_clock.scss +0 -10
  235. package/styles/components/fs_col.scss +1 -1
  236. package/styles/components/fs_color_field.scss +0 -4
  237. package/styles/components/fs_data_table.scss +6 -9
  238. package/styles/components/fs_dialog.scss +4 -10
  239. package/styles/components/fs_dialog_menu.scss +4 -2
  240. package/styles/components/fs_draggable.scss +0 -5
  241. package/styles/components/fs_fade_out.scss +10 -2
  242. package/styles/components/fs_filter_button.scss +1 -1
  243. package/styles/components/fs_hidden_button.scss +2 -7
  244. package/styles/components/fs_image_card.scss +6 -4
  245. package/styles/components/fs_magic_config_field.scss +1 -2
  246. package/styles/components/fs_map.scss +57 -17
  247. package/styles/components/fs_meta_field.scss +3 -5
  248. package/styles/components/fs_password_field.scss +4 -2
  249. package/styles/components/fs_progress_bar.scss +14 -0
  250. package/styles/components/fs_radio.scss +0 -11
  251. package/styles/components/fs_rich_text_field.scss +1 -10
  252. package/styles/components/fs_select_field.scss +4 -13
  253. package/styles/components/fs_slide_group.scss +7 -0
  254. package/styles/components/fs_slider.scss +0 -40
  255. package/styles/components/fs_span.scss +13 -5
  256. package/styles/components/fs_status_rich_card.scss +6 -0
  257. package/styles/components/fs_tabs.scss +18 -37
  258. package/styles/components/fs_tag.scss +8 -22
  259. package/styles/components/fs_text_area.scss +2 -21
  260. package/styles/components/fs_tile.scss +0 -19
  261. package/styles/components/fs_window.scss +3 -1
  262. package/styles/components/fs_wrap_group.scss +7 -0
  263. package/styles/components/index.scss +2 -6
  264. package/styles/globals/index.scss +1 -5
  265. package/styles/globals/overrides.scss +26 -54
  266. package/styles/globals/scrollbars.scss +8 -0
  267. package/styles/globals/text_fonts.scss +18 -66
  268. package/styles/globals/touchscreen.scss +2 -2
  269. package/tools/alertsTools.ts +94 -18
  270. package/tools/chartsTools.ts +155 -16
  271. package/tools/index.ts +3 -1
  272. package/tools/reportsTools.ts +38 -0
  273. package/tools/timeRangeTools.ts +125 -0
  274. package/utils/badge.ts +9 -5
  275. package/utils/filter.ts +4 -1
  276. package/utils/index.ts +2 -0
  277. package/utils/leafletMarkers.ts +4 -4
  278. package/utils/operations.ts +108 -0
  279. package/utils/picker.ts +40 -0
  280. package/utils/sort.ts +2 -2
  281. package/utils/time.ts +13 -13
  282. package/components/fields/FSTimeSlotField.vue +0 -250
  283. package/components/views/FSEntityHeader.vue +0 -343
  284. package/components/views/FSListHeader.vue +0 -83
  285. package/components/views/FSListView.vue +0 -83
  286. package/components/views/FSSkeletonView.vue +0 -100
  287. package/styles/components/fs_data_iterator_item.scss +0 -33
  288. package/styles/components/fs_icon_field.scss +0 -12
  289. package/styles/components/fs_search_field.scss +0 -3
  290. package/styles/components/fs_tag_field.scss +0 -8
  291. package/styles/components/fs_time_field.scss +0 -12
  292. package/styles/components/fs_timeslot_field.scss +0 -12
  293. package/styles/globals/breakpoints.scss +0 -20
  294. package/styles/globals/fixes.scss +0 -5
@@ -1,20 +1,25 @@
1
+ /// <reference types="@types/google.maps" />
1
2
  import _ from "lodash";
2
3
 
3
4
  import { Address, type Place } from "@dative-gpi/foundation-shared-domain/models";
5
+ import { useAppLanguageCode } from '@dative-gpi/foundation-shared-services/composables';
4
6
 
5
7
  export const useAddress = () => {
6
8
  const enabled = true;
9
+ const { languageCode } = useAppLanguageCode();
10
+
7
11
  let initialized = false;
12
+ let userLocation: google.maps.LatLngLiteral | null;
8
13
  let searchService: google.maps.places.AutocompleteService;
9
14
  let placeService: google.maps.places.PlacesService;
10
15
  let sessionId: google.maps.places.AutocompleteSessionToken;
11
-
12
16
 
13
17
  const init = async () => {
14
18
  await window.initMap;
19
+ userLocation = await getCurrentLocation();
15
20
  searchService = new google.maps.places.AutocompleteService();
16
21
  placeService = new google.maps.places.PlacesService(
17
- document.getElementById("places") as HTMLDivElement
22
+ document.createElement("div")
18
23
  );
19
24
  sessionId = new google.maps.places.AutocompleteSessionToken();
20
25
  initialized = true;
@@ -25,11 +30,12 @@ export const useAddress = () => {
25
30
  await init();
26
31
  }
27
32
 
28
- return _search(search).then(result => {
29
- return _.map(result, r => ({ id: r.place_id, label: r.description }));
30
- }).catch(() => {
31
- return [];
32
- });
33
+ const mapsResults = await _search(search);
34
+
35
+ return mapsResults.map((result) => ({
36
+ id: result.place_id,
37
+ label: result.description
38
+ }));
33
39
  }
34
40
 
35
41
  const get = async (place: Place): Promise<Address> => {
@@ -78,16 +84,42 @@ export const useAddress = () => {
78
84
  });
79
85
  }
80
86
 
87
+ const getCurrentLocation = async (): Promise<google.maps.LatLngLiteral | null> => {
88
+ if (!navigator.geolocation) {
89
+ return null;
90
+ }
91
+
92
+ return new Promise((resolve) => {
93
+ navigator.geolocation.getCurrentPosition(
94
+ (position) => {
95
+ resolve({
96
+ lat: position.coords.latitude,
97
+ lng: position.coords.longitude
98
+ });
99
+ },
100
+ () => resolve(null)
101
+ );
102
+ });
103
+ };
104
+
81
105
  const _search = (search: string) => {
82
106
  if (!enabled) {
83
107
  throw new Error("offline mode, do not call this method");
84
108
  }
85
109
  return new Promise<google.maps.places.AutocompletePrediction[]>(
86
110
  (resolve, reject) => {
111
+ /**
112
+ * ISO 3166 language code
113
+ */
114
+ const isoLanguageCode = languageCode.value?.split("-")[0];
115
+
87
116
  searchService!.getPlacePredictions(
88
117
  {
89
118
  input: search,
90
- sessionToken: sessionId!
119
+ region: isoLanguageCode,
120
+ language: isoLanguageCode,
121
+ sessionToken: sessionId,
122
+ locationBias: userLocation,
91
123
  },
92
124
  function (result, status) {
93
125
  if (status != google.maps.places.PlacesServiceStatus.OK || !result) {
@@ -5,22 +5,31 @@ let initialized = false;
5
5
  const windowHeight = ref(window.innerHeight);
6
6
  const windowWidth = ref(window.innerWidth);
7
7
 
8
+ const windowOuterWidth = ref(!window.document.hasFocus() && window.outerWidth === 0 ? window.innerWidth : window.outerWidth);
9
+
8
10
  export const useBreakpoints = () => {
9
11
  const onSizeChange = (): void => {
10
12
  windowHeight.value = window.innerHeight;
11
13
  windowWidth.value = window.innerWidth;
14
+
15
+ // Bug in chromium based browsers where window.outerWidth is 0 when tab loads without focus
16
+ if (!window.document.hasFocus() && window.outerWidth === 0) {
17
+ windowOuterWidth.value = window.innerWidth;
18
+ return;
19
+ }
20
+ windowOuterWidth.value = window.outerWidth;
12
21
  };
13
22
 
14
23
  const isTouchScreenEnabled = computed((): boolean => {
15
- return navigator.maxTouchPoints > 0;
24
+ return window.matchMedia('(hover: none), (pointer: coarse), (pointer: none)').matches;
16
25
  });
17
26
 
18
27
  const isMobileSized = computed((): boolean => {
19
- return windowWidth.value < 1264;
28
+ return windowOuterWidth.value < 1264;
20
29
  });
21
30
 
22
31
  const isExtraSmall = computed((): boolean => {
23
- return windowWidth.value < 600;
32
+ return windowOuterWidth.value < 600;
24
33
  });
25
34
 
26
35
  if (!initialized) {
@@ -28,11 +37,38 @@ export const useBreakpoints = () => {
28
37
  initialized = true;
29
38
  }
30
39
 
40
+ const fontStyles = computed(() => ({
41
+ "--fs-font-h1-font-size" : isMobileSized.value ? "28px" : "36px",
42
+ "--fs-font-h1-line-height" : isMobileSized.value ? "32px" : "40px",
43
+ "--fs-font-h1-letter-spacing" : isMobileSized.value ? "-1.4px" : "-0.72px",
44
+ "--fs-font-h2-font-size" : isMobileSized.value ? "22px" : "26px",
45
+ "--fs-font-h2-line-height" : isMobileSized.value ? "24px" : "32px",
46
+ "--fs-font-h2-letter-spacing" : isMobileSized.value ? "-0.88px" : "-0.78px",
47
+ "--fs-font-h3-font-size" : isMobileSized.value ? "16px" : "20px",
48
+ "--fs-font-h3-line-height" : isMobileSized.value ? "20px" : "24px",
49
+ "--fs-font-h3-letter-spacing" : isMobileSized.value ? "-0.48px" : "-0.6px",
50
+ "--fs-font-button-font-size" : isMobileSized.value ? "12px" : "14px",
51
+ "--fs-font-button-line-height" : isMobileSized.value ? "16px" : "20px",
52
+ "--fs-font-button-letter-spacing" : isMobileSized.value ? "-0.36px" : "-0.42px",
53
+ "--fs-font-overline-font-size" : isMobileSized.value ? "10px" : "12px",
54
+ "--fs-font-overline-line-height" : isMobileSized.value ? "16px" : "16px",
55
+ "--fs-font-overline-letter-spacing": isMobileSized.value ? "0" : "0",
56
+ ...bodyStyle.value
57
+ }));
58
+
59
+ const bodyStyle = computed(() => ({
60
+ "--fs-font-body-font-size" : isMobileSized.value ? "12px" : "14px",
61
+ "--fs-font-body-line-height" : isMobileSized.value ? "16px" : "20px",
62
+ "--fs-font-body-letter-spacing": isMobileSized.value ? "-0.36px" : "-0.42px",
63
+ }));
64
+
31
65
  return {
32
66
  isTouchScreenEnabled,
33
67
  isMobileSized,
34
68
  isExtraSmall,
35
69
  windowHeight,
36
- windowWidth
70
+ windowWidth,
71
+ fontStyles,
72
+ bodyStyle
37
73
  };
38
74
  }
@@ -5,6 +5,8 @@ import Color from "color";
5
5
  import type { ColorBase, ColorVariations } from "@dative-gpi/foundation-shared-components/models";
6
6
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
7
7
 
8
+ const colorsCache: Map<string, ColorVariations> = new Map();
9
+
8
10
  export const useColors = () => {
9
11
  const theme = useTheme().current.value;
10
12
  const baseMinSaturation = 0;
@@ -40,17 +42,17 @@ export const useColors = () => {
40
42
  };
41
43
 
42
44
  const getContrast = (color: Color): Color => {
43
- if(isGrayScale(color)){
45
+ if (isGrayScale(color)) {
44
46
  const coeff = 4
45
47
  return color
46
48
  .value(color.value() < 70 ? 100 : Math.max(color.value() / coeff, 0));
47
49
  }
48
50
 
49
- if(isPastel(color)){
51
+ if (isPastel(color)) {
50
52
  return color.darken(0.6);
51
53
  }
52
54
 
53
- if(color.darken(0.15).isLight()){
55
+ if (color.darken(0.15).isLight()) {
54
56
  return color.darken(0.8);
55
57
  }
56
58
 
@@ -59,7 +61,7 @@ export const useColors = () => {
59
61
 
60
62
  const parseColor = (color: ColorBase): Color => {
61
63
  const themed = (Object as any).values(ColorEnum).includes(color);
62
-
64
+
63
65
  try {
64
66
  return themed ? new Color(theme.colors[color as ColorEnum]) : new Color(color);
65
67
  }
@@ -70,7 +72,7 @@ export const useColors = () => {
70
72
 
71
73
  const getColors = (color: ColorBase): ColorVariations => {
72
74
  const base = parseColor(color);
73
-
75
+
74
76
  const light = getLight(base);
75
77
  const soft = getSoft(base);
76
78
  const dark = getDark(base);
@@ -88,7 +90,7 @@ export const useColors = () => {
88
90
  };
89
91
 
90
92
  const getGradients = (colors: ColorBase | ColorBase[], rotation: number = 90): ColorVariations => {
91
- const variations = Array.isArray(colors) ? colors.map(getColors) : [getColors(colors)];
93
+ const variations = Array.isArray(colors) ? colors.map(getColorsCached) : [getColorsCached(colors)];
92
94
 
93
95
  if (variations.length === 1) {
94
96
  return variations[0];
@@ -121,9 +123,16 @@ export const useColors = () => {
121
123
  return colors;
122
124
  }
123
125
 
126
+ const getColorsCached = (color: ColorBase): ColorVariations => {
127
+ if (!colorsCache.has(color)) {
128
+ const variations = getColors(color);
129
+ colorsCache.set(color, variations);
130
+ }
131
+ return colorsCache.get(color) as ColorVariations;
132
+ };
124
133
 
125
134
  return {
126
- getColors,
135
+ getColors : getColorsCached,
127
136
  getGradients,
128
137
  getBasePaletteColors
129
138
  };
@@ -10,6 +10,7 @@ const FIELDS = {
10
10
  [MagicFieldType.IconField] : defineAsyncComponent(() => import("../components/fields/FSIconField.vue")),
11
11
  [MagicFieldType.TimeField] : defineAsyncComponent(() => import("../components/fields/FSTimeField.vue")),
12
12
  [MagicFieldType.TimeStepField] : defineAsyncComponent(() => import("../components/fields/FSTimeStepField.vue")),
13
+ [MagicFieldType.PlotPerField] : defineAsyncComponent(() => import("../components/selects/chartSelectors/FSPlotPerSelector.vue")),
13
14
  };
14
15
 
15
16
  export const useMagicFieldProvider = () => {
@@ -0,0 +1,69 @@
1
+ import { ref, onMounted } from "vue";
2
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
3
+ import { MapLayers } from '@dative-gpi/foundation-shared-components/models';
4
+
5
+ export const useMapLayers = () => {
6
+ const { $tr } = useTranslationsProvider();
7
+ const apiKey = import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? "";
8
+
9
+ const layers = ref<any[]>([]);
10
+
11
+ onMounted(async () => {
12
+ try {
13
+ const leaflet = await import('leaflet');
14
+ const tileLayer = leaflet.tileLayer;
15
+
16
+ layers.value = [
17
+ {
18
+ name: MapLayers.Map,
19
+ label: $tr("ui.map-layer.map", "Map"),
20
+ image: new URL("../assets/images/map/map.png", import.meta.url).href,
21
+ layers: [
22
+ tileLayer(`https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=${apiKey}`, {
23
+ maxZoom: 22,
24
+ subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
25
+ attribution: '© Google Map Data',
26
+ className: 'fs-map-tile-base-layer'
27
+ })
28
+ ]
29
+ },
30
+ {
31
+ name: MapLayers.Imagery,
32
+ label: $tr("ui.map-layer.imagery", "Imagery"),
33
+ image: new URL("../assets/images/map/imagery.png", import.meta.url).href,
34
+ layers: [
35
+ tileLayer(`https://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}&key=${apiKey}`, {
36
+ maxZoom: 22,
37
+ subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
38
+ attribution: '© Google Map Data',
39
+ className: 'fs-map-tile-base-layer'
40
+ })
41
+ ]
42
+ },
43
+ {
44
+ name: MapLayers.Snow,
45
+ label: $tr("ui.map-layer.snow", "Snow ski map"),
46
+ image: new URL("../assets/images/map/snow.png", import.meta.url).href,
47
+ layers: [
48
+ tileLayer(`https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=${apiKey}`, {
49
+ maxZoom: 22,
50
+ subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
51
+ attribution: '© Google Map Data',
52
+ className: 'fs-map-tile-base-layer fs-map-tile-grayscale-layer'
53
+ }),
54
+ tileLayer(`https://tiles.opensnowmap.org/pistes/{z}/{x}/{y}.png`, {
55
+ maxZoom: 18,
56
+ attribution: 'Map data: &copy; OpenStreetMap contributors & ODbL, CC-BY-SA',
57
+ className: 'fs-map-tile-base-layer'
58
+ })
59
+ ]
60
+ }
61
+ ];
62
+ } catch (err) {
63
+ console.error("Leaflet is not installed or failed to load.", err);
64
+ layers.value = [];
65
+ }
66
+ });
67
+
68
+ return { layers };
69
+ };
@@ -20,11 +20,12 @@ export const useSlots = () => {
20
20
  // Directive wrapper (v-for, v-if)
21
21
  case "symbol":
22
22
  switch (element.type) {
23
+ // On a v-for, we want to get the children of the v-for
23
24
  case Symbol.for("v-fgt"):
24
25
  returnElements.push(...recursiveGetChildren(element.children));
25
26
  break;
27
+ // On a negative v-if, we want to get nothing
26
28
  case Symbol.for("v-cmt"):
27
- returnElements.push(element);
28
29
  break;
29
30
  default:
30
31
  returnElements.push(element);
package/models/colors.ts CHANGED
@@ -19,4 +19,5 @@ export interface ColorVariations {
19
19
  darkContrast?: string | null;
20
20
  }
21
21
 
22
- export type ColorBase = (string | ColorEnum);
22
+ export type ColorBase = (string | ColorEnum);
23
+ export type ColorBaseVariations = "base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast";
@@ -7,4 +7,5 @@ export interface FSDeviceAlert {
7
7
  criticity: Criticity;
8
8
  sourceTimestamp?: number | null;
9
9
  enqueuedTimestamp?: number | null;
10
+ actualTimestamp?: number | null;
10
11
  }
@@ -7,4 +7,5 @@ export enum MagicFieldType {
7
7
  IconField = 5,
8
8
  TimeField = 6,
9
9
  TimeStepField = 7,
10
+ PlotPerField = 8,
10
11
  }
package/models/map.ts CHANGED
@@ -1,18 +1,20 @@
1
1
  import { type Layer } from "leaflet";
2
2
 
3
- import { type Address } from "@dative-gpi/foundation-shared-domain/models";
4
-
5
3
  export interface MapLayer {
6
- name : string;
4
+ name : MapLayers;
7
5
  label: string;
8
6
  image: string;
9
- layer: Layer;
7
+ layers: Layer[];
10
8
  }
11
9
 
12
- export interface FSLocation {
13
- id: string;
14
- label: string;
15
- icon: string | null;
16
- address: Address;
17
- color: string | null;
10
+ export enum MapLayers {
11
+ Map = "map",
12
+ Imagery = "imagery",
13
+ Snow= "snow"
14
+ }
15
+
16
+ export enum MapOverlayPositions {
17
+ Expand = "expand",
18
+ Half = "half",
19
+ Collapse = "collapse",
18
20
  }
package/models/rules.ts CHANGED
@@ -2,8 +2,9 @@ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui
2
2
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
3
3
  import { validateExpression } from "@dative-gpi/foundation-shared-domain/tools";
4
4
 
5
- import { getTimeBestString } from "../utils";
6
- import type { TimeUnit } from "@/shared/foundation-shared-domain/enums";
5
+ import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums";
6
+
7
+ import { getTimeBestString, validateOperation } from "../utils";
7
8
 
8
9
  const { epochToLongDateFormat } = useDateFormat()!;
9
10
  const { $tr } = useTranslationsProvider();
@@ -22,6 +23,8 @@ export const TextRules = {
22
23
  different: (original: string, message: string | undefined = undefined) => (value: string) => value != original || (message ?? $tr("ui.rules.text-different", "Must be different from original")),
23
24
  outside: (values: string[], message: string | undefined = undefined) => (value: string) => !values.includes(value) || (message ?? $tr("ui.rules.text-outside", "Must be different from others")),
24
25
  inside: (values: string[], message: string | undefined = undefined) => (value: string) => values.includes(value) || (message ?? $tr("ui.rules.text-inside", "Must be one of the options")),
26
+ operation: (operands: string[], variables: string[], message: string | undefined = undefined) => (value: string) => validateOperation(value, operands, variables) || (message ?? $tr("ui.rules.text-operation", "Invalid operation")),
27
+ singleWord: (message: string | undefined = undefined) => (value: string) => !value.includes(" ") || (message ?? $tr("ui.rules.text-single-word", "Must be a single word")),
25
28
  };
26
29
 
27
30
  export const TagRules = {
package/models/tables.ts CHANGED
@@ -37,8 +37,9 @@ export interface FSDataTableOrder {
37
37
  export interface FSDataTable {
38
38
  headers: FSDataTableColumn[];
39
39
  sortBy: FSDataTableOrder | null;
40
- mode: "table" | "iterator";
40
+ mode: "table" | "iterator" | null;
41
41
  rowsPerPage: -1 | 10 | 30;
42
+ showFilters: boolean;
42
43
  filters: { [key: string]: FSDataTableFilter[] };
43
44
  page: number;
44
45
  }
@@ -51,14 +51,17 @@ export class VariableNode extends DecoratorNode<Element> {
51
51
  content.classList.add("fs-rich-text-field-node-variable-value");
52
52
  if (_editor._rootElement) {
53
53
  content.textContent = this.getValue(_editor._rootElement);
54
- }
55
- else {
54
+
55
+ const observer = new MutationObserver(() => {
56
+ content.textContent = this.getValue(_editor._rootElement!);
57
+ });
58
+ observer.observe(_editor._rootElement, { attributes: true, attributeFilter: ['data-variable-values'] });
59
+ } else {
56
60
  content.textContent = this.__defaultValue;
57
61
  }
58
- }
59
- else {
62
+ } else {
60
63
  content.classList.add("fs-rich-text-field-node-variable-code");
61
- content.textContent = `{${this.__code}}`
64
+ content.textContent = `{${this.__code}}`;
62
65
  }
63
66
  container.appendChild(content);
64
67
  return container;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.65",
4
+ "version": "1.0.67-map-edit",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,11 +10,11 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.65",
14
- "@dative-gpi/foundation-shared-services": "1.0.65"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.67-map-edit",
14
+ "@dative-gpi/foundation-shared-services": "1.0.67-map-edit"
15
15
  },
16
16
  "peerDependencies": {
17
- "@dative-gpi/bones-ui": "^0.0.75",
17
+ "@dative-gpi/bones-ui": "^1.0.0",
18
18
  "@fontsource/montserrat": "^5.0.16",
19
19
  "@lexical/clipboard": "0.12.5",
20
20
  "@lexical/history": "0.12.5",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "942a36ea827fcf856d357a4ad826a6d4e3acf53c"
38
+ "gitHead": "725635256ebf2bb6450c38e5a3077fb907ea550c"
39
39
  }
@@ -30,3 +30,7 @@
30
30
  width: 100%;
31
31
  height: 100%;
32
32
  }
33
+
34
+ .fs-agenda-header-text {
35
+ text-transform: capitalize !important;
36
+ }
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  >.fs-card {
11
- border-left: solid 3px var(--fs-clickable-border-color) !important;
11
+ border-left: solid var(--fs-agenda-event-border-width) var(--fs-clickable-border-color) !important;
12
12
  }
13
13
  }
14
14
 
@@ -1,11 +1,3 @@
1
- .fs-agenda-hours-row {
2
- transform: translateX(calc(-2.4% + 2px));
3
- }
4
-
5
- .fs-agenda-hours-row-text {
6
- padding: 0 2px;
7
- }
8
-
9
1
  .fs-agenda-hours-row-marker {
10
2
  height: 4px;
11
3
  border-right: solid 1px var(--fs-agenda-hours-row-marker-color);
@@ -22,19 +22,6 @@
22
22
  }
23
23
  }
24
24
 
25
- .fs-autocomplete-field-label {
26
- color: var(--fs-autocomplete-field-color);
27
- }
28
-
29
- .fs-autocomplete-field-messages {
30
- align-self: stretch;
31
- color: var(--fs-autocomplete-field-error-color);
32
- }
33
-
34
- .fs-autocomplete-field-description {
35
- color: var(--fs-autocomplete-field-color);
36
- }
37
-
38
25
  .v-overlay-container > .v-overlay > .v-autocomplete__content {
39
26
  box-shadow: 0px 5px 8px 0px #00000029;
40
27
  max-width: none !important;
@@ -1,54 +1,36 @@
1
- .fs-breadcrumbs-label {
2
- cursor: pointer;
3
- user-select: none;
4
- color: var(--fs-breadcrumbs-color);
5
-
6
- &-disabled {
7
- color: var(--fs-breadcrumbs-disabled-color) !important;
8
- }
9
-
10
- &:hover {
11
- text-decoration: underline;
12
- }
13
-
14
- &:active {
15
- color: var(--fs-breadcrumbs-active-color) !important;
16
- }
17
- }
1
+ .fs-breadcrumbs {
2
+ height: var(--fs-breadcrumbs-height) !important;
3
+ padding: 0 !important;
4
+ gap: 0 !important;
18
5
 
19
- .fs-breadcrumbs-divider {
20
- margin-bottom: 2px !important;
6
+ max-width: 100%;
21
7
  }
22
8
 
23
- .v-breadcrumbs {
9
+ .v-breadcrumbs-item,
10
+ .v-breadcrumbs-item--link {
24
11
  padding: 0 !important;
25
- gap: 8px !important;
26
-
27
- @include web {
28
- height: 24px;
29
- }
12
+ user-select: none;
13
+ cursor: pointer;
30
14
 
31
- @include mobile {
32
- height: 20px;
33
- }
34
- }
15
+ align-self: stretch;
16
+ display: flex;
17
+ flex: 1 0 0;
35
18
 
36
- .v-breadcrumbs-item {
37
- padding: 0 !important;
19
+ max-width: fit-content;
20
+ min-width: 20px;
38
21
 
39
22
  &--disabled {
40
23
  opacity: 1 !important;
41
24
  color: var(--fs-breadcrumbs-disabled-color) !important;
42
25
  }
26
+ }
43
27
 
44
- &:last-child > .fs-breadcrumbs-label-disabled {
45
- @extend .text-button;
28
+ .v-breadcrumbs-item:last-child > .fs-breadcrumbs-label {
29
+ @extend .text-button;
46
30
 
47
- color: var(--fs-breadcrumbs-active-color) !important;
48
- }
31
+ color: var(--fs-breadcrumbs-active-color) !important;
49
32
  }
50
33
 
51
34
  .v-breadcrumbs-divider {
52
- padding: 0 !important;
53
35
  color: var(--fs-breadcrumbs-color) !important;
54
36
  }
@@ -2,11 +2,6 @@
2
2
  transition: color 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
3
3
  color: var(--fs-button-color) !important;
4
4
 
5
- &:not(.fs-button-disabled, :has(.fs-button-load)):hover {
6
- color: var(--fs-button-hover-color) !important;
7
- cursor: pointer !important;
8
- }
9
-
10
5
  &.fs-button-disabled,
11
6
  &:has(.fs-button-load) {
12
7
  cursor: default !important;
@@ -16,4 +11,11 @@
16
11
  color: inherit;
17
12
  text-decoration: none;
18
13
  }
14
+
15
+ @include clickscreen {
16
+ &:not(.fs-button-disabled, :has(.fs-button-load)):hover {
17
+ color: var(--fs-button-hover-color) !important;
18
+ cursor: pointer !important;
19
+ }
20
+ }
19
21
  }
@@ -32,6 +32,7 @@
32
32
  border: 1px solid var(--fs-calendar-border-color) !important;
33
33
  border-radius: 4px !important;
34
34
  padding: 8px !important;
35
+ min-height: 380px;
35
36
  }
36
37
 
37
38
  .fs-calendar-header {
@@ -4,6 +4,8 @@
4
4
  padding: var(--fs-card-padding);
5
5
  height: var(--fs-card-height);
6
6
  width: var(--fs-card-width);
7
+ max-width: var(--fs-card-max-width);
8
+ position: relative;
7
9
  display: flex;
8
10
 
9
11
  border-color: var(--fs-card-border-color);
@@ -21,4 +23,11 @@
21
23
  &-gradient {
22
24
  background: var(--fs-card-background-color);
23
25
  }
26
+
27
+ .fs-card-top-right {
28
+ position: absolute;
29
+ line-height: normal;
30
+ right: var(--fs-card-top-right-padding);
31
+ top: var(--fs-card-top-right-padding);
32
+ }
24
33
  }