@seanyeh77/ui 0.48.3 → 0.49.0
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/dist/bundle.js +2 -2
- package/dist/components/FloorPlan/FloorPlan.d.ts +65 -0
- package/dist/components/FloorPlan/FloorPlan.js +822 -0
- package/dist/components/FloorPlan/FloorPlan.js.map +1 -0
- package/dist/components/ZoneMap/ZoneMap.d.ts +3 -0
- package/dist/components/ZoneMap/ZoneMap.js +6 -20
- package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
- package/dist/css/FloorPlan.css +270 -0
- package/dist/css/ZoneMap.css +0 -97
- package/dist/css/base.css +99 -0
- package/dist/i18n.js +6 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/zone.js +48 -0
- package/dist/internal/zone.js.map +1 -0
- package/dist/styles.css +364 -97
- package/docs/DataColors.md +1 -1
- package/docs/FloorPlan.md +43 -0
- package/docs/ZoneMap.md +2 -2
- package/docs/agents.md +5 -5
- package/docs/components.json +4 -0
- package/docs/data.md +2 -1
- package/docs/monitoring.md +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Zone } from "../ZoneMap/ZoneMap.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** A MultiPolygon in metres: [polygon][ring][point][x, y]. The first ring of a polygon is its outline, the others are
|
|
4
|
+
* holes (even-odd). y points north (up). */
|
|
5
|
+
export type MultiPolygon = number[][][][];
|
|
6
|
+
export interface FloorPlanZone extends Omit<Zone, 'area'> {
|
|
7
|
+
/** The zone's outline, a MultiPolygon in metres (y up): several polygons for a zone in pieces, inner rings for holes. */
|
|
8
|
+
outline: MultiPolygon;
|
|
9
|
+
/** Where its label sits, [x, y] in metres, worked out by the caller (e.g. the pole of inaccessibility). */
|
|
10
|
+
label: [number, number];
|
|
11
|
+
/** 'muted': a secondary zone, drawn fainter with a smaller label; still selectable, and 「⚠」 still shows. Default
|
|
12
|
+
* 'primary'. */
|
|
13
|
+
emphasis?: 'primary' | 'muted';
|
|
14
|
+
/** The id of the group it belongs to (`groups`). */
|
|
15
|
+
group?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FloorPlanGroup {
|
|
18
|
+
/** Unique id, named by the zones' `group`. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Shown on its outline, e.g. 「北側機櫃列」. */
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
export interface FloorPlanEdge {
|
|
24
|
+
/** The id of the zone on one side. */
|
|
25
|
+
a: string;
|
|
26
|
+
/** The id of the zone on the other side. */
|
|
27
|
+
b: string;
|
|
28
|
+
/** The boundary as polylines in metres: [line][point][x, y]. */
|
|
29
|
+
segs: [number, number][][];
|
|
30
|
+
}
|
|
31
|
+
export interface FloorPlanProps {
|
|
32
|
+
/** The zones. Tab moves through primary zones before muted ones, each from the smallest area up. */
|
|
33
|
+
zones: FloorPlanZone[];
|
|
34
|
+
/** What the plan shows, for screen readers, e.g. 「機房平面圖」. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Groups of zones: each gets a thin outline around its zones and its name. No group figures are worked out. */
|
|
37
|
+
groups?: FloorPlanGroup[];
|
|
38
|
+
/** The building's outline, drawn under the zones (a MultiPolygon in metres, y up). */
|
|
39
|
+
shell?: MultiPolygon;
|
|
40
|
+
/** Boundaries between zones, drawn as dashed lines. */
|
|
41
|
+
edges?: FloorPlanEdge[];
|
|
42
|
+
/** Bottom of the heat scale for zones without a fill. Default: the smallest value among the zones. */
|
|
43
|
+
min?: number;
|
|
44
|
+
/** Top of the heat scale for zones without a fill. Default: the largest value among the zones. */
|
|
45
|
+
max?: number;
|
|
46
|
+
/** The watch line on the legend's scale, in the zones' unit (from the caller; nothing is assumed). */
|
|
47
|
+
warn?: number;
|
|
48
|
+
/** The limit mark on the legend's scale, in the zones' unit. */
|
|
49
|
+
limit?: number;
|
|
50
|
+
/** false: no legend under the plan. Default true. */
|
|
51
|
+
legend?: boolean;
|
|
52
|
+
/** The selected zone's id (controlled); null for none. */
|
|
53
|
+
value?: string | null;
|
|
54
|
+
/** A zone was picked (click, tap, Enter or Space): its id, and the zone. */
|
|
55
|
+
onChange?: (id: string, zone: FloorPlanZone) => void;
|
|
56
|
+
/** The plan grows to fill the height it is given (in ConsoleLayout's main view, or any flex column), never below
|
|
57
|
+
* 240 px. Without it the plan keeps the outline's proportions, 240 to 640 px high. */
|
|
58
|
+
fill?: boolean;
|
|
59
|
+
/** Extra class on the root element. */
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
/** A floor plan of zones with any outline (L shapes, pieces, holes), each filled by its value on the heat scale with
|
|
63
|
+
* its name, figure and state. Zones are buttons in Tab order (primary first, smaller first); Enter or Space selects.
|
|
64
|
+
* Wheel, pinch, drag, + − and the arrow keys zoom and pan; 「重設視角」 shows the whole plan again. */
|
|
65
|
+
export declare function FloorPlan({ zones, label, groups, shell, edges, legend, fill, className, ...p }: FloorPlanProps): React.JSX.Element;
|