@dative-gpi/foundation-shared-components 0.0.70 → 0.0.72

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.
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <FSTile
3
+ :bottomColor="$props.bottomColor"
4
+ :editable="$props.editable"
5
+ :modelValue="$props.modelValue"
6
+ v-bind="$attrs"
7
+ >
8
+ <FSCol
9
+ align="center-center"
10
+ width="fill"
11
+ >
12
+ <FSRow
13
+ align="center-center"
14
+ gap="24px"
15
+ :height="imageSize"
16
+ :wrap="false"
17
+ >
18
+ <FSCol
19
+ gap="6px"
20
+ >
21
+ <FSText
22
+ font="text-button"
23
+ :lineClamp="2"
24
+ >
25
+ {{ $props.label }}
26
+ </FSText>
27
+ <FSText
28
+ font="text-overline"
29
+ variant="light"
30
+ >
31
+ {{ $props.code }}
32
+ </FSText>
33
+ </FSCol>
34
+ <FSIconCard
35
+ :backgroundColor="iconBackgroundColor"
36
+ :icon="$props.icon"
37
+ :size="imageSize"
38
+ />
39
+ </FSRow>
40
+ </FSCol>
41
+ </FSTile>
42
+ </template>
43
+
44
+ <script lang="ts">
45
+ import { computed, defineComponent, PropType } from "vue";
46
+
47
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
48
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
49
+
50
+ import FSIconCard from "../FSIconCard.vue";
51
+ import FSText from "../FSText.vue";
52
+ import FSTile from "./FSTile.vue";
53
+ import FSCol from "../FSCol.vue";
54
+ import FSRow from "../FSRow.vue";
55
+
56
+ export default defineComponent({
57
+ name: "FSSimpleIconTileUI",
58
+ components: {
59
+ FSIconCard,
60
+ FSText,
61
+ FSTile,
62
+ FSCol,
63
+ FSRow
64
+ },
65
+ props: {
66
+ label: {
67
+ type: String as PropType<string | null>,
68
+ required: false,
69
+ default: null
70
+ },
71
+ modelValue: {
72
+ type: Boolean,
73
+ required: false,
74
+ default: false
75
+ },
76
+ code: {
77
+ type: String as PropType<string | null>,
78
+ required: false,
79
+ default: null
80
+ },
81
+ bottomColor: {
82
+ type: [Array, String] as PropType<ColorBase | ColorBase[]>,
83
+ required: false,
84
+ default: ColorEnum.Light
85
+ },
86
+ iconBackgroundColor: {
87
+ type: Boolean,
88
+ required: false,
89
+ default: false
90
+ },
91
+ icon: {
92
+ type: String as PropType<string>,
93
+ required: false,
94
+ default: "mdi-ab-testing"
95
+ },
96
+ editable: {
97
+ type: Boolean,
98
+ required: false,
99
+ default: true
100
+ }
101
+ },
102
+ setup(props) {
103
+ const { isMobileSized } = useBreakpoints();
104
+
105
+ const iconBackgroundColor = computed((): ColorBase | ColorBase[] => {
106
+ return props.iconBackgroundColor ? props.bottomColor : ColorEnum.Background;
107
+ });
108
+
109
+ const imageSize = computed((): number => {
110
+ return isMobileSized.value ? 90 : 100;
111
+ });
112
+
113
+ const infoWidth = computed((): number => {
114
+ let width = isMobileSized.value ? 288 : 304;
115
+ if (props.icon) {
116
+ width -= imageSize.value;
117
+ }
118
+ return width;
119
+ });
120
+
121
+ return {
122
+ iconBackgroundColor,
123
+ ColorEnum,
124
+ imageSize,
125
+ infoWidth
126
+ };
127
+ }
128
+ });
129
+ </script>
@@ -15,9 +15,9 @@
15
15
  v-if="$props.editable"
16
16
  class="fs-tile-checkbox"
17
17
  :border="false"
18
+ v-bind="$attrs"
18
19
  >
19
20
  <FSCheckbox
20
- :color="ColorEnum.Dark"
21
21
  :modelValue="$props.modelValue"
22
22
  @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
23
23
  />
@@ -34,15 +34,16 @@
34
34
  :style="style"
35
35
  :width="width"
36
36
  :height="height"
37
+ v-bind="$attrs"
37
38
  >
38
39
  <slot />
39
40
  <FSCard
40
41
  v-if="$props.editable"
41
42
  class="fs-tile-checkbox"
42
43
  :border="false"
44
+ v-bind="$attrs"
43
45
  >
44
46
  <FSCheckbox
45
- :color="ColorEnum.Dark"
46
47
  :modelValue="$props.modelValue"
47
48
  @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
48
49
  />
@@ -60,7 +61,7 @@ import { computed, defineComponent, PropType } from "vue";
60
61
  import { RouteLocation } from "vue-router";
61
62
 
