st-comp 0.0.146 → 0.0.147
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/components.d.ts +0 -3
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +22 -26
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +103 -112
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +1426 -671
- package/es/KlineNew.cjs +3 -1
- package/es/KlineNew.js +2736 -314
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +96 -102
- package/es/Table.cjs +1 -1
- package/es/Table.js +60 -66
- package/es/User.cjs +1 -1
- package/es/User.js +96 -103
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +32 -41
- package/es/VirtualTable.cjs +1 -13
- package/es/VirtualTable.js +1 -2801
- package/es/_initCloneObject-7493ecd5.cjs +1 -0
- package/es/{_initCloneObject-14b53c6f.js → _initCloneObject-a8dcd058.js} +26 -26
- package/es/{base-ec05f348.cjs → base-00ce90ec.cjs} +3 -3
- package/es/{base-437d17f3.js → base-674a354a.js} +63 -64
- package/es/config-provider-419ffbf2.js +120 -0
- package/es/config-provider-68414290.cjs +3 -0
- package/es/dropdown-127a8c0d.cjs +1 -0
- package/es/{dropdown-634b5e27.js → dropdown-ce30ada6.js} +30 -31
- package/es/el-button-7b9f5933.js +745 -0
- package/es/el-button-c00975e1.cjs +1 -0
- package/es/{el-checkbox-group-e8fece80.js → el-checkbox-group-0554b352.js} +10 -10
- package/es/el-checkbox-group-7a313d34.cjs +1 -0
- package/es/{el-empty-bacc6613.js → el-empty-39b3aed7.js} +5 -5
- package/es/{el-empty-19ea04f4.cjs → el-empty-87154b6d.cjs} +1 -1
- package/es/el-form-item-7867f64d.cjs +12 -0
- package/es/{el-form-item-af1855f0.js → el-form-item-fc6f80ab.js} +78 -79
- package/es/el-input-2ff1628c.cjs +1 -0
- package/es/{el-input-4961b99f.js → el-input-d249ac86.js} +82 -84
- package/es/{el-input-number-610fc8ba.js → el-input-number-2066fbb7.js} +35 -36
- package/es/el-input-number-d6801a5c.cjs +1 -0
- package/es/{el-message-c3b3ac96.js → el-message-9859835d.js} +79 -81
- package/es/el-message-ffcf690c.cjs +1 -0
- package/es/el-overlay-91784be2.cjs +1 -0
- package/es/el-overlay-f0757cc4.js +525 -0
- package/es/el-popover-4db657e2.cjs +1 -0
- package/es/{el-popover-0aa071f2.js → el-popover-b7b43c1f.js} +18 -18
- package/es/el-scrollbar-35bac6b3.js +2452 -0
- package/es/el-scrollbar-ec09bbd3.cjs +1 -0
- package/es/el-select-0785c35a.cjs +1 -0
- package/es/{el-select-9381b156.js → el-select-bcbb7e55.js} +329 -333
- package/es/el-table-column-2478adf8.cjs +14 -0
- package/es/{el-table-column-55bffba5.js → el-table-column-c1e1a206.js} +346 -350
- package/es/el-tag-13ee17b3.cjs +1 -0
- package/es/el-tag-73372c6c.js +359 -0
- package/es/index-07b61d12.cjs +1 -0
- package/es/{index-39ec9741.js → index-45de4a12.js} +7 -7
- package/es/index-65b719a4.cjs +1 -0
- package/es/index-8b5fbc11.js +66 -0
- package/es/index-8c85d7c5.js +858 -0
- package/es/index-a49f4743.cjs +2 -0
- package/es/{scroll-387fcfdb.js → scroll-cb696ed2.js} +1 -1
- package/es/{scroll-41224831.cjs → scroll-cca17da0.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{zh-cn-ab9a583d.cjs → zh-cn-37af467d.cjs} +1 -1
- package/es/{zh-cn-eb9c2820.js → zh-cn-ef7d7220.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +206 -206
- package/lib/{index-9b8ff62a.js → index-24f8572c.js} +31450 -33319
- package/lib/{python-a9c3d9e5.js → python-2143eee4.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/components/KlineSub/index.vue +17 -3
- package/packages/KlineBasic/index.vue +2 -1
- package/packages/KlineBasic/utils.js +20 -2
- package/packages/index.ts +0 -2
- package/src/pages/KlineBasic/api.js +1 -1
- package/src/router/routes.ts +0 -5
- package/es/Kline.cjs +0 -1
- package/es/Kline.js +0 -1901
- package/es/_initCloneObject-441db749.cjs +0 -1
- package/es/castArray-4251bbe4.js +0 -10
- package/es/castArray-a45823fe.cjs +0 -1
- package/es/config-provider-55482a43.js +0 -47
- package/es/config-provider-7cdfca4d.cjs +0 -1
- package/es/debounce-ac30be50.js +0 -83
- package/es/debounce-b2ff12bd.cjs +0 -1
- package/es/dropdown-d7c59a21.cjs +0 -1
- package/es/el-button-196807af.cjs +0 -1
- package/es/el-button-e1665717.js +0 -235
- package/es/el-checkbox-group-492b95cc.cjs +0 -1
- package/es/el-form-item-5bdffd07.cjs +0 -12
- package/es/el-input-23e2bac3.cjs +0 -1
- package/es/el-input-number-40a81eb5.cjs +0 -1
- package/es/el-menu-item-78b858f2.cjs +0 -1
- package/es/el-menu-item-7d04c11a.js +0 -771
- package/es/el-message-d4df8136.cjs +0 -1
- package/es/el-overlay-12dd9b35.js +0 -519
- package/es/el-overlay-bc0790a2.cjs +0 -1
- package/es/el-popover-8a77e015.cjs +0 -1
- package/es/el-popper-50100766.js +0 -2262
- package/es/el-popper-746070ba.cjs +0 -1
- package/es/el-scrollbar-562d0595.js +0 -201
- package/es/el-scrollbar-d1c3e7f7.cjs +0 -1
- package/es/el-select-b162dffc.cjs +0 -1
- package/es/el-table-column-6d761fce.cjs +0 -14
- package/es/el-tag-985d9aff.js +0 -279
- package/es/el-tag-c51a6490.cjs +0 -1
- package/es/index-09e01b1d.js +0 -81
- package/es/index-0cb48e01.js +0 -306
- package/es/index-3bf8d597.cjs +0 -1
- package/es/index-657047bb.js +0 -513
- package/es/index-8a0b1c53.cjs +0 -3
- package/es/index-a387515d.cjs +0 -1
- package/es/index-a902a0d9.js +0 -59
- package/es/index-deb8de52.cjs +0 -1
- package/es/index-eea0bcb3.cjs +0 -1
- package/es/index.esm-8d9a2abe.js +0 -2432
- package/es/index.esm-94a95a2a.cjs +0 -3
- package/es/raf-8fc301fd.cjs +0 -1
- package/es/raf-b128c7b7.js +0 -6
- package/es/typescript-7ae59c4c.js +0 -4
- package/es/typescript-b63f8e83.cjs +0 -1
- package/es/use-form-common-props-1b84d8f4.cjs +0 -2
- package/es/use-form-common-props-f377e500.js +0 -587
- package/es/vnode-7dfd4ed5.js +0 -14
- package/es/vnode-7fbc61e1.cjs +0 -1
- package/packages/Kline/components/Contextmenu/index.vue +0 -110
- package/packages/Kline/components/Tips/index.vue +0 -40
- package/packages/Kline/componentsNew/KlineSlide/index.vue +0 -155
- package/packages/Kline/componentsNew/KlineSub/index.vue +0 -297
- package/packages/Kline/componentsNew/KlineTips/index.vue +0 -66
- package/packages/Kline/componentsNew/KlineUtils/index.vue +0 -84
- package/packages/Kline/componentsNew/Tips/index.vue +0 -33
- package/packages/Kline/formatKlineData.ts +0 -109
- package/packages/Kline/images/buy.svg +0 -1
- package/packages/Kline/images/pen.png +0 -0
- package/packages/Kline/images/sell.svg +0 -1
- package/packages/Kline/images/t.svg +0 -1
- package/packages/Kline/index.ts +0 -16
- package/packages/Kline/index.vue +0 -891
- package/packages/Kline/option.ts +0 -539
- package/packages/Kline/type.d.ts +0 -219
- package/packages/Kline/utils.ts +0 -682
- package/src/pages/Kline/api.ts +0 -127
- package/src/pages/Kline/components/MultiCycleSingleVariety.vue +0 -701
- package/src/pages/Kline/components/SingleCycleSingleVariety.vue +0 -924
- package/src/pages/Kline/index.vue +0 -90
package/es/index-0cb48e01.js
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { ref as y, onMounted as I, onBeforeUnmount as R, defineComponent as ee, provide as ae, watch as A, unref as b, nextTick as M, renderSlot as O, openBlock as ce, createBlock as ue, Teleport as ie } from "vue";
|
|
2
|
-
import { m as q, j, q as de, _ as te, i as fe, b as le, d as pe, w as Ee } from "./base-437d17f3.js";
|
|
3
|
-
function De(e) {
|
|
4
|
-
return e === void 0;
|
|
5
|
-
}
|
|
6
|
-
const xe = "update:modelValue", Ke = "change", Ve = "input", ve = 'a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])', Te = (e) => process.env.NODE_ENV === "test" ? !0 : getComputedStyle(e).position === "fixed" ? !1 : e.offsetParent !== null, Be = (e) => Array.from(e.querySelectorAll(ve)).filter((t) => ne(t) && Te(t)), ne = (e) => {
|
|
7
|
-
if (e.tabIndex > 0 || e.tabIndex === 0 && e.getAttribute("tabIndex") !== null)
|
|
8
|
-
return !0;
|
|
9
|
-
if (e.tabIndex < 0 || e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true")
|
|
10
|
-
return !1;
|
|
11
|
-
switch (e.nodeName) {
|
|
12
|
-
case "A":
|
|
13
|
-
return !!e.href && e.rel !== "ignore";
|
|
14
|
-
case "INPUT":
|
|
15
|
-
return !(e.type === "hidden" || e.type === "file");
|
|
16
|
-
case "BUTTON":
|
|
17
|
-
case "SELECT":
|
|
18
|
-
case "TEXTAREA":
|
|
19
|
-
return !0;
|
|
20
|
-
default:
|
|
21
|
-
return !1;
|
|
22
|
-
}
|
|
23
|
-
}, $e = function(e, t, ...o) {
|
|
24
|
-
let s;
|
|
25
|
-
t.includes("mouse") || t.includes("click") ? s = "MouseEvents" : t.includes("key") ? s = "KeyboardEvent" : s = "HTMLEvents";
|
|
26
|
-
const a = document.createEvent(s);
|
|
27
|
-
return a.initEvent(t, ...o), e.dispatchEvent(a), e;
|
|
28
|
-
}, N = "focus-trap.focus-after-trapped", C = "focus-trap.focus-after-released", be = "focus-trap.focusout-prevented", W = {
|
|
29
|
-
cancelable: !0,
|
|
30
|
-
bubbles: !1
|
|
31
|
-
}, me = {
|
|
32
|
-
cancelable: !0,
|
|
33
|
-
bubbles: !1
|
|
34
|
-
}, G = "focusAfterTrapped", J = "focusAfterReleased", Fe = Symbol("elFocusTrap"), U = y(), h = y(0), k = y(0);
|
|
35
|
-
let m = 0;
|
|
36
|
-
const se = (e) => {
|
|
37
|
-
const t = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
38
|
-
acceptNode: (s) => {
|
|
39
|
-
const a = s.tagName === "INPUT" && s.type === "hidden";
|
|
40
|
-
return s.disabled || s.hidden || a ? NodeFilter.FILTER_SKIP : s.tabIndex >= 0 || s === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
for (; o.nextNode(); )
|
|
44
|
-
t.push(o.currentNode);
|
|
45
|
-
return t;
|
|
46
|
-
}, X = (e, t) => {
|
|
47
|
-
for (const o of e)
|
|
48
|
-
if (!_e(o, t))
|
|
49
|
-
return o;
|
|
50
|
-
}, _e = (e, t) => {
|
|
51
|
-
if (process.env.NODE_ENV === "test")
|
|
52
|
-
return !1;
|
|
53
|
-
if (getComputedStyle(e).visibility === "hidden")
|
|
54
|
-
return !0;
|
|
55
|
-
for (; e; ) {
|
|
56
|
-
if (t && e === t)
|
|
57
|
-
return !1;
|
|
58
|
-
if (getComputedStyle(e).display === "none")
|
|
59
|
-
return !0;
|
|
60
|
-
e = e.parentElement;
|
|
61
|
-
}
|
|
62
|
-
return !1;
|
|
63
|
-
}, ye = (e) => {
|
|
64
|
-
const t = se(e), o = X(t, e), s = X(t.reverse(), e);
|
|
65
|
-
return [o, s];
|
|
66
|
-
}, he = (e) => e instanceof HTMLInputElement && "select" in e, l = (e, t) => {
|
|
67
|
-
if (e && e.focus) {
|
|
68
|
-
const o = document.activeElement;
|
|
69
|
-
let s = !1;
|
|
70
|
-
q(e) && !ne(e) && !e.getAttribute("tabindex") && (e.setAttribute("tabindex", "-1"), s = !0), e.focus({ preventScroll: !0 }), k.value = window.performance.now(), e !== o && he(e) && t && e.select(), q(e) && s && e.removeAttribute("tabindex");
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
function Y(e, t) {
|
|
74
|
-
const o = [...e], s = e.indexOf(t);
|
|
75
|
-
return s !== -1 && o.splice(s, 1), o;
|
|
76
|
-
}
|
|
77
|
-
const Pe = () => {
|
|
78
|
-
let e = [];
|
|
79
|
-
return {
|
|
80
|
-
push: (s) => {
|
|
81
|
-
const a = e[0];
|
|
82
|
-
a && s !== a && a.pause(), e = Y(e, s), e.unshift(s);
|
|
83
|
-
},
|
|
84
|
-
remove: (s) => {
|
|
85
|
-
var a, d;
|
|
86
|
-
e = Y(e, s), (d = (a = e[0]) == null ? void 0 : a.resume) == null || d.call(a);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}, ge = (e, t = !1) => {
|
|
90
|
-
const o = document.activeElement;
|
|
91
|
-
for (const s of e)
|
|
92
|
-
if (l(s, t), document.activeElement !== o)
|
|
93
|
-
return;
|
|
94
|
-
}, z = Pe(), we = () => h.value > k.value, F = () => {
|
|
95
|
-
U.value = "pointer", h.value = window.performance.now();
|
|
96
|
-
}, Q = () => {
|
|
97
|
-
U.value = "keyboard", h.value = window.performance.now();
|
|
98
|
-
}, Le = () => (I(() => {
|
|
99
|
-
m === 0 && (document.addEventListener("mousedown", F), document.addEventListener("touchstart", F), document.addEventListener("keydown", Q)), m++;
|
|
100
|
-
}), R(() => {
|
|
101
|
-
m--, m <= 0 && (document.removeEventListener("mousedown", F), document.removeEventListener("touchstart", F), document.removeEventListener("keydown", Q));
|
|
102
|
-
}), {
|
|
103
|
-
focusReason: U,
|
|
104
|
-
lastUserFocusTimestamp: h,
|
|
105
|
-
lastAutomatedFocusTimestamp: k
|
|
106
|
-
}), _ = (e) => new CustomEvent(be, {
|
|
107
|
-
...me,
|
|
108
|
-
detail: e
|
|
109
|
-
}), oe = {
|
|
110
|
-
tab: "Tab",
|
|
111
|
-
enter: "Enter",
|
|
112
|
-
space: "Space",
|
|
113
|
-
left: "ArrowLeft",
|
|
114
|
-
up: "ArrowUp",
|
|
115
|
-
right: "ArrowRight",
|
|
116
|
-
down: "ArrowDown",
|
|
117
|
-
esc: "Escape",
|
|
118
|
-
delete: "Delete",
|
|
119
|
-
backspace: "Backspace",
|
|
120
|
-
numpadEnter: "NumpadEnter",
|
|
121
|
-
pageUp: "PageUp",
|
|
122
|
-
pageDown: "PageDown",
|
|
123
|
-
home: "Home",
|
|
124
|
-
end: "End"
|
|
125
|
-
};
|
|
126
|
-
let E = [];
|
|
127
|
-
const Z = (e) => {
|
|
128
|
-
e.code === oe.esc && E.forEach((t) => t(e));
|
|
129
|
-
}, Se = (e) => {
|
|
130
|
-
I(() => {
|
|
131
|
-
E.length === 0 && document.addEventListener("keydown", Z), j && E.push(e);
|
|
132
|
-
}), R(() => {
|
|
133
|
-
E = E.filter((t) => t !== e), E.length === 0 && j && document.removeEventListener("keydown", Z);
|
|
134
|
-
});
|
|
135
|
-
}, Ae = ee({
|
|
136
|
-
name: "ElFocusTrap",
|
|
137
|
-
inheritAttrs: !1,
|
|
138
|
-
props: {
|
|
139
|
-
loop: Boolean,
|
|
140
|
-
trapped: Boolean,
|
|
141
|
-
focusTrapEl: Object,
|
|
142
|
-
focusStartEl: {
|
|
143
|
-
type: [Object, String],
|
|
144
|
-
default: "first"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
emits: [
|
|
148
|
-
G,
|
|
149
|
-
J,
|
|
150
|
-
"focusin",
|
|
151
|
-
"focusout",
|
|
152
|
-
"focusout-prevented",
|
|
153
|
-
"release-requested"
|
|
154
|
-
],
|
|
155
|
-
setup(e, { emit: t }) {
|
|
156
|
-
const o = y();
|
|
157
|
-
let s, a;
|
|
158
|
-
const { focusReason: d } = Le();
|
|
159
|
-
Se((n) => {
|
|
160
|
-
e.trapped && !p.paused && t("release-requested", n);
|
|
161
|
-
});
|
|
162
|
-
const p = {
|
|
163
|
-
paused: !1,
|
|
164
|
-
pause() {
|
|
165
|
-
this.paused = !0;
|
|
166
|
-
},
|
|
167
|
-
resume() {
|
|
168
|
-
this.paused = !1;
|
|
169
|
-
}
|
|
170
|
-
}, v = (n) => {
|
|
171
|
-
if (!e.loop && !e.trapped || p.paused)
|
|
172
|
-
return;
|
|
173
|
-
const { code: r, altKey: c, ctrlKey: u, metaKey: i, currentTarget: B, shiftKey: $ } = n, { loop: H } = e, re = r === oe.tab && !c && !u && !i, T = document.activeElement;
|
|
174
|
-
if (re && T) {
|
|
175
|
-
const w = B, [L, S] = ye(w);
|
|
176
|
-
if (L && S) {
|
|
177
|
-
if (!$ && T === S) {
|
|
178
|
-
const f = _({
|
|
179
|
-
focusReason: d.value
|
|
180
|
-
});
|
|
181
|
-
t("focusout-prevented", f), f.defaultPrevented || (n.preventDefault(), H && l(L, !0));
|
|
182
|
-
} else if ($ && [L, w].includes(T)) {
|
|
183
|
-
const f = _({
|
|
184
|
-
focusReason: d.value
|
|
185
|
-
});
|
|
186
|
-
t("focusout-prevented", f), f.defaultPrevented || (n.preventDefault(), H && l(S, !0));
|
|
187
|
-
}
|
|
188
|
-
} else if (T === w) {
|
|
189
|
-
const f = _({
|
|
190
|
-
focusReason: d.value
|
|
191
|
-
});
|
|
192
|
-
t("focusout-prevented", f), f.defaultPrevented || n.preventDefault();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
ae(Fe, {
|
|
197
|
-
focusTrapRef: o,
|
|
198
|
-
onKeydown: v
|
|
199
|
-
}), A(() => e.focusTrapEl, (n) => {
|
|
200
|
-
n && (o.value = n);
|
|
201
|
-
}, { immediate: !0 }), A([o], ([n], [r]) => {
|
|
202
|
-
n && (n.addEventListener("keydown", v), n.addEventListener("focusin", P), n.addEventListener("focusout", g)), r && (r.removeEventListener("keydown", v), r.removeEventListener("focusin", P), r.removeEventListener("focusout", g));
|
|
203
|
-
});
|
|
204
|
-
const D = (n) => {
|
|
205
|
-
t(G, n);
|
|
206
|
-
}, x = (n) => t(J, n), P = (n) => {
|
|
207
|
-
const r = b(o);
|
|
208
|
-
if (!r)
|
|
209
|
-
return;
|
|
210
|
-
const c = n.target, u = n.relatedTarget, i = c && r.contains(c);
|
|
211
|
-
e.trapped || u && r.contains(u) || (s = u), i && t("focusin", n), !p.paused && e.trapped && (i ? a = c : l(a, !0));
|
|
212
|
-
}, g = (n) => {
|
|
213
|
-
const r = b(o);
|
|
214
|
-
if (!(p.paused || !r))
|
|
215
|
-
if (e.trapped) {
|
|
216
|
-
const c = n.relatedTarget;
|
|
217
|
-
!de(c) && !r.contains(c) && setTimeout(() => {
|
|
218
|
-
if (!p.paused && e.trapped) {
|
|
219
|
-
const u = _({
|
|
220
|
-
focusReason: d.value
|
|
221
|
-
});
|
|
222
|
-
t("focusout-prevented", u), u.defaultPrevented || l(a, !0);
|
|
223
|
-
}
|
|
224
|
-
}, 0);
|
|
225
|
-
} else {
|
|
226
|
-
const c = n.target;
|
|
227
|
-
c && r.contains(c) || t("focusout", n);
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
async function K() {
|
|
231
|
-
await M();
|
|
232
|
-
const n = b(o);
|
|
233
|
-
if (n) {
|
|
234
|
-
z.push(p);
|
|
235
|
-
const r = n.contains(document.activeElement) ? s : document.activeElement;
|
|
236
|
-
if (s = r, !n.contains(r)) {
|
|
237
|
-
const u = new Event(N, W);
|
|
238
|
-
n.addEventListener(N, D), n.dispatchEvent(u), u.defaultPrevented || M(() => {
|
|
239
|
-
let i = e.focusStartEl;
|
|
240
|
-
fe(i) || (l(i), document.activeElement !== i && (i = "first")), i === "first" && ge(se(n), !0), (document.activeElement === r || i === "container") && l(n);
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function V() {
|
|
246
|
-
const n = b(o);
|
|
247
|
-
if (n) {
|
|
248
|
-
n.removeEventListener(N, D);
|
|
249
|
-
const r = new CustomEvent(C, {
|
|
250
|
-
...W,
|
|
251
|
-
detail: {
|
|
252
|
-
focusReason: d.value
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
n.addEventListener(C, x), n.dispatchEvent(r), !r.defaultPrevented && (d.value == "keyboard" || !we() || n.contains(document.activeElement)) && l(s ?? document.body), n.removeEventListener(C, x), z.remove(p);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return I(() => {
|
|
259
|
-
e.trapped && K(), A(() => e.trapped, (n) => {
|
|
260
|
-
n ? K() : V();
|
|
261
|
-
});
|
|
262
|
-
}), R(() => {
|
|
263
|
-
e.trapped && V(), o.value && (o.value.removeEventListener("keydown", v), o.value.removeEventListener("focusin", P), o.value.removeEventListener("focusout", g), o.value = void 0);
|
|
264
|
-
}), {
|
|
265
|
-
onKeydown: v
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
function Ne(e, t, o, s, a, d) {
|
|
270
|
-
return O(e.$slots, "default", { handleKeydown: e.onKeydown });
|
|
271
|
-
}
|
|
272
|
-
var He = /* @__PURE__ */ te(Ae, [["render", Ne], ["__file", "focus-trap.vue"]]);
|
|
273
|
-
const Ce = le({
|
|
274
|
-
to: {
|
|
275
|
-
type: pe([String, Object]),
|
|
276
|
-
required: !0
|
|
277
|
-
},
|
|
278
|
-
disabled: Boolean
|
|
279
|
-
}), Oe = /* @__PURE__ */ ee({
|
|
280
|
-
__name: "teleport",
|
|
281
|
-
props: Ce,
|
|
282
|
-
setup(e) {
|
|
283
|
-
return (t, o) => t.disabled ? O(t.$slots, "default", { key: 0 }) : (ce(), ue(ie, {
|
|
284
|
-
key: 1,
|
|
285
|
-
to: t.to
|
|
286
|
-
}, [
|
|
287
|
-
O(t.$slots, "default")
|
|
288
|
-
], 8, ["to"]));
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
var Ie = /* @__PURE__ */ te(Oe, [["__file", "teleport.vue"]]);
|
|
292
|
-
const Me = Ee(Ie);
|
|
293
|
-
export {
|
|
294
|
-
Ke as C,
|
|
295
|
-
oe as E,
|
|
296
|
-
Fe as F,
|
|
297
|
-
Ve as I,
|
|
298
|
-
xe as U,
|
|
299
|
-
He as a,
|
|
300
|
-
Me as b,
|
|
301
|
-
ne as c,
|
|
302
|
-
l as d,
|
|
303
|
-
De as i,
|
|
304
|
-
Be as o,
|
|
305
|
-
$e as t
|
|
306
|
-
};
|
package/es/index-3bf8d597.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("vue"),f=require("./base-ec05f348.cjs");function Q(e){return e===void 0}const Z="update:modelValue",ee="change",te="input",ne='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',oe=e=>process.env.NODE_ENV==="test"?!0:getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,se=e=>Array.from(e.querySelectorAll(ne)).filter(t=>C(t)&&oe(t)),C=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true")return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},re=function(e,t,...s){let o;t.includes("mouse")||t.includes("click")?o="MouseEvents":t.includes("key")?o="KeyboardEvent":o="HTMLEvents";const c=document.createEvent(o);return c.initEvent(t,...s),e.dispatchEvent(c),e},w="focus-trap.focus-after-trapped",L="focus-trap.focus-after-released",ue="focus-trap.focusout-prevented",H={cancelable:!0,bubbles:!1},ce={cancelable:!0,bubbles:!1},M="focusAfterTrapped",$="focusAfterReleased",Y=Symbol("elFocusTrap"),O=r.ref(),P=r.ref(0),U=r.ref(0);let _=0;const X=e=>{const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t},q=(e,t)=>{for(const s of e)if(!ae(s,t))return s},ae=(e,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},ie=e=>{const t=X(e),s=q(t,e),o=q(t.reverse(),e);return[s,o]},de=e=>e instanceof HTMLInputElement&&"select"in e,E=(e,t)=>{if(e&&e.focus){const s=document.activeElement;let o=!1;f.isElement(e)&&!C(e)&&!e.getAttribute("tabindex")&&(e.setAttribute("tabindex","-1"),o=!0),e.focus({preventScroll:!0}),U.value=window.performance.now(),e!==s&&de(e)&&t&&e.select(),f.isElement(e)&&o&&e.removeAttribute("tabindex")}};function j(e,t){const s=[...e],o=e.indexOf(t);return o!==-1&&s.splice(o,1),s}const fe=()=>{let e=[];return{push:o=>{const c=e[0];c&&o!==c&&c.pause(),e=j(e,o),e.unshift(o)},remove:o=>{var c,l;e=j(e,o),(l=(c=e[0])==null?void 0:c.resume)==null||l.call(c)}}},le=(e,t=!1)=>{const s=document.activeElement;for(const o of e)if(E(o,t),document.activeElement!==s)return},G=fe(),Ee=()=>P.value>U.value,F=()=>{O.value="pointer",P.value=window.performance.now()},J=()=>{O.value="keyboard",P.value=window.performance.now()},pe=()=>(r.onMounted(()=>{_===0&&(document.addEventListener("mousedown",F),document.addEventListener("touchstart",F),document.addEventListener("keydown",J)),_++}),r.onBeforeUnmount(()=>{_--,_<=0&&(document.removeEventListener("mousedown",F),document.removeEventListener("touchstart",F),document.removeEventListener("keydown",J))}),{focusReason:O,lastUserFocusTimestamp:P,lastAutomatedFocusTimestamp:U}),y=e=>new CustomEvent(ue,{...ce,detail:e}),I={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"};let T=[];const W=e=>{e.code===I.esc&&T.forEach(t=>t(e))},ve=e=>{r.onMounted(()=>{T.length===0&&document.addEventListener("keydown",W),f.isClient&&T.push(e)}),r.onBeforeUnmount(()=>{T=T.filter(t=>t!==e),T.length===0&&f.isClient&&document.removeEventListener("keydown",W)})},Te=r.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[M,$,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const s=r.ref();let o,c;const{focusReason:l}=pe();ve(n=>{e.trapped&&!v.paused&&t("release-requested",n)});const v={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},b=n=>{if(!e.loop&&!e.trapped||v.paused)return;const{code:u,altKey:a,ctrlKey:i,metaKey:d,currentTarget:x,shiftKey:K}=n,{loop:B}=e,z=u===I.tab&&!a&&!i&&!d,m=document.activeElement;if(z&&m){const S=x,[g,A]=ie(S);if(g&&A){if(!K&&m===A){const p=y({focusReason:l.value});t("focusout-prevented",p),p.defaultPrevented||(n.preventDefault(),B&&E(g,!0))}else if(K&&[g,S].includes(m)){const p=y({focusReason:l.value});t("focusout-prevented",p),p.defaultPrevented||(n.preventDefault(),B&&E(A,!0))}}else if(m===S){const p=y({focusReason:l.value});t("focusout-prevented",p),p.defaultPrevented||n.preventDefault()}}};r.provide(Y,{focusTrapRef:s,onKeydown:b}),r.watch(()=>e.focusTrapEl,n=>{n&&(s.value=n)},{immediate:!0}),r.watch([s],([n],[u])=>{n&&(n.addEventListener("keydown",b),n.addEventListener("focusin",h),n.addEventListener("focusout",N)),u&&(u.removeEventListener("keydown",b),u.removeEventListener("focusin",h),u.removeEventListener("focusout",N))});const R=n=>{t(M,n)},k=n=>t($,n),h=n=>{const u=r.unref(s);if(!u)return;const a=n.target,i=n.relatedTarget,d=a&&u.contains(a);e.trapped||i&&u.contains(i)||(o=i),d&&t("focusin",n),!v.paused&&e.trapped&&(d?c=a:E(c,!0))},N=n=>{const u=r.unref(s);if(!(v.paused||!u))if(e.trapped){const a=n.relatedTarget;!f.isNil(a)&&!u.contains(a)&&setTimeout(()=>{if(!v.paused&&e.trapped){const i=y({focusReason:l.value});t("focusout-prevented",i),i.defaultPrevented||E(c,!0)}},0)}else{const a=n.target;a&&u.contains(a)||t("focusout",n)}};async function D(){await r.nextTick();const n=r.unref(s);if(n){G.push(v);const u=n.contains(document.activeElement)?o:document.activeElement;if(o=u,!n.contains(u)){const i=new Event(w,H);n.addEventListener(w,R),n.dispatchEvent(i),i.defaultPrevented||r.nextTick(()=>{let d=e.focusStartEl;f.isString(d)||(E(d),document.activeElement!==d&&(d="first")),d==="first"&&le(X(n),!0),(document.activeElement===u||d==="container")&&E(n)})}}}function V(){const n=r.unref(s);if(n){n.removeEventListener(w,R);const u=new CustomEvent(L,{...H,detail:{focusReason:l.value}});n.addEventListener(L,k),n.dispatchEvent(u),!u.defaultPrevented&&(l.value=="keyboard"||!Ee()||n.contains(document.activeElement))&&E(o??document.body),n.removeEventListener(L,k),G.remove(v)}}return r.onMounted(()=>{e.trapped&&D(),r.watch(()=>e.trapped,n=>{n?D():V()})}),r.onBeforeUnmount(()=>{e.trapped&&V(),s.value&&(s.value.removeEventListener("keydown",b),s.value.removeEventListener("focusin",h),s.value.removeEventListener("focusout",N),s.value=void 0)}),{onKeydown:b}}});function be(e,t,s,o,c,l){return r.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var me=f._export_sfc(Te,[["render",be],["__file","focus-trap.vue"]]);const _e=f.buildProps({to:{type:f.definePropType([String,Object]),required:!0},disabled:Boolean}),Fe=r.defineComponent({__name:"teleport",props:_e,setup(e){return(t,s)=>t.disabled?r.renderSlot(t.$slots,"default",{key:0}):(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:t.to},[r.renderSlot(t.$slots,"default")],8,["to"]))}});var ye=f._export_sfc(Fe,[["__file","teleport.vue"]]);const Pe=f.withInstall(ye);exports.CHANGE_EVENT=ee;exports.EVENT_CODE=I;exports.ElFocusTrap=me;exports.ElTeleport=Pe;exports.FOCUS_TRAP_INJECTION_KEY=Y;exports.INPUT_EVENT=te;exports.UPDATE_MODEL_EVENT=Z;exports.isFocusable=C;exports.isUndefined=Q;exports.obtainAllFocusableElements=se;exports.triggerEvent=re;exports.tryFocus=E;
|