@v-c/util 0.0.2 → 0.0.4

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 (103) hide show
  1. package/dist/Children/isFragment.d.ts +0 -1
  2. package/dist/Children/toArray.d.ts +0 -1
  3. package/dist/Dom/addEventListener.cjs +1 -1
  4. package/dist/Dom/addEventListener.d.ts +2 -2
  5. package/dist/Dom/addEventListener.js +5 -6
  6. package/dist/Dom/dynamicCSS.cjs +1 -1
  7. package/dist/Dom/dynamicCSS.d.ts +1 -1
  8. package/dist/Dom/dynamicCSS.js +33 -34
  9. package/dist/Dom/findDOMNode.d.ts +0 -1
  10. package/dist/Dom/scrollLocker.cjs +1 -1
  11. package/dist/Dom/scrollLocker.js +59 -76
  12. package/dist/Dom/shadow.cjs +1 -1
  13. package/dist/Dom/shadow.js +8 -9
  14. package/dist/Portal.cjs +1 -1
  15. package/dist/Portal.js +14 -21
  16. package/dist/PortalWrapper.cjs +1 -1
  17. package/dist/PortalWrapper.d.ts +2 -3
  18. package/dist/PortalWrapper.js +39 -42
  19. package/dist/composeProps.cjs +1 -1
  20. package/dist/composeProps.js +8 -11
  21. package/dist/createRef.d.ts +0 -1
  22. package/dist/debug/diff.d.ts +1 -1
  23. package/dist/getScrollBarSize.cjs +1 -1
  24. package/dist/getScrollBarSize.js +14 -14
  25. package/dist/hooks/useEvent.cjs +1 -0
  26. package/dist/hooks/useEvent.d.ts +1 -0
  27. package/dist/hooks/useEvent.js +6 -0
  28. package/dist/hooks/useId.cjs +1 -1
  29. package/dist/hooks/useId.d.ts +1 -5
  30. package/dist/hooks/useId.js +8 -13
  31. package/dist/hooks/useLayoutEffect.cjs +1 -0
  32. package/dist/hooks/useLayoutEffect.d.ts +3 -0
  33. package/dist/hooks/useLayoutEffect.js +28 -0
  34. package/dist/hooks/useMemo.d.ts +0 -1
  35. package/dist/hooks/useMergedState.cjs +1 -1
  36. package/dist/hooks/useMergedState.d.ts +0 -1
  37. package/dist/hooks/useMergedState.js +16 -16
  38. package/dist/hooks/useMobile.cjs +1 -0
  39. package/dist/hooks/useMobile.d.ts +2 -0
  40. package/dist/hooks/useMobile.js +14 -0
  41. package/dist/hooks/useState.d.ts +0 -1
  42. package/dist/isMobile.cjs +1 -1
  43. package/dist/isMobile.js +4 -4
  44. package/dist/isValid.cjs +1 -0
  45. package/dist/isValid.d.ts +2 -0
  46. package/dist/isValid.js +6 -0
  47. package/dist/pickAttrs.cjs +1 -1
  48. package/dist/pickAttrs.js +1 -1
  49. package/dist/props-util/index.cjs +1 -1
  50. package/dist/props-util/index.d.ts +6 -1
  51. package/dist/props-util/index.js +21 -9
  52. package/dist/props-util/initDefaultProps.cjs +1 -0
  53. package/dist/props-util/initDefaultProps.d.ts +8 -0
  54. package/dist/props-util/initDefaultProps.js +13 -0
  55. package/dist/setStyle.d.ts +0 -1
  56. package/dist/type.d.ts +2 -3
  57. package/dist/utils/checkSlotProp.cjs +1 -1
  58. package/dist/utils/checkSlotProp.js +3 -4
  59. package/dist/utils/omit.cjs +1 -0
  60. package/dist/utils/omit.d.ts +1 -0
  61. package/dist/utils/omit.js +9 -0
  62. package/dist/utils/set.cjs +1 -1
  63. package/dist/utils/set.d.ts +1 -0
  64. package/dist/utils/set.js +1 -0
  65. package/dist/utils/transition.cjs +1 -0
  66. package/dist/utils/transition.d.ts +18 -0
  67. package/dist/utils/transition.js +79 -0
  68. package/dist/vnode.cjs +1 -1
  69. package/dist/vnode.d.ts +1 -2
  70. package/dist/vnode.js +14 -15
  71. package/dist/vueuse/unref-element.cjs +1 -0
  72. package/dist/vueuse/unref-element.d.ts +8 -0
  73. package/dist/vueuse/unref-element.js +8 -0
  74. package/package.json +1 -1
  75. package/src/Children/tests/isFragment.test.tsx +1 -1
  76. package/src/Children/tests/toArray.test.tsx +3 -3
  77. package/src/Dom/addEventListener.ts +2 -2
  78. package/src/Dom/focus.ts +1 -1
  79. package/src/Dom/scrollLocker.ts +5 -4
  80. package/src/KeyCode.ts +2 -1
  81. package/src/Portal.tsx +1 -1
  82. package/src/PortalWrapper.tsx +9 -6
  83. package/src/createRef.ts +0 -1
  84. package/src/hooks/useEvent.ts +3 -0
  85. package/src/hooks/useId.ts +13 -24
  86. package/src/hooks/useLayoutEffect.ts +61 -0
  87. package/src/hooks/useMobile.ts +16 -0
  88. package/src/isMobile.ts +1 -1
  89. package/src/isValid.ts +4 -0
  90. package/src/pickAttrs.ts +3 -2
  91. package/src/props-util/index.ts +57 -22
  92. package/src/props-util/initDefaultProps.ts +34 -0
  93. package/src/test/domHook.ts +1 -2
  94. package/src/type.ts +2 -2
  95. package/src/utils/omit.ts +9 -0
  96. package/src/utils/set.ts +1 -1
  97. package/src/utils/transition.ts +128 -0
  98. package/src/vnode.ts +2 -2
  99. package/src/vueuse/unref-element.ts +13 -0
  100. package/tsconfig.json +3 -2
  101. package/vite.config.ts +1 -1
  102. package/vitest.config.ts +11 -0
  103. package/tests/{Portal.test.tsx → Portal.spec.tsx} +2 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let d;function u(n){if(typeof document>"u")return 0;if(n||d===void 0){const e=document.createElement("div");e.style.width="100%",e.style.height="200px";const t=document.createElement("div"),i=t.style;i.position="absolute",i.top="0",i.left="0",i.pointerEvents="none",i.visibility="hidden",i.width="200px",i.height="150px",i.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const l=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;l===o&&(o=t.clientWidth),document.body.removeChild(t),d=l-o}return d}function r(n){const e=n.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?u():t}function c(n){if(typeof document>"u"||!n||!(n instanceof Element))return{width:0,height:0};const{width:e,height:t}=getComputedStyle(n,"::-webkit-scrollbar");return{width:r(e),height:r(t)}}exports.default=u;exports.getTargetScrollBarSize=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let d;function c(n){if(typeof document>"u")return 0;if(n||d===void 0){const t=document.createElement("div");t.style.width="100%",t.style.height="200px";const e=document.createElement("div"),i=e.style;i.position="absolute",i.top="0",i.left="0",i.pointerEvents="none",i.visibility="hidden",i.width="200px",i.height="150px",i.overflow="hidden",e.appendChild(t),document.body.appendChild(e);const l=t.offsetWidth;e.style.overflow="scroll";let o=t.offsetWidth;l===o&&(o=e.clientWidth),document.body.removeChild(e),d=l-o}return d}function r(n){const t=n.match(/^(.*)px$/),e=Number(t?.[1]);return Number.isNaN(e)?c():e}function u(n){if(typeof document>"u"||!n||!(n instanceof Element))return{width:0,height:0};const{width:t,height:e}=getComputedStyle(n,"::-webkit-scrollbar");return{width:r(t),height:r(e)}}exports.default=c;exports.getTargetScrollBarSize=u;
