@pisell/lowcode-renderer 1.0.4 → 1.0.6
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/es/api/report/index.js +38 -12
- package/es/config/index.d.ts +8 -4
- package/es/config/index.js +5 -5
- package/lib/api/report/index.js +26 -8
- package/lib/config/index.d.ts +8 -4
- package/lib/config/index.js +6 -6
- package/package.json +3 -2
package/es/api/report/index.js
CHANGED
|
@@ -2,10 +2,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
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
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
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
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
|
+
import dayjs from 'dayjs';
|
|
11
|
+
import utc from 'dayjs/plugin/utc';
|
|
12
|
+
import timezone from 'dayjs/plugin/timezone';
|
|
5
13
|
import urls from "./URL";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
import { getShopConfig, injectedConfig } from "../../config";
|
|
15
|
+
dayjs.extend(utc);
|
|
16
|
+
dayjs.extend(timezone);
|
|
17
|
+
var includeTimeZoneUrl = ['REPORT_DASHBOARD'];
|
|
18
|
+
|
|
19
|
+
// 获取时差
|
|
20
|
+
var getTimeDiff = function getTimeDiff(timezone) {
|
|
21
|
+
var now = dayjs().tz(timezone);
|
|
22
|
+
var diff = now.utcOffset() / 60;
|
|
23
|
+
return diff;
|
|
24
|
+
};
|
|
25
|
+
var getParams = function getParams(values, url) {
|
|
26
|
+
var _getShopConfig = getShopConfig(),
|
|
27
|
+
id = _getShopConfig.id,
|
|
28
|
+
timezone = _getShopConfig.timezone;
|
|
29
|
+
|
|
30
|
+
// 包含时区
|
|
31
|
+
var timezoneObj = {};
|
|
32
|
+
if (includeTimeZoneUrl.includes(url)) {
|
|
33
|
+
timezoneObj = {
|
|
34
|
+
timezone: getTimeDiff(timezone)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
9
37
|
var _ref = values || {},
|
|
10
38
|
date = _ref.date;
|
|
11
39
|
|
|
@@ -15,32 +43,30 @@ var getParams = function getParams(values) {
|
|
|
15
43
|
|
|
16
44
|
// 有筛选时间 使用筛选日期
|
|
17
45
|
if (date && Array.isArray(date) && date[0]) {
|
|
18
|
-
start_at =
|
|
19
|
-
end_at =
|
|
46
|
+
start_at = dayjs(date[0]);
|
|
47
|
+
end_at = dayjs(date[1]);
|
|
20
48
|
} else {
|
|
21
49
|
// 获取当天时间
|
|
22
|
-
start_at =
|
|
50
|
+
start_at = dayjs().startOf("day");
|
|
23
51
|
end_at = start_at.endOf("day");
|
|
24
52
|
}
|
|
25
53
|
|
|
26
54
|
// 转换时间戳
|
|
27
55
|
start_at = start_at.unix();
|
|
28
56
|
end_at = end_at.unix();
|
|
29
|
-
return {
|
|
30
|
-
shop_id:
|
|
57
|
+
return _objectSpread({
|
|
58
|
+
shop_id: id,
|
|
31
59
|
start_at: start_at,
|
|
32
60
|
end_at: end_at
|
|
33
|
-
|
|
34
|
-
};
|
|
61
|
+
}, timezoneObj);
|
|
35
62
|
};
|
|
36
|
-
|
|
37
63
|
var getReportList = /*#__PURE__*/function () {
|
|
38
64
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values, url) {
|
|
39
65
|
var params, data;
|
|
40
66
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
67
|
while (1) switch (_context.prev = _context.next) {
|
|
42
68
|
case 0:
|
|
43
|
-
params = getParams(values);
|
|
69
|
+
params = getParams(values, url);
|
|
44
70
|
_context.next = 3;
|
|
45
71
|
return injectedConfig.request.custom(urls[url || "REPORT_DETAILED_TRANSACTIONS"], {
|
|
46
72
|
method: "post",
|
package/es/config/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
declare type ShopConfigType = {
|
|
2
|
+
timezone: string;
|
|
3
|
+
id: number;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
1
6
|
declare type InjectedConfigType = {
|
|
2
|
-
|
|
7
|
+
shopConfig: ShopConfigType | (() => ShopConfigType);
|
|
3
8
|
request: any;
|
|
4
|
-
dayjs: any;
|
|
5
9
|
};
|
|
6
10
|
declare let injectedConfig: InjectedConfigType;
|
|
7
11
|
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
8
|
-
declare const
|
|
9
|
-
export { injectedConfig,
|
|
12
|
+
declare const getShopConfig: () => ShopConfigType;
|
|
13
|
+
export { injectedConfig, getShopConfig };
|
package/es/config/index.js
CHANGED
|
@@ -2,10 +2,10 @@ var injectedConfig = {};
|
|
|
2
2
|
export var injectConfig = function injectConfig(context) {
|
|
3
3
|
injectedConfig = context;
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
if (typeof injectedConfig.
|
|
7
|
-
return injectedConfig.
|
|
5
|
+
var getShopConfig = function getShopConfig() {
|
|
6
|
+
if (typeof injectedConfig.shopConfig === "function") {
|
|
7
|
+
return injectedConfig.shopConfig();
|
|
8
8
|
}
|
|
9
|
-
return injectedConfig.
|
|
9
|
+
return injectedConfig.shopConfig;
|
|
10
10
|
};
|
|
11
|
-
export { injectedConfig,
|
|
11
|
+
export { injectedConfig, getShopConfig };
|
package/lib/api/report/index.js
CHANGED
|
@@ -32,31 +32,49 @@ __export(report_exports, {
|
|
|
32
32
|
default: () => report_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(report_exports);
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
+
var import_utc = __toESM(require("dayjs/plugin/utc"));
|
|
37
|
+
var import_timezone = __toESM(require("dayjs/plugin/timezone"));
|
|
35
38
|
var import_URL = __toESM(require("./URL"));
|
|
36
39
|
var import_config = require("../../config");
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
import_dayjs.default.extend(import_utc.default);
|
|
41
|
+
import_dayjs.default.extend(import_timezone.default);
|
|
42
|
+
var includeTimeZoneUrl = ["REPORT_DASHBOARD"];
|
|
43
|
+
var getTimeDiff = (timezone2) => {
|
|
44
|
+
const now = (0, import_dayjs.default)().tz(timezone2);
|
|
45
|
+
const diff = now.utcOffset() / 60;
|
|
46
|
+
return diff;
|
|
47
|
+
};
|
|
48
|
+
var getParams = (values, url) => {
|
|
49
|
+
let { id, timezone: timezone2 } = (0, import_config.getShopConfig)();
|
|
50
|
+
let timezoneObj = {};
|
|
51
|
+
if (includeTimeZoneUrl.includes(url)) {
|
|
52
|
+
timezoneObj = {
|
|
53
|
+
timezone: getTimeDiff(timezone2)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
39
56
|
let { date } = values || {};
|
|
40
57
|
let start_at = 0;
|
|
41
58
|
let end_at = 0;
|
|
42
59
|
if (date && Array.isArray(date) && date[0]) {
|
|
43
|
-
start_at =
|
|
44
|
-
end_at =
|
|
60
|
+
start_at = (0, import_dayjs.default)(date[0]);
|
|
61
|
+
end_at = (0, import_dayjs.default)(date[1]);
|
|
45
62
|
} else {
|
|
46
|
-
start_at =
|
|
63
|
+
start_at = (0, import_dayjs.default)().startOf("day");
|
|
47
64
|
end_at = start_at.endOf("day");
|
|
48
65
|
}
|
|
49
66
|
start_at = start_at.unix();
|
|
50
67
|
end_at = end_at.unix();
|
|
51
68
|
return {
|
|
52
|
-
shop_id,
|
|
69
|
+
shop_id: id,
|
|
53
70
|
start_at,
|
|
54
|
-
end_at
|
|
71
|
+
end_at,
|
|
72
|
+
...timezoneObj
|
|
55
73
|
// email: 'nick.li@pisell.com',
|
|
56
74
|
};
|
|
57
75
|
};
|
|
58
76
|
var getReportList = async (values, url) => {
|
|
59
|
-
const params = getParams(values);
|
|
77
|
+
const params = getParams(values, url);
|
|
60
78
|
const data = await import_config.injectedConfig.request.custom(
|
|
61
79
|
import_URL.default[url || "REPORT_DETAILED_TRANSACTIONS"],
|
|
62
80
|
{
|
package/lib/config/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
declare type ShopConfigType = {
|
|
2
|
+
timezone: string;
|
|
3
|
+
id: number;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
1
6
|
declare type InjectedConfigType = {
|
|
2
|
-
|
|
7
|
+
shopConfig: ShopConfigType | (() => ShopConfigType);
|
|
3
8
|
request: any;
|
|
4
|
-
dayjs: any;
|
|
5
9
|
};
|
|
6
10
|
declare let injectedConfig: InjectedConfigType;
|
|
7
11
|
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
8
|
-
declare const
|
|
9
|
-
export { injectedConfig,
|
|
12
|
+
declare const getShopConfig: () => ShopConfigType;
|
|
13
|
+
export { injectedConfig, getShopConfig };
|
package/lib/config/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/config/index.ts
|
|
20
20
|
var config_exports = {};
|
|
21
21
|
__export(config_exports, {
|
|
22
|
-
|
|
22
|
+
getShopConfig: () => getShopConfig,
|
|
23
23
|
injectConfig: () => injectConfig,
|
|
24
24
|
injectedConfig: () => injectedConfig
|
|
25
25
|
});
|
|
@@ -28,15 +28,15 @@ var injectedConfig = {};
|
|
|
28
28
|
var injectConfig = (context) => {
|
|
29
29
|
injectedConfig = context;
|
|
30
30
|
};
|
|
31
|
-
var
|
|
32
|
-
if (typeof injectedConfig.
|
|
33
|
-
return injectedConfig.
|
|
31
|
+
var getShopConfig = () => {
|
|
32
|
+
if (typeof injectedConfig.shopConfig === "function") {
|
|
33
|
+
return injectedConfig.shopConfig();
|
|
34
34
|
}
|
|
35
|
-
return injectedConfig.
|
|
35
|
+
return injectedConfig.shopConfig;
|
|
36
36
|
};
|
|
37
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
38
|
0 && (module.exports = {
|
|
39
|
-
|
|
39
|
+
getShopConfig,
|
|
40
40
|
injectConfig,
|
|
41
41
|
injectedConfig
|
|
42
42
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/lowcode-renderer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"@alilc/lowcode-renderer-core": "^1.1.7",
|
|
17
17
|
"antd": "^5.6.4",
|
|
18
18
|
"@alifd/next": "^1.25.44",
|
|
19
|
-
"lodash-es": "^4.17.21"
|
|
19
|
+
"lodash-es": "^4.17.21",
|
|
20
|
+
"dayjs": "^1.11.9"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
22
23
|
"react": ">=16.9.0",
|