@pisell/materials 1.0.1034 → 1.0.1035

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 (254) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +17 -17
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +18 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +27 -32
  11. package/es/components/Pagination/index.js +1 -1
  12. package/es/components/PisellCards/index.d.ts +6 -6
  13. package/es/components/calendar/index.d.ts +2 -2
  14. package/es/components/checkbox/index.d.ts +2 -2
  15. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
  16. package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
  17. package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
  18. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +3 -3
  19. package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
  20. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  21. package/es/components/date-picker/index.d.ts +2 -2
  22. package/es/components/filter/components/Dropdown/index.js +6 -2
  23. package/es/components/filter/components/FilterButton/index.js +3 -2
  24. package/es/components/filter/components/FilterButton/types.d.ts +5 -2
  25. package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +67 -0
  26. package/es/components/filter/components/FilterItem/index.js +105 -6
  27. package/es/components/filter/components/FilterItem/index.less +90 -0
  28. package/es/components/filter/types.d.ts +4 -2
  29. package/es/components/input/index.d.ts +2 -2
  30. package/es/components/pisell-config-provider/context.d.ts +2 -2
  31. package/es/components/pisellCurrency/PisellCurrency.less +163 -25
  32. package/es/components/pisellDatePicker/index.d.ts +2 -2
  33. package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
  34. package/es/components/pisellDateTimeDisplay/types.d.ts +5 -0
  35. package/es/components/pisellEmail/PisellEmail.d.ts +2 -33
  36. package/es/components/pisellEmail/PisellEmail.js +1 -1
  37. package/es/components/pisellEmail/PisellEmail.less +119 -10
  38. package/es/components/pisellEmail/index.d.ts +1 -1
  39. package/es/components/pisellFilter/docs/PisellFilter.md +289 -232
  40. package/es/components/pisellFilter/index.js +66 -11
  41. package/es/components/pisellLongText/PisellLongText.less +72 -4
  42. package/es/components/pisellLookup/PisellLookup.js +3 -3
  43. package/es/components/pisellLookup/PisellLookup.less +14 -9
  44. package/es/components/pisellLookup/components/LookupTrigger.js +6 -2
  45. package/es/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
  46. package/es/components/pisellMetricCard/PisellMetricCard.js +136 -0
  47. package/es/components/pisellMetricCard/components/MetricComparison.js +54 -0
  48. package/es/components/pisellMetricCard/components/MetricTitle.js +41 -0
  49. package/es/components/pisellMetricCard/components/MetricValue.js +26 -0
  50. package/es/components/pisellMetricCard/components/TrendIcon.js +26 -0
  51. package/es/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
  52. package/es/components/pisellMetricCard/index.d.ts +2 -0
  53. package/es/components/pisellMetricCard/types.d.ts +143 -0
  54. package/es/components/pisellMetricCard/utils/calculateTrend.js +22 -0
  55. package/es/components/pisellMetricCard/utils/formatMetricValue.js +52 -0
  56. package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
  57. package/es/components/pisellMultipleSelect/components/EditView.js +8 -1
  58. package/es/components/pisellMultipleSelect/components/ReadOnlyView.js +18 -6
  59. package/es/components/pisellNumber/PisellNumber.less +135 -17
  60. package/es/components/pisellPercent/PisellPercent.less +142 -24
  61. package/es/components/pisellPhone/PisellPhone.less +122 -27
  62. package/es/components/pisellPhone/components/EditView.js +1 -1
  63. package/es/components/pisellPhone/components/ReadOnlyView.js +15 -5
  64. package/es/components/pisellPhone/utils/countryCodeHelper.js +1 -10
  65. package/es/components/pisellRating/PisellRating.less +20 -12
  66. package/es/components/pisellRecordBoard/PisellRecordBoard.js +148 -0
  67. package/es/components/pisellRecordBoard/README.md +183 -0
  68. package/es/components/pisellRecordBoard/context/RecordBoardContext.js +7 -0
  69. package/es/components/pisellRecordBoard/context/RecordBoardProvider.js +14 -0
  70. package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
  71. package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
  72. package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
  73. package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
  74. package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
  75. package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.js +16 -0
  76. package/es/components/pisellRecordBoard/index.d.ts +40 -0
  77. package/es/components/pisellRecordBoard/index.js +28 -0
  78. package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
  79. package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.js +24 -0
  80. package/es/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
  81. package/es/components/pisellRecordBoard/layouts/CardLayout/index.js +21 -0
  82. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
  83. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +105 -0
  84. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
  85. package/es/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
  86. package/es/components/pisellRecordBoard/layouts/GridLayout/index.js +21 -0
  87. package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
  88. package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +69 -0
  89. package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +40 -0
  90. package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +60 -0
  91. package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
  92. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
  93. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +52 -0
  94. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
  95. package/es/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
  96. package/es/components/pisellRecordBoard/shellFrame/Search/index.js +34 -0
  97. package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
  98. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
  99. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +136 -0
  100. package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +2 -0
  101. package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +62 -0
  102. package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
  103. package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +45 -0
  104. package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
  105. package/es/components/pisellRecordBoard/shellFrame/index.d.ts +27 -0
  106. package/es/components/pisellRecordBoard/shellFrame/index.js +38 -0
  107. package/es/components/pisellRecordBoard/types.d.ts +259 -0
  108. package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +287 -0
  109. package/es/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
  110. package/es/components/pisellShellFrame/PisellShellFrame.js +60 -0
  111. package/es/components/pisellShellFrame/PisellShellFrame.less +73 -0
  112. package/es/components/pisellShellFrame/README.md +58 -0
  113. package/es/components/pisellShellFrame/index.d.ts +2 -0
  114. package/es/components/pisellShellFrame/types.d.ts +60 -0
  115. package/es/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
  116. package/es/components/pisellSingleSelect/components/EditView.js +8 -1
  117. package/es/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
  118. package/es/components/pisellUrl/PisellUrl.d.ts +2 -33
  119. package/es/components/pisellUrl/PisellUrl.js +1 -1
  120. package/es/components/pisellUrl/PisellUrl.less +120 -11
  121. package/es/components/pisellUrl/index.d.ts +1 -1
  122. package/es/components/radio/index.d.ts +2 -2
  123. package/es/components/section-footers/index.d.ts +2 -2
  124. package/es/components/skeleton/index.d.ts +2 -2
  125. package/es/components/sort/index.js +12 -1
  126. package/es/components/sort/types.d.ts +8 -2
  127. package/es/components/time-picker/index.d.ts +2 -2
  128. package/es/index.d.ts +19 -11
  129. package/es/index.js +19 -15
  130. package/es/locales/en-US.js +16 -2
  131. package/es/locales/zh-CN.js +18 -4
  132. package/es/locales/zh-TW.js +18 -4
  133. package/es/utils/tagColor.js +31 -0
  134. package/lib/components/Pagination/index.js +1 -1
  135. package/lib/components/checkbox/index.d.ts +2 -2
  136. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
  137. package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +2 -2
  138. package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
  139. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  140. package/lib/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
  141. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  142. package/lib/components/filter/components/Dropdown/index.js +6 -2
  143. package/lib/components/filter/components/FilterButton/index.js +3 -2
  144. package/lib/components/filter/components/FilterButton/types.d.ts +5 -2
  145. package/lib/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +69 -0
  146. package/lib/components/filter/components/FilterItem/index.js +106 -6
  147. package/lib/components/filter/components/FilterItem/index.less +90 -0
  148. package/lib/components/filter/types.d.ts +4 -2
  149. package/lib/components/input/index.d.ts +2 -2
  150. package/lib/components/pisell-config-provider/context.d.ts +2 -2
  151. package/lib/components/pisellCurrency/PisellCurrency.less +163 -25
  152. package/lib/components/pisellDatePicker/index.d.ts +2 -2
  153. package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
  154. package/lib/components/pisellDateTimeDisplay/types.d.ts +5 -0
  155. package/lib/components/pisellEmail/PisellEmail.d.ts +2 -33
  156. package/lib/components/pisellEmail/PisellEmail.js +1 -1
  157. package/lib/components/pisellEmail/PisellEmail.less +119 -10
  158. package/lib/components/pisellEmail/index.d.ts +1 -1
  159. package/lib/components/pisellFilter/docs/PisellFilter.md +289 -232
  160. package/lib/components/pisellFilter/index.js +65 -10
  161. package/lib/components/pisellLongText/PisellLongText.less +72 -4
  162. package/lib/components/pisellLookup/PisellLookup.js +3 -3
  163. package/lib/components/pisellLookup/PisellLookup.less +14 -9
  164. package/lib/components/pisellLookup/components/LookupTrigger.js +6 -2
  165. package/lib/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
  166. package/lib/components/pisellMetricCard/PisellMetricCard.js +138 -0
  167. package/lib/components/pisellMetricCard/components/MetricComparison.js +56 -0
  168. package/lib/components/pisellMetricCard/components/MetricTitle.js +43 -0
  169. package/lib/components/pisellMetricCard/components/MetricValue.js +28 -0
  170. package/lib/components/pisellMetricCard/components/TrendIcon.js +28 -0
  171. package/lib/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
  172. package/lib/components/pisellMetricCard/index.d.ts +2 -0
  173. package/lib/components/pisellMetricCard/types.d.ts +143 -0
  174. package/lib/components/pisellMetricCard/utils/calculateTrend.js +23 -0
  175. package/lib/components/pisellMetricCard/utils/formatMetricValue.js +53 -0
  176. package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
  177. package/lib/components/pisellMultipleSelect/components/EditView.js +7 -0
  178. package/lib/components/pisellMultipleSelect/components/ReadOnlyView.js +17 -5
  179. package/lib/components/pisellNumber/PisellNumber.less +135 -17
  180. package/lib/components/pisellPercent/PisellPercent.less +142 -24
  181. package/lib/components/pisellPhone/PisellPhone.less +122 -27
  182. package/lib/components/pisellPhone/components/EditView.js +1 -1
  183. package/lib/components/pisellPhone/components/ReadOnlyView.js +15 -5
  184. package/lib/components/pisellPhone/utils/countryCodeHelper.js +0 -10
  185. package/lib/components/pisellRating/PisellRating.less +20 -12
  186. package/lib/components/pisellRecordBoard/PisellRecordBoard.js +150 -0
  187. package/lib/components/pisellRecordBoard/README.md +183 -0
  188. package/lib/components/pisellRecordBoard/context/RecordBoardContext.js +8 -0
  189. package/lib/components/pisellRecordBoard/context/RecordBoardProvider.js +16 -0
  190. package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
  191. package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
  192. package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
  193. package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
  194. package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
  195. package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.js +17 -0
  196. package/lib/components/pisellRecordBoard/index.d.ts +40 -0
  197. package/lib/components/pisellRecordBoard/index.js +28 -0
  198. package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
  199. package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.js +26 -0
  200. package/lib/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
  201. package/lib/components/pisellRecordBoard/layouts/CardLayout/index.js +23 -0
  202. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
  203. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +107 -0
  204. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
  205. package/lib/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
  206. package/lib/components/pisellRecordBoard/layouts/GridLayout/index.js +23 -0
  207. package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
  208. package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +71 -0
  209. package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +43 -0
  210. package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +62 -0
  211. package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
  212. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
  213. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +54 -0
  214. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
  215. package/lib/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
  216. package/lib/components/pisellRecordBoard/shellFrame/Search/index.js +36 -0
  217. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
  218. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
  219. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +139 -0
  220. package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +64 -0
  221. package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
  222. package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +47 -0
  223. package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
  224. package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +26 -0
  225. package/lib/components/pisellRecordBoard/shellFrame/index.js +40 -0
  226. package/lib/components/pisellRecordBoard/types.d.ts +259 -0
  227. package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +292 -0
  228. package/lib/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
  229. package/lib/components/pisellShellFrame/PisellShellFrame.js +62 -0
  230. package/lib/components/pisellShellFrame/PisellShellFrame.less +73 -0
  231. package/lib/components/pisellShellFrame/README.md +58 -0
  232. package/lib/components/pisellShellFrame/index.d.ts +2 -0
  233. package/lib/components/pisellShellFrame/types.d.ts +60 -0
  234. package/lib/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
  235. package/lib/components/pisellSingleSelect/components/EditView.js +7 -0
  236. package/lib/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
  237. package/lib/components/pisellUrl/PisellUrl.d.ts +2 -33
  238. package/lib/components/pisellUrl/PisellUrl.js +1 -1
  239. package/lib/components/pisellUrl/PisellUrl.less +120 -11
  240. package/lib/components/pisellUrl/index.d.ts +1 -1
  241. package/lib/components/radio/index.d.ts +2 -2
  242. package/lib/components/section-footers/index.d.ts +2 -2
  243. package/lib/components/skeleton/index.d.ts +2 -2
  244. package/lib/components/sort/index.js +12 -1
  245. package/lib/components/sort/types.d.ts +8 -2
  246. package/lib/components/time-picker/index.d.ts +2 -2
  247. package/lib/components/upload/index.d.ts +2 -2
  248. package/lib/index.d.ts +19 -11
  249. package/lib/index.js +33 -25
  250. package/lib/locales/en-US.js +16 -2
  251. package/lib/locales/zh-CN.js +18 -4
  252. package/lib/locales/zh-TW.js +18 -4
  253. package/lib/utils/tagColor.js +32 -0
  254. package/package.json +3 -3
