@pisell/materials 1.0.4 → 1.0.6

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 (277) 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 +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +26 -4
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -4
  11. package/es/components/DragSortList/index.d.ts +32 -0
  12. package/es/components/DragSortList/index.js +85 -0
  13. package/es/components/MultipleContainersSortList/index.d.ts +15 -0
  14. package/es/components/MultipleContainersSortList/index.js +156 -0
  15. package/es/components/date-picker/index.js +5 -0
  16. package/es/components/table/Actions/Filter/Dropdown/index.d.ts +14 -0
  17. package/es/components/table/Actions/Filter/Dropdown/index.js +99 -0
  18. package/es/components/table/Actions/Filter/Dropdown/index.less +74 -0
  19. package/es/components/table/Actions/Filter/FilterItem/index.d.ts +7 -6
  20. package/es/components/table/Actions/Filter/FilterItem/index.js +15 -12
  21. package/es/components/table/Actions/Filter/QuickFilter/index.d.ts +3 -0
  22. package/es/components/table/Actions/Filter/QuickFilter/index.js +25 -0
  23. package/es/components/table/Actions/Filter/index.d.ts +3 -8
  24. package/es/components/table/Actions/Filter/index.js +23 -12
  25. package/es/components/table/Actions/Sort/index.d.ts +12 -0
  26. package/es/components/table/Actions/Sort/index.js +23 -0
  27. package/es/components/table/Actions/index.d.ts +1 -1
  28. package/es/components/table/Actions/index.js +14 -10
  29. package/es/components/table/Actions/index.less +9 -1
  30. package/es/components/table/{Actions → Header}/Buttons/index.js +1 -1
  31. package/es/components/table/Header/index.d.ts +4 -0
  32. package/es/components/table/Header/index.js +20 -0
  33. package/es/components/table/Header/index.less +16 -0
  34. package/es/components/table/Pagination/index.d.ts +8 -2
  35. package/es/components/table/Pagination/index.js +32 -28
  36. package/es/components/table/Pagination/index.less +62 -7
  37. package/es/components/table/Summary/index.d.ts +4 -0
  38. package/es/components/table/Summary/index.js +12 -0
  39. package/es/components/table/Summary/index.less +5 -0
  40. package/es/components/table/Table/fields/date/Config/index.d.ts +3 -0
  41. package/es/components/table/Table/fields/date/Config/index.js +4 -0
  42. package/es/components/table/Table/fields/date/Edit/index.d.ts +4 -0
  43. package/es/components/table/Table/fields/date/Edit/index.js +42 -0
  44. package/es/components/table/Table/fields/date/Show/index.d.ts +4 -0
  45. package/es/components/table/Table/fields/{text/Preview → date/Show}/index.js +3 -5
  46. package/es/components/table/Table/fields/date/Sort/index.d.ts +3 -0
  47. package/es/components/table/Table/fields/date/Sort/index.js +4 -0
  48. package/es/components/table/Table/fields/date/index.d.ts +14 -0
  49. package/es/components/table/Table/fields/date/index.js +17 -0
  50. package/es/components/table/Table/fields/image/Config/index.d.ts +3 -0
  51. package/es/components/table/Table/fields/image/Config/index.js +4 -0
  52. package/es/components/table/Table/fields/image/Edit/index.d.ts +4 -0
  53. package/es/components/table/Table/fields/image/Edit/index.js +23 -0
  54. package/es/components/table/Table/fields/image/Show/index.d.ts +4 -0
  55. package/es/components/table/Table/fields/image/Show/index.js +19 -0
  56. package/es/components/table/Table/fields/image/Sort/index.d.ts +3 -0
  57. package/es/components/table/Table/fields/image/Sort/index.js +4 -0
  58. package/es/components/table/Table/fields/image/index.d.ts +14 -0
  59. package/es/components/table/Table/fields/image/index.js +17 -0
  60. package/es/components/table/Table/fields/index.d.ts +173 -8
  61. package/es/components/table/Table/fields/index.js +19 -3
  62. package/es/components/table/Table/fields/link/Config/index.d.ts +3 -0
  63. package/es/components/table/Table/fields/link/Config/index.js +4 -0
  64. package/es/components/table/Table/fields/link/Edit/index.d.ts +4 -0
  65. package/es/components/table/Table/fields/link/Edit/index.js +59 -0
  66. package/es/components/table/Table/fields/link/Show/index.d.ts +4 -0
  67. package/es/components/table/Table/fields/link/Show/index.js +29 -0
  68. package/es/components/table/Table/fields/link/Sort/index.d.ts +3 -0
  69. package/es/components/table/Table/fields/link/Sort/index.js +4 -0
  70. package/es/components/table/Table/fields/link/index.d.ts +4 -2
  71. package/es/components/table/Table/fields/link/index.js +8 -4
  72. package/es/components/table/Table/fields/number/Config/index.d.ts +3 -0
  73. package/es/components/table/Table/fields/number/Config/index.js +4 -0
  74. package/es/components/table/Table/fields/number/Edit/index.d.ts +4 -0
  75. package/es/components/table/Table/fields/number/Edit/index.js +24 -0
  76. package/es/components/table/Table/fields/number/Show/index.d.ts +4 -0
  77. package/es/components/table/Table/fields/{link/Preview → number/Show}/index.js +4 -5
  78. package/es/components/table/Table/fields/number/Sort/index.d.ts +3 -0
  79. package/es/components/table/Table/fields/number/Sort/index.js +4 -0
  80. package/es/components/table/Table/fields/number/index.d.ts +14 -0
  81. package/es/components/table/Table/fields/number/index.js +17 -0
  82. package/es/components/table/Table/fields/rangePicker/Config/index.d.ts +3 -0
  83. package/es/components/table/Table/fields/rangePicker/Config/index.js +4 -0
  84. package/es/components/table/Table/fields/rangePicker/Edit/index.d.ts +4 -0
  85. package/es/components/table/Table/fields/rangePicker/Edit/index.js +58 -0
  86. package/es/components/table/Table/fields/rangePicker/Show/index.d.ts +4 -0
  87. package/es/components/table/Table/fields/rangePicker/Show/index.js +16 -0
  88. package/es/components/table/Table/fields/rangePicker/Sort/index.d.ts +3 -0
  89. package/es/components/table/Table/fields/rangePicker/Sort/index.js +4 -0
  90. package/es/components/table/Table/fields/rangePicker/index.d.ts +14 -0
  91. package/es/components/table/Table/fields/rangePicker/index.js +17 -0
  92. package/es/components/table/Table/fields/select/Config/index.d.ts +3 -0
  93. package/es/components/table/Table/fields/select/Config/index.js +4 -0
  94. package/es/components/table/Table/fields/select/Edit/index.d.ts +4 -0
  95. package/es/components/table/Table/fields/select/Edit/index.js +23 -0
  96. package/es/components/table/Table/fields/select/Show/index.d.ts +4 -0
  97. package/es/components/table/Table/fields/select/Show/index.js +27 -0
  98. package/es/components/table/Table/fields/select/Show/index.less +0 -0
  99. package/es/components/table/Table/fields/select/Sort/index.d.ts +3 -0
  100. package/es/components/table/Table/fields/select/Sort/index.js +4 -0
  101. package/es/components/table/Table/fields/select/index.d.ts +14 -0
  102. package/es/components/table/Table/fields/select/index.js +17 -0
  103. package/es/components/table/Table/fields/select/index.less +0 -0
  104. package/es/components/table/Table/fields/text/Config/index.d.ts +3 -0
  105. package/es/components/table/Table/fields/text/Config/index.js +4 -0
  106. package/es/components/table/Table/fields/text/Edit/index.d.ts +4 -0
  107. package/es/components/table/Table/fields/text/Edit/index.js +23 -0
  108. package/es/components/table/Table/fields/text/Edit/index.less +0 -0
  109. package/es/components/table/Table/fields/text/Show/index.d.ts +4 -0
  110. package/es/components/table/Table/fields/text/Show/index.js +16 -0
  111. package/es/components/table/Table/fields/text/Show/index.less +0 -0
  112. package/es/components/table/Table/fields/text/Sort/index.d.ts +3 -0
  113. package/es/components/table/Table/fields/text/Sort/index.js +4 -0
  114. package/es/components/table/Table/fields/text/index.d.ts +4 -2
  115. package/es/components/table/Table/fields/text/index.js +8 -4
  116. package/es/components/table/Table/fields/types/index.d.ts +27 -0
  117. package/es/components/table/Table/fields/types/index.js +1 -0
  118. package/es/components/table/Table/index.js +13 -30
  119. package/es/components/table/Table/index.less +1 -90
  120. package/es/components/table/Table/tableConfig/body/CellProvider/index.js +21 -14
  121. package/es/components/table/Table/tableConfig/header/CellProvider/index.js +1 -6
  122. package/es/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  123. package/es/components/table/index.d.ts +16 -3
  124. package/es/components/table/index.js +43 -9
  125. package/es/components/table/model.d.ts +3 -0
  126. package/es/components/table/model.js +19 -0
  127. package/es/utils/hoc.js +3 -2
  128. package/lib/components/DragSortList/index.d.ts +32 -0
  129. package/lib/components/DragSortList/index.js +119 -0
  130. package/lib/components/MultipleContainersSortList/index.d.ts +15 -0
  131. package/lib/components/MultipleContainersSortList/index.js +181 -0
  132. package/lib/components/date-picker/index.js +15 -0
  133. package/lib/components/table/Actions/Filter/Dropdown/index.d.ts +14 -0
  134. package/lib/components/table/Actions/Filter/Dropdown/index.js +128 -0
  135. package/lib/components/table/Actions/Filter/Dropdown/index.less +74 -0
  136. package/lib/components/table/Actions/Filter/FilterItem/index.d.ts +7 -6
  137. package/lib/components/table/Actions/Filter/FilterItem/index.js +8 -2
  138. package/lib/components/table/Actions/Filter/QuickFilter/index.d.ts +3 -0
  139. package/lib/components/table/Actions/Filter/QuickFilter/index.js +56 -0
  140. package/lib/components/table/Actions/Filter/index.d.ts +3 -8
  141. package/lib/components/table/Actions/Filter/index.js +16 -5
  142. package/lib/components/table/Actions/Sort/index.d.ts +12 -0
  143. package/lib/components/table/{Table/fields/text/Preview → Actions/Sort}/index.js +10 -18
  144. package/lib/components/table/Actions/Sort/index.less +0 -0
  145. package/lib/components/table/Actions/index.d.ts +1 -1
  146. package/lib/components/table/Actions/index.js +7 -3
  147. package/lib/components/table/Actions/index.less +9 -1
  148. package/lib/components/table/{Actions → Header}/Buttons/index.js +2 -2
  149. package/lib/components/table/Header/Buttons/index.less +0 -0
  150. package/lib/components/table/Header/index.d.ts +4 -0
  151. package/lib/components/table/Header/index.js +44 -0
  152. package/lib/components/table/Header/index.less +16 -0
  153. package/lib/components/table/Pagination/index.d.ts +8 -2
  154. package/lib/components/table/Pagination/index.js +27 -22
  155. package/lib/components/table/Pagination/index.less +62 -7
  156. package/lib/components/table/Summary/index.d.ts +4 -0
  157. package/lib/components/table/{Table/fields/text/Editor → Summary}/index.js +12 -9
  158. package/lib/components/table/Summary/index.less +5 -0
  159. package/lib/components/table/Table/fields/date/Config/index.d.ts +3 -0
  160. package/lib/components/table/Table/fields/date/Config/index.js +28 -0
  161. package/lib/components/table/Table/fields/date/Edit/index.d.ts +4 -0
  162. package/lib/components/table/Table/fields/date/Edit/index.js +67 -0
  163. package/lib/components/table/Table/fields/date/Show/index.d.ts +4 -0
  164. package/lib/components/table/Table/fields/{link/Preview → date/Show}/index.js +8 -9
  165. package/lib/components/table/Table/fields/date/Sort/index.d.ts +3 -0
  166. package/lib/components/table/Table/fields/date/Sort/index.js +28 -0
  167. package/lib/components/table/Table/fields/date/index.d.ts +14 -0
  168. package/lib/components/table/Table/fields/date/index.js +51 -0
  169. package/lib/components/table/Table/fields/image/Config/index.d.ts +3 -0
  170. package/lib/components/table/Table/fields/image/Config/index.js +28 -0
  171. package/lib/components/table/Table/fields/image/Edit/index.d.ts +4 -0
  172. package/lib/components/table/Table/fields/image/Edit/index.js +53 -0
  173. package/lib/components/table/Table/fields/image/Edit/index.less +0 -0
  174. package/lib/components/table/Table/fields/image/Show/index.d.ts +4 -0
  175. package/lib/components/table/Table/fields/{link/Editor → image/Show}/index.js +17 -9
  176. package/lib/components/table/Table/fields/image/Show/index.less +0 -0
  177. package/lib/components/table/Table/fields/image/Sort/index.d.ts +3 -0
  178. package/lib/components/table/Table/fields/image/Sort/index.js +28 -0
  179. package/lib/components/table/Table/fields/image/index.d.ts +14 -0
  180. package/lib/components/table/Table/fields/image/index.js +51 -0
  181. package/lib/components/table/Table/fields/image/index.less +0 -0
  182. package/lib/components/table/Table/fields/index.d.ts +173 -8
  183. package/lib/components/table/Table/fields/index.js +19 -3
  184. package/lib/components/table/Table/fields/link/Config/index.d.ts +3 -0
  185. package/lib/components/table/Table/fields/link/Config/index.js +28 -0
  186. package/lib/components/table/Table/fields/link/Edit/index.d.ts +4 -0
  187. package/lib/components/table/Table/fields/link/Edit/index.js +78 -0
  188. package/lib/components/table/Table/fields/link/Edit/index.less +0 -0
  189. package/lib/components/table/Table/fields/link/Show/index.d.ts +4 -0
  190. package/lib/components/table/Table/fields/link/Show/index.js +48 -0
  191. package/lib/components/table/Table/fields/link/Show/index.less +0 -0
  192. package/lib/components/table/Table/fields/link/Sort/index.d.ts +3 -0
  193. package/lib/components/table/Table/fields/link/Sort/index.js +28 -0
  194. package/lib/components/table/Table/fields/link/index.d.ts +4 -2
  195. package/lib/components/table/Table/fields/link/index.js +8 -4
  196. package/lib/components/table/Table/fields/number/Config/index.d.ts +3 -0
  197. package/lib/components/table/Table/fields/number/Config/index.js +28 -0
  198. package/lib/components/table/Table/fields/number/Edit/index.d.ts +4 -0
  199. package/lib/components/table/Table/fields/number/Edit/index.js +44 -0
  200. package/lib/components/table/Table/fields/number/Show/index.d.ts +4 -0
  201. package/lib/components/table/Table/fields/number/Show/index.js +37 -0
  202. package/lib/components/table/Table/fields/number/Sort/index.d.ts +3 -0
  203. package/lib/components/table/Table/fields/number/Sort/index.js +28 -0
  204. package/lib/components/table/Table/fields/number/index.d.ts +14 -0
  205. package/lib/components/table/Table/fields/number/index.js +51 -0
  206. package/lib/components/table/Table/fields/rangePicker/Config/index.d.ts +3 -0
  207. package/lib/components/table/Table/fields/rangePicker/Config/index.js +28 -0
  208. package/lib/components/table/Table/fields/rangePicker/Edit/index.d.ts +4 -0
  209. package/lib/components/table/Table/fields/rangePicker/Edit/index.js +73 -0
  210. package/lib/components/table/Table/fields/rangePicker/Show/index.d.ts +4 -0
  211. package/lib/components/table/Table/fields/rangePicker/Show/index.js +37 -0
  212. package/lib/components/table/Table/fields/rangePicker/Sort/index.d.ts +3 -0
  213. package/lib/components/table/Table/fields/rangePicker/Sort/index.js +28 -0
  214. package/lib/components/table/Table/fields/rangePicker/index.d.ts +14 -0
  215. package/lib/components/table/Table/fields/rangePicker/index.js +51 -0
  216. package/lib/components/table/Table/fields/select/Config/index.d.ts +3 -0
  217. package/lib/components/table/Table/fields/select/Config/index.js +28 -0
  218. package/lib/components/table/Table/fields/select/Edit/index.d.ts +4 -0
  219. package/lib/components/table/Table/fields/select/Edit/index.js +53 -0
  220. package/lib/components/table/Table/fields/select/Edit/index.less +0 -0
  221. package/lib/components/table/Table/fields/select/Show/index.d.ts +4 -0
  222. package/lib/components/table/Table/fields/select/Show/index.js +46 -0
  223. package/lib/components/table/Table/fields/select/Show/index.less +0 -0
  224. package/lib/components/table/Table/fields/select/Sort/index.d.ts +3 -0
  225. package/lib/components/table/Table/fields/select/Sort/index.js +28 -0
  226. package/lib/components/table/Table/fields/select/index.d.ts +14 -0
  227. package/lib/components/table/Table/fields/select/index.js +51 -0
  228. package/lib/components/table/Table/fields/select/index.less +0 -0
  229. package/lib/components/table/Table/fields/text/Config/index.d.ts +3 -0
  230. package/lib/components/table/Table/fields/text/Config/index.js +28 -0
  231. package/lib/components/table/Table/fields/text/Edit/index.d.ts +4 -0
  232. package/lib/components/table/Table/fields/text/Edit/index.js +53 -0
  233. package/lib/components/table/Table/fields/text/Edit/index.less +0 -0
  234. package/lib/components/table/Table/fields/text/Show/index.d.ts +4 -0
  235. package/lib/components/table/Table/fields/text/Show/index.js +37 -0
  236. package/lib/components/table/Table/fields/text/Show/index.less +0 -0
  237. package/lib/components/table/Table/fields/text/Sort/index.d.ts +3 -0
  238. package/lib/components/table/Table/fields/text/Sort/index.js +28 -0
  239. package/lib/components/table/Table/fields/text/index.d.ts +4 -2
  240. package/lib/components/table/Table/fields/text/index.js +8 -4
  241. package/lib/components/table/Table/fields/types/index.d.ts +27 -0
  242. package/lib/components/table/Table/fields/types/index.js +17 -0
  243. package/lib/components/table/Table/index.js +19 -20
  244. package/lib/components/table/Table/index.less +1 -90
  245. package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +19 -14
  246. package/lib/components/table/Table/tableConfig/header/CellProvider/index.js +1 -3
  247. package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  248. package/lib/components/table/index.d.ts +16 -3
  249. package/lib/components/table/index.js +28 -6
  250. package/lib/components/table/model.d.ts +3 -0
  251. package/lib/components/table/model.js +14 -0
  252. package/lib/utils/hoc.js +3 -2
  253. package/lowcode/button/meta.ts +17 -87
  254. package/lowcode/table/meta.ts +146 -63
  255. package/package.json +11 -4
  256. package/es/components/table/Actions/Buttons/index.less +0 -30
  257. package/es/components/table/Table/fields/link/Editor/index.d.ts +0 -3
  258. package/es/components/table/Table/fields/link/Editor/index.js +0 -10
  259. package/es/components/table/Table/fields/link/Preview/index.d.ts +0 -3
  260. package/es/components/table/Table/fields/text/Editor/index.d.ts +0 -3
  261. package/es/components/table/Table/fields/text/Editor/index.js +0 -11
  262. package/es/components/table/Table/fields/text/Preview/index.d.ts +0 -3
  263. package/lib/components/table/Actions/Buttons/index.less +0 -30
  264. package/lib/components/table/Table/fields/link/Editor/index.d.ts +0 -3
  265. package/lib/components/table/Table/fields/link/Preview/index.d.ts +0 -3
  266. package/lib/components/table/Table/fields/text/Editor/index.d.ts +0 -3
  267. package/lib/components/table/Table/fields/text/Preview/index.d.ts +0 -3
  268. /package/es/components/table/{Table/fields/link/Editor → Actions/Sort}/index.less +0 -0
  269. /package/es/components/table/{Actions → Header}/Buttons/index.d.ts +0 -0
  270. /package/es/components/table/{Table/fields/link/Preview → Header/Buttons}/index.less +0 -0
  271. /package/es/components/table/Table/fields/{text/Editor → image/Edit}/index.less +0 -0
  272. /package/es/components/table/Table/fields/{text/Preview → image/Show}/index.less +0 -0
  273. /package/{lib/components/table/Table/fields/link/Editor → es/components/table/Table/fields/image}/index.less +0 -0
  274. /package/{lib/components/table/Table/fields/link/Preview → es/components/table/Table/fields/link/Edit}/index.less +0 -0
  275. /package/{lib/components/table/Table/fields/text/Editor → es/components/table/Table/fields/link/Show}/index.less +0 -0
  276. /package/{lib/components/table/Table/fields/text/Preview → es/components/table/Table/fields/select/Edit}/index.less +0 -0
  277. /package/lib/components/table/{Actions → Header}/Buttons/index.d.ts +0 -0
