@deot/docs-client 1.1.3 → 1.1.5
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 +88 -4
- package/dist/chunks/browser-Cmwcvs-d.js +505 -0
- package/dist/chunks/cdn-DQoETju_-DS-873Vi.js +38 -0
- package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
- package/dist/chunks/compile-BHD98Ttf-BJaenUUQ.js +79915 -0
- package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
- package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
- package/dist/chunks/dist-0ySyXNpo.js +415 -0
- package/dist/chunks/dist-9UPCn_ag.js +24601 -0
- package/dist/chunks/dist-B44jICwZ.js +22 -0
- package/dist/chunks/dist-BQyOK8Qy.js +17 -0
- package/dist/chunks/dist-BUw25nXJ.js +65 -0
- package/dist/chunks/dist-BeOE8qTX.js +345 -0
- package/dist/chunks/dist-C3V7reR4.js +197 -0
- package/dist/chunks/dist-C8z9l0mA.js +58 -0
- package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
- package/dist/chunks/dist-COjpr4FU.js +426 -0
- package/dist/chunks/dist-CQir6D4y.js +244 -0
- package/dist/chunks/dist-Cxf7_ocf.js +44 -0
- package/dist/chunks/dist-DF4kisl2.js +43 -0
- package/dist/chunks/dist-DLj8yJdm.js +38 -0
- package/dist/chunks/dist-DWn6r6un.js +76 -0
- package/dist/chunks/dist-DWqBe2Ah.js +132 -0
- package/dist/chunks/dist-D_Uqh6m9.js +80 -0
- package/dist/chunks/dist-DcIU51zW.js +166 -0
- package/dist/chunks/dist-kiZUqqzR.js +27 -0
- package/dist/chunks/dist-oZ12SGqg.js +6 -0
- package/dist/chunks/dist-uXnwGrO3.js +76 -0
- package/dist/chunks/dist-va7FmnW4.js +156 -0
- package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
- package/dist/chunks/files-BqucFldk-B-hTQ-ip.js +148 -0
- package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
- package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
- package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
- package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
- package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
- package/dist/chunks/linker-xqjVl0X0-CWWI367H.js +118 -0
- package/dist/chunks/local-sandbox-DvcgaBOa-CzJxrdVx.js +298 -0
- package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
- package/dist/chunks/modules-BGzPcoRR-C9BWX8hC.js +154 -0
- package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
- package/dist/chunks/pinia-pDJilYOg.js +326 -0
- package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
- package/dist/chunks/remote-mq4zvrI1-Bib9tTkb.js +104 -0
- package/dist/chunks/script-DjUf9uWK-Cu5Kla_E.js +15055 -0
- package/dist/chunks/store-BOyC8F2y-CbodPye0.js +17037 -0
- package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
- package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
- package/dist/index.cjs +997 -340
- package/dist/index.d.ts +2 -1
- package/dist/index.js +42205 -103464
- package/dist/index.style.css +3 -4
- package/package.json +9 -9
- package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
- package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+helper-validator@1.1.4/node_modules/@deot/helper-validator/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({
|
|
5
|
+
RegExps: () => r,
|
|
6
|
+
RuleHelper: () => a,
|
|
7
|
+
Validator: () => i
|
|
8
|
+
}), n = /^-?\d+(\.\d+)?$/, r = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty({
|
|
9
|
+
__proto__: null,
|
|
10
|
+
dataURL: /^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=\-._~:@/?%\s]*\s*$/i,
|
|
11
|
+
date: /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,
|
|
12
|
+
email: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
|
|
13
|
+
identity: /(^[0-9a-zA-Z]{6,}$)/,
|
|
14
|
+
integer: /^[1-9]\d*$/,
|
|
15
|
+
mobile: /^(1[3-9])\d{9}$/,
|
|
16
|
+
name: /^[A-Za-z0-9\u4e00-\u9fa5_-]{1,}$/,
|
|
17
|
+
number: n,
|
|
18
|
+
number4: /^\d{4}$/,
|
|
19
|
+
number6: /^\d{6}$/,
|
|
20
|
+
price: /^([1-9][\d]{0,10}|0)([.]?[\d]{1,2})?$/,
|
|
21
|
+
tel: /^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/,
|
|
22
|
+
time: /\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}/,
|
|
23
|
+
url: /[a-zA-z]+:\/\/[^\s]*/,
|
|
24
|
+
wechat: /^[a-zA-Z\d_-]{5,}$/
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" })), i = class e {
|
|
26
|
+
static falsy = [
|
|
27
|
+
void 0,
|
|
28
|
+
null,
|
|
29
|
+
""
|
|
30
|
+
];
|
|
31
|
+
rules = {};
|
|
32
|
+
paths;
|
|
33
|
+
original;
|
|
34
|
+
constructor(e, t, n) {
|
|
35
|
+
this.updateRules(e), this.paths = t || [], this.original = n;
|
|
36
|
+
}
|
|
37
|
+
updateRules(t) {
|
|
38
|
+
t && Object.keys(t).forEach((n) => {
|
|
39
|
+
let r = t[n];
|
|
40
|
+
this.rules[n] = (Array.isArray(r) ? r : [r]).map((t) => {
|
|
41
|
+
if (typeof t == "function") return { validate: t };
|
|
42
|
+
(typeof t == "string" || t instanceof RegExp) && (t = { pattern: t }), typeof t == "boolean" && (t = { required: t });
|
|
43
|
+
let { validate: n, pattern: r, required: i, enum: a = [] } = t;
|
|
44
|
+
if (n && t.fields && (t.fields = void 0), !n && r) {
|
|
45
|
+
let e = typeof r == "string" ? new RegExp(r) : r;
|
|
46
|
+
return {
|
|
47
|
+
...t,
|
|
48
|
+
validate: (t) => e.test(t)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return !n && i ? {
|
|
52
|
+
...t,
|
|
53
|
+
validate: (t) => Array.isArray(t) ? !!t.length && t.every((t) => e.falsy.every((e) => t !== e)) : e.falsy.every((e) => t !== e)
|
|
54
|
+
} : !n && a.length ? {
|
|
55
|
+
...t,
|
|
56
|
+
validate: (e) => a.some((t) => e === t)
|
|
57
|
+
} : t;
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async validate(t, n) {
|
|
62
|
+
if (n ||= {}, !Object.keys(this.rules).length) return;
|
|
63
|
+
let r = n.fields || Object.keys(this.rules), i = [];
|
|
64
|
+
for (let a = 0; a < r.length; a++) {
|
|
65
|
+
let o = r[a], s = this.rules[o], c = t[o], l = this.original;
|
|
66
|
+
for (let r = 0; r < s.length; r++) {
|
|
67
|
+
let a = s[r], { validate: u = () => {}, transform: d = (e) => e, fields: f } = a, p = [...this.paths, o];
|
|
68
|
+
n._index !== void 0 && p.splice(p.length - 1, 0, n._index);
|
|
69
|
+
let m = d(c, {
|
|
70
|
+
field: o,
|
|
71
|
+
source: t,
|
|
72
|
+
paths: p,
|
|
73
|
+
original: l
|
|
74
|
+
});
|
|
75
|
+
if (f) {
|
|
76
|
+
let t = Array.isArray(m), r = t ? m : [m];
|
|
77
|
+
if (r.every((e) => e && typeof e == "object")) {
|
|
78
|
+
let a = new e(f, p);
|
|
79
|
+
for (let e = 0; e < r.length; e++) try {
|
|
80
|
+
await a.validate(r[e], {
|
|
81
|
+
_index: t ? e : void 0,
|
|
82
|
+
first: n.first,
|
|
83
|
+
original: l
|
|
84
|
+
});
|
|
85
|
+
} catch (e) {
|
|
86
|
+
if (i.push(...e), e.length && n.first) break;
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
let h = u(m, {
|
|
92
|
+
field: o,
|
|
93
|
+
source: t,
|
|
94
|
+
paths: p,
|
|
95
|
+
original: l
|
|
96
|
+
}), g = "";
|
|
97
|
+
if (h instanceof Promise) try {
|
|
98
|
+
await h;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
h = !1, g = e.message || e;
|
|
101
|
+
}
|
|
102
|
+
else typeof h == "string" && (g = h, h = !1);
|
|
103
|
+
if (h === !1 && (i.push({
|
|
104
|
+
paths: p,
|
|
105
|
+
message: g || a.message || "",
|
|
106
|
+
field: o,
|
|
107
|
+
value: m
|
|
108
|
+
}), n.first)) break;
|
|
109
|
+
}
|
|
110
|
+
if (i.length && n.first) break;
|
|
111
|
+
}
|
|
112
|
+
if (i.length) {
|
|
113
|
+
let e = i.map((e) => {
|
|
114
|
+
let { message: t, ...n } = e;
|
|
115
|
+
return e.message = typeof t == "function" ? t(n) : t, e;
|
|
116
|
+
});
|
|
117
|
+
return Promise.reject(e);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, a = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty({
|
|
121
|
+
__proto__: null,
|
|
122
|
+
create: (e) => {
|
|
123
|
+
e = {
|
|
124
|
+
name: "值",
|
|
125
|
+
...e
|
|
126
|
+
};
|
|
127
|
+
let { name: t, range: r = [], maxlength: a } = e;
|
|
128
|
+
e.messages = {
|
|
129
|
+
required: `${t} 必填`,
|
|
130
|
+
pattern: `请输入正确的 ${t}`,
|
|
131
|
+
type: `${t} 类型错误`,
|
|
132
|
+
range: `${t} 取值范围: ${r[0] || "*"}~${r[1] || "*"}`,
|
|
133
|
+
maxlength: `${t} 长度不超过 ${a}`,
|
|
134
|
+
...e.messages
|
|
135
|
+
};
|
|
136
|
+
let { messages: o, type: s, pattern: c, required: l } = e, u = (e) => !l && i.falsy.includes(e), d = [];
|
|
137
|
+
return l && d.push({
|
|
138
|
+
message: o.required,
|
|
139
|
+
required: l
|
|
140
|
+
}), (c || s === "number") && d.push({
|
|
141
|
+
message: o.pattern,
|
|
142
|
+
validate: (e) => u(e) ? !0 : (c || n).test(e)
|
|
143
|
+
}), s && d.push({
|
|
144
|
+
message: o.type,
|
|
145
|
+
validate: (e) => u(e) ? !0 : s === "string" ? typeof e == "string" : s === "number" ? typeof e == "number" :
|
|
146
|
+
/* istanbul ignore else -- @preserve */
|
|
147
|
+
s !== "array" || Array.isArray(e)
|
|
148
|
+
}), (r[0] !== void 0 || r[1] !== void 0) && d.push({
|
|
149
|
+
message: o.range,
|
|
150
|
+
validate: (e) => {
|
|
151
|
+
if (u(e)) return !0;
|
|
152
|
+
let t = !0, n = !0;
|
|
153
|
+
return r[0] !== void 0 && (t = Array.isArray(e) ? e.length >= r[0] : e >= r[0]), r[1] !== void 0 && (n = Array.isArray(e) ? e.length <= r[1] : e <= r[1]), t && n;
|
|
154
|
+
}
|
|
155
|
+
}), a !== void 0 && d.push({
|
|
156
|
+
message: o.maxlength,
|
|
157
|
+
validate: (e) => u(e) || typeof e != "string" ? !0 : e.length <= a
|
|
158
|
+
}), d;
|
|
159
|
+
},
|
|
160
|
+
required: (e) => [{
|
|
161
|
+
message: e,
|
|
162
|
+
required: !0
|
|
163
|
+
}]
|
|
164
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
165
|
+
//#endregion
|
|
166
|
+
export { r as i, t as n, a as r, i as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
//#region node_modules/.pnpm/@deot+helper-device@1.1.3/node_modules/@deot/helper-device/dist/index.js
|
|
3
|
+
var e = (e) => {
|
|
4
|
+
e ||= typeof window > "u" ? "" : navigator.userAgent;
|
|
5
|
+
let t = e.match(/(Android);?[\s\/]+([\d.]+)?/), n = e.match(/(iPad).*OS\s([\d_]+)/), r = e.match(/(iPod)(.*OS\s([\d_]+))/), i = !r && !n && e.match(/(iPhone\sOS)\s([\d_]+)/), a = e.toLowerCase().indexOf("chrome") >= 0, o = !!(i || n || r), s = t ? "android" : o ? "ios" : "", c = t ? t[2] : i && !r ? i[2].replace(/_/g, ".") : n ? n[2].replace(/_/g, ".") : r ? r[3] && r[3].replace(/_/g, ".") : "", l = o && e.match(/.*AppleWebKit(?!.*Safari)/i), u = /MicroMessenger/i.test(e), d = (e.match(/MicroMessenger\/([\d\.]+)/i) || [])[1] || "", f = /wechatdevtools/.test(e), p = !!(t || o || e && "ontouchend" in document), m = e.toLowerCase().indexOf("firefox") > -1;
|
|
6
|
+
return {
|
|
7
|
+
android: !!t,
|
|
8
|
+
ipad: !!n,
|
|
9
|
+
ipod: !!r,
|
|
10
|
+
iphone: !!i,
|
|
11
|
+
androidChrome: a,
|
|
12
|
+
ios: o,
|
|
13
|
+
os: s,
|
|
14
|
+
osVersion: c,
|
|
15
|
+
webView: l,
|
|
16
|
+
wechat: u,
|
|
17
|
+
wechatVersion: d,
|
|
18
|
+
wechatDevTools: f,
|
|
19
|
+
touch: p,
|
|
20
|
+
firefox: m
|
|
21
|
+
};
|
|
22
|
+
}, t = {
|
|
23
|
+
parse: e,
|
|
24
|
+
...e()
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { t as Device };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+helper-shared@1.1.3/node_modules/@deot/helper-shared/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({ IS_SERVER: () => n }), n = typeof window > "u";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { n as IS_SERVER, t };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
import { C as t, F as n, M as r, W as i, f as a, q as o } from "./vue.runtime.esm-bundler-XxHGOLq2.js";
|
|
4
|
+
//#region node_modules/.pnpm/@deot+vc-hooks@1.2.0_vue@3.5.43_typescript@6.0.3_/node_modules/@deot/vc-hooks/dist/index.js
|
|
5
|
+
var s = /* @__PURE__ */ e({
|
|
6
|
+
getInstance: () => m,
|
|
7
|
+
useAttrs: () => c,
|
|
8
|
+
useDrag: () => l,
|
|
9
|
+
useScrollbar: () => p
|
|
10
|
+
}), c = (e) => {
|
|
11
|
+
let t = i(), { merge: n = !0, exclude: r = [] } = e || {};
|
|
12
|
+
return a(() => {
|
|
13
|
+
if (n && !r.length) return t;
|
|
14
|
+
let e = Object.entries(t).reduce((e, [t, i]) => (r.includes(t) || (!n && /^on([A-Z])/.test(t) ? e.listeners[t] = i : !n && /(class|style)/.test(t) ? e[t] = i : e.attrs[t] = i), e), {
|
|
15
|
+
style: void 0,
|
|
16
|
+
class: void 0,
|
|
17
|
+
attrs: {},
|
|
18
|
+
listeners: {}
|
|
19
|
+
});
|
|
20
|
+
return n ? e.attrs : e;
|
|
21
|
+
});
|
|
22
|
+
}, l = (e) => {
|
|
23
|
+
let t = (t, n) => (e.cancel || e.end)?.(t, n), n = (e) => e.preventDefault(), i = (t) => {
|
|
24
|
+
let r = (t ? document.addEventListener : document.removeEventListener).bind(document);
|
|
25
|
+
r("mousemove", a), r("mouseup", o), e.selectable === !1 && (r("selectstart", n), r("dragstart", n));
|
|
26
|
+
}, a = (n) => {
|
|
27
|
+
if (!(n.buttons & 1)) {
|
|
28
|
+
i(!1), t(n, n);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
e.move?.(n, n);
|
|
32
|
+
}, o = (t) => {
|
|
33
|
+
t.button === 0 && (i(!1), e.end?.(t, t));
|
|
34
|
+
}, s = (t) => {
|
|
35
|
+
t.button === 0 && e.start?.(t, t) !== !1 && i(!0);
|
|
36
|
+
}, c = null, l = (e) => {
|
|
37
|
+
for (let t = 0; c !== null && t < (e?.length || 0); t++) if (e[t].identifier === c) return e[t];
|
|
38
|
+
}, u = (t) => {
|
|
39
|
+
if (l(t.touches) && !l(t.changedTouches)) return;
|
|
40
|
+
let n = t.changedTouches?.[0] || t.touches?.[0];
|
|
41
|
+
c = n && e.start?.(t, n) !== !1 ? n.identifier : null;
|
|
42
|
+
}, d = (t) => {
|
|
43
|
+
let n = l(t.touches);
|
|
44
|
+
n && e.move?.(t, n);
|
|
45
|
+
}, f = (e) => (t) => {
|
|
46
|
+
let n = l(t.changedTouches);
|
|
47
|
+
n && (c = null, e(t, n));
|
|
48
|
+
};
|
|
49
|
+
return r(() => i(!1)), { listeners: {
|
|
50
|
+
onMousedown: s,
|
|
51
|
+
onTouchstart: u,
|
|
52
|
+
onTouchmove: d,
|
|
53
|
+
onTouchend: f((t, n) => e.end?.(t, n)),
|
|
54
|
+
onTouchcancel: f(t)
|
|
55
|
+
} };
|
|
56
|
+
}, u = 0, d = "", f = "", p = (e) => {
|
|
57
|
+
let t = !1, i = !1, a = (e) => {
|
|
58
|
+
if (!t || e === i) return;
|
|
59
|
+
let { style: n } = document.body;
|
|
60
|
+
i = e, e ? u++ === 0 && (d = n.getPropertyValue("overflow"), f = n.getPropertyPriority("overflow"), n.setProperty("overflow", "hidden")) : --u === 0 && (d ? n.setProperty("overflow", d, f) : n.removeProperty("overflow"));
|
|
61
|
+
};
|
|
62
|
+
o(() => e.value, (e) => {
|
|
63
|
+
a(e);
|
|
64
|
+
}, { immediate: !1 }), n(() => {
|
|
65
|
+
t = !0, e.value && a(!0);
|
|
66
|
+
}), r(() => {
|
|
67
|
+
a(!1);
|
|
68
|
+
});
|
|
69
|
+
}, m = (e, n) => {
|
|
70
|
+
let r = t(), i = RegExp(`${e}$`), a = r.parent;
|
|
71
|
+
/* istanbul ignore next -- @preserve */
|
|
72
|
+
for (; a && !(a?.type?.name && i.test(a.type.name)) && (!n || !a?.[n] || !a?.proxy?.[n]);) a = a.parent || a?.type?.parent;
|
|
73
|
+
return a;
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { p as a, l as i, m as n, c as r, s as t };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+helper-dom@1.1.5/node_modules/@deot/helper-dom/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({
|
|
5
|
+
addClass: () => i,
|
|
6
|
+
composedPath: () => a,
|
|
7
|
+
contains: () => o,
|
|
8
|
+
el: () => s,
|
|
9
|
+
getScroller: () => u,
|
|
10
|
+
getStyle: () => c,
|
|
11
|
+
hasClass: () => r,
|
|
12
|
+
isScroller: () => l,
|
|
13
|
+
off: () => d,
|
|
14
|
+
on: () => f,
|
|
15
|
+
once: () => p,
|
|
16
|
+
prefixStyle: () => g,
|
|
17
|
+
removeClass: () => _,
|
|
18
|
+
scrollIntoView: () => v,
|
|
19
|
+
setStyle: () => y
|
|
20
|
+
}), n = typeof window > "u", r = (e, t) => {
|
|
21
|
+
if (n || !t) return !1;
|
|
22
|
+
if (t.includes(" ")) throw Error("[@deot/helper-dom]: 类名不应该包含空格");
|
|
23
|
+
return e.classList ? e.classList.contains(t) : (" " + e.className + " ").indexOf(" " + t + " ") > -1;
|
|
24
|
+
}, i = (e, t) => {
|
|
25
|
+
if (n || !t) return;
|
|
26
|
+
let i = e.className, a = t.split(" ");
|
|
27
|
+
for (let t = 0, n = a.length; t < n; t++) {
|
|
28
|
+
let n = a[t];
|
|
29
|
+
n && (e.classList ? e.classList.add(n) : r(e, n) || (i += " " + n));
|
|
30
|
+
}
|
|
31
|
+
e.classList || (e.className = i);
|
|
32
|
+
}, a = (e) => {
|
|
33
|
+
let t = e.composedPath && e.composedPath() || [];
|
|
34
|
+
if (t.length) return t;
|
|
35
|
+
let n = e.target?.parentNode;
|
|
36
|
+
/* istanbul ignore next -- @preserve */
|
|
37
|
+
for (; n;) t.push(n), n = n.parentNode;
|
|
38
|
+
return t;
|
|
39
|
+
}, o = (e, t) => {
|
|
40
|
+
if (n || !t) return !1;
|
|
41
|
+
let r = t.getBoundingClientRect(), i;
|
|
42
|
+
return i = !e || [
|
|
43
|
+
window,
|
|
44
|
+
document,
|
|
45
|
+
document.documentElement
|
|
46
|
+
].includes(e) ? {
|
|
47
|
+
top: 0,
|
|
48
|
+
right: window.innerWidth,
|
|
49
|
+
bottom: window.innerHeight,
|
|
50
|
+
left: 0
|
|
51
|
+
} : e.getBoundingClientRect(), r.top < i.bottom && r.bottom > i.top && r.right > i.left && r.left < i.right;
|
|
52
|
+
}, s = (e) => {
|
|
53
|
+
if (n) return null;
|
|
54
|
+
let t;
|
|
55
|
+
if (t = typeof e == "object" ? e : document.querySelector(e), !t) throw Error("[@deot/helper-dom]: el缺失");
|
|
56
|
+
return t;
|
|
57
|
+
}, c = (e, t) => {
|
|
58
|
+
if (n || !t) return "";
|
|
59
|
+
t === "float" && (t = "cssFloat");
|
|
60
|
+
try {
|
|
61
|
+
let n = document.defaultView.getComputedStyle(e, "");
|
|
62
|
+
return e.style[t] || n?.[t] || "";
|
|
63
|
+
} catch {
|
|
64
|
+
/* istanbul ignore next -- @preserve */
|
|
65
|
+
return e.style[t] || "";
|
|
66
|
+
}
|
|
67
|
+
}, l = (e, t) => {
|
|
68
|
+
if (n || !e) return !1;
|
|
69
|
+
let { className: r, direction: i } = t || {}, a = i ? c(e, `overflow-${i}`) : "";
|
|
70
|
+
return (!a || a === "visible") && (a = c(e, "overflow")), !!(a.match(/(scroll|auto)/) || r?.test(e.className));
|
|
71
|
+
}, u = (e, t) => {
|
|
72
|
+
if (n || !e) return null;
|
|
73
|
+
let r = e;
|
|
74
|
+
for (; r;) {
|
|
75
|
+
if ([
|
|
76
|
+
window,
|
|
77
|
+
document,
|
|
78
|
+
document.documentElement
|
|
79
|
+
].includes(r)) return window;
|
|
80
|
+
if (l(r, t)) return r;
|
|
81
|
+
r = r?.parentNode;
|
|
82
|
+
}
|
|
83
|
+
return r;
|
|
84
|
+
}, d = (e, t, r, i) => {
|
|
85
|
+
n || e.removeEventListener(t, r, i || !1);
|
|
86
|
+
}, f = (e, t, r, i) => n ? () => {} : (e.addEventListener(t, r, i || !1), () => {
|
|
87
|
+
e.removeEventListener(t, r, i || !1);
|
|
88
|
+
}), p = (e, t, r, i) => {
|
|
89
|
+
if (n) return () => {};
|
|
90
|
+
let a = f(e, t, function(...e) {
|
|
91
|
+
r && r.apply(this, e), a();
|
|
92
|
+
}, i);
|
|
93
|
+
return a;
|
|
94
|
+
}, m = n ? {} : document.createElement("div").style, h = (() => {
|
|
95
|
+
let e = {
|
|
96
|
+
webkit: "webkitTransform",
|
|
97
|
+
Moz: "MozTransform",
|
|
98
|
+
O: "OTransform",
|
|
99
|
+
ms: "msTransform",
|
|
100
|
+
standard: "transform"
|
|
101
|
+
}, t = {
|
|
102
|
+
webkit: "-webkit-",
|
|
103
|
+
Moz: "-moz-",
|
|
104
|
+
O: "-o-",
|
|
105
|
+
ms: "-ms-",
|
|
106
|
+
standard: ""
|
|
107
|
+
};
|
|
108
|
+
for (let n in e) if (m[e[n]] !== void 0) return {
|
|
109
|
+
camel: n,
|
|
110
|
+
kebab: t[n]
|
|
111
|
+
};
|
|
112
|
+
return !1;
|
|
113
|
+
})(), g = (e) => n || h === !1 ? {
|
|
114
|
+
camel: e,
|
|
115
|
+
kebab: e
|
|
116
|
+
} : {
|
|
117
|
+
camel: h.camel + e.charAt(0).toUpperCase() + e.substr(1),
|
|
118
|
+
kebab: h.kebab + e
|
|
119
|
+
}, _ = (e, t) => {
|
|
120
|
+
if (n || !t) return;
|
|
121
|
+
let i = t.split(" "), a = " " + e.className + " ";
|
|
122
|
+
for (let t = 0, n = i.length; t < n; t++) {
|
|
123
|
+
let n = i[t];
|
|
124
|
+
if (n) {
|
|
125
|
+
if (e.classList) {
|
|
126
|
+
e.classList.remove(n);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
/* istanbul ignore next -- @preserve */
|
|
130
|
+
r(e, n) && (a = a.replace(" " + n + " ", " "));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
e.classList || (e.className = a.trim());
|
|
134
|
+
}, v = async (e, t) => {
|
|
135
|
+
if (n) return;
|
|
136
|
+
let { from: r = 0, to: i = 0, duration: a = 300 } = t || {}, o = Math.abs(r - i), s = Math.ceil(o / a * 50), c, l = new Promise((e) => {
|
|
137
|
+
c = e;
|
|
138
|
+
}), u = (t, n) => {
|
|
139
|
+
if (t === n) {
|
|
140
|
+
c();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
let r = t + s > n ? n : t + s;
|
|
144
|
+
t > n && (r = t - s < n ? n : t - s), e === window ? window.scrollTo(r, r) : e.scrollTop = r, window.requestAnimationFrame(() => u(r, n));
|
|
145
|
+
};
|
|
146
|
+
return u(r, i), l;
|
|
147
|
+
}, y = (e, t, r) => {
|
|
148
|
+
if (!n && t) {
|
|
149
|
+
if (typeof t == "object") for (let n in t)
|
|
150
|
+
/* istanbul ignore if -- @preserve */
|
|
151
|
+
Object.hasOwnProperty.call(t, n) && y(e, n, t[n]);
|
|
152
|
+
else e.style[t] = r;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { s as a, d as c, _ as d, v as f, t as i, f as l, a as n, u as o, o as r, c as s, i as t, g as u };
|