@smartnet360/svelte-components 0.0.101 → 0.0.103

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 (81) hide show
  1. package/dist/apps/antenna-pattern/index.d.ts +1 -0
  2. package/dist/apps/antenna-pattern/index.js +1 -0
  3. package/dist/apps/antenna-pattern/utils/load-static-antennas.d.ts +17 -0
  4. package/dist/apps/antenna-pattern/utils/load-static-antennas.js +83 -0
  5. package/dist/apps/site-check/SiteCheck.svelte +4 -6
  6. package/dist/core/Charts/ChartCard.svelte +122 -12
  7. package/dist/core/Charts/ChartCard.svelte.d.ts +2 -0
  8. package/dist/core/Charts/ChartComponent.svelte +8 -6
  9. package/dist/core/CoverageMap/ai/AITools.d.ts +117 -0
  10. package/dist/core/CoverageMap/ai/AITools.js +380 -0
  11. package/dist/core/CoverageMap/core/CoverageCalculator.d.ts +138 -0
  12. package/dist/core/CoverageMap/core/CoverageCalculator.js +375 -0
  13. package/dist/core/CoverageMap/core/GridCalculator.d.ts +115 -0
  14. package/dist/core/CoverageMap/core/GridCalculator.js +484 -0
  15. package/dist/core/CoverageMap/core/PathLossModels.d.ts +253 -0
  16. package/dist/core/CoverageMap/core/PathLossModels.js +380 -0
  17. package/dist/core/CoverageMap/core/SignalProcessor.d.ts +288 -0
  18. package/dist/core/CoverageMap/core/SignalProcessor.js +424 -0
  19. package/dist/core/CoverageMap/data/AntennaStore.d.ts +165 -0
  20. package/dist/core/CoverageMap/data/AntennaStore.js +327 -0
  21. package/dist/core/CoverageMap/data/SiteStore.d.ts +155 -0
  22. package/dist/core/CoverageMap/data/SiteStore.js +355 -0
  23. package/dist/core/CoverageMap/index.d.ts +74 -0
  24. package/dist/core/CoverageMap/index.js +103 -0
  25. package/dist/core/CoverageMap/types.d.ts +252 -0
  26. package/dist/core/CoverageMap/types.js +7 -0
  27. package/dist/core/CoverageMap/utils/geoUtils.d.ts +223 -0
  28. package/dist/core/CoverageMap/utils/geoUtils.js +374 -0
  29. package/dist/core/CoverageMap/utils/rfUtils.d.ts +329 -0
  30. package/dist/core/CoverageMap/utils/rfUtils.js +434 -0
  31. package/dist/core/CoverageMap/visualization/ColorSchemes.d.ts +149 -0
  32. package/dist/core/CoverageMap/visualization/ColorSchemes.js +377 -0
  33. package/dist/core/TreeView/index.d.ts +4 -4
  34. package/dist/core/TreeView/index.js +5 -5
  35. package/dist/core/TreeView/tree-utils.d.ts +12 -0
  36. package/dist/core/TreeView/tree-utils.js +115 -6
  37. package/dist/core/TreeView/tree.store.svelte.d.ts +94 -0
  38. package/dist/core/TreeView/tree.store.svelte.js +274 -0
  39. package/dist/map-v2/features/cells/controls/CellFilterControl.svelte +16 -27
  40. package/dist/map-v2/features/cells/utils/cellGeoJSON.js +1 -0
  41. package/dist/map-v2/features/repeaters/controls/RepeaterFilterControl.svelte +33 -42
  42. package/dist/map-v2/features/sites/controls/SiteFilterControl.svelte +12 -19
  43. package/dist/map-v3/core/components/Map.svelte +4 -0
  44. package/dist/map-v3/core/stores/map.store.svelte.js +2 -0
  45. package/dist/map-v3/demo/DemoMap.svelte +31 -5
  46. package/dist/map-v3/demo/demo-cells.js +51 -22
  47. package/dist/map-v3/features/cells/components/CellFilterControl.svelte +24 -30
  48. package/dist/map-v3/features/cells/layers/CellsLayer.svelte +29 -9
  49. package/dist/map-v3/features/cells/logic/geometry.js +3 -0
  50. package/dist/map-v3/features/cells/stores/cell.data.svelte.d.ts +27 -0
  51. package/dist/map-v3/features/cells/stores/cell.data.svelte.js +65 -0
  52. package/dist/map-v3/features/coverage/index.d.ts +12 -0
  53. package/dist/map-v3/features/coverage/index.js +16 -0
  54. package/dist/map-v3/features/coverage/layers/CoverageLayer.svelte +198 -0
  55. package/dist/map-v3/features/coverage/layers/CoverageLayer.svelte.d.ts +10 -0
  56. package/dist/map-v3/features/coverage/logic/coloring.d.ts +28 -0
  57. package/dist/map-v3/features/coverage/logic/coloring.js +77 -0
  58. package/dist/map-v3/features/coverage/logic/geometry.d.ts +33 -0
  59. package/dist/map-v3/features/coverage/logic/geometry.js +112 -0
  60. package/dist/map-v3/features/coverage/stores/coverage.data.svelte.d.ts +46 -0
  61. package/dist/map-v3/features/coverage/stores/coverage.data.svelte.js +95 -0
  62. package/dist/map-v3/features/coverage/stores/coverage.display.svelte.d.ts +33 -0
  63. package/dist/map-v3/features/coverage/stores/coverage.display.svelte.js +90 -0
  64. package/dist/map-v3/features/coverage/types.d.ts +52 -0
  65. package/dist/map-v3/features/coverage/types.js +7 -0
  66. package/dist/map-v3/features/repeaters/components/RepeaterFilterControl.svelte +14 -20
  67. package/dist/map-v3/features/selection/components/FeatureSelectionControl.svelte +82 -65
  68. package/dist/map-v3/features/selection/components/FeatureSelectionControl.svelte.d.ts +5 -9
  69. package/dist/map-v3/features/selection/index.d.ts +1 -2
  70. package/dist/map-v3/features/selection/index.js +0 -1
  71. package/dist/map-v3/features/selection/stores/selection.store.svelte.d.ts +44 -15
  72. package/dist/map-v3/features/selection/stores/selection.store.svelte.js +163 -40
  73. package/dist/map-v3/features/selection/types.d.ts +4 -2
  74. package/dist/map-v3/features/sites/components/SiteFilterControl.svelte +23 -33
  75. package/dist/map-v3/index.d.ts +4 -0
  76. package/dist/map-v3/index.js +5 -0
  77. package/package.json +2 -2
  78. package/dist/core/TreeView/tree.store.d.ts +0 -10
  79. package/dist/core/TreeView/tree.store.js +0 -320
  80. package/dist/map-v3/features/selection/layers/SelectionHighlightLayers.svelte +0 -209
  81. package/dist/map-v3/features/selection/layers/SelectionHighlightLayers.svelte.d.ts +0 -13
