@abgov/jsonforms-components 0.0.1 → 1.2.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.
Files changed (123) hide show
  1. package/index.esm.d.ts +1 -0
  2. package/index.esm.js +4831 -0
  3. package/package.json +8 -2
  4. package/src/index.d.ts +5 -0
  5. package/src/lib/Additional/HelpContent.d.ts +21 -0
  6. package/src/lib/Additional/styled-components.d.ts +1 -0
  7. package/src/lib/Cells/DateCell.d.ts +6 -0
  8. package/src/lib/Cells/IntegerCell.d.ts +6 -0
  9. package/src/lib/Cells/NumberCell.d.ts +6 -0
  10. package/src/lib/Cells/TextCell.d.ts +6 -0
  11. package/src/lib/Cells/TimeCell.d.ts +6 -0
  12. package/src/lib/Cells/index.d.ts +2 -0
  13. package/src/lib/Context/index.d.ts +39 -0
  14. package/src/lib/Controls/FileUploader/ContextMenu.d.ts +18 -0
  15. package/src/lib/Controls/FileUploader/FileUploaderControl.d.ts +4 -0
  16. package/src/lib/Controls/FileUploader/FileUploaderTester.d.ts +2 -0
  17. package/src/lib/Controls/FileUploader/styled-components.d.ts +1 -0
  18. package/src/lib/Controls/FormStepper/FormStepperControl.d.ts +14 -0
  19. package/src/lib/Controls/FormStepper/FormStepperTester.d.ts +2 -0
  20. package/src/lib/Controls/FormStepper/styled-components.d.ts +7 -0
  21. package/src/lib/Controls/Inputs/InputBaseControl.d.ts +7 -0
  22. package/src/lib/Controls/Inputs/InputBooleanControl.d.ts +6 -0
  23. package/src/lib/Controls/Inputs/InputBooleanRadioControl.d.ts +6 -0
  24. package/src/lib/Controls/Inputs/InputDateControl.d.ts +9 -0
  25. package/src/lib/Controls/Inputs/InputDateTimeControl.d.ts +9 -0
  26. package/src/lib/Controls/Inputs/InputEnum.d.ts +12 -0
  27. package/src/lib/Controls/Inputs/InputEnumAutoComplete.d.ts +10 -0
  28. package/src/lib/Controls/Inputs/InputEnumRadios.d.ts +12 -0
  29. package/src/lib/Controls/Inputs/InputIntegerControl.d.ts +9 -0
  30. package/src/lib/Controls/Inputs/InputMultiLineTextControl.d.ts +9 -0
  31. package/src/lib/Controls/Inputs/InputNumberControl.d.ts +9 -0
  32. package/src/lib/Controls/Inputs/InputTextControl.d.ts +9 -0
  33. package/src/lib/Controls/Inputs/InputTimeControl.d.ts +9 -0
  34. package/src/lib/Controls/Inputs/{type.ts → type.d.ts} +1 -1
  35. package/src/lib/Controls/ObjectArray/DeleteDialog.d.ts +12 -0
  36. package/src/lib/Controls/ObjectArray/ObjectArray.d.ts +6 -0
  37. package/src/lib/Controls/ObjectArray/ObjectArrayToolBar.d.ts +16 -0
  38. package/src/lib/Controls/ObjectArray/ObjectListControl.d.ts +24 -0
  39. package/src/lib/Controls/ObjectArray/styled-components.d.ts +3 -0
  40. package/src/lib/ErrorHandling/GoAErrorControl.d.ts +15 -0
  41. package/src/lib/ErrorHandling/{MessageControl.tsx → MessageControl.d.ts} +1 -8
  42. package/src/lib/ErrorHandling/errorCheck.d.ts +14 -0
  43. package/src/lib/ErrorHandling/schemaValidation.d.ts +11 -0
  44. package/src/lib/common/Grid.d.ts +11 -0
  45. package/src/lib/jsonforms-components.d.ts +4 -0
  46. package/src/lib/layouts/GroupControl.d.ts +5 -0
  47. package/src/lib/layouts/HorizontalLayoutControl.d.ts +5 -0
  48. package/src/lib/layouts/VerticalLayoutControl.d.ts +4 -0
  49. package/src/lib/util/layout.d.ts +8 -0
  50. package/src/lib/util/schemaUtils.d.ts +1 -0
  51. package/src/lib/util/stringUtils.d.ts +33 -0
  52. package/src/lib/util/style-component.d.ts +1 -0
  53. package/.babelrc +0 -12
  54. package/.eslintrc.json +0 -36
  55. package/.releaserc.json +0 -25
  56. package/jest.config.ts +0 -11
  57. package/project.json +0 -55
  58. package/rollup.config.js +0 -14
  59. package/src/index.ts +0 -166
  60. package/src/lib/Additional/HelpContent.tsx +0 -95
  61. package/src/lib/Additional/styled-components.ts +0 -27
  62. package/src/lib/Cells/DateCell.tsx +0 -10
  63. package/src/lib/Cells/IntegerCell.tsx +0 -10
  64. package/src/lib/Cells/NumberCell.tsx +0 -10
  65. package/src/lib/Cells/TextCell.tsx +0 -10
  66. package/src/lib/Cells/TimeCell.tsx +0 -10
  67. package/src/lib/Cells/index.tsx +0 -14
  68. package/src/lib/Context/index.tsx +0 -172
  69. package/src/lib/Controls/FileUploader/ContextMenu.tsx +0 -50
  70. package/src/lib/Controls/FileUploader/FileUploaderControl.tsx +0 -131
  71. package/src/lib/Controls/FileUploader/FileUploaderTester.tsx +0 -3
  72. package/src/lib/Controls/FileUploader/styled-components.tsx +0 -10
  73. package/src/lib/Controls/FormStepper/FormStepperControl.tsx +0 -269
  74. package/src/lib/Controls/FormStepper/FormStepperTester.tsx +0 -22
  75. package/src/lib/Controls/FormStepper/styled-components.tsx +0 -17
  76. package/src/lib/Controls/Inputs/InputBaseControl.tsx +0 -52
  77. package/src/lib/Controls/Inputs/InputBooleanControl.tsx +0 -67
  78. package/src/lib/Controls/Inputs/InputBooleanRadioControl.tsx +0 -74
  79. package/src/lib/Controls/Inputs/InputDateControl.tsx +0 -90
  80. package/src/lib/Controls/Inputs/InputDateTimeControl.tsx +0 -46
  81. package/src/lib/Controls/Inputs/InputEnum.tsx +0 -74
  82. package/src/lib/Controls/Inputs/InputEnumAutoComplete.tsx +0 -73
  83. package/src/lib/Controls/Inputs/InputEnumRadios.tsx +0 -43
  84. package/src/lib/Controls/Inputs/InputIntegerControl.tsx +0 -63
  85. package/src/lib/Controls/Inputs/InputMultiLineTextControl.tsx +0 -63
  86. package/src/lib/Controls/Inputs/InputNumberControl.tsx +0 -63
  87. package/src/lib/Controls/Inputs/InputTextControl.tsx +0 -62
  88. package/src/lib/Controls/Inputs/InputTimeControl.tsx +0 -46
  89. package/src/lib/Controls/Inputs/inputControl.spec.ts +0 -84
  90. package/src/lib/Controls/ObjectArray/DeleteDialog.tsx +0 -49
  91. package/src/lib/Controls/ObjectArray/ObjectArray.tsx +0 -59
  92. package/src/lib/Controls/ObjectArray/ObjectArrayToolBar.tsx +0 -51
  93. package/src/lib/Controls/ObjectArray/ObjectListControl.tsx +0 -368
  94. package/src/lib/Controls/ObjectArray/styled-components.tsx +0 -13
  95. package/src/lib/ErrorHandling/GoAErrorControl.tsx +0 -53
  96. package/src/lib/ErrorHandling/categorizationValidation.spec.ts +0 -98
  97. package/src/lib/ErrorHandling/controlValildation.spec.ts +0 -57
  98. package/src/lib/ErrorHandling/errorCheck.spec.ts +0 -185
  99. package/src/lib/ErrorHandling/errorCheck.tsx +0 -86
  100. package/src/lib/ErrorHandling/layoutValildation.spec.ts +0 -47
  101. package/src/lib/ErrorHandling/otherValildation.spec.ts +0 -74
  102. package/src/lib/ErrorHandling/schemaValidation.ts +0 -115
  103. package/src/lib/common/Grid.tsx +0 -55
  104. package/src/lib/jsonforms-components.module.scss +0 -7
  105. package/src/lib/jsonforms-components.spec.tsx +0 -10
  106. package/src/lib/jsonforms-components.tsx +0 -14
  107. package/src/lib/layouts/GroupControl.tsx +0 -25
  108. package/src/lib/layouts/HorizontalLayoutControl.tsx +0 -30
  109. package/src/lib/layouts/VerticalLayoutControl.tsx +0 -28
  110. package/src/lib/util/layout.tsx +0 -68
  111. package/src/lib/util/schemaUtils.ts +0 -9
  112. package/src/lib/util/stringUtils.ts +0 -98
  113. package/src/lib/util/style-component.ts +0 -8
  114. package/tsconfig.json +0 -20
  115. package/tsconfig.lib.json +0 -19
  116. package/tsconfig.spec.json +0 -20
  117. /package/src/lib/Additional/{index.ts → index.d.ts} +0 -0
  118. /package/src/lib/Controls/FileUploader/{index.tsx → index.d.ts} +0 -0
  119. /package/src/lib/Controls/FormStepper/{index.tsx → index.d.ts} +0 -0
  120. /package/src/lib/Controls/Inputs/{index.tsx → index.d.ts} +0 -0
  121. /package/src/lib/Controls/ObjectArray/{index.tsx → index.d.ts} +0 -0
  122. /package/src/lib/Controls/{index.tsx → index.d.ts} +0 -0
  123. /package/src/lib/layouts/{index.ts → index.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "0.0.1",
3
+ "version": "1.2.0",
4
+ "license": "Apache-2.0",
5
+ "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
+ "repository": "https://github.com/GovAlta/adsp-monorepo",
4
7
  "peerDependencies": {
5
8
  "@abgov/react-components": "^4.18.1",
6
9
  "@jsonforms/core": "^3.1.0",
@@ -13,5 +16,8 @@
13
16
  "axios": "^1.6.7",
14
17
  "lodash": "^4.17.20",
15
18
  "styled-components": "^5.3.6"
16
- }
19
+ },
20
+ "module": "./index.esm.js",
21
+ "type": "module",
22
+ "main": "./index.esm.js"
17
23
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry } from '@jsonforms/core';
2
+ export * from './lib/Context';
3
+ export declare const GoABaseRenderers: JsonFormsRendererRegistryEntry[];
4
+ export declare const GoARenderers: JsonFormsRendererRegistryEntry[];
5
+ export declare const GoACells: JsonFormsCellRendererRegistryEntry[];
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { RankedTester } from '@jsonforms/core';
3
+ import { ControlProps, ControlElement } from '@jsonforms/core';
4
+ interface OptionProps {
5
+ ariaLabel?: string;
6
+ help?: string | string[];
7
+ variant?: string;
8
+ }
9
+ interface CustomControlElement extends ControlElement {
10
+ options?: OptionProps;
11
+ elements?: CustomControlElement[];
12
+ }
13
+ interface CustomControlProps extends ControlProps {
14
+ uischema: CustomControlElement;
15
+ }
16
+ export declare const HelpContentComponent: ({ isParent, ...props }: CustomControlProps & {
17
+ isParent?: boolean | undefined;
18
+ }) => JSX.Element;
19
+ export declare const HelpContentTester: RankedTester;
20
+ export declare const HelpContent: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare const HelpContentDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CellProps, RankedTester, WithClassname } from '@jsonforms/core';
3
+ export declare const GoADateCell: (props: CellProps & WithClassname) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoADateCellTester: RankedTester;
5
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfCell>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CellProps, RankedTester, WithClassname } from '@jsonforms/core';
3
+ export declare const GoAIntegerCell: (props: CellProps & WithClassname) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoAIntegerCellTester: RankedTester;
5
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfCell>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CellProps, RankedTester, WithClassname } from '@jsonforms/core';
3
+ export declare const GoANumberCell: (props: CellProps & WithClassname) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoANumberCellTester: RankedTester;
5
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfCell>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CellProps, RankedTester, WithClassname } from '@jsonforms/core';
3
+ export declare const GoATextCell: (props: CellProps & WithClassname) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoATextCellTester: RankedTester;
5
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfCell>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CellProps, RankedTester, WithClassname } from '@jsonforms/core';
3
+ export declare const GoATimeCell: (props: CellProps & WithClassname) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoATimeCellTester: RankedTester;
5
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfCell>;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { JsonFormsCellRendererRegistryEntry } from '@jsonforms/core';
2
+ export declare const InputCells: JsonFormsCellRendererRegistryEntry[];
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ export interface AllData {
3
+ [x: string]: any;
4
+ }
5
+ export declare function addDataByUrl(key: string, url: string, processDataFunction: (url: string) => string[], token?: string): void;
6
+ export declare function addDataByOptions(key: string, url: string, location: string[], type: string, values: string[]): void;
7
+ interface FileManagement {
8
+ fileList?: any;
9
+ uploadFile?: (file: File, propertyId: string) => void;
10
+ downloadFile?: (file: File) => void;
11
+ deleteFile?: (file: File) => void;
12
+ }
13
+ type Props = {
14
+ children?: React.ReactNode;
15
+ fileManagement?: FileManagement;
16
+ data?: any;
17
+ };
18
+ export declare const JsonFormContext: React.Context<{
19
+ data: Map<string, () => Record<string, any> | string[]>;
20
+ functions: Map<string, () => (file: File, propertyId: string) => void>;
21
+ }>;
22
+ export declare function ContextProvider(props: Props): JSX.Element | null;
23
+ /**
24
+ * Grabs data stored under a given key
25
+ *
26
+ */
27
+ export declare function getData(key: string): string[] | Record<string, any> | undefined;
28
+ /**
29
+ * Grabs all data
30
+ *
31
+ */
32
+ export declare function getAllData(): AllData;
33
+ /**
34
+ * Allows additional data to be added under a given key
35
+ *
36
+ * This data will then be available inside the context
37
+ */
38
+ export declare function addData(key: string, data: Record<string, unknown> | unknown[]): void;
39
+ export {};
@@ -0,0 +1,18 @@
1
+ import { FC } from 'react';
2
+ import { GoAIconType } from '@abgov/react-components-new';
3
+ interface ContextMenuIconProps {
4
+ type: GoAIconType;
5
+ testId?: string;
6
+ title?: string;
7
+ onClick?: () => void;
8
+ disabled?: boolean;
9
+ }
10
+ interface ContextMenuTextProps {
11
+ type?: GoAIconType;
12
+ testId?: string;
13
+ onClick?: () => void;
14
+ }
15
+ export declare const GoAContextMenuIcon: FC<ContextMenuIconProps>;
16
+ export declare const GoAContextMenuText: FC<ContextMenuTextProps>;
17
+ export declare const GoAContextMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export {};
@@ -0,0 +1,4 @@
1
+ import { WithClassname, ControlProps } from '@jsonforms/core';
2
+ type FileUploaderLayoutRendererProps = ControlProps & WithClassname;
3
+ export declare const FileUploader: ({ data, path, handleChange, uischema, ...props }: FileUploaderLayoutRendererProps) => import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RankedTester } from '@jsonforms/core';
2
+ export declare const FileUploaderTester: RankedTester;
@@ -0,0 +1 @@
1
+ export declare const ReviewItem: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Categorization, UISchemaElement, Category, StatePropsOfLayout } from '@jsonforms/core';
3
+ import { TranslateProps } from '@jsonforms/react';
4
+ import { AjvProps } from '@jsonforms/material-renderers';
5
+ export interface CategorizationStepperLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
6
+ data: any;
7
+ }
8
+ export declare const resolveLabelFromScope: (scope: string) => string | null;
9
+ export declare const getFormFieldValue: (scope: string, data: object) => any;
10
+ export declare const renderFormFields: (elements: UISchemaElement[] | (Category | Categorization)[], data: object) => (import("react/jsx-runtime").JSX.Element | null)[];
11
+ export declare const FormStepper: ({ uischema, data, schema, ajv, path, cells, renderers, config, visible, enabled, t, }: CategorizationStepperLayoutRendererProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const flattenObject: (obj: Record<string, string>) => Record<string, string>;
13
+ export declare const FormStepperControl: (props: CategorizationStepperLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
14
+ export default FormStepper;
@@ -0,0 +1,2 @@
1
+ import { RankedTester } from '@jsonforms/core';
2
+ export declare const CategorizationRendererTester: RankedTester;
@@ -0,0 +1,7 @@
1
+ export declare const ReviewItem: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const ReviewItemSection: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const ReviewItemHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const ReviewItemTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const Anchor: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const ReviewListItem: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const ReviewListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,7 @@
1
+ import { ControlProps } from '@jsonforms/core';
2
+ export type GoAInputType = 'text' | 'password' | 'email' | 'number' | 'date' | 'datetime-local' | 'month' | 'range' | 'search' | 'tel' | 'time' | 'url' | 'week';
3
+ export interface WithInput {
4
+ input: any;
5
+ noLabel?: boolean;
6
+ }
7
+ export declare const GoAInputBaseControl: (props: ControlProps & WithInput) => JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { RankedTester, ControlProps } from '@jsonforms/core';
3
+ export declare const BooleanComponent: ({ data, visible, enabled, uischema, handleChange, path, config, label, required, errors, description, }: ControlProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const BooleanControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const GoABooleanControlTester: RankedTester;
6
+ export declare const GoABooleanControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { RankedTester, ControlProps } from '@jsonforms/core';
3
+ export declare const BooleanRadioComponent: ({ data, visible, enabled, uischema, handleChange, path, config, label, required, errors, description, }: ControlProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const BooleanRadioControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const GoABooleanRadioControlTester: RankedTester;
6
+ export declare const GoABooleanRadioControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ export type GoAInputDateProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const errMalformedDate: (scope: string, type: string) => string;
6
+ export declare const GoADateInput: (props: GoAInputDateProps) => JSX.Element;
7
+ export declare const GoADateControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const GoADateControlTester: RankedTester;
9
+ export declare const GoAInputDateControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputDateTimeProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const GoADateTimeInput: (props: GoAInputDateTimeProps) => JSX.Element;
6
+ export declare const GoADateTimeControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GoADateTimeControlTester: RankedTester;
8
+ export declare const GoAInputDateTimeControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ControlProps, OwnPropsOfEnum, RankedTester } from '@jsonforms/core';
3
+ import { TranslateProps } from '@jsonforms/react';
4
+ import { WithInputProps } from './type';
5
+ import { WithOptionLabel } from '@jsonforms/material-renderers';
6
+ import { EnumCellProps, WithClassname } from '@jsonforms/core';
7
+ type EnumSelectProp = EnumCellProps & WithClassname & TranslateProps & WithInputProps;
8
+ export declare const EnumSelect: (props: EnumSelectProp) => JSX.Element;
9
+ export declare const numControl: (props: ControlProps & OwnPropsOfEnum & WithOptionLabel & TranslateProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const GoAEnumControlTester: RankedTester;
11
+ export declare const GoAEnumControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl & OwnPropsOfEnum>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { OwnPropsOfEnum, RankedTester } from '@jsonforms/core';
3
+ import { TranslateProps } from '@jsonforms/react';
4
+ import { WithInputProps } from './type';
5
+ import { EnumCellProps, WithClassname } from '@jsonforms/core';
6
+ type EnumSelectAutoCompleteProp = EnumCellProps & WithClassname & TranslateProps & WithInputProps;
7
+ export declare const EnumSelectAutoComplete: (props: EnumSelectAutoCompleteProp) => JSX.Element;
8
+ export declare const GoAEnumControlAutoCompleteTester: RankedTester;
9
+ export declare const GoAEnumAutoCompleteControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl & OwnPropsOfEnum>;
10
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ControlProps, OwnPropsOfEnum, RankedTester } from '@jsonforms/core';
3
+ import { TranslateProps } from '@jsonforms/react';
4
+ import { WithInputProps } from './type';
5
+ import { WithOptionLabel } from '@jsonforms/material-renderers';
6
+ import { EnumCellProps, WithClassname } from '@jsonforms/core';
7
+ type RadioGroupProp = EnumCellProps & WithClassname & TranslateProps & WithInputProps;
8
+ export declare const RadioGroup: (props: RadioGroupProp) => JSX.Element;
9
+ export declare const EnumRadioControl: (props: ControlProps & OwnPropsOfEnum & WithOptionLabel & TranslateProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const GoAEnumRadioGroupControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl & OwnPropsOfEnum>;
11
+ export declare const GoARadioGroupControlTester: RankedTester;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputIntegerProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const GoAInputInteger: (props: GoAInputIntegerProps) => JSX.Element;
6
+ export declare const GoAIntegerControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GoAIntegerControlTester: RankedTester;
8
+ export declare const GoAInputIntegerControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputTextProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const MultiLineText: (props: GoAInputTextProps) => JSX.Element;
6
+ export declare const MultiLineTextControlInput: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const MultiLineTextControlTester: RankedTester;
8
+ export declare const MultiLineTextControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputNumberProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const GoANumberInput: (props: GoAInputNumberProps) => JSX.Element;
6
+ export declare const GoANumberControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GoANumberControlTester: RankedTester;
8
+ export declare const GoAInputNumberControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputTextProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const GoAInputText: (props: GoAInputTextProps) => JSX.Element;
6
+ export declare const GoATextControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GoATextControlTester: RankedTester;
8
+ export declare const GoAInputTextControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CellProps, WithClassname, ControlProps, RankedTester } from '@jsonforms/core';
3
+ import { WithInputProps } from './type';
4
+ type GoAInputTimeProps = CellProps & WithClassname & WithInputProps;
5
+ export declare const GoATimeInput: (props: GoAInputTimeProps) => JSX.Element;
6
+ export declare const GoATimeControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GoATimeControlTester: RankedTester;
8
+ export declare const GoAInputTimeControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
9
+ export {};
@@ -1,3 +1,3 @@
1
1
  export interface WithInputProps {
2
- label?: string;
2
+ label?: string;
3
3
  }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface DeleteDialogProps {
3
+ open: boolean;
4
+ onConfirm(): void;
5
+ onCancel(): void;
6
+ title: string;
7
+ message: string;
8
+ }
9
+ export interface WithDeleteDialogSupport {
10
+ openDeleteDialog(path: string, data: number): void;
11
+ }
12
+ export declare const DeleteDialog: React.NamedExoticComponent<DeleteDialogProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ArrayLayoutProps, RankedTester } from '@jsonforms/core';
3
+ export declare const ArrayControl: (props: ArrayLayoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoAArrayControlTester: RankedTester;
5
+ export declare const GoAArrayControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
6
+ export declare const GoAListWithDetailsTester: RankedTester;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { ControlElement, JsonSchema, ArrayTranslations } from '@jsonforms/core';
3
+ export interface ObjectArrayToolbarProps {
4
+ numColumns: number;
5
+ errors: string;
6
+ label: string;
7
+ path: string;
8
+ uischema: ControlElement;
9
+ schema: JsonSchema;
10
+ rootSchema: JsonSchema;
11
+ enabled: boolean;
12
+ translations: ArrayTranslations;
13
+ addItem(path: string, value: any): () => void;
14
+ }
15
+ declare const ObjectArrayToolBar: React.NamedExoticComponent<ObjectArrayToolbarProps>;
16
+ export default ObjectArrayToolBar;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { ArrayLayoutProps, ControlElement, JsonSchema, JsonFormsCellRendererRegistryEntry, ArrayTranslations } from '@jsonforms/core';
3
+ import { WithDeleteDialogSupport } from './DeleteDialog';
4
+ export interface EmptyListProps {
5
+ numColumns: number;
6
+ translations: ArrayTranslations;
7
+ }
8
+ interface NonEmptyRowProps {
9
+ childPath: string;
10
+ schema: JsonSchema;
11
+ rowIndex: number;
12
+ showSortButtons: boolean;
13
+ enabled: boolean;
14
+ cells?: JsonFormsCellRendererRegistryEntry[];
15
+ path: string;
16
+ translations: ArrayTranslations;
17
+ uischema: ControlElement;
18
+ }
19
+ export declare const NonEmptyList: React.MemoExoticComponent<({ childPath, schema, rowIndex, openDeleteDialog, enabled, cells, path, translations, uischema, }: NonEmptyRowProps & WithDeleteDialogSupport) => import("react/jsx-runtime").JSX.Element>;
20
+ export declare class ObjectArrayControl extends React.Component<ArrayLayoutProps & WithDeleteDialogSupport, any> {
21
+ addItem: (path: string, value: any) => () => void;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
24
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const DeleteDialogContent: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const ToolBarHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const ObjectArrayTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The error control is invoked whenever no other control can be found. It is used to display
3
+ * an error to the developers indicating that they have misconfigured one or more of their schemas and
4
+ * that they need to take a close look. It will attempt to provide information to guide the developer
5
+ * toward fixing the error.
6
+ */
7
+ import React from 'react';
8
+ import { RankedTester } from '@jsonforms/core';
9
+ /**
10
+ * Note: by returning a rank of 1000, we are saying that this renderer is very important,
11
+ * one that must get used if there are any errors whatsoever.
12
+ */
13
+ export declare const GoAErrorControlTester: RankedTester;
14
+ declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
15
+ export default _default;
@@ -1,6 +1,3 @@
1
- import { GoACallout } from '@abgov/react-components-new';
2
- import React from 'react';
3
-
4
1
  /**
5
2
  * Used internally by registered Controls, the MessageControl
6
3
  * is used to display an error message if a component cannot be rendered
@@ -12,8 +9,4 @@ import React from 'react';
12
9
  *
13
10
  * @returns component for displaying the message in the correct style
14
11
  */
15
-
16
- // TODO: Add styling
17
- export const MessageControl = (message: string): JSX.Element => {
18
- return <GoACallout type="emergency">{message}</GoACallout>;
19
- };
12
+ export declare const MessageControl: (message: string) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { JsonSchema, UISchemaElement } from '@jsonforms/core';
2
+ export declare const isNullSchema: (schema: unknown) => boolean;
3
+ export declare const isValidScope: (uiSchema: UISchemaElement, schema: JsonSchema) => boolean;
4
+ export declare const isLayoutType: (schema: UISchemaElement) => boolean;
5
+ export declare const isKnownType: (schema: UISchemaElement) => boolean;
6
+ export declare const isListWithDetail: (schema: UISchemaElement) => boolean;
7
+ export declare const isScopedPrefixed: (scope: string) => boolean;
8
+ export declare const isEmptyObject: (schema: object) => boolean;
9
+ export declare const isControlWithNoScope: (uiSchema: UISchemaElement) => boolean;
10
+ export declare const isCategorization: (uiSchema: UISchemaElement) => boolean;
11
+ export declare const hasElements: (schema: object) => boolean;
12
+ export declare const isEmptyElements: (schema: object) => boolean;
13
+ export declare const hasVariant: (schema: UISchemaElement) => boolean;
14
+ export declare const isValidJsonObject: (schema: JsonSchema) => boolean;
@@ -0,0 +1,11 @@
1
+ import { JsonSchema, UISchemaElement } from '@jsonforms/core';
2
+ export declare const errCategorizationHasNonCategories = "Each element of 'Categorizations' must be of type 'Category'";
3
+ export declare const errCategorizationHasNoElements = "A Categorization must contain Categories.";
4
+ export declare const errNoElements: (type: string) => string;
5
+ export declare const errCategorizationHasNoVariant = "A Categorization must contain Options with a variant.";
6
+ export declare const errMissingScope = "A Control must have a scope";
7
+ export declare const errMalformedScope: (scope: string) => string;
8
+ export declare const errUnknownScope: (scope: string) => string;
9
+ export declare const errMissingType = "UI schema element must have a type";
10
+ export declare const errUnknownType: (type: string) => string;
11
+ export declare const getUISchemaErrors: (uiSchema: UISchemaElement, schema: JsonSchema) => string | null;
@@ -0,0 +1,11 @@
1
+ export declare const Grid: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ interface GridItemProps {
3
+ sm?: number;
4
+ md?: number;
5
+ lg?: number;
6
+ xl?: number;
7
+ hSpacing?: number;
8
+ vSpacing?: number;
9
+ }
10
+ export declare const GridItem: import("styled-components").StyledComponent<"div", any, GridItemProps, never>;
11
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface JsonformsComponentsProps {
2
+ }
3
+ export declare function JsonformsComponents(props: JsonformsComponentsProps): import("react/jsx-runtime").JSX.Element;
4
+ export default JsonformsComponents;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { LayoutProps, RankedTester } from '@jsonforms/core';
3
+ export declare const groupTester: RankedTester;
4
+ export declare const GoAGroupLayoutTester: RankedTester;
5
+ export declare const GoAGroupControl: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { LayoutProps, RankedTester } from '@jsonforms/core';
3
+ export declare const materialHorizontalLayoutTester: RankedTester;
4
+ export declare const GoAHorizontalLayoutComponent: ({ uischema, renderers, cells, schema, path, enabled, visible, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const GoAHorizontalLayout: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { LayoutProps } from '@jsonforms/core';
3
+ export declare const GoAVerticalLayoutComponent: ({ uischema, schema, path, enabled, renderers, cells, visible, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const GoAVerticalLayout: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
@@ -0,0 +1,8 @@
1
+ import type { UISchemaElement } from '@jsonforms/core';
2
+ import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonSchema, OwnPropsOfRenderer } from '@jsonforms/core';
3
+ export declare const renderLayoutElements: (elements: UISchemaElement[], schema?: JsonSchema, path?: string, enabled?: boolean, renderers?: JsonFormsRendererRegistryEntry[], cells?: JsonFormsCellRendererRegistryEntry[]) => import("react/jsx-runtime").JSX.Element[];
4
+ export interface LayoutRendererProps extends OwnPropsOfRenderer {
5
+ elements: UISchemaElement[];
6
+ direction: 'row' | 'column';
7
+ }
8
+ export declare const LayoutRenderer: ({ elements, schema, path, enabled, direction, renderers, cells, visible, }: LayoutRendererProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const parseSchema: (schema: string) => any;
@@ -0,0 +1,33 @@
1
+ import { ControlProps } from '@jsonforms/core';
2
+ /**
3
+ * Sets the first word to be capitalized so that it is sentence cased.
4
+ * @param words
5
+ * @returns sentence word string.
6
+ */
7
+ export declare const capitalizeFirstLetter: (words: string) => string;
8
+ /**
9
+ * Compares the scope name and the label to determine if it matches so that it can be sentence case.
10
+ * @param scope - format eg: '#/properties/firstName'
11
+ * @param label - The label text
12
+ * @returns true if the scope and label matches, otherwise false
13
+ */
14
+ export declare const controlScopeMatchesLabel: (scope: string, label: string) => boolean;
15
+ /**
16
+ * Gets the label text in sentence case
17
+ * @param scope
18
+ * @param label
19
+ * @returns
20
+ */
21
+ export declare const getLabelText: (scope: string, label: string) => string;
22
+ export declare const FIELD_REQUIRED = "data should pass \"isNotEmpty\" keyword validation";
23
+ /**
24
+ * Check if a required, defined input value is valid. Returns an appropriate
25
+ * error message if not.
26
+ * @param props
27
+ * @returns error message
28
+ */
29
+ export declare const checkFieldValidity: (props: ControlProps) => string;
30
+ /**
31
+ * Check if the date is a valid date/time
32
+ */
33
+ export declare const isValidDate: (date: Date | string) => boolean;
@@ -0,0 +1 @@
1
+ export declare const VerticalLayout: import("styled-components").StyledComponent<"div", any, {}, never>;
package/.babelrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@nx/react/babel",
5
- {
6
- "runtime": "automatic",
7
- "useBuiltIns": "usage"
8
- }
9
- ]
10
- ],
11
- "plugins": []
12
- }