@dative-gpi/foundation-shared-components 1.0.124 → 1.0.126-fix-imports
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/FSWindow.vue +92 -3
- package/components/agenda/FSAgendaHorizontalEvent.vue +14 -4
- package/components/fields/FSEntityFieldUI.vue +7 -7
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +1 -1
- package/package.json +4 -4
- package/styles/components/fs_agenda_event.scss +1 -1
- package/tools/chartsTools.ts +3 -3
- package/utils/sort.ts +2 -2
- package/utils/time.ts +12 -12
package/components/FSWindow.vue
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<template
|
|
3
|
+
v-if="noMatch"
|
|
4
|
+
>
|
|
5
|
+
<slot
|
|
6
|
+
name="error"
|
|
7
|
+
>
|
|
8
|
+
<FSRow
|
|
9
|
+
padding="16px"
|
|
10
|
+
:width="$props.width"
|
|
11
|
+
>
|
|
12
|
+
<FSCol
|
|
13
|
+
align="center-center"
|
|
14
|
+
gap="16px"
|
|
15
|
+
>
|
|
16
|
+
<FSCol
|
|
17
|
+
align="center-center"
|
|
18
|
+
>
|
|
19
|
+
<FSIcon
|
|
20
|
+
size="42px"
|
|
21
|
+
:color="ColorEnum.Error"
|
|
22
|
+
>
|
|
23
|
+
mdi-alert-outline
|
|
24
|
+
</FSIcon>
|
|
25
|
+
<FSText
|
|
26
|
+
font="text-h3"
|
|
27
|
+
>
|
|
28
|
+
{{ $tr("window.no-access-title", "Nothing to see here") }}
|
|
29
|
+
</FSText>
|
|
30
|
+
</FSCol>
|
|
31
|
+
<FSText
|
|
32
|
+
:lineClamp="2"
|
|
33
|
+
>
|
|
34
|
+
{{ $tr("window.no-access-body", "It seems you either do not have access to this content, or there is nothing to display here") }}
|
|
35
|
+
</FSText>
|
|
36
|
+
<FSButton
|
|
37
|
+
:label="$tr('window.no-access-button', 'Go back')"
|
|
38
|
+
:color="ColorEnum.Primary"
|
|
39
|
+
@click="goBack"
|
|
40
|
+
/>
|
|
41
|
+
</FSCol>
|
|
42
|
+
</FSRow>
|
|
43
|
+
</slot>
|
|
44
|
+
</template>
|
|
2
45
|
<v-window
|
|
3
46
|
class="fs-window"
|
|
47
|
+
ref="windowRef"
|
|
4
48
|
:touch="false"
|
|
5
49
|
:style="style"
|
|
6
50
|
:modelValue="$props.modelValue"
|
|
7
|
-
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
51
|
v-bind="$attrs"
|
|
9
52
|
>
|
|
10
53
|
<template
|
|
@@ -35,8 +78,23 @@ import { computed, defineComponent, type PropType, ref, type StyleValue, type VN
|
|
|
35
78
|
import { useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
36
79
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
37
80
|
|
|
81
|
+
import { ColorEnum } from "../models";
|
|
82
|
+
|
|
83
|
+
import FSButton from "./FSButton.vue";
|
|
84
|
+
import FSCard from "./FSCard.vue";
|
|
85
|
+
import FSIcon from "./FSIcon.vue";
|
|
86
|
+
import FSText from "./FSText.vue";
|
|
87
|
+
import FSRow from "./FSRow.vue";
|
|
88
|
+
|
|
38
89
|
export default defineComponent({
|
|
39
90
|
name: "FSWindow",
|
|
91
|
+
components: {
|
|
92
|
+
FSButton,
|
|
93
|
+
FSCard,
|
|
94
|
+
FSIcon,
|
|
95
|
+
FSText,
|
|
96
|
+
FSRow
|
|
97
|
+
},
|
|
40
98
|
props: {
|
|
41
99
|
width: {
|
|
42
100
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
@@ -54,11 +112,13 @@ export default defineComponent({
|
|
|
54
112
|
default: 0
|
|
55
113
|
}
|
|
56
114
|
},
|
|
57
|
-
emits: ["update:modelValue"],
|
|
58
|
-
setup(props) {
|
|
115
|
+
emits: ["update:modelValue", "error"],
|
|
116
|
+
setup(props, { emit }) {
|
|
59
117
|
const { slots, getChildren } = useSlots();
|
|
60
118
|
|
|
61
119
|
delete slots.default;
|
|
120
|
+
|
|
121
|
+
const windowRef = ref<any | null>(null);
|
|
62
122
|
|
|
63
123
|
const showOverflow = ref(true);
|
|
64
124
|
const overflowTimeout = ref<NodeJS.Timeout | null>(null);
|
|
@@ -84,10 +144,39 @@ export default defineComponent({
|
|
|
84
144
|
}, 560);
|
|
85
145
|
});
|
|
86
146
|
|
|
147
|
+
const noMatch = computed(() => {
|
|
148
|
+
if (!windowRef.value) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VWindow/VWindow.tsx
|
|
153
|
+
// https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/group.ts#L161
|
|
154
|
+
const group = windowRef.value.group;
|
|
155
|
+
return !group.items.value.find((item: any) => item.value === props.modelValue);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const goBack = (): void => {
|
|
159
|
+
if (!windowRef.value) {
|
|
160
|
+
emit("error");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const group = windowRef.value.group;
|
|
165
|
+
if (!group.items.value.length) {
|
|
166
|
+
emit("error");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
emit("update:modelValue", group.items.value[0].value);
|
|
170
|
+
};
|
|
171
|
+
|
|
87
172
|
return {
|
|
173
|
+
ColorEnum,
|
|
174
|
+
windowRef,
|
|
175
|
+
noMatch,
|
|
88
176
|
slots,
|
|
89
177
|
style,
|
|
90
178
|
getChildren,
|
|
179
|
+
goBack,
|
|
91
180
|
value
|
|
92
181
|
};
|
|
93
182
|
}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
name="default"
|
|
45
45
|
:label="label"
|
|
46
46
|
:icon="icon"
|
|
47
|
-
:iconBis="iconBis"
|
|
47
|
+
:iconBis="endToday ? iconBis : null"
|
|
48
48
|
:timeStart="epochToShortTimeOnlyFormat($props.start)"
|
|
49
49
|
:timeEnd="epochToShortTimeOnlyFormat($props.end)"
|
|
50
50
|
:variant="$props.variant"
|
|
@@ -120,12 +120,20 @@ export default defineComponent({
|
|
|
120
120
|
return dayEnd.value - props.dayStart;
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
const startToday = computed(() => {
|
|
124
|
+
return props.start >= props.dayStart;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const endToday = computed(() => {
|
|
128
|
+
return props.end <= dayEnd.value;
|
|
129
|
+
});
|
|
130
|
+
|
|
123
131
|
const dayDurationOffset = computed(() => {
|
|
124
132
|
return dayDuration.value - dayToMillisecond(1);
|
|
125
133
|
});
|
|
126
134
|
|
|
127
135
|
const leftPosition = computed(() => {
|
|
128
|
-
if (
|
|
136
|
+
if (!startToday.value) {
|
|
129
137
|
return 0;
|
|
130
138
|
}
|
|
131
139
|
return millisecondToDay(props.start - props.dayStart - dayDurationOffset.value) * 100;
|
|
@@ -136,10 +144,10 @@ export default defineComponent({
|
|
|
136
144
|
let end = props.end - dayDurationOffset.value;
|
|
137
145
|
if(props.variant === 'current' && dayEnd.value > props.now) {
|
|
138
146
|
end = props.now;
|
|
139
|
-
} else if (
|
|
147
|
+
} else if (!endToday.value) {
|
|
140
148
|
end = dayEnd.value - dayDurationOffset.value;
|
|
141
149
|
}
|
|
142
|
-
if (
|
|
150
|
+
if (!startToday.value) {
|
|
143
151
|
start = props.dayStart;
|
|
144
152
|
}
|
|
145
153
|
|
|
@@ -150,12 +158,14 @@ export default defineComponent({
|
|
|
150
158
|
const style = computed((): StyleValue => {
|
|
151
159
|
return {
|
|
152
160
|
'--fs-agenda-event-left': `${leftPosition.value}%`,
|
|
161
|
+
'--fs-agenda-event-border-width': startToday.value ? '3px' : '0px',
|
|
153
162
|
};
|
|
154
163
|
});
|
|
155
164
|
|
|
156
165
|
return {
|
|
157
166
|
style,
|
|
158
167
|
width,
|
|
168
|
+
endToday,
|
|
159
169
|
epochToShortTimeOnlyFormat
|
|
160
170
|
};
|
|
161
171
|
}
|
|
@@ -205,31 +205,31 @@ export default defineComponent({
|
|
|
205
205
|
const items = [
|
|
206
206
|
{
|
|
207
207
|
id: EntityType.Model,
|
|
208
|
-
label: $tr("ui.
|
|
208
|
+
label: $tr("ui.common.models", "Models")
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
id: EntityType.Group,
|
|
212
|
-
label: $tr("ui.
|
|
212
|
+
label: $tr("ui.common.groups", "Groups")
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
id: EntityType.Location,
|
|
216
|
-
label: $tr("ui.
|
|
216
|
+
label: $tr("ui.common.locations", "Locations")
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
id: EntityType.Device,
|
|
220
|
-
label: $tr("ui.
|
|
220
|
+
label: $tr("ui.common.devices", "Devices")
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
id: EntityType.User,
|
|
224
|
-
label: $tr("ui.
|
|
224
|
+
label: $tr("ui.common.users", "Users")
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
id: EntityType.Dashboard,
|
|
228
|
-
label: $tr("ui.
|
|
228
|
+
label: $tr("ui.common.dashboards", "Dashboards")
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
id: EntityType.Folder,
|
|
232
|
-
label: $tr("ui.
|
|
232
|
+
label: $tr("ui.common.folders", "Folders")
|
|
233
233
|
}
|
|
234
234
|
];
|
|
235
235
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
-
:label="label ?? $tr('
|
|
3
|
+
:label="label ?? $tr('autocomplete.display-as.label','Display as')"
|
|
4
4
|
:items="displayAsItems"
|
|
5
5
|
:modelValue="modelValue"
|
|
6
6
|
@update:modelValue="$emit('update:modelValue', $event)"
|
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.126-fix-imports",
|
|
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.126-fix-imports",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.126-fix-imports"
|
|
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": "a33ad553014a5e4bec951107b73444080b2d7dd5"
|
|
39
39
|
}
|
package/tools/chartsTools.ts
CHANGED
|
@@ -112,7 +112,7 @@ export const displayAsLabel = (display: DisplayAs | number): string => {
|
|
|
112
112
|
switch (display) {
|
|
113
113
|
case DisplayAs.Bars: return $tr("ui.common.bars", "Bars");
|
|
114
114
|
case DisplayAs.Lines: return $tr("ui.common.lines", "Lines");
|
|
115
|
-
case DisplayAs.Points: return $tr("ui.common.
|
|
115
|
+
case DisplayAs.Points: return $tr("ui.common.points", "Points");
|
|
116
116
|
default: return $tr("ui.common.none", "None");
|
|
117
117
|
}
|
|
118
118
|
};
|
|
@@ -179,7 +179,7 @@ export const serieTypeLabel = (serieType: SerieType): string => {
|
|
|
179
179
|
case SerieType.Operation: return $tr("ui.common.operation", "Operation");
|
|
180
180
|
case SerieType.Planning: return $tr("ui.common.planning", "Planning");
|
|
181
181
|
case SerieType.ScatterPlot: return $tr("ui.common.scatter-plot", "Scatter plot");
|
|
182
|
-
case SerieType.Top: return $tr("ui.
|
|
182
|
+
case SerieType.Top: return $tr("ui.serie-type.top", "Top");
|
|
183
183
|
case SerieType.Bars: return $tr("ui.common.bars", "Bars");
|
|
184
184
|
case SerieType.StackedBars: return $tr("ui.common.stacked-bars", "Stacked bars");
|
|
185
185
|
case SerieType.Pie: return $tr("ui.common.pie", "Pie");
|
|
@@ -187,7 +187,7 @@ export const serieTypeLabel = (serieType: SerieType): string => {
|
|
|
187
187
|
case SerieType.Slider: return $tr("ui.common.slider", "Slider");
|
|
188
188
|
case SerieType.Gauge: return $tr("ui.common.gauge", "Gauge");
|
|
189
189
|
case SerieType.ScoreCard: return $tr("ui.common.score-card", "Score card");
|
|
190
|
-
case SerieType.Table: return $tr("ui.
|
|
190
|
+
case SerieType.Table: return $tr("ui.serie-type.table", "Table");
|
|
191
191
|
default: return "";
|
|
192
192
|
}
|
|
193
193
|
};
|
package/utils/sort.ts
CHANGED
package/utils/time.ts
CHANGED
|
@@ -5,13 +5,13 @@ import { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums"
|
|
|
5
5
|
const { $tr } = useTranslationsProvider();
|
|
6
6
|
|
|
7
7
|
export const timeSteps = [
|
|
8
|
-
{ id: TimeUnit.Second, label: $tr("ui.
|
|
9
|
-
{ id: TimeUnit.Minute, label: $tr("ui.
|
|
10
|
-
{ id: TimeUnit.Hour, label: $tr("ui.
|
|
11
|
-
{ id: TimeUnit.Day, label: $tr("ui.
|
|
12
|
-
{ id: TimeUnit.Week, label: $tr("ui.
|
|
13
|
-
{ id: TimeUnit.Month, label: $tr("ui.
|
|
14
|
-
{ id: TimeUnit.Year, label: $tr("ui.
|
|
8
|
+
{ id: TimeUnit.Second, label: $tr("ui.common.second", "Second"), plural: $tr("ui.common.seconds", "Seconds") },
|
|
9
|
+
{ id: TimeUnit.Minute, label: $tr("ui.common.minute", "Minute"), plural: $tr("ui.common.minutes", "Minutes") },
|
|
10
|
+
{ id: TimeUnit.Hour, label: $tr("ui.common.hour", "Hour"), plural: $tr("ui.common.hours", "Hours") },
|
|
11
|
+
{ id: TimeUnit.Day, label: $tr("ui.common.day", "Day"), plural: $tr("ui.common.days", "Days") },
|
|
12
|
+
{ id: TimeUnit.Week, label: $tr("ui.common.week", "Week"), plural: $tr("ui.common.weeks", "Weeks") },
|
|
13
|
+
{ id: TimeUnit.Month, label: $tr("ui.common.month", "Month"), plural: $tr("ui.common.months", "Months") },
|
|
14
|
+
{ id: TimeUnit.Year, label: $tr("ui.common.year", "Year"), plural: $tr("ui.common.years", "Years") },
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
export const timeStepToString = (value: { value: number, unit: TimeUnit } | null): string => {
|
|
@@ -29,11 +29,11 @@ export const timeStepToString = (value: { value: number, unit: TimeUnit } | null
|
|
|
29
29
|
|
|
30
30
|
// TODO : remove everything below this line
|
|
31
31
|
export const timeScale: any[] = [
|
|
32
|
-
{ id: 1, label: $tr("ui.
|
|
33
|
-
{ id: 60, label: $tr("ui.
|
|
34
|
-
{ id: 3600, label: $tr("ui.
|
|
35
|
-
{ id: 86400, label: $tr("ui.
|
|
36
|
-
{ id: 604800, label: $tr("ui.
|
|
32
|
+
{ id: 1, label: $tr("ui.common.second", "Second"), plural: $tr("ui.common.seconds", "Seconds") },
|
|
33
|
+
{ id: 60, label: $tr("ui.common.minute", "Minute"), plural: $tr("ui.common.minutes", "Minutes") },
|
|
34
|
+
{ id: 3600, label: $tr("ui.common.hour", "Hour"), plural: $tr("ui.common.hours", "Hours") },
|
|
35
|
+
{ id: 86400, label: $tr("ui.common.day", "Day"), plural: $tr("ui.common.days", "Days") },
|
|
36
|
+
{ id: 604800, label: $tr("ui.common.week", "Week"), plural: $tr("ui.common.weeks", "Weeks") },
|
|
37
37
|
];
|
|
38
38
|
|
|
39
39
|
export const getTimeScaleIndex = (value: number): number => {
|