@agridea/suibi-module 0.1.0-preview.00f7b5e
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/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/elements/browser/main.js +78 -0
- package/dist/elements/browser/polyfills.js +1 -0
- package/dist/elements/browser/styles.css +1 -0
- package/dist/elements/browser/suibi-module-latest.css +1 -0
- package/dist/elements/browser/suibi-module-latest.js +78 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.00f7b5e.css +1 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.00f7b5e.js +78 -0
- package/dist/elements/browser/suibi-theme-dark.css +1 -0
- package/dist/elements/browser/version.txt +1 -0
- package/dist/elements/browser/wc-global-utilities.css +1 -0
- package/dist/types/app/app.config.d.ts +2 -0
- package/dist/types/app/app.d.ts +34 -0
- package/dist/types/app/components/add-dashed-button/add-dashed-button.component.d.ts +9 -0
- package/dist/types/app/components/data-preview/data-preview.component.d.ts +233 -0
- package/dist/types/app/components/empty-state/empty-state.component.d.ts +12 -0
- package/dist/types/app/components/gauge-arc/gauge-arc.component.d.ts +49 -0
- package/dist/types/app/components/header-bar/header-bar.component.d.ts +14 -0
- package/dist/types/app/components/inline-table/inline-table.component.d.ts +167 -0
- package/dist/types/app/components/inline-table/inline-table.types.d.ts +212 -0
- package/dist/types/app/components/module-placeholder-page/module-placeholder-page.component.d.ts +6 -0
- package/dist/types/app/components/planning-result/planning-result.component.d.ts +46 -0
- package/dist/types/app/components/planning-result-row/planning-result-row.component.d.ts +34 -0
- package/dist/types/app/components/planning-trigger/planning-trigger.component.d.ts +13 -0
- package/dist/types/app/components/results-page/results-page.component.d.ts +13 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +32 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-metrics.service.d.ts +21 -0
- package/dist/types/app/components/suissebilanz-minibar/suissebilanz-minibar.component.d.ts +19 -0
- package/dist/types/app/components/validation-errors-panel/validation-errors-panel.component.d.ts +36 -0
- package/dist/types/app/components/validation-page/validation-page.component.d.ts +18 -0
- package/dist/types/app/components/welcome-page/metadata.types.d.ts +1 -0
- package/dist/types/app/components/welcome-page/welcome-page.component.d.ts +30 -0
- package/dist/types/app/components/workflow-stepper/workflow-stepper.component.d.ts +49 -0
- package/dist/types/app/core/data/naebi-data.service.d.ts +253 -0
- package/dist/types/app/core/error/global-error-handler.d.ts +5 -0
- package/dist/types/app/core/events/suibi-data-emitter.service.d.ts +13 -0
- package/dist/types/app/core/events/suibi-data-event.d.ts +26 -0
- package/dist/types/app/core/i18n/i18n.service.d.ts +22 -0
- package/dist/types/app/core/i18n/locales/de.d.ts +2 -0
- package/dist/types/app/core/i18n/locales/en.d.ts +2 -0
- package/dist/types/app/core/i18n/locales/fr.d.ts +2 -0
- package/dist/types/app/core/i18n/locales/it.d.ts +2 -0
- package/dist/types/app/core/master-data/master-data.service.d.ts +32 -0
- package/dist/types/app/core/metadata/suibi-metadata.service.d.ts +6 -0
- package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +18 -0
- package/dist/types/app/core/navigation/navigation.service.d.ts +107 -0
- package/dist/types/app/core/planning/planning-balance.service.d.ts +46 -0
- package/dist/types/app/core/planning/planning-balance.types.d.ts +206 -0
- package/dist/types/app/core/planning/planning-balance.utils.d.ts +10 -0
- package/dist/types/app/core/schemas/index.d.ts +18 -0
- package/dist/types/app/core/schemas/schema-localization.util.d.ts +18 -0
- package/dist/types/app/core/schemas/schema-merge.util.d.ts +26 -0
- package/dist/types/app/core/schemas/ui-helper-registry.d.ts +16 -0
- package/dist/types/app/core/telemetry/telemetry.service.d.ts +12 -0
- package/dist/types/app/core/utils/custom-unit.util.d.ts +39 -0
- package/dist/types/app/core/utils/object.util.d.ts +46 -0
- package/dist/types/app/core/validation/ajv-custom.d.ts +16 -0
- package/dist/types/app/core/validation/capabilities.d.ts +24 -0
- package/dist/types/app/core/validation/error-formatter.d.ts +19 -0
- package/dist/types/app/core/validation/global-validation.service.d.ts +61 -0
- package/dist/types/app/jsonforms/constraints/constraint-resolvers.d.ts +50 -0
- package/dist/types/app/jsonforms/filters/code-list-filter-resolvers.d.ts +63 -0
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +38 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +24 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +37 -0
- package/dist/types/app/jsonforms/renderers/layout/array/array-layout.renderer.d.ts +43 -0
- package/dist/types/app/jsonforms/renderers/layout/categorization/selected-category-categorization.renderer.d.ts +34 -0
- package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +31 -0
- package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +31 -0
- package/dist/types/app/jsonforms/renderers/layout/group/card-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/renderers/layout/group/group-testers.d.ts +4 -0
- package/dist/types/app/jsonforms/renderers/layout/group/logical-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/renderers/layout/group/module-toggle-group.renderer.d.ts +38 -0
- package/dist/types/app/jsonforms/renderers/layout/group/plain-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/shared/base-control/base-select-control.d.ts +16 -0
- package/dist/types/app/jsonforms/shared/option-sources/code-lists.d.ts +11 -0
- package/dist/types/app/jsonforms/shared/searchable-select/search-highlight.d.ts +18 -0
- package/dist/types/app/jsonforms/shared/searchable-select/searchable-select.component.d.ts +63 -0
- package/dist/types/app/jsonforms/shared/validation/field-error.service.d.ts +18 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail/animal-stock-detail.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-list/animal-stock-list.component.d.ts +18 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-master-detail/animal-stock-master-detail.component.d.ts +24 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock.types.d.ts +69 -0
- package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail/farm-manure-trading-master-detail.component.d.ts +19 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.component.d.ts +37 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-table/farm-manure-trading-table.config.d.ts +24 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading.types.d.ts +31 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/transaction-unit.util.d.ts +3 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/arable-land-table/arable-land-table.config.d.ts +16 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/crop-harvest-table/crop-harvest-table.config.d.ts +13 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-detail/field-cultivation-detail.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-general/field-cultivation-general.component.d.ts +20 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-list/field-cultivation-list.component.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail/field-cultivation-master-detail.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.types.d.ts +45 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.util.d.ts +10 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/fodder-cropland-table/fodder-cropland-table.config.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/index.d.ts +9 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/special-crops-table/special-crops-table.config.d.ts +51 -0
- package/dist/types/app/nutrient-cycle/field-spreading/fertiliser-table/fertiliser-table.component.d.ts +58 -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 +36 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.types.d.ts +45 -0
- package/dist/types/app/nutrient-cycle/field-spreading/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/field-spreading/ingredient.util.d.ts +8 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.component.d.ts +32 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-table.config.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/field-spreading/recycling-table/recycling-transaction-unit.util.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail/fodder-master-detail.component.d.ts +25 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.component.d.ts +28 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-table/fodder-table.config.d.ts +9 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder.types.d.ts +34 -0
- package/dist/types/app/nutrient-cycle/fodder/index.d.ts +3 -0
- package/dist/types/app/nutrient-cycle/fodder/ingredient.util.d.ts +8 -0
- package/dist/types/app/nutrient-cycle/fodder/transaction-unit.util.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance.types.d.ts +5 -0
- package/dist/types/app/nutrient-cycle/storage/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/storage/storage-detail/storage-detail.component.d.ts +30 -0
- package/dist/types/app/nutrient-cycle/storage/storage-general/storage-general.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/storage/storage-list/storage-list.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/storage/storage-master-detail/storage-master-detail.component.d.ts +32 -0
- package/dist/types/app/nutrient-cycle/storage/storage.types.d.ts +40 -0
- package/dist/types/environments/environment.d.ts +11 -0
- package/dist/types/public-api.d.ts +6 -0
- package/dist/types/shared/material-icons.d.ts +16 -0
- package/package.json +142 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AnimalCategorySelectRenderer } from '../renderers/controls/selects/animal-category/animal-category-select.renderer';
|
|
2
|
+
import { CodeListSelectRenderer } from '../renderers/controls/selects/code-list/code-list-select.renderer';
|
|
3
|
+
import { CardGroupRenderer } from '../renderers/layout/group/card-group.renderer';
|
|
4
|
+
import { PlainGroupRenderer } from '../renderers/layout/group/plain-group.renderer';
|
|
5
|
+
import { LogicalGroupRenderer } from '../renderers/layout/group/logical-group.renderer';
|
|
6
|
+
import { ModuleToggleGroupRenderer } from '../renderers/layout/group/module-toggle-group.renderer';
|
|
7
|
+
import { RankedTester } from '@jsonforms/core';
|
|
8
|
+
import { ConstraintLayoutRenderer } from '../renderers/layout/constraint/constraint-layout.renderer';
|
|
9
|
+
import { SelectedCategoryCategorizationRenderer } from '../renderers/layout/categorization/selected-category-categorization.renderer';
|
|
10
|
+
import { CustomArrayLayoutRenderer } from '../renderers/layout/array/array-layout.renderer';
|
|
11
|
+
export declare const CUSTOM_JSONFORMS_RENDERERS: ({
|
|
12
|
+
tester: RankedTester;
|
|
13
|
+
renderer: typeof ConstraintLayoutRenderer;
|
|
14
|
+
} | {
|
|
15
|
+
tester: RankedTester;
|
|
16
|
+
renderer: typeof SelectedCategoryCategorizationRenderer;
|
|
17
|
+
} | {
|
|
18
|
+
tester: RankedTester;
|
|
19
|
+
renderer: typeof CardGroupRenderer;
|
|
20
|
+
} | {
|
|
21
|
+
tester: RankedTester;
|
|
22
|
+
renderer: typeof PlainGroupRenderer;
|
|
23
|
+
} | {
|
|
24
|
+
tester: RankedTester;
|
|
25
|
+
renderer: typeof LogicalGroupRenderer;
|
|
26
|
+
} | {
|
|
27
|
+
tester: RankedTester;
|
|
28
|
+
renderer: typeof ModuleToggleGroupRenderer;
|
|
29
|
+
} | {
|
|
30
|
+
tester: RankedTester;
|
|
31
|
+
renderer: typeof AnimalCategorySelectRenderer;
|
|
32
|
+
} | {
|
|
33
|
+
tester: RankedTester;
|
|
34
|
+
renderer: typeof CodeListSelectRenderer;
|
|
35
|
+
} | {
|
|
36
|
+
tester: RankedTester;
|
|
37
|
+
renderer: typeof CustomArrayLayoutRenderer;
|
|
38
|
+
})[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
3
|
+
import { RankedTester } from '@jsonforms/core';
|
|
4
|
+
import { BaseSelectControl } from '../../../../shared/base-control/base-select-control';
|
|
5
|
+
import { SearchableSelectOption } from '../../../../shared/searchable-select/searchable-select.component';
|
|
6
|
+
interface AnimalCategoryPrifEntry {
|
|
7
|
+
id: number;
|
|
8
|
+
animalGroup?: string;
|
|
9
|
+
descriptor?: {
|
|
10
|
+
designation_ita?: string;
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class AnimalCategorySelectRenderer extends BaseSelectControl<number> {
|
|
15
|
+
options: import("@angular/core").InputSignal<AnimalCategoryPrifEntry[]>;
|
|
16
|
+
private readonly masterData;
|
|
17
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
18
|
+
getEventValue: (event: any) => any;
|
|
19
|
+
optLabel(opt: AnimalCategoryPrifEntry): string;
|
|
20
|
+
readonly selectOptions: Signal<SearchableSelectOption[]>;
|
|
21
|
+
onSelectionChange(value: unknown): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const animalCategorySelectTester: RankedTester;
|
|
24
|
+
export {};
|
package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
3
|
+
import { ControlElement, RankedTester } from '@jsonforms/core';
|
|
4
|
+
import { BaseSelectControl } from '../../../../shared/base-control/base-select-control';
|
|
5
|
+
import { BaseCodeListEntry } from '../../../../shared/option-sources/code-lists';
|
|
6
|
+
import { SearchableSelectOption } from '../../../../shared/searchable-select/searchable-select.component';
|
|
7
|
+
export declare function replaceDataPathLeaf(path: string | null | undefined, replacement: string): string | null;
|
|
8
|
+
export declare function deriveSiblingDependencyPath(uischema: ControlElement | null | undefined, path: string | null | undefined, replacement: string): string | null;
|
|
9
|
+
export declare class CodeListSelectRenderer extends BaseSelectControl<number | string> {
|
|
10
|
+
private readonly masterData;
|
|
11
|
+
private readonly i18n;
|
|
12
|
+
private readonly naebiData;
|
|
13
|
+
private readonly formData;
|
|
14
|
+
private readonly controlScope;
|
|
15
|
+
private explicitCodeListKey;
|
|
16
|
+
private controlKey;
|
|
17
|
+
private listKey;
|
|
18
|
+
readonly options: Signal<BaseCodeListEntry[]>;
|
|
19
|
+
readonly isMultiSelect: Signal<boolean>;
|
|
20
|
+
private readonly filterConfig;
|
|
21
|
+
private readonly emptyHintKey;
|
|
22
|
+
private readonly dependsOnDataPath;
|
|
23
|
+
private readonly autoDependsOnDataPath;
|
|
24
|
+
private scopePointerToDataPath;
|
|
25
|
+
private inferListKeyFromScope;
|
|
26
|
+
private readValueAtPath;
|
|
27
|
+
readonly filteredOptions: Signal<BaseCodeListEntry[]>;
|
|
28
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
29
|
+
getEventValue: (event: any) => any;
|
|
30
|
+
optionLabel(opt: BaseCodeListEntry): string;
|
|
31
|
+
readonly selectOptions: Signal<SearchableSelectOption[]>;
|
|
32
|
+
emptyHint(): string;
|
|
33
|
+
shouldShowEmptyHint(): boolean;
|
|
34
|
+
currentHints(): string[];
|
|
35
|
+
onSelectionChange(value: unknown): void;
|
|
36
|
+
}
|
|
37
|
+
export declare const codeListSelectTester: RankedTester;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { JsonFormsAbstractControl, JsonFormsAngularService } from '@jsonforms/angular';
|
|
3
|
+
import { ArrayLayoutProps, ArrayTranslations, JsonFormsState, OwnPropsOfRenderer, RankedTester, StatePropsOfArrayLayout, UISchemaElement, UISchemaTester } from '@jsonforms/core';
|
|
4
|
+
/**
|
|
5
|
+
* CustomArrayLayoutRenderer
|
|
6
|
+
* Overrides the stock JSONForms `ArrayLayoutRenderer` (rank 4 → this is rank 5) to apply
|
|
7
|
+
* the project UX pattern: centered empty-state placeholder when the array has no entries,
|
|
8
|
+
* and the full-width dashed add-button always anchored below the list.
|
|
9
|
+
*
|
|
10
|
+
* The add button label is driven by `translations.addTooltip` resolved via the JSONForms
|
|
11
|
+
* i18n pipeline — configure per-array labels there.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CustomArrayLayoutRenderer extends JsonFormsAbstractControl<StatePropsOfArrayLayout> implements OnInit {
|
|
14
|
+
noData: boolean;
|
|
15
|
+
/** Indices 0..n-1 used to render per-item cards and drive sort-button disabled state. */
|
|
16
|
+
indices: number[];
|
|
17
|
+
translations: ArrayTranslations;
|
|
18
|
+
showSortButtons: boolean;
|
|
19
|
+
addItem: (path: string, value: unknown) => () => void;
|
|
20
|
+
moveItemUp: (path: string, index: number) => () => void;
|
|
21
|
+
moveItemDown: (path: string, index: number) => () => void;
|
|
22
|
+
removeItems: (path: string, toDelete: number[]) => () => void;
|
|
23
|
+
uischemas: {
|
|
24
|
+
tester: UISchemaTester;
|
|
25
|
+
uischema: UISchemaElement;
|
|
26
|
+
}[];
|
|
27
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
28
|
+
get emptyText(): string;
|
|
29
|
+
get addLabel(): string;
|
|
30
|
+
mapToProps(state: JsonFormsState): StatePropsOfArrayLayout & {
|
|
31
|
+
translations: ArrayTranslations;
|
|
32
|
+
};
|
|
33
|
+
mapAdditionalProps(props: ArrayLayoutProps & {
|
|
34
|
+
translations: ArrayTranslations;
|
|
35
|
+
}): void;
|
|
36
|
+
remove(index: number): void;
|
|
37
|
+
add(): void;
|
|
38
|
+
up(index: number): void;
|
|
39
|
+
down(index: number): void;
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
getProps(index: number): OwnPropsOfRenderer;
|
|
42
|
+
}
|
|
43
|
+
export declare const customArrayLayoutRendererTester: RankedTester;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { JsonFormsBaseRenderer } from '@jsonforms/angular';
|
|
3
|
+
import { Categorization, Category } from '@jsonforms/core';
|
|
4
|
+
/**
|
|
5
|
+
* Custom categorization renderer with programmatic tab selection via NavigationService.
|
|
6
|
+
*
|
|
7
|
+
* Extends JSONForms default categorization by reading category keys from UI schema options
|
|
8
|
+
* and syncing with NavigationService.selectedCategory signal for deep-linking (e.g., validation errors).
|
|
9
|
+
*
|
|
10
|
+
* UI Schema: Add "options": { "categoryKey": "<key>" } to each Category element.
|
|
11
|
+
* Navigation: Call navigationSvc.setCategory(page, key) or navigate methods to select tabs programmatically.
|
|
12
|
+
* Bidirectional: User tab clicks update NavigationService state automatically.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SelectedCategoryCategorizationRenderer extends JsonFormsBaseRenderer<Categorization> implements OnInit {
|
|
15
|
+
private readonly jsonFormsService;
|
|
16
|
+
private readonly navigationSvc;
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
visibleCategories: (Category | Categorization)[];
|
|
19
|
+
categoryLabels: string[];
|
|
20
|
+
private readonly categoryKeyToIndex;
|
|
21
|
+
private readonly indexToCategoryKey;
|
|
22
|
+
private _prevCategorySignature;
|
|
23
|
+
readonly selectedTabIndex: import("@angular/core").Signal<number>;
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Build bidirectional category key ↔ tab index mapping from UI schema.
|
|
27
|
+
* Reads options.categoryKey from each visible Category element.
|
|
28
|
+
* Example: { base: 0, formOfDetention: 1, feeding: 2 }
|
|
29
|
+
* Skips signal writes when the tab structure hasn't changed (pure data changes
|
|
30
|
+
* fire $state on every keystroke; no need to mark selectedTabIndex stale each time).
|
|
31
|
+
*/
|
|
32
|
+
private buildCategoryMappings;
|
|
33
|
+
onTabChange(newIndex: number): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JsonFormsBaseRenderer } from '@jsonforms/angular';
|
|
2
|
+
import { Layout } from '@jsonforms/core';
|
|
3
|
+
/**
|
|
4
|
+
* Layout renderer for a custom UI schema element:
|
|
5
|
+
* { type: 'Constraint', options: { constraint: { resolver, args } }, elements: [ ... ] }
|
|
6
|
+
*
|
|
7
|
+
* It conditionally instantiates its children based on a named constraint
|
|
8
|
+
* resolver (see constraint-resolvers.ts). No additional DOM wrapper is added;
|
|
9
|
+
* children participate directly in surrounding layout.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ConstraintLayoutRenderer extends JsonFormsBaseRenderer<Layout> {
|
|
12
|
+
private readonly service;
|
|
13
|
+
private childrenHost?;
|
|
14
|
+
private subscription;
|
|
15
|
+
private _prevSig?;
|
|
16
|
+
private _elements;
|
|
17
|
+
private _schema;
|
|
18
|
+
private _path;
|
|
19
|
+
private _renderers;
|
|
20
|
+
private _cells;
|
|
21
|
+
private _constraintCfg;
|
|
22
|
+
private readonly masterData;
|
|
23
|
+
private readonly i18n;
|
|
24
|
+
private visible;
|
|
25
|
+
/** Test-only helper (not used in templates). */
|
|
26
|
+
isVisibleForTest(): boolean;
|
|
27
|
+
ngOnInit(): void;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
private renderChildren;
|
|
30
|
+
private pickRenderer;
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectorRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { GroupLayout, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry } from '@jsonforms/core';
|
|
3
|
+
import { JsonFormsAngularService, JsonFormsBaseRenderer } from '@jsonforms/angular';
|
|
4
|
+
export declare class BaseGroupRenderer extends JsonFormsBaseRenderer<GroupLayout> implements OnInit, OnDestroy {
|
|
5
|
+
protected readonly service: JsonFormsAngularService;
|
|
6
|
+
protected readonly cdr: ChangeDetectorRef;
|
|
7
|
+
protected _hidden: import("@angular/core").WritableSignal<boolean>;
|
|
8
|
+
protected _label: import("@angular/core").WritableSignal<string | undefined>;
|
|
9
|
+
protected _elements: import("@angular/core").WritableSignal<import("@jsonforms/core").UISchemaElement[]>;
|
|
10
|
+
protected _schema: import("@angular/core").WritableSignal<any>;
|
|
11
|
+
protected _path: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
protected _renderers: import("@angular/core").WritableSignal<JsonFormsRendererRegistryEntry[]>;
|
|
13
|
+
protected _cells: import("@angular/core").WritableSignal<JsonFormsCellRendererRegistryEntry[] | undefined>;
|
|
14
|
+
protected _id: string;
|
|
15
|
+
hidden(): boolean;
|
|
16
|
+
label(): string | undefined;
|
|
17
|
+
labelId(): string | null;
|
|
18
|
+
elements(): import("@jsonforms/core").UISchemaElement[];
|
|
19
|
+
get currentPath(): string;
|
|
20
|
+
get currentSchema(): any;
|
|
21
|
+
registryRenderers(): JsonFormsRendererRegistryEntry[];
|
|
22
|
+
registryCells(): JsonFormsCellRendererRegistryEntry[] | undefined;
|
|
23
|
+
private subscription;
|
|
24
|
+
private _destroyed;
|
|
25
|
+
private _prevSig?;
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
28
|
+
protected resolveHost(): ViewContainerRef | undefined;
|
|
29
|
+
protected renderChildren(): void;
|
|
30
|
+
private pickRenderer;
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 _enabled: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
protected readonly _label: import("@angular/core").WritableSignal<string | undefined>;
|
|
25
|
+
protected readonly _description: import("@angular/core").WritableSignal<string | undefined>;
|
|
26
|
+
protected readonly _modules: import("@angular/core").WritableSignal<ModuleCard[]>;
|
|
27
|
+
readonly labelId: string;
|
|
28
|
+
hidden: () => boolean;
|
|
29
|
+
enabled: () => boolean;
|
|
30
|
+
label: () => string | undefined;
|
|
31
|
+
description: () => string | undefined;
|
|
32
|
+
modules: () => ModuleCard[];
|
|
33
|
+
ngOnInit(): void;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
/** Flip a single module boolean in the JSONForms data store. No-op while the group is disabled. */
|
|
36
|
+
toggle(dataPath: string): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight abstraction for select-like JsonForms controls.
|
|
4
|
+
* Provides a uniform selection change handler and validation trigger.
|
|
5
|
+
* Concrete subclasses supply template + option source + label logic.
|
|
6
|
+
*
|
|
7
|
+
* Also injects custom validation errors from FieldErrorService into the FormControl
|
|
8
|
+
* so Angular Material mat-error displays them automatically.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseSelectControl<TValue = number> extends JsonFormsControl {
|
|
11
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
12
|
+
/** Override if event value extraction differs */
|
|
13
|
+
getEventValue: (event: any) => any;
|
|
14
|
+
/** Invoke when the user picks a new value. */
|
|
15
|
+
protected commitValue(value: TValue): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface BaseCodeListEntry {
|
|
2
|
+
id: number | string;
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
descriptor?: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export declare const CODE_LISTS: Record<string, BaseCodeListEntry[]>;
|
|
7
|
+
export declare const PATH_TO_LIST_KEY: Array<{
|
|
8
|
+
regex: RegExp;
|
|
9
|
+
key: keyof typeof CODE_LISTS;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function resolveCodeListKey(tail: string): string | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accent- and case-insensitive matching/highlighting helpers for the searchable select.
|
|
3
|
+
* Pure functions (no DI) so matching semantics stay unit-testable without a component fixture.
|
|
4
|
+
*/
|
|
5
|
+
export interface HighlightSegment {
|
|
6
|
+
text: string;
|
|
7
|
+
match: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Folds a string for comparison: NFD decomposition + strip diacritics + lowercase. */
|
|
10
|
+
export declare function normalizeForSearch(value: string): string;
|
|
11
|
+
/** True when `query` (raw or normalized) is found in the label, ignoring case/accents. */
|
|
12
|
+
export declare function matchesSearch(label: string, query: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Splits `label` into segments flagging every occurrence of `normalizedQuery`.
|
|
15
|
+
* Matching runs on the normalized form but slices the original string, so accents/casing
|
|
16
|
+
* typed by the user still highlight the original characters (e.g. "mat" highlights "Mât").
|
|
17
|
+
*/
|
|
18
|
+
export declare function highlightSegments(label: string, normalizedQuery: string): HighlightSegment[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
import { HighlightSegment } from './search-highlight';
|
|
3
|
+
export interface SearchableSelectOption<T = string | number> {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
interface VisibleOption {
|
|
8
|
+
value: unknown;
|
|
9
|
+
segments: HighlightSegment[];
|
|
10
|
+
/** True when the option does not match the current search — kept in the DOM (hidden +
|
|
11
|
+
* disabled) so the mat-select trigger keeps the selected option's label while typing,
|
|
12
|
+
* and so the panel key manager natively skips it during arrow navigation. */
|
|
13
|
+
filteredOut: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* mat-select with a sticky search field inside the panel: typing filters options and highlights
|
|
17
|
+
* the matched text (`<mark>`-style), arrows move the active (highlighted) option and Enter
|
|
18
|
+
* selects it — so the control stays fully usable with the keyboard only.
|
|
19
|
+
*
|
|
20
|
+
* Two binding modes:
|
|
21
|
+
* - reactive: pass `control` (JSONForms renderers);
|
|
22
|
+
* - plain value: pass `value` (+ `disabled`, `nullable`) — used by the inline-table cells.
|
|
23
|
+
* The panel content is duplicated in both mat-select branches on purpose: nodes rendered
|
|
24
|
+
* through a shared `<ng-template>` outlet are NOT moved into the select overlay by content
|
|
25
|
+
* projection (the anchor moves, the embedded view stays), so options/trigger would break.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SearchableSelectComponent {
|
|
28
|
+
readonly control: import("@angular/core").InputSignal<FormControl<any> | null>;
|
|
29
|
+
readonly value: import("@angular/core").InputSignal<unknown>;
|
|
30
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
readonly options: import("@angular/core").InputSignal<readonly SearchableSelectOption<string | number>[]>;
|
|
32
|
+
readonly label: import("@angular/core").InputSignal<string | null | undefined>;
|
|
33
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
34
|
+
readonly multiple: import("@angular/core").InputSignal<boolean>;
|
|
35
|
+
readonly hidden: import("@angular/core").InputSignal<boolean>;
|
|
36
|
+
readonly hints: import("@angular/core").InputSignal<readonly string[]>;
|
|
37
|
+
readonly error: import("@angular/core").InputSignal<string | null | undefined>;
|
|
38
|
+
/** Adds a leading null option rendered as « – » so the selection can be cleared. */
|
|
39
|
+
readonly nullable: import("@angular/core").InputSignal<boolean>;
|
|
40
|
+
/** Table-cell density: no label, 40px container, hidden subscript wrapper. */
|
|
41
|
+
readonly compact: import("@angular/core").InputSignal<boolean>;
|
|
42
|
+
readonly selectionChange: import("@angular/core").OutputEmitterRef<unknown>;
|
|
43
|
+
private readonly i18n;
|
|
44
|
+
private readonly matSelect;
|
|
45
|
+
private readonly searchInput;
|
|
46
|
+
protected readonly query: import("@angular/core").WritableSignal<string>;
|
|
47
|
+
private readonly panelOpen;
|
|
48
|
+
protected readonly placeholderText: import("@angular/core").Signal<string>;
|
|
49
|
+
protected readonly noResultsText: import("@angular/core").Signal<string>;
|
|
50
|
+
protected readonly optionViews: import("@angular/core").Signal<VisibleOption[]>;
|
|
51
|
+
protected readonly hasVisibleOptions: import("@angular/core").Signal<boolean>;
|
|
52
|
+
constructor();
|
|
53
|
+
protected onQueryInput(event: Event): void;
|
|
54
|
+
protected onSearchKeydown(event: KeyboardEvent): void;
|
|
55
|
+
protected onOpenedChange(open: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* mat-select keeps a stale active item when filtering shrinks the option list, which would
|
|
58
|
+
* let Enter pick an invisible option. There is no public API for this, so reach the key
|
|
59
|
+
* manager defensively and pin the highlight to the first visible match.
|
|
60
|
+
*/
|
|
61
|
+
private syncActiveOption;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ErrorObject } from 'ajv';
|
|
2
|
+
/**
|
|
3
|
+
* Service to share validation errors from JSONForms across custom renderers.
|
|
4
|
+
* Allows renderers to display field-specific errors from custom AJV keywords.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FieldErrorService {
|
|
7
|
+
private readonly errors;
|
|
8
|
+
/** Update the global error list from JSONForms validation */
|
|
9
|
+
setErrors(errors: ErrorObject[] | null): void;
|
|
10
|
+
/** Get error message for a specific field path */
|
|
11
|
+
getErrorForPath(scopeOrInstancePath: string): string | null;
|
|
12
|
+
/** Get all errors for a specific field path */
|
|
13
|
+
getErrorsForPath(scopeOrInstancePath: string): ErrorObject[];
|
|
14
|
+
/** Clear all errors */
|
|
15
|
+
clearErrors(): void;
|
|
16
|
+
private normalizeScope;
|
|
17
|
+
private normalizeInstancePath;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
import { AnimalStockRow } from '../animal-stock.types';
|
|
3
|
+
import { ErrorObject } from 'ajv';
|
|
4
|
+
export declare class AnimalStockDetailComponent {
|
|
5
|
+
private readonly i18n;
|
|
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>;
|
|
11
|
+
private readonly baseUi;
|
|
12
|
+
localizedUi: import("@angular/core").Signal<UISchemaElement>;
|
|
13
|
+
jsonFormsData: import("@angular/core").Signal<(AnimalStockRow & import("../../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
14
|
+
readonly renderers: {
|
|
15
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
16
|
+
renderer: any;
|
|
17
|
+
}[];
|
|
18
|
+
readonly suibiAjv: import("ajv").Ajv;
|
|
19
|
+
onDataChange(newData: any): void;
|
|
20
|
+
onValidationErrors(_errors: ErrorObject[] | null | undefined): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
2
|
+
import { AnimalStockRow } from '../animal-stock.types';
|
|
3
|
+
export declare class AnimalStockListComponent {
|
|
4
|
+
private readonly masterData;
|
|
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<{
|
|
10
|
+
previousIndex: number;
|
|
11
|
+
currentIndex: number;
|
|
12
|
+
}>;
|
|
13
|
+
displayedColumns: string[];
|
|
14
|
+
onDelete(index: number, event: Event): void;
|
|
15
|
+
drop(event: CdkDragDrop<AnimalStockRow[]>): void;
|
|
16
|
+
resolveAnimalCategory(id: unknown): string;
|
|
17
|
+
resolveUtilisation(id: unknown): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnimalStockRow } from '../animal-stock.types';
|
|
2
|
+
import { LifetimePerformance } from '../../lifetime-performance/lifetime-performance.types';
|
|
3
|
+
export declare class AnimalStockMasterDetailComponent {
|
|
4
|
+
private readonly dataSvc;
|
|
5
|
+
private readonly navigationSvc;
|
|
6
|
+
constructor();
|
|
7
|
+
readonly rows: import("@angular/core").Signal<AnimalStockRow[]>;
|
|
8
|
+
readonly lifetimePerformance: import("@angular/core").Signal<LifetimePerformance | null>;
|
|
9
|
+
readonly selectedIndex: import("@angular/core").WritableSignal<number | null>;
|
|
10
|
+
readonly detailData: import("@angular/core").Signal<any>;
|
|
11
|
+
openDetail(index: number): void;
|
|
12
|
+
closeDetail(): void;
|
|
13
|
+
onRowClick(_row: AnimalStockRow, index: number): void;
|
|
14
|
+
addRow(): void;
|
|
15
|
+
deleteRow(index: number): void;
|
|
16
|
+
reorderRow(event: {
|
|
17
|
+
previousIndex: number;
|
|
18
|
+
currentIndex: number;
|
|
19
|
+
}): void;
|
|
20
|
+
onDetailChange(newData: any): void;
|
|
21
|
+
onLifetimePerformanceChange(payload: LifetimePerformance): void;
|
|
22
|
+
private patchRows;
|
|
23
|
+
private patchLifetimePerformance;
|
|
24
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface FeedingRoutineItem {
|
|
2
|
+
typeOfFeedstuffProduct?: string;
|
|
3
|
+
transactionUnit?: string;
|
|
4
|
+
quantity?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SeasonalFeeding {
|
|
7
|
+
feedingRoutine?: FeedingRoutineItem[];
|
|
8
|
+
dailyConcentratedFeedstuff?: {
|
|
9
|
+
quantity?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface Feeding {
|
|
13
|
+
fodderConsumption?: number;
|
|
14
|
+
concentratedFeedstuffConsumption?: number;
|
|
15
|
+
winterFeeding?: SeasonalFeeding;
|
|
16
|
+
summerFeeding?: SeasonalFeeding;
|
|
17
|
+
}
|
|
18
|
+
export interface Stall {
|
|
19
|
+
stableSystem?: number;
|
|
20
|
+
stableCapacity?: number;
|
|
21
|
+
stableVentilationType?: number | null;
|
|
22
|
+
stableAirPurification?: number | null;
|
|
23
|
+
hasStableDeepLitter?: boolean;
|
|
24
|
+
hasStableManureBeltDrying?: boolean;
|
|
25
|
+
stableManureRemovalFrequency?: number | null;
|
|
26
|
+
stableWaterSupply?: number | null;
|
|
27
|
+
hasStableManureAndSlurryProduction?: boolean;
|
|
28
|
+
hasStableFeedingStationElevated?: boolean;
|
|
29
|
+
hasStableFloorSlopedUrineDrainage?: boolean;
|
|
30
|
+
hasYard?: boolean;
|
|
31
|
+
yardFeeding?: number | null;
|
|
32
|
+
yardFloorType?: number | null;
|
|
33
|
+
yardDays?: number;
|
|
34
|
+
yardHoursPerDay?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface Pasture {
|
|
37
|
+
days?: number;
|
|
38
|
+
hoursPerDay?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface FormOfDetention {
|
|
41
|
+
hasGrazing?: boolean;
|
|
42
|
+
pasture?: Pasture;
|
|
43
|
+
stall?: Stall;
|
|
44
|
+
}
|
|
45
|
+
export interface LivestockReport {
|
|
46
|
+
durationSumTotalNutrientBalance?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface SelfReportedLivestock {
|
|
49
|
+
averageQuantity?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface LinearCorrection {
|
|
52
|
+
duration?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface AnimalStockRow {
|
|
55
|
+
order?: number | string;
|
|
56
|
+
animalCategoryPRIF?: number;
|
|
57
|
+
livestockReportViaAnimalTracingOriginal?: LivestockReport;
|
|
58
|
+
livestockReportedViaAnimalTracingFinal?: LivestockReport;
|
|
59
|
+
selfReportedLivestock?: SelfReportedLivestock;
|
|
60
|
+
durationCorrectionQuantity?: number;
|
|
61
|
+
durationCorrectionDays?: number;
|
|
62
|
+
hasImpexDerivedExcretion?: boolean;
|
|
63
|
+
hasLinearCorrectionDerivedExcretion?: boolean;
|
|
64
|
+
linearCorrection?: LinearCorrection;
|
|
65
|
+
utilisation?: number;
|
|
66
|
+
formOfDetention?: FormOfDetention;
|
|
67
|
+
feeding?: Feeding;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FarmManureTradingSupply, FarmManureTradingDispense } from '../farm-manure-trading.types';
|
|
2
|
+
/**
|
|
3
|
+
* Farm manure trading page — two inline tables (supply "Reprises" / dispense
|
|
4
|
+
* "Cessions") editing `nutrientCycle.farmManureTrading` directly. The former
|
|
5
|
+
* master-detail round-trip (list + JSONForms detail pane) was replaced by inline
|
|
6
|
+
* editing, so validation deep-links (`selectedFarmManureTrading`) are merely
|
|
7
|
+
* consumed and cleared — there is no detail pane left to open (fodder pattern).
|
|
8
|
+
*/
|
|
9
|
+
export declare class FarmManureTradingMasterDetailComponent {
|
|
10
|
+
private readonly dataSvc;
|
|
11
|
+
private readonly navigationSvc;
|
|
12
|
+
constructor();
|
|
13
|
+
readonly supplyRows: import("@angular/core").Signal<FarmManureTradingSupply[]>;
|
|
14
|
+
readonly dispenseRows: import("@angular/core").Signal<FarmManureTradingDispense[]>;
|
|
15
|
+
onSupplyChange(rows: FarmManureTradingSupply[]): void;
|
|
16
|
+
onDispenseChange(rows: FarmManureTradingDispense[]): void;
|
|
17
|
+
private patchRows;
|
|
18
|
+
private cloneTrading;
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { InlineTableConfig } from '../../../components/inline-table/inline-table.types';
|
|
2
|
+
import { FarmManureTradingMode } from '../../../core/navigation/navigation.service';
|
|
3
|
+
import { FarmManureTradingSupply, FarmManureTradingDispense } from '../farm-manure-trading.types';
|
|
4
|
+
type TradingRow = FarmManureTradingSupply | FarmManureTradingDispense;
|
|
5
|
+
/**
|
|
6
|
+
* FarmManureTradingTableComponent — thin wrapper around InlineTableComponent.
|
|
7
|
+
*
|
|
8
|
+
* Responsibilities:
|
|
9
|
+
* 1. Provides the per-mode column/section config (the "uischema").
|
|
10
|
+
* 2. Bridges typed `FarmManureTradingSupply[]`/`Dispense[]` to/from the generic
|
|
11
|
+
* `Record<string, unknown>[]` API of InlineTableComponent.
|
|
12
|
+
* 3. Supplies `deriveUnits` as a `rowTransform` — the base `transactionUnit` ('kg'/'m3')
|
|
13
|
+
* and every ingredient's `unit` ('kg/t'/'kg/m3') are derived from the selected
|
|
14
|
+
* product's matterState; the user may switch to a custom unit sharing the same base
|
|
15
|
+
* (t, dt for kg), which converts the entered quantity on the fly.
|
|
16
|
+
*/
|
|
17
|
+
export declare class FarmManureTradingTableComponent {
|
|
18
|
+
readonly mode: import("@angular/core").InputSignal<FarmManureTradingMode>;
|
|
19
|
+
readonly entries: import("@angular/core").InputSignal<TradingRow[]>;
|
|
20
|
+
readonly entriesChange: import("@angular/core").OutputEmitterRef<TradingRow[]>;
|
|
21
|
+
protected readonly config: import("@angular/core").Signal<InlineTableConfig>;
|
|
22
|
+
/** Cast typed entries to generic Record[] for InlineTableComponent. */
|
|
23
|
+
readonly rowsForTable: import("@angular/core").Signal<Record<string, unknown>[]>;
|
|
24
|
+
/** Cast generic output back to typed trading rows. */
|
|
25
|
+
onRowsChange(rows: Record<string, unknown>[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* Row transform deriving the ingredient units from the product's matterState on each
|
|
28
|
+
* edit, and handling `transactionUnit`:
|
|
29
|
+
* - product change (or missing unit on legacy rows): reset to the derived base unit,
|
|
30
|
+
* - unit switch: convert the entered quantity from the previous to the new unit
|
|
31
|
+
* (both share the same base), so the transacted amount is preserved.
|
|
32
|
+
* - no product picked yet: keep the pre-filtered unit the user chose (kg/m3/t/dt)
|
|
33
|
+
* instead of clearing it on every edit.
|
|
34
|
+
*/
|
|
35
|
+
readonly deriveUnits: (changedKey: string, newValue: unknown, row: Record<string, unknown>, previousRow?: Record<string, unknown>) => Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|