@panneau/form-inline 3.0.223 → 3.0.226
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/package.json +10 -7
- package/lib/index.js +0 -68
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/form-inline",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.226",
|
4
4
|
"description": "Inline form",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -33,8 +33,11 @@
|
|
33
33
|
}
|
34
34
|
],
|
35
35
|
"license": "ISC",
|
36
|
-
"
|
36
|
+
"type": "module",
|
37
37
|
"module": "es/index.js",
|
38
|
+
"exports": {
|
39
|
+
".": "./es/index.js"
|
40
|
+
},
|
38
41
|
"files": [
|
39
42
|
"lib",
|
40
43
|
"es",
|
@@ -54,10 +57,10 @@
|
|
54
57
|
},
|
55
58
|
"dependencies": {
|
56
59
|
"@babel/runtime": "^7.12.5",
|
57
|
-
"@panneau/core": "^3.0.
|
58
|
-
"@panneau/element-button": "^3.0.
|
59
|
-
"@panneau/element-form": "^3.0.
|
60
|
-
"@panneau/field-fields": "^3.0.
|
60
|
+
"@panneau/core": "^3.0.224",
|
61
|
+
"@panneau/element-button": "^3.0.226",
|
62
|
+
"@panneau/element-form": "^3.0.226",
|
63
|
+
"@panneau/field-fields": "^3.0.226",
|
61
64
|
"classnames": "^2.5.1",
|
62
65
|
"lodash": "^4.17.21",
|
63
66
|
"prop-types": "^15.7.2",
|
@@ -66,5 +69,5 @@
|
|
66
69
|
"publishConfig": {
|
67
70
|
"access": "public"
|
68
71
|
},
|
69
|
-
"gitHead": "
|
72
|
+
"gitHead": "9615a4d3021e9ad9b15be01e998dd6f366f8f705"
|
70
73
|
}
|
package/lib/index.js
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
6
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
7
|
-
var React = require('react');
|
8
|
-
var PropTypes = require('prop-types');
|
9
|
-
var core = require('@panneau/core');
|
10
|
-
var Form = require('@panneau/element-form');
|
11
|
-
var contexts = require('@panneau/core/contexts');
|
12
|
-
|
13
|
-
var _excluded = ["fields", "status", "value", "onChange", "className", "onSubmit"];
|
14
|
-
var propTypes = {
|
15
|
-
fields: core.PropTypes.fields.isRequired,
|
16
|
-
value: PropTypes.object,
|
17
|
-
// eslint-disable-line react/forbid-prop-types
|
18
|
-
onChange: PropTypes.func.isRequired,
|
19
|
-
onSubmit: PropTypes.func,
|
20
|
-
status: core.PropTypes.formStatus,
|
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
|
29
|
-
})),
|
30
|
-
className: PropTypes.string
|
31
|
-
};
|
32
|
-
var defaultProps = {
|
33
|
-
status: null,
|
34
|
-
value: null,
|
35
|
-
onSubmit: null,
|
36
|
-
generalError: null,
|
37
|
-
errors: null,
|
38
|
-
buttons: null,
|
39
|
-
className: null
|
40
|
-
};
|
41
|
-
var InlineForm = function InlineForm(_ref) {
|
42
|
-
var fields = _ref.fields,
|
43
|
-
status = _ref.status,
|
44
|
-
value = _ref.value,
|
45
|
-
onChange = _ref.onChange,
|
46
|
-
className = _ref.className,
|
47
|
-
onSubmit = _ref.onSubmit,
|
48
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
49
|
-
var FieldsComponent = contexts.useFieldComponent('fields');
|
50
|
-
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
51
|
-
onSubmit: onSubmit,
|
52
|
-
className: className,
|
53
|
-
status: status
|
54
|
-
}, props), /*#__PURE__*/React.createElement(FieldsComponent, {
|
55
|
-
fields: fields.map(function (f) {
|
56
|
-
return _objectSpread(_objectSpread({}, f), {}, {
|
57
|
-
inline: true
|
58
|
-
});
|
59
|
-
}),
|
60
|
-
value: value,
|
61
|
-
onChange: onChange
|
62
|
-
}));
|
63
|
-
};
|
64
|
-
InlineForm.propTypes = propTypes;
|
65
|
-
InlineForm.defaultProps = defaultProps;
|
66
|
-
var Inline = InlineForm;
|
67
|
-
|
68
|
-
exports.default = Inline;
|