@gx-design-vue/pro-utils 0.2.0-alpha.2 → 0.2.0-alpha.3
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/array/index.js +1 -2
- package/dist/array/slice.js +1 -3
- package/dist/array/sort.js +1 -3
- package/dist/array/tree.d.ts +2 -2
- package/dist/array/tree.js +1 -3
- package/dist/array/unique.js +1 -2
- package/dist/base64/index.js +1 -2
- package/dist/class/index.js +1 -2
- package/dist/class/prefix.js +1 -2
- package/dist/clone/cloneDeep.js +1 -3
- package/dist/clone/cloneDeepWith.js +1 -3
- package/dist/clone/getTag.js +1 -2
- package/dist/clone/index.js +1 -2
- package/dist/clone/symbols.js +1 -2
- package/dist/clone/tags.js +1 -2
- package/dist/dom/event.js +1 -2
- package/dist/dom/index.js +1 -2
- package/dist/dom/measure.js +1 -3
- package/dist/dom/raf.js +1 -2
- package/dist/dom/scroll.js +1 -3
- package/dist/file/config.js +6 -2
- package/dist/file/convert.js +1 -2
- package/dist/file/index.js +1 -2
- package/dist/file/media.js +1 -3
- package/dist/file/type.js +1 -3
- package/dist/function/copy.js +1 -2
- package/dist/function/getValue.js +1 -2
- package/dist/function/index.js +1 -2
- package/dist/function/object.js +1 -2
- package/dist/function/run.js +1 -2
- package/dist/index.d.ts +0 -7
- package/dist/index.js +2 -3
- package/dist/is/base64.js +1 -2
- package/dist/is/browser.js +1 -2
- package/dist/is/deepEqual.js +1 -2
- package/dist/is/device.js +1 -2
- package/dist/is/equal.js +1 -2
- package/dist/is/img.js +1 -2
- package/dist/is/index.js +1 -2
- package/dist/is/nil.js +1 -2
- package/dist/is/plainObject.js +1 -3
- package/dist/is/primitive.js +1 -2
- package/dist/is/server.js +1 -2
- package/dist/is/type.js +1 -2
- package/dist/is/typedArray.js +1 -2
- package/dist/is/unsafeProperty.js +1 -2
- package/dist/is/url.js +1 -2
- package/dist/is/valid.js +1 -2
- package/dist/merge/index.js +25 -7
- package/dist/merge/mergeWith.js +1 -3
- package/dist/merge/useDeepMege.js +1 -3
- package/dist/number/chinese.js +1 -3
- package/dist/number/format.js +1 -3
- package/dist/number/index.js +1 -2
- package/dist/object/classNames.js +1 -4
- package/dist/object/index.js +2 -3
- package/dist/object/omitBoolean.js +1 -2
- package/dist/object/omitUndefined.js +1 -2
- package/dist/object/omitUndefinedAndEmptyArr.js +1 -2
- package/dist/pro-utils.esm.js +366 -242
- package/dist/pro-utils.js +1 -1
- package/dist/string/duration.js +1 -2
- package/dist/string/empty.js +1 -2
- package/dist/string/index.js +1 -2
- package/dist/string/nanoid.js +1 -2
- package/dist/string/uuid.js +23 -2
- package/dist/table/column.js +1 -3
- package/dist/table/index.js +1 -2
- package/dist/table/page.js +1 -3
- package/dist/typing.js +1 -1
- package/dist/vue/index.js +1 -2
- package/dist/vue/slots.d.ts +2 -2
- package/dist/vue/slots.js +1 -3
- package/package.json +1 -1
package/dist/array/index.js
CHANGED
|
@@ -2,5 +2,4 @@ import { arraySlice } from "./slice.js";
|
|
|
2
2
|
import { compareArray, compareArraySort, compareArrayTimeSort, compareTime } from "./sort.js";
|
|
3
3
|
import { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData } from "./tree.js";
|
|
4
4
|
import { arrayUnique } from "./unique.js";
|
|
5
|
-
|
|
6
|
-
export { arraySlice, arrayUnique, compareArray, compareArraySort, compareArrayTimeSort, compareTime, filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
|
|
5
|
+
export { arraySlice, arrayUnique, compareArray, compareArraySort, compareArrayTimeSort, compareTime, filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
|
package/dist/array/slice.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isArray, isNumber } from "../is/type.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/array/slice.ts
|
|
5
4
|
/**
|
|
6
5
|
* 数组切片,根据范围筛选数组元素
|
|
@@ -24,6 +23,5 @@ function arraySlice(data, range) {
|
|
|
24
23
|
return true;
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
|
-
export { arraySlice };
|
|
27
|
+
export { arraySlice };
|
package/dist/array/sort.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isNumber } from "../is/type.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/array/sort.ts
|
|
5
4
|
/**
|
|
6
5
|
* 比较数组元素(用于排序)
|
|
@@ -60,6 +59,5 @@ function compareArraySort(dataSource, key, sort = 0) {
|
|
|
60
59
|
function compareArrayTimeSort(dataSource, key, sort = 0) {
|
|
61
60
|
return dataSource.sort((a, b) => compareTime(a, b, key, sort));
|
|
62
61
|
}
|
|
63
|
-
|
|
64
62
|
//#endregion
|
|
65
|
-
export { compareArray, compareArraySort, compareArrayTimeSort, compareTime };
|
|
63
|
+
export { compareArray, compareArraySort, compareArrayTimeSort, compareTime };
|
package/dist/array/tree.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ declare function filterTree<T = any>(tree: T[], predicate: (val: T) => boolean):
|
|
|
48
48
|
* @returns 祖先节点值数组
|
|
49
49
|
*/
|
|
50
50
|
declare function findValueAndAncestors<T = any>(tree: T[], targetValue: any, fieldNames?: {
|
|
51
|
-
value:
|
|
52
|
-
children:
|
|
51
|
+
value: keyof T;
|
|
52
|
+
children: keyof T;
|
|
53
53
|
}): any[];
|
|
54
54
|
/**
|
|
55
55
|
* 树形数组递归查找指定对象
|
package/dist/array/tree.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isArray, isObject } from "../is/type.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/array/tree.ts
|
|
5
4
|
/**
|
|
6
5
|
* 获取树形结构最深的层级数
|
|
@@ -152,6 +151,5 @@ function getSortIndex(data = [], pageConfig, childrenKey = "children") {
|
|
|
152
151
|
return item;
|
|
153
152
|
});
|
|
154
153
|
}
|
|
155
|
-
|
|
156
154
|
//#endregion
|
|
157
|
-
export { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
|
|
155
|
+
export { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
|
package/dist/array/unique.js
CHANGED
package/dist/base64/index.js
CHANGED
package/dist/class/index.js
CHANGED
package/dist/class/prefix.js
CHANGED
|
@@ -10,6 +10,5 @@ function getPrefixCls({ suffixCls, customizePrefixCls, isPor, className }) {
|
|
|
10
10
|
if (customizePrefixCls) return customizePrefixCls;
|
|
11
11
|
return suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
//#endregion
|
|
15
|
-
export { getPrefixCls };
|
|
14
|
+
export { getPrefixCls };
|
package/dist/clone/cloneDeep.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cloneDeepWithImpl } from "./cloneDeepWith.js";
|
|
2
|
-
|
|
3
2
|
//#region src/clone/cloneDeep.ts
|
|
4
3
|
/**
|
|
5
4
|
* 深度克隆对象
|
|
@@ -30,6 +29,5 @@ import { cloneDeepWithImpl } from "./cloneDeepWith.js";
|
|
|
30
29
|
function cloneDeep(obj) {
|
|
31
30
|
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
//#endregion
|
|
35
|
-
export { cloneDeep };
|
|
33
|
+
export { cloneDeep };
|
|
@@ -4,7 +4,6 @@ import "../is/index.js";
|
|
|
4
4
|
import { getTag } from "./getTag.js";
|
|
5
5
|
import { getSymbols } from "./symbols.js";
|
|
6
6
|
import { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from "./tags.js";
|
|
7
|
-
|
|
8
7
|
//#region src/clone/cloneDeepWith.ts
|
|
9
8
|
/**
|
|
10
9
|
* 深度克隆对象(带自定义处理)
|
|
@@ -145,6 +144,5 @@ function isCloneableObject(object) {
|
|
|
145
144
|
default: return false;
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
|
|
149
147
|
//#endregion
|
|
150
|
-
export { cloneDeepWith, cloneDeepWithImpl, copyProperties };
|
|
148
|
+
export { cloneDeepWith, cloneDeepWithImpl, copyProperties };
|
package/dist/clone/getTag.js
CHANGED
package/dist/clone/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { cloneDeepWith, cloneDeepWithImpl, copyProperties } from "./cloneDeepWith.js";
|
|
2
2
|
import { cloneDeep } from "./cloneDeep.js";
|
|
3
|
-
|
|
4
|
-
export { cloneDeep, cloneDeepWith, cloneDeepWithImpl, copyProperties };
|
|
3
|
+
export { cloneDeep, cloneDeepWith, cloneDeepWithImpl, copyProperties };
|
package/dist/clone/symbols.js
CHANGED
package/dist/clone/tags.js
CHANGED
|
@@ -43,6 +43,5 @@ const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
|
|
|
43
43
|
const uint16ArrayTag = "[object Uint16Array]";
|
|
44
44
|
/** Uint32 数组标签 */
|
|
45
45
|
const uint32ArrayTag = "[object Uint32Array]";
|
|
46
|
-
|
|
47
46
|
//#endregion
|
|
48
|
-
export { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };
|
|
47
|
+
export { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };
|
package/dist/dom/event.js
CHANGED
|
@@ -21,6 +21,5 @@ function on(element, event, handler, useCapture = false) {
|
|
|
21
21
|
function off(element, event, handler, useCapture = false) {
|
|
22
22
|
if (element && event && handler) element.removeEventListener(event, handler, useCapture);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
//#endregion
|
|
26
|
-
export { off, on };
|
|
25
|
+
export { off, on };
|
package/dist/dom/index.js
CHANGED
|
@@ -2,5 +2,4 @@ import { off, on } from "./event.js";
|
|
|
2
2
|
import { getTextWidth } from "./measure.js";
|
|
3
3
|
import wrapperRaf from "./raf.js";
|
|
4
4
|
import { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo } from "./scroll.js";
|
|
5
|
-
|
|
6
|
-
export { easeInOutCubic, getScroll, getScrollContainer, getTextWidth, isInContainer, isScroll, isWindow, off, on, wrapperRaf as raf, scrollTo };
|
|
5
|
+
export { easeInOutCubic, getScroll, getScrollContainer, getTextWidth, isInContainer, isScroll, isWindow, off, on, wrapperRaf as raf, scrollTo };
|
package/dist/dom/measure.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isBoolean, isObject } from "../is/type.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/dom/measure.ts
|
|
5
4
|
/**
|
|
6
5
|
* 获取文字宽度或高度
|
|
@@ -37,6 +36,5 @@ function getTextWidth(str, options) {
|
|
|
37
36
|
if (removeAfter) targetEl.removeChild(sourceEl);
|
|
38
37
|
return number;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
|
-
export { getTextWidth };
|
|
40
|
+
export { getTextWidth };
|
package/dist/dom/raf.js
CHANGED
package/dist/dom/scroll.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isServer } from "../is/server.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
3
|
import wrapperRaf from "./raf.js";
|
|
4
|
-
|
|
5
4
|
//#region src/dom/scroll.ts
|
|
6
5
|
function easeInOutCubic(t, b, c, d) {
|
|
7
6
|
const cc = c - b;
|
|
@@ -92,6 +91,5 @@ function scrollTo(y, options = {}) {
|
|
|
92
91
|
};
|
|
93
92
|
if (container) wrapperRaf(frameFunc);
|
|
94
93
|
}
|
|
95
|
-
|
|
96
94
|
//#endregion
|
|
97
|
-
export { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo };
|
|
95
|
+
export { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo };
|
package/dist/file/config.js
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* 文件类型配置
|
|
4
4
|
*/
|
|
5
5
|
const fileTypes = {
|
|
6
|
+
/** 允许的视频格式 */
|
|
6
7
|
videoAllowType: [
|
|
7
8
|
"mp4",
|
|
8
9
|
"webm",
|
|
9
10
|
"ogg"
|
|
10
11
|
],
|
|
12
|
+
/** 允许的音频格式 */
|
|
11
13
|
audioAllowType: [
|
|
12
14
|
"mp3",
|
|
13
15
|
"ogg",
|
|
@@ -16,6 +18,7 @@ const fileTypes = {
|
|
|
16
18
|
"m4a",
|
|
17
19
|
"webm"
|
|
18
20
|
],
|
|
21
|
+
/** 图片格式 */
|
|
19
22
|
imageType: [
|
|
20
23
|
"jpeg",
|
|
21
24
|
"jpg",
|
|
@@ -37,6 +40,7 @@ const fileTypes = {
|
|
|
37
40
|
"psd",
|
|
38
41
|
"eps"
|
|
39
42
|
],
|
|
43
|
+
/** 视频格式 */
|
|
40
44
|
videoType: [
|
|
41
45
|
"mp4",
|
|
42
46
|
"avi",
|
|
@@ -59,6 +63,7 @@ const fileTypes = {
|
|
|
59
63
|
"divx",
|
|
60
64
|
"xvid"
|
|
61
65
|
],
|
|
66
|
+
/** 音频格式 */
|
|
62
67
|
audioType: [
|
|
63
68
|
"mp3",
|
|
64
69
|
"wav",
|
|
@@ -76,6 +81,5 @@ const fileTypes = {
|
|
|
76
81
|
"ape"
|
|
77
82
|
]
|
|
78
83
|
};
|
|
79
|
-
|
|
80
84
|
//#endregion
|
|
81
|
-
export { fileTypes };
|
|
85
|
+
export { fileTypes };
|
package/dist/file/convert.js
CHANGED
|
@@ -64,6 +64,5 @@ function dataURLtoFile(url, filename) {
|
|
|
64
64
|
function blobToDataURL(blob, fileName, fileType) {
|
|
65
65
|
return new window.File([blob], fileName, { type: fileType });
|
|
66
66
|
}
|
|
67
|
-
|
|
68
67
|
//#endregion
|
|
69
|
-
export { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl };
|
|
68
|
+
export { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl };
|
package/dist/file/index.js
CHANGED
|
@@ -2,5 +2,4 @@ import { fileTypes } from "./config.js";
|
|
|
2
2
|
import { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl } from "./convert.js";
|
|
3
3
|
import { checkFileType, getFileSuffix, getVideoFileUrl } from "./type.js";
|
|
4
4
|
import { generateVideoPicture, getMediaInfos, getVideoCoverPicture } from "./media.js";
|
|
5
|
-
|
|
6
|
-
export { blobToDataURL, checkFileType, dataURLtoBlob, dataURLtoFile, fileTypes, generateVideoPicture, getBase64, getBlobUrl, getFileSuffix, getMediaInfos, getVideoCoverPicture, getVideoFileUrl };
|
|
5
|
+
export { blobToDataURL, checkFileType, dataURLtoBlob, dataURLtoFile, fileTypes, generateVideoPicture, getBase64, getBlobUrl, getFileSuffix, getMediaInfos, getVideoCoverPicture, getVideoFileUrl };
|
package/dist/file/media.js
CHANGED
|
@@ -2,7 +2,6 @@ import { isBase64 } from "../is/base64.js";
|
|
|
2
2
|
import "../is/index.js";
|
|
3
3
|
import { fileTypes } from "./config.js";
|
|
4
4
|
import { checkFileType, getFileSuffix } from "./type.js";
|
|
5
|
-
|
|
6
5
|
//#region src/file/media.ts
|
|
7
6
|
/**
|
|
8
7
|
* 获取媒体信息(图片/视频/音频)
|
|
@@ -156,6 +155,5 @@ async function generateVideoPicture(videoUrl, currentTime = 0) {
|
|
|
156
155
|
}
|
|
157
156
|
});
|
|
158
157
|
}
|
|
159
|
-
|
|
160
158
|
//#endregion
|
|
161
|
-
export { generateVideoPicture, getMediaInfos, getVideoCoverPicture };
|
|
159
|
+
export { generateVideoPicture, getMediaInfos, getVideoCoverPicture };
|
package/dist/file/type.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isBase64 } from "../is/base64.js";
|
|
2
2
|
import "../is/index.js";
|
|
3
3
|
import { fileTypes } from "./config.js";
|
|
4
|
-
|
|
5
4
|
//#region src/file/type.ts
|
|
6
5
|
/**
|
|
7
6
|
* 获取文件后缀名
|
|
@@ -53,6 +52,5 @@ function checkFileType(url, type) {
|
|
|
53
52
|
if (fileTypes.audioType.includes(fileType)) return "2";
|
|
54
53
|
return "4";
|
|
55
54
|
}
|
|
56
|
-
|
|
57
55
|
//#endregion
|
|
58
|
-
export { checkFileType, getFileSuffix, getVideoFileUrl };
|
|
56
|
+
export { checkFileType, getFileSuffix, getVideoFileUrl };
|
package/dist/function/copy.js
CHANGED
package/dist/function/index.js
CHANGED
|
@@ -2,5 +2,4 @@ import { forInObject, getSymbols, keysOf } from "./object.js";
|
|
|
2
2
|
import { deepCopy } from "./copy.js";
|
|
3
3
|
import { getValueFromObjectByKey } from "./getValue.js";
|
|
4
4
|
import { runFunction } from "./run.js";
|
|
5
|
-
|
|
6
|
-
export { deepCopy, forInObject, getSymbols, getValueFromObjectByKey, keysOf, runFunction };
|
|
5
|
+
export { deepCopy, forInObject, getSymbols, getValueFromObjectByKey, keysOf, runFunction };
|
package/dist/function/object.js
CHANGED
package/dist/function/run.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { compareArray, compareArraySort, compareArrayTimeSort, compareTime } fro
|
|
|
3
3
|
import { AlignType, BasicTablePageConfig, Breakpoint, CustomRender, DeepPartial, EmptyEmit, ExtendIfDefined, Fn, LimitDeepPartial, MediaOptions, Nullable, OmitUndefined, RecordType, SemanticClassNames, SemanticStyles, SizeType, VueNode, WithFalse, WithIfDefault, WithRequired } from "./typing.js";
|
|
4
4
|
import { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData } from "./array/tree.js";
|
|
5
5
|
import { arrayUnique } from "./array/unique.js";
|
|
6
|
-
import "./array/index.js";
|
|
7
6
|
import { PrefixCls, getPrefixCls } from "./class/prefix.js";
|
|
8
7
|
import { cloneDeep } from "./clone/cloneDeep.js";
|
|
9
8
|
import { cloneDeepWith, cloneDeepWithImpl, copyProperties } from "./clone/cloneDeepWith.js";
|
|
@@ -11,17 +10,14 @@ import { off, on } from "./dom/event.js";
|
|
|
11
10
|
import { getTextWidth } from "./dom/measure.js";
|
|
12
11
|
import wrapperRaf from "./dom/raf.js";
|
|
13
12
|
import { ScrollToOptions, easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo } from "./dom/scroll.js";
|
|
14
|
-
import "./dom/index.js";
|
|
15
13
|
import { fileTypes } from "./file/config.js";
|
|
16
14
|
import { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl } from "./file/convert.js";
|
|
17
15
|
import { generateVideoPicture, getMediaInfos, getVideoCoverPicture } from "./file/media.js";
|
|
18
16
|
import { checkFileType, getFileSuffix, getVideoFileUrl } from "./file/type.js";
|
|
19
|
-
import "./file/index.js";
|
|
20
17
|
import { deepCopy } from "./function/copy.js";
|
|
21
18
|
import { getValueFromObjectByKey } from "./function/getValue.js";
|
|
22
19
|
import { forInObject, getSymbols, keysOf } from "./function/object.js";
|
|
23
20
|
import { runFunction } from "./function/run.js";
|
|
24
|
-
import "./function/index.js";
|
|
25
21
|
import { isBase64, isDataURLBase64 } from "./is/base64.js";
|
|
26
22
|
import { isBrowser } from "./is/browser.js";
|
|
27
23
|
import { isDeepEqualReact } from "./is/deepEqual.js";
|
|
@@ -46,14 +42,11 @@ import classNames from "./object/classNames.js";
|
|
|
46
42
|
import { omitBoolean } from "./object/omitBoolean.js";
|
|
47
43
|
import { omitUndefined } from "./object/omitUndefined.js";
|
|
48
44
|
import { omitUndefinedAndEmptyArr } from "./object/omitUndefinedAndEmptyArr.js";
|
|
49
|
-
import "./object/index.js";
|
|
50
45
|
import { formatDuration } from "./string/duration.js";
|
|
51
46
|
import { handleEmptyField } from "./string/empty.js";
|
|
52
47
|
import { nanoid } from "./string/nanoid.js";
|
|
53
48
|
import { getRandomNumber } from "./string/uuid.js";
|
|
54
49
|
import { genColumnKey, handleShowIndex } from "./table/column.js";
|
|
55
50
|
import { handleCurrentPage } from "./table/page.js";
|
|
56
|
-
import "./table/index.js";
|
|
57
51
|
import { RenderResult, SlotsPropsResult, filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender } from "./vue/slots.js";
|
|
58
|
-
import "./vue/index.js";
|
|
59
52
|
export { AlignType, BasicTablePageConfig, Breakpoint, CustomRender, DeepPartial, EmptyEmit, ExtendIfDefined, Fn, LimitDeepPartial, MediaOptions, Nullable, OmitUndefined, PrefixCls, RecordType, RenderResult, ScrollToOptions, SemanticClassNames, SemanticStyles, SizeType, SlotsPropsResult, VueNode, WithFalse, WithIfDefault, WithRequired, arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import { deepMerge, merge } from "./merge/index.js";
|
|
|
43
43
|
import { toChinesNum } from "./number/chinese.js";
|
|
44
44
|
import { formatNumber, toConvertNumberShow } from "./number/format.js";
|
|
45
45
|
import "./number/index.js";
|
|
46
|
-
import
|
|
46
|
+
import classNames from "./object/classNames.js";
|
|
47
47
|
import { omitBoolean } from "./object/omitBoolean.js";
|
|
48
48
|
import { omitUndefined } from "./object/omitUndefined.js";
|
|
49
49
|
import { omitUndefinedAndEmptyArr } from "./object/omitUndefinedAndEmptyArr.js";
|
|
@@ -57,5 +57,4 @@ import { handleCurrentPage } from "./table/page.js";
|
|
|
57
57
|
import "./table/index.js";
|
|
58
58
|
import { filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender } from "./vue/slots.js";
|
|
59
59
|
import "./vue/index.js";
|
|
60
|
-
|
|
61
|
-
export { arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames_default as classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
|
|
60
|
+
export { arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
|
package/dist/is/base64.js
CHANGED
|
@@ -22,6 +22,5 @@ function isBase64(str = "") {
|
|
|
22
22
|
function isDataURLBase64(str) {
|
|
23
23
|
return typeof str === "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(str);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
//#endregion
|
|
27
|
-
export { isBase64, isDataURLBase64 };
|
|
26
|
+
export { isBase64, isDataURLBase64 };
|
package/dist/is/browser.js
CHANGED
|
@@ -9,6 +9,5 @@ function isBrowser() {
|
|
|
9
9
|
if (process.env.NODE_ENV === "TEST") return true;
|
|
10
10
|
return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.matchMedia !== "undefined" && !isNode;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
//#endregion
|
|
14
|
-
export { isBrowser };
|
|
13
|
+
export { isBrowser };
|
package/dist/is/deepEqual.js
CHANGED
package/dist/is/device.js
CHANGED
package/dist/is/equal.js
CHANGED
package/dist/is/img.js
CHANGED
package/dist/is/index.js
CHANGED
|
@@ -13,5 +13,4 @@ import { isTypedArray } from "./typedArray.js";
|
|
|
13
13
|
import { isUnsafeProperty } from "./unsafeProperty.js";
|
|
14
14
|
import { isUrl } from "./url.js";
|
|
15
15
|
import { convertValueBoolean, isValid } from "./valid.js";
|
|
16
|
-
|
|
17
|
-
export { convertValueBoolean, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEqual, isFunction, isImg, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindowsOs };
|
|
16
|
+
export { convertValueBoolean, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEqual, isFunction, isImg, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindowsOs };
|
package/dist/is/nil.js
CHANGED
package/dist/is/plainObject.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getSymbols } from "../function/object.js";
|
|
2
2
|
import { isObject } from "./type.js";
|
|
3
|
-
|
|
4
3
|
//#region src/is/plainObject.ts
|
|
5
4
|
/**
|
|
6
5
|
* 判断是否为纯对象(plain object)
|
|
@@ -25,6 +24,5 @@ function isObjectWithSymbols(value) {
|
|
|
25
24
|
if (!isObject(value)) return false;
|
|
26
25
|
return getSymbols(value).length > 0;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
//#endregion
|
|
30
|
-
export { isObjectWithSymbols, isPlainObject };
|
|
28
|
+
export { isObjectWithSymbols, isPlainObject };
|
package/dist/is/primitive.js
CHANGED
package/dist/is/server.js
CHANGED
package/dist/is/type.js
CHANGED
package/dist/is/typedArray.js
CHANGED
package/dist/is/url.js
CHANGED
package/dist/is/valid.js
CHANGED
package/dist/merge/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { cloneDeep } from "../clone/cloneDeep.js";
|
|
|
4
4
|
import "../clone/index.js";
|
|
5
5
|
import { mergeWith } from "./mergeWith.js";
|
|
6
6
|
import { useDeepMerge } from "./useDeepMege.js";
|
|
7
|
-
|
|
8
7
|
//#region src/merge/index.ts
|
|
9
8
|
/**
|
|
10
9
|
* 合并多个对象
|
|
@@ -17,7 +16,7 @@ function merge(...rest) {
|
|
|
17
16
|
const il = rest.length;
|
|
18
17
|
let key;
|
|
19
18
|
let i = 0;
|
|
20
|
-
for (; i < il; i += 1) for (key in rest[i]) if (Object.
|
|
19
|
+
for (; i < il; i += 1) for (key in rest[i]) if (Object.getOwnPropertyDescriptor(rest[i], key)) if (typeof obj[key] === "object" && typeof rest[i][key] === "object" && obj[key] !== void 0 && obj[key] !== null && !Array.isArray(obj[key]) && !Array.isArray(rest[i][key])) obj[key] = {
|
|
21
20
|
...obj[key],
|
|
22
21
|
...rest[i][key]
|
|
23
22
|
};
|
|
@@ -32,11 +31,30 @@ function merge(...rest) {
|
|
|
32
31
|
* @returns 合并后的对象
|
|
33
32
|
*/
|
|
34
33
|
function deepMerge(target, source) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const sourceStack = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
const clonedTarget = cloneDeep(target);
|
|
36
|
+
if (isPlainObject(source)) sourceStack.set(source, clonedTarget);
|
|
37
|
+
const mergedTarget = mergeWith(clonedTarget, source, function mergeRecursively(targetValue, sourceValue) {
|
|
38
|
+
if (isPlainObject(sourceValue)) {
|
|
39
|
+
const cached = sourceStack.get(sourceValue);
|
|
40
|
+
if (cached) return cached;
|
|
41
|
+
if (isPlainObject(targetValue)) {
|
|
42
|
+
const nextTarget = cloneDeep(targetValue);
|
|
43
|
+
sourceStack.set(sourceValue, nextTarget);
|
|
44
|
+
const merged = mergeWith(nextTarget, sourceValue, mergeRecursively);
|
|
45
|
+
sourceStack.delete(sourceValue);
|
|
46
|
+
return merged;
|
|
47
|
+
} else {
|
|
48
|
+
const nextTarget = {};
|
|
49
|
+
sourceStack.set(sourceValue, nextTarget);
|
|
50
|
+
const merged = mergeWith(nextTarget, sourceValue, mergeRecursively);
|
|
51
|
+
sourceStack.delete(sourceValue);
|
|
52
|
+
return merged;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
38
55
|
});
|
|
56
|
+
if (isPlainObject(source)) sourceStack.delete(source);
|
|
57
|
+
return mergedTarget;
|
|
39
58
|
}
|
|
40
|
-
|
|
41
59
|
//#endregion
|
|
42
|
-
export { deepMerge, merge, mergeWith, useDeepMerge };
|
|
60
|
+
export { deepMerge, merge, mergeWith, useDeepMerge };
|