@luck-design-biz/luckda 1.0.1-4 → 1.0.1-5

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.
@@ -6,11 +6,11 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
9
- var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "showConfigBtn"],
9
+ var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "showConfigBtn", "affixBarZIndex"],
10
10
  _excluded2 = ["dataSets", "doAction", "resources"],
11
11
  _excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft", "serial"],
12
12
  _excluded4 = ["ldId", "initData", "overModel"];
13
- import React, { useContext, useRef, forwardRef, Fragment, useImperativeHandle, useState, useEffect } from 'react';
13
+ import React, { useContext, useRef, forwardRef, Fragment, useImperativeHandle, useState } from 'react';
14
14
  import { connect, getDvaApp, useRouteMatch } from 'umi';
15
15
  import PropTypes from 'prop-types';
16
16
  import { isArray, sortBy, mapValues, reduce, includes } from 'lodash';
@@ -61,6 +61,7 @@ var LdFormList = function LdFormList(_ref) {
61
61
  afterSubmitLoading = _ref.afterSubmitLoading,
62
62
  _ref$showConfigBtn = _ref.showConfigBtn,
63
63
  showConfigBtn = _ref$showConfigBtn === void 0 ? true : _ref$showConfigBtn,
64
+ affixBarZIndex = _ref.affixBarZIndex,
64
65
  props = _objectWithoutProperties(_ref, _excluded);
65
66
  var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
66
67
  var currentValueRef = useRef(null);
@@ -275,6 +276,7 @@ var LdFormList = function LdFormList(_ref) {
275
276
  renderRight: isCustomRenderAffixRight ? renderAffixRightCustom : renderAffixRight,
276
277
  title: saveBtnTitle,
277
278
  layout: affixLayout || defaultLayout,
279
+ zIndex: affixBarZIndex,
278
280
  getContainer: getContainer
279
281
  }), sortBy([].concat(_toConsumableArray(formList), _toConsumableArray(formExtra)), function (o) {
280
282
  var _o$props;
@@ -10,6 +10,7 @@
10
10
  "showSave": true,
11
11
  "saveTitle": "保存",
12
12
  "settingLayout": "bottom",
13
+ "getContainer": "page_content",
13
14
  "blocks": [
14
15
  {
15
16
  "id": "block_main",
@@ -75,7 +75,8 @@
75
75
  "meta.group",
76
76
  "build-in"
77
77
  ]
78
- ]
78
+ ],
79
+ "default": "page_content"
79
80
  },
80
81
  {
81
82
  "key": "renderFormLeft",
@@ -7,6 +7,7 @@ var _excluded = ["props", "children"],
7
7
  import React, { useRef } from 'react';
8
8
  import { dynamic } from 'umi';
9
9
  import { useMemoizedFn, useCreation } from 'ahooks';
10
+ import { Skeleton } from 'luck-design/antd';
10
11
  import { upperFirst, isNil } from 'lodash';
11
12
  import { useContext } from "../provider/ContextProvider";
12
13
  import { LC_BUILDIN_UNIT_KEY_LIST, RUNTIME } from "../../constants";
@@ -55,7 +56,18 @@ export default function useCanvasRender(data, deps) {
55
56
  return _loader.apply(this, arguments);
56
57
  }
57
58
  return loader;
58
- }()
59
+ }(),
60
+ loading: function loading() {
61
+ return /*#__PURE__*/React.createElement(Skeleton, {
62
+ active: true,
63
+ title: {
64
+ width: '70%'
65
+ },
66
+ paragraph: {
67
+ rows: 7
68
+ }
69
+ });
70
+ }
59
71
  });
60
72
  }
61
73
  var renderable = true;
@@ -90,6 +90,7 @@
90
90
  .ant-form-item,
91
91
  .ant-collapse-header,
92
92
  .resizer,
93
+ .formlist-affix-bar,
93
94
  .ant-tree-node-content-wrapper,
94
95
  .ant-modal-header,
