@cozeloop/components 0.0.3 → 0.0.4-beta-1770694681364

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 (451) hide show
  1. package/dist/es/index.css +13 -29
  2. package/dist/es/{index.js → index.mjs} +562 -518
  3. package/dist/es/loopIcons.mjs +3 -0
  4. package/dist/es/rslib-runtime.mjs +40 -0
  5. package/dist/lib/base-search-select/base-search-select.d.ts +4 -1
  6. package/dist/lib/base-search-select/index.d.ts +1 -1
  7. package/dist/lib/base-search-select/types.d.ts +1 -1
  8. package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
  9. package/dist/lib/codemirror-editor/code-editor.d.ts +23 -2
  10. package/dist/lib/codemirror-editor/index.d.ts +2 -0
  11. package/dist/lib/codemirror-editor/json-editor.d.ts +1 -1
  12. package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
  13. package/dist/lib/codemirror-editor/text-editor.d.ts +23 -2
  14. package/dist/lib/collapse-card/index.d.ts +2 -1
  15. package/dist/lib/collapse-item/index.d.ts +7 -0
  16. package/dist/lib/copyable/index.d.ts +5 -0
  17. package/dist/lib/hooks/use-unsave-leave-warning.d.ts +4 -1
  18. package/dist/lib/index.d.ts +7 -6
  19. package/dist/lib/large-txt-render/index.d.ts +1 -0
  20. package/dist/lib/logic-editor/logic-editor.d.ts +2 -4
  21. package/dist/lib/logic-editor/logic-types.d.ts +6 -2
  22. package/dist/lib/loop-icons/index.d.ts +1 -0
  23. package/dist/lib/multi-part-editor/type.d.ts +1 -1
  24. package/dist/lib/primary-page/primary-header.d.ts +2 -1
  25. package/dist/lib/table/sort-icon.d.ts +3 -3
  26. package/dist/lib/table-col-actions/index.d.ts +2 -0
  27. package/package.json +36 -28
  28. package/.eslintcache +0 -1
  29. package/.rush/temp/shrinkwrap-deps.json +0 -770
  30. package/OWNERS +0 -5
  31. package/config/rush-project.json +0 -8
  32. package/dist/lib/base-search-select/base-search-form-select.js +0 -6
  33. package/dist/lib/base-search-select/base-search-form-select.js.map +0 -1
  34. package/dist/lib/base-search-select/base-search-select.js +0 -127
  35. package/dist/lib/base-search-select/base-search-select.js.map +0 -1
  36. package/dist/lib/base-search-select/index.js +0 -3
  37. package/dist/lib/base-search-select/index.js.map +0 -1
  38. package/dist/lib/base-search-select/types.js +0 -2
  39. package/dist/lib/base-search-select/types.js.map +0 -1
  40. package/dist/lib/base-search-select/utils.js +0 -48
  41. package/dist/lib/base-search-select/utils.js.map +0 -1
  42. package/dist/lib/basic-card/index.js +0 -4
  43. package/dist/lib/basic-card/index.js.map +0 -1
  44. package/dist/lib/card-pane/index.js +0 -9
  45. package/dist/lib/card-pane/index.js.map +0 -1
  46. package/dist/lib/chip-select/index.js +0 -6
  47. package/dist/lib/chip-select/index.js.map +0 -1
  48. package/dist/lib/code-editor/index.js +0 -7
  49. package/dist/lib/code-editor/index.js.map +0 -1
  50. package/dist/lib/code-usage/index.d.ts +0 -14
  51. package/dist/lib/code-usage/index.js +0 -31
  52. package/dist/lib/code-usage/index.js.map +0 -1
  53. package/dist/lib/codemirror-editor/code-editor.js +0 -108
  54. package/dist/lib/codemirror-editor/code-editor.js.map +0 -1
  55. package/dist/lib/codemirror-editor/index.js +0 -5
  56. package/dist/lib/codemirror-editor/index.js.map +0 -1
  57. package/dist/lib/codemirror-editor/json-editor.js +0 -97
  58. package/dist/lib/codemirror-editor/json-editor.js.map +0 -1
  59. package/dist/lib/codemirror-editor/raw-text-editor.js +0 -32
  60. package/dist/lib/codemirror-editor/raw-text-editor.js.map +0 -1
  61. package/dist/lib/codemirror-editor/text-editor.js +0 -44
  62. package/dist/lib/codemirror-editor/text-editor.js.map +0 -1
  63. package/dist/lib/codemirror-editor/themes/coze-dark.js +0 -113
  64. package/dist/lib/codemirror-editor/themes/coze-dark.js.map +0 -1
  65. package/dist/lib/codemirror-editor/themes/coze-light.js +0 -119
  66. package/dist/lib/codemirror-editor/themes/coze-light.js.map +0 -1
  67. package/dist/lib/collapse-card/index.js +0 -31
  68. package/dist/lib/collapse-card/index.js.map +0 -1
  69. package/dist/lib/collapsible-card/index.js +0 -13
  70. package/dist/lib/collapsible-card/index.js.map +0 -1
  71. package/dist/lib/column-manage-storage/index.js +0 -48
  72. package/dist/lib/column-manage-storage/index.js.map +0 -1
  73. package/dist/lib/columns-select/index.js +0 -77
  74. package/dist/lib/columns-select/index.js.map +0 -1
  75. package/dist/lib/edit-icon-button/index.js +0 -13
  76. package/dist/lib/edit-icon-button/index.js.map +0 -1
  77. package/dist/lib/footer-actions/index.js +0 -9
  78. package/dist/lib/footer-actions/index.js.map +0 -1
  79. package/dist/lib/hooks/use-infinite-scroll.js +0 -133
  80. package/dist/lib/hooks/use-infinite-scroll.js.map +0 -1
  81. package/dist/lib/hooks/use-mouse-down-offset.js +0 -39
  82. package/dist/lib/hooks/use-mouse-down-offset.js.map +0 -1
  83. package/dist/lib/hooks/use-unsave-leave-warning.js +0 -33
  84. package/dist/lib/hooks/use-unsave-leave-warning.js.map +0 -1
  85. package/dist/lib/id-render/icon-button-container.js +0 -8
  86. package/dist/lib/id-render/icon-button-container.js.map +0 -1
  87. package/dist/lib/id-render/index.js +0 -21
  88. package/dist/lib/id-render/index.js.map +0 -1
  89. package/dist/lib/index-controller/record-navigation.js +0 -9
  90. package/dist/lib/index-controller/record-navigation.js.map +0 -1
  91. package/dist/lib/index-controller/use-item-index-controller.js +0 -123
  92. package/dist/lib/index-controller/use-item-index-controller.js.map +0 -1
  93. package/dist/lib/index.js +0 -76
  94. package/dist/lib/index.js.map +0 -1
  95. package/dist/lib/infinite-scroll-table/index.js +0 -34
  96. package/dist/lib/infinite-scroll-table/index.js.map +0 -1
  97. package/dist/lib/info-tooltip/index.js +0 -9
  98. package/dist/lib/info-tooltip/index.js.map +0 -1
  99. package/dist/lib/input-components/radio-button.js +0 -21
  100. package/dist/lib/input-components/radio-button.js.map +0 -1
  101. package/dist/lib/input-slider/index.js +0 -81
  102. package/dist/lib/input-slider/index.js.map +0 -1
  103. package/dist/lib/input-with-count/index.js +0 -7
  104. package/dist/lib/input-with-count/index.js.map +0 -1
  105. package/dist/lib/jump-button/jump-icon-button.js +0 -7
  106. package/dist/lib/jump-button/jump-icon-button.js.map +0 -1
  107. package/dist/lib/large-txt-render/index.js +0 -26
  108. package/dist/lib/large-txt-render/index.js.map +0 -1
  109. package/dist/lib/layout/content.js +0 -5
  110. package/dist/lib/layout/content.js.map +0 -1
  111. package/dist/lib/layout/header.js +0 -6
  112. package/dist/lib/layout/header.js.map +0 -1
  113. package/dist/lib/layout/index.js +0 -9
  114. package/dist/lib/layout/index.js.map +0 -1
  115. package/dist/lib/layout/tabs.js +0 -10
  116. package/dist/lib/layout/tabs.js.map +0 -1
  117. package/dist/lib/lazy-load-component/index.js +0 -42
  118. package/dist/lib/lazy-load-component/index.js.map +0 -1
  119. package/dist/lib/logic-editor/index.js +0 -3
  120. package/dist/lib/logic-editor/index.js.map +0 -1
  121. package/dist/lib/logic-editor/logic-editor.js +0 -69
  122. package/dist/lib/logic-editor/logic-editor.js.map +0 -1
  123. package/dist/lib/logic-editor/logic-left-render.js +0 -60
  124. package/dist/lib/logic-editor/logic-left-render.js.map +0 -1
  125. package/dist/lib/logic-editor/logic-operator-render.js +0 -29
  126. package/dist/lib/logic-editor/logic-operator-render.js.map +0 -1
  127. package/dist/lib/logic-editor/logic-right-render.js +0 -25
  128. package/dist/lib/logic-editor/logic-right-render.js.map +0 -1
  129. package/dist/lib/logic-editor/logic-types.js +0 -136
  130. package/dist/lib/logic-editor/logic-types.js.map +0 -1
  131. package/dist/lib/logic-editor/utils.js +0 -18
  132. package/dist/lib/logic-editor/utils.js.map +0 -1
  133. package/dist/lib/logic-expr/consts.js +0 -5
  134. package/dist/lib/logic-expr/consts.js.map +0 -1
  135. package/dist/lib/logic-expr/expr-group-render.js +0 -61
  136. package/dist/lib/logic-expr/expr-group-render.js.map +0 -1
  137. package/dist/lib/logic-expr/expr-render.js +0 -85
  138. package/dist/lib/logic-expr/expr-render.js.map +0 -1
  139. package/dist/lib/logic-expr/index.js +0 -2
  140. package/dist/lib/logic-expr/index.js.map +0 -1
  141. package/dist/lib/logic-expr/logic-expr.js +0 -187
  142. package/dist/lib/logic-expr/logic-expr.js.map +0 -1
  143. package/dist/lib/logic-expr/logic-not.js +0 -21
  144. package/dist/lib/logic-expr/logic-not.js.map +0 -1
  145. package/dist/lib/logic-expr/logic-toggle.js +0 -33
  146. package/dist/lib/logic-expr/logic-toggle.js.map +0 -1
  147. package/dist/lib/logic-expr/types.js +0 -2
  148. package/dist/lib/logic-expr/types.js.map +0 -1
  149. package/dist/lib/loop-radio-group/index.js +0 -7
  150. package/dist/lib/loop-radio-group/index.js.map +0 -1
  151. package/dist/lib/multi-part-editor/components/image-item-renderer.js +0 -57
  152. package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +0 -1
  153. package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +0 -25
  154. package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +0 -1
  155. package/dist/lib/multi-part-editor/components/url-input-modal.js +0 -150
  156. package/dist/lib/multi-part-editor/components/url-input-modal.js.map +0 -1
  157. package/dist/lib/multi-part-editor/components/video-item-renderer.js +0 -57
  158. package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +0 -1
  159. package/dist/lib/multi-part-editor/index.js +0 -300
  160. package/dist/lib/multi-part-editor/index.js.map +0 -1
  161. package/dist/lib/multi-part-editor/multi-part-render.js +0 -40
  162. package/dist/lib/multi-part-editor/multi-part-render.js.map +0 -1
  163. package/dist/lib/multi-part-editor/type.js +0 -25
  164. package/dist/lib/multi-part-editor/type.js.map +0 -1
  165. package/dist/lib/multi-part-editor/upload-button.js +0 -103
  166. package/dist/lib/multi-part-editor/upload-button.js.map +0 -1
  167. package/dist/lib/multi-part-editor/utils.js +0 -43
  168. package/dist/lib/multi-part-editor/utils.js.map +0 -1
  169. package/dist/lib/open-detail-button/index.js +0 -11
  170. package/dist/lib/open-detail-button/index.js.map +0 -1
  171. package/dist/lib/page-content/index.js +0 -23
  172. package/dist/lib/page-content/index.js.map +0 -1
  173. package/dist/lib/primary-page/index.js +0 -2
  174. package/dist/lib/primary-page/index.js.map +0 -1
  175. package/dist/lib/primary-page/primary-header.js +0 -4
  176. package/dist/lib/primary-page/primary-header.js.map +0 -1
  177. package/dist/lib/primary-title/index.js +0 -8
  178. package/dist/lib/primary-title/index.js.map +0 -1
  179. package/dist/lib/provider/index.d.ts +0 -18
  180. package/dist/lib/provider/index.js +0 -43
  181. package/dist/lib/provider/index.js.map +0 -1
  182. package/dist/lib/resizable-side-sheet/index.js +0 -32
  183. package/dist/lib/resizable-side-sheet/index.js.map +0 -1
  184. package/dist/lib/resize-sidesheet/index.js +0 -15
  185. package/dist/lib/resize-sidesheet/index.js.map +0 -1
  186. package/dist/lib/resize-sidesheet/use-drag.js +0 -30
  187. package/dist/lib/resize-sidesheet/use-drag.js.map +0 -1
  188. package/dist/lib/schema-editor/index.js +0 -5
  189. package/dist/lib/schema-editor/index.js.map +0 -1
  190. package/dist/lib/search-form/index.d.ts +0 -15
  191. package/dist/lib/search-form/index.js +0 -77
  192. package/dist/lib/search-form/index.js.map +0 -1
  193. package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +0 -19
  194. package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +0 -1
  195. package/dist/lib/semi-schema-form/components/tmpls/array-field.js +0 -39
  196. package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +0 -1
  197. package/dist/lib/semi-schema-form/components/tmpls/base-input.js +0 -32
  198. package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +0 -1
  199. package/dist/lib/semi-schema-form/components/tmpls/description-field.js +0 -13
  200. package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +0 -1
  201. package/dist/lib/semi-schema-form/components/tmpls/error-list.js +0 -14
  202. package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +0 -1
  203. package/dist/lib/semi-schema-form/components/tmpls/field-error.js +0 -16
  204. package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +0 -1
  205. package/dist/lib/semi-schema-form/components/tmpls/field.js +0 -21
  206. package/dist/lib/semi-schema-form/components/tmpls/field.js.map +0 -1
  207. package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +0 -29
  208. package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +0 -1
  209. package/dist/lib/semi-schema-form/components/tmpls/index.js +0 -31
  210. package/dist/lib/semi-schema-form/components/tmpls/index.js.map +0 -1
  211. package/dist/lib/semi-schema-form/components/tmpls/object-field.js +0 -81
  212. package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +0 -1
  213. package/dist/lib/semi-schema-form/components/tmpls/submit.js +0 -13
  214. package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +0 -1
  215. package/dist/lib/semi-schema-form/components/tmpls/title-field.js +0 -12
  216. package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +0 -1
  217. package/dist/lib/semi-schema-form/components/widgets/checkbox.js +0 -26
  218. package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +0 -1
  219. package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +0 -27
  220. package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +0 -1
  221. package/dist/lib/semi-schema-form/components/widgets/index.js +0 -15
  222. package/dist/lib/semi-schema-form/components/widgets/index.js.map +0 -1
  223. package/dist/lib/semi-schema-form/components/widgets/radio.js +0 -27
  224. package/dist/lib/semi-schema-form/components/widgets/radio.js.map +0 -1
  225. package/dist/lib/semi-schema-form/components/widgets/range.js +0 -26
  226. package/dist/lib/semi-schema-form/components/widgets/range.js.map +0 -1
  227. package/dist/lib/semi-schema-form/components/widgets/select.js +0 -44
  228. package/dist/lib/semi-schema-form/components/widgets/select.js.map +0 -1
  229. package/dist/lib/semi-schema-form/components/widgets/textarea.js +0 -18
  230. package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +0 -1
  231. package/dist/lib/semi-schema-form/index.js +0 -9
  232. package/dist/lib/semi-schema-form/index.js.map +0 -1
  233. package/dist/lib/sentinel-form/enum.js +0 -15
  234. package/dist/lib/sentinel-form/enum.js.map +0 -1
  235. package/dist/lib/sentinel-form/index.js +0 -289
  236. package/dist/lib/sentinel-form/index.js.map +0 -1
  237. package/dist/lib/step-nav/index.js +0 -13
  238. package/dist/lib/step-nav/index.js.map +0 -1
  239. package/dist/lib/table/index.js +0 -6
  240. package/dist/lib/table/index.js.map +0 -1
  241. package/dist/lib/table/sort-icon.js +0 -30
  242. package/dist/lib/table/sort-icon.js.map +0 -1
  243. package/dist/lib/table/table-with-pagination.js +0 -74
  244. package/dist/lib/table/table-with-pagination.js.map +0 -1
  245. package/dist/lib/table/table-without-pagniation.js +0 -37
  246. package/dist/lib/table/table-without-pagniation.js.map +0 -1
  247. package/dist/lib/table-batch-operate/table-batch-operation.js +0 -14
  248. package/dist/lib/table-batch-operate/table-batch-operation.js.map +0 -1
  249. package/dist/lib/table-batch-operate/use-batch-operate.js +0 -71
  250. package/dist/lib/table-batch-operate/use-batch-operate.js.map +0 -1
  251. package/dist/lib/table-col-actions/index.js +0 -35
  252. package/dist/lib/table-col-actions/index.js.map +0 -1
  253. package/dist/lib/table-cols-config/index.js +0 -57
  254. package/dist/lib/table-cols-config/index.js.map +0 -1
  255. package/dist/lib/table-cols-config/type.js +0 -2
  256. package/dist/lib/table-cols-config/type.js.map +0 -1
  257. package/dist/lib/table-cols-config/use-hidden-col-keys.js +0 -32
  258. package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +0 -1
  259. package/dist/lib/table-cols-config/util.js +0 -39
  260. package/dist/lib/table-cols-config/util.js.map +0 -1
  261. package/dist/lib/table-empty/index.js +0 -10
  262. package/dist/lib/table-empty/index.js.map +0 -1
  263. package/dist/lib/table-header/index.js +0 -11
  264. package/dist/lib/table-header/index.js.map +0 -1
  265. package/dist/lib/tabs/index.js +0 -9
  266. package/dist/lib/tabs/index.js.map +0 -1
  267. package/dist/lib/text-area-pro/index.js +0 -10
  268. package/dist/lib/text-area-pro/index.js.map +0 -1
  269. package/dist/lib/text-with-copy/index.js +0 -24
  270. package/dist/lib/text-with-copy/index.js.map +0 -1
  271. package/dist/lib/title-with-sub/index.js +0 -6
  272. package/dist/lib/title-with-sub/index.js.map +0 -1
  273. package/dist/lib/tooltip-when-disabled/index.js +0 -9
  274. package/dist/lib/tooltip-when-disabled/index.js.map +0 -1
  275. package/dist/lib/tooltip-with-disabled/index.js +0 -9
  276. package/dist/lib/tooltip-with-disabled/index.js.map +0 -1
  277. package/dist/lib/tsconfig.build.tsbuildinfo +0 -1
  278. package/dist/lib/upload/index.js +0 -25
  279. package/dist/lib/upload/index.js.map +0 -1
  280. package/dist/lib/user-profile/index.js +0 -21
  281. package/dist/lib/user-profile/index.js.map +0 -1
  282. package/dist/lib/utils/basic.js +0 -29
  283. package/dist/lib/utils/basic.js.map +0 -1
  284. package/dist/lib/version-list/version-descriptions.js +0 -14
  285. package/dist/lib/version-list/version-descriptions.js.map +0 -1
  286. package/dist/lib/version-list/version-item.js +0 -6
  287. package/dist/lib/version-list/version-item.js.map +0 -1
  288. package/dist/lib/version-list/version-list.js +0 -11
  289. package/dist/lib/version-list/version-list.js.map +0 -1
  290. package/dist/lib/version-list/version-switch-panel.js +0 -10
  291. package/dist/lib/version-list/version-switch-panel.js.map +0 -1
  292. package/eslint.config.js +0 -7
  293. package/rslib.config.js +0 -7
  294. package/script/publish.js +0 -146
  295. package/src/base-search-select/base-search-form-select.tsx +0 -10
  296. package/src/base-search-select/base-search-select.tsx +0 -200
  297. package/src/base-search-select/index.module.less +0 -16
  298. package/src/base-search-select/index.tsx +0 -3
  299. package/src/base-search-select/types.ts +0 -16
  300. package/src/base-search-select/utils.ts +0 -78
  301. package/src/basic-card/index.tsx +0 -23
  302. package/src/card-pane/index.module.less +0 -14
  303. package/src/card-pane/index.tsx +0 -25
  304. package/src/chip-select/index.module.less +0 -17
  305. package/src/chip-select/index.tsx +0 -7
  306. package/src/code-editor/index.tsx +0 -9
  307. package/src/code-usage/code-item.module.less +0 -32
  308. package/src/code-usage/index.tsx +0 -91
  309. package/src/codemirror-editor/code-editor.tsx +0 -139
  310. package/src/codemirror-editor/index.ts +0 -4
  311. package/src/codemirror-editor/json-editor.tsx +0 -183
  312. package/src/codemirror-editor/raw-text-editor.tsx +0 -68
  313. package/src/codemirror-editor/text-editor.tsx +0 -58
  314. package/src/codemirror-editor/themes/coze-dark.ts +0 -116
  315. package/src/codemirror-editor/themes/coze-light.ts +0 -122
  316. package/src/collapse-card/index.module.less +0 -27
  317. package/src/collapse-card/index.tsx +0 -93
  318. package/src/collapsible-card/index.module.less +0 -63
  319. package/src/collapsible-card/index.tsx +0 -57
  320. package/src/column-manage-storage/index.tsx +0 -64
  321. package/src/columns-select/index.tsx +0 -244
  322. package/src/edit-icon-button/index.tsx +0 -36
  323. package/src/footer-actions/index.tsx +0 -33
  324. package/src/hooks/use-infinite-scroll.ts +0 -183
  325. package/src/hooks/use-mouse-down-offset.ts +0 -50
  326. package/src/hooks/use-unsave-leave-warning.ts +0 -49
  327. package/src/id-render/icon-button-container.tsx +0 -37
  328. package/src/id-render/index.tsx +0 -64
  329. package/src/index-controller/record-navigation.tsx +0 -57
  330. package/src/index-controller/use-item-index-controller.ts +0 -197
  331. package/src/index.ts +0 -208
  332. package/src/infinite-scroll-table/index.tsx +0 -99
  333. package/src/info-tooltip/index.tsx +0 -41
  334. package/src/input-components/radio-button.tsx +0 -63
  335. package/src/input-slider/index.module.less +0 -30
  336. package/src/input-slider/index.tsx +0 -161
  337. package/src/input-with-count/index.tsx +0 -31
  338. package/src/jump-button/jump-icon-button.tsx +0 -12
  339. package/src/large-txt-render/index.tsx +0 -46
  340. package/src/layout/content.tsx +0 -28
  341. package/src/layout/header.tsx +0 -15
  342. package/src/layout/index.module.less +0 -28
  343. package/src/layout/index.tsx +0 -9
  344. package/src/layout/tabs.tsx +0 -11
  345. package/src/lazy-load-component/index.tsx +0 -55
  346. package/src/logic-editor/index.ts +0 -3
  347. package/src/logic-editor/logic-editor.module.less +0 -13
  348. package/src/logic-editor/logic-editor.tsx +0 -200
  349. package/src/logic-editor/logic-left-render.tsx +0 -100
  350. package/src/logic-editor/logic-operator-render.tsx +0 -54
  351. package/src/logic-editor/logic-right-render.tsx +0 -51
  352. package/src/logic-editor/logic-types.tsx +0 -238
  353. package/src/logic-editor/utils.ts +0 -22
  354. package/src/logic-expr/assets/select.svg +0 -1
  355. package/src/logic-expr/consts.ts +0 -6
  356. package/src/logic-expr/expr-group-render.tsx +0 -238
  357. package/src/logic-expr/expr-render.tsx +0 -226
  358. package/src/logic-expr/index.module.less +0 -252
  359. package/src/logic-expr/index.ts +0 -13
  360. package/src/logic-expr/logic-expr.tsx +0 -261
  361. package/src/logic-expr/logic-not.tsx +0 -46
  362. package/src/logic-expr/logic-toggle.tsx +0 -96
  363. package/src/logic-expr/types.ts +0 -95
  364. package/src/loop-radio-group/index.tsx +0 -16
  365. package/src/multi-part-editor/components/image-item-renderer.tsx +0 -134
  366. package/src/multi-part-editor/components/index.module.less +0 -21
  367. package/src/multi-part-editor/components/multipart-item-renderer.tsx +0 -74
  368. package/src/multi-part-editor/components/url-input-modal.tsx +0 -317
  369. package/src/multi-part-editor/components/video-item-renderer.tsx +0 -145
  370. package/src/multi-part-editor/index.module.less +0 -8
  371. package/src/multi-part-editor/index.tsx +0 -571
  372. package/src/multi-part-editor/multi-part-render.tsx +0 -87
  373. package/src/multi-part-editor/type.tsx +0 -103
  374. package/src/multi-part-editor/upload-button.tsx +0 -256
  375. package/src/multi-part-editor/utils.ts +0 -64
  376. package/src/open-detail-button/index.tsx +0 -30
  377. package/src/page-content/index.tsx +0 -99
  378. package/src/primary-page/index.tsx +0 -1
  379. package/src/primary-page/primary-header.tsx +0 -64
  380. package/src/primary-title/index.module.less +0 -14
  381. package/src/primary-title/index.tsx +0 -18
  382. package/src/provider/index.tsx +0 -89
  383. package/src/resizable-side-sheet/index.tsx +0 -69
  384. package/src/resize-sidesheet/index.module.less +0 -14
  385. package/src/resize-sidesheet/index.tsx +0 -68
  386. package/src/resize-sidesheet/use-drag.ts +0 -43
  387. package/src/schema-editor/index.tsx +0 -52
  388. package/src/search-form/index.tsx +0 -134
  389. package/src/semi-schema-form/components/tmpls/array-field-item.tsx +0 -97
  390. package/src/semi-schema-form/components/tmpls/array-field.tsx +0 -127
  391. package/src/semi-schema-form/components/tmpls/base-input.tsx +0 -126
  392. package/src/semi-schema-form/components/tmpls/description-field.tsx +0 -23
  393. package/src/semi-schema-form/components/tmpls/error-list.tsx +0 -44
  394. package/src/semi-schema-form/components/tmpls/field-error.tsx +0 -33
  395. package/src/semi-schema-form/components/tmpls/field.tsx +0 -54
  396. package/src/semi-schema-form/components/tmpls/icon-button.tsx +0 -112
  397. package/src/semi-schema-form/components/tmpls/index.ts +0 -39
  398. package/src/semi-schema-form/components/tmpls/object-field.tsx +0 -173
  399. package/src/semi-schema-form/components/tmpls/submit.tsx +0 -31
  400. package/src/semi-schema-form/components/tmpls/title-field.tsx +0 -30
  401. package/src/semi-schema-form/components/widgets/checkbox.tsx +0 -67
  402. package/src/semi-schema-form/components/widgets/checkboxs.tsx +0 -100
  403. package/src/semi-schema-form/components/widgets/index.ts +0 -17
  404. package/src/semi-schema-form/components/widgets/radio.tsx +0 -105
  405. package/src/semi-schema-form/components/widgets/range.tsx +0 -73
  406. package/src/semi-schema-form/components/widgets/select.tsx +0 -108
  407. package/src/semi-schema-form/components/widgets/textarea.tsx +0 -63
  408. package/src/semi-schema-form/index.tsx +0 -14
  409. package/src/sentinel-form/enum.ts +0 -16
  410. package/src/sentinel-form/index.tsx +0 -382
  411. package/src/step-nav/index.module.less +0 -45
  412. package/src/step-nav/index.tsx +0 -53
  413. package/src/table/index.module.less +0 -144
  414. package/src/table/index.tsx +0 -18
  415. package/src/table/sort-icon.tsx +0 -73
  416. package/src/table/table-with-pagination.tsx +0 -150
  417. package/src/table/table-without-pagniation.tsx +0 -66
  418. package/src/table-batch-operate/table-batch-operation.tsx +0 -47
  419. package/src/table-batch-operate/use-batch-operate.ts +0 -111
  420. package/src/table-col-actions/index.module.less +0 -8
  421. package/src/table-col-actions/index.tsx +0 -149
  422. package/src/table-cols-config/index.module.less +0 -34
  423. package/src/table-cols-config/index.tsx +0 -171
  424. package/src/table-cols-config/type.ts +0 -12
  425. package/src/table-cols-config/use-hidden-col-keys.ts +0 -53
  426. package/src/table-cols-config/util.ts +0 -56
  427. package/src/table-empty/index.tsx +0 -23
  428. package/src/table-header/index.module.less +0 -7
  429. package/src/table-header/index.tsx +0 -70
  430. package/src/tabs/index.module.less +0 -48
  431. package/src/tabs/index.tsx +0 -9
  432. package/src/text-area-pro/index.module.less +0 -5
  433. package/src/text-area-pro/index.tsx +0 -49
  434. package/src/text-with-copy/index.tsx +0 -95
  435. package/src/title-with-sub/index.tsx +0 -27
  436. package/src/tooltip-when-disabled/index.tsx +0 -23
  437. package/src/tooltip-with-disabled/index.tsx +0 -17
  438. package/src/types.d.ts +0 -24
  439. package/src/upload/index.ts +0 -39
  440. package/src/user-profile/index.tsx +0 -49
  441. package/src/utils/basic.ts +0 -29
  442. package/src/version-list/index.module.less +0 -16
  443. package/src/version-list/version-descriptions.tsx +0 -80
  444. package/src/version-list/version-item.tsx +0 -30
  445. package/src/version-list/version-list.tsx +0 -59
  446. package/src/version-list/version-switch-panel.tsx +0 -31
  447. package/tailwind.config.ts +0 -6
  448. package/tsconfig.build.json +0 -44
  449. package/tsconfig.json +0 -17
  450. package/tsconfig.misc.json +0 -28
  451. package/vitest.config.mts +0 -7
