@dative-gpi/foundation-shared-components 1.0.62 → 1.0.63

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.
@@ -11,7 +11,7 @@
11
11
  >
12
12
  <FSIcon
13
13
  :color="$props.color"
14
- :size="$props.size"
14
+ :size="iconSize"
15
15
  >
16
16
  <slot />
17
17
  </FSIcon>
@@ -25,6 +25,8 @@ import { computed, defineComponent, type PropType } from "vue";
25
25
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
26
26
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
27
27
 
28
+ import { sizeToVar } from "../utils";
29
+
28
30
  import FSColor from "./FSColor.vue";
29
31
  import FSIcon from "./FSIcon.vue";
30
32
  import FSRow from "./FSRow.vue";
@@ -46,6 +48,11 @@ export default defineComponent({
46
48
  type: String as PropType<ColorBase>,
47
49
  required: false,
48
50
  default: ColorEnum.Dark
51
+ },
52
+ padding: {
53
+ type: [String, Number] as PropType<string | number>,
54
+ required: false,
55
+ default: "0px"
49
56
  }
50
57
  },
51
58
  setup(props) {
@@ -60,7 +67,15 @@ export default defineComponent({
60
67
  }
61
68
  });
62
69
 
70
+ const iconSize = computed(() => {
71
+ if (!props.padding) {
72
+ return size.value;
73
+ }
74
+ return `calc(${sizeToVar(size.value)} - ${sizeToVar(props.padding)})`;
75
+ });
76
+
63
77
  return {
78
+ iconSize,
64
79
  size
65
80
  };
66
81
  }
@@ -1,10 +1,58 @@
1
1
  <template>
2
- <FSCol
2
+ <FSRow
3
3
  width="hug"
4
+ align="top-left"
5
+ gap="16px"
6
+ padding="8px 0px"
7
+ :wrap="false"
4
8
  >
9
+ <v-switch
10
+ v-if="variant == 'left'"
11
+ class="fs-switch"
12
+ hide-details
13
+ inset
14
+ :validateOn="validateOn"
15
+ :rules="$props.rules"
16
+ :ripple="false"
17
+ :style="style"
18
+ :modelValue="$props.modelValue"
19
+ @update:modelValue="onToggle"
20
+ v-bind="$attrs"
21
+ />
22
+ <slot>
23
+ <FSCol
24
+ width="hug"
25
+ v-if="$props.label || $props.description || $slots.description"
26
+ >
27
+ <FSSpan
28
+ v-if="$props.label"
29
+ class="fs-switch-label"
30
+ :style="style"
31
+ :font="font"
32
+ @click.stop="onToggle"
33
+ >
34
+ {{ $props.label }}
35
+ </FSSpan>
36
+ <slot
37
+ name="description"
38
+ >
39
+ <FSSpan
40
+ v-if="$props.description"
41
+ class="fs-switch-description"
42
+ font="text-overline"
43
+ :style="style"
44
+ >
45
+ {{ $props.description }}
46
+ </FSSpan>
47
+ </slot>
48
+ <slot
49
+ name="footer"
50
+ />
51
+ </FSCol>
52
+ </slot>
5
53
  <FSRow
6
- width="hug"
7
- align="center-left"
54
+ v-if="variant == 'right'"
55
+ align="center-right"
8
56
  >
9
57
  <v-switch
10
58
  class="fs-switch"
@@ -18,31 +66,8 @@
18
66
  @update:modelValue="onToggle"
19
67
  v-bind="$attrs"
20
68
  />
21
- <slot>
22
- <FSSpan
23
- v-if="$props.label"
24
- class="fs-switch-label"
25
- :style="style"
26
- :font="font"
27
- @click.stop="onToggle"
28
- >
29
- {{ $props.label }}
30
- </FSSpan>
31
- </slot>
32
69
  </FSRow>
33
- <slot
34
- name="description"
35
- >
36
- <FSSpan
37
- v-if="$props.description"
38
- class="fs-switch-description"
39
- font="text-overline"
40
- :style="style"
41
- >
42
- {{ $props.description }}
43
- </FSSpan>
44
- </slot>
45
- </FSCol>
70
+ </FSRow>
46
71
  </template>
47
72
 
48
73
  <script lang="ts">
