@smartnet360/svelte-components 0.0.39 → 0.0.41
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/apps/antenna-pattern/components/AntennaDiagrams.svelte +0 -5
- package/dist/apps/antenna-pattern/components/DbNotification.svelte +1 -1
- package/dist/apps/antenna-pattern/components/chart-engines/PolarBarChart.svelte +2 -0
- package/dist/apps/antenna-pattern/components/chart-engines/PolarBarChart.svelte.d.ts +1 -0
- package/dist/apps/site-check/SiteCheck.svelte +5 -3
- package/dist/apps/site-check/SiteCheck.svelte.d.ts +2 -1
- package/dist/apps/site-check/helper.js +3 -0
- package/dist/core/Charts/ChartCard.svelte +9 -12
- package/dist/core/Charts/ChartCard.svelte.d.ts +5 -21
- package/dist/core/Charts/ChartComponent.svelte +2 -2
- package/dist/core/Charts/editor/ChartLayoutEditor.svelte +8 -8
- package/dist/core/Charts/editor/GridPreview.svelte +0 -3
- package/dist/core/Charts/editor/KPIPicker.svelte +6 -7
- package/dist/core/Charts/editor/KPIPicker.svelte.d.ts +4 -20
- package/dist/core/Charts/editor/PropertiesPanel.svelte +6 -3
- package/dist/core/Charts/editor/PropertiesPanel.svelte.d.ts +8 -18
- package/dist/core/Map/Map.svelte +312 -0
- package/dist/core/Map/Map.svelte.d.ts +230 -0
- package/dist/core/Map/index.d.ts +9 -0
- package/dist/core/Map/index.js +9 -0
- package/dist/core/Map/mapSettings.d.ts +147 -0
- package/dist/core/Map/mapSettings.js +226 -0
- package/dist/core/Map/mapStore.d.ts +73 -0
- package/dist/core/Map/mapStore.js +136 -0
- package/dist/core/Map/types.d.ts +72 -0
- package/dist/core/Map/types.js +32 -0
- package/dist/core/Settings/FieldRenderer.svelte +19 -15
- package/dist/core/Settings/FieldRenderer.svelte.d.ts +12 -25
- package/dist/core/Settings/Settings.svelte +48 -29
- package/dist/core/Settings/Settings.svelte.d.ts +26 -20
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +2 -0
- package/package.json +15 -11
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Settings Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the settings schema for map configuration using the Settings component.
|
|
5
|
+
* Integrates with the Settings system for reactive map configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { MAP_STYLES } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Map settings schema for use with Settings component
|
|
10
|
+
*/
|
|
11
|
+
export const mapSettingsSchema = {
|
|
12
|
+
segments: [
|
|
13
|
+
{
|
|
14
|
+
id: 'appearance',
|
|
15
|
+
title: 'Map Appearance',
|
|
16
|
+
icon: '🎨',
|
|
17
|
+
description: 'Visual style and theme settings',
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
id: 'style',
|
|
21
|
+
type: 'select',
|
|
22
|
+
label: 'Map Style',
|
|
23
|
+
description: 'Choose the base map style',
|
|
24
|
+
defaultValue: 'streets',
|
|
25
|
+
options: [
|
|
26
|
+
{ value: 'streets', label: 'Streets', description: 'Default street map' },
|
|
27
|
+
{ value: 'satellite', label: 'Satellite', description: 'Satellite imagery' },
|
|
28
|
+
{
|
|
29
|
+
value: 'satelliteStreets',
|
|
30
|
+
label: 'Satellite Streets',
|
|
31
|
+
description: 'Satellite with street labels'
|
|
32
|
+
},
|
|
33
|
+
{ value: 'light', label: 'Light', description: 'Light colored theme' },
|
|
34
|
+
{ value: 'dark', label: 'Dark', description: 'Dark colored theme' },
|
|
35
|
+
{ value: 'outdoors', label: 'Outdoors', description: 'Outdoor/terrain map' },
|
|
36
|
+
{ value: 'navigationDay', label: 'Navigation Day', description: 'Navigation optimized' },
|
|
37
|
+
{ value: 'navigationNight', label: 'Navigation Night', description: 'Night navigation' }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'show3dBuildings',
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
label: 'Show 3D Buildings',
|
|
44
|
+
description: 'Display buildings in 3D when zoomed in',
|
|
45
|
+
defaultValue: true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'showTerrain',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
label: 'Show Terrain',
|
|
51
|
+
description: 'Display 3D terrain elevation',
|
|
52
|
+
defaultValue: false
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'controls',
|
|
58
|
+
title: 'Map Controls',
|
|
59
|
+
icon: '🎮',
|
|
60
|
+
description: 'Control visibility and behavior',
|
|
61
|
+
fields: [
|
|
62
|
+
{
|
|
63
|
+
id: 'showNavigationControls',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
label: 'Navigation Controls',
|
|
66
|
+
description: 'Show zoom and rotation controls',
|
|
67
|
+
defaultValue: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'showScaleControl',
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
label: 'Scale Control',
|
|
73
|
+
description: 'Show distance scale',
|
|
74
|
+
defaultValue: true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'showFullscreenControl',
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
label: 'Fullscreen Control',
|
|
80
|
+
description: 'Show fullscreen toggle button',
|
|
81
|
+
defaultValue: false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'showGeolocateControl',
|
|
85
|
+
type: 'boolean',
|
|
86
|
+
label: 'Geolocation Control',
|
|
87
|
+
description: 'Show user location button',
|
|
88
|
+
defaultValue: false
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'interaction',
|
|
94
|
+
title: 'Interaction',
|
|
95
|
+
icon: '👆',
|
|
96
|
+
description: 'User interaction settings',
|
|
97
|
+
fields: [
|
|
98
|
+
{
|
|
99
|
+
id: 'dragRotate',
|
|
100
|
+
type: 'boolean',
|
|
101
|
+
label: 'Drag to Rotate',
|
|
102
|
+
description: 'Enable rotation by dragging with right mouse or ctrl+drag',
|
|
103
|
+
defaultValue: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'touchZoomRotate',
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
label: 'Touch Zoom/Rotate',
|
|
109
|
+
description: 'Enable pinch to zoom and rotate on touch devices',
|
|
110
|
+
defaultValue: true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'scrollZoom',
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
label: 'Scroll to Zoom',
|
|
116
|
+
description: 'Enable mouse wheel zoom',
|
|
117
|
+
defaultValue: true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'doubleClickZoom',
|
|
121
|
+
type: 'boolean',
|
|
122
|
+
label: 'Double Click Zoom',
|
|
123
|
+
description: 'Enable double click to zoom',
|
|
124
|
+
defaultValue: true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'dragPan',
|
|
128
|
+
type: 'boolean',
|
|
129
|
+
label: 'Drag to Pan',
|
|
130
|
+
description: 'Enable map panning by dragging',
|
|
131
|
+
defaultValue: true
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'view',
|
|
137
|
+
title: 'View Settings',
|
|
138
|
+
icon: '🌍',
|
|
139
|
+
description: 'Camera and viewport settings',
|
|
140
|
+
fields: [
|
|
141
|
+
{
|
|
142
|
+
id: 'pitch',
|
|
143
|
+
type: 'range',
|
|
144
|
+
label: 'Pitch',
|
|
145
|
+
description: 'Camera tilt angle (0-85 degrees)',
|
|
146
|
+
defaultValue: 0,
|
|
147
|
+
min: 0,
|
|
148
|
+
max: 85,
|
|
149
|
+
step: 5,
|
|
150
|
+
showValue: true,
|
|
151
|
+
unit: '°'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 'bearing',
|
|
155
|
+
type: 'range',
|
|
156
|
+
label: 'Bearing',
|
|
157
|
+
description: 'Map rotation angle (0-360 degrees)',
|
|
158
|
+
defaultValue: 0,
|
|
159
|
+
min: 0,
|
|
160
|
+
max: 360,
|
|
161
|
+
step: 15,
|
|
162
|
+
showValue: true,
|
|
163
|
+
unit: '°'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 'minZoom',
|
|
167
|
+
type: 'number',
|
|
168
|
+
label: 'Min Zoom',
|
|
169
|
+
description: 'Minimum zoom level',
|
|
170
|
+
defaultValue: 0,
|
|
171
|
+
min: 0,
|
|
172
|
+
max: 22,
|
|
173
|
+
step: 1
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 'maxZoom',
|
|
177
|
+
type: 'number',
|
|
178
|
+
label: 'Max Zoom',
|
|
179
|
+
description: 'Maximum zoom level',
|
|
180
|
+
defaultValue: 22,
|
|
181
|
+
min: 0,
|
|
182
|
+
max: 22,
|
|
183
|
+
step: 1
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'performance',
|
|
189
|
+
title: 'Performance',
|
|
190
|
+
icon: '⚡',
|
|
191
|
+
description: 'Performance and rendering settings',
|
|
192
|
+
fields: [
|
|
193
|
+
{
|
|
194
|
+
id: 'maxTileCacheSize',
|
|
195
|
+
type: 'select',
|
|
196
|
+
label: 'Tile Cache Size',
|
|
197
|
+
description: 'Maximum number of tiles to cache',
|
|
198
|
+
defaultValue: 500,
|
|
199
|
+
options: [
|
|
200
|
+
{ value: 100, label: 'Small (100)' },
|
|
201
|
+
{ value: 500, label: 'Medium (500)' },
|
|
202
|
+
{ value: 1000, label: 'Large (1000)' }
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 'antialias',
|
|
207
|
+
type: 'boolean',
|
|
208
|
+
label: 'Anti-aliasing',
|
|
209
|
+
description: 'Enable anti-aliasing for smoother rendering (may impact performance)',
|
|
210
|
+
defaultValue: true
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 'fadeDuration',
|
|
214
|
+
type: 'number',
|
|
215
|
+
label: 'Fade Duration',
|
|
216
|
+
description: 'Tile fade-in duration in milliseconds',
|
|
217
|
+
defaultValue: 300,
|
|
218
|
+
min: 0,
|
|
219
|
+
max: 1000,
|
|
220
|
+
step: 100,
|
|
221
|
+
unit: 'ms'
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Store
|
|
3
|
+
*
|
|
4
|
+
* Centralized store for map instance and state management.
|
|
5
|
+
* Allows components to access map instance and react to state changes.
|
|
6
|
+
*/
|
|
7
|
+
import type { Readable } from 'svelte/store';
|
|
8
|
+
import type { Map as MapboxMap } from 'mapbox-gl';
|
|
9
|
+
import type { MapboxOverlay } from '@deck.gl/mapbox';
|
|
10
|
+
import type { Layer } from '@deck.gl/core';
|
|
11
|
+
import type { MapState } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* Create a map store instance
|
|
14
|
+
* Each map component should create its own store instance
|
|
15
|
+
*/
|
|
16
|
+
export declare function createMapStore(): {
|
|
17
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<MapState>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
18
|
+
/**
|
|
19
|
+
* Set the map instance after initialization
|
|
20
|
+
*/
|
|
21
|
+
setMap(map: MapboxMap): void;
|
|
22
|
+
/**
|
|
23
|
+
* Set the Deck.GL overlay instance
|
|
24
|
+
*/
|
|
25
|
+
setOverlay(overlay: MapboxOverlay): void;
|
|
26
|
+
/**
|
|
27
|
+
* Update Deck.GL layers
|
|
28
|
+
*/
|
|
29
|
+
setLayers(layers: Layer[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* Add a layer to the existing layers
|
|
32
|
+
*/
|
|
33
|
+
addLayer(layer: Layer): void;
|
|
34
|
+
/**
|
|
35
|
+
* Remove a layer by id
|
|
36
|
+
*/
|
|
37
|
+
removeLayer(layerId: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Mark map as loaded
|
|
40
|
+
*/
|
|
41
|
+
setLoaded(isLoaded: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* Update map view state
|
|
44
|
+
*/
|
|
45
|
+
updateViewState(updates: Partial<Pick<MapState, "center" | "zoom" | "pitch" | "bearing">>): void;
|
|
46
|
+
/**
|
|
47
|
+
* Fly to a location
|
|
48
|
+
*/
|
|
49
|
+
flyTo(center: [number, number], zoom?: number, options?: {
|
|
50
|
+
duration?: number;
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
* Fit map to bounds
|
|
54
|
+
*/
|
|
55
|
+
fitBounds(bounds: [[number, number], [number, number]], padding?: number): void;
|
|
56
|
+
/**
|
|
57
|
+
* Reset to initial state
|
|
58
|
+
*/
|
|
59
|
+
reset(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Clean up map resources
|
|
62
|
+
*/
|
|
63
|
+
destroy(): void;
|
|
64
|
+
};
|
|
65
|
+
export type MapStore = ReturnType<typeof createMapStore>;
|
|
66
|
+
/**
|
|
67
|
+
* Derived store: Check if map is ready to use
|
|
68
|
+
*/
|
|
69
|
+
export declare function isMapReady(mapStore: MapStore): Readable<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Derived store: Get current map instance (null-safe)
|
|
72
|
+
*/
|
|
73
|
+
export declare function getMapInstance(mapStore: MapStore): Readable<MapboxMap | null>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Store
|
|
3
|
+
*
|
|
4
|
+
* Centralized store for map instance and state management.
|
|
5
|
+
* Allows components to access map instance and react to state changes.
|
|
6
|
+
*/
|
|
7
|
+
import { writable, derived, get } from 'svelte/store';
|
|
8
|
+
/**
|
|
9
|
+
* Create a map store instance
|
|
10
|
+
* Each map component should create its own store instance
|
|
11
|
+
*/
|
|
12
|
+
export function createMapStore() {
|
|
13
|
+
const initialState = {
|
|
14
|
+
map: null,
|
|
15
|
+
overlay: null,
|
|
16
|
+
layers: [],
|
|
17
|
+
isLoaded: false,
|
|
18
|
+
center: [-74.5, 40],
|
|
19
|
+
zoom: 9,
|
|
20
|
+
pitch: 0,
|
|
21
|
+
bearing: 0
|
|
22
|
+
};
|
|
23
|
+
const store = writable(initialState);
|
|
24
|
+
return {
|
|
25
|
+
subscribe: store.subscribe,
|
|
26
|
+
/**
|
|
27
|
+
* Set the map instance after initialization
|
|
28
|
+
*/
|
|
29
|
+
setMap(map) {
|
|
30
|
+
store.update(state => ({ ...state, map }));
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Set the Deck.GL overlay instance
|
|
34
|
+
*/
|
|
35
|
+
setOverlay(overlay) {
|
|
36
|
+
store.update(state => ({ ...state, overlay }));
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Update Deck.GL layers
|
|
40
|
+
*/
|
|
41
|
+
setLayers(layers) {
|
|
42
|
+
const state = get(store);
|
|
43
|
+
if (state.overlay) {
|
|
44
|
+
state.overlay.setProps({ layers });
|
|
45
|
+
}
|
|
46
|
+
store.update(s => ({ ...s, layers }));
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Add a layer to the existing layers
|
|
50
|
+
*/
|
|
51
|
+
addLayer(layer) {
|
|
52
|
+
const state = get(store);
|
|
53
|
+
const newLayers = [...state.layers, layer];
|
|
54
|
+
if (state.overlay) {
|
|
55
|
+
state.overlay.setProps({ layers: newLayers });
|
|
56
|
+
}
|
|
57
|
+
store.update(s => ({ ...s, layers: newLayers }));
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Remove a layer by id
|
|
61
|
+
*/
|
|
62
|
+
removeLayer(layerId) {
|
|
63
|
+
const state = get(store);
|
|
64
|
+
const newLayers = state.layers.filter(l => l.id !== layerId);
|
|
65
|
+
if (state.overlay) {
|
|
66
|
+
state.overlay.setProps({ layers: newLayers });
|
|
67
|
+
}
|
|
68
|
+
store.update(s => ({ ...s, layers: newLayers }));
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Mark map as loaded
|
|
72
|
+
*/
|
|
73
|
+
setLoaded(isLoaded) {
|
|
74
|
+
store.update(state => ({ ...state, isLoaded }));
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Update map view state
|
|
78
|
+
*/
|
|
79
|
+
updateViewState(updates) {
|
|
80
|
+
store.update(state => ({ ...state, ...updates }));
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Fly to a location
|
|
84
|
+
*/
|
|
85
|
+
flyTo(center, zoom, options) {
|
|
86
|
+
const state = get(store);
|
|
87
|
+
if (state.map) {
|
|
88
|
+
state.map.flyTo({
|
|
89
|
+
center,
|
|
90
|
+
zoom: zoom ?? state.zoom,
|
|
91
|
+
duration: options?.duration ?? 1000
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Fit map to bounds
|
|
97
|
+
*/
|
|
98
|
+
fitBounds(bounds, padding) {
|
|
99
|
+
const state = get(store);
|
|
100
|
+
if (state.map) {
|
|
101
|
+
state.map.fitBounds(bounds, {
|
|
102
|
+
padding: padding ?? 50,
|
|
103
|
+
duration: 1000
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* Reset to initial state
|
|
109
|
+
*/
|
|
110
|
+
reset() {
|
|
111
|
+
store.set(initialState);
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Clean up map resources
|
|
115
|
+
*/
|
|
116
|
+
destroy() {
|
|
117
|
+
const state = get(store);
|
|
118
|
+
if (state.map) {
|
|
119
|
+
state.map.remove();
|
|
120
|
+
}
|
|
121
|
+
this.reset();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Derived store: Check if map is ready to use
|
|
127
|
+
*/
|
|
128
|
+
export function isMapReady(mapStore) {
|
|
129
|
+
return derived(mapStore, $store => $store.map !== null && $store.overlay !== null && $store.isLoaded);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Derived store: Get current map instance (null-safe)
|
|
133
|
+
*/
|
|
134
|
+
export function getMapInstance(mapStore) {
|
|
135
|
+
return derived(mapStore, $store => $store.map);
|
|
136
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Component Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines types for Mapbox GL + Deck.GL integration
|
|
5
|
+
*/
|
|
6
|
+
import type { Map as MapboxMap } from 'mapbox-gl';
|
|
7
|
+
import type { MapboxOverlay } from '@deck.gl/mapbox';
|
|
8
|
+
import type { Layer } from '@deck.gl/core';
|
|
9
|
+
/**
|
|
10
|
+
* Map initialization options
|
|
11
|
+
*/
|
|
12
|
+
export interface MapOptions {
|
|
13
|
+
/** Mapbox access token (required) */
|
|
14
|
+
accessToken: string;
|
|
15
|
+
/** Initial map style */
|
|
16
|
+
style?: string;
|
|
17
|
+
/** Initial center coordinates [lng, lat] */
|
|
18
|
+
center?: [number, number];
|
|
19
|
+
/** Initial zoom level */
|
|
20
|
+
zoom?: number;
|
|
21
|
+
/** Initial pitch (tilt) in degrees */
|
|
22
|
+
pitch?: number;
|
|
23
|
+
/** Initial bearing (rotation) in degrees */
|
|
24
|
+
bearing?: number;
|
|
25
|
+
/** Minimum zoom level */
|
|
26
|
+
minZoom?: number;
|
|
27
|
+
/** Maximum zoom level */
|
|
28
|
+
maxZoom?: number;
|
|
29
|
+
/** Whether to show navigation controls */
|
|
30
|
+
showControls?: boolean;
|
|
31
|
+
/** Whether to show scale control */
|
|
32
|
+
showScale?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Map state (stored in mapStore)
|
|
36
|
+
*/
|
|
37
|
+
export interface MapState {
|
|
38
|
+
/** The Mapbox GL instance */
|
|
39
|
+
map: MapboxMap | null;
|
|
40
|
+
/** The Deck.GL overlay instance */
|
|
41
|
+
overlay: MapboxOverlay | null;
|
|
42
|
+
/** Current Deck.GL layers */
|
|
43
|
+
layers: Layer[];
|
|
44
|
+
/** Whether the map is loaded and ready */
|
|
45
|
+
isLoaded: boolean;
|
|
46
|
+
/** Current map center */
|
|
47
|
+
center: [number, number];
|
|
48
|
+
/** Current zoom level */
|
|
49
|
+
zoom: number;
|
|
50
|
+
/** Current pitch */
|
|
51
|
+
pitch: number;
|
|
52
|
+
/** Current bearing */
|
|
53
|
+
bearing: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Map style presets
|
|
57
|
+
*/
|
|
58
|
+
export declare const MAP_STYLES: {
|
|
59
|
+
readonly streets: "mapbox://styles/mapbox/streets-v12";
|
|
60
|
+
readonly satellite: "mapbox://styles/mapbox/satellite-v9";
|
|
61
|
+
readonly satelliteStreets: "mapbox://styles/mapbox/satellite-streets-v12";
|
|
62
|
+
readonly light: "mapbox://styles/mapbox/light-v11";
|
|
63
|
+
readonly dark: "mapbox://styles/mapbox/dark-v11";
|
|
64
|
+
readonly outdoors: "mapbox://styles/mapbox/outdoors-v12";
|
|
65
|
+
readonly navigationDay: "mapbox://styles/mapbox/navigation-day-v1";
|
|
66
|
+
readonly navigationNight: "mapbox://styles/mapbox/navigation-night-v1";
|
|
67
|
+
};
|
|
68
|
+
export type MapStyleName = keyof typeof MAP_STYLES;
|
|
69
|
+
/**
|
|
70
|
+
* Default map options
|
|
71
|
+
*/
|
|
72
|
+
export declare const DEFAULT_MAP_OPTIONS: Partial<MapOptions>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Component Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines types for Mapbox GL + Deck.GL integration
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Map style presets
|
|
8
|
+
*/
|
|
9
|
+
export const MAP_STYLES = {
|
|
10
|
+
streets: 'mapbox://styles/mapbox/streets-v12',
|
|
11
|
+
satellite: 'mapbox://styles/mapbox/satellite-v9',
|
|
12
|
+
satelliteStreets: 'mapbox://styles/mapbox/satellite-streets-v12',
|
|
13
|
+
light: 'mapbox://styles/mapbox/light-v11',
|
|
14
|
+
dark: 'mapbox://styles/mapbox/dark-v11',
|
|
15
|
+
outdoors: 'mapbox://styles/mapbox/outdoors-v12',
|
|
16
|
+
navigationDay: 'mapbox://styles/mapbox/navigation-day-v1',
|
|
17
|
+
navigationNight: 'mapbox://styles/mapbox/navigation-night-v1'
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Default map options
|
|
21
|
+
*/
|
|
22
|
+
export const DEFAULT_MAP_OPTIONS = {
|
|
23
|
+
style: MAP_STYLES.streets,
|
|
24
|
+
center: [-74.5, 40],
|
|
25
|
+
zoom: 9,
|
|
26
|
+
pitch: 0,
|
|
27
|
+
bearing: 0,
|
|
28
|
+
minZoom: 0,
|
|
29
|
+
maxZoom: 22,
|
|
30
|
+
showControls: true,
|
|
31
|
+
showScale: true
|
|
32
|
+
};
|
|
@@ -9,10 +9,14 @@
|
|
|
9
9
|
* Works with hierarchical store structure.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
interface Props {
|
|
13
|
+
field: FieldDefinition;
|
|
14
|
+
segmentId: string;
|
|
15
|
+
store: any; // The hierarchical settings store
|
|
16
|
+
value: any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { field, segmentId, store, value }: Props = $props();
|
|
16
20
|
|
|
17
21
|
// Generate unique ID for form elements
|
|
18
22
|
const inputId = `field-${segmentId}-${field.id}`;
|
|
@@ -32,7 +36,7 @@
|
|
|
32
36
|
class="form-check-input"
|
|
33
37
|
checked={value}
|
|
34
38
|
disabled={field.disabled}
|
|
35
|
-
|
|
39
|
+
onchange={(e) => handleChange(e.currentTarget.checked)}
|
|
36
40
|
/>
|
|
37
41
|
<label class="form-check-label" for={inputId}>
|
|
38
42
|
{field.label}
|
|
@@ -57,7 +61,7 @@
|
|
|
57
61
|
maxlength={field.maxLength}
|
|
58
62
|
pattern={field.pattern}
|
|
59
63
|
disabled={field.disabled}
|
|
60
|
-
|
|
64
|
+
oninput={(e) => handleChange(e.currentTarget.value)}
|
|
61
65
|
/>
|
|
62
66
|
{#if field.description}
|
|
63
67
|
<div class="form-text">{field.description}</div>
|
|
@@ -79,7 +83,7 @@
|
|
|
79
83
|
max={field.max}
|
|
80
84
|
step={field.step}
|
|
81
85
|
disabled={field.disabled}
|
|
82
|
-
|
|
86
|
+
oninput={(e) => handleChange(parseFloat(e.currentTarget.value))}
|
|
83
87
|
/>
|
|
84
88
|
{#if field.unit}
|
|
85
89
|
<span class="input-group-text">{field.unit}</span>
|
|
@@ -107,7 +111,7 @@
|
|
|
107
111
|
max={field.max}
|
|
108
112
|
step={field.step || 1}
|
|
109
113
|
disabled={field.disabled}
|
|
110
|
-
|
|
114
|
+
oninput={(e) => handleChange(parseFloat(e.currentTarget.value))}
|
|
111
115
|
/>
|
|
112
116
|
{#if field.description}
|
|
113
117
|
<div class="form-text">{field.description}</div>
|
|
@@ -126,14 +130,14 @@
|
|
|
126
130
|
class="form-control form-control-color"
|
|
127
131
|
value={value}
|
|
128
132
|
disabled={field.disabled}
|
|
129
|
-
|
|
133
|
+
oninput={(e) => handleChange(e.currentTarget.value)}
|
|
130
134
|
/>
|
|
131
135
|
<input
|
|
132
136
|
type="text"
|
|
133
137
|
class="form-control"
|
|
134
138
|
value={value}
|
|
135
139
|
disabled={field.disabled}
|
|
136
|
-
|
|
140
|
+
oninput={(e) => handleChange(e.currentTarget.value)}
|
|
137
141
|
/>
|
|
138
142
|
</div>
|
|
139
143
|
{#if field.description}
|
|
@@ -151,7 +155,7 @@
|
|
|
151
155
|
class="form-select"
|
|
152
156
|
value={value}
|
|
153
157
|
disabled={field.disabled}
|
|
154
|
-
|
|
158
|
+
onchange={(e) => handleChange(e.currentTarget.value)}
|
|
155
159
|
>
|
|
156
160
|
{#each field.options as option}
|
|
157
161
|
<option value={option.value}>
|
|
@@ -179,7 +183,7 @@
|
|
|
179
183
|
value={option.value}
|
|
180
184
|
checked={value === option.value}
|
|
181
185
|
disabled={field.disabled}
|
|
182
|
-
|
|
186
|
+
onchange={() => handleChange(option.value)}
|
|
183
187
|
/>
|
|
184
188
|
<label class="form-check-label" for={`${inputId}-${index}`}>
|
|
185
189
|
{option.label}
|
|
@@ -199,11 +203,11 @@
|
|
|
199
203
|
<span class="text-muted" title={field.tooltip}>ⓘ</span>
|
|
200
204
|
{/if}
|
|
201
205
|
</label>
|
|
202
|
-
|
|
203
|
-
|
|
206
|
+
{@const Component = field.component}
|
|
207
|
+
<Component
|
|
204
208
|
{value}
|
|
205
209
|
disabled={field.disabled}
|
|
206
|
-
|
|
210
|
+
onchange={(e: CustomEvent) => handleChange(e.detail)}
|
|
207
211
|
{...field.componentProps}
|
|
208
212
|
/>
|
|
209
213
|
{#if field.description}
|
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
import type { FieldDefinition } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const FieldRenderer: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
/**
|
|
17
|
-
* Generic Field Renderer
|
|
18
|
-
*
|
|
19
|
-
* Renders a form field based on its type definition.
|
|
20
|
-
* Uses Bootstrap form components for styling.
|
|
21
|
-
* Works with hierarchical store structure.
|
|
22
|
-
*/ field: FieldDefinition;
|
|
2
|
+
/**
|
|
3
|
+
* Generic Field Renderer
|
|
4
|
+
*
|
|
5
|
+
* Renders a form field based on its type definition.
|
|
6
|
+
* Uses Bootstrap form components for styling.
|
|
7
|
+
* Works with hierarchical store structure.
|
|
8
|
+
*/
|
|
9
|
+
interface Props {
|
|
10
|
+
field: FieldDefinition;
|
|
23
11
|
segmentId: string;
|
|
24
12
|
store: any;
|
|
25
13
|
value: any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type FieldRenderer = InstanceType<typeof FieldRenderer>;
|
|
14
|
+
}
|
|
15
|
+
declare const FieldRenderer: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type FieldRenderer = ReturnType<typeof FieldRenderer>;
|
|
30
17
|
export default FieldRenderer;
|