@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.
- package/dist/Children/isFragment.d.ts +0 -1
- package/dist/Children/toArray.d.ts +0 -1
- package/dist/Dom/addEventListener.cjs +1 -1
- package/dist/Dom/addEventListener.d.ts +2 -2
- package/dist/Dom/addEventListener.js +5 -6
- package/dist/Dom/dynamicCSS.cjs +1 -1
- package/dist/Dom/dynamicCSS.d.ts +1 -1
- package/dist/Dom/dynamicCSS.js +33 -34
- package/dist/Dom/findDOMNode.d.ts +0 -1
- package/dist/Dom/scrollLocker.cjs +1 -1
- package/dist/Dom/scrollLocker.js +59 -76
- package/dist/Dom/shadow.cjs +1 -1
- package/dist/Dom/shadow.js +8 -9
- package/dist/Portal.cjs +1 -1
- package/dist/Portal.js +14 -21
- package/dist/PortalWrapper.cjs +1 -1
- package/dist/PortalWrapper.d.ts +2 -3
- package/dist/PortalWrapper.js +39 -42
- package/dist/composeProps.cjs +1 -1
- package/dist/composeProps.js +8 -11
- package/dist/createRef.d.ts +0 -1
- package/dist/debug/diff.d.ts +1 -1
- package/dist/getScrollBarSize.cjs +1 -1
- package/dist/getScrollBarSize.js +14 -14
- package/dist/hooks/useEvent.cjs +1 -0
- package/dist/hooks/useEvent.d.ts +1 -0
- package/dist/hooks/useEvent.js +6 -0
- package/dist/hooks/useId.cjs +1 -1
- package/dist/hooks/useId.d.ts +1 -5
- package/dist/hooks/useId.js +8 -13
- package/dist/hooks/useLayoutEffect.cjs +1 -0
- package/dist/hooks/useLayoutEffect.d.ts +3 -0
- package/dist/hooks/useLayoutEffect.js +28 -0
- package/dist/hooks/useMemo.d.ts +0 -1
- package/dist/hooks/useMergedState.cjs +1 -1
- package/dist/hooks/useMergedState.d.ts +0 -1
- package/dist/hooks/useMergedState.js +16 -16
- package/dist/hooks/useMobile.cjs +1 -0
- package/dist/hooks/useMobile.d.ts +2 -0
- package/dist/hooks/useMobile.js +14 -0
- package/dist/hooks/useState.d.ts +0 -1
- package/dist/isMobile.cjs +1 -1
- package/dist/isMobile.js +4 -4
- package/dist/isValid.cjs +1 -0
- package/dist/isValid.d.ts +2 -0
- package/dist/isValid.js +6 -0
- package/dist/pickAttrs.cjs +1 -1
- package/dist/pickAttrs.js +1 -1
- package/dist/props-util/index.cjs +1 -1
- package/dist/props-util/index.d.ts +6 -1
- package/dist/props-util/index.js +21 -9
- package/dist/props-util/initDefaultProps.cjs +1 -0
- package/dist/props-util/initDefaultProps.d.ts +8 -0
- package/dist/props-util/initDefaultProps.js +13 -0
- package/dist/setStyle.d.ts +0 -1
- package/dist/type.d.ts +2 -3
- package/dist/utils/checkSlotProp.cjs +1 -1
- package/dist/utils/checkSlotProp.js +3 -4
- package/dist/utils/omit.cjs +1 -0
- package/dist/utils/omit.d.ts +1 -0
- package/dist/utils/omit.js +9 -0
- package/dist/utils/set.cjs +1 -1
- package/dist/utils/set.d.ts +1 -0
- package/dist/utils/set.js +1 -0
- package/dist/utils/transition.cjs +1 -0
- package/dist/utils/transition.d.ts +18 -0
- package/dist/utils/transition.js +79 -0
- package/dist/vnode.cjs +1 -1
- package/dist/vnode.d.ts +1 -2
- package/dist/vnode.js +14 -15
- package/dist/vueuse/unref-element.cjs +1 -0
- package/dist/vueuse/unref-element.d.ts +8 -0
- package/dist/vueuse/unref-element.js +8 -0
- package/package.json +1 -1
- package/src/Children/tests/isFragment.test.tsx +1 -1
- package/src/Children/tests/toArray.test.tsx +3 -3
- package/src/Dom/addEventListener.ts +2 -2
- package/src/Dom/focus.ts +1 -1
- package/src/Dom/scrollLocker.ts +5 -4
- package/src/KeyCode.ts +2 -1
- package/src/Portal.tsx +1 -1
- package/src/PortalWrapper.tsx +9 -6
- package/src/createRef.ts +0 -1
- package/src/hooks/useEvent.ts +3 -0
- package/src/hooks/useId.ts +13 -24
- package/src/hooks/useLayoutEffect.ts +61 -0
- package/src/hooks/useMobile.ts +16 -0
- package/src/isMobile.ts +1 -1
- package/src/isValid.ts +4 -0
- package/src/pickAttrs.ts +3 -2
- package/src/props-util/index.ts +57 -22
- package/src/props-util/initDefaultProps.ts +34 -0
- package/src/test/domHook.ts +1 -2
- package/src/type.ts +2 -2
- package/src/utils/omit.ts +9 -0
- package/src/utils/set.ts +1 -1
- package/src/utils/transition.ts +128 -0
- package/src/vnode.ts +2 -2
- package/src/vueuse/unref-element.ts +13 -0
- package/tsconfig.json +3 -2
- package/vite.config.ts +1 -1
- package/vitest.config.ts +11 -0
- 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
|
|
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;
|
package/dist/getScrollBarSize.js
CHANGED
|
@@ -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
|
|
6
|
-
|
|
7
|
-
const
|
|
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",
|
|
9
|
-
const l =
|
|
10
|
-
|
|
11
|
-
let o =
|
|
12
|
-
l === o && (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
|
|
18
|
-
return Number.isNaN(
|
|
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:
|
|
27
|
-
height:
|
|
26
|
+
width: t,
|
|
27
|
+
height: e
|
|
28
28
|
} = getComputedStyle(i, "::-webkit-scrollbar");
|
|
29
29
|
return {
|
|
30
|
-
width: r(
|
|
31
|
-
height: r(
|
|
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;
|
package/dist/hooks/useId.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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;
|
package/dist/hooks/useId.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
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;
|
package/dist/hooks/useId.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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,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
|
+
};
|
package/dist/hooks/useMemo.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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,21 +1,21 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const { defaultValue:
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
|
|
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
|
|
12
|
-
const
|
|
13
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
}), [
|
|
15
|
+
return g(a, () => {
|
|
16
|
+
v.value = a.value;
|
|
17
|
+
}), [f, r];
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
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,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
|
+
};
|
package/dist/hooks/useState.d.ts
CHANGED
package/dist/isMobile.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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
|
|
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-(
|
|
8
|
-
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-([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
|
-
|
|
12
|
+
a as default
|
|
13
13
|
};
|
package/dist/isValid.cjs
ADDED
|
@@ -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;
|
package/dist/isValid.js
ADDED
package/dist/pickAttrs.cjs
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
|
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
|
-
|
|
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 };
|
package/dist/props-util/index.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { Fragment as
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
7
|
+
function i(t = []) {
|
|
6
8
|
const r = [];
|
|
7
|
-
return t.forEach((
|
|
8
|
-
Array.isArray(
|
|
9
|
-
}), r.filter((
|
|
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
|
-
|
|
13
|
-
p as
|
|
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
|
+
};
|
package/dist/setStyle.d.ts
CHANGED
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 |
|
|
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
|
|
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
|
|
2
|
-
|
|
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
|
-
|
|
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>;
|
package/dist/utils/set.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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;
|
package/dist/utils/set.d.ts
CHANGED
|
@@ -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
|
@@ -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"),
|
|
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
|
|
10
|
+
export declare function customRenderSlot(slots: Slots, name: string, props: Record<string, unknown>, fallback?: () => VNodeArrayChildren): VNodeArrayChildren;
|
|
12
11
|
export {};
|