95
96
  .ant-modal-close,
@@ -79,15 +79,18 @@ var LCDialog = function LCDialog(_ref) {
79
79
  while (1) switch (_context.prev = _context.next) {
80
80
  case 0:
81
81
  setLoading(true);
82
- _context.next = 3;
82
+ _context.prev = 1;
83
+ _context.next = 4;
83
84
  return ctx.doAction(advance.events.onOk);
84
- case 3:
85
- setLoading(false);
86
85
  case 4:
86
+ _context.prev = 4;
87
+ setLoading(false);
88
+ return _context.finish(4);
89
+ case 7:
87
90
  case "end":
88
91
  return _context.stop();
89
92
  }
90
- }, _callee);
93
+ }, _callee, null, [[1,, 4, 7]]);
91
94
  })));
92
95
  var _footer = useCreation(function () {
93
96
  if (!footer) return {
@@ -94,7 +94,8 @@ var FunctionDesign = function FunctionDesign(_ref) {
94
94
  formMode: 'update',
95
95
  ticketData: _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, 'test')
96
96
  },
97
- ref: ref
97
+ ref: ref,
98
+ affixBarZIndex: 10
98
99
  }), children);
99
100
  };
100
101
  export default FunctionDesign;
@@ -20,7 +20,6 @@ import RuntimeComp from "../JSX/RuntimeComp";
20
20
  import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
21
21
  import defaultMeta from "../../../engine/meta/form.props.default.json";
22
22
  import { RUNTIME } from "../../../constants";
23
- import styles from "./index.less";
24
23
  var _I18N_PREFIX_ = 'lc.form.validator';
25
24
  var Header = function Header(_ref2) {
26
25
  var _ref2$header = _ref2.header,
@@ -56,7 +55,7 @@ var getMthodParams = function getMthodParams(methodStr) {
56
55
  return [];
57
56
  };
58
57
  var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
59
- var _ctx$state2, _promiseRef$current2;
58
+ var _ctx$state2;
60
59
  var id = _ref3.id,
61
60
  className = _ref3.className,
62
61
  blocks = _ref3.blocks,
@@ -65,6 +64,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
65
64
  readOnly = _ref3.readOnly,
66
65
  showSave = _ref3.showSave,
67
66
  saveTitle = _ref3.saveTitle,
67
+ affixBarZIndex = _ref3.affixBarZIndex,
68
68
  getContainer = _ref3.getContainer,
69
69
  settingLayout = _ref3.settingLayout,
70
70
  renderFormLeft = _ref3.renderFormLeft,
@@ -111,9 +111,12 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
111
111
  * @method
112
112
  */
113
113
  submit: function submit(_formMode) {
114
- return new Promise(function (resolve) {
114
+ return new Promise(function (resolve, reject) {
115
115
  var _ctx$state;
116
- promiseRef.current = resolve;
116
+ promiseRef.current = {
117
+ resolve: resolve,
118
+ reject: reject
119
+ };
117
120
  var instance = formRef.current;
118
121
  var _ref5 = _formMode ? {
119
122
  formMode: _formMode
@@ -565,7 +568,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
565
568
  wrapperRef: wrapperRef,
566
569
  id: id,
567
570
  ldId: id,
568
- className: classNames(styles['lc-component-form'], _defineProperty({}, className, !!className)),
571
+ className: classNames('lc-component-form', _defineProperty({}, className, !!className)),
569
572
  renderFormList: renderFormList,
570
573
  renderFormExtra: renderFormExtra,
571
574
  mainFormLdId: "block_main",
@@ -575,6 +578,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
575
578
  showSaveBtn: showSave,
576
579
  saveBtnTitle: saveTitle,
577
580
  affixLayout: settingLayout,
581
+ affixBarZIndex: affixBarZIndex,
578
582
  renderAffixLeft: function renderAffixLeft() {
579
583
  return renderAffix(renderFormLeft);
580
584
  },
@@ -587,15 +591,17 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
587
591
  onChildChange: onChildChange,
588
592
  setVerifyRules: setVerifyRules,
589
593
  getContainer: isNil(getContainer) ? null : ctx.componentMap.get(getContainer).api.getSelfDom,
590
- afterSubmitLoading: function afterSubmitLoading() {
594
+ afterSubmitLoading: function afterSubmitLoading(res) {
591
595
  var _promiseRef$current;
592
- for (var _len5 = arguments.length, rest = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
593
- rest[_key5] = arguments[_key5];
594
- }
595
- return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
596
+ (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 || _promiseRef$current.resolve(res);
597
+ promiseRef.current = null;
596
598
  },
597
599
  afterInit: afterInit,
598
- validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef),
600
+ validateErrorCallback: function validateErrorCallback() {
601
+ var _promiseRef$current2;
602
+ (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 || _promiseRef$current2.reject();
603
+ promiseRef.current = null;
604
+ },
599
605
  showConfigBtn: false
600
606
  }));
601
607
  });
@@ -66,7 +66,8 @@
66
66
  ["id", "page_root"],
67
67
  ["meta.group", "container"],
68
68
  ["meta.group", "build-in"]
69
- ]
69
+ ],
70
+ "default": "page_content"
70
71
  },
71
72
  {
72
73
  "key": "renderFormLeft",
@@ -31,7 +31,7 @@ var _LdPop = require("../LdPop");
31
31
  var _model = _interopRequireDefault(require("./model"));
32
32
  var _action = require("../../helper/action");
33
33
  var _utils2 = require("../../lowcode/engine/provider/ContextProvider/utils");
34
- var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "showConfigBtn"],
34
+ var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "showConfigBtn", "affixBarZIndex"],
35
35
  _excluded2 = ["dataSets", "doAction", "resources"],