@@ -1,20 +1,36 @@
1
- var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "buttons"];
1
+ var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "sort", "buttons", "title", "summary", "onValuesChange"];
2
2
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4
10
  import React, { useEffect } from "react";
11
+ import { Form } from "antd";
12
+ import Header from "./Header";
5
13
  import Actions from "./Actions";
14
+ import Summary from "./Summary";
6
15
  import GridViewTable from "./Table";
7
16
  import { useSharedState } from "../../hooks";
8
17
  import "./index.less";
9
18
  import { Provider, Context } from "./model";
10
- var GridView = function GridView(props) {
19
+ var GridView = Provider(function (props) {
11
20
  var modal = useSharedState(Context);
21
+ var _Form$useForm = Form.useForm(),
22
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
23
+ form = _Form$useForm2[0];
12
24
  var dataSource = props.dataSource,
13
25
  columns = props.columns,
14
26
  dispatch = props.dispatch,
15
27
  style = props.style,
16
28
  filter = props.filter,
29
+ sort = props.sort,
17
30
  buttons = props.buttons,
31
+ title = props.title,
32
+ summary = props.summary,
33
+ onValuesChange = props.onValuesChange,
18
34
  other = _objectWithoutProperties(props, _excluded);
19
35
  useEffect(function () {
20
36
  modal.dispatch({
@@ -22,21 +38,39 @@ var GridView = function GridView(props) {
22
38
  payload: columns
23
39
  });
24
40
  }, [columns]);
25
- console.log("wzw", other);
26
41
  useEffect(function () {
27
42
  modal.dispatch({
28
43
  type: "setDataSource",
29
44
  payload: dataSource
30
45
  });
31
46
  }, [dataSource]);
32
- return /*#__PURE__*/React.createElement("div", {
47
+ useEffect(function () {
48
+ modal.dispatch({
49
+ type: "setQuickFilter",
50
+ payload: filter.list
51
+ });
52
+ // modal.dispatch({
53
+ // type: "setOtherFilter",
54
+ // payload: filter,
55
+ // });
56
+ }, [filter]);
57
+ return /*#__PURE__*/React.createElement(Form, {
58
+ form: form,
59
+ layout: "vertical",
60
+ onValuesChange: onValuesChange
61
+ }, /*#__PURE__*/React.createElement("div", {
33
62
  className: "materials-grid",
34
63
  style: style
35
- }, /*#__PURE__*/React.createElement(Actions, {
36
- filter: filter,
64
+ }, /*#__PURE__*/React.createElement(Header, {
65
+ title: title,
37
66
  buttons: buttons
67
+ }), /*#__PURE__*/React.createElement(Actions, {
68
+ filter: filter,
69
+ sort: sort
70
+ }), /*#__PURE__*/React.createElement(Summary, {
71
+ summary: summary
38
72
  }), /*#__PURE__*/React.createElement(GridViewTable, {
39
73
  tableProps: other
40
- }));
41
- };
42
- export default Provider(GridView);
74
+ })));
75
+ });
76
+ export default GridView;
@@ -1,9 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { FilterItemProps } from "./Actions/Filter/Dropdown";
2
3
  interface FormState {
3
4
  dataSource: any[];
4
5
  defaultColumns: any[];
5
6
  currentCell: any;
6
7
  setting: any;
8
+ quickFilter: FilterItemProps[];
9
+ otherFilter: FilterItemProps[];
7
10
  }
8
11
  export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
9
12
  state: FormState;
@@ -50,6 +50,8 @@ var defaultState = {
50
50
  field_type: "image"
51
51
  }],
