@ccs-ui/rc-pro 2.3.6-alpha-32 → 2.3.6-alpha-33

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 (344) hide show
  1. package/package.json +4 -26
  2. package/LICENSE +0 -21
  3. package/README.md +0 -37
  4. package/docs-dist/2179.b80aa159.async.js +0 -22
  5. package/docs-dist/2191.275582c6.async.js +0 -6
  6. package/docs-dist/27.82086704.async.js +0 -11
  7. package/docs-dist/3249.edb38f0f.async.js +0 -28
  8. package/docs-dist/404.html +0 -15
  9. package/docs-dist/5171.198d8c6e.async.js +0 -8
  10. package/docs-dist/7024.588d984f.async.js +0 -22
  11. package/docs-dist/7488.2db563fb.async.js +0 -137
  12. package/docs-dist/751.bb8cce69.async.js +0 -1
  13. package/docs-dist/8784.91b4ab45.async.js +0 -598
  14. package/docs-dist/9591.06d066b1.async.js +0 -1
  15. package/docs-dist/9600.78d67888.async.js +0 -16
  16. package/docs-dist/9600.e8c51481.chunk.css +0 -5
  17. package/docs-dist/auth__demos.32e710d5.async.js +0 -1
  18. package/docs-dist/auth__index.md.33be0665.chunk.css +0 -1
  19. package/docs-dist/auth__index.md.e0b5996f.async.js +0 -1
  20. package/docs-dist/button__demos.a20990de.async.js +0 -1
  21. package/docs-dist/button__index.md.33be0665.chunk.css +0 -1
  22. package/docs-dist/button__index.md.43fe8c62.async.js +0 -1
  23. package/docs-dist/cascader__demos.cb1e67f3.async.js +0 -1
  24. package/docs-dist/cascader__index.md.33be0665.chunk.css +0 -1
  25. package/docs-dist/cascader__index.md.cafec622.async.js +0 -1
  26. package/docs-dist/components/auth/index.html +0 -15
  27. package/docs-dist/components/button/index.html +0 -15
  28. package/docs-dist/components/cascader/index.html +0 -15
  29. package/docs-dist/components/date-picker/index.html +0 -15
  30. package/docs-dist/components/dialog/index.html +0 -15
  31. package/docs-dist/components/editor/index.html +0 -15
  32. package/docs-dist/components/group-form-item/index.html +0 -15
  33. package/docs-dist/components/index.html +0 -15
  34. package/docs-dist/components/interval-button/index.html +0 -15
  35. package/docs-dist/components/layout-keep-alive/index.html +0 -15
  36. package/docs-dist/components/loading/index.html +0 -15
  37. package/docs-dist/components/pro-grid/index.html +0 -15
  38. package/docs-dist/components/pro-table/index.html +0 -15
  39. package/docs-dist/components/pro-tabs/index.html +0 -15
  40. package/docs-dist/components/result/index.html +0 -15
  41. package/docs-dist/components/select/index.html +0 -15
  42. package/docs-dist/components/time-picker/index.html +0 -15
  43. package/docs-dist/components/trigger/index.html +0 -15
  44. package/docs-dist/components/virtual-list/index.html +0 -15
  45. package/docs-dist/components/water-mark/index.html +0 -15
  46. package/docs-dist/date-picker__demos.4cf5ef3e.async.js +0 -1
  47. package/docs-dist/date-picker__index.md.33be0665.chunk.css +0 -1
  48. package/docs-dist/date-picker__index.md.c27e69b2.async.js +0 -1
  49. package/docs-dist/dialog__demos.14d31789.async.js +0 -1
  50. package/docs-dist/dialog__index.md.33be0665.chunk.css +0 -1
  51. package/docs-dist/dialog__index.md.665375f8.async.js +0 -1
  52. package/docs-dist/docs__index.md.0a458278.async.js +0 -1
  53. package/docs-dist/docs__index.md.33be0665.chunk.css +0 -1
  54. package/docs-dist/docs__log.md.33be0665.chunk.css +0 -1
  55. package/docs-dist/docs__log.md.af406e13.async.js +0 -1
  56. package/docs-dist/docs__utils.md.33be0665.chunk.css +0 -1
  57. package/docs-dist/docs__utils.md.e1ca1150.async.js +0 -1
  58. package/docs-dist/dumi__tmp-production__dumi__theme__ContextWrapper.b4f42a14.async.js +0 -233
  59. package/docs-dist/dumi__tmp-production__dumi__theme__ContextWrapper.b9764392.chunk.css +0 -1
  60. package/docs-dist/editor__demos.f5ff3638.async.js +0 -6
  61. package/docs-dist/editor__index.md.33be0665.chunk.css +0 -1
  62. package/docs-dist/editor__index.md.b4f3c5a3.async.js +0 -1
  63. package/docs-dist/favicon.png +0 -0
  64. package/docs-dist/group-form-item__demos.3197aa4d.async.js +0 -1
  65. package/docs-dist/group-form-item__index.md.33be0665.chunk.css +0 -1
  66. package/docs-dist/group-form-item__index.md.63bf18f4.async.js +0 -1
  67. package/docs-dist/index.html +0 -15
  68. package/docs-dist/index.md.1621f8b8.async.js +0 -1
  69. package/docs-dist/index.md.33be0665.chunk.css +0 -1
  70. package/docs-dist/interval-button__demos.ff98564f.async.js +0 -1
  71. package/docs-dist/interval-button__index.md.33be0665.chunk.css +0 -1
  72. package/docs-dist/interval-button__index.md.54c9da91.async.js +0 -1
  73. package/docs-dist/layout-keep-alive__demos.c12a544d.async.js +0 -1
  74. package/docs-dist/layout-keep-alive__index.md.33be0665.chunk.css +0 -1
  75. package/docs-dist/layout-keep-alive__index.md.90ef1c2b.async.js +0 -1
  76. package/docs-dist/loading__demos.8ac9187d.async.js +0 -1
  77. package/docs-dist/loading__index.md.33be0665.chunk.css +0 -1
  78. package/docs-dist/loading__index.md.d52a9847.async.js +0 -1
  79. package/docs-dist/log/index.html +0 -15
  80. package/docs-dist/logo.svg +0 -48
  81. package/docs-dist/meta__auth.2fdb9639.async.js +0 -12
  82. package/docs-dist/meta__auth.b9764392.chunk.css +0 -1
  83. package/docs-dist/meta__button.420ed66c.async.js +0 -8759
  84. package/docs-dist/meta__button.b9764392.chunk.css +0 -1
  85. package/docs-dist/meta__cascader.79f5fc28.async.js +0 -103
  86. package/docs-dist/meta__cascader.b9764392.chunk.css +0 -1
  87. package/docs-dist/meta__date-picker.79265ba8.async.js +0 -72
  88. package/docs-dist/meta__date-picker.b9764392.chunk.css +0 -1
  89. package/docs-dist/meta__dialog.1ca8b654.async.js +0 -502
  90. package/docs-dist/meta__dialog.b9764392.chunk.css +0 -1
  91. package/docs-dist/meta__docs.5dbc484a.async.js +0 -1
  92. package/docs-dist/meta__editor.11adf92c.async.js +0 -37
  93. package/docs-dist/meta__editor.b9764392.chunk.css +0 -1
  94. package/docs-dist/meta__group-form-item.a6e6163c.async.js +0 -36
  95. package/docs-dist/meta__group-form-item.b9764392.chunk.css +0 -1
  96. package/docs-dist/meta__index.md.3fe47f24.async.js +0 -1
  97. package/docs-dist/meta__interval-button.72bce101.async.js +0 -17
  98. package/docs-dist/meta__interval-button.b9764392.chunk.css +0 -1
  99. package/docs-dist/meta__layout-keep-alive.3997804f.async.js +0 -17
  100. package/docs-dist/meta__layout-keep-alive.b9764392.chunk.css +0 -1
  101. package/docs-dist/meta__loading.b9764392.chunk.css +0 -1
  102. package/docs-dist/meta__loading.cd39daf6.async.js +0 -24
  103. package/docs-dist/meta__pro-grid.b9764392.chunk.css +0 -1
  104. package/docs-dist/meta__pro-grid.be34bc7a.async.js +0 -21
  105. package/docs-dist/meta__pro-table.b9764392.chunk.css +0 -1
  106. package/docs-dist/meta__pro-table.d318e6ac.async.js +0 -609
  107. package/docs-dist/meta__pro-tabs.2d66cb0d.async.js +0 -104
  108. package/docs-dist/meta__pro-tabs.b9764392.chunk.css +0 -1
  109. package/docs-dist/meta__result.12e85cae.async.js +0 -20
  110. package/docs-dist/meta__result.b9764392.chunk.css +0 -1
  111. package/docs-dist/meta__select.91395de5.async.js +0 -337
  112. package/docs-dist/meta__select.b9764392.chunk.css +0 -1
  113. package/docs-dist/meta__time-picker.5ae1cf72.async.js +0 -24
  114. package/docs-dist/meta__time-picker.b9764392.chunk.css +0 -1
  115. package/docs-dist/meta__trigger.0368918c.async.js +0 -451
  116. package/docs-dist/meta__trigger.b9764392.chunk.css +0 -1
  117. package/docs-dist/meta__virtual-list.71ae35a9.async.js +0 -35
  118. package/docs-dist/meta__virtual-list.b9764392.chunk.css +0 -1
  119. package/docs-dist/meta__water-mark.b9764392.chunk.css +0 -1
  120. package/docs-dist/meta__water-mark.f487e8dd.async.js +0 -15
  121. package/docs-dist/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +0 -1
  122. package/docs-dist/nm__dumi__dist__client__pages__404.c319e0a3.async.js +0 -1
  123. package/docs-dist/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +0 -1
  124. package/docs-dist/nm__dumi__dist__client__pages__Demo__index.7e033f2b.async.js +0 -1
  125. package/docs-dist/nm__dumi__theme-default__layouts__DocLayout__index.8a08baa2.async.js +0 -1
  126. package/docs-dist/preload_helper.9430b29d.js +0 -1
  127. package/docs-dist/pro-grid__demos.81d67052.async.js +0 -1
  128. package/docs-dist/pro-grid__index.md.33be0665.chunk.css +0 -1
  129. package/docs-dist/pro-grid__index.md.a6b9c956.async.js +0 -1
  130. package/docs-dist/pro-table__demos.254e5b3a.async.js +0 -1
  131. package/docs-dist/pro-table__index.md.33be0665.chunk.css +0 -1
  132. package/docs-dist/pro-table__index.md.607fa3d4.async.js +0 -1
  133. package/docs-dist/pro-tabs__demos.2f05143c.async.js +0 -1
  134. package/docs-dist/pro-tabs__index.md.33be0665.chunk.css +0 -1
  135. package/docs-dist/pro-tabs__index.md.61a7d2c1.async.js +0 -1
  136. package/docs-dist/result__demos.689a5a17.async.js +0 -1
  137. package/docs-dist/result__index.md.33be0665.chunk.css +0 -1
  138. package/docs-dist/result__index.md.7cac7890.async.js +0 -1
  139. package/docs-dist/select__demos.c77af292.async.js +0 -1
  140. package/docs-dist/select__index.md.33be0665.chunk.css +0 -1
  141. package/docs-dist/select__index.md.f818a939.async.js +0 -2
  142. package/docs-dist/time-picker__demos.48d5025e.async.js +0 -1
  143. package/docs-dist/time-picker__index.md.25b2d39e.async.js +0 -1
  144. package/docs-dist/time-picker__index.md.33be0665.chunk.css +0 -1
  145. package/docs-dist/trigger__demos.2f9bf9f4.async.js +0 -1
  146. package/docs-dist/trigger__index.md.33be0665.chunk.css +0 -1
  147. package/docs-dist/trigger__index.md.7e0b7729.async.js +0 -1
  148. package/docs-dist/umi.52ae6580.js +0 -110
  149. package/docs-dist/umi.8c46519e.css +0 -1
  150. package/docs-dist/utils/index.html +0 -15
  151. package/docs-dist/virtual-list__demos.b1f5e707.async.js +0 -1
  152. package/docs-dist/virtual-list__index.md.33be0665.chunk.css +0 -1
  153. package/docs-dist/virtual-list__index.md.47c7bdca.async.js +0 -1
  154. package/docs-dist/water-mark__demos.f7bcee8a.async.js +0 -1
  155. package/docs-dist/water-mark__index.md.33be0665.chunk.css +0 -1
  156. package/docs-dist/water-mark__index.md.e5555c25.async.js +0 -1
  157. package/docs-dist/~demos/:id/index.html +0 -15
  158. package/docs-dist/~demos/auth-demo-basic/index.html +0 -15
  159. package/docs-dist/~demos/button-demo-button/index.html +0 -15
  160. package/docs-dist/~demos/button-demo-group/index.html +0 -15
  161. package/docs-dist/~demos/cascader-demo-basic/index.html +0 -15
  162. package/docs-dist/~demos/cascader-demo-cache/index.html +0 -15
  163. package/docs-dist/~demos/date-picker-demo-basic/index.html +0 -15
  164. package/docs-dist/~demos/date-picker-demo-range/index.html +0 -15
  165. package/docs-dist/~demos/dialog-demo-demos/index.html +0 -15
  166. package/docs-dist/~demos/editor-demo-demos/index.html +0 -15
  167. package/docs-dist/~demos/group-form-item-demo-basic/index.html +0 -15
  168. package/docs-dist/~demos/interval-button-demo-basic/index.html +0 -15
  169. package/docs-dist/~demos/layout-keep-alive-demo-basic/index.html +0 -15
  170. package/docs-dist/~demos/loading-demo-basic/index.html +0 -15
  171. package/docs-dist/~demos/pro-grid-demo-basic/index.html +0 -15
  172. package/docs-dist/~demos/pro-table-demo-basic/index.html +0 -15
  173. package/docs-dist/~demos/pro-table-demo-fixed/index.html +0 -15
  174. package/docs-dist/~demos/pro-table-demo-selection/index.html +0 -15
  175. package/docs-dist/~demos/pro-tabs-demo-basic/index.html +0 -15
  176. package/docs-dist/~demos/pro-tabs-demo-tab/index.html +0 -15
  177. package/docs-dist/~demos/result-demo-basic/index.html +0 -15
  178. package/docs-dist/~demos/select-demo-api/index.html +0 -15
  179. package/docs-dist/~demos/select-demo-basic/index.html +0 -15
  180. package/docs-dist/~demos/select-demo-customize/index.html +0 -15
  181. package/docs-dist/~demos/select-demo-customize-label/index.html +0 -15
  182. package/docs-dist/~demos/time-picker-demo-basic/index.html +0 -15
  183. package/docs-dist/~demos/trigger-demo-basic/index.html +0 -15
  184. package/docs-dist/~demos/virtual-list-demo-basic/index.html +0 -15
  185. package/docs-dist/~demos/water-mark-demo-basic/index.html +0 -15
  186. package/es/aj-captcha/index.d.ts +0 -34
  187. package/es/aj-captcha/index.js +0 -302
  188. package/es/aj-captcha/index.less +0 -89
  189. package/es/auth/index.d.ts +0 -22
  190. package/es/auth/index.js +0 -52
  191. package/es/breadcrumb.d.ts +0 -8
  192. package/es/breadcrumb.js +0 -40
  193. package/es/button/dropdown.d.ts +0 -6
  194. package/es/button/dropdown.js +0 -72
  195. package/es/button/group.d.ts +0 -2
  196. package/es/button/group.js +0 -176
  197. package/es/button/index.d.ts +0 -65
  198. package/es/button/index.js +0 -133
  199. package/es/cascader/index.d.ts +0 -33
  200. package/es/cascader/index.js +0 -120
  201. package/es/ccs.d.ts +0 -131
  202. package/es/ccs.js +0 -1
  203. package/es/color-picker/index.d.ts +0 -7
  204. package/es/color-picker/index.js +0 -142
  205. package/es/color-picker/index.less +0 -8
  206. package/es/config.d.ts +0 -6
  207. package/es/config.js +0 -126
  208. package/es/context/index.d.ts +0 -115
  209. package/es/context/index.js +0 -6
  210. package/es/date-picker/index.d.ts +0 -19
  211. package/es/date-picker/index.js +0 -72
  212. package/es/dialog/HookDrawer.d.ts +0 -9
  213. package/es/dialog/HookDrawer.js +0 -156
  214. package/es/dialog/HookModal.d.ts +0 -10
  215. package/es/dialog/HookModal.js +0 -213
  216. package/es/dialog/button.d.ts +0 -24
  217. package/es/dialog/button.js +0 -256
  218. package/es/dialog/context.d.ts +0 -25
  219. package/es/dialog/context.js +0 -13
  220. package/es/dialog/drawer-footer.d.ts +0 -16
  221. package/es/dialog/drawer-footer.js +0 -43
  222. package/es/dialog/form.d.ts +0 -16
  223. package/es/dialog/form.js +0 -53
  224. package/es/dialog/hook.d.ts +0 -80
  225. package/es/dialog/hook.js +0 -234
  226. package/es/dialog/index.d.ts +0 -19
  227. package/es/dialog/index.js +0 -14
  228. package/es/dialog/usePatchElement.d.ts +0 -5
  229. package/es/dialog/usePatchElement.js +0 -35
  230. package/es/editor/index.d.ts +0 -22
  231. package/es/editor/index.js +0 -18
  232. package/es/editor/index.less +0 -19
  233. package/es/editor/javascript.d.ts +0 -2
  234. package/es/editor/javascript.js +0 -56
  235. package/es/editor/json.d.ts +0 -7
  236. package/es/editor/json.js +0 -82
  237. package/es/editor/sql.d.ts +0 -2
  238. package/es/editor/sql.js +0 -54
  239. package/es/ellipsis/index.d.ts +0 -22
  240. package/es/ellipsis/index.js +0 -129
  241. package/es/ellipsis/index.less +0 -5
  242. package/es/ellipsis/useMeasure.d.ts +0 -9
  243. package/es/ellipsis/useMeasure.js +0 -142
  244. package/es/ellipsis/useResizeEffect.d.ts +0 -2
  245. package/es/ellipsis/useResizeEffect.js +0 -14
  246. package/es/ellipsis/withStopPropagation.d.ts +0 -4
  247. package/es/ellipsis/withStopPropagation.js +0 -38
  248. package/es/full-screen/index.d.ts +0 -3
  249. package/es/full-screen/index.js +0 -49
  250. package/es/group-form-item/index.d.ts +0 -11
  251. package/es/group-form-item/index.js +0 -124
  252. package/es/hooks/use-app.d.ts +0 -25
  253. package/es/hooks/use-app.js +0 -52
  254. package/es/hooks/use-event.d.ts +0 -10
  255. package/es/hooks/use-event.js +0 -69
  256. package/es/hooks/use-once-event.d.ts +0 -2
  257. package/es/hooks/use-once-event.js +0 -16
  258. package/es/hooks/use-page.d.ts +0 -10
  259. package/es/hooks/use-page.js +0 -10
  260. package/es/hooks/use-selection.d.ts +0 -17
  261. package/es/hooks/use-selection.js +0 -172
  262. package/es/hooks/use-tabs.d.ts +0 -2
  263. package/es/hooks/use-tabs.js +0 -10
  264. package/es/hooks/use-window.d.ts +0 -8
  265. package/es/hooks/use-window.js +0 -15
  266. package/es/index.d.ts +0 -37
  267. package/es/index.js +0 -37
  268. package/es/interval-button/index.d.ts +0 -14
  269. package/es/interval-button/index.js +0 -128
  270. package/es/layout-keep-alive/index.d.ts +0 -29
  271. package/es/layout-keep-alive/index.js +0 -400
  272. package/es/layout-keep-alive/index.less +0 -79
  273. package/es/layout-keep-alive/page.d.ts +0 -14
  274. package/es/layout-keep-alive/page.js +0 -53
  275. package/es/layout-single-page/index.d.ts +0 -14
  276. package/es/layout-single-page/index.js +0 -71
  277. package/es/layout-single-page/index.less +0 -15
  278. package/es/layout-single-page/page.d.ts +0 -13
  279. package/es/layout-single-page/page.js +0 -41
  280. package/es/loading/index.d.ts +0 -14
  281. package/es/loading/index.js +0 -43
  282. package/es/pro-grid/index.d.ts +0 -15
  283. package/es/pro-grid/index.js +0 -58
  284. package/es/pro-table/_utils.d.ts +0 -12
  285. package/es/pro-table/_utils.js +0 -94
  286. package/es/pro-table/form-item.d.ts +0 -9
  287. package/es/pro-table/form-item.js +0 -44
  288. package/es/pro-table/head.d.ts +0 -16
  289. package/es/pro-table/head.js +0 -225
  290. package/es/pro-table/index.d.ts +0 -23
  291. package/es/pro-table/index.js +0 -37
  292. package/es/pro-table/index.less +0 -82
  293. package/es/pro-table/operation.d.ts +0 -14
  294. package/es/pro-table/operation.js +0 -194
  295. package/es/pro-table/selection-alert.d.ts +0 -20
  296. package/es/pro-table/selection-alert.js +0 -64
  297. package/es/pro-table/size.d.ts +0 -10
  298. package/es/pro-table/size.js +0 -17
  299. package/es/pro-table/summary.d.ts +0 -8
  300. package/es/pro-table/summary.js +0 -32
  301. package/es/pro-table/table.d.ts +0 -104
  302. package/es/pro-table/table.js +0 -712
  303. package/es/pro-table/tree.d.ts +0 -24
  304. package/es/pro-table/tree.js +0 -197
  305. package/es/pro-tabs/index.d.ts +0 -9
  306. package/es/pro-tabs/index.js +0 -174
  307. package/es/resize-observer.d.ts +0 -15
  308. package/es/resize-observer.js +0 -37
  309. package/es/result/icon.d.ts +0 -3
  310. package/es/result/icon.js +0 -3
  311. package/es/result/index.d.ts +0 -12
  312. package/es/result/index.js +0 -68
  313. package/es/select/ modal.d.ts +0 -10
  314. package/es/select/ modal.js +0 -141
  315. package/es/select/api.d.ts +0 -25
  316. package/es/select/api.js +0 -67
  317. package/es/select/customize.d.ts +0 -25
  318. package/es/select/customize.js +0 -139
  319. package/es/select/index.d.ts +0 -31
  320. package/es/select/index.js +0 -108
  321. package/es/status-tag/index.d.ts +0 -13
  322. package/es/status-tag/index.js +0 -31
  323. package/es/table/index.d.ts +0 -19
  324. package/es/table/index.js +0 -253
  325. package/es/table/index.less +0 -29
  326. package/es/theme-dialog.d.ts +0 -28
  327. package/es/theme-dialog.js +0 -81
  328. package/es/time-picker/index.d.ts +0 -15
  329. package/es/time-picker/index.js +0 -49
  330. package/es/trigger/index.d.ts +0 -43
  331. package/es/trigger/index.js +0 -298
  332. package/es/trigger/index.less +0 -42
  333. package/es/types.d.ts +0 -0
  334. package/es/types.js +0 -0
  335. package/es/upload/index.d.ts +0 -42
  336. package/es/upload/index.js +0 -167
  337. package/es/upload/upload-image.d.ts +0 -6
  338. package/es/upload/upload-image.js +0 -205
  339. package/es/virtual-list/index.d.ts +0 -51
  340. package/es/virtual-list/index.js +0 -132
  341. package/es/water-mark/index.d.ts +0 -65
  342. package/es/water-mark/index.js +0 -141
  343. package/es/water-mark/relative.d.ts +0 -62
  344. package/es/water-mark/relative.js +0 -130
