@pisell/materials 1.0.472 → 1.0.474

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 (291) 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 +7 -7
  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 +17 -17
  11. package/es/components/cardMetricItem/index.less +1 -0
  12. package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -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 +46 -5
  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/pisellAnchor/index.less +77 -77
  106. package/es/components/pisellStatisticList/index.less +1 -1
  107. package/es/components/pisellWalletPassCard/index.js +3 -1
  108. package/es/components/pisellWalletPassCard/index.less +23 -9
  109. package/es/components/table/Actions/index.js +16 -7
  110. package/es/components/table/Gallery/index.d.ts +3 -3
  111. package/es/components/table/Gallery/index.js +25 -7
  112. package/es/components/table/Gallery/index.less +1 -0
  113. package/es/components/table/Header/index.d.ts +10 -3
  114. package/es/components/table/Header/index.js +37 -11
  115. package/es/components/table/Header/index.less +10 -2
  116. package/es/components/table/Table/utils.js +4 -0
  117. package/es/components/table/Tabs/index.d.ts +14 -0
  118. package/es/components/table/Tabs/index.js +37 -0
  119. package/es/components/table/hooks/useTriggerValuesChange.js +3 -0
  120. package/es/components/table/index.js +16 -3
  121. package/es/components/table/types.d.ts +14 -2
  122. package/es/components/typography/index.d.ts +2 -2
  123. package/es/components/typography/index.js +4 -3
  124. package/es/components/walletCard/index.d.ts +6 -4
  125. package/es/components/walletCard/index.js +34 -15
  126. package/es/index.d.ts +4 -0
  127. package/es/index.js +5 -1
  128. package/es/locales/en-US.d.ts +7 -0
  129. package/es/locales/en-US.js +16 -1
  130. package/es/locales/zh-CN.d.ts +7 -0
  131. package/es/locales/zh-CN.js +16 -1
  132. package/es/locales/zh-TW.d.ts +7 -0
  133. package/es/locales/zh-TW.js +16 -1
  134. package/lib/components/cardMetricItem/index.less +1 -0
  135. package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -1
  136. package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
  137. package/lib/components/dataSourceComponents/dataSourceForm/serve.js +3 -2
  138. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
  139. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +58 -11
  140. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
  141. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +38 -0
  142. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
  143. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +38 -0
  144. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
  145. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +44 -0
  146. package/lib/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
  147. package/lib/components/dataSourceComponents/dataSourceShow/utils.js +95 -0
  148. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +29 -90
  149. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
  150. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +176 -0
  151. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
  152. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +176 -0
  153. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  154. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
  155. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +24 -37
  156. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
  157. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +53 -7
  158. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
  159. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +73 -3
  160. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
  161. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +236 -0
  162. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
  163. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +38 -11
  164. package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
  165. package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -0
  166. package/lib/components/dataSourceComponents/dataSourceTable/index.less +5 -0
  167. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
  168. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
  169. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +51 -0
  170. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
  171. package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +14 -2
  172. package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -1
  173. package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
  174. package/lib/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
  175. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
  176. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +41 -0
  177. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
  178. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +42 -0
  179. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
  180. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.js +39 -0
  181. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
  182. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
  183. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.js +17 -0
  184. package/lib/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
  185. package/lib/components/dataSourceComponents/fields/Input/index.js +4 -0
  186. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
  187. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +39 -0
  188. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
  189. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +57 -0
  190. package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
  191. package/lib/components/dataSourceComponents/fields/Input.Email/index.js +38 -0
  192. package/lib/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
  193. package/lib/components/dataSourceComponents/fields/Input.Email/type.js +17 -0
  194. package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
  195. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
  196. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +30 -2
  197. package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
  198. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
  199. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +39 -0
  200. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
  201. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +43 -0
  202. package/lib/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
  203. package/lib/components/dataSourceComponents/fields/Input.Phone/index.js +38 -0
  204. package/lib/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
  205. package/lib/components/dataSourceComponents/fields/Input.Phone/type.js +17 -0
  206. package/lib/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
  207. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  208. package/lib/components/dataSourceComponents/fields/index.d.ts +46 -5
  209. package/lib/components/dataSourceComponents/fields/index.js +6 -1
  210. package/lib/components/dataSourceComponents/fields/type.d.ts +18 -0
  211. package/lib/components/dataSourceComponents/fields/type.js +17 -0
  212. package/lib/components/dataSourceComponents/fields/utils.d.ts +3 -0
  213. package/lib/components/dataSourceComponents/fields/utils.js +134 -0
  214. package/lib/components/dataSourceComponents/hooks/useActions.js +14 -5
  215. package/lib/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
  216. package/lib/components/dataSourceComponents/hooks/useComponentId.js +32 -0
  217. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
  218. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
  219. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +29 -16
  220. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
  221. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +17 -8
  222. package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
  223. package/lib/components/dataSourceComponents/provider/variables/utils.js +15 -2
  224. package/lib/components/filter/components/Dropdown/index.d.ts +1 -0
  225. package/lib/components/filter/components/Dropdown/index.js +6 -2
  226. package/lib/components/filter/components/FilterButton/index.js +5 -3
  227. package/lib/components/filter/components/FilterButton/types.d.ts +2 -0
  228. package/lib/components/pisellAnchor/index.less +77 -77
  229. package/lib/components/pisellStatisticList/index.less +1 -1
  230. package/lib/components/pisellWalletPassCard/index.js +1 -1
  231. package/lib/components/pisellWalletPassCard/index.less +23 -9
  232. package/lib/components/table/Actions/index.js +18 -9
  233. package/lib/components/table/Gallery/index.d.ts +3 -3
  234. package/lib/components/table/Gallery/index.js +17 -0
  235. package/lib/components/table/Gallery/index.less +1 -0
  236. package/lib/components/table/Header/index.d.ts +10 -3
  237. package/lib/components/table/Header/index.js +29 -4
  238. package/lib/components/table/Header/index.less +10 -2
  239. package/lib/components/table/Table/utils.js +4 -0
  240. package/lib/components/table/Tabs/index.d.ts +14 -0
  241. package/lib/components/table/Tabs/index.js +70 -0
  242. package/lib/components/table/hooks/useTriggerValuesChange.js +3 -0
  243. package/lib/components/table/index.js +17 -2
  244. package/lib/components/table/types.d.ts +14 -2
  245. package/lib/components/typography/index.d.ts +2 -2
  246. package/lib/components/typography/index.js +4 -3
  247. package/lib/components/walletCard/index.d.ts +6 -4
  248. package/lib/components/walletCard/index.js +24 -13
  249. package/lib/index.d.ts +4 -0
  250. package/lib/index.js +12 -0
  251. package/lib/locales/en-US.d.ts +7 -0
  252. package/lib/locales/en-US.js +8 -1
  253. package/lib/locales/zh-CN.d.ts +7 -0
  254. package/lib/locales/zh-CN.js +8 -1
  255. package/lib/locales/zh-TW.d.ts +7 -0
  256. package/lib/locales/zh-TW.js +8 -1
  257. package/lowcode/_utils/defaultSchema.ts +452 -83
  258. package/lowcode/_utils/type.ts +5 -0
  259. package/lowcode/_utils/utils.ts +1 -0
  260. package/lowcode/button/meta.ts +1 -2
  261. package/lowcode/data-source-form/constants.ts +5 -0
  262. package/lowcode/data-source-form/meta.ts +259 -273
  263. package/lowcode/data-source-form/snippets.ts +9 -0
  264. package/lowcode/data-source-form/utils.ts +80 -15
  265. package/lowcode/data-source-image/meta.ts +74 -0
  266. package/lowcode/data-source-image/snippets.ts +14 -0
  267. package/lowcode/data-source-qrcode/meta.ts +158 -0
  268. package/lowcode/data-source-qrcode/snippets.ts +20 -0
  269. package/lowcode/data-source-table/meta.ts +4577 -2285
  270. package/lowcode/data-source-table/snippets.ts +10 -4
  271. package/lowcode/data-source-table/utils.tsx +254 -0
  272. package/lowcode/data-source-typography/meta.ts +54 -0
  273. package/lowcode/data-source-typography.text/meta.ts +212 -0
  274. package/lowcode/data-source-typography.text/snippets.ts +12 -0
  275. package/lowcode/data-source-wrapper/meta.ts +243 -0
  276. package/lowcode/data-source-wrapper/snippets.ts +11 -0
  277. package/lowcode/data-source-wrapper/utils.ts +45 -0
  278. package/lowcode/form-item-color-picker/snippets.ts +1 -0
  279. package/lowcode/form-item-input/meta.ts +2 -1
  280. package/lowcode/form-item-input/snippets.ts +2 -1
  281. package/lowcode/form-item-input.email/meta.ts +284 -0
  282. package/lowcode/form-item-input.email/snippets.ts +35 -0
  283. package/lowcode/form-item-input.phone/meta.ts +295 -0
  284. package/lowcode/form-item-input.phone/snippets.ts +16 -0
  285. package/lowcode/form-item-input.text-area/meta.ts +243 -32
  286. package/lowcode/form-item-input.text-area/snippets.ts +2 -1
  287. package/lowcode/form-item-input.url/meta.ts +44 -20
  288. package/lowcode/form-item-input.url/snippets.ts +5 -5
  289. package/lowcode/table/snippets.ts +6 -0
  290. package/lowcode/test/meta.ts +1 -2
  291. package/package.json +4 -4
