@pisell/lowcode-renderer 1.0.26 → 1.0.28
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/appHelper/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { isMobile, isIos, isAndroid
|
|
1
|
+
import { isMobile, isIos, isAndroid } from "@pisell/utils";
|
|
2
|
+
import { getTimezone } from "./others";
|
|
2
3
|
import api from "../api";
|
|
3
4
|
var appHelper = {
|
|
4
5
|
utils: {
|
|
@@ -6,7 +7,7 @@ var appHelper = {
|
|
|
6
7
|
isMobile: isMobile,
|
|
7
8
|
isIos: isIos,
|
|
8
9
|
isAndroid: isAndroid,
|
|
9
|
-
|
|
10
|
+
getTimezone: getTimezone
|
|
10
11
|
}
|
|
11
12
|
};
|
|
12
13
|
export default appHelper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTimezone: () => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import utc from "dayjs/plugin/utc";
|
|
3
|
+
import timezone from "dayjs/plugin/timezone";
|
|
4
|
+
import { getShopConfig } from "../config";
|
|
5
|
+
dayjs.extend(utc);
|
|
6
|
+
dayjs.extend(timezone);
|
|
7
|
+
export var getTimezone = function getTimezone() {
|
|
8
|
+
var _getShopConfig = getShopConfig(),
|
|
9
|
+
timezone = _getShopConfig.timezone;
|
|
10
|
+
var now = dayjs().tz(timezone);
|
|
11
|
+
var diff = now.utcOffset() / 60;
|
|
12
|
+
return diff;
|
|
13
|
+
};
|
package/lib/appHelper/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(appHelper_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(appHelper_exports);
|
|
35
35
|
var import_utils = require("@pisell/utils");
|
|
36
|
+
var import_others = require("./others");
|
|
36
37
|
var import_api = __toESM(require("../api"));
|
|
37
38
|
var appHelper = {
|
|
38
39
|
utils: {
|
|
@@ -40,7 +41,7 @@ var appHelper = {
|
|
|
40
41
|
isMobile: import_utils.isMobile,
|
|
41
42
|
isIos: import_utils.isIos,
|
|
42
43
|
isAndroid: import_utils.isAndroid,
|
|
43
|
-
|
|
44
|
+
getTimezone: import_others.getTimezone
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
var appHelper_default = appHelper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTimezone: () => number;
|
|
@@ -0,0 +1,50 @@
|
|
|
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/others.ts
|
|
30
|
+
var others_exports = {};
|
|
31
|
+
__export(others_exports, {
|
|
32
|
+
getTimezone: () => getTimezone
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(others_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"));
|
|
38
|
+
var import_config = require("../config");
|
|
39
|
+
import_dayjs.default.extend(import_utc.default);
|
|
40
|
+
import_dayjs.default.extend(import_timezone.default);
|
|
41
|
+
var getTimezone = () => {
|
|
42
|
+
let { timezone: timezone2 } = (0, import_config.getShopConfig)();
|
|
43
|
+
const now = (0, import_dayjs.default)().tz(timezone2);
|
|
44
|
+
const diff = now.utcOffset() / 60;
|
|
45
|
+
return diff;
|
|
46
|
+
};
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
getTimezone
|
|
50
|
+
});
|