@dative-gpi/foundation-shared-components 0.0.119 → 0.0.121
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/FSBreadcrumbs.vue +1 -1
- package/components/FSButton.vue +1 -1
- package/components/FSChip.vue +1 -1
- package/components/FSClickable.vue +2 -2
- package/components/FSDialog.vue +12 -21
- package/components/FSDivider.vue +1 -1
- package/components/FSSlideGroup.vue +1 -1
- package/components/FSTabs.vue +1 -1
- package/components/FSText.vue +1 -1
- package/components/FSWrapGroup.vue +1 -1
- package/components/lists/FSDataTableUI.vue +1 -1
- package/components/tiles/FSDashboardOrganisationTileUI.vue +3 -3
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +3 -3
- package/components/tiles/FSDashboardShallowTileUI.vue +3 -3
- package/components/tiles/FSDeviceOrganisationTileUI.vue +1 -1
- package/components/tiles/FSFolderTileUI.vue +4 -4
- package/components/tiles/FSGroupTileUI.vue +1 -1
- package/components/tiles/{FSSimpleIconTileUI.vue → FSSimpleTileUI.vue} +17 -3
- package/components/tiles/FSUserOrganisationTileUI.vue +2 -2
- package/composables/index.ts +2 -1
- package/composables/useColors.ts +31 -59
- package/composables/useTables.ts +29 -0
- package/models/tables.ts +30 -21
- package/package.json +4 -4
- package/styles/components/fs_dialog.scss +12 -22
|
@@ -55,7 +55,7 @@ export default defineComponent({
|
|
|
55
55
|
const style: Ref<{ [key: string] : string }> = ref({
|
|
56
56
|
"--fs-breadcrumbs-color": darks.dark,
|
|
57
57
|
"--fs-breadcrumbs-active-color": darks.base,
|
|
58
|
-
"--fs-breadcrumbs-disabled-color": darks.
|
|
58
|
+
"--fs-breadcrumbs-disabled-color": darks.soft
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const classes = (item: FSBreadcrumbItem): string[] => {
|
package/components/FSButton.vue
CHANGED
|
@@ -251,7 +251,7 @@ export default defineComponent({
|
|
|
251
251
|
case ColorEnum.Success:
|
|
252
252
|
case ColorEnum.Warning:
|
|
253
253
|
case ColorEnum.Error : return ["standard"].includes(props.variant) ? colors.value.dark : colors.value.light;
|
|
254
|
-
default : return ["standard"].includes(props.variant) ? darks.dark : darks.
|
|
254
|
+
default : return ["standard"].includes(props.variant) ? darks.dark : darks.soft;
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
257
|
|
package/components/FSChip.vue
CHANGED
|
@@ -122,7 +122,7 @@ export default defineComponent({
|
|
|
122
122
|
case "full": return {
|
|
123
123
|
"--fs-chip-height" : sizeToVar(props.height),
|
|
124
124
|
"--fs-chip-background-color" : colors.value.base,
|
|
125
|
-
"--fs-chip-border-color" : colors.value.
|
|
125
|
+
"--fs-chip-border-color" : colors.value.base,
|
|
126
126
|
"--fs-chip-color" : colors.value.baseContrast,
|
|
127
127
|
"--fs-chip-hover-background-color" : colors.value.base,
|
|
128
128
|
"--fs-chip-hover-border-color" : colors.value.base,
|
|
@@ -254,7 +254,7 @@ export default defineComponent({
|
|
|
254
254
|
"--fs-clickable-border-color" : colors.value.lightContrast,
|
|
255
255
|
"--fs-clickable-color" : colors.value.lightContrast,
|
|
256
256
|
"--fs-clickable-hover-background-color" : colors.value.base,
|
|
257
|
-
"--fs-clickable-hover-border-color" : colors.value.
|
|
257
|
+
"--fs-clickable-hover-border-color" : colors.value.base,
|
|
258
258
|
"--fs-clickable-hover-color" : colors.value.baseContrast,
|
|
259
259
|
"--fs-clickable-active-background-color": colors.value.dark,
|
|
260
260
|
"--fs-clickable-active-border-color" : colors.value.darkContrast,
|
|
@@ -326,7 +326,7 @@ export default defineComponent({
|
|
|
326
326
|
case ColorEnum.Success:
|
|
327
327
|
case ColorEnum.Warning:
|
|
328
328
|
case ColorEnum.Error : return ["full"].includes(props.variant) ? colors.value.light : colors.value.dark;
|
|
329
|
-
default : return ["full"].includes(props.variant) ? darks.
|
|
329
|
+
default : return ["full"].includes(props.variant) ? darks.soft : darks.dark;
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
332
|
|
package/components/FSDialog.vue
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-dialog
|
|
3
3
|
transition="dialog-bottom-transition"
|
|
4
|
-
class="
|
|
5
|
-
:style="style"
|
|
4
|
+
:class="classes"
|
|
6
5
|
:modelValue="$props.modelValue"
|
|
7
6
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
7
|
v-bind="$attrs"
|
|
@@ -10,8 +9,9 @@
|
|
|
10
9
|
<FSCard
|
|
11
10
|
padding="24px 8px 24px 24px"
|
|
12
11
|
gap="24px"
|
|
12
|
+
:class="$props.cardClasses"
|
|
13
13
|
:color="$props.color"
|
|
14
|
-
:
|
|
14
|
+
:width="cardWidth"
|
|
15
15
|
>
|
|
16
16
|
<template
|
|
17
17
|
#header
|
|
@@ -113,37 +113,28 @@ export default defineComponent({
|
|
|
113
113
|
const { isExtraSmall } = useBreakpoints();
|
|
114
114
|
|
|
115
115
|
const classes = computed((): string[] => {
|
|
116
|
-
const classNames = [
|
|
117
|
-
if (props.cardClasses) {
|
|
118
|
-
if (Array.isArray(props.cardClasses)) {
|
|
119
|
-
classNames.push(...props.cardClasses);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
classNames.push(props.cardClasses);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
116
|
+
const classNames: string[] = [];
|
|
125
117
|
if (isExtraSmall.value) {
|
|
126
118
|
classNames.push("fs-dialog-mobile");
|
|
127
119
|
}
|
|
120
|
+
else {
|
|
121
|
+
classNames.push("fs-dialog");
|
|
122
|
+
}
|
|
128
123
|
return classNames;
|
|
129
124
|
});
|
|
130
125
|
|
|
131
|
-
const
|
|
126
|
+
const cardWidth = computed((): string => {
|
|
132
127
|
if (isExtraSmall.value) {
|
|
133
|
-
return
|
|
134
|
-
"--fs-dialog-width": "100%"
|
|
135
|
-
};
|
|
128
|
+
return "100%";
|
|
136
129
|
}
|
|
137
|
-
return
|
|
138
|
-
"--fs-dialog-width": sizeToVar(props.width)
|
|
139
|
-
};
|
|
130
|
+
return sizeToVar(props.width);
|
|
140
131
|
});
|
|
141
132
|
|
|
142
133
|
return {
|
|
143
134
|
isExtraSmall,
|
|
135
|
+
cardWidth,
|
|
144
136
|
ColorEnum,
|
|
145
|
-
classes
|
|
146
|
-
style
|
|
137
|
+
classes
|
|
147
138
|
};
|
|
148
139
|
}
|
|
149
140
|
});
|
package/components/FSDivider.vue
CHANGED
|
@@ -91,7 +91,7 @@ export default defineComponent({
|
|
|
91
91
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
92
92
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
93
93
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
94
|
-
"--fs-group-color" : darks.
|
|
94
|
+
"--fs-group-color" : darks.soft,
|
|
95
95
|
"--fs-group-hover-color" : darks.dark
|
|
96
96
|
}));
|
|
97
97
|
|
package/components/FSTabs.vue
CHANGED
|
@@ -50,7 +50,7 @@ export default defineComponent({
|
|
|
50
50
|
const darks = getColors(ColorEnum.Dark);
|
|
51
51
|
|
|
52
52
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
53
|
-
"--fs-group-color" : darks.
|
|
53
|
+
"--fs-group-color" : darks.soft,
|
|
54
54
|
"--fs-group-hover-color" : darks.dark,
|
|
55
55
|
"--fs-tab-border-color" : lights.dark,
|
|
56
56
|
"--fs-tab-hover-border-color" : darks.dark,
|
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" | "baseContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
|
|
48
|
+
type: String as PropType<"base" | "baseContrast" | "light" | "lightContrast" | "dark" | "darkContrast" | "soft" | "softContrast">,
|
|
49
49
|
required: false,
|
|
50
50
|
default: "base"
|
|
51
51
|
}
|
|
@@ -54,7 +54,7 @@ export default defineComponent({
|
|
|
54
54
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
55
55
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
56
56
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
57
|
-
"--fs-group-color" : darks.
|
|
57
|
+
"--fs-group-color" : darks.soft,
|
|
58
58
|
"--fs-group-hover-color": darks.dark
|
|
59
59
|
}));
|
|
60
60
|
|
|
@@ -1105,7 +1105,7 @@ export default defineComponent({
|
|
|
1105
1105
|
switch (property) {
|
|
1106
1106
|
case "hidden":
|
|
1107
1107
|
innerColumn.hidden = value as boolean;
|
|
1108
|
-
if (value) {
|
|
1108
|
+
if (value && filters.value[header.value!]) {
|
|
1109
1109
|
filters.value[header.value!] = filters.value[header.value!].map((filter) => ({ ...filter, hidden: false }));
|
|
1110
1110
|
resetable.value = Object.keys(filters.value)
|
|
1111
1111
|
.some((key) => filters.value[key].some((filter) => filter.hidden));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -11,7 +11,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
11
11
|
|
|
12
12
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
15
|
|
|
16
16
|
export default defineComponent({
|
|
17
17
|
name: "FSDashboardOrganisationTileUI",
|
|
@@ -28,7 +28,7 @@ export default defineComponent({
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
components: {
|
|
31
|
-
|
|
31
|
+
FSSimpleTileUI
|
|
32
32
|
},
|
|
33
33
|
setup(props){
|
|
34
34
|
const color = computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -11,7 +11,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
11
11
|
|
|
12
12
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
15
|
|
|
16
16
|
export default defineComponent({
|
|
17
17
|
name: "FSDashboardOrganisationTypeTileUI",
|
|
@@ -28,7 +28,7 @@ export default defineComponent({
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
components: {
|
|
31
|
-
|
|
31
|
+
FSSimpleTileUI
|
|
32
32
|
},
|
|
33
33
|
setup(props){
|
|
34
34
|
const color = computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -11,7 +11,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
11
11
|
|
|
12
12
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
15
|
|
|
16
16
|
export default defineComponent({
|
|
17
17
|
name: "FSDashboardShallowTileUI",
|
|
@@ -28,7 +28,7 @@ export default defineComponent({
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
components: {
|
|
31
|
-
|
|
31
|
+
FSSimpleTileUI
|
|
32
32
|
},
|
|
33
33
|
setup(props){
|
|
34
34
|
const color = computed(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
|
+
:iconBackgroundColor="true"
|
|
3
4
|
:bottomColor="color"
|
|
4
5
|
:icon="$props.icon"
|
|
5
|
-
:iconBackgroundColor="true"
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
/>
|
|
8
8
|
</template>
|
|
@@ -12,7 +12,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
12
12
|
|
|
13
13
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
16
16
|
|
|
17
17
|
export default defineComponent({
|
|
18
18
|
name: "FSFolderTileUI",
|
|
@@ -29,7 +29,7 @@ export default defineComponent({
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
components: {
|
|
32
|
-
|
|
32
|
+
FSSimpleTileUI
|
|
33
33
|
},
|
|
34
34
|
setup(props){
|
|
35
35
|
const color = computed(() => {
|
|
@@ -26,12 +26,19 @@
|
|
|
26
26
|
</FSText>
|
|
27
27
|
<FSText
|
|
28
28
|
font="text-overline"
|
|
29
|
-
variant="
|
|
29
|
+
variant="soft"
|
|
30
30
|
>
|
|
31
31
|
{{ $props.code }}
|
|
32
32
|
</FSText>
|
|
33
33
|
</FSCol>
|
|
34
|
+
<FSImage
|
|
35
|
+
v-if="$props.imageId"
|
|
36
|
+
:height="imageSize"
|
|
37
|
+
:width="imageSize"
|
|
38
|
+
:imageId="$props.imageId"
|
|
39
|
+
/>
|
|
34
40
|
<FSIconCard
|
|
41
|
+
v-else
|
|
35
42
|
:backgroundColor="iconBackgroundColor"
|
|
36
43
|
:icon="$props.icon"
|
|
37
44
|
:size="imageSize"
|
|
@@ -48,17 +55,19 @@ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composa
|
|
|
48
55
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
49
56
|
|
|
50
57
|
import FSIconCard from "../FSIconCard.vue";
|
|
58
|
+
import FSImage from "../FSImage.vue";
|
|
51
59
|
import FSText from "../FSText.vue";
|
|
52
60
|
import FSTile from "./FSTile.vue";
|
|
53
61
|
import FSCol from "../FSCol.vue";
|
|
54
62
|
import FSRow from "../FSRow.vue";
|
|
55
63
|
|
|
56
64
|
export default defineComponent({
|
|
57
|
-
name: "
|
|
65
|
+
name: "FSSimpleTileUI",
|
|
58
66
|
components: {
|
|
59
67
|
FSIconCard,
|
|
60
|
-
|
|
68
|
+
FSImage,
|
|
61
69
|
FSTile,
|
|
70
|
+
FSText,
|
|
62
71
|
FSCol,
|
|
63
72
|
FSRow
|
|
64
73
|
},
|
|
@@ -93,6 +102,11 @@ export default defineComponent({
|
|
|
93
102
|
required: false,
|
|
94
103
|
default: "mdi-ab-testing"
|
|
95
104
|
},
|
|
105
|
+
imageId: {
|
|
106
|
+
type: String as PropType<string>,
|
|
107
|
+
required: false,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
96
110
|
editable: {
|
|
97
111
|
type: Boolean,
|
|
98
112
|
required: false,
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
>
|
|
32
32
|
<FSIcon
|
|
33
33
|
v-if="roleIcon"
|
|
34
|
-
variant="
|
|
34
|
+
variant="soft"
|
|
35
35
|
:color="ColorEnum.Dark"
|
|
36
36
|
>
|
|
37
37
|
{{ roleIcon }}
|
|
38
38
|
</FSIcon>
|
|
39
39
|
<FSText
|
|
40
40
|
font="text-overline"
|
|
41
|
-
variant="
|
|
41
|
+
variant="soft"
|
|
42
42
|
>
|
|
43
43
|
{{ roleLabel }}
|
|
44
44
|
</FSText>
|
package/composables/index.ts
CHANGED
package/composables/useColors.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ColorBase, ColorEnum, ColorVariations } from "@dative-gpi/foundation-sh
|
|
|
6
6
|
|
|
7
7
|
export const useColors = () => {
|
|
8
8
|
const theme = useTheme().current.value;
|
|
9
|
-
const baseMinSaturation =
|
|
9
|
+
const baseMinSaturation = 0;
|
|
10
10
|
const baseFixedBrightness = 90;
|
|
11
11
|
|
|
12
12
|
const isGrayScale = (color: Color): boolean => {
|
|
@@ -24,7 +24,8 @@ export const useColors = () => {
|
|
|
24
24
|
|
|
25
25
|
const getLight = (base: Color): Color => {
|
|
26
26
|
if (isGrayScale(base)) {
|
|
27
|
-
return base
|
|
27
|
+
return base
|
|
28
|
+
.value(Math.max(base.value(), 95));
|
|
28
29
|
}
|
|
29
30
|
return base.saturationv(10).value(100);
|
|
30
31
|
};
|
|
@@ -33,75 +34,46 @@ export const useColors = () => {
|
|
|
33
34
|
return base.value(Math.min(base.value() + 10, 100));
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
const getBase = (base: Color): Color => {
|
|
37
|
-
if (isGrayScale(base)) {
|
|
38
|
-
return base.saturationv(1);
|
|
39
|
-
}
|
|
40
|
-
const saturation = base.saturationv() > baseMinSaturation ? base.saturationv() : baseMinSaturation;
|
|
41
|
-
return base.saturationv(saturation).value(baseFixedBrightness);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
37
|
const getDark = (base: Color): Color => {
|
|
45
38
|
return base.value(Math.max(base.value() - 15, 0));
|
|
46
39
|
};
|
|
47
40
|
|
|
48
|
-
const getContrast = (color: Color
|
|
49
|
-
if
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
const getContrast = (color: Color): Color => {
|
|
42
|
+
if(isGrayScale(color)){
|
|
43
|
+
const coeff = 4
|
|
44
|
+
return color
|
|
45
|
+
.value(color.value() < 70 ? 100 : Math.max(color.value() / coeff, 0));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if(isPastel(color)){
|
|
49
|
+
return color.darken(0.6);
|
|
56
50
|
}
|
|
57
|
-
|
|
51
|
+
|
|
52
|
+
if(color.darken(0.15).isLight()){
|
|
53
|
+
return color.darken(0.6);
|
|
54
|
+
}
|
|
55
|
+
return color.lighten(color.value() / 50);
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
const getColors = (color: ColorBase): ColorVariations => {
|
|
61
59
|
const themed = (Object as any).values(ColorEnum).includes(color);
|
|
62
60
|
|
|
63
|
-
const
|
|
61
|
+
const base = themed ? new Color(theme.colors[color as ColorEnum]) : new Color(color);
|
|
64
62
|
|
|
65
|
-
const base = getBase(seed);
|
|
66
63
|
const light = getLight(base);
|
|
67
64
|
const soft = getSoft(base);
|
|
68
65
|
const dark = getDark(base);
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
switch (color) {
|
|
84
|
-
case ColorEnum.Background: return {
|
|
85
|
-
light: base.hex(),
|
|
86
|
-
lightContrast: getContrast(base, base).hex(),
|
|
87
|
-
soft: base.hex(),
|
|
88
|
-
softContrast: getContrast(base, base).hex(),
|
|
89
|
-
base: base.hex(),
|
|
90
|
-
baseContrast: getContrast(base, base).hex(),
|
|
91
|
-
dark: dark.hex(),
|
|
92
|
-
darkContrast: getContrast(dark, base).hex()
|
|
93
|
-
};
|
|
94
|
-
default: return {
|
|
95
|
-
light: light.hex(),
|
|
96
|
-
lightContrast: getContrast(light, dark).hex(),
|
|
97
|
-
soft: soft.hex(),
|
|
98
|
-
softContrast: getContrast(soft, light).hex(),
|
|
99
|
-
base: base.hex(),
|
|
100
|
-
baseContrast: getContrast(base, light).hex(),
|
|
101
|
-
dark: dark.hex(),
|
|
102
|
-
darkContrast: getContrast(dark, light).hex()
|
|
103
|
-
};
|
|
104
|
-
}
|
|
67
|
+
return {
|
|
68
|
+
light: light.hex(),
|
|
69
|
+
lightContrast: getContrast(light).hex(),
|
|
70
|
+
soft: soft.hex(),
|
|
71
|
+
softContrast: getContrast(soft).hex(),
|
|
72
|
+
base: base.hex(),
|
|
73
|
+
baseContrast: getContrast(base).hex(),
|
|
74
|
+
dark: dark.hex(),
|
|
75
|
+
darkContrast: getContrast(dark).hex()
|
|
76
|
+
};
|
|
105
77
|
};
|
|
106
78
|
|
|
107
79
|
const getGradients = (colors: ColorBase | ColorBase[], rotation: number = 90): ColorVariations => {
|
|
@@ -119,10 +91,10 @@ export const useColors = () => {
|
|
|
119
91
|
}
|
|
120
92
|
|
|
121
93
|
const getBasePaletteColors = (): string[][] => {
|
|
122
|
-
const columnCount =
|
|
94
|
+
const columnCount = 8
|
|
123
95
|
const colors: string[][] = [];
|
|
124
96
|
for (let saturation = baseMinSaturation; saturation <= 100; saturation += (100 - baseMinSaturation) / (columnCount - 1)) {
|
|
125
|
-
|
|
97
|
+
const colorsRow = [];
|
|
126
98
|
for (let hue = 0; hue < 360; hue += 15) {
|
|
127
99
|
const color = new Color({ h: hue, s: saturation, v: baseFixedBrightness });
|
|
128
100
|
colorsRow.push(color.hex());
|
|
@@ -130,7 +102,7 @@ export const useColors = () => {
|
|
|
130
102
|
colors.push(colorsRow)
|
|
131
103
|
}
|
|
132
104
|
let i = 0;
|
|
133
|
-
for (let brightness =
|
|
105
|
+
for (let brightness = 0; brightness <= 100; brightness += (100 / (columnCount - 1))) {
|
|
134
106
|
const color = new Color({ h: 0, s: 1, v: 100 - brightness });
|
|
135
107
|
colors[i].unshift(color.hex());
|
|
136
108
|
i++;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
|
|
3
|
+
import { Single } from "@dative-gpi/foundation-shared-domain/tools/single";
|
|
4
|
+
|
|
5
|
+
import { FSDataTable } from "../models";
|
|
6
|
+
|
|
7
|
+
const tables = ref<{ [key: string]: FSDataTable }>({});
|
|
8
|
+
|
|
9
|
+
const single = new Single();
|
|
10
|
+
|
|
11
|
+
export const useTables = () => {
|
|
12
|
+
return single.call(() => {
|
|
13
|
+
const getTable = (tableCode: string): FSDataTable | null => {
|
|
14
|
+
if (tables.value[tableCode] != null) {
|
|
15
|
+
return tables.value[tableCode];
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const setTable = (tableCode: string, value: FSDataTable) => {
|
|
21
|
+
tables.value[tableCode] = { ...value };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
getTable,
|
|
26
|
+
setTable
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
};
|
package/models/tables.ts
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
export interface FSDataTableColumn {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
text?: string | null;
|
|
4
|
+
value?: string | null;
|
|
5
|
+
index: number;
|
|
6
|
+
hidden: boolean;
|
|
7
|
+
width?: string | number | null;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
sortable?: boolean | null;
|
|
10
|
+
sort?: ((a: any, b: any) => number) | null;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
filterable?: boolean | null;
|
|
13
|
+
fixedFilters?: { value: any, text: string }[] | null;
|
|
14
|
+
methodFilter?: ((value: any, item: any) => boolean) | null;
|
|
15
|
+
filter?: ((value: any, search: string, item: any) => boolean) | null;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
innerValue?: ((value: any) => any) | null;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// Should not be set directly !
|
|
20
|
+
slotName?: string | null;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface FSDataTableFilter {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
text: string;
|
|
25
|
+
value: string;
|
|
26
|
+
hidden: boolean;
|
|
27
|
+
filter?: ((value: any, property: any, item: any) => boolean) | null;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export interface FSDataTableOrder {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
key: string | null;
|
|
32
|
+
order: "asc" | "desc" | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FSDataTable {
|
|
36
|
+
headers: FSDataTableColumn[];
|
|
37
|
+
sortBy: FSDataTableOrder | null;
|
|
38
|
+
mode: "table" | "iterator";
|
|
39
|
+
rowsPerPage: -1 | 10 | 30;
|
|
40
|
+
filters: { [key: string]: FSDataTableFilter[] };
|
|
41
|
+
page: number;
|
|
33
42
|
}
|
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.
|
|
4
|
+
"version": "0.0.121",
|
|
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.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.121",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.121",
|
|
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": "
|
|
35
|
+
"gitHead": "305cafbeb6046ce65f2b4917b319f4d36ebbcf00"
|
|
36
36
|
}
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
.fs-dialog-mobile {
|
|
2
|
+
& > .v-overlay__content {
|
|
3
|
+
max-height: calc(100% - 40px) !important;
|
|
4
|
+
max-width: 100% !important;
|
|
5
|
+
width: 100% !important;
|
|
6
|
+
margin: 0 !important;
|
|
7
7
|
align-self: flex-end;
|
|
8
|
-
|
|
9
|
-
width: 100vw !important;
|
|
10
|
-
margin: 0px !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.v-overlay__content:has(.fs-dialog) {
|
|
14
|
-
max-height: calc(100vh - 40px) !important;
|
|
15
|
-
width: var(--fs-dialog-width) !important;
|
|
16
|
-
min-width: 35vw !important;
|
|
8
|
+
}
|
|
17
9
|
}
|
|
18
10
|
|
|
19
11
|
.fs-dialog {
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
& > .v-overlay__content {
|
|
13
|
+
max-height: calc(100% - 40px) !important;
|
|
14
|
+
max-width: calc(100% - 40px) !important;
|
|
22
15
|
min-width: 35vw !important;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.fs-dialog-mobile {
|
|
26
|
-
max-height: calc(100vh - 40px) !important;
|
|
27
|
-
width: 100vw !important;
|
|
16
|
+
width: fit-content !important;
|
|
17
|
+
}
|
|
28
18
|
}
|