@abgov/jsonforms-components 1.3.0 → 1.4.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
@@ -3609,45 +3609,6 @@ const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({},
3609
3609
  const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, optionIs('radio', true)));
3610
3610
  const GoABooleanRadioControl = withJsonFormsControlProps(BooleanRadioControl);
3611
3611
 
3612
- var call = functionCall;
3613
- var hasOwn = hasOwnProperty_1;
3614
- var isPrototypeOf = objectIsPrototypeOf;
3615
- var regExpFlags = regexpFlags$1;
3616
-
3617
- var RegExpPrototype$1 = RegExp.prototype;
3618
-
3619
- var regexpGetFlags = function (R) {
3620
- var flags = R.flags;
3621
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
3622
- ? call(regExpFlags, R) : flags;
3623
- };
3624
-
3625
- var PROPER_FUNCTION_NAME = functionName.PROPER;
3626
- var defineBuiltIn = defineBuiltIn$5;
3627
- var anObject = anObject$9;
3628
- var $toString = toString$5;
3629
- var fails = fails$i;
3630
- var getRegExpFlags = regexpGetFlags;
3631
-
3632
- var TO_STRING = 'toString';
3633
- var RegExpPrototype = RegExp.prototype;
3634
- var nativeToString = RegExpPrototype[TO_STRING];
3635
-
3636
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
3637
- // FF44- RegExp#toString has a wrong name
3638
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
3639
-
3640
- // `RegExp.prototype.toString` method
3641
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
3642
- if (NOT_GENERIC || INCORRECT_NAME) {
3643
- defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
3644
- var R = anObject(this);
3645
- var pattern = $toString(R.source);
3646
- var flags = $toString(getRegExpFlags(R));
3647
- return '/' + pattern + '/' + flags;
3648
- }, { unsafe: true });
3649
- }
3650
-
3651
3612
  let _$5 = t => t,
3652
3613
  _t$5,
3653
3614
  _t2$3;
@@ -3703,10 +3664,12 @@ let _$4 = t => t,
3703
3664
  _t$4,
3704
3665
  _t2$2,
3705
3666
  _t3$1,
3706
- _t4,
3667
+ _t4$1,
3707
3668
  _t5,
3708
3669
  _t6,
