st-comp 0.0.148 → 0.0.149

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.
Files changed (130) hide show
  1. package/components.d.ts +3 -0
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +2 -2
  4. package/es/Dialog.cjs +1 -1
  5. package/es/Dialog.js +16 -14
  6. package/es/FactorWarning.cjs +1 -1
  7. package/es/FactorWarning.js +576 -632
  8. package/es/Kline.cjs +1 -0
  9. package/es/Kline.js +1901 -0
  10. package/es/KlineBasic.cjs +1 -1
  11. package/es/KlineBasic.js +675 -1428
  12. package/es/KlineNew.cjs +1 -3
  13. package/es/KlineNew.js +314 -2740
  14. package/es/Pagination.cjs +1 -1
  15. package/es/Pagination.js +85 -85
  16. package/es/Table.cjs +1 -1
  17. package/es/Table.js +57 -55
  18. package/es/User.cjs +1 -1
  19. package/es/User.js +89 -87
  20. package/es/VarietySearch.cjs +1 -1
  21. package/es/VarietySearch.js +2393 -1
  22. package/es/VirtualTable.cjs +5 -5
  23. package/es/VirtualTable.js +59 -58
  24. package/es/{_initCloneObject-ec5c9523.js → _initCloneObject-14b53c6f.js} +24 -24
  25. package/es/_initCloneObject-441db749.cjs +1 -0
  26. package/es/{base-950bac7e.js → base-437d17f3.js} +65 -65
  27. package/es/{base-6ccc8fc2.cjs → base-ec05f348.cjs} +1 -1
  28. package/es/{castArray-c770910d.js → castArray-4251bbe4.js} +1 -1
  29. package/es/castArray-a45823fe.cjs +1 -0
  30. package/es/{config-provider-feed0e8a.js → config-provider-55482a43.js} +3 -3
  31. package/es/{config-provider-c87e277f.cjs → config-provider-7cdfca4d.cjs} +1 -1
  32. package/es/{debounce-c64fb3b5.js → debounce-ac30be50.js} +20 -20
  33. package/es/debounce-b2ff12bd.cjs +1 -0
  34. package/es/{dropdown-c9272ca3.js → dropdown-634b5e27.js} +4 -4
  35. package/es/{dropdown-6bdb3cf4.cjs → dropdown-d7c59a21.cjs} +1 -1
  36. package/es/el-button-196807af.cjs +1 -0
  37. package/es/el-button-e1665717.js +235 -0
  38. package/es/el-checkbox-group-492b95cc.cjs +1 -0
  39. package/es/el-checkbox-group-e8fece80.js +67 -0
  40. package/es/{el-empty-12eece57.cjs → el-empty-19ea04f4.cjs} +1 -1
  41. package/es/{el-empty-89a523ed.js → el-empty-bacc6613.js} +1 -1
  42. package/es/{el-form-item-ebbf096d.cjs → el-form-item-5bdffd07.cjs} +2 -2
  43. package/es/{el-form-item-55d36086.js → el-form-item-af1855f0.js} +81 -81
  44. package/es/el-input-23e2bac3.cjs +1 -0
  45. package/es/{el-input-cb528574.js → el-input-4961b99f.js} +80 -80
  46. package/es/el-input-number-40a81eb5.cjs +1 -0
  47. package/es/{el-input-number-ce30bfa8.js → el-input-number-610fc8ba.js} +26 -26
  48. package/es/el-menu-item-78b858f2.cjs +1 -0
  49. package/es/el-menu-item-7d04c11a.js +771 -0
  50. package/es/{el-message-d51d032b.js → el-message-c3b3ac96.js} +18 -18
  51. package/es/{el-message-612c2346.cjs → el-message-d4df8136.cjs} +1 -1
  52. package/es/el-overlay-12dd9b35.js +519 -0
  53. package/es/el-overlay-bc0790a2.cjs +1 -0
  54. package/es/el-popover-0aa071f2.js +138 -0
  55. package/es/el-popover-8a77e015.cjs +1 -0
  56. package/es/{el-popper-f4b01f85.js → el-popper-50100766.js} +31 -31
  57. package/es/el-popper-746070ba.cjs +1 -0
  58. package/es/{el-scrollbar-e8e93751.js → el-scrollbar-562d0595.js} +19 -19
  59. package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
  60. package/es/{el-select-e71af2e6.js → el-select-9381b156.js} +11 -11
  61. package/es/el-select-b162dffc.cjs +1 -0
  62. package/es/el-table-column-55bffba5.js +3802 -0
  63. package/es/el-table-column-6d761fce.cjs +14 -0
  64. package/es/{el-tag-d65768f4.js → el-tag-985d9aff.js} +72 -72
  65. package/es/el-tag-c51a6490.cjs +1 -0
  66. package/es/index-09e01b1d.js +81 -0
  67. package/es/{index-121e2861.js → index-0cb48e01.js} +3 -3
  68. package/es/{index-92ba4292.js → index-39ec9741.js} +17 -17
  69. package/es/{index-18416440.cjs → index-3bf8d597.cjs} +1 -1
  70. package/es/index-657047bb.js +513 -0
  71. package/es/{index-0ed86daf.cjs → index-8a0b1c53.cjs} +1 -1
  72. package/es/{index-674d2fd7.cjs → index-a387515d.cjs} +1 -1
  73. package/es/{index-709675d5.js → index-a902a0d9.js} +18 -18
  74. package/es/{index-da646183.cjs → index-deb8de52.cjs} +1 -1
  75. package/es/index-eea0bcb3.cjs +1 -0
  76. package/es/index.esm-8d9a2abe.js +2432 -0
  77. package/es/index.esm-94a95a2a.cjs +3 -0
  78. package/es/{raf-2d77cbbe.cjs → raf-8fc301fd.cjs} +1 -1
  79. package/es/{raf-f55e0daa.js → raf-b128c7b7.js} +1 -1
  80. package/es/{scroll-ca84f80a.js → scroll-387fcfdb.js} +1 -1
  81. package/es/{scroll-c8ac196e.cjs → scroll-41224831.cjs} +1 -1
  82. package/es/style.css +1 -1
  83. package/es/{use-form-common-props-c1960844.cjs → use-form-common-props-1b84d8f4.cjs} +2 -2
  84. package/es/{use-form-common-props-4d37077d.js → use-form-common-props-f377e500.js} +64 -63
  85. package/es/vnode-7dfd4ed5.js +14 -0
  86. package/es/vnode-7fbc61e1.cjs +1 -0
  87. package/es/{zh-cn-414d7f0c.cjs → zh-cn-ab9a583d.cjs} +1 -1
  88. package/es/{zh-cn-23c8e0d1.js → zh-cn-eb9c2820.js} +2 -2
  89. package/lib/bundle.js +1 -1
  90. package/lib/bundle.umd.cjs +206 -206
  91. package/lib/{index-ffeb163e.js → index-d2de454d.js} +33249 -31372
  92. package/lib/{python-0ec8f68c.js → python-22975586.js} +1 -1
  93. package/lib/style.css +1 -1
  94. package/package.json +1 -1
  95. package/packages/Kline/components/Contextmenu/index.vue +110 -0
  96. package/packages/Kline/components/Tips/index.vue +40 -0
  97. package/packages/Kline/componentsNew/KlineSlide/index.vue +155 -0
  98. package/packages/Kline/componentsNew/KlineSub/index.vue +297 -0
  99. package/packages/Kline/componentsNew/KlineTips/index.vue +66 -0
  100. package/packages/Kline/componentsNew/KlineUtils/index.vue +84 -0
  101. package/packages/Kline/componentsNew/Tips/index.vue +33 -0
  102. package/packages/Kline/formatKlineData.ts +109 -0
  103. package/packages/Kline/images/buy.svg +1 -0
  104. package/packages/Kline/images/pen.png +0 -0
  105. package/packages/Kline/images/sell.svg +1 -0
  106. package/packages/Kline/images/t.svg +1 -0
  107. package/packages/Kline/index.ts +16 -0
  108. package/packages/Kline/index.vue +891 -0
  109. package/packages/Kline/option.ts +539 -0
  110. package/packages/Kline/type.d.ts +219 -0
  111. package/packages/Kline/utils.ts +682 -0
  112. package/packages/index.ts +2 -0
  113. package/src/pages/Kline/index.vue +12 -0
  114. package/src/router/routes.ts +5 -0
  115. package/es/_initCloneObject-476b02ce.cjs +0 -1
  116. package/es/castArray-374558a5.cjs +0 -1
  117. package/es/debounce-a6b4f91b.cjs +0 -1
  118. package/es/el-button-b8f71c7d.cjs +0 -1
  119. package/es/el-button-d7b6eebd.js +0 -745
  120. package/es/el-input-2c7e70a3.cjs +0 -1
  121. package/es/el-input-number-8e168e83.cjs +0 -1
  122. package/es/el-overlay-07414277.js +0 -526
  123. package/es/el-overlay-fb255b83.cjs +0 -1
  124. package/es/el-popper-8360bd91.cjs +0 -1
  125. package/es/el-scrollbar-271142ad.cjs +0 -1
  126. package/es/el-select-2e71d4af.cjs +0 -1
  127. package/es/el-table-column-9fe79f05.cjs +0 -14
  128. package/es/el-table-column-dc562f14.js +0 -3933
  129. package/es/el-tag-930e7b32.cjs +0 -1
  130. package/es/index-aece600c.js +0 -81
