@abgov/jsonforms-components 2.71.4 → 2.72.0

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
@@ -8360,7 +8360,7 @@ class ContextProviderClass {
8360
8360
  this.enumValues.set(key, () => data);
8361
8361
  };
8362
8362
  this.setup = props => {
8363
- var _props$isFormSubmitte, _props$autoPopulatedD, _this$selfProps;
8363
+ var _props$isFormSubmitte, _props$showChangeButt, _props$autoPopulatedD, _this$selfProps;
8364
8364
  this.selfProps = props;
8365
8365
  if (props.fileManagement) {
8366
8366
  const {
@@ -8397,6 +8397,7 @@ class ContextProviderClass {
8397
8397
  this.baseEnumerator.formUrl = props.formUrl;
8398
8398
  }
8399
8399
  this.baseEnumerator.isFormSubmitted = (_props$isFormSubmitte = props.isFormSubmitted) != null ? _props$isFormSubmitte : false;
8400
+ this.baseEnumerator.showChangeButtons = (_props$showChangeButt = props.showChangeButtons) != null ? _props$showChangeButt : true;
8400
8401
  this.baseEnumerator.autoPopulatedData = (_props$autoPopulatedD = props.autoPopulatedData) != null ? _props$autoPopulatedD : [];
8401
8402
  this.baseEnumerator.formId = props.formId;
8402
8403
  return jsx(JsonFormContext.Provider, {
@@ -8462,6 +8463,14 @@ const ContextProviderC = new ContextProviderClass();
8462
8463
  const ContextProviderFactory = () => new ContextProviderClass().setup;
8463
8464
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
8464
8465
  const JsonFormContext = /*#__PURE__*/createContext(null);
8466
+ /**
8467
+ * Whether review renderers should show their "Change" buttons. Hosts opt out through the context
8468
+ * provider; anything rendered without a provider keeps the buttons.
8469
+ */
8470
+ const useShowChangeButtons = () => {
8471
+ const enumerators = useContext(JsonFormContext);
8472
+ return (enumerators == null ? void 0 : enumerators.showChangeButtons) !== false;
8473
+ };
8465
8474
 
8466
8475
  const REVIEW_CHANGE_ACTION = 'jsonforms/review/change';
8467
8476
  function reviewReducer(_state, action) {
@@ -11994,6 +12003,7 @@ const GoAInputBaseTableReview = props => {
11994
12003
  } = props;
11995
12004
  const context = useContext(JsonFormsStepperContext);
11996
12005
  const reviewCtx = useReviewContext();
12006
+ const showChangeButtons = useShowChangeButtons();
11997
12007
  const jsonForms = useJsonForms();
11998
12008
  const reviewLabel = typeof ((_uischema$options = uischema.options) == null ? void 0 : _uischema$options.reviewLabel) === 'string' ? uischema.options.reviewLabel : '';
11999
12009
  const propLabel = typeof label === 'string' ? label : '';
@@ -12178,7 +12188,7 @@ const GoAInputBaseTableReview = props => {
12178
12188
  children: [labelToUpdate, required && jsx(RequiredTextLabel, {
12179
12189
  children: " (required)"
12180
12190
  })]
12181
- }), stepId !== undefined && !((_uischema$options6 = uischema.options) != null && (_uischema$options6 = _uischema$options6.componentProps) != null && _uischema$options6.readOnly) && jsx(GoabButton, {
12191
+ }), showChangeButtons && stepId !== undefined && !((_uischema$options6 = uischema.options) != null && (_uischema$options6 = _uischema$options6.componentProps) != null && _uischema$options6.readOnly) && jsx(GoabButton, {
12182
12192
  type: "text",
12183
12193
  size: "compact",
12184
12194
  onClick: handleChangeClick,
@@ -12707,6 +12717,7 @@ const FullNameTester = rankWith(4, isFullName);
12707
12717
  const FullNameControlReview = props => {
12708
12718
  var _props$uischema, _props$schema$require, _props$schema;
12709
12719
  const context = useContext(JsonFormsStepperContext);
12720
+ const showChangeButtons = useShowChangeButtons();
12710
12721
  const stepId = (_props$uischema = props.uischema) == null || (_props$uischema = _props$uischema.options) == null ? void 0 : _props$uischema.stepId;
12711
12722
  const {
12712
12723
  uischema,
@@ -12725,7 +12736,7 @@ const FullNameControlReview = props => {
12725
12736
  children: [fieldLabel, requiredFields.includes(fieldName) && jsx(RequiredTextLabel, {
12726
12737
  children: " (required)"
12727
12738
  })]
12728
- }), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
12739
+ }), showChangeButtons && stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
12729
12740
  type: "text",
12730
12741
  onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
12731
12742
  testId: `${fieldName}-change-btn`,
@@ -12760,6 +12771,7 @@ const FullNameDobReviewControl = props => {
12760
12771
  uischema
12761
12772
  } = props;
12762
12773
  const context = useContext(JsonFormsStepperContext);
12774
+ const showChangeButtons = useShowChangeButtons();
12763
12775
  const stepId = uischema == null || (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.stepId;
12764
12776
  const requiredFields = (_props$schema$require = (_props$schema = props.schema) == null ? void 0 : _props$schema.required) != null ? _props$schema$require : [];
12765
12777
  const isMissing = value => isNilOrEmptyString(value);
@@ -12773,7 +12785,7 @@ const FullNameDobReviewControl = props => {
12773
12785
  children: [fieldLabel, requiredFields.includes(fieldName) && jsx(RequiredTextLabel, {
12774
12786
  children: " (required)"
12775
12787
  })]
12776
- }), stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
12788
+ }), showChangeButtons && stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
12777
12789
  type: "text",
12778
12790
  size: "compact",
12779
12791
  onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
@@ -13146,6 +13158,7 @@ const ContractInfoControl = props => {
13146
13158
  const ContractInfoControlReview = props => {
13147
13159
  var _props$uischema, _schema$required, _options$enableEmail, _options$enablePhone, _options$emailFirst;
13148
13160
  const context = useContext(JsonFormsStepperContext);
13161
+ const showChangeButtons = useShowChangeButtons();
13149
13162
  const stepId = (_props$uischema = props.uischema) == null || (_props$uischema = _props$uischema.options) == null ? void 0 : _props$uischema.stepId;
13150
13163
  const {
13151
13164
  uischema,
@@ -13163,7 +13176,7 @@ const ContractInfoControlReview = props => {
13163
13176
  children: [jsxs(ReviewHeader, {
13164
13177
  children: [jsx(ReviewLabel, {
13165
13178
  children: fieldLabel
13166
- }), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
13179
+ }), showChangeButtons && stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
13167
13180
  type: "text",
13168
13181
  size: "compact",
13169
13182
  onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
@@ -13794,6 +13807,7 @@ const ObjectArrayControl = props => {
13794
13807
  const [rowData, setRowData] = useState(0);
13795
13808
  const [maxItemsError, setMaxItemsError] = useState('');
13796
13809
  const context = useContext(JsonFormsStepperContext);
13810
+ const showChangeButtons = useShowChangeButtons();
13797
13811
  const {
13798
13812
  label,
13799
13813
  path,
@@ -13974,7 +13988,7 @@ const ObjectArrayControl = props => {
13974
13988
  },
13975
13989
  children: maxItemsError
13976
13990
  })]
13977
- }), ((_uischema$options6 = uischema.options) == null ? void 0 : _uischema$options6.stepId) !== undefined && !((_uischema$options7 = uischema.options) != null && (_uischema$options7 = _uischema$options7.componentProps) != null && _uischema$options7.readOnly) && jsx(GoabButton, {
13991
+ }), showChangeButtons && ((_uischema$options6 = uischema.options) == null ? void 0 : _uischema$options6.stepId) !== undefined && !((_uischema$options7 = uischema.options) != null && (_uischema$options7 = _uischema$options7.componentProps) != null && _uischema$options7.readOnly) && jsx(GoabButton, {
13978
13992
  type: "text",
13979
13993
  size: "compact",
13980
13994
  onClick: () => {
@@ -14498,6 +14512,7 @@ const AddressLoopUpControlTableReview = props => {
14498
14512
  const jsonForms = useJsonForms();
14499
14513
  const stepId = (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.stepId;
14500
14514
  const formStepperCtx = useContext(JsonFormsStepperContext);
14515
+ const showChangeButtons = useShowChangeButtons();
14501
14516
  const isAlbertaAddress = (schema == null || (_schema$properties2 = schema.properties) == null || (_schema$properties2 = _schema$properties2.subdivisionCode) == null ? void 0 : _schema$properties2.const) === 'AB';
14502
14517
  const provinces = [{
14503
14518
  value: 'AB',
@@ -14606,7 +14621,7 @@ const AddressLoopUpControlTableReview = props => {
14606
14621
  children: [label, required && jsx(RequiredTextLabel, {
14607
14622
  children: " (required)"
14608
14623
  })]
14609
- }), showButton && stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
14624
+ }), showButton && showChangeButtons && stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
14610
14625
  type: "text",
14611
14626
  size: "compact",
14612
14627
  onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
@@ -14632,7 +14647,7 @@ const AddressLoopUpControlTableReview = props => {
14632
14647
  children: jsxs(ReviewHeader, {
14633
14648
  children: [jsx(ReviewLabel, {
14634
14649
  children: `${isAlbertaAddress ? 'Alberta' : 'Canada'} postal address`
14635
- }), stepId !== undefined && !((_uischema$options3 = uischema.options) != null && (_uischema$options3 = _uischema$options3.componentProps) != null && _uischema$options3.readOnly) && jsx(GoabButton, {
14650
+ }), showChangeButtons && stepId !== undefined && !((_uischema$options3 = uischema.options) != null && (_uischema$options3 = _uischema$options3.componentProps) != null && _uischema$options3.readOnly) && jsx(GoabButton, {
14636
14651
  type: "text",
14637
14652
  size: "compact",
14638
14653
  onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
@@ -20375,4 +20390,4 @@ const GoARenderers = [...GoABaseRenderers, {
20375
20390
  }];
20376
20391
  const GoACells = [...InputCells];
20377
20392
 
20378
- export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AUTO_POPULATE_SOURCES, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContactInformationTester, ContextProviderC, ContextProviderClass, ContextProviderFactory, ContractInfoControl, ContractInfoControlReview, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoAContractInfoControlReview, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, OPTION_DEFINITIONS, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, REVIEW_CHANGE_ACTION, RadioGroup, ReviewRenderContext, ReviewRenderProvider, USER_FIELD_DEFINITIONS, autoPopulatePropertiesMonaco, autoPopulateValue, categoriesAreValid, createAutoPopulateMiddleware, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getAutoPopulateControls, getAutoPopulatedData, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isContactInformation, isFullName, isFullNameDoB, isPhoneNumberWithType, mergeAutoPopulatedData, predictiveOptionsMonaco, registerReducer, resolveRefs, toDateTimeLocalInputValue, tryResolveRefs, useRegisterUser, useReviewContext };
20393
+ export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AUTO_POPULATE_SOURCES, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContactInformationTester, ContextProviderC, ContextProviderClass, ContextProviderFactory, ContractInfoControl, ContractInfoControlReview, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoAContractInfoControlReview, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, OPTION_DEFINITIONS, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, REVIEW_CHANGE_ACTION, RadioGroup, ReviewRenderContext, ReviewRenderProvider, USER_FIELD_DEFINITIONS, autoPopulatePropertiesMonaco, autoPopulateValue, categoriesAreValid, createAutoPopulateMiddleware, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getAutoPopulateControls, getAutoPopulatedData, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isContactInformation, isFullName, isFullNameDoB, isPhoneNumberWithType, mergeAutoPopulatedData, predictiveOptionsMonaco, registerReducer, resolveRefs, toDateTimeLocalInputValue, tryResolveRefs, useRegisterUser, useReviewContext, useShowChangeButtons };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.71.4",
3
+ "version": "2.72.0",
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
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-08-18T17:30:18.093Z",
4
- "sourceCommit": "db27b317c4ff5e3030a93ef732dd649d0a9a7efa",
3
+ "generatedAt": "2026-08-21T19:44:51.722Z",
4
+ "sourceCommit": "1c39a20a72c3d50d067165674de8ae0ded1c7b47",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { RankedTester } from '@jsonforms/core';
3
3
  import { ControlProps, ControlElement } from '@jsonforms/core';
4
- import './HelpContent';
4
+ import './HelpContent.css';
5
5
  interface OptionProps {
6
6
  ariaLabel?: string;
7
7
  help?: string | string[];
@@ -13,6 +13,7 @@ export interface enumerators {
13
13
  getAllFormContextData: () => AllData;
14
14
  isFormSubmitted: boolean;
15
15
  formUrl: string;
16
+ showChangeButtons: boolean;
16
17
  }
17
18
  interface FileManagement {
18
19
  fileList?: any;
@@ -33,6 +34,7 @@ type Props = {
33
34
  fileManagement?: FileManagement;
34
35
  submit?: SubmitManagement;
35
36
  isFormSubmitted?: boolean;
37
+ showChangeButtons?: boolean;
36
38
  data?: any;
37
39
  formUrl?: string | null | undefined;
38
40
  autoPopulatedData?: AutoPopulatedValue[];
@@ -53,6 +55,7 @@ export declare class ContextProviderClass {
53
55
  getFormContextData: (key: string) => Record<string, any> | undefined;
54
56
  getAllFormContextData: () => AllData;
55
57
  isFormSubmitted?: boolean;
58
+ showChangeButtons?: boolean;
56
59
  formUrl: string | null | undefined;
57
60
  autoPopulatedData?: AutoPopulatedValue[];
58
61
  formId?: string;
@@ -78,4 +81,9 @@ export declare class ContextProviderClass {
78
81
  export declare const ContextProviderC: ContextProviderClass;
79
82
  export declare const ContextProviderFactory: () => (props: Props) => import("react/jsx-runtime").JSX.Element | null;
80
83
  export declare const JsonFormContext: React.Context<any>;
84
+ /**
85
+ * Whether review renderers should show their "Change" buttons. Hosts opt out through the context
86
+ * provider; anything rendered without a provider keeps the buttons.
87
+ */
88
+ export declare const useShowChangeButtons: () => boolean;
81
89
  export {};