@panneau/form-two-pane 4.0.27 → 4.0.33
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/dist/index.d.ts +2 -1
- package/dist/index.js +21 -6
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Resource, FormStatus, Button } from '@panneau/core';
|
|
|
5
5
|
interface TwoPaneFormProps {
|
|
6
6
|
fields: Record<string, unknown>;
|
|
7
7
|
resource?: Resource | null;
|
|
8
|
+
size?: 'half' | 'medium' | 'large' | null;
|
|
8
9
|
value?: Record<string, unknown> | null;
|
|
9
10
|
onChange: (value: Record<string, unknown>) => void;
|
|
10
11
|
onSubmit: () => void;
|
|
@@ -15,6 +16,6 @@ interface TwoPaneFormProps {
|
|
|
15
16
|
children?: ReactNode | null;
|
|
16
17
|
className?: string | null;
|
|
17
18
|
}
|
|
18
|
-
declare function TwoPaneForm({ resource, fields, status, value, onChange, onSubmit, errors, buttons, children, className, ...props }: TwoPaneFormProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function TwoPaneForm({ resource, fields, size, status, value, onChange, onSubmit, errors, buttons, children, className, ...props }: TwoPaneFormProps): react_jsx_runtime.JSX.Element;
|
|
19
20
|
|
|
20
21
|
export { TwoPaneForm as default };
|
package/dist/index.js
CHANGED
|
@@ -6,17 +6,22 @@ import { useFieldComponent, usePreviewComponent } from '@panneau/core/contexts';
|
|
|
6
6
|
import Form from '@panneau/element-form';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var _excluded = ["resource", "fields", "status", "value", "onChange", "onSubmit", "errors", "buttons", "children", "className"];
|
|
9
|
+
var _excluded = ["resource", "fields", "size", "status", "value", "onChange", "onSubmit", "errors", "buttons", "children", "className"];
|
|
10
10
|
function TwoPaneForm(_ref) {
|
|
11
11
|
var _ref$resource = _ref.resource,
|
|
12
12
|
resource = _ref$resource === void 0 ? null : _ref$resource,
|
|
13
|
-
fields = _ref.fields,
|
|
13
|
+
_ref$fields = _ref.fields,
|
|
14
|
+
fields = _ref$fields === void 0 ? null : _ref$fields,
|
|
15
|
+
_ref$size = _ref.size,
|
|
16
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
14
17
|
_ref$status = _ref.status,
|
|
15
18
|
status = _ref$status === void 0 ? null : _ref$status,
|
|
16
19
|
_ref$value = _ref.value,
|
|
17
20
|
value = _ref$value === void 0 ? null : _ref$value,
|
|
18
|
-
onChange = _ref.onChange,
|
|
19
|
-
|
|
21
|
+
_ref$onChange = _ref.onChange,
|
|
22
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
23
|
+
_ref$onSubmit = _ref.onSubmit,
|
|
24
|
+
onSubmit = _ref$onSubmit === void 0 ? null : _ref$onSubmit,
|
|
20
25
|
_ref$errors = _ref.errors,
|
|
21
26
|
errors = _ref$errors === void 0 ? null : _ref$errors,
|
|
22
27
|
_ref$buttons = _ref.buttons,
|
|
@@ -31,10 +36,20 @@ function TwoPaneForm(_ref) {
|
|
|
31
36
|
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
32
37
|
var FieldsComponent = useFieldComponent('fields');
|
|
33
38
|
var PreviewComponent = usePreviewComponent(id);
|
|
39
|
+
var formClassName = classNames(['form', 'col-12', _defineProperty({
|
|
40
|
+
'col-lg-6': size === 'half',
|
|
41
|
+
'col-lg-5': size === 'medium',
|
|
42
|
+
'col-lg-4': size === 'large'
|
|
43
|
+
}, className, className !== null)]);
|
|
44
|
+
var previewClassName = classNames(['preview', 'col-12', {
|
|
45
|
+
'col-lg-6': size === 'half',
|
|
46
|
+
'col-lg-7': size === 'medium',
|
|
47
|
+
'col-lg-8': size === 'large'
|
|
48
|
+
}]);
|
|
34
49
|
return /*#__PURE__*/jsxs("div", {
|
|
35
50
|
className: "container-fluid row gx-4",
|
|
36
51
|
children: [/*#__PURE__*/jsx(Form, _objectSpread(_objectSpread({
|
|
37
|
-
className:
|
|
52
|
+
className: formClassName,
|
|
38
53
|
resource: resource,
|
|
39
54
|
status: status,
|
|
40
55
|
buttons: buttons,
|
|
@@ -48,7 +63,7 @@ function TwoPaneForm(_ref) {
|
|
|
48
63
|
errors: errors
|
|
49
64
|
})
|
|
50
65
|
})), /*#__PURE__*/jsx("div", {
|
|
51
|
-
className:
|
|
66
|
+
className: previewClassName,
|
|
52
67
|
children: PreviewComponent !== null ? /*#__PURE__*/jsx(PreviewComponent, {
|
|
53
68
|
resource: resource,
|
|
54
69
|
value: value
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/form-two-pane",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.33",
|
|
4
4
|
"description": "Two-pane resource forms",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
63
|
"@panneau/core": "^4.0.27",
|
|
64
64
|
"@panneau/data": "^4.0.27",
|
|
65
|
-
"@panneau/element-button": "^4.0.
|
|
66
|
-
"@panneau/element-form": "^4.0.
|
|
67
|
-
"@panneau/field-fields": "^4.0.
|
|
68
|
-
"@panneau/themes": "^4.0.
|
|
65
|
+
"@panneau/element-button": "^4.0.33",
|
|
66
|
+
"@panneau/element-form": "^4.0.33",
|
|
67
|
+
"@panneau/field-fields": "^4.0.33",
|
|
68
|
+
"@panneau/themes": "^4.0.33",
|
|
69
69
|
"classnames": "^2.5.1",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
71
71
|
"react-intl": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "c0e63d849207a4f77f9e6d8d2c9f4b51c3d892d5"
|
|
77
77
|
}
|