@v-c/util 0.0.13 → 0.0.15
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.cjs +2 -4
- package/dist/Children/isFragment.js +3 -5
- package/dist/Children/toArray.cjs +10 -17
- package/dist/Children/toArray.js +10 -17
- package/dist/Dom/addEventListener.cjs +5 -10
- package/dist/Dom/addEventListener.js +6 -11
- package/dist/Dom/canUseDom.cjs +2 -3
- package/dist/Dom/canUseDom.js +2 -4
- package/dist/Dom/class.cjs +6 -20
- package/dist/Dom/class.js +7 -23
- package/dist/Dom/contains.cjs +9 -13
- package/dist/Dom/contains.js +9 -14
- package/dist/Dom/css.cjs +51 -66
- package/dist/Dom/css.js +52 -74
- package/dist/Dom/dynamicCSS.cjs +59 -86
- package/dist/Dom/dynamicCSS.js +58 -88
- package/dist/Dom/findDOMNode.cjs +7 -10
- package/dist/Dom/findDOMNode.js +6 -11
- package/dist/Dom/focus.cjs +36 -43
- package/dist/Dom/focus.js +37 -48
- package/dist/Dom/isVisible.cjs +16 -21
- package/dist/Dom/isVisible.js +15 -21
- package/dist/Dom/scrollLocker.cjs +66 -88
- package/dist/Dom/scrollLocker.js +64 -87
- package/dist/Dom/shadow.cjs +3 -5
- package/dist/Dom/shadow.js +4 -7
- package/dist/Dom/styleChecker.cjs +14 -18
- package/dist/Dom/styleChecker.js +14 -18
- package/dist/Dom/support.cjs +14 -22
- package/dist/Dom/support.js +12 -21
- package/dist/EventInterface.cjs +0 -1
- package/dist/EventInterface.js +0 -1
- package/dist/KeyCode.cjs +165 -522
- package/dist/KeyCode.js +164 -522
- package/dist/Portal.cjs +40 -46
- package/dist/Portal.js +37 -45
- package/dist/PortalWrapper.cjs +130 -164
- package/dist/PortalWrapper.js +126 -163
- package/dist/classnames.cjs +30 -38
- package/dist/classnames.js +30 -40
- package/dist/composeProps.cjs +15 -17
- package/dist/composeProps.js +14 -17
- package/dist/createRef.cjs +14 -16
- package/dist/createRef.js +13 -18
- package/dist/debug/diff.cjs +39 -45
- package/dist/debug/diff.js +39 -46
- package/dist/deprecated.cjs +2 -7
- package/dist/deprecated.js +2 -8
- package/dist/getScrollBarSize.cjs +39 -43
- package/dist/getScrollBarSize.js +39 -45
- package/dist/guid.cjs +3 -4
- package/dist/guid.js +3 -5
- package/dist/hooks/useEvent.cjs +2 -3
- package/dist/hooks/useEvent.js +2 -4
- package/dist/hooks/useId.cjs +10 -15
- package/dist/hooks/useId.js +9 -15
- package/dist/hooks/useLayoutEffect.cjs +29 -52
- package/dist/hooks/useLayoutEffect.js +30 -54
- package/dist/hooks/useMemo.cjs +9 -13
- package/dist/hooks/useMemo.js +8 -13
- package/dist/hooks/useMergedState.cjs +22 -27
- package/dist/hooks/useMergedState.js +22 -28
- package/dist/hooks/useMobile.cjs +13 -13
- package/dist/hooks/useMobile.js +12 -14
- package/dist/hooks/useState.cjs +7 -9
- package/dist/hooks/useState.js +6 -9
- package/dist/index.cjs +9 -11
- package/dist/index.js +5 -11
- package/dist/isEqual.cjs +26 -34
- package/dist/isEqual.js +25 -34
- package/dist/isMobile.cjs +6 -12
- package/dist/isMobile.js +5 -12
- package/dist/isValid.cjs +4 -4
- package/dist/isValid.js +3 -4
- package/dist/omit.cjs +6 -9
- package/dist/omit.js +6 -10
- package/dist/pickAttrs.cjs +20 -36
- package/dist/pickAttrs.js +20 -37
- package/dist/props-util/index.cjs +35 -52
- package/dist/props-util/index.js +35 -57
- package/dist/raf.cjs +34 -37
- package/dist/raf.js +33 -38
- package/dist/setStyle.cjs +14 -15
- package/dist/setStyle.js +13 -15
- package/dist/switchScrollingEffect.cjs +29 -35
- package/dist/switchScrollingEffect.js +27 -34
- package/dist/test/domHook.cjs +32 -46
- package/dist/test/domHook.js +33 -48
- package/dist/type.cjs +36 -17
- package/dist/type.d.ts +1 -1
- package/dist/type.js +38 -30
- package/dist/utils/checkSlotProp.cjs +6 -10
- package/dist/utils/checkSlotProp.js +7 -11
- package/dist/utils/get.cjs +7 -9
- package/dist/utils/get.js +7 -10
- package/dist/utils/omit.cjs +5 -7
- package/dist/utils/omit.js +6 -8
- package/dist/utils/set.cjs +37 -51
- package/dist/utils/set.js +36 -53
- package/dist/utils/transition.cjs +76 -80
- package/dist/utils/transition.d.ts +2 -2
- package/dist/utils/transition.js +76 -84
- package/dist/utils/watchState.cjs +12 -14
- package/dist/utils/watchState.js +13 -16
- package/dist/vnode.cjs +48 -39
- package/dist/vnode.d.ts +1 -0
- package/dist/vnode.js +47 -43
- package/dist/vueuse/unref-element.cjs +3 -5
- package/dist/vueuse/unref-element.js +3 -5
- package/dist/warning.cjs +21 -29
- package/dist/warning.js +20 -36
- package/package.json +1 -1
package/dist/pickAttrs.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
const attributes = `accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
var propList = `accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
4
3
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
5
4
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
6
5
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
@@ -11,46 +10,31 @@ const attributes = `accept acceptCharset accessKey action allowFullScreen allowT
|
|
|
11
10
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
12
11
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
13
12
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
14
|
-
summary tabIndex target title type useMap value width wmode wrap
|
|
15
|
-
const eventsName = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
13
|
+
summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
16
14
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
17
15
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
18
16
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
19
17
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
20
18
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
21
|
-
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const dataPrefix = "data-";
|
|
19
|
+
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/\s+/);
|
|
20
|
+
var ariaPrefix = "aria-";
|
|
21
|
+
var dataPrefix = "data-";
|
|
25
22
|
function match(key, prefix) {
|
|
26
|
-
|
|
23
|
+
return key.indexOf(prefix) === 0;
|
|
27
24
|
}
|
|
28
25
|
function pickAttrs(props, ariaOnly = false) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...ariaOnly
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const attrs = {};
|
|
46
|
-
Object.keys(props).forEach((key) => {
|
|
47
|
-
if (
|
|
48
|
-
// Aria
|
|
49
|
-
mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && propList.includes(key)
|
|
50
|
-
) {
|
|
51
|
-
attrs[key] = props[key];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return attrs;
|
|
26
|
+
let mergedConfig;
|
|
27
|
+
if (ariaOnly === false) mergedConfig = {
|
|
28
|
+
aria: true,
|
|
29
|
+
data: true,
|
|
30
|
+
attr: true
|
|
31
|
+
};
|
|
32
|
+
else if (ariaOnly === true) mergedConfig = { aria: true };
|
|
33
|
+
else mergedConfig = { ...ariaOnly };
|
|
34
|
+
const attrs = {};
|
|
35
|
+
Object.keys(props).forEach((key) => {
|
|
36
|
+
if (mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && propList.includes(key)) attrs[key] = props[key];
|
|
37
|
+
});
|
|
38
|
+
return attrs;
|
|
55
39
|
}
|
|
56
40
|
exports.default = pickAttrs;
|
package/dist/pickAttrs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var propList = `accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
2
2
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
3
3
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
4
4
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
@@ -9,48 +9,31 @@ const attributes = `accept acceptCharset accessKey action allowFullScreen allowT
|
|
|
9
9
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
10
10
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
11
11
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
12
|
-
summary tabIndex target title type useMap value width wmode wrap
|
|
13
|
-
const eventsName = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
12
|
+
summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
14
13
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
15
14
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
16
15
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
17
16
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
18
17
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
19
|
-
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const dataPrefix = "data-";
|
|
18
|
+
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/\s+/);
|
|
19
|
+
var ariaPrefix = "aria-";
|
|
20
|
+
var dataPrefix = "data-";
|
|
23
21
|
function match(key, prefix) {
|
|
24
|
-
|
|
22
|
+
return key.indexOf(prefix) === 0;
|
|
25
23
|
}
|
|
26
24
|
function pickAttrs(props, ariaOnly = false) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...ariaOnly
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const attrs = {};
|
|
44
|
-
Object.keys(props).forEach((key) => {
|
|
45
|
-
if (
|
|
46
|
-
// Aria
|
|
47
|
-
mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && propList.includes(key)
|
|
48
|
-
) {
|
|
49
|
-
attrs[key] = props[key];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return attrs;
|
|
25
|
+
let mergedConfig;
|
|
26
|
+
if (ariaOnly === false) mergedConfig = {
|
|
27
|
+
aria: true,
|
|
28
|
+
data: true,
|
|
29
|
+
attr: true
|
|
30
|
+
};
|
|
31
|
+
else if (ariaOnly === true) mergedConfig = { aria: true };
|
|
32
|
+
else mergedConfig = { ...ariaOnly };
|
|
33
|
+
const attrs = {};
|
|
34
|
+
Object.keys(props).forEach((key) => {
|
|
35
|
+
if (mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && propList.includes(key)) attrs[key] = props[key];
|
|
36
|
+
});
|
|
37
|
+
return attrs;
|
|
53
38
|
}
|
|
54
|
-
export {
|
|
55
|
-
pickAttrs as default
|
|
56
|
-
};
|
|
39
|
+
export { pickAttrs as default };
|
|
@@ -1,65 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const vue = require("vue");
|
|
4
|
-
const isValid = require("../isValid.cjs");
|
|
1
|
+
const require_isValid = require("../isValid.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
5
3
|
function isEmptyElement(c) {
|
|
6
|
-
|
|
4
|
+
return c && (c.type === vue.Comment || c.type === vue.Fragment && c.children.length === 0 || c.type === vue.Text && c.children.trim() === "");
|
|
7
5
|
}
|
|
8
6
|
function filterEmpty(children = []) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
return res.filter((c) => !isEmptyElement(c));
|
|
7
|
+
const res = [];
|
|
8
|
+
children.forEach((child) => {
|
|
9
|
+
if (Array.isArray(child)) res.push(...child);
|
|
10
|
+
else if (child?.type === vue.Fragment) res.push(...filterEmpty(child.children));
|
|
11
|
+
else res.push(child);
|
|
12
|
+
});
|
|
13
|
+
return res.filter((c) => !isEmptyElement(c));
|
|
18
14
|
}
|
|
19
15
|
const skipFlattenKey = Symbol("skipFlatten");
|
|
20
16
|
function flattenChildren(children, isFilterEmpty = true) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (isFilterEmpty && !isEmptyElement(child)) {
|
|
36
|
-
res.push(child);
|
|
37
|
-
} else if (!isFilterEmpty) {
|
|
38
|
-
res.push(child);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
if (isFilterEmpty) {
|
|
43
|
-
return filterEmpty(res);
|
|
44
|
-
}
|
|
45
|
-
return res;
|
|
17
|
+
const temp = Array.isArray(children) ? children : [children];
|
|
18
|
+
const res = [];
|
|
19
|
+
temp.forEach((child) => {
|
|
20
|
+
if (Array.isArray(child)) res.push(...flattenChildren(child, isFilterEmpty));
|
|
21
|
+
else if (require_isValid.default(child)) res.push(child);
|
|
22
|
+
else if (child && typeof child === "object" && child.type === vue.Fragment) if (child.key === skipFlattenKey) res.push(child);
|
|
23
|
+
else res.push(...flattenChildren(child.children, isFilterEmpty));
|
|
24
|
+
else if (child && (0, vue.isVNode)(child)) {
|
|
25
|
+
if (isFilterEmpty && !isEmptyElement(child)) res.push(child);
|
|
26
|
+
else if (!isFilterEmpty) res.push(child);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (isFilterEmpty) return filterEmpty(res);
|
|
30
|
+
return res;
|
|
46
31
|
}
|
|
47
32
|
function toPropsRefs(obj, ...args) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
const _res = {};
|
|
34
|
+
args.forEach((key) => {
|
|
35
|
+
_res[key] = (0, vue.toRef)(obj, key);
|
|
36
|
+
});
|
|
37
|
+
return _res;
|
|
53
38
|
}
|
|
54
39
|
function removeUndefined(obj) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
return res;
|
|
40
|
+
const res = {};
|
|
41
|
+
Object.keys(obj).forEach((key) => {
|
|
42
|
+
const value = obj[key];
|
|
43
|
+
if (value !== void 0) res[key] = value;
|
|
44
|
+
});
|
|
45
|
+
return res;
|
|
63
46
|
}
|
|
64
47
|
exports.filterEmpty = filterEmpty;
|
|
65
48
|
exports.flattenChildren = flattenChildren;
|
package/dist/props-util/index.js
CHANGED
|
@@ -1,69 +1,47 @@
|
|
|
1
|
+
import isValid_default from "../isValid.js";
|
|
1
2
|
import { Comment, Fragment, Text, isVNode, toRef } from "vue";
|
|
2
|
-
import isValid from "../isValid.js";
|
|
3
3
|
function isEmptyElement(c) {
|
|
4
|
-
|
|
4
|
+
return c && (c.type === Comment || c.type === Fragment && c.children.length === 0 || c.type === Text && c.children.trim() === "");
|
|
5
5
|
}
|
|
6
6
|
function filterEmpty(children = []) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
return res.filter((c) => !isEmptyElement(c));
|
|
7
|
+
const res = [];
|
|
8
|
+
children.forEach((child) => {
|
|
9
|
+
if (Array.isArray(child)) res.push(...child);
|
|
10
|
+
else if (child?.type === Fragment) res.push(...filterEmpty(child.children));
|
|
11
|
+
else res.push(child);
|
|
12
|
+
});
|
|
13
|
+
return res.filter((c) => !isEmptyElement(c));
|
|
16
14
|
}
|
|
17
15
|
const skipFlattenKey = Symbol("skipFlatten");
|
|
18
16
|
function flattenChildren(children, isFilterEmpty = true) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (isFilterEmpty && !isEmptyElement(child)) {
|
|
34
|
-
res.push(child);
|
|
35
|
-
} else if (!isFilterEmpty) {
|
|
36
|
-
res.push(child);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
if (isFilterEmpty) {
|
|
41
|
-
return filterEmpty(res);
|
|
42
|
-
}
|
|
43
|
-
return res;
|
|
17
|
+
const temp = Array.isArray(children) ? children : [children];
|
|
18
|
+
const res = [];
|
|
19
|
+
temp.forEach((child) => {
|
|
20
|
+
if (Array.isArray(child)) res.push(...flattenChildren(child, isFilterEmpty));
|
|
21
|
+
else if (isValid_default(child)) res.push(child);
|
|
22
|
+
else if (child && typeof child === "object" && child.type === Fragment) if (child.key === skipFlattenKey) res.push(child);
|
|
23
|
+
else res.push(...flattenChildren(child.children, isFilterEmpty));
|
|
24
|
+
else if (child && isVNode(child)) {
|
|
25
|
+
if (isFilterEmpty && !isEmptyElement(child)) res.push(child);
|
|
26
|
+
else if (!isFilterEmpty) res.push(child);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (isFilterEmpty) return filterEmpty(res);
|
|
30
|
+
return res;
|
|
44
31
|
}
|
|
45
32
|
function toPropsRefs(obj, ...args) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
const _res = {};
|
|
34
|
+
args.forEach((key) => {
|
|
35
|
+
_res[key] = toRef(obj, key);
|
|
36
|
+
});
|
|
37
|
+
return _res;
|
|
51
38
|
}
|
|
52
39
|
function removeUndefined(obj) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
return res;
|
|
40
|
+
const res = {};
|
|
41
|
+
Object.keys(obj).forEach((key) => {
|
|
42
|
+
const value = obj[key];
|
|
43
|
+
if (value !== void 0) res[key] = value;
|
|
44
|
+
});
|
|
45
|
+
return res;
|
|
61
46
|
}
|
|
62
|
-
export {
|
|
63
|
-
filterEmpty,
|
|
64
|
-
flattenChildren,
|
|
65
|
-
isEmptyElement,
|
|
66
|
-
removeUndefined,
|
|
67
|
-
skipFlattenKey,
|
|
68
|
-
toPropsRefs
|
|
69
|
-
};
|
|
47
|
+
export { filterEmpty, flattenChildren, isEmptyElement, removeUndefined, skipFlattenKey, toPropsRefs };
|
package/dist/raf.cjs
CHANGED
|
@@ -1,48 +1,45 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let caf = (num) => clearTimeout(num);
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
var raf = (callback) => +setTimeout(callback, 16);
|
|
3
|
+
var caf = (num) => clearTimeout(num);
|
|
5
4
|
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
raf = (callback) => window.requestAnimationFrame(callback);
|
|
6
|
+
caf = (handle) => window.cancelAnimationFrame(handle);
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var rafUUID = 0;
|
|
9
|
+
var rafIds = /* @__PURE__ */ new Map();
|
|
11
10
|
function cleanup(id) {
|
|
12
|
-
|
|
11
|
+
rafIds.delete(id);
|
|
13
12
|
}
|
|
14
13
|
function wrapperRaf(callback, times = 1) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
rafUUID += 1;
|
|
15
|
+
const id = rafUUID;
|
|
16
|
+
function callRef(leftTimes) {
|
|
17
|
+
if (leftTimes === 0) {
|
|
18
|
+
cleanup(id);
|
|
19
|
+
callback();
|
|
20
|
+
} else {
|
|
21
|
+
const realId = raf(() => {
|
|
22
|
+
callRef(leftTimes - 1);
|
|
23
|
+
});
|
|
24
|
+
rafIds.set(id, realId);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
callRef(times);
|
|
28
|
+
return id;
|
|
30
29
|
}
|
|
31
30
|
wrapperRaf.cancel = (id) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const realId = rafIds.get(id);
|
|
32
|
+
cleanup(id);
|
|
33
|
+
return caf(realId);
|
|
35
34
|
};
|
|
36
|
-
if (process.env.NODE_ENV !== "production")
|
|
37
|
-
|
|
35
|
+
if (process.env.NODE_ENV !== "production") wrapperRaf.ids = () => rafIds;
|
|
36
|
+
var raf_default = wrapperRaf;
|
|
38
37
|
function rafDebounce(fn) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
id = wrapperRaf(fn);
|
|
45
|
-
};
|
|
38
|
+
let id = null;
|
|
39
|
+
return () => {
|
|
40
|
+
if (id !== null) wrapperRaf.cancel(id);
|
|
41
|
+
id = wrapperRaf(fn);
|
|
42
|
+
};
|
|
46
43
|
}
|
|
47
|
-
exports.default =
|
|
44
|
+
exports.default = raf_default;
|
|
48
45
|
exports.rafDebounce = rafDebounce;
|
package/dist/raf.js
CHANGED
|
@@ -1,48 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var raf = (callback) => +setTimeout(callback, 16);
|
|
2
|
+
var caf = (num) => clearTimeout(num);
|
|
3
3
|
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
raf = (callback) => window.requestAnimationFrame(callback);
|
|
5
|
+
caf = (handle) => window.cancelAnimationFrame(handle);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var rafUUID = 0;
|
|
8
|
+
var rafIds = /* @__PURE__ */ new Map();
|
|
9
9
|
function cleanup(id) {
|
|
10
|
-
|
|
10
|
+
rafIds.delete(id);
|
|
11
11
|
}
|
|
12
12
|
function wrapperRaf(callback, times = 1) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
rafUUID += 1;
|
|
14
|
+
const id = rafUUID;
|
|
15
|
+
function callRef(leftTimes) {
|
|
16
|
+
if (leftTimes === 0) {
|
|
17
|
+
cleanup(id);
|
|
18
|
+
callback();
|
|
19
|
+
} else {
|
|
20
|
+
const realId = raf(() => {
|
|
21
|
+
callRef(leftTimes - 1);
|
|
22
|
+
});
|
|
23
|
+
rafIds.set(id, realId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
callRef(times);
|
|
27
|
+
return id;
|
|
28
28
|
}
|
|
29
29
|
wrapperRaf.cancel = (id) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const realId = rafIds.get(id);
|
|
31
|
+
cleanup(id);
|
|
32
|
+
return caf(realId);
|
|
33
33
|
};
|
|
34
|
-
if (process.env.NODE_ENV !== "production")
|
|
35
|
-
|
|
34
|
+
if (process.env.NODE_ENV !== "production") wrapperRaf.ids = () => rafIds;
|
|
35
|
+
var raf_default = wrapperRaf;
|
|
36
36
|
function rafDebounce(fn) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
id = wrapperRaf(fn);
|
|
43
|
-
};
|
|
37
|
+
let id = null;
|
|
38
|
+
return () => {
|
|
39
|
+
if (id !== null) wrapperRaf.cancel(id);
|
|
40
|
+
id = wrapperRaf(fn);
|
|
41
|
+
};
|
|
44
42
|
}
|
|
45
|
-
export {
|
|
46
|
-
wrapperRaf as default,
|
|
47
|
-
rafDebounce
|
|
48
|
-
};
|
|
43
|
+
export { raf_default as default, rafDebounce };
|
package/dist/setStyle.cjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
function setStyle(style, options = {}) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return oldStyle;
|
|
3
|
+
if (!style) return {};
|
|
4
|
+
const { element = document.body } = options;
|
|
5
|
+
const oldStyle = {};
|
|
6
|
+
const styleKeys = Object.keys(style);
|
|
7
|
+
styleKeys.forEach((key) => {
|
|
8
|
+
oldStyle[key] = element.style[key];
|
|
9
|
+
});
|
|
10
|
+
styleKeys.forEach((key) => {
|
|
11
|
+
element.style[key] = style[key];
|
|
12
|
+
});
|
|
13
|
+
return oldStyle;
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
var setStyle_default = setStyle;
|
|
16
|
+
exports.default = setStyle_default;
|
package/dist/setStyle.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
function setStyle(style, options = {}) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return oldStyle;
|
|
2
|
+
if (!style) return {};
|
|
3
|
+
const { element = document.body } = options;
|
|
4
|
+
const oldStyle = {};
|
|
5
|
+
const styleKeys = Object.keys(style);
|
|
6
|
+
styleKeys.forEach((key) => {
|
|
7
|
+
oldStyle[key] = element.style[key];
|
|
8
|
+
});
|
|
9
|
+
styleKeys.forEach((key) => {
|
|
10
|
+
element.style[key] = style[key];
|
|
11
|
+
});
|
|
12
|
+
return oldStyle;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
14
|
+
var setStyle_default = setStyle;
|
|
15
|
+
export { setStyle_default as default };
|