@ssg-coop/luic-calculator-core 1.3.0 → 1.4.1
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/README.md +12 -2
- package/dist/api/domain.d.ts +5 -0
- package/dist/api/domain.js +5 -0
- package/dist/config/i18n/en.d.ts +19 -0
- package/dist/config/i18n/en.js +19 -0
- package/dist/config/i18n/fr.d.ts +19 -0
- package/dist/config/i18n/fr.js +19 -0
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.js +5 -0
- package/dist/generator/WorkbookGenerator.d.ts +4 -0
- package/dist/generator/WorkbookGenerator.js +69 -9
- package/dist/generator/builders/ChartDataSheetBuilder.d.ts +10 -0
- package/dist/generator/builders/ChartDataSheetBuilder.js +160 -7
- package/dist/generator/builders/ChartsSheetBuilder.js +103 -2
- package/dist/generator/builders/InputDataSheetBuilder.js +4 -3
- package/dist/generator/builders/ScenarioDetailsBuilder.d.ts +2 -0
- package/dist/generator/builders/ScenarioDetailsBuilder.js +4 -4
- package/dist/generator/builders/ScenarioSheetBuilder.d.ts +2 -0
- package/dist/generator/builders/ScenarioSheetBuilder.js +205 -25
- package/dist/generator/builders/SummarySheetBuilder.d.ts +3 -2
- package/dist/generator/builders/SummarySheetBuilder.js +109 -9
- package/dist/types/config.types.d.ts +9 -0
- package/dist/types/workbook.types.d.ts +52 -1
- package/package.json +1 -1
- package/dist/package.json +0 -31
- package/dist/src/config/appConfig.d.ts +0 -11
- package/dist/src/config/appConfig.js +0 -38
- package/dist/src/config/core/calculatorUtils.d.ts +0 -17
- package/dist/src/config/core/calculatorUtils.js +0 -212
- package/dist/src/config/core/genericUtils.d.ts +0 -10
- package/dist/src/config/core/genericUtils.js +0 -79
- package/dist/src/config/domain/buildings.d.ts +0 -14
- package/dist/src/config/domain/buildings.js +0 -282
- package/dist/src/config/domain/emissionFactors.d.ts +0 -2
- package/dist/src/config/domain/emissionFactors.js +0 -42
- package/dist/src/config/domain/energySources.d.ts +0 -18
- package/dist/src/config/domain/energySources.js +0 -370
- package/dist/src/config/domain/infrastructure.d.ts +0 -8
- package/dist/src/config/domain/infrastructure.js +0 -56
- package/dist/src/config/domain/neighbourhoodTypes.d.ts +0 -10
- package/dist/src/config/domain/neighbourhoodTypes.js +0 -366
- package/dist/src/config/domain/regions.d.ts +0 -8
- package/dist/src/config/domain/regions.js +0 -423
- package/dist/src/config/domain/services.d.ts +0 -8
- package/dist/src/config/domain/services.js +0 -48
- package/dist/src/config/domain/transportation.d.ts +0 -12
- package/dist/src/config/domain/transportation.js +0 -81
- package/dist/src/config/i18n/en.d.ts +0 -445
- package/dist/src/config/i18n/en.js +0 -488
- package/dist/src/config/i18n/fr.d.ts +0 -445
- package/dist/src/config/i18n/fr.js +0 -491
- package/dist/src/config/types.d.ts +0 -80
- package/dist/src/config/types.js +0 -5
- package/dist/src/generator/FormulaBuilder.d.ts +0 -58
- package/dist/src/generator/FormulaBuilder.js +0 -101
- package/dist/src/generator/WorkbookGenerator.d.ts +0 -7
- package/dist/src/generator/WorkbookGenerator.js +0 -77
- package/dist/src/generator/builders/AssumptionsBuilder.d.ts +0 -20
- package/dist/src/generator/builders/AssumptionsBuilder.js +0 -311
- package/dist/src/generator/builders/CalculationSheetBuilder.d.ts +0 -20
- package/dist/src/generator/builders/CalculationSheetBuilder.js +0 -149
- package/dist/src/generator/builders/EmissionFactorsSheetBuilder.d.ts +0 -7
- package/dist/src/generator/builders/EmissionFactorsSheetBuilder.js +0 -86
- package/dist/src/generator/builders/InputDataSheetBuilder.d.ts +0 -13
- package/dist/src/generator/builders/InputDataSheetBuilder.js +0 -114
- package/dist/src/generator/builders/ScenarioSheetBuilder.d.ts +0 -19
- package/dist/src/generator/builders/ScenarioSheetBuilder.js +0 -1067
- package/dist/src/generator/builders/SummarySheetBuilder.d.ts +0 -8
- package/dist/src/generator/builders/SummarySheetBuilder.js +0 -304
- package/dist/src/index.d.ts +0 -57
- package/dist/src/index.js +0 -103
- package/dist/src/theme/defaultTheme.d.ts +0 -2
- package/dist/src/theme/defaultTheme.js +0 -254
- package/dist/src/theme/index.d.ts +0 -2
- package/dist/src/theme/index.js +0 -2
- package/dist/src/theme/sunsetTheme.d.ts +0 -2
- package/dist/src/theme/sunsetTheme.js +0 -310
- package/dist/src/types/config.types.d.ts +0 -69
- package/dist/src/types/config.types.js +0 -1
- package/dist/src/types/scenario.types.d.ts +0 -63
- package/dist/src/types/scenario.types.js +0 -1
- package/dist/src/types/workbook.types.d.ts +0 -181
- package/dist/src/types/workbook.types.js +0 -1
- package/dist/src/utils/ReactivityUtils.d.ts +0 -7
- package/dist/src/utils/ReactivityUtils.js +0 -26
- package/dist/src/utils/cellAddressing.d.ts +0 -16
- package/dist/src/utils/cellAddressing.js +0 -35
- package/dist/src/utils/formatting.d.ts +0 -9
- package/dist/src/utils/formatting.js +0 -32
- package/dist/src/writers/JsonExporter.d.ts +0 -11
- package/dist/src/writers/JsonExporter.js +0 -14
- package/dist/types/blinktagtypes.d.ts +0 -167
- package/dist/types/blinktagtypes.js +0 -21
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export interface Scenario {
|
|
2
|
-
title: string;
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
provId: string;
|
|
6
|
-
year: number;
|
|
7
|
-
neighbourhoodType: string;
|
|
8
|
-
datetimeCreated: number;
|
|
9
|
-
datetimeModified: number;
|
|
10
|
-
buildings: Record<string, BuildingScenario>;
|
|
11
|
-
services: Record<string, ServiceScenario>;
|
|
12
|
-
infrastructure: Record<string, InfrastructureScenario>;
|
|
13
|
-
transportation: Record<string, TransportationScenario>;
|
|
14
|
-
revenue: {
|
|
15
|
-
developmentCharges: Record<string, RevenueDetail>;
|
|
16
|
-
propertyTaxes: Record<string, RevenueDetail>;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface BuildingScenario {
|
|
20
|
-
qty: number;
|
|
21
|
-
buildingEnergyCode: string;
|
|
22
|
-
eui: number;
|
|
23
|
-
energySources: Record<string, EnergySourceDetail>;
|
|
24
|
-
energyUse: number;
|
|
25
|
-
emissions: Emissions;
|
|
26
|
-
}
|
|
27
|
-
export interface ServiceScenario {
|
|
28
|
-
qty: number;
|
|
29
|
-
capCostIntensity: number;
|
|
30
|
-
capCost: number;
|
|
31
|
-
maintCostIntensity: number;
|
|
32
|
-
maintCost: number;
|
|
33
|
-
}
|
|
34
|
-
export interface InfrastructureScenario {
|
|
35
|
-
qty: number;
|
|
36
|
-
capCostIntensity: number;
|
|
37
|
-
capCost: number;
|
|
38
|
-
maintCostIntensity: number;
|
|
39
|
-
maintCost: number;
|
|
40
|
-
}
|
|
41
|
-
export interface TransportationScenario {
|
|
42
|
-
qty: number;
|
|
43
|
-
energySources: Record<string, EnergySourceDetail>;
|
|
44
|
-
energyUse?: number;
|
|
45
|
-
emissions?: Emissions;
|
|
46
|
-
}
|
|
47
|
-
export interface EnergySourceDetail {
|
|
48
|
-
value: number;
|
|
49
|
-
units: string;
|
|
50
|
-
fuelDensity?: number;
|
|
51
|
-
emissionsFactors?: Record<string, number | number[]>;
|
|
52
|
-
references?: [string, string][];
|
|
53
|
-
}
|
|
54
|
-
export interface Emissions {
|
|
55
|
-
CO2: number;
|
|
56
|
-
CH4: number;
|
|
57
|
-
N2O: number;
|
|
58
|
-
total: number;
|
|
59
|
-
}
|
|
60
|
-
export interface RevenueDetail {
|
|
61
|
-
perUnit: number;
|
|
62
|
-
total: number;
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cell values use Excel JS API convention: 2D arrays
|
|
3
|
-
* Single cell: [[value]]
|
|
4
|
-
* Row: [[val1, val2, val3]]
|
|
5
|
-
* Grid: [[r1c1, r1c2], [r2c1, r2c2]]
|
|
6
|
-
*/
|
|
7
|
-
export type CellValues = (string | number | boolean | null)[][];
|
|
8
|
-
/**
|
|
9
|
-
* Formulas follow same 2D array pattern
|
|
10
|
-
* All formulas start with '='
|
|
11
|
-
*/
|
|
12
|
-
export type CellFormulas = string[][];
|
|
13
|
-
/**
|
|
14
|
-
* Number format strings - Excel-compatible patterns
|
|
15
|
-
* These work in both Excel JS API and openpyxl
|
|
16
|
-
*/
|
|
17
|
-
export type NumberFormatPattern = '#,##0' | '#,##0.00' | '#,##0.000' | '$#,##0' | '$#,##0.00' | '0%' | '0.00%' | string;
|
|
18
|
-
/**
|
|
19
|
-
* Alignment values - matches Excel.HorizontalAlignment / VerticalAlignment
|
|
20
|
-
*/
|
|
21
|
-
export type HorizontalAlignment = 'General' | 'Left' | 'Center' | 'Right' | 'Fill' | 'Justify' | 'CenterAcrossSelection' | 'Distributed';
|
|
22
|
-
export type VerticalAlignment = 'Top' | 'Center' | 'Bottom' | 'Justify' | 'Distributed';
|
|
23
|
-
/**
|
|
24
|
-
* Border style - matches Excel.BorderLineStyle
|
|
25
|
-
*/
|
|
26
|
-
export type BorderLineStyle = 'None' | 'Continuous' | 'Dash' | 'DashDot' | 'DashDotDot' | 'Dot' | 'Double' | 'SlantDashDot';
|
|
27
|
-
/**
|
|
28
|
-
* Border position - matches Excel.BorderIndex
|
|
29
|
-
*/
|
|
30
|
-
export type BorderIndex = 'EdgeTop' | 'EdgeBottom' | 'EdgeLeft' | 'EdgeRight' | 'InsideVertical' | 'InsideHorizontal' | 'DiagonalDown' | 'DiagonalUp';
|
|
31
|
-
/**
|
|
32
|
-
* Chart type - matches Excel.ChartType enum subset
|
|
33
|
-
*/
|
|
34
|
-
export type ChartType = 'ColumnClustered' | 'ColumnStacked' | 'ColumnStacked100' | 'BarClustered' | 'BarStacked' | 'BarStacked100' | 'Line' | 'LineMarkers' | 'LineStacked' | 'Pie' | 'PieExploded' | 'Area' | 'AreaStacked';
|
|
35
|
-
/**
|
|
36
|
-
* Chart series by - matches Excel.ChartSeriesBy
|
|
37
|
-
*/
|
|
38
|
-
export type ChartSeriesBy = 'Auto' | 'Columns' | 'Rows';
|
|
39
|
-
/**
|
|
40
|
-
* Chart legend position - matches Excel.ChartLegendPosition
|
|
41
|
-
*/
|
|
42
|
-
export type ChartLegendPosition = 'Invalid' | 'Top' | 'Bottom' | 'Left' | 'Right' | 'Corner' | 'Custom';
|
|
43
|
-
/**
|
|
44
|
-
* Axis type - matches Excel.ChartAxisType
|
|
45
|
-
*/
|
|
46
|
-
export type ChartAxisType = 'Invalid' | 'Category' | 'Value' | 'Series';
|
|
47
|
-
/**
|
|
48
|
-
* Display unit - matches Excel.ChartAxisDisplayUnit
|
|
49
|
-
*/
|
|
50
|
-
export type AxisDisplayUnit = 'None' | 'Hundreds' | 'Thousands' | 'TenThousands' | 'HundredThousands' | 'Millions' | 'TenMillions' | 'HundredMillions' | 'Billions' | 'Trillions';
|
|
51
|
-
/**
|
|
52
|
-
* Sheet visibility - matches Excel.SheetVisibility
|
|
53
|
-
*/
|
|
54
|
-
export type SheetVisibility = 'Visible' | 'Hidden' | 'VeryHidden';
|
|
55
|
-
export interface WorkbookSpec {
|
|
56
|
-
metadata: WorkbookMetadata;
|
|
57
|
-
sheets: SheetSpec[];
|
|
58
|
-
namedRanges: NamedRangeSpec[];
|
|
59
|
-
typography?: {
|
|
60
|
-
fontName: string;
|
|
61
|
-
fontSize: number;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export interface WorkbookMetadata {
|
|
65
|
-
generatedAt: string;
|
|
66
|
-
generatorVersion: string;
|
|
67
|
-
locale: string;
|
|
68
|
-
}
|
|
69
|
-
export interface SheetSpec {
|
|
70
|
-
name: string;
|
|
71
|
-
sheetType: SheetType;
|
|
72
|
-
visibility: SheetVisibility;
|
|
73
|
-
tabColor: string | null;
|
|
74
|
-
showGridlines: boolean;
|
|
75
|
-
customProperties: Record<string, string>;
|
|
76
|
-
columnWidths: ColumnWidthSpec[];
|
|
77
|
-
rows: RowSpec[];
|
|
78
|
-
mergedRanges: string[];
|
|
79
|
-
charts?: ChartSpec[];
|
|
80
|
-
}
|
|
81
|
-
export type SheetType = 'scenario' | 'summary' | 'assumptions' | 'chartData' | 'charts' | 'data';
|
|
82
|
-
export interface ColumnWidthSpec {
|
|
83
|
-
range: string;
|
|
84
|
-
width: number;
|
|
85
|
-
}
|
|
86
|
-
export interface RowSpec {
|
|
87
|
-
rowIndex: number;
|
|
88
|
-
cells: CellSpec[];
|
|
89
|
-
}
|
|
90
|
-
export interface CellSpec {
|
|
91
|
-
/** Column address, e.g., 'A' or 'AA' */
|
|
92
|
-
column: string;
|
|
93
|
-
/**
|
|
94
|
-
* Static value - use this OR formula, not both
|
|
95
|
-
* Matches Excel JS API range.values structure
|
|
96
|
-
*/
|
|
97
|
-
value?: string | number | boolean | null;
|
|
98
|
-
/**
|
|
99
|
-
* Formula string starting with '='
|
|
100
|
-
* Matches Excel JS API range.formulas structure
|
|
101
|
-
*/
|
|
102
|
-
formula?: string;
|
|
103
|
-
/**
|
|
104
|
-
* Cell formatting
|
|
105
|
-
*/
|
|
106
|
-
format?: CellFormatSpec;
|
|
107
|
-
/**
|
|
108
|
-
* Hyperlink (optional)
|
|
109
|
-
*/
|
|
110
|
-
hyperlink?: HyperlinkSpec;
|
|
111
|
-
}
|
|
112
|
-
export interface CellFormatSpec {
|
|
113
|
-
font?: {
|
|
114
|
-
bold?: boolean;
|
|
115
|
-
italic?: boolean;
|
|
116
|
-
size?: number;
|
|
117
|
-
color?: string;
|
|
118
|
-
name?: string;
|
|
119
|
-
};
|
|
120
|
-
fill?: {
|
|
121
|
-
color: string;
|
|
122
|
-
};
|
|
123
|
-
numberFormat?: NumberFormatPattern;
|
|
124
|
-
horizontalAlignment?: HorizontalAlignment;
|
|
125
|
-
verticalAlignment?: VerticalAlignment;
|
|
126
|
-
wrapText?: boolean;
|
|
127
|
-
borders?: BorderSpec[];
|
|
128
|
-
}
|
|
129
|
-
export interface BorderSpec {
|
|
130
|
-
index: BorderIndex;
|
|
131
|
-
style: BorderLineStyle;
|
|
132
|
-
color?: string;
|
|
133
|
-
}
|
|
134
|
-
export interface HyperlinkSpec {
|
|
135
|
-
address: string;
|
|
136
|
-
textToDisplay?: string;
|
|
137
|
-
screenTip?: string;
|
|
138
|
-
}
|
|
139
|
-
export interface NamedRangeSpec {
|
|
140
|
-
name: string;
|
|
141
|
-
refersTo: string;
|
|
142
|
-
scope?: string;
|
|
143
|
-
comment?: string;
|
|
144
|
-
}
|
|
145
|
-
export interface ChartSpec {
|
|
146
|
-
name: string;
|
|
147
|
-
chartType: ChartType;
|
|
148
|
-
/** Data source range address, e.g., 'Sheet1!A1:D10' */
|
|
149
|
-
sourceDataRange: string;
|
|
150
|
-
seriesBy: ChartSeriesBy;
|
|
151
|
-
/** Position as range address, e.g., 'A5:F20' */
|
|
152
|
-
position: string;
|
|
153
|
-
title?: {
|
|
154
|
-
text: string;
|
|
155
|
-
visible?: boolean;
|
|
156
|
-
};
|
|
157
|
-
legend?: {
|
|
158
|
-
visible: boolean;
|
|
159
|
-
position: ChartLegendPosition;
|
|
160
|
-
};
|
|
161
|
-
axes?: {
|
|
162
|
-
category?: ChartAxisSpec;
|
|
163
|
-
value?: ChartAxisSpec;
|
|
164
|
-
};
|
|
165
|
-
/** Override series names */
|
|
166
|
-
series?: ChartSeriesSpec[];
|
|
167
|
-
}
|
|
168
|
-
export interface ChartAxisSpec {
|
|
169
|
-
title?: {
|
|
170
|
-
text: string;
|
|
171
|
-
visible?: boolean;
|
|
172
|
-
};
|
|
173
|
-
displayUnit?: AxisDisplayUnit;
|
|
174
|
-
minimum?: number;
|
|
175
|
-
maximum?: number;
|
|
176
|
-
categoryNames?: string[];
|
|
177
|
-
}
|
|
178
|
-
export interface ChartSeriesSpec {
|
|
179
|
-
index: number;
|
|
180
|
-
name: string;
|
|
181
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export class ReactivityUtils {
|
|
2
|
-
/**
|
|
3
|
-
* Recursively traverses an object and unwraps any Vue/Pinia reactive wrappers
|
|
4
|
-
* specifically looking for the `_custom.value` pattern.
|
|
5
|
-
*/
|
|
6
|
-
static unwrap(obj) {
|
|
7
|
-
if (obj === null || typeof obj !== 'object') {
|
|
8
|
-
return obj;
|
|
9
|
-
}
|
|
10
|
-
// If it's an array, map over its items
|
|
11
|
-
if (Array.isArray(obj)) {
|
|
12
|
-
return obj.map(item => this.unwrap(item));
|
|
13
|
-
}
|
|
14
|
-
// Check if this object is a reactive wrapper
|
|
15
|
-
if (obj._custom && obj._custom.value !== undefined) {
|
|
16
|
-
// Unwrap and recursively process the inner value
|
|
17
|
-
return this.unwrap(obj._custom.value);
|
|
18
|
-
}
|
|
19
|
-
// Otherwise, it's a normal object, recursively process its properties
|
|
20
|
-
const result = {};
|
|
21
|
-
for (const key of Object.keys(obj)) {
|
|
22
|
-
result[key] = this.unwrap(obj[key]);
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple utilities to handle Excel column letters.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Convert 0-based column index to Excel column string (e.g. 0 -> 'A', 25 -> 'Z', 26 -> 'AA')
|
|
6
|
-
*/
|
|
7
|
-
export declare function getColumnLetter(colIndex: number): string;
|
|
8
|
-
/**
|
|
9
|
-
* Expand a range across columns given a start column and length.
|
|
10
|
-
* Useful for building dynamic ranges for time-series.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getRangeAcrossColumns(startLetter: string, startRow: number, length: number): string;
|
|
13
|
-
/**
|
|
14
|
-
* Convert Excel column letter to 0-based index (e.g. 'A' -> 0, 'Z' -> 25)
|
|
15
|
-
*/
|
|
16
|
-
export declare function colLetterToIndex(colLetter: string): number;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple utilities to handle Excel column letters.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Convert 0-based column index to Excel column string (e.g. 0 -> 'A', 25 -> 'Z', 26 -> 'AA')
|
|
6
|
-
*/
|
|
7
|
-
export function getColumnLetter(colIndex) {
|
|
8
|
-
let letter = '';
|
|
9
|
-
let temp = colIndex;
|
|
10
|
-
while (temp >= 0) {
|
|
11
|
-
letter = String.fromCharCode((temp % 26) + 65) + letter;
|
|
12
|
-
temp = Math.floor(temp / 26) - 1;
|
|
13
|
-
}
|
|
14
|
-
return letter;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Expand a range across columns given a start column and length.
|
|
18
|
-
* Useful for building dynamic ranges for time-series.
|
|
19
|
-
*/
|
|
20
|
-
export function getRangeAcrossColumns(startLetter, startRow, length) {
|
|
21
|
-
if (length <= 0)
|
|
22
|
-
return `${startLetter}${startRow}`;
|
|
23
|
-
const endLetter = getColumnLetter(colLetterToIndex(startLetter) + length - 1);
|
|
24
|
-
return `${startLetter}${startRow}:${endLetter}${startRow}`;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Convert Excel column letter to 0-based index (e.g. 'A' -> 0, 'Z' -> 25)
|
|
28
|
-
*/
|
|
29
|
-
export function colLetterToIndex(colLetter) {
|
|
30
|
-
let index = 0;
|
|
31
|
-
for (let i = 0; i < colLetter.length; i++) {
|
|
32
|
-
index = index * 26 + (colLetter.charCodeAt(i) - 64);
|
|
33
|
-
}
|
|
34
|
-
return index - 1;
|
|
35
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CellFormatSpec } from '../types/workbook.types';
|
|
2
|
-
export declare const FormattingUtils: {
|
|
3
|
-
header: (backgroundColor?: string, fontColor?: string) => CellFormatSpec;
|
|
4
|
-
boldText: (backgroundColor?: string) => CellFormatSpec;
|
|
5
|
-
italicText: () => CellFormatSpec;
|
|
6
|
-
number: (decimals?: number, backgroundColor?: string) => CellFormatSpec;
|
|
7
|
-
currency: (decimals?: number, backgroundColor?: string) => CellFormatSpec;
|
|
8
|
-
percent: (decimals?: number, backgroundColor?: string) => CellFormatSpec;
|
|
9
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const FormattingUtils = {
|
|
2
|
-
header: (backgroundColor = '#CFE2F3', fontColor) => ({
|
|
3
|
-
font: {
|
|
4
|
-
bold: true,
|
|
5
|
-
size: 14,
|
|
6
|
-
...(fontColor ? { color: fontColor } : {})
|
|
7
|
-
},
|
|
8
|
-
fill: {
|
|
9
|
-
color: backgroundColor
|
|
10
|
-
},
|
|
11
|
-
verticalAlignment: 'Center'
|
|
12
|
-
}),
|
|
13
|
-
boldText: (backgroundColor) => ({
|
|
14
|
-
font: { bold: true },
|
|
15
|
-
...(backgroundColor ? { fill: { color: backgroundColor } } : {})
|
|
16
|
-
}),
|
|
17
|
-
italicText: () => ({
|
|
18
|
-
font: { italic: true }
|
|
19
|
-
}),
|
|
20
|
-
number: (decimals = 0, backgroundColor) => ({
|
|
21
|
-
numberFormat: decimals === 0 ? '#,##0' : `#,##0.${'0'.repeat(decimals)}`,
|
|
22
|
-
...(backgroundColor ? { fill: { color: backgroundColor } } : {})
|
|
23
|
-
}),
|
|
24
|
-
currency: (decimals = 0, backgroundColor) => ({
|
|
25
|
-
numberFormat: decimals === 0 ? '$#,##0' : `$#,##0.${'0'.repeat(decimals)}`,
|
|
26
|
-
...(backgroundColor ? { fill: { color: backgroundColor } } : {})
|
|
27
|
-
}),
|
|
28
|
-
percent: (decimals = 0, backgroundColor) => ({
|
|
29
|
-
numberFormat: decimals === 0 ? '0%' : `0.${'0'.repeat(decimals)}%`,
|
|
30
|
-
...(backgroundColor ? { fill: { color: backgroundColor } } : {})
|
|
31
|
-
})
|
|
32
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WorkbookSpec } from '../types/workbook.types';
|
|
2
|
-
export declare class JsonExporter {
|
|
3
|
-
/**
|
|
4
|
-
* Serialize a WorkbookSpec to a JSON string.
|
|
5
|
-
*/
|
|
6
|
-
static serialize(spec: WorkbookSpec, pretty?: boolean): string;
|
|
7
|
-
/**
|
|
8
|
-
* Parse a JSON string back to a WorkbookSpec.
|
|
9
|
-
*/
|
|
10
|
-
static deserialize(jsonString: string): WorkbookSpec;
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class JsonExporter {
|
|
2
|
-
/**
|
|
3
|
-
* Serialize a WorkbookSpec to a JSON string.
|
|
4
|
-
*/
|
|
5
|
-
static serialize(spec, pretty = true) {
|
|
6
|
-
return JSON.stringify(spec, null, pretty ? 2 : 0);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Parse a JSON string back to a WorkbookSpec.
|
|
10
|
-
*/
|
|
11
|
-
static deserialize(jsonString) {
|
|
12
|
-
return JSON.parse(jsonString);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { PermissionType } from '@/components/profile/types';
|
|
2
|
-
import { buildingsConfig, energySourcesConfig, infrastructureConfig, neighbourhoodTypesConfig, revenueConfig, servicesConfig, transportationConfig } from 'luic-calculator-core';
|
|
3
|
-
type StepStatus = {
|
|
4
|
-
completed: boolean;
|
|
5
|
-
unlocked: boolean;
|
|
6
|
-
};
|
|
7
|
-
interface SectorReferences {
|
|
8
|
-
description: string;
|
|
9
|
-
references: [string, string][];
|
|
10
|
-
}
|
|
11
|
-
type Reference = [string, string] | [string];
|
|
12
|
-
export interface Neighbourhood {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
description: string;
|
|
16
|
-
developmentType: 'existing' | 'greenfield';
|
|
17
|
-
icon: string;
|
|
18
|
-
sectorDefaults: {
|
|
19
|
-
homes: Record<string, number>;
|
|
20
|
-
services: {
|
|
21
|
-
school: number;
|
|
22
|
-
police: number;
|
|
23
|
-
fire: number;
|
|
24
|
-
waste: number;
|
|
25
|
-
};
|
|
26
|
-
infrastructure: {
|
|
27
|
-
road2: number;
|
|
28
|
-
road4: number;
|
|
29
|
-
sidewalk: number;
|
|
30
|
-
bikelane: number;
|
|
31
|
-
water: number;
|
|
32
|
-
wastewater: number;
|
|
33
|
-
};
|
|
34
|
-
transportation: {
|
|
35
|
-
puv: number;
|
|
36
|
-
transit: number;
|
|
37
|
-
walk: number;
|
|
38
|
-
bike: number;
|
|
39
|
-
};
|
|
40
|
-
DOC: number;
|
|
41
|
-
};
|
|
42
|
-
sectorReferences: {
|
|
43
|
-
homes: SectorReferences;
|
|
44
|
-
services: SectorReferences;
|
|
45
|
-
infrastructure: SectorReferences;
|
|
46
|
-
transportation: SectorReferences;
|
|
47
|
-
revenue: SectorReferences;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export type NeighbourhoodType = keyof ReturnType<typeof neighbourhoodTypesConfig>['neighbourhoods'];
|
|
51
|
-
export declare const ALL_HOME_TYPES: readonly ["single", "row", "apt"];
|
|
52
|
-
export type HomeType = keyof ReturnType<typeof buildingsConfig>['homeTypes'];
|
|
53
|
-
export interface BuildingEnergyCode {
|
|
54
|
-
id: string;
|
|
55
|
-
name: string;
|
|
56
|
-
description: string;
|
|
57
|
-
references: Reference[];
|
|
58
|
-
eui: Record<string, number>;
|
|
59
|
-
}
|
|
60
|
-
export type BuildingEnergyCodeType = keyof ReturnType<typeof buildingsConfig>['buildingEnergyCodes'];
|
|
61
|
-
export type EnergySourceType = keyof ReturnType<typeof energySourcesConfig>['energySources'];
|
|
62
|
-
type EmissionType = 'CO2' | 'CH4' | 'N2O';
|
|
63
|
-
type EmissionFactors = Record<EmissionType, number | number[]>;
|
|
64
|
-
export type Emissions = {
|
|
65
|
-
CO2: number;
|
|
66
|
-
CH4: number;
|
|
67
|
-
N2O: number;
|
|
68
|
-
total: number;
|
|
69
|
-
};
|
|
70
|
-
export type EnergySourceTypeSpecs = {
|
|
71
|
-
id: string;
|
|
72
|
-
name: string;
|
|
73
|
-
description: string;
|
|
74
|
-
absUnit: string;
|
|
75
|
-
convUnit: string;
|
|
76
|
-
convVal?: number;
|
|
77
|
-
emissionsFactors: EmissionFactors;
|
|
78
|
-
references: [string, string?][];
|
|
79
|
-
efUnit?: string;
|
|
80
|
-
};
|
|
81
|
-
export type EnergySourceData = {
|
|
82
|
-
value: number;
|
|
83
|
-
units: string;
|
|
84
|
-
fuelDensity?: number;
|
|
85
|
-
emissionsFactors?: EmissionFactors;
|
|
86
|
-
references?: [string, string?][];
|
|
87
|
-
};
|
|
88
|
-
export type EnergyAllocation = Record<EnergySourceType, number>;
|
|
89
|
-
export type EnergySources = Record<EnergySourceType, EnergySourceData>;
|
|
90
|
-
export type BuildingData = {
|
|
91
|
-
qty?: number;
|
|
92
|
-
buildingEnergyCode?: string;
|
|
93
|
-
eui?: number;
|
|
94
|
-
energySources?: EnergySources;
|
|
95
|
-
energyUse?: number;
|
|
96
|
-
emissions?: Emissions;
|
|
97
|
-
};
|
|
98
|
-
export declare const ALL_SERVICE_TYPES: readonly ["school", "police", "fire", "waste"];
|
|
99
|
-
export type ServiceType = keyof ReturnType<typeof servicesConfig>['serviceTypes'];
|
|
100
|
-
export type CostData = {
|
|
101
|
-
qty?: number;
|
|
102
|
-
capCostIntensity: number;
|
|
103
|
-
capCost?: number;
|
|
104
|
-
maintCostIntensity: number;
|
|
105
|
-
maintCost?: number;
|
|
106
|
-
};
|
|
107
|
-
export declare const ALL_INFRASTRUCTURE_TYPES: readonly ["road2", "road4", "sidewalk", "bikelane", "water", "wastewater"];
|
|
108
|
-
export type InfrastructureType = keyof ReturnType<typeof infrastructureConfig>['infrastructureTypes'];
|
|
109
|
-
export declare const ALL_TRANSPORT_TYPES: readonly ["puv", "transit", "walk", "bike"];
|
|
110
|
-
export type TransportType = keyof ReturnType<typeof transportationConfig>['transportationTypes'];
|
|
111
|
-
export type TransportFuelData = {
|
|
112
|
-
qty?: number;
|
|
113
|
-
energySources: EnergySources;
|
|
114
|
-
energyUse?: number;
|
|
115
|
-
emissions?: Emissions;
|
|
116
|
-
};
|
|
117
|
-
export type TransportationTypeSpecs = {
|
|
118
|
-
id: TransportType;
|
|
119
|
-
name: string;
|
|
120
|
-
fuelConsumption?: Partial<Record<EnergySourceType, number>>;
|
|
121
|
-
active?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type RevenueData = Partial<Record<HomeType, {
|
|
124
|
-
perUnit: number;
|
|
125
|
-
total: number;
|
|
126
|
-
}>>;
|
|
127
|
-
export declare const ALL_REVENUE_TYPES: readonly ["developmentCharges", "propertyTaxes"];
|
|
128
|
-
export type RevenueType = keyof ReturnType<typeof revenueConfig>['revenueTypes'];
|
|
129
|
-
export type ScenarioMeta = {
|
|
130
|
-
id: string | null;
|
|
131
|
-
createdAt: string | null;
|
|
132
|
-
modifiedAt: string | null;
|
|
133
|
-
modifiedBy: {
|
|
134
|
-
id: string | null;
|
|
135
|
-
email: string | null;
|
|
136
|
-
};
|
|
137
|
-
modifiedStudents: boolean;
|
|
138
|
-
permission: PermissionType | null;
|
|
139
|
-
projectId: string | null;
|
|
140
|
-
currentStep: number | null;
|
|
141
|
-
steps: StepStatus[];
|
|
142
|
-
otherNames: string[];
|
|
143
|
-
};
|
|
144
|
-
export type ScenarioData = {
|
|
145
|
-
id: string | null;
|
|
146
|
-
title: string;
|
|
147
|
-
description: string;
|
|
148
|
-
provId: string;
|
|
149
|
-
year: number | null;
|
|
150
|
-
neighbourhoodType: string;
|
|
151
|
-
buildings: Record<HomeType, BuildingData>;
|
|
152
|
-
services: Record<ServiceType, CostData>;
|
|
153
|
-
infrastructure: Record<InfrastructureType, CostData>;
|
|
154
|
-
transportation: Record<TransportType, TransportFuelData>;
|
|
155
|
-
revenue: Record<RevenueType, RevenueData>;
|
|
156
|
-
};
|
|
157
|
-
export type Scenario = ScenarioMeta & {
|
|
158
|
-
data: ScenarioData;
|
|
159
|
-
};
|
|
160
|
-
export type ExcelScenario = ScenarioMeta & ScenarioData;
|
|
161
|
-
export type ProjectData = {
|
|
162
|
-
id: string;
|
|
163
|
-
name: string;
|
|
164
|
-
permission: PermissionType;
|
|
165
|
-
scenarios: Scenario[];
|
|
166
|
-
};
|
|
167
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// 'urbanInfillV1' | 'urbanInfillV2' | 'TODV1' | 'TODV2' | 'suburbanV1' | 'suburbanV2'
|
|
2
|
-
export const ALL_HOME_TYPES = ['single', 'row', 'apt'];
|
|
3
|
-
export const ALL_SERVICE_TYPES = ['school', 'police', 'fire', 'waste'];
|
|
4
|
-
export const ALL_INFRASTRUCTURE_TYPES = [
|
|
5
|
-
'road2',
|
|
6
|
-
'road4',
|
|
7
|
-
'sidewalk',
|
|
8
|
-
'bikelane',
|
|
9
|
-
'water',
|
|
10
|
-
'wastewater',
|
|
11
|
-
];
|
|
12
|
-
// export const ALL_INFRASTRUCTURE_TYPES: InfrastructureType[] =
|
|
13
|
-
// infrastructureConfig()
|
|
14
|
-
// .getInfrastructureTypeNamesIdsAsArray()
|
|
15
|
-
// .map((item) => item.id as InfrastructureType);
|
|
16
|
-
// 'road2' | 'road4' | 'sidewalk' | 'bikelane' | 'water' | 'wastewater'
|
|
17
|
-
export const ALL_TRANSPORT_TYPES = ['puv', 'transit', 'walk', 'bike'];
|
|
18
|
-
export const ALL_REVENUE_TYPES = [
|
|
19
|
-
'developmentCharges',
|
|
20
|
-
'propertyTaxes',
|
|
21
|
-
];
|