@dative-gpi/foundation-core-components 0.0.220 → 0.0.222

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,50 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.aggregation-type','Aggregation')"
4
+ :items="aggregationTypeItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {AggregationType} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import {aggregationTypeLabel, getEnumEntries} from "../../utils";
16
+
17
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue : {
25
+ type: Number as PropType<AggregationType>,
26
+ required: false
27
+ },
28
+ label : {
29
+ type: String,
30
+ required: false
31
+ }
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup() {
35
+
36
+ const aggregationTypeItems = computed(()=>{
37
+ return getEnumEntries(AggregationType).map((f)=>{
38
+ return {
39
+ id: f.value,
40
+ label: aggregationTypeLabel(f.value)
41
+ }
42
+ })
43
+ });
44
+
45
+ return {
46
+ aggregationTypeItems
47
+ }
48
+ }
49
+ })
50
+ </script>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <FSToggleSet
3
+ :hideHeader="true"
4
+ :values="axisTypeItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {AxisType} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import {axisTypeLabel, getEnumEntries} from "../../utils";
16
+
17
+ import FSToggleSet from "@dative-gpi/foundation-shared-components/components/FSToggleSet.vue";
18
+
19
+
20
+ export default defineComponent({
21
+ components: {
22
+ FSToggleSet
23
+ },
24
+ props: {
25
+ modelValue: {
26
+ type: Number as PropType<AxisType>,
27
+ required: false
28
+ }
29
+ },
30
+ emits: ['update:modelValue'],
31
+ setup() {
32
+
33
+ const axisTypeItems = computed(()=>{
34
+ return getEnumEntries(AxisType).map((f)=>{
35
+ return {
36
+ id: f.value,
37
+ label: axisTypeLabel(f.value)
38
+ }
39
+ })
40
+ });
41
+
42
+ return {
43
+ axisTypeItems
44
+ }
45
+ }
46
+ })
47
+ </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <FSAutocompleteField
3
+ :label="label ?? $tr('ui.common.data-category', 'Data category')"
4
+ :items="toggleDataCategories"
5
+ :modelValue="modelValue"
6
+ :toggleSet="toggleDataCategories.length < 5"
7
+ @update:modelValue="$emit('update:modelValue', $event);"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import { computed, defineComponent, watch } from "vue";
13
+
14
+ import {useDataCategories} from "@dative-gpi/foundation-core-services/composables";
15
+
16
+ import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
17
+
18
+ export default defineComponent({
19
+ components: {
20
+ FSAutocompleteField
21
+ },
22
+ props:{
23
+ modelValue: {
24
+ type: String,
25
+ required: false
26
+ },
27
+ modelId: {
28
+ type: String,
29
+ required: false,
30
+ },
31
+ label: {
32
+ type: String,
33
+ required: false
34
+ },
35
+ },
36
+ emits: ['update:modelValue'],
37
+ setup(props) {
38
+ const {getMany : fetchdataCategories, entities : dataCategories} = useDataCategories()
39
+
40
+ const toggleDataCategories = computed(()=>{
41
+ return dataCategories.value.map((d) => {
42
+ return {
43
+ id: d.id,
44
+ label: d.label
45
+ }
46
+ })
47
+ })
48
+
49
+ watch(() => props.modelId, () => {
50
+ fetchdataCategories({modelId: props.modelId})
51
+ }, {immediate: true})
52
+
53
+
54
+ return {
55
+ toggleDataCategories,
56
+ dataCategories
57
+ }
58
+ }
59
+ })
60
+
61
+ </script>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <FSAutocompleteField
3
+ :label="label ?? $tr('ui.common.data-definition', 'Data')"
4
+ :items="toggleDataDefinitions"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, watch } from "vue";
12
+
13
+ import {useDataDefinitions} from "@dative-gpi/foundation-core-services/composables";
14
+
15
+ import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
16
+
17
+ export default defineComponent({
18
+ components: {
19
+ FSAutocompleteField
20
+ },
21
+ props:{
22
+ modelValue: {
23
+ type: String,
24
+ required: false
25
+ },
26
+ modelId: {
27
+ type: String,
28
+ required: false,
29
+ },
30
+ dataCategoryId: {
31
+ type: String,
32
+ required: false,
33
+ },
34
+ label: {
35
+ type: String,
36
+ required: false
37
+ },
38
+
39
+ },
40
+ emits: ['update:modelValue'],
41
+ setup(props) {
42
+
43
+ const {getMany : fetchDataDefinitions, entities : dataDefinitions} = useDataDefinitions()
44
+
45
+ const toggleDataDefinitions = computed(()=>{
46
+ return dataDefinitions.value.map((d) => {
47
+ return {
48
+ id: d.id,
49
+ label: d.label
50
+ }
51
+ })
52
+ })
53
+
54
+ watch(() => [props.modelId, props.dataCategoryId], async () => {
55
+ await fetchDataDefinitions({modelsIds: props.modelId ? [props.modelId] : undefined, dataCategoryId: props.dataCategoryId})
56
+ }, {immediate: true})
57
+
58
+ return {
59
+ toggleDataDefinitions,
60
+ dataDefinitions
61
+ }
62
+ }
63
+ })
64
+
65
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.display-as','Display as')"
4
+ :items="displayAsItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {DisplayAs} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {displayAsLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<DisplayAs>,
26
+ required: false
27
+ },
28
+ label: {
29
+ type: String,
30
+ required: false
31
+ }
32
+
33
+ },
34
+ emits: ['update:modelValue'],
35
+ setup() {
36
+
37
+ const displayAsItems = computed(()=>{
38
+ return getEnumEntries(DisplayAs).map((f)=>{
39
+ return {
40
+ id: f.value,
41
+ label: displayAsLabel(f.value)
42
+ }
43
+ })
44
+ });
45
+
46
+ return {
47
+ displayAsItems,
48
+ }
49
+ }
50
+ })
51
+ </script>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <FSAutocompleteField
3
+ :label="label ?? $tr('ui.common.filter-type','Filter type')"
4
+ :toggleSet="true"
5
+ :items="filterTypeItems"
6
+ :modelValue="modelValue"
7
+ @update:modelValue="$emit('update:modelValue', $event)"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import { computed, defineComponent, type PropType } from "vue";
13
+
14
+ import {FilterType} from "@dative-gpi/foundation-core-domain/models";
15
+
16
+ import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
17
+
18
+ import {filterTypeLabel, getEnumEntries} from "../../utils";
19
+
20
+ export default defineComponent({
21
+ components: {
22
+ FSAutocompleteField
23
+ },
24
+ props: {
25
+ modelValue: {
26
+ type: Number as PropType<FilterType>,
27
+ required: false,
28
+ default : FilterType.None
29
+ },
30
+ label: {
31
+ type: String,
32
+ required: false
33
+ }
34
+ },
35
+ emits: ['update:modelValue'],
36
+ setup() {
37
+
38
+ const filterTypeItems = computed(()=>{
39
+ return getEnumEntries(FilterType).map((f)=>{
40
+ return {
41
+ id: f.value,
42
+ label: filterTypeLabel(f.value)
43
+ }
44
+ })
45
+ });
46
+
47
+ return {
48
+ filterTypeItems
49
+ }
50
+ }
51
+ })
52
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.heat-rule','Heat rule')"
4
+ :items="heatmapRuleItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {HeatmapRule} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {heatmapRuleLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<HeatmapRule>,
26
+ required: false
27
+ },
28
+ label: {
29
+ type: String,
30
+ required: false
31
+ }
32
+
33
+ },
34
+ emits: ['update:modelValue'],
35
+ setup() {
36
+
37
+ const heatmapRuleItems = computed(()=>{
38
+ return getEnumEntries(HeatmapRule).map((f)=>{
39
+ return {
40
+ id: f.value,
41
+ label: heatmapRuleLabel(f.value)
42
+ }
43
+ })
44
+ });
45
+
46
+ return {
47
+ heatmapRuleItems
48
+ }
49
+ }
50
+ })
51
+ </script>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <FSAutocompleteField
3
+ :label="label ?? $tr('ui.common.model', 'Model')"
4
+ :items="modelItems"
5
+ :toggleSet="modelItems.length < 5"
6
+ :modelValue="modelValue"
7
+ @update:modelValue="$emit('update:modelValue', $event)"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import { computed, defineComponent, onMounted } from "vue";
13
+
14
+ import {useModels} from "@dative-gpi/foundation-core-services/composables";
15
+
16
+ import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
17
+
18
+ export default defineComponent({
19
+ components: {
20
+ FSAutocompleteField
21
+ },
22
+ props:{
23
+ modelValue: {
24
+ type: String,
25
+ required: false
26
+ },
27
+ label: {
28
+ type: String,
29
+ required: false
30
+ }
31
+ },
32
+ emits: ['update:modelValue'],
33
+ setup(){
34
+ const {getMany : fetchModels, entities : models} = useModels()
35
+
36
+ const modelItems = computed(()=>{
37
+ return models.value.map((d) => {
38
+ return {
39
+ id: d.id,
40
+ label: d.label
41
+ }
42
+ })
43
+ })
44
+
45
+ onMounted(() => {
46
+ fetchModels()
47
+ })
48
+
49
+ return {
50
+ modelItems,
51
+ }
52
+ }
53
+ })
54
+
55
+ </script>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.operation-on','Operation on')"
4
+ :items="operationOnItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {OperationOn} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {operationOnLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<OperationOn>,
26
+ required: false
27
+ },
28
+ label : {
29
+ type: String,
30
+ required: false
31
+ }
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup() {
35
+
36
+ const operationOnItems = computed(()=>{
37
+ return getEnumEntries(OperationOn).map((f)=>{
38
+ return {
39
+ id: f.value,
40
+ label: operationOnLabel(f.value)
41
+ }
42
+ })
43
+ });
44
+
45
+ return {
46
+ operationOnItems
47
+ }
48
+ }
49
+ })
50
+ </script>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.planning-type','Planning type')"
4
+ :items="planningTypeItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {PlanningType} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {planningTypeLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<PlanningType>,
26
+ required: false
27
+ },
28
+ label: {
29
+ type: String,
30
+ required: false
31
+ }
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup() {
35
+
36
+ const planningTypeItems = computed(()=>{
37
+ return getEnumEntries(PlanningType).map((f)=>{
38
+ return {
39
+ id: f.value,
40
+ label: planningTypeLabel(f.value)
41
+ }
42
+ })
43
+ });
44
+
45
+ return {
46
+ planningTypeItems
47
+ }
48
+ }
49
+ })
50
+ </script>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.plot-per','Plot per')"
4
+ :items="plotPerItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {PlotPer} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {plotPerLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<PlotPer>,
26
+ required: false
27
+ },
28
+ label: {
29
+ type: String,
30
+ required: false
31
+ }
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup() {
35
+
36
+ const plotPerItems = computed(()=>{
37
+ return getEnumEntries(PlotPer).map((f)=>{
38
+ return {
39
+ id: f.value,
40
+ label: plotPerLabel(f.value)
41
+ }
42
+ })
43
+ });
44
+
45
+ return {
46
+ plotPerItems
47
+ }
48
+ }
49
+ })
50
+ </script>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.serie-type','Serie type')"
4
+ :items="serieTypeItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent, type PropType } from "vue";
12
+
13
+ import {SerieType} from "@dative-gpi/foundation-core-domain/models";
14
+
15
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
16
+
17
+ import {serieTypeLabel, getEnumEntries} from "../../utils";
18
+
19
+ export default defineComponent({
20
+ components: {
21
+ FSSelectField
22
+ },
23
+ props: {
24
+ modelValue: {
25
+ type: Number as PropType<SerieType>,
26
+ required: false
27
+ },
28
+ label: {
29
+ type: String,
30
+ required: false
31
+ }
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup() {
35
+
36
+ const serieTypeItems = computed(()=>{
37
+ return getEnumEntries(SerieType).map((f)=>{
38
+ return {
39
+ id: f.value,
40
+ label: serieTypeLabel(f.value)
41
+ }
42
+ })
43
+ });
44
+
45
+ return {
46
+ serieTypeItems
47
+ }
48
+ }
49
+ })
50
+ </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.220",
4
+ "version": "0.0.222",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,11 +10,11 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "0.0.220",
14
- "@dative-gpi/foundation-core-services": "0.0.220",
15
- "@dative-gpi/foundation-shared-components": "0.0.220",
16
- "@dative-gpi/foundation-shared-domain": "0.0.220",
17
- "@dative-gpi/foundation-shared-services": "0.0.220"
13
+ "@dative-gpi/foundation-core-domain": "0.0.222",
14
+ "@dative-gpi/foundation-core-services": "0.0.222",
15
+ "@dative-gpi/foundation-shared-components": "0.0.222",
16
+ "@dative-gpi/foundation-shared-domain": "0.0.222",
17
+ "@dative-gpi/foundation-shared-services": "0.0.222"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -26,5 +26,5 @@
26
26
  "sass": "1.71.1",
27
27
  "sass-loader": "13.3.2"
28
28
  },
