@genesislcap/foundation-forms 14.451.5-alpha-ec85af7.0 → 14.452.1-FUI-2538.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +138 -0
- package/dist/dts/form.d.ts +16 -0
- package/dist/dts/form.d.ts.map +1 -1
- package/dist/dts/form.template.d.ts.map +1 -1
- package/dist/dts/jsonforms/json-forms.d.ts +15 -0
- package/dist/dts/jsonforms/json-forms.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/CategorizationWrapperRenderer.d.ts +14 -0
- package/dist/dts/jsonforms/renderers/CategorizationWrapperRenderer.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/ControlWrapperRenderer.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/VerticalCategorizationWrapperRenderer.d.ts.map +1 -1
- package/dist/dts/types.d.ts +12 -0
- package/dist/dts/types.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/server-errors.d.ts +40 -0
- package/dist/dts/utils/server-errors.d.ts.map +1 -0
- package/dist/esm/form.js +38 -2
- package/dist/esm/form.template.js +1 -0
- package/dist/esm/jsonforms/json-forms.js +49 -19
- package/dist/esm/jsonforms/renderers/CategorizationWrapperRenderer.js +28 -1
- package/dist/esm/jsonforms/renderers/ControlWrapperRenderer.js +10 -1
- package/dist/esm/jsonforms/renderers/VerticalCategorizationWrapperRenderer.js +10 -2
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/server-errors.js +98 -0
- package/dist/foundation-forms.api.json +141 -0
- package/dist/foundation-forms.d.ts +144 -0
- package/package.json +15 -15
|
@@ -1456,6 +1456,15 @@
|
|
|
1456
1456
|
"privacy": "private",
|
|
1457
1457
|
"default": "false"
|
|
1458
1458
|
},
|
|
1459
|
+
{
|
|
1460
|
+
"kind": "field",
|
|
1461
|
+
"name": "serverErrors",
|
|
1462
|
+
"type": {
|
|
1463
|
+
"text": "ErrorObject[]"
|
|
1464
|
+
},
|
|
1465
|
+
"privacy": "private",
|
|
1466
|
+
"default": "[]"
|
|
1467
|
+
},
|
|
1459
1468
|
{
|
|
1460
1469
|
"kind": "field",
|
|
1461
1470
|
"name": "submitted",
|
|
@@ -1603,6 +1612,75 @@
|
|
|
1603
1612
|
"kind": "field",
|
|
1604
1613
|
"name": "dispatch"
|
|
1605
1614
|
},
|
|
1615
|
+
{
|
|
1616
|
+
"kind": "method",
|
|
1617
|
+
"name": "setServerErrors",
|
|
1618
|
+
"parameters": [
|
|
1619
|
+
{
|
|
1620
|
+
"name": "errors",
|
|
1621
|
+
"type": {
|
|
1622
|
+
"text": "ErrorObject[]"
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
],
|
|
1626
|
+
"description": "Applies server-side validation errors returned from an EVENT_NACK response.\nErrors are merged into `core.additionalErrors` and shown inline on fields.",
|
|
1627
|
+
"privacy": "public"
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
"kind": "method",
|
|
1631
|
+
"name": "clearServerErrors",
|
|
1632
|
+
"description": "Clears all server-side validation errors from the form.",
|
|
1633
|
+
"privacy": "public"
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
"kind": "method",
|
|
1637
|
+
"name": "buildAdditionalErrors",
|
|
1638
|
+
"privacy": "private",
|
|
1639
|
+
"return": {
|
|
1640
|
+
"type": {
|
|
1641
|
+
"text": "ErrorObject[]"
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
"parameters": [
|
|
1645
|
+
{
|
|
1646
|
+
"name": "uischema",
|
|
1647
|
+
"type": {
|
|
1648
|
+
"text": "UISchemaElement"
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"name": "data",
|
|
1653
|
+
"type": {
|
|
1654
|
+
"text": "any"
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
]
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
"kind": "method",
|
|
1661
|
+
"name": "applyAdditionalErrorsToCore",
|
|
1662
|
+
"privacy": "private",
|
|
1663
|
+
"parameters": [
|
|
1664
|
+
{
|
|
1665
|
+
"name": "nextCore",
|
|
1666
|
+
"type": {
|
|
1667
|
+
"text": "JsonFormsCore"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
"name": "changedPath",
|
|
1672
|
+
"optional": true,
|
|
1673
|
+
"type": {
|
|
1674
|
+
"text": "string"
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
]
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
"kind": "method",
|
|
1681
|
+
"name": "refreshAdditionalErrors",
|
|
1682
|
+
"privacy": "private"
|
|
1683
|
+
},
|
|
1606
1684
|
{
|
|
1607
1685
|
"kind": "field",
|
|
1608
1686
|
"name": "validate",
|
|
@@ -1939,6 +2017,14 @@
|
|
|
1939
2017
|
"package": "./validation"
|
|
1940
2018
|
}
|
|
1941
2019
|
},
|
|
2020
|
+
{
|
|
2021
|
+
"kind": "js",
|
|
2022
|
+
"name": "*",
|
|
2023
|
+
"declaration": {
|
|
2024
|
+
"name": "*",
|
|
2025
|
+
"package": "./server-errors"
|
|
2026
|
+
}
|
|
2027
|
+
},
|
|
1942
2028
|
{
|
|
1943
2029
|
"kind": "js",
|
|
1944
2030
|
"name": "*",
|
|
@@ -1961,6 +2047,58 @@
|
|
|
1961
2047
|
"declarations": [],
|
|
1962
2048
|
"exports": []
|
|
1963
2049
|
},
|
|
2050
|
+
{
|
|
2051
|
+
"kind": "javascript-module",
|
|
2052
|
+
"path": "src/utils/server-errors.ts",
|
|
2053
|
+
"declarations": [
|
|
2054
|
+
{
|
|
2055
|
+
"kind": "function",
|
|
2056
|
+
"name": "mapGenesisFieldErrorsToAdditionalErrors",
|
|
2057
|
+
"return": {
|
|
2058
|
+
"type": {
|
|
2059
|
+
"text": "ErrorObject[]"
|
|
2060
|
+
}
|
|
2061
|
+
},
|
|
2062
|
+
"parameters": [
|
|
2063
|
+
{
|
|
2064
|
+
"name": "errors",
|
|
2065
|
+
"type": {
|
|
2066
|
+
"text": "GenesisFieldError[] | undefined"
|
|
2067
|
+
},
|
|
2068
|
+
"description": "Genesis ERROR array from an EVENT_NACK response"
|
|
2069
|
+
},
|
|
2070
|
+
{
|
|
2071
|
+
"name": "schema",
|
|
2072
|
+
"optional": true,
|
|
2073
|
+
"type": {
|
|
2074
|
+
"text": "JSONSchema7"
|
|
2075
|
+
},
|
|
2076
|
+
"description": "JSON schema used to resolve `parentSchema` for each field"
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
"name": "instancePathPrefix",
|
|
2080
|
+
"optional": true,
|
|
2081
|
+
"type": {
|
|
2082
|
+
"text": "string"
|
|
2083
|
+
},
|
|
2084
|
+
"description": "Optional prefix for bulk-insert rows (e.g. `/items/0`)"
|
|
2085
|
+
}
|
|
2086
|
+
],
|
|
2087
|
+
"description": "Maps Genesis commitEvent NACK `ERROR[]` entries to JsonForms `ErrorObject[]`\nsuitable for `additionalErrors` on the form core.\n\nOnly entries with a `FIELD` or `PATH` are mapped; generic errors (no field\nassociation) are omitted so callers can still surface them via toast/dialog.",
|
|
2088
|
+
"privacy": "public"
|
|
2089
|
+
}
|
|
2090
|
+
],
|
|
2091
|
+
"exports": [
|
|
2092
|
+
{
|
|
2093
|
+
"kind": "js",
|
|
2094
|
+
"name": "mapGenesisFieldErrorsToAdditionalErrors",
|
|
2095
|
+
"declaration": {
|
|
2096
|
+
"name": "mapGenesisFieldErrorsToAdditionalErrors",
|
|
2097
|
+
"module": "src/utils/server-errors.ts"
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
]
|
|
2101
|
+
},
|
|
1964
2102
|
{
|
|
1965
2103
|
"kind": "javascript-module",
|
|
1966
2104
|
"path": "src/utils/translation.ts",
|
package/dist/dts/form.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { JSONForms } from './jsonforms/json-forms';
|
|
3
4
|
import { BulkRowStatus, RendererEntry, UiSchema } from './types';
|
|
4
5
|
/**
|
|
5
6
|
* Set of default renderers used by the foundation-forms.
|
|
@@ -442,6 +443,11 @@ export declare class Form extends Form_base {
|
|
|
442
443
|
* @internal
|
|
443
444
|
*/
|
|
444
445
|
csvFileInput: HTMLInputElement;
|
|
446
|
+
/**
|
|
447
|
+
* Reference to the internal json-forms element.
|
|
448
|
+
* @internal
|
|
449
|
+
*/
|
|
450
|
+
jsonFormsElement: JSONForms;
|
|
445
451
|
/**
|
|
446
452
|
* Stores the approval message entered by the user.
|
|
447
453
|
* @internal
|
|
@@ -664,6 +670,16 @@ export declare class Form extends Form_base {
|
|
|
664
670
|
* @public
|
|
665
671
|
*/
|
|
666
672
|
reset(clearData?: boolean): void;
|
|
673
|
+
/**
|
|
674
|
+
* Maps Genesis EVENT_NACK field errors onto the form via additionalErrors.
|
|
675
|
+
* @internal
|
|
676
|
+
*/
|
|
677
|
+
private applyServerFieldErrors;
|
|
678
|
+
/**
|
|
679
|
+
* Maps field errors from failed bulk-insert rows onto the form.
|
|
680
|
+
* @internal
|
|
681
|
+
*/
|
|
682
|
+
private applyBulkServerFieldErrors;
|
|
667
683
|
/**
|
|
668
684
|
* Show the approval message modal
|
|
669
685
|
* @internal
|
package/dist/dts/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.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G;IACH,mBAAmB;CA2BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,
|
|
1
|
+
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DAkHrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { BulkRowStatus } from '../types';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class JSONForms extends FASTElement {
|
|
13
13
|
private _submitted;
|
|
14
|
+
private serverErrors;
|
|
14
15
|
get submitted(): boolean;
|
|
15
16
|
set submitted(value: boolean);
|
|
16
17
|
prefix: any;
|
|
@@ -48,6 +49,20 @@ export declare class JSONForms extends FASTElement {
|
|
|
48
49
|
bulkInsertChanged(): void;
|
|
49
50
|
get props(): RendererProps;
|
|
50
51
|
dispatch: (action: UpdateAction) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Applies server-side validation errors returned from an EVENT_NACK response.
|
|
54
|
+
* Errors are merged into `core.additionalErrors` and shown inline on fields.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
setServerErrors(errors: ErrorObject[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Clears all server-side validation errors from the form.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
clearServerErrors(): void;
|
|
63
|
+
private buildAdditionalErrors;
|
|
64
|
+
private applyAdditionalErrorsToCore;
|
|
65
|
+
private refreshAdditionalErrors;
|
|
51
66
|
/**
|
|
52
67
|
* Performs client-side validation by running the validator defined in the UI schema.
|
|
53
68
|
* @param uischema the UI schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-forms.d.ts","sourceRoot":"","sources":["../../../src/jsonforms/json-forms.ts"],"names":[],"mappings":"AACA,OAAO,EASL,8BAA8B,EAE9B,aAAa,EAGb,eAAe,EACf,YAAY,EACZ,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,WAAW,EAKZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAmCzC;;;;;;GAMG;AACH,qBAUa,SAAU,SAAQ,WAAW;IACxC,OAAO,CAAC,UAAU,CAAS;
|
|
1
|
+
{"version":3,"file":"json-forms.d.ts","sourceRoot":"","sources":["../../../src/jsonforms/json-forms.ts"],"names":[],"mappings":"AACA,OAAO,EASL,8BAA8B,EAE9B,aAAa,EAGb,eAAe,EACf,YAAY,EACZ,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,WAAW,EAKZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAmCzC;;;;;;GAMG;AACH,qBAUa,SAAU,SAAQ,WAAW;IACxC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAqB;IAEzC,IAAI,SAAS,IAAI,OAAO,CAGvB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAG3B;IAEW,MAAM,MAAC;IACnB,aAAa;IAGD,SAAS,MAAC;IACV,IAAI,MAAC;IACL,YAAY,MAAC;IAEb,MAAM,MAAC;IACnB,aAAa;IA+DD,QAAQ,EAAE,eAAe,CAAC;IACtC,eAAe;IAIH,IAAI,MAAC;IACjB,WAAW;IAwBC,SAAS,EAAE,8BAA8B,EAAE,CAAC;IACxD,gBAAgB;IAIJ,cAAc,EAAE,cAAc,CAAC;IAC3C,qBAAqB;IAIT,GAAG,EAAE,GAAG,CAAiD;IACrE,UAAU;IAIiB,QAAQ,EAAE,OAAO,CAAC;IAC7C,eAAe;IAIH,MAAM,EAAE,GAAG,CAAC;IACxB,aAAa;IAIb;;;OAGG;IACS,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAa;IACtE,wBAAwB;IAUxB;;;OAGG;IACS,UAAU,EAAE,OAAO,CAAS;IACxC,iBAAiB;IAUjB,IAAI,KAAK,IAAI,aAAa,CAuBzB;IAED,QAAQ,GAAI,QAAQ,YAAY,UAe9B;IAEF;;;;OAIG;IACH,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE;IAKrC;;;OAGG;IACH,iBAAiB;IAKjB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,2BAA2B;IAenC,OAAO,CAAC,uBAAuB;IAO/B;;;;;OAKG;IACH,QAAQ,GAAI,UAAU,eAAe,EAAE,UAAiC,KAAG,WAAW,EAAE,CAoDtF;IAEI,uBAAuB;CAQ9B"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
import { UiSchemaElement } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the `className` option declared on a categorization category element
|
|
5
|
+
* to the class name(s) that should be applied to its tab header. Mirrors the
|
|
6
|
+
* control-level `className` option: either a static string, or a function that
|
|
7
|
+
* receives the entire form data and returns the class name(s).
|
|
8
|
+
*
|
|
9
|
+
* Tab headers render eagerly (unlike the lazily-mounted panels), so a class
|
|
10
|
+
* applied here is in the DOM for every category on first paint — even before
|
|
11
|
+
* its panel is opened.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeCategoryClassName(category: UiSchemaElement, data: any): string;
|
|
2
16
|
export declare const tabControlIconStyles: import("@microsoft/fast-element").ElementStyles;
|
|
3
17
|
export declare const CategorizationWrapperRendererTemplate: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<CategorizationWrapper, any>;
|
|
4
18
|
export declare class CategorizationWrapper extends FASTElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAA2C,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvF;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAMrF;AAED,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,eAAe,+EA0DhB,CAAC;AAsBF,qBAQa,qBAAsB,SAAQ,WAAW;IACxC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAgB;IAEpD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIjC,eAAe,CAAC,KAAK,EAAE,KAAK;IAO5B,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAQjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/ControlWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,YAAY,EAQb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,cAAc,MAAM,oDAwD3D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,iDAA6C,CAAC;AAE/E,UAAU,qBAAqB;IAC7B;;;;OAIG;IACH,aAAa,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC9C,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,qBAAqB,KAC7B,YAAY,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ControlWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/ControlWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,YAAY,EAQb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,cAAc,MAAM,oDAwD3D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,iDAA6C,CAAC;AAE/E,UAAU,qBAAqB;IAC7B;;;;OAIG;IACH,aAAa,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC9C,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,qBAAqB,KAC7B,YAAY,CAAC,gBAAgB,CA8D/B,CAAC;AA2CF,4BAA4B;AAC5B,eAAO,MAAM,8BAA8B,wBAoD1C,CAAC;AAoEF;;;;GAIG;AACH,qBAKa,cAAe,SAAQ,WAAW;IACjC,OAAO,MAAC;IACR,SAAS,MAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACuB,SAAS,EAAE,OAAO,CAAS;IACzE,MAAM,EAAE,MAAM,CAAC;IAEZ,iBAAiB;IAQ1B,IACI,eAAe,YAOlB;IAED,IACI,aAAa,WAOhB;IAED,IACI,kBAAkB,2BAGrB;IAED,IACI,UAAU,WAOb;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalCategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/VerticalCategorizationWrapperRenderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerticalCategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/VerticalCategorizationWrapperRenderer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAA4B,MAAM,iCAAiC,CAAC;AAElG,eAAO,MAAM,6CAA6C,GACxD,eAAe,uFAkEhB,CAAC;AAgEF,qBAQa,6BAA8B,SAAQ,qBAAqB;IAChE,MAAM,EAAE,MAAM,CAAM;IAE1B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAMjD,iBAAiB;CAIlB"}
|
package/dist/dts/types.d.ts
CHANGED
|
@@ -524,6 +524,18 @@ export interface StandardRendererOptions {
|
|
|
524
524
|
* @public
|
|
525
525
|
*/
|
|
526
526
|
useNumberControl?: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* CSS class name(s) to apply to the element's rendered root.
|
|
529
|
+
* - On a control, applied to its wrapper root element.
|
|
530
|
+
* - On a categorization `Category`, applied to its tab header. Tab headers
|
|
531
|
+
* render eagerly, so the class is present for every category on first paint
|
|
532
|
+
* even before its (lazily-mounted) panel is opened.
|
|
533
|
+
*
|
|
534
|
+
* Either a static string, or a function that receives the entire form data
|
|
535
|
+
* and returns the class name(s) to apply.
|
|
536
|
+
* @public
|
|
537
|
+
*/
|
|
538
|
+
className?: string | ((data: any) => string);
|
|
527
539
|
}
|
|
528
540
|
/**
|
|
529
541
|
* Configuration options for the segmented control renderer.
|
package/dist/dts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,gBAAgB,GAChB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,OAAO,GACP,SAAS,GACT,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,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","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ErrorObject } from 'ajv';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Genesis EVENT_NACK field-level error entry.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type GenesisFieldError = {
|
|
8
|
+
'@type'?: string;
|
|
9
|
+
CODE?: string;
|
|
10
|
+
TEXT: string;
|
|
11
|
+
STATUS_CODE?: string;
|
|
12
|
+
FIELD?: string;
|
|
13
|
+
PATH?: string | null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Converts a JsonForms/Ajv instance path to a JSON Forms scope string.
|
|
17
|
+
* @example `/items/0/CCY` → `#/properties/items/items/0/properties/CCY`
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function instancePathToJsonFormsScope(instancePath: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Converts a Genesis JSON-path or FIELD name to a JsonForms instance path.
|
|
23
|
+
* Strips the `$.` prefix and optional `DETAILS` segment used in event payloads.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function genesisFieldToInstancePath(field?: string, path?: string | null, instancePathPrefix?: string): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Maps Genesis commitEvent NACK `ERROR[]` entries to JsonForms `ErrorObject[]`
|
|
29
|
+
* suitable for `additionalErrors` on the form core.
|
|
30
|
+
*
|
|
31
|
+
* Only entries with a `FIELD` or `PATH` are mapped; generic errors (no field
|
|
32
|
+
* association) are omitted so callers can still surface them via toast/dialog.
|
|
33
|
+
*
|
|
34
|
+
* @param errors - Genesis ERROR array from an EVENT_NACK response
|
|
35
|
+
* @param schema - JSON schema used to resolve `parentSchema` for each field
|
|
36
|
+
* @param instancePathPrefix - Optional prefix for bulk-insert rows (e.g. `/items/0`)
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare function mapGenesisFieldErrorsToAdditionalErrors(errors: GenesisFieldError[] | undefined, schema?: JSONSchema7, instancePathPrefix?: string): ErrorObject[];
|
|
40
|
+
//# sourceMappingURL=server-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-errors.d.ts","sourceRoot":"","sources":["../../../src/utils/server-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAkBzE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EACpB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,GAAG,IAAI,CAuBf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,iBAAiB,EAAE,GAAG,SAAS,EACvC,MAAM,CAAC,EAAE,WAAW,EACpB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,WAAW,EAAE,CAoCf"}
|
package/dist/esm/form.js
CHANGED
|
@@ -29,7 +29,7 @@ import { NumberControlRendererEntry } from './jsonforms/renderers/NumberControlR
|
|
|
29
29
|
import { SegmentedControlRendererEntry } from './jsonforms/renderers/SegmentedControlRenderer';
|
|
30
30
|
import { StringArrayEntry } from './jsonforms/renderers/StringArrayControlRenderer';
|
|
31
31
|
import { StringControlRendererTemplate } from './jsonforms/renderers/StringControlRenderer';
|
|
32
|
-
import { downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, logger, mapCsvToSchema, parseCsv, } from './utils';
|
|
32
|
+
import { downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, logger, mapCsvToSchema, mapGenesisFieldErrorsToAdditionalErrors, parseCsv, } from './utils';
|
|
33
33
|
import { findModalParent, showConfirmationDialog } from './utils/confirmation-dialog-utils';
|
|
34
34
|
import { removeDataPropertiesNotInSchema } from './utils/form-utils';
|
|
35
35
|
import { generateBulkUiSchema, isBulkUiSchema } from './utils/schema-utils';
|
|
@@ -297,6 +297,7 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
297
297
|
this.showApprovalModal();
|
|
298
298
|
}
|
|
299
299
|
else {
|
|
300
|
+
this.applyServerFieldErrors(formSubmitReq.ERROR);
|
|
300
301
|
this.$emit('submit-failure', { payload, errors: formSubmitReq.ERROR });
|
|
301
302
|
}
|
|
302
303
|
}
|
|
@@ -313,7 +314,7 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
313
314
|
*/
|
|
314
315
|
_submitBulk() {
|
|
315
316
|
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
var _a;
|
|
317
|
+
var _a, _b;
|
|
317
318
|
const items = ((_a = this.data) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
318
319
|
// Validate minimum items
|
|
319
320
|
if (items.length < this.bulkInsertMinItems) {
|
|
@@ -390,15 +391,18 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
390
391
|
this.$emit('bulk-submit-complete', results);
|
|
391
392
|
// Also emit standard events based on overall result
|
|
392
393
|
if (results.failed.length === 0) {
|
|
394
|
+
(_b = this.jsonFormsElement) === null || _b === void 0 ? void 0 : _b.clearServerErrors();
|
|
393
395
|
this.$emit('submit-success', { payload: this.data, results });
|
|
394
396
|
}
|
|
395
397
|
else if (results.successful.length === 0) {
|
|
398
|
+
this.applyBulkServerFieldErrors(results.failed);
|
|
396
399
|
this.$emit('submit-failure', {
|
|
397
400
|
payload: this.data,
|
|
398
401
|
errors: results.failed.flatMap((f) => f.errors),
|
|
399
402
|
});
|
|
400
403
|
}
|
|
401
404
|
else {
|
|
405
|
+
this.applyBulkServerFieldErrors(results.failed);
|
|
402
406
|
// Partial success - emit both events
|
|
403
407
|
this.$emit('submit-partial-success', { payload: this.data, results });
|
|
404
408
|
}
|
|
@@ -461,6 +465,7 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
461
465
|
const response = yield this.connect.commitEvent(this.resourceName, commitPayload);
|
|
462
466
|
if (response.ERROR) {
|
|
463
467
|
this.updateRowStatus(index, { status: 'failed', errors: response.ERROR });
|
|
468
|
+
this.applyServerFieldErrors(response.ERROR, `/items/${index}`);
|
|
464
469
|
this.$emit('row-submit-failure', { index, item, errors: response.ERROR });
|
|
465
470
|
}
|
|
466
471
|
else {
|
|
@@ -583,13 +588,43 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
583
588
|
* @public
|
|
584
589
|
*/
|
|
585
590
|
reset(clearData = true) {
|
|
591
|
+
var _a;
|
|
586
592
|
this.submitted = false;
|
|
587
593
|
this.clearRowSubmitStatuses();
|
|
594
|
+
(_a = this.jsonFormsElement) === null || _a === void 0 ? void 0 : _a.clearServerErrors();
|
|
588
595
|
if (clearData) {
|
|
589
596
|
this.data = {};
|
|
590
597
|
}
|
|
591
598
|
Observable.notify(this, 'submitted');
|
|
592
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* Maps Genesis EVENT_NACK field errors onto the form via additionalErrors.
|
|
602
|
+
* @internal
|
|
603
|
+
*/
|
|
604
|
+
applyServerFieldErrors(errors, instancePathPrefix) {
|
|
605
|
+
var _a, _b;
|
|
606
|
+
const additionalErrors = mapGenesisFieldErrorsToAdditionalErrors(errors, this.jsonSchema, instancePathPrefix);
|
|
607
|
+
if (additionalErrors.length) {
|
|
608
|
+
(_a = this.jsonFormsElement) === null || _a === void 0 ? void 0 : _a.setServerErrors(additionalErrors);
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
(_b = this.jsonFormsElement) === null || _b === void 0 ? void 0 : _b.clearServerErrors();
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Maps field errors from failed bulk-insert rows onto the form.
|
|
616
|
+
* @internal
|
|
617
|
+
*/
|
|
618
|
+
applyBulkServerFieldErrors(failed) {
|
|
619
|
+
var _a, _b;
|
|
620
|
+
const additionalErrors = failed.flatMap(({ index, errors }) => mapGenesisFieldErrorsToAdditionalErrors(errors, this.jsonSchema, `/items/${index}`));
|
|
621
|
+
if (additionalErrors.length) {
|
|
622
|
+
(_a = this.jsonFormsElement) === null || _a === void 0 ? void 0 : _a.setServerErrors(additionalErrors);
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
(_b = this.jsonFormsElement) === null || _b === void 0 ? void 0 : _b.clearServerErrors();
|
|
626
|
+
}
|
|
627
|
+
}
|
|
593
628
|
/**
|
|
594
629
|
* Show the approval message modal
|
|
595
630
|
* @internal
|
|
@@ -634,6 +669,7 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
634
669
|
const formSubmitReq = yield this.connect.commitEvent(this.resourceName, commitPayload);
|
|
635
670
|
this.submitting = false;
|
|
636
671
|
if (formSubmitReq.ERROR) {
|
|
672
|
+
this.applyServerFieldErrors(formSubmitReq.ERROR);
|
|
637
673
|
this.$emit('submit-failure', { payload: this.pendingPayload, errors: formSubmitReq.ERROR });
|
|
638
674
|
}
|
|
639
675
|
else {
|
|
@@ -40,6 +40,7 @@ export const getPrefixedForm = (prefix) => html `
|
|
|
40
40
|
</div>
|
|
41
41
|
`)}
|
|
42
42
|
<json-forms
|
|
43
|
+
${ref('jsonFormsElement')}
|
|
43
44
|
@submit-button-clicked=${(x) => x._submit()}
|
|
44
45
|
@submit-part=${(x, c) => x.submitPart(c.event)}
|
|
45
46
|
@submit-single-row=${(x, c) => x.submitSingleRow(c.event.detail.index)}
|
|
@@ -37,6 +37,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments);
|
|
39
39
|
this._submitted = false;
|
|
40
|
+
this.serverErrors = [];
|
|
40
41
|
this.ajv = createAjv({ useDefaults: true, $data: true });
|
|
41
42
|
/**
|
|
42
43
|
* Row submit statuses for bulk insert mode.
|
|
@@ -54,16 +55,13 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
54
55
|
// the fresh errors. Without this, the value baked in by `Actions.init`
|
|
55
56
|
// sticks forever even when validators would now return [].
|
|
56
57
|
const nextCore = coreReducer(this.jsonforms.core, action);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
additionalErrors,
|
|
65
|
-
path: action.path,
|
|
66
|
-
});
|
|
58
|
+
if (action.path) {
|
|
59
|
+
const editedPath = action.path.startsWith('/')
|
|
60
|
+
? action.path
|
|
61
|
+
: `/${action.path.replace(/\./g, '/')}`;
|
|
62
|
+
this.serverErrors = this.serverErrors.filter((e) => e.instancePath !== editedPath);
|
|
63
|
+
}
|
|
64
|
+
this.applyAdditionalErrorsToCore(nextCore, action.path);
|
|
67
65
|
};
|
|
68
66
|
/**
|
|
69
67
|
* Performs client-side validation by running the validator defined in the UI schema.
|
|
@@ -139,6 +137,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
139
137
|
if (!this.schema) {
|
|
140
138
|
return;
|
|
141
139
|
}
|
|
140
|
+
this.serverErrors = [];
|
|
142
141
|
this.uichemaToUse = (_a = this.uischema) !== null && _a !== void 0 ? _a : Generate.uiSchema(this.schema);
|
|
143
142
|
if (!this.uischema) {
|
|
144
143
|
logger.debug('UI schema not provided. Auto generated schema:', this.uichemaToUse);
|
|
@@ -152,7 +151,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
152
151
|
const core = coreReducer(initialCore, Actions.init(this.data, this.schema, this.uichemaToUse, {
|
|
153
152
|
validationMode: this.validationMode || 'ValidateAndShow',
|
|
154
153
|
ajv: this.ajv,
|
|
155
|
-
additionalErrors: this.
|
|
154
|
+
additionalErrors: this.buildAdditionalErrors(this.uichemaToUse, this.data),
|
|
156
155
|
}));
|
|
157
156
|
return core;
|
|
158
157
|
};
|
|
@@ -166,7 +165,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
166
165
|
rowSubmitStatuses: this.rowSubmitStatuses,
|
|
167
166
|
bulkInsert: this.bulkInsert,
|
|
168
167
|
};
|
|
169
|
-
const additionalErrors = this.
|
|
168
|
+
const additionalErrors = this.buildAdditionalErrors(this.uichemaToUse, this.data);
|
|
170
169
|
// Only notify consumers when `init` actually changed `core.data` (e.g. defaults
|
|
171
170
|
// were filled in). A bare uischema/schema swap must not re-emit `this.data` —
|
|
172
171
|
// when `<foundation-form>` mirrors the echo into its own `data` property it
|
|
@@ -202,13 +201,7 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
202
201
|
const nextCore = coreReducer(this.jsonforms.core, Actions.updateCore(this.data, this.schema, this.uichemaToUse));
|
|
203
202
|
// Validate against the freshly-reduced data, not the still-assigned
|
|
204
203
|
// `this.jsonforms.core.data` (which is the pre-action snapshot).
|
|
205
|
-
|
|
206
|
-
this.jsonforms = Object.assign(Object.assign({}, this.jsonforms), { core: Object.assign(Object.assign({}, nextCore), { additionalErrors }) });
|
|
207
|
-
this.$emit('data-change', {
|
|
208
|
-
data: this.jsonforms.core.data,
|
|
209
|
-
errors: this.jsonforms.core.errors,
|
|
210
|
-
additionalErrors,
|
|
211
|
-
});
|
|
204
|
+
this.applyAdditionalErrorsToCore(nextCore);
|
|
212
205
|
}
|
|
213
206
|
renderersChanged() {
|
|
214
207
|
this.schemaChanged();
|
|
@@ -257,6 +250,43 @@ let JSONForms = class JSONForms extends FASTElement {
|
|
|
257
250
|
visible: true,
|
|
258
251
|
};
|
|
259
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Applies server-side validation errors returned from an EVENT_NACK response.
|
|
255
|
+
* Errors are merged into `core.additionalErrors` and shown inline on fields.
|
|
256
|
+
* @public
|
|
257
|
+
*/
|
|
258
|
+
setServerErrors(errors) {
|
|
259
|
+
this.serverErrors = errors !== null && errors !== void 0 ? errors : [];
|
|
260
|
+
this.refreshAdditionalErrors();
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Clears all server-side validation errors from the form.
|
|
264
|
+
* @public
|
|
265
|
+
*/
|
|
266
|
+
clearServerErrors() {
|
|
267
|
+
this.serverErrors = [];
|
|
268
|
+
this.refreshAdditionalErrors();
|
|
269
|
+
}
|
|
270
|
+
buildAdditionalErrors(uischema, data) {
|
|
271
|
+
return [...this.validate(uischema, data), ...this.serverErrors];
|
|
272
|
+
}
|
|
273
|
+
applyAdditionalErrorsToCore(nextCore, changedPath) {
|
|
274
|
+
const additionalErrors = this.buildAdditionalErrors(this.uichemaToUse, nextCore.data);
|
|
275
|
+
this.jsonforms = Object.assign(Object.assign({}, this.jsonforms), { core: Object.assign(Object.assign({}, nextCore), { additionalErrors }) });
|
|
276
|
+
this.$emit('data-change', {
|
|
277
|
+
data: this.jsonforms.core.data,
|
|
278
|
+
errors: this.jsonforms.core.errors,
|
|
279
|
+
additionalErrors,
|
|
280
|
+
path: changedPath,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
refreshAdditionalErrors() {
|
|
284
|
+
var _a;
|
|
285
|
+
if (!((_a = this.jsonforms) === null || _a === void 0 ? void 0 : _a.core) || !this.uichemaToUse) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
this.applyAdditionalErrorsToCore(this.jsonforms.core);
|
|
289
|
+
}
|
|
260
290
|
copyUISchemaToClipboard() {
|
|
261
291
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
292
|
try {
|