52
52
  currentCell: null,
53
+ quickFilter: [],
54
+ otherFilter: [],
53
55
  setting: {
54
56
  field: {
55
57
  edit: 0
@@ -79,6 +81,23 @@ var _getContext = getContext({
79
81
  return _objectSpread(_objectSpread({}, state), {}, {
80
82
  currentCell: payload
81
83
  });
84
+ },
85
+ setQuickFilter: function setQuickFilter(state, payload) {
86
+ return _objectSpread(_objectSpread({}, state), {}, {
87
+ quickFilter: payload
88
+ });
89
+ },
90
+ syncStorage: function syncStorage(state, payload) {
91
+ return _objectSpread({}, state);
92
+ },
93
+ init: function init(state, payload) {
94
+ // 这里进行初始化, 比如 同步storage数据
95
+ return _objectSpread({}, state);
96
+ },
97
+ setOtherFilter: function setOtherFilter(state, payload) {
98
+ return _objectSpread(_objectSpread({}, state), {}, {
99
+ otherFilter: payload
100
+ });
82
101
  }
83
102
  }
84
103
  }),
package/es/utils/hoc.js CHANGED
@@ -2,6 +2,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  import React, { forwardRef } from 'react';
4
4
  import { get, set, has } from 'lodash';
5
+ import dayjs from "dayjs";
5
6
  function convertProps(props, list, mapper) {
6
7
  var out = {};
7
8
  list.forEach(function (key) {
@@ -70,10 +71,10 @@ export function withMomentProps(Comp) {
70
71
  if (prop) {
71
72
  if (Array.isArray(prop)) {
72
73
  return prop.map(function (v) {
73
- return moment.isMoment(v) ? v : moment(v);
74
+ return dayjs.isDayjs(v) ? v : dayjs(v);
74
75
  });
75
76
  }
76
- return moment.isMoment(prop) ? prop : moment(prop);
77
+ return dayjs.isDayjs(prop) ? prop : dayjs(prop);
77
78
  }
78
79
  });
79
80
  return /*#__PURE__*/React.createElement(Comp, _extends({}, props, convertedProps));
@@ -0,0 +1,32 @@
1
+ import { DraggableAttributes } from "@dnd-kit/core";
2
+ import { SyntheticListenerMap } from "@dnd-kit/core/dist/hooks/utilities";
3
+ import React from "react";
4
+ declare type IdType = string | number;
5
+ export interface Props<T> {
6
+ list?: T[];
7
+ onChange?: (list: T[]) => void;
8
+ rowKey: IdType | ((val: T) => IdType);
9
+ children: (params: {
10
+ item: T;
11
+ index: number;
12
+ style: React.CSSProperties;
13
+ props: any;
14
+ }) => React.ReactElement<HTMLElement>;
15
+ }
16
+ export default function Sortable<T extends Record<string, any>>({ list, onChange, rowKey, children, }: Props<T>): JSX.Element;
17
+ export interface SortableItemProps<T> {
18
+ id: number;
19
+ index: number;
20
+ children: (params: {
21
+ item: T;
22
+ index: number;
23
+ style: React.CSSProperties;
24
+ props: any;
25
+ setActivatorNodeRef: (element: HTMLElement | null) => void;
26
+ listeners: SyntheticListenerMap;
27
+ attributes: DraggableAttributes;
28
+ }) => React.ReactElement<HTMLElement>;
29
+ item: T;
30
+ }
31
+ export declare function SortableItem<T>({ id, index, item, children, }: SortableItemProps<T>): React.ReactElement<HTMLElement, string | React.JSXElementConstructor<any>>;
32
+ export {};
@@ -0,0 +1,119 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/DragSortList/index.tsx
30
+ var DragSortList_exports = {};
31
+ __export(DragSortList_exports, {
32
+ SortableItem: () => SortableItem,
33
+ default: () => Sortable
34
+ });
35
+ module.exports = __toCommonJS(DragSortList_exports);
36
+ var import_core = require("@dnd-kit/core");
37
+ var import_sortable = require("@dnd-kit/sortable");
38
+ var import_utilities = require("@dnd-kit/utilities");
39
+ var import_utils = require("@pisell/utils");
40
+ var import_react = __toESM(require("react"));
41
+ function Sortable({
42
+ list = [],
43
+ onChange,
44
+ rowKey,
45
+ children
46
+ }) {
47
+ const getRowKey = (0, import_react.useCallback)(
48
+ (row) => {
49
+ if ((0, import_utils.isFunction)(rowKey)) {
50
+ return rowKey(row);
51
+ }
52
+ return row[rowKey];
53
+ },
54
+ [rowKey]
55
+ );
56
+ const items = (0, import_react.useMemo)(() => {
57
+ return list == null ? void 0 : list.map((item) => getRowKey(item));
58
+ }, [list, rowKey]);
59
+ return /* @__PURE__ */ import_react.default.createElement(
60
+ import_core.DndContext,
61
+ {
62
+ onDragEnd: ({ over, active }) => {
63
+ if (active.id !== (over == null ? void 0 : over.id)) {
64
+ const activeIndex = list == null ? void 0 : list.findIndex((i) => i.id === active.id);
65
+ const overIndex = list == null ? void 0 : list.findIndex((i) => i.id === (over == null ? void 0 : over.id));
66
+ onChange == null ? void 0 : onChange((0, import_sortable.arrayMove)(list, activeIndex, overIndex));
67
+ }
68
+ }
69
+ },
70
+ /* @__PURE__ */ import_react.default.createElement(import_sortable.SortableContext, { items }, list.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
71
+ SortableItem,
72
+ {
73
+ key: getRowKey(item),
74
+ id: getRowKey(item),
75
+ item,
76
+ index
77
+ },
78
+ children
79
+ )))
80
+ );
81
+ }
82
+ function SortableItem({
83
+ id,
84
+ index,
85
+ item,
86
+ children
87
+ }) {
88
+ const {
89
+ attributes,
90
+ isSorting,
91
+ listeners,
92
+ setNodeRef,
93
+ setActivatorNodeRef,
94
+ transform,
95
+ transition
96
+ } = (0, import_sortable.useSortable)({
97
+ id
98
+ });
99
+ return children({
100
+ item,
101
+ index,
102
+ style: {
103
+ transform: import_utilities.CSS.Transform.toString(
104
+ transform && { ...transform, scaleY: 1 }
105
+ ),
106
+ transition
107
+ },
108
+ setActivatorNodeRef,
109
+ listeners,
110
+ attributes,
111
+ props: {
112
+ ref: setNodeRef
113
+ }
114
+ });
115
+ }
116
+ // Annotate the CommonJS export names for ESM import in node:
117
+ 0 && (module.exports = {
118
+ SortableItem
119
+ });
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { SortableItemProps } from "../DragSortList";
3
+ declare type IdType = string | number;
4
+ export interface MultipleContainersSortListProps<T> {
5
+ list: Record<string, T[]>;
6
+ vertical: boolean;
7
+ wrapStyle: React.CSSProperties;
8
+ onChange: (val: Record<string, T[]>) => void;
9
+ renderContainer?: (dom: React.ReactElement) => React.ReactElement;
10
+ rowKey: IdType | ((val: T) => IdType);
11
+ children: SortableItemProps<T>["children"];
12
+ }
13
+ export declare const TRASH_ID = "void";
14
+ declare const MultipleContainersSortList: <T extends Record<string, any>>(props: MultipleContainersSortListProps<T>) => JSX.Element;
15
+ export default MultipleContainersSortList;
@@ -0,0 +1,181 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/MultipleContainersSortList/index.tsx
30
+ var MultipleContainersSortList_exports = {};
31
+ __export(MultipleContainersSortList_exports, {
32
+ TRASH_ID: () => TRASH_ID,
33
+ default: () => MultipleContainersSortList_default
34
+ });
35
+ module.exports = __toCommonJS(MultipleContainersSortList_exports);
36
+ var import_core = require("@dnd-kit/core");
37
+ var import_sortable = require("@dnd-kit/sortable");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_react = __toESM(require("react"));
40
+ var import_DragSortList = require("../DragSortList");
41
+ var TRASH_ID = "void";
42
+ var DefaultRenderContainer = (props) => {
43
+ const { id, children, renderContainer } = props;
44
+ const { setNodeRef } = (0, import_sortable.useSortable)({
45
+ id
46
+ });
47
+ if ((0, import_utils.isFunction)(renderContainer)) {
48
+ return renderContainer({ children, ref: setNodeRef, id });
49
+ }
50
+ if (renderContainer)
51
+ return /* @__PURE__ */ import_react.default.createElement("div", { ref: setNodeRef }, children);
52
+ };
53
+ var MultipleContainersSortList = (props) => {
54
+ const {
55
+ wrapStyle,
56
+ list,
57
+ children,
58
+ onChange,
59
+ renderContainer,
60
+ rowKey = "id"
61
+ } = props;
62
+ const [containers, setContainers] = (0, import_react.useState)([]);
63
+ const getRowKey = (0, import_react.useCallback)(
64
+ (row) => {
65
+ if ((0, import_utils.isFunction)(rowKey)) {
66
+ return rowKey(row);
67
+ }
68
+ return row[rowKey];
69
+ },
70
+ [rowKey]
71
+ );
72
+ (0, import_react.useEffect)(() => {
73
+ setContainers(Object.keys(list));
74
+ }, [list]);
75
+ const findContainer = (id) => {
76
+ if (id in list) {
77
+ return id;
78
+ }
79
+ return Object.keys(list).find(
80
+ (key) => list[key].map((item) => getRowKey(item)).includes(id)
81
+ );
82
+ };
83
+ const handleDragOver = ({ active, over }) => {
84
+ const overId = over == null ? void 0 : over.id;
85
+ if (overId == null || overId === TRASH_ID || active.id in list) {
86
+ return;
87
+ }
88
+ const overContainer = findContainer(overId);
89
+ const activeContainer = findContainer(active.id);
90
+ if (!overContainer || !activeContainer) {
91
+ return;
92
+ }
93
+ if (activeContainer !== overContainer) {
94
+ const activeItems = list[activeContainer];
95
+ const overItems = list[overContainer];
96
+ const overIndex = overItems.findIndex(
97
+ (item) => getRowKey(item) === overId
98
+ );
99
+ const activeIndex = activeItems.findIndex(
100
+ (item) => getRowKey(item) === active.id
101
+ );
102
+ let newIndex;
103
+ if (overId in list) {
104
+ newIndex = overItems.length + 1;
105
+ } else {
106
+ const isBelowOverItem = over && active.rect.current.translated && active.rect.current.translated.top > over.rect.top + over.rect.height;
107
+ const modifier = isBelowOverItem ? 1 : 0;
108
+ newIndex = overIndex >= 0 ? overIndex + modifier : overItems.length + 1;
109
+ }
110
+ const newList = {
111
+ ...list,
112
+ [activeContainer]: list[activeContainer].filter(
113
+ (item) => getRowKey(item) !== active.id
114
+ ),
115
+ [overContainer]: [
116
+ ...list[overContainer].slice(0, newIndex),
117
+ list[activeContainer][activeIndex],
118
+ ...list[overContainer].slice(newIndex, list[overContainer].length)
119
+ ]
120
+ };
121
+ onChange == null ? void 0 : onChange(newList);
122
+ }
123
+ };
124
+ const handleDragEnd = ({ active, over }) => {
125
+ const overId = over == null ? void 0 : over.id;
126
+ const overContainer = findContainer(overId);
127
+ const activeContainer = findContainer(active.id);
128
+ if (!activeContainer) {
129
+ return;
130
+ }
131
+ if (overContainer) {
132
+ const activeIndex = list[activeContainer].findIndex(
133
+ (item) => getRowKey(item) === active.id
134
+ );
135
+ const overIndex = list[overContainer].findIndex(
136
+ (item) => getRowKey(item) === overId
137
+ );
138
+ if (activeIndex !== overIndex) {
139
+ const newList = {
140
+ ...list,
141
+ [overContainer]: (0, import_sortable.arrayMove)(
142
+ list[overContainer],
143
+ activeIndex,
144
+ overIndex
145
+ )
146
+ };
147
+ onChange == null ? void 0 : onChange(newList);
148
+ }
149
+ }
150
+ };
151
+ return /* @__PURE__ */ import_react.default.createElement(import_core.DndContext, { onDragOver: handleDragOver, onDragEnd: handleDragEnd }, /* @__PURE__ */ import_react.default.createElement("div", { style: wrapStyle }, containers.map((container) => /* @__PURE__ */ import_react.default.createElement(
152
+ DefaultRenderContainer,
153
+ {
154
+ id: container,
155
+ renderContainer
156
+ },
157
+ /* @__PURE__ */ import_react.default.createElement(
158
+ import_sortable.SortableContext,
159
+ {
160
+ key: container,
161
+ items: list[container].map((item) => getRowKey(item)),
162
+ strategy: import_sortable.verticalListSortingStrategy
163
+ },
164
+ list[container].map((item, index) => /* @__PURE__ */ import_react.default.createElement(
165
+ import_DragSortList.SortableItem,
166
+ {
167
+ key: getRowKey(item),
168
+ id: getRowKey(item),
169
+ item,
170
+ index
171
+ },
172
+ children
173
+ ))
174
+ )
175
+ ))));
176
+ };
177
+ var MultipleContainersSortList_default = MultipleContainersSortList;
178
+ // Annotate the CommonJS export names for ESM import in node:
179
+ 0 && (module.exports = {
180
+ TRASH_ID
181
+ });
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/date-picker/index.tsx
@@ -24,6 +34,11 @@ __export(date_picker_exports, {
24
34
  module.exports = __toCommonJS(date_picker_exports);
25
35
  var import_antd = require("antd");
26
36
  var import_hoc = require("../../utils/hoc");
37
+ var import_dayjs = __toESM(require("dayjs"));
38
+ var import_localeData = __toESM(require("dayjs/plugin/localeData"));
39
+ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
40
+ import_dayjs.default.extend(import_weekday.default);
41
+ import_dayjs.default.extend(import_localeData.default);
27
42
  var OriginalRangePicker = import_antd.DatePicker.RangePicker;
28
43
  var DatePicker = (0, import_hoc.withMomentProps)(import_antd.DatePicker, [
29
44
  "defaultPickerValue",
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ export declare type FilterItemProps = {
4
+ type: "single" | "input" | "datePicker" | "rangePicker";
5
+ name: string;
6
+ props: object;
7
+ label: string;
8
+ other: Record<string, any>;
9
+ };
10
+ export interface DropdownProps {
11
+ list: FilterItemProps[];
12
+ }
13
+ declare const Dropdown: React.FC<DropdownProps>;
14
+ export default Dropdown;