@@ -28,23 +28,23 @@ PisellFilter 是一个强大的筛选组件,基于 Ant Design Form 封装,
28
28
  ## 基础用法
29
29
 
30
30
  ```tsx
31
- import { useState } from 'react';
32
- import { PisellFilter } from '@pisell/materials';
31
+ import {useState} from 'react';
32
+ import {PisellFilter} from '@pisell/materials';
33
33
 
34
34
  const Demo = () => {
35
- const [filterValue, setFilterValue] = useState({
36
- quickFilter: [],
37
- otherFilter: [],
38
- });
39
-
40
- return (
41
- <PisellFilter
42
- value={filterValue}
43
- onChange={setFilterValue}
44
- quickFilterMaxLength={5}
45
- formFiltersPrefix="filter_"
46
- />
47
- );
35
+ const [filterValue, setFilterValue] = useState({
36
+ quickFilter: [],
37
+ otherFilter: [],
38
+ });
39
+
40
+ return (
41
+ <PisellFilter
42
+ value={filterValue}
43
+ onChange={setFilterValue}
44
+ quickFilterMaxLength={5}
45
+ formFiltersPrefix="filter_"
46
+ />
47
+ );
48
48
  };
49
49
 
50
50
  export default Demo;
@@ -54,22 +54,24 @@ export default Demo;
54
54
 
55
55
  ### PisellFilter Props
56
56
 
57
- | 参数 | 说明 | 类型 | 默认值 | 版本 |
58
- | --------------------- | ---------------------- | -------------------- | ------- | ---- |
59
- | value | 筛选值 | `FilterValueType` | - | - |
60
- | onChange | 筛选值变化回调 | `(value: FilterValueType) => void` | - | - |
61
- | hiddenQuickFilter | 隐藏快速筛选 | `boolean` | `true` | - |
62
- | hiddenOtherFilter | 隐藏高级筛选 | `boolean` | `false` | - |
63
- | quickFilterMaxLength | 快速筛选最大显示数量 | `number` | `100` | - |
64
- | formFiltersPrefix | 表单字段前缀 | `string` | `''` | - |
65
- | renderItem | 自定义渲染筛选项 | `(item: any, otherProps?: any) => ReactNode` | - | - |
57
+ | 参数 | 说明 | 类型 | 默认值 | 版本 |
58
+ |----------------------|------------|----------------------------------------------|-----------|----|
59
+ | value | 筛选值 | `FilterValueType` | - | - |
60
+ | onChange | 筛选值变化回调 | `(value: FilterValueType) => void` | - | - |
61
+ | hiddenQuickFilter | 隐藏快速筛选 | `boolean` | `true` | - |
62
+ | hiddenOtherFilter | 隐藏高级筛选 | `boolean` | `false` | - |
63
+ | quickFilterMaxLength | 快速筛选最大显示数量 | `number` | `100` | - |
64
+ | formFiltersPrefix | 表单字段前缀 | `string` | `''` | - |
65
+ | renderItem | 自定义渲染筛选项 | `(item: any, otherProps?: any) => ReactNode` | - | - |
66
+ | size | 筛选按钮尺寸 | `'small' \| 'middle' \| 'large'` | `'large'` | - |
67
+ | placement | 弹出层定位 | `Popover` 的 placement | - | - |
66
68
 
67
69
  ### FilterValueType
68
70
 
69
71
  ```typescript
