@abgov/jsonforms-components 1.19.3 → 1.20.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
@@ -3662,10 +3662,14 @@ const EnumSelect = props => {
3662
3662
  const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
3663
3663
  const mergedOptions = useMemo(() => {
3664
3664
  return [...(options || []), ...registerData.map(d => {
3665
- return {
3666
- value: d,
3667
- label: d
3668
- };
3665
+ if (typeof d === 'string') {
3666
+ return {
3667
+ value: d,
3668
+ label: d
3669
+ };
3670
+ } else {
3671
+ return Object.assign({}, d);
3672
+ }
3669
3673
  })];
3670
3674
  }, [registerData, options]);
3671
3675
  useEffect(() => {
@@ -5031,26 +5035,23 @@ const FormStepper = props => {
5031
5035
  })
5032
5036
  })]
5033
5037
  })]
5034
- }), jsx(GoAModal, {
5038
+ }), jsxs(GoAModal, {
5035
5039
  testId: "submit-confirmation",
5036
5040
  open: isOpen,
5037
5041
  heading: 'Form Submitted',
5038
5042
  width: "640px",
5039
- actions: jsxs(GoAButtonGroup, {
5043
+ actions: jsx(GoAButtonGroup, {
5040
5044
  alignment: "end",
5041
- children: [jsx(GoAButton, {
5045
+ children: jsx(GoAButton, {
5042
5046
  type: "primary",
5043
5047
  testId: "close-submit-modal",
5044
5048
  onClick: onCloseModal,
5045
5049
  children: "Close"
5046
- }), !showNextBtn && jsx(GoAButton, {
5047
- type: "primary",
5048
- onClick: handleSubmit,
5049
- disabled: !isFormValid || !enabled,
5050
- testId: "submit-form",
5051
- children: "Submit"
5052
- })]
5053
- })
5050
+ })
5051
+ }),
5052
+ children: [jsx("b", {
5053
+ children: "Submit is a test for preview purposes "
5054
+ }), "(i.e. no actual form is being submitted)"]
5054
5055
  })]
5055
5056
  })
5056
5057
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.19.3",
3
+ "version": "1.20.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",
@@ -9,8 +9,13 @@ export interface RegisterConfig {
9
9
  responsePrefixPath?: string;
10
10
  objectPathInArray?: string;
11
11
  }
12
+ export interface LabelValueRegisterData {
13
+ key: string;
14
+ value: string;
15
+ }
16
+ export type RegisterDataType = string[] | LabelValueRegisterData[];
12
17
  export interface RegisterConfigData extends RegisterConfig {
13
- data?: string[];
18
+ data?: RegisterDataType;
14
19
  }
15
20
  export type RegisterData = RegisterConfigData[];
16
21
  type AddDataAction = {
@@ -1,9 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- import { RegisterConfig, RegisterData, JsonFormRegisterDispatch } from './actions';
2
+ import { RegisterConfig, RegisterData, JsonFormRegisterDispatch, RegisterDataType } from './actions';
3
3
  interface JsonFormsRegisterContextProps {
4
4
  registerDispatch: JsonFormRegisterDispatch;
5
5
  fetchRegisterByUrl: (registerConfig: RegisterConfig) => Promise<void>;
6
- selectRegisterData: (registerConfig: RegisterConfig) => string[];
6
+ selectRegisterData: (registerConfig: RegisterConfig) => RegisterDataType;
7
7
  isProvided: boolean;
8
8
  }
9
9
  export declare const JsonFormsRegisterContext: import("react").Context<JsonFormsRegisterContextProps | undefined>;