@abgov/jsonforms-components 1.16.9 → 1.16.10

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
@@ -4369,42 +4369,7 @@ const getAllRequiredFields = schema => {
4369
4369
  return requiredFields;
4370
4370
  };
4371
4371
 
4372
- // TODO: Remove from `core-js@4` since it's moved to entry points
4373
-
4374
- var $ = _export;
4375
4372
  var call$1 = functionCall;
4376
- var isCallable = isCallable$l;
4377
- var anObject$1 = anObject$9;
4378
- var toString = toString$9;
4379
-
4380
- var DELEGATES_TO_EXEC = function () {
4381
- var execCalled = false;
4382
- var re = /[ac]/;
4383
- re.exec = function () {
4384
- execCalled = true;
4385
- return /./.exec.apply(this, arguments);
4386
- };
4387
- return re.test('abc') === true && execCalled;
4388
- }();
4389
-
4390
- var nativeTest = /./.test;
4391
-
4392
- // `RegExp.prototype.test` method
4393
- // https://tc39.es/ecma262/#sec-regexp.prototype.test
4394
- $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
4395
- test: function (S) {
4396
- var R = anObject$1(this);
4397
- var string = toString(S);
4398
- var exec = R.exec;
4399
- if (!isCallable(exec)) return call$1(nativeTest, R, string);
4400
- var result = call$1(exec, R, string);
4401
- if (result === null) return false;
4402
- anObject$1(result);
4403
- return true;
4404
- }
4405
- });
4406
-
4407
- var call = functionCall;
4408
4373
  var hasOwn = hasOwnProperty_1;
4409
4374
  var isPrototypeOf = objectIsPrototypeOf;
4410
4375
  var regExpFlags = regexpFlags$1;
@@ -4414,12 +4379,12 @@ var RegExpPrototype$1 = RegExp.prototype;
4414
4379
  var regexpGetFlags = function (R) {
4415
4380
  var flags = R.flags;
4416
4381
  return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
4417
- ? call(regExpFlags, R) : flags;
4382
+ ? call$1(regExpFlags, R) : flags;
4418
4383
  };
4419
4384
 
4420
4385
  var PROPER_FUNCTION_NAME = functionName.PROPER;
4421
4386
  var defineBuiltIn = defineBuiltIn$5;
4422
- var anObject = anObject$9;
4387
+ var anObject$1 = anObject$9;
4423
4388
  var $toString = toString$9;
4424
4389
  var fails = fails$m;
4425
4390
  var getRegExpFlags = regexpGetFlags;
@@ -4436,13 +4401,48 @@ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
4436
4401
  // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
4437
4402
  if (NOT_GENERIC || INCORRECT_NAME) {
4438
4403
  defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
4439
- var R = anObject(this);
4404
+ var R = anObject$1(this);
4440
4405
  var pattern = $toString(R.source);
4441
4406
  var flags = $toString(getRegExpFlags(R));
4442
4407
  return '/' + pattern + '/' + flags;
4443
4408
  }, { unsafe: true });
4444
4409
  }
4445
4410
 
4411
+ // TODO: Remove from `core-js@4` since it's moved to entry points
4412
+
4413
+ var $ = _export;
4414
+ var call = functionCall;
4415
+ var isCallable = isCallable$l;
4416
+ var anObject = anObject$9;
4417
+ var toString = toString$9;
4418
+
4419
+ var DELEGATES_TO_EXEC = function () {
4420
+ var execCalled = false;
4421
+ var re = /[ac]/;
4422
+ re.exec = function () {
4423
+ execCalled = true;
4424
+ return /./.exec.apply(this, arguments);
4425
+ };
4426
+ return re.test('abc') === true && execCalled;
4427
+ }();
4428
+
4429
+ var nativeTest = /./.test;
4430
+
4431
+ // `RegExp.prototype.test` method
4432
+ // https://tc39.es/ecma262/#sec-regexp.prototype.test
4433
+ $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
4434
+ test: function (S) {
4435
+ var R = anObject(this);
4436
+ var string = toString(S);
4437
+ var exec = R.exec;
4438
+ if (!isCallable(exec)) return call(nativeTest, R, string);
4439
+ var result = call(exec, R, string);
4440
+ if (result === null) return false;
4441
+ anObject(result);
4442
+ return true;
4443
+ }
4444
+ });
4445
+
4446
4446
  const resolveLabelFromScope = scope => {
4447
4447
  // eslint-disable-next-line no-useless-escape
4448
4448
  const validPatternRegex = /^#(\/properties\/[^\/]+)+$/;
@@ -4471,7 +4471,8 @@ const getFormFieldValue = (scope, data) => {
4471
4471
  return '';
4472
4472
  }
4473
4473
  };
