@whitesev/utils 2.1.0 → 2.1.2
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/index.amd.js +7 -10
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +7 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +7 -10
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +7 -10
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +7 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +2 -2
- package/dist/types/src/{UtilsWindowApi.d.ts → WindowApi.d.ts} +1 -1
- package/dist/types/src/indexedDB.d.ts +21 -6
- package/package.json +1 -1
- package/src/Utils.ts +14 -11
- package/src/{UtilsWindowApi.ts → WindowApi.ts} +1 -1
- package/src/indexedDB.ts +26 -15
package/dist/index.system.js
CHANGED
|
@@ -2638,8 +2638,6 @@ System.register('Utils', [], (function (exports) {
|
|
|
2638
2638
|
let request = idbStore.put(inData);
|
|
2639
2639
|
request.onsuccess = function (event) {
|
|
2640
2640
|
/* 保存成功有success 字段 */
|
|
2641
|
-
// @ts-ignore
|
|
2642
|
-
event.target;
|
|
2643
2641
|
resolve({
|
|
2644
2642
|
success: true,
|
|
2645
2643
|
code: that.#errorCode.success.code,
|
|
@@ -2648,8 +2646,6 @@ System.register('Utils', [], (function (exports) {
|
|
|
2648
2646
|
});
|
|
2649
2647
|
};
|
|
2650
2648
|
request.onerror = function (event) {
|
|
2651
|
-
// @ts-ignore
|
|
2652
|
-
event.target;
|
|
2653
2649
|
resolve({
|
|
2654
2650
|
success: false,
|
|
2655
2651
|
code: that.#errorCode.save.code,
|
|
@@ -2668,8 +2664,8 @@ System.register('Utils', [], (function (exports) {
|
|
|
2668
2664
|
async get(key) {
|
|
2669
2665
|
let that = this;
|
|
2670
2666
|
return new Promise((resolve) => {
|
|
2671
|
-
let dbName =
|
|
2672
|
-
|
|
2667
|
+
let dbName = this.#dbName;
|
|
2668
|
+
this.open(function (idbStore, success) {
|
|
2673
2669
|
/* 判断返回的数据中是否有error字段 */
|
|
2674
2670
|
if (!success) {
|
|
2675
2671
|
resolve({
|
|
@@ -3485,7 +3481,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
3485
3481
|
}
|
|
3486
3482
|
}
|
|
3487
3483
|
|
|
3488
|
-
class
|
|
3484
|
+
class WindowApi {
|
|
3489
3485
|
/** 默认的配置 */
|
|
3490
3486
|
defaultApi = {
|
|
3491
3487
|
document: document,
|
|
@@ -3522,10 +3518,10 @@ System.register('Utils', [], (function (exports) {
|
|
|
3522
3518
|
class Utils {
|
|
3523
3519
|
windowApi;
|
|
3524
3520
|
constructor(option) {
|
|
3525
|
-
this.windowApi = new
|
|
3521
|
+
this.windowApi = new WindowApi(option);
|
|
3526
3522
|
}
|
|
3527
3523
|
/** 版本号 */
|
|
3528
|
-
version = "2024.7.
|
|
3524
|
+
version = "2024.7.24";
|
|
3529
3525
|
addStyle(cssText) {
|
|
3530
3526
|
if (typeof cssText !== "string") {
|
|
3531
3527
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -5835,7 +5831,8 @@ System.register('Utils', [], (function (exports) {
|
|
|
5835
5831
|
if (Array.isArray(data)) {
|
|
5836
5832
|
data.sort(sortFunc);
|
|
5837
5833
|
}
|
|
5838
|
-
else if (data instanceof NodeList ||
|
|
5834
|
+
else if (data instanceof NodeList ||
|
|
5835
|
+
UtilsContext.isJQuery(data)) {
|
|
5839
5836
|
sortNodeFunc(data, getDataFunc);
|
|
5840
5837
|
result = getDataFunc();
|
|
5841
5838
|
}
|