@@ -2,20 +2,20 @@ let d;
2
2
  function c(i) {
3
3
  if (typeof document > "u") return 0;
4
4
  if (i || d === void 0) {
5
- const e = document.createElement("div");
6
- e.style.width = "100%", e.style.height = "200px";
7
- const t = document.createElement("div"), n = t.style;
8
- n.position = "absolute", n.top = "0", n.left = "0", n.pointerEvents = "none", n.visibility = "hidden", n.width = "200px", n.height = "150px", n.overflow = "hidden", t.appendChild(e), document.body.appendChild(t);
9
- const l = e.offsetWidth;
10
- t.style.overflow = "scroll";
11
- let o = e.offsetWidth;
12
- l === o && (o = t.clientWidth), document.body.removeChild(t), d = l - o;
5
+ const t = document.createElement("div");
6
+ t.style.width = "100%", t.style.height = "200px";
7
+ const e = document.createElement("div"), n = e.style;
8
+ n.position = "absolute", n.top = "0", n.left = "0", n.pointerEvents = "none", n.visibility = "hidden", n.width = "200px", n.height = "150px", n.overflow = "hidden", e.appendChild(t), document.body.appendChild(e);
9
+ const l = t.offsetWidth;
10
+ e.style.overflow = "scroll";
11
+ let o = t.offsetWidth;
12
+ l === o && (o = e.clientWidth), document.body.removeChild(e), d = l - o;
13
13
  }
14
14
  return d;
15
15
  }
16
16
  function r(i) {
17
- const e = i.match(/^(.*)px$/), t = Number(e == null ? void 0 : e[1]);
18
- return Number.isNaN(t) ? c() : t;
17
+ const t = i.match(/^(.*)px$/), e = Number(t?.[1]);
18
+ return Number.isNaN(e) ? c() : e;
19
19
  }
