@pisell/utils 1.0.57 → 1.0.59

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.
Files changed (126) hide show
  1. package/README.md +2 -2
  2. package/es/arrayUtils.d.ts +1 -1
  3. package/es/common/index.d.ts +5 -5
  4. package/es/common/index.js +2 -2
  5. package/es/common/stateHelper.d.ts +18 -18
  6. package/es/common/stateHelper.js +15 -15
  7. package/es/common/types.d.ts +28 -28
  8. package/es/constants/index.d.ts +7 -0
  9. package/es/date.d.ts +28 -28
  10. package/es/date.js +22 -22
  11. package/es/document.d.ts +13 -13
  12. package/es/document.js +7 -7
  13. package/es/escPosPrinter/index.d.ts +9 -9
  14. package/es/firebase/config/index.d.ts +13 -13
  15. package/es/firebase/index.d.ts +28 -28
  16. package/es/format.d.ts +28 -0
  17. package/es/format.js +14 -14
  18. package/es/image.d.ts +11 -11
  19. package/es/image.js +5 -5
  20. package/es/index.d.ts +24 -24
  21. package/es/jsBridge/index.d.ts +22 -0
  22. package/es/jsBridge/index.js +15 -15
  23. package/es/jsBridge/regDeviceApi.d.ts +15 -15
  24. package/es/jsBridge/regDeviceApi.js +3 -3
  25. package/es/jsBridge/types.d.ts +149 -0
  26. package/es/locales.d.ts +12 -0
  27. package/es/locales.js +15 -15
  28. package/es/log.d.ts +10 -10
  29. package/es/miniRedux.d.ts +16 -0
  30. package/es/number-input/hooks/index.d.ts +4 -4
  31. package/es/number-input/hooks/index.js +2 -2
  32. package/es/number-input/hooks/useNumberInputState.d.ts +25 -25
  33. package/es/number-input/hooks/useNumberInputState.js +39 -39
  34. package/es/number-input/index.d.ts +14 -14
  35. package/es/number-input/index.js +8 -8
  36. package/es/number-input/types.d.ts +96 -96
  37. package/es/number-input/utils/formatter.d.ts +53 -53
  38. package/es/number-input/utils/formatter.js +37 -37
  39. package/es/number-input/utils/index.d.ts +7 -7
  40. package/es/number-input/utils/index.js +2 -2
  41. package/es/number-input/utils/validation.d.ts +27 -27
  42. package/es/number-input/utils/validation.js +24 -24
  43. package/es/otherUtils.d.ts +48 -0
  44. package/es/otherUtils.js +32 -32
  45. package/es/platform.d.ts +9 -9
  46. package/es/select/hooks/index.d.ts +5 -5
  47. package/es/select/hooks/index.js +2 -2
  48. package/es/select/hooks/useDebouncedSearch.d.ts +20 -20
  49. package/es/select/hooks/useDebouncedSearch.js +17 -17
  50. package/es/select/hooks/useSelectState.d.ts +19 -19
  51. package/es/select/hooks/useSelectState.js +13 -13
  52. package/es/select/index.d.ts +8 -8
  53. package/es/select/index.js +3 -3
  54. package/es/select/types.d.ts +256 -256
  55. package/es/select/utils/filterOptions.d.ts +22 -22
  56. package/es/select/utils/filterOptions.js +16 -16
  57. package/es/select/utils/helpers.d.ts +42 -42
  58. package/es/select/utils/helpers.js +30 -30
  59. package/es/select/utils/index.d.ts +7 -7
  60. package/es/select/utils/index.js +2 -2
  61. package/es/select/utils/sortOptions.d.ts +12 -12
  62. package/es/select/utils/sortOptions.js +8 -8
  63. package/es/select/utils/tagAggregation.d.ts +25 -25
  64. package/es/select/utils/tagAggregation.js +21 -21
  65. package/es/text-input/hooks/index.d.ts +4 -4
  66. package/es/text-input/hooks/index.js +2 -2
  67. package/es/text-input/hooks/useTextInputState.d.ts +24 -24
  68. package/es/text-input/hooks/useTextInputState.js +38 -38
  69. package/es/text-input/index.d.ts +14 -14
  70. package/es/text-input/index.js +9 -9
  71. package/es/text-input/types.d.ts +56 -56
  72. package/es/text-input/utils/index.d.ts +5 -5
  73. package/es/text-input/utils/index.js +2 -2
  74. package/es/text-input/utils/validation.d.ts +23 -23
  75. package/es/text-input/utils/validation.js +20 -20
  76. package/es/typeUtils.d.ts +42 -42
  77. package/es/typeUtils.js +26 -26
  78. package/es/walletValidity.d.ts +44 -0
  79. package/es/walletValidity.js +85 -85
  80. package/lib/arrayUtils.d.ts +1 -1
  81. package/lib/common/index.d.ts +5 -5
  82. package/lib/common/stateHelper.d.ts +18 -18
  83. package/lib/common/types.d.ts +28 -28
  84. package/lib/constants/index.d.ts +7 -0
  85. package/lib/date.d.ts +28 -28
  86. package/lib/document.d.ts +13 -13
  87. package/lib/escPosPrinter/index.d.ts +9 -9
  88. package/lib/firebase/config/index.d.ts +13 -13
  89. package/lib/firebase/index.d.ts +28 -28
  90. package/lib/format.d.ts +28 -0
  91. package/lib/image.d.ts +11 -11
  92. package/lib/index.d.ts +24 -24
  93. package/lib/jsBridge/index.d.ts +22 -0
  94. package/lib/jsBridge/regDeviceApi.d.ts +15 -15
  95. package/lib/jsBridge/types.d.ts +149 -0
  96. package/lib/locales.d.ts +12 -0
  97. package/lib/log.d.ts +10 -10
  98. package/lib/miniRedux.d.ts +16 -0
  99. package/lib/number-input/hooks/index.d.ts +4 -4
  100. package/lib/number-input/hooks/useNumberInputState.d.ts +25 -25
  101. package/lib/number-input/index.d.ts +14 -14
  102. package/lib/number-input/types.d.ts +96 -96
  103. package/lib/number-input/utils/formatter.d.ts +53 -53
  104. package/lib/number-input/utils/index.d.ts +7 -7
  105. package/lib/number-input/utils/validation.d.ts +27 -27
  106. package/lib/otherUtils.d.ts +48 -0
  107. package/lib/platform.d.ts +9 -9
  108. package/lib/select/hooks/index.d.ts +5 -5
  109. package/lib/select/hooks/useDebouncedSearch.d.ts +20 -20
  110. package/lib/select/hooks/useSelectState.d.ts +19 -19
  111. package/lib/select/index.d.ts +8 -8
  112. package/lib/select/types.d.ts +256 -256
  113. package/lib/select/utils/filterOptions.d.ts +22 -22
  114. package/lib/select/utils/helpers.d.ts +42 -42
  115. package/lib/select/utils/index.d.ts +7 -7
  116. package/lib/select/utils/sortOptions.d.ts +12 -12
  117. package/lib/select/utils/tagAggregation.d.ts +25 -25
  118. package/lib/text-input/hooks/index.d.ts +4 -4
  119. package/lib/text-input/hooks/useTextInputState.d.ts +24 -24
  120. package/lib/text-input/index.d.ts +14 -14
  121. package/lib/text-input/types.d.ts +56 -56
  122. package/lib/text-input/utils/index.d.ts +5 -5
  123. package/lib/text-input/utils/validation.d.ts +23 -23
  124. package/lib/typeUtils.d.ts +42 -42
  125. package/lib/walletValidity.d.ts +44 -0
  126. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @pisell/utils
