@pisell/materials 1.0.2 → 1.0.4

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 (333) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -0
  8. package/build/lowcode/render/default/view.js +4 -4
  9. package/build/lowcode/view.css +1 -0
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/auto-complete/index.d.ts +7 -0
  12. package/es/components/auto-complete/index.js +4 -0
  13. package/es/components/button/index.d.ts +8 -0
  14. package/es/components/button/index.js +15 -0
  15. package/es/components/calendar/index.d.ts +3 -0
  16. package/es/components/calendar/index.js +4 -0
  17. package/es/components/cascader/index.d.ts +2 -0
  18. package/es/components/cascader/index.js +6 -0
  19. package/es/components/checkbox/index.d.ts +3 -0
  20. package/es/components/checkbox/index.js +5 -0
  21. package/es/components/config-provider/index.d.ts +4 -0
  22. package/es/components/config-provider/index.js +30 -0
  23. package/es/components/date-picker/index.d.ts +3 -0
  24. package/es/components/date-picker/index.js +7 -0
  25. package/es/components/div/index.d.ts +7 -0
  26. package/es/components/div/index.js +10 -0
  27. package/es/components/drawer/index.d.ts +2 -0
  28. package/es/components/drawer/index.js +13 -0
  29. package/es/components/dropdown/index.d.ts +3 -0
  30. package/es/components/dropdown/index.js +13 -0
  31. package/es/components/form/index.d.ts +8 -0
  32. package/es/components/form/index.js +132 -0
  33. package/es/components/icon/index.d.ts +12 -0
  34. package/es/components/icon/index.js +40 -0
  35. package/es/components/iconfont/index.d.ts +6 -0
  36. package/es/components/iconfont/index.js +13 -0
  37. package/es/components/iconfont/index.less +0 -0
  38. package/es/components/input/index.d.ts +11 -0
  39. package/es/components/input/index.js +12 -0
  40. package/es/components/modal/index.d.ts +2 -0
  41. package/es/components/modal/index.js +18 -0
  42. package/es/components/radio/index.d.ts +3 -0
  43. package/es/components/radio/index.js +5 -0
  44. package/es/components/select/index.d.ts +7 -0
  45. package/es/components/select/index.js +4 -0
  46. package/es/components/skeleton/index.d.ts +3 -0
  47. package/es/components/skeleton/index.js +4 -0
  48. package/es/components/slider/index.d.ts +3 -0
  49. package/es/components/slider/index.js +16 -0
  50. package/es/components/table/Actions/Buttons/index.d.ts +3 -0
  51. package/es/components/table/Actions/Buttons/index.js +10 -0
  52. package/es/components/table/Actions/Buttons/index.less +30 -0
  53. package/es/components/table/Actions/Filter/FilterItem/index.d.ts +10 -0
  54. package/es/components/table/Actions/Filter/FilterItem/index.js +15 -0
  55. package/es/components/table/Actions/Filter/FilterItem/index.less +0 -0
  56. package/es/components/table/Actions/Filter/index.d.ts +12 -0
  57. package/es/components/table/Actions/Filter/index.js +15 -0
  58. package/es/components/table/Actions/Filter/index.less +0 -0
  59. package/es/components/table/Actions/Filter/items/index.d.ts +42 -0
  60. package/es/components/table/Actions/Filter/items/index.js +13 -0
  61. package/es/components/table/Actions/Filter/items/text/Editor/index.d.ts +3 -0
  62. package/es/components/table/Actions/Filter/items/text/Editor/index.js +10 -0
  63. package/es/components/table/Actions/Filter/items/text/Editor/index.less +0 -0
  64. package/es/components/table/Actions/Filter/items/text/Preview/index.d.ts +3 -0
  65. package/es/components/table/Actions/Filter/items/text/Preview/index.js +17 -0
  66. package/es/components/table/Actions/Filter/items/text/Preview/index.less +0 -0
  67. package/es/components/table/Actions/Filter/items/text/index.d.ts +12 -0
  68. package/es/components/table/Actions/Filter/items/text/index.js +13 -0
  69. package/es/components/table/Actions/Filter/items/text/index.less +0 -0
  70. package/es/components/table/Actions/index.d.ts +4 -0
  71. package/es/components/table/Actions/index.js +20 -0
  72. package/es/components/table/Actions/index.less +30 -0
  73. package/es/components/table/Pagination/index.d.ts +5 -0
  74. package/es/components/table/Pagination/index.js +35 -0
  75. package/es/components/table/Pagination/index.less +88 -0
  76. package/es/components/table/Table/AddFieldModal/index.d.ts +3 -0
  77. package/es/components/table/Table/AddFieldModal/index.js +140 -0
  78. package/es/components/table/Table/AddFieldModal/index.less +84 -0
  79. package/es/components/table/Table/SelectField/index.d.ts +3 -0
  80. package/es/components/table/Table/SelectField/index.js +89 -0
  81. package/es/components/table/Table/SelectField/index.less +97 -0
  82. package/es/components/table/Table/fields/index.d.ts +57 -0
  83. package/es/components/table/Table/fields/index.js +15 -0
  84. package/es/components/table/Table/fields/link/Editor/index.d.ts +3 -0
  85. package/es/components/table/Table/fields/link/Editor/index.js +10 -0
  86. package/es/components/table/Table/fields/link/Editor/index.less +0 -0
  87. package/es/components/table/Table/fields/link/Preview/index.d.ts +3 -0
  88. package/es/components/table/Table/fields/link/Preview/index.js +17 -0
  89. package/es/components/table/Table/fields/link/Preview/index.less +0 -0
  90. package/es/components/table/Table/fields/link/index.d.ts +12 -0
  91. package/es/components/table/Table/fields/link/index.js +13 -0
  92. package/es/components/table/Table/fields/link/index.less +0 -0
  93. package/es/components/table/Table/fields/text/Editor/index.d.ts +3 -0
  94. package/es/components/table/Table/fields/text/Editor/index.js +11 -0
  95. package/es/components/table/Table/fields/text/Editor/index.less +0 -0
  96. package/es/components/table/Table/fields/text/Preview/index.d.ts +3 -0
  97. package/es/components/table/Table/fields/text/Preview/index.js +18 -0
  98. package/es/components/table/Table/fields/text/Preview/index.less +0 -0
  99. package/es/components/table/Table/fields/text/index.d.ts +12 -0
  100. package/es/components/table/Table/fields/text/index.js +13 -0
  101. package/es/components/table/Table/fields/text/index.less +0 -0
  102. package/es/components/table/Table/index.d.ts +4 -0
  103. package/es/components/table/Table/index.js +136 -0
  104. package/es/components/table/Table/index.less +104 -0
  105. package/es/components/table/Table/tableConfig/SortRow/index.d.ts +4 -0
  106. package/es/components/table/Table/tableConfig/SortRow/index.js +39 -0
  107. package/es/components/table/Table/tableConfig/SortRow/index.less +0 -0
  108. package/es/components/table/Table/tableConfig/body/CellContent/index.d.ts +4 -0
  109. package/es/components/table/Table/tableConfig/body/CellContent/index.js +14 -0
  110. package/es/components/table/Table/tableConfig/body/CellContent/index.less +17 -0
  111. package/es/components/table/Table/tableConfig/body/CellProvider/index.d.ts +4 -0
  112. package/es/components/table/Table/tableConfig/body/CellProvider/index.js +136 -0
  113. package/es/components/table/Table/tableConfig/body/CellProvider/index.less +18 -0
  114. package/es/components/table/Table/tableConfig/body/index.d.ts +30 -0
  115. package/es/components/table/Table/tableConfig/body/index.js +48 -0
  116. package/es/components/table/Table/tableConfig/body/index.less +10 -0
  117. package/es/components/table/Table/tableConfig/header/CellProvider/index.d.ts +14 -0
  118. package/es/components/table/Table/tableConfig/header/CellProvider/index.js +26 -0
  119. package/es/components/table/Table/tableConfig/header/CellProvider/index.less +36 -0
  120. package/es/components/table/Table/tableConfig/header/index.d.ts +18 -0
  121. package/es/components/table/Table/tableConfig/header/index.js +53 -0
  122. package/es/components/table/Table/tableConfig/header/index.less +0 -0
  123. package/es/components/table/Table/tableConfig/summary/index.d.ts +3 -0
  124. package/es/components/table/Table/tableConfig/summary/index.js +18 -0
  125. package/es/components/table/Table/tableConfig/summary/index.less +0 -0
  126. package/es/components/table/index.d.ts +4 -0
  127. package/es/components/table/index.js +42 -0
  128. package/es/components/table/index.less +7 -0
  129. package/es/components/table/model.d.ts +16 -0
  130. package/es/components/table/model.js +96 -0
  131. package/es/components/tabs/index.d.ts +11 -0
  132. package/es/components/tabs/index.js +93 -0
  133. package/es/components/time-picker/index.d.ts +3 -0
  134. package/es/components/time-picker/index.js +4 -0
  135. package/es/components/tree-select/index.d.ts +2 -0
  136. package/es/components/tree-select/index.js +6 -0
  137. package/es/components/upload/index.d.ts +3 -0
  138. package/es/components/upload/index.js +4 -0
  139. package/es/hooks/index.d.ts +2 -0
  140. package/es/hooks/index.js +2 -0
  141. package/es/hooks/useSharedState.d.ts +11 -0
  142. package/es/hooks/useSharedState.js +18 -0
  143. package/{src/index.tsx → es/index.d.ts} +3 -81
  144. package/es/index.js +88 -0
  145. package/es/utils/hoc.d.ts +17 -0
  146. package/es/utils/hoc.js +81 -0
  147. package/es/utils/miniRedux.d.ts +17 -0
  148. package/es/utils/miniRedux.js +69 -0
  149. package/es/utils/warning.d.ts +1 -0
  150. package/es/utils/warning.js +6 -0
  151. package/lib/components/auto-complete/index.d.ts +7 -0
  152. package/lib/components/auto-complete/index.js +28 -0
  153. package/lib/components/button/index.d.ts +8 -0
  154. package/lib/components/button/index.js +47 -0
  155. package/lib/components/calendar/index.d.ts +3 -0
  156. package/lib/components/calendar/index.js +32 -0
  157. package/lib/components/cascader/index.d.ts +2 -0
  158. package/lib/components/cascader/index.js +28 -0
  159. package/lib/components/checkbox/index.d.ts +3 -0
  160. package/lib/components/checkbox/index.js +29 -0
  161. package/lib/components/config-provider/index.d.ts +4 -0
  162. package/lib/components/config-provider/index.js +54 -0
  163. package/lib/components/date-picker/index.d.ts +3 -0
  164. package/lib/components/date-picker/index.js +41 -0
  165. package/lib/components/div/index.d.ts +7 -0
  166. package/lib/components/div/index.js +40 -0
  167. package/lib/components/drawer/index.d.ts +2 -0
  168. package/lib/components/drawer/index.js +45 -0
  169. package/lib/components/dropdown/index.d.ts +3 -0
  170. package/lib/components/dropdown/index.js +45 -0
  171. package/lib/components/form/index.d.ts +8 -0
  172. package/lib/components/form/index.js +114 -0
  173. package/lib/components/icon/index.d.ts +12 -0
  174. package/lib/components/icon/index.js +52 -0
  175. package/lib/components/iconfont/index.d.ts +6 -0
  176. package/lib/components/iconfont/index.js +44 -0
  177. package/lib/components/iconfont/index.less +0 -0
  178. package/lib/components/input/index.d.ts +11 -0
  179. package/lib/components/input/index.js +38 -0
  180. package/lib/components/modal/index.d.ts +2 -0
  181. package/lib/components/modal/index.js +50 -0
  182. package/lib/components/radio/index.d.ts +3 -0
  183. package/lib/components/radio/index.js +29 -0
  184. package/lib/components/select/index.d.ts +7 -0
  185. package/lib/components/select/index.js +28 -0
  186. package/lib/components/skeleton/index.d.ts +3 -0
  187. package/lib/components/skeleton/index.js +28 -0
  188. package/lib/components/slider/index.d.ts +3 -0
  189. package/lib/components/slider/index.js +47 -0
  190. package/lib/components/table/Actions/Buttons/index.d.ts +3 -0
  191. package/lib/components/table/Actions/Buttons/index.js +43 -0
  192. package/lib/components/table/Actions/Buttons/index.less +30 -0
  193. package/lib/components/table/Actions/Filter/FilterItem/index.d.ts +10 -0
  194. package/lib/components/table/Actions/Filter/FilterItem/index.js +41 -0
  195. package/lib/components/table/Actions/Filter/FilterItem/index.less +0 -0
  196. package/lib/components/table/Actions/Filter/index.d.ts +12 -0
  197. package/lib/components/table/Actions/Filter/index.js +43 -0
  198. package/lib/components/table/Actions/Filter/index.less +0 -0
  199. package/lib/components/table/Actions/Filter/items/index.d.ts +42 -0
  200. package/lib/components/table/Actions/Filter/items/index.js +56 -0
  201. package/lib/components/table/Actions/Filter/items/text/Editor/index.d.ts +3 -0
  202. package/lib/components/table/Actions/Filter/items/text/Editor/index.js +29 -0
  203. package/lib/components/table/Actions/Filter/items/text/Editor/index.less +0 -0
  204. package/lib/components/table/Actions/Filter/items/text/Preview/index.d.ts +3 -0
  205. package/lib/components/table/Actions/Filter/items/text/Preview/index.js +38 -0
  206. package/lib/components/table/Actions/Filter/items/text/Preview/index.less +0 -0
  207. package/lib/components/table/Actions/Filter/items/text/index.d.ts +12 -0
  208. package/lib/components/table/Actions/Filter/items/text/index.js +47 -0
  209. package/lib/components/table/Actions/Filter/items/text/index.less +0 -0
  210. package/lib/components/table/Actions/index.d.ts +4 -0
  211. package/lib/components/table/Actions/index.js +42 -0
  212. package/lib/components/table/Actions/index.less +30 -0
  213. package/lib/components/table/Pagination/index.d.ts +5 -0
  214. package/lib/components/table/Pagination/index.js +62 -0
  215. package/lib/components/table/Pagination/index.less +88 -0
  216. package/lib/components/table/Table/AddFieldModal/index.d.ts +3 -0
  217. package/lib/components/table/Table/AddFieldModal/index.js +159 -0
  218. package/lib/components/table/Table/AddFieldModal/index.less +84 -0
  219. package/lib/components/table/Table/SelectField/index.d.ts +3 -0
  220. package/lib/components/table/Table/SelectField/index.js +124 -0
  221. package/lib/components/table/Table/SelectField/index.less +97 -0
  222. package/lib/components/table/Table/fields/index.d.ts +57 -0
  223. package/lib/components/table/Table/fields/index.js +58 -0
  224. package/lib/components/table/Table/fields/link/Editor/index.d.ts +3 -0
  225. package/lib/components/table/Table/fields/link/Editor/index.js +29 -0
  226. package/lib/components/table/Table/fields/link/Editor/index.less +0 -0
  227. package/lib/components/table/Table/fields/link/Preview/index.d.ts +3 -0
  228. package/lib/components/table/Table/fields/link/Preview/index.js +38 -0
  229. package/lib/components/table/Table/fields/link/Preview/index.less +0 -0
  230. package/lib/components/table/Table/fields/link/index.d.ts +12 -0
  231. package/lib/components/table/Table/fields/link/index.js +47 -0
  232. package/lib/components/table/Table/fields/link/index.less +0 -0
  233. package/lib/components/table/Table/fields/text/Editor/index.d.ts +3 -0
  234. package/lib/components/table/Table/fields/text/Editor/index.js +40 -0
  235. package/lib/components/table/Table/fields/text/Editor/index.less +0 -0
  236. package/lib/components/table/Table/fields/text/Preview/index.d.ts +3 -0
  237. package/lib/components/table/Table/fields/text/Preview/index.js +49 -0
  238. package/lib/components/table/Table/fields/text/Preview/index.less +0 -0
  239. package/lib/components/table/Table/fields/text/index.d.ts +12 -0
  240. package/lib/components/table/Table/fields/text/index.js +47 -0
  241. package/lib/components/table/Table/fields/text/index.less +0 -0
  242. package/lib/components/table/Table/index.d.ts +4 -0
  243. package/lib/components/table/Table/index.js +139 -0
  244. package/lib/components/table/Table/index.less +104 -0
  245. package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +4 -0
  246. package/lib/components/table/Table/tableConfig/SortRow/index.js +58 -0
  247. package/lib/components/table/Table/tableConfig/SortRow/index.less +0 -0
  248. package/lib/components/table/Table/tableConfig/body/CellContent/index.d.ts +4 -0
  249. package/lib/components/table/Table/tableConfig/body/CellContent/index.js +49 -0
  250. package/lib/components/table/Table/tableConfig/body/CellContent/index.less +17 -0
  251. package/lib/components/table/Table/tableConfig/body/CellProvider/index.d.ts +4 -0
  252. package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +141 -0
  253. package/lib/components/table/Table/tableConfig/body/CellProvider/index.less +18 -0
  254. package/lib/components/table/Table/tableConfig/body/index.d.ts +30 -0
  255. package/lib/components/table/Table/tableConfig/body/index.js +76 -0
  256. package/lib/components/table/Table/tableConfig/body/index.less +10 -0
  257. package/lib/components/table/Table/tableConfig/header/CellProvider/index.d.ts +14 -0
  258. package/lib/components/table/Table/tableConfig/header/CellProvider/index.js +49 -0
  259. package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +36 -0
  260. package/lib/components/table/Table/tableConfig/header/index.d.ts +18 -0
  261. package/lib/components/table/Table/tableConfig/header/index.js +106 -0
  262. package/lib/components/table/Table/tableConfig/header/index.less +0 -0
  263. package/lib/components/table/Table/tableConfig/summary/index.d.ts +3 -0
  264. package/lib/components/table/Table/tableConfig/summary/index.js +47 -0
  265. package/lib/components/table/Table/tableConfig/summary/index.less +0 -0
  266. package/lib/components/table/index.d.ts +4 -0
  267. package/lib/components/table/index.js +59 -0
  268. package/lib/components/table/index.less +7 -0
  269. package/lib/components/table/model.d.ts +16 -0
  270. package/lib/components/table/model.js +134 -0
  271. package/lib/components/tabs/index.d.ts +11 -0
  272. package/lib/components/tabs/index.js +92 -0
  273. package/lib/components/time-picker/index.d.ts +3 -0
  274. package/lib/components/time-picker/index.js +31 -0
  275. package/lib/components/tree-select/index.d.ts +2 -0
  276. package/lib/components/tree-select/index.js +40 -0
  277. package/lib/components/upload/index.d.ts +3 -0
  278. package/lib/components/upload/index.js +28 -0
  279. package/lib/hooks/index.d.ts +2 -0
  280. package/lib/hooks/index.js +39 -0
  281. package/lib/hooks/useSharedState.d.ts +11 -0
  282. package/lib/hooks/useSharedState.js +33 -0
  283. package/lib/index.d.ts +63 -0
  284. package/lib/index.js +225 -0
  285. package/lib/utils/hoc.d.ts +17 -0
  286. package/lib/utils/hoc.js +101 -0
  287. package/lib/utils/miniRedux.d.ts +17 -0
  288. package/lib/utils/miniRedux.js +86 -0
  289. package/lib/utils/warning.d.ts +1 -0
  290. package/lib/utils/warning.js +31 -0
  291. package/lowcode/alert/meta.ts +62 -62
  292. package/lowcode/card/meta.ts +33 -32
  293. package/lowcode/card/snippets.ts +46 -0
  294. package/lowcode/div/meta.ts +70 -0
  295. package/lowcode/table/meta.ts +131 -0
  296. package/lowcode/test/meta.ts +48 -0
  297. package/package.json +23 -4
  298. package/.fatherrc.ts +0 -7
  299. package/.tmp/assets-daily.json +0 -93
  300. package/.tmp/assets-dev.json +0 -93
  301. package/.tmp/assets-prod.json +0 -93
  302. package/.tmp/default.view.js +0 -24
  303. package/.tmp/index.jsx +0 -279
  304. package/.tmp/meta.js +0 -251
  305. package/.tmp/preview.jsx +0 -72
  306. package/.tmp/view.js +0 -25
  307. package/CHANGELOG.md +0 -13
  308. package/build.lowcode.js +0 -46
  309. package/src/components/auto-complete/index.tsx +0 -6
  310. package/src/components/button/index.tsx +0 -12
  311. package/src/components/calendar/index.tsx +0 -10
  312. package/src/components/cascader/index.tsx +0 -6
  313. package/src/components/checkbox/index.tsx +0 -7
  314. package/src/components/config-provider/index.tsx +0 -27
  315. package/src/components/date-picker/index.tsx +0 -22
  316. package/src/components/drawer/index.tsx +0 -13
  317. package/src/components/dropdown/index.tsx +0 -13
  318. package/src/components/form/index.tsx +0 -97
  319. package/src/components/icon/index.tsx +0 -34
  320. package/src/components/input/index.tsx +0 -18
  321. package/src/components/modal/index.tsx +0 -18
  322. package/src/components/radio/index.tsx +0 -7
  323. package/src/components/select/index.tsx +0 -6
  324. package/src/components/skeleton/index.tsx +0 -6
  325. package/src/components/slider/index.tsx +0 -18
  326. package/src/components/table/index.tsx +0 -10
  327. package/src/components/tabs/index.tsx +0 -67
  328. package/src/components/time-picker/index.tsx +0 -9
  329. package/src/components/tree-select/index.tsx +0 -8
  330. package/src/components/upload/index.tsx +0 -5
  331. package/src/utils/hoc.tsx +0 -92
  332. package/src/utils/warning.ts +0 -3
  333. package/tsconfig.json +0 -14
