@panneau/form-two-pane 1.0.0-alpha.95 → 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 +3 -2
- package/lib/index.js +23 -22
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useFieldComponent } from '@panneau/core/contexts';
|
|
|
9
9
|
|
|
10
10
|
var styles = {};
|
|
11
11
|
|
|
12
|
+
var _excluded = ["fields", "status", "value", "setValue", "onSubmit", "buttons", "children", "className"];
|
|
12
13
|
var propTypes = {
|
|
13
14
|
fields: PropTypes.objectOf(PropTypes.shape({})).isRequired,
|
|
14
15
|
value: PropTypes.object,
|
|
@@ -49,7 +50,7 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
|
49
50
|
buttons = _ref.buttons,
|
|
50
51
|
children = _ref.children,
|
|
51
52
|
className = _ref.className,
|
|
52
|
-
props = _objectWithoutProperties(_ref,
|
|
53
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
54
|
|
|
54
55
|
var FieldsComponent = useFieldComponent('fields');
|
|
55
56
|
var onChange = setValue || null;
|
|
@@ -72,4 +73,4 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
|
72
73
|
TwoPaneForm.propTypes = propTypes;
|
|
73
74
|
TwoPaneForm.defaultProps = defaultProps;
|
|
74
75
|
|
|
75
|
-
export default
|
|
76
|
+
export { TwoPaneForm as default };
|
package/lib/index.js
CHANGED
|
@@ -22,25 +22,26 @@ var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
|
22
22
|
|
|
23
23
|
var styles = {};
|
|
24
24
|
|
|
25
|
+
var _excluded = ["fields", "status", "value", "setValue", "onSubmit", "buttons", "children", "className"];
|
|
25
26
|
var propTypes = {
|
|
26
|
-
fields: PropTypes__default[
|
|
27
|
-
value: PropTypes__default[
|
|
27
|
+
fields: PropTypes__default["default"].objectOf(PropTypes__default["default"].shape({})).isRequired,
|
|
28
|
+
value: PropTypes__default["default"].object,
|
|
28
29
|
// eslint-disable-line react/forbid-prop-types
|
|
29
|
-
setValue: PropTypes__default[
|
|
30
|
-
onChange: PropTypes__default[
|
|
31
|
-
onSubmit: PropTypes__default[
|
|
30
|
+
setValue: PropTypes__default["default"].func,
|
|
31
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
|
32
|
+
onSubmit: PropTypes__default["default"].func.isRequired,
|
|
32
33
|
status: core.PropTypes.formStatus,
|
|
33
|
-
generalError: PropTypes__default[
|
|
34
|
-
errors: PropTypes__default[
|
|
35
|
-
buttons: PropTypes__default[
|
|
36
|
-
type: PropTypes__default[
|
|
37
|
-
id: PropTypes__default[
|
|
38
|
-
label: PropTypes__default[
|
|
39
|
-
position: PropTypes__default[
|
|
40
|
-
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
|
|
41
42
|
})),
|
|
42
|
-
children: PropTypes__default[
|
|
43
|
-
className: PropTypes__default[
|
|
43
|
+
children: PropTypes__default["default"].node,
|
|
44
|
+
className: PropTypes__default["default"].string
|
|
44
45
|
};
|
|
45
46
|
var defaultProps = {
|
|
46
47
|
status: null,
|
|
@@ -62,22 +63,22 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
|
62
63
|
buttons = _ref.buttons,
|
|
63
64
|
children = _ref.children,
|
|
64
65
|
className = _ref.className,
|
|
65
|
-
props = _objectWithoutProperties__default[
|
|
66
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
66
67
|
|
|
67
68
|
var FieldsComponent = contexts.useFieldComponent('fields');
|
|
68
69
|
var onChange = setValue || null;
|
|
69
|
-
return /*#__PURE__*/React__default[
|
|
70
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
70
71
|
className: "d-flex"
|
|
71
|
-
}, /*#__PURE__*/React__default[
|
|
72
|
-
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)]),
|
|
73
74
|
status: status,
|
|
74
75
|
buttons: buttons,
|
|
75
76
|
onSubmit: onSubmit
|
|
76
|
-
}, props), /*#__PURE__*/React__default[
|
|
77
|
+
}, props), /*#__PURE__*/React__default["default"].createElement(FieldsComponent, {
|
|
77
78
|
fields: fields,
|
|
78
79
|
value: value,
|
|
79
80
|
onChange: onChange
|
|
80
|
-
})), /*#__PURE__*/React__default[
|
|
81
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
81
82
|
className: "w-50"
|
|
82
83
|
}, children));
|
|
83
84
|
};
|
|
@@ -85,4 +86,4 @@ var TwoPaneForm = function TwoPaneForm(_ref) {
|
|
|
85
86
|
TwoPaneForm.propTypes = propTypes;
|
|
86
87
|
TwoPaneForm.defaultProps = defaultProps;
|
|
87
88
|
|
|
88
|
-
exports
|
|
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
|
}
|