@agridea/suibi-module 0.1.0-preview.5f912f0 → 0.1.0-preview.68e6607

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 (54) hide show
  1. package/dist/elements/browser/main.js +71 -71
  2. package/dist/elements/browser/suibi-module-latest.js +71 -71
  3. package/dist/elements/browser/suibi-module.v0.1.0-preview.68e6607.js +78 -0
  4. package/dist/elements/browser/version.txt +1 -1
  5. package/dist/types/app/components/inline-table/inline-table.component.d.ts +10 -0
  6. package/dist/types/app/components/inline-table/inline-table.types.d.ts +36 -2
  7. package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +2 -0
  8. package/dist/types/app/core/i18n/i18n.service.d.ts +1 -0
  9. package/dist/types/app/core/utils/object.util.d.ts +26 -0
  10. package/dist/types/app/jsonforms/renderers/layout/group/module-toggle-group.renderer.d.ts +3 -1
  11. package/dist/types/app/nutrient-cycle/animal-stock/{animal-stock-detail.component.d.ts → animal-stock-detail/animal-stock-detail.component.d.ts} +2 -2
  12. package/dist/types/app/nutrient-cycle/animal-stock/{animal-stock-list.component.d.ts → animal-stock-list/animal-stock-list.component.d.ts} +1 -1
  13. 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
  14. package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +3 -3
  15. package/dist/types/app/nutrient-cycle/farm-manure-trading/{farm-manure-trading-detail.component.d.ts → farm-manure-trading-detail/farm-manure-trading-detail.component.d.ts} +2 -2
  16. package/dist/types/app/nutrient-cycle/farm-manure-trading/{farm-manure-trading-list.component.d.ts → farm-manure-trading-list/farm-manure-trading-list.component.d.ts} +2 -2
  17. package/dist/types/app/nutrient-cycle/farm-manure-trading/{farm-manure-trading-master-detail.component.d.ts → farm-manure-trading-master-detail/farm-manure-trading-master-detail.component.d.ts} +3 -3
  18. package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +3 -3
  19. package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.component.d.ts +21 -0
  20. package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.config.d.ts +9 -0
  21. package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.component.d.ts +21 -0
  22. package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.config.d.ts +13 -0
  23. package/dist/types/app/nutrient-cycle/field-cultivation/{field-cultivation-detail.component.d.ts → field-cultivation-detail/field-cultivation-detail.component.d.ts} +2 -2
  24. package/dist/types/app/nutrient-cycle/field-cultivation/{field-cultivation-general.component.d.ts → field-cultivation-general/field-cultivation-general.component.d.ts} +2 -4
  25. package/dist/types/app/nutrient-cycle/field-cultivation/{field-cultivation-list.component.d.ts → field-cultivation-list/field-cultivation-list.component.d.ts} +1 -1
  26. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail/field-cultivation-master-detail.component.d.ts +29 -0
  27. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.types.d.ts +1 -0
  28. package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.component.d.ts +27 -0
  29. package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.config.d.ts +16 -0
  30. package/dist/types/app/nutrient-cycle/field-cultivation/index.d.ts +8 -3
  31. package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.component.d.ts +29 -0
  32. package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.config.d.ts +61 -0
  33. package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +6 -1
  34. package/dist/types/app/nutrient-cycle/field-spreading/ingredient.util.d.ts +8 -0
  35. package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +13 -4
  36. package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-transaction-unit.util.d.ts +4 -0
  37. package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail/fodder-master-detail.component.d.ts +25 -0
  38. package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.component.d.ts +26 -0
  39. package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.config.d.ts +9 -0
  40. package/dist/types/app/nutrient-cycle/fodder/fodder.types.d.ts +7 -0
  41. package/dist/types/app/nutrient-cycle/fodder/index.d.ts +2 -3
  42. package/dist/types/app/nutrient-cycle/fodder/ingredient.util.d.ts +8 -0
  43. package/dist/types/app/nutrient-cycle/storage/index.d.ts +3 -3
  44. package/dist/types/app/nutrient-cycle/storage/{storage-detail.component.d.ts → storage-detail/storage-detail.component.d.ts} +3 -3
  45. package/dist/types/app/nutrient-cycle/storage/{storage-general.component.d.ts → storage-general/storage-general.component.d.ts} +4 -4
  46. package/dist/types/app/nutrient-cycle/storage/{storage-list.component.d.ts → storage-list/storage-list.component.d.ts} +1 -1
  47. package/dist/types/app/nutrient-cycle/storage/{storage-master-detail.component.d.ts → storage-master-detail/storage-master-detail.component.d.ts} +2 -2
  48. package/package.json +1 -1
  49. package/dist/elements/browser/suibi-module.v0.1.0-preview.5f912f0.js +0 -78
  50. package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail.component.d.ts +0 -37
  51. package/dist/types/app/nutrient-cycle/fodder/fodder-detail.component.d.ts +0 -31
  52. package/dist/types/app/nutrient-cycle/fodder/fodder-list.component.d.ts +0 -20
  53. package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail.component.d.ts +0 -37
  54. /package/dist/elements/browser/{suibi-module.v0.1.0-preview.5f912f0.css → suibi-module.v0.1.0-preview.68e6607.css} +0 -0
