@dative-gpi/foundation-shared-components 1.0.160 → 1.0.161-alert-tile
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/FSInstantPicker.vue +36 -51
- package/components/FSOptionsMenu.vue +165 -0
- package/components/FSRangePicker.vue +261 -0
- package/components/FSRangeSlider.vue +84 -0
- package/components/FSSlider.vue +41 -77
- package/components/lists/FSDataTableUI.vue +16 -11
- package/components/map/FSMap.vue +1 -1
- package/components/tiles/FSEntityCountBadge.vue +72 -0
- package/components/tiles/FSFolderTileUI.vue +38 -4
- package/components/tiles/FSGroupTileUI.vue +15 -67
- package/components/tiles/FSLocationTileUI.vue +9 -28
- package/composables/useMapLayers.ts +60 -53
- package/package.json +4 -4
- package/styles/components/fs_slider.scss +0 -40
- package/tools/alertsTools.ts +11 -10
- package/utils/index.ts +1 -0
- package/utils/picker.ts +40 -0
|
@@ -1,50 +1,10 @@
|
|
|
1
1
|
.fs-slider {
|
|
2
|
-
padding: 0px !important;
|
|
3
|
-
width: calc(100% - 16px);
|
|
4
|
-
|
|
5
|
-
& .v-slider__container {
|
|
6
|
-
cursor: var(--fs-slider-cursor);
|
|
7
|
-
margin-left: 8px;
|
|
8
|
-
margin-right: 8px;
|
|
9
|
-
opacity: 1 !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
& .v-slider-track__background {
|
|
13
|
-
background-color: var(--fs-slider-track-color);
|
|
14
|
-
height: 6px !important;
|
|
15
|
-
opacity: 1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
2
|
& .v-slider-track__fill {
|
|
19
3
|
display: none;
|
|
20
4
|
}
|
|
21
5
|
|
|
22
6
|
& .v-slider-track__tick {
|
|
23
7
|
background-color: var(--fs-slider-thumb-color);
|
|
24
|
-
border-radius: 50%;
|
|
25
8
|
}
|
|
26
9
|
|
|
27
|
-
& .v-slider-thumb {
|
|
28
|
-
color: var(--fs-slider-thumb-color);
|
|
29
|
-
|
|
30
|
-
&__surface:before {
|
|
31
|
-
display: none !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__surface:after {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&__ripple {
|
|
39
|
-
display: none !important;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.fs-slider-label {
|
|
45
|
-
color: var(--fs-slider-color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.fs-slider-description {
|
|
49
|
-
color: var(--fs-slider-color);
|
|
50
10
|
}
|
package/tools/alertsTools.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
2
|
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
|
-
import { ColorEnum } from "../models"
|
|
3
|
+
import { ColorEnum } from "../models";
|
|
4
4
|
import { getTimeBestString } from "../utils";
|
|
5
5
|
|
|
6
6
|
const { $tr } = useTranslationsProvider();
|
|
@@ -8,12 +8,12 @@ const { $tr } = useTranslationsProvider();
|
|
|
8
8
|
export const AlertTools = {
|
|
9
9
|
statusIcon(value: AlertStatus): string {
|
|
10
10
|
switch (value) {
|
|
11
|
-
case AlertStatus.Pending: return "mdi-timer-
|
|
12
|
-
case AlertStatus.Untriggered: return "mdi-
|
|
13
|
-
case AlertStatus.Unresolved: return "mdi-
|
|
14
|
-
case AlertStatus.Resolved: return "mdi-check-circle
|
|
15
|
-
case AlertStatus.Expired: return "mdi-clock-outline";
|
|
16
|
-
case AlertStatus.Triggered: return "mdi-
|
|
11
|
+
case AlertStatus.Pending: return "mdi-timer-sand";
|
|
12
|
+
case AlertStatus.Untriggered: return "mdi-close-octagon";
|
|
13
|
+
case AlertStatus.Unresolved: return "mdi-cancel";
|
|
14
|
+
case AlertStatus.Resolved: return "mdi-check-circle";
|
|
15
|
+
case AlertStatus.Expired: return "mdi-timeline-clock-outline";
|
|
16
|
+
case AlertStatus.Triggered: return "mdi-timer-sand";
|
|
17
17
|
case AlertStatus.Abandoned: return "mdi-cancel"
|
|
18
18
|
default: return "";
|
|
19
19
|
}
|
|
@@ -82,15 +82,16 @@ export const AlertTools = {
|
|
|
82
82
|
},
|
|
83
83
|
statusColor(status: AlertStatus): ColorEnum {
|
|
84
84
|
switch (status) {
|
|
85
|
-
case AlertStatus.None:
|
|
86
85
|
case AlertStatus.Pending:
|
|
87
|
-
case AlertStatus.
|
|
86
|
+
case AlertStatus.Untriggered:
|
|
88
87
|
return ColorEnum.Warning;
|
|
88
|
+
case AlertStatus.Expired:
|
|
89
|
+
case AlertStatus.Abandoned:
|
|
90
|
+
return ColorEnum.Dark;
|
|
89
91
|
case AlertStatus.Unresolved:
|
|
90
92
|
case AlertStatus.Triggered:
|
|
91
93
|
return ColorEnum.Error;
|
|
92
94
|
case AlertStatus.Resolved:
|
|
93
|
-
case AlertStatus.Untriggered:
|
|
94
95
|
return ColorEnum.Success;
|
|
95
96
|
default:
|
|
96
97
|
return ColorEnum.Warning;
|
package/utils/index.ts
CHANGED
package/utils/picker.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export enum TimePrecision {
|
|
2
|
+
Hours = 1,
|
|
3
|
+
Days = 2,
|
|
4
|
+
Months = 3
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Compute ticks for a time range based on the specified precision.
|
|
9
|
+
*/
|
|
10
|
+
export const computeTicks = ({ start, end, tickCount, precision }: { start: number, end: number, tickCount: number, precision: TimePrecision }): number[] => {
|
|
11
|
+
const ticks: number[] = [];
|
|
12
|
+
const range = end - start;
|
|
13
|
+
|
|
14
|
+
if (precision === TimePrecision.Hours) {
|
|
15
|
+
// Tick toutes les X heures, aligné sur l'heure pleine
|
|
16
|
+
const step = Math.ceil(range / tickCount / 3600000) * 3600000;
|
|
17
|
+
const alignedStart = Math.ceil(start / 3600000) * 3600000;
|
|
18
|
+
for (let i = 0; i < tickCount; i++) {
|
|
19
|
+
const tick = alignedStart + i * step;
|
|
20
|
+
if (tick < end) { ticks.push(tick); }
|
|
21
|
+
}
|
|
22
|
+
} else if (precision === TimePrecision.Days) {
|
|
23
|
+
// Tick tous les X jours, aligné sur minuit
|
|
24
|
+
const step = Math.ceil(range / tickCount / 86400000) * 86400000;
|
|
25
|
+
const date = new Date(start);
|
|
26
|
+
date.setHours(0, 0, 0, 0);
|
|
27
|
+
const alignedStart = date.getTime() + (date.getTime() < start ? step : 0);
|
|
28
|
+
for (let i = 0; i < tickCount; i++) {
|
|
29
|
+
const tick = alignedStart + i * step;
|
|
30
|
+
if (tick < end) { ticks.push(tick); }
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
// Tick tous les X mois (approximation linéaire)
|
|
34
|
+
const interval = range / tickCount;
|
|
35
|
+
for (let i = 0; i < tickCount; i++) {
|
|
36
|
+
ticks.push(start + i * interval);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return ticks;
|
|
40
|
+
}
|