@hestia-earth/ui-components 0.43.17 → 0.43.18
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/fesm2022/hestia-earth-ui-components-file-errors.mjs +3 -1409
- package/fesm2022/hestia-earth-ui-components-file-errors.mjs.map +1 -1
- package/fesm2022/hestia-earth-ui-components.mjs +70 -55
- package/fesm2022/hestia-earth-ui-components.mjs.map +1 -1
- package/package.json +2 -2
- package/types/hestia-earth-ui-components-file-errors.d.ts +1 -178
- package/types/hestia-earth-ui-components.d.ts +21 -12
- package/file-errors/README.md +0 -114
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/ui-components",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.18",
|
|
4
4
|
"description": "HESTIA reusable components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@angular/core": "^21.0.0",
|
|
19
19
|
"@angular/google-maps": "^21.0.0",
|
|
20
20
|
"@hestia-earth/api": "*",
|
|
21
|
-
"@hestia-earth/data-validation": "
|
|
21
|
+
"@hestia-earth/data-validation": ">=0.41.3",
|
|
22
22
|
"@hestia-earth/engine-models": "*",
|
|
23
23
|
"@hestia-earth/glossary": "*",
|
|
24
24
|
"@hestia-earth/json-schema": "*",
|
|
@@ -1,178 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A renderer abstracts every presentation primitive used to build an error message.
|
|
5
|
-
*
|
|
6
|
-
* The error catalog is a single source of truth; swapping the renderer changes only how
|
|
7
|
-
* the messages are presented:
|
|
8
|
-
* - `htmlRenderer` reproduces the exact Bulma-classed HTML consumed by the Angular app.
|
|
9
|
-
* - `textRenderer` produces framework-agnostic plain text (with lightweight markdown for
|
|
10
|
-
* code spans, links and lists) suitable for any non-Angular consumer.
|
|
11
|
-
*/
|
|
12
|
-
interface IErrorRenderer {
|
|
13
|
-
code: (text: string | number | boolean) => string;
|
|
14
|
-
link: (href: string, text: string, newTab?: boolean) => string;
|
|
15
|
-
list: (values: Array<string | string[]>, style?: 'disc' | 'decimal') => string;
|
|
16
|
-
paragraph: (text: string) => string;
|
|
17
|
-
bold: (text: string) => string;
|
|
18
|
-
subscript: (text: string) => string;
|
|
19
|
-
underline: (text: string) => string;
|
|
20
|
-
/** Inline line break, e.g. `<br/>` or `\n`. */
|
|
21
|
-
lineBreak: string;
|
|
22
|
-
/** Separator used when joining inline code spans (`joinValues`). */
|
|
23
|
-
inlineSeparator: string;
|
|
24
|
-
/** Wraps the leading sentence of a default (non-catalog) message. */
|
|
25
|
-
capitalizeFirst: (text: string) => string;
|
|
26
|
-
/** Wraps the whole formatted message; receives a non-empty string. */
|
|
27
|
-
wrapMessage: (text: string) => string;
|
|
28
|
-
}
|
|
29
|
-
declare const htmlRenderer: IErrorRenderer;
|
|
30
|
-
declare const textRenderer: IErrorRenderer;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Provides the base URLs used to build links inside error messages.
|
|
34
|
-
*
|
|
35
|
-
* Functions (rather than plain strings) keep the lookups lazy: the Angular app reads them
|
|
36
|
-
* from `window.location` at call time, while a non-Angular consumer can pass static values.
|
|
37
|
-
*/
|
|
38
|
-
interface IUrlConfig {
|
|
39
|
-
baseUrl: () => string;
|
|
40
|
-
glossaryBaseUrl: () => string;
|
|
41
|
-
schemaBaseUrl: () => string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Static, browser-free default configuration pointing at the public HESTIA platform.
|
|
45
|
-
*/
|
|
46
|
-
declare const defaultUrlConfig: IUrlConfig;
|
|
47
|
-
/**
|
|
48
|
-
* Builds a configuration from a single base URL.
|
|
49
|
-
*/
|
|
50
|
-
declare const urlConfig: (baseUrl?: string) => IUrlConfig;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Framework-agnostic validation types.
|
|
54
|
-
*
|
|
55
|
-
* These mirror the canonical definitions in `../schema/schema-validation.model` but are
|
|
56
|
-
* duplicated here so this entry point stays self-contained (no import from the Angular
|
|
57
|
-
* primary entry point). They are kept structurally compatible on purpose.
|
|
58
|
-
*/
|
|
59
|
-
type validationErrorLevel = 'error' | 'warning';
|
|
60
|
-
type validationErrorParam = 'missingProperty' | 'type' | 'term' | 'termType' | 'termIds' | 'model' | 'product' | 'range' | 'node' | 'allowedValues' | 'allowedValue' | 'additionalProperty' | 'expected' | 'default' | 'current' | 'percentage' | 'keys' | 'threshold' | 'outliers' | 'country' | 'min' | 'max' | 'mu' | 'sd' | 'defaultSource' | 'source' | 'group' | 'message' | 'distance' | 'siteType' | 'products' | 'units' | 'duplicatedIndexes' | 'invalidCoordinates' | 'ids' | 'limit' | 'delta';
|
|
61
|
-
type validationErrorKeyword = 'required' | 'type' | 'if' | 'then' | 'not';
|
|
62
|
-
interface ICustomValidationRules {
|
|
63
|
-
const?: any;
|
|
64
|
-
required?: string[];
|
|
65
|
-
enum?: string[];
|
|
66
|
-
contains?: ICustomValidationRules;
|
|
67
|
-
properties?: {
|
|
68
|
-
[property: string]: ICustomValidationRules;
|
|
69
|
-
};
|
|
70
|
-
not?: ICustomValidationRules;
|
|
71
|
-
items?: ICustomValidationRules;
|
|
72
|
-
allOf?: ICustomValidationRules[];
|
|
73
|
-
anyOf?: ICustomValidationRules[];
|
|
74
|
-
oneOf?: ICustomValidationRules[];
|
|
75
|
-
}
|
|
76
|
-
interface IValidationError {
|
|
77
|
-
index?: number;
|
|
78
|
-
nodeIndex?: number;
|
|
79
|
-
level?: validationErrorLevel;
|
|
80
|
-
dataPath?: string;
|
|
81
|
-
schemaPath?: string;
|
|
82
|
-
keyword?: validationErrorKeyword;
|
|
83
|
-
message: string;
|
|
84
|
-
params?: {
|
|
85
|
-
[key in validationErrorParam]?: any;
|
|
86
|
-
};
|
|
87
|
-
schema?: ICustomValidationRules;
|
|
88
|
-
}
|
|
89
|
-
interface IValidationErrorWithIndex {
|
|
90
|
-
error: IValidationError[];
|
|
91
|
-
index: number;
|
|
92
|
-
changed?: boolean;
|
|
93
|
-
}
|
|
94
|
-
interface IDataPath {
|
|
95
|
-
path: string;
|
|
96
|
-
/**
|
|
97
|
-
* Human readable version of the path.
|
|
98
|
-
*/
|
|
99
|
-
label: string;
|
|
100
|
-
nodeType?: NodeType;
|
|
101
|
-
schemaType?: SchemaType;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Structured, framework-agnostic representation of a formatted validation error.
|
|
105
|
-
*/
|
|
106
|
-
interface IFormattedError {
|
|
107
|
-
level: validationErrorLevel;
|
|
108
|
-
/**
|
|
109
|
-
* The rendered message. Plain text (or lightweight markdown) by default, HTML when
|
|
110
|
-
* formatted with the html renderer.
|
|
111
|
-
*/
|
|
112
|
-
message: string;
|
|
113
|
-
/**
|
|
114
|
-
* Human readable location of the error within the document (derived from the dataPath).
|
|
115
|
-
*/
|
|
116
|
-
location?: string;
|
|
117
|
-
dataPath?: string;
|
|
118
|
-
keyword?: validationErrorKeyword;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
declare enum Repository {
|
|
122
|
-
glossary = "hestia-glossary",
|
|
123
|
-
models = "hestia-engine-models",
|
|
124
|
-
aggregation = "hestia-aggregation-engine",
|
|
125
|
-
community = "hestia-community-edition",
|
|
126
|
-
schema = "hestia-schema",
|
|
127
|
-
frontend = "hestia-front-end"
|
|
128
|
-
}
|
|
129
|
-
declare enum Template {
|
|
130
|
-
bug = "bug",
|
|
131
|
-
feature = "feature"
|
|
132
|
-
}
|
|
133
|
-
interface IIssueParams {
|
|
134
|
-
title?: string;
|
|
135
|
-
description?: string;
|
|
136
|
-
}
|
|
137
|
-
declare const reportIssueUrl: (repository: Repository, template?: Template, issueParams?: IIssueParams) => string;
|
|
138
|
-
|
|
139
|
-
declare const guidePageId: (nodeType: SchemaType, errorMessage: string) => string;
|
|
140
|
-
declare const isMigrationError: ({ params }: IValidationError) => boolean;
|
|
141
|
-
interface ICreateErrorFormatterOptions {
|
|
142
|
-
renderer: IErrorRenderer;
|
|
143
|
-
urls: IUrlConfig;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Builds the error formatting functions for a given presentation (`renderer`) and link
|
|
147
|
-
* configuration (`urls`). The error catalog below is the single source of truth; the
|
|
148
|
-
* renderer alone decides whether the output is HTML, plain text, etc.
|
|
149
|
-
*/
|
|
150
|
-
declare const createErrorFormatter: ({ renderer: r, urls }: ICreateErrorFormatterOptions) => {
|
|
151
|
-
parseDataPath: (dataPath?: string) => IDataPath[];
|
|
152
|
-
dataPathLabel: (dataPath?: string) => string;
|
|
153
|
-
migrationErrorMessage: ({ params }: IValidationError) => string;
|
|
154
|
-
formatCustomErrorMessage: (message?: string, error?: IValidationError, allErrors?: IValidationError[]) => string;
|
|
155
|
-
formatError: (error?: IValidationError, allErrors?: IValidationError[]) => IValidationError;
|
|
156
|
-
formatErrors: (errors?: IValidationError[]) => IFormattedError[];
|
|
157
|
-
locationLabel: (dataPath?: string) => string;
|
|
158
|
-
};
|
|
159
|
-
declare const errorHasError: (error?: IValidationError) => boolean;
|
|
160
|
-
declare const errorHasWarning: (error?: IValidationError) => boolean;
|
|
161
|
-
declare const isMissingPropertyError: ({ params }: IValidationError) => boolean;
|
|
162
|
-
declare const isMissingOneOfError: ({ keyword, schemaPath }: IValidationError) => boolean;
|
|
163
|
-
declare const filterError: (error: IValidationError) => boolean;
|
|
164
|
-
declare const missingNodeErrors: (errors: IValidationError[]) => IValidationError[];
|
|
165
|
-
|
|
166
|
-
interface IFormatErrorsOptions {
|
|
167
|
-
/** Presentation renderer. Defaults to `textRenderer` (plain text / lightweight markdown). */
|
|
168
|
-
renderer?: IErrorRenderer;
|
|
169
|
-
/** Base URLs used to build links. Defaults to the public HESTIA platform. */
|
|
170
|
-
urls?: IUrlConfig;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Formats a list of validation errors into structured, framework-agnostic objects.
|
|
174
|
-
*/
|
|
175
|
-
declare const formatErrors: (errors?: IValidationError[], options?: IFormatErrorsOptions) => IFormattedError[];
|
|
176
|
-
|
|
177
|
-
export { Repository, Template, createErrorFormatter, defaultUrlConfig, errorHasError, errorHasWarning, filterError, formatErrors, guidePageId, htmlRenderer, isMigrationError, isMissingOneOfError, isMissingPropertyError, missingNodeErrors, reportIssueUrl, textRenderer, urlConfig };
|
|
178
|
-
export type { ICreateErrorFormatterOptions, ICustomValidationRules, IDataPath, IErrorRenderer, IFormatErrorsOptions, IFormattedError, IUrlConfig, IValidationError, IValidationErrorWithIndex, validationErrorKeyword, validationErrorLevel, validationErrorParam };
|
|
1
|
+
export * from '@hestia-earth/data-validation/file-errors';
|
|
@@ -26,11 +26,11 @@ export * from '@hestia-earth/ui-components/svg-icons';
|
|
|
26
26
|
import { AnimationEvent } from '@angular/animations';
|
|
27
27
|
import { IsActiveMatchOptions } from '@angular/router';
|
|
28
28
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
29
|
-
import * as
|
|
30
|
-
import { IValidationErrorWithIndex } from '@hestia-earth/ui-components/file-errors';
|
|
31
|
-
export { IValidationErrorWithIndex, errorHasError, errorHasWarning, filterError, guidePageId, isMigrationError, isMissingOneOfError, isMissingPropertyError, missingNodeErrors } from '@hestia-earth/ui-components/file-errors';
|
|
29
|
+
import * as _hestia_earth_data_validation_file_errors from '@hestia-earth/data-validation/file-errors';
|
|
32
30
|
import { definition, definitions, IDefinition, IDefinitionObject } from '@hestia-earth/json-schema';
|
|
33
31
|
import { ErrorKeys, IJSONConversionParams, IConvertCSVOptions } from '@hestia-earth/schema-convert';
|
|
32
|
+
import { IValidationErrorWithIndex } from '@hestia-earth/ui-components/file-errors';
|
|
33
|
+
export { IValidationErrorWithIndex, errorHasError, errorHasWarning, filterError, guidePageId, isMigrationError, isMissingOneOfError, isMissingPropertyError, missingNodeErrors } from '@hestia-earth/ui-components/file-errors';
|
|
34
34
|
import * as _angular_platform_browser from '@angular/platform-browser';
|
|
35
35
|
import * as _angular_cdk_overlay from '@angular/cdk/overlay';
|
|
36
36
|
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
@@ -3128,12 +3128,12 @@ declare class EngineRequirementsFormComponent {
|
|
|
3128
3128
|
}
|
|
3129
3129
|
|
|
3130
3130
|
declare const formatter$1: {
|
|
3131
|
-
parseDataPath: (dataPath?: string) =>
|
|
3131
|
+
parseDataPath: (dataPath?: string) => _hestia_earth_data_validation_file_errors.IDataPath[];
|
|
3132
3132
|
dataPathLabel: (dataPath?: string) => string;
|
|
3133
|
-
migrationErrorMessage: ({ params }:
|
|
3134
|
-
formatCustomErrorMessage: (message?: string, error?:
|
|
3135
|
-
formatError: (error?:
|
|
3136
|
-
formatErrors: (errors?:
|
|
3133
|
+
migrationErrorMessage: ({ params }: _hestia_earth_data_validation_file_errors.IValidationError) => string;
|
|
3134
|
+
formatCustomErrorMessage: (message?: string, error?: _hestia_earth_data_validation_file_errors.IValidationError, allErrors?: _hestia_earth_data_validation_file_errors.IValidationError[]) => string;
|
|
3135
|
+
formatError: (error?: _hestia_earth_data_validation_file_errors.IValidationError, allErrors?: _hestia_earth_data_validation_file_errors.IValidationError[]) => _hestia_earth_data_validation_file_errors.IValidationError;
|
|
3136
|
+
formatErrors: (errors?: _hestia_earth_data_validation_file_errors.IValidationError[]) => _hestia_earth_data_validation_file_errors.IFormattedError[];
|
|
3137
3137
|
locationLabel: (dataPath?: string) => string;
|
|
3138
3138
|
};
|
|
3139
3139
|
declare const parseDataPath: typeof formatter$1.parseDataPath;
|
|
@@ -3250,6 +3250,13 @@ declare const formatPropertyError: (errors: any, property: INodeProperty) => str
|
|
|
3250
3250
|
declare const formatter: (key: string) => (value: any) => any;
|
|
3251
3251
|
declare const hasError: (value: any) => any;
|
|
3252
3252
|
declare const hasWarning: (value: any) => any;
|
|
3253
|
+
/**
|
|
3254
|
+
* The label on the node header: a node routinely carries several errors or warnings, and a single
|
|
3255
|
+
* label for both counts reads as exactly one. A `missingOneOf` error is shown as a warning while
|
|
3256
|
+
* being recorded as an `error`, so the badge can be up with nothing counted under its own level —
|
|
3257
|
+
* hence the floor of one.
|
|
3258
|
+
*/
|
|
3259
|
+
declare const errorsLabel: (label: string, errors: IValidationError[], matches: (error: IValidationError) => unknown) => string;
|
|
3253
3260
|
declare const nodeAvailableProperties: (node: JSON<SchemaType>, { fullKey, schema, schemaType }: Partial<INodeProperty>) => any;
|
|
3254
3261
|
declare const isAddPropertyEnabled: (node: JSON<SchemaType>, schemaType: SchemaType, schema: definition, fullKey?: string) => boolean;
|
|
3255
3262
|
declare const propertyId: () => string;
|
|
@@ -3388,7 +3395,7 @@ declare class FilesFormComponent {
|
|
|
3388
3395
|
fullKey: string;
|
|
3389
3396
|
key: string;
|
|
3390
3397
|
value: {};
|
|
3391
|
-
error:
|
|
3398
|
+
error: _hestia_earth_data_validation_file_errors.IValidationError;
|
|
3392
3399
|
errorGuidePageId: string;
|
|
3393
3400
|
hasError: boolean;
|
|
3394
3401
|
hasWarning: boolean;
|
|
@@ -3408,6 +3415,8 @@ declare class FilesFormComponent {
|
|
|
3408
3415
|
protected readonly unmatchedErrors: _angular_core.Signal<INodeProperty[]>;
|
|
3409
3416
|
protected readonly hasError: _angular_core.Signal<any>;
|
|
3410
3417
|
protected readonly hasWarning: _angular_core.Signal<any>;
|
|
3418
|
+
protected readonly errorLabel: _angular_core.Signal<string>;
|
|
3419
|
+
protected readonly warningLabel: _angular_core.Signal<string>;
|
|
3411
3420
|
protected readonly canOpen: _angular_core.Signal<boolean>;
|
|
3412
3421
|
protected trackByProperty(_index: number, { id, fullKey }: INodeProperty): string;
|
|
3413
3422
|
protected resolveError(property: INodeProperty): void;
|
|
@@ -3462,7 +3471,7 @@ declare class FilesFormEditableComponent {
|
|
|
3462
3471
|
fullKey: string;
|
|
3463
3472
|
key: string;
|
|
3464
3473
|
value: {};
|
|
3465
|
-
error:
|
|
3474
|
+
error: _hestia_earth_data_validation_file_errors.IValidationError;
|
|
3466
3475
|
errorGuidePageId: string;
|
|
3467
3476
|
hasError: boolean;
|
|
3468
3477
|
hasWarning: boolean;
|
|
@@ -3651,7 +3660,7 @@ interface ISummary {
|
|
|
3651
3660
|
* @param summaryData The previously computed summary objects.
|
|
3652
3661
|
* @returns
|
|
3653
3662
|
*/
|
|
3654
|
-
declare const buildSummary: (nodes?: JSON<SchemaType>[], errors?: IValidationErrorWithIndex[], summaryData?: ISummary[]) =>
|
|
3663
|
+
declare const buildSummary: (nodes?: JSON<SchemaType>[], errors?: IValidationErrorWithIndex[], summaryData?: ISummary[]) => Observable<ISummary[]>;
|
|
3655
3664
|
|
|
3656
3665
|
declare class FilesErrorSummaryItemComponent {
|
|
3657
3666
|
readonly summary: _angular_core.InputSignal<ISummary>;
|
|
@@ -6397,5 +6406,5 @@ declare class TermsUnitsDescriptionComponent {
|
|
|
6397
6406
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TermsUnitsDescriptionComponent, "he-terms-units-description", never, { "term": { "alias": "term"; "required": true; "isSignal": true; }; "iconTemplate": { "alias": "iconTemplate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6398
6407
|
}
|
|
6399
6408
|
|
|
6400
|
-
export { ARRAY_DELIMITER, ApplyPurePipe, BarChartComponent, BibliographiesSearchConfirmComponent, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, CapitalizePipe, ChartComponent, ChartConfigurationDirective, ChartExportButtonComponent, ChartTooltipComponent, ClickOutsideDirective, ClipboardComponent, CollapsibleBlockComponent, CollapsibleBoxComponent, CollapsibleBoxStyle, ColorPalette, CompoundDirective, CompoundPipe, ContributionChartComponent, ControlValueAccessor, CycleNodesKeyGroup, CyclesCompletenessComponent, CyclesEmissionsCategoryService, CyclesEmissionsChartComponent, CyclesFunctionalUnitMeasureComponent, CyclesMetadataComponent, CyclesNodesComponent, CyclesNodesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DistributionChartComponent, DrawerContainerComponent, DurationPipe, EllipsisPipe, EngineModelsLinkComponent, EngineModelsLookupInfoComponent, EngineModelsStageComponent, EngineModelsStageDeepComponent, EngineModelsStageDeepService, EngineModelsVersionInfoComponent, EngineModelsVersionLinkComponent, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FileSizePipe, FileUploadErrorKeys, FilesDragDropDirective, FilesDropZoneComponent, FilesErrorSummaryComponent, FilesFormComponent, FilesFormEditableComponent, FilesUploadErrorsComponent, FilterAccordionComponent, FormulaBlockComponent, GUIDE_ENABLED, GetPipe, GlossaryMigrationFormat, GuideOverlayComponent, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_MAP_LOADED, HeAuthService, HeCommonService, HeEngineService, HeGlossaryService, HeMendeleyService, HeNodeCsvService, HeNodeService, HeNodeStoreService, HeSchemaService, HeSearchService, HeToastService, HorizontalBarChartComponent, HorizontalButtonsGroupComponent, ImpactAssessmentsGraphComponent, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, IsArrayPipe, IsObjectPipe, IssueConfirmComponent, KeyToLabelPipe, Level, LineChartComponent, LinkKeyValueComponent, LogStatus, LongPressDirective, MAX_RESULTS, MapsDrawingComponent, MapsDrawingConfirmComponent, MaxPipe, MeanPipe, MedianPipe, MendeleySearchResult, MinPipe, MobileShellComponent, NavigationMenuComponent, NoExtPipe, NodeAggregatedComponent, NodeAggregatedFormulasComponent, NodeAggregatedInfoComponent, NodeAggregatedQualityScoreComponent, NodeAggregationLogsComponent, NodeCsvExportConfirmComponent, NodeCsvPreviewComponent, NodeCsvSelectHeadersComponent, NodeIconComponent, NodeJLogModelsComponent, NodeJsonldComponent, NodeJsonldSchemaComponent, NodeKeyState, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeLogsTimeComponent, NodeMissingLookupFactorsComponent, NodeQualityScore, NodeRecommendationsComponent, NodeSelectComponent, NodeValueDetailsComponent, PipelineStagesProgressComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, RelatedNodeResult, RemoveMarkdownPipe, RepeatPipe, Repository, ResizedDirective, ResizedEvent, ResponsiveService, SchemaInfoComponent, SchemaVersionLinkComponent, SearchExtendComponent, ShelfDialogComponent, ShellComponent, SiteNodesKeyGroup, SitesManagementChartComponent, SitesMapsComponent, SitesNodesComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, SortSelectComponent, SumPipe, TagsInputDirective, Template, TermsPropertyContentComponent, TermsSubClassOfContentComponent, TermsUnitsDescriptionComponent, ThousandSuffixesPipe, ThousandsPipe, TimesPipe, ToastComponent, UncapitalizePipe, addPolygonToFeature, afterBarDrawPlugin, allCountriesQuery, allGroups, allOptions, availableProperties, axisHoverPlugin, backgroundHoverPlugin, backgroundModelParams, baseApiUrl, baseUrl, bottom, buildSummary, bytesSize, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, capitalize, changelogUrl, clustererImage, code, colorToRgba, compoundToHtml, computeKeys, computeTerms, contactUsEmail, contactUsLink, convertToSvg, coordinatesToPoint, copyObject, countGroupVisibleNodes, countriesQuery, createMarker, cropsQuery, d3ellipse, d3wrap, dataPathLabel, dataPathToKey, dataVersionHeader, dataVersionHeaderKey, defaultFeature, defaultLabel, defaultSuggestionType, defaultTicksFont, definitionToSchemaType, distinctUntilChangedDeep, downloadFile, downloadPng, downloadSvg, ellipsis, engineGitBaseUrl, engineGitUrl, errorText, evaluateSuccess, exportAsSVG, exportFormats, externalLink, externalNodeLink, fillColor, fillStyle, filterBlankNode, filterParams, findBackgroundModel, findConfigModels, findMatchingModel, findModels, findNodeModel, findOrchestratorModel, findProperty, findPropertyById, findTermModels, flatFilterData, flatFilterNode, formatCustomErrorMessage, formatDate, formatError, formatPropertyError, formatter, getColor, getDatesBetween, gitBranch, gitHome, glossaryBaseUrl, glossaryLink, groupBlankNodesByTermIdentity, groupChanged, groupDataByCategory, groupJLogByField, groupJLogByTerm, groupLogsByTerm, groupNodesByTerm, groupdLogsByKey, grouppedKeys, grouppedValueKeys, groupsLogsByFields, guideModelUrl, guideNamespace, handleAPIError, handleGuideEvent, hasError, hasValidationError, hasWarning, hexToRgba, ignoreKeys, increaseScaleLimits, initialFilterState, injectResizeEvent$, inputGroupsTermTypes, isAddPropertyEnabled, isChrome, isDateBetween, isEqual, isExternal, isIdenticalNodeValue, isKeyClosedVisible, isKeyHidden, isMaxStage, isMethodModelAllowed, isNonNodeModelKey, isSchemaIri, isScrolledBelow, isState, isTermTypeAllowed, isValidKey, jLogModelCount, keyToDataPath, levels, listColor, listColorContinuous, listColorWithAlpha, loadMapApi, locationQuery, logToCsv, logValueArray, logsKey, lollipopChartPlugin, lookupUrl, mapFilterData, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchAggregatedValidatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchId, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchPrimaryProductQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, mergeDataWithHeaders, methodTierOrder, migrationErrorMessage, migrationsUrl, modelCount, modelKeyParams, modelParams, models, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, noValue, nodeAvailableProperties, nodeById, nodeColours, nodeDataState, nodeDataStates, nodeDataVersion, nodeId, nodeIdWithoutDataVersion, nodeIds, nodeLink, nodeLinkEnabled, nodeLinkTypeEnabled, nodeLogsUrl, nodeQualityScoreColor, nodeQualityScoreLevel, nodeQualityScoreMaxDefault, nodeQualityScoreOrder, nodeRequestId, nodeSecondaryColours, nodeToAggregationFilename, nodeType, nodeTypeDataState, nodeTypeIcon, nodeTypeIconSchema, nodeUrl, nodeUrlParams, nodeVersion, nodeVersionKey, nodesByState, nodesByType, numberGte, optionsFromGroup, parentKey, parentProperty, parseColor, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pluralize, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonToMap, polygonsFromFeature, populateWithTrackIdsFilterData, postGuideEvent, primaryProduct, productsQuery, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, registerChart, repeat, reportIssueLink, reportIssueUrl, safeJSONParse, safeJSONStringify, schemaBaseUrl, schemaDataBaseUrl, schemaLink, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchFilterData, searchableTypes, siblingProperty, simplifyContributions, singleProperty, siteTooBig, siteTypeToColor, siteTypeToIcon, sortProperties, sortedDates, strokeColor, strokeStyle, subValueKeys, suggestMatchQuery, suggestQuery, sumValues, takeAfterViewInit, termLocation, termLocationName, termProperties, termTypeLabel, toSnakeCase, toTextParts, toThousands, typeToNewProperty, typeaheadFocus, uncapitalize, uniqueDatesBetween, updateProperties, valueLink, valueToString, valueTypeToDefault, valueValue, waitFor, wildcardQuery };
|
|
6409
|
+
export { ARRAY_DELIMITER, ApplyPurePipe, BarChartComponent, BibliographiesSearchConfirmComponent, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, CapitalizePipe, ChartComponent, ChartConfigurationDirective, ChartExportButtonComponent, ChartTooltipComponent, ClickOutsideDirective, ClipboardComponent, CollapsibleBlockComponent, CollapsibleBoxComponent, CollapsibleBoxStyle, ColorPalette, CompoundDirective, CompoundPipe, ContributionChartComponent, ControlValueAccessor, CycleNodesKeyGroup, CyclesCompletenessComponent, CyclesEmissionsCategoryService, CyclesEmissionsChartComponent, CyclesFunctionalUnitMeasureComponent, CyclesMetadataComponent, CyclesNodesComponent, CyclesNodesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DistributionChartComponent, DrawerContainerComponent, DurationPipe, EllipsisPipe, EngineModelsLinkComponent, EngineModelsLookupInfoComponent, EngineModelsStageComponent, EngineModelsStageDeepComponent, EngineModelsStageDeepService, EngineModelsVersionInfoComponent, EngineModelsVersionLinkComponent, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FileSizePipe, FileUploadErrorKeys, FilesDragDropDirective, FilesDropZoneComponent, FilesErrorSummaryComponent, FilesFormComponent, FilesFormEditableComponent, FilesUploadErrorsComponent, FilterAccordionComponent, FormulaBlockComponent, GUIDE_ENABLED, GetPipe, GlossaryMigrationFormat, GuideOverlayComponent, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_MAP_LOADED, HeAuthService, HeCommonService, HeEngineService, HeGlossaryService, HeMendeleyService, HeNodeCsvService, HeNodeService, HeNodeStoreService, HeSchemaService, HeSearchService, HeToastService, HorizontalBarChartComponent, HorizontalButtonsGroupComponent, ImpactAssessmentsGraphComponent, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, IsArrayPipe, IsObjectPipe, IssueConfirmComponent, KeyToLabelPipe, Level, LineChartComponent, LinkKeyValueComponent, LogStatus, LongPressDirective, MAX_RESULTS, MapsDrawingComponent, MapsDrawingConfirmComponent, MaxPipe, MeanPipe, MedianPipe, MendeleySearchResult, MinPipe, MobileShellComponent, NavigationMenuComponent, NoExtPipe, NodeAggregatedComponent, NodeAggregatedFormulasComponent, NodeAggregatedInfoComponent, NodeAggregatedQualityScoreComponent, NodeAggregationLogsComponent, NodeCsvExportConfirmComponent, NodeCsvPreviewComponent, NodeCsvSelectHeadersComponent, NodeIconComponent, NodeJLogModelsComponent, NodeJsonldComponent, NodeJsonldSchemaComponent, NodeKeyState, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeLogsTimeComponent, NodeMissingLookupFactorsComponent, NodeQualityScore, NodeRecommendationsComponent, NodeSelectComponent, NodeValueDetailsComponent, PipelineStagesProgressComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, RelatedNodeResult, RemoveMarkdownPipe, RepeatPipe, Repository, ResizedDirective, ResizedEvent, ResponsiveService, SchemaInfoComponent, SchemaVersionLinkComponent, SearchExtendComponent, ShelfDialogComponent, ShellComponent, SiteNodesKeyGroup, SitesManagementChartComponent, SitesMapsComponent, SitesNodesComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, SortSelectComponent, SumPipe, TagsInputDirective, Template, TermsPropertyContentComponent, TermsSubClassOfContentComponent, TermsUnitsDescriptionComponent, ThousandSuffixesPipe, ThousandsPipe, TimesPipe, ToastComponent, UncapitalizePipe, addPolygonToFeature, afterBarDrawPlugin, allCountriesQuery, allGroups, allOptions, availableProperties, axisHoverPlugin, backgroundHoverPlugin, backgroundModelParams, baseApiUrl, baseUrl, bottom, buildSummary, bytesSize, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, capitalize, changelogUrl, clustererImage, code, colorToRgba, compoundToHtml, computeKeys, computeTerms, contactUsEmail, contactUsLink, convertToSvg, coordinatesToPoint, copyObject, countGroupVisibleNodes, countriesQuery, createMarker, cropsQuery, d3ellipse, d3wrap, dataPathLabel, dataPathToKey, dataVersionHeader, dataVersionHeaderKey, defaultFeature, defaultLabel, defaultSuggestionType, defaultTicksFont, definitionToSchemaType, distinctUntilChangedDeep, downloadFile, downloadPng, downloadSvg, ellipsis, engineGitBaseUrl, engineGitUrl, errorText, errorsLabel, evaluateSuccess, exportAsSVG, exportFormats, externalLink, externalNodeLink, fillColor, fillStyle, filterBlankNode, filterParams, findBackgroundModel, findConfigModels, findMatchingModel, findModels, findNodeModel, findOrchestratorModel, findProperty, findPropertyById, findTermModels, flatFilterData, flatFilterNode, formatCustomErrorMessage, formatDate, formatError, formatPropertyError, formatter, getColor, getDatesBetween, gitBranch, gitHome, glossaryBaseUrl, glossaryLink, groupBlankNodesByTermIdentity, groupChanged, groupDataByCategory, groupJLogByField, groupJLogByTerm, groupLogsByTerm, groupNodesByTerm, groupdLogsByKey, grouppedKeys, grouppedValueKeys, groupsLogsByFields, guideModelUrl, guideNamespace, handleAPIError, handleGuideEvent, hasError, hasValidationError, hasWarning, hexToRgba, ignoreKeys, increaseScaleLimits, initialFilterState, injectResizeEvent$, inputGroupsTermTypes, isAddPropertyEnabled, isChrome, isDateBetween, isEqual, isExternal, isIdenticalNodeValue, isKeyClosedVisible, isKeyHidden, isMaxStage, isMethodModelAllowed, isNonNodeModelKey, isSchemaIri, isScrolledBelow, isState, isTermTypeAllowed, isValidKey, jLogModelCount, keyToDataPath, levels, listColor, listColorContinuous, listColorWithAlpha, loadMapApi, locationQuery, logToCsv, logValueArray, logsKey, lollipopChartPlugin, lookupUrl, mapFilterData, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchAggregatedValidatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchId, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchPrimaryProductQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, mergeDataWithHeaders, methodTierOrder, migrationErrorMessage, migrationsUrl, modelCount, modelKeyParams, modelParams, models, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, noValue, nodeAvailableProperties, nodeById, nodeColours, nodeDataState, nodeDataStates, nodeDataVersion, nodeId, nodeIdWithoutDataVersion, nodeIds, nodeLink, nodeLinkEnabled, nodeLinkTypeEnabled, nodeLogsUrl, nodeQualityScoreColor, nodeQualityScoreLevel, nodeQualityScoreMaxDefault, nodeQualityScoreOrder, nodeRequestId, nodeSecondaryColours, nodeToAggregationFilename, nodeType, nodeTypeDataState, nodeTypeIcon, nodeTypeIconSchema, nodeUrl, nodeUrlParams, nodeVersion, nodeVersionKey, nodesByState, nodesByType, numberGte, optionsFromGroup, parentKey, parentProperty, parseColor, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pluralize, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonToMap, polygonsFromFeature, populateWithTrackIdsFilterData, postGuideEvent, primaryProduct, productsQuery, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, registerChart, repeat, reportIssueLink, reportIssueUrl, safeJSONParse, safeJSONStringify, schemaBaseUrl, schemaDataBaseUrl, schemaLink, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchFilterData, searchableTypes, siblingProperty, simplifyContributions, singleProperty, siteTooBig, siteTypeToColor, siteTypeToIcon, sortProperties, sortedDates, strokeColor, strokeStyle, subValueKeys, suggestMatchQuery, suggestQuery, sumValues, takeAfterViewInit, termLocation, termLocationName, termProperties, termTypeLabel, toSnakeCase, toTextParts, toThousands, typeToNewProperty, typeaheadFocus, uncapitalize, uniqueDatesBetween, updateProperties, valueLink, valueToString, valueTypeToDefault, valueValue, waitFor, wildcardQuery };
|
|
6401
6410
|
export type { AfterBarDrawSettings, AxisHoverSettings, BarChartDataItem, ButtonGroupItem, ChartExportMetadata, ContributionChartDataItem, ContributionTooltipData, FilterData, FilterElement, FilterFn, FilterGroup, FilterOption, FilterState, HistogramChartDataItem, IBlankNodeIdentityGroup, IBlankNodeIdentityRow, IBlankNodeLog, IBlankNodeLogSubValue, ICalculationsModel, ICalculationsModelsParams, ICalculationsRequirementsParams, IChartExportFormat, ICloseMessage, IConfigModel, IContributionCategory, ICustomValidationRules, ICycleJSONLDExtended, IEmissionCategory, IErrorProperty, IFeature, IFeatureCollection, IFileUploadError, IFilesDropped, IFormulaTextPart, IFormulaVariable, IGeometryCollection, IGlossaryMigration, IGlossaryMigrations, IGroupedKeys, IGroupedNode, IGroupedNodes, IGroupedNodesValue, IGroupedNodesValues, IIdentityScalar, IIdentitySegment, IImpactAssessmentJSONLDExtended, IIssueParams, IJLogBlankNode, IJLogModelColumn, IJLogModelRun, IJLogTermGroup, IJSONData, IJSONNode, ILine, ILog, IMarker, IMessage, IMobileShellMenuButton, INavigationMenuLink, INewProperty, INodeContributions, INodeErrorLog, INodeHeaders, INodeLogs, INodeMissingLookupLog, INodeProperty, INodeRequestParams, INodeTermLog, INodeTermLogs, INonBlankNodeLog, IPolygonMap, IRelatedNode, IRenderedFormula, ISearchParams, ISearchResultExtended, ISearchResults, IShellMenuButton, ISiteJSONLDExtended, IStoredNode, ISummary, ISummaryError, IToast, IValidationError, LollipopPluginSettings, RgbColor, SelectValue, SortOption, SortSelectEvent, SortSelectOrder, blankNodesTypeValue, chartExportFn, chartTooltipContentFn, contributions, feature, horizontalTooltipData, modelKey, nodeContributionsSimplified, nodes, nonBlankNodesTypeValue, searchResult, searchableType, sortOrders, suggestionType, validationErrorKeyword, validationErrorLevel, validationErrorParam };
|
package/file-errors/README.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# `@hestia-earth/ui-components/file-errors`
|
|
2
|
-
|
|
3
|
-
Framework-agnostic formatting of HESTIA file validation errors. No Angular, no Bulma, no
|
|
4
|
-
`window` dependency — import it from any TypeScript package (browser, Node, SSR).
|
|
5
|
-
|
|
6
|
-
The error catalog is the single source of truth shared with the Angular UI; only the
|
|
7
|
-
presentation differs (a pluggable renderer).
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import { formatErrors } from '@hestia-earth/ui-components/file-errors';
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Basic usage — structured plain text
|
|
16
|
-
|
|
17
|
-
`formatErrors` takes the raw validation errors and returns one structured object per
|
|
18
|
-
visible error (errors that resolve to an empty message are dropped).
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
import { formatErrors } from '@hestia-earth/ui-components/file-errors';
|
|
22
|
-
|
|
23
|
-
const errors = [
|
|
24
|
-
{
|
|
25
|
-
dataPath: '.functionalUnit',
|
|
26
|
-
keyword: 'enum',
|
|
27
|
-
message: 'should be equal to one of the allowed values',
|
|
28
|
-
params: { allowedValues: ['1 ha', 'relative'] }
|
|
29
|
-
}
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
formatErrors(errors);
|
|
33
|
-
// [
|
|
34
|
-
// {
|
|
35
|
-
// level: 'error',
|
|
36
|
-
// message: 'Only the following values are permitted: `1 ha`, `relative`.',
|
|
37
|
-
// location: '`functionalUnit`',
|
|
38
|
-
// dataPath: '.functionalUnit',
|
|
39
|
-
// keyword: 'enum'
|
|
40
|
-
// }
|
|
41
|
-
// ]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Each item is an `IFormattedError`:
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
interface IFormattedError {
|
|
48
|
-
level: 'error' | 'warning';
|
|
49
|
-
message: string; // plain text; code spans as `backticks`, links as [text](url), lists as bullets
|
|
50
|
-
location?: string; // human-readable path, e.g. "Cycle › Practice"
|
|
51
|
-
dataPath?: string;
|
|
52
|
-
keyword?: string;
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Rendering as HTML (or anything else)
|
|
57
|
-
|
|
58
|
-
Pass a renderer. `htmlRenderer` produces the same Bulma-classed markup the platform UI uses;
|
|
59
|
-
`textRenderer` (the default) produces plain text / lightweight markdown. You can also supply
|
|
60
|
-
your own `IErrorRenderer`.
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
import { formatErrors, htmlRenderer } from '@hestia-earth/ui-components/file-errors';
|
|
64
|
-
|
|
65
|
-
formatErrors(errors, { renderer: htmlRenderer });
|
|
66
|
-
// message: '<p class="is-normal">Only the following values are permitted: <code>1 ha</code>, <code>relative</code>.</p>'
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Custom link URLs
|
|
70
|
-
|
|
71
|
-
Links default to `https://www.hestia.earth`. Override the base (or each URL) via `urls`:
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
import { formatErrors, urlConfig } from '@hestia-earth/ui-components/file-errors';
|
|
75
|
-
|
|
76
|
-
formatErrors(errors, { urls: urlConfig('https://www.hestia.earth') });
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Lower-level: build a reusable formatter
|
|
80
|
-
|
|
81
|
-
`formatErrors` builds a formatter on every call. To reuse one (e.g. format errors one at a
|
|
82
|
-
time, or reach the individual functions), use `createErrorFormatter`:
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
import { createErrorFormatter, textRenderer, defaultUrlConfig } from '@hestia-earth/ui-components/file-errors';
|
|
86
|
-
|
|
87
|
-
const { formatError, formatErrors, formatCustomErrorMessage, parseDataPath, dataPathLabel } = createErrorFormatter({
|
|
88
|
-
renderer: textRenderer,
|
|
89
|
-
urls: defaultUrlConfig
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
formatError(errors[0]); // single IValidationError -> { level, message, ...error }
|
|
93
|
-
formatCustomErrorMessage(errors[0].message, errors[0]); // just the message string
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Helpers
|
|
97
|
-
|
|
98
|
-
Pure, renderer-independent predicates are exported too:
|
|
99
|
-
|
|
100
|
-
```ts
|
|
101
|
-
import {
|
|
102
|
-
errorHasError,
|
|
103
|
-
errorHasWarning,
|
|
104
|
-
isMigrationError,
|
|
105
|
-
isMissingPropertyError,
|
|
106
|
-
isMissingOneOfError,
|
|
107
|
-
filterError,
|
|
108
|
-
missingNodeErrors,
|
|
109
|
-
guidePageId
|
|
110
|
-
} from '@hestia-earth/ui-components/file-errors';
|
|
111
|
-
|
|
112
|
-
const blocking = errors.filter(errorHasError);
|
|
113
|
-
const warnings = errors.filter(errorHasWarning);
|
|
114
|
-
```
|