@@ -6,9 +6,10 @@ import { FieldSpreadingRecyclingEntry } from '../field-spreading.types';
6
6
  * 1. Provides `RECYCLING_TABLE_CONFIG` (the column/section "uischema").
7
7
  * 2. Bridges typed `FieldSpreadingRecyclingEntry[]` to/from the generic
8
8
  * `Record<string, unknown>[]` API of InlineTableComponent.
9
- *
10
- * Unlike FertiliserTableComponent, no `rowTransform` is needed here — recycling
11
- * products have no auto-population logic; all nutrient values are entered manually.
9
+ * 3. Supplies `deriveUnits` as a `rowTransform` — `transactionUnit` ('kg'/'m3') and every
10
+ * ingredient's `unit` ('kg/t'/'kg/m3') are fully derived from the selected product's
11
+ * matterState (never user-entered) — they are separate mappings, NOT a concatenation of
12
+ * one into the other (kg/kg would be wrong for solid products).
12
13
  */
13
14
  export declare class RecyclingTableComponent {
14
15
  readonly entries: import("@angular/core").InputSignal<FieldSpreadingRecyclingEntry[]>;
@@ -17,6 +18,14 @@ export declare class RecyclingTableComponent {
17
18
  protected readonly config: import("../../../components/inline-table/inline-table.types").InlineTableConfig;
18
19
  /** Cast typed entries to generic Record[] for InlineTableComponent. */
19
20
  readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
20
- /** Cast generic output back to typed FieldSpreadingRecyclingEntry[]. */
21
+ /** Cast generic output back to typed FieldSpreadingRecyclingEntry[], stripping any
22
+ * ingredient with a 0 quantity so it never reaches the final JSON. */
21
23
  onRowsChange(rows: Record<string, unknown>[]): void;
24
+ /**
25
+ * Row transform re-deriving `transactionUnit` and every ingredient's `unit` from the
26
+ * product's matterState on each edit — runs unconditionally (not just when
27
+ * `typeOfManureRecyclingProduct` changes) so an edit made before the product is picked still
28
+ * resolves once it is.
29
+ */
30
+ readonly deriveUnits: (_changedKey: string, _newValue: unknown, row: Record<string, unknown>) => Record<string, unknown>;
22
31
  }
@@ -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,26 @@
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
+ * - Units are fixed, never user-entered: quantity is always transacted in kg and the only
23
+ * permitted ingredient is dry matter (T/S) expressed in % — re-appended when missing.
24
+ */
25
+ readonly enforceFodderRules: (changedKey: string, newValue: unknown, row: Record<string, unknown>) => Record<string, unknown>;
26
+ }
@@ -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;
@@ -25,3 +25,10 @@ export interface FodderData {
25
25
  proportionStorageLoss?: number;
26
26
  totalBalanceErrorMargin?: number;
27
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
+ };
@@ -1,4 +1,3 @@
1
- export * from './fodder-list.component';
2
- export * from './fodder-detail.component';
3
- export * from './fodder-master-detail.component';
1
+ export * from './fodder-table/fodder-table.component';
2
+ export * from './fodder-master-detail/fodder-master-detail.component';
4
3
  export * from './fodder.types';