3709
- _t7;
3670
+ _t7,
3671
+ _t8,
3672
+ _t9;
3710
3673
  const ReviewItem = styled.div(_t$4 || (_t$4 = _$4`
3711
3674
  display: flex;
3712
3675
  flex-direction: column;
@@ -3728,7 +3691,7 @@ const ReviewItemHeader = styled.div(_t3$1 || (_t3$1 = _$4`
3728
3691
  justify-content: space-between;
3729
3692
  margin-bottom: 2rem;
3730
3693
  `));
3731
- const ReviewItemTitle = styled.div(_t4 || (_t4 = _$4`
3694
+ const ReviewItemTitle = styled.div(_t4$1 || (_t4$1 = _$4`
3732
3695
  font-size: var(--fs-xl);
3733
3696
  line-height: var(--lh-lg);
3734
3697
  font-weight: var(--fw-light);
@@ -3745,6 +3708,75 @@ styled.div(_t6 || (_t6 = _$4`
3745
3708
  styled.div(_t7 || (_t7 = _$4`
3746
3709
  margin-bottom: var(--goa-space-m);
3747
3710
  `));
3711
+ const ListWithDetail = styled.div(_t8 || (_t8 = _$4`
3712
+ margin: var(--goa-space-s);
3713
+ width: 100%;
3714
+ `));
3715
+ const ListWithDetailHeading = styled.h3(_t9 || (_t9 = _$4`
3716
+ text-transform: capitalize;
3717
+ `));
3718
+
3719
+ const getAllRequiredFields = schema => {
3720
+ const requiredFields = [];
3721
+ function findRequired(fields) {
3722
+ if (fields && fields.required && Array.isArray(fields.required)) {
3723
+ fields.required.forEach(field => {
3724
+ requiredFields.push(field);
3725
+ });
3726
+ }
3727
+ if (fields !== undefined && fields.properties) {
3728
+ Object.keys(fields.properties).forEach(key => {
3729
+ if (fields.properties) {
3730
+ findRequired(fields.properties[key]);
3731
+ }
3732
+ });
3733
+ } else if (fields && fields.type === 'array' && fields.items && typeof fields.items === 'object') {
3734
+ const childItems = JSON.parse(JSON.stringify(fields.items));
3735
+ findRequired(childItems);
3736
+ }
3737
+ }
3738
+ findRequired(schema);
3739
+ return requiredFields;
3740
+ };
3741
+
3742
+ var call = functionCall;
3743
+ var hasOwn = hasOwnProperty_1;
3744
+ var isPrototypeOf = objectIsPrototypeOf;
3745
+ var regExpFlags = regexpFlags$1;
3746
+
3747
+ var RegExpPrototype$1 = RegExp.prototype;
3748
+
3749
+ var regexpGetFlags = function (R) {
3750
+ var flags = R.flags;
3751
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
3752
+ ? call(regExpFlags, R) : flags;
3753
+ };
3754
+
3755
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
3756
+ var defineBuiltIn = defineBuiltIn$5;
3757
+ var anObject = anObject$9;
3758
+ var $toString = toString$5;
3759
+ var fails = fails$i;
3760
+ var getRegExpFlags = regexpGetFlags;
3761
+
3762
+ var TO_STRING = 'toString';
3763
+ var RegExpPrototype = RegExp.prototype;
3764
+ var nativeToString = RegExpPrototype[TO_STRING];
3765
+
3766
+ var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
3767
+ // FF44- RegExp#toString has a wrong name
3768
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
3769
+
3770
+ // `RegExp.prototype.toString` method
3771
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
3772
+ if (NOT_GENERIC || INCORRECT_NAME) {
3773
+ defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
3774
+ var R = anObject(this);
3775
+ var pattern = $toString(R.source);
3776
+ var flags = $toString(getRegExpFlags(R));
3777
+ return '/' + pattern + '/' + flags;
3778
+ }, { unsafe: true });
3779
+ }
3748
3780
 
3749
3781
  const resolveLabelFromScope = scope => {
3750
3782
  // eslint-disable-next-line no-useless-escape
@@ -3769,33 +3801,52 @@ const getFormFieldValue = (scope, data) => {
3769
3801
  }
3770
3802
  currentValue = currentValue[key];
3771
3803
  }
3772
- return typeof currentValue === 'object' ? '' : currentValue;
3804
+ return Array.isArray(currentValue) ? currentValue[currentValue.length - 1] : typeof currentValue === 'object' ? '' : currentValue;
3773
3805
  } else {
3774
3806
  return '';
3775
3807
  }
3776
3808
  };
3777
- const renderFormFields = (elements, data) => elements.map((element, index) => {
3778
- // const clonedElement = element;
3809
+ const renderFormFields = (elements, data,
3810
+ // eslint-disable-line @typescript-eslint/no-explicit-any
3811
+ requiredFields) => elements.map((element, index) => {
3812
+ var _a;
3779
3813
  const clonedElement = JSON.parse(JSON.stringify(element));
3814
+ const lastSegment = (_a = clonedElement.scope) === null || _a === void 0 ? void 0 : _a.split('/').pop();
3780
3815
  if (clonedElement.type === 'Control' && clonedElement.scope) {
3781
3816
  const label = resolveLabelFromScope(clonedElement.scope);
3782
3817
  if (!label) return null;
3783
3818
  const value = getFormFieldValue(clonedElement.scope, data ? data : {}).toString();
3819
+ const asterisk = requiredFields.indexOf(lastSegment) !== -1 ? ' *' : '';
3784
3820
  return jsxs(GridItem, {
3785
3821
  md: 6,
3786
3822
  vSpacing: 1,
3787
3823
  hSpacing: 0.5,
3788
3824
  children: [jsxs("strong", {
3789
- children: [label, ":"]
3790
- }), " ", value]
3825
+ children: [label, " ", asterisk + ':']
3826
+ }), ' ', value]
3791
3827
  }, index);
3792
- } else if (clonedElement === null || clonedElement === void 0 ? void 0 : clonedElement.elements) {
3828
+ } else if (clonedElement.type !== 'ListWithDetail' && (clonedElement === null || clonedElement === void 0 ? void 0 : clonedElement.elements)) {
3793
3829
  return jsx(React.Fragment, {
3794
- children: renderFormFields(clonedElement.elements, data)
3830
+ children: renderFormFields(clonedElement.elements, data, requiredFields)
3795
3831
  }, index);
3832
+ } else if (clonedElement.type === 'ListWithDetail' && data && data[lastSegment] && data[lastSegment].length > 0) {
3833
+ const listData = data[lastSegment];
3834
+ return jsxs(ListWithDetail, {
3835
+ children: [jsxs(ListWithDetailHeading, {
3836
+ children: [lastSegment, listData.length > 1 && 's']
3837
+ }), jsx(Grid, {
3838
+ children: listData.map((childData,
3839
+ // eslint-disable-line @typescript-eslint/no-explicit-any
3840
+ childIndex // eslint-disable-line @typescript-eslint/no-explicit-any
3841
+ ) => jsx(React.Fragment, {
3842
+ children: renderFormFields(clonedElement.elements, childData, requiredFields)
3843
+ }, `${index}-${childIndex}`))
3844
+ })]
3845
+ });
3796
3846
  }
3797
3847
  return null;
3798
3848
  });
