@zhubangyun/lowcode-core 5.12.161 → 6.2.30

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.
Files changed (89) hide show
  1. package/es/components/load-materials/index.js +38 -22
  2. package/es/components/page-loading/index.js +4 -1
  3. package/es/index.d.ts +1 -1
  4. package/es/index.js +19 -2
  5. package/es/index.less +21 -0
  6. package/es/init/init.bar-height.d.ts +1 -0
  7. package/es/init/init.bar-height.js +37 -0
  8. package/es/init/init.mobile-class.d.ts +1 -0
  9. package/es/init/init.mobile-class.js +10 -0
  10. package/es/init/init.scroll-size.d.ts +5 -0
  11. package/es/init/init.scroll-size.js +26 -0
  12. package/es/style.js +3 -3
  13. package/es/utils/api/form-api.d.ts +2 -0
  14. package/es/utils/api/form-api.js +155 -34
  15. package/es/utils/api/index.d.ts +1 -1
  16. package/es/utils/api/index.js +4 -2
  17. package/es/utils/api/rest-api.d.ts +3 -1
  18. package/es/utils/api/rest-api.js +105 -23
  19. package/es/utils/api/schema.util.d.ts +3 -3
  20. package/es/utils/api/schema.util.js +17 -12
  21. package/es/utils/cache/index.js +57 -17
  22. package/es/utils/common/index.d.ts +3 -0
  23. package/es/utils/common/index.js +17 -3
  24. package/es/utils/page/index.js +10 -6
  25. package/es/utils/page/page-form-data-manager-group.js +10 -10
  26. package/es/utils/page/page-form-data-manager.d.ts +1 -0
  27. package/es/utils/page/page-form-data-manager.js +10 -10
  28. package/es/utils/page/page-form-group.d.ts +1 -0
  29. package/es/utils/page/page-form-group.js +2 -2
  30. package/es/utils/page/page-form.d.ts +1 -0
  31. package/es/utils/page/page-form.js +12 -4
  32. package/es/utils/page/page-layout.d.ts +3 -1
  33. package/es/utils/page/page-layout.js +44 -7
  34. package/es/utils/page/page-load-schema.js +20 -28
  35. package/es/utils/page/page-render.js +4 -5
  36. package/es/utils/page/page-show.d.ts +2 -0
  37. package/es/utils/page/page-show.js +9 -4
  38. package/es/utils/page/print-form.d.ts +3 -2
  39. package/es/utils/page/print-form.js +200 -61
  40. package/es/utils/uni-bridge.d.ts +20 -0
  41. package/es/utils/uni-bridge.js +172 -0
  42. package/es/utils/util.common.d.ts +1 -0
  43. package/es/utils/util.common.js +4 -0
  44. package/es/utils/utils.scrollbar-size.js +0 -0
  45. package/lib/components/load-materials/index.js +38 -22
  46. package/lib/components/page-loading/index.js +4 -1
  47. package/lib/index.d.ts +1 -1
  48. package/lib/index.js +22 -4
  49. package/lib/index.less +21 -0
  50. package/lib/init/init.bar-height.d.ts +1 -0
  51. package/lib/init/init.bar-height.js +42 -0
  52. package/lib/init/init.mobile-class.d.ts +1 -0
  53. package/lib/init/init.mobile-class.js +14 -0
  54. package/lib/init/init.scroll-size.d.ts +5 -0
  55. package/lib/init/init.scroll-size.js +31 -0
  56. package/lib/style.js +3 -3
  57. package/lib/utils/api/form-api.d.ts +2 -0
  58. package/lib/utils/api/form-api.js +155 -34
  59. package/lib/utils/api/index.d.ts +1 -1
  60. package/lib/utils/api/index.js +4 -2
  61. package/lib/utils/api/rest-api.d.ts +3 -1
  62. package/lib/utils/api/rest-api.js +105 -23
  63. package/lib/utils/api/schema.util.d.ts +3 -3
  64. package/lib/utils/api/schema.util.js +19 -13
  65. package/lib/utils/cache/index.js +56 -16
  66. package/lib/utils/common/index.d.ts +3 -0
  67. package/lib/utils/common/index.js +19 -2
  68. package/lib/utils/page/index.js +10 -6
  69. package/lib/utils/page/page-form-data-manager-group.js +10 -10
  70. package/lib/utils/page/page-form-data-manager.d.ts +1 -0
  71. package/lib/utils/page/page-form-data-manager.js +10 -10
  72. package/lib/utils/page/page-form-group.d.ts +1 -0
  73. package/lib/utils/page/page-form-group.js +2 -2
  74. package/lib/utils/page/page-form.d.ts +1 -0
  75. package/lib/utils/page/page-form.js +12 -4
  76. package/lib/utils/page/page-layout.d.ts +3 -1
  77. package/lib/utils/page/page-layout.js +44 -7
  78. package/lib/utils/page/page-load-schema.js +19 -27
  79. package/lib/utils/page/page-render.js +4 -5
  80. package/lib/utils/page/page-show.d.ts +2 -0
  81. package/lib/utils/page/page-show.js +9 -4
  82. package/lib/utils/page/print-form.d.ts +3 -2
  83. package/lib/utils/page/print-form.js +200 -61
  84. package/lib/utils/uni-bridge.d.ts +20 -0
  85. package/lib/utils/uni-bridge.js +177 -0
  86. package/lib/utils/util.common.d.ts +1 -0
  87. package/lib/utils/util.common.js +8 -0
  88. package/lib/utils/utils.scrollbar-size.js +1 -0
  89. package/package.json +2 -2
