@dative-gpi/foundation-shared-components 1.0.126 → 1.0.127
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.
|
@@ -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
|
}
|
|
@@ -73,7 +73,7 @@ export default defineComponent({
|
|
|
73
73
|
|
|
74
74
|
const firstDayOfMonth = computed(() => {
|
|
75
75
|
const date = new Date(props.year, props.month - 1, 1);
|
|
76
|
-
const offset = getMachineOffset();
|
|
76
|
+
const offset = getMachineOffset(date.getTime());
|
|
77
77
|
|
|
78
78
|
date.setTime(date.getTime() + offset);
|
|
79
79
|
|
|
@@ -84,8 +84,7 @@ export default defineComponent({
|
|
|
84
84
|
const day = new Date(firstDayOfMonth.value);
|
|
85
85
|
|
|
86
86
|
const date = startOfWeek(day, { weekStartsOn: 1 });
|
|
87
|
-
|
|
88
|
-
const offset = getMachineOffset();
|
|
87
|
+
const offset = getMachineOffset(date.getTime());
|
|
89
88
|
|
|
90
89
|
date.setTime(date.getTime() + offset);
|
|
91
90
|
|
|
@@ -94,10 +93,9 @@ export default defineComponent({
|
|
|
94
93
|
|
|
95
94
|
const endDayOfMonth = computed(() => {
|
|
96
95
|
const day = new Date(firstDayOfMonth.value);
|
|
97
|
-
|
|
98
|
-
const date = endOfMonth(day);
|
|
99
96
|
|
|
100
|
-
const
|
|
97
|
+
const date = endOfMonth(day);
|
|
98
|
+
const offset = getMachineOffset(date.getTime());
|
|
101
99
|
|
|
102
100
|
date.setTime(date.getTime() + offset);
|
|
103
101
|
|
|
@@ -106,10 +104,9 @@ export default defineComponent({
|
|
|
106
104
|
|
|
107
105
|
const lastSunday = computed(() => {
|
|
108
106
|
const day = new Date(endDayOfMonth.value);
|
|
109
|
-
|
|
110
|
-
const date = endOfWeek(day, { weekStartsOn: 1 });
|
|
111
107
|
|
|
112
|
-
const
|
|
108
|
+
const date = endOfWeek(day, { weekStartsOn: 1 });
|
|
109
|
+
const offset = getMachineOffset(date.getTime());
|
|
113
110
|
|
|
114
111
|
date.setTime(date.getTime() + offset);
|
|
115
112
|
|
|
@@ -143,7 +140,6 @@ export default defineComponent({
|
|
|
143
140
|
dayLabel,
|
|
144
141
|
days
|
|
145
142
|
};
|
|
146
|
-
|
|
147
143
|
}
|
|
148
144
|
});
|
|
149
145
|
</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.127",
|
|
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.127",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.127"
|
|
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": "b0ad78457ad86632d841709d3fc3951a8e44c667"
|
|
39
39
|
}
|
package/tools/chartsTools.ts
CHANGED
|
@@ -39,10 +39,10 @@ export const colorSetLabel = (value: ColorSets | number): string => {
|
|
|
39
39
|
switch (value) {
|
|
40
40
|
case ColorSets.Default: return $tr("ui.color-sets.am-charts", "Am Charts");
|
|
41
41
|
case ColorSets.Grafana: return $tr("ui.color-sets.grafana", "Grafana");
|
|
42
|
-
case ColorSets.Armytage: return $tr("ui.color-sets.armytage", "
|
|
42
|
+
case ColorSets.Armytage: return $tr("ui.color-sets.armytage", "High contrast (26 colors)");
|
|
43
43
|
case ColorSets.Hash: return $tr("ui.color-sets.hash", "Hash");
|
|
44
|
-
case ColorSets.Kelly: return $tr("ui.color-sets.
|
|
45
|
-
case ColorSets.ZeileisHornikMurrell: return $tr("ui.color-sets.
|
|
44
|
+
case ColorSets.Kelly: return $tr("ui.color-sets.kelly", "High contrast (22 colors)");
|
|
45
|
+
case ColorSets.ZeileisHornikMurrell: return $tr("ui.color-sets.zeileis", "Colorblind accessible");
|
|
46
46
|
default: return $tr("ui.common.none", "None");
|
|
47
47
|
}
|
|
48
48
|
}
|
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,
|
|
9
|
-
{ id: TimeUnit.Minute,
|
|
10
|
-
{ id: TimeUnit.Hour,
|
|
11
|
-
{ id: TimeUnit.Day,
|
|
12
|
-
{ id: TimeUnit.Week,
|
|
13
|
-
{ id: TimeUnit.Month,
|
|
14
|
-
{ id: TimeUnit.Year,
|
|
8
|
+
{ id: TimeUnit.Second, get label() { return $tr("ui.common.second", "Second") }, get plural() { return $tr("ui.common.seconds", "Seconds") } },
|
|
9
|
+
{ id: TimeUnit.Minute, get label() { return $tr("ui.common.minute", "Minute") }, get plural() { return $tr("ui.common.minutes", "Minutes") } },
|
|
10
|
+
{ id: TimeUnit.Hour, get label() { return $tr("ui.common.hour", "Hour") }, get plural() { return $tr("ui.common.hours", "Hours") } },
|
|
11
|
+
{ id: TimeUnit.Day, get label() { return $tr("ui.common.day", "Day") }, get plural() { return $tr("ui.common.days", "Days") } },
|
|
12
|
+
{ id: TimeUnit.Week, get label() { return $tr("ui.common.week", "Week") }, get plural() { return $tr("ui.common.weeks", "Weeks") } },
|
|
13
|
+
{ id: TimeUnit.Month, get label() { return $tr("ui.common.month", "Month") }, get plural() { return $tr("ui.common.months", "Months") } },
|
|
14
|
+
{ id: TimeUnit.Year, get label() { return $tr("ui.common.year", "Year") }, get plural() { return $tr("ui.common.years", "Years") } },
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
export const timeStepToString = (value: { value: number, unit: TimeUnit } | null): string => {
|
|
@@ -28,12 +28,12 @@ export const timeStepToString = (value: { value: number, unit: TimeUnit } | null
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
// TODO : remove everything below this line
|
|
31
|
-
export const timeScale
|
|
32
|
-
{ id: 1, label
|
|
33
|
-
{ id: 60, label
|
|
34
|
-
{ id: 3600, label
|
|
35
|
-
{ id: 86400, label
|
|
36
|
-
{ id: 604800, label
|
|
31
|
+
export const timeScale = [
|
|
32
|
+
{ id: 1, get label() { return $tr("ui.common.second", "Second") }, get plural() { return $tr("ui.common.seconds", "Seconds") } },
|
|
33
|
+
{ id: 60, get label() { return $tr("ui.common.minute", "Minute") }, get plural() { return $tr("ui.common.minutes", "Minutes") } },
|
|
34
|
+
{ id: 3600, get label() { return $tr("ui.common.hour", "Hour") }, get plural() { return $tr("ui.common.hours", "Hours") } },
|
|
35
|
+
{ id: 86400, get label() { return $tr("ui.common.day", "Day") }, get plural() { return $tr("ui.common.days", "Days") } },
|
|
36
|
+
{ id: 604800, get label() { return $tr("ui.common.week", "Week") }, get plural() { return $tr("ui.common.weeks", "Weeks") } },
|
|
37
37
|
];
|
|
38
38
|
|
|
39
39
|
export const getTimeScaleIndex = (value: number): number => {
|