@abgov/jsonforms-components 1.48.0 → 1.48.1

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
@@ -5872,8 +5872,9 @@ const stepperReducer = (state, action) => {
5872
5872
  state.isValid = errors.length === 0;
5873
5873
  return Object.assign({}, state);
5874
5874
  }
5875
+ default:
5876
+ return state;
5875
5877
  }
5876
- return state;
5877
5878
  };
5878
5879
 
5879
5880
  const isErrorPathIncluded = (errorPaths, path) => {
@@ -5944,6 +5945,7 @@ const JsonFormsStepperContextProvider = ({
5944
5945
  const stepperDispatch = (StepperProps === null || StepperProps === void 0 ? void 0 : StepperProps.customDispatch) || dispatch;
5945
5946
  const context = useMemo(() => {
5946
5947
  return {
5948
+ isProvided: true,
5947
5949
  stepperDispatch,
5948
5950
  selectStepperState: () => {
5949
5951
  return stepperState;
@@ -6005,10 +6007,11 @@ const JsonFormsStepperContextProvider = ({
6005
6007
  const summaryLabel = 'Summary';
6006
6008
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6007
6009
  const FormStepper = props => {
6010
+ const formStepperCtx = useContext(JsonFormsStepperContext);
6008
6011
  /**
6009
- * The path check is to prevent the categorization in categorization case. This scenario is not supported in the current version.
6012
+ * StepperCtx can only be provided once to prevent issues from categorization in categorization
6010
6013
  * */
6011
- if (props.path === undefined) {
6014
+ if ((formStepperCtx === null || formStepperCtx === void 0 ? void 0 : formStepperCtx.isProvided) === true) {
6012
6015
  return jsx(FormStepperView, Object.assign({}, props));
6013
6016
  }
6014
6017
  return jsx(JsonFormsStepperContextProvider, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.48.0",
3
+ "version": "1.48.1",
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",
@@ -19,6 +19,7 @@ export interface JsonFormsStepperContextProps {
19
19
  selectPath: () => string;
20
20
  selectCategory: (id: number) => CategoryState;
21
21
  goToPage: (id: number, updateCategoryId?: number) => void;
22
+ isProvided?: boolean;
22
23
  }
23
24
  export declare const isErrorPathIncluded: (errorPaths: string[], path: string) => boolean;
24
25
  export declare const getIncompletePaths: (ajv: Ajv, scopes: string[]) => string[];