@@ -1,89 +0,0 @@
1
- import { createContext, useContext, type ReactNode } from 'react';
2
-
3
- // I18n function type definition
4
- export type I18nFunction = (
5
- key: string,
6
- options?: Record<string, unknown>,
7
- fallbackText?: string,
8
- ) => string;
9
-
10
- // I18n object interface that matches the structure of @cozeloop/i18n-adapter
11
- export interface I18nObject {
12
- t: I18nFunction;
13
- language?: string; // en-US,zh-CN
14
- }
15
-
16
- // Context interface
17
- interface CozeLoopContextValue {
18
- i18n?: I18nFunction | I18nObject;
19
- sendEvent?: (
20
- name: string,
21
- params: Record<string, unknown>,
22
- target?: HTMLElement | string | null,
23
- ) => void;
24
- }
25
-
26
- // Create context
27
- const CozeLoopContext = createContext<CozeLoopContextValue>({});
28
-
29
- // Provider props
30
- interface CozeLoopProviderProps extends CozeLoopContextValue {
31
- children: ReactNode;
32
- }
33
-
34
- // Provider component
35
- export function CozeLoopProvider({
36
- children,
37
- i18n,
38
- sendEvent,
39
- }: CozeLoopProviderProps) {
40
- return (
41
- <CozeLoopContext.Provider value={{ i18n, sendEvent }}>
42
- {children}
43
- </CozeLoopContext.Provider>
44
- );
45
- }
46
-
47
- // Hook to use i18n - returns an object with t method to maintain I18n.t usage pattern
48
- export function useI18n(): I18nObject {
49
- const context = useContext(CozeLoopContext);
50
-
51
- if (!context.i18n) {
52
- // Fallback object when no i18n is provided
53
- return {
54
- t: (key: string) => {
55
- console.warn(
56
- `CozeLoopProvider: No i18n function provided, returning key: ${key}`,
57
- );
58
- return key;
59
- },
60
- language: 'zh-CN',
61
- };
62
- }
63
-
64
- // If context.i18n is already an object with t method, return it directly
65
- if (typeof context.i18n === 'object' && 't' in context.i18n) {
66
- return context.i18n;
67
- }
68
-
69
- // If context.i18n is a function, wrap it in an object
70
- return {
71
- t: context.i18n,
72
- };
73
- }
74
-
75
- // Hook to use sendEvent - return sendEvent function
76
- export function useReportEvent() {
77
- const context = useContext(CozeLoopContext);
78
- return (
79
- context.sendEvent ??
80
- ((name: string, params: Record<string, unknown>) => {
81
- console.info(name, params);
82
- })
83
- );
84
- }
85
-
86
- // Hook to get the full context (for advanced usage)
87
- export function useCozeLoopContext(): CozeLoopContextValue {
88
- return useContext(CozeLoopContext);
89
- }
@@ -1,69 +0,0 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
-
3
- import classNames from 'classnames';
4
- import { useMouseDownOffset } from '@cozeloop/hooks';
5
- import { type SideSheetReactProps, SideSheet } from '@coze-arch/coze-design';
6
-
7
- interface ResizableSideSheetProps extends SideSheetReactProps {
8
- minSize?: number;
9
- maxSize?: number;
10
- defaultSize?: number;
11
- onResizeEnd?: (size: number) => void;
12
- }
13
-
14
- const SIZE_MAP = {
15
- small: 448,
16
- medium: 684,
17
- large: 920,
18
- };
19
- /** 仅支持 left 模式 */
20
- export const ResizableSideSheet = (props: ResizableSideSheetProps) => {
21
- const {
22
- minSize = Number.MIN_VALUE,
23
- defaultSize,
24
- maxSize = Number.MAX_VALUE,
25
- size = 'small',
26
- onResizeEnd,
27
- className,
28
- children,
29
- ...restProps
30
- } = props;
31
-
32
- const [sidePaneWidth, setSidePaneWidth] = useState(
33
- defaultSize ?? SIZE_MAP[size],
34
- );
35
- const prevWidthRef = useRef(sidePaneWidth);
36
-
37
- const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
38
- const newWidth = prevWidthRef.current - offsetX;
39
- setSidePaneWidth([maxSize, newWidth, minSize].sort((a, b) => a - b)[1]);
40
- });
41
-
42
- useEffect(() => {
43
- prevWidthRef.current = sidePaneWidth;
44
- document.body.style.cursor = isActive ? 'col-resize' : '';
45
- document.body.style.userSelect = isActive ? 'none' : 'auto';
46
- if (!isActive) {
47
- onResizeEnd?.(sidePaneWidth);
48
- }
49
- }, [isActive]);
50
- return (
51
- <SideSheet
52
- className={classNames('relative', className)}
53
- size={size}
54
- width={sidePaneWidth}
55
- {...restProps}
56
- >
57
- <div
58
- ref={ref}
59
- className={classNames(
60
- 'absolute h-full w-1 bg-white top-0 left-0 hover:cursor-col-resize hover:bg-blue-400 transition',
61
- {
62
- 'bg-blue-400 cursor-col-resize': isActive,
63
- },
64
- )}
65
- />
66
- {children}
67
- </SideSheet>
68
- );
69
- };
@@ -1,14 +0,0 @@
1
- .sheet{
2
- :global{
3
- .semi-sidesheet-header {
4
- display: flex;
5
- align-items: flex-start;
6
- padding: 18px 24px;
7
- border-bottom: 1px solid var(--semi-color-border);
8
- }
9
-
10
- .semi-sidesheet-footer{
11
- border-top: 1px solid var(--semi-color-border);
12
- }
13
- }
14
- }
@@ -1,68 +0,0 @@
1
- import cn from 'classnames';
2
- import { IconCozCrossFill } from '@coze-arch/coze-design/icons';
3
- import {
4
- type SideSheetReactProps,
5
- Divider,
6
- SideSheet,
7
- } from '@coze-arch/coze-design';
8
- import { Button } from '@coze-arch/coze-design';
9
-
10
- import { useDrag, type DragOptions } from './use-drag';
11
-
12
- import styles from './index.module.less';
13
-
14
- export const ResizeSidesheet = (
15
- props: SideSheetReactProps & {
16
- dragOptions?: DragOptions;
17
- showDivider?: boolean;
18
- disableDrag?: boolean;
19
- },
20
- ) => {
21
- const {
22
- children,
23
- dragOptions,
24
- title,
25
- onCancel,
26
- className,
27
- showDivider,
28
- disableDrag,
29
- ...rest
30
- } = props;
31
- const { containerRef, isActive, sidePaneWidth } = useDrag(dragOptions);
32
- return (
33
- <SideSheet
34
- title={
35
- <div className="flex items-center gap-2">
36
- <div className="flex-1">{title}</div>
37
- {showDivider ? (
38
- <Divider layout="vertical" className="h-[12px]" />
39
- ) : null}
40
- <Button
41
- type="primary"
42
- color="secondary"
43
- icon={<IconCozCrossFill className="w-[16px] h-[16px]" />}
44
- onClick={onCancel}
45
- />
46
- </div>
47
- }
48
- width={disableDrag ? undefined : sidePaneWidth}
49
- className={cn(styles.sheet, className)}
50
- {...rest}
51
- onCancel={onCancel}
52
- closable={false}
53
- >
54
- {disableDrag ? null : (
55
- <div
56
- ref={containerRef}
57
- className={cn(
58
- 'absolute h-full w-[2px] z-[20000] bg-transparent top-0 left-0 hover:cursor-col-resize hover:bg-[rgb(var(--coze-up-brand-9))] transition ',
59
- {
60
- 'bg-[rgb(var(--coze-up-brand-9))] cursor-col-resize': isActive,
61
- },
62
- )}
63
- />
64
- )}
65
- {props.children}
66
- </SideSheet>
67
- );
68
- };
@@ -1,43 +0,0 @@
1
- import { useEffect, useRef, useState } from 'react';
2
-
3
- import { useMouseDownOffset } from '../hooks/use-mouse-down-offset';
4
-
5
- const DEFAULT_WIDTH = 500;
6
- const MAX_WIDTH = 800;
7
- const MIN_WIDTH = 300;
8
-
9
- export interface DragOptions {
10
- defaultWidth?: number;
11
- maxWidth?: number;
12
- minWidth?: number;
13
- onDragEnd?: (width: number) => void;
14
- }
15
-
16
- export const useDrag = (options: DragOptions = {}) => {
17
- const {
18
- defaultWidth = DEFAULT_WIDTH,
19
- maxWidth = MAX_WIDTH,
20
- minWidth = MIN_WIDTH,
21
- } = options;
22
- const [sidePaneWidth, setSidePaneWidth] = useState(defaultWidth);
23
- const prevWidthRef = useRef(sidePaneWidth);
24
- const isActiveRef = useRef(false);
25
- const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
26
- const newWidth = prevWidthRef.current - offsetX;
27
- setSidePaneWidth([maxWidth, newWidth, minWidth].sort((a, b) => a - b)[1]);
28
- });
29
- useEffect(() => {
30
- prevWidthRef.current = sidePaneWidth;
31
- document.body.style.cursor = isActive ? 'col-resize' : '';
32
- document.body.style.userSelect = isActive ? 'none' : 'auto';
33
- if (isActiveRef.current && !isActive) {
34
- options?.onDragEnd?.(sidePaneWidth);
35
- }
36
- isActiveRef.current = isActive;
37
- }, [isActive]);
38
- return {
39
- sidePaneWidth,
40
- containerRef: ref,
41
- isActive,
42
- };
43
- };
@@ -1,52 +0,0 @@
1
- import classNames from 'classnames';
2
-
3
- import {
4
- CodeMirrorJsonEditor,
5
- CodeMirrorRawTextEditor,
6
- } from '../codemirror-editor';
7
-
8
- interface SchemaEditorProps {
9
- value?: string;
10
- readOnly?: boolean;
11
- onChange?: (value?: string) => void;
12
- language?: string;
13
- placeholder?: string;
14
- showLineNumbs?: boolean;
15
- className?: string;
16
- }
17
-
18
- export const SchemaEditor = ({
19
- value,
20
- onChange,
21
- placeholder,
22
- readOnly,
23
- language,
24
- className,
25
- }: SchemaEditorProps) => (
26
- <div
27
- className={classNames(
28
- 'w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white',
29
- { 'opacity-70': readOnly },
30
- className,
31
- )}
32
- >
33
- {language === 'json' ? (
34
- <CodeMirrorJsonEditor
35
- className="w-full h-full overflow-y-auto"
36
- onChange={onChange}
37
- value={value || ''}
38
- placeholder={placeholder}
39
- readonly={readOnly}
40
- borderRadius={4}
41
- />
42
- ) : (
43
- <CodeMirrorRawTextEditor
44
- className="w-full h-full overflow-y-auto"
45
- onChange={onChange}
46
- value={value || ''}
47
- placeholder={placeholder}
48
- readonly={readOnly}
49
- />
50
- )}
51
- </div>
52
- );
@@ -1,134 +0,0 @@
1
- /* eslint-disable security/detect-object-injection */
2
- /* eslint-disable @typescript-eslint/naming-convention */
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
- import { useSearchParams } from 'react-router-dom';
5
- import React, {
6
- forwardRef,
7
- useCallback,
8
- useImperativeHandle,
9
- useRef,
10
- useState,
11
- } from 'react';
12
-
13
- import { omit } from 'lodash-es';
14
- import { type Form } from '@coze-arch/coze-design';
15
-
16
- import { safeJsonParse } from '@cozeloop/toolkit';
17
-
18
- export type SearchFormFilterRecord = Record<string, any>;
19
-
20
- export interface SearchFormRef {
21
- getValues: () => SearchFormFilterRecord | undefined;
22
- }
23
-
24
- interface SearchFormProps {
25
- className?: string;
26
- children: any;
27
- SemiForm: typeof Form;
28
- onSearch?: (v: SearchFormFilterRecord) => Promise<any>;
29
- initValue?: SearchFormFilterRecord;
30
- }
31
-
32
- /**
33
- * 如果对象的value为对象,将 value 转换为字符串
34
- * @param value
35
- * @returns
36
- */
37
- const stringifyObjectValue = (value: Record<string, any>) =>
38
- Object.keys(value).reduce(
39
- (acc, key) => {
40
- const val = value[key];
41
- if (typeof val === 'object') {
42
- acc[key] = JSON.stringify(val);
43
- } else {
44
- acc[key] = val;
45
- }
46
- return acc;
47
- },
48
- {} as unknown as Record<string, string>,
49
- );
50
-
51
- const parseObjectValue = (data: Record<string, string>) =>
52
- Object.keys(data).reduce(
53
- (acc, key) => {
54
- const value = data[key];
55
- if (value.startsWith('{') || value.startsWith('[')) {
56
- acc[key] = safeJsonParse(value) || value;
57
- } else {
58
- acc[key] = value;
59
- }
60
- return acc;
61
- },
62
- {} as unknown as Record<string, any>,
63
- );
64
-
65
- export const SearchForm = forwardRef<SearchFormRef, SearchFormProps>(
66
- ({ className, children, onSearch, SemiForm, initValue = {} }, ref) => {
67
- const formRef = useRef<Form<SearchFormFilterRecord>>(null);
68
-
69
- const [initValueAndParams] = useState(() => {
70
- const params = new URLSearchParams(window.location.search);
71
-
72
- const initParams: Record<string, string> = {};
73
- params.forEach((value, key) => {
74
- initParams[key] = value;
75
- });
76
-
77
- const urlValues = parseObjectValue(initParams);
78
- const defaultValue = { ...initValue, ...urlValues };
79
- const defaultSearchParams = new URLSearchParams(
80
- stringifyObjectValue(defaultValue),
81
- );
82
- const filterValue = omit(defaultValue, ['page', 'pageSize']);
83
- if (Object.keys(filterValue).length !== 0) {
84
- onSearch?.(filterValue);
85
- }
86
- return {
87
- defaultValue: filterValue,
88
- defaultSearchParams,
89
- };
90
- });
91
- const [searchParams, setSearchParams] = useSearchParams();
92
-
93
- const formValueChange = useCallback(
94
- (allValues: SearchFormFilterRecord) => {
95
- const searchResult = onSearch?.(allValues);
96
- searchResult?.then(() => {
97
- setSearchParams(
98
- prev => {
99
- const v = stringifyObjectValue(allValues || {});
100
- prev.forEach((_value, key) => {
101
- if (!['page', 'pageSize', 'tab'].includes(key)) {
102
- prev.delete(key);
103
- }
104
- });
105
- Object.keys(v).forEach(key => {
106
- prev.set(key, v[key]);
107
- });
108
- return prev;
109
- },
110
- { replace: true },
111
- );
112
- });
113
- },
114
- [searchParams],
115
- );
116
-
117
- useImperativeHandle(ref, () => ({
118
- getValues: () => formRef.current?.formApi?.getValues?.(),
119
- }));
120
-
121
- type ChangeValue = typeof initValueAndParams.defaultValue;
122
- return children ? (
123
- <SemiForm<ChangeValue>
124
- ref={formRef}
125
- initValues={initValueAndParams.defaultValue}
126
- onValueChange={formValueChange}
127
- layout="horizontal"
128
- className={className}
129
- >
130
- {children}
131
- </SemiForm>
132
- ) : null;
133
- },
134
- );
@@ -1,97 +0,0 @@
1
- /* eslint-disable complexity */
2
-
3
- import React from 'react';
4
- import {
5
- type ArrayFieldTemplateItemType,
6
- type FormContextType,
7
- type RJSFSchema,
8
- type StrictRJSFSchema,
9
- } from '@rjsf/utils';
10
- import { ButtonGroup, Col, Row } from '@coze-arch/coze-design';
11
-
12
- const BTN_GRP_STYLE = {
13
- width: '100%',
14
- };
15
-
16
- const BTN_STYLE = {
17
- width: 'calc(100% / 4)',
18
- };
19
-
20
- /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
21
- *
22
- * @param props - The `ArrayFieldTemplateItemType` props for the component
23
- */
24
- export default function ArrayFieldItemTemplate<
25
- T = unknown,
26
- S extends StrictRJSFSchema = RJSFSchema,
27
- F extends FormContextType = object,
28
- >(props: ArrayFieldTemplateItemType<T, S, F>) {
29
- const {
30
- children,
31
- disabled,
32
- hasCopy,
33
- hasMoveDown,
34
- hasMoveUp,
35
- hasRemove,
36
- hasToolbar,
37
- index,
38
- onCopyIndexClick,
39
- onDropIndexClick,
40
- onReorderClick,
41
- readonly,
42
- registry,
43
- uiSchema,
44
- } = props;
45
- const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } =
46
- registry.templates.ButtonTemplates;
47
- const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext;
48
-
49
- return (
50
- <Row align={toolbarAlign} key={`array-item-${index}`} gutter={rowGutter}>
51
- <Col span={18}>{children}</Col>
52
-
53
- {hasToolbar ? (
54
- <Col span={6}>
55
- <ButtonGroup style={BTN_GRP_STYLE}>
56
- {hasMoveUp || hasMoveDown ? (
57
- <MoveUpButton
58
- disabled={disabled || readonly || !hasMoveUp}
59
- onClick={onReorderClick(index, index - 1)}
60
- style={BTN_STYLE}
61
- uiSchema={uiSchema}
62
- registry={registry}
63
- />
64
- ) : null}
65
- {hasMoveUp || hasMoveDown ? (
66
- <MoveDownButton
67
- disabled={disabled || readonly || !hasMoveDown}
68
- onClick={onReorderClick(index, index + 1)}
69
- style={BTN_STYLE}
70
- uiSchema={uiSchema}
71
- registry={registry}
72
- />
73
- ) : null}
74
- {hasCopy ? (
75
- <CopyButton
76
- disabled={disabled || readonly}
77
- onClick={onCopyIndexClick(index)}
78
- style={BTN_STYLE}
79
- uiSchema={uiSchema}
80
- registry={registry}
81
- />
82
- ) : null}
83
- {hasRemove ? (
84
- <RemoveButton
85
- disabled={disabled || readonly}
86
- onClick={onDropIndexClick(index)}
87
- style={BTN_STYLE}
88
- uiSchema={uiSchema}
89
- registry={registry}
90
- />
91
- ) : null}
92
- </ButtonGroup>
93
- </Col>
94
- ) : null}
95
- </Row>
96
- );
97
- }
@@ -1,127 +0,0 @@
1
- import React from 'react';
2
- import cn from 'classnames';
3
- import {
4
- getTemplate,
5
- getUiOptions,
6
- type ArrayFieldTemplateProps,
7
- type ArrayFieldTemplateItemType,
8
- type FormContextType,
9
- type GenericObjectType,
10
- type RJSFSchema,
11
- type StrictRJSFSchema,
12
- } from '@rjsf/utils';
13
- import { Col, Row } from '@coze-arch/coze-design';
14
-
15
- // const DESCRIPTION_COL_STYLE = {
16
- // paddingBottom: '8px',
17
- // };
18
-
19
- /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
20
- *
21
- * @param props - The `ArrayFieldTemplateItemType` props for the component
22
- */
23
- export default function ArrayFieldTemplate<
24
- T = unknown,
25
- S extends StrictRJSFSchema = RJSFSchema,
26
- F extends FormContextType = object,
27
- >(props: ArrayFieldTemplateProps<T, S, F>) {
28
- const {
29
- canAdd,
30
- className,
31
- disabled,
32
- formContext,
33
- idSchema,
34
- items,
35
- onAddClick,
36
- readonly,
37
- registry,
38
- // required,
39
- // schema,
40
- // title,
41
- uiSchema,
42
- } = props;
43
- const uiOptions = getUiOptions<T, S, F>(uiSchema);
44
- // const ArrayFieldDescriptionTemplate = getTemplate<
45
- // 'ArrayFieldDescriptionTemplate',
46
- // T,
47
- // S,
48
- // F
49
- // >('ArrayFieldDescriptionTemplate', registry, uiOptions);
50
- const ArrayFieldItemTemplate = getTemplate<'ArrayFieldItemTemplate', T, S, F>(
51
- 'ArrayFieldItemTemplate',
52
- registry,
53
- uiOptions,
54
- );
55
- // const ArrayFieldTitleTemplate = getTemplate<
56
- // 'ArrayFieldTitleTemplate',
57
- // T,
58
- // S,
59
- // F
60
- // >('ArrayFieldTitleTemplate', registry, uiOptions);
61
- // Button templates are not overridden in the uiSchema
62
- const {
63
- ButtonTemplates: { AddButton },
64
- } = registry.templates;
65
- const { rowGutter = 24 } = formContext as GenericObjectType;
66
-
67
- return (
68
- <div
69
- className={cn('p-3 semi-card-bordered rounded-[4px]', className)}
70
- id={idSchema.$id}
71
- >
72
- <Row gutter={rowGutter}>
73
- {/* {uiOptions.title || title ? (
74
- <Col span={24}>
75
- <ArrayFieldTitleTemplate
76
- idSchema={idSchema}
77
- required={required}
78
- title={uiOptions.title || title}
79
- schema={schema}
80
- uiSchema={uiSchema}
81
- registry={registry}
82
- />
83
- </Col>
84
- ) : null} */}
85
- {/* {uiOptions.description || schema.description ? (
86
- <Col span={24} style={DESCRIPTION_COL_STYLE}>
87
- <ArrayFieldDescriptionTemplate
88
- description={uiOptions.description || schema.description}
89
- idSchema={idSchema}
90
- schema={schema}
91
- uiSchema={uiSchema}
92
- registry={registry}
93
- />
94
- </Col>
95
- ) : null} */}
96
- <Col className="row array-item-list" span={24}>
97
- {items
98
- ? items.map(
99
- ({
100
- key,
101
- ...itemProps
102
- }: ArrayFieldTemplateItemType<T, S, F>) => (
103
- <ArrayFieldItemTemplate key={key} {...itemProps} />
104
- ),
105
- )
106
- : null}
107
- </Col>
108
-
109
- {canAdd ? (
110
- <Col span={24}>
111
- <Row gutter={rowGutter} justify="end">
112
- <Col span={6}>
113
- <AddButton
114
- className="array-item-add"
115
- disabled={disabled || readonly}
116
- onClick={onAddClick}
117
- uiSchema={uiSchema}
118
- registry={registry}
119
- />
120
- </Col>
121
- </Row>
122
- </Col>
123
- ) : null}
124
- </Row>
125
- </div>
126
- );
127
- }