@dative-gpi/foundation-shared-domain 1.0.190 → 1.0.191-add-unit-formatter-2

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/enums/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from "./messages";
17
17
  export * from "./playlists";
18
18
  export * from "./roles";
19
19
  export * from "./times";
20
+ export * from "./units";
20
21
  export * from "./users";
21
22
  export * from "./widgetTemplates";
22
23
  export * from "./reports";
package/enums/units.ts ADDED
@@ -0,0 +1,174 @@
1
+ export enum UnitPrefix {
2
+ None = "",
3
+ Nano = "n",
4
+ Micro = "µ",
5
+ Milli = "m",
6
+ Kilo = "k",
7
+ Mega = "M",
8
+ Giga = "G",
9
+ Tera = "T",
10
+ Peta = "P"
11
+ }
12
+
13
+ export enum UnitFamily {
14
+ Energy = "energy",
15
+ Power = "power",
16
+ Volume = "volume",
17
+ GasVolume = "gasVolume",
18
+ WaterFlow = "waterFlow",
19
+ GasFlow = "gasFlow",
20
+ Pressure = "pressure",
21
+ Temperature = "temperature",
22
+ Speed = "speed",
23
+ Distance = "distance",
24
+ Mass = "mass",
25
+ MassFlow = "massFlow",
26
+ Frequency = "frequency",
27
+ Voltage = "voltage",
28
+ Current = "current",
29
+ Resistance = "resistance",
30
+ Percentage = "percentage",
31
+ Capacity = "capacity",
32
+ SnowProduction = "snowProduction",
33
+ Efficiency = "efficiency"
34
+ }
35
+
36
+
37
+ export enum EnergyUnit {
38
+ Wh = "Wh",
39
+ kWh = "kWh",
40
+ MWh = "MWh",
41
+ GWh = "GWh",
42
+ TWh = "TWh",
43
+ }
44
+
45
+ export enum PowerUnit {
46
+ W = "W",
47
+ kW = "kW",
48
+ MW = "MW",
49
+ GW = "GW",
50
+ TW = "TW",
51
+ }
52
+
53
+ export enum VolumeUnit {
54
+ mL = "mL",
55
+ L = "L",
56
+ m3 = "m3",
57
+ dam3 = "dam3",
58
+ }
59
+
60
+ export enum GasVolumeUnit {
61
+ Nm3 = "Nm3",
62
+ kNm3 = "kNm3",
63
+ MNm3 = "MNm3",
64
+ GNm3 = "GNm3",
65
+ }
66
+
67
+ export enum WaterFlowUnit {
68
+ mL_s = "mL/s",
69
+ L_s = "L/s",
70
+ m3_s = "m3/s",
71
+ L_min = "L/min",
72
+ m3_h = "m3/h",
73
+ }
74
+
75
+ export enum GasFlowUnit {
76
+ Nm3_h = "Nm3/h",
77
+ kNm3_h = "kNm3/h",
78
+ MNm3_h = "MNm3/h",
79
+ }
80
+
81
+ export enum PressureUnit {
82
+ Pa = "Pa",
83
+ kPa = "kPa",
84
+ MPa = "MPa",
85
+ GPa = "GPa",
86
+ bar = "bar",
87
+ mbar = "mbar",
88
+ }
89
+
90
+ export enum TemperatureUnit {
91
+ Celsius = "°C",
92
+ Kelvin = "K",
93
+ Fahrenheit = "°F",
94
+ }
95
+
96
+ export enum SpeedUnit {
97
+ m_s = "m/s",
98
+ km_h = "km/h",
99
+ knot = "kn",
100
+ }
101
+
102
+ export enum DistanceUnit {
103
+ mm = "mm",
104
+ cm = "cm",
105
+ m = "m",
106
+ km = "km",
107
+ }
108
+
109
+ export enum MassUnit {
110
+ mg = "mg",
111
+ g = "g",
112
+ kg = "kg",
113
+ t = "t",
114
+ kt = "kt",
115
+ Mt = "Mt",
116
+ }
117
+
118
+ export enum MassFlowUnit {
119
+ g_s = "g/s",
120
+ kg_s = "kg/s",
121
+ t_s = "t/s",
122
+ kg_h = "kg/h",
123
+ t_h = "t/h",
124
+ }
125
+
126
+ export enum FrequencyUnit {
127
+ Hz = "Hz",
128
+ kHz = "kHz",
129
+ MHz = "MHz",
130
+ GHz = "GHz",
131
+ rpm = "rpm",
132
+ }
133
+
134
+ export enum VoltageUnit {
135
+ mV = "mV",
136
+ V = "V",
137
+ kV = "kV",
138
+ MV = "MV",
139
+ }
140
+
141
+ export enum CurrentUnit {
142
+ mA = "mA",
143
+ A = "A",
144
+ kA = "kA",
145
+ }
146
+
147
+ export enum ResistanceUnit {
148
+ mΩ = "mΩ",
149
+ Ω = "Ω",
150
+ kΩ = "kΩ",
151
+ MΩ = "MΩ",
152
+ }
153
+
154
+ export enum PercentageUnit {
155
+ Percent = "%",
156
+ RelativeHumidity = "%RH",
157
+ }
158
+
159
+ export enum CapacityUnit {
160
+ pers = "pers",
161
+ pers_h = "pers/h",
162
+ }
163
+
164
+ export enum SnowProductionUnit {
165
+ m3_neige_h = "m3_neige/h",
166
+ }
167
+
168
+ export enum EfficiencyUnit {
169
+ kWh_m3 = "kWh/m3",
170
+ kWh_kg = "kWh/kg",
171
+ }
172
+
173
+
174
+
package/models/index.ts CHANGED
@@ -11,5 +11,6 @@ export * from "./permissions";
11
11
  export * from "./terminals";