@@ -3,58 +3,58 @@
3
3
  import { MapControl } from '../../../shared';
4
4
  import type { MapStore } from '../../../core/stores/map.store.svelte';
5
5
  import type { CellDataStore } from '../../cells/stores/cell.data.svelte';
6
- import type { CellDisplayStore } from '../../cells/stores/cell.display.svelte';
7
- import { createFeatureSelectionStore } from '../stores/selection.store.svelte';
8
- import SelectionHighlightLayers from '../layers/SelectionHighlightLayers.svelte';
6
+ import { createFeatureSelectionStore, type SelectionMode } from '../stores/selection.store.svelte';
9
7
  import type { SelectedFeature } from '../types';
8
+ import type { Snippet } from 'svelte';
10
9
 
11
10
  interface Props {
12
- cellDataStore?: CellDataStore;
13
- cellDisplayStore?: CellDisplayStore;
11
+ cellDataStore: CellDataStore;
14
12
  position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
15
13
  title?: string;
16
14
  icon?: string;
17
15
  iconOnlyWhenCollapsed?: boolean;
18
- onAction?: (featureIds: string[]) => void;
19
- actionButtonLabel?: string;
20
16
  featureIcon?: string;
21
- idPropertyOptions?: string[];
22
- defaultIdProperty?: string;
23
- highlightColor?: string;
24
- highlightWidth?: number;
17
+ defaultSelectionMode?: SelectionMode;
18
+ children?: Snippet<[string[]]>;
25
19
  }