@@ -0,0 +1,81 @@
1
+ import { ref as C, getCurrentInstance as f, provide as x, computed as l, unref as i, inject as y, watch as I } from "vue";
2
+ import { D as b, f as p, a9 as _, aa as z, u as K, V as S, x as O } from "./base-437d17f3.js";
3
+ import { O as G, R as $, S as N, U as V, K as k, W as E } from "./use-form-common-props-f377e500.js";
4
+ const m = Symbol();
5
+ function P(n, o, a) {
6
+ return n == null ? n : G(n, o, a);
7
+ }
8
+ const d = (n) => Object.keys(n), A = (n, o, a) => ({
9
+ get value() {
10
+ return b(n, o, a);
11
+ },
12
+ set value(t) {
13
+ P(n, o, t);
14
+ }
15
+ }), v = C();
16
+ function g(n, o = void 0) {
17
+ const a = f() ? y(m, v) : v;
18
+ return n ? l(() => {
19
+ var t, s;
20
+ return (s = (t = a.value) == null ? void 0 : t[n]) != null ? s : o;
21
+ }) : a;
22
+ }
23
+ function J(n, o) {
24
+ const a = g(), t = K(n, l(() => {
25
+ var e;
26
+ return ((e = a.value) == null ? void 0 : e.namespace) || S;
27
+ })), s = O(l(() => {
28
+ var e;
29
+ return (e = a.value) == null ? void 0 : e.locale;
30
+ })), r = k(l(() => {
31
+ var e;
32
+ return ((e = a.value) == null ? void 0 : e.zIndex) || E;
33
+ })), u = l(() => {
34
+ var e;
35
+ return i(o) || ((e = a.value) == null ? void 0 : e.size) || "";
36
+ });
37
+ return Z(l(() => i(a) || {})), {
38
+ ns: t,
39
+ locale: s,
40
+ zIndex: r,
41
+ size: u
42
+ };
43
+ }
44
+ const Z = (n, o, a = !1) => {
45
+ var t;
46
+ const s = !!f(), r = s ? g() : void 0, u = (t = o == null ? void 0 : o.provide) != null ? t : s ? x : void 0;
47
+ if (!u) {
48
+ p("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
49
+ return;
50
+ }
51
+ const e = l(() => {
52
+ const c = i(n);
53
+ return r != null && r.value ? w(r.value, c) : c;
54
+ });
55
+ return u(m, e), u(_, l(() => e.value.locale)), u(z, l(() => e.value.namespace)), u($, l(() => e.value.zIndex)), u(N, {
56
+ size: l(() => e.value.size || "")
57
+ }), u(V, l(() => ({
58
+ emptyValues: e.value.emptyValues,
59
+ valueOnClear: e.value.valueOnClear
60
+ }))), (a || !v.value) && (v.value = e.value), e;
61
+ }, w = (n, o) => {
62
+ const a = [.../* @__PURE__ */ new Set([...d(n), ...d(o)])], t = {};
63
+ for (const s of a)
64
+ t[s] = o[s] !== void 0 ? o[s] : n[s];
65
+ return t;
66
+ }, L = ({ from: n, replacement: o, scope: a, version: t, ref: s, type: r = "API" }, u) => {
67
+ I(() => i(u), (e) => {
68
+ e && p(a, `[${r}] ${n} is about to be deprecated in version ${t}, please use ${o} instead.
69
+ For more detail, please visit: ${s}
70
+ `);
71
+ }, {
72
+ immediate: !0
73
+ });
74
+ };
75
+ export {
76
+ L as a,
77
+ g as b,
78
+ A as g,
79
+ Z as p,
80
+ J as u
81
+ };
@@ -1,5 +1,5 @@
1
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 { c as q, i as j, m as de, _ as te, v as fe, b as le, d as pe, w as Ee } from "./base-950bac7e.js";
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
3
  function De(e) {
4
4
  return e === void 0;
5
5
  }
@@ -296,8 +296,8 @@ export {
296
296
  Fe as F,
297
297
  Ve as I,
298
298
  xe as U,
299
- Me as a,
300
- He as b,
299
+ He as a,
300
+ Me as b,
301
301
  ne as c,
302
302
  l as d,
303
303
  De as i,
@@ -1,6 +1,6 @@
1
- import { defineComponent as E, computed as w, openBlock as i, createElementBlock as M, normalizeClass as n, unref as s, normalizeStyle as b, createElementVNode as r, renderSlot as g, createBlock as u, withModifiers as y, withCtx as p, createVNode as v, createCommentVNode as C, Transition as N } from "vue";
2
- import { c as V, b as $, E as _, d as h } from "./use-form-common-props-4d37077d.js";
3
- import { b as I, u as P, _ as F, w as K } from "./base-950bac7e.js";
1
+ import { defineComponent as E, computed as w, openBlock as i, createElementBlock as M, normalizeClass as n, unref as s, normalizeStyle as g, createElementVNode as r, renderSlot as b, createBlock as u, withModifiers as y, withCtx as p, createVNode as C, createCommentVNode as v, Transition as N } from "vue";
2
+ import { c as V, a as $, E as _, C as h } from "./use-form-common-props-f377e500.js";
3
+ import { b as I, u as P, _ as F, w as K } from "./base-437d17f3.js";
4
4
  const j = I({
5
5
  type: {
6
6
  type: String,
@@ -30,8 +30,8 @@ const j = I({
30
30
  ...A,
31
31
  props: j,
32
32
  emits: q,
33
- setup(a, { emit: d }) {
34
- const S = a, T = $(), o = P("tag"), m = w(() => {
33
+ setup(a, { emit: m }) {
34
+ const S = a, T = $(), o = P("tag"), d = w(() => {
35
35
  const { type: e, hit: l, effect: t, closable: c, round: B } = S;
36
36
  return [
37
37
  o.b(),
@@ -43,23 +43,23 @@ const j = I({
43
43
  o.is("round", B)
44
44
  ];
45
45
  }), f = (e) => {
46
- d("close", e);
46
+ m("close", e);
47
47
  }, k = (e) => {
48
- d("click", e);
48
+ m("click", e);
49
49
  }, z = (e) => {
50
50
  var l, t, c;
51
51
  (c = (t = (l = e == null ? void 0 : e.component) == null ? void 0 : l.subTree) == null ? void 0 : t.component) != null && c.bum && (e.component.subTree.component.bum = null);
52
52
  };
53
53
  return (e, l) => e.disableTransitions ? (i(), M("span", {
54
54
  key: 0,
55
- class: n(s(m)),
56
- style: b({ backgroundColor: e.color }),
55
+ class: n(s(d)),
56
+ style: g({ backgroundColor: e.color }),
57
57
  onClick: k
58
58
  }, [
59
59
  r("span", {
60
60
  class: n(s(o).e("content"))
61
61
  }, [
62
- g(e.$slots, "default")
62
+ b(e.$slots, "default")
63
63
  ], 2),
64
64
  e.closable ? (i(), u(s(_), {
65
65
  key: 0,
@@ -67,10 +67,10 @@ const j = I({
67
67
  onClick: y(f, ["stop"])
68
68
  }, {
69
69
  default: p(() => [
70
- v(s(h))
70
+ C(s(h))
71
71
  ]),
72
72
  _: 1
73
- }, 8, ["class", "onClick"])) : C("v-if", !0)
73
+ }, 8, ["class", "onClick"])) : v("v-if", !0)
74
74
  ], 6)) : (i(), u(N, {
75
75
  key: 1,
76
76
  name: `${s(o).namespace.value}-zoom-in-center`,
@@ -79,14 +79,14 @@ const j = I({
79
79
  }, {
80
80
  default: p(() => [
81
81
  r("span", {
82
- class: n(s(m)),
83
- style: b({ backgroundColor: e.color }),
82
+ class: n(s(d)),
83
+ style: g({ backgroundColor: e.color }),
84
84
  onClick: k
85
85
  }, [
86
86
  r("span", {
87
87
  class: n(s(o).e("content"))
88
88
  }, [
89
- g(e.$slots, "default")
89
+ b(e.$slots, "default")
90
90
  ], 2),
91
91
  e.closable ? (i(), u(s(_), {
92
92
  key: 0,
@@ -94,10 +94,10 @@ const j = I({
94
94
  onClick: y(f, ["stop"])
95
95
  }, {
96
96
  default: p(() => [
97
- v(s(h))
97
+ C(s(h))
98
98
  ]),
99
99
  _: 1
100
- }, 8, ["class", "onClick"])) : C("v-if", !0)
100
+ }, 8, ["class", "onClick"])) : v("v-if", !0)
101
101
  ], 6)
102
102
  ]),
103
103
  _: 3
@@ -1 +1 @@
1
- "use strict";const r=require("vue"),f=require("./base-6ccc8fc2.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$1(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;
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;