@v-c/util 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Children/isFragment.cjs +1 -0
  3. package/dist/Children/isFragment.d.ts +3 -0
  4. package/dist/Children/isFragment.js +7 -0
  5. package/dist/Children/toArray.cjs +1 -0
  6. package/dist/Children/toArray.d.ts +8 -0
  7. package/dist/Children/toArray.js +11 -0
  8. package/dist/Dom/addEventListener.cjs +1 -0
  9. package/dist/Dom/addEventListener.d.ts +8 -0
  10. package/dist/Dom/addEventListener.js +12 -0
  11. package/dist/Dom/canUseDom.cjs +1 -0
  12. package/dist/Dom/canUseDom.d.ts +1 -0
  13. package/dist/Dom/canUseDom.js +6 -0
  14. package/dist/Dom/class.cjs +1 -0
  15. package/dist/Dom/class.d.ts +3 -0
  16. package/dist/Dom/class.js +19 -0
  17. package/dist/Dom/contains.cjs +1 -0
  18. package/dist/Dom/contains.d.ts +1 -0
  19. package/dist/Dom/contains.js +16 -0
  20. package/dist/Dom/css.cjs +1 -0
  21. package/dist/Dom/css.d.ts +20 -0
  22. package/dist/Dom/css.js +75 -0
  23. package/dist/Dom/dynamicCSS.cjs +1 -0
  24. package/dist/Dom/dynamicCSS.d.ts +24 -0
  25. package/dist/Dom/dynamicCSS.js +78 -0
  26. package/dist/Dom/findDOMNode.cjs +1 -0
  27. package/dist/Dom/findDOMNode.d.ts +7 -0
  28. package/dist/Dom/findDOMNode.js +12 -0
  29. package/dist/Dom/focus.cjs +1 -0
  30. package/dist/Dom/focus.d.ts +8 -0
  31. package/dist/Dom/focus.js +40 -0
  32. package/dist/Dom/isVisible.cjs +1 -0
  33. package/dist/Dom/isVisible.d.ts +2 -0
  34. package/dist/Dom/isVisible.js +22 -0
  35. package/dist/Dom/scrollLocker.cjs +1 -0
  36. package/dist/Dom/scrollLocker.d.ts +12 -0
  37. package/dist/Dom/scrollLocker.js +81 -0
  38. package/dist/Dom/shadow.cjs +1 -0
  39. package/dist/Dom/shadow.d.ts +8 -0
  40. package/dist/Dom/shadow.js +14 -0
  41. package/dist/Dom/styleChecker.cjs +1 -0
  42. package/dist/Dom/styleChecker.d.ts +2 -0
  43. package/dist/Dom/styleChecker.js +20 -0
  44. package/dist/Dom/support.cjs +1 -0
  45. package/dist/Dom/support.d.ts +6 -0
  46. package/dist/Dom/support.js +24 -0
  47. package/dist/EventInterface.cjs +1 -0
  48. package/dist/EventInterface.d.ts +18 -0
  49. package/dist/EventInterface.js +1 -0
  50. package/dist/KeyCode.cjs +1 -0
  51. package/dist/KeyCode.d.ts +435 -0
  52. package/dist/KeyCode.js +516 -0
  53. package/dist/Portal.cjs +1 -0
  54. package/dist/Portal.d.ts +8 -0
  55. package/dist/Portal.js +38 -0
  56. package/dist/PortalWrapper.cjs +1 -0
  57. package/dist/PortalWrapper.d.ts +28 -0
  58. package/dist/PortalWrapper.js +114 -0
  59. package/dist/composeProps.cjs +1 -0
  60. package/dist/composeProps.d.ts +2 -0
  61. package/dist/composeProps.js +16 -0
  62. package/dist/createRef.cjs +1 -0
  63. package/dist/createRef.d.ts +12 -0
  64. package/dist/createRef.js +21 -0
  65. package/dist/debug/diff.cjs +1 -0
  66. package/dist/debug/diff.d.ts +1 -0
  67. package/dist/debug/diff.js +41 -0
  68. package/dist/deprecated.cjs +1 -0
  69. package/dist/deprecated.d.ts +1 -0
  70. package/dist/deprecated.js +8 -0
  71. package/dist/getScrollBarSize.cjs +1 -0
  72. package/dist/getScrollBarSize.d.ts +5 -0
  73. package/dist/getScrollBarSize.js +37 -0
  74. package/dist/guid.cjs +1 -0
  75. package/dist/guid.d.ts +1 -0
  76. package/dist/guid.js +7 -0
  77. package/dist/hooks/useId.cjs +1 -0
  78. package/dist/hooks/useId.d.ts +5 -0
  79. package/dist/hooks/useId.js +17 -0
  80. package/dist/hooks/useMemo.cjs +1 -0
  81. package/dist/hooks/useMemo.d.ts +3 -0
  82. package/dist/hooks/useMemo.js +10 -0
  83. package/dist/hooks/useMergedState.cjs +1 -0
  84. package/dist/hooks/useMergedState.d.ts +8 -0
  85. package/dist/hooks/useMergedState.js +21 -0
  86. package/dist/hooks/useState.cjs +1 -0
  87. package/dist/hooks/useState.d.ts +3 -0
  88. package/dist/hooks/useState.js +11 -0
  89. package/dist/index.cjs +1 -0
  90. package/dist/index.d.ts +3 -0
  91. package/dist/index.js +8 -0
  92. package/dist/isEqual.cjs +1 -0
  93. package/dist/isEqual.d.ts +8 -0
  94. package/dist/isEqual.js +32 -0
  95. package/dist/isMobile.cjs +1 -0
  96. package/dist/isMobile.d.ts +2 -0
  97. package/dist/isMobile.js +13 -0
  98. package/dist/omit.cjs +1 -0
  99. package/dist/omit.d.ts +1 -0
  100. package/dist/omit.js +9 -0
  101. package/dist/pickAttrs.cjs +18 -0
  102. package/dist/pickAttrs.d.ts +11 -0
  103. package/dist/pickAttrs.js +41 -0
  104. package/dist/props-util/index.cjs +1 -0
  105. package/dist/props-util/index.d.ts +2 -0
  106. package/dist/props-util/index.js +14 -0
  107. package/dist/raf.cjs +1 -0
  108. package/dist/raf.d.ts +6 -0
  109. package/dist/raf.js +30 -0
  110. package/dist/setStyle.cjs +1 -0
  111. package/dist/setStyle.d.ts +13 -0
  112. package/dist/setStyle.js +13 -0
  113. package/dist/switchScrollingEffect.cjs +1 -0
  114. package/dist/switchScrollingEffect.d.ts +2 -0
  115. package/dist/switchScrollingEffect.js +31 -0
  116. package/dist/test/domHook.cjs +1 -0
  117. package/dist/test/domHook.d.ts +8 -0
  118. package/dist/test/domHook.js +37 -0
  119. package/dist/type.cjs +1 -0
  120. package/dist/type.d.ts +63 -0
  121. package/dist/type.js +49 -0
  122. package/dist/utils/checkSlotProp.cjs +1 -0
  123. package/dist/utils/checkSlotProp.d.ts +1 -0
  124. package/dist/utils/checkSlotProp.js +7 -0
  125. package/dist/utils/get.cjs +1 -0
  126. package/dist/utils/get.d.ts +1 -0
  127. package/dist/utils/get.js +12 -0
  128. package/dist/utils/set.cjs +1 -0
  129. package/dist/utils/set.d.ts +6 -0
  130. package/dist/utils/set.js +41 -0
  131. package/dist/vnode.cjs +1 -0
  132. package/dist/vnode.d.ts +12 -0
  133. package/dist/vnode.js +41 -0
  134. package/dist/warning.cjs +1 -0
  135. package/dist/warning.d.ts +18 -0
  136. package/dist/warning.js +48 -0
  137. package/package.json +37 -0
  138. package/src/Children/isFragment.ts +6 -0
  139. package/src/Children/tests/isFragment.test.tsx +15 -0
  140. package/src/Children/tests/toArray.test.tsx +101 -0
  141. package/src/Children/toArray.ts +27 -0
  142. package/src/Dom/addEventListener.ts +20 -0
  143. package/src/Dom/canUseDom.ts +7 -0
  144. package/src/Dom/class.ts +29 -0
  145. package/src/Dom/contains.ts +19 -0
  146. package/src/Dom/css.ts +113 -0
  147. package/src/Dom/dynamicCSS.ts +173 -0
  148. package/src/Dom/findDOMNode.ts +23 -0
  149. package/src/Dom/focus.ts +96 -0
  150. package/src/Dom/isVisible.ts +23 -0
  151. package/src/Dom/scrollLocker.ts +143 -0
  152. package/src/Dom/shadow.ts +17 -0
  153. package/src/Dom/styleChecker.ts +31 -0
  154. package/src/Dom/support.ts +27 -0
  155. package/src/EventInterface.ts +19 -0
  156. package/src/KeyCode.ts +516 -0
  157. package/src/Portal.tsx +50 -0
  158. package/src/PortalWrapper.tsx +214 -0
  159. package/src/composeProps.ts +23 -0
  160. package/src/createRef.ts +33 -0
  161. package/src/debug/diff.ts +66 -0
  162. package/src/deprecated.ts +8 -0
  163. package/src/getScrollBarSize.tsx +57 -0
  164. package/src/guid.ts +4 -0
  165. package/src/hooks/useId.ts +31 -0
  166. package/src/hooks/useMemo.ts +21 -0
  167. package/src/hooks/useMergedState.ts +44 -0
  168. package/src/hooks/useState.ts +17 -0
  169. package/src/index.ts +3 -0
  170. package/src/isEqual.ts +50 -0
  171. package/src/isMobile.ts +15 -0
  172. package/src/omit.ts +14 -0
  173. package/src/pickAttrs.ts +78 -0
  174. package/src/props-util/index.ts +22 -0
  175. package/src/raf.ts +55 -0
  176. package/src/setStyle.ts +38 -0
  177. package/src/switchScrollingEffect.ts +48 -0
  178. package/src/test/domHook.ts +67 -0
  179. package/src/type.ts +94 -0
  180. package/src/utils/checkSlotProp.ts +10 -0
  181. package/src/utils/get.ts +15 -0
  182. package/src/utils/set.ts +110 -0
  183. package/src/vnode.ts +86 -0
  184. package/src/warning.ts +79 -0
  185. package/tests/Portal.test.tsx +199 -0
  186. package/tsconfig.json +7 -0
  187. package/vite.config.ts +18 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 antdv-community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function r(e){return t.isVNode(e)&&e.type===t.Fragment}exports.isFragment=r;
