@pisell/utils 1.0.70 → 1.0.72

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 (129) 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/componentStorage.d.ts +36 -36
  9. package/es/componentStorage.js +7 -7
  10. package/es/constants/index.d.ts +7 -7
  11. package/es/date.d.ts +28 -28
  12. package/es/date.js +22 -22
  13. package/es/document.d.ts +13 -13
  14. package/es/document.js +7 -7
  15. package/es/escPosPrinter/index.d.ts +9 -9
  16. package/es/firebase/config/index.d.ts +13 -13
  17. package/es/firebase/index.d.ts +28 -28
  18. package/es/format.js +14 -14
  19. package/es/image.d.ts +11 -11
  20. package/es/image.js +5 -5
  21. package/es/index.d.ts +25 -25
  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/locales.js +15 -15
  26. package/es/log.d.ts +10 -10
  27. package/es/number-input/hooks/index.d.ts +4 -4
  28. package/es/number-input/hooks/index.js +2 -2
  29. package/es/number-input/hooks/useNumberInputState.d.ts +25 -25
  30. package/es/number-input/hooks/useNumberInputState.js +39 -39
  31. package/es/number-input/index.d.ts +14 -14
  32. package/es/number-input/index.js +8 -8
  33. package/es/number-input/types.d.ts +96 -96
  34. package/es/number-input/utils/formatter.d.ts +53 -53
  35. package/es/number-input/utils/formatter.js +37 -37
  36. package/es/number-input/utils/index.d.ts +7 -7
  37. package/es/number-input/utils/index.js +2 -2
  38. package/es/number-input/utils/validation.d.ts +27 -27
  39. package/es/number-input/utils/validation.js +24 -24
  40. package/es/otherUtils.d.ts +48 -48
  41. package/es/otherUtils.js +32 -32
  42. package/es/platform.d.ts +9 -9
  43. package/es/select/hooks/index.d.ts +5 -5
  44. package/es/select/hooks/index.js +2 -2
  45. package/es/select/hooks/useDebouncedSearch.d.ts +20 -20
  46. package/es/select/hooks/useDebouncedSearch.js +17 -17
  47. package/es/select/hooks/useSelectState.d.ts +19 -19
  48. package/es/select/hooks/useSelectState.js +13 -13
  49. package/es/select/index.d.ts +8 -8
  50. package/es/select/index.js +3 -3
  51. package/es/select/types.d.ts +256 -256
  52. package/es/select/utils/filterOptions.d.ts +22 -22
  53. package/es/select/utils/filterOptions.js +16 -16
  54. package/es/select/utils/helpers.d.ts +42 -42
  55. package/es/select/utils/helpers.js +30 -30
  56. package/es/select/utils/index.d.ts +7 -7
  57. package/es/select/utils/index.js +2 -2
  58. package/es/select/utils/sortOptions.d.ts +12 -12
  59. package/es/select/utils/sortOptions.js +8 -8
  60. package/es/select/utils/tagAggregation.d.ts +25 -25
  61. package/es/select/utils/tagAggregation.js +21 -21
  62. package/es/text-input/hooks/index.d.ts +4 -4
  63. package/es/text-input/hooks/index.js +2 -2
  64. package/es/text-input/hooks/useTextInputState.d.ts +24 -24
  65. package/es/text-input/hooks/useTextInputState.js +38 -38
  66. package/es/text-input/index.d.ts +14 -14
  67. package/es/text-input/index.js +9 -9
  68. package/es/text-input/types.d.ts +56 -56
  69. package/es/text-input/utils/index.d.ts +5 -5
  70. package/es/text-input/utils/index.js +2 -2
  71. package/es/text-input/utils/validation.d.ts +23 -23
  72. package/es/text-input/utils/validation.js +20 -20
  73. package/es/typeUtils.d.ts +42 -42
  74. package/es/typeUtils.js +26 -26
  75. package/es/walletValidity.d.ts +44 -44
  76. package/es/walletValidity.js +85 -85
  77. package/lib/arrayUtils.d.ts +1 -1
  78. package/lib/common/index.d.ts +5 -5
  79. package/lib/common/stateHelper.d.ts +18 -18
  80. package/lib/common/types.d.ts +28 -28
  81. package/lib/componentStorage.d.ts +36 -36
  82. package/lib/constants/index.d.ts +7 -7
  83. package/lib/date.d.ts +28 -28
  84. package/lib/document.d.ts +13 -13
  85. package/lib/escPosPrinter/index.d.ts +9 -9
  86. package/lib/firebase/config/index.d.ts +13 -13
  87. package/lib/firebase/index.d.ts +28 -28
  88. package/lib/image.d.ts +11 -11
  89. package/lib/index.d.ts +25 -25
  90. package/lib/jsBridge/regDeviceApi.d.ts +15 -15
  91. package/lib/log.d.ts +10 -10
  92. package/lib/number-input/hooks/index.d.ts +4 -4
  93. package/lib/number-input/hooks/useNumberInputState.d.ts +25 -25
  94. package/lib/number-input/index.d.ts +14 -14
  95. package/lib/number-input/types.d.ts +96 -96
  96. package/lib/number-input/utils/formatter.d.ts +53 -53
  97. package/lib/number-input/utils/index.d.ts +7 -7
  98. package/lib/number-input/utils/validation.d.ts +27 -27
  99. package/lib/otherUtils.d.ts +48 -48
  100. package/lib/platform.d.ts +9 -9
  101. package/lib/select/hooks/index.d.ts +5 -5
  102. package/lib/select/hooks/useDebouncedSearch.d.ts +20 -20
  103. package/lib/select/hooks/useSelectState.d.ts +19 -19
  104. package/lib/select/index.d.ts +8 -8
  105. package/lib/select/types.d.ts +256 -256
  106. package/lib/select/utils/filterOptions.d.ts +22 -22
  107. package/lib/select/utils/helpers.d.ts +42 -42
  108. package/lib/select/utils/index.d.ts +7 -7
  109. package/lib/select/utils/sortOptions.d.ts +12 -12
  110. package/lib/select/utils/tagAggregation.d.ts +25 -25
  111. package/lib/text-input/hooks/index.d.ts +4 -4
  112. package/lib/text-input/hooks/useTextInputState.d.ts +24 -24
  113. package/lib/text-input/index.d.ts +14 -14
  114. package/lib/text-input/types.d.ts +56 -56
  115. package/lib/text-input/utils/index.d.ts +5 -5
  116. package/lib/text-input/utils/validation.d.ts +23 -23
  117. package/lib/typeUtils.d.ts +42 -42
  118. package/lib/walletValidity.d.ts +44 -44
  119. package/package.json +1 -1
  120. package/es/format.d.ts +0 -28
  121. package/es/jsBridge/index.d.ts +0 -22
  122. package/es/jsBridge/types.d.ts +0 -149
  123. package/es/locales.d.ts +0 -9
  124. package/es/miniRedux.d.ts +0 -16
  125. package/lib/format.d.ts +0 -28
  126. package/lib/jsBridge/index.d.ts +0 -22
  127. package/lib/jsBridge/types.d.ts +0 -149
  128. package/lib/locales.d.ts +0 -9
  129. package/lib/miniRedux.d.ts +0 -16
