@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
@@ -1,25 +1,25 @@
1
- import type { BaseNumberInputProps, NumberInputState } from '../types';
2
- /**
3
- * 数值输入状态管理 Hook
4
- *
5
- * 管理组件的内部状态,包括:
6
- * - 值管理(受控/非受控模式)
7
- * - 校验状态管理
8
- * - 事件处理函数封装
9
- *
10
- * 支持受控和非受控两种模式:
11
- * - 受控模式:value 由外部传入,组件不维护内部状态
12
- * - 非受控模式:使用 defaultValue,组件维护内部状态
13
- *
14
- * @param props 组件 Props(包含校验配置)
15
- * @returns 数值输入状态对象
16
- *
17
- * @example
18
- * // 受控模式
19
- * const state = useNumberInputState({ value: 10, onChange: (v) => console.log(v) });
20
- *
21
- * @example
22
- * // 非受控模式
23
- * const state = useNumberInputState({ defaultValue: 10, min: 0, max: 100 });
24
- */
25
- export declare function useNumberInputState(props: BaseNumberInputProps): NumberInputState;
1
+ import type { BaseNumberInputProps, NumberInputState } from '../types';
2
+ /**
3
+ * 数值输入状态管理 Hook
4
+ *
5
+ * 管理组件的内部状态,包括:
6
+ * - 值管理(受控/非受控模式)
7
+ * - 校验状态管理
8
+ * - 事件处理函数封装
9
+ *
10
+ * 支持受控和非受控两种模式:
11
+ * - 受控模式:value 由外部传入,组件不维护内部状态
12
+ * - 非受控模式:使用 defaultValue,组件维护内部状态
13
+ *
14
+ * @param props 组件 Props(包含校验配置)
15
+ * @returns 数值输入状态对象
16
+ *
17
+ * @example
18
+ * // 受控模式
19
+ * const state = useNumberInputState({ value: 10, onChange: (v) => console.log(v) });
20
+ *
21
+ * @example
22
+ * // 非受控模式
23
+ * const state = useNumberInputState({ defaultValue: 10, min: 0, max: 100 });
24
+ */
25
+ export declare function useNumberInputState(props: BaseNumberInputProps): NumberInputState;
@@ -1,14 +1,14 @@
1
- /**
2
- * 数值输入组件公共逻辑导出
3
- *
4
- * 供以下组件使用:
5
- * - PisellNumber
6
- * - PisellCurrency
7
- * - PisellPercent
8
- * - 其他数值输入组件
9
- */
10
- export type { DisplayState, ValidationResult, NumberInputState, BaseNumberInputProps, } from './types';
11
- export { useNumberInputState } from './hooks';
12
- export { getDisplayState, formatNumber, addThousandsSeparator, formatPrecision, } from './utils';
13
- export { validateValue as validateNumberValue } from './utils';
14
- export type { NumberFormatOptions } from './utils';
1
+ /**
2
+ * 数值输入组件公共逻辑导出
3
+ *
4
+ * 供以下组件使用:
5
+ * - PisellNumber
6
+ * - PisellCurrency
7
+ * - PisellPercent
8
+ * - 其他数值输入组件
9
+ */
10
+ export type { DisplayState, ValidationResult, NumberInputState, BaseNumberInputProps, } from './types';
11
+ export { useNumberInputState } from './hooks';
12
+ export { getDisplayState, formatNumber, addThousandsSeparator, formatPrecision, } from './utils';
13
+ export { validateValue as validateNumberValue } from './utils';
14
+ export type { NumberFormatOptions } from './utils';
@@ -1,96 +1,96 @@
1
- /**
2
- * 数值输入组件公共类型定义
3
- * 供 PisellNumber、PisellCurrency、PisellPercent 等组件使用
4
- */
5
- export type { DisplayState, ValidationResult } from '../common';
6
- /**
7
- * 数值输入状态 Hook 返回值
8
- */
9
- export interface NumberInputState {
10
- /**
11
- * 当前值
12
- */
13
- value: number | null | undefined;
14
- /**
15
- * 是否已被触摸(交互过)
16
- */
17
- isTouched: boolean;
18
- /**
19
- * 是否校验通过
20
- */
21
- isValid: boolean;
22
- /**
23
- * 错误信息数组
24
- */
25
- errors: string[];
26
- /**
27
- * 值变更处理函数
28
- */
29
- handleChange: (value: number | null) => void;
30
- /**
31
- * 失焦处理函数
32
- */
33
- handleBlur: () => void;
34
- /**
35
- * 聚焦处理函数
36
- */
37
- handleFocus: () => void;
38
- }
39
- /**
40
- * 基础数值输入 Props(供校验和状态管理使用)
41
- */
42
- export interface BaseNumberInputProps {
43
- /**
44
- * 当前值(受控)
45
- */
46
- value?: number | null;
47
- /**
48
- * 默认值(非受控)
49
- */
50
- defaultValue?: number | null;
51
- /**
52
- * 是否必填
53
- */
54
- required?: boolean;
55
- /**
56
- * 最小值
57
- */
58
- min?: number;
59
- /**
60
- * 最大值
61
- */
62
- max?: number;
63
- /**
64
- * 自定义校验函数
65
- * @param value 当前值
66
- * @returns true 表示通过,false 或错误信息字符串表示不通过
67
- */
68
- validator?: (value: number | null) => boolean | string;
69
- /**
70
- * 校验触发时机
71
- * - onChange: 输入时即时校验
72
- * - onBlur: 失焦时校验
73
- * - both: 输入和失焦时都校验
74
- */
75
- validateTrigger?: 'onChange' | 'onBlur' | 'both';
76
- /**
77
- * 自定义错误提示信息
78
- */
79
- errorMessage?: string;
80
- /**
81
- * 值变更回调
82
- */
83
- onChange?: (value: number | null) => void;
84
- /**
85
- * 失焦回调
86
- */
87
- onBlur?: (value: number | null) => void;
88
- /**
89
- * 聚焦回调
90
- */
91
- onFocus?: () => void;
92
- /**
93
- * 校验回调
94
- */
95
- onValidate?: (isValid: boolean, errors: string[]) => void;
96
- }
1
+ /**
2
+ * 数值输入组件公共类型定义
3
+ * 供 PisellNumber、PisellCurrency、PisellPercent 等组件使用
4
+ */
5
+ export type { DisplayState, ValidationResult } from '../common';
6
+ /**
7
+ * 数值输入状态 Hook 返回值
8
+ */
9
+ export interface NumberInputState {
10
+ /**
11
+ * 当前值
12
+ */
13
+ value: number | null | undefined;
14
+ /**
15
+ * 是否已被触摸(交互过)
16
+ */
17
+ isTouched: boolean;
18
+ /**
19
+ * 是否校验通过
20
+ */
21
+ isValid: boolean;
22
+ /**
23
+ * 错误信息数组
24
+ */
25
+ errors: string[];
26
+ /**
27
+ * 值变更处理函数
28
+ */
29
+ handleChange: (value: number | null) => void;
30
+ /**
31
+ * 失焦处理函数
32
+ */
33
+ handleBlur: () => void;
34
+ /**
35
+ * 聚焦处理函数
36
+ */
37
+ handleFocus: () => void;
38
+ }
39
+ /**
40
+ * 基础数值输入 Props(供校验和状态管理使用)
41
+ */
42
+ export interface BaseNumberInputProps {
43
+ /**
44
+ * 当前值(受控)
45
+ */
46
+ value?: number | null;
47
+ /**
48
+ * 默认值(非受控)
49
+ */
50
+ defaultValue?: number | null;
51
+ /**
52
+ * 是否必填
53
+ */
54
+ required?: boolean;
55
+ /**
56
+ * 最小值
57
+ */
58
+ min?: number;
59
+ /**
60
+ * 最大值
61
+ */
62
+ max?: number;
63
+ /**
64
+ * 自定义校验函数
65
+ * @param value 当前值
66
+ * @returns true 表示通过,false 或错误信息字符串表示不通过
67
+ */
68
+ validator?: (value: number | null) => boolean | string;
69
+ /**
70
+ * 校验触发时机
71
+ * - onChange: 输入时即时校验
72
+ * - onBlur: 失焦时校验
73
+ * - both: 输入和失焦时都校验
74
+ */
75
+ validateTrigger?: 'onChange' | 'onBlur' | 'both';
76
+ /**
77
+ * 自定义错误提示信息
78
+ */
79
+ errorMessage?: string;
80
+ /**
81
+ * 值变更回调
82
+ */
83
+ onChange?: (value: number | null) => void;
84
+ /**
85
+ * 失焦回调
86
+ */
87
+ onBlur?: (value: number | null) => void;
88
+ /**
89
+ * 聚焦回调
90
+ */
91
+ onFocus?: () => void;
92
+ /**
93
+ * 校验回调
94
+ */
95
+ onValidate?: (isValid: boolean, errors: string[]) => void;
96
+ }
@@ -1,53 +1,53 @@
1
- /**
2
- * 数值格式化工具函数
3
- */
4
- /**
5
- * 格式化选项
6
- */
7
- export interface NumberFormatOptions {
8
- /** 小数精度 */
9
- precision?: number;
10
- /** 是否使用千分位分隔符 */
11
- useGrouping?: boolean;
12
- /** 自定义格式化函数 */
13
- formatter?: (value: number | null) => string;
14
- }
15
- /**
16
- * 格式化数值
17
- *
18
- * @param value 数值
19
- * @param options 格式化选项
20
- * @returns 格式化后的字符串,null 时返回 null
21
- *
22
- * @example
23
- * formatNumber(1234.567, { precision: 2, useGrouping: true })
24
- * // 返回: "1,234.57"
25
- *
26
- * @example
27
- * formatNumber(1234, { precision: 0, useGrouping: true })
28
- * // 返回: "1,234"
29
- */
30
- export declare function formatNumber(value: number | null | undefined, options?: NumberFormatOptions): string | null;
31
- /**
32
- * 添加千分位分隔符
33
- *
34
- * @param value 数值
35
- * @returns 添加千分位后的字符串
36
- *
37
- * @example
38
- * addThousandsSeparator(1234567)
39
- * // 返回: "1,234,567"
40
- */
41
- export declare function addThousandsSeparator(value: number): string;
42
- /**
43
- * 格式化精度
44
- *
45
- * @param value 数值
46
- * @param precision 小数位数
47
- * @returns 格式化后的数值
48
- *
49
- * @example
50
- * formatPrecision(1.2345, 2)
51
- * // 返回: 1.23
52
- */
53
- export declare function formatPrecision(value: number, precision: number): number;
1
+ /**
2
+ * 数值格式化工具函数
3
+ */
4
+ /**
5
+ * 格式化选项
6
+ */
7
+ export interface NumberFormatOptions {
8
+ /** 小数精度 */
9
+ precision?: number;
10
+ /** 是否使用千分位分隔符 */
11
+ useGrouping?: boolean;
12
+ /** 自定义格式化函数 */
13
+ formatter?: (value: number | null) => string;
14
+ }
15
+ /**
16
+ * 格式化数值
17
+ *
18
+ * @param value 数值
19
+ * @param options 格式化选项
20
+ * @returns 格式化后的字符串,null 时返回 null
21
+ *
22
+ * @example
23
+ * formatNumber(1234.567, { precision: 2, useGrouping: true })
24
+ * // 返回: "1,234.57"
25
+ *
26
+ * @example
27
+ * formatNumber(1234, { precision: 0, useGrouping: true })
28
+ * // 返回: "1,234"
29
+ */
30
+ export declare function formatNumber(value: number | null | undefined, options?: NumberFormatOptions): string | null;
31
+ /**
32
+ * 添加千分位分隔符
33
+ *
34
+ * @param value 数值
35
+ * @returns 添加千分位后的字符串
36
+ *
37
+ * @example
38
+ * addThousandsSeparator(1234567)
39
+ * // 返回: "1,234,567"
40
+ */
41
+ export declare function addThousandsSeparator(value: number): string;
42
+ /**
43
+ * 格式化精度
44
+ *
45
+ * @param value 数值
46
+ * @param precision 小数位数
47
+ * @returns 格式化后的数值
48
+ *
49
+ * @example
50
+ * formatPrecision(1.2345, 2)
51
+ * // 返回: 1.23
52
+ */
53
+ export declare function formatPrecision(value: number, precision: number): number;
@@ -1,7 +1,7 @@
1
- /**
2
- * 数值输入工具函数导出
3
- */
4
- export { validateValue } from './validation';
5
- export { getDisplayState } from '../../common';
6
- export { formatNumber, addThousandsSeparator, formatPrecision } from './formatter';
7
- export type { NumberFormatOptions } from './formatter';
1
+ /**
2
+ * 数值输入工具函数导出
3
+ */
4
+ export { validateValue } from './validation';
5
+ export { getDisplayState } from '../../common';
6
+ export { formatNumber, addThousandsSeparator, formatPrecision } from './formatter';
7
+ export type { NumberFormatOptions } from './formatter';
@@ -1,27 +1,27 @@
1
- import type { BaseNumberInputProps, ValidationResult } from '../types';
2
- /**
3
- * 校验数值输入
4
- *
5
- * 按照优先级执行校验规则:
6
- * 1. 必填校验(required)
7
- * 2. 最小值校验(min)
8
- * 3. 最大值校验(max)
9
- * 4. 自定义校验函数(validator)
10
- *
11
- * @param value 待校验的值
12
- * @param props 校验配置
13
- * @returns 校验结果对象,包含 isValid 和 errors
14
- *
15
- * @example
16
- * validateValue(10, { required: true, min: 0, max: 100 })
17
- * // { isValid: true, errors: [] }
18
- *
19
- * @example
20
- * validateValue(null, { required: true })
21
- * // { isValid: false, errors: ['此字段为必填项'] }
22
- *
23
- * @example
24
- * validateValue(150, { min: 0, max: 100 })
25
- * // { isValid: false, errors: ['不能大于 100'] }
26
- */
27
- export declare function validateValue(value: number | null | undefined, props: BaseNumberInputProps): ValidationResult;
1
+ import type { BaseNumberInputProps, ValidationResult } from '../types';
2
+ /**
3
+ * 校验数值输入
4
+ *
5
+ * 按照优先级执行校验规则:
6
+ * 1. 必填校验(required)
7
+ * 2. 最小值校验(min)
8
+ * 3. 最大值校验(max)
9
+ * 4. 自定义校验函数(validator)
10
+ *
11
+ * @param value 待校验的值
12
+ * @param props 校验配置
13
+ * @returns 校验结果对象,包含 isValid 和 errors
14
+ *
15
+ * @example
16
+ * validateValue(10, { required: true, min: 0, max: 100 })
17
+ * // { isValid: true, errors: [] }
18
+ *
19
+ * @example
20
+ * validateValue(null, { required: true })
21
+ * // { isValid: false, errors: ['此字段为必填项'] }
22
+ *
23
+ * @example
24
+ * validateValue(150, { min: 0, max: 100 })
25
+ * // { isValid: false, errors: ['不能大于 100'] }
26
+ */
27
+ export declare function validateValue(value: number | null | undefined, props: BaseNumberInputProps): ValidationResult;
@@ -0,0 +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;
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';