@agridea/suibi-module 0.1.0-preview.10
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 +67 -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 +67 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.10.css +1 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.10.js +67 -0
- package/dist/elements/browser/suibi-theme-dark.css +1 -0
- package/dist/elements/browser/version.txt +1 -0
- package/dist/types/app/app.config.d.ts +2 -0
- package/dist/types/app/app.d.ts +26 -0
- package/dist/types/app/core/data/naebi-data.service.d.ts +232 -0
- package/dist/types/app/core/i18n/i18n.service.d.ts +20 -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/master-data/master-data.service.d.ts +18 -0
- package/dist/types/app/core/navigation/navigation.service.d.ts +61 -0
- package/dist/types/app/core/schemas/index.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/validation/ajv-custom.d.ts +15 -0
- package/dist/types/app/core/validation/capabilities.d.ts +18 -0
- package/dist/types/app/core/validation/error-formatter.d.ts +19 -0
- package/dist/types/app/core/validation/global-validation.service.d.ts +34 -0
- package/dist/types/app/core/validation/validation-errors-panel.d.ts +36 -0
- package/dist/types/app/data-preview.d.ts +7 -0
- package/dist/types/app/header-bar.d.ts +14 -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 +60 -0
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +30 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +21 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +20 -0
- package/dist/types/app/jsonforms/renderers/layout/categorization/selected-category-categorization.renderer.d.ts +31 -0
- package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +30 -0
- package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +29 -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/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/validation/field-error.service.d.ts +18 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-list.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-master-detail.component.d.ts +25 -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/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/welcome-page.d.ts +4 -0
- package/dist/types/public-api.d.ts +4 -0
- package/dist/types/shared/material-icons.d.ts +16 -0
- package/package.json +90 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint resolver registry enabling UI schema elements to declare dynamic
|
|
3
|
+
* visibility rules referencing domain-specific predicates. A resolver is a
|
|
4
|
+
* pure function returning a boolean. It receives a contextual accessor for
|
|
5
|
+
* current form data (root object) plus master-data + locale.
|
|
6
|
+
*
|
|
7
|
+
* UI schema structured example:
|
|
8
|
+
* {
|
|
9
|
+
* "type": "Constraint",
|
|
10
|
+
* "options": {
|
|
11
|
+
* "constraint": {
|
|
12
|
+
* "resolver": "animalCategory_isPermittedForConcentratedFeedstuffSummering",
|
|
13
|
+
* "args": ["#/animalCategoryPRIF"],
|
|
14
|
+
* "fallbackVisible": false
|
|
15
|
+
* }
|
|
16
|
+
* },
|
|
17
|
+
* "elements": [ { "type": "Group", ... } ]
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
import { MasterDataService } from '../../core/master-data/master-data.service';
|
|
21
|
+
import { I18nService } from '../../core/i18n/i18n.service';
|
|
22
|
+
export interface ConstraintCall {
|
|
23
|
+
resolver: string;
|
|
24
|
+
args?: unknown[];
|
|
25
|
+
fallbackVisible?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export type ConstraintConfig = ConstraintCall;
|
|
28
|
+
export interface ConstraintContext {
|
|
29
|
+
/** Root data object from JSONForms state */
|
|
30
|
+
data: unknown;
|
|
31
|
+
/** Dereference a JSON Pointer (starts with '#/'); returns undefined if invalid */
|
|
32
|
+
get<T = unknown>(pointer: string): T | undefined;
|
|
33
|
+
/** Master-data service */
|
|
34
|
+
masterData: MasterDataService;
|
|
35
|
+
/** Current locale (from I18nService) */
|
|
36
|
+
locale: string;
|
|
37
|
+
}
|
|
38
|
+
export type ConstraintResolver = (ctx: ConstraintContext, ...args: any[]) => boolean;
|
|
39
|
+
export declare function registerConstraint(name: string, fn: ConstraintResolver): void;
|
|
40
|
+
/**
|
|
41
|
+
* Evaluate a constraint configuration.
|
|
42
|
+
* @param cfg constraint object (or undefined => visible)
|
|
43
|
+
* @param data current form data root
|
|
44
|
+
* @param services injected service wrappers
|
|
45
|
+
* @param ctxOverrides optional context override (testing/extensibility)
|
|
46
|
+
*/
|
|
47
|
+
export declare function evaluateConstraint(cfg: ConstraintConfig | undefined, data: unknown, services: {
|
|
48
|
+
masterData: MasterDataService;
|
|
49
|
+
i18n: I18nService;
|
|
50
|
+
}, ctxOverrides?: Partial<ConstraintContext>): boolean;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code list filtering engine & resolver registry.
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Allow UI schema controls rendering code list selects to declaratively
|
|
5
|
+
* filter the available options based on current form data (JSONForms), master data,
|
|
6
|
+
* locale, and arbitrary domain predicates – without baking domain logic into the
|
|
7
|
+
* generic select renderer.
|
|
8
|
+
*
|
|
9
|
+
* UI schema extension example (implicit generic filter using entryField/valueFrom):
|
|
10
|
+
* {
|
|
11
|
+
* "type": "Control",
|
|
12
|
+
* "scope": "#/properties/formOfDetention/properties/stall/properties/stableManureRemovalFrequency",
|
|
13
|
+
* "options": {
|
|
14
|
+
* "codeList": { "filter": { "entryField": "permittedForStableSystem", "valueFrom": "#/formOfDetention/stall/stableSystem", "fallback": "all" } }
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* Named resolver example:
|
|
19
|
+
* "filter": { "resolver": "stableManureRemoval_permittedForSystem", "args": ["#/formOfDetention/stall/stableSystem"], "fallback": "all" }
|
|
20
|
+
*/
|
|
21
|
+
import { MasterDataService } from '../../core/master-data/master-data.service';
|
|
22
|
+
import { I18nService } from '../../core/i18n/i18n.service';
|
|
23
|
+
import { BaseCodeListEntry } from '../shared/option-sources/code-lists';
|
|
24
|
+
export interface FilterContext {
|
|
25
|
+
data: unknown;
|
|
26
|
+
get<T = unknown>(pointer: string): T | undefined;
|
|
27
|
+
masterData: MasterDataService;
|
|
28
|
+
locale: string;
|
|
29
|
+
i18n: I18nService;
|
|
30
|
+
}
|
|
31
|
+
export type CodeListFilterResolver = (ctx: FilterContext, entry: BaseCodeListEntry, ...args: any[]) => boolean;
|
|
32
|
+
export interface LeafFilterCall {
|
|
33
|
+
resolver?: string;
|
|
34
|
+
args?: unknown[];
|
|
35
|
+
entryField?: string;
|
|
36
|
+
valueFrom?: string;
|
|
37
|
+
fallback?: 'all' | 'none';
|
|
38
|
+
}
|
|
39
|
+
export type FilterConfig = LeafFilterCall | {
|
|
40
|
+
all: FilterConfig[];
|
|
41
|
+
fallback?: 'all' | 'none';
|
|
42
|
+
} | {
|
|
43
|
+
any: FilterConfig[];
|
|
44
|
+
fallback?: 'all' | 'none';
|
|
45
|
+
} | {
|
|
46
|
+
not: FilterConfig;
|
|
47
|
+
fallback?: 'all' | 'none';
|
|
48
|
+
} | {
|
|
49
|
+
true: boolean;
|
|
50
|
+
fallback?: 'all' | 'none';
|
|
51
|
+
};
|
|
52
|
+
export declare function registerCodeListFilter(name: string, fn: CodeListFilterResolver): void;
|
|
53
|
+
/**
|
|
54
|
+
* Public entry to filter a list. Returns the provided list unchanged if cfg is falsy or
|
|
55
|
+
* if top-level fallback === 'all' and an unrecoverable error occurs.
|
|
56
|
+
*/
|
|
57
|
+
export declare function evaluateFilter(list: BaseCodeListEntry[], cfg: FilterConfig | undefined, services: {
|
|
58
|
+
masterData: MasterDataService;
|
|
59
|
+
i18n: I18nService;
|
|
60
|
+
}, data: unknown): BaseCodeListEntry[];
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { RankedTester } from '@jsonforms/core';
|
|
7
|
+
import { ConstraintLayoutRenderer } from '../renderers/layout/constraint/constraint-layout.renderer';
|
|
8
|
+
import { SelectedCategoryCategorizationRenderer } from '../renderers/layout/categorization/selected-category-categorization.renderer';
|
|
9
|
+
export declare const CUSTOM_JSONFORMS_RENDERERS: ({
|
|
10
|
+
tester: RankedTester;
|
|
11
|
+
renderer: typeof ConstraintLayoutRenderer;
|
|
12
|
+
} | {
|
|
13
|
+
tester: RankedTester;
|
|
14
|
+
renderer: typeof SelectedCategoryCategorizationRenderer;
|
|
15
|
+
} | {
|
|
16
|
+
tester: RankedTester;
|
|
17
|
+
renderer: typeof CardGroupRenderer;
|
|
18
|
+
} | {
|
|
19
|
+
tester: RankedTester;
|
|
20
|
+
renderer: typeof PlainGroupRenderer;
|
|
21
|
+
} | {
|
|
22
|
+
tester: RankedTester;
|
|
23
|
+
renderer: typeof LogicalGroupRenderer;
|
|
24
|
+
} | {
|
|
25
|
+
tester: RankedTester;
|
|
26
|
+
renderer: typeof AnimalCategorySelectRenderer;
|
|
27
|
+
} | {
|
|
28
|
+
tester: RankedTester;
|
|
29
|
+
renderer: typeof CodeListSelectRenderer;
|
|
30
|
+
})[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
2
|
+
import { RankedTester } from '@jsonforms/core';
|
|
3
|
+
import { BaseSelectControl } from '../../../../shared/base-control/base-select-control';
|
|
4
|
+
interface AnimalCategoryPrifEntry {
|
|
5
|
+
id: number;
|
|
6
|
+
animalGroup?: string;
|
|
7
|
+
descriptor?: {
|
|
8
|
+
designation_ita?: string;
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare class AnimalCategorySelectRenderer extends BaseSelectControl<number> {
|
|
13
|
+
options: AnimalCategoryPrifEntry[];
|
|
14
|
+
private readonly masterData;
|
|
15
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
16
|
+
getEventValue: (event: any) => any;
|
|
17
|
+
optLabel(opt: AnimalCategoryPrifEntry): string;
|
|
18
|
+
onSelectionChange(value: number): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const animalCategorySelectTester: RankedTester;
|
|
21
|
+
export {};
|
package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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 { BaseCodeListEntry } from '../../../../shared/option-sources/code-lists';
|
|
6
|
+
export declare class CodeListSelectRenderer extends BaseSelectControl<number | string> {
|
|
7
|
+
private readonly masterData;
|
|
8
|
+
private readonly i18n;
|
|
9
|
+
private readonly formData;
|
|
10
|
+
private controlKey;
|
|
11
|
+
private listKey;
|
|
12
|
+
readonly options: Signal<BaseCodeListEntry[]>;
|
|
13
|
+
private readonly filterConfig;
|
|
14
|
+
readonly filteredOptions: Signal<BaseCodeListEntry[]>;
|
|
15
|
+
constructor(jsonFormsService: JsonFormsAngularService);
|
|
16
|
+
getEventValue: (event: any) => any;
|
|
17
|
+
optionLabel(opt: BaseCodeListEntry): string;
|
|
18
|
+
onSelectionChange(value: number | string): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const codeListSelectTester: RankedTester;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
readonly selectedTabIndex: import("@angular/core").Signal<number>;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Build bidirectional category key ↔ tab index mapping from UI schema.
|
|
26
|
+
* Reads options.categoryKey from each visible Category element.
|
|
27
|
+
* Example: { base: 0, formOfDetention: 1, feeding: 2 }
|
|
28
|
+
*/
|
|
29
|
+
private buildCategoryMappings;
|
|
30
|
+
onTabChange(newIndex: number): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 _elements;
|
|
16
|
+
private _schema;
|
|
17
|
+
private _path;
|
|
18
|
+
private _renderers;
|
|
19
|
+
private _cells;
|
|
20
|
+
private _constraintCfg;
|
|
21
|
+
private readonly masterData;
|
|
22
|
+
private readonly i18n;
|
|
23
|
+
private visible;
|
|
24
|
+
/** Test-only helper (not used in templates). */
|
|
25
|
+
isVisibleForTest(): boolean;
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
28
|
+
private renderChildren;
|
|
29
|
+
private pickRenderer;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
ngOnInit(): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
protected resolveHost(): ViewContainerRef | undefined;
|
|
27
|
+
protected renderChildren(): void;
|
|
28
|
+
private pickRenderer;
|
|
29
|
+
}
|
|
@@ -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
|
+
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,22 @@
|
|
|
1
|
+
import { EventEmitter, Signal } from '@angular/core';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
3
|
+
import { AnimalStockRow } from './animal-stock.types';
|
|
4
|
+
import { ErrorObject } from 'ajv';
|
|
5
|
+
export declare class AnimalStockDetailComponent {
|
|
6
|
+
private readonly i18n;
|
|
7
|
+
row: Signal<AnimalStockRow | null>;
|
|
8
|
+
index: Signal<number | null>;
|
|
9
|
+
rowChange: EventEmitter<AnimalStockRow>;
|
|
10
|
+
close: EventEmitter<void>;
|
|
11
|
+
itemSchema: Signal<JsonSchema>;
|
|
12
|
+
private readonly baseUi;
|
|
13
|
+
localizedUi: Signal<UISchemaElement>;
|
|
14
|
+
jsonFormsData: Signal<(AnimalStockRow & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions) | null>;
|
|
15
|
+
readonly renderers: {
|
|
16
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
17
|
+
renderer: any;
|
|
18
|
+
}[];
|
|
19
|
+
readonly suibiAjv: import("ajv").Ajv;
|
|
20
|
+
onDataChange(newData: any): void;
|
|
21
|
+
onValidationErrors(_errors: ErrorObject[] | null | undefined): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EventEmitter, Signal } from '@angular/core';
|
|
2
|
+
import { MatTable } from '@angular/material/table';
|
|
3
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
4
|
+
import { AnimalStockRow } from './animal-stock.types';
|
|
5
|
+
export declare class AnimalStockListComponent {
|
|
6
|
+
private readonly masterData;
|
|
7
|
+
table: MatTable<AnimalStockRow>;
|
|
8
|
+
rows: Signal<AnimalStockRow[]>;
|
|
9
|
+
select: EventEmitter<number>;
|
|
10
|
+
add: EventEmitter<void>;
|
|
11
|
+
delete: EventEmitter<number>;
|
|
12
|
+
reorder: EventEmitter<{
|
|
13
|
+
previousIndex: number;
|
|
14
|
+
currentIndex: number;
|
|
15
|
+
}>;
|
|
16
|
+
displayedColumns: string[];
|
|
17
|
+
onDelete(index: number, event: Event): void;
|
|
18
|
+
drop(event: CdkDragDrop<AnimalStockRow[]>): void;
|
|
19
|
+
resolveAnimalCategory(id: unknown): string;
|
|
20
|
+
resolveUtilisation(id: unknown): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
private readonly rootData;
|
|
7
|
+
constructor();
|
|
8
|
+
readonly rows: import("@angular/core").Signal<AnimalStockRow[]>;
|
|
9
|
+
readonly lifetimePerformance: import("@angular/core").Signal<LifetimePerformance | null>;
|
|
10
|
+
readonly selectedIndex: import("@angular/core").WritableSignal<number | null>;
|
|
11
|
+
readonly detailData: import("@angular/core").Signal<any>;
|
|
12
|
+
openDetail(index: number): void;
|
|
13
|
+
closeDetail(): void;
|
|
14
|
+
onRowClick(_row: AnimalStockRow, index: number): void;
|
|
15
|
+
addRow(): void;
|
|
16
|
+
deleteRow(index: number): void;
|
|
17
|
+
reorderRow(event: {
|
|
18
|
+
previousIndex: number;
|
|
19
|
+
currentIndex: number;
|
|
20
|
+
}): void;
|
|
21
|
+
onDetailChange(newData: any): void;
|
|
22
|
+
onLifetimePerformanceChange(payload: LifetimePerformance): void;
|
|
23
|
+
private patchRows;
|
|
24
|
+
private patchLifetimePerformance;
|
|
25
|
+
}
|
|
@@ -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;
|
|
22
|
+
stableAirPurification?: number;
|
|
23
|
+
hasStableDeepLitter?: boolean;
|
|
24
|
+
hasStableManureBeltDrying?: boolean;
|
|
25
|
+
stableManureRemovalFrequency?: number;
|
|
26
|
+
stableWaterSupply?: number;
|
|
27
|
+
hasStableManureAndSlurryProduction?: boolean;
|
|
28
|
+
hasStableFeedingStationElevated?: boolean;
|
|
29
|
+
hasStableFloorSlopedUrineDrainage?: boolean;
|
|
30
|
+
hasYard?: boolean;
|
|
31
|
+
yardFeeding?: number;
|
|
32
|
+
yardFloorType?: number;
|
|
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
|
+
}
|
package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
import { AnimalStockRow } from '../animal-stock/animal-stock.types';
|
|
3
|
+
import { LifetimePerformance } from './lifetime-performance.types';
|
|
4
|
+
export declare class LifetimePerformanceFormComponent {
|
|
5
|
+
private readonly i18n;
|
|
6
|
+
private readonly masterData;
|
|
7
|
+
rows: import("@angular/core").InputSignal<AnimalStockRow[]>;
|
|
8
|
+
lifetimePerformance: import("@angular/core").InputSignal<LifetimePerformance | null | undefined>;
|
|
9
|
+
dataChange: import("@angular/core").OutputEmitterRef<LifetimePerformance>;
|
|
10
|
+
readonly renderers: {
|
|
11
|
+
tester: import("@jsonforms/core").RankedTester;
|
|
12
|
+
renderer: any;
|
|
13
|
+
}[];
|
|
14
|
+
readonly suibiAjv: import("ajv").Ajv;
|
|
15
|
+
private readonly beefFields;
|
|
16
|
+
private readonly dairyFields;
|
|
17
|
+
private readonly hasBeefRows;
|
|
18
|
+
private readonly hasDairyRows;
|
|
19
|
+
private readonly activeFields;
|
|
20
|
+
readonly shouldRender: import("@angular/core").Signal<boolean>;
|
|
21
|
+
readonly schema: import("@angular/core").Signal<JsonSchema>;
|
|
22
|
+
readonly localizedUi: import("@angular/core").Signal<UISchemaElement>;
|
|
23
|
+
readonly jsonFormsData: import("@angular/core").Signal<LifetimePerformance & import("../../core/schemas/ui-helper-registry").UiHelperDefinitions>;
|
|
24
|
+
private readonly pruneDisallowedEffect;
|
|
25
|
+
onDataChange(newValue: unknown): void;
|
|
26
|
+
private hasGroup;
|
|
27
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { NaebiData } from './app/core/data/naebi-data.service';
|
|
2
|
+
export type { Locale } from './app/core/i18n/i18n.service';
|
|
3
|
+
export type { PageId, AnimalStockCategory } from './app/core/navigation/navigation.service';
|
|
4
|
+
export type { EnrichedValidationError } from './app/core/validation/global-validation.service';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensure the Material Icons stylesheet exists in the document <head> (SPA / non-shadow usage).
|
|
3
|
+
* Idempotent: returns immediately if DOM unavailable (SSR) or link already present.
|
|
4
|
+
*
|
|
5
|
+
* @param doc Optional document for testing / dependency injection.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureMaterialIconsInHead(doc?: Document): void;
|
|
8
|
+
/**
|
|
9
|
+
* Ensure the Material Icons stylesheet is available inside a ShadowRoot so that
|
|
10
|
+
* icon ligatures render when the component is embedded as a Web Component.
|
|
11
|
+
* We prepend so icons load early without disturbing existing adopted stylesheets.
|
|
12
|
+
* Idempotent: guarded by a custom attribute selector.
|
|
13
|
+
*
|
|
14
|
+
* @param shadow Target ShadowRoot; silently no-ops if null/undefined or DOM unavailable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ensureMaterialIconsInShadow(shadow: ShadowRoot | null | undefined): void;
|