4474
- const RenderFormFields = ({
4474
+
4475
+ const RenderFormReviewFields = ({
4475
4476
  elements,
4476
4477
  data,
4477
4478
  requiredFields
@@ -4481,7 +4482,7 @@ const RenderFormFields = ({
4481
4482
  const downloadTriggerFunction = (_a = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _a === void 0 ? void 0 : _a.get('download-file');
4482
4483
  const downloadTrigger = downloadTriggerFunction && downloadTriggerFunction();
4483
4484
  const fileListValue = (_b = enumerators === null || enumerators === void 0 ? void 0 : enumerators.data) === null || _b === void 0 ? void 0 : _b.get('file-list');
4484
- // eslint-disable-next-line
4485
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4485
4486
  const fileList = fileListValue && fileListValue();
4486
4487
  const downloadFile = (file, propertyId) => {
4487
4488
  if (downloadTrigger) {
@@ -4513,7 +4514,7 @@ const RenderFormFields = ({
4513
4514
  }, index);
4514
4515
  } else if (clonedElement.type !== 'ListWithDetail' && (clonedElement === null || clonedElement === void 0 ? void 0 : clonedElement.elements)) {
4515
4516
  return jsx(React.Fragment, {
4516
- children: jsx(RenderFormFields, {
4517
+ children: jsx(RenderFormReviewFields, {
4517
4518
  elements: clonedElement.elements,
4518
4519
  data: data,
4519
4520
  requiredFields: requiredFields
@@ -4525,18 +4526,18 @@ const RenderFormFields = ({
4525
4526
  children: [jsxs(ListWithDetailHeading, {
4526
4527
  children: [lastSegment, listData.length > 1 && 's']
4527
4528
  }), jsx(Grid, {
4528
- children: listData.map((childData,
4529
- // eslint-disable-line @typescript-eslint/no-explicit-any
4530
- childIndex // eslint-disable-line @typescript-eslint/no-explicit-any
4531
- ) => jsx(React.Fragment, {
4532
- children: jsx(RenderFormFields, {
4533
- elements: clonedElement.elements,
4534
- data: childData,
4535
- requiredFields: requiredFields
4536
- })
4537
- }, `${index}-${childIndex}`))
4529
+ children: listData.map((childData, childIndex) => {
4530
+ var _a, _b;
4531
+ return jsx(React.Fragment, {
4532
+ children: jsx(RenderFormReviewFields, {
4533
+ elements: ((_b = (_a = clonedElement === null || clonedElement === void 0 ? void 0 : clonedElement.options) === null || _a === void 0 ? void 0 : _a.detail) === null || _b === void 0 ? void 0 : _b.elements) || [],
4534
+ data: childData,
4535
+ requiredFields: requiredFields
4536
+ })
4537
+ }, `${index}-${childIndex}`);
4538
+ })
4538
4539
  })]
4539
- });
4540
+ }, `${index}-${lastSegment}`);
4540
4541
  }
4541
4542
  return null;
4542
4543
  });
@@ -4784,7 +4785,7 @@ const FormStepper = props => {
4784
4785
  children: readOnly ? 'View' : 'Edit'
4785
4786
  })]
4786
4787
  }), jsx(Grid, {
4787
- children: jsx(RenderFormFields, {
4788
+ children: jsx(RenderFormReviewFields, {
4788
4789
  elements: category.elements,
4789
4790
  data: data,
4790
4791
  requiredFields: requiredFields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.16.9",
3
+ "version": "1.16.10",
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",
@@ -1,11 +1,2 @@
1
- import { UISchemaElement, Category, Categorization } from '@jsonforms/core';
2
- import React from 'react';
3
- interface RenderFormFieldsProps {
4
- elements: UISchemaElement[] | (Category | Categorization)[];
5
- data: any;
6
- requiredFields: string[];
7
- }
8
1
  export declare const resolveLabelFromScope: (scope: string) => string | null;
9
2
  export declare const getFormFieldValue: (scope: string, data: object) => any;
10
- export declare const RenderFormFields: React.FC<RenderFormFieldsProps>;
11
- export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Categorization, Category, UISchemaElement } from '@jsonforms/core';
3
+ interface RenderFormReviewFieldsProps {
4
+ elements: UISchemaElement[] | (Category | Categorization)[];
5
+ data: any;
6
+ requiredFields: string[];
7
+ }
8
+ export declare const RenderFormReviewFields: React.FC<RenderFormReviewFieldsProps>;
9
+ export {};