@pisell/lowcode-renderer 1.0.1
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 +3 -0
- package/es/ReactRenderer/index.d.ts +3 -0
- package/es/ReactRenderer/index.js +71 -0
- package/es/Render/index.d.ts +10 -0
- package/es/Render/index.js +144 -0
- package/es/Render/index.less +0 -0
- package/es/api/index.d.ts +7 -0
- package/es/api/index.js +6 -0
- package/es/api/report/URL.d.ts +17 -0
- package/es/api/report/URL.js +29 -0
- package/es/api/report/index.d.ts +5 -0
- package/es/api/report/index.js +68 -0
- package/es/api/utils/index.d.ts +2 -0
- package/es/api/utils/index.js +1 -0
- package/es/appHelper/index.d.ts +11 -0
- package/es/appHelper/index.js +7 -0
- package/es/config/index.d.ts +8 -0
- package/es/config/index.js +5 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +4 -0
- package/lib/ReactRenderer/index.d.ts +3 -0
- package/lib/ReactRenderer/index.js +72 -0
- package/lib/Render/index.d.ts +10 -0
- package/lib/Render/index.js +122 -0
- package/lib/Render/index.less +0 -0
- package/lib/api/index.d.ts +7 -0
- package/lib/api/index.js +40 -0
- package/lib/api/report/URL.d.ts +17 -0
- package/lib/api/report/URL.js +57 -0
- package/lib/api/report/index.d.ts +5 -0
- package/lib/api/report/index.js +72 -0
- package/lib/api/utils/index.d.ts +2 -0
- package/lib/api/utils/index.js +25 -0
- package/lib/appHelper/index.d.ts +11 -0
- package/lib/appHelper/index.js +41 -0
- package/lib/config/index.d.ts +8 -0
- package/lib/config/index.js +34 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +42 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
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';
|
|
19
|
+
|
|
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.
|
|
25
|
+
window.React = React;
|
|
26
|
+
window.ReactDom = ReactDOM;
|
|
27
|
+
window.ReactDOM = ReactDOM;
|
|
28
|
+
adapter.setRuntime({
|
|
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
|
|
35
|
+
});
|
|
36
|
+
adapter.setRenderers({
|
|
37
|
+
PageRenderer: pageRendererFactory(),
|
|
38
|
+
ComponentRenderer: componentRendererFactory(),
|
|
39
|
+
BlockRenderer: blockRendererFactory(),
|
|
40
|
+
AddonRenderer: addonRendererFactory(),
|
|
41
|
+
TempRenderer: tempRendererFactory(),
|
|
42
|
+
DivRenderer: blockRendererFactory()
|
|
43
|
+
});
|
|
44
|
+
adapter.setConfigProvider(ConfigProvider);
|
|
45
|
+
function factory() {
|
|
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
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
55
|
+
_defineProperty(_assertThisInitialized(_this), "context", void 0);
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "setState", void 0);
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "forceUpdate", void 0);
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "refs", void 0);
|
|
59
|
+
return _this;
|
|
60
|
+
}
|
|
61
|
+
_createClass(ReactRenderer, [{
|
|
62
|
+
key: "isValidComponent",
|
|
63
|
+
value: function isValidComponent(obj) {
|
|
64
|
+
var _obj$prototype;
|
|
65
|
+
return (obj === null || obj === void 0 ? 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;
|
|
66
|
+
}
|
|
67
|
+
}]);
|
|
68
|
+
return ReactRenderer;
|
|
69
|
+
}(Renderer);
|
|
70
|
+
}
|
|
71
|
+
export default factory();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IRendererAppHelper } from "@alilc/lowcode-renderer-core/lib/types";
|
|
3
|
+
interface RenderProps {
|
|
4
|
+
packages: Record<string, any>;
|
|
5
|
+
projectSchema: Record<string, any>;
|
|
6
|
+
className?: string;
|
|
7
|
+
appHelper?: IRendererAppHelper;
|
|
8
|
+
}
|
|
9
|
+
declare const Render: (props: RenderProps) => JSX.Element;
|
|
10
|
+
export default Render;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
|
+
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); } }
|
|
9
|
+
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); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { injectComponents } from "@alilc/lowcode-plugin-inject";
|
|
17
|
+
import { AssetLoader, buildComponents } from "@alilc/lowcode-utils";
|
|
18
|
+
import { Skeleton } from "antd";
|
|
19
|
+
import isArray from "lodash/isArray";
|
|
20
|
+
import mergeWith from "lodash/mergeWith";
|
|
21
|
+
import { useEffect, useState } from "react";
|
|
22
|
+
import ReactRenderer from "../ReactRenderer";
|
|
23
|
+
import appHelper from "../appHelper";
|
|
24
|
+
var Render = function Render(props) {
|
|
25
|
+
var packages = props.packages,
|
|
26
|
+
projectSchema = props.projectSchema,
|
|
27
|
+
className = props.className,
|
|
28
|
+
propsAppHelper = props.appHelper;
|
|
29
|
+
var _useState = useState({}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
data = _useState2[0],
|
|
32
|
+
setData = _useState2[1];
|
|
33
|
+
var _ref = data,
|
|
34
|
+
schema = _ref.schema,
|
|
35
|
+
components = _ref.components,
|
|
36
|
+
_ref$i18n = _ref.i18n,
|
|
37
|
+
i18n = _ref$i18n === void 0 ? {} : _ref$i18n,
|
|
38
|
+
_ref$projectDataSourc = _ref.projectDataSource,
|
|
39
|
+
projectDataSource = _ref$projectDataSourc === void 0 ? {} : _ref$projectDataSourc;
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
function init() {
|
|
42
|
+
return _init.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
function _init() {
|
|
45
|
+
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
46
|
+
var componentsMapArray, componentsTree, i18n, projectDataSource, componentsMap, packagesMap, pageSchema, libraryMap, libraryAsset, assetLoader, components;
|
|
47
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
if (projectSchema) {
|
|
51
|
+
_context.next = 2;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
return _context.abrupt("return");
|
|
55
|
+
case 2:
|
|
56
|
+
componentsMapArray = projectSchema.componentsMap, componentsTree = projectSchema.componentsTree, i18n = projectSchema.i18n, projectDataSource = projectSchema.dataSource;
|
|
57
|
+
componentsMap = {};
|
|
58
|
+
packagesMap = {};
|
|
59
|
+
componentsMapArray.forEach(function (component) {
|
|
60
|
+
packagesMap[component.package] = true;
|
|
61
|
+
componentsMap[component.componentName] = component;
|
|
62
|
+
});
|
|
63
|
+
pageSchema = componentsTree[0];
|
|
64
|
+
libraryMap = {};
|
|
65
|
+
libraryAsset = [];
|
|
66
|
+
packages.forEach(function (_ref3) {
|
|
67
|
+
var _package = _ref3.package,
|
|
68
|
+
library = _ref3.library,
|
|
69
|
+
urls = _ref3.urls,
|
|
70
|
+
renderUrls = _ref3.renderUrls;
|
|
71
|
+
// if (!packagesMap[_package]) return;
|
|
72
|
+
libraryMap[_package] = library;
|
|
73
|
+
if (renderUrls) {
|
|
74
|
+
libraryAsset.push(renderUrls);
|
|
75
|
+
} else if (urls) {
|
|
76
|
+
libraryAsset.push(urls);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// console.log(libraryMap,'libraryMap',libraryAsset);
|
|
81
|
+
// const vendors = [assetBundle(libraryAsset, AssetLevel.Library)];
|
|
82
|
+
|
|
83
|
+
// TODO asset may cause pollution
|
|
84
|
+
assetLoader = new AssetLoader();
|
|
85
|
+
_context.next = 13;
|
|
86
|
+
return assetLoader.load(libraryAsset);
|
|
87
|
+
case 13:
|
|
88
|
+
_context.next = 15;
|
|
89
|
+
return injectComponents(buildComponents(libraryMap, componentsMap));
|
|
90
|
+
case 15:
|
|
91
|
+
components = _context.sent;
|
|
92
|
+
// console.log(components,'components');
|
|
93
|
+
|
|
94
|
+
setData({
|
|
95
|
+
schema: pageSchema,
|
|
96
|
+
components: components,
|
|
97
|
+
i18n: i18n,
|
|
98
|
+
projectDataSource: projectDataSource
|
|
99
|
+
});
|
|
100
|
+
case 17:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context.stop();
|
|
103
|
+
}
|
|
104
|
+
}, _callee);
|
|
105
|
+
}));
|
|
106
|
+
return _init.apply(this, arguments);
|
|
107
|
+
}
|
|
108
|
+
var _ref2 = data,
|
|
109
|
+
schema = _ref2.schema,
|
|
110
|
+
components = _ref2.components,
|
|
111
|
+
_ref2$i18n = _ref2.i18n,
|
|
112
|
+
i18n = _ref2$i18n === void 0 ? {} : _ref2$i18n,
|
|
113
|
+
_ref2$projectDataSour = _ref2.projectDataSource,
|
|
114
|
+
projectDataSource = _ref2$projectDataSour === void 0 ? {} : _ref2$projectDataSour;
|
|
115
|
+
if (!schema || !components) {
|
|
116
|
+
init();
|
|
117
|
+
}
|
|
118
|
+
}, [data]);
|
|
119
|
+
if (!schema || !components) {
|
|
120
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
style: {
|
|
122
|
+
padding: 20
|
|
123
|
+
}
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
125
|
+
loading: true,
|
|
126
|
+
active: true,
|
|
127
|
+
round: true
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
function customizer(objValue, srcValue) {
|
|
131
|
+
if (isArray(objValue)) {
|
|
132
|
+
return objValue.concat(srcValue || []);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return /*#__PURE__*/React.createElement(ReactRenderer, {
|
|
136
|
+
className: "lowcode-plugin-sample-preview-content ".concat(className),
|
|
137
|
+
schema: _objectSpread(_objectSpread({}, schema), {}, {
|
|
138
|
+
dataSource: mergeWith(schema.dataSource, projectDataSource, customizer)
|
|
139
|
+
}),
|
|
140
|
+
appHelper: mergeWith(appHelper, propsAppHelper),
|
|
141
|
+
components: components
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
export default Render;
|
|
File without changes
|
|
@@ -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") => Promise<any>;
|
|
4
|
+
};
|
|
5
|
+
utils: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
package/es/api/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const REPORT_DETAILED_TRANSACTIONS = "https://prod-03.australiasoutheast.logic.azure.com:443/workflows/cc1bc2ac0f824122a51b1cc17f099789/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=i464OhQO9VjuiVw14YUNBgKPAhambDmCzPC_6bKZBxM";
|
|
2
|
+
export declare const REPORT_DETAILED_PRODUCT_SALES = "https://prod-08.australiasoutheast.logic.azure.com:443/workflows/40bf1ebddfaf414fb43430843655ebee/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=sdEFIBnqWc_xxomkbnhq__ySZ6BBe2Cfs3ATeWp898s";
|
|
3
|
+
export declare const REPORT_DAILY_SUMMARY_BY_PAYMETHOD = "https://prod-25.australiasoutheast.logic.azure.com:443/workflows/69ecf67d14dc4c5494ac6e58e4168b44/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=VwrALdkCWZBuoy4AMq3sxLuTD8mrDS6gAWmQG9ma27g";
|
|
4
|
+
export declare const REPORT_DAILY_SUMMARY_BY_ORDER = "https://prod-28.australiasoutheast.logic.azure.com:443/workflows/4c579e57f93143518bb0b51675681ba5/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=kb4szs5DXpjQab87inkBfr2AL-w0wyxA5uQF8Vt2WcE";
|
|
5
|
+
export declare const REPORT_DETAILED_ORDERS = "https://prod-22.australiasoutheast.logic.azure.com:443/workflows/2a71808194724ce7966fc516cbea6889/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=7GtvCsK-jcsx4lszeJm295X3uCBLP4MF2EjAwLWbSAw";
|
|
6
|
+
export declare const REPORT_MONTH_SUMMARY_BY_ORDER = "https://prod-19.australiasoutheast.logic.azure.com:443/workflows/bb93098ba15e48b5af16d8519f01c959/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=1duBNlZz70C_w8lJakWIG5E8xhTcxiyCeBP2q5xWISQ";
|
|
7
|
+
export declare const REPORT_WEEK_SUMMARY_BY_ORDER = "https://prod-12.australiasoutheast.logic.azure.com:443/workflows/74eb659a4c264b6ca85cfacd328443eb/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=-7pJxhJ3j5XF-4-Ghz25b-VUnxS-BnBjPDK-Lbp_DLM";
|
|
8
|
+
declare const _default: {
|
|
9
|
+
REPORT_DETAILED_TRANSACTIONS: string;
|
|
10
|
+
REPORT_DETAILED_PRODUCT_SALES: string;
|
|
11
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD: string;
|
|
12
|
+
REPORT_DAILY_SUMMARY_BY_ORDER: string;
|
|
13
|
+
REPORT_DETAILED_ORDERS: string;
|
|
14
|
+
REPORT_MONTH_SUMMARY_BY_ORDER: string;
|
|
15
|
+
REPORT_WEEK_SUMMARY_BY_ORDER: string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// detailed_transactions
|
|
2
|
+
export var REPORT_DETAILED_TRANSACTIONS = 'https://prod-03.australiasoutheast.logic.azure.com:443/workflows/cc1bc2ac0f824122a51b1cc17f099789/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=i464OhQO9VjuiVw14YUNBgKPAhambDmCzPC_6bKZBxM';
|
|
3
|
+
|
|
4
|
+
// detailed_product_sales
|
|
5
|
+
export var REPORT_DETAILED_PRODUCT_SALES = 'https://prod-08.australiasoutheast.logic.azure.com:443/workflows/40bf1ebddfaf414fb43430843655ebee/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=sdEFIBnqWc_xxomkbnhq__ySZ6BBe2Cfs3ATeWp898s';
|
|
6
|
+
|
|
7
|
+
// daily_summary_by_paymethod
|
|
8
|
+
export var REPORT_DAILY_SUMMARY_BY_PAYMETHOD = 'https://prod-25.australiasoutheast.logic.azure.com:443/workflows/69ecf67d14dc4c5494ac6e58e4168b44/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=VwrALdkCWZBuoy4AMq3sxLuTD8mrDS6gAWmQG9ma27g';
|
|
9
|
+
|
|
10
|
+
// daily_summary_by_order
|
|
11
|
+
export var REPORT_DAILY_SUMMARY_BY_ORDER = 'https://prod-28.australiasoutheast.logic.azure.com:443/workflows/4c579e57f93143518bb0b51675681ba5/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=kb4szs5DXpjQab87inkBfr2AL-w0wyxA5uQF8Vt2WcE';
|
|
12
|
+
|
|
13
|
+
// detailed_orders
|
|
14
|
+
export var REPORT_DETAILED_ORDERS = 'https://prod-22.australiasoutheast.logic.azure.com:443/workflows/2a71808194724ce7966fc516cbea6889/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=7GtvCsK-jcsx4lszeJm295X3uCBLP4MF2EjAwLWbSAw';
|
|
15
|
+
|
|
16
|
+
// month_summary_by_order
|
|
17
|
+
export var REPORT_MONTH_SUMMARY_BY_ORDER = 'https://prod-19.australiasoutheast.logic.azure.com:443/workflows/bb93098ba15e48b5af16d8519f01c959/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=1duBNlZz70C_w8lJakWIG5E8xhTcxiyCeBP2q5xWISQ';
|
|
18
|
+
|
|
19
|
+
// week_summary_by_order
|
|
20
|
+
export var REPORT_WEEK_SUMMARY_BY_ORDER = 'https://prod-12.australiasoutheast.logic.azure.com:443/workflows/74eb659a4c264b6ca85cfacd328443eb/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=-7pJxhJ3j5XF-4-Ghz25b-VUnxS-BnBjPDK-Lbp_DLM';
|
|
21
|
+
export default {
|
|
22
|
+
REPORT_DETAILED_TRANSACTIONS: REPORT_DETAILED_TRANSACTIONS,
|
|
23
|
+
REPORT_DETAILED_PRODUCT_SALES: REPORT_DETAILED_PRODUCT_SALES,
|
|
24
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD: REPORT_DAILY_SUMMARY_BY_PAYMETHOD,
|
|
25
|
+
REPORT_DAILY_SUMMARY_BY_ORDER: REPORT_DAILY_SUMMARY_BY_ORDER,
|
|
26
|
+
REPORT_DETAILED_ORDERS: REPORT_DETAILED_ORDERS,
|
|
27
|
+
REPORT_MONTH_SUMMARY_BY_ORDER: REPORT_MONTH_SUMMARY_BY_ORDER,
|
|
28
|
+
REPORT_WEEK_SUMMARY_BY_ORDER: REPORT_WEEK_SUMMARY_BY_ORDER
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare type UrlItem = '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';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
getReportList: (values: any, url: UrlItem) => Promise<any>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
import urls from "./URL";
|
|
6
|
+
import { injectedConfig } from "../../config";
|
|
7
|
+
var getParams = function getParams(values) {
|
|
8
|
+
var shop_id = injectedConfig.shop_id;
|
|
9
|
+
var _ref = values || {},
|
|
10
|
+
date = _ref.date;
|
|
11
|
+
|
|
12
|
+
// 存储筛选日期
|
|
13
|
+
var start_at = 0;
|
|
14
|
+
var end_at = 0;
|
|
15
|
+
|
|
16
|
+
// 有筛选时间 使用筛选日期
|
|
17
|
+
if (date && Array.isArray(date) && date[0]) {
|
|
18
|
+
start_at = injectedConfig.dayjs(date[0]);
|
|
19
|
+
end_at = injectedConfig.dayjs(date[1]);
|
|
20
|
+
} else {
|
|
21
|
+
// 获取当天时间
|
|
22
|
+
start_at = injectedConfig.dayjs().startOf('day');
|
|
23
|
+
end_at = start_at.endOf('day');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 转换时间戳
|
|
27
|
+
start_at = start_at.unix();
|
|
28
|
+
end_at = end_at.unix();
|
|
29
|
+
return {
|
|
30
|
+
shop_id: shop_id,
|
|
31
|
+
start_at: start_at,
|
|
32
|
+
end_at: end_at
|
|
33
|
+
// email: 'nick.li@pisell.com',
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var getReportList = /*#__PURE__*/function () {
|
|
38
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values, url) {
|
|
39
|
+
var params, data;
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
params = getParams(values);
|
|
44
|
+
_context.next = 3;
|
|
45
|
+
return injectedConfig.request.custom(urls[url || 'REPORT_DETAILED_TRANSACTIONS'], {
|
|
46
|
+
method: 'post',
|
|
47
|
+
data: params,
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
50
|
+
},
|
|
51
|
+
third: true
|
|
52
|
+
});
|
|
53
|
+
case 3:
|
|
54
|
+
data = _context.sent;
|
|
55
|
+
return _context.abrupt("return", data);
|
|
56
|
+
case 5:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
59
|
+
}
|
|
60
|
+
}, _callee);
|
|
61
|
+
}));
|
|
62
|
+
return function getReportList(_x, _x2) {
|
|
63
|
+
return _ref2.apply(this, arguments);
|
|
64
|
+
};
|
|
65
|
+
}();
|
|
66
|
+
export default {
|
|
67
|
+
getReportList: getReportList
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const appHelper: {
|
|
2
|
+
utils: {
|
|
3
|
+
api: {
|
|
4
|
+
report: {
|
|
5
|
+
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") => Promise<any>;
|
|
6
|
+
};
|
|
7
|
+
utils: {};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default appHelper;
|
package/es/index.d.ts
ADDED
package/es/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/ReactRenderer/index.tsx
|
|
30
|
+
var ReactRenderer_exports = {};
|
|
31
|
+
__export(ReactRenderer_exports, {
|
|
32
|
+
default: () => ReactRenderer_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ReactRenderer_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_dom = __toESM(require("react-dom"));
|
|
37
|
+
var import_lowcode_renderer_core = require("@alilc/lowcode-renderer-core");
|
|
38
|
+
var import_config_provider = __toESM(require("@alifd/next/lib/config-provider"));
|
|
39
|
+
window.React = import_react.default;
|
|
40
|
+
window.ReactDom = import_react_dom.default;
|
|
41
|
+
window.ReactDOM = import_react_dom.default;
|
|
42
|
+
var _a;
|
|
43
|
+
import_lowcode_renderer_core.adapter.setRuntime({
|
|
44
|
+
Component: import_react.Component,
|
|
45
|
+
PureComponent: import_react.PureComponent,
|
|
46
|
+
createContext: import_react.createContext,
|
|
47
|
+
createElement: import_react.createElement,
|
|
48
|
+
forwardRef: import_react.forwardRef,
|
|
49
|
+
findDOMNode: (_a = import_react_dom.default) == null ? void 0 : _a.findDOMNode
|
|
50
|
+
});
|
|
51
|
+
import_lowcode_renderer_core.adapter.setRenderers({
|
|
52
|
+
PageRenderer: (0, import_lowcode_renderer_core.pageRendererFactory)(),
|
|
53
|
+
ComponentRenderer: (0, import_lowcode_renderer_core.componentRendererFactory)(),
|
|
54
|
+
BlockRenderer: (0, import_lowcode_renderer_core.blockRendererFactory)(),
|
|
55
|
+
AddonRenderer: (0, import_lowcode_renderer_core.addonRendererFactory)(),
|
|
56
|
+
TempRenderer: (0, import_lowcode_renderer_core.tempRendererFactory)(),
|
|
57
|
+
DivRenderer: (0, import_lowcode_renderer_core.blockRendererFactory)()
|
|
58
|
+
});
|
|
59
|
+
import_lowcode_renderer_core.adapter.setConfigProvider(import_config_provider.default);
|
|
60
|
+
function factory() {
|
|
61
|
+
const Renderer = (0, import_lowcode_renderer_core.rendererFactory)();
|
|
62
|
+
return class ReactRenderer extends Renderer {
|
|
63
|
+
constructor(props, context) {
|
|
64
|
+
super(props, context);
|
|
65
|
+
}
|
|
66
|
+
isValidComponent(obj) {
|
|
67
|
+
var _a2;
|
|
68
|
+
return ((_a2 = obj == null ? void 0 : obj.prototype) == null ? void 0 : _a2.isReactComponent) || (obj == null ? void 0 : obj.prototype) instanceof import_react.Component;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
var ReactRenderer_default = factory();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IRendererAppHelper } from "@alilc/lowcode-renderer-core/lib/types";
|
|
3
|
+
interface RenderProps {
|
|
4
|
+
packages: Record<string, any>;
|
|
5
|
+
projectSchema: Record<string, any>;
|
|
6
|
+
className?: string;
|
|
7
|
+
appHelper?: IRendererAppHelper;
|
|
8
|
+
}
|
|
9
|
+
declare const Render: (props: RenderProps) => JSX.Element;
|
|
10
|
+
export default Render;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Render/index.tsx
|
|
30
|
+
var Render_exports = {};
|
|
31
|
+
__export(Render_exports, {
|
|
32
|
+
default: () => Render_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Render_exports);
|
|
35
|
+
var import_lowcode_plugin_inject = require("@alilc/lowcode-plugin-inject");
|
|
36
|
+
var import_lowcode_utils = require("@alilc/lowcode-utils");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_isArray = __toESM(require("lodash/isArray"));
|
|
39
|
+
var import_mergeWith = __toESM(require("lodash/mergeWith"));
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_ReactRenderer = __toESM(require("../ReactRenderer"));
|
|
42
|
+
var import_appHelper = __toESM(require("../appHelper"));
|
|
43
|
+
var Render = (props) => {
|
|
44
|
+
const {
|
|
45
|
+
packages,
|
|
46
|
+
projectSchema,
|
|
47
|
+
className,
|
|
48
|
+
appHelper: propsAppHelper
|
|
49
|
+
} = props;
|
|
50
|
+
const [data, setData] = (0, import_react.useState)({});
|
|
51
|
+
const { schema, components, i18n = {}, projectDataSource = {} } = data;
|
|
52
|
+
(0, import_react.useEffect)(() => {
|
|
53
|
+
async function init() {
|
|
54
|
+
if (!projectSchema)
|
|
55
|
+
return;
|
|
56
|
+
const {
|
|
57
|
+
componentsMap: componentsMapArray,
|
|
58
|
+
componentsTree,
|
|
59
|
+
i18n: i18n3,
|
|
60
|
+
dataSource: projectDataSource3
|
|
61
|
+
} = projectSchema;
|
|
62
|
+
const componentsMap = {};
|
|
63
|
+
const packagesMap = {};
|
|
64
|
+
componentsMapArray.forEach((component) => {
|
|
65
|
+
packagesMap[component.package] = true;
|
|
66
|
+
componentsMap[component.componentName] = component;
|
|
67
|
+
});
|
|
68
|
+
const pageSchema = componentsTree[0];
|
|
69
|
+
const libraryMap = {};
|
|
70
|
+
const libraryAsset = [];
|
|
71
|
+
packages.forEach(({ package: _package, library, urls, renderUrls }) => {
|
|
72
|
+
libraryMap[_package] = library;
|
|
73
|
+
if (renderUrls) {
|
|
74
|
+
libraryAsset.push(renderUrls);
|
|
75
|
+
} else if (urls) {
|
|
76
|
+
libraryAsset.push(urls);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const assetLoader = new import_lowcode_utils.AssetLoader();
|
|
80
|
+
await assetLoader.load(libraryAsset);
|
|
81
|
+
const components3 = await (0, import_lowcode_plugin_inject.injectComponents)(
|
|
82
|
+
(0, import_lowcode_utils.buildComponents)(libraryMap, componentsMap)
|
|
83
|
+
);
|
|
84
|
+
setData({
|
|
85
|
+
schema: pageSchema,
|
|
86
|
+
components: components3,
|
|
87
|
+
i18n: i18n3,
|
|
88
|
+
projectDataSource: projectDataSource3
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const {
|
|
92
|
+
schema: schema2,
|
|
93
|
+
components: components2,
|
|
94
|
+
i18n: i18n2 = {},
|
|
95
|
+
projectDataSource: projectDataSource2 = {}
|
|
96
|
+
} = data;
|
|
97
|
+
if (!schema2 || !components2) {
|
|
98
|
+
init();
|
|
99
|
+
}
|
|
100
|
+
}, [data]);
|
|
101
|
+
if (!schema || !components) {
|
|
102
|
+
return /* @__PURE__ */ React.createElement("div", { style: { padding: 20 } }, /* @__PURE__ */ React.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }));
|
|
103
|
+
}
|
|
104
|
+
function customizer(objValue, srcValue) {
|
|
105
|
+
if ((0, import_isArray.default)(objValue)) {
|
|
106
|
+
return objValue.concat(srcValue || []);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ React.createElement(
|
|
110
|
+
import_ReactRenderer.default,
|
|
111
|
+
{
|
|
112
|
+
className: `lowcode-plugin-sample-preview-content ${className}`,
|
|
113
|
+
schema: {
|
|
114
|
+
...schema,
|
|
115
|
+
dataSource: (0, import_mergeWith.default)(schema.dataSource, projectDataSource, customizer)
|
|
116
|
+
},
|
|
117
|
+
appHelper: (0, import_mergeWith.default)(import_appHelper.default, propsAppHelper),
|
|
118
|
+
components
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
var Render_default = Render;
|
|
File without changes
|
|
@@ -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") => Promise<any>;
|
|
4
|
+
};
|
|
5
|
+
utils: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/api/index.ts
|
|
30
|
+
var api_exports = {};
|
|
31
|
+
__export(api_exports, {
|
|
32
|
+
default: () => api_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(api_exports);
|
|
35
|
+
var import_report = __toESM(require("./report"));
|
|
36
|
+
var import_utils = __toESM(require("./utils"));
|
|
37
|
+
var api_default = {
|
|
38
|
+
report: import_report.default,
|
|
39
|
+
utils: import_utils.default
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const REPORT_DETAILED_TRANSACTIONS = "https://prod-03.australiasoutheast.logic.azure.com:443/workflows/cc1bc2ac0f824122a51b1cc17f099789/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=i464OhQO9VjuiVw14YUNBgKPAhambDmCzPC_6bKZBxM";
|
|
2
|
+
export declare const REPORT_DETAILED_PRODUCT_SALES = "https://prod-08.australiasoutheast.logic.azure.com:443/workflows/40bf1ebddfaf414fb43430843655ebee/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=sdEFIBnqWc_xxomkbnhq__ySZ6BBe2Cfs3ATeWp898s";
|
|
3
|
+
export declare const REPORT_DAILY_SUMMARY_BY_PAYMETHOD = "https://prod-25.australiasoutheast.logic.azure.com:443/workflows/69ecf67d14dc4c5494ac6e58e4168b44/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=VwrALdkCWZBuoy4AMq3sxLuTD8mrDS6gAWmQG9ma27g";
|
|
4
|
+
export declare const REPORT_DAILY_SUMMARY_BY_ORDER = "https://prod-28.australiasoutheast.logic.azure.com:443/workflows/4c579e57f93143518bb0b51675681ba5/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=kb4szs5DXpjQab87inkBfr2AL-w0wyxA5uQF8Vt2WcE";
|
|
5
|
+
export declare const REPORT_DETAILED_ORDERS = "https://prod-22.australiasoutheast.logic.azure.com:443/workflows/2a71808194724ce7966fc516cbea6889/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=7GtvCsK-jcsx4lszeJm295X3uCBLP4MF2EjAwLWbSAw";
|
|
6
|
+
export declare const REPORT_MONTH_SUMMARY_BY_ORDER = "https://prod-19.australiasoutheast.logic.azure.com:443/workflows/bb93098ba15e48b5af16d8519f01c959/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=1duBNlZz70C_w8lJakWIG5E8xhTcxiyCeBP2q5xWISQ";
|
|
7
|
+
export declare const REPORT_WEEK_SUMMARY_BY_ORDER = "https://prod-12.australiasoutheast.logic.azure.com:443/workflows/74eb659a4c264b6ca85cfacd328443eb/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=-7pJxhJ3j5XF-4-Ghz25b-VUnxS-BnBjPDK-Lbp_DLM";
|
|
8
|
+
declare const _default: {
|
|
9
|
+
REPORT_DETAILED_TRANSACTIONS: string;
|
|
10
|
+
REPORT_DETAILED_PRODUCT_SALES: string;
|
|
11
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD: string;
|
|
12
|
+
REPORT_DAILY_SUMMARY_BY_ORDER: string;
|
|
13
|
+
REPORT_DETAILED_ORDERS: string;
|
|
14
|
+
REPORT_MONTH_SUMMARY_BY_ORDER: string;
|
|
15
|
+
REPORT_WEEK_SUMMARY_BY_ORDER: string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/api/report/URL.ts
|
|
20
|
+
var URL_exports = {};
|
|
21
|
+
__export(URL_exports, {
|
|
22
|
+
REPORT_DAILY_SUMMARY_BY_ORDER: () => REPORT_DAILY_SUMMARY_BY_ORDER,
|
|
23
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD: () => REPORT_DAILY_SUMMARY_BY_PAYMETHOD,
|
|
24
|
+
REPORT_DETAILED_ORDERS: () => REPORT_DETAILED_ORDERS,
|
|
25
|
+
REPORT_DETAILED_PRODUCT_SALES: () => REPORT_DETAILED_PRODUCT_SALES,
|
|
26
|
+
REPORT_DETAILED_TRANSACTIONS: () => REPORT_DETAILED_TRANSACTIONS,
|
|
27
|
+
REPORT_MONTH_SUMMARY_BY_ORDER: () => REPORT_MONTH_SUMMARY_BY_ORDER,
|
|
28
|
+
REPORT_WEEK_SUMMARY_BY_ORDER: () => REPORT_WEEK_SUMMARY_BY_ORDER,
|
|
29
|
+
default: () => URL_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(URL_exports);
|
|
32
|
+
var REPORT_DETAILED_TRANSACTIONS = "https://prod-03.australiasoutheast.logic.azure.com:443/workflows/cc1bc2ac0f824122a51b1cc17f099789/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=i464OhQO9VjuiVw14YUNBgKPAhambDmCzPC_6bKZBxM";
|
|
33
|
+
var REPORT_DETAILED_PRODUCT_SALES = "https://prod-08.australiasoutheast.logic.azure.com:443/workflows/40bf1ebddfaf414fb43430843655ebee/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=sdEFIBnqWc_xxomkbnhq__ySZ6BBe2Cfs3ATeWp898s";
|
|
34
|
+
var REPORT_DAILY_SUMMARY_BY_PAYMETHOD = "https://prod-25.australiasoutheast.logic.azure.com:443/workflows/69ecf67d14dc4c5494ac6e58e4168b44/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=VwrALdkCWZBuoy4AMq3sxLuTD8mrDS6gAWmQG9ma27g";
|
|
35
|
+
var REPORT_DAILY_SUMMARY_BY_ORDER = "https://prod-28.australiasoutheast.logic.azure.com:443/workflows/4c579e57f93143518bb0b51675681ba5/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=kb4szs5DXpjQab87inkBfr2AL-w0wyxA5uQF8Vt2WcE";
|
|
36
|
+
var REPORT_DETAILED_ORDERS = "https://prod-22.australiasoutheast.logic.azure.com:443/workflows/2a71808194724ce7966fc516cbea6889/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=7GtvCsK-jcsx4lszeJm295X3uCBLP4MF2EjAwLWbSAw";
|
|
37
|
+
var REPORT_MONTH_SUMMARY_BY_ORDER = "https://prod-19.australiasoutheast.logic.azure.com:443/workflows/bb93098ba15e48b5af16d8519f01c959/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=1duBNlZz70C_w8lJakWIG5E8xhTcxiyCeBP2q5xWISQ";
|
|
38
|
+
var REPORT_WEEK_SUMMARY_BY_ORDER = "https://prod-12.australiasoutheast.logic.azure.com:443/workflows/74eb659a4c264b6ca85cfacd328443eb/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=-7pJxhJ3j5XF-4-Ghz25b-VUnxS-BnBjPDK-Lbp_DLM";
|
|
39
|
+
var URL_default = {
|
|
40
|
+
REPORT_DETAILED_TRANSACTIONS,
|
|
41
|
+
REPORT_DETAILED_PRODUCT_SALES,
|
|
42
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD,
|
|
43
|
+
REPORT_DAILY_SUMMARY_BY_ORDER,
|
|
44
|
+
REPORT_DETAILED_ORDERS,
|
|
45
|
+
REPORT_MONTH_SUMMARY_BY_ORDER,
|
|
46
|
+
REPORT_WEEK_SUMMARY_BY_ORDER
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
REPORT_DAILY_SUMMARY_BY_ORDER,
|
|
51
|
+
REPORT_DAILY_SUMMARY_BY_PAYMETHOD,
|
|
52
|
+
REPORT_DETAILED_ORDERS,
|
|
53
|
+
REPORT_DETAILED_PRODUCT_SALES,
|
|
54
|
+
REPORT_DETAILED_TRANSACTIONS,
|
|
55
|
+
REPORT_MONTH_SUMMARY_BY_ORDER,
|
|
56
|
+
REPORT_WEEK_SUMMARY_BY_ORDER
|
|
57
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare type UrlItem = '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';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
getReportList: (values: any, url: UrlItem) => Promise<any>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/api/report/index.ts
|
|
30
|
+
var report_exports = {};
|
|
31
|
+
__export(report_exports, {
|
|
32
|
+
default: () => report_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(report_exports);
|
|
35
|
+
var import_URL = __toESM(require("./URL"));
|
|
36
|
+
var import_config = require("../../config");
|
|
37
|
+
var getParams = (values) => {
|
|
38
|
+
let shop_id = import_config.injectedConfig.shop_id;
|
|
39
|
+
let { date } = values || {};
|
|
40
|
+
let start_at = 0;
|
|
41
|
+
let end_at = 0;
|
|
42
|
+
if (date && Array.isArray(date) && date[0]) {
|
|
43
|
+
start_at = import_config.injectedConfig.dayjs(date[0]);
|
|
44
|
+
end_at = import_config.injectedConfig.dayjs(date[1]);
|
|
45
|
+
} else {
|
|
46
|
+
start_at = import_config.injectedConfig.dayjs().startOf("day");
|
|
47
|
+
end_at = start_at.endOf("day");
|
|
48
|
+
}
|
|
49
|
+
start_at = start_at.unix();
|
|
50
|
+
end_at = end_at.unix();
|
|
51
|
+
return {
|
|
52
|
+
shop_id,
|
|
53
|
+
start_at,
|
|
54
|
+
end_at
|
|
55
|
+
// email: 'nick.li@pisell.com',
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
var getReportList = async (values, url) => {
|
|
59
|
+
const params = getParams(values);
|
|
60
|
+
const data = await import_config.injectedConfig.request.custom(import_URL.default[url || "REPORT_DETAILED_TRANSACTIONS"], {
|
|
61
|
+
method: "post",
|
|
62
|
+
data: params,
|
|
63
|
+
headers: {
|
|
64
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
65
|
+
},
|
|
66
|
+
third: true
|
|
67
|
+
});
|
|
68
|
+
return data;
|
|
69
|
+
};
|
|
70
|
+
var report_default = {
|
|
71
|
+
getReportList
|
|
72
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/api/utils/index.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
default: () => utils_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var utils_default = {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const appHelper: {
|
|
2
|
+
utils: {
|
|
3
|
+
api: {
|
|
4
|
+
report: {
|
|
5
|
+
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") => Promise<any>;
|
|
6
|
+
};
|
|
7
|
+
utils: {};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default appHelper;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/appHelper/index.ts
|
|
30
|
+
var appHelper_exports = {};
|
|
31
|
+
__export(appHelper_exports, {
|
|
32
|
+
default: () => appHelper_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(appHelper_exports);
|
|
35
|
+
var import_api = __toESM(require("../api"));
|
|
36
|
+
var appHelper = {
|
|
37
|
+
utils: {
|
|
38
|
+
api: import_api.default
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var appHelper_default = appHelper;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/config/index.ts
|
|
20
|
+
var config_exports = {};
|
|
21
|
+
__export(config_exports, {
|
|
22
|
+
injectConfig: () => injectConfig,
|
|
23
|
+
injectedConfig: () => injectedConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(config_exports);
|
|
26
|
+
var injectedConfig = {};
|
|
27
|
+
var injectConfig = (context) => {
|
|
28
|
+
injectedConfig = context;
|
|
29
|
+
};
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
injectConfig,
|
|
33
|
+
injectedConfig
|
|
34
|
+
});
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.tsx
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
default: () => src_default,
|
|
33
|
+
injectConfig: () => import_config.injectConfig
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var import_Render = __toESM(require("./Render"));
|
|
37
|
+
var import_config = require("./config");
|
|
38
|
+
var src_default = import_Render.default;
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
injectConfig
|
|
42
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pisell/lowcode-renderer",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "./lib/index.js",
|
|
5
|
+
"module": "./es/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"typings": "./lib/index.d.ts",
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"react": "^18.0.0",
|
|
10
|
+
"react-dom": "^18.0.0"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@alilc/lowcode-plugin-inject": "^1.2.2",
|
|
14
|
+
"@alilc/lowcode-utils": "1.1.6",
|
|
15
|
+
"@alilc/lowcode-renderer-core": "^1.1.7",
|
|
16
|
+
"antd": "^5.6.4",
|
|
17
|
+
"@alifd/next": "^1.25.44",
|
|
18
|
+
"lodash": "^4.17.21"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": ">=16.9.0",
|
|
22
|
+
"react-dom": ">=16.9.0",
|
|
23
|
+
"antd": ">=5.6.4"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"es",
|
|
27
|
+
"lib",
|
|
28
|
+
"package.json",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "father build",
|
|
36
|
+
"dev": "father dev"
|
|
37
|
+
}
|
|
38
|
+
}
|