@pisell/utils 3.0.6 → 3.0.7
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/es/arrayUtils.d.ts +23 -26
- package/es/arrayUtils.js +157 -97
- package/es/common/index.d.ts +5 -0
- package/es/common/index.js +5 -0
- package/es/common/stateHelper.d.ts +2 -6
- package/es/common/stateHelper.js +24 -22
- package/es/common/types.d.ts +10 -13
- package/es/common/types.js +1 -0
- package/es/componentStorage.d.ts +25 -27
- package/es/componentStorage.js +130 -94
- package/es/constants/index.js +9 -7
- package/es/date.js +53 -36
- package/es/document.js +67 -43
- package/es/escPosPrinter/EscPosPrinter.js +490 -353
- package/es/escPosPrinter/index.d.ts +9 -9
- package/es/escPosPrinter/index.js +52 -37
- package/es/firebase/config/index.js +54 -0
- package/es/firebase/index.js +232 -0
- package/es/format.d.ts +15 -12
- package/es/format.js +156 -89
- package/es/image.js +60 -48
- package/es/index.d.ts +24 -39
- package/es/index.js +35 -40
- package/es/jsBridge/index.d.ts +4 -8
- package/es/jsBridge/index.js +55 -56
- package/es/jsBridge/regDeviceApi.js +126 -87
- package/es/jsBridge/types.d.ts +115 -95
- package/es/jsBridge/types.js +1 -0
- package/es/locales.d.ts +8 -11
- package/es/locales.js +96 -77
- package/es/log.d.ts +6 -11
- package/es/log.js +59 -37
- package/es/miniRedux.d.ts +13 -20
- package/es/miniRedux.js +76 -42
- package/es/number-input/hooks/index.d.ts +4 -0
- package/es/number-input/hooks/index.js +5 -0
- package/es/number-input/hooks/useNumberInputState.d.ts +2 -6
- package/es/number-input/hooks/useNumberInputState.js +128 -71
- package/es/number-input/index.d.ts +14 -0
- package/es/number-input/index.js +21 -0
- package/es/number-input/types.d.ts +88 -88
- package/es/number-input/types.js +1 -0
- package/es/number-input/utils/formatter.d.ts +10 -13
- package/es/number-input/utils/formatter.js +77 -51
- package/es/number-input/utils/index.d.ts +7 -0
- package/es/number-input/utils/index.js +8 -0
- package/es/number-input/utils/validation.d.ts +2 -7
- package/es/number-input/utils/validation.js +66 -51
- package/es/otherUtils.d.ts +9 -12
- package/es/otherUtils.js +129 -71
- package/es/platform.d.ts +9 -12
- package/es/platform.js +85 -61
- package/es/select/hooks/index.d.ts +5 -0
- package/es/select/hooks/index.js +6 -0
- package/es/select/hooks/useDebouncedSearch.d.ts +1 -4
- package/es/select/hooks/useDebouncedSearch.js +53 -39
- package/es/select/hooks/useSelectState.d.ts +7 -7
- package/es/select/hooks/useSelectState.js +113 -56
- package/es/select/index.d.ts +8 -7
- package/es/select/index.js +13 -0
- package/es/select/types.d.ts +211 -211
- package/es/select/types.js +1 -0
- package/es/select/utils/filterOptions.d.ts +6 -7
- package/es/select/utils/filterOptions.js +31 -26
- package/es/select/utils/helpers.d.ts +9 -10
- package/es/select/utils/helpers.js +52 -42
- package/es/select/utils/index.d.ts +7 -4
- package/es/select/utils/index.js +8 -0
- package/es/select/utils/sortOptions.d.ts +5 -6
- package/es/select/utils/sortOptions.js +31 -19
- package/es/select/utils/tagAggregation.d.ts +6 -6
- package/es/select/utils/tagAggregation.js +47 -34
- package/es/text-input/hooks/index.d.ts +4 -0
- package/es/text-input/hooks/index.js +5 -0
- package/es/text-input/hooks/useTextInputState.d.ts +2 -6
- package/es/text-input/hooks/useTextInputState.js +126 -69
- package/es/text-input/index.d.ts +14 -0
- package/es/text-input/index.js +20 -0
- package/es/text-input/types.d.ts +48 -48
- package/es/text-input/types.js +1 -0
- package/es/text-input/utils/index.d.ts +5 -0
- package/es/text-input/utils/index.js +7 -0
- package/es/text-input/utils/validation.d.ts +2 -7
- package/es/text-input/utils/validation.js +70 -50
- package/es/typeUtils.js +84 -61
- package/es/walletValidity.d.ts +42 -44
- package/es/walletValidity.js +557 -396
- package/es/weighing.d.ts +45 -48
- package/es/weighing.js +106 -83
- package/lib/arrayUtils.d.ts +23 -26
- package/lib/arrayUtils.js +111 -101
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +29 -0
- package/lib/common/stateHelper.d.ts +2 -6
- package/lib/common/stateHelper.js +32 -21
- package/lib/common/types.d.ts +10 -13
- package/lib/common/types.js +17 -0
- package/lib/componentStorage.d.ts +25 -27
- package/lib/componentStorage.js +126 -96
- package/lib/constants/index.js +36 -7
- package/lib/date.js +65 -43
- package/lib/document.js +62 -46
- package/lib/escPosPrinter/EscPosPrinter.js +403 -327
- package/lib/escPosPrinter/index.d.ts +9 -9
- package/lib/escPosPrinter/index.js +84 -38
- package/lib/firebase/config/index.js +79 -0
- package/lib/firebase/index.js +180 -0
- package/lib/format.d.ts +15 -12
- package/lib/format.js +133 -91
- package/lib/image.js +74 -48
- package/lib/index.d.ts +24 -39
- package/lib/index.js +80 -137
- package/lib/jsBridge/index.d.ts +4 -8
- package/lib/jsBridge/index.js +76 -57
- package/lib/jsBridge/regDeviceApi.js +133 -86
- package/lib/jsBridge/types.d.ts +115 -95
- package/lib/jsBridge/types.js +17 -0
- package/lib/locales.d.ts +8 -11
- package/lib/locales.js +90 -79
- package/lib/log.d.ts +6 -11
- package/lib/log.js +61 -37
- package/lib/miniRedux.d.ts +13 -20
- package/lib/miniRedux.js +89 -43
- package/lib/number-input/hooks/index.d.ts +4 -0
- package/lib/number-input/hooks/index.js +29 -0
- package/lib/number-input/hooks/useNumberInputState.d.ts +2 -6
- package/lib/number-input/hooks/useNumberInputState.js +81 -71
- package/lib/number-input/index.d.ts +14 -0
- package/lib/number-input/index.js +41 -0
- package/lib/number-input/types.d.ts +88 -88
- package/lib/number-input/types.js +17 -0
- package/lib/number-input/utils/formatter.d.ts +10 -13
- package/lib/number-input/utils/formatter.js +49 -52
- package/lib/number-input/utils/index.d.ts +7 -0
- package/lib/number-input/utils/index.js +39 -0
- package/lib/number-input/utils/validation.d.ts +2 -7
- package/lib/number-input/utils/validation.js +52 -50
- package/lib/otherUtils.d.ts +9 -12
- package/lib/otherUtils.js +98 -86
- package/lib/platform.d.ts +9 -12
- package/lib/platform.js +123 -68
- package/lib/select/hooks/index.d.ts +5 -0
- package/lib/select/hooks/index.js +34 -0
- package/lib/select/hooks/useDebouncedSearch.d.ts +1 -4
- package/lib/select/hooks/useDebouncedSearch.js +41 -40
- package/lib/select/hooks/useSelectState.d.ts +7 -7
- package/lib/select/hooks/useSelectState.js +93 -58
- package/lib/select/index.d.ts +8 -7
- package/lib/select/index.js +53 -0
- package/lib/select/types.d.ts +211 -211
- package/lib/select/types.js +17 -0
- package/lib/select/utils/filterOptions.d.ts +6 -7
- package/lib/select/utils/filterOptions.js +37 -26
- package/lib/select/utils/helpers.d.ts +9 -10
- package/lib/select/utils/helpers.js +41 -45
- package/lib/select/utils/index.d.ts +7 -4
- package/lib/select/utils/index.js +48 -0
- package/lib/select/utils/sortOptions.d.ts +5 -6
- package/lib/select/utils/sortOptions.js +39 -18
- package/lib/select/utils/tagAggregation.d.ts +6 -6
- package/lib/select/utils/tagAggregation.js +41 -33
- package/lib/text-input/hooks/index.d.ts +4 -0
- package/lib/text-input/hooks/index.js +29 -0
- package/lib/text-input/hooks/useTextInputState.d.ts +2 -6
- package/lib/text-input/hooks/useTextInputState.js +79 -69
- package/lib/text-input/index.d.ts +14 -0
- package/lib/text-input/index.js +35 -0
- package/lib/text-input/types.d.ts +48 -48
- package/lib/text-input/types.js +17 -0
- package/lib/text-input/utils/index.d.ts +5 -0
- package/lib/text-input/utils/index.js +32 -0
- package/lib/text-input/utils/validation.d.ts +2 -7
- package/lib/text-input/utils/validation.js +58 -49
- package/lib/typeUtils.js +73 -68
- package/lib/walletValidity.d.ts +42 -44
- package/lib/walletValidity.js +393 -410
- package/lib/weighing.d.ts +45 -48
- package/lib/weighing.js +149 -104
- package/package.json +1 -1
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js +0 -27
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js +0 -12
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js +0 -25
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.js +0 -14
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.js +0 -9
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.js +0 -11
- package/es/date.d.ts +0 -31
- package/es/document.d.ts +0 -16
- package/es/image.d.ts +0 -14
- package/es/typeUtils.d.ts +0 -45
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js +0 -27
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js +0 -12
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js +0 -25
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.js +0 -14
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.js +0 -9
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.js +0 -16
- package/lib/_virtual/_rolldown/runtime.js +0 -23
- package/lib/date.d.ts +0 -31
- package/lib/document.d.ts +0 -16
- package/lib/image.d.ts +0 -14
- package/lib/typeUtils.d.ts +0 -45
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_defineProperty = require("./defineProperty.js");
|
|
2
|
-
//#region \0@oxc-project+runtime@0.122.0/helpers/objectSpread2.js
|
|
3
|
-
function ownKeys(e, r) {
|
|
4
|
-
var t = Object.keys(e);
|
|
5
|
-
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
7
|
-
r && (o = o.filter(function(r) {
|
|
8
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
9
|
-
})), t.push.apply(t, o);
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
}
|
|
13
|
-
function _objectSpread2(e) {
|
|
14
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
15
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
17
|
-
require_defineProperty._defineProperty(e, r, t[r]);
|
|
18
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
19
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return e;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
exports._objectSpread2 = _objectSpread2;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const require_typeof = require("./typeof.js");
|
|
2
|
-
//#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
|
|
3
|
-
function toPrimitive(t, r) {
|
|
4
|
-
if ("object" != require_typeof._typeof(t) || !t) return t;
|
|
5
|
-
var e = t[Symbol.toPrimitive];
|
|
6
|
-
if (void 0 !== e) {
|
|
7
|
-
var i = e.call(t, r || "default");
|
|
8
|
-
if ("object" != require_typeof._typeof(i)) return i;
|
|
9
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
-
}
|
|
11
|
-
return ("string" === r ? String : Number)(t);
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
exports.toPrimitive = toPrimitive;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_typeof = require("./typeof.js");
|
|
2
|
-
const require_toPrimitive = require("./toPrimitive.js");
|
|
3
|
-
//#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
|
|
4
|
-
function toPropertyKey(t) {
|
|
5
|
-
var i = require_toPrimitive.toPrimitive(t, "string");
|
|
6
|
-
return "symbol" == require_typeof._typeof(i) ? i : i + "";
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.toPropertyKey = toPropertyKey;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
|
|
2
|
-
function _typeof(o) {
|
|
3
|
-
"@babel/helpers - typeof";
|
|
4
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
-
return typeof o;
|
|
6
|
-
} : function(o) {
|
|
7
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
-
}, _typeof(o);
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
Object.defineProperty(exports, "_typeof", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function() {
|
|
14
|
-
return _typeof;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.__toESM = __toESM;
|
package/lib/date.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region src/date.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* @title: 格式化日期
|
|
4
|
-
* @description:
|
|
5
|
-
* @param {string} date
|
|
6
|
-
* @param {string} format
|
|
7
|
-
* @return {*}
|
|
8
|
-
* @Author: zhiwei.Wang
|
|
9
|
-
* @Date: 2023-07-21 10:49
|
|
10
|
-
*/
|
|
11
|
-
declare const formatDate: (date: string | Date, format?: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* @title: excel日期 转 js日期
|
|
14
|
-
* @description:
|
|
15
|
-
* @param {number} excelDate
|
|
16
|
-
* @return {*}
|
|
17
|
-
* @Author: zhiwei.Wang
|
|
18
|
-
* @Date: 2023-07-21 10:49
|
|
19
|
-
*/
|
|
20
|
-
declare const excelDateToJSDate: (excelDate: number) => string;
|
|
21
|
-
/**
|
|
22
|
-
* @title: js日期 转 excel日期
|
|
23
|
-
* @description:
|
|
24
|
-
* @param {string} jsDate
|
|
25
|
-
* @return {*}
|
|
26
|
-
* @Author: zhiwei.Wang
|
|
27
|
-
* @Date: 2023-07-21 10:49
|
|
28
|
-
*/
|
|
29
|
-
declare const jsDateToExcelDate: (jsDate: string) => number;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { excelDateToJSDate, formatDate, jsDateToExcelDate };
|
package/lib/document.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/document.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* @Title: 设置主题
|
|
4
|
-
* @Describe: 传入字符串键值对
|
|
5
|
-
* @Author: Wzw
|
|
6
|
-
*/
|
|
7
|
-
declare const setTheme: (themes: {
|
|
8
|
-
[key: string]: string;
|
|
9
|
-
}) => void;
|
|
10
|
-
/**
|
|
11
|
-
* 复制到剪切板
|
|
12
|
-
* @param text
|
|
13
|
-
*/
|
|
14
|
-
declare const copyToClipboard: (text: string) => Promise<void>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { copyToClipboard, setTheme };
|
package/lib/image.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/image.d.ts
|
|
2
|
-
declare const image: {
|
|
3
|
-
ali: (url: string, w: number) => string;
|
|
4
|
-
getImageSize: (url: string) => {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
ratio: number;
|
|
8
|
-
success: boolean;
|
|
9
|
-
widthRatio: number;
|
|
10
|
-
originRatio: number;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { image };
|
package/lib/typeUtils.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region src/typeUtils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* 判断是否是函数
|
|
4
|
-
* @param obj
|
|
5
|
-
*/
|
|
6
|
-
declare const isFunction: (obj: any) => obj is Function;
|
|
7
|
-
/**
|
|
8
|
-
* 判断是否是数组
|
|
9
|
-
* @param obj
|
|
10
|
-
*/
|
|
11
|
-
declare const isArr: (obj: any) => obj is any[];
|
|
12
|
-
/**
|
|
13
|
-
* 判断是否是字符串
|
|
14
|
-
* @param obj
|
|
15
|
-
*/
|
|
16
|
-
declare const isString: (obj: any) => obj is string;
|
|
17
|
-
/**
|
|
18
|
-
* 判断是否是数字
|
|
19
|
-
* @param obj
|
|
20
|
-
*/
|
|
21
|
-
declare const isNumber: (obj: any) => obj is number;
|
|
22
|
-
/**
|
|
23
|
-
* 判断是否是undefined
|
|
24
|
-
* @param obj
|
|
25
|
-
*/
|
|
26
|
-
declare const isUndefined: (obj: any) => obj is undefined;
|
|
27
|
-
/**
|
|
28
|
-
* 判断是否是boolean
|
|
29
|
-
* @param obj
|
|
30
|
-
*/
|
|
31
|
-
declare const isBoolean: (obj: any) => obj is boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 判断是否是json字符串
|
|
34
|
-
* @param v
|
|
35
|
-
*/
|
|
36
|
-
declare const isJson: (v: any) => boolean;
|
|
37
|
-
/**
|
|
38
|
-
* @Title: 判断是否为对象
|
|
39
|
-
* @Describe:
|
|
40
|
-
* @Author: Wzw
|
|
41
|
-
* @param {any} obj
|
|
42
|
-
*/
|
|
43
|
-
declare const isPlainObject: (obj: any) => boolean;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { isArr, isBoolean, isFunction, isJson, isNumber, isPlainObject, isString, isUndefined };
|