@dative-gpi/foundation-shared-components 1.0.6 → 1.0.9

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 (88) hide show
  1. package/components/FSAccordionPanel.vue +8 -10
  2. package/components/FSBadge.vue +2 -4
  3. package/components/FSBreadcrumbs.vue +6 -6
  4. package/components/FSButton.vue +4 -4
  5. package/components/FSCalendar.vue +33 -31
  6. package/components/FSCalendarTwin.vue +75 -82
  7. package/components/FSCard.vue +7 -7
  8. package/components/FSCardPlaceholder.vue +1 -2
  9. package/components/FSCheckbox.vue +4 -6
  10. package/components/FSChip.vue +9 -11
  11. package/components/FSClickable.vue +44 -48
  12. package/components/FSClock.vue +2 -2
  13. package/components/FSCol.vue +2 -3
  14. package/components/FSColorIcon.vue +2 -4
  15. package/components/FSDialog.vue +1 -2
  16. package/components/FSDialogMenu.vue +2 -4
  17. package/components/FSDialogSubmit.vue +2 -4
  18. package/components/FSDivider.vue +6 -8
  19. package/components/FSEditImage.vue +6 -8
  20. package/components/FSErrorToast.vue +3 -4
  21. package/components/FSFadeOut.vue +9 -11
  22. package/components/FSGrid.vue +5 -9
  23. package/components/FSGridMosaic.vue +1 -2
  24. package/components/FSIcon.vue +5 -7
  25. package/components/FSIconCard.vue +20 -25
  26. package/components/FSIconCheck.vue +1 -2
  27. package/components/FSImage.vue +9 -10
  28. package/components/FSImageCard.vue +2 -2
  29. package/components/FSLabel.vue +17 -19
  30. package/components/FSLink.vue +18 -20
  31. package/components/FSLoader.vue +8 -11
  32. package/components/FSOptionGroup.vue +7 -9
  33. package/components/FSPagination.vue +3 -5
  34. package/components/FSRadio.vue +4 -6
  35. package/components/FSRadioGroup.vue +2 -4
  36. package/components/FSRow.vue +3 -4
  37. package/components/FSSlideGroup.vue +2 -3
  38. package/components/FSSlider.vue +8 -10
  39. package/components/FSSpan.vue +5 -8
  40. package/components/FSSwitch.vue +7 -9
  41. package/components/FSTab.vue +2 -4
  42. package/components/FSTabs.vue +9 -9
  43. package/components/FSTag.vue +9 -11
  44. package/components/FSTagGroup.vue +2 -4
  45. package/components/FSText.vue +7 -11
  46. package/components/FSWindow.vue +2 -2
  47. package/components/FSWrapGroup.vue +2 -3
  48. package/components/deviceOrganisations/FSConnectivityCard.vue +1 -2
  49. package/components/deviceOrganisations/FSStatusCard.vue +1 -2
  50. package/components/deviceOrganisations/FSStatusesRow.vue +1 -2
  51. package/components/deviceOrganisations/FSWorstAlert.vue +1 -2
  52. package/components/deviceOrganisations/FSWorstAlertCard.vue +1 -2
  53. package/components/fields/FSAutocompleteField.vue +2 -3
  54. package/components/fields/FSBaseField.vue +13 -10
  55. package/components/fields/FSColorField.vue +16 -16
  56. package/components/fields/FSDateTimeField.vue +2 -2
  57. package/components/fields/FSDateTimeRangeField.vue +4 -4
  58. package/components/fields/FSIconField.vue +2 -3
  59. package/components/fields/FSMagicConfigField.vue +1 -2
  60. package/components/fields/FSMagicField.vue +1 -2
  61. package/components/fields/FSNumberField.vue +1 -2
  62. package/components/fields/FSPasswordField.vue +2 -3
  63. package/components/fields/FSRichTextField.vue +3 -4
  64. package/components/fields/FSSearchField.vue +1 -2
  65. package/components/fields/FSSelectField.vue +2 -3
  66. package/components/fields/FSTagField.vue +3 -5
  67. package/components/fields/FSTermField.vue +6 -5
  68. package/components/fields/FSTextArea.vue +2 -3
  69. package/components/fields/FSTextField.vue +2 -3
  70. package/components/fields/FSTimeField.vue +1 -1
  71. package/components/fields/FSTimeSlotField.vue +2 -3
  72. package/components/fields/FSTranslateField.vue +2 -2
  73. package/components/fields/FSTreeViewField.vue +4 -6
  74. package/components/lists/FSDataIteratorItem.vue +8 -10
  75. package/components/lists/FSDataTableUI.vue +7 -11
  76. package/components/lists/FSFilterButton.vue +1 -2
  77. package/components/lists/FSLoadDataTable.vue +4 -6
  78. package/components/map/FSMap.vue +11 -14
  79. package/components/map/FSMapOverlay.vue +10 -10
  80. package/components/selects/FSSelectDateSetting.vue +1 -2
  81. package/components/tiles/FSLoadTile.vue +5 -7
  82. package/components/views/FSEntityHeader.vue +4 -4
  83. package/components/views/FSListHeader.vue +83 -0
  84. package/components/views/FSListView.vue +83 -0
  85. package/models/rules.ts +1 -1
  86. package/package.json +4 -4
  87. package/utils/badge.ts +9 -0
  88. package/utils/index.ts +1 -0
