@agridea/suibi-module 0.1.0-preview.8 → 0.1.0-preview.8c4fa92
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/elements/browser/main.js +76 -64
- package/dist/elements/browser/styles.css +1 -1
- package/dist/elements/browser/suibi-module-latest.css +1 -1
- package/dist/elements/browser/suibi-module-latest.js +76 -64
- package/dist/elements/browser/{suibi-module.v0.1.0-preview.8.css → suibi-module.v0.1.0-preview.8c4fa92.css} +1 -1
- package/dist/elements/browser/suibi-module.v0.1.0-preview.8c4fa92.js +79 -0
- package/dist/elements/browser/suibi-theme-dark.css +1 -1
- package/dist/elements/browser/version.txt +1 -1
- package/dist/elements/browser/wc-global-utilities.css +1 -0
- package/dist/types/app/app.d.ts +14 -6
- package/dist/types/app/components/add-dashed-button/add-dashed-button.component.d.ts +9 -0
- package/dist/types/app/components/data-preview/data-preview.component.d.ts +11 -0
- package/dist/types/app/components/empty-state/empty-state.component.d.ts +10 -0
- package/dist/types/app/components/planning-result/planning-result.component.d.ts +69 -0
- package/dist/types/app/components/welcome-page/metadata.types.d.ts +1 -0
- package/dist/types/app/components/welcome-page/welcome-page.component.d.ts +28 -0
- package/dist/types/app/components/workflow-stepper/workflow-stepper.component.d.ts +48 -0
- package/dist/types/app/core/data/naebi-data.service.d.ts +28 -7
- package/dist/types/app/core/error/global-error-handler.d.ts +6 -0
- package/dist/types/app/core/events/suibi-data-emitter.service.d.ts +13 -0
- package/dist/types/app/core/events/suibi-data-event.d.ts +26 -0
- package/dist/types/app/core/master-data/master-data.service.d.ts +13 -1
- package/dist/types/app/core/metadata/suibi-metadata.service.d.ts +6 -0
- package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +8 -0
- package/dist/types/app/core/navigation/navigation.service.d.ts +25 -4
- package/dist/types/app/core/planning/planning-balance.service.d.ts +18 -0
- package/dist/types/app/core/planning/planning-balance.types.d.ts +206 -0
- package/dist/types/app/core/schemas/schema-localization.util.d.ts +18 -0
- package/dist/types/app/core/telemetry/telemetry.service.d.ts +12 -0
- package/dist/types/app/core/utils/object.util.d.ts +24 -0
- package/dist/types/app/core/validation/capabilities.d.ts +5 -5
- package/dist/types/app/core/validation/global-validation.service.d.ts +13 -4
- package/dist/types/app/header-bar.d.ts +3 -7
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +8 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +8 -0
- package/dist/types/app/jsonforms/renderers/layout/array/array-layout.renderer.d.ts +43 -0
- package/dist/types/app/jsonforms/renderers/layout/categorization/selected-category-categorization.renderer.d.ts +34 -0
- package/dist/types/app/{animal-stock → nutrient-cycle/animal-stock}/animal-stock-detail.component.d.ts +1 -1
- package/dist/types/app/{animal-stock → nutrient-cycle/animal-stock}/animal-stock-master-detail.component.d.ts +4 -1
- package/dist/types/app/{animal-stock → nutrient-cycle/animal-stock}/animal-stock.types.d.ts +6 -6
- package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail.component.d.ts +25 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading.types.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/transaction-unit.util.d.ts +1 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.types.d.ts +43 -0
- package/dist/types/app/nutrient-cycle/field-spreading/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance.types.d.ts +5 -0
- package/dist/types/environments/environment.d.ts +11 -0
- package/dist/types/public-api.d.ts +2 -0
- package/package.json +2 -1
- package/dist/elements/browser/suibi-module.v0.1.0-preview.8.js +0 -67
- package/dist/types/app/data-preview.d.ts +0 -7
- package/dist/types/app/welcome-page.d.ts +0 -4
- /package/dist/types/app/{animal-stock → nutrient-cycle/animal-stock}/animal-stock-list.component.d.ts +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript interfaces for the planning-balance API response.
|
|
3
|
+
* These match the eBilanz / BLW response shape observed in the example data.
|
|
4
|
+
*/
|
|
5
|
+
/** A single nutrient quantity entry (kg or % unit). */
|
|
6
|
+
export interface NutrientEntry {
|
|
7
|
+
molecularFormula: string;
|
|
8
|
+
quantity: number;
|
|
9
|
+
quantityCorrected?: number;
|
|
10
|
+
unit: string;
|
|
11
|
+
productFamilyType?: string;
|
|
12
|
+
typeOfManureRecyclingProduct?: string;
|
|
13
|
+
fertiliserProductCategory?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CalculationVersion {
|
|
16
|
+
version: string;
|
|
17
|
+
validFrom: string;
|
|
18
|
+
validTo: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AreaAndYieldPerAgronomicCropCategory {
|
|
21
|
+
agronomicCropCategory: string;
|
|
22
|
+
areaSize: number;
|
|
23
|
+
effectiveYield: number;
|
|
24
|
+
isMainCrop: boolean;
|
|
25
|
+
isNutrientPoorFodder: boolean;
|
|
26
|
+
yieldPerSquareMeasure?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface AreaPerCultivationType {
|
|
29
|
+
areaSize: number;
|
|
30
|
+
isMainCrop: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface AreaAndYieldPerCultivationCategory {
|
|
33
|
+
cultivationCategory: string;
|
|
34
|
+
areaAndYieldPerAgronomicCropCategory: AreaAndYieldPerAgronomicCropCategory[];
|
|
35
|
+
areaPerCultivationType: AreaPerCultivationType[];
|
|
36
|
+
}
|
|
37
|
+
export interface AreaPerSubCategory {
|
|
38
|
+
cultivationSubCategory: string;
|
|
39
|
+
areaSize: number;
|
|
40
|
+
isMainCrop: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface FieldCultivation {
|
|
43
|
+
areaAndYieldPerCultivationCategory: AreaAndYieldPerCultivationCategory[];
|
|
44
|
+
areaPerSubCategory: AreaPerSubCategory[];
|
|
45
|
+
fertilizableAreaSize: number;
|
|
46
|
+
slurrySpreadingAreaSize: number;
|
|
47
|
+
totalAgriculturalLandAreaSize: number;
|
|
48
|
+
}
|
|
49
|
+
export interface FodderQuantity {
|
|
50
|
+
quantity: number;
|
|
51
|
+
unit: string;
|
|
52
|
+
proportionNutrientPoorFodder?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface FodderProduct {
|
|
55
|
+
typeOfFeedstuffProduct: string;
|
|
56
|
+
quantity: number;
|
|
57
|
+
unit: string;
|
|
58
|
+
isNutrientPoorFodder: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ConsumptionAnimalStock {
|
|
61
|
+
animalCategoryPRIF: number;
|
|
62
|
+
averageQuantity: number;
|
|
63
|
+
order: string;
|
|
64
|
+
quantity: number;
|
|
65
|
+
unit: string;
|
|
66
|
+
}
|
|
67
|
+
export interface RequiredEffectiveYieldFromFodderCropland {
|
|
68
|
+
consumptionAnimalStock: ConsumptionAnimalStock[];
|
|
69
|
+
cropFromNonFodderCroplandPerProduct: FodderProduct[];
|
|
70
|
+
dispensePerProduct: FodderProduct[];
|
|
71
|
+
supplyPerProduct: FodderProduct[];
|
|
72
|
+
totalBalance: FodderQuantity;
|
|
73
|
+
totalConsumptionAnimalStock: FodderQuantity;
|
|
74
|
+
totalCropFromNonFodderCropland: FodderQuantity;
|
|
75
|
+
totalDispense: FodderQuantity;
|
|
76
|
+
totalSupply: FodderQuantity;
|
|
77
|
+
}
|
|
78
|
+
export interface FodderBalance {
|
|
79
|
+
requiredEffectiveYieldFromFodderCropland: RequiredEffectiveYieldFromFodderCropland;
|
|
80
|
+
totalBalance: FodderQuantity;
|
|
81
|
+
totalEffectiveYieldFromFodderCropland: FodderQuantity;
|
|
82
|
+
totalNutrientPoorFodder: FodderQuantity;
|
|
83
|
+
}
|
|
84
|
+
export interface EmissionAndAccumulationEntry {
|
|
85
|
+
animalCategoryPRIF: number;
|
|
86
|
+
order: string;
|
|
87
|
+
accumulation: NutrientEntry[];
|
|
88
|
+
emission: NutrientEntry[];
|
|
89
|
+
manureExcretion?: unknown[];
|
|
90
|
+
}
|
|
91
|
+
export interface AccumulationEntireExcretion {
|
|
92
|
+
animalCategoryPRIF: number;
|
|
93
|
+
order: string;
|
|
94
|
+
durationSumTotalCorrectedNutrientBalance: number;
|
|
95
|
+
accumulation: NutrientEntry[];
|
|
96
|
+
}
|
|
97
|
+
export interface TotalNutrientSet {
|
|
98
|
+
accumulation: NutrientEntry[];
|
|
99
|
+
emission?: NutrientEntry[];
|
|
100
|
+
}
|
|
101
|
+
export interface AnimalStock {
|
|
102
|
+
accumulationEntireExcretion: AccumulationEntireExcretion[];
|
|
103
|
+
emissionAndAccumulationPasture: EmissionAndAccumulationEntry[];
|
|
104
|
+
emissionAndAccumulationStall: EmissionAndAccumulationEntry[];
|
|
105
|
+
emissionAndAccumulationYard: EmissionAndAccumulationEntry[];
|
|
106
|
+
totalAccumulationEntireExcretion: TotalNutrientSet;
|
|
107
|
+
totalEmissionAndAccumulationAnimalStock: TotalNutrientSet;
|
|
108
|
+
totalEmissionAndAccumulationPasture: TotalNutrientSet;
|
|
109
|
+
totalEmissionAndAccumulationStall: TotalNutrientSet;
|
|
110
|
+
totalEmissionAndAccumulationYard: TotalNutrientSet;
|
|
111
|
+
}
|
|
112
|
+
export interface ManureTradingProduct {
|
|
113
|
+
typeOfManureRecyclingProduct: string;
|
|
114
|
+
quantity: number;
|
|
115
|
+
unit: string;
|
|
116
|
+
ingredient: NutrientEntry[];
|
|
117
|
+
}
|
|
118
|
+
export interface FarmManureTrading {
|
|
119
|
+
balancePerProduct: ManureTradingProduct[];
|
|
120
|
+
dispensePerProduct: ManureTradingProduct[];
|
|
121
|
+
supplyPerProduct: ManureTradingProduct[];
|
|
122
|
+
totalBalance: {
|
|
123
|
+
ingredient: NutrientEntry[];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface NutrientRequirementEntry {
|
|
127
|
+
agronomicCropCategory?: string;
|
|
128
|
+
cultivationCategory?: string;
|
|
129
|
+
isMainCrop?: boolean;
|
|
130
|
+
requirement: NutrientEntry[];
|
|
131
|
+
}
|
|
132
|
+
export interface FieldCultivationNutrients {
|
|
133
|
+
nutrientTransferUnfertilizedCultivation: NutrientEntry[];
|
|
134
|
+
requirementPerAgronomicCropCategory: NutrientRequirementEntry[];
|
|
135
|
+
requirementPerCultivationCategory: NutrientRequirementEntry[];
|
|
136
|
+
totalRequirement: NutrientEntry[];
|
|
137
|
+
}
|
|
138
|
+
export interface FieldSpreading {
|
|
139
|
+
emissionAndAccumulationFieldSpreading: TotalNutrientSet;
|
|
140
|
+
totalEmissionAndAccumulationFieldSpreading: TotalNutrientSet;
|
|
141
|
+
}
|
|
142
|
+
export interface StorageBalance {
|
|
143
|
+
emissionAndAccumulationManureStorage: TotalNutrientSet;
|
|
144
|
+
totalEmissionAndAccumulationManureStorage: TotalNutrientSet;
|
|
145
|
+
}
|
|
146
|
+
export interface NutrientBalance {
|
|
147
|
+
animalStock: AnimalStock;
|
|
148
|
+
farmManureTrading: FarmManureTrading;
|
|
149
|
+
fieldCultivation: FieldCultivationNutrients;
|
|
150
|
+
fieldSpreading: FieldSpreading;
|
|
151
|
+
storage: StorageBalance;
|
|
152
|
+
/** Final per-nutrient balance figures: kg lines + % lines interleaved. */
|
|
153
|
+
totalBalance: NutrientEntry[];
|
|
154
|
+
/** Farm-wide gas emissions (NH3, NO, N2O, N2). */
|
|
155
|
+
totalEmissionFarm: NutrientEntry[];
|
|
156
|
+
nutrientBalanceTMP?: unknown[];
|
|
157
|
+
}
|
|
158
|
+
export interface NutrientCycle {
|
|
159
|
+
creationDateTime: string;
|
|
160
|
+
facilitySpecificProducts: {
|
|
161
|
+
manureRecyclingProduct: unknown[];
|
|
162
|
+
};
|
|
163
|
+
fieldCultivation: FieldCultivation;
|
|
164
|
+
fodderBalance: FodderBalance;
|
|
165
|
+
nutrientBalance: NutrientBalance;
|
|
166
|
+
version: string;
|
|
167
|
+
/** Base64-encoded PDF report, if returned by the endpoint. */
|
|
168
|
+
report?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface ValidationMessageDetail {
|
|
171
|
+
designation_deu: string;
|
|
172
|
+
designation_eng: string;
|
|
173
|
+
designation_fra: string;
|
|
174
|
+
designation_ita: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ValidationMessage {
|
|
177
|
+
field: string;
|
|
178
|
+
type: string;
|
|
179
|
+
detail: ValidationMessageDetail;
|
|
180
|
+
}
|
|
181
|
+
/** Full response from the planning-balance endpoint. */
|
|
182
|
+
export interface PlanningBalanceResponse {
|
|
183
|
+
calculationVersion: CalculationVersion;
|
|
184
|
+
nutrientCycle: NutrientCycle;
|
|
185
|
+
validationMessage: ValidationMessage[];
|
|
186
|
+
}
|
|
187
|
+
/** Merged kg + % row for the final balance table (Section D). */
|
|
188
|
+
export interface BalanceRow {
|
|
189
|
+
molecularFormula: string;
|
|
190
|
+
quantity: number;
|
|
191
|
+
quantityCorrected: number;
|
|
192
|
+
quantityPct: number | null;
|
|
193
|
+
quantityCorrectedPct: number | null;
|
|
194
|
+
unit: 'kg';
|
|
195
|
+
}
|
|
196
|
+
/** Crop requirement row enriched with area and yield for display (Section C). */
|
|
197
|
+
export interface CropRequirementRow {
|
|
198
|
+
cropCode: string;
|
|
199
|
+
cultivationCategory: string;
|
|
200
|
+
isMainCrop: boolean;
|
|
201
|
+
areaHa: number;
|
|
202
|
+
effectiveYield: number;
|
|
203
|
+
/** kg/ha yield per square measure field (m² basis), converted to dt/ha for display. */
|
|
204
|
+
yieldDtHa: number | null;
|
|
205
|
+
requirement: NutrientEntry[];
|
|
206
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
/**
|
|
3
|
+
* Deeply clones a UI schema and translates its labels.
|
|
4
|
+
*
|
|
5
|
+
* This utility is essential for JSONForms integration in a multi-language environment.
|
|
6
|
+
* Since UI schemas are typically static JSON objects, we must clone them before
|
|
7
|
+
* modifying their labels to avoid mutating the shared source or leaking translations
|
|
8
|
+
* across language switches.
|
|
9
|
+
*
|
|
10
|
+
* It traverses:
|
|
11
|
+
* - Nested `elements` arrays (standard layouts)
|
|
12
|
+
* - `options.detail` objects (often used in array controls)
|
|
13
|
+
*
|
|
14
|
+
* @param ui The original UI schema to localize
|
|
15
|
+
* @param translate A function that takes a translation key and returns the translated string
|
|
16
|
+
* @returns A new UI schema object with translated labels
|
|
17
|
+
*/
|
|
18
|
+
export declare function cloneAndLocalize(ui: any, translate: (key: string) => string): UISchemaElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class TelemetryService {
|
|
2
|
+
private appInsights;
|
|
3
|
+
private isEnabled;
|
|
4
|
+
constructor();
|
|
5
|
+
private init;
|
|
6
|
+
setTelemetryEnabled(enabled: boolean): void;
|
|
7
|
+
trackPageView(name?: string, uri?: string): void;
|
|
8
|
+
trackEvent(name: string, properties?: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}): void;
|
|
11
|
+
trackException(exception: Error): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively compares two values for deep equality.
|
|
3
|
+
*
|
|
4
|
+
* Useful for checking if complex objects or arrays have changed content,
|
|
5
|
+
* often used in change detection strategies or form dirty checking.
|
|
6
|
+
*
|
|
7
|
+
* @param a The first value to compare
|
|
8
|
+
* @param b The second value to compare
|
|
9
|
+
* @returns True if the values are deeply equal, false otherwise
|
|
10
|
+
*/
|
|
11
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a deep copy of a value.
|
|
14
|
+
*
|
|
15
|
+
* Essential for immutable state updates where you need to modify a nested property
|
|
16
|
+
* without mutating the original object.
|
|
17
|
+
*
|
|
18
|
+
* Uses `structuredClone` if available, falling back to JSON serialization.
|
|
19
|
+
* Note: The JSON fallback has limitations (e.g. loses Date objects, functions, undefined).
|
|
20
|
+
*
|
|
21
|
+
* @param value The value to clone
|
|
22
|
+
* @returns A deep copy of the value
|
|
23
|
+
*/
|
|
24
|
+
export declare function deepClone<T>(value: T): T;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* All master data is embedded statically at compile time - no runtime HTTP calls.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Derives permitted stable systems (
|
|
8
|
+
* Derives permitted stable systems (stableSystem enum strings) for a given animal category.
|
|
9
9
|
*
|
|
10
10
|
* @param animalCategoryPRIF - The PRIF animal category ID
|
|
11
|
-
* @returns Array of permitted
|
|
11
|
+
* @returns Array of permitted stableSystem enum strings (e.g. 'HUS_TETHER')
|
|
12
12
|
*/
|
|
13
|
-
export declare function derivePermittedStableSystems(animalCategoryPRIF: number | null | undefined):
|
|
13
|
+
export declare function derivePermittedStableSystems(animalCategoryPRIF: number | null | undefined): string[];
|
|
14
14
|
/**
|
|
15
15
|
* Pre-computed map for performance (memoized at module load).
|
|
16
|
-
* Maps animalCategoryPRIF -> array of permitted stableSystem
|
|
16
|
+
* Maps animalCategoryPRIF -> array of permitted stableSystem enum strings.
|
|
17
17
|
*/
|
|
18
|
-
export declare const PERMITTED_STABLE_SYSTEMS: Record<number,
|
|
18
|
+
export declare const PERMITTED_STABLE_SYSTEMS: Record<number, string[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorObject } from 'ajv';
|
|
2
|
-
import { AnimalStockCategory, PageId } from '../navigation/navigation.service';
|
|
2
|
+
import { AnimalStockCategory, FarmManureTradingCategory, FarmManureTradingMode, FieldSpreadingCategory, PageId } from '../navigation/navigation.service';
|
|
3
3
|
export interface EnrichedValidationError extends ErrorObject {
|
|
4
4
|
/** Human-friendly field label (e.g., "Animal Category") */
|
|
5
5
|
fieldLabel?: string;
|
|
@@ -9,6 +9,16 @@ export interface EnrichedValidationError extends ErrorObject {
|
|
|
9
9
|
targetAnimalStockIndex?: number;
|
|
10
10
|
/** Navigation target: detail category (tab) */
|
|
11
11
|
targetCategory?: AnimalStockCategory;
|
|
12
|
+
/** Navigation target: static section (e.g., lifetime performance panel) */
|
|
13
|
+
targetSection?: 'lifetimePerformance';
|
|
14
|
+
/** Navigation target: farm manure trading tab */
|
|
15
|
+
targetFarmManureTradingMode?: FarmManureTradingMode;
|
|
16
|
+
/** Navigation target: farm manure trading entry index */
|
|
17
|
+
targetFarmManureTradingIndex?: number;
|
|
18
|
+
/** Category tab inside farm manure trading detail */
|
|
19
|
+
targetFarmManureTradingCategory?: FarmManureTradingCategory;
|
|
20
|
+
/** Category tab inside field spreading */
|
|
21
|
+
targetFieldSpreadingCategory?: FieldSpreadingCategory;
|
|
12
22
|
}
|
|
13
23
|
/**
|
|
14
24
|
* GlobalValidationService
|
|
@@ -21,12 +31,11 @@ export declare class GlobalValidationService {
|
|
|
21
31
|
private readonly dataSvc;
|
|
22
32
|
private readonly ajv;
|
|
23
33
|
private readonly validateFn;
|
|
24
|
-
private readonly rawErrors;
|
|
25
34
|
readonly errors: import("@angular/core").Signal<EnrichedValidationError[]>;
|
|
26
|
-
constructor();
|
|
27
|
-
validate(): void;
|
|
28
35
|
private consolidateErrors;
|
|
29
36
|
private enrichErrors;
|
|
30
37
|
private inferCategory;
|
|
38
|
+
private inferFarmTradingCategory;
|
|
39
|
+
private inferFieldSpreadingCategory;
|
|
31
40
|
private inferFieldLabel;
|
|
32
41
|
}
|
|
@@ -2,18 +2,14 @@ import { Locale } from './core/i18n/i18n.service';
|
|
|
2
2
|
import { PageId } from './core/navigation/navigation.service';
|
|
3
3
|
/**
|
|
4
4
|
* HeaderBarComponent
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Top app bar: application branding, utility actions (data preview, save indicator).
|
|
6
|
+
* Main workflow navigation is delegated to WorkflowStepperComponent below the toolbar.
|
|
7
7
|
*/
|
|
8
8
|
export declare class HeaderBarComponent {
|
|
9
9
|
locale: import("@angular/core").InputSignal<Locale>;
|
|
10
10
|
currentPage: import("@angular/core").InputSignal<PageId>;
|
|
11
|
+
isDirty: import("@angular/core").InputSignal<boolean>;
|
|
11
12
|
onNavigate: import("@angular/core").InputSignal<(page: PageId) => void>;
|
|
12
13
|
onLocaleChange: import("@angular/core").InputSignal<(locale: Locale) => void>;
|
|
13
|
-
readonly locales: Locale[];
|
|
14
|
-
menuOpen: import("@angular/core").WritableSignal<boolean>;
|
|
15
|
-
toggleMenu(event?: Event): void;
|
|
16
|
-
closeMenu(): void;
|
|
17
|
-
choose(locale: Locale): void;
|
|
18
14
|
navigate(page: PageId): void;
|
|
19
15
|
}
|
|
@@ -5,9 +5,14 @@ import { PlainGroupRenderer } from '../renderers/layout/group/plain-group.render
|
|
|
5
5
|
import { LogicalGroupRenderer } from '../renderers/layout/group/logical-group.renderer';
|
|
6
6
|
import { RankedTester } from '@jsonforms/core';
|
|
7
7
|
import { ConstraintLayoutRenderer } from '../renderers/layout/constraint/constraint-layout.renderer';
|
|
8
|
+
import { SelectedCategoryCategorizationRenderer } from '../renderers/layout/categorization/selected-category-categorization.renderer';
|
|
9
|
+
import { CustomArrayLayoutRenderer } from '../renderers/layout/array/array-layout.renderer';
|
|
8
10
|
export declare const CUSTOM_JSONFORMS_RENDERERS: ({
|
|
9
11
|
tester: RankedTester;
|
|
10
12
|
renderer: typeof ConstraintLayoutRenderer;
|
|
13
|
+
} | {
|
|
14
|
+
tester: RankedTester;
|
|
15
|
+
renderer: typeof SelectedCategoryCategorizationRenderer;
|
|
11
16
|
} | {
|
|
12
17
|
tester: RankedTester;
|
|
13
18
|
renderer: typeof CardGroupRenderer;
|
|
@@ -23,4 +28,7 @@ export declare const CUSTOM_JSONFORMS_RENDERERS: ({
|
|
|
23
28
|
} | {
|
|
24
29
|
tester: RankedTester;
|
|
25
30
|
renderer: typeof CodeListSelectRenderer;
|
|
31
|
+
} | {
|
|
32
|
+
tester: RankedTester;
|
|
33
|
+
renderer: typeof CustomArrayLayoutRenderer;
|
|
26
34
|
})[];
|
package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts
CHANGED
|
@@ -7,10 +7,18 @@ export declare class CodeListSelectRenderer extends BaseSelectControl<number | s
|
|
|
7
7
|
private readonly masterData;
|
|
8
8
|
private readonly i18n;
|
|
9
9
|
private readonly formData;
|
|
10
|
+
private readonly controlScope;
|
|
11
|
+
private explicitCodeListKey;
|
|
10
12
|
private controlKey;
|
|
11
13
|
private listKey;
|
|
12
14
|
readonly options: Signal<BaseCodeListEntry[]>;
|
|
13
15
|
private readonly filterConfig;
|
|
16
|
+
private readonly dependsOnDataPath;
|
|
17
|
+
private readonly autoDependsOnScope;
|
|
18
|
+
private scopePointerToDataPath;
|
|
19
|
+
private replacePointerLeaf;
|
|
20
|
+
private inferListKeyFromScope;
|
|
21
|
+
private readValueAtPath;
|
|
14
22
|
readonly filteredOptions: Signal<BaseCodeListEntry[]>;
|
|
15
23
|
constructor(jsonFormsService: JsonFormsAngularService);
|
|
16
24
|
getEventValue: (event: any) => any;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { JsonFormsAbstractControl, JsonFormsAngularService } from '@jsonforms/angular';
|
|
3
|
+
import { ArrayLayoutProps, ArrayTranslations, JsonFormsState, OwnPropsOfRenderer, RankedTester, StatePropsOfArrayLayout, UISchemaElement, UISchemaTester } from '@jsonforms/core';
|
|
4
|
+
/**
|
|
5
|
+
* CustomArrayLayoutRenderer
|
|
6
|
+
* Overrides the stock JSONForms `ArrayLayoutRenderer` (rank 4 → this is rank 5) to apply
|
|
7
|
+
* the project UX pattern: centered empty-state placeholder when the array has no entries,
|
|
8
|
+
* and the full-width dashed add-button always anchored below the list.
|
|
9
|
+
*
|
|
10
|
+
* The add button label is driven by `translations.addTooltip` resolved via the JSONForms
|
|
11
|
+
* i18n pipeline — configure per-array labels there.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CustomArrayLayoutRenderer extends JsonFormsAbstractControl<StatePropsOfArrayLayout> implements OnInit {
|
|
14
|
+
noData: boolean;
|
|
15
|
+
/** Indices 0..n-1 used to render per-item cards and drive sort-button disabled state. */
|
|
16
|
+
indices: number[];
|
|
17
|
+
translations: ArrayTranslations;
|
|
18
|
+
showSortButtons: boolean;
|
|
19
|
+
addItem: (path: string, value: unknown) => () => void;
|
|
20
|
+
moveItemUp: (path: string, index: number) => () => void;
|
|
21
|
+
moveItemDown: (path: string, index: number) => () => void;
|
|
22
|
+
removeItems: (path: string, toDelete: number[]) => () => void;
|
|
23
|
+
uischemas: {
|
|
24
|
+
tester: UISchemaTester;
|
|
25
|
+
uischema: UISchemaElement;
|
|
26
|
+
}[];
|
|
27
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
28
|
+
get emptyText(): string;
|
|
29
|
+
get addLabel(): string;
|
|
30
|
+
mapToProps(state: JsonFormsState): StatePropsOfArrayLayout & {
|
|
31
|
+
translations: ArrayTranslations;
|
|
32
|
+
};
|
|
33
|
+
mapAdditionalProps(props: ArrayLayoutProps & {
|
|
34
|
+
translations: ArrayTranslations;
|
|
35
|
+
}): void;
|
|
36
|
+
remove(index: number): void;
|
|
37
|
+
add(): void;
|
|
38
|
+
up(index: number): void;
|
|
39
|
+
down(index: number): void;
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
getProps(index: number): OwnPropsOfRenderer;
|
|
42
|
+
}
|
|
43
|
+
export declare const customArrayLayoutRendererTester: RankedTester;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { JsonFormsBaseRenderer } from '@jsonforms/angular';
|
|
3
|
+
import { Categorization, Category } from '@jsonforms/core';
|
|
4
|
+
/**
|
|
5
|
+
* Custom categorization renderer with programmatic tab selection via NavigationService.
|
|
6
|
+
*
|
|
7
|
+
* Extends JSONForms default categorization by reading category keys from UI schema options
|
|
8
|
+
* and syncing with NavigationService.selectedCategory signal for deep-linking (e.g., validation errors).
|
|
9
|
+
*
|
|
10
|
+
* UI Schema: Add "options": { "categoryKey": "<key>" } to each Category element.
|
|
11
|
+
* Navigation: Call navigationSvc.setCategory(page, key) or navigate methods to select tabs programmatically.
|
|
12
|
+
* Bidirectional: User tab clicks update NavigationService state automatically.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SelectedCategoryCategorizationRenderer extends JsonFormsBaseRenderer<Categorization> implements OnInit {
|
|
15
|
+
private readonly jsonFormsService;
|
|
16
|
+
private readonly navigationSvc;
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
visibleCategories: (Category | Categorization)[];
|
|
19
|
+
categoryLabels: string[];
|
|
20
|
+
private readonly categoryKeyToIndex;
|
|
21
|
+
private readonly indexToCategoryKey;
|
|
22
|
+
private _prevCategorySignature;
|
|
23
|
+
readonly selectedTabIndex: import("@angular/core").Signal<number>;
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Build bidirectional category key ↔ tab index mapping from UI schema.
|
|
27
|
+
* Reads options.categoryKey from each visible Category element.
|
|
28
|
+
* Example: { base: 0, formOfDetention: 1, feeding: 2 }
|
|
29
|
+
* Skips signal writes when the tab structure hasn't changed (pure data changes
|
|
30
|
+
* fire $state on every keystroke; no need to mark selectedTabIndex stale each time).
|
|
31
|
+
*/
|
|
32
|
+
private buildCategoryMappings;
|
|
33
|
+
onTabChange(newIndex: number): void;
|
|
34
|
+
}
|
|
@@ -11,7 +11,7 @@ export declare class AnimalStockDetailComponent {
|
|
|
11
11
|
itemSchema: Signal<JsonSchema>;
|
|
12
12
|
private readonly baseUi;
|
|
13
13
|
localizedUi: Signal<UISchemaElement>;
|
|
14
|
-
jsonFormsData: Signal<(AnimalStockRow & import("
|
|
14
|
+
jsonFormsData: Signal<(AnimalStockRow & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
15
15
|
readonly renderers: {
|
|
16
16
|
tester: import("@jsonforms/core").RankedTester;
|
|
17
17
|
renderer: any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AnimalStockRow } from './animal-stock.types';
|
|
2
|
+
import { LifetimePerformance } from '../lifetime-performance/lifetime-performance.types';
|
|
2
3
|
export declare class AnimalStockMasterDetailComponent {
|
|
3
4
|
private readonly dataSvc;
|
|
4
5
|
private readonly navigationSvc;
|
|
5
|
-
private readonly rootData;
|
|
6
6
|
constructor();
|
|
7
7
|
readonly rows: import("@angular/core").Signal<AnimalStockRow[]>;
|
|
8
|
+
readonly lifetimePerformance: import("@angular/core").Signal<LifetimePerformance | null>;
|
|
8
9
|
readonly selectedIndex: import("@angular/core").WritableSignal<number | null>;
|
|
9
10
|
readonly detailData: import("@angular/core").Signal<any>;
|
|
10
11
|
openDetail(index: number): void;
|
|
@@ -17,5 +18,7 @@ export declare class AnimalStockMasterDetailComponent {
|
|
|
17
18
|
currentIndex: number;
|
|
18
19
|
}): void;
|
|
19
20
|
onDetailChange(newData: any): void;
|
|
21
|
+
onLifetimePerformanceChange(payload: LifetimePerformance): void;
|
|
20
22
|
private patchRows;
|
|
23
|
+
private patchLifetimePerformance;
|
|
21
24
|
}
|
|
@@ -18,18 +18,18 @@ export interface Feeding {
|
|
|
18
18
|
export interface Stall {
|
|
19
19
|
stableSystem?: number;
|
|
20
20
|
stableCapacity?: number;
|
|
21
|
-
stableVentilationType?: number;
|
|
22
|
-
stableAirPurification?: number;
|
|
21
|
+
stableVentilationType?: number | null;
|
|
22
|
+
stableAirPurification?: number | null;
|
|
23
23
|
hasStableDeepLitter?: boolean;
|
|
24
24
|
hasStableManureBeltDrying?: boolean;
|
|
25
|
-
stableManureRemovalFrequency?: number;
|
|
26
|
-
stableWaterSupply?: number;
|
|
25
|
+
stableManureRemovalFrequency?: number | null;
|
|
26
|
+
stableWaterSupply?: number | null;
|
|
27
27
|
hasStableManureAndSlurryProduction?: boolean;
|
|
28
28
|
hasStableFeedingStationElevated?: boolean;
|
|
29
29
|
hasStableFloorSlopedUrineDrainage?: boolean;
|
|
30
30
|
hasYard?: boolean;
|
|
31
|
-
yardFeeding?: number;
|
|
32
|
-
yardFloorType?: number;
|
|
31
|
+
yardFeeding?: number | null;
|
|
32
|
+
yardFloorType?: number | null;
|
|
33
33
|
yardDays?: number;
|
|
34
34
|
yardHoursPerDay?: number;
|
|
35
35
|
}
|
package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EventEmitter, Signal } from '@angular/core';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
3
|
+
import { FarmManureTradingSupply, FarmManureTradingDispense } from './farm-manure-trading.types';
|
|
4
|
+
type Mode = 'supply' | 'dispense';
|
|
5
|
+
type TradingRow = FarmManureTradingSupply | FarmManureTradingDispense;
|
|
6
|
+
export declare class FarmManureTradingDetailComponent {
|
|
7
|
+
private readonly i18n;
|
|
8
|
+
row: Signal<TradingRow | null>;
|
|
9
|
+
index: Signal<number | null>;
|
|
10
|
+
mode: import("@angular/core").InputSignal<Mode>;
|
|
11
|
+
rowChange: EventEmitter<TradingRow>;
|
|
12
|
+
close: EventEmitter<void>;
|
|
13
|
+
readonly renderers: {
|
|
14
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
15
|
+
renderer: any;
|
|
16
|
+
}[];
|
|
17
|
+
readonly suibiAjv: import("ajv").Ajv;
|
|
18
|
+
private readonly baseSchemas;
|
|
19
|
+
private readonly baseUis;
|
|
20
|
+
itemSchema: Signal<JsonSchema>;
|
|
21
|
+
localizedUi: Signal<UISchemaElement>;
|
|
22
|
+
detailTitle: Signal<string>;
|
|
23
|
+
jsonFormsData: Signal<(FarmManureTradingSupply & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
24
|
+
onDataChange(event: any): void;
|
|
25
|
+
private applyDerivedFields;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventEmitter, Signal } from '@angular/core';
|
|
2
|
+
import { FarmManureTradingSupply, FarmManureTradingDispense } from './farm-manure-trading.types';
|
|
3
|
+
import { FarmManureTradingMode } from '../../core/navigation/navigation.service';
|
|
4
|
+
export type TradingMode = FarmManureTradingMode;
|
|
5
|
+
type TradingRow = FarmManureTradingSupply | FarmManureTradingDispense;
|
|
6
|
+
export declare class FarmManureTradingListComponent {
|
|
7
|
+
private readonly masterData;
|
|
8
|
+
private readonly i18n;
|
|
9
|
+
rows: Signal<TradingRow[]>;
|
|
10
|
+
selectedIndex: Signal<number | null>;
|
|
11
|
+
mode: TradingMode;
|
|
12
|
+
select: EventEmitter<number>;
|
|
13
|
+
add: EventEmitter<void>;
|
|
14
|
+
delete: EventEmitter<number>;
|
|
15
|
+
readonly displayedColumns: string[];
|
|
16
|
+
resolveProduct(code: string | null | undefined): string;
|
|
17
|
+
emptyLabel(): string;
|
|
18
|
+
emptyHintLabel(): string;
|
|
19
|
+
addLabel(): string;
|
|
20
|
+
headerLabel(): string;
|
|
21
|
+
onDelete(index: number, event: Event): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TradingMode } from './farm-manure-trading-list.component';
|
|
2
|
+
import { FarmManureTradingSupply, FarmManureTradingDispense } from './farm-manure-trading.types';
|
|
3
|
+
export declare class FarmManureTradingMasterDetailComponent {
|
|
4
|
+
private readonly dataSvc;
|
|
5
|
+
private readonly navigationSvc;
|
|
6
|
+
constructor();
|
|
7
|
+
readonly supplyRows: import("@angular/core").Signal<FarmManureTradingSupply[]>;
|
|
8
|
+
readonly dispenseRows: import("@angular/core").Signal<FarmManureTradingDispense[]>;
|
|
9
|
+
readonly activeTab: import("@angular/core").WritableSignal<import("../../core/navigation/navigation.service").FarmManureTradingMode>;
|
|
10
|
+
readonly selectedSupplyIndex: import("@angular/core").WritableSignal<number | null>;
|
|
11
|
+
readonly selectedDispenseIndex: import("@angular/core").WritableSignal<number | null>;
|
|
12
|
+
readonly currentDetail: import("@angular/core").Signal<FarmManureTradingSupply | null>;
|
|
13
|
+
readonly currentIndex: import("@angular/core").Signal<number | null>;
|
|
14
|
+
readonly detailOpen: import("@angular/core").Signal<boolean>;
|
|
15
|
+
readonly activeTabIndex: import("@angular/core").Signal<0 | 1>;
|
|
16
|
+
onTabChange(index: number): void;
|
|
17
|
+
openDetail(mode: TradingMode, index: number): void;
|
|
18
|
+
closeDetail(): void;
|
|
19
|
+
addEntry(mode: TradingMode): void;
|
|
20
|
+
deleteEntry(mode: TradingMode, index: number): void;
|
|
21
|
+
onDetailChange(payload: FarmManureTradingSupply | FarmManureTradingDispense): void;
|
|
22
|
+
private createEmptyEntry;
|
|
23
|
+
private patchRows;
|
|
24
|
+
private cloneTrading;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ManureIngredient {
|
|
2
|
+
quantity?: number;
|
|
3
|
+
molecularFormula?: string;
|
|
4
|
+
unit?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ManureDerivation {
|
|
7
|
+
zoologicalAnimal?: string;
|
|
8
|
+
percentageAllocation?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface FarmManureTradingSupply {
|
|
11
|
+
quantity?: number;
|
|
12
|
+
typeOfManureRecyclingProduct?: string;
|
|
13
|
+
transactionUnit?: string;
|
|
14
|
+
manureDerivation?: ManureDerivation[];
|
|
15
|
+
ingredient?: ManureIngredient[];
|
|
16
|
+
}
|
|
17
|
+
export interface FarmManureTradingDispense {
|
|
18
|
+
quantity?: number;
|
|
19
|
+
typeOfManureRecyclingProduct?: string;
|
|
20
|
+
transactionUnit?: string;
|
|
21
|
+
manureDerivation?: ManureDerivation[];
|
|
22
|
+
ingredient?: ManureIngredient[];
|
|
23
|
+
}
|
|
24
|
+
export interface FarmManureTradingData {
|
|
25
|
+
supply?: FarmManureTradingSupply[];
|
|
26
|
+
dispense?: FarmManureTradingDispense[];
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deriveTransactionUnit(productCode: string | null | undefined): string | undefined;
|