@smartnet360/svelte-components 0.0.40 → 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.
Files changed (31) hide show
  1. package/dist/apps/antenna-pattern/components/AntennaDiagrams.svelte +0 -5
  2. package/dist/apps/antenna-pattern/components/DbNotification.svelte +1 -1
  3. package/dist/apps/antenna-pattern/components/chart-engines/PolarBarChart.svelte +2 -0
  4. package/dist/apps/antenna-pattern/components/chart-engines/PolarBarChart.svelte.d.ts +1 -0
  5. package/dist/apps/site-check/helper.js +3 -0
  6. package/dist/core/Charts/ChartCard.svelte +9 -12
  7. package/dist/core/Charts/ChartCard.svelte.d.ts +5 -21
  8. package/dist/core/Charts/ChartComponent.svelte +2 -2
  9. package/dist/core/Charts/editor/ChartLayoutEditor.svelte +8 -8
  10. package/dist/core/Charts/editor/GridPreview.svelte +0 -3
  11. package/dist/core/Charts/editor/KPIPicker.svelte +6 -7
  12. package/dist/core/Charts/editor/KPIPicker.svelte.d.ts +4 -20
  13. package/dist/core/Charts/editor/PropertiesPanel.svelte +6 -3
  14. package/dist/core/Charts/editor/PropertiesPanel.svelte.d.ts +8 -18
  15. package/dist/core/Map/Map.svelte +312 -0
  16. package/dist/core/Map/Map.svelte.d.ts +230 -0
  17. package/dist/core/Map/index.d.ts +9 -0
  18. package/dist/core/Map/index.js +9 -0
  19. package/dist/core/Map/mapSettings.d.ts +147 -0
  20. package/dist/core/Map/mapSettings.js +226 -0
  21. package/dist/core/Map/mapStore.d.ts +73 -0
  22. package/dist/core/Map/mapStore.js +136 -0
  23. package/dist/core/Map/types.d.ts +72 -0
  24. package/dist/core/Map/types.js +32 -0
  25. package/dist/core/Settings/FieldRenderer.svelte +19 -15
  26. package/dist/core/Settings/FieldRenderer.svelte.d.ts +12 -25
  27. package/dist/core/Settings/Settings.svelte +48 -29
  28. package/dist/core/Settings/Settings.svelte.d.ts +26 -20
  29. package/dist/core/index.d.ts +1 -0
  30. package/dist/core/index.js +2 -0
  31. package/package.json +15 -11
