@abgov/jsonforms-components 1.4.0 → 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 +24 -1
- package/package.json +1 -1
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';
|
|
@@ -3866,6 +3866,7 @@ const FormStepper = ({
|
|
|
3866
3866
|
const [step, setStep] = useState(1);
|
|
3867
3867
|
const [isFormValid, setIsFormValid] = useState(false);
|
|
3868
3868
|
const [showNextBtn, setShowNextBtn] = useState(true);
|
|
3869
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
3869
3870
|
const [categories, setCategories] = useState(categorization.elements);
|
|
3870
3871
|
useEffect(() => {
|
|
3871
3872
|
const cates = categorization.elements.filter(category => isVisible(category, data, '', ajv));
|
|
@@ -3873,6 +3874,11 @@ const FormStepper = ({
|
|
|
3873
3874
|
}, [categorization, data, ajv]);
|
|
3874
3875
|
const disabledCategoryMap = categories.map(c => !isEnabled(c, data, '', ajv));
|
|
3875
3876
|
const handleSubmit = () => {
|
|
3877
|
+
setIsOpen(true);
|
|
3878
|
+
console.log('submitted', data);
|
|
3879
|
+
};
|
|
3880
|
+
const onSubmit = () => {
|
|
3881
|
+
setIsOpen(false);
|
|
3876
3882
|
console.log('submitted', data);
|
|
3877
3883
|
};
|
|
3878
3884
|
const CategoryLabels = useMemo(() => {
|
|
@@ -4040,6 +4046,23 @@ const FormStepper = ({
|
|
|
4040
4046
|
children: "Submit"
|
|
4041
4047
|
})
|
|
4042
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)"]
|
|
4043
4066
|
})]
|
|
4044
4067
|
})
|
|
4045
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",
|