st-comp 0.0.115 → 0.0.116
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/auto-imports.d.ts +1 -0
- package/components.d.ts +1 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +11 -11
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +1070 -272
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +13 -13
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +30 -30
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +31 -31
- package/es/User.cjs +1 -1
- package/es/User.js +84 -84
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1116 -936
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +56 -56
- package/es/base-ec05f348.cjs +9 -0
- package/es/{base-a3fcf99a.js → base-f7877059.js} +345 -328
- package/es/{castArray-0e8e51f9.js → castArray-18f43497.js} +1 -1
- package/es/{castArray-e6cd255c.cjs → castArray-a45823fe.cjs} +1 -1
- package/es/{config-provider-e4ebacca.js → config-provider-6479d795.js} +6 -6
- package/es/{config-provider-957c280a.cjs → config-provider-7cdfca4d.cjs} +1 -1
- package/es/{debounce-7f3a3471.js → debounce-2336e546.js} +14 -14
- package/es/{debounce-3ad03224.cjs → debounce-b2ff12bd.cjs} +1 -1
- package/es/{dropdown-c505d260.js → dropdown-46daf582.js} +4 -4
- package/es/{dropdown-e73864c0.cjs → dropdown-9a974876.cjs} +1 -1
- package/es/{el-button-e389429d.cjs → el-button-196807af.cjs} +1 -1
- package/es/{el-button-fe99fee6.js → el-button-802f579a.js} +6 -6
- package/es/{el-empty-848e4e08.cjs → el-empty-19ea04f4.cjs} +1 -1
- package/es/{el-empty-a338aa98.js → el-empty-3c5ec277.js} +5 -5
- package/es/el-form-item-84099d46.js +1599 -0
- package/es/el-form-item-c39f717e.cjs +12 -0
- package/es/{el-input-65ed0dba.cjs → el-input-6c6f5bda.cjs} +1 -1
- package/es/{el-input-35c8ebc3.js → el-input-fac5b401.js} +39 -39
- package/es/{el-overlay-851ea246.js → el-overlay-69e9ae49.js} +105 -101
- package/es/el-overlay-891dcc40.cjs +1 -0
- package/es/{el-popover-246eb710.js → el-popover-694ded47.js} +22 -22
- package/es/{el-popover-b0deb095.cjs → el-popover-8735b1fa.cjs} +1 -1
- package/es/{el-popper-e052fb84.js → el-popper-6126b1f6.js} +91 -91
- package/es/{el-popper-4da22fdc.cjs → el-popper-f62316cd.cjs} +1 -1
- package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
- package/es/el-scrollbar-e0493906.js +201 -0
- package/es/el-select-513126a5.js +1128 -0
- package/es/el-select-928f8c19.cjs +1 -0
- package/es/{el-table-column-661deade.js → el-table-column-3c920bdd.js} +69 -69
- package/es/{el-table-column-d636a7d6.cjs → el-table-column-dd8b62aa.cjs} +1 -1
- package/es/{el-tag-a45bdd1e.cjs → el-tag-3b03d13e.cjs} +1 -1
- package/es/{el-tag-7601f7e6.js → el-tag-5becabc9.js} +74 -74
- package/es/index-048dca7e.js +303 -0
- package/es/{index-28cd5fde.js → index-35117549.js} +25 -25
- package/es/{index-fc652f21.js → index-57f8f7b9.js} +15 -1
- package/es/index-7e40be25.js +167 -0
- package/es/index-80a2b137.cjs +1 -0
- package/es/{index-35665af5.cjs → index-8a0b1c53.cjs} +1 -1
- package/es/{index-25aca205.cjs → index-dc273ea2.cjs} +1 -1
- package/es/index-e1e83173.cjs +1 -0
- package/es/{raf-a97e05a3.js → raf-07da7cdf.js} +1 -1
- package/es/{raf-da075499.cjs → raf-8fc301fd.cjs} +1 -1
- package/es/{refs-f0ee592c.js → refs-1b1fe6ca.js} +1 -1
- package/es/{refs-34a69f8c.cjs → refs-d00b710b.cjs} +1 -1
- package/es/{scroll-1e0c8fab.js → scroll-3b521d81.js} +1 -1
- package/es/{scroll-c7ef9180.cjs → scroll-41224831.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-96d2ea48.cjs → use-form-common-props-1b84d8f4.cjs} +1 -1
- package/es/{use-form-common-props-d0739feb.js → use-form-common-props-f3a520d0.js} +53 -53
- package/es/{vnode-8f40662d.js → vnode-25d7c2f5.js} +1 -1
- package/es/{vnode-562e063c.cjs → vnode-7fbc61e1.cjs} +1 -1
- package/es/{zh-cn-0ab4aa73.js → zh-cn-74781bbd.js} +2 -2
- package/es/{zh-cn-bf58db71.cjs → zh-cn-ab9a583d.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +192 -192
- package/lib/{index-a981dd97.js → index-c6ba3bcd.js} +30058 -29227
- package/lib/{python-72fd599d.js → python-49e22e65.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/FactorWarning/index.vue +296 -97
- package/packages/FactorWarning/tools.js +10 -0
- package/src/pages/FactorWarning/index.vue +69 -25
- package/es/base-adc4e34e.cjs +0 -9
- package/es/el-overlay-84e3cb6c.cjs +0 -1
- package/es/el-radio-button-12b07ac2.js +0 -1782
- package/es/el-radio-button-5259a46b.cjs +0 -12
- package/es/el-scrollbar-8cb3663b.cjs +0 -1
- package/es/el-scrollbar-c23060d5.js +0 -193
- package/es/el-select-4987a187.cjs +0 -1
- package/es/el-select-d1a33fbe.js +0 -1233
- package/es/index-4090cb2c.cjs +0 -1
- package/es/index-af687c16.js +0 -302
- package/es/index-b4bbc58d.js +0 -59
- package/es/index-f14354e6.cjs +0 -1
package/es/index-4090cb2c.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("vue"),d=require("./el-scrollbar-8cb3663b.cjs"),m=require("./base-adc4e34e.cjs");function h(s,{beforeFocus:t,afterFocus:o,beforeBlur:v,afterBlur:a}={}){const f=l.getCurrentInstance(),{emit:p}=f,e=l.shallowRef(),u=l.ref(!1),i=n=>{m.isFunction(t)&&t(n)||u.value||(u.value=!0,p("focus",n),o==null||o())},r=n=>{var c;m.isFunction(v)&&v(n)||n.relatedTarget&&((c=e.value)!=null&&c.contains(n.relatedTarget))||(u.value=!1,p("blur",n),a==null||a())},C=()=>{var n,c;(n=e.value)!=null&&n.contains(document.activeElement)&&e.value!==document.activeElement||(c=s.value)==null||c.focus()};return l.watch(e,n=>{n&&n.setAttribute("tabindex","-1")}),d.useEventListener(e,"focus",i,!0),d.useEventListener(e,"blur",r,!0),d.useEventListener(e,"click",C,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const n=m.isElement(s.value)?s.value:document.querySelector("input,textarea");n&&(d.useEventListener(n,"focus",i,!0),d.useEventListener(n,"blur",r,!0))}),{isFocused:u,wrapperRef:e,handleFocus:i,handleBlur:r}}const E=s=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(s);function F({afterComposition:s,emit:t}){const o=l.ref(!1),v=e=>{t==null||t("compositionstart",e),o.value=!0},a=e=>{var u;t==null||t("compositionupdate",e);const i=(u=e.target)==null?void 0:u.value,r=i[i.length-1]||"";o.value=!E(r)},f=e=>{t==null||t("compositionend",e),o.value&&(o.value=!1,l.nextTick(()=>s(e)))};return{isComposing:o,handleComposition:e=>{e.type==="compositionend"?f(e):a(e)},handleCompositionStart:v,handleCompositionUpdate:a,handleCompositionEnd:f}}exports.useComposition=F;exports.useFocusController=h;
|
package/es/index-af687c16.js
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { ref as y, onMounted as k, onBeforeUnmount as R, defineComponent as ee, provide as re, watch as A, unref as b, nextTick as M, renderSlot as N, openBlock as ae, createBlock as ce, Teleport as ue } from "vue";
|
|
2
|
-
import { A as q, q as j, f as ie, _ as te, i as de, b as fe, d as le, w as ve } from "./base-a3fcf99a.js";
|
|
3
|
-
function Ie(e) {
|
|
4
|
-
return e === void 0;
|
|
5
|
-
}
|
|
6
|
-
const pe = (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
|
-
}, Ue = function(e, n, ...o) {
|
|
24
|
-
let s;
|
|
25
|
-
n.includes("mouse") || n.includes("click") ? s = "MouseEvents" : n.includes("key") ? s = "KeyboardEvent" : s = "HTMLEvents";
|
|
26
|
-
const a = document.createEvent(s);
|
|
27
|
-
return a.initEvent(n, ...o), e.dispatchEvent(a), e;
|
|
28
|
-
}, C = "focus-trap.focus-after-trapped", O = "focus-trap.focus-after-released", Ee = "focus-trap.focusout-prevented", W = {
|
|
29
|
-
cancelable: !0,
|
|
30
|
-
bubbles: !1
|
|
31
|
-
}, Te = {
|
|
32
|
-
cancelable: !0,
|
|
33
|
-
bubbles: !1
|
|
34
|
-
}, J = "focusAfterTrapped", X = "focusAfterReleased", be = Symbol("elFocusTrap"), I = y(), w = y(0), U = y(0);
|
|
35
|
-
let m = 0;
|
|
36
|
-
const ne = (e) => {
|
|
37
|
-
const n = [], 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
|
-
n.push(o.currentNode);
|
|
45
|
-
return n;
|
|
46
|
-
}, Y = (e, n) => {
|
|
47
|
-
for (const o of e)
|
|
48
|
-
if (!me(o, n))
|
|
49
|
-
return o;
|
|
50
|
-
}, me = (e, n) => {
|
|
51
|
-
if (process.env.NODE_ENV === "test")
|
|
52
|
-
return !1;
|
|
53
|
-
if (getComputedStyle(e).visibility === "hidden")
|
|
54
|
-
return !0;
|
|
55
|
-
for (; e; ) {
|
|
56
|
-
if (n && e === n)
|
|
57
|
-
return !1;
|
|
58
|
-
if (getComputedStyle(e).display === "none")
|
|
59
|
-
return !0;
|
|
60
|
-
e = e.parentElement;
|
|
61
|
-
}
|
|
62
|
-
return !1;
|
|
63
|
-
}, Fe = (e) => {
|
|
64
|
-
const n = ne(e), o = Y(n, e), s = Y(n.reverse(), e);
|
|
65
|
-
return [o, s];
|
|
66
|
-
}, _e = (e) => e instanceof HTMLInputElement && "select" in e, l = (e, n) => {
|
|
67
|
-
if (e && e.focus) {
|
|
68
|
-
const o = document.activeElement;
|
|
69
|
-
let s = !1;
|
|
70
|
-
q(e) && !pe(e) && !e.getAttribute("tabindex") && (e.setAttribute("tabindex", "-1"), s = !0), e.focus({ preventScroll: !0 }), U.value = window.performance.now(), e !== o && _e(e) && n && e.select(), q(e) && s && e.removeAttribute("tabindex");
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
function z(e, n) {
|
|
74
|
-
const o = [...e], s = e.indexOf(n);
|
|
75
|
-
return s !== -1 && o.splice(s, 1), o;
|
|
76
|
-
}
|
|
77
|
-
const ye = () => {
|
|
78
|
-
let e = [];
|
|
79
|
-
return {
|
|
80
|
-
push: (s) => {
|
|
81
|
-
const a = e[0];
|
|
82
|
-
a && s !== a && a.pause(), e = z(e, s), e.unshift(s);
|
|
83
|
-
},
|
|
84
|
-
remove: (s) => {
|
|
85
|
-
var a, d;
|
|
86
|
-
e = z(e, s), (d = (a = e[0]) == null ? void 0 : a.resume) == null || d.call(a);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}, we = (e, n = !1) => {
|
|
90
|
-
const o = document.activeElement;
|
|
91
|
-
for (const s of e)
|
|
92
|
-
if (l(s, n), document.activeElement !== o)
|
|
93
|
-
return;
|
|
94
|
-
}, G = ye(), Pe = () => w.value > U.value, F = () => {
|
|
95
|
-
I.value = "pointer", w.value = window.performance.now();
|
|
96
|
-
}, Q = () => {
|
|
97
|
-
I.value = "keyboard", w.value = window.performance.now();
|
|
98
|
-
}, ge = () => (k(() => {
|
|
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: I,
|
|
104
|
-
lastUserFocusTimestamp: w,
|
|
105
|
-
lastAutomatedFocusTimestamp: U
|
|
106
|
-
}), _ = (e) => new CustomEvent(Ee, {
|
|
107
|
-
...Te,
|
|
108
|
-
detail: e
|
|
109
|
-
}), se = {
|
|
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 p = [];
|
|
127
|
-
const Z = (e) => {
|
|
128
|
-
e.code === se.esc && p.forEach((n) => n(e));
|
|
129
|
-
}, he = (e) => {
|
|
130
|
-
k(() => {
|
|
131
|
-
p.length === 0 && document.addEventListener("keydown", Z), j && p.push(e);
|
|
132
|
-
}), R(() => {
|
|
133
|
-
p = p.filter((n) => n !== e), p.length === 0 && j && document.removeEventListener("keydown", Z);
|
|
134
|
-
});
|
|
135
|
-
}, Le = 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
|
-
J,
|
|
149
|
-
X,
|
|
150
|
-
"focusin",
|
|
151
|
-
"focusout",
|
|
152
|
-
"focusout-prevented",
|
|
153
|
-
"release-requested"
|
|
154
|
-
],
|
|
155
|
-
setup(e, { emit: n }) {
|
|
156
|
-
const o = y();
|
|
157
|
-
let s, a;
|
|
158
|
-
const { focusReason: d } = ge();
|
|
159
|
-
he((t) => {
|
|
160
|
-
e.trapped && !v.paused && n("release-requested", t);
|
|
161
|
-
});
|
|
162
|
-
const v = {
|
|
163
|
-
paused: !1,
|
|
164
|
-
pause() {
|
|
165
|
-
this.paused = !0;
|
|
166
|
-
},
|
|
167
|
-
resume() {
|
|
168
|
-
this.paused = !1;
|
|
169
|
-
}
|
|
170
|
-
}, E = (t) => {
|
|
171
|
-
if (!e.loop && !e.trapped || v.paused)
|
|
172
|
-
return;
|
|
173
|
-
const { code: r, altKey: c, ctrlKey: u, metaKey: i, currentTarget: $, shiftKey: H } = t, { loop: V } = e, oe = r === se.tab && !c && !u && !i, T = document.activeElement;
|
|
174
|
-
if (oe && T) {
|
|
175
|
-
const h = $, [L, S] = Fe(h);
|
|
176
|
-
if (L && S) {
|
|
177
|
-
if (!H && T === S) {
|
|
178
|
-
const f = _({
|
|
179
|
-
focusReason: d.value
|
|
180
|
-
});
|
|
181
|
-
n("focusout-prevented", f), f.defaultPrevented || (t.preventDefault(), V && l(L, !0));
|
|
182
|
-
} else if (H && [L, h].includes(T)) {
|
|
183
|
-
const f = _({
|
|
184
|
-
focusReason: d.value
|
|
185
|
-
});
|
|
186
|
-
n("focusout-prevented", f), f.defaultPrevented || (t.preventDefault(), V && l(S, !0));
|
|
187
|
-
}
|
|
188
|
-
} else if (T === h) {
|
|
189
|
-
const f = _({
|
|
190
|
-
focusReason: d.value
|
|
191
|
-
});
|
|
192
|
-
n("focusout-prevented", f), f.defaultPrevented || t.preventDefault();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
re(be, {
|
|
197
|
-
focusTrapRef: o,
|
|
198
|
-
onKeydown: E
|
|
199
|
-
}), A(() => e.focusTrapEl, (t) => {
|
|
200
|
-
t && (o.value = t);
|
|
201
|
-
}, { immediate: !0 }), A([o], ([t], [r]) => {
|
|
202
|
-
t && (t.addEventListener("keydown", E), t.addEventListener("focusin", P), t.addEventListener("focusout", g)), r && (r.removeEventListener("keydown", E), r.removeEventListener("focusin", P), r.removeEventListener("focusout", g));
|
|
203
|
-
});
|
|
204
|
-
const D = (t) => {
|
|
205
|
-
n(J, t);
|
|
206
|
-
}, K = (t) => n(X, t), P = (t) => {
|
|
207
|
-
const r = b(o);
|
|
208
|
-
if (!r)
|
|
209
|
-
return;
|
|
210
|
-
const c = t.target, u = t.relatedTarget, i = c && r.contains(c);
|
|
211
|
-
e.trapped || u && r.contains(u) || (s = u), i && n("focusin", t), !v.paused && e.trapped && (i ? a = c : l(a, !0));
|
|
212
|
-
}, g = (t) => {
|
|
213
|
-
const r = b(o);
|
|
214
|
-
if (!(v.paused || !r))
|
|
215
|
-
if (e.trapped) {
|
|
216
|
-
const c = t.relatedTarget;
|
|
217
|
-
!ie(c) && !r.contains(c) && setTimeout(() => {
|
|
218
|
-
if (!v.paused && e.trapped) {
|
|
219
|
-
const u = _({
|
|
220
|
-
focusReason: d.value
|
|
221
|
-
});
|
|
222
|
-
n("focusout-prevented", u), u.defaultPrevented || l(a, !0);
|
|
223
|
-
}
|
|
224
|
-
}, 0);
|
|
225
|
-
} else {
|
|
226
|
-
const c = t.target;
|
|
227
|
-
c && r.contains(c) || n("focusout", t);
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
async function x() {
|
|
231
|
-
await M();
|
|
232
|
-
const t = b(o);
|
|
233
|
-
if (t) {
|
|
234
|
-
G.push(v);
|
|
235
|
-
const r = t.contains(document.activeElement) ? s : document.activeElement;
|
|
236
|
-
if (s = r, !t.contains(r)) {
|
|
237
|
-
const u = new Event(C, W);
|
|
238
|
-
t.addEventListener(C, D), t.dispatchEvent(u), u.defaultPrevented || M(() => {
|
|
239
|
-
let i = e.focusStartEl;
|
|
240
|
-
de(i) || (l(i), document.activeElement !== i && (i = "first")), i === "first" && we(ne(t), !0), (document.activeElement === r || i === "container") && l(t);
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function B() {
|
|
246
|
-
const t = b(o);
|
|
247
|
-
if (t) {
|
|
248
|
-
t.removeEventListener(C, D);
|
|
249
|
-
const r = new CustomEvent(O, {
|
|
250
|
-
...W,
|
|
251
|
-
detail: {
|
|
252
|
-
focusReason: d.value
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
t.addEventListener(O, K), t.dispatchEvent(r), !r.defaultPrevented && (d.value == "keyboard" || !Pe() || t.contains(document.activeElement)) && l(s ?? document.body), t.removeEventListener(O, K), G.remove(v);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return k(() => {
|
|
259
|
-
e.trapped && x(), A(() => e.trapped, (t) => {
|
|
260
|
-
t ? x() : B();
|
|
261
|
-
});
|
|
262
|
-
}), R(() => {
|
|
263
|
-
e.trapped && B(), o.value && (o.value.removeEventListener("keydown", E), o.value.removeEventListener("focusin", P), o.value.removeEventListener("focusout", g), o.value = void 0);
|
|
264
|
-
}), {
|
|
265
|
-
onKeydown: E
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
function Se(e, n, o, s, a, d) {
|
|
270
|
-
return N(e.$slots, "default", { handleKeydown: e.onKeydown });
|
|
271
|
-
}
|
|
272
|
-
var De = /* @__PURE__ */ te(Le, [["render", Se], ["__file", "focus-trap.vue"]]);
|
|
273
|
-
const Ae = fe({
|
|
274
|
-
to: {
|
|
275
|
-
type: le([String, Object]),
|
|
276
|
-
required: !0
|
|
277
|
-
},
|
|
278
|
-
disabled: Boolean
|
|
279
|
-
}), Ce = /* @__PURE__ */ ee({
|
|
280
|
-
__name: "teleport",
|
|
281
|
-
props: Ae,
|
|
282
|
-
setup(e) {
|
|
283
|
-
return (n, o) => n.disabled ? N(n.$slots, "default", { key: 0 }) : (ae(), ce(ue, {
|
|
284
|
-
key: 1,
|
|
285
|
-
to: n.to
|
|
286
|
-
}, [
|
|
287
|
-
N(n.$slots, "default")
|
|
288
|
-
], 8, ["to"]));
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
var Oe = /* @__PURE__ */ te(Ce, [["__file", "teleport.vue"]]);
|
|
292
|
-
const Ke = ve(Oe);
|
|
293
|
-
export {
|
|
294
|
-
se as E,
|
|
295
|
-
be as F,
|
|
296
|
-
Ke as a,
|
|
297
|
-
De as b,
|
|
298
|
-
pe as c,
|
|
299
|
-
l as d,
|
|
300
|
-
Ie as i,
|
|
301
|
-
Ue as t
|
|
302
|
-
};
|
package/es/index-b4bbc58d.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as C, shallowRef as E, ref as m, watch as g, onMounted as F, nextTick as x } from "vue";
|
|
2
|
-
import { a as r } from "./el-scrollbar-c23060d5.js";
|
|
3
|
-
import { A as _, z as f } from "./base-a3fcf99a.js";
|
|
4
|
-
function y(l, {
|
|
5
|
-
beforeFocus: t,
|
|
6
|
-
afterFocus: e,
|
|
7
|
-
beforeBlur: d,
|
|
8
|
-
afterBlur: c
|
|
9
|
-
} = {}) {
|
|
10
|
-
const p = C(), { emit: v } = p, o = E(), s = m(!1), a = (n) => {
|
|
11
|
-
f(t) && t(n) || s.value || (s.value = !0, v("focus", n), e == null || e());
|
|
12
|
-
}, i = (n) => {
|
|
13
|
-
var u;
|
|
14
|
-
f(d) && d(n) || n.relatedTarget && ((u = o.value) != null && u.contains(n.relatedTarget)) || (s.value = !1, v("blur", n), c == null || c());
|
|
15
|
-
}, h = () => {
|
|
16
|
-
var n, u;
|
|
17
|
-
(n = o.value) != null && n.contains(document.activeElement) && o.value !== document.activeElement || (u = l.value) == null || u.focus();
|
|
18
|
-
};
|
|
19
|
-
return g(o, (n) => {
|
|
20
|
-
n && n.setAttribute("tabindex", "-1");
|
|
21
|
-
}), r(o, "focus", a, !0), r(o, "blur", i, !0), r(o, "click", h, !0), process.env.NODE_ENV === "test" && F(() => {
|
|
22
|
-
const n = _(l.value) ? l.value : document.querySelector("input,textarea");
|
|
23
|
-
n && (r(n, "focus", a, !0), r(n, "blur", i, !0));
|
|
24
|
-
}), {
|
|
25
|
-
isFocused: s,
|
|
26
|
-
wrapperRef: o,
|
|
27
|
-
handleFocus: a,
|
|
28
|
-
handleBlur: i
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const b = (l) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(l);
|
|
32
|
-
function D({
|
|
33
|
-
afterComposition: l,
|
|
34
|
-
emit: t
|
|
35
|
-
}) {
|
|
36
|
-
const e = m(!1), d = (o) => {
|
|
37
|
-
t == null || t("compositionstart", o), e.value = !0;
|
|
38
|
-
}, c = (o) => {
|
|
39
|
-
var s;
|
|
40
|
-
t == null || t("compositionupdate", o);
|
|
41
|
-
const a = (s = o.target) == null ? void 0 : s.value, i = a[a.length - 1] || "";
|
|
42
|
-
e.value = !b(i);
|
|
43
|
-
}, p = (o) => {
|
|
44
|
-
t == null || t("compositionend", o), e.value && (e.value = !1, x(() => l(o)));
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
isComposing: e,
|
|
48
|
-
handleComposition: (o) => {
|
|
49
|
-
o.type === "compositionend" ? p(o) : c(o);
|
|
50
|
-
},
|
|
51
|
-
handleCompositionStart: d,
|
|
52
|
-
handleCompositionUpdate: c,
|
|
53
|
-
handleCompositionEnd: p
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export {
|
|
57
|
-
D as a,
|
|
58
|
-
y as u
|
|
59
|
-
};
|
package/es/index-f14354e6.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("vue"),f=require("./base-adc4e34e.cjs");function Q(e){return e===void 0}const Y=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}},Z=function(e,n,...s){let o;n.includes("mouse")||n.includes("click")?o="MouseEvents":n.includes("key")?o="KeyboardEvent":o="HTMLEvents";const u=document.createEvent(o);return u.initEvent(n,...s),e.dispatchEvent(u),e},C="focus-trap.focus-after-trapped",A="focus-trap.focus-after-released",ee="focus-trap.focusout-prevented",H={cancelable:!0,bubbles:!1},te={cancelable:!0,bubbles:!1},V="focusAfterTrapped",$="focusAfterReleased",X=Symbol("elFocusTrap"),O=r.ref(),w=r.ref(0),N=r.ref(0);let F=0;const z=e=>{const n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const u=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||u?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n},M=(e,n)=>{for(const s of e)if(!ne(s,n))return s},ne=(e,n)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},oe=e=>{const n=z(e),s=M(n,e),o=M(n.reverse(),e);return[s,o]},se=e=>e instanceof HTMLInputElement&&"select"in e,v=(e,n)=>{if(e&&e.focus){const s=document.activeElement;let o=!1;f.isElement(e)&&!Y(e)&&!e.getAttribute("tabindex")&&(e.setAttribute("tabindex","-1"),o=!0),e.focus({preventScroll:!0}),N.value=window.performance.now(),e!==s&&se(e)&&n&&e.select(),f.isElement(e)&&o&&e.removeAttribute("tabindex")}};function q(e,n){const s=[...e],o=e.indexOf(n);return o!==-1&&s.splice(o,1),s}const re=()=>{let e=[];return{push:o=>{const u=e[0];u&&o!==u&&u.pause(),e=q(e,o),e.unshift(o)},remove:o=>{var u,l;e=q(e,o),(l=(u=e[0])==null?void 0:u.resume)==null||l.call(u)}}},ce=(e,n=!1)=>{const s=document.activeElement;for(const o of e)if(v(o,n),document.activeElement!==s)return},j=re(),ue=()=>w.value>N.value,_=()=>{O.value="pointer",w.value=window.performance.now()},J=()=>{O.value="keyboard",w.value=window.performance.now()},ae=()=>(r.onMounted(()=>{F===0&&(document.addEventListener("mousedown",_),document.addEventListener("touchstart",_),document.addEventListener("keydown",J)),F++}),r.onBeforeUnmount(()=>{F--,F<=0&&(document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",J))}),{focusReason:O,lastUserFocusTimestamp:w,lastAutomatedFocusTimestamp:N}),y=e=>new CustomEvent(ee,{...te,detail:e}),k={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===k.esc&&T.forEach(n=>n(e))},ie=e=>{r.onMounted(()=>{T.length===0&&document.addEventListener("keydown",W),f.isClient&&T.push(e)}),r.onBeforeUnmount(()=>{T=T.filter(n=>n!==e),T.length===0&&f.isClient&&document.removeEventListener("keydown",W)})},de=r.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[V,$,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:n}){const s=r.ref();let o,u;const{focusReason:l}=ae();ie(t=>{e.trapped&&!E.paused&&n("release-requested",t)});const E={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},b=t=>{if(!e.loop&&!e.trapped||E.paused)return;const{code:c,altKey:a,ctrlKey:i,metaKey:d,currentTarget:K,shiftKey:B}=t,{loop:x}=e,G=c===k.tab&&!a&&!i&&!d,m=document.activeElement;if(G&&m){const P=K,[S,L]=oe(P);if(S&&L){if(!B&&m===L){const p=y({focusReason:l.value});n("focusout-prevented",p),p.defaultPrevented||(t.preventDefault(),x&&v(S,!0))}else if(B&&[S,P].includes(m)){const p=y({focusReason:l.value});n("focusout-prevented",p),p.defaultPrevented||(t.preventDefault(),x&&v(L,!0))}}else if(m===P){const p=y({focusReason:l.value});n("focusout-prevented",p),p.defaultPrevented||t.preventDefault()}}};r.provide(X,{focusTrapRef:s,onKeydown:b}),r.watch(()=>e.focusTrapEl,t=>{t&&(s.value=t)},{immediate:!0}),r.watch([s],([t],[c])=>{t&&(t.addEventListener("keydown",b),t.addEventListener("focusin",g),t.addEventListener("focusout",h)),c&&(c.removeEventListener("keydown",b),c.removeEventListener("focusin",g),c.removeEventListener("focusout",h))});const I=t=>{n(V,t)},R=t=>n($,t),g=t=>{const c=r.unref(s);if(!c)return;const a=t.target,i=t.relatedTarget,d=a&&c.contains(a);e.trapped||i&&c.contains(i)||(o=i),d&&n("focusin",t),!E.paused&&e.trapped&&(d?u=a:v(u,!0))},h=t=>{const c=r.unref(s);if(!(E.paused||!c))if(e.trapped){const a=t.relatedTarget;!f.isNil(a)&&!c.contains(a)&&setTimeout(()=>{if(!E.paused&&e.trapped){const i=y({focusReason:l.value});n("focusout-prevented",i),i.defaultPrevented||v(u,!0)}},0)}else{const a=t.target;a&&c.contains(a)||n("focusout",t)}};async function U(){await r.nextTick();const t=r.unref(s);if(t){j.push(E);const c=t.contains(document.activeElement)?o:document.activeElement;if(o=c,!t.contains(c)){const i=new Event(C,H);t.addEventListener(C,I),t.dispatchEvent(i),i.defaultPrevented||r.nextTick(()=>{let d=e.focusStartEl;f.isString(d)||(v(d),document.activeElement!==d&&(d="first")),d==="first"&&ce(z(t),!0),(document.activeElement===c||d==="container")&&v(t)})}}}function D(){const t=r.unref(s);if(t){t.removeEventListener(C,I);const c=new CustomEvent(A,{...H,detail:{focusReason:l.value}});t.addEventListener(A,R),t.dispatchEvent(c),!c.defaultPrevented&&(l.value=="keyboard"||!ue()||t.contains(document.activeElement))&&v(o??document.body),t.removeEventListener(A,R),j.remove(E)}}return r.onMounted(()=>{e.trapped&&U(),r.watch(()=>e.trapped,t=>{t?U():D()})}),r.onBeforeUnmount(()=>{e.trapped&&D(),s.value&&(s.value.removeEventListener("keydown",b),s.value.removeEventListener("focusin",g),s.value.removeEventListener("focusout",h),s.value=void 0)}),{onKeydown:b}}});function fe(e,n,s,o,u,l){return r.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var le=f._export_sfc(de,[["render",fe],["__file","focus-trap.vue"]]);const ve=f.buildProps({to:{type:f.definePropType([String,Object]),required:!0},disabled:Boolean}),pe=r.defineComponent({__name:"teleport",props:ve,setup(e){return(n,s)=>n.disabled?r.renderSlot(n.$slots,"default",{key:0}):(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:n.to},[r.renderSlot(n.$slots,"default")],8,["to"]))}});var Ee=f._export_sfc(pe,[["__file","teleport.vue"]]);const Te=f.withInstall(Ee);exports.EVENT_CODE=k;exports.ElFocusTrap=le;exports.ElTeleport=Te;exports.FOCUS_TRAP_INJECTION_KEY=X;exports.isFocusable=Y;exports.isUndefined=Q;exports.triggerEvent=Z;exports.tryFocus=v;
|