envoc-form 2.0.1-12 → 2.0.1-13
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/es/FormInputArray/FormInputArray.js +10 -5
- package/es/ReactSelectField/ReactSelectField.js +3 -1
- package/lib/FormInputArray/FormInputArray.js +11 -5
- package/lib/ReactSelectField/ReactSelectField.js +3 -1
- package/package.json +6 -3
- package/src/FormInputArray/FormInputArray.js +7 -2
- package/src/FormInputArray/__snapshots__/FormInputArray.test.js.snap +15 -3
- package/src/ReactSelectField/ReactSelectField.js +2 -0
- package/CHANGELOG.json +0 -95
- package/CHANGELOG.md +0 -58
@@ -18,9 +18,12 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
19
19
|
import classnames from 'classnames';
|
20
20
|
import { Col, Card, Button, CardBody, Row, Alert } from 'reactstrap';
|
21
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
22
|
+
import { faPlus, faTrash } from '@fortawesome/free-solid-svg-icons';
|
21
23
|
import PropTypes from 'prop-types';
|
22
24
|
import useStandardFormInput from '../useStandardFormInput';
|
23
25
|
import NestedFormFieldContext from '../NestedFormFieldContext';
|
26
|
+
import classNames from 'classnames';
|
24
27
|
export default function FormInputArray(_ref) {
|
25
28
|
var id = _ref.id,
|
26
29
|
name = _ref.name,
|
@@ -71,8 +74,8 @@ export default function FormInputArray(_ref) {
|
|
71
74
|
onClick: addItem,
|
72
75
|
title: "Add an additional item",
|
73
76
|
className: "add-array-item"
|
74
|
-
}, /*#__PURE__*/React.createElement(
|
75
|
-
|
77
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
78
|
+
icon: faPlus
|
76
79
|
}), " Add New"))), /*#__PURE__*/React.createElement(CardBody, null, meta.error && typeof meta.error === 'string' && /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(Alert, {
|
77
80
|
className: "field-array-alert",
|
78
81
|
color: "danger"
|
@@ -92,11 +95,13 @@ export default function FormInputArray(_ref) {
|
|
92
95
|
role: "listitem"
|
93
96
|
}, /*#__PURE__*/React.createElement(NestedFormFieldContext.Provider, {
|
94
97
|
value: itemName
|
98
|
+
}, /*#__PURE__*/React.createElement("div", {
|
99
|
+
className: "component"
|
95
100
|
}, /*#__PURE__*/React.createElement(Component, _extends({
|
96
101
|
value: value,
|
97
102
|
name: itemName,
|
98
103
|
disabled: disabled
|
99
|
-
}, props))), !disabled && /*#__PURE__*/React.createElement("div", {
|
104
|
+
}, props)))), !disabled && /*#__PURE__*/React.createElement("div", {
|
100
105
|
className: "remove-array-item"
|
101
106
|
}, /*#__PURE__*/React.createElement(Button, {
|
102
107
|
color: "link",
|
@@ -104,8 +109,8 @@ export default function FormInputArray(_ref) {
|
|
104
109
|
return removeItem(index);
|
105
110
|
},
|
106
111
|
title: "Remove Item"
|
107
|
-
}, /*#__PURE__*/React.createElement(
|
108
|
-
|
112
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
113
|
+
icon: faTrash
|
109
114
|
}))));
|
110
115
|
})));
|
111
116
|
|
@@ -73,7 +73,9 @@ export default function ReactSelectInput(_ref2) {
|
|
73
73
|
onChange: handleChange,
|
74
74
|
className: "react-select-input",
|
75
75
|
theme: overrideTheme,
|
76
|
-
styles: customStyles
|
76
|
+
styles: customStyles,
|
77
|
+
menuPortalTarget: document.body,
|
78
|
+
menuPlacement: "auto"
|
77
79
|
}));
|
78
80
|
|
79
81
|
function getOptionValue(option) {
|
@@ -27,6 +27,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
27
27
|
|
28
28
|
var _reactstrap = require("reactstrap");
|
29
29
|
|
30
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
31
|
+
|
32
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
33
|
+
|
30
34
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
31
35
|
|
32
36
|
var _useStandardFormInput3 = _interopRequireDefault(require("../useStandardFormInput"));
|
@@ -98,8 +102,8 @@ function FormInputArray(_ref) {
|
|
98
102
|
onClick: addItem,
|
99
103
|
title: "Add an additional item",
|
100
104
|
className: "add-array-item"
|
101
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
102
|
-
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactFontawesome.FontAwesomeIcon, {
|
106
|
+
icon: _freeSolidSvgIcons.faPlus
|
103
107
|
}), " Add New"))), /*#__PURE__*/_react["default"].createElement(_reactstrap.CardBody, null, meta.error && typeof meta.error === 'string' && /*#__PURE__*/_react["default"].createElement(_reactstrap.Row, null, /*#__PURE__*/_react["default"].createElement(_reactstrap.Col, null, /*#__PURE__*/_react["default"].createElement(_reactstrap.Alert, {
|
104
108
|
className: "field-array-alert",
|
105
109
|
color: "danger"
|
@@ -119,11 +123,13 @@ function FormInputArray(_ref) {
|
|
119
123
|
role: "listitem"
|
120
124
|
}, /*#__PURE__*/_react["default"].createElement(_NestedFormFieldContext["default"].Provider, {
|
121
125
|
value: itemName
|
126
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
127
|
+
className: "component"
|
122
128
|
}, /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
|
123
129
|
value: value,
|
124
130
|
name: itemName,
|
125
131
|
disabled: disabled
|
126
|
-
}, props))), !disabled && /*#__PURE__*/_react["default"].createElement("div", {
|
132
|
+
}, props)))), !disabled && /*#__PURE__*/_react["default"].createElement("div", {
|
127
133
|
className: "remove-array-item"
|
128
134
|
}, /*#__PURE__*/_react["default"].createElement(_reactstrap.Button, {
|
129
135
|
color: "link",
|
@@ -131,8 +137,8 @@ function FormInputArray(_ref) {
|
|
131
137
|
return removeItem(index);
|
132
138
|
},
|
133
139
|
title: "Remove Item"
|
134
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
135
|
-
|
140
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactFontawesome.FontAwesomeIcon, {
|
141
|
+
icon: _freeSolidSvgIcons.faTrash
|
136
142
|
}))));
|
137
143
|
})));
|
138
144
|
|
@@ -97,7 +97,9 @@ function ReactSelectInput(_ref2) {
|
|
97
97
|
onChange: handleChange,
|
98
98
|
className: "react-select-input",
|
99
99
|
theme: overrideTheme,
|
100
|
-
styles: customStyles
|
100
|
+
styles: customStyles,
|
101
|
+
menuPortalTarget: document.body,
|
102
|
+
menuPlacement: "auto"
|
101
103
|
}));
|
102
104
|
|
103
105
|
function getOptionValue(option) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "envoc-form",
|
3
|
-
"version": "2.0.1-
|
3
|
+
"version": "2.0.1-13",
|
4
4
|
"description": "Envoc form components",
|
5
5
|
"keywords": [
|
6
6
|
"react-component",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"axios": "^0.21.1",
|
38
38
|
"classnames": "^2.3.1",
|
39
39
|
"date-fns": "^2.22.1",
|
40
|
-
"envoc-request": "^2.0.1-
|
40
|
+
"envoc-request": "^2.0.1-13",
|
41
41
|
"lru-cache": "^6.0.0",
|
42
42
|
"prop-types": "^15.7.2",
|
43
43
|
"react-date-picker": "^8.2.0",
|
@@ -48,7 +48,10 @@
|
|
48
48
|
"react-toastify": "^7.0.4",
|
49
49
|
"reactstrap": "^8.9.0",
|
50
50
|
"smoothscroll-polyfill": "^0.4.4",
|
51
|
-
"uuid": "^8.3.2"
|
51
|
+
"uuid": "^8.3.2",
|
52
|
+
"@fortawesome/react-fontawesome": "~0.1.16",
|
53
|
+
"@fortawesome/free-solid-svg-icons": "~5.15.4",
|
54
|
+
"@fortawesome/fontawesome-svg-core": "~1.2.36"
|
52
55
|
},
|
53
56
|
"devDependencies": {
|
54
57
|
"@babel/cli": "^7.14.5",
|
@@ -2,9 +2,12 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
3
3
|
import classnames from 'classnames';
|
4
4
|
import { Col, Card, Button, CardBody, Row, Alert } from 'reactstrap';
|
5
|
+
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
|
6
|
+
import {faPlus, faTrash} from '@fortawesome/free-solid-svg-icons'
|
5
7
|
import PropTypes from 'prop-types';
|
6
8
|
import useStandardFormInput from '../useStandardFormInput';
|
7
9
|
import NestedFormFieldContext from '../NestedFormFieldContext';
|
10
|
+
import classNames from 'classnames';
|
8
11
|
|
9
12
|
export default function FormInputArray({
|
10
13
|
id,
|
@@ -54,7 +57,7 @@ export default function FormInputArray({
|
|
54
57
|
onClick={addItem}
|
55
58
|
title="Add an additional item"
|
56
59
|
className="add-array-item">
|
57
|
-
<
|
60
|
+
<FontAwesomeIcon icon={faPlus} /> Add New
|
58
61
|
</Button>
|
59
62
|
)}
|
60
63
|
</CardActionHeader.Actions>
|
@@ -90,12 +93,14 @@ export default function FormInputArray({
|
|
90
93
|
})}
|
91
94
|
role="listitem">
|
92
95
|
<NestedFormFieldContext.Provider value={itemName}>
|
96
|
+
<div className="component">
|
93
97
|
<Component
|
94
98
|
value={value}
|
95
99
|
name={itemName}
|
96
100
|
disabled={disabled}
|
97
101
|
{...props}
|
98
102
|
/>
|
103
|
+
</div>
|
99
104
|
</NestedFormFieldContext.Provider>
|
100
105
|
{!disabled && (
|
101
106
|
<div className="remove-array-item">
|
@@ -103,7 +108,7 @@ export default function FormInputArray({
|
|
103
108
|
color="link"
|
104
109
|
onClick={() => removeItem(index)}
|
105
110
|
title="Remove Item">
|
106
|
-
|
111
|
+
<FontAwesomeIcon icon={faTrash} />
|
107
112
|
</Button>
|
108
113
|
</div>
|
109
114
|
)}
|
@@ -24,9 +24,21 @@ exports[`FormInputArray has matching snapshot 1`] = `
|
|
24
24
|
title="Add an additional item"
|
25
25
|
type="button"
|
26
26
|
>
|
27
|
-
<
|
28
|
-
|
29
|
-
|
27
|
+
<svg
|
28
|
+
aria-hidden="true"
|
29
|
+
class="svg-inline--fa fa-plus fa-w-14 "
|
30
|
+
data-icon="plus"
|
31
|
+
data-prefix="fas"
|
32
|
+
focusable="false"
|
33
|
+
role="img"
|
34
|
+
viewBox="0 0 448 512"
|
35
|
+
xmlns="http://www.w3.org/2000/svg"
|
36
|
+
>
|
37
|
+
<path
|
38
|
+
d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"
|
39
|
+
fill="currentColor"
|
40
|
+
/>
|
41
|
+
</svg>
|
30
42
|
Add New
|
31
43
|
</button>
|
32
44
|
</div>
|
package/CHANGELOG.json
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "envoc-form",
|
3
|
-
"entries": [
|
4
|
-
{
|
5
|
-
"version": "2.0.0",
|
6
|
-
"tag": "envoc-form_v2.0.0",
|
7
|
-
"date": "Fri, 11 Sep 2020 16:49:17 GMT",
|
8
|
-
"comments": {}
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"version": "1.3.1",
|
12
|
-
"tag": "envoc-form_v1.3.1",
|
13
|
-
"date": "Fri, 04 Sep 2020 19:35:20 GMT",
|
14
|
-
"comments": {}
|
15
|
-
},
|
16
|
-
{
|
17
|
-
"version": "1.3.0",
|
18
|
-
"tag": "envoc-form_v1.3.0",
|
19
|
-
"date": "Tue, 01 Sep 2020 16:02:23 GMT",
|
20
|
-
"comments": {}
|
21
|
-
},
|
22
|
-
{
|
23
|
-
"version": "1.2.0",
|
24
|
-
"tag": "envoc-form_v1.2.0",
|
25
|
-
"date": "Mon, 31 Aug 2020 20:33:06 GMT",
|
26
|
-
"comments": {
|
27
|
-
"none": [
|
28
|
-
{
|
29
|
-
"comment": "readme change"
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"comment": "Resolves issues with scss not being included, provides support for tree-shaking, adds jest testing"
|
33
|
-
},
|
34
|
-
{
|
35
|
-
"comment": " Prerelease"
|
36
|
-
},
|
37
|
-
{
|
38
|
-
"comment": "Fixes missing destructed prop on ConfirmBaseForm and adds some tests"
|
39
|
-
},
|
40
|
-
{
|
41
|
-
"comment": "build script changes"
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"comment": "Fix issues with validators export"
|
45
|
-
},
|
46
|
-
{
|
47
|
-
"comment": "fixes normalizers"
|
48
|
-
}
|
49
|
-
]
|
50
|
-
}
|
51
|
-
},
|
52
|
-
{
|
53
|
-
"version": "1.1.26",
|
54
|
-
"tag": "envoc-form_v1.1.26",
|
55
|
-
"date": "Mon, 13 Jul 2020 16:17:47 GMT",
|
56
|
-
"comments": {}
|
57
|
-
},
|
58
|
-
{
|
59
|
-
"version": "1.1.25",
|
60
|
-
"tag": "envoc-form_v1.1.25",
|
61
|
-
"date": "Fri, 10 Jul 2020 19:16:12 GMT",
|
62
|
-
"comments": {
|
63
|
-
"none": [
|
64
|
-
{
|
65
|
-
"comment": "Changing the 'sideEffects' to be false for better tree shaking"
|
66
|
-
}
|
67
|
-
]
|
68
|
-
}
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"version": "1.1.24",
|
72
|
-
"tag": "envoc-form_v1.1.24",
|
73
|
-
"date": "Fri, 10 Jul 2020 18:58:53 GMT",
|
74
|
-
"comments": {
|
75
|
-
"none": [
|
76
|
-
{
|
77
|
-
"comment": "Resolves issues with scss not being included, provides support for tree-shaking, adds jest testing"
|
78
|
-
}
|
79
|
-
]
|
80
|
-
}
|
81
|
-
},
|
82
|
-
{
|
83
|
-
"version": "1.1.23",
|
84
|
-
"tag": "envoc-form_v1.1.23",
|
85
|
-
"date": "Thu, 25 Jun 2020 19:05:11 GMT",
|
86
|
-
"comments": {
|
87
|
-
"none": [
|
88
|
-
{
|
89
|
-
"comment": "Initial envoc-form implementation"
|
90
|
-
}
|
91
|
-
]
|
92
|
-
}
|
93
|
-
}
|
94
|
-
]
|
95
|
-
}
|
package/CHANGELOG.md
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# Change Log - envoc-form
|
2
|
-
|
3
|
-
This log was last generated on Fri, 11 Sep 2020 16:49:17 GMT and should not be manually modified.
|
4
|
-
|
5
|
-
## 2.0.0
|
6
|
-
Fri, 11 Sep 2020 16:49:17 GMT
|
7
|
-
|
8
|
-
*Version update only*
|
9
|
-
|
10
|
-
## 1.3.1
|
11
|
-
Fri, 04 Sep 2020 19:35:20 GMT
|
12
|
-
|
13
|
-
*Version update only*
|
14
|
-
|
15
|
-
## 1.3.0
|
16
|
-
Tue, 01 Sep 2020 16:02:23 GMT
|
17
|
-
|
18
|
-
*Version update only*
|
19
|
-
|
20
|
-
## 1.2.0
|
21
|
-
Mon, 31 Aug 2020 20:33:06 GMT
|
22
|
-
|
23
|
-
### Updates
|
24
|
-
|
25
|
-
- readme change
|
26
|
-
- Resolves issues with scss not being included, provides support for tree-shaking, adds jest testing
|
27
|
-
- Prerelease
|
28
|
-
- Fixes missing destructed prop on ConfirmBaseForm and adds some tests
|
29
|
-
- build script changes
|
30
|
-
- Fix issues with validators export
|
31
|
-
- fixes normalizers
|
32
|
-
|
33
|
-
## 1.1.26
|
34
|
-
Mon, 13 Jul 2020 16:17:47 GMT
|
35
|
-
|
36
|
-
*Version update only*
|
37
|
-
|
38
|
-
## 1.1.25
|
39
|
-
Fri, 10 Jul 2020 19:16:12 GMT
|
40
|
-
|
41
|
-
### Updates
|
42
|
-
|
43
|
-
- Changing the 'sideEffects' to be false for better tree shaking
|
44
|
-
|
45
|
-
## 1.1.24
|
46
|
-
Fri, 10 Jul 2020 18:58:53 GMT
|
47
|
-
|
48
|
-
### Updates
|
49
|
-
|
50
|
-
- Resolves issues with scss not being included, provides support for tree-shaking, adds jest testing
|
51
|
-
|
52
|
-
## 1.1.23
|
53
|
-
Thu, 25 Jun 2020 19:05:11 GMT
|
54
|
-
|
55
|
-
### Updates
|
56
|
-
|
57
|
-
- Initial envoc-form implementation
|
58
|
-
|