sculp-js 1.18.2 → 1.19.0
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/README.md +83 -6
- package/dist/cjs/{array.js → array.cjs} +10 -2
- package/dist/cjs/{async.js → async.cjs} +8 -2
- package/dist/cjs/{base64.js → base64.cjs} +11 -4
- package/dist/cjs/{clipboard.js → clipboard.cjs} +9 -4
- package/dist/cjs/{cloneDeep.js → cloneDeep.cjs} +6 -2
- package/dist/cjs/{cookie.js → cookie.cjs} +9 -3
- package/dist/cjs/{date.js → date.cjs} +13 -3
- package/dist/cjs/{dom.js → dom.cjs} +16 -5
- package/dist/cjs/{download.js → download.cjs} +12 -4
- package/dist/cjs/{file.js → file.cjs} +9 -3
- package/dist/cjs/{func.js → func.cjs} +10 -2
- package/dist/cjs/{index.js → index.cjs} +63 -31
- package/dist/cjs/{isEqual.js → isEqual.cjs} +6 -2
- package/dist/cjs/{math.js → math.cjs} +10 -2
- package/dist/cjs/{number.js → number.cjs} +16 -7
- package/dist/cjs/{object.js → object.cjs} +19 -5
- package/dist/cjs/{path.js → path.cjs} +7 -2
- package/dist/cjs/{qs.js → qs.cjs} +9 -4
- package/dist/cjs/{random.js → random.cjs} +11 -4
- package/dist/cjs/{string.js → string.cjs} +15 -2
- package/dist/cjs/{tooltip.js → tooltip.cjs} +8 -4
- package/dist/cjs/{tree.js → tree.cjs} +15 -4
- package/dist/cjs/{type.js → type.cjs} +27 -2
- package/dist/cjs/{unicodeToolkit.js → unicodeToolkit.cjs} +6 -2
- package/dist/cjs/{unique.js → unique.cjs} +11 -5
- package/dist/cjs/{url.js → url.cjs} +12 -5
- package/dist/cjs/{validator.js → validator.cjs} +21 -2
- package/dist/cjs/{variable.js → variable.cjs} +11 -3
- package/dist/cjs/{watermark.js → watermark.cjs} +7 -3
- package/dist/esm/{array.js → array.mjs} +9 -2
- package/dist/esm/{async.js → async.mjs} +7 -2
- package/dist/esm/{base64.js → base64.mjs} +10 -4
- package/dist/esm/{clipboard.js → clipboard.mjs} +8 -4
- package/dist/esm/{cloneDeep.js → cloneDeep.mjs} +5 -2
- package/dist/esm/{cookie.js → cookie.mjs} +8 -3
- package/dist/esm/{date.js → date.mjs} +21 -3
- package/dist/esm/{dom.js → dom.mjs} +25 -5
- package/dist/esm/{download.js → download.mjs} +11 -4
- package/dist/esm/{file.js → file.mjs} +8 -3
- package/dist/esm/{func.js → func.mjs} +9 -2
- package/dist/esm/index.mjs +191 -0
- package/dist/esm/{isEqual.js → isEqual.mjs} +5 -2
- package/dist/esm/{math.js → math.mjs} +9 -2
- package/dist/esm/{number.js → number.mjs} +23 -7
- package/dist/esm/{object.js → object.mjs} +16 -2
- package/dist/esm/{path.js → path.mjs} +6 -2
- package/dist/esm/{qs.js → qs.mjs} +8 -4
- package/dist/esm/{random.js → random.mjs} +10 -4
- package/dist/esm/{string.js → string.mjs} +14 -1
- package/dist/esm/{tooltip.js → tooltip.mjs} +7 -4
- package/dist/esm/{tree.js → tree.mjs} +24 -4
- package/dist/esm/{type.js → type.mjs} +27 -2
- package/dist/esm/{unicodeToolkit.js → unicodeToolkit.mjs} +5 -2
- package/dist/esm/{unique.js → unique.mjs} +10 -5
- package/dist/esm/{url.js → url.mjs} +11 -5
- package/dist/esm/{validator.js → validator.mjs} +20 -1
- package/dist/esm/{variable.js → variable.mjs} +10 -3
- package/dist/esm/{watermark.js → watermark.mjs} +6 -3
- package/dist/types/array.d.ts +8 -0
- package/dist/types/async.d.ts +6 -0
- package/dist/types/base64.d.ts +7 -0
- package/dist/types/clipboard.d.ts +5 -1
- package/dist/types/cloneDeep.d.ts +4 -0
- package/dist/types/cookie.d.ts +6 -0
- package/dist/types/date.d.ts +10 -0
- package/dist/types/dom.d.ts +11 -0
- package/dist/types/download.d.ts +8 -1
- package/dist/types/file.d.ts +6 -1
- package/dist/types/func.d.ts +8 -0
- package/dist/types/isEqual.d.ts +4 -0
- package/dist/types/math.d.ts +8 -1
- package/dist/types/number.d.ts +11 -2
- package/dist/types/object.d.ts +13 -0
- package/dist/types/path.d.ts +5 -0
- package/dist/types/qs.d.ts +5 -0
- package/dist/types/random.d.ts +7 -0
- package/dist/types/string.d.ts +13 -0
- package/dist/types/tooltip.d.ts +7 -0
- package/dist/types/tree.d.ts +11 -0
- package/dist/types/type.d.ts +29 -4
- package/dist/types/unicodeToolkit.d.ts +4 -0
- package/dist/types/unique.d.ts +6 -0
- package/dist/types/url.d.ts +7 -0
- package/dist/types/validator.d.ts +19 -0
- package/dist/types/variable.d.ts +8 -0
- package/dist/types/watermark.d.ts +4 -0
- package/dist/umd/index.min.js +2 -2
- package/package.json +92 -120
- package/dist/esm/index.js +0 -130
- package/dist/types/index.d.ts +0 -28
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isNumber, isDate } from './type.
|
|
7
|
+
import { isNumber, isDate } from './type.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 获取cookie
|
|
@@ -52,5 +52,10 @@ function cookieSet(name, value, maxAge) {
|
|
|
52
52
|
* @param name cookie 名称
|
|
53
53
|
*/
|
|
54
54
|
const cookieDel = name => cookieSet(name, '', -1);
|
|
55
|
+
var cookie = {
|
|
56
|
+
cookieSet,
|
|
57
|
+
cookieGet,
|
|
58
|
+
cookieDel
|
|
59
|
+
};
|
|
55
60
|
|
|
56
|
-
export { cookieDel, cookieGet, cookieSet };
|
|
61
|
+
export { cookieDel, cookieGet, cookieSet, cookie as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isDate, isNaN, isString } from './type.
|
|
7
|
+
import { isDate, isNaN, isString } from './type.mjs';
|
|
8
8
|
|
|
9
9
|
const isValidDate = any => isDate(any) && !isNaN(any.getTime());
|
|
10
10
|
/* istanbul ignore next */
|
|
@@ -208,5 +208,23 @@ function calculateDateTime(originDateTime, n, dateSep = '-', timeSep = ':') {
|
|
|
208
208
|
String(targetDateTime.getSeconds()).padStart(2, '0')
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
+
var date = {
|
|
212
|
+
isValidDate,
|
|
213
|
+
dateParse,
|
|
214
|
+
dateToStart,
|
|
215
|
+
dateToEnd,
|
|
216
|
+
formatDate,
|
|
217
|
+
calculateDate,
|
|
218
|
+
calculateDateTime
|
|
219
|
+
};
|
|
211
220
|
|
|
212
|
-
export {
|
|
221
|
+
export {
|
|
222
|
+
calculateDate,
|
|
223
|
+
calculateDateTime,
|
|
224
|
+
dateParse,
|
|
225
|
+
dateToEnd,
|
|
226
|
+
dateToStart,
|
|
227
|
+
date as default,
|
|
228
|
+
formatDate,
|
|
229
|
+
isValidDate
|
|
230
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { objectEach } from './object.
|
|
8
|
-
import { stringKebabCase } from './string.
|
|
9
|
-
import { isString, isObject } from './type.
|
|
7
|
+
import { objectEach } from './object.mjs';
|
|
8
|
+
import { stringKebabCase } from './string.mjs';
|
|
9
|
+
import { isString, isObject } from './type.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 判断元素是否包含某个样式名
|
|
@@ -146,5 +146,25 @@ function select(element) {
|
|
|
146
146
|
}
|
|
147
147
|
return selectedText;
|
|
148
148
|
}
|
|
149
|
+
var dom = {
|
|
150
|
+
hasClass,
|
|
151
|
+
addClass,
|
|
152
|
+
removeClass,
|
|
153
|
+
setStyle,
|
|
154
|
+
getStyle,
|
|
155
|
+
getComputedCssVal,
|
|
156
|
+
getStrWidthPx,
|
|
157
|
+
select
|
|
158
|
+
};
|
|
149
159
|
|
|
150
|
-
export {
|
|
160
|
+
export {
|
|
161
|
+
addClass,
|
|
162
|
+
dom as default,
|
|
163
|
+
getComputedCssVal,
|
|
164
|
+
getStrWidthPx,
|
|
165
|
+
getStyle,
|
|
166
|
+
hasClass,
|
|
167
|
+
removeClass,
|
|
168
|
+
select,
|
|
169
|
+
setStyle
|
|
170
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isNullOrUnDef, isFunction, isString } from './type.
|
|
8
|
-
import { urlSetParams } from './url.
|
|
7
|
+
import { isNullOrUnDef, isFunction, isString } from './type.mjs';
|
|
8
|
+
import { urlSetParams } from './url.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 通过打开新窗口的方式下载
|
|
@@ -127,5 +127,12 @@ function downloadData(data, fileType, filename, headers) {
|
|
|
127
127
|
downloadHref(href, filename);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
var download = {
|
|
131
|
+
downloadURL,
|
|
132
|
+
downloadHref,
|
|
133
|
+
downloadBlob,
|
|
134
|
+
crossOriginDownload,
|
|
135
|
+
downloadData
|
|
136
|
+
};
|
|
130
137
|
|
|
131
|
-
export { crossOriginDownload, downloadBlob, downloadData, downloadHref, downloadURL };
|
|
138
|
+
export { crossOriginDownload, download as default, downloadBlob, downloadData, downloadHref, downloadURL };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isObject, isNumber } from './type.
|
|
7
|
+
import { isObject, isNumber } from './type.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 判断是否支持canvas
|
|
@@ -204,5 +204,10 @@ function compressImg(file, options = { mime: 'image/jpeg', minFileSizeKB: 50 })
|
|
|
204
204
|
}
|
|
205
205
|
return Promise.resolve(null);
|
|
206
206
|
}
|
|
207
|
+
var file = {
|
|
208
|
+
supportCanvas,
|
|
209
|
+
chooseLocalFile,
|
|
210
|
+
compressImg
|
|
211
|
+
};
|
|
207
212
|
|
|
208
|
-
export { chooseLocalFile, compressImg, supportCanvas };
|
|
213
|
+
export { chooseLocalFile, compressImg, file as default, supportCanvas };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -109,5 +109,12 @@ function getGlobal(key) {
|
|
|
109
109
|
else if (typeof global !== 'undefined') return global[key];
|
|
110
110
|
else if (typeof self !== 'undefined') return self[key];
|
|
111
111
|
}
|
|
112
|
+
var func = {
|
|
113
|
+
debounce,
|
|
114
|
+
throttle,
|
|
115
|
+
once,
|
|
116
|
+
getGlobal,
|
|
117
|
+
setGlobal
|
|
118
|
+
};
|
|
112
119
|
|
|
113
|
-
export { debounce, getGlobal, once, setGlobal, throttle };
|
|
120
|
+
export { debounce, func as default, getGlobal, once, setGlobal, throttle };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
|
+
* (c) 2023-present chandq
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as array from './array.mjs';
|
|
8
|
+
export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove, diffArray } from './array.mjs';
|
|
9
|
+
import * as clipboard from './clipboard.mjs';
|
|
10
|
+
export { copyText, fallbackCopyText } from './clipboard.mjs';
|
|
11
|
+
import * as cookie from './cookie.mjs';
|
|
12
|
+
export { cookieDel, cookieGet, cookieSet } from './cookie.mjs';
|
|
13
|
+
import * as date from './date.mjs';
|
|
14
|
+
export {
|
|
15
|
+
calculateDate,
|
|
16
|
+
calculateDateTime,
|
|
17
|
+
dateParse,
|
|
18
|
+
dateToEnd,
|
|
19
|
+
dateToStart,
|
|
20
|
+
formatDate,
|
|
21
|
+
isValidDate
|
|
22
|
+
} from './date.mjs';
|
|
23
|
+
import * as dom from './dom.mjs';
|
|
24
|
+
export {
|
|
25
|
+
addClass,
|
|
26
|
+
getComputedCssVal,
|
|
27
|
+
getStrWidthPx,
|
|
28
|
+
getStyle,
|
|
29
|
+
hasClass,
|
|
30
|
+
removeClass,
|
|
31
|
+
select,
|
|
32
|
+
setStyle
|
|
33
|
+
} from './dom.mjs';
|
|
34
|
+
import * as download from './download.mjs';
|
|
35
|
+
export { crossOriginDownload, downloadBlob, downloadData, downloadHref, downloadURL } from './download.mjs';
|
|
36
|
+
import * as object from './object.mjs';
|
|
37
|
+
export {
|
|
38
|
+
isPlainObject,
|
|
39
|
+
objectAssign,
|
|
40
|
+
objectEach,
|
|
41
|
+
objectEachAsync,
|
|
42
|
+
objectFill,
|
|
43
|
+
objectGet,
|
|
44
|
+
objectMap,
|
|
45
|
+
objectAssign as objectMerge,
|
|
46
|
+
objectOmit,
|
|
47
|
+
objectPick
|
|
48
|
+
} from './object.mjs';
|
|
49
|
+
import * as path from './path.mjs';
|
|
50
|
+
export { pathJoin, pathNormalize } from './path.mjs';
|
|
51
|
+
import * as qs from './qs.mjs';
|
|
52
|
+
export { qsParse, qsStringify } from './qs.mjs';
|
|
53
|
+
import * as string from './string.mjs';
|
|
54
|
+
export {
|
|
55
|
+
STRING_ARABIC_NUMERALS,
|
|
56
|
+
STRING_LOWERCASE_ALPHA,
|
|
57
|
+
STRING_UPPERCASE_ALPHA,
|
|
58
|
+
parseQueryParams,
|
|
59
|
+
stringAssign,
|
|
60
|
+
stringCamelCase,
|
|
61
|
+
stringEscapeHtml,
|
|
62
|
+
stringFill,
|
|
63
|
+
stringFormat,
|
|
64
|
+
stringKebabCase
|
|
65
|
+
} from './string.mjs';
|
|
66
|
+
import * as type from './type.mjs';
|
|
67
|
+
export {
|
|
68
|
+
arrayLike,
|
|
69
|
+
isArray,
|
|
70
|
+
isBigInt,
|
|
71
|
+
isBoolean,
|
|
72
|
+
isDate,
|
|
73
|
+
isEmpty,
|
|
74
|
+
isError,
|
|
75
|
+
isFunction,
|
|
76
|
+
isJsonString,
|
|
77
|
+
isNaN,
|
|
78
|
+
isNodeList,
|
|
79
|
+
isNull,
|
|
80
|
+
isNullOrUnDef,
|
|
81
|
+
isNullOrUnDef as isNullish,
|
|
82
|
+
isNumber,
|
|
83
|
+
isObject,
|
|
84
|
+
isPrimitive,
|
|
85
|
+
isRegExp,
|
|
86
|
+
isString,
|
|
87
|
+
isSymbol,
|
|
88
|
+
isUndefined,
|
|
89
|
+
objectHas,
|
|
90
|
+
typeIs
|
|
91
|
+
} from './type.mjs';
|
|
92
|
+
import * as url from './url.mjs';
|
|
93
|
+
export { urlDelParams, urlParse, urlSetParams, urlStringify } from './url.mjs';
|
|
94
|
+
import * as async from './async.mjs';
|
|
95
|
+
export { asyncMap, safeAwait, wait } from './async.mjs';
|
|
96
|
+
import * as file from './file.mjs';
|
|
97
|
+
export { chooseLocalFile, compressImg, supportCanvas } from './file.mjs';
|
|
98
|
+
import * as watermark from './watermark.mjs';
|
|
99
|
+
export { genCanvasWM } from './watermark.mjs';
|
|
100
|
+
import * as func from './func.mjs';
|
|
101
|
+
export { debounce, getGlobal, once, setGlobal, throttle } from './func.mjs';
|
|
102
|
+
import * as random from './random.mjs';
|
|
103
|
+
export { STRING_POOL, randomNumber, randomString, randomUuid } from './random.mjs';
|
|
104
|
+
import * as number from './number.mjs';
|
|
105
|
+
export {
|
|
106
|
+
HEX_POOL,
|
|
107
|
+
formatMoney,
|
|
108
|
+
formatMoney as formatNumber,
|
|
109
|
+
humanFileSize,
|
|
110
|
+
numberAbbr,
|
|
111
|
+
numberToHex
|
|
112
|
+
} from './number.mjs';
|
|
113
|
+
import * as unique from './unique.mjs';
|
|
114
|
+
export { UNIQUE_NUMBER_SAFE_LENGTH, uniqueNumber, uniqueString } from './unique.mjs';
|
|
115
|
+
import * as tooltip from './tooltip.mjs';
|
|
116
|
+
export { tooltipEvent } from './tooltip.mjs';
|
|
117
|
+
import * as tree from './tree.mjs';
|
|
118
|
+
export {
|
|
119
|
+
filterDeep,
|
|
120
|
+
findDeep,
|
|
121
|
+
flatTree,
|
|
122
|
+
forEachDeep,
|
|
123
|
+
formatTree,
|
|
124
|
+
fuzzySearchTree,
|
|
125
|
+
mapDeep,
|
|
126
|
+
searchTreeById
|
|
127
|
+
} from './tree.mjs';
|
|
128
|
+
import * as math from './math.mjs';
|
|
129
|
+
export { add, divide, multiply, strip, subtract } from './math.mjs';
|
|
130
|
+
import * as base64 from './base64.mjs';
|
|
131
|
+
export { b64decode, b64encode, weAtob, weBtoa } from './base64.mjs';
|
|
132
|
+
import * as validator from './validator.mjs';
|
|
133
|
+
export {
|
|
134
|
+
EMAIL_REGEX,
|
|
135
|
+
HTTP_URL_REGEX,
|
|
136
|
+
IPV4_REGEX,
|
|
137
|
+
IPV6_REGEX,
|
|
138
|
+
PHONE_REGEX,
|
|
139
|
+
URL_REGEX,
|
|
140
|
+
isDigit,
|
|
141
|
+
isEmail,
|
|
142
|
+
isFloat,
|
|
143
|
+
isIdNo,
|
|
144
|
+
isInteger,
|
|
145
|
+
isIpV4,
|
|
146
|
+
isIpV6,
|
|
147
|
+
isNumerical,
|
|
148
|
+
isPhone,
|
|
149
|
+
isUrl
|
|
150
|
+
} from './validator.mjs';
|
|
151
|
+
import * as variable from './variable.mjs';
|
|
152
|
+
export { escapeRegExp, executeInScope, parseVarFromString, replaceVarFromString, uniqueSymbol } from './variable.mjs';
|
|
153
|
+
import * as cloneDeep from './cloneDeep.mjs';
|
|
154
|
+
export { cloneDeep } from './cloneDeep.mjs';
|
|
155
|
+
import * as isEqual from './isEqual.mjs';
|
|
156
|
+
export { isEqual } from './isEqual.mjs';
|
|
157
|
+
import * as unicodeToolkit from './unicodeToolkit.mjs';
|
|
158
|
+
export { UnicodeToolkit } from './unicodeToolkit.mjs';
|
|
159
|
+
|
|
160
|
+
var index = {
|
|
161
|
+
...array,
|
|
162
|
+
...clipboard,
|
|
163
|
+
...cookie,
|
|
164
|
+
...date,
|
|
165
|
+
...dom,
|
|
166
|
+
...download,
|
|
167
|
+
...object,
|
|
168
|
+
...path,
|
|
169
|
+
...qs,
|
|
170
|
+
...string,
|
|
171
|
+
...type,
|
|
172
|
+
...url,
|
|
173
|
+
...async,
|
|
174
|
+
...file,
|
|
175
|
+
...watermark,
|
|
176
|
+
...func,
|
|
177
|
+
...random,
|
|
178
|
+
...number,
|
|
179
|
+
...unique,
|
|
180
|
+
...tooltip,
|
|
181
|
+
...tree,
|
|
182
|
+
...math,
|
|
183
|
+
...base64,
|
|
184
|
+
...validator,
|
|
185
|
+
...variable,
|
|
186
|
+
...cloneDeep,
|
|
187
|
+
...isEqual,
|
|
188
|
+
...unicodeToolkit
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -204,5 +204,8 @@ function deepCompareObject(a, b, stack) {
|
|
|
204
204
|
}
|
|
205
205
|
return true;
|
|
206
206
|
}
|
|
207
|
+
var isEqual_default = {
|
|
208
|
+
isEqual
|
|
209
|
+
};
|
|
207
210
|
|
|
208
|
-
export { isEqual };
|
|
211
|
+
export { isEqual_default as default, isEqual };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -72,5 +72,12 @@ const divide = (arg1, arg2) => {
|
|
|
72
72
|
function strip(num, precision = 15) {
|
|
73
73
|
return +parseFloat(Number(num).toPrecision(precision));
|
|
74
74
|
}
|
|
75
|
+
var math = {
|
|
76
|
+
add,
|
|
77
|
+
subtract,
|
|
78
|
+
multiply,
|
|
79
|
+
divide,
|
|
80
|
+
strip
|
|
81
|
+
};
|
|
75
82
|
|
|
76
|
-
export { add, divide, multiply, strip, subtract };
|
|
83
|
+
export { add, math as default, divide, multiply, strip, subtract };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getGlobal } from './func.
|
|
8
|
-
import { STRING_ARABIC_NUMERALS, STRING_UPPERCASE_ALPHA, STRING_LOWERCASE_ALPHA } from './string.
|
|
9
|
-
import { isNullOrUnDef } from './type.
|
|
7
|
+
import { getGlobal } from './func.mjs';
|
|
8
|
+
import { STRING_ARABIC_NUMERALS, STRING_UPPERCASE_ALPHA, STRING_LOWERCASE_ALPHA } from './string.mjs';
|
|
9
|
+
import { isNullOrUnDef } from './type.mjs';
|
|
10
10
|
|
|
11
11
|
const HEX_POOL = `${STRING_ARABIC_NUMERALS}${STRING_UPPERCASE_ALPHA}${STRING_LOWERCASE_ALPHA}`;
|
|
12
12
|
const supportBigInt = typeof BigInt !== 'undefined';
|
|
@@ -68,9 +68,9 @@ const numberAbbr = (num, units, options = { ratio: 1000, decimals: 0, separator:
|
|
|
68
68
|
* reference: https://zh.wikipedia.org/wiki/%E5%8D%83%E5%AD%97%E8%8A%82
|
|
69
69
|
* @param {number | string} num bytes Number in Bytes
|
|
70
70
|
* @param {IHumanFileSizeOptions} options default: { decimals = 0, si = false, separator = ' ' }
|
|
71
|
-
* si: True to use metric (SI) units, aka powers of 1000,
|
|
71
|
+
* si: True to use metric (SI) units, aka powers of 1000, units is
|
|
72
72
|
* ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'].
|
|
73
|
-
* False to use binary (IEC), aka powers of 1024,
|
|
73
|
+
* False to use binary (IEC), aka powers of 1024, units is
|
|
74
74
|
* ['Byte', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
|
75
75
|
* @returns
|
|
76
76
|
*/
|
|
@@ -109,5 +109,21 @@ function formatNumber(num, decimals) {
|
|
|
109
109
|
}
|
|
110
110
|
return Number(Number(num).toFixed(prec)).toLocaleString('en-US');
|
|
111
111
|
}
|
|
112
|
+
var number = {
|
|
113
|
+
HEX_POOL,
|
|
114
|
+
numberToHex,
|
|
115
|
+
numberAbbr,
|
|
116
|
+
humanFileSize,
|
|
117
|
+
formatNumber,
|
|
118
|
+
formatMoney: formatNumber
|
|
119
|
+
};
|
|
112
120
|
|
|
113
|
-
export {
|
|
121
|
+
export {
|
|
122
|
+
HEX_POOL,
|
|
123
|
+
number as default,
|
|
124
|
+
formatNumber as formatMoney,
|
|
125
|
+
formatNumber,
|
|
126
|
+
humanFileSize,
|
|
127
|
+
numberAbbr,
|
|
128
|
+
numberToHex
|
|
129
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { isNumber, isObject, objectHas, isUndefined, isArray, typeIs as typeIs$1 } from './type.mjs';
|
|
8
8
|
|
|
9
|
+
const typeIs = typeIs$1;
|
|
9
10
|
/**
|
|
10
11
|
* 判断对象是否为纯对象
|
|
11
12
|
* @param {object} obj
|
|
@@ -191,8 +192,21 @@ function objectGet(obj, path, strict = false) {
|
|
|
191
192
|
v: tempObj ? tempObj[keyArr[i]] : undefined
|
|
192
193
|
};
|
|
193
194
|
}
|
|
195
|
+
var object = {
|
|
196
|
+
isPlainObject,
|
|
197
|
+
objectEach,
|
|
198
|
+
objectEachAsync,
|
|
199
|
+
objectMap,
|
|
200
|
+
objectPick,
|
|
201
|
+
objectOmit,
|
|
202
|
+
objectAssign,
|
|
203
|
+
objectMerge: objectAssign,
|
|
204
|
+
objectFill,
|
|
205
|
+
objectGet
|
|
206
|
+
};
|
|
194
207
|
|
|
195
208
|
export {
|
|
209
|
+
object as default,
|
|
196
210
|
isPlainObject,
|
|
197
211
|
objectAssign,
|
|
198
212
|
objectEach,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -55,5 +55,9 @@ const pathNormalize = path => {
|
|
|
55
55
|
* @returns {string}
|
|
56
56
|
*/
|
|
57
57
|
const pathJoin = (from, ...to) => pathNormalize([from, ...to].join('/'));
|
|
58
|
+
var path = {
|
|
59
|
+
pathJoin,
|
|
60
|
+
pathNormalize
|
|
61
|
+
};
|
|
58
62
|
|
|
59
|
-
export { pathJoin, pathNormalize };
|
|
63
|
+
export { path as default, pathJoin, pathNormalize };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { objectEach } from './object.
|
|
8
|
-
import {
|
|
7
|
+
import { objectEach } from './object.mjs';
|
|
8
|
+
import { isString, isNumber, isBoolean, isDate, isUndefined, isArray } from './type.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 解析查询参数,内部使用的是浏览器内置的 URLSearchParams 进行处理
|
|
@@ -57,5 +57,9 @@ function qsStringify(query, replacer = defaultReplacer) {
|
|
|
57
57
|
});
|
|
58
58
|
return params.toString();
|
|
59
59
|
}
|
|
60
|
+
var qs = {
|
|
61
|
+
qsParse,
|
|
62
|
+
qsStringify
|
|
63
|
+
};
|
|
60
64
|
|
|
61
|
-
export { qsParse, qsStringify };
|
|
65
|
+
export { qs as default, qsParse, qsStringify };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { STRING_ARABIC_NUMERALS, STRING_UPPERCASE_ALPHA, STRING_LOWERCASE_ALPHA } from './string.
|
|
8
|
-
import { isString, isNumber } from './type.
|
|
7
|
+
import { STRING_ARABIC_NUMERALS, STRING_UPPERCASE_ALPHA, STRING_LOWERCASE_ALPHA } from './string.mjs';
|
|
8
|
+
import { isString, isNumber } from './type.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 随机整数
|
|
@@ -60,5 +60,11 @@ function randomUuid() {
|
|
|
60
60
|
}
|
|
61
61
|
return /[^/]+$/.exec(URL.createObjectURL(new Blob()).slice())[0];
|
|
62
62
|
}
|
|
63
|
+
var random = {
|
|
64
|
+
STRING_POOL,
|
|
65
|
+
randomNumber,
|
|
66
|
+
randomString,
|
|
67
|
+
randomUuid
|
|
68
|
+
};
|
|
63
69
|
|
|
64
|
-
export { STRING_POOL, randomNumber, randomString, randomUuid };
|
|
70
|
+
export { STRING_POOL, random as default, randomNumber, randomString, randomUuid };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -139,11 +139,24 @@ function parseQueryParams(searchStr = location.search) {
|
|
|
139
139
|
});
|
|
140
140
|
return queryObj;
|
|
141
141
|
}
|
|
142
|
+
var string = {
|
|
143
|
+
stringCamelCase,
|
|
144
|
+
stringKebabCase,
|
|
145
|
+
STRING_ARABIC_NUMERALS,
|
|
146
|
+
STRING_LOWERCASE_ALPHA,
|
|
147
|
+
STRING_UPPERCASE_ALPHA,
|
|
148
|
+
stringFormat,
|
|
149
|
+
stringAssign,
|
|
150
|
+
stringEscapeHtml,
|
|
151
|
+
stringFill,
|
|
152
|
+
parseQueryParams
|
|
153
|
+
};
|
|
142
154
|
|
|
143
155
|
export {
|
|
144
156
|
STRING_ARABIC_NUMERALS,
|
|
145
157
|
STRING_LOWERCASE_ALPHA,
|
|
146
158
|
STRING_UPPERCASE_ALPHA,
|
|
159
|
+
string as default,
|
|
147
160
|
parseQueryParams,
|
|
148
161
|
stringAssign,
|
|
149
162
|
stringCamelCase,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getStrWidthPx } from './dom.
|
|
8
|
-
import { isString } from './type.
|
|
7
|
+
import { getStrWidthPx } from './dom.mjs';
|
|
8
|
+
import { isString } from './type.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 自定义的 tooltip, 支持鼠标移动动悬浮提示
|
|
@@ -119,5 +119,8 @@ function handleMouseLeave(rootContainer = '#root') {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
const tooltipEvent = { handleMouseEnter, handleMouseLeave };
|
|
122
|
+
var tooltip = {
|
|
123
|
+
tooltipEvent
|
|
124
|
+
};
|
|
122
125
|
|
|
123
|
-
export { tooltipEvent };
|
|
126
|
+
export { tooltip as default, tooltipEvent };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { objectOmit } from './object.
|
|
8
|
-
import {
|
|
7
|
+
import { objectOmit } from './object.mjs';
|
|
8
|
+
import { objectHas, isObject, isNodeList } from './type.mjs';
|
|
9
9
|
|
|
10
10
|
const defaultFieldOptions = { keyField: 'key', childField: 'children', pidField: 'pid' };
|
|
11
11
|
const defaultSearchTreeOptions = {
|
|
@@ -427,5 +427,25 @@ function fuzzySearchTree(nodes, filterCondition, options = defaultSearchTreeOpti
|
|
|
427
427
|
}
|
|
428
428
|
return result;
|
|
429
429
|
}
|
|
430
|
+
var tree = {
|
|
431
|
+
forEachDeep,
|
|
432
|
+
findDeep,
|
|
433
|
+
filterDeep,
|
|
434
|
+
mapDeep,
|
|
435
|
+
searchTreeById,
|
|
436
|
+
formatTree,
|
|
437
|
+
flatTree,
|
|
438
|
+
fuzzySearchTree
|
|
439
|
+
};
|
|
430
440
|
|
|
431
|
-
export {
|
|
441
|
+
export {
|
|
442
|
+
tree as default,
|
|
443
|
+
filterDeep,
|
|
444
|
+
findDeep,
|
|
445
|
+
flatTree,
|
|
446
|
+
forEachDeep,
|
|
447
|
+
formatTree,
|
|
448
|
+
fuzzySearchTree,
|
|
449
|
+
mapDeep,
|
|
450
|
+
searchTreeById
|
|
451
|
+
};
|