@@ -0,0 +1,172 @@
1
+ import _message from "antd/es/message";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ import { v7 } from "uuid";
5
+ var UniBridge = /*#__PURE__*/function () {
6
+ function UniBridge() {
7
+ this.callbacks = {};
8
+ }
9
+ var _proto = UniBridge.prototype;
10
+ _proto.navigateTo = function navigateTo(src) {
11
+ var url = src;
12
+ if (!src.startsWith("http")) {
13
+ url = new URL(url, window.location.href).href;
14
+ }
15
+ if (window.plus) {
16
+ uni.navigateTo({
17
+ url: "/pages/web-page/index?url=" + encodeURIComponent(url)
18
+ });
19
+ } else {
20
+ window.open(url);
21
+ }
22
+ };
23
+ _proto.scanCode = /*#__PURE__*/function () {
24
+ var _scanCode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
25
+ var _t;
26
+ return _regeneratorRuntime.wrap(function (_context) {
27
+ while (1) switch (_context.prev = _context.next) {
28
+ case 0:
29
+ options.scanType = ['qrCode', 'barCode'];
30
+ _context.prev = 1;
31
+ _context.next = 2;
32
+ return this.doAction("scanCode", options);
33
+ case 2:
34
+ return _context.abrupt("return", _context.sent);
35
+ case 3:
36
+ _context.prev = 3;
37
+ _t = _context["catch"](1);
38
+ throw _t;
39
+ case 4:
40
+ case "end":
41
+ return _context.stop();
42
+ }
43
+ }, _callee, this, [[1, 3]]);
44
+ }));
45
+ function scanCode(_x) {
46
+ return _scanCode.apply(this, arguments);
47
+ }
48
+ return scanCode;
49
+ }();
50
+ _proto.getBarHeight = /*#__PURE__*/function () {
51
+ var _getBarHeight = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
52
+ return _regeneratorRuntime.wrap(function (_context2) {
53
+ while (1) switch (_context2.prev = _context2.next) {
54
+ case 0:
55
+ return _context2.abrupt("return", this.doAction("getBarHeight", {}));
56
+ case 1:
57
+ case "end":
58
+ return _context2.stop();
59
+ }
60
+ }, _callee2, this);
61
+ }));
62
+ function getBarHeight() {
63
+ return _getBarHeight.apply(this, arguments);
64
+ }
65
+ return getBarHeight;
66
+ }();
67
+ _proto.scanCodeResult = /*#__PURE__*/function () {
68
+ var _scanCodeResult = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
69
+ var res;
70
+ return _regeneratorRuntime.wrap(function (_context3) {
71
+ while (1) switch (_context3.prev = _context3.next) {
72
+ case 0:
73
+ _context3.next = 1;
74
+ return this.scanCode({
75
+ onlyFromCamera: false,
76
+ openUrl: false
77
+ });
78
+ case 1:
79
+ res = _context3.sent;
80
+ return _context3.abrupt("return", res.result);
81
+ case 2:
82
+ case "end":
83
+ return _context3.stop();
84
+ }
85
+ }, _callee3, this);
86
+ }));
87
+ function scanCodeResult() {
88
+ return _scanCodeResult.apply(this, arguments);
89
+ }
90
+ return scanCodeResult;
91
+ }();
92
+ _proto.getLocation = /*#__PURE__*/function () {
93
+ var _getLocation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(options) {
94
+ return _regeneratorRuntime.wrap(function (_context4) {
95
+ while (1) switch (_context4.prev = _context4.next) {
96
+ case 0:
97
+ return _context4.abrupt("return", this.doAction("getLocation", {
98
+ type: 'wgs84'
99
+ }));
100
+ case 1:
101
+ case "end":
102
+ return _context4.stop();
103
+ }
104
+ }, _callee4, this);
105
+ }));
106
+ function getLocation(_x2) {
107
+ return _getLocation.apply(this, arguments);
108
+ }
109
+ return getLocation;
110
+ }();
111
+ _proto.doAction = /*#__PURE__*/function () {
112
+ var _doAction = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(action, options) {
113
+ var _this = this;
114
+ var messageId;
115
+ return _regeneratorRuntime.wrap(function (_context5) {
116
+ while (1) switch (_context5.prev = _context5.next) {
117
+ case 0:
118
+ if (window.uni) {
119
+ _context5.next = 1;
120
+ break;
121
+ }
122
+ _message.error("\u6267\u884C\u5931\u8D25\uFF01\u7F3A\u5C11uni\u63D2\u4EF6");
123
+ return _context5.abrupt("return");
124
+ case 1:
125
+ messageId = v7();
126
+ return _context5.abrupt("return", new Promise(function (resolve, reject) {
127
+ console.log("UniBridge.doAction", messageId, action, options);
128
+ _this.callbacks[messageId] = {
129
+ resolve: resolve,
130
+ reject: reject
131
+ };
132
+ try {
133
+ console.log("postMessage", messageId, action, options);
134
+ uni.postMessage({
135
+ data: {
136
+ action: action,
137
+ messageId: messageId,
138
+ options: options
139
+ }
140
+ });
141
+ } catch (e) {
142
+ console.log("UniBridge.doAction 异常", e);
143
+ delete _this.callbacks[messageId];
144
+ }
145
+ }));
146
+ case 2:
147
+ case "end":
148
+ return _context5.stop();
149
+ }
150
+ }, _callee5);
151
+ }));
152
+ function doAction(_x3, _x4) {
153
+ return _doAction.apply(this, arguments);
154
+ }
155
+ return doAction;
156
+ }();
157
+ _proto.receiveMessage = function receiveMessage(message) {
158
+ var callback = this.callbacks[message.messageId];
159
+ console.log('客户端收到 UniApp 消息:', JSON.stringify(message));
160
+ console.log('客户端收到 UniApp 消息:callbacks', this.callbacks);
161
+ if (callback) {
162
+ if (message.success) {
163
+ callback.resolve(message.data);
164
+ } else {
165
+ callback.reject(message.error || new Error('操作失败'));
166
+ }
167
+ delete this.callbacks[message.messageId];
168
+ }
169
+ };
170
+ return UniBridge;
171
+ }();
172
+ export var uniBridge = new UniBridge();
@@ -0,0 +1 @@
1
+ export declare function isTemplate(): boolean;
@@ -0,0 +1,4 @@
1
+ export function isTemplate() {
2
+ return false;
3
+ return location.host == "templates.zhiyunhe.com";
4
+ }
File without changes
@@ -9,16 +9,23 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _pageLoading = require("../page-loading");
10
10
  var _common = require("../../utils/common");
