@digigov/form 1.0.0-002c630d → 1.0.0-290a96e2
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/FormBuilder/FormBuilder.mdx +4 -7
- package/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
- package/Questions/Step/StepArrayReview.js +2 -2
- package/Questions/Step/StepTitle.d.ts +2 -2
- package/Questions/Step/StepTitle.js +9 -3
- package/Questions/__snapshots__/index.spec.tsx.snap +69 -356
- package/Questions/__stories__/Default.js +1 -1
- package/Questions/index.mdx +4 -4
- package/es/FormBuilder/FormBuilder.mdx +4 -7
- package/es/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
- package/es/Questions/Step/StepArrayReview.js +2 -2
- package/es/Questions/Step/StepTitle.js +7 -3
- package/es/Questions/__snapshots__/index.spec.tsx.snap +69 -356
- package/es/Questions/__stories__/Default.js +1 -1
- package/es/Questions/index.mdx +4 -4
- package/es/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
- package/es/inputs/FileInput/index.js +1 -1
- package/es/inputs/OtpInput/index.js +5 -5
- package/es/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/esm/FormBuilder/FormBuilder.mdx +4 -7
- package/esm/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
- package/esm/Questions/Step/StepArrayReview.js +2 -2
- package/esm/Questions/Step/StepTitle.js +7 -3
- package/esm/Questions/__snapshots__/index.spec.tsx.snap +69 -356
- package/esm/Questions/__stories__/Default.js +1 -1
- package/esm/Questions/index.mdx +4 -4
- package/esm/index.js +1 -1
- package/esm/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
- package/esm/inputs/FileInput/index.js +1 -1
- package/esm/inputs/OtpInput/index.js +5 -5
- package/esm/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
- package/inputs/FileInput/index.js +1 -1
- package/inputs/OtpInput/index.js +5 -5
- package/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/package.json +4 -4
- package/src/FormBuilder/FormBuilder.mdx +4 -7
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +4 -4
- package/src/Questions/Step/StepArrayReview.tsx +3 -3
- package/src/Questions/Step/StepTitle.tsx +11 -14
- package/src/Questions/__snapshots__/index.spec.tsx.snap +69 -356
- package/src/Questions/__stories__/Default.tsx +4 -4
- package/src/Questions/index.mdx +4 -4
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/FileInput/index.tsx +1 -1
- package/src/inputs/OtpInput/index.tsx +8 -8
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/src/types.tsx +1 -1
- package/types.d.ts +1 -1
|
@@ -41,7 +41,7 @@ export var FileInput = /*#__PURE__*/React.forwardRef(function FileInput(_ref, re
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FileUploadContainer, {
|
|
44
|
-
|
|
44
|
+
hasFiles: files && files.length > 0
|
|
45
45
|
}, files !== null && files !== void 0 && files.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Paragraph, null, /*#__PURE__*/React.createElement("b", null, t('upload.file'), ":"), " ", "".concat(files.join(', ')))) : /*#__PURE__*/React.createElement(CoreHint, null, t('upload.no_file')), /*#__PURE__*/React.createElement(FileUpload, _extends({
|
|
46
46
|
ref: ref,
|
|
47
47
|
hasFiles: !!(files !== null && files !== void 0 && files.length),
|
|
@@ -4,7 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
var _excluded = ["name", "maxLength"];
|
|
6
6
|
import React, { useState, useCallback } from 'react';
|
|
7
|
-
import
|
|
7
|
+
import SingleCharacterInputs, { SingleCharacterInput } from '@digigov/ui/form/SingleCharacterInputs';
|
|
8
8
|
export var RE_DIGIT = new RegExp(/^\d+$/);
|
|
9
9
|
export var REMOVE_SPACES = new RegExp(/\s+/g);
|
|
10
10
|
|
|
@@ -113,10 +113,10 @@ function useOtp(onChange, maxLength) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
var
|
|
116
|
+
var SingleCharacterInputPart = function SingleCharacterInputPart(_ref) {
|
|
117
117
|
var props = _extends({}, _ref);
|
|
118
118
|
|
|
119
|
-
return /*#__PURE__*/React.createElement(
|
|
119
|
+
return /*#__PURE__*/React.createElement(SingleCharacterInput, props);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
export var OtpInput = function OtpInput(_ref2) {
|
|
@@ -126,8 +126,8 @@ export var OtpInput = function OtpInput(_ref2) {
|
|
|
126
126
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
127
127
|
|
|
128
128
|
var otp = useOtp(props.onChange, maxLength);
|
|
129
|
-
return /*#__PURE__*/React.createElement(
|
|
130
|
-
return /*#__PURE__*/React.createElement(
|
|
129
|
+
return /*#__PURE__*/React.createElement(SingleCharacterInputs, null, otp.otpValues.map(function (digit, idx) {
|
|
130
|
+
return /*#__PURE__*/React.createElement(SingleCharacterInputPart, {
|
|
131
131
|
name: "".concat(name, "-").concat(idx),
|
|
132
132
|
type: "text",
|
|
133
133
|
key: idx,
|
|
@@ -95,11 +95,10 @@ import Header, { HeaderTitle } from '@digigov/ui/app/Header';
|
|
|
95
95
|
import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
|
|
96
96
|
import GovGRFooter from '@digigov/ui/govgr/Footer';
|
|
97
97
|
import Button from '@digigov/ui/form/Button';
|
|
98
|
-
import
|
|
99
|
-
PageTitleSection,
|
|
98
|
+
import PageTitleContainer, {
|
|
100
99
|
PageTitleCaption,
|
|
101
100
|
PageTitleHeading,
|
|
102
|
-
} from '@digigov/ui/app/
|
|
101
|
+
} from '@digigov/ui/app/PageTitleContainer';
|
|
103
102
|
import BackButton from '@digigov/ui/form/Button/BackButton';
|
|
104
103
|
import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
|
|
105
104
|
import { useTranslation } from '@digigov/ui/i18n';
|
|
@@ -228,12 +227,10 @@ export default function Index() {
|
|
|
228
227
|
<Content>
|
|
229
228
|
<Main className={styles.main}>
|
|
230
229
|
<BackButton>{t('button.back')}</BackButton>
|
|
231
|
-
<
|
|
232
|
-
<PageTitleSection>
|
|
230
|
+
<PageTitleContainer>
|
|
233
231
|
<PageTitleCaption>Before we start</PageTitleCaption>
|
|
234
|
-
</PageTitleSection>
|
|
235
232
|
<PageTitleHeading>Submit a form</PageTitleHeading>
|
|
236
|
-
</
|
|
233
|
+
</PageTitleContainer>
|
|
237
234
|
<FormBuilder
|
|
238
235
|
fields={FIELDS}
|
|
239
236
|
onSubmit={setData}
|
|
@@ -33,7 +33,7 @@ var fields = [{
|
|
|
33
33
|
value: 'ΚΑΡΤΑ'
|
|
34
34
|
}];
|
|
35
35
|
|
|
36
|
-
var _ref = /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(
|
|
36
|
+
var _ref = /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(HeaderSection, null, /*#__PURE__*/React.createElement(GovGRLogo, {
|
|
37
37
|
href: "#"
|
|
38
38
|
}), /*#__PURE__*/React.createElement(HeaderTitle, null, "\u03A0\u03C1\u03CC\u03C4\u03C5\u03C0\u03BF-\u0391\u03BD\u03B1\u03C6\u03BF\u03C1\u03AC\u03C2"))));
|
|
39
39
|
|
|
@@ -5,7 +5,7 @@ import FormBuilder from '@digigov/form/FormBuilder';
|
|
|
5
5
|
import Label from '@digigov/form/inputs/Label';
|
|
6
6
|
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
7
7
|
import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
|
|
8
|
-
import
|
|
8
|
+
import PageTitleContainer, { PageTitleHeading } from '@digigov/ui/app/PageTitleContainer';
|
|
9
9
|
import { SummaryList, SummaryListItem, SummaryListItemKey, SummaryListItemValue, SummaryListItemAction } from '@digigov/ui/content/SummaryList';
|
|
10
10
|
import Button from '@digigov/ui/form/Button';
|
|
11
11
|
import { useTranslation } from '@digigov/ui/i18n';
|
|
@@ -24,7 +24,7 @@ export var StepArrayReview = function StepArrayReview(props) {
|
|
|
24
24
|
|
|
25
25
|
return field.key === ((_currentStep$review = currentStep.review) === null || _currentStep$review === void 0 ? void 0 : _currentStep$review.primaryFieldKey);
|
|
26
26
|
}) || {};
|
|
27
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PageTitleContainer, null, /*#__PURE__*/React.createElement(PageTitleHeading, null, ((_currentStep$review2 = currentStep.review) === null || _currentStep$review2 === void 0 ? void 0 : _currentStep$review2.title) && t((_currentStep$review3 = currentStep.review) === null || _currentStep$review3 === void 0 ? void 0 : _currentStep$review3.title))), /*#__PURE__*/React.createElement(SummaryList, null, props.array.map(function (item, idx) {
|
|
28
28
|
return /*#__PURE__*/React.createElement(SummaryListItem, {
|
|
29
29
|
key: idx
|
|
30
30
|
}, /*#__PURE__*/React.createElement(SummaryListItemKey, null, t(primaryField.label.primary)), /*#__PURE__*/React.createElement(SummaryListItemValue, null, item[primaryField.key]), /*#__PURE__*/React.createElement(SummaryListItemAction, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
3
|
-
import
|
|
3
|
+
import PageTitleContainer, { PageTitleCaption } from '@digigov/ui/app/PageTitleContainer';
|
|
4
4
|
import BackButton from '@digigov/ui/form/Button/BackButton';
|
|
5
5
|
import { useTranslation } from '@digigov/ui/i18n';
|
|
6
|
+
import HeadingCaption from '@digigov/react-core/HeadingCaption';
|
|
7
|
+
import Heading from '@digigov/react-core/Heading';
|
|
6
8
|
export var StepTitleHeading = function StepTitleHeading(props) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(
|
|
9
|
+
return /*#__PURE__*/React.createElement(Heading, null, props.children);
|
|
8
10
|
};
|
|
9
11
|
export var StepTitleBase = function StepTitleBase(_ref) {
|
|
10
12
|
var caption = _ref.caption,
|
|
@@ -16,7 +18,9 @@ export var StepTitleBase = function StepTitleBase(_ref) {
|
|
|
16
18
|
var _useTranslation = useTranslation(),
|
|
17
19
|
t = _useTranslation.t;
|
|
18
20
|
|
|
19
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BackButton, null, backButton || t('back
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BackButton, null, backButton || t('button.back')), /*#__PURE__*/React.createElement(PageTitleContainer, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeadingCaption, {
|
|
22
|
+
size: "xl"
|
|
23
|
+
}, caption && t(caption)), step && /*#__PURE__*/React.createElement(PageTitleCaption, null, step), /*#__PURE__*/React.createElement(StepTitleHeading, null, title && t(title)))));
|
|
20
24
|
};
|
|
21
25
|
/**
|
|
22
26
|
* The StepTitle component accepts a title, a caption and a step indicator
|