36
36
  _excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft", "serial"],
37
37
  _excluded4 = ["ldId", "initData", "overModel"];
@@ -68,6 +68,7 @@ var LdFormList = function LdFormList(_ref) {
68
68
  afterSubmitLoading = _ref.afterSubmitLoading,
69
69
  _ref$showConfigBtn = _ref.showConfigBtn,
70
70
  showConfigBtn = _ref$showConfigBtn === void 0 ? true : _ref$showConfigBtn,
71
+ affixBarZIndex = _ref.affixBarZIndex,
71
72
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
72
73
  var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
73
74
  var currentValueRef = (0, _react.useRef)(null);
@@ -282,6 +283,7 @@ var LdFormList = function LdFormList(_ref) {
282
283
  renderRight: isCustomRenderAffixRight ? renderAffixRightCustom : renderAffixRight,
283
284
  title: saveBtnTitle,
284
285
  layout: affixLayout || defaultLayout,
286
+ zIndex: affixBarZIndex,
285
287
  getContainer: getContainer
286
288
  }), (0, _lodash.sortBy)([].concat((0, _toConsumableArray2.default)(formList), (0, _toConsumableArray2.default)(formExtra)), function (o) {
287
289
  var _o$props;
@@ -10,6 +10,7 @@
10
10
  "showSave": true,
11
11
  "saveTitle": "保存",
12
12
  "settingLayout": "bottom",
13
+ "getContainer": "page_content",
13
14
  "blocks": [
14
15
  {
15
16
  "id": "block_main",
@@ -75,7 +75,8 @@
75
75
  "meta.group",
76
76
  "build-in"
77
77
  ]
78
- ]
78
+ ],
79
+ "default": "page_content"
79
80
  },
