vdrag-topo-utils 1.4.0 → 1.6.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/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +111 -65
- package/dist/es/src/browser.d.ts +49 -2
- package/dist/es/src/browser.js +156 -103
- package/dist/es/src/coord.d.ts +30 -0
- package/dist/es/src/coord.js +65 -0
- package/dist/es/src/file.d.ts +21 -0
- package/dist/es/src/file.js +15 -0
- package/dist/es/src/mouse.d.ts +10 -0
- package/dist/es/src/mouse.js +22 -0
- package/dist/es/src/number.d.ts +9 -0
- package/dist/es/src/number.js +20 -10
- package/dist/es/src/string.d.ts +9 -0
- package/dist/es/src/string.js +33 -25
- package/dist/es/src/time.d.ts +15 -0
- package/dist/es/src/time.js +52 -25
- package/dist/es/src/type.d.ts +72 -0
- package/dist/es/src/type.js +33 -19
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/browser.d.ts +49 -2
- package/dist/lib/src/browser.js +1 -1
- package/dist/lib/src/coord.d.ts +30 -0
- package/dist/lib/src/coord.js +1 -0
- package/dist/lib/src/file.d.ts +21 -0
- package/dist/lib/src/file.js +1 -0
- package/dist/lib/src/mouse.d.ts +10 -0
- package/dist/lib/src/mouse.js +1 -0
- package/dist/lib/src/number.d.ts +9 -0
- package/dist/lib/src/number.js +1 -1
- package/dist/lib/src/string.d.ts +9 -0
- package/dist/lib/src/string.js +1 -1
- package/dist/lib/src/time.d.ts +15 -0
- package/dist/lib/src/time.js +1 -1
- package/dist/lib/src/type.d.ts +72 -0
- package/dist/lib/src/type.js +1 -1
- package/package.json +2 -1
package/dist/es/index.d.ts
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1,78 +1,124 @@
|
|
|
1
1
|
import { default as r } from "./src/withinstall.js";
|
|
2
2
|
import { default as a } from "./src/bus.js";
|
|
3
|
-
import { UA as
|
|
4
|
-
import { addBigBraceToStr as
|
|
5
|
-
import { formatDate as
|
|
6
|
-
import { isExistProperty as
|
|
7
|
-
import { replaceAop as
|
|
8
|
-
import { fromHttpStatus as
|
|
9
|
-
import { addEventListener as
|
|
10
|
-
import { formatDecimal as
|
|
11
|
-
import { imgError as
|
|
12
|
-
import { galleryImg as
|
|
3
|
+
import { UA as s, _global as l, _support as m, concatParams as c, customizeSetInterval as n, debounce as p, getClientHeight as g, getGlobal as d, getGlobalSupport as f, getLocationHref as h, getScrollHeight as S, getScrollTop as u, getURLParameters as x, getUrlParam as y, htmlElementAsString as T, inBrowser as b, is360zhushou as D, isAndroid as P, isChrome as v, isEdge as E, isEqual as C, isIE as F, isIE9 as w, isIOS as B, isMobile as I, isWeiXin as U, loadJS as k, loadStyle as N, matchUrlFileName as A, nativeTryCatch as L, parse as M, parseUrlToObj as H, setDocumentTitle as O, stringify as _, supportsHistory as j, throttle as z, throttle_02 as G } from "./src/browser.js";
|
|
4
|
+
import { addBigBraceToStr as R, addMiddleBraceToStr as q, capitalize as J, checkAccount as W, checkCertNo as X, checkCreditCode as Y, checkPassword as K, checkPhone as Q, extractStrFromCurlyBrace as V, extractStrFromMiddleBrace as $, interceptStr as ee, unknownToString as te, validateEmail as re, validateFixedPhone as oe, validatePhone as ae, validateSpecialString_01 as ie } from "./src/string.js";
|
|
5
|
+
import { calcTotalFlightTime as le, countDown as me, formatDate as ce, formatDate_02 as ne, formatShortTime as pe, formatTime as ge, generateUUID as de, getDaysDiffBetweenDates as fe, getDaysDiffFromNow as he, getTimestamp as Se, isExceedOneYear as ue } from "./src/time.js";
|
|
6
|
+
import { isArray as ye, isDate as Te, isExistProperty as be, isFunction as De, isMap as Pe, isObject as ve, isPlainObject as Ee, isPromise as Ce, isRegExp as Fe, isSet as we, isString as Be, isSymbol as Ie, objectToString as Ue, toTypeString as ke, variableTypeDetection as Ne } from "./src/type.js";
|
|
7
|
+
import { replaceAop as Le } from "./src/object.js";
|
|
8
|
+
import { fromHttpStatus as He } from "./src/http.js";
|
|
9
|
+
import { addEventListener as _e, removeEventListener as je, triggerDragEvent as ze } from "./src/dom.js";
|
|
10
|
+
import { formatDecimal as Ze, looseToNumber as Re, random as qe, toNumber as Je } from "./src/number.js";
|
|
11
|
+
import { imgError as Xe, preloadImage as Ye } from "./src/image.js";
|
|
12
|
+
import { galleryImg as Qe, getContacts as Ve, savePicture as $e, scanCode as et, scanFromGallery as tt, takePhoto as rt } from "./src/app.js";
|
|
13
|
+
import { getFileNameByPath as at, getFileTypeByPath as it, getImgUrl as st } from "./src/file.js";
|
|
14
|
+
import { LatLngConverter as mt, padZero as ct, padZeroNew as nt, switchDMS as pt } from "./src/coord.js";
|
|
15
|
+
import { disableUserZoom as dt, isMetaPressed as ft } from "./src/mouse.js";
|
|
13
16
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
mt as LatLngConverter,
|
|
18
|
+
s as UA,
|
|
19
|
+
l as _global,
|
|
20
|
+
m as _support,
|
|
21
|
+
R as addBigBraceToStr,
|
|
22
|
+
_e as addEventListener,
|
|
23
|
+
q as addMiddleBraceToStr,
|
|
20
24
|
a as bus,
|
|
25
|
+
le as calcTotalFlightTime,
|
|
26
|
+
J as capitalize,
|
|
27
|
+
W as checkAccount,
|
|
28
|
+
X as checkCertNo,
|
|
29
|
+
Y as checkCreditCode,
|
|
30
|
+
K as checkPassword,
|
|
31
|
+
Q as checkPhone,
|
|
32
|
+
c as concatParams,
|
|
33
|
+
me as countDown,
|
|
21
34
|
n as customizeSetInterval,
|
|
22
35
|
p as debounce,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
dt as disableUserZoom,
|
|
37
|
+
V as extractStrFromCurlyBrace,
|
|
38
|
+
$ as extractStrFromMiddleBrace,
|
|
39
|
+
ce as formatDate,
|
|
40
|
+
ne as formatDate_02,
|
|
41
|
+
Ze as formatDecimal,
|
|
42
|
+
pe as formatShortTime,
|
|
43
|
+
ge as formatTime,
|
|
44
|
+
He as fromHttpStatus,
|
|
45
|
+
Qe as galleryImg,
|
|
46
|
+
de as generateUUID,
|
|
31
47
|
g as getClientHeight,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
Ve as getContacts,
|
|
49
|
+
fe as getDaysDiffBetweenDates,
|
|
50
|
+
he as getDaysDiffFromNow,
|
|
51
|
+
at as getFileNameByPath,
|
|
52
|
+
it as getFileTypeByPath,
|
|
35
53
|
d as getGlobal,
|
|
36
54
|
f as getGlobalSupport,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
S as
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
st as getImgUrl,
|
|
56
|
+
h as getLocationHref,
|
|
57
|
+
S as getScrollHeight,
|
|
58
|
+
u as getScrollTop,
|
|
59
|
+
Se as getTimestamp,
|
|
60
|
+
x as getURLParameters,
|
|
61
|
+
y as getUrlParam,
|
|
62
|
+
T as htmlElementAsString,
|
|
63
|
+
Xe as imgError,
|
|
64
|
+
b as inBrowser,
|
|
65
|
+
ee as interceptStr,
|
|
46
66
|
D as is360zhushou,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
P as isAndroid,
|
|
68
|
+
ye as isArray,
|
|
69
|
+
v as isChrome,
|
|
70
|
+
Te as isDate,
|
|
71
|
+
E as isEdge,
|
|
72
|
+
C as isEqual,
|
|
73
|
+
ue as isExceedOneYear,
|
|
74
|
+
be as isExistProperty,
|
|
75
|
+
De as isFunction,
|
|
76
|
+
F as isIE,
|
|
77
|
+
w as isIE9,
|
|
53
78
|
B as isIOS,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
Pe as isMap,
|
|
80
|
+
ft as isMetaPressed,
|
|
81
|
+
I as isMobile,
|
|
82
|
+
ve as isObject,
|
|
83
|
+
Ee as isPlainObject,
|
|
84
|
+
Ce as isPromise,
|
|
85
|
+
Fe as isRegExp,
|
|
86
|
+
we as isSet,
|
|
87
|
+
Be as isString,
|
|
88
|
+
Ie as isSymbol,
|
|
89
|
+
U as isWeiXin,
|
|
90
|
+
k as loadJS,
|
|
91
|
+
N as loadStyle,
|
|
92
|
+
Re as looseToNumber,
|
|
93
|
+
A as matchUrlFileName,
|
|
94
|
+
L as nativeTryCatch,
|
|
95
|
+
Ue as objectToString,
|
|
96
|
+
ct as padZero,
|
|
97
|
+
nt as padZeroNew,
|
|
98
|
+
M as parse,
|
|
99
|
+
H as parseUrlToObj,
|
|
100
|
+
Ye as preloadImage,
|
|
101
|
+
qe as random,
|
|
102
|
+
je as removeEventListener,
|
|
103
|
+
Le as replaceAop,
|
|
104
|
+
$e as savePicture,
|
|
105
|
+
et as scanCode,
|
|
106
|
+
tt as scanFromGallery,
|
|
107
|
+
O as setDocumentTitle,
|
|
108
|
+
_ as stringify,
|
|
109
|
+
j as supportsHistory,
|
|
110
|
+
pt as switchDMS,
|
|
111
|
+
rt as takePhoto,
|
|
112
|
+
z as throttle,
|
|
113
|
+
G as throttle_02,
|
|
114
|
+
Je as toNumber,
|
|
115
|
+
ke as toTypeString,
|
|
116
|
+
ze as triggerDragEvent,
|
|
117
|
+
te as unknownToString,
|
|
118
|
+
re as validateEmail,
|
|
119
|
+
oe as validateFixedPhone,
|
|
120
|
+
ae as validatePhone,
|
|
121
|
+
ie as validateSpecialString_01,
|
|
122
|
+
Ne as variableTypeDetection,
|
|
77
123
|
r as withInstall
|
|
78
124
|
};
|
package/dist/es/src/browser.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const is360zhushou: any;
|
|
|
13
13
|
* 判断是否是移动端
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
|
-
export declare const isMobile: () =>
|
|
16
|
+
export declare const isMobile: () => boolean;
|
|
17
17
|
/**
|
|
18
18
|
* 获取全局事件
|
|
19
19
|
* @returns window
|
|
@@ -22,7 +22,7 @@ export declare function getGlobal(): Window;
|
|
|
22
22
|
export declare function getGlobalSupport(): {
|
|
23
23
|
[key: string]: any;
|
|
24
24
|
};
|
|
25
|
-
export declare const _global: Window;
|
|
25
|
+
export declare const _global: () => Window;
|
|
26
26
|
export declare const _support: {
|
|
27
27
|
[key: string]: any;
|
|
28
28
|
};
|
|
@@ -47,12 +47,39 @@ export declare function getLocationHref(): string;
|
|
|
47
47
|
* @returns
|
|
48
48
|
*/
|
|
49
49
|
export declare function matchUrlFileName(str: string, ext?: string): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* 把对象格式化为url上的参数表形式
|
|
52
|
+
* @param obj
|
|
53
|
+
* @param sep
|
|
54
|
+
* @param eq
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
export declare function stringify(obj: any, sep?: string, eq?: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* 将url上的参数,解析为对象
|
|
60
|
+
* @param str
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export declare function parse(str: string): any;
|
|
64
|
+
/**
|
|
65
|
+
* 解析url参数
|
|
66
|
+
* @example http://test.58.com:8084/#/?id=15&a=2
|
|
67
|
+
* @return {object} {id:15, a:2}
|
|
68
|
+
*/
|
|
69
|
+
export declare const getURLParameters: (url?: any) => any;
|
|
50
70
|
/**
|
|
51
71
|
* 从URL上获取指定key的值
|
|
52
72
|
* @param keyValue
|
|
53
73
|
* @returns value
|
|
54
74
|
*/
|
|
55
75
|
export declare function getUrlParam(keyValue: string, parseUrl?: string): string | null;
|
|
76
|
+
/**
|
|
77
|
+
* 粘合参数
|
|
78
|
+
* @example
|
|
79
|
+
* concatParams({a:1,b:2},'http://www.58.com?c=4')
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
export declare const concatParams: (obj: any, url: string) => string;
|
|
56
83
|
/**
|
|
57
84
|
* 解析URL为Obj
|
|
58
85
|
* @param url
|
|
@@ -125,3 +152,23 @@ export declare const getScrollHeight: () => number;
|
|
|
125
152
|
* @returns
|
|
126
153
|
*/
|
|
127
154
|
export declare function customizeSetInterval(callback: () => void, interval: number): number;
|
|
155
|
+
/**
|
|
156
|
+
* 动态加载js文件
|
|
157
|
+
*/
|
|
158
|
+
export declare function loadJS(url: string, callback?: any): void;
|
|
159
|
+
/**
|
|
160
|
+
*
|
|
161
|
+
* 动态加载css
|
|
162
|
+
*/
|
|
163
|
+
export declare function loadStyle(url: string, callback: any): void;
|
|
164
|
+
/**
|
|
165
|
+
* 对比两个值是否相等
|
|
166
|
+
* @param value
|
|
167
|
+
* @param oldValue
|
|
168
|
+
* @returns
|
|
169
|
+
*/
|
|
170
|
+
export declare const isEqual: (value: any, oldValue: any) => boolean;
|
|
171
|
+
/**
|
|
172
|
+
* 动态设置设置网页的title
|
|
173
|
+
*/
|
|
174
|
+
export declare const setDocumentTitle: (title: string) => void;
|
package/dist/es/src/browser.js
CHANGED
|
@@ -1,147 +1,200 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
);
|
|
4
|
-
|
|
1
|
+
const p = typeof window < "u", s = p && window.navigator.userAgent.toLowerCase(), T = s && /msie|trident/.test(s), E = s && s.indexOf("msie 9.0") > 0, h = s && s.indexOf("edge/") > 0, x = s && s.indexOf("android") > 0, S = s && /iphone|ipad|ipod|ios/.test(s), b = s && /chrome\/\d+/.test(s) && !h, H = s && /micromessenger/.test(s), O = s && /360appstore/.test(s), _ = () => {
|
|
2
|
+
const e = typeof window < "u" ? window.navigator.userAgent.toLowerCase() : "";
|
|
3
|
+
return /iphone|ipad|ipod|android|mobile/.test(e);
|
|
4
|
+
};
|
|
5
|
+
function g() {
|
|
5
6
|
return window;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
8
|
+
function y() {
|
|
9
|
+
return d().__vdrag_topo_error__ || {};
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
-
function
|
|
11
|
+
const d = () => g(), A = y();
|
|
12
|
+
function C(e, n) {
|
|
12
13
|
try {
|
|
13
|
-
|
|
14
|
-
} catch (
|
|
15
|
-
|
|
14
|
+
e();
|
|
15
|
+
} catch (t) {
|
|
16
|
+
n && n(t);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function D() {
|
|
19
20
|
return typeof document > "u" || document.location == null ? "" : document.location.href;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
22
|
+
function U(e, n = ".js") {
|
|
23
|
+
if (e.endsWith(n))
|
|
24
|
+
return e.substring(e.lastIndexOf("/") + 1);
|
|
25
|
+
}
|
|
26
|
+
function w(e, n, t) {
|
|
27
|
+
n = n || "&", t = t || "=";
|
|
28
|
+
let o = "";
|
|
29
|
+
for (const i in e)
|
|
30
|
+
o += i + t + unescape(e[i]) + n;
|
|
31
|
+
return o.slice(0, -1);
|
|
32
|
+
}
|
|
33
|
+
function $(e) {
|
|
34
|
+
const n = new Object(), t = e.split("&");
|
|
35
|
+
for (let o = 0; o < t.length; o++) {
|
|
36
|
+
const i = t[o].indexOf("=");
|
|
37
|
+
n[t[o].slice(0, i)] = unescape(t[o].slice(i + 1));
|
|
38
|
+
}
|
|
39
|
+
return n;
|
|
24
40
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
const f = (e = window.location.href) => (e.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
|
|
42
|
+
(n, t) => (n[t.slice(0, t.indexOf("="))] = decodeURIComponent(
|
|
43
|
+
t.slice(t.indexOf("=") + 1)
|
|
44
|
+
), n),
|
|
45
|
+
{}
|
|
46
|
+
);
|
|
47
|
+
function I(e, n = window.location.href) {
|
|
48
|
+
const t = decodeURI(n), o = {}, i = t.split("?").length > 1 ? t.split("?")[1] : null;
|
|
49
|
+
return i ? (i.split("&").forEach(function(r) {
|
|
50
|
+
const [l, u] = r.split("=");
|
|
51
|
+
o[l] = u;
|
|
52
|
+
}), o[e]) : null;
|
|
31
53
|
}
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
const N = (e, n) => {
|
|
55
|
+
const t = n ? f(n) : f();
|
|
56
|
+
return Object.assign(t, e), w(t);
|
|
57
|
+
};
|
|
58
|
+
function v(e) {
|
|
59
|
+
if (!e)
|
|
34
60
|
return {};
|
|
35
|
-
const
|
|
61
|
+
const n = e.match(
|
|
36
62
|
// eslint-disable-next-line no-useless-escape
|
|
37
63
|
/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/
|
|
38
64
|
);
|
|
39
|
-
if (!
|
|
65
|
+
if (!n)
|
|
40
66
|
return {};
|
|
41
|
-
const
|
|
67
|
+
const t = n[6] || "", o = n[8] || "";
|
|
42
68
|
return {
|
|
43
|
-
host:
|
|
44
|
-
path:
|
|
45
|
-
protocol:
|
|
46
|
-
relative:
|
|
69
|
+
host: n[4],
|
|
70
|
+
path: n[5],
|
|
71
|
+
protocol: n[2],
|
|
72
|
+
relative: n[5] + t + o
|
|
47
73
|
};
|
|
48
74
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
75
|
+
function L(e) {
|
|
76
|
+
const n = e.tagName.toLowerCase();
|
|
77
|
+
if (n === "body")
|
|
52
78
|
return "";
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
const o =
|
|
56
|
-
return `<${
|
|
79
|
+
let t = e.classList.value;
|
|
80
|
+
t = t !== "" ? ` class='${t}'` : "";
|
|
81
|
+
const o = e.id ? ` id="${e.id}"` : "", i = e.innerText;
|
|
82
|
+
return `<${n}${o}${t !== "" ? t : ""}>${i}</${n}>`;
|
|
57
83
|
}
|
|
58
|
-
const
|
|
59
|
-
let
|
|
84
|
+
const j = (e, n) => {
|
|
85
|
+
let t = !0;
|
|
60
86
|
return function(...o) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
87
|
+
t && (e.apply(this, o), t = !1, setTimeout(() => {
|
|
88
|
+
t = !0;
|
|
89
|
+
}, n));
|
|
64
90
|
};
|
|
65
|
-
}, M = function(
|
|
66
|
-
let o, i,
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
91
|
+
}, M = function(e, n, t) {
|
|
92
|
+
let o, i, c, r, l;
|
|
93
|
+
const u = function() {
|
|
94
|
+
const a = (/* @__PURE__ */ new Date()).getTime() - r;
|
|
95
|
+
a < n && a >= 0 ? o = setTimeout(u, n - a) : (o = null, t || (l = e.apply(c, i), o || (c = i = null)));
|
|
70
96
|
};
|
|
71
97
|
return function() {
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
return o || (o = setTimeout(
|
|
98
|
+
c = this, i = arguments, r = (/* @__PURE__ */ new Date()).getTime();
|
|
99
|
+
const a = t && !o;
|
|
100
|
+
return o || (o = setTimeout(u, n)), a && (l = e.apply(c, i), c = i = null), l;
|
|
75
101
|
};
|
|
76
|
-
},
|
|
77
|
-
let o, i,
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
l =
|
|
102
|
+
}, P = function(e, n, t) {
|
|
103
|
+
let o, i, c, r = null, l = 0;
|
|
104
|
+
t || (t = {});
|
|
105
|
+
const u = function() {
|
|
106
|
+
l = t.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), r = null, c = e.apply(o, i), r || (o = i = null);
|
|
81
107
|
};
|
|
82
108
|
return function() {
|
|
83
|
-
const
|
|
84
|
-
!l &&
|
|
85
|
-
const
|
|
86
|
-
return o = this, i = arguments,
|
|
109
|
+
const a = (/* @__PURE__ */ new Date()).getTime();
|
|
110
|
+
!l && t.leading === !1 && (l = a);
|
|
111
|
+
const m = n - (a - l);
|
|
112
|
+
return o = this, i = arguments, m <= 0 || m > n ? (r && (clearTimeout(r), r = null), l = a, c = e.apply(o, i), r || (o = i = null)) : !r && t.trailing !== !1 && (r = setTimeout(u, m)), c;
|
|
87
113
|
};
|
|
88
114
|
};
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
return !
|
|
115
|
+
function R() {
|
|
116
|
+
const e = d.chrome, n = e && e.app && e.app.runtime, t = "history" in d && !!d.history.pushState && !!d.history.replaceState;
|
|
117
|
+
return !n && t;
|
|
92
118
|
}
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
return document.documentElement && document.documentElement.scrollTop ?
|
|
96
|
-
},
|
|
97
|
-
let
|
|
98
|
-
return document.body.clientHeight && document.documentElement.clientHeight ?
|
|
119
|
+
const B = () => {
|
|
120
|
+
let e = 0;
|
|
121
|
+
return document.documentElement && document.documentElement.scrollTop ? e = document.documentElement.scrollTop : document.body && (e = document.body.scrollTop), e;
|
|
122
|
+
}, z = () => {
|
|
123
|
+
let e = 0;
|
|
124
|
+
return document.body.clientHeight && document.documentElement.clientHeight ? e = Math.min(
|
|
99
125
|
document.body.clientHeight,
|
|
100
126
|
document.documentElement.clientHeight
|
|
101
|
-
) :
|
|
127
|
+
) : e = Math.max(
|
|
102
128
|
document.body.clientHeight,
|
|
103
129
|
document.documentElement.clientHeight
|
|
104
|
-
),
|
|
105
|
-
},
|
|
130
|
+
), e;
|
|
131
|
+
}, F = () => Math.max(
|
|
106
132
|
document.body.scrollHeight,
|
|
107
133
|
document.documentElement.scrollHeight
|
|
108
134
|
);
|
|
109
|
-
function
|
|
110
|
-
let
|
|
135
|
+
function G(e, n) {
|
|
136
|
+
let t = Date.now(), o = 0;
|
|
111
137
|
const i = () => {
|
|
112
|
-
let
|
|
113
|
-
|
|
138
|
+
let c = Date.now();
|
|
139
|
+
c - t >= n && (t = c = Date.now(), e()), cancelAnimationFrame(o), o = window.requestAnimationFrame(i);
|
|
114
140
|
};
|
|
115
141
|
return i(), o;
|
|
116
142
|
}
|
|
143
|
+
function W(e, n) {
|
|
144
|
+
const t = document.createElement("script");
|
|
145
|
+
t.readyState ? t.onreadystatechange = function() {
|
|
146
|
+
(t.readyState === "loaded" || t.readyState === "complete") && (t.onreadystatechange = null, typeof n == "function" && n());
|
|
147
|
+
} : t.onload = function() {
|
|
148
|
+
typeof n == "function" && n();
|
|
149
|
+
}, t.src = e, document.getElementsByTagName("head")[0].appendChild(t);
|
|
150
|
+
}
|
|
151
|
+
function k(e, n) {
|
|
152
|
+
const t = document.createElement("link");
|
|
153
|
+
t.type = "text/css", t.rel = "stylesheet", t.readyState ? t.onreadystatechange = function() {
|
|
154
|
+
(t.readyState === "loaded" || t.readyState === "complete") && (t.onreadystatechange = null, n());
|
|
155
|
+
} : t.onload = function() {
|
|
156
|
+
n();
|
|
157
|
+
}, t.href = e, document.getElementsByTagName("head")[0].appendChild(t);
|
|
158
|
+
}
|
|
159
|
+
const q = (e, n) => !Object.is(e, n), J = (e) => {
|
|
160
|
+
document.title = e;
|
|
161
|
+
};
|
|
117
162
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
163
|
+
s as UA,
|
|
164
|
+
d as _global,
|
|
165
|
+
A as _support,
|
|
166
|
+
N as concatParams,
|
|
167
|
+
G as customizeSetInterval,
|
|
122
168
|
M as debounce,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
169
|
+
z as getClientHeight,
|
|
170
|
+
g as getGlobal,
|
|
171
|
+
y as getGlobalSupport,
|
|
172
|
+
D as getLocationHref,
|
|
173
|
+
F as getScrollHeight,
|
|
174
|
+
B as getScrollTop,
|
|
175
|
+
f as getURLParameters,
|
|
176
|
+
I as getUrlParam,
|
|
177
|
+
L as htmlElementAsString,
|
|
178
|
+
p as inBrowser,
|
|
179
|
+
O as is360zhushou,
|
|
180
|
+
x as isAndroid,
|
|
181
|
+
b as isChrome,
|
|
182
|
+
h as isEdge,
|
|
183
|
+
q as isEqual,
|
|
184
|
+
T as isIE,
|
|
185
|
+
E as isIE9,
|
|
186
|
+
S as isIOS,
|
|
187
|
+
_ as isMobile,
|
|
188
|
+
H as isWeiXin,
|
|
189
|
+
W as loadJS,
|
|
190
|
+
k as loadStyle,
|
|
191
|
+
U as matchUrlFileName,
|
|
192
|
+
C as nativeTryCatch,
|
|
193
|
+
$ as parse,
|
|
194
|
+
v as parseUrlToObj,
|
|
195
|
+
J as setDocumentTitle,
|
|
196
|
+
w as stringify,
|
|
197
|
+
R as supportsHistory,
|
|
198
|
+
j as throttle,
|
|
199
|
+
P as throttle_02
|
|
147
200
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 经纬度转换工具
|
|
3
|
+
*/
|
|
4
|
+
export declare const LatLngConverter: {
|
|
5
|
+
/**
|
|
6
|
+
* 将小数形式的经纬度转换为度分秒格式
|
|
7
|
+
* @param {number} decimal - 小数形式的经纬度(如 116.404)
|
|
8
|
+
* @param {number} [precision=6] - 秒的精度(小数位数)
|
|
9
|
+
* @returns {Object} 包含度、分、秒的对象 { degree: number, minute: number, second: number }
|
|
10
|
+
*/
|
|
11
|
+
decimalToDMS(decimal: number, precision?: number): {
|
|
12
|
+
degree: number;
|
|
13
|
+
minute: number;
|
|
14
|
+
second: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 将度分秒格式转换为小数形式的经纬度
|
|
18
|
+
* @param {number} degree - 度
|
|
19
|
+
* @param {number} minute - 分
|
|
20
|
+
* @param {number} second - 秒
|
|
21
|
+
* @param {number} [precision=8] - 结果的精度(小数位数)
|
|
22
|
+
* @returns {number} 小数形式的经纬度
|
|
23
|
+
*/
|
|
24
|
+
dmsToDecimal(dmsStr: string, precision?: number): number | {
|
|
25
|
+
isMatch: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function padZeroNew(n: number): string;
|
|
29
|
+
export declare const padZero: (num: number) => string;
|
|
30
|
+
export declare function switchDMS(data: number, type: string): string;
|