@agridea/suibi-module 0.1.0-preview.7 → 0.1.0-preview.87cac2d
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 +10 -10
- package/dist/elements/browser/main.js +75 -72
- 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 +75 -72
- package/dist/elements/browser/{suibi-module.v0.1.0-preview.7.css → suibi-module.v0.1.0-preview.87cac2d.css} +1 -1
- package/dist/elements/browser/suibi-module.v0.1.0-preview.87cac2d.js +78 -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 -1
- package/dist/types/app/app.d.ts +1 -3
- 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 +226 -2
- package/dist/types/app/components/empty-state/empty-state.component.d.ts +12 -0
- package/dist/types/app/components/gauge-arc/gauge-arc.component.d.ts +49 -0
- package/dist/types/app/{header-bar.d.ts → components/header-bar/header-bar.component.d.ts} +3 -4
- package/dist/types/app/components/inline-table/inline-table.component.d.ts +159 -0
- package/dist/types/app/components/inline-table/inline-table.types.d.ts +212 -0
- package/dist/types/app/components/module-placeholder-page/module-placeholder-page.component.d.ts +6 -0
- package/dist/types/app/components/planning-result/planning-result.component.d.ts +46 -0
- package/dist/types/app/components/planning-result-row/planning-result-row.component.d.ts +34 -0
- package/dist/types/app/components/planning-trigger/planning-trigger.component.d.ts +13 -0
- package/dist/types/app/components/results-page/results-page.component.d.ts +13 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +32 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-metrics.service.d.ts +21 -0
- package/dist/types/app/components/suissebilanz-minibar/suissebilanz-minibar.component.d.ts +19 -0
- package/dist/types/app/components/validation-page/validation-page.component.d.ts +18 -0
- package/dist/types/app/components/welcome-page/metadata.types.d.ts +1 -1
- package/dist/types/app/components/welcome-page/welcome-page.component.d.ts +5 -3
- package/dist/types/app/components/workflow-stepper/workflow-stepper.component.d.ts +49 -0
- package/dist/types/app/core/data/naebi-data.service.d.ts +38 -28
- package/dist/types/app/core/error/global-error-handler.d.ts +2 -3
- package/dist/types/app/core/i18n/i18n.service.d.ts +5 -3
- package/dist/types/app/core/i18n/locales/fr.d.ts +2 -0
- package/dist/types/app/core/i18n/locales/it.d.ts +2 -0
- package/dist/types/app/core/master-data/master-data.service.d.ts +8 -1
- package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +11 -1
- package/dist/types/app/core/navigation/navigation.service.d.ts +36 -1
- package/dist/types/app/core/planning/planning-balance.service.d.ts +46 -0
- package/dist/types/app/core/planning/planning-balance.types.d.ts +206 -0
- package/dist/types/app/core/planning/planning-balance.utils.d.ts +10 -0
- package/dist/types/app/core/utils/custom-unit.util.d.ts +39 -0
- package/dist/types/app/core/utils/object.util.d.ts +22 -0
- package/dist/types/app/core/validation/ajv-custom.d.ts +1 -0
- package/dist/types/app/core/validation/capabilities.d.ts +11 -5
- package/dist/types/app/core/validation/global-validation.service.d.ts +21 -4
- package/dist/types/app/jsonforms/filters/code-list-filter-resolvers.d.ts +3 -0
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +8 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +1 -1
- package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +10 -4
- 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 +3 -0
- package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +1 -0
- package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +2 -0
- package/dist/types/app/jsonforms/renderers/layout/group/module-toggle-group.renderer.d.ts +38 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail/animal-stock-detail.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/animal-stock/{animal-stock-list.component.d.ts → animal-stock-list/animal-stock-list.component.d.ts} +6 -9
- package/dist/types/app/nutrient-cycle/animal-stock/{animal-stock-master-detail.component.d.ts → animal-stock-master-detail/animal-stock-master-detail.component.d.ts} +2 -3
- package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +3 -3
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail/farm-manure-trading-master-detail.component.d.ts +19 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.component.d.ts +37 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.config.d.ts +24 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading.types.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +3 -3
- package/dist/types/app/nutrient-cycle/farm-manure-trading/transaction-unit.util.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.config.d.ts +16 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.config.d.ts +13 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-detail/field-cultivation-detail.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-general/field-cultivation-general.component.d.ts +20 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-list/field-cultivation-list.component.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail/field-cultivation-master-detail.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.types.d.ts +45 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.util.d.ts +10 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.config.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/index.d.ts +9 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.config.d.ts +54 -0
- package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +52 -0
- package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.config.d.ts +20 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.component.d.ts +18 -4
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.types.d.ts +1 -0
- package/dist/types/app/nutrient-cycle/field-spreading/ingredient.util.d.ts +8 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +32 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-transaction-unit.util.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail/fodder-master-detail.component.d.ts +25 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.component.d.ts +28 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.config.d.ts +9 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder.types.d.ts +34 -0
- package/dist/types/app/nutrient-cycle/fodder/index.d.ts +3 -0
- package/dist/types/app/nutrient-cycle/fodder/ingredient.util.d.ts +8 -0
- package/dist/types/app/nutrient-cycle/fodder/transaction-unit.util.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts +1 -1
- package/dist/types/app/nutrient-cycle/storage/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/storage/storage-detail/storage-detail.component.d.ts +30 -0
- package/dist/types/app/nutrient-cycle/storage/storage-general/storage-general.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/storage/storage-list/storage-list.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/storage/storage-master-detail/storage-master-detail.component.d.ts +32 -0
- package/dist/types/app/nutrient-cycle/storage/storage.types.d.ts +40 -0
- package/dist/types/environments/environment.d.ts +5 -0
- package/dist/types/shared/material-icons.d.ts +3 -3
- package/package.json +68 -17
- package/dist/elements/browser/suibi-module.v0.1.0-preview.7.js +0 -75
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail.component.d.ts +0 -22
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts +0 -27
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts +0 -22
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail.component.d.ts +0 -26
- /package/dist/types/app/{core/validation/validation-errors-panel.d.ts → components/validation-errors-panel/validation-errors-panel.component.d.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface FieldCultivationRequirementCorrection {
|
|
2
|
+
quantity?: number | null;
|
|
3
|
+
molecularFormula?: string | null;
|
|
4
|
+
unit?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface FieldCultivationCropHarvest {
|
|
7
|
+
agronomicCropCategory?: string | null;
|
|
8
|
+
userSpecificPlantName?: string | null;
|
|
9
|
+
effectiveYield?: number | null;
|
|
10
|
+
}
|
|
11
|
+
export interface FieldCultivationBaseEntry {
|
|
12
|
+
agronomicCropCategory?: string | null;
|
|
13
|
+
userSpecificPlantName?: string | null;
|
|
14
|
+
/** Null for CSC_OUTVG special crops — the main-crop concept does not apply to them. */
|
|
15
|
+
isMainCrop?: boolean | null;
|
|
16
|
+
areaSize?: number | null;
|
|
17
|
+
/** Host-only display unit for areaSize ('m2' base, or custom e.g. 'ha') — persisted in
|
|
18
|
+
* the dossier, converted to m2 and stripped before the planning POST (docs/custom-units.md). */
|
|
19
|
+
areaUnit?: string | null;
|
|
20
|
+
yieldPerSquareMeasure?: number | null;
|
|
21
|
+
}
|
|
22
|
+
export interface FieldCultivationFodderCropland extends FieldCultivationBaseEntry {
|
|
23
|
+
fieldName?: string | null;
|
|
24
|
+
calculateYieldThroughFodderBalance?: boolean;
|
|
25
|
+
requirementCorrection?: FieldCultivationRequirementCorrection[];
|
|
26
|
+
}
|
|
27
|
+
export interface FieldCultivationArableLand extends FieldCultivationBaseEntry {
|
|
28
|
+
hasLongTermYieldDivergence?: boolean;
|
|
29
|
+
requirementCorrection?: FieldCultivationRequirementCorrection[];
|
|
30
|
+
}
|
|
31
|
+
export interface FieldCultivationSpecial extends FieldCultivationBaseEntry {
|
|
32
|
+
requirementCorrection?: FieldCultivationRequirementCorrection[];
|
|
33
|
+
}
|
|
34
|
+
export interface FieldCultivationData {
|
|
35
|
+
buildingZoneAreaSize?: number | null;
|
|
36
|
+
outdoorVegetableMainCropAreaSize?: number | null;
|
|
37
|
+
indoorVegetableMainCropAreaSize?: number | null;
|
|
38
|
+
feedingOfCropHarvest?: FieldCultivationCropHarvest[];
|
|
39
|
+
dispenseOfCropHarvest?: FieldCultivationCropHarvest[];
|
|
40
|
+
fodderCropland?: FieldCultivationFodderCropland[];
|
|
41
|
+
arableLand?: FieldCultivationArableLand[];
|
|
42
|
+
special?: FieldCultivationSpecial[];
|
|
43
|
+
}
|
|
44
|
+
export type FieldCultivationDetailMode = 'fodderCropland' | 'arableLand' | 'special';
|
|
45
|
+
export type FieldCultivationDetailEntry = FieldCultivationFodderCropland | FieldCultivationArableLand | FieldCultivationSpecial;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FieldCultivationCropHarvest, FieldCultivationData, FieldCultivationDetailEntry, FieldCultivationDetailMode, FieldCultivationRequirementCorrection } from './field-cultivation.types';
|
|
2
|
+
/** Subcategory whose special crops are never a main crop — `isMainCrop` must be null. */
|
|
3
|
+
export declare const OUTDOOR_VEGETABLE_SUBCATEGORY = "CSC_OUTVG";
|
|
4
|
+
/** True when the crop code belongs to the outdoor-vegetable subcategory (CSC_OUTVG). */
|
|
5
|
+
export declare function isOutdoorVegetableCrop(cropCode: unknown): boolean;
|
|
6
|
+
export declare function normalizeRequirementCorrection(source: Partial<FieldCultivationRequirementCorrection> | undefined): FieldCultivationRequirementCorrection;
|
|
7
|
+
export declare function normalizeCropHarvestEntry(source: Partial<FieldCultivationCropHarvest> | undefined): FieldCultivationCropHarvest;
|
|
8
|
+
export declare function normalizeFieldCultivationDetailEntry(mode: FieldCultivationDetailMode, source: Partial<FieldCultivationDetailEntry> | undefined): FieldCultivationDetailEntry;
|
|
9
|
+
export declare function createEmptyFieldCultivationDetailEntry(mode: FieldCultivationDetailMode): FieldCultivationDetailEntry;
|
|
10
|
+
export declare function normalizeFieldCultivation(source: Partial<FieldCultivationData> | undefined): FieldCultivationData;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FieldCultivationFodderCropland } from '../field-cultivation.types';
|
|
2
|
+
/**
|
|
3
|
+
* FodderCroplandTableComponent — thin wrapper around InlineTableComponent for the
|
|
4
|
+
* "Surface fourragère" tab: entries are edited directly in the table (no detail pane).
|
|
5
|
+
*
|
|
6
|
+
* Rows without a selected crop (freshly added) exist only in the local `uiRows`
|
|
7
|
+
* state and are emitted upstream once a crop is picked, so no empty rows ever
|
|
8
|
+
* reach the data store (fodder `uiRows` pattern). The rowTransform clears the
|
|
9
|
+
* yield whenever it is not user-editable for the row.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FodderCroplandTableComponent {
|
|
12
|
+
readonly entries: import("@angular/core").InputSignal<FieldCultivationFodderCropland[]>;
|
|
13
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<FieldCultivationFodderCropland[]>;
|
|
14
|
+
/** Column/section config (constant — no signal needed). */
|
|
15
|
+
protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
|
|
16
|
+
/** Rows as last edited locally (may contain not-yet-committed empty rows); null = follow data. */
|
|
17
|
+
private readonly uiRows;
|
|
18
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
19
|
+
constructor();
|
|
20
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Clears the yield whenever it stops being user-editable for the row (fodder-balance
|
|
23
|
+
* calculation switched on, or new crop without yield input), so no stale value
|
|
24
|
+
* lingers under the now-disabled cell. A crop that cannot serve as pre/catch crop
|
|
25
|
+
* forces `isMainCrop: true`. Requirement corrections are special-crops-only
|
|
26
|
+
* (SUIBIL-1143): strip them so they never reach the emitted JSON.
|
|
27
|
+
*/
|
|
28
|
+
readonly enforceFodderCroplandRules: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column and section configuration for the fodder-cropland inline table
|
|
3
|
+
* ("Surface fourragère" tab).
|
|
4
|
+
*
|
|
5
|
+
* Replaces the former list + JSONForms detail pane: entries are edited directly
|
|
6
|
+
* in the table. `userSpecificPlantName` and `fieldName` stay in the data model
|
|
7
|
+
* (filled by imports/API) but are no longer editable in the UI.
|
|
8
|
+
*/
|
|
9
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
10
|
+
/**
|
|
11
|
+
* Yield is user-editable only when the selected crop permits yield input AND the
|
|
12
|
+
* yield is not calculated through the fodder balance — mirrors the former
|
|
13
|
+
* `fieldCultivation_shouldShowYieldInput` constraint of the detail form.
|
|
14
|
+
*/
|
|
15
|
+
export declare function yieldNotEditable(row: Record<string, unknown>): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Main crop is forced (checked + disabled) when the selected crop cannot serve as a
|
|
18
|
+
* pre/catch crop (`isPermittedForPreOrCatchCrop: false` in the master data).
|
|
19
|
+
*/
|
|
20
|
+
export declare function mainCropForced(row: Record<string, unknown>): boolean;
|
|
21
|
+
export declare const FODDER_CROPLAND_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './field-cultivation-list/field-cultivation-list.component';
|
|
2
|
+
export * from './field-cultivation-detail/field-cultivation-detail.component';
|
|
3
|
+
export * from './field-cultivation-general/field-cultivation-general.component';
|
|
4
|
+
export * from './field-cultivation-master-detail/field-cultivation-master-detail.component';
|
|
5
|
+
export * from './crop-harvest-table/crop-harvest-table.component';
|
|
6
|
+
export * from './fodder-cropland-table/fodder-cropland-table.component';
|
|
7
|
+
export * from './arable-land-table/arable-land-table.component';
|
|
8
|
+
export * from './special-crops-table/special-crops-table.component';
|
|
9
|
+
export * from './field-cultivation.types';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FieldCultivationSpecial } from '../field-cultivation.types';
|
|
2
|
+
/**
|
|
3
|
+
* SpecialCropsTableComponent — thin wrapper around InlineTableComponent for the
|
|
4
|
+
* "Cultures spéciales" tab: one table for the whole CULT_SPECIAL category.
|
|
5
|
+
*
|
|
6
|
+
* Rows without a selected crop (freshly added) exist only in the local `uiRows`
|
|
7
|
+
* state and are emitted upstream once a crop is picked, so no empty rows ever
|
|
8
|
+
* reach the data store (fodder `uiRows` pattern).
|
|
9
|
+
*/
|
|
10
|
+
export declare class SpecialCropsTableComponent {
|
|
11
|
+
readonly entries: import("@angular/core").InputSignal<FieldCultivationSpecial[]>;
|
|
12
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<FieldCultivationSpecial[]>;
|
|
13
|
+
/** Column/section config (constant — no signal needed). */
|
|
14
|
+
protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
|
|
15
|
+
/** Rows as last edited locally (may contain not-yet-committed empty rows); null = follow data. */
|
|
16
|
+
private readonly uiRows;
|
|
17
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
18
|
+
constructor();
|
|
19
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* Domain rules applied on every edit:
|
|
22
|
+
* - the unit of the managed nutrient slots is fixed (corrections in %),
|
|
23
|
+
* - managed slots left empty are dropped (the API rejects null quantities),
|
|
24
|
+
* - CSC_OUTVG crops carry `isMainCrop: null` (not a main-crop concept),
|
|
25
|
+
* - selecting a crop pre-fills the three corrections (P2O5/K2O/Mg) at 100 %;
|
|
26
|
+
* clearing the crop removes the managed slots.
|
|
27
|
+
*/
|
|
28
|
+
readonly enforceSpecialCropRules: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column and section configuration for the special-crops inline table
|
|
3
|
+
* ("Cultures spéciales" tab).
|
|
4
|
+
*
|
|
5
|
+
* ONE table for the whole CULT_SPECIAL category: the crop dropdown reuses the
|
|
6
|
+
* `agronomicCropCategorySpecial` code list, which is already filtered on
|
|
7
|
+
* cultivationCategory === 'CULT_SPECIAL'. The nutrient columns are the three
|
|
8
|
+
* corrections (P2O5/K2O/Mg slots in %) living in the row's
|
|
9
|
+
* `requirementCorrection[]` sub-array.
|
|
10
|
+
*/
|
|
11
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
12
|
+
/** Correction slots managed by the table, always expressed in % (100 % = no correction). */
|
|
13
|
+
export declare const CORRECTION_FORMULAS: readonly ["P2O5", "K2O", "Mg"];
|
|
14
|
+
export declare const CORRECTION_UNIT = "%";
|
|
15
|
+
export declare const CORRECTION_DEFAULT = 100;
|
|
16
|
+
/** Code list feeding the crop dropdown — the whole CULT_SPECIAL category. */
|
|
17
|
+
export declare const SPECIAL_CROPS_CODE_LIST = "agronomicCropCategorySpecial";
|
|
18
|
+
/** Crop ids permitted in the table — every CULT_SPECIAL entry of the master data. */
|
|
19
|
+
export declare const SPECIAL_CROPS_IDS: Set<string>;
|
|
20
|
+
/** Looks up a crop entry in the table's code list. */
|
|
21
|
+
export declare function specialCropEntry(id: unknown): Record<string, unknown> | undefined;
|
|
22
|
+
/** True when the crop cannot serve as a pre/catch crop — it must then be the main crop. */
|
|
23
|
+
export declare function mainCropForced(row: Record<string, unknown>): boolean;
|
|
24
|
+
/** True when the row's crop belongs to the outdoor-vegetable subcategory (CSC_OUTVG). */
|
|
25
|
+
export declare function isOutdoorVegetableRow(row: Record<string, unknown>): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Enforces the isMainCrop rule: null for CSC_OUTVG crops (the main-crop concept does
|
|
28
|
+
* not apply), forced to true for crops that cannot serve as pre/catch crop, restored
|
|
29
|
+
* to false when switching back to a crop where the flag applies.
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeIsMainCrop(row: Record<string, unknown>): Record<string, unknown>;
|
|
32
|
+
/** Corrections (P2O5/K2O/Mg) apply to every special crop; locked only without a crop. */
|
|
33
|
+
export declare function correctionColumnsLocked(crop: Record<string, unknown> | undefined): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Applies the crop's defaults to the requirement-correction slots:
|
|
36
|
+
* - No crop selected: the managed slots are removed entirely — nothing is editable
|
|
37
|
+
* and nothing is sent to the API.
|
|
38
|
+
* - Crop selected: the three corrections (P2O5/K2O/Mg) are reset to 100 % and
|
|
39
|
+
* stay user-editable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function applyCropDefaults(row: Record<string, unknown>, crop: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* Normalizes the managed requirement-correction slots on every edit: fixed unit
|
|
44
|
+
* (%) and removal of managed entries left without a quantity (the API rejects
|
|
45
|
+
* present-but-null quantities).
|
|
46
|
+
*/
|
|
47
|
+
export declare function normalizeManagedCorrections(row: Record<string, unknown>): Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* Shared column definitions for the requirement-correction sub-array (P2O5/K2O/Mg),
|
|
50
|
+
* reusable across fodder, arable and special tables. `lockCorrections` disables
|
|
51
|
+
* editing per row.
|
|
52
|
+
*/
|
|
53
|
+
export declare function requirementCorrectionColumns(lockCorrections: (row: Record<string, unknown>) => boolean): InlineTableConfig['columns'];
|
|
54
|
+
export declare const SPECIAL_CROPS_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { InlineColumnDef } from '../../../components/inline-table/inline-table.types';
|
|
2
|
+
import { FieldSpreadingFertiliserEntry } from '../field-spreading.types';
|
|
3
|
+
/**
|
|
4
|
+
* FertiliserTableComponent — thin wrapper around InlineTableComponent.
|
|
5
|
+
*
|
|
6
|
+
* Responsibilities:
|
|
7
|
+
* 1. Provides `FERTILISER_TABLE_CONFIG` (the column/section "uischema") to the
|
|
8
|
+
* generic table component.
|
|
9
|
+
* 2. Bridges the typed `FieldSpreadingFertiliserEntry[]` inputs/outputs to the
|
|
10
|
+
* generic `Record<string, unknown>[]` API expected by InlineTableComponent.
|
|
11
|
+
* 3. Supplies `autoPopulateNutrients` as a `rowTransform` — domain logic that
|
|
12
|
+
* pre-fills Ntot/P₂O₅/K₂O/Mg from the product's max values on product selection.
|
|
13
|
+
*
|
|
14
|
+
* To create a similar table for another domain:
|
|
15
|
+
* 1. Copy `fertiliser-table.config.ts` and define new columns there.
|
|
16
|
+
* 2. Create a new thin wrapper component (like this one) that wires the config
|
|
17
|
+
* and an optional rowTransform.
|
|
18
|
+
* 3. The generic InlineTableComponent requires no changes.
|
|
19
|
+
*/
|
|
20
|
+
export declare class FertiliserTableComponent {
|
|
21
|
+
private readonly i18n;
|
|
22
|
+
readonly entries: import("@angular/core").InputSignal<FieldSpreadingFertiliserEntry[]>;
|
|
23
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<FieldSpreadingFertiliserEntry[]>;
|
|
24
|
+
/** Row index to highlight after a validation-error deep-link (forwarded to the table). */
|
|
25
|
+
readonly highlightRowIndex: import("@angular/core").InputSignal<number | null>;
|
|
26
|
+
/** Column/section config exposed to the template (constant — no signal needed). */
|
|
27
|
+
protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
|
|
28
|
+
/** Cast typed entries to the generic Record[] expected by InlineTableComponent. */
|
|
29
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
30
|
+
/** Cast the generic output back to the typed FieldSpreadingFertiliserEntry[], stripping any
|
|
31
|
+
* ingredient with a 0 quantity so it never reaches the final JSON. */
|
|
32
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Row transform for auto-populating nutrient columns when a product is selected.
|
|
35
|
+
*
|
|
36
|
+
* Unit handling: `transactionUnit` is user-selectable between kg and its custom units
|
|
37
|
+
* (t, dt). Switching the unit converts the already-entered quantity so the amount is
|
|
38
|
+
* preserved; legacy/imported rows without a unit default to kg.
|
|
39
|
+
*
|
|
40
|
+
* Defined as an arrow-function property so `this` is never needed and the function
|
|
41
|
+
* can be passed as a value to InlineTableComponent without losing its context.
|
|
42
|
+
*/
|
|
43
|
+
readonly autoPopulateNutrients: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* Per-cell validation for the nutrient % columns: each value capped at 100 %
|
|
46
|
+
* and the sum of the four ingredients capped at 100 % per row.
|
|
47
|
+
* The inline table bypasses JSONForms/AJV, so these rules (mirroring the
|
|
48
|
+
* `maximum` / `proportionSum` keywords in schema.json) must be surfaced
|
|
49
|
+
* visually here — the global validation panel alone is not visible while typing.
|
|
50
|
+
*/
|
|
51
|
+
readonly nutrientCellError: (row: Record<string, unknown>, col: InlineColumnDef) => string | null;
|
|
52
|
+
}
|
package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.config.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column and section configuration for the Mineral Fertiliser inline table.
|
|
3
|
+
*
|
|
4
|
+
* This is the "uischema" for the Mineral fertilisers tab — it is the ONLY file
|
|
5
|
+
* that needs to be created/modified when adapting the inline table pattern for
|
|
6
|
+
* a different domain (e.g. recycling entries).
|
|
7
|
+
*
|
|
8
|
+
* Relationship to InlineTableComponent:
|
|
9
|
+
* - `columns` → drives header labels, cell widgets, grid widths, and code-list sources
|
|
10
|
+
* - `createRow` → produces a blank row with the ingredient sub-array pre-initialised
|
|
11
|
+
* - Labels reference i18n keys; chemical formula headers use `labelLiteral: true`
|
|
12
|
+
*
|
|
13
|
+
* Auto-population of nutrient columns on product selection is NOT configured here —
|
|
14
|
+
* that business logic lives in FertiliserTableComponent as a `rowTransform` function.
|
|
15
|
+
*/
|
|
16
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
17
|
+
/** The four nutrient formulas tracked per fertiliser entry, in display order. */
|
|
18
|
+
export declare const NUTRIENT_COLUMNS: readonly ["Ntot", "P2O5", "K2O", "Mg"];
|
|
19
|
+
export type NutrientFormula = (typeof NUTRIENT_COLUMNS)[number];
|
|
20
|
+
export declare const FERTILISER_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { JsonSchema
|
|
2
|
-
import { FieldSpreadingData } from './field-spreading.types';
|
|
1
|
+
import { JsonSchema } from '@jsonforms/core';
|
|
2
|
+
import { FieldSpreadingData, FieldSpreadingFertiliserEntry, FieldSpreadingRecyclingEntry } from './field-spreading.types';
|
|
3
3
|
export declare class FieldSpreadingComponent {
|
|
4
4
|
private readonly dataSvc;
|
|
5
5
|
private readonly navigationSvc;
|
|
6
6
|
private readonly i18n;
|
|
7
|
-
private readonly rootData;
|
|
8
7
|
constructor();
|
|
8
|
+
/** Fertiliser row to highlight (set by validation deep-links, cleared by the next one). */
|
|
9
|
+
readonly highlightedFertiliserIndex: import("@angular/core").WritableSignal<number | null>;
|
|
9
10
|
readonly schema: import("@angular/core").Signal<JsonSchema>;
|
|
10
|
-
readonly
|
|
11
|
+
readonly localizedGeneralUi: import("@angular/core").Signal<import("@jsonforms/core").UISchemaElement>;
|
|
11
12
|
readonly renderers: {
|
|
12
13
|
tester: import("@jsonforms/core").RankedTester;
|
|
13
14
|
renderer: any;
|
|
@@ -15,7 +16,20 @@ export declare class FieldSpreadingComponent {
|
|
|
15
16
|
readonly ajv: import("ajv").Ajv;
|
|
16
17
|
private readonly normalizedFieldSpreading;
|
|
17
18
|
readonly jsonFormsData: import("@angular/core").Signal<(FieldSpreadingData & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
19
|
+
/** Fertiliser entries exposed to the custom table component. */
|
|
20
|
+
readonly fertiliserEntries: import("@angular/core").Signal<FieldSpreadingFertiliserEntry[]>;
|
|
21
|
+
/** Recycling entries exposed to the custom table component. */
|
|
22
|
+
readonly recyclingEntries: import("@angular/core").Signal<FieldSpreadingRecyclingEntry[]>;
|
|
23
|
+
/** Drives mat-tab-group [selectedIndex] from NavigationService state. */
|
|
24
|
+
readonly activeTabIndex: import("@angular/core").Signal<number>;
|
|
25
|
+
onTabChange(index: number): void;
|
|
26
|
+
/** Called by both general JSONForms instances on data change.
|
|
27
|
+
* Preserves fertiliser and recycling entries managed by their custom table components. */
|
|
18
28
|
onDataChange(event: unknown): void;
|
|
29
|
+
/** Called by FertiliserTableComponent when entries are added/edited/removed. */
|
|
30
|
+
onFertiliserChange(fertiliser: FieldSpreadingFertiliserEntry[]): void;
|
|
31
|
+
/** Called by RecyclingTableComponent when entries are added/edited/removed. */
|
|
32
|
+
onRecyclingChange(recycling: FieldSpreadingRecyclingEntry[]): void;
|
|
19
33
|
private patchFieldSpreading;
|
|
20
34
|
private normalizeFieldSpreading;
|
|
21
35
|
private areFieldSpreadingEqual;
|
|
@@ -23,6 +23,7 @@ export interface FieldSpreadingIngredient {
|
|
|
23
23
|
unit?: string | null;
|
|
24
24
|
}
|
|
25
25
|
export interface FieldSpreadingFertiliserEntry {
|
|
26
|
+
descriptor?: string | null;
|
|
26
27
|
fertiliserProductCategory?: string | null;
|
|
27
28
|
quantity?: number | null;
|
|
28
29
|
transactionUnit?: string | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldSpreadingIngredient } from './field-spreading.types';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures all ingredients are present in the output, converting `null` quantities to `0`
|
|
4
|
+
* to satisfy API requirements while still filtering out explicitly zeroed entries.
|
|
5
|
+
*/
|
|
6
|
+
export declare function stripZeroQuantityIngredients<T extends {
|
|
7
|
+
ingredient?: FieldSpreadingIngredient[];
|
|
8
|
+
}>(entries: T[]): T[];
|
package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FieldSpreadingRecyclingEntry } from '../field-spreading.types';
|
|
2
|
+
/**
|
|
3
|
+
* RecyclingTableComponent — thin wrapper around InlineTableComponent.
|
|
4
|
+
*
|
|
5
|
+
* Responsibilities:
|
|
6
|
+
* 1. Provides `RECYCLING_TABLE_CONFIG` (the column/section "uischema").
|
|
7
|
+
* 2. Bridges typed `FieldSpreadingRecyclingEntry[]` to/from the generic
|
|
8
|
+
* `Record<string, unknown>[]` API of InlineTableComponent.
|
|
9
|
+
* 3. Supplies `deriveUnits` as a `rowTransform` — the base `transactionUnit` ('kg'/'m3')
|
|
10
|
+
* and every ingredient's `unit` ('kg/t'/'kg/m3') are derived from the selected
|
|
11
|
+
* product's matterState; the user may switch to a custom unit sharing the same base
|
|
12
|
+
* (t, dt for kg), which converts the entered quantity on the fly.
|
|
13
|
+
*/
|
|
14
|
+
export declare class RecyclingTableComponent {
|
|
15
|
+
readonly entries: import("@angular/core").InputSignal<FieldSpreadingRecyclingEntry[]>;
|
|
16
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<FieldSpreadingRecyclingEntry[]>;
|
|
17
|
+
/** Column/section config (constant — no signal needed). */
|
|
18
|
+
protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
|
|
19
|
+
/** Cast typed entries to generic Record[] for InlineTableComponent. */
|
|
20
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
21
|
+
/** Cast generic output back to typed FieldSpreadingRecyclingEntry[], stripping any
|
|
22
|
+
* ingredient with a 0 quantity so it never reaches the final JSON. */
|
|
23
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* Row transform deriving the ingredient units from the product's matterState on each
|
|
26
|
+
* edit, and handling `transactionUnit`:
|
|
27
|
+
* - product change (or missing unit on legacy rows): reset to the derived base unit,
|
|
28
|
+
* - unit switch: convert the entered quantity from the previous to the new unit
|
|
29
|
+
* (both share the same base), so the transacted amount is preserved.
|
|
30
|
+
*/
|
|
31
|
+
readonly deriveUnits: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
32
|
+
}
|
package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column and section configuration for the Recycling Fertiliser inline table.
|
|
3
|
+
*
|
|
4
|
+
* This is the "uischema" for the Recycling fertilisers tab.
|
|
5
|
+
* The structure mirrors fertiliser-table.config.ts — only the columns differ:
|
|
6
|
+
* - Product field: typeOfManureRecyclingProduct (different code list)
|
|
7
|
+
* - Nutrient columns: Ntot, Nlos, P₂O₅, K₂O, Mg expressed in kg/unit (not %)
|
|
8
|
+
* — 5 nutrients vs 4 for mineral fertilisers, no auto-population on product select.
|
|
9
|
+
*
|
|
10
|
+
* To adapt again for a new domain, copy this file and adjust columns + i18n keys.
|
|
11
|
+
*/
|
|
12
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
13
|
+
/** Nutrient formulas tracked per recycling entry, in display order. 'Nlos' = soluble nitrogen (matches the
|
|
14
|
+
* `molecularFormula` enum from assets/master-data/substances.json — NOT 'NSol', which the API rejects). */
|
|
15
|
+
export declare const RECYCLING_NUTRIENT_COLUMNS: readonly ["Ntot", "Nlos", "P2O5", "K2O", "Mg"];
|
|
16
|
+
export type RecyclingNutrientFormula = (typeof RECYCLING_NUTRIENT_COLUMNS)[number];
|
|
17
|
+
export declare const RECYCLING_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Derives the mandatory transaction unit ('kg' or 'm3') from the product's matterState. */
|
|
2
|
+
export declare function deriveRecyclingTransactionUnit(productCode: string | null | undefined): string | null;
|
|
3
|
+
/** Derives the mandatory ingredient unit ('kg/t' or 'kg/m3') from the product's matterState. */
|
|
4
|
+
export declare function deriveRecyclingIngredientUnit(productCode: string | null | undefined): string | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FodderCropFromNonFodderCropland, FodderDispense, FodderSupply, FodderTableRow } from '../fodder.types';
|
|
2
|
+
export declare class FodderMasterDetailComponent {
|
|
3
|
+
private readonly dataSvc;
|
|
4
|
+
private readonly navigationSvc;
|
|
5
|
+
constructor();
|
|
6
|
+
readonly supplyRows: import("@angular/core").Signal<FodderSupply[]>;
|
|
7
|
+
readonly dispenseRows: import("@angular/core").Signal<FodderDispense[]>;
|
|
8
|
+
readonly nonFodderCroplandRows: import("@angular/core").Signal<FodderCropFromNonFodderCropland[]>;
|
|
9
|
+
readonly proportionStorageLoss: import("@angular/core").Signal<number | undefined>;
|
|
10
|
+
readonly totalBalanceErrorMargin: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
/** Rows in the order last produced by the table (local UI order); null = follow the data. */
|
|
12
|
+
private readonly uiRows;
|
|
13
|
+
/** Data-derived merged list: supply block, then dispense, then non-fodder cropland. */
|
|
14
|
+
private readonly dataRows;
|
|
15
|
+
/** Rows shown in the table. The local UI order wins so that adding a row or changing its
|
|
16
|
+
* type never reshuffles the list under the user's hands. */
|
|
17
|
+
readonly rows: import("@angular/core").Signal<FodderTableRow[]>;
|
|
18
|
+
/** Persists the edited rows (split back into their three collections) while keeping the
|
|
19
|
+
* emitted order as the local UI order. */
|
|
20
|
+
onRowsChange(rows: FodderTableRow[]): void;
|
|
21
|
+
onScalarInput(field: 'proportionStorageLoss' | 'totalBalanceErrorMargin', event: Event): void;
|
|
22
|
+
scalarInputValue(value: number | undefined): string;
|
|
23
|
+
private cloneFodder;
|
|
24
|
+
private cloneTrading;
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FodderTableRow } from '../fodder.types';
|
|
2
|
+
/**
|
|
3
|
+
* FodderTableComponent — thin wrapper around InlineTableComponent for the merged fodder table
|
|
4
|
+
* (supply / dispense / non-fodder cropland in one table, distinguished per row via `rowKind`).
|
|
5
|
+
* The config provides the columns; the rowTransform imposes the fixed units (transactionUnit
|
|
6
|
+
* 'kg', dry-matter ingredient T/S in '%') and keeps the product compatible with the row kind.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FodderTableComponent {
|
|
9
|
+
readonly entries: import("@angular/core").InputSignal<FodderTableRow[]>;
|
|
10
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<FodderTableRow[]>;
|
|
11
|
+
/** Column/section config (constant — no signal needed). */
|
|
12
|
+
protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
|
|
13
|
+
/** Cast typed entries to the generic Record[] expected by InlineTableComponent. */
|
|
14
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
15
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Domain rules applied on every edit:
|
|
18
|
+
* - `rowKind` change: normalize unknown/cleared values to 'supply' and clear the product
|
|
19
|
+
* when it is not permitted for the new kind.
|
|
20
|
+
* - Product change: pre-fill the dry matter share (T/S %) with the product's
|
|
21
|
+
* `standardDryMatterContent` (stays editable afterwards; null when none is defined).
|
|
22
|
+
* - `transactionUnit` is selectable between kg and its custom units (t, dt): switching
|
|
23
|
+
* converts the entered quantity so the amount is preserved; rows without a unit
|
|
24
|
+
* default to kg. The only permitted ingredient is dry matter (T/S) in % — re-appended
|
|
25
|
+
* when missing.
|
|
26
|
+
*/
|
|
27
|
+
readonly enforceFodderRules: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column and section configuration for the single fodder inline table.
|
|
3
|
+
*
|
|
4
|
+
* The three former mode tabs (supply / dispense / non-fodder cropland) are merged into one
|
|
5
|
+
* table: each row picks its kind via the `rowKind` select column, and the product dropdown
|
|
6
|
+
* is narrowed per row to the products permitted for that kind.
|
|
7
|
+
*/
|
|
8
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
9
|
+
export declare const FODDER_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface FodderIngredient {
|
|
2
|
+
quantity?: number;
|
|
3
|
+
molecularFormula?: string;
|
|
4
|
+
unit?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FodderTradingEntry {
|
|
7
|
+
quantity?: number;
|
|
8
|
+
typeOfFeedstuffProduct?: string;
|
|
9
|
+
transactionUnit?: string;
|
|
10
|
+
ingredient?: FodderIngredient[];
|
|
11
|
+
}
|
|
12
|
+
export interface FodderSupply extends FodderTradingEntry {
|
|
13
|
+
}
|
|
14
|
+
export interface FodderDispense extends FodderTradingEntry {
|
|
15
|
+
}
|
|
16
|
+
export interface FodderCropFromNonFodderCropland extends FodderTradingEntry {
|
|
17
|
+
}
|
|
18
|
+
export interface FodderTradingData {
|
|
19
|
+
supply?: FodderSupply[];
|
|
20
|
+
dispense?: FodderDispense[];
|
|
21
|
+
}
|
|
22
|
+
export interface FodderData {
|
|
23
|
+
trading?: FodderTradingData;
|
|
24
|
+
cropFromNonFodderCropland?: FodderCropFromNonFodderCropland[];
|
|
25
|
+
proportionStorageLoss?: number;
|
|
26
|
+
totalBalanceErrorMargin?: number;
|
|
27
|
+
}
|
|
28
|
+
/** UI-only discriminator telling which fodder collection a table row belongs to. */
|
|
29
|
+
export type FodderRowKind = 'supply' | 'dispense' | 'non_fodder_cropland';
|
|
30
|
+
/** Row shape used by the inline fodder table: a trading entry tagged with its row kind.
|
|
31
|
+
* `rowKind` is stripped again when the rows are written back to the data model. */
|
|
32
|
+
export type FodderTableRow = FodderTradingEntry & {
|
|
33
|
+
rowKind: FodderRowKind;
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dry matter (Trockensubstanz, T/S) is the only ingredient formula permitted for fodder
|
|
3
|
+
* entries (see `fodderMolecularFormula` in code-lists.ts) and its only allowed unit is '%'
|
|
4
|
+
* (assets/master-data/substances.json → S.1007.1). Both are imposed, never user-picked.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FODDER_INGREDIENT_FORMULA = "T/S";
|
|
7
|
+
export declare const FODDER_INGREDIENT_UNIT = "%";
|
|
8
|
+
export declare function deriveFodderIngredientUnit(): string;
|
package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts
CHANGED
|
@@ -23,5 +23,5 @@ export declare class LifetimePerformanceFormComponent {
|
|
|
23
23
|
readonly jsonFormsData: import("@angular/core").Signal<LifetimePerformance & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions>;
|
|
24
24
|
private readonly pruneDisallowedEffect;
|
|
25
25
|
onDataChange(newValue: unknown): void;
|
|
26
|
-
private
|
|
26
|
+
private hasFlag;
|
|
27
27
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from '../storage.types';
|
|
3
|
+
export declare class StorageDetailComponent {
|
|
4
|
+
private readonly i18n;
|
|
5
|
+
readonly type: import("@angular/core").InputSignal<StorageEntryType>;
|
|
6
|
+
readonly row: import("@angular/core").InputSignal<ManurePitEntry | SlurryTankEntry | null>;
|
|
7
|
+
readonly rowChange: import("@angular/core").OutputEmitterRef<ManurePitEntry | SlurryTankEntry>;
|
|
8
|
+
readonly close: import("@angular/core").OutputEmitterRef<void>;
|
|
9
|
+
readonly renderers: {
|
|
10
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
11
|
+
renderer: any;
|
|
12
|
+
}[];
|
|
13
|
+
readonly ajv: import("ajv").Ajv;
|
|
14
|
+
readonly schema: import("@angular/core").Signal<JsonSchema>;
|
|
15
|
+
readonly localizedUi: import("@angular/core").Signal<UISchemaElement>;
|
|
16
|
+
readonly detailTitle: import("@angular/core").Signal<string>;
|
|
17
|
+
readonly jsonFormsData: import("@angular/core").Signal<(({
|
|
18
|
+
descriptor?: string;
|
|
19
|
+
cover?: number | null;
|
|
20
|
+
manureFromAnimalStockStored?: import("..").ManureFromAnimalStockStored[];
|
|
21
|
+
} | {
|
|
22
|
+
descriptor?: string;
|
|
23
|
+
volumeInM3?: number | null;
|
|
24
|
+
depthInM?: number | null;
|
|
25
|
+
cover?: number | null;
|
|
26
|
+
mixingFrequency?: number | null;
|
|
27
|
+
manureDerivation?: string[];
|
|
28
|
+
}) & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
29
|
+
onDataChange(event: unknown): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
import { StorageNormalized } from '../storage.types';
|
|
3
|
+
type StorageSection = 'manure' | 'slurry' | 'slurryFacilityToggle' | 'general';
|
|
4
|
+
export declare class StorageGeneralComponent {
|
|
5
|
+
private readonly i18n;
|
|
6
|
+
readonly section: import("@angular/core").InputSignal<StorageSection>;
|
|
7
|
+
readonly value: import("@angular/core").InputSignal<StorageNormalized>;
|
|
8
|
+
readonly valueChange: import("@angular/core").OutputEmitterRef<StorageNormalized>;
|
|
9
|
+
readonly renderers: {
|
|
10
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
11
|
+
renderer: any;
|
|
12
|
+
}[];
|
|
13
|
+
readonly ajv: import("ajv").Ajv;
|
|
14
|
+
readonly schema: import("@angular/core").Signal<JsonSchema>;
|
|
15
|
+
readonly localizedUi: import("@angular/core").Signal<UISchemaElement>;
|
|
16
|
+
readonly jsonFormsData: import("@angular/core").Signal<({
|
|
17
|
+
stableStrawLitter: number | null;
|
|
18
|
+
manureSupplyProportionStored: number | null;
|
|
19
|
+
createFacilitySpecificManureProduct: boolean;
|
|
20
|
+
} & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
|
|
21
|
+
createFacilitySpecificSlurryProduct: boolean;
|
|
22
|
+
} & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
|
|
23
|
+
slurrySupplyProportionStored: number | null;
|
|
24
|
+
slurryTankQuantity: number | null;
|
|
25
|
+
dilutionRatio: number | null;
|
|
26
|
+
} & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
27
|
+
onDataChange(event: unknown): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from '../storage.types';
|
|
2
|
+
export declare class StorageListComponent {
|
|
3
|
+
private readonly i18n;
|
|
4
|
+
private readonly masterData;
|
|
5
|
+
readonly rows: import("@angular/core").InputSignal<(ManurePitEntry | SlurryTankEntry)[]>;
|
|
6
|
+
readonly selectedIndex: import("@angular/core").InputSignal<number | null>;
|
|
7
|
+
readonly type: import("@angular/core").InputSignal<StorageEntryType>;
|
|
8
|
+
readonly errorIndices: import("@angular/core").InputSignal<ReadonlySet<number>>;
|
|
9
|
+
readonly select: import("@angular/core").OutputEmitterRef<number>;
|
|
10
|
+
readonly add: import("@angular/core").OutputEmitterRef<void>;
|
|
11
|
+
readonly delete: import("@angular/core").OutputEmitterRef<number>;
|
|
12
|
+
readonly displayedColumns: string[];
|
|
13
|
+
readonly headerName: import("@angular/core").Signal<string>;
|
|
14
|
+
readonly headerMeta: import("@angular/core").Signal<string>;
|
|
15
|
+
resolveName(row: ManurePitEntry | SlurryTankEntry, index: number): string;
|
|
16
|
+
rowHasError(index: number): boolean;
|
|
17
|
+
rowErrorLabel(): string;
|
|
18
|
+
resolveMeta(row: ManurePitEntry | SlurryTankEntry): string;
|
|
19
|
+
emptyLabel(): string;
|
|
20
|
+
emptyHintLabel(): string;
|
|
21
|
+
addLabel(): string;
|
|
22
|
+
onDelete(index: number, event: Event): void;
|
|
23
|
+
}
|