80
81
  {
81
82
  "key": "renderFormLeft",
@@ -14,6 +14,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
14
14
  var _react = _interopRequireWildcard3(require("react"));
15
15
  var _umi = require("umi");
16
16
  var _ahooks = require("ahooks");
17
+ var _antd = require("luck-design/antd");
17
18
  var _lodash = require("lodash");
18
19
  var _ContextProvider = require("../provider/ContextProvider");
19
20
  var _constants = require("../../constants");
@@ -70,7 +71,18 @@ function useCanvasRender(data, deps) {
70
71
  return _loader.apply(this, arguments);
71
72
  }
72
73
  return loader;
73
- }()
74
+ }(),
75
+ loading: function loading() {
76
+ return /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
77
+ active: true,
78
+ title: {
79
+ width: '70%'
80
+ },
81
+ paragraph: {
82
+ rows: 7
83
+ }
84
+ });
85
+ }
74
86
  });
75
87
  }
76
88
  var renderable = true;
@@ -90,6 +90,7 @@
90
90
  .ant-form-item,
91
91
  .ant-collapse-header,
92
92
  .resizer,
93
+ .formlist-affix-bar,
93
94
  .ant-tree-node-content-wrapper,
94
95
  .ant-modal-header,
95
96
  .ant-modal-close,
@@ -87,15 +87,18 @@ var LCDialog = function LCDialog(_ref) {
87
87
  while (1) switch (_context.prev = _context.next) {
88
88
  case 0:
89
89
  setLoading(true);
90
- _context.next = 3;
90
+ _context.prev = 1;
91
+ _context.next = 4;
91
92
  return ctx.doAction(advance.events.onOk);
92
- case 3:
93
- setLoading(false);
94
93
  case 4:
94
+ _context.prev = 4;
95
+ setLoading(false);
96
+ return _context.finish(4);
97
+ case 7:
95
98
  case "end":
96
99
  return _context.stop();
97
100
  }
98
- }, _callee);
101
+ }, _callee, null, [[1,, 4, 7]]);
99
102
  })));
100
103
  var _footer = (0, _ahooks.useCreation)(function () {
101
104
  if (!footer) return {
@@ -101,7 +101,8 @@ var FunctionDesign = function FunctionDesign(_ref) {
101
101
  formMode: 'update',
102
102
  ticketData: (0, _defineProperty2.default)({}, window.appConfig.constraintKeys.PRIMARY, 'test')
103
103
  },
104
- ref: ref
104
+ ref: ref,
105
+ affixBarZIndex: 10
105
106
  }), children);
106
107
  };
107
108
  var _default = exports.default = FunctionDesign;
@@ -27,7 +27,6 @@ var _RuntimeComp = _interopRequireDefault(require("../JSX/RuntimeComp"));
27
27
  var _useCombinedRefs = _interopRequireDefault(require("../../../engine/tools/useCombinedRefs"));
28
28
  var _formPropsDefault = _interopRequireDefault(require("../../../engine/meta/form.props.default.json"));
29
29
  var _constants = require("../../../constants");
30
- var _index2 = _interopRequireDefault(require("./index.less"));
31
30
  var _excluded = ["advance", "state", "render"];
32
31
  var _I18N_PREFIX_ = 'lc.form.validator';
