@genesislcap/foundation-forms 14.488.1 → 14.488.2-FUI-2571.3
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 +1381 -721
- package/dist/dts/form.d.ts +77 -0
- package/dist/dts/form.d.ts.map +1 -1
- package/dist/dts/form.styles.d.ts.map +1 -1
- package/dist/dts/form.template.d.ts.map +1 -1
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/CategorizationWrapperRenderer.d.ts.map +1 -1
- package/dist/dts/react.d.ts +10 -0
- package/dist/dts/review.d.ts +34 -0
- package/dist/dts/review.d.ts.map +1 -0
- package/dist/dts/review.styles.d.ts +3 -0
- package/dist/dts/review.styles.d.ts.map +1 -0
- package/dist/dts/review.template.d.ts +6 -0
- package/dist/dts/review.template.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/review-utils.d.ts +73 -0
- package/dist/dts/utils/review-utils.d.ts.map +1 -0
- package/dist/dts/utils/schema-utils.d.ts +12 -0
- package/dist/dts/utils/schema-utils.d.ts.map +1 -1
- package/dist/esm/form.js +120 -1
- package/dist/esm/form.styles.js +9 -2
- package/dist/esm/form.template.js +58 -24
- package/dist/esm/index.js +3 -0
- package/dist/esm/jsonforms/renderers/CategorizationWrapperRenderer.js +1 -45
- package/dist/esm/review.js +63 -0
- package/dist/esm/review.styles.js +93 -0
- package/dist/esm/review.template.js +38 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/review-utils.js +269 -0
- package/dist/esm/utils/schema-utils.js +48 -0
- package/dist/foundation-forms.api.json +1229 -114
- package/dist/foundation-forms.d.ts +200 -0
- package/dist/react.cjs +7 -0
- package/dist/react.mjs +6 -0
- package/package.json +15 -15
|
@@ -93,6 +93,54 @@ export function isBulkUiSchema(uischema) {
|
|
|
93
93
|
var _a;
|
|
94
94
|
return (_a = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _a === void 0 ? void 0 : _a.some((element) => element.scope === '#/properties/items' && element.type === 'Control');
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Converts AJV validation errors to the JSON Schema scope strings they correspond to
|
|
98
|
+
* (e.g. `#/properties/ADDRESS/properties/STREET`). Used to match errors back to UI
|
|
99
|
+
* schema controls for features like categorization-tab error indicators.
|
|
100
|
+
*/
|
|
101
|
+
export function extractErrorScopes(errors) {
|
|
102
|
+
var _a;
|
|
103
|
+
const scopes = new Set();
|
|
104
|
+
for (const error of errors) {
|
|
105
|
+
if (error.keyword === 'required' && ((_a = error.params) === null || _a === void 0 ? void 0 : _a.missingProperty)) {
|
|
106
|
+
const basePath = error.instancePath || '';
|
|
107
|
+
const prop = error.params.missingProperty;
|
|
108
|
+
const fullPath = basePath === '' ? `#/properties/${prop}` : `#${basePath}/properties/${prop}`;
|
|
109
|
+
scopes.add(fullPath);
|
|
110
|
+
}
|
|
111
|
+
else if (error.instancePath) {
|
|
112
|
+
// Convert JSON Pointer /ADDRESS/STREET → #/properties/ADDRESS/properties/STREET
|
|
113
|
+
const instancePath = `#${error.instancePath.replace(/\//g, '/properties/')}`;
|
|
114
|
+
scopes.add(instancePath);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return Array.from(scopes);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns true when `uiSchema` (or any of its descendants) has a scope that appears
|
|
121
|
+
* in `errorScopes`. Walks both `elements` and `options.childElements`.
|
|
122
|
+
*/
|
|
123
|
+
export function uiSchemaHasAnyError(uiSchema, errorScopes) {
|
|
124
|
+
var _a;
|
|
125
|
+
if (typeof uiSchema.scope === 'string' &&
|
|
126
|
+
errorScopes.includes(uiSchema.scope)) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
const childElements = (_a = uiSchema.options) === null || _a === void 0 ? void 0 : _a.childElements;
|
|
130
|
+
if (Array.isArray(childElements)) {
|
|
131
|
+
for (const child of childElements) {
|
|
132
|
+
if (uiSchemaHasAnyError(child, errorScopes))
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (Array.isArray(uiSchema.elements)) {
|
|
137
|
+
for (const el of uiSchema.elements) {
|
|
138
|
+
if (uiSchemaHasAnyError(el, errorScopes))
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
96
144
|
/**
|
|
97
145
|
* Generates a UI schema suitable for bulk insert mode with array control.
|
|
98
146
|
* @param userProvidedUiSchema - Optional user-provided UI schema to use as childUiSchema
|