envoc-form 5.0.2 → 5.0.4-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/README.md +4650 -1250
- package/dist/index.cjs +21523 -0
- package/dist/index.d.ts +575 -0
- package/dist/index.js +21456 -0
- package/package.json +107 -111
- package/dist/css/envoc-form-styles.css +0 -3
- package/dist/css/envoc-form-styles.css.map +0 -1
- package/es/AddressInput/AddressInput.d.ts +0 -24
- package/es/AddressInput/AddressInput.js +0 -20
- package/es/AddressInput/UsStates.d.ts +0 -3
- package/es/AddressInput/UsStates.js +0 -53
- package/es/ConfirmBaseForm/ConfirmBaseForm.d.ts +0 -26
- package/es/ConfirmBaseForm/ConfirmBaseForm.js +0 -42
- package/es/ConfirmDeleteForm/ConfirmDeleteForm.d.ts +0 -24
- package/es/ConfirmDeleteForm/ConfirmDeleteForm.js +0 -60
- package/es/DatePicker/DatePickerGroup.d.ts +0 -13
- package/es/DatePicker/DatePickerGroup.js +0 -87
- package/es/DatePicker/DatePickerHelper.d.ts +0 -3
- package/es/DatePicker/DatePickerHelper.js +0 -1
- package/es/DatePicker/StringDateOnlyPickerGroup.d.ts +0 -9
- package/es/DatePicker/StringDateOnlyPickerGroup.js +0 -29
- package/es/DatePicker/StringDatePickerGroup.d.ts +0 -9
- package/es/DatePicker/StringDatePickerGroup.js +0 -24
- package/es/Field/CustomFieldInputProps.d.ts +0 -7
- package/es/Field/CustomFieldInputProps.js +0 -1
- package/es/Field/CustomFieldMetaProps.d.ts +0 -4
- package/es/Field/CustomFieldMetaProps.js +0 -1
- package/es/Field/Field.d.ts +0 -28
- package/es/Field/Field.js +0 -51
- package/es/Field/FieldErrorScrollTarget.d.ts +0 -2
- package/es/Field/FieldErrorScrollTarget.js +0 -12
- package/es/Field/FieldNameContext.d.ts +0 -3
- package/es/Field/FieldNameContext.js +0 -3
- package/es/Field/FieldSection.d.ts +0 -7
- package/es/Field/FieldSection.js +0 -9
- package/es/Field/InjectedFieldProps.d.ts +0 -7
- package/es/Field/InjectedFieldProps.js +0 -1
- package/es/Field/StandAloneInput.d.ts +0 -13
- package/es/Field/StandAloneInput.js +0 -50
- package/es/Field/useStandardField.d.ts +0 -21
- package/es/Field/useStandardField.js +0 -92
- package/es/FieldArray/FieldArray.d.ts +0 -24
- package/es/FieldArray/FieldArray.js +0 -77
- package/es/File/FileGroup.d.ts +0 -10
- package/es/File/FileGroup.js +0 -53
- package/es/File/FileList.d.ts +0 -5
- package/es/File/FileList.js +0 -10
- package/es/File/humanFileSize.d.ts +0 -1
- package/es/File/humanFileSize.js +0 -6
- package/es/Form/FocusError.d.ts +0 -7
- package/es/Form/FocusError.js +0 -42
- package/es/Form/Form.d.ts +0 -33
- package/es/Form/Form.js +0 -141
- package/es/Form/FormBasedPreventNavigation.d.ts +0 -6
- package/es/Form/FormBasedPreventNavigation.js +0 -20
- package/es/Form/LegacyFormBasedPreventNavigation.d.ts +0 -17
- package/es/Form/LegacyFormBasedPreventNavigation.js +0 -69
- package/es/Form/NewFormBasedPreventNavigation.d.ts +0 -14
- package/es/Form/NewFormBasedPreventNavigation.js +0 -39
- package/es/Form/ServerErrorContext.d.ts +0 -11
- package/es/Form/ServerErrorContext.js +0 -9
- package/es/FormActions.d.ts +0 -12
- package/es/FormActions.js +0 -16
- package/es/FormDefaults.d.ts +0 -4
- package/es/FormDefaults.js +0 -2
- package/es/Group.d.ts +0 -16
- package/es/Group.js +0 -14
- package/es/Input/IconInputGroup.d.ts +0 -12
- package/es/Input/IconInputGroup.js +0 -43
- package/es/Input/InputGroup.d.ts +0 -12
- package/es/Input/InputGroup.js +0 -34
- package/es/Input/MoneyInputGroup.d.ts +0 -9
- package/es/Input/MoneyInputGroup.js +0 -43
- package/es/Input/NumberInputGroup.d.ts +0 -9
- package/es/Input/NumberInputGroup.js +0 -43
- package/es/Input/PhoneNumberInputGroup.d.ts +0 -10
- package/es/Input/PhoneNumberInputGroup.js +0 -47
- package/es/Input/StringInputGroup.d.ts +0 -8
- package/es/Input/StringInputGroup.js +0 -43
- package/es/Normalization/NormalizationFunction.d.ts +0 -4
- package/es/Normalization/NormalizationFunction.js +0 -1
- package/es/Normalization/normalizers.d.ts +0 -4
- package/es/Normalization/normalizers.js +0 -32
- package/es/Select/BooleanSelectGroup.d.ts +0 -7
- package/es/Select/BooleanSelectGroup.js +0 -28
- package/es/Select/NumberSelectGroup.d.ts +0 -9
- package/es/Select/NumberSelectGroup.js +0 -21
- package/es/Select/SelectGroup.d.ts +0 -27
- package/es/Select/SelectGroup.js +0 -65
- package/es/Select/SelectGroupPropsHelper.d.ts +0 -3
- package/es/Select/SelectGroupPropsHelper.js +0 -1
- package/es/Select/StringSelectGroup.d.ts +0 -9
- package/es/Select/StringSelectGroup.js +0 -21
- package/es/StandardFormActions.d.ts +0 -11
- package/es/StandardFormActions.js +0 -14
- package/es/SubmitFormButton.d.ts +0 -10
- package/es/SubmitFormButton.js +0 -40
- package/es/TextArea/TextAreaGroup.d.ts +0 -9
- package/es/TextArea/TextAreaGroup.js +0 -35
- package/es/Validation/ValidatedApiResult.d.ts +0 -6
- package/es/Validation/ValidatedApiResult.js +0 -1
- package/es/Validation/ValidationError.d.ts +0 -5
- package/es/Validation/ValidationError.js +0 -1
- package/es/Validation/ValidationFunction.d.ts +0 -4
- package/es/Validation/ValidationFunction.js +0 -1
- package/es/Validation/validators.d.ts +0 -18
- package/es/Validation/validators.js +0 -77
- package/es/index.d.ts +0 -75
- package/es/index.js +0 -51
- package/es/setupTests.d.ts +0 -1
- package/es/setupTests.js +0 -1
- package/es/utils/objectContainsNonSerializableProperty.d.ts +0 -1
- package/es/utils/objectContainsNonSerializableProperty.js +0 -14
- package/es/utils/objectToFormData.d.ts +0 -10
- package/es/utils/objectToFormData.js +0 -77
- package/es/utils/typeChecks.d.ts +0 -8
- package/es/utils/typeChecks.js +0 -18
- package/lib/AddressInput/AddressInput.d.ts +0 -24
- package/lib/AddressInput/AddressInput.js +0 -26
- package/lib/AddressInput/UsStates.d.ts +0 -3
- package/lib/AddressInput/UsStates.js +0 -55
- package/lib/ConfirmBaseForm/ConfirmBaseForm.d.ts +0 -26
- package/lib/ConfirmBaseForm/ConfirmBaseForm.js +0 -48
- package/lib/ConfirmDeleteForm/ConfirmDeleteForm.d.ts +0 -24
- package/lib/ConfirmDeleteForm/ConfirmDeleteForm.js +0 -66
- package/lib/DatePicker/DatePickerGroup.d.ts +0 -13
- package/lib/DatePicker/DatePickerGroup.js +0 -95
- package/lib/DatePicker/DatePickerHelper.d.ts +0 -3
- package/lib/DatePicker/DatePickerHelper.js +0 -2
- package/lib/DatePicker/StringDateOnlyPickerGroup.d.ts +0 -9
- package/lib/DatePicker/StringDateOnlyPickerGroup.js +0 -35
- package/lib/DatePicker/StringDatePickerGroup.d.ts +0 -9
- package/lib/DatePicker/StringDatePickerGroup.js +0 -30
- package/lib/Field/CustomFieldInputProps.d.ts +0 -7
- package/lib/Field/CustomFieldInputProps.js +0 -2
- package/lib/Field/CustomFieldMetaProps.d.ts +0 -4
- package/lib/Field/CustomFieldMetaProps.js +0 -2
- package/lib/Field/Field.d.ts +0 -28
- package/lib/Field/Field.js +0 -56
- package/lib/Field/FieldErrorScrollTarget.d.ts +0 -2
- package/lib/Field/FieldErrorScrollTarget.js +0 -15
- package/lib/Field/FieldNameContext.d.ts +0 -3
- package/lib/Field/FieldNameContext.js +0 -9
- package/lib/Field/FieldSection.d.ts +0 -7
- package/lib/Field/FieldSection.js +0 -12
- package/lib/Field/InjectedFieldProps.d.ts +0 -7
- package/lib/Field/InjectedFieldProps.js +0 -2
- package/lib/Field/StandAloneInput.d.ts +0 -13
- package/lib/Field/StandAloneInput.js +0 -76
- package/lib/Field/useStandardField.d.ts +0 -21
- package/lib/Field/useStandardField.js +0 -95
- package/lib/FieldArray/FieldArray.d.ts +0 -24
- package/lib/FieldArray/FieldArray.js +0 -83
- package/lib/File/FileGroup.d.ts +0 -10
- package/lib/File/FileGroup.js +0 -58
- package/lib/File/FileList.d.ts +0 -5
- package/lib/File/FileList.js +0 -13
- package/lib/File/humanFileSize.d.ts +0 -1
- package/lib/File/humanFileSize.js +0 -10
- package/lib/Form/FocusError.d.ts +0 -7
- package/lib/Form/FocusError.js +0 -48
- package/lib/Form/Form.d.ts +0 -33
- package/lib/Form/Form.js +0 -147
- package/lib/Form/FormBasedPreventNavigation.d.ts +0 -6
- package/lib/Form/FormBasedPreventNavigation.js +0 -26
- package/lib/Form/LegacyFormBasedPreventNavigation.d.ts +0 -17
- package/lib/Form/LegacyFormBasedPreventNavigation.js +0 -72
- package/lib/Form/NewFormBasedPreventNavigation.d.ts +0 -14
- package/lib/Form/NewFormBasedPreventNavigation.js +0 -42
- package/lib/Form/ServerErrorContext.d.ts +0 -11
- package/lib/Form/ServerErrorContext.js +0 -15
- package/lib/FormActions.d.ts +0 -12
- package/lib/FormActions.js +0 -22
- package/lib/FormDefaults.d.ts +0 -4
- package/lib/FormDefaults.js +0 -5
- package/lib/Group.d.ts +0 -16
- package/lib/Group.js +0 -20
- package/lib/Input/IconInputGroup.d.ts +0 -12
- package/lib/Input/IconInputGroup.js +0 -48
- package/lib/Input/InputGroup.d.ts +0 -12
- package/lib/Input/InputGroup.js +0 -39
- package/lib/Input/MoneyInputGroup.d.ts +0 -9
- package/lib/Input/MoneyInputGroup.js +0 -48
- package/lib/Input/NumberInputGroup.d.ts +0 -9
- package/lib/Input/NumberInputGroup.js +0 -48
- package/lib/Input/PhoneNumberInputGroup.d.ts +0 -10
- package/lib/Input/PhoneNumberInputGroup.js +0 -52
- package/lib/Input/StringInputGroup.d.ts +0 -8
- package/lib/Input/StringInputGroup.js +0 -48
- package/lib/Normalization/NormalizationFunction.d.ts +0 -4
- package/lib/Normalization/NormalizationFunction.js +0 -2
- package/lib/Normalization/normalizers.d.ts +0 -4
- package/lib/Normalization/normalizers.js +0 -37
- package/lib/Select/BooleanSelectGroup.d.ts +0 -7
- package/lib/Select/BooleanSelectGroup.js +0 -35
- package/lib/Select/NumberSelectGroup.d.ts +0 -9
- package/lib/Select/NumberSelectGroup.js +0 -29
- package/lib/Select/SelectGroup.d.ts +0 -27
- package/lib/Select/SelectGroup.js +0 -71
- package/lib/Select/SelectGroupPropsHelper.d.ts +0 -3
- package/lib/Select/SelectGroupPropsHelper.js +0 -2
- package/lib/Select/StringSelectGroup.d.ts +0 -9
- package/lib/Select/StringSelectGroup.js +0 -29
- package/lib/StandardFormActions.d.ts +0 -11
- package/lib/StandardFormActions.js +0 -20
- package/lib/SubmitFormButton.d.ts +0 -10
- package/lib/SubmitFormButton.js +0 -45
- package/lib/TextArea/TextAreaGroup.d.ts +0 -9
- package/lib/TextArea/TextAreaGroup.js +0 -40
- package/lib/Validation/ValidatedApiResult.d.ts +0 -6
- package/lib/Validation/ValidatedApiResult.js +0 -2
- package/lib/Validation/ValidationError.d.ts +0 -5
- package/lib/Validation/ValidationError.js +0 -2
- package/lib/Validation/ValidationFunction.d.ts +0 -4
- package/lib/Validation/ValidationFunction.js +0 -2
- package/lib/Validation/validators.d.ts +0 -18
- package/lib/Validation/validators.js +0 -90
- package/lib/index.d.ts +0 -75
- package/lib/index.js +0 -119
- package/lib/setupTests.d.ts +0 -1
- package/lib/setupTests.js +0 -3
- package/lib/utils/objectContainsNonSerializableProperty.d.ts +0 -1
- package/lib/utils/objectContainsNonSerializableProperty.js +0 -17
- package/lib/utils/objectToFormData.d.ts +0 -10
- package/lib/utils/objectToFormData.js +0 -79
- package/lib/utils/typeChecks.d.ts +0 -8
- package/lib/utils/typeChecks.js +0 -29
- package/src/AddressInput/AddressInput.test.tsx +0 -27
- package/src/AddressInput/AddressInput.tsx +0 -82
- package/src/AddressInput/UsStates.ts +0 -55
- package/src/AddressInput/__snapshots__/AddressInput.test.tsx.snap +0 -182
- package/src/ConfirmBaseForm/ConfirmBaseForm.test.tsx +0 -24
- package/src/ConfirmBaseForm/ConfirmBaseForm.tsx +0 -74
- package/src/ConfirmBaseForm/__snapshots__/ConfirmBaseForm.test.tsx.snap +0 -23
- package/src/ConfirmDeleteForm/ConfirmDeleteForm.test.tsx +0 -24
- package/src/ConfirmDeleteForm/ConfirmDeleteForm.tsx +0 -87
- package/src/ConfirmDeleteForm/__snapshots__/ConfirmDeleteForm.test.tsx.snap +0 -25
- package/src/DatePicker/DatePicker.test.tsx +0 -48
- package/src/DatePicker/DatePickerGroup.tsx +0 -115
- package/src/DatePicker/DatePickerHelper.ts +0 -4
- package/src/DatePicker/StringDateOnlyPickerGroup.tsx +0 -28
- package/src/DatePicker/StringDatePickerGroup.tsx +0 -20
- package/src/DatePicker/__snapshots__/DatePicker.test.tsx.snap +0 -152
- package/src/Field/CustomFieldInputProps.ts +0 -10
- package/src/Field/CustomFieldMetaProps.ts +0 -5
- package/src/Field/Field.tsx +0 -113
- package/src/Field/FieldErrorScrollTarget.tsx +0 -12
- package/src/Field/FieldNameContext.ts +0 -6
- package/src/Field/FieldSection.tsx +0 -18
- package/src/Field/InjectedFieldProps.ts +0 -8
- package/src/Field/StandAloneInput.tsx +0 -55
- package/src/Field/useStandardField.ts +0 -125
- package/src/FieldArray/FieldArray.tsx +0 -154
- package/src/File/FileGroup.test.tsx +0 -35
- package/src/File/FileGroup.tsx +0 -85
- package/src/File/FileList.tsx +0 -21
- package/src/File/__snapshots__/FileGroup.test.tsx.snap +0 -34
- package/src/File/humanFileSize.ts +0 -8
- package/src/Form/FocusError.tsx +0 -55
- package/src/Form/Form.test.tsx +0 -14
- package/src/Form/Form.tsx +0 -237
- package/src/Form/FormBasedPreventNavigation.tsx +0 -56
- package/src/Form/LegacyFormBasedPreventNavigation.tsx +0 -77
- package/src/Form/NewFormBasedPreventNavigation.tsx +0 -59
- package/src/Form/ServerErrorContext.ts +0 -18
- package/src/Form/__snapshots__/Form.test.tsx.snap +0 -10
- package/src/FormActions.tsx +0 -47
- package/src/FormDefaults.ts +0 -2
- package/src/Group.tsx +0 -62
- package/src/Input/IconInputGroup.tsx +0 -54
- package/src/Input/InputGroup.tsx +0 -72
- package/src/Input/MoneyInputGroup.tsx +0 -50
- package/src/Input/NumberInputGroup.tsx +0 -48
- package/src/Input/PhoneNumberInputGroup.tsx +0 -45
- package/src/Input/StringInputGroup.tsx +0 -53
- package/src/Input/__Tests__/IconInputGroup.test.tsx +0 -35
- package/src/Input/__Tests__/MoneyInputGroup.test.tsx +0 -37
- package/src/Input/__Tests__/NumberInputGroup.test.tsx +0 -35
- package/src/Input/__Tests__/PhoneNumberInputGroup.test.tsx +0 -36
- package/src/Input/__Tests__/StringInputGroup.test.tsx +0 -27
- package/src/Input/__Tests__/__snapshots__/IconInputGroup.test.tsx.snap +0 -32
- package/src/Input/__Tests__/__snapshots__/MoneyInputGroup.test.tsx.snap +0 -34
- package/src/Input/__Tests__/__snapshots__/NumberInputGroup.test.tsx.snap +0 -32
- package/src/Input/__Tests__/__snapshots__/PhoneNumberInputGroup.test.tsx.snap +0 -33
- package/src/Input/__Tests__/__snapshots__/StringInputGroup.test.tsx.snap +0 -31
- package/src/Normalization/NormalizationFunction.ts +0 -4
- package/src/Normalization/normalizers.ts +0 -44
- package/src/Select/BooleanSelectGroup.tsx +0 -28
- package/src/Select/NumberSelectGroup.tsx +0 -16
- package/src/Select/SelectGroup.tsx +0 -124
- package/src/Select/SelectGroupPropsHelper.ts +0 -4
- package/src/Select/StringSelectGroup.tsx +0 -16
- package/src/Select/__tests__/BooleanSelectGroup.test.tsx +0 -35
- package/src/Select/__tests__/NumberSelectGroup.test.tsx +0 -87
- package/src/Select/__tests__/StringSelectGroup.test.tsx +0 -89
- package/src/Select/__tests__/__snapshots__/BooleanSelectGroup.test.tsx.snap +0 -98
- package/src/Select/__tests__/__snapshots__/NumberSelectGroup.test.tsx.snap +0 -195
- package/src/Select/__tests__/__snapshots__/StringSelectGroup.test.tsx.snap +0 -195
- package/src/StandardFormActions.tsx +0 -41
- package/src/SubmitFormButton.tsx +0 -54
- package/src/TextArea/TextAreaGroup.tsx +0 -64
- package/src/Validation/ValidatedApiResult.ts +0 -8
- package/src/Validation/ValidationError.ts +0 -6
- package/src/Validation/ValidationFunction.ts +0 -4
- package/src/Validation/validators.test.tsx +0 -81
- package/src/Validation/validators.ts +0 -97
- package/src/__Tests__/FormTestBase.tsx +0 -64
- package/src/__Tests__/RealisticForm.test.tsx +0 -82
- package/src/__Tests__/StandardFormActions.test.tsx +0 -17
- package/src/__Tests__/SubmitFormButton.test.tsx +0 -17
- package/src/__Tests__/__snapshots__/StandardFormActions.test.tsx.snap +0 -27
- package/src/__Tests__/__snapshots__/SubmitFormButton.test.tsx.snap +0 -20
- package/src/__Tests__/index.ts +0 -3
- package/src/_variables.scss +0 -11
- package/src/index.ts +0 -153
- package/src/react-app-env.d.ts +0 -1
- package/src/setupTests.ts +0 -1
- package/src/styles.scss +0 -0
- package/src/utils/objectContainsNonSerializableProperty.test.tsx +0 -49
- package/src/utils/objectContainsNonSerializableProperty.ts +0 -17
- package/src/utils/objectToFormData.test.tsx +0 -76
- package/src/utils/objectToFormData.ts +0 -105
- package/src/utils/typeChecks.ts +0 -18
package/lib/index.js
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
27
|
-
};
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
30
|
-
};
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
32
|
-
exports.validators = exports.serialize = exports.objectContainsNonSerializableProperty = exports.TextAreaGroup = exports.SingleStringSelectGroup = exports.MultiStringSelectGroup = exports.SingleNumberSelectGroup = exports.MultiNumberSelectGroup = exports.BooleanSelectGroup = exports.SelectGroup = exports.normalizers = exports.StringInputGroup = exports.PhoneNumberInputGroup = exports.NumberInputGroup = exports.MoneyInputGroup = exports.InputGroup = exports.IconInputGroup = exports.Group = exports.FormDefaults = exports.StandardFormActions = exports.FormActions = exports.ServerErrorContext = exports.Form = exports.FileGroup = exports.FieldArray = exports.useStandardField = exports.StandAloneInput = exports.FieldNameContext = exports.FieldErrorScrollTarget = exports.Field = exports.StringDateOnlyPickerGroup = exports.StringDatePickerGroup = exports.convertToTimeZoneInsensitiveISOString = exports.DatePickerGroup = exports.ConfirmDeleteForm = exports.ConfirmBaseForm = exports.SubmitFormButton = exports.AddressInput = void 0;
|
33
|
-
// Address
|
34
|
-
var AddressInput_1 = require("./AddressInput/AddressInput");
|
35
|
-
Object.defineProperty(exports, "AddressInput", { enumerable: true, get: function () { return __importDefault(AddressInput_1).default; } });
|
36
|
-
// Button
|
37
|
-
var SubmitFormButton_1 = require("./SubmitFormButton");
|
38
|
-
Object.defineProperty(exports, "SubmitFormButton", { enumerable: true, get: function () { return __importDefault(SubmitFormButton_1).default; } });
|
39
|
-
// ConfirmBaseForm
|
40
|
-
var ConfirmBaseForm_1 = require("./ConfirmBaseForm/ConfirmBaseForm");
|
41
|
-
Object.defineProperty(exports, "ConfirmBaseForm", { enumerable: true, get: function () { return __importDefault(ConfirmBaseForm_1).default; } });
|
42
|
-
// ConfirmDeleteForm
|
43
|
-
var ConfirmDeleteForm_1 = require("./ConfirmDeleteForm/ConfirmDeleteForm");
|
44
|
-
Object.defineProperty(exports, "ConfirmDeleteForm", { enumerable: true, get: function () { return __importDefault(ConfirmDeleteForm_1).default; } });
|
45
|
-
// Date
|
46
|
-
var DatePickerGroup_1 = require("./DatePicker/DatePickerGroup");
|
47
|
-
Object.defineProperty(exports, "DatePickerGroup", { enumerable: true, get: function () { return __importDefault(DatePickerGroup_1).default; } });
|
48
|
-
var DatePickerGroup_2 = require("./DatePicker/DatePickerGroup");
|
49
|
-
Object.defineProperty(exports, "convertToTimeZoneInsensitiveISOString", { enumerable: true, get: function () { return DatePickerGroup_2.convertToTimeZoneInsensitiveISOString; } });
|
50
|
-
var StringDatePickerGroup_1 = require("./DatePicker/StringDatePickerGroup");
|
51
|
-
Object.defineProperty(exports, "StringDatePickerGroup", { enumerable: true, get: function () { return __importDefault(StringDatePickerGroup_1).default; } });
|
52
|
-
var StringDateOnlyPickerGroup_1 = require("./DatePicker/StringDateOnlyPickerGroup");
|
53
|
-
Object.defineProperty(exports, "StringDateOnlyPickerGroup", { enumerable: true, get: function () { return __importDefault(StringDateOnlyPickerGroup_1).default; } });
|
54
|
-
// Field
|
55
|
-
var Field_1 = require("./Field/Field");
|
56
|
-
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return __importDefault(Field_1).default; } });
|
57
|
-
var FieldErrorScrollTarget_1 = require("./Field/FieldErrorScrollTarget");
|
58
|
-
Object.defineProperty(exports, "FieldErrorScrollTarget", { enumerable: true, get: function () { return __importDefault(FieldErrorScrollTarget_1).default; } });
|
59
|
-
var FieldNameContext_1 = require("./Field/FieldNameContext");
|
60
|
-
Object.defineProperty(exports, "FieldNameContext", { enumerable: true, get: function () { return FieldNameContext_1.FieldNameContext; } });
|
61
|
-
var StandAloneInput_1 = require("./Field/StandAloneInput");
|
62
|
-
Object.defineProperty(exports, "StandAloneInput", { enumerable: true, get: function () { return __importDefault(StandAloneInput_1).default; } });
|
63
|
-
var useStandardField_1 = require("./Field/useStandardField");
|
64
|
-
Object.defineProperty(exports, "useStandardField", { enumerable: true, get: function () { return __importDefault(useStandardField_1).default; } });
|
65
|
-
// Field Array
|
66
|
-
var FieldArray_1 = require("./FieldArray/FieldArray");
|
67
|
-
Object.defineProperty(exports, "FieldArray", { enumerable: true, get: function () { return __importDefault(FieldArray_1).default; } });
|
68
|
-
// File
|
69
|
-
var FileGroup_1 = require("./File/FileGroup");
|
70
|
-
Object.defineProperty(exports, "FileGroup", { enumerable: true, get: function () { return __importDefault(FileGroup_1).default; } });
|
71
|
-
// Form
|
72
|
-
var Form_1 = require("./Form/Form");
|
73
|
-
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return __importDefault(Form_1).default; } });
|
74
|
-
var ServerErrorContext_1 = require("./Form/ServerErrorContext");
|
75
|
-
Object.defineProperty(exports, "ServerErrorContext", { enumerable: true, get: function () { return ServerErrorContext_1.ServerErrorContext; } });
|
76
|
-
var FormActions_1 = require("./FormActions");
|
77
|
-
Object.defineProperty(exports, "FormActions", { enumerable: true, get: function () { return __importDefault(FormActions_1).default; } });
|
78
|
-
var StandardFormActions_1 = require("./StandardFormActions");
|
79
|
-
Object.defineProperty(exports, "StandardFormActions", { enumerable: true, get: function () { return __importDefault(StandardFormActions_1).default; } });
|
80
|
-
// FormDefaults
|
81
|
-
var FormDefaults_1 = require("./FormDefaults");
|
82
|
-
Object.defineProperty(exports, "FormDefaults", { enumerable: true, get: function () { return FormDefaults_1.FormDefaults; } });
|
83
|
-
// Input
|
84
|
-
var Group_1 = require("./Group");
|
85
|
-
Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return __importDefault(Group_1).default; } });
|
86
|
-
var IconInputGroup_1 = require("./Input/IconInputGroup");
|
87
|
-
Object.defineProperty(exports, "IconInputGroup", { enumerable: true, get: function () { return __importDefault(IconInputGroup_1).default; } });
|
88
|
-
var InputGroup_1 = require("./Input/InputGroup");
|
89
|
-
Object.defineProperty(exports, "InputGroup", { enumerable: true, get: function () { return __importDefault(InputGroup_1).default; } });
|
90
|
-
var MoneyInputGroup_1 = require("./Input/MoneyInputGroup");
|
91
|
-
Object.defineProperty(exports, "MoneyInputGroup", { enumerable: true, get: function () { return __importDefault(MoneyInputGroup_1).default; } });
|
92
|
-
var NumberInputGroup_1 = require("./Input/NumberInputGroup");
|
93
|
-
Object.defineProperty(exports, "NumberInputGroup", { enumerable: true, get: function () { return __importDefault(NumberInputGroup_1).default; } });
|
94
|
-
var PhoneNumberInputGroup_1 = require("./Input/PhoneNumberInputGroup");
|
95
|
-
Object.defineProperty(exports, "PhoneNumberInputGroup", { enumerable: true, get: function () { return __importDefault(PhoneNumberInputGroup_1).default; } });
|
96
|
-
var StringInputGroup_1 = require("./Input/StringInputGroup");
|
97
|
-
Object.defineProperty(exports, "StringInputGroup", { enumerable: true, get: function () { return __importDefault(StringInputGroup_1).default; } });
|
98
|
-
exports.normalizers = __importStar(require("./Normalization/normalizers"));
|
99
|
-
// Select
|
100
|
-
var SelectGroup_1 = require("./Select/SelectGroup");
|
101
|
-
Object.defineProperty(exports, "SelectGroup", { enumerable: true, get: function () { return __importDefault(SelectGroup_1).default; } });
|
102
|
-
var BooleanSelectGroup_1 = require("./Select/BooleanSelectGroup");
|
103
|
-
Object.defineProperty(exports, "BooleanSelectGroup", { enumerable: true, get: function () { return BooleanSelectGroup_1.BooleanSelectGroup; } });
|
104
|
-
var NumberSelectGroup_1 = require("./Select/NumberSelectGroup");
|
105
|
-
Object.defineProperty(exports, "MultiNumberSelectGroup", { enumerable: true, get: function () { return NumberSelectGroup_1.MultiNumberSelectGroup; } });
|
106
|
-
Object.defineProperty(exports, "SingleNumberSelectGroup", { enumerable: true, get: function () { return NumberSelectGroup_1.SingleNumberSelectGroup; } });
|
107
|
-
var StringSelectGroup_1 = require("./Select/StringSelectGroup");
|
108
|
-
Object.defineProperty(exports, "MultiStringSelectGroup", { enumerable: true, get: function () { return StringSelectGroup_1.MultiStringSelectGroup; } });
|
109
|
-
Object.defineProperty(exports, "SingleStringSelectGroup", { enumerable: true, get: function () { return StringSelectGroup_1.SingleStringSelectGroup; } });
|
110
|
-
// Text Area
|
111
|
-
var TextAreaGroup_1 = require("./TextArea/TextAreaGroup");
|
112
|
-
Object.defineProperty(exports, "TextAreaGroup", { enumerable: true, get: function () { return __importDefault(TextAreaGroup_1).default; } });
|
113
|
-
// Utils
|
114
|
-
var objectContainsNonSerializableProperty_1 = require("./utils/objectContainsNonSerializableProperty");
|
115
|
-
Object.defineProperty(exports, "objectContainsNonSerializableProperty", { enumerable: true, get: function () { return __importDefault(objectContainsNonSerializableProperty_1).default; } });
|
116
|
-
var objectToFormData_1 = require("./utils/objectToFormData");
|
117
|
-
Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return __importDefault(objectToFormData_1).default; } });
|
118
|
-
__exportStar(require("./utils/typeChecks"), exports);
|
119
|
-
exports.validators = __importStar(require("./Validation/validators"));
|
package/lib/setupTests.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
package/lib/setupTests.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export default function objectContainsNonSerializableProperty(object: any): boolean;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var typeChecks_1 = require("./typeChecks");
|
4
|
-
function objectContainsNonSerializableProperty(object) {
|
5
|
-
return Object.entries(object).some(function (value) {
|
6
|
-
if (value) {
|
7
|
-
if ((0, typeChecks_1.isBlob)(value[1]) || (0, typeChecks_1.isFile)(value[1])) {
|
8
|
-
return true;
|
9
|
-
}
|
10
|
-
if ((0, typeChecks_1.isObject)(value[1])) {
|
11
|
-
return objectContainsNonSerializableProperty(value[1]);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
return false;
|
15
|
-
});
|
16
|
-
}
|
17
|
-
exports.default = objectContainsNonSerializableProperty;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export interface ObjectToFormDataCfgProps {
|
2
|
-
indices: boolean;
|
3
|
-
dotNotation: boolean;
|
4
|
-
allowEmptyArrays: boolean;
|
5
|
-
noFileListBrackets: boolean;
|
6
|
-
nullsAsUndefineds?: boolean;
|
7
|
-
booleansAsIntegers?: boolean;
|
8
|
-
}
|
9
|
-
declare const serialize: (obj: any, cfg: ObjectToFormDataCfgProps, fd?: FormData, pre?: string) => FormData;
|
10
|
-
export default serialize;
|
@@ -1,79 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
// Original: https://github.com/therealparmesh/object-to-formdata/blob/master/src/index.js
|
4
|
-
// With Multiple Form File Fix: https://github.com/therealparmesh/object-to-formdata/pull/94/files
|
5
|
-
var typeChecks_1 = require("./typeChecks");
|
6
|
-
// 'pre' is not provided until this function recursively calls itself when 'obj' is an array or object
|
7
|
-
var serialize = function (obj, cfg, fd, pre) {
|
8
|
-
cfg = cfg || {};
|
9
|
-
cfg.indices = (0, typeChecks_1.isUndefined)(cfg.indices) ? false : cfg.indices;
|
10
|
-
cfg.nullsAsUndefineds = (0, typeChecks_1.isUndefined)(cfg.nullsAsUndefineds)
|
11
|
-
? false
|
12
|
-
: cfg.nullsAsUndefineds;
|
13
|
-
cfg.booleansAsIntegers = (0, typeChecks_1.isUndefined)(cfg.booleansAsIntegers)
|
14
|
-
? false
|
15
|
-
: cfg.booleansAsIntegers;
|
16
|
-
cfg.allowEmptyArrays = (0, typeChecks_1.isUndefined)(cfg.allowEmptyArrays)
|
17
|
-
? false
|
18
|
-
: cfg.allowEmptyArrays;
|
19
|
-
//reverse of normal because we want a different default
|
20
|
-
cfg.dotNotation = (0, typeChecks_1.isUndefined)(cfg.dotNotation) ? true : cfg.dotNotation;
|
21
|
-
fd = fd || new FormData();
|
22
|
-
if ((0, typeChecks_1.isUndefined)(obj)) {
|
23
|
-
return fd;
|
24
|
-
}
|
25
|
-
else if ((0, typeChecks_1.isNull)(obj) && !!pre) {
|
26
|
-
if (!cfg.nullsAsUndefineds) {
|
27
|
-
fd.append(pre, '');
|
28
|
-
}
|
29
|
-
}
|
30
|
-
else if ((0, typeChecks_1.isBoolean)(obj) && !!pre) {
|
31
|
-
if (cfg.booleansAsIntegers) {
|
32
|
-
fd.append(pre, obj ? '1' : '0');
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
fd.append(pre, obj);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
else if ((0, typeChecks_1.isDate)(obj) && !!pre) {
|
39
|
-
fd.append(pre, obj.toISOString());
|
40
|
-
}
|
41
|
-
else if ((0, typeChecks_1.isArray)(obj)) {
|
42
|
-
if (obj.length) {
|
43
|
-
obj.forEach(function (value, index) {
|
44
|
-
var key;
|
45
|
-
if (cfg.noFileListBrackets && (0, typeChecks_1.isFile)(value)) {
|
46
|
-
key = pre;
|
47
|
-
}
|
48
|
-
else {
|
49
|
-
key = pre + '[' + (cfg.indices ? index : '') + ']';
|
50
|
-
}
|
51
|
-
serialize(value, cfg, fd, key);
|
52
|
-
});
|
53
|
-
}
|
54
|
-
else if (cfg.allowEmptyArrays) {
|
55
|
-
fd.append(pre + '[]', '');
|
56
|
-
}
|
57
|
-
}
|
58
|
-
else if ((0, typeChecks_1.isObject)(obj) && !(0, typeChecks_1.isFile)(obj) && !(0, typeChecks_1.isBlob)(obj)) {
|
59
|
-
Object.keys(obj).forEach(function (prop) {
|
60
|
-
var value = obj[prop];
|
61
|
-
if ((0, typeChecks_1.isArray)(value)) {
|
62
|
-
while (prop.length > 2 && prop.lastIndexOf('[]') === prop.length - 2) {
|
63
|
-
prop = prop.substring(0, prop.length - 2);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
var key = pre
|
67
|
-
? cfg.dotNotation
|
68
|
-
? pre + '.' + prop
|
69
|
-
: pre + '[' + prop + ']'
|
70
|
-
: prop;
|
71
|
-
serialize(value, cfg, fd, key);
|
72
|
-
});
|
73
|
-
}
|
74
|
-
else if (!!pre) {
|
75
|
-
fd.append(pre, obj);
|
76
|
-
}
|
77
|
-
return fd;
|
78
|
-
};
|
79
|
-
exports.default = serialize;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export declare const isUndefined: (value: any) => boolean;
|
2
|
-
export declare const isNull: (value: any) => boolean;
|
3
|
-
export declare const isBoolean: (value: any) => boolean;
|
4
|
-
export declare const isObject: (value: any) => boolean;
|
5
|
-
export declare const isArray: (value: any) => boolean;
|
6
|
-
export declare const isDate: (value: any) => boolean;
|
7
|
-
export declare const isBlob: (value: any) => any;
|
8
|
-
export declare const isFile: (value: any) => any;
|
package/lib/utils/typeChecks.js
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.isFile = exports.isBlob = exports.isDate = exports.isArray = exports.isObject = exports.isBoolean = exports.isNull = exports.isUndefined = void 0;
|
4
|
-
var isUndefined = function (value) { return value === undefined; };
|
5
|
-
exports.isUndefined = isUndefined;
|
6
|
-
var isNull = function (value) { return value === null; };
|
7
|
-
exports.isNull = isNull;
|
8
|
-
var isBoolean = function (value) { return typeof value === 'boolean'; };
|
9
|
-
exports.isBoolean = isBoolean;
|
10
|
-
var isObject = function (value) { return value === Object(value); };
|
11
|
-
exports.isObject = isObject;
|
12
|
-
var isArray = function (value) { return Array.isArray(value); };
|
13
|
-
exports.isArray = isArray;
|
14
|
-
var isDate = function (value) { return value instanceof Date; };
|
15
|
-
exports.isDate = isDate;
|
16
|
-
var isBlob = function (value) {
|
17
|
-
return value &&
|
18
|
-
typeof value.size === 'number' &&
|
19
|
-
typeof value.type === 'string' &&
|
20
|
-
typeof value.slice === 'function';
|
21
|
-
};
|
22
|
-
exports.isBlob = isBlob;
|
23
|
-
var isFile = function (value) {
|
24
|
-
return (0, exports.isBlob)(value) &&
|
25
|
-
typeof value.name === 'string' &&
|
26
|
-
(typeof value.lastModifiedDate === 'object' ||
|
27
|
-
typeof value.lastModified === 'number');
|
28
|
-
};
|
29
|
-
exports.isFile = isFile;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render } from '@testing-library/react';
|
3
|
-
import AddressInput from './AddressInput';
|
4
|
-
import FormTestBase from '../__Tests__/FormTestBase';
|
5
|
-
|
6
|
-
describe('AddressInput', () => {
|
7
|
-
it('renders without crashing', () => {
|
8
|
-
render(
|
9
|
-
<FormTestBase>
|
10
|
-
{({ Field }) => (
|
11
|
-
<AddressInput fieldBuilder={{ Field }} name="normalAddressInput" />
|
12
|
-
)}
|
13
|
-
</FormTestBase>
|
14
|
-
);
|
15
|
-
});
|
16
|
-
|
17
|
-
it('has matching snapshot', () => {
|
18
|
-
const renderResult = render(
|
19
|
-
<FormTestBase>
|
20
|
-
{({ Field }) => (
|
21
|
-
<AddressInput fieldBuilder={{ Field }} name="normalAddressInput" />
|
22
|
-
)}
|
23
|
-
</FormTestBase>
|
24
|
-
);
|
25
|
-
expect(renderResult.asFragment()).toMatchSnapshot();
|
26
|
-
});
|
27
|
-
});
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import UsStates from './UsStates';
|
2
|
-
import { SingleStringSelectGroup, StringInputGroup } from '../';
|
3
|
-
import FieldSection from '../Field/FieldSection';
|
4
|
-
import { FormBuilderProp } from '../Form/Form';
|
5
|
-
import { zipCode as zipCodeNormalizer } from '../Normalization/normalizers';
|
6
|
-
import {
|
7
|
-
required,
|
8
|
-
zipCode as zipCodeValidator,
|
9
|
-
} from '../Validation/validators';
|
10
|
-
|
11
|
-
// TODO: find a permanent home for these interfaces
|
12
|
-
// TODO: but also, maybe they are comfortable here?
|
13
|
-
export interface AddressInputProps {
|
14
|
-
fieldBuilder: Pick<FormBuilderProp<AddressDto>, 'Field'>;
|
15
|
-
name: string;
|
16
|
-
}
|
17
|
-
|
18
|
-
interface AddressDto {
|
19
|
-
address1?: string | null;
|
20
|
-
address2?: string | null;
|
21
|
-
zipCode?: string | null;
|
22
|
-
city?: string | null;
|
23
|
-
state?: string | null;
|
24
|
-
}
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Collection of `<Field/>`s for inputting an address. Includes:
|
28
|
-
* ```txt
|
29
|
-
* Address 1
|
30
|
-
* Address 2
|
31
|
-
* City
|
32
|
-
* State
|
33
|
-
* Zip
|
34
|
-
* ```
|
35
|
-
*/
|
36
|
-
export default function AddressInput({
|
37
|
-
fieldBuilder: { Field },
|
38
|
-
name,
|
39
|
-
}: AddressInputProps) {
|
40
|
-
return (
|
41
|
-
<>
|
42
|
-
<FieldSection name={name}>
|
43
|
-
<Field
|
44
|
-
name="address1"
|
45
|
-
placeholder="Address, Line 1"
|
46
|
-
label="Address 1"
|
47
|
-
Component={StringInputGroup}
|
48
|
-
validate={required}
|
49
|
-
/>
|
50
|
-
<Field
|
51
|
-
name="address2"
|
52
|
-
placeholder="Address, Line 2"
|
53
|
-
label="Address 2"
|
54
|
-
Component={StringInputGroup}
|
55
|
-
/>
|
56
|
-
<Field
|
57
|
-
name="city"
|
58
|
-
placeholder="City"
|
59
|
-
label="City"
|
60
|
-
Component={StringInputGroup}
|
61
|
-
validate={required}
|
62
|
-
/>
|
63
|
-
<Field
|
64
|
-
name="state"
|
65
|
-
placeholder="State"
|
66
|
-
label="State"
|
67
|
-
Component={SingleStringSelectGroup}
|
68
|
-
options={UsStates}
|
69
|
-
validate={required}
|
70
|
-
/>
|
71
|
-
<Field
|
72
|
-
name="zipCode"
|
73
|
-
placeholder="Zip"
|
74
|
-
label="Zip"
|
75
|
-
Component={StringInputGroup}
|
76
|
-
normalize={zipCodeNormalizer}
|
77
|
-
validate={[required, zipCodeValidator]}
|
78
|
-
/>
|
79
|
-
</FieldSection>
|
80
|
-
</>
|
81
|
-
);
|
82
|
-
}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { SelectOption } from '../Select/SelectGroup';
|
2
|
-
|
3
|
-
const states: SelectOption<string>[] = [
|
4
|
-
{ label: 'Alabama', value: 'AL' },
|
5
|
-
{ label: 'Alaska', value: 'AK' },
|
6
|
-
{ label: 'Arizona', value: 'AZ' },
|
7
|
-
{ label: 'Arkansas', value: 'AR' },
|
8
|
-
{ label: 'California', value: 'CA' },
|
9
|
-
{ label: 'Colorado', value: 'CO' },
|
10
|
-
{ label: 'Connecticut', value: 'CT' },
|
11
|
-
{ label: 'Delaware', value: 'DE' },
|
12
|
-
{ label: 'Florida', value: 'FL' },
|
13
|
-
{ label: 'Georgia', value: 'GA' },
|
14
|
-
{ label: 'Hawaii', value: 'HI' },
|
15
|
-
{ label: 'Idaho', value: 'ID' },
|
16
|
-
{ label: 'Illinois', value: 'IL' },
|
17
|
-
{ label: 'Indiana', value: 'IN' },
|
18
|
-
{ label: 'Iowa', value: 'IA' },
|
19
|
-
{ label: 'Kansas', value: 'KS' },
|
20
|
-
{ label: 'Kentucky', value: 'KY' },
|
21
|
-
{ label: 'Louisiana', value: 'LA' },
|
22
|
-
{ label: 'Maine', value: 'ME' },
|
23
|
-
{ label: 'Maryland', value: 'MD' },
|
24
|
-
{ label: 'Massachusetts', value: 'MA' },
|
25
|
-
{ label: 'Michigan', value: 'MI' },
|
26
|
-
{ label: 'Minnesota', value: 'MN' },
|
27
|
-
{ label: 'Mississippi', value: 'MS' },
|
28
|
-
{ label: 'Missouri', value: 'MO' },
|
29
|
-
{ label: 'Montana', value: 'MT' },
|
30
|
-
{ label: 'Nebraska', value: 'NE' },
|
31
|
-
{ label: 'Nevada', value: 'NV' },
|
32
|
-
{ label: 'New Hampshire', value: 'NH' },
|
33
|
-
{ label: 'New Jersey', value: 'NJ' },
|
34
|
-
{ label: 'New Mexico', value: 'NM' },
|
35
|
-
{ label: 'New York', value: 'NY' },
|
36
|
-
{ label: 'North Carolina', value: 'NC' },
|
37
|
-
{ label: 'North Dakota', value: 'ND' },
|
38
|
-
{ label: 'Ohio', value: 'OH' },
|
39
|
-
{ label: 'Oklahoma', value: 'OK' },
|
40
|
-
{ label: 'Oregon', value: 'OR' },
|
41
|
-
{ label: 'Pennsylvania', value: 'PA' },
|
42
|
-
{ label: 'Rhode Island', value: 'RI' },
|
43
|
-
{ label: 'South Carolina', value: 'SC' },
|
44
|
-
{ label: 'South Dakota', value: 'SD' },
|
45
|
-
{ label: 'Tennessee', value: 'TN' },
|
46
|
-
{ label: 'Texas', value: 'TX' },
|
47
|
-
{ label: 'Utah', value: 'UT' },
|
48
|
-
{ label: 'Vermont', value: 'VT' },
|
49
|
-
{ label: 'Virginia', value: 'VA' },
|
50
|
-
{ label: 'Washington', value: 'WA' },
|
51
|
-
{ label: 'West Virginia', value: 'WV' },
|
52
|
-
{ label: 'Wisconsin', value: 'WI' },
|
53
|
-
{ label: 'Wyoming', value: 'WY' },
|
54
|
-
];
|
55
|
-
export default states;
|
@@ -1,182 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`AddressInput has matching snapshot 1`] = `
|
4
|
-
<DocumentFragment>
|
5
|
-
<form
|
6
|
-
action="#"
|
7
|
-
class="envoc-form-form"
|
8
|
-
>
|
9
|
-
<div
|
10
|
-
class="envoc-form-string-group envoc-form-input-group envoc-form-group envoc-form-required"
|
11
|
-
>
|
12
|
-
<div
|
13
|
-
id="normaladdressinput.address1-error-scroll-target"
|
14
|
-
style="display: none;"
|
15
|
-
/>
|
16
|
-
<label
|
17
|
-
for="normalAddressInput.address1"
|
18
|
-
>
|
19
|
-
Address 1
|
20
|
-
</label>
|
21
|
-
<input
|
22
|
-
aria-invalid="false"
|
23
|
-
class="envoc-form-string-group envoc-form-input-group"
|
24
|
-
id="normalAddressInput.address1"
|
25
|
-
name="normalAddressInput.address1"
|
26
|
-
placeholder="Address, Line 1"
|
27
|
-
value=""
|
28
|
-
/>
|
29
|
-
</div>
|
30
|
-
<div
|
31
|
-
class="envoc-form-string-group envoc-form-input-group envoc-form-group"
|
32
|
-
>
|
33
|
-
<div
|
34
|
-
id="normaladdressinput.address2-error-scroll-target"
|
35
|
-
style="display: none;"
|
36
|
-
/>
|
37
|
-
<label
|
38
|
-
for="normalAddressInput.address2"
|
39
|
-
>
|
40
|
-
Address 2
|
41
|
-
</label>
|
42
|
-
<input
|
43
|
-
aria-invalid="false"
|
44
|
-
class="envoc-form-string-group envoc-form-input-group"
|
45
|
-
id="normalAddressInput.address2"
|
46
|
-
name="normalAddressInput.address2"
|
47
|
-
placeholder="Address, Line 2"
|
48
|
-
value=""
|
49
|
-
/>
|
50
|
-
</div>
|
51
|
-
<div
|
52
|
-
class="envoc-form-string-group envoc-form-input-group envoc-form-group envoc-form-required"
|
53
|
-
>
|
54
|
-
<div
|
55
|
-
id="normaladdressinput.city-error-scroll-target"
|
56
|
-
style="display: none;"
|
57
|
-
/>
|
58
|
-
<label
|
59
|
-
for="normalAddressInput.city"
|
60
|
-
>
|
61
|
-
City
|
62
|
-
</label>
|
63
|
-
<input
|
64
|
-
aria-invalid="false"
|
65
|
-
class="envoc-form-string-group envoc-form-input-group"
|
66
|
-
id="normalAddressInput.city"
|
67
|
-
name="normalAddressInput.city"
|
68
|
-
placeholder="City"
|
69
|
-
value=""
|
70
|
-
/>
|
71
|
-
</div>
|
72
|
-
<div
|
73
|
-
class="envoc-form-select-group envoc-form-group envoc-form-required"
|
74
|
-
>
|
75
|
-
<div
|
76
|
-
id="normaladdressinput.state-error-scroll-target"
|
77
|
-
style="display: none;"
|
78
|
-
/>
|
79
|
-
<label
|
80
|
-
for="normalAddressInput.state"
|
81
|
-
>
|
82
|
-
State
|
83
|
-
</label>
|
84
|
-
<div
|
85
|
-
class="envoc-form-select-group css-b62m3t-container"
|
86
|
-
>
|
87
|
-
<span
|
88
|
-
class="css-1f43avz-a11yText-A11yText"
|
89
|
-
id="react-select-3-live-region"
|
90
|
-
/>
|
91
|
-
<span
|
92
|
-
aria-atomic="false"
|
93
|
-
aria-live="polite"
|
94
|
-
aria-relevant="additions text"
|
95
|
-
class="css-1f43avz-a11yText-A11yText"
|
96
|
-
/>
|
97
|
-
<div
|
98
|
-
class="react-select__control css-13cymwt-control"
|
99
|
-
>
|
100
|
-
<div
|
101
|
-
class="react-select__value-container css-16674sh-Component"
|
102
|
-
>
|
103
|
-
<div
|
104
|
-
class="react-select__placeholder css-1jqq78o-placeholder"
|
105
|
-
id="react-select-3-placeholder"
|
106
|
-
>
|
107
|
-
State
|
108
|
-
</div>
|
109
|
-
<div
|
110
|
-
class="react-select__input-container css-d9r47t-Component"
|
111
|
-
data-value=""
|
112
|
-
>
|
113
|
-
<input
|
114
|
-
aria-autocomplete="list"
|
115
|
-
aria-describedby="react-select-3-placeholder"
|
116
|
-
aria-expanded="false"
|
117
|
-
aria-haspopup="true"
|
118
|
-
autocapitalize="none"
|
119
|
-
autocomplete="off"
|
120
|
-
autocorrect="off"
|
121
|
-
class="react-select__input"
|
122
|
-
id="normalAddressInput.state"
|
123
|
-
role="combobox"
|
124
|
-
spellcheck="false"
|
125
|
-
style="opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;"
|
126
|
-
tabindex="0"
|
127
|
-
type="text"
|
128
|
-
value=""
|
129
|
-
/>
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
<div
|
133
|
-
class="react-select__indicators css-ny0e4k-Component"
|
134
|
-
>
|
135
|
-
<span
|
136
|
-
class="react-select__indicator-separator css-1u9des2-indicatorSeparator"
|
137
|
-
/>
|
138
|
-
<div
|
139
|
-
aria-hidden="true"
|
140
|
-
class="react-select__indicator react-select__dropdown-indicator css-1xc3v61-indicatorContainer"
|
141
|
-
>
|
142
|
-
<svg
|
143
|
-
aria-hidden="true"
|
144
|
-
class="css-tj5bde-Svg"
|
145
|
-
focusable="false"
|
146
|
-
height="20"
|
147
|
-
viewBox="0 0 20 20"
|
148
|
-
width="20"
|
149
|
-
>
|
150
|
-
<path
|
151
|
-
d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
|
152
|
-
/>
|
153
|
-
</svg>
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
</div>
|
157
|
-
</div>
|
158
|
-
</div>
|
159
|
-
<div
|
160
|
-
class="envoc-form-string-group envoc-form-input-group envoc-form-group envoc-form-required"
|
161
|
-
>
|
162
|
-
<div
|
163
|
-
id="normaladdressinput.zipcode-error-scroll-target"
|
164
|
-
style="display: none;"
|
165
|
-
/>
|
166
|
-
<label
|
167
|
-
for="normalAddressInput.zipCode"
|
168
|
-
>
|
169
|
-
Zip
|
170
|
-
</label>
|
171
|
-
<input
|
172
|
-
aria-invalid="false"
|
173
|
-
class="envoc-form-string-group envoc-form-input-group"
|
174
|
-
id="normalAddressInput.zipCode"
|
175
|
-
name="normalAddressInput.zipCode"
|
176
|
-
placeholder="Zip"
|
177
|
-
value=""
|
178
|
-
/>
|
179
|
-
</div>
|
180
|
-
</form>
|
181
|
-
</DocumentFragment>
|
182
|
-
`;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render } from '@testing-library/react';
|
3
|
-
import { useAxiosRequestProps } from 'envoc-request';
|
4
|
-
import ConfirmBaseForm from './ConfirmBaseForm';
|
5
|
-
|
6
|
-
describe('ConfirmBaseForm', () => {
|
7
|
-
it('Renders without error', () => {
|
8
|
-
render(<ConfirmBaseForm request={confirmBaseFormRequest} />);
|
9
|
-
});
|
10
|
-
|
11
|
-
it('has matching snapshot', () => {
|
12
|
-
const renderResult = render(
|
13
|
-
<ConfirmBaseForm request={confirmBaseFormRequest} />
|
14
|
-
);
|
15
|
-
expect(renderResult.asFragment()).toMatchSnapshot();
|
16
|
-
});
|
17
|
-
});
|
18
|
-
|
19
|
-
const confirmBaseFormRequest = {
|
20
|
-
method: 'get',
|
21
|
-
url: `/boop`,
|
22
|
-
onComplete: () => {},
|
23
|
-
onError: () => {},
|
24
|
-
} as useAxiosRequestProps;
|