33
32
  var Header = function Header(_ref2) {
@@ -64,7 +63,7 @@ var getMthodParams = function getMthodParams(methodStr) {
64
63
  return [];
65
64
  };
66
65
  var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
67
- var _ctx$state2, _promiseRef$current2;
66
+ var _ctx$state2;
68
67
  var id = _ref3.id,
69
68
  className = _ref3.className,
70
69
  blocks = _ref3.blocks,
@@ -73,6 +72,7 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
73
72
  readOnly = _ref3.readOnly,
74
73
  showSave = _ref3.showSave,
75
74
  saveTitle = _ref3.saveTitle,
75
+ affixBarZIndex = _ref3.affixBarZIndex,
76
76
  getContainer = _ref3.getContainer,
77
77
  settingLayout = _ref3.settingLayout,
78
78
  renderFormLeft = _ref3.renderFormLeft,
@@ -119,9 +119,12 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
119
119
  * @method
120
120
  */
121
121
  submit: function submit(_formMode) {
122
- return new Promise(function (resolve) {
122
+ return new Promise(function (resolve, reject) {
123
123
  var _ctx$state;
124
- promiseRef.current = resolve;
124
+ promiseRef.current = {
125
+ resolve: resolve,
126
+ reject: reject
127
+ };
125
128
  var instance = formRef.current;
126
129
  var _ref5 = _formMode ? {
127
130
  formMode: _formMode
@@ -573,7 +576,7 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
573
576
  wrapperRef: wrapperRef,
574
577
  id: id,
575
578
  ldId: id,
576
- className: (0, _classnames.default)(_index2.default['lc-component-form'], (0, _defineProperty2.default)({}, className, !!className)),
579
+ className: (0, _classnames.default)('lc-component-form', (0, _defineProperty2.default)({}, className, !!className)),
577
580
  renderFormList: renderFormList,
578
581
  renderFormExtra: renderFormExtra,
579
582
  mainFormLdId: "block_main",
@@ -583,6 +586,7 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
583
586
  showSaveBtn: showSave,
584
587
  saveBtnTitle: saveTitle,
585
588
  affixLayout: settingLayout,
589
+ affixBarZIndex: affixBarZIndex,
586
590
  renderAffixLeft: function renderAffixLeft() {
587
591
  return renderAffix(renderFormLeft);
588
592
  },
@@ -595,15 +599,17 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
595
599
  onChildChange: onChildChange,
596
600
  setVerifyRules: setVerifyRules,
597
601
  getContainer: (0, _lodash.isNil)(getContainer) ? null : ctx.componentMap.get(getContainer).api.getSelfDom,
598
- afterSubmitLoading: function afterSubmitLoading() {
602
+ afterSubmitLoading: function afterSubmitLoading(res) {
599
603
  var _promiseRef$current;
600
- for (var _len5 = arguments.length, rest = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
601
- rest[_key5] = arguments[_key5];
602
- }
603
- return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
604
+ (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 || _promiseRef$current.resolve(res);
605
+ promiseRef.current = null;
604
606
  },
605
607
  afterInit: afterInit,
606
- validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef),
608
+ validateErrorCallback: function validateErrorCallback() {
609
+ var _promiseRef$current2;
610
+ (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 || _promiseRef$current2.reject();
611
+ promiseRef.current = null;
612
+ },
607
613
  showConfigBtn: false
608
614
  }));
609
615
  });
@@ -66,7 +66,8 @@
66
66
  ["id", "page_root"],
67
67
  ["meta.group", "container"],
68
68
  ["meta.group", "build-in"]
69
- ]
69
+ ],
70
+ "default": "page_content"
70
71
  },
71
72
  {
72
73
  "key": "renderFormLeft",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luck-design-biz/luckda",
3
- "version": "1.0.1-4",
3
+ "version": "1.0.1-5",
4
4
  "description": "前端配置管理中心业务组件库",
5
5
  "scripts": {
6
6
  "start": "cross-env NODE_OPTIONS=--max-old-space-size=10240 USER_RUNTIME=SITE RUNTIME=dev umi dev",
@@ -81,7 +81,7 @@
81
81
  "@babel/plugin-transform-strict-mode": "^7.18.6",
82
82
  "@babel/polyfill": "^7.12.1",
83
83
  "@babel/traverse": "^7.24.1",
84
- "@luck-design-biz/base": "0.0.49-2",
84
+ "@luck-design-biz/base": "0.0.49-9",
85
85
  "@luck-design-biz/bpm": "0.0.5",
86
86
  "@luck-helper/ui-design": "0.0.6",
87
87
  "@types/classnames": "^2.3.1",
@@ -1,5 +0,0 @@
1
- .lc-component-form{
2
- }
3
- .lc-component-form.runtime-form {
4
-
5
- }
@@ -1,5 +0,0 @@
1
- .lc-component-form{
2
- }
3
- .lc-component-form.runtime-form {
4
-
5
- }