26
20
 
27
21
  let {
28
22
  cellDataStore,
29
- cellDisplayStore,
30
23
  position = 'top-left',
31
24
  title = 'Feature Selection',
32
25
  icon = 'cursor-fill',
33
26
  iconOnlyWhenCollapsed = true,
34
- onAction,
35
- actionButtonLabel = 'Process Selection',
36
27
  featureIcon = 'geo-alt-fill',
37
- idPropertyOptions = ['siteId', 'sectorId', 'cellName'],
38
- defaultIdProperty = 'siteId',
39
- highlightColor = '#FF6B00',
40
- highlightWidth = 4
28
+ defaultSelectionMode = 'site',
29
+ children
41
30
  }: Props = $props();
42
31
 
43
32
  const mapStore = getContext<MapStore>('MAP_CONTEXT');
44
33
  const store = createFeatureSelectionStore();
45
34
 
46
- store.setIdProperty(defaultIdProperty);
47
-
35
+ // Initialize selection mode
36
+ store.setIdProperty(defaultSelectionMode);
37
+
48
38
  let selectedFeatures = $derived(store.getSelectedFeatures());
49
39
  let selectionCount = $derived(store.count);
40
+ let cellCount = $derived(store.cellCount);
41
+ let selectedIds = $derived(store.getSelectedIds());
50
42
  let hasSelection = $derived(selectionCount > 0);
51
43
  let isCollapsed = $state(false);
44
+ let currentMode = $state<SelectionMode>(defaultSelectionMode);
45
+ let isInitialized = $state(false);
52
46
 
47
+ // Initialize store with map and cell data (run once)
53
48
  $effect(() => {
49
+ if (isInitialized) return;
50
+
54
51
  const map = mapStore.map;
55
- if (map && !store['map']) {
52
+ if (map) {
53
+ console.log('[FeatureSelectionControl] Initializing selection store');
56
54
  store.setMap(map);
55
+ store.setCellDataStore(cellDataStore);
57
56
  store.enableSelectionMode();
57
+ isInitialized = true;
58
58
  }
59
59
  });
60
60
 
@@ -71,9 +71,11 @@
71
71
  }
72
72
  }
73
73
 
