@digigov/form 2.0.0-e7d30530 → 2.0.0-eaf330f5
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/Field/FieldBase/index.js +4 -3
- package/Field/FieldBase.js.map +2 -2
- package/Field/FieldBaseContainer/index.js +19 -37
- package/Field/FieldBaseContainer.d.ts +1 -1
- package/Field/FieldBaseContainer.js.map +2 -2
- package/Field/FieldConditional/index.js +1 -1
- package/Field/FieldConditional.js.map +1 -1
- package/Field/index.js +1 -2
- package/Field/index.js.map +2 -2
- package/Field/types.d.ts +2 -2
- package/Field/utils/index.js +3 -4
- package/Field/utils/index.js.map +2 -2
- package/FieldArray/FormDialog/index.js +7 -2
- package/FieldArray/FormDialog.d.ts +3 -2
- package/FieldArray/FormDialog.js.map +2 -2
- package/FieldArray/__stories__/Default.d.ts +1 -1
- package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
- package/FieldArray/__stories__/WithModal.d.ts +1 -1
- package/FieldArray/index.d.ts +1 -1
- package/FieldArray/index.js +88 -95
- package/FieldArray/index.js.map +3 -3
- package/FormBuilder/FormBuilder.stories.d.ts +0 -2
- package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +1 -1
- package/FormBuilder/__stories__/Default.d.ts +1 -1
- package/FormBuilder/__stories__/ErrorGrouping.d.ts +1 -1
- package/FormBuilder/index.d.ts +1 -1
- package/FormBuilder/index.js +7 -3
- package/FormBuilder/index.js.map +2 -2
- package/FormContext/index.js +2 -6
- package/FormContext.d.ts +0 -1
- package/FormContext.js.map +2 -2
- package/MultiplicityField/MultiplicityField.stories.d.ts +0 -2
- package/MultiplicityField/__stories__/Default.d.ts +1 -1
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
- package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
- package/MultiplicityField/add-objects/index.js +1 -1
- package/MultiplicityField/add-objects.js.map +2 -2
- package/MultiplicityField/index.js +2 -4
- package/MultiplicityField/index.js.map +2 -2
- package/MultiplicityField/types.d.ts +0 -1
- package/Questions/Questions.stories.d.ts +0 -2
- package/Questions/__stories__/Default.d.ts +1 -1
- package/cjs/Field/FieldBase/index.js +4 -3
- package/cjs/Field/FieldBase.js.map +2 -2
- package/cjs/Field/FieldBaseContainer/index.js +18 -36
- package/cjs/Field/FieldBaseContainer.js.map +3 -3
- package/cjs/Field/FieldConditional/index.js +1 -1
- package/cjs/Field/FieldConditional.js.map +1 -1
- package/cjs/Field/index.js +1 -2
- package/cjs/Field/index.js.map +2 -2
- package/cjs/Field/types.js.map +1 -1
- package/cjs/Field/utils/index.js +3 -4
- package/cjs/Field/utils/index.js.map +2 -2
- package/cjs/FieldArray/FormDialog/index.js +7 -2
- package/cjs/FieldArray/FormDialog.js.map +2 -2
- package/cjs/FieldArray/index.js +83 -93
- package/cjs/FieldArray/index.js.map +3 -3
- package/cjs/FormBuilder/index.js +7 -3
- package/cjs/FormBuilder/index.js.map +2 -2
- package/cjs/FormContext/index.js +2 -7
- package/cjs/FormContext.js.map +2 -2
- package/cjs/MultiplicityField/add-objects/index.js +1 -1
- package/cjs/MultiplicityField/add-objects.js.map +2 -2
- package/cjs/MultiplicityField/index.js +2 -4
- package/cjs/MultiplicityField/index.js.map +2 -2
- package/cjs/MultiplicityField/types.js.map +1 -1
- package/cjs/inputs/Checkboxes/index.js +1 -2
- package/cjs/inputs/Checkboxes/index.js.map +2 -2
- package/cjs/inputs/DateInput/index.js +12 -27
- package/cjs/inputs/DateInput/index.js.map +2 -2
- package/cjs/inputs/DateTimeInput/index.js +34 -55
- package/cjs/inputs/DateTimeInput/index.js.map +2 -2
- package/cjs/inputs/FileInput/index.js +26 -45
- package/cjs/inputs/FileInput/index.js.map +2 -2
- package/cjs/inputs/ImageInput/index.js +10 -41
- package/cjs/inputs/ImageInput/index.js.map +2 -2
- package/cjs/inputs/Input/inputsInputScenarios/index.js +439 -0
- package/cjs/inputs/Input/inputsInputScenarios.js.map +7 -0
- package/cjs/lazy/index.js +6 -6
- package/cjs/lazy.js.map +2 -2
- package/cjs/registry/index.js +10 -8
- package/cjs/registry.js.map +2 -2
- package/cjs/validators/index.js +10 -8
- package/cjs/validators/index.js.map +2 -2
- package/cjs/validators/utils/date/index.js +3 -21
- package/cjs/validators/utils/date.js.map +2 -2
- package/cjs/validators/utils/datetime/index.js +24 -113
- package/cjs/validators/utils/datetime.js.map +2 -2
- package/index.js +1 -1
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +0 -2
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +0 -2
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Checkboxes/index.js +1 -2
- package/inputs/Checkboxes/index.js.map +2 -2
- package/inputs/DateInput/DateInput.stories.d.ts +0 -6
- package/inputs/DateInput/__stories__/Default.d.ts +1 -1
- package/inputs/DateInput/index.js +13 -28
- package/inputs/DateInput/index.js.map +2 -2
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +3 -10
- package/inputs/DateTimeInput/__stories__/Default.d.ts +1 -1
- package/inputs/DateTimeInput/index.js +35 -56
- package/inputs/DateTimeInput/index.js.map +2 -2
- package/inputs/FileInput/FileInput.stories.d.ts +0 -2
- package/inputs/FileInput/__stories__/Default.d.ts +1 -1
- package/inputs/FileInput/index.d.ts +1 -5
- package/inputs/FileInput/index.js +27 -46
- package/inputs/FileInput/index.js.map +2 -2
- package/inputs/ImageInput/ImageInput.stories.d.ts +1 -4
- package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
- package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
- package/inputs/ImageInput/index.d.ts +1 -9
- package/inputs/ImageInput/index.js +11 -42
- package/inputs/ImageInput/index.js.map +2 -2
- package/inputs/Input/Input.stories.d.ts +0 -3
- package/inputs/Input/__stories__/AFM.d.ts +1 -1
- package/inputs/Input/__stories__/Boolean.d.ts +1 -1
- package/inputs/Input/__stories__/IBAN.d.ts +1 -1
- package/inputs/Input/__stories__/Integer.d.ts +1 -1
- package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
- package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
- package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
- package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
- package/inputs/Input/__stories__/String.d.ts +1 -1
- package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +1 -1
- package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
- package/inputs/Input/inputsInputScenarios/index.js +406 -0
- package/inputs/{ImageInput/__stories__/logo.d → Input/inputsInputScenarios}/package.json +1 -1
- package/inputs/Input/inputsInputScenarios.d.ts +57 -0
- package/inputs/Input/inputsInputScenarios.js.map +7 -0
- package/inputs/Label/Label.stories.d.ts +0 -2
- package/inputs/Label/__stories__/Default.d.ts +1 -1
- package/inputs/OtpInput/OtpInput.stories.d.ts +0 -2
- package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
- package/inputs/Radio/Radio.stories.d.ts +0 -2
- package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
- package/inputs/Radio/__stories__/Default.d.ts +1 -1
- package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Select/Select.stories.d.ts +0 -2
- package/inputs/Select/__stories__/Default.d.ts +1 -1
- package/lazy/index.js +6 -6
- package/package.json +8 -8
- package/registry/index.js +10 -8
- package/src/Field/FieldBase.tsx +18 -14
- package/src/Field/FieldBaseContainer.tsx +51 -68
- package/src/Field/FieldConditional.tsx +1 -1
- package/src/Field/index.tsx +1 -2
- package/src/Field/types.tsx +2 -2
- package/src/Field/utils/index.ts +1 -2
- package/src/FieldArray/FormDialog.tsx +12 -3
- package/src/FieldArray/__stories__/Default.tsx +1 -1
- package/src/FieldArray/__stories__/WithExactLength.tsx +1 -1
- package/src/FieldArray/__stories__/WithModal.tsx +1 -1
- package/src/FieldArray/index.tsx +103 -111
- package/src/FormBuilder/FormBuilder.stories.js +0 -3
- package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +1 -1
- package/src/FormBuilder/__stories__/Default.tsx +1 -1
- package/src/FormBuilder/__stories__/ErrorGrouping.tsx +1 -1
- package/src/FormBuilder/index.tsx +7 -3
- package/src/FormBuilder/scenarios.test.tsx +1 -1
- package/src/FormContext.tsx +1 -5
- package/src/MultiplicityField/MultiplicityField.stories.js +0 -3
- package/src/MultiplicityField/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
- package/src/MultiplicityField/add-objects.tsx +1 -1
- package/src/MultiplicityField/index.tsx +1 -3
- package/src/MultiplicityField/types.ts +0 -1
- package/src/Questions/Questions.stories.js +0 -3
- package/src/Questions/__stories__/Default.tsx +1 -1
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +0 -3
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -1
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +1 -1
- package/src/inputs/Checkboxes/Checkboxes.stories.js +0 -3
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Checkboxes/index.tsx +5 -4
- package/src/inputs/DateInput/DateInput.stories.js +0 -7
- package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
- package/src/inputs/DateInput/index.test.tsx +0 -16
- package/src/inputs/DateInput/index.tsx +13 -31
- package/src/inputs/DateTimeInput/DateTimeInput.stories.js +6 -12
- package/src/inputs/DateTimeInput/__stories__/Default.tsx +1 -1
- package/src/inputs/DateTimeInput/index.test.tsx +0 -16
- package/src/inputs/DateTimeInput/index.tsx +35 -59
- package/src/inputs/FileInput/FileInput.stories.js +0 -3
- package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
- package/src/inputs/FileInput/index.tsx +39 -72
- package/src/inputs/ImageInput/ImageInput.stories.js +1 -5
- package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
- package/src/inputs/ImageInput/__stories__/MaxSize.tsx +2 -3
- package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +1 -1
- package/src/inputs/ImageInput/index.test.tsx +0 -4
- package/src/inputs/ImageInput/index.tsx +48 -100
- package/src/inputs/Input/Input.stories.js +0 -4
- package/src/inputs/Input/__stories__/AFM.tsx +1 -1
- package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
- package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
- package/src/inputs/Input/__stories__/Integer.tsx +1 -1
- package/src/inputs/Input/__stories__/LandlineNumber.tsx +1 -1
- package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
- package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
- package/src/inputs/Input/__stories__/String.tsx +1 -1
- package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +1 -1
- package/src/inputs/Input/__stories__/TextWithLimit.tsx +1 -1
- package/src/inputs/Input/index.test.tsx +0 -8
- package/src/inputs/Input/inputsInputScenarios.ts +404 -0
- package/src/inputs/Label/Label.stories.js +0 -3
- package/src/inputs/Label/__stories__/Default.tsx +1 -1
- package/src/inputs/OtpInput/OtpInput.stories.js +0 -3
- package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/Radio.stories.js +0 -3
- package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Select/Select.stories.js +0 -3
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/lazy.js +6 -6
- package/src/registry.js +10 -8
- package/src/validators/index.ts +13 -13
- package/src/validators/utils/date.ts +4 -23
- package/src/validators/utils/datetime.ts +29 -116
- package/validators/index.js +10 -8
- package/validators/index.js.map +2 -2
- package/validators/utils/date/index.js +3 -21
- package/validators/utils/date.d.ts +1 -1
- package/validators/utils/date.js.map +2 -2
- package/validators/utils/datetime/index.js +24 -113
- package/validators/utils/datetime.d.ts +1 -1
- package/validators/utils/datetime.js.map +2 -2
- package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +0 -1
- package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +0 -7
- package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithInitialValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +0 -3
- package/inputs/ImageInput/__stories__/logo.d/index.js +0 -1
- package/inputs/ImageInput/__stories__/logo.d.js.map +0 -7
- package/inputs/Input/__stories__/Email.d.ts +0 -3
- package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +0 -26
- package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +0 -28
- package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +0 -26
- package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +0 -28
- package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +0 -26
- package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +0 -28
- package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +0 -26
- package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +0 -28
- package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +0 -45
- package/src/inputs/ImageInput/__stories__/logo.d.ts +0 -4
- package/src/inputs/ImageInput/__stories__/logo.png +0 -0
- package/src/inputs/Input/__stories__/Email.tsx +0 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/validators/utils/datetime.ts"],
|
|
4
|
-
"sourcesContent": ["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\ndayjs.extend(customParseFormat);\n\nconst VALID_DATETIME_FORMATS = ['DD/MM/YYYY HH:mm'];\nconst DATETIME_CACHE = {};\n\nconst getDateTime = (v: string) => {\n return DATETIME_CACHE[v]\n ? DATETIME_CACHE[v]\n : dayjs(v, VALID_DATETIME_FORMATS, true);\n};\n\
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,uBAAuB;AAI9B,MAAM,OAAO,iBAAiB;AAE9B,MAAM,yBAAyB,CAAC,kBAAkB;AAClD,MAAM,iBAAiB,CAAC;AAExB,MAAM,cAAc,CAAC,MAAc;AACjC,SAAO,eAAe,CAAC,IACnB,eAAe,CAAC,IAChB,MAAM,GAAG,wBAAwB,IAAI;AAC3C;
|
|
4
|
+
"sourcesContent": ["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\ndayjs.extend(customParseFormat);\n\nconst VALID_DATETIME_FORMATS = ['DD/MM/YYYY HH:mm'];\nconst DATETIME_CACHE = {};\n\nconst getDateTime = (v: string) => {\n return DATETIME_CACHE[v]\n ? DATETIME_CACHE[v]\n : dayjs(v, VALID_DATETIME_FORMATS, true);\n};\n\n// Function to check partial datetime completion\nconst checkPartialDateTime = (value: string) => {\n const [datePart, timePart] = value.split(' ');\n const [day, month, year] = datePart.split('/');\n const [hours, minutes] = timePart ? timePart.split(':') : [null, null];\n\n // Check date part first\n if (day && !month && !year) {\n return 'form.error.datetime.invalid_month_year';\n }\n if (!day && month && !year) {\n return 'form.error.datetime.invalid_day_year';\n }\n if (!day && !month && year) {\n return 'form.error.datetime.invalid_day_month';\n }\n if (day && month && !year) {\n return 'form.error.datetime.invalid_year';\n }\n if (day && !month && year) {\n return 'form.error.datetime.invalid_month';\n }\n if (!day && month && year) {\n return 'form.error.datetime.invalid_day';\n }\n // If date is complete, check time part\n if (day && month && year) {\n if (hours && !minutes) {\n return 'form.error.datetime.invalid_minutes';\n }\n if (!hours && minutes) {\n return 'form.error.datetime.invalid_hours';\n }\n if (!hours && !minutes) {\n return 'form.error.datetime.invalid';\n }\n if (hours && minutes) {\n const hoursNum = parseInt(hours);\n const minutesNum = parseInt(minutes);\n if (hoursNum < 0 || hoursNum > 23) {\n return 'form.error.datetime.invalid_hours_range';\n }\n if (minutesNum < 0 || minutesNum > 59) {\n return 'form.error.datetime.invalid_minutes_range';\n }\n }\n }\n\n return 'form.error.datetime.invalid';\n};\n\nexport const LATER_THAN_DATETIME_VALIDATOR = (\n field: FieldSpec\n): ValidatorSchema => {\n let minDateTime;\n const params = field.extra || {};\n if (params.min === 'now') {\n minDateTime = dayjs();\n } else {\n minDateTime = getDateTime(params.min);\n }\n return {\n name: 'later-than-datetime',\n message: {\n key: 'form.error.datetime.later_than',\n context: {\n minDateTime: minDateTime.format('DD/MM/YYYY HH:mm'),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid() && datetime.isAfter(minDateTime);\n },\n };\n};\n\nexport const EARLIER_THAN_DATETIME_VALIDATOR = (\n field: FieldSpec\n): ValidatorSchema => {\n let maxDateTime;\n const params = field.extra || {};\n if (params.max === 'now') {\n maxDateTime = dayjs();\n } else {\n maxDateTime = getDateTime(params.max);\n }\n return {\n name: 'earlier-than-datetime',\n message: {\n key: 'form.error.datetime.earlier_than',\n context: {\n maxDateTime: maxDateTime.format('DD/MM/YYYY HH:mm'),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid() && datetime.isBefore(maxDateTime);\n },\n };\n};\n\nexport const DATETIME_VALIDATOR = {\n name: 'datetime-validator',\n message: (v): string => {\n return checkPartialDateTime(v.value);\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid();\n },\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=logo.d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=logo.d.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'date',
|
|
9
|
-
required: true,
|
|
10
|
-
defaultValue: '05/11/2020',
|
|
11
|
-
label: {
|
|
12
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
14
|
-
},
|
|
15
|
-
} as const,
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const WithDefaultValue = (_: any) => (
|
|
19
|
-
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
-
{fields.map(({ key, ...field }) => {
|
|
21
|
-
return <Field {...field} name={key} key={key} />;
|
|
22
|
-
})}
|
|
23
|
-
<Button type="submit">Συνέχεια</Button>
|
|
24
|
-
</FormBuilder>
|
|
25
|
-
);
|
|
26
|
-
export default WithDefaultValue;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'date',
|
|
9
|
-
required: true,
|
|
10
|
-
label: {
|
|
11
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
-
},
|
|
14
|
-
} as const,
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
export const WithInitialValue = (_: any) => (
|
|
18
|
-
<FormBuilder
|
|
19
|
-
initial={{ date_example: '05/01/2020' }}
|
|
20
|
-
onSubmit={(data) => console.log(data)}
|
|
21
|
-
>
|
|
22
|
-
{fields.map(({ key, ...field }) => {
|
|
23
|
-
return <Field {...field} name={key} key={key} />;
|
|
24
|
-
})}
|
|
25
|
-
<Button type="submit">Συνέχεια</Button>
|
|
26
|
-
</FormBuilder>
|
|
27
|
-
);
|
|
28
|
-
export default WithInitialValue;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'date',
|
|
9
|
-
required: true,
|
|
10
|
-
defaultValue: '5/1/2020',
|
|
11
|
-
label: {
|
|
12
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
14
|
-
},
|
|
15
|
-
} as const,
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const WithWrongDefaultValue = (_: any) => (
|
|
19
|
-
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
-
{fields.map(({ key, ...field }) => {
|
|
21
|
-
return <Field {...field} name={key} key={key} />;
|
|
22
|
-
})}
|
|
23
|
-
<Button type="submit">Συνέχεια</Button>
|
|
24
|
-
</FormBuilder>
|
|
25
|
-
);
|
|
26
|
-
export default WithWrongDefaultValue;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'date',
|
|
9
|
-
required: true,
|
|
10
|
-
label: {
|
|
11
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
-
},
|
|
14
|
-
} as const,
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
export const WithWrongInitialValue = (_: any) => (
|
|
18
|
-
<FormBuilder
|
|
19
|
-
initial={{ date_example: '5/1/2020' }}
|
|
20
|
-
onSubmit={(data) => console.log(data)}
|
|
21
|
-
>
|
|
22
|
-
{fields.map(({ key, ...field }) => {
|
|
23
|
-
return <Field {...field} name={key} key={key} />;
|
|
24
|
-
})}
|
|
25
|
-
<Button type="submit">Συνέχεια</Button>
|
|
26
|
-
</FormBuilder>
|
|
27
|
-
);
|
|
28
|
-
export default WithWrongInitialValue;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'datetime_example',
|
|
8
|
-
type: 'datetime',
|
|
9
|
-
defaultValue: '05/11/2020 13:30',
|
|
10
|
-
required: true,
|
|
11
|
-
label: {
|
|
12
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
-
secondary: 'Για παράδειγμα, 05 11 2020 13:30',
|
|
14
|
-
},
|
|
15
|
-
} as const,
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const WithDefaultValue = (_: any) => (
|
|
19
|
-
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
-
{fields.map(({ key, ...field }) => {
|
|
21
|
-
return <Field {...field} name={key} key={key} />;
|
|
22
|
-
})}
|
|
23
|
-
<Button type="submit">Συνέχεια</Button>
|
|
24
|
-
</FormBuilder>
|
|
25
|
-
);
|
|
26
|
-
export default WithDefaultValue;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'datetime',
|
|
9
|
-
required: true,
|
|
10
|
-
label: {
|
|
11
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
-
},
|
|
14
|
-
} as const,
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
export const WithInitialValue = (_: any) => (
|
|
18
|
-
<FormBuilder
|
|
19
|
-
initial={{ date_example: '05/01/2020 13:30' }}
|
|
20
|
-
onSubmit={(data) => console.log(data)}
|
|
21
|
-
>
|
|
22
|
-
{fields.map(({ key, ...field }) => {
|
|
23
|
-
return <Field {...field} name={key} key={key} />;
|
|
24
|
-
})}
|
|
25
|
-
<Button type="submit">Συνέχεια</Button>
|
|
26
|
-
</FormBuilder>
|
|
27
|
-
);
|
|
28
|
-
export default WithInitialValue;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'datetime_example',
|
|
8
|
-
type: 'datetime',
|
|
9
|
-
defaultValue: '5/1/2020 3:3',
|
|
10
|
-
required: true,
|
|
11
|
-
label: {
|
|
12
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
-
secondary: 'Για παράδειγμα, 05 11 2020 13:30',
|
|
14
|
-
},
|
|
15
|
-
} as const,
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const WithWrongDefaultValue = (_: any) => (
|
|
19
|
-
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
-
{fields.map(({ key, ...field }) => {
|
|
21
|
-
return <Field {...field} name={key} key={key} />;
|
|
22
|
-
})}
|
|
23
|
-
<Button type="submit">Συνέχεια</Button>
|
|
24
|
-
</FormBuilder>
|
|
25
|
-
);
|
|
26
|
-
export default WithWrongDefaultValue;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
const fields = [
|
|
6
|
-
{
|
|
7
|
-
key: 'date_example',
|
|
8
|
-
type: 'datetime',
|
|
9
|
-
required: true,
|
|
10
|
-
label: {
|
|
11
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
-
},
|
|
14
|
-
} as const,
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
export const WithWrongInitialValue = (_: any) => (
|
|
18
|
-
<FormBuilder
|
|
19
|
-
initial={{ date_example: '5/1/2020 3:3' }}
|
|
20
|
-
onSubmit={(data) => console.log(data)}
|
|
21
|
-
>
|
|
22
|
-
{fields.map(({ key, ...field }) => {
|
|
23
|
-
return <Field {...field} name={key} key={key} />;
|
|
24
|
-
})}
|
|
25
|
-
<Button type="submit">Συνέχεια</Button>
|
|
26
|
-
</FormBuilder>
|
|
27
|
-
);
|
|
28
|
-
export default WithWrongInitialValue;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field, Fieldset } from '@digigov/form';
|
|
3
|
-
import logo from '@digigov/form/inputs/ImageInput/__stories__/logo.png';
|
|
4
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
5
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
6
|
-
const FIELDS: FieldSpec[] = [
|
|
7
|
-
{
|
|
8
|
-
key: 'image',
|
|
9
|
-
type: 'image',
|
|
10
|
-
required: true,
|
|
11
|
-
label: {
|
|
12
|
-
primary: 'Ανέβασμα φωτογραφίας',
|
|
13
|
-
secondary:
|
|
14
|
-
'Οι επιτρεπόμενες διαστάσεις είναι για το ύψος από 100 μέχρι 400 και για το πλάτος από 100 μέχρι 400.',
|
|
15
|
-
},
|
|
16
|
-
extra: {
|
|
17
|
-
limit: {
|
|
18
|
-
maxHeight: 400,
|
|
19
|
-
maxWidth: 400,
|
|
20
|
-
minHeight: 100,
|
|
21
|
-
minWidth: 100,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export const WithInitialValues = (_: any) => (
|
|
28
|
-
<FormBuilder
|
|
29
|
-
fields={FIELDS}
|
|
30
|
-
initial={{
|
|
31
|
-
image: { src: logo, filename: 'logo.png' },
|
|
32
|
-
}}
|
|
33
|
-
onSubmit={(data) => {
|
|
34
|
-
console.log(data);
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<Fieldset>
|
|
38
|
-
{FIELDS.map((field) => (
|
|
39
|
-
<Field key={field.key} name={field.key} />
|
|
40
|
-
))}
|
|
41
|
-
</Fieldset>
|
|
42
|
-
<Button type="submit">Συνέχεια</Button>
|
|
43
|
-
</FormBuilder>
|
|
44
|
-
);
|
|
45
|
-
export default WithInitialValues;
|
|
Binary file
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
export const Email = (_: any) => (
|
|
6
|
-
<FormBuilder
|
|
7
|
-
onSubmit={(data) => {
|
|
8
|
-
console.log(data);
|
|
9
|
-
}}
|
|
10
|
-
>
|
|
11
|
-
<Field
|
|
12
|
-
key="email"
|
|
13
|
-
name="email"
|
|
14
|
-
type="email"
|
|
15
|
-
label={{
|
|
16
|
-
primary: 'Δ/νση Ηλεκτρ. Ταχυδρομείου (Ε-mail)',
|
|
17
|
-
}}
|
|
18
|
-
required
|
|
19
|
-
/>
|
|
20
|
-
<Button type="submit">Συνέχεια</Button>
|
|
21
|
-
</FormBuilder>
|
|
22
|
-
);
|
|
23
|
-
export default Email;
|