fix: 修改打包文件
This commit is contained in:
parent
c4088792e8
commit
b433d5f182
23
packages/constants/es/base/index.d.ts
vendored
23
packages/constants/es/base/index.d.ts
vendored
@ -1,23 +0,0 @@
|
|||||||
export declare const OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
export declare const OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
export declare const MODE_KEY = "test_mode";
|
|
||||||
export declare const SEARCH_IMG_COUNT = 10;
|
|
||||||
export declare const GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
export declare const publicPath = "hummingbird";
|
|
||||||
export declare const ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
export declare const OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
export declare const TEMP = "MONITORTYPE_TEMP";
|
|
||||||
export declare const GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
export declare const BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
export declare const RECORD_VERSION = "3.0.0";
|
|
||||||
export declare const DeviceTab: {
|
|
||||||
EMPTY: number;
|
|
||||||
REAL_CAMERA: number;
|
|
||||||
PREPROCESS_CAMERA: number;
|
|
||||||
TAG_CAMERA: number;
|
|
||||||
HISTORY_VIDEO_GROUP: number;
|
|
||||||
VIRTUAL_CAMERA: number;
|
|
||||||
REAL_CAMERA_NOFACE: number;
|
|
||||||
REAL_CAMERA_ONLYFACE: number;
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: number;
|
|
||||||
};
|
|
1
packages/constants/es/camera/index.d.ts
vendored
1
packages/constants/es/camera/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare const TYPE = "";
|
|
3
packages/constants/es/index.d.ts
vendored
3
packages/constants/es/index.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
export * from './camera';
|
|
||||||
export * from './base';
|
|
||||||
export * from './user';
|
|
2
packages/constants/es/user/index.d.ts
vendored
2
packages/constants/es/user/index.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
declare const _default: {};
|
|
||||||
export default _default;
|
|
23
packages/constants/lib/base/index.d.ts
vendored
23
packages/constants/lib/base/index.d.ts
vendored
@ -1,23 +0,0 @@
|
|||||||
export declare const OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
export declare const OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
export declare const MODE_KEY = "test_mode";
|
|
||||||
export declare const SEARCH_IMG_COUNT = 10;
|
|
||||||
export declare const GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
export declare const publicPath = "hummingbird";
|
|
||||||
export declare const ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
export declare const OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
export declare const TEMP = "MONITORTYPE_TEMP";
|
|
||||||
export declare const GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
export declare const BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
export declare const RECORD_VERSION = "3.0.0";
|
|
||||||
export declare const DeviceTab: {
|
|
||||||
EMPTY: number;
|
|
||||||
REAL_CAMERA: number;
|
|
||||||
PREPROCESS_CAMERA: number;
|
|
||||||
TAG_CAMERA: number;
|
|
||||||
HISTORY_VIDEO_GROUP: number;
|
|
||||||
VIRTUAL_CAMERA: number;
|
|
||||||
REAL_CAMERA_NOFACE: number;
|
|
||||||
REAL_CAMERA_ONLYFACE: number;
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: number;
|
|
||||||
};
|
|
@ -1,80 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/base/index.ts
|
|
||||||
var base_exports = {};
|
|
||||||
__export(base_exports, {
|
|
||||||
BODY_SEARCH_THRESHOID: () => BODY_SEARCH_THRESHOID,
|
|
||||||
DeviceTab: () => DeviceTab,
|
|
||||||
ENTER_CIRCLE: () => ENTER_CIRCLE,
|
|
||||||
GLOBAL_IS_BOX_VMS_SHOW: () => GLOBAL_IS_BOX_VMS_SHOW,
|
|
||||||
GLOBAL_IS_ITEM_NUMBER_SHOW: () => GLOBAL_IS_ITEM_NUMBER_SHOW,
|
|
||||||
MODE_KEY: () => MODE_KEY,
|
|
||||||
OBJECT_AGE_TYPE_THRESHOLD: () => OBJECT_AGE_TYPE_THRESHOLD,
|
|
||||||
OBJECT_GRNER_THRESHOLD: () => OBJECT_GRNER_THRESHOLD,
|
|
||||||
OUT_CIRCLE: () => OUT_CIRCLE,
|
|
||||||
RECORD_VERSION: () => RECORD_VERSION,
|
|
||||||
SEARCH_IMG_COUNT: () => SEARCH_IMG_COUNT,
|
|
||||||
TEMP: () => TEMP,
|
|
||||||
publicPath: () => publicPath
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(base_exports);
|
|
||||||
var OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
var OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
var MODE_KEY = "test_mode";
|
|
||||||
var SEARCH_IMG_COUNT = 10;
|
|
||||||
var GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
var publicPath = "hummingbird";
|
|
||||||
var ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
var OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
var TEMP = "MONITORTYPE_TEMP";
|
|
||||||
var GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
var BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
var RECORD_VERSION = "3.0.0";
|
|
||||||
var DeviceTab = {
|
|
||||||
EMPTY: 0,
|
|
||||||
REAL_CAMERA: 1,
|
|
||||||
PREPROCESS_CAMERA: 2,
|
|
||||||
//摄像头列表
|
|
||||||
TAG_CAMERA: 3,
|
|
||||||
//预案列表
|
|
||||||
HISTORY_VIDEO_GROUP: 4,
|
|
||||||
//录像回放
|
|
||||||
VIRTUAL_CAMERA: 5,
|
|
||||||
//离线视频
|
|
||||||
REAL_CAMERA_NOFACE: 6,
|
|
||||||
REAL_CAMERA_ONLYFACE: 7,
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: 8
|
|
||||||
// 只有普通摄像头,没有人脸、没有盒子、直连
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
BODY_SEARCH_THRESHOID,
|
|
||||||
DeviceTab,
|
|
||||||
ENTER_CIRCLE,
|
|
||||||
GLOBAL_IS_BOX_VMS_SHOW,
|
|
||||||
GLOBAL_IS_ITEM_NUMBER_SHOW,
|
|
||||||
MODE_KEY,
|
|
||||||
OBJECT_AGE_TYPE_THRESHOLD,
|
|
||||||
OBJECT_GRNER_THRESHOLD,
|
|
||||||
OUT_CIRCLE,
|
|
||||||
RECORD_VERSION,
|
|
||||||
SEARCH_IMG_COUNT,
|
|
||||||
TEMP,
|
|
||||||
publicPath
|
|
||||||
});
|
|
1
packages/constants/lib/camera/index.d.ts
vendored
1
packages/constants/lib/camera/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare const TYPE = "";
|
|
@ -1,29 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/camera/index.ts
|
|
||||||
var camera_exports = {};
|
|
||||||
__export(camera_exports, {
|
|
||||||
TYPE: () => TYPE
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(camera_exports);
|
|
||||||
var TYPE = "";
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
TYPE
|
|
||||||
});
|
|
3
packages/constants/lib/index.d.ts
vendored
3
packages/constants/lib/index.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
export * from './camera';
|
|
||||||
export * from './base';
|
|
||||||
export * from './user';
|
|
@ -1,27 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var src_exports = {};
|
|
||||||
module.exports = __toCommonJS(src_exports);
|
|
||||||
__reExport(src_exports, require("./camera"), module.exports);
|
|
||||||
__reExport(src_exports, require("./base"), module.exports);
|
|
||||||
__reExport(src_exports, require("./user"), module.exports);
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
...require("./camera"),
|
|
||||||
...require("./base"),
|
|
||||||
...require("./user")
|
|
||||||
});
|
|
2
packages/constants/lib/user/index.d.ts
vendored
2
packages/constants/lib/user/index.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
declare const _default: {};
|
|
||||||
export default _default;
|
|
@ -1,25 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/user/index.ts
|
|
||||||
var user_exports = {};
|
|
||||||
__export(user_exports, {
|
|
||||||
default: () => user_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(user_exports);
|
|
||||||
var user_default = {};
|
|
1
packages/icon/es/index.d.ts
vendored
1
packages/icon/es/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export { default as IconFont } from './Iconfont';
|
|
@ -1,70 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/Iconfont.tsx
|
|
||||||
var Iconfont_exports = {};
|
|
||||||
__export(Iconfont_exports, {
|
|
||||||
default: () => Iconfont_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(Iconfont_exports);
|
|
||||||
var import_icons = require("@ant-design/icons");
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var Icon = (0, import_icons.createFromIconfontCN)({
|
|
||||||
scriptUrl: require("./font/iconfont.js")
|
|
||||||
});
|
|
||||||
var IconFont = (props) => {
|
|
||||||
const {
|
|
||||||
title = "",
|
|
||||||
styles = {},
|
|
||||||
icon,
|
|
||||||
size = 14,
|
|
||||||
onIconClick,
|
|
||||||
children,
|
|
||||||
active = false,
|
|
||||||
color = ""
|
|
||||||
} = props || {};
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
Icon,
|
|
||||||
{
|
|
||||||
title,
|
|
||||||
onClick: (e) => {
|
|
||||||
onIconClick && onIconClick(e);
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
...styles,
|
|
||||||
cursor: "pointer",
|
|
||||||
fontSize: size,
|
|
||||||
color,
|
|
||||||
...active ? { color: "#09f" } : {}
|
|
||||||
},
|
|
||||||
type: icon
|
|
||||||
},
|
|
||||||
children
|
|
||||||
);
|
|
||||||
};
|
|
||||||
var Iconfont_default = IconFont;
|
|
@ -1,40 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/demo/basic.tsx
|
|
||||||
var basic_exports = {};
|
|
||||||
__export(basic_exports, {
|
|
||||||
default: () => basic_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(basic_exports);
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var import_icon = require("@zhst/icon");
|
|
||||||
var demo = () => {
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_icon.IconFont, { icon: "icon-daoru1" }));
|
|
||||||
};
|
|
||||||
var basic_default = demo;
|
|
@ -1,59 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/demo/demo.tsx
|
|
||||||
var demo_exports = {};
|
|
||||||
__export(demo_exports, {
|
|
||||||
default: () => demo_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(demo_exports);
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var import_icon = require("@zhst/icon");
|
|
||||||
var import_index = require("./index.less");
|
|
||||||
var import_meta = require("@zhst/meta");
|
|
||||||
var iconJson = require("../font/iconfont.json");
|
|
||||||
var demo = () => {
|
|
||||||
const iconArr = iconJson["glyphs"];
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("ul", { className: "demo-ul" }, iconArr.map((item) => {
|
|
||||||
const { font_class, name } = item;
|
|
||||||
const fontName = `icon-${font_class}`;
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement("li", { className: "demo-li" }, /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_icon.IconFont,
|
|
||||||
{
|
|
||||||
styles: { marginBottom: 20 },
|
|
||||||
icon: fontName,
|
|
||||||
size: 32,
|
|
||||||
onIconClick: () => {
|
|
||||||
navigator.clipboard.writeText(fontName);
|
|
||||||
import_meta.message.success(`复制${fontName}成功`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
), /* @__PURE__ */ import_react.default.createElement("div", { className: "demo-li-name" }, name), /* @__PURE__ */ import_react.default.createElement("div", { className: "demo-li-name" }, fontName));
|
|
||||||
})));
|
|
||||||
};
|
|
||||||
var demo_default = demo;
|
|
@ -1,20 +0,0 @@
|
|||||||
.demo {
|
|
||||||
&-ul {
|
|
||||||
list-style-type: none;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-li {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
height: 150px;
|
|
||||||
width: 150px;
|
|
||||||
|
|
||||||
&-name {
|
|
||||||
color: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
packages/icon/lib/index.d.ts
vendored
1
packages/icon/lib/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export { default as IconFont } from './Iconfont';
|
|
@ -1,39 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var src_exports = {};
|
|
||||||
__export(src_exports, {
|
|
||||||
IconFont: () => import_Iconfont.default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(src_exports);
|
|
||||||
var import_Iconfont = __toESM(require("./Iconfont"));
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
IconFont
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
.icon:hover {
|
|
||||||
color: #6accca !important;
|
|
||||||
}
|
|
31
packages/map/es/constants.d.ts
vendored
31
packages/map/es/constants.d.ts
vendored
@ -1,31 +0,0 @@
|
|||||||
export declare const mapboxAccessToken = "pk.eyJ1IjoiZGluZ2xpMTIzIiwiYSI6ImNra204ODhjczBobTgyeHJ6MmJpZHMxNWgifQ.NbKrXh_hb2gvjr5CEMDnyQ";
|
|
||||||
export declare const MAP_CENTER: {
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
};
|
|
||||||
export declare const defaultMapConfig: {
|
|
||||||
mapboxAccessToken: string;
|
|
||||||
maxZoom: number;
|
|
||||||
minZoom: number;
|
|
||||||
dragRotate: boolean;
|
|
||||||
mapStyle: {
|
|
||||||
version: number;
|
|
||||||
name: string;
|
|
||||||
glyphs: string;
|
|
||||||
sources: {
|
|
||||||
'osm-tiles': {
|
|
||||||
type: string;
|
|
||||||
tiles: string[];
|
|
||||||
tileSize: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
layers: {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
source: string;
|
|
||||||
minZoom: number;
|
|
||||||
maxZoom: number;
|
|
||||||
renderingMode: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
};
|
|
1
packages/map/es/index.d.ts
vendored
1
packages/map/es/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export { default as MapBox } from './MapBox';
|
|
20
packages/map/es/interface.d.ts
vendored
20
packages/map/es/interface.d.ts
vendored
@ -1,20 +0,0 @@
|
|||||||
import { CSSProperties } from "react";
|
|
||||||
import { MapRef, MapStyle } from "react-map-gl";
|
|
||||||
export interface MapProps {
|
|
||||||
onLoad?: (e: mapboxgl.MapboxEvent<undefined>) => void;
|
|
||||||
mapRef?: React.MutableRefObject<MapRef | undefined>;
|
|
||||||
style?: CSSProperties;
|
|
||||||
children?: JSX.Element | JSX.Element[] | Array<JSX.Element | undefined>;
|
|
||||||
mapConfig?: MapConfigProps;
|
|
||||||
mapCenter: {
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface MapConfigProps {
|
|
||||||
mapboxAccessToken?: string;
|
|
||||||
minZoom?: number;
|
|
||||||
maxZoom?: number;
|
|
||||||
dragRotate?: boolean;
|
|
||||||
mapStyle?: MapStyle;
|
|
||||||
}
|
|
1
packages/map/es/utils.d.ts
vendored
1
packages/map/es/utils.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare const merge: (object: any, ...sources: any) => any;
|
|
@ -1,73 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/MapBox.tsx
|
|
||||||
var MapBox_exports = {};
|
|
||||||
__export(MapBox_exports, {
|
|
||||||
default: () => MapBox_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(MapBox_exports);
|
|
||||||
var import_mapbox_gl = require("mapbox-gl/dist/mapbox-gl.css");
|
|
||||||
var import_react_map_gl = __toESM(require("react-map-gl"));
|
|
||||||
var import_index = require("./index.less");
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var import_utils = require("./utils");
|
|
||||||
var import_constants = require("./constants");
|
|
||||||
var MapBox = (props) => {
|
|
||||||
const {
|
|
||||||
style = {},
|
|
||||||
children,
|
|
||||||
mapRef,
|
|
||||||
onLoad,
|
|
||||||
mapCenter = import_constants.MAP_CENTER,
|
|
||||||
mapConfig = {},
|
|
||||||
...others
|
|
||||||
} = props || {};
|
|
||||||
return (
|
|
||||||
//@ts-ignore
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_react_map_gl.default,
|
|
||||||
{
|
|
||||||
ref: (e) => {
|
|
||||||
if (mapRef) {
|
|
||||||
mapRef.current = e;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad: (e) => {
|
|
||||||
onLoad && onLoad(e);
|
|
||||||
},
|
|
||||||
style: { width: "100%", height: 600, ...style },
|
|
||||||
...(0, import_utils.merge)(import_constants.defaultMapConfig, mapConfig),
|
|
||||||
initialViewState: { ...mapCenter, zoom: 10 },
|
|
||||||
...others
|
|
||||||
},
|
|
||||||
children
|
|
||||||
)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
var MapBox_default = MapBox;
|
|
31
packages/map/lib/constants.d.ts
vendored
31
packages/map/lib/constants.d.ts
vendored
@ -1,31 +0,0 @@
|
|||||||
export declare const mapboxAccessToken = "pk.eyJ1IjoiZGluZ2xpMTIzIiwiYSI6ImNra204ODhjczBobTgyeHJ6MmJpZHMxNWgifQ.NbKrXh_hb2gvjr5CEMDnyQ";
|
|
||||||
export declare const MAP_CENTER: {
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
};
|
|
||||||
export declare const defaultMapConfig: {
|
|
||||||
mapboxAccessToken: string;
|
|
||||||
maxZoom: number;
|
|
||||||
minZoom: number;
|
|
||||||
dragRotate: boolean;
|
|
||||||
mapStyle: {
|
|
||||||
version: number;
|
|
||||||
name: string;
|
|
||||||
glyphs: string;
|
|
||||||
sources: {
|
|
||||||
'osm-tiles': {
|
|
||||||
type: string;
|
|
||||||
tiles: string[];
|
|
||||||
tileSize: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
layers: {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
source: string;
|
|
||||||
minZoom: number;
|
|
||||||
maxZoom: number;
|
|
||||||
renderingMode: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,81 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/constants.ts
|
|
||||||
var constants_exports = {};
|
|
||||||
__export(constants_exports, {
|
|
||||||
MAP_CENTER: () => MAP_CENTER,
|
|
||||||
defaultMapConfig: () => defaultMapConfig,
|
|
||||||
mapboxAccessToken: () => mapboxAccessToken
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(constants_exports);
|
|
||||||
var mapboxAccessToken = "pk.eyJ1IjoiZGluZ2xpMTIzIiwiYSI6ImNra204ODhjczBobTgyeHJ6MmJpZHMxNWgifQ.NbKrXh_hb2gvjr5CEMDnyQ";
|
|
||||||
var MAP_CENTER = {
|
|
||||||
longitude: 120.2667694313269,
|
|
||||||
latitude: 30.180942826533766
|
|
||||||
};
|
|
||||||
var MapUrl = "http://10.0.0.120:30003/map";
|
|
||||||
var defaultMapConfig = {
|
|
||||||
mapboxAccessToken,
|
|
||||||
maxZoom: 18,
|
|
||||||
minZoom: 4,
|
|
||||||
dragRotate: false,
|
|
||||||
mapStyle: {
|
|
||||||
version: 8,
|
|
||||||
name: "Mapbox Streets",
|
|
||||||
// sprite: `${location.origin}/mapbox/sprite`, // 地图图标
|
|
||||||
glyphs: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
|
|
||||||
// 字体
|
|
||||||
sources: {
|
|
||||||
//数据源
|
|
||||||
"osm-tiles": {
|
|
||||||
type: "raster",
|
|
||||||
//栅格切片。vector:矢量切片
|
|
||||||
// Z-瓦片层级,一般支持0-18级,越大代表越清晰;
|
|
||||||
// X-瓦片列号,从西向东(0->360),依次0,1,2,……;
|
|
||||||
// Y-瓦片行号,从北向南(有些也可能是从南向北),依次0,1,2,……;
|
|
||||||
tiles: [`${MapUrl}/api/tilesets/mapfile/{z}/{x}/{y}.png`],
|
|
||||||
//在线地址,先写死120
|
|
||||||
tileSize: 256
|
|
||||||
//切片的最小展示尺寸(可选,单位:像素,默认值为 512,即 1024/2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
layers: [
|
|
||||||
// 图层。图层指定了如何渲染数据源提供的数据
|
|
||||||
{
|
|
||||||
id: "zhstLayer",
|
|
||||||
//唯一id
|
|
||||||
type: "raster",
|
|
||||||
//类型 栅格。circle,symbol,line...
|
|
||||||
source: "osm-tiles",
|
|
||||||
// 'source-layer': 'osmtiles',//数据源必须是type:vector
|
|
||||||
minZoom: 4,
|
|
||||||
//最小层级
|
|
||||||
maxZoom: 17,
|
|
||||||
//最大层级
|
|
||||||
renderingMode: "2d"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
MAP_CENTER,
|
|
||||||
defaultMapConfig,
|
|
||||||
mapboxAccessToken
|
|
||||||
});
|
|
1
packages/map/lib/index.d.ts
vendored
1
packages/map/lib/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export { default as MapBox } from './MapBox';
|
|
@ -1,39 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var src_exports = {};
|
|
||||||
__export(src_exports, {
|
|
||||||
MapBox: () => import_MapBox.default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(src_exports);
|
|
||||||
var import_MapBox = __toESM(require("./MapBox"));
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
MapBox
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
.mapboxgl-ctrl-attrib-button {
|
|
||||||
display: none;
|
|
||||||
}
|
|
20
packages/map/lib/interface.d.ts
vendored
20
packages/map/lib/interface.d.ts
vendored
@ -1,20 +0,0 @@
|
|||||||
import { CSSProperties } from "react";
|
|
||||||
import { MapRef, MapStyle } from "react-map-gl";
|
|
||||||
export interface MapProps {
|
|
||||||
onLoad?: (e: mapboxgl.MapboxEvent<undefined>) => void;
|
|
||||||
mapRef?: React.MutableRefObject<MapRef | undefined>;
|
|
||||||
style?: CSSProperties;
|
|
||||||
children?: JSX.Element | JSX.Element[] | Array<JSX.Element | undefined>;
|
|
||||||
mapConfig?: MapConfigProps;
|
|
||||||
mapCenter: {
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface MapConfigProps {
|
|
||||||
mapboxAccessToken?: string;
|
|
||||||
minZoom?: number;
|
|
||||||
maxZoom?: number;
|
|
||||||
dragRotate?: boolean;
|
|
||||||
mapStyle?: MapStyle;
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/interface.ts
|
|
||||||
var interface_exports = {};
|
|
||||||
module.exports = __toCommonJS(interface_exports);
|
|
1
packages/map/lib/utils.d.ts
vendored
1
packages/map/lib/utils.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare const merge: (object: any, ...sources: any) => any;
|
|
@ -1,60 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/utils.ts
|
|
||||||
var utils_exports = {};
|
|
||||||
__export(utils_exports, {
|
|
||||||
merge: () => merge
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(utils_exports);
|
|
||||||
var getRawType = (val) => {
|
|
||||||
return Object.prototype.toString.call(val).slice(8, -1);
|
|
||||||
};
|
|
||||||
var isPlainObjectOrArray = (val) => {
|
|
||||||
return isPlainObject(val) || Array.isArray(val);
|
|
||||||
};
|
|
||||||
var isPlainObject = (val) => {
|
|
||||||
return getRawType(val) === "Object";
|
|
||||||
};
|
|
||||||
var merge = (object, ...sources) => {
|
|
||||||
for (const source of sources) {
|
|
||||||
for (const key in source) {
|
|
||||||
if (source[key] === void 0 && key in object) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (isPlainObjectOrArray(source[key])) {
|
|
||||||
if (getRawType(object[key] === getRawType(source[key]))) {
|
|
||||||
if (isPlainObject(object[key])) {
|
|
||||||
merge(object[key], source[key]);
|
|
||||||
} else {
|
|
||||||
object[key] = object[key].concat(source[key]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
object[key] = source[key];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
object[key] = source[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return object;
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
merge
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user