70
72
  interface FilterValueType {
71
- quickFilter: FilterItemProps[]; // 快速筛选项数组
72
- otherFilter: FilterItemProps[]; // 高级筛选项数组
73
+ quickFilter: FilterItemProps[]; // 快速筛选项数组
74
+ otherFilter: FilterItemProps[]; // 高级筛选项数组
73
75
  }
74
76
  ```
75
77
 
@@ -77,17 +79,17 @@ interface FilterValueType {
77
79
 
78
80
  ```typescript
79
81
  interface FilterItemProps {
80
- type: 'single' | 'input' | 'datePicker' | 'rangePicker' | 'search'; // 筛选类型
81
- name?: string | string[]; // 字段名称
82
- key: string; // 唯一标识
83
- props: object; // 传递给筛选组件的属性
84
- label?: string; // 显示标签
85
- sort?: boolean; // 是否可排序
86
- localFilter?: boolean; // 是否本地筛选
87
- other: Record<string, any>; // 其他配置
88
- isCustom?: boolean; // 是否自定义
89
- columnKey?: string; // 列键值
90
- isHidden?: boolean; // 是否隐藏
82
+ type: 'single' | 'input' | 'datePicker' | 'rangePicker' | 'search'; // 筛选类型
83
+ name?: string | string[]; // 字段名称
84
+ key: string; // 唯一标识
85
+ props: object; // 传递给筛选组件的属性
86
+ label?: string; // 显示标签
87
+ sort?: boolean; // 是否可排序
88
+ localFilter?: boolean; // 是否本地筛选
89
+ other: Record<string, any>; // 其他配置
90
+ isCustom?: boolean; // 是否自定义
91
+ columnKey?: string; // 列键值
92
+ isHidden?: boolean; // 是否隐藏
91
93
  }