@@ -78,6 +103,11 @@ export default defineComponent({
78
103
  required: false,
79
104
  default: false
80
105
  },
106
+ variant: {
107
+ type: String as PropType<"left" | "right">,
108
+ required: false,
109
+ default: "left"
110
+ },
81
111
  color: {
82
112
  type: String as PropType<ColorBase>,
83
113
  required: false,
@@ -9,7 +9,8 @@
9
9
  >
10
10
  <FSColorIcon
11
11
  class="fs-stopclick"
12
- size="m"
12
+ :size="$props.size"
13
+ :padding="$props.padding"
13
14
  :color="$props.deviceConnectivity.color"
14
15
  @click.prevent.stop
15
16
  v-bind="props"
@@ -43,6 +44,14 @@ export default defineComponent({
43
44
  deviceConnectivity: {
44
45
  type: Object as PropType<FSDeviceConnectivity>,
45
46
  required: true
47
+ },
48
+ size: {
49
+ type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
50
+ default: "m"
51
+ },
52
+ padding: {
53
+ type: [String, Number] as PropType<string | number>,
54
+ default: "8px"
46
55
  }
47
56
  },
48
57
  setup() {
@@ -11,6 +11,7 @@
11
11
  class="fs-stopclick"
12
12
  :size="$props.size"
13
13
  :color="$props.statusGroup.color"
14
+ :padding="$props.padding"
14
15
  @click.prevent.stop
15
16
  v-bind="props"
16
17
  >
@@ -52,6 +53,10 @@ export default defineComponent({
52
53
  size: {
53
54
  type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
54
55
  default: "m"
56
+ },
57
+ padding: {
58
+ type: [String, Number] as PropType<string | number>,
59
+ default: "8px"
55
60
  }
56
61
  },
57
62
  setup() {
@@ -68,7 +68,11 @@
68
68
  v-else-if="item.icon"
69
69
  :icon="item.icon"
70
70
  />
71
- <FSSpan>{{ item[itemLabel] }}</FSSpan>
71
+ <FSSpan
72
+ font="text-overline"
73
+ >
74
+ {{ item[itemLabel] }}
75
+ </FSSpan>
72
76
  </slot>
73
77
  <FSRow
74
78
  align="center-right"
@@ -47,8 +47,8 @@
47
47
  v-for="location in $props.locations"
48
48
  :selected="location.id === $props.selectedLocationId"
49
49
  :key="location.id"
50
- :color="location.color"
51
- :icon="location.icon"
50
+ :color="location.color ?? ColorEnum.Primary"
51
+ :icon="location.icon ?? 'mdi-map-marker'"
52
52
  :latlng="{lat: location.address.latitude, lng: location.address.longitude}"
53
53
  @click="$emit('update:selectedLocationId', location.id)"
54
54
  />
package/models/map.ts CHANGED
@@ -12,7 +12,7 @@ export interface MapLayer {
12
12
  export interface FSLocation {
13
13
  id: string;
14
14
  label: string;
15
- icon: string;
15
+ icon: string | null;
16
16
  address: Address;
17
- color: string;
17
+ color: string | null;
18
18
  }
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.62",
4
+ "version": "1.0.63",
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.62",
14
- "@dative-gpi/foundation-shared-services": "1.0.62"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.63",
14
+ "@dative-gpi/foundation-shared-services": "1.0.63"
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": "aebca5afe970e1d7117b5515abba742a6c96fa3a"
38
+ "gitHead": "b2fbfec30ab5c2f3edeaddbc7eed0d3c98fe71c4"
39
39
  }
@@ -1,10 +1,5 @@
1
1
  .fs-filter-button-menu {
2
- @include web {
3
- min-width: 200px !important;
4
- }
5
- @include mobile {
6
- min-width: 180px !important;
7
- }
2
+ min-width: 300px !important;
8
3
  }
9
4
 
10
5
  .fs-filter-button-chip {
@@ -31,6 +31,7 @@
31
31
  .fs-switch-label {
32
32
  cursor: var(--fs-switch-cursor) !important;
33
33
  color: var(--fs-switch-color) !important;
34
+ padding-top: 2px;
34
35
  user-select: none;
35
36
  }
36
37
 
@@ -1,16 +1,17 @@
1
1
  .fs-tabs {
2
2
  display: flex !important;
3
3
  width: 100% !important;
4
- flex-shrink: 0;
5
4
 
6
5
  @include web {
7
6
  height: 48px !important;
8
7
  max-height: 48px;
8
+ min-height: 48px;
9
9
  }
10
10
 
11
11
  @include mobile {
12
12
  height: 40px !important;
13
13
  max-height: 40px;
14
+ min-height: 40px;
14
15
  }
15
16
  }
16
17
 
@@ -34,11 +35,13 @@
34
35
  @include web {
35
36
  height: 48px !important;
36
37
  max-height: 48px;
38
+ min-height: 48px;
37
39
  }
38
40
 
39
41
  @include mobile {
40
42
  height: 40px !important;
41
43
  max-height: 40px;
44
+ min-height: 40px;
42
45
  }
43
46
  }
44
47