@@ -7,6 +7,9 @@ export default [
7
7
  title: '表单(添加)',
8
8
  componentName: 'DataSourceForm',
9
9
  props: {
10
+ style: {
11
+ padding: '24px',
12
+ },
10
13
  mode: 'add',
11
14
  groupInfoPosition: 'top',
12
15
  labelWrap: true,
@@ -49,6 +52,9 @@ export default [
49
52
  title: '表单(编辑)',
50
53
  componentName: 'DataSourceForm',
51
54
  props: {
55
+ style: {
56
+ padding: '24px',
57
+ },
52
58
  mode: 'edit',
53
59
  groupInfoPosition: 'top',
54
60
  labelWrap: true,
@@ -92,6 +98,9 @@ export default [
92
98
  title: '详情',
93
99
  componentName: 'DataSourceForm',
94
100
  props: {
101
+ style: {
102
+ padding: '24px',
103
+ },
95
104
  mode: 'view',
96
105
  groupInfoPosition: 'top',
97
106
  labelWrap: true,
@@ -35,6 +35,7 @@ export const createFormGroup = (children: any[]) => {
35
35
  export const createSubmitButton = (props: any = {}) => {
36
36
  return {
37
37
  componentName: 'SubmitButton',
38
+ title: '提交',
38
39
  props: {
39
40
  type: 'primary',
40
41
  size: 'large',
@@ -97,6 +98,7 @@ export const createFormItemSchema = (
97
98
  uiSchema: UiSchema;
98
99
  children?: any[];
99
100
  _children?: any[];
101
+ interface?: string;
100
102
  },
101
103
  mode: string
102
104
  ) => {
@@ -109,6 +111,8 @@ export const createFormItemSchema = (
109
111
  default: defaultValue,
110
112
  } = uiSchema;
111
113
 
114
+ let cptTitle = undefined;
115
+
112
116
  let props: Record<string, any> = {
113
117
  label: title,
114
118
  name,
@@ -119,6 +123,15 @@ export const createFormItemSchema = (
119
123
  let childrenSchema: any[] = [];
120
124
 
121
125
  if (validator && validator !== 'integer') {
126
+ console.log('validator', validator);
127
+ if (item?.interface === 'phone') {
128
+ cptTitle = '手机号码输入';
129
+ componentName = 'Input.Phone';
130
+ }
131
+ if (validator === 'email') {
132
+ cptTitle = '电子邮箱输入';
133
+ componentName = 'Input.Email';
134
+ }
122
135
  props.typeobj = {
123
136
  type: validator,
124
137
  enabled: true,
@@ -126,15 +139,35 @@ export const createFormItemSchema = (
126
139
  }
127
140
 
128
141
  if (xComponent === 'Input.JSON') {
129
- props.prefix = name;
130
-
131
142
  const jsonChildren = item._children || item.children || [];
132
143
 
133
144
  // 如果有children属性,递归创建子表单项
134
145
  if (jsonChildren && jsonChildren.length > 0) {
146
+ props.prefix = name;
135
147
  childrenSchema = jsonChildren.map((child: any) =>
136
148
  createFormItemSchema(child, mode)
137
149
  );
150
+ } else {
151
+ componentName = 'Input.InputJSON';
152
+ props.autoSize = {
153
+ minRows: 4,
154
+ };
155
+ // props.validateTrigger = "onBlur";
156
+ props.normalize = {
157
+ type: 'JSExpression',
158
+ value:
159
+ '(value) => {\n try {\n return JSON.parse(value);\n } catch(error) {\n console.log(error)\n }\n return value\n}',
160
+ };
161
+ props.getValueProps = {
162
+ type: 'JSExpression',
163
+ value:
164
+ '(value) => {\n try {\n return { value: value != "" && typeof value === \'object\' ? JSON.stringify(value, null, 2) : value};\n } catch(error) {\n console.log(error)\n }\n return {value: value}\n}',
165
+ };
166
+ props.validator = {
167
+ type: 'JSExpression',
168
+ value:
169
+ "async (value) => {\n try {\n if (typeof value === 'string' && value.trim() !== '') {\n JSON.parse(value);\n }\n } catch (err) {\n return Promise.reject(new Error(err.message));\n }\n}",
170
+ };
138
171
  }
139
172
  }
140
173
 
@@ -159,6 +192,7 @@ export const createFormItemSchema = (
159
192
  }
160
193
 
161
194
  return {
195
+ title: cptTitle,
162
196
  componentName: nocobaseCpt2PisellCptMap[componentName],
163
197
  props,
164
198
  children: childrenSchema,
@@ -178,7 +212,11 @@ export const formSchema2PisellFieldsOptions = (
178
212
  formSchema: any,
179
213
  allFields: any[]
180
214
  ) => {
181
- if (!['DataSourceForm', 'FormGroup'].includes(formSchema.componentName)) {
215
+ if (
216
+ !['DataSourceForm', 'FormGroup', 'DataSourceWrapper'].includes(
217
+ formSchema.componentName
218
+ )
219
+ ) {
182
220
  return [];
183
221
  }
184
222
 
@@ -295,7 +333,19 @@ export const setVariables = (
295
333
  export const setBatchVariables = (
296
334
  target: any,
297
335
  variables: Array<{
298
- label: string;
336
+ /**
337
+ * currentFields 当前表单字段列表
338
+ * dataSourceTitle 数据源标题
339
+ * dataSourceValue 数据源值
340
+ * cptValuesVariables 组件值变量
341
+ */
342
+ label:
343
+ | 'currentFields'
344
+ | 'dataSourceTitle'
345
+ | 'dataSourceValue'
346
+ | 'cptValuesVariables'
347
+ | 'currentValueVariables'
348
+ | 'dataSourceVariables';
299
349
  value: any;
300
350
  }>
301
351
  ) => {
@@ -364,14 +414,16 @@ const getParentVariables = (target: any) => {
364
414
  export const getDataSourceVariables = (target: any) => {
365
415
  const variables = getParentVariables(target);
366
416
 
367
- return variables?.map((item: VariablesItemType) => {
368
- return {
369
- label: item.title,
370
- value: item.id,
371
- children: item.variables.dataSourceVariables,
372
- isVariable: true,
373
- };
374
- }).filter(item => item?.children?.length);
417
+ return variables
418
+ ?.map((item: VariablesItemType) => {
419
+ return {
420
+ label: item.title,
421
+ value: item.id,
422
+ children: item.variables.dataSourceVariables,
423
+ isVariable: true,
424
+ };
425
+ })
426
+ .filter((item) => item?.children?.length);
375
427
  };
376
428
 
377
429
  export const getCurrentValueVariables = (target: any) => {
@@ -399,9 +451,22 @@ export const getCurrentValueVariables = (target: any) => {
399
451
  return currentValueVariables;
400
452
  };
401
453
 
402
- export const getDataSourceValue = (target: any) => {
454
+ export const getCptValuesVariables = (target: any) => {
403
455
  const variables = getParentVariables(target);
404
- return variables?.find(item => item.variables.dataSourceValue)?.variables.dataSourceValue;
456
+ return variables
457
+ ?.map((item: VariablesItemType) => {
458
+ return {
459
+ label: `${item.title}-${item?.variables?.dataSourceTitle || ''}`,
460
+ value: item.id,
461
+ children: item.variables.cptValuesVariables,
462
+ isVariable: true,
463
+ };
464
+ })
465
+ .filter((item) => item?.children?.length);
405
466
  };
406
467
 
407
-
468
+ export const getDataSourceValue = (target: any) => {
469
+ const variables = getParentVariables(target);
470
+ return variables?.find((item) => item.variables.dataSourceValue)?.variables
471
+ .dataSourceValue;
472
+ };
@@ -0,0 +1,74 @@
1
+ import snippets from './snippets';
2
+ import { genGeneralVariablesSetting } from '../_utils/defaultSchema';
3
+
4
+ export default {
5
+ snippets,
6
+ componentName: 'DataSourceImage',
7
+ title: '图片',
8
+ category: '数据展示',
9
+ group: '无代码组件',
10
+ docUrl: '',
11
+ screenshot: '',
12
+ devMode: 'proCode',
13
+ npm: {
14
+ package: '@pisell/materials',
15
+ version: '1.0.1',
16
+ exportName: 'DataSourceImage',
17
+ main: 'src/index.tsx',
18
+ destructuring: true,
19
+ subName: '',
20
+ },
21
+
22
+ generalProps: [
23
+ genGeneralVariablesSetting({
24
+ name: 'src',
25
+ title: { label: '图片地址', tip: '图片地址' },
26
+ }),
27
+ ],
28
+ props: [
29
+ {
30
+ name: 'src',
31
+ title: { label: '图片地址', tip: '图片地址' },
32
+ propType: { type: 'string', isRequired: true },
33
+ },
34
+ {
35
+ name: 'alt',
36
+ title: { label: '替换文本', tip: '替换文本' },
37
+ propType: 'string',
38
+ setter: 'PisellI18nSetter',
39
+ },
40
+ {
41
+ name: 'preview',
42
+ title: { label: '支持预览', tip: '支持预览' },
43
+ defaultValue: true,
44
+ propType: 'bool',
45
+ },
46
+ {
47
+ name: 'fallback',
48
+ title: { label: '失败地址', tip: '加载失败容错地址' },
49
+ propType: 'string',
50
+ },
51
+ {
52
+ name: 'width',
53
+ title: { label: '宽度', tip: '宽度' },
54
+ propType: 'number',
55
+ },
56
+ {
57
+ name: 'height',
58
+ title: { label: '高度', tip: '高度' },
59
+ propType: 'number',
60
+ },
61
+ ],
62
+ configure: {
63
+ supports: {
64
+ style: true,
65
+ events: [
66
+ {
67
+ name: 'onClick',
68
+ template:
69
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
70
+ },
71
+ ],
72
+ },
73
+ },
74
+ };
@@ -0,0 +1,14 @@
1
+ export default [
2
+ {
3
+ title: '图片',
4
+ screenshot: 'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/image-1.png',
5
+ schema: {
6
+ componentName: 'DataSourceImage',
7
+ props: {
8
+ src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
9
+ height: 120,
10
+ width: 120,
11
+ },
12
+ },
13
+ },
14
+ ];
@@ -0,0 +1,158 @@
1
+ import snippets from './snippets';
2
+ import { genGeneralVariablesSetting } from '../_utils/defaultSchema';
3
+
4
+ export default {
5
+ snippets,
6
+ componentName: 'DataSourceQRCode',
7
+ title: '二维码',
8
+ category: '数据展示',
9
+ group: '无代码组件',
10
+ docUrl: "",
11
+ screenshot: "",
12
+ devMode: "proCode",
13
+ npm: {
14
+ package: "@pisell/materials",
15
+ version: "1.0.1",
16
+ exportName: "DataSourceQRCode",
17
+ main: "src/index.tsx",
18
+ destructuring: true,
19
+ subName: "",
20
+ },
21
+ generalProps: [
22
+ genGeneralVariablesSetting({
23
+ name: 'value',
24
+ title: { label: '内容', tip: '内容' },
25
+ }),
26
+ ],
27
+ props: [
28
+ {
29
+ name: 'value',
30
+ title: { label: '内容', tip: '内容' },
31
+ propType: 'string',
32
+ },
33
+ {
34
+ name: 'type',
35
+ title: { label: '渲染类型', tip: '渲染类型' },
36
+ setter: {
37
+ componentName: 'RadioGroupSetter',
38
+ props: {
39
+ options: [
40
+ {
41
+ title: 'Canvas',
42
+ value: 'canvas',
43
+ },
44
+ {
45
+ title: 'Svg',
46
+ value: 'svg',
47
+ },
48
+ ],
49
+ },
50
+ },
51
+ },
52
+ {
53
+ name: 'icon',
54
+ title: { label: '二维码中图片的地址', tip: '二维码中图片的地址(目前只支持图片地址)' },
55
+ propType: 'string',
56
+ },
57
+ {
58
+ name: 'size',
59
+ title: { label: '二维码大小', tip: '二维码大小' },
60
+ propType: 'number',
61
+ },
62
+ {
63
+ name: 'iconSize',
64
+ title: { label: '二维码中图片的大小', tip: '二维码中图片的大小' },
65
+ propType: 'number',
66
+ },
67
+ {
68
+ name: 'color',
69
+ description: '二维码颜色',
70
+ propType: 'string',
71
+ setter: 'ColorSetter',
72
+ },
73
+ {
74
+ name: 'bgColor',
75
+ description: '二维码背景颜色',
76
+ propType: 'string',
77
+ setter: 'ColorSetter',
78
+ },
79
+ {
80
+ name: 'bordered',
81
+ title: { label: '是否有边框', tip: '是否有边框' },
82
+ propType: 'bool',
83
+ setter: 'BoolSetter'
84
+ },
85
+ {
86
+ name: 'errorLevel',
87
+ title: { label: '二维码纠错等级', tip: '通常情况下二维码分为 4 个纠错级别:L级 可纠正约 7% 错误、M级 可纠正约 15% 错误、Q级 可纠正约 25% 错误、H级 可纠正约30% 错误。并不是所有位置都可以缺损,像最明显的三个角上的方框,直接影响初始定位。中间零散的部分是内容编码,可以容忍缺损。当二维码的内容编码携带信息比较少的时候,也就是链接比较短的时候,设置不同的纠错等级,生成的图片不会发生变化。' },
88
+ setter: {
89
+ componentName: 'RadioGroupSetter',
90
+ props: {
91
+ options: [
92
+ {
93
+ title: 'L',
94
+ value: 'L',
95
+ },
96
+ {
97
+ title: 'M',
98
+ value: 'M',
99
+ },
100
+ {
101
+ title: 'Q',
102
+ value: 'Q',
103
+ },
104
+ {
105
+ title: 'H',
106
+ value: 'H',
107
+ },
108
+ ],
109
+ },
110
+ },
111
+ },
112
+ {
113
+ name: 'preview',
114
+ title: { label: '预览功能', tip: '是否开启预览功能,点击放大展示' },
115
+ propType: 'bool',
116
+ setter: 'BoolSetter'
117
+ },
118
+ {
119
+ name: 'status',
120
+ title: { label: '二维码状态', tip: '二维码状态' },
121
+ setter: {
122
+ componentName: 'RadioGroupSetter',
123
+ props: {
124
+ options: [
125
+ {
126
+ title: 'active',
127
+ value: 'active',
128
+ },
129
+ {
130
+ title: 'expired',
131
+ value: 'expired',
132
+ },
133
+ {
134
+ title: 'loading',
135
+ value: 'loading',
136
+ },
137
+ ],
138
+ },
139
+ },
140
+ },
141
+ ],
142
+ configure: {
143
+ supports: {
144
+ style: true,
145
+ events: [
146
+ {
147
+ name: 'onRefresh',
148
+ template: "onRefresh(event,${extParams}){\n// 刷新\nconsole.log('onClose',event);}",
149
+ },
150
+ {
151
+ name: "onClick",
152
+ template:
153
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
154
+ },
155
+ ],
156
+ },
157
+ },
158
+ };
@@ -0,0 +1,20 @@
1
+ export default [
2
+ {
3
+ title: '二维码',
4
+ screenshot: 'https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*cJopQrf0ncwAAAAAAAAAAAAADrJ8AQ/original',
5
+ schema: {
6
+ componentName: 'DataSourceQRCode',
7
+ props: {
8
+ value: "pisell2",
9
+ size: 160,
10
+ iconSize: 40,
11
+ status: "active",
12
+ errorLevel: "L",
13
+ type: "canvas",
14
+ color: "#000",
15
+ bgColor: "transparent",
16
+ bordered: true,
17
+ },
18
+ },
19
+ },
20
+ ];