@smartnet360/svelte-components 0.0.132 → 0.0.134
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/core/CellTable/CellHistoryDemo.svelte +17 -0
- package/dist/core/CellTable/CellTable.svelte +7 -5
- package/dist/core/CellTable/CellTablePanel.svelte +92 -15
- package/dist/core/CellTable/CellTablePanel.svelte.d.ts +7 -1
- package/dist/core/CellTable/CellTableToolbar.svelte +10 -4
- package/dist/core/CellTable/CellTableToolbar.svelte.d.ts +3 -1
- package/dist/core/CellTable/column-config.js +56 -62
- package/dist/core/CellTable/index.d.ts +1 -1
- package/dist/core/CellTable/types.d.ts +11 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
interface HistoryTableRow {
|
|
9
9
|
id: string;
|
|
10
10
|
cellName: string;
|
|
11
|
+
frequency: number;
|
|
11
12
|
configDate: string;
|
|
12
13
|
// Current values
|
|
13
14
|
antenna: string;
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
return apiData.map((record, index) => ({
|
|
35
36
|
id: `hist-${index}`,
|
|
36
37
|
cellName: record.CELLNAME,
|
|
38
|
+
frequency: record.FREQUENCY,
|
|
37
39
|
configDate: record.CONFIG_DATE,
|
|
38
40
|
// Current values
|
|
39
41
|
antenna: record.ANTENNA_TYPE,
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
const EXAMPLE_HISTORY_DATA: CellHistoryData[] = [
|
|
60
62
|
{
|
|
61
63
|
CELLNAME: '1001141',
|
|
64
|
+
FREQUENCY: 1800,
|
|
62
65
|
CONFIG_DATE: '2025-12-03T23:00:00.000Z',
|
|
63
66
|
ANTENNA_TYPE: 'AQU4521R01v06',
|
|
64
67
|
PREV_ANTENNA_TYPE: 'AQU4521R01v06',
|
|
@@ -71,6 +74,7 @@
|
|
|
71
74
|
},
|
|
72
75
|
{
|
|
73
76
|
CELLNAME: '1001141',
|
|
77
|
+
FREQUENCY: 1800,
|
|
74
78
|
CONFIG_DATE: '2025-09-11T22:00:00.000Z',
|
|
75
79
|
ANTENNA_TYPE: 'AQU4521R01v06',
|
|
76
80
|
PREV_ANTENNA_TYPE: 'ADU451602v01',
|
|
@@ -83,6 +87,7 @@
|
|
|
83
87
|
},
|
|
84
88
|
{
|
|
85
89
|
CELLNAME: '1001141',
|
|
90
|
+
FREQUENCY: 1800,
|
|
86
91
|
CONFIG_DATE: '2021-02-15T23:00:00.000Z',
|
|
87
92
|
ANTENNA_TYPE: 'ADU451602v01',
|
|
88
93
|
PREV_ANTENNA_TYPE: 'ADU451602v01',
|
|
@@ -120,6 +125,10 @@
|
|
|
120
125
|
if (record1.antenna) params.set('ant1', record1.antenna);
|
|
121
126
|
if (record2.antenna) params.set('ant2', record2.antenna);
|
|
122
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
|
+
|
|
123
132
|
// Use electrical tilt values
|
|
124
133
|
params.set('etilt1', String(record1.electricalTilt || 0));
|
|
125
134
|
params.set('etilt2', String(record2.electricalTilt || 0));
|
|
@@ -165,7 +174,15 @@
|
|
|
165
174
|
<CellTablePanel
|
|
166
175
|
cells={historyData as unknown as import('./types').CellData[]}
|
|
167
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
|
+
]}
|
|
168
184
|
columnPreset="history"
|
|
185
|
+
showColumnPresets={false}
|
|
169
186
|
selectable={true}
|
|
170
187
|
multiSelect={true}
|
|
171
188
|
showToolbar={true}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
headerFilters = true,
|
|
57
57
|
resizableColumns = true,
|
|
58
58
|
movableColumns = true,
|
|
59
|
-
persistLayout =
|
|
59
|
+
persistLayout = true,
|
|
60
60
|
storageKey = 'cell-table-layout',
|
|
61
61
|
onselectionchange,
|
|
62
62
|
onrowclick,
|
|
@@ -119,11 +119,12 @@
|
|
|
119
119
|
selectable: selectable ? (multiSelect ? true : 1) : false,
|
|
120
120
|
selectableRangeMode: 'click',
|
|
121
121
|
|
|
122
|
-
// Persistence -
|
|
122
|
+
// Persistence - save column widths, order, visibility and group settings
|
|
123
123
|
persistence: persistLayout ? {
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
columns: ['width', 'visible', 'order'],
|
|
125
|
+
group: true,
|
|
126
126
|
} : false,
|
|
127
|
+
persistenceMode: persistLayout ? 'local' : undefined,
|
|
127
128
|
persistenceID: persistLayout ? storageKey : undefined,
|
|
128
129
|
|
|
129
130
|
// Grouping
|
|
@@ -230,7 +231,8 @@
|
|
|
230
231
|
// Track previous values to avoid unnecessary updates
|
|
231
232
|
let prevCellsRef: unknown[] | null = null;
|
|
232
233
|
let prevGroupBy: string | null = null;
|
|
233
|
-
|
|
234
|
+
// Initialize with current preset to prevent setColumns on first load (which would override persisted layout)
|
|
235
|
+
let prevColumnPreset: string | null = columnPreset;
|
|
234
236
|
|
|
235
237
|
// Update table data when cells change (reference comparison)
|
|
236
238
|
$effect(() => {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
RowContextMenuEvent,
|
|
14
14
|
DataChangeEvent,
|
|
15
15
|
TechColorMap,
|
|
16
|
-
StatusColorMap
|
|
16
|
+
StatusColorMap,
|
|
17
|
+
GroupOption
|
|
17
18
|
} from './types';
|
|
18
19
|
|
|
19
20
|
interface Props {
|
|
@@ -21,6 +22,8 @@
|
|
|
21
22
|
cells: CellData[];
|
|
22
23
|
/** Initial grouping field */
|
|
23
24
|
groupBy?: CellTableGroupField;
|
|
25
|
+
/** Custom grouping options (overrides default tech/fband/status options) */
|
|
26
|
+
groupOptions?: GroupOption[];
|
|
24
27
|
/** Initial column preset */
|
|
25
28
|
columnPreset?: ColumnPreset;
|
|
26
29
|
/** Enable row selection */
|
|
@@ -31,6 +34,8 @@
|
|
|
31
34
|
height?: string;
|
|
32
35
|
/** Show toolbar */
|
|
33
36
|
showToolbar?: boolean;
|
|
37
|
+
/** Show column presets dropdown and column picker (set false for simple tables) */
|
|
38
|
+
showColumnPresets?: boolean;
|
|
34
39
|
/** Show export buttons */
|
|
35
40
|
showExport?: boolean;
|
|
36
41
|
/** Show JSON export button (requires showExport=true) */
|
|
@@ -51,6 +56,8 @@
|
|
|
51
56
|
persistSettings?: boolean;
|
|
52
57
|
/** Storage key prefix for persisted settings */
|
|
53
58
|
storageKey?: string;
|
|
59
|
+
/** Enable Tabulator persistence for column widths, order, visibility */
|
|
60
|
+
persistLayout?: boolean;
|
|
54
61
|
/** Show scrollspy navigation bar for quick group navigation */
|
|
55
62
|
showScrollSpy?: boolean;
|
|
56
63
|
/** Bindable reference to table methods */
|
|
@@ -76,11 +83,13 @@
|
|
|
76
83
|
let {
|
|
77
84
|
cells = [],
|
|
78
85
|
groupBy = $bindable('none'),
|
|
86
|
+
groupOptions,
|
|
79
87
|
columnPreset = $bindable('default'),
|
|
80
88
|
selectable = true,
|
|
81
89
|
multiSelect = true,
|
|
82
90
|
height = '100%',
|
|
83
91
|
showToolbar = true,
|
|
92
|
+
showColumnPresets = true,
|
|
84
93
|
showExport = true,
|
|
85
94
|
showJsonExport = false,
|
|
86
95
|
techColors,
|
|
@@ -91,6 +100,7 @@
|
|
|
91
100
|
sidebarWidth = 320,
|
|
92
101
|
persistSettings = true,
|
|
93
102
|
storageKey = 'cell-table',
|
|
103
|
+
persistLayout = true,
|
|
94
104
|
showScrollSpy = false,
|
|
95
105
|
tableRef = $bindable(null),
|
|
96
106
|
onselectionchange,
|
|
@@ -110,17 +120,22 @@
|
|
|
110
120
|
|
|
111
121
|
// Storage keys
|
|
112
122
|
const STORAGE_KEY_GROUP = `${storageKey}-groupBy`;
|
|
113
|
-
const STORAGE_KEY_COLUMNS = `${storageKey}-visibleColumns`;
|
|
114
123
|
const STORAGE_KEY_FILTERS = `${storageKey}-filtersVisible`;
|
|
115
124
|
const STORAGE_KEY_SCROLLSPY = `${storageKey}-scrollSpyEnabled`;
|
|
125
|
+
const STORAGE_KEY_PRESET = `${storageKey}-columnPreset`;
|
|
126
|
+
|
|
127
|
+
// Per-preset column visibility storage key
|
|
128
|
+
function getColumnsStorageKey(preset: ColumnPreset): string {
|
|
129
|
+
return `${storageKey}-visibleColumns-${preset}`;
|
|
130
|
+
}
|
|
116
131
|
|
|
117
132
|
// Load persisted settings
|
|
118
133
|
function loadPersistedSettings() {
|
|
119
|
-
if (!persistSettings || typeof localStorage === 'undefined') return {
|
|
134
|
+
if (!persistSettings || typeof localStorage === 'undefined') return { filtersVisible: true, scrollSpyEnabled: showScrollSpy, preset: null };
|
|
120
135
|
|
|
121
|
-
let columns: string[] | null = null;
|
|
122
136
|
let filters = true;
|
|
123
137
|
let scrollSpy = showScrollSpy;
|
|
138
|
+
let preset: ColumnPreset | null = null;
|
|
124
139
|
|
|
125
140
|
try {
|
|
126
141
|
const savedGroup = localStorage.getItem(STORAGE_KEY_GROUP);
|
|
@@ -128,9 +143,9 @@
|
|
|
128
143
|
groupBy = savedGroup as CellTableGroupField;
|
|
129
144
|
}
|
|
130
145
|
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
|
|
146
|
+
const savedPreset = localStorage.getItem(STORAGE_KEY_PRESET);
|
|
147
|
+
if (savedPreset) {
|
|
148
|
+
preset = savedPreset as ColumnPreset;
|
|
134
149
|
}
|
|
135
150
|
|
|
136
151
|
const savedFilters = localStorage.getItem(STORAGE_KEY_FILTERS);
|
|
@@ -145,7 +160,23 @@
|
|
|
145
160
|
} catch (e) {
|
|
146
161
|
console.warn('Failed to load CellTable settings:', e);
|
|
147
162
|
}
|
|
148
|
-
return {
|
|
163
|
+
return { filtersVisible: filters, scrollSpyEnabled: scrollSpy, preset };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Load columns for a specific preset
|
|
167
|
+
function loadColumnsForPreset(preset: ColumnPreset): string[] {
|
|
168
|
+
if (!persistSettings || typeof localStorage === 'undefined') {
|
|
169
|
+
return getPresetVisibleFields(preset);
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
const saved = localStorage.getItem(getColumnsStorageKey(preset));
|
|
173
|
+
if (saved) {
|
|
174
|
+
return JSON.parse(saved) as string[];
|
|
175
|
+
}
|
|
176
|
+
} catch (e) {
|
|
177
|
+
console.warn('Failed to load columns for preset:', e);
|
|
178
|
+
}
|
|
179
|
+
return getPresetVisibleFields(preset);
|
|
149
180
|
}
|
|
150
181
|
|
|
151
182
|
// Save group setting
|
|
@@ -158,11 +189,11 @@
|
|
|
158
189
|
}
|
|
159
190
|
}
|
|
160
191
|
|
|
161
|
-
// Save column visibility
|
|
192
|
+
// Save column visibility for current preset
|
|
162
193
|
function saveColumnVisibility(columns: string[]) {
|
|
163
194
|
if (!persistSettings || typeof localStorage === 'undefined') return;
|
|
164
195
|
try {
|
|
165
|
-
localStorage.setItem(
|
|
196
|
+
localStorage.setItem(getColumnsStorageKey(columnPreset), JSON.stringify(columns));
|
|
166
197
|
} catch (e) {
|
|
167
198
|
console.warn('Failed to save column visibility:', e);
|
|
168
199
|
}
|
|
@@ -188,6 +219,16 @@
|
|
|
188
219
|
}
|
|
189
220
|
}
|
|
190
221
|
|
|
222
|
+
// Save column preset
|
|
223
|
+
function savePreset(preset: ColumnPreset) {
|
|
224
|
+
if (!persistSettings || typeof localStorage === 'undefined') return;
|
|
225
|
+
try {
|
|
226
|
+
localStorage.setItem(STORAGE_KEY_PRESET, preset);
|
|
227
|
+
} catch (e) {
|
|
228
|
+
console.warn('Failed to save preset:', e);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
191
232
|
let cellTable: CellTable;
|
|
192
233
|
let selectedCount = $state(0);
|
|
193
234
|
let selectedRows = $state<CellData[]>([]);
|
|
@@ -202,15 +243,44 @@
|
|
|
202
243
|
// Initialize from storage or defaults
|
|
203
244
|
const persistedSettings = loadPersistedSettings();
|
|
204
245
|
let filtersVisible = $state(persistedSettings.filtersVisible);
|
|
205
|
-
|
|
246
|
+
|
|
247
|
+
// Apply persisted preset if available
|
|
248
|
+
if (persistedSettings.preset) {
|
|
249
|
+
columnPreset = persistedSettings.preset;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Load columns for the current preset (with any saved customizations)
|
|
253
|
+
let visibleColumns = $state<string[]>(loadColumnsForPreset(columnPreset));
|
|
206
254
|
|
|
207
255
|
// ScrollSpy state - initialize from persisted settings
|
|
208
256
|
let scrollSpyGroups = $state<{ key: string; count: number }[]>([]);
|
|
209
257
|
let scrollSpyEnabled = $state(persistedSettings.scrollSpyEnabled);
|
|
210
258
|
|
|
211
|
-
//
|
|
259
|
+
// Track preset changes to load per-preset columns
|
|
260
|
+
let prevPreset: ColumnPreset | null = columnPreset;
|
|
261
|
+
|
|
262
|
+
// Apply column visibility to Tabulator
|
|
263
|
+
function applyColumnVisibility(columns: string[]) {
|
|
264
|
+
if (!cellTable) return;
|
|
265
|
+
columnMeta.forEach(col => {
|
|
266
|
+
if (columns.includes(col.field)) {
|
|
267
|
+
cellTable.showColumn(col.field);
|
|
268
|
+
} else {
|
|
269
|
+
cellTable.hideColumn(col.field);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Update visible columns when preset changes - load saved customizations for that preset
|
|
212
275
|
$effect(() => {
|
|
213
|
-
|
|
276
|
+
if (columnPreset !== prevPreset) {
|
|
277
|
+
prevPreset = columnPreset;
|
|
278
|
+
// Load saved columns for this preset (or preset defaults if none saved)
|
|
279
|
+
const newColumns = loadColumnsForPreset(columnPreset);
|
|
280
|
+
visibleColumns = newColumns;
|
|
281
|
+
// Apply to Tabulator
|
|
282
|
+
applyColumnVisibility(newColumns);
|
|
283
|
+
}
|
|
214
284
|
});
|
|
215
285
|
|
|
216
286
|
// Expose table methods via tableRef - only set once
|
|
@@ -220,6 +290,8 @@
|
|
|
220
290
|
tableRef = {
|
|
221
291
|
redraw: () => cellTable?.redraw()
|
|
222
292
|
};
|
|
293
|
+
// Apply persisted column visibility after table is ready
|
|
294
|
+
setTimeout(() => applyColumnVisibility(visibleColumns), 100);
|
|
223
295
|
// Apply persisted filter visibility after table is ready
|
|
224
296
|
if (!filtersVisible) {
|
|
225
297
|
setTimeout(() => cellTable?.toggleHeaderFilters(false), 100);
|
|
@@ -304,6 +376,7 @@
|
|
|
304
376
|
|
|
305
377
|
function handlePresetChange(preset: ColumnPreset) {
|
|
306
378
|
columnPreset = preset;
|
|
379
|
+
savePreset(preset);
|
|
307
380
|
}
|
|
308
381
|
|
|
309
382
|
function handleExportCSV() {
|
|
@@ -356,10 +429,10 @@
|
|
|
356
429
|
cellTable?.hideColumn(col.field);
|
|
357
430
|
}
|
|
358
431
|
});
|
|
359
|
-
// Clear persisted column visibility (use preset defaults)
|
|
432
|
+
// Clear persisted column visibility for this preset (use preset defaults)
|
|
360
433
|
if (persistSettings && typeof localStorage !== 'undefined') {
|
|
361
434
|
try {
|
|
362
|
-
localStorage.removeItem(
|
|
435
|
+
localStorage.removeItem(getColumnsStorageKey(columnPreset));
|
|
363
436
|
} catch (e) {
|
|
364
437
|
console.warn('Failed to clear column visibility:', e);
|
|
365
438
|
}
|
|
@@ -435,12 +508,14 @@
|
|
|
435
508
|
{#if showToolbar}
|
|
436
509
|
<CellTableToolbar
|
|
437
510
|
{groupBy}
|
|
511
|
+
{groupOptions}
|
|
438
512
|
{columnPreset}
|
|
439
513
|
totalCount={cells.length}
|
|
440
514
|
{filteredCount}
|
|
441
515
|
{selectedCount}
|
|
442
516
|
{showExport}
|
|
443
517
|
{showJsonExport}
|
|
518
|
+
showPresets={showColumnPresets}
|
|
444
519
|
ongroupchange={handleGroupChange}
|
|
445
520
|
onpresetchange={handlePresetChange}
|
|
446
521
|
onexportcsv={handleExportCSV}
|
|
@@ -503,6 +578,8 @@
|
|
|
503
578
|
{techColors}
|
|
504
579
|
{statusColors}
|
|
505
580
|
{headerFilters}
|
|
581
|
+
{persistLayout}
|
|
582
|
+
storageKey="{storageKey}-tabulator"
|
|
506
583
|
onselectionchange={handleSelectionChange}
|
|
507
584
|
ondatachange={handleDataChange}
|
|
508
585
|
onrowclick={handleRowClick}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { CellData, CellTableGroupField, ColumnPreset, RowSelectionEvent, RowClickEvent, RowDblClickEvent, TechColorMap, StatusColorMap } from './types';
|
|
2
|
+
import type { CellData, CellTableGroupField, ColumnPreset, RowSelectionEvent, RowClickEvent, RowDblClickEvent, TechColorMap, StatusColorMap, GroupOption } from './types';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Cell data array to display */
|
|
5
5
|
cells: CellData[];
|
|
6
6
|
/** Initial grouping field */
|
|
7
7
|
groupBy?: CellTableGroupField;
|
|
8
|
+
/** Custom grouping options (overrides default tech/fband/status options) */
|
|
9
|
+
groupOptions?: GroupOption[];
|
|
8
10
|
/** Initial column preset */
|
|
9
11
|
columnPreset?: ColumnPreset;
|
|
10
12
|
/** Enable row selection */
|
|
@@ -15,6 +17,8 @@ interface Props {
|
|
|
15
17
|
height?: string;
|
|
16
18
|
/** Show toolbar */
|
|
17
19
|
showToolbar?: boolean;
|
|
20
|
+
/** Show column presets dropdown and column picker (set false for simple tables) */
|
|
21
|
+
showColumnPresets?: boolean;
|
|
18
22
|
/** Show export buttons */
|
|
19
23
|
showExport?: boolean;
|
|
20
24
|
/** Show JSON export button (requires showExport=true) */
|
|
@@ -35,6 +39,8 @@ interface Props {
|
|
|
35
39
|
persistSettings?: boolean;
|
|
36
40
|
/** Storage key prefix for persisted settings */
|
|
37
41
|
storageKey?: string;
|
|
42
|
+
/** Enable Tabulator persistence for column widths, order, visibility */
|
|
43
|
+
persistLayout?: boolean;
|
|
38
44
|
/** Show scrollspy navigation bar for quick group navigation */
|
|
39
45
|
showScrollSpy?: boolean;
|
|
40
46
|
/** Bindable reference to table methods */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { CellTableGroupField, ColumnPreset } from './types';
|
|
2
|
+
import type { CellTableGroupField, ColumnPreset, GroupOption } from './types';
|
|
3
3
|
import type { ColumnMeta } from './column-config';
|
|
4
4
|
import ColumnPicker from './ColumnPicker.svelte';
|
|
5
5
|
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
showJsonExport?: boolean;
|
|
21
21
|
/** Show grouping dropdown */
|
|
22
22
|
showGrouping?: boolean;
|
|
23
|
+
/** Custom grouping options (overrides default options) */
|
|
24
|
+
groupOptions?: GroupOption[];
|
|
23
25
|
/** Show preset dropdown */
|
|
24
26
|
showPresets?: boolean;
|
|
25
27
|
/** Group change event */
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
showExport = true,
|
|
66
68
|
showJsonExport = false,
|
|
67
69
|
showGrouping = true,
|
|
70
|
+
groupOptions: customGroupOptions,
|
|
68
71
|
showPresets = true,
|
|
69
72
|
ongroupchange,
|
|
70
73
|
onpresetchange,
|
|
@@ -84,7 +87,7 @@
|
|
|
84
87
|
ontogglescrollspy
|
|
85
88
|
}: Props = $props();
|
|
86
89
|
|
|
87
|
-
const
|
|
90
|
+
const defaultGroupOptions: GroupOption[] = [
|
|
88
91
|
{ value: 'none', label: 'No Grouping' },
|
|
89
92
|
{ value: 'tech', label: 'Technology' },
|
|
90
93
|
{ value: 'fband', label: 'Frequency Band' },
|
|
@@ -93,6 +96,9 @@
|
|
|
93
96
|
{ value: 'siteId', label: 'Site ID' }
|
|
94
97
|
];
|
|
95
98
|
|
|
99
|
+
// Use custom options if provided, otherwise use defaults
|
|
100
|
+
const groupOptions = customGroupOptions ?? defaultGroupOptions;
|
|
101
|
+
|
|
96
102
|
const presetOptions: { value: ColumnPreset; label: string }[] = [
|
|
97
103
|
{ value: 'default', label: 'Default' },
|
|
98
104
|
{ value: 'compact', label: 'Compact' },
|
|
@@ -105,8 +111,8 @@
|
|
|
105
111
|
];
|
|
106
112
|
|
|
107
113
|
function handleGroupChange(e: Event) {
|
|
108
|
-
const value = (e.target as HTMLSelectElement).value
|
|
109
|
-
ongroupchange?.(value);
|
|
114
|
+
const value = (e.target as HTMLSelectElement).value;
|
|
115
|
+
ongroupchange?.(value as CellTableGroupField);
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
function handlePresetChange(e: Event) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CellTableGroupField, ColumnPreset } from './types';
|
|
1
|
+
import type { CellTableGroupField, ColumnPreset, GroupOption } from './types';
|
|
2
2
|
import type { ColumnMeta } from './column-config';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Current grouping field */
|
|
@@ -17,6 +17,8 @@ interface Props {
|
|
|
17
17
|
showJsonExport?: boolean;
|
|
18
18
|
/** Show grouping dropdown */
|
|
19
19
|
showGrouping?: boolean;
|
|
20
|
+
/** Custom grouping options (overrides default options) */
|
|
21
|
+
groupOptions?: GroupOption[];
|
|
20
22
|
/** Show preset dropdown */
|
|
21
23
|
showPresets?: boolean;
|
|
22
24
|
/** Group change event */
|
|
@@ -54,14 +54,14 @@ export const FBAND_COLORS = {
|
|
|
54
54
|
*/
|
|
55
55
|
export const COLUMN_GROUPS = {
|
|
56
56
|
core: ['siteId', 'txId', 'cellName', 'tech', 'fband', 'status'],
|
|
57
|
-
physical: ['antenna', 'azimuth', 'height', '
|
|
58
|
-
network: ['
|
|
59
|
-
planning: ['planner', 'comment', 'onAirDate'
|
|
60
|
-
atoll: ['atollET', 'atollPW', 'atollRS', 'atollBW'],
|
|
57
|
+
physical: ['antenna', 'azimuth', 'height', 'beamwidth'],
|
|
58
|
+
network: ['nwET', 'nwPW', 'nwRS', 'nwBW', 'dlEarfn', 'bcch', 'pci', 'rru', 'cellID', 'cellId2G', 'ctrlid'],
|
|
59
|
+
planning: ['planner', 'comment', 'onAirDate'],
|
|
60
|
+
atoll: ['atollET', 'atollMT', 'atollPW', 'atollRS', 'atollBW'],
|
|
61
61
|
position: ['latitude', 'longitude', 'siteLatitude', 'siteLongitude', 'dx', 'dy'],
|
|
62
62
|
compare: ['compareET', 'comparePW', 'compareRS', 'compareBW'],
|
|
63
63
|
kpi: ['kpiTraffic', 'kpiThroughput', 'kpiAvailability', 'kpiSuccessRate'],
|
|
64
|
-
history: ['configDate', 'antennaChange', 'etiltChange', 'mtiltChange', 'powerChange'],
|
|
64
|
+
history: ['configDate', 'frequency', 'antennaChange', 'etiltChange', 'mtiltChange', 'powerChange'],
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* Create a technology badge formatter
|
|
@@ -359,12 +359,6 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
359
359
|
formatter: createStatusFormatter(statusColors),
|
|
360
360
|
...selectHeaderFilter,
|
|
361
361
|
},
|
|
362
|
-
{
|
|
363
|
-
title: 'Type',
|
|
364
|
-
field: 'type',
|
|
365
|
-
width: 100,
|
|
366
|
-
...selectHeaderFilter,
|
|
367
|
-
},
|
|
368
362
|
{
|
|
369
363
|
title: 'On Air Date',
|
|
370
364
|
field: 'onAirDate',
|
|
@@ -378,6 +372,13 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
378
372
|
formatter: historyDateFormatter,
|
|
379
373
|
...headerFilterParams,
|
|
380
374
|
},
|
|
375
|
+
{
|
|
376
|
+
title: 'Freq (MHz)',
|
|
377
|
+
field: 'frequency',
|
|
378
|
+
width: 100,
|
|
379
|
+
hozAlign: 'right',
|
|
380
|
+
...headerFilterParams,
|
|
381
|
+
},
|
|
381
382
|
// History change columns (current vs previous, highlights changes)
|
|
382
383
|
{
|
|
383
384
|
title: 'Antenna',
|
|
@@ -430,13 +431,6 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
430
431
|
formatter: heightFormatter,
|
|
431
432
|
...headerFilterParams,
|
|
432
433
|
},
|
|
433
|
-
{
|
|
434
|
-
title: 'E-Tilt',
|
|
435
|
-
field: 'electricalTilt',
|
|
436
|
-
width: 80,
|
|
437
|
-
hozAlign: 'right',
|
|
438
|
-
...headerFilterParams,
|
|
439
|
-
},
|
|
440
434
|
{
|
|
441
435
|
title: 'Beamwidth',
|
|
442
436
|
field: 'beamwidth',
|
|
@@ -462,17 +456,11 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
462
456
|
},
|
|
463
457
|
{
|
|
464
458
|
title: 'PCI',
|
|
465
|
-
field: '
|
|
459
|
+
field: 'pci',
|
|
466
460
|
width: 80,
|
|
467
461
|
hozAlign: 'right',
|
|
468
462
|
...headerFilterParams,
|
|
469
463
|
},
|
|
470
|
-
{
|
|
471
|
-
title: 'Cell ID 3',
|
|
472
|
-
field: 'cellId3',
|
|
473
|
-
width: 100,
|
|
474
|
-
...headerFilterParams,
|
|
475
|
-
},
|
|
476
464
|
{
|
|
477
465
|
title: 'Cell ID',
|
|
478
466
|
field: 'cellID',
|
|
@@ -492,17 +480,25 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
492
480
|
...headerFilterParams,
|
|
493
481
|
},
|
|
494
482
|
{
|
|
495
|
-
title: '
|
|
496
|
-
field: '
|
|
483
|
+
title: 'RRU',
|
|
484
|
+
field: 'rru',
|
|
485
|
+
width: 100,
|
|
486
|
+
...headerFilterParams,
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
title: 'NW ET',
|
|
490
|
+
field: 'nwET',
|
|
497
491
|
width: 80,
|
|
498
492
|
hozAlign: 'right',
|
|
493
|
+
formatter: numberFormatter(1),
|
|
499
494
|
...headerFilterParams,
|
|
500
495
|
},
|
|
501
496
|
{
|
|
502
|
-
title: '
|
|
503
|
-
field: '
|
|
497
|
+
title: 'NW PW',
|
|
498
|
+
field: 'nwPW',
|
|
504
499
|
width: 80,
|
|
505
500
|
hozAlign: 'right',
|
|
501
|
+
formatter: numberFormatter(1),
|
|
506
502
|
...headerFilterParams,
|
|
507
503
|
},
|
|
508
504
|
{
|
|
@@ -791,61 +787,59 @@ export function getColumnMetadata() {
|
|
|
791
787
|
{ field: 'cellName', title: 'Cell Name', group: 'Core' },
|
|
792
788
|
{ field: 'tech', title: 'Technology', group: 'Core' },
|
|
793
789
|
{ field: 'fband', title: 'Band', group: 'Core' },
|
|
790
|
+
{ field: 'rru', title: 'RRU', group: 'Core' },
|
|
794
791
|
{ field: 'frq', title: 'Frequency', group: 'Core' },
|
|
795
792
|
{ field: 'status', title: 'Status', group: 'Core' },
|
|
796
|
-
{ field: 'type', title: 'Type', group: 'Core' },
|
|
797
793
|
{ field: 'onAirDate', title: 'On Air Date', group: 'Core' },
|
|
798
|
-
// Physical
|
|
799
|
-
{ field: 'antenna', title: 'Antenna', group: 'Physical' },
|
|
800
|
-
{ field: 'azimuth', title: 'Azimuth', group: 'Physical' },
|
|
801
|
-
{ field: 'height', title: 'Height', group: 'Physical' },
|
|
802
|
-
{ field: '
|
|
803
|
-
{ field: 'beamwidth', title: 'Beamwidth', group: 'Physical' },
|
|
804
|
-
// Network
|
|
805
|
-
{ field: 'dlEarfn', title: 'DL EARFCN', group: 'Network' },
|
|
806
|
-
{ field: 'bcch', title: 'BCCH', group: 'Network' },
|
|
807
|
-
{ field: 'pci', title: 'PCI', group: 'Network' },
|
|
808
|
-
{ field: 'rru', title: 'RRU', group: 'Network' },
|
|
809
|
-
{ field: 'cellID', title: 'Cell ID', group: 'Network' },
|
|
810
|
-
{ field: 'cellId2G', title: 'Cell ID 2G', group: 'Network' },
|
|
811
|
-
{ field: 'ctrlid', title: 'Ctrl ID', group: 'Network' },
|
|
812
|
-
{ field: 'nwET', title: 'NW ET', group: 'Network' },
|
|
813
|
-
{ field: 'nwPW', title: 'NW PW', group: 'Network' },
|
|
814
|
-
{ field: 'nwRS', title: 'NW RS', group: 'Network' },
|
|
815
|
-
{ field: 'nwBW', title: 'NW BW', group: 'Network' },
|
|
816
|
-
// Atoll
|
|
817
|
-
{ field: 'atollET', title: 'Atoll ET', group: 'Atoll' },
|
|
794
|
+
// Antenna Physical
|
|
795
|
+
{ field: 'antenna', title: 'Antenna', group: 'Antenna Physical' },
|
|
796
|
+
{ field: 'azimuth', title: 'Azimuth', group: 'Antenna Physical' },
|
|
797
|
+
{ field: 'height', title: 'Height', group: 'Antenna Physical' },
|
|
798
|
+
{ field: 'beamwidth', title: 'Beamwidth', group: 'Antenna Physical' },
|
|
818
799
|
{ field: 'atollMT', title: 'Atoll MT', group: 'Atoll' },
|
|
800
|
+
// Atoll antenna settings
|
|
801
|
+
{ field: 'atollET', title: 'Atoll ET', group: 'Atoll' },
|
|
819
802
|
{ field: 'atollPW', title: 'Atoll PW', group: 'Atoll' },
|
|
820
803
|
{ field: 'atollRS', title: 'Atoll RS', group: 'Atoll' },
|
|
821
804
|
{ field: 'atollBW', title: 'Atoll BW', group: 'Atoll' },
|
|
805
|
+
// Network antena settings
|
|
806
|
+
{ field: 'nwET', title: 'NW ET', group: 'Network' },
|
|
807
|
+
{ field: 'nwPW', title: 'NW PW', group: 'Network' },
|
|
808
|
+
{ field: 'nwRS', title: 'NW RS', group: 'Network' },
|
|
809
|
+
{ field: 'nwBW', title: 'NW BW', group: 'Network' },
|
|
810
|
+
// Compare (Atoll vs Network)
|
|
811
|
+
{ field: 'compareET', title: 'Δ ET', group: 'Compare' },
|
|
812
|
+
{ field: 'comparePW', title: 'Δ PW', group: 'Compare' },
|
|
813
|
+
{ field: 'compareRS', title: 'Δ RS', group: 'Compare' },
|
|
814
|
+
{ field: 'compareBW', title: 'Δ BW', group: 'Compare' },
|
|
815
|
+
// Network settings
|
|
816
|
+
{ field: 'dlEarfn', title: 'DL EARFCN', group: 'Network' },
|
|
817
|
+
{ field: 'bcch', title: 'BCCH', group: 'Network' },
|
|
818
|
+
{ field: 'pci', title: 'PCI', group: 'Network' },
|
|
819
|
+
{ field: 'ctrlid', title: 'Ctrl ID', group: 'Network' },
|
|
822
820
|
// History
|
|
823
821
|
{ field: 'configDate', title: 'Config Date', group: 'History' },
|
|
822
|
+
{ field: 'frequency', title: 'Freq (MHz)', group: 'History' },
|
|
824
823
|
{ field: 'antennaChange', title: 'Antenna (Δ)', group: 'History' },
|
|
825
824
|
{ field: 'etiltChange', title: 'E-Tilt (Δ)', group: 'History' },
|
|
826
825
|
{ field: 'mtiltChange', title: 'M-Tilt (Δ)', group: 'History' },
|
|
827
826
|
{ field: 'powerChange', title: 'Power (Δ)', group: 'History' },
|
|
828
|
-
// Compare (Atoll vs Network)
|
|
829
|
-
{ field: 'compareET', title: 'Δ ET', group: 'Compare' },
|
|
830
|
-
{ field: 'comparePW', title: 'Δ PW', group: 'Compare' },
|
|
831
|
-
{ field: 'compareRS', title: 'Δ RS', group: 'Compare' },
|
|
832
|
-
{ field: 'compareBW', title: 'Δ BW', group: 'Compare' },
|
|
833
827
|
// KPI Trends
|
|
834
828
|
{ field: 'kpiTraffic', title: 'Traffic', group: 'KPI' },
|
|
835
829
|
{ field: 'kpiThroughput', title: 'Throughput', group: 'KPI' },
|
|
836
830
|
{ field: 'kpiAvailability', title: 'Availability', group: 'KPI' },
|
|
837
831
|
{ field: 'kpiSuccessRate', title: 'Success Rate', group: 'KPI' },
|
|
838
832
|
// Position
|
|
839
|
-
{ field: 'latitude', title: 'Latitude', group: 'Position' },
|
|
840
|
-
{ field: 'longitude', title: 'Longitude', group: 'Position' },
|
|
841
|
-
{ field: 'siteLatitude', title: 'Site Latitude', group: 'Position' },
|
|
842
|
-
{ field: 'siteLongitude', title: 'Site Longitude', group: 'Position' },
|
|
843
|
-
{ field: 'dx', title: 'DX', group: 'Position' },
|
|
844
|
-
{ field: 'dy', title: 'DY', group: 'Position' },
|
|
833
|
+
// { field: 'latitude', title: 'Latitude', group: 'Position' },
|
|
834
|
+
// { field: 'longitude', title: 'Longitude', group: 'Position' },
|
|
835
|
+
// { field: 'siteLatitude', title: 'Site Latitude', group: 'Position' },
|
|
836
|
+
// { field: 'siteLongitude', title: 'Site Longitude', group: 'Position' },
|
|
837
|
+
// { field: 'dx', title: 'DX', group: 'Position' },
|
|
838
|
+
// { field: 'dy', title: 'DY', group: 'Position' },
|
|
845
839
|
// Planning
|
|
846
840
|
{ field: 'planner', title: 'Planner', group: 'Planning' },
|
|
847
841
|
{ field: 'comment', title: 'Comment', group: 'Planning' },
|
|
848
|
-
{ field: 'customSubgroup', title: 'Subgroup', group: 'Planning' },
|
|
842
|
+
// { field: 'customSubgroup', title: 'Subgroup', group: 'Planning' },
|
|
849
843
|
];
|
|
850
844
|
}
|
|
851
845
|
/**
|
|
@@ -11,5 +11,5 @@ export { default as CellHistoryDemo } from './CellHistoryDemo.svelte';
|
|
|
11
11
|
export { default as ColumnPicker } from './ColumnPicker.svelte';
|
|
12
12
|
export { transformDbRecord, transformDbRecords, formatConfigDate, type CellHistoryDbRecord, type CellHistoryApiResponse } from './history-api-helper';
|
|
13
13
|
export { generateCells, generateCellsFromPreset, getGeneratorInfo, GENERATOR_PRESETS, type CellGeneratorConfig, type GeneratorPreset } from '../../shared/demo';
|
|
14
|
-
export type { CellData, CellTableGroupField, ColumnPreset, ColumnVisibility, TechColorMap, StatusColorMap, CellTableProps, RowSelectionEvent, RowClickEvent, RowDblClickEvent, RowContextMenuEvent, DataChangeEvent, CellTableColumn, ColumnGroups, CellHistoryData } from './types';
|
|
14
|
+
export type { CellData, CellTableGroupField, ColumnPreset, ColumnVisibility, TechColorMap, StatusColorMap, CellTableProps, RowSelectionEvent, RowClickEvent, RowDblClickEvent, RowContextMenuEvent, DataChangeEvent, CellTableColumn, ColumnGroups, CellHistoryData, GroupOption } from './types';
|
|
15
15
|
export { DEFAULT_TECH_COLORS, DEFAULT_STATUS_COLORS, FBAND_COLORS, COLUMN_GROUPS, getAllColumns, getColumnsForPreset, getGroupHeaderFormatter, getColumnMetadata, getPresetVisibleFields, fbandSorter, cellNameSectorSorter, cellDataSorter, createTechFormatter, createStatusFormatter, createFbandFormatter, createHistoryChangeFormatter, historyDateFormatter, numberFormatter, coordinateFormatter, azimuthFormatter, heightFormatter, type ColumnMeta } from './column-config';
|
|
@@ -23,6 +23,15 @@ export type ColumnPreset = 'default' | 'compact' | 'full' | 'physical' | 'networ
|
|
|
23
23
|
export interface ColumnVisibility {
|
|
24
24
|
[key: string]: boolean;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Grouping option for toolbar dropdown
|
|
28
|
+
*/
|
|
29
|
+
export interface GroupOption {
|
|
30
|
+
/** Field name to group by (or 'none') */
|
|
31
|
+
value: string;
|
|
32
|
+
/** Display label in dropdown */
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
26
35
|
/**
|
|
27
36
|
* Technology color mapping
|
|
28
37
|
*/
|
|
@@ -140,6 +149,8 @@ export interface ColumnGroups {
|
|
|
140
149
|
export interface CellHistoryData {
|
|
141
150
|
/** Cell name identifier */
|
|
142
151
|
CELLNAME: string;
|
|
152
|
+
/** Frequency in MHz (e.g., 1800, 2100, 3500) */
|
|
153
|
+
FREQUENCY: number;
|
|
143
154
|
/** Date of configuration change (ISO 8601 format) */
|
|
144
155
|
CONFIG_DATE: string;
|
|
145
156
|
/** Current antenna type at this config date */
|