@agridea/suibi-module 0.1.0-preview.6e162c8 → 0.1.0-preview.6e1d5e8
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 +70 -70
- package/dist/elements/browser/suibi-module-latest.js +70 -70
- package/dist/elements/browser/suibi-module.v0.1.0-preview.6e1d5e8.js +78 -0
- package/dist/elements/browser/version.txt +1 -1
- package/dist/types/app/components/data-preview/data-preview.component.d.ts +1 -2
- package/dist/types/app/components/{suissebilanz-dashboard → gauge-arc}/gauge-arc.component.d.ts +2 -0
- package/dist/types/app/{header-bar.d.ts → components/header-bar/header-bar.component.d.ts} +2 -2
- package/dist/types/app/components/inline-table/inline-table.component.d.ts +100 -0
- package/dist/types/app/components/inline-table/inline-table.types.d.ts +127 -0
- package/dist/types/app/components/planning-result-row/planning-result-row.component.d.ts +34 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +8 -2
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-metrics.service.d.ts +1 -1
- package/dist/types/app/components/{suissebilanz-dashboard → suissebilanz-minibar}/suissebilanz-minibar.component.d.ts +2 -2
- 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/core/data/naebi-data.service.d.ts +4 -29
- package/dist/types/app/core/error/global-error-handler.d.ts +2 -3
- package/dist/types/app/core/i18n/i18n.service.d.ts +4 -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/metadata/suibi-metadata.types.d.ts +11 -1
- package/dist/types/app/core/planning/planning-balance.service.d.ts +1 -0
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +4 -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/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 +36 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail.component.d.ts +7 -8
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-list.component.d.ts +5 -8
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts +8 -9
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts +6 -7
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail.component.d.ts +2 -1
- package/dist/types/app/nutrient-cycle/field-cultivation/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +38 -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 +16 -3
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-detail.component.d.ts +8 -9
- package/dist/types/app/nutrient-cycle/fodder/fodder-list.component.d.ts +6 -7
- package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail.component.d.ts +1 -1
- package/dist/types/app/nutrient-cycle/fodder/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/storage/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/storage/storage-general.component.d.ts +1 -1
- package/dist/types/app/nutrient-cycle/storage/storage-list.component.d.ts +3 -0
- package/dist/types/app/nutrient-cycle/storage/storage-master-detail.component.d.ts +4 -3
- package/package.json +68 -17
- package/dist/elements/browser/suibi-module.v0.1.0-preview.6e162c8.js +0 -78
- /package/dist/elements/browser/{suibi-module.v0.1.0-preview.6e162c8.css → suibi-module.v0.1.0-preview.6e1d5e8.css} +0 -0
- /package/dist/types/app/components/{planning-result → planning-trigger}/planning-trigger.component.d.ts +0 -0
- /package/dist/types/app/{core/validation/validation-errors-panel.d.ts → components/validation-errors-panel/validation-errors-panel.component.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.0-preview.
|
|
1
|
+
0.1.0-preview.6e1d5e8 6e1d5e8
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { NaebiDataService } from '../../core/data/naebi-data.service';
|
|
2
2
|
import { PlanningBalanceService } from '../../core/planning/planning-balance.service';
|
|
3
3
|
export declare class DataPreviewComponent {
|
|
4
|
-
readonly naebi: NaebiDataService;
|
|
5
4
|
private readonly host;
|
|
6
5
|
private readonly emitter;
|
|
7
6
|
readonly planning: PlanningBalanceService;
|
|
7
|
+
readonly naebi: NaebiDataService;
|
|
8
8
|
readonly metadataPreview: import("@angular/core").Signal<import("../../../public-api").SuibiDataEventMetadata>;
|
|
9
|
-
constructor(naebi: NaebiDataService);
|
|
10
9
|
setPlanningEndpoint(value: string | null): void;
|
|
11
10
|
emitData(): void;
|
|
12
11
|
}
|
package/dist/types/app/components/{suissebilanz-dashboard → gauge-arc}/gauge-arc.component.d.ts
RENAMED
|
@@ -18,6 +18,8 @@ export interface GaugeMetric {
|
|
|
18
18
|
maxGauge: number;
|
|
19
19
|
/** Short range description shown below the arc (e.g. '< 100 %'). */
|
|
20
20
|
rangeLabel: string;
|
|
21
|
+
/** Raw quantity in kg (nutrients) or dt/ha (rendement) to display below the arc. */
|
|
22
|
+
kgValue?: number | null;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Reusable semicircular SVG arc gauge.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Locale } from '
|
|
2
|
-
import { PageId } from '
|
|
1
|
+
import { Locale } from '../../core/i18n/i18n.service';
|
|
2
|
+
import { PageId } from '../../core/navigation/navigation.service';
|
|
3
3
|
/**
|
|
4
4
|
* HeaderBarComponent
|
|
5
5
|
* Footer actions for quick access to data preview and the current save state.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BaseCodeListEntry } from '../../jsonforms/shared/option-sources/code-lists';
|
|
2
|
+
import { InlineColumnDef, InlineTableConfig } from './inline-table.types';
|
|
3
|
+
/**
|
|
4
|
+
* InlineTableComponent — generic inline-editable table for array-of-objects data.
|
|
5
|
+
*
|
|
6
|
+
* This component is intentionally domain-agnostic. All column structure, labels,
|
|
7
|
+
* and section text are driven by an `InlineTableConfig` input (the "uischema").
|
|
8
|
+
* Domain-specific side-effects (e.g. auto-populating fields when a dropdown changes)
|
|
9
|
+
* are injected via the optional `rowTransform` function input.
|
|
10
|
+
*
|
|
11
|
+
* ## Usage
|
|
12
|
+
* ```html
|
|
13
|
+
* <app-inline-table
|
|
14
|
+
* [config]="myTableConfig"
|
|
15
|
+
* [rows]="myRows()"
|
|
16
|
+
* [rowTransform]="myTransform"
|
|
17
|
+
* (rowsChange)="onRowsChange($event)"
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ## Extending for a new domain
|
|
22
|
+
* 1. Create a new `InlineTableConfig` constant (the column config file).
|
|
23
|
+
* 2. Optionally create a thin wrapper component that provides the config and
|
|
24
|
+
* a `rowTransform` arrow-function.
|
|
25
|
+
* 3. No changes to this component are needed.
|
|
26
|
+
*/
|
|
27
|
+
export declare class InlineTableComponent {
|
|
28
|
+
private readonly i18n;
|
|
29
|
+
/** Table configuration — columns, labels, and the row factory. Acts as the "uischema". */
|
|
30
|
+
readonly config: import("@angular/core").InputSignal<InlineTableConfig>;
|
|
31
|
+
/** Current array of row objects. Each key maps to a column's `key` or sub-array path. */
|
|
32
|
+
readonly rows: import("@angular/core").InputSignal<Record<string, unknown>[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Emitted with the complete updated array after any cell change, row add, or row remove.
|
|
35
|
+
* The parent component is responsible for persisting the new value (e.g. via signal).
|
|
36
|
+
*/
|
|
37
|
+
readonly rowsChange: import("@angular/core").OutputEmitterRef<Record<string, unknown>[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Optional business-logic transform applied after every cell edit — before emission.
|
|
40
|
+
*
|
|
41
|
+
* Signature: `(changedKey, newValue, updatedRow) => transformedRow`
|
|
42
|
+
*
|
|
43
|
+
* - `changedKey`: the `InlineColumnDef.key` of the edited column.
|
|
44
|
+
* - `newValue`: the raw new value (string, number, or null).
|
|
45
|
+
* - `updatedRow`: the row object already reflecting the edit.
|
|
46
|
+
* - Return the row (possibly further mutated) that should be stored.
|
|
47
|
+
*
|
|
48
|
+
* Use this for cross-field side-effects such as pre-populating nutrient % columns
|
|
49
|
+
* when a product is selected. For forms without such logic, omit this input.
|
|
50
|
+
*/
|
|
51
|
+
readonly rowTransform: import("@angular/core").InputSignal<((changedKey: string, newValue: unknown, row: Record<string, unknown>) => Record<string, unknown>) | null>;
|
|
52
|
+
/** Extracts a px value from a grid-format width string (e.g. 'minmax(120px, 1fr)' → '120px'). */
|
|
53
|
+
colMinWidth(width?: string): string;
|
|
54
|
+
/** Total table width = sum of all column px values + 40px for the delete column. */
|
|
55
|
+
readonly tableWidth: import("@angular/core").Signal<string>;
|
|
56
|
+
/** Grid template columns string for CSS grid layout. */
|
|
57
|
+
readonly gridTemplateColumns: import("@angular/core").Signal<string>;
|
|
58
|
+
readonly sectionTitle: import("@angular/core").Signal<string>;
|
|
59
|
+
readonly sectionDescription: import("@angular/core").Signal<string>;
|
|
60
|
+
readonly addLabel: import("@angular/core").Signal<string>;
|
|
61
|
+
readonly emptyLabel: import("@angular/core").Signal<string>;
|
|
62
|
+
readonly emptyHint: import("@angular/core").Signal<string>;
|
|
63
|
+
/** Returns the option array for a select column from the shared CODE_LISTS map. */
|
|
64
|
+
getOptions(col: InlineColumnDef): BaseCodeListEntry[];
|
|
65
|
+
/**
|
|
66
|
+
* Returns the localized display label for a code-list option.
|
|
67
|
+
* - `optionDisplay: 'id'`: returns `String(entry.id)` (e.g. "kg", "t").
|
|
68
|
+
* - default (`'label'`): uses `descriptor.designation_eng / designation_deu`;
|
|
69
|
+
* falls back to `String(entry.id)` when no descriptor is present.
|
|
70
|
+
*/
|
|
71
|
+
optionLabel(entry: BaseCodeListEntry, col: InlineColumnDef): string;
|
|
72
|
+
/**
|
|
73
|
+
* Reads the current cell value for a column from a row object.
|
|
74
|
+
*
|
|
75
|
+
* - Simple field: returns `row[col.key]`.
|
|
76
|
+
* - Sub-array field: navigates `row[arrayPath]`, finds the entry matching
|
|
77
|
+
* `arrayKeyField === arrayKeyValue`, and returns `entry[arrayValueField]`.
|
|
78
|
+
*/
|
|
79
|
+
getValue(row: Record<string, unknown>, col: InlineColumnDef): unknown;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a new row with the column's value updated (immutably).
|
|
82
|
+
* Handles both flat field assignment and nested sub-array mutation.
|
|
83
|
+
*/
|
|
84
|
+
private setValue;
|
|
85
|
+
/** Called when a `mat-select` selection changes. */
|
|
86
|
+
onSelectChange(rowIdx: number, col: InlineColumnDef, value: unknown): void;
|
|
87
|
+
/** Called on `(change)` of a number `<input>` — parses the string value and guards NaN. */
|
|
88
|
+
onNumberChange(rowIdx: number, col: InlineColumnDef, event: Event): void;
|
|
89
|
+
/** Called on `(change)` of a text `<input>`. */
|
|
90
|
+
onTextChange(rowIdx: number, col: InlineColumnDef, event: Event): void;
|
|
91
|
+
/** Appends a blank row produced by `config.createRow()`. */
|
|
92
|
+
addRow(): void;
|
|
93
|
+
/** Removes the row at `idx` from the array. */
|
|
94
|
+
removeRow(idx: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* Core change handler: sets the new value on the row, applies the optional
|
|
97
|
+
* `rowTransform` for any cross-field side-effects, then emits the updated array.
|
|
98
|
+
*/
|
|
99
|
+
private _applyChange;
|
|
100
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
/** Supported cell widget types. Extend with new literal types as needed. */
|
|
15
|
+
export type InlineCellType = 'select' | 'number' | 'text';
|
|
16
|
+
/**
|
|
17
|
+
* Definition for a single column in an inline table.
|
|
18
|
+
*
|
|
19
|
+
* Each definition drives both the column header and the cell widget for that column.
|
|
20
|
+
* This is the per-column equivalent of a JSONForms uischema Control element.
|
|
21
|
+
*/
|
|
22
|
+
export interface InlineColumnDef {
|
|
23
|
+
/**
|
|
24
|
+
* Unique key for this column.
|
|
25
|
+
* - For simple flat fields: also the property path on the row object.
|
|
26
|
+
* - For nested sub-array columns: used as a stable identifier; actual read/write
|
|
27
|
+
* path is determined by `arrayPath` + `arrayKeyField` + `arrayKeyValue`.
|
|
28
|
+
*/
|
|
29
|
+
key: string;
|
|
30
|
+
/**
|
|
31
|
+
* Header label source.
|
|
32
|
+
* - By default treated as an i18n translation key (e.g. `'fieldSpreading.fields.fertiliser.product'`).
|
|
33
|
+
* - Set `labelLiteral: true` to use the value verbatim (e.g. `'Ntot (%)'`).
|
|
34
|
+
*/
|
|
35
|
+
labelKey: string;
|
|
36
|
+
/**
|
|
37
|
+
* When `true`, `labelKey` is rendered as a plain string rather than passed through
|
|
38
|
+
* the translation service. Use this for labels that are already final (e.g. chemical
|
|
39
|
+
* formulas such as "P₂O₅ (%)").
|
|
40
|
+
* Default: `false`.
|
|
41
|
+
*/
|
|
42
|
+
labelLiteral?: boolean;
|
|
43
|
+
/** Widget rendered inside the cell. */
|
|
44
|
+
type: InlineCellType;
|
|
45
|
+
/**
|
|
46
|
+
* For `type: 'select'` — key into the shared `CODE_LISTS` map.
|
|
47
|
+
* The generic component resolves the option list and their localized labels
|
|
48
|
+
* automatically via the `descriptor.designation_eng / designation_deu` convention.
|
|
49
|
+
*/
|
|
50
|
+
codeListKey?: string;
|
|
51
|
+
/**
|
|
52
|
+
* For `type: 'select'` — how to display an option's label in the dropdown.
|
|
53
|
+
* - `'label'` (default): use `descriptor.designation_eng/deu` — best for named products.
|
|
54
|
+
* - `'id'`: use `String(entry.id)` verbatim — best for codes that are already
|
|
55
|
+
* human-readable (e.g. unit codes like "kg", "t", "l").
|
|
56
|
+
*/
|
|
57
|
+
optionDisplay?: 'label' | 'id';
|
|
58
|
+
/**
|
|
59
|
+
* CSS grid column-sizing token, e.g. `'minmax(140px, 2fr)'` or `'84px'`.
|
|
60
|
+
* These values are joined to build the `grid-template-columns` style on the table.
|
|
61
|
+
* Defaults to `'1fr'` when omitted.
|
|
62
|
+
*/
|
|
63
|
+
width?: string;
|
|
64
|
+
/** Minimum allowed value — sets the `min` attribute (type `'number'` only). */
|
|
65
|
+
min?: number;
|
|
66
|
+
/** Maximum allowed value — sets the `max` attribute (type `'number'` only). */
|
|
67
|
+
max?: number;
|
|
68
|
+
/**
|
|
69
|
+
* `step` attribute value (type `'number'` only).
|
|
70
|
+
* Defaults to `'any'` when omitted, allowing any decimal.
|
|
71
|
+
*/
|
|
72
|
+
step?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Sub-array navigation config — for columns whose value lives inside a nested array
|
|
75
|
+
* on the row object (e.g. `ingredient[].quantity`).
|
|
76
|
+
*
|
|
77
|
+
* When all four sub-fields are set, the component:
|
|
78
|
+
* - **reads** `row[arrayPath].find(e => e[arrayKeyField] === arrayKeyValue)[arrayValueField]`
|
|
79
|
+
* - **writes** back immutably into that same slot
|
|
80
|
+
*
|
|
81
|
+
* Example — "Ntot %" column that reads `row.ingredient[{molecularFormula:'Ntot'}].quantity`:
|
|
82
|
+
* ```
|
|
83
|
+
* arrayPath: 'ingredient'
|
|
84
|
+
* arrayKeyField: 'molecularFormula'
|
|
85
|
+
* arrayKeyValue: 'Ntot'
|
|
86
|
+
* arrayValueField: 'quantity'
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
arrayPath?: string;
|
|
90
|
+
arrayKeyField?: string;
|
|
91
|
+
arrayKeyValue?: string;
|
|
92
|
+
arrayValueField?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Full configuration for one inline-table instance — the "uischema" equivalent.
|
|
96
|
+
*
|
|
97
|
+
* Creating a table for a new domain means defining one `InlineTableConfig` object
|
|
98
|
+
* (and an optional `rowTransform` for business logic); the generic component handles
|
|
99
|
+
* all layout, rendering, and data binding.
|
|
100
|
+
*/
|
|
101
|
+
export interface InlineTableConfig {
|
|
102
|
+
/** Ordered list of column definitions — determines column count and order. */
|
|
103
|
+
columns: InlineColumnDef[];
|
|
104
|
+
/** i18n key for the section heading (`<h2>`). */
|
|
105
|
+
titleKey: string;
|
|
106
|
+
/**
|
|
107
|
+
* i18n key for the section description paragraph.
|
|
108
|
+
* Omit (or set to `undefined`) to hide the description.
|
|
109
|
+
*/
|
|
110
|
+
descriptionKey?: string;
|
|
111
|
+
/** i18n key for the "Add entry" dashed-button label. */
|
|
112
|
+
addLabelKey: string;
|
|
113
|
+
/** i18n key for the empty-state primary text (shown when `rows` is empty). */
|
|
114
|
+
emptyLabelKey: string;
|
|
115
|
+
/**
|
|
116
|
+
* i18n key for the empty-state hint text (secondary line).
|
|
117
|
+
* Omit to show only the primary text.
|
|
118
|
+
*/
|
|
119
|
+
emptyHintKey?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Factory function invoked when the user clicks "Add entry".
|
|
122
|
+
* Should return a fresh row object with sensible defaults (e.g. pre-initialised
|
|
123
|
+
* sub-arrays such as `ingredient`).
|
|
124
|
+
* Defaults to `() => ({})` when omitted.
|
|
125
|
+
*/
|
|
126
|
+
createRow?: () => Record<string, unknown>;
|
|
127
|
+
}
|
|
@@ -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
|
+
}
|
package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts
CHANGED
|
@@ -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 '
|
|
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
|
|
@@ -15,7 +15,13 @@ export declare class SuisseBilanzDashboardComponent {
|
|
|
15
15
|
private readonly sanitizer;
|
|
16
16
|
protected readonly metricsService: SuisseBilanzMetricsService;
|
|
17
17
|
private readonly result;
|
|
18
|
-
protected readonly metrics: import("@angular/core").Signal<import("
|
|
18
|
+
protected readonly metrics: import("@angular/core").Signal<import("../gauge-arc/gauge-arc.component").GaugeMetric[]>;
|
|
19
|
+
/** Surface areas in ha, derived from the latest planning result. */
|
|
20
|
+
protected readonly surfaces: import("@angular/core").Signal<{
|
|
21
|
+
sau: number;
|
|
22
|
+
sfe: number;
|
|
23
|
+
to: number;
|
|
24
|
+
} | null>;
|
|
19
25
|
protected readonly officialPdfUrl: import("@angular/core").Signal<SafeUrl | null>;
|
|
20
26
|
private prevBlobUrl;
|
|
21
27
|
private readonly blobCleanup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GaugeMetric, GaugeStatus } from '
|
|
2
|
-
import { SuisseBilanzMetricsService } from '
|
|
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
|
*
|
|
@@ -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
|
|
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
|
-
|
|
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;
|
|
@@ -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,12 @@ 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
|
-
descriptor: string;
|
|
86
|
-
cover: number;
|
|
87
|
-
manureFromAnimalStockStored: {
|
|
88
|
-
manureDerivation: string;
|
|
89
|
-
proportionStored: number;
|
|
90
|
-
}[];
|
|
91
|
-
}[];
|
|
79
|
+
manurePit: never[];
|
|
92
80
|
slurryTank: {
|
|
93
81
|
descriptor: string;
|
|
94
82
|
volumeInM3: number;
|
|
@@ -99,20 +87,7 @@ export declare class NaebiDataService {
|
|
|
99
87
|
}[];
|
|
100
88
|
};
|
|
101
89
|
farmManureTrading: {
|
|
102
|
-
supply:
|
|
103
|
-
quantity: number;
|
|
104
|
-
typeOfManureRecyclingProduct: string;
|
|
105
|
-
transactionUnit: string;
|
|
106
|
-
manureDerivation: {
|
|
107
|
-
zoologicalAnimal: string;
|
|
108
|
-
percentageAllocation: number;
|
|
109
|
-
}[];
|
|
110
|
-
ingredient: {
|
|
111
|
-
quantity: number;
|
|
112
|
-
molecularFormula: string;
|
|
113
|
-
unit: string;
|
|
114
|
-
}[];
|
|
115
|
-
}[];
|
|
90
|
+
supply: never[];
|
|
116
91
|
dispense: {
|
|
117
92
|
quantity: number;
|
|
118
93
|
typeOfManureRecyclingProduct: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ErrorHandler
|
|
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,5 @@
|
|
|
1
1
|
import { PipeTransform, Signal } from '@angular/core';
|
|
2
|
-
export type Locale = 'en' | 'de';
|
|
2
|
+
export type Locale = 'en' | 'de' | 'fr' | 'it';
|
|
3
3
|
export type JsonFormsTranslator = (key: string, defaultMessage: string | undefined, context: unknown) => string;
|
|
4
4
|
export declare class I18nService {
|
|
5
5
|
private readonly _locale;
|
|
@@ -10,11 +10,12 @@ export declare class I18nService {
|
|
|
10
10
|
translate: JsonFormsTranslator;
|
|
11
11
|
}>;
|
|
12
12
|
setLocale(locale: Locale): void;
|
|
13
|
+
/** Returns true if the given string is a supported locale key. */
|
|
14
|
+
isValidLocale(value: string): value is Locale;
|
|
13
15
|
t(key: string, defaultMessage?: string): string;
|
|
14
16
|
}
|
|
15
17
|
export declare class TranslatePipe implements PipeTransform {
|
|
16
|
-
private readonly i18n;
|
|
17
18
|
private readonly cache;
|
|
18
|
-
|
|
19
|
+
private readonly i18n;
|
|
19
20
|
transform(key: string, defaultMessage?: string): Signal<string>;
|
|
20
21
|
}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
export type SuibiVersion = '
|
|
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;
|
|
@@ -3,6 +3,7 @@ import { CodeListSelectRenderer } from '../renderers/controls/selects/code-list/
|
|
|
3
3
|
import { CardGroupRenderer } from '../renderers/layout/group/card-group.renderer';
|
|
4
4
|
import { PlainGroupRenderer } from '../renderers/layout/group/plain-group.renderer';
|
|
5
5
|
import { LogicalGroupRenderer } from '../renderers/layout/group/logical-group.renderer';
|
|
6
|
+
import { ModuleToggleGroupRenderer } from '../renderers/layout/group/module-toggle-group.renderer';
|
|
6
7
|
import { RankedTester } from '@jsonforms/core';
|
|
7
8
|
import { ConstraintLayoutRenderer } from '../renderers/layout/constraint/constraint-layout.renderer';
|
|
8
9
|
import { SelectedCategoryCategorizationRenderer } from '../renderers/layout/categorization/selected-category-categorization.renderer';
|
|
@@ -22,6 +23,9 @@ export declare const CUSTOM_JSONFORMS_RENDERERS: ({
|
|
|
22
23
|
} | {
|
|
23
24
|
tester: RankedTester;
|
|
24
25
|
renderer: typeof LogicalGroupRenderer;
|
|
26
|
+
} | {
|
|
27
|
+
tester: RankedTester;
|
|
28
|
+
renderer: typeof ModuleToggleGroupRenderer;
|
|
25
29
|
} | {
|
|
26
30
|
tester: RankedTester;
|
|
27
31
|
renderer: typeof AnimalCategorySelectRenderer;
|
|
@@ -10,7 +10,7 @@ interface AnimalCategoryPrifEntry {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export declare class AnimalCategorySelectRenderer extends BaseSelectControl<number> {
|
|
13
|
-
options: AnimalCategoryPrifEntry[]
|
|
13
|
+
options: import("@angular/core").InputSignal<AnimalCategoryPrifEntry[]>;
|
|
14
14
|
private readonly masterData;
|
|
15
15
|
constructor(jsonFormsService: JsonFormsAngularService);
|
|
16
16
|
getEventValue: (event: any) => any;
|
|
@@ -21,6 +21,8 @@ export declare class BaseGroupRenderer extends JsonFormsBaseRenderer<GroupLayout
|
|
|
21
21
|
registryRenderers(): JsonFormsRendererRegistryEntry[];
|
|
22
22
|
registryCells(): JsonFormsCellRendererRegistryEntry[] | undefined;
|
|
23
23
|
private subscription;
|
|
24
|
+
private _destroyed;
|
|
25
|
+
private _prevSig?;
|
|
24
26
|
ngOnInit(): void;
|
|
25
27
|
ngOnDestroy(): void;
|
|
26
28
|
protected resolveHost(): ViewContainerRef | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { JsonFormsBaseRenderer } from '@jsonforms/angular';
|
|
3
|
+
import { GroupLayout, RankedTester } from '@jsonforms/core';
|
|
4
|
+
interface ModuleCard {
|
|
5
|
+
path: string;
|
|
6
|
+
value: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const moduleToggleGroupTester: RankedTester;
|
|
11
|
+
/**
|
|
12
|
+
* Layout renderer for `{ type: 'Group', options: { variant: 'module-toggle' } }`.
|
|
13
|
+
*
|
|
14
|
+
* Renders boolean control children as interactive card-toggles in a horizontal
|
|
15
|
+
* row. Label and description are read from the (already-localised) schema that
|
|
16
|
+
* JSONForms passes into the renderer, so no extra i18n wiring is needed here.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ModuleToggleGroupRenderer extends JsonFormsBaseRenderer<GroupLayout> implements OnInit, OnDestroy {
|
|
19
|
+
private readonly service;
|
|
20
|
+
private readonly cdr;
|
|
21
|
+
private subscription?;
|
|
22
|
+
protected readonly _hidden: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
+
protected readonly _label: import("@angular/core").WritableSignal<string | undefined>;
|
|
24
|
+
protected readonly _description: import("@angular/core").WritableSignal<string | undefined>;
|
|
25
|
+
protected readonly _modules: import("@angular/core").WritableSignal<ModuleCard[]>;
|
|
26
|
+
readonly labelId: string;
|
|
27
|
+
hidden: () => boolean;
|
|
28
|
+
label: () => string | undefined;
|
|
29
|
+
description: () => string | undefined;
|
|
30
|
+
modules: () => ModuleCard[];
|
|
31
|
+
ngOnInit(): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
/** Flip a single module boolean in the JSONForms data store. */
|
|
34
|
+
toggle(dataPath: string): void;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { EventEmitter, Signal } from '@angular/core';
|
|
2
1
|
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
3
2
|
import { AnimalStockRow } from './animal-stock.types';
|
|
4
3
|
import { ErrorObject } from 'ajv';
|
|
5
4
|
export declare class AnimalStockDetailComponent {
|
|
6
5
|
private readonly i18n;
|
|
7
|
-
row:
|
|
8
|
-
index:
|
|
9
|
-
rowChange:
|
|
10
|
-
close:
|
|
11
|
-
itemSchema: Signal<JsonSchema>;
|
|
6
|
+
row: import("@angular/core").InputSignal<AnimalStockRow | null>;
|
|
7
|
+
index: import("@angular/core").InputSignal<number | null>;
|
|
8
|
+
rowChange: import("@angular/core").OutputEmitterRef<AnimalStockRow>;
|
|
9
|
+
close: import("@angular/core").OutputEmitterRef<void>;
|
|
10
|
+
itemSchema: import("@angular/core").Signal<JsonSchema>;
|
|
12
11
|
private readonly baseUi;
|
|
13
|
-
localizedUi: Signal<UISchemaElement>;
|
|
14
|
-
jsonFormsData: Signal<(AnimalStockRow & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
12
|
+
localizedUi: import("@angular/core").Signal<UISchemaElement>;
|
|
13
|
+
jsonFormsData: import("@angular/core").Signal<(AnimalStockRow & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
15
14
|
readonly renderers: {
|
|
16
15
|
tester: import("@jsonforms/core").RankedTester;
|
|
17
16
|
renderer: any;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { EventEmitter, Signal } from '@angular/core';
|
|
2
|
-
import { MatTable } from '@angular/material/table';
|
|
3
1
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
4
2
|
import { AnimalStockRow } from './animal-stock.types';
|
|
5
3
|
export declare class AnimalStockListComponent {
|
|
6
4
|
private readonly masterData;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
reorder: EventEmitter<{
|
|
5
|
+
rows: import("@angular/core").InputSignal<AnimalStockRow[]>;
|
|
6
|
+
select: import("@angular/core").OutputEmitterRef<number>;
|
|
7
|
+
add: import("@angular/core").OutputEmitterRef<void>;
|
|
8
|
+
delete: import("@angular/core").OutputEmitterRef<number>;
|
|
9
|
+
reorder: import("@angular/core").OutputEmitterRef<{
|
|
13
10
|
previousIndex: number;
|
|
14
11
|
currentIndex: number;
|
|
15
12
|
}>;
|