92
94
  ```
93
95
 
@@ -96,38 +98,38 @@ interface FilterItemProps {
96
98
  ### 快速筛选模式
97
99
 
98
100
  ```tsx
99
- import { PisellFilter } from '@pisell/materials';
101
+ import {PisellFilter} from '@pisell/materials';
100
102
 
101
103
  const Demo = () => {
102
- const [filterValue, setFilterValue] = useState({
103
- quickFilter: [
104
- {
105
- type: 'single',
106
- key: 'status',
107
- label: '状态',
108
- name: 'status',
109
- props: {
110
- options: [
111
- { label: '全部', value: 'all' },
112
- { label: '启用', value: 'enabled' },
113
- { label: '禁用', value: 'disabled' },
114
- ],
115
- },
116
- other: {},
117
- },
118
- ],
119
- otherFilter: [],
120
- });
121
-
122
- return (
123
- <PisellFilter
124
- value={filterValue}
125
- onChange={setFilterValue}
126
- hiddenQuickFilter={false}
127
- hiddenOtherFilter={true}
128
- quickFilterMaxLength={3}
129
- />
130
- );
104
+ const [filterValue, setFilterValue] = useState({
105
+ quickFilter: [
106
+ {
107
+ type: 'single',
108
+ key: 'status',
109
+ label: '状态',
110
+ name: 'status',
111
+ props: {
112
+ options: [
113
+ {label: '全部', value: 'all'},
114
+ {label: '启用', value: 'enabled'},
115
+ {label: '禁用', value: 'disabled'},
116
+ ],
117
+ },
118
+ other: {},
119
+ },
120
+ ],
121
+ otherFilter: [],
122
+ });
123
+
124
+ return (
125
+ <PisellFilter
126
+ value={filterValue}
127
+ onChange={setFilterValue}
128
+ hiddenQuickFilter={false}
129
+ hiddenOtherFilter={true}
130
+ quickFilterMaxLength={3}
131
+ />
132
+ );
131
133
  };