@@ -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;
@@ -1,4 +1,4 @@
1
- export * from './storage-list.component';
2
- export * from './storage-detail.component';
3
- export * from './storage-master-detail.component';
1
+ export * from './storage-list/storage-list.component';
2
+ export * from './storage-detail/storage-detail.component';
3
+ export * from './storage-master-detail/storage-master-detail.component';
4
4
  export * from './storage.types';
@@ -1,5 +1,5 @@
1
1
  import { JsonSchema, UISchemaElement } from '@jsonforms/core';
2
- import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from './storage.types';
2
+ import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from '../storage.types';
3
3
  export declare class StorageDetailComponent {
4
4
  private readonly i18n;
5
5
  readonly type: import("@angular/core").InputSignal<StorageEntryType>;
@@ -17,7 +17,7 @@ export declare class StorageDetailComponent {
17
17
  readonly jsonFormsData: import("@angular/core").Signal<(({
18
18
  descriptor?: string;
19
19
  cover?: number | null;
20
- manureFromAnimalStockStored?: import("./storage.types").ManureFromAnimalStockStored[];
20
+ manureFromAnimalStockStored?: import("..").ManureFromAnimalStockStored[];
21
21
  } | {
22
22
  descriptor?: string;
23
23
  volumeInM3?: number | null;
@@ -25,6 +25,6 @@ export declare class StorageDetailComponent {
25
25
  cover?: number | null;
26
26
  mixingFrequency?: number | null;
27
27
  manureDerivation?: string[];
28
- }) & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
28
+ }) & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
29
29
  onDataChange(event: unknown): void;
30
30
  }
@@ -1,5 +1,5 @@
1
1
  import { JsonSchema, UISchemaElement } from '@jsonforms/core';
2
- import { StorageNormalized } from './storage.types';
2
+ import { StorageNormalized } from '../storage.types';
3
3
  type StorageSection = 'manure' | 'slurry' | 'slurryFacilityToggle' | 'general';
4
4
  export declare class StorageGeneralComponent {
5
5
  private readonly i18n;
@@ -17,13 +17,13 @@ export declare class StorageGeneralComponent {
17
17
  stableStrawLitter: number | null;
18
18
  manureSupplyProportionStored: number | null;
19
19
  createFacilitySpecificManureProduct: boolean;
20
- } & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
20
+ } & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
21
21
  createFacilitySpecificSlurryProduct: boolean;
22
- } & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
22
+ } & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | ({
23
23
  slurrySupplyProportionStored: number | null;
24
24
  slurryTankQuantity: number | null;
25
25
  dilutionRatio: number | null;
26
- } & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
26
+ } & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
27
27
  onDataChange(event: unknown): void;
28
28
  }
29
29
  export {};
@@ -1,4 +1,4 @@
1
- import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from './storage.types';
1
+ import { ManurePitEntry, SlurryTankEntry, StorageEntryType } from '../storage.types';
2
2
  export declare class StorageListComponent {
3
3
  private readonly i18n;
4
4
  private readonly masterData;
@@ -1,5 +1,5 @@
1
- import { StorageTab } from '../../core/navigation/navigation.service';
2
- import { ManurePitEntry, SlurryTankEntry, StorageEntryType, StorageNormalized } from './storage.types';
1
+ import { StorageTab } from '../../../core/navigation/navigation.service';
2
+ import { ManurePitEntry, SlurryTankEntry, StorageEntryType, StorageNormalized } from '../storage.types';
3
3
  export declare class StorageMasterDetailComponent {
4
4
  private readonly dataSvc;
5
5
  private readonly navigationSvc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agridea/suibi-module",
3
- "version": "0.1.0-preview.5f912f0",
3
+ "version": "0.1.0-preview.68e6607",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",