@panneau/form-two-pane 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 +22 -31
- package/package.json +10 -9
package/lib/index.js
CHANGED
@@ -11,37 +11,28 @@ var core = require('@panneau/core');
|
|
11
11
|
var contexts = require('@panneau/core/contexts');
|
12
12
|
var Form = require('@panneau/element-form');
|
13
13
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
15
|
-
|
16
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
17
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
18
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
19
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
21
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
22
|
-
|
23
14
|
var styles = {};
|
24
15
|
|
25
16
|
var _excluded = ["fields", "status", "value", "setValue", "onSubmit", "buttons", "children", "className"];
|
26
17
|
var propTypes = {
|
27
|
-
fields:
|
28
|
-
value:
|
18
|
+
fields: PropTypes.objectOf(PropTypes.shape({})).isRequired,
|
19
|
+
value: PropTypes.object,
|
29
20
|
// eslint-disable-line react/forbid-prop-types
|
30
|
-
setValue:
|
31
|
-
onChange:
|
32
|
-
onSubmit:
|
21
|
+
setValue: PropTypes.func,
|
22
|
+
onChange: PropTypes.func.isRequired,
|
23
|
+
onSubmit: PropTypes.func.isRequired,
|
33
24
|
status: core.PropTypes.formStatus,
|
34
|
-
generalError:
|
35
|
-
errors:
|
36
|
-
buttons:
|
37
|
-
type:
|
38
|
-
id:
|
39
|
-
label:
|
40
|
-
position:
|
41
|
-
onClick:
|
25
|
+
generalError: PropTypes.string,
|
26
|
+
errors: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),
|
27
|
+
buttons: PropTypes.arrayOf(PropTypes.shape({
|
28
|
+
type: PropTypes.oneOf(['submit', 'button', 'link', 'reset']),
|
29
|
+
id: PropTypes.string,
|
30
|
+
label: PropTypes.string,
|
31
|
+
position: PropTypes.string,
|
32
|
+
onClick: PropTypes.func
|
42
33
|
})),
|
43
|
-
children:
|
44
|
-
className:
|
34
|
+
children: PropTypes.node,
|
35
|
+
className: PropTypes.string
|
45
36
|
};
|
46
37
|
var defaultProps = {
|
47
38
|
status: null,
|
@@ -62,21 +53,21 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
62
53
|
buttons = _ref.buttons,
|
63
54
|
children = _ref.children,
|
64
55
|
className = _ref.className,
|
65
|
-
props =
|
56
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
66
57
|
var FieldsComponent = contexts.useFieldComponent('fields');
|
67
58
|
var onChange = setValue || null;
|
68
|
-
return /*#__PURE__*/
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
69
60
|
className: "d-flex"
|
70
|
-
}, /*#__PURE__*/
|
71
|
-
className:
|
61
|
+
}, /*#__PURE__*/React.createElement(Form, Object.assign({
|
62
|
+
className: classNames([styles.container, 'form', 'w-50', _defineProperty({}, className, className !== null)]),
|
72
63
|
status: status,
|
73
64
|
buttons: buttons,
|
74
65
|
onSubmit: onSubmit
|
75
|
-
}, props), /*#__PURE__*/
|
66
|
+
}, props), /*#__PURE__*/React.createElement(FieldsComponent, {
|
76
67
|
fields: fields,
|
77
68
|
value: value,
|
78
69
|
onChange: onChange
|
79
|
-
})), /*#__PURE__*/
|
70
|
+
})), /*#__PURE__*/React.createElement("div", {
|
80
71
|
className: "w-50"
|
81
72
|
}, children));
|
82
73
|
};
|
@@ -84,4 +75,4 @@ TwoPaneForm.propTypes = propTypes;
|
|
84
75
|
TwoPaneForm.defaultProps = defaultProps;
|
85
76
|
var TwoPane = TwoPaneForm;
|
86
77
|
|
87
|
-
exports
|
78
|
+
exports.default = TwoPane;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/form-two-pane",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.126",
|
4
4
|
"description": "Two-pane resource forms",
|
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,12 +54,12 @@
|
|
53
54
|
},
|
54
55
|
"dependencies": {
|
55
56
|
"@babel/runtime": "^7.12.5",
|
56
|
-
"@panneau/core": "^3.0.
|
57
|
-
"@panneau/data": "^3.0.
|
58
|
-
"@panneau/element-button": "^3.0.
|
59
|
-
"@panneau/element-form": "^3.0.
|
60
|
-
"@panneau/field-fields": "^3.0.
|
61
|
-
"@panneau/themes": "^3.0.
|
57
|
+
"@panneau/core": "^3.0.126",
|
58
|
+
"@panneau/data": "^3.0.126",
|
59
|
+
"@panneau/element-button": "^3.0.126",
|
60
|
+
"@panneau/element-form": "^3.0.126",
|
61
|
+
"@panneau/field-fields": "^3.0.126",
|
62
|
+
"@panneau/themes": "^3.0.126",
|
62
63
|
"classnames": "^2.2.6",
|
63
64
|
"lodash": "^4.17.21",
|
64
65
|
"prop-types": "^15.7.2",
|
@@ -67,5 +68,5 @@
|
|
67
68
|
"publishConfig": {
|
68
69
|
"access": "public"
|
69
70
|
},
|
70
|
-
"gitHead": "
|
71
|
+
"gitHead": "fa69ddff3f8cf22b00504093087608d5701e6f6a"
|
71
72
|
}
|