@@ -0,0 +1,97 @@
1
+ .field-list {
2
+ width: 100%;
3
+ max-height: 500px;
4
+ overflow-y: auto;
5
+ padding: 16px 0 0 0;
6
+ border-top: 1px solid #F1F1F1;
7
+ position: relative;
8
+
9
+ .field-search {
10
+ margin-bottom: 10px;
11
+ position: sticky;
12
+ top: 0;
13
+ left: 0;
14
+ width: 100%;
15
+ height: 36px;
16
+ display: flex;
17
+ align-items: center;
18
+ }
19
+
20
+ .field-item {
21
+ height: 40px;
22
+ border-radius: 4px;
23
+ cursor: pointer;
24
+ display: flex;
25
+ align-items: center;
26
+ transition: .2s;
27
+ padding: 0 8px;
28
+ margin-bottom: 2px;
29
+
30
+ &:hover,
31
+ &.active {
32
+ background: #F1F1F1;
33
+ }
34
+
35
+ .field-icon {
36
+ width: 24px;
37
+ height: 24px;
38
+ font-size: 24px;
39
+ color: #777777;
40
+ }
41
+
42
+ .field-name {
43
+ margin-left: 8px;
44
+ flex: auto;
45
+ font-style: normal;
46
+ font-weight: 400;
47
+ font-size: 14px;
48
+ color: #1B1B1B;
49
+ }
50
+ }
51
+ }
52
+
53
+ .current-field {
54
+ width: 100%;
55
+ height: 36px;
56
+ /* Background/Web_Bg
57
+
58
+ web大背景、下拉弹窗禁用背景、输入框禁用背景
59
+ */
60
+ background: #FAFAFA;
61
+ /* Surface/Surface_3
62
+
63
+ 输入框边框、输入框提示icon、开关禁用、80
64
+ */
65
+ border: 1px solid #C6C6C6;
66
+ border-radius: 8px;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: flex-start;
70
+ padding: 0 10px;
71
+ overflow: hidden;
72
+ text-overflow: ellipsis;
73
+ white-space: nowrap;
74
+ word-break: break-all;
75
+ cursor: pointer;
76
+
77
+ .left {
78
+ flex: 1;
79
+ display: flex;
80
+ align-items: center;
81
+
82
+ .icon {
83
+ color: #919191;
84
+ font-size: 16px;
85
+ margin-right: 10px;
86
+ }
87
+
88
+
89
+ .name {
90
+ color: #919191;
91
+ font-weight: 400;
92
+ font-size: 14px;
93
+ }
94
+ }
95
+
96
+ .right {}
97
+ }
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ export declare const fieldMaps: {
3
+ text: {
4
+ field: {
5
+ field_icon: string;
6
+ field_name: string;
7
+ field_type: string;
8
+ default_value: string;
9
+ };
10
+ Preview: (props: any) => JSX.Element;
11
+ Editor: () => JSX.Element;
12
+ };
13
+ link: {
14
+ field: {
15
+ field_icon: string;
16
+ field_name: string;
17
+ field_type: string;
18
+ default_value: string;
19
+ };
20
+ Preview: (props: any) => JSX.Element;
21
+ Editor: () => JSX.Element;
22
+ };
23
+ };
24
+ export declare const fieldList: ({
25
+ field_icon: string;
26
+ field_name: string;
27
+ field_type: string;
28
+ default_value: string;
29
+ } | {
30
+ field_icon: string;
31
+ field_name: string;
32
+ field_type: string;
33
+ default_value: string;
34
+ })[];
35
+ export declare const getFieldByType: (type: string) => {
36
+ field: {
37
+ field_icon: string;
38
+ field_name: string;
39
+ field_type: string;
40
+ default_value: string;
41
+ };
42
+ Preview: (props: any) => JSX.Element;
43
+ Editor: () => JSX.Element;
44
+ };
45
+ declare const _default: {
46
+ text: {
47
+ field: {
48
+ field_icon: string;
49
+ field_name: string;
50
+ field_type: string;
51
+ default_value: string;
52
+ };
53
+ Preview: (props: any) => JSX.Element;
54
+ Editor: () => JSX.Element;
55
+ };
56
+ };
57
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import text from "./text";
2
+ import link from "./link";
3
+ export var fieldMaps = {
4
+ text: text,
5
+ link: link
6
+ };
7
+ export var fieldList = Object.values(fieldMaps).map(function (d) {
8
+ return d.field;
9
+ });
10
+ export var getFieldByType = function getFieldByType(type) {
11
+ return fieldMaps[type];
12
+ };
13
+ export default {
14
+ text: text
15
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Text: () => JSX.Element;
3
+ export default Text;
@@ -0,0 +1,10 @@
1
+ import { Form, Input } from "antd";
2
+ var Text = function Text() {
3
+ return /*#__PURE__*/React.createElement("div", {
4
+ className: ""
5
+ }, /*#__PURE__*/React.createElement(Form.Item, {
6
+ label: "Default value",
7
+ name: "default_value"
8
+ }, /*#__PURE__*/React.createElement(Input, null)));
9
+ };
10
+ export default Text;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Text: (props: any) => JSX.Element;
3
+ export default Text;
@@ -0,0 +1,17 @@
1
+ var _excluded = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave"];
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
+ 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
+ var Text = function Text(props) {
5
+ var title = props.title,
6
+ editable = props.editable,
7
+ children = props.children,
8
+ dataIndex = props.dataIndex,
9
+ field_type = props.field_type,
10
+ record = props.record,
11
+ handleSave = props.handleSave,
12
+ restProps = _objectWithoutProperties(props, _excluded);
13
+ return /*#__PURE__*/React.createElement("a", {
14
+ className: ""
15
+ }, record[dataIndex]);
16
+ };
17
+ export default Text;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ field: {
4
+ field_icon: string;
5
+ field_name: string;
6
+ field_type: string;
7
+ default_value: string;
8
+ };
9
+ Preview: (props: any) => JSX.Element;
10
+ Editor: () => JSX.Element;
11
+ };
12
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import Editor from "./Editor";
2
+ import Preview from "./Preview";
3
+ var field = {
4
+ field_icon: 'pi-a-Property3Singlelinetext',
5
+ field_name: 'Link',
6
+ field_type: 'link',
7
+ default_value: 'Text'
8
+ };
9
+ export default {
10
+ field: field,
11
+ Preview: Preview,
12
+ Editor: Editor
13
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Text: () => JSX.Element;
3
+ export default Text;
@@ -0,0 +1,11 @@
1
+ import { Form, Input } from "antd";
2
+ import React from "react";
3
+ var Text = function Text() {
4
+ return /*#__PURE__*/React.createElement("div", {
5
+ className: ""
6
+ }, /*#__PURE__*/React.createElement(Form.Item, {
7
+ label: "Default value",
8
+ name: "default_value"
9
+ }, /*#__PURE__*/React.createElement(Input, null)));
10
+ };
11
+ export default Text;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Text: (props: any) => JSX.Element;
3
+ export default Text;
@@ -0,0 +1,18 @@
1
+ var _excluded = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave"];
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
+ 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
+ import React from "react";
5
+ var Text = function Text(props) {
6
+ var title = props.title,
7
+ editable = props.editable,
8
+ children = props.children,
9
+ dataIndex = props.dataIndex,
10
+ field_type = props.field_type,
11
+ record = props.record,
12
+ handleSave = props.handleSave,
13
+ restProps = _objectWithoutProperties(props, _excluded);
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: ""
16
+ }, record[dataIndex]);
17
+ };
18
+ export default Text;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ field: {
4
+ field_icon: string;
5
+ field_name: string;
6
+ field_type: string;
7
+ default_value: string;
8
+ };
9
+ Preview: (props: any) => JSX.Element;
10
+ Editor: () => JSX.Element;
11
+ };
12
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import Editor from "./Editor";
2
+ import Preview from "./Preview";
3
+ var field = {
4
+ field_icon: "pi-a-Property3Singlelinetext",
5
+ field_name: "Single line text",
6
+ field_type: "text",
7
+ default_value: "Text"
8
+ };
9
+ export default {
10
+ field: field,
11
+ Preview: Preview,
12
+ Editor: Editor
13
+ };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const GridViewTable: React.FC<any>;
4
+ export default GridViewTable;
@@ -0,0 +1,136 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ 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); }
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+ 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; }
14
+ import { useSharedState } from "../../../hooks";
15
+ import { Table } from "antd";
16
+ // import { Access } from '@umijs/max';
17
+ import React, { useMemo } from "react";
18
+ import { Context } from "../model";
19
+ // import AddFieldModal from "./AddFieldModal";
20
+ import Iconfont from "../../iconfont";
21
+ import "./index.less";
22
+ import SortRow from "./tableConfig/SortRow";
23
+ import Body from "./tableConfig/body";
24
+ import Header from "./tableConfig/header";
25
+ var itemRender = function itemRender(_, type, originalElement) {
26
+ if (type === "prev") {
27
+ return /*#__PURE__*/React.createElement("div", {
28
+ className: "paginator-page-btn left"
29
+ }, /*#__PURE__*/React.createElement(Iconfont, {
30
+ type: "icona-iconArrowsLine",
31
+ className: "icon"
32
+ }), "Pre");
33
+ }
34
+ if (type === "next") {
35
+ return /*#__PURE__*/React.createElement("div", {
36
+ className: "paginator-page-btn right"
37
+ }, "Next", /*#__PURE__*/React.createElement(Iconfont, {
38
+ type: "icona-iconArrowsLine",
39
+ className: "icon"
40
+ }));
41
+ }
42
+ return originalElement;
43
+ };
44
+ var GridViewTable = function GridViewTable(_ref) {
45
+ var tableProps = _ref.tableProps;
46
+ var _useSharedState = useSharedState(Context),
47
+ state = _useSharedState.state,
48
+ dispatch = _useSharedState.dispatch;
49
+ var dataSource = state.dataSource,
50
+ defaultColumns = state.defaultColumns;
51
+ var handleSave = function handleSave(row) {
52
+ var newData = _toConsumableArray(dataSource);
53
+ var index = newData.findIndex(function (item) {
54
+ return row.key === item.key;
55
+ });
56
+ var item = newData[index];
57
+ newData.splice(index, 1, _objectSpread(_objectSpread({}, item), row));
58
+ dispatch({
59
+ type: "setDataSource",
60
+ payload: newData
61
+ });
62
+ };
63
+ var handleResize = function handleResize(index) {
64
+ return function (e, _ref2) {
65
+ var size = _ref2.size;
66
+ var nextColumns = _toConsumableArray(defaultColumns);
67
+ nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
68
+ width: size.width
69
+ });
70
+ dispatch({
71
+ type: "setDefaultColumns",
72
+ payload: nextColumns
73
+ });
74
+ };
75
+ };
76
+ var columns = useMemo(function () {
77
+ return defaultColumns.map(function (col, index) {
78
+ if (!col.editable) {
79
+ return col;
80
+ }
81
+ var item = {
82
+ editable: col.editable || true,
83
+ dataIndex: col.dataIndex,
84
+ title: col.title,
85
+ field_type: col.field_type,
86
+ lock: col.lock,
87
+ width: col.width || 0
88
+ };
89
+ return _objectSpread(_objectSpread({}, col), {}, {
90
+ onCell: function onCell(record) {
91
+ return _objectSpread(_objectSpread({
92
+ record: record
93
+ }, item), {}, {
94
+ handleSave: handleSave
95
+ });
96
+ },
97
+ onHeaderCell: function onHeaderCell(record) {
98
+ return _objectSpread(_objectSpread({
99
+ record: record
100
+ }, item), {}, {
101
+ onResize: handleResize(index)
102
+ });
103
+ }
104
+ });
105
+ });
106
+ }, [defaultColumns]);
107
+ var pagination = useMemo(function () {
108
+ return tableProps.pagination === false ? false : _objectSpread({
109
+ className: "materials-grid-paginator",
110
+ itemRender: itemRender
111
+ }, tableProps.pagination);
112
+ }, [tableProps.pagination]);
113
+ return /*#__PURE__*/React.createElement("div", {
114
+ className: "materials-grid-table-wrap"
115
+ }, /*#__PURE__*/React.createElement(SortRow, null, /*#__PURE__*/React.createElement(Table, _extends({
116
+ dataSource: dataSource,
117
+ columns: columns,
118
+ className: "grid-view-table",
119
+ components: {
120
+ header: {
121
+ row: Header.Row,
122
+ cell: Header.Cell
123
+ },
124
+ body: {
125
+ row: Body.Row,
126
+ cell: Body.Coll
127
+ }
128
+ }
129
+ }, tableProps, {
130
+ scroll: {
131
+ x: "max-content"
132
+ },
133
+ pagination: pagination
134
+ }))));
135
+ };
136
+ export default GridViewTable;
@@ -0,0 +1,104 @@
1
+ .grid-view-table-wrap {
2
+ position: relative;
3
+ // flex: 1;
4
+ // display: flex;
5
+ // flex-direction: column;
6
+
7
+ .grid-view-table {
8
+ margin-top: 20px;
9
+ // width: max-content;
10
+
11
+ }
12
+
13
+
14
+
15
+ }
16
+
17
+ .materials-grid-paginator {
18
+ margin: 0 !important;
19
+ display: flex;
20
+ justify-content: center;
21
+ align-items: center;
22
+ overflow: hidden;
23
+ height: 50px;
24
+ width: 100%;
25
+ background-color: #fff;
26
+ border-radius: 0 0 8px 8px;
27
+ border: 1px solid #f0f0f0;
28
+ border-top: none;
29
+
30
+ .ant-pagination-item {
31
+ position: relative;
32
+ border: none;
33
+ }
34
+
35
+ .ant-pagination-disabled {
36
+ opacity: 0.4;
37
+ }
38
+
39
+ .ant-pagination-item-active {
40
+ a {
41
+ font-weight: 450 !important;
42
+ color: rgba(0, 0, 0, 0.88) !important;
43
+
44
+ }
45
+
46
+ background-color: rgba(0, 0, 0, 0.06);
47
+ }
48
+
49
+ .ant-pagination-prev {
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ margin-right: auto;
54
+ min-width: auto;
55
+ }
56
+
57
+ .ant-pagination-item-active {}
58
+
59
+ .ant-pagination-next {
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ margin-left: auto;
64
+ min-width: auto;
65
+ }
66
+ }
67
+
68
+ .paginator-page-btn {
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ border-radius: 4px 4px 4px 4px;
73
+ padding: 0 4px;
74
+ transition: 0.2s;
75
+ font-size: 12px;
76
+ font-weight: 400;
77
+ color: #6f6f6f;
78
+ cursor: pointer;
79
+ user-select: none;
80
+ height: 20px;
81
+
82
+ &:hover {
83
+ // background: #f2f2f2;
84
+ }
85
+
86
+ &.left {
87
+ margin-right: auto;
88
+
89
+ .icon {
90
+ font-size: 18px;
91
+ margin-right: 8px;
92
+ }
93
+ }
94
+
95
+ &.right {
96
+ margin-left: auto;
97
+
98
+ .icon {
99
+ font-size: 18px;
100
+ margin-left: 8px;
101
+ transform: rotate(180deg);
102
+ }
103
+ }
104
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const SortRow: ({ children }: any) => JSX.Element;
4
+ export default SortRow;
@@ -0,0 +1,39 @@
1
+ import { useSharedState } from "../../../../../hooks";
2
+ import { Context } from "../../../model";
3
+ import "./index.less";
4
+ import React from "react";
5
+ import { DndContext } from "@dnd-kit/core";
6
+ import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
7
+ import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
8
+ var SortRow = function SortRow(_ref) {
9
+ var children = _ref.children;
10
+ var _useSharedState = useSharedState(Context),
11
+ state = _useSharedState.state,
12
+ dispatch = _useSharedState.dispatch;
13
+ var dataSource = state.dataSource;
14
+ var onDragEnd = function onDragEnd(_ref2) {
15
+ var active = _ref2.active,
16
+ over = _ref2.over;
17
+ if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
18
+ // setDataSource((previous) => {
19
+ // const activeIndex = previous.findIndex((i) => i.key === active.id);
20
+ // const overIndex = previous.findIndex((i) => i.key === over?.id);
21
+ // return arrayMove(previous, activeIndex, overIndex);
22
+ // });
23
+ }
24
+ };
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ className: "grid-view-table-wrap"
27
+ }, /*#__PURE__*/React.createElement(DndContext, {
28
+ modifiers: [restrictToVerticalAxis],
29
+ onDragEnd: onDragEnd
30
+ }, /*#__PURE__*/React.createElement(SortableContext
31
+ // rowKey array
32
+ , {
33
+ items: dataSource.map(function (i) {
34
+ return i.key;
35
+ }),
36
+ strategy: verticalListSortingStrategy
37
+ }, children)));
38
+ };
39
+ export default SortRow;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const CellProvider: React.FC<any>;
4
+ export default CellProvider;
@@ -0,0 +1,14 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import classNames from "classnames";
6
+ import React from "react";
7
+ import "./index.less";
8
+ var CellProvider = function CellProvider(_ref) {
9
+ var children = _ref.children;
10
+ return /*#__PURE__*/React.createElement("div", {
11
+ className: classNames("cell-provider", _defineProperty({}, "focus", true))
12
+ }, children);
13
+ };
14
+ export default CellProvider;
@@ -0,0 +1,17 @@
1
+ .cell-provider {
2
+ position: relative;
3
+ cursor: pointer;
4
+ width: 100%;
5
+ height: 100%;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ border-radius: 4px;
10
+ padding: 12px;
11
+
12
+ &.focus {
13
+ box-shadow: rgb(22, 110, 225) 0px 0px 0px 1px !important;
14
+ }
15
+
16
+
17
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const CellProvider: React.FC<any>;
4
+ export default CellProvider;