@pisell/materials 1.0.471 → 1.0.473

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 (279) 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 +7 -7
  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 +18 -18
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +15 -15
  11. package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -1
  12. package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
  13. package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
  14. package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -3
  15. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
  16. package/es/components/dataSourceComponents/dataSourceForm/utils.js +41 -17
  17. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
  18. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +4 -0
  19. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
  20. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +4 -0
  21. package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
  22. package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +15 -0
  23. package/es/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
  24. package/es/components/dataSourceComponents/dataSourceShow/utils.js +82 -0
  25. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +33 -139
  26. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
  27. package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +162 -0
  28. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
  29. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +135 -0
  30. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  31. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
  32. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +35 -39
  33. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
  34. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +65 -11
  35. package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
  36. package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +105 -6
  37. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
  38. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +245 -0
  39. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
  40. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +41 -12
  41. package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
  42. package/es/components/dataSourceComponents/dataSourceTable/index.js +1 -0
  43. package/es/components/dataSourceComponents/dataSourceTable/index.less +5 -0
  44. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
  45. package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
  46. package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +23 -0
  47. package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
  48. package/es/components/dataSourceComponents/dataSourceWrapper/index.js +17 -2
  49. package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +7 -1
  50. package/es/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
  51. package/es/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
  52. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
  53. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +7 -0
  54. package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
  55. package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +5 -0
  56. package/es/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
  57. package/es/components/dataSourceComponents/fields/DateRangePicker/index.js +5 -0
  58. package/es/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
  59. package/es/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
  60. package/es/components/dataSourceComponents/fields/DateRangePicker/type.js +1 -0
  61. package/es/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
  62. package/es/components/dataSourceComponents/fields/Input/index.js +4 -0
  63. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
  64. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +5 -0
  65. package/es/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
  66. package/es/components/dataSourceComponents/fields/Input.Email/WithMode.js +17 -0
  67. package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
  68. package/es/components/dataSourceComponents/fields/Input.Email/index.js +4 -0
  69. package/es/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
  70. package/es/components/dataSourceComponents/fields/Input.Email/type.js +1 -0
  71. package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
  72. package/es/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
  73. package/es/components/dataSourceComponents/fields/Input.Json/WithMode.js +41 -1
  74. package/es/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
  75. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
  76. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +5 -0
  77. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
  78. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +12 -0
  79. package/es/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
  80. package/es/components/dataSourceComponents/fields/Input.Phone/index.js +4 -0
  81. package/es/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
  82. package/es/components/dataSourceComponents/fields/Input.Phone/type.js +1 -0
  83. package/es/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
  84. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  85. package/es/components/dataSourceComponents/fields/index.d.ts +52 -4
  86. package/es/components/dataSourceComponents/fields/index.js +7 -2
  87. package/es/components/dataSourceComponents/fields/type.d.ts +18 -0
  88. package/es/components/dataSourceComponents/fields/type.js +1 -0
  89. package/es/components/dataSourceComponents/fields/utils.d.ts +3 -0
  90. package/es/components/dataSourceComponents/fields/utils.js +111 -0
  91. package/es/components/dataSourceComponents/hooks/useActions.js +22 -7
  92. package/es/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
  93. package/es/components/dataSourceComponents/hooks/useComponentId.js +9 -0
  94. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
  95. package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
  96. package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +37 -27
  97. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
  98. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +19 -13
  99. package/es/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
  100. package/es/components/dataSourceComponents/provider/variables/utils.js +9 -0
  101. package/es/components/filter/components/Dropdown/index.d.ts +1 -0
  102. package/es/components/filter/components/Dropdown/index.js +6 -2
  103. package/es/components/filter/components/FilterButton/index.js +5 -3
  104. package/es/components/filter/components/FilterButton/types.d.ts +2 -0
  105. package/es/components/table/Actions/index.js +16 -7
  106. package/es/components/table/Gallery/index.d.ts +3 -3
  107. package/es/components/table/Gallery/index.js +25 -7
  108. package/es/components/table/Gallery/index.less +1 -0
  109. package/es/components/table/Header/index.d.ts +10 -3
  110. package/es/components/table/Header/index.js +37 -11
  111. package/es/components/table/Header/index.less +10 -2
  112. package/es/components/table/Table/utils.js +4 -0
  113. package/es/components/table/Tabs/index.d.ts +14 -0
  114. package/es/components/table/Tabs/index.js +37 -0
  115. package/es/components/table/hooks/useTriggerValuesChange.js +3 -0
  116. package/es/components/table/index.js +16 -3
  117. package/es/components/table/types.d.ts +14 -2
  118. package/es/components/typography/index.d.ts +2 -2
  119. package/es/components/typography/index.js +4 -3
  120. package/es/index.d.ts +4 -0
  121. package/es/index.js +5 -1
  122. package/es/locales/en-US.d.ts +7 -0
  123. package/es/locales/en-US.js +16 -1
  124. package/es/locales/zh-CN.d.ts +7 -0
  125. package/es/locales/zh-CN.js +16 -1
  126. package/es/locales/zh-TW.d.ts +7 -0
  127. package/es/locales/zh-TW.js +16 -1
  128. package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -1
  129. package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
  130. package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
  131. package/lib/components/dataSourceComponents/dataSourceForm/serve.js +3 -2
  132. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
  133. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +58 -11
  134. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
  135. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +38 -0
  136. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
  137. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +38 -0
  138. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
  139. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +44 -0
  140. package/lib/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
  141. package/lib/components/dataSourceComponents/dataSourceShow/utils.js +95 -0
  142. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +29 -90
  143. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
  144. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +176 -0
  145. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
  146. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +176 -0
  147. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  148. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
  149. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +24 -37
  150. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
  151. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +53 -7
  152. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
  153. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +73 -3
  154. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
  155. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +236 -0
  156. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
  157. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +38 -11
  158. package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
  159. package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -0
  160. package/lib/components/dataSourceComponents/dataSourceTable/index.less +5 -0
  161. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
  162. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
  163. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +51 -0
  164. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
  165. package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +14 -2
  166. package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -1
  167. package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
  168. package/lib/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
  169. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
  170. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +41 -0
  171. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
  172. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +42 -0
  173. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
  174. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.js +39 -0
  175. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
  176. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
  177. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.js +17 -0
  178. package/lib/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
  179. package/lib/components/dataSourceComponents/fields/Input/index.js +4 -0
  180. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
  181. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +39 -0
  182. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
  183. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +57 -0
  184. package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
  185. package/lib/components/dataSourceComponents/fields/Input.Email/index.js +38 -0
  186. package/lib/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
  187. package/lib/components/dataSourceComponents/fields/Input.Email/type.js +17 -0
  188. package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
  189. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
  190. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +30 -2
  191. package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
  192. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
  193. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +39 -0
  194. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
  195. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +43 -0
  196. package/lib/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
  197. package/lib/components/dataSourceComponents/fields/Input.Phone/index.js +38 -0
  198. package/lib/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
  199. package/lib/components/dataSourceComponents/fields/Input.Phone/type.js +17 -0
  200. package/lib/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
  201. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  202. package/lib/components/dataSourceComponents/fields/index.d.ts +52 -4
  203. package/lib/components/dataSourceComponents/fields/index.js +6 -1
  204. package/lib/components/dataSourceComponents/fields/type.d.ts +18 -0
  205. package/lib/components/dataSourceComponents/fields/type.js +17 -0
  206. package/lib/components/dataSourceComponents/fields/utils.d.ts +3 -0
  207. package/lib/components/dataSourceComponents/fields/utils.js +134 -0
  208. package/lib/components/dataSourceComponents/hooks/useActions.js +14 -5
  209. package/lib/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
  210. package/lib/components/dataSourceComponents/hooks/useComponentId.js +32 -0
  211. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
  212. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
  213. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +29 -16
  214. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
  215. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +17 -8
  216. package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
  217. package/lib/components/dataSourceComponents/provider/variables/utils.js +15 -2
  218. package/lib/components/filter/components/Dropdown/index.d.ts +1 -0
  219. package/lib/components/filter/components/Dropdown/index.js +6 -2
  220. package/lib/components/filter/components/FilterButton/index.js +5 -3
  221. package/lib/components/filter/components/FilterButton/types.d.ts +2 -0
  222. package/lib/components/table/Actions/index.js +18 -9
  223. package/lib/components/table/Gallery/index.d.ts +3 -3
  224. package/lib/components/table/Gallery/index.js +17 -0
  225. package/lib/components/table/Gallery/index.less +1 -0
  226. package/lib/components/table/Header/index.d.ts +10 -3
  227. package/lib/components/table/Header/index.js +29 -4
  228. package/lib/components/table/Header/index.less +10 -2
  229. package/lib/components/table/Table/utils.js +4 -0
  230. package/lib/components/table/Tabs/index.d.ts +14 -0
  231. package/lib/components/table/Tabs/index.js +70 -0
  232. package/lib/components/table/hooks/useTriggerValuesChange.js +3 -0
  233. package/lib/components/table/index.js +17 -2
  234. package/lib/components/table/types.d.ts +14 -2
  235. package/lib/components/typography/index.d.ts +2 -2
  236. package/lib/components/typography/index.js +4 -3
  237. package/lib/index.d.ts +4 -0
  238. package/lib/index.js +12 -0
  239. package/lib/locales/en-US.d.ts +7 -0
  240. package/lib/locales/en-US.js +8 -1
  241. package/lib/locales/zh-CN.d.ts +7 -0
  242. package/lib/locales/zh-CN.js +8 -1
  243. package/lib/locales/zh-TW.d.ts +7 -0
  244. package/lib/locales/zh-TW.js +8 -1
  245. package/lowcode/_utils/defaultSchema.ts +452 -83
  246. package/lowcode/_utils/type.ts +5 -0
  247. package/lowcode/_utils/utils.ts +1 -0
  248. package/lowcode/button/meta.ts +1 -2
  249. package/lowcode/data-source-form/constants.ts +5 -0
  250. package/lowcode/data-source-form/meta.ts +259 -273
  251. package/lowcode/data-source-form/snippets.ts +9 -0
  252. package/lowcode/data-source-form/utils.ts +80 -15
  253. package/lowcode/data-source-image/meta.ts +74 -0
  254. package/lowcode/data-source-image/snippets.ts +14 -0
  255. package/lowcode/data-source-qrcode/meta.ts +158 -0
  256. package/lowcode/data-source-qrcode/snippets.ts +20 -0
  257. package/lowcode/data-source-table/meta.ts +4577 -2285
  258. package/lowcode/data-source-table/snippets.ts +10 -4
  259. package/lowcode/data-source-table/utils.tsx +254 -0
  260. package/lowcode/data-source-typography/meta.ts +54 -0
  261. package/lowcode/data-source-typography.text/meta.ts +212 -0
  262. package/lowcode/data-source-typography.text/snippets.ts +12 -0
  263. package/lowcode/data-source-wrapper/meta.ts +243 -0
  264. package/lowcode/data-source-wrapper/snippets.ts +11 -0
  265. package/lowcode/data-source-wrapper/utils.ts +45 -0
  266. package/lowcode/form-item-color-picker/snippets.ts +1 -0
  267. package/lowcode/form-item-input/meta.ts +2 -1
  268. package/lowcode/form-item-input/snippets.ts +2 -1
  269. package/lowcode/form-item-input.email/meta.ts +284 -0
  270. package/lowcode/form-item-input.email/snippets.ts +35 -0
  271. package/lowcode/form-item-input.phone/meta.ts +295 -0
  272. package/lowcode/form-item-input.phone/snippets.ts +16 -0
  273. package/lowcode/form-item-input.text-area/meta.ts +243 -32
  274. package/lowcode/form-item-input.text-area/snippets.ts +2 -1
  275. package/lowcode/form-item-input.url/meta.ts +44 -20
  276. package/lowcode/form-item-input.url/snippets.ts +5 -5
  277. package/lowcode/table/snippets.ts +6 -0
  278. package/lowcode/test/meta.ts +1 -2
  279. package/package.json +2 -2
