@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.
@@ -1 +1,3 @@
1
1
  export { showForm } from "./page.form";
2
+ export interface PageShowProps {
3
+ }
@@ -1,14 +1,16 @@
1
1
  import { PageLayoutType } from "./page.layout";
2
- interface ShowFormOptions {
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?: "add" | "edit" | "copy" | "detail";
10
+ mode?: PageFormModeType;
10
11
  dataId?: string;
11
- onClose?: (data: any) => void | Promise<void>;
12
+ onSubmitOk?: () => void;
13
+ onRemoveOk?: () => void;
14
+ onClose?: () => void | Promise<void>;
12
15
  }
13
- export declare function showForm(options: ShowFormOptions): void;
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 _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
26
- var _container;
27
- return _regeneratorRuntime.wrap(function _callee$(_context) {
28
- while (1) switch (_context.prev = _context.next) {
29
- case 0:
30
- if (unmount) {
31
- //取消挂载
32
- ReactDOM.unmountComponentAtNode(container);
33
- //移除
34
- (_container = container) === null || _container === void 0 ? void 0 : _container.remove();
35
- }
36
- onClose === null || onClose === void 0 ? void 0 : onClose(data);
37
- case 2:
38
- case "end":
39
- return _context.stop();
40
- }
41
- }, _callee);
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,4 +1,4 @@
1
1
  export declare function PageLoadSchema(props: {
2
- pageId: string;
2
+ pageId?: string;
3
3
  children: (schema: any) => any;
4
4
  }): any;
@@ -1 +1,3 @@
1
1
  export { showForm } from "./page.form";
2
+ export interface PageShowProps {
3
+ }
@@ -1,14 +1,16 @@
1
1
  import { PageLayoutType } from "./page.layout";
2
- interface ShowFormOptions {
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?: "add" | "edit" | "copy" | "detail";
10
+ mode?: PageFormModeType;
10
11
  dataId?: string;
11
- onClose?: (data: any) => void | Promise<void>;
12
+ onSubmitOk?: () => void;
13
+ onRemoveOk?: () => void;
14
+ onClose?: () => void | Promise<void>;
12
15
  }
13
- export declare function showForm(options: ShowFormOptions): void;
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 _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
31
- var _container;
32
- return _regenerator["default"].wrap(function _callee$(_context) {
33
- while (1) switch (_context.prev = _context.next) {
34
- case 0:
35
- if (unmount) {
36
- //取消挂载
37
- _reactDom["default"].unmountComponentAtNode(container);
38
- //移除
39
- (_container = container) === null || _container === void 0 ? void 0 : _container.remove();
40
- }
41
- onClose === null || onClose === void 0 ? void 0 : onClose(data);
42
- case 2:
43
- case "end":
44
- return _context.stop();
45
- }
46
- }, _callee);
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,
@@ -1,4 +1,4 @@
1
1
  export declare function PageLoadSchema(props: {
2
- pageId: string;
2
+ pageId?: string;
3
3
  children: (schema: any) => any;
4
4
  }): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhubangyun/lowcode-core",
3
- "version": "5.4.105",
3
+ "version": "5.4.115",
4
4
  "description": "低代码核心",
5
5
  "files": [
6
6
  "lib",