132
134
 
133
135
  export default Demo;
@@ -136,41 +138,41 @@ export default Demo;
136
138
  ### 高级筛选模式
137
139
 
138
140
  ```tsx
139
- import { PisellFilter } from '@pisell/materials';
141
+ import {PisellFilter} from '@pisell/materials';
140
142
 
141
143
  const Demo = () => {
142
- const [filterValue, setFilterValue] = useState({
143
- quickFilter: [],
144
- otherFilter: [
145
- {
146
- type: 'input',
147
- key: 'keyword',
148
- label: '关键词',
149
- name: 'keyword',
150
- props: {
151
- placeholder: '请输入关键词',
152
- },
153
- other: {},
154
- },
155
- {
156
- type: 'datePicker',
157
- key: 'created_at',
158
- label: '创建时间',
159
- name: 'created_at',
160
- props: {},
161
- other: {},
162
- },
163
- ],
164
- });
165
-
166
- return (
167
- <PisellFilter
168
- value={filterValue}
169
- onChange={setFilterValue}
170
- hiddenQuickFilter={true}
171
- hiddenOtherFilter={false}
172
- />
173
- );
144
+ const [filterValue, setFilterValue] = useState({
145
+ quickFilter: [],
146
+ otherFilter: [
147
+ {
148
+ type: 'input',
149
+ key: 'keyword',
150
+ label: '关键词',
151
+ name: 'keyword',
152
+ props: {
153
+ placeholder: '请输入关键词',
154
+ },
155
+ other: {},
156
+ },
157
+ {
158
+ type: 'datePicker',
159
+ key: 'created_at',
160
+ label: '创建时间',
161
+ name: 'created_at',
162
+ props: {},
163
+ other: {},
164
+ },
165
+ ],
166
+ });
167
+
168
+ return (
169
+ <PisellFilter
170
+ value={filterValue}
171
+ onChange={setFilterValue}
172
+ hiddenQuickFilter={true}
173
+ hiddenOtherFilter={false}
174
+ />
175
+ );
174
176
  };
175
177
 
176
178
  export default Demo;
@@ -179,48 +181,48 @@ export default Demo;
179
181
  ### 混合模式
180
182
 
181
183
  ```tsx