12
12
  export * from "./timeZones";
13
13
  export * from "./translations";
14
+ export * from "./units";
14
15
  export * from "./userLegalInformations";
15
16
  export * from "./users";
@@ -0,0 +1,2 @@
1
+ export * from "./unitDetails";
2
+ export * from "./unitsRegistry";
@@ -0,0 +1,22 @@
1
+ import type { UnitFamily } from "@dative-gpi/foundation-shared-domain/enums";
2
+
3
+ export type UnitScaleStep = { unit: string; ratioToParent: number };
4
+
5
+ export type UnitConversion = {
6
+ sourceUnit: string;
7
+ targetUnit: string;
8
+ conversionRate: number;
9
+ minThreshold?: number;
10
+ };
11
+
12
+ export interface UnitDefinition {
13
+ symbol: string;
14
+ precision: number;
15
+ family?: UnitFamily;
16
+ factor?: number;
17
+ conversions?: Array<{
18
+ targetUnit: string;
19
+ conversionRate: number;
20
+ minThreshold?: number;
21
+ }>;
22
+ }
@@ -0,0 +1,497 @@
1
+ import { EnergyUnit, PowerUnit, GasFlowUnit, PressureUnit, TemperatureUnit, SpeedUnit, DistanceUnit, MassUnit, MassFlowUnit, FrequencyUnit, VoltageUnit, CurrentUnit, ResistanceUnit, PercentageUnit, CapacityUnit, SnowProductionUnit, EfficiencyUnit, VolumeUnit, GasVolumeUnit, WaterFlowUnit, UnitFamily } from "@dative-gpi/foundation-shared-domain/enums"
2
+ import type { UnitDefinition } from "./unitDetails"
3
+
4
+ export const unitRegistry: Record<string, UnitDefinition> = {
5
+ // ===== ÉNERGIE - Pivot: Wh =====
6
+ [EnergyUnit.Wh]: {
7
+ symbol: EnergyUnit.Wh,
8
+ precision: 0,
9
+ family: UnitFamily.Energy,
10
+ factor: 1, // Pivot
11
+ },
12
+ [EnergyUnit.kWh]: {
13
+ symbol: EnergyUnit.kWh,
14
+ precision: 2,
15
+ family: UnitFamily.Energy,
16
+ factor: 1000,
17
+ },
18
+ [EnergyUnit.MWh]: {
19
+ symbol: EnergyUnit.MWh,
20
+ precision: 2,
21
+ family: UnitFamily.Energy,
22
+ factor: 1_000_000,
23
+ },
24
+ [EnergyUnit.GWh]: {
25
+ symbol: EnergyUnit.GWh,
26
+ precision: 2,
27
+ family: UnitFamily.Energy,
28
+ factor: 1_000_000_000,
29
+ },
30
+ [EnergyUnit.TWh]: {
31
+ symbol: EnergyUnit.TWh,
32
+ precision: 2,
33
+ family: UnitFamily.Energy,
34
+ factor: 1_000_000_000_000,
35
+ },
36
+
37
+ // ===== PUISSANCE - Pivot: W =====
38
+ [PowerUnit.W]: {
39
+ symbol: PowerUnit.W,
40
+ precision: 0,
41
+ family: UnitFamily.Power,
42
+ factor: 1, // Pivot
43
+ },
44
+ [PowerUnit.kW]: {
45
+ symbol: PowerUnit.kW,
46
+ precision: 2,
47
+ family: UnitFamily.Power,
48
+ factor: 1000,
49
+ },
50
+ [PowerUnit.MW]: {
51
+ symbol: PowerUnit.MW,
52
+ precision: 2,
53
+ family: UnitFamily.Power,
54
+ factor: 1_000_000,
55
+ },
56
+ [PowerUnit.GW]: {
57
+ symbol: PowerUnit.GW,
58
+ precision: 2,
59
+ family: UnitFamily.Power,
60
+ factor: 1_000_000_000,
61
+ },
62
+ [PowerUnit.TW]: {
63
+ symbol: PowerUnit.TW,
64
+ precision: 2,
65
+ family: UnitFamily.Power,
66
+ factor: 1_000_000_000_000,
67
+ },
68
+
69
+ // ===== VOLUME (EAU) - Pivot: L =====
70
+ [VolumeUnit.mL]: {
71
+ symbol: VolumeUnit.mL,
72
+ precision: 0,
73
+ family: UnitFamily.Volume,
74
+ factor: 0.001,
75
+ },
76
+ [VolumeUnit.L]: {
77
+ symbol: VolumeUnit.L,
78
+ precision: 1,
79
+ family: UnitFamily.Volume,
80
+ factor: 1, // Pivot
81
+ },
82
+ [VolumeUnit.m3]: {
83
+ symbol: VolumeUnit.m3,
84
+ precision: 2,
85
+ family: UnitFamily.Volume,
86
+ factor: 1000,
87
+ },
88
+ [VolumeUnit.dam3]: {
89
+ symbol: VolumeUnit.dam3,
90
+ precision: 2,
91
+ family: UnitFamily.Volume,
92
+ factor: 1_000_000,
93
+ },
94
+
95
+ // ===== VOLUME (GAZ) - Pivot: Nm3 =====
96
+ [GasVolumeUnit.Nm3]: {
97
+ symbol: GasVolumeUnit.Nm3,
98
+ precision: 2,
99
+ family: UnitFamily.GasVolume,
100
+ factor: 1, // Pivot
101
+ },
102
+ [GasVolumeUnit.kNm3]: {
103
+ symbol: GasVolumeUnit.kNm3,
104
+ precision: 2,
105
+ family: UnitFamily.GasVolume,
106
+ factor: 1000,
107
+ },
108
+ [GasVolumeUnit.MNm3]: {
109
+ symbol: GasVolumeUnit.MNm3,
110
+ precision: 2,
111
+ family: UnitFamily.GasVolume,
112
+ factor: 1_000_000,
113
+ },
114
+ [GasVolumeUnit.GNm3]: {
115
+ symbol: GasVolumeUnit.GNm3,
116
+ precision: 2,
117
+ family: UnitFamily.GasVolume,
118
+ factor: 1_000_000_000,
119
+ },
120
+
121
+ // ===== DÉBIT D'EAU - Pivot: mL/s =====
122
+ [WaterFlowUnit.mL_s]: {
123
+ symbol: WaterFlowUnit.mL_s,
124
+ precision: 0,
125
+ family: UnitFamily.WaterFlow,
126
+ factor: 1, // Pivot
127
+ },
128
+ [WaterFlowUnit.L_s]: {
129
+ symbol: WaterFlowUnit.L_s,
130
+ precision: 2,
131
+ family: UnitFamily.WaterFlow,
132
+ factor: 1000,
133
+ conversions: [
134
+ {
135
+ targetUnit: WaterFlowUnit.m3_h,
136
+ conversionRate: 3.6,
137
+ minThreshold: 100,
138
+ },
139
+ ],
140
+ },
141
+ [WaterFlowUnit.m3_s]: {
142
+ symbol: WaterFlowUnit.m3_s,
143
+ precision: 3,
144
+ family: UnitFamily.WaterFlow,
145
+ factor: 1_000_000,
146
+ },
147
+ [WaterFlowUnit.L_min]: {
148
+ symbol: WaterFlowUnit.L_min,
149
+ precision: 1,
150
+ family: UnitFamily.WaterFlow,
151
+ factor: 1000 / 60, // 16.666...
152
+ conversions: [
153
+ {
154
+ targetUnit: WaterFlowUnit.L_s,
155
+ conversionRate: 1 / 60,
156
+ minThreshold: 60,
157
+ },
158
+ ],
159
+ },
160
+ [WaterFlowUnit.m3_h]: {
161
+ symbol: WaterFlowUnit.m3_h,
162
+ precision: 1,
163
+ },
164
+
165
+ // ===== DÉBIT DE GAZ - Pivot: Nm3/h =====
166
+ [GasFlowUnit.Nm3_h]: {
167
+ symbol: GasFlowUnit.Nm3_h,
168
+ precision: 1,
169
+ family: UnitFamily.GasFlow,
170
+ factor: 1, // Pivot
171
+ },
172
+ [GasFlowUnit.kNm3_h]: {
173
+ symbol: GasFlowUnit.kNm3_h,
174
+ precision: 2,
175
+ family: UnitFamily.GasFlow,
176
+ factor: 1000,
177
+ },
178
+ [GasFlowUnit.MNm3_h]: {
179
+ symbol: GasFlowUnit.MNm3_h,
180
+ precision: 2,
181
+ family: UnitFamily.GasFlow,
182
+ factor: 1_000_000,
183
+ },
184
+
185
+ // ===== PRESSION - Pivot: Pa =====
186
+ [PressureUnit.Pa]: {
187
+ symbol: PressureUnit.Pa,
188
+ precision: 0,
189
+ family: UnitFamily.Pressure,
190
+ factor: 1, // Pivot
191
+ },
192
+ [PressureUnit.kPa]: {
193
+ symbol: PressureUnit.kPa,
194
+ precision: 2,
195
+ family: UnitFamily.Pressure,
196
+ factor: 1000,
197
+ },
198
+ [PressureUnit.MPa]: {
199
+ symbol: PressureUnit.MPa,
200
+ precision: 2,
201
+ family: UnitFamily.Pressure,
202
+ factor: 1_000_000,
203
+ },
204
+ [PressureUnit.GPa]: {
205
+ symbol: PressureUnit.GPa,
206
+ precision: 2,
207
+ family: UnitFamily.Pressure,
208
+ factor: 1_000_000_000,
209
+ },
210
+ [PressureUnit.bar]: {
211
+ symbol: PressureUnit.bar,
212
+ precision: 2,
213
+ family: UnitFamily.Pressure,
214
+ factor: 100_000,
215
+ },
216
+ [PressureUnit.mbar]: {
217
+ symbol: PressureUnit.mbar,
218
+ precision: 1,
219
+ family: UnitFamily.Pressure,
220
+ factor: 100,
221
+ },
222
+
223
+ // ===== TEMPÉRATURE - Pas de famille (conversions non-linéaires) =====
224
+ [TemperatureUnit.Celsius]: {
225
+ symbol: TemperatureUnit.Celsius,
226
+ precision: 1,
227
+ },
228
+ [TemperatureUnit.Kelvin]: {
229
+ symbol: TemperatureUnit.Kelvin,
230
+ precision: 1,
231
+ },
232
+ [TemperatureUnit.Fahrenheit]: {
233
+ symbol: TemperatureUnit.Fahrenheit,
234
+ precision: 1,
235
+ },
236
+
237
+ // ===== VITESSE - Conversions alternatives =====
238
+ [SpeedUnit.m_s]: {
239
+ symbol: SpeedUnit.m_s,
240
+ precision: 2,
241
+ conversions: [
242
+ {
243
+ targetUnit: SpeedUnit.km_h,
244
+ conversionRate: 3.6,
245
+ },
246
+ ],
247
+ },
248
+ [SpeedUnit.km_h]: {
249
+ symbol: SpeedUnit.km_h,
250
+ precision: 1,
251
+ },
252
+ [SpeedUnit.knot]: {
253
+ symbol: SpeedUnit.knot,
254
+ precision: 0,
255
+ conversions: [
256
+ {
257
+ targetUnit: SpeedUnit.km_h,
258
+ conversionRate: 1.852,
259
+ },
260
+ ],
261
+ },
262
+
263
+ // ===== DISTANCE - Pivot: m =====
264
+ [DistanceUnit.mm]: {
265
+ symbol: DistanceUnit.mm,
266
+ precision: 0,
267
+ family: UnitFamily.Distance,
268
+ factor: 0.001,
269
+ },
270
+ [DistanceUnit.cm]: {
271
+ symbol: DistanceUnit.cm,
272
+ precision: 1,
273
+ family: UnitFamily.Distance,
274
+ factor: 0.01,
275
+ },
276
+ [DistanceUnit.m]: {
277
+ symbol: DistanceUnit.m,
278
+ precision: 0,
279
+ family: UnitFamily.Distance,
280
+ factor: 1, // Pivot
281
+ },
282
+ [DistanceUnit.km]: {
283
+ symbol: DistanceUnit.km,
284
+ precision: 2,
285
+ family: UnitFamily.Distance,
286
+ factor: 1000,
287
+ },
288
+
289
+ // ===== MASSE - Pivot: g =====
290
+ [MassUnit.mg]: {
291
+ symbol: MassUnit.mg,
292
+ precision: 0,
293
+ family: UnitFamily.Mass,
294
+ factor: 0.001,
295
+ },
296
+ [MassUnit.g]: {
297
+ symbol: MassUnit.g,
298
+ precision: 0,
299
+ family: UnitFamily.Mass,
300
+ factor: 1, // Pivot
301
+ },
302
+ [MassUnit.kg]: {
303
+ symbol: MassUnit.kg,
304
+ precision: 2,
305
+ family: UnitFamily.Mass,
306
+ factor: 1000,
307
+ },
308
+ [MassUnit.t]: {
309
+ symbol: MassUnit.t,
310
+ precision: 2,
311
+ family: UnitFamily.Mass,
312
+ factor: 1_000_000,
313
+ },
314
+ [MassUnit.kt]: {
315
+ symbol: MassUnit.kt,
316
+ precision: 2,
317
+ family: UnitFamily.Mass,
318
+ factor: 1_000_000_000,
319
+ },
320
+
321
+ // ===== DÉBIT MASSIQUE - Pivot: g/s =====
322
+ [MassFlowUnit.g_s]: {
323
+ symbol: MassFlowUnit.g_s,
324
+ precision: 1,
325
+ family: UnitFamily.MassFlow,
326
+ factor: 1, // Pivot
327
+ },
328
+ [MassFlowUnit.kg_s]: {
329
+ symbol: MassFlowUnit.kg_s,
330
+ precision: 2,
331
+ family: UnitFamily.MassFlow,
332
+ factor: 1000,
333
+ conversions: [
334
+ {
335
+ targetUnit: MassFlowUnit.t_h,
336
+ conversionRate: 3.6,
337
+ minThreshold: 100,
338
+ },
339
+ ],
340
+ },
341
+ [MassFlowUnit.t_s]: {
342
+ symbol: MassFlowUnit.t_s,
343
+ precision: 3,
344
+ family: UnitFamily.MassFlow,
345
+ factor: 1_000_000,
346
+ },
347
+ [MassFlowUnit.kg_h]: {
348
+ symbol: MassFlowUnit.kg_h,
349
+ precision: 1,
350
+ family: UnitFamily.MassFlow,
351
+ factor: 1000 / 3600, // 0.277...
352
+ },
353
+ [MassFlowUnit.t_h]: {
354
+ symbol: MassFlowUnit.t_h,
355
+ precision: 1,
356
+ },
357
+
358
+ // ===== FRÉQUENCE - Pivot: Hz =====
359
+ [FrequencyUnit.Hz]: {
360
+ symbol: FrequencyUnit.Hz,
361
+ precision: 1,
362
+ family: UnitFamily.Frequency,
363
+ factor: 1, // Pivot
364
+ },
365
+ [FrequencyUnit.kHz]: {
366
+ symbol: FrequencyUnit.kHz,
367
+ precision: 2,
368
+ family: UnitFamily.Frequency,
369
+ factor: 1000,
370
+ },
371
+ [FrequencyUnit.MHz]: {
372
+ symbol: FrequencyUnit.MHz,
373
+ precision: 2,
374
+ family: UnitFamily.Frequency,
375
+ factor: 1_000_000,
376
+ },
377
+ [FrequencyUnit.GHz]: {
378
+ symbol: FrequencyUnit.GHz,
379
+ precision: 2,
380
+ family: UnitFamily.Frequency,
381
+ factor: 1_000_000_000,
382
+ },
383
+ [FrequencyUnit.rpm]: {
384
+ symbol: FrequencyUnit.rpm,
385
+ precision: 0,
386
+ family: UnitFamily.Frequency,
387
+ factor: 1 / 60, // rpm = Hz / 60
388
+ },
389
+
390
+ // ===== TENSION - Pivot: V =====
391
+ [VoltageUnit.mV]: {
392
+ symbol: VoltageUnit.mV,
393
+ precision: 0,
394
+ family: UnitFamily.Voltage,
395
+ factor: 0.001,
396
+ },
397
+ [VoltageUnit.V]: {
398
+ symbol: VoltageUnit.V,
399
+ precision: 1,
400
+ family: UnitFamily.Voltage,
401
+ factor: 1, // Pivot
402
+ },
403
+ [VoltageUnit.kV]: {
404
+ symbol: VoltageUnit.kV,
405
+ precision: 2,
406
+ family: UnitFamily.Voltage,
407
+ factor: 1000,
408
+ },
409
+ [VoltageUnit.MV]: {
410
+ symbol: VoltageUnit.MV,
411
+ precision: 2,
412
+ family: UnitFamily.Voltage,
413
+ factor: 1_000_000,
414
+ },
415
+
416
+ // ===== COURANT - Pivot: A =====
417
+ [CurrentUnit.mA]: {
418
+ symbol: CurrentUnit.mA,
419
+ precision: 1,
420
+ family: UnitFamily.Current,
421
+ factor: 0.001,
422
+ },
423
+ [CurrentUnit.A]: {
424
+ symbol: CurrentUnit.A,
425
+ precision: 2,
426
+ family: UnitFamily.Current,
427
+ factor: 1, // Pivot
428
+ },
429
+ [CurrentUnit.kA]: {
430
+ symbol: CurrentUnit.kA,
431
+ precision: 2,
432
+ family: UnitFamily.Current,
433
+ factor: 1000,
434
+ },
435
+
436
+ // ===== RÉSISTANCE - Pivot: Ω =====
437
+ [ResistanceUnit.mΩ]: {
438
+ symbol: ResistanceUnit.mΩ,
439
+ precision: 1,
440
+ family: UnitFamily.Resistance,
441
+ factor: 0.001,
442
+ },
443
+ [ResistanceUnit.Ω]: {
444
+ symbol: ResistanceUnit.Ω,
445
+ precision: 1,
446
+ family: UnitFamily.Resistance,
447
+ factor: 1, // Pivot
448
+ },
449
+ [ResistanceUnit.kΩ]: {
450
+ symbol: ResistanceUnit.kΩ,
451
+ precision: 2,
452
+ family: UnitFamily.Resistance,
453
+ factor: 1000,
454
+ },
455
+ [ResistanceUnit.MΩ]: {
456
+ symbol: ResistanceUnit.MΩ,
457
+ precision: 2,
458
+ family: UnitFamily.Resistance,
459
+ factor: 1_000_000,
460
+ },
461
+
462
+ // ===== POURCENTAGE - Pas de scaling =====
463
+ [PercentageUnit.Percent]: {
464
+ symbol: PercentageUnit.Percent,
465
+ precision: 1,
466
+ },
467
+ [PercentageUnit.RelativeHumidity]: {
468
+ symbol: PercentageUnit.RelativeHumidity,
469
+ precision: 0,
470
+ },
471
+
472
+ // ===== CAPACITÉ - Pas de scaling =====
473
+ [CapacityUnit.pers]: {
474
+ symbol: CapacityUnit.pers,
475
+ precision: 0,
476
+ },
477
+ [CapacityUnit.pers_h]: {
478
+ symbol: CapacityUnit.pers_h,
479
+ precision: 0,
480
+ },
481
+
482
+ // ===== PRODUCTION NEIGE - Pas de scaling =====
483
+ [SnowProductionUnit.m3_neige_h]: {
484
+ symbol: SnowProductionUnit.m3_neige_h,
485
+ precision: 0,
486
+ },
487
+
488
+ // ===== RENDEMENT - Pas de scaling =====
489
+ [EfficiencyUnit.kWh_m3]: {
490
+ symbol: EfficiencyUnit.kWh_m3,
491
+ precision: 2,
492
+ },
493
+ [EfficiencyUnit.kWh_kg]: {
494
+ symbol: EfficiencyUnit.kWh_kg,
495
+ precision: 2,
496
+ },
497
+ };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.0.190",
7
+ "version": "1.0.191-add-unit-formatter-2",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -15,5 +15,5 @@
15
15
  "peerDependencies": {
16
16
  "date-fns": "^3.6.0"
17
17
  },
18
- "gitHead": "c828caf6ee06215c92beb11d9cc8241f12d4abe0"
18
+ "gitHead": "7c34bcea5b12a9461c14adbdb2227f6dda0d46aa"
19
19
  }