74
- function handleIdPropertyChange(event: Event) {
74
+ function handleModeChange(event: Event) {
75
75
  const target = event.target as HTMLSelectElement;
76
- store.setIdProperty(target.value);
76
+ const mode = target.value as SelectionMode;
77
+ currentMode = mode;
78
+ store.setIdProperty(mode);
77
79
  }
78
80
 
79
81
  function handleRemoveFeature(featureId: string) {
@@ -85,7 +87,7 @@
85
87
  }
86
88
 
87
89
  async function handleCopy() {
88
- const ids = store.getSelectedIds().join(',');
90
+ const ids = selectedIds.join(',');
89
91
  try {
90
92
  await navigator.clipboard.writeText(ids);
91
93
  console.log('[FeatureSelection] Copied to clipboard:', ids);
@@ -94,14 +96,22 @@
94
96
  }
95
97
  }
96
98
 
97
- function handleAction() {
98
- if (onAction && hasSelection) {
99
- const ids = store.getSelectedIds();
100
- onAction(ids);
99
+ // Get display label for selection mode
100
+ function getModeLabel(mode: SelectionMode): string {
101
+ switch (mode) {
102
+ case 'site': return 'Site (all sectors)';
103
+ case 'sector': return 'Sector (all bands)';
104
+ case 'cell': return 'Individual Cell';
101
105
  }
102
106
  }
103
- </script>
104
107
 
108
+ // Get cell count description for a feature
109
+ function getCellCountText(feature: SelectedFeature): string {
110
+ const count = feature.cellNames?.length || 0;
111
+ if (count <= 1) return '';
112
+ return ` (${count} cells)`;
113
+ }
114
+ </script>
105
115
  <MapControl
106
116
  {position}
107
117
  {title}
@@ -109,28 +119,45 @@
109
119
  {iconOnlyWhenCollapsed}
110
120
  collapsible={true}
111
121
  onCollapseToggle={handleCollapseToggle}
112
- controlWidth="300px"
122
+ controlWidth="320px"
113
123
  >
114
124
  <div class="feature-selection-control">
115
- <!-- ID Property Selector -->
125
+ <!-- Selection Mode Selector -->
116
126
  <div class="mb-3">
117
- <label for="id-property-select" class="form-label small fw-semibold">Select By</label>
127
+ <label for="mode-select" class="form-label small fw-semibold">Selection Mode</label>
118
128
  <select
119
- id="id-property-select"
129
+ id="mode-select"
120
130
  class="form-select form-select-sm"
121
- value={store.idProperty}
122
- onchange={handleIdPropertyChange}
131
+ value={currentMode}
132
+ onchange={handleModeChange}
123
133
  >
124
- {#each idPropertyOptions as option}
125
- <option value={option}>{option}</option>
126
- {/each}
134
+ <option value="site">{getModeLabel('site')}</option>
135
+ <option value="sector">{getModeLabel('sector')}</option>
136
+ <option value="cell">{getModeLabel('cell')}</option>
127
137
  </select>
138
+ <div class="form-text small mt-1">
139
+ {#if currentMode === 'site'}
140
+ Click any cell to select all cells at that site
141
+ {:else if currentMode === 'sector'}
142
+ Click any cell to select all cells in that sector
143
+ {:else}
144
+ Click to select individual cells
145
+ {/if}
146
+ </div>
128
147
  </div>
129
148
 
130
149
  <!-- Selection Stats -->
131
- <div class="selection-stats mb-2 text-secondary">
132
- <strong>{selectionCount}</strong>
133
- {selectionCount === 1 ? 'item' : 'items'} selected
150
+ <div class="selection-stats mb-2">
151
+ <div class="d-flex justify-content-between align-items-center">
152
+ <span class="text-secondary">
153
+ <strong>{selectionCount}</strong> {selectionCount === 1 ? 'group' : 'groups'}
154
+ </span>
155
+ {#if cellCount > selectionCount}
156
+ <span class="badge bg-secondary">
157
+ {cellCount} {cellCount === 1 ? 'cell' : 'cells'} total
158
+ </span>
159
+ {/if}
160
+ </div>
134
161
  </div>
135
162
 
136
163
  <!-- Action Buttons -->
@@ -162,11 +189,17 @@
162
189
  <div class="feature-list">
163
190
  {#each selectedFeatures as feature (feature.id)}
164
191
  <div class="feature-item">
165
- <i class="bi bi-{featureIcon} feature-icon"></i>
192
+ <i class="bi bi-grid-3x3-gap-fill feature-icon"></i>
166
193
  <div class="feature-info">
167
- <span class="feature-id">{feature.id}</span>
168
- {#if feature.layerId}
169
- <small class="feature-layer text-muted">{feature.layerId}</small>
194
+ <span class="feature-id">
195
+ {feature.id}{getCellCountText(feature)}
196
+ </span>
197
+ {#if currentMode === 'site'}
198
+ <small class="feature-layer text-muted">Site</small>
199
+ {:else if currentMode === 'sector'}
200
+ <small class="feature-layer text-muted">Sector</small>
201
+ {:else}
202
+ <small class="feature-layer text-muted">Cell</small>
170
203
  {/if}
171
204
  </div>
172
205
  <button
@@ -185,35 +218,19 @@
185
218
  <div class="text-muted small text-center py-3">
186
219
  <i class="bi bi-inbox" style="font-size: 2rem; opacity: 0.3;"></i>
187
220
  <div class="mt-2">No items selected</div>
188
- <div class="mt-1">Click on features to select</div>
221
+ <div class="mt-1">Click on map to select</div>
189
222
  </div>
190
223
  {/if}
191
224
 
192
- <!-- Action Button -->
193
- {#if onAction}
225
+ <!-- Custom Action Buttons (snippet) -->
226
+ {#if children}
194
227
  <div class="mt-3">
195
- <button
196
- type="button"
197
- class="btn btn-primary w-100"
198
- disabled={!hasSelection}
199
- onclick={handleAction}
200
- >
201
- <i class="bi bi-lightning-charge-fill"></i> {actionButtonLabel}
202
- </button>
228
+ {@render children(selectedIds)}
203
229
  </div>
204
230
  {/if}
205
231
  </div>
206
232
  </MapControl>
207
233
 
208
- <!-- Highlight Layers -->
209
- <SelectionHighlightLayers
210
- {selectedFeatures}
211
- {cellDataStore}
212
- {cellDisplayStore}
213
- {highlightColor}
214
- {highlightWidth}
215
- />
216
-
217
234
  <style>
218
235
  .feature-selection-control {
219
236
  width: 100%;
@@ -1,19 +1,15 @@
1
1
  import type { CellDataStore } from '../../cells/stores/cell.data.svelte';
2
- import type { CellDisplayStore } from '../../cells/stores/cell.display.svelte';
2
+ import { type SelectionMode } from '../stores/selection.store.svelte';
3
+ import type { Snippet } from 'svelte';
3
4
  interface Props {
4
- cellDataStore?: CellDataStore;
5
- cellDisplayStore?: CellDisplayStore;
5
+ cellDataStore: CellDataStore;
6
6
  position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
7
7
  title?: string;
8
8
  icon?: string;
9
9
  iconOnlyWhenCollapsed?: boolean;
10
- onAction?: (featureIds: string[]) => void;
11
- actionButtonLabel?: string;
12
10
  featureIcon?: string;
13
- idPropertyOptions?: string[];
14
- defaultIdProperty?: string;
15
- highlightColor?: string;
16
- highlightWidth?: number;
11
+ defaultSelectionMode?: SelectionMode;
12
+ children?: Snippet<[string[]]>;
17
13
  }
18
14
  declare const FeatureSelectionControl: import("svelte").Component<Props, {}, "">;
19
15
  type FeatureSelectionControl = ReturnType<typeof FeatureSelectionControl>;
@@ -4,6 +4,5 @@
4
4
  * Exports all selection-related components, stores, and types.
5
5
  */
6
6
  export type { SelectedFeature, SelectionStoreState } from './types';
7
- export { createFeatureSelectionStore, FeatureSelectionStore } from './stores/selection.store.svelte';
7
+ export { createFeatureSelectionStore, FeatureSelectionStore, type SelectionMode } from './stores/selection.store.svelte';
8
8
  export { default as FeatureSelectionControl } from './components/FeatureSelectionControl.svelte';
9
- export { default as SelectionHighlightLayers } from './layers/SelectionHighlightLayers.svelte';
@@ -7,4 +7,3 @@
7
7
  export { createFeatureSelectionStore, FeatureSelectionStore } from './stores/selection.store.svelte';
8
8
  // Components
9
9
  export { default as FeatureSelectionControl } from './components/FeatureSelectionControl.svelte';
10
- export { default as SelectionHighlightLayers } from './layers/SelectionHighlightLayers.svelte';
@@ -2,14 +2,19 @@
2
2
  * Feature Selection Store - Svelte 5 Runes Implementation
3
3
  *
4
4
  * Manages selection of map features (cells, sites) with click detection.
5
+ * Supports multi-cell selection based on site/sector hierarchy.
5
6
  */
6
7
  import type { Map as MapboxMap } from 'mapbox-gl';
7
8
  import type { SelectedFeature } from '../types';
9
+ import type { CellDataStore } from '../../cells/stores/cell.data.svelte';
10
+ export type SelectionMode = 'cell' | 'sector' | 'site';
8
11
  export declare class FeatureSelectionStore {
9
12
  private selectedFeatures;
13
+ private selectedCellNames;
10
14
  private map;
15
+ private cellDataStore;
11
16
  selectionMode: boolean;
12
- idProperty: string;
17
+ idProperty: SelectionMode;
13
18
  queryLayers: string[];
14
19
  private clickHandler;
15
20
  private onSelectionChange?;
@@ -18,9 +23,13 @@ export declare class FeatureSelectionStore {
18
23
  */
19
24
  setMap(mapInstance: MapboxMap): void;
20
25
  /**
21
- * Set which property to use as the ID
26
+ * Set the cell data store for lookup maps
22
27
  */
23
- setIdProperty(property: string): void;
28
+ setCellDataStore(dataStore: CellDataStore): void;
29
+ /**
30
+ * Set which property to use as the ID (selection mode)
31
+ */
32
+ setIdProperty(property: SelectionMode): void;
24
33
  /**
25
34
  * Set which layers to query for features
26
35
  */
@@ -34,45 +43,65 @@ export declare class FeatureSelectionStore {
34
43
  */
35
44
  private setupClickHandler;
36
45
  /**
37
- * Enable selection mode
46
+ * Handle click on a cell - expand to site/sector based on mode
38
47
  */
39
- enableSelectionMode(): void;
48
+ private handleCellClick;
40
49
  /**
41
- * Disable selection mode
50
+ * Handle click on a site marker (if sites layer exists)
42
51
  */
43
- disableSelectionMode(): void;
52
+ private handleSiteClick;
44
53
  /**
45
- * Toggle a feature in the selection
54
+ * Toggle a group of cells (site or sector)
46
55
  */
47
- toggleFeatureSelection(id: string, layerId?: string, properties?: Record<string, any>, siteId?: string, cellName?: string): void;
56
+ private toggleGroupSelection;
48
57
  /**
49
- * Add a feature to the selection
58
+ * Update Mapbox feature-state for cells
50
59
  */
51
- addFeatureSelection(id: string, layerId?: string, properties?: Record<string, any>, siteId?: string, cellName?: string): void;
60
+ private updateFeatureStates;
52
61
  /**
53
- * Remove a feature from the selection
62
+ * Enable selection mode
54
63
  */
55
- removeFeatureSelection(id: string): void;
64
+ enableSelectionMode(): void;
65
+ /**
66
+ * Disable selection mode
67
+ */
68
+ disableSelectionMode(): void;
56
69
  /**
57
70
  * Clear all selections
58
71
  */
59
72
  clearSelection(): void;
73
+ /**
74
+ * Remove a selection group by ID
75
+ */
76
+ removeFeatureSelection(id: string): void;
60
77
  /**
61
78
  * Get all selected features
62
79
  */
63
80
  getSelectedFeatures(): SelectedFeature[];
64
81
  /**
65
- * Get selected feature IDs only
82
+ * Get selected group IDs (site/sector/cell IDs)
66
83
  */
67
84
  getSelectedIds(): string[];
85
+ /**
86
+ * Get all selected cell names (flattened from all groups)
87
+ */
88
+ getSelectedCellNames(): string[];
68
89
  /**
69
90
  * Check if a feature is selected
70
91
  */
71
92
  isFeatureSelected(id: string): boolean;
72
93
  /**
73
- * Get selection count
94
+ * Check if a specific cell is selected
95
+ */
96
+ isCellSelected(cellName: string): boolean;
97
+ /**
98
+ * Get selection count (number of groups, not individual cells)
74
99
  */
75
100
  get count(): number;
101
+ /**
102
+ * Get total number of selected cells
103
+ */
104
+ get cellCount(): number;
76
105
  /**
77
106
  * Cleanup - remove event handlers
78
107
  */