@agridea/suibi-module 0.1.0-preview.cf0616d → 0.1.0-preview.d54bad3

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.
Files changed (102) hide show
  1. package/README.md +10 -10
  2. package/dist/elements/browser/main.js +71 -71
  3. package/dist/elements/browser/styles.css +1 -1
  4. package/dist/elements/browser/suibi-module-latest.css +1 -1
  5. package/dist/elements/browser/suibi-module-latest.js +71 -71
  6. package/dist/elements/browser/{suibi-module.v0.1.0-preview.cf0616d.css → suibi-module.v0.1.0-preview.d54bad3.css} +1 -1
  7. package/dist/elements/browser/suibi-module.v0.1.0-preview.d54bad3.js +78 -0
  8. package/dist/elements/browser/suibi-theme-dark.css +1 -1
  9. package/dist/elements/browser/version.txt +1 -1
  10. package/dist/elements/browser/wc-global-utilities.css +1 -1
  11. package/dist/types/app/components/data-preview/data-preview.component.d.ts +223 -2
  12. package/dist/types/app/components/{suissebilanz-dashboard → gauge-arc}/gauge-arc.component.d.ts +2 -0
  13. package/dist/types/app/{header-bar.d.ts → components/header-bar/header-bar.component.d.ts} +2 -2
  14. package/dist/types/app/components/inline-table/inline-table.component.d.ts +167 -0
  15. package/dist/types/app/components/inline-table/inline-table.types.d.ts +212 -0
  16. package/dist/types/app/components/planning-result-row/planning-result-row.component.d.ts +34 -0
  17. package/dist/types/app/components/results-page/results-page.component.d.ts +9 -0
  18. package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +10 -2
  19. package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-metrics.service.d.ts +1 -1
  20. package/dist/types/app/components/{suissebilanz-dashboard → suissebilanz-minibar}/suissebilanz-minibar.component.d.ts +2 -2
  21. package/dist/types/app/components/validation-page/validation-page.component.d.ts +1 -0
  22. package/dist/types/app/components/welcome-page/metadata.types.d.ts +1 -1
  23. package/dist/types/app/components/welcome-page/welcome-page.component.d.ts +5 -3
  24. package/dist/types/app/components/workflow-stepper/workflow-stepper.component.d.ts +1 -4
  25. package/dist/types/app/core/data/naebi-data.service.d.ts +28 -28
  26. package/dist/types/app/core/error/global-error-handler.d.ts +2 -3
  27. package/dist/types/app/core/i18n/i18n.service.d.ts +7 -3
  28. package/dist/types/app/core/i18n/locales/fr.d.ts +2 -0
  29. package/dist/types/app/core/i18n/locales/it.d.ts +2 -0
  30. package/dist/types/app/core/master-data/master-data.service.d.ts +2 -0
  31. package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +11 -1
  32. package/dist/types/app/core/navigation/navigation.service.d.ts +34 -1
  33. package/dist/types/app/core/planning/planning-balance.service.d.ts +9 -0
  34. package/dist/types/app/core/utils/custom-unit.util.d.ts +39 -0
  35. package/dist/types/app/core/utils/object.util.d.ts +22 -0
  36. package/dist/types/app/core/validation/ajv-custom.d.ts +1 -0
  37. package/dist/types/app/core/validation/capabilities.d.ts +6 -0
  38. package/dist/types/app/core/validation/global-validation.service.d.ts +21 -1
  39. package/dist/types/app/jsonforms/filters/code-list-filter-resolvers.d.ts +3 -0
  40. package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +4 -0
  41. package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +5 -2
  42. package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +13 -4
  43. package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +1 -0
  44. package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +2 -0
  45. package/dist/types/app/jsonforms/renderers/layout/group/module-toggle-group.renderer.d.ts +38 -0
  46. package/dist/types/app/jsonforms/shared/searchable-select/search-highlight.d.ts +18 -0
  47. package/dist/types/app/jsonforms/shared/searchable-select/searchable-select.component.d.ts +63 -0
  48. package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail/animal-stock-detail.component.d.ts +21 -0
  49. 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
  50. 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 -2
  51. package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +3 -3
  52. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail/farm-manure-trading-master-detail.component.d.ts +19 -0
  53. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.component.d.ts +37 -0
  54. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.config.d.ts +24 -0
  55. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading.types.d.ts +4 -0
  56. package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +3 -3
  57. package/dist/types/app/nutrient-cycle/farm-manure-trading/transaction-unit.util.d.ts +2 -0
  58. package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.component.d.ts +23 -0
  59. package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.config.d.ts +16 -0
  60. package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.component.d.ts +21 -0
  61. package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.config.d.ts +13 -0
  62. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-detail/field-cultivation-detail.component.d.ts +22 -0
  63. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-general/field-cultivation-general.component.d.ts +20 -0
  64. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-list/field-cultivation-list.component.d.ts +17 -0
  65. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail/field-cultivation-master-detail.component.d.ts +29 -0
  66. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.types.d.ts +45 -0
  67. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.util.d.ts +10 -0
  68. package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.component.d.ts +29 -0
  69. package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.config.d.ts +21 -0
  70. package/dist/types/app/nutrient-cycle/field-cultivation/index.d.ts +9 -0
  71. package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.component.d.ts +29 -0
  72. package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.config.d.ts +51 -0
  73. package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +58 -0
  74. package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.config.d.ts +20 -0
  75. package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.component.d.ts +18 -3
  76. package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.types.d.ts +2 -0
  77. package/dist/types/app/nutrient-cycle/field-spreading/ingredient.util.d.ts +8 -0
  78. package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +32 -0
  79. package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts +17 -0
  80. package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-transaction-unit.util.d.ts +4 -0
  81. package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail/fodder-master-detail.component.d.ts +25 -0
  82. package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.component.d.ts +28 -0
  83. package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.config.d.ts +9 -0
  84. package/dist/types/app/nutrient-cycle/fodder/fodder.types.d.ts +34 -0
  85. package/dist/types/app/nutrient-cycle/fodder/index.d.ts +3 -0
  86. package/dist/types/app/nutrient-cycle/fodder/ingredient.util.d.ts +8 -0
  87. package/dist/types/app/nutrient-cycle/fodder/transaction-unit.util.d.ts +2 -0
  88. package/dist/types/app/nutrient-cycle/lifetime-performance/index.d.ts +2 -0
  89. package/dist/types/app/nutrient-cycle/storage/index.d.ts +4 -0
  90. package/dist/types/app/nutrient-cycle/storage/storage-detail/storage-detail.component.d.ts +30 -0
  91. package/dist/types/app/nutrient-cycle/storage/storage-general/storage-general.component.d.ts +29 -0
  92. package/dist/types/app/nutrient-cycle/storage/storage-list/storage-list.component.d.ts +23 -0
  93. package/dist/types/app/nutrient-cycle/storage/storage-master-detail/storage-master-detail.component.d.ts +32 -0
  94. package/dist/types/app/nutrient-cycle/storage/storage.types.d.ts +40 -0
  95. package/package.json +68 -17
  96. package/dist/elements/browser/suibi-module.v0.1.0-preview.cf0616d.js +0 -78
  97. package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail.component.d.ts +0 -22
  98. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts +0 -27
  99. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts +0 -23
  100. package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail.component.d.ts +0 -25
  101. /package/dist/types/app/components/{planning-result → planning-trigger}/planning-trigger.component.d.ts +0 -0
  102. /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,212 @@
