@dative-gpi/foundation-shared-components 1.0.137-override-widgets → 1.0.137-reportV2

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.
@@ -50,7 +50,6 @@
50
50
  v-if="$props.description"
51
51
  class="fs-checkbox-description"
52
52
  font="text-overline"
53
- :lineClamp="2"
54
53
  :style="style"
55
54
  >
56
55
  {{ $props.description }}
@@ -50,7 +50,6 @@
50
50
  v-if="$props.description"
51
51
  class="fs-radio-description"
52
52
  font="text-overline"
53
- :lineClamp="2"
54
53
  :style="style"
55
54
  >
56
55
  {{ $props.description }}
@@ -35,7 +35,7 @@
35
35
  :elevation="0"
36
36
  :tickSize="4"
37
37
  :modelValue="$props.modelValue ?? undefined"
38
- @update:modelValue="$emit('update:modelValue', $event)"
38
+ @update:modelValue="(value) => $emit('update:modelValue', value)"
39
39
  v-bind="$attrs"
40
40
  >
41
41
  <template
@@ -55,7 +55,6 @@
55
55
  v-if="$props.description"
56
56
  class="fs-slider-description"
57
57
  font="text-overline"
58
- :lineClamp="2"
59
58
  :style="style"
60
59
  >
61
60
  {{ $props.description }}
@@ -1,25 +1,29 @@
1
1
  <template>
2
- <FSCol
2
+ <FSRow
3
+ width="hug"
4
+ align="top-left"
5
+ gap="16px"
3
6
  padding="8px 0px"
7
+ :wrap="false"
4
8
  >
5
- <FSRow
6
- gap="16px"
7
- :wrap="false"
8
- >
9
- <v-switch
10
- v-if="variant == 'left'"
11
- class="fs-switch"
12
- hide-details
13
- inset
14
- :validateOn="validateOn"
15
- :rules="$props.rules"
16
- :ripple="false"
17
- :style="style"
18
- :modelValue="$props.modelValue"
19
- @update:modelValue="onToggle"
20
- v-bind="$attrs"
21
- />
22
- <FSCol>
9
+ <v-switch
10
+ v-if="variant == 'left'"
11
+ class="fs-switch"
12
+ hide-details
13
+ inset
14
+ :validateOn="validateOn"
15
+ :rules="$props.rules"
16
+ :ripple="false"
17
+ :style="style"
18
+ :modelValue="$props.modelValue"
19
+ @update:modelValue="onToggle"
20
+ v-bind="$attrs"
21
+ />
22
+ <slot>
23
+ <FSCol
24
+ width="hug"
25
+ v-if="$props.label || $props.description || $slots.description"
26
+ >
23
27
  <FSSpan
24
28
  v-if="$props.label"
25
29
  class="fs-switch-label"
@@ -37,31 +41,33 @@
37
41
  class="fs-switch-description"
38
42
  font="text-overline"
39
43
  :style="style"
40
- :lineClamp="2"
41
44
  >
42
45
  {{ $props.description }}
43
46
  </FSSpan>
44
47
  </slot>
45
- </FSCol>
46
- <FSRow
47
- v-if="variant == 'right'"
48
- align="center-right"
49
- >
50
- <v-switch
51
- class="fs-switch"
52
- hide-details
53
- inset
54
- :validateOn="validateOn"
55
- :rules="$props.rules"
56
- :ripple="false"
57
- :style="style"
58
- :modelValue="$props.modelValue"
59
- @update:modelValue="onToggle"
60
- v-bind="$attrs"
48
+ <slot
49
+ name="footer"
61
50
  />
62
- </FSRow>
51
+ </FSCol>
52
+ </slot>
53
+ <FSRow
54
+ v-if="variant == 'right'"
55
+ align="center-right"
56
+ >
57
+ <v-switch
58
+ class="fs-switch"
59
+ hide-details
60
+ inset
61
+ :validateOn="validateOn"
62
+ :rules="$props.rules"
63
+ :ripple="false"
64
+ :style="style"
65
+ :modelValue="$props.modelValue"
66
+ @update:modelValue="onToggle"
67
+ v-bind="$attrs"
68
+ />
63
69
  </FSRow>
64
- </FSCol>
70
+ </FSRow>
65
71
  </template>
66
72
 
67
73
  <script lang="ts">
@@ -54,7 +54,6 @@
54
54
  v-if="$props.description"
