@digigov/form 1.0.0-6b93ebf2 → 1.0.0-871b6be5
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 +6 -8
- 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 +8 -4
- 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 +6 -8
- package/es/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
- package/es/Questions/Step/StepArrayReview.js +2 -2
- package/es/Questions/Step/StepTitle.js +7 -4
- 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/DateInput/__stories__/Default.js +0 -18
- package/es/inputs/FileInput/index.js +1 -1
- package/es/inputs/OtpInput/index.js +5 -5
- package/es/inputs/Radio/__stories__/Default.js +1 -1
- package/es/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/es/inputs/Select/__stories__/Default.js +1 -1
- package/esm/FormBuilder/FormBuilder.mdx +6 -8
- package/esm/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
- package/esm/Questions/Step/StepArrayReview.js +2 -2
- package/esm/Questions/Step/StepTitle.js +7 -4
- 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/DateInput/__stories__/Default.js +0 -18
- package/esm/inputs/FileInput/index.js +1 -1
- package/esm/inputs/OtpInput/index.js +5 -5
- package/esm/inputs/Radio/__stories__/Default.js +1 -1
- package/esm/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/esm/inputs/Select/__stories__/Default.js +1 -1
- package/inputs/DateInput/__stories__/Default.js +0 -18
- package/inputs/FileInput/index.js +1 -1
- package/inputs/OtpInput/index.js +5 -5
- package/inputs/Radio/__stories__/Default.js +1 -1
- package/inputs/Radio/__stories__/WithDivider.js +1 -1
- package/inputs/Select/__stories__/Default.js +1 -1
- package/package.json +4 -4
- package/src/FormBuilder/FormBuilder.mdx +6 -8
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +4 -4
- package/src/Questions/Step/StepArrayReview.tsx +3 -3
- package/src/Questions/Step/StepTitle.tsx +12 -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/DateInput/__stories__/Default.tsx +0 -16
- package/src/inputs/FileInput/index.tsx +1 -1
- package/src/inputs/OtpInput/index.tsx +8 -8
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/types.tsx +1 -1
- package/types.d.ts +1 -1
package/es/Questions/index.mdx
CHANGED
|
@@ -348,11 +348,11 @@ export default function Index() {
|
|
|
348
348
|
<BasicLayout>
|
|
349
349
|
<Top>
|
|
350
350
|
<Header>
|
|
351
|
-
<
|
|
352
|
-
<
|
|
351
|
+
<HeaderContent>
|
|
352
|
+
<HeaderSection>
|
|
353
353
|
<GovGRLogo href="#" />
|
|
354
|
-
</
|
|
355
|
-
</
|
|
354
|
+
</HeaderSection>
|
|
355
|
+
</HeaderContent>
|
|
356
356
|
</Header>
|
|
357
357
|
</Top>
|
|
358
358
|
<Content>
|
|
@@ -19,24 +19,6 @@ export var Default = function Default() {
|
|
|
19
19
|
label: {
|
|
20
20
|
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
21
21
|
secondary: 'Για παράδειγμα, 05 11 2020'
|
|
22
|
-
},
|
|
23
|
-
extra: {
|
|
24
|
-
options: [{
|
|
25
|
-
label: {
|
|
26
|
-
primary: 'Έχω συνάχι'
|
|
27
|
-
},
|
|
28
|
-
value: 'runny-nose'
|
|
29
|
-
}, {
|
|
30
|
-
label: {
|
|
31
|
-
primary: 'Έχω πυρετό'
|
|
32
|
-
},
|
|
33
|
-
value: 'fever'
|
|
34
|
-
}, {
|
|
35
|
-
label: {
|
|
36
|
-
primary: 'Αισθάνομαι κούραση'
|
|
37
|
-
},
|
|
38
|
-
value: 'fatigue'
|
|
39
|
-
}]
|
|
40
22
|
}
|
|
41
23
|
}), _ref);
|
|
42
24
|
};
|
|
@@ -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,10 +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
|
|
98
|
+
import PageTitleContainer, {
|
|
99
|
+
PageTitleCaption,
|
|
99
100
|
PageTitleHeading,
|
|
100
|
-
} from '@digigov/ui/app/
|
|
101
|
-
import { HeadingCaption } from '@digigov/ui/typography/HeadingCaption';
|
|
101
|
+
} from '@digigov/ui/app/PageTitleContainer';
|
|
102
102
|
import BackButton from '@digigov/ui/form/Button/BackButton';
|
|
103
103
|
import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
|
|
104
104
|
import { useTranslation } from '@digigov/ui/i18n';
|
|
@@ -227,12 +227,10 @@ export default function Index() {
|
|
|
227
227
|
<Content>
|
|
228
228
|
<Main className={styles.main}>
|
|
229
229
|
<BackButton>{t('button.back')}</BackButton>
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
<HeadingCaption>Before we start</HeadingCaption>
|
|
233
|
-
</Section>
|
|
230
|
+
<PageTitleContainer>
|
|
231
|
+
<PageTitleCaption>Before we start</PageTitleCaption>
|
|
234
232
|
<PageTitleHeading>Submit a form</PageTitleHeading>
|
|
235
|
-
</
|
|
233
|
+
</PageTitleContainer>
|
|
236
234
|
<FormBuilder
|
|
237
235
|
fields={FIELDS}
|
|
238
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,11 +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
|
|
6
|
+
import HeadingCaption from '@digigov/react-core/HeadingCaption';
|
|
7
|
+
import Heading from '@digigov/react-core/Heading';
|
|
7
8
|
export var StepTitleHeading = function StepTitleHeading(props) {
|
|
8
|
-
return /*#__PURE__*/React.createElement(
|
|
9
|
+
return /*#__PURE__*/React.createElement(Heading, null, props.children);
|
|
9
10
|
};
|
|
10
11
|
export var StepTitleBase = function StepTitleBase(_ref) {
|
|
11
12
|
var caption = _ref.caption,
|
|
@@ -17,7 +18,9 @@ export var StepTitleBase = function StepTitleBase(_ref) {
|
|
|
17
18
|
var _useTranslation = useTranslation(),
|
|
18
19
|
t = _useTranslation.t;
|
|
19
20
|
|
|
20
|
-
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)))));
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
23
26
|
* The StepTitle component accepts a title, a caption and a step indicator
|