@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.
- package/components/FSCard.vue +28 -4
- package/components/FSClickable.vue +36 -4
- package/components/FSIcon.vue +25 -9
- package/components/FSIconCard.vue +80 -0
- package/components/FSText.vue +5 -15
- package/components/lists/FSDataIteratorItem.vue +23 -1
- package/components/lists/FSDataTableUI.vue +177 -57
- package/components/tiles/FSDashboardOrganisationTileUI.vue +18 -0
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +18 -0
- package/components/tiles/FSDashboardShallowTileUI.vue +18 -0
- package/components/tiles/FSFolderTileUI.vue +19 -0
- package/components/tiles/FSSimpleIconTileUI.vue +129 -0
- package/components/tiles/FSTile.vue +13 -11
- package/components/tiles/FSUserOrganisationTileUI.vue +48 -4
- package/composables/useColors.ts +5 -5
- package/package.json +4 -4
- package/styles/components/fs_card.scss +8 -1
- package/styles/components/fs_data_table.scss +28 -2
- package/styles/components/fs_icon.scss +2 -26
package/components/FSCard.vue
CHANGED
|
@@ -65,12 +65,12 @@ export default defineComponent({
|
|
|
65
65
|
default: "8px"
|
|
66
66
|
},
|
|
67
67
|
variant: {
|
|
68
|
-
type: String as PropType<"background" | "standard">,
|
|
68
|
+
type: String as PropType<"background" | "standard" | "gradient">,
|
|
69
69
|
required: false,
|
|
70
70
|
default: "background"
|
|
71
71
|
},
|
|
72
72
|
color: {
|
|
73
|
-
type: String as PropType<ColorBase>,
|
|
73
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
74
74
|
required: false,
|
|
75
75
|
default: ColorEnum.Background
|
|
76
76
|
},
|
|
@@ -91,9 +91,15 @@ export default defineComponent({
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
setup(props) {
|
|
94
|
-
const { getColors } = useColors();
|
|
94
|
+
const { getColors, getGradients } = useColors();
|
|
95
95
|
|
|
96
|
-
const colors = computed(() =>
|
|
96
|
+
const colors = computed(() => {
|
|
97
|
+
if(Array.isArray(props.color)) {
|
|
98
|
+
return getColors(props.color[0]);
|
|
99
|
+
}
|
|
100
|
+
return getColors(props.color);
|
|
101
|
+
});
|
|
102
|
+
const gradients = computed(() => getGradients(props.color, 135));
|
|
97
103
|
const backgrounds = getColors(ColorEnum.Background);
|
|
98
104
|
const lights = getColors(ColorEnum.Light);
|
|
99
105
|
const darks = getColors(ColorEnum.Dark);
|
|
@@ -120,11 +126,29 @@ export default defineComponent({
|
|
|
120
126
|
"--fs-card-border-color" : lights.dark,
|
|
121
127
|
"--fs-card-color" : darks.base
|
|
122
128
|
}
|
|
129
|
+
case "gradient": return {
|
|
130
|
+
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
131
|
+
"--fs-card-border-radius" : sizeToVar(props.borderRadius),
|
|
132
|
+
"--fs-card-padding" : sizeToVar(props.padding),
|
|
133
|
+
"--fs-card-height" : sizeToVar(props.height),
|
|
134
|
+
"--fs-card-width" : sizeToVar(props.width),
|
|
135
|
+
"--fs-card-background-color": gradients.value.base,
|
|
136
|
+
"--fs-card-border-color" : colors.value.lightContrast,
|
|
137
|
+
"--fs-card-color" : colors.value.lightContrast
|
|
138
|
+
}
|
|
123
139
|
}
|
|
124
140
|
});
|
|
125
141
|
|
|
126
142
|
const classes = computed((): string[] => {
|
|
127
143
|
const classNames = ["fs-card"];
|
|
144
|
+
switch(props.variant) {
|
|
145
|
+
case "gradient":
|
|
146
|
+
classNames.push("fs-card-gradient");
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
classNames.push("fs-card-background");
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
128
152
|
if (props.elevation) {
|
|
129
153
|
classNames.push("fs-card-elevation");
|
|
130
154
|
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
v-if="$props.href"
|
|
4
4
|
:href="$props.href"
|
|
5
5
|
:style="style"
|
|
6
|
+
@mouseover="hover = true"
|
|
7
|
+
@mouseleave="hover = false"
|
|
8
|
+
@mousedown="active = true"
|
|
9
|
+
@mouseup="active = false"
|
|
6
10
|
>
|
|
7
11
|
<FSCard
|
|
8
12
|
:height="$props.height"
|
|
@@ -12,7 +16,7 @@
|
|
|
12
16
|
v-bind="$attrs"
|
|
13
17
|
>
|
|
14
18
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
15
|
-
<slot :name="name" v-bind="slotData" />
|
|
19
|
+
<slot :name="name" v-bind="{ ...slotData, contentVariant }" />
|
|
16
20
|
</template>
|
|
17
21
|
</FSCard>
|
|
18
22
|
<template v-if="$props.load">
|
|
@@ -29,6 +33,10 @@
|
|
|
29
33
|
v-else-if="$props.to"
|
|
30
34
|
:style="style"
|
|
31
35
|
:to="$props.to"
|
|
36
|
+
@mouseover="hover = true"
|
|
37
|
+
@mouseleave="hover = false"
|
|
38
|
+
@mousedown="active = true"
|
|
39
|
+
@mouseup="active = false"
|
|
32
40
|
>
|
|
33
41
|
<FSCard
|
|
34
42
|
:height="$props.height"
|
|
@@ -38,7 +46,7 @@
|
|
|
38
46
|
v-bind="$attrs"
|
|
39
47
|
>
|
|
40
48
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
41
|
-
<slot :name="name" v-bind="slotData" />
|
|
49
|
+
<slot :name="name" v-bind="{ ...slotData, contentVariant }" />
|
|
42
50
|
</template>
|
|
43
51
|
</FSCard>
|
|
44
52
|
<template v-if="$props.load">
|
|
@@ -56,6 +64,10 @@
|
|
|
56
64
|
:type="$props.type"
|
|
57
65
|
:style="style"
|
|
58
66
|
@click.stop="onClick"
|
|
67
|
+
@mouseover="hover = true"
|
|
68
|
+
@mouseleave="hover = false"
|
|
69
|
+
@mousedown="active = true"
|
|
70
|
+
@mouseup="active = false"
|
|
59
71
|
>
|
|
60
72
|
<FSCard
|
|
61
73
|
:height="$props.height"
|
|
@@ -65,7 +77,7 @@
|
|
|
65
77
|
v-bind="$attrs"
|
|
66
78
|
>
|
|
67
79
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
68
|
-
<slot :name="name" v-bind="slotData" />
|
|
80
|
+
<slot :name="name" v-bind="{ ...slotData, contentVariant }" />
|
|
69
81
|
</template>
|
|
70
82
|
</FSCard>
|
|
71
83
|
<template v-if="$props.load">
|
|
@@ -81,7 +93,7 @@
|
|
|
81
93
|
</template>
|
|
82
94
|
|
|
83
95
|
<script lang="ts">
|
|
84
|
-
import { computed, defineComponent, PropType } from "vue";
|
|
96
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
85
97
|
import { RouteLocation } from "vue-router";
|
|
86
98
|
|
|
87
99
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -161,6 +173,9 @@ export default defineComponent({
|
|
|
161
173
|
const lights = getColors(ColorEnum.Light);
|
|
162
174
|
const darks = getColors(ColorEnum.Dark);
|
|
163
175
|
|
|
176
|
+
const hover = ref(false);
|
|
177
|
+
const active = ref(false);
|
|
178
|
+
|
|
164
179
|
const style = computed((): { [key: string] : string | undefined } => {
|
|
165
180
|
if (!props.editable) {
|
|
166
181
|
return {
|
|
@@ -222,6 +237,20 @@ export default defineComponent({
|
|
|
222
237
|
}
|
|
223
238
|
});
|
|
224
239
|
|
|
240
|
+
const contentVariant = computed((): "base" | "baseContrast" | "light" | "lightContrast" | "dark" | "darkContrast" => {
|
|
241
|
+
if (active.value) {
|
|
242
|
+
return "darkContrast";
|
|
243
|
+
}
|
|
244
|
+
if (hover.value) {
|
|
245
|
+
return "baseContrast";
|
|
246
|
+
}
|
|
247
|
+
switch (props.variant) {
|
|
248
|
+
case "standard" : return "lightContrast";
|
|
249
|
+
case "background": return "base";
|
|
250
|
+
case "full" : return "baseContrast";
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
225
254
|
const classes = computed((): string[] => {
|
|
226
255
|
const classNames: string[] = ["fs-clickable"];
|
|
227
256
|
if (!props.editable) {
|
|
@@ -247,8 +276,11 @@ export default defineComponent({
|
|
|
247
276
|
};
|
|
248
277
|
|
|
249
278
|
return {
|
|
279
|
+
contentVariant,
|
|
250
280
|
loadColor,
|
|
251
281
|
classes,
|
|
282
|
+
active,
|
|
283
|
+
hover,
|
|
252
284
|
style,
|
|
253
285
|
onClick
|
|
254
286
|
};
|
package/components/FSIcon.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-icon
|
|
3
|
-
|
|
3
|
+
class="fs-icon"
|
|
4
4
|
:color="color"
|
|
5
|
+
:style="style"
|
|
5
6
|
v-bind="$attrs"
|
|
6
7
|
>
|
|
7
8
|
<slot />
|
|
@@ -11,14 +12,15 @@
|
|
|
11
12
|
<script lang="ts">
|
|
12
13
|
import { computed, defineComponent, PropType } from "vue";
|
|
13
14
|
|
|
14
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
15
|
+
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
15
16
|
import { ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
17
|
+
import { sizeToVar } from "../utils";
|
|
16
18
|
|
|
17
19
|
export default defineComponent({
|
|
18
20
|
name: "FSIcon",
|
|
19
21
|
props: {
|
|
20
22
|
size: {
|
|
21
|
-
type: String as PropType<"s" | "m" | "l">,
|
|
23
|
+
type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
|
|
22
24
|
required: false,
|
|
23
25
|
default: "m"
|
|
24
26
|
},
|
|
@@ -28,28 +30,42 @@ export default defineComponent({
|
|
|
28
30
|
default: null
|
|
29
31
|
},
|
|
30
32
|
variant: {
|
|
31
|
-
type: String as PropType<"base" | "light" | "dark">,
|
|
33
|
+
type: String as PropType<"base" | "baseContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
|
|
32
34
|
required: false,
|
|
33
35
|
default: "base"
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
38
|
setup(props) {
|
|
39
|
+
const { isMobileSized } = useBreakpoints();
|
|
37
40
|
const { getColors } = useColors();
|
|
38
41
|
|
|
39
42
|
const color = computed((): string | null => {
|
|
40
43
|
if (props.color) {
|
|
41
|
-
return getColors(props.color)[props.variant]
|
|
44
|
+
return getColors(props.color)[props.variant]!;
|
|
42
45
|
}
|
|
43
46
|
return null;
|
|
44
47
|
});
|
|
45
48
|
|
|
46
|
-
const
|
|
47
|
-
|
|
49
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
50
|
+
switch(props.size) {
|
|
51
|
+
case "s": return {
|
|
52
|
+
"--fs-icon-font-size": isMobileSized.value ? "14px" : "16px"
|
|
53
|
+
};
|
|
54
|
+
case "m": return {
|
|
55
|
+
"--fs-icon-font-size": isMobileSized.value ? "16px" : "20px"
|
|
56
|
+
};
|
|
57
|
+
case "l": return {
|
|
58
|
+
"--fs-icon-font-size": isMobileSized.value ? "20px" : "24px"
|
|
59
|
+
};
|
|
60
|
+
default: return {
|
|
61
|
+
"--fs-icon-font-size": sizeToVar(props.size)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
48
64
|
});
|
|
49
65
|
|
|
50
66
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
color,
|
|
68
|
+
style
|
|
53
69
|
};
|
|
54
70
|
}
|
|
55
71
|
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCard
|
|
3
|
+
:color="$props.backgroundColor"
|
|
4
|
+
:height="$props.size"
|
|
5
|
+
:width="$props.size"
|
|
6
|
+
:variant="variant"
|
|
7
|
+
:border="border"
|
|
8
|
+
>
|
|
9
|
+
<FSRow
|
|
10
|
+
align="center-center"
|
|
11
|
+
>
|
|
12
|
+
<FSIcon
|
|
13
|
+
variant="dark"
|
|
14
|
+
size="56"
|
|
15
|
+
:color="$props.iconColor"
|
|
16
|
+
>
|
|
17
|
+
{{ $props.icon }}
|
|
18
|
+
</FSIcon>
|
|
19
|
+
</FSRow>
|
|
20
|
+
</FSCard>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
25
|
+
|
|
26
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
27
|
+
|
|
28
|
+
import FSCard from "./FSCard.vue";
|
|
29
|
+
import FSIcon from "./FSIcon.vue";
|
|
30
|
+
|
|
31
|
+
export default defineComponent({
|
|
32
|
+
name: "FSIconCard",
|
|
33
|
+
components: {
|
|
34
|
+
FSCard,
|
|
35
|
+
FSIcon
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
size: {
|
|
39
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
40
|
+
required: false,
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
backgroundColor: {
|
|
44
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
45
|
+
required: false,
|
|
46
|
+
default: null
|
|
47
|
+
},
|
|
48
|
+
icon: {
|
|
49
|
+
type: String as PropType<string>,
|
|
50
|
+
required: false,
|
|
51
|
+
default: "mdi-shape"
|
|
52
|
+
},
|
|
53
|
+
iconColor: {
|
|
54
|
+
type: String as PropType<ColorBase>,
|
|
55
|
+
required: false,
|
|
56
|
+
default: ColorEnum.Dark
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
setup(props) {
|
|
60
|
+
const variant = computed((): "background" | "gradient" => {
|
|
61
|
+
switch (props.backgroundColor) {
|
|
62
|
+
case ColorEnum.Background: return "background";
|
|
63
|
+
default: return "gradient";
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const border = computed((): boolean => {
|
|
68
|
+
switch (props.backgroundColor) {
|
|
69
|
+
case ColorEnum.Background: return true;
|
|
70
|
+
default: return false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
variant,
|
|
76
|
+
border
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
</script>
|
package/components/FSText.vue
CHANGED
|
@@ -45,7 +45,7 @@ export default defineComponent({
|
|
|
45
45
|
default: ColorEnum.Dark
|
|
46
46
|
},
|
|
47
47
|
variant: {
|
|
48
|
-
type: String as PropType<"base" | "light" | "dark">,
|
|
48
|
+
type: String as PropType<"base" | "baseContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
|
|
49
49
|
required: false,
|
|
50
50
|
default: "base"
|
|
51
51
|
}
|
|
@@ -71,20 +71,10 @@ export default defineComponent({
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
const style = computed((): { [key: string] : string | undefined } => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
case "light": return {
|
|
80
|
-
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
81
|
-
"--fs-text-color" : colors.value.light
|
|
82
|
-
};
|
|
83
|
-
case "dark": return {
|
|
84
|
-
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
85
|
-
"--fs-text-color" : colors.value.dark
|
|
86
|
-
};
|
|
87
|
-
}
|
|
74
|
+
return {
|
|
75
|
+
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
76
|
+
"--fs-text-color" : colors.value[props.variant]
|
|
77
|
+
};
|
|
88
78
|
});
|
|
89
79
|
|
|
90
80
|
return {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
class="fs-data-iterator-item"
|
|
4
4
|
padding="12px"
|
|
5
5
|
width="100%"
|
|
6
|
+
:color="$props.itemColor"
|
|
7
|
+
:variant="variant"
|
|
6
8
|
>
|
|
7
9
|
<FSCol>
|
|
8
10
|
<slot name="item.top" v-bind="{ item: $props.item }" />
|
|
@@ -38,6 +40,8 @@
|
|
|
38
40
|
<FSCard
|
|
39
41
|
v-if="$props.showSelect"
|
|
40
42
|
class="fs-data-iterator-item-checkbox"
|
|
43
|
+
:color="$props.itemColor"
|
|
44
|
+
:variant="variant"
|
|
41
45
|
:border="false"
|
|
42
46
|
>
|
|
43
47
|
<FSCheckbox
|
|
@@ -50,7 +54,7 @@
|
|
|
50
54
|
</template>
|
|
51
55
|
|
|
52
56
|
<script lang="ts">
|
|
53
|
-
import { defineComponent, PropType } from "vue";
|
|
57
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
54
58
|
|
|
55
59
|
import { ColorEnum, FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
|
|
56
60
|
|
|
@@ -86,6 +90,11 @@ export default defineComponent({
|
|
|
86
90
|
required: false,
|
|
87
91
|
default: false
|
|
88
92
|
},
|
|
93
|
+
itemColor: {
|
|
94
|
+
type: String as PropType<ColorEnum>,
|
|
95
|
+
required: false,
|
|
96
|
+
default: ColorEnum.Background
|
|
97
|
+
},
|
|
89
98
|
color: {
|
|
90
99
|
type: String as PropType<ColorEnum>,
|
|
91
100
|
required: false,
|
|
@@ -96,6 +105,19 @@ export default defineComponent({
|
|
|
96
105
|
required: false,
|
|
97
106
|
default: true
|
|
98
107
|
}
|
|
108
|
+
},
|
|
109
|
+
setup(props) {
|
|
110
|
+
const variant = computed((): "standard" | "background" => {
|
|
111
|
+
switch (props.itemColor) {
|
|
112
|
+
case ColorEnum.Background:
|
|
113
|
+
case null: return "background";
|
|
114
|
+
default: return "standard";
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
variant
|
|
120
|
+
};
|
|
99
121
|
}
|
|
100
122
|
});
|
|
101
123
|
</script>
|