@panneau/form-inline 3.0.119 → 3.0.126
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/lib/index.js +17 -25
- package/package.json +8 -7
package/lib/index.js
CHANGED
@@ -10,32 +10,24 @@ var core = require('@panneau/core');
|
|
10
10
|
var Form = require('@panneau/element-form');
|
11
11
|
var contexts = require('@panneau/core/contexts');
|
12
12
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
14
|
-
|
15
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
16
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
19
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
20
|
-
|
21
13
|
var _excluded = ["fields", "status", "value", "onChange", "className", "onSubmit"];
|
22
14
|
var propTypes = {
|
23
15
|
fields: core.PropTypes.fields.isRequired,
|
24
|
-
value:
|
16
|
+
value: PropTypes.object,
|
25
17
|
// eslint-disable-line react/forbid-prop-types
|
26
|
-
onChange:
|
27
|
-
onSubmit:
|
18
|
+
onChange: PropTypes.func.isRequired,
|
19
|
+
onSubmit: PropTypes.func,
|
28
20
|
status: core.PropTypes.formStatus,
|
29
|
-
generalError:
|
30
|
-
errors:
|
31
|
-
buttons:
|
32
|
-
type:
|
33
|
-
id:
|
34
|
-
label:
|
35
|
-
position:
|
36
|
-
onClick:
|
21
|
+
generalError: PropTypes.string,
|
22
|
+
errors: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),
|
23
|
+
buttons: PropTypes.arrayOf(PropTypes.shape({
|
24
|
+
type: PropTypes.oneOf(['submit', 'button', 'link', 'reset']),
|
25
|
+
id: PropTypes.string,
|
26
|
+
label: PropTypes.string,
|
27
|
+
position: PropTypes.string,
|
28
|
+
onClick: PropTypes.func
|
37
29
|
})),
|
38
|
-
className:
|
30
|
+
className: PropTypes.string
|
39
31
|
};
|
40
32
|
var defaultProps = {
|
41
33
|
status: null,
|
@@ -53,15 +45,15 @@ var InlineForm = function InlineForm(_ref) {
|
|
53
45
|
onChange = _ref.onChange,
|
54
46
|
className = _ref.className,
|
55
47
|
onSubmit = _ref.onSubmit,
|
56
|
-
props =
|
48
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
57
49
|
var FieldsComponent = contexts.useFieldComponent('fields');
|
58
|
-
return /*#__PURE__*/
|
50
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
59
51
|
onSubmit: onSubmit,
|
60
52
|
className: className,
|
61
53
|
status: status
|
62
|
-
}, props), /*#__PURE__*/
|
54
|
+
}, props), /*#__PURE__*/React.createElement(FieldsComponent, {
|
63
55
|
fields: fields.map(function (f) {
|
64
|
-
return
|
56
|
+
return _objectSpread(_objectSpread({}, f), {}, {
|
65
57
|
inline: true
|
66
58
|
});
|
67
59
|
}),
|
@@ -73,4 +65,4 @@ InlineForm.propTypes = propTypes;
|
|
73
65
|
InlineForm.defaultProps = defaultProps;
|
74
66
|
var Inline = InlineForm;
|
75
67
|
|
76
|
-
exports
|
68
|
+
exports.default = Inline;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/form-inline",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.126",
|
4
4
|
"description": "Inline form",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -41,7 +41,8 @@
|
|
41
41
|
"assets"
|
42
42
|
],
|
43
43
|
"scripts": {
|
44
|
-
"
|
44
|
+
"prepublishOnly": "npm run build",
|
45
|
+
"build": "../../scripts/prepare-package.sh"
|
45
46
|
},
|
46
47
|
"devDependencies": {
|
47
48
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
@@ -53,10 +54,10 @@
|
|
53
54
|
},
|
54
55
|
"dependencies": {
|
55
56
|
"@babel/runtime": "^7.12.5",
|
56
|
-
"@panneau/core": "^3.0.
|
57
|
-
"@panneau/element-button": "^3.0.
|
58
|
-
"@panneau/element-form": "^3.0.
|
59
|
-
"@panneau/field-fields": "^3.0.
|
57
|
+
"@panneau/core": "^3.0.126",
|
58
|
+
"@panneau/element-button": "^3.0.126",
|
59
|
+
"@panneau/element-form": "^3.0.126",
|
60
|
+
"@panneau/field-fields": "^3.0.126",
|
60
61
|
"classnames": "^2.2.6",
|
61
62
|
"lodash": "^4.17.21",
|
62
63
|
"prop-types": "^15.7.2",
|
@@ -65,5 +66,5 @@
|
|
65
66
|
"publishConfig": {
|
66
67
|
"access": "public"
|
67
68
|
},
|
68
|
-
"gitHead": "
|
69
|
+
"gitHead": "fa69ddff3f8cf22b00504093087608d5701e6f6a"
|
69
70
|
}
|