3849
+
3799
3850
  const FormStepper = ({
3800
3851
  uischema,
3801
3852
  data,
@@ -3811,10 +3862,15 @@ const FormStepper = ({
3811
3862
  t
3812
3863
  }) => {
3813
3864
  const categorization = uischema;
3814
- const [step, setStep] = useState(0);
3865
+ const rawCategories = JSON.parse(JSON.stringify(categorization));
3866
+ const [step, setStep] = useState(1);
3815
3867
  const [isFormValid, setIsFormValid] = useState(false);
3816
3868
  const [showNextBtn, setShowNextBtn] = useState(true);
3817
- const categories = useMemo(() => categorization.elements.filter(category => isVisible(category, data, '', ajv)), [categorization, data, ajv]);
3869
+ const [categories, setCategories] = useState(categorization.elements);
3870
+ useEffect(() => {
3871
+ const cates = categorization.elements.filter(category => isVisible(category, data, '', ajv));
3872
+ setCategories(cates);
3873
+ }, [categorization, data, ajv]);
3818
3874
  const disabledCategoryMap = categories.map(c => !isEnabled(c, data, '', ajv));
3819
3875
  const handleSubmit = () => {
3820
3876
  console.log('submitted', data);
@@ -3850,6 +3906,26 @@ const FormStepper = ({
3850
3906
  }
3851
3907
  setPage(page);
3852
3908
  }
3909
+ function setTab(page) {
3910
+ const rawCategoryLabels = rawCategories.elements.map(category => category.label);
3911
+ if (page > 1 && page <= rawCategoryLabels.length && rawCategoryLabels.length !== CategoryLabels.length) {
3912
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3913
+ const selectedTabLabel = rawCategoryLabels[page - 1];
3914
+ const selectedTab = CategoryLabels.indexOf(selectedTabLabel);
3915
+ const newStep = selectedTab !== -1 ? selectedTab : page;
3916
+ page = newStep;
3917
+ }
3918
+ if (page > rawCategoryLabels.length && rawCategoryLabels.length !== CategoryLabels.length) {
3919
+ page = page - 1;
3920
+ }
3921
+ setStep(page);
3922
+ if (page < 1 || page > categories.length + 1) return;
3923
+ if (categories.length + 1 === page) {
3924
+ setShowNextBtn(false);
3925
+ } else {
3926
+ setShowNextBtn(true);
3927
+ }
3928
+ }
3853
3929
  function setPage(page) {
3854
3930
  setStep(page);
3855
3931
  if (page < 1 || page > categories.length + 1) return;
@@ -3897,11 +3973,11 @@ const FormStepper = ({
3897
3973
  testId: "form-stepper-test",
3898
3974
  step: step,
3899
3975
  onChange: step => {
3900
- setPage(step);
3976
+ setTab(step);
3901
3977
  },
3902
3978
  children: [categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
3903
3979
  return jsx(GoAFormStep, {
3904
- text: `${CategoryLabels[index]}${disabledCategoryMap[index] ? ' (disabled)' : ''}`,
3980
+ text: `${CategoryLabels[index]}`,
3905
3981
  status: 'incomplete'
3906
3982
  }, `${CategoryLabels[index]}-tab`);
3907
3983
  }), jsx(GoAFormStep, {
@@ -3923,8 +3999,9 @@ const FormStepper = ({
3923
3999
  },
3924
4000
  children: "Summary"
3925
4001
  }), jsx(ReviewItem, {
3926
- children: categories.map((category, index) => {
4002
+ children: categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
3927
4003
  const categoryLabel = category.label || category.i18n || 'Unknown Category';
4004
+ const requiredFields = getAllRequiredFields(schema);
3928
4005
  return jsxs(ReviewItemSection, {
3929
4006
  children: [jsxs(ReviewItemHeader, {
3930
4007
  children: [jsx(ReviewItemTitle, {
@@ -3934,7 +4011,7 @@ const FormStepper = ({
3934
4011
  children: "Edit"
3935
4012
  })]
3936
4013
  }), jsx(Grid, {
3937
- children: renderFormFields(category.elements, data)
4014
+ children: renderFormFields(category.elements, data, requiredFields)
3938
4015
  })]
3939
4016
  }, index);
3940
4017
  })
@@ -4213,7 +4290,8 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
4213
4290
  let _$1 = t => t,
4214
4291
  _t$1,
4215
4292
  _t2,
4216
- _t3;
4293
+ _t3,
4294
+ _t4;
4217
4295
  const DeleteDialogContent = styled.div(_t$1 || (_t$1 = _$1`
4218
4296
  margin-bottom: var(--goa-space-m);
4219
4297
  `));
@@ -4223,6 +4301,9 @@ const ToolBarHeader = styled.div(_t2 || (_t2 = _$1`
4223
4301
  const ObjectArrayTitle = styled.h2(_t3 || (_t3 = _$1`
4224
4302
  margin-bottom: var(--goa-space-l);
4225
4303
  `));
4304
+ const DisplayWrapper = styled.div(_t4 || (_t4 = _$1`
4305
+ display: ${0};
4306
+ `), p => p.visible ? 'initial' : 'none');
4226
4307
 
4227
4308
  // eslint-disable-next-line
4228
4309
  const extractScopesFromUISchema = uischema => {
@@ -4302,17 +4383,18 @@ const ctxToNonEmptyCellProps = (ctx, ownProps) => {
4302
4383
  renderers: ownProps.renderers || ctx.renderers
4303
4384
  };
4304
4385
  };
4305
- const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellComponent({
4306
- schema,
4307
- errors,
4308
- enabled,
4309
- renderers,
4310
- cells,
4311
- rowPath,
4312
- isValid,
4313
- uischema
4314
- }) {
4315
- var _a, _b;
4386
+ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellComponent(props) {
4387
+ var _a, _b, _c;
4388
+ const {
4389
+ schema,
4390
+ errors,
4391
+ enabled,
4392
+ renderers,
4393
+ cells,
4394
+ rowPath,
4395
+ isValid,
4396
+ uischema
4397
+ } = props;
4316
4398
  const propNames = getValidColumnProps(schema);
4317
4399
  const propScopes = (uischema === null || uischema === void 0 ? void 0 : uischema.scope) ? propNames.map(name => {
4318
4400
  return `#/properties/${name}`;
@@ -4338,6 +4420,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
4338
4420
  // eslint-disable-next-line
4339
4421
  (_b = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _b === void 0 ? void 0 : _b.map(element => {
4340
4422
  return jsx(JsonFormsDispatch, {
4423
+ "data-testid": `jsonforms-object-list-defined-elements-dispatch`,
4341
4424
  schema: schema,
4342
4425
  uischema: element,
4343
4426
  path: rowPath,
@@ -4345,7 +4428,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
4345
4428
  renderers: renderers,
4346
4429
  cells: cells
4347
4430
  }, rowPath);
4348
- }), jsx(JsonFormsDispatch, {
4431
+ }), ((_c = uiSchemaElementsForNotDefined === null || uiSchemaElementsForNotDefined === void 0 ? void 0 : uiSchemaElementsForNotDefined.elements) === null || _c === void 0 ? void 0 : _c.length) > 0 && jsx(JsonFormsDispatch, {
4349
4432
  schema: schema,
4350
4433
  uischema: uiSchemaElementsForNotDefined,
4351
4434
  path: rowPath,
@@ -4457,38 +4540,37 @@ class ObjectArrayControl extends React.Component {
4457
4540
  const controlElement = uischema;
4458
4541
  // eslint-disable-next-line
4459
4542
  const listTitle = label || ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.title);
4460
- return jsx(Hidden, {
4461
- xsUp: !visible,
4462
- children: jsxs("div", {
4463
- children: [jsxs(ToolBarHeader, {
4464
- children: [listTitle && jsx(ObjectArrayTitle, {
4465
- children: listTitle
4466
- }), jsx(ObjectArrayToolBar, {
4467
- errors: errors,
4468
- label: label,
4469
- addItem: this.addItem,
4470
- numColumns: 0,
4471
- path: path,
4472
- uischema: controlElement,
4473
- schema: schema,
4474
- rootSchema: rootSchema,
4475
- enabled: enabled,
4476
- translations: translations
4477
- })]
4478
- }), jsx("div", {
4479
- children: jsx(ObjectArrayList, Object.assign({
4480
- path: path,
4481
- schema: schema,
4482
- uischema: uischema,
4483
- enabled: enabled,
4484
- openDeleteDialog: openDeleteDialog,
4485
- translations: translations,
4486
- data: data,
4487
- cells: cells,
4488
- config: config
4489
- }, additionalProps))
4543
+ return jsxs(DisplayWrapper, {
4544
+ visible: visible,
4545
+ "data-testid": "jsonforms-object-list-wrapper",
4546
+ children: [jsxs(ToolBarHeader, {
4547
+ children: [listTitle && jsx(ObjectArrayTitle, {
4548
+ children: listTitle
4549
+ }), jsx(ObjectArrayToolBar, {
4550
+ errors: errors,
4551
+ label: label,
4552
+ addItem: this.addItem,
4553
+ numColumns: 0,
4554
+ path: path,
4555
+ uischema: controlElement,
4556
+ schema: schema,
4557
+ rootSchema: rootSchema,
4558
+ enabled: enabled,
4559
+ translations: translations
4490
4560
  })]
4491
- })
4561
+ }), jsx("div", {
4562
+ children: jsx(ObjectArrayList, Object.assign({
4563
+ path: path,
4564
+ schema: schema,
4565
+ uischema: uischema,
4566
+ enabled: enabled,
4567
+ openDeleteDialog: openDeleteDialog,
4568
+ translations: translations,
4569
+ data: data,
4570
+ cells: cells,
4571
+ config: config
4572
+ }, additionalProps))
4573
+ })]
4492
4574
  });
4493
4575
  }
4494
4576
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.3.0",
3
+ "version": "1.4.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,13 +1,10 @@
1
1
  import React from 'react';
2
- import { Categorization, UISchemaElement, Category, StatePropsOfLayout } from '@jsonforms/core';
2
+ import { StatePropsOfLayout } from '@jsonforms/core';
3
3
  import { TranslateProps } from '@jsonforms/react';
4
4
  import { AjvProps } from '@jsonforms/material-renderers';
5
5
  export interface CategorizationStepperLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
6
6
  data: any;
7
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
8
  export declare const FormStepper: ({ uischema, data, schema, ajv, path, cells, renderers, config, visible, enabled, t, }: CategorizationStepperLayoutRendererProps) => import("react/jsx-runtime").JSX.Element;
12
9
  export declare const flattenObject: (obj: Record<string, string>) => Record<string, string>;
13
10
  export declare const FormStepperControl: (props: CategorizationStepperLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { JsonSchema4, JsonSchema7 } from '@jsonforms/core';
2
+ export declare const Schema: JsonSchema4 | JsonSchema7;
@@ -0,0 +1,283 @@
1
+ export declare const MockUiSchema: {
2
+ type: string;
3
+ elements: ({
4
+ type: string;
5
+ scope: string;
6
+ rule?: undefined;
7
+ elements?: undefined;
8
+ options?: undefined;
9
+ } | {
10
+ type: string;
11
+ rule: {
12
+ effect: string;
13
+ condition: {
14
+ scope: string;
15
+ schema: {
16
+ const: boolean;
17
+ };
18
+ };
19
+ };
20
+ elements: ({
21
+ type: string;
22
+ label: string;
23
+ elements: ({
24
+ type: string;
25
+ scope: string;
26
+ label?: undefined;
27
+ rule?: undefined;
28
+ options?: undefined;
29
+ elements?: undefined;
30
+ } | {
31
+ type: string;
32
+ label: string;
33
+ rule: {
34
+ effect: string;
35
+ condition: {
36
+ scope: string;
37
+ schema: {
38
+ const: boolean;
39
+ };
40
+ };
41
+ };
42
+ options: {
43
+ help: string;
44
+ addButtonPosition?: undefined;
45
+ addButtonText?: undefined;
46
+ };
47
+ scope?: undefined;
48
+ elements?: undefined;
49
+ } | {
50
+ type: string;
51
+ elements: ({
52
+ type: string;
53
+ rule: {
54
+ effect: string;
55
+ condition: {
56
+ scope: string;
57
+ schema: {
58
+ const: boolean;
59
+ };
60
+ };
61
+ };
62
+ scope: string;
63
+ elements?: undefined;
64
+ } | {
65
+ type: string;
66
+ scope: string;
67
+ rule?: undefined;
68
+ elements?: undefined;
69
+ } | {
70
+ type: string;
71
+ elements: {
72
+ type: string;
73
+ scope: string;
74
+ }[];
75
+ rule: {
76
+ effect: string;
77
+ condition: {
78
+ scope: string;
79
+ schema: {
80
+ const: boolean;
81
+ };
82
+ };
83
+ };
84
+ scope?: undefined;
85
+ })[];
86
+ scope?: undefined;
87
+ label?: undefined;
88
+ rule?: undefined;
89
+ options?: undefined;
90
+ } | {
91
+ type: string;
92
+ rule: {
93
+ effect: string;
94
+ condition: {
95
+ scope: string;
96
+ schema: {
97
+ const: boolean;
98
+ };
99
+ };
100
+ };
101
+ elements: ({
102
+ type: string;
103
+ scope: string;
104
+ options?: undefined;
105
+ } | {
106
+ type: string;
107
+ scope: string;
108
+ options: {
109
+ enumContext: {
110
+ key: string;
111
+ url: string;
112
+ values: string;
113
+ location?: undefined;
114
+ type?: undefined;
115
+ };
116
+ };
117
+ } | {
118
+ type: string;
119
+ scope: string;
120
+ options: {
121
+ enumContext: {
122
+ key: string;
123
+ url: string;
124
+ location: string;
125
+ type: string;
126
+ values?: undefined;
127
+ };
128
+ };
129
+ })[];
130
+ scope?: undefined;
131
+ label?: undefined;
132
+ options?: undefined;
133
+ } | {
134
+ type: string;
135
+ rule: {
136
+ effect: string;
137
+ condition: {
138
+ scope: string;
139
+ schema: {
140
+ const: boolean;
141
+ };
142
+ };
143
+ };
144
+ elements: ({
145
+ type: string;
146
+ scope: string;
147
+ options: {
148
+ autocomplete: boolean;
149
+ enumContext: {
150
+ key: string;
151
+ location: string;
152
+ url: string;
153
+ values: string[];
154
+ };
155
+ };
156
+ } | {
157
+ type: string;
158
+ scope: string;
159
+ options: {
160
+ autocomplete: boolean;
161
+ enumContext: {
162
+ key: string;
163
+ location?: undefined;
164
+ url?: undefined;
165
+ values?: undefined;
166
+ };
167
+ };
168
+ })[];
169
+ scope?: undefined;
170
+ label?: undefined;
171
+ options?: undefined;
172
+ } | {
173
+ type: string;
174
+ rule: {
175
+ effect: string;
176
+ condition: {
177
+ scope: string;
178
+ schema: {
179
+ const: boolean;
180
+ };
181
+ };
182
+ };
183
+ scope: string;
184
+ options: {
185
+ addButtonPosition: string;
186
+ addButtonText: string;
187
+ help?: undefined;
188
+ };
189
+ elements: {
190
+ type: string;
191
+ elements: {
192
+ type: string;
193
+ scope: string;
194
+ }[];
195
+ }[];
196
+ label?: undefined;
197
+ })[];
198
+ i18n?: undefined;
199
+ rule?: undefined;
200
+ } | {
201
+ type: string;
202
+ i18n: string;
203
+ label: string;
204
+ elements: {
205
+ type: string;
206
+ elements: {
207
+ type: string;
208
+ scope: string;
209
+ }[];
210
+ }[];
211
+ rule: {
212
+ effect: string;
213
+ condition: {
214
+ scope: string;
215
+ schema: {
216
+ const: boolean;
217
+ };
218
+ };
219
+ };
220
+ } | {
221
+ type: string;
222
+ label: string;
223
+ elements: ({
224
+ type: string;
225
+ scope: string;
226
+ rule?: undefined;
227
+ options?: undefined;
228
+ } | {
229
+ type: string;
230
+ scope: string;
231
+ rule: {
232
+ effect: string;
233
+ condition: {
234
+ scope: string;
235
+ schema: {
236
+ const: boolean;
237
+ };
238
+ };
239
+ };
240
+ options?: undefined;
241
+ } | {
242
+ type: string;
243
+ scope: string;
244
+ options: {
245
+ format: string;
246
+ multi?: undefined;
247
+ };
248
+ rule: {
249
+ effect: string;
250
+ condition: {
251
+ scope: string;
252
+ schema: {
253
+ const: boolean;
254
+ };
255
+ };
256
+ };
257
+ } | {
258
+ type: string;
259
+ scope: string;
260
+ options: {
261
+ multi: boolean;
262
+ format?: undefined;
263
+ };
264
+ rule: {
265
+ effect: string;
266
+ condition: {
267
+ scope: string;
268
+ schema: {
269
+ const: boolean;
270
+ };
271
+ };
272
+ };
273
+ })[];
274
+ i18n?: undefined;
275
+ rule?: undefined;
276
+ })[];
277
+ options: {
278
+ variant: string;
279
+ showNavButtons: boolean;
280
+ };
281
+ scope?: undefined;
282
+ })[];
283
+ };
@@ -5,3 +5,5 @@ export declare const ReviewItemTitle: import("styled-components").StyledComponen
5
5
  export declare const Anchor: import("styled-components").StyledComponent<"div", any, {}, never>;
6
6
  export declare const ReviewListItem: import("styled-components").StyledComponent<"div", any, {}, never>;
7
7
  export declare const ReviewListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const ListWithDetail: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const ListWithDetailHeading: import("styled-components").StyledComponent<"h3", any, {}, never>;
@@ -0,0 +1,4 @@
1
+ import { UISchemaElement, Category, Categorization } from '@jsonforms/core';
2
+ export declare const resolveLabelFromScope: (scope: string) => string | null;
3
+ export declare const getFormFieldValue: (scope: string, data: object) => any;
4
+ export declare const renderFormFields: (elements: UISchemaElement[] | (Category | Categorization)[], data: any, requiredFields: string[]) => (import("react/jsx-runtime").JSX.Element | null)[];
@@ -0,0 +1,2 @@
1
+ import { JsonSchema4, JsonSchema7 } from '@jsonforms/core';
2
+ export declare const getAllRequiredFields: (schema: JsonSchema4 | JsonSchema7) => string[];
@@ -1,10 +1,24 @@
1
1
  import React from 'react';
2
- import { ArrayLayoutProps, ControlElement, JsonSchema, JsonFormsCellRendererRegistryEntry, ArrayTranslations } from '@jsonforms/core';
2
+ import { ArrayLayoutProps, ControlElement, JsonSchema, JsonFormsRendererRegistryEntry, JsonFormsCellRendererRegistryEntry, ArrayTranslations, Layout } from '@jsonforms/core';
3
3
  import { WithDeleteDialogSupport } from './DeleteDialog';
4
+ export type ObjectArrayControlProps = ArrayLayoutProps & WithDeleteDialogSupport;
4
5
  export interface EmptyListProps {
5
6
  numColumns: number;
6
7
  translations: ArrayTranslations;
7
8
  }
9
+ interface NonEmptyRowComponentProps {
10
+ propName?: string;
11
+ schema: JsonSchema;
12
+ rootSchema?: JsonSchema;
13
+ rowPath: string;
14
+ errors: string;
15
+ enabled: boolean;
16
+ renderers?: JsonFormsRendererRegistryEntry[];
17
+ cells?: JsonFormsCellRendererRegistryEntry[];
18
+ isValid: boolean;
19
+ uischema?: ControlElement | Layout;
20
+ }
21
+ export declare const NonEmptyCellComponent: React.NamedExoticComponent<NonEmptyRowComponentProps>;
8
22
  interface NonEmptyRowProps {
9
23
  childPath: string;
10
24
  schema: JsonSchema;
@@ -17,7 +31,7 @@ interface NonEmptyRowProps {
17
31
  uischema: ControlElement;
18
32
  }
19
33
  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> {
34
+ export declare class ObjectArrayControl extends React.Component<ObjectArrayControlProps, any> {
21
35
  addItem: (path: string, value: any) => () => void;
22
36
  render(): import("react/jsx-runtime").JSX.Element;
23
37
  }
@@ -1,3 +1,6 @@
1
1
  export declare const DeleteDialogContent: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export declare const ToolBarHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export declare const ObjectArrayTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
4
+ export declare const DisplayWrapper: import("styled-components").StyledComponent<"div", any, {
5
+ visible: boolean;
6
+ }, never>;