1
+ /**
2
+ * Type definitions for the generic InlineTableComponent.
3
+ *
4
+ * Usage pattern (the "uischema" concept):
5
+ * 1. Define an `InlineTableConfig` object describing your columns and labels.
6
+ * 2. Pass it to `<app-inline-table [config]="…" [rows]="…">`.
7
+ * 3. For business-logic side-effects (e.g. auto-populating fields on selection),
8
+ * pass an optional `rowTransform` function — the generic component knows nothing
9
+ * about domain rules.
10
+ *
11
+ * To reuse the table for a different domain, create a new config file and a thin
12
+ * wrapper component. Only the config changes; the rendering component stays the same.
13
+ */
14
+ import type { BaseCodeListEntry } from '../../jsonforms/shared/option-sources/code-lists';
15
+ /** Supported cell widget types. Extend with new literal types as needed.
16
+ * 'readonly' renders the resolved value as plain text (no input) — for columns
17
+ * that are fully derived from other fields and must not be user-editable.
18
+ * 'checkbox' renders a boolean mat-checkbox bound to a true/false row field.
19
+ * 'subrows' renders an expandable editor for a nested list of key/percentage
20
+ * pairs (e.g. manureDerivation[]) — see `InlineSubrowsConfig`. */
21
+ export type InlineCellType = 'select' | 'number' | 'text' | 'readonly' | 'checkbox' | 'subrows';
22
+ /**
23
+ * Per-cell validation resolver — returns a translated error message to display
24
+ * under the cell, or `null` when the cell is valid. Passed as the `cellError`
25
+ * input of InlineTableComponent for domain tables that bypass JSONForms/AJV
26
+ * (inline tables are not schema-validated, so business rules like percentage
27
+ * caps must be surfaced visually through this hook).
28
+ */
29
+ export type InlineCellErrorResolver = (row: Record<string, unknown>, col: InlineColumnDef) => string | null;
30
+ /**
31
+ * Configuration for a `type: 'subrows'` column — an expandable editor for a nested
32
+ * array of `{ key, value }` entries (e.g. manureDerivation: zoologicalAnimal +
33
+ * percentageAllocation). The collapsed cell shows a joined summary; expanding it
34
+ * opens a floating panel with one select + number input per entry, an add button,
35
+ * and a total indicator (green when the sum matches `expectedTotal`).
36
+ */
37
+ export interface InlineSubrowsConfig {
38
+ /** Path to the nested array on the row object (e.g. `'manureDerivation'`). */
39
+ arrayPath: string;
40
+ /** Field holding the code-list key in each sub-entry (e.g. `'zoologicalAnimal'`). */
41
+ keyField: string;
42
+ /** Key into the shared `CODE_LISTS` map for the key select options. */
43
+ keyCodeListKey: string;
44
+ /** i18n key for the key sub-column header inside the panel. */
45
+ keyLabelKey: string;
46
+ /** Field holding the numeric share in each sub-entry (e.g. `'percentageAllocation'`). */
47
+ valueField: string;
48
+ /** i18n key for the value sub-column header inside the panel. */
49
+ valueLabelKey: string;
50
+ /** i18n key for the "add sub-entry" button label. */
51
+ addLabelKey: string;
52
+ /** i18n key for the expand toggle label (collapsed state). */
53
+ expandLabelKey: string;
54
+ /** i18n key for the collapse toggle label (expanded state). */
55
+ collapseLabelKey: string;
56
+ /** i18n key for the total indicator label. */
57
+ totalLabelKey: string;
58
+ /** Expected sum of the value fields (e.g. 100) — the indicator turns green on exact
59
+ * match (no more, no less) and entered values are clamped so the sum never exceeds it. */
60
+ expectedTotal?: number;
61
+ /** Min for the value number input (default 0). */
62
+ valueMin?: number;
63
+ /** Max for the value number input (default: none). */
64
+ valueMax?: number;
65
+ }
66
+ /**
67
+ * Definition for a single column in an inline table.
68
+ *
69
+ * Each definition drives both the column header and the cell widget for that column.
70
+ * This is the per-column equivalent of a JSONForms uischema Control element.
71
+ */
72
+ export interface InlineColumnDef {
73
+ /**
74
+ * Unique key for this column.
75
+ * - For simple flat fields: also the property path on the row object.
76
+ * - For nested sub-array columns: used as a stable identifier; actual read/write
77
+ * path is determined by `arrayPath` + `arrayKeyField` + `arrayKeyValue`.
78
+ */
79
+ key: string;
80
+ /**
81
+ * Header label source.
82
+ * - By default treated as an i18n translation key (e.g. `'fieldSpreading.fields.fertiliser.product'`).
83
+ * - Set `labelLiteral: true` to use the value verbatim (e.g. `'Ntot (%)'`).
84
+ */
85
+ labelKey: string;
86
+ /**
87
+ * When `true`, `labelKey` is rendered as a plain string rather than passed through
88
+ * the translation service. Use this for labels that are already final (e.g. chemical
89
+ * formulas such as "P₂O₅ (%)").
90
+ * Default: `false`.
91
+ */
92
+ labelLiteral?: boolean;
93
+ /** Widget rendered inside the cell. */
94
+ type: InlineCellType;
95
+ /**
96
+ * For `type: 'select'` — key into the shared `CODE_LISTS` map.
97
+ * The generic component resolves the option list and their localized labels
98
+ * automatically via the localized `descriptor.designation_<suffix>` convention.
99
+ */
100
+ codeListKey?: string;
101
+ /**
102
+ * For `type: 'select'` — how to display an option's label in the dropdown.
103
+ * - `'label'` (default): use the localized `descriptor.designation_<suffix>` — best for named products.
104
+ * - `'id'`: use `String(entry.id)` verbatim — best for codes that are already
105
+ * human-readable (e.g. unit codes like "kg", "t", "l").
106
+ */
107
+ optionDisplay?: 'label' | 'id';
108
+ /**
109
+ * For `type: 'select'` — optional per-row narrowing of the code-list options,
110
+ * e.g. to restrict the product list based on another cell of the same row.
111
+ * Evaluated for every option of every row, so keep it cheap.
112
+ */
113
+ optionsFilter?: (entry: BaseCodeListEntry, row: Record<string, unknown>) => boolean;
114
+ /**
115
+ * For `type: 'select'` — resolve an option's label through an i18n key instead of the
116
+ * master-data descriptor (for literal option lists whose labels live in the locales,
117
+ * e.g. a row-type selector). Takes precedence over `optionDisplay`.
118
+ */
119
+ optionLabelKey?: (entry: BaseCodeListEntry) => string;
120
+ /**
121
+ * Optional i18n key for an explanatory tooltip shown via an info icon next to
122
+ * the column header (e.g. to explain a checkbox whose effect is not obvious).
123
+ * Omit for columns that need no extra explanation.
124
+ */
125
+ tooltipKey?: string;
126
+ /**
127
+ * CSS grid column-sizing token, e.g. `'minmax(140px, 2fr)'` or `'84px'`.
128
+ * These values are joined to build the `grid-template-columns` style on the table.
129
+ * Defaults to `'1fr'` when omitted.
130
+ */
131
+ width?: string;
132
+ /** Minimum allowed value — sets the `min` attribute (type `'number'` only). */
133
+ min?: number;
134
+ /** Maximum allowed value — sets the `max` attribute (type `'number'` only). */
135
+ max?: number;
136
+ /**
137
+ * `step` attribute value (type `'number'` only).
138
+ * Defaults to `'any'` when omitted, allowing any decimal.
139
+ */
140
+ step?: string;
141
+ /**
142
+ * Custom cell-value resolver — takes precedence over the default read path.
143
+ * Use this for `type: 'readonly'` columns whose value is derived from master
144
+ * data or other cells (e.g. a standard yield looked up from the selected crop)
145
+ * and therefore does not live on the row object.
146
+ */
147
+ valueResolver?: (row: Record<string, unknown>) => unknown;
148
+ /**
149
+ * Per-row disabling of the cell widget (e.g. grey out the yield input when the
150
+ * selected crop does not permit yield input). Evaluated per row, keep it cheap.
151
+ */
152
+ disabledForRow?: (row: Record<string, unknown>) => boolean;
153
+ /**
154
+ * Sub-array navigation config — for columns whose value lives inside a nested array
155
+ * on the row object (e.g. `ingredient[].quantity`).
156
+ *
157
+ * When all four sub-fields are set, the component:
158
+ * - **reads** `row[arrayPath].find(e => e[arrayKeyField] === arrayKeyValue)[arrayValueField]`
159
+ * - **writes** back immutably into that same slot
160
+ *
161
+ * Example — "Ntot %" column that reads `row.ingredient[{molecularFormula:'Ntot'}].quantity`:
162
+ * ```
163
+ * arrayPath: 'ingredient'
164
+ * arrayKeyField: 'molecularFormula'
165
+ * arrayKeyValue: 'Ntot'
166
+ * arrayValueField: 'quantity'
167
+ * ```
168
+ */
169
+ arrayPath?: string;
170
+ arrayKeyField?: string;
171
+ arrayKeyValue?: string;
172
+ arrayValueField?: string;
173
+ /**
174
+ * Sub-rows editor config — required when `type: 'subrows'`, ignored otherwise.
175
+ * Drives the expandable key/percentage pair editor (see `InlineSubrowsConfig`).
176
+ */
177
+ subrows?: InlineSubrowsConfig;
178
+ }
179
+ /**
180
+ * Full configuration for one inline-table instance — the "uischema" equivalent.
181
+ *
182
+ * Creating a table for a new domain means defining one `InlineTableConfig` object
183
+ * (and an optional `rowTransform` for business logic); the generic component handles
184
+ * all layout, rendering, and data binding.
185
+ */
186
+ export interface InlineTableConfig {
187
+ /** Ordered list of column definitions — determines column count and order. */
188
+ columns: InlineColumnDef[];
189
+ /** i18n key for the section heading (`<h2>`). */
190
+ titleKey: string;
191
+ /**
192
+ * i18n key for the section description paragraph.
193
+ * Omit (or set to `undefined`) to hide the description.
194
+ */
195
+ descriptionKey?: string;
196
+ /** i18n key for the "Add entry" dashed-button label. */
197
+ addLabelKey: string;
198
+ /** i18n key for the empty-state primary text (shown when `rows` is empty). */
199
+ emptyLabelKey: string;
200
+ /**
201
+ * i18n key for the empty-state hint text (secondary line).
202
+ * Omit to show only the primary text.
203
+ */
204
+ emptyHintKey?: string;
205
+ /**
206
+ * Factory function invoked when the user clicks "Add entry".
207
+ * Should return a fresh row object with sensible defaults (e.g. pre-initialised
208
+ * sub-arrays such as `ingredient`).
209
+ * Defaults to `() => ({})` when omitted.
210
+ */
211
+ createRow?: () => Record<string, unknown>;
212
+ }
@@ -0,0 +1,34 @@
1
+ import { SuisseBilanzMetricsService } from '../suissebilanz-dashboard/suissebilanz-metrics.service';
2
+ import { GaugeStatus } from '../gauge-arc/gauge-arc.component';
3
+ /** Compact row + expandable detail for the latest planning-balance result. */
4
+ export declare class PlanningResultRowComponent {
5
+ protected readonly STATUS_ICONS: Record<GaugeStatus, string>;
6
+ private readonly planning;
7
+ private readonly naebi;
8
+ private readonly metadataSvc;
9
+ protected readonly metricsService: SuisseBilanzMetricsService;
10
+ protected readonly expanded: import("@angular/core").WritableSignal<boolean>;
11
+ protected readonly isLoading: import("@angular/core").Signal<boolean>;
12
+ protected readonly hasResult: import("@angular/core").Signal<boolean>;
13
+ protected readonly title: import("@angular/core").Signal<string>;
14
+ private readonly result;
15
+ /** Derived overall status: worst status across all nutrient metrics. */
16
+ protected readonly overallStatus: import("@angular/core").Signal<GaugeStatus>;
17
+ /** Compact chips for the 4 nutrient metrics + rendement, with kg values merged in. */
18
+ protected readonly nutrientChips: import("@angular/core").Signal<{
19
+ key: string;
20
+ label: string;
21
+ pct: number | null;
22
+ kg: number | null;
23
+ dt: number | null;
24
+ status: GaugeStatus;
25
+ }[]>;
26
+ /** Areas in ha (converted from m²). */
27
+ protected readonly areas: import("@angular/core").Signal<{
28
+ sau: number;
29
+ sfe: number;
30
+ to: number;
31
+ } | null>;
32
+ protected refresh(): void;
33
+ protected toggleDetail(): void;
34
+ }
@@ -1,4 +1,13 @@
1
+ import { ErrorObject } from 'ajv';
2
+ import { PageId } from '../../core/navigation/navigation.service';
1
3
  import { PlanningBalanceService } from '../../core/planning/planning-balance.service';
