@road-labs/map-sdk 0.0.28-rc.7 → 0.0.28-rc.8
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/README.md +21 -2
- package/dist/components/Pin/Pin.d.ts +15 -0
- package/dist/i18n.d.ts +3 -2
- package/dist/index.js +109 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3321 -2737
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/pinState.d.ts +41 -0
- package/dist/utils/pinState.test.d.ts +1 -0
- package/dist/utils/status.d.ts +16 -2
- package/dist/utils/statusFilters.d.ts +1 -1
- package/dist/utils/version.d.ts +3 -0
- package/dist/utils/version.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { MapKind } from '../types';
|
|
2
|
+
export type PinTone = "available" | "inUse" | "offline" | "fault" | "planned" | "unknown";
|
|
3
|
+
export type PinGlyph = "bolt" | "ratio" | "dash" | "plus" | "alert";
|
|
4
|
+
export type PinColours = {
|
|
5
|
+
ring: string;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
export type PinSlice = {
|
|
9
|
+
tone: PinTone;
|
|
10
|
+
ring: string;
|
|
11
|
+
fraction: number;
|
|
12
|
+
};
|
|
13
|
+
export type PinState = {
|
|
14
|
+
tone: PinTone;
|
|
15
|
+
colours: PinColours;
|
|
16
|
+
glyph: PinGlyph;
|
|
17
|
+
free: number;
|
|
18
|
+
total: number;
|
|
19
|
+
split: PinSlice[];
|
|
20
|
+
};
|
|
21
|
+
export type UnitCounts = {
|
|
22
|
+
free: number;
|
|
23
|
+
busy: number;
|
|
24
|
+
fault: number;
|
|
25
|
+
planned: number;
|
|
26
|
+
unknown: number;
|
|
27
|
+
offline: number;
|
|
28
|
+
total: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function countUnits(statuses?: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
count: number;
|
|
33
|
+
}>): UnitCounts;
|
|
34
|
+
export declare function pinTone(counts: UnitCounts, kind: MapKind, cluster: boolean): PinTone;
|
|
35
|
+
export declare function pinGlyph(counts: UnitCounts, tone: PinTone): PinGlyph;
|
|
36
|
+
export declare function pinColours(tone: PinTone, kind: MapKind): PinColours;
|
|
37
|
+
export declare function pinSplit(counts: UnitCounts, kind: MapKind): PinSlice[];
|
|
38
|
+
export declare function describePin(statuses: Array<{
|
|
39
|
+
name: string;
|
|
40
|
+
count: number;
|
|
41
|
+
}> | undefined, kind?: MapKind, cluster?: boolean): PinState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/status.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { LabelsType } from '../i18n';
|
|
2
2
|
import { MapKind } from '../types';
|
|
3
3
|
export declare function normaliseStatus(status?: string): string;
|
|
4
|
-
export
|
|
4
|
+
export type Palette = {
|
|
5
|
+
green: string;
|
|
6
|
+
blue: string;
|
|
7
|
+
red: string;
|
|
8
|
+
amber: string;
|
|
9
|
+
grey: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const classicPalette: Palette;
|
|
12
|
+
export declare const modernPalette: Palette;
|
|
13
|
+
export declare function paletteFor(version?: string): Palette;
|
|
14
|
+
export declare const inSessionStatuses: Set<string>;
|
|
15
|
+
export type StatusTone = "available" | "inSession" | "fault" | "unavailable" | "unknown" | "offline";
|
|
16
|
+
export declare function statusTone(status?: string, kind?: MapKind): StatusTone;
|
|
17
|
+
export declare function toneColour(tone: StatusTone, kind?: MapKind, version?: string): string;
|
|
18
|
+
export declare function getStatusColor(status?: string, kind?: MapKind, version?: string): string;
|
|
5
19
|
export declare function getStatusLabelKey(status?: string): keyof LabelsType;
|
|
6
20
|
export declare function pickMarkerColor(statuses?: Array<{
|
|
7
21
|
name: string;
|
|
8
22
|
count: number;
|
|
9
|
-
}>, kind?: MapKind): string;
|
|
23
|
+
}>, kind?: MapKind, version?: string): string;
|
|
@@ -6,7 +6,7 @@ export type StatusFilterOption = {
|
|
|
6
6
|
values: string[];
|
|
7
7
|
color: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function getStatusFilterOptions(kind?: MapKind): StatusFilterOption[];
|
|
9
|
+
export declare function getStatusFilterOptions(kind?: MapKind, version?: string): StatusFilterOption[];
|
|
10
10
|
export declare function toggleOption(action: "remove" | "add", existing: string[], values: string[]): string[];
|
|
11
11
|
export declare function findStatusFilterOption(kind: MapKind | undefined, status: string): StatusFilterOption | undefined;
|
|
12
12
|
export declare function isStatusFilterActive(kind: MapKind | undefined, selected: string[], status: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|