@@ -6,6 +6,9 @@ export default [
6
6
  schema: {
7
7
  componentName: 'DataSourceTable',
8
8
  props: {
9
+ style: {
10
+ padding: '24px',
11
+ },
9
12
  dataSource: [],
10
13
  columns: [],
11
14
  rowKey: 'id',
@@ -13,18 +16,19 @@ export default [
13
16
  pageSize: 10,
14
17
  total: 15,
15
18
  current: 1,
19
+ localPagination: false,
16
20
  },
17
21
  view: {
18
22
  defaultViewMode: 'grid',
19
23
  multiple: false,
20
24
  },
21
25
  columnSetting: {
22
- show: false,
23
- storageMode: '',
26
+ show: true,
27
+ storageMode: 'localStorage',
24
28
  },
25
29
  sort: {
26
30
  show: false,
27
- storageMode: '',
31
+ storageMode: 'localStorage',
28
32
  },
29
33
  dataSourceGroup: {
30
34
  show: false,
@@ -71,13 +75,15 @@ export default [
71
75
  showHeader: true,
72
76
  bordered: true,
73
77
  size: 'default',
74
- tableLayout: '',
78
+ tableLayout: 'auto',
75
79
  virtual: true,
76
80
  scroll: {
77
81
  autoCalc: false,
78
82
  scrollToFirstRowOnChange: true,
79
83
  },
80
84
  dragSort: false,
85
+ showTitle: true,
86
+ showSubTitle: true,
81
87
  },
82
88
  },
83
89
  },
@@ -2,6 +2,14 @@ import {
2
2
  nocobaseCpt2PisellCptMap,
3
3
  systemFields,
4
4
  } from '../data-source-form/constants';
5
+ import { clearVariables } from '../data-source-form/utils';
6
+ import {
7
+ getVariable,
8
+ getAllVariables,
9
+ createSubmitButton,
10
+ fields2ChildrenSchemas,
11
+ } from '../data-source-form/utils';
12
+ import { omit } from '../_utils/utils';
5
13
 
6
14
  const createRenderSchema = (field: any) => {
7
15
  let props: Record<string, any> = {
@@ -143,3 +151,249 @@ export const columns2Options = (columns: any[], allFields: any[] = []) => {
143
151
  export const genDataSourceValueKey = (target: any, key: string) => {
144
152
  return `{{${target.node.id}.value.${key}}}`;
145
153
  };
154
+
155
+ // 获取当前target下的所有columns的dataIndex
156
+ export const getColumnsDataIndex = (target: any) => {
157
+ return target
158
+ .getProps()
159
+ .getPropValue('columns')
160
+ .map((column: any) => column.dataIndex);
161
+ };
162
+
163
+ // 重置表格的props
164
+ export const resetTableProps = (target: any) => {
165
+ target.getProps().setPropValue('columns', []);
166
+ target.getProps().setPropValue('title', '');
167
+ target.getProps().setPropValue('operationContent', {});
168
+ target.getProps().setPropValue('filter', {
169
+ show: false,
170
+ sortButtonShow: false,
171
+ storageMode: '',
172
+ quickFilterMaxLength: 3,
173
+ list: [],
174
+ });
175
+ target.getProps().setPropValue('sort', {
176
+ show: false,
177
+ storageMode: 'localStorage',
178
+ });
179
+ clearVariables(target);
180
+ };
181
+
182
+ export const getJsSlot = () => {
183
+ return {
184
+ type: 'JSSlot',
185
+ params: [],
186
+ value: [],
187
+ };
188
+ };
189
+
190
+ export const getFormContent = (target: any, mode: 'add' | 'edit' | 'view') => {
191
+ const fields = getVariable(target, 'currentFields');
192
+ let childrenSchemas = fields2ChildrenSchemas(fields, mode);
193
+ const titleMap = {
194
+ add: '表单(添加)',
195
+ edit: '编辑',
196
+ view: '详情',
197
+ };
198
+ const title = titleMap[mode];
199
+
200
+ if (['add', 'edit'].includes(mode)) {
201
+ childrenSchemas = childrenSchemas.concat(
202
+ createSubmitButton({
203
+ afterSubmitType: 'close',
204
+ })
205
+ );
206
+ }
207
+
208
+ // 过滤不需要继承的变量
209
+ const variables = omit(getAllVariables(target), [
210
+ 'currentValueVariables',
211
+ 'dataSourceVariables',
212
+ ]);
213
+
214
+ return {
215
+ type: 'JSSlot',
216
+ params: [],
217
+ value: [
218
+ {
219
+ componentName: 'DataSourceForm',
220
+ title,
221
+ props: {
222
+ _variables: variables,
223
+ dataSource: genDataSourceValueKey(target, 'currentDataSource'),
224
+ showTitle: false,
225
+ showDescription: false,
226
+ groupInfoPosition: 'top',
227
+ layout: 'vertical',
228
+ size: 'large',
229
+ mode,
230
+ currentValue:
231
+ mode !== 'add'
232
+ ? genDataSourceValueKey(target, 'currentRecord')
233
+ : undefined,
234
+ },
235
+ children: childrenSchemas,
236
+ },
237
+ ],
238
+ };
239
+ };
240
+
241
+ // 生成默认的operation和content
242
+ export const setDefaultOperationAndTitleButtons = (target: any) => {
243
+ const operation = {
244
+ show: true,
245
+ title: '操作',
246
+ align: 'center',
247
+ fixed: false,
248
+ type: 'link',
249
+ items: [
250
+ {
251
+ label: '查看',
252
+ openMode: 'drawer',
253
+ openContentSize: 'middle',
254
+ openTitle: '详情',
255
+ actionType: 'view',
256
+ key: 'view',
257
+ },
258
+ {
259
+ label: '编辑',
260
+ openMode: 'drawer',
261
+ openContentSize: 'middle',
262
+ openTitle: '编辑',
263
+ actionType: 'edit',
264
+ key: 'edit',
265
+ },
266
+ {
267
+ label: '删除',
268
+ actionType: 'delete',
269
+ },
270
+ ],
271
+ };
272
+
273
+ const titleButtons = {
274
+ show: true,
275
+ items: [
276
+ {
277
+ label: '添加',
278
+ openMode: 'drawer',
279
+ openContentSize: 'middle',
280
+ openTitle: '添加',
281
+ actionType: 'add',
282
+ key: 'add',
283
+ buttonProps: {
284
+ type: 'primary',
285
+ title: '添加',
286
+ },
287
+ },
288
+ ],
289
+ maxCount: 3,
290
+ };
291
+
292
+ target.getProps().setPropValue('titleButtons', titleButtons);
293
+ target.getProps().setPropValue('operation', operation);
294
+
295
+ const operationContent = {
296
+ view: getFormContent(target, 'view'),
297
+ edit: getFormContent(target, 'edit'),
298
+ add: getFormContent(target, 'add'),
299
+ };
300
+
301
+ target.getProps().setPropValue('operationContent', operationContent);
302
+ };
303
+
304
+ // 默认显示的filter组件
305
+ const defaultShowFilterComponent = [
306
+ 'Select',
307
+ 'DatePicker',
308
+ 'Checkbox',
309
+ 'Radio.Group',
310
+ 'Checkbox.Group',
311
+ ]
312
+
313
+ // 选择数据源后 生成默认的filter
314
+ export const setDefaultSearchFilter = (target: any, fields: any[]) => {
315
+ const filterFields = fields
316
+ .filter(
317
+ (field) => !systemFields.includes(field.name) && field.type !== 'json'
318
+ )
319
+ .map((field) => {
320
+ return {
321
+ name: field.name,
322
+ isCustom: false,
323
+ label: field.uiSchema.title,
324
+ value: field.name,
325
+ isHidden: defaultShowFilterComponent.includes(field.uiSchema['x-component']) ? false : true,
326
+ };
327
+ });
328
+
329
+ target.getProps().setPropValue('search', {
330
+ show: true,
331
+ placeholder: 'Search',
332
+ });
333
+
334
+ target.getProps().setPropValue('filter', {
335
+ show: true,
336
+ storageMode: 'localStorage',
337
+ mode: 'simple',
338
+ quickFilterMaxLength: 3,
339
+ items: filterFields,
340
+ });
341
+ };
342
+
343
+ const sortTypeMap: Record<string, string> = {
344
+ float: 'number',
345
+ bigInt: 'number',
346
+ };
347
+
348
+ // 生成默认的排序
349
+ export const setDefaultSort = (target: any, fields: any[]) => {
350
+ target.getProps().setPropValue('sort', {
351
+ show: true,
352
+ type: 'simple',
353
+ storageMode: 'localStorage',
354
+ list: fields
355
+ .filter(
356
+ (field) =>
357
+ !systemFields.includes(field.name) &&
358
+ ['string', 'number', 'date', 'bigInt', 'float'].includes(field.type)
359
+ )
360
+ .map((field) => ({
361
+ label: field.uiSchema.title,
362
+ type: sortTypeMap[field.type] || field.type,
363
+ name: field.name,
364
+ isHidden: false,
365
+ localFilter: false,
366
+ })),
367
+ });
368
+ };
369
+
370
+ // 根据当前fields格式化 filter筛选字段的select options
371
+ export const fields2TableFilterOptions = (
372
+ fields: any[],
373
+ useFields: string[]
374
+ ) => {
375
+ if (!fields || !fields.length) return [];
376
+
377
+ return fields
378
+ .filter((field) => !systemFields.includes(field.name))
379
+ .map((field) => ({
380
+ title: field.uiSchema.title,
381
+ value: field.name,
382
+ disabled: useFields.includes(field.name),
383
+ }));
384
+ };
385
+
386
+ export const filterTypes = [
387
+ {
388
+ label: '输入框',
389
+ value: 'Input',
390
+ },
391
+ {
392
+ label: '日期范围选择',
393
+ value: 'DateRangePicker',
394
+ },
395
+ {
396
+ label: '下拉选择',
397
+ value: 'Select',
398
+ },
399
+ ];
@@ -0,0 +1,54 @@
1
+
2
+ const DataSourceTypographyMeta = {
3
+ "componentName": "DataSourceTypography",
4
+ "title": "DataSourceTypography",
5
+ "docUrl": "",
6
+ "screenshot": "",
7
+ "devMode": "proCode",
8
+ "npm": {
9
+ "package": "@pisell/materials",
10
+ "version": "3.0.55",
11
+ "exportName": "DataSourceTypography",
12
+ "main": "src/index.tsx",
13
+ "destructuring": true,
14
+ "subName": ""
15
+ },
16
+ "configure": {
17
+ "props": [
18
+ {
19
+ "title": {
20
+ "label": {
21
+ "type": "i18n",
22
+ "en-US": "dataSourceKey",
23
+ "zh-CN": "dataSourceKey"
24
+ }
25
+ },
26
+ "name": "dataSourceKey",
27
+ "setter": {
28
+ "componentName": "StringSetter",
29
+ "isRequired": true,
30
+ "initialValue": ""
31
+ }
32
+ }
33
+ ],
34
+ "supports": {
35
+ "style": true
36
+ },
37
+ "component": {}
38
+ }
39
+ };
40
+ const snippets = [
41
+ {
42
+ "title": "DataSourceTypography",
43
+ "screenshot": "",
44
+ "schema": {
45
+ "componentName": "DataSourceTypography",
46
+ "props": {}
47
+ }
48
+ }
49
+ ];
50
+
51
+ export default {
52
+ ...DataSourceTypographyMeta,
53
+ snippets
54
+ };
@@ -0,0 +1,212 @@
1
+ import { MetaType } from '../_utils/type';
2
+ import {
3
+ genGeneralVariablesSetting,
4
+ } from '../_utils/defaultSchema';
5
+ import snippets from './snippets';
6
+
7
+ const DataSourceTypographyText: MetaType = {
8
+ snippets,
9
+ componentName: 'DataSourceTypography.Text',
10
+ title: '文本',
11
+ category: '数据展示',
12
+ group: '无代码组件',
13
+ docUrl: '',
14
+ screenshot: '',
15
+ devMode: 'proCode',
16
+ npm: {
17
+ package: '@pisell/materials',
18
+ version: '1.0.1',
19
+ exportName: 'DataSourceTypography',
20
+ main: 'src/index.tsx',
21
+ destructuring: true,
22
+ subName: 'Text',
23
+ },
24
+ generalProps: [
25
+ genGeneralVariablesSetting({
26
+ name: 'children',
27
+ title: { label: '内容', tip: '内容' },
28
+ }),
29
+ ],
30
+ configure: {
31
+ props: [
32
+ {
33
+ name: 'children',
34
+ title: { label: '内容', tip: '内容' },
35
+ setter: {
36
+ componentName: 'PisellI18nSetter',
37
+ },
38
+ defaultValue: '',
39
+ supportVariable: true,
40
+ },
41
+ {
42
+ name: 'code',
43
+ title: { label: '添加代码样式', tip: '添加代码样式' },
44
+ defaultValue: false,
45
+ },
46
+ {
47
+ name: 'delete',
48
+ title: { label: '添加删除线样式', tip: '添加删除线样式' },
49
+ defaultValue: false,
50
+ },
51
+ {
52
+ name: 'disabled',
53
+ title: { label: '是否禁用', tip: '是否为禁用状态' },
54
+ defaultValue: false,
55
+ },
56
+
57
+ {
58
+ name: 'mark',
59
+ title: { label: '添加标记样式', tip: '添加标记样式' },
60
+ defaultValue: false,
61
+ },
62
+ {
63
+ name: 'keyboard',
64
+ title: { label: '添加键盘样式', tip: '添加键盘样式' },
65
+ defaultValue: false,
66
+ },
67
+ {
68
+ name: 'underline',
69
+ title: { label: '添加下划线样式', tip: '添加下划线样式' },
70
+ defaultValue: false,
71
+ },
72
+ {
73
+ name: 'strong',
74
+ title: { label: '是否加粗', tip: '是否加粗' },
75
+ defaultValue: false,
76
+ },
77
+ {
78
+ name: 'type',
79
+ title: { label: '文本类型', tip: '文本类型' },
80
+ setter: {
81
+ componentName: 'SelectSetter',
82
+ props: {
83
+ options: [
84
+ {
85
+ title: '默认',
86
+ value: 'default',
87
+ },
88
+ {
89
+ title: '弱提示',
90
+ value: 'secondary',
91
+ },
92
+ {
93
+ title: '成功',
94
+ value: 'success',
95
+ },
96
+ {
97
+ title: '警告',
98
+ value: 'warning',
99
+ },
100
+ {
101
+ title: '错误',
102
+ value: 'danger',
103
+ },
104
+ ],
105
+ },
106
+ },
107
+ },
108
+ {
109
+ title: '高级',
110
+ type: 'group',
111
+ display: 'accordion',
112
+ items: [
113
+ {
114
+ name: 'copyable',
115
+ title: { label: '是否可拷贝', tip: '是否可拷贝' },
116
+ setter: [
117
+ {
118
+ componentName: 'BoolSetter',
119
+ isRequired: false,
120
+ initialValue: false,
121
+ },
122
+ {
123
+ componentName: 'JsonSetter',
124
+ isRequired: false,
125
+ },
126
+ ],
127
+ },
128
+ {
129
+ name: 'editable',
130
+ title: { label: '是否可编辑', tip: '是否可编辑' },
131
+ setter: [
132
+ {
133
+ componentName: 'BoolSetter',
134
+ isRequired: false,
135
+ initialValue: false,
136
+ },
137
+ {
138
+ componentName: 'JsonSetter',
139
+ isRequired: false,
140
+ },
141
+ ],
142
+ },
143
+ {
144
+ name: 'ellipsis',
145
+ title: {
146
+ label: '自动溢出省略',
147
+ tip: '设置自动溢出省略,需要设置元素宽度',
148
+ },
149
+ setter: [
150
+ {
151
+ componentName: 'BoolSetter',
152
+ isRequired: false,
153
+ initialValue: false,
154
+ },
155
+ {
156
+ componentName: 'JsonSetter',
157
+ isRequired: false,
158
+ },
159
+ ],
160
+ },
161
+ ],
162
+ },
163
+ ],
164
+ supports: {
165
+ style: true,
166
+ events: [
167
+ {
168
+ name: 'onClick',
169
+ template:
170
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
171
+ },
172
+ {
173
+ name: 'copyable.onCopy',
174
+ template:
175
+ "onCopy(${extParams}){\n// 拷贝成功的回调函数\nconsole.log('onCopy');}",
176
+ },
177
+ {
178
+ name: 'editable.onStart',
179
+ template:
180
+ "onStart(${extParams}){\n// 进入编辑中状态时触发\nconsole.log('onStart');}",
181
+ },
182
+ {
183
+ name: 'editable.onChange',
184
+ template:
185
+ "onChange(event,${extParams}){\n// 文本域编辑时触发\nconsole.log('onChange', event);}",
186
+ },
187
+ {
188
+ name: 'editable.onEnd',
189
+ template:
190
+ "onEnd(${extParams}){\n// 按 ENTER 结束编辑状态时触发\nconsole.log('onEnd');}",
191
+ },
192
+ {
193
+ name: 'editable.onCancel',
194
+ template:
195
+ "onCancel(${extParams}){\n// 按 ESC 退出编辑状态时触发\nconsole.log('onCancel');}",
196
+ },
197
+ {
198
+ name: 'ellipsis.onEllipsis',
199
+ template:
200
+ "onEllipsis(ellipsis,${extParams}){\n// 触发省略时的回调\nconsole.log('onEllipsis', ellipsis);}",
201
+ },
202
+ {
203
+ name: 'ellipsis.onExpand',
204
+ template:
205
+ "onExpand(event,${extParams}){\n// 点击展开时的回调\nconsole.log('onExpand', event);}",
206
+ },
207
+ ],
208
+ },
209
+ },
210
+ };
211
+
212
+ export default DataSourceTypographyText;
@@ -0,0 +1,12 @@
1
+ export default [
2
+ {
3
+ title: '文本',
4
+ screenshot: 'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/typography-text-1.png',
5
+ schema: {
6
+ componentName: 'DataSourceTypography.Text',
7
+ props: {
8
+ children: 'text',
9
+ },
10
+ },
11
+ },
12
+ ];