2
4
  export declare class ResultsPageComponent {
5
+ readonly currentPage: import("@angular/core").InputSignal<PageId>;
6
+ readonly onNavigate: import("@angular/core").InputSignal<(page: PageId) => void>;
7
+ readonly onErrorSelected: import("@angular/core").InputSignal<(error: ErrorObject) => void>;
8
+ readonly onSubmitSuccess: import("@angular/core").InputSignal<() => void>;
3
9
  protected readonly planning: PlanningBalanceService;
10
+ protected readonly selectedTabIndex: import("@angular/core").WritableSignal<number>;
11
+ constructor();
12
+ protected onTabChange(index: number): void;
4
13
  }
@@ -1,6 +1,6 @@
1
1
  import { SafeUrl } from '@angular/platform-browser';
2
2
  import { PlanningBalanceService } from '../../core/planning/planning-balance.service';
3
- import { GaugeStatus } from './gauge-arc.component';
3
+ import { GaugeStatus } from '../gauge-arc/gauge-arc.component';
4
4
  import { SuisseBilanzMetricsService } from './suissebilanz-metrics.service';
5
5
  /**
6
6
  * Dashboard card displaying the 5 main SuisseBilanz metrics as semicircular
@@ -11,11 +11,19 @@ import { SuisseBilanzMetricsService } from './suissebilanz-metrics.service';
11
11
  */
