@abgov/jsonforms-components 1.3.1 → 1.5.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 +154 -54
- package/package.json +1 -1
- package/src/lib/Controls/FormStepper/FormStepperControl.d.ts +1 -4
- package/src/lib/Controls/FormStepper/MockData/mock-schema.d.ts +2 -0
- package/src/lib/Controls/FormStepper/MockData/mock-ui-schema.d.ts +283 -0
- package/src/lib/Controls/FormStepper/styled-components.d.ts +2 -0
- package/src/lib/Controls/FormStepper/util/GenerateFormFields.d.ts +4 -0
- package/src/lib/Controls/FormStepper/util/getRequiredFields.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withAjvProps, materialSliderControlTester, MaterialSliderControl, materialObjectControlTester, MaterialObjectRenderer, materialAllOfControlTester, MaterialAllOfRenderer, materialAnyOfControlTester, MaterialAnyOfRenderer, materialOneOfControlTester, MaterialOneOfRenderer, materialOneOfRadioGroupControlTester, MaterialOneOfRadioGroupControl, materialOneOfEnumControlTester, MaterialOneOfEnumControl, materialHorizontalLayoutTester, materialVerticalLayoutTester, materialArrayLayoutTester, MaterialArrayLayout, materialAnyOfStringOrEnumControlTester, MaterialAnyOfStringOrEnumControl, materialEnumArrayRendererTester, MaterialEnumArrayRenderer, materialBooleanCellTester, MaterialBooleanCell, materialBooleanToggleCellTester, MaterialBooleanToggleCell, materialEnumCellTester, MaterialEnumCell, materialOneOfEnumCellTester, MaterialOneOfEnumCell } from '@jsonforms/material-renderers';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { GoAFormItem, GoACallout, GoAInputDate, GoAInput, GoATextArea, GoAInputDateTime, GoAInputTime, GoADropdown, GoADropdownItem, GoARadioGroup, GoARadioItem, GoACheckbox, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAIconButton, GoAFileUploadInput,
|
|
3
|
+
import { GoAFormItem, GoACallout, GoAInputDate, GoAInput, GoATextArea, GoAInputDateTime, GoAInputTime, GoADropdown, GoADropdownItem, GoARadioGroup, GoARadioItem, GoACheckbox, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAGrid, GoAContainer, GoADetails } from '@abgov/react-components';
|
|
4
4
|
import { Hidden, Typography, FormHelperText } from '@mui/material';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { rankWith, uiTypeIs, isDateControl, isStringControl, and, optionIs, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, isDescriptionHidden, isVisible, isEnabled, deriveLabelForUISchemaElement, schemaTypeIs, formatIs, createDefaultValue, Paths, or, isObjectArrayControl, isPrimitiveArrayControl, withIncreasedRank, hasType, isControl, isCategorization, isLayout } from '@jsonforms/core';
|
|
@@ -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;
|
|
@@ -3706,7 +3667,9 @@ let _$4 = t => t,
|
|
|
3706
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;
|
|
@@ -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
|
|
3778
|
-
|
|
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
|
-
}),
|
|
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,12 +3862,23 @@ const FormStepper = ({
|
|
|
3811
3862
|
t
|
|
3812
3863
|
}) => {
|
|
3813
3864
|
const categorization = uischema;
|
|
3814
|
-
const
|
|
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
|
|
3869
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
3870
|
+
const [categories, setCategories] = useState(categorization.elements);
|
|
3871
|
+
useEffect(() => {
|
|
3872
|
+
const cates = categorization.elements.filter(category => isVisible(category, data, '', ajv));
|
|
3873
|
+
setCategories(cates);
|
|
3874
|
+
}, [categorization, data, ajv]);
|
|
3818
3875
|
const disabledCategoryMap = categories.map(c => !isEnabled(c, data, '', ajv));
|
|
3819
3876
|
const handleSubmit = () => {
|
|
3877
|
+
setIsOpen(true);
|
|
3878
|
+
console.log('submitted', data);
|
|
3879
|
+
};
|
|
3880
|
+
const onSubmit = () => {
|
|
3881
|
+
setIsOpen(false);
|
|
3820
3882
|
console.log('submitted', data);
|
|
3821
3883
|
};
|
|
3822
3884
|
const CategoryLabels = useMemo(() => {
|
|
@@ -3850,6 +3912,26 @@ const FormStepper = ({
|
|
|
3850
3912
|
}
|
|
3851
3913
|
setPage(page);
|
|
3852
3914
|
}
|
|
3915
|
+
function setTab(page) {
|
|
3916
|
+
const rawCategoryLabels = rawCategories.elements.map(category => category.label);
|
|
3917
|
+
if (page > 1 && page <= rawCategoryLabels.length && rawCategoryLabels.length !== CategoryLabels.length) {
|
|
3918
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3919
|
+
const selectedTabLabel = rawCategoryLabels[page - 1];
|
|
3920
|
+
const selectedTab = CategoryLabels.indexOf(selectedTabLabel);
|
|
3921
|
+
const newStep = selectedTab !== -1 ? selectedTab : page;
|
|
3922
|
+
page = newStep;
|
|
3923
|
+
}
|
|
3924
|
+
if (page > rawCategoryLabels.length && rawCategoryLabels.length !== CategoryLabels.length) {
|
|
3925
|
+
page = page - 1;
|
|
3926
|
+
}
|
|
3927
|
+
setStep(page);
|
|
3928
|
+
if (page < 1 || page > categories.length + 1) return;
|
|
3929
|
+
if (categories.length + 1 === page) {
|
|
3930
|
+
setShowNextBtn(false);
|
|
3931
|
+
} else {
|
|
3932
|
+
setShowNextBtn(true);
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3853
3935
|
function setPage(page) {
|
|
3854
3936
|
setStep(page);
|
|
3855
3937
|
if (page < 1 || page > categories.length + 1) return;
|
|
@@ -3897,11 +3979,11 @@ const FormStepper = ({
|
|
|
3897
3979
|
testId: "form-stepper-test",
|
|
3898
3980
|
step: step,
|
|
3899
3981
|
onChange: step => {
|
|
3900
|
-
|
|
3982
|
+
setTab(step);
|
|
3901
3983
|
},
|
|
3902
3984
|
children: [categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
|
|
3903
3985
|
return jsx(GoAFormStep, {
|
|
3904
|
-
text: `${CategoryLabels[index]}
|
|
3986
|
+
text: `${CategoryLabels[index]}`,
|
|
3905
3987
|
status: 'incomplete'
|
|
3906
3988
|
}, `${CategoryLabels[index]}-tab`);
|
|
3907
3989
|
}), jsx(GoAFormStep, {
|
|
@@ -3923,8 +4005,9 @@ const FormStepper = ({
|
|
|
3923
4005
|
},
|
|
3924
4006
|
children: "Summary"
|
|
3925
4007
|
}), jsx(ReviewItem, {
|
|
3926
|
-
children: categories.map((category, index) => {
|
|
4008
|
+
children: categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
|
|
3927
4009
|
const categoryLabel = category.label || category.i18n || 'Unknown Category';
|
|
4010
|
+
const requiredFields = getAllRequiredFields(schema);
|
|
3928
4011
|
return jsxs(ReviewItemSection, {
|
|
3929
4012
|
children: [jsxs(ReviewItemHeader, {
|
|
3930
4013
|
children: [jsx(ReviewItemTitle, {
|
|
@@ -3934,7 +4017,7 @@ const FormStepper = ({
|
|
|
3934
4017
|
children: "Edit"
|
|
3935
4018
|
})]
|
|
3936
4019
|
}), jsx(Grid, {
|
|
3937
|
-
children: renderFormFields(category.elements, data)
|
|
4020
|
+
children: renderFormFields(category.elements, data, requiredFields)
|
|
3938
4021
|
})]
|
|
3939
4022
|
}, index);
|
|
3940
4023
|
})
|
|
@@ -3963,6 +4046,23 @@ const FormStepper = ({
|
|
|
3963
4046
|
children: "Submit"
|
|
3964
4047
|
})
|
|
3965
4048
|
})]
|
|
4049
|
+
}), jsxs(GoAModal, {
|
|
4050
|
+
testId: "submit-confirmation",
|
|
4051
|
+
open: isOpen,
|
|
4052
|
+
heading: 'Form Submitted',
|
|
4053
|
+
width: "640px",
|
|
4054
|
+
actions: jsx(GoAButtonGroup, {
|
|
4055
|
+
alignment: "end",
|
|
4056
|
+
children: jsx(GoAButton, {
|
|
4057
|
+
type: "secondary",
|
|
4058
|
+
testId: "submit-form",
|
|
4059
|
+
onClick: onSubmit,
|
|
4060
|
+
children: "Ok"
|
|
4061
|
+
})
|
|
4062
|
+
}),
|
|
4063
|
+
children: [jsx("b", {
|
|
4064
|
+
children: "Submit is a test for preview purposes"
|
|
4065
|
+
}), "(i.e. no actual form is being submitted)"]
|
|
3966
4066
|
})]
|
|
3967
4067
|
})
|
|
3968
4068
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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 {
|
|
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,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)[];
|