@@ -0,0 +1,230 @@
1
+ import type { Layer } from '@deck.gl/core';
2
+ import { type MapStore } from './mapStore';
3
+ import { type MapOptions } from './types';
4
+ interface Props {
5
+ accessToken: string;
6
+ initialOptions?: Partial<MapOptions>;
7
+ namespace?: string;
8
+ layers?: Layer[];
9
+ mapStore?: MapStore;
10
+ onMapLoaded?: (map: mapboxgl.Map) => void;
11
+ }
12
+ declare const Map: import("svelte").Component<Props, {
13
+ settings: {
14
+ subscribe: (this: void, run: import("svelte/store").Subscriber<import("..").InferSettingsType<{
15
+ segments: ({
16
+ id: string;
17
+ title: string;
18
+ icon: string;
19
+ description: string;
20
+ fields: ({
21
+ id: string;
22
+ type: "select";
23
+ label: string;
24
+ description: string;
25
+ defaultValue: string;
26
+ options: {
27
+ value: string;
28
+ label: string;
29
+ description: string;
30
+ }[];
31
+ } | {
32
+ id: string;
33
+ type: "boolean";
34
+ label: string;
35
+ description: string;
36
+ defaultValue: true;
37
+ options?: undefined;
38
+ } | {
39
+ id: string;
40
+ type: "boolean";
41
+ label: string;
42
+ description: string;
43
+ defaultValue: false;
44
+ options?: undefined;
45
+ })[];
46
+ } | {
47
+ id: string;
48
+ title: string;
49
+ icon: string;
50
+ description: string;
51
+ fields: ({
52
+ id: string;
53
+ type: "range";
54
+ label: string;
55
+ description: string;
56
+ defaultValue: number;
57
+ min: number;
58
+ max: number;
59
+ step: number;
60
+ showValue: true;
61
+ unit: string;
62
+ } | {
63
+ id: string;
64
+ type: "number";
65
+ label: string;
66
+ description: string;
67
+ defaultValue: number;
68
+ min: number;
69
+ max: number;
70
+ step: number;
71
+ showValue?: undefined;
72
+ unit?: undefined;
73
+ })[];
74
+ } | {
75
+ id: string;
76
+ title: string;
77
+ icon: string;
78
+ description: string;
79
+ fields: ({
80
+ id: string;
81
+ type: "select";
82
+ label: string;
83
+ description: string;
84
+ defaultValue: number;
85
+ options: {
86
+ value: number;
87
+ label: string;
88
+ }[];
89
+ min?: undefined;
90
+ max?: undefined;
91
+ step?: undefined;
92
+ unit?: undefined;
93
+ } | {
94
+ id: string;
95
+ type: "boolean";
96
+ label: string;
97
+ description: string;
98
+ defaultValue: true;
99
+ options?: undefined;
100
+ min?: undefined;
101
+ max?: undefined;
102
+ step?: undefined;
103
+ unit?: undefined;
104
+ } | {
105
+ id: string;
106
+ type: "number";
107
+ label: string;
108
+ description: string;
109
+ defaultValue: number;
110
+ min: number;
111
+ max: number;
112
+ step: number;
113
+ unit: string;
114
+ options?: undefined;
115
+ })[];
116
+ })[];
117
+ }>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
118
+ update: (segmentId: string, fieldId: string, value: any) => void;
119
+ updateSegment: (segmentId: string, values: Record<string, any>) => void;
120
+ reset: (segmentId: string, fieldId: string) => void;
121
+ resetSegment: (segmentId: string) => void;
122
+ resetAll: () => void;
123
+ getValues: () => import("..").InferSettingsType<{
124
+ segments: ({
125
+ id: string;
126
+ title: string;
127
+ icon: string;
128
+ description: string;
129
+ fields: ({
130
+ id: string;
131
+ type: "select";
132
+ label: string;
133
+ description: string;
134
+ defaultValue: string;
135
+ options: {
136
+ value: string;
137
+ label: string;
138
+ description: string;
139
+ }[];
140
+ } | {
141
+ id: string;
142
+ type: "boolean";
143
+ label: string;
144
+ description: string;
145
+ defaultValue: true;
146
+ options?: undefined;
147
+ } | {
148
+ id: string;
149
+ type: "boolean";
150
+ label: string;
151
+ description: string;
152
+ defaultValue: false;
153
+ options?: undefined;
154
+ })[];
155
+ } | {
156
+ id: string;
157
+ title: string;
158
+ icon: string;
159
+ description: string;
160
+ fields: ({
161
+ id: string;
162
+ type: "range";
163
+ label: string;
164
+ description: string;
165
+ defaultValue: number;
166
+ min: number;
167
+ max: number;
168
+ step: number;
169
+ showValue: true;
170
+ unit: string;
171
+ } | {
172
+ id: string;
173
+ type: "number";
174
+ label: string;
175
+ description: string;
176
+ defaultValue: number;
177
+ min: number;
178
+ max: number;
179
+ step: number;
180
+ showValue?: undefined;
181
+ unit?: undefined;
182
+ })[];
183
+ } | {
184
+ id: string;
185
+ title: string;
186
+ icon: string;
187
+ description: string;
188
+ fields: ({
189
+ id: string;
190
+ type: "select";
191
+ label: string;
192
+ description: string;
193
+ defaultValue: number;
194
+ options: {
195
+ value: number;
196
+ label: string;
197
+ }[];
198
+ min?: undefined;
199
+ max?: undefined;
200
+ step?: undefined;
201
+ unit?: undefined;
202
+ } | {
203
+ id: string;
204
+ type: "boolean";
205
+ label: string;
206
+ description: string;
207
+ defaultValue: true;
208
+ options?: undefined;
209
+ min?: undefined;
210
+ max?: undefined;
211
+ step?: undefined;
212
+ unit?: undefined;
213
+ } | {
214
+ id: string;
215
+ type: "number";
216
+ label: string;
217
+ description: string;
218
+ defaultValue: number;
219
+ min: number;
220
+ max: number;
221
+ step: number;
222
+ unit: string;
223
+ options?: undefined;
224
+ })[];
225
+ })[];
226
+ }>;
227
+ };
228
+ }, "mapStore">;
229
+ type Map = ReturnType<typeof Map>;
230
+ export default Map;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Map Component Exports
3
+ *
4
+ * Barrel export for clean imports
5
+ */
6
+ export { default as Map } from './Map.svelte';
7
+ export { createMapStore, isMapReady, getMapInstance, type MapStore } from './mapStore';
8
+ export { mapSettingsSchema, type MapSettings } from './mapSettings';
9
+ export { MAP_STYLES, DEFAULT_MAP_OPTIONS, type MapOptions, type MapState, type MapStyleName } from './types';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Map Component Exports
3
+ *
4
+ * Barrel export for clean imports
5
+ */
6
+ export { default as Map } from './Map.svelte';
7
+ export { createMapStore, isMapReady, getMapInstance } from './mapStore';
8
+ export { mapSettingsSchema } from './mapSettings';
9
+ export { MAP_STYLES, DEFAULT_MAP_OPTIONS } from './types';
@@ -0,0 +1,147 @@
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
+ /**
8
+ * Map settings schema for use with Settings component
9
+ */
10
+ export declare const mapSettingsSchema: {
11
+ segments: ({
12
+ id: string;
13
+ title: string;
14
+ icon: string;
15
+ description: string;
16
+ fields: ({
17
+ id: string;
18
+ type: "select";
19
+ label: string;
20
+ description: string;
21
+ defaultValue: string;
22
+ options: {
23
+ value: string;
24
+ label: string;
25
+ description: string;
26
+ }[];
27
+ } | {
28
+ id: string;
29
+ type: "boolean";
30
+ label: string;
31
+ description: string;
32
+ defaultValue: true;
33
+ options?: undefined;
34
+ } | {
35
+ id: string;
36
+ type: "boolean";
37
+ label: string;
38
+ description: string;
39
+ defaultValue: false;
40
+ options?: undefined;
41
+ })[];
42
+ } | {
43
+ id: string;
44
+ title: string;
45
+ icon: string;
46
+ description: string;
47
+ fields: ({
48
+ id: string;
49
+ type: "range";
50
+ label: string;
51
+ description: string;
52
+ defaultValue: number;
53
+ min: number;
54
+ max: number;
55
+ step: number;
56
+ showValue: true;
57
+ unit: string;
58
+ } | {
59
+ id: string;
60
+ type: "number";
61
+ label: string;
62
+ description: string;
63
+ defaultValue: number;
64
+ min: number;
65
+ max: number;
66
+ step: number;
67
+ showValue?: undefined;
68
+ unit?: undefined;
69
+ })[];
70
+ } | {
71
+ id: string;
72
+ title: string;
73
+ icon: string;
74
+ description: string;
75
+ fields: ({
76
+ id: string;
77
+ type: "select";
78
+ label: string;
79
+ description: string;
80
+ defaultValue: number;
81
+ options: {
82
+ value: number;
83
+ label: string;
84
+ }[];
85
+ min?: undefined;
86
+ max?: undefined;
87
+ step?: undefined;
88
+ unit?: undefined;
89
+ } | {
90
+ id: string;
91
+ type: "boolean";
92
+ label: string;
93
+ description: string;
94
+ defaultValue: true;
95
+ options?: undefined;
96
+ min?: undefined;
97
+ max?: undefined;
98
+ step?: undefined;
99
+ unit?: undefined;
100
+ } | {
101
+ id: string;
102
+ type: "number";
103
+ label: string;
104
+ description: string;
105
+ defaultValue: number;
106
+ min: number;
107
+ max: number;
108
+ step: number;
109
+ unit: string;
110
+ options?: undefined;
111
+ })[];
112
+ })[];
113
+ };
114
+ /**
115
+ * Type inference for map settings
116
+ */
117
+ export type MapSettings = {
118
+ appearance: {
119
+ style: string;
120
+ show3dBuildings: boolean;
121
+ showTerrain: boolean;
122
+ };
123
+ controls: {
124
+ showNavigationControls: boolean;
125
+ showScaleControl: boolean;
126
+ showFullscreenControl: boolean;
127
+ showGeolocateControl: boolean;
128
+ };
129
+ interaction: {
130
+ dragRotate: boolean;
131
+ touchZoomRotate: boolean;
132
+ scrollZoom: boolean;
133
+ doubleClickZoom: boolean;
134
+ dragPan: boolean;
135
+ };
136
+ view: {
137
+ pitch: number;
138
+ bearing: number;
139
+ minZoom: number;
140
+ maxZoom: number;
141
+ };
142
+ performance: {
143
+ maxTileCacheSize: number;
144
+ antialias: boolean;
145
+ fadeDuration: number;
146
+ };
147
+ };
@@ -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>;