12
12
  export declare class SuisseBilanzDashboardComponent {
13
13
  readonly embedded: import("@angular/core").InputSignal<boolean>;
14
+ /** Shows the official PDF download link even when `embedded` (header hidden). */
15
+ readonly showPdfButton: import("@angular/core").InputSignal<boolean>;
14
16
  protected readonly planning: PlanningBalanceService;
15
17
  private readonly sanitizer;
16
18
  protected readonly metricsService: SuisseBilanzMetricsService;
17
19
  private readonly result;
18
- protected readonly metrics: import("@angular/core").Signal<import("./gauge-arc.component").GaugeMetric[]>;
20
+ protected readonly metrics: import("@angular/core").Signal<import("../gauge-arc/gauge-arc.component").GaugeMetric[]>;
21
+ /** Surface areas in ha, derived from the latest planning result. */
22
+ protected readonly surfaces: import("@angular/core").Signal<{
23
+ sau: number;
24
+ sfe: number;
25
+ to: number;
26
+ } | null>;
19
27
  protected readonly officialPdfUrl: import("@angular/core").Signal<SafeUrl | null>;
20
28
  private prevBlobUrl;
21
29
  private readonly blobCleanup;
@@ -1,4 +1,4 @@
1
- import { GaugeMetric } from './gauge-arc.component';
1
+ import { GaugeMetric } from '../gauge-arc/gauge-arc.component';
2
2
  /**
3
3
  * Shared source of truth for all SuisseBilanz metric view-models.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { GaugeMetric, GaugeStatus } from './gauge-arc.component';
2
- import { SuisseBilanzMetricsService } from './suissebilanz-metrics.service';
1
+ import { GaugeMetric, GaugeStatus } from '../gauge-arc/gauge-arc.component';
2
+ import { SuisseBilanzMetricsService } from '../suissebilanz-dashboard/suissebilanz-metrics.service';
3
3
  /**
4
4
  * Slim, always-visible metrics card placed above the workflow stepper.
5
5
  *
@@ -4,6 +4,7 @@ import { PlanningBalanceService } from '../../core/planning/planning-balance.ser
4
4
  * Final submission step: review validation status and submit the planning balance.
5
5
  */
6
6
  export declare class ValidationPageComponent {
7
+ readonly showHeader: import("@angular/core").InputSignal<boolean>;
7
8
  /** Navigation callback for validation error clicks — provided by App to keep routing logic centralised. */
8
9
  readonly onErrorSelected: import("@angular/core").InputSignal<(error: ErrorObject) => void>;
9
10
  /** Navigation callback triggered after a fresh successful planning submission. */
@@ -1 +1 @@
1
- export { DEFAULT_SUIBI_METADATA, type SubmissionStatus, type SuibiVersion, type SuibiMetadata } from '../../core/metadata/suibi-metadata.types';
1
+ export { DEFAULT_SUIBI_METADATA, DEFAULT_COMPUTATION_MODULES, type ComputationModules, type SubmissionStatus, type SuibiVersion, type SuibiMetadata } from '../../core/metadata/suibi-metadata.types';
@@ -1,9 +1,9 @@
1
- import { OnInit } from '@angular/core';
2
1
  import { JsonSchema, UISchemaElement } from '@jsonforms/core';
3
2
  import { SuibiMetadata } from '../../core/metadata/suibi-metadata.types';
4
- export declare class WelcomePageComponent implements OnInit {
3
+ export declare class WelcomePageComponent {
5
4
  private readonly i18n;
6
5
  private readonly metadataSvc;
6
+ private readonly naebi;
7
7
  startEvent: import("@angular/core").OutputEmitterRef<void>;
8
8
  metadataChange: import("@angular/core").OutputEmitterRef<SuibiMetadata>;
9
9
  private readonly baseSchema;
@@ -17,11 +17,13 @@ export declare class WelcomePageComponent implements OnInit {
17
17
  readonly localizedSchema: import("@angular/core").Signal<JsonSchema>;
18
18
  readonly localizedUi: import("@angular/core").Signal<UISchemaElement>;
19
19
  readonly jsonFormsData: import("@angular/core").Signal<{}>;
20
- ngOnInit(): void;
20
+ constructor();
21
21
  start(): void;
22
+ loadExampleData(): void;
22
23
  onMetadataChange(newValue: unknown): void;
23
24
  private normalizeJsonFormsPayload;
24
25
  private toMetadata;
26
+ private extractModules;
25
27
  private isSuibiVersion;
26
28
  private isSubmissionStatus;
27
29
  private isSameMetadata;
@@ -39,14 +39,11 @@ export declare class WorkflowStepperComponent {
39
39
  */
40
40
  readonly onNavigate: import("@angular/core").InputSignal<(page: PageId) => void>;
41
41
  private readonly validationSvc;
42
- private readonly planningSvc;
42
+ private readonly workflowPage;
43
43
  protected readonly pagesWithErrors: import("@angular/core").Signal<Set<PageId>>;
44
44
  protected readonly isOnWorkflowPage: import("@angular/core").Signal<boolean>;
45
- protected readonly hasPlanningResult: import("@angular/core").Signal<boolean>;
46
- protected readonly isResultsStepDisabled: import("@angular/core").Signal<boolean>;
47
45
  protected readonly clampedStepIndex: import("@angular/core").Signal<number>;
48
46
  protected onSelectedIndexChange(index: number): void;
49
47
  protected onStepperClick(event: MouseEvent): void;
50
48
  private navigateTo;
51
- private isStepDisabled;
52
49
  }
@@ -30,9 +30,7 @@ export declare class NaebiDataService {
30
30
  };
31
31
  stall: {
32
32
  stableSystem: string;
33
- stableCapacity: number;
34
33
  stableVentilationType: number;
35
- stableAirPurification: number;
36
34
  hasStableDeepLitter: boolean;
37
35
  hasStableManureBeltDrying: boolean;
38
36
  stableManureRemovalFrequency: number;
@@ -41,10 +39,6 @@ export declare class NaebiDataService {
41
39
  hasStableFeedingStationElevated: boolean;
42
40
  hasStableFloorSlopedUrineDrainage: boolean;
43
41
  hasYard: boolean;
44
- yardFeeding: number;
45
- yardFloorType: number;
46
- yardDays: number;
47
- yardHoursPerDay: number;
48
42
  };
49
43
  };
50
44
  hasImpexDerivedExcretion: boolean;
@@ -52,6 +46,7 @@ export declare class NaebiDataService {
52
46
  feeding: {
53
47
  fodderConsumption: number;
54
48
  concentratedFeedstuffConsumption: number;
49
+ concentratedFeedStuffConsumption: number;
55
50
  winterFeeding: {
56
51
  feedingRoutine: {
57
52
  typeOfFeedstuffProduct: string;
@@ -76,19 +71,14 @@ export declare class NaebiDataService {
76
71
  }[];
77
72
  storage: {
78
73
  stableStrawLitter: number;
79
- manureSupplyProportionStored: number;
80
74
  slurrySupplyProportionStored: number;
81
75
  createFacilitySpecificManureProduct: boolean;
82
76
  createFacilitySpecificSlurryProduct: boolean;
77
+ slurryTankQuantity: number;
83
78
  dilutionRatio: number;
84
- manurePit: {
85
- cover: number;
86
- manureFromAnimalStockStored: {
87
- manureDerivation: string;
88
- proportionStored: number;
89
- }[];
90
- }[];
79
+ manurePit: never[];
91
80
  slurryTank: {
81
+ descriptor: string;
92
82
  volumeInM3: number;
93
83
  depthInM: number;
94
84
  cover: number;
@@ -97,20 +87,7 @@ export declare class NaebiDataService {
97
87
  }[];
98
88
  };
99
89
  farmManureTrading: {
100
- supply: {
101
- quantity: number;
102
- typeOfManureRecyclingProduct: string;
103
- transactionUnit: string;
104
- manureDerivation: {
105
- zoologicalAnimal: string;
106
- percentageAllocation: number;
107
- }[];
108
- ingredient: {
109
- quantity: number;
110
- molecularFormula: string;
111
- unit: string;
112
- }[];
113
- }[];
90
+ supply: never[];
114
91
  dispense: {
115
92
  quantity: number;
116
93
  typeOfManureRecyclingProduct: string;
@@ -183,6 +160,12 @@ export declare class NaebiDataService {
183
160
  unit: string;
184
161
  }[];
185
162
  }[];
163
+ dispense: {
164
+ typeOfFeedstuffProduct: string;
165
+ quantity: number;
166
+ transactionUnit: string;
167
+ ingredient: never[];
168
+ }[];
186
169
  };
187
170
  cropFromNonFodderCropland: {
188
171
  typeOfFeedstuffProduct: string;
@@ -198,6 +181,17 @@ export declare class NaebiDataService {
198
181
  totalBalanceErrorMargin: number;
199
182
  };
200
183
  fieldCultivation: {
184
+ buildingZoneAreaSize: number;
185
+ outdoorVegetableMainCropAreaSize: number;
186
+ indoorVegetableMainCropAreaSize: number;
187
+ feedingOfCropHarvest: {
188
+ agronomicCropCategory: string;
189
+ effectiveYield: number;
190
+ }[];
191
+ dispenseOfCropHarvest: {
192
+ agronomicCropCategory: string;
193
+ effectiveYield: number;
194
+ }[];
201
195
  fodderCropland: ({
202
196
  agronomicCropCategory: string;
203
197
  isMainCrop: boolean;
@@ -216,12 +210,18 @@ export declare class NaebiDataService {
216
210
  isMainCrop: boolean;
217
211
  areaSize: number;
218
212
  yieldPerSquareMeasure: number;
213
+ hasLongTermYieldDivergence: boolean;
219
214
  }[];
220
215
  special: {
221
216
  agronomicCropCategory: string;
222
217
  userSpecificPlantName: string;
223
218
  isMainCrop: boolean;
224
219
  areaSize: number;
220
+ requirementCorrection: {
221
+ quantity: number;
222
+ molecularFormula: string;
223
+ unit: string;
224
+ }[];
225
225
  }[];
226
226
  };
227
227
  generateReport: boolean;
@@ -1,6 +1,5 @@
1
- import { ErrorHandler, Injector } from '@angular/core';
1
+ import { ErrorHandler } from '@angular/core';
2
2
  export declare class GlobalErrorHandler implements ErrorHandler {
3
- private injector;
4
- constructor(injector: Injector);
3
+ private readonly injector;
5
4
  handleError(error: any): void;
6
5
  }
@@ -1,5 +1,7 @@
1
1
  import { PipeTransform, Signal } from '@angular/core';
2
- export type Locale = 'en' | 'de';
2
+ export type Locale = 'en' | 'de' | 'fr' | 'it';
3
+ /** Suffix of master-data `descriptor` designation fields (e.g. `designation_fra`) for a locale. */
4
+ export declare function designationSuffix(locale: Locale): 'deu' | 'eng' | 'fra' | 'ita';
3
5
  export type JsonFormsTranslator = (key: string, defaultMessage: string | undefined, context: unknown) => string;
4
6
  export declare class I18nService {
5
7
  private readonly _locale;
@@ -8,13 +10,15 @@ export declare class I18nService {
8
10
  readonly jsonFormsI18n: Signal<{
9
11
  locale: Locale;
10
12
  translate: JsonFormsTranslator;
13
+ translateError: (error: unknown, translate: JsonFormsTranslator) => string;
11
14
  }>;
12
15
  setLocale(locale: Locale): void;
16
+ /** Returns true if the given string is a supported locale key. */
17
+ isValidLocale(value: string): value is Locale;
13
18
  t(key: string, defaultMessage?: string): string;
14
19
  }
15
20
  export declare class TranslatePipe implements PipeTransform {
16
- private readonly i18n;
17
21
  private readonly cache;
18
- constructor(i18n: I18nService);
22
+ private readonly i18n;
19
23
  transform(key: string, defaultMessage?: string): Signal<string>;
20
24
  }
@@ -0,0 +1,2 @@
1
+ export declare const frTranslations: Record<string, string>;
2
+ export type FrTranslationKeys = keyof typeof frTranslations;
@@ -0,0 +1,2 @@
1
+ export declare const itTranslations: Record<string, string>;
2
+ export type ItTranslationKeys = keyof typeof itTranslations;
@@ -26,5 +26,7 @@ export declare class MasterDataService {
26
26
  resolveCultivationCategory(code: string | null | undefined, locale?: Locale): string;
27
27
  resolveAgronomicCropCategory(code: string | null | undefined, locale?: Locale): string;
28
28
  resolveFeedstuffProduct(code: string | null | undefined, locale?: Locale): string;
29
+ resolveCover(id: number | string | null | undefined, locale?: Locale): string;
30
+ resolveMixingFrequency(id: number | string | null | undefined, locale?: Locale): string;
29
31
  }
30
32
  export {};
@@ -1,8 +1,18 @@
1
- export type SuibiVersion = '1.19' | '1.20';
1
+ export type SuibiVersion = 'v2.0';
2
2
  export type SubmissionStatus = 'draft' | 'submitted' | 'final';
3
+ /** Which computation modules are active for this dossier. */
4
+ export interface ComputationModules {
5
+ suisseBilanz: boolean;
6
+ gmf: boolean;
7
+ nh3: boolean;
8
+ impex: boolean;
9
+ linear: boolean;
10
+ }
11
+ export declare const DEFAULT_COMPUTATION_MODULES: ComputationModules;
3
12
  export interface SuibiMetadata {
4
13
  title: string;
5
14
  suibiVersion: SuibiVersion;
6
15
  status: SubmissionStatus;
16
+ modules: ComputationModules;
7
17
  }
8
18
  export declare const DEFAULT_SUIBI_METADATA: SuibiMetadata;
@@ -1,8 +1,13 @@
1
- export type PageId = 'welcome' | 'animal_stock' | 'data_preview' | 'storage' | 'field_spreading' | 'farm_manure_trading' | 'field_cultivation' | 'validation' | 'results';
1
+ export type PageId = 'welcome' | 'animal_stock' | 'data_preview' | 'storage' | 'field_spreading' | 'farm_manure_trading' | 'fodder' | 'field_cultivation' | 'validation' | 'results';
2
2
  export type AnimalStockCategory = 'base' | 'formOfDetention' | 'feeding';
3
3
  export type FarmManureTradingMode = 'supply' | 'dispense';
4
4
  export type FarmManureTradingCategory = 'general' | 'derivation' | 'ingredients';
5
+ export type FodderMode = 'supply' | 'dispense' | 'non_fodder_cropland';
6
+ export type FodderCategory = 'general' | 'ingredients';
5
7
  export type FieldSpreadingCategory = 'general' | 'fertiliser' | 'recycling';
8
+ export type FieldCultivationTab = 'general' | 'fodderCropland' | 'arableLand' | 'special';
9
+ export type StorageTab = 'manure' | 'slurry';
10
+ export type StorageEntryType = 'manure_pit' | 'slurry_tank';
6
11
  /**
7
12
  * NavigationService
8
13
  * Global reactive store for application routing and deep-link state.
@@ -38,6 +43,26 @@ export declare class NavigationService {
38
43
  mode: FarmManureTradingMode;
39
44
  index: number;
40
45
  } | null>;
46
+ /** Selected fodder detail context (mode + index) */
47
+ readonly selectedFodderDetail: import("@angular/core").WritableSignal<{
48
+ mode: FodderMode;
49
+ index: number;
50
+ } | null>;
51
+ /** Selected field cultivation detail context (tab + index) */
52
+ readonly selectedFieldCultivationDetail: import("@angular/core").WritableSignal<{
53
+ tab: Exclude<FieldCultivationTab, "general">;
54
+ index: number;
55
+ } | null>;
56
+ /** Selected storage detail context (type + index) */
57
+ readonly selectedStorageDetail: import("@angular/core").WritableSignal<{
58
+ type: StorageEntryType;
59
+ index: number;
60
+ } | null>;
61
+ /** Selected field spreading row context (category/tab + row index) — used by validation deep-links */
62
+ readonly selectedFieldSpreadingDetail: import("@angular/core").WritableSignal<{
63
+ category: FieldSpreadingCategory;
64
+ index: number;
65
+ } | null>;
41
66
  /** True if currently viewing animal stock detail (not list) */
42
67
  readonly isAnimalStockDetailView: import("@angular/core").Signal<boolean>;
43
68
  /** True if currently on animal stock page (list or detail) */
@@ -58,7 +83,15 @@ export declare class NavigationService {
58
83
  navigateToAnimalStockDetail(index: number, category?: AnimalStockCategory): void;
59
84
  navigateToFarmManureTradingDetail(mode: FarmManureTradingMode, index: number, category?: FarmManureTradingCategory): void;
60
85
  navigateToFarmManureTradingList(): void;
86
+ navigateToFodderDetail(mode: FodderMode, index: number, category?: FodderCategory): void;
87
+ navigateToFodderList(): void;
61
88
  navigateToFieldSpreading(category?: FieldSpreadingCategory): void;
89
+ /** Deep-link to a specific row of a field spreading tab (e.g. from a validation error). */
90
+ navigateToFieldSpreadingDetail(category: FieldSpreadingCategory, index: number): void;
91
+ navigateToFieldCultivationDetail(tab: Exclude<FieldCultivationTab, 'general'>, index: number): void;
92
+ navigateToFieldCultivationList(tab?: FieldCultivationTab): void;
93
+ navigateToStorageDetail(type: StorageEntryType, index: number): void;
94
+ navigateToStorageList(tab?: StorageTab): void;
62
95
  /**
63
96
  * Set active category/tab for current page (without changing page/entry).
64
97
  * Generic method supporting any page's categorization navigation.
@@ -11,6 +11,7 @@ export type PlanningEndpoint = 'ebilanz' | 'blw';
11
11
  */
12
12
  export declare class PlanningBalanceService {
13
13
  private readonly http;
14
+ private readonly metadataSvc;
14
15
  private readonly _value;
15
16
  private readonly _error;
16
17
  private readonly _isLoading;
@@ -32,6 +33,14 @@ export declare class PlanningBalanceService {
32
33
  };
33
34
  readonly selectedEndpoint: import("@angular/core").Signal<PlanningEndpoint>;
34
35
  setSelectedEndpoint(endpoint: PlanningEndpoint): void;
36
+ /**
37
+ * Builds the exact payload posted to the planning API: calculationVersion stamped from
38
+ * the current metadata, `nutrientCycle.generateReport` forced to true (the PDF report
39
+ * must always be requested on submission), empty ingredient/routine slots stripped,
40
+ * null optional fields and host-only fields removed, custom display units converted
41
+ * to base units.
42
+ */
43
+ buildApiPayload(data: NaebiData): NaebiData;
35
44
  /** Fire a new planning-balance request with the current NAEBI data payload. */
36
45
  runPlanning(data: NaebiData, endpoint?: PlanningEndpoint): void;
37
46
  }