@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
@@ -1,176 +0,0 @@
1
- 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); }
2
- var _excluded = ["auth", "hidden"],
3
- _excluded2 = ["key", "label", "auth", "confirm"],
4
- _excluded3 = ["key", "label", "disabled", "auth", "confirm"];
5
- 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; }
6
- 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; }
7
- 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; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
- 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); }
10
- 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; }
11
- 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; }
12
- /* eslint-disable @typescript-eslint/no-unused-vars */
13
- import { EllipsisOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
14
- import { Button, Divider, Dropdown, Space } from 'antd';
15
- import { useRef } from 'react';
16
- import { ModalConfirm } from '.';
17
- import { useCcsPage } from '..';
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- import { Fragment as _Fragment } from "react/jsx-runtime";
20
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
- export default function CssButtonGroup(_ref) {
22
- var size = _ref.size,
23
- isLink = _ref.isLink,
24
- showCount = _ref.showCount,
25
- moreIcon = _ref.moreIcon,
26
- moreText = _ref.moreText,
27
- _ref$items = _ref.items,
28
- items = _ref$items === void 0 ? [] : _ref$items,
29
- onClick = _ref.onClick;
30
- var _ref2 = useCcsPage() || {},
31
- onAuth = _ref2.onAuth;
32
- var modalRef = useRef(null);
33
-
34
- // 有权限的按钮
35
- var authButtons = [];
36
-
37
- // 变量按钮
38
- items.forEach(function (_ref3) {
39
- var auth = _ref3.auth,
40
- hidden = _ref3.hidden,
41
- item = _objectWithoutProperties(_ref3, _excluded);
42
- // 权限校验
43
- if (onAuth && auth && !onAuth(auth)) {
44
- return;
45
- }
46
- if (hidden) return;
47
- authButtons.push(item);
48
- });
49
- if (!authButtons || items.length === 0) return null;
50
-
51
- // 按钮点击
52
- var handleOnClick = function handleOnClick(key) {
53
- if (!onClick) return;
54
- var item = items.find(function (i) {
55
- return i.key === key;
56
- });
57
- if (item && item.confirm) {
58
- var _modalRef$current;
59
- (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || _modalRef$current.confirm({
60
- title: '操作确认',
61
- icon: /*#__PURE__*/_jsx(ExclamationCircleOutlined, {}),
62
- centered: true,
63
- content: item.confirm,
64
- okText: '确认',
65
- cancelText: '取消',
66
- onOk: function onOk() {
67
- return onClick === null || onClick === void 0 ? void 0 : onClick(key);
68
- }
69
- });
70
- return;
71
- }
72
- onClick(key);
73
- };
74
-
75
- // 显示的按钮
76
- var showBtns = authButtons.splice(0, showCount || items.length);
77
-
78
- // link类型按钮
79
- if (isLink) {
80
- return /*#__PURE__*/_jsxs(_Fragment, {
81
- children: [/*#__PURE__*/_jsx(Space, {
82
- split: /*#__PURE__*/_jsx(Divider, {
83
- type: "vertical",
84
- style: {
85
- margin: 0
86
- }
87
- }),
88
- children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (_ref4) {
89
- var key = _ref4.key,
90
- label = _ref4.label,
91
- auth = _ref4.auth,
92
- confirm = _ref4.confirm,
93
- restProps = _objectWithoutProperties(_ref4, _excluded2);
94
- return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
95
- style: {
96
- padding: 0
97
- }
98
- }, restProps), {}, {
99
- size: size,
100
- type: "link",
101
- onClick: function onClick() {
102
- return handleOnClick(key);
103
- },
104
- children: label
105
- }), key);
106
- })
107
- }), authButtons.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
108
- menu: {
109
- items: authButtons,
110
- onClick: function onClick(e) {
111
- return handleOnClick(e.key);
112
- }
113
- },
114
- children: /*#__PURE__*/_jsx(Button, {
115
- type: "link",
116
- icon: moreText ? null : moreIcon || /*#__PURE__*/_jsx(EllipsisOutlined, {}),
117
- size: "small",
118
- children: moreText
119
- })
120
- }), items.find(function (i) {
121
- return !!i.confirm;
122
- }) ? /*#__PURE__*/_jsx(ModalConfirm, {
123
- modalRef: modalRef
124
- }) : null]
125
- });
126
- }
127
- return /*#__PURE__*/_jsxs(_Fragment, {
128
- children: [/*#__PURE__*/_jsx(Space, {
129
- wrap: true,
130
- children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (_ref5, index) {
131
- var key = _ref5.key,
132
- label = _ref5.label,
133
- disabled = _ref5.disabled,
134
- auth = _ref5.auth,
135
- confirm = _ref5.confirm,
136
- restProps = _objectWithoutProperties(_ref5, _excluded3);
137
- // 更多按钮
138
- if (index === showBtns.length - 1 && authButtons.length > 0) {
139
- return /*#__PURE__*/_jsxs(Space.Compact, {
140
- children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, restProps), {}, {
141
- size: size,
142
- onClick: function onClick() {
143
- return handleOnClick(key);
144
- },
145
- disabled: disabled,
146
- children: label
147
- })), /*#__PURE__*/_jsx(Dropdown, {
148
- menu: {
149
- items: authButtons,
150
- onClick: function onClick(e) {
151
- return handleOnClick(e.key);
152
- }
153
- },
154
- children: /*#__PURE__*/_jsx(Button, {
155
- icon: moreText ? null : moreIcon || /*#__PURE__*/_jsx(EllipsisOutlined, {}),
156
- children: moreText
157
- })
158
- })]
159
- }, key);
160
- }
161
- return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, restProps), {}, {
162
- size: size,
163
- disabled: disabled,
164
- onClick: function onClick() {
165
- return handleOnClick(key);
166
- },
167
- children: label
168
- }), key);
169
- })
170
- }), items.find(function (i) {
171
- return !!i.confirm;
172
- }) ? /*#__PURE__*/_jsx(ModalConfirm, {
173
- modalRef: modalRef
174
- }) : null]
175
- });
176
- }
@@ -1,65 +0,0 @@
1
- import { ButtonProps } from 'antd';
2
- import { ItemType } from 'antd/es/menu/interface';
3
- import { DropDownProps } from 'antd/lib/dropdown';
4
- import { MenuInfo } from 'rc-menu/lib/interface';
5
- import { ReactNode } from 'react';
6
- import CCS from '..';
7
- import CssButtonDropdown from './dropdown';
8
- import CssButtonGroup from './group';
9
- type ChildrenType = React.ReactNode;
10
- export type DropdownMenuItemType = ItemType & {
11
- auth?: string;
12
- disabled?: boolean;
13
- children?: DropdownMenuItemType[];
14
- };
15
- export type CcsAuthDropdownProps = Omit<DropDownProps, 'overlay' | 'children'> & {
16
- /** 权限标识 */
17
- auth?: string;
18
- /** dropdown 菜单数据 */
19
- menus: DropdownMenuItemType[];
20
- /** 自定义显示内容 */
21
- children: ChildrenType;
22
- /** 点击事件 */
23
- onClick?: (info: MenuInfo) => void;
24
- };
25
- export type CcsButtonGroupProps = {
26
- /** 按钮尺寸 */
27
- size?: ButtonProps['size'];
28
- /** 默认显示按钮数量 */
29
- showCount?: number;
30
- /** 全部显示成link样式 */
31
- isLink?: boolean;
32
- /** 按钮数据 */
33
- items?: CCS.AuthButtonItem[];
34
- /** 更多icon */
35
- moreIcon?: ReactNode;
36
- /** 更多文字 */
37
- moreText?: string;
38
- /** 点击事件 */
39
- onClick?: (key: string) => void;
40
- };
41
- export declare function ModalConfirm({ modalRef }: {
42
- modalRef: any;
43
- }): import("react/jsx-runtime").JSX.Element;
44
- export type CcsAuthButtonProps = ButtonProps & {
45
- /** 权限标识 */
46
- auth?: string;
47
- /** 文本 */
48
- text?: string;
49
- /** 二次确认消息 */
50
- confirm?: string;
51
- /** 输入确认的值 */
52
- inputConfirm?: string;
53
- };
54
- /**
55
- * 带权限的按钮组件、继承Ant Button所有属性
56
- * @param CcsAuthButtonProps
57
- * @returns
58
- */
59
- declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, onClick, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
60
- declare namespace CcsButton {
61
- var displayName: string;
62
- var Group: typeof CssButtonGroup;
63
- var Dropdown: typeof CssButtonDropdown;
64
- }
65
- export default CcsButton;
@@ -1,133 +0,0 @@
1
- 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); }
2
- var _excluded = ["auth", "text", "confirm", "disabled", "inputConfirm", "onClick"];
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
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
- 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."); }
12
- 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); }
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
- 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; } }
15
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { ExclamationCircleOutlined } from '@ant-design/icons';
17
- import { Button, Input, Modal } from 'antd';
18
- import { useEffect, useRef } from 'react';
19
- import { useCcsPage } from '..';
20
- import CssButtonDropdown from "./dropdown";
21
- import CssButtonGroup from "./group";
22
- import { Fragment as _Fragment } from "react/jsx-runtime";
23
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- export function ModalConfirm(_ref) {
26
- var modalRef = _ref.modalRef;
27
- var _Modal$useModal = Modal.useModal(),
28
- _Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
29
- modal = _Modal$useModal2[0],
30
- contextHolder = _Modal$useModal2[1];
31
- useEffect(function () {
32
- modalRef.current = modal;
33
- }, []);
34
- return /*#__PURE__*/_jsxs(_Fragment, {
35
- children: [" ", contextHolder]
36
- });
37
- }
38
- /**
39
- * 带权限的按钮组件、继承Ant Button所有属性
40
- * @param CcsAuthButtonProps
41
- * @returns
42
- */
43
- function CcsButton(_ref2) {
44
- var auth = _ref2.auth,
45
- text = _ref2.text,
46
- confirm = _ref2.confirm,
47
- disabled = _ref2.disabled,
48
- inputConfirm = _ref2.inputConfirm,
49
- _onClick = _ref2.onClick,
50
- restProps = _objectWithoutProperties(_ref2, _excluded);
51
- var _ref3 = useCcsPage() || {},
52
- onAuth = _ref3.onAuth;
53
- var modalRef = useRef(null);
54
- var ref = useRef(null);
55
- var button = /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
56
- onClick: function onClick(e) {
57
- if (!_onClick) return;
58
- if (confirm) {
59
- var _modalRef$current;
60
- (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || _modalRef$current.confirm({
61
- title: '操作确认',
62
- icon: /*#__PURE__*/_jsx(ExclamationCircleOutlined, {}),
63
- centered: true,
64
- content: /*#__PURE__*/_jsxs(_Fragment, {
65
- children: [confirm, inputConfirm && /*#__PURE__*/_jsx(Input, {
66
- ref: ref,
67
- placeholder: "\u8BF7\u8F93\u5165",
68
- style: {
69
- marginTop: 5
70
- },
71
- onFocus: function onFocus() {
72
- var errorDom = document.getElementById('_inputConfirmError');
73
- if (errorDom) {
74
- errorDom.innerHTML = '';
75
- }
76
- }
77
- })]
78
- }),
79
- okText: '确认',
80
- cancelText: '取消',
81
- onOk: function onOk() {
82
- if (inputConfirm) {
83
- return new Promise(function (resolve, reject) {
84
- var _ref$current;
85
- if (((_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.input) === null || _ref$current === void 0 ? void 0 : _ref$current.value) === inputConfirm) {
86
- _onClick(e);
87
- resolve(true);
88
- } else {
89
- var errorDom = document.getElementById('_inputConfirmError');
90
- if (errorDom) {
91
- errorDom.innerHTML = '输入验证失败!';
92
- } else {
93
- var _ref$current2;
94
- (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || (_ref$current2 = _ref$current2.input) === null || _ref$current2 === void 0 || (_ref$current2 = _ref$current2.parentElement) === null || _ref$current2 === void 0 || _ref$current2.insertAdjacentHTML('beforeend', '<span id="_inputConfirmError" style="color:red">输入验证失败!</span>');
95
- }
96
- reject(false);
97
- }
98
- });
99
- }
100
- _onClick(e);
101
- }
102
- });
103
- return;
104
- }
105
- _onClick(e);
106
- },
107
- disabled: disabled,
108
- children: [text, restProps.children]
109
- }));
110
-
111
- // 不控制权限或没有传auth
112
- if (!auth) {
113
- return /*#__PURE__*/_jsxs(_Fragment, {
114
- children: [button, !!confirm ? /*#__PURE__*/_jsx(ModalConfirm, {
115
- modalRef: modalRef
116
- }) : null]
117
- });
118
- }
119
-
120
- // 当前菜单下查找按钮权限
121
- var hasAuth = onAuth && onAuth(auth);
122
- return /*#__PURE__*/_jsxs(_Fragment, {
123
- children: [hasAuth ? button : /*#__PURE__*/_jsx(_Fragment, {}), !!confirm ? /*#__PURE__*/_jsx(ModalConfirm, {
124
- modalRef: modalRef
125
- }) : null]
126
- });
127
- }
128
- if (process.env.NODE_ENV !== 'production') {
129
- CcsButton.displayName = 'CcsButton';
130
- }
131
- CcsButton.Group = CssButtonGroup;
132
- CcsButton.Dropdown = CssButtonDropdown;
133
- export default CcsButton;
@@ -1,33 +0,0 @@
1
- import { CascaderProps } from 'antd/lib';
2
- import CCS from '..';
3
- type CacheType = {
4
- /** 缓存key,同一个key将共享数据 */
5
- cacheKey?: string;
6
- /** 设置数据保持新鲜时间,在该时间内,我们认为数据是新鲜的,不会重新发起请求 */
7
- staleTime?: number;
8
- /** 设置数据缓存时间,超过该时间,我们会清空该条缓存数据 */
9
- cacheTime?: number;
10
- };
11
- type ApiCascaderProps = Omit<CascaderProps, 'fieldNames'> & {
12
- cache?: CacheType;
13
- /** 依赖参数 */
14
- defaultParams?: CCS.RecordType;
15
- /** 接口数据字段 */
16
- fieldNames?: {
17
- label?: string[] | string;
18
- value?: string[] | string;
19
- children?: string[] | string;
20
- };
21
- /** 查询请求 */
22
- request?: (params?: any) => Promise<any>;
23
- };
24
- /**
25
- * 基于接口查询的select组件
26
- * @param CcsSelectProps
27
- * @returns
28
- */
29
- declare function ApiCascader({ request, cache, fieldNames, defaultParams, ...restProps }: ApiCascaderProps): import("react/jsx-runtime").JSX.Element;
30
- declare namespace ApiCascader {
31
- var displayName: string;
32
- }
33
- export default ApiCascader;
@@ -1,120 +0,0 @@
1
- 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); }
2
- var _excluded = ["request", "cache", "fieldNames", "defaultParams"];
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
- 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."); }
13
- 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); }
14
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
- 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; }
17
- 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; }
18
- 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; }
19
- import { useRequest } from 'ahooks';
20
- import { Cascader } from 'antd';
21
- import { useEffect } from 'react';
22
- import { getDataByNamePath } from "../select";
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- function onIsArray(data) {
25
- if (Array.isArray(data)) return data;
26
- return [data];
27
- }
28
-
29
- /**
30
- * 基于接口查询的select组件
31
- * @param CcsSelectProps
32
- * @returns
33
- */
34
- function ApiCascader(_ref) {
35
- var request = _ref.request,
36
- cache = _ref.cache,
37
- fieldNames = _ref.fieldNames,
38
- _ref$defaultParams = _ref.defaultParams,
39
- defaultParams = _ref$defaultParams === void 0 ? {} : _ref$defaultParams,
40
- restProps = _objectWithoutProperties(_ref, _excluded);
41
- var labelField = _toConsumableArray(onIsArray((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || ['data', 'label']));
42
- var valueField = _toConsumableArray(onIsArray((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || ['data', 'value']));
43
- var childrenField = _toConsumableArray(onIsArray((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || ['data', 'children']));
44
- var _useRequest = useRequest( /*#__PURE__*/function () {
45
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
46
- var result, value;
47
- return _regeneratorRuntime().wrap(function _callee$(_context) {
48
- while (1) switch (_context.prev = _context.next) {
49
- case 0:
50
- if (request) {
51
- _context.next = 2;
52
- break;
53
- }
54
- return _context.abrupt("return", []);
55
- case 2:
56
- _context.next = 4;
57
- return request(params);
58
- case 4:
59
- result = _context.sent;
60
- case 5:
61
- if (!(labelField.length > 0 || valueField.length > 0)) {
62
- _context.next = 15;
63
- break;
64
- }
65
- if (!Array.isArray(result)) {
66
- _context.next = 9;
67
- break;
68
- }
69
- result.forEach(function (r) {
70
- r.label = getDataByNamePath(r, labelField);
71
- r.value = getDataByNamePath(r, valueField);
72
- r.children = getDataByNamePath(r, childrenField);
73
- });
74
- return _context.abrupt("break", 15);
75
- case 9:
76
- labelField.shift();
77
- childrenField.shift();
78
- value = valueField.shift();
79
- if (value) {
80
- result = result[value];
81
- }
82
- _context.next = 5;
83
- break;
84
- case 15:
85
- return _context.abrupt("return", result);
86
- case 16:
87
- case "end":
88
- return _context.stop();
89
- }
90
- }, _callee);
91
- }));
92
- return function (_x) {
93
- return _ref2.apply(this, arguments);
94
- };
95
- }(), _objectSpread({
96
- manual: true
97
- }, cache || {})),
98
- loading = _useRequest.loading,
99
- _useRequest$data = _useRequest.data,
100
- data = _useRequest$data === void 0 ? [] : _useRequest$data,
101
- run = _useRequest.run;
102
- useEffect(function () {
103
- if (request) run(defaultParams);
104
- }, [JSON.stringify(defaultParams)]);
105
- return (
106
- /*#__PURE__*/
107
- // @ts-ignore
108
- _jsx(Cascader, _objectSpread({
109
- options: data,
110
- loading: loading,
111
- style: {
112
- width: '100%'
113
- }
114
- }, restProps))
115
- );
116
- }
117
- if (process.env.NODE_ENV !== 'production') {
118
- ApiCascader.displayName = 'CcsApiCascader';
119
- }
120
- export default ApiCascader;