20
20
  function h(i) {
21
21
  if (typeof document > "u" || !i || !(i instanceof Element)) return {
@@ -23,12 +23,12 @@ function h(i) {
23
23
  height: 0
24
24
  };
25
25
  const {
26
- width: e,
27
- height: t
26
+ width: t,
27
+ height: e
28
28
  } = getComputedStyle(i, "::-webkit-scrollbar");
29
29
  return {
30
- width: r(e),
31
- height: r(t)
30
+ width: r(t),
31
+ height: r(e)
32
32
  };
33
33
  }
34
34
  export {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(e){return e}exports.default=t;
@@ -0,0 +1 @@
1
+ export default function useEvent<T extends Function>(callback: T): T;
@@ -0,0 +1,6 @@
1
+ function t(e) {
2
+ return e;
3
+ }
4
+ export {
5
+ t as default
6
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),i=require("../Dom/canUseDom.cjs");let t=0;const r=process.env.NODE_ENV!=="test"&&i.default();function u(){let e;return r?(e=t,t+=1):e="TEST_OR_SSR",e}function o(e=s.ref("")){const n=`vc_unique_${u()}`;return e.value||n}exports.default=o;exports.getUUID=u;exports.isBrowserClient=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue");function r(){return u.useId}const n=r();function s(e){const t=n();return e||(process.env.NODE_ENV==="test"?"test-id":t)}exports.default=s;
@@ -1,5 +1 @@
1
- /** Is client side and not jsdom */
2
- export declare const isBrowserClient: boolean;
3
- /** Get unique id for accessibility usage */
4
- export declare function getUUID(): number | string;
5
- export default function useId(id?: import('vue').Ref<string, string>): string;
1
+ export default function (id?: string): string;
@@ -1,17 +1,12 @@
1
- import { ref as n } from "vue";
2
- import o from "../Dom/canUseDom.js";
3
- let t = 0;
4
- const s = process.env.NODE_ENV !== "test" && o();
5
- function u() {
6
- let e;
7
- return s ? (e = t, t += 1) : e = "TEST_OR_SSR", e;
1
+ import { useId as r } from "vue";
2
+ function s() {
3
+ return r;
8
4
  }
9
- function f(e = n("")) {
10
- const r = `vc_unique_${u()}`;
11
- return e.value || r;
5
+ const n = s();
6
+ function o(e) {
7
+ const t = n();
8
+ return e || (process.env.NODE_ENV === "test" ? "test-id" : t);
12
9
  }
13
10
  export {
14
- f as default,
15
- u as getUUID,
16
- s as isBrowserClient
11
+ o as default
17
12
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue");function o(e,n=[]){let t=null;n&&n.length?f.watch(n,async()=>{t&&t?.(),await f.nextTick(),typeof e=="function"&&(t=e())},{immediate:!0,flush:"post"}):(f.onMounted(()=>{t&&t?.(),typeof e=="function"&&(t=e())}),f.onUpdated(()=>{t&&t?.(),typeof e=="function"&&(t=e())})),f.onUnmounted(()=>{t&&t?.()})}function i(e,n){let t=null;f.watch(n,async()=>{t&&t?.(),await f.nextTick(),typeof e=="function"&&(t=e())},{flush:"post"})}exports.useLayoutEffect=o;exports.useLayoutUpdateEffect=i;
@@ -0,0 +1,3 @@
1
+ import { WatchSource } from 'vue';
2
+ export declare function useLayoutEffect(callback: Function, deps?: WatchSource<unknown>[]): void;
3
+ export declare function useLayoutUpdateEffect(callback: Function, deps: WatchSource<unknown>[]): void;
@@ -0,0 +1,28 @@
1
+ import { watch as o, nextTick as e, onMounted as i, onUpdated as u, onUnmounted as s } from "vue";
2
+ function y(f, n = []) {
3
+ let t = null;
4
+ n && n.length ? o(n, async () => {
5
+ t && t?.(), await e(), typeof f == "function" && (t = f());
6
+ }, {
7
+ immediate: !0,
8
+ flush: "post"
9
+ }) : (i(() => {
10
+ t && t?.(), typeof f == "function" && (t = f());
11
+ }), u(() => {
12
+ t && t?.(), typeof f == "function" && (t = f());
13
+ })), s(() => {
14
+ t && t?.();
15
+ });
16
+ }
17
+ function m(f, n) {
18
+ let t = null;
19
+ o(n, async () => {
20
+ t && t?.(), await e(), typeof f == "function" && (t = f());
21
+ }, {
22
+ flush: "post"
23
+ });
24
+ }
25
+ export {
26
+ y as useLayoutEffect,
27
+ m as useLayoutUpdateEffect
28
+ };
@@ -1,3 +1,2 @@
1
1
  import { Ref, WatchSource } from 'vue';
2
-
3
2
  export default function useMemo<T>(getValue: () => T, condition: (WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T, T>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue");function g(f,e){const{defaultValue:r,value:l=a.ref()}=e||{};let t=typeof f=="function"?f():f;l.value!==void 0&&(t=a.unref(l)),r!==void 0&&(t=typeof r=="function"?r():r);const c=a.ref(t),v=a.ref(t);a.watchEffect(()=>{let u=l.value!==void 0?l.value:c.value;e!=null&&e.postState&&(u=e.postState(u)),v.value=u});function s(u){const n=v.value;c.value=u,a.toRaw(v.value)!==u&&(e!=null&&e.onChange)&&e.onChange(u,n)}return a.watch(l,()=>{c.value=l.value}),[v,s]}exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");function c(v,a){const{defaultValue:l,value:u=t.ref()}=a||{};let n=typeof v=="function"?v():v;u.value!==void 0&&(n=t.unref(u)),l!==void 0&&(n=typeof l=="function"?l():l);const f=t.ref(n),r=t.ref(n);t.watchEffect(()=>{let e=u.value!==void 0?u.value:f.value;a?.postState&&(e=a.postState(e)),r.value=e});function i(e){const o=r.value;f.value=e,t.toRaw(r.value)!==e&&a?.onChange&&a.onChange(e,o)}return t.watch(u,()=>{f.value=u.value}),[r,i]}exports.default=c;
@@ -1,5 +1,4 @@
1
1
  import { ComputedRef, Ref, UnwrapRef } from 'vue';
2
-
3
2
  export default function useMergedState<T, R = Ref<T>>(defaultStateValue: T | (() => T), option?: {
4
3
  defaultValue?: T | (() => T);
5
4
  value?: Ref<T> | Ref<UnwrapRef<T>> | ComputedRef<T>;
@@ -1,21 +1,21 @@
1
- import { ref as c, unref as g, watchEffect as d, watch as h, toRaw as i } from "vue";
2
- function C(r, e) {
3
- const { defaultValue: f, value: u = c() } = e || {};
4
- let l = typeof r == "function" ? r() : r;
5
- u.value !== void 0 && (l = g(u)), f !== void 0 && (l = typeof f == "function" ? f() : f);
6
- const t = c(l), v = c(l);
7
- d(() => {
8
- let a = u.value !== void 0 ? u.value : t.value;
9
- e != null && e.postState && (a = e.postState(a)), v.value = a;
1
+ import { ref as o, unref as c, watchEffect as s, watch as g, toRaw as d } from "vue";
2
+ function m(l, t) {
3
+ const { defaultValue: u, value: a = o() } = t || {};
4
+ let n = typeof l == "function" ? l() : l;
5
+ a.value !== void 0 && (n = c(a)), u !== void 0 && (n = typeof u == "function" ? u() : u);
6
+ const v = o(n), f = o(n);
7
+ s(() => {
8
+ let e = a.value !== void 0 ? a.value : v.value;
9
+ t?.postState && (e = t.postState(e)), f.value = e;
10
10
  });
11
- function n(a) {
12
- const s = v.value;
13
- t.value = a, i(v.value) !== a && (e != null && e.onChange) && e.onChange(a, s);
11
+ function r(e) {
12
+ const i = f.value;
13
+ v.value = e, d(f.value) !== e && t?.onChange && t.onChange(e, i);
14
14
  }
15
- return h(u, () => {
16
- t.value = u.value;
17
- }), [v, n];
15
+ return g(a, () => {
16
+ v.value = a.value;
17
+ }), [f, r];
18
18
  }
19
19
  export {
20
- C as default
20
+ m as default
21
21
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue"),l=require("../isMobile.cjs");function o(){const e=u.shallowRef(!1);return u.onMounted(()=>{e.value=l.default()}),u.onUpdated(()=>{e.value=l.default()}),e}exports.default=o;exports.useMobile=o;
@@ -0,0 +1,2 @@
1
+ export declare function useMobile(): import('vue').ShallowRef<boolean, boolean>;
2
+ export default useMobile;
@@ -0,0 +1,14 @@
1
+ import { shallowRef as l, onMounted as t, onUpdated as a } from "vue";
2
+ import e from "../isMobile.js";
3
+ function r() {
4
+ const o = l(!1);
5
+ return t(() => {
6
+ o.value = e();
7
+ }), a(() => {
8
+ o.value = e();
9
+ }), o;
10
+ }
11
+ export {
12
+ r as default,
13
+ r as useMobile
14
+ };
@@ -1,3 +1,2 @@
1
1
  import { Ref } from 'vue';
2
-
3
2
  export default function useState<T, R = Ref<T>>(defaultStateValue?: T | (() => T)): [R, (val: T) => void];
package/dist/isMobile.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=()=>{if(typeof navigator>"u"||typeof window>"u")return!1;const i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=()=>{if(typeof navigator>"u"||typeof window>"u")return!1;const e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([\- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ \-/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([\- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[23]|n30(0|2)|n50([025])|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8c]))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([\-01])|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e?.substr(0,4))};exports.default=i;
package/dist/isMobile.js CHANGED
@@ -1,13 +1,13 @@
1
- const o = () => {
1
+ const a = () => {
2
2
  if (typeof navigator > "u" || typeof window > "u")
3
3
  return !1;
4
4
  const i = navigator.userAgent || navigator.vendor || window.opera;
5
5
  return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
6
6
  i
7
- ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
8
- i == null ? void 0 : i.substr(0, 4)
7
+ ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([\- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ \-/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([\- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[23]|n30(0|2)|n50([025])|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8c]))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([\-01])|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
8
+ i?.substr(0, 4)
9
9
  );
10
10
  };
11
11
  export {
12
- o as default
12
+ a as default
13
13
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(e){return e!=null&&e!==""}exports.default=t;
@@ -0,0 +1,2 @@
1
+ declare function isValid(value: any): boolean;
2
+ export default isValid;
@@ -0,0 +1,6 @@
1
+ function n(i) {
2
+ return i != null && i !== "";
3
+ }
4
+ export {
5
+ n as default
6
+ };
@@ -15,4 +15,4 @@
15
15
  onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
16
16
  onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
17
17
  onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
18
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,l=`${s} ${i}`.split(/[\s\n]+/),d="aria-",c="data-";function r(a,n){return a.indexOf(n)===0}function u(a,n=!1){let e;n===!1?e={aria:!0,data:!0,attr:!0}:n===!0?e={aria:!0}:e={...n};const t={};return Object.keys(a).forEach(o=>{(e.aria&&(o==="role"||r(o,d))||e.data&&r(o,c)||e.attr&&l.includes(o))&&(t[o]=a[o])}),t}exports.default=u;
18
+ onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,l=`${s} ${i}`.split(/\s+/),d="aria-",c="data-";function r(a,n){return a.indexOf(n)===0}function u(a,n=!1){let e;n===!1?e={aria:!0,data:!0,attr:!0}:n===!0?e={aria:!0}:e={...n};const t={};return Object.keys(a).forEach(o=>{(e.aria&&(o==="role"||r(o,d))||e.data&&r(o,c)||e.attr&&l.includes(o))&&(t[o]=a[o])}),t}exports.default=u;
package/dist/pickAttrs.js CHANGED
@@ -15,7 +15,7 @@ const s = `accept acceptCharset accessKey action allowFullScreen allowTransparen
15
15
  onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
16
16
  onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
17
17
  onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
18
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, l = `${s} ${i}`.split(/[\s\n]+/), c = "aria-", d = "data-";
18
+ onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, l = `${s} ${i}`.split(/\s+/), c = "aria-", d = "data-";
19
19
  function r(a, n) {
20
20
  return a.indexOf(n) === 0;
21
21
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue");function s(t){return t&&(t.type===Comment||t.type===n.Fragment&&t.children.length===0||t.type===Text&&t.children.trim()==="")}function m(t=[]){const r=[];return t.forEach(e=>{Array.isArray(e)?r.push(...e):(e==null?void 0:e.type)===n.Fragment?r.push(...m(e.children)):r.push(e)}),r.filter(e=>!s(e))}exports.filterEmpty=m;exports.isEmptyElement=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),i=require("../isValid.cjs"),y=require("./initDefaultProps.cjs");function o(t){return t&&(t.type===u.Comment||t.type===u.Fragment&&t.children.length===0||t.type===u.Text&&t.children.trim()==="")}function p(t=[]){const r=[];return t.forEach(s=>{Array.isArray(s)?r.push(...s):s?.type===u.Fragment?r.push(...p(s.children)):r.push(s)}),r.filter(s=>!o(s))}const f=Symbol("skipFlatten");function a(t,r=!0){const s=Array.isArray(t)?t:[t],n=[];return s.forEach(e=>{Array.isArray(e)?n.push(...a(e,r)):i.default(e)?n.push(e):e&&typeof e=="object"&&e.type===u.Fragment?e.key===f?n.push(e):n.push(...a(e.children,r)):e&&u.isVNode(e)&&(r&&!o(e)?n.push(e):r||n.push(e))}),n}exports.initDefaultProps=y.default;exports.filterEmpty=p;exports.flattenChildren=a;exports.isEmptyElement=o;exports.skipFlattenKey=f;
@@ -1,2 +1,7 @@
1
- export declare function isEmptyElement(c: any): any;
1
+ import { VNode, VNodeNormalizedChildren } from 'vue';
2
+ import { default as initDefaultProps } from './initDefaultProps';
3
+ export declare function isEmptyElement(c: any): boolean;
2
4
  export declare function filterEmpty(children?: any[]): any[];
5
+ export declare const skipFlattenKey: unique symbol;
6
+ declare function flattenChildren(children?: VNode | VNodeNormalizedChildren, filterEmpty?: boolean): any[];
7
+ export { flattenChildren, initDefaultProps };
@@ -1,14 +1,26 @@
1
- import { Fragment as n } from "vue";
2
- function p(t) {
3
- return t && (t.type === Comment || t.type === n && t.children.length === 0 || t.type === Text && t.children.trim() === "");
1
+ import { Comment as u, Fragment as o, Text as a, isVNode as y } from "vue";
2
+ import m from "../isValid.js";
3
+ import { default as g } from "./initDefaultProps.js";
4
+ function f(t) {
5
+ return t && (t.type === u || t.type === o && t.children.length === 0 || t.type === a && t.children.trim() === "");
4
6
  }
5
- function m(t = []) {
7
+ function i(t = []) {
6
8
  const r = [];
7
- return t.forEach((e) => {
8
- Array.isArray(e) ? r.push(...e) : (e == null ? void 0 : e.type) === n ? r.push(...m(e.children)) : r.push(e);
9
- }), r.filter((e) => !p(e));
9
+ return t.forEach((s) => {
10
+ Array.isArray(s) ? r.push(...s) : s?.type === o ? r.push(...i(s.children)) : r.push(s);
11
+ }), r.filter((s) => !f(s));
12
+ }
13
+ const A = Symbol("skipFlatten");
14
+ function p(t, r = !0) {
15
+ const s = Array.isArray(t) ? t : [t], n = [];
16
+ return s.forEach((e) => {
17
+ Array.isArray(e) ? n.push(...p(e, r)) : m(e) ? n.push(e) : e && typeof e == "object" && e.type === o ? e.key === A ? n.push(e) : n.push(...p(e.children, r)) : e && y(e) && (r && !f(e) ? n.push(e) : r || n.push(e));
18
+ }), n;
10
19
  }
11
20
  export {
12
- m as filterEmpty,
13
- p as isEmptyElement
21
+ i as filterEmpty,
22
+ p as flattenChildren,
23
+ g as initDefaultProps,
24
+ f as isEmptyElement,
25
+ A as skipFlattenKey
14
26
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function i(f,o){const r={...f};return Object.keys(o).forEach(t=>{const e=r[t];if(e)e.type||e.default?e.default=o[t]:e.def?e.def(o[t]):r[t]={type:e,default:o[t]};else throw new Error(`not have ${t} prop`)}),r}exports.default=i;
@@ -0,0 +1,8 @@
1
+ import { PropType } from 'vue';
2
+ import { VueTypeDef, VueTypeValidableDef } from 'vue-types';
3
+ declare function initDefaultProps<T>(types: T, defaultProps: {
4
+ [K in keyof T]?: T[K] extends VueTypeValidableDef<infer U> ? U : T[K] extends VueTypeDef<infer U> ? U : T[K] extends {
5
+ type: PropType<infer U>;
6
+ } ? U : any;
7
+ }): T;
8
+ export default initDefaultProps;
@@ -0,0 +1,13 @@
1
+ function n(r, f) {
2
+ const o = { ...r };
3
+ return Object.keys(f).forEach((t) => {
4
+ const e = o[t];
5
+ if (e)
6
+ e.type || e.default ? e.default = f[t] : e.def ? e.def(f[t]) : o[t] = { type: e, default: f[t] };
7
+ else
8
+ throw new Error(`not have ${t} prop`);
9
+ }), o;
10
+ }
11
+ export {
12
+ n as default
13
+ };
@@ -1,5 +1,4 @@
1
1
  import { CSSProperties } from 'vue';
2
-
3
2
  export interface SetStyleOptions {
4
3
  element?: HTMLElement;
5
4
  }
package/dist/type.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Plugin, PropType, Ref, SlotsType, VNode } from 'vue';
2
-
1
+ import { Component, Plugin, PropType, Ref, SlotsType, VNode } from 'vue';
3
2
  export declare const tuple: <T extends string[]>(...args: T) => T;
4
3
  export declare const tupleNum: <T extends number[]>(...args: T) => T;
5
4
  /**
@@ -20,7 +19,7 @@ export interface PropOptions<T = any, D = T> {
20
19
  default?: D | DefaultFactory<D> | null | undefined | object;
21
20
  validator?: (value: unknown) => boolean;
22
21
  }
23
- declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
22
+ declare type VNodeChildAtom = Component | VNode | string | number | null | undefined | void;
24
23
  export type VueNode = VNodeChildAtom | VNodeChildAtom[] | VNode;
25
24
  export declare function withInstall<T>(comp: T): T & Plugin;
26
25
  export type MaybeRef<T> = T | Ref<T>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t,e,u,...i){var c,f;return e[u]?(c=e[u])==null?void 0:c.call(e,...i):u in t?typeof t[u]=="function"?(f=t[u])==null?void 0:f.call(t,...i):t[u]:null}exports.checkSlotProp=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(r,u,t,...e){return u[t]?u[t]?.(...e):t in r?typeof r[t]=="function"?r[t]?.(...e):r[t]:null}exports.checkSlotProp=i;
@@ -1,7 +1,6 @@
1
- function e(u, i, f, ...n) {
2
- var c, t;
3
- return i[f] ? (c = i[f]) == null ? void 0 : c.call(i, ...n) : f in u ? typeof u[f] == "function" ? (t = u[f]) == null ? void 0 : t.call(u, ...n) : u[f] : null;
1
+ function r(u, f, t, ...i) {
2
+ return f[t] ? f[t]?.(...i) : t in u ? typeof u[t] == "function" ? u[t]?.(...i) : u[t] : null;
4
3
  }
5
4
  export {
6
- e as checkSlotProp
5
+ r as checkSlotProp
7
6
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,o){const t={...e};return o.forEach(r=>{delete t[r]}),t}exports.omit=i;
@@ -0,0 +1 @@
1
+ export declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
@@ -0,0 +1,9 @@
1
+ function n(e, o) {
2
+ const t = { ...e };
3
+ return o.forEach((r) => {
4
+ delete t[r];
5
+ }), t;
6
+ }
7
+ export {
8
+ n as omit
9
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./get.cjs");function g(e,t,o,l){if(!t.length)return o;const[r,...f]=t;let n;return!e&&typeof r=="number"?n=[]:Array.isArray(e)?n=[...e]:n={...e},l&&o===void 0&&f.length===1?delete n[r][f[0]]:n[r]=g(n[r],f,o,l),n}function i(e,t,o,l=!1){return t.length&&l&&o===void 0&&!u.default(e,t.slice(0,-1))?e:g(e,t,o,l)}function b(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return Array.isArray(e)?[]:{}}const A=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function O(...e){let t=y(e[0]);return e.forEach(o=>{function l(r,f){const n=new Set(f),c=u.default(o,r),s=Array.isArray(c);if(s||b(c)){if(!n.has(c)){n.add(c);const a=u.default(t,r);s?t=i(t,r,[]):(!a||typeof a!="object")&&(t=i(t,r,y(c))),A(c).forEach(d=>{l([...r,d],n)})}}else t=i(t,r,c)}l([])}),t}exports.default=i;exports.merge=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./get.cjs");function g(e,t,o,l){if(!t.length)return o;const[r,...f]=t;let n;return!e&&typeof r=="number"?n=[]:Array.isArray(e)?n=[...e]:n={...e},l&&o===void 0&&f.length===1?delete n[r][f[0]]:n[r]=g(n[r],f,o,l),n}function i(e,t,o,l=!1){return t.length&&l&&o===void 0&&!s.default(e,t.slice(0,-1))?e:g(e,t,o,l)}function d(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return Array.isArray(e)?[]:{}}const A=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function O(...e){let t=y(e[0]);return e.forEach(o=>{function l(r,f){const n=new Set(f),c=s.default(o,r),u=Array.isArray(c);if(u||d(c)){if(!n.has(c)){n.add(c);const a=s.default(t,r);u?t=i(t,r,[]):(!a||typeof a!="object")&&(t=i(t,r,y(c))),A(c).forEach(b=>{l([...r,b],n)})}}else t=i(t,r,c)}l([])}),t}exports.default=i;exports.isObject=d;exports.merge=O;
@@ -1,5 +1,6 @@
1
1
  export type Path = (string | number | symbol)[];
2
2
  export default function set<Entity = any, Output = Entity, Value = any>(entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean): Output;
3
+ export declare function isObject(obj: any): boolean;
3
4
  /**
4
5
  * Merge objects which will create
5
6
  */
package/dist/utils/set.js CHANGED
@@ -37,5 +37,6 @@ function j(...e) {
37
37
  }
38
38
  export {
39
39
  l as default,
40
+ b as isObject,
40
41
  j as merge
41
42
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function v(e){return e!==void 0&&(e==="topLeft"||e==="topRight")?"slide-down":"slide-up"}function u(e,r={}){return e?e?{name:e,appear:!0,enterFromClass:`${e}-enter ${e}-enter-prepare ${e}-enter-start`,enterActiveClass:`${e}-enter ${e}-enter-prepare`,enterToClass:`${e}-enter ${e}-enter-active`,leaveFromClass:` ${e}-leave`,leaveActiveClass:`${e}-leave ${e}-leave-active`,leaveToClass:`${e}-leave ${e}-leave-active`,...r}:{css:!1,...r}:{}}function c(e,r={}){return e?{name:e,appear:!0,appearActiveClass:`${e}`,appearToClass:`${e}-appear ${e}-appear-active`,enterFromClass:`${e}-appear ${e}-enter ${e}-appear-prepare ${e}-enter-prepare`,enterActiveClass:`${e}`,enterToClass:`${e}-enter ${e}-appear ${e}-appear-active ${e}-enter-active`,leaveActiveClass:`${e} ${e}-leave`,leaveToClass:`${e}-leave-active`,...r}:{css:!1,...r}}const o=()=>({height:0,opacity:0}),$=e=>({height:`${e.scrollHeight}px`,opacity:1}),s=e=>({height:`${e.offsetHeight}px`});function a(e="ant-motion-collapse",r,p){return{name:e,appear:!0,css:!0,onBeforeEnter:t=>{p.value=e,r.value=o()},onEnter:t=>{l.nextTick(()=>{r.value=$(t)})},onAfterEnter:()=>{p.value="",r.value={}},onBeforeLeave:t=>{p.value=e,r.value=s(t)},onLeave:t=>{setTimeout(()=>{r.value=o()})},onAfterLeave:()=>{p.value="",r.value={}}}}function n(e,r,p){return p!==void 0?p:`${e}-${r}`}exports.collapseMotion=a;exports.getTransitionDirection=v;exports.getTransitionGroupProps=c;exports.getTransitionName=n;exports.getTransitionProps=u;
@@ -0,0 +1,18 @@
1
+ import { BaseTransitionProps, CSSProperties, Ref, TransitionGroupProps, TransitionProps } from 'vue';
2
+ declare const SelectPlacements: ["bottomLeft", "bottomRight", "topLeft", "topRight"];
3
+ export type SelectCommonPlacement = (typeof SelectPlacements)[number];
4
+ declare function getTransitionDirection(placement: SelectCommonPlacement | undefined): "slide-down" | "slide-up";
5
+ export declare function getTransitionProps(transitionName?: string, opt?: TransitionProps): TransitionProps;
6
+ export declare function getTransitionGroupProps(transitionName: string, opt?: TransitionProps): TransitionGroupProps;
7
+ export declare type MotionEvent = (TransitionEvent | AnimationEvent) & {
8
+ deadline?: boolean;
9
+ };
10
+ export declare type MotionEventHandler = (element: Element, done?: () => void) => CSSProperties;
11
+ export declare type MotionEndEventHandler = (element: Element, done?: () => void) => boolean | void;
12
+ export interface CSSMotionProps extends Partial<BaseTransitionProps<Element>> {
13
+ name?: string;
14
+ css?: boolean;
15
+ }
16
+ declare function collapseMotion(name: string, style: Ref<CSSProperties>, className: Ref<string>): CSSMotionProps;
17
+ declare function getTransitionName(rootPrefixCls: string, motion: string, transitionName?: string): string;
18
+ export { collapseMotion, getTransitionDirection, getTransitionName };
@@ -0,0 +1,79 @@
1
+ import { nextTick as o } from "vue";
2
+ function c(e) {
3
+ return e !== void 0 && (e === "topLeft" || e === "topRight") ? "slide-down" : "slide-up";
4
+ }
5
+ function a(e, r = {}) {
6
+ return e ? e ? {
7
+ name: e,
8
+ appear: !0,
9
+ // type: 'animation',
10
+ // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
11
+ // appearActiveClass: `antdv-base-transtion`,
12
+ // appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
13
+ enterFromClass: `${e}-enter ${e}-enter-prepare ${e}-enter-start`,
14
+ enterActiveClass: `${e}-enter ${e}-enter-prepare`,
15
+ enterToClass: `${e}-enter ${e}-enter-active`,
16
+ leaveFromClass: ` ${e}-leave`,
17
+ leaveActiveClass: `${e}-leave ${e}-leave-active`,
18
+ leaveToClass: `${e}-leave ${e}-leave-active`,
19
+ ...r
20
+ } : { css: !1, ...r } : {};
21
+ }
22
+ function s(e, r = {}) {
23
+ return e ? {
24
+ name: e,
25
+ appear: !0,
26
+ // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
27
+ appearActiveClass: `${e}`,
28
+ appearToClass: `${e}-appear ${e}-appear-active`,
29
+ enterFromClass: `${e}-appear ${e}-enter ${e}-appear-prepare ${e}-enter-prepare`,
30
+ enterActiveClass: `${e}`,
31
+ enterToClass: `${e}-enter ${e}-appear ${e}-appear-active ${e}-enter-active`,
32
+ leaveActiveClass: `${e} ${e}-leave`,
33
+ leaveToClass: `${e}-leave-active`,
34
+ ...r
35
+ } : { css: !1, ...r };
36
+ }
37
+ const l = () => ({ height: 0, opacity: 0 }), t = (e) => ({
38
+ height: `${e.scrollHeight}px`,
39
+ opacity: 1
40
+ }), u = (e) => ({ height: `${e.offsetHeight}px` });
41
+ function f(e = "ant-motion-collapse", r, p) {
42
+ return {
43
+ name: e,
44
+ appear: !0,
45
+ css: !0,
46
+ onBeforeEnter: (v) => {
47
+ p.value = e, r.value = l();
48
+ },
49
+ onEnter: (v) => {
50
+ o(() => {
51
+ r.value = t(v);
52
+ });
53
+ },
54
+ onAfterEnter: () => {
55
+ p.value = "", r.value = {};
56
+ },
57
+ onBeforeLeave: (v) => {
58
+ p.value = e, r.value = u(v);
59
+ },
60
+ onLeave: (v) => {
61
+ setTimeout(() => {
62
+ r.value = l();
63
+ });
64
+ },
65
+ onAfterLeave: () => {
66
+ p.value = "", r.value = {};
67
+ }
68
+ };
69
+ }
70
+ function g(e, r, p) {
71
+ return p !== void 0 ? p : `${e}-${r}`;
72
+ }
73
+ export {
74
+ f as collapseMotion,
75
+ c as getTransitionDirection,
76
+ s as getTransitionGroupProps,
77
+ g as getTransitionName,
78
+ a as getTransitionProps
79
+ };
package/dist/vnode.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),f=require("./props-util/index.cjs"),p=require("./warning.cjs");function s(e,r={},t=!0,u=!1){let n=e;if(Array.isArray(e)&&(n=f.filterEmpty(e)[0]),!n)return null;const i=o.cloneVNode(n,r,u);return i.props=t?{...i.props,...r}:i.props,p.warningOnce(typeof i.props.class!="object","class must be string"),i}function a(e,r={},t=!0){return e.map(u=>s(u,r,t))}function c(e,r={},t=!0,u=!1){if(Array.isArray(e))return e.map(n=>c(n,r,t,u));{if(!o.isVNode(e))return e;const n=s(e,r,t,u);return Array.isArray(n.children)&&(n.children=c(n.children)),n}}function d(e,r,t){o.render(o.cloneVNode(e,{...r}),t)}function l(e){return(e||[]).some(r=>o.isVNode(r)?!(r.type===o.Comment||r.type===o.Fragment&&!l(r.children)):!0)?e:null}function m(e,r,t,u){var i;const n=(i=e[r])==null?void 0:i.call(e,t);return l(n)?n:u==null?void 0:u()}exports.cloneElement=s;exports.cloneVNodes=a;exports.customRenderSlot=m;exports.deepCloneElement=c;exports.triggerVNodeUpdate=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),a=require("./props-util/index.cjs"),f=require("./warning.cjs");function s(e,r={},n=!0,u=!1){let t=e;if(Array.isArray(e)&&(t=a.filterEmpty(e)[0]),!t)return null;const i=o.cloneVNode(t,r,u);return i.props=n?{...i.props,...r}:i.props,f.warningOnce(typeof i.props.class!="object","class must be string"),i}function p(e,r={},n=!0){return e.map(u=>s(u,r,n))}function l(e,r={},n=!0,u=!1){if(Array.isArray(e))return e.map(t=>l(t,r,n,u));{if(!o.isVNode(e))return e;const t=s(e,r,n,u);return Array.isArray(t.children)&&(t.children=l(t.children)),t}}function d(e,r,n){o.render(o.cloneVNode(e,{...r}),n)}function c(e){return(e||[]).some(r=>o.isVNode(r)?!(r.type===o.Comment||r.type===o.Fragment&&!c(r.children)):!0)?e:null}function m(e,r,n,u){const t=e[r]?.(n);return c(t)?t:u?.()}exports.cloneElement=s;exports.cloneVNodes=p;exports.customRenderSlot=m;exports.deepCloneElement=l;exports.triggerVNodeUpdate=d;
package/dist/vnode.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Slots, VNode, VNodeArrayChildren, VNodeProps } from 'vue';
2
2
  import { RefObject } from './createRef';
3
-
4
3
  type NodeProps = Record<string, any> & Omit<VNodeProps, 'ref'> & {
5
4
  ref?: VNodeProps['ref'] | RefObject;
6
5
  };
@@ -8,5 +7,5 @@ export declare function cloneElement<T, U>(vnode: VNode<T, U> | VNode<T, U>[], n
8
7
  export declare function cloneVNodes(vnodes: any, nodeProps?: {}, override?: boolean): any;
9
8
  export declare function deepCloneElement<T, U>(vnode: VNode<T, U> | VNode<T, U>[], nodeProps?: NodeProps, override?: boolean, mergeRef?: boolean): any;
10
9
  export declare function triggerVNodeUpdate(vm: VNode, attrs: Record<string, any>, dom: any): void;
11
- export declare function customRenderSlot(slots: Slots, name: string, props: Record<string, unknown>, fallback?: () => VNodeArrayChildren): VNodeArrayChildren | undefined;
10
+ export declare function customRenderSlot(slots: Slots, name: string, props: Record<string, unknown>, fallback?: () => VNodeArrayChildren): VNodeArrayChildren;
12
11
  export {};