package/es/dialog/hook.js DELETED
@@ -1,234 +0,0 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- /* eslint-disable @typescript-eslint/ban-types */
12
- import CcsUtils from '@ccs-ui/utils';
13
- import _debounce from 'lodash.debounce';
14
- import React from 'react';
15
- import { createRoot } from 'react-dom/client';
16
- import { useCcsPage } from '..';
17
- import useAppConfig from "../hooks/use-app";
18
- import HookDrawer from "./HookDrawer";
19
- import HookModal from "./HookModal";
20
- import usePatchElement from "./usePatchElement";
21
-
22
- // Add `then` field for `ModalFunc` return instance.
23
- import { Fragment as _Fragment } from "react/jsx-runtime";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- // type CcsModalFuncType<TParams, TData> = (
26
- // config: CcsDialogModalProps<TParams, TData>,
27
- // ) => {
28
- // destroy: () => void;
29
- // update: (configUpdate: ModalFuncProps) => void;
30
- // };
31
-
32
- export var DialogElementsHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_props, ref) {
33
- var _usePatchElement = usePatchElement(),
34
- _usePatchElement2 = _slicedToArray(_usePatchElement, 2),
35
- elements = _usePatchElement2[0],
36
- patchElement = _usePatchElement2[1];
37
- React.useImperativeHandle(ref, function () {
38
- return {
39
- patchElement: patchElement
40
- };
41
- }, []);
42
- // eslint-disable-next-line react/jsx-no-useless-fragment
43
- return /*#__PURE__*/_jsx(_Fragment, {
44
- children: elements
45
- });
46
- }));
47
- var modalUuid = 0;
48
- var drawerUuid = 0;
49
- var destroyFns = [];
50
- export default function useCcsDialog() {
51
- var holderRef = React.useRef(null);
52
- var _React$useState = React.useState([]),
53
- _React$useState2 = _slicedToArray(_React$useState, 2),
54
- actionQueue = _React$useState2[0],
55
- setActionQueue = _React$useState2[1];
56
- var appConfig = useAppConfig() || {};
57
- var CcsPageContext = useCcsPage();
58
- var dialogHolderRef = CcsPageContext.dialogHolderRef || appConfig.dialogHolderRef;
59
- React.useEffect(function () {
60
- if (actionQueue.length) {
61
- var cloneQueue = _toConsumableArray(actionQueue);
62
- cloneQueue.forEach(function (action) {
63
- action();
64
- });
65
- setActionQueue([]);
66
- }
67
- }, [actionQueue]);
68
- var getModalFunc = React.useCallback(function (config) {
69
- modalUuid += 1;
70
- var modalRef = /*#__PURE__*/React.createRef();
71
-
72
- // 关闭事件
73
- var closeFunc;
74
- // modal
75
- var dialog = /*#__PURE__*/_jsx(HookModal, {
76
- config: config,
77
- afterClose: function afterClose() {
78
- var _closeFunc;
79
- (_closeFunc = closeFunc) === null || _closeFunc === void 0 || _closeFunc();
80
- },
81
- dialogRef: modalRef
82
- }, "modal-".concat(modalUuid));
83
-
84
- // 优先使用自定义contextHolder、其次使用全局contextHolder
85
- var $holderRef = holderRef.current ? holderRef : dialogHolderRef;
86
- if ($holderRef !== null && $holderRef !== void 0 && $holderRef.current) {
87
- // 加载了contextHolder
88
- closeFunc = $holderRef.current.patchElement(dialog);
89
- } else {
90
- CcsUtils.showWarning(false, "\u672A\u4F7F\u7528CssAppConfig\u5168\u5C40\u914D\u7F6E\u3001\u4E5F\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
91
- // 未加载contextHolder,创建dom
92
- var dialogEle = document.createElement('div');
93
- document.body.append(dialogEle);
94
- var root = createRoot(dialogEle);
95
- root.render( /*#__PURE__*/_jsx(_Fragment, {
96
- children: dialog
97
- }));
98
- closeFunc = function closeFunc() {
99
- setTimeout(function () {
100
- root.unmount();
101
- }, 500);
102
- };
103
- }
104
- if (closeFunc) {
105
- destroyFns.push(closeFunc);
106
- }
107
- var instance = {
108
- destroy: function destroy() {
109
- function destroyAction() {
110
- var _modalRef$current;
111
- (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || _modalRef$current.destroy();
112
- }
113
- if (modalRef.current) {
114
- destroyAction();
115
- } else {
116
- setActionQueue(function (prev) {
117
- return [].concat(_toConsumableArray(prev), [destroyAction]);
118
- });
119
- }
120
- },
121
- update: function update(newConfig) {
122
- function updateAction() {
123
- var _modalRef$current2;
124
- (_modalRef$current2 = modalRef.current) === null || _modalRef$current2 === void 0 || _modalRef$current2.update(newConfig);
125
- }
126
- if (modalRef.current) {
127
- updateAction();
128
- } else {
129
- setActionQueue(function (prev) {
130
- return [].concat(_toConsumableArray(prev), [updateAction]);
131
- });
132
- }
133
- }
134
- };
135
- return instance;
136
- }, []);
137
- var getDrawerFunc = React.useCallback(function (config) {
138
- drawerUuid += 1;
139
- var dialogRef = /*#__PURE__*/React.createRef();
140
- var closeFunc;
141
- var dialog = /*#__PURE__*/_jsx(HookDrawer, {
142
- config: config,
143
- afterClose: function afterClose() {
144
- var _closeFunc2;
145
- (_closeFunc2 = closeFunc) === null || _closeFunc2 === void 0 || _closeFunc2();
146
- },
147
- dialogRef: dialogRef
148
- }, "drawer-".concat(drawerUuid));
149
-
150
- // 优先使用自定义contextHolder、其次使用全局contextHolder
151
- var $holderRef = holderRef.current ? holderRef : dialogHolderRef;
152
- if ($holderRef !== null && $holderRef !== void 0 && $holderRef.current) {
153
- var _$holderRef$current;
154
- // 加载了contextHolder
155
- closeFunc = (_$holderRef$current = $holderRef.current) === null || _$holderRef$current === void 0 ? void 0 : _$holderRef$current.patchElement(dialog);
156
- } else {
157
- CcsUtils.showWarning(false, "\u672A\u4F7F\u7528CssAppConfig\u5168\u5C40\u914D\u7F6E\u3001\u4E5F\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
158
- // 未加载contextHolder,创建dom
159
- var dialogEle = document.createElement('div');
160
- document.body.append(dialogEle);
161
- var root = createRoot(dialogEle);
162
- root.render( /*#__PURE__*/_jsx(_Fragment, {
163
- children: dialog
164
- }));
165
- closeFunc = function closeFunc() {
166
- setTimeout(function () {
167
- root.unmount();
168
- }, 500);
169
- };
170
- }
171
- if (closeFunc) {
172
- destroyFns.push(closeFunc);
173
- }
174
- var instance = {
175
- destroy: function destroy() {
176
- function destroyAction() {
177
- var _dialogRef$current;
178
- (_dialogRef$current = dialogRef.current) === null || _dialogRef$current === void 0 || _dialogRef$current.destroy();
179
- }
180
- if (dialogRef.current) {
181
- destroyAction();
182
- } else {
183
- setActionQueue(function (prev) {
184
- return [].concat(_toConsumableArray(prev), [destroyAction]);
185
- });
186
- }
187
- },
188
- update: function update(newConfig) {
189
- function updateAction() {
190
- var _dialogRef$current2;
191
- (_dialogRef$current2 = dialogRef.current) === null || _dialogRef$current2 === void 0 || _dialogRef$current2.update(newConfig);
192
- }
193
- if (dialogRef.current) {
194
- updateAction();
195
- } else {
196
- setActionQueue(function (prev) {
197
- return [].concat(_toConsumableArray(prev), [updateAction]);
198
- });
199
- }
200
- }
201
- };
202
- return instance;
203
- }, []);
204
-
205
- // const resizeFn = _debounce((width: number) => {
206
- // if (tabRef.current) tabRef.current.style.maxWidth = `${width}px`;
207
- // }, 200);
208
-
209
- var fns = React.useMemo(function () {
210
- return {
211
- openModal: _debounce(function (props) {
212
- return getModalFunc(props);
213
- }, 500, {
214
- leading: true,
215
- trailing: false
216
- }),
217
- openDrawer: _debounce(function (props) {
218
- return getDrawerFunc(props);
219
- }, 500, {
220
- leading: true,
221
- trailing: false
222
- })
223
- };
224
- }, []);
225
- // return [fns, <ElementsHolder key="modal-holder" ref={holderRef} />] as const;
226
-
227
- return {
228
- openDrawer: fns.openDrawer,
229
- openModal: fns.openModal,
230
- contextHolder: /*#__PURE__*/_jsx(DialogElementsHolder, {
231
- ref: holderRef
232
- }, "modal-holder")
233
- };
234
- }
@@ -1,19 +0,0 @@
1
- import ThemeDialog from '../theme-dialog';
2
- import CcsDialogFooter from './button';
3
- import { useDialogContext } from './context';
4
- import CcsDrawerFooter from './drawer-footer';
5
- import useCcsDialog from './hook';
6
- type DialogInterface = {
7
- /** 获取openModal,openDrawer方法 */
8
- useDialog: typeof useCcsDialog;
9
- /** dialog 实例 */
10
- useInstance: typeof useDialogContext;
11
- /** dialog 按钮 */
12
- Buttons: typeof CcsDialogFooter;
13
- /** drawer footer */
14
- DrawerFooter: typeof CcsDrawerFooter;
15
- };
16
- declare const CcsDialog: typeof ThemeDialog & DialogInterface & {
17
- displayName?: string | undefined;
18
- };
19
- export default CcsDialog;
@@ -1,14 +0,0 @@
1
- import ThemeDialog from "../theme-dialog";
2
- import CcsDialogFooter from "./button";
3
- import { useDialogContext } from "./context";
4
- import CcsDrawerFooter from "./drawer-footer";
5
- import useCcsDialog from "./hook";
6
- var CcsDialog = ThemeDialog;
7
- CcsDialog.Buttons = CcsDialogFooter;
8
- CcsDialog.useDialog = useCcsDialog;
9
- CcsDialog.useInstance = useDialogContext;
10
- CcsDialog.DrawerFooter = CcsDrawerFooter;
11
- if (process.env.NODE_ENV !== 'production') {
12
- CcsDialog.displayName = 'CcsDialog';
13
- }
14
- export default CcsDialog;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export default function usePatchElement(): [
3
- React.ReactElement[],
4
- (element: React.ReactElement) => Function
5
- ];
@@ -1,35 +0,0 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- /* eslint-disable @typescript-eslint/ban-types */
12
- import * as React from 'react';
13
- export default function usePatchElement() {
14
- var _React$useState = React.useState([]),
15
- _React$useState2 = _slicedToArray(_React$useState, 2),
16
- elements = _React$useState2[0],
17
- setElements = _React$useState2[1];
18
- var patchElement = React.useCallback(function (element) {
19
- // append a new element to elements (and create a new ref)
20
- setElements(function (originElements) {
21
- return [].concat(_toConsumableArray(originElements), [element]);
22
- });
23
-
24
- // return a function that removes the new element out of elements (and create a new ref)
25
- // it works a little like useEffect
26
- return function () {
27
- setElements(function (originElements) {
28
- return originElements.filter(function (ele) {
29
- return ele !== element;
30
- });
31
- });
32
- };
33
- }, []);
34
- return [elements, patchElement];
35
- }
@@ -1,22 +0,0 @@
1
- import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
2
- import { PropsWithCss } from '../ccs';
3
- import './index.less';
4
- import JavaScriptEditor from './javascript';
5
- import JsonEditor from './json';
6
- import SqlEditor from './sql';
7
- export type EditorPropsType = PropsWithCss & Omit<ReactCodeMirrorProps, 'height'> & {
8
- value?: string;
9
- placeholder?: string;
10
- bordered?: boolean;
11
- isPreview?: boolean;
12
- height?: number | string;
13
- onChange?: (e: string) => void;
14
- };
15
- declare function Editor({}: {}): import("react/jsx-runtime").JSX.Element;
16
- declare namespace Editor {
17
- var Json: typeof JsonEditor;
18
- var Js: typeof JavaScriptEditor;
19
- var Sql: typeof SqlEditor;
20
- var displayName: string;
21
- }
22
- export default Editor;
@@ -1,18 +0,0 @@
1
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
2
- import "./index.less";
3
- import JavaScriptEditor from "./javascript";
4
- import JsonEditor from "./json";
5
- import SqlEditor from "./sql";
6
- import { Fragment as _Fragment } from "react/jsx-runtime";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- function Editor(_ref) {
9
- _objectDestructuringEmpty(_ref);
10
- return /*#__PURE__*/_jsx(_Fragment, {});
11
- }
12
- Editor.Json = JsonEditor;
13
- Editor.Js = JavaScriptEditor;
14
- Editor.Sql = SqlEditor;
15
- if (process.env.NODE_ENV !== 'production') {
16
- Editor.displayName = 'CcsEditor';
17
- }
18
- export default Editor;
@@ -1,19 +0,0 @@
1
- .ccs-editor {
2
- .cm-editor {
3
- outline: none !important;
4
-
5
- &:hover {
6
- outline: 1px solid rgb(200, 200, 200) !important;
7
- }
8
- }
9
- }
10
-
11
- .ccs-editor-preview {
12
- .cm-gutters {
13
- display: none;
14
- }
15
- /* stylelint-disable */
16
- .cm-activeLine {
17
- background: transparent;
18
- }
19
- }
@@ -1,2 +0,0 @@
1
- import { EditorPropsType } from '.';
2
- export default function JavaScriptEditor({ placeholder, height, bordered, isPreview, style, className, ...restProps }: EditorPropsType): import("react/jsx-runtime").JSX.Element;
@@ -1,56 +0,0 @@
1
- var _excluded = ["placeholder", "height", "bordered", "isPreview", "style", "className"];
2
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { javascript } from '@codemirror/lang-javascript';
11
- import CodeMirror from '@uiw/react-codemirror';
12
- import classNames from 'classnames';
13
- import useAppConfig from "../hooks/use-app";
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- export default function JavaScriptEditor(_ref) {
16
- var _ref$placeholder = _ref.placeholder,
17
- placeholder = _ref$placeholder === void 0 ? '请输入' : _ref$placeholder,
18
- _ref$height = _ref.height,
19
- height = _ref$height === void 0 ? '200px' : _ref$height,
20
- bordered = _ref.bordered,
21
- isPreview = _ref.isPreview,
22
- style = _ref.style,
23
- className = _ref.className,
24
- restProps = _objectWithoutProperties(_ref, _excluded);
25
- var _useAppConfig = useAppConfig(),
26
- theme = _useAppConfig.theme;
27
- var isDark = theme === 'dark';
28
- var styles = style || {};
29
- var previewProps = {};
30
- if (bordered !== false) {
31
- styles.border = '1px solid #d9d9d9';
32
- styles.borderRadius = 3;
33
- }
34
- if (isPreview) {
35
- styles.border = 0;
36
- previewProps.editable = false;
37
- previewProps.readOnly = true;
38
- previewProps.height = 'auto';
39
- previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
40
- lineNumbers: false
41
- });
42
- previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
43
- }
44
- var newHeight = typeof height === 'number' ? "".concat(height, "px") : height;
45
- return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
46
- height: newHeight,
47
- extensions: [javascript({
48
- jsx: true
49
- })],
50
- placeholder: placeholder,
51
- theme: isDark ? 'dark' : 'light'
52
- }, restProps), {}, {
53
- style: styles,
54
- className: classNames('ccs-editor', className)
55
- }, previewProps));
56
- }
@@ -1,7 +0,0 @@
1
- import { EditorPropsType } from '.';
2
- /**
3
- * JSON编辑器
4
- * @param {number} height - 高度
5
- * @param {string} placeholder - 占位
6
- */
7
- export default function JsonEditor({ value, placeholder, height, bordered, onChange, style, className, isPreview, ...restProps }: EditorPropsType): import("react/jsx-runtime").JSX.Element;
package/es/editor/json.js DELETED
@@ -1,82 +0,0 @@
1
- var _excluded = ["value", "placeholder", "height", "bordered", "onChange", "style", "className", "isPreview"];
2
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { json } from '@codemirror/lang-json';
11
- import { syntaxTree } from '@codemirror/language';
12
- import { linter } from '@codemirror/lint';
13
- import CodeMirror from '@uiw/react-codemirror';
14
- import classNames from 'classnames';
15
- import useAppConfig from "../hooks/use-app";
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- var regexpLinter = linter(function (view) {
18
- var diagnostics = [];
19
- syntaxTree(view.state).cursor().iterate(function (node) {
20
- if (node.name === '⚠') {
21
- diagnostics.push({
22
- from: node.from,
23
- to: node.to,
24
- severity: 'error',
25
- message: 'JSON错误'
26
- });
27
- }
28
- });
29
- return diagnostics;
30
- });
31
- var defaultPlaceholder = "JSON\u8F93\u5165\u793A\u4F8B\n{\n \"key\": 1,\n \"value\": \"..\"\n}";
32
-
33
- /**
34
- * JSON编辑器
35
- * @param {number} height - 高度
36
- * @param {string} placeholder - 占位
37
- */
38
- export default function JsonEditor(_ref) {
39
- var value = _ref.value,
40
- placeholder = _ref.placeholder,
41
- _ref$height = _ref.height,
42
- height = _ref$height === void 0 ? '200px' : _ref$height,
43
- bordered = _ref.bordered,
44
- _onChange = _ref.onChange,
45
- style = _ref.style,
46
- className = _ref.className,
47
- isPreview = _ref.isPreview,
48
- restProps = _objectWithoutProperties(_ref, _excluded);
49
- var _useAppConfig = useAppConfig(),
50
- theme = _useAppConfig.theme;
51
- var isDark = theme === 'dark';
52
- var styles = style || {};
53
- var previewProps = {};
54
- if (bordered !== false) {
55
- styles.border = '1px solid #d9d9d9';
56
- styles.borderRadius = 3;
57
- }
58
- if (isPreview) {
59
- styles.border = 0;
60
- previewProps.editable = false;
61
- previewProps.readOnly = true;
62
- previewProps.height = 'auto';
63
- previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
64
- lineNumbers: false
65
- });
66
- previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
67
- }
68
- var newHeight = typeof height === 'number' ? "".concat(height, "px") : height;
69
- return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
70
- value: value,
71
- height: newHeight,
72
- placeholder: placeholder || defaultPlaceholder,
73
- extensions: [json(), regexpLinter],
74
- onChange: function onChange(e) {
75
- if (_onChange) _onChange(e);
76
- },
77
- theme: isDark ? 'dark' : 'light'
78
- }, restProps), {}, {
79
- style: styles,
80
- className: classNames('ccs-editor', className)
81
- }, previewProps));
82
- }
@@ -1,2 +0,0 @@
1
- import { EditorPropsType } from '.';
2
- export default function SqlEditor({ placeholder, height, bordered, isPreview, style, className, ...restProps }: EditorPropsType): import("react/jsx-runtime").JSX.Element;
package/es/editor/sql.js DELETED
@@ -1,54 +0,0 @@
1
- var _excluded = ["placeholder", "height", "bordered", "isPreview", "style", "className"];
2
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { sql } from '@codemirror/lang-sql';
11
- import CodeMirror from '@uiw/react-codemirror';
12
- import classNames from 'classnames';
13
- import useAppConfig from "../hooks/use-app";
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- export default function SqlEditor(_ref) {
16
- var _ref$placeholder = _ref.placeholder,
17
- placeholder = _ref$placeholder === void 0 ? '请输入' : _ref$placeholder,
18
- _ref$height = _ref.height,
19
- height = _ref$height === void 0 ? '200px' : _ref$height,
20
- bordered = _ref.bordered,
21
- isPreview = _ref.isPreview,
22
- style = _ref.style,
23
- className = _ref.className,
24
- restProps = _objectWithoutProperties(_ref, _excluded);
25
- var _useAppConfig = useAppConfig(),
26
- theme = _useAppConfig.theme;
27
- var isDark = theme === 'dark';
28
- var styles = style || {};
29
- var previewProps = {};
30
- if (bordered !== false) {
31
- styles.border = '1px solid #d9d9d9';
32
- styles.borderRadius = 3;
33
- }
34
- if (isPreview) {
35
- styles.border = 0;
36
- previewProps.editable = false;
37
- previewProps.readOnly = true;
38
- previewProps.height = 'auto';
39
- previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
40
- lineNumbers: false
41
- });
42
- previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
43
- }
44
- var newHeight = typeof height === 'number' ? "".concat(height, "px") : height;
45
- return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
46
- height: newHeight,
47
- extensions: [sql()],
48
- placeholder: placeholder,
49
- theme: isDark ? 'dark' : 'light'
50
- }, restProps), {}, {
51
- style: styles,
52
- className: classNames('ccs-editor', className)
53
- }, previewProps));
54
- }
@@ -1,22 +0,0 @@
1
- import type { FC, ReactNode } from 'react';
2
- import React from 'react';
3
- import './index.less';
4
- import { PropagationEvent } from './withStopPropagation';
5
- export type EllipsisProps = {
6
- content: string;
7
- direction?: 'start' | 'end' | 'middle';
8
- rows?: number;
9
- expandText?: ReactNode;
10
- collapseText?: ReactNode;
11
- stopPropagationForActionButtons?: PropagationEvent[];
12
- onContentClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
13
- defaultExpanded?: boolean;
14
- showTooltip?: boolean;
15
- };
16
- /**
17
- * 文本缩略
18
- * @param EllipsisProps
19
- * @returns
20
- */
21
- declare const Ellipsis: FC<EllipsisProps>;
22
- export default Ellipsis;