@dative-gpi/foundation-shared-components 0.0.21 → 0.0.23

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.
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSClickable
3
3
  v-if="!['icon'].includes($props.variant)"
4
+ :fullWidth="$props.fullWidth"
4
5
  :editable="$props.editable"
5
6
  :height="['40px', '36px']"
6
7
  :variant="$props.variant"
@@ -13,6 +13,7 @@
13
13
  </FSCard>
14
14
  <a
15
15
  v-else
16
+ :class="anchorClasses"
16
17
  :href="href"
17
18
  >
18
19
  <FSCard
@@ -69,6 +70,11 @@ export default defineComponent({
69
70
  required: false,
70
71
  default: ColorEnum.Primary
71
72
  },
73
+ fullWidth: {
74
+ type: Boolean,
75
+ required: false,
76
+ default: false
77
+ },
72
78
  editable: {
73
79
  type: Boolean,
74
80
  required: false,
@@ -132,6 +138,14 @@ export default defineComponent({
132
138
  return classNames;
133
139
  });
134
140
 
141
+ const anchorClasses = computed((): string[] => {
142
+ const classNames: string[] = [];
143
+ if (!props.fullWidth) {
144
+ classNames.push("fs-clickable-anchor-full-width");
145
+ }
146
+ return classNames;
147
+ });
148
+
135
149
  const href = computed((): string | null => {
136
150
  if (!props.to) {
137
151
  return null;
@@ -151,6 +165,7 @@ export default defineComponent({
151
165
  };
152
166
 
153
167
  return {
168
+ anchorClasses,
154
169
  classes,
155
170
  style,
156
171
  href,
@@ -1,15 +1,12 @@
1
1
  <template>
2
- <FSRow
3
- class="fs-color"
4
- :width="$props.width"
5
- :height="$props.height"
6
- :align="$props.align"
7
- :wrap="$props.wrap"
8
- :gap="$props.gap"
2
+ <FSCard
3
+ :border="$props.border"
4
+ :class="classes"
9
5
  :style="style"
6
+ v-bind="$attrs"
10
7
  >
11
8
  <slot v-bind="{ color: $props.color, colors }" />
12
- </FSRow>
9
+ </FSCard>
13
10
  </template>
14
11
 
15
12
  <script lang="ts">
@@ -18,39 +15,19 @@ import { computed, defineComponent, PropType, ref, Ref } from "vue";
18
15
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
19
16
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
20
17
 
21
- import FSRow from "./FSRow.vue";
18
+ import FSCard from "./FSCard.vue";
22
19
 
23
20
  export default defineComponent({
24
21
  name: "FSColor",
25
22
  components: {
26
- FSRow
23
+ FSCard
27
24
  },
28
25
  props: {
29
- width: {
30
- type: String as PropType<"hug" | "fill" | string>,
31
- required: false,
32
- default: "hug"
33
- },
34
- height: {
35
- type: String as PropType<"hug" | "fill" | string>,
36
- required: false,
37
- default: "hug"
38
- },
39
- align: {
40
- type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
41
- required: false,
42
- default: "center-left"
43
- },
44
- wrap: {
26
+ border: {
45
27
  type: Boolean,
46
28
  required: false,
47
29
  default: true
48
30
  },
49
- gap: {
50
- type: [String, Number],
51
- required: false,
52
- default: "8px"
53
- },
54
31
  color: {
55
32
  type: String as PropType<ColorBase>,
56
33
  required: false,
@@ -64,13 +41,23 @@ export default defineComponent({
64
41
 
65
42
  const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
66
43
  "--fs-color-background-color": colors.value.light,
44
+ "--fs-color-border-color" : colors.value.base,
67
45
  "--fs-color-color" : colors.value.base,
68
46
  "--fs-color-light" : colors.value.light,
69
47
  "--fs-color-base" : colors.value.base,
70
48
  "--fs-color-dark" : colors.value.dark
71
49
  });
72
50
 
51
+ const classes = computed((): string[] => {
52
+ const classNames = ["fs-color"];
53
+ if (props.border) {
54
+ classNames.push("fs-color-border");
55
+ }
56
+ return classNames;
57
+ });
58
+
73
59
  return {
60
+ classes,
74
61
  colors,
75
62
  style
76
63
  };
@@ -20,7 +20,7 @@ export default defineComponent({
20
20
  padding: {
21
21
  type: [String, Number],
22
22
  required: false,
23
- default: 8
23
+ default: "8px"
24
24
  },
25
25
  border: {
26
26
  type: Boolean,
@@ -11,9 +11,9 @@
11
11
  <template #placeholder>
12
12
  <FSLoader
13
13
  class="fs-load-image"
14
+ height="100%"
15
+ width="100%"
14
16
  :borderRadius="$props.borderRadius"
15
- :height="computedHeight"
16
- :width="computedWidth"
17
17
  />
18
18
  </template>
19
19
  </v-img>
@@ -5,7 +5,9 @@
5
5
  :style="style"
6
6
  v-bind="$attrs"
7
7
  >
8
- {{ $props.label }}
8
+ <slot>
9
+ {{ $props.label }}
10
+ </slot>
9
11
  </span>
10
12
  <FSLoader
11
13
  v-else
@@ -16,7 +18,7 @@
16
18
  <script lang="ts">
17
19
  import { computed, defineComponent, PropType } from "vue";
18
20
 
19
- import { useBreakpoints, useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
21
+ import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
20
22
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
21
23
 
22
24
  import FSLoader from "./FSLoader.vue";
@@ -59,7 +61,6 @@ export default defineComponent({
59
61
  }
60
62
  },
61
63
  setup(props) {
62
- const { isMobileSized } = useBreakpoints();
63
64
  const { getColors } = useColors();
64
65
  const { slots } = useSlots();
65
66
 
@@ -5,7 +5,9 @@
5
5
  :href="href"
6
6
  v-bind="$attrs"
7
7
  >
8
- <slot />
8
+ <slot>
9
+ {{ $props.label }}
10
+ </slot>
9
11
  </a>
10
12
  </template>
11
13
 
@@ -19,10 +21,15 @@ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/m
19
21
  export default defineComponent({
20
22
  name: "FSLink",
21
23
  props: {
24
+ label: {
25
+ type: [String, null, undefined],
26
+ required: false,
27
+ default: null
28
+ },
22
29
  to: {
23
- type: [String, Object] as PropType<string | RouteLocation>,
24
- required: false,
25
- default: "_blank"
30
+ type: [String, Object] as PropType<string | RouteLocation>,
31
+ required: false,
32
+ default: "_blank"
26
33
  },
27
34
  font: {
28
35
  type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
@@ -31,13 +31,13 @@ export default defineComponent({
31
31
  default: "4px"
32
32
  },
33
33
  variant: {
34
- type: String as PropType<"standard" | "button" | "input" | "chip" | "text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
34
+ type: String as PropType<"standard" | "button" | "input" | "field" | "chip" | "text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
35
35
  required: false,
36
36
  default: "standard"
37
37
  }
38
38
  },
39
39
  setup(props) {
40
- const { isMobileSized, isExtraSmall } = useBreakpoints();
40
+ const { isMobileSized } = useBreakpoints();
41
41
 
42
42
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
43
43
  return {
@@ -51,16 +51,17 @@ export default defineComponent({
51
51
  switch (props.variant) {
52
52
  case "standard": return sizeToVar(props.height);
53
53
  case "button":
54
- case "input": return isMobileSized.value ? "36px" : "40px";
54
+ case "input":
55
+ case "field": return isMobileSized.value ? "36px" : "40px";
55
56
  case "chip": return isMobileSized.value ? "20px" : "24px";
56
- case "text-h1": return isMobileSized.value ? "29px" : "36px";
57
- case "text-h2": return isMobileSized.value ? "22px" : "27px";
58
- case "text-h3": return isMobileSized.value ? "17px" : "21px";
59
- case "text-h4": return isMobileSized.value ? "14px" : "16px";
57
+ case "text-h1": return isMobileSized.value ? "32px" : "40px";
58
+ case "text-h2": return isMobileSized.value ? "24px" : "32px";
59
+ case "text-h3": return isMobileSized.value ? "20px" : "24px";
60
+ case "text-h4": return isMobileSized.value ? "16px" : "20px";
60
61
  case "text-body":
61
- case "text-button": return isMobileSized.value ? "12px" : "14px";
62
+ case "text-button": return isMobileSized.value ? "14px" : "16px";
62
63
  case "text-overline":
63
- case "text-underline": return isMobileSized.value ? "10px" : "12px";
64
+ case "text-underline": return "16px";
64
65
  }
65
66
  });
66
67
 
@@ -69,6 +70,7 @@ export default defineComponent({
69
70
  case "standard": return sizeToVar(props.width);
70
71
  case "button": return isMobileSized ? "36px" : "40px";
71
72
  case "input": return isMobileSized ? "calc(50% - 124px)" : "calc(50% - 132px)";
73
+ case "field": return "100%";
72
74
  case "chip": return "8vw";
73
75
  case "text-h1": return "calc(50% - 32px)";
74
76
  case "text-h2": return "calc(60% - 32px)";
@@ -4,7 +4,9 @@
4
4
  :style="style"
5
5
  v-bind="$attrs"
6
6
  >
7
- <slot />
7
+ <slot>
8
+ {{ $props.label }}
9
+ </slot>
8
10
  </span>
9
11
  </template>
10
12
 
@@ -16,6 +18,11 @@ import { useSlots } from "@dative-gpi/foundation-shared-components/composables";
16
18
  export default defineComponent({
17
19
  name: "FSSpan",
18
20
  props: {
21
+ label: {
22
+ type: [String, null, undefined],
23
+ required: false,
24
+ default: null
25
+ },
19
26
  font: {
20
27
  type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
21
28
  required: false,
@@ -4,7 +4,9 @@
4
4
  :style="style"
5
5
  v-bind="$attrs"
6
6
  >
7
- <slot />
7
+ <slot>
8
+ {{ $props.label }}
9
+ </slot>
8
10
  </span>
9
11
  </template>
10
12
 
@@ -17,6 +19,11 @@ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/m
17
19
  export default defineComponent({
18
20
  name: "FSText",
19
21
  props: {
22
+ label: {
23
+ type: [String, null, undefined],
24
+ required: false,
25
+ default: null
26
+ },
20
27
  font: {
21
28
  type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
22
29
  required: false,
@@ -23,7 +23,6 @@
23
23
  <template #prepend-inner>
24
24
  <slot name="prepend-inner">
25
25
  <FSIcon
26
- size="xl"
27
26
  :color="innerColor"
28
27
  >
29
28
  mdi-circle
@@ -51,12 +50,12 @@
51
50
  <template #prepend-inner>
52
51
  <slot name="prepend-inner">
53
52
  <FSIcon
54
- icon="mdi-circle"
55
- size="xl"
56
53
  :color="ColorEnum.Dark"
57
54
  :editable="$props.editable"
58
55
  :style="{ opacity: getPercentageFromHex(innerOpacity) }"
59
- />
56
+ >
57
+ mdi-circle
58
+ </FSIcon>
60
59
  </slot>
61
60
  </template>
62
61
  <template #append>
@@ -49,7 +49,7 @@
49
49
  />
50
50
  </template>
51
51
  <FSHiddenButton
52
- v-if="hiddenHeaders.length > 0"
52
+ v-if="innerMode === 'table' && hiddenHeaders.length > 0"
53
53
  :headers="hiddenHeaders"
54
54
  :color="$props.color"
55
55
  @update:show="(value) => updateHeader(value, 'hidden', false)"
@@ -359,7 +359,7 @@
359
359
  </template>
360
360
  </v-data-iterator>
361
361
  </template>
362
- <template v-else-if="innerMode === 'iterator'">
362
+ <template v-else>
363
363
  <v-data-iterator
364
364
  class="fs-data-table-iterator"
365
365
  :items="innerItems"
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <FSSelectField
3
+ :items="entities"
4
+ :modelValue="$props.modelValue"
5
+ @update:modelValue="$emit('update:modelValue', $event)"
6
+ v-bind="$attrs"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { defineComponent, onMounted } from "vue";
12
+
13
+ import { useTimeZones } from "@dative-gpi/foundation-shared-services/composables";
14
+
15
+ import FSSelectField from "../fields/FSSelectField.vue";
16
+
17
+ export default defineComponent({
18
+ name: "FSSelectTimeZone",
19
+ components: {
20
+ FSSelectField
21
+ },
22
+ props: {
23
+ modelValue: {
24
+ type: String,
25
+ required: false,
26
+ default: null
27
+ },
28
+ },
29
+ emits: ["update:modelValue"],
30
+ setup() {
31
+ const { getMany, entities } = useTimeZones();
32
+
33
+ onMounted(() => {
34
+ getMany();
35
+ });
36
+
37
+ return {
38
+ entities
39
+ };
40
+ }
41
+ });
42
+ </script>
@@ -40,16 +40,20 @@
40
40
  align="center-left"
41
41
  >
42
42
  <FSColor
43
- align="center-center"
44
43
  padding="0 8px"
45
44
  height="24px"
46
45
  :color="ColorEnum.Primary"
46
+ :border="false"
47
47
  >
48
- <FSText
49
- font="text-overline"
48
+ <FSRow
49
+ align="center-center"
50
50
  >
51
- {{ groupsLabel }}
52
- </FSText>
51
+ <FSText
52
+ font="text-overline"
53
+ >
54
+ {{ groupsLabel }}
55
+ </FSText>
56
+ </FSRow>
53
57
  </FSColor>
54
58
  <FSSpan
55
59
  font="text-overline"
@@ -61,16 +65,20 @@
61
65
  align="center-left"
62
66
  >
63
67
  <FSColor
64
- align="center-center"
65
68
  padding="0 8px"
66
69
  height="24px"
67
70
  :color="ColorEnum.Success"
71
+ :border="false"
68
72
  >
69
- <FSText
70
- font="text-overline"
73
+ <FSRow
74
+ align="center-center"
71
75
  >
72
- {{ deviceOrganisationsLabel }}
73
- </FSText>
76
+ <FSText
77
+ font="text-overline"
78
+ >
79
+ {{ deviceOrganisationsLabel }}
80
+ </FSText>
81
+ </FSRow>
74
82
  </FSColor>
75
83
  <FSSpan
76
84
  font="text-overline"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.21",
4
+ "version": "0.0.23",
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": "0.0.21",
14
- "@dative-gpi/foundation-shared-services": "0.0.21",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.23",
14
+ "@dative-gpi/foundation-shared-services": "0.0.23",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "27642f99177d57e7349dd826e922442a6c0720cb"
35
+ "gitHead": "c0d661503cf9ffd8f585a696a7b0c1173d9c111c"
36
36
  }
@@ -28,4 +28,8 @@
28
28
  a:has(.fs-clickable) {
29
29
  text-decoration: none;
30
30
  padding: 0 !important;
31
+ }
32
+
33
+ .fs-clickable-achor-full-width {
34
+ width: 100%;
31
35
  }
@@ -1,5 +1,6 @@
1
1
  .fs-color {
2
- background-color: var(--fs-color-background-color);
2
+ display: flex;
3
+ background-color: var(--fs-color-background-color) !important;
4
+ border-color: var(--fs-color-border-color) !important;
3
5
  color: var(--fs-color-color);
4
- border-radius: 4px;
5
6
  }