@smartnet360/svelte-components 0.0.132 → 0.0.133
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 +16 -0
- package/dist/core/CellTable/CellTablePanel.svelte +10 -1
- package/dist/core/CellTable/CellTablePanel.svelte.d.ts +5 -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 +9 -1
- 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,14 @@
|
|
|
165
174
|
<CellTablePanel
|
|
166
175
|
cells={historyData as unknown as import('./types').CellData[]}
|
|
167
176
|
groupBy="none"
|
|
177
|
+
groupOptions={[
|
|
178
|
+
{ value: 'none', label: 'No Grouping' },
|
|
179
|
+
{ value: 'antenna', label: 'Antenna Type' },
|
|
180
|
+
{ value: 'cellname', label: 'Cell Name' },
|
|
181
|
+
|
|
182
|
+
]}
|
|
168
183
|
columnPreset="history"
|
|
184
|
+
showColumnPresets={false}
|
|
169
185
|
selectable={true}
|
|
170
186
|
multiSelect={true}
|
|
171
187
|
showToolbar={true}
|
|
@@ -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) */
|
|
@@ -76,11 +81,13 @@
|
|
|
76
81
|
let {
|
|
77
82
|
cells = [],
|
|
78
83
|
groupBy = $bindable('none'),
|
|
84
|
+
groupOptions,
|
|
79
85
|
columnPreset = $bindable('default'),
|
|
80
86
|
selectable = true,
|
|
81
87
|
multiSelect = true,
|
|
82
88
|
height = '100%',
|
|
83
89
|
showToolbar = true,
|
|
90
|
+
showColumnPresets = true,
|
|
84
91
|
showExport = true,
|
|
85
92
|
showJsonExport = false,
|
|
86
93
|
techColors,
|
|
@@ -435,12 +442,14 @@
|
|
|
435
442
|
{#if showToolbar}
|
|
436
443
|
<CellTableToolbar
|
|
437
444
|
{groupBy}
|
|
445
|
+
{groupOptions}
|
|
438
446
|
{columnPreset}
|
|
439
447
|
totalCount={cells.length}
|
|
440
448
|
{filteredCount}
|
|
441
449
|
{selectedCount}
|
|
442
450
|
{showExport}
|
|
443
451
|
{showJsonExport}
|
|
452
|
+
showPresets={showColumnPresets}
|
|
444
453
|
ongroupchange={handleGroupChange}
|
|
445
454
|
onpresetchange={handlePresetChange}
|
|
446
455
|
onexportcsv={handleExportCSV}
|
|
@@ -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) */
|
|
@@ -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 */
|
|
@@ -61,7 +61,7 @@ export const COLUMN_GROUPS = {
|
|
|
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
|
|
@@ -378,6 +378,13 @@ export function getAllColumns(techColors = DEFAULT_TECH_COLORS, statusColors = D
|
|
|
378
378
|
formatter: historyDateFormatter,
|
|
379
379
|
...headerFilterParams,
|
|
380
380
|
},
|
|
381
|
+
{
|
|
382
|
+
title: 'Freq (MHz)',
|
|
383
|
+
field: 'frequency',
|
|
384
|
+
width: 100,
|
|
385
|
+
hozAlign: 'right',
|
|
386
|
+
...headerFilterParams,
|
|
387
|
+
},
|
|
381
388
|
// History change columns (current vs previous, highlights changes)
|
|
382
389
|
{
|
|
383
390
|
title: 'Antenna',
|
|
@@ -821,6 +828,7 @@ export function getColumnMetadata() {
|
|
|
821
828
|
{ field: 'atollBW', title: 'Atoll BW', group: 'Atoll' },
|
|
822
829
|
// History
|
|
823
830
|
{ field: 'configDate', title: 'Config Date', group: 'History' },
|
|
831
|
+
{ field: 'frequency', title: 'Freq (MHz)', group: 'History' },
|
|
824
832
|
{ field: 'antennaChange', title: 'Antenna (Δ)', group: 'History' },
|
|
825
833
|
{ field: 'etiltChange', title: 'E-Tilt (Δ)', group: 'History' },
|
|
826
834
|
{ field: 'mtiltChange', title: 'M-Tilt (Δ)', group: 'History' },
|
|
@@ -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 */
|