182
- import { PisellFilter } from '@pisell/materials';
184
+ import {PisellFilter} from '@pisell/materials';
183
185
 
184
186
  const Demo = () => {
185
- const [filterValue, setFilterValue] = useState({
186
- quickFilter: [
187
- {
188
- type: 'single',
189
- key: 'category',
190
- label: '分类',
191
- name: 'category',
192
- props: {
193
- options: [
194
- { label: '全部', value: 'all' },
195
- { label: '类型A', value: 'a' },
196
- { label: '类型B', value: 'b' },
197
- ],
198
- },
199
- other: {},
200
- },
201
- ],
202
- otherFilter: [
203
- {
204
- type: 'rangePicker',
205
- key: 'date_range',
206
- label: '日期范围',
207
- name: ['start_date', 'end_date'],
208
- props: {},
209
- other: {},
210
- },
211
- ],
212
- });
213
-
214
- return (
215
- <PisellFilter
216
- value={filterValue}
217
- onChange={setFilterValue}
218
- hiddenQuickFilter={false}
219
- hiddenOtherFilter={false}
220
- quickFilterMaxLength={5}
221
- formFiltersPrefix="filter_"
222
- />
223
- );
187
+ const [filterValue, setFilterValue] = useState({
188
+ quickFilter: [
189
+ {
190
+ type: 'single',
191
+ key: 'category',
192
+ label: '分类',
193
+ name: 'category',
194
+ props: {
195
+ options: [
196
+ {label: '全部', value: 'all'},
197
+ {label: '类型A', value: 'a'},
198
+ {label: '类型B', value: 'b'},
199
+ ],
200
+ },
201
+ other: {},
202
+ },
203
+ ],
204
+ otherFilter: [
205
+ {
206
+ type: 'rangePicker',
207
+ key: 'date_range',
208
+ label: '日期范围',
209
+ name: ['start_date', 'end_date'],
210
+ props: {},
211
+ other: {},
212
+ },
213
+ ],
214
+ });
215
+
216
+ return (
217
+ <PisellFilter
218
+ value={filterValue}
219
+ onChange={setFilterValue}
220
+ hiddenQuickFilter={false}
221
+ hiddenOtherFilter={false}
222
+ quickFilterMaxLength={5}
223
+ formFiltersPrefix="filter_"
224
+ />
225
+ );
224
226
  };