11
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
+ function getInit() {
13
+ if (window._components) {
14
+ return true;
15
+ }
16
+ if (window.AntdProMaterial) {
17
+ setComponents();
18
+ return true;
19
+ }
20
+ return false;
21
+ }
12
22
  function LoadMaterials(props) {
13
- var _useState = (0, _react.useState)(false),
23
+ var _useState = (0, _react.useState)(getInit()),
14
24
  init = _useState[0],
15
25
  setInit = _useState[1];
16
26
  (0, _react.useEffect)(function () {
17
27
  initialize().then();
18
28
  }, []);
19
- if (window._components) {
20
- return props.children;
21
- }
22
29
  function initialize() {
23
30
  return _initialize.apply(this, arguments);
24
31
  }
@@ -27,11 +34,17 @@ function LoadMaterials(props) {
27
34
  return _regenerator["default"].wrap(function (_context) {
28
35
  while (1) switch (_context.prev = _context.next) {
29
36
  case 0:
30
- _context.next = 1;
31
- return loadMaterials();
37
+ if (!init) {
38
+ _context.next = 1;
39
+ break;
40
+ }
41
+ return _context.abrupt("return");
32
42
  case 1:
33
- setInit(true);
43
+ _context.next = 2;
44
+ return loadMaterials();
34
45
  case 2:
46
+ setInit(true);
47
+ case 3:
35
48
  case "end":
36
49
  return _context.stop();
37
50
  }
@@ -52,35 +65,23 @@ function loadMaterials() {
52
65
  }
53
66
  function _loadMaterials() {
54
67
  _loadMaterials = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
55
- var components, urls;
68
+ var urls;
56
69
  return _regenerator["default"].wrap(function (_context2) {
57
70
  while (1) switch (_context2.prev = _context2.next) {
58
71
  case 0:
59
- components = {};
60
72
  if (!window._components) {
61
73
  _context2.next = 1;
62
74
  break;
63
75
  }
64
76
  return _context2.abrupt("return");
65
77
  case 1:
66
- urls = ["prop-types/15.8.1/prop-types.min.js", "lodash/4.17.15/lodash.min.js", "dayjs/dayjs.min.js", "antd/latest/reset.css", "antd/latest/antd.min.js", "antdIcon/1.0.0/antdIcon.min.js", "lowcode/core/index.js", "lowcode/core/index.css", "lowcode/materials/root/view.js", "lowcode/materials/root/view.css", "lowcode/materials/antd/view.js", "lowcode/materials/antd/view.css", "lowcode/materials/antd-pro/view.js", "lowcode/materials/antd-pro/view.css", "lowcode/icon-font/app/iconfont.js"];
78
+ urls = ["prop-types/15.8.1/prop-types.min.js", "lodash/4.17.15/lodash.min.js", "dayjs/dayjs.min.js", "antdIcon/1.0.0/antdIcon.min.js", "lowcode/core/index.js", "lowcode/core/index.css", "lowcode/materials/root/view.js", "lowcode/materials/root/view.css", "lowcode/materials/antd/view.js", "lowcode/materials/antd/view.css", "lowcode/materials/antd-pro/view.js", "lowcode/materials/antd-pro/view.css", "lowcode/icon-font/app/iconfont.js"];
67
79
  _context2.next = 2;
68
80
  return (0, _common.loadPlugins)(urls.map(function (url) {
69
81
  return "https://cdn.zhiyunhe.com/plugin/" + url;
70
82
  }));
71
83
  case 2:
72
- ["RootMaterial", "AntdMaterial", "AntdProMaterial"].forEach(function (lib) {
73
- var data = window[lib];
74
- if (data) {
75
- Object.entries(data).forEach(function (_ref) {
76
- var key = _ref[0],
77
- value = _ref[1];
78
- // @ts-ignore
79
- components[key] = value;
80
- });
81
- }
82
- });
83
- window._components = components;
84
+ setComponents();
84
85
  case 3:
85
86
  case "end":
86
87
  return _context2.stop();
@@ -88,4 +89,19 @@ function _loadMaterials() {
88
89
  }, _callee2);
89
90
  }));
90
91
  return _loadMaterials.apply(this, arguments);
92
+ }
93
+ function setComponents() {
94
+ var components = {};
95
+ ["RootMaterial", "AntdMaterial", "AntdProMaterial"].forEach(function (lib) {
96
+ var data = window[lib];
97
+ if (data) {
98
+ Object.entries(data).forEach(function (_ref) {
99
+ var key = _ref[0],
100
+ value = _ref[1];
101
+ // @ts-ignore
102
+ components[key] = value;
103
+ });
104
+ }
105
+ });
106
+ window._components = components;
91
107
  }
@@ -3,16 +3,19 @@
3
3
  exports.__esModule = true;
4
4
  exports.PageLoading = PageLoading;
5
5
  require("./index.less");
6
+ var _react = require("react");
6
7
  function PageLoading(props) {
7
8
  var loading = props.loading,
8
9
  _props$background = props.background,
9
10
  background = _props$background === void 0 ? "#f1f1f1" : _props$background,
10
11
  children = props.children;
12
+ (0, _react.useEffect)(function () {}, [loading]);
11
13
  return /*#__PURE__*/React.createElement("div", {
12
14
  className: "page-loading-wrapper",
13
15
  style: {
14
16
  width: "100%",
15
- height: "100%"
17
+ height: "100%",
18
+ background: "rgba(0,0,0,0)"
16
19
  }
17
20
  }, children, loading && /*#__PURE__*/React.createElement("div", {
18
21
  className: "page-loading",
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./index.less";
2
- import utils from "./utils";
3
2
  import * as lodash from "lodash";
4
3
  export { LoadMaterials } from "./components/load-materials";
5
4
  export { PageLoading } from "./components/page-loading";
6
5
  export { RestApi, RestFormApi, apiRequest } from "./utils/api";
7
6
  export { Layout } from "./components/layout";
8
7
  export { ReactRender } from "./components/react-render";
8
+ import utils from "./utils/index";
9
9
  export { utils, lodash };
package/lib/index.js CHANGED
@@ -3,9 +3,8 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
5
  exports.lodash = exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.PageLoading = exports.LoadMaterials = exports.Layout = void 0;
6
+ var _message2 = _interopRequireDefault(require("antd/lib/message"));
6
7
  require("./index.less");
7
- var _utils = _interopRequireDefault(require("./utils"));
8
- exports.utils = _utils["default"];
9
8
  var _reactRender = require("./components/react-render");
10
9
  exports.ReactRender = _reactRender.ReactRender;
11
10
  var lodash = _interopRequireWildcard(require("lodash"));
@@ -20,6 +19,12 @@ exports.RestFormApi = _api.RestFormApi;
20
19
  exports.apiRequest = _api.apiRequest;
21
20
  var _layout = require("./components/layout");
22
21
  exports.Layout = _layout.Layout;
22
+ var _index2 = _interopRequireDefault(require("./utils/index"));
23
+ exports.utils = _index2["default"];
24
+ var _uniBridge = require("./utils/uni-bridge");
25
+ var _init = require("./init/init.bar-height");
26
+ var _init2 = require("./init/init.scroll-size");
27
+ var _init3 = require("./init/init.mobile-class");
23
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
29
  // @ts-ignore
25
30
  window.__ReactRender = _reactRender.ReactRender;
@@ -31,5 +36,18 @@ if (window._) {
31
36
  // @ts-ignore
32
37
  if (!window.utils) {
33
38
  // @ts-ignore
34
- window.utils = _utils["default"];
35
- }
39
+ window.utils = _index2["default"];
40
+ }
41
+ (0, _init3.initMobileClass)();
42
+
43
+ // @ts-ignore
44
+ _index2["default"].uniBridge = _uniBridge.uniBridge;
45
+ // @ts-ignore
46
+ window.uniBridge = _uniBridge.uniBridge;
47
+ _message2["default"].config({
48
+ top: 150,
49
+ duration: 5,
50
+ maxCount: 3
51
+ });
52
+ (0, _init.initBarHeight)();
53
+ (0, _init2.initScrollSize)();
package/lib/index.less CHANGED
@@ -1,7 +1,18 @@
1
+ :root {
2
+ --scroll-bar-width: 15px;
3
+ --scroll-bar-height: 15px;
4
+ }
5
+
6
+ .ant-table-cell-scrollbar {
7
+ padding: 0 !important;
8
+ width: var(--scroll-bar-width);
9
+ }
10
+
1
11
  [componentname="Page"] {
2
12
  height: 100%;
3
13
  }
4
14
 
15
+
5
16
  ul {
6
17
  margin-bottom: 0;
7
18
  padding-left: 0;
@@ -11,3 +22,13 @@ ul {
11
22
  .page-content {
12
23
  overflow: hidden;
13
24
  }
25
+
26
+ .print-iframe {
27
+ position: fixed;
28
+ z-index: -1;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100vw;
32
+ height: 100vh;
33
+ background: white;
34
+ }
@@ -0,0 +1 @@
1
+ export declare function initBarHeight(): void;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.initBarHeight = initBarHeight;
6
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+ var _uniBridge = require("../utils/uni-bridge");
9
+ var bar_height_key = "bar_height";
10
+ function initBarHeight() {
11
+ updateBarHeight();
12
+ window.onload = function () {
13
+ setTimeout(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
14
+ var height;
15
+ return _regenerator["default"].wrap(function (_context) {
16
+ while (1) switch (_context.prev = _context.next) {
17
+ case 0:
18
+ if (!window.uni) {
19
+ _context.next = 2;
20
+ break;
21
+ }
22
+ _context.next = 1;
23
+ return _uniBridge.uniBridge.getBarHeight();
24
+ case 1:
25
+ height = _context.sent;
26
+ localStorage.setItem(bar_height_key, height);
27
+ updateBarHeight();
28
+ case 2:
29
+ case "end":
30
+ return _context.stop();
31
+ }
32
+ }, _callee);
33
+ })), 100);
34
+ };
35
+ }
36
+ function updateBarHeight() {
37
+ var style = document.documentElement.style;
38
+ var barHeight = localStorage.getItem(bar_height_key);
39
+ if (barHeight) {
40
+ style.setProperty('--bar-height', barHeight);
41
+ }
42
+ }
@@ -0,0 +1 @@
1
+ export declare function initMobileClass(): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.initMobileClass = initMobileClass;
5
+ var _common = require("../utils/common");
6
+ function initMobileClass() {
7
+ window.isMobile = (0, _common.isMobile)();
8
+ if (window.isMobile) {
9
+ var classList = window.document.body.classList;
10
+ if (!classList.contains("mobile")) {
11
+ classList.add("mobile");
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ export declare function initScrollSize(): void;
2
+ export declare function getScrollbarSize(): {
3
+ width?: number;
4
+ height?: number;
5
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getScrollbarSize = getScrollbarSize;
5
+ exports.initScrollSize = initScrollSize;
6
+ var scrollbarSize = {};
7
+
8
+ // @ts-ignore
9
+ window.scrollbarSize = scrollbarSize;
10
+ function initScrollSize() {
11
+ var size = getScrollbarSize();
12
+ var style = document.documentElement.style;
13
+ style.setProperty('--scroll-bar-height', size.height + "px");
14
+ style.setProperty('--scroll-bar-width', size.width + "px");
15
+ }
16
+ function getScrollbarSize() {
17
+ if (typeof scrollbarSize.height == "number" && typeof scrollbarSize.width == "number") {
18
+ return scrollbarSize;
19
+ }
20
+ var outer = document.createElement('div');
21
+ outer.style.cssText = "\n visibility: hidden;\n overflow: scroll;\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n ";
22
+ document.body.appendChild(outer);
23
+ var inner = document.createElement('div');
24
+ inner.style.width = '100%';
25
+ inner.style.height = '100%';
26
+ outer.appendChild(inner);
27
+ scrollbarSize.width = outer.offsetWidth - inner.offsetWidth;
28
+ scrollbarSize.height = outer.offsetHeight - inner.offsetHeight;
29
+ document.body.removeChild(outer);
30
+ return scrollbarSize;
31
+ }
package/lib/style.js CHANGED
@@ -1,9 +1,9 @@
1
+ require('antd/lib/message/style');
2
+ require('antd/lib/config-provider/style');
3
+
1
4
  require('antd/lib/notification/style');
2
5
  require('antd/lib/modal/style');
3
- require('antd/lib/message/style');
4
6
  require('antd/lib/typography/style');
5
7
  require('antd/lib/drawer/style');
6
8
  require('antd/lib/result/style');
7
- require('antd/lib/config-provider/style');
8
-
9
9
  require('./index.less');
@@ -12,8 +12,10 @@ export declare class RestFormApi<DataType> extends RestApi<DataType> {
12
12
  handleRequestConfig(config: AxiosRequestConfig): Promise<void>;
13
13
  search(searchParams?: RestSearchParams): Promise<ManyResult<DataType>>;
14
14
  getById(id: string, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
15
+ labelToValue(data: any[], options?: any): Promise<ManyResult<DataType>>;
15
16
  save(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
16
17
  create(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
17
18
  update(id: string, data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
19
+ fieldFilters(searchParams?: RestSearchParams): Promise<ManyResult<DataType>>;
18
20
  serviceUpdate(data: DataType, options?: BaseRequestOptions<DataType>): Promise<import("axios").AxiosResponse<any, any, {}>>;
19
21
  }