@abgov/jsonforms-components 2.6.6 → 2.6.7

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
@@ -6227,7 +6227,6 @@ const GoADateTimeInput = props => {
6227
6227
  uischema,
6228
6228
  isVisited,
6229
6229
  errors,
6230
- schema,
6231
6230
  label,
6232
6231
  setIsVisited
6233
6232
  } = props;
@@ -6344,7 +6343,6 @@ const EnumSelect = props => {
6344
6343
  path,
6345
6344
  handleChange,
6346
6345
  options,
6347
- config,
6348
6346
  label,
6349
6347
  uischema,
6350
6348
  required,
@@ -6418,7 +6416,6 @@ const RadioGroup = props => {
6418
6416
  var _a;
6419
6417
  const {
6420
6418
  data,
6421
- className,
6422
6419
  id,
6423
6420
  enabled,
6424
6421
  schema,
@@ -6428,7 +6425,6 @@ const RadioGroup = props => {
6428
6425
  options,
6429
6426
  config,
6430
6427
  label,
6431
- t,
6432
6428
  isVisited,
6433
6429
  errors
6434
6430
  } = props;
@@ -6513,7 +6509,6 @@ const GoABooleanControl = withJsonFormsControlProps(BooleanControl);
6513
6509
 
6514
6510
  const BooleanRadioComponent = ({
6515
6511
  data,
6516
- visible,
6517
6512
  enabled,
6518
6513
  uischema,
6519
6514
  handleChange,
@@ -6532,34 +6527,31 @@ const BooleanRadioComponent = ({
6532
6527
  const TrueDescription = description || (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.descriptionForTrue);
6533
6528
  const FalseDescription = description || (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.descriptionForFalse);
6534
6529
  const BaseTestId = (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${path}-boolean-radio-jsonform`;
6535
- return jsx(Visible, {
6536
- visible: visible,
6537
- children: jsxs(GoARadioGroup, Object.assign({
6538
- error: isVisited && errors.length,
6539
- name: `${label}`,
6540
- value: data === true ? TrueValue : data === false ? FalseValue : null,
6541
- disabled: !enabled,
6542
- testId: BaseTestId,
6543
- onChange: (_name, value) => {
6544
- if (value === TrueValue) {
6545
- handleChange(path, true);
6546
- }
6547
- if (value === FalseValue) {
6548
- handleChange(path, false);
6549
- }
6530
+ return jsxs(GoARadioGroup, Object.assign({
6531
+ error: isVisited && errors.length,
6532
+ name: `${label}`,
6533
+ value: data === true ? TrueValue : data === false ? FalseValue : null,
6534
+ disabled: !enabled,
6535
+ testId: BaseTestId,
6536
+ onChange: (_name, value) => {
6537
+ if (value === TrueValue) {
6538
+ handleChange(path, true);
6550
6539
  }
6551
- }, (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps, {
6552
- children: [jsx(GoARadioItem, {
6553
- value: TrueValue,
6554
- testId: `${BaseTestId}-yes-option`,
6555
- description: EnableDescription ? TrueDescription : null
6556
- }), jsx(GoARadioItem, {
6557
- value: FalseValue,
6558
- testId: `${BaseTestId}-no-option`,
6559
- description: EnableDescription ? FalseDescription : null
6560
- })]
6561
- }))
6562
- });
6540
+ if (value === FalseValue) {
6541
+ handleChange(path, false);
6542
+ }
6543
+ }
6544
+ }, (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps, {
6545
+ children: [jsx(GoARadioItem, {
6546
+ value: TrueValue,
6547
+ testId: `${BaseTestId}-yes-option`,
6548
+ description: EnableDescription ? TrueDescription : null
6549
+ }), jsx(GoARadioItem, {
6550
+ value: FalseValue,
6551
+ testId: `${BaseTestId}-no-option`,
6552
+ description: EnableDescription ? FalseDescription : null
6553
+ })]
6554
+ }));
6563
6555
  };
6564
6556
  const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({}, props, {
6565
6557
  input: BooleanRadioComponent
@@ -6602,8 +6594,7 @@ const CheckboxGroup = props => {
6602
6594
  handleChange,
6603
6595
  options,
6604
6596
  config,
6605
- label,
6606
- t
6597
+ label
6607
6598
  } = props;
6608
6599
  const newSchema = schema;
6609
6600
  const enumData = (schema === null || schema === void 0 ? void 0 : schema.enum) || ((_a = newSchema === null || newSchema === void 0 ? void 0 : newSchema.items) === null || _a === void 0 ? void 0 : _a.enum) || [];
@@ -10802,7 +10793,7 @@ const AddressLookUpControl = props => {
10802
10793
  enabled,
10803
10794
  handleChange,
10804
10795
  uischema,
10805
- rootSchema
10796
+ visible
10806
10797
  } = props;
10807
10798
  const isAlbertaAddress = ((_b = (_a = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _a === void 0 ? void 0 : _a.subdivisionCode) === null || _b === void 0 ? void 0 : _b.const) === 'AB';
10808
10799
  const formCtx = useContext(JsonFormContext);
@@ -10935,7 +10926,8 @@ const AddressLookUpControl = props => {
10935
10926
  }
10936
10927
  }, [activeIndex]);
10937
10928
  const readOnly = (_f = (_e = (_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.componentProps) === null || _e === void 0 ? void 0 : _e.readOnly) !== null && _f !== void 0 ? _f : false;
10938
- return jsxs("div", {
10929
+ return jsxs(Visible, {
10930
+ visible: visible,
10939
10931
  children: [renderHelp(), jsx("h3", {
10940
10932
  children: label
10941
10933
  }), jsx(GoAFormItem, {
@@ -11337,7 +11329,8 @@ const FullNameControl = props => {
11337
11329
  path,
11338
11330
  schema,
11339
11331
  handleChange,
11340
- enabled
11332
+ enabled,
11333
+ visible
11341
11334
  } = props;
11342
11335
  const requiredFields = schema.required;
11343
11336
  const defaultName = {};
@@ -11353,14 +11346,17 @@ const FullNameControl = props => {
11353
11346
  setNameData(updatedName);
11354
11347
  updateFormData(updatedName);
11355
11348
  };
11356
- return jsx(NameInputs, {
11357
- firstName: nameData.firstName,
11358
- middleName: nameData.middleName,
11359
- lastName: nameData.lastName,
11360
- handleInputChange: handleInputChange,
11361
- data: data,
11362
- disabled: !enabled,
11363
- requiredFields: requiredFields
11349
+ return jsx(Visible, {
11350
+ visible: visible,
11351
+ children: jsx(NameInputs, {
11352
+ firstName: nameData.firstName,
11353
+ middleName: nameData.middleName,
11354
+ lastName: nameData.lastName,
11355
+ handleInputChange: handleInputChange,
11356
+ data: data,
11357
+ disabled: !enabled,
11358
+ requiredFields: requiredFields
11359
+ })
11364
11360
  });
11365
11361
  };
11366
11362
 
@@ -11444,7 +11440,8 @@ const FullNameDobControl = props => {
11444
11440
  path,
11445
11441
  schema,
11446
11442
  handleChange,
11447
- enabled
11443
+ enabled,
11444
+ visible
11448
11445
  } = props;
11449
11446
  const requiredFields = schema.required;
11450
11447
  const [errors, setErrors] = useState({});
@@ -11483,7 +11480,8 @@ const FullNameDobControl = props => {
11483
11480
  setErrors(err);
11484
11481
  };
11485
11482
  useSyncAutofillFields(['firstName', 'middleName', 'lastName', 'dateOfBirth'], formData, updateFormData, handleRequiredFieldBlur);
11486
- return jsxs(Fragment, {
11483
+ return jsxs(Visible, {
11484
+ visible: visible,
11487
11485
  children: [jsxs(GoAGrid, {
11488
11486
  minChildWidth: "0ch",
11489
11487
  gap: "s",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
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,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { RankedTester, ControlProps } from '@jsonforms/core';
3
3
  import { WithInputProps } from './type';
4
- export declare const BooleanRadioComponent: ({ data, visible, enabled, uischema, handleChange, path, config, label, isVisited, errors, description, }: ControlProps & WithInputProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const BooleanRadioComponent: ({ data, enabled, uischema, handleChange, path, config, label, isVisited, errors, description, }: ControlProps & WithInputProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const BooleanRadioControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export declare const GoABooleanRadioControlTester: RankedTester;
7
7
  export declare const GoABooleanRadioControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;