@agridea/suibi-module 0.1.0-preview.b1a9725 → 0.1.0-preview.c59da9e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/browser/main.js +66 -66
- package/dist/elements/browser/suibi-module-latest.js +66 -66
- package/dist/elements/browser/{suibi-module.v0.1.0-preview.b1a9725.js → suibi-module.v0.1.0-preview.c59da9e.js} +66 -66
- package/dist/elements/browser/version.txt +1 -1
- package/dist/types/app/components/inline-table/inline-table.component.d.ts +6 -2
- package/dist/types/app/components/inline-table/inline-table.types.d.ts +4 -2
- package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +1 -1
- package/dist/types/app/core/planning/planning-balance.service.d.ts +1 -0
- package/dist/types/app/core/utils/object.util.d.ts +10 -0
- package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +11 -3
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts +4 -3
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-transaction-unit.util.d.ts +4 -0
- 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 +3 -0
- package/package.json +1 -1
- /package/dist/elements/browser/{suibi-module.v0.1.0-preview.b1a9725.css → suibi-module.v0.1.0-preview.c59da9e.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.0-preview.
|
|
1
|
+
0.1.0-preview.c59da9e c59da9e
|
|
@@ -84,9 +84,13 @@ export declare class InlineTableComponent {
|
|
|
84
84
|
private setValue;
|
|
85
85
|
/** Called when a `mat-select` selection changes. */
|
|
86
86
|
onSelectChange(rowIdx: number, col: InlineColumnDef, value: unknown): void;
|
|
87
|
-
/** Called on `(
|
|
87
|
+
/** Called on `(input)` of a number `<input>` — parses the string value and guards NaN.
|
|
88
|
+
* Uses `input` (not `change`) so every keystroke commits immediately: relying on blur
|
|
89
|
+
* meant edits were lost whenever the table was destroyed before the field lost focus
|
|
90
|
+
* (e.g. navigating to another page), even though switching same-page tabs hid the bug
|
|
91
|
+
* since mat-tab-group keeps inactive tab content mounted. */
|
|
88
92
|
onNumberChange(rowIdx: number, col: InlineColumnDef, event: Event): void;
|
|
89
|
-
/** Called on `(
|
|
93
|
+
/** Called on `(input)` of a text `<input>` (see onNumberChange for why not `(change)`). */
|
|
90
94
|
onTextChange(rowIdx: number, col: InlineColumnDef, event: Event): void;
|
|
91
95
|
/** Appends a blank row produced by `config.createRow()`. */
|
|
92
96
|
addRow(): void;
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
* To reuse the table for a different domain, create a new config file and a thin
|
|
12
12
|
* wrapper component. Only the config changes; the rendering component stays the same.
|
|
13
13
|
*/
|
|
14
|
-
/** Supported cell widget types. Extend with new literal types as needed.
|
|
15
|
-
|
|
14
|
+
/** Supported cell widget types. Extend with new literal types as needed.
|
|
15
|
+
* 'readonly' renders the resolved value as plain text (no input) — for columns
|
|
16
|
+
* that are fully derived from other fields and must not be user-editable. */
|
|
17
|
+
export type InlineCellType = 'select' | 'number' | 'text' | 'readonly';
|
|
16
18
|
/**
|
|
17
19
|
* Definition for a single column in an inline table.
|
|
18
20
|
*
|
|
@@ -22,3 +22,13 @@ export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
|
22
22
|
* @returns A deep copy of the value
|
|
23
23
|
*/
|
|
24
24
|
export declare function deepClone<T>(value: T): T;
|
|
25
|
+
/**
|
|
26
|
+
* Recursively drops `ingredient[]` entries whose `quantity` is null/undefined.
|
|
27
|
+
*
|
|
28
|
+
* Inline tables (fertiliser/recycling) pre-populate every nutrient slot in `ingredient[]`
|
|
29
|
+
* so the UI always shows all formula columns, but slots the user never fills in stay as
|
|
30
|
+
* `{ molecularFormula, quantity: null, unit }`. The calculation API rejects any ingredient
|
|
31
|
+
* entry that's present but incomplete, so submitted payloads must omit those still-empty
|
|
32
|
+
* slots entirely rather than send them with a null quantity.
|
|
33
|
+
*/
|
|
34
|
+
export declare function stripIncompleteIngredients<T>(value: T): T;
|
|
@@ -28,6 +28,10 @@ export declare class FertiliserTableComponent {
|
|
|
28
28
|
/**
|
|
29
29
|
* Row transform for auto-populating nutrient columns when a product is selected.
|
|
30
30
|
*
|
|
31
|
+
* Also imposes `transactionUnit = 'kg'` on every edit (not just product changes) so
|
|
32
|
+
* stale/imported rows with a different or null unit get corrected once touched —
|
|
33
|
+
* `createRow` already defaults new rows to 'kg', this is only a safety net.
|
|
34
|
+
*
|
|
31
35
|
* Defined as an arrow-function property so `this` is never needed and the function
|
|
32
36
|
* can be passed as a value to InlineTableComponent without losing its context.
|
|
33
37
|
*
|
package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
11
|
-
*
|
|
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[]>;
|
|
@@ -19,4 +20,11 @@ export declare class RecyclingTableComponent {
|
|
|
19
20
|
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
20
21
|
/** Cast generic output back to typed FieldSpreadingRecyclingEntry[]. */
|
|
21
22
|
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Row transform re-deriving `transactionUnit` and every ingredient's `unit` from the
|
|
25
|
+
* product's matterState on each edit — runs unconditionally (not just when
|
|
26
|
+
* `typeOfManureRecyclingProduct` changes) so an edit made before the product is picked still
|
|
27
|
+
* resolves once it is.
|
|
28
|
+
*/
|
|
29
|
+
readonly deriveUnits: (_changedKey: string, _newValue: unknown, row: Record<string, unknown>) => Record<string, unknown>;
|
|
22
30
|
}
|
package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* This is the "uischema" for the Recycling fertilisers tab.
|
|
5
5
|
* The structure mirrors fertiliser-table.config.ts — only the columns differ:
|
|
6
6
|
* - Product field: typeOfManureRecyclingProduct (different code list)
|
|
7
|
-
* - Nutrient columns: Ntot,
|
|
7
|
+
* - Nutrient columns: Ntot, Nlos, P₂O₅, K₂O, Mg expressed in kg/unit (not %)
|
|
8
8
|
* — 5 nutrients vs 4 for mineral fertilisers, no auto-population on product select.
|
|
9
9
|
*
|
|
10
10
|
* To adapt again for a new domain, copy this file and adjust columns + i18n keys.
|
|
11
11
|
*/
|
|
12
12
|
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
13
|
-
/** Nutrient formulas tracked per recycling entry, in display order.
|
|
14
|
-
|
|
13
|
+
/** Nutrient formulas tracked per recycling entry, in display order. 'Nlos' = soluble nitrogen (matches the
|
|
14
|
+
* `molecularFormula` enum from assets/master-data/substances.json — NOT 'NSol', which the API rejects). */
|
|
15
|
+
export declare const RECYCLING_NUTRIENT_COLUMNS: readonly ["Ntot", "Nlos", "P2O5", "K2O", "Mg"];
|
|
15
16
|
export type RecyclingNutrientFormula = (typeof RECYCLING_NUTRIENT_COLUMNS)[number];
|
|
16
17
|
export declare const RECYCLING_TABLE_CONFIG: InlineTableConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Derives the mandatory transaction unit ('kg' or 'm3') from the product's matterState. */
|
|
2
|
+
export declare function deriveRecyclingTransactionUnit(productCode: string | null | undefined): string | null;
|
|
3
|
+
/** Derives the mandatory ingredient unit ('kg/t' or 'kg/m3') from the product's matterState. */
|
|
4
|
+
export declare function deriveRecyclingIngredientUnit(productCode: string | null | undefined): string | null;
|
|
@@ -5,6 +5,7 @@ export declare class StorageListComponent {
|
|
|
5
5
|
readonly rows: import("@angular/core").InputSignal<(ManurePitEntry | SlurryTankEntry)[]>;
|
|
6
6
|
readonly selectedIndex: import("@angular/core").InputSignal<number | null>;
|
|
7
7
|
readonly type: import("@angular/core").InputSignal<StorageEntryType>;
|
|
8
|
+
readonly errorIndices: import("@angular/core").InputSignal<ReadonlySet<number>>;
|
|
8
9
|
readonly select: import("@angular/core").OutputEmitterRef<number>;
|
|
9
10
|
readonly add: import("@angular/core").OutputEmitterRef<void>;
|
|
10
11
|
readonly delete: import("@angular/core").OutputEmitterRef<number>;
|
|
@@ -12,6 +13,8 @@ export declare class StorageListComponent {
|
|
|
12
13
|
readonly headerName: import("@angular/core").Signal<string>;
|
|
13
14
|
readonly headerMeta: import("@angular/core").Signal<string>;
|
|
14
15
|
resolveName(row: ManurePitEntry | SlurryTankEntry, index: number): string;
|
|
16
|
+
rowHasError(index: number): boolean;
|
|
17
|
+
rowErrorLabel(): string;
|
|
15
18
|
resolveMeta(row: ManurePitEntry | SlurryTankEntry): string;
|
|
16
19
|
emptyLabel(): string;
|
|
17
20
|
emptyHintLabel(): string;
|
|
@@ -3,6 +3,7 @@ import { ManurePitEntry, SlurryTankEntry, StorageEntryType, StorageNormalized }
|
|
|
3
3
|
export declare class StorageMasterDetailComponent {
|
|
4
4
|
private readonly dataSvc;
|
|
5
5
|
private readonly navigationSvc;
|
|
6
|
+
private readonly globalValidation;
|
|
6
7
|
constructor();
|
|
7
8
|
readonly storage: import("@angular/core").Signal<StorageNormalized>;
|
|
8
9
|
readonly manurePitRows: import("@angular/core").Signal<ManurePitEntry[]>;
|
|
@@ -11,6 +12,8 @@ export declare class StorageMasterDetailComponent {
|
|
|
11
12
|
readonly selectedIndex: import("@angular/core").WritableSignal<number | null>;
|
|
12
13
|
readonly manureFacilitySpecificEnabled: import("@angular/core").Signal<boolean>;
|
|
13
14
|
readonly slurryFacilitySpecificEnabled: import("@angular/core").Signal<boolean>;
|
|
15
|
+
readonly manurePitErrorIndices: import("@angular/core").Signal<Set<number>>;
|
|
16
|
+
readonly slurryTankErrorIndices: import("@angular/core").Signal<Set<number>>;
|
|
14
17
|
readonly detailOpen: import("@angular/core").Signal<boolean>;
|
|
15
18
|
readonly detailType: import("@angular/core").Signal<StorageEntryType>;
|
|
16
19
|
readonly currentDetail: import("@angular/core").Signal<ManurePitEntry | SlurryTankEntry | null>;
|
package/package.json
CHANGED
|
File without changes
|