@smartnet360/svelte-components 0.0.103 → 0.0.104
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/apps/site-check/SiteCheck.svelte +11 -77
- package/dist/apps/site-check/SiteCheckControls.svelte +0 -7
- package/dist/apps/site-check/helper.js +0 -33
- package/dist/apps/site-check/transforms.js +15 -65
- package/dist/core/CellTable/CellTable.svelte +456 -0
- package/dist/core/CellTable/CellTable.svelte.d.ts +27 -0
- package/dist/core/CellTable/CellTablePanel.svelte +211 -0
- package/dist/core/CellTable/CellTablePanel.svelte.d.ts +49 -0
- package/dist/core/CellTable/CellTableToolbar.svelte +218 -0
- package/dist/core/CellTable/CellTableToolbar.svelte.d.ts +32 -0
- package/dist/core/CellTable/column-config.d.ts +63 -0
- package/dist/core/CellTable/column-config.js +465 -0
- package/dist/core/CellTable/index.d.ts +10 -0
- package/dist/core/CellTable/index.js +11 -0
- package/dist/core/CellTable/types.d.ts +166 -0
- package/dist/core/CellTable/types.js +6 -0
- package/dist/core/Charts/ChartCard.svelte +0 -23
- package/dist/core/Charts/ChartComponent.svelte +0 -25
- package/dist/core/Charts/data-processor.js +1 -19
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +2 -0
- package/package.json +3 -2
- package/dist/apps/site-check/transforms-old.d.ts +0 -56
- package/dist/apps/site-check/transforms-old.js +0 -273
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { CellData, CellTableGroupField, ColumnPreset, RowSelectionEvent, RowClickEvent, RowDblClickEvent, TechColorMap, StatusColorMap } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Cell data array to display */
|
|
5
|
+
cells: CellData[];
|
|
6
|
+
/** Initial grouping field */
|
|
7
|
+
groupBy?: CellTableGroupField;
|
|
8
|
+
/** Initial column preset */
|
|
9
|
+
columnPreset?: ColumnPreset;
|
|
10
|
+
/** Enable row selection */
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
/** Enable multi-row selection */
|
|
13
|
+
multiSelect?: boolean;
|
|
14
|
+
/** Panel height (CSS value) */
|
|
15
|
+
height?: string;
|
|
16
|
+
/** Show toolbar */
|
|
17
|
+
showToolbar?: boolean;
|
|
18
|
+
/** Show export buttons */
|
|
19
|
+
showExport?: boolean;
|
|
20
|
+
/** Technology color mapping */
|
|
21
|
+
techColors?: TechColorMap;
|
|
22
|
+
/** Status color mapping */
|
|
23
|
+
statusColors?: StatusColorMap;
|
|
24
|
+
/** Enable header filters */
|
|
25
|
+
headerFilters?: boolean;
|
|
26
|
+
/** Panel title */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** Row selection change event */
|
|
29
|
+
onselectionchange?: (event: RowSelectionEvent) => void;
|
|
30
|
+
/** Row click event */
|
|
31
|
+
onrowclick?: (event: RowClickEvent) => void;
|
|
32
|
+
/** Row double-click event */
|
|
33
|
+
onrowdblclick?: (event: RowDblClickEvent) => void;
|
|
34
|
+
/** Custom header actions slot */
|
|
35
|
+
headerActions?: Snippet;
|
|
36
|
+
/** Custom footer slot */
|
|
37
|
+
footer?: Snippet<[{
|
|
38
|
+
selectedRows: CellData[];
|
|
39
|
+
selectedCount: number;
|
|
40
|
+
}]>;
|
|
41
|
+
}
|
|
42
|
+
declare const CellTablePanel: import("svelte").Component<Props, {
|
|
43
|
+
getSelectedRows: () => CellData[];
|
|
44
|
+
clearSelection: () => void;
|
|
45
|
+
scrollToRow: (id: string) => void;
|
|
46
|
+
redraw: () => void;
|
|
47
|
+
}, "groupBy" | "columnPreset">;
|
|
48
|
+
type CellTablePanel = ReturnType<typeof CellTablePanel>;
|
|
49
|
+
export default CellTablePanel;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CellTableGroupField, ColumnPreset } from './types';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Current grouping field */
|
|
6
|
+
groupBy?: CellTableGroupField;
|
|
7
|
+
/** Current column preset */
|
|
8
|
+
columnPreset?: ColumnPreset;
|
|
9
|
+
/** Total row count */
|
|
10
|
+
totalCount?: number;
|
|
11
|
+
/** Filtered row count */
|
|
12
|
+
filteredCount?: number;
|
|
13
|
+
/** Selected row count */
|
|
14
|
+
selectedCount?: number;
|
|
15
|
+
/** Show export buttons */
|
|
16
|
+
showExport?: boolean;
|
|
17
|
+
/** Show grouping dropdown */
|
|
18
|
+
showGrouping?: boolean;
|
|
19
|
+
/** Show preset dropdown */
|
|
20
|
+
showPresets?: boolean;
|
|
21
|
+
/** Group change event */
|
|
22
|
+
ongroupchange?: (group: CellTableGroupField) => void;
|
|
23
|
+
/** Preset change event */
|
|
24
|
+
onpresetchange?: (preset: ColumnPreset) => void;
|
|
25
|
+
/** Export CSV event */
|
|
26
|
+
onexportcsv?: () => void;
|
|
27
|
+
/** Export JSON event */
|
|
28
|
+
onexportjson?: () => void;
|
|
29
|
+
/** Clear filters event */
|
|
30
|
+
onclearfilters?: () => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
groupBy = 'none',
|
|
35
|
+
columnPreset = 'default',
|
|
36
|
+
totalCount = 0,
|
|
37
|
+
filteredCount = 0,
|
|
38
|
+
selectedCount = 0,
|
|
39
|
+
showExport = true,
|
|
40
|
+
showGrouping = true,
|
|
41
|
+
showPresets = true,
|
|
42
|
+
ongroupchange,
|
|
43
|
+
onpresetchange,
|
|
44
|
+
onexportcsv,
|
|
45
|
+
onexportjson,
|
|
46
|
+
onclearfilters
|
|
47
|
+
}: Props = $props();
|
|
48
|
+
|
|
49
|
+
const groupOptions: { value: CellTableGroupField; label: string }[] = [
|
|
50
|
+
{ value: 'none', label: 'No Grouping' },
|
|
51
|
+
{ value: 'tech', label: 'Technology' },
|
|
52
|
+
{ value: 'fband', label: 'Frequency Band' },
|
|
53
|
+
{ value: 'frq', label: 'Frequency' },
|
|
54
|
+
{ value: 'status', label: 'Status' },
|
|
55
|
+
{ value: 'siteId', label: 'Site ID' }
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const presetOptions: { value: ColumnPreset; label: string }[] = [
|
|
59
|
+
{ value: 'default', label: 'Default' },
|
|
60
|
+
{ value: 'compact', label: 'Compact' },
|
|
61
|
+
{ value: 'full', label: 'All Columns' },
|
|
62
|
+
{ value: 'physical', label: 'Physical' },
|
|
63
|
+
{ value: 'network', label: 'Network' },
|
|
64
|
+
{ value: 'planning', label: 'Planning' }
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
function handleGroupChange(e: Event) {
|
|
68
|
+
const value = (e.target as HTMLSelectElement).value as CellTableGroupField;
|
|
69
|
+
ongroupchange?.(value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function handlePresetChange(e: Event) {
|
|
73
|
+
const value = (e.target as HTMLSelectElement).value as ColumnPreset;
|
|
74
|
+
onpresetchange?.(value);
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<div class="cell-table-toolbar d-flex align-items-center gap-3 p-2 bg-body-tertiary border-bottom">
|
|
79
|
+
<!-- Stats -->
|
|
80
|
+
<div class="toolbar-stats d-flex align-items-center gap-2">
|
|
81
|
+
<span class="badge bg-secondary">
|
|
82
|
+
{filteredCount} / {totalCount} cells
|
|
83
|
+
</span>
|
|
84
|
+
{#if selectedCount > 0}
|
|
85
|
+
<span class="badge bg-primary">
|
|
86
|
+
{selectedCount} selected
|
|
87
|
+
</span>
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="vr"></div>
|
|
92
|
+
|
|
93
|
+
<!-- Grouping -->
|
|
94
|
+
{#if showGrouping}
|
|
95
|
+
<div class="toolbar-group d-flex align-items-center gap-2">
|
|
96
|
+
<label for="group-select" class="form-label mb-0 text-muted small">
|
|
97
|
+
<i class="bi bi-collection"></i> Group:
|
|
98
|
+
</label>
|
|
99
|
+
<select
|
|
100
|
+
id="group-select"
|
|
101
|
+
class="form-select form-select-sm"
|
|
102
|
+
style="width: auto;"
|
|
103
|
+
value={groupBy}
|
|
104
|
+
onchange={handleGroupChange}
|
|
105
|
+
>
|
|
106
|
+
{#each groupOptions as option}
|
|
107
|
+
<option value={option.value}>{option.label}</option>
|
|
108
|
+
{/each}
|
|
109
|
+
</select>
|
|
110
|
+
</div>
|
|
111
|
+
{/if}
|
|
112
|
+
|
|
113
|
+
<!-- Presets -->
|
|
114
|
+
{#if showPresets}
|
|
115
|
+
<div class="toolbar-preset d-flex align-items-center gap-2">
|
|
116
|
+
<label for="preset-select" class="form-label mb-0 text-muted small">
|
|
117
|
+
<i class="bi bi-layout-three-columns"></i> Columns:
|
|
118
|
+
</label>
|
|
119
|
+
<select
|
|
120
|
+
id="preset-select"
|
|
121
|
+
class="form-select form-select-sm"
|
|
122
|
+
style="width: auto;"
|
|
123
|
+
value={columnPreset}
|
|
124
|
+
onchange={handlePresetChange}
|
|
125
|
+
>
|
|
126
|
+
{#each presetOptions as option}
|
|
127
|
+
<option value={option.value}>{option.label}</option>
|
|
128
|
+
{/each}
|
|
129
|
+
</select>
|
|
130
|
+
</div>
|
|
131
|
+
{/if}
|
|
132
|
+
|
|
133
|
+
<div class="flex-grow-1"></div>
|
|
134
|
+
|
|
135
|
+
<!-- Actions -->
|
|
136
|
+
<div class="toolbar-actions d-flex align-items-center gap-2">
|
|
137
|
+
{#if onclearfilters}
|
|
138
|
+
<button
|
|
139
|
+
type="button"
|
|
140
|
+
class="btn btn-sm btn-outline-secondary"
|
|
141
|
+
onclick={onclearfilters}
|
|
142
|
+
title="Clear all filters"
|
|
143
|
+
>
|
|
144
|
+
<i class="bi bi-x-circle"></i>
|
|
145
|
+
<span class="d-none d-md-inline ms-1">Clear Filters</span>
|
|
146
|
+
</button>
|
|
147
|
+
{/if}
|
|
148
|
+
|
|
149
|
+
{#if showExport}
|
|
150
|
+
<div class="btn-group">
|
|
151
|
+
<button
|
|
152
|
+
type="button"
|
|
153
|
+
class="btn btn-sm btn-outline-primary"
|
|
154
|
+
onclick={onexportcsv}
|
|
155
|
+
title="Export to CSV"
|
|
156
|
+
>
|
|
157
|
+
<i class="bi bi-filetype-csv"></i>
|
|
158
|
+
<span class="d-none d-md-inline ms-1">CSV</span>
|
|
159
|
+
</button>
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
class="btn btn-sm btn-outline-primary"
|
|
163
|
+
onclick={onexportjson}
|
|
164
|
+
title="Export to JSON"
|
|
165
|
+
>
|
|
166
|
+
<i class="bi bi-filetype-json"></i>
|
|
167
|
+
<span class="d-none d-md-inline ms-1">JSON</span>
|
|
168
|
+
</button>
|
|
169
|
+
</div>
|
|
170
|
+
{/if}
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<style>
|
|
175
|
+
.cell-table-toolbar {
|
|
176
|
+
min-height: 48px;
|
|
177
|
+
flex-wrap: wrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.toolbar-stats .badge {
|
|
181
|
+
font-size: 0.75rem;
|
|
182
|
+
font-weight: 500;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.form-select-sm {
|
|
186
|
+
padding-top: 0.25rem;
|
|
187
|
+
padding-bottom: 0.25rem;
|
|
188
|
+
font-size: 0.8125rem;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.btn-sm {
|
|
192
|
+
padding: 0.25rem 0.5rem;
|
|
193
|
+
font-size: 0.8125rem;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (max-width: 768px) {
|
|
197
|
+
.cell-table-toolbar {
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
align-items: stretch !important;
|
|
200
|
+
gap: 0.5rem !important;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.toolbar-stats,
|
|
204
|
+
.toolbar-group,
|
|
205
|
+
.toolbar-preset,
|
|
206
|
+
.toolbar-actions {
|
|
207
|
+
justify-content: space-between;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.vr {
|
|
211
|
+
display: none;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.flex-grow-1 {
|
|
215
|
+
display: none;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CellTableGroupField, ColumnPreset } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Current grouping field */
|
|
4
|
+
groupBy?: CellTableGroupField;
|
|
5
|
+
/** Current column preset */
|
|
6
|
+
columnPreset?: ColumnPreset;
|
|
7
|
+
/** Total row count */
|
|
8
|
+
totalCount?: number;
|
|
9
|
+
/** Filtered row count */
|
|
10
|
+
filteredCount?: number;
|
|
11
|
+
/** Selected row count */
|
|
12
|
+
selectedCount?: number;
|
|
13
|
+
/** Show export buttons */
|
|
14
|
+
showExport?: boolean;
|
|
15
|
+
/** Show grouping dropdown */
|
|
16
|
+
showGrouping?: boolean;
|
|
17
|
+
/** Show preset dropdown */
|
|
18
|
+
showPresets?: boolean;
|
|
19
|
+
/** Group change event */
|
|
20
|
+
ongroupchange?: (group: CellTableGroupField) => void;
|
|
21
|
+
/** Preset change event */
|
|
22
|
+
onpresetchange?: (preset: ColumnPreset) => void;
|
|
23
|
+
/** Export CSV event */
|
|
24
|
+
onexportcsv?: () => void;
|
|
25
|
+
/** Export JSON event */
|
|
26
|
+
onexportjson?: () => void;
|
|
27
|
+
/** Clear filters event */
|
|
28
|
+
onclearfilters?: () => void;
|
|
29
|
+
}
|
|
30
|
+
declare const CellTableToolbar: import("svelte").Component<Props, {}, "">;
|
|
31
|
+
type CellTableToolbar = ReturnType<typeof CellTableToolbar>;
|
|
32
|
+
export default CellTableToolbar;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CellTable - Column Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines column definitions, presets, and formatters for the cell table
|
|
5
|
+
*/
|
|
6
|
+
import type { ColumnDefinition, CellComponent } from 'tabulator-tables';
|
|
7
|
+
import type { CellTableColumn, ColumnPreset, TechColorMap, StatusColorMap, ColumnGroups } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Default technology colors (Bootstrap-aligned)
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_TECH_COLORS: TechColorMap;
|
|
12
|
+
/**
|
|
13
|
+
* Default status colors (Bootstrap-aligned)
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_STATUS_COLORS: StatusColorMap;
|
|
16
|
+
/**
|
|
17
|
+
* Frequency band colors
|
|
18
|
+
*/
|
|
19
|
+
export declare const FBAND_COLORS: Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Column groups for different presets
|
|
22
|
+
*/
|
|
23
|
+
export declare const COLUMN_GROUPS: ColumnGroups;
|
|
24
|
+
/**
|
|
25
|
+
* Create a technology badge formatter
|
|
26
|
+
*/
|
|
27
|
+
export declare function createTechFormatter(colors?: TechColorMap): (cell: CellComponent) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Create a status badge formatter
|
|
30
|
+
*/
|
|
31
|
+
export declare function createStatusFormatter(colors?: StatusColorMap): (cell: CellComponent) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Create an fband badge formatter
|
|
34
|
+
*/
|
|
35
|
+
export declare function createFbandFormatter(): (cell: CellComponent) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Number formatter with fixed decimals
|
|
38
|
+
*/
|
|
39
|
+
export declare function numberFormatter(decimals?: number): (cell: CellComponent) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Coordinate formatter (lat/lng)
|
|
42
|
+
*/
|
|
43
|
+
export declare function coordinateFormatter(cell: CellComponent): string;
|
|
44
|
+
/**
|
|
45
|
+
* Azimuth formatter with degree symbol
|
|
46
|
+
*/
|
|
47
|
+
export declare function azimuthFormatter(cell: CellComponent): string;
|
|
48
|
+
/**
|
|
49
|
+
* Height formatter with meter unit
|
|
50
|
+
*/
|
|
51
|
+
export declare function heightFormatter(cell: CellComponent): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get all column definitions
|
|
54
|
+
*/
|
|
55
|
+
export declare function getAllColumns(techColors?: TechColorMap, statusColors?: StatusColorMap, headerFilters?: boolean): CellTableColumn[];
|
|
56
|
+
/**
|
|
57
|
+
* Get columns for a specific preset
|
|
58
|
+
*/
|
|
59
|
+
export declare function getColumnsForPreset(preset: ColumnPreset, techColors?: TechColorMap, statusColors?: StatusColorMap, headerFilters?: boolean): ColumnDefinition[];
|
|
60
|
+
/**
|
|
61
|
+
* Get group header formatter for a specific field
|
|
62
|
+
*/
|
|
63
|
+
export declare function getGroupHeaderFormatter(groupField: string): (value: unknown, count: number) => string;
|