62
63
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
63
- import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
64
+ import { ColorBase } from "@dative-gpi/foundation-shared-components/models";
64
65
 
65
66
  import FSClickable from "../FSClickable.vue";
66
67
  import FSCheckbox from "../FSCheckbox.vue";
@@ -105,12 +106,14 @@ export default defineComponent({
105
106
  const { isMobileSized } = useBreakpoints();
106
107
  const { getGradients } = useColors();
107
108
 
108
- const bottomColors = computed(() => getGradients(props.bottomColor));
109
-
110
109
  const style = computed((): { [key: string] : string | undefined } => {
111
- return {
112
- "--fs-tile-border-color": bottomColors.value.base
113
- };
110
+ if (props.bottomColor) {
111
+ const bottomColors = getGradients(props.bottomColor);
112
+ return {
113
+ "--fs-tile-border-color": bottomColors.base
114
+ };
115
+ }
116
+ return {};
114
117
  });
115
118
 
116
119
  const width = computed(() => {
@@ -122,10 +125,9 @@ export default defineComponent({
122
125
  });
123
126
 
124
127
  return {
125
- ColorEnum,
126
- style,
128
+ height,
127
129
  width,
128
- height
130
+ style
129
131
  };
130
132
  }
131
133
  });
@@ -22,23 +22,25 @@
22
22
  font="text-button"
23
23
  :lineClamp="2"
24
24
  >
25
- {{ $props.name }}
25
+ {{ title }}
26
26
  </FSText>
27
27
  <FSRow
28
+ v-if="roleLabel"
28
29
  align="center-left"
29
30
  gap="4px"
30
31
  >
31
32
  <FSIcon
33
+ v-if="roleIcon"
32
34
  variant="light"
33
35
  :color="ColorEnum.Dark"
34
36
  >
35
- {{ $props.roleIcon }}
37
+ {{ roleIcon }}
36
38
  </FSIcon>
37
39
  <FSText
38
40
  font="text-overline"
39
41
  variant="light"
40
42
  >
41
- {{ $props.roleLabel }}
43
+ {{ roleLabel }}
42
44
  </FSText>
43
45
  </FSRow>
44
46
  </FSCol>
@@ -55,8 +57,10 @@
55
57
  <script lang="ts">
56
58
  import { computed, defineComponent, PropType } from "vue";
57
59
 
60
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
58
61
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
59
62
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
63
+ import { UserType } from "@dative-gpi/foundation-core-domain/models";
60
64
 
61
65
  import FSImage from "../FSImage.vue";
62
66
  import FSText from "../FSText.vue";
@@ -84,6 +88,16 @@ export default defineComponent({
84
88
  required: false,
85
89
  default: null
86
90
  },
91
+ label: {
92
+ type: String as PropType<string | null>,
93
+ required: false,
94
+ default: null
95
+ },
96
+ userType: {
97
+ type: Number as PropType<UserType>,
98
+ required: false,
99
+ default: UserType.User
100
+ },
87
101
  roleIcon: {
88
102
  type: String as PropType<string | null>,
89
103
  required: false,
@@ -94,6 +108,11 @@ export default defineComponent({
94
108
  required: false,
95
109
  default: null
96
110
  },
111
+ admin: {
112
+ type: Boolean,
113
+ required: false,
114
+ default: false
115
+ },
97
116
  modelValue: {
98
117
  type: Boolean,
99
118
  required: false,
@@ -107,6 +126,28 @@ export default defineComponent({
107
126
  },
108
127
  setup(props) {
109
128
  const { isMobileSized } = useBreakpoints();
129
+ const { $tr } = useTranslationsProvider();
130
+
131
+ const title = computed((): string | null => {
132
+ switch (props.userType) {
133
+ case UserType.ServiceAccount: return props.label;
134
+ default: return props.name;
135
+ }
136
+ });
137
+
138
+ const roleIcon = computed((): string | null => {
139
+ if (props.admin) {
140
+ return "mdi-crown-outline";
141
+ }
142
+ return props.roleIcon;
143
+ });
144
+
145
+ const roleLabel = computed((): string | null => {
146
+ if (props.admin) {
147
+ return $tr("ui.user-organisation.admin", "Administrator");
148
+ }
149
+ return props.roleLabel;
150
+ });
110
151
 
111
152
  const imageSize = computed((): number => {
112
153
  return isMobileSized.value ? 90 : 100;
@@ -123,7 +164,10 @@ export default defineComponent({
123
164
  return {
124
165
  imageSize,
125
166
  infoWidth,
126
- ColorEnum
167
+ ColorEnum,
168
+ roleLabel,
169
+ roleIcon,
170
+ title
127
171
  };
128
172
  }
129
173
  });
@@ -101,17 +101,17 @@ export const useColors = () => {
101
101
  }
102
102
  };
103
103
 
104
- const getGradients = (colors: ColorBase | ColorBase[]): ColorVariations => {
104
+ const getGradients = (colors: ColorBase | ColorBase[], rotation: number = 90): ColorVariations => {
105
105
  const variations = Array.isArray(colors) ? colors.map(getColors) : [getColors(colors)];
106
106
 
107
107
  if (variations.length === 1) {
108
108
  return variations[0];
109
109
  }
110
110
  return {
111
- light: `linear-gradient(90deg, ${variations.map(v => v.light).join(", ")})`,
112
- soft: `linear-gradient(90deg, ${variations.map(v => v.soft).join(", ")})`,
113
- base: `linear-gradient(90deg, ${variations.map(v => v.base).join(", ")})`,
114
- dark: `linear-gradient(90deg, ${variations.map(v => v.dark).join(", ")})`,
111
+ light: `linear-gradient(${rotation}deg, ${variations.map(v => v.light).join(", ")})`,
112
+ soft: `linear-gradient(${rotation}deg, ${variations.map(v => v.soft).join(", ")})`,
113
+ base: `linear-gradient(${rotation}deg, ${variations.map(v => v.base).join(", ")})`,
114
+ dark: `linear-gradient(${rotation}deg, ${variations.map(v => v.dark).join(", ")})`,
115
115
  };
116
116
  }
117
117
 
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.70",
4
+ "version": "0.0.72",
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.70",
14
- "@dative-gpi/foundation-shared-services": "0.0.70",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.72",
14
+ "@dative-gpi/foundation-shared-services": "0.0.72",
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": "e280ffdb9ee5d27727cc01325689b792168febcd"
35
+ "gitHead": "dbc4787e4b28439c3d9284f6e430daab222cd671"
36
36
  }
@@ -6,7 +6,6 @@
6
6
  width: var(--fs-card-width);
7
7
  display: flex;
8
8
 
9
- background-color: var(--fs-card-background-color);
10
9
  border-color: var(--fs-card-border-color);
11
10
  color: var(--fs-card-color);
12
11
 
@@ -15,4 +14,12 @@
15
14
  border-radius: 4px;
16
15
  margin: 4px;
17
16
  }
17
+
18
+ &-background {
19
+ background-color: var(--fs-card-background-color);
20
+ }
21
+
22
+ &-gradient {
23
+ background: var(--fs-card-background-color);
24
+ }
18
25
  }
@@ -1,8 +1,34 @@
1
1
  .fs-data-table {
2
- th,
3
- td {
2
+ table {
3
+ margin-top: calc(var(--fs-data-table-row-gap) * -1);
4
+ border-spacing: 0 var(--fs-data-table-row-gap) !important;
5
+ background-color: var(--fs-data-table-background-color) !important;
6
+ }
7
+
8
+ .fs-data-table-custom-row > td {
9
+ border-bottom: var(--fs-data-table-row-border-size) solid var(--fs-data-table-row-border-color) !important;
10
+ border-top: var(--fs-data-table-row-border-size) solid var(--fs-data-table-row-border-color) !important;
11
+ background-color: var(--fs-data-table-row-background-color) !important;
12
+ color: var(--fs-data-table-row-color);
4
13
  position: relative;
14
+ }
15
+
16
+ .fs-data-table-custom-row > td:first-child{
17
+ border-top-left-radius: var(--fs-data-table-row-border-radius) !important;
18
+ border-bottom-left-radius: var(--fs-data-table-row-border-radius) !important;
19
+ border-left: var(--fs-data-table-row-border-size) solid var(--fs-data-table-row-border-color);
20
+ }
21
+
22
+ .fs-data-table-custom-row > td:last-child{
23
+ border-top-right-radius: var(--fs-data-table-row-border-radius) !important;
24
+ border-bottom-right-radius: var(--fs-data-table-row-border-radius) !important;
25
+ border-right: var(--fs-data-table-row-border-size) solid var(--fs-data-table-row-border-color);
26
+ }
27
+
28
+ th,
29
+ :not(.fs-data-table-custom-row) > td {
5
30
  background-color: var(--fs-data-table-background-color) !important;
31
+ position: relative;
6
32
  }
7
33
 
8
34
  th {
@@ -1,27 +1,3 @@
1
- .fs-icon-s {
2
- @include web {
3
- font-size: 16px !important;
4
- }
5
- @include mobile {
6
- font-size: 14px !important;
7
- }
8
- }
9
-
10
- .fs-icon-m {
11
- @include web {
12
- font-size: 20px !important;
13
- }
14
- @include mobile {
15
- font-size: 16px !important;
16
- }
17
- }
18
-
19
- .fs-icon-l {
20
- @include web {
21
- font-size: 24px !important;
22
- }
23
-
24
- @include mobile {
25
- font-size: 20px !important;
26
- }
1
+ .fs-icon {
2
+ font-size: var(--fs-icon-font-size) !important;
27
3
  }