@zhubangyun/lowcode-core 5.4.105 → 5.4.115
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/utils/page/index.d.ts +2 -0
- package/es/utils/page/page.form.d.ts +8 -6
- package/es/utils/page/page.form.js +21 -24
- package/es/utils/page/page.load-schema.d.ts +1 -1
- package/lib/utils/page/index.d.ts +2 -0
- package/lib/utils/page/page.form.d.ts +8 -6
- package/lib/utils/page/page.form.js +21 -24
- package/lib/utils/page/page.load-schema.d.ts +1 -1
- package/package.json +1 -1
package/es/utils/page/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page.layout";
|
|
2
|
-
|
|
2
|
+
export declare type PageFormModeType = "add" | "edit" | "detail";
|
|
3
|
+
export interface ShowFormProps {
|
|
3
4
|
container?: HTMLDivElement;
|
|
4
5
|
layout?: PageLayoutType;
|
|
5
|
-
form
|
|
6
|
+
form?: {
|
|
6
7
|
id: string;
|
|
7
8
|
fieldId?: string;
|
|
8
9
|
};
|
|
9
|
-
mode?:
|
|
10
|
+
mode?: PageFormModeType;
|
|
10
11
|
dataId?: string;
|
|
11
|
-
|
|
12
|
+
onSubmitOk?: () => void;
|
|
13
|
+
onRemoveOk?: () => void;
|
|
14
|
+
onClose?: () => void | Promise<void>;
|
|
12
15
|
}
|
|
13
|
-
export declare function showForm(options:
|
|
14
|
-
export {};
|
|
16
|
+
export declare function showForm(options: ShowFormProps): void;
|
|
@@ -21,29 +21,24 @@ export function showForm(options) {
|
|
|
21
21
|
document.body.append(container);
|
|
22
22
|
}
|
|
23
23
|
ReactDOM.render( /*#__PURE__*/React.createElement(FormRender, _extends({}, restProps, {
|
|
24
|
-
onClose: ( /*#__PURE__*/function () {
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}));
|
|
43
|
-
return function (_x) {
|
|
44
|
-
return _ref.apply(this, arguments);
|
|
45
|
-
};
|
|
46
|
-
}())
|
|
24
|
+
onClose: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
25
|
+
var _container;
|
|
26
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
if (unmount) {
|
|
30
|
+
//取消挂载
|
|
31
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
32
|
+
//移除
|
|
33
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
34
|
+
}
|
|
35
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
36
|
+
case 2:
|
|
37
|
+
case "end":
|
|
38
|
+
return _context.stop();
|
|
39
|
+
}
|
|
40
|
+
}, _callee);
|
|
41
|
+
}))
|
|
47
42
|
})), container);
|
|
48
43
|
}
|
|
49
44
|
var FormRender = /*#__PURE__*/function (_Component) {
|
|
@@ -57,10 +52,12 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
57
52
|
layout = _this$props.layout,
|
|
58
53
|
form = _this$props.form,
|
|
59
54
|
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded2);
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
restProps.layout = layout || "drawer";
|
|
60
57
|
return /*#__PURE__*/React.createElement(PageLayout, {
|
|
61
58
|
layout: layout
|
|
62
59
|
}, /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
63
|
-
pageId: form.id
|
|
60
|
+
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
64
61
|
}, function (schema) {
|
|
65
62
|
return /*#__PURE__*/React.createElement(ReactRender, _extends({
|
|
66
63
|
schema: schema,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page.layout";
|
|
2
|
-
|
|
2
|
+
export declare type PageFormModeType = "add" | "edit" | "detail";
|
|
3
|
+
export interface ShowFormProps {
|
|
3
4
|
container?: HTMLDivElement;
|
|
4
5
|
layout?: PageLayoutType;
|
|
5
|
-
form
|
|
6
|
+
form?: {
|
|
6
7
|
id: string;
|
|
7
8
|
fieldId?: string;
|
|
8
9
|
};
|
|
9
|
-
mode?:
|
|
10
|
+
mode?: PageFormModeType;
|
|
10
11
|
dataId?: string;
|
|
11
|
-
|
|
12
|
+
onSubmitOk?: () => void;
|
|
13
|
+
onRemoveOk?: () => void;
|
|
14
|
+
onClose?: () => void | Promise<void>;
|
|
12
15
|
}
|
|
13
|
-
export declare function showForm(options:
|
|
14
|
-
export {};
|
|
16
|
+
export declare function showForm(options: ShowFormProps): void;
|
|
@@ -26,29 +26,24 @@ function showForm(options) {
|
|
|
26
26
|
document.body.append(container);
|
|
27
27
|
}
|
|
28
28
|
_reactDom["default"].render( /*#__PURE__*/React.createElement(FormRender, (0, _extends2["default"])({}, restProps, {
|
|
29
|
-
onClose: ( /*#__PURE__*/function () {
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}));
|
|
48
|
-
return function (_x) {
|
|
49
|
-
return _ref.apply(this, arguments);
|
|
50
|
-
};
|
|
51
|
-
}())
|
|
29
|
+
onClose: /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
30
|
+
var _container;
|
|
31
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
if (unmount) {
|
|
35
|
+
//取消挂载
|
|
36
|
+
_reactDom["default"].unmountComponentAtNode(container);
|
|
37
|
+
//移除
|
|
38
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
39
|
+
}
|
|
40
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
41
|
+
case 2:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
44
|
+
}
|
|
45
|
+
}, _callee);
|
|
46
|
+
}))
|
|
52
47
|
})), container);
|
|
53
48
|
}
|
|
54
49
|
var FormRender = /*#__PURE__*/function (_Component) {
|
|
@@ -62,10 +57,12 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
62
57
|
layout = _this$props.layout,
|
|
63
58
|
form = _this$props.form,
|
|
64
59
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded2);
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
restProps.layout = layout || "drawer";
|
|
65
62
|
return /*#__PURE__*/React.createElement(_page.PageLayout, {
|
|
66
63
|
layout: layout
|
|
67
64
|
}, /*#__PURE__*/React.createElement(_page2.PageLoadSchema, {
|
|
68
|
-
pageId: form.id
|
|
65
|
+
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
69
66
|
}, function (schema) {
|
|
70
67
|
return /*#__PURE__*/React.createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
71
68
|
schema: schema,
|