@dative-gpi/foundation-shared-components 1.0.137-widgetextensions2 → 1.0.138
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/FSChipGroup.vue +69 -0
- package/package.json +4 -4
- package/tools/index.ts +1 -0
- package/tools/reportsTools.ts +38 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSWrapGroup
|
|
3
|
+
v-if="$props.variant === 'wrap'"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
>
|
|
6
|
+
<FSChip
|
|
7
|
+
v-for="(label, index) in $props.labels"
|
|
8
|
+
:key="index"
|
|
9
|
+
:variant="$props.chipVariant"
|
|
10
|
+
:color="$props.color"
|
|
11
|
+
:label="label"
|
|
12
|
+
/>
|
|
13
|
+
<slot />
|
|
14
|
+
</FSWrapGroup>
|
|
15
|
+
<FSSlideGroup
|
|
16
|
+
v-if="$props.variant === 'slide'"
|
|
17
|
+
v-bind="$attrs"
|
|
18
|
+
>
|
|
19
|
+
<FSChip
|
|
20
|
+
v-for="(label, index) in $props.labels"
|
|
21
|
+
:key="index"
|
|
22
|
+
:variant="$props.chipVariant"
|
|
23
|
+
:color="$props.color"
|
|
24
|
+
:label="label"
|
|
25
|
+
/>
|
|
26
|
+
<slot />
|
|
27
|
+
</FSSlideGroup>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import { defineComponent, type PropType } from "vue";
|
|
32
|
+
|
|
33
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
34
|
+
|
|
35
|
+
import FSSlideGroup from "./FSSlideGroup.vue";
|
|
36
|
+
import FSWrapGroup from "./FSWrapGroup.vue";
|
|
37
|
+
import FSChip from "./FSChip.vue";
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
name: "FSChipGroup",
|
|
41
|
+
components: {
|
|
42
|
+
FSSlideGroup,
|
|
43
|
+
FSWrapGroup,
|
|
44
|
+
FSChip
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
labels: {
|
|
48
|
+
type: Array as PropType<string[]>,
|
|
49
|
+
required: false,
|
|
50
|
+
default: () => []
|
|
51
|
+
},
|
|
52
|
+
variant: {
|
|
53
|
+
type: String as PropType<"wrap" | "slide">,
|
|
54
|
+
required: false,
|
|
55
|
+
default: "wrap"
|
|
56
|
+
},
|
|
57
|
+
chipVariant: {
|
|
58
|
+
type: String as PropType<"standard" | "full" | "borderless">,
|
|
59
|
+
required: false,
|
|
60
|
+
default: "full"
|
|
61
|
+
},
|
|
62
|
+
color: {
|
|
63
|
+
type: String as PropType<ColorBase>,
|
|
64
|
+
required: false,
|
|
65
|
+
default: ColorEnum.Light
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
</script>
|
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.
|
|
4
|
+
"version": "1.0.138",
|
|
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.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.138",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.138"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ec1370eef99afdec2bd4425c7010c1012c23563e"
|
|
39
39
|
}
|
package/tools/index.ts
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
|
+
import { ColorEnum } from "../models";
|
|
3
|
+
import { JobState } from "@dative-gpi/foundation-shared-domain/enums";
|
|
4
|
+
|
|
5
|
+
const { $tr } = useTranslationsProvider();
|
|
6
|
+
|
|
7
|
+
export const getColorByState = (state: number | JobState | undefined) => {
|
|
8
|
+
switch (state) {
|
|
9
|
+
case JobState.Succeeded:
|
|
10
|
+
return ColorEnum.Success;
|
|
11
|
+
case JobState.Failed:
|
|
12
|
+
return ColorEnum.Error;
|
|
13
|
+
default:
|
|
14
|
+
return ColorEnum.Primary;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const getIconByState = (state: number | JobState | undefined) => {
|
|
19
|
+
switch (state) {
|
|
20
|
+
case JobState.Succeeded:
|
|
21
|
+
return 'mdi-check-circle-outline';
|
|
22
|
+
case JobState.Failed:
|
|
23
|
+
return 'mdi-alert-circle-outline';
|
|
24
|
+
default:
|
|
25
|
+
return 'mdi-alert-circle-outline';
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const getLabelByState = (state: number | JobState | undefined) => {
|
|
30
|
+
switch (state) {
|
|
31
|
+
case JobState.Succeeded:
|
|
32
|
+
return $tr('ui.common.success', 'Success');
|
|
33
|
+
case JobState.Failed:
|
|
34
|
+
return $tr('ui.common.error', 'Error');
|
|
35
|
+
default:
|
|
36
|
+
return $tr('ui.common.executed', 'Executed');
|
|
37
|
+
}
|
|
38
|
+
};
|