@pisell/lowcode-renderer 1.0.104 → 1.0.105
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/README.md +2 -2
- package/es/ReactRenderer/index.d.ts +3 -0
- package/es/ReactRenderer/index.js +64 -31
- package/es/Render/index.d.ts +16 -20
- package/es/Render/index.js +243 -146
- package/es/Render/index.less +6 -6
- package/es/api/index.d.ts +7 -0
- package/es/api/index.js +6 -11
- package/es/api/report/URL.d.ts +39 -0
- package/es/api/report/URL.js +71 -42
- package/es/api/report/index.d.ts +5 -0
- package/es/api/report/index.js +112 -75
- package/es/api/utils/index.d.ts +2 -0
- package/es/api/utils/index.js +1 -5
- package/es/appHelper/index.d.ts +2 -0
- package/es/appHelper/index.js +26 -28
- package/es/appHelper/others.d.ts +1 -0
- package/es/appHelper/others.js +8 -10
- package/es/config/index.d.ts +15 -14
- package/es/config/index.js +14 -13
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -8
- package/lib/ReactRenderer/index.d.ts +3 -0
- package/lib/ReactRenderer/index.js +75 -40
- package/lib/Render/index.d.ts +16 -20
- package/lib/Render/index.js +187 -152
- package/lib/Render/index.less +6 -6
- package/lib/api/index.d.ts +7 -0
- package/lib/api/index.js +37 -8
- package/lib/api/report/URL.d.ts +39 -0
- package/lib/api/report/URL.js +98 -40
- package/lib/api/report/index.d.ts +5 -0
- package/lib/api/report/index.js +116 -83
- package/lib/api/utils/index.d.ts +2 -0
- package/lib/api/utils/index.js +23 -4
- package/lib/appHelper/index.d.ts +2 -0
- package/lib/appHelper/index.js +58 -27
- package/lib/appHelper/others.d.ts +1 -0
- package/lib/appHelper/others.js +48 -17
- package/lib/config/index.d.ts +15 -14
- package/lib/config/index.js +46 -21
- package/lib/index.d.ts +4 -3
- package/lib/index.js +41 -9
- package/package.json +2 -2
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js +0 -28
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/defineProperty.js +0 -14
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js +0 -27
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js +0 -15
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutPropertiesLoose.js +0 -13
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPrimitive.js +0 -16
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPropertyKey.js +0 -11
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/typeof.js +0 -12
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js +0 -29
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/defineProperty.js +0 -14
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js +0 -27
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js +0 -15
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutPropertiesLoose.js +0 -14
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPrimitive.js +0 -16
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPropertyKey.js +0 -11
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/typeof.js +0 -18
- package/lib/_virtual/rolldown_runtime.js +0 -29
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# @pisell/lowcode-renderer
|
|
2
|
-
|
|
1
|
+
# @pisell/lowcode-renderer
|
|
2
|
+
|
|
3
3
|
pisell 低代码渲染器
|
|
@@ -1,42 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
6
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
9
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
import React, { Component, PureComponent, createElement, createContext, forwardRef } from 'react';
|
|
16
|
+
import ReactDOM from 'react-dom';
|
|
17
|
+
import { adapter, pageRendererFactory, componentRendererFactory, blockRendererFactory, addonRendererFactory, tempRendererFactory, rendererFactory } from '@alilc/lowcode-renderer-core';
|
|
18
|
+
import ConfigProvider from '@alifd/next/lib/config-provider';
|
|
5
19
|
|
|
6
|
-
|
|
20
|
+
// https://github.com/alibaba/lowcode-engine/blob/5cc4715daf510a64b6bf10c51b3a12df2bc62a36/packages/react-renderer/src/index.ts#L15
|
|
21
|
+
// 此处进行改造旨在解决低代码引擎在渲染时React和React DOM版本不匹配的问题
|
|
22
|
+
// 在shop的externals中添加React和React DOM可以解决这个问题,但会出现以下警告
|
|
23
|
+
// 为了避免在生产环境中出现问题,我们在此处使用统一React 和 React DOM
|
|
24
|
+
// Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17.
|
|
7
25
|
window.React = React;
|
|
8
26
|
window.ReactDom = ReactDOM;
|
|
9
27
|
window.ReactDOM = ReactDOM;
|
|
10
28
|
adapter.setRuntime({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
29
|
+
Component: Component,
|
|
30
|
+
PureComponent: PureComponent,
|
|
31
|
+
createContext: createContext,
|
|
32
|
+
createElement: createElement,
|
|
33
|
+
forwardRef: forwardRef,
|
|
34
|
+
findDOMNode: ReactDOM === null || ReactDOM === void 0 ? void 0 : ReactDOM.findDOMNode
|
|
17
35
|
});
|
|
18
36
|
adapter.setRenderers({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
PageRenderer: pageRendererFactory(),
|
|
38
|
+
ComponentRenderer: componentRendererFactory(),
|
|
39
|
+
BlockRenderer: blockRendererFactory(),
|
|
40
|
+
AddonRenderer: addonRendererFactory(),
|
|
41
|
+
TempRenderer: tempRendererFactory(),
|
|
42
|
+
DivRenderer: blockRendererFactory()
|
|
25
43
|
});
|
|
26
44
|
adapter.setConfigProvider(ConfigProvider);
|
|
27
45
|
function factory() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
var Renderer = rendererFactory();
|
|
47
|
+
return /*#__PURE__*/function (_Renderer) {
|
|
48
|
+
_inherits(ReactRenderer, _Renderer);
|
|
49
|
+
var _super = _createSuper(ReactRenderer);
|
|
50
|
+
function ReactRenderer(props, context) {
|
|
51
|
+
var _this;
|
|
52
|
+
_classCallCheck(this, ReactRenderer);
|
|
53
|
+
_this = _super.call(this, props, context);
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "context", void 0);
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "setState", void 0);
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "forceUpdate", void 0);
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "refs", void 0);
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
_createClass(ReactRenderer, [{
|
|
66
|
+
key: "isValidComponent",
|
|
67
|
+
value: function isValidComponent(obj) {
|
|
68
|
+
var _obj$prototype;
|
|
69
|
+
return (obj === null || obj === void 0 || (_obj$prototype = obj.prototype) === null || _obj$prototype === void 0 ? void 0 : _obj$prototype.isReactComponent) || (obj === null || obj === void 0 ? void 0 : obj.prototype) instanceof Component;
|
|
70
|
+
}
|
|
71
|
+
}]);
|
|
72
|
+
return ReactRenderer;
|
|
73
|
+
}(Renderer);
|
|
38
74
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//#endregion
|
|
42
|
-
export { ReactRenderer_default as default };
|
|
75
|
+
export default factory();
|
package/es/Render/index.d.ts
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
declare const Render: (props: RenderProps) => react_jsx_runtime0.JSX.Element | null;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { Render };
|
|
1
|
+
import { IRendererAppHelper } from "@alilc/lowcode-renderer-core/lib/types";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface RenderProps {
|
|
4
|
+
packages: Record<string, any>;
|
|
5
|
+
projectSchema?: Record<string, any> | null;
|
|
6
|
+
className?: string;
|
|
7
|
+
appHelper?: IRendererAppHelper;
|
|
8
|
+
locale?: string;
|
|
9
|
+
isShowSkeleton?: boolean;
|
|
10
|
+
isLoadedAssets?: boolean;
|
|
11
|
+
loadingType?: "spin" | "skeleton";
|
|
12
|
+
isRender?: boolean;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
declare const Render: (props: RenderProps) => JSX.Element | null;
|
|
16
|
+
export default Render;
|
package/es/Render/index.js
CHANGED
|
@@ -1,153 +1,250 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["packages", "projectSchema", "className", "appHelper", "locale", "isShowSkeleton", "isLoadedAssets", "loadingType", "isRender"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
19
|
import { injectComponents } from "@alilc/lowcode-plugin-inject";
|
|
7
20
|
import { AssetLoader, buildComponents } from "@alilc/lowcode-utils";
|
|
8
21
|
import { Skeleton, Spin } from "antd";
|
|
9
|
-
import {
|
|
10
|
-
import React, { useEffect,
|
|
22
|
+
import { isArray, mergeWith, cloneDeep } from "lodash-es";
|
|
23
|
+
import React, { useEffect, useState, useMemo } from "react";
|
|
24
|
+
import ReactRenderer from "../ReactRenderer";
|
|
25
|
+
import appHelper from "../appHelper";
|
|
11
26
|
import { generateUniqueIdByObj } from "@pisell/utils";
|
|
12
27
|
import "./index.less";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
/**
|
|
30
|
+
* 缓存处理后的data信息 二次访问时
|
|
31
|
+
* 直接从缓存中获取
|
|
32
|
+
*/
|
|
33
|
+
var cacheDataMap = new Map();
|
|
14
34
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (isArray(objValue)) return objValue.concat(srcValue || []);
|
|
139
|
-
}
|
|
140
|
-
if (!isRender) return null;
|
|
141
|
-
return /* @__PURE__ */ jsx(ReactRenderer_default, _objectSpread2(_objectSpread2({}, others), {}, {
|
|
142
|
-
className: `lowcode-plugin-sample-preview-content ${className}`,
|
|
143
|
-
schema: _objectSpread2(_objectSpread2({}, schema), {}, { dataSource: mergeWith(schema.dataSource, projectDataSource, customizer) }),
|
|
144
|
-
appHelper: mergeWith(cloneDeep(appHelper_default), propsAppHelper),
|
|
145
|
-
components,
|
|
146
|
-
messages: i18n,
|
|
147
|
-
locale
|
|
148
|
-
}));
|
|
149
|
-
};
|
|
150
|
-
var Render_default = Render;
|
|
35
|
+
/**
|
|
36
|
+
* 资产加载Promise缓存,用于避免竞态问题
|
|
37
|
+
* - 正在加载:存储 pending Promise,后续请求等待同一个 Promise
|
|
38
|
+
* - 已加载完成:存储 resolved Promise,后续请求直接通过
|
|
39
|
+
* - 加载失败:删除缓存,允许重试
|
|
40
|
+
*/
|
|
41
|
+
var assetPromiseCache = new Map();
|
|
42
|
+
var Render = function Render(props) {
|
|
43
|
+
var packages = props.packages,
|
|
44
|
+
projectSchema = props.projectSchema,
|
|
45
|
+
className = props.className,
|
|
46
|
+
propsAppHelper = props.appHelper,
|
|
47
|
+
locale = props.locale,
|
|
48
|
+
_props$isShowSkeleton = props.isShowSkeleton,
|
|
49
|
+
isShowSkeleton = _props$isShowSkeleton === void 0 ? true : _props$isShowSkeleton,
|
|
50
|
+
isLoadedAssets = props.isLoadedAssets,
|
|
51
|
+
_props$loadingType = props.loadingType,
|
|
52
|
+
loadingType = _props$loadingType === void 0 ? "skeleton" : _props$loadingType,
|
|
53
|
+
_props$isRender = props.isRender,
|
|
54
|
+
isRender = _props$isRender === void 0 ? true : _props$isRender,
|
|
55
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
56
|
+
var schemaHash = useMemo(function () {
|
|
57
|
+
if (projectSchema) {
|
|
58
|
+
return generateUniqueIdByObj(projectSchema);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}, [projectSchema]);
|
|
62
|
+
var _useState = useState(schemaHash ? cacheDataMap.get(schemaHash) || {} : {}),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
data = _useState2[0],
|
|
65
|
+
setData = _useState2[1];
|
|
66
|
+
var _ref = data,
|
|
67
|
+
schema = _ref.schema,
|
|
68
|
+
components = _ref.components,
|
|
69
|
+
_ref$i18n = _ref.i18n,
|
|
70
|
+
i18n = _ref$i18n === void 0 ? {} : _ref$i18n,
|
|
71
|
+
_ref$projectDataSourc = _ref.projectDataSource,
|
|
72
|
+
projectDataSource = _ref$projectDataSourc === void 0 ? {} : _ref$projectDataSourc;
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
// body追加id来处理antd 5 取消:where 时css权重问题
|
|
75
|
+
// 物料中css使用post-css追加 #body 前缀
|
|
76
|
+
document.body.id = "body";
|
|
77
|
+
}, []);
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
function init() {
|
|
80
|
+
return _init.apply(this, arguments);
|
|
81
|
+
}
|
|
82
|
+
function _init() {
|
|
83
|
+
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
84
|
+
var componentsMapArray, componentsTree, i18n, projectDataSource, componentsMap, packagesMap, pageSchema, libraryMap, libraryAsset, assetKey, loadingPromise, components, _data;
|
|
85
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
86
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
if (projectSchema) {
|
|
89
|
+
_context2.next = 2;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return _context2.abrupt("return");
|
|
93
|
+
case 2:
|
|
94
|
+
console.log(performance.now(), 'init');
|
|
95
|
+
console.time('lowcode-init');
|
|
96
|
+
componentsMapArray = projectSchema.componentsMap, componentsTree = projectSchema.componentsTree, i18n = projectSchema.i18n, projectDataSource = projectSchema.dataSource;
|
|
97
|
+
componentsMap = {};
|
|
98
|
+
packagesMap = {};
|
|
99
|
+
componentsMapArray.forEach(function (component) {
|
|
100
|
+
packagesMap[component.package] = true;
|
|
101
|
+
componentsMap[component.componentName] = component;
|
|
102
|
+
});
|
|
103
|
+
pageSchema = componentsTree[0];
|
|
104
|
+
libraryMap = {};
|
|
105
|
+
libraryAsset = [];
|
|
106
|
+
packages.forEach(function (_ref3) {
|
|
107
|
+
var _package = _ref3.package,
|
|
108
|
+
library = _ref3.library,
|
|
109
|
+
urls = _ref3.urls,
|
|
110
|
+
renderUrls = _ref3.renderUrls;
|
|
111
|
+
// if (!packagesMap[_package]) return;
|
|
112
|
+
libraryMap[_package] = library;
|
|
113
|
+
if (renderUrls) {
|
|
114
|
+
libraryAsset.push(renderUrls);
|
|
115
|
+
} else if (urls) {
|
|
116
|
+
libraryAsset.push(urls);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// console.log(libraryMap,'libraryMap',libraryAsset);
|
|
121
|
+
// const vendors = [assetBundle(libraryAsset, AssetLevel.Library)];
|
|
122
|
+
console.timeEnd('lowcode-init');
|
|
123
|
+
|
|
124
|
+
// 静态资源load后不再二次加载,使用Promise缓存避免竞态问题
|
|
125
|
+
if (isLoadedAssets) {
|
|
126
|
+
_context2.next = 19;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
// 生成资产的唯一标识
|
|
130
|
+
assetKey = JSON.stringify(libraryAsset); // 检查缓存中是否存在(包括正在加载和已加载完成的)
|
|
131
|
+
loadingPromise = assetPromiseCache.get(assetKey);
|
|
132
|
+
if (!loadingPromise) {
|
|
133
|
+
// 创建新的加载Promise
|
|
134
|
+
loadingPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
135
|
+
var assetLoader;
|
|
136
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
137
|
+
while (1) switch (_context.prev = _context.next) {
|
|
138
|
+
case 0:
|
|
139
|
+
_context.prev = 0;
|
|
140
|
+
assetLoader = new AssetLoader();
|
|
141
|
+
_context.next = 4;
|
|
142
|
+
return assetLoader.load(libraryAsset);
|
|
143
|
+
case 4:
|
|
144
|
+
_context.next = 10;
|
|
145
|
+
break;
|
|
146
|
+
case 6:
|
|
147
|
+
_context.prev = 6;
|
|
148
|
+
_context.t0 = _context["catch"](0);
|
|
149
|
+
// 加载失败时从缓存中移除,允许重试
|
|
150
|
+
assetPromiseCache.delete(assetKey);
|
|
151
|
+
throw _context.t0;
|
|
152
|
+
case 10:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context.stop();
|
|
155
|
+
}
|
|
156
|
+
}, _callee, null, [[0, 6]]);
|
|
157
|
+
}))();
|
|
151
158
|
|
|
152
|
-
|
|
153
|
-
|
|
159
|
+
// 缓存Promise(无论是pending还是resolved,都可以被await)
|
|
160
|
+
assetPromiseCache.set(assetKey, loadingPromise);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 等待加载完成(新创建的或已存在的Promise)
|
|
164
|
+
_context2.next = 19;
|
|
165
|
+
return loadingPromise;
|
|
166
|
+
case 19:
|
|
167
|
+
console.timeEnd('lowcode-isLoadedAssets');
|
|
168
|
+
console.time('lowcode-injectComponents');
|
|
169
|
+
_context2.next = 23;
|
|
170
|
+
return injectComponents(
|
|
171
|
+
// @ts-ignore
|
|
172
|
+
buildComponents(libraryMap, componentsMap));
|
|
173
|
+
case 23:
|
|
174
|
+
components = _context2.sent;
|
|
175
|
+
console.timeEnd('lowcode-injectComponents');
|
|
176
|
+
_data = {
|
|
177
|
+
schema: pageSchema,
|
|
178
|
+
components: components,
|
|
179
|
+
i18n: i18n,
|
|
180
|
+
projectDataSource: projectDataSource
|
|
181
|
+
};
|
|
182
|
+
cacheDataMap.set(schemaHash, _data);
|
|
183
|
+
setData(_data);
|
|
184
|
+
case 28:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context2.stop();
|
|
187
|
+
}
|
|
188
|
+
}, _callee2);
|
|
189
|
+
}));
|
|
190
|
+
return _init.apply(this, arguments);
|
|
191
|
+
}
|
|
192
|
+
var _ref2 = data,
|
|
193
|
+
schema = _ref2.schema,
|
|
194
|
+
components = _ref2.components,
|
|
195
|
+
_ref2$i18n = _ref2.i18n,
|
|
196
|
+
i18n = _ref2$i18n === void 0 ? {} : _ref2$i18n,
|
|
197
|
+
_ref2$projectDataSour = _ref2.projectDataSource,
|
|
198
|
+
projectDataSource = _ref2$projectDataSour === void 0 ? {} : _ref2$projectDataSour;
|
|
199
|
+
if (!schema || !components) {
|
|
200
|
+
init();
|
|
201
|
+
}
|
|
202
|
+
}, [data, projectSchema, schemaHash]);
|
|
203
|
+
useEffect(function () {
|
|
204
|
+
console.log(performance.now(), 'schema components', schema, components);
|
|
205
|
+
}, [schema, components]);
|
|
206
|
+
if (!schema || !components) {
|
|
207
|
+
if (!isShowSkeleton) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
if (loadingType === "spin") {
|
|
211
|
+
return /*#__PURE__*/_jsx("div", {
|
|
212
|
+
style: {
|
|
213
|
+
height: '100%',
|
|
214
|
+
width: '100%',
|
|
215
|
+
display: 'flex',
|
|
216
|
+
justifyContent: 'center',
|
|
217
|
+
alignItems: 'center'
|
|
218
|
+
},
|
|
219
|
+
children: /*#__PURE__*/_jsx(Spin, {})
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return /*#__PURE__*/_jsx("div", {
|
|
223
|
+
style: {
|
|
224
|
+
padding: 20
|
|
225
|
+
},
|
|
226
|
+
children: /*#__PURE__*/_jsx(Skeleton, {
|
|
227
|
+
loading: true,
|
|
228
|
+
active: true,
|
|
229
|
+
round: true
|
|
230
|
+
})
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function customizer(objValue, srcValue) {
|
|
234
|
+
if (isArray(objValue)) {
|
|
235
|
+
return objValue.concat(srcValue || []);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (!isRender) return null;
|
|
239
|
+
return /*#__PURE__*/_jsx(ReactRenderer, _objectSpread(_objectSpread({}, others), {}, {
|
|
240
|
+
className: "lowcode-plugin-sample-preview-content ".concat(className),
|
|
241
|
+
schema: _objectSpread(_objectSpread({}, schema), {}, {
|
|
242
|
+
dataSource: mergeWith(schema.dataSource, projectDataSource, customizer)
|
|
243
|
+
}),
|
|
244
|
+
appHelper: mergeWith(cloneDeep(appHelper), propsAppHelper),
|
|
245
|
+
components: components,
|
|
246
|
+
messages: i18n,
|
|
247
|
+
locale: locale
|
|
248
|
+
}));
|
|
249
|
+
};
|
|
250
|
+
export default Render;
|
package/es/Render/index.less
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.lowcode-render-spin-wrap {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
1
|
+
.lowcode-render-spin-wrap {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
report: {
|
|
3
|
+
getReportList: (values: any, url: "REPORT_DETAILED_TRANSACTIONS" | "REPORT_DETAILED_PRODUCT_SALES" | "REPORT_DAILY_SUMMARY_BY_PAYMETHOD" | "REPORT_DAILY_SUMMARY_BY_ORDER" | "REPORT_DETAILED_ORDERS" | "REPORT_MONTH_SUMMARY_BY_ORDER" | "REPORT_WEEK_SUMMARY_BY_ORDER" | "REPORT_DASHBOARD" | "DAILY_SUMMARY_BY_PRODUCT" | "SALES_SUMMARY_BY_PRODUCT" | "TEAM_MEMBERS_COMMISSION_DETAIL" | "TEAM_SELF_COMMISSION_DETAIL" | "TEAM_MEMBERS_COMMISSION_SUMMARY_BY_WEEK" | "BOOKING_BY_CHECK_IN_OUT_DATE" | "SALES_SUMMARY_BY_CHANNEL" | "SALES_SUMMARY_BY_PAYMENT_METHOD" | "SALES_SUMMARY_BY_CHANNEL_PAYMENT_METHOD" | "TEAM_MEMBERS_COMMISSION_SUMMARY_BY_PERIOD") => Promise<any>;
|
|
4
|
+
};
|
|
5
|
+
utils: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
package/es/api/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
utils: utils_default
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
export { api_default as default };
|
|
1
|
+
import report from "./report";
|
|
2
|
+
import utils from "./utils";
|
|
3
|
+
export default {
|
|
4
|
+
report: report,
|
|
5
|
+
utils: utils
|
|
6
|
+
};
|