@@ -60,7 +60,7 @@
60
60
  </template>
61
61
 
62
62
  <script lang="ts">
63
- import { computed, defineComponent } from "vue";
63
+ import { computed, defineComponent, type StyleValue } from "vue";
64
64
 
65
65
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
66
66
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -81,11 +81,9 @@ export default defineComponent({
81
81
 
82
82
  const backgroundColors = getColors(ColorEnum.Background);
83
83
 
84
- const style = computed((): { [key: string] : string | null | undefined } => {
85
- return {
86
- "--fs-load-data-table-background-color": backgroundColors.base
87
- };
88
- });
84
+ const style = computed((): StyleValue => ({
85
+ "--fs-load-data-table-background-color": backgroundColors.base
86
+ }));
89
87
 
90
88
  return {
91
89
  style
@@ -129,17 +129,16 @@
129
129
  </template>
130
130
 
131
131
  <script lang="ts">
132
- import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, watch } from "vue";
133
-
134
- import * as L from "leaflet";
132
+ import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, type StyleValue, watch } from "vue";
135
133
  import "leaflet.markercluster";
134
+ import * as L from "leaflet";
136
135
 
137
136
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
138
137
  import { type Address, type FSArea } from '@dative-gpi/foundation-shared-domain/models';
139
138
 
140
139
  import { clusterMarkerHtml, locationMarkerHtml, myLocationMarkerHtml } from "../../utils";
141
- import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
142
140
  import { useColors, useAddress, useBreakpoints } from "../../composables";
141
+ import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
143
142
 
144
143
  import FSMapEditPointAddressOverlay from "./FSMapEditPointAddressOverlay.vue";
145
144
  import FSMapLayerButton from "./FSMapLayerButton.vue";
@@ -309,16 +308,14 @@ export default defineComponent({
309
308
  return margin;
310
309
  });
311
310
 
312
- const style = computed((): { [key: string]: string | undefined } => {
313
- return {
314
- "--fs-map-location-pin-color": getColors(ColorEnum.Primary).base,
315
- "--fs-map-mylocation-pin-color": getColors(ColorEnum.Primary).base,
316
- "--fs-map-mylocation-pin-color-alpha": getColors(ColorEnum.Primary).base + "50",
317
- "--fs-map-leaflet-container-height": props.height as string,
318
- "--fs-map-leaflet-bottom-overlay-margin": `${bottomMargin.value}px`,
319
- "--fs-map-container-grayscale": props.grayscale ? '0.9' : '0'
320
- };
321
- });
311
+ const style = computed((): StyleValue => ({
312
+ "--fs-map-location-pin-color": getColors(ColorEnum.Primary).base,
313
+ "--fs-map-mylocation-pin-color": getColors(ColorEnum.Primary).base,
314
+ "--fs-map-mylocation-pin-color-alpha": getColors(ColorEnum.Primary).base + "50",
315
+ "--fs-map-leaflet-container-height": props.height as string,
316
+ "--fs-map-leaflet-bottom-overlay-margin": `${bottomMargin.value}px`,
317
+ "--fs-map-container-grayscale": props.grayscale ? '0.9' : '0'
318
+ }));
322
319
 
323
320
  const displayLocations = () => {
324
321
  markerLayerGroup.clearLayers();
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <FSCol
3
3
  v-show="isExtraSmall"
4
- :id="`left-overlay-mobile-${$props.mapId}`"
5
- :height="$props.mode === 'expand' ? '100%' : ($props.mode === 'half' ? '50%' : 'hug')"
6
- :style="style"
7
4
  class="fs-map-overlay-left-mobile"
8
5
  ref="mobileOverlayElement"
9
6
  align="bottom-center"
10
7
  width="hug"
11
8
  gap="2px"
9
+ :height="$props.mode === 'expand' ? '100%' : ($props.mode === 'half' ? '50%' : 'hug')"
10
+ :id="`left-overlay-mobile-${$props.mapId}`"
11
+ :style="style"
12
12
  @click="$event.target === mobileOverlayElement?.$el ? $emit('update:mode', 'collapse') : null"
13
13
  >
14
14
  <FSCard
@@ -17,16 +17,16 @@
17
17
  :border="false"
18
18
  >
19
19
  <FSCol
20
- gap="0px"
21
20
  height="fill"
21
+ gap="0px"
22
22
  >
23
23
  <FSRow
24
24
  align="center-center"
25
25
  @touchstart="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
26
26
  >
27
27
  <FSButton
28
- :icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
29
28
  variant="icon"
29
+ :icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
30
30
  @click="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
31
31
  />
32
32
  </FSRow>
@@ -38,8 +38,8 @@
38
38
  name="leftoverlay-header"
39
39
  />
40
40
  <FSFadeOut
41
- :height="$props.mode === 'collapse' ? '0px' : '100%'"
42
41
  maskHeight="0px"
42
+ :height="$props.mode === 'collapse' ? '0px' : '100%'"
43
43
  >
44
44
  <slot
45
45
  name="leftoverlay-body"
@@ -51,11 +51,11 @@
51
51
  </FSCol>
52
52
  <FSCol
53
53
  v-show="!isExtraSmall"
54
- :style="style"
55
- :id="`left-overlay-${$props.mapId}`"
56
54
  class="fs-map-overlay-left"
57
55
  width="hug"
58
56
  gap="2px"
57
+ :id="`left-overlay-${$props.mapId}`"
58
+ :style="style"
59
59
  >
60
60
  <FSCard
61
61
  padding="4px"
@@ -82,7 +82,7 @@
82
82
  </template>
83
83
 
84
84
  <script lang="ts">
85
- import { computed, defineComponent, type PropType, ref } from "vue";
85
+ import { computed, defineComponent, type PropType, ref, type StyleValue } from "vue";
86
86
 
87
87
  import { useBreakpoints } from "../../composables";
88
88
 
@@ -124,7 +124,7 @@ export default defineComponent({
124
124
  const leftOverlayMenuMobile = ref(false);
125
125
  const mobileOverlayElement = ref(null);
126
126
 
127
- const style = computed((): { [key: string]: string | null | undefined } => {
127
+ const style = computed((): StyleValue => {
128
128
  if (props.mode === "expand") {
129
129
  return {
130
130
  "--fs-map-overlay-max-height": `calc(${props.height} - 40px)`,
@@ -9,8 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script lang="ts">
12
- import type { PropType } from "vue";
13
- import { computed, defineComponent } from "vue";
12
+ import { computed, defineComponent, type PropType } from "vue";
14
13
 
15
14
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
16
15
  import { DateSetting } from "@dative-gpi/foundation-shared-domain/models";
@@ -53,7 +53,7 @@
53
53
  </template>
54
54
 
55
55
  <script lang="ts">
56
- import { computed, defineComponent } from "vue";
56
+ import { computed, defineComponent, type StyleValue } from "vue";
57
57
 
58
58
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
59
59
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -92,6 +92,10 @@ export default defineComponent({
92
92
 
93
93
  const backgroundColors = getColors(ColorEnum.Background);
94
94
 
95
+ const style = computed((): StyleValue => ({
96
+ "--fs-load-tile-background-color": backgroundColors.base
97
+ }));
98
+
95
99
  const heights = computed(() => {
96
100
  return {
97
101
  image: isMobileSized.value ? "90px" : "100px",
@@ -108,12 +112,6 @@ export default defineComponent({
108
112
  }
109
113
  });
110
114
 
111
- const style = computed((): { [key: string] : string | null | undefined } => {
112
- return {
113
- "--fs-load-tile-background-color": backgroundColors.base
114
- };
115
- });
116
-
117
115
  return {
118
116
  heights,
119
117
  widths,
@@ -150,9 +150,9 @@
150
150
  />
151
151
  <FSIcon
152
152
  v-else-if="$props.icon"
153
+ :color="$props.color"
153
154
  :icon="$props.icon"
154
155
  :size="imageSize"
155
- :color="$props.color"
156
156
  />
157
157
  <FSCol
158
158
  align="center-left"
@@ -210,7 +210,7 @@
210
210
  <script lang="ts">
211
211
  import { computed, defineComponent, type PropType } from "vue";
212
212
 
213
- import { type ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
213
+ import { type ColorBase, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
214
214
  import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
215
215
 
216
216
  import FSBreadcrumbs from "../FSBreadcrumbs.vue";
@@ -245,8 +245,8 @@ export default defineComponent({
245
245
  required: false,
246
246
  default: null
247
247
  },
248
- color : {
249
- type: Object as PropType<ColorEnum | null>,
248
+ color: {
249
+ type: String as PropType<ColorBase>,
250
250
  required: false,
251
251
  default: null
252
252
  },
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <template
3
+ v-if="isExtraSmall"
4
+ >
5
+ <FSCol
6
+ gap="12px"
7
+ >
8
+ <FSText
9
+ font="text-h3"
10
+ >
11
+ {{ $props.title }}
12
+ </FSText>
13
+ <FSBreadcrumbs
14
+ :items="$props.breadcrumbs"
15
+ />
16
+ </FSCol>
17
+ </template>
18
+ <template
19
+ v-else
20
+ >
21
+ <FSCol
22
+ gap="16px"
23
+ >
24
+ <FSText
25
+ font="text-h2"
26
+ >
27
+ {{ $props.title }}
28
+ </FSText>
29
+ <FSBreadcrumbs
30
+ :items="$props.breadcrumbs"
31
+ />
32
+ <FSSlideGroup
33
+ v-if="$slots['toolbar']"
34
+ style="min-width: 100%;"
35
+ >
36
+ <slot
37
+ name="toolbar"
38
+ />
39
+ </FSSlideGroup>
40
+ </FSCol>
41
+ </template>
42
+ </template>
43
+
44
+ <script lang="ts">
45
+ import { defineComponent, type PropType } from "vue";
46
+
47
+ import { type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
48
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
49
+
50
+ import FSBreadcrumbs from "../FSBreadcrumbs.vue";
51
+ import FSSlideGroup from "../FSSlideGroup.vue";
52
+ import FSText from "../FSText.vue";
53
+ import FSCol from "../FSCol.vue";
54
+
55
+ export default defineComponent({
56
+ name: "FSListHeader",
57
+ components: {
58
+ FSBreadcrumbs,
59
+ FSSlideGroup,
60
+ FSText,
61
+ FSCol
62
+ },
63
+ props: {
64
+ title: {
65
+ type: String as PropType<string | null>,
66
+ required: false,
67
+ default: null
68
+ },
69
+ breadcrumbs: {
70
+ type: Array as PropType<Array<FSBreadcrumbItem>>,
71
+ required: false,
72
+ default: () => []
73
+ },
74
+ },
75
+ setup() {
76
+ const { isExtraSmall } = useBreakpoints();
77
+
78
+ return {
79
+ isExtraSmall
80
+ };
81
+ }
82
+ });
83
+ </script>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <FSSkeletonView>
3
+ <template
4
+ #header
5
+ >
6
+ <FSListHeader
7
+ ref="headerRef"
8
+ :breadcrumbs="$props.breadcrumbs"
9
+ :title="$props.title"
10
+ padding="0 14px 0 0"
11
+ >
12
+ <template
13
+ #toolbar
14
+ >
15
+ <slot
16
+ name="toolbar"
17
+ />
18
+ </template>
19
+ </FSListHeader>
20
+ </template>
21
+ <template
22
+ #default
23
+ >
24
+ <FSFadeOut
25
+ padding="0 8px 0 0"
26
+ :height="height"
27
+ >
28
+ <slot
29
+ name="default"
30
+ />
31
+ </FSFadeOut>
32
+ </template>
33
+ </FSSkeletonView>
34
+ </template>
35
+
36
+ <script lang="ts">
37
+ import { computed, defineComponent, type PropType, ref } from "vue";
38
+
39
+ import { type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
40
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
41
+
42
+ import FSSkeletonView from "./FSSkeletonView.vue";
43
+ import FSListHeader from "./FSListHeader.vue";
44
+ import FSFadeOut from "../FSFadeOut.vue";
45
+
46
+ export default defineComponent({
47
+ name: "FSListView",
48
+ components: {
49
+ FSSkeletonView,
50
+ FSListHeader,
51
+ FSFadeOut
52
+ },
53
+ props: {
54
+ title: {
55
+ type: String as PropType<string | null>,
56
+ required: false,
57
+ default: null
58
+ },
59
+ breadcrumbs: {
60
+ type: Array as PropType<FSBreadcrumbItem[]>,
61
+ required: false,
62
+ default: () => []
63
+ }
64
+ },
65
+ setup() {
66
+ const { isExtraSmall, windowHeight } = useBreakpoints();
67
+
68
+ const headerRef = ref<HTMLElement | null>(null);
69
+
70
+ const height = computed((): string => {
71
+ let other = isExtraSmall.value ? 16 + 16 : 24 + 24 // Paddings
72
+ + (headerRef.value?.clientHeight ?? 0); // Header
73
+
74
+ return `${windowHeight.value - other}px`;
75
+ });
76
+
77
+ return {
78
+ headerRef,
79
+ height
80
+ };
81
+ }
82
+ });
83
+ </script>
package/models/rules.ts CHANGED
@@ -44,7 +44,7 @@ export const DateRules = {
44
44
  required: (message: string | undefined = undefined) => (value: string) => !!value || (message ?? $tr("ui.rules.required", "Required")),
45
45
  min: (min: number, message: string | undefined = undefined) => (value: number) => (!value || value >= min) || (message ?? $tr("ui.rules.date-min", "Must be after {0}", epochToLongDateFormat(min))),
46
46
  max: (max: number, message: string | undefined = undefined) => (value: number) => (!value || value <= max) || (message ?? $tr("ui.rules.date-max", "Must be before {0}", epochToLongDateFormat(max))),
47
- validateExpression: (variant: "default" | "before-after") => (value: string) => validateExpression(value, variant)
47
+ validateExpression: (variant: "default" | "before-after" | undefined = "default") => (value: string) => validateExpression(value, variant)
48
48
  };
49
49
 
50
50
  export const SelectRules = {
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.6",
4
+ "version": "1.0.9",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.6",
14
- "@dative-gpi/foundation-shared-services": "1.0.6"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.9",
14
+ "@dative-gpi/foundation-shared-services": "1.0.9"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "b2bbdea22792b7454a5234d8a6b8bb43553f3202"
38
+ "gitHead": "018a67489fc022344c90d45b02bfabdcd0dcefec"
39
39
  }
package/utils/badge.ts ADDED
@@ -0,0 +1,9 @@
1
+ export const getBadgeFromNumber = (value: number, parenthesis: boolean = false): string => {
2
+ if (value < 1) {
3
+ return "";
4
+ }
5
+ if (value > 99) {
6
+ return `${parenthesis ? '(' : ''}99+${parenthesis ? ')' : ''}`;
7
+ }
8
+ return `${parenthesis ? '(' : ''}${value.toString()}${parenthesis ? ')' : ''}`;
9
+ }
package/utils/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./badge";
1
2
  export * from "./color";
2
3
  export * from "./css";
3
4
  export * from "./error";