225
227
 
226
228
  export default Demo;
@@ -229,31 +231,31 @@ export default Demo;
229
231
  ### 自定义渲染
230
232
 
231
233
  ```tsx
232
- import { PisellFilter } from '@pisell/materials';
233
- import { Tag } from 'antd';
234
+ import {PisellFilter} from '@pisell/materials';
235
+ import {Tag} from 'antd';
234
236
 
235
237
  const Demo = () => {
236
- const [filterValue, setFilterValue] = useState({
237
- quickFilter: [],
238
- otherFilter: [],
239
- });
238
+ const [filterValue, setFilterValue] = useState({
239
+ quickFilter: [],
240
+ otherFilter: [],
241
+ });
242
+
243
+ const renderItem = (item: any, otherProps: any) => {
244
+ return (
245
+ <div style={{padding: '8px'}}>
246
+ <Tag color="blue">{item.label}</Tag>
247
+ {/* 自定义渲染逻辑 */}
248
+ </div>
249
+ );
250
+ };
240
251
 
241
- const renderItem = (item: any, otherProps: any) => {
242
252
  return (
243
- <div style={{ padding: '8px' }}>
244
- <Tag color="blue">{item.label}</Tag>
245
- {/* 自定义渲染逻辑 */}
246
- </div>
253
+ <PisellFilter
254
+ value={filterValue}
255
+ onChange={setFilterValue}
256
+ renderItem={renderItem}
257
+ />
247
258
  );
248
- };
249
-
250
- return (
251
- <PisellFilter
252
- value={filterValue}
253
- onChange={setFilterValue}
254
- renderItem={renderItem}
255
- />
256
- );
257
259
  };
258
260
 
259
261
  export default Demo;
@@ -262,36 +264,36 @@ export default Demo;
262
264
  ### 本地筛选
263
265
 
264
266
  ```tsx
265
- import { PisellFilter } from '@pisell/materials';
267
+ import {PisellFilter} from '@pisell/materials';
266
268
 
267
269
  const Demo = () => {
268
- const [filterValue, setFilterValue] = useState({
269
- quickFilter: [
270
- {
271
- type: 'single',
272
- key: 'status',
273
- label: '状态',
274
- name: 'status',
275
- props: {
276
- options: [
277
- { label: '全部', value: 'all' },
278
- { label: '启用', value: 'enabled' },
279
- ],
280
- },
281
- localFilter: true, // 启用本地筛选
282
- other: {},
283
- },
284
- ],
285
- otherFilter: [],
286
- });
287
-
288
- return (
289
- <PisellFilter
290
- value={filterValue}
291
- onChange={setFilterValue}
292
- hiddenQuickFilter={false}
293
- />
294
- );
270
+ const [filterValue, setFilterValue] = useState({
271
+ quickFilter: [
272
+ {
273
+ type: 'single',
274
+ key: 'status',
275
+ label: '状态',
276
+ name: 'status',
277
+ props: {
278
+ options: [
279
+ {label: '全部', value: 'all'},
280
+ {label: '启用', value: 'enabled'},
281
+ ],
282
+ },
283
+ localFilter: true, // 启用本地筛选
284
+ other: {},
285
+ },
286
+ ],
287
+ otherFilter: [],
288
+ });
289
+
290
+ return (
291
+ <PisellFilter
292
+ value={filterValue}
293
+ onChange={setFilterValue}
294
+ hiddenQuickFilter={false}
295
+ />
296
+ );
295
297
  };
296
298
 
297
299
  export default Demo;