55
55
  class="fs-base-field-description"
56
56
  font="text-overline"
57
- :lineClamp="2"
58
57
  >
59
58
  {{ $props.description }}
60
59
  </FSSpan>
@@ -14,20 +14,18 @@
14
14
  :wrap="false"
15
15
  >
16
16
  <FSSelectField
17
- :editable="$props.editable"
18
- :items="actualEntityTypes"
19
17
  :hideHeader="true"
20
- :clearable="false"
21
18
  :modelValue="$props.entityType"
22
19
  @update:modelValue="$emit('update:entityType', $event)"
20
+ :items="actualEntityTypes"
21
+ :clearable="false"
23
22
  />
24
23
  <template
25
24
  v-if="itemsCount > 0"
26
25
  >
27
26
  <FSButton
28
- icon="mdi-pencil"
29
27
  :label="$tr('ui.common.edit', 'Edit')"
30
- :editable="$props.editable"
28
+ icon="mdi-pencil"
31
29
  @click="$emit('click:select')"
32
30
  />
33
31
  </template>
@@ -35,9 +33,8 @@
35
33
  v-else
36
34
  >
37
35
  <FSButton
38
- icon="mdi-plus-circle-multiple-outline"
39
36
  :label="$tr('ui.common.select', 'Select')"
40
- :editable="$props.editable"
37
+ icon="mdi-plus-circle-multiple-outline"
41
38
  @click="$emit('click:select')"
42
39
  />
43
40
  </template>
@@ -215,8 +215,7 @@
215
215
  <FSSpan
216
216
  v-if="!readonly && $props.description"
217
217
  class="fs-rich-text-field-description"
218
- font="text-overline"
219
- :lineClamp="2"
218
+ font="text-underline"
220
219
  :style="style"
221
220
  >
222
221
  {{ $props.description }}
@@ -32,9 +32,7 @@
32
32
  >
33
33
  {{ $tr('translate-rich-text-field.translate-in', 'Translate in {0}', language.label) }}
34
34
  </FSSpan>
35
- <FSIcon>
36
- {{ language.icon }}
37
- </FSIcon>
35
+ <FSIcon>{{ language.icon }}</FSIcon>
38
36
  </FSRow>
39
37
  </template>
40
38
  </FSRichTextField>
@@ -97,13 +97,6 @@
97
97
  :imageId="$props.imageId"
98
98
  :width="imageSize"
99
99
  />
100
- <FSIconCard
101
- v-else-if="$props.icon"
102
- backgroundVariant="standard"
103
- :backgroundColor="ColorEnum.Background"
104
- :icon="$props.icon"
105
- :size="imageSize"
106
- />
107
100
  </FSRow>
108
101
  </FSCol>
109
102
  </FSTile>
@@ -115,7 +108,6 @@ import { computed, defineComponent, type PropType } from "vue";
115
108
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
116
109
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
117
110
 
118
- import FSIconCard from "../FSIconCard.vue";
119
111
  import FSImage from "../FSImage.vue";
120
112
  import FSColor from "../FSColor.vue";
121
113
  import FSSpan from "../FSSpan.vue";