@@ -1,48 +1,48 @@
1
- /**
2
- * @title: 判断是否无痕模式
3
- * @description:
4
- * @return: *
5
- * @Author: shengjie.zuo
6
- * @Date: 2024-09-4 09:58:22
7
- */
8
- export declare const detectIncognito: () => Promise<{
9
- isPrivate: boolean;
10
- browserName: string;
11
- } | {
12
- isPrivate: boolean;
13
- }>;
14
- /**
15
- * @Description: 生成唯一id
16
- * @Author: wzw
17
- * @Date: 2020-12-01 14:20:29
18
- * @param {*}
19
- * @return {*}
20
- */
21
- export declare const getUniqueId: (prefix?: string, maxLength?: number) => string;
22
- /**
23
- * @title: 对数组进行增|删
24
- * @description: 用于多选选中和取消选中的处理
25
- * @param {any} list
26
- * @param {any} item
27
- * @param {string} key
28
- * @return {*}
29
- * @Author: zhiwei.Wang
30
- * @Date: 2023-12-19 16:44
31
- */
32
- export declare const changeArray: <T>(list: T[] | undefined, item: T, key?: string) => T[];
33
- /**
34
- * @title: 判断某个字段是否在列表内
35
- * @description:
36
- * @param {*} T
37
- * @param {boolean} param2
38
- * @return {*}
39
- * @Author: zhiwei.Wang
40
- * @Date: 2023-12-19 16:54
41
- */
42
- export declare const getItemByArray: <T>(list: T[] | undefined, item: T, key?: string) => boolean;
43
- export declare const createArray: (length: number, returnItem: any) => unknown[];
44
- /**
45
- * 根据对象内容生成唯一id
46
- * @param obj
47
- */
48
- export declare const generateUniqueIdByObj: (obj: Record<string, any>) => any;
1
+ /**
2
+ * @title: 判断是否无痕模式
3
+ * @description:
4
+ * @return: *
5
+ * @Author: shengjie.zuo
6
+ * @Date: 2024-09-4 09:58:22
7
+ */
8
+ export declare const detectIncognito: () => Promise<{
9
+ isPrivate: boolean;
10
+ browserName: string;
11
+ } | {
12
+ isPrivate: boolean;
13
+ }>;
14
+ /**
15
+ * @Description: 生成唯一id
16
+ * @Author: wzw
17
+ * @Date: 2020-12-01 14:20:29
18
+ * @param {*}
19
+ * @return {*}
20
+ */
21
+ export declare const getUniqueId: (prefix?: string, maxLength?: number) => string;
22
+ /**
23
+ * @title: 对数组进行增|删
24
+ * @description: 用于多选选中和取消选中的处理
25
+ * @param {any} list
26
+ * @param {any} item
27
+ * @param {string} key
28
+ * @return {*}
29
+ * @Author: zhiwei.Wang
30
+ * @Date: 2023-12-19 16:44
31
+ */
32
+ export declare const changeArray: <T>(list: T[] | undefined, item: T, key?: string) => T[];
33
+ /**
34
+ * @title: 判断某个字段是否在列表内
35
+ * @description:
36
+ * @param {*} T
37
+ * @param {boolean} param2
38
+ * @return {*}
39
+ * @Author: zhiwei.Wang
40
+ * @Date: 2023-12-19 16:54
41
+ */
42
+ export declare const getItemByArray: <T>(list: T[] | undefined, item: T, key?: string) => boolean;
43
+ export declare const createArray: (length: number, returnItem: any) => unknown[];
44
+ /**
45
+ * 根据对象内容生成唯一id
46
+ * @param obj
47
+ */
48
+ export declare const generateUniqueIdByObj: (obj: Record<string, any>) => any;
package/lib/platform.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare const isIpad: () => boolean;
2
- export declare const isMobile: () => boolean;
3
- export declare const isAndroid: () => boolean;
4
- export declare const isIos: () => boolean;
5
- export declare const checkEnv: () => number;
6
- export declare const isWx: () => boolean;
7
- export declare const isIOS: () => boolean;
8
- export declare const isWxApp: () => boolean;
9
- export declare const isSafari: () => boolean;
1
+ export declare const isIpad: () => boolean;
2
+ export declare const isMobile: () => boolean;
3
+ export declare const isAndroid: () => boolean;
4
+ export declare const isIos: () => boolean;
5
+ export declare const checkEnv: () => number;
6
+ export declare const isWx: () => boolean;
7
+ export declare const isIOS: () => boolean;
8
+ export declare const isWxApp: () => boolean;
9
+ export declare const isSafari: () => boolean;
@@ -1,5 +1,5 @@
1
- /**
2
- * Select Hooks 导出
3
- */
4
- export { useSelectState, useMultipleSelectState } from './useSelectState';
5
- export { useDebouncedSearch } from './useDebouncedSearch';
1
+ /**
2
+ * Select Hooks 导出
3
+ */
4
+ export { useSelectState, useMultipleSelectState } from './useSelectState';
5
+ export { useDebouncedSearch } from './useDebouncedSearch';
@@ -1,20 +1,20 @@
1
- /**
2
- * 防抖搜索 Hook
3
- * 对用户输入进行防抖处理,避免频繁触发搜索
4
- */
5
- /**
6
- * 防抖搜索 Hook
7
- * @template T 值的类型
8
- * @param initialValue 初始值
9
- * @param delay 防抖延迟时间(毫秒)
10
- * @param callback 防抖后的回调函数
11
- * @returns [防抖后的值, 设置值函数]
12
- *
13
- * @example
14
- * ```tsx
15
- * const [debouncedSearch, setSearchInput] = useDebouncedSearch('', 300, (text) => {
16
- * console.log('搜索关键词:', text);
17
- * });
18
- * ```
19
- */
20
- export declare function useDebouncedSearch<T = string>(initialValue: T, delay: number, callback?: (value: T) => void): [T, (value: T) => void];
1
+ /**
2
+ * 防抖搜索 Hook
3
+ * 对用户输入进行防抖处理,避免频繁触发搜索
4
+ */
5
+ /**
6
+ * 防抖搜索 Hook
7
+ * @template T 值的类型
8
+ * @param initialValue 初始值
9
+ * @param delay 防抖延迟时间(毫秒)
10
+ * @param callback 防抖后的回调函数
11
+ * @returns [防抖后的值, 设置值函数]
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const [debouncedSearch, setSearchInput] = useDebouncedSearch('', 300, (text) => {
16
+ * console.log('搜索关键词:', text);
17
+ * });
18
+ * ```
19
+ */
20
+ export declare function useDebouncedSearch<T = string>(initialValue: T, delay: number, callback?: (value: T) => void): [T, (value: T) => void];
@@ -1,19 +1,19 @@
1
- /**
2
- * Select 状态管理 Hook
3
- * 处理受控/非受控模式,适用于单选和多选
4
- */
5
- import type { UseSelectStateOptions, UseMultipleSelectStateOptions, SelectState, MultipleSelectState } from '../types';
6
- /**
7
- * 单选状态管理 Hook
8
- * @template T 值的类型
9
- * @param options Hook 配置选项
10
- * @returns 状态管理对象
11
- */
12
- export declare function useSelectState<T = string | number>(options: UseSelectStateOptions<T>): SelectState<T>;
13
- /**
14
- * 多选状态管理 Hook
15
- * @template T 值的类型
16
- * @param options Hook 配置选项
17
- * @returns 状态管理对象
18
- */
19
- export declare function useMultipleSelectState<T = string | number>(options: UseMultipleSelectStateOptions<T>): MultipleSelectState<T>;
1
+ /**
2
+ * Select 状态管理 Hook
3
+ * 处理受控/非受控模式,适用于单选和多选
4
+ */
5
+ import type { UseSelectStateOptions, UseMultipleSelectStateOptions, SelectState, MultipleSelectState } from '../types';
6
+ /**
7
+ * 单选状态管理 Hook
8
+ * @template T 值的类型
9
+ * @param options Hook 配置选项
10
+ * @returns 状态管理对象
11
+ */
12
+ export declare function useSelectState<T = string | number>(options: UseSelectStateOptions<T>): SelectState<T>;
13
+ /**
14
+ * 多选状态管理 Hook
15
+ * @template T 值的类型
16
+ * @param options Hook 配置选项
17
+ * @returns 状态管理对象
18
+ */
19
+ export declare function useMultipleSelectState<T = string | number>(options: UseMultipleSelectStateOptions<T>): MultipleSelectState<T>;
@@ -1,8 +1,8 @@
1
- /**
2
- * Select 组件相关工具和类型导出
3
- * 供 PisellSingleSelect、PisellMultipleSelect 等组件使用
4
- */
5
- export type { SelectOption, FilterOptionFunc, SortDirection, SelectState, MultipleSelectState, TagDisplayInfo, UseSelectStateOptions, UseMultipleSelectStateOptions, BaseSelectProps, } from './types';
6
- export { useSelectState, useMultipleSelectState } from './hooks/useSelectState';
7
- export { useDebouncedSearch } from './hooks/useDebouncedSearch';
8
- export { filterOptions, defaultFilterOption, sortOptions, calculateTagDisplay, findOptionByValue, findOptionsByValues, isOptionSelected, isOptionSelectedInMultiple, generateId, } from './utils';
1
+ /**
2
+ * Select 组件相关工具和类型导出
3
+ * 供 PisellSingleSelect、PisellMultipleSelect 等组件使用
4
+ */
5
+ export type { SelectOption, FilterOptionFunc, SortDirection, SelectState, MultipleSelectState, TagDisplayInfo, UseSelectStateOptions, UseMultipleSelectStateOptions, BaseSelectProps, } from './types';
6
+ export { useSelectState, useMultipleSelectState } from './hooks/useSelectState';
7
+ export { useDebouncedSearch } from './hooks/useDebouncedSearch';
8
+ export { filterOptions, defaultFilterOption, sortOptions, calculateTagDisplay, findOptionByValue, findOptionsByValues, isOptionSelected, isOptionSelectedInMultiple, generateId, } from './utils';