29
- "gitHead": "5386c0eed28a035ac9da6a8a00ba7681bc86f942"
29
+ "gitHead": "84398c44d065b454974c48e07f494d6e2c73690a"
30
30
  }
package/utils/charts.ts CHANGED
@@ -1,7 +1,6 @@
1
+ import { AggregationType, AxisType, ChartOrigin, DisplayAs, FilterType, HeatmapRule, OperationOn, PlanningType, PlotPer, SerieType } from "@dative-gpi/foundation-core-domain/models";
1
2
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
3
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
4
- import { ChartOrigin } from "@dative-gpi/foundation-core-domain/models";
3
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
5
4
 
6
5
  const { $tr } = useTranslationsProvider();
7
6
 
@@ -19,4 +18,119 @@ export const chartOriginColor = (type: ChartOrigin): ColorBase => {
19
18
  case ChartOrigin.Organisation: return ColorEnum.Primary;
20
19
  case ChartOrigin.OrganisationType: return ColorEnum.Warning;
21
20
  }
21
+ };
22
+
23
+ export const aggregationTypeLabel = (aggregationType : AggregationType): string => {
24
+ switch (aggregationType) {
25
+ case AggregationType.Sum: return $tr("ui.common.sum", "Sum");
26
+ case AggregationType.Cardinal: return $tr("ui.common.cardinal", "Cardinal");
27
+ case AggregationType.Mean: return $tr("ui.common.cean", "Mean");
28
+ case AggregationType.Median: return $tr("ui.common.median", "Median");
29
+ case AggregationType.First: return $tr("ui.common.first", "First");
30
+ case AggregationType.Last: return $tr("ui.common.last", "Last");
31
+ case AggregationType.Difference: return $tr("ui.common.difference", "Difference");
32
+ case AggregationType.Minimum: return $tr("ui.common.minimum", "Minimum");
33
+ case AggregationType.Maximum: return $tr("ui.common.maximum", "Maximum");
34
+ case AggregationType.Range: return $tr("ui.common.range", "Range");
35
+ default : return $tr("ui.common.none", "None");
36
+ }
37
+ };
38
+
39
+ export const axisTypeLabel = (axisType: AxisType | number): string => {
40
+ switch (axisType) {
41
+ case AxisType.Date: return $tr("ui.common.date", "Date");
42
+ case AxisType.Value: return $tr("ui.common.value", "Value");
43
+ case AxisType.Category: return $tr("ui.common.category", "Category");
44
+ default: return $tr("ui.common.none", "None");
45
+ }
46
+ };
47
+
48
+ export const displayAsLabel = (display: DisplayAs | number): string => {
49
+ switch (display) {
50
+ case DisplayAs.Bars: return $tr("ui.common.bars", "Bars");
51
+ case DisplayAs.Lines: return $tr("ui.common.lines", "Lines");
52
+ case DisplayAs.Points: return $tr("ui.common.point", "Points");
53
+ default: return $tr("ui.common.none", "None");
54
+ }
55
+ };
56
+
57
+ export const filterTypeLabel = (filterType: FilterType | number): string => {
58
+ switch (filterType) {
59
+ case FilterType.Contains: return $tr("ui.common.contains", "contains");
60
+ case FilterType.Different: return "≠";
61
+ case FilterType.EndsWith: return $tr("ui.common.end-width", "end with") ;
62
+ case FilterType.Equal: return "=";
63
+ case FilterType.Less: return "<";
64
+ case FilterType.LessOrEqual: return "≤";
65
+ case FilterType.More: return ">";
66
+ case FilterType.MoreOrEqual: return "≥";
67
+ case FilterType.StartsWith: return $tr("ui.common.starts-with", "start with");
68
+ default: return $tr("ui.common.none", "None");
69
+ }
70
+ };
71
+
72
+ export const heatmapRuleLabel = (heatMap: HeatmapRule | number): string => {
73
+ switch (heatMap) {
74
+ case HeatmapRule.Gradient: return $tr("ui.common.gradient", "Gradient");
75
+ case HeatmapRule.Ranges: return $tr("ui.common.ranges", "Ranges");
76
+ case HeatmapRule.Fixed : return $tr("ui.common.fixed", "Fixed");
77
+ default: return $tr("ui.common.none", "None");
78
+ }
79
+ };
80
+
81
+ export const operationOnLabel = (operationOn: OperationOn | number): string => {
82
+ switch (operationOn) {
83
+ case OperationOn.SameEntity: return $tr("ui.common.same-entity", "Same entity");
84
+ case OperationOn.SameGroup: return $tr("ui.common.same-group", "Same group");
85
+ case OperationOn.SameGroupAndEntity: return $tr("ui.common.same-group-entity", "Same group and entity");
86
+ default: return $tr("ui.common.none", "None");
87
+ }
88
+ };
89
+
90
+ export const planningTypeLabel = (planningType : PlanningType | number): string => {
91
+ switch (planningType) {
92
+ case PlanningType.UntilNext: return $tr("ui.common.until-next", "Until next");
93
+ case PlanningType.ElapsedTime: return $tr("ui.common.elapsed-time", "Elapsed time");
94
+ case PlanningType.SinglePoint: return $tr("ui.common.single-point", "Single point");
95
+ default: return $tr("ui.common.none", "None");
96
+ }
97
+ };
98
+
99
+ export const plotPerLabel = (plotper: PlotPer | number): string => {
100
+ switch (plotper) {
101
+ case PlotPer.SinglePlot: return $tr("ui.common.single-slot", "Single slot");
102
+ case PlotPer.Model: return $tr("ui.common.model", "Model");
103
+ case PlotPer.Group: return $tr("ui.common.group", "Group");
104
+ case PlotPer.Location: return $tr("ui.common.location", "Location");
105
+ case PlotPer.Device: return $tr("ui.common.device", "Device");
106
+ default: return $tr("ui.common.none", "None");
107
+ }
108
+ };
109
+
110
+ export const serieTypeLabel = (serieType : SerieType): string => {
111
+ switch (serieType) {
112
+ case SerieType.Lines: return $tr("ui.common.lines", "Lines");
113
+ case SerieType.Area: return $tr("ui.common.area", "Area");
114
+ case SerieType.Range: return $tr("ui.common.range", "Range");
115
+ case SerieType.Histogram: return $tr("ui.common.histogram", "Histogram");
116
+ case SerieType.Operation: return $tr("ui.common.operation", "Operation");
117
+ case SerieType.Planning: return $tr("ui.common.planning", "Planning");
118
+ case SerieType.ScatterPlot: return $tr("ui.common.scatter-plot", "Scatter plot");
119
+ case SerieType.Top: return $tr("ui.common.top", "Top");
120
+ case SerieType.Bars: return $tr("ui.common.bars", "Bars");
121
+ case SerieType.StackedBars: return $tr("ui.common.stacked-bars", "Stacked bars");
122
+ case SerieType.Pie: return $tr("ui.common.pie", "Pie");
123
+ case SerieType.Heatmap: return $tr('ui.common.heatmap', 'Heatmap');
124
+ case SerieType.Slider: return $tr("ui.common.slider", "Slider");
125
+ case SerieType.Gauge: return $tr("ui.common.gauge", "Gauge");
126
+ case SerieType.ScoreCard: return $tr("ui.common.score-card", "Score card");
127
+ case SerieType.Table: return $tr("ui.common.table", "Table");
128
+ default: return "";
129
+ }
130
+ };
131
+
132
+ export const getEnumEntries = (e: any) => {
133
+ return Object.keys(e)
134
+ .filter(key => isNaN(Number(key)))
135
+ .map(key => ({key : key, value : e[key]}));
22
136
  };