@abgov/jsonforms-components 1.58.0 → 1.58.2

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
@@ -5197,9 +5197,6 @@ const CheckboxGroup = props => {
5197
5197
  const newSchema = schema;
5198
5198
  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) || [];
5199
5199
  const appliedUiSchemaOptions = merge({}, config, props.uischema.options, options);
5200
- useEffect(() => {
5201
- handleChange(path, data || []);
5202
- }, []);
5203
5200
  return jsx(Checkboxes, {
5204
5201
  orientation: ((_b = uischema.options) === null || _b === void 0 ? void 0 : _b.orientation) ? (_c = uischema.options) === null || _c === void 0 ? void 0 : _c.orientation : 'vertical',
5205
5202
  testId: `${label || id}-jsonforms-checkboxes`,
@@ -5238,7 +5235,8 @@ const warningIcon = errorMessage => {
5238
5235
  type: "warning",
5239
5236
  size: "small",
5240
5237
  theme: "filled",
5241
- mt: "2xs"
5238
+ mt: "2xs",
5239
+ ariaLabel: "warning"
5242
5240
  }), errorMessage]
5243
5241
  });
5244
5242
  };
@@ -8984,10 +8982,17 @@ const AddressLookUpControl = props => {
8984
8982
  const autocompletion = ((_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.autocomplete) !== false;
8985
8983
  const [open, setOpen] = useState(false);
8986
8984
  const label = typeof (uischema === null || uischema === void 0 ? void 0 : uischema.label) === 'string' && uischema.label ? uischema.label : '';
8987
- const defaultAddress = {
8988
- subdivisionCode: isAlbertaAddress ? 'AB' : '',
8989
- country: 'CA'
8990
- };
8985
+ let defaultAddress = {};
8986
+ if (isAlbertaAddress) {
8987
+ defaultAddress = {
8988
+ country: 'CA',
8989
+ subdivisionCode: 'AB'
8990
+ };
8991
+ } else {
8992
+ defaultAddress = {
8993
+ country: 'CA'
8994
+ };
8995
+ }
8991
8996
  const [address, setAddress] = useState(data || defaultAddress);
8992
8997
  const [searchTerm, setSearchTerm] = useState('');
8993
8998
  const [saveSearchTerm, setSaveSearchTerm] = useState(false);
@@ -9189,7 +9194,8 @@ const AddressLookUpControl = props => {
9189
9194
 
9190
9195
  const AddressViews = ({
9191
9196
  data,
9192
- isAlbertaAddress
9197
+ isAlbertaAddress,
9198
+ withoutHeader
9193
9199
  }) => {
9194
9200
  var _a;
9195
9201
  const provinces = [{
@@ -9233,7 +9239,7 @@ const AddressViews = ({
9233
9239
  label: 'Yukon'
9234
9240
  }];
9235
9241
  return jsxs(Fragment, {
9236
- children: [jsx(GoAGrid, {
9242
+ children: [withoutHeader !== true && jsx(GoAGrid, {
9237
9243
  minChildWidth: "0",
9238
9244
  gap: "s",
9239
9245
  children: jsx(GoAFormItem, {
@@ -9308,6 +9314,48 @@ const AddressLookUpControlReview = props => {
9308
9314
  isAlbertaAddress: isAlbertaAddress
9309
9315
  });
9310
9316
  };
9317
+ const AddressLoopUpControlTableReview = props => {
9318
+ var _a, _b, _c;
9319
+ const {
9320
+ data,
9321
+ schema,
9322
+ uischema
9323
+ } = props;
9324
+ const categoryIndex = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.categoryIndex;
9325
+ const formStepperCtx = useContext(JsonFormsStepperContext);
9326
+ const isAlbertaAddress = ((_c = (_b = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _b === void 0 ? void 0 : _b.subdivisionCode) === null || _c === void 0 ? void 0 : _c.const) === 'AB';
9327
+ return jsxs(Fragment, {
9328
+ children: [jsxs("tr", {
9329
+ "data-testid": "address-lookup-table-review",
9330
+ children: [jsx(PageReviewNameCol, {
9331
+ children: jsx("strong", {
9332
+ children: `${isAlbertaAddress ? 'Alberta' : 'Canada'} postal address`
9333
+ })
9334
+ }), jsx(PageReviewValueCol, {}), jsx(PageReviewActionCol, {
9335
+ children: jsx(GoAButton, {
9336
+ type: "tertiary",
9337
+ testId: `page-review-change-address-btn`,
9338
+ onClick: () => {
9339
+ if (formStepperCtx) {
9340
+ formStepperCtx.toggleShowReviewLink(categoryIndex);
9341
+ formStepperCtx.goToPage(categoryIndex);
9342
+ }
9343
+ },
9344
+ children: "Change"
9345
+ })
9346
+ })]
9347
+ }), jsx("tr", {
9348
+ children: jsx("td", {
9349
+ colSpan: 3,
9350
+ children: jsx(AddressViews, {
9351
+ data: data,
9352
+ isAlbertaAddress: isAlbertaAddress,
9353
+ withoutHeader: true
9354
+ })
9355
+ })
9356
+ })]
9357
+ });
9358
+ };
9311
9359
 
9312
9360
  const isPropertiesMatch = (obj, props, isExactMatch) => {
9313
9361
  if (isObject$f(obj)) {
@@ -11204,6 +11252,12 @@ const GoABaseTableReviewRenderers = [
11204
11252
  }, {
11205
11253
  tester: GoAListWithDetailsTester,
11206
11254
  renderer: GoAInputBaseTableReviewControl
11255
+ }, {
11256
+ tester: FullNameDobTester,
11257
+ renderer: GoAInputBaseTableReviewControl
11258
+ }, {
11259
+ tester: AddressLookUpTester,
11260
+ renderer: withJsonFormsControlProps(AddressLoopUpControlTableReview)
11207
11261
  }, {
11208
11262
  tester: GoAHorizontalLayoutTester,
11209
11263
  renderer: GoAInputBaseTableReviewControl
@@ -11257,4 +11311,4 @@ const GoARenderers = [...GoABaseRenderers, {
11257
11311
  }];
11258
11312
  const GoACells = [...InputCells];
11259
11313
 
11260
- export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputInteger, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoInputBaseReviewControl, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, RadioGroup, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, formatSin, isAddressLookup, isFullName, isFullNameDoB, registerReducer, resolveRefs, tryResolveRefs };
11314
+ export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputInteger, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoInputBaseReviewControl, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, RadioGroup, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, formatSin, isAddressLookup, isFullName, isFullNameDoB, registerReducer, resolveRefs, tryResolveRefs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.58.0",
3
+ "version": "1.58.2",
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,4 +1,5 @@
1
1
  import { ControlProps } from '@jsonforms/core';
2
2
  type AddressViewProps = ControlProps;
3
3
  export declare const AddressLookUpControlReview: (props: AddressViewProps) => JSX.Element;
4
+ export declare const AddressLoopUpControlTableReview: (props: AddressViewProps) => JSX.Element;
4
5
  export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface AddressInputsProps {
3
3
  data: Record<string, string>;
4
4
  isAlbertaAddress?: boolean;
5
+ withoutHeader?: boolean;
5
6
  }
6
7
  export declare const AddressViews: React.FC<AddressInputsProps>;
7
8
  export {};