2
-
1
+ # @pisell/utils
2
+
3
3
  pisell通用utils方法
@@ -1 +1 @@
1
- export declare const uniqueByKey: <T>(arr: T[], key: keyof T) => T[];
1
+ export declare const uniqueByKey: <T>(arr: T[], key: keyof T) => T[];
@@ -1,5 +1,5 @@
1
- /**
2
- * 公共工具和类型导出
3
- */
4
- export type { DisplayState, ValidationResult } from './types';
5
- export { getDisplayState } from './stateHelper';
1
+ /**
2
+ * 公共工具和类型导出
3
+ */
4
+ export type { DisplayState, ValidationResult } from './types';
5
+ export { getDisplayState } from './stateHelper';
@@ -1,5 +1,5 @@
1
- /**
2
- * 公共工具和类型导出
1
+ /**
2
+ * 公共工具和类型导出
3
3
  */
4
4
 
5
5
  export { getDisplayState } from "./stateHelper";
@@ -1,18 +1,18 @@
1
- import type { DisplayState } from './types';
2
- /**
3
- * 根据 mode 和 disabled 计算组件的显示状态
4
- *
5
- * 状态优先级:disabled > mode
6
- * 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
7
- *
8
- * @param mode 状态模式('read' | 'edit')
9
- * @param disabled 是否禁用
10
- * @returns 显示状态('read' | 'edit' | 'disabled')
11
- *
12
- * @example
13
- * getDisplayState('edit', false) // 'edit'
14
- * getDisplayState('read', false) // 'read'
15
- * getDisplayState('edit', true) // 'disabled'
16
- * getDisplayState('read', true) // 'disabled'
17
- */
18
- export declare function getDisplayState(mode?: 'read' | 'edit', disabled?: boolean): DisplayState;
1
+ import type { DisplayState } from './types';
2
+ /**
3
+ * 根据 mode 和 disabled 计算组件的显示状态
4
+ *
5
+ * 状态优先级:disabled > mode
6
+ * 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
7
+ *
8
+ * @param mode 状态模式('read' | 'edit')
9
+ * @param disabled 是否禁用
10
+ * @returns 显示状态('read' | 'edit' | 'disabled')
11
+ *
12
+ * @example
13
+ * getDisplayState('edit', false) // 'edit'
14
+ * getDisplayState('read', false) // 'read'
15
+ * getDisplayState('edit', true) // 'disabled'
16
+ * getDisplayState('read', true) // 'disabled'
17
+ */
18
+ export declare function getDisplayState(mode?: 'read' | 'edit', disabled?: boolean): DisplayState;
@@ -1,18 +1,18 @@
1
- /**
2
- * 根据 mode 和 disabled 计算组件的显示状态
3
- *
4
- * 状态优先级:disabled > mode
5
- * 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
6
- *
7
- * @param mode 状态模式('read' | 'edit')
8
- * @param disabled 是否禁用
9
- * @returns 显示状态('read' | 'edit' | 'disabled')
10
- *
11
- * @example
12
- * getDisplayState('edit', false) // 'edit'
13
- * getDisplayState('read', false) // 'read'
14
- * getDisplayState('edit', true) // 'disabled'
15
- * getDisplayState('read', true) // 'disabled'
1
+ /**
2
+ * 根据 mode 和 disabled 计算组件的显示状态
3
+ *
4
+ * 状态优先级:disabled > mode
5
+ * 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
6
+ *
7
+ * @param mode 状态模式('read' | 'edit')
8
+ * @param disabled 是否禁用
9
+ * @returns 显示状态('read' | 'edit' | 'disabled')
10
+ *
11
+ * @example
12
+ * getDisplayState('edit', false) // 'edit'
13
+ * getDisplayState('read', false) // 'read'
14
+ * getDisplayState('edit', true) // 'disabled'
15
+ * getDisplayState('read', true) // 'disabled'
16
16
  */