@@ -126,7 +118,6 @@ import FSRow from "../FSRow.vue";
126
118
  export default defineComponent({
127
119
  name: "FSGroupTileUI",
128
120
  components: {
129
- FSIconCard,
130
121
  FSImage,
131
122
  FSColor,
132
123
  FSSpan,
@@ -140,10 +131,6 @@ export default defineComponent({
140
131
  required: false,
141
132
  default: null
142
133
  },
143
- icon: {
144
- type: String,
145
- required: false
146
- },
147
134
  label: {
148
135
  type: String as PropType<string | null>,
149
136
  required: false,
@@ -196,7 +183,7 @@ export default defineComponent({
196
183
  });
197
184
 
198
185
  const infoWidth = computed((): string => {
199
- if (!props.imageId && !props.icon) {
186
+ if (!props.imageId) {
200
187
  return "100%";
201
188
  }
202
189
  return `calc(100% - ${imageSize.value}px - 24px)`;
@@ -4,52 +4,48 @@
4
4
  :height="$props.height"
5
5
  :width="$props.width"
6
6
  >
7
- <template
8
- v-if="$props.editable"
7
+ <FSClickable
8
+ v-if="$props.singleSelect"
9
+ padding="12px"
10
+ :variant="variant"
11
+ :color="color"
12
+ :style="style"
13
+ width="100%"
14
+ height="100%"
15
+ @click="() => $emit('update:modelValue', !$props.modelValue)"
16
+ v-bind="$attrs"
9
17
  >
10
- <FSClickable
11
- v-if="$props.singleSelect"
12
- padding="12px"
13
- :variant="variant"
14
- :color="color"
15
- :style="style"
16
- width="100%"
17
- height="100%"
18
- @click="() => $emit('update:modelValue', !$props.modelValue)"
19
- v-bind="$attrs"
20
- >
21
- <slot />
22
- </FSClickable>
23
- <FSClickable
24
- v-else-if="$props.href || $props.to || $attrs.onClick"
18
+ <slot />
19
+ </FSClickable>
20
+ <FSClickable
21
+ v-else-if="$props.href || $props.to || $attrs.onClick"
22
+ variant="background"
23
+ class="fs-tile"
24
+ padding="12px"
25
+ :color="ColorEnum.Background"
26
+ :href="$props.href"
27
+ width="100%"
28
+ height="100%"
29
+ :to="$props.to"
30
+ :style="style"
31
+ v-bind="$attrs"
32
+ >
33
+ <slot />
34
+ <FSCard
35
+ v-if="$props.editable"
36
+ class="fs-tile-checkbox"
25
37
  variant="background"
26
- class="fs-tile"
27
- padding="12px"
28
- :color="ColorEnum.Background"
29
- :href="$props.href"
30
- width="100%"
31
- height="100%"
32
- :to="$props.to"
33
- :style="style"
38
+ :height="['40px', '32px']"
39
+ :width="['40px', '32px']"
40
+ :border="false"
34
41
  v-bind="$attrs"
35
42
  >
36
- <slot />
37
- <FSCard
38
- v-if="$props.editable"
39
- class="fs-tile-checkbox"
40
- variant="background"
41
- :height="['40px', '32px']"
42
- :width="['40px', '32px']"
43
- :border="false"
44
- v-bind="$attrs"
45
- >
46
- <FSCheckbox
47
- :modelValue="$props.modelValue"
48
- @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
49
- />
50
- </FSCard>
51
- </FSClickable>
52
- </template>
43
+ <FSCheckbox
44
+ :modelValue="$props.modelValue"
45
+ @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
46
+ />
47
+ </FSCard>
48
+ </FSClickable>
53
49
  <FSCard
54
50
  v-else
55
51
  variant="background"
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.137-override-widgets",
4
+ "version": "1.0.137-reportV2",
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.137-override-widgets",
14
- "@dative-gpi/foundation-shared-services": "1.0.137-override-widgets"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.137-reportV2",
14
+ "@dative-gpi/foundation-shared-services": "1.0.137-reportV2"
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": "1eff5a41302a336f7298d8198527030c6bbf4e65"
38
+ "gitHead": "57f88a90528a7849e930dbc8eea7223a84c58c9f"
39
39
  }
@@ -55,7 +55,6 @@
55
55
  @import "fs_slide_group.scss";
56
56
  @import "fs_slider.scss";
57
57
  @import "fs_span.scss";
58
- @import "fs_status_rich_card.scss";
59
58
  @import "fs_switch.scss";
60
59
  @import "fs_tag.scss";
61
60
  @import "fs_tabs.scss";
package/tools/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./alertsTools";
2
2
  export * from "./chartsTools";
3
+ export * from "./reportsTools";
3
4
  export * from "./timeRangeTools";
@@ -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
+ };
@@ -1,170 +0,0 @@
1
- <template>
2
- <component
3
- v-if="$props.modelStatus"
4
- class="fs-status-rich-card"
5
- variant="standard"
6
- :is="$attrs.onClick ? FSClickable : FSCard"
7
- :padding="$props.padding"
8
- :height="$props.height"
9
- :width="$props.width"
10
- :color="color"
11
- :style="style"
12
- >
13
- <FSCol
14
- align="center-center"
15
- :gap="$props.gap"
16
- >
17
- <FSRow
18
- align="top-center"
19
- >
20
- <FSIcon
21
- v-if="icon"
22
- >
23
- {{ icon }}
24
- </FSIcon>
25
- <FSText
26
- v-if="value"
27
- font="text-button"
28
- >
29
- {{ value }}
30
- </FSText>
31
- </FSRow>
32
- <FSText
33
- font="text-overline"
34
- align="center"
35
- :lineClamp="$props.titleClamp"
36
- >
37
- {{ title }}
38
- </FSText>
39
- <slot
40
- name="footer"
41
- v-bind="{ color }"
42
- />
43
- </FSCol>
44
- <div
45
- class="fs-status-rich-card-corner"
46
- >
47
- <slot
48
- name="corner"
49
- v-bind="{ color }"
50
- />
51
- </div>
52
- </component>
53
- </template>
54
-
55
- <script lang="ts">
56
- import { computed, defineComponent, type PropType, type StyleValue } from "vue";
57
-
58
- import { ColorEnum, type FSDeviceStatusGroup, type FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
59
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
60
-
61
- import FSClickable from "../FSClickable.vue";
62
- import FSCard from "../FSCard.vue";
63
- import FSIcon from "../FSChip.vue";
64
- import FSText from "../FSText.vue";
65
- import FSCol from "../FSCol.vue";
66
-
67
- export default defineComponent({
68
- name: "FSStatusRichCard",
69
- components: {
70
- FSClickable,
71
- FSCard,
72
- FSIcon,
73
- FSText,
74
- FSCol
75
- },
76
- props: {
77
- height: {
78
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
79
- required: false,
80
- default: "100px"
81
- },
82
- width: {
83
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
84
- required: false,
85
- default: "160px"
86
- },
87
- padding: {
88
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
89
- required: false,
90
- default: "12px"
91
- },
92
- gap: {
93
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
94
- required: false,
95
- default: "8px"
96
- },
97
- title: {
98
- type: [String, null] as PropType<string | null>,
99
- required: false,
100
- default: null
101
- },
102
- titleClamp: {
103
- type: Number,
104
- required: false,
105
- default: 2
106
- },
107
- color: {
108
- type: [String, null] as PropType<string | null>,
109
- required: false,
110
- default: null
111
- },
112
- fillBackground: {
113
- type: Boolean,
114
- required: false,
115
- default: false
116
- },
117
- modelStatus: {
118
- type: Object as PropType<FSModelStatus | undefined>,
119
- required: true
120
- },
121
- statusGroup: {
122
- type: Object as PropType<FSDeviceStatusGroup | undefined>,
123
- required: true
124
- }
125
- },
126
- setup(props) {
127
- const { getColors } = useColors();
128
-
129
- const color = computed((): string => {
130
- return props.color ?? props.statusGroup?.color ?? props.modelStatus?.colorDefault ?? ColorEnum.Primary;
131
- });
132
-
133
- const icon = computed((): string | null => {
134
- return props.statusGroup?.icon ?? props.modelStatus?.iconDefault ?? null;
135
- });
136
-
137
- const title = computed((): string => {
138
- return props.title ?? props.modelStatus?.label;
139
- });
140
-
141
- const value = computed((): string | null => {
142
- if (props.statusGroup?.label) {
143
- return props.statusGroup.label;
144
- }
145
- if (props.statusGroup?.value && !isNaN(parseFloat(props.statusGroup?.value))) {
146
- return `${parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 })} ${props.statusGroup.unit}`;
147
- }
148
- if (props.statusGroup?.value) {
149
- return `${props.statusGroup?.value} ${props.statusGroup?.unit}`;
150
- }
151
- return null;
152
- });
153
-
154
- const style = computed((): StyleValue => ({
155
- "--fs-status-rich-card-background-color": props.fillBackground ? getColors(color.value).light : "transparent",
156
- "--fs-status-rich-card-border-color": props.fillBackground ? getColors(color.value).base : getColors(ColorEnum.Light).dark
157
- }));
158
-
159
- return {
160
- FSClickable,
161
- FSCard,
162
- color,
163
- style,
164
- title,
165
- value,
166
- icon
167
- };
168
- }
169
- });
170
- </script>
@@ -1,13 +0,0 @@
1
- .fs-status-rich-card {
2
- position: relative;
3
- flex-grow: 1;
4
- background-color: var(--fs-status-rich-card-background-color);
5
- border-color: var(--fs-status-rich-card-border-color);
6
- }
7
-
8
- .fs-status-rich-card-corner {
9
- position: absolute;
10
- display: flex;
11
- right: 2px;
12
- top: 2px;
13
- }