@panneau/form-two-pane 1.0.0-y.0 → 1.0.3-alpha.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/es/index.js +1 -1
- package/lib/index.js +24 -22
- package/package.json +13 -13
package/es/index.js
CHANGED
package/lib/index.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
3
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
4
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
5
7
|
var React = require('react');
|
@@ -22,24 +24,24 @@ var styles = {};
|
|
22
24
|
|
23
25
|
var _excluded = ["fields", "status", "value", "setValue", "onSubmit", "buttons", "children", "className"];
|
24
26
|
var propTypes = {
|
25
|
-
fields: PropTypes__default[
|
26
|
-
value: PropTypes__default[
|
27
|
+
fields: PropTypes__default["default"].objectOf(PropTypes__default["default"].shape({})).isRequired,
|
28
|
+
value: PropTypes__default["default"].object,
|
27
29
|
// eslint-disable-line react/forbid-prop-types
|
28
|
-
setValue: PropTypes__default[
|
29
|
-
onChange: PropTypes__default[
|
30
|
-
onSubmit: PropTypes__default[
|
30
|
+
setValue: PropTypes__default["default"].func,
|
31
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
32
|
+
onSubmit: PropTypes__default["default"].func.isRequired,
|
31
33
|
status: core.PropTypes.formStatus,
|
32
|
-
generalError: PropTypes__default[
|
33
|
-
errors: PropTypes__default[
|
34
|
-
buttons: PropTypes__default[
|
35
|
-
type: PropTypes__default[
|
36
|
-
id: PropTypes__default[
|
37
|
-
label: PropTypes__default[
|
38
|
-
position: PropTypes__default[
|
39
|
-
onClick: PropTypes__default[
|
34
|
+
generalError: PropTypes__default["default"].string,
|
35
|
+
errors: PropTypes__default["default"].objectOf(PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)),
|
36
|
+
buttons: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
37
|
+
type: PropTypes__default["default"].oneOf(['submit', 'button', 'link', 'reset']),
|
38
|
+
id: PropTypes__default["default"].string,
|
39
|
+
label: PropTypes__default["default"].string,
|
40
|
+
position: PropTypes__default["default"].string,
|
41
|
+
onClick: PropTypes__default["default"].func
|
40
42
|
})),
|
41
|
-
children: PropTypes__default[
|
42
|
-
className: PropTypes__default[
|
43
|
+
children: PropTypes__default["default"].node,
|
44
|
+
className: PropTypes__default["default"].string
|
43
45
|
};
|
44
46
|
var defaultProps = {
|
45
47
|
status: null,
|
@@ -61,22 +63,22 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
61
63
|
buttons = _ref.buttons,
|
62
64
|
children = _ref.children,
|
63
65
|
className = _ref.className,
|
64
|
-
props = _objectWithoutProperties__default[
|
66
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
65
67
|
|
66
68
|
var FieldsComponent = contexts.useFieldComponent('fields');
|
67
69
|
var onChange = setValue || null;
|
68
|
-
return /*#__PURE__*/React__default[
|
70
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
69
71
|
className: "d-flex"
|
70
|
-
}, /*#__PURE__*/React__default[
|
71
|
-
className: classNames__default[
|
72
|
+
}, /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
|
73
|
+
className: classNames__default["default"]([styles.container, 'form', 'w-50', _defineProperty__default["default"]({}, className, className !== null)]),
|
72
74
|
status: status,
|
73
75
|
buttons: buttons,
|
74
76
|
onSubmit: onSubmit
|
75
|
-
}, props), /*#__PURE__*/React__default[
|
77
|
+
}, props), /*#__PURE__*/React__default["default"].createElement(FieldsComponent, {
|
76
78
|
fields: fields,
|
77
79
|
value: value,
|
78
80
|
onChange: onChange
|
79
|
-
})), /*#__PURE__*/React__default[
|
81
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
80
82
|
className: "w-50"
|
81
83
|
}, children));
|
82
84
|
};
|
@@ -84,4 +86,4 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
84
86
|
TwoPaneForm.propTypes = propTypes;
|
85
87
|
TwoPaneForm.defaultProps = defaultProps;
|
86
88
|
|
87
|
-
|
89
|
+
exports["default"] = TwoPaneForm;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/form-two-pane",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3-alpha.0",
|
4
4
|
"description": "Two-pane resource forms",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -44,28 +44,28 @@
|
|
44
44
|
"prepare": "../../scripts/prepare-package.sh"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
|
-
"react": "^16.8.0",
|
48
|
-
"react-dom": "^16.8.0"
|
47
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
48
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
51
|
-
"react": "^16.8.0",
|
52
|
-
"react-dom": "^16.8.0"
|
51
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
52
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
53
53
|
},
|
54
54
|
"dependencies": {
|
55
55
|
"@babel/runtime": "^7.12.5",
|
56
|
-
"@panneau/core": "^1.0.
|
57
|
-
"@panneau/data": "^1.0.
|
58
|
-
"@panneau/element-button": "^1.0.
|
59
|
-
"@panneau/element-form": "^1.0.
|
60
|
-
"@panneau/field-fields": "^1.0.
|
61
|
-
"@panneau/themes": "^1.0.
|
56
|
+
"@panneau/core": "^1.0.3-alpha.0",
|
57
|
+
"@panneau/data": "^1.0.3-alpha.0",
|
58
|
+
"@panneau/element-button": "^1.0.3-alpha.0",
|
59
|
+
"@panneau/element-form": "^1.0.3-alpha.0",
|
60
|
+
"@panneau/field-fields": "^1.0.3-alpha.0",
|
61
|
+
"@panneau/themes": "^1.0.3-alpha.0",
|
62
62
|
"classnames": "^2.2.6",
|
63
63
|
"lodash": "^4.17.21",
|
64
64
|
"prop-types": "^15.7.2",
|
65
|
-
"react-intl": "^5.15.8"
|
65
|
+
"react-intl": "^5.15.8||^6.0.0"
|
66
66
|
},
|
67
67
|
"publishConfig": {
|
68
68
|
"access": "public"
|
69
69
|
},
|
70
|
-
"gitHead": "
|
70
|
+
"gitHead": "7f9c472b97c79a5c81da30730549acdde2de5c9f"
|
71
71
|
}
|