@@ -0,0 +1,3 @@
1
+ import { VNode, VNodeChild } from 'vue';
2
+
3
+ export declare function isFragment(node: VNodeChild): node is VNode;
@@ -0,0 +1,7 @@
1
+ import { isVNode as t, Fragment as e } from "vue";
2
+ function m(r) {
3
+ return t(r) && r.type === e;
4
+ }
5
+ export {
6
+ m as isFragment
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./isFragment.cjs");function a(t,i={}){let e=[];Array.isArray(t)||(t=[t]);for(const r of t)r==null&&!i.keepEmpty||(Array.isArray(r)?e=e.concat(a(r,i)):n.isFragment(r)&&r.children?e=e.concat(a(r.children,i)):e.push(r));return e}exports.toArray=a;
@@ -0,0 +1,8 @@
1
+ import { VNode } from 'vue';
2
+
3
+ export interface Option {
4
+ keepEmpty?: boolean;
5
+ }
6
+ export declare function toArray(children: any, option?: Option): VNode<import('vue').RendererNode, import('vue').RendererElement, {
7
+ [key: string]: any;
8
+ }>[];
@@ -0,0 +1,11 @@
1
+ import { isFragment as f } from "./isFragment.js";
2
+ function a(t, i = {}) {
3
+ let e = [];
4
+ Array.isArray(t) || (t = [t]);
5
+ for (const r of t)
6
+ r == null && !i.keepEmpty || (Array.isArray(r) ? e = e.concat(a(r, i)) : f(r) && r.children ? e = e.concat(a(r.children, i)) : e.push(r));
7
+ return e;
8
+ }
9
+ export {
10
+ a as toArray
11
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function v(...o){const[e,n,i,t]=o;return e!=null&&e.addEventListener&&e.addEventListener(n,i,t),{remove(){var d;(d=e==null?void 0:e.removeEventListener)==null||d.call(e,n,i,t)}}}exports.addEventListener=v;
@@ -0,0 +1,8 @@
1
+ export type WindowEventName = keyof WindowEventMap;
2
+ export type DocumentEventName = keyof DocumentEventMap;
3
+ export declare function addEventListener<E extends WindowEventName = WindowEventName>(target: Window, eventType: E, cb: WindowEventMap[E], option?: AddEventListenerOptions): {
4
+ remove(): void;
5
+ };
6
+ export declare function addEventListener<E extends DocumentEventName = DocumentEventName>(target: Document, eventType: E, cb: DocumentEventMap[E], option?: AddEventListenerOptions): {
7
+ remove(): void;
8
+ };
@@ -0,0 +1,12 @@
1
+ function s(...d) {
2
+ const [e, n, i, o] = d;
3
+ return e != null && e.addEventListener && e.addEventListener(n, i, o), {
4
+ remove() {
5
+ var v;
6
+ (v = e == null ? void 0 : e.removeEventListener) == null || v.call(e, n, i, o);
7
+ }
8
+ };
9
+ }
10
+ export {
11
+ s as addEventListener
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}exports.default=e;
@@ -0,0 +1 @@
1
+ export default function canUseDom(): boolean;
@@ -0,0 +1,6 @@
1
+ function e() {
2
+ return !!(typeof window < "u" && window.document && window.document.createElement);
3
+ }
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(s,i){return s.classList?s.classList.contains(i):` ${s.className} `.includes(` ${i} `)}function t(s,i){s.classList?s.classList.add(i):a(s,i)||(s.className=`${s.className} ${i}`)}function c(s,i){if(s.classList)s.classList.remove(i);else if(a(s,i)){const l=s.className;s.className=` ${l} `.replace(` ${i} `," ")}}exports.addClass=t;exports.hasClass=a;exports.removeClass=c;
@@ -0,0 +1,3 @@
1
+ export declare function hasClass(node: Element, className: string): boolean;
2
+ export declare function addClass(node: Element, className: string): void;
3
+ export declare function removeClass(node: Element, className: string): void;
@@ -0,0 +1,19 @@
1
+ function l(s, i) {
2
+ return s.classList ? s.classList.contains(i) : ` ${s.className} `.includes(` ${i} `);
3
+ }
4
+ function t(s, i) {
5
+ s.classList ? s.classList.add(i) : l(s, i) || (s.className = `${s.className} ${i}`);
6
+ }
7
+ function c(s, i) {
8
+ if (s.classList)
9
+ s.classList.remove(i);
10
+ else if (l(s, i)) {
11
+ const a = s.className;
12
+ s.className = ` ${a} `.replace(` ${i} `, " ");
13
+ }
14
+ }
15
+ export {
16
+ t as addClass,
17
+ l as hasClass,
18
+ c as removeClass
19
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(e,n){if(!e)return!1;if(e.contains)return e.contains(n);let t=n;for(;t;){if(t===e)return!0;t=t.parentNode}return!1}exports.default=u;
@@ -0,0 +1 @@
1
+ export default function contains(root: Node | null | undefined, n?: Node): boolean;
@@ -0,0 +1,16 @@
1
+ function a(e, t) {
2
+ if (!e)
3
+ return !1;
4
+ if (e.contains)
5
+ return e.contains(t);
6
+ let n = t;
7
+ for (; n; ) {
8
+ if (n === e)
9
+ return !0;
10
+ n = n.parentNode;
11
+ }
12
+ return !1;
13
+ }
14
+ export {
15
+ a as default
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=/margin|padding|width|height|max|min|offset/,i={left:!0,top:!0},r={cssFloat:1,styleFloat:1,float:1};function u(e){return e.nodeType===1?e.ownerDocument.defaultView.getComputedStyle(e,null):{}}function f(e,t,o){if(t=t.toLowerCase(),o==="auto"){if(t==="height")return e.offsetHeight;if(t==="width")return e.offsetWidth}return t in i||(i[t]=l.test(t)),i[t]?Number.parseFloat(o)||0:o}function d(e,t){const o=arguments.length,n=u(e);return t=r[t]?"cssFloat"in e.style?"cssFloat":"styleFloat":t,o===1?n:f(e,t,n[t]||e.style[t])}function s(e,t,o){const n=arguments.length;if(t=r[t]?"cssFloat"in e.style?"cssFloat":"styleFloat":t,n===3)return typeof o=="number"&&l.test(t)&&(o=`${o}px`),e.style[t]=o,o;for(const c in t)c in t&&s(e,c,t[c]);return u(e)}function g(e){return e===document.body?document.documentElement.clientWidth:e.offsetWidth}function m(e){return e===document.body?window.innerHeight||document.documentElement.clientHeight:e.offsetHeight}function h(){const e=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:e,height:t}}function a(){const e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function y(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function w(e){const t=e.getBoundingClientRect(),o=document.documentElement;return{left:t.left+(window.pageXOffset||o.scrollLeft)-(o.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||o.scrollTop)-(o.clientTop||document.body.clientTop||0)}}exports.get=d;exports.getClientSize=a;exports.getDocSize=h;exports.getOffset=w;exports.getOuterHeight=m;exports.getOuterWidth=g;exports.getScroll=y;exports.set=s;
@@ -0,0 +1,20 @@
1
+ export declare function get(node: HTMLElement, name: any): any;
2
+ export declare function set(node: HTMLElement, name: any, value: string | number): any;
3
+ export declare function getOuterWidth(el: HTMLElement): number;
4
+ export declare function getOuterHeight(el: HTMLElement): number;
5
+ export declare function getDocSize(): {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export declare function getClientSize(): {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ export declare function getScroll(): {
14
+ scrollLeft: number;
15
+ scrollTop: number;
16
+ };
17
+ export declare function getOffset(node: any): {
18
+ left: number;
19
+ top: number;
20
+ };
@@ -0,0 +1,75 @@
1
+ const l = /margin|padding|width|height|max|min|offset/, i = {
2
+ left: !0,
3
+ top: !0
4
+ }, u = {
5
+ cssFloat: 1,
6
+ styleFloat: 1,
7
+ float: 1
8
+ };
9
+ function r(e) {
10
+ return e.nodeType === 1 ? e.ownerDocument.defaultView.getComputedStyle(e, null) : {};
11
+ }
12
+ function s(e, t, o) {
13
+ if (t = t.toLowerCase(), o === "auto") {
14
+ if (t === "height")
15
+ return e.offsetHeight;
16
+ if (t === "width")
17
+ return e.offsetWidth;
18
+ }
19
+ return t in i || (i[t] = l.test(t)), i[t] ? Number.parseFloat(o) || 0 : o;
20
+ }
21
+ function d(e, t) {
22
+ const o = arguments.length, n = r(e);
23
+ return t = u[t] ? "cssFloat" in e.style ? "cssFloat" : "styleFloat" : t, o === 1 ? n : s(e, t, n[t] || e.style[t]);
24
+ }
25
+ function f(e, t, o) {
26
+ const n = arguments.length;
27
+ if (t = u[t] ? "cssFloat" in e.style ? "cssFloat" : "styleFloat" : t, n === 3)
28
+ return typeof o == "number" && l.test(t) && (o = `${o}px`), e.style[t] = o, o;
29
+ for (const c in t)
30
+ c in t && f(e, c, t[c]);
31
+ return r(e);
32
+ }
33
+ function m(e) {
34
+ return e === document.body ? document.documentElement.clientWidth : e.offsetWidth;
35
+ }
36
+ function h(e) {
37
+ return e === document.body ? window.innerHeight || document.documentElement.clientHeight : e.offsetHeight;
38
+ }
39
+ function g() {
40
+ const e = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), t = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
41
+ return {
42
+ width: e,
43
+ height: t
44
+ };
45
+ }
46
+ function w() {
47
+ const e = document.documentElement.clientWidth, t = window.innerHeight || document.documentElement.clientHeight;
48
+ return {
49
+ width: e,
50
+ height: t
51
+ };
52
+ }
53
+ function a() {
54
+ return {
55
+ scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
56
+ scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
57
+ };
58
+ }
59
+ function y(e) {
60
+ const t = e.getBoundingClientRect(), o = document.documentElement;
61
+ return {
62
+ left: t.left + (window.pageXOffset || o.scrollLeft) - (o.clientLeft || document.body.clientLeft || 0),
63
+ top: t.top + (window.pageYOffset || o.scrollTop) - (o.clientTop || document.body.clientTop || 0)
64
+ };
65
+ }
66
+ export {
67
+ d as get,
68
+ w as getClientSize,
69
+ g as getDocSize,
70
+ y as getOffset,
71
+ h as getOuterHeight,
72
+ m as getOuterWidth,
73
+ a as getScroll,
74
+ f as set
75
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./canUseDom.cjs"),N=require("./contains.cjs"),h="data-vc-order",C="data-vc-priority",v="vc-util-key",d=new Map;function g({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:v}function s(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function P(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function y(e){return Array.from((d.get(e)||e).children).filter(n=>n.tagName==="STYLE")}function l(e,n={}){if(!A.default())return null;const{csp:t,prepend:i,priority:r=0}=n,u=P(i),a=u==="prependQueue",c=document.createElement("style");c.setAttribute(h,u),a&&r&&c.setAttribute(C,`${r}`),t!=null&&t.nonce&&(c.nonce=t==null?void 0:t.nonce),c.innerHTML=e;const o=s(n),{firstChild:p}=o;if(i){if(a){const f=y(o).filter(S=>{if(!["prepend","prependQueue"].includes(S.getAttribute(h)))return!1;const b=Number(S.getAttribute(C)||0);return r>=b});if(f.length)return o.insertBefore(c,f[f.length-1].nextSibling),c}o.insertBefore(c,p)}else o.appendChild(c);return c}function m(e,n={}){const t=s(n);return y(t).find(i=>i.getAttribute(g(n))===e)}function T(e,n={}){const t=m(e,n);t&&s(n).removeChild(t)}function E(e,n){const t=d.get(e);if(!t||!N.default(document,t)){const i=l("",n),{parentNode:r}=i;d.set(e,r),e.removeChild(i)}}function M(){d.clear()}function R(e,n,t={}){var a,c,o;const i=s(t);E(i,t);const r=m(n,t);if(r)return(a=t.csp)!=null&&a.nonce&&r.nonce!==((c=t.csp)==null?void 0:c.nonce)&&(r.nonce=(o=t.csp)==null?void 0:o.nonce),r.innerHTML!==e&&(r.innerHTML=e),r;const u=l(e,t);return u.setAttribute(g(t),n),u}exports.clearContainerCache=M;exports.injectCSS=l;exports.removeCSS=T;exports.updateCSS=R;
@@ -0,0 +1,24 @@
1
+ export type ContainerType = Element | ShadowRoot;
2
+ export type Prepend = boolean | 'queue';
3
+ export type AppendType = 'prependQueue' | 'append' | 'prepend';
4
+ interface Options {
5
+ attachTo?: ContainerType;
6
+ csp?: {
7
+ nonce?: string;
8
+ };
9
+ prepend?: Prepend;
10
+ /**
11
+ * Config the `priority` of `prependQueue`. Default is `0`.
12
+ * It's useful if you need to insert style before other style.
13
+ */
14
+ priority?: number;
15
+ mark?: string;
16
+ }
17
+ export declare function injectCSS(css: string, option?: Options): HTMLStyleElement | null;
18
+ export declare function removeCSS(key: string, option?: Options): void;
19
+ /**
20
+ * manually clear container cache to avoid global cache in unit testes
21
+ */
22
+ export declare function clearContainerCache(): void;
23
+ export declare function updateCSS(css: string, key: string, option?: Options): any;
24
+ export {};
@@ -0,0 +1,78 @@
1
+ import N from "./canUseDom.js";
2
+ import b from "./contains.js";
3
+ const h = "data-vc-order", m = "data-vc-priority", E = "vc-util-key", a = /* @__PURE__ */ new Map();
4
+ function g({ mark: e } = {}) {
5
+ return e ? e.startsWith("data-") ? e : `data-${e}` : E;
6
+ }
7
+ function s(e) {
8
+ return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
9
+ }
10
+ function P(e) {
11
+ return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
12
+ }
13
+ function p(e) {
14
+ return Array.from(
15
+ (a.get(e) || e).children
16
+ ).filter((n) => n.tagName === "STYLE");
17
+ }
18
+ function C(e, n = {}) {
19
+ if (!N())
20
+ return null;
21
+ const { csp: t, prepend: i, priority: r = 0 } = n, u = P(i), d = u === "prependQueue", c = document.createElement("style");
22
+ c.setAttribute(h, u), d && r && c.setAttribute(m, `${r}`), t != null && t.nonce && (c.nonce = t == null ? void 0 : t.nonce), c.innerHTML = e;
23
+ const o = s(n), { firstChild: S } = o;
24
+ if (i) {
25
+ if (d) {
26
+ const f = p(o).filter((l) => {
27
+ if (!["prepend", "prependQueue"].includes(l.getAttribute(h)))
28
+ return !1;
29
+ const A = Number(l.getAttribute(m) || 0);
30
+ return r >= A;
31
+ });
32
+ if (f.length)
33
+ return o.insertBefore(
34
+ c,
35
+ f[f.length - 1].nextSibling
36
+ ), c;
37
+ }
38
+ o.insertBefore(c, S);
39
+ } else
40
+ o.appendChild(c);
41
+ return c;
42
+ }
43
+ function y(e, n = {}) {
44
+ const t = s(n);
45
+ return p(t).find(
46
+ (i) => i.getAttribute(g(n)) === e
47
+ );
48
+ }
49
+ function x(e, n = {}) {
50
+ const t = y(e, n);
51
+ t && s(n).removeChild(t);
52
+ }
53
+ function R(e, n) {
54
+ const t = a.get(e);
55
+ if (!t || !b(document, t)) {
56
+ const i = C("", n), { parentNode: r } = i;
57
+ a.set(e, r), e.removeChild(i);
58
+ }
59
+ }
60
+ function M() {
61
+ a.clear();
62
+ }
63
+ function D(e, n, t = {}) {
64
+ var d, c, o;
65
+ const i = s(t);
66
+ R(i, t);
67
+ const r = y(n, t);
68
+ if (r)
69
+ return (d = t.csp) != null && d.nonce && r.nonce !== ((c = t.csp) == null ? void 0 : c.nonce) && (r.nonce = (o = t.csp) == null ? void 0 : o.nonce), r.innerHTML !== e && (r.innerHTML = e), r;
70
+ const u = C(e, t);
71
+ return u.setAttribute(g(t), n), u;
72
+ }
73
+ export {
74
+ M as clearContainerCache,
75
+ C as injectCSS,
76
+ x as removeCSS,
77
+ D as updateCSS
78
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue");function t(n){return n instanceof HTMLElement||n instanceof SVGElement}function r(n){const e=u.unref(n);return t(e)?e:e&&"$el"in e?e.$el:null}exports.default=r;exports.isDOM=t;
@@ -0,0 +1,7 @@
1
+ import { ComponentPublicInstance, MaybeRef } from 'vue';
2
+
3
+ export declare function isDOM(node: any): node is HTMLElement | SVGElement;
4
+ /**
5
+ * Return if a node is a DOM node. Else will return by `findDOMNode`
6
+ */
7
+ export default function findDOMNode<T = Element | Text>(_node: MaybeRef<ComponentPublicInstance | HTMLElement | SVGElement>): T | null;
@@ -0,0 +1,12 @@
1
+ import { unref as t } from "vue";
2
+ function r(e) {
3
+ return e instanceof HTMLElement || e instanceof SVGElement;
4
+ }
5
+ function i(e) {
6
+ const n = t(e);
7
+ return r(n) ? n : n && "$el" in n ? n.$el : null;
8
+ }
9
+ export {
10
+ i as default,
11
+ r as isDOM
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./isVisible.cjs");function c(t,s=!1){if(r.default(t)){const e=t.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(e)||t.isContentEditable||e==="a"&&!!t.getAttribute("href"),u=t.getAttribute("tabindex"),o=Number(u);let a=null;return u&&!Number.isNaN(o)?a=o:n&&a===null&&(a=0),n&&t.disabled&&(a=null),a!==null&&(a>=0||s&&a<0)}return!1}function i(t,s=!1){const e=[...t.querySelectorAll("*")].filter(n=>c(n,s));return c(t,s)&&e.unshift(t),e}let l=null;function f(){l=document.activeElement}function b(){l=null}function d(){if(l)try{l.focus()}catch{}}function N(t,s){if(s.keyCode===9){const e=i(t);(e[s.shiftKey?0:e.length-1]===document.activeElement||t===document.activeElement)&&(e[s.shiftKey?e.length-1:0].focus(),s.preventDefault())}}exports.backLastFocusNode=d;exports.clearLastFocusNode=b;exports.getFocusNodeList=i;exports.limitTabRange=N;exports.saveLastFocusNode=f;
@@ -0,0 +1,8 @@
1
+ export declare function getFocusNodeList(node: HTMLElement, includePositive?: boolean): HTMLElement[];
2
+ /** @deprecated Do not use since this may failed when used in async */
3
+ export declare function saveLastFocusNode(): void;
4
+ /** @deprecated Do not use since this may failed when used in async */
5
+ export declare function clearLastFocusNode(): void;
6
+ /** @deprecated Do not use since this may failed when used in async */
7
+ export declare function backLastFocusNode(): void;
8
+ export declare function limitTabRange(node: HTMLElement, e: KeyboardEvent): void;
@@ -0,0 +1,40 @@
1
+ import o from "./isVisible.js";
2
+ function c(t, n = !1) {
3
+ if (o(t)) {
4
+ const e = t.nodeName.toLowerCase(), l = ["input", "select", "textarea", "button"].includes(e) || t.isContentEditable || e === "a" && !!t.getAttribute("href"), i = t.getAttribute("tabindex"), u = Number(i);
5
+ let a = null;
6
+ return i && !Number.isNaN(u) ? a = u : l && a === null && (a = 0), l && t.disabled && (a = null), a !== null && (a >= 0 || n && a < 0);
7
+ }
8
+ return !1;
9
+ }
10
+ function r(t, n = !1) {
11
+ const e = [...t.querySelectorAll("*")].filter((l) => c(l, n));
12
+ return c(t, n) && e.unshift(t), e;
13
+ }
14
+ let s = null;
15
+ function b() {
16
+ s = document.activeElement;
17
+ }
18
+ function m() {
19
+ s = null;
20
+ }
21
+ function N() {
22
+ if (s)
23
+ try {
24
+ s.focus();
25
+ } catch {
26
+ }
27
+ }
28
+ function d(t, n) {
29
+ if (n.keyCode === 9) {
30
+ const e = r(t);
31
+ (e[n.shiftKey ? 0 : e.length - 1] === document.activeElement || t === document.activeElement) && (e[n.shiftKey ? e.length - 1 : 0].focus(), n.preventDefault());
32
+ }
33
+ }
34
+ export {
35
+ N as backLastFocusNode,
36
+ m as clearLastFocusNode,
37
+ r as getFocusNodeList,
38
+ d as limitTabRange,
39
+ b as saveLastFocusNode
40
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=t=>{if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){const{width:i,height:e}=t.getBBox();if(i||e)return!0}if(t.getBoundingClientRect){const{width:i,height:e}=t.getBoundingClientRect();if(i||e)return!0}}return!1};exports.default=r;
@@ -0,0 +1,2 @@
1
+ declare const _default: (element: Element) => boolean;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ const f = (t) => {
2
+ if (!t)
3
+ return !1;
4
+ if (t instanceof Element) {
5
+ if (t.offsetParent)
6
+ return !0;
7
+ if (t.getBBox) {
8
+ const { width: i, height: r } = t.getBBox();
9
+ if (i || r)
10
+ return !0;
11
+ }
12
+ if (t.getBoundingClientRect) {
13
+ const { width: i, height: r } = t.getBoundingClientRect();
14
+ if (i || r)
15
+ return !0;
16
+ }
17
+ }
18
+ return !1;
19
+ };
20
+ export {
21
+ f as default
22
+ };
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var g=(s,t,e)=>t in s?u(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var c=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("../getScrollBarSize.cjs"),f=require("../setStyle.cjs");let k=0,n=[];const h="ant-scrolling-effect",a=new RegExp(`${h}`,"g"),d=new Map;class N{constructor(t){c(this,"lockTarget");c(this,"options");c(this,"getContainer",()=>{var t;return(t=this.options)==null?void 0:t.container});c(this,"reLock",t=>{const e=n.find(({target:l})=>l===this.lockTarget);e&&this.unLock(),this.options=t,e&&(e.options=t,this.lock())});c(this,"lock",()=>{var r;if(n.some(({target:o})=>o===this.lockTarget))return;if(n.some(({options:o})=>{var i;return(o==null?void 0:o.container)===((i=this.options)==null?void 0:i.container)})){n=[...n,{target:this.lockTarget,options:this.options}];return}let t=0;const e=((r=this.options)==null?void 0:r.container)||document.body;(e===document.body&&window.innerWidth-document.documentElement.clientWidth>0||e.scrollHeight>e.clientHeight)&&getComputedStyle(e).overflow!=="hidden"&&(t=m.default());const l=e.className;if(n.filter(({options:o})=>{var i;return(o==null?void 0:o.container)===((i=this.options)==null?void 0:i.container)}).length===0&&d.set(e,f.default({width:t!==0?`calc(100% - ${t}px)`:void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:e})),!a.test(l)){const o=`${l} ${h}`;e.className=o.trim()}n=[...n,{target:this.lockTarget,options:this.options}]});c(this,"unLock",()=>{var r;const t=n.find(({target:o})=>o===this.lockTarget);if(n=n.filter(({target:o})=>o!==this.lockTarget),!t||n.some(({options:o})=>{var i;return(o==null?void 0:o.container)===((i=t.options)==null?void 0:i.container)}))return;const e=((r=this.options)==null?void 0:r.container)||document.body,l=e.className;a.test(l)&&(f.default(d.get(e),{element:e}),d.delete(e),e.className=e.className.replace(a,"").trim())});this.lockTarget=k++,this.options=t}}exports.default=N;
@@ -0,0 +1,12 @@
1
+ export interface scrollLockOptions {
2
+ container: HTMLElement;
3
+ }
4
+ export default class ScrollLocker {
5
+ private readonly lockTarget;
6
+ private options;
7
+ constructor(options?: scrollLockOptions);
8
+ getContainer: () => HTMLElement | undefined;
9
+ reLock: (options?: scrollLockOptions) => void;
10
+ lock: () => void;
11
+ unLock: () => void;
12
+ }
@@ -0,0 +1,81 @@
1
+ var m = Object.defineProperty;
2
+ var g = (s, e, t) => e in s ? m(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var c = (s, e, t) => g(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import k from "../getScrollBarSize.js";
5
+ import f from "../setStyle.js";
6
+ let u = 0, n = [];
7
+ const h = "ant-scrolling-effect", a = new RegExp(
8
+ `${h}`,
9
+ "g"
10
+ ), d = /* @__PURE__ */ new Map();
11
+ class T {
12
+ constructor(e) {
13
+ c(this, "lockTarget");
14
+ c(this, "options");
15
+ c(this, "getContainer", () => {
16
+ var e;
17
+ return (e = this.options) == null ? void 0 : e.container;
18
+ });
19
+ // if options change...
20
+ c(this, "reLock", (e) => {
21
+ const t = n.find(({ target: r }) => r === this.lockTarget);
22
+ t && this.unLock(), this.options = e, t && (t.options = e, this.lock());
23
+ });
24
+ c(this, "lock", () => {
25
+ var l;
26
+ if (n.some(({ target: o }) => o === this.lockTarget))
27
+ return;
28
+ if (n.some(
29
+ ({ options: o }) => {
30
+ var i;
31
+ return (o == null ? void 0 : o.container) === ((i = this.options) == null ? void 0 : i.container);
32
+ }
33
+ )) {
34
+ n = [...n, { target: this.lockTarget, options: this.options }];
35
+ return;
36
+ }
37
+ let e = 0;
38
+ const t = ((l = this.options) == null ? void 0 : l.container) || document.body;
39
+ (t === document.body && window.innerWidth - document.documentElement.clientWidth > 0 || t.scrollHeight > t.clientHeight) && getComputedStyle(t).overflow !== "hidden" && (e = k());
40
+ const r = t.className;
41
+ if (n.filter(
42
+ ({ options: o }) => {
43
+ var i;
44
+ return (o == null ? void 0 : o.container) === ((i = this.options) == null ? void 0 : i.container);
45
+ }
46
+ ).length === 0 && d.set(
47
+ t,
48
+ f(
49
+ {
50
+ width: e !== 0 ? `calc(100% - ${e}px)` : void 0,
51
+ overflow: "hidden",
52
+ overflowX: "hidden",
53
+ overflowY: "hidden"
54
+ },
55
+ { element: t }
56
+ )
57
+ ), !a.test(r)) {
58
+ const o = `${r} ${h}`;
59
+ t.className = o.trim();
60
+ }
61
+ n = [...n, { target: this.lockTarget, options: this.options }];
62
+ });
63
+ c(this, "unLock", () => {
64
+ var l;
65
+ const e = n.find(({ target: o }) => o === this.lockTarget);
66
+ if (n = n.filter(({ target: o }) => o !== this.lockTarget), !e || n.some(
67
+ ({ options: o }) => {
68
+ var i;
69
+ return (o == null ? void 0 : o.container) === ((i = e.options) == null ? void 0 : i.container);
70
+ }
71
+ ))
72
+ return;
73
+ const t = ((l = this.options) == null ? void 0 : l.container) || document.body, r = t.className;
74
+ a.test(r) && (f(d.get(t), { element: t }), d.delete(t), t.className = t.className.replace(a, "").trim());
75
+ });
76
+ this.lockTarget = u++, this.options = e;
77
+ }
78
+ }
79
+ export {
80
+ T as default
81
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(o){var t;return(t=o==null?void 0:o.getRootNode)==null?void 0:t.call(o)}function r(o){return n(o)instanceof ShadowRoot}function u(o){return r(o)?n(o):null}exports.getShadowRoot=u;exports.inShadow=r;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Check if is in shadowRoot
3
+ */
4
+ export declare function inShadow(ele: Node): boolean;
5
+ /**
6
+ * Return shadowRoot if possible
7
+ */
8
+ export declare function getShadowRoot(ele: Node): ShadowRoot | null;
@@ -0,0 +1,14 @@
1
+ function n(o) {
2
+ var t;
3
+ return (t = o == null ? void 0 : o.getRootNode) == null ? void 0 : t.call(o);
4
+ }
5
+ function r(o) {
6
+ return n(o) instanceof ShadowRoot;
7
+ }
8
+ function u(o) {
9
+ return r(o) ? n(o) : null;
10
+ }
11
+ export {
12
+ u as getShadowRoot,
13
+ r as inShadow
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./canUseDom.cjs");function o(t){if(i.default()&&window.document.documentElement){const n=Array.isArray(t)?t:[t],{documentElement:r}=window.document;return n.some(e=>e in r.style)}return!1}function u(t,n){if(!o(t))return!1;const r=document.createElement("div"),e=r.style[t];return r.style[t]=n,r.style[t]!==e}function c(t,n){return!Array.isArray(t)&&n!==void 0?u(t,n):o(t)}exports.isStyleSupport=c;
@@ -0,0 +1,2 @@
1
+ export declare function isStyleSupport(styleName: string | string[]): boolean;
2
+ export declare function isStyleSupport(styleName: string, styleValue: any): boolean;
@@ -0,0 +1,20 @@
1
+ import i from "./canUseDom.js";
2
+ function e(n) {
3
+ if (i() && window.document.documentElement) {
4
+ const r = Array.isArray(n) ? n : [n], { documentElement: t } = window.document;
5
+ return r.some((o) => o in t.style);
6
+ }
7
+ return !1;
8
+ }
9
+ function u(n, r) {
10
+ if (!e(n))
11
+ return !1;
12
+ const t = document.createElement("div"), o = t.style[n];
13
+ return t.style[n] = r, t.style[n] !== o;
14
+ }
15
+ function s(n, r) {
16
+ return !Array.isArray(n) && r !== void 0 ? u(n, r) : e(n);
17
+ }
18
+ export {
19
+ s as isStyleSupport
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./canUseDom.cjs"),a={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd",animation:"animationend"},r={WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionend"};function o(n){const e=document.createElement("div");for(const t in n)if(n.hasOwnProperty(t)&&e.style[t]!==void 0)return{end:n[t]};return!1}const s=i.default()&&o(a),d=i.default()&&o(r);exports.animation=s;exports.transition=d;