@optimum-intelligence/opti-ui 0.7.3 → 0.7.5
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/CHANGELOG.md +26 -0
- package/README.md +3 -1
- package/dist/components/data-table/DataTable.d.ts +11 -5
- package/dist/components/data-table/DataTable.js +75 -62
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +4 -1
- package/dist/components/data-table/DataTableFilters.js +22 -17
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/map/Map.d.ts +20 -3
- package/dist/components/map/Map.js +375 -230
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components.json +13 -9
- package/dist/llms-full.txt +23 -8
- package/dist/llms.txt +2 -2
- package/dist/opti-ui.css +21 -13
- package/package.json +1 -1
|
@@ -79,11 +79,13 @@ export type MapView = {
|
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
81
|
* Builds a MapLibre style from a raster tile URL template (`{z}`, `{x}`, `{y}`), for `MapBaseLayer.style`.
|
|
82
|
+
* The style gets a `glyphs` URL (OpenFreeMap's font server by default) so `Map.Points` labels can render;
|
|
83
|
+
* pass your own `glyphs` URL to use another font server.
|
|
82
84
|
*
|
|
83
85
|
* @example
|
|
84
86
|
* const satellite = rasterStyle('https://tiles.example.com/{z}/{x}/{y}.jpg', '© Example');
|
|
85
87
|
*/
|
|
86
|
-
export declare function rasterStyle(tiles: string | string[], attribution?: string, tileSize?: number): StyleSpecification;
|
|
88
|
+
export declare function rasterStyle(tiles: string | string[], attribution?: string, tileSize?: number, glyphs?: string): StyleSpecification;
|
|
87
89
|
export interface MapRootProps extends Omit<MapProps, 'mapStyle' | 'initialViewState' | 'interactiveLayerIds' | 'cursor' | 'locale' | 'style' | 'children' | 'id' | 'attributionControl' | 'workerUrl' | 'mapLib'> {
|
|
88
90
|
/** Ref to the map instance (`flyTo`, `getMap()`, …), set once the map has loaded MapLibre. */
|
|
89
91
|
ref?: React.Ref<MapRef>;
|
|
@@ -222,6 +224,12 @@ export interface MapPointItem {
|
|
|
222
224
|
* when you filter `items`; otherwise colours shift and stop matching the legend.
|
|
223
225
|
*/
|
|
224
226
|
colorIndex?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Short text drawn in the point, such as a stop number in visiting order. Labelled points are drawn
|
|
229
|
+
* larger so 1–3 digits fit; points without a label render as plain dots. Needs a style with a `glyphs`
|
|
230
|
+
* URL (OpenFreeMap styles and `rasterStyle()` have one).
|
|
231
|
+
*/
|
|
232
|
+
label?: string | number;
|
|
225
233
|
}
|
|
226
234
|
export interface MapPointsProps {
|
|
227
235
|
/** Points to draw, all in one GeoJSON source and one circle layer. */
|
|
@@ -234,11 +242,20 @@ export interface MapPointsProps {
|
|
|
234
242
|
onItemHover?: (item: MapPointItem | null, event: MapLayerMouseEvent) => void;
|
|
235
243
|
}
|
|
236
244
|
/**
|
|
237
|
-
* Many simple points (sensors, stops, events) as one circle layer.
|
|
238
|
-
*
|
|
245
|
+
* Many simple points (sensors, stops, events) as one circle layer. Items with a `label` get it drawn in
|
|
246
|
+
* the circle by a symbol layer on the same source, so thousands of numbered stops stay fast. For a few
|
|
247
|
+
* dozen styled pins with HTML content, use `Map.Marker` instead.
|
|
239
248
|
*
|
|
240
249
|
* @example
|
|
241
250
|
* <Map.Points items={sensors.map((s) => ({ id: s.id, coordinates: s.position, tone: s.ok ? 'success' : 'danger' }))} />
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* // Stops numbered in visiting order, one colour per truck.
|
|
254
|
+
* <Map.Points
|
|
255
|
+
* items={trucks.flatMap((truck, t) =>
|
|
256
|
+
* truck.stops.map((stop, i) => ({ id: stop.id, coordinates: stop.position, colorIndex: t, label: i + 1 })),
|
|
257
|
+
* )}
|
|
258
|
+
* />
|
|
242
259
|
*/
|
|
243
260
|
declare function MapPoints({ items, selectedIds, onItemClick, onItemHover }: MapPointsProps): React.JSX.Element;
|
|
244
261
|
export interface MapMarkerProps {
|