@@ -305,18 +307,29 @@ export default Demo;
305
307
 
306
308
  ```typescript
307
309
  {
308
- type: 'single',
309
- key: 'status',
310
- label: '状态',
311
- name: 'status',
312
- props: {
313
- options: [
314
- { label: '全部', value: 'all' },
315
- { label: '启用', value: 'enabled' },
316
- { label: '禁用', value: 'disabled' },
317
- ],
318
- },
319
- other: {},
310
+ type: 'single',
311
+ key
312
+ :
313
+ 'status',
314
+ label
315
+ :
316
+ '状态',
317
+ name
318
+ :
319
+ 'status',
320
+ props
321
+ :
322
+ {
323
+ options: [
324
+ {label: '全部', value: 'all'},
325
+ {label: '启用', value: 'enabled'},
326
+ {label: '禁用', value: 'disabled'},
327
+ ],
328
+ }
329
+ ,
330
+ other: {
331
+ }
332
+ ,
320
333
  }
321
334
  ```
322
335
 
@@ -326,14 +339,25 @@ export default Demo;
326
339
 
327
340
  ```typescript
328
341
  {
329
- type: 'input',
330
- key: 'keyword',
331
- label: '关键词',
332
- name: 'keyword',
333
- props: {
334
- placeholder: '请输入关键词',
335
- },
336
- other: {},
342
+ type: 'input',
343
+ key
344
+ :
345
+ 'keyword',
346
+ label
347
+ :
348
+ '关键词',
349
+ name
350
+ :
351
+ 'keyword',
352
+ props
353
+ :
354
+ {
355
+ placeholder: '请输入关键词',
356
+ }
357
+ ,
358
+ other: {
359
+ }
360
+ ,
337
361
  }
338
362
  ```
339
363
 
@@ -343,14 +367,25 @@ export default Demo;
343
367
 
344
368
  ```typescript
345
369
  {
346
- type: 'datePicker',
347
- key: 'created_at',
348
- label: '创建时间',
349
- name: 'created_at',
350
- props: {
351
- format: 'YYYY-MM-DD',
352
- },
353
- other: {},
370
+ type: 'datePicker',
371
+ key
372
+ :
373
+ 'created_at',
374
+ label
375
+ :
376
+ '创建时间',
377
+ name
378
+ :
379
+ 'created_at',
380
+ props
381
+ :
382
+ {
383
+ format: 'YYYY-MM-DD',
384
+ }
385
+ ,
386
+ other: {
387
+ }
388
+ ,
354
389
  }
355
390
  ```
356
391
 
@@ -360,14 +395,25 @@ export default Demo;
360
395
 
361
396
  ```typescript
362
397
  {
363
- type: 'rangePicker',
364
- key: 'date_range',
365
- label: '日期范围',
366
- name: ['start_date', 'end_date'],
367
- props: {
368
- format: 'YYYY-MM-DD',
369
- },
370
- other: {},
398
+ type: 'rangePicker',
399
+ key
400
+ :
401
+ 'date_range',
402
+ label
403
+ :
404
+ '日期范围',
405
+ name
406
+ :
407
+ ['start_date', 'end_date'],
408
+ props
409
+ :
410
+ {
411
+ format: 'YYYY-MM-DD',
412
+ }
413
+ ,
414
+ other: {
415
+ }
416
+ ,
371
417
  }
372
418
  ```
373
419
 
@@ -377,14 +423,25 @@ export default Demo;
377
423
 
378
424
  ```typescript
379
425
  {
380
- type: 'search',
381
- key: 'search',
382
- label: '搜索',
383
- name: 'search',
384
- props: {
385
- placeholder: '请输入搜索内容',
386
- },
387
- other: {},
426
+ type: 'search',
427
+ key
428
+ :
429
+ 'search',
430
+ label
431
+ :
432
+ '搜索',
433
+ name
434
+ :
435
+ 'search',
436
+ props
437
+ :
438
+ {
439
+ placeholder: '请输入搜索内容',
440
+ }
441
+ ,
442
+ other: {
443
+ }
444
+ ,
388
445
  }
389
446
  ```
390
447