@limetech/lime-elements 35.0.0-next.21 → 35.0.0-next.25

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.
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { FormError, ValidationStatus } from './form.types';
2
+ import { FormError, ValidationError, ValidationStatus } from './form.types';
3
3
  /**
4
4
  * @exampleComponent limel-example-form
5
5
  * @exampleComponent limel-example-nested-form
@@ -10,6 +10,7 @@ import { FormError, ValidationStatus } from './form.types';
10
10
  * @exampleComponent limel-example-form-layout
11
11
  * @exampleComponent limel-example-form-span-fields
12
12
  * @exampleComponent limel-example-custom-error-message
13
+ * @exampleComponent limel-example-server-errors
13
14
  */
14
15
  export declare class Form {
15
16
  /**
@@ -41,6 +42,11 @@ export declare class Form {
41
42
  * Custom function to customize the default error messages
42
43
  */
43
44
  transformErrors?: (errors: FormError[]) => FormError[];
45
+ /**
46
+ * Extra errors to display in the form. Typical use case is asynchronous
47
+ * errors generated server side.
48
+ */
49
+ errors: ValidationError;
44
50
  /**
45
51
  * Emitted when a change is made within the form
46
52
  */
@@ -69,5 +75,6 @@ export declare class Form {
69
75
  private setSchemaId;
70
76
  private createValidator;
71
77
  private getValidationErrors;
78
+ private getExtraErrors;
72
79
  private getCustomErrorMessages;
73
80
  }
@@ -29,6 +29,12 @@ export interface FormError {
29
29
  */
30
30
  message: string;
31
31
  }
32
+ export declare type ValidationError = {
33
+ /**
34
+ * Name of the field the error belongs to
35
+ */
36
+ [key: string]: string[] | ValidationError;
37
+ };
32
38
  export interface FormComponent<T = any> {
33
39
  /**
34
40
  * The value of the current property
@@ -10,7 +10,7 @@ import { Action as Action1, Chip, DateType, DialogHeading, FileInfo, FlexContain
10
10
  import { CircularProgressSize } from "./components/circular-progress/circular-progress.types";
11
11
  import { ColorScheme, Language } from "./components/code-editor/code-editor.types";
12
12
  import { Action } from "./components/collapsible-section/action";
13
- import { FormError, ValidationStatus } from "./components/form/form.types";
13
+ import { FormError, ValidationError, ValidationStatus } from "./components/form/form.types";
14
14
  import { IconSize } from "./components/icon/icon.types";
15
15
  import { InputType } from "./components/input-field/input-field.types";
16
16
  import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
@@ -430,6 +430,10 @@ export namespace Components {
430
430
  * Set to `true` to disable the whole form.
431
431
  */
432
432
  "disabled": boolean;
433
+ /**
434
+ * Extra errors to display in the form. Typical use case is asynchronous errors generated server side.
435
+ */
436
+ "errors": ValidationError;
433
437
  /**
434
438
  * Factory for creating properties for custom form components When using custom components in the form some properties might have to be set dynamically. If this factory is set, it will be called with the current schema for the field for each custom component in the form. The factory must return an object where each key is the name of the property that should be set, along with its value.
435
439
  */
@@ -1827,6 +1831,10 @@ declare namespace LocalJSX {
1827
1831
  * Set to `true` to disable the whole form.
1828
1832
  */
1829
1833
  "disabled"?: boolean;
1834
+ /**
1835
+ * Extra errors to display in the form. Typical use case is asynchronous errors generated server side.
1836
+ */
1837
+ "errors"?: ValidationError;
1830
1838
  /**
1831
1839
  * Emitted when a change is made within the form
1832
1840
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "35.0.0-next.21",
3
+ "version": "35.0.0-next.25",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -88,7 +88,7 @@
88
88
  "react-shadow-dom-retarget-events": "^1.1.0",
89
89
  "replace-in-file": "^6.2.0",
90
90
  "shelljs": "0.8.5",
91
- "showdown": "1.9.1",
91
+ "showdown": "2.0.0",
92
92
  "shx": "^0.3.3",
93
93
  "tabulator-tables": "^4.9.3",
94
94
  "typescript": "^4.3.5"