17
17
  export function getDisplayState(mode, disabled) {
18
18
  // disabled 优先级最高
@@ -1,28 +1,28 @@
1
- /**
2
- * 公共类型定义
3
- * 供所有输入组件使用
4
- */
5
- /**
6
- * 显示状态类型
7
- *
8
- * 所有输入组件的三种状态:
9
- * - read: 只读态,纯文本展示
10
- * - edit: 编辑态,显示输入控件
11
- * - disabled: 禁用态,禁用的输入控件
12
- */
13
- export declare type DisplayState = 'read' | 'edit' | 'disabled';
14
- /**
15
- * 校验结果类型
16
- *
17
- * 所有输入组件的校验结果统一格式
18
- */
19
- export interface ValidationResult {
20
- /**
21
- * 是否校验通过
22
- */
23
- isValid: boolean;
24
- /**
25
- * 错误信息数组
26
- */
27
- errors: string[];
28
- }
1
+ /**
2
+ * 公共类型定义
3
+ * 供所有输入组件使用
4
+ */
5
+ /**
6
+ * 显示状态类型
7
+ *
8
+ * 所有输入组件的三种状态:
9
+ * - read: 只读态,纯文本展示
10
+ * - edit: 编辑态,显示输入控件
11
+ * - disabled: 禁用态,禁用的输入控件
12
+ */
13
+ export declare type DisplayState = 'read' | 'edit' | 'disabled';
14
+ /**
15
+ * 校验结果类型
16
+ *
17
+ * 所有输入组件的校验结果统一格式
18
+ */
19
+ export interface ValidationResult {
20
+ /**
21
+ * 是否校验通过
22
+ */
23
+ isValid: boolean;
24
+ /**
25
+ * 错误信息数组
26
+ */
27
+ errors: string[];
28
+ }
@@ -0,0 +1,7 @@
1
+ declare const webHookApi: {
2
+ warning_log: {
3
+ test: string;
4
+ prod: string;
5
+ };
6
+ };
7
+ export { webHookApi };
package/es/date.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- /**
2
- * @title: 格式化日期
3
- * @description:
4
- * @param {string} date
5
- * @param {string} format
6
- * @return {*}
7
- * @Author: zhiwei.Wang
8
- * @Date: 2023-07-21 10:49
9
- */
10
- export declare const formatDate: (date: string | Date, format?: string) => string;
11
- /**
12
- * @title: excel日期 转 js日期
13
- * @description:
14
- * @param {number} excelDate
15
- * @return {*}
16
- * @Author: zhiwei.Wang
17
- * @Date: 2023-07-21 10:49
18
- */
19
- export declare const excelDateToJSDate: (excelDate: number) => string;
20
- /**
21
- * @title: js日期 转 excel日期
22
- * @description:
23
- * @param {string} jsDate
24
- * @return {*}
25
- * @Author: zhiwei.Wang
26
- * @Date: 2023-07-21 10:49
27
- */
28
- export declare const jsDateToExcelDate: (jsDate: string) => number;
1
+ /**
2
+ * @title: 格式化日期
3
+ * @description:
4
+ * @param {string} date
5
+ * @param {string} format
6
+ * @return {*}
7
+ * @Author: zhiwei.Wang
8
+ * @Date: 2023-07-21 10:49
9
+ */
10
+ export declare const formatDate: (date: string | Date, format?: string) => string;
11
+ /**
12
+ * @title: excel日期 转 js日期
13
+ * @description:
14
+ * @param {number} excelDate
15
+ * @return {*}
16
+ * @Author: zhiwei.Wang
17
+ * @Date: 2023-07-21 10:49
18
+ */
19
+ export declare const excelDateToJSDate: (excelDate: number) => string;
20
+ /**
21
+ * @title: js日期 转 excel日期
22
+ * @description:
23
+ * @param {string} jsDate
24
+ * @return {*}
25
+ * @Author: zhiwei.Wang
26
+ * @Date: 2023-07-21 10:49
27
+ */
28
+ export declare const jsDateToExcelDate: (jsDate: string) => number;
package/es/date.js CHANGED
@@ -5,14 +5,14 @@ var formatMaps = [
5
5
  // 2023-07-19
6
6
  'YYYY-MM-DD'];
7
7
 
8
- /**
9
- * @title: 格式化日期
10
- * @description:
11
- * @param {string} date
12
- * @param {string} format
13
- * @return {*}
14
- * @Author: zhiwei.Wang
15
- * @Date: 2023-07-21 10:49
8
+ /**
9
+ * @title: 格式化日期
10
+ * @description:
11
+ * @param {string} date
12
+ * @param {string} format
13
+ * @return {*}
14
+ * @Author: zhiwei.Wang
15
+ * @Date: 2023-07-21 10:49
16
16
  */
17
17
  export var formatDate = function formatDate(date, format) {
18
18
  // 19 Jul 2023, 09:00am
@@ -23,13 +23,13 @@ export var formatDate = function formatDate(date, format) {
23
23
  return dayjs(date).format(_format);
24
24
  };
25
25
 
26
- /**
27
- * @title: excel日期 转 js日期
28
- * @description:
29
- * @param {number} excelDate
30
- * @return {*}
31
- * @Author: zhiwei.Wang
32
- * @Date: 2023-07-21 10:49
26
+ /**
27
+ * @title: excel日期 转 js日期
28
+ * @description:
29
+ * @param {number} excelDate
30
+ * @return {*}
31
+ * @Author: zhiwei.Wang
32
+ * @Date: 2023-07-21 10:49
33
33
  */
34
34
  export var excelDateToJSDate = function excelDateToJSDate(excelDate) {
35
35
  // Excel日期的起始日期为1900年1月1日,JavaScript的起始日期为1970年1月1日
@@ -39,13 +39,13 @@ export var excelDateToJSDate = function excelDateToJSDate(excelDate) {
39
39
  return jsDate;
40
40
  };
41
41
 
42
- /**
43
- * @title: js日期 转 excel日期
44
- * @description:
45
- * @param {string} jsDate
46
- * @return {*}
47
- * @Author: zhiwei.Wang
48
- * @Date: 2023-07-21 10:49
42
+ /**
43
+ * @title: js日期 转 excel日期
44
+ * @description:
45
+ * @param {string} jsDate
46
+ * @return {*}
47
+ * @Author: zhiwei.Wang
48
+ * @Date: 2023-07-21 10:49
49
49
  */
50
50
  export var jsDateToExcelDate = function jsDateToExcelDate(jsDate) {
51
51
  var _jsDate = new Date(jsDate);
package/es/document.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- /**
2
- * @Title: 设置主题
3
- * @Describe: 传入字符串键值对
4
- * @Author: Wzw
5
- */
6
- export declare const setTheme: (themes: {
7
- [key: string]: string;
8
- }) => void;
9
- /**
10
- * 复制到剪切板
11
- * @param text
12
- */
13
- export declare const copyToClipboard: (text: string) => Promise<void>;
1
+ /**
2
+ * @Title: 设置主题
3
+ * @Describe: 传入字符串键值对
4
+ * @Author: Wzw
5
+ */
6
+ export declare const setTheme: (themes: {
7
+ [key: string]: string;
8
+ }) => void;
9
+ /**
10
+ * 复制到剪切板
11
+ * @param text
12
+ */
13
+ export declare const copyToClipboard: (text: string) => Promise<void>;
package/es/document.js CHANGED
@@ -2,10 +2,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
- /**
6
- * @Title: 设置主题
7
- * @Describe: 传入字符串键值对
8
- * @Author: Wzw
5
+ /**
6
+ * @Title: 设置主题
7
+ * @Describe: 传入字符串键值对
8
+ * @Author: Wzw
9
9
  */
10
10
  export var setTheme = function setTheme(themes) {
11
11
  try {
@@ -31,9 +31,9 @@ var httpCopyToClipboard = function httpCopyToClipboard(text) {
31
31
  document.body.removeChild(textArea);
32
32
  };
33
33
 
34
- /**
35
- * 复制到剪切板
36
- * @param text
34
+ /**
35
+ * 复制到剪切板
36
+ * @param text
37
37
  */
38
38
  export var copyToClipboard = /*#__PURE__*/function () {
39
39
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(text) {
@@ -1,9 +1,9 @@
1
- export declare const EscPosPrinter = any;
2
- export declare const ALIGN_LEFT = number;
3
- export declare const ALIGN_CENTER = number;
4
- export declare const ALIGN_RIGHT = number;
5
- export declare const columnWidthWithAlignment = (
6
- width: number,
7
- alignment: number
8
- ) => any;
9
- export declare const preparing = any;
1
+ export declare const EscPosPrinter = any;
2
+ export declare const ALIGN_LEFT = number;
3
+ export declare const ALIGN_CENTER = number;
4
+ export declare const ALIGN_RIGHT = number;
5
+ export declare const columnWidthWithAlignment = (
6
+ width: number,
7
+ alignment: number
8
+ ) => any;
9
+ export declare const preparing = any;
@@ -1,13 +1,13 @@
1
- declare type InjectedConfigType = {
2
- apiKey: string;
3
- authDomain: string;
4
- projectId: string;
5
- storageBucket: string;
6
- messagingSenderId: string;
7
- appId: string;
8
- databaseURL: string;
9
- };
10
- export declare const injectConfig: (context: InjectedConfigType) => void;
11
- export declare const firebaseConfig: any;
12
- declare const _default: any;
13
- export default _default;
1
+ declare type InjectedConfigType = {
2
+ apiKey: string;
3
+ authDomain: string;
4
+ projectId: string;
5
+ storageBucket: string;
6
+ messagingSenderId: string;
7
+ appId: string;
8
+ databaseURL: string;
9
+ };
10
+ export declare const injectConfig: (context: InjectedConfigType) => void;
11
+ export declare const firebaseConfig: any;
12
+ declare const _default: any;
13
+ export default _default;
@@ -1,28 +1,28 @@
1
- import { FirebaseApp } from 'firebase/app';
2
- import { Auth } from 'firebase/auth';
3
- import { ref, Database, goOnline, goOffline } from 'firebase/database';
4
- declare let firebaseApp: FirebaseApp;
5
- declare let auth: Auth;
6
- declare let database: Database;
7
- export declare const initFirebase: (config?: any) => void;
8
- export { database, firebaseApp, auth, ref, goOnline, goOffline };
9
- export declare const getPath: (path: string) => string;
10
- export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
11
- export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
12
- export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
13
- export declare const signOutUser: () => Promise<void>;
14
- export declare const readData: (path: string) => Promise<any>;
15
- export declare const writeData: (path: string, data: any) => Promise<void>;
16
- export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
17
- export declare const onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
18
- export declare const removeDataListener: (listener: any) => void;
19
- declare const _default: {
20
- signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
21
- signOutUser: () => Promise<void>;
22
- readData: (path: string) => Promise<any>;
23
- writeData: (path: string, data: any) => Promise<void>;
24
- onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
25
- removeDataListener: (listener: any) => void;
26
- onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
27
- };
28
- export default _default;
1
+ import { FirebaseApp } from 'firebase/app';
2
+ import { Auth } from 'firebase/auth';
3
+ import { ref, Database, goOnline, goOffline } from 'firebase/database';
4
+ declare let firebaseApp: FirebaseApp;
5
+ declare let auth: Auth;
6
+ declare let database: Database;
7
+ export declare const initFirebase: (config?: any) => void;
8
+ export { database, firebaseApp, auth, ref, goOnline, goOffline };
9
+ export declare const getPath: (path: string) => string;
10
+ export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
11
+ export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
12
+ export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
13
+ export declare const signOutUser: () => Promise<void>;
14
+ export declare const readData: (path: string) => Promise<any>;
15
+ export declare const writeData: (path: string, data: any) => Promise<void>;
16
+ export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
17
+ export declare const onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
18
+ export declare const removeDataListener: (listener: any) => void;
19
+ declare const _default: {
20
+ signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
21
+ signOutUser: () => Promise<void>;
22
+ readData: (path: string) => Promise<any>;
23
+ writeData: (path: string, data: any) => Promise<void>;
24
+ onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
25
+ removeDataListener: (listener: any) => void;
26
+ onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
27
+ };
28
+ export default _default;
package/es/format.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @title: 格式化金额
3
+ * @description:
4
+ * @param {number} amount 原金额
5
+ * @param {number} precision 小数位数
6
+ * @param {string} symbol 货币符号
7
+ * @return {*}
8
+ * @Author: zhiwei.Wang
9
+ * @Date: 2023-11-06 16:51
10
+ */
11
+ export declare const formatAmount: (amount?: number | string, precision?: number, symbol?: string) => string | number;
12
+ export declare type FormatOptions = {
13
+ /** 小数点后位数 默认是小数点后2位 */
14
+ precision?: number;
15
+ /** 显示货币符号 指的是 ¥$ 等货币符号等显隐,默认是展示 */
16
+ showCurrencySymbol?: boolean;
17
+ /** 千分位 指的是长金额的千分位逗号隔开,比如“123, 245, 315” 这种展现形式,默认是关闭 */
18
+ useThousandsSeparator?: boolean;
19
+ /** 整数位隐藏小数 指的是如果价格为整数,后面的".00" 将被省略以节省页面空间 */
20
+ hideDecimalForWholeNumbers?: boolean;
21
+ };
22
+ /**
23
+ * 根据配置格式化金额
24
+ * @param amount
25
+ * @param symbol
26
+ * @param options
27
+ */
28
+ export declare const formatAmountWithOptions: (amount: string | number | undefined, symbol: string | undefined, options: FormatOptions) => string | number;
package/es/format.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { isString, isNumber } from "./typeUtils";
2
2
 
3
- /**
4
- * @title: 格式化金额
5
- * @description:
6
- * @param {number} amount 原金额
7
- * @param {number} precision 小数位数
8
- * @param {string} symbol 货币符号
9
- * @return {*}
10
- * @Author: zhiwei.Wang
11
- * @Date: 2023-11-06 16:51
3
+ /**
4
+ * @title: 格式化金额
5
+ * @description:
6
+ * @param {number} amount 原金额
7
+ * @param {number} precision 小数位数
8
+ * @param {string} symbol 货币符号
9
+ * @return {*}
10
+ * @Author: zhiwei.Wang
11
+ * @Date: 2023-11-06 16:51
12
12
  */
13
13
  export var formatAmount = function formatAmount() {
14
14
  var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -55,11 +55,11 @@ export var formatAmount = function formatAmount() {
55
55
  return amount;
56
56
  }
57
57
  };
58
- /**
59
- * 根据配置格式化金额
60
- * @param amount
61
- * @param symbol
62
- * @param options
58
+ /**
59
+ * 根据配置格式化金额
60
+ * @param amount
61
+ * @param symbol
62
+ * @param options
63
63
  */
64
64
  export var formatAmountWithOptions = function formatAmountWithOptions() {
65
65
  var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
package/es/image.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- export declare const image: {
2
- ali: (url: string, w: number) => string;
3
- getImageSize: (url: string) => {
4
- width: number;
5
- height: number;
6
- ratio: number;
7
- success: boolean;
8
- widthRatio: number;
9
- originRatio: number;
10
- };
11
- };
1
+ export declare const image: {
2
+ ali: (url: string, w: number) => string;
3
+ getImageSize: (url: string) => {
4
+ width: number;
5
+ height: number;
6
+ ratio: number;
7
+ success: boolean;
8
+ widthRatio: number;
9
+ originRatio: number;
10
+ };
11
+ };
package/es/image.js CHANGED
@@ -17,11 +17,11 @@ var ali = function ali(url, w) {
17
17
  return url;
18
18
  };
19
19
 
20
- /**
21
- * @Title: 获取图片尺寸
22
- * @Describe: 通过 __ 进行分割
23
- * @Author: Wzw
24
- * @param {string} url
20
+ /**
21
+ * @Title: 获取图片尺寸
22
+ * @Describe: 通过 __ 进行分割
23
+ * @Author: Wzw
24
+ * @param {string} url
25
25
  */
26
26
 
27
27
  var getImageSize = function getImageSize(url) {
package/es/index.d.ts CHANGED
@@ -1,24 +1,24 @@
1
- export * from './otherUtils';
2
- export * from './typeUtils';
3
- export * from './document';
4
- export * from './date';
5
- export * from './platform';
6
- export * from './log';
7
- export * from './format';
8
- export * from './escPosPrinter';
9
- export * from './miniRedux';
10
- export * from './jsBridge';
11
- export * from './image';
12
- export * from './locales';
13
- export * from './arrayUtils';
14
- export * from './walletValidity';
15
- export * from './common';
16
- export * from './text-input';
17
- export * from './number-input';
18
- export * from './select';
19
- export declare const setPisellUtilsConfig: (config: {
20
- [key: string]: any;
21
- }) => void;
22
- export declare const getPisellUtilsConfig: () => {
23
- [key: string]: any;
24
- };
1
+ export * from './otherUtils';
2
+ export * from './typeUtils';
3
+ export * from './document';
4
+ export * from './date';
5
+ export * from './platform';
6
+ export * from './log';
7
+ export * from './format';
8
+ export * from './escPosPrinter';
9
+ export * from './miniRedux';
10
+ export * from './jsBridge';
11
+ export * from './image';
12
+ export * from './locales';
13
+ export * from './arrayUtils';
14
+ export * from './walletValidity';
15
+ export * from './common';
16
+ export * from './text-input';
17
+ export * from './number-input';
18
+ export * from './select';
19
+ export declare const setPisellUtilsConfig: (config: {
20
+ [key: string]: any;
21
+ }) => void;
22
+ export declare const getPisellUtilsConfig: () => {
23
+ [key: string]: any;
24
+ };