@smartnet360/svelte-components 0.0.135 → 0.0.136

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.
@@ -3,8 +3,7 @@ export * from './Charts/index.js';
3
3
  export * from './TreeView/index.js';
4
4
  export * from './Settings/index.js';
5
5
  export * from './logger/index.js';
6
- export * from './CellTable/index.js';
7
- export * as CellTableV2 from './CellTableV2/index.js';
6
+ export * from './CellTableV2/index.js';
8
7
  export * from './CellHistory/index.js';
9
8
  export * from './FeatureRegistry/index.js';
10
9
  export * from './Benchmark/index.js';
@@ -11,11 +11,8 @@ export * from './Settings/index.js';
11
11
  // Logger utility for debugging and monitoring
12
12
  export * from './logger/index.js';
13
13
  // CellTable - Tabulator-based cell data table with Bootstrap theming
14
- export * from './CellTable/index.js';
15
- // CellTableV2 - Refactored with composables architecture
16
- // Use namespaced import to avoid conflicts with V1: import { CellTableV2 } from './'
17
- export * as CellTableV2 from './CellTableV2/index.js';
18
- // CellHistory - Cell configuration history feature (uses CellTableV2)
14
+ export * from './CellTableV2/index.js';
15
+ // CellHistory - Cell configuration history feature (uses CellTable)
19
16
  export * from './CellHistory/index.js';
20
17
  // Map component - Mapbox GL + Deck.GL integration
21
18
  // TODO: Moved to top-level src/lib/map module
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartnet360/svelte-components",
3
- "version": "0.0.135",
3
+ "version": "0.0.136",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -1,240 +0,0 @@
1
- <script lang="ts">
2
- import CellTablePanel from './CellTablePanel.svelte';
3
- import type { RowSelectionEvent, CellHistoryData } from './types';
4
-
5
- /**
6
- * Table-ready history record after transformation
7
- */
8
- interface HistoryTableRow {
9
- id: string;
10
- cellName: string;
11
- frequency: number;
12
- configDate: string;
13
- // Current values
14
- antenna: string;
15
- electricalTilt: number;
16
- mechanicalTilt: number;
17
- power: number;
18
- // Previous values for change comparison
19
- prevAntenna: string;
20
- prevElectricalTilt: number;
21
- prevMechanicalTilt: number;
22
- prevPower: number;
23
- // Virtual fields for the change columns
24
- antennaChange: string;
25
- etiltChange: number;
26
- mtiltChange: number;
27
- powerChange: number;
28
- }
29
-
30
- /**
31
- * Transform API history data to table-friendly format
32
- * Maps UPPER_CASE API fields to camelCase and adds virtual fields for change detection
33
- */
34
- function transformHistoryData(apiData: CellHistoryData[]): HistoryTableRow[] {
35
- return apiData.map((record, index) => ({
36
- id: `hist-${index}`,
37
- cellName: record.CELLNAME,
38
- frequency: record.FREQUENCY,
39
- configDate: record.CONFIG_DATE,
40
- // Current values
41
- antenna: record.ANTENNA_TYPE,
42
- electricalTilt: record.ELECTRONIC_TILT,
43
- mechanicalTilt: record.MECHANIC_TILT,
44
- power: record.ANTOUTPUTPWR,
45
- // Previous values for change comparison
46
- prevAntenna: record.PREV_ANTENNA_TYPE,
47
- prevElectricalTilt: record.PREV_ELECTRONIC_TILT,
48
- prevMechanicalTilt: record.PREV_MECHANIC_TILT,
49
- prevPower: record.PREV_ANTOUTPUTPWR,
50
- // Virtual fields for the change columns (needed for column filtering)
51
- antennaChange: record.ANTENNA_TYPE,
52
- etiltChange: record.ELECTRONIC_TILT,
53
- mtiltChange: record.MECHANIC_TILT,
54
- powerChange: record.ANTOUTPUTPWR,
55
- }));
56
- }
57
-
58
- /**
59
- * Example API data for cell configuration history
60
- */
61
- const EXAMPLE_HISTORY_DATA: CellHistoryData[] = [
62
- {
63
- CELLNAME: '1001141',
64
- FREQUENCY: 1800,
65
- CONFIG_DATE: '2025-12-03T23:00:00.000Z',
66
- ANTENNA_TYPE: 'AQU4521R01v06',
67
- PREV_ANTENNA_TYPE: 'AQU4521R01v06',
68
- ANTOUTPUTPWR: 20,
69
- PREV_ANTOUTPUTPWR: 20,
70
- MECHANIC_TILT: 1,
71
- PREV_MECHANIC_TILT: 1,
72
- ELECTRONIC_TILT: 10,
73
- PREV_ELECTRONIC_TILT: 9
74
- },
75
- {
76
- CELLNAME: '1001141',
77
- FREQUENCY: 1800,
78
- CONFIG_DATE: '2025-09-11T22:00:00.000Z',
79
- ANTENNA_TYPE: 'AQU4521R01v06',
80
- PREV_ANTENNA_TYPE: 'ADU451602v01',
81
- ANTOUTPUTPWR: 20,
82
- PREV_ANTOUTPUTPWR: 20,
83
- MECHANIC_TILT: 1,
84
- PREV_MECHANIC_TILT: 0,
85
- ELECTRONIC_TILT: 9,
86
- PREV_ELECTRONIC_TILT: 10
87
- },
88
- {
89
- CELLNAME: '1001141',
90
- FREQUENCY: 1800,
91
- CONFIG_DATE: '2021-02-15T23:00:00.000Z',
92
- ANTENNA_TYPE: 'ADU451602v01',
93
- PREV_ANTENNA_TYPE: 'ADU451602v01',
94
- ANTOUTPUTPWR: 20,
95
- PREV_ANTOUTPUTPWR: 20,
96
- MECHANIC_TILT: 0,
97
- PREV_MECHANIC_TILT: 2,
98
- ELECTRONIC_TILT: 10,
99
- PREV_ELECTRONIC_TILT: 10
100
- }
101
- ];
102
-
103
- let cellName = $state('1001141');
104
- let rawHistoryData = $state<CellHistoryData[]>(EXAMPLE_HISTORY_DATA);
105
- let historyData = $derived(transformHistoryData(rawHistoryData));
106
-
107
- function loadHistory() {
108
- // TODO: Replace with actual API call
109
- // For now, just reload the example data
110
- console.log(`Loading history for cell: ${cellName}`);
111
- rawHistoryData = EXAMPLE_HISTORY_DATA.filter(r => r.CELLNAME === cellName);
112
- }
113
-
114
- function handleSelectionChange(event: RowSelectionEvent) {
115
- console.log('Selection changed:', event.ids);
116
- }
117
-
118
- /**
119
- * Compare two selected history records
120
- */
121
- function handleCompareTwoRecords(record1: HistoryTableRow, record2: HistoryTableRow) {
122
- const params = new URLSearchParams();
123
-
124
- // Use antenna from both records
125
- if (record1.antenna) params.set('ant1', record1.antenna);
126
- if (record2.antenna) params.set('ant2', record2.antenna);
127
-
128
- // Use frequency (same for both records typically)
129
- params.set('freq1', String(record1.frequency || 1800));
130
- params.set('freq2', String(record2.frequency || 1800));
131
-
132
- // Use electrical tilt values
133
- params.set('etilt1', String(record1.electricalTilt || 0));
134
- params.set('etilt2', String(record2.electricalTilt || 0));
135
-
136
- // Use mechanical tilt values
137
- params.set('mtilt1', String(record1.mechanicalTilt || 0));
138
- params.set('mtilt2', String(record2.mechanicalTilt || 0));
139
-
140
- // Add config date as labels
141
- params.set('label1', `${record1.cellName} (${record1.configDate})`);
142
- params.set('label2', `${record2.cellName} (${record2.configDate})`);
143
-
144
- const url = `/apps/antenna-compare?${params.toString()}`;
145
- window.open(url, '_blank');
146
- }
147
- </script>
148
-
149
- <div class="cell-history-page vh-100 d-flex flex-column">
150
- <!-- Header -->
151
- <div class="demo-controls bg-light border-bottom px-3 py-2 d-flex align-items-center gap-3 flex-wrap">
152
- <div class="input-group input-group-sm" style="width: auto;">
153
- <span class="input-group-text">Cell Name</span>
154
- <input
155
- type="text"
156
- class="form-control"
157
- bind:value={cellName}
158
- style="width: 120px;"
159
- />
160
- <button class="btn btn-outline-primary" onclick={loadHistory}>
161
- <i class="bi bi-arrow-clockwise"></i> Load History
162
- </button>
163
- </div>
164
- <span class="badge bg-info">
165
- {historyData.length} records
166
- </span>
167
- <span class="text-muted small">
168
- Select 2 rows to compare antenna configurations
169
- </span>
170
- </div>
171
-
172
- <!-- CellTablePanel with history preset -->
173
- <div class="flex-grow-1 overflow-hidden">
174
- <CellTablePanel
175
- cells={historyData as unknown as import('./types').CellData[]}
176
- groupBy="none"
177
- storageKey="cell-history-table"
178
- groupOptions={[
179
- { value: 'none', label: 'No Grouping' },
180
- { value: 'antenna', label: 'Antenna Type' },
181
- { value: 'cellname', label: 'Cell Name' },
182
-
183
- ]}
184
- columnPreset="history"
185
- showColumnPresets={false}
186
- selectable={true}
187
- multiSelect={true}
188
- showToolbar={true}
189
- showExport={true}
190
- headerFilters={true}
191
- showDetailsSidebar={false}
192
- showScrollSpy={false}
193
- title="Cell Configuration History"
194
- onselectionchange={handleSelectionChange}
195
- >
196
- {#snippet footer({ selectedRows, selectedCount })}
197
- <div class="d-flex align-items-center justify-content-between">
198
- <span class="text-muted small">
199
- {#if selectedCount > 0}
200
- {selectedCount} record(s) selected
201
- {:else}
202
- Select rows to compare configurations
203
- {/if}
204
- </span>
205
- <div class="btn-group">
206
- <button
207
- type="button"
208
- class="btn btn-sm btn-outline-success"
209
- disabled={selectedCount !== 2}
210
- title={selectedCount === 2 ? 'Compare antenna patterns for selected dates' : 'Select exactly 2 records to compare'}
211
- onclick={() => handleCompareTwoRecords(selectedRows[0] as unknown as HistoryTableRow, selectedRows[1] as unknown as HistoryTableRow)}
212
- >
213
- <i class="bi bi-broadcast-pin"></i>
214
- <span class="d-none d-sm-inline ms-1">Compare Antennas</span>
215
- </button>
216
- <button
217
- type="button"
218
- class="btn btn-sm btn-outline-secondary"
219
- disabled={selectedCount === 0}
220
- onclick={() => console.log('Export:', selectedRows.map(r => r.configDate))}
221
- >
222
- <i class="bi bi-download"></i>
223
- <span class="d-none d-sm-inline ms-1">Export</span>
224
- </button>
225
- </div>
226
- </div>
227
- {/snippet}
228
- </CellTablePanel>
229
- </div>
230
- </div>
231
-
232
- <style>
233
- .cell-history-page {
234
- background: var(--bs-body-bg, #f8f9fa);
235
- }
236
-
237
- .demo-controls {
238
- flex-shrink: 0;
239
- }
240
- </style>
@@ -1,3 +0,0 @@
1
- declare const CellHistoryDemo: import("svelte").Component<Record<string, never>, {}, "">;
2
- type CellHistoryDemo = ReturnType<typeof CellHistoryDemo>;
3
- export default CellHistoryDemo;