@abgov/jsonforms-components 1.24.6 → 1.24.8
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/index.esm.js
CHANGED
|
@@ -10,6 +10,7 @@ import merge from 'lodash/merge';
|
|
|
10
10
|
import isEmpty$1 from 'lodash/isEmpty';
|
|
11
11
|
import range from 'lodash/range';
|
|
12
12
|
import Ajv from 'ajv';
|
|
13
|
+
import addFormats from 'ajv-formats';
|
|
13
14
|
|
|
14
15
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
15
16
|
|
|
@@ -5066,7 +5067,6 @@ data, field, index, requiredFields) => {
|
|
|
5066
5067
|
const fieldName = element.scope.split('/').pop() || '';
|
|
5067
5068
|
const label = resolveLabelFromScope(element.scope);
|
|
5068
5069
|
const value = (_a = elementData[fieldName]) !== null && _a !== void 0 ? _a : '';
|
|
5069
|
-
console.log('ListWithDetailValue', value);
|
|
5070
5070
|
itemData.push([label, value]);
|
|
5071
5071
|
});
|
|
5072
5072
|
detailData.push([`${i}`, itemData]);
|
|
@@ -6325,11 +6325,18 @@ const RenderLink = props => {
|
|
|
6325
6325
|
label: "",
|
|
6326
6326
|
children: jsx("div", {
|
|
6327
6327
|
"data-testid": "link-jsonform",
|
|
6328
|
-
children: linkUrl && linkValid ? jsx("
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6328
|
+
children: linkUrl && linkValid ? jsx("div", {
|
|
6329
|
+
children: jsxs("a", {
|
|
6330
|
+
href: link,
|
|
6331
|
+
rel: "noopener noreferrer",
|
|
6332
|
+
target: "_blank",
|
|
6333
|
+
children: [linkLabel, jsx(GoAIconButton, {
|
|
6334
|
+
icon: "open",
|
|
6335
|
+
title: "Open",
|
|
6336
|
+
testId: "open-icon",
|
|
6337
|
+
size: "small"
|
|
6338
|
+
})]
|
|
6339
|
+
})
|
|
6333
6340
|
}) : linkLabel
|
|
6334
6341
|
})
|
|
6335
6342
|
});
|
|
@@ -6374,18 +6381,18 @@ const HelpContentComponent = _a => {
|
|
|
6374
6381
|
alt: alt
|
|
6375
6382
|
});
|
|
6376
6383
|
};
|
|
6377
|
-
const textVariant = !((_c = uischema.options) === null || _c === void 0 ? void 0 : _c.variant) || ((_d = uischema.options) === null || _d === void 0 ? void 0 : _d.variant) !== 'details' && ((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) !== '
|
|
6384
|
+
const textVariant = !((_c = uischema.options) === null || _c === void 0 ? void 0 : _c.variant) || ((_d = uischema.options) === null || _d === void 0 ? void 0 : _d.variant) !== 'details' && ((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) !== 'hyperlink';
|
|
6378
6385
|
return jsx(Visible, {
|
|
6379
6386
|
visible: visible,
|
|
6380
6387
|
children: jsx(HelpContentDiv, {
|
|
6381
6388
|
"aria-label": (_f = uischema.options) === null || _f === void 0 ? void 0 : _f.ariaLabel,
|
|
6382
6389
|
children: jsxs("div", {
|
|
6383
6390
|
className: marginClass,
|
|
6384
|
-
children: [label && (!((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) || ((_h = uischema.options) === null || _h === void 0 ? void 0 : _h.variant) === '
|
|
6391
|
+
children: [label && (!((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) || ((_h = uischema.options) === null || _h === void 0 ? void 0 : _h.variant) === 'hyperlink') && jsxs("div", {
|
|
6385
6392
|
className: labelClass,
|
|
6386
6393
|
"data-testid": label,
|
|
6387
6394
|
children: [label, jsx("br", {})]
|
|
6388
|
-
}), ((_j = uischema.options) === null || _j === void 0 ? void 0 : _j.variant) && ((_k = uischema.options) === null || _k === void 0 ? void 0 : _k.variant) === 'img' && renderImage(uischema.options), ((_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.variant) && ((_m = uischema.options) === null || _m === void 0 ? void 0 : _m.variant) === '
|
|
6395
|
+
}), ((_j = uischema.options) === null || _j === void 0 ? void 0 : _j.variant) && ((_k = uischema.options) === null || _k === void 0 ? void 0 : _k.variant) === 'img' && renderImage(uischema.options), ((_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.variant) && ((_m = uischema.options) === null || _m === void 0 ? void 0 : _m.variant) === 'hyperlink' && link && RenderLink(uischema === null || uischema === void 0 ? void 0 : uischema.options), textVariant && renderHelp(), ((_o = uischema.options) === null || _o === void 0 ? void 0 : _o.variant) && ((_p = uischema.options) === null || _p === void 0 ? void 0 : _p.variant) === 'details' && jsxs(GoADetails, {
|
|
6389
6396
|
heading: label ? label : '',
|
|
6390
6397
|
mt: "3xs",
|
|
6391
6398
|
mb: "none",
|
|
@@ -6593,10 +6600,12 @@ var GoAErrorControl = withJsonFormsControlProps(ErrorControl);
|
|
|
6593
6600
|
|
|
6594
6601
|
const ajv = new Ajv({
|
|
6595
6602
|
allErrors: true,
|
|
6596
|
-
verbose: true
|
|
6603
|
+
verbose: true,
|
|
6604
|
+
strict: 'log'
|
|
6597
6605
|
});
|
|
6598
6606
|
//Example format: urn:ads:platform:file-service:v1:/files/f6de737e-c5fc-42fe-963b-28bfe14597c4
|
|
6599
6607
|
ajv.addFormat('file-urn', /^urn:ads:platform:file-service:v[0-9]:\/files\/[a-zA-Z0-9.-]*$/);
|
|
6608
|
+
addFormats(ajv);
|
|
6600
6609
|
|
|
6601
6610
|
const GoABaseRenderers = [
|
|
6602
6611
|
// controls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"@jsonforms/core": "^3.1.0",
|
|
10
10
|
"@jsonforms/react": "^3.1.0",
|
|
11
11
|
"react": "^18.0.0",
|
|
12
|
-
"ajv": "^6.
|
|
13
|
-
"
|
|
12
|
+
"ajv": "^8.6.1",
|
|
13
|
+
"ajv-formats": "^3.0.1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"axios": "^1.6.7",
|
package/src/lib/common/Ajv.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import Ajv from 'ajv';
|
|
2
|
-
export declare const ajv: Ajv
|
|
2
|
+
export declare const ajv: Ajv;
|
package/src/lib/util/layout.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import type { UISchemaElement } from '@jsonforms/core';
|
|
3
3
|
import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonSchema, OwnPropsOfRenderer } from '@jsonforms/core';
|
|
4
|
-
import Ajv from '
|
|
4
|
+
import Ajv from 'ajv';
|
|
5
5
|
export type Ajv8 = Ajv;
|
|
6
6
|
export declare const renderLayoutElements: (elements: UISchemaElement[], schema?: JsonSchema, path?: string, enabled?: boolean, renderers?: JsonFormsRendererRegistryEntry[], cells?: JsonFormsCellRendererRegistryEntry[]) => import("react/jsx-runtime").JSX.Element[];
|
|
